From 6c47e7d5da028f171def976b0702413eb0ad95a1 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 22 Jul 2025 22:04:23 +0200 Subject: [PATCH 1/6] treewide: fix syntax errors in nix code blocks Fixes all code blocks with "nix" language in markdown files for syntax errors to be able to run nixfmt in the next step. --- .../administration/service-mgmt.chapter.md | 18 +- .../adding-custom-packages.section.md | 2 +- .../configuration/mattermost.chapter.md | 2 +- .../manual/configuration/user-mgmt.chapter.md | 8 +- .../testing-hardware-features.section.md | 193 +++++++++--------- ...s-via-nixos-rebuild-build-image.chapter.md | 2 + .../manual/release-notes/rl-2405.section.md | 8 +- .../manual/release-notes/rl-2411.section.md | 38 ++-- .../manual/release-notes/rl-2505.section.md | 26 ++- .../modules/services/databases/postgresql.md | 62 +++--- nixos/modules/services/misc/paisa.md | 4 +- nixos/modules/services/monitoring/glances.md | 2 +- .../modules/services/networking/crab-hole.md | 2 +- .../modules/services/networking/jotta-cli.md | 12 +- .../services/networking/netbird/server.md | 48 ++--- .../modules/services/networking/pihole-ftl.md | 21 +- .../system/kerberos/kerberos-server.md | 2 +- nixos/modules/services/web-apps/nextcloud.md | 8 +- nixos/modules/services/web-apps/szurubooru.md | 4 +- .../k3s/docs/examples/EXTERNAL_CONTAINERD.md | 32 +-- pkgs/by-name/README.md | 11 +- pkgs/by-name/az/azure-cli/README.md | 6 +- .../custom-components/README.md | 3 +- 23 files changed, 282 insertions(+), 232 deletions(-) diff --git a/nixos/doc/manual/administration/service-mgmt.chapter.md b/nixos/doc/manual/administration/service-mgmt.chapter.md index 8b64e4823c6e..375e4dc7d504 100644 --- a/nixos/doc/manual/administration/service-mgmt.chapter.md +++ b/nixos/doc/manual/administration/service-mgmt.chapter.md @@ -126,17 +126,19 @@ in turn will not make the service / timer start on login. You can define services by adding them to `systemd.services`: ```nix -systemd.services.myservice = { - after = [ "network-online.target" ]; - requires = [ "network-online.target" ]; +{ + systemd.services.myservice = { + after = [ "network-online.target" ]; + requires = [ "network-online.target" ]; - before = [ "multi-user.target" ]; - wantedBy = [ "multi-user.target" ]; + before = [ "multi-user.target" ]; + wantedBy = [ "multi-user.target" ]; - serviceConfig = { - ExecStart = "..."; + serviceConfig = { + ExecStart = "..."; + }; }; -}; +} ``` If you want to specify a multi-line script for `ExecStart`, diff --git a/nixos/doc/manual/configuration/adding-custom-packages.section.md b/nixos/doc/manual/configuration/adding-custom-packages.section.md index f2012d9c2462..abb2f9cc31ea 100644 --- a/nixos/doc/manual/configuration/adding-custom-packages.section.md +++ b/nixos/doc/manual/configuration/adding-custom-packages.section.md @@ -111,7 +111,7 @@ If there are shared libraries missing add them with extraPkgs = pkgs: [ # missing libraries here, e.g.: `pkgs.libepoxy` ]; - } + }; } ``` diff --git a/nixos/doc/manual/configuration/mattermost.chapter.md b/nixos/doc/manual/configuration/mattermost.chapter.md index f247134ce49a..801475ce5a15 100644 --- a/nixos/doc/manual/configuration/mattermost.chapter.md +++ b/nixos/doc/manual/configuration/mattermost.chapter.md @@ -33,7 +33,7 @@ To enable Mattermost using Postgres, use a config like this: # For example, to disable auto-installation of prepackaged plugins. settings.PluginSettings.AutomaticPrepackagedPlugins = false; - } + }; } ``` diff --git a/nixos/doc/manual/configuration/user-mgmt.chapter.md b/nixos/doc/manual/configuration/user-mgmt.chapter.md index 89604941bf11..3f490bb68d26 100644 --- a/nixos/doc/manual/configuration/user-mgmt.chapter.md +++ b/nixos/doc/manual/configuration/user-mgmt.chapter.md @@ -137,7 +137,9 @@ the Perl script. It aims to eventually replace the Perl script by default. You can enable Userborn via: ```nix -services.userborn.enable = true; +{ + services.userborn.enable = true; +} ``` You can configure Userborn to store the password files @@ -145,7 +147,9 @@ You can configure Userborn to store the password files location to `/etc`: ```nix -services.userborn.passwordFilesLocation = "/persistent/etc"; +{ + services.userborn.passwordFilesLocation = "/persistent/etc"; +} ``` This is useful when you store `/etc` on a `tmpfs` or if `/etc` is immutable diff --git a/nixos/doc/manual/development/testing-hardware-features.section.md b/nixos/doc/manual/development/testing-hardware-features.section.md index aaf652d731f7..f90880830a9a 100644 --- a/nixos/doc/manual/development/testing-hardware-features.section.md +++ b/nixos/doc/manual/development/testing-hardware-features.section.md @@ -22,25 +22,27 @@ You can run `vwifi-ctrl` on this node to control characteristics of the simulate physical layer. ```nix -airgap = - { config, ... }: - { - networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ - { - address = "192.168.1.2"; - prefixLength = 24; - } - ]; - services.vwifi = { - server = { - enable = true; - ports.tcp = 8212; - # uncomment if you want to enable monitor mode on another node - # ports.spy = 8213; - openFirewall = true; +{ + airgap = + { config, ... }: + { + networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ + { + address = "192.168.1.2"; + prefixLength = 24; + } + ]; + services.vwifi = { + server = { + enable = true; + ports.tcp = 8212; + # uncomment if you want to enable monitor mode on another node + # ports.spy = 8213; + openFirewall = true; + }; }; }; - }; +} ``` ### AP {#sec-nixos-test-wifi-ap} @@ -48,40 +50,42 @@ airgap = A node like this will act as a wireless access point in infrastructure mode. ```nix -ap = - { config, ... }: - { - networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ - { - address = "192.168.1.3"; - prefixLength = 24; - } - ]; - services.hostapd = { - enable = true; - radios.wlan0 = { - channel = 1; - networks.wlan0 = { - ssid = "NixOS Test Wi-Fi Network"; - authentication = { - mode = "wpa3-sae"; - saePasswords = [ { password = "supersecret"; } ]; - enableRecommendedPairwiseCiphers = true; +{ + ap = + { config, ... }: + { + networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ + { + address = "192.168.1.3"; + prefixLength = 24; + } + ]; + services.hostapd = { + enable = true; + radios.wlan0 = { + channel = 1; + networks.wlan0 = { + ssid = "NixOS Test Wi-Fi Network"; + authentication = { + mode = "wpa3-sae"; + saePasswords = [ { password = "supersecret"; } ]; + enableRecommendedPairwiseCiphers = true; + }; }; }; }; - }; - services.vwifi = { - module = { - enable = true; - macPrefix = "74:F8:F6:00:01"; - }; - client = { - enable = true; - serverAddress = "192.168.1.2"; + services.vwifi = { + module = { + enable = true; + macPrefix = "74:F8:F6:00:01"; + }; + client = { + enable = true; + serverAddress = "192.168.1.2"; + }; }; }; - }; +} ``` ### Station {#sec-nixos-test-wifi-station} @@ -89,37 +93,39 @@ ap = A node like this acts as a wireless client. ```nix -station = - { config, ... }: - { - networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ - { - address = "192.168.1.3"; - prefixLength = 24; - } - ]; - networking.wireless = { - # No, really, we want it enabled! - enable = lib.mkOverride 0 true; - interfaces = [ "wlan0" ]; - networks = { - "NixOS Test Wi-Fi Network" = { - psk = "supersecret"; - authProtocols = [ "SAE" ]; +{ + station = + { config, ... }: + { + networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ + { + address = "192.168.1.3"; + prefixLength = 24; + } + ]; + networking.wireless = { + # No, really, we want it enabled! + enable = lib.mkOverride 0 true; + interfaces = [ "wlan0" ]; + networks = { + "NixOS Test Wi-Fi Network" = { + psk = "supersecret"; + authProtocols = [ "SAE" ]; + }; + }; + }; + services.vwifi = { + module = { + enable = true; + macPrefix = "74:F8:F6:00:02"; + }; + client = { + enable = true; + serverAddress = "192.168.1.2"; }; }; }; - services.vwifi = { - module = { - enable = true; - macPrefix = "74:F8:F6:00:02"; - }; - client = { - enable = true; - serverAddress = "192.168.1.2"; - }; - }; - }; +} ``` ### Monitor {#sec-nixos-test-wifi-monitor} @@ -128,25 +134,28 @@ When the monitor mode interface is enabled, this node will receive all packets broadcast by all other nodes through the spy interface. ```nix -monitor = - { config, ... }: - { - networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ - { - address = "192.168.1.4"; - prefixLength = 24; - } - ]; +{ + monitor = + { config, ... }: + { + networking.interfaces.eth1.ipv4.addresses = lib.mkForce [ + { + address = "192.168.1.4"; + prefixLength = 24; + } + ]; - services.vwifi = { - module = { - enable = true; - macPrefix = "74:F8:F6:00:03"; - }; - client = { - enable = true; - spy = true; - serverAddress = "192.168.1.2"; + services.vwifi = { + module = { + enable = true; + macPrefix = "74:F8:F6:00:03"; + }; + client = { + enable = true; + spy = true; + serverAddress = "192.168.1.2"; + }; }; }; +} ``` diff --git a/nixos/doc/manual/installation/building-images-via-nixos-rebuild-build-image.chapter.md b/nixos/doc/manual/installation/building-images-via-nixos-rebuild-build-image.chapter.md index 075a8fca3bbb..9b18bf895ad1 100644 --- a/nixos/doc/manual/installation/building-images-via-nixos-rebuild-build-image.chapter.md +++ b/nixos/doc/manual/installation/building-images-via-nixos-rebuild-build-image.chapter.md @@ -25,7 +25,9 @@ The `image.modules` option can be used to set specific options per image variant E.g. images for the cloud provider Linode use `grub2` as a bootloader by default. If you are using `systemd-boot` on other platforms and want to disable it for Linode only, you could use the following options: ``` nix +{ image.modules.linode = { boot.loader.systemd-boot.enable = lib.mkForce false; }; +} ``` diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index b11f36719035..799d9eb62a74 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -243,9 +243,11 @@ The pre-existing `services.ankisyncd` has been marked deprecated and will be dro - `azure-cli` now has extension support. For example, to install the `aks-preview` extension, use ```nix - environment.systemPackages = [ - (azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]) - ]; + { + environment.systemPackages = [ + (azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]) + ]; + } ``` To make the `azure-cli` immutable and prevent clashes in case `azure-cli` is also installed via other package managers, some configuration files were moved into the derivation. This can be disabled by overriding `withImmutableConfig = false` when building `azure-cli`. diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index fc335a19f4ef..3361b46d5e64 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -615,8 +615,10 @@ Then, follow the instructions on the [upstream release notes](https://github.com/majewsky/portunus/releases/tag/v2.0.0) to upgrade all existing user accounts to strong password hashes. If you need to upgrade to 24.11 without having completed the migration, consider the security implications of weak password hashes on your user accounts, and add the following to your configuration: ```nix - services.portunus.package = pkgs.portunus.override { libxcrypt = pkgs.libxcrypt-legacy; }; - services.portunus.ldap.package = pkgs.openldap.override { libxcrypt = pkgs.libxcrypt-legacy; }; + { + services.portunus.package = pkgs.portunus.override { libxcrypt = pkgs.libxcrypt-legacy; }; + services.portunus.ldap.package = pkgs.openldap.override { libxcrypt = pkgs.libxcrypt-legacy; }; + } ``` - The default value of `services.kubernetes.kubelet.hostname` is now lowercased. @@ -956,24 +958,26 @@ If you set `sound.mediaKeys` in your configuration: - If you want to maintain the exact behavior of the option, use the following snippet ```nix -services.actkbd = let - volumeStep = "1%"; -in { - enable = true; - bindings = [ - # "Mute" media key - { keys = [ 113 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Master toggle"; } +{ + services.actkbd = let + volumeStep = "1%"; + in { + enable = true; + bindings = [ + # "Mute" media key + { keys = [ 113 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Master toggle"; } - # "Lower Volume" media key - { keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}- unmute"; } + # "Lower Volume" media key + { keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}- unmute"; } - # "Raise Volume" media key - { keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}+ unmute"; } + # "Raise Volume" media key + { keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}+ unmute"; } - # "Mic Mute" media key - { keys = [ 190 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Capture toggle"; } - ]; -}; + # "Mic Mute" media key + { keys = [ 190 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Capture toggle"; } + ]; + }; +} ``` ### `hardware.deviceTree.overlays` compatible string matching {#sec-release-24.11-migration-dto-compatible} diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 694c8caadb2c..ede104f80212 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -355,10 +355,12 @@ Alongside many enhancements to NixOS modules and general system improvements, th - To avoid delaying user logins unnecessarily the `multi-user.target` is no longer ordered after `network-online.target`. System services requiring a connection to start correctly must explicitly state so, i.e. ```nix - systemd.services. = { - wants = [ "network-online.target" ]; - after = [ "network-online.target" ]; - }; + { + systemd.services."" = { + wants = [ "network-online.target" ]; + after = [ "network-online.target" ]; + }; + } ``` This changed follows a deprecation period of one year started in NixOS 24.05 (see [PR #283818](https://github.com/NixOS/nixpkgs/pull/283818)). @@ -457,15 +459,17 @@ Alongside many enhancements to NixOS modules and general system improvements, th Example: ```nix - services.mysql = { - enable = true; - galeraCluster = { + { + services.mysql = { enable = true; - localName = "Node 1"; - localAddress = "galera_01"; - nodeAddresses = [ "galera_01" "galera_02" "galera_03"]; + galeraCluster = { + enable = true; + localName = "Node 1"; + localAddress = "galera_01"; + nodeAddresses = [ "galera_01" "galera_02" "galera_03"]; + }; }; - }; + } ``` - systemd's {manpage}`systemd-ssh-generator(8)` now works out of the box on NixOS. diff --git a/nixos/modules/services/databases/postgresql.md b/nixos/modules/services/databases/postgresql.md index fbff43290529..4bbddf1bbc42 100644 --- a/nixos/modules/services/databases/postgresql.md +++ b/nixos/modules/services/databases/postgresql.md @@ -94,13 +94,13 @@ database migrations. `ensureUsers` is run in `postgresql-setup`, so this is where `postStart` must be added to: ```nix - { - systemd.services.postgresql-setup.postStart = '' - psql service1 -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"' - psql service1 -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"' - # .... - ''; - } +{ + systemd.services.postgresql-setup.postStart = '' + psql service1 -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"' + psql service1 -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"' + # .... + ''; +} ``` #### in intermediate oneshot service {#module-services-postgres-initializing-extra-permissions-superuser-oneshot} @@ -114,22 +114,22 @@ They differ in two aspects: Both can lead to unexpected errors either during initial database creation or restore, when using `postgresql.service`. ```nix - { - systemd.services."migrate-service1-db1" = { - serviceConfig.Type = "oneshot"; - requiredBy = "service1.service"; - before = "service1.service"; - after = "postgresql.target"; - serviceConfig.User = "postgres"; - environment.PGPORT = toString services.postgresql.settings.port; - path = [ postgresql ]; - script = '' - psql service1 -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"' - psql service1 -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"' - # .... - ''; - }; - } +{ + systemd.services."migrate-service1-db1" = { + serviceConfig.Type = "oneshot"; + requiredBy = "service1.service"; + before = "service1.service"; + after = "postgresql.target"; + serviceConfig.User = "postgres"; + environment.PGPORT = toString services.postgresql.settings.port; + path = [ postgresql ]; + script = '' + psql service1 -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO "extraUser1"' + psql service1 -c 'GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO "extraUser1"' + # .... + ''; + }; +} ``` ## Authentication {#module-services-postgres-authentication} @@ -147,13 +147,15 @@ Assume that your app creates a role `admin` and you want the `root` user to be a You can then use [](#opt-services.postgresql.identMap) to define the map and [](#opt-services.postgresql.authentication) to enable it: ```nix -services.postgresql = { - identMap = '' - admin root admin - ''; - authentication = '' - local all admin peer map=admin - ''; +{ + services.postgresql = { + identMap = '' + admin root admin + ''; + authentication = '' + local all admin peer map=admin + ''; + }; } ``` diff --git a/nixos/modules/services/misc/paisa.md b/nixos/modules/services/misc/paisa.md index 3d9878dd50af..e16b52cbcdb6 100644 --- a/nixos/modules/services/misc/paisa.md +++ b/nixos/modules/services/misc/paisa.md @@ -21,7 +21,9 @@ configure this in the module, but you can e.g. use systemd to give the unit access to the command at runtime. ```nix -systemd.services.paisa.path = [ pkgs.hledger ]; +{ + systemd.services.paisa.path = [ pkgs.hledger ]; +} ``` ::: {.note} diff --git a/nixos/modules/services/monitoring/glances.md b/nixos/modules/services/monitoring/glances.md index 69554b6bc5e4..071b2480ec2c 100644 --- a/nixos/modules/services/monitoring/glances.md +++ b/nixos/modules/services/monitoring/glances.md @@ -16,5 +16,5 @@ Use the following configuration to start a public instance of Glances locally: enable = true; openFirewall = true; }; -}; +} ``` diff --git a/nixos/modules/services/networking/crab-hole.md b/nixos/modules/services/networking/crab-hole.md index a89a62fa0509..52a452b91545 100644 --- a/nixos/modules/services/networking/crab-hole.md +++ b/nixos/modules/services/networking/crab-hole.md @@ -103,7 +103,7 @@ Additionally you can set an optional timeout value. certificate = ./dns.example.com.crt; key = "/dns.example.com.key"; # optional (default = 3000) - timeout_ms = 3000 + timeout_ms = 3000; } ]; } diff --git a/nixos/modules/services/networking/jotta-cli.md b/nixos/modules/services/networking/jotta-cli.md index 335e5c8e3856..d5629465377d 100644 --- a/nixos/modules/services/networking/jotta-cli.md +++ b/nixos/modules/services/networking/jotta-cli.md @@ -15,11 +15,13 @@ This adds `jotta-cli` to `environment.systemPackages` and starts a user service ## Example Configuration {#module-services-jotta-cli-example-configuration} ```nix -services.jotta-cli = { - enable = true; - options = [ "slow" ]; - package = pkgs.jotta-cli; -}; +{ + services.jotta-cli = { + enable = true; + options = [ "slow" ]; + package = pkgs.jotta-cli; + }; +} ``` This uses `jotta-cli` and `jottad` from the `pkgs.jotta-cli` package and starts `jottad` in low memory mode. diff --git a/nixos/modules/services/networking/netbird/server.md b/nixos/modules/services/networking/netbird/server.md index 3649e97b379e..1de251b80109 100644 --- a/nixos/modules/services/networking/netbird/server.md +++ b/nixos/modules/services/networking/netbird/server.md @@ -9,34 +9,36 @@ To fully setup Netbird as a self-hosted server, we need both a Coturn server and There are quite a few settings that need to be passed to Netbird for it to function, and a minimal config looks like : ```nix -services.netbird.server = { - enable = true; - - domain = "netbird.example.selfhosted"; - - enableNginx = true; - - coturn = { +{ + services.netbird.server = { enable = true; - passwordFile = "/path/to/a/secret/password"; - }; + domain = "netbird.example.selfhosted"; - management = { - oidcConfigEndpoint = "https://sso.example.selfhosted/oauth2/openid/netbird/.well-known/openid-configuration"; + enableNginx = true; - settings = { - TURNConfig = { - Turns = [ - { - Proto = "udp"; - URI = "turn:netbird.example.selfhosted:3478"; - Username = "netbird"; - Password._secret = "/path/to/a/secret/password"; - } - ]; + coturn = { + enable = true; + + passwordFile = "/path/to/a/secret/password"; + }; + + management = { + oidcConfigEndpoint = "https://sso.example.selfhosted/oauth2/openid/netbird/.well-known/openid-configuration"; + + settings = { + TURNConfig = { + Turns = [ + { + Proto = "udp"; + URI = "turn:netbird.example.selfhosted:3478"; + Username = "netbird"; + Password._secret = "/path/to/a/secret/password"; + } + ]; + }; }; }; }; -}; +} ``` diff --git a/nixos/modules/services/networking/pihole-ftl.md b/nixos/modules/services/networking/pihole-ftl.md index 0f79fd6101c4..3d49f640c805 100644 --- a/nixos/modules/services/networking/pihole-ftl.md +++ b/nixos/modules/services/networking/pihole-ftl.md @@ -99,17 +99,16 @@ to configure additional interfaces with different configuration, use { services.pihole-ftl = { settings.misc.dnsmasq_lines = [ - # Specify the secondary interface - "interface=enp1s0" - # A different device is the router on this network, e.g. the one - # provided by your ISP - "dhcp-option=enp1s0,option:router,192.168.0.1" - # Specify the IPv4 ranges to allocate, with a 1-day lease time - "dhcp-range=enp1s0,192.168.0.10,192.168.0.253,1d" - # Enable IPv6 - "dhcp-range=::f,::ff,constructor:enp1s0,ra-names,ra-stateless" - ]; - }; + # Specify the secondary interface + "interface=enp1s0" + # A different device is the router on this network, e.g. the one + # provided by your ISP + "dhcp-option=enp1s0,option:router,192.168.0.1" + # Specify the IPv4 ranges to allocate, with a 1-day lease time + "dhcp-range=enp1s0,192.168.0.10,192.168.0.253,1d" + # Enable IPv6 + "dhcp-range=::f,::ff,constructor:enp1s0,ra-names,ra-stateless" + ]; }; } ``` diff --git a/nixos/modules/services/system/kerberos/kerberos-server.md b/nixos/modules/services/system/kerberos/kerberos-server.md index 80c71be1541e..ba3b1057f382 100644 --- a/nixos/modules/services/system/kerberos/kerberos-server.md +++ b/nixos/modules/services/system/kerberos/kerberos-server.md @@ -24,7 +24,7 @@ To enable a Kerberos server: admin_server = "kerberos.example.com"; }; }; - } + }; services.kerberos-server = { enable = true; diff --git a/nixos/modules/services/web-apps/nextcloud.md b/nixos/modules/services/web-apps/nextcloud.md index b497562224a0..3ae19e1f8ad5 100644 --- a/nixos/modules/services/web-apps/nextcloud.md +++ b/nixos/modules/services/web-apps/nextcloud.md @@ -208,7 +208,9 @@ release notes when upgrading. the cache size to zero: ```nix - services.nextcloud.phpOptions."realpath_cache_size" = "0"; + { + services.nextcloud.phpOptions."realpath_cache_size" = "0"; + } ``` - **Empty Files on chunked uploads** @@ -286,9 +288,9 @@ that are managed by Nix: ```nix { config, pkgs, ... }: { - services.nextcloud.extraApps = with config.services.nextcloud.package.packages.apps; [ + services.nextcloud.extraApps = with config.services.nextcloud.package.packages.apps; { inherit user_oidc calendar contacts; - ]; + }; } ``` diff --git a/nixos/modules/services/web-apps/szurubooru.md b/nixos/modules/services/web-apps/szurubooru.md index 368fe608d450..29c5caf42895 100644 --- a/nixos/modules/services/web-apps/szurubooru.md +++ b/nixos/modules/services/web-apps/szurubooru.md @@ -40,10 +40,10 @@ The prefered method to run this service is behind a reverse proxy not to expose server = { port = 8080; - ... + # ... }; - ... + # ... }; services.nginx.virtualHosts."szurubooru.domain.tld" = { diff --git a/pkgs/applications/networking/cluster/k3s/docs/examples/EXTERNAL_CONTAINERD.md b/pkgs/applications/networking/cluster/k3s/docs/examples/EXTERNAL_CONTAINERD.md index 7a6d9859ee50..3839d5c0ec75 100644 --- a/pkgs/applications/networking/cluster/k3s/docs/examples/EXTERNAL_CONTAINERD.md +++ b/pkgs/applications/networking/cluster/k3s/docs/examples/EXTERNAL_CONTAINERD.md @@ -6,26 +6,30 @@ containerd. This can be done in a few lines of configuration. ## Configure Containerd ```nix -virtualisation.containerd = { - enable = true; - settings.plugins."io.containerd.grpc.v1.cri".cni = { - bin_dir = "/var/lib/rancher/k3s/data/current/bin"; - conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d"; +{ + virtualisation.containerd = { + enable = true; + settings.plugins."io.containerd.grpc.v1.cri".cni = { + bin_dir = "/var/lib/rancher/k3s/data/current/bin"; + conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d"; + }; + # Optionally, configure containerd to use the k3s pause image + settings.plugins."io.containerd.grpc.v1.cri" = { + sandbox_image = "docker.io/rancher/mirrored-pause:3.6"; + }; }; - # Optionally, configure containerd to use the k3s pause image - settings.plugins."io.containerd.grpc.v1.cri" = { - sandbox_image = "docker.io/rancher/mirrored-pause:3.6"; - }; -}; +} ``` ## Configure k3s ```nix -services.k3s = { - enable = true; - extraFlags = [ "--container-runtime-endpoint unix:///run/containerd/containerd.sock" ]; -}; +{ + services.k3s = { + enable = true; + extraFlags = [ "--container-runtime-endpoint unix:///run/containerd/containerd.sock" ]; + }; +} ``` ## Importing Container Images diff --git a/pkgs/by-name/README.md b/pkgs/by-name/README.md index 1b6e81110d0a..6853407a9a8d 100644 --- a/pkgs/by-name/README.md +++ b/pkgs/by-name/README.md @@ -99,9 +99,14 @@ Definitions like the following however, _can_ be transitioned: ```nix # all-packages.nix -fooWithBaz = foo.override { - bar = baz; -}; +{ + fooWithBaz = foo.override { + bar = baz; + }; +} +``` + +```nix # turned into pkgs/by-name/fo/fooWithBaz/package.nix with: { foo, diff --git a/pkgs/by-name/az/azure-cli/README.md b/pkgs/by-name/az/azure-cli/README.md index 5907f1916f8f..29964f91948b 100644 --- a/pkgs/by-name/az/azure-cli/README.md +++ b/pkgs/by-name/az/azure-cli/README.md @@ -56,6 +56,7 @@ The output should look something like this: Based on this, you can add an attribute to `extensions-manual.nix`: ```nix +{ azure-devops = mkAzExtension { pname = "azure-devops"; version = "1.0.0"; @@ -67,6 +68,7 @@ Based on this, you can add an attribute to `extensions-manual.nix`: ]; meta.maintainers = with lib.maintainers; [ katexochen ]; }; +} ``` * The attribute name should be the same as `pname`. @@ -113,5 +115,7 @@ If extensions are removed upstream, an alias is added to the end of `extensions- this example: ```nix -blockchain = throw "The 'blockchain' extension for azure-cli was deprecated upstream"; # Added 2024-04-26 +{ + blockchain = throw "The 'blockchain' extension for azure-cli was deprecated upstream"; # Added 2024-04-26 +} ``` diff --git a/pkgs/servers/home-assistant/custom-components/README.md b/pkgs/servers/home-assistant/custom-components/README.md index b4115c63d061..c51e6512538e 100644 --- a/pkgs/servers/home-assistant/custom-components/README.md +++ b/pkgs/servers/home-assistant/custom-components/README.md @@ -80,6 +80,7 @@ needs to be. Instead of applying brittle substitutions the version constraint can be ignored on a per requirement basis. ```nix +{ dependencies = [ pyemvue ]; @@ -88,5 +89,5 @@ can be ignored on a per requirement basis. ignoreVersionRequirement = [ "pyemvue" ]; +} ``` -` From 62fe01651911043bd3db0add920af3d2935d9869 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 22 Jul 2025 16:14:50 +0200 Subject: [PATCH 2/6] treewide: run treefmt with mdcr/nixfmt --- CONTRIBUTING.md | 50 ++++---- .../fixed-point-arguments.chapter.md | 5 +- .../images/appimagetools.section.md | 8 +- .../images/binarycache.section.md | 5 +- .../images/dockertools.section.md | 4 +- doc/build-helpers/images/ocitools.section.md | 4 +- .../special/checkpoint-build.section.md | 31 ++--- doc/build-helpers/testers.chapter.md | 12 +- .../trivial-build-helpers.chapter.md | 13 +- doc/functions/generators.section.md | 2 +- doc/functions/nix-gitignore.section.md | 21 +++- doc/hooks/breakpoint.section.md | 4 +- doc/hooks/memcached-test-hook.section.md | 14 +-- doc/hooks/patch-rc-path-hooks.section.md | 4 +- doc/hooks/redis-test-hook.section.md | 8 +- doc/hooks/tauri.section.md | 22 ++-- doc/hooks/udevCheckHook.section.md | 4 +- doc/hooks/versionCheckHook.section.md | 4 +- doc/hooks/zig.section.md | 4 +- doc/interoperability/cyclonedx.md | 4 +- doc/languages-frameworks/agda.section.md | 4 +- doc/languages-frameworks/android.section.md | 18 +-- doc/languages-frameworks/beam.section.md | 14 +-- doc/languages-frameworks/chicken.section.md | 4 +- doc/languages-frameworks/coq.section.md | 8 +- doc/languages-frameworks/cuda.section.md | 8 +- doc/languages-frameworks/dhall.section.md | 4 +- doc/languages-frameworks/dotnet.section.md | 8 +- .../emscripten.section.md | 107 ++++++++-------- doc/languages-frameworks/factor.section.md | 5 +- doc/languages-frameworks/gnome.section.md | 4 +- doc/languages-frameworks/go.section.md | 8 +- doc/languages-frameworks/haskell.section.md | 12 +- doc/languages-frameworks/ios.section.md | 16 +-- doc/languages-frameworks/java.section.md | 6 +- .../javascript.section.md | 24 ++-- doc/languages-frameworks/lisp.section.md | 10 +- doc/languages-frameworks/neovim.section.md | 4 +- doc/languages-frameworks/nim.section.md | 4 +- doc/languages-frameworks/octave.section.md | 4 +- doc/languages-frameworks/php.section.md | 8 +- doc/languages-frameworks/python.section.md | 115 ++++-------------- doc/languages-frameworks/qt.section.md | 2 +- doc/languages-frameworks/ruby.section.md | 8 +- doc/languages-frameworks/rust.section.md | 16 +-- doc/languages-frameworks/scheme.section.md | 1 - doc/languages-frameworks/swift.section.md | 14 +-- doc/languages-frameworks/texlive.section.md | 42 +++---- doc/languages-frameworks/typst.section.md | 9 +- doc/packages/cataclysm-dda.section.md | 16 +-- doc/packages/inkscape.section.md | 4 +- doc/packages/kakoune.section.md | 4 +- doc/packages/urxvt.section.md | 4 +- doc/release-notes/rl-2505.section.md | 2 +- doc/stdenv/cross-compilation.chapter.md | 22 +--- doc/stdenv/meta.chapter.md | 8 +- doc/stdenv/stdenv.chapter.md | 22 +--- doc/using/configuration.chapter.md | 30 +---- doc/using/overlays.chapter.md | 24 +--- doc/using/overrides.chapter.md | 16 +-- maintainers/README.md | 6 +- .../container-networking.section.md | 6 +- .../administration/control-groups.chapter.md | 8 +- .../declarative-containers.section.md | 13 +- .../administration/service-mgmt.chapter.md | 4 +- .../configuration/abstractions.section.md | 88 ++++++++------ .../ad-hoc-network-config.section.md | 7 +- .../adding-custom-packages.section.md | 24 ++-- .../configuration/config-file.section.md | 9 +- .../customizing-packages.section.md | 26 ++-- .../declarative-packages.section.md | 4 +- .../configuration/file-systems.chapter.md | 8 +- .../manual/configuration/firewall.section.md | 19 ++- .../manual/configuration/gpu-accel.chapter.md | 35 ++---- .../configuration/ipv4-config.section.md | 14 +-- .../configuration/ipv6-config.section.md | 18 ++- .../configuration/kubernetes.chapter.md | 13 +- .../configuration/linux-kernel.chapter.md | 36 +++--- .../luks-file-systems.section.md | 11 +- .../configuration/mattermost.chapter.md | 8 +- .../configuration/modularity.section.md | 37 +++--- .../configuration/network-manager.section.md | 12 +- .../manual/configuration/profiles.chapter.md | 6 +- nixos/doc/manual/configuration/ssh.section.md | 7 +- .../sshfs-file-systems.section.md | 37 +++--- .../configuration/subversion.chapter.md | 47 ++++--- .../manual/configuration/user-mgmt.chapter.md | 25 ++-- .../manual/configuration/wayland.chapter.md | 4 +- .../manual/configuration/wireless.section.md | 15 +-- .../manual/configuration/x-windows.chapter.md | 46 +++---- .../manual/development/assertions.section.md | 25 ++-- .../manual/development/bootspec.chapter.md | 3 +- .../manual/development/etc-overlay.section.md | 8 +- .../development/freeform-modules.section.md | 3 +- .../development/importing-modules.section.md | 17 ++- .../development/meta-attributes.section.md | 7 +- .../non-switchable-systems.section.md | 3 +- .../option-declarations.section.md | 95 ++++++++------- .../manual/development/option-def.section.md | 83 ++++++++----- .../development/option-types.section.md | 74 +++++------ .../development/replace-modules.section.md | 26 ++-- ...nning-nixos-tests-interactively.section.md | 4 +- .../development/settings-options.section.md | 21 +++- .../development/writing-modules.chapter.md | 97 +++++++++------ .../writing-nixos-tests.section.md | 62 +++++----- ...lding-images-via-systemd-repart.chapter.md | 68 ++++++----- .../installation/building-nixos.chapter.md | 5 +- .../installation/changing-config.chapter.md | 4 +- .../installing-from-other-distro.section.md | 4 +- .../installation/installing-kexec.section.md | 11 +- .../installing-virtualbox-guest.section.md | 15 ++- .../manual/installation/upgrading.chapter.md | 4 +- .../manual/release-notes/rl-1404.section.md | 12 +- .../manual/release-notes/rl-1412.section.md | 4 +- .../manual/release-notes/rl-1509.section.md | 37 +++--- .../manual/release-notes/rl-1603.section.md | 33 +++-- .../manual/release-notes/rl-1609.section.md | 4 +- .../manual/release-notes/rl-1703.section.md | 18 ++- .../manual/release-notes/rl-1709.section.md | 3 +- .../manual/release-notes/rl-1803.section.md | 6 +- .../manual/release-notes/rl-1809.section.md | 16 ++- .../manual/release-notes/rl-1903.section.md | 53 ++++---- .../manual/release-notes/rl-2003.section.md | 55 +++++---- .../manual/release-notes/rl-2009.section.md | 43 +++---- .../manual/release-notes/rl-2105.section.md | 52 ++++---- .../manual/release-notes/rl-2111.section.md | 2 +- .../manual/release-notes/rl-2205.section.md | 75 +++++++----- .../manual/release-notes/rl-2211.section.md | 14 +-- .../manual/release-notes/rl-2305.section.md | 28 ++--- .../manual/release-notes/rl-2311.section.md | 12 +- .../manual/release-notes/rl-2405.section.md | 7 +- .../manual/release-notes/rl-2411.section.md | 64 ++++++---- .../manual/release-notes/rl-2505.section.md | 6 +- nixos/modules/i18n/input-method/default.md | 17 ++- .../modules/programs/digitalbitbox/default.md | 18 +-- nixos/modules/programs/plotinus.md | 4 +- nixos/modules/programs/zsh/oh-my-zsh.md | 10 +- nixos/modules/security/acme/default.md | 56 +++++---- nixos/modules/services/backup/borgbackup.md | 37 +++--- .../services/databases/foundationdb.md | 8 +- .../modules/services/databases/postgresql.md | 99 ++++++++------- .../modules/services/databases/tigerbeetle.md | 4 +- .../services/desktop-managers/gnome.md | 16 +-- nixos/modules/services/desktops/flatpak.md | 4 +- nixos/modules/services/development/athens.md | 18 ++- .../modules/services/development/blackfire.md | 7 +- .../modules/services/development/livebook.md | 5 +- nixos/modules/services/editors/emacs.md | 99 ++++++++------- nixos/modules/services/hardware/display.md | 81 ++++++------ nixos/modules/services/mail/mailman.md | 20 +-- nixos/modules/services/matrix/maubot.md | 4 +- nixos/modules/services/matrix/mjolnir.md | 14 +-- nixos/modules/services/matrix/synapse.md | 39 +++--- .../modules/services/misc/anki-sync-server.md | 4 +- nixos/modules/services/misc/dump1090-fa.md | 4 +- nixos/modules/services/misc/forgejo.md | 4 +- nixos/modules/services/misc/gitlab.md | 4 +- nixos/modules/services/misc/paisa.md | 4 +- .../modules/services/monitoring/parsedmarc.md | 4 +- .../monitoring/prometheus/exporters.md | 46 ++++--- .../network-filesystems/litestream/default.md | 34 +++--- .../services/network-filesystems/samba.md | 4 +- nixos/modules/services/networking/anubis.md | 7 +- nixos/modules/services/networking/atalkd.md | 2 +- .../modules/services/networking/crab-hole.md | 4 +- .../modules/services/networking/doh-server.md | 5 +- .../modules/services/networking/jotta-cli.md | 4 +- .../modules/services/networking/mosquitto.md | 56 +++++---- nixos/modules/services/networking/netbird.md | 4 +- nixos/modules/services/networking/pleroma.md | 44 +++---- nixos/modules/services/networking/prosody.md | 19 +-- .../modules/services/networking/yggdrasil.md | 78 +++++++----- nixos/modules/services/search/meilisearch.md | 4 +- .../system/kerberos/kerberos-server.md | 10 +- .../services/system/systemd-lock-handler.md | 10 +- nixos/modules/services/web-apps/akkoma.md | 78 ++++++------ .../services/web-apps/c2fmzq-server.md | 4 +- nixos/modules/services/web-apps/castopod.md | 5 +- nixos/modules/services/web-apps/filesender.md | 7 +- nixos/modules/services/web-apps/gotosocial.md | 5 +- nixos/modules/services/web-apps/jitsi-meet.md | 10 +- nixos/modules/services/web-apps/keycloak.md | 2 +- nixos/modules/services/web-apps/nextcloud.md | 30 +++-- nixos/modules/services/web-apps/pict-rs.md | 4 +- nixos/modules/services/web-servers/garage.md | 2 +- .../services/x11/desktop-managers/pantheon.md | 19 +-- nixos/modules/system/boot/clevis.md | 8 +- .../system/boot/loader/external/external.md | 3 +- pkgs/README.md | 100 +++++++++------ .../applications/emulators/libretro/README.md | 18 +-- pkgs/by-name/README.md | 41 +++---- pkgs/by-name/az/azure-cli/README.md | 4 +- .../development/tcl-modules/by-name/README.md | 9 +- .../custom-components/README.md | 15 +-- .../custom-lovelace-modules/README.md | 4 +- 195 files changed, 1919 insertions(+), 2002 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17c8c8e48fd5..f3dfae0563b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -567,7 +567,12 @@ If you have any problems with formatting, please ping the [formatting team](http That is, write ```nix - { stdenv, fetchurl, perl }: <...> + { + stdenv, + fetchurl, + perl, + }: + <...> ``` instead of @@ -579,17 +584,25 @@ If you have any problems with formatting, please ping the [formatting team](http or ```nix - { stdenv, fetchurl, perl, ... }: <...> + { + stdenv, + fetchurl, + perl, + ... + }: + <...> ``` For functions that are truly generic in the number of arguments, but have some required arguments, you should write them using an `@`-pattern: ```nix - { stdenv, doCoverageAnalysis ? false, ... } @ args: + { + stdenv, + doCoverageAnalysis ? false, + ... + }@args: - stdenv.mkDerivation (args // { - foo = if doCoverageAnalysis then "bla" else ""; - }) + stdenv.mkDerivation (args // { foo = if doCoverageAnalysis then "bla" else ""; }) ``` instead of @@ -597,42 +610,37 @@ If you have any problems with formatting, please ping the [formatting team](http ```nix args: - args.stdenv.mkDerivation (args // { - foo = if args ? doCoverageAnalysis && args.doCoverageAnalysis then "bla" else ""; - }) + args.stdenv.mkDerivation ( + args + // { + foo = if args ? doCoverageAnalysis && args.doCoverageAnalysis then "bla" else ""; + } + ) ``` - Unnecessary string conversions should be avoided. Do ```nix - { - rev = version; - } + { rev = version; } ``` instead of ```nix - { - rev = "${version}"; - } + { rev = "${version}"; } ``` - Building lists conditionally _should_ be done with `lib.optional(s)` instead of using `if cond then [ ... ] else null` or `if cond then [ ... ] else [ ]`. ```nix - { - buildInputs = lib.optional stdenv.hostPlatform.isDarwin iconv; - } + { buildInputs = lib.optional stdenv.hostPlatform.isDarwin iconv; } ``` instead of ```nix - { - buildInputs = if stdenv.hostPlatform.isDarwin then [ iconv ] else null; - } + { buildInputs = if stdenv.hostPlatform.isDarwin then [ iconv ] else null; } ``` As an exception, an explicit conditional expression with null can be used when fixing a important bug without triggering a mass rebuild. diff --git a/doc/build-helpers/fixed-point-arguments.chapter.md b/doc/build-helpers/fixed-point-arguments.chapter.md index 8e5d985ce858..4506d716b4c1 100644 --- a/doc/build-helpers/fixed-point-arguments.chapter.md +++ b/doc/build-helpers/fixed-point-arguments.chapter.md @@ -60,10 +60,7 @@ lib.extendMkDerivation { }@args: { # Arguments to pass - inherit - preferLocalBuild - allowSubstitute - ; + inherit preferLocalBuild allowSubstitute; # Some expressions involving specialArg greeting = if specialArg "hi" then "hi" else "hello"; }; diff --git a/doc/build-helpers/images/appimagetools.section.md b/doc/build-helpers/images/appimagetools.section.md index 7bfc45287d1f..c469124c3bd5 100644 --- a/doc/build-helpers/images/appimagetools.section.md +++ b/doc/build-helpers/images/appimagetools.section.md @@ -37,9 +37,7 @@ let hash = "sha256-he1uGC1M/nFcKpMM9JKY4oeexJcnzV0ZRxhTjtJz6xw="; }; in -appimageTools.wrapType2 { - inherit pname version src; -} +appimageTools.wrapType2 { inherit pname version src; } ``` ::: @@ -104,9 +102,7 @@ let hash = "sha256-/hMPvYdnVB1XjKgU2v47HnVvW4+uC3rhRjbucqin4iI="; }; - appimageContents = appimageTools.extract { - inherit pname version src; - }; + appimageContents = appimageTools.extract { inherit pname version src; }; in appimageTools.wrapType2 { inherit pname version src; diff --git a/doc/build-helpers/images/binarycache.section.md b/doc/build-helpers/images/binarycache.section.md index 46b43bd4f65a..348b8c49a2a2 100644 --- a/doc/build-helpers/images/binarycache.section.md +++ b/doc/build-helpers/images/binarycache.section.md @@ -33,10 +33,7 @@ You may also want to consider [dockerTools](#sec-pkgs-dockerTools) for your cont The following derivation will construct a flat-file binary cache containing the closure of `hello`. ```nix -{ mkBinaryCache, hello }: -mkBinaryCache { - rootPaths = [ hello ]; -} +{ mkBinaryCache, hello }: mkBinaryCache { rootPaths = [ hello ]; } ``` Build the cache on a machine. diff --git a/doc/build-helpers/images/dockertools.section.md b/doc/build-helpers/images/dockertools.section.md index 135bf8833dd2..d9e7bac95d50 100644 --- a/doc/build-helpers/images/dockertools.section.md +++ b/doc/build-helpers/images/dockertools.section.md @@ -1577,9 +1577,7 @@ This example uses [](#ex-dockerTools-streamNixShellImage-hello) as a starting po dockerTools.streamNixShellImage { tag = "latest"; drv = hello.overrideAttrs (old: { - nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ - cowsay - ]; + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ cowsay ]; }); } ``` diff --git a/doc/build-helpers/images/ocitools.section.md b/doc/build-helpers/images/ocitools.section.md index 5101dd81715b..88011bda79e1 100644 --- a/doc/build-helpers/images/ocitools.section.md +++ b/doc/build-helpers/images/ocitools.section.md @@ -82,9 +82,7 @@ This example uses `ociTools.buildContainer` to create a simple container that ru bash, }: ociTools.buildContainer { - args = [ - (lib.getExe bash) - ]; + args = [ (lib.getExe bash) ]; readonly = false; } diff --git a/doc/build-helpers/special/checkpoint-build.section.md b/doc/build-helpers/special/checkpoint-build.section.md index 3960a64dfc8e..bc4616cd2486 100644 --- a/doc/build-helpers/special/checkpoint-build.section.md +++ b/doc/build-helpers/special/checkpoint-build.section.md @@ -7,20 +7,18 @@ For hermeticity, Nix derivations do not allow any state to be carried over betwe However, we can tell Nix explicitly what the previous build state was, by representing that previous state as a derivation output. This allows the passed build state to be used for an incremental build. To change a normal derivation to a checkpoint based build, these steps must be taken: - - apply `prepareCheckpointBuild` on the desired derivation, e.g. -```nix -{ - checkpointArtifacts = (pkgs.checkpointBuildTools.prepareCheckpointBuild pkgs.virtualbox); -} -``` - - change something you want in the sources of the package, e.g. use a source override: -```nix -{ - changedVBox = pkgs.virtualbox.overrideAttrs (old: { - src = path/to/vbox/sources; - }); -} -``` + ```nix + { + checkpointArtifacts = (pkgs.checkpointBuildTools.prepareCheckpointBuild pkgs.virtualbox); + } + ``` + ```nix + { + changedVBox = pkgs.virtualbox.overrideAttrs (old: { + src = path/to/vbox/sources; + }); + } + ``` - use `mkCheckpointBuild changedVBox checkpointArtifacts` - enjoy shorter build times @@ -30,10 +28,7 @@ To change a normal derivation to a checkpoint based build, these steps must be t pkgs ? import { }, }: let - inherit (pkgs.checkpointBuildTools) - prepareCheckpointBuild - mkCheckpointBuild - ; + inherit (pkgs.checkpointBuildTools) prepareCheckpointBuild mkCheckpointBuild; helloCheckpoint = prepareCheckpointBuild pkgs.hello; changedHello = pkgs.hello.overrideAttrs (_: { doCheck = false; diff --git a/doc/build-helpers/testers.chapter.md b/doc/build-helpers/testers.chapter.md index 7f7e6bd7d3e7..344f4dc75dfd 100644 --- a/doc/build-helpers/testers.chapter.md +++ b/doc/build-helpers/testers.chapter.md @@ -15,9 +15,7 @@ If the `moduleNames` argument is omitted, `hasPkgConfigModules` will use `meta.p ```nix { - passthru.tests.pkg-config = testers.hasPkgConfigModules { - package = finalAttrs.finalPackage; - }; + passthru.tests.pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; }; meta.pkgConfigModules = [ "libfoo" ]; } @@ -74,9 +72,7 @@ If you have a static site that can be built with Nix, you can use `lycheeLinkChe # Check hyperlinks in the `nix` documentation ```nix -testers.lycheeLinkCheck { - site = nix.doc + "/share/doc/nix/manual"; -} +testers.lycheeLinkCheck { site = nix.doc + "/share/doc/nix/manual"; } ``` ::: @@ -269,9 +265,7 @@ The default argument to the command is `--version`, and the version to be checke This example will run the command `hello --version`, and then check that the version of the `hello` package is in the output of the command. ```nix -{ - passthru.tests.version = testers.testVersion { package = hello; }; -} +{ passthru.tests.version = testers.testVersion { package = hello; }; } ``` ::: diff --git a/doc/build-helpers/trivial-build-helpers.chapter.md b/doc/build-helpers/trivial-build-helpers.chapter.md index 48ed99b2fa36..1b6bc3311869 100644 --- a/doc/build-helpers/trivial-build-helpers.chapter.md +++ b/doc/build-helpers/trivial-build-helpers.chapter.md @@ -152,9 +152,7 @@ runCommandWith { Likewise, `runCommandCC name derivationArgs buildCommand` is equivalent to ```nix -runCommandWith { - inherit name derivationArgs; -} buildCommand +runCommandWith { inherit name derivationArgs; } buildCommand ``` ::: @@ -713,7 +711,10 @@ concatTextFile # Writes contents of files to /nix/store/ concatText "my-file" - [ file1 file2 ] + [ + file1 + file2 + ] # Writes contents of files to /nix/store/ concatScript @@ -790,7 +791,7 @@ The result is equivalent to the output of `nix-store -q --requisites`. For example, ```nix -writeClosure [ (writeScriptBin "hi" ''${hello}/bin/hello'') ] +writeClosure [ (writeScriptBin "hi" "${hello}/bin/hello") ] ``` produces an output path `/nix/store/-runtime-deps` containing @@ -816,7 +817,7 @@ This produces the equivalent of `nix-store -q --references`. For example, ```nix -writeDirectReferencesToFile (writeScriptBin "hi" ''${hello}/bin/hello'') +writeDirectReferencesToFile (writeScriptBin "hi" "${hello}/bin/hello") ``` produces an output path `/nix/store/-runtime-references` containing diff --git a/doc/functions/generators.section.md b/doc/functions/generators.section.md index 0b073c641e53..f636d00cc258 100644 --- a/doc/functions/generators.section.md +++ b/doc/functions/generators.section.md @@ -27,8 +27,8 @@ let } ":"; }; + # the INI file can now be given as plain old nix values in -# the INI file can now be given as plain old nix values customToINI { main = { pushinfo = true; diff --git a/doc/functions/nix-gitignore.section.md b/doc/functions/nix-gitignore.section.md index 416b5435fa58..e4962e200220 100644 --- a/doc/functions/nix-gitignore.section.md +++ b/doc/functions/nix-gitignore.section.md @@ -15,13 +15,24 @@ src = nix-gitignore.gitignoreSource [ ] ./source; # Simplest version - src = nix-gitignore.gitignoreSource "supplemental-ignores\n" ./source; + src = nix-gitignore.gitignoreSource '' + supplemental-ignores + '' ./source; # This one reads the ./source/.gitignore and concats the auxiliary ignores - src = nix-gitignore.gitignoreSourcePure "ignore-this\nignore-that\n" ./source; + src = nix-gitignore.gitignoreSourcePure '' + ignore-this + ignore-that + '' ./source; # Use this string as gitignore, don't read ./source/.gitignore. - src = nix-gitignore.gitignoreSourcePure [ "ignore-this\nignore-that\n" ~/.gitignore ] ./source; + src = nix-gitignore.gitignoreSourcePure [ + '' + ignore-this + ignore-that + '' + ~/.gitignore + ] ./source; # It also accepts a list (of strings and paths) that will be concatenated # once the paths are turned to strings via readFile. } @@ -41,9 +52,7 @@ Those filter functions accept the same arguments the `builtins.filterSource` fun If you want to make your own filter from scratch, you may use ```nix -{ - gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root; -} +{ gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root; } ``` ## gitignore files in subdirectories {#sec-pkgs-nix-gitignore-usage-recursive} diff --git a/doc/hooks/breakpoint.section.md b/doc/hooks/breakpoint.section.md index cbc93b0fb988..c8c1ad26173a 100644 --- a/doc/hooks/breakpoint.section.md +++ b/doc/hooks/breakpoint.section.md @@ -3,9 +3,7 @@ This hook makes a build pause instead of stopping when a failure occurs. It prevents Nix from cleaning up the build environment immediately and allows the user to attach to the build environment. Upon a build error, it will print instructions that can be used to enter the environment for debugging. breakpointHook is only available on Linux. To use it, add `breakpointHook` to `nativeBuildInputs` in the package to be inspected. ```nix -{ - nativeBuildInputs = [ breakpointHook ]; -} +{ nativeBuildInputs = [ breakpointHook ]; } ``` When a build failure occurs, an instruction will be printed showing how to attach to the build sandbox. diff --git a/doc/hooks/memcached-test-hook.section.md b/doc/hooks/memcached-test-hook.section.md index 03fc91ab4bf0..6575d33b7e05 100644 --- a/doc/hooks/memcached-test-hook.section.md +++ b/doc/hooks/memcached-test-hook.section.md @@ -4,17 +4,12 @@ This hook starts a Memcached server during `checkPhase`. Example: ```nix -{ - stdenv, - memcachedTestHook, -}: +{ stdenv, memcachedTestHook }: stdenv.mkDerivation { # ... - nativeCheckInputs = [ - memcachedTestHook - ]; + nativeCheckInputs = [ memcachedTestHook ]; } ``` @@ -45,11 +40,10 @@ stdenv.mkDerivation { # ... - nativeCheckInputs = [ - memcachedTestHook - ]; + nativeCheckInputs = [ memcachedTestHook ]; preCheck = '' memcachedTestPort=1234; ''; } +``` diff --git a/doc/hooks/patch-rc-path-hooks.section.md b/doc/hooks/patch-rc-path-hooks.section.md index 080a03da72d6..61bcb276c4ee 100644 --- a/doc/hooks/patch-rc-path-hooks.section.md +++ b/doc/hooks/patch-rc-path-hooks.section.md @@ -38,9 +38,7 @@ stdenv.mkDerivation { # ... - nativeBuildInputs = [ - patchRcPathFish - ]; + nativeBuildInputs = [ patchRcPathFish ]; postFixup = '' patchRcPathFish $out/bin/this-foo.fish ${ diff --git a/doc/hooks/redis-test-hook.section.md b/doc/hooks/redis-test-hook.section.md index 7971b29fa10a..383f8b5c29ce 100644 --- a/doc/hooks/redis-test-hook.section.md +++ b/doc/hooks/redis-test-hook.section.md @@ -13,9 +13,7 @@ stdenv.mkDerivation { # ... - nativeCheckInputs = [ - redisTestHook - ]; + nativeCheckInputs = [ redisTestHook ]; } ``` @@ -56,9 +54,7 @@ stdenv.mkDerivation { # ... - nativeCheckInputs = [ - redisTestHook - ]; + nativeCheckInputs = [ redisTestHook ]; preCheck = '' redisTestPort=6390; diff --git a/doc/hooks/tauri.section.md b/doc/hooks/tauri.section.md index 290bc3a1d781..32881813d42d 100644 --- a/doc/hooks/tauri.section.md +++ b/doc/hooks/tauri.section.md @@ -35,21 +35,17 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "..."; }; - nativeBuildInputs = - [ - # Pull in our main hook - cargo-tauri.hook + nativeBuildInputs = [ + # Pull in our main hook + cargo-tauri.hook - # Setup npm - nodejs - npmHooks.npmConfigHook + # Setup npm + nodejs + npmHooks.npmConfigHook - # Make sure we can find our libraries - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wrapGAppsHook4 - ]; + # Make sure we can find our libraries + pkg-config + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ glib-networking # Most Tauri apps need networking diff --git a/doc/hooks/udevCheckHook.section.md b/doc/hooks/udevCheckHook.section.md index 1e84a1ee33d8..79b8f26b03d4 100644 --- a/doc/hooks/udevCheckHook.section.md +++ b/doc/hooks/udevCheckHook.section.md @@ -16,9 +16,7 @@ The hook runs in `installCheckPhase`, requiring `doInstallCheck` is enabled for stdenv.mkDerivation (finalAttrs: { # ... - nativeInstallCheckInputs = [ - udevCheckHook - ]; + nativeInstallCheckInputs = [ udevCheckHook ]; doInstallCheck = true; # ... diff --git a/doc/hooks/versionCheckHook.section.md b/doc/hooks/versionCheckHook.section.md index c97911fb349f..229aebc538a5 100644 --- a/doc/hooks/versionCheckHook.section.md +++ b/doc/hooks/versionCheckHook.section.md @@ -15,9 +15,7 @@ You use it like this: stdenv.mkDerivation (finalAttrs: { # ... - nativeInstallCheckInputs = [ - versionCheckHook - ]; + nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; # ... diff --git a/doc/hooks/zig.section.md b/doc/hooks/zig.section.md index 1c52e9827b41..58515087c59a 100644 --- a/doc/hooks/zig.section.md +++ b/doc/hooks/zig.section.md @@ -16,9 +16,7 @@ In Nixpkgs, `zig.hook` overrides the default build, check and install phases. stdenv.mkDerivation { # . . . - nativeBuildInputs = [ - zig.hook - ]; + nativeBuildInputs = [ zig.hook ]; zigBuildFlags = [ "-Dman-pages=true" ]; diff --git a/doc/interoperability/cyclonedx.md b/doc/interoperability/cyclonedx.md index 3c141b86d9f9..95c51e8a5df0 100644 --- a/doc/interoperability/cyclonedx.md +++ b/doc/interoperability/cyclonedx.md @@ -79,9 +79,7 @@ let sha256, ... }: - pkgs.fetchzip { - inherit name url sha256; - }; + pkgs.fetchzip { inherit name url sha256; }; }; in diff --git a/doc/languages-frameworks/agda.section.md b/doc/languages-frameworks/agda.section.md index d5a1c6ef08a3..ae126b16cad7 100644 --- a/doc/languages-frameworks/agda.section.md +++ b/doc/languages-frameworks/agda.section.md @@ -144,9 +144,7 @@ agdaPackages.mkDerivation { version = "1.0"; pname = "my-agda-lib"; src = ./.; - buildInputs = [ - agdaPackages.standard-library - ]; + buildInputs = [ agdaPackages.standard-library ]; } ``` diff --git a/doc/languages-frameworks/android.section.md b/doc/languages-frameworks/android.section.md index 9e93d4eda36d..b47874df1820 100644 --- a/doc/languages-frameworks/android.section.md +++ b/doc/languages-frameworks/android.section.md @@ -8,17 +8,13 @@ supporting features. Use the `android-studio-full` attribute for a very complete Android SDK, including system images: ```nix -{ - buildInputs = [ android-studio-full ]; -} +{ buildInputs = [ android-studio-full ]; } ``` This is identical to: ```nix -{ - buildInputs = [ androidStudioPackages.stable.full ]; -} +{ buildInputs = [ androidStudioPackages.stable.full ]; } ``` Alternatively, you can pass composeAndroidPackages to the `withSdk` passthru: @@ -26,11 +22,7 @@ Alternatively, you can pass composeAndroidPackages to the `withSdk` passthru: ```nix { buildInputs = [ - (android-studio.withSdk - (androidenv.composeAndroidPackages { - includeNDK = true; - }).androidsdk - ) + (android-studio.withSdk (androidenv.composeAndroidPackages { includeNDK = true; }).androidsdk) ]; } ``` @@ -58,9 +50,7 @@ let "arm64-v8a" ]; includeNDK = true; - includeExtras = [ - "extras;google;auto" - ]; + includeExtras = [ "extras;google;auto" ]; }; in androidComposition.androidsdk diff --git a/doc/languages-frameworks/beam.section.md b/doc/languages-frameworks/beam.section.md index a6c22f46d912..9e5233e87dcb 100644 --- a/doc/languages-frameworks/beam.section.md +++ b/doc/languages-frameworks/beam.section.md @@ -65,9 +65,7 @@ let overlays = [ ]; }; in -pkgs.mkShell { - packages = [ pkgs.beamPackages.rebar3 ]; -} +pkgs.mkShell { packages = [ pkgs.beamPackages.rebar3 ]; } ``` ::: @@ -324,9 +322,7 @@ with pkgs; let elixir = beam.packages.erlang_27.elixir_1_18; in -mkShell { - buildInputs = [ elixir ]; -} +mkShell { buildInputs = [ elixir ]; } ``` ### Using an overlay {#beam-using-overlays} @@ -348,11 +344,7 @@ let pkgs = import { overlays = [ elixir_1_18_1_overlay ]; }; in with pkgs; -mkShell { - buildInputs = [ - elixir_1_18 - ]; -} +mkShell { buildInputs = [ elixir_1_18 ]; } ``` #### Elixir - Phoenix project {#elixir---phoenix-project} diff --git a/doc/languages-frameworks/chicken.section.md b/doc/languages-frameworks/chicken.section.md index 78a4469a8e1d..c0c36d692327 100644 --- a/doc/languages-frameworks/chicken.section.md +++ b/doc/languages-frameworks/chicken.section.md @@ -77,8 +77,8 @@ let ); } ); + # Here, `myChickenPackages.chickenEggs.json-rpc`, which depends on `srfi-180` will use + # the local copy of `srfi-180`. in -# Here, `myChickenPackages.chickenEggs.json-rpc`, which depends on `srfi-180` will use -# the local copy of `srfi-180`. <...> ``` diff --git a/doc/languages-frameworks/coq.section.md b/doc/languages-frameworks/coq.section.md index c08ed2bc6f43..5da705964fa8 100644 --- a/doc/languages-frameworks/coq.section.md +++ b/doc/languages-frameworks/coq.section.md @@ -145,17 +145,13 @@ There are three distinct ways of changing a Coq package by overriding one of its For example, assuming you have a special `mathcomp` dependency you want to use, here is how you could override the `mathcomp` dependency: ```nix -multinomials.override { - mathcomp = my-special-mathcomp; -} +multinomials.override { mathcomp = my-special-mathcomp; } ``` In Nixpkgs, all Coq derivations take a `version` argument. This can be overridden in order to easily use a different version: ```nix -coqPackages.multinomials.override { - version = "1.5.1"; -} +coqPackages.multinomials.override { version = "1.5.1"; } ``` Refer to [](#coq-packages-attribute-sets-coqpackages) for all the different formats that you can potentially pass to `version`, as well as the restrictions. diff --git a/doc/languages-frameworks/cuda.section.md b/doc/languages-frameworks/cuda.section.md index e045bb43b78c..8699594e1d6d 100644 --- a/doc/languages-frameworks/cuda.section.md +++ b/doc/languages-frameworks/cuda.section.md @@ -146,9 +146,7 @@ These settings ensure that the CUDA setup hooks function as intended. When using `callPackage`, you can choose to pass in a different variant, e.g. when a package requires a specific version of CUDA: ```nix -{ - mypkg = callPackage { cudaPackages = cudaPackages_12_2; }; -} +{ mypkg = callPackage { cudaPackages = cudaPackages_12_2; }; } ``` ::: {.caution} @@ -208,9 +206,7 @@ It is possible to run Docker or Podman containers with CUDA support. The recomme The NVIDIA Container Toolkit can be enabled in NixOS like follows: ```nix -{ - hardware.nvidia-container-toolkit.enable = true; -} +{ hardware.nvidia-container-toolkit.enable = true; } ``` This will automatically enable a service that generates a CDI specification (located at `/var/run/cdi/nvidia-container-toolkit.json`) based on the auto-detected hardware of your machine. You can check this service by running: diff --git a/doc/languages-frameworks/dhall.section.md b/doc/languages-frameworks/dhall.section.md index 469f1a4fe3d1..1e86e263089d 100644 --- a/doc/languages-frameworks/dhall.section.md +++ b/doc/languages-frameworks/dhall.section.md @@ -94,9 +94,7 @@ let hash = "sha256-B4Q3c6IvTLg3Q92qYa8y+i4uTaphtFdjp+Ir3QQjdN0="; }; - dhallOverlay = self: super: { - true = self.callPackage ./true.nix { }; - }; + dhallOverlay = self: super: { true = self.callPackage ./true.nix { }; }; overlay = self: super: { dhallPackages = super.dhallPackages.override (old: { diff --git a/doc/languages-frameworks/dotnet.section.md b/doc/languages-frameworks/dotnet.section.md index ea3448542f5d..396177da9d47 100644 --- a/doc/languages-frameworks/dotnet.section.md +++ b/doc/languages-frameworks/dotnet.section.md @@ -10,9 +10,7 @@ with import { }; mkShell { name = "dotnet-env"; - packages = [ - dotnet-sdk - ]; + packages = [ dotnet-sdk ]; } ``` @@ -161,7 +159,9 @@ buildDotnetModule rec { projectFile = "src/project.sln"; nugetDeps = ./deps.json; # see "Generating and updating NuGet dependencies" section for details - buildInputs = [ referencedProject ]; # `referencedProject` must contain `nupkg` in the folder structure. + buildInputs = [ + referencedProject + ]; # `referencedProject` must contain `nupkg` in the folder structure. dotnet-sdk = dotnetCorePackages.sdk_8_0; dotnet-runtime = dotnetCorePackages.runtime_8_0; diff --git a/doc/languages-frameworks/emscripten.section.md b/doc/languages-frameworks/emscripten.section.md index b36ec5fc32a5..be0fe41ad340 100644 --- a/doc/languages-frameworks/emscripten.section.md +++ b/doc/languages-frameworks/emscripten.section.md @@ -38,78 +38,75 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update ```nix -(pkgs.zlib.override { - stdenv = pkgs.emscriptenStdenv; -}).overrideAttrs - (old: { - buildInputs = old.buildInputs ++ [ pkg-config ]; - # we need to reset this setting! - env = (old.env or { }) // { - NIX_CFLAGS_COMPILE = ""; - }; +(pkgs.zlib.override { stdenv = pkgs.emscriptenStdenv; }).overrideAttrs (old: { + buildInputs = old.buildInputs ++ [ pkg-config ]; + # we need to reset this setting! + env = (old.env or { }) // { + NIX_CFLAGS_COMPILE = ""; + }; - configurePhase = '' - # FIXME: Some tests require writing at $HOME - HOME=$TMPDIR - runHook preConfigure + configurePhase = '' + # FIXME: Some tests require writing at $HOME + HOME=$TMPDIR + runHook preConfigure - #export EMCC_DEBUG=2 - emconfigure ./configure --prefix=$out --shared + #export EMCC_DEBUG=2 + emconfigure ./configure --prefix=$out --shared - runHook postConfigure - ''; + runHook postConfigure + ''; - dontStrip = true; - outputs = [ "out" ]; + dontStrip = true; + outputs = [ "out" ]; - buildPhase = '' - runHook preBuild + buildPhase = '' + runHook preBuild - emmake make + emmake make - runHook postBuild - ''; + runHook postBuild + ''; - installPhase = '' - runHook preInstall + installPhase = '' + runHook preInstall - emmake make install + emmake make install - runHook postInstall - ''; + runHook postInstall + ''; - checkPhase = '' - runHook preCheck + checkPhase = '' + runHook preCheck - echo "================= testing zlib using node =================" + echo "================= testing zlib using node =================" - echo "Compiling a custom test" - set -x - emcc -O2 -s EMULATE_FUNCTION_POINTER_CASTS=1 test/example.c -DZ_SOLO \ - libz.so.${old.version} -I . -o example.js + echo "Compiling a custom test" + set -x + emcc -O2 -s EMULATE_FUNCTION_POINTER_CASTS=1 test/example.c -DZ_SOLO \ + libz.so.${old.version} -I . -o example.js - echo "Using node to execute the test" - ${pkgs.nodejs}/bin/node ./example.js + echo "Using node to execute the test" + ${pkgs.nodejs}/bin/node ./example.js - set +x - if [ $? -ne 0 ]; then - echo "test failed for some reason" - exit 1; - else - echo "it seems to work! very good." - fi - echo "================= /testing zlib using node =================" + set +x + if [ $? -ne 0 ]; then + echo "test failed for some reason" + exit 1; + else + echo "it seems to work! very good." + fi + echo "================= /testing zlib using node =================" - runHook postCheck - ''; + runHook postCheck + ''; - postPatch = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin '' - substituteInPlace configure \ - --replace-fail '/usr/bin/libtool' 'ar' \ - --replace-fail 'AR="libtool"' 'AR="ar"' \ - --replace-fail 'ARFLAGS="-o"' 'ARFLAGS="-r"' - ''; - }) + postPatch = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin '' + substituteInPlace configure \ + --replace-fail '/usr/bin/libtool' 'ar' \ + --replace-fail 'AR="libtool"' 'AR="ar"' \ + --replace-fail 'ARFLAGS="-o"' 'ARFLAGS="-r"' + ''; +}) ``` :::{.example #usage-2-pkgs.buildemscriptenpackage} diff --git a/doc/languages-frameworks/factor.section.md b/doc/languages-frameworks/factor.section.md index 0d67eede4d34..7b854e11b0ba 100644 --- a/doc/languages-frameworks/factor.section.md +++ b/doc/languages-frameworks/factor.section.md @@ -81,10 +81,7 @@ The function understands several forms of source directory trees: For instance, packaging the Bresenham algorithm for line interpolation looks like this, see `pkgs/development/compilers/factor-lang/vocabs/bresenham` for the complete file: ```nix -{ - factorPackages, - fetchFromGitHub, -}: +{ factorPackages, fetchFromGitHub }: factorPackages.buildFactorVocab { pname = "bresenham"; diff --git a/doc/languages-frameworks/gnome.section.md b/doc/languages-frameworks/gnome.section.md index 718c296bce80..0b4d66a430f4 100644 --- a/doc/languages-frameworks/gnome.section.md +++ b/doc/languages-frameworks/gnome.section.md @@ -48,9 +48,7 @@ In the rare case you need to use icons from dependencies (e.g. when an app force ```nix { - buildInputs = [ - pantheon.elementary-icon-theme - ]; + buildInputs = [ pantheon.elementary-icon-theme ]; preFixup = '' gappsWrapperArgs+=( # The icon theme is hardcoded. diff --git a/doc/languages-frameworks/go.section.md b/doc/languages-frameworks/go.section.md index fcc3c687d354..e947403b2348 100644 --- a/doc/languages-frameworks/go.section.md +++ b/doc/languages-frameworks/go.section.md @@ -147,9 +147,7 @@ A string list of [Go build tags (also called build constraints)](https://pkg.go. Tags can also be set conditionally: ```nix -{ - tags = [ "production" ] ++ lib.optionals withSqlite [ "sqlite" ]; -} +{ tags = [ "production" ] ++ lib.optionals withSqlite [ "sqlite" ]; } ``` ### `deleteVendor` {#var-go-deleteVendor} @@ -283,9 +281,7 @@ For example, only a selection of tests could be run with: ```nix { # -run and -skip accept regular expressions - checkFlags = [ - "-run=^Test(Simple|Fast)$" - ]; + checkFlags = [ "-run=^Test(Simple|Fast)$" ]; } ``` diff --git a/doc/languages-frameworks/haskell.section.md b/doc/languages-frameworks/haskell.section.md index 63944fd1bc01..9a02c18b548d 100644 --- a/doc/languages-frameworks/haskell.section.md +++ b/doc/languages-frameworks/haskell.section.md @@ -783,9 +783,7 @@ need to build `nix-tree` with a more recent version of `brick` than the default one provided by `haskellPackages`: ```nix -haskellPackages.nix-tree.override { - brick = haskellPackages.brick_0_67; -} +haskellPackages.nix-tree.override { brick = haskellPackages.brick_0_67; } ``` @@ -318,9 +314,7 @@ In addition to numerous new and upgraded packages, this release includes the fol of environment variables for Grafana. If you had an expression like ```nix - { - services.grafana.extraOptions.SECURITY_ADMIN_USER = "foobar"; - } + { services.grafana.extraOptions.SECURITY_ADMIN_USER = "foobar"; } ``` your Grafana instance was running with `GF_SECURITY_ADMIN_USER=foobar` in its environment. @@ -329,9 +323,7 @@ In addition to numerous new and upgraded packages, this release includes the fol to declare ```nix - { - services.grafana.settings.security.admin_user = "foobar"; - } + { services.grafana.settings.security.admin_user = "foobar"; } ``` instead. diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index 7ffe079977af..dbc1aa8d97eb 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -25,9 +25,7 @@ In addition to numerous new and updated packages, this release has the following - NixOS now defaults to using [nsncd](https://github.com/twosigma/nsncd), a non-caching reimplementation of nscd in Rust, as its NSS lookup dispatcher. This replaces the buggy and deprecated nscd implementation provided through glibc. When you find problems, you can switch back by disabling it: ```nix - { - services.nscd.enableNsncd = false; - } + { services.nscd.enableNsncd = false; } ``` - The internal option `boot.bootspec.enable` is now enabled by default because [RFC 0125](https://github.com/NixOS/rfcs/pull/125) was merged. This means you will have a bootspec document called `boot.json` generated for each system and specialisation in the top-level. This is useful to enable advanced boot use cases in NixOS, such as Secure Boot. @@ -455,15 +453,17 @@ In addition to numerous new and updated packages, this release has the following ```nix { - swapDevices = [ { - device = "/dev/disk/by-partlabel/swapspace"; - randomEncryption = { - enable = true; - cipher = "aes-xts-plain64"; - keySize = 512; - sectorSize = 4096; - }; - } ]; + swapDevices = [ + { + device = "/dev/disk/by-partlabel/swapspace"; + randomEncryption = { + enable = true; + cipher = "aes-xts-plain64"; + keySize = 512; + sectorSize = 4096; + }; + } + ]; } ``` @@ -475,9 +475,7 @@ In addition to numerous new and updated packages, this release has the following - PostgreSQL has added opt-in support for [JIT compilation](https://www.postgresql.org/docs/current/jit-reason.html). It can be enabled like this: ```nix - { - services.postgresql.enableJIT = true; - } + { services.postgresql.enableJIT = true; } ``` - `services.netdata` offers a [`services.netdata.deadlineBeforeStopSec`](#opt-services.netdata.deadlineBeforeStopSec) option which will control the deadline (in seconds) after which systemd will consider your netdata instance as dead if it didn't start in the elapsed time. It is helpful when your netdata instance takes longer to start because of a large amount of state or upgrades. diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index b6a702918e8b..920fa9862cc7 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -256,7 +256,7 @@ Make sure to also check the many updates in the [Nixpkgs library](#sec-release-2 ```nix { services.nextcloud.phpOptions = lib.mkForce { - /* ... */ + # ... }; } ``` @@ -888,9 +888,7 @@ Make sure to also check the many updates in the [Nixpkgs library](#sec-release-2 ```nix { python = python3.override { - packageOverrides = self: super: { - django = super.django_3; - }; + packageOverrides = self: super: { django = super.django_3; }; }; } ``` @@ -1237,7 +1235,11 @@ Make sure to also check the many updates in the [Nixpkgs library](#sec-release-2 enable = true; package = pkgs.coredns.override { externalPlugins = [ - {name = "fanout"; repo = "github.com/networkservicemesh/fanout"; version = "v1.9.1";} + { + name = "fanout"; + repo = "github.com/networkservicemesh/fanout"; + version = "v1.9.1"; + } ]; vendorHash = ""; }; diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 799d9eb62a74..5b959dafacd1 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -37,7 +37,8 @@ In addition to numerous new and upgraded packages, this release has the followin which can now be replaced via an opt-in mechanism. To make your system perlless, you can use the new perlless profile: ```nix - { modulesPath, ... }: { + { modulesPath, ... }: + { imports = [ "${modulesPath}/profiles/perlless.nix" ]; } ``` @@ -244,9 +245,7 @@ The pre-existing `services.ankisyncd` has been marked deprecated and will be dro ```nix { - environment.systemPackages = [ - (azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]) - ]; + environment.systemPackages = [ (azure-cli.withExtensions [ azure-cli.extensions.aks-preview ]) ]; } ``` To make the `azure-cli` immutable and prevent clashes in case `azure-cli` is also installed via other package managers, some configuration files were moved into the derivation. diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 3361b46d5e64..997c0bf1f325 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -413,11 +413,7 @@ ```nix { featureGates = [ "EphemeralContainers" ]; - extraOpts = pkgs.lib.concatStringsSep " " ( - [ - ''--feature-gates="CSIMigration=false"'' - ] - ); + extraOpts = pkgs.lib.concatStringsSep " " ([ ''--feature-gates="CSIMigration=false"'' ]); } ``` @@ -427,7 +423,7 @@ { featureGates = { EphemeralContainers = true; - CSIMigration=false; + CSIMigration = false; }; } ``` @@ -616,7 +612,7 @@ If you need to upgrade to 24.11 without having completed the migration, consider the security implications of weak password hashes on your user accounts, and add the following to your configuration: ```nix { - services.portunus.package = pkgs.portunus.override { libxcrypt = pkgs.libxcrypt-legacy; }; + services.portunus.package = pkgs.portunus.override { libxcrypt = pkgs.libxcrypt-legacy; }; services.portunus.ldap.package = pkgs.openldap.override { libxcrypt = pkgs.libxcrypt-legacy; }; } ``` @@ -959,24 +955,48 @@ If you set `sound.mediaKeys` in your configuration: ```nix { - services.actkbd = let - volumeStep = "1%"; - in { - enable = true; - bindings = [ - # "Mute" media key - { keys = [ 113 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Master toggle"; } + services.actkbd = + let + volumeStep = "1%"; + in + { + enable = true; + bindings = [ + # "Mute" media key + { + keys = [ 113 ]; + events = [ "key" ]; + command = "${alsa-utils}/bin/amixer -q set Master toggle"; + } - # "Lower Volume" media key - { keys = [ 114 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}- unmute"; } + # "Lower Volume" media key + { + keys = [ 114 ]; + events = [ + "key" + "rep" + ]; + command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}- unmute"; + } - # "Raise Volume" media key - { keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}+ unmute"; } + # "Raise Volume" media key + { + keys = [ 115 ]; + events = [ + "key" + "rep" + ]; + command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}+ unmute"; + } - # "Mic Mute" media key - { keys = [ 190 ]; events = [ "key" ]; command = "${alsa-utils}/bin/amixer -q set Capture toggle"; } - ]; - }; + # "Mic Mute" media key + { + keys = [ 190 ]; + events = [ "key" ]; + command = "${alsa-utils}/bin/amixer -q set Capture toggle"; + } + ]; + }; } ``` diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index ede104f80212..4ef84b41b94b 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -466,7 +466,11 @@ Alongside many enhancements to NixOS modules and general system improvements, th enable = true; localName = "Node 1"; localAddress = "galera_01"; - nodeAddresses = [ "galera_01" "galera_02" "galera_03"]; + nodeAddresses = [ + "galera_01" + "galera_02" + "galera_03" + ]; }; }; } diff --git a/nixos/modules/i18n/input-method/default.md b/nixos/modules/i18n/input-method/default.md index b7312348cd7a..f2d7934f94fb 100644 --- a/nixos/modules/i18n/input-method/default.md +++ b/nixos/modules/i18n/input-method/default.md @@ -27,7 +27,11 @@ The following snippet can be used to configure IBus: i18n.inputMethod = { enable = true; type = "ibus"; - ibus.engines = with pkgs.ibus-engines; [ anthy hangul mozc ]; + ibus.engines = with pkgs.ibus-engines; [ + anthy + hangul + mozc + ]; }; } ``` @@ -54,7 +58,10 @@ Available extra IBus engines are: ```nix { - ibus.engines = with pkgs.ibus-engines; [ table table-others ]; + ibus.engines = with pkgs.ibus-engines; [ + table + table-others + ]; } ``` @@ -85,7 +92,11 @@ The following snippet can be used to configure Fcitx: i18n.inputMethod = { enable = true; type = "fcitx5"; - fcitx5.addons = with pkgs; [ fcitx5-mozc fcitx5-hangul fcitx5-m17n ]; + fcitx5.addons = with pkgs; [ + fcitx5-mozc + fcitx5-hangul + fcitx5-m17n + ]; }; } ``` diff --git a/nixos/modules/programs/digitalbitbox/default.md b/nixos/modules/programs/digitalbitbox/default.md index 5147bb971e3a..0f8d1b8793c3 100644 --- a/nixos/modules/programs/digitalbitbox/default.md +++ b/nixos/modules/programs/digitalbitbox/default.md @@ -5,9 +5,7 @@ Digital Bitbox is a hardware wallet and second-factor authenticator. The `digitalbitbox` programs module may be installed by setting `programs.digitalbitbox` to `true` in a manner similar to ```nix -{ - programs.digitalbitbox.enable = true; -} +{ programs.digitalbitbox.enable = true; } ``` and bundles the `digitalbitbox` package (see [](#sec-digitalbitbox-package)), which contains the `dbb-app` and `dbb-cli` binaries, along with the hardware @@ -24,11 +22,7 @@ For more information, see . The binaries, `dbb-app` (a GUI tool) and `dbb-cli` (a CLI tool), are available through the `digitalbitbox` package which could be installed as follows: ```nix -{ - environment.systemPackages = [ - pkgs.digitalbitbox - ]; -} +{ environment.systemPackages = [ pkgs.digitalbitbox ]; } ``` ## Hardware {#sec-digitalbitbox-hardware-module} @@ -36,9 +30,7 @@ through the `digitalbitbox` package which could be installed as follows: The digitalbitbox hardware package enables the udev rules for Digital Bitbox devices and may be installed as follows: ```nix -{ - hardware.digitalbitbox.enable = true; -} +{ hardware.digitalbitbox.enable = true; } ``` In order to alter the udev rules, one may provide different values for the @@ -47,9 +39,7 @@ In order to alter the udev rules, one may provide different values for the { programs.digitalbitbox = { enable = true; - package = pkgs.digitalbitbox.override { - udevRule51 = "something else"; - }; + package = pkgs.digitalbitbox.override { udevRule51 = "something else"; }; }; } ``` diff --git a/nixos/modules/programs/plotinus.md b/nixos/modules/programs/plotinus.md index 0a2c688c722c..fd43abceb82c 100644 --- a/nixos/modules/programs/plotinus.md +++ b/nixos/modules/programs/plotinus.md @@ -13,7 +13,5 @@ palette provides a searchable list of of all menu items in the application. To enable Plotinus, add the following to your {file}`configuration.nix`: ```nix -{ - programs.plotinus.enable = true; -} +{ programs.plotinus.enable = true; } ``` diff --git a/nixos/modules/programs/zsh/oh-my-zsh.md b/nixos/modules/programs/zsh/oh-my-zsh.md index 7e4a41641eea..992e39cda3f4 100644 --- a/nixos/modules/programs/zsh/oh-my-zsh.md +++ b/nixos/modules/programs/zsh/oh-my-zsh.md @@ -13,7 +13,11 @@ configuration format of `oh-my-zsh`. { programs.zsh.ohMyZsh = { enable = true; - plugins = [ "git" "python" "man" ]; + plugins = [ + "git" + "python" + "man" + ]; theme = "agnoster"; }; } @@ -34,9 +38,7 @@ scripts. The module can do this as well: ```nix -{ - programs.zsh.ohMyZsh.custom = "~/path/to/custom/scripts"; -} +{ programs.zsh.ohMyZsh.custom = "~/path/to/custom/scripts"; } ``` ## Custom environments {#module-programs-oh-my-zsh-environments} diff --git a/nixos/modules/security/acme/default.md b/nixos/modules/security/acme/default.md index a6ef2a3fdf18..b3a5f838f897 100644 --- a/nixos/modules/security/acme/default.md +++ b/nixos/modules/security/acme/default.md @@ -210,14 +210,20 @@ Nix config. Instead, generate them one time with a systemd service: ```nix { systemd.services.dns-rfc2136-conf = { - requiredBy = ["acme-example.com.service" "bind.service"]; - before = ["acme-example.com.service" "bind.service"]; + requiredBy = [ + "acme-example.com.service" + "bind.service" + ]; + before = [ + "acme-example.com.service" + "bind.service" + ]; unitConfig = { ConditionPathExists = "!/var/lib/secrets/dnskeys.conf"; }; serviceConfig = { Type = "oneshot"; - UMask = 0077; + UMask = 77; }; path = [ pkgs.bind ]; script = '' @@ -312,28 +318,32 @@ can be applied to any service. # Now you must augment OpenSMTPD's systemd service to load # the certificate files. - systemd.services.opensmtpd.requires = ["acme-finished-mail.example.com.target"]; - systemd.services.opensmtpd.serviceConfig.LoadCredential = let - certDir = config.security.acme.certs."mail.example.com".directory; - in [ - "cert.pem:${certDir}/cert.pem" - "key.pem:${certDir}/key.pem" - ]; + systemd.services.opensmtpd.requires = [ "acme-finished-mail.example.com.target" ]; + systemd.services.opensmtpd.serviceConfig.LoadCredential = + let + certDir = config.security.acme.certs."mail.example.com".directory; + in + [ + "cert.pem:${certDir}/cert.pem" + "key.pem:${certDir}/key.pem" + ]; # Finally, configure OpenSMTPD to use these certs. - services.opensmtpd = let - credsDir = "/run/credentials/opensmtpd.service"; - in { - enable = true; - setSendmail = false; - serverConfiguration = '' - pki mail.example.com cert "${credsDir}/cert.pem" - pki mail.example.com key "${credsDir}/key.pem" - listen on localhost tls pki mail.example.com - action act1 relay host smtp://127.0.0.1:10027 - match for local action act1 - ''; - }; + services.opensmtpd = + let + credsDir = "/run/credentials/opensmtpd.service"; + in + { + enable = true; + setSendmail = false; + serverConfiguration = '' + pki mail.example.com cert "${credsDir}/cert.pem" + pki mail.example.com key "${credsDir}/key.pem" + listen on localhost tls pki mail.example.com + action act1 relay host smtp://127.0.0.1:10027 + match for local action act1 + ''; + }; } ``` diff --git a/nixos/modules/services/backup/borgbackup.md b/nixos/modules/services/backup/borgbackup.md index 23f0e5c934ed..42ba3cc3799a 100644 --- a/nixos/modules/services/backup/borgbackup.md +++ b/nixos/modules/services/backup/borgbackup.md @@ -23,20 +23,23 @@ A complete list of options for the Borgbase module may be found A very basic configuration for backing up to a locally accessible directory is: ```nix { - services.borgbackup.jobs = { - rootBackup = { - paths = "/"; - exclude = [ "/nix" "/path/to/local/repo" ]; - repo = "/path/to/local/repo"; - doInit = true; - encryption = { - mode = "repokey"; - passphrase = "secret"; - }; - compression = "auto,lzma"; - startAt = "weekly"; + services.borgbackup.jobs = { + rootBackup = { + paths = "/"; + exclude = [ + "/nix" + "/path/to/local/repo" + ]; + repo = "/path/to/local/repo"; + doInit = true; + encryption = { + mode = "repokey"; + passphrase = "secret"; }; + compression = "auto,lzma"; + startAt = "weekly"; }; + }; } ``` @@ -64,8 +67,8 @@ Add the following snippet to your NixOS configuration: my_borg_repo = { authorizedKeys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID78zmOyA+5uPG4Ot0hfAy+sLDPU1L4AiIoRYEIVbbQ/ root@nixos" - ] ; - path = "/var/lib/my_borg_repo" ; + ]; + path = "/var/lib/my_borg_repo"; }; }; } @@ -85,12 +88,14 @@ accessible by root backupToLocalServer = { paths = [ "/etc/nixos" ]; doInit = true; - repo = "borg@nixos:." ; + repo = "borg@nixos:."; encryption = { mode = "repokey-blake2"; passCommand = "cat /run/keys/borgbackup_passphrase"; }; - environment = { BORG_RSH = "ssh -i /run/keys/id_ed25519_my_borg_repo"; }; + environment = { + BORG_RSH = "ssh -i /run/keys/id_ed25519_my_borg_repo"; + }; compression = "auto,lzma"; startAt = "hourly"; }; diff --git a/nixos/modules/services/databases/foundationdb.md b/nixos/modules/services/databases/foundationdb.md index 5e31497ae3cd..73ee6e6b4c38 100644 --- a/nixos/modules/services/databases/foundationdb.md +++ b/nixos/modules/services/databases/foundationdb.md @@ -112,9 +112,7 @@ FoundationDB stores all data for all server processes under {file}`/var/lib/foundationdb`. You can override this using {option}`services.foundationdb.dataDir`, e.g. ```nix -{ - services.foundationdb.dataDir = "/data/fdb"; -} +{ services.foundationdb.dataDir = "/data/fdb"; } ``` Similarly, logs are stored under {file}`/var/log/foundationdb` @@ -270,9 +268,7 @@ For example, to create backups in {command}`/opt/fdb-backups`, first set up the paths in the module options: ```nix -{ - services.foundationdb.extraReadWritePaths = [ "/opt/fdb-backups" ]; -} +{ services.foundationdb.extraReadWritePaths = [ "/opt/fdb-backups" ]; } ``` Restart the FoundationDB service, and it will now be able to write to this diff --git a/nixos/modules/services/databases/postgresql.md b/nixos/modules/services/databases/postgresql.md index 4bbddf1bbc42..4e4d147e0300 100644 --- a/nixos/modules/services/databases/postgresql.md +++ b/nixos/modules/services/databases/postgresql.md @@ -41,9 +41,7 @@ alice=> By default, PostgreSQL stores its databases in {file}`/var/lib/postgresql/$psqlSchema`. You can override this using [](#opt-services.postgresql.dataDir), e.g. ```nix -{ - services.postgresql.dataDir = "/data/postgresql"; -} +{ services.postgresql.dataDir = "/data/postgresql"; } ``` ## Initializing {#module-services-postgres-initializing} @@ -183,36 +181,44 @@ $ nix-instantiate --eval -A postgresql_13.psqlSchema ``` For an upgrade, a script like this can be used to simplify the process: ```nix -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: { environment.systemPackages = [ - (let - # XXX specify the postgresql package you'd like to upgrade to. - # Do not forget to list the extensions you need. - newPostgres = pkgs.postgresql_13.withPackages (pp: [ - # pp.plv8 - ]); - cfg = config.services.postgresql; - in pkgs.writeScriptBin "upgrade-pg-cluster" '' - set -eux - # XXX it's perhaps advisable to stop all services that depend on postgresql - systemctl stop postgresql + ( + let + # XXX specify the postgresql package you'd like to upgrade to. + # Do not forget to list the extensions you need. + newPostgres = pkgs.postgresql_13.withPackages (pp: [ + # pp.plv8 + ]); + cfg = config.services.postgresql; + in + pkgs.writeScriptBin "upgrade-pg-cluster" '' + set -eux + # XXX it's perhaps advisable to stop all services that depend on postgresql + systemctl stop postgresql - export NEWDATA="/var/lib/postgresql/${newPostgres.psqlSchema}" - export NEWBIN="${newPostgres}/bin" + export NEWDATA="/var/lib/postgresql/${newPostgres.psqlSchema}" + export NEWBIN="${newPostgres}/bin" - export OLDDATA="${cfg.dataDir}" - export OLDBIN="${cfg.finalPackage}/bin" + export OLDDATA="${cfg.dataDir}" + export OLDBIN="${cfg.finalPackage}/bin" - install -d -m 0700 -o postgres -g postgres "$NEWDATA" - cd "$NEWDATA" - sudo -u postgres "$NEWBIN/initdb" -D "$NEWDATA" ${lib.escapeShellArgs cfg.initdbArgs} + install -d -m 0700 -o postgres -g postgres "$NEWDATA" + cd "$NEWDATA" + sudo -u postgres "$NEWBIN/initdb" -D "$NEWDATA" ${lib.escapeShellArgs cfg.initdbArgs} - sudo -u postgres "$NEWBIN/pg_upgrade" \ - --old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \ - --old-bindir "$OLDBIN" --new-bindir "$NEWBIN" \ - "$@" - '') + sudo -u postgres "$NEWBIN/pg_upgrade" \ + --old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \ + --old-bindir "$OLDBIN" --new-bindir "$NEWBIN" \ + "$@" + '' + ) ]; } ``` @@ -313,10 +319,11 @@ To add plugins via NixOS configuration, set `services.postgresql.extensions`: ```nix { services.postgresql.package = pkgs.postgresql_17; - services.postgresql.extensions = ps: with ps; [ - pg_repack - postgis - ]; + services.postgresql.extensions = + ps: with ps; [ + pg_repack + postgis + ]; } ``` @@ -333,7 +340,7 @@ self: super: { Here's a recipe on how to override a particular plugin through an overlay: ```nix self: super: { - postgresql_15 = super.postgresql_15// { + postgresql_15 = super.postgresql_15 // { pkgs = super.postgresql_15.pkgs // { pg_repack = super.postgresql_15.pkgs.pg_repack.overrideAttrs (_: { name = "pg_repack-v20181024"; @@ -353,11 +360,12 @@ PostgreSQL ships the additional procedural languages PL/Perl, PL/Python and PL/T They are packaged as plugins and can be made available in the same way as external extensions: ```nix { - services.postgresql.extensions = ps: with ps; [ - plperl - plpython3 - pltcl - ]; + services.postgresql.extensions = + ps: with ps; [ + plperl + plpython3 + pltcl + ]; } ``` @@ -366,9 +374,8 @@ Each procedural language plugin provides a `.withPackages` helper to make langua For example, to make `python3Packages.base58` available: ```nix { - services.postgresql.extensions = pgps: with pgps; [ - (plpython3.withPackages (pyps: with pyps; [ base58 ])) - ]; + services.postgresql.extensions = + pgps: with pgps; [ (plpython3.withPackages (pyps: with pyps; [ base58 ])) ]; } ``` @@ -385,9 +392,7 @@ is disabled by default because of the ~600MiB closure-size increase from the LLV can be optionally enabled in PostgreSQL with the following config option: ```nix -{ - services.postgresql.enableJIT = true; -} +{ services.postgresql.enableJIT = true; } ``` This makes sure that the [`jit`](https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-JIT)-setting @@ -406,7 +411,9 @@ overlay) since all modifications are propagated to `withJIT`. I.e. with import { overlays = [ (self: super: { - postgresql = super.postgresql.overrideAttrs (_: { pname = "foobar"; }); + postgresql = super.postgresql.overrideAttrs (_: { + pname = "foobar"; + }); }) ]; }; @@ -428,9 +435,7 @@ several common hardening options from `systemd`, most notably: * When using [`TABLESPACE`](https://www.postgresql.org/docs/current/manage-ag-tablespaces.html)s, make sure to add the filesystem paths to `ReadWritePaths` like this: ```nix { - systemd.services.postgresql.serviceConfig.ReadWritePaths = [ - "/path/to/tablespace/location" - ]; + systemd.services.postgresql.serviceConfig.ReadWritePaths = [ "/path/to/tablespace/location" ]; } ``` diff --git a/nixos/modules/services/databases/tigerbeetle.md b/nixos/modules/services/databases/tigerbeetle.md index 7cf3bedda5e0..2acbc96c5e66 100644 --- a/nixos/modules/services/databases/tigerbeetle.md +++ b/nixos/modules/services/databases/tigerbeetle.md @@ -8,9 +8,7 @@ TigerBeetle is a distributed financial accounting database designed for mission To enable TigerBeetle, add the following to your {file}`configuration.nix`: ```nix -{ - services.tigerbeetle.enable = true; -} +{ services.tigerbeetle.enable = true; } ``` When first started, the TigerBeetle service will create its data file at {file}`/var/lib/tigerbeetle` unless the file already exists, in which case it will just use the existing file. diff --git a/nixos/modules/services/desktop-managers/gnome.md b/nixos/modules/services/desktop-managers/gnome.md index 4b45b0872aa7..1fa248761ada 100644 --- a/nixos/modules/services/desktop-managers/gnome.md +++ b/nixos/modules/services/desktop-managers/gnome.md @@ -26,9 +26,7 @@ The default applications used in NixOS are very minimal, inspired by the default If you’d like to only use the GNOME desktop and not the apps, you can disable them with: ```nix -{ - services.gnome.core-apps.enable = false; -} +{ services.gnome.core-apps.enable = false; } ``` and none of them will be installed. @@ -55,9 +53,7 @@ Note, however, that doing so is not supported and might break some applications. You can install all of the GNOME games with: ```nix -{ - services.gnome.games.enable = true; -} +{ services.gnome.games.enable = true; } ``` ### GNOME core developer tools {#sec-gnome-core-developer-tools} @@ -65,9 +61,7 @@ You can install all of the GNOME games with: You can install GNOME core developer tools with: ```nix -{ - services.gnome.core-developer-tools.enable = true; -} +{ services.gnome.core-developer-tools.enable = true; } ``` ## Enabling GNOME Flashback {#sec-gnome-enable-flashback} @@ -75,9 +69,7 @@ You can install GNOME core developer tools with: GNOME Flashback provides a desktop environment based on the classic GNOME 2 architecture. You can enable the default GNOME Flashback session, which uses the Metacity window manager, with: ```nix -{ - services.desktopManager.gnome.flashback.enableMetacity = true; -} +{ services.desktopManager.gnome.flashback.enableMetacity = true; } ``` It is also possible to create custom sessions that replace Metacity with a different window manager using [](#opt-services.desktopManager.gnome.flashback.customSessions). diff --git a/nixos/modules/services/desktops/flatpak.md b/nixos/modules/services/desktops/flatpak.md index 5299b32a03c7..eae51138e811 100644 --- a/nixos/modules/services/desktops/flatpak.md +++ b/nixos/modules/services/desktops/flatpak.md @@ -9,9 +9,7 @@ applications on Linux. To enable Flatpak, add the following to your {file}`configuration.nix`: ```nix -{ - services.flatpak.enable = true; -} +{ services.flatpak.enable = true; } ``` For the sandboxed apps to work correctly, desktop integration portals need to diff --git a/nixos/modules/services/development/athens.md b/nixos/modules/services/development/athens.md index 6f8181561913..cc339c2f43f3 100644 --- a/nixos/modules/services/development/athens.md +++ b/nixos/modules/services/development/athens.md @@ -20,9 +20,9 @@ A complete list of options for the Athens module may be found A very basic configuration for Athens that acts as a caching and forwarding HTTP proxy is: ```nix { - services.athens = { - enable = true; - }; + services.athens = { + enable = true; + }; } ``` @@ -30,10 +30,10 @@ If you want to prevent Athens from writing to disk, you can instead configure it ```nix { - services.athens = { - enable = true; - storageType = "memory"; - }; + services.athens = { + enable = true; + storageType = "memory"; + }; } ``` @@ -52,9 +52,7 @@ To also use the local proxy for Go builds happening in `nix` (with `buildGoModul This can either be done via the nix-daemon systemd unit: ```nix -{ - systemd.services.nix-daemon.environment.GOPROXY = "http://localhost:3000"; -} +{ systemd.services.nix-daemon.environment.GOPROXY = "http://localhost:3000"; } ``` or via the [impure-env experimental feature](https://nix.dev/manual/nix/2.24/command-ref/conf-file#conf-impure-env): diff --git a/nixos/modules/services/development/blackfire.md b/nixos/modules/services/development/blackfire.md index 5a7fbe68f7d2..ad58e7ba04dd 100644 --- a/nixos/modules/services/development/blackfire.md +++ b/nixos/modules/services/development/blackfire.md @@ -9,10 +9,9 @@ To use it, you will need to enable the agent and the probe on your server. The exact method will depend on the way you use PHP but here is an example of NixOS configuration for PHP-FPM: ```nix let - php = pkgs.php.withExtensions ({ enabled, all }: enabled ++ (with all; [ - blackfire - ])); -in { + php = pkgs.php.withExtensions ({ enabled, all }: enabled ++ (with all; [ blackfire ])); +in +{ # Enable the probe extension for PHP-FPM. services.phpfpm = { phpPackage = php; diff --git a/nixos/modules/services/development/livebook.md b/nixos/modules/services/development/livebook.md index aac9c58d081c..65eb5d55fd86 100644 --- a/nixos/modules/services/development/livebook.md +++ b/nixos/modules/services/development/livebook.md @@ -53,6 +53,9 @@ learning Kinos require `gcc` and `gnumake`. To add these, use ```nix { - services.livebook.extraPackages = with pkgs; [ gcc gnumake ]; + services.livebook.extraPackages = with pkgs; [ + gcc + gnumake + ]; } ``` diff --git a/nixos/modules/services/editors/emacs.md b/nixos/modules/services/editors/emacs.md index da1028675155..a3c9ae5907b0 100644 --- a/nixos/modules/services/editors/emacs.md +++ b/nixos/modules/services/editors/emacs.md @@ -85,23 +85,25 @@ dedicated {file}`emacs.nix` file such as: ```nix /* -This is a nix expression to build Emacs and some Emacs packages I like -from source on any distribution where Nix is installed. This will install -all the dependencies from the nixpkgs repository and build the binary files -without interfering with the host distribution. + This is a nix expression to build Emacs and some Emacs packages I like + from source on any distribution where Nix is installed. This will install + all the dependencies from the nixpkgs repository and build the binary files + without interfering with the host distribution. -To build the project, type the following from the current directory: + To build the project, type the following from the current directory: -$ nix-build emacs.nix + $ nix-build emacs.nix -To run the newly compiled executable: + To run the newly compiled executable: -$ ./result/bin/emacs + $ ./result/bin/emacs */ # The first non-comment line in this file indicates that # the whole file represents a function. -{ pkgs ? import {} }: +{ + pkgs ? import { }, +}: let # The let expression below defines a myEmacs binding pointing to the @@ -113,29 +115,32 @@ let # argument: a function from a package set to a list of packages # (the packages that will be available in Emacs). emacsWithPackages = (pkgs.emacsPackagesFor myEmacs).emacsWithPackages; -in # The rest of the file specifies the list of packages to install. In the # example, two packages (magit and zerodark-theme) are taken from # MELPA stable. - emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [ - magit # ; Integrate git +in +emacsWithPackages ( + epkgs: + (with epkgs.melpaStablePackages; [ + magit # ; Integrate git zerodark-theme # ; Nicolas' theme ]) # Two packages (undo-tree and zoom-frm) are taken from MELPA. ++ (with epkgs.melpaPackages; [ - undo-tree # ; to show the undo tree - zoom-frm # ; increase/decrease font size for all buffers %lt;C-x C-+> + undo-tree # ; to show the undo tree + zoom-frm # ; increase/decrease font size for all buffers %lt;C-x C-+> ]) # Three packages are taken from GNU ELPA. ++ (with epkgs.elpaPackages; [ - auctex # ; LaTeX mode - beacon # ; highlight my cursor when scrolling - nameless # ; hide current package name everywhere in elisp code + auctex # ; LaTeX mode + beacon # ; highlight my cursor when scrolling + nameless # ; hide current package name everywhere in elisp code ]) # notmuch is taken from a nixpkgs derivation which contains an Emacs mode. ++ [ - pkgs.notmuch # From main packages set - ]) + pkgs.notmuch # From main packages set + ] +) ``` ::: @@ -180,9 +185,9 @@ file {file}`configuration.nix` to make it contain: ```nix { - environment.systemPackages = [ - # [...] - (import ./emacs.nix { inherit pkgs; }) + environment.systemPackages = [ + # [...] + (import ./emacs.nix { inherit pkgs; }) ]; } ``` @@ -205,9 +210,14 @@ adding it to your {file}`~/.config/nixpkgs/config.nix` (see ```nix { - packageOverrides = super: let self = super.pkgs; in { - myemacs = import ./emacs.nix { pkgs = self; }; - }; + packageOverrides = + super: + let + self = super.pkgs; + in + { + myemacs = import ./emacs.nix { pkgs = self; }; + }; } ``` ::: @@ -229,20 +239,29 @@ only use {command}`emacsclient`), you can change your file ### Custom Emacs build ```nix -{ pkgs ? import {} }: +{ + pkgs ? import { }, +}: let - myEmacs = (pkgs.emacs.override { - # Use gtk3 instead of the default gtk2 - withGTK3 = true; - withGTK2 = false; - }).overrideAttrs (attrs: { - # I don't want emacs.desktop file because I only use - # emacsclient. - postInstall = (attrs.postInstall or "") + '' - rm $out/share/applications/emacs.desktop - ''; - }); -in [ /* ... */ ] + myEmacs = + (pkgs.emacs.override { + # Use gtk3 instead of the default gtk2 + withGTK3 = true; + withGTK2 = false; + }).overrideAttrs + (attrs: { + # I don't want emacs.desktop file because I only use + # emacsclient. + postInstall = + (attrs.postInstall or "") + + '' + rm $out/share/applications/emacs.desktop + ''; + }); +in +[ + # ... +] ``` ::: @@ -263,9 +282,7 @@ with the user's login session. To install and enable the {command}`systemd` user service for Emacs daemon, add the following to your {file}`configuration.nix`: ```nix -{ - services.emacs.enable = true; -} +{ services.emacs.enable = true; } ``` The {var}`services.emacs.package` option allows a custom diff --git a/nixos/modules/services/hardware/display.md b/nixos/modules/services/hardware/display.md index 019c4cf146eb..5b3b96d571ac 100644 --- a/nixos/modules/services/hardware/display.md +++ b/nixos/modules/services/hardware/display.md @@ -23,8 +23,9 @@ This is exactly the case with [`amdgpu` drivers](https://gitlab.freedesktop.org/ # completely disable output no matter what is connected to it hardware.display.outputs."VGA-2".mode = "d"; - /* equals - boot.kernelParams = [ "video=DP-1:e" "video=VGA-2:d" ]; + /* + equals + boot.kernelParams = [ "video=DP-1:e" "video=VGA-2:d" ]; */ } ``` @@ -37,14 +38,14 @@ To make custom EDID binaries discoverable you should first create a derivation s ```nix { hardware.display.edid.packages = [ - (pkgs.runCommand "edid-custom" {} '' - mkdir -p $out/lib/firmware/edid - base64 -d > "$out/lib/firmware/edid/custom1.bin" <<'EOF' - - EOF - base64 -d > "$out/lib/firmware/edid/custom2.bin" <<'EOF' - - EOF + (pkgs.runCommand "edid-custom" { } '' + mkdir -p $out/lib/firmware/edid + base64 -d > "$out/lib/firmware/edid/custom1.bin" <<'EOF' + + EOF + base64 -d > "$out/lib/firmware/edid/custom2.bin" <<'EOF' + + EOF '') ]; } @@ -63,8 +64,9 @@ Under the hood it adds `drm.edid_firmware` entry to `boot.kernelParams` NixOS op { hardware.display.outputs."VGA-1".edid = "custom1.bin"; hardware.display.outputs."VGA-2".edid = "custom2.bin"; - /* equals: - boot.kernelParams = [ "drm.edid_firmware=VGA-1:edid/custom1.bin,VGA-2:edid/custom2.bin" ]; + /* + equals: + boot.kernelParams = [ "drm.edid_firmware=VGA-1:edid/custom1.bin,VGA-2:edid/custom2.bin" ]; */ } ``` @@ -76,16 +78,20 @@ from https://github.com/linuxhw/EDID based on simple string/regexp search identi ```nix { - hardware.display.edid.linuxhw."PG278Q_2014" = [ "PG278Q" "2014" ]; - - /* equals: - hardware.display.edid.packages = [ - (pkgs.linuxhw-edid-fetcher.override { - displays = { - "PG278Q_2014" = [ "PG278Q" "2014" ]; - }; - }) + hardware.display.edid.linuxhw."PG278Q_2014" = [ + "PG278Q" + "2014" ]; + + /* + equals: + hardware.display.edid.packages = [ + (pkgs.linuxhw-edid-fetcher.override { + displays = { + "PG278Q_2014" = [ "PG278Q" "2014" ]; + }; + }) + ]; */ } ``` @@ -98,19 +104,22 @@ conveniently use [`XFree86 Modeline`](https://en.wikipedia.org/wiki/XFree86_Mode ```nix { - hardware.display.edid.modelines."PG278Q_60" = " 241.50 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync"; - hardware.display.edid.modelines."PG278Q_120" = " 497.75 2560 2608 2640 2720 1440 1443 1448 1525 +hsync -vsync"; + hardware.display.edid.modelines."PG278Q_60" = + " 241.50 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync"; + hardware.display.edid.modelines."PG278Q_120" = + " 497.75 2560 2608 2640 2720 1440 1443 1448 1525 +hsync -vsync"; - /* equals: - hardware.display.edid.packages = [ - (pkgs.edid-generator.overrideAttrs { - clean = true; - modelines = '' - Modeline "PG278Q_60" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync - Modeline "PG278Q_120" 497.75 2560 2608 2640 2720 1440 1443 1448 1525 +hsync -vsync - ''; - }) - ]; + /* + equals: + hardware.display.edid.packages = [ + (pkgs.edid-generator.overrideAttrs { + clean = true; + modelines = '' + Modeline "PG278Q_60" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync + Modeline "PG278Q_120" 497.75 2560 2608 2640 2720 1440 1443 1448 1525 +hsync -vsync + ''; + }) + ]; */ } ``` @@ -121,8 +130,10 @@ And finally this is a complete working example for a 2014 (first) batch of [Asus ```nix { - hardware.display.edid.modelines."PG278Q_60" = " 241.50 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync"; - hardware.display.edid.modelines."PG278Q_120" = " 497.75 2560 2608 2640 2720 1440 1443 1448 1525 +hsync -vsync"; + hardware.display.edid.modelines."PG278Q_60" = + " 241.50 2560 2608 2640 2720 1440 1443 1448 1481 -hsync +vsync"; + hardware.display.edid.modelines."PG278Q_120" = + " 497.75 2560 2608 2640 2720 1440 1443 1448 1525 +hsync -vsync"; hardware.display.outputs."DP-1".edid = "PG278Q_60.bin"; hardware.display.outputs."DP-1".mode = "e"; diff --git a/nixos/modules/services/mail/mailman.md b/nixos/modules/services/mail/mailman.md index 446aa1f921b6..b36ce69392c5 100644 --- a/nixos/modules/services/mail/mailman.md +++ b/nixos/modules/services/mail/mailman.md @@ -10,26 +10,31 @@ an existing, securely configured Postfix setup, as it does not automatically con For a basic configuration with Postfix as the MTA, the following settings are suggested: ```nix -{ config, ... }: { +{ config, ... }: +{ services.postfix = { enable = true; - relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"]; + relayDomains = [ "hash:/var/lib/mailman/data/postfix_domains" ]; sslCert = config.security.acme.certs."lists.example.org".directory + "/full.pem"; sslKey = config.security.acme.certs."lists.example.org".directory + "/key.pem"; config = { - transport_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; - local_recipient_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; + transport_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; + local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ]; }; }; services.mailman = { enable = true; serve.enable = true; hyperkitty.enable = true; - webHosts = ["lists.example.org"]; + webHosts = [ "lists.example.org" ]; siteOwner = "mailman@example.org"; }; services.nginx.virtualHosts."lists.example.org".enableACME = true; - networking.firewall.allowedTCPPorts = [ 25 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 25 + 80 + 443 + ]; } ``` @@ -51,7 +56,8 @@ necessary, but outside the scope of the Mailman module. Mailman also supports other MTA, though with a little bit more configuration. For example, to use Mailman with Exim, you can use the following settings: ```nix -{ config, ... }: { +{ config, ... }: +{ services = { mailman = { enable = true; diff --git a/nixos/modules/services/matrix/maubot.md b/nixos/modules/services/matrix/maubot.md index d49066057a23..46a0caaedefc 100644 --- a/nixos/modules/services/matrix/maubot.md +++ b/nixos/modules/services/matrix/maubot.md @@ -10,9 +10,7 @@ framework for Matrix. 2. If you want to use PostgreSQL instead of SQLite, do this: ```nix - { - services.maubot.settings.database = "postgresql://maubot@localhost/maubot"; - } + { services.maubot.settings.database = "postgresql://maubot@localhost/maubot"; } ``` If the PostgreSQL connection requires a password, you will have to diff --git a/nixos/modules/services/matrix/mjolnir.md b/nixos/modules/services/matrix/mjolnir.md index 2594f05ce27b..e2a7e3806cb7 100644 --- a/nixos/modules/services/matrix/mjolnir.md +++ b/nixos/modules/services/matrix/mjolnir.md @@ -52,13 +52,11 @@ will be configured to connect to the new Pantalaimon instance. enable = true; homeserverUrl = "https://matrix.domain.tld"; pantalaimon = { - enable = true; - username = "mjolnir"; - passwordFile = "/run/secrets/mjolnir-password"; + enable = true; + username = "mjolnir"; + passwordFile = "/run/secrets/mjolnir-password"; }; - protectedRooms = [ - "https://matrix.to/#/!xxx:domain.tld" - ]; + protectedRooms = [ "https://matrix.to/#/!xxx:domain.tld" ]; managementRoom = "!yyy:domain.tld"; }; } @@ -81,9 +79,7 @@ to the Synapse plugin list and enable the `mjolnir.Module` module. ```nix { services.matrix-synapse = { - plugins = with pkgs; [ - matrix-synapse-plugins.matrix-synapse-mjolnir-antispam - ]; + plugins = with pkgs; [ matrix-synapse-plugins.matrix-synapse-mjolnir-antispam ]; extraConfig = '' modules: - module: mjolnir.Module diff --git a/nixos/modules/services/matrix/synapse.md b/nixos/modules/services/matrix/synapse.md index 62967adddb4b..7ca8e1c354ff 100644 --- a/nixos/modules/services/matrix/synapse.md +++ b/nixos/modules/services/matrix/synapse.md @@ -44,7 +44,12 @@ the host `myhostname.example.org`. For more information, please refer to the [installation instructions of Synapse](https://element-hq.github.io/synapse/latest/setup/installation.html) . ```nix -{ pkgs, lib, config, ... }: +{ + pkgs, + lib, + config, + ... +}: let fqdn = "${config.networking.hostName}.${config.networking.domain}"; baseUrl = "https://${fqdn}"; @@ -55,10 +60,14 @@ let add_header Access-Control-Allow-Origin *; return 200 '${builtins.toJSON data}'; ''; -in { +in +{ networking.hostName = "myhostname"; networking.domain = "example.org"; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; services.postgresql.enable = true; @@ -117,15 +126,21 @@ in { # in client applications. settings.public_baseurl = baseUrl; settings.listeners = [ - { port = 8008; + { + port = 8008; bind_addresses = [ "::1" ]; type = "http"; tls = false; x_forwarded = true; - resources = [ { - names = [ "client" "federation" ]; - compress = true; - } ]; + resources = [ + { + names = [ + "client" + "federation" + ]; + compress = true; + } + ]; } ]; }; @@ -173,9 +188,7 @@ in an additional file like this: ```nix { - services.matrix-synapse.extraConfigFiles = [ - "/run/secrets/matrix-shared-secret" - ]; + services.matrix-synapse.extraConfigFiles = [ "/run/secrets/matrix-shared-secret" ]; } ``` ::: @@ -208,9 +221,7 @@ for a list of existing clients and their supported featureset. services.nginx.virtualHosts."element.${fqdn}" = { enableACME = true; forceSSL = true; - serverAliases = [ - "element.${config.networking.domain}" - ]; + serverAliases = [ "element.${config.networking.domain}" ]; root = pkgs.element-web.override { conf = { diff --git a/nixos/modules/services/misc/anki-sync-server.md b/nixos/modules/services/misc/anki-sync-server.md index 1210cad6d0af..8040f2da1b72 100644 --- a/nixos/modules/services/misc/anki-sync-server.md +++ b/nixos/modules/services/misc/anki-sync-server.md @@ -46,9 +46,7 @@ By default, synced data are stored in */var/lib/anki-sync-server/*ankiuser**. You can change the directory by using `services.anki-sync-server.baseDirectory` ```nix -{ - services.anki-sync-server.baseDirectory = "/home/anki/data"; -} +{ services.anki-sync-server.baseDirectory = "/home/anki/data"; } ``` By default, the server listen address {option}`services.anki-sync-server.host` diff --git a/nixos/modules/services/misc/dump1090-fa.md b/nixos/modules/services/misc/dump1090-fa.md index 835d91e61828..41b9bd02d2c0 100644 --- a/nixos/modules/services/misc/dump1090-fa.md +++ b/nixos/modules/services/misc/dump1090-fa.md @@ -9,7 +9,8 @@ When enabled, this module automatically creates a systemd service to start the ` Exposing the integrated web interface is left to the user's configuration. Below is a minimal example demonstrating how to serve it using Nginx: ```nix -{ pkgs, ... }: { +{ pkgs, ... }: +{ services.dump1090-fa.enable = true; services.nginx = { @@ -22,5 +23,4 @@ Exposing the integrated web interface is left to the user's configuration. Below }; }; } - ``` diff --git a/nixos/modules/services/misc/forgejo.md b/nixos/modules/services/misc/forgejo.md index cca557408639..3ae80b5adbe9 100644 --- a/nixos/modules/services/misc/forgejo.md +++ b/nixos/modules/services/misc/forgejo.md @@ -53,7 +53,7 @@ let repo = "nixpkgs"; rev = "3bb45b041e7147e2fd2daf689e26a1f970a55d65"; hash = "sha256-8JL5NI9eUcGzzbR/ARkrG81WLwndoxqI650mA/4rUGI="; - }) {}; + }) { }; in { services.forgejo.package = nixpkgs-forgejo-10.forgejo; @@ -114,6 +114,6 @@ Make sure to disable `services.gitea`, when doing this. isSystemUser = true; }; - users.groups.gitea = {}; + users.groups.gitea = { }; } ``` diff --git a/nixos/modules/services/misc/gitlab.md b/nixos/modules/services/misc/gitlab.md index f7a5a8027489..de1e256bfef3 100644 --- a/nixos/modules/services/misc/gitlab.md +++ b/nixos/modules/services/misc/gitlab.md @@ -64,7 +64,9 @@ A basic configuration with some custom settings could look like this: email_from = "gitlab-no-reply@example.com"; email_display_name = "Example GitLab"; email_reply_to = "gitlab-no-reply@example.com"; - default_projects_features = { builds = false; }; + default_projects_features = { + builds = false; + }; }; }; }; diff --git a/nixos/modules/services/misc/paisa.md b/nixos/modules/services/misc/paisa.md index e16b52cbcdb6..1f5239b8f3c3 100644 --- a/nixos/modules/services/misc/paisa.md +++ b/nixos/modules/services/misc/paisa.md @@ -21,9 +21,7 @@ configure this in the module, but you can e.g. use systemd to give the unit access to the command at runtime. ```nix -{ - systemd.services.paisa.path = [ pkgs.hledger ]; -} +{ systemd.services.paisa.path = [ pkgs.hledger ]; } ``` ::: {.note} diff --git a/nixos/modules/services/monitoring/parsedmarc.md b/nixos/modules/services/monitoring/parsedmarc.md index 765846bbbaf3..077988ff6278 100644 --- a/nixos/modules/services/monitoring/parsedmarc.md +++ b/nixos/modules/services/monitoring/parsedmarc.md @@ -80,7 +80,7 @@ added to Grafana as well. # Not required, but recommended for full functionality services.geoipupdate = { settings = { - AccountID = 000000; + AccountID = 0; LicenseKey = "/path/to/license_key_file"; }; }; @@ -104,7 +104,7 @@ added to Grafana as well. recommendedOptimisation = true; recommendedGzipSettings = true; recommendedProxySettings = true; - upstreams.grafana.servers."unix:/${config.services.grafana.socket}" = {}; + upstreams.grafana.servers."unix:/${config.services.grafana.socket}" = { }; virtualHosts.${url} = { root = config.services.grafana.staticRootPath; enableACME = true; diff --git a/nixos/modules/services/monitoring/prometheus/exporters.md b/nixos/modules/services/monitoring/prometheus/exporters.md index 23464b9d315e..f0bff8154291 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.md +++ b/nixos/modules/services/monitoring/prometheus/exporters.md @@ -18,9 +18,7 @@ running on. The exporter could be configured as follows: "logind" "systemd" ]; - disabledCollectors = [ - "textfile" - ]; + disabledCollectors = [ "textfile" ]; openFirewall = true; firewallFilter = "-i br0 -p tcp -m tcp --dport 9100"; }; @@ -39,20 +37,24 @@ the [available options](https://nixos.org/nixos/options.html#prometheus.exporter Prometheus can now be configured to consume the metrics produced by the exporter: ```nix { - services.prometheus = { - # ... + services.prometheus = { + # ... - scrapeConfigs = [ - { - job_name = "node"; - static_configs = [{ - targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; - }]; - } - ]; + scrapeConfigs = [ + { + job_name = "node"; + static_configs = [ + { + targets = [ + "localhost:${toString config.services.prometheus.exporters.node.port}" + ]; + } + ]; + } + ]; - # ... - }; + # ... + }; } ``` @@ -82,7 +84,12 @@ example: specific options and configuration: ```nix # nixpkgs/nixos/modules/services/prometheus/exporters/postfix.nix - { config, lib, pkgs, options }: + { + config, + lib, + pkgs, + options, + }: let # for convenience we define cfg here cfg = config.services.prometheus.exporters.postfix; @@ -151,7 +158,12 @@ Should an exporter option change at some point, it is possible to add information about the change to the exporter definition similar to `nixpkgs/nixos/modules/rename.nix`: ```nix -{ config, lib, pkgs, options }: +{ + config, + lib, + pkgs, + options, +}: let cfg = config.services.prometheus.exporters.nginx; diff --git a/nixos/modules/services/network-filesystems/litestream/default.md b/nixos/modules/services/network-filesystems/litestream/default.md index 626d69df84a5..f422419a98a6 100644 --- a/nixos/modules/services/network-filesystems/litestream/default.md +++ b/nixos/modules/services/network-filesystems/litestream/default.md @@ -13,24 +13,26 @@ required permissions to access [grafana database](#opt-services.grafana.settings { users.users.litestream.extraGroups = [ "grafana" ]; - systemd.services.grafana.serviceConfig.ExecStartPost = "+" + pkgs.writeShellScript "grant-grafana-permissions" '' - timeout=10 + systemd.services.grafana.serviceConfig.ExecStartPost = + "+" + + pkgs.writeShellScript "grant-grafana-permissions" '' + timeout=10 - while [ ! -f /var/lib/grafana/data/grafana.db ]; - do - if [ "$timeout" == 0 ]; then - echo "ERROR: Timeout while waiting for /var/lib/grafana/data/grafana.db." - exit 1 - fi + while [ ! -f /var/lib/grafana/data/grafana.db ]; + do + if [ "$timeout" == 0 ]; then + echo "ERROR: Timeout while waiting for /var/lib/grafana/data/grafana.db." + exit 1 + fi - sleep 1 + sleep 1 - ((timeout--)) - done + ((timeout--)) + done - find /var/lib/grafana -type d -exec chmod -v 775 {} \; - find /var/lib/grafana -type f -exec chmod -v 660 {} \; - ''; + find /var/lib/grafana -type d -exec chmod -v 775 {} \; + find /var/lib/grafana -type f -exec chmod -v 660 {} \; + ''; services.litestream = { enable = true; @@ -41,9 +43,7 @@ required permissions to access [grafana database](#opt-services.grafana.settings dbs = [ { path = "/var/lib/grafana/data/grafana.db"; - replicas = [{ - url = "s3://mybkt.litestream.io/grafana"; - }]; + replicas = [ { url = "s3://mybkt.litestream.io/grafana"; } ]; } ]; }; diff --git a/nixos/modules/services/network-filesystems/samba.md b/nixos/modules/services/network-filesystems/samba.md index 229320220974..bf55c24e1ede 100644 --- a/nixos/modules/services/network-filesystems/samba.md +++ b/nixos/modules/services/network-filesystems/samba.md @@ -7,9 +7,7 @@ A minimal configuration looks like this: ```nix -{ - services.samba.enable = true; -} +{ services.samba.enable = true; } ``` This configuration automatically enables `smbd`, `nmbd` and `winbindd` services by default. diff --git a/nixos/modules/services/networking/anubis.md b/nixos/modules/services/networking/anubis.md index 8a9a2ea76aa6..533ece7bfbd3 100644 --- a/nixos/modules/services/networking/anubis.md +++ b/nixos/modules/services/networking/anubis.md @@ -11,7 +11,8 @@ instances, but TCP sockets are also supported. A minimal configuration with [nginx](#opt-services.nginx.enable) may look like the following: ```nix -{ config, ... }: { +{ config, ... }: +{ services.anubis.instances.default.settings.TARGET = "http://localhost:8000"; # required due to unix socket permissions @@ -49,7 +50,9 @@ It is possible to configure default settings for all instances of Anubis, via {o ```nix { services.anubis.defaultOptions = { - botPolicy = { dnsbl = false; }; + botPolicy = { + dnsbl = false; + }; settings.DIFFICULTY = 3; }; } diff --git a/nixos/modules/services/networking/atalkd.md b/nixos/modules/services/networking/atalkd.md index 3b999680ce33..034e22a4c9d8 100644 --- a/nixos/modules/services/networking/atalkd.md +++ b/nixos/modules/services/networking/atalkd.md @@ -10,7 +10,7 @@ A minimal configuration looks like this: { services.atalkd = { enable = true; - interfaces.wlan0.config = "-router -phase 2 -net 1 -addr 1.48 -zone \"Default\""; + interfaces.wlan0.config = ''-router -phase 2 -net 1 -addr 1.48 -zone "Default"''; }; } ``` diff --git a/nixos/modules/services/networking/crab-hole.md b/nixos/modules/services/networking/crab-hole.md index 52a452b91545..a3e1919a92e1 100644 --- a/nixos/modules/services/networking/crab-hole.md +++ b/nixos/modules/services/networking/crab-hole.md @@ -209,7 +209,5 @@ For ACME for example this would be `acme:acme`. To give the crab-hole service access to these files, the group which owns the certificate can be added as a supplementary group to the service. For ACME for example: ```nix -{ - services.crab-hole.supplementaryGroups = [ "acme" ]; -} +{ services.crab-hole.supplementaryGroups = [ "acme" ]; } ``` diff --git a/nixos/modules/services/networking/doh-server.md b/nixos/modules/services/networking/doh-server.md index 2ac1630aa29d..730100eec688 100644 --- a/nixos/modules/services/networking/doh-server.md +++ b/nixos/modules/services/networking/doh-server.md @@ -35,7 +35,10 @@ Setup with Nginx + ACME (recommended): defaults.email = "you@example.com"; }; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; } ``` diff --git a/nixos/modules/services/networking/jotta-cli.md b/nixos/modules/services/networking/jotta-cli.md index d5629465377d..7e84aa18599a 100644 --- a/nixos/modules/services/networking/jotta-cli.md +++ b/nixos/modules/services/networking/jotta-cli.md @@ -5,9 +5,7 @@ The [Jottacloud Command-line Tool](https://docs.jottacloud.com/en/articles/14368 ## Quick Start {#module-services-jotta-cli-quick-start} ```nix -{ - services.jotta-cli.enable = true; -} +{ services.jotta-cli.enable = true; } ``` This adds `jotta-cli` to `environment.systemPackages` and starts a user service that runs `jottad` with the default options. diff --git a/nixos/modules/services/networking/mosquitto.md b/nixos/modules/services/networking/mosquitto.md index 66b3ad6cfa8f..53b5beb16b89 100644 --- a/nixos/modules/services/networking/mosquitto.md +++ b/nixos/modules/services/networking/mosquitto.md @@ -10,11 +10,13 @@ A minimal configuration for Mosquitto is { services.mosquitto = { enable = true; - listeners = [ { - acl = [ "pattern readwrite #" ]; - omitPasswordAuth = true; - settings.allow_anonymous = true; - } ]; + listeners = [ + { + acl = [ "pattern readwrite #" ]; + omitPasswordAuth = true; + settings.allow_anonymous = true; + } + ]; }; } ``` @@ -30,18 +32,20 @@ like { services.mosquitto = { enable = true; - listeners = [ { - users = { - monitor = { - acl = [ "read #" ]; - password = "monitor"; + listeners = [ + { + users = { + monitor = { + acl = [ "read #" ]; + password = "monitor"; + }; + service = { + acl = [ "write service/#" ]; + password = "service"; + }; }; - service = { - acl = [ "write service/#" ]; - password = "service"; - }; - }; - } ]; + } + ]; }; } ``` @@ -52,15 +56,17 @@ TLS authentication is configured by setting TLS-related options of the listener: { services.mosquitto = { enable = true; - listeners = [ { - port = 8883; # port change is not required, but helpful to avoid mistakes - # ... - settings = { - cafile = "/path/to/mqtt.ca.pem"; - certfile = "/path/to/mqtt.pem"; - keyfile = "/path/to/mqtt.key"; - }; - } ]; + listeners = [ + { + port = 8883; # port change is not required, but helpful to avoid mistakes + # ... + settings = { + cafile = "/path/to/mqtt.ca.pem"; + certfile = "/path/to/mqtt.pem"; + keyfile = "/path/to/mqtt.key"; + }; + } + ]; }; } ``` diff --git a/nixos/modules/services/networking/netbird.md b/nixos/modules/services/networking/netbird.md index 876c27cb0d22..37e104795237 100644 --- a/nixos/modules/services/networking/netbird.md +++ b/nixos/modules/services/networking/netbird.md @@ -5,9 +5,7 @@ The absolute minimal configuration for the Netbird client daemon looks like this: ```nix -{ - services.netbird.enable = true; -} +{ services.netbird.enable = true; } ``` This will set up a netbird service listening on the port `51820` associated to the diff --git a/nixos/modules/services/networking/pleroma.md b/nixos/modules/services/networking/pleroma.md index c2313fd63e6a..b2a366a0fd38 100644 --- a/nixos/modules/services/networking/pleroma.md +++ b/nixos/modules/services/networking/pleroma.md @@ -47,34 +47,34 @@ This is an example of configuration, where [](#opt-services.pleroma.configs) opt secretConfigFile = "/var/lib/pleroma/secrets.exs"; configs = [ '' - import Config + import Config - config :pleroma, Pleroma.Web.Endpoint, - url: [host: "pleroma.example.net", scheme: "https", port: 443], - http: [ip: {127, 0, 0, 1}, port: 4000] + config :pleroma, Pleroma.Web.Endpoint, + url: [host: "pleroma.example.net", scheme: "https", port: 443], + http: [ip: {127, 0, 0, 1}, port: 4000] - config :pleroma, :instance, - name: "Test", - email: "admin@example.net", - notify_email: "admin@example.net", - limit: 5000, - registrations_open: true + config :pleroma, :instance, + name: "Test", + email: "admin@example.net", + notify_email: "admin@example.net", + limit: 5000, + registrations_open: true - config :pleroma, :media_proxy, - enabled: false, - redirect_on_failure: true + config :pleroma, :media_proxy, + enabled: false, + redirect_on_failure: true - config :pleroma, Pleroma.Repo, - adapter: Ecto.Adapters.Postgres, - username: "pleroma", - database: "pleroma", - hostname: "localhost" + config :pleroma, Pleroma.Repo, + adapter: Ecto.Adapters.Postgres, + username: "pleroma", + database: "pleroma", + hostname: "localhost" - # Configure web push notifications - config :web_push_encryption, :vapid_details, - subject: "mailto:admin@example.net" + # Configure web push notifications + config :web_push_encryption, :vapid_details, + subject: "mailto:admin@example.net" - # ... TO CONTINUE ... + # ... TO CONTINUE ... '' ]; }; diff --git a/nixos/modules/services/networking/prosody.md b/nixos/modules/services/networking/prosody.md index d6eee4e29f0a..f3042dedd163 100644 --- a/nixos/modules/services/networking/prosody.md +++ b/nixos/modules/services/networking/prosody.md @@ -33,16 +33,14 @@ endpoint will look like this: ssl.cert = "/var/lib/acme/example.org/fullchain.pem"; ssl.key = "/var/lib/acme/example.org/key.pem"; virtualHosts."example.org" = { - enabled = true; - domain = "example.org"; - ssl.cert = "/var/lib/acme/example.org/fullchain.pem"; - ssl.key = "/var/lib/acme/example.org/key.pem"; + enabled = true; + domain = "example.org"; + ssl.cert = "/var/lib/acme/example.org/fullchain.pem"; + ssl.key = "/var/lib/acme/example.org/key.pem"; }; - muc = [ { - domain = "conference.example.org"; - } ]; + muc = [ { domain = "conference.example.org"; } ]; uploadHttp = { - domain = "upload.example.org"; + domain = "upload.example.org"; }; }; } @@ -68,7 +66,10 @@ a TLS certificate for the three endponits: "example.org" = { webroot = "/var/www/example.org"; email = "root@example.org"; - extraDomainNames = [ "conference.example.org" "upload.example.org" ]; + extraDomainNames = [ + "conference.example.org" + "upload.example.org" + ]; }; }; }; diff --git a/nixos/modules/services/networking/yggdrasil.md b/nixos/modules/services/networking/yggdrasil.md index 7b899f9d6ddb..1b6f1868a434 100644 --- a/nixos/modules/services/networking/yggdrasil.md +++ b/nixos/modules/services/networking/yggdrasil.md @@ -17,8 +17,8 @@ An annotated example of a simple configuration: services.yggdrasil = { enable = true; persistentKeys = false; - # The NixOS module will generate new keys and a new IPv6 address each time - # it is started if persistentKeys is not enabled. + # The NixOS module will generate new keys and a new IPv6 address each time + # it is started if persistentKeys is not enabled. settings = { Peers = [ @@ -44,13 +44,17 @@ let address = "210:5217:69c0:9afc:1b95:b9f:8718:c3d2"; prefix = "310:5217:69c0:9afc"; # taken from the output of "yggdrasilctl getself". -in { +in +{ services.yggdrasil = { enable = true; persistentKeys = true; # Maintain a fixed public key and IPv6 address. settings = { - Peers = [ "tcp://1.2.3.4:1024" "tcp://1.2.3.5:1024" ]; + Peers = [ + "tcp://1.2.3.4:1024" + "tcp://1.2.3.5:1024" + ]; NodeInfo = { # This information is visible to the network. name = config.networking.hostName; @@ -60,13 +64,15 @@ in { }; boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1; - # Forward traffic under the prefix. + # Forward traffic under the prefix. - networking.interfaces.${eth0}.ipv6.addresses = [{ - # Set a 300::/8 address on the local physical device. - address = prefix + "::1"; - prefixLength = 64; - }]; + networking.interfaces.${eth0}.ipv6.addresses = [ + { + # Set a 300::/8 address on the local physical device. + address = prefix + "::1"; + prefixLength = 64; + } + ]; services.radvd = { # Announce the 300::/8 prefix to eth0. @@ -93,7 +99,7 @@ host: ```nix let yggPrefix64 = "310:5217:69c0:9afc"; - # Again, taken from the output of "yggdrasilctl getself". + # Again, taken from the output of "yggdrasilctl getself". in { boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1; @@ -105,10 +111,12 @@ in interfaces.br0 = { # … configured with a prefix address. - ipv6.addresses = [{ - address = "${yggPrefix64}::1"; - prefixLength = 64; - }]; + ipv6.addresses = [ + { + address = "${yggPrefix64}::1"; + prefixLength = 64; + } + ]; }; }; @@ -117,24 +125,30 @@ in privateNetwork = true; hostBridge = "br0"; # Attach the container to the bridge only. - config = { config, pkgs, ... }: { - networking.interfaces.eth0.ipv6 = { - addresses = [{ - # Configure a prefix address. - address = "${yggPrefix64}::2"; - prefixLength = 64; - }]; - routes = [{ - # Configure the prefix route. - address = "200::"; - prefixLength = 7; - via = "${yggPrefix64}::1"; - }]; - }; + config = + { config, pkgs, ... }: + { + networking.interfaces.eth0.ipv6 = { + addresses = [ + { + # Configure a prefix address. + address = "${yggPrefix64}::2"; + prefixLength = 64; + } + ]; + routes = [ + { + # Configure the prefix route. + address = "200::"; + prefixLength = 7; + via = "${yggPrefix64}::1"; + } + ]; + }; - services.httpd.enable = true; - networking.firewall.allowedTCPPorts = [ 80 ]; - }; + services.httpd.enable = true; + networking.firewall.allowedTCPPorts = [ 80 ]; + }; }; } diff --git a/nixos/modules/services/search/meilisearch.md b/nixos/modules/services/search/meilisearch.md index db53777e063d..5f906ae9ed96 100644 --- a/nixos/modules/services/search/meilisearch.md +++ b/nixos/modules/services/search/meilisearch.md @@ -7,9 +7,7 @@ Meilisearch is a lightweight, fast and powerful search engine. Think elastic sea the minimum to start meilisearch is ```nix -{ - services.meilisearch.enable = true; -} +{ services.meilisearch.enable = true; } ``` this will start the http server included with meilisearch on port 7700. diff --git a/nixos/modules/services/system/kerberos/kerberos-server.md b/nixos/modules/services/system/kerberos/kerberos-server.md index ba3b1057f382..4aa883b8e68b 100644 --- a/nixos/modules/services/system/kerberos/kerberos-server.md +++ b/nixos/modules/services/system/kerberos/kerberos-server.md @@ -30,7 +30,15 @@ To enable a Kerberos server: enable = true; settings = { realms."EXAMPLE.COM" = { - acl = [{ principal = "adminuser"; access= ["add" "cpw"]; }]; + acl = [ + { + principal = "adminuser"; + access = [ + "add" + "cpw" + ]; + } + ]; }; }; }; diff --git a/nixos/modules/services/system/systemd-lock-handler.md b/nixos/modules/services/system/systemd-lock-handler.md index ac9ee00ae4bc..779fdab3b44d 100644 --- a/nixos/modules/services/system/systemd-lock-handler.md +++ b/nixos/modules/services/system/systemd-lock-handler.md @@ -17,17 +17,17 @@ For example, to create a service for `swaylock`: systemd.user.services.swaylock = { description = "Screen locker for Wayland"; - documentation = ["man:swaylock(1)"]; + documentation = [ "man:swaylock(1)" ]; # If swaylock exits cleanly, unlock the session: - onSuccess = ["unlock.target"]; + onSuccess = [ "unlock.target" ]; # When lock.target is stopped, stops this too: - partOf = ["lock.target"]; + partOf = [ "lock.target" ]; # Delay lock.target until this service is ready: - before = ["lock.target"]; - wantedBy = ["lock.target"]; + before = [ "lock.target" ]; + wantedBy = [ "lock.target" ]; serviceConfig = { # systemd will consider this service started when swaylock forks... diff --git a/nixos/modules/services/web-apps/akkoma.md b/nixos/modules/services/web-apps/akkoma.md index 13b074b228a4..e05ab034de2d 100644 --- a/nixos/modules/services/web-apps/akkoma.md +++ b/nixos/modules/services/web-apps/akkoma.md @@ -139,9 +139,8 @@ received by the instance. ```nix { - services.akkoma.config.":pleroma".":mrf".policies = - map (pkgs.formats.elixirConf { }).lib.mkRaw [ - "Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy" + services.akkoma.config.":pleroma".":mrf".policies = map (pkgs.formats.elixirConf { }).lib.mkRaw [ + "Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy" ]; } ``` @@ -171,29 +170,35 @@ derivation. ```nix { - services.akkoma.frontends.primary.package = pkgs.runCommand "akkoma-fe" { - config = builtins.toJSON { - expertLevel = 1; - collapseMessageWithSubject = false; - stopGifs = false; - replyVisibility = "following"; - webPushHideIfCW = true; - hideScopeNotice = true; - renderMisskeyMarkdown = false; - hideSiteFavicon = true; - postContentType = "text/markdown"; - showNavShortcuts = false; - }; - nativeBuildInputs = with pkgs; [ jq xorg.lndir ]; - passAsFile = [ "config" ]; - } '' - mkdir $out - lndir ${pkgs.akkoma-frontends.akkoma-fe} $out + services.akkoma.frontends.primary.package = + pkgs.runCommand "akkoma-fe" + { + config = builtins.toJSON { + expertLevel = 1; + collapseMessageWithSubject = false; + stopGifs = false; + replyVisibility = "following"; + webPushHideIfCW = true; + hideScopeNotice = true; + renderMisskeyMarkdown = false; + hideSiteFavicon = true; + postContentType = "text/markdown"; + showNavShortcuts = false; + }; + nativeBuildInputs = with pkgs; [ + jq + xorg.lndir + ]; + passAsFile = [ "config" ]; + } + '' + mkdir $out + lndir ${pkgs.akkoma-frontends.akkoma-fe} $out - rm $out/static/config.json - jq -s add ${pkgs.akkoma-frontends.akkoma-fe}/static/config.json ${config} \ - >$out/static/config.json - ''; + rm $out/static/config.json + jq -s add ${pkgs.akkoma-frontends.akkoma-fe}/static/config.json ${config} \ + >$out/static/config.json + ''; } ``` @@ -212,15 +217,11 @@ of the fediverse and providing a pleasant experience to the users of an instance ```nix { services.akkoma.config.":pleroma" = with (pkgs.formats.elixirConf { }).lib; { - ":mrf".policies = map mkRaw [ - "Pleroma.Web.ActivityPub.MRF.SimplePolicy" - ]; + ":mrf".policies = map mkRaw [ "Pleroma.Web.ActivityPub.MRF.SimplePolicy" ]; ":mrf_simple" = { # Tag all media as sensitive - media_nsfw = mkMap { - "nsfw.weird.kinky" = "Untagged NSFW content"; - }; + media_nsfw = mkMap { "nsfw.weird.kinky" = "Untagged NSFW content"; }; # Reject all activities except deletes reject = mkMap { @@ -244,11 +245,12 @@ the file name. ```nix { services.akkoma.config.":pleroma"."Pleroma.Upload".filters = - map (pkgs.formats.elixirConf { }).lib.mkRaw [ - "Pleroma.Upload.Filter.Exiftool" - "Pleroma.Upload.Filter.Dedupe" - "Pleroma.Upload.Filter.AnonymizeFilename" - ]; + map (pkgs.formats.elixirConf { }).lib.mkRaw + [ + "Pleroma.Upload.Filter.Exiftool" + "Pleroma.Upload.Filter.Dedupe" + "Pleroma.Upload.Filter.AnonymizeFilename" + ]; } ``` @@ -322,9 +324,7 @@ details. The Akkoma systemd service may be confined to a chroot with ```nix -{ - services.systemd.akkoma.confinement.enable = true; -} +{ services.systemd.akkoma.confinement.enable = true; } ``` Confinement of services is not generally supported in NixOS and therefore disabled by default. diff --git a/nixos/modules/services/web-apps/c2fmzq-server.md b/nixos/modules/services/web-apps/c2fmzq-server.md index d8e59b3ad210..3eb44d7d9499 100644 --- a/nixos/modules/services/web-apps/c2fmzq-server.md +++ b/nixos/modules/services/web-apps/c2fmzq-server.md @@ -5,9 +5,7 @@ including but not limited to pictures and videos. The service `c2fmzq-server` can be enabled by setting ```nix -{ - services.c2fmzq-server.enable = true; -} +{ services.c2fmzq-server.enable = true; } ``` This will spin up an instance of the server which is API-compatible with [Stingle Photos](https://stingle.org) and an experimental Progressive Web App diff --git a/nixos/modules/services/web-apps/castopod.md b/nixos/modules/services/web-apps/castopod.md index 5ecd807686fd..6c654c6ad363 100644 --- a/nixos/modules/services/web-apps/castopod.md +++ b/nixos/modules/services/web-apps/castopod.md @@ -9,7 +9,10 @@ Use the following configuration to start a public instance of Castopod on `casto ```nix { - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; services.castopod = { enable = true; database.createLocally = true; diff --git a/nixos/modules/services/web-apps/filesender.md b/nixos/modules/services/web-apps/filesender.md index bb971fb984e5..0f768857e905 100644 --- a/nixos/modules/services/web-apps/filesender.md +++ b/nixos/modules/services/web-apps/filesender.md @@ -10,10 +10,13 @@ Minimal working instance of FileSender that uses password-authentication would l ```nix let - format = pkgs.formats.php {}; + format = pkgs.formats.php { }; in { - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; services.filesender = { enable = true; localDomain = "filesender.example.com"; diff --git a/nixos/modules/services/web-apps/gotosocial.md b/nixos/modules/services/web-apps/gotosocial.md index b3540f0d5811..f498fdbef506 100644 --- a/nixos/modules/services/web-apps/gotosocial.md +++ b/nixos/modules/services/web-apps/gotosocial.md @@ -33,7 +33,10 @@ HTTP reverse proxy such as nginx. ```nix { - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; services.nginx = { enable = true; clientMaxBodySize = "40M"; diff --git a/nixos/modules/services/web-apps/jitsi-meet.md b/nixos/modules/services/web-apps/jitsi-meet.md index 705cf69274ca..6ac8b8a0b6e9 100644 --- a/nixos/modules/services/web-apps/jitsi-meet.md +++ b/nixos/modules/services/web-apps/jitsi-meet.md @@ -13,7 +13,10 @@ A minimal configuration using Let's Encrypt for TLS certificates looks like this hostName = "jitsi.example.com"; }; services.jitsi-videobridge.openFirewall = true; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; security.acme.email = "me@example.com"; security.acme.acceptTerms = true; } @@ -46,7 +49,10 @@ Here is the minimal configuration with additional configurations: }; }; services.jitsi-videobridge.openFirewall = true; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; security.acme.email = "me@example.com"; security.acme.acceptTerms = true; } diff --git a/nixos/modules/services/web-apps/keycloak.md b/nixos/modules/services/web-apps/keycloak.md index 4036885ce151..4bf8c9fcad71 100644 --- a/nixos/modules/services/web-apps/keycloak.md +++ b/nixos/modules/services/web-apps/keycloak.md @@ -132,7 +132,7 @@ A basic configuration with some custom settings could look like this: hostname = "keycloak.example.com"; hostname-strict-backchannel = true; }; - initialAdminPassword = "e6Wcm0RrtegMEHl"; # change on first login + initialAdminPassword = "e6Wcm0RrtegMEHl"; # change on first login sslCertificate = "/run/keys/ssl_cert"; sslCertificateKey = "/run/keys/ssl_key"; database.passwordFile = "/run/keys/db_password"; diff --git a/nixos/modules/services/web-apps/nextcloud.md b/nixos/modules/services/web-apps/nextcloud.md index 3ae19e1f8ad5..0c038347c913 100644 --- a/nixos/modules/services/web-apps/nextcloud.md +++ b/nixos/modules/services/web-apps/nextcloud.md @@ -38,7 +38,10 @@ A very basic configuration may look like this: }; }; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; } ``` @@ -69,7 +72,8 @@ Custom service units that need to run `nextcloud-occ` either need elevated privi or the systemd configuration from `nextcloud-setup.service` (recommended): ```nix -{ config, ... }: { +{ config, ... }: +{ systemd.services.my-custom-service = { script = '' nextcloud-occ … @@ -78,7 +82,8 @@ or the systemd configuration from `nextcloud-setup.service` (recommended): inherit (config.systemd.services.nextcloud-cron.serviceConfig) User LoadCredential - KillMode; + KillMode + ; }; }; } @@ -208,9 +213,7 @@ release notes when upgrading. the cache size to zero: ```nix - { - services.nextcloud.phpOptions."realpath_cache_size" = "0"; - } + { services.nextcloud.phpOptions."realpath_cache_size" = "0"; } ``` - **Empty Files on chunked uploads** @@ -233,13 +236,19 @@ settings `listen.owner` & `listen.group` in the An exemplary configuration may look like this: ```nix -{ config, lib, pkgs, ... }: { +{ + config, + lib, + pkgs, + ... +}: +{ services.nginx.enable = false; services.nextcloud = { enable = true; hostName = "localhost"; - /* further, required options */ + # further, required options }; services.phpfpm.pools.nextcloud.settings = { "listen.owner" = config.services.httpd.user; @@ -287,7 +296,8 @@ When using this setting, apps can no longer be managed statefully because this c that are managed by Nix: ```nix -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +{ services.nextcloud.extraApps = with config.services.nextcloud.package.packages.apps; { inherit user_oidc calendar contacts; }; @@ -338,7 +348,7 @@ in NixOS for a safe upgrade-path before removing those. In that case we should k packages, but mark them as insecure in an expression like this (in ``): ```nix -/* ... */ +# ... { nextcloud17 = generic { version = "17.0.x"; diff --git a/nixos/modules/services/web-apps/pict-rs.md b/nixos/modules/services/web-apps/pict-rs.md index 56c51e0d7259..9cc0b3cbf9b3 100644 --- a/nixos/modules/services/web-apps/pict-rs.md +++ b/nixos/modules/services/web-apps/pict-rs.md @@ -7,9 +7,7 @@ pict-rs is a a simple image hosting service. the minimum to start pict-rs is ```nix -{ - services.pict-rs.enable = true; -} +{ services.pict-rs.enable = true; } ``` this will start the http server on port 8080 by default. diff --git a/nixos/modules/services/web-servers/garage.md b/nixos/modules/services/web-servers/garage.md index c51e4b060147..8af0b87e7a5d 100644 --- a/nixos/modules/services/web-servers/garage.md +++ b/nixos/modules/services/web-servers/garage.md @@ -72,7 +72,7 @@ in NixOS for a safe upgrade-path before removing those. In that case we should k packages, but mark them as insecure in an expression like this (in ``): ```nix -/* ... */ +# ... { garage_1_2_0 = generic { version = "1.2.0"; diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.md b/nixos/modules/services/x11/desktop-managers/pantheon.md index c964321d4814..f4c488bf6dec 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.md +++ b/nixos/modules/services/x11/desktop-managers/pantheon.md @@ -6,9 +6,7 @@ Pantheon is the desktop environment created for the elementary OS distribution. All of Pantheon is working in NixOS and the applications should be available, aside from a few [exceptions](https://github.com/NixOS/nixpkgs/issues/58161). To enable Pantheon, set ```nix -{ - services.xserver.desktopManager.pantheon.enable = true; -} +{ services.xserver.desktopManager.pantheon.enable = true; } ``` This automatically enables LightDM and Pantheon's LightDM greeter. If you'd like to disable this, set ```nix @@ -19,9 +17,7 @@ This automatically enables LightDM and Pantheon's LightDM greeter. If you'd like ``` but please be aware using Pantheon without LightDM as a display manager will break screenlocking from the UI. The NixOS module for Pantheon installs all of Pantheon's default applications. If you'd like to not install Pantheon's apps, set ```nix -{ - services.pantheon.apps.enable = false; -} +{ services.pantheon.apps.enable = false; } ``` You can also use [](#opt-environment.pantheon.excludePackages) to remove any other app (like `elementary-mail`). @@ -37,18 +33,11 @@ to configure the programs with plugs or indicators. The difference in NixOS is both these programs are patched to load plugins from a directory that is the value of an environment variable. All of which is controlled in Nix. If you need to configure the particular packages manually you can override the packages like: ```nix wingpanel-with-indicators.override { - indicators = [ - pkgs.some-special-indicator - ]; + indicators = [ pkgs.some-special-indicator ]; } - ``` ```nix -switchboard-with-plugs.override { - plugs = [ - pkgs.some-special-plug - ]; -} +switchboard-with-plugs.override { plugs = [ pkgs.some-special-plug ]; } ``` please note that, like how the NixOS options describe these as extra plugins, this would only add to the default plugins included with the programs. If for some reason you'd like to configure which plugins to use exactly, both packages have an argument for this: ```nix diff --git a/nixos/modules/system/boot/clevis.md b/nixos/modules/system/boot/clevis.md index 39edc0fc38df..c428747b3c23 100644 --- a/nixos/modules/system/boot/clevis.md +++ b/nixos/modules/system/boot/clevis.md @@ -40,16 +40,12 @@ For more complete documentation on how to generate a secret with clevis, see the In order to activate unattended decryption of a resource at boot, enable the `clevis` module: ```nix -{ - boot.initrd.clevis.enable = true; -} +{ boot.initrd.clevis.enable = true; } ``` Then, specify the device you want to decrypt using a given clevis secret. Clevis will automatically try to decrypt the device at boot and will fallback to interactive unlocking if the decryption policy is not fulfilled. ```nix -{ - boot.initrd.clevis.devices."/dev/nvme0n1p1".secretFile = ./nvme0n1p1.jwe; -} +{ boot.initrd.clevis.devices."/dev/nvme0n1p1".secretFile = ./nvme0n1p1.jwe; } ``` Only `bcachefs`, `zfs` and `luks` encrypted devices are supported at this time. diff --git a/nixos/modules/system/boot/loader/external/external.md b/nixos/modules/system/boot/loader/external/external.md index 4f5b559dfc40..1982bdfe5d8b 100644 --- a/nixos/modules/system/boot/loader/external/external.md +++ b/nixos/modules/system/boot/loader/external/external.md @@ -12,7 +12,8 @@ FooBoot provides a program at `${pkgs.fooboot}/bin/fooboot-install` which takes You can enable FooBoot like this: ```nix -{ pkgs, ... }: { +{ pkgs, ... }: +{ boot.loader.external = { enable = true; installHook = "${pkgs.fooboot}/bin/fooboot-install"; diff --git a/pkgs/README.md b/pkgs/README.md index eff9421efbfb..14a4fc355fb5 100644 --- a/pkgs/README.md +++ b/pkgs/README.md @@ -610,9 +610,7 @@ In the following cases, a `.patch` file _should_ be added to Nixpkgs repository, The latter avoids link rot when the upstream abandons, squashes or rebases their change, in which case the commit may get garbage-collected. ```nix -{ - patches = [ ./0001-add-missing-include.patch ]; -} +{ patches = [ ./0001-add-missing-include.patch ]; } ``` If you do need to do create this sort of patch file, one way to do so is with git: @@ -719,13 +717,14 @@ Here in the nixpkgs manual we describe mostly _package tests_; for _module tests For very simple tests, they can be written inline: ```nix -{ /* ... , */ yq-go }: +# ... , +{ yq-go }: buildGoModule rec { # … passthru.tests = { - simple = runCommand "${pname}-test" {} '' + simple = runCommand "${pname}-test" { } '' echo "test: 1" | ${yq-go}/bin/yq eval -j > $out [ "$(cat $out | tr -d $'\n ')" = '{"test":1}' ] ''; @@ -749,16 +748,26 @@ stdenv.mkDerivation (finalAttrs: { ```nix # my-package/example.nix -{ runCommand, lib, my-package, ... }: -runCommand "my-package-test" { - nativeBuildInputs = [ my-package ]; - src = lib.sources.sourcesByRegex ./. [ ".*.in" ".*.expected" ]; -} '' - my-package --help - my-package example.actual - diff -U3 --color=auto example.expected example.actual - mkdir $out -'' +{ + runCommand, + lib, + my-package, + ... +}: +runCommand "my-package-test" + { + nativeBuildInputs = [ my-package ]; + src = lib.sources.sourcesByRegex ./. [ + ".*.in" + ".*.expected" + ]; + } + '' + my-package --help + my-package example.actual + diff -U3 --color=auto example.expected example.actual + mkdir $out + '' ``` ### Writing larger package tests @@ -769,7 +778,12 @@ This is an example using the `phoronix-test-suite` package with the current best Add the tests in `passthru.tests` to the package definition like this: ```nix -{ stdenv, lib, fetchurl, callPackage }: +{ + stdenv, + lib, + fetchurl, + callPackage, +}: stdenv.mkDerivation { # … @@ -778,7 +792,9 @@ stdenv.mkDerivation { simple-execution = callPackage ./tests.nix { }; }; - meta = { /* … */ }; + meta = { + # … + }; } ``` @@ -789,22 +805,21 @@ Create `tests.nix` in the package directory: let inherit (phoronix-test-suite) pname version; -in -runCommand "${pname}-tests" { meta.timeout = 60; } - '' - # automatic initial setup to prevent interactive questions - ${phoronix-test-suite}/bin/phoronix-test-suite enterprise-setup >/dev/null - # get version of installed program and compare with package version - if [[ `${phoronix-test-suite}/bin/phoronix-test-suite version` != *"${version}"* ]]; then - echo "Error: program version does not match package version" - exit 1 - fi - # run dummy command - ${phoronix-test-suite}/bin/phoronix-test-suite dummy_module.dummy-command >/dev/null - # needed for Nix to register the command as successful - touch $out - '' +in +runCommand "${pname}-tests" { meta.timeout = 60; } '' + # automatic initial setup to prevent interactive questions + ${phoronix-test-suite}/bin/phoronix-test-suite enterprise-setup >/dev/null + # get version of installed program and compare with package version + if [[ `${phoronix-test-suite}/bin/phoronix-test-suite version` != *"${version}"* ]]; then + echo "Error: program version does not match package version" + exit 1 + fi + # run dummy command + ${phoronix-test-suite}/bin/phoronix-test-suite dummy_module.dummy-command >/dev/null + # needed for Nix to register the command as successful + touch $out +'' ``` ### Running package tests @@ -833,7 +848,11 @@ Like [package tests][larger-package-tests] as shown above, [NixOS module tests]( For example, assuming we're packaging `nginx`, we can link its module test via `passthru.tests`: ```nix -{ stdenv, lib, nixosTests }: +{ + stdenv, + lib, + nixosTests, +}: stdenv.mkDerivation { # ... @@ -902,7 +921,11 @@ The `passthru.updateScript` attribute can contain one of the following: { stdenv }: stdenv.mkDerivation { # ... - passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]; + passthru.updateScript = [ + ../../update.sh + pname + "--requested-release=unstable" + ]; } ``` @@ -927,9 +950,14 @@ The `passthru.updateScript` attribute can contain one of the following: pname = "my-package"; # ... passthru.updateScript = { - command = [ ../../update.sh pname ]; + command = [ + ../../update.sh + pname + ]; attrPath = pname; - supportedFeatures = [ /* ... */ ]; + supportedFeatures = [ + # ... + ]; }; } ``` diff --git a/pkgs/applications/emulators/libretro/README.md b/pkgs/applications/emulators/libretro/README.md index ca494d29e8a9..2de2e61e4852 100644 --- a/pkgs/applications/emulators/libretro/README.md +++ b/pkgs/applications/emulators/libretro/README.md @@ -22,16 +22,18 @@ this: { pkgs, ... }: let - retroarchWithCores = (pkgs.retroarch.withCores (cores: with cores; [ - bsnes - mgba - quicknes - ])); + retroarchWithCores = ( + pkgs.retroarch.withCores ( + cores: with cores; [ + bsnes + mgba + quicknes + ] + ) + ); in { - environment.systemPackages = [ - retroarchWithCores - ]; + environment.systemPackages = [ retroarchWithCores ]; } ``` diff --git a/pkgs/by-name/README.md b/pkgs/by-name/README.md index 6853407a9a8d..4dcb6708a1c7 100644 --- a/pkgs/by-name/README.md +++ b/pkgs/by-name/README.md @@ -37,8 +37,7 @@ The `package.nix` may look like this: # The return value must be a derivation stdenv.mkDerivation { # ... - buildInputs = - lib.optional enableBar libbar; + buildInputs = lib.optional enableBar libbar; } ``` @@ -70,9 +69,7 @@ and override its value in [`pkgs/top-level/all-packages.nix`](../top-level/all-p ```nix { - libfoo = callPackage ../by-name/so/some-package/package.nix { - libbar = libbar_2; - }; + libfoo = callPackage ../by-name/so/some-package/package.nix { libbar = libbar_2; }; } ``` @@ -100,22 +97,15 @@ Definitions like the following however, _can_ be transitioned: ```nix # all-packages.nix { - fooWithBaz = foo.override { - bar = baz; - }; + fooWithBaz = foo.override { bar = baz; }; } ``` ```nix # turned into pkgs/by-name/fo/fooWithBaz/package.nix with: -{ - foo, - baz, -}: +{ foo, baz }: -foo.override { - bar = baz; -} +foo.override { bar = baz; } ``` ## Limitations @@ -187,10 +177,7 @@ because it establishes a clear connection between related attributes. This is not required, but the above solution also allows refactoring the definitions into a separate file: ```nix -{ - inherit (import ../tools/foo pkgs) - foo_1 foo_2; -} +{ inherit (import ../tools/foo pkgs) foo_1 foo_2; } ``` ```nix @@ -205,19 +192,19 @@ Alternatively using [`callPackages`](https://nixos.org/manual/nixpkgs/unstable/# if `callPackage` isn't used underneath and you want the same `.override` arguments for all attributes: ```nix -{ - inherit (callPackages ../tools/foo { }) - foo_1 foo_2; -} +{ inherit (callPackages ../tools/foo { }) foo_1 foo_2; } ``` ```nix # pkgs/tools/foo/default.nix +{ stdenv }: { - stdenv -}: { - foo_1 = stdenv.mkDerivation { /* ... */ }; - foo_2 = stdenv.mkDerivation { /* ... */ }; + foo_1 = stdenv.mkDerivation { + # ... + }; + foo_2 = stdenv.mkDerivation { + # ... + }; } ``` diff --git a/pkgs/by-name/az/azure-cli/README.md b/pkgs/by-name/az/azure-cli/README.md index 29964f91948b..c2d340db0b76 100644 --- a/pkgs/by-name/az/azure-cli/README.md +++ b/pkgs/by-name/az/azure-cli/README.md @@ -63,9 +63,7 @@ Based on this, you can add an attribute to `extensions-manual.nix`: url = "https://github.com/Azure/azure-devops-cli-extension/releases/download/20240206.1/azure_devops-${version}-py2.py3-none-any.whl"; sha256 = "658a2854d8c80f874f9382d421fa45abf6a38d00334737dda006f8dec64cf70a"; description = "Tools for managing Azure DevOps"; - propagatedBuildInputs = with python3Packages; [ - distro - ]; + propagatedBuildInputs = with python3Packages; [ distro ]; meta.maintainers = with lib.maintainers; [ katexochen ]; }; } diff --git a/pkgs/development/tcl-modules/by-name/README.md b/pkgs/development/tcl-modules/by-name/README.md index c65310524c1c..b8a083c19508 100644 --- a/pkgs/development/tcl-modules/by-name/README.md +++ b/pkgs/development/tcl-modules/by-name/README.md @@ -5,10 +5,11 @@ The structure of this directory is identical to the one described in The only difference is the scope: ```nix -{ lib -# You can get tclPackages attributes directly -, mkTclDerivation -, tcllib +{ + lib, + # You can get tclPackages attributes directly + mkTclDerivation, + tcllib, }: mkTclDerivation { diff --git a/pkgs/servers/home-assistant/custom-components/README.md b/pkgs/servers/home-assistant/custom-components/README.md index c51e6512538e..fc6f90dd95d2 100644 --- a/pkgs/servers/home-assistant/custom-components/README.md +++ b/pkgs/servers/home-assistant/custom-components/README.md @@ -19,9 +19,10 @@ versions into the Python environment. **Example Boilerplate:** ```nix -{ lib -, buildHomeAssistantComponent -, fetchFromGitHub +{ + lib, + buildHomeAssistantComponent, + fetchFromGitHub, }: buildHomeAssistantComponent { @@ -81,13 +82,9 @@ can be ignored on a per requirement basis. ```nix { - dependencies = [ - pyemvue - ]; + dependencies = [ pyemvue ]; # don't check the version constraint of pyemvue - ignoreVersionRequirement = [ - "pyemvue" - ]; + ignoreVersionRequirement = [ "pyemvue" ]; } ``` diff --git a/pkgs/servers/home-assistant/custom-lovelace-modules/README.md b/pkgs/servers/home-assistant/custom-lovelace-modules/README.md index 72f979d07f95..e9bf6de1a747 100644 --- a/pkgs/servers/home-assistant/custom-lovelace-modules/README.md +++ b/pkgs/servers/home-assistant/custom-lovelace-modules/README.md @@ -9,7 +9,5 @@ configured. The entrypoint used can be overridden in `passthru` like this: ```nix -{ - passthru.entrypoint = "demo-card-bundle.js"; -} +{ passthru.entrypoint = "demo-card-bundle.js"; } ``` From 0f3f710c86878c769e3929692aab58f39cfbc09c Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 22 Jul 2025 16:07:57 +0200 Subject: [PATCH 3/6] nixos/doc/wireless: fix comments Those had been misplaced by nixfmt. --- nixos/doc/manual/configuration/wireless.section.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/configuration/wireless.section.md b/nixos/doc/manual/configuration/wireless.section.md index 3331935d5c17..ca581c183087 100644 --- a/nixos/doc/manual/configuration/wireless.section.md +++ b/nixos/doc/manual/configuration/wireless.section.md @@ -15,16 +15,16 @@ NixOS lets you specify networks for wpa_supplicant declaratively: ```nix { networking.wireless.networks = { + # SSID with no spaces or special characters echelon = { - # SSID with no spaces or special characters psk = "abcdefgh"; }; + # SSID with spaces and/or special characters "echelon's AP" = { - # SSID with spaces and/or special characters psk = "ijklmnop"; }; + # Hidden SSID echelon = { - # Hidden SSID hidden = true; psk = "qrstuvwx"; }; From ea970ff3bed430c4d447cec8147494b644d1914d Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 24 Jul 2025 12:54:52 +0200 Subject: [PATCH 4/6] ci/parse: raise minimum test to Nix 2.24 Nix 2.3 is marked as insecure and thus not cached anymore. We'll either need to patch it and cache it again or drop it. --- ci/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/default.nix b/ci/default.nix index a33b023a6beb..1f87117d39fc 100644 --- a/ci/default.nix +++ b/ci/default.nix @@ -110,7 +110,8 @@ rec { parse = pkgs.lib.recurseIntoAttrs { latest = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.latest; }; lix = pkgs.callPackage ./parse.nix { nix = pkgs.lix; }; - minimum = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.minimum; }; + # TODO: Raise nixVersions.minimum to 2.24 and flip back to it. + minimum = pkgs.callPackage ./parse.nix { nix = pkgs.nixVersions.nix_2_24; }; }; shell = import ../shell.nix { inherit nixpkgs system; }; tarball = import ../pkgs/top-level/make-tarball.nix { From 6f5663940c8f7219a96b609cd1a3954e179d6de3 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 22 Jul 2025 14:45:51 +0200 Subject: [PATCH 5/6] ci/pinned: update This gives us Nix 2.30 and nixfmt 1.0.0. From the nixpkgs-unstable channel: https://hydra.nixos.org/eval/1817034#tabs-inputs Changes for treefmt-nix: https://github.com/numtide/treefmt-nix/compare/a05be418a1af1198ca0f63facb13c985db4cb3c5...421b56313c65a0815a52b424777f55acf0b56ddf --- ci/pinned.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/pinned.json b/ci/pinned.json index 08a675000b86..7818ad5f6769 100644 --- a/ci/pinned.json +++ b/ci/pinned.json @@ -9,9 +9,9 @@ }, "branch": "nixpkgs-unstable", "submodules": false, - "revision": "6afe187897bef7933475e6af374c893f4c84a293", - "url": "https://github.com/NixOS/nixpkgs/archive/6afe187897bef7933475e6af374c893f4c84a293.tar.gz", - "hash": "1x3yas2aingswrw7hpn43d9anlb08bpyk42dqg6v8f3p3yk83p1b" + "revision": "2baf8e1658cba84a032c3a8befb1e7b06629242a", + "url": "https://github.com/NixOS/nixpkgs/archive/2baf8e1658cba84a032c3a8befb1e7b06629242a.tar.gz", + "hash": "0l48zkf2zs7r53fjq46j770vpb5avxihyfypra3fv429akqnsmm1" }, "treefmt-nix": { "type": "Git", @@ -22,9 +22,9 @@ }, "branch": "main", "submodules": false, - "revision": "a05be418a1af1198ca0f63facb13c985db4cb3c5", - "url": "https://github.com/numtide/treefmt-nix/archive/a05be418a1af1198ca0f63facb13c985db4cb3c5.tar.gz", - "hash": "1yadm9disc59an4a6c1zidq82530rd7i7idzzsirv6dlwirbqk3q" + "revision": "421b56313c65a0815a52b424777f55acf0b56ddf", + "url": "https://github.com/numtide/treefmt-nix/archive/421b56313c65a0815a52b424777f55acf0b56ddf.tar.gz", + "hash": "1l57hzz704s7izkkcl3xsg77xjfza57cl0fchs24rdpdhmry2dmp" } }, "version": 5 From 5a0711127cd8b916c3d3128f473388c8c79df0da Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 22 Jul 2025 15:19:36 +0200 Subject: [PATCH 6/6] treewide: run nixfmt 1.0.0 --- doc/hooks/tauri.section.md | 3 +- doc/languages-frameworks/coq.section.md | 8 +- doc/languages-frameworks/python.section.md | 30 +- doc/stdenv/cross-compilation.chapter.md | 3 +- lib/customisation.nix | 19 +- lib/deprecated/misc.nix | 7 +- lib/modules.nix | 60 +- lib/options.nix | 47 +- lib/path/tests/default.nix | 15 +- lib/systems/architectures.nix | 9 +- lib/systems/default.nix | 919 +++++++++--------- lib/systems/examples.nix | 45 +- lib/systems/inspect.nix | 20 +- .../define-option-dependently-nested.nix | 15 +- .../modules/define-option-dependently.nix | 15 +- lib/tests/test-with-nix.nix | 3 +- lib/types.nix | 3 +- nixos/lib/eval-config-minimal.nix | 3 +- nixos/lib/make-btrfs-fs.nix | 3 +- nixos/lib/make-ext4-fs.nix | 3 +- nixos/lib/make-iso9660-image.nix | 3 +- nixos/lib/make-squashfs.nix | 59 +- nixos/lib/systemd-lib.nix | 21 +- nixos/lib/test-driver/default.nix | 23 +- nixos/lib/testing/driver.nix | 3 +- nixos/lib/testing/run.nix | 7 +- .../scripts/openstack/openstack-image-zfs.nix | 3 +- .../scripts/openstack/openstack-image.nix | 3 +- nixos/modules/config/console.nix | 25 +- nixos/modules/config/fonts/fontconfig.nix | 75 +- nixos/modules/config/i18n.nix | 30 +- nixos/modules/config/locale.nix | 15 +- nixos/modules/config/mysql.nix | 67 +- nixos/modules/config/networking.nix | 37 +- nixos/modules/config/nix-remote-build.nix | 15 +- nixos/modules/config/nix.nix | 106 +- nixos/modules/config/resolvconf.nix | 41 +- nixos/modules/config/swap.nix | 3 +- nixos/modules/config/users-groups.nix | 320 +++--- nixos/modules/config/xdg/icons.nix | 31 +- nixos/modules/hardware/all-hardware.nix | 245 +++-- nixos/modules/hardware/device-tree.nix | 3 +- nixos/modules/hardware/infiniband.nix | 47 +- nixos/modules/hardware/ksm.nix | 13 +- nixos/modules/hardware/logitech.nix | 15 +- nixos/modules/hardware/nfc-nci.nix | 13 +- nixos/modules/hardware/system-76.nix | 3 +- nixos/modules/hardware/video/bumblebee.nix | 3 +- nixos/modules/hardware/video/nvidia.nix | 75 +- .../hardware/video/webcam/facetimehd.nix | 3 +- nixos/modules/i18n/input-method/default.nix | 11 +- nixos/modules/i18n/input-method/fcitx5.nix | 17 +- nixos/modules/i18n/input-method/kime.nix | 15 +- nixos/modules/image/repart-image.nix | 91 +- nixos/modules/installer/cd-dvd/iso-image.nix | 13 +- nixos/modules/installer/netboot/netboot.nix | 3 +- .../sd-card/sd-image-powerpc64le.nix | 41 +- nixos/modules/installer/sd-card/sd-image.nix | 3 +- nixos/modules/misc/documentation.nix | 3 +- .../modules/profiles/installation-device.nix | 23 +- nixos/modules/programs/cdemu.nix | 13 +- nixos/modules/programs/dconf.nix | 3 +- nixos/modules/programs/feedbackd.nix | 3 +- nixos/modules/programs/firefox.nix | 3 +- nixos/modules/programs/htop.nix | 15 +- nixos/modules/programs/less.nix | 19 +- .../modules/programs/nix-required-mounts.nix | 3 +- nixos/modules/programs/opengamepadui.nix | 3 +- nixos/modules/programs/schroot.nix | 35 +- nixos/modules/programs/ssh.nix | 32 +- nixos/modules/programs/steam.nix | 17 +- nixos/modules/programs/tsm-client.nix | 67 +- nixos/modules/programs/wayland/sway.nix | 27 +- nixos/modules/programs/zsh/zsh.nix | 3 +- nixos/modules/security/acme/default.nix | 58 +- nixos/modules/security/apparmor.nix | 13 +- nixos/modules/security/apparmor/includes.nix | 725 +++++++------- nixos/modules/security/dhparams.nix | 109 +-- nixos/modules/security/duosec.nix | 10 +- .../security/krb5/krb5-conf-format.nix | 63 +- nixos/modules/security/pam.nix | 94 +- nixos/modules/security/pam_mount.nix | 3 +- nixos/modules/security/wrappers/wrapper.nix | 33 +- nixos/modules/services/admin/oxidized.nix | 83 +- nixos/modules/services/admin/pgadmin.nix | 38 +- nixos/modules/services/amqp/rabbitmq.nix | 18 +- nixos/modules/services/audio/gonic.nix | 19 +- nixos/modules/services/audio/hqplayerd.nix | 23 +- nixos/modules/services/audio/jack.nix | 25 +- nixos/modules/services/audio/mpd.nix | 25 +- nixos/modules/services/audio/navidrome.nix | 23 +- nixos/modules/services/audio/pulseaudio.nix | 19 +- nixos/modules/services/backup/borgbackup.nix | 35 +- nixos/modules/services/backup/btrbk.nix | 13 +- nixos/modules/services/backup/duplicity.nix | 138 ++- nixos/modules/services/backup/pgbackrest.nix | 13 +- nixos/modules/services/backup/restic.nix | 86 +- nixos/modules/services/backup/snapraid.nix | 83 +- .../services/cluster/druid/default.nix | 6 +- .../modules/services/cluster/hadoop/hbase.nix | 101 +- .../services/cluster/kubernetes/apiserver.nix | 3 +- .../computing/foldingathome/client.nix | 19 +- .../services/computing/slurm/slurm.nix | 3 +- .../gitea-actions-runner.nix | 106 +- .../github-runner/service.nix | 3 +- .../continuous-integration/gitlab-runner.nix | 67 +- .../continuous-integration/hydra/default.nix | 23 +- .../jenkins/default.nix | 3 +- nixos/modules/services/databases/couchdb.nix | 13 +- nixos/modules/services/databases/dgraph.nix | 6 +- .../services/databases/dragonflydb.nix | 23 +- nixos/modules/services/databases/etcd.nix | 6 +- .../services/databases/foundationdb.nix | 18 +- .../modules/services/databases/influxdb2.nix | 108 +- nixos/modules/services/databases/mysql.nix | 92 +- nixos/modules/services/databases/openldap.nix | 111 ++- .../databases/postgres-websockets.nix | 3 +- .../modules/services/databases/postgresql.nix | 83 +- .../services/databases/victorialogs.nix | 3 +- .../services/databases/victoriametrics.nix | 15 +- .../services/desktop-managers/gnome.nix | 32 +- .../services/desktop-managers/lomiri.nix | 40 +- .../services/desktop-managers/plasma6.nix | 63 +- nixos/modules/services/desktops/geoclue2.nix | 19 +- .../desktops/gnome/gnome-initial-setup.nix | 9 +- .../services/desktops/pipewire/pipewire.nix | 3 +- .../modules/services/development/corteza.nix | 3 +- .../services/development/jupyter/default.nix | 3 +- nixos/modules/services/development/zammad.nix | 21 +- .../modules/services/display-managers/gdm.nix | 56 +- .../services/display-managers/greetd.nix | 15 +- .../services/display-managers/sddm.nix | 117 ++- nixos/modules/services/editors/emacs.md | 8 +- nixos/modules/services/editors/emacs.nix | 33 +- .../services/finance/libeufin/common.nix | 23 +- nixos/modules/services/finance/odoo.nix | 15 +- nixos/modules/services/games/factorio.nix | 3 +- .../services/games/minecraft-server.nix | 66 +- .../services/games/minetest-server.nix | 41 +- nixos/modules/services/hardware/amdvlk.nix | 17 +- .../services/hardware/bitbox-bridge.nix | 23 +- nixos/modules/services/hardware/bluetooth.nix | 133 ++- .../services/hardware/handheld-daemon.nix | 3 +- .../services/hardware/interception-tools.nix | 3 +- nixos/modules/services/hardware/kmonad.nix | 108 +- nixos/modules/services/hardware/monado.nix | 3 +- nixos/modules/services/hardware/openrgb.nix | 9 +- nixos/modules/services/hardware/rasdaemon.nix | 21 +- nixos/modules/services/hardware/sane.nix | 13 +- .../modules/services/hardware/scanservjs.nix | 3 +- nixos/modules/services/hardware/thinkfan.nix | 103 +- nixos/modules/services/hardware/tlp.nix | 15 +- nixos/modules/services/hardware/udev.nix | 32 +- nixos/modules/services/hardware/udisks2.nix | 3 +- nixos/modules/services/hardware/vdr.nix | 14 +- .../services/home-automation/esphome.nix | 3 +- .../home-automation/home-assistant.nix | 59 +- nixos/modules/services/logging/awstats.nix | 9 +- nixos/modules/services/logging/logrotate.nix | 95 +- nixos/modules/services/logging/promtail.nix | 67 +- nixos/modules/services/mail/dovecot.nix | 147 ++- nixos/modules/services/mail/mailman.nix | 553 ++++++----- nixos/modules/services/mail/offlineimap.nix | 3 +- nixos/modules/services/mail/opendkim.nix | 33 +- .../modules/services/mail/postfix-tlspol.nix | 15 +- nixos/modules/services/mail/postfix.nix | 267 ++--- nixos/modules/services/mail/postsrsd.nix | 30 +- nixos/modules/services/mail/public-inbox.nix | 126 +-- nixos/modules/services/mail/sympa.nix | 87 +- .../services/matrix/mautrix-discord.nix | 11 +- .../modules/services/matrix/mautrix-meta.nix | 11 +- .../services/matrix/mautrix-telegram.nix | 67 +- nixos/modules/services/matrix/mjolnir.nix | 6 +- nixos/modules/services/matrix/synapse.nix | 206 ++-- nixos/modules/services/misc/atuin.nix | 9 +- nixos/modules/services/misc/bcg.nix | 3 +- nixos/modules/services/misc/blenderfarm.nix | 29 +- nixos/modules/services/misc/devpi-server.nix | 58 +- nixos/modules/services/misc/disnix.nix | 41 +- .../modules/services/misc/docker-registry.nix | 3 +- nixos/modules/services/misc/docling-serve.nix | 3 +- nixos/modules/services/misc/duckdns.nix | 3 +- nixos/modules/services/misc/dysnomia.nix | 67 +- .../modules/services/misc/etebase-server.nix | 13 +- nixos/modules/services/misc/forgejo.nix | 81 +- nixos/modules/services/misc/gitea.nix | 83 +- nixos/modules/services/misc/gitlab.nix | 161 +-- nixos/modules/services/misc/gitolite.nix | 42 +- nixos/modules/services/misc/gotenberg.nix | 60 +- nixos/modules/services/misc/heisenbridge.nix | 11 +- nixos/modules/services/misc/klipper.nix | 51 +- nixos/modules/services/misc/metabase.nix | 23 +- nixos/modules/services/misc/moonraker.nix | 48 +- nixos/modules/services/misc/open-webui.nix | 3 +- nixos/modules/services/misc/paperless.nix | 76 +- nixos/modules/services/misc/pghero.nix | 3 +- nixos/modules/services/misc/pinchflat.nix | 33 +- nixos/modules/services/misc/portunus.nix | 51 +- nixos/modules/services/misc/redlib.nix | 121 ++- nixos/modules/services/misc/redmine.nix | 50 +- nixos/modules/services/misc/renovate.nix | 3 +- nixos/modules/services/misc/rmfakecloud.nix | 3 +- nixos/modules/services/misc/rshim.nix | 13 +- nixos/modules/services/misc/snapper.nix | 29 +- .../modules/services/misc/tandoor-recipes.nix | 21 +- .../services/misc/taskserver/default.nix | 35 +- nixos/modules/services/misc/transfer-sh.nix | 76 +- nixos/modules/services/misc/wastebin.nix | 59 +- .../modules/services/misc/workout-tracker.nix | 3 +- .../services/monitoring/datadog-agent.nix | 49 +- nixos/modules/services/monitoring/goss.nix | 3 +- .../services/monitoring/grafana-to-ntfy.nix | 28 +- nixos/modules/services/monitoring/grafana.nix | 12 +- .../modules/services/monitoring/graphite.nix | 3 +- .../modules/services/monitoring/librenms.nix | 296 +++--- .../modules/services/monitoring/longview.nix | 47 +- nixos/modules/services/monitoring/netdata.nix | 317 +++--- .../services/monitoring/parsedmarc.nix | 29 +- .../monitoring/prometheus/default.nix | 3 +- .../monitoring/prometheus/exporters.nix | 254 ++--- .../prometheus/exporters/bitcoin.nix | 3 +- .../prometheus/exporters/deluge.nix | 27 +- .../monitoring/prometheus/exporters/node.nix | 13 +- .../monitoring/prometheus/exporters/pve.nix | 43 +- .../prometheus/exporters/restic.nix | 3 +- .../prometheus/exporters/unbound.nix | 43 +- nixos/modules/services/monitoring/vmagent.nix | 29 +- .../services/monitoring/zabbix-server.nix | 53 +- .../services/network-filesystems/ceph.nix | 98 +- .../network-filesystems/glusterfs.nix | 33 +- .../services/network-filesystems/kubo.nix | 118 +-- .../services/network-filesystems/moosefs.nix | 26 +- .../services/network-filesystems/samba.nix | 34 +- .../services/network-filesystems/saunafs.nix | 3 +- .../modules/services/networking/asterisk.nix | 71 +- nixos/modules/services/networking/babeld.nix | 19 +- .../services/networking/cloudflare-dyndns.nix | 92 +- .../services/networking/cloudflared.nix | 3 +- nixos/modules/services/networking/consul.nix | 44 +- nixos/modules/services/networking/coturn.nix | 19 +- nixos/modules/services/networking/croc.nix | 3 +- nixos/modules/services/networking/dae.nix | 3 +- nixos/modules/services/networking/dhcpcd.nix | 55 +- .../services/networking/doh-server.nix | 3 +- .../modules/services/networking/ejabberd.nix | 3 +- .../networking/firefox-syncserver.nix | 37 +- .../modules/services/networking/firewall.nix | 9 +- .../services/networking/firezone/server.nix | 84 +- nixos/modules/services/networking/flannel.nix | 41 +- nixos/modules/services/networking/frp.nix | 3 +- nixos/modules/services/networking/frr.nix | 175 ++-- .../services/networking/gns3-server.nix | 17 +- nixos/modules/services/networking/hostapd.nix | 314 +++--- nixos/modules/services/networking/i2pd.nix | 246 +++-- .../services/networking/jibri/default.nix | 3 +- .../services/networking/jitsi-videobridge.nix | 3 +- nixos/modules/services/networking/jool.nix | 6 +- nixos/modules/services/networking/kea.nix | 12 +- nixos/modules/services/networking/knot.nix | 42 +- nixos/modules/services/networking/kresd.nix | 3 +- .../modules/services/networking/libreswan.nix | 3 +- .../services/networking/microsocks.nix | 33 +- nixos/modules/services/networking/mihomo.nix | 95 +- .../modules/services/networking/mosquitto.nix | 3 +- .../services/networking/mtprotoproxy.nix | 15 +- nixos/modules/services/networking/murmur.nix | 71 +- nixos/modules/services/networking/nat.nix | 27 +- nixos/modules/services/networking/ncdns.nix | 39 +- nixos/modules/services/networking/netbird.nix | 81 +- .../services/networking/netbird/coturn.nix | 31 +- .../services/networking/netbird/dashboard.nix | 54 +- .../services/networking/netbird/server.nix | 49 +- .../services/networking/networkmanager.nix | 81 +- .../services/networking/ntp/chrony.nix | 36 +- .../modules/services/networking/ntp/ntpd.nix | 3 +- nixos/modules/services/networking/privoxy.nix | 48 +- nixos/modules/services/networking/prosody.nix | 22 +- nixos/modules/services/networking/quassel.nix | 9 +- nixos/modules/services/networking/resilio.nix | 13 +- nixos/modules/services/networking/searx.nix | 82 +- .../services/networking/shadowsocks.nix | 42 +- .../services/networking/shairport-sync.nix | 3 +- .../services/networking/spacecookie.nix | 3 +- .../modules/services/networking/ssh/sshd.nix | 91 +- nixos/modules/services/networking/sslh.nix | 74 +- nixos/modules/services/networking/stubby.nix | 16 +- nixos/modules/services/networking/supybot.nix | 104 +- .../modules/services/networking/syncplay.nix | 106 +- .../services/networking/syncthing-relay.nix | 21 +- .../modules/services/networking/syncthing.nix | 51 +- .../modules/services/networking/tailscale.nix | 24 +- .../services/networking/teamspeak3.nix | 15 +- nixos/modules/services/networking/unbound.nix | 25 +- nixos/modules/services/networking/v2raya.nix | 6 +- .../services/networking/vdirsyncer.nix | 31 +- nixos/modules/services/networking/vsftpd.nix | 44 +- .../services/networking/wasabibackend.nix | 37 +- nixos/modules/services/networking/webhook.nix | 31 +- .../services/networking/wg-access-server.nix | 3 +- .../modules/services/networking/wg-quick.nix | 59 +- .../services/networking/whoogle-search.nix | 3 +- .../modules/services/networking/wireguard.nix | 3 +- .../services/networking/wpa_supplicant.nix | 29 +- .../modules/services/networking/wstunnel.nix | 38 +- .../modules/services/networking/yggdrasil.nix | 67 +- .../services/networking/zerotierone.nix | 39 +- nixos/modules/services/printing/cupsd.nix | 38 +- nixos/modules/services/scheduling/prefect.nix | 183 ++-- nixos/modules/services/search/manticore.nix | 89 +- nixos/modules/services/search/nominatim.nix | 6 +- nixos/modules/services/search/opensearch.nix | 152 ++- nixos/modules/services/search/quickwit.nix | 101 +- nixos/modules/services/security/aesmd.nix | 3 +- nixos/modules/services/security/canaille.nix | 30 +- nixos/modules/services/security/fail2ban.nix | 30 +- nixos/modules/services/security/kanidm.nix | 18 +- nixos/modules/services/security/pocket-id.nix | 39 +- nixos/modules/services/security/tor.nix | 151 ++- nixos/modules/services/security/vault.nix | 9 +- .../services/security/vaultwarden/default.nix | 13 +- .../services/system/cachix-watch-store.nix | 38 +- nixos/modules/services/system/nix-daemon.nix | 6 +- nixos/modules/services/torrent/bitmagnet.nix | 3 +- .../modules/services/torrent/transmission.nix | 73 +- nixos/modules/services/ttys/getty.nix | 27 +- .../services/video/epgstation/default.nix | 9 +- nixos/modules/services/video/frigate.nix | 117 +-- nixos/modules/services/video/mirakurun.nix | 11 +- nixos/modules/services/video/ustreamer.nix | 13 +- nixos/modules/services/video/v4l2-relayd.nix | 19 +- nixos/modules/services/video/wivrn.nix | 3 +- nixos/modules/services/web-apps/agorakit.nix | 3 +- .../services/web-apps/anuko-time-tracker.nix | 3 +- nixos/modules/services/web-apps/artalk.nix | 39 +- nixos/modules/services/web-apps/bookstack.nix | 6 +- .../modules/services/web-apps/calibre-web.nix | 39 +- nixos/modules/services/web-apps/castopod.nix | 3 +- .../services/web-apps/changedetection-io.nix | 13 +- nixos/modules/services/web-apps/cloudlog.nix | 3 +- .../modules/services/web-apps/code-server.nix | 64 +- nixos/modules/services/web-apps/commafeed.nix | 3 +- nixos/modules/services/web-apps/crabfit.nix | 6 +- nixos/modules/services/web-apps/davis.nix | 137 ++- .../services/web-apps/dependency-track.nix | 11 +- nixos/modules/services/web-apps/dex.nix | 118 +-- nixos/modules/services/web-apps/discourse.nix | 108 +- nixos/modules/services/web-apps/dokuwiki.nix | 3 +- nixos/modules/services/web-apps/dolibarr.nix | 40 +- nixos/modules/services/web-apps/drupal.nix | 3 +- nixos/modules/services/web-apps/fider.nix | 3 +- .../modules/services/web-apps/filesender.nix | 3 +- .../web-apps/firefly-iii-data-importer.nix | 6 +- .../modules/services/web-apps/firefly-iii.nix | 9 +- nixos/modules/services/web-apps/flarum.nix | 39 +- nixos/modules/services/web-apps/freshrss.nix | 13 +- .../services/web-apps/froide-govplan.nix | 25 +- nixos/modules/services/web-apps/gancio.nix | 3 +- nixos/modules/services/web-apps/glitchtip.nix | 9 +- .../services/web-apps/guacamole-server.nix | 3 +- .../services/web-apps/healthchecks.nix | 17 +- nixos/modules/services/web-apps/hedgedoc.nix | 3 +- .../web-apps/icingaweb2/module-monitoring.nix | 27 +- nixos/modules/services/web-apps/ifm.nix | 3 +- nixos/modules/services/web-apps/invidious.nix | 114 ++- .../services/web-apps/invoiceplane.nix | 3 +- nixos/modules/services/web-apps/jirafeau.nix | 3 +- .../modules/services/web-apps/jitsi-meet.nix | 36 +- nixos/modules/services/web-apps/karakeep.nix | 3 +- nixos/modules/services/web-apps/keycloak.nix | 60 +- nixos/modules/services/web-apps/kimai.nix | 3 +- nixos/modules/services/web-apps/lanraragi.nix | 45 +- .../services/web-apps/lasuite-docs.nix | 27 +- .../services/web-apps/lasuite-meet.nix | 24 +- .../modules/services/web-apps/limesurvey.nix | 6 +- nixos/modules/services/web-apps/mastodon.nix | 209 ++-- .../modules/services/web-apps/mattermost.nix | 149 ++- nixos/modules/services/web-apps/mealie.nix | 3 +- nixos/modules/services/web-apps/mediawiki.nix | 54 +- nixos/modules/services/web-apps/miniflux.nix | 13 +- nixos/modules/services/web-apps/misskey.nix | 25 +- nixos/modules/services/web-apps/monica.nix | 3 +- nixos/modules/services/web-apps/moodle.nix | 6 +- nixos/modules/services/web-apps/movim.nix | 166 ++-- nixos/modules/services/web-apps/netbox.nix | 17 +- .../web-apps/nextcloud-notify_push.nix | 117 ++- nixos/modules/services/web-apps/nextcloud.nix | 54 +- nixos/modules/services/web-apps/nipap.nix | 6 +- nixos/modules/services/web-apps/ocis.nix | 3 +- nixos/modules/services/web-apps/opencloud.nix | 9 +- .../services/web-apps/openvscode-server.nix | 63 +- nixos/modules/services/web-apps/outline.nix | 9 +- nixos/modules/services/web-apps/part-db.nix | 3 +- .../services/web-apps/peering-manager.nix | 36 +- nixos/modules/services/web-apps/peertube.nix | 189 ++-- .../modules/services/web-apps/photoprism.nix | 3 +- nixos/modules/services/web-apps/pixelfed.nix | 25 +- nixos/modules/services/web-apps/plausible.nix | 118 ++- .../services/web-apps/powerdns-admin.nix | 42 +- nixos/modules/services/web-apps/pretalx.nix | 42 +- .../modules/services/web-apps/reposilite.nix | 9 +- nixos/modules/services/web-apps/screego.nix | 3 +- nixos/modules/services/web-apps/shiori.nix | 44 +- nixos/modules/services/web-apps/snipe-it.nix | 3 +- nixos/modules/services/web-apps/tt-rss.nix | 9 +- nixos/modules/services/web-apps/vikunja.nix | 9 +- nixos/modules/services/web-apps/wakapi.nix | 6 +- nixos/modules/services/web-apps/weblate.nix | 137 ++- nixos/modules/services/web-apps/windmill.nix | 34 +- nixos/modules/services/web-apps/wordpress.nix | 3 +- .../modules/services/web-apps/writefreely.nix | 11 +- nixos/modules/services/web-apps/zabbix.nix | 59 +- .../web-servers/apache-httpd/default.nix | 183 ++-- .../services/web-servers/caddy/default.nix | 32 +- .../modules/services/web-servers/fcgiwrap.nix | 51 +- nixos/modules/services/web-servers/garage.nix | 6 +- .../services/web-servers/h2o/default.nix | 119 ++- .../services/web-servers/hitch/default.nix | 15 +- nixos/modules/services/web-servers/minio.nix | 9 +- .../services/web-servers/nginx/default.nix | 57 +- .../modules/services/web-servers/pomerium.nix | 6 +- nixos/modules/services/web-servers/send.nix | 48 +- .../services/web-servers/stargazer.nix | 34 +- nixos/modules/services/web-servers/tomcat.nix | 3 +- .../web-servers/trafficserver/default.nix | 33 +- nixos/modules/services/web-servers/ttyd.nix | 105 +- nixos/modules/services/x11/clight.nix | 25 +- .../services/x11/desktop-managers/budgie.nix | 35 +- .../x11/desktop-managers/cinnamon.nix | 37 +- .../x11/desktop-managers/pantheon.nix | 17 +- .../services/x11/desktop-managers/plasma5.nix | 31 +- .../x11/window-managers/wmderland.nix | 3 +- nixos/modules/services/x11/xautolock.nix | 29 +- nixos/modules/services/x11/xserver.nix | 29 +- .../system/activation/activation-script.nix | 68 +- nixos/modules/system/activation/bootspec.nix | 25 +- nixos/modules/system/activation/top-level.nix | 75 +- nixos/modules/system/boot/binfmt.nix | 16 +- nixos/modules/system/boot/initrd-ssh.nix | 75 +- nixos/modules/system/boot/kernel.nix | 13 +- .../modules/system/boot/loader/grub/grub.nix | 79 +- .../modules/system/boot/loader/grub/ipxe.nix | 19 +- .../boot/loader/systemd-boot/systemd-boot.nix | 111 ++- nixos/modules/system/boot/luksroot.nix | 42 +- nixos/modules/system/boot/networkd.nix | 34 +- nixos/modules/system/boot/plymouth.nix | 3 +- nixos/modules/system/boot/resolved.nix | 19 +- nixos/modules/system/boot/stage-1.nix | 87 +- nixos/modules/system/boot/stratisroot.nix | 39 +- nixos/modules/system/boot/systemd.nix | 331 ++++--- nixos/modules/system/boot/systemd/initrd.nix | 191 ++-- nixos/modules/system/boot/systemd/logind.nix | 39 +- nixos/modules/system/boot/systemd/nspawn.nix | 3 +- nixos/modules/system/boot/systemd/repart.nix | 3 +- .../modules/system/boot/systemd/shutdown.nix | 3 +- .../modules/system/boot/systemd/sysusers.nix | 33 +- .../modules/system/boot/systemd/tmpfiles.nix | 129 ++- nixos/modules/system/boot/systemd/tpm2.nix | 11 +- nixos/modules/system/boot/systemd/user.nix | 3 +- nixos/modules/system/boot/timesyncd.nix | 21 +- nixos/modules/system/boot/uki.nix | 24 +- nixos/modules/system/etc/etc-activation.nix | 26 +- nixos/modules/tasks/filesystems.nix | 206 ++-- nixos/modules/tasks/filesystems/bcachefs.nix | 23 +- nixos/modules/tasks/filesystems/btrfs.nix | 17 +- nixos/modules/tasks/filesystems/nfs.nix | 32 +- nixos/modules/tasks/filesystems/zfs.nix | 6 +- .../tasks/network-interfaces-scripted.nix | 17 +- .../tasks/network-interfaces-systemd.nix | 82 +- nixos/modules/tasks/network-interfaces.nix | 345 ++++--- nixos/modules/virtualisation/containers.nix | 13 +- .../virtualisation/digital-ocean-config.nix | 9 +- nixos/modules/virtualisation/docker.nix | 7 +- nixos/modules/virtualisation/incus.nix | 40 +- nixos/modules/virtualisation/libvirtd.nix | 13 +- .../virtualisation/lxc-image-metadata.nix | 3 +- nixos/modules/virtualisation/lxd-agent.nix | 15 +- nixos/modules/virtualisation/lxd.nix | 3 +- .../virtualisation/nixos-containers.nix | 3 +- .../modules/virtualisation/oci-containers.nix | 59 +- .../virtualisation/parallels-guest.nix | 3 +- .../modules/virtualisation/podman/default.nix | 8 +- nixos/modules/virtualisation/qemu-vm.nix | 6 +- .../virtualisation/virtualbox-host.nix | 23 +- .../virtualisation/virtualbox-image.nix | 29 +- nixos/modules/virtualisation/waagent.nix | 3 +- nixos/tests/boot.nix | 69 +- nixos/tests/calibre-server.nix | 3 +- nixos/tests/cassandra.nix | 129 ++- nixos/tests/chromium.nix | 21 +- nixos/tests/common/ec2.nix | 112 ++- nixos/tests/dokuwiki.nix | 8 +- nixos/tests/easytier.nix | 3 +- nixos/tests/ergochat.nix | 65 +- nixos/tests/garage/default.nix | 3 +- nixos/tests/hadoop/hdfs.nix | 77 +- nixos/tests/incus/incus-tests.nix | 539 +++++----- nixos/tests/inspircd.nix | 67 +- nixos/tests/installed-tests/default.nix | 3 +- nixos/tests/installer.nix | 53 +- nixos/tests/kafka/base.nix | 131 ++- nixos/tests/kernel-rust.nix | 29 +- nixos/tests/kubernetes/base.nix | 9 +- nixos/tests/lomiri-gallery-app.nix | 125 ++- nixos/tests/lomiri-music-app.nix | 14 +- nixos/tests/man.nix | 122 ++- nixos/tests/mattermost/default.nix | 8 +- nixos/tests/mysql/mysql.nix | 3 +- .../networking/networkd-and-scripted.nix | 245 +++-- nixos/tests/opensnitch.nix | 122 ++- nixos/tests/optee.nix | 10 +- nixos/tests/paretosecurity.nix | 12 +- nixos/tests/pulseaudio.nix | 20 +- nixos/tests/redis.nix | 3 +- nixos/tests/shadowsocks/common.nix | 27 +- nixos/tests/solanum.nix | 65 +- nixos/tests/syncthing-many-devices.nix | 117 ++- nixos/tests/systemd-confinement/default.nix | 31 +- nixos/tests/vaultwarden.nix | 147 ++- nixos/tests/virtualbox.nix | 3 +- nixos/tests/ydotool.nix | 48 +- nixos/tests/zfs.nix | 147 ++- pkgs/applications/audio/ardour/7.nix | 148 ++- pkgs/applications/audio/ardour/default.nix | 161 ++- .../audio/bucklespring/default.nix | 19 +- pkgs/applications/audio/carla/default.nix | 50 +- pkgs/applications/audio/chuck/default.nix | 19 +- .../applications/audio/clementine/default.nix | 69 +- pkgs/applications/audio/cmus/default.nix | 16 +- pkgs/applications/audio/csound/default.nix | 58 +- pkgs/applications/audio/deadbeef/default.nix | 166 ++-- .../audio/easyaudiosync/default.nix | 40 +- pkgs/applications/audio/espeak-ng/default.nix | 27 +- pkgs/applications/audio/espeak/default.nix | 15 +- pkgs/applications/audio/espeak/edit.nix | 27 +- pkgs/applications/audio/guitarix/default.nix | 3 +- pkgs/applications/audio/jamesdsp/default.nix | 33 +- pkgs/applications/audio/librespot/default.nix | 28 +- .../audio/mellowplayer/default.nix | 41 +- .../audio/miniaudicle/default.nix | 15 +- pkgs/applications/audio/mmlgui/default.nix | 19 +- pkgs/applications/audio/mopidy/youtube.nix | 3 +- pkgs/applications/audio/mpg123/default.nix | 3 +- pkgs/applications/audio/munt/mt32emu-qt.nix | 23 +- pkgs/applications/audio/musescore/default.nix | 105 +- pkgs/applications/audio/noson/default.nix | 21 +- .../audio/open-music-kontrollers/generic.nix | 3 +- pkgs/applications/audio/pithos/default.nix | 40 +- pkgs/applications/audio/puredata/default.nix | 54 +- pkgs/applications/audio/quodlibet/default.nix | 122 ++- .../audio/radiotray-ng/default.nix | 37 +- pkgs/applications/audio/reaper/default.nix | 38 +- pkgs/applications/audio/sayonara/default.nix | 31 +- pkgs/applications/audio/snapcast/default.nix | 31 +- pkgs/applications/audio/sonic-pi/default.nix | 53 +- .../audio/vorbis-tools/default.nix | 3 +- .../audio/youtube-music/default.nix | 44 +- .../audio/zynaddsubfx/default.nix | 78 +- .../applications/backup/timeshift/default.nix | 10 +- .../applications/backup/timeshift/minimal.nix | 10 +- .../blockchains/bitcoin-knots/default.nix | 92 +- .../blockchains/bitcoin/default.nix | 133 ++- .../blockchains/digibyte/default.nix | 57 +- .../blockchains/elements/default.nix | 96 +- .../blockchains/groestlcoin/default.nix | 119 ++- .../blockchains/vertcoin/default.nix | 59 +- .../display-managers/greetd/qtgreet.nix | 3 +- .../display-managers/lightdm/default.nix | 6 +- .../editors/code-browser/default.nix | 75 +- .../applications/editors/cudatext/default.nix | 59 +- .../editors/eclipse/build-eclipse.nix | 3 +- pkgs/applications/editors/eclipse/plugins.nix | 3 +- .../editors/emacs/build-support/elpa.nix | 3 +- .../editors/emacs/build-support/generic.nix | 69 +- .../editors/emacs/build-support/melpa.nix | 61 +- .../elisp-packages/elpa-common-overrides.nix | 8 +- .../tree-sitter-langs/default.nix | 10 +- .../emacs/elisp-packages/melpa-packages.nix | 197 ++-- .../applications/editors/emacs/make-emacs.nix | 422 ++++---- pkgs/applications/editors/emacs/sources.nix | 40 +- .../editors/jetbrains/default.nix | 27 +- pkgs/applications/editors/jupyter/console.nix | 15 +- .../editors/mindforger/default.nix | 13 +- .../editors/neovim/gnvim/wrapper.nix | 29 +- pkgs/applications/editors/neovim/utils.nix | 3 +- pkgs/applications/editors/neovim/wrapper.nix | 106 +- .../applications/editors/sublime/3/common.nix | 33 +- .../applications/editors/sublime/4/common.nix | 68 +- pkgs/applications/editors/texmacs/default.nix | 39 +- .../applications/editors/texworks/default.nix | 30 +- pkgs/applications/editors/vim/default.nix | 45 +- pkgs/applications/editors/vim/full.nix | 190 ++-- .../editors/vim/plugins/overrides.nix | 43 +- .../vim/plugins/utils/build-vim-plugin.nix | 3 +- .../editors/vim/plugins/utils/vim-utils.nix | 42 +- .../extensions/ms-python.python/default.nix | 31 +- .../extensions/ms-vscode.cpptools/default.nix | 56 +- .../vadimcn.vscode-lldb/default.nix | 15 +- .../vscode/extensions/vscode-utils.nix | 15 +- .../editors/vscode/extensions/vscodeEnv.nix | 3 +- pkgs/applications/editors/vscode/generic.nix | 150 ++- pkgs/applications/emulators/box64/default.nix | 39 +- pkgs/applications/emulators/box86/default.nix | 29 +- .../applications/emulators/dosbox/default.nix | 21 +- .../emulators/libretro/mkLibretroCore.nix | 9 +- pkgs/applications/emulators/mame/default.nix | 129 ++- pkgs/applications/emulators/punes/default.nix | 29 +- pkgs/applications/emulators/wine/base.nix | 34 +- pkgs/applications/emulators/wine/sources.nix | 6 +- pkgs/applications/emulators/wine/staging.nix | 23 +- pkgs/applications/gis/qgis/unwrapped-ltr.nix | 112 ++- pkgs/applications/gis/qgis/unwrapped.nix | 106 +- .../gis/zombietrackergps/default.nix | 21 +- .../applications/graphics/ImageMagick/6.x.nix | 79 +- .../graphics/ImageMagick/default.nix | 142 +-- .../graphics/apitrace/default.nix | 109 +-- pkgs/applications/graphics/drawio/default.nix | 101 +- pkgs/applications/graphics/feh/default.nix | 13 +- .../graphics/gimp/2.0/default.nix | 145 ++- pkgs/applications/graphics/gimp/default.nix | 199 ++-- .../graphics/gimp/plugins/default.nix | 9 +- .../graphics/inkscape/default.nix | 110 +-- pkgs/applications/graphics/ipe/default.nix | 62 +- .../graphics/mandelbulber/default.nix | 25 +- pkgs/applications/graphics/nufraw/default.nix | 33 +- .../graphics/rawtherapee/default.nix | 103 +- .../graphics/sane/backends/default.nix | 50 +- pkgs/applications/graphics/sane/config.nix | 25 +- pkgs/applications/graphics/sane/frontends.nix | 3 +- pkgs/applications/graphics/sane/xsane.nix | 3 +- pkgs/applications/kde/ark/default.nix | 6 +- pkgs/applications/kde/audiotube.nix | 41 +- pkgs/applications/kde/cantor.nix | 68 +- pkgs/applications/kde/falkon.nix | 3 +- pkgs/applications/kde/okular.nix | 3 +- pkgs/applications/kde/plasmatube/default.nix | 31 +- pkgs/applications/maui/booth.nix | 35 +- .../misc/avalonia-ilspy/default.nix | 50 +- pkgs/applications/misc/clight/clightd.nix | 64 +- pkgs/applications/misc/clight/default.nix | 25 +- pkgs/applications/misc/electrum/grs.nix | 41 +- pkgs/applications/misc/electrum/ltc.nix | 33 +- pkgs/applications/misc/goldendict/default.nix | 53 +- pkgs/applications/misc/gpsbabel/default.nix | 137 ++- pkgs/applications/misc/gpxsee/default.nix | 31 +- pkgs/applications/misc/ikiwiki/default.nix | 85 +- pkgs/applications/misc/inochi2d/generic.nix | 3 +- pkgs/applications/misc/input-leap/default.nix | 44 +- pkgs/applications/misc/kemai/default.nix | 3 +- pkgs/applications/misc/lutris/default.nix | 37 +- pkgs/applications/misc/meerk40t/default.nix | 13 +- pkgs/applications/misc/opencpn/default.nix | 133 ++- pkgs/applications/misc/opentrack/default.nix | 6 +- pkgs/applications/misc/pagefind/default.nix | 25 +- pkgs/applications/misc/pdfstudio/common.nix | 3 +- .../misc/prusa-slicer/default.nix | 71 +- .../misc/prusa-slicer/super-slicer.nix | 24 +- .../misc/qMasterPassword/default.nix | 21 +- pkgs/applications/misc/qcad/default.nix | 108 +- .../misc/qsyncthingtray/default.nix | 6 +- pkgs/applications/misc/redshift/default.nix | 49 +- pkgs/applications/misc/resp-app/default.nix | 3 +- pkgs/applications/misc/rofi-emoji/default.nix | 23 +- pkgs/applications/misc/rofi-rbw/default.nix | 46 +- pkgs/applications/misc/rofi/wrapper.nix | 3 +- .../misc/syncthingtray/default.nix | 63 +- pkgs/applications/misc/synergy/default.nix | 133 ++- pkgs/applications/misc/visidata/default.nix | 111 ++- pkgs/applications/misc/xpdf/default.nix | 18 +- pkgs/applications/misc/xygrib/default.nix | 9 +- .../misc/zathura/core/default.nix | 29 +- .../misc/zathura/pdf-mupdf/default.nix | 3 +- .../networking/browsers/chromium/common.nix | 504 +++++----- .../networking/browsers/elinks/default.nix | 74 +- .../browsers/firefox-bin/default.nix | 39 +- .../networking/browsers/firefox/common.nix | 447 +++++---- .../networking/browsers/firefox/wrapper.nix | 167 ++-- .../networking/browsers/netsurf/browser.nix | 72 +- .../browsers/netsurf/libparserutils.nix | 15 +- .../networking/browsers/palemoon/bin.nix | 21 +- .../cluster/docker-machine/kvm2.nix | 8 +- .../networking/cluster/hadoop/default.nix | 114 +-- .../networking/cluster/k3s/builder.nix | 39 +- .../networking/cluster/rke2/builder.nix | 3 +- .../networking/cluster/spark/default.nix | 3 +- .../networking/firehol/default.nix | 3 +- .../networking/hpmyroom/default.nix | 45 +- .../instant-messengers/bitlbee/default.nix | 30 +- .../instant-messengers/gajim/default.nix | 37 +- .../instant-messengers/jami/default.nix | 6 +- .../pantalaimon/default.nix | 13 +- .../instant-messengers/pidgin/default.nix | 66 +- .../instant-messengers/profanity/default.nix | 82 +- .../instant-messengers/psi-plus/default.nix | 78 +- .../instant-messengers/ripcord/default.nix | 39 +- .../telegram/telegram-desktop/default.nix | 48 +- .../telegram/telegram-desktop/tg_owt.nix | 57 +- .../telegram/telegram-desktop/unwrapped.nix | 78 +- .../networking/irc/quassel/default.nix | 70 +- .../networking/irc/weechat/default.nix | 63 +- .../networking/libcoap/default.nix | 34 +- .../mailreaders/mailnag/default.nix | 3 +- .../mailreaders/notmuch/default.nix | 130 ++- .../networking/mailreaders/notmuch/mutt.nix | 27 +- .../mailreaders/thunderbird-bin/default.nix | 3 +- .../mailreaders/thunderbird/packages.nix | 25 +- .../mailreaders/thunderbird/wrapper.nix | 12 +- .../networking/mkchromecast/default.nix | 22 +- .../networking/mullvad/mullvad.nix | 16 +- .../networking/mullvad/openvpn.nix | 55 +- .../networking/mumble/default.nix | 90 +- .../networking/p2p/deluge/default.nix | 52 +- .../networking/p2p/eiskaltdcpp/default.nix | 3 +- .../networking/p2p/gnunet/default.nix | 3 +- .../networking/p2p/jesec-rtorrent/default.nix | 26 +- .../networking/p2p/mldonkey/default.nix | 21 +- .../networking/p2p/transmission/4.nix | 111 +-- .../networking/protonvpn-gui/default.nix | 19 +- .../networking/seafile-client/default.nix | 3 +- .../sniffers/qtwirediff/default.nix | 46 +- .../networking/sniffers/wireshark/default.nix | 196 ++-- .../networking/sync/rsync/default.nix | 56 +- .../networking/syncplay/default.nix | 17 +- .../networking/syncthing/default.nix | 39 +- pkgs/applications/networking/znc/default.nix | 36 +- .../office/activitywatch/wrapper.nix | 3 +- .../office/beamerpresenter/default.nix | 47 +- .../office/libreoffice/default.nix | 417 ++++---- .../office/paperwork/paperwork-gtk.nix | 3 +- pkgs/applications/office/scribus/default.nix | 3 +- pkgs/applications/radio/direwolf/default.nix | 41 +- pkgs/applications/radio/fldigi/default.nix | 33 +- pkgs/applications/radio/gnuradio/default.nix | 19 +- pkgs/applications/radio/gnuradio/shared.nix | 88 +- pkgs/applications/radio/limesuite/default.nix | 30 +- .../applications/radio/qradiolink/default.nix | 65 +- pkgs/applications/radio/sdr-j-fm/default.nix | 3 +- pkgs/applications/radio/soapysdr/default.nix | 17 +- pkgs/applications/radio/welle-io/default.nix | 9 +- .../science/astronomy/stellarium/default.nix | 50 +- .../science/biology/blast/bin.nix | 23 +- .../science/biology/nest/default.nix | 25 +- .../science/biology/truvari/default.nix | 15 +- .../chemistry/autodock-vina/default.nix | 13 +- .../chemistry/quantum-espresso/default.nix | 32 +- .../science/chemistry/siesta/default.nix | 68 +- .../science/electronics/dsview/default.nix | 6 +- .../science/electronics/fritzing/default.nix | 29 +- .../hal-hardware-analyzer/default.nix | 37 +- .../science/electronics/kicad/base.nix | 171 ++-- .../science/electronics/kicad/libraries.nix | 15 +- .../science/electronics/openems/default.nix | 27 +- .../science/electronics/pulseview/default.nix | 6 +- .../science/electronics/qucs-s/default.nix | 27 +- .../science/logic/abella/default.nix | 17 +- .../science/logic/coq/default.nix | 54 +- .../science/logic/cubicle/default.nix | 17 +- .../science/logic/eprover/default.nix | 15 +- .../science/logic/prooftree/default.nix | 15 +- .../science/logic/tamarin-prover/default.nix | 45 +- .../machine-learning/shogun/default.nix | 108 +- pkgs/applications/science/math/R/default.nix | 79 +- .../science/math/caffe/default.nix | 93 +- .../science/math/glsurf/default.nix | 42 +- .../science/math/lp_solve/default.nix | 34 +- .../science/math/mathematica/generic.nix | 149 ++- .../science/math/maxima/default.nix | 25 +- .../science/math/pari/default.nix | 24 +- .../science/math/weka/default.nix | 3 +- .../science/math/wolfram-engine/default.nix | 71 +- .../science/math/yacas/default.nix | 44 +- .../science/misc/boinc/default.nix | 44 +- .../science/misc/colmap/default.nix | 54 +- .../science/misc/golly/default.nix | 21 +- .../openmodelica/mkderivation/default.nix | 16 +- .../misc/openmodelica/omcompiler/default.nix | 3 +- .../science/misc/openmvg/default.nix | 3 +- .../science/misc/tulip/default.nix | 30 +- .../molecular-dynamics/gromacs/default.nix | 109 +-- .../science/physics/crystfel/default.nix | 50 +- .../science/robotics/mavproxy/default.nix | 29 +- pkgs/applications/search/recoll/default.nix | 176 ++-- pkgs/applications/system/glances/default.nix | 3 +- .../cool-retro-term/default.nix | 17 +- .../rxvt-unicode/default.nix | 57 +- .../terminal-emulators/termite/default.nix | 3 +- .../version-management/cgit/common.nix | 17 +- .../version-management/fossil/default.nix | 22 +- .../version-management/git/default.nix | 692 +++++++------ .../monotone-viz/graphviz-2.0.nix | 3 +- .../version-management/monotone/default.nix | 19 +- .../silver-platter/default.nix | 3 +- .../sublime-merge/common.nix | 43 +- .../version-management/subversion/default.nix | 64 +- .../video/anilibria-winmaclinux/default.nix | 40 +- pkgs/applications/video/clipgrab/default.nix | 21 +- .../video/hyperion-ng/default.nix | 43 +- .../video/jellyfin-media-player/default.nix | 46 +- .../video/kodi/build-kodi-binary-addon.nix | 6 +- pkgs/applications/video/kodi/unwrapped.nix | 349 ++++--- pkgs/applications/video/mplayer/default.nix | 164 ++-- pkgs/applications/video/mpv/default.nix | 201 ++-- .../video/mpv/scripts/buildLua.nix | 51 +- .../video/mpv/scripts/videoclip.nix | 17 +- pkgs/applications/video/mpv/wrapper.nix | 25 +- pkgs/applications/video/mythtv/default.nix | 3 +- .../applications/video/obs-studio/default.nix | 116 +-- .../obs-studio/plugins/obs-vkcapture.nix | 29 +- .../applications/video/obs-studio/wrapper.nix | 3 +- .../video/openshot-qt/default.nix | 38 +- .../video/pipe-viewer/default.nix | 58 +- pkgs/applications/video/vdr/default.nix | 32 +- .../virtualization/OVMF/default.nix | 92 +- .../virtualization/cri-o/default.nix | 25 +- .../virtualization/docker/default.nix | 83 +- .../virtualization/krunvm/default.nix | 14 +- .../virtualization/qemu/default.nix | 379 ++++---- .../virtualization/singularity/generic.nix | 58 +- .../virtualization/virt-manager/default.nix | 36 +- .../virtualization/virtualbox/default.nix | 88 +- .../virtualbox/guest-additions/builder.nix | 3 +- .../virtualbox/guest-additions/default.nix | 3 +- .../window-managers/awesome/default.nix | 6 +- .../window-managers/i3/lock-fancy.nix | 21 +- .../window-managers/i3/status-rust.nix | 35 +- .../window-managers/wayfire/wrapper.nix | 3 +- .../xmonad/log-applet/default.nix | 37 +- pkgs/build-support/appimage/default.nix | 3 +- pkgs/build-support/binary-cache/default.nix | 17 +- .../bintools-wrapper/default.nix | 245 +++-- .../build-bazel-package/default.nix | 117 ++- .../build-fhsenv-bubblewrap/buildFHSEnv.nix | 23 +- .../build-fhsenv-bubblewrap/default.nix | 3 +- .../build-support/build-fhsenv-chroot/env.nix | 6 +- .../build-graalvm-native-image/default.nix | 9 +- pkgs/build-support/cc-wrapper/default.nix | 299 +++--- pkgs/build-support/checkpoint-build.nix | 38 +- .../dart/build-dart-application/default.nix | 17 +- .../dlang/builddubpackage/default.nix | 3 +- pkgs/build-support/docker/default.nix | 98 +- pkgs/build-support/docker/examples.nix | 17 +- .../build-dotnet-global-tool/default.nix | 3 +- .../dotnet/build-dotnet-package/default.nix | 3 +- .../dotnet/fetch-nupkg/overrides.nix | 18 +- pkgs/build-support/fetchgit/default.nix | 13 +- .../fetchnextcloudapp/default.nix | 23 +- pkgs/build-support/fetchpatch/default.nix | 115 ++- .../fetchrepoproject/default.nix | 3 +- pkgs/build-support/fetchsourcehut/default.nix | 25 +- pkgs/build-support/fetchsvn/default.nix | 3 +- pkgs/build-support/fetchtorrent/default.nix | 21 +- pkgs/build-support/fetchurl/default.nix | 3 +- pkgs/build-support/fetchzip/default.nix | 67 +- pkgs/build-support/go/module.nix | 6 +- .../kernel/compress-firmware.nix | 3 +- pkgs/build-support/kernel/make-initrd-ng.nix | 3 +- pkgs/build-support/kernel/make-initrd.nix | 3 +- .../make-desktopitem/default.nix | 3 +- .../node/build-npm-package/default.nix | 3 +- .../node/import-npm-lock/default.nix | 29 +- pkgs/build-support/ocaml/dune.nix | 3 +- pkgs/build-support/ocaml/oasis.nix | 3 +- pkgs/build-support/ocaml/topkg.nix | 3 +- pkgs/build-support/php/build-pecl.nix | 3 +- .../pkg-config-wrapper/default.nix | 41 +- .../portable-service/default.nix | 35 +- pkgs/build-support/release/nix-build.nix | 22 +- .../remove-references-to/default.nix | 3 +- .../rust/build-rust-crate/build-crate.nix | 51 +- .../rust/build-rust-crate/default.nix | 19 +- .../rust/build-rust-crate/test/default.nix | 20 +- .../rust/build-rust-package/default.nix | 11 +- .../rust/default-crate-overrides.nix | 35 +- .../build-support/rust/fetch-cargo-vendor.nix | 3 +- pkgs/build-support/rust/hooks/default.nix | 65 +- pkgs/build-support/rust/import-cargo-lock.nix | 3 +- pkgs/build-support/rust/lib/default.nix | 49 +- .../setup-hooks/wrap-gapps-hook/default.nix | 19 +- pkgs/build-support/testers/default.nix | 50 +- .../testers/hasCmakeConfigModules/tester.nix | 38 +- .../testers/hasPkgConfigModules/tester.nix | 35 +- pkgs/build-support/testers/lychee.nix | 19 +- .../trivial-builders/default.nix | 35 +- .../test/write-shell-script.nix | 18 +- .../wasm-bindgen-cli/default.nix | 11 +- pkgs/by-name/_1/_1fps/package.nix | 3 +- pkgs/by-name/_1/_1password-cli/package.nix | 22 +- pkgs/by-name/_3/_389-ds-base/package.nix | 97 +- pkgs/by-name/_7/_7zz/package.nix | 25 +- pkgs/by-name/_8/_86Box/package.nix | 68 +- pkgs/by-name/_9/_9base/package.nix | 3 +- pkgs/by-name/a2/a2jmidid/package.nix | 19 +- pkgs/by-name/aa/aalib/package.nix | 3 +- pkgs/by-name/ab/abseil-cpp_202501/package.nix | 17 +- pkgs/by-name/ac/accountsservice/package.nix | 27 +- pkgs/by-name/ac/acsccid/package.nix | 15 +- pkgs/by-name/ac/actiona/package.nix | 3 +- pkgs/by-name/ad/adaptivecpp/package.nix | 67 +- pkgs/by-name/ad/adaptivecpp/tests.nix | 38 +- pkgs/by-name/ad/adios2/package.nix | 89 +- pkgs/by-name/ad/adlplug/package.nix | 29 +- pkgs/by-name/ae/aegisub/package.nix | 47 +- pkgs/by-name/ae/aerc/package.nix | 3 +- pkgs/by-name/af/afew/package.nix | 15 +- pkgs/by-name/af/affine-bin/package.nix | 66 +- pkgs/by-name/af/affine/package.nix | 39 +- pkgs/by-name/af/afflib/package.nix | 19 +- .../by-name/ag/age-plugin-yubikey/package.nix | 3 +- pkgs/by-name/ag/ags/bundle.nix | 41 +- pkgs/by-name/ah/ahoviewer/package.nix | 3 +- pkgs/by-name/ai/aider-chat/package.nix | 48 +- pkgs/by-name/ai/aircrack-ng/package.nix | 21 +- pkgs/by-name/ai/airgeddon/package.nix | 107 +- pkgs/by-name/ai/airtame/package.nix | 3 +- pkgs/by-name/ai/airwin2rack/package.nix | 123 ++- pkgs/by-name/ak/akkoma-admin-fe/package.nix | 3 +- pkgs/by-name/al/alacritty/package.nix | 31 +- pkgs/by-name/al/albert/package.nix | 39 +- pkgs/by-name/al/alcom/package.nix | 21 +- pkgs/by-name/al/algol68g/package.nix | 3 +- pkgs/by-name/al/aliae/package.nix | 19 +- pkgs/by-name/al/aligator/package.nix | 93 +- pkgs/by-name/al/alot/package.nix | 16 +- pkgs/by-name/al/alsa-ucm-conf/package.nix | 49 +- pkgs/by-name/al/alt-ergo/package.nix | 18 +- .../by-name/al/alttpr-opentracker/package.nix | 23 +- pkgs/by-name/am/amazon-ssm-agent/package.nix | 46 +- pkgs/by-name/am/amber-lang/package.nix | 15 +- pkgs/by-name/am/amberol/package.nix | 29 +- pkgs/by-name/am/amd-blis/package.nix | 13 +- pkgs/by-name/am/amd-libflame/package.nix | 21 +- pkgs/by-name/am/amdvlk/package.nix | 64 +- pkgs/by-name/am/amneziawg-tools/package.nix | 59 +- pkgs/by-name/am/ams/package.nix | 23 +- pkgs/by-name/am/amule/package.nix | 21 +- pkgs/by-name/an/ananicy-cpp/package.nix | 38 +- pkgs/by-name/an/andi/package.nix | 3 +- .../an/android-studio-tools/package.nix | 17 +- pkgs/by-name/an/angband/package.nix | 17 +- pkgs/by-name/an/ani-cli/package.nix | 21 +- pkgs/by-name/an/anime-downloader/package.nix | 41 +- pkgs/by-name/an/anubis/package.nix | 3 +- pkgs/by-name/an/anvil-editor/package.nix | 15 +- pkgs/by-name/an/anydesk/package.nix | 73 +- .../ap/apache-airflow/python-package.nix | 175 ++-- pkgs/by-name/ap/apache-orc/package.nix | 27 +- pkgs/by-name/ap/apbs/package.nix | 19 +- pkgs/by-name/ap/apcupsd/package.nix | 80 +- pkgs/by-name/ap/apfs-fuse/package.nix | 3 +- pkgs/by-name/ap/apkeditor/package.nix | 3 +- pkgs/by-name/ap/apostrophe/package.nix | 21 +- pkgs/by-name/ap/apparmor-parser/package.nix | 3 +- pkgs/by-name/ap/apparmor-utils/package.nix | 27 +- pkgs/by-name/ap/appflowy/package.nix | 3 +- pkgs/by-name/ap/appimageupdate/package.nix | 40 +- .../common/add-core-symbolication.nix | 14 +- .../apple-sdk/common/derivation-options.nix | 20 +- .../ap/apple-sdk/common/process-stubs.nix | 68 +- .../ap/apple-sdk/common/propagate-inputs.nix | 12 +- .../ap/apple-sdk/common/propagate-xcrun.nix | 52 +- .../common/remove-disallowed-packages.nix | 24 +- pkgs/by-name/ap/applgrid/package.nix | 17 +- pkgs/by-name/ap/aprutil/package.nix | 84 +- pkgs/by-name/ap/apt/package.nix | 76 +- pkgs/by-name/ar/arangodb/package.nix | 21 +- pkgs/by-name/ar/aravis/package.nix | 45 +- pkgs/by-name/ar/arcan/package.nix | 6 +- pkgs/by-name/ar/archi/package.nix | 23 +- pkgs/by-name/ar/archivebox/package.nix | 43 +- pkgs/by-name/ar/arduino-cli/package.nix | 3 +- .../ar/arduino-language-server/package.nix | 19 +- pkgs/by-name/ar/ares/package.nix | 64 +- pkgs/by-name/ar/argc/package.nix | 13 +- pkgs/by-name/ar/argon/package.nix | 13 +- pkgs/by-name/ar/arion/package.nix | 18 +- pkgs/by-name/ar/armitage/package.nix | 19 +- pkgs/by-name/ar/arpack/package.nix | 44 +- pkgs/by-name/ar/arrayfire/package.nix | 100 +- pkgs/by-name/ar/arrow-cpp/package.nix | 198 ++-- .../as/asc-key-to-qr-code-gif/package.nix | 17 +- pkgs/by-name/as/ashell/package.nix | 3 +- pkgs/by-name/as/assaultcube/package.nix | 27 +- pkgs/by-name/as/ast-grep/package.nix | 3 +- pkgs/by-name/at/at-spi2-core/package.nix | 77 +- pkgs/by-name/at/atlauncher/package.nix | 23 +- pkgs/by-name/at/atop/package.nix | 59 +- pkgs/by-name/at/ats2/package.nix | 23 +- pkgs/by-name/at/attic-client/package.nix | 3 +- pkgs/by-name/at/attract-mode/package.nix | 32 +- pkgs/by-name/au/aucatctl/package.nix | 22 +- pkgs/by-name/au/audacity/package.nix | 145 ++- pkgs/by-name/au/audio-recorder/package.nix | 33 +- pkgs/by-name/au/audio-sharing/package.nix | 31 +- pkgs/by-name/au/audit/package.nix | 15 +- pkgs/by-name/au/augustus/package.nix | 15 +- pkgs/by-name/au/ausweiskopie/package.nix | 3 +- .../au/auto-multiple-choice/package.nix | 69 +- pkgs/by-name/au/autogen/package.nix | 95 +- pkgs/by-name/av/av1an/package.nix | 25 +- pkgs/by-name/av/avalonia/package.nix | 95 +- pkgs/by-name/av/avidemux/package.nix | 62 +- pkgs/by-name/av/avrdude/package.nix | 25 +- pkgs/by-name/aw/aws-c-common/package.nix | 13 +- .../by-name/aw/aws-c-event-stream/package.nix | 3 +- pkgs/by-name/aw/aws-sdk-cpp/package.nix | 74 +- pkgs/by-name/aw/aws-sso-cli/package.nix | 24 +- pkgs/by-name/aw/awscli2/package.nix | 17 +- .../ay/ayatana-indicator-datetime/package.nix | 214 ++-- .../ay/ayatana-indicator-display/package.nix | 39 +- .../ay/ayatana-indicator-messages/package.nix | 63 +- .../ay/ayatana-indicator-power/package.nix | 27 +- .../ay/ayatana-indicator-sound/package.nix | 33 +- pkgs/by-name/az/azahar/package.nix | 106 +- pkgs/by-name/az/azimuth/package.nix | 3 +- pkgs/by-name/az/azpainter/package.nix | 6 +- pkgs/by-name/az/azure-cli/package.nix | 31 +- pkgs/by-name/ba/babeltrace/package.nix | 54 +- pkgs/by-name/ba/babeltrace2/package.nix | 36 +- pkgs/by-name/ba/babl/package.nix | 17 +- pkgs/by-name/ba/backrest/package.nix | 19 +- pkgs/by-name/ba/bacon/package.nix | 13 +- pkgs/by-name/ba/bacula/package.nix | 60 +- pkgs/by-name/ba/bagels/package.nix | 15 +- pkgs/by-name/ba/balena-cli/package.nix | 17 +- pkgs/by-name/ba/bambootracker/package.nix | 65 +- pkgs/by-name/ba/bambu-studio/package.nix | 75 +- pkgs/by-name/ba/bamf/package.nix | 28 +- pkgs/by-name/ba/baresip/package.nix | 87 +- pkgs/by-name/ba/barman/package.nix | 19 +- pkgs/by-name/ba/baserow/package.nix | 3 +- pkgs/by-name/ba/bats/package.nix | 230 +++-- pkgs/by-name/ba/bazarr/package.nix | 3 +- pkgs/by-name/bc/bcachefs-tools/package.nix | 27 +- pkgs/by-name/be/bearssl/package.nix | 3 +- pkgs/by-name/be/bemenu/package.nix | 65 +- pkgs/by-name/be/bento4/package.nix | 13 +- pkgs/by-name/be/bespokesynth/package.nix | 92 +- pkgs/by-name/be/bettercap/package.nix | 17 +- pkgs/by-name/be/betterlockscreen/package.nix | 3 +- pkgs/by-name/bf/bfs/package.nix | 17 +- pkgs/by-name/bi/biber-ms/package.nix | 13 +- pkgs/by-name/bi/biblioteca/package.nix | 3 +- pkgs/by-name/bi/biboumi/package.nix | 23 +- pkgs/by-name/bi/bind/package.nix | 74 +- pkgs/by-name/bi/binwalk/package.nix | 41 +- pkgs/by-name/bi/bison/package.nix | 3 +- pkgs/by-name/bi/bite/package.nix | 48 +- pkgs/by-name/bi/bitsnpicas/package.nix | 64 +- pkgs/by-name/bi/bitwarden-cli/package.nix | 19 +- pkgs/by-name/bi/bitwarden-desktop/package.nix | 115 ++- pkgs/by-name/bl/blackbox-terminal/package.nix | 8 +- pkgs/by-name/bl/blahtexml/package.nix | 39 +- pkgs/by-name/bl/bleep/package.nix | 3 +- pkgs/by-name/bl/blender/package.nix | 303 +++--- pkgs/by-name/bl/blendfarm/package.nix | 3 +- pkgs/by-name/bl/blis/package.nix | 13 +- pkgs/by-name/bl/blobdrop/package.nix | 30 +- pkgs/by-name/bl/blockbench/package.nix | 13 +- pkgs/by-name/bl/bloop/package.nix | 3 +- pkgs/by-name/bl/blueman/package.nix | 23 +- pkgs/by-name/bl/bluespec/package.nix | 209 ++-- pkgs/by-name/bl/bluez-alsa/package.nix | 27 +- pkgs/by-name/bl/bluez/package.nix | 48 +- pkgs/by-name/bm/bmake/package.nix | 15 +- pkgs/by-name/bm/bmon/package.nix | 3 +- pkgs/by-name/bn/bngblaster/package.nix | 3 +- pkgs/by-name/bo/bochs/package.nix | 180 ++-- pkgs/by-name/bo/boehmgc/package.nix | 15 +- pkgs/by-name/bo/bolt-launcher/package.nix | 17 +- pkgs/by-name/bo/boofuzz/package.nix | 3 +- pkgs/by-name/bo/boolector/package.nix | 3 +- pkgs/by-name/bo/bore/package.nix | 3 +- pkgs/by-name/bo/borgbackup/package.nix | 21 +- pkgs/by-name/bo/borgmatic/package.nix | 31 +- pkgs/by-name/bo/boringssl/package.nix | 16 +- pkgs/by-name/bo/bottles-unwrapped/package.nix | 27 +- pkgs/by-name/bo/boxfs/package.nix | 3 +- pkgs/by-name/bo/bozohttpd/package.nix | 3 +- pkgs/by-name/br/brainflow/package.nix | 9 +- pkgs/by-name/br/brave/make-brave.nix | 102 +- .../br/breeze-hacked-cursor-theme/package.nix | 37 +- pkgs/by-name/br/brig/package.nix | 25 +- pkgs/by-name/br/brltty/package.nix | 52 +- pkgs/by-name/br/broot/package.nix | 13 +- pkgs/by-name/br/browserpass/package.nix | 3 +- pkgs/by-name/br/bruno/package.nix | 15 +- pkgs/by-name/br/brunsli/package.nix | 13 +- pkgs/by-name/bs/bsdiff/package.nix | 45 +- pkgs/by-name/bs/bsnes-hd/package.nix | 57 +- pkgs/by-name/bt/btop/package.nix | 13 +- pkgs/by-name/bt/btor2tools/package.nix | 15 +- pkgs/by-name/bt/btrfs-assistant/package.nix | 28 +- pkgs/by-name/bt/btrfs-progs/package.nix | 50 +- .../bu/budgie-gsettings-overrides/package.nix | 3 +- pkgs/by-name/bu/bugdom/package.nix | 47 +- pkgs/by-name/bu/buildstream/package.nix | 39 +- pkgs/by-name/bu/buku/package.nix | 49 +- pkgs/by-name/bu/bumblebee/package.nix | 36 +- pkgs/by-name/bu/bun/package.nix | 3 +- pkgs/by-name/bu/burp/package.nix | 3 +- pkgs/by-name/bu/buteo-syncfw/package.nix | 38 +- pkgs/by-name/bw/bws/package.nix | 28 +- pkgs/by-name/by/byzanz/package.nix | 39 +- pkgs/by-name/c3/c3c/package.nix | 3 +- pkgs/by-name/ca/caddy/package.nix | 35 +- pkgs/by-name/ca/cadical/package.nix | 17 +- pkgs/by-name/ca/cairo/package.nix | 77 +- pkgs/by-name/ca/cakelisp/package.nix | 23 +- pkgs/by-name/ca/calc/package.nix | 31 +- pkgs/by-name/ca/calibre/package.nix | 6 +- pkgs/by-name/ca/calls/package.nix | 33 +- pkgs/by-name/ca/cameractrls/package.nix | 44 +- pkgs/by-name/ca/camilladsp/package.nix | 3 +- pkgs/by-name/ca/canaille/package.nix | 3 +- pkgs/by-name/ca/cantata/package.nix | 3 +- pkgs/by-name/ca/capnproto/package.nix | 3 +- pkgs/by-name/ca/cardinal/package.nix | 13 +- pkgs/by-name/ca/cardpeek/package.nix | 3 +- pkgs/by-name/ca/cargo-c/package.nix | 15 +- pkgs/by-name/ca/cargo-crev/package.nix | 13 +- pkgs/by-name/ca/cargo-cyclonedx/package.nix | 13 +- pkgs/by-name/ca/cargo-deadlinks/package.nix | 18 +- pkgs/by-name/ca/cargo-dephell/package.nix | 28 +- pkgs/by-name/ca/cargo-fund/package.nix | 13 +- pkgs/by-name/ca/cargo-geiger/package.nix | 22 +- pkgs/by-name/ca/cargo-generate/package.nix | 23 +- pkgs/by-name/ca/cargo-lambda/package.nix | 11 +- pkgs/by-name/ca/cargo-leptos/package.nix | 15 +- pkgs/by-name/ca/cargo-release/package.nix | 15 +- pkgs/by-name/ca/cargo-tarpaulin/package.nix | 11 +- pkgs/by-name/ca/cargo-tauri/package.nix | 13 +- pkgs/by-name/ca/cargo-tauri/test-app.nix | 15 +- pkgs/by-name/ca/cargo-tauri_1/package.nix | 15 +- pkgs/by-name/ca/cargo-udeps/package.nix | 11 +- pkgs/by-name/ca/cargo-ui/package.nix | 29 +- pkgs/by-name/ca/cargo-update/package.nix | 38 +- pkgs/by-name/ca/cargo-vibe/package.nix | 3 +- pkgs/by-name/ca/casadi/package.nix | 152 ++- pkgs/by-name/ca/casync/package.nix | 34 +- pkgs/by-name/ca/catalyst/package.nix | 21 +- pkgs/by-name/ca/catboost/package.nix | 54 +- pkgs/by-name/ca/catclock/package.nix | 24 +- pkgs/by-name/ca/catdvi/package.nix | 13 +- pkgs/by-name/ca/catppuccin-fcitx5/package.nix | 23 +- pkgs/by-name/ca/catppuccin/package.nix | 169 ++-- pkgs/by-name/ca/cava/package.nix | 41 +- pkgs/by-name/cb/cbc/package.nix | 3 +- pkgs/by-name/cb/cbmc/package.nix | 35 +- pkgs/by-name/cc/ccache/package.nix | 22 +- pkgs/by-name/cc/ccextractor/package.nix | 61 +- pkgs/by-name/cc/cctools/package.nix | 3 +- pkgs/by-name/cc/cctz/package.nix | 9 +- pkgs/by-name/cd/cdo/package.nix | 17 +- pkgs/by-name/cd/cdrkit/package.nix | 34 +- pkgs/by-name/cd/cdxgen/package.nix | 23 +- pkgs/by-name/ce/cegui/package.nix | 32 +- pkgs/by-name/ce/celeste64/package.nix | 3 +- pkgs/by-name/ce/centerpiece/package.nix | 29 +- pkgs/by-name/cf/cflow/package.nix | 7 +- pkgs/by-name/cg/cgns/package.nix | 17 +- pkgs/by-name/ch/chatd/package.nix | 3 +- pkgs/by-name/ch/checkinstall/package.nix | 59 +- pkgs/by-name/ch/cheesecutter/package.nix | 12 +- pkgs/by-name/ch/chessx/package.nix | 34 +- pkgs/by-name/ch/chiptrack/package.nix | 3 +- pkgs/by-name/ch/chromaprint/package.nix | 34 +- pkgs/by-name/ch/chrony/package.nix | 24 +- pkgs/by-name/ci/cifs-utils/package.nix | 15 +- .../cinnamon-gsettings-overrides/package.nix | 3 +- pkgs/by-name/ci/cinny-desktop/package.nix | 17 +- pkgs/by-name/ci/cinny-unwrapped/package.nix | 3 +- .../by-name/ci/ciscoPacketTracer8/package.nix | 79 +- pkgs/by-name/cj/cjdns/package.nix | 15 +- pkgs/by-name/cj/cjs/package.nix | 25 +- pkgs/by-name/cl/clamav/package.nix | 3 +- pkgs/by-name/cl/clang-uml/package.nix | 29 +- pkgs/by-name/cl/claws-mail/package.nix | 20 +- pkgs/by-name/cl/clblas/package.nix | 17 +- pkgs/by-name/cl/clfft/package.nix | 19 +- pkgs/by-name/cl/clickable/package.nix | 73 +- pkgs/by-name/cl/clickhouse/package.nix | 103 +- pkgs/by-name/cl/clightning/package.nix | 35 +- pkgs/by-name/cl/cling/package.nix | 122 ++- pkgs/by-name/cl/clipboard-jh/package.nix | 19 +- pkgs/by-name/cl/clutter/package.nix | 60 +- pkgs/by-name/cm/cmake/package.nix | 143 ++- pkgs/by-name/cm/cmdstan/package.nix | 36 +- pkgs/by-name/cm/cmtk/package.nix | 30 +- pkgs/by-name/cm/cmusfm/package.nix | 6 +- pkgs/by-name/cn/cnijfilter2/package.nix | 111 ++- pkgs/by-name/co/coal/package.nix | 48 +- pkgs/by-name/co/code-cursor/package.nix | 6 +- pkgs/by-name/co/codeblocks/package.nix | 36 +- pkgs/by-name/co/codec2/package.nix | 31 +- pkgs/by-name/co/cogl/package.nix | 105 +- pkgs/by-name/co/coin3d/package.nix | 3 +- pkgs/by-name/co/colima/package.nix | 3 +- pkgs/by-name/co/collision/package.nix | 17 +- pkgs/by-name/co/colord-gtk/package.nix | 27 +- pkgs/by-name/co/colord/package.nix | 76 +- pkgs/by-name/co/composefs/package.nix | 34 +- pkgs/by-name/co/conan/package.nix | 74 +- pkgs/by-name/co/conduktor-ctl/package.nix | 19 +- pkgs/by-name/co/conduwuit/package.nix | 36 +- pkgs/by-name/co/conglomerate/package.nix | 19 +- pkgs/by-name/co/conmon/package.nix | 19 +- .../co/connectome-workbench/package.nix | 15 +- pkgs/by-name/co/connman/package.nix | 185 ++-- pkgs/by-name/co/conntrack-tools/package.nix | 25 +- pkgs/by-name/co/conserver/package.nix | 32 +- pkgs/by-name/co/containerd/package.nix | 9 +- pkgs/by-name/co/contour/package.nix | 79 +- pkgs/by-name/co/convco/package.nix | 11 +- pkgs/by-name/co/convos/package.nix | 32 +- pkgs/by-name/co/coost/package.nix | 11 +- pkgs/by-name/co/copacetic/package.nix | 19 +- pkgs/by-name/co/coredns/package.nix | 39 +- pkgs/by-name/co/corosync/package.nix | 50 +- pkgs/by-name/co/corrscope/package.nix | 21 +- pkgs/by-name/co/corteza/package.nix | 15 +- pkgs/by-name/co/cosmic-comp/package.nix | 3 +- pkgs/by-name/co/coturn/package.nix | 21 +- pkgs/by-name/co/cozy/package.nix | 21 +- pkgs/by-name/cp/cp2k/package.nix | 80 +- pkgs/by-name/cp/cppcheck/package.nix | 37 +- pkgs/by-name/cp/cppitertools/package.nix | 19 +- pkgs/by-name/cr/cri-tools/package.nix | 27 +- pkgs/by-name/cr/criu/package.nix | 15 +- pkgs/by-name/cr/crocoddyl/package.nix | 48 +- pkgs/by-name/cr/crow-translate/package.nix | 27 +- pkgs/by-name/cr/crusader/package.nix | 36 +- pkgs/by-name/cr/cryfs/package.nix | 3 +- pkgs/by-name/cr/cryptsetup/package.nix | 42 +- pkgs/by-name/cs/csmith/package.nix | 13 +- pkgs/by-name/cu/cubeb/package.nix | 17 +- pkgs/by-name/cu/cubicsdr/package.nix | 25 +- pkgs/by-name/cu/cup-docker/package.nix | 13 +- .../cu/cups-brother-hll2350dw/package.nix | 71 +- .../cu/cups-brother-hll2375dw/package.nix | 81 +- .../cu/cups-brother-mfcl2750dw/package.nix | 71 +- .../cu/cups-brother-mfcl2800dw/package.nix | 69 +- pkgs/by-name/cu/cups-kyodialog/package.nix | 46 +- .../cu/curl-impersonate/chrome/default.nix | 49 +- .../cu/curl-impersonate/firefox/default.nix | 49 +- pkgs/by-name/cu/curlMinimal/package.nix | 138 ++- pkgs/by-name/cu/curv/package.nix | 39 +- pkgs/by-name/cv/cvc4/package.nix | 6 +- pkgs/by-name/cv/cvs/package.nix | 36 +- pkgs/by-name/cx/cxxopts/package.nix | 3 +- pkgs/by-name/cy/cyme/package.nix | 15 +- pkgs/by-name/cy/cypress/package.nix | 21 +- pkgs/by-name/cy/cyrus-imapd/package.nix | 88 +- pkgs/by-name/cy/cyrus_sasl/package.nix | 47 +- pkgs/by-name/da/daggerfall-unity/package.nix | 31 +- pkgs/by-name/da/dante/package.nix | 25 +- pkgs/by-name/da/dar/package.nix | 39 +- pkgs/by-name/da/darkly/package.nix | 23 +- pkgs/by-name/da/darkradiant/package.nix | 3 +- pkgs/by-name/da/darktable/package.nix | 140 ++- pkgs/by-name/da/darling-dmg/package.nix | 3 +- pkgs/by-name/da/dartsim/package.nix | 70 +- pkgs/by-name/da/dasher/package.nix | 3 +- pkgs/by-name/da/dav1d/package.nix | 17 +- pkgs/by-name/da/davix/package.nix | 19 +- pkgs/by-name/db/dbd/package.nix | 13 +- pkgs/by-name/db/dbeaver-bin/package.nix | 65 +- pkgs/by-name/db/dblatex/package.nix | 64 +- pkgs/by-name/db/dbmonster/package.nix | 21 +- pkgs/by-name/db/dbqn/package.nix | 68 +- pkgs/by-name/db/dbus-cpp/package.nix | 29 +- pkgs/by-name/db/dbus-glib/package.nix | 11 +- pkgs/by-name/db/dbus_cplusplus/package.nix | 15 +- pkgs/by-name/db/dbx/package.nix | 30 +- pkgs/by-name/dc/dclxvi/package.nix | 17 +- pkgs/by-name/dc/dconf/package.nix | 49 +- pkgs/by-name/dd/ddd/package.nix | 3 +- pkgs/by-name/dd/ddm/package.nix | 49 +- pkgs/by-name/dd/ddnet/package.nix | 49 +- pkgs/by-name/de/debian-devscripts/package.nix | 55 +- pkgs/by-name/de/delly/package.nix | 3 +- pkgs/by-name/de/delta/package.nix | 13 +- pkgs/by-name/de/deltachat-desktop/package.nix | 23 +- pkgs/by-name/de/deno/package.nix | 101 +- .../by-name/de/descent3-unwrapped/package.nix | 3 +- pkgs/by-name/de/devpi-client/package.nix | 29 +- pkgs/by-name/de/dexed/package.nix | 23 +- pkgs/by-name/dh/dhcpcd/package.nix | 24 +- pkgs/by-name/di/dia/package.nix | 52 +- pkgs/by-name/di/dictu/package.nix | 51 +- pkgs/by-name/di/didyoumean/package.nix | 13 +- pkgs/by-name/di/diesel-cli/package.nix | 17 +- pkgs/by-name/di/diffoscope/package.nix | 45 +- pkgs/by-name/di/directfb/package.nix | 98 +- pkgs/by-name/di/dirvish/package.nix | 15 +- pkgs/by-name/di/discocss/package.nix | 21 +- pkgs/by-name/di/displaycal/package.nix | 23 +- pkgs/by-name/di/distant/package.nix | 29 +- pkgs/by-name/di/distrobuilder/package.nix | 30 +- pkgs/by-name/di/dit/package.nix | 3 +- pkgs/by-name/dj/djenrandom/package.nix | 13 +- pkgs/by-name/dj/djent/package.nix | 13 +- pkgs/by-name/dl/dl-librescore/package.nix | 13 +- pkgs/by-name/dl/dlib/package.nix | 83 +- pkgs/by-name/dm/dmd/binary.nix | 17 +- pkgs/by-name/dm/dmd/generic.nix | 89 +- pkgs/by-name/dm/dmenu-rs/package.nix | 36 +- pkgs/by-name/dm/dmenu/package.nix | 3 +- pkgs/by-name/dn/dnf5/package.nix | 29 +- pkgs/by-name/dn/dnsmasq/package.nix | 70 +- pkgs/by-name/do/doas/package.nix | 13 +- pkgs/by-name/do/docbook2x/package.nix | 27 +- pkgs/by-name/do/dogdns/package.nix | 3 +- pkgs/by-name/do/dogedns/package.nix | 3 +- pkgs/by-name/do/dokuwiki/package.nix | 24 +- pkgs/by-name/do/dolfinx/package.nix | 3 +- .../do/dolphin-emu-primehack/package.nix | 157 ++- pkgs/by-name/do/dolphin-emu/package.nix | 139 ++- pkgs/by-name/do/doppler/package.nix | 23 +- pkgs/by-name/do/dosbox-staging/package.nix | 3 +- pkgs/by-name/do/dosbox-x/package.nix | 77 +- pkgs/by-name/do/dosfstools/package.nix | 3 +- pkgs/by-name/do/dovecot/package.nix | 195 ++-- pkgs/by-name/dp/dpdk/package.nix | 43 +- pkgs/by-name/dp/dpkg/package.nix | 44 +- pkgs/by-name/dr/drawpile/package.nix | 47 +- pkgs/by-name/dr/drawterm/package.nix | 54 +- pkgs/by-name/dr/drogon/package.nix | 33 +- pkgs/by-name/ds/dsd/package.nix | 3 +- pkgs/by-name/ds/dspam/package.nix | 62 +- pkgs/by-name/dt/dtc/package.nix | 27 +- pkgs/by-name/du/duc/package.nix | 17 +- pkgs/by-name/du/duckdb/package.nix | 28 +- pkgs/by-name/du/duckscript/package.nix | 11 +- pkgs/by-name/du/duktape/package.nix | 35 +- pkgs/by-name/du/dump1090-fa/package.nix | 3 +- pkgs/by-name/du/dumpvdl2/package.nix | 3 +- pkgs/by-name/du/dune3d/package.nix | 3 +- pkgs/by-name/du/dunst/package.nix | 60 +- pkgs/by-name/du/duplicity/package.nix | 66 +- pkgs/by-name/dv/dvdisaster/package.nix | 3 +- pkgs/by-name/dv/dvdplusrwtools/package.nix | 109 ++- pkgs/by-name/dv/dvdstyler/package.nix | 33 +- pkgs/by-name/dw/dwl/package.nix | 50 +- pkgs/by-name/dw/dwm/package.nix | 3 +- pkgs/by-name/dx/dxvk_1/package.nix | 35 +- pkgs/by-name/dx/dxvk_2/package.nix | 47 +- pkgs/by-name/dy/dyalog/package.nix | 135 ++- pkgs/by-name/dy/dynarmic/package.nix | 44 +- pkgs/by-name/e2/e2fsprogs/package.nix | 68 +- pkgs/by-name/ea/earlyoom/package.nix | 3 +- pkgs/by-name/ea/eartag/package.nix | 3 +- pkgs/by-name/ea/earthly/package.nix | 23 +- pkgs/by-name/ea/easypdkprog/package.nix | 13 +- pkgs/by-name/ea/easyrpg-player/package.nix | 71 +- pkgs/by-name/eb/ebpf-usb/package.nix | 11 +- pkgs/by-name/eb/ebtks/package.nix | 17 +- pkgs/by-name/ec/ecapture/package.nix | 31 +- pkgs/by-name/ec/eclib/package.nix | 17 +- pkgs/by-name/ec/ecryptfs/package.nix | 18 +- pkgs/by-name/ec/ecwolf/package.nix | 3 +- pkgs/by-name/ed/edencommon/package.nix | 15 +- pkgs/by-name/ed/edk2-uefi-shell/package.nix | 19 +- pkgs/by-name/ed/edk2/package.nix | 3 +- pkgs/by-name/ed/eduke32/package.nix | 146 ++- pkgs/by-name/eg/eggnog-mapper/package.nix | 17 +- pkgs/by-name/ei/eiwd/package.nix | 68 +- pkgs/by-name/ej/ejabberd/package.nix | 26 +- pkgs/by-name/el/elan/package.nix | 3 +- .../el/element-desktop/keytar/default.nix | 3 +- pkgs/by-name/el/element-desktop/package.nix | 3 +- pkgs/by-name/el/elfutils/package.nix | 65 +- pkgs/by-name/el/eli/package.nix | 21 +- pkgs/by-name/el/elmerfem/package.nix | 3 +- pkgs/by-name/el/elogind/package.nix | 48 +- pkgs/by-name/el/elpa/package.nix | 57 +- pkgs/by-name/em/emojipick/package.nix | 3 +- pkgs/by-name/em/emulsion/package.nix | 27 +- pkgs/by-name/en/en-croissant/package.nix | 17 +- pkgs/by-name/en/entangle/package.nix | 63 +- pkgs/by-name/en/ente-cli/package.nix | 43 +- pkgs/by-name/en/enum4linux-ng/package.nix | 15 +- pkgs/by-name/en/envchain/package.nix | 17 +- pkgs/by-name/en/envision/package.nix | 37 +- pkgs/by-name/en/envoy/package.nix | 59 +- pkgs/by-name/ep/epic5/package.nix | 21 +- pkgs/by-name/ep/epiphany/package.nix | 74 +- pkgs/by-name/ep/epoll-shim/package.nix | 17 +- pkgs/by-name/ep/epsonscan2/package.nix | 106 +- pkgs/by-name/eq/equibop/package.nix | 15 +- pkgs/by-name/er/ergoscf/package.nix | 3 +- pkgs/by-name/er/erofs-utils/package.nix | 38 +- pkgs/by-name/es/espanso/package.nix | 66 +- pkgs/by-name/ev/evince/package.nix | 88 +- .../ev/evolution-data-server/package.nix | 98 +- pkgs/by-name/ex/exaile/package.nix | 86 +- .../by-name/ex/example-robot-data/package.nix | 22 +- pkgs/by-name/ex/exatorrent/package.nix | 17 +- pkgs/by-name/ex/exempi/package.nix | 30 +- pkgs/by-name/ex/exim/package.nix | 51 +- pkgs/by-name/ex/exiv2/package.nix | 33 +- pkgs/by-name/ex/extract_url/package.nix | 13 +- pkgs/by-name/ez/eza/package.nix | 29 +- pkgs/by-name/f3/f3/package.nix | 6 +- pkgs/by-name/f3/f3d/package.nix | 97 +- pkgs/by-name/fa/faac/package.nix | 3 +- .../fa/facetimehd-calibration/package.nix | 35 +- pkgs/by-name/fa/facter/package.nix | 27 +- pkgs/by-name/fa/factorio/package.nix | 78 +- pkgs/by-name/fa/factorio/utils.nix | 21 +- pkgs/by-name/fa/faiss/package.nix | 55 +- pkgs/by-name/fa/famistudio/package.nix | 99 +- pkgs/by-name/fa/far2l/package.nix | 27 +- pkgs/by-name/fa/fastcdr/package.nix | 15 +- pkgs/by-name/fa/fastd/package.nix | 21 +- pkgs/by-name/fa/fastfetch/package.nix | 86 +- pkgs/by-name/fa/fastjet/package.nix | 3 +- pkgs/by-name/fa/fastnlo-toolkit/package.nix | 34 +- pkgs/by-name/fa/fastqc/package.nix | 13 +- pkgs/by-name/fa/fatrop/package.nix | 9 +- pkgs/by-name/fa/fawltydeps/package.nix | 15 +- pkgs/by-name/fb/fbthrift/package.nix | 33 +- pkgs/by-name/fc/fcft/package.nix | 32 +- pkgs/by-name/fd/fd/package.nix | 19 +- pkgs/by-name/fe/feather-tk/package.nix | 39 +- pkgs/by-name/fe/feather/package.nix | 41 +- pkgs/by-name/fe/febio-studio/package.nix | 46 +- pkgs/by-name/fe/fedistar/package.nix | 13 +- pkgs/by-name/fe/feedgnuplot/package.nix | 22 +- pkgs/by-name/fe/feishin/package.nix | 90 +- pkgs/by-name/fe/ferrishot/package.nix | 32 +- pkgs/by-name/fe/fex/package.nix | 21 +- pkgs/by-name/ff/fflas-ffpack/package.nix | 44 +- pkgs/by-name/ff/ffsend/package.nix | 3 +- pkgs/by-name/ff/fftw/package.nix | 32 +- pkgs/by-name/fh/fheroes2/package.nix | 3 +- pkgs/by-name/fi/fido2-manage/package.nix | 106 +- pkgs/by-name/fi/filen-cli/package.nix | 19 +- pkgs/by-name/fi/fim/package.nix | 27 +- pkgs/by-name/fi/finalfrontier/package.nix | 11 +- pkgs/by-name/fi/fio/package.nix | 3 +- pkgs/by-name/fi/fire/package.nix | 88 +- pkgs/by-name/fi/firebase-tools/package.nix | 13 +- pkgs/by-name/fi/firestarter/package.nix | 57 +- pkgs/by-name/fi/firewalld/package.nix | 123 ++- pkgs/by-name/fi/fish/package.nix | 204 ++-- pkgs/by-name/fl/flac/package.nix | 22 +- pkgs/by-name/fl/flameshot/package.nix | 46 +- pkgs/by-name/fl/flann/package.nix | 63 +- pkgs/by-name/fl/flashprog/package.nix | 27 +- pkgs/by-name/fl/flashrom/package.nix | 17 +- pkgs/by-name/fl/flatpak/package.nix | 190 ++-- pkgs/by-name/fl/flatter/package.nix | 21 +- .../fl/flet-client-flutter/package.nix | 25 +- pkgs/by-name/fl/flips/package.nix | 14 +- pkgs/by-name/fl/flite/package.nix | 3 +- pkgs/by-name/fl/flowtime/package.nix | 19 +- pkgs/by-name/fl/fluent-bit/package.nix | 58 +- pkgs/by-name/fl/fluffychat/package.nix | 29 +- pkgs/by-name/fl/fluidsynth/package.nix | 19 +- .../flutter_rust_bridge_codegen/package.nix | 21 +- .../fl/fluxcd-operator-mcp/package.nix | 19 +- pkgs/by-name/fm/fmit/package.nix | 42 +- pkgs/by-name/fo/folks/package.nix | 46 +- pkgs/by-name/fo/folly/package.nix | 19 +- pkgs/by-name/fo/font-manager/package.nix | 29 +- pkgs/by-name/fo/fontforge/package.nix | 60 +- .../by-name/fo/foomatic-db-engine/package.nix | 31 +- pkgs/by-name/fo/foot/package.nix | 23 +- pkgs/by-name/fo/footage/package.nix | 47 +- pkgs/by-name/fo/fortune-kind/package.nix | 15 +- pkgs/by-name/fo/fortune/package.nix | 22 +- pkgs/by-name/fo/foundry/package.nix | 3 +- pkgs/by-name/fo/foxotron/package.nix | 27 +- pkgs/by-name/fp/fprintd-tod/package.nix | 12 +- pkgs/by-name/fr/fractal/package.nix | 41 +- pkgs/by-name/fr/framac/package.nix | 17 +- pkgs/by-name/fr/frame/package.nix | 19 +- pkgs/by-name/fr/frankenphp/package.nix | 44 +- pkgs/by-name/fr/freecad/package.nix | 49 +- pkgs/by-name/fr/freecell-solver/package.nix | 49 +- pkgs/by-name/fr/freedroidrpg/package.nix | 3 +- pkgs/by-name/fr/freedv/package.nix | 146 ++- pkgs/by-name/fr/freeimage/package.nix | 53 +- pkgs/by-name/fr/freeradius/package.nix | 40 +- pkgs/by-name/fr/freerdp/package.nix | 191 ++-- pkgs/by-name/fr/freeswitch/package.nix | 3 +- pkgs/by-name/fr/freetalk/package.nix | 33 +- pkgs/by-name/fr/freetds/package.nix | 3 +- pkgs/by-name/fr/freetube/package.nix | 39 +- pkgs/by-name/fr/freetype/package.nix | 37 +- pkgs/by-name/fr/freexl/package.nix | 3 +- pkgs/by-name/fr/frei0r/package.nix | 17 +- pkgs/by-name/fr/fribidi/package.nix | 3 +- pkgs/by-name/fr/frigate/package.nix | 77 +- pkgs/by-name/fr/froide/package.nix | 21 +- pkgs/by-name/fr/frr/clippy-helper.nix | 13 +- pkgs/by-name/fr/frr/package.nix | 193 ++-- pkgs/by-name/fr/frugally-deep/package.nix | 15 +- pkgs/by-name/fs/fsverity-utils/package.nix | 6 +- pkgs/by-name/ft/ft2-clone/package.nix | 13 +- pkgs/by-name/fu/furmark/package.nix | 3 +- pkgs/by-name/fu/furnace/package.nix | 58 +- pkgs/by-name/fu/fuse-archive/package.nix | 19 +- pkgs/by-name/fu/fuzzel/package.nix | 23 +- pkgs/by-name/fv/fvwm2/package.nix | 3 +- pkgs/by-name/fw/fwknop/package.nix | 46 +- pkgs/by-name/fw/fwup/package.nix | 19 +- pkgs/by-name/fw/fwupd/package.nix | 178 ++-- pkgs/by-name/ga/galario/package.nix | 13 +- pkgs/by-name/ga/galene-stream/package.nix | 19 +- pkgs/by-name/ga/gamescope/package.nix | 118 ++- pkgs/by-name/ga/gammu/package.nix | 29 +- pkgs/by-name/ga/gap/package.nix | 8 +- pkgs/by-name/ga/gapless/package.nix | 21 +- pkgs/by-name/ga/gargoyle/package.nix | 33 +- pkgs/by-name/ga/gavin-bc/package.nix | 15 +- pkgs/by-name/gc/gcs/package.nix | 29 +- pkgs/by-name/gd/gd/package.nix | 38 +- pkgs/by-name/gd/gdal/package.nix | 182 ++-- pkgs/by-name/gd/gdbm/package.nix | 19 +- pkgs/by-name/ge/geant4/package.nix | 93 +- pkgs/by-name/ge/gedit/package.nix | 60 +- pkgs/by-name/ge/gel/package.nix | 19 +- pkgs/by-name/ge/gemmi/package.nix | 21 +- pkgs/by-name/ge/gemrb/package.nix | 3 +- pkgs/by-name/ge/geoclue2/package.nix | 89 +- pkgs/by-name/ge/geocode-glib_2/package.nix | 25 +- pkgs/by-name/ge/geoserver/package.nix | 16 +- pkgs/by-name/ge/gepetto-viewer/package.nix | 21 +- pkgs/by-name/ge/gerbera/package.nix | 6 +- pkgs/by-name/ge/getdns/package.nix | 3 +- pkgs/by-name/ge/getdp/package.nix | 3 +- pkgs/by-name/ge/getoptions/package.nix | 18 +- pkgs/by-name/ge/gex/package.nix | 3 +- pkgs/by-name/ge/gexiv2/package.nix | 29 +- pkgs/by-name/gf/gf/package.nix | 3 +- pkgs/by-name/gf/gfan/package.nix | 37 +- pkgs/by-name/gf/gforth/package.nix | 13 +- pkgs/by-name/gf/gfxstream/package.nix | 3 +- pkgs/by-name/gg/gg-jj/package.nix | 30 +- pkgs/by-name/gh/gh/package.nix | 29 +- pkgs/by-name/gh/ghdl/package.nix | 103 +- pkgs/by-name/gh/ghdl/test-simple.nix | 41 +- pkgs/by-name/gh/ghex/package.nix | 17 +- pkgs/by-name/gh/ghostscript/package.nix | 143 ++- pkgs/by-name/gh/ghostty/package.nix | 75 +- pkgs/by-name/gi/gImageReader/package.nix | 61 +- pkgs/by-name/gi/giac/package.nix | 234 +++-- pkgs/by-name/gi/giada/package.nix | 53 +- pkgs/by-name/gi/giflib/package.nix | 54 +- pkgs/by-name/gi/gildas/package.nix | 13 +- pkgs/by-name/gi/git-absorb/package.nix | 25 +- pkgs/by-name/gi/git-buildpackage/package.nix | 60 +- pkgs/by-name/gi/git-cola/package.nix | 25 +- pkgs/by-name/gi/git-lfs/package.nix | 19 +- pkgs/by-name/gi/git-machete/package.nix | 15 +- pkgs/by-name/gi/git-quickfix/package.nix | 13 +- .../gi/git-remote-codecommit/package.nix | 19 +- pkgs/by-name/gi/git-series/package.nix | 6 +- pkgs/by-name/gi/gitbutler/package.nix | 57 +- pkgs/by-name/gi/github-runner/package.nix | 288 +++--- pkgs/by-name/gi/gitlab-runner/package.nix | 63 +- pkgs/by-name/gi/gitlab-timelogs/package.nix | 11 +- pkgs/by-name/gi/gitnr/package.nix | 15 +- pkgs/by-name/gi/gitrs/package.nix | 13 +- pkgs/by-name/gi/gitui/package.nix | 13 +- pkgs/by-name/gi/givaro/package.nix | 31 +- pkgs/by-name/gj/gjs/package.nix | 60 +- pkgs/by-name/gl/gl2ps/package.nix | 19 +- pkgs/by-name/gl/glade/package.nix | 29 +- pkgs/by-name/gl/glava/package.nix | 3 +- pkgs/by-name/gl/glfw3/package.nix | 26 +- pkgs/by-name/gl/glib/package.nix | 172 ++-- pkgs/by-name/gl/globalping-cli/package.nix | 19 +- pkgs/by-name/gl/globalplatform/package.nix | 15 +- pkgs/by-name/gl/glom/package.nix | 10 +- pkgs/by-name/gl/glpk/package.nix | 13 +- pkgs/by-name/gm/gmic-qt/package.nix | 41 +- pkgs/by-name/gm/gmic/package.nix | 58 +- pkgs/by-name/gm/gmsh/package.nix | 49 +- pkgs/by-name/gm/gmt/package.nix | 70 +- pkgs/by-name/gn/gnome-bluetooth/package.nix | 3 +- .../gn/gnome-bluetooth_1_0/package.nix | 35 +- pkgs/by-name/gn/gnome-clocks/package.nix | 35 +- pkgs/by-name/gn/gnome-desktop/package.nix | 52 +- pkgs/by-name/gn/gnome-keysign/package.nix | 17 +- pkgs/by-name/gn/gnome-music/package.nix | 49 +- .../gn/gnome-online-accounts/package.nix | 54 +- pkgs/by-name/gn/gnome-panel/wrapper.nix | 6 +- .../gn/gnome-settings-daemon/package.nix | 66 +- pkgs/by-name/gn/gnome-software/package.nix | 6 +- .../gn/gnome-sound-recorder/package.nix | 27 +- pkgs/by-name/gn/gnome-user-share/package.nix | 29 +- pkgs/by-name/gn/gnss-sdr/package.nix | 69 +- pkgs/by-name/gn/gnu-smalltalk/package.nix | 3 +- pkgs/by-name/gn/gnucash/package.nix | 49 +- pkgs/by-name/gn/gnucobol/package.nix | 21 +- pkgs/by-name/gn/gnum4/package.nix | 18 +- pkgs/by-name/gn/gnumeric/package.nix | 23 +- pkgs/by-name/go/go-musicfox/package.nix | 13 +- pkgs/by-name/go/go-task/package.nix | 19 +- pkgs/by-name/go/goaccess/package.nix | 16 +- pkgs/by-name/go/goarista/package.nix | 3 +- pkgs/by-name/go/golden-cheetah/package.nix | 17 +- pkgs/by-name/go/gomanagedocker/package.nix | 3 +- pkgs/by-name/go/goodvibes/package.nix | 31 +- pkgs/by-name/go/google-amber/package.nix | 19 +- pkgs/by-name/go/google-chrome/package.nix | 129 ++- pkgs/by-name/go/google-cloud-cpp/package.nix | 27 +- pkgs/by-name/go/google-fonts/package.nix | 37 +- pkgs/by-name/go/goose-cli/package.nix | 55 +- pkgs/by-name/go/gopher64/package.nix | 17 +- pkgs/by-name/go/goss/package.nix | 3 +- pkgs/by-name/go/gossip/package.nix | 50 +- pkgs/by-name/go/got/package.nix | 30 +- pkgs/by-name/gp/gpac/package.nix | 13 +- pkgs/by-name/gp/gperftools/package.nix | 11 +- pkgs/by-name/gp/gpscorrelate/package.nix | 3 +- pkgs/by-name/gp/gpsd/package.nix | 60 +- pkgs/by-name/gp/gpt4all/package.nix | 83 +- pkgs/by-name/gp/gptfdisk/package.nix | 35 +- pkgs/by-name/gp/gpufetch/package.nix | 34 +- pkgs/by-name/gq/gqrx/package.nix | 48 +- pkgs/by-name/gr/grail/package.nix | 23 +- pkgs/by-name/gr/gramps/package.nix | 52 +- pkgs/by-name/gr/grandorgue/package.nix | 25 +- pkgs/by-name/gr/graphene/package.nix | 96 +- pkgs/by-name/gr/graphicsmagick/package.nix | 6 +- pkgs/by-name/gr/grass/package.nix | 149 ++- pkgs/by-name/gr/gretl/package.nix | 3 +- pkgs/by-name/gr/gridtracker2/package.nix | 131 ++- pkgs/by-name/gr/grilo/package.nix | 31 +- pkgs/by-name/gr/groff/package.nix | 95 +- pkgs/by-name/gr/groonga/package.nix | 37 +- pkgs/by-name/gr/grpc/package.nix | 96 +- pkgs/by-name/gs/gscan2pdf/package.nix | 102 +- pkgs/by-name/gs/gscreenshot/package.nix | 49 +- .../gs/gsettings-desktop-schemas/package.nix | 19 +- pkgs/by-name/gs/gsm/package.nix | 47 +- pkgs/by-name/gs/gspell/package.nix | 27 +- pkgs/by-name/gs/gst123/package.nix | 25 +- pkgs/by-name/gt/gtest/package.nix | 13 +- pkgs/by-name/gt/gthumb/package.nix | 3 +- pkgs/by-name/gt/gtk-doc/package.nix | 17 +- pkgs/by-name/gt/gtk-vnc/package.nix | 27 +- pkgs/by-name/gt/gtk4-layer-shell/package.nix | 3 +- pkgs/by-name/gt/gtkgnutella/package.nix | 38 +- pkgs/by-name/gt/gtkwave/package.nix | 18 +- pkgs/by-name/gt/gtypist/package.nix | 3 +- pkgs/by-name/gu/gucharmap/package.nix | 41 +- pkgs/by-name/gu/guestfs-tools/package.nix | 45 +- pkgs/by-name/gu/guilt/package.nix | 3 +- pkgs/by-name/gu/gum/package.nix | 21 +- pkgs/by-name/gu/gupnp-igd/package.nix | 3 +- pkgs/by-name/gu/gusb/package.nix | 24 +- pkgs/by-name/gv/gv/package.nix | 19 +- pkgs/by-name/gv/gvfs/package.nix | 128 ++- pkgs/by-name/gw/gwyddion/package.nix | 37 +- pkgs/by-name/gx/gxkb/package.nix | 3 +- pkgs/by-name/gz/gzdoom/package.nix | 6 +- pkgs/by-name/h2/h2o/package.nix | 23 +- pkgs/by-name/h5/h5utils/package.nix | 17 +- pkgs/by-name/ha/halloy/package.nix | 52 +- pkgs/by-name/ha/handbrake/package.nix | 242 +++-- pkgs/by-name/ha/haproxy/package.nix | 82 +- pkgs/by-name/ha/hare/package.nix | 3 +- pkgs/by-name/ha/harfbuzz/package.nix | 20 +- pkgs/by-name/ha/harlequin/package.nix | 19 +- pkgs/by-name/ha/harvid/package.nix | 13 +- pkgs/by-name/ha/hash-slinger/package.nix | 3 +- pkgs/by-name/ha/hashcat/package.nix | 55 +- pkgs/by-name/ha/hatch/package.nix | 173 ++-- pkgs/by-name/hd/hdf4/package.nix | 73 +- pkgs/by-name/hd/hdfview/package.nix | 39 +- pkgs/by-name/he/headlines/package.nix | 39 +- pkgs/by-name/he/hebbot/package.nix | 17 +- pkgs/by-name/he/hedgewars/package.nix | 3 +- pkgs/by-name/he/heimdall/package.nix | 6 +- pkgs/by-name/he/herbe/package.nix | 3 +- pkgs/by-name/he/hercules/package.nix | 40 +- pkgs/by-name/he/herwig/package.nix | 25 +- pkgs/by-name/he/hexbinhex/package.nix | 15 +- pkgs/by-name/hi/hiawatha/package.nix | 19 +- pkgs/by-name/hi/hiawatha/test.nix | 3 +- pkgs/by-name/hi/higan/package.nix | 161 ++- pkgs/by-name/hi/high-tide/package.nix | 23 +- pkgs/by-name/hi/highfive/package.nix | 3 +- pkgs/by-name/hi/himalaya/package.nix | 3 +- pkgs/by-name/hm/hmat-oss/package.nix | 13 +- .../ho/homebridge-config-ui-x/package.nix | 3 +- .../by-name/ho/homepage-dashboard/package.nix | 3 +- pkgs/by-name/ho/hostapd/package.nix | 107 +- pkgs/by-name/ho/hotspot/package.nix | 49 +- pkgs/by-name/hp/hp2p/package.nix | 13 +- pkgs/by-name/hp/hping/package.nix | 35 +- pkgs/by-name/hp/hpipm/package.nix | 3 +- pkgs/by-name/hp/hplip/package.nix | 117 ++- pkgs/by-name/hq/hqplayerd/rygel.nix | 47 +- pkgs/by-name/hs/hsd/package.nix | 13 +- pkgs/by-name/ht/htb-toolkit/package.nix | 13 +- pkgs/by-name/ht/html-tidy/package.nix | 3 +- pkgs/by-name/ht/html5validator/package.nix | 13 +- pkgs/by-name/ht/htop-vim/package.nix | 38 +- pkgs/by-name/ht/htop/package.nix | 38 +- pkgs/by-name/ht/http-parser/package.nix | 62 +- pkgs/by-name/ht/httptoolkit/package.nix | 3 +- pkgs/by-name/hw/hwloc/package.nix | 21 +- pkgs/by-name/hy/hydrogen/package.nix | 33 +- pkgs/by-name/hy/hydrus/package.nix | 61 +- pkgs/by-name/hy/hyperscan/package.nix | 13 +- pkgs/by-name/hy/hyprpanel/package.nix | 3 +- pkgs/by-name/hy/hypseus-singe/package.nix | 27 +- pkgs/by-name/i2/i2p/package.nix | 17 +- pkgs/by-name/i2/i2pd/package.nix | 3 +- pkgs/by-name/ig/igraph/package.nix | 40 +- pkgs/by-name/ii/iio-oscilloscope/package.nix | 3 +- pkgs/by-name/im/imagelol/package.nix | 11 +- pkgs/by-name/im/imhex/package.nix | 3 +- pkgs/by-name/im/imlib2/package.nix | 37 +- pkgs/by-name/im/imnodes/package.nix | 13 +- pkgs/by-name/im/implot/demos/default.nix | 3 +- pkgs/by-name/im/imtui/package.nix | 17 +- pkgs/by-name/im/imv/package.nix | 22 +- pkgs/by-name/in/inchi/package.nix | 21 +- pkgs/by-name/in/inetutils/package.nix | 21 +- pkgs/by-name/in/influxdb-cxx/package.nix | 17 +- pkgs/by-name/in/inlyne/package.nix | 13 +- pkgs/by-name/in/innernet/package.nix | 34 +- pkgs/by-name/in/innoextract/package.nix | 3 +- pkgs/by-name/in/inspectrum/package.nix | 19 +- pkgs/by-name/in/inspircd/package.nix | 65 +- pkgs/by-name/in/insync/package.nix | 3 +- .../by-name/in/intel-media-driver/package.nix | 3 +- .../by-name/in/intel-vaapi-driver/package.nix | 28 +- pkgs/by-name/in/intltool/package.nix | 13 +- pkgs/by-name/in/inxi/package.nix | 13 +- pkgs/by-name/io/ioquake3/package.nix | 19 +- pkgs/by-name/io/iosevka/package.nix | 28 +- pkgs/by-name/ip/ip2unix/package.nix | 3 +- pkgs/by-name/ip/ipopt/package.nix | 21 +- pkgs/by-name/ip/iproute2/package.nix | 50 +- pkgs/by-name/ip/iprover/package.nix | 34 +- pkgs/by-name/ip/ipv6calc/package.nix | 37 +- pkgs/by-name/ip/ipxe/package.nix | 67 +- pkgs/by-name/iq/iqtree/package.nix | 17 +- pkgs/by-name/ir/iredis/package.nix | 27 +- pkgs/by-name/ir/ironbar/package.nix | 60 +- pkgs/by-name/ir/irqbalance/package.nix | 17 +- pkgs/by-name/ir/irrd/package.nix | 29 +- pkgs/by-name/is/isabelle/package.nix | 160 ++- pkgs/by-name/is/isync/package.nix | 3 +- pkgs/by-name/iw/iwd/package.nix | 22 +- pkgs/by-name/ja/jadx/package.nix | 3 +- pkgs/by-name/ja/jalv/package.nix | 40 +- pkgs/by-name/ja/jam/package.nix | 39 +- pkgs/by-name/ja/jameica/package.nix | 43 +- pkgs/by-name/ja/jamin/package.nix | 25 +- pkgs/by-name/ja/jasmin-compiler/package.nix | 17 +- pkgs/by-name/ja/jasp-desktop/package.nix | 3 +- pkgs/by-name/ja/jasper/package.nix | 25 +- pkgs/by-name/jb/jbigkit/package.nix | 106 +- pkgs/by-name/jd/jdupes/package.nix | 15 +- pkgs/by-name/je/jellyfin-web/package.nix | 11 +- pkgs/by-name/jg/jgmenu/package.nix | 40 +- pkgs/by-name/ji/jimtcl/package.nix | 22 +- .../ji/jitsi-meet-electron/package.nix | 13 +- pkgs/by-name/jo/jogl/package.nix | 64 +- pkgs/by-name/jo/john/package.nix | 53 +- pkgs/by-name/jo/jotta-cli/package.nix | 23 +- pkgs/by-name/jq/jq/package.nix | 38 +- pkgs/by-name/jr/jrsonnet/package.nix | 23 +- pkgs/by-name/js/json-glib/package.nix | 42 +- pkgs/by-name/js/jsoncpp/package.nix | 27 +- pkgs/by-name/js/jsonnet/package.nix | 15 +- pkgs/by-name/ju/juce/package.nix | 47 +- pkgs/by-name/ju/julius/package.nix | 17 +- pkgs/by-name/ju/jumpy/package.nix | 35 +- pkgs/by-name/ju/just/package.nix | 18 +- pkgs/by-name/ju/justbuild/package.nix | 27 +- .../by-name/ka/kafka-delta-ingest/package.nix | 11 +- pkgs/by-name/ka/kahip/package.nix | 13 +- pkgs/by-name/ka/kana/package.nix | 19 +- pkgs/by-name/ka/kando/package.nix | 19 +- pkgs/by-name/ka/kanidm/generic.nix | 96 +- pkgs/by-name/ka/kapacitor/package.nix | 19 +- pkgs/by-name/ka/katago/package.nix | 114 ++- pkgs/by-name/ka/katawa-shoujo/package.nix | 35 +- pkgs/by-name/kb/kbd/package.nix | 19 +- pkgs/by-name/kb/kbs2/package.nix | 24 +- pkgs/by-name/kc/kcollectd/package.nix | 46 +- pkgs/by-name/ke/kea/package.nix | 34 +- pkgs/by-name/ke/keepalived/package.nix | 34 +- pkgs/by-name/ke/keepassxc/package.nix | 71 +- pkgs/by-name/ke/kew/package.nix | 13 +- pkgs/by-name/ke/kexec-tools/package.nix | 3 +- pkgs/by-name/ke/keycloak/package.nix | 47 +- pkgs/by-name/ke/keydb/package.nix | 49 +- .../package.nix | 31 +- pkgs/by-name/ke/keystone/package.nix | 19 +- pkgs/by-name/ki/ki/package.nix | 25 +- pkgs/by-name/ki/kid3/package.nix | 51 +- pkgs/by-name/ki/kismet/package.nix | 103 +- pkgs/by-name/ki/kitsas/package.nix | 21 +- pkgs/by-name/ki/kitty/package.nix | 131 ++- pkgs/by-name/kl/klipper-estimator/package.nix | 11 +- pkgs/by-name/km/kmscube/package.nix | 21 +- pkgs/by-name/km/kmsxx/package.nix | 24 +- pkgs/by-name/kn/knot-dns/package.nix | 88 +- pkgs/by-name/kn/knxd/package.nix | 15 +- pkgs/by-name/ko/koboldcpp/package.nix | 37 +- pkgs/by-name/ko/kohighlights/package.nix | 13 +- pkgs/by-name/ko/koji/package.nix | 3 +- pkgs/by-name/ko/komac/package.nix | 13 +- pkgs/by-name/ko/koodo-reader/package.nix | 21 +- pkgs/by-name/kr/kraft/package.nix | 13 +- pkgs/by-name/kr/krunker/package.nix | 6 +- pkgs/by-name/ks/ksmbd-tools/package.nix | 3 +- pkgs/by-name/ks/ksnip/package.nix | 17 +- pkgs/by-name/ks/kstart/package.nix | 3 +- pkgs/by-name/kv/kvmtool/package.nix | 17 +- pkgs/by-name/ky/kyua/package.nix | 85 +- pkgs/by-name/la/ladybird/package.nix | 105 +- pkgs/by-name/la/lagrange/package.nix | 31 +- pkgs/by-name/la/lammps/package.nix | 30 +- pkgs/by-name/la/lapack-reference/package.nix | 29 +- pkgs/by-name/la/laszip/package.nix | 13 +- pkgs/by-name/la/laze/package.nix | 21 +- pkgs/by-name/lb/lbdb/package.nix | 17 +- pkgs/by-name/lc/lc0/package.nix | 17 +- pkgs/by-name/lc/lcevcdec/package.nix | 29 +- pkgs/by-name/lc/lcov/package.nix | 3 +- pkgs/by-name/ld/ldb/package.nix | 19 +- pkgs/by-name/ld/ldc/package.nix | 62 +- pkgs/by-name/ld/ldmud/package.nix | 29 +- pkgs/by-name/ld/ldns/package.nix | 23 +- pkgs/by-name/le/ledger/package.nix | 46 +- pkgs/by-name/le/ledger2beancount/package.nix | 3 +- .../le/legends-of-equestria/package.nix | 97 +- pkgs/by-name/le/lenmus/package.nix | 15 +- pkgs/by-name/le/lerc/package.nix | 31 +- pkgs/by-name/lg/lgogdownloader/package.nix | 30 +- pkgs/by-name/lh/lhapdf/package.nix | 15 +- pkgs/by-name/li/lib2geom/package.nix | 15 +- pkgs/by-name/li/lib3mf/package.nix | 3 +- pkgs/by-name/li/libaccounts-glib/package.nix | 31 +- pkgs/by-name/li/libadwaita/package.nix | 26 +- pkgs/by-name/li/libaio/package.nix | 3 +- pkgs/by-name/li/libamplsolver/package.nix | 29 +- pkgs/by-name/li/libaom/package.nix | 69 +- pkgs/by-name/li/libapparmor/package.nix | 38 +- pkgs/by-name/li/libappindicator/package.nix | 35 +- pkgs/by-name/li/libarchive/package.nix | 62 +- pkgs/by-name/li/libargon2/package.nix | 23 +- pkgs/by-name/li/libass/package.nix | 19 +- pkgs/by-name/li/libavif/package.nix | 23 +- pkgs/by-name/li/libb64/package.nix | 65 +- pkgs/by-name/li/libbladeRF/package.nix | 30 +- pkgs/by-name/li/libbluray/package.nix | 26 +- pkgs/by-name/li/libcaca/package.nix | 36 +- pkgs/by-name/li/libcamera/package.nix | 52 +- pkgs/by-name/li/libcanberra/package.nix | 75 +- pkgs/by-name/li/libcap/package.nix | 94 +- pkgs/by-name/li/libcdio-paranoia/package.nix | 11 +- pkgs/by-name/li/libcdio/package.nix | 71 +- pkgs/by-name/li/libcgroup/package.nix | 34 +- pkgs/by-name/li/libchamplain/package.nix | 28 +- pkgs/by-name/li/libcloudproviders/package.nix | 25 +- pkgs/by-name/li/libdaemon/package.nix | 13 +- pkgs/by-name/li/libdazzle/package.nix | 39 +- pkgs/by-name/li/libdbiDrivers/package.nix | 50 +- pkgs/by-name/li/libdbusmenu/package.nix | 20 +- pkgs/by-name/li/libdeflate/package.nix | 3 +- pkgs/by-name/li/libdeltachat/package.nix | 38 +- pkgs/by-name/li/libdicom/package.nix | 3 +- pkgs/by-name/li/libdmapsharing/package.nix | 61 +- pkgs/by-name/li/libdrm/package.nix | 36 +- pkgs/by-name/li/libepoxy/package.nix | 25 +- pkgs/by-name/li/libevent/package.nix | 9 +- pkgs/by-name/li/libewf-legacy/package.nix | 3 +- pkgs/by-name/li/libewf/package.nix | 3 +- pkgs/by-name/li/libexecinfo/package.nix | 21 +- pkgs/by-name/li/libexsid/package.nix | 3 +- pkgs/by-name/li/libfaketime/package.nix | 35 +- pkgs/by-name/li/libff/package.nix | 13 +- pkgs/by-name/li/libfido2/package.nix | 42 +- pkgs/by-name/li/libfilezilla/package.nix | 19 +- pkgs/by-name/li/libfixposix/package.nix | 3 +- pkgs/by-name/li/libfm/package.nix | 12 +- pkgs/by-name/li/libftdi/package.nix | 3 +- pkgs/by-name/li/libftdi1/package.nix | 57 +- pkgs/by-name/li/libgcrypt/package.nix | 105 +- pkgs/by-name/li/libgedit-amtk/package.nix | 23 +- pkgs/by-name/li/libgedit-gfls/package.nix | 23 +- pkgs/by-name/li/libgedit-tepl/package.nix | 23 +- pkgs/by-name/li/libgee/package.nix | 17 +- pkgs/by-name/li/libgit2/package.nix | 36 +- pkgs/by-name/li/libglycin/package.nix | 28 +- pkgs/by-name/li/libgnt/package.nix | 30 +- pkgs/by-name/li/libgpiod_1/package.nix | 16 +- pkgs/by-name/li/libgpod/package.nix | 31 +- pkgs/by-name/li/libgudev/package.nix | 21 +- pkgs/by-name/li/libguestfs/package.nix | 55 +- pkgs/by-name/li/libgweather/package.nix | 45 +- pkgs/by-name/li/libgxps/package.nix | 13 +- pkgs/by-name/li/libhugetlbfs/package.nix | 29 +- pkgs/by-name/li/libical/package.nix | 54 +- pkgs/by-name/li/libieee1284/package.nix | 19 +- pkgs/by-name/li/libiio/package.nix | 81 +- pkgs/by-name/li/libinfinity/package.nix | 23 +- pkgs/by-name/li/libisoburn/package.nix | 27 +- pkgs/by-name/li/libjpeg_turbo/package.nix | 52 +- pkgs/by-name/li/libjxl/package.nix | 59 +- pkgs/by-name/li/libkrun/package.nix | 45 +- pkgs/by-name/li/libkrunfw/package.nix | 13 +- pkgs/by-name/li/libks/package.nix | 9 +- pkgs/by-name/li/liblangtag/package.nix | 13 +- pkgs/by-name/li/libloot/package.nix | 24 +- pkgs/by-name/li/liblouis/package.nix | 17 +- pkgs/by-name/li/libmad/package.nix | 67 +- pkgs/by-name/li/libmanette/package.nix | 49 +- pkgs/by-name/li/libmbim/package.nix | 28 +- pkgs/by-name/li/libmediaart/package.nix | 27 +- pkgs/by-name/li/libmediainfo/package.nix | 13 +- pkgs/by-name/li/libmpdclient/package.nix | 15 +- pkgs/by-name/li/libmsquic/package.nix | 13 +- pkgs/by-name/li/libnbd/package.nix | 25 +- pkgs/by-name/li/libnfc-nci/package.nix | 13 +- pkgs/by-name/li/libngspice/package.nix | 23 +- pkgs/by-name/li/libnice/package.nix | 3 +- pkgs/by-name/li/libnick/package.nix | 36 +- pkgs/by-name/li/libnl/package.nix | 6 +- pkgs/by-name/li/libnma/package.nix | 58 +- pkgs/by-name/li/libnotify/package.nix | 23 +- pkgs/by-name/li/libofx/package.nix | 3 +- pkgs/by-name/li/libopenglrecorder/package.nix | 19 +- pkgs/by-name/li/libopenmpt/package.nix | 25 +- pkgs/by-name/li/liboping/package.nix | 3 +- pkgs/by-name/li/liborcus/package.nix | 27 +- pkgs/by-name/li/libosinfo/package.nix | 3 +- pkgs/by-name/li/libossp_uuid/package.nix | 3 +- pkgs/by-name/li/libpcap/package.nix | 37 +- pkgs/by-name/li/libpciaccess/package.nix | 13 +- pkgs/by-name/li/libpkgconf/package.nix | 35 +- pkgs/by-name/li/libplacebo/package.nix | 54 +- pkgs/by-name/li/libplacebo_5/package.nix | 19 +- pkgs/by-name/li/libplist/package.nix | 16 +- pkgs/by-name/li/libportal/package.nix | 57 +- pkgs/by-name/li/libpostal/package.nix | 3 +- pkgs/by-name/li/libproxy/package.nix | 97 +- pkgs/by-name/li/libpwquality/package.nix | 6 +- pkgs/by-name/li/libqmi/package.nix | 68 +- pkgs/by-name/li/libqrtr-glib/package.nix | 25 +- pkgs/by-name/li/librandombytes/package.nix | 3 +- pkgs/by-name/li/librashader/package.nix | 47 +- pkgs/by-name/li/libre/package.nix | 15 +- pkgs/by-name/li/libredirect/package.nix | 57 +- pkgs/by-name/li/libredwg/package.nix | 14 +- pkgs/by-name/li/librem/package.nix | 15 +- pkgs/by-name/li/libremines/package.nix | 13 +- pkgs/by-name/li/libresample/package.nix | 17 +- pkgs/by-name/li/libresprite/package.nix | 41 +- pkgs/by-name/li/libreswan/package.nix | 3 +- pkgs/by-name/li/librime/package.nix | 3 +- pkgs/by-name/li/librsvg/package.nix | 75 +- pkgs/by-name/li/librum/package.nix | 32 +- pkgs/by-name/li/libsbml/package.nix | 9 +- pkgs/by-name/li/libsecret/package.nix | 92 +- pkgs/by-name/li/libselinux/package.nix | 85 +- pkgs/by-name/li/libsemanage/package.nix | 25 +- pkgs/by-name/li/libsidplayfp/package.nix | 21 +- pkgs/by-name/li/libsignal-ffi/package.nix | 3 +- pkgs/by-name/li/libsigrok/package.nix | 29 +- pkgs/by-name/li/libsnark/package.nix | 3 +- pkgs/by-name/li/libsndfile/package.nix | 3 +- pkgs/by-name/li/libsolv/package.nix | 36 +- pkgs/by-name/li/libsoundio/package.nix | 13 +- pkgs/by-name/li/libspatialite/package.nix | 27 +- pkgs/by-name/li/libspnav/package.nix | 17 +- pkgs/by-name/li/libstemmer/package.nix | 15 +- pkgs/by-name/li/libtapi/package.nix | 57 +- pkgs/by-name/li/libtheora/package.nix | 19 +- pkgs/by-name/li/libticalcs2/package.nix | 23 +- pkgs/by-name/li/libticonv/package.nix | 3 +- pkgs/by-name/li/libtiff/package.nix | 13 +- pkgs/by-name/li/libtoxcore/package.nix | 22 +- pkgs/by-name/li/libui/package.nix | 41 +- pkgs/by-name/li/libusb1/package.nix | 6 +- pkgs/by-name/li/libusbsio/package.nix | 26 +- pkgs/by-name/li/libuv/package.nix | 195 ++-- pkgs/by-name/li/libvgm/package.nix | 94 +- pkgs/by-name/li/libvirt-glib/package.nix | 49 +- pkgs/by-name/li/libvirt/package.nix | 275 +++--- pkgs/by-name/li/libvmi/package.nix | 17 +- pkgs/by-name/li/libvncserver/package.nix | 19 +- pkgs/by-name/li/libvpx/package.nix | 135 ++- pkgs/by-name/li/libwebsockets/package.nix | 37 +- pkgs/by-name/li/libx86/package.nix | 3 +- pkgs/by-name/li/libxisf/package.nix | 3 +- pkgs/by-name/li/libxkbcommon_8/package.nix | 22 +- pkgs/by-name/li/libxklavier/package.nix | 22 +- pkgs/by-name/li/libxmlb/package.nix | 46 +- pkgs/by-name/li/libyafaray/package.nix | 3 +- pkgs/by-name/li/libzakalwe/package.nix | 17 +- pkgs/by-name/li/libzbc/package.nix | 3 +- pkgs/by-name/li/libzbd/package.nix | 3 +- pkgs/by-name/li/liferea/package.nix | 43 +- pkgs/by-name/li/lightgbm/package.nix | 116 +-- pkgs/by-name/li/lighthouse/package.nix | 466 +++++---- pkgs/by-name/li/lighttpd/package.nix | 60 +- pkgs/by-name/li/lilv/package.nix | 35 +- pkgs/by-name/li/lima/package.nix | 36 +- pkgs/by-name/li/limine/package.nix | 19 +- pkgs/by-name/li/limo/package.nix | 50 +- pkgs/by-name/li/linbox/package.nix | 31 +- pkgs/by-name/li/linenoise/package.nix | 3 +- pkgs/by-name/li/lingot/package.nix | 3 +- pkgs/by-name/li/links2/package.nix | 52 +- pkgs/by-name/li/linux-pam/package.nix | 6 +- pkgs/by-name/li/linuxdoc-tools/package.nix | 3 +- pkgs/by-name/li/listenbrainz-mpd/package.nix | 38 +- pkgs/by-name/li/littlegptracker/package.nix | 9 +- pkgs/by-name/li/live555/package.nix | 41 +- pkgs/by-name/li/livekit-libwebrtc/package.nix | 316 +++--- pkgs/by-name/lk/lkl/package.nix | 29 +- pkgs/by-name/ll/llama-cpp/package.nix | 99 +- pkgs/by-name/ll/lldpd/package.nix | 25 +- pkgs/by-name/ll/llpp/package.nix | 62 +- pkgs/by-name/lm/lm_sensors/package.nix | 6 +- pkgs/by-name/lm/lmdb/package.nix | 54 +- pkgs/by-name/ln/lnav/package.nix | 50 +- pkgs/by-name/lo/local-ai/package.nix | 128 ++- pkgs/by-name/lo/localsearch/package.nix | 125 ++- pkgs/by-name/lo/logisim-evolution/package.nix | 17 +- pkgs/by-name/lo/logisim/package.nix | 17 +- pkgs/by-name/lo/logseq/package.nix | 51 +- pkgs/by-name/lo/longview/package.nix | 37 +- .../lo/looking-glass-client/package.nix | 88 +- pkgs/by-name/lo/lowdown/package.nix | 22 +- pkgs/by-name/lo/lowfi/package.nix | 13 +- pkgs/by-name/lr/lrcget/package.nix | 27 +- pkgs/by-name/lr/lrzip/package.nix | 3 +- pkgs/by-name/ls/lsd2dsl/package.nix | 3 +- pkgs/by-name/ls/lshw/package.nix | 13 +- pkgs/by-name/ls/lsof/package.nix | 25 +- .../lu/lua-language-server/package.nix | 98 +- pkgs/by-name/lu/luakit/package.nix | 31 +- pkgs/by-name/lu/luanti/package.nix | 73 +- pkgs/by-name/lu/ludusavi/package.nix | 35 +- pkgs/by-name/lu/lunarvim/package.nix | 49 +- pkgs/by-name/lv/lv2/package.nix | 33 +- pkgs/by-name/ly/ly/package.nix | 3 +- pkgs/by-name/ly/lynx/package.nix | 6 +- .../fastdeploy-ppocr.nix | 45 +- .../ma/maa-assistant-arknights/package.nix | 36 +- pkgs/by-name/ma/maa-cli/package.nix | 45 +- pkgs/by-name/ma/macskk/package.nix | 3 +- pkgs/by-name/ma/magic-vlsi/package.nix | 15 +- pkgs/by-name/ma/maigret/package.nix | 29 +- pkgs/by-name/ma/mailutils/package.nix | 56 +- pkgs/by-name/ma/man-db/package.nix | 41 +- pkgs/by-name/ma/manifest-tool/package.nix | 21 +- pkgs/by-name/ma/mapcache/package.nix | 17 +- pkgs/by-name/ma/mapserver/package.nix | 22 +- pkgs/by-name/ma/marktext/package.nix | 29 +- pkgs/by-name/ma/mars-mips/package.nix | 19 +- pkgs/by-name/ma/master_me/package.nix | 19 +- pkgs/by-name/ma/materialize/package.nix | 17 +- .../matrix-authentication-service/package.nix | 3 +- .../ma/matrix-continuwuity/package.nix | 65 +- .../ma/matrix-synapse-unwrapped/package.nix | 30 +- .../plugins/rendezvous.nix | 15 +- .../plugins/s3-storage-provider.nix | 19 +- pkgs/by-name/ma/matrix-synapse/package.nix | 11 +- pkgs/by-name/ma/matrix-tuwunel/package.nix | 65 +- pkgs/by-name/ma/mattermost/package.nix | 17 +- pkgs/by-name/ma/mattermost/tests.nix | 211 ++-- pkgs/by-name/ma/maude/package.nix | 13 +- pkgs/by-name/ma/mautrix-signal/package.nix | 17 +- pkgs/by-name/ma/maven/build-maven-package.nix | 80 +- pkgs/by-name/mb/mblaze/package.nix | 57 +- pkgs/by-name/mc/mc/package.nix | 50 +- .../mc/mcpelauncher-client/package.nix | 60 +- pkgs/by-name/md/mdadm4/package.nix | 25 +- pkgs/by-name/me/mediaelch/package.nix | 31 +- pkgs/by-name/me/mednafen/package.nix | 41 +- pkgs/by-name/me/megacmd/package.nix | 3 +- pkgs/by-name/me/megatools/package.nix | 3 +- pkgs/by-name/me/meld/package.nix | 3 +- pkgs/by-name/me/melonDS/package.nix | 29 +- pkgs/by-name/me/memray/package.nix | 3 +- pkgs/by-name/me/mercurial/package.nix | 23 +- pkgs/by-name/me/merkaartor/package.nix | 25 +- pkgs/by-name/me/meshoptimizer/package.nix | 3 +- pkgs/by-name/me/meson/package.nix | 36 +- pkgs/by-name/me/mesonlsp/package.nix | 23 +- pkgs/by-name/mf/mfcl5750dw/package.nix | 81 +- pkgs/by-name/mg/mgba/package.nix | 3 +- pkgs/by-name/mi/microsoft-edge/package.nix | 131 ++- pkgs/by-name/mi/midivisualizer/package.nix | 23 +- pkgs/by-name/mi/miktex/package.nix | 72 +- pkgs/by-name/mi/milkytracker/package.nix | 23 +- pkgs/by-name/mi/mim-solvers/package.nix | 24 +- pkgs/by-name/mi/mimalloc/package.nix | 11 +- pkgs/by-name/mi/mimetic/package.nix | 3 +- pkgs/by-name/mi/mimic/package.nix | 3 +- pkgs/by-name/mi/mimir/package.nix | 29 +- pkgs/by-name/mi/mindustry/package.nix | 107 +- pkgs/by-name/mi/minicom/package.nix | 11 +- pkgs/by-name/mi/minikube/package.nix | 33 +- pkgs/by-name/mi/minimacy/package.nix | 19 +- pkgs/by-name/mi/minizip-ng/package.nix | 23 +- pkgs/by-name/mi/miracle-wm/package.nix | 21 +- pkgs/by-name/mi/miraclecast/package.nix | 15 +- pkgs/by-name/mi/mirakurun/package.nix | 3 +- pkgs/by-name/mi/mise/package.nix | 19 +- pkgs/by-name/mi/misskey/package.nix | 3 +- pkgs/by-name/mi/mistral-rs/package.nix | 95 +- pkgs/by-name/mi/mitm-cache/fetch.nix | 59 +- pkgs/by-name/mj/mjpegtools/package.nix | 23 +- pkgs/by-name/mk/mkcal/package.nix | 23 +- pkgs/by-name/mk/mkl/package.nix | 124 +-- pkgs/by-name/mk/mkp224o/package.nix | 53 +- pkgs/by-name/mk/mktorrent/package.nix | 15 +- pkgs/by-name/mk/mkvtoolnix/package.nix | 48 +- pkgs/by-name/ml/mlflow-server/package.nix | 14 +- pkgs/by-name/ml/mlt/package.nix | 127 ++- pkgs/by-name/ml/mlterm/package.nix | 148 ++- pkgs/by-name/ml/mlx42/package.nix | 15 +- pkgs/by-name/mm/mmex/package.nix | 27 +- pkgs/by-name/mm/mmseqs2/package.nix | 44 +- pkgs/by-name/mo/moc/package.nix | 70 +- pkgs/by-name/mo/modemmanager/package.nix | 62 +- .../mo/modrinth-app-unwrapped/package.nix | 3 +- pkgs/by-name/mo/mods/package.nix | 27 +- .../mo/modsecurity_standalone/package.nix | 3 +- pkgs/by-name/mo/mold/package.nix | 17 +- pkgs/by-name/mo/monado/package.nix | 93 +- pkgs/by-name/mo/monero-cli/package.nix | 66 +- pkgs/by-name/mo/monero-gui/package.nix | 72 +- pkgs/by-name/mo/moneydance/package.nix | 19 +- pkgs/by-name/mo/mongodb-ce/package.nix | 31 +- pkgs/by-name/mo/mongoose/package.nix | 13 +- pkgs/by-name/mo/monit/package.nix | 52 +- pkgs/by-name/mo/monkeysphere/package.nix | 39 +- pkgs/by-name/mo/monophony/package.nix | 21 +- pkgs/by-name/mo/moonlight-qt/package.nix | 41 +- pkgs/by-name/mo/mosh/package.nix | 3 +- pkgs/by-name/mo/moshi/package.nix | 62 +- pkgs/by-name/mo/mosquitto/package.nix | 3 +- pkgs/by-name/mo/motif/package.nix | 51 +- pkgs/by-name/mo/movit/package.nix | 13 +- pkgs/by-name/mo/mozc/package.nix | 13 +- pkgs/by-name/mo/mozphab/package.nix | 25 +- pkgs/by-name/mp/mp3blaster/package.nix | 3 +- pkgs/by-name/mp/mpb/package.nix | 3 +- pkgs/by-name/mp/mpc/package.nix | 3 +- pkgs/by-name/mp/mpdscribble/package.nix | 3 +- pkgs/by-name/mp/mpop/package.nix | 3 +- pkgs/by-name/mp/mpris-scrobbler/package.nix | 19 +- pkgs/by-name/mq/mqtt-explorer/package.nix | 3 +- pkgs/by-name/mr/mrtrix/package.nix | 38 +- .../msbuild-structured-log-viewer/package.nix | 29 +- pkgs/by-name/ms/msgpack-cxx/package.nix | 3 +- pkgs/by-name/ms/msmtp/package.nix | 57 +- pkgs/by-name/ms/msolve/package.nix | 17 +- pkgs/by-name/ms/mstflint/package.nix | 58 +- pkgs/by-name/mt/mtdutils/package.nix | 3 +- pkgs/by-name/mu/mum/package.nix | 3 +- pkgs/by-name/mu/mumps/package.nix | 32 +- pkgs/by-name/mu/muon/package.nix | 30 +- pkgs/by-name/mu/mupdf/package.nix | 210 ++-- .../mu/muse-sounds-manager/package.nix | 3 +- pkgs/by-name/mu/musikcube/package.nix | 45 +- pkgs/by-name/mu/musl/package.nix | 70 +- pkgs/by-name/mu/mutt/package.nix | 77 +- pkgs/by-name/mu/muvm/package.nix | 26 +- pkgs/by-name/mv/mvapich/package.nix | 74 +- pkgs/by-name/mv/mvfst/package.nix | 23 +- pkgs/by-name/mv/mvnd/package.nix | 41 +- pkgs/by-name/mx/mxnet/package.nix | 23 +- pkgs/by-name/my/mya/package.nix | 17 +- pkgs/by-name/my/mydumper/package.nix | 31 +- pkgs/by-name/my/mygui/package.nix | 33 +- pkgs/by-name/my/mysql84/package.nix | 52 +- pkgs/by-name/n8/n8n/package.nix | 21 +- pkgs/by-name/na/naja/package.nix | 21 +- pkgs/by-name/na/namecoind/package.nix | 59 +- pkgs/by-name/na/nano/package.nix | 17 +- pkgs/by-name/na/nanoboyadvance/package.nix | 23 +- pkgs/by-name/na/narsil/package.nix | 17 +- pkgs/by-name/na/nasc/package.nix | 23 +- pkgs/by-name/nb/nbd/package.nix | 17 +- pkgs/by-name/nb/nbench/package.nix | 15 +- pkgs/by-name/nb/nbstripout/package.nix | 17 +- pkgs/by-name/nc/ncmpcpp/package.nix | 40 +- pkgs/by-name/nc/ncnn/package.nix | 25 +- pkgs/by-name/nc/ncspot/package.nix | 21 +- pkgs/by-name/nd/ndcurves/package.nix | 55 +- pkgs/by-name/ne/neko/package.nix | 3 +- pkgs/by-name/ne/neomutt/package.nix | 91 +- pkgs/by-name/ne/neon/package.nix | 3 +- pkgs/by-name/ne/neovide/package.nix | 19 +- .../ne/neovim-qt-unwrapped/package.nix | 21 +- pkgs/by-name/ne/neovim-unwrapped/package.nix | 109 +-- pkgs/by-name/ne/net-snmp/package.nix | 3 +- pkgs/by-name/ne/netcap/package.nix | 19 +- pkgs/by-name/ne/netcdf/package.nix | 44 +- .../ne/netease-cloud-music-gtk/package.nix | 27 +- pkgs/by-name/ne/netgen/package.nix | 38 +- pkgs/by-name/ne/netlify-cli/test.nix | 15 +- pkgs/by-name/ne/netpbm/package.nix | 66 +- pkgs/by-name/ne/netrw/package.nix | 3 +- .../ne/networkmanager-fortisslvpn/package.nix | 27 +- .../ne/networkmanager-iodine/package.nix | 21 +- .../ne/networkmanager-l2tp/package.nix | 44 +- .../ne/networkmanager-openconnect/package.nix | 29 +- .../ne/networkmanager-openvpn/package.nix | 23 +- .../ne/networkmanager-sstp/package.nix | 46 +- .../ne/networkmanager-vpnc/package.nix | 23 +- pkgs/by-name/ne/neuron/package.nix | 60 +- pkgs/by-name/ne/neverest/package.nix | 3 +- pkgs/by-name/ne/newsboat/package.nix | 61 +- pkgs/by-name/ne/newsflash/package.nix | 41 +- pkgs/by-name/ne/newt/package.nix | 23 +- .../ne/nextcloud-talk-desktop/package.nix | 45 +- pkgs/by-name/ne/nextpnr/package.nix | 18 +- pkgs/by-name/ne/nexusmods-app/package.nix | 29 +- pkgs/by-name/ne/nezha/package.nix | 27 +- pkgs/by-name/nf/nfd/package.nix | 18 +- pkgs/by-name/nf/nfs-utils/package.nix | 61 +- pkgs/by-name/nh/nheko/package.nix | 59 +- pkgs/by-name/ni/nickel/package.nix | 15 +- pkgs/by-name/ni/nim-2_2/package.nix | 49 +- pkgs/by-name/ni/nim-unwrapped-2_2/package.nix | 15 +- pkgs/by-name/ni/ninja/package.nix | 93 +- pkgs/by-name/ni/niri/package.nix | 76 +- pkgs/by-name/ni/nix-doc/package.nix | 17 +- pkgs/by-name/ni/nix-template/package.nix | 21 +- pkgs/by-name/ni/nix-top/package.nix | 27 +- pkgs/by-name/ni/nix-unit/package.nix | 3 +- pkgs/by-name/ni/nix-weather/package.nix | 15 +- pkgs/by-name/ni/nixpkgs-review/package.nix | 30 +- pkgs/by-name/ni/nixtract/package.nix | 11 +- pkgs/by-name/nl/nlohmann_json/package.nix | 3 +- pkgs/by-name/nl/nlopt/package.nix | 64 +- pkgs/by-name/nn/nng/package.nix | 20 +- pkgs/by-name/nn/nnn/package.nix | 28 +- .../no/node-problem-detector/package.nix | 3 +- pkgs/by-name/no/nodehun/package.nix | 3 +- pkgs/by-name/no/nomacs/package.nix | 44 +- pkgs/by-name/no/normcap/package.nix | 224 +++-- pkgs/by-name/no/nostr-rs-relay/package.nix | 11 +- pkgs/by-name/no/notcurses/package.nix | 17 +- pkgs/by-name/no/notifymuch/package.nix | 17 +- pkgs/by-name/no/noto-fonts/package.nix | 71 +- pkgs/by-name/no/novops/package.nix | 13 +- pkgs/by-name/np/np2kai/package.nix | 42 +- pkgs/by-name/ns/ns-3/package.nix | 3 +- pkgs/by-name/ns/nsis/package.nix | 3 +- pkgs/by-name/ns/nsncd/package.nix | 39 +- pkgs/by-name/ns/nspr/package.nix | 18 +- pkgs/by-name/ns/nsxiv/package.nix | 3 +- pkgs/by-name/nt/ntbtls/package.nix | 3 +- pkgs/by-name/nt/ntfs3g/package.nix | 52 +- pkgs/by-name/nt/ntl/package.nix | 37 +- pkgs/by-name/nt/ntp/package.nix | 20 +- pkgs/by-name/nu/nulloy/package.nix | 25 +- pkgs/by-name/nu/nut/package.nix | 27 +- pkgs/by-name/nv/nvc/package.nix | 19 +- .../nv/nvidia-texture-tools/package.nix | 21 +- pkgs/by-name/nw/nwg-displays/package.nix | 25 +- pkgs/by-name/nx/nxengine-evo/package.nix | 27 +- pkgs/by-name/nz/nzportable/fteqw.nix | 90 +- pkgs/by-name/oc/ocl-icd/package.nix | 15 +- pkgs/by-name/oc/ocrodjvu/package.nix | 11 +- .../by-name/oc/ocsinventory-agent/package.nix | 31 +- pkgs/by-name/oc/octoprint/package.nix | 3 +- pkgs/by-name/oc/octopus/package.nix | 3 +- pkgs/by-name/oc/oculante/package.nix | 29 +- pkgs/by-name/od/odamex/package.nix | 37 +- pkgs/by-name/of/offpunk/package.nix | 33 +- pkgs/by-name/oi/oils-for-unix/package.nix | 15 +- pkgs/by-name/ol/ollama/package.nix | 87 +- pkgs/by-name/ol/olm/package.nix | 23 +- pkgs/by-name/om/ombi/package.nix | 9 +- pkgs/by-name/om/omxplayer/package.nix | 85 +- pkgs/by-name/on/onboard/package.nix | 3 +- pkgs/by-name/on/onedrive/package.nix | 3 +- pkgs/by-name/on/onefetch/package.nix | 11 +- pkgs/by-name/on/onionshare/package.nix | 15 +- pkgs/by-name/on/onnxruntime/package.nix | 222 +++-- pkgs/by-name/op/open-policy-agent/package.nix | 29 +- pkgs/by-name/op/open-vm-tools/package.nix | 64 +- pkgs/by-name/op/open62541/package.nix | 54 +- .../op/openapi-python-client/package.nix | 13 +- pkgs/by-name/op/opencc/package.nix | 15 +- pkgs/by-name/op/opencl-clang/package.nix | 35 +- pkgs/by-name/op/openclonk/package.nix | 15 +- pkgs/by-name/op/opencollada/package.nix | 19 +- pkgs/by-name/op/opencsg/package.nix | 21 +- pkgs/by-name/op/openctm/package.nix | 3 +- pkgs/by-name/op/opendht/package.nix | 31 +- pkgs/by-name/op/opendkim/package.nix | 6 +- pkgs/by-name/op/openfortivpn/package.nix | 26 +- pkgs/by-name/op/openfpgaloader/package.nix | 19 +- pkgs/by-name/op/openh264/package.nix | 13 +- pkgs/by-name/op/openhmd/package.nix | 17 +- pkgs/by-name/op/openimagedenoise/package.nix | 28 +- pkgs/by-name/op/openjpeg/package.nix | 26 +- pkgs/by-name/op/openldap/package.nix | 56 +- pkgs/by-name/op/openmm/package.nix | 97 +- pkgs/by-name/op/openmolcas/package.nix | 42 +- pkgs/by-name/op/openmpi/package.nix | 153 ++- pkgs/by-name/op/openocd/package.nix | 26 +- pkgs/by-name/op/openomf/package.nix | 27 +- .../op/openorienteering-mapper/package.nix | 37 +- pkgs/by-name/op/openrgb/package.nix | 36 +- pkgs/by-name/op/openroad/package.nix | 86 +- pkgs/by-name/op/opensbi/package.nix | 19 +- pkgs/by-name/op/opensc/package.nix | 31 +- pkgs/by-name/op/openscad/package.nix | 80 +- pkgs/by-name/op/opensmt/package.nix | 3 +- pkgs/by-name/op/opensp/package.nix | 27 +- pkgs/by-name/op/opensplat/package.nix | 59 +- pkgs/by-name/op/opensubdiv/package.nix | 52 +- pkgs/by-name/op/opentelemetry-cpp/package.nix | 3 +- pkgs/by-name/op/openturns/package.nix | 48 +- pkgs/by-name/op/openvino/package.nix | 62 +- pkgs/by-name/op/openvpn3/package.nix | 3 +- pkgs/by-name/op/openvscode-server/package.nix | 146 ++- pkgs/by-name/op/openvswitch/package.nix | 49 +- pkgs/by-name/op/ophcrack/package.nix | 32 +- pkgs/by-name/op/optee-client/package.nix | 17 +- pkgs/by-name/op/optipng/package.nix | 15 +- pkgs/by-name/op/opusfile/package.nix | 23 +- pkgs/by-name/op/opustags/package.nix | 22 +- pkgs/by-name/or/or-tools/package.nix | 81 +- .../or/oracle-instantclient/package.nix | 27 +- pkgs/by-name/or/oranda/package.nix | 17 +- pkgs/by-name/or/orbiton/package.nix | 19 +- pkgs/by-name/or/orc/package.nix | 22 +- pkgs/by-name/or/orca-slicer/package.nix | 95 +- pkgs/by-name/os/osi/package.nix | 17 +- pkgs/by-name/os/osm2pgsql/package.nix | 47 +- pkgs/by-name/os/ostree/package.nix | 109 +-- pkgs/by-name/ot/otb/package.nix | 89 +- pkgs/by-name/ot/otel-cli/package.nix | 25 +- pkgs/by-name/ot/otf2/package.nix | 15 +- pkgs/by-name/ot/ott/package.nix | 32 +- pkgs/by-name/ou/ouch/package.nix | 19 +- pkgs/by-name/ov/ovftool/package.nix | 191 ++-- pkgs/by-name/ow/owl-compositor/package.nix | 38 +- pkgs/by-name/ow/owmods-cli/package.nix | 37 +- pkgs/by-name/ow/owncloud-client/package.nix | 25 +- pkgs/by-name/ow/owntone/package.nix | 43 +- pkgs/by-name/p4/p4/package.nix | 41 +- pkgs/by-name/p4/p4est-sc/package.nix | 20 +- pkgs/by-name/p4/p4est/package.nix | 26 +- pkgs/by-name/pa/pacemaker/package.nix | 3 +- pkgs/by-name/pa/packcc/package.nix | 17 +- pkgs/by-name/pa/pacu/package.nix | 41 +- pkgs/by-name/pa/pagmo2/package.nix | 34 +- pkgs/by-name/pa/pahole/package.nix | 19 +- pkgs/by-name/pa/palp/package.nix | 25 +- pkgs/by-name/pa/pam_p11/package.nix | 3 +- pkgs/by-name/pa/pan/package.nix | 23 +- pkgs/by-name/pa/pango/package.nix | 47 +- pkgs/by-name/pa/pantheon-tweaks/package.nix | 27 +- pkgs/by-name/pa/pantum-driver/package.nix | 29 +- pkgs/by-name/pa/paperjam/package.nix | 3 +- pkgs/by-name/pa/paperless-ngx/package.nix | 34 +- pkgs/by-name/pa/papers/package.nix | 62 +- pkgs/by-name/pa/pappl/package.nix | 33 +- pkgs/by-name/pa/parabolic/package.nix | 66 +- pkgs/by-name/pa/parallel-launcher/package.nix | 3 +- pkgs/by-name/pa/parted/package.nix | 11 +- pkgs/by-name/pa/particl-core/package.nix | 15 +- pkgs/by-name/pa/partio/package.nix | 23 +- pkgs/by-name/pa/pax-britannica/package.nix | 45 +- pkgs/by-name/pb/pb_cli/package.nix | 15 +- pkgs/by-name/pc/pc-ble-driver/package.nix | 24 +- pkgs/by-name/pc/pcaudiolib/package.nix | 11 +- pkgs/by-name/pc/pcem/package.nix | 12 +- pkgs/by-name/pc/pciutils/package.nix | 3 +- pkgs/by-name/pc/pcl/package.nix | 6 +- pkgs/by-name/pc/pcmciaUtils/package.nix | 27 +- pkgs/by-name/pc/pcsc-tools/package.nix | 112 ++- pkgs/by-name/pc/pcsclite/package.nix | 77 +- pkgs/by-name/pd/pdal/package.nix | 41 +- pkgs/by-name/pd/pdisk/package.nix | 17 +- pkgs/by-name/pd/pdns-recursor/package.nix | 3 +- pkgs/by-name/pe/peakperf/package.nix | 17 +- pkgs/by-name/pe/peazip/package.nix | 15 +- pkgs/by-name/pe/persepolis/package.nix | 25 +- .../pe/persistent-cache-cpp/package.nix | 35 +- pkgs/by-name/pe/petsc/package.nix | 179 ++-- pkgs/by-name/pf/pfft/package.nix | 3 +- pkgs/by-name/pg/pgagroal/package.nix | 3 +- pkgs/by-name/pg/pgbouncer/package.nix | 3 +- pkgs/by-name/pg/pgcopydb/package.nix | 27 +- pkgs/by-name/pg/pgmodeler/package.nix | 65 +- pkgs/by-name/pg/pgpool/package.nix | 6 +- pkgs/by-name/ph/photoqt/package.nix | 43 +- pkgs/by-name/pi/picard/package.nix | 53 +- pkgs/by-name/pi/picolibc/package.nix | 121 ++- pkgs/by-name/pi/picolisp/package.nix | 19 +- pkgs/by-name/pi/picom/package.nix | 15 +- pkgs/by-name/pi/pihole/package.nix | 15 +- pkgs/by-name/pi/pijul/package.nix | 3 +- pkgs/by-name/pi/pikchr/package.nix | 25 +- pkgs/by-name/pi/pilot-link/package.nix | 40 +- pkgs/by-name/pi/pineflash/package.nix | 32 +- pkgs/by-name/pi/pinocchio/package.nix | 79 +- pkgs/by-name/pi/pitivi/package.nix | 37 +- pkgs/by-name/pi/pixinsight/package.nix | 105 +- pkgs/by-name/pj/pjsip/package.nix | 107 +- .../pk/pkg-config-unwrapped/package.nix | 31 +- pkgs/by-name/pk/pkg/package.nix | 3 +- pkgs/by-name/pk/pktgen/package.nix | 23 +- pkgs/by-name/pl/playerctl/package.nix | 23 +- pkgs/by-name/pl/plfit/package.nix | 28 +- pkgs/by-name/pl/plink-ng/package.nix | 15 +- pkgs/by-name/pm/pmacct/package.nix | 48 +- pkgs/by-name/pm/pmars/package.nix | 6 +- pkgs/by-name/pm/pmbootstrap/package.nix | 19 +- pkgs/by-name/pm/pmix/package.nix | 33 +- pkgs/by-name/pn/pnfft/package.nix | 3 +- pkgs/by-name/pn/pngout/package.nix | 15 +- pkgs/by-name/po/pocl/package.nix | 64 +- pkgs/by-name/po/poco/package.nix | 35 +- pkgs/by-name/po/podman-desktop/package.nix | 62 +- pkgs/by-name/po/podman-tui/package.nix | 3 +- pkgs/by-name/po/podman/package.nix | 52 +- .../po/poetry/plugins/poetry-plugin-shell.nix | 17 +- pkgs/by-name/po/poetry/unwrapped.nix | 116 ++- pkgs/by-name/po/poke/package.nix | 49 +- pkgs/by-name/po/polkadot/package.nix | 3 +- pkgs/by-name/po/polkit/package.nix | 89 +- pkgs/by-name/po/polybar/package.nix | 71 +- pkgs/by-name/po/polymake/package.nix | 41 +- pkgs/by-name/po/ponyc/package.nix | 121 ++- pkgs/by-name/po/portablemc/package.nix | 39 +- pkgs/by-name/po/portaudio/package.nix | 32 +- pkgs/by-name/po/positron-bin/package.nix | 46 +- pkgs/by-name/po/postfix/package.nix | 27 +- .../po/power-profiles-daemon/package.nix | 53 +- pkgs/by-name/po/powerdns-admin/package.nix | 3 +- pkgs/by-name/po/powershell/package.nix | 73 +- pkgs/by-name/pp/ppl/package.nix | 17 +- pkgs/by-name/pp/ppp/package.nix | 21 +- pkgs/by-name/pp/ppsspp/package.nix | 48 +- pkgs/by-name/pr/pre-commit/package.nix | 204 ++-- pkgs/by-name/pr/previewqt/package.nix | 37 +- .../pr/prism-model-checker/package.nix | 3 +- .../pr/prismlauncher-unwrapped/package.nix | 38 +- pkgs/by-name/pr/prismlauncher/package.nix | 67 +- pkgs/by-name/pr/pritunl-client/package.nix | 137 ++- pkgs/by-name/pr/procmail/package.nix | 37 +- pkgs/by-name/pr/procs/package.nix | 3 +- pkgs/by-name/pr/professor/package.nix | 17 +- .../prometheus-borgmatic-exporter/package.nix | 25 +- pkgs/by-name/pr/proot/package.nix | 6 +- pkgs/by-name/pr/properties-cpp/package.nix | 19 +- pkgs/by-name/pr/prowlarr/package.nix | 23 +- pkgs/by-name/pr/proxsuite-nlp/package.nix | 28 +- pkgs/by-name/pr/proxsuite/package.nix | 35 +- pkgs/by-name/ps/psc-package/package.nix | 43 +- pkgs/by-name/ps/psqlodbc/package.nix | 41 +- pkgs/by-name/ps/psst/package.nix | 25 +- pkgs/by-name/ps/pstoedit/package.nix | 25 +- pkgs/by-name/pt/ptcollab/package.nix | 34 +- pkgs/by-name/pu/pueue/package.nix | 13 +- pkgs/by-name/pu/pulsar/package.nix | 170 ++-- pkgs/by-name/pu/pulseaudio-dlna/zeroconf.nix | 3 +- .../pu/pulumi/extra/mk-pulumi-package.nix | 3 +- pkgs/by-name/pw/pwsafe/package.nix | 87 +- pkgs/by-name/py/pylyzer/package.nix | 3 +- pkgs/by-name/py/pymol/package.nix | 62 +- pkgs/by-name/py/pympress/package.nix | 29 +- pkgs/by-name/py/pytrainer/package.nix | 19 +- pkgs/by-name/q2/q2pro/package.nix | 58 +- .../qa/qadwaitadecorations/package.nix | 11 +- pkgs/by-name/qa/qalculate-gtk/package.nix | 3 +- pkgs/by-name/qa/qastools/package.nix | 19 +- pkgs/by-name/qb/qbittorrent/package.nix | 42 +- pkgs/by-name/qd/qdirstat/package.nix | 13 +- pkgs/by-name/qd/qdiskinfo/package.nix | 21 +- pkgs/by-name/qe/qemacs/package.nix | 13 +- pkgs/by-name/qg/qgroundcontrol/package.nix | 15 +- pkgs/by-name/ql/qlog/package.nix | 25 +- pkgs/by-name/qm/qmidiarp/package.nix | 17 +- pkgs/by-name/qm/qmplay2/package.nix | 72 +- pkgs/by-name/qo/qodem/package.nix | 17 +- pkgs/by-name/qo/qownnotes/package.nix | 22 +- pkgs/by-name/qr/qrtool/package.nix | 21 +- pkgs/by-name/qt/qtalarm/package.nix | 41 +- pkgs/by-name/qt/qtorganizer-mkcal/package.nix | 17 +- pkgs/by-name/qt/qtox/package.nix | 3 +- pkgs/by-name/qt/qtscrcpy/package.nix | 21 +- .../by-name/qu/quartus-prime-lite/package.nix | 61 +- .../by-name/qu/quartus-prime-lite/quartus.nix | 15 +- pkgs/by-name/qu/quickemu/package.nix | 47 +- pkgs/by-name/qu/quill/package.nix | 15 +- pkgs/by-name/qu/quirc/package.nix | 19 +- pkgs/by-name/qu/qutebrowser/package.nix | 33 +- pkgs/by-name/qv/qview/package.nix | 3 +- pkgs/by-name/qx/qxmpp/package.nix | 36 +- pkgs/by-name/ra/racket/minimal.nix | 39 +- pkgs/by-name/ra/radarr/package.nix | 62 +- pkgs/by-name/ra/raider/package.nix | 25 +- pkgs/by-name/ra/range-v3/package.nix | 3 +- pkgs/by-name/ra/ranger/package.nix | 58 +- pkgs/by-name/ra/rasdaemon/package.nix | 25 +- pkgs/by-name/ra/rav1e/package.nix | 23 +- pkgs/by-name/ra/raylib/package.nix | 18 +- pkgs/by-name/rb/rbw/package.nix | 56 +- pkgs/by-name/rc/rc/package.nix | 26 +- pkgs/by-name/rc/rclip/package.nix | 3 +- pkgs/by-name/rc/rcodesign/package.nix | 29 +- pkgs/by-name/rc/rcu/package.nix | 105 +- pkgs/by-name/rd/rdesktop/package.nix | 24 +- pkgs/by-name/re/re2/package.nix | 17 +- pkgs/by-name/re/readsb/package.nix | 3 +- pkgs/by-name/re/rebels-in-the-sky/package.nix | 15 +- pkgs/by-name/re/recastnavigation/package.nix | 27 +- pkgs/by-name/re/recordbox/package.nix | 29 +- pkgs/by-name/re/recutils/package.nix | 27 +- pkgs/by-name/re/redict/package.nix | 31 +- pkgs/by-name/re/redis-plus-plus/package.nix | 19 +- pkgs/by-name/re/redis/package.nix | 31 +- pkgs/by-name/re/redo-apenwarr/package.nix | 33 +- pkgs/by-name/re/refind/package.nix | 27 +- pkgs/by-name/re/refine/package.nix | 15 +- pkgs/by-name/re/regripper/package.nix | 3 +- pkgs/by-name/re/rehex/package.nix | 39 +- pkgs/by-name/re/remmina/package.nix | 117 ++- pkgs/by-name/re/renderdoc/package.nix | 27 +- pkgs/by-name/re/renovate/package.nix | 44 +- pkgs/by-name/re/renpy/package.nix | 48 +- pkgs/by-name/re/repgrep/package.nix | 29 +- pkgs/by-name/re/repseek/package.nix | 19 +- pkgs/by-name/re/rerun/package.nix | 3 +- pkgs/by-name/re/resonance/package.nix | 35 +- pkgs/by-name/re/restic-browser/package.nix | 19 +- pkgs/by-name/re/restic/package.nix | 25 +- pkgs/by-name/re/restinio/package.nix | 35 +- pkgs/by-name/re/retdec/package.nix | 130 ++- pkgs/by-name/re/retool/package.nix | 13 +- pkgs/by-name/re/retroarch-bare/package.nix | 119 ++- pkgs/by-name/re/retroarch-bare/wrapper.nix | 13 +- pkgs/by-name/re/retrofe/package.nix | 31 +- pkgs/by-name/rh/rhash/package.nix | 15 +- pkgs/by-name/rh/rhythmbox/package.nix | 3 +- pkgs/by-name/ri/ride/package.nix | 3 +- pkgs/by-name/ri/riemann_c_client/package.nix | 15 +- pkgs/by-name/ri/rigel-engine/package.nix | 3 +- pkgs/by-name/ri/rink/package.nix | 23 +- pkgs/by-name/ri/rio/package.nix | 69 +- pkgs/by-name/ri/ripes/package.nix | 31 +- pkgs/by-name/ri/ripgrep/package.nix | 22 +- pkgs/by-name/ri/ripmime/package.nix | 13 +- pkgs/by-name/ri/ripser/package.nix | 23 +- pkgs/by-name/ri/river/package.nix | 19 +- pkgs/by-name/rm/rmg/package.nix | 47 +- pkgs/by-name/rm/rmw/package.nix | 3 +- pkgs/by-name/rn/rng-tools/package.nix | 54 +- pkgs/by-name/rn/rnnoise-plugin/package.nix | 21 +- pkgs/by-name/rn/rnote/package.nix | 25 +- pkgs/by-name/ro/roc-toolkit/package.nix | 21 +- pkgs/by-name/ro/roc/package.nix | 38 +- pkgs/by-name/ro/rockbox-utility/package.nix | 3 +- pkgs/by-name/ro/rocksdb/package.nix | 24 +- pkgs/by-name/ro/rofimoji/package.nix | 23 +- pkgs/by-name/ro/root/clang-root.nix | 33 +- pkgs/by-name/ro/root/package.nix | 163 ++-- pkgs/by-name/ro/rosa/package.nix | 3 +- pkgs/by-name/ro/rott/package.nix | 23 +- pkgs/by-name/ro/route-graph/package.nix | 17 +- pkgs/by-name/rp/rpPPPoE/package.nix | 3 +- pkgs/by-name/rp/rpcbind/package.nix | 3 +- pkgs/by-name/rp/rpcs3/package.nix | 59 +- pkgs/by-name/rp/rpcsvc-proto/package.nix | 21 +- pkgs/by-name/rp/rpi-imager/package.nix | 31 +- pkgs/by-name/rq/rquickshare/package.nix | 23 +- pkgs/by-name/rr/rrdtool/package.nix | 23 +- pkgs/by-name/rs/rshim-user-space/package.nix | 18 +- pkgs/by-name/rs/rspamd/package.nix | 50 +- pkgs/by-name/rs/rstudio/package.nix | 267 +++-- pkgs/by-name/rt/rtags/package.nix | 3 +- pkgs/by-name/rt/rtfm/package.nix | 3 +- pkgs/by-name/rt/rtmpdump/package.nix | 30 +- pkgs/by-name/rt/rtorrent/package.nix | 6 +- pkgs/by-name/ru/rubyfmt/package.nix | 23 +- pkgs/by-name/ru/ruffle/package.nix | 42 +- pkgs/by-name/ru/runit/package.nix | 19 +- pkgs/by-name/ru/rust-cbindgen/package.nix | 29 +- pkgs/by-name/ru/rustdesk/package.nix | 57 +- pkgs/by-name/ru/rusty-psn/package.nix | 67 +- pkgs/by-name/ru/rutabaga_gfx/package.nix | 23 +- pkgs/by-name/rv/rvvm/package.nix | 9 +- pkgs/by-name/ry/rygel/package.nix | 59 +- pkgs/by-name/ry/ryubing/package.nix | 53 +- pkgs/by-name/s2/s2n-tls/package.nix | 17 +- pkgs/by-name/sa/sacrifice/package.nix | 13 +- pkgs/by-name/sa/saga/package.nix | 58 +- pkgs/by-name/sa/sage/sage-env.nix | 187 ++-- pkgs/by-name/sa/sage/sage-src.nix | 33 +- pkgs/by-name/sa/sage/sage.nix | 27 +- .../by-name/sa/sagittarius-scheme/package.nix | 3 +- pkgs/by-name/sa/salmon/package.nix | 3 +- pkgs/by-name/sa/samtools/package.nix | 9 +- pkgs/by-name/sa/sapling/package.nix | 36 +- pkgs/by-name/sa/satdump/package.nix | 59 +- pkgs/by-name/sa/satysfi/package.nix | 31 +- pkgs/by-name/sb/sbctl/package.nix | 19 +- pkgs/by-name/sc/sc-im/package.nix | 21 +- pkgs/by-name/sc/scala-cli/package.nix | 3 +- pkgs/by-name/sc/scalp/package.nix | 48 +- pkgs/by-name/sc/scanbd/package.nix | 23 +- pkgs/by-name/sc/scdoc/package.nix | 13 +- pkgs/by-name/sc/schismtracker/package.nix | 44 +- pkgs/by-name/sc/scilab-bin/package.nix | 33 +- pkgs/by-name/sc/scopehal-apps/package.nix | 64 +- pkgs/by-name/sc/scrcpy/package.nix | 21 +- pkgs/by-name/sc/screen-pipe/package.nix | 29 +- pkgs/by-name/sd/SDL2_image/package.nix | 52 +- pkgs/by-name/sd/SDL2_ttf/package.nix | 17 +- pkgs/by-name/sd/SDL_compat/package.nix | 32 +- pkgs/by-name/sd/sdcc/package.nix | 32 +- pkgs/by-name/sd/sdl2-compat/package.nix | 33 +- pkgs/by-name/sd/sdl3-image/package.nix | 21 +- pkgs/by-name/sd/sdl3-ttf/package.nix | 3 +- pkgs/by-name/sd/sdl3/package.nix | 3 +- pkgs/by-name/sd/sdrangel/package.nix | 91 +- pkgs/by-name/sd/sdrpp/package.nix | 61 +- pkgs/by-name/se/segger-jlink/package.nix | 13 +- pkgs/by-name/se/selinux-refpolicy/package.nix | 31 +- pkgs/by-name/se/semantic-release/package.nix | 3 +- pkgs/by-name/se/sequoia-wot/package.nix | 15 +- .../se/serenityos-emoji-font/package.nix | 19 +- pkgs/by-name/se/serf/package.nix | 24 +- pkgs/by-name/se/servo/package.nix | 45 +- pkgs/by-name/se/setroot/package.nix | 3 +- pkgs/by-name/sf/sfeed/package.nix | 13 +- pkgs/by-name/sf/sfml/package.nix | 33 +- pkgs/by-name/sf/sfml_2/package.nix | 33 +- pkgs/by-name/sg/sgx-ssl/package.nix | 13 +- pkgs/by-name/sg/sgx-ssl/tests.nix | 34 +- pkgs/by-name/sh/shader-slang/package.nix | 115 ++- pkgs/by-name/sh/shadow/package.nix | 30 +- pkgs/by-name/sh/shairport-sync/package.nix | 131 ++- pkgs/by-name/sh/shanggu-fonts/package.nix | 50 +- pkgs/by-name/sh/shared-mime-info/package.nix | 3 +- pkgs/by-name/sh/shark/package.nix | 3 +- pkgs/by-name/sh/sharkey/package.nix | 23 +- pkgs/by-name/sh/sheldon/package.nix | 11 +- pkgs/by-name/sh/shipwright/package.nix | 103 +- pkgs/by-name/sh/shogihome/package.nix | 80 +- pkgs/by-name/sh/shorewall/package.nix | 25 +- pkgs/by-name/sh/shortwave/package.nix | 37 +- pkgs/by-name/sh/shutter/package.nix | 3 +- pkgs/by-name/si/sidplayfp/package.nix | 25 +- pkgs/by-name/si/sigal/package.nix | 13 +- pkgs/by-name/si/signal-cli/package.nix | 51 +- pkgs/by-name/si/signal-desktop/ringrtc.nix | 13 +- .../by-name/si/signalbackup-tools/package.nix | 28 +- pkgs/by-name/si/sile/package.nix | 102 +- pkgs/by-name/si/silicon/package.nix | 26 +- pkgs/by-name/si/simdjson/package.nix | 23 +- pkgs/by-name/si/simgrid/package.nix | 39 +- pkgs/by-name/si/simulide/package.nix | 17 +- pkgs/by-name/si/singular/package.nix | 77 +- pkgs/by-name/si/sioyek/package.nix | 27 +- pkgs/by-name/si/sipp/package.nix | 3 +- pkgs/by-name/si/sipvicious/package.nix | 13 +- pkgs/by-name/si/sirikali/package.nix | 17 +- pkgs/by-name/si/sirius/package.nix | 138 ++- pkgs/by-name/sk/skia/package.nix | 54 +- pkgs/by-name/sk/skopeo/package.nix | 71 +- pkgs/by-name/sk/skribilo/package.nix | 27 +- pkgs/by-name/sk/skyemu/package.nix | 29 +- pkgs/by-name/sl/slack/package.nix | 69 +- pkgs/by-name/sl/slang/package.nix | 3 +- pkgs/by-name/sl/slepc/package.nix | 43 +- pkgs/by-name/sl/sleqp/package.nix | 37 +- pkgs/by-name/sl/slic3r/package.nix | 59 +- pkgs/by-name/sl/slimevr/package.nix | 68 +- pkgs/by-name/sl/slint-lsp/package.nix | 25 +- pkgs/by-name/sl/slurm/package.nix | 129 ++- pkgs/by-name/sl/slurp/package.nix | 3 +- pkgs/by-name/sm/sm64ex/package.nix | 13 +- pkgs/by-name/sm/smatch/package.nix | 13 +- pkgs/by-name/sm/smokeping/package.nix | 37 +- pkgs/by-name/sm/smpeg/package.nix | 15 +- pkgs/by-name/sm/smuview/package.nix | 6 +- pkgs/by-name/sm/smuxi/package.nix | 34 +- pkgs/by-name/sn/sn0int/package.nix | 15 +- pkgs/by-name/sn/snakemake/package.nix | 123 ++- pkgs/by-name/sn/snapcraft/package.nix | 3 +- pkgs/by-name/sn/snd/package.nix | 29 +- pkgs/by-name/sn/snes9x/package.nix | 72 +- pkgs/by-name/sn/sniffglue/package.nix | 13 +- pkgs/by-name/sn/sniffnet/package.nix | 35 +- pkgs/by-name/sn/snobol4/package.nix | 25 +- pkgs/by-name/so/so/package.nix | 11 +- pkgs/by-name/so/soapyaudio/package.nix | 23 +- pkgs/by-name/so/sockperf/package.nix | 9 +- pkgs/by-name/so/sogo/package.nix | 3 +- pkgs/by-name/so/solana-cli/package.nix | 48 +- pkgs/by-name/so/solc/package.nix | 50 +- pkgs/by-name/so/somo/package.nix | 15 +- pkgs/by-name/so/sonic/package.nix | 13 +- pkgs/by-name/so/sope/package.nix | 42 +- pkgs/by-name/so/soundtracker/package.nix | 16 +- pkgs/by-name/so/soupault/package.nix | 11 +- pkgs/by-name/so/sourceHighlight/package.nix | 62 +- pkgs/by-name/sp/spaceFM/package.nix | 3 +- pkgs/by-name/sp/spade/package.nix | 3 +- pkgs/by-name/sp/spatialite-gui/package.nix | 3 +- pkgs/by-name/sp/speech-tools/package.nix | 13 +- pkgs/by-name/sp/speechd/package.nix | 127 ++- pkgs/by-name/sp/spfft/package.nix | 61 +- pkgs/by-name/sp/sphinxsearch/package.nix | 15 +- pkgs/by-name/sp/spice-gtk/package.nix | 166 ++-- pkgs/by-name/sp/spice/package.nix | 53 +- pkgs/by-name/sp/spider/package.nix | 43 +- .../sp/spirv-llvm-translator/package.nix | 42 +- pkgs/by-name/sp/spla/package.nix | 42 +- pkgs/by-name/sp/spotify-player/package.nix | 68 +- pkgs/by-name/sp/spral/package.nix | 22 +- pkgs/by-name/sq/sqlite-vss/package.nix | 15 +- pkgs/by-name/sq/sqlitestudio/package.nix | 53 +- pkgs/by-name/sq/sqsh/package.nix | 13 +- pkgs/by-name/sq/squashfsTools/package.nix | 9 +- pkgs/by-name/sq/squeezelite/package.nix | 58 +- pkgs/by-name/sq/squid/package.nix | 60 +- pkgs/by-name/sq/squirreldisk/package.nix | 25 +- pkgs/by-name/sr/srt/package.nix | 13 +- pkgs/by-name/ss/sshfs-fuse/common.nix | 15 +- pkgs/by-name/ss/sslh/package.nix | 21 +- pkgs/by-name/st/st/package.nix | 3 +- pkgs/by-name/st/stalwart-mail/package.nix | 47 +- pkgs/by-name/st/starfetch/package.nix | 13 +- pkgs/by-name/st/starship/package.nix | 29 +- pkgs/by-name/st/steam/package.nix | 3 +- pkgs/by-name/st/steel/package.nix | 62 +- pkgs/by-name/st/stfl/package.nix | 48 +- pkgs/by-name/st/stgit/package.nix | 17 +- pkgs/by-name/st/stlink/package.nix | 28 +- pkgs/by-name/st/stp/package.nix | 67 +- pkgs/by-name/st/strace/package.nix | 12 +- pkgs/by-name/st/strawberry/package.nix | 92 +- pkgs/by-name/st/streamcontroller/package.nix | 216 ++-- pkgs/by-name/st/streamdeck-ui/package.nix | 15 +- pkgs/by-name/st/stress-ng/package.nix | 33 +- pkgs/by-name/st/stripe-cli/package.nix | 51 +- pkgs/by-name/st/strongswan/package.nix | 216 ++-- pkgs/by-name/st/stubby/package.nix | 3 +- pkgs/by-name/st/stunnel/package.nix | 19 +- pkgs/by-name/su/sublime-music/package.nix | 13 +- pkgs/by-name/su/subtitlecomposer/package.nix | 33 +- pkgs/by-name/su/sudo/package.nix | 39 +- pkgs/by-name/su/suil/package.nix | 25 +- pkgs/by-name/su/sumo/package.nix | 65 +- pkgs/by-name/su/sundials/package.nix | 76 +- pkgs/by-name/su/sunshine/package.nix | 155 ++- pkgs/by-name/su/sunvox/package.nix | 51 +- pkgs/by-name/su/superTuxKart/package.nix | 45 +- pkgs/by-name/su/superlu/package.nix | 19 +- pkgs/by-name/su/superlu_dist/package.nix | 46 +- pkgs/by-name/su/supersonic/package.nix | 77 +- pkgs/by-name/su/surf/package.nix | 33 +- pkgs/by-name/su/suricata/package.nix | 125 ++- pkgs/by-name/su/survex/package.nix | 31 +- pkgs/by-name/sv/svt-av1-psy/package.nix | 28 +- pkgs/by-name/sv/svt-av1/package.nix | 13 +- pkgs/by-name/sw/sway-unwrapped/package.nix | 72 +- pkgs/by-name/sw/swayfx-unwrapped/package.nix | 36 +- pkgs/by-name/sw/swayidle/package.nix | 3 +- pkgs/by-name/sw/swi-prolog/package.nix | 18 +- pkgs/by-name/sw/sword/package.nix | 57 +- pkgs/by-name/sw/swtpm/package.nix | 38 +- pkgs/by-name/sy/sylpheed/package.nix | 7 +- pkgs/by-name/sy/symengine/package.nix | 29 +- pkgs/by-name/sy/sympow/package.nix | 21 +- pkgs/by-name/sy/syncterm/package.nix | 22 +- .../sy/syndication-domination/package.nix | 19 +- pkgs/by-name/sy/synfigstudio/package.nix | 19 +- pkgs/by-name/sy/sysbench/package.nix | 3 +- pkgs/by-name/sy/syslinux/package.nix | 41 +- pkgs/by-name/sy/syslogng/package.nix | 56 +- pkgs/by-name/sy/systemd-netlogd/package.nix | 16 +- pkgs/by-name/sy/sysvinit/package.nix | 25 +- pkgs/by-name/t-/t-rec/package.nix | 11 +- pkgs/by-name/ta/tabby/package.nix | 41 +- pkgs/by-name/ta/tacacsplus/package.nix | 15 +- pkgs/by-name/ta/tachyon/package.nix | 23 +- pkgs/by-name/ta/taco/package.nix | 3 +- pkgs/by-name/ta/tailscale/package.nix | 174 ++-- pkgs/by-name/ta/taisei/package.nix | 3 +- pkgs/by-name/ta/talloc/package.nix | 40 +- pkgs/by-name/ta/tangram/package.nix | 35 +- pkgs/by-name/ta/tarsnap/package.nix | 13 +- pkgs/by-name/ta/taskopen/package.nix | 13 +- pkgs/by-name/ta/taskwarrior3/package.nix | 15 +- pkgs/by-name/ta/taterclient-ddnet/package.nix | 3 +- pkgs/by-name/tc/tcpcrypt/package.nix | 21 +- pkgs/by-name/tc/tcpflow/package.nix | 3 +- pkgs/by-name/td/tdb/package.nix | 44 +- pkgs/by-name/td/tdlib/package.nix | 23 +- pkgs/by-name/te/teams-for-linux/package.nix | 105 +- pkgs/by-name/te/teamspeak3/package.nix | 25 +- .../by-name/te/tectonic-unwrapped/package.nix | 21 +- pkgs/by-name/te/tectonic/package.nix | 47 +- pkgs/by-name/te/teeworlds/package.nix | 46 +- pkgs/by-name/te/telegraf/package.nix | 15 +- .../te/telepathy-mission-control/package.nix | 23 +- pkgs/by-name/te/teleport/package.nix | 18 +- pkgs/by-name/te/tenacity/package.nix | 141 ++- pkgs/by-name/te/tensorflow-lite/package.nix | 13 +- .../by-name/te/terminal-typeracer/package.nix | 17 +- pkgs/by-name/te/termscp/package.nix | 23 +- pkgs/by-name/te/termusic/package.nix | 23 +- pkgs/by-name/te/terra/package.nix | 17 +- pkgs/by-name/te/test-drive/package.nix | 17 +- pkgs/by-name/te/tev/package.nix | 29 +- pkgs/by-name/te/tevent/package.nix | 17 +- pkgs/by-name/te/texstudio/package.nix | 27 +- pkgs/by-name/te/textadept/package.nix | 17 +- pkgs/by-name/te/textlint/package.nix | 19 +- pkgs/by-name/th/thc-hydra/package.nix | 3 +- pkgs/by-name/th/the-powder-toy/package.nix | 3 +- pkgs/by-name/th/thelounge/package.nix | 3 +- pkgs/by-name/th/thinkfan/package.nix | 3 +- pkgs/by-name/th/thonny/package.nix | 3 +- pkgs/by-name/th/thrift/package.nix | 91 +- pkgs/by-name/ti/tig/package.nix | 3 +- pkgs/by-name/ti/tigerbeetle/package.nix | 3 +- pkgs/by-name/ti/tigervnc/package.nix | 90 +- pkgs/by-name/ti/tiledb/package.nix | 6 +- pkgs/by-name/ti/timeloop/package.nix | 58 +- pkgs/by-name/ti/timidity/package.nix | 91 +- pkgs/by-name/ti/tiny-cuda-nn/package.nix | 89 +- pkgs/by-name/ti/tinycc/package.nix | 29 +- pkgs/by-name/ti/tinycdb/package.nix | 41 +- pkgs/by-name/ti/tinyfugue/package.nix | 3 +- pkgs/by-name/ti/tinygo/package.nix | 6 +- pkgs/by-name/ti/tinyscheme/package.nix | 31 +- pkgs/by-name/ti/tinysparql/package.nix | 68 +- pkgs/by-name/ti/tiscamera/package.nix | 82 +- pkgs/by-name/tm/tmux/package.nix | 49 +- pkgs/by-name/to/tonelib-gfx/package.nix | 3 +- pkgs/by-name/to/tonelib-jam/package.nix | 3 +- pkgs/by-name/to/tonelib-metal/package.nix | 3 +- .../to/tonelib-noisereducer/package.nix | 3 +- pkgs/by-name/to/tonelib-zoom/package.nix | 3 +- pkgs/by-name/to/topiary/package.nix | 19 +- pkgs/by-name/to/tor/package.nix | 31 +- pkgs/by-name/to/touchegg/package.nix | 33 +- pkgs/by-name/to/toxic/package.nix | 31 +- pkgs/by-name/to/toxvpn/package.nix | 21 +- pkgs/by-name/to/toybox/package.nix | 36 +- pkgs/by-name/tp/tpm2-pkcs11/package.nix | 21 +- pkgs/by-name/tr/tracee/integration-tests.nix | 36 +- pkgs/by-name/tr/tracexec/package.nix | 17 +- pkgs/by-name/tr/trackma/package.nix | 19 +- pkgs/by-name/tr/tractor/package.nix | 46 +- pkgs/by-name/tr/tracy/package.nix | 94 +- pkgs/by-name/tr/trafficserver/package.nix | 97 +- pkgs/by-name/tr/transmission_3/package.nix | 60 +- pkgs/by-name/tr/trealla/package.nix | 13 +- pkgs/by-name/tr/trgui-ng/package.nix | 42 +- pkgs/by-name/tr/tribler/package.nix | 95 +- pkgs/by-name/tr/trickster/package.nix | 23 +- pkgs/by-name/tr/trigger-control/package.nix | 19 +- pkgs/by-name/tr/triton-llvm/package.nix | 175 ++-- pkgs/by-name/tr/trlib/package.nix | 13 +- pkgs/by-name/tr/trunk-recorder/package.nix | 27 +- pkgs/by-name/ts/tsid/package.nix | 34 +- pkgs/by-name/ts/tsukimi/package.nix | 33 +- pkgs/by-name/tu/tuba/package.nix | 51 +- pkgs/by-name/tu/tuifimanager/package.nix | 25 +- pkgs/by-name/tu/tuntox/package.nix | 27 +- pkgs/by-name/tu/turbo-unwrapped/package.nix | 19 +- pkgs/by-name/tu/turtle/package.nix | 33 +- pkgs/by-name/ty/typst/typst-packages.nix | 3 +- pkgs/by-name/tz/tzdata/package.nix | 59 +- pkgs/by-name/uc/ucc/package.nix | 20 +- pkgs/by-name/uc/uclibc-ng/package.nix | 66 +- pkgs/by-name/uc/ucx/package.nix | 65 +- pkgs/by-name/ue/ueberzugpp/package.nix | 74 +- pkgs/by-name/ue/ueviewer/package.nix | 19 +- pkgs/by-name/uf/ufoai/package.nix | 3 +- pkgs/by-name/uf/uftrace/package.nix | 17 +- pkgs/by-name/ug/uget/package.nix | 29 +- pkgs/by-name/uh/uhd/package.nix | 112 ++- pkgs/by-name/uh/uhttpmock/package.nix | 25 +- pkgs/by-name/uh/uhttpmock_1_0/package.nix | 25 +- pkgs/by-name/uh/uhub/package.nix | 3 +- pkgs/by-name/ui/uiua/package.nix | 18 +- pkgs/by-name/ul/ultrastardx/package.nix | 3 +- pkgs/by-name/um/umockdev/package.nix | 25 +- pkgs/by-name/um/umpire/package.nix | 13 +- pkgs/by-name/un/unblob/package.nix | 3 +- pkgs/by-name/un/unbound/package.nix | 149 ++- pkgs/by-name/un/uni-vga/package.nix | 73 +- pkgs/by-name/un/unicorn/package.nix | 15 +- pkgs/by-name/un/unimap/package.nix | 15 +- pkgs/by-name/un/unison-ucm/package.nix | 3 +- pkgs/by-name/un/unison/package.nix | 20 +- pkgs/by-name/un/unit/package.nix | 44 +- pkgs/by-name/un/units/package.nix | 13 +- pkgs/by-name/un/universal-ctags/package.nix | 17 +- pkgs/by-name/un/unixbench/package.nix | 51 +- pkgs/by-name/un/unoconv/package.nix | 17 +- pkgs/by-name/un/unp/package.nix | 3 +- pkgs/by-name/un/unzip/package.nix | 130 ++- pkgs/by-name/up/upower/package.nix | 122 ++- pkgs/by-name/uq/uqm/package.nix | 31 +- pkgs/by-name/ur/urh/package.nix | 21 +- pkgs/by-name/us/usbimager/package.nix | 9 +- pkgs/by-name/us/usbutils/package.nix | 38 +- pkgs/by-name/us/ustreamer/package.nix | 62 +- pkgs/by-name/ut/util-linux/package.nix | 206 ++-- pkgs/by-name/uu/uutils-coreutils/package.nix | 49 +- pkgs/by-name/uw/uwimap/package.nix | 38 +- pkgs/by-name/uw/uwsgi/package.nix | 30 +- pkgs/by-name/uw/uwsm/package.nix | 3 +- pkgs/by-name/uw/uwufetch/package.nix | 33 +- .../va/vala-language-server/package.nix | 21 +- pkgs/by-name/va/vale-ls/package.nix | 19 +- pkgs/by-name/va/vale/styles.nix | 3 +- pkgs/by-name/va/valeronoi/package.nix | 23 +- pkgs/by-name/va/valkey/package.nix | 31 +- pkgs/by-name/va/vamp-plugin-sdk/package.nix | 3 +- pkgs/by-name/va/vanillatd/package.nix | 25 +- pkgs/by-name/va/vapoursynth-eedi3/package.nix | 17 +- .../by-name/va/vapoursynth-znedi3/package.nix | 13 +- pkgs/by-name/va/vapoursynth/editor.nix | 37 +- pkgs/by-name/va/variety/package.nix | 3 +- pkgs/by-name/va/vault-tasks/package.nix | 39 +- pkgs/by-name/va/vault/package.nix | 27 +- pkgs/by-name/va/vaultwarden/package.nix | 15 +- pkgs/by-name/vc/vcpkg-tool/package.nix | 3 +- pkgs/by-name/vc/vcsi/package.nix | 13 +- pkgs/by-name/ve/vector/package.nix | 48 +- pkgs/by-name/ve/vectorcode/package.nix | 17 +- pkgs/by-name/ve/vectorscan/package.nix | 64 +- pkgs/by-name/ve/vengi-tools/package.nix | 39 +- pkgs/by-name/ve/ventoy/package.nix | 175 ++-- pkgs/by-name/ve/verilator/package.nix | 42 +- pkgs/by-name/ve/vesktop/package.nix | 91 +- pkgs/by-name/vg/vgmstream/package.nix | 44 +- pkgs/by-name/vi/video2x/package.nix | 23 +- pkgs/by-name/vi/viking/package.nix | 34 +- pkgs/by-name/vi/vips/package.nix | 45 +- pkgs/by-name/vi/virglrenderer/package.nix | 44 +- pkgs/by-name/vi/virt-v2v/package.nix | 89 +- pkgs/by-name/vi/virt-viewer/package.nix | 47 +- pkgs/by-name/vi/vis/package.nix | 21 +- pkgs/by-name/vi/viskores/package.nix | 11 +- pkgs/by-name/vi/visp/package.nix | 49 +- pkgs/by-name/vi/visual-hexdiff/package.nix | 21 +- pkgs/by-name/vi/vivaldi/package.nix | 219 ++--- pkgs/by-name/vl/vlang/package.nix | 22 +- pkgs/by-name/vl/vlc/package.nix | 286 +++--- .../by-name/vm/vmware-workstation/package.nix | 25 +- pkgs/by-name/vo/voicevox-engine/package.nix | 41 +- pkgs/by-name/vo/voicevox/package.nix | 23 +- pkgs/by-name/vo/volctl/package.nix | 23 +- pkgs/by-name/vo/volk_2/package.nix | 15 +- pkgs/by-name/vo/voms/package.nix | 19 +- pkgs/by-name/vo/vorta/package.nix | 30 +- pkgs/by-name/vo/voxinput/package.nix | 19 +- pkgs/by-name/vp/vpnc-scripts/package.nix | 59 +- pkgs/by-name/vp/vpnc/package.nix | 32 +- pkgs/by-name/vp/vpp/package.nix | 63 +- pkgs/by-name/vs/vscode-js-debug/package.nix | 3 +- pkgs/by-name/vt/vte/package.nix | 55 +- pkgs/by-name/vu/vulkan-loader/package.nix | 38 +- pkgs/by-name/vu/vulkan-tools/package.nix | 70 +- .../vu/vulkan-validation-layers/package.nix | 35 +- pkgs/by-name/vu/vulnix/package.nix | 25 +- pkgs/by-name/vu/vunnel/package.nix | 17 +- pkgs/by-name/vv/vvvvvv/package.nix | 18 +- pkgs/by-name/w3/w3m/package.nix | 38 +- pkgs/by-name/wa/waffle/package.nix | 62 +- .../wa/waifu2x-converter-cpp/package.nix | 17 +- pkgs/by-name/wa/wakeonlan/package.nix | 18 +- pkgs/by-name/wa/wapiti/package.nix | 17 +- pkgs/by-name/wa/warp-terminal/package.nix | 26 +- pkgs/by-name/wa/warp/package.nix | 23 +- pkgs/by-name/wa/warpd/package.nix | 9 +- pkgs/by-name/wa/warzone2100/package.nix | 44 +- pkgs/by-name/wa/wasm-tools/package.nix | 7 +- pkgs/by-name/wa/waybar/package.nix | 86 +- .../wa/wayland-proxy-virtwl/package.nix | 23 +- pkgs/by-name/wb/wbg/package.nix | 19 +- .../by-name/we/webp-pixbuf-loader/package.nix | 29 +- pkgs/by-name/we/websocat/package.nix | 11 +- pkgs/by-name/we/werf/package.nix | 79 +- pkgs/by-name/we/weston/package.nix | 106 +- pkgs/by-name/we/weylus/package.nix | 72 +- pkgs/by-name/we/wezterm/package.nix | 61 +- pkgs/by-name/wf/wfview/package.nix | 31 +- pkgs/by-name/wg/wget/package.nix | 102 +- pkgs/by-name/wg/wget2/package.nix | 33 +- pkgs/by-name/wg/wgpu-native/examples.nix | 19 +- pkgs/by-name/wg/wgpu-native/package.nix | 3 +- .../wh/where-is-my-sddm-theme/package.nix | 35 +- pkgs/by-name/wh/whisper-cpp/package.nix | 92 +- pkgs/by-name/wi/widelands/package.nix | 3 +- pkgs/by-name/wi/wifite2/package.nix | 3 +- pkgs/by-name/wi/wiiuse/package.nix | 3 +- pkgs/by-name/wi/wiliwili/package.nix | 50 +- pkgs/by-name/wi/windmill/package.nix | 65 +- pkgs/by-name/wi/wireguard-tools/package.nix | 59 +- pkgs/by-name/wi/wivrn/package.nix | 149 ++- pkgs/by-name/wk/wkhtmltopdf/package.nix | 6 +- pkgs/by-name/wl/wl-clipboard-rs/package.nix | 41 +- pkgs/by-name/wl/wl-mirror/package.nix | 23 +- pkgs/by-name/wl/wldash/package.nix | 26 +- pkgs/by-name/wl/wlogout/package.nix | 19 +- pkgs/by-name/wo/wob/package.nix | 3 +- pkgs/by-name/wo/woff2/package.nix | 3 +- pkgs/by-name/wo/wolfssl/package.nix | 65 +- pkgs/by-name/wo/wordgrinder/package.nix | 32 +- pkgs/by-name/wr/wrangler/package.nix | 38 +- pkgs/by-name/wr/wrangler_1/package.nix | 13 +- pkgs/by-name/wx/wxGTK31/package.nix | 80 +- pkgs/by-name/wx/wxGTK32/package.nix | 108 +- pkgs/by-name/wx/wxformbuilder/package.nix | 21 +- pkgs/by-name/wx/wxhexeditor/package.nix | 19 +- pkgs/by-name/x2/x265/package.nix | 134 ++- pkgs/by-name/x3/x3270/package.nix | 45 +- pkgs/by-name/xa/xar/package.nix | 23 +- pkgs/by-name/xa/xarchiver/package.nix | 3 +- pkgs/by-name/xa/xautoclick/package.nix | 31 +- pkgs/by-name/xa/xavs/package.nix | 39 +- pkgs/by-name/xc/xcbuild/package.nix | 41 +- pkgs/by-name/xc/xchm/package.nix | 13 +- pkgs/by-name/xc/xcodegen/package.nix | 14 +- pkgs/by-name/xd/xdg-user-dirs/package.nix | 3 +- pkgs/by-name/xe/xed/package.nix | 3 +- pkgs/by-name/xe/xemu/package.nix | 44 +- pkgs/by-name/xe/xen/package.nix | 157 ++- pkgs/by-name/xf/xfitter/package.nix | 3 +- pkgs/by-name/xg/xgboost/package.nix | 49 +- pkgs/by-name/xi/xiu/package.nix | 13 +- pkgs/by-name/xl/xloadimage/package.nix | 27 +- pkgs/by-name/xl/xlockmore/package.nix | 3 +- pkgs/by-name/xm/xmlcopyeditor/package.nix | 19 +- pkgs/by-name/xn/xnee/package.nix | 25 +- pkgs/by-name/xp/xpar/package.nix | 16 +- pkgs/by-name/xp/xpra/package.nix | 106 +- pkgs/by-name/xp/xprompt/package.nix | 21 +- pkgs/by-name/xq/xquartz/package.nix | 27 +- pkgs/by-name/xr/xreader/package.nix | 3 +- pkgs/by-name/xr/xrootd/package.nix | 108 +- pkgs/by-name/xs/xscreensaver/package.nix | 48 +- pkgs/by-name/xs/xsnow/package.nix | 25 +- pkgs/by-name/xt/xterm/package.nix | 20 +- pkgs/by-name/xv/xvidcore/package.nix | 17 +- pkgs/by-name/xw/xwayland-run/package.nix | 13 +- pkgs/by-name/xx/xxkb/package.nix | 23 +- pkgs/by-name/xy/xyce/package.nix | 100 +- pkgs/by-name/ya/yaak/package.nix | 23 +- pkgs/by-name/ya/yabai/package.nix | 11 +- pkgs/by-name/ya/yacreader/package.nix | 23 +- pkgs/by-name/ya/yambar/package.nix | 45 +- pkgs/by-name/ya/yandex-cloud/package.nix | 39 +- pkgs/by-name/ya/yara-x/package.nix | 19 +- pkgs/by-name/ya/yara/package.nix | 13 +- pkgs/by-name/ya/yarn-berry/package.nix | 3 +- pkgs/by-name/ya/yay/package.nix | 17 +- pkgs/by-name/yc/ycmd/package.nix | 74 +- pkgs/by-name/yd/yder/package.nix | 3 +- pkgs/by-name/ye/yersinia/package.nix | 16 +- pkgs/by-name/yg/ygot/package.nix | 29 +- pkgs/by-name/yo/yoda/package.nix | 15 +- pkgs/by-name/yo/yosys/package.nix | 59 +- pkgs/by-name/yt/yt-dlp/package.nix | 23 +- pkgs/by-name/yt/ytmdesktop/package.nix | 45 +- pkgs/by-name/yu/yubico-piv-tool/package.nix | 3 +- pkgs/by-name/yu/yubihsm-shell/package.nix | 25 +- pkgs/by-name/z3/z3/package.nix | 88 +- pkgs/by-name/z8/z88dk/package.nix | 79 +- pkgs/by-name/za/zap-chip/package.nix | 41 +- pkgs/by-name/zc/zchunk/package.nix | 3 +- pkgs/by-name/ze/zed-editor/package.nix | 241 +++-- pkgs/by-name/ze/zeek/package.nix | 62 +- pkgs/by-name/ze/zeitgeist/package.nix | 3 +- pkgs/by-name/ze/zellij/package.nix | 21 +- pkgs/by-name/ze/zenn-cli/package.nix | 15 +- pkgs/by-name/ze/zepp-simulator/package.nix | 55 +- pkgs/by-name/ze/zeroad-unwrapped/package.nix | 3 +- pkgs/by-name/ze/zerotierone/package.nix | 17 +- pkgs/by-name/zf/zfp/package.nix | 17 +- pkgs/by-name/zi/zile/package.nix | 17 +- pkgs/by-name/zi/zint-qt/package.nix | 28 +- pkgs/by-name/zi/zip/package.nix | 6 +- pkgs/by-name/zi/zita-resampler/package.nix | 15 +- pkgs/by-name/zl/zlib-ng/package.nix | 3 +- pkgs/by-name/zm/zmusic/package.nix | 3 +- pkgs/by-name/zo/zoneminder/package.nix | 75 +- pkgs/by-name/zo/zoom-us/package.nix | 39 +- pkgs/by-name/zs/zsh/package.nix | 147 ++- pkgs/by-name/zu/zulip-term/package.nix | 17 +- pkgs/by-name/zx/zxtune/package.nix | 28 +- pkgs/data/documentation/zeal/default.nix | 3 +- pkgs/data/fonts/open-relay/default.nix | 3 +- pkgs/data/fonts/openmoji/default.nix | 3 +- .../stylesheets/xslt/docbook-xsl/default.nix | 53 +- pkgs/data/themes/adwaita-qt/default.nix | 25 +- pkgs/data/themes/elegant-sddm/default.nix | 23 +- pkgs/data/themes/plata/default.nix | 29 +- pkgs/data/themes/qtcurve/default.nix | 3 +- .../deepin/apps/deepin-music/default.nix | 39 +- .../core/dde-gsettings-schemas/default.nix | 3 +- .../deepin/core/dde-launchpad/default.nix | 25 +- .../deepin/core/deepin-kwin/default.nix | 71 +- .../library/dtk6declarative/default.nix | 17 +- .../deepin/library/dtk6log/default.nix | 3 +- .../deepin/library/dtk6widget/default.nix | 19 +- .../deepin/library/dtklog/default.nix | 3 +- .../deepin/library/gio-qt/default.nix | 22 +- .../enlightenment/enlightenment/default.nix | 38 +- .../gnome-2/desktop/gtksourceview/default.nix | 46 +- .../gnome-2/platform/GConf/default.nix | 15 +- .../extensions/systemd-manager/default.nix | 35 +- .../gnome/gdk-pixbuf-cache-builder.nix | 3 +- pkgs/desktops/gnome/installer.nix | 3 +- .../nixos/gsettings-overrides/default.nix | 17 +- pkgs/desktops/gnome/update.nix | 3 +- .../lomiri-calendar-app/default.nix | 23 +- .../lomiri-camera-app/default.nix | 49 +- .../lomiri-mediaplayer-app/default.nix | 33 +- .../applications/lomiri-music-app/default.nix | 39 +- .../lomiri-system-settings/wrapper.nix | 3 +- .../lomiri/applications/lomiri/default.nix | 53 +- .../applications/morph-browser/default.nix | 27 +- .../lomiri-gsettings-overrides/default.nix | 3 +- .../lomiri/development/geonames/default.nix | 82 +- .../development/lomiri-app-launch/default.nix | 42 +- .../development/trust-store/default.nix | 25 +- .../qml/lomiri-notifications/default.nix | 23 +- .../lomiri-settings-components/default.nix | 19 +- .../lomiri/services/biometryd/default.nix | 37 +- .../lomiri-download-manager/default.nix | 26 +- .../lomiri-history-service/default.nix | 77 +- .../lomiri-telephony-service/default.nix | 33 +- .../services/lomiri-thumbnailer/default.nix | 49 +- .../lomiri-url-dispatcher/default.nix | 29 +- .../lomiri/services/mediascanner2/default.nix | 45 +- pkgs/desktops/lxde/core/lxpanel/default.nix | 3 +- pkgs/desktops/lxqt/libfm-qt/default.nix | 3 +- .../lxqt/xdg-desktop-portal-lxqt/default.nix | 3 +- pkgs/desktops/mate/atril/default.nix | 33 +- pkgs/desktops/mate/engrampa/default.nix | 34 +- pkgs/desktops/mate/libmatemixer/default.nix | 21 +- .../mate/mate-settings-daemon/default.nix | 3 +- .../apps/elementary-music/default.nix | 29 +- .../apps/elementary-photos/default.nix | 45 +- .../pantheon/apps/switchboard/wrapper.nix | 3 +- .../elementary-gsettings-schemas/default.nix | 3 +- .../applications-menu/default.nix | 23 +- .../pantheon/desktop/wingpanel/wrapper.nix | 3 +- .../plasma-5/breeze-plymouth/default.nix | 34 +- .../xfce/applications/mousepad/default.nix | 23 +- .../desktops/xfce/core/libxfce4ui/default.nix | 15 +- .../xfce/core/libxfce4util/default.nix | 15 +- .../xfce/core/libxfce4windowing/default.nix | 15 +- pkgs/desktops/xfce/core/thunar/default.nix | 15 +- .../xfce/core/xfce4-panel/default.nix | 15 +- .../xfce/core/xfce4-settings/default.nix | 50 +- pkgs/desktops/xfce/core/xfconf/default.nix | 15 +- pkgs/desktops/xfce/mkXfceDerivation.nix | 3 +- .../xfce4-dockbarx-plugin/default.nix | 3 +- .../xfce4-sensors-plugin/default.nix | 3 +- .../xfce/thunar-plugins/vcs/default.nix | 27 +- .../ada-modules/gnatcoll/bindings.nix | 3 +- pkgs/development/ada-modules/gnatcoll/db.nix | 28 +- .../ada-modules/gnatprove/default.nix | 60 +- pkgs/development/ada-modules/gpr2/default.nix | 19 +- .../development/ada-modules/gprbuild/boot.nix | 19 +- .../ada-modules/gprbuild/default.nix | 21 +- .../beam-modules/build-erlang-mk.nix | 9 +- .../development/beam-modules/build-rebar3.nix | 12 +- pkgs/development/beam-modules/mix-release.nix | 138 ++- .../beam-modules/rebar3-release.nix | 3 +- .../compilers/binaryen/default.nix | 43 +- pkgs/development/compilers/c0/default.nix | 30 +- .../compilers/chicken/4/chicken.nix | 34 +- .../compilers/chicken/4/eggDerivation.nix | 3 +- .../compilers/chicken/5/chicken.nix | 46 +- .../compilers/chicken/5/eggDerivation.nix | 3 +- .../compilers/corretto/mk-corretto.nix | 37 +- .../development/compilers/crystal/default.nix | 92 +- pkgs/development/compilers/dart/default.nix | 34 +- pkgs/development/compilers/djgpp/default.nix | 33 +- .../compilers/dotnet/build-dotnet.nix | 69 +- .../compilers/dotnet/combine-packages.nix | 21 +- pkgs/development/compilers/dotnet/default.nix | 13 +- .../development/compilers/dotnet/packages.nix | 62 +- pkgs/development/compilers/dotnet/sigtool.nix | 12 +- pkgs/development/compilers/dotnet/stage0.nix | 76 +- pkgs/development/compilers/dotnet/vmr.nix | 495 +++++----- pkgs/development/compilers/dotnet/wrapper.nix | 45 +- pkgs/development/compilers/ecl/16.1.2.nix | 71 +- pkgs/development/compilers/ecl/default.nix | 48 +- .../development/compilers/elm/lib/default.nix | 18 +- .../factor-lang/mk-factor-application.nix | 9 +- .../compilers/factor-lang/wrapper.nix | 101 +- pkgs/development/compilers/fbc/default.nix | 25 +- .../build-flutter-application.nix | 11 +- .../compilers/flutter/engine/default.nix | 23 +- .../compilers/flutter/engine/package.nix | 134 ++- .../compilers/flutter/flutter-tools.nix | 17 +- .../development/compilers/flutter/flutter.nix | 41 +- .../development/compilers/flutter/wrapper.nix | 109 +-- pkgs/development/compilers/fpc/default.nix | 21 +- pkgs/development/compilers/fpc/lazarus.nix | 40 +- pkgs/development/compilers/fpc/libqtpas.nix | 13 +- pkgs/development/compilers/gambit/build.nix | 73 +- .../compilers/gcc/common/builder.nix | 213 ++-- .../compilers/gcc/common/dependencies.nix | 56 +- .../compilers/gcc/common/strip-attributes.nix | 75 +- pkgs/development/compilers/gcc/default.nix | 148 +-- .../compilers/gcc/ng/common/gcc/default.nix | 158 ++- .../gcc/ng/common/libgcc/default.nix | 178 ++-- .../gcc/ng/common/libgfortran/default.nix | 165 ++-- .../gcc/ng/common/libiberty/default.nix | 3 +- pkgs/development/compilers/gcc/ng/default.nix | 3 +- pkgs/development/compilers/gerbil/build.nix | 23 +- .../compilers/ghc/8.10.7-binary.nix | 98 +- pkgs/development/compilers/ghc/8.10.7.nix | 608 ++++++------ .../compilers/ghc/8.6.5-binary.nix | 52 +- .../compilers/ghc/9.0.2-binary.nix | 110 +-- .../compilers/ghc/9.2.4-binary.nix | 77 +- .../compilers/ghc/9.6.3-binary.nix | 54 +- .../compilers/ghc/9.8.4-binary.nix | 54 +- .../compilers/ghc/common-hadrian.nix | 488 +++++----- .../ghc/common-make-native-bignum.nix | 720 +++++++------- .../compilers/ghcjs/8.10/default.nix | 27 +- .../compilers/gnat-bootstrap/default.nix | 316 +++--- pkgs/development/compilers/go/1.23.nix | 57 +- pkgs/development/compilers/go/1.24.nix | 57 +- pkgs/development/compilers/go/1.25.nix | 57 +- .../community-edition/buildGraalvm.nix | 53 +- .../community-edition/buildGraalvmProduct.nix | 15 +- pkgs/development/compilers/halide/default.nix | 85 +- pkgs/development/compilers/haxe/default.nix | 15 +- .../compilers/idris2/build-idris.nix | 6 +- pkgs/development/compilers/idris2/idris2.nix | 3 +- pkgs/development/compilers/idris2/pack.nix | 3 +- .../compilers/jetbrains-jdk/17.nix | 3 +- .../compilers/jetbrains-jdk/default.nix | 3 +- .../compilers/jetbrains-jdk/jcef.nix | 133 ++- .../compilers/julia/generic-bin.nix | 98 +- pkgs/development/compilers/julia/generic.nix | 55 +- .../compilers/llvm/common/bolt/default.nix | 3 +- .../compilers/llvm/common/clang/default.nix | 318 +++--- .../llvm/common/compiler-rt/default.nix | 166 ++-- .../compilers/llvm/common/default.nix | 125 ++- .../compilers/llvm/common/libc/default.nix | 40 +- .../compilers/llvm/common/libclc/default.nix | 40 +- .../compilers/llvm/common/libcxx/default.nix | 168 ++-- .../llvm/common/libunwind/default.nix | 32 +- .../compilers/llvm/common/lld/default.nix | 35 +- .../compilers/llvm/common/lldb/default.nix | 166 ++-- .../compilers/llvm/common/llvm/default.nix | 114 +-- .../compilers/llvm/common/mlir/default.nix | 49 +- .../compilers/llvm/common/openmp/default.nix | 71 +- .../compilers/llvm/common/tblgen.nix | 34 +- pkgs/development/compilers/llvm/default.nix | 3 +- pkgs/development/compilers/mlton/20130715.nix | 94 +- pkgs/development/compilers/mono/generic.nix | 19 +- .../development/compilers/obliv-c/default.nix | 15 +- pkgs/development/compilers/ocaml/4.00.1.nix | 26 +- pkgs/development/compilers/open-watcom/v2.nix | 97 +- .../development/compilers/openjdk/generic.nix | 857 ++++++++-------- pkgs/development/compilers/osl/default.nix | 33 +- pkgs/development/compilers/p4c/default.nix | 31 +- pkgs/development/compilers/polyml/5.6.nix | 21 +- pkgs/development/compilers/polyml/5.7.nix | 21 +- pkgs/development/compilers/polyml/default.nix | 21 +- .../purescript/purescript/default.nix | 21 +- pkgs/development/compilers/rust/binary.nix | 69 +- pkgs/development/compilers/rust/rustc.nix | 140 +-- pkgs/development/compilers/sbcl/default.nix | 79 +- .../development/compilers/shaderc/default.nix | 17 +- .../compilers/swift/compiler/default.nix | 419 ++++---- .../compilers/swift/libdispatch/default.nix | 13 +- .../compilers/swift/sourcekit-lsp/default.nix | 36 +- .../compilers/swift/swift-driver/default.nix | 20 +- .../compilers/swift/swift-format/default.nix | 20 +- .../compilers/swift/swiftpm/default.nix | 125 ++- .../compilers/swift/swiftpm2nix/support.nix | 39 +- .../compilers/swift/xctest/default.nix | 3 +- .../compilers/temurin-bin/jdk-linux-base.nix | 20 +- pkgs/development/compilers/vala/default.nix | 38 +- pkgs/development/compilers/zig/default.nix | 3 +- pkgs/development/compilers/zig/generic.nix | 38 +- pkgs/development/compilers/zig/hook.nix | 11 +- pkgs/development/compilers/zig/passthru.nix | 15 +- pkgs/development/compilers/zulu/common.nix | 142 ++- .../coq-modules/QuickChick/default.nix | 13 +- pkgs/development/coq-modules/VST/default.nix | 61 +- .../coq-modules/hydra-battles/default.nix | 3 +- .../coq-modules/mathcomp/default.nix | 29 +- .../coq-modules/metacoq/default.nix | 6 +- .../coq-modules/metarocq/default.nix | 3 +- .../coq-modules/simple-io/default.nix | 15 +- .../coq-modules/smtcoq/default.nix | 23 +- .../vscoq-language-server/default.nix | 45 +- .../cuda-modules/_cuda/fixups/cuda_cudart.nix | 12 +- .../cuda-modules/_cuda/fixups/cuda_nvcc.nix | 8 +- .../_cuda/fixups/nsight_compute.nix | 34 +- .../_cuda/fixups/nsight_systems.nix | 24 +- .../cuda-library-samples/generic.nix | 34 +- .../cuda-modules/cuda-samples/generic.nix | 17 +- .../cuda-modules/cudatoolkit/default.nix | 391 ++++---- .../generic-builders/manifest.nix | 35 +- .../packages/cudnn-frontend/package.nix | 17 +- .../cuda-modules/packages/nccl-tests.nix | 43 +- .../cuda-modules/packages/nccl.nix | 63 +- .../cuda-modules/packages/saxpy/package.nix | 13 +- .../em-modules/generic/default.nix | 29 +- .../embedded/arduino/arduino-core/default.nix | 3 +- pkgs/development/embedded/platformio/core.nix | 174 ++-- .../gnuradio-modules/bladeRF/default.nix | 46 +- .../gnuradio-modules/fosphor/default.nix | 64 +- .../gnuradio-modules/lora_sdr/default.nix | 21 +- .../gnuradio-modules/osmosdr/default.nix | 72 +- .../haskell-modules/configuration-common.nix | 276 +++--- .../haskell-modules/configuration-darwin.nix | 104 +- .../configuration-ghc-9.12.x.nix | 8 +- .../configuration-ghc-9.4.x.nix | 3 +- .../haskell-modules/configuration-nix.nix | 375 ++++--- .../haskell-modules/generic-builder.nix | 614 ++++++------ .../haskell-modules/hackage-packages.nix | 9 +- .../haskell-modules/lib/compose.nix | 48 +- .../haskell-modules/make-package-set.nix | 21 +- .../haskell-modules/with-packages-wrapper.nix | 187 ++-- .../idris-modules/build-idris-package.nix | 3 +- .../development/interpreters/acl2/default.nix | 114 ++- .../interpreters/bqn/cbqn/default.nix | 127 ++- .../interpreters/clisp/default.nix | 81 +- .../interpreters/dzaima-apl/default.nix | 68 +- .../interpreters/erlang/generic-builder.nix | 67 +- .../interpreters/gnudatalanguage/default.nix | 69 +- pkgs/development/interpreters/guile/1.8.nix | 37 +- pkgs/development/interpreters/guile/2.0.nix | 110 +-- pkgs/development/interpreters/guile/2.2.nix | 80 +- pkgs/development/interpreters/guile/3.0.nix | 157 ++- .../interpreters/janet/default.nix | 19 +- .../interpreters/lfe/generic-builder.nix | 3 +- .../lua-5/build-luarocks-package.nix | 48 +- .../interpreters/lua-5/default.nix | 3 +- .../interpreters/lua-5/interpreter.nix | 25 +- .../interpreters/lua-5/wrapper.nix | 59 +- .../interpreters/luajit/default.nix | 17 +- .../interpreters/octave/build-env.nix | 87 +- .../octave/build-octave-package.nix | 33 +- .../interpreters/octave/default.nix | 131 ++- .../interpreters/perl/interpreter.nix | 198 ++-- .../development/interpreters/perl/wrapper.nix | 41 +- pkgs/development/interpreters/php/generic.nix | 3 +- .../python/cpython/2.7/default.nix | 311 +++--- .../interpreters/python/cpython/default.nix | 501 +++++----- .../interpreters/python/hooks/default.nix | 57 +- .../python/mk-python-derivation.nix | 209 ++-- .../interpreters/python/pypy/default.nix | 313 +++--- .../interpreters/python/pypy/prebuilt.nix | 58 +- .../interpreters/python/pypy/prebuilt_2_7.nix | 58 +- .../python/python2/mk-python-derivation.nix | 84 +- .../development/interpreters/python/tests.nix | 13 +- .../interpreters/python/wrapper.nix | 43 +- .../interpreters/rakudo/moarvm.nix | 23 +- .../development/interpreters/ruby/default.nix | 313 +++--- .../interpreters/spidermonkey/common.nix | 111 +-- .../interpreters/supercollider/default.nix | 6 +- pkgs/development/interpreters/tcl/generic.nix | 17 +- .../interpreters/tcl/mk-tcl-derivation.nix | 3 +- .../interpreters/wasmer/default.nix | 19 +- pkgs/development/julia-modules/depot.nix | 3 +- .../libraries/abseil-cpp/202103.nix | 68 +- .../libraries/abseil-cpp/202301.nix | 46 +- .../libraries/abseil-cpp/202401.nix | 17 +- .../libraries/abseil-cpp/202407.nix | 17 +- .../libraries/accounts-qml-module/default.nix | 29 +- pkgs/development/libraries/agg/default.nix | 34 +- pkgs/development/libraries/allegro/5.nix | 84 +- .../libraries/appstream/default.nix | 107 +- pkgs/development/libraries/aspell/default.nix | 3 +- .../libraries/aspell/dictionaries.nix | 147 +-- .../libraries/astal/buildAstalModule.nix | 3 +- pkgs/development/libraries/avahi/default.nix | 80 +- .../libraries/bashup-events/generic.nix | 3 +- pkgs/development/libraries/boost/generic.nix | 45 +- pkgs/development/libraries/botan/default.nix | 101 +- pkgs/development/libraries/bullet/default.nix | 21 +- .../libraries/bullet/roboschool-fork.nix | 19 +- pkgs/development/libraries/capstone/4.nix | 13 +- .../libraries/capstone/default.nix | 22 +- pkgs/development/libraries/catch2/3.nix | 21 +- .../libraries/ceres-solver/default.nix | 19 +- .../libraries/clucene-core/2.x.nix | 72 +- .../libraries/ctranslate2/default.nix | 16 +- pkgs/development/libraries/db/generic.nix | 13 +- pkgs/development/libraries/dbus/default.nix | 72 +- pkgs/development/libraries/draco/default.nix | 38 +- .../libraries/drumstick/default.nix | 3 +- pkgs/development/libraries/embree/default.nix | 3 +- pkgs/development/libraries/enchant/2.x.nix | 25 +- pkgs/development/libraries/ffmpeg/generic.nix | 559 ++++++----- pkgs/development/libraries/flint/3.nix | 46 +- pkgs/development/libraries/fltk/common.nix | 60 +- .../libraries/fontconfig/default.nix | 21 +- .../libraries/fontconfig/make-fonts-conf.nix | 43 +- pkgs/development/libraries/fox/default.nix | 31 +- pkgs/development/libraries/g2o/default.nix | 25 +- .../libraries/gcc/libgcc/default.nix | 161 ++- pkgs/development/libraries/gcr/4.nix | 38 +- pkgs/development/libraries/gcr/default.nix | 40 +- pkgs/development/libraries/gdcm/default.nix | 133 ++- .../libraries/gdk-pixbuf/default.nix | 106 +- pkgs/development/libraries/gecode/default.nix | 3 +- pkgs/development/libraries/gegl/default.nix | 80 +- .../development/libraries/gettext/default.nix | 95 +- pkgs/development/libraries/glew/default.nix | 3 +- pkgs/development/libraries/glibc/common.nix | 368 ++++--- pkgs/development/libraries/gmime/2.nix | 9 +- pkgs/development/libraries/gmime/3.nix | 49 +- pkgs/development/libraries/gmp/6.x.nix | 41 +- pkgs/development/libraries/gnutls/default.nix | 98 +- .../gobject-introspection/default.nix | 121 ++- .../gobject-introspection/wrapper.nix | 81 +- pkgs/development/libraries/gpgme/default.nix | 24 +- pkgs/development/libraries/gssdp/1.6.nix | 3 +- pkgs/development/libraries/gssdp/default.nix | 28 +- .../libraries/gstreamer/bad/default.nix | 475 +++++---- .../libraries/gstreamer/base/default.nix | 176 ++-- .../libraries/gstreamer/core/default.nix | 80 +- .../libraries/gstreamer/devtools/default.nix | 42 +- .../libraries/gstreamer/ges/default.nix | 44 +- .../libraries/gstreamer/good/default.nix | 308 +++--- .../gstreamer/icamerasrc/default.nix | 23 +- .../libraries/gstreamer/libav/default.nix | 38 +- .../libraries/gstreamer/rs/default.nix | 69 +- .../gstreamer/rtsp-server/default.nix | 38 +- .../libraries/gstreamer/ugly/default.nix | 95 +- .../libraries/gstreamer/vaapi/default.nix | 74 +- pkgs/development/libraries/gtk/2.x.nix | 118 ++- pkgs/development/libraries/gtk/3.x.nix | 117 ++- pkgs/development/libraries/gtk/4.x.nix | 284 +++--- pkgs/development/libraries/gupnp/default.nix | 3 +- pkgs/development/libraries/hamlib/4.nix | 59 +- pkgs/development/libraries/hamlib/default.nix | 59 +- pkgs/development/libraries/hivex/default.nix | 38 +- pkgs/development/libraries/icu/make-icu.nix | 56 +- .../libraries/irrlicht/default.nix | 18 +- pkgs/development/libraries/itk/generic.nix | 126 ++- .../development/libraries/jabcode/default.nix | 3 +- .../libraries/java/saxon/default.nix | 37 +- .../libraries/jemalloc/default.nix | 57 +- .../kde-frameworks/kdoctools/default.nix | 21 +- .../kde-frameworks/kinit/default.nix | 15 +- .../libraries/kde-frameworks/kio/default.nix | 76 +- .../kde-frameworks/knotifications.nix | 25 +- .../kde-frameworks/solid/default.nix | 3 +- .../libraries/kerberos/heimdal.nix | 72 +- pkgs/development/libraries/kerberos/krb5.nix | 92 +- .../development/libraries/libbutl/default.nix | 13 +- pkgs/development/libraries/libcec/default.nix | 16 +- .../libraries/libcommuni/default.nix | 19 +- .../libraries/libdevil/default.nix | 25 +- .../libraries/libextractor/default.nix | 68 +- pkgs/development/libraries/libgda/5.x.nix | 23 +- pkgs/development/libraries/libgda/6.x.nix | 29 +- .../libraries/libhandy/default.nix | 92 +- .../libraries/libiconv/default.nix | 3 +- .../libraries/libinput/default.nix | 64 +- pkgs/development/libraries/libint/default.nix | 68 +- .../libraries/libopenshot/default.nix | 35 +- .../libraries/libpulsar/default.nix | 33 +- .../libraries/libqtdbusmock/default.nix | 17 +- pkgs/development/libraries/librdf/redland.nix | 39 +- .../libraries/librealsense/default.nix | 92 +- .../libraries/libressl/default.nix | 12 +- .../development/libraries/librest/default.nix | 19 +- pkgs/development/libraries/libsoup/3.x.nix | 49 +- .../development/libraries/libsoup/default.nix | 63 +- .../development/libraries/libubox/default.nix | 7 +- .../libraries/libunique/default.nix | 3 +- .../libraries/libunwind/default.nix | 27 +- pkgs/development/libraries/libva/1.nix | 23 +- pkgs/development/libraries/libva/default.nix | 43 +- .../development/libraries/libwnck/default.nix | 27 +- .../development/libraries/libxml2/default.nix | 74 +- .../development/libraries/libxslt/default.nix | 51 +- .../libraries/liquid-dsp/default.nix | 15 +- .../development/libraries/medfile/default.nix | 43 +- pkgs/development/libraries/mesa/default.nix | 305 +++--- pkgs/development/libraries/mpich/default.nix | 38 +- .../development/libraries/ncurses/default.nix | 158 ++- pkgs/development/libraries/ngtcp2/default.nix | 3 +- pkgs/development/libraries/nss/generic.nix | 87 +- .../development/libraries/nuspell/default.nix | 28 +- pkgs/development/libraries/ogre/default.nix | 70 +- .../development/libraries/opencolorio/1.x.nix | 26 +- .../libraries/opencolorio/default.nix | 60 +- pkgs/development/libraries/opencv/4.x.nix | 540 +++++----- pkgs/development/libraries/opencv/tests.nix | 78 +- pkgs/development/libraries/openexr/2.nix | 3 +- .../development/libraries/openssl/default.nix | 208 ++-- pkgs/development/libraries/pcre/default.nix | 26 +- pkgs/development/libraries/pcre2/default.nix | 17 +- .../libraries/physics/hepmc3/default.nix | 23 +- .../libraries/physics/pythia/default.nix | 29 +- .../libraries/pipewire/default.nix | 123 ++- .../libraries/pipewire/wireplumber.nix | 52 +- .../development/libraries/poppler/default.nix | 116 ++- .../libraries/protobuf/generic.nix | 21 +- .../libraries/qcustomplot/default.nix | 13 +- .../development/libraries/qdjango/default.nix | 23 +- .../libraries/qgnomeplatform/default.nix | 40 +- .../libraries/qmenumodel/default.nix | 21 +- .../libraries/qscintilla/default.nix | 3 +- .../libraries/qt-5/5.15/default.nix | 97 +- .../libraries/qt-5/modules/qtbase.nix | 603 ++++++------ .../libraries/qt-5/modules/qtimageformats.nix | 23 +- .../libraries/qt-5/modules/qtmultimedia.nix | 21 +- .../libraries/qt-5/modules/qtsystems.nix | 32 +- .../libraries/qt-5/modules/qttools.nix | 3 +- .../libraries/qt-5/modules/qtwebchannel.nix | 3 +- .../libraries/qt-5/modules/qtwebengine.nix | 362 ++++--- .../libraries/qt-5/modules/qtwebkit.nix | 18 +- pkgs/development/libraries/qt-5/qtModule.nix | 48 +- pkgs/development/libraries/qt-6/default.nix | 13 +- .../libraries/qt-6/modules/qtbase/default.nix | 233 +++-- .../qt-6/modules/qtdeclarative/default.nix | 19 +- .../qt-6/modules/qtmultimedia/default.nix | 62 +- .../libraries/qt-6/modules/qtsvg.nix | 21 +- .../qt-6/modules/qttools/default.nix | 3 +- .../qt-6/modules/qtwebengine/default.nix | 331 ++++--- .../libraries/qt-6/modules/qtwebview.nix | 3 +- pkgs/development/libraries/qt-6/qtModule.nix | 3 +- .../development/libraries/qtspell/default.nix | 17 +- .../qtstyleplugin-kvantum/default.nix | 23 +- pkgs/development/libraries/quarto/default.nix | 3 +- .../development/libraries/quictls/default.nix | 70 +- pkgs/development/libraries/readline/7.0.nix | 3 +- .../science/astronomy/indilib/default.nix | 17 +- .../astronomy/indilib/indi-3rdparty.nix | 26 +- .../libraries/science/math/magma/generic.nix | 129 ++- .../science/math/openblas/default.nix | 102 +- .../science/math/suitesparse/default.nix | 79 +- .../science/math/trilinos/default.nix | 3 +- .../libraries/silgraphite/graphite2.nix | 15 +- pkgs/development/libraries/sqlite/default.nix | 32 +- pkgs/development/libraries/sqlite/sqlar.nix | 16 +- pkgs/development/libraries/tinyxml/2.6.2.nix | 29 +- pkgs/development/libraries/tk/generic.nix | 46 +- .../libraries/tpm2-tss/default.nix | 76 +- .../libraries/unixODBCDrivers/default.nix | 3 +- pkgs/development/libraries/vigra/default.nix | 17 +- pkgs/development/libraries/vtk/generic.nix | 109 +-- .../development/libraries/wayland/default.nix | 71 +- .../development/libraries/wayland/scanner.nix | 3 +- .../libraries/waylandpp/default.nix | 51 +- .../libraries/webkitgtk/default.nix | 172 ++-- .../development/libraries/wlroots/default.nix | 46 +- pkgs/development/libraries/wt/default.nix | 19 +- pkgs/development/libraries/xapian/default.nix | 13 +- .../libraries/xdg-desktop-portal/default.nix | 70 +- pkgs/development/libraries/zlib/default.nix | 28 +- pkgs/development/lisp-modules/packages.nix | 10 +- .../lua-modules/generic/default.nix | 3 +- pkgs/development/lua-modules/luv/default.nix | 21 +- pkgs/development/lua-modules/luv/lib.nix | 3 +- pkgs/development/misc/msp430/mspdebug.nix | 9 +- .../development/misc/msp430/mspds/default.nix | 18 +- pkgs/development/misc/newlib/default.nix | 143 ++- .../misc/resholve/resholve-utils.nix | 58 +- pkgs/development/misc/resholve/test.nix | 72 +- .../mobile/androidenv/build-tools.nix | 33 +- .../mobile/androidenv/cmdline-tools.nix | 3 +- .../androidenv/deploy-androidpackages.nix | 57 +- .../mobile/androidenv/emulate-app.nix | 23 +- .../mobile/androidenv/examples/shell.nix | 13 +- .../mobile/androidenv/ndk-bundle/default.nix | 3 +- pkgs/development/node-packages/node-env.nix | 50 +- pkgs/development/node-packages/overrides.nix | 18 +- .../ocaml-modules/camlzip/default.nix | 12 +- pkgs/development/ocaml-modules/eio/main.nix | 13 +- .../ocaml-modules/elina/default.nix | 3 +- .../ocaml-modules/elpi/default.nix | 60 +- .../janestreet/janePackage_0_12.nix | 3 +- .../janestreet/janePackage_0_14.nix | 3 +- .../janestreet/janePackage_0_15.nix | 3 +- .../janestreet/janePackage_0_16.nix | 3 +- .../janestreet/janePackage_0_17.nix | 3 +- .../ocaml-modules/lablgtk/default.nix | 3 +- .../ocaml-modules/lambda-term/default.nix | 21 +- .../ocaml-modules/mirage-crypto/default.nix | 13 +- .../ocaml-modules/mirage-crypto/ec.nix | 15 +- .../development/ocaml-modules/num/default.nix | 3 +- .../ocaml-modules/ocamlformat/generic.nix | 57 +- .../ocaml-modules/ocamlformat/ocamlformat.nix | 13 +- .../ocaml-modules/odoc-parser/default.nix | 3 +- .../ppx_deriving_yojson/default.nix | 3 +- .../ocaml-modules/ppxlib/default.nix | 19 +- .../ocaml-modules/sail/default.nix | 19 +- .../ocaml-modules/sedlex/default.nix | 15 +- .../ocaml-modules/tcpip/default.nix | 51 +- .../ocaml-modules/uunf/default.nix | 3 +- .../ocaml-modules/uuseg/default.nix | 3 +- pkgs/development/ocaml-modules/vg/default.nix | 23 +- .../perl-modules/Tirex/default.nix | 3 +- .../perl-modules/generic/default.nix | 3 +- .../strip-nondeterminism/default.nix | 17 +- .../php-packages/datadog_trace/default.nix | 15 +- .../php-packages/mongodb/default.nix | 23 +- .../php-packages/relay/default.nix | 79 +- .../php-packages/snuffleupagus/default.nix | 11 +- .../python-modules/aardwolf/default.nix | 3 +- .../python-modules/accelerate/default.nix | 161 ++- .../python-modules/accupy/default.nix | 3 +- .../python-modules/acquire/default.nix | 3 +- .../python-modules/adb-shell/default.nix | 3 +- .../python-modules/adblock/default.nix | 24 +- .../python-modules/aenum/default.nix | 29 +- .../python-modules/afdko/default.nix | 100 +- .../python-modules/aioboto3/default.nix | 20 +- .../python-modules/aiobotocore/default.nix | 3 +- .../python-modules/aiobtclientrpc/default.nix | 3 +- .../python-modules/aiocache/default.nix | 30 +- .../python-modules/aioesphomeapi/default.nix | 3 +- .../python-modules/aioftp/default.nix | 3 +- .../python-modules/aiogram/default.nix | 3 +- .../python-modules/aiohomeconnect/default.nix | 3 +- .../aiohttp-client-cache/default.nix | 3 +- .../python-modules/aiohttp-socks/default.nix | 3 +- .../python-modules/aiohttp/default.nix | 73 +- .../python-modules/aioimaplib/default.nix | 17 +- .../python-modules/aiojobs/default.nix | 3 +- .../python-modules/aiomisc/default.nix | 12 +- .../python-modules/aioprometheus/default.nix | 3 +- .../python-modules/aioredis/default.nix | 3 +- .../python-modules/aiorpcx/default.nix | 3 +- .../python-modules/aiortm/default.nix | 3 +- .../python-modules/aiosmtpd/default.nix | 3 +- .../python-modules/aioswitcher/default.nix | 25 +- .../python-modules/aiovlc/default.nix | 3 +- .../python-modules/aioxmpp/default.nix | 33 +- .../python-modules/ale-py/default.nix | 49 +- .../python-modules/alembic/default.nix | 19 +- .../python-modules/alpha-vantage/default.nix | 3 +- .../python-modules/altair/default.nix | 3 +- .../python-modules/amaranth/default.nix | 15 +- .../python-modules/amqp/default.nix | 17 +- .../python-modules/androguard/default.nix | 49 +- .../python-modules/androidtv/default.nix | 13 +- .../python-modules/anndata/default.nix | 103 +- .../python-modules/ansible-runner/default.nix | 26 +- .../python-modules/ansible/core.nix | 3 +- .../python-modules/anyio/default.nix | 65 +- .../python-modules/anywidget/default.nix | 3 +- .../python-modules/apache-beam/default.nix | 360 ++++--- .../python-modules/apischema/default.nix | 3 +- .../python-modules/apispec/default.nix | 6 +- .../apple-weatherkit/default.nix | 3 +- .../appthreat-vulnerability-db/default.nix | 3 +- .../python-modules/apscheduler/default.nix | 23 +- .../python-modules/arelle/default.nix | 23 +- .../python-modules/argilla/default.nix | 57 +- .../argparse-manpage/default.nix | 3 +- .../python-modules/aria2p/default.nix | 6 +- .../array-api-compat/default.nix | 3 +- .../python-modules/array-record/default.nix | 3 +- .../python-modules/ase/default.nix | 26 +- .../python-modules/asn1tools/default.nix | 3 +- .../asteroid-filterbanks/default.nix | 41 +- .../python-modules/astropy/default.nix | 51 +- .../async-upnp-client/default.nix | 3 +- .../python-modules/asyncssh/default.nix | 3 +- .../python-modules/asyncua/default.nix | 35 +- .../python-modules/asyncwhois/default.nix | 3 +- .../python-modules/auth0-python/default.nix | 3 +- .../python-modules/autobahn/default.nix | 15 +- .../python-modules/avwx-engine/default.nix | 3 +- .../python-modules/aws-xray-sdk/default.nix | 3 +- .../python-modules/ax-platform/default.nix | 43 +- .../python-modules/azure-core/default.nix | 6 +- .../azure-cosmosdb-table/default.nix | 3 +- .../azure-kusto-data/default.nix | 3 +- .../azure-kusto-ingest/default.nix | 3 +- .../azure-mgmt-advisor/default.nix | 3 +- .../azure-mgmt-appcontainers/default.nix | 3 +- .../default.nix | 3 +- .../azure-mgmt-authorization/default.nix | 3 +- .../azure-mgmt-batchai/default.nix | 3 +- .../azure-mgmt-datamigration/default.nix | 3 +- .../azure-mgmt-devtestlabs/default.nix | 3 +- .../azure-mgmt-hanaonazure/default.nix | 3 +- .../azure-mgmt-iotcentral/default.nix | 3 +- .../azure-mgmt-iothub/default.nix | 3 +- .../azure-mgmt-managementgroups/default.nix | 3 +- .../azure-mgmt-maps/default.nix | 3 +- .../default.nix | 3 +- .../azure-mgmt-monitor/default.nix | 3 +- .../azure-mgmt-policyinsights/default.nix | 3 +- .../azure-mgmt-rdbms/default.nix | 3 +- .../azure-mgmt-recoveryservices/default.nix | 3 +- .../azure-mgmt-redis/default.nix | 3 +- .../azure-mgmt-reservations/default.nix | 3 +- .../azure-mgmt-search/default.nix | 3 +- .../python-modules/azure-mgmt-sql/default.nix | 3 +- .../azure-mgmt-subscription/default.nix | 3 +- .../azure-mgmt-trafficmanager/default.nix | 3 +- .../azure-storage-common/default.nix | 3 +- .../azure-storage-file/default.nix | 3 +- .../python-modules/b2sdk/default.nix | 20 +- .../python-modules/babel/default.nix | 3 +- .../python-modules/bambi/default.nix | 95 +- .../python-modules/banks/default.nix | 3 +- .../python-modules/basedmypy/default.nix | 61 +- .../bc-detect-secrets/default.nix | 3 +- .../python-modules/beaker/default.nix | 19 +- .../python-modules/beanhub-cli/default.nix | 6 +- .../python-modules/beartype/default.nix | 17 +- .../python-modules/beautifulsoup4/default.nix | 3 +- .../python-modules/bellows/default.nix | 3 +- .../python-modules/bentoml/default.nix | 17 +- .../python-modules/betterproto/default.nix | 3 +- .../bimmer-connected/default.nix | 3 +- .../python-modules/biosppy/default.nix | 3 +- .../python-modules/black/default.nix | 76 +- .../python-modules/blackjax/default.nix | 39 +- .../python-modules/blocksat-cli/default.nix | 3 +- .../python-modules/blosc2/default.nix | 3 +- .../python-modules/bork/default.nix | 19 +- .../python-modules/botorch/default.nix | 47 +- .../python-modules/bottle/default.nix | 29 +- .../python-modules/bpython/default.nix | 3 +- .../python-modules/bravado-core/default.nix | 3 +- .../python-modules/breezy/default.nix | 27 +- .../python-modules/build/default.nix | 38 +- .../python-modules/bundlewrap/default.nix | 3 +- .../python-modules/bytewax/default.nix | 3 +- .../python-modules/cachecontrol/default.nix | 3 +- .../python-modules/cairocffi/default.nix | 3 +- .../camel-converter/default.nix | 3 +- .../python-modules/canals/default.nix | 3 +- .../python-modules/canmatrix/default.nix | 3 +- .../python-modules/cantools/default.nix | 3 +- .../python-modules/cartopy/default.nix | 3 +- .../cassandra-driver/default.nix | 3 +- .../python-modules/cattrs/default.nix | 36 +- .../python-modules/causal-conv1d/default.nix | 3 +- .../python-modules/celery/default.nix | 42 +- .../python-modules/cement/default.nix | 3 +- .../python-modules/certomancer/default.nix | 3 +- .../python-modules/cf-xarray/default.nix | 3 +- .../python-modules/cfn-lint/default.nix | 3 +- .../python-modules/cgal/default.nix | 25 +- .../python-modules/channels/default.nix | 3 +- .../python-modules/check-manifest/default.nix | 3 +- .../python-modules/cheroot/default.nix | 19 +- .../python-modules/cherrypy/default.nix | 57 +- .../python-modules/cirq-core/default.nix | 70 +- .../python-modules/cirq-google/default.nix | 3 +- .../python-modules/claripy/default.nix | 3 +- .../python-modules/cleanlab/default.nix | 35 +- .../python-modules/cli-helpers/default.nix | 6 +- .../click-odoo-contrib/default.nix | 3 +- .../clickhouse-connect/default.nix | 13 +- .../python-modules/cloudpathlib/default.nix | 3 +- .../python-modules/cmd2/default.nix | 3 +- .../python-modules/cmdstanpy/default.nix | 25 +- .../python-modules/coffea/default.nix | 3 +- .../coinmetrics-api-client/default.nix | 3 +- .../python-modules/comicapi/default.nix | 3 +- .../python-modules/commoncode/default.nix | 29 +- .../python-modules/configargparse/default.nix | 3 +- .../confluent-kafka/default.nix | 3 +- .../connected-components-3d/default.nix | 3 +- .../python-modules/connexion/default.nix | 28 +- .../python-modules/constantly/default.nix | 3 +- .../construct-typing/default.nix | 21 +- .../python-modules/construct/default.nix | 6 +- .../python-modules/controku/default.nix | 32 +- .../python-modules/corallium/default.nix | 17 +- .../python-modules/cot/default.nix | 3 +- .../python-modules/coverage/default.nix | 39 +- .../craft-application/default.nix | 72 +- .../python-modules/craft-parts/default.nix | 39 +- .../python-modules/cryptography/default.nix | 17 +- .../python-modules/css-inline/default.nix | 19 +- .../python-modules/cssutils/default.nix | 3 +- .../python-modules/csvw/default.nix | 23 +- .../python-modules/cu2qu/default.nix | 3 +- .../python-modules/curio/default.nix | 27 +- .../python-modules/cvxopt/default.nix | 47 +- .../python-modules/cx-freeze/default.nix | 126 ++- .../cyclonedx-python-lib/default.nix | 3 +- .../python-modules/cyclopts/default.nix | 3 +- pkgs/development/python-modules/cython/0.nix | 33 +- .../python-modules/cython/default.nix | 33 +- .../python-modules/daphne/default.nix | 3 +- .../python-modules/dask-awkward/default.nix | 3 +- .../python-modules/dask-glm/default.nix | 3 +- .../python-modules/dask-jobqueue/default.nix | 95 +- .../python-modules/dask-ml/default.nix | 27 +- .../python-modules/dask/default.nix | 47 +- .../dataclass-wizard/default.nix | 3 +- .../python-modules/datadog/default.nix | 41 +- .../python-modules/datafusion/default.nix | 11 +- .../python-modules/datalad-next/default.nix | 71 +- .../python-modules/datalad/default.nix | 33 +- .../python-modules/dataproperty/default.nix | 3 +- .../python-modules/dateparser/default.nix | 3 +- .../python-modules/dbt-adapters/default.nix | 3 +- .../python-modules/dbt-common/default.nix | 3 +- .../python-modules/dbt-core/default.nix | 3 +- .../python-modules/dbt-snowflake/default.nix | 3 +- .../python-modules/deal-solver/default.nix | 3 +- .../python-modules/deal/default.nix | 55 +- .../python-modules/debuglater/default.nix | 3 +- .../python-modules/debugpy/default.nix | 82 +- .../python-modules/deepdiff/default.nix | 28 +- .../python-modules/defcon/default.nix | 11 +- .../python-modules/deltalake/default.nix | 28 +- .../python-modules/denonavr/default.nix | 3 +- .../dependency-injector/default.nix | 3 +- .../python-modules/depyf/default.nix | 35 +- .../desktop-notifier/default.nix | 15 +- .../python-modules/detectron2/default.nix | 83 +- .../python-modules/devito/default.nix | 111 ++- .../python-modules/diffimg/default.nix | 17 +- .../python-modules/diffusers/default.nix | 44 +- .../python-modules/discordpy/default.nix | 3 +- .../python-modules/disnake/default.nix | 17 +- .../dissect-cobaltstrike/default.nix | 3 +- .../python-modules/dissect-target/default.nix | 79 +- .../python-modules/dissect/default.nix | 3 +- .../python-modules/distributed/default.nix | 3 +- .../python-modules/dj-rest-auth/default.nix | 6 +- .../python-modules/django-allauth/default.nix | 9 +- .../python-modules/django-anymail/default.nix | 3 +- .../django-bootstrap5/default.nix | 3 +- .../django-filingcabinet/default.nix | 13 +- .../django-haystack/default.nix | 3 +- .../django-import-export/default.nix | 3 +- .../django-mailman3/default.nix | 17 +- .../python-modules/django-markup/default.nix | 3 +- .../django-modelcluster/default.nix | 3 +- .../django-payments/default.nix | 3 +- .../python-modules/django-q2/default.nix | 29 +- .../python-modules/django-redis/default.nix | 3 +- .../django-storages/default.nix | 3 +- .../python-modules/django-stubs/default.nix | 6 +- .../python-modules/django-tables2/default.nix | 3 +- pkgs/development/python-modules/django/3.nix | 25 +- pkgs/development/python-modules/django/4.nix | 95 +- .../development/python-modules/django/5_1.nix | 48 +- .../development/python-modules/django/5_2.nix | 36 +- .../djangorestframework-stubs/default.nix | 3 +- .../djangorestframework/default.nix | 31 +- .../python-modules/dm-control/default.nix | 3 +- .../python-modules/dm-sonnet/default.nix | 3 +- .../python-modules/dns-lexicon/default.nix | 6 +- .../python-modules/docker-pycreds/default.nix | 11 +- .../python-modules/docker/default.nix | 3 +- .../python-modules/dockerflow/default.nix | 3 +- .../python-modules/docling-jobkit/default.nix | 27 +- .../python-modules/docling-serve/default.nix | 33 +- .../python-modules/docplex/default.nix | 3 +- .../python-modules/doit/default.nix | 15 +- .../python-modules/dparse/default.nix | 3 +- .../python-modules/dramatiq/default.nix | 55 +- .../drf-extra-fields/default.nix | 26 +- .../python-modules/drf-jwt/default.nix | 3 +- .../drf-spectacular/default.nix | 3 +- .../python-modules/dscribe/default.nix | 33 +- .../python-modules/dsnap/default.nix | 3 +- .../python-modules/duckdb-engine/default.nix | 27 +- .../python-modules/duckdb/default.nix | 24 +- .../python-modules/dufte/default.nix | 3 +- .../python-modules/dukpy/default.nix | 3 +- .../python-modules/dulwich/default.nix | 3 +- .../python-modules/dvc-hdfs/default.nix | 3 +- .../python-modules/dvc-render/default.nix | 17 +- .../python-modules/dvc/default.nix | 97 +- .../python-modules/dvclive/default.nix | 6 +- .../python-modules/e3-core/default.nix | 35 +- .../python-modules/edalize/default.nix | 3 +- .../python-modules/elastic-apm/default.nix | 17 +- .../python-modules/eliot/default.nix | 3 +- .../python-modules/energyflow/default.nix | 30 +- .../python-modules/entrance/default.nix | 3 +- .../python-modules/envisage/default.nix | 3 +- .../python-modules/ete3/default.nix | 15 +- .../python-modules/eth-abi/default.nix | 3 +- .../python-modules/eth-bloom/default.nix | 3 +- .../python-modules/eth-hash/default.nix | 36 +- .../python-modules/eth-keys/default.nix | 21 +- .../python-modules/eth-utils/default.nix | 16 +- .../python-modules/etils/default.nix | 36 +- .../python-modules/evaluate/default.nix | 3 +- .../python-modules/evohome-async/default.nix | 3 +- .../python-modules/execnet/default.nix | 21 +- .../python-modules/executing/default.nix | 3 +- .../python-modules/falcon/default.nix | 20 +- .../python-modules/fastapi-cli/default.nix | 9 +- .../python-modules/fastapi-sso/default.nix | 3 +- .../python-modules/fastapi/default.nix | 89 +- .../python-modules/fastavro/default.nix | 3 +- .../python-modules/fastjet/default.nix | 8 +- .../python-modules/fastjsonschema/default.nix | 19 +- .../python-modules/fenics-dolfinx/default.nix | 19 +- .../python-modules/filedepot/default.nix | 3 +- .../python-modules/fiona/default.nix | 3 +- .../python-modules/fipy/default.nix | 3 +- .../firebase-messaging/default.nix | 3 +- .../python-modules/firedrake/default.nix | 55 +- .../python-modules/fixtures/default.nix | 3 +- .../flask-appbuilder/default.nix | 3 +- .../python-modules/flask-caching/default.nix | 25 +- .../python-modules/flask-compress/default.nix | 13 +- .../python-modules/flask-dramatiq/default.nix | 3 +- .../flask-expects-json/default.nix | 3 +- .../flask-jwt-extended/default.nix | 3 +- .../flask-mongoengine/default.nix | 6 +- .../python-modules/flask-restx/default.nix | 19 +- .../python-modules/flask-security/default.nix | 31 +- .../flask-sqlalchemy-lite/default.nix | 13 +- .../python-modules/flask/default.nix | 3 +- .../python-modules/flit-gettext/default.nix | 3 +- .../python-modules/flit-scm/default.nix | 6 +- .../python-modules/flow-record/default.nix | 3 +- .../python-modules/fmpy/default.nix | 39 +- .../python-modules/fnllm/default.nix | 3 +- .../python-modules/fontmake/default.nix | 21 +- .../python-modules/fontparts/default.nix | 21 +- .../python-modules/fontpens/default.nix | 33 +- .../python-modules/fonttools/default.nix | 37 +- .../python-modules/foolscap/default.nix | 6 +- .../python-modules/formulaic/default.nix | 11 +- .../python-modules/foxdot/default.nix | 11 +- .../python-modules/frictionless/default.nix | 3 +- .../development/python-modules/fs/default.nix | 23 +- .../python-modules/fslpy/default.nix | 3 +- .../python-modules/fsspec/default.nix | 27 +- .../python-modules/fugashi/default.nix | 3 +- .../python-modules/funsor/default.nix | 25 +- .../python-modules/gdown/default.nix | 3 +- .../python-modules/geoalchemy2/default.nix | 3 +- .../python-modules/geopandas/default.nix | 3 +- .../python-modules/gevent/default.nix | 9 +- .../python-modules/gfal2-python/default.nix | 3 +- .../python-modules/gftools/default.nix | 89 +- .../python-modules/gidgethub/default.nix | 3 +- .../python-modules/git-revise/default.nix | 15 +- .../python-modules/github3-py/default.nix | 3 +- .../python-modules/githubkit/default.nix | 3 +- .../python-modules/gitpython/default.nix | 3 +- .../python-modules/globus-sdk/default.nix | 3 +- .../python-modules/glom/default.nix | 3 +- .../python-modules/gluonts/default.nix | 20 +- .../google-auth-oauthlib/default.nix | 20 +- .../python-modules/google-auth/default.nix | 3 +- .../default.nix | 3 +- .../default.nix | 3 +- .../default.nix | 3 +- .../google-cloud-asset/default.nix | 3 +- .../google-cloud-automl/default.nix | 3 +- .../default.nix | 3 +- .../google-cloud-bigquery-logging/default.nix | 3 +- .../google-cloud-bigquery-storage/default.nix | 3 +- .../google-cloud-bigquery/default.nix | 28 +- .../google-cloud-bigtable/default.nix | 3 +- .../google-cloud-compute/default.nix | 3 +- .../google-cloud-container/default.nix | 3 +- .../google-cloud-core/default.nix | 3 +- .../google-cloud-datacatalog/default.nix | 3 +- .../google-cloud-dataproc/default.nix | 3 +- .../google-cloud-datastore/default.nix | 3 +- .../google-cloud-dlp/default.nix | 3 +- .../google-cloud-error-reporting/default.nix | 3 +- .../google-cloud-firestore/default.nix | 3 +- .../google-cloud-iam-logging/default.nix | 3 +- .../google-cloud-iam/default.nix | 3 +- .../google-cloud-iot/default.nix | 3 +- .../google-cloud-kms/default.nix | 3 +- .../google-cloud-language/default.nix | 3 +- .../google-cloud-logging/default.nix | 3 +- .../google-cloud-monitoring/default.nix | 6 +- .../google-cloud-netapp/default.nix | 3 +- .../default.nix | 3 +- .../google-cloud-org-policy/default.nix | 3 +- .../google-cloud-os-config/default.nix | 3 +- .../google-cloud-pubsub/default.nix | 3 +- .../google-cloud-redis/default.nix | 3 +- .../google-cloud-resource-manager/default.nix | 3 +- .../google-cloud-secret-manager/default.nix | 3 +- .../google-cloud-securitycenter/default.nix | 3 +- .../google-cloud-shell/default.nix | 3 +- .../google-cloud-spanner/default.nix | 3 +- .../google-cloud-speech/default.nix | 3 +- .../google-cloud-tasks/default.nix | 3 +- .../google-cloud-texttospeech/default.nix | 3 +- .../google-cloud-trace/default.nix | 3 +- .../google-cloud-translate/default.nix | 3 +- .../default.nix | 3 +- .../google-cloud-vision/default.nix | 3 +- .../google-cloud-vpc-access/default.nix | 3 +- .../google-cloud-webrisk/default.nix | 3 +- .../default.nix | 3 +- .../google-cloud-workflows/default.nix | 3 +- .../google-cloud-workstations/default.nix | 3 +- .../google-geo-type/default.nix | 3 +- .../google-maps-routing/default.nix | 3 +- .../google-resumable-media/default.nix | 3 +- .../gotenberg-client/default.nix | 11 +- .../python-modules/gpuctypes/default.nix | 29 +- .../python-modules/gql/default.nix | 3 +- .../python-modules/gradio/default.nix | 273 +++--- .../python-modules/graph-tool/default.nix | 3 +- .../graphene-django/default.nix | 23 +- .../python-modules/graphite-web/default.nix | 25 +- .../great-expectations/default.nix | 35 +- .../python-modules/groq/default.nix | 3 +- .../python-modules/grpcio/default.nix | 19 +- .../python-modules/gruut/default.nix | 39 +- .../python-modules/gstools/default.nix | 3 +- .../python-modules/gudhi/default.nix | 3 +- .../python-modules/guessit/default.nix | 3 +- .../python-modules/guidance/default.nix | 3 +- .../python-modules/gunicorn/default.nix | 3 +- .../python-modules/gvm-tools/default.nix | 3 +- .../python-modules/gym/default.nix | 74 +- .../python-modules/gymnasium/default.nix | 3 +- .../development/python-modules/h3/default.nix | 25 +- .../python-modules/h5py/default.nix | 15 +- .../python-modules/hap-python/default.nix | 3 +- .../hatch-fancy-pypi-readme/default.nix | 9 +- .../hatch-jupyter-builder/default.nix | 3 +- .../python-modules/hatch-odoo/default.nix | 15 +- .../python-modules/hatch-vcs/default.nix | 23 +- .../python-modules/hatchling/default.nix | 3 +- .../python-modules/hf-transfer/default.nix | 13 +- .../python-modules/hishel/default.nix | 3 +- .../home-assistant-chip-core/default.nix | 3 +- .../python-modules/htmldate/default.nix | 26 +- .../python-modules/htseq/default.nix | 3 +- .../python-modules/httpcore/default.nix | 3 +- .../python-modules/httpie/default.nix | 40 +- .../python-modules/httplib2/default.nix | 31 +- .../python-modules/httpx-socks/default.nix | 3 +- .../python-modules/httpx/default.nix | 3 +- .../huggingface-hub/default.nix | 3 +- .../python-modules/hupper/default.nix | 3 +- .../python-modules/hydra-core/default.nix | 23 +- .../python-modules/hypercorn/default.nix | 3 +- .../python-modules/hypothesis/default.nix | 55 +- .../python-modules/i-pi/default.nix | 3 +- .../python-modules/ibis-framework/default.nix | 3 +- .../python-modules/igraph/default.nix | 3 +- .../python-modules/imageio/default.nix | 15 +- .../importlib-metadata/default.nix | 3 +- .../python-modules/inform/default.nix | 13 +- .../python-modules/inkex/default.nix | 19 +- .../inline-snapshot/default.nix | 22 +- .../python-modules/intake/default.nix | 60 +- .../internetarchive/default.nix | 3 +- .../invisible-watermark/default.nix | 23 +- .../python-modules/iocsearcher/default.nix | 3 +- .../python-modules/ipdb/default.nix | 34 +- .../python-modules/ipykernel/default.nix | 3 +- .../python-modules/ipykernel/tests.nix | 61 +- .../python-modules/ipyparallel/default.nix | 3 +- .../python-modules/ipython/default.nix | 30 +- .../python-modules/irc/default.nix | 3 +- .../python-modules/jaraco-net/default.nix | 6 +- .../python-modules/jaraco-text/default.nix | 3 +- .../python-modules/jax/default.nix | 89 +- .../python-modules/jax/test-cuda.nix | 3 +- .../python-modules/jaxlib/default.nix | 37 +- .../python-modules/jedi/default.nix | 25 +- .../python-modules/jeepney/default.nix | 23 +- .../python-modules/joblib/default.nix | 29 +- .../johnnycanencrypt/default.nix | 28 +- .../jsonschema-specifications/default.nix | 3 +- .../python-modules/jsonschema/default.nix | 21 +- .../python-modules/jupysql/default.nix | 50 +- .../python-modules/jupyter-client/default.nix | 3 +- .../python-modules/jupyter-events/default.nix | 6 +- .../jupyter-server-terminals/default.nix | 3 +- .../python-modules/jupyter-server/default.nix | 43 +- .../python-modules/jupyterhub/default.nix | 43 +- .../jupyterlab-server/default.nix | 6 +- .../python-modules/jupyterlab/default.nix | 35 +- .../python-modules/jupytext/default.nix | 3 +- .../kafka-python-ng/default.nix | 3 +- .../python-modules/kaleido/default.nix | 59 +- .../python-modules/keras/default.nix | 30 +- .../python-modules/keyring/default.nix | 30 +- .../python-modules/keystoneauth1/default.nix | 24 +- .../python-modules/kivy/default.nix | 62 +- .../python-modules/klaus/default.nix | 3 +- .../python-modules/kokoro/default.nix | 3 +- .../python-modules/kombu/default.nix | 6 +- .../python-modules/kserve/default.nix | 66 +- .../python-modules/kubernetes/default.nix | 3 +- .../python-modules/labelbox/default.nix | 3 +- .../python-modules/lacuscore/default.nix | 29 +- .../python-modules/lancedb/default.nix | 17 +- .../python-modules/langchain-core/default.nix | 69 +- .../python-modules/langchain/default.nix | 3 +- .../python-modules/langsmith/default.nix | 3 +- .../python-modules/lastversion/default.nix | 3 +- .../python-modules/ldaptor/default.nix | 3 +- .../python-modules/ledgerblue/default.nix | 3 +- .../python-modules/libpass/default.nix | 3 +- .../python-modules/librosa/default.nix | 58 +- .../python-modules/libtmux/default.nix | 31 +- .../python-modules/lightgbm/default.nix | 18 +- .../python-modules/limits/default.nix | 3 +- .../python-modules/limnoria/default.nix | 3 +- .../python-modules/line-profiler/default.nix | 3 +- .../python-modules/llguidance/default.nix | 29 +- .../python-modules/llmx/default.nix | 3 +- .../python-modules/lm-eval/default.nix | 3 +- .../python-modules/localstack-ext/default.nix | 3 +- .../python-modules/logbook/default.nix | 3 +- .../python-modules/logilab/common.nix | 3 +- .../python-modules/loguru/default.nix | 30 +- .../python-modules/lomond/default.nix | 19 +- .../python-modules/lxml/default.nix | 3 +- .../python-modules/m2crypto/default.nix | 19 +- .../python-modules/macholib/default.nix | 13 +- .../python-modules/maestral/default.nix | 64 +- .../magic-wormhole-mailbox-server/default.nix | 17 +- .../python-modules/magic-wormhole/default.nix | 54 +- .../python-modules/mako/default.nix | 3 +- .../python-modules/mamba-ssm/default.nix | 3 +- .../python-modules/manifest-ml/default.nix | 3 +- .../python-modules/manim-slides/default.nix | 53 +- .../python-modules/marimo/default.nix | 3 +- .../python-modules/markdown-it-py/default.nix | 3 +- .../python-modules/marko/default.nix | 11 +- .../python-modules/markups/default.nix | 3 +- .../marshmallow-dataclass/default.nix | 3 +- .../python-modules/mashumaro/default.nix | 3 +- .../python-modules/mastodon-py/default.nix | 3 +- .../python-modules/mat2/default.nix | 66 +- .../python-modules/materialx/default.nix | 25 +- .../python-modules/matplotlib/default.nix | 85 +- .../python-modules/matrix-nio/default.nix | 82 +- .../python-modules/mautrix/default.nix | 3 +- .../python-modules/mayim/default.nix | 21 +- .../python-modules/mcp/default.nix | 36 +- .../python-modules/meep/default.nix | 27 +- .../python-modules/meilisearch/default.nix | 3 +- .../python-modules/meross-iot/default.nix | 3 +- .../python-modules/meshtastic/default.nix | 3 +- .../python-modules/meson-python/default.nix | 6 +- .../python-modules/mezzanine/default.nix | 3 +- .../microsoft-kiota-http/default.nix | 3 +- .../python-modules/mike/default.nix | 17 +- .../python-modules/minari/default.nix | 3 +- .../python-modules/mip/default.nix | 3 +- .../python-modules/mir-eval/default.nix | 3 +- .../python-modules/mirakuru/default.nix | 15 +- .../mitmproxy-linux/default.nix | 17 +- .../mkdocs-rss-plugin/default.nix | 3 +- .../python-modules/mkdocs/default.nix | 9 +- .../python-modules/mkdocstrings/default.nix | 23 +- .../python-modules/mlcroissant/default.nix | 3 +- .../python-modules/mmcv/default.nix | 77 +- .../python-modules/mne/default.nix | 3 +- .../python-modules/mocket/default.nix | 30 +- .../python-modules/molecule/default.nix | 3 +- .../python-modules/monty/default.nix | 24 +- .../python-modules/moto/default.nix | 3 +- .../python-modules/moviepy/default.nix | 40 +- .../python-modules/mrjob/default.nix | 3 +- .../msal-extensions/default.nix | 27 +- .../python-modules/msal/default.nix | 3 +- .../python-modules/msrest/default.nix | 35 +- .../python-modules/mtcnn/default.nix | 15 +- .../python-modules/mujoco-mjx/default.nix | 3 +- .../python-modules/mypermobil/default.nix | 17 +- .../python-modules/mypy/default.nix | 80 +- .../python-modules/myst-parser/default.nix | 3 +- .../python-modules/nanobind/default.nix | 23 +- .../python-modules/napari/default.nix | 3 +- .../python-modules/narwhals/default.nix | 3 +- .../python-modules/nats-py/default.nix | 37 +- .../python-modules/nbconvert/default.nix | 35 +- .../python-modules/nbdime/default.nix | 31 +- .../python-modules/ndeflib/default.nix | 3 +- .../python-modules/ndindex/default.nix | 3 +- .../python-modules/ndtypes/default.nix | 15 +- .../python-modules/nebula3-python/default.nix | 3 +- .../python-modules/nengo/default.nix | 11 +- .../python-modules/netcdf4/default.nix | 3 +- .../python-modules/nextcord/default.nix | 23 +- .../python-modules/niaarm/default.nix | 24 +- .../python-modules/nibabel/default.nix | 16 +- .../python-modules/nibe/default.nix | 3 +- .../python-modules/nicegui/default.nix | 3 +- .../python-modules/nidaqmx/default.nix | 25 +- .../python-modules/nose2/default.nix | 3 +- .../python-modules/notebook/default.nix | 15 +- .../python-modules/notobuilder/default.nix | 3 +- .../python-modules/notus-scanner/default.nix | 3 +- .../python-modules/nox/default.nix | 19 +- .../python-modules/nsz/default.nix | 3 +- .../python-modules/numba/default.nix | 27 +- .../python-modules/numcodecs/default.nix | 3 +- pkgs/development/python-modules/numpy/1.nix | 97 +- pkgs/development/python-modules/numpy/2.nix | 76 +- .../python-modules/numpyro/default.nix | 39 +- .../python-modules/nutils/default.nix | 3 +- .../python-modules/nvchecker/default.nix | 3 +- .../python-modules/oauthenticator/default.nix | 3 +- .../python-modules/oauthlib/default.nix | 18 +- .../python-modules/odc-geo/default.nix | 3 +- .../python-modules/odc-loader/default.nix | 3 +- .../python-modules/odc-stac/default.nix | 3 +- .../python-modules/okonomiyaki/default.nix | 20 +- .../python-modules/ome-zarr/default.nix | 3 +- .../python-modules/omegaconf/default.nix | 21 +- .../python-modules/onnxruntime/default.nix | 43 +- .../onvif-zeep-async/default.nix | 3 +- .../open-clip-torch/default.nix | 33 +- .../python-modules/openai-whisper/default.nix | 26 +- .../python-modules/openai/default.nix | 44 +- .../python-modules/openapi-core/default.nix | 3 +- .../openapi-spec-validator/default.nix | 3 +- .../python-modules/opencamlib/default.nix | 3 +- .../python-modules/openfga-sdk/default.nix | 3 +- .../python-modules/openpyxl/default.nix | 45 +- .../python-modules/opensearch-py/default.nix | 30 +- .../python-modules/opensfm/default.nix | 17 +- .../python-modules/openstacksdk/tests.nix | 73 +- .../default.nix | 3 +- .../python-modules/openusd/default.nix | 120 ++- .../python-modules/optimum/default.nix | 3 +- .../python-modules/optuna/default.nix | 92 +- .../orange-widget-base/default.nix | 3 +- .../orbax-checkpoint/default.nix | 25 +- .../python-modules/orjson/default.nix | 13 +- .../python-modules/ormar/default.nix | 26 +- .../python-modules/oslo-log/default.nix | 3 +- .../python-modules/osqp/default.nix | 25 +- .../python-modules/paddlepaddle/default.nix | 15 +- .../python-modules/pandas-stubs/default.nix | 39 +- .../python-modules/pandas/default.nix | 90 +- .../python-modules/pandera/default.nix | 3 +- .../python-modules/papermill/default.nix | 43 +- .../python-modules/papis/default.nix | 3 +- .../python-modules/paramiko/default.nix | 3 +- .../python-modules/parver/default.nix | 3 +- .../python-modules/pathlib2/default.nix | 13 +- .../python-modules/patool/default.nix | 3 +- .../python-modules/pcre2-py/default.nix | 29 +- .../python-modules/peewee/default.nix | 11 +- .../python-modules/pegen/default.nix | 17 +- .../python-modules/pem/default.nix | 3 +- .../python-modules/pendulum/default.nix | 30 +- .../python-modules/pep517/default.nix | 13 +- .../python-modules/persistent/default.nix | 3 +- .../python-modules/pettingzoo/default.nix | 17 +- .../python-modules/pg8000/default.nix | 3 +- .../python-modules/pgcli/default.nix | 3 +- .../python-modules/pillow-heif/default.nix | 43 +- .../python-modules/pillow/default.nix | 24 +- .../python-modules/pins/default.nix | 3 +- .../python-modules/pip-tools/default.nix | 3 +- .../python-modules/pipdate/default.nix | 3 +- .../python-modules/pipdeptree/default.nix | 3 +- .../python-modules/pipx/default.nix | 3 +- .../planetary-computer/default.nix | 3 +- .../python-modules/playwright/default.nix | 18 +- .../python-modules/plotly/default.nix | 58 +- .../python-modules/plumbum/default.nix | 3 +- .../python-modules/pluthon/default.nix | 3 +- .../python-modules/podman/default.nix | 3 +- .../python-modules/pontos/default.nix | 3 +- .../python-modules/powerapi/default.nix | 3 +- .../python-modules/powerline/default.nix | 3 +- .../python-modules/prance/default.nix | 3 +- .../python-modules/prisma/default.nix | 3 +- .../python-modules/private-gpt/default.nix | 3 +- .../python-modules/prophet/default.nix | 3 +- .../development/python-modules/protobuf/4.nix | 3 +- .../python-modules/psycopg/default.nix | 70 +- .../python-modules/pulsar-client/default.nix | 3 +- .../python-modules/pushbullet-py/default.nix | 21 +- .../python-modules/py-evm/default.nix | 3 +- .../python-modules/py-sucks/default.nix | 3 +- .../pyTelegramBotAPI/default.nix | 13 +- .../python-modules/pyannotate/default.nix | 17 +- .../python-modules/pyarrow/default.nix | 131 ++- .../python-modules/pybase64/default.nix | 3 +- .../python-modules/pybids/default.nix | 3 +- .../pybind11-protobuf/default.nix | 25 +- .../python-modules/pybind11/default.nix | 3 +- .../python-modules/pyclip/default.nix | 13 +- .../python-modules/pycognito/default.nix | 6 +- .../python-modules/pycookiecheat/default.nix | 3 +- .../python-modules/pycurl/default.nix | 49 +- .../python-modules/pycyphal/default.nix | 3 +- .../development/python-modules/pydantic/1.nix | 3 +- .../python-modules/pydantic/default.nix | 25 +- .../python-modules/pydeck/default.nix | 3 +- .../python-modules/pydevd/default.nix | 53 +- .../python-modules/pydicom/default.nix | 40 +- .../python-modules/pydruid/default.nix | 3 +- .../python-modules/pyecharts/default.nix | 3 +- .../python-modules/pyfakefs/default.nix | 15 +- .../python-modules/pyfnip/default.nix | 3 +- .../python-modules/pyftgl/default.nix | 15 +- .../python-modules/pygal/default.nix | 3 +- .../python-modules/pygame-ce/default.nix | 60 +- .../python-modules/pygame-gui/default.nix | 35 +- .../python-modules/pygatt/default.nix | 3 +- .../python-modules/pygit2/default.nix | 3 +- .../python-modules/pygithub/default.nix | 3 +- .../python-modules/pygobject/3.nix | 3 +- .../python-modules/pyhanko/default.nix | 89 +- .../python-modules/pyheos/default.nix | 17 +- .../python-modules/pyiceberg/default.nix | 100 +- .../python-modules/pyinfra/default.nix | 29 +- .../python-modules/pyipp/default.nix | 3 +- .../python-modules/pykakasi/default.nix | 3 +- .../python-modules/pykaleidescape/default.nix | 19 +- .../python-modules/pylance/default.nix | 56 +- .../python-modules/pylint/default.nix | 64 +- .../python-modules/pylsp-mypy/default.nix | 3 +- .../pylutron-caseta/default.nix | 6 +- .../pym3u8downloader/default.nix | 40 +- .../python-modules/pymatgen/default.nix | 72 +- .../python-modules/pymatting/default.nix | 21 +- .../python-modules/pymodbus/default.nix | 22 +- .../python-modules/pymoo/default.nix | 31 +- .../python-modules/pympler/default.nix | 47 +- .../python-modules/pynamodb/default.nix | 3 +- .../python-modules/pynput/default.nix | 13 +- .../python-modules/pynvim/default.nix | 9 +- .../python-modules/pynws/default.nix | 3 +- .../python-modules/pyocd/default.nix | 3 +- .../python-modules/pyogrio/default.nix | 3 +- .../python-modules/pyopengl/default.nix | 15 +- .../python-modules/pyopenssl/default.nix | 75 +- .../python-modules/pyparted/default.nix | 23 +- .../python-modules/pypdf/default.nix | 3 +- .../python-modules/pypiserver/default.nix | 6 +- .../pyproject-parser/default.nix | 3 +- pkgs/development/python-modules/pyqt/5.x.nix | 78 +- pkgs/development/python-modules/pyqt/6.x.nix | 27 +- .../python-modules/pyqt5-stubs/default.nix | 43 +- .../python-modules/pyqtwebengine/default.nix | 62 +- .../python-modules/pyrail/default.nix | 3 +- .../python-modules/pyrate-limiter/default.nix | 3 +- .../python-modules/pyrender/default.nix | 13 +- .../python-modules/pyro5/default.nix | 3 +- .../python-modules/pyscard/default.nix | 21 +- .../python-modules/pyscreenshot/default.nix | 19 +- .../python-modules/pyshark/default.nix | 21 +- .../python-modules/pyside6/default.nix | 28 +- .../python-modules/pysvn/default.nix | 3 +- .../python-modules/pytablewriter/default.nix | 3 +- .../python-modules/pytask/default.nix | 3 +- .../python-modules/pytest-aio/default.nix | 3 +- .../python-modules/pytest-ansible/default.nix | 54 +- .../pytest-benchmark/default.nix | 3 +- .../python-modules/pytest-jupyter/default.nix | 3 +- .../pytest-notebook/default.nix | 29 +- .../pytest-recording/default.nix | 13 +- .../pytest-regressions/default.nix | 3 +- .../pytest-scim2-server/default.nix | 3 +- .../python-modules/pytest-shutil/default.nix | 13 +- pkgs/development/python-modules/pytest/7.nix | 19 +- .../python-modules/pytest/default.nix | 19 +- .../python-modules/python-barcode/default.nix | 3 +- .../python-benedict/default.nix | 3 +- .../python-modules/python-can/default.nix | 30 +- .../python-engineio/default.nix | 3 +- .../python-modules/python-escpos/default.nix | 3 +- .../python-modules/python-gvm/default.nix | 3 +- .../python-modules/python-jose/default.nix | 3 +- .../python-lsp-black/default.nix | 3 +- .../python-lsp-ruff/default.nix | 3 +- .../python-lsp-server/default.nix | 3 +- .../python-modules/python-mapnik/default.nix | 52 +- .../python-matter-server/default.nix | 3 +- .../python-modules/python-miio/default.nix | 3 +- .../python-openstackclient/default.nix | 19 +- .../python-rabbitair/default.nix | 3 +- .../python-redis-lock/default.nix | 3 +- .../python-roborock/default.nix | 3 +- .../python-socketio/default.nix | 3 +- .../python-telegram-bot/default.nix | 3 +- .../python-modules/python-ulid/default.nix | 3 +- .../python-modules/python-utils/default.nix | 3 +- .../python-modules/pythonfinder/default.nix | 3 +- .../python-modules/pytoolconfig/default.nix | 6 +- .../pytorch-lightning/default.nix | 3 +- .../pytorch-metric-learning/default.nix | 50 +- .../pytorch-pfn-extras/default.nix | 98 +- .../python-modules/pytorch3d/default.nix | 13 +- .../python-modules/pyunbound/default.nix | 25 +- .../python-modules/pyutil/default.nix | 3 +- .../python-modules/pywebcopy/default.nix | 3 +- .../python-modules/pywebview/default.nix | 3 +- .../python-modules/pywinrm/default.nix | 3 +- .../python-modules/pyzmq/default.nix | 3 +- .../python-modules/qdrant-client/default.nix | 3 +- .../qiskit-ibmq-provider/default.nix | 6 +- .../python-modules/qiskit-ignis/default.nix | 32 +- .../python-modules/qiskit-nature/default.nix | 3 +- .../python-modules/qiskit-terra/default.nix | 159 ++- .../python-modules/qiskit/default.nix | 3 +- .../python-modules/qrcode/default.nix | 3 +- .../python-modules/qscintilla/default.nix | 38 +- .../python-modules/quandl/default.nix | 3 +- .../python-modules/quart/default.nix | 35 +- .../python-modules/qutip/default.nix | 3 +- .../python-modules/rarfile/default.nix | 29 +- .../python-modules/rasterio/default.nix | 3 +- .../python-modules/ratarmountcore/default.nix | 3 +- .../raylib-python-cffi/passthru-tests.nix | 12 +- .../python-modules/rchitect/default.nix | 3 +- .../python-modules/rdflib/default.nix | 49 +- .../python-modules/reikna/default.nix | 15 +- .../python-modules/rembg/default.nix | 3 +- .../python-modules/remi/default.nix | 13 +- .../python-modules/renault-api/default.nix | 3 +- .../python-modules/reproject/default.nix | 3 +- .../python-modules/reptor/default.nix | 3 +- .../python-modules/requests-cache/default.nix | 29 +- .../requests-kerberos/default.nix | 15 +- .../python-modules/requests/default.nix | 44 +- .../python-modules/resampy/default.nix | 3 +- .../python-modules/responses/default.nix | 3 +- .../python-modules/rich/default.nix | 3 +- .../python-modules/rioxarray/default.nix | 29 +- .../python-modules/rope/default.nix | 23 +- .../python-modules/rpy2/default.nix | 49 +- .../python-modules/s3transfer/default.nix | 11 +- .../python-modules/safetensors/default.nix | 19 +- .../python-modules/sagemaker-core/default.nix | 3 +- .../python-modules/samsungtvws/default.nix | 15 +- .../python-modules/sanic/default.nix | 3 +- .../python-modules/scalene/default.nix | 6 +- .../scancode-toolkit/default.nix | 3 +- .../python-modules/scapy/default.nix | 60 +- .../python-modules/schedula/default.nix | 22 +- .../python-modules/schema-salad/default.nix | 29 +- .../python-modules/schwifty/default.nix | 6 +- .../scikit-build-core/default.nix | 17 +- .../python-modules/scikit-build/default.nix | 3 +- .../scikit-hep-testdata/default.nix | 3 +- .../python-modules/scikit-image/default.nix | 52 +- .../python-modules/scikit-learn/default.nix | 32 +- .../scikit-survival/default.nix | 22 +- .../python-modules/scim2-client/default.nix | 3 +- .../scim2-filter-parser/default.nix | 3 +- .../python-modules/scim2-tester/default.nix | 3 +- .../python-modules/scipy/default.nix | 81 +- .../python-modules/scrapy/default.nix | 55 +- .../python-modules/screenlogicpy/default.nix | 33 +- .../python-modules/sdkmanager/default.nix | 13 +- .../python-modules/seaborn/default.nix | 17 +- .../python-modules/seabreeze/default.nix | 3 +- .../python-modules/seasonal/default.nix | 3 +- .../securesystemslib/default.nix | 3 +- .../python-modules/selenium/default.nix | 40 +- .../sentence-transformers/default.nix | 46 +- .../python-modules/sentry-sdk/default.nix | 3 +- .../python-modules/servefile/default.nix | 3 +- .../setuptools-generate/default.nix | 3 +- .../setuptools-git-versioning/default.nix | 3 +- .../setuptools-rust/default.nix | 15 +- .../python-modules/setuptools-scm/default.nix | 3 +- .../python-modules/sfrbox-api/default.nix | 3 +- .../development/python-modules/sh/default.nix | 37 +- .../python-modules/shiboken2/default.nix | 23 +- .../python-modules/shiboken6/default.nix | 26 +- .../python-modules/shiny/default.nix | 3 +- .../python-modules/signedjson/default.nix | 19 +- .../python-modules/simpful/default.nix | 3 +- .../python-modules/simplekv/default.nix | 3 +- .../python-modules/sip/default.nix | 3 +- .../python-modules/skein/default.nix | 24 +- .../python-modules/skia-pathops/default.nix | 64 +- .../python-modules/skops/default.nix | 23 +- .../skytemple-files/default.nix | 6 +- .../skytemple-ssb-debugger/default.nix | 3 +- .../python-modules/slack-bolt/default.nix | 3 +- .../python-modules/slack-sdk/default.nix | 3 +- .../python-modules/slowapi/default.nix | 3 +- .../python-modules/smart-open/default.nix | 3 +- .../python-modules/smolagents/default.nix | 67 +- .../python-modules/snitun/default.nix | 61 +- .../python-modules/snorkel/default.nix | 3 +- .../python-modules/snscrape/default.nix | 17 +- .../social-auth-core/default.nix | 3 +- .../python-modules/soxr/default.nix | 19 +- .../python-modules/spacy/models.nix | 31 +- .../python-modules/spectral-cube/default.nix | 192 ++-- .../speechrecognition/default.nix | 3 +- .../python-modules/spglib/default.nix | 13 +- .../python-modules/sphinx-autoapi/default.nix | 19 +- .../sphinx-autodoc2/default.nix | 3 +- .../python-modules/sphinx/default.nix | 140 ++- .../sphinxcontrib-bibtex/default.nix | 21 +- .../sphinxcontrib-spelling/default.nix | 3 +- .../sphinxext-opengraph/default.nix | 3 +- .../python-modules/splinter/default.nix | 3 +- .../python-modules/spyder/default.nix | 3 +- .../sqlalchemy-continuum/default.nix | 17 +- .../sqlalchemy-utils/default.nix | 54 +- .../python-modules/sqlalchemy/1_4.nix | 3 +- .../python-modules/sqlfmt/default.nix | 3 +- .../python-modules/sshfs/default.nix | 17 +- .../starlette-admin/default.nix | 31 +- .../python-modules/starlette/default.nix | 3 +- .../python-modules/static3/default.nix | 3 +- .../python-modules/statmake/default.nix | 19 +- .../python-modules/stm32loader/default.nix | 3 +- .../strawberry-django/default.nix | 35 +- .../strawberry-graphql/default.nix | 3 +- .../python-modules/streamlit/default.nix | 3 +- .../python-modules/sunpy/default.nix | 23 +- .../python-modules/swh-objstorage/default.nix | 3 +- .../python-modules/swh-storage/default.nix | 3 +- .../python-modules/swifter/default.nix | 3 +- .../python-modules/synergy/default.nix | 25 +- .../python-modules/tabulate/default.nix | 3 +- .../python-modules/temporalio/default.nix | 3 +- .../python-modules/tensorboardx/default.nix | 23 +- .../python-modules/tensordict/default.nix | 54 +- .../tensorflow-datasets/default.nix | 49 +- .../python-modules/tensorflow/bin.nix | 3 +- .../python-modules/tensorflow/default.nix | 155 ++- .../python-modules/term-image/default.nix | 3 +- .../textual-fastdatatable/default.nix | 6 +- .../textual-textarea/default.nix | 3 +- .../python-modules/textual/default.nix | 20 +- .../python-modules/tf-keras/default.nix | 3 +- .../threat9-test-bed/default.nix | 3 +- .../python-modules/tianshou/default.nix | 27 +- .../python-modules/tinygrad/default.nix | 119 ++- .../torch-geometric/default.nix | 95 +- .../python-modules/torch/bin/default.nix | 3 +- .../python-modules/torch/source/default.nix | 488 +++++----- .../python-modules/torchao/default.nix | 37 +- .../python-modules/torchaudio/bin.nix | 31 +- .../python-modules/torchaudio/default.nix | 31 +- .../python-modules/torcheval/default.nix | 107 +- .../python-modules/torchio/default.nix | 17 +- .../python-modules/torchrl/default.nix | 166 ++-- .../python-modules/torchvision/default.nix | 45 +- .../python-modules/towncrier/default.nix | 15 +- .../python-modules/tox/default.nix | 3 +- .../python-modules/tpm2-pytss/default.nix | 57 +- .../python-modules/transitions/default.nix | 35 +- .../python-modules/treq/default.nix | 3 +- .../python-modules/trezor/default.nix | 3 +- .../python-modules/trie/default.nix | 3 +- .../python-modules/trimesh/default.nix | 43 +- .../trino-python-client/default.nix | 3 +- .../python-modules/trio-asyncio/default.nix | 3 +- .../python-modules/trio-websocket/default.nix | 44 +- .../python-modules/trio/default.nix | 3 +- .../python-modules/triton/default.nix | 68 +- .../python-modules/trytond/default.nix | 49 +- .../python-modules/tsfresh/default.nix | 40 +- .../python-modules/ttfautohint-py/default.nix | 17 +- .../python-modules/tuf/default.nix | 13 +- .../python-modules/tweepy/default.nix | 3 +- .../python-modules/twine/default.nix | 31 +- .../python-modules/twisted/default.nix | 197 ++-- .../python-modules/txredisapi/default.nix | 3 +- .../python-modules/txtai/default.nix | 25 +- .../python-modules/txtorcon/default.nix | 3 +- .../python-modules/typed-settings/default.nix | 19 +- .../python-modules/typeguard/default.nix | 3 +- .../python-modules/typepy/default.nix | 3 +- .../python-modules/typer/default.nix | 43 +- .../types-aiobotocore-packages/default.nix | 3 +- .../python-modules/types-lxml/default.nix | 3 +- .../python-modules/tzdata/default.nix | 3 +- .../python-modules/tzlocal/default.nix | 3 +- .../python-modules/ufmt/default.nix | 3 +- .../python-modules/ufo2ft/default.nix | 27 +- .../python-modules/ufolib2/default.nix | 6 +- .../python-modules/ufoprocessor/default.nix | 21 +- .../python-modules/ultralytics/default.nix | 71 +- .../python-modules/uncertainties/default.nix | 3 +- .../universal-silabs-flasher/default.nix | 23 +- .../unstructured-api-tools/default.nix | 3 +- .../unstructured-inference/default.nix | 27 +- .../python-modules/uqbar/default.nix | 39 +- .../python-modules/urllib3/default.nix | 3 +- .../python-modules/urwid/default.nix | 3 +- .../python-modules/uvicorn/default.nix | 3 +- .../python-modules/uvicorn/tests.nix | 3 +- .../python-modules/uvloop/default.nix | 62 +- .../python-modules/valkey/default.nix | 28 +- .../python-modules/vbuild/default.nix | 17 +- .../python-modules/vector/default.nix | 45 +- .../python-modules/versioningit/default.nix | 9 +- .../python-modules/virtualenv/default.nix | 39 +- .../python-modules/visions/default.nix | 3 +- .../python-modules/vivisect/default.nix | 3 +- .../python-modules/vllm/default.nix | 198 ++-- .../python-modules/volvooncall/default.nix | 3 +- .../python-modules/w1thermsensor/default.nix | 15 +- .../python-modules/wacz/default.nix | 3 +- .../python-modules/wagtail/default.nix | 3 +- .../python-modules/wand/default.nix | 23 +- .../python-modules/wandb/default.nix | 249 +++-- .../python-modules/watchdog/default.nix | 113 ++- .../python-modules/watermark/default.nix | 3 +- .../python-modules/weasyprint/default.nix | 3 +- .../python-modules/web/default.nix | 3 +- .../python-modules/web3/default.nix | 39 +- .../python-modules/webdataset/default.nix | 63 +- .../python-modules/webdav4/default.nix | 3 +- .../weblate-schemas/default.nix | 3 +- .../python-modules/websockets/default.nix | 39 +- .../python-modules/weconnect-mqtt/default.nix | 3 +- .../python-modules/werkzeug/default.nix | 6 +- .../python-modules/wfuzz/default.nix | 21 +- .../python-modules/whey/default.nix | 3 +- .../python-modules/whool/default.nix | 3 +- .../python-modules/willow/default.nix | 3 +- .../python-modules/wtforms/default.nix | 3 +- .../python-modules/wxpython/4.2.nix | 38 +- .../python-modules/xformers/default.nix | 13 +- .../python-modules/xgrammar/default.nix | 21 +- .../python-modules/xknx/default.nix | 3 +- .../python-modules/xnd/default.nix | 48 +- .../python-modules/xsdata/default.nix | 13 +- .../python-modules/yalexs/default.nix | 3 +- .../python-modules/yamllint/default.nix | 25 +- .../python-modules/yowsup/default.nix | 3 +- .../python-modules/zarr/default.nix | 3 +- .../python-modules/zeep/default.nix | 3 +- .../python-modules/zigpy/default.nix | 18 +- .../python-modules/zope-security/default.nix | 3 +- .../python-modules/zulip/default.nix | 3 +- .../importlib-metadata/default.nix | 15 +- .../python2-modules/mock/default.nix | 3 +- .../python2-modules/pygtk/default.nix | 29 +- .../python2-modules/pytest/default.nix | 27 +- pkgs/development/r-modules/default.nix | 18 +- pkgs/development/r-modules/wrapper-radian.nix | 13 +- .../development/r-modules/wrapper-rstudio.nix | 13 +- .../rocm-modules/6/aotriton/default.nix | 121 ++- .../rocm-modules/6/clr/default.nix | 119 ++- .../rocm-modules/6/composable_kernel/base.nix | 84 +- .../6/composable_kernel/default.nix | 26 +- .../rocm-modules/6/hipblas/default.nix | 93 +- .../rocm-modules/6/hipblaslt/default.nix | 135 ++- .../rocm-modules/6/hipcub/default.nix | 73 +- .../rocm-modules/6/hipfft/default.nix | 95 +- .../rocm-modules/6/hiprand/default.nix | 42 +- .../rocm-modules/6/hipsolver/default.nix | 87 +- .../rocm-modules/6/hipsparse/default.nix | 67 +- .../rocm-modules/6/llvm/default.nix | 63 +- .../rocm-modules/6/migraphx/default.nix | 83 +- .../rocm-modules/6/miopen/default.nix | 194 ++-- .../rocm-modules/6/mivisionx/default.nix | 74 +- .../rocm-modules/6/rccl/default.nix | 87 +- .../rocm-modules/6/rdc/default.nix | 117 ++- .../rocm-modules/6/rocalution/default.nix | 101 +- .../rocm-modules/6/rocblas/default.nix | 145 ++- .../rocm-modules/6/rocdbgapi/default.nix | 34 +- .../rocm-modules/6/rocfft/default.nix | 27 +- .../rocm-modules/6/rocmlir/default.nix | 52 +- .../rocm-modules/6/rocprim/default.nix | 54 +- .../rocm-modules/6/rocrand/default.nix | 54 +- .../rocm-modules/6/rocsolver/default.nix | 108 +- .../rocm-modules/6/rocsparse/default.nix | 79 +- .../rocm-modules/6/rocthrust/default.nix | 54 +- .../rocm-modules/6/roctracer/default.nix | 51 +- .../rocm-modules/6/rocwmma/default.nix | 87 +- .../rocm-modules/6/rpp/default.nix | 56 +- .../rocm-modules/6/tensile/default.nix | 29 +- .../ruby-modules/bundled-common/default.nix | 3 +- .../ruby-modules/bundler-app/default.nix | 3 +- .../ruby-modules/bundler-env/default.nix | 3 +- .../ruby-modules/gem-config/default.nix | 181 ++-- pkgs/development/ruby-modules/gem/default.nix | 21 +- .../build-skaware-package.nix | 25 +- .../s6-networking/default.nix | 53 +- .../skaware-packages/skalibs/default.nix | 63 +- .../tcl-modules/by-name/ti/tix/package.nix | 35 +- pkgs/development/tools/ammonite/default.nix | 17 +- .../tools/analysis/qcachegrind/default.nix | 47 +- .../tools/analysis/radare2/default.nix | 39 +- .../tools/analysis/rizin/cutter.nix | 27 +- .../tools/analysis/rizin/default.nix | 27 +- .../tools/analysis/rizin/rz-ghidra.nix | 38 +- .../build-managers/bazel/bazel_5/default.nix | 51 +- .../build-managers/bazel/bazel_6/default.nix | 202 ++-- .../build-managers/bazel/bazel_7/default.nix | 206 ++-- .../tools/build-managers/bazel/cpp-test.nix | 23 +- .../tools/build-managers/bazel/java-test.nix | 35 +- .../build-managers/bazel/protobuf-test.nix | 41 +- .../tools/build-managers/gradle/default.nix | 107 +- .../build-managers/gradle/update-deps.nix | 3 +- .../tools/build-managers/sbt/scala-native.nix | 50 +- pkgs/development/tools/buildah/default.nix | 21 +- pkgs/development/tools/buildah/wrapper.nix | 15 +- pkgs/development/tools/comby/default.nix | 62 +- .../buildbot/master.nix | 66 +- .../hercules-ci-agent/default.nix | 82 +- .../tools/database/sqlitebrowser/default.nix | 3 +- .../tools/devpi-server/default.nix | 3 +- pkgs/development/tools/devpod/default.nix | 52 +- .../tools/documentation/doxygen/default.nix | 24 +- pkgs/development/tools/electron/common.nix | 148 ++- pkgs/development/tools/godot/3/default.nix | 9 +- pkgs/development/tools/godot/common.nix | 179 ++-- .../tools/haskell/hadrian/hadrian.nix | 47 +- .../tools/haskell/lambdabot/default.nix | 24 +- pkgs/development/tools/hotdoc/default.nix | 17 +- pkgs/development/tools/ilspycmd/default.nix | 13 +- .../tools/misc/binutils/2.38/default.nix | 201 ++-- .../tools/misc/binutils/2.38/libbfd.nix | 6 +- .../tools/misc/binutils/default.nix | 161 ++- .../tools/misc/creduce/default.nix | 58 +- pkgs/development/tools/misc/gdb/default.nix | 117 ++- .../tools/misc/luarocks/default.nix | 55 +- pkgs/development/tools/misc/premake/5.nix | 44 +- .../development/tools/misc/sqitch/default.nix | 27 +- .../development/tools/misc/texinfo/common.nix | 93 +- pkgs/development/tools/mysql-shell/8.nix | 72 +- .../tools/mysql-shell/innovation.nix | 72 +- .../tools/ocaml/camlp4/default.nix | 17 +- .../tools/ocaml/findlib/default.nix | 13 +- .../tools/ocaml/merlin/dot-merlin-reader.nix | 25 +- pkgs/development/tools/ocaml/opam/default.nix | 3 +- .../tools/parsing/flex/default.nix | 15 +- .../tools/parsing/tree-sitter/default.nix | 59 +- .../tools/profiling/heaptrack/default.nix | 35 +- .../tools/rust/bindgen/default.nix | 12 +- .../development/tools/rust/rustup/default.nix | 19 +- pkgs/development/tools/simavr/default.nix | 3 +- pkgs/development/tools/wails/default.nix | 21 +- pkgs/development/tools/wasmedge/default.nix | 13 +- .../tools/yarn2nix-moretea/default.nix | 24 +- pkgs/development/web/grails/default.nix | 25 +- pkgs/development/web/nodejs/nodejs.nix | 335 ++++--- pkgs/development/web/nodejs/v20.nix | 3 +- pkgs/development/web/playwright/webkit.nix | 23 +- pkgs/games/anki/addons/anki-utils.nix | 6 +- pkgs/games/anki/default.nix | 6 +- pkgs/games/armagetronad/default.nix | 68 +- pkgs/games/arx-libertatis/default.nix | 51 +- pkgs/games/blightmud/default.nix | 9 +- pkgs/games/cataclysm-dda/common.nix | 35 +- pkgs/games/chiaki/default.nix | 33 +- pkgs/games/construo/default.nix | 17 +- pkgs/games/crawl/default.nix | 79 +- pkgs/games/cutemaze/default.nix | 15 +- .../doom-ports/zandronum/alpha/default.nix | 59 +- pkgs/games/doom-ports/zandronum/default.nix | 59 +- pkgs/games/dwarf-fortress/dfhack/default.nix | 51 +- .../dwarf-therapist/wrapper.nix | 15 +- pkgs/games/dwarf-fortress/game.nix | 77 +- pkgs/games/dwarf-fortress/lazy-pack.nix | 37 +- pkgs/games/dwarf-fortress/unfuck.nix | 47 +- pkgs/games/dwarf-fortress/wrapper/default.nix | 45 +- pkgs/games/freeciv/default.nix | 91 +- pkgs/games/koboredux/default.nix | 21 +- pkgs/games/mudlet/default.nix | 89 +- pkgs/games/nethack/default.nix | 60 +- pkgs/games/openmw/default.nix | 30 +- pkgs/games/openttd/default.nix | 72 +- pkgs/games/openxray/default.nix | 17 +- pkgs/games/path-of-building/default.nix | 3 +- pkgs/games/quake2/yquake2/default.nix | 20 +- pkgs/games/quake2/yquake2/wrapper.nix | 29 +- pkgs/games/quakespasm/default.nix | 37 +- pkgs/games/quakespasm/vulkan.nix | 31 +- pkgs/games/scummvm/default.nix | 15 +- .../games/shattered-pixel-dungeon/generic.nix | 3 +- pkgs/games/spring/default.nix | 47 +- pkgs/games/xonotic/default.nix | 35 +- pkgs/kde/gear/akonadi/default.nix | 53 +- pkgs/kde/gear/audiotube/default.nix | 3 +- pkgs/kde/lib/mk-kde-derivation.nix | 48 +- pkgs/kde/plasma/breeze-plymouth/default.nix | 34 +- pkgs/misc/arm-trusted-firmware/default.nix | 34 +- pkgs/misc/cups/default.nix | 140 ++- pkgs/misc/drivers/epkowa/default.nix | 34 +- pkgs/misc/drivers/gutenprint/default.nix | 44 +- pkgs/misc/jackaudio/default.nix | 51 +- pkgs/misc/jackaudio/tools.nix | 25 +- pkgs/misc/opcua-client-gui/default.nix | 3 +- pkgs/misc/optee-os/default.nix | 29 +- pkgs/misc/uboot/default.nix | 38 +- .../bsd/freebsd/pkgs/compat/package.nix | 211 ++-- pkgs/os-specific/bsd/freebsd/pkgs/csu.nix | 3 +- pkgs/os-specific/bsd/freebsd/pkgs/install.nix | 19 +- .../bsd/freebsd/pkgs/libcMinimal.nix | 3 +- .../bsd/freebsd/pkgs/libcasper.nix | 3 +- pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix | 16 +- .../bsd/freebsd/pkgs/libnetbsd/package.nix | 3 +- .../bsd/freebsd/pkgs/libprocstat.nix | 3 +- pkgs/os-specific/bsd/freebsd/pkgs/libthr.nix | 3 +- pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix | 17 +- .../bsd/freebsd/pkgs/localedef.nix | 3 +- pkgs/os-specific/bsd/freebsd/pkgs/locales.nix | 3 +- pkgs/os-specific/bsd/freebsd/pkgs/make.nix | 19 +- .../bsd/freebsd/pkgs/mkDerivation.nix | 93 +- pkgs/os-specific/bsd/freebsd/pkgs/rc.nix | 81 +- .../os-specific/bsd/freebsd/pkgs/rtld-elf.nix | 3 +- .../bsd/freebsd/pkgs/stand-efi.nix | 3 +- .../bsd/freebsd/pkgs/sys/package.nix | 46 +- .../bsd/netbsd/pkgs/compat/package.nix | 90 +- .../bsd/netbsd/pkgs/make-rules.nix | 85 +- pkgs/os-specific/bsd/netbsd/pkgs/make.nix | 10 +- pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix | 30 +- .../bsd/openbsd/pkgs/mkDerivation.nix | 3 +- .../bsd/openbsd/pkgs/sys/package.nix | 12 +- .../apple-source-releases/ICU/package.nix | 54 +- .../libiconv/package.nix | 30 +- .../apple-source-releases/libpcap/package.nix | 6 +- .../mkAppleDerivation.nix | 3 +- .../text_cmds/package.nix | 49 +- pkgs/os-specific/linux/ax99100/default.nix | 20 +- .../linux/bionic-prebuilt/default.nix | 85 +- pkgs/os-specific/linux/busybox/default.nix | 6 +- pkgs/os-specific/linux/conky/default.nix | 90 +- pkgs/os-specific/linux/corefreq/default.nix | 3 +- pkgs/os-specific/linux/dmraid/default.nix | 50 +- pkgs/os-specific/linux/drbd/utils.nix | 3 +- pkgs/os-specific/linux/exfat/default.nix | 15 +- pkgs/os-specific/linux/ffado/default.nix | 85 +- .../linux/firmware/ath9k/default.nix | 53 +- .../linux/firmware/raspberrypi/armstubs.nix | 39 +- pkgs/os-specific/linux/freeipa/default.nix | 3 +- pkgs/os-specific/linux/fuse/common.nix | 38 +- pkgs/os-specific/linux/guvcview/default.nix | 61 +- pkgs/os-specific/linux/iptables/default.nix | 3 +- pkgs/os-specific/linux/iputils/default.nix | 17 +- .../linux/kernel-headers/default.nix | 48 +- .../linux/kernel/common-config.nix | 672 +++++++------ pkgs/os-specific/linux/kernel/generic.nix | 72 +- pkgs/os-specific/linux/kernel/linux-rpi.nix | 76 +- .../linux/kernel/manual-config.nix | 151 ++- .../os-specific/linux/kernel/perf/default.nix | 145 ++- pkgs/os-specific/linux/kmod/default.nix | 49 +- pkgs/os-specific/linux/lvm2/common.nix | 134 ++- .../minimal-bootstrap/gnumake/default.nix | 3 +- .../linux/mstflint_access/default.nix | 3 +- pkgs/os-specific/linux/nftables/default.nix | 32 +- pkgs/os-specific/linux/nvidia-x11/generic.nix | 23 +- .../os-specific/linux/nvidia-x11/settings.nix | 57 +- pkgs/os-specific/linux/prl-tools/default.nix | 3 +- pkgs/os-specific/linux/procps-ng/default.nix | 21 +- pkgs/os-specific/linux/rtl8189es/default.nix | 3 +- pkgs/os-specific/linux/rtl8723ds/default.nix | 13 +- pkgs/os-specific/linux/rtl8812au/default.nix | 20 +- pkgs/os-specific/linux/rtl8821au/default.nix | 26 +- pkgs/os-specific/linux/rtl8852au/default.nix | 20 +- pkgs/os-specific/linux/rtl8852bu/default.nix | 20 +- pkgs/os-specific/linux/scx/scx_cscheds.nix | 23 +- pkgs/os-specific/linux/scx/scx_full.nix | 8 +- pkgs/os-specific/linux/sgx/sdk/default.nix | 13 +- pkgs/os-specific/linux/sgx/sdk/ipp-crypto.nix | 3 +- pkgs/os-specific/linux/sssd/default.nix | 45 +- pkgs/os-specific/linux/sysdig/default.nix | 75 +- pkgs/os-specific/linux/systemd/default.nix | 858 ++++++++-------- pkgs/os-specific/linux/tbs/default.nix | 3 +- pkgs/os-specific/linux/udisks/2-default.nix | 3 +- pkgs/os-specific/linux/v4l-utils/default.nix | 45 +- pkgs/os-specific/linux/wireguard/default.nix | 16 +- .../linux/wpa_supplicant/default.nix | 195 ++-- pkgs/os-specific/linux/zfs/2_2.nix | 13 +- pkgs/os-specific/linux/zfs/2_3.nix | 13 +- pkgs/os-specific/linux/zfs/generic.nix | 128 ++- pkgs/servers/asterisk/default.nix | 52 +- pkgs/servers/authelia/default.nix | 21 +- pkgs/servers/code-server/default.nix | 172 ++-- pkgs/servers/dns/knot-resolver/default.nix | 128 ++- pkgs/servers/dns/nsd/default.nix | 17 +- pkgs/servers/firebird/default.nix | 3 +- .../build-custom-component/default.nix | 6 +- .../custom-components/frigate/package.nix | 21 +- .../yandex-station/package.nix | 3 +- pkgs/servers/http/apache-httpd/2.4.nix | 84 +- .../apache-modules/mod_python/default.nix | 27 +- pkgs/servers/http/couchdb/3.nix | 21 +- pkgs/servers/http/nginx/generic.nix | 186 ++-- pkgs/servers/http/tengine/default.nix | 142 +-- pkgs/servers/irc/solanum/default.nix | 25 +- pkgs/servers/klipper/klipper-flash.nix | 15 +- pkgs/servers/mail/mailman/hyperkitty.nix | 3 +- pkgs/servers/mail/mailman/postorius.nix | 3 +- pkgs/servers/mail/nullmailer/default.nix | 3 +- pkgs/servers/mail/public-inbox/default.nix | 31 +- pkgs/servers/mir/common.nix | 149 ++- pkgs/servers/monitoring/grafana/default.nix | 3 +- .../grafana/plugins/grafana-plugin.nix | 6 +- pkgs/servers/monitoring/icinga2/default.nix | 3 +- .../monitoring/prometheus/xmpp-alerts.nix | 25 +- pkgs/servers/monitoring/zabbix/proxy.nix | 96 +- pkgs/servers/monitoring/zabbix/server.nix | 102 +- pkgs/servers/mpd/default.nix | 108 +- .../nextcloud/packages/apps/recognize.nix | 54 +- pkgs/servers/nosql/influxdb/default.nix | 19 +- pkgs/servers/nosql/influxdb2/default.nix | 19 +- pkgs/servers/nosql/mongodb/7.0.nix | 3 +- pkgs/servers/nosql/mongodb/mongodb.nix | 136 ++- pkgs/servers/nosql/rethinkdb/default.nix | 21 +- pkgs/servers/openafs/1.8/default.nix | 138 ++- pkgs/servers/openafs/1.8/module.nix | 3 +- pkgs/servers/pulseaudio/default.nix | 213 ++-- pkgs/servers/samba/4.x.nix | 332 ++++--- pkgs/servers/search/elasticsearch/7.x.nix | 3 +- pkgs/servers/shishi/default.nix | 29 +- .../sql/mariadb/connector-c/default.nix | 36 +- pkgs/servers/sql/mariadb/default.nix | 183 ++-- pkgs/servers/sql/mysql/8.0.x.nix | 50 +- pkgs/servers/sql/percona-server/8_0.nix | 60 +- pkgs/servers/sql/percona-server/8_4.nix | 208 ++-- pkgs/servers/sql/postgresql/ext/h3-pg.nix | 17 +- pkgs/servers/sql/postgresql/ext/postgis.nix | 86 +- pkgs/servers/sql/postgresql/generic.nix | 518 +++++----- pkgs/servers/sql/postgresql/libpq.nix | 39 +- .../postgresql/postgresqlBuildExtension.nix | 94 +- pkgs/servers/varnish/default.nix | 25 +- pkgs/servers/web-apps/discourse/default.nix | 47 +- pkgs/servers/web-apps/lemmy/server.nix | 11 +- .../web-apps/wordpress/packages/default.nix | 3 +- pkgs/servers/x11/xorg/overrides.nix | 113 +-- pkgs/servers/x11/xorg/xwayland.nix | 85 +- pkgs/servers/xmpp/prosody/default.nix | 3 +- pkgs/shells/bash/5.nix | 116 +-- .../shells/fish/plugins/build-fish-plugin.nix | 3 +- pkgs/shells/fish/plugins/fzf-fish.nix | 37 +- pkgs/shells/nushell/default.nix | 26 +- pkgs/stdenv/freebsd/default.nix | 17 +- pkgs/stdenv/generic/check-meta.nix | 6 +- pkgs/stdenv/generic/make-derivation.nix | 17 +- pkgs/stdenv/linux/default.nix | 47 +- pkgs/stdenv/linux/stdenv-bootstrap-tools.nix | 277 +++--- pkgs/stdenv/linux/test-bootstrap-tools.nix | 89 +- pkgs/stdenv/native/default.nix | 33 +- pkgs/test/auto-patchelf-hook/package.nix | 15 +- pkgs/test/cc-wrapper/hardening.nix | 3 +- pkgs/test/cross/default.nix | 67 +- .../dotnet/use-dotnet-from-env/default.nix | 8 +- .../upstreamStackHpackVersion/default.nix | 19 +- pkgs/test/overriding.nix | 15 +- pkgs/test/php/default.nix | 40 +- pkgs/test/stdenv/default.nix | 24 +- pkgs/test/stdenv/no-broken-symlinks.nix | 9 +- pkgs/test/texlive/default.nix | 3 +- pkgs/tools/X11/virtualgl/default.nix | 39 +- .../admin/google-cloud-sdk/components.nix | 15 +- .../google-cloud-sdk/withExtraComponents.nix | 6 +- pkgs/tools/admin/ibmcloud-cli/default.nix | 3 +- pkgs/tools/admin/pulumi-bin/default.nix | 38 +- pkgs/tools/admin/turbovnc/default.nix | 55 +- pkgs/tools/archivers/p7zip/default.nix | 42 +- pkgs/tools/archivers/rar/default.nix | 3 +- pkgs/tools/archivers/unar/default.nix | 53 +- pkgs/tools/archivers/zpaq/default.nix | 3 +- pkgs/tools/audio/beets/common.nix | 21 +- pkgs/tools/audio/beets/plugins/filetote.nix | 3 +- .../backup/percona-xtrabackup/generic.nix | 60 +- pkgs/tools/compression/bzip3/default.nix | 3 +- pkgs/tools/compression/gzip/default.nix | 23 +- pkgs/tools/compression/zstd/default.nix | 44 +- pkgs/tools/filesystems/ceph/arrow-cpp-19.nix | 194 ++-- pkgs/tools/filesystems/ceph/default.nix | 3 +- .../ceph/old-python-packages/cryptography.nix | 35 +- pkgs/tools/filesystems/garage/default.nix | 48 +- pkgs/tools/filesystems/irods/default.nix | 28 +- pkgs/tools/games/alice-tools/default.nix | 65 +- pkgs/tools/games/pokefinder/default.nix | 53 +- pkgs/tools/graphics/asymptote/default.nix | 87 +- pkgs/tools/graphics/gnuplot/default.nix | 63 +- pkgs/tools/graphics/graphviz/default.nix | 6 +- pkgs/tools/graphics/mangohud/default.nix | 29 +- pkgs/tools/graphics/nifskope/default.nix | 3 +- pkgs/tools/graphics/pfstools/default.nix | 37 +- .../graphics/vulkan-caps-viewer/default.nix | 3 +- pkgs/tools/graphics/zbar/default.nix | 113 ++- .../fcitx5/fcitx5-chinese-addons.nix | 3 +- .../inputmethods/fcitx5/fcitx5-configtool.nix | 55 +- pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix | 6 +- pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix | 17 +- .../tools/inputmethods/fcitx5/with-addons.nix | 21 +- .../ibus-engines/ibus-cangjie/default.nix | 3 +- pkgs/tools/inputmethods/ibus/default.nix | 156 ++- .../inputmethods/input-remapper/default.nix | 34 +- .../inputmethods/skk/skk-dicts/default.nix | 46 +- pkgs/tools/inputmethods/uim/default.nix | 121 ++- .../misc/bat-extras/buildBatExtrasPkg.nix | 28 +- .../tools/misc/bat-extras/modules/batdiff.nix | 3 +- .../misc/bat-extras/modules/batwatch.nix | 3 +- pkgs/tools/misc/bat-extras/modules/core.nix | 3 +- pkgs/tools/misc/ckb-next/default.nix | 3 +- pkgs/tools/misc/coreutils/default.nix | 171 ++-- pkgs/tools/misc/file/default.nix | 3 +- pkgs/tools/misc/graylog/graylog.nix | 21 +- pkgs/tools/misc/grub/default.nix | 74 +- pkgs/tools/misc/hdf5/default.nix | 99 +- pkgs/tools/misc/moreutils/default.nix | 21 +- pkgs/tools/misc/qflipper/default.nix | 33 +- pkgs/tools/misc/rmlint/default.nix | 54 +- pkgs/tools/misc/tlp/default.nix | 17 +- pkgs/tools/misc/tremor-rs/default.nix | 32 +- pkgs/tools/misc/ttfautohint/default.nix | 3 +- pkgs/tools/misc/vimpager/latest.nix | 8 +- pkgs/tools/misc/youtube-dl/default.nix | 7 +- pkgs/tools/networking/bitmask-vpn/default.nix | 67 +- .../networking/dd-agent/datadog-agent.nix | 50 +- pkgs/tools/networking/gp-saml-gui/default.nix | 3 +- pkgs/tools/networking/lxi-tools/default.nix | 36 +- .../networking/maubot/plugins/generated.nix | 12 +- pkgs/tools/networking/miniupnpd/default.nix | 19 +- pkgs/tools/networking/mtr/default.nix | 13 +- .../networking/networkmanager/default.nix | 68 +- pkgs/tools/networking/openconnect/common.nix | 25 +- pkgs/tools/networking/openssh/common.nix | 107 +- pkgs/tools/networking/openvpn/default.nix | 53 +- pkgs/tools/networking/pdsh/default.nix | 3 +- pkgs/tools/networking/spoofer/default.nix | 3 +- .../akku/akkuDerivation.nix | 6 +- .../package-management/apk-tools/default.nix | 20 +- .../disnix/dysnomia/default.nix | 42 +- .../package-management/lix/common-lix.nix | 221 ++--- .../lix/common-nix-eval-jobs.nix | 20 +- .../nix/common-autoconf.nix | 233 +++-- .../package-management/nix/common-meson.nix | 161 ++- .../package-management/nix/dependencies.nix | 63 +- .../nix/modular/packaging/components.nix | 15 +- .../nix/modular/packaging/everything.nix | 125 ++- .../nix/modular/src/libcmd/package.nix | 3 +- .../nix/modular/src/libexpr/package.nix | 6 +- .../modular/src/libfetchers-tests/package.nix | 25 +- .../nix/modular/src/libflake-c/package.nix | 21 +- .../nix/modular/src/libstore/package.nix | 36 +- .../nix/modular/src/libutil/package.nix | 19 +- .../nix/modular/src/perl/package.nix | 3 +- .../nix/modular/tests/functional/package.nix | 35 +- .../tools/package-management/nix/nix-perl.nix | 69 +- .../package-management/packagekit/default.nix | 58 +- .../protontricks/default.nix | 23 +- pkgs/tools/package-management/rpm/default.nix | 136 ++- pkgs/tools/security/aflplusplus/default.nix | 76 +- pkgs/tools/security/chipsec/default.nix | 15 +- pkgs/tools/security/cve-bin-tool/default.nix | 6 +- pkgs/tools/security/ggshield/default.nix | 25 +- pkgs/tools/security/ghidra/build.nix | 58 +- pkgs/tools/security/ghidra/default.nix | 3 +- .../extensions/gnudisassembler/default.nix | 3 +- .../tools/security/ghidra/with-extensions.nix | 28 +- pkgs/tools/security/gnupg/24.nix | 140 ++- pkgs/tools/security/gopass/default.nix | 21 +- pkgs/tools/security/gpg-tui/default.nix | 25 +- pkgs/tools/security/nitrokey-app2/default.nix | 13 +- pkgs/tools/security/pass/default.nix | 80 +- pkgs/tools/security/pinentry/default.nix | 40 +- pkgs/tools/security/proxmark3/default.nix | 51 +- pkgs/tools/security/stoken/default.nix | 15 +- pkgs/tools/system/collectd/default.nix | 16 +- pkgs/tools/system/collectd/plugins.nix | 50 +- pkgs/tools/system/hw-probe/default.nix | 37 +- pkgs/tools/system/netdata/default.nix | 185 ++-- pkgs/tools/system/nvtop/build-nvtop.nix | 28 +- pkgs/tools/system/plan9port/default.nix | 39 +- pkgs/tools/system/rsyslog/default.nix | 61 +- pkgs/tools/system/testdisk/default.nix | 29 +- pkgs/tools/text/gawk/default.nix | 24 +- pkgs/tools/text/gawk/gawkextlib.nix | 12 +- pkgs/tools/text/gnugrep/default.nix | 3 +- pkgs/tools/text/highlight/default.nix | 24 +- pkgs/tools/text/mdcat/default.nix | 25 +- pkgs/tools/text/mecab/ipadic.nix | 21 +- pkgs/tools/text/patchutils/generic.nix | 17 +- pkgs/tools/typesetting/asciidoc/default.nix | 264 ++--- pkgs/tools/typesetting/tex/nix/default.nix | 3 +- pkgs/tools/typesetting/tex/tetex/default.nix | 27 +- pkgs/tools/typesetting/tex/texlive/bin.nix | 236 +++-- .../typesetting/tex/texlive/build-tex-env.nix | 6 +- .../tex/texlive/build-texlive-package.nix | 74 +- .../tex/texlive/tlpdb-overrides.nix | 7 +- pkgs/tools/virtualization/mkosi/default.nix | 64 +- .../tools/virtualization/supermin/default.nix | 21 +- pkgs/top-level/all-packages.nix | 12 +- pkgs/top-level/darwin-aliases.nix | 77 +- pkgs/top-level/darwin-packages.nix | 3 +- pkgs/top-level/haxe-packages.nix | 3 +- pkgs/top-level/linux-kernels.nix | 71 +- pkgs/top-level/perl-packages.nix | 99 +- pkgs/top-level/php-packages.nix | 899 +++++++++-------- pkgs/top-level/release-alternatives.nix | 6 +- pkgs/top-level/release-attrpaths-superset.nix | 3 +- pkgs/top-level/release-python.nix | 3 +- pkgs/top-level/release.nix | 340 ++++--- pkgs/top-level/stage.nix | 9 +- pkgs/top-level/unixtools.nix | 13 +- pkgs/top-level/variants.nix | 15 +- 5118 files changed, 98809 insertions(+), 101507 deletions(-) diff --git a/doc/hooks/tauri.section.md b/doc/hooks/tauri.section.md index 32881813d42d..6804e4b5a055 100644 --- a/doc/hooks/tauri.section.md +++ b/doc/hooks/tauri.section.md @@ -45,7 +45,8 @@ rustPlatform.buildRustPackage (finalAttrs: { # Make sure we can find our libraries pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ glib-networking # Most Tauri apps need networking diff --git a/doc/languages-frameworks/coq.section.md b/doc/languages-frameworks/coq.section.md index 5da705964fa8..8f35da176fc7 100644 --- a/doc/languages-frameworks/coq.section.md +++ b/doc/languages-frameworks/coq.section.md @@ -177,10 +177,8 @@ For instance, here is how you could add some code to be performed in the derivat ```nix coqPackages.multinomials.overrideAttrs (oldAttrs: { - postInstall = - oldAttrs.postInstall or "" - + '' - echo "you can do anything you want here" - ''; + postInstall = oldAttrs.postInstall or "" + '' + echo "you can do anything you want here" + ''; }) ``` diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index 8231ee0a8073..e79a324b236c 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -1376,20 +1376,19 @@ This is especially helpful to select tests or specify flags conditionally: ```nix { - disabledTests = - [ - # touches network - "download" - "update" - ] - ++ lib.optionals (pythonAtLeast "3.8") [ - # broken due to python3.8 async changes - "async" - ] - ++ lib.optionals stdenv.buildPlatform.isDarwin [ - # can fail when building with other packages - "socket" - ]; + disabledTests = [ + # touches network + "download" + "update" + ] + ++ lib.optionals (pythonAtLeast "3.8") [ + # broken due to python3.8 async changes + "async" + ] + ++ lib.optionals stdenv.buildPlatform.isDarwin [ + # can fail when building with other packages + "socket" + ]; } ``` @@ -2035,7 +2034,8 @@ and letting the package requiring the extra add the list to its dependencies { dependencies = [ # ... - ] ++ dask.optional-dependencies.complete; + ] + ++ dask.optional-dependencies.complete; } ``` diff --git a/doc/stdenv/cross-compilation.chapter.md b/doc/stdenv/cross-compilation.chapter.md index fcaa659f12e0..d901c2cf974c 100644 --- a/doc/stdenv/cross-compilation.chapter.md +++ b/doc/stdenv/cross-compilation.chapter.md @@ -171,7 +171,8 @@ e.g. { nativeBuildInputs = [ meson - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; } ``` diff --git a/lib/customisation.nix b/lib/customisation.nix index c73f2f2911bb..7c24dc242d06 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -446,16 +446,15 @@ rec { let outputs = drv.outputs or [ "out" ]; - commonAttrs = - { - inherit (drv) name system meta; - inherit outputs; - } - // optionalAttrs (drv._hydraAggregate or false) { - _hydraAggregate = true; - constituents = map hydraJob (flatten drv.constituents); - } - // (listToAttrs outputsList); + commonAttrs = { + inherit (drv) name system meta; + inherit outputs; + } + // optionalAttrs (drv._hydraAggregate or false) { + _hydraAggregate = true; + constituents = map hydraJob (flatten drv.constituents); + } + // (listToAttrs outputsList); makeOutput = outputName: diff --git a/lib/deprecated/misc.nix b/lib/deprecated/misc.nix index 230efed40ffd..22015c9b20aa 100644 --- a/lib/deprecated/misc.nix +++ b/lib/deprecated/misc.nix @@ -355,8 +355,11 @@ let mergeAttrByFunc = x: y: let - mergeAttrBy2 = - { mergeAttrBy = mergeAttrs; } // (maybeAttr "mergeAttrBy" { } x) // (maybeAttr "mergeAttrBy" { } y); + mergeAttrBy2 = { + mergeAttrBy = mergeAttrs; + } + // (maybeAttr "mergeAttrBy" { } x) + // (maybeAttr "mergeAttrBy" { } y); in foldr mergeAttrs { } [ x diff --git a/lib/modules.nix b/lib/modules.nix index 23ee8201f7c5..36a2ee5c4181 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -886,19 +886,18 @@ let path = showOption loc; depth = length loc; - paragraphs = - [ - "In module ${file}: expected an option declaration at option path `${path}` but got an attribute set with type ${actualTag}" - ] - ++ optional (actualTag == "option-type") '' - When declaring an option, you must wrap the type in a `mkOption` call. It should look somewhat like: - ${comment} - ${name} = lib.mkOption { - description = ...; - type = ; - ... - }; - ''; + paragraphs = [ + "In module ${file}: expected an option declaration at option path `${path}` but got an attribute set with type ${actualTag}" + ] + ++ optional (actualTag == "option-type") '' + When declaring an option, you must wrap the type in a `mkOption` call. It should look somewhat like: + ${comment} + ${name} = lib.mkOption { + description = ...; + type = ; + ... + }; + ''; # Ideally we'd know the exact syntax they used, but short of that, # we can only reliably repeat the last. However, we repeat the @@ -1627,25 +1626,24 @@ let ) from ); - config = - { - warnings = filter (x: x != "") ( - map ( - f: - let - val = getAttrFromPath f config; - opt = getAttrFromPath f options; - in - optionalString (val != "_mkMergedOptionModule") - "The option `${showOption f}' defined in ${showFiles opt.files} has been changed to `${showOption to}' that has a different type. Please read `${showOption to}' documentation and update your configuration accordingly." - ) from - ); - } - // setAttrByPath to ( - mkMerge ( - optional (any (f: (getAttrFromPath f config) != "_mkMergedOptionModule") from) (mergeFn config) - ) + config = { + warnings = filter (x: x != "") ( + map ( + f: + let + val = getAttrFromPath f config; + opt = getAttrFromPath f options; + in + optionalString (val != "_mkMergedOptionModule") + "The option `${showOption f}' defined in ${showFiles opt.files} has been changed to `${showOption to}' that has a different type. Please read `${showOption to}' documentation and update your configuration accordingly." + ) from ); + } + // setAttrByPath to ( + mkMerge ( + optional (any (f: (getAttrFromPath f config) != "_mkMergedOptionModule") from) (mergeFn config) + ) + ); }; /** diff --git a/lib/options.nix b/lib/options.nix index 25f5cefb5da9..5d2b32c497a8 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -572,30 +572,29 @@ rec { opt: let name = showOption opt.loc; - docOption = - { - loc = opt.loc; - inherit name; - description = opt.description or null; - declarations = filter (x: x != unknownModule) opt.declarations; - internal = opt.internal or false; - visible = if (opt ? visible && opt.visible == "shallow") then true else opt.visible or true; - readOnly = opt.readOnly or false; - type = opt.type.description or "unspecified"; - } - // optionalAttrs (opt ? example) { - example = builtins.addErrorContext "while evaluating the example of option `${name}`" ( - renderOptionValue opt.example - ); - } - // optionalAttrs (opt ? defaultText || opt ? default) { - default = builtins.addErrorContext "while evaluating the ${ - if opt ? defaultText then "defaultText" else "default value" - } of option `${name}`" (renderOptionValue (opt.defaultText or opt.default)); - } - // optionalAttrs (opt ? relatedPackages && opt.relatedPackages != null) { - inherit (opt) relatedPackages; - }; + docOption = { + loc = opt.loc; + inherit name; + description = opt.description or null; + declarations = filter (x: x != unknownModule) opt.declarations; + internal = opt.internal or false; + visible = if (opt ? visible && opt.visible == "shallow") then true else opt.visible or true; + readOnly = opt.readOnly or false; + type = opt.type.description or "unspecified"; + } + // optionalAttrs (opt ? example) { + example = builtins.addErrorContext "while evaluating the example of option `${name}`" ( + renderOptionValue opt.example + ); + } + // optionalAttrs (opt ? defaultText || opt ? default) { + default = builtins.addErrorContext "while evaluating the ${ + if opt ? defaultText then "defaultText" else "default value" + } of option `${name}`" (renderOptionValue (opt.defaultText or opt.default)); + } + // optionalAttrs (opt ? relatedPackages && opt.relatedPackages != null) { + inherit (opt) relatedPackages; + }; subOptions = let diff --git a/lib/path/tests/default.nix b/lib/path/tests/default.nix index 2ea43e04c3b7..1d6a55181f9f 100644 --- a/lib/path/tests/default.nix +++ b/lib/path/tests/default.nix @@ -14,14 +14,13 @@ pkgs.runCommand "lib-path-tests" { - nativeBuildInputs = - [ - nixVersions.stable - ] - ++ (with pkgs; [ - jq - bc - ]); + nativeBuildInputs = [ + nixVersions.stable + ] + ++ (with pkgs; [ + jq + bc + ]); } '' # Needed to make Nix evaluation work diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix index 91fc2ef0bbfe..95c9d0da341a 100644 --- a/lib/systems/architectures.nix +++ b/lib/systems/architectures.nix @@ -477,7 +477,8 @@ rec { "armv9.1-a" = [ "armv9-a" "armv8.6-a" - ] ++ inferiors."armv8.6-a"; + ] + ++ inferiors."armv8.6-a"; "armv9.2-a" = lib.unique ( [ "armv9.1-a" @@ -503,12 +504,14 @@ rec { "armv8.2-a" "cortex-a53" "cortex-a72" - ] ++ inferiors."armv8.2-a"; + ] + ++ inferiors."armv8.2-a"; cortex-a76 = [ "armv8.2-a" "cortex-a53" "cortex-a72" - ] ++ inferiors."armv8.2-a"; + ] + ++ inferiors."armv8.2-a"; # Ampere ampere1 = withInferiors [ diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 6f5be39d29ac..edb69cc43194 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -83,486 +83,485 @@ let # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. rust = args.rust or args.rustc or { }; - final = - { - # Prefer to parse `config` as it is strictly more informative. - parsed = parse.mkSystemFromString (args.config or allArgs.system); - # This can be losslessly-extracted from `parsed` iff parsing succeeds. - system = parse.doubleFromSystem final.parsed; - # TODO: This currently can't be losslessly-extracted from `parsed`, for example - # because of -mingw32. - config = parse.tripleFromSystem final.parsed; - # Determine whether we can execute binaries built for the provided platform. - canExecute = - platform: - final.isAndroid == platform.isAndroid - && parse.isCompatible final.parsed.cpu platform.parsed.cpu - && final.parsed.kernel == platform.parsed.kernel - && ( - # Only perform this check when cpus have the same type; - # assume compatible cpu have all the instructions included - final.parsed.cpu == platform.parsed.cpu - -> - # if both have gcc.arch defined, check whether final can execute the given platform - ( - (final ? gcc.arch && platform ? gcc.arch) - -> architectures.canExecute final.gcc.arch platform.gcc.arch - ) - # if platform has gcc.arch defined but final doesn't, don't assume it can be executed - || (platform ? gcc.arch -> !(final ? gcc.arch)) - ); + final = { + # Prefer to parse `config` as it is strictly more informative. + parsed = parse.mkSystemFromString (args.config or allArgs.system); + # This can be losslessly-extracted from `parsed` iff parsing succeeds. + system = parse.doubleFromSystem final.parsed; + # TODO: This currently can't be losslessly-extracted from `parsed`, for example + # because of -mingw32. + config = parse.tripleFromSystem final.parsed; + # Determine whether we can execute binaries built for the provided platform. + canExecute = + platform: + final.isAndroid == platform.isAndroid + && parse.isCompatible final.parsed.cpu platform.parsed.cpu + && final.parsed.kernel == platform.parsed.kernel + && ( + # Only perform this check when cpus have the same type; + # assume compatible cpu have all the instructions included + final.parsed.cpu == platform.parsed.cpu + -> + # if both have gcc.arch defined, check whether final can execute the given platform + ( + (final ? gcc.arch && platform ? gcc.arch) + -> architectures.canExecute final.gcc.arch platform.gcc.arch + ) + # if platform has gcc.arch defined but final doesn't, don't assume it can be executed + || (platform ? gcc.arch -> !(final ? gcc.arch)) + ); - isCompatible = - _: - throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details"; - # Derived meta-data - useLLVM = final.isFreeBSD || final.isOpenBSD; + isCompatible = + _: + throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details"; + # Derived meta-data + useLLVM = final.isFreeBSD || final.isOpenBSD; - libc = - if final.isDarwin then - "libSystem" - else if final.isMinGW then - "msvcrt" - else if final.isWasi then - "wasilibc" - else if final.isWasm && !final.isWasi then - null - else if final.isRedox then - "relibc" - else if final.isMusl then - "musl" - else if final.isUClibc then - "uclibc" - else if final.isAndroid then - "bionic" - else if - final.isLinux # default - then - "glibc" - else if final.isFreeBSD then - "fblibc" - else if final.isOpenBSD then - "oblibc" - else if final.isNetBSD then - "nblibc" - else if final.isAvr then - "avrlibc" - else if final.isGhcjs then - null - else if final.isNone then - "newlib" - # TODO(@Ericson2314) think more about other operating systems - else - "native/impure"; - # Choose what linker we wish to use by default. Someday we might also - # choose the C compiler, runtime library, C++ standard library, etc. in - # this way, nice and orthogonally, and deprecate `useLLVM`. But due to - # the monolithic GCC build we cannot actually make those choices - # independently, so we are just doing `linker` and keeping `useLLVM` for - # now. - linker = - if final.useLLVM or false then - "lld" + libc = + if final.isDarwin then + "libSystem" + else if final.isMinGW then + "msvcrt" + else if final.isWasi then + "wasilibc" + else if final.isWasm && !final.isWasi then + null + else if final.isRedox then + "relibc" + else if final.isMusl then + "musl" + else if final.isUClibc then + "uclibc" + else if final.isAndroid then + "bionic" + else if + final.isLinux # default + then + "glibc" + else if final.isFreeBSD then + "fblibc" + else if final.isOpenBSD then + "oblibc" + else if final.isNetBSD then + "nblibc" + else if final.isAvr then + "avrlibc" + else if final.isGhcjs then + null + else if final.isNone then + "newlib" + # TODO(@Ericson2314) think more about other operating systems + else + "native/impure"; + # Choose what linker we wish to use by default. Someday we might also + # choose the C compiler, runtime library, C++ standard library, etc. in + # this way, nice and orthogonally, and deprecate `useLLVM`. But due to + # the monolithic GCC build we cannot actually make those choices + # independently, so we are just doing `linker` and keeping `useLLVM` for + # now. + linker = + if final.useLLVM or false then + "lld" + else if final.isDarwin then + "cctools" + # "bfd" and "gold" both come from GNU binutils. The existence of Gold + # is why we use the more obscure "bfd" and not "binutils" for this + # choice. + else + "bfd"; + # The standard lib directory name that non-nixpkgs binaries distributed + # for this platform normally assume. + libDir = + if final.isLinux then + if final.isx86_64 || final.isMips64 || final.isPower64 then "lib64" else "lib" + else + null; + extensions = + optionalAttrs final.hasSharedLibraries { + sharedLibrary = + if final.isDarwin then + ".dylib" + else if final.isWindows then + ".dll" + else + ".so"; + } + // { + staticLibrary = if final.isWindows then ".lib" else ".a"; + library = if final.isStatic then final.extensions.staticLibrary else final.extensions.sharedLibrary; + executable = if final.isWindows then ".exe" else ""; + }; + # Misc boolean options + useAndroidPrebuilt = false; + useiOSPrebuilt = false; + + # Output from uname + uname = { + # uname -s + system = + { + linux = "Linux"; + windows = "Windows"; + darwin = "Darwin"; + netbsd = "NetBSD"; + freebsd = "FreeBSD"; + openbsd = "OpenBSD"; + wasi = "Wasi"; + redox = "Redox"; + genode = "Genode"; + } + .${final.parsed.kernel.name} or null; + + # uname -m + processor = + if final.isPower64 then + "ppc64${optionalString final.isLittleEndian "le"}" + else if final.isPower then + "ppc${optionalString final.isLittleEndian "le"}" + else if final.isMips64 then + "mips64" # endianness is *not* included on mips64 else if final.isDarwin then - "cctools" - # "bfd" and "gold" both come from GNU binutils. The existence of Gold - # is why we use the more obscure "bfd" and not "binutils" for this - # choice. + final.darwinArch else - "bfd"; - # The standard lib directory name that non-nixpkgs binaries distributed - # for this platform normally assume. - libDir = - if final.isLinux then - if final.isx86_64 || final.isMips64 || final.isPower64 then "lib64" else "lib" + final.parsed.cpu.name; + + # uname -r + release = null; + }; + + # It is important that hasSharedLibraries==false when the platform has no + # dynamic library loader. Various tools (including the gcc build system) + # have knowledge of which platforms are incapable of dynamic linking, and + # will still build on/for those platforms with --enable-shared, but simply + # omit any `.so` build products such as libgcc_s.so. When that happens, + # it causes hard-to-troubleshoot build failures. + hasSharedLibraries = + with final; + ( + isAndroid + || isGnu + || isMusl # Linux (allows multiple libcs) + || isDarwin + || isSunOS + || isOpenBSD + || isFreeBSD + || isNetBSD # BSDs + || isCygwin + || isMinGW + || isWindows # Windows + || isWasm # WASM + ) + && !isStatic; + + # The difference between `isStatic` and `hasSharedLibraries` is mainly the + # addition of the `staticMarker` (see make-derivation.nix). Some + # platforms, like embedded machines without a libc (e.g. arm-none-eabi) + # don't support dynamic linking, but don't get the `staticMarker`. + # `pkgsStatic` sets `isStatic=true`, so `pkgsStatic.hostPlatform` always + # has the `staticMarker`. + isStatic = final.isWasi || final.isRedox; + + # Just a guess, based on `system` + inherit + ( + { + linux-kernel = args.linux-kernel or { }; + gcc = args.gcc or { }; + } + // platforms.select final + ) + linux-kernel + gcc + ; + + # TODO: remove after 23.05 is EOL, with an error pointing to the rust.* attrs. + rustc = args.rustc or { }; + + linuxArch = + if final.isAarch32 then + "arm" + else if final.isAarch64 then + "arm64" + else if final.isx86_32 then + "i386" + else if final.isx86_64 then + "x86_64" + # linux kernel does not distinguish microblaze/microblazeel + else if final.isMicroBlaze then + "microblaze" + else if final.isMips32 then + "mips" + else if final.isMips64 then + "mips" # linux kernel does not distinguish mips32/mips64 + else if final.isPower then + "powerpc" + else if final.isRiscV then + "riscv" + else if final.isS390 then + "s390" + else if final.isLoongArch64 then + "loongarch" + else + final.parsed.cpu.name; + + # https://source.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L81-106 + ubootArch = + if final.isx86_32 then + "x86" # not i386 + else if final.isMips64 then + "mips64" # uboot *does* distinguish between mips32/mips64 + else + final.linuxArch; # other cases appear to agree with linuxArch + + qemuArch = + if final.isAarch32 then + "arm" + else if final.isAarch64 then + "aarch64" + else if final.isS390 && !final.isS390x then + null + else if final.isx86_64 then + "x86_64" + else if final.isx86 then + "i386" + else if final.isMips64n32 then + "mipsn32${optionalString final.isLittleEndian "el"}" + else if final.isMips64 then + "mips64${optionalString final.isLittleEndian "el"}" + else + final.uname.processor; + + # Name used by UEFI for architectures. + efiArch = + if final.isx86_32 then + "ia32" + else if final.isx86_64 then + "x64" + else if final.isAarch32 then + "arm" + else if final.isAarch64 then + "aa64" + else + final.parsed.cpu.name; + + darwinArch = parse.darwinArch final.parsed.cpu; + + darwinPlatform = + if final.isMacOS then + "macos" + else if final.isiOS then + "ios" + else + null; + # The canonical name for this attribute is darwinSdkVersion, but some + # platforms define the old name "sdkVer". + darwinSdkVersion = final.sdkVer or "11.3"; + darwinMinVersion = final.darwinSdkVersion; + darwinMinVersionVariable = + if final.isMacOS then + "MACOSX_DEPLOYMENT_TARGET" + else if final.isiOS then + "IPHONEOS_DEPLOYMENT_TARGET" + else + null; + + # Handle Android SDK and NDK versions. + androidSdkVersion = args.androidSdkVersion or null; + androidNdkVersion = args.androidNdkVersion or null; + } + // ( + let + selectEmulator = + pkgs: + let + wine = (pkgs.winePackagesFor "wine${toString final.parsed.cpu.bits}").minimal; + in + # Note: we guarantee that the return value is either `null` or a path + # to an emulator program. That is, if an emulator requires additional + # arguments, a wrapper should be used. + if pkgs.stdenv.hostPlatform.canExecute final then + lib.getExe (pkgs.writeShellScriptBin "exec" ''exec "$@"'') + else if final.isWindows then + "${wine}/bin/wine${optionalString (final.parsed.cpu.bits == 64) "64"}" + else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux && final.qemuArch != null then + "${pkgs.qemu-user}/bin/qemu-${final.qemuArch}" + else if final.isWasi then + "${pkgs.wasmtime}/bin/wasmtime" + else if final.isMmix then + "${pkgs.mmixware}/bin/mmix" else null; - extensions = - optionalAttrs final.hasSharedLibraries { - sharedLibrary = - if final.isDarwin then - ".dylib" - else if final.isWindows then - ".dll" - else - ".so"; - } - // { - staticLibrary = if final.isWindows then ".lib" else ".a"; - library = if final.isStatic then final.extensions.staticLibrary else final.extensions.sharedLibrary; - executable = if final.isWindows then ".exe" else ""; - }; - # Misc boolean options - useAndroidPrebuilt = false; - useiOSPrebuilt = false; + in + { + emulatorAvailable = pkgs: (selectEmulator pkgs) != null; - # Output from uname - uname = { - # uname -s - system = - { - linux = "Linux"; - windows = "Windows"; - darwin = "Darwin"; - netbsd = "NetBSD"; - freebsd = "FreeBSD"; - openbsd = "OpenBSD"; - wasi = "Wasi"; - redox = "Redox"; - genode = "Genode"; - } - .${final.parsed.kernel.name} or null; + # whether final.emulator pkgs.pkgsStatic works + staticEmulatorAvailable = + pkgs: final.emulatorAvailable pkgs && (final.isLinux || final.isWasi || final.isMmix); - # uname -m - processor = - if final.isPower64 then - "ppc64${optionalString final.isLittleEndian "le"}" - else if final.isPower then - "ppc${optionalString final.isLittleEndian "le"}" + emulator = + pkgs: + if (final.emulatorAvailable pkgs) then + selectEmulator pkgs + else + throw "Don't know how to run ${final.config} executables."; + + } + ) + // mapAttrs (n: v: v final.parsed) inspect.predicates + // mapAttrs (n: v: v final.gcc.arch or "default") architectures.predicates + // args + // { + rust = rust // { + # Once args.rustc.platform.target-family is deprecated and + # removed, there will no longer be any need to modify any + # values from args.rust.platform, so we can drop all the + # "args ? rust" etc. checks, and merge args.rust.platform in + # /after/. + platform = rust.platform or { } // { + # https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch + arch = + if rust ? platform then + rust.platform.arch + else if final.isAarch32 then + "arm" else if final.isMips64 then - "mips64" # endianness is *not* included on mips64 - else if final.isDarwin then - final.darwinArch + "mips64" # never add "el" suffix + else if final.isPower64 then + "powerpc64" # never add "le" suffix else final.parsed.cpu.name; - # uname -r - release = null; + # https://doc.rust-lang.org/reference/conditional-compilation.html#target_os + os = + if rust ? platform then + rust.platform.os or "none" + else if final.isDarwin then + "macos" + else if final.isWasm && !final.isWasi then + "unknown" # Needed for {wasm32,wasm64}-unknown-unknown. + else + final.parsed.kernel.name; + + # https://doc.rust-lang.org/reference/conditional-compilation.html#target_family + target-family = + if args ? rust.platform.target-family then + args.rust.platform.target-family + else if args ? rustc.platform.target-family then + ( + # Since https://github.com/rust-lang/rust/pull/84072 + # `target-family` is a list instead of single value. + let + f = args.rustc.platform.target-family; + in + if isList f then f else [ f ] + ) + else + optional final.isUnix "unix" ++ optional final.isWindows "windows" ++ optional final.isWasm "wasm"; + + # https://doc.rust-lang.org/reference/conditional-compilation.html#target_vendor + vendor = + let + inherit (final.parsed) vendor; + in + rust.platform.vendor or { + "w64" = "pc"; + } + .${vendor.name} or vendor.name; }; - # It is important that hasSharedLibraries==false when the platform has no - # dynamic library loader. Various tools (including the gcc build system) - # have knowledge of which platforms are incapable of dynamic linking, and - # will still build on/for those platforms with --enable-shared, but simply - # omit any `.so` build products such as libgcc_s.so. When that happens, - # it causes hard-to-troubleshoot build failures. - hasSharedLibraries = - with final; - ( - isAndroid - || isGnu - || isMusl # Linux (allows multiple libcs) - || isDarwin - || isSunOS - || isOpenBSD - || isFreeBSD - || isNetBSD # BSDs - || isCygwin - || isMinGW - || isWindows # Windows - || isWasm # WASM - ) - && !isStatic; - - # The difference between `isStatic` and `hasSharedLibraries` is mainly the - # addition of the `staticMarker` (see make-derivation.nix). Some - # platforms, like embedded machines without a libc (e.g. arm-none-eabi) - # don't support dynamic linking, but don't get the `staticMarker`. - # `pkgsStatic` sets `isStatic=true`, so `pkgsStatic.hostPlatform` always - # has the `staticMarker`. - isStatic = final.isWasi || final.isRedox; - - # Just a guess, based on `system` - inherit - ( - { - linux-kernel = args.linux-kernel or { }; - gcc = args.gcc or { }; - } - // platforms.select final - ) - linux-kernel - gcc - ; - - # TODO: remove after 23.05 is EOL, with an error pointing to the rust.* attrs. - rustc = args.rustc or { }; - - linuxArch = - if final.isAarch32 then - "arm" - else if final.isAarch64 then - "arm64" - else if final.isx86_32 then - "i386" - else if final.isx86_64 then - "x86_64" - # linux kernel does not distinguish microblaze/microblazeel - else if final.isMicroBlaze then - "microblaze" - else if final.isMips32 then - "mips" - else if final.isMips64 then - "mips" # linux kernel does not distinguish mips32/mips64 - else if final.isPower then - "powerpc" - else if final.isRiscV then - "riscv" - else if final.isS390 then - "s390" - else if final.isLoongArch64 then - "loongarch" - else - final.parsed.cpu.name; - - # https://source.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L81-106 - ubootArch = - if final.isx86_32 then - "x86" # not i386 - else if final.isMips64 then - "mips64" # uboot *does* distinguish between mips32/mips64 - else - final.linuxArch; # other cases appear to agree with linuxArch - - qemuArch = - if final.isAarch32 then - "arm" - else if final.isAarch64 then - "aarch64" - else if final.isS390 && !final.isS390x then - null - else if final.isx86_64 then - "x86_64" - else if final.isx86 then - "i386" - else if final.isMips64n32 then - "mipsn32${optionalString final.isLittleEndian "el"}" - else if final.isMips64 then - "mips64${optionalString final.isLittleEndian "el"}" - else - final.uname.processor; - - # Name used by UEFI for architectures. - efiArch = - if final.isx86_32 then - "ia32" - else if final.isx86_64 then - "x64" - else if final.isAarch32 then - "arm" - else if final.isAarch64 then - "aa64" - else - final.parsed.cpu.name; - - darwinArch = parse.darwinArch final.parsed.cpu; - - darwinPlatform = - if final.isMacOS then - "macos" - else if final.isiOS then - "ios" - else - null; - # The canonical name for this attribute is darwinSdkVersion, but some - # platforms define the old name "sdkVer". - darwinSdkVersion = final.sdkVer or "11.3"; - darwinMinVersion = final.darwinSdkVersion; - darwinMinVersionVariable = - if final.isMacOS then - "MACOSX_DEPLOYMENT_TARGET" - else if final.isiOS then - "IPHONEOS_DEPLOYMENT_TARGET" - else - null; - - # Handle Android SDK and NDK versions. - androidSdkVersion = args.androidSdkVersion or null; - androidNdkVersion = args.androidNdkVersion or null; - } - // ( - let - selectEmulator = - pkgs: - let - wine = (pkgs.winePackagesFor "wine${toString final.parsed.cpu.bits}").minimal; - in - # Note: we guarantee that the return value is either `null` or a path - # to an emulator program. That is, if an emulator requires additional - # arguments, a wrapper should be used. - if pkgs.stdenv.hostPlatform.canExecute final then - lib.getExe (pkgs.writeShellScriptBin "exec" ''exec "$@"'') - else if final.isWindows then - "${wine}/bin/wine${optionalString (final.parsed.cpu.bits == 64) "64"}" - else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux && final.qemuArch != null then - "${pkgs.qemu-user}/bin/qemu-${final.qemuArch}" - else if final.isWasi then - "${pkgs.wasmtime}/bin/wasmtime" - else if final.isMmix then - "${pkgs.mmixware}/bin/mmix" - else - null; - in - { - emulatorAvailable = pkgs: (selectEmulator pkgs) != null; - - # whether final.emulator pkgs.pkgsStatic works - staticEmulatorAvailable = - pkgs: final.emulatorAvailable pkgs && (final.isLinux || final.isWasi || final.isMmix); - - emulator = - pkgs: - if (final.emulatorAvailable pkgs) then - selectEmulator pkgs - else - throw "Don't know how to run ${final.config} executables."; - - } - ) - // mapAttrs (n: v: v final.parsed) inspect.predicates - // mapAttrs (n: v: v final.gcc.arch or "default") architectures.predicates - // args - // { - rust = rust // { - # Once args.rustc.platform.target-family is deprecated and - # removed, there will no longer be any need to modify any - # values from args.rust.platform, so we can drop all the - # "args ? rust" etc. checks, and merge args.rust.platform in - # /after/. - platform = rust.platform or { } // { - # https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch - arch = - if rust ? platform then - rust.platform.arch - else if final.isAarch32 then - "arm" - else if final.isMips64 then - "mips64" # never add "el" suffix - else if final.isPower64 then - "powerpc64" # never add "le" suffix - else - final.parsed.cpu.name; - - # https://doc.rust-lang.org/reference/conditional-compilation.html#target_os - os = - if rust ? platform then - rust.platform.os or "none" - else if final.isDarwin then - "macos" - else if final.isWasm && !final.isWasi then - "unknown" # Needed for {wasm32,wasm64}-unknown-unknown. - else - final.parsed.kernel.name; - - # https://doc.rust-lang.org/reference/conditional-compilation.html#target_family - target-family = - if args ? rust.platform.target-family then - args.rust.platform.target-family - else if args ? rustc.platform.target-family then - ( - # Since https://github.com/rust-lang/rust/pull/84072 - # `target-family` is a list instead of single value. - let - f = args.rustc.platform.target-family; - in - if isList f then f else [ f ] - ) - else - optional final.isUnix "unix" ++ optional final.isWindows "windows" ++ optional final.isWasm "wasm"; - - # https://doc.rust-lang.org/reference/conditional-compilation.html#target_vendor - vendor = - let - inherit (final.parsed) vendor; - in - rust.platform.vendor or { - "w64" = "pc"; + # The name of the rust target, even if it is custom. Adjustments are + # because rust has slightly different naming conventions than we do. + rustcTarget = + let + inherit (final.parsed) cpu kernel abi; + cpu_ = + rust.platform.arch or { + "armv7a" = "armv7"; + "armv7l" = "armv7"; + "armv6l" = "arm"; + "armv5tel" = "armv5te"; + "riscv32" = "riscv32gc"; + "riscv64" = "riscv64gc"; } - .${vendor.name} or vendor.name; - }; + .${cpu.name} or cpu.name; + vendor_ = final.rust.platform.vendor; + in + # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. + args.rust.rustcTarget or args.rustc.config or ( + # Rust uses `wasm32-wasip?` rather than `wasm32-unknown-wasi`. + # We cannot know which subversion does the user want, and + # currently use WASI 0.1 as default for compatibility. Custom + # users can set `rust.rustcTarget` to override it. + if final.isWasi then + "${cpu_}-wasip1" + else + "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi.name}"}" + ); - # The name of the rust target, even if it is custom. Adjustments are - # because rust has slightly different naming conventions than we do. - rustcTarget = - let - inherit (final.parsed) cpu kernel abi; - cpu_ = - rust.platform.arch or { - "armv7a" = "armv7"; - "armv7l" = "armv7"; - "armv6l" = "arm"; - "armv5tel" = "armv5te"; - "riscv32" = "riscv32gc"; - "riscv64" = "riscv64gc"; - } - .${cpu.name} or cpu.name; - vendor_ = final.rust.platform.vendor; - in - # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. - args.rust.rustcTarget or args.rustc.config or ( - # Rust uses `wasm32-wasip?` rather than `wasm32-unknown-wasi`. - # We cannot know which subversion does the user want, and - # currently use WASI 0.1 as default for compatibility. Custom - # users can set `rust.rustcTarget` to override it. - if final.isWasi then - "${cpu_}-wasip1" - else - "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi.name}"}" - ); + # The name of the rust target if it is standard, or the json file + # containing the custom target spec. + rustcTargetSpec = + rust.rustcTargetSpec or ( + if rust ? platform then + builtins.toFile (final.rust.rustcTarget + ".json") (toJSON rust.platform) + else + final.rust.rustcTarget + ); - # The name of the rust target if it is standard, or the json file - # containing the custom target spec. - rustcTargetSpec = - rust.rustcTargetSpec or ( - if rust ? platform then - builtins.toFile (final.rust.rustcTarget + ".json") (toJSON rust.platform) - else - final.rust.rustcTarget - ); + # The name of the rust target if it is standard, or the + # basename of the file containing the custom target spec, + # without the .json extension. + # + # This is the name used by Cargo for target subdirectories. + cargoShortTarget = removeSuffix ".json" (baseNameOf "${final.rust.rustcTargetSpec}"); - # The name of the rust target if it is standard, or the - # basename of the file containing the custom target spec, - # without the .json extension. - # - # This is the name used by Cargo for target subdirectories. - cargoShortTarget = removeSuffix ".json" (baseNameOf "${final.rust.rustcTargetSpec}"); + # When used as part of an environment variable name, triples are + # uppercased and have all hyphens replaced by underscores: + # + # https://github.com/rust-lang/cargo/pull/9169 + # https://github.com/rust-lang/cargo/issues/8285#issuecomment-634202431 + cargoEnvVarTarget = replaceString "-" "_" (toUpper final.rust.cargoShortTarget); - # When used as part of an environment variable name, triples are - # uppercased and have all hyphens replaced by underscores: - # - # https://github.com/rust-lang/cargo/pull/9169 - # https://github.com/rust-lang/cargo/issues/8285#issuecomment-634202431 - cargoEnvVarTarget = replaceString "-" "_" (toUpper final.rust.cargoShortTarget); - - # True if the target is no_std - # https://github.com/rust-lang/rust/blob/2e44c17c12cec45b6a682b1e53a04ac5b5fcc9d2/src/bootstrap/config.rs#L415-L421 - isNoStdTarget = any (t: hasInfix t final.rust.rustcTarget) [ - "-none" - "nvptx" - "switch" - "-uefi" - ]; - }; - } - // { - go = { - # See https://pkg.go.dev/internal/platform for a list of known platforms - GOARCH = - { - "aarch64" = "arm64"; - "arm" = "arm"; - "armv5tel" = "arm"; - "armv6l" = "arm"; - "armv7l" = "arm"; - "i686" = "386"; - "loongarch64" = "loong64"; - "mips" = "mips"; - "mips64el" = "mips64le"; - "mipsel" = "mipsle"; - "powerpc64" = "ppc64"; - "powerpc64le" = "ppc64le"; - "riscv64" = "riscv64"; - "s390x" = "s390x"; - "x86_64" = "amd64"; - "wasm32" = "wasm"; - } - .${final.parsed.cpu.name} or null; - GOOS = if final.isWasi then "wasip1" else final.parsed.kernel.name; - - # See https://go.dev/wiki/GoArm - GOARM = toString (lib.intersectLists [ (final.parsed.cpu.version or "") ] [ "5" "6" "7" ]); - }; + # True if the target is no_std + # https://github.com/rust-lang/rust/blob/2e44c17c12cec45b6a682b1e53a04ac5b5fcc9d2/src/bootstrap/config.rs#L415-L421 + isNoStdTarget = any (t: hasInfix t final.rust.rustcTarget) [ + "-none" + "nvptx" + "switch" + "-uefi" + ]; }; + } + // { + go = { + # See https://pkg.go.dev/internal/platform for a list of known platforms + GOARCH = + { + "aarch64" = "arm64"; + "arm" = "arm"; + "armv5tel" = "arm"; + "armv6l" = "arm"; + "armv7l" = "arm"; + "i686" = "386"; + "loongarch64" = "loong64"; + "mips" = "mips"; + "mips64el" = "mips64le"; + "mipsel" = "mipsle"; + "powerpc64" = "ppc64"; + "powerpc64le" = "ppc64le"; + "riscv64" = "riscv64"; + "s390x" = "s390x"; + "x86_64" = "amd64"; + "wasm32" = "wasm"; + } + .${final.parsed.cpu.name} or null; + GOOS = if final.isWasi then "wasip1" else final.parsed.kernel.name; + + # See https://go.dev/wiki/GoArm + GOARM = toString (lib.intersectLists [ (final.parsed.cpu.version or "") ] [ "5" "6" "7" ]); + }; + }; in assert final.useAndroidPrebuilt -> final.isAndroid; assert foldl (pass: { assertion, message }: if assertion final then pass else throw message) true ( diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 9f67c109c787..152ac4ddc0ec 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -38,23 +38,28 @@ rec { sheevaplug = { config = "armv5tel-unknown-linux-gnueabi"; - } // platforms.sheevaplug; + } + // platforms.sheevaplug; raspberryPi = { config = "armv6l-unknown-linux-gnueabihf"; - } // platforms.raspberrypi; + } + // platforms.raspberrypi; bluefield2 = { config = "aarch64-unknown-linux-gnu"; - } // platforms.bluefield2; + } + // platforms.bluefield2; remarkable1 = { config = "armv7l-unknown-linux-gnueabihf"; - } // platforms.zero-gravitas; + } + // platforms.zero-gravitas; remarkable2 = { config = "armv7l-unknown-linux-gnueabihf"; - } // platforms.zero-sugar; + } + // platforms.zero-sugar; armv7l-hf-multiplatform = { config = "armv7l-unknown-linux-gnueabihf"; @@ -70,7 +75,8 @@ rec { androidSdkVersion = "33"; androidNdkVersion = "26"; useAndroidPrebuilt = true; - } // platforms.armv7a-android; + } + // platforms.armv7a-android; aarch64-android-prebuilt = { config = "aarch64-unknown-linux-android"; @@ -91,39 +97,48 @@ rec { pogoplug4 = { config = "armv5tel-unknown-linux-gnueabi"; - } // platforms.pogoplug4; + } + // platforms.pogoplug4; ben-nanonote = { config = "mipsel-unknown-linux-uclibc"; - } // platforms.ben_nanonote; + } + // platforms.ben_nanonote; fuloongminipc = { config = "mipsel-unknown-linux-gnu"; - } // platforms.fuloong2f_n32; + } + // platforms.fuloong2f_n32; # can execute on 32bit chip mips-linux-gnu = { config = "mips-unknown-linux-gnu"; - } // platforms.gcc_mips32r2_o32; + } + // platforms.gcc_mips32r2_o32; mipsel-linux-gnu = { config = "mipsel-unknown-linux-gnu"; - } // platforms.gcc_mips32r2_o32; + } + // platforms.gcc_mips32r2_o32; # require 64bit chip (for more registers, 64-bit floating point, 64-bit "long long") but use 32bit pointers mips64-linux-gnuabin32 = { config = "mips64-unknown-linux-gnuabin32"; - } // platforms.gcc_mips64r2_n32; + } + // platforms.gcc_mips64r2_n32; mips64el-linux-gnuabin32 = { config = "mips64el-unknown-linux-gnuabin32"; - } // platforms.gcc_mips64r2_n32; + } + // platforms.gcc_mips64r2_n32; # 64bit pointers mips64-linux-gnuabi64 = { config = "mips64-unknown-linux-gnuabi64"; - } // platforms.gcc_mips64r2_64; + } + // platforms.gcc_mips64r2_64; mips64el-linux-gnuabi64 = { config = "mips64el-unknown-linux-gnuabi64"; - } // platforms.gcc_mips64r2_64; + } + // platforms.gcc_mips64r2_64; muslpi = raspberryPi // { config = "armv6l-unknown-linux-musleabihf"; diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index efc02d79f9c8..2cc009133f2a 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -260,16 +260,16 @@ rec { bits = 64; }; }; - isILP32 = - [ - { - cpu = { - family = "wasm"; - bits = 32; - }; - } - ] - ++ map + isILP32 = [ + { + cpu = { + family = "wasm"; + bits = 32; + }; + } + ] + ++ + map (a: { abi = { abi = a; diff --git a/lib/tests/modules/define-option-dependently-nested.nix b/lib/tests/modules/define-option-dependently-nested.nix index d0aa722537d0..69ee4255534a 100644 --- a/lib/tests/modules/define-option-dependently-nested.nix +++ b/lib/tests/modules/define-option-dependently-nested.nix @@ -5,13 +5,12 @@ { # Always defined, but the value depends on the presence of an option. - config.set = - { - value = if options ? set.enable then 360 else 7; - } - # Only define if possible. - // lib.optionalAttrs (options ? set.enable) { - enable = true; - }; + config.set = { + value = if options ? set.enable then 360 else 7; + } + # Only define if possible. + // lib.optionalAttrs (options ? set.enable) { + enable = true; + }; } diff --git a/lib/tests/modules/define-option-dependently.nix b/lib/tests/modules/define-option-dependently.nix index 61330c920c96..ad85f99a919f 100644 --- a/lib/tests/modules/define-option-dependently.nix +++ b/lib/tests/modules/define-option-dependently.nix @@ -5,13 +5,12 @@ { # Always defined, but the value depends on the presence of an option. - config = - { - value = if options ? enable then 360 else 7; - } - # Only define if possible. - // lib.optionalAttrs (options ? enable) { - enable = true; - }; + config = { + value = if options ? enable then 360 else 7; + } + # Only define if possible. + // lib.optionalAttrs (options ? enable) { + enable = true; + }; } diff --git a/lib/tests/test-with-nix.nix b/lib/tests/test-with-nix.nix index d9089902a0a3..ebbe5e0ae5cd 100644 --- a/lib/tests/test-with-nix.nix +++ b/lib/tests/test-with-nix.nix @@ -27,7 +27,8 @@ pkgs.runCommand "nixpkgs-lib-tests-nix-${nix.version}" nativeBuildInputs = [ nix pkgs.gitMinimal - ] ++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.inotify-tools; + ] + ++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.inotify-tools; strictDeps = true; } '' diff --git a/lib/types.nix b/lib/types.nix index 9c409f7e254c..dcb536c4723b 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -1210,7 +1210,8 @@ let # It shouldn't cause an issue since this is cosmetic for the manual. _module.args.name = lib.mkOptionDefault "‹name›"; } - ] ++ modules; + ] + ++ modules; }; freeformType = base._module.freeformType; diff --git a/nixos/lib/eval-config-minimal.nix b/nixos/lib/eval-config-minimal.nix index 63c2aedc87a9..f65c907290d6 100644 --- a/nixos/lib/eval-config-minimal.nix +++ b/nixos/lib/eval-config-minimal.nix @@ -40,7 +40,8 @@ let class = "nixos"; specialArgs = { modulesPath = builtins.toString ../modules; - } // specialArgs; + } + // specialArgs; }; in diff --git a/nixos/lib/make-btrfs-fs.nix b/nixos/lib/make-btrfs-fs.nix index 30d74d5fdb45..1f3e821a405d 100644 --- a/nixos/lib/make-btrfs-fs.nix +++ b/nixos/lib/make-btrfs-fs.nix @@ -31,7 +31,8 @@ pkgs.stdenv.mkDerivation { btrfs-progs libfaketime fakeroot - ] ++ lib.optional compressImage zstd; + ] + ++ lib.optional compressImage zstd; buildCommand = '' ${if compressImage then "img=temp.img" else "img=$out"} diff --git a/nixos/lib/make-ext4-fs.nix b/nixos/lib/make-ext4-fs.nix index 113ca0c1420f..7b48f3c60a94 100644 --- a/nixos/lib/make-ext4-fs.nix +++ b/nixos/lib/make-ext4-fs.nix @@ -33,7 +33,8 @@ pkgs.stdenv.mkDerivation { libfaketime perl fakeroot - ] ++ lib.optional compressImage zstd; + ] + ++ lib.optional compressImage zstd; buildCommand = '' ${if compressImage then "img=temp.img" else "img=$out"} diff --git a/nixos/lib/make-iso9660-image.nix b/nixos/lib/make-iso9660-image.nix index daf2d14a9ebf..2a208d27d766 100644 --- a/nixos/lib/make-iso9660-image.nix +++ b/nixos/lib/make-iso9660-image.nix @@ -82,7 +82,8 @@ stdenv.mkDerivation { syslinux zstd libossp_uuid - ] ++ lib.optionals needSquashfs makeSquashfsDrv.nativeBuildInputs; + ] + ++ lib.optionals needSquashfs makeSquashfsDrv.nativeBuildInputs; inherit isoName diff --git a/nixos/lib/make-squashfs.nix b/nixos/lib/make-squashfs.nix index 49c926760106..de74c881d6e4 100644 --- a/nixos/lib/make-squashfs.nix +++ b/nixos/lib/make-squashfs.nix @@ -29,40 +29,39 @@ stdenv.mkDerivation { nativeBuildInputs = [ squashfsTools ]; - buildCommand = - '' - closureInfo=${closureInfo { rootPaths = storeContents; }} + buildCommand = '' + closureInfo=${closureInfo { rootPaths = storeContents; }} - # Also include a manifest of the closures in a format suitable - # for nix-store --load-db. - cp $closureInfo/registration nix-path-registration + # Also include a manifest of the closures in a format suitable + # for nix-store --load-db. + cp $closureInfo/registration nix-path-registration - imgPath="$out" - '' - + lib.optionalString hydraBuildProduct '' + imgPath="$out" + '' + + lib.optionalString hydraBuildProduct '' - mkdir $out - imgPath="$out/${fileName}.squashfs" - '' - + lib.optionalString stdenv.buildPlatform.is32bit '' + mkdir $out + imgPath="$out/${fileName}.squashfs" + '' + + lib.optionalString stdenv.buildPlatform.is32bit '' - # 64 cores on i686 does not work - # fails with FATAL ERROR: mangle2:: xz compress failed with error code 5 - if ((NIX_BUILD_CORES > 48)); then - NIX_BUILD_CORES=48 - fi - '' - + '' + # 64 cores on i686 does not work + # fails with FATAL ERROR: mangle2:: xz compress failed with error code 5 + if ((NIX_BUILD_CORES > 48)); then + NIX_BUILD_CORES=48 + fi + '' + + '' - # Generate the squashfs image. - # We have to set SOURCE_DATE_EPOCH to 0 here for reproducibility (https://github.com/NixOS/nixpkgs/issues/390696) - SOURCE_DATE_EPOCH=0 mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $imgPath ${pseudoFilesArgs} \ - -no-hardlinks ${lib.optionalString noStrip "-no-strip"} -keep-as-directory -all-root -b 1048576 ${compFlag} \ - -processors $NIX_BUILD_CORES -root-mode 0755 - '' - + lib.optionalString hydraBuildProduct '' + # Generate the squashfs image. + # We have to set SOURCE_DATE_EPOCH to 0 here for reproducibility (https://github.com/NixOS/nixpkgs/issues/390696) + SOURCE_DATE_EPOCH=0 mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $imgPath ${pseudoFilesArgs} \ + -no-hardlinks ${lib.optionalString noStrip "-no-strip"} -keep-as-directory -all-root -b 1048576 ${compFlag} \ + -processors $NIX_BUILD_CORES -root-mode 0755 + '' + + lib.optionalString hydraBuildProduct '' - mkdir -p $out/nix-support - echo "file squashfs-image $out/${fileName}.squashfs" >> $out/nix-support/hydra-build-products - ''; + mkdir -p $out/nix-support + echo "file squashfs-image $out/${fileName}.squashfs" >> $out/nix-support/hydra-build-products + ''; } diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix index 8249c4c4feb3..3b68d56d4541 100644 --- a/nixos/lib/systemd-lib.nix +++ b/nixos/lib/systemd-lib.nix @@ -701,17 +701,16 @@ rec { { config = { name = "${utils.escapeSystemdPath config.where}.mount"; - mountConfig = - { - What = config.what; - Where = config.where; - } - // optionalAttrs (config.type != "") { - Type = config.type; - } - // optionalAttrs (config.options != "") { - Options = config.options; - }; + mountConfig = { + What = config.what; + Where = config.where; + } + // optionalAttrs (config.type != "") { + Type = config.type; + } + // optionalAttrs (config.options != "") { + Options = config.options; + }; }; }; diff --git a/nixos/lib/test-driver/default.nix b/nixos/lib/test-driver/default.nix index bb07bba363a1..cb3729941d0e 100644 --- a/nixos/lib/test-driver/default.nix +++ b/nixos/lib/test-driver/default.nix @@ -37,18 +37,17 @@ python3Packages.buildPythonApplication { ] ++ extraPythonPackages python3Packages; - propagatedBuildInputs = - [ - coreutils - netpbm - qemu_pkg - socat - vde2 - ] - ++ lib.optionals enableOCR [ - imagemagick_light - tesseract4 - ]; + propagatedBuildInputs = [ + coreutils + netpbm + qemu_pkg + socat + vde2 + ] + ++ lib.optionals enableOCR [ + imagemagick_light + tesseract4 + ]; passthru.tests = { inherit (nixosTests.nixos-test-driver) driver-timeout; diff --git a/nixos/lib/testing/driver.nix b/nixos/lib/testing/driver.nix index 05d0b1a04569..6ddb7a341bd3 100644 --- a/nixos/lib/testing/driver.nix +++ b/nixos/lib/testing/driver.nix @@ -49,7 +49,8 @@ let # inherit testName; TODO (roberth): need this? nativeBuildInputs = [ hostPkgs.makeWrapper - ] ++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.mypy ]; + ] + ++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.mypy ]; buildInputs = [ testDriver ]; testScript = config.testScriptString; preferLocalBuild = true; diff --git a/nixos/lib/testing/run.nix b/nixos/lib/testing/run.nix index ab1dc7733d5f..e34e585241be 100644 --- a/nixos/lib/testing/run.nix +++ b/nixos/lib/testing/run.nix @@ -93,8 +93,11 @@ in { name = "vm-test-run-${config.name}"; - requiredSystemFeatures = - [ "nixos-test" ] ++ lib.optional isLinux "kvm" ++ lib.optional isDarwin "apple-virt"; + requiredSystemFeatures = [ + "nixos-test" + ] + ++ lib.optional isLinux "kvm" + ++ lib.optional isDarwin "apple-virt"; nativeBuildInputs = lib.optionals config.enableDebugHook [ hostPkgs.openssh diff --git a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix index 2e7cd481584a..580b67889d99 100644 --- a/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix +++ b/nixos/maintainers/scripts/openstack/openstack-image-zfs.nix @@ -40,7 +40,8 @@ in ]; }) - ] ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix); + ] + ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix); options.openstackImage = { ramMB = mkOption { diff --git a/nixos/maintainers/scripts/openstack/openstack-image.nix b/nixos/maintainers/scripts/openstack/openstack-image.nix index 8de0bcc9c2eb..65ce2fec2033 100644 --- a/nixos/maintainers/scripts/openstack/openstack-image.nix +++ b/nixos/maintainers/scripts/openstack/openstack-image.nix @@ -14,7 +14,8 @@ in imports = [ ../../../modules/virtualisation/openstack-config.nix ../../../modules/image/file-options.nix - ] ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix); + ] + ++ (lib.optional copyChannel ../../../modules/installer/cd-dvd/channel.nix); documentation.enable = copyChannel; diff --git a/nixos/modules/config/console.nix b/nixos/modules/config/console.nix index 006cf91baaf0..7c126df4e878 100644 --- a/nixos/modules/config/console.nix +++ b/nixos/modules/config/console.nix @@ -191,19 +191,18 @@ in boot.initrd.systemd.additionalUpstreamUnits = [ "systemd-vconsole-setup.service" ]; - boot.initrd.systemd.storePaths = - [ - "${config.boot.initrd.systemd.package}/lib/systemd/systemd-vconsole-setup" - "${config.boot.initrd.systemd.package.kbd}/bin/setfont" - "${config.boot.initrd.systemd.package.kbd}/bin/loadkeys" - "${config.boot.initrd.systemd.package.kbd.gzip}/bin/gzip" # Fonts and keyboard layouts are compressed - ] - ++ lib.optionals (cfg.font != null && lib.hasPrefix builtins.storeDir cfg.font) [ - "${cfg.font}" - ] - ++ lib.optionals (lib.hasPrefix builtins.storeDir cfg.keyMap) [ - "${cfg.keyMap}" - ]; + boot.initrd.systemd.storePaths = [ + "${config.boot.initrd.systemd.package}/lib/systemd/systemd-vconsole-setup" + "${config.boot.initrd.systemd.package.kbd}/bin/setfont" + "${config.boot.initrd.systemd.package.kbd}/bin/loadkeys" + "${config.boot.initrd.systemd.package.kbd.gzip}/bin/gzip" # Fonts and keyboard layouts are compressed + ] + ++ lib.optionals (cfg.font != null && lib.hasPrefix builtins.storeDir cfg.font) [ + "${cfg.font}" + ] + ++ lib.optionals (lib.hasPrefix builtins.storeDir cfg.keyMap) [ + "${cfg.keyMap}" + ]; systemd.additionalUpstreamSystemUnits = [ "systemd-vconsole-setup.service" diff --git a/nixos/modules/config/fonts/fontconfig.nix b/nixos/modules/config/fonts/fontconfig.nix index 89c537ff3868..82bac6249d21 100644 --- a/nixos/modules/config/fonts/fontconfig.nix +++ b/nixos/modules/config/fonts/fontconfig.nix @@ -258,44 +258,43 @@ let fontconfigNote = "Consider manually configuring fonts.fontconfig according to personal preference."; in { - imports = - [ - (lib.mkRenamedOptionModule - [ "fonts" "fontconfig" "ultimate" "allowBitmaps" ] - [ "fonts" "fontconfig" "allowBitmaps" ] - ) - (lib.mkRenamedOptionModule - [ "fonts" "fontconfig" "ultimate" "allowType1" ] - [ "fonts" "fontconfig" "allowType1" ] - ) - (lib.mkRenamedOptionModule - [ "fonts" "fontconfig" "ultimate" "useEmbeddedBitmaps" ] - [ "fonts" "fontconfig" "useEmbeddedBitmaps" ] - ) - (lib.mkRenamedOptionModule - [ "fonts" "fontconfig" "ultimate" "forceAutohint" ] - [ "fonts" "fontconfig" "forceAutohint" ] - ) - (lib.mkRenamedOptionModule - [ "fonts" "fontconfig" "ultimate" "renderMonoTTFAsBitmap" ] - [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] - ) - (lib.mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "") - (lib.mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "") - (lib.mkRemovedOptionModule [ "fonts" "fontconfig" "dpi" ] "Use display server-specific options") - (lib.mkRemovedOptionModule [ "hardware" "video" "hidpi" "enable" ] fontconfigNote) - (lib.mkRemovedOptionModule [ "fonts" "optimizeForVeryHighDPI" ] fontconfigNote) - ] - ++ lib.forEach [ "enable" "substitutions" "preset" ] ( - opt: - lib.mkRemovedOptionModule [ "fonts" "fontconfig" "ultimate" "${opt}" ] '' - The fonts.fontconfig.ultimate module and configuration is obsolete. - The repository has since been archived and activity has ceased. - https://github.com/bohoomil/fontconfig-ultimate/issues/171. - No action should be needed for font configuration, as the fonts.fontconfig - module is already used by default. - '' - ); + imports = [ + (lib.mkRenamedOptionModule + [ "fonts" "fontconfig" "ultimate" "allowBitmaps" ] + [ "fonts" "fontconfig" "allowBitmaps" ] + ) + (lib.mkRenamedOptionModule + [ "fonts" "fontconfig" "ultimate" "allowType1" ] + [ "fonts" "fontconfig" "allowType1" ] + ) + (lib.mkRenamedOptionModule + [ "fonts" "fontconfig" "ultimate" "useEmbeddedBitmaps" ] + [ "fonts" "fontconfig" "useEmbeddedBitmaps" ] + ) + (lib.mkRenamedOptionModule + [ "fonts" "fontconfig" "ultimate" "forceAutohint" ] + [ "fonts" "fontconfig" "forceAutohint" ] + ) + (lib.mkRenamedOptionModule + [ "fonts" "fontconfig" "ultimate" "renderMonoTTFAsBitmap" ] + [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] + ) + (lib.mkRemovedOptionModule [ "fonts" "fontconfig" "forceAutohint" ] "") + (lib.mkRemovedOptionModule [ "fonts" "fontconfig" "renderMonoTTFAsBitmap" ] "") + (lib.mkRemovedOptionModule [ "fonts" "fontconfig" "dpi" ] "Use display server-specific options") + (lib.mkRemovedOptionModule [ "hardware" "video" "hidpi" "enable" ] fontconfigNote) + (lib.mkRemovedOptionModule [ "fonts" "optimizeForVeryHighDPI" ] fontconfigNote) + ] + ++ lib.forEach [ "enable" "substitutions" "preset" ] ( + opt: + lib.mkRemovedOptionModule [ "fonts" "fontconfig" "ultimate" "${opt}" ] '' + The fonts.fontconfig.ultimate module and configuration is obsolete. + The repository has since been archived and activity has ceased. + https://github.com/bohoomil/fontconfig-ultimate/issues/171. + No action should be needed for font configuration, as the fonts.fontconfig + module is already used by default. + '' + ); options = { diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix index 67b0e2a897af..1e6c35a4ea31 100644 --- a/nixos/modules/config/i18n.nix +++ b/nixos/modules/config/i18n.nix @@ -7,20 +7,19 @@ let sanitizeUTF8Capitalization = lang: (lib.replaceStrings [ "utf8" "utf-8" "UTF8" ] [ "UTF-8" "UTF-8" "UTF-8" ] lang); - aggregatedLocales = - [ - "${config.i18n.defaultLocale}/${config.i18n.defaultCharset}" - ] - ++ lib.pipe config.i18n.extraLocaleSettings [ - # See description of extraLocaleSettings for why is this ignored here. - (lib.filterAttrs (n: v: n != "LANGUAGE")) - (lib.mapAttrs (n: v: (sanitizeUTF8Capitalization v))) - (lib.mapAttrsToList (LCRole: lang: lang + "/" + (config.i18n.localeCharsets.${LCRole} or "UTF-8"))) - ] - ++ (builtins.map sanitizeUTF8Capitalization ( - lib.optionals (builtins.isList config.i18n.extraLocales) config.i18n.extraLocales - )) - ++ (lib.optional (builtins.isString config.i18n.extraLocales) config.i18n.extraLocales); + aggregatedLocales = [ + "${config.i18n.defaultLocale}/${config.i18n.defaultCharset}" + ] + ++ lib.pipe config.i18n.extraLocaleSettings [ + # See description of extraLocaleSettings for why is this ignored here. + (lib.filterAttrs (n: v: n != "LANGUAGE")) + (lib.mapAttrs (n: v: (sanitizeUTF8Capitalization v))) + (lib.mapAttrsToList (LCRole: lang: lang + "/" + (config.i18n.localeCharsets.${LCRole} or "UTF-8"))) + ] + ++ (builtins.map sanitizeUTF8Capitalization ( + lib.optionals (builtins.isList config.i18n.extraLocales) config.i18n.extraLocales + )) + ++ (lib.optional (builtins.isString config.i18n.extraLocales) config.i18n.extraLocales); in { ###### interface @@ -171,7 +170,8 @@ in environment.sessionVariables = { LANG = config.i18n.defaultLocale; LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; - } // config.i18n.extraLocaleSettings; + } + // config.i18n.extraLocaleSettings; systemd.globalEnvironment = lib.mkIf (config.i18n.supportedLocales != [ ]) { LOCALE_ARCHIVE = "${config.i18n.glibcLocales}/lib/locale/locale-archive"; diff --git a/nixos/modules/config/locale.nix b/nixos/modules/config/locale.nix index cb4115a57e86..395a25f537be 100644 --- a/nixos/modules/config/locale.nix +++ b/nixos/modules/config/locale.nix @@ -90,14 +90,13 @@ in NIXOS_STATIC_TIMEZONE = "1"; }; - environment.etc = - { - zoneinfo.source = tzdir; - } - // lib.optionalAttrs (config.time.timeZone != null) { - localtime.source = "/etc/zoneinfo/${config.time.timeZone}"; - localtime.mode = "direct-symlink"; - }; + environment.etc = { + zoneinfo.source = tzdir; + } + // lib.optionalAttrs (config.time.timeZone != null) { + localtime.source = "/etc/zoneinfo/${config.time.timeZone}"; + localtime.mode = "direct-symlink"; + }; }; } diff --git a/nixos/modules/config/mysql.nix b/nixos/modules/config/mysql.nix index 5cbd313d4c60..201bbf7faa17 100644 --- a/nixos/modules/config/mysql.nix +++ b/nixos/modules/config/mysql.nix @@ -380,40 +380,39 @@ in group = "root"; mode = "0600"; # password will be added from password file in systemd oneshot - text = - '' - users.host=${cfg.host} - users.db_user=${cfg.user} - users.database=${cfg.database} - users.table=${cfg.pam.table} - users.user_column=${cfg.pam.userColumn} - users.password_column=${cfg.pam.passwordColumn} - users.password_crypt=${cfg.pam.passwordCrypt} - users.disconnect_every_operation=${if cfg.pam.disconnectEveryOperation then "1" else "0"} - verbose=${if cfg.pam.verbose then "1" else "0"} - '' - + lib.optionalString (cfg.pam.cryptDefault != null) '' - users.use_${cfg.pam.cryptDefault}=1 - '' - + lib.optionalString (cfg.pam.where != null) '' - users.where_clause=${cfg.pam.where} - '' - + lib.optionalString (cfg.pam.statusColumn != null) '' - users.status_column=${cfg.pam.statusColumn} - '' - + lib.optionalString (cfg.pam.updateTable != null) '' - users.update_table=${cfg.pam.updateTable} - '' - + lib.optionalString cfg.pam.logging.enable '' - log.enabled=true - log.table=${cfg.pam.logging.table} - log.message_column=${cfg.pam.logging.msgColumn} - log.pid_column=${cfg.pam.logging.pidColumn} - log.user_column=${cfg.pam.logging.userColumn} - log.host_column=${cfg.pam.logging.hostColumn} - log.rhost_column=${cfg.pam.logging.rHostColumn} - log.time_column=${cfg.pam.logging.timeColumn} - ''; + text = '' + users.host=${cfg.host} + users.db_user=${cfg.user} + users.database=${cfg.database} + users.table=${cfg.pam.table} + users.user_column=${cfg.pam.userColumn} + users.password_column=${cfg.pam.passwordColumn} + users.password_crypt=${cfg.pam.passwordCrypt} + users.disconnect_every_operation=${if cfg.pam.disconnectEveryOperation then "1" else "0"} + verbose=${if cfg.pam.verbose then "1" else "0"} + '' + + lib.optionalString (cfg.pam.cryptDefault != null) '' + users.use_${cfg.pam.cryptDefault}=1 + '' + + lib.optionalString (cfg.pam.where != null) '' + users.where_clause=${cfg.pam.where} + '' + + lib.optionalString (cfg.pam.statusColumn != null) '' + users.status_column=${cfg.pam.statusColumn} + '' + + lib.optionalString (cfg.pam.updateTable != null) '' + users.update_table=${cfg.pam.updateTable} + '' + + lib.optionalString cfg.pam.logging.enable '' + log.enabled=true + log.table=${cfg.pam.logging.table} + log.message_column=${cfg.pam.logging.msgColumn} + log.pid_column=${cfg.pam.logging.pidColumn} + log.user_column=${cfg.pam.logging.userColumn} + log.host_column=${cfg.pam.logging.hostColumn} + log.rhost_column=${cfg.pam.logging.rHostColumn} + log.time_column=${cfg.pam.logging.timeColumn} + ''; }; environment.etc."libnss-mysql.cfg" = { diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix index 7c2b42aeffae..c71147c4f72a 100644 --- a/nixos/modules/config/networking.nix +++ b/nixos/modules/config/networking.nix @@ -206,30 +206,29 @@ in extraHosts ]; - environment.etc = - { - # /etc/services: TCP/UDP port assignments. - services.source = pkgs.iana-etc + "/etc/services"; + environment.etc = { + # /etc/services: TCP/UDP port assignments. + services.source = pkgs.iana-etc + "/etc/services"; - # /etc/protocols: IP protocol numbers. - protocols.source = pkgs.iana-etc + "/etc/protocols"; + # /etc/protocols: IP protocol numbers. + protocols.source = pkgs.iana-etc + "/etc/protocols"; - # /etc/hosts: Hostname-to-IP mappings. - hosts.source = pkgs.concatText "hosts" cfg.hostFiles; + # /etc/hosts: Hostname-to-IP mappings. + hosts.source = pkgs.concatText "hosts" cfg.hostFiles; - # /etc/netgroup: Network-wide groups. - netgroup.text = lib.mkDefault ""; + # /etc/netgroup: Network-wide groups. + netgroup.text = lib.mkDefault ""; - # /etc/host.conf: resolver configuration file - "host.conf".text = '' - multi on - ''; + # /etc/host.conf: resolver configuration file + "host.conf".text = '' + multi on + ''; - } - // lib.optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") { - # /etc/rpc: RPC program numbers. - rpc.source = pkgs.stdenv.cc.libc.out + "/etc/rpc"; - }; + } + // lib.optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") { + # /etc/rpc: RPC program numbers. + rpc.source = pkgs.stdenv.cc.libc.out + "/etc/rpc"; + }; networking.proxy.envVars = lib.optionalAttrs (cfg.proxy.default != null) { diff --git a/nixos/modules/config/nix-remote-build.nix b/nixos/modules/config/nix-remote-build.nix index 4786fef31d06..9a276aa29d07 100644 --- a/nixos/modules/config/nix-remote-build.nix +++ b/nixos/modules/config/nix-remote-build.nix @@ -235,14 +235,13 @@ in [ { assertion = !(any badMachine cfg.buildMachines); - message = - '' - At least one system type (via system or - systems) must be set for every build machine. - Invalid machine specifications: - '' - + " " - + (concatStringsSep "\n " (map (m: m.hostName) (filter (badMachine) cfg.buildMachines))); + message = '' + At least one system type (via system or + systems) must be set for every build machine. + Invalid machine specifications: + '' + + " " + + (concatStringsSep "\n " (map (m: m.hostName) (filter (badMachine) cfg.buildMachines))); } ]; diff --git a/nixos/modules/config/nix.nix b/nixos/modules/config/nix.nix index 0a469f97678b..48ac45323750 100644 --- a/nixos/modules/config/nix.nix +++ b/nixos/modules/config/nix.nix @@ -50,20 +50,19 @@ let isNixAtLeast = versionAtLeast (getVersion nixPackage); - defaultSystemFeatures = - [ - "nixos-test" - "benchmark" - "big-parallel" - "kvm" - ] - ++ optionals (pkgs.stdenv.hostPlatform ? gcc.arch) ( - # a builder can run code for `gcc.arch` and inferior architectures - [ "gccarch-${pkgs.stdenv.hostPlatform.gcc.arch}" ] - ++ map (x: "gccarch-${x}") ( - systems.architectures.inferiors.${pkgs.stdenv.hostPlatform.gcc.arch} or [ ] - ) - ); + defaultSystemFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ] + ++ optionals (pkgs.stdenv.hostPlatform ? gcc.arch) ( + # a builder can run code for `gcc.arch` and inferior architectures + [ "gccarch-${pkgs.stdenv.hostPlatform.gcc.arch}" ] + ++ map (x: "gccarch-${x}") ( + systems.architectures.inferiors.${pkgs.stdenv.hostPlatform.gcc.arch} or [ ] + ) + ); legacyConfMappings = { useSandbox = "sandbox"; @@ -170,46 +169,45 @@ let in { - imports = - [ - (mkRenamedOptionModuleWith { - sinceRelease = 2003; - from = [ - "nix" - "useChroot" - ]; - to = [ - "nix" - "useSandbox" - ]; - }) - (mkRenamedOptionModuleWith { - sinceRelease = 2003; - from = [ - "nix" - "chrootDirs" - ]; - to = [ - "nix" - "sandboxPaths" - ]; - }) - ] - ++ mapAttrsToList ( - oldConf: newConf: - mkRenamedOptionModuleWith { - sinceRelease = 2205; - from = [ - "nix" - oldConf - ]; - to = [ - "nix" - "settings" - newConf - ]; - } - ) legacyConfMappings; + imports = [ + (mkRenamedOptionModuleWith { + sinceRelease = 2003; + from = [ + "nix" + "useChroot" + ]; + to = [ + "nix" + "useSandbox" + ]; + }) + (mkRenamedOptionModuleWith { + sinceRelease = 2003; + from = [ + "nix" + "chrootDirs" + ]; + to = [ + "nix" + "sandboxPaths" + ]; + }) + ] + ++ mapAttrsToList ( + oldConf: newConf: + mkRenamedOptionModuleWith { + sinceRelease = 2205; + from = [ + "nix" + oldConf + ]; + to = [ + "nix" + "settings" + newConf + ]; + } + ) legacyConfMappings; options = { nix = { diff --git a/nixos/modules/config/resolvconf.nix b/nixos/modules/config/resolvconf.nix index f9c9d04b3fbe..3ec0654dfc02 100644 --- a/nixos/modules/config/resolvconf.nix +++ b/nixos/modules/config/resolvconf.nix @@ -15,27 +15,26 @@ let ++ lib.optional cfg.dnsExtensionMechanism "edns0" ++ lib.optional cfg.useLocalResolver "trust-ad"; - configText = - '' - # This is the default, but we must set it here to prevent - # a collision with an apparently unrelated environment - # variable with the same name exported by dhcpcd. - interface_order='lo lo[0-9]*' - '' - + lib.optionalString config.services.nscd.enable '' - # Invalidate the nscd cache whenever resolv.conf is - # regenerated. - libc_restart='/run/current-system/systemd/bin/systemctl try-restart --no-block nscd.service 2> /dev/null' - '' - + lib.optionalString (lib.length resolvconfOptions > 0) '' - # Options as described in resolv.conf(5) - resolv_conf_options='${lib.concatStringsSep " " resolvconfOptions}' - '' - + lib.optionalString cfg.useLocalResolver '' - # This hosts runs a full-blown DNS resolver. - name_servers='127.0.0.1${lib.optionalString config.networking.enableIPv6 " ::1"}' - '' - + cfg.extraConfig; + configText = '' + # This is the default, but we must set it here to prevent + # a collision with an apparently unrelated environment + # variable with the same name exported by dhcpcd. + interface_order='lo lo[0-9]*' + '' + + lib.optionalString config.services.nscd.enable '' + # Invalidate the nscd cache whenever resolv.conf is + # regenerated. + libc_restart='/run/current-system/systemd/bin/systemctl try-restart --no-block nscd.service 2> /dev/null' + '' + + lib.optionalString (lib.length resolvconfOptions > 0) '' + # Options as described in resolv.conf(5) + resolv_conf_options='${lib.concatStringsSep " " resolvconfOptions}' + '' + + lib.optionalString cfg.useLocalResolver '' + # This hosts runs a full-blown DNS resolver. + name_servers='127.0.0.1${lib.optionalString config.networking.enableIPv6 " ::1"}' + '' + + cfg.extraConfig; in diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix index df9e6afe30c6..1fee6c7f2c9f 100644 --- a/nixos/modules/config/swap.nix +++ b/nixos/modules/config/swap.nix @@ -286,7 +286,8 @@ in path = [ pkgs.util-linux pkgs.e2fsprogs - ] ++ lib.optional sw.randomEncryption.enable pkgs.cryptsetup; + ] + ++ lib.optional sw.randomEncryption.enable pkgs.cryptsetup; environment.DEVICE = sw.device; diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 6d534ed237f6..59f1b44483df 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -1036,176 +1036,174 @@ in }; }; - assertions = - [ - { - assertion = !cfg.enforceIdUniqueness || (uidsAreUnique && gidsAreUnique); - message = "UIDs and GIDs must be unique!"; - } - { - assertion = !cfg.enforceIdUniqueness || (sdInitrdUidsAreUnique && sdInitrdGidsAreUnique); - message = "systemd initrd UIDs and GIDs must be unique!"; - } - { - assertion = usersWithoutExistingGroup == { }; - message = - let - errUsers = lib.attrNames usersWithoutExistingGroup; - missingGroups = lib.unique (lib.mapAttrsToList (n: u: u.group) usersWithoutExistingGroup); - mkConfigHint = group: "users.groups.${group} = {};"; - in - '' - The following users have a primary group that is undefined: ${lib.concatStringsSep " " errUsers} - Hint: Add this to your NixOS configuration: - ${lib.concatStringsSep "\n " (map mkConfigHint missingGroups)} - ''; - } - { - assertion = !cfg.mutableUsers -> length usersWithNullShells == 0; - message = '' - users.mutableUsers = false has been set, - but found users that have their shell set to null. - If you wish to disable login, set their shell to pkgs.shadow (the default). - Misconfigured users: ${lib.concatStringsSep " " usersWithNullShells} + assertions = [ + { + assertion = !cfg.enforceIdUniqueness || (uidsAreUnique && gidsAreUnique); + message = "UIDs and GIDs must be unique!"; + } + { + assertion = !cfg.enforceIdUniqueness || (sdInitrdUidsAreUnique && sdInitrdGidsAreUnique); + message = "systemd initrd UIDs and GIDs must be unique!"; + } + { + assertion = usersWithoutExistingGroup == { }; + message = + let + errUsers = lib.attrNames usersWithoutExistingGroup; + missingGroups = lib.unique (lib.mapAttrsToList (n: u: u.group) usersWithoutExistingGroup); + mkConfigHint = group: "users.groups.${group} = {};"; + in + '' + The following users have a primary group that is undefined: ${lib.concatStringsSep " " errUsers} + Hint: Add this to your NixOS configuration: + ${lib.concatStringsSep "\n " (map mkConfigHint missingGroups)} ''; - } - { - # If mutableUsers is false, to prevent users creating a - # configuration that locks them out of the system, ensure that - # there is at least one "privileged" account that has a - # password or an SSH authorized key. Privileged accounts are - # root and users in the wheel group. - # The check does not apply when users.allowNoPasswordLogin - # The check does not apply when users.mutableUsers - assertion = - !cfg.mutableUsers - -> !cfg.allowNoPasswordLogin - -> any id ( - mapAttrsToList ( - name: cfg: - (name == "root" || cfg.group == "wheel" || elem "wheel" cfg.extraGroups) - && ( - allowsLogin cfg.hashedPassword - || cfg.password != null - || cfg.hashedPasswordFile != null - || cfg.openssh.authorizedKeys.keys != [ ] - || cfg.openssh.authorizedKeys.keyFiles != [ ] - ) - ) cfg.users - ++ [ - config.security.googleOsLogin.enable - ] - ); - message = '' - Neither the root account nor any wheel user has a password or SSH authorized key. - You must set one to prevent being locked out of your system. - If you really want to be locked out of your system, set users.allowNoPasswordLogin = true; - However you are most probably better off by setting users.mutableUsers = true; and - manually running passwd root to set the root password. - ''; - } - ] - ++ flatten ( - flip mapAttrsToList cfg.users ( - name: user: - [ - ( - let - # Things fail in various ways with especially non-ascii usernames. - # This regex mirrors the one from shadow's is_valid_name: - # https://github.com/shadow-maint/shadow/blob/bee77ffc291dfed2a133496db465eaa55e2b0fec/lib/chkname.c#L68 - # though without the trailing $, because Samba 3 got its last release - # over 10 years ago and is not in Nixpkgs anymore, - # while later versions don't appear to require anything like that. - nameRegex = "[a-zA-Z0-9_.][a-zA-Z0-9_.-]*"; - in - { - assertion = builtins.match nameRegex user.name != null; - message = "The username \"${user.name}\" is not valid, it does not match the regex \"${nameRegex}\"."; - } - ) - { - assertion = (user.hashedPassword != null) -> (match ".*:.*" user.hashedPassword == null); - message = '' - The password hash of user "${user.name}" contains a ":" character. - This is invalid and would break the login system because the fields - of /etc/shadow (file where hashes are stored) are colon-separated. - Please check the value of option `users.users."${user.name}".hashedPassword`.''; - } - { - assertion = user.isNormalUser && user.uid != null -> user.uid >= 1000; - message = '' - A user cannot have a users.users.${user.name}.uid set below 1000 and set users.users.${user.name}.isNormalUser. - Either users.users.${user.name}.isSystemUser must be set to true instead of users.users.${user.name}.isNormalUser - or users.users.${user.name}.uid must be changed to 1000 or above. - ''; - } - { - assertion = - let - # we do an extra check on isNormalUser here, to not trigger this assertion when isNormalUser is set and uid to < 1000 - isEffectivelySystemUser = - user.isSystemUser || (user.uid != null && user.uid < 1000 && !user.isNormalUser); - in - xor isEffectivelySystemUser user.isNormalUser; - message = '' - Exactly one of users.users.${user.name}.isSystemUser and users.users.${user.name}.isNormalUser must be set. - ''; - } - { - assertion = user.group != ""; - message = '' - users.users.${user.name}.group is unset. This used to default to - nogroup, but this is unsafe. For example you can create a group - for this user with: - users.users.${user.name}.group = "${user.name}"; - users.groups.${user.name} = {}; - ''; - } - ] - ++ (map - (shell: { - assertion = - !user.ignoreShellProgramCheck - -> (user.shell == pkgs.${shell}) - -> (config.programs.${shell}.enable == true); - message = '' - users.users.${user.name}.shell is set to ${shell}, but - programs.${shell}.enable is not true. This will cause the ${shell} - shell to lack the basic nix directories in its PATH and might make - logging in as that user impossible. You can fix it with: - programs.${shell}.enable = true; - - If you know what you're doing and you are fine with the behavior, - set users.users.${user.name}.ignoreShellProgramCheck = true; - instead. - ''; - }) - [ - "fish" - "xonsh" - "zsh" + } + { + assertion = !cfg.mutableUsers -> length usersWithNullShells == 0; + message = '' + users.mutableUsers = false has been set, + but found users that have their shell set to null. + If you wish to disable login, set their shell to pkgs.shadow (the default). + Misconfigured users: ${lib.concatStringsSep " " usersWithNullShells} + ''; + } + { + # If mutableUsers is false, to prevent users creating a + # configuration that locks them out of the system, ensure that + # there is at least one "privileged" account that has a + # password or an SSH authorized key. Privileged accounts are + # root and users in the wheel group. + # The check does not apply when users.allowNoPasswordLogin + # The check does not apply when users.mutableUsers + assertion = + !cfg.mutableUsers + -> !cfg.allowNoPasswordLogin + -> any id ( + mapAttrsToList ( + name: cfg: + (name == "root" || cfg.group == "wheel" || elem "wheel" cfg.extraGroups) + && ( + allowsLogin cfg.hashedPassword + || cfg.password != null + || cfg.hashedPasswordFile != null + || cfg.openssh.authorizedKeys.keys != [ ] + || cfg.openssh.authorizedKeys.keyFiles != [ ] + ) + ) cfg.users + ++ [ + config.security.googleOsLogin.enable ] + ); + message = '' + Neither the root account nor any wheel user has a password or SSH authorized key. + You must set one to prevent being locked out of your system. + If you really want to be locked out of your system, set users.allowNoPasswordLogin = true; + However you are most probably better off by setting users.mutableUsers = true; and + manually running passwd root to set the root password. + ''; + } + ] + ++ flatten ( + flip mapAttrsToList cfg.users ( + name: user: + [ + ( + let + # Things fail in various ways with especially non-ascii usernames. + # This regex mirrors the one from shadow's is_valid_name: + # https://github.com/shadow-maint/shadow/blob/bee77ffc291dfed2a133496db465eaa55e2b0fec/lib/chkname.c#L68 + # though without the trailing $, because Samba 3 got its last release + # over 10 years ago and is not in Nixpkgs anymore, + # while later versions don't appear to require anything like that. + nameRegex = "[a-zA-Z0-9_.][a-zA-Z0-9_.-]*"; + in + { + assertion = builtins.match nameRegex user.name != null; + message = "The username \"${user.name}\" is not valid, it does not match the regex \"${nameRegex}\"."; + } ) + { + assertion = (user.hashedPassword != null) -> (match ".*:.*" user.hashedPassword == null); + message = '' + The password hash of user "${user.name}" contains a ":" character. + This is invalid and would break the login system because the fields + of /etc/shadow (file where hashes are stored) are colon-separated. + Please check the value of option `users.users."${user.name}".hashedPassword`.''; + } + { + assertion = user.isNormalUser && user.uid != null -> user.uid >= 1000; + message = '' + A user cannot have a users.users.${user.name}.uid set below 1000 and set users.users.${user.name}.isNormalUser. + Either users.users.${user.name}.isSystemUser must be set to true instead of users.users.${user.name}.isNormalUser + or users.users.${user.name}.uid must be changed to 1000 or above. + ''; + } + { + assertion = + let + # we do an extra check on isNormalUser here, to not trigger this assertion when isNormalUser is set and uid to < 1000 + isEffectivelySystemUser = + user.isSystemUser || (user.uid != null && user.uid < 1000 && !user.isNormalUser); + in + xor isEffectivelySystemUser user.isNormalUser; + message = '' + Exactly one of users.users.${user.name}.isSystemUser and users.users.${user.name}.isNormalUser must be set. + ''; + } + { + assertion = user.group != ""; + message = '' + users.users.${user.name}.group is unset. This used to default to + nogroup, but this is unsafe. For example you can create a group + for this user with: + users.users.${user.name}.group = "${user.name}"; + users.groups.${user.name} = {}; + ''; + } + ] + ++ (map + (shell: { + assertion = + !user.ignoreShellProgramCheck + -> (user.shell == pkgs.${shell}) + -> (config.programs.${shell}.enable == true); + message = '' + users.users.${user.name}.shell is set to ${shell}, but + programs.${shell}.enable is not true. This will cause the ${shell} + shell to lack the basic nix directories in its PATH and might make + logging in as that user impossible. You can fix it with: + programs.${shell}.enable = true; + + If you know what you're doing and you are fine with the behavior, + set users.users.${user.name}.ignoreShellProgramCheck = true; + instead. + ''; + }) + [ + "fish" + "xonsh" + "zsh" + ] ) - ); + ) + ); warnings = flip concatMap (attrValues cfg.users) ( user: let - passwordOptions = - [ - "hashedPassword" - "hashedPasswordFile" - "password" - ] - ++ optionals cfg.mutableUsers [ - # For immutable users, initialHashedPassword is set to hashedPassword, - # so using these options would always trigger the assertion. - "initialHashedPassword" - "initialPassword" - ]; + passwordOptions = [ + "hashedPassword" + "hashedPasswordFile" + "password" + ] + ++ optionals cfg.mutableUsers [ + # For immutable users, initialHashedPassword is set to hashedPassword, + # so using these options would always trigger the assertion. + "initialHashedPassword" + "initialPassword" + ]; unambiguousPasswordConfiguration = 1 >= length (filter (x: x != null) (map (flip getAttr user) passwordOptions)); in diff --git a/nixos/modules/config/xdg/icons.nix b/nixos/modules/config/xdg/icons.nix index 0deb5fbb80aa..7810c57ef386 100644 --- a/nixos/modules/config/xdg/icons.nix +++ b/nixos/modules/config/xdg/icons.nix @@ -34,22 +34,21 @@ "/share/pixmaps" ]; - environment.systemPackages = - [ - # Empty icon theme that contains index.theme file describing directories - # where toolkits should look for icons installed by apps. - pkgs.hicolor-icon-theme - ] - ++ lib.optionals (config.xdg.icons.fallbackCursorThemes != [ ]) [ - (pkgs.writeTextFile { - name = "fallback-cursor-theme"; - text = '' - [Icon Theme] - Inherits=${lib.concatStringsSep "," config.xdg.icons.fallbackCursorThemes} - ''; - destination = "/share/icons/default/index.theme"; - }) - ]; + environment.systemPackages = [ + # Empty icon theme that contains index.theme file describing directories + # where toolkits should look for icons installed by apps. + pkgs.hicolor-icon-theme + ] + ++ lib.optionals (config.xdg.icons.fallbackCursorThemes != [ ]) [ + (pkgs.writeTextFile { + name = "fallback-cursor-theme"; + text = '' + [Icon Theme] + Inherits=${lib.concatStringsSep "," config.xdg.icons.fallbackCursorThemes} + ''; + destination = "/share/icons/default/index.theme"; + }) + ]; # libXcursor looks for cursors in XCURSOR_PATH # it mostly follows the spec for icons diff --git a/nixos/modules/hardware/all-hardware.nix b/nixos/modules/hardware/all-hardware.nix index 6ffd8b677686..7e67cd7d43fe 100644 --- a/nixos/modules/hardware/all-hardware.nix +++ b/nixos/modules/hardware/all-hardware.nix @@ -22,151 +22,150 @@ in # The initrd has to contain any module that might be necessary for # supporting the most important parts of HW like drives. - boot.initrd.availableKernelModules = - [ - # SATA/PATA support. - "ahci" + boot.initrd.availableKernelModules = [ + # SATA/PATA support. + "ahci" - "ata_piix" + "ata_piix" - "sata_inic162x" - "sata_nv" - "sata_promise" - "sata_qstor" - "sata_sil" - "sata_sil24" - "sata_sis" - "sata_svw" - "sata_sx4" - "sata_uli" - "sata_via" - "sata_vsc" + "sata_inic162x" + "sata_nv" + "sata_promise" + "sata_qstor" + "sata_sil" + "sata_sil24" + "sata_sis" + "sata_svw" + "sata_sx4" + "sata_uli" + "sata_via" + "sata_vsc" - "pata_ali" - "pata_amd" - "pata_artop" - "pata_atiixp" - "pata_efar" - "pata_hpt366" - "pata_hpt37x" - "pata_hpt3x2n" - "pata_hpt3x3" - "pata_it8213" - "pata_it821x" - "pata_jmicron" - "pata_marvell" - "pata_mpiix" - "pata_netcell" - "pata_ns87410" - "pata_oldpiix" - "pata_pcmcia" - "pata_pdc2027x" - "pata_qdi" - "pata_rz1000" - "pata_serverworks" - "pata_sil680" - "pata_sis" - "pata_sl82c105" - "pata_triflex" - "pata_via" - "pata_winbond" + "pata_ali" + "pata_amd" + "pata_artop" + "pata_atiixp" + "pata_efar" + "pata_hpt366" + "pata_hpt37x" + "pata_hpt3x2n" + "pata_hpt3x3" + "pata_it8213" + "pata_it821x" + "pata_jmicron" + "pata_marvell" + "pata_mpiix" + "pata_netcell" + "pata_ns87410" + "pata_oldpiix" + "pata_pcmcia" + "pata_pdc2027x" + "pata_qdi" + "pata_rz1000" + "pata_serverworks" + "pata_sil680" + "pata_sis" + "pata_sl82c105" + "pata_triflex" + "pata_via" + "pata_winbond" - # SCSI support (incomplete). - "3w-9xxx" - "3w-xxxx" - "aic79xx" - "aic7xxx" - "arcmsr" - "hpsa" + # SCSI support (incomplete). + "3w-9xxx" + "3w-xxxx" + "aic79xx" + "aic7xxx" + "arcmsr" + "hpsa" - # USB support, especially for booting from USB CD-ROM - # drives. - "uas" + # USB support, especially for booting from USB CD-ROM + # drives. + "uas" - # SD cards. - "sdhci_pci" + # SD cards. + "sdhci_pci" - # NVMe drives - "nvme" + # NVMe drives + "nvme" - # Firewire support. Not tested. - "ohci1394" - "sbp2" + # Firewire support. Not tested. + "ohci1394" + "sbp2" - # Virtio (QEMU, KVM etc.) support. - "virtio_net" - "virtio_pci" - "virtio_mmio" - "virtio_blk" - "virtio_scsi" - "virtio_balloon" - "virtio_console" + # Virtio (QEMU, KVM etc.) support. + "virtio_net" + "virtio_pci" + "virtio_mmio" + "virtio_blk" + "virtio_scsi" + "virtio_balloon" + "virtio_console" - # VMware support. - "mptspi" - "vmxnet3" - "vsock" - ] - ++ lib.optional platform.isx86 "vmw_balloon" - ++ lib.optionals (pkgs.stdenv.hostPlatform.isi686 || pkgs.stdenv.hostPlatform.isx86_64) [ - "vmw_vmci" - "vmwgfx" - "vmw_vsock_vmci_transport" + # VMware support. + "mptspi" + "vmxnet3" + "vsock" + ] + ++ lib.optional platform.isx86 "vmw_balloon" + ++ lib.optionals (pkgs.stdenv.hostPlatform.isi686 || pkgs.stdenv.hostPlatform.isx86_64) [ + "vmw_vmci" + "vmwgfx" + "vmw_vsock_vmci_transport" - # Hyper-V support. - "hv_storvsc" - ] - ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch [ - # Allwinner support - # Required for early KMS - "sun4i-drm" - "sun8i-mixer" # Audio, but required for kms + # Hyper-V support. + "hv_storvsc" + ] + ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch [ + # Allwinner support + # Required for early KMS + "sun4i-drm" + "sun8i-mixer" # Audio, but required for kms - # PWM for the backlight - "pwm-sun4i" + # PWM for the backlight + "pwm-sun4i" - # Broadcom - "vc4" - ] - ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch64 [ - # Most of the following falls into two categories: - # - early KMS / early display - # - early storage (e.g. USB) support + # Broadcom + "vc4" + ] + ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch64 [ + # Most of the following falls into two categories: + # - early KMS / early display + # - early storage (e.g. USB) support - # Broadcom + # Broadcom - "pcie-brcmstb" + "pcie-brcmstb" - # Rockchip - "dw-hdmi" - "dw-mipi-dsi" - "rockchipdrm" - "rockchip-rga" - "phy-rockchip-pcie" - "pcie-rockchip-host" + # Rockchip + "dw-hdmi" + "dw-mipi-dsi" + "rockchipdrm" + "rockchip-rga" + "phy-rockchip-pcie" + "pcie-rockchip-host" - # Misc. uncategorized hardware + # Misc. uncategorized hardware - # Used for some platform's integrated displays - "panel-simple" - "pwm-bl" + # Used for some platform's integrated displays + "panel-simple" + "pwm-bl" - # Power supply drivers, some platforms need them for USB - "axp20x-ac-power" - "axp20x-battery" - "pinctrl-axp209" - "mp8859" + # Power supply drivers, some platforms need them for USB + "axp20x-ac-power" + "axp20x-battery" + "pinctrl-axp209" + "mp8859" - # USB drivers - "xhci-pci-renesas" + # USB drivers + "xhci-pci-renesas" - # Reset controllers - "reset-raspberrypi" # Triggers USB chip firmware load. + # Reset controllers + "reset-raspberrypi" # Triggers USB chip firmware load. - # Misc "weak" dependencies - "analogix-dp" - "analogix-anx6345" # For DP or eDP (e.g. integrated display) - ]; + # Misc "weak" dependencies + "analogix-dp" + "analogix-anx6345" # For DP or eDP (e.g. integrated display) + ]; # Include lots of firmware. hardware.enableRedistributableFirmware = true; diff --git a/nixos/modules/hardware/device-tree.nix b/nixos/modules/hardware/device-tree.nix index 98c7bf1302d0..dab3488b320e 100644 --- a/nixos/modules/hardware/device-tree.nix +++ b/nixos/modules/hardware/device-tree.nix @@ -93,7 +93,8 @@ let let includePaths = [ "${lib.getDev cfg.kernelPackage}/lib/modules/${cfg.kernelPackage.modDirVersion}/source/scripts/dtc/include-prefixes" - ] ++ cfg.dtboBuildExtraIncludePaths; + ] + ++ cfg.dtboBuildExtraIncludePaths; extraPreprocessorFlags = cfg.dtboBuildExtraPreprocessorFlags; in if o.dtboFile == null then diff --git a/nixos/modules/hardware/infiniband.nix b/nixos/modules/hardware/infiniband.nix index 311b91c5c5b2..2726e697c4fa 100644 --- a/nixos/modules/hardware/infiniband.nix +++ b/nixos/modules/hardware/infiniband.nix @@ -7,31 +7,30 @@ let cfg = config.hardware.infiniband; - opensm-services = - { - "opensm@" = { - enable = true; - description = "Starts OpenSM Infiniband fabric Subnet Managers"; - before = [ "network.target" ]; - unitConfig = { - ConditionPathExists = "/sys/class/infiniband_mad/abi_version"; - }; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.opensm}/bin/opensm --guid %I --log_file /var/log/opensm.%I.log"; - }; + opensm-services = { + "opensm@" = { + enable = true; + description = "Starts OpenSM Infiniband fabric Subnet Managers"; + before = [ "network.target" ]; + unitConfig = { + ConditionPathExists = "/sys/class/infiniband_mad/abi_version"; }; - } - // (builtins.listToAttrs ( - map (guid: { - name = "opensm@${guid}"; - value = { - enable = true; - wantedBy = [ "machines.target" ]; - overrideStrategy = "asDropin"; - }; - }) cfg.guids - )); + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.opensm}/bin/opensm --guid %I --log_file /var/log/opensm.%I.log"; + }; + }; + } + // (builtins.listToAttrs ( + map (guid: { + name = "opensm@${guid}"; + value = { + enable = true; + wantedBy = [ "machines.target" ]; + overrideStrategy = "asDropin"; + }; + }) cfg.guids + )); in diff --git a/nixos/modules/hardware/ksm.nix b/nixos/modules/hardware/ksm.nix index 26b6e6049b97..026ad87c8fc2 100644 --- a/nixos/modules/hardware/ksm.nix +++ b/nixos/modules/hardware/ksm.nix @@ -24,13 +24,12 @@ in systemd.services.enable-ksm = { description = "Enable Kernel Same-Page Merging"; wantedBy = [ "multi-user.target" ]; - script = - '' - echo 1 > /sys/kernel/mm/ksm/run - '' - + lib.optionalString (cfg.sleep != null) '' - echo ${toString cfg.sleep} > /sys/kernel/mm/ksm/sleep_millisecs - ''; + script = '' + echo 1 > /sys/kernel/mm/ksm/run + '' + + lib.optionalString (cfg.sleep != null) '' + echo ${toString cfg.sleep} > /sys/kernel/mm/ksm/sleep_millisecs + ''; }; }; } diff --git a/nixos/modules/hardware/logitech.nix b/nixos/modules/hardware/logitech.nix index d52236e56f82..74c8a230bc46 100644 --- a/nixos/modules/hardware/logitech.nix +++ b/nixos/modules/hardware/logitech.nix @@ -80,14 +80,13 @@ in ++ lib.optional cfg.wireless.enable pkgs.logitech-udev-rules ++ lib.optional cfg.lcd.enable pkgs.g15daemon; - extraRules = - '' - # nixos: hardware.logitech.lcd - '' - + lib.concatMapStringsSep "\n" ( - dev: - ''ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="${vendor}", ATTRS{idProduct}=="${dev}", TAG+="systemd", ENV{SYSTEMD_WANTS}+="${daemon}.service"'' - ) cfg.lcd.devices; + extraRules = '' + # nixos: hardware.logitech.lcd + '' + + lib.concatMapStringsSep "\n" ( + dev: + ''ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="${vendor}", ATTRS{idProduct}=="${dev}", TAG+="systemd", ENV{SYSTEMD_WANTS}+="${daemon}.service"'' + ) cfg.lcd.devices; }; systemd.services."${daemon}" = lib.mkIf cfg.lcd.enable { diff --git a/nixos/modules/hardware/nfc-nci.nix b/nixos/modules/hardware/nfc-nci.nix index bb2ce3a9dca0..49d9be94d109 100644 --- a/nixos/modules/hardware/nfc-nci.nix +++ b/nixos/modules/hardware/nfc-nci.nix @@ -154,13 +154,12 @@ in }; config = lib.mkIf cfg.enable { - environment.systemPackages = - [ - pkgs.libnfc-nci - ] - ++ lib.optionals cfg.enableIFD [ - pkgs.ifdnfc-nci - ]; + environment.systemPackages = [ + pkgs.libnfc-nci + ] + ++ lib.optionals cfg.enableIFD [ + pkgs.ifdnfc-nci + ]; environment.etc = { "libnfc-nci.conf".text = generateSettings "nci"; diff --git a/nixos/modules/hardware/system-76.nix b/nixos/modules/hardware/system-76.nix index 4dc71b9a5098..52a5d9acc5a3 100644 --- a/nixos/modules/hardware/system-76.nix +++ b/nixos/modules/hardware/system-76.nix @@ -24,7 +24,8 @@ let modules = [ "system76" "system76-io" - ] ++ (optional (versionOlder kpkgs.kernel.version "5.5") "system76-acpi"); + ] + ++ (optional (versionOlder kpkgs.kernel.version "5.5") "system76-acpi"); modulePackages = map (m: kpkgs.${m}) modules; moduleConfig = mkIf cfg.kernel-modules.enable { boot.extraModulePackages = modulePackages; diff --git a/nixos/modules/hardware/video/bumblebee.nix b/nixos/modules/hardware/video/bumblebee.nix index 430013044251..fca939797b69 100644 --- a/nixos/modules/hardware/video/bumblebee.nix +++ b/nixos/modules/hardware/video/bumblebee.nix @@ -93,8 +93,7 @@ in ]; boot.kernelModules = lib.optional useBbswitch "bbswitch"; boot.extraModulePackages = - lib.optional useBbswitch kernel.bbswitch - ++ lib.optional useNvidia kernel.nvidia_x11.bin; + lib.optional useBbswitch kernel.bbswitch ++ lib.optional useNvidia kernel.nvidia_x11.bin; environment.systemPackages = [ bumblebee diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index 21a9d35a451c..28752c8f5406 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -488,40 +488,37 @@ in name = igpuDriver; display = offloadCfg.enable; modules = lib.optional (igpuDriver == "amdgpu") pkgs.xorg.xf86videoamdgpu; - deviceSection = - '' - BusID "${igpuBusId}" - '' - + lib.optionalString (syncCfg.enable && igpuDriver != "amdgpu") '' - Option "AccelMethod" "none" - ''; + deviceSection = '' + BusID "${igpuBusId}" + '' + + lib.optionalString (syncCfg.enable && igpuDriver != "amdgpu") '' + Option "AccelMethod" "none" + ''; } ++ lib.singleton { name = "nvidia"; modules = [ nvidia_x11.bin ]; display = !offloadCfg.enable; - deviceSection = - '' - Option "SidebandSocketPath" "/run/nvidia-xdriver/" - '' - + lib.optionalString primeEnabled '' - BusID "${pCfg.nvidiaBusId}" - '' - + lib.optionalString pCfg.allowExternalGpu '' - Option "AllowExternalGpus" - ''; - screenSection = - '' - Option "RandRRotation" "on" - '' - + lib.optionalString syncCfg.enable '' - Option "AllowEmptyInitialConfiguration" - '' - + lib.optionalString cfg.forceFullCompositionPipeline '' - Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}" - Option "AllowIndirectGLXProtocol" "off" - Option "TripleBuffer" "on" - ''; + deviceSection = '' + Option "SidebandSocketPath" "/run/nvidia-xdriver/" + '' + + lib.optionalString primeEnabled '' + BusID "${pCfg.nvidiaBusId}" + '' + + lib.optionalString pCfg.allowExternalGpu '' + Option "AllowExternalGpus" + ''; + screenSection = '' + Option "RandRRotation" "on" + '' + + lib.optionalString syncCfg.enable '' + Option "AllowEmptyInitialConfiguration" + '' + + lib.optionalString cfg.forceFullCompositionPipeline '' + Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}" + Option "AllowIndirectGLXProtocol" "off" + Option "TripleBuffer" "on" + ''; }; services.xserver.serverLayoutSection = @@ -644,16 +641,16 @@ in hardware.firmware = lib.optional cfg.gsp.enable nvidia_x11.firmware; - systemd.tmpfiles.rules = - [ - # Remove the following log message: - # (WW) NVIDIA: Failed to bind sideband socket to - # (WW) NVIDIA: '/var/run/nvidia-xdriver-b4f69129' Permission denied - # - # https://bbs.archlinux.org/viewtopic.php?pid=1909115#p1909115 - "d /run/nvidia-xdriver 0770 root users" - ] - ++ lib.optional (nvidia_x11.persistenced != null && config.virtualisation.docker.enableNvidia) + systemd.tmpfiles.rules = [ + # Remove the following log message: + # (WW) NVIDIA: Failed to bind sideband socket to + # (WW) NVIDIA: '/var/run/nvidia-xdriver-b4f69129' Permission denied + # + # https://bbs.archlinux.org/viewtopic.php?pid=1909115#p1909115 + "d /run/nvidia-xdriver 0770 root users" + ] + ++ + lib.optional (nvidia_x11.persistenced != null && config.virtualisation.docker.enableNvidia) "L+ /run/nvidia-docker/extras/bin/nvidia-persistenced - - - - ${nvidia_x11.persistenced}/origBin/nvidia-persistenced"; boot = { diff --git a/nixos/modules/hardware/video/webcam/facetimehd.nix b/nixos/modules/hardware/video/webcam/facetimehd.nix index 1b666ed95577..61222d93eecf 100644 --- a/nixos/modules/hardware/video/webcam/facetimehd.nix +++ b/nixos/modules/hardware/video/webcam/facetimehd.nix @@ -38,7 +38,8 @@ in hardware.firmware = [ pkgs.facetimehd-firmware - ] ++ lib.optional cfg.withCalibration pkgs.facetimehd-calibration; + ] + ++ lib.optional cfg.withCalibration pkgs.facetimehd-calibration; # unload module during suspend/hibernate as it crashes the whole system powerManagement.powerDownCommands = '' diff --git a/nixos/modules/i18n/input-method/default.nix b/nixos/modules/i18n/input-method/default.nix index 810abe127af4..55441dd83490 100644 --- a/nixos/modules/i18n/input-method/default.nix +++ b/nixos/modules/i18n/input-method/default.nix @@ -104,12 +104,11 @@ in warnings = lib.optional (cfg.enabled != null) "i18n.inputMethod.enabled will be removed in a future release. Please use .type, and .enable = true instead"; - environment.systemPackages = - [ - cfg.package - ] - ++ lib.optional cfg.enableGtk2 gtk2_cache - ++ lib.optional cfg.enableGtk3 gtk3_cache; + environment.systemPackages = [ + cfg.package + ] + ++ lib.optional cfg.enableGtk2 gtk2_cache + ++ lib.optional cfg.enableGtk3 gtk3_cache; }; meta = { diff --git a/nixos/modules/i18n/input-method/fcitx5.nix b/nixos/modules/i18n/input-method/fcitx5.nix index 9b4284e7ae2e..9f3517dd7771 100644 --- a/nixos/modules/i18n/input-method/fcitx5.nix +++ b/nixos/modules/i18n/input-method/fcitx5.nix @@ -147,15 +147,14 @@ in ) cfg.settings.addons) ]; - environment.variables = - { - XMODIFIERS = "@im=fcitx"; - QT_PLUGIN_PATH = [ "${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ]; - } - // lib.optionalAttrs (!cfg.waylandFrontend) { - GTK_IM_MODULE = "fcitx"; - QT_IM_MODULE = "fcitx"; - }; + environment.variables = { + XMODIFIERS = "@im=fcitx"; + QT_PLUGIN_PATH = [ "${fcitx5Package}/${pkgs.qt6.qtbase.qtPluginPrefix}" ]; + } + // lib.optionalAttrs (!cfg.waylandFrontend) { + GTK_IM_MODULE = "fcitx"; + QT_IM_MODULE = "fcitx"; + }; environment.sessionVariables = lib.mkIf cfg.ignoreUserConfig { SKIP_FCITX_USER_PATH = "1"; diff --git a/nixos/modules/i18n/input-method/kime.nix b/nixos/modules/i18n/input-method/kime.nix index 92dfe4abba76..c579731a965d 100644 --- a/nixos/modules/i18n/input-method/kime.nix +++ b/nixos/modules/i18n/input-method/kime.nix @@ -69,14 +69,13 @@ in XMODIFIERS = "@im=kime"; }; - environment.etc."xdg/kime/config.yaml".text = - '' - daemon: - modules: [${lib.concatStringsSep "," imcfg.kime.daemonModules}] - indicator: - icon_color: ${imcfg.kime.iconColor} - '' - + imcfg.kime.extraConfig; + environment.etc."xdg/kime/config.yaml".text = '' + daemon: + modules: [${lib.concatStringsSep "," imcfg.kime.daemonModules}] + indicator: + icon_color: ${imcfg.kime.iconColor} + '' + + imcfg.kime.extraConfig; }; # uses attributes of the linked package diff --git a/nixos/modules/image/repart-image.nix b/nixos/modules/image/repart-image.nix index 026f68418e95..1bc50c719b14 100644 --- a/nixos/modules/image/repart-image.nix +++ b/nixos/modules/image/repart-image.nix @@ -148,16 +148,15 @@ stdenvNoCC.mkDerivation ( # to the closure that was used to build it unsafeDiscardReferences.out = true; - nativeBuildInputs = - [ - systemd - util-linux - fakeroot - ] - ++ lib.optionals (compression.enable) [ - compressionPkg - ] - ++ fileSystemTools; + nativeBuildInputs = [ + systemd + util-linux + fakeroot + ] + ++ lib.optionals (compression.enable) [ + compressionPkg + ] + ++ fileSystemTools; env = mkfsEnv; @@ -168,24 +167,23 @@ stdenvNoCC.mkDerivation ( # relative path to the repart definitions that are read by systemd-repart finalRepartDefinitions = "repart.d"; - systemdRepartFlags = - [ - "--architecture=${systemdArch}" - "--dry-run=no" - "--size=auto" - "--definitions=${finalAttrs.finalRepartDefinitions}" - "--split=${lib.boolToString split}" - "--json=pretty" - ] - ++ lib.optionals (seed != null) [ - "--seed=${seed}" - ] - ++ lib.optionals createEmpty [ - "--empty=create" - ] - ++ lib.optionals (sectorSize != null) [ - "--sector-size=${toString sectorSize}" - ]; + systemdRepartFlags = [ + "--architecture=${systemdArch}" + "--dry-run=no" + "--size=auto" + "--definitions=${finalAttrs.finalRepartDefinitions}" + "--split=${lib.boolToString split}" + "--json=pretty" + ] + ++ lib.optionals (seed != null) [ + "--seed=${seed}" + ] + ++ lib.optionals createEmpty [ + "--empty=create" + ] + ++ lib.optionals (sectorSize != null) [ + "--sector-size=${toString sectorSize}" + ]; dontUnpack = true; dontConfigure = true; @@ -213,27 +211,26 @@ stdenvNoCC.mkDerivation ( runHook postBuild ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out - '' - # Compression is implemented in the same derivation as opposed to in a - # separate derivation to allow users to save disk space. Disk images are - # already very space intensive so we want to allow users to mitigate this. - + lib.optionalString compression.enable '' - for f in ${imageFileBasename}*; do - echo "Compressing $f with ${compression.algorithm}..." - # Keep the original file when compressing and only delete it afterwards - ${compressionCommand} $f && rm $f - done - '' - + '' - mv -v repart-output.json ${imageFileBasename}* $out + mkdir -p $out + '' + # Compression is implemented in the same derivation as opposed to in a + # separate derivation to allow users to save disk space. Disk images are + # already very space intensive so we want to allow users to mitigate this. + + lib.optionalString compression.enable '' + for f in ${imageFileBasename}*; do + echo "Compressing $f with ${compression.algorithm}..." + # Keep the original file when compressing and only delete it afterwards + ${compressionCommand} $f && rm $f + done + '' + + '' + mv -v repart-output.json ${imageFileBasename}* $out - runHook postInstall - ''; + runHook postInstall + ''; passthru = { inherit amendRepartDefinitions; diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index 35afdc3a3f76..47397b99d922 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -797,7 +797,8 @@ in device = "/iso/nix-store.squashfs"; options = [ "loop" - ] ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi"; + ] + ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi"; neededForBoot = true; }; @@ -869,7 +870,8 @@ in environment.systemPackages = [ grubPkgs.grub2 - ] ++ lib.optional (config.isoImage.makeBiosBootable) pkgs.syslinux; + ] + ++ lib.optional (config.isoImage.makeBiosBootable) pkgs.syslinux; system.extraDependencies = [ grubPkgs.grub2_efi ]; # In stage 1 of the boot, mount the CD as the root FS by label so @@ -901,9 +903,10 @@ in # Closures to be copied to the Nix store on the CD, namely the init # script and the top-level system configuration directory. - isoImage.storeContents = - [ config.system.build.toplevel ] - ++ lib.optional config.isoImage.includeSystemBuildDependencies config.system.build.toplevel.drvPath; + isoImage.storeContents = [ + config.system.build.toplevel + ] + ++ lib.optional config.isoImage.includeSystemBuildDependencies config.system.build.toplevel.drvPath; # Individual files to be included on the CD, outside of the Nix # store on the CD. diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix index 4da2c2c82cbb..052d3ea50fc0 100644 --- a/nixos/modules/installer/netboot/netboot.nix +++ b/nixos/modules/installer/netboot/netboot.nix @@ -54,7 +54,8 @@ with lib; device = "../nix-store.squashfs"; options = [ "loop" - ] ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi"; + ] + ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2") "threads=multi"; neededForBoot = true; }; diff --git a/nixos/modules/installer/sd-card/sd-image-powerpc64le.nix b/nixos/modules/installer/sd-card/sd-image-powerpc64le.nix index 549bd21f6b08..4f857d0ebc06 100644 --- a/nixos/modules/installer/sd-card/sd-image-powerpc64le.nix +++ b/nixos/modules/installer/sd-card/sd-image-powerpc64le.nix @@ -30,26 +30,25 @@ sdImage = { populateFirmwareCommands = ""; - populateRootCommands = - '' - mkdir -p ./files/boot - ${config.boot.loader.generic-extlinux-compatible.populateCmd} \ - -c ${config.system.build.toplevel} \ - -d ./files/boot - '' - # https://github.com/open-power/petitboot/blob/master/discover/syslinux-parser.c - # petitboot will look in these paths (plus all-caps versions of them): - # /boot/syslinux/syslinux.cfg - # /syslinux/syslinux.cfg - # /syslinux.cfg - + '' - mv ./files/boot/extlinux ./files/boot/syslinux - mv ./files/boot/syslinux/extlinux.conf ./files/boot/syslinux/syslinux.cfg - '' - # petitboot does not support relative paths for LINUX or INITRD; it prepends - # a `/` when parsing these fields - + '' - sed -i 's_^\(\W\W*\(INITRD\|initrd\|LINUX\|linux\)\W\)\.\./_\1/boot/_' ./files/boot/syslinux/syslinux.cfg - ''; + populateRootCommands = '' + mkdir -p ./files/boot + ${config.boot.loader.generic-extlinux-compatible.populateCmd} \ + -c ${config.system.build.toplevel} \ + -d ./files/boot + '' + # https://github.com/open-power/petitboot/blob/master/discover/syslinux-parser.c + # petitboot will look in these paths (plus all-caps versions of them): + # /boot/syslinux/syslinux.cfg + # /syslinux/syslinux.cfg + # /syslinux.cfg + + '' + mv ./files/boot/extlinux ./files/boot/syslinux + mv ./files/boot/syslinux/extlinux.conf ./files/boot/syslinux/syslinux.cfg + '' + # petitboot does not support relative paths for LINUX or INITRD; it prepends + # a `/` when parsing these fields + + '' + sed -i 's_^\(\W\W*\(INITRD\|initrd\|LINUX\|linux\)\W\)\.\./_\1/boot/_' ./files/boot/syslinux/syslinux.cfg + ''; }; } diff --git a/nixos/modules/installer/sd-card/sd-image.nix b/nixos/modules/installer/sd-card/sd-image.nix index cba5f3e8e882..988ab9ee003f 100644 --- a/nixos/modules/installer/sd-card/sd-image.nix +++ b/nixos/modules/installer/sd-card/sd-image.nix @@ -227,7 +227,8 @@ in libfaketime mtools util-linux - ] ++ lib.optional config.sdImage.compressImage zstd; + ] + ++ lib.optional config.sdImage.compressImage zstd; inherit (config.sdImage) compressImage; diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 7545bbd4d7db..3a60ae3286d2 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -77,7 +77,8 @@ let { _module.check = false; } - ] ++ docModules.eager; + ] + ++ docModules.eager; class = "nixos"; specialArgs = specialArgs // { pkgs = scrubDerivations "pkgs" pkgs; diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix index 375cfc7087d7..b12c2470d4a4 100644 --- a/nixos/modules/profiles/installation-device.nix +++ b/nixos/modules/profiles/installation-device.nix @@ -61,21 +61,20 @@ with lib; services.getty.autologinUser = "nixos"; # Some more help text. - services.getty.helpLine = - '' - The "nixos" and "root" accounts have empty passwords. + services.getty.helpLine = '' + The "nixos" and "root" accounts have empty passwords. - To log in over ssh you must set a password for either "nixos" or "root" - with `passwd` (prefix with `sudo` for "root"), or add your public key to - /home/nixos/.ssh/authorized_keys or /root/.ssh/authorized_keys. + To log in over ssh you must set a password for either "nixos" or "root" + with `passwd` (prefix with `sudo` for "root"), or add your public key to + /home/nixos/.ssh/authorized_keys or /root/.ssh/authorized_keys. - To set up a wireless connection, run `nmtui`. - '' - + optionalString config.services.xserver.enable '' + To set up a wireless connection, run `nmtui`. + '' + + optionalString config.services.xserver.enable '' - Type `sudo systemctl start display-manager' to - start the graphical user interface. - ''; + Type `sudo systemctl start display-manager' to + start the graphical user interface. + ''; # We run sshd by default. Login is only possible after adding a # password via "passwd" or by adding a ssh key to ~/.ssh/authorized_keys. diff --git a/nixos/modules/programs/cdemu.nix b/nixos/modules/programs/cdemu.nix index 5496f06de2a1..018e80aa653c 100644 --- a/nixos/modules/programs/cdemu.nix +++ b/nixos/modules/programs/cdemu.nix @@ -71,13 +71,12 @@ in Restart = "no"; }; - environment.systemPackages = - [ - pkgs.cdemu-daemon - pkgs.cdemu-client - ] - ++ lib.optional cfg.gui pkgs.gcdemu - ++ lib.optional cfg.image-analyzer pkgs.image-analyzer; + environment.systemPackages = [ + pkgs.cdemu-daemon + pkgs.cdemu-client + ] + ++ lib.optional cfg.gui pkgs.gcdemu + ++ lib.optional cfg.image-analyzer pkgs.image-analyzer; }; } diff --git a/nixos/modules/programs/dconf.nix b/nixos/modules/programs/dconf.nix index 4eaa61051e78..767a0bf9632f 100644 --- a/nixos/modules/programs/dconf.nix +++ b/nixos/modules/programs/dconf.nix @@ -50,7 +50,8 @@ let (pkgs.writeTextDir "locks/nixos-generated-dconf-locks" ( lib.concatStringsSep "\n" (if val.lockAll then mkAllLocks val.settings else val.locks) )) - ] ++ (map checkDconfKeyfiles val.keyfiles); + ] + ++ (map checkDconfKeyfiles val.keyfiles); } ); diff --git a/nixos/modules/programs/feedbackd.nix b/nixos/modules/programs/feedbackd.nix index 021ce805d376..7ee006e381cd 100644 --- a/nixos/modules/programs/feedbackd.nix +++ b/nixos/modules/programs/feedbackd.nix @@ -25,7 +25,8 @@ in config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package - ] ++ (if cfg.theme-package != null then [ cfg.theme-package ] else [ ]); + ] + ++ (if cfg.theme-package != null then [ cfg.theme-package ] else [ ]); services.dbus.packages = [ cfg.package ]; services.udev.packages = [ cfg.package ]; diff --git a/nixos/modules/programs/firefox.nix b/nixos/modules/programs/firefox.nix index 2019f1724523..1600d62ad038 100644 --- a/nixos/modules/programs/firefox.nix +++ b/nixos/modules/programs/firefox.nix @@ -293,7 +293,8 @@ in Additional packages containing native messaging hosts that should be made available to Firefox extensions. ''; }; - }) // (builtins.mapAttrs (k: v: lib.mkEnableOption "${v.name} support") nmhOptions); + }) + // (builtins.mapAttrs (k: v: lib.mkEnableOption "${v.name} support") nmhOptions); }; config = diff --git a/nixos/modules/programs/htop.nix b/nixos/modules/programs/htop.nix index 62fb4a4fe57b..358b7c0eae36 100644 --- a/nixos/modules/programs/htop.nix +++ b/nixos/modules/programs/htop.nix @@ -63,14 +63,13 @@ in cfg.package ]; - environment.etc."htoprc".text = - '' - # Global htop configuration - # To change set: programs.htop.settings.KEY = VALUE; - '' - + builtins.concatStringsSep "\n" ( - lib.mapAttrsToList (key: value: "${key}=${fmt value}") cfg.settings - ); + environment.etc."htoprc".text = '' + # Global htop configuration + # To change set: programs.htop.settings.KEY = VALUE; + '' + + builtins.concatStringsSep "\n" ( + lib.mapAttrsToList (key: value: "${key}=${fmt value}") cfg.settings + ); }; } diff --git a/nixos/modules/programs/less.nix b/nixos/modules/programs/less.nix index 9731276bddcd..dc1643b8a1a6 100644 --- a/nixos/modules/programs/less.nix +++ b/nixos/modules/programs/less.nix @@ -123,16 +123,15 @@ in environment.systemPackages = [ cfg.package ]; - environment.variables = - { - LESSKEYIN_SYSTEM = builtins.toString lessKey; - } - // lib.optionalAttrs (cfg.lessopen != null) { - LESSOPEN = cfg.lessopen; - } - // lib.optionalAttrs (cfg.lessclose != null) { - LESSCLOSE = cfg.lessclose; - }; + environment.variables = { + LESSKEYIN_SYSTEM = builtins.toString lessKey; + } + // lib.optionalAttrs (cfg.lessopen != null) { + LESSOPEN = cfg.lessopen; + } + // lib.optionalAttrs (cfg.lessclose != null) { + LESSCLOSE = cfg.lessclose; + }; warnings = lib.optional diff --git a/nixos/modules/programs/nix-required-mounts.nix b/nixos/modules/programs/nix-required-mounts.nix index 625baa0514e5..f1fa34509dbf 100644 --- a/nixos/modules/programs/nix-required-mounts.nix +++ b/nixos/modules/programs/nix-required-mounts.nix @@ -56,7 +56,8 @@ let config.hardware.graphics.package # nvidia_x11, etc: - ] ++ config.hardware.graphics.extraPackages; # nvidia_x11 + ] + ++ config.hardware.graphics.extraPackages; # nvidia_x11 defaults = { nvidia-gpu.onFeatures = package.allowedPatterns.nvidia-gpu.onFeatures; diff --git a/nixos/modules/programs/opengamepadui.nix b/nixos/modules/programs/opengamepadui.nix index 12446cabdad9..f1b862f6278e 100644 --- a/nixos/modules/programs/opengamepadui.nix +++ b/nixos/modules/programs/opengamepadui.nix @@ -264,7 +264,8 @@ in environment.systemPackages = [ cfg.package - ] ++ lib.optional cfg.gamescopeSession.enable opengamepadui-gamescope; + ] + ++ lib.optional cfg.gamescopeSession.enable opengamepadui-gamescope; }; meta.maintainers = with lib.maintainers; [ shadowapex ]; diff --git a/nixos/modules/programs/schroot.nix b/nixos/modules/programs/schroot.nix index bce8e4709ddb..2092544d2983 100644 --- a/nixos/modules/programs/schroot.nix +++ b/nixos/modules/programs/schroot.nix @@ -96,26 +96,25 @@ in environment = { systemPackages = [ cfg.package ]; - etc = - { - # schroot requires this directory to exist - "schroot/chroot.d/.keep".text = ""; + etc = { + # schroot requires this directory to exist + "schroot/chroot.d/.keep".text = ""; - "schroot/schroot.conf".source = iniFmt.generate "schroot.conf" cfg.settings; + "schroot/schroot.conf".source = iniFmt.generate "schroot.conf" cfg.settings; + } + // (lib.attrsets.concatMapAttrs ( + name: + { + copyfiles, + fstab, + nssdatabases, + }: + { + "schroot/${name}/copyfiles".text = (lib.strings.concatStringsSep "\n" copyfiles) + "\n"; + "schroot/${name}/fstab".source = fstab; + "schroot/${name}/nssdatabases".text = (lib.strings.concatStringsSep "\n" nssdatabases) + "\n"; } - // (lib.attrsets.concatMapAttrs ( - name: - { - copyfiles, - fstab, - nssdatabases, - }: - { - "schroot/${name}/copyfiles".text = (lib.strings.concatStringsSep "\n" copyfiles) + "\n"; - "schroot/${name}/fstab".source = fstab; - "schroot/${name}/nssdatabases".text = (lib.strings.concatStringsSep "\n" nssdatabases) + "\n"; - } - ) cfg.profiles); + ) cfg.profiles); }; security.wrappers.schroot = { diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index 27a56034d86c..a950a1c12b12 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -32,7 +32,8 @@ let knownHostsFiles = [ "/etc/ssh/ssh_known_hosts" - ] ++ builtins.map pkgs.copyPathToStore cfg.knownHostsFiles; + ] + ++ builtins.map pkgs.copyPathToStore cfg.knownHostsFiles; in { @@ -319,21 +320,20 @@ in || config.services.openssh.settings.X11Forwarding ); - assertions = - [ - { - assertion = cfg.forwardX11 == true -> cfg.setXAuthLocation; - message = "cannot enable X11 forwarding without setting XAuth location"; - } - ] - ++ lib.flip lib.mapAttrsToList cfg.knownHosts ( - name: data: { - assertion = - (data.publicKey == null && data.publicKeyFile != null) - || (data.publicKey != null && data.publicKeyFile == null); - message = "knownHost ${name} must contain either a publicKey or publicKeyFile"; - } - ); + assertions = [ + { + assertion = cfg.forwardX11 == true -> cfg.setXAuthLocation; + message = "cannot enable X11 forwarding without setting XAuth location"; + } + ] + ++ lib.flip lib.mapAttrsToList cfg.knownHosts ( + name: data: { + assertion = + (data.publicKey == null && data.publicKeyFile != null) + || (data.publicKey != null && data.publicKeyFile == null); + message = "knownHost ${name} must contain either a publicKey or publicKeyFile"; + } + ); # SSH configuration. Slight duplication of the sshd_config # generation in the sshd service. diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix index f31aaf3bd555..a8d1b7aefc70 100644 --- a/nixos/modules/programs/steam.nix +++ b/nixos/modules/programs/steam.nix @@ -241,15 +241,14 @@ in hardware.steam-hardware.enable = true; - environment.systemPackages = - [ - cfg.package - cfg.package.run - ] - ++ lib.optional cfg.gamescopeSession.enable steam-gamescope - ++ lib.optional cfg.protontricks.enable ( - cfg.protontricks.package.override { inherit extraCompatPaths; } - ); + environment.systemPackages = [ + cfg.package + cfg.package.run + ] + ++ lib.optional cfg.gamescopeSession.enable steam-gamescope + ++ lib.optional cfg.protontricks.enable ( + cfg.protontricks.package.override { inherit extraCompatPaths; } + ); networking.firewall = lib.mkMerge [ (lib.mkIf (cfg.remotePlay.openFirewall || cfg.localNetworkGameTransfers.openFirewall) { diff --git a/nixos/modules/programs/tsm-client.nix b/nixos/modules/programs/tsm-client.nix index 9331671fcb20..26623844513c 100644 --- a/nixos/modules/programs/tsm-client.nix +++ b/nixos/modules/programs/tsm-client.nix @@ -229,44 +229,43 @@ let cfg = config.programs.tsmClient; servernames = map (s: s.servername) (attrValues cfg.servers); - assertions = - [ - { - assertion = allUnique (map toLower servernames); - message = '' - TSM server names - (option `programs.tsmClient.servers`) - contain duplicate name - (note that server names are case insensitive). - ''; - } - { - assertion = (cfg.defaultServername != null) -> (elem cfg.defaultServername servernames); - message = '' - TSM default server name - `programs.tsmClient.defaultServername="${cfg.defaultServername}"` - not found in server names in - `programs.tsmClient.servers`. - ''; - } - ] - ++ (mapAttrsToList (name: serverCfg: { - assertion = all (key: null != match "[^[:space:]]+" key) (attrNames serverCfg); + assertions = [ + { + assertion = allUnique (map toLower servernames); message = '' - TSM server setting names in - `programs.tsmClient.servers.${name}.*` - contain spaces, but that's not allowed. + TSM server names + (option `programs.tsmClient.servers`) + contain duplicate name + (note that server names are case insensitive). ''; - }) cfg.servers) - ++ (mapAttrsToList (name: serverCfg: { - assertion = allUnique (map toLower (attrNames serverCfg)); + } + { + assertion = (cfg.defaultServername != null) -> (elem cfg.defaultServername servernames); message = '' - TSM server setting names in - `programs.tsmClient.servers.${name}.*` - contain duplicate names - (note that setting names are case insensitive). + TSM default server name + `programs.tsmClient.defaultServername="${cfg.defaultServername}"` + not found in server names in + `programs.tsmClient.servers`. ''; - }) cfg.servers); + } + ] + ++ (mapAttrsToList (name: serverCfg: { + assertion = all (key: null != match "[^[:space:]]+" key) (attrNames serverCfg); + message = '' + TSM server setting names in + `programs.tsmClient.servers.${name}.*` + contain spaces, but that's not allowed. + ''; + }) cfg.servers) + ++ (mapAttrsToList (name: serverCfg: { + assertion = allUnique (map toLower (attrNames serverCfg)); + message = '' + TSM server setting names in + `programs.tsmClient.servers.${name}.*` + contain duplicate names + (note that setting names are case insensitive). + ''; + }) cfg.servers); makeDsmSysLines = key: value: diff --git a/nixos/modules/programs/wayland/sway.nix b/nixos/modules/programs/wayland/sway.nix index 6acf56c1aa24..aa8dbf4e5200 100644 --- a/nixos/modules/programs/wayland/sway.nix +++ b/nixos/modules/programs/wayland/sway.nix @@ -155,20 +155,19 @@ in # Needed for the default wallpaper: pathsToLink = lib.optional (cfg.package != null) "/share/backgrounds/sway"; - etc = - { - "sway/config.d/nixos.conf".source = pkgs.writeText "nixos.conf" '' - # Import the most important environment variables into the D-Bus and systemd - # user environments (e.g. required for screen sharing and Pinentry prompts): - exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP - # enable systemd-integration - exec "systemctl --user import-environment {,WAYLAND_}DISPLAY SWAYSOCK; systemctl --user start sway-session.target" - exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target - ''; - } - // lib.optionalAttrs (cfg.package != null) { - "sway/config".source = lib.mkOptionDefault "${cfg.package}/etc/sway/config"; - }; + etc = { + "sway/config.d/nixos.conf".source = pkgs.writeText "nixos.conf" '' + # Import the most important environment variables into the D-Bus and systemd + # user environments (e.g. required for screen sharing and Pinentry prompts): + exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP + # enable systemd-integration + exec "systemctl --user import-environment {,WAYLAND_}DISPLAY SWAYSOCK; systemctl --user start sway-session.target" + exec swaymsg -t subscribe '["shutdown"]' && systemctl --user stop sway-session.target + ''; + } + // lib.optionalAttrs (cfg.package != null) { + "sway/config".source = lib.mkOptionDefault "${cfg.package}/etc/sway/config"; + }; }; systemd.user.targets.sway-session = { diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index baf16ae8397b..b46099de5255 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -308,7 +308,8 @@ in environment.systemPackages = [ pkgs.zsh - ] ++ lib.optional cfg.enableCompletion pkgs.nix-zsh-completions; + ] + ++ lib.optional cfg.enableCompletion pkgs.nix-zsh-completions; environment.pathsToLink = lib.optional cfg.enableCompletion "/share/zsh"; diff --git a/nixos/modules/security/acme/default.nix b/nixos/modules/security/acme/default.nix index 58ab3623223d..92c545797376 100644 --- a/nixos/modules/security/acme/default.nix +++ b/nixos/modules/security/acme/default.nix @@ -284,34 +284,33 @@ let data.webroot ]; - commonOpts = - [ - "--accept-tos" # Checking the option is covered by the assertions - "--path" - "." - "--email" - data.email - ] - ++ protocolOpts - ++ lib.optionals (acmeServer != null) [ - "--server" - acmeServer - ] - ++ lib.optionals (data.csr != null) [ - "--csr" - data.csr - ] - ++ lib.optionals (data.csr == null) [ - "--key-type" - data.keyType - "-d" - data.domain - ] - ++ lib.concatMap (name: [ - "-d" - name - ]) extraDomains - ++ data.extraLegoFlags; + commonOpts = [ + "--accept-tos" # Checking the option is covered by the assertions + "--path" + "." + "--email" + data.email + ] + ++ protocolOpts + ++ lib.optionals (acmeServer != null) [ + "--server" + acmeServer + ] + ++ lib.optionals (data.csr != null) [ + "--csr" + data.csr + ] + ++ lib.optionals (data.csr == null) [ + "--key-type" + data.keyType + "-d" + data.domain + ] + ++ lib.concatMap (name: [ + "-d" + name + ]) extraDomains + ++ data.extraLegoFlags; # Although --must-staple is common to both modes, it is not declared as a # mode-agnostic argument in lego and thus must come after the mode. @@ -420,7 +419,8 @@ let "network-online.target" "acme-setup.service" "nss-lookup.target" - ] ++ selfsignedDeps; + ] + ++ selfsignedDeps; wants = [ "network-online.target" ] ++ selfsignedDeps; requires = [ "acme-setup.service" ]; diff --git a/nixos/modules/security/apparmor.nix b/nixos/modules/security/apparmor.nix index 2a20a673d5af..5875d13bf786 100644 --- a/nixos/modules/security/apparmor.nix +++ b/nixos/modules/security/apparmor.nix @@ -149,13 +149,12 @@ in }) enabledPolicies ++ lib.mapAttrsToList (name: path: { inherit name path; }) cfg.includes ); - environment.etc."apparmor/parser.conf".text = - '' - ${if cfg.enableCache then "write-cache" else "skip-cache"} - cache-loc /var/cache/apparmor - Include /etc/apparmor.d - '' - + lib.concatMapStrings (p: "Include ${p}/etc/apparmor.d\n") cfg.packages; + environment.etc."apparmor/parser.conf".text = '' + ${if cfg.enableCache then "write-cache" else "skip-cache"} + cache-loc /var/cache/apparmor + Include /etc/apparmor.d + '' + + lib.concatMapStrings (p: "Include ${p}/etc/apparmor.d\n") cfg.packages; # For aa-logprof environment.etc."apparmor/apparmor.conf".text = ''''; # For aa-logprof diff --git a/nixos/modules/security/apparmor/includes.nix b/nixos/modules/security/apparmor/includes.nix index ddf6f3a1a778..03f8f5df9d5f 100644 --- a/nixos/modules/security/apparmor/includes.nix +++ b/nixos/modules/security/apparmor/includes.nix @@ -39,60 +39,58 @@ in alias /sbin -> /run/current-system/sw/sbin, alias /usr -> /run/current-system/sw, ''; - "abstractions/audio" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/audio" - '' - + lib.concatMapStringsSep "\n" etcRule [ - "asound.conf" - "esound/esd.conf" - "libao.conf" - { - path = "pulse"; - trail = "/"; - } - { - path = "pulse"; - trail = "/**"; - } - { - path = "sound"; - trail = "/"; - } - { - path = "sound"; - trail = "/**"; - } - { - path = "alsa/conf.d"; - trail = "/"; - } - { - path = "alsa/conf.d"; - trail = "/*"; - } - "openal/alsoft.conf" - "wildmidi/wildmidi.conf" - ]; - "abstractions/authentication" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/authentication" - # Defined in security.pam - include - '' - + lib.concatMapStringsSep "\n" etcRule [ - "nologin" - "securetty" - { - path = "security"; - trail = "/*"; - } - "shadow" - "gshadow" - "pwdb.conf" - "default/passwd" - "login.defs" - ]; + "abstractions/audio" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/audio" + '' + + lib.concatMapStringsSep "\n" etcRule [ + "asound.conf" + "esound/esd.conf" + "libao.conf" + { + path = "pulse"; + trail = "/"; + } + { + path = "pulse"; + trail = "/**"; + } + { + path = "sound"; + trail = "/"; + } + { + path = "sound"; + trail = "/**"; + } + { + path = "alsa/conf.d"; + trail = "/"; + } + { + path = "alsa/conf.d"; + trail = "/*"; + } + "openal/alsoft.conf" + "wildmidi/wildmidi.conf" + ]; + "abstractions/authentication" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/authentication" + # Defined in security.pam + include + '' + + lib.concatMapStringsSep "\n" etcRule [ + "nologin" + "securetty" + { + path = "security"; + trail = "/*"; + } + "shadow" + "gshadow" + "pwdb.conf" + "default/passwd" + "login.defs" + ]; "abstractions/base" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/base" r ${pkgs.stdenv.cc.libc}/share/locale/**, @@ -102,38 +100,37 @@ in r ${pkgs.tzdata}/share/zoneinfo/**, r ${pkgs.stdenv.cc.libc}/share/i18n/**, ''; - "abstractions/bash" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/bash" + "abstractions/bash" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/bash" - # bash inspects filesystems at startup - # and /etc/mtab is linked to /proc/mounts - r @{PROC}/mounts, + # bash inspects filesystems at startup + # and /etc/mtab is linked to /proc/mounts + r @{PROC}/mounts, - # system-wide bash configuration - '' - + lib.concatMapStringsSep "\n" etcRule [ - "profile.dos" - "profile" - "profile.d" - { - path = "profile.d"; - trail = "/*"; - } - "bashrc" - "bash.bashrc" - "bash.bashrc.local" - "bash_completion" - "bash_completion.d" - { - path = "bash_completion.d"; - trail = "/*"; - } - # bash relies on system-wide readline configuration - "inputrc" - # run out of /etc/bash.bashrc - "DIR_COLORS" - ]; + # system-wide bash configuration + '' + + lib.concatMapStringsSep "\n" etcRule [ + "profile.dos" + "profile" + "profile.d" + { + path = "profile.d"; + trail = "/*"; + } + "bashrc" + "bash.bashrc" + "bash.bashrc.local" + "bash_completion" + "bash_completion.d" + { + path = "bash_completion.d"; + trail = "/*"; + } + # bash relies on system-wide readline configuration + "inputrc" + # run out of /etc/bash.bashrc + "DIR_COLORS" + ]; "abstractions/consoles" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/consoles" ''; @@ -166,129 +163,125 @@ in trail = "/**"; }} ''; - "abstractions/gnome" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/gnome" - include - '' - + lib.concatMapStringsSep "\n" etcRule [ - { - path = "gnome"; - trail = "/gtkrc*"; - } - { - path = "gtk"; - trail = "/*"; - } - { - path = "gtk-2.0"; - trail = "/*"; - } - { - path = "gtk-3.0"; - trail = "/*"; - } - "orbitrc" - { - path = "pango"; - trail = "/*"; - } - { - path = "/etc/gnome-vfs-2.0"; - trail = "/modules/"; - } - { - path = "/etc/gnome-vfs-2.0"; - trail = "/modules/*"; - } - "papersize" - { - path = "cups"; - trail = "/lpoptions"; - } - { - path = "gnome"; - trail = "/defaults.list"; - } - { - path = "xdg"; - trail = "/{,*-}mimeapps.list"; - } - "xdg/mimeapps.list" - ]; - "abstractions/kde" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kde" - '' - + lib.concatMapStringsSep "\n" etcRule [ - { - path = "qt3"; - trail = "/kstylerc"; - } - { - path = "qt3"; - trail = "/qt_plugins_3.3rc"; - } - { - path = "qt3"; - trail = "/qtrc"; - } - "kderc" - { - path = "kde3"; - trail = "/*"; - } - "kde4rc" - { - path = "xdg"; - trail = "/kdeglobals"; - } - { - path = "xdg"; - trail = "/Trolltech.conf"; - } - ]; - "abstractions/kerberosclient" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kerberosclient" - '' - + lib.concatMapStringsSep "\n" etcRule [ - { - path = "krb5.keytab"; - mode = "rk"; - } - "krb5.conf" - "krb5.conf.d" - { - path = "krb5.conf.d"; - trail = "/*"; - } + "abstractions/gnome" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/gnome" + include + '' + + lib.concatMapStringsSep "\n" etcRule [ + { + path = "gnome"; + trail = "/gtkrc*"; + } + { + path = "gtk"; + trail = "/*"; + } + { + path = "gtk-2.0"; + trail = "/*"; + } + { + path = "gtk-3.0"; + trail = "/*"; + } + "orbitrc" + { + path = "pango"; + trail = "/*"; + } + { + path = "/etc/gnome-vfs-2.0"; + trail = "/modules/"; + } + { + path = "/etc/gnome-vfs-2.0"; + trail = "/modules/*"; + } + "papersize" + { + path = "cups"; + trail = "/lpoptions"; + } + { + path = "gnome"; + trail = "/defaults.list"; + } + { + path = "xdg"; + trail = "/{,*-}mimeapps.list"; + } + "xdg/mimeapps.list" + ]; + "abstractions/kde" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kde" + '' + + lib.concatMapStringsSep "\n" etcRule [ + { + path = "qt3"; + trail = "/kstylerc"; + } + { + path = "qt3"; + trail = "/qt_plugins_3.3rc"; + } + { + path = "qt3"; + trail = "/qtrc"; + } + "kderc" + { + path = "kde3"; + trail = "/*"; + } + "kde4rc" + { + path = "xdg"; + trail = "/kdeglobals"; + } + { + path = "xdg"; + trail = "/Trolltech.conf"; + } + ]; + "abstractions/kerberosclient" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/kerberosclient" + '' + + lib.concatMapStringsSep "\n" etcRule [ + { + path = "krb5.keytab"; + mode = "rk"; + } + "krb5.conf" + "krb5.conf.d" + { + path = "krb5.conf.d"; + trail = "/*"; + } - # config files found via strings on libs - "krb.conf" - "krb.realms" - "srvtab" - ]; - "abstractions/ldapclient" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ldapclient" - '' - + lib.concatMapStringsSep "\n" etcRule [ - "ldap.conf" - "ldap.secret" - { - path = "openldap"; - trail = "/*"; - } - { - path = "openldap"; - trail = "/cacerts/*"; - } - { - path = "sasl2"; - trail = "/*"; - } - ]; + # config files found via strings on libs + "krb.conf" + "krb.realms" + "srvtab" + ]; + "abstractions/ldapclient" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ldapclient" + '' + + lib.concatMapStringsSep "\n" etcRule [ + "ldap.conf" + "ldap.secret" + { + path = "openldap"; + trail = "/*"; + } + { + path = "openldap"; + trail = "/cacerts/*"; + } + { + path = "sasl2"; + trail = "/*"; + } + ]; "abstractions/likewise" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/likewise" ''; @@ -296,49 +289,48 @@ in include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/mdns" ${etcRule "nss_mdns.conf"} ''; - "abstractions/nameservice" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nameservice" + "abstractions/nameservice" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nameservice" - # Many programs wish to perform nameservice-like operations, such as - # looking up users by name or id, groups by name or id, hosts by name - # or IP, etc. These operations may be performed through files, dns, - # NIS, NIS+, LDAP, hesiod, wins, etc. Allow them all here. - mr ${getLib pkgs.nss}/lib/libnss_*.so*, - mr ${getLib pkgs.nss}/lib64/libnss_*.so*, - '' - + lib.concatMapStringsSep "\n" etcRule [ - "group" - "host.conf" - "hosts" - "nsswitch.conf" - "gai.conf" - "passwd" - "protocols" + # Many programs wish to perform nameservice-like operations, such as + # looking up users by name or id, groups by name or id, hosts by name + # or IP, etc. These operations may be performed through files, dns, + # NIS, NIS+, LDAP, hesiod, wins, etc. Allow them all here. + mr ${getLib pkgs.nss}/lib/libnss_*.so*, + mr ${getLib pkgs.nss}/lib64/libnss_*.so*, + '' + + lib.concatMapStringsSep "\n" etcRule [ + "group" + "host.conf" + "hosts" + "nsswitch.conf" + "gai.conf" + "passwd" + "protocols" - # libtirpc (used for NIS/YP login) needs this - "netconfig" + # libtirpc (used for NIS/YP login) needs this + "netconfig" - "resolv.conf" + "resolv.conf" - { - path = "samba"; - trail = "/lmhosts"; - } - "services" + { + path = "samba"; + trail = "/lmhosts"; + } + "services" - "default/nss" + "default/nss" - # libnl-3-200 via libnss-gw-name - { - path = "libnl"; - trail = "/classid"; - } - { - path = "libnl-3"; - trail = "/classid"; - } - ]; + # libnl-3-200 via libnss-gw-name + { + path = "libnl"; + trail = "/classid"; + } + { + path = "libnl-3"; + trail = "/classid"; + } + ]; "abstractions/nis" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nis" ''; @@ -367,28 +359,27 @@ in trail = "/openssl.cnf"; }} ''; - "abstractions/p11-kit" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/p11-kit" - '' - + lib.concatMapStringsSep "\n" etcRule [ - { - path = "pkcs11"; - trail = "/"; - } - { - path = "pkcs11"; - trail = "/pkcs11.conf"; - } - { - path = "pkcs11"; - trail = "/modules/"; - } - { - path = "pkcs11"; - trail = "/modules/*"; - } - ]; + "abstractions/p11-kit" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/p11-kit" + '' + + lib.concatMapStringsSep "\n" etcRule [ + { + path = "pkcs11"; + trail = "/"; + } + { + path = "pkcs11"; + trail = "/pkcs11.conf"; + } + { + path = "pkcs11"; + trail = "/modules/"; + } + { + path = "pkcs11"; + trail = "/modules/*"; + } + ]; "abstractions/perl" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/perl" ${etcRule { @@ -396,67 +387,64 @@ in trail = "/**"; }} ''; - "abstractions/php" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/php" - '' - + lib.concatMapStringsSep "\n" etcRule [ - { - path = "php"; - trail = "/**/"; - } - { - path = "php5"; - trail = "/**/"; - } - { - path = "php7"; - trail = "/**/"; - } - { - path = "php"; - trail = "/**.ini"; - } - { - path = "php5"; - trail = "/**.ini"; - } - { - path = "php7"; - trail = "/**.ini"; - } - ]; - "abstractions/postfix-common" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/postfix-common" - '' - + lib.concatMapStringsSep "\n" etcRule [ - "mailname" - { - path = "postfix"; - trail = "/*.cf"; - } - "postfix/main.cf" - "postfix/master.cf" - ]; + "abstractions/php" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/php" + '' + + lib.concatMapStringsSep "\n" etcRule [ + { + path = "php"; + trail = "/**/"; + } + { + path = "php5"; + trail = "/**/"; + } + { + path = "php7"; + trail = "/**/"; + } + { + path = "php"; + trail = "/**.ini"; + } + { + path = "php5"; + trail = "/**.ini"; + } + { + path = "php7"; + trail = "/**.ini"; + } + ]; + "abstractions/postfix-common" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/postfix-common" + '' + + lib.concatMapStringsSep "\n" etcRule [ + "mailname" + { + path = "postfix"; + trail = "/*.cf"; + } + "postfix/main.cf" + "postfix/master.cf" + ]; "abstractions/python" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/python" ''; - "abstractions/qt5" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/qt5" - '' - + lib.concatMapStringsSep "\n" etcRule [ - { - path = "xdg"; - trail = "/QtProject/qtlogging.ini"; - } - { - path = "xdg/QtProject"; - trail = "/qtlogging.ini"; - } - "xdg/QtProject/qtlogging.ini" - ]; + "abstractions/qt5" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/qt5" + '' + + lib.concatMapStringsSep "\n" etcRule [ + { + path = "xdg"; + trail = "/QtProject/qtlogging.ini"; + } + { + path = "xdg/QtProject"; + trail = "/qtlogging.ini"; + } + "xdg/QtProject/qtlogging.ini" + ]; "abstractions/samba" = '' include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/samba" ${etcRule { @@ -464,56 +452,55 @@ in trail = "/*"; }} ''; - "abstractions/ssl_certs" = - '' - include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ssl_certs" + "abstractions/ssl_certs" = '' + include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/ssl_certs" - # For the NixOS module: security.acme - r /var/lib/acme/*/cert.pem, - r /var/lib/acme/*/chain.pem, - r /var/lib/acme/*/fullchain.pem, + # For the NixOS module: security.acme + r /var/lib/acme/*/cert.pem, + r /var/lib/acme/*/chain.pem, + r /var/lib/acme/*/fullchain.pem, - r /etc/pki/tls/certs/, + r /etc/pki/tls/certs/, - '' - + lib.concatMapStringsSep "\n" etcRule [ - "ssl/certs/ca-certificates.crt" - "ssl/certs/ca-bundle.crt" - "pki/tls/certs/ca-bundle.crt" + '' + + lib.concatMapStringsSep "\n" etcRule [ + "ssl/certs/ca-certificates.crt" + "ssl/certs/ca-bundle.crt" + "pki/tls/certs/ca-bundle.crt" - { - path = "ssl/trust"; - trail = "/"; - } - { - path = "ssl/trust"; - trail = "/*"; - } - { - path = "ssl/trust/anchors"; - trail = "/"; - } - { - path = "ssl/trust/anchors"; - trail = "/**"; - } - { - path = "pki/trust"; - trail = "/"; - } - { - path = "pki/trust"; - trail = "/*"; - } - { - path = "pki/trust/anchors"; - trail = "/"; - } - { - path = "pki/trust/anchors"; - trail = "/**"; - } - ]; + { + path = "ssl/trust"; + trail = "/"; + } + { + path = "ssl/trust"; + trail = "/*"; + } + { + path = "ssl/trust/anchors"; + trail = "/"; + } + { + path = "ssl/trust/anchors"; + trail = "/**"; + } + { + path = "pki/trust"; + trail = "/"; + } + { + path = "pki/trust"; + trail = "/*"; + } + { + path = "pki/trust/anchors"; + trail = "/"; + } + { + path = "pki/trust/anchors"; + trail = "/**"; + } + ]; "abstractions/ssl_keys" = '' # security.acme NixOS module r /var/lib/acme/*/full.pem, diff --git a/nixos/modules/security/dhparams.nix b/nixos/modules/security/dhparams.nix index 36bb8398f542..ed00c3ada42f 100644 --- a/nixos/modules/security/dhparams.nix +++ b/nixos/modules/security/dhparams.nix @@ -144,67 +144,66 @@ in }; config = lib.mkIf (cfg.enable && cfg.stateful) { - systemd.services = - { - dhparams-init = { - description = "Clean Up Old Diffie-Hellman Parameters"; + systemd.services = { + dhparams-init = { + description = "Clean Up Old Diffie-Hellman Parameters"; - # Clean up even when no DH params is set - wantedBy = [ "multi-user.target" ]; + # Clean up even when no DH params is set + wantedBy = [ "multi-user.target" ]; - serviceConfig.RemainAfterExit = true; - serviceConfig.Type = "oneshot"; + serviceConfig.RemainAfterExit = true; + serviceConfig.Type = "oneshot"; - script = '' - if [ ! -d ${cfg.path} ]; then - mkdir -p ${cfg.path} + script = '' + if [ ! -d ${cfg.path} ]; then + mkdir -p ${cfg.path} + fi + + # Remove old dhparams + for file in ${cfg.path}/*; do + if [ ! -f "$file" ]; then + continue fi + ${lib.concatStrings ( + lib.mapAttrsToList ( + name: + { bits, path, ... }: + '' + if [ "$file" = ${lib.escapeShellArg path} ] && \ + ${pkgs.openssl}/bin/openssl dhparam -in "$file" -text \ + | head -n 1 | grep "(${toString bits} bit)" > /dev/null; then + continue + fi + '' + ) cfg.params + )} + rm "$file" + done - # Remove old dhparams - for file in ${cfg.path}/*; do - if [ ! -f "$file" ]; then - continue - fi - ${lib.concatStrings ( - lib.mapAttrsToList ( - name: - { bits, path, ... }: - '' - if [ "$file" = ${lib.escapeShellArg path} ] && \ - ${pkgs.openssl}/bin/openssl dhparam -in "$file" -text \ - | head -n 1 | grep "(${toString bits} bit)" > /dev/null; then - continue - fi - '' - ) cfg.params - )} - rm "$file" - done - - # TODO: Ideally this would be removing the *former* cfg.path, though - # this does not seem really important as changes to it are quite - # unlikely - rmdir --ignore-fail-on-non-empty ${cfg.path} - ''; - }; + # TODO: Ideally this would be removing the *former* cfg.path, though + # this does not seem really important as changes to it are quite + # unlikely + rmdir --ignore-fail-on-non-empty ${cfg.path} + ''; + }; + } + // lib.mapAttrs' ( + name: + { bits, path, ... }: + lib.nameValuePair "dhparams-gen-${name}" { + description = "Generate Diffie-Hellman Parameters for ${name}"; + after = [ "dhparams-init.service" ]; + before = [ "${name}.service" ]; + wantedBy = [ "multi-user.target" ]; + unitConfig.ConditionPathExists = "!${path}"; + serviceConfig.Type = "oneshot"; + script = '' + mkdir -p ${lib.escapeShellArg cfg.path} + ${pkgs.openssl}/bin/openssl dhparam -out ${lib.escapeShellArg path} \ + ${toString bits} + ''; } - // lib.mapAttrs' ( - name: - { bits, path, ... }: - lib.nameValuePair "dhparams-gen-${name}" { - description = "Generate Diffie-Hellman Parameters for ${name}"; - after = [ "dhparams-init.service" ]; - before = [ "${name}.service" ]; - wantedBy = [ "multi-user.target" ]; - unitConfig.ConditionPathExists = "!${path}"; - serviceConfig.Type = "oneshot"; - script = '' - mkdir -p ${lib.escapeShellArg cfg.path} - ${pkgs.openssl}/bin/openssl dhparam -out ${lib.escapeShellArg path} \ - ${toString bits} - ''; - } - ) cfg.params; + ) cfg.params; }; meta.maintainers = with lib.maintainers; [ ekleog ]; diff --git a/nixos/modules/security/duosec.nix b/nixos/modules/security/duosec.nix index c1699f0cf308..b8ff3ae18856 100644 --- a/nixos/modules/security/duosec.nix +++ b/nixos/modules/security/duosec.nix @@ -21,12 +21,10 @@ let fallback_local_ip=${boolToStr cfg.fallbackLocalIP} ''; - configFileLogin = - configFilePam - + '' - motd=${boolToStr cfg.motd} - accept_env_factor=${boolToStr cfg.acceptEnvFactor} - ''; + configFileLogin = configFilePam + '' + motd=${boolToStr cfg.motd} + accept_env_factor=${boolToStr cfg.acceptEnvFactor} + ''; in { imports = [ diff --git a/nixos/modules/security/krb5/krb5-conf-format.nix b/nixos/modules/security/krb5/krb5-conf-format.nix index c6af150186b5..ef071f279c18 100644 --- a/nixos/modules/security/krb5/krb5-conf-format.nix +++ b/nixos/modules/security/krb5/krb5-conf-format.nix @@ -124,39 +124,38 @@ rec { in submodule { freeformType = attrsOf sectionType; - options = - { - include = mkOption { - default = [ ]; - description = '' - Files to include in the Kerberos configuration. - ''; - type = coercedTo path singleton (listOf path); - }; - includedir = mkOption { - default = [ ]; - description = '' - Directories containing files to include in the Kerberos configuration. - ''; - type = coercedTo path singleton (listOf path); - }; - module = mkOption { - default = [ ]; - description = '' - Modules to obtain Kerberos configuration from. - ''; - type = coercedTo path singleton (listOf path); - }; + options = { + include = mkOption { + default = [ ]; + description = '' + Files to include in the Kerberos configuration. + ''; + type = coercedTo path singleton (listOf path); + }; + includedir = mkOption { + default = [ ]; + description = '' + Directories containing files to include in the Kerberos configuration. + ''; + type = coercedTo path singleton (listOf path); + }; + module = mkOption { + default = [ ]; + description = '' + Modules to obtain Kerberos configuration from. + ''; + type = coercedTo path singleton (listOf path); + }; - } - // (lib.optionalAttrs enableKdcACLEntries { - realms = mkOption { - type = attrsOf realm; - description = '' - The realm(s) to serve keys for. - ''; - }; - }); + } + // (lib.optionalAttrs enableKdcACLEntries { + realms = mkOption { + type = attrsOf realm; + description = '' + The realm(s) to serve keys for. + ''; + }; + }); }; generate = diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index 0020ace8da5d..3eba6d4b519e 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -2270,16 +2270,17 @@ in a malicious process can then edit such an authorized_keys file and bypass the ssh-agent-based authentication. See https://github.com/NixOS/nixpkgs/issues/31611 '' - ++ lib.optional - ( - with config.security.pam.rssh; - enable && settings.auth_key_file or null != null && settings.authorized_keys_command or null != null - ) - '' - security.pam.rssh.settings.auth_key_file will be ignored as - security.pam.rssh.settings.authorized_keys_command has been specified. - Explictly set the former to null to silence this warning. - ''; + ++ + lib.optional + ( + with config.security.pam.rssh; + enable && settings.auth_key_file or null != null && settings.authorized_keys_command or null != null + ) + '' + security.pam.rssh.settings.auth_key_file will be ignored as + security.pam.rssh.settings.authorized_keys_command has been specified. + Explictly set the former to null to silence this warning. + ''; environment.systemPackages = # Include the PAM modules in the system path mostly for the manpages. @@ -2310,47 +2311,46 @@ in environment.etc = lib.mapAttrs' makePAMService enabledServices; - security.pam.services = - { - other.text = '' - auth required pam_warn.so - auth required pam_deny.so - account required pam_warn.so - account required pam_deny.so - password required pam_warn.so - password required pam_deny.so - session required pam_warn.so - session required pam_deny.so - ''; + security.pam.services = { + other.text = '' + auth required pam_warn.so + auth required pam_deny.so + account required pam_warn.so + account required pam_deny.so + password required pam_warn.so + password required pam_deny.so + session required pam_warn.so + session required pam_deny.so + ''; - # Most of these should be moved to specific modules. - i3lock.enable = lib.mkDefault config.programs.i3lock.enable; - i3lock-color.enable = lib.mkDefault config.programs.i3lock.enable; - vlock.enable = lib.mkDefault config.console.enable; - xlock.enable = lib.mkDefault config.services.xserver.enable; - xscreensaver.enable = lib.mkDefault config.services.xscreensaver.enable; + # Most of these should be moved to specific modules. + i3lock.enable = lib.mkDefault config.programs.i3lock.enable; + i3lock-color.enable = lib.mkDefault config.programs.i3lock.enable; + vlock.enable = lib.mkDefault config.console.enable; + xlock.enable = lib.mkDefault config.services.xserver.enable; + xscreensaver.enable = lib.mkDefault config.services.xscreensaver.enable; - runuser = { - rootOK = true; - unixAuth = false; - setEnvironment = false; - }; - - /* - FIXME: should runuser -l start a systemd session? Currently - it complains "Cannot create session: Already running in a - session". - */ - runuser-l = { - rootOK = true; - unixAuth = false; - }; - } - // lib.optionalAttrs (config.security.pam.enableFscrypt) { - # Allow fscrypt to verify login passphrase - fscrypt = { }; + runuser = { + rootOK = true; + unixAuth = false; + setEnvironment = false; }; + /* + FIXME: should runuser -l start a systemd session? Currently + it complains "Cannot create session: Already running in a + session". + */ + runuser-l = { + rootOK = true; + unixAuth = false; + }; + } + // lib.optionalAttrs (config.security.pam.enableFscrypt) { + # Allow fscrypt to verify login passphrase + fscrypt = { }; + }; + security.apparmor.includes."abstractions/pam" = lib.concatMapStrings (name: "r ${config.environment.etc."pam.d/${name}".source},\n") ( lib.attrNames enabledServices diff --git a/nixos/modules/security/pam_mount.nix b/nixos/modules/security/pam_mount.nix index fbc5fe1ed2b3..62deec4ca487 100644 --- a/nixos/modules/security/pam_mount.nix +++ b/nixos/modules/security/pam_mount.nix @@ -158,7 +158,8 @@ in user = user.name; path = user.cryptHomeLuks; mountpoint = user.home; - } // user.pamMount; + } + // user.pamMount; in "\n"; in diff --git a/nixos/modules/security/wrappers/wrapper.nix b/nixos/modules/security/wrappers/wrapper.nix index 13e328ffcc37..1d809ab6c9da 100644 --- a/nixos/modules/security/wrappers/wrapper.nix +++ b/nixos/modules/security/wrappers/wrapper.nix @@ -11,23 +11,22 @@ stdenv.mkDerivation { name = "security-wrapper-${baseNameOf sourceProg}"; buildInputs = [ linuxHeaders ]; dontUnpack = true; - CFLAGS = - [ - ''-DSOURCE_PROG="${sourceProg}"'' - ] - ++ ( - if debug then - [ - "-Werror" - "-Og" - "-g" - ] - else - [ - "-Wall" - "-O2" - ] - ); + CFLAGS = [ + ''-DSOURCE_PROG="${sourceProg}"'' + ] + ++ ( + if debug then + [ + "-Werror" + "-Og" + "-g" + ] + else + [ + "-Wall" + "-O2" + ] + ); dontStrip = debug; installPhase = '' mkdir -p $out/bin diff --git a/nixos/modules/services/admin/oxidized.nix b/nixos/modules/services/admin/oxidized.nix index 7c99e395adb5..a00a5d388101 100644 --- a/nixos/modules/services/admin/oxidized.nix +++ b/nixos/modules/services/admin/oxidized.nix @@ -97,51 +97,50 @@ in isSystemUser = true; }; - systemd.tmpfiles.settings."10-oxidized" = - { - "${cfg.dataDir}" = { - d = { - mode = "0750"; - user = cfg.user; - group = cfg.group; - }; - }; - - "${cfg.dataDir}/.config" = { - d = { - mode = "0750"; - user = cfg.user; - group = cfg.group; - }; - }; - - "${cfg.dataDir}/.config/oxidized" = { - d = { - mode = "0750"; - user = cfg.user; - group = cfg.group; - }; - }; - - "${cfg.dataDir}/.config/oxidized/config" = { - "L+" = { - argument = "${cfg.configFile}"; - user = cfg.user; - group = cfg.group; - }; - }; - - } - // lib.optionalAttrs (cfg.routerDB != null) { - "${cfg.dataDir}/.config/oxidized/router.db" = { - "L+" = { - argument = "${cfg.routerDB}"; - user = cfg.user; - group = cfg.group; - }; + systemd.tmpfiles.settings."10-oxidized" = { + "${cfg.dataDir}" = { + d = { + mode = "0750"; + user = cfg.user; + group = cfg.group; }; }; + "${cfg.dataDir}/.config" = { + d = { + mode = "0750"; + user = cfg.user; + group = cfg.group; + }; + }; + + "${cfg.dataDir}/.config/oxidized" = { + d = { + mode = "0750"; + user = cfg.user; + group = cfg.group; + }; + }; + + "${cfg.dataDir}/.config/oxidized/config" = { + "L+" = { + argument = "${cfg.configFile}"; + user = cfg.user; + group = cfg.group; + }; + }; + + } + // lib.optionalAttrs (cfg.routerDB != null) { + "${cfg.dataDir}/.config/oxidized/router.db" = { + "L+" = { + argument = "${cfg.routerDB}"; + user = cfg.user; + group = cfg.group; + }; + }; + }; + systemd.services.oxidized = { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; diff --git a/nixos/modules/services/admin/pgadmin.nix b/nixos/modules/services/admin/pgadmin.nix index 772c1628032a..8341b9939239 100644 --- a/nixos/modules/services/admin/pgadmin.nix +++ b/nixos/modules/services/admin/pgadmin.nix @@ -157,24 +157,23 @@ in config = lib.mkIf (cfg.enable) { networking.firewall.allowedTCPPorts = lib.mkIf (cfg.openFirewall) [ cfg.port ]; - services.pgadmin.settings = - { - DEFAULT_SERVER_PORT = cfg.port; - PASSWORD_LENGTH_MIN = cfg.minimumPasswordLength; - SERVER_MODE = true; - UPGRADE_CHECK_ENABLED = false; - } - // (lib.optionalAttrs cfg.openFirewall { - DEFAULT_SERVER = lib.mkDefault "::"; - }) - // (lib.optionalAttrs cfg.emailServer.enable { - MAIL_SERVER = cfg.emailServer.address; - MAIL_PORT = cfg.emailServer.port; - MAIL_USE_SSL = cfg.emailServer.useSSL; - MAIL_USE_TLS = cfg.emailServer.useTLS; - MAIL_USERNAME = cfg.emailServer.username; - SECURITY_EMAIL_SENDER = cfg.emailServer.sender; - }); + services.pgadmin.settings = { + DEFAULT_SERVER_PORT = cfg.port; + PASSWORD_LENGTH_MIN = cfg.minimumPasswordLength; + SERVER_MODE = true; + UPGRADE_CHECK_ENABLED = false; + } + // (lib.optionalAttrs cfg.openFirewall { + DEFAULT_SERVER = lib.mkDefault "::"; + }) + // (lib.optionalAttrs cfg.emailServer.enable { + MAIL_SERVER = cfg.emailServer.address; + MAIL_PORT = cfg.emailServer.port; + MAIL_USE_SSL = cfg.emailServer.useSSL; + MAIL_USE_TLS = cfg.emailServer.useTLS; + MAIL_USERNAME = cfg.emailServer.username; + SECURITY_EMAIL_SENDER = cfg.emailServer.sender; + }); systemd.services.pgadmin = { wantedBy = [ "multi-user.target" ]; @@ -227,7 +226,8 @@ in ExecStart = "${cfg.package}/bin/pgadmin4"; LoadCredential = [ "initial_password:${cfg.initialPasswordFile}" - ] ++ lib.optional cfg.emailServer.enable "email_password:${cfg.emailServer.passwordFile}"; + ] + ++ lib.optional cfg.emailServer.enable "email_password:${cfg.emailServer.passwordFile}"; }; }; diff --git a/nixos/modules/services/amqp/rabbitmq.nix b/nixos/modules/services/amqp/rabbitmq.nix index 39ff594c9f08..5b2794a18566 100644 --- a/nixos/modules/services/amqp/rabbitmq.nix +++ b/nixos/modules/services/amqp/rabbitmq.nix @@ -175,14 +175,13 @@ in users.groups.rabbitmq.gid = config.ids.gids.rabbitmq; - services.rabbitmq.configItems = - { - "listeners.tcp.1" = lib.mkDefault "${cfg.listenAddress}:${toString cfg.port}"; - } - // lib.optionalAttrs cfg.managementPlugin.enable { - "management.tcp.port" = toString cfg.managementPlugin.port; - "management.tcp.ip" = cfg.listenAddress; - }; + services.rabbitmq.configItems = { + "listeners.tcp.1" = lib.mkDefault "${cfg.listenAddress}:${toString cfg.port}"; + } + // lib.optionalAttrs cfg.managementPlugin.enable { + "management.tcp.port" = toString cfg.managementPlugin.port; + "management.tcp.ip" = cfg.listenAddress; + }; services.rabbitmq.plugins = lib.optional cfg.managementPlugin.enable "rabbitmq_management"; @@ -213,7 +212,8 @@ in RABBITMQ_ENABLED_PLUGINS_FILE = pkgs.writeText "enabled_plugins" '' [ ${lib.concatStringsSep "," cfg.plugins} ]. ''; - } // lib.optionalAttrs (cfg.config != "") { RABBITMQ_ADVANCED_CONFIG_FILE = advanced_config_file; }; + } + // lib.optionalAttrs (cfg.config != "") { RABBITMQ_ADVANCED_CONFIG_FILE = advanced_config_file; }; serviceConfig = { ExecStart = "${cfg.package}/sbin/rabbitmq-server"; diff --git a/nixos/modules/services/audio/gonic.nix b/nixos/modules/services/audio/gonic.nix index 1eb118c22b73..800c08b13879 100644 --- a/nixos/modules/services/audio/gonic.nix +++ b/nixos/modules/services/audio/gonic.nix @@ -63,16 +63,15 @@ in cfg.settings.playlists-path cfg.settings.podcast-path ]; - BindReadOnlyPaths = - [ - # gonic can access scrobbling services - "-/etc/resolv.conf" - "${config.security.pki.caBundle}:/etc/ssl/certs/ca-certificates.crt" - builtins.storeDir - ] - ++ cfg.settings.music-path - ++ lib.optional (cfg.settings.tls-cert != null) cfg.settings.tls-cert - ++ lib.optional (cfg.settings.tls-key != null) cfg.settings.tls-key; + BindReadOnlyPaths = [ + # gonic can access scrobbling services + "-/etc/resolv.conf" + "${config.security.pki.caBundle}:/etc/ssl/certs/ca-certificates.crt" + builtins.storeDir + ] + ++ cfg.settings.music-path + ++ lib.optional (cfg.settings.tls-cert != null) cfg.settings.tls-cert + ++ lib.optional (cfg.settings.tls-key != null) cfg.settings.tls-key; CapabilityBoundingSet = ""; RestrictAddressFamilies = [ "AF_UNIX" diff --git a/nixos/modules/services/audio/hqplayerd.nix b/nixos/modules/services/audio/hqplayerd.nix index 9eb09e86bb76..d7e155e9c8c4 100644 --- a/nixos/modules/services/audio/hqplayerd.nix +++ b/nixos/modules/services/audio/hqplayerd.nix @@ -122,19 +122,18 @@ in config.environment.etc."hqplayer/hqplayerd.xml".source ]; - preStart = - '' - cp -r "${pkg}/var/lib/hqplayer/web" "${stateDir}" - chmod -R u+wX "${stateDir}/web" + preStart = '' + cp -r "${pkg}/var/lib/hqplayer/web" "${stateDir}" + chmod -R u+wX "${stateDir}/web" - if [ ! -f "${configDir}/hqplayerd.xml" ]; then - echo "creating initial config file" - install -m 0644 "${pkg}/etc/hqplayer/hqplayerd.xml" "${configDir}/hqplayerd.xml" - fi - '' - + lib.optionalString (cfg.auth.username != null && cfg.auth.password != null) '' - ${pkg}/bin/hqplayerd -s ${cfg.auth.username} ${cfg.auth.password} - ''; + if [ ! -f "${configDir}/hqplayerd.xml" ]; then + echo "creating initial config file" + install -m 0644 "${pkg}/etc/hqplayer/hqplayerd.xml" "${configDir}/hqplayerd.xml" + fi + '' + + lib.optionalString (cfg.auth.username != null && cfg.auth.password != null) '' + ${pkg}/bin/hqplayerd -s ${cfg.auth.username} ${cfg.auth.password} + ''; }; }; diff --git a/nixos/modules/services/audio/jack.nix b/nixos/modules/services/audio/jack.nix index 0a936447b14b..d6d8b502b0c7 100644 --- a/nixos/modules/services/audio/jack.nix +++ b/nixos/modules/services/audio/jack.nix @@ -254,19 +254,18 @@ in systemd.services.jack = { description = "JACK Audio Connection Kit"; - serviceConfig = - { - User = "jackaudio"; - SupplementaryGroups = lib.optional ( - config.services.pulseaudio.enable && !config.services.pulseaudio.systemWide - ) "users"; - ExecStart = "${cfg.jackd.package}/bin/jackd ${lib.escapeShellArgs cfg.jackd.extraOptions}"; - LimitRTPRIO = 99; - LimitMEMLOCK = "infinity"; - } - // lib.optionalAttrs umaskNeeded { - UMask = "007"; - }; + serviceConfig = { + User = "jackaudio"; + SupplementaryGroups = lib.optional ( + config.services.pulseaudio.enable && !config.services.pulseaudio.systemWide + ) "users"; + ExecStart = "${cfg.jackd.package}/bin/jackd ${lib.escapeShellArgs cfg.jackd.extraOptions}"; + LimitRTPRIO = 99; + LimitMEMLOCK = "infinity"; + } + // lib.optionalAttrs umaskNeeded { + UMask = "007"; + }; path = [ cfg.jackd.package ]; environment = { JACK_PROMISCUOUS_SERVER = "jackaudio"; diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix index 8f8e8b6be036..904b0a8c60a4 100644 --- a/nixos/modules/services/audio/mpd.nix +++ b/nixos/modules/services/audio/mpd.nix @@ -258,19 +258,18 @@ in systemd.services.mpd = { wantedBy = lib.optional (!cfg.startWhenNeeded) "multi-user.target"; - preStart = - '' - set -euo pipefail - install -m 600 ${mpdConf} /run/mpd/mpd.conf - '' - + lib.optionalString (cfg.credentials != [ ]) ( - lib.concatStringsSep "\n" ( - lib.imap0 ( - i: c: - ''${pkgs.replace-secret}/bin/replace-secret '{{password-${toString i}}}' '${c.passwordFile}' /run/mpd/mpd.conf'' - ) cfg.credentials - ) - ); + preStart = '' + set -euo pipefail + install -m 600 ${mpdConf} /run/mpd/mpd.conf + '' + + lib.optionalString (cfg.credentials != [ ]) ( + lib.concatStringsSep "\n" ( + lib.imap0 ( + i: c: + ''${pkgs.replace-secret}/bin/replace-secret '{{password-${toString i}}}' '${c.passwordFile}' /run/mpd/mpd.conf'' + ) cfg.credentials + ) + ); serviceConfig = { User = "${cfg.user}"; diff --git a/nixos/modules/services/audio/navidrome.nix b/nixos/modules/services/audio/navidrome.nix index ab6fc7b6bce4..4f40837fed63 100644 --- a/nixos/modules/services/audio/navidrome.nix +++ b/nixos/modules/services/audio/navidrome.nix @@ -127,18 +127,17 @@ in BindPaths = optional (cfg.settings ? DataFolder) cfg.settings.DataFolder ++ optional (cfg.settings ? CacheFolder) cfg.settings.CacheFolder; - BindReadOnlyPaths = - [ - # navidrome uses online services to download additional album metadata / covers - "${config.security.pki.caBundle}:/etc/ssl/certs/ca-certificates.crt" - builtins.storeDir - "/etc" - ] - ++ optional (cfg.settings ? MusicFolder) cfg.settings.MusicFolder - ++ lib.optionals config.services.resolved.enable [ - "/run/systemd/resolve/stub-resolv.conf" - "/run/systemd/resolve/resolv.conf" - ]; + BindReadOnlyPaths = [ + # navidrome uses online services to download additional album metadata / covers + "${config.security.pki.caBundle}:/etc/ssl/certs/ca-certificates.crt" + builtins.storeDir + "/etc" + ] + ++ optional (cfg.settings ? MusicFolder) cfg.settings.MusicFolder + ++ lib.optionals config.services.resolved.enable [ + "/run/systemd/resolve/stub-resolv.conf" + "/run/systemd/resolve/resolv.conf" + ]; CapabilityBoundingSet = ""; RestrictAddressFamilies = [ "AF_UNIX" diff --git a/nixos/modules/services/audio/pulseaudio.nix b/nixos/modules/services/audio/pulseaudio.nix index 6724e9a32f94..b4ef09f49760 100644 --- a/nixos/modules/services/audio/pulseaudio.nix +++ b/nixos/modules/services/audio/pulseaudio.nix @@ -286,17 +286,16 @@ in "pulse/default.pa".source = myConfigFile; }; systemd.user = { - services.pulseaudio = - { - restartIfChanged = true; - serviceConfig = { - RestartSec = "500ms"; - PassEnvironment = "DISPLAY"; - }; - } - // lib.optionalAttrs config.services.jack.jackd.enable { - environment.JACK_PROMISCUOUS_SERVER = "jackaudio"; + services.pulseaudio = { + restartIfChanged = true; + serviceConfig = { + RestartSec = "500ms"; + PassEnvironment = "DISPLAY"; }; + } + // lib.optionalAttrs config.services.jack.jackd.enable { + environment.JACK_PROMISCUOUS_SERVER = "jackaudio"; + }; sockets.pulseaudio = { wantedBy = [ "sockets.target" ]; }; diff --git a/nixos/modules/services/backup/borgbackup.nix b/nixos/modules/services/backup/borgbackup.nix index e8dfb2dd68a6..2dffe39ba49f 100644 --- a/nixos/modules/services/backup/borgbackup.nix +++ b/nixos/modules/services/backup/borgbackup.nix @@ -165,22 +165,20 @@ let CPUSchedulingPolicy = "idle"; IOSchedulingClass = "idle"; ProtectSystem = "strict"; - ReadWritePaths = - [ - "${userHome}/.config/borg" - "${userHome}/.cache/borg" - ] - ++ cfg.readWritePaths - # Borg needs write access to repo if it is not remote - ++ lib.optional (isLocalPath cfg.repo) cfg.repo; + ReadWritePaths = [ + "${userHome}/.config/borg" + "${userHome}/.cache/borg" + ] + ++ cfg.readWritePaths + # Borg needs write access to repo if it is not remote + ++ lib.optional (isLocalPath cfg.repo) cfg.repo; PrivateTmp = cfg.privateTmp; }; - environment = - { - BORG_REPO = cfg.repo; - } - // (mkPassEnv cfg) - // cfg.environment; + environment = { + BORG_REPO = cfg.repo; + } + // (mkPassEnv cfg) + // cfg.environment; }; mkBackupTimers = @@ -223,7 +221,11 @@ let mkWrapperDrv { original = lib.getExe config.services.borgbackup.package; name = "borg-job-${name}"; - set = { BORG_REPO = cfg.repo; } // (mkPassEnv cfg) // cfg.environment; + set = { + BORG_REPO = cfg.repo; + } + // (mkPassEnv cfg) + // cfg.environment; }; # Paths listed in ReadWritePaths must exist before service is started @@ -895,7 +897,8 @@ in environment.systemPackages = [ config.services.borgbackup.package - ] ++ (lib.mapAttrsToList mkBorgWrapper jobs); + ] + ++ (lib.mapAttrsToList mkBorgWrapper jobs); } ); } diff --git a/nixos/modules/services/backup/btrbk.nix b/nixos/modules/services/backup/btrbk.nix index 9e39bb8ed4bb..4b705b3fb88b 100644 --- a/nixos/modules/services/backup/btrbk.nix +++ b/nixos/modules/services/backup/btrbk.nix @@ -354,12 +354,13 @@ in value = { description = "Takes BTRFS snapshots and maintains retention policies."; unitConfig.Documentation = "man:btrbk(1)"; - path = - [ "/run/wrappers" ] - ++ cfg.extraPackages - ++ optional (instance.settings.stream_compress != "no") ( - getAttr instance.settings.stream_compress streamCompressMap - ); + path = [ + "/run/wrappers" + ] + ++ cfg.extraPackages + ++ optional (instance.settings.stream_compress != "no") ( + getAttr instance.settings.stream_compress streamCompressMap + ); serviceConfig = { User = "btrbk"; Group = "btrbk"; diff --git a/nixos/modules/services/backup/duplicity.nix b/nixos/modules/services/backup/duplicity.nix index 22b43c5e131f..fa0b00db6b2c 100644 --- a/nixos/modules/services/backup/duplicity.nix +++ b/nixos/modules/services/backup/duplicity.nix @@ -162,82 +162,80 @@ in config = lib.mkIf cfg.enable { systemd = { - services.duplicity = - { - description = "backup files with duplicity"; + services.duplicity = { + description = "backup files with duplicity"; - environment.HOME = stateDirectory; + environment.HOME = stateDirectory; - script = - let - target = lib.escapeShellArg cfg.targetUrl; - extra = lib.escapeShellArgs ( + script = + let + target = lib.escapeShellArg cfg.targetUrl; + extra = lib.escapeShellArgs ( + [ + "--archive-dir" + stateDirectory + ] + ++ cfg.extraFlags + ); + dup = "${pkgs.duplicity}/bin/duplicity"; + in + '' + set -x + ${dup} cleanup ${target} --force ${extra} + ${lib.optionalString ( + cfg.cleanup.maxAge != null + ) "${dup} remove-older-than ${lib.escapeShellArg cfg.cleanup.maxAge} ${target} --force ${extra}"} + ${lib.optionalString ( + cfg.cleanup.maxFull != null + ) "${dup} remove-all-but-n-full ${toString cfg.cleanup.maxFull} ${target} --force ${extra}"} + ${lib.optionalString ( + cfg.cleanup.maxIncr != null + ) "${dup} remove-all-inc-of-but-n-full ${toString cfg.cleanup.maxIncr} ${target} --force ${extra}"} + exec ${dup} ${if cfg.fullIfOlderThan == "always" then "full" else "incr"} ${ + lib.escapeShellArgs ( [ - "--archive-dir" - stateDirectory + cfg.root + cfg.targetUrl ] - ++ cfg.extraFlags - ); - dup = "${pkgs.duplicity}/bin/duplicity"; - in - '' - set -x - ${dup} cleanup ${target} --force ${extra} - ${lib.optionalString ( - cfg.cleanup.maxAge != null - ) "${dup} remove-older-than ${lib.escapeShellArg cfg.cleanup.maxAge} ${target} --force ${extra}"} - ${lib.optionalString ( - cfg.cleanup.maxFull != null - ) "${dup} remove-all-but-n-full ${toString cfg.cleanup.maxFull} ${target} --force ${extra}"} - ${lib.optionalString ( - cfg.cleanup.maxIncr != null - ) "${dup} remove-all-inc-of-but-n-full ${toString cfg.cleanup.maxIncr} ${target} --force ${extra}"} - exec ${dup} ${if cfg.fullIfOlderThan == "always" then "full" else "incr"} ${ - lib.escapeShellArgs ( - [ - cfg.root - cfg.targetUrl - ] - ++ lib.optionals (cfg.includeFileList != null) [ - "--include-filelist" - cfg.includeFileList - ] - ++ lib.optionals (cfg.excludeFileList != null) [ - "--exclude-filelist" - cfg.excludeFileList - ] - ++ lib.concatMap (p: [ - "--include" - p - ]) cfg.include - ++ lib.concatMap (p: [ - "--exclude" - p - ]) cfg.exclude - ++ (lib.optionals (cfg.fullIfOlderThan != "never" && cfg.fullIfOlderThan != "always") [ - "--full-if-older-than" - cfg.fullIfOlderThan - ]) - ) - } ${extra} - ''; - serviceConfig = - { - PrivateTmp = true; - ProtectSystem = "strict"; - ProtectHome = "read-only"; - StateDirectory = baseNameOf stateDirectory; - } - // lib.optionalAttrs (localTarget != null) { - ReadWritePaths = localTarget; - } - // lib.optionalAttrs (cfg.secretFile != null) { - EnvironmentFile = cfg.secretFile; - }; + ++ lib.optionals (cfg.includeFileList != null) [ + "--include-filelist" + cfg.includeFileList + ] + ++ lib.optionals (cfg.excludeFileList != null) [ + "--exclude-filelist" + cfg.excludeFileList + ] + ++ lib.concatMap (p: [ + "--include" + p + ]) cfg.include + ++ lib.concatMap (p: [ + "--exclude" + p + ]) cfg.exclude + ++ (lib.optionals (cfg.fullIfOlderThan != "never" && cfg.fullIfOlderThan != "always") [ + "--full-if-older-than" + cfg.fullIfOlderThan + ]) + ) + } ${extra} + ''; + serviceConfig = { + PrivateTmp = true; + ProtectSystem = "strict"; + ProtectHome = "read-only"; + StateDirectory = baseNameOf stateDirectory; } - // lib.optionalAttrs (cfg.frequency != null) { - startAt = cfg.frequency; + // lib.optionalAttrs (localTarget != null) { + ReadWritePaths = localTarget; + } + // lib.optionalAttrs (cfg.secretFile != null) { + EnvironmentFile = cfg.secretFile; }; + } + // lib.optionalAttrs (cfg.frequency != null) { + startAt = cfg.frequency; + }; tmpfiles.rules = lib.optional (localTarget != null) "d ${localTarget} 0700 root root -"; }; diff --git a/nixos/modules/services/backup/pgbackrest.nix b/nixos/modules/services/backup/pgbackrest.nix index 1e1377818097..381589bc742d 100644 --- a/nixos/modules/services/backup/pgbackrest.nix +++ b/nixos/modules/services/backup/pgbackrest.nix @@ -52,13 +52,12 @@ let )) ]; - fullConfig = - { - global = normalize (cfg.settings // flattenWithIndex cfg.repos "repo"); - } - // lib.mapAttrs ( - _: cfg': normalize (cfg'.settings // flattenWithIndex cfg'.instances "pg") - ) cfg.stanzas; + fullConfig = { + global = normalize (cfg.settings // flattenWithIndex cfg.repos "repo"); + } + // lib.mapAttrs ( + _: cfg': normalize (cfg'.settings // flattenWithIndex cfg'.instances "pg") + ) cfg.stanzas; namedJobs = lib.listToAttrs ( lib.flatten ( diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix index 69df4f60d8de..3df51858bce8 100644 --- a/nixos/modules/services/backup/restic.nix +++ b/nixos/modules/services/backup/restic.nix @@ -367,54 +367,52 @@ in in lib.nameValuePair "restic-backups-${name}" ( { - environment = - { - # not %C, because that wouldn't work in the wrapper script - RESTIC_CACHE_DIR = "/var/cache/restic-backups-${name}"; - RESTIC_PASSWORD_FILE = backup.passwordFile; - RESTIC_REPOSITORY = backup.repository; - RESTIC_REPOSITORY_FILE = backup.repositoryFile; - } - // lib.optionalAttrs (backup.rcloneOptions != null) ( - lib.mapAttrs' ( - name: value: lib.nameValuePair (rcloneAttrToOpt name) (toRcloneVal value) - ) backup.rcloneOptions - ) - // lib.optionalAttrs (backup.rcloneConfigFile != null) { - RCLONE_CONFIG = backup.rcloneConfigFile; - } - // lib.optionalAttrs (backup.rcloneConfig != null) ( - lib.mapAttrs' ( - name: value: lib.nameValuePair (rcloneAttrToConf name) (toRcloneVal value) - ) backup.rcloneConfig - ) - // lib.optionalAttrs (backup.progressFps != null) { - RESTIC_PROGRESS_FPS = toString backup.progressFps; - }; + environment = { + # not %C, because that wouldn't work in the wrapper script + RESTIC_CACHE_DIR = "/var/cache/restic-backups-${name}"; + RESTIC_PASSWORD_FILE = backup.passwordFile; + RESTIC_REPOSITORY = backup.repository; + RESTIC_REPOSITORY_FILE = backup.repositoryFile; + } + // lib.optionalAttrs (backup.rcloneOptions != null) ( + lib.mapAttrs' ( + name: value: lib.nameValuePair (rcloneAttrToOpt name) (toRcloneVal value) + ) backup.rcloneOptions + ) + // lib.optionalAttrs (backup.rcloneConfigFile != null) { + RCLONE_CONFIG = backup.rcloneConfigFile; + } + // lib.optionalAttrs (backup.rcloneConfig != null) ( + lib.mapAttrs' ( + name: value: lib.nameValuePair (rcloneAttrToConf name) (toRcloneVal value) + ) backup.rcloneConfig + ) + // lib.optionalAttrs (backup.progressFps != null) { + RESTIC_PROGRESS_FPS = toString backup.progressFps; + }; path = [ config.programs.ssh.package ]; restartIfChanged = false; wants = [ "network-online.target" ]; after = [ "network-online.target" ]; - serviceConfig = - { - Type = "oneshot"; - ExecStart = - (lib.optionals doBackup [ - "${resticCmd} backup ${ - lib.concatStringsSep " " (backup.extraBackupArgs ++ excludeFlags) - } --files-from=${filesFromTmpFile}" - ]) - ++ pruneCmd - ++ checkCmd; - User = backup.user; - RuntimeDirectory = "restic-backups-${name}"; - CacheDirectory = "restic-backups-${name}"; - CacheDirectoryMode = "0700"; - PrivateTmp = true; - } - // lib.optionalAttrs (backup.environmentFile != null) { - EnvironmentFile = backup.environmentFile; - }; + serviceConfig = { + Type = "oneshot"; + ExecStart = + (lib.optionals doBackup [ + "${resticCmd} backup ${ + lib.concatStringsSep " " (backup.extraBackupArgs ++ excludeFlags) + } --files-from=${filesFromTmpFile}" + ]) + ++ pruneCmd + ++ checkCmd; + User = backup.user; + RuntimeDirectory = "restic-backups-${name}"; + CacheDirectory = "restic-backups-${name}"; + CacheDirectoryMode = "0700"; + PrivateTmp = true; + } + // lib.optionalAttrs (backup.environmentFile != null) { + EnvironmentFile = backup.environmentFile; + }; } // lib.optionalAttrs (backup.initialize || doBackup || backup.backupPrepareCommand != null) { preStart = '' diff --git a/nixos/modules/services/backup/snapraid.nix b/nixos/modules/services/backup/snapraid.nix index 32e5cf630ffd..19bf7ea2cf85 100644 --- a/nixos/modules/services/backup/snapraid.nix +++ b/nixos/modules/services/backup/snapraid.nix @@ -191,50 +191,49 @@ in snapraid-sync = { description = "Synchronize the state of the SnapRAID array"; startAt = sync.interval; - serviceConfig = - { - Type = "oneshot"; - ExecStart = "${pkgs.snapraid}/bin/snapraid sync"; - Nice = 19; - IOSchedulingPriority = 7; - CPUSchedulingPolicy = "batch"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.snapraid}/bin/snapraid sync"; + Nice = 19; + IOSchedulingPriority = 7; + CPUSchedulingPolicy = "batch"; - LockPersonality = true; - MemoryDenyWriteExecute = true; - NoNewPrivileges = true; - PrivateTmp = true; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - RestrictAddressFamilies = "none"; - RestrictNamespaces = true; - RestrictRealtime = true; - RestrictSUIDSGID = true; - SystemCallArchitectures = "native"; - SystemCallFilter = "@system-service"; - SystemCallErrorNumber = "EPERM"; - CapabilityBoundingSet = "CAP_DAC_OVERRIDE" + lib.optionalString cfg.touchBeforeSync " CAP_FOWNER"; + LockPersonality = true; + MemoryDenyWriteExecute = true; + NoNewPrivileges = true; + PrivateTmp = true; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + RestrictAddressFamilies = "none"; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + SystemCallFilter = "@system-service"; + SystemCallErrorNumber = "EPERM"; + CapabilityBoundingSet = "CAP_DAC_OVERRIDE" + lib.optionalString cfg.touchBeforeSync " CAP_FOWNER"; - ProtectSystem = "strict"; - ProtectHome = "read-only"; - ReadWritePaths = - # sync requires access to directories containing content files - # to remove them if they are stale - let - contentDirs = map dirOf contentFiles; - # Multiple "split" parity files can be specified in a single - # "parityFile", separated by a comma. - # https://www.snapraid.it/manual#7.1 - splitParityFiles = map (s: lib.splitString "," s) parityFiles; - in - lib.unique (lib.attrValues dataDisks ++ splitParityFiles ++ contentDirs); - } - // lib.optionalAttrs touchBeforeSync { - ExecStartPre = "${pkgs.snapraid}/bin/snapraid touch"; - }; + ProtectSystem = "strict"; + ProtectHome = "read-only"; + ReadWritePaths = + # sync requires access to directories containing content files + # to remove them if they are stale + let + contentDirs = map dirOf contentFiles; + # Multiple "split" parity files can be specified in a single + # "parityFile", separated by a comma. + # https://www.snapraid.it/manual#7.1 + splitParityFiles = map (s: lib.splitString "," s) parityFiles; + in + lib.unique (lib.attrValues dataDisks ++ splitParityFiles ++ contentDirs); + } + // lib.optionalAttrs touchBeforeSync { + ExecStartPre = "${pkgs.snapraid}/bin/snapraid touch"; + }; }; }; }; diff --git a/nixos/modules/services/cluster/druid/default.nix b/nixos/modules/services/cluster/druid/default.nix index d22a3f223678..86fa1e483a25 100644 --- a/nixos/modules/services/cluster/druid/default.nix +++ b/nixos/modules/services/cluster/druid/default.nix @@ -253,7 +253,8 @@ in tmpDirs = [ (attrByPath [ "druid.lookup.snapshotWorkingDir" ] "" cfg."${name}".config) - ] ++ (map (x: x.path) cfg."${name}".segmentLocations); + ] + ++ (map (x: x.path) cfg."${name}".segmentLocations); allowedTCPPorts = [ (attrByPath [ "druid.plaintextPort" ] 8083 cfg."${name}".config) ]; @@ -266,7 +267,8 @@ in tmpDirs = [ "/var/log/druid/indexer" - ] ++ [ (attrByPath [ "druid.indexer.task.baseTaskDir" ] "" cfg."${name}".config) ]; + ] + ++ [ (attrByPath [ "druid.indexer.task.baseTaskDir" ] "" cfg."${name}".config) ]; allowedTCPPorts = [ (attrByPath [ "druid.plaintextPort" ] 8091 cfg."${name}".config) ]; diff --git a/nixos/modules/services/cluster/hadoop/hbase.nix b/nixos/modules/services/cluster/hadoop/hbase.nix index 1d63530406c2..06af0a21811e 100644 --- a/nixos/modules/services/cluster/hadoop/hbase.nix +++ b/nixos/modules/services/cluster/hadoop/hbase.nix @@ -146,65 +146,64 @@ in ''; }; - hbase = - { + hbase = { - package = lib.mkPackageOption pkgs "hbase" { }; + package = lib.mkPackageOption pkgs "hbase" { }; - rootdir = lib.mkOption { - description = '' - This option will set "hbase.rootdir" in hbase-site.xml and determine - the directory shared by region servers and into which HBase persists. - The URL should be 'fully-qualified' to include the filesystem scheme. - If a core-site.xml is provided, the FS scheme defaults to the value - of "fs.defaultFS". + rootdir = lib.mkOption { + description = '' + This option will set "hbase.rootdir" in hbase-site.xml and determine + the directory shared by region servers and into which HBase persists. + The URL should be 'fully-qualified' to include the filesystem scheme. + If a core-site.xml is provided, the FS scheme defaults to the value + of "fs.defaultFS". - Filesystems other than HDFS (like S3, QFS, Swift) are also supported. - ''; - type = lib.types.str; - example = "hdfs://nameservice1/hbase"; - default = "/hbase"; + Filesystems other than HDFS (like S3, QFS, Swift) are also supported. + ''; + type = lib.types.str; + example = "hdfs://nameservice1/hbase"; + default = "/hbase"; + }; + zookeeperQuorum = lib.mkOption { + description = '' + This option will set "hbase.zookeeper.quorum" in hbase-site.xml. + Comma separated list of servers in the ZooKeeper ensemble. + ''; + type = with lib.types; nullOr commas; + example = "zk1.internal,zk2.internal,zk3.internal"; + default = null; + }; + } + // ( + let + ports = port: infoPort: { + port = lib.mkOption { + type = lib.types.int; + default = port; + description = "RPC port"; + }; + infoPort = lib.mkOption { + type = lib.types.int; + default = infoPort; + description = "web UI port"; + }; }; - zookeeperQuorum = lib.mkOption { + in + lib.mapAttrs hbaseRoleOption { + master.initHDFS = lib.mkEnableOption "initialization of the hbase directory on HDFS"; + regionServer.overrideHosts = lib.mkOption { + type = lib.types.bool; + default = true; description = '' - This option will set "hbase.zookeeper.quorum" in hbase-site.xml. - Comma separated list of servers in the ZooKeeper ensemble. + Remove /etc/hosts entries for "127.0.0.2" and "::1" defined in nixos/modules/config/networking.nix + Regionservers must be able to resolve their hostnames to their IP addresses, through PTR records + or /etc/hosts entries. ''; - type = with lib.types; nullOr commas; - example = "zk1.internal,zk2.internal,zk3.internal"; - default = null; }; + thrift = ports 9090 9095; + rest = ports 8080 8085; } - // ( - let - ports = port: infoPort: { - port = lib.mkOption { - type = lib.types.int; - default = port; - description = "RPC port"; - }; - infoPort = lib.mkOption { - type = lib.types.int; - default = infoPort; - description = "web UI port"; - }; - }; - in - lib.mapAttrs hbaseRoleOption { - master.initHDFS = lib.mkEnableOption "initialization of the hbase directory on HDFS"; - regionServer.overrideHosts = lib.mkOption { - type = lib.types.bool; - default = true; - description = '' - Remove /etc/hosts entries for "127.0.0.2" and "::1" defined in nixos/modules/config/networking.nix - Regionservers must be able to resolve their hostnames to their IP addresses, through PTR records - or /etc/hosts entries. - ''; - }; - thrift = ports 9090 9095; - rest = ports 8080 8085; - } - ); + ); }; config = lib.mkMerge ( diff --git a/nixos/modules/services/cluster/kubernetes/apiserver.nix b/nixos/modules/services/cluster/kubernetes/apiserver.nix index d8e99f4f71de..3ab4dbeafdf5 100644 --- a/nixos/modules/services/cluster/kubernetes/apiserver.nix +++ b/nixos/modules/services/cluster/kubernetes/apiserver.nix @@ -492,7 +492,8 @@ in top.masterAddress apiserverServiceIP "127.0.0.1" - ] ++ cfg.extraSANs; + ] + ++ cfg.extraSANs; action = "systemctl restart kube-apiserver.service"; }; apiserverProxyClient = mkCert { diff --git a/nixos/modules/services/computing/foldingathome/client.nix b/nixos/modules/services/computing/foldingathome/client.nix index b1a60416215e..58d2e77be5b0 100644 --- a/nixos/modules/services/computing/foldingathome/client.nix +++ b/nixos/modules/services/computing/foldingathome/client.nix @@ -7,16 +7,15 @@ let cfg = config.services.foldingathome; - args = - [ - "--team" - "${toString cfg.team}" - ] - ++ lib.optionals (cfg.user != null) [ - "--user" - cfg.user - ] - ++ cfg.extraArgs; + args = [ + "--team" + "${toString cfg.team}" + ] + ++ lib.optionals (cfg.user != null) [ + "--user" + cfg.user + ] + ++ cfg.extraArgs; in { imports = [ diff --git a/nixos/modules/services/computing/slurm/slurm.nix b/nixos/modules/services/computing/slurm/slurm.nix index 7a1c2437732c..4d01d4533f67 100644 --- a/nixos/modules/services/computing/slurm/slurm.nix +++ b/nixos/modules/services/computing/slurm/slurm.nix @@ -57,7 +57,8 @@ let cgroupConfig plugStackConfig mpiConf - ] ++ cfg.extraConfigPaths; + ] + ++ cfg.extraConfigPaths; }; in diff --git a/nixos/modules/services/continuous-integration/gitea-actions-runner.nix b/nixos/modules/services/continuous-integration/gitea-actions-runner.nix index b4bb4d687920..52009e6e9cef 100644 --- a/nixos/modules/services/continuous-integration/gitea-actions-runner.nix +++ b/nixos/modules/services/continuous-integration/gitea-actions-runner.nix @@ -197,16 +197,15 @@ in inherit (instance) enable; description = "Gitea Actions Runner"; wants = [ "network-online.target" ]; - after = - [ - "network-online.target" - ] - ++ optionals (wantsDocker) [ - "docker.service" - ] - ++ optionals (wantsPodman) [ - "podman.service" - ]; + after = [ + "network-online.target" + ] + ++ optionals (wantsDocker) [ + "docker.service" + ] + ++ optionals (wantsPodman) [ + "podman.service" + ]; wantedBy = [ "multi-user.target" ]; @@ -226,58 +225,57 @@ in coreutils ] ++ lib.optionals wantsHost instance.hostPackages; - serviceConfig = - { - DynamicUser = true; - User = "gitea-runner"; - StateDirectory = "gitea-runner"; - WorkingDirectory = "-/var/lib/gitea-runner/${name}"; + serviceConfig = { + DynamicUser = true; + User = "gitea-runner"; + StateDirectory = "gitea-runner"; + WorkingDirectory = "-/var/lib/gitea-runner/${name}"; - # gitea-runner might fail when gitea is restarted during upgrade. - Restart = "on-failure"; - RestartSec = 2; + # gitea-runner might fail when gitea is restarted during upgrade. + Restart = "on-failure"; + RestartSec = 2; - ExecStartPre = [ - (pkgs.writeShellScript "gitea-register-runner-${name}" '' - export INSTANCE_DIR="$STATE_DIRECTORY/${name}" - mkdir -vp "$INSTANCE_DIR" - cd "$INSTANCE_DIR" + ExecStartPre = [ + (pkgs.writeShellScript "gitea-register-runner-${name}" '' + export INSTANCE_DIR="$STATE_DIRECTORY/${name}" + mkdir -vp "$INSTANCE_DIR" + cd "$INSTANCE_DIR" - # force reregistration on changed labels - export LABELS_FILE="$INSTANCE_DIR/.labels" - export LABELS_WANTED="$(echo ${escapeShellArg (concatStringsSep "\n" instance.labels)} | sort)" - export LABELS_CURRENT="$(cat $LABELS_FILE 2>/dev/null || echo 0)" + # force reregistration on changed labels + export LABELS_FILE="$INSTANCE_DIR/.labels" + export LABELS_WANTED="$(echo ${escapeShellArg (concatStringsSep "\n" instance.labels)} | sort)" + export LABELS_CURRENT="$(cat $LABELS_FILE 2>/dev/null || echo 0)" - if [ ! -e "$INSTANCE_DIR/.runner" ] || [ "$LABELS_WANTED" != "$LABELS_CURRENT" ]; then - # remove existing registration file, so that changing the labels forces a re-registration - rm -v "$INSTANCE_DIR/.runner" || true + if [ ! -e "$INSTANCE_DIR/.runner" ] || [ "$LABELS_WANTED" != "$LABELS_CURRENT" ]; then + # remove existing registration file, so that changing the labels forces a re-registration + rm -v "$INSTANCE_DIR/.runner" || true - # perform the registration - ${cfg.package}/bin/act_runner register --no-interactive \ - --instance ${escapeShellArg instance.url} \ - --token "$TOKEN" \ - --name ${escapeShellArg instance.name} \ - --labels ${escapeShellArg (concatStringsSep "," instance.labels)} \ - --config ${configFile} + # perform the registration + ${cfg.package}/bin/act_runner register --no-interactive \ + --instance ${escapeShellArg instance.url} \ + --token "$TOKEN" \ + --name ${escapeShellArg instance.name} \ + --labels ${escapeShellArg (concatStringsSep "," instance.labels)} \ + --config ${configFile} - # and write back the configured labels - echo "$LABELS_WANTED" > "$LABELS_FILE" - fi + # and write back the configured labels + echo "$LABELS_WANTED" > "$LABELS_FILE" + fi - '') + '') + ]; + ExecStart = "${cfg.package}/bin/act_runner daemon --config ${configFile}"; + SupplementaryGroups = + optionals (wantsDocker) [ + "docker" + ] + ++ optionals (wantsPodman) [ + "podman" ]; - ExecStart = "${cfg.package}/bin/act_runner daemon --config ${configFile}"; - SupplementaryGroups = - optionals (wantsDocker) [ - "docker" - ] - ++ optionals (wantsPodman) [ - "podman" - ]; - } - // optionalAttrs (instance.tokenFile != null) { - EnvironmentFile = instance.tokenFile; - }; + } + // optionalAttrs (instance.tokenFile != null) { + EnvironmentFile = instance.tokenFile; + }; }; in mapAttrs' mkRunnerService cfg.instances; diff --git a/nixos/modules/services/continuous-integration/github-runner/service.nix b/nixos/modules/services/continuous-integration/github-runner/service.nix index edf93417d205..d40b51da0eef 100644 --- a/nixos/modules/services/continuous-integration/github-runner/service.nix +++ b/nixos/modules/services/continuous-integration/github-runner/service.nix @@ -59,7 +59,8 @@ environment = { HOME = workDir; RUNNER_ROOT = stateDir; - } // cfg.extraEnvironment; + } + // cfg.extraEnvironment; path = (with pkgs; [ diff --git a/nixos/modules/services/continuous-integration/gitlab-runner.nix b/nixos/modules/services/continuous-integration/gitlab-runner.nix index f68460c86c91..ed9a10cff6ed 100644 --- a/nixos/modules/services/continuous-integration/gitlab-runner.nix +++ b/nixos/modules/services/continuous-integration/gitlab-runner.nix @@ -68,18 +68,19 @@ let configPath = ''"$HOME"/.gitlab-runner/config.toml''; configureScript = pkgs.writeShellApplication { name = "gitlab-runner-configure"; - runtimeInputs = - [ cfg.package ] - ++ (with pkgs; [ - bash - gawk - jq - moreutils - remarshal - util-linux - perl - python3 - ]); + runtimeInputs = [ + cfg.package + ] + ++ (with pkgs; [ + bash + gawk + jq + moreutils + remarshal + util-linux + perl + python3 + ]); text = if (cfg.configFile != null) then '' @@ -775,8 +776,11 @@ in systemd.services.gitlab-runner = { description = "Gitlab Runner"; documentation = [ "https://docs.gitlab.com/runner/" ]; - after = - [ "network.target" ] ++ optional hasDocker "docker.service" ++ optional hasPodman "podman.service"; + after = [ + "network.target" + ] + ++ optional hasDocker "docker.service" + ++ optional hasPodman "podman.service"; requires = optional hasDocker "docker.service" ++ optional hasPodman "podman.service"; wantedBy = [ "multi-user.target" ]; @@ -797,24 +801,23 @@ in ++ cfg.extraPackages; reloadIfChanged = true; - serviceConfig = - { - # Set `DynamicUser` under `systemd.services.gitlab-runner.serviceConfig` - # to `lib.mkForce false` in your configuration to run this service as root. - # You can also set `User` and `Group` options to run this service as desired user. - # Make sure to restart service or changes won't apply. - DynamicUser = true; - StateDirectory = "gitlab-runner"; - SupplementaryGroups = optional hasDocker "docker" ++ optional hasPodman "podman"; - ExecStartPre = "!${configureScript}/bin/gitlab-runner-configure"; - ExecStart = "${startScript}/bin/gitlab-runner-start"; - ExecReload = "!${configureScript}/bin/gitlab-runner-configure"; - } - // optionalAttrs cfg.gracefulTermination { - TimeoutStopSec = "${cfg.gracefulTimeout}"; - KillSignal = "SIGQUIT"; - KillMode = "process"; - }; + serviceConfig = { + # Set `DynamicUser` under `systemd.services.gitlab-runner.serviceConfig` + # to `lib.mkForce false` in your configuration to run this service as root. + # You can also set `User` and `Group` options to run this service as desired user. + # Make sure to restart service or changes won't apply. + DynamicUser = true; + StateDirectory = "gitlab-runner"; + SupplementaryGroups = optional hasDocker "docker" ++ optional hasPodman "podman"; + ExecStartPre = "!${configureScript}/bin/gitlab-runner-configure"; + ExecStart = "${startScript}/bin/gitlab-runner-start"; + ExecReload = "!${configureScript}/bin/gitlab-runner-configure"; + } + // optionalAttrs cfg.gracefulTermination { + TimeoutStopSec = "${cfg.gracefulTimeout}"; + KillSignal = "SIGQUIT"; + KillMode = "process"; + }; }; # Enable periodic clear-docker-cache script systemd.services.gitlab-runner-clear-docker-cache = diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix index 8195d940f2fe..65df56ef39f1 100644 --- a/nixos/modules/services/continuous-integration/hydra/default.nix +++ b/nixos/modules/services/continuous-integration/hydra/default.nix @@ -18,18 +18,17 @@ let HYDRA_DATA = "${baseDir}"; }; - env = - { - NIX_REMOTE = "daemon"; - PGPASSFILE = "${baseDir}/pgpass"; - NIX_REMOTE_SYSTEMS = lib.concatStringsSep ":" cfg.buildMachinesFiles; - } - // lib.optionalAttrs (cfg.smtpHost != null) { - EMAIL_SENDER_TRANSPORT = "SMTP"; - EMAIL_SENDER_TRANSPORT_host = cfg.smtpHost; - } - // hydraEnv - // cfg.extraEnv; + env = { + NIX_REMOTE = "daemon"; + PGPASSFILE = "${baseDir}/pgpass"; + NIX_REMOTE_SYSTEMS = lib.concatStringsSep ":" cfg.buildMachinesFiles; + } + // lib.optionalAttrs (cfg.smtpHost != null) { + EMAIL_SENDER_TRANSPORT = "SMTP"; + EMAIL_SENDER_TRANSPORT_host = cfg.smtpHost; + } + // hydraEnv + // cfg.extraEnv; serverEnv = env diff --git a/nixos/modules/services/continuous-integration/jenkins/default.nix b/nixos/modules/services/continuous-integration/jenkins/default.nix index 96ded1e4c765..bcd96443a861 100644 --- a/nixos/modules/services/continuous-integration/jenkins/default.nix +++ b/nixos/modules/services/continuous-integration/jenkins/default.nix @@ -167,7 +167,8 @@ in # server references the dejavu fonts systemPackages = [ pkgs.dejavu_fonts - ] ++ lib.optional cfg.withCLI cfg.package; + ] + ++ lib.optional cfg.withCLI cfg.package; variables = { } diff --git a/nixos/modules/services/databases/couchdb.nix b/nixos/modules/services/databases/couchdb.nix index 030df2e7c9fd..46de0df0ee61 100644 --- a/nixos/modules/services/databases/couchdb.nix +++ b/nixos/modules/services/databases/couchdb.nix @@ -37,13 +37,12 @@ let # 2. the module configuration # 3. the extraConfigFiles from the module options # 4. the locally writable config file, which couchdb itself writes to - configFiles = - [ - "${cfg.package}/etc/default.ini" - optionsConfigFile - ] - ++ cfg.extraConfigFiles - ++ [ cfg.configFile ]; + configFiles = [ + "${cfg.package}/etc/default.ini" + optionsConfigFile + ] + ++ cfg.extraConfigFiles + ++ [ cfg.configFile ]; executable = "${cfg.package}/bin/couchdb"; in { diff --git a/nixos/modules/services/databases/dgraph.nix b/nixos/modules/services/databases/dgraph.nix index 81d160052413..38eb7df0bf66 100644 --- a/nixos/modules/services/databases/dgraph.nix +++ b/nixos/modules/services/databases/dgraph.nix @@ -133,7 +133,8 @@ in DynamicUser = true; ExecStart = "${cfg.package}/bin/dgraph zero --my ${cfg.zero.host}:${toString cfg.zero.port}"; Restart = "on-failure"; - } // securityOptions; + } + // securityOptions; }; systemd.services.dgraph-alpha = { @@ -157,7 +158,8 @@ in http://localhost:8080/admin ''; Restart = "on-failure"; - } // securityOptions; + } + // securityOptions; }; }; diff --git a/nixos/modules/services/databases/dragonflydb.nix b/nixos/modules/services/databases/dragonflydb.nix index 3a7f005fce4f..af6629b10de7 100644 --- a/nixos/modules/services/databases/dragonflydb.nix +++ b/nixos/modules/services/databases/dragonflydb.nix @@ -8,18 +8,17 @@ let cfg = config.services.dragonflydb; dragonflydb = pkgs.dragonflydb; - settings = - { - port = cfg.port; - dir = "/var/lib/dragonflydb"; - keys_output_limit = cfg.keysOutputLimit; - } - // (lib.optionalAttrs (cfg.bind != null) { bind = cfg.bind; }) - // (lib.optionalAttrs (cfg.requirePass != null) { requirepass = cfg.requirePass; }) - // (lib.optionalAttrs (cfg.maxMemory != null) { maxmemory = cfg.maxMemory; }) - // (lib.optionalAttrs (cfg.memcachePort != null) { memcache_port = cfg.memcachePort; }) - // (lib.optionalAttrs (cfg.dbNum != null) { dbnum = cfg.dbNum; }) - // (lib.optionalAttrs (cfg.cacheMode != null) { cache_mode = cfg.cacheMode; }); + settings = { + port = cfg.port; + dir = "/var/lib/dragonflydb"; + keys_output_limit = cfg.keysOutputLimit; + } + // (lib.optionalAttrs (cfg.bind != null) { bind = cfg.bind; }) + // (lib.optionalAttrs (cfg.requirePass != null) { requirepass = cfg.requirePass; }) + // (lib.optionalAttrs (cfg.maxMemory != null) { maxmemory = cfg.maxMemory; }) + // (lib.optionalAttrs (cfg.memcachePort != null) { memcache_port = cfg.memcachePort; }) + // (lib.optionalAttrs (cfg.dbNum != null) { dbnum = cfg.dbNum; }) + // (lib.optionalAttrs (cfg.cacheMode != null) { cache_mode = cfg.cacheMode; }); in { diff --git a/nixos/modules/services/databases/etcd.nix b/nixos/modules/services/databases/etcd.nix index 051547d1dd5a..b0b7ca5516fa 100644 --- a/nixos/modules/services/databases/etcd.nix +++ b/nixos/modules/services/databases/etcd.nix @@ -180,10 +180,12 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" - ] ++ lib.optional config.networking.firewall.enable "firewall.service"; + ] + ++ lib.optional config.networking.firewall.enable "firewall.service"; wants = [ "network-online.target" - ] ++ lib.optional config.networking.firewall.enable "firewall.service"; + ] + ++ lib.optional config.networking.firewall.enable "firewall.service"; environment = (lib.filterAttrs (n: v: v != null) { diff --git a/nixos/modules/services/databases/foundationdb.nix b/nixos/modules/services/databases/foundationdb.nix index 18f197890b79..5cce94ac6d5e 100644 --- a/nixos/modules/services/databases/foundationdb.nix +++ b/nixos/modules/services/databases/foundationdb.nix @@ -353,14 +353,13 @@ in assertions = [ { assertion = lib.versionOlder cfg.package.version "6.1" -> cfg.traceFormat == "xml"; - message = - '' - Versions of FoundationDB before 6.1 do not support configurable trace formats (only XML is supported). - This option has no effect for version '' - + cfg.package.version - + '' - , and enabling it is an error. - ''; + message = '' + Versions of FoundationDB before 6.1 do not support configurable trace formats (only XML is supported). + This option has no effect for version '' + + cfg.package.version + + '' + , and enabling it is an error. + ''; } ]; @@ -408,7 +407,8 @@ in cfg.logDir cfg.pidfile "/etc/foundationdb" - ] ++ cfg.extraReadWritePaths; + ] + ++ cfg.extraReadWritePaths; in { Type = "simple"; diff --git a/nixos/modules/services/databases/influxdb2.nix b/nixos/modules/services/databases/influxdb2.nix index 3dea70f6b848..18b183d65c01 100644 --- a/nixos/modules/services/databases/influxdb2.nix +++ b/nixos/modules/services/databases/influxdb2.nix @@ -415,54 +415,53 @@ in }; config = mkIf cfg.enable { - assertions = - [ - { - assertion = !(hasAttr "bolt-path" cfg.settings) && !(hasAttr "engine-path" cfg.settings); - message = "services.influxdb2.config: bolt-path and engine-path should not be set as they are managed by systemd"; - } - ] - ++ flatten ( - flip mapAttrsToList cfg.provision.organizations ( - orgName: org: - flip mapAttrsToList org.auths ( - authName: auth: [ + assertions = [ + { + assertion = !(hasAttr "bolt-path" cfg.settings) && !(hasAttr "engine-path" cfg.settings); + message = "services.influxdb2.config: bolt-path and engine-path should not be set as they are managed by systemd"; + } + ] + ++ flatten ( + flip mapAttrsToList cfg.provision.organizations ( + orgName: org: + flip mapAttrsToList org.auths ( + authName: auth: [ + { + assertion = + 1 == count (x: x) [ + auth.operator + auth.allAccess + ( + auth.readPermissions != [ ] + || auth.writePermissions != [ ] + || auth.readBuckets != [ ] + || auth.writeBuckets != [ ] + ) + ]; + message = "influxdb2: provision.organizations.${orgName}.auths.${authName}: The `operator` and `allAccess` options are mutually exclusive with each other and the granular permission settings."; + } + ( + let + unknownBuckets = subtractLists (attrNames org.buckets) auth.readBuckets; + in { - assertion = - 1 == count (x: x) [ - auth.operator - auth.allAccess - ( - auth.readPermissions != [ ] - || auth.writePermissions != [ ] - || auth.readBuckets != [ ] - || auth.writeBuckets != [ ] - ) - ]; - message = "influxdb2: provision.organizations.${orgName}.auths.${authName}: The `operator` and `allAccess` options are mutually exclusive with each other and the granular permission settings."; + assertion = unknownBuckets == [ ]; + message = "influxdb2: provision.organizations.${orgName}.auths.${authName}: Refers to invalid buckets in readBuckets: ${toString unknownBuckets}"; } - ( - let - unknownBuckets = subtractLists (attrNames org.buckets) auth.readBuckets; - in - { - assertion = unknownBuckets == [ ]; - message = "influxdb2: provision.organizations.${orgName}.auths.${authName}: Refers to invalid buckets in readBuckets: ${toString unknownBuckets}"; - } - ) - ( - let - unknownBuckets = subtractLists (attrNames org.buckets) auth.writeBuckets; - in - { - assertion = unknownBuckets == [ ]; - message = "influxdb2: provision.organizations.${orgName}.auths.${authName}: Refers to invalid buckets in writeBuckets: ${toString unknownBuckets}"; - } - ) - ] - ) + ) + ( + let + unknownBuckets = subtractLists (attrNames org.buckets) auth.writeBuckets; + in + { + assertion = unknownBuckets == [ ]; + message = "influxdb2: provision.organizations.${orgName}.auths.${authName}: Refers to invalid buckets in writeBuckets: ${toString unknownBuckets}"; + } + ) + ] ) - ); + ) + ); services.influxdb2.provision = mkIf cfg.provision.enable { organizations.${cfg.provision.initialSetup.organization} = { @@ -500,16 +499,15 @@ in "admin-token:${cfg.provision.initialSetup.tokenFile}" ]; - ExecStartPost = - [ - waitUntilServiceIsReady - ] - ++ (lib.optionals cfg.provision.enable ( - [ provisioningScript ] - ++ - # Only the restarter runs with elevated privileges - optional anyAuthDefined "+${restarterScript}" - )); + ExecStartPost = [ + waitUntilServiceIsReady + ] + ++ (lib.optionals cfg.provision.enable ( + [ provisioningScript ] + ++ + # Only the restarter runs with elevated privileges + optional anyAuthDefined "+${restarterScript}" + )); }; path = [ diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 6bd4cc508d7a..28fac48844fa 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -406,30 +406,29 @@ in ###### implementation config = lib.mkIf cfg.enable { - assertions = - [ - { - assertion = !cfg.galeraCluster.enable || isMariaDB; - message = "'services.mysql.galeraCluster.enable' expect services.mysql.package to be an mariadb variant"; - } - ] - # galeraCluster options checks - ++ lib.optionals cfg.galeraCluster.enable [ - { - assertion = - cfg.galeraCluster.localAddress != "" - && (cfg.galeraCluster.nodeAddresses != [ ] || cfg.galeraCluster.clusterAddress != ""); - message = "mariadb galera cluster is enabled but the localAddress and (nodeAddresses or clusterAddress) are not set"; - } - { - assertion = cfg.galeraCluster.clusterPassword == "" || cfg.galeraCluster.clusterAddress == ""; - message = "mariadb galera clusterPassword is set but overwritten by clusterAddress"; - } - { - assertion = cfg.galeraCluster.nodeAddresses != [ ] || cfg.galeraCluster.clusterAddress != ""; - message = "When services.mysql.galeraCluster.clusterAddress is set, setting services.mysql.galeraCluster.nodeAddresses is redundant and will be overwritten by clusterAddress. Choose one approach."; - } - ]; + assertions = [ + { + assertion = !cfg.galeraCluster.enable || isMariaDB; + message = "'services.mysql.galeraCluster.enable' expect services.mysql.package to be an mariadb variant"; + } + ] + # galeraCluster options checks + ++ lib.optionals cfg.galeraCluster.enable [ + { + assertion = + cfg.galeraCluster.localAddress != "" + && (cfg.galeraCluster.nodeAddresses != [ ] || cfg.galeraCluster.clusterAddress != ""); + message = "mariadb galera cluster is enabled but the localAddress and (nodeAddresses or clusterAddress) are not set"; + } + { + assertion = cfg.galeraCluster.clusterPassword == "" || cfg.galeraCluster.clusterAddress == ""; + message = "mariadb galera clusterPassword is set but overwritten by clusterAddress"; + } + { + assertion = cfg.galeraCluster.nodeAddresses != [ ] || cfg.galeraCluster.clusterAddress != ""; + message = "When services.mysql.galeraCluster.clusterAddress is set, setting services.mysql.galeraCluster.nodeAddresses is redundant and will be overwritten by clusterAddress. Choose one approach."; + } + ]; services.mysql.dataDir = lib.mkDefault ( if lib.versionAtLeast config.system.stateVersion "17.09" then "/var/lib/mysql" else "/var/mysql" @@ -521,29 +520,28 @@ in unitConfig.RequiresMountsFor = cfg.dataDir; - path = - [ - # Needed for the mysql_install_db command in the preStart script - # which calls the hostname command. - pkgs.hostname-debian - ] - # tools 'wsrep_sst_rsync' needs - ++ lib.optionals cfg.galeraCluster.enable [ - cfg.package - pkgs.bash - pkgs.gawk - pkgs.gnutar - pkgs.gzip - pkgs.inetutils - pkgs.iproute2 - pkgs.netcat - pkgs.procps - pkgs.pv - pkgs.rsync - pkgs.socat - pkgs.stunnel - pkgs.which - ]; + path = [ + # Needed for the mysql_install_db command in the preStart script + # which calls the hostname command. + pkgs.hostname-debian + ] + # tools 'wsrep_sst_rsync' needs + ++ lib.optionals cfg.galeraCluster.enable [ + cfg.package + pkgs.bash + pkgs.gawk + pkgs.gnutar + pkgs.gzip + pkgs.inetutils + pkgs.iproute2 + pkgs.netcat + pkgs.procps + pkgs.pv + pkgs.rsync + pkgs.socat + pkgs.stunnel + pkgs.which + ]; preStart = if isMariaDB then diff --git a/nixos/modules/services/databases/openldap.nix b/nixos/modules/services/databases/openldap.nix index 6cf517d9dfdb..44affdfb0586 100644 --- a/nixos/modules/services/databases/openldap.nix +++ b/nixos/modules/services/databases/openldap.nix @@ -278,44 +278,43 @@ in ''; in lib.mkIf cfg.enable { - assertions = - [ - { - assertion = (cfg.declarativeContents != { }) -> cfg.configDir == null; - message = '' - Declarative DB contents (${lib.attrNames cfg.declarativeContents}) are not - supported with user-managed configuration. - ''; - } - ] - ++ (map (dn: { - assertion = (lib.getAttr dn dbSettings) ? "olcDbDirectory"; - # olcDbDirectory is necessary to prepopulate database using `slapadd`. + assertions = [ + { + assertion = (cfg.declarativeContents != { }) -> cfg.configDir == null; message = '' - Declarative DB ${dn} does not exist in `services.openldap.settings`, or does not have - `olcDbDirectory` configured. + Declarative DB contents (${lib.attrNames cfg.declarativeContents}) are not + supported with user-managed configuration. ''; - }) (lib.attrNames cfg.declarativeContents)) - ++ (lib.mapAttrsToList ( - dn: - { - olcDbDirectory ? null, - ... - }: - { - # For forward compatibility with `DynamicUser`, and to avoid accidentally clobbering - # directories with `declarativeContents`. - assertion = - (olcDbDirectory != null) - -> ( - (lib.hasPrefix "/var/lib/openldap/" olcDbDirectory) && (olcDbDirectory != "/var/lib/openldap/") - ); - message = '' - Database ${dn} has `olcDbDirectory` (${olcDbDirectory}) that is not a subdirectory of - `/var/lib/openldap/`. - ''; - } - ) dbSettings); + } + ] + ++ (map (dn: { + assertion = (lib.getAttr dn dbSettings) ? "olcDbDirectory"; + # olcDbDirectory is necessary to prepopulate database using `slapadd`. + message = '' + Declarative DB ${dn} does not exist in `services.openldap.settings`, or does not have + `olcDbDirectory` configured. + ''; + }) (lib.attrNames cfg.declarativeContents)) + ++ (lib.mapAttrsToList ( + dn: + { + olcDbDirectory ? null, + ... + }: + { + # For forward compatibility with `DynamicUser`, and to avoid accidentally clobbering + # directories with `declarativeContents`. + assertion = + (olcDbDirectory != null) + -> ( + (lib.hasPrefix "/var/lib/openldap/" olcDbDirectory) && (olcDbDirectory != "/var/lib/openldap/") + ); + message = '' + Database ${dn} has `olcDbDirectory` (${olcDbDirectory}) that is not a subdirectory of + `/var/lib/openldap/`. + ''; + } + ) dbSettings); environment.systemPackages = [ openldap ]; # Literal attributes must always be set @@ -343,22 +342,21 @@ in serviceConfig = { User = cfg.user; Group = cfg.group; - ExecStartPre = - [ - "!${pkgs.coreutils}/bin/mkdir -p ${configDir}" - "+${pkgs.coreutils}/bin/chown $USER ${configDir}" + ExecStartPre = [ + "!${pkgs.coreutils}/bin/mkdir -p ${configDir}" + "+${pkgs.coreutils}/bin/chown $USER ${configDir}" + ] + ++ (lib.optional (cfg.configDir == null) writeConfig) + ++ (lib.mapAttrsToList ( + dn: content: + lib.escapeShellArgs [ + writeContents + dn + (lib.getAttr dn dbSettings).olcDbDirectory + content ] - ++ (lib.optional (cfg.configDir == null) writeConfig) - ++ (lib.mapAttrsToList ( - dn: content: - lib.escapeShellArgs [ - writeContents - dn - (lib.getAttr dn dbSettings).olcDbDirectory - content - ] - ) contentsFiles) - ++ [ "${openldap}/bin/slaptest -u -F ${configDir}" ]; + ) contentsFiles) + ++ [ "${openldap}/bin/slaptest -u -F ${configDir}" ]; ExecStart = lib.escapeShellArgs ([ "${openldap}/libexec/slapd" "-d" @@ -374,11 +372,12 @@ in # Got notification message from PID 6378, but reception only permitted for main PID 6377 NotifyAccess = "all"; RuntimeDirectory = "openldap"; - StateDirectory = - [ "openldap" ] - ++ (map ({ olcDbDirectory, ... }: lib.removePrefix "/var/lib/" olcDbDirectory) ( - lib.attrValues dbSettings - )); + StateDirectory = [ + "openldap" + ] + ++ (map ({ olcDbDirectory, ... }: lib.removePrefix "/var/lib/" olcDbDirectory) ( + lib.attrValues dbSettings + )); StateDirectoryMode = "700"; AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; diff --git a/nixos/modules/services/databases/postgres-websockets.nix b/nixos/modules/services/databases/postgres-websockets.nix index bd5b75b8e6b9..738f33bd7b0f 100644 --- a/nixos/modules/services/databases/postgres-websockets.nix +++ b/nixos/modules/services/databases/postgres-websockets.nix @@ -174,7 +174,8 @@ in CacheDirectoryMode = "0700"; LoadCredential = [ "jwt_secret:${cfg.jwtSecretFile}" - ] ++ lib.optional (cfg.pgpassFile != null) "pgpass:${cfg.pgpassFile}"; + ] + ++ lib.optional (cfg.pgpassFile != null) "pgpass:${cfg.pgpassFile}"; Restart = "always"; User = "postgres-websockets"; diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index aa844ada5e3e..d1fd9797e4d4 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -892,53 +892,52 @@ in environment.PGPORT = builtins.toString cfg.settings.port; # Wait for PostgreSQL to be ready to accept connections. - script = - '' - check-connection() { - psql -d postgres -v ON_ERROR_STOP=1 <<-' EOF' - SELECT pg_is_in_recovery() \gset - \if :pg_is_in_recovery - \i still-recovering - \endif - EOF - } - while ! check-connection 2> /dev/null; do - if ! systemctl is-active --quiet postgresql.service; then exit 1; fi - sleep 0.1 - done + script = '' + check-connection() { + psql -d postgres -v ON_ERROR_STOP=1 <<-' EOF' + SELECT pg_is_in_recovery() \gset + \if :pg_is_in_recovery + \i still-recovering + \endif + EOF + } + while ! check-connection 2> /dev/null; do + if ! systemctl is-active --quiet postgresql.service; then exit 1; fi + sleep 0.1 + done - if test -e "${cfg.dataDir}/.first_startup"; then - ${optionalString (cfg.initialScript != null) '' - psql -f "${cfg.initialScript}" -d postgres - ''} - rm -f "${cfg.dataDir}/.first_startup" - fi - '' - + optionalString (cfg.ensureDatabases != [ ]) '' - ${concatMapStrings (database: '' - psql -tAc "SELECT 1 FROM pg_database WHERE datname = '${database}'" | grep -q 1 || psql -tAc 'CREATE DATABASE "${database}"' - '') cfg.ensureDatabases} - '' - + '' - ${concatMapStrings ( - user: - let - dbOwnershipStmt = optionalString user.ensureDBOwnership ''psql -tAc 'ALTER DATABASE "${user.name}" OWNER TO "${user.name}";' ''; + if test -e "${cfg.dataDir}/.first_startup"; then + ${optionalString (cfg.initialScript != null) '' + psql -f "${cfg.initialScript}" -d postgres + ''} + rm -f "${cfg.dataDir}/.first_startup" + fi + '' + + optionalString (cfg.ensureDatabases != [ ]) '' + ${concatMapStrings (database: '' + psql -tAc "SELECT 1 FROM pg_database WHERE datname = '${database}'" | grep -q 1 || psql -tAc 'CREATE DATABASE "${database}"' + '') cfg.ensureDatabases} + '' + + '' + ${concatMapStrings ( + user: + let + dbOwnershipStmt = optionalString user.ensureDBOwnership ''psql -tAc 'ALTER DATABASE "${user.name}" OWNER TO "${user.name}";' ''; - filteredClauses = filterAttrs (name: value: value != null) user.ensureClauses; + filteredClauses = filterAttrs (name: value: value != null) user.ensureClauses; - clauseSqlStatements = attrValues (mapAttrs (n: v: if v then n else "no${n}") filteredClauses); + clauseSqlStatements = attrValues (mapAttrs (n: v: if v then n else "no${n}") filteredClauses); - userClauses = ''psql -tAc 'ALTER ROLE "${user.name}" ${concatStringsSep " " clauseSqlStatements}' ''; - in - '' - psql -tAc "SELECT 1 FROM pg_roles WHERE rolname='${user.name}'" | grep -q 1 || psql -tAc 'CREATE USER "${user.name}"' - ${userClauses} + userClauses = ''psql -tAc 'ALTER ROLE "${user.name}" ${concatStringsSep " " clauseSqlStatements}' ''; + in + '' + psql -tAc "SELECT 1 FROM pg_roles WHERE rolname='${user.name}'" | grep -q 1 || psql -tAc 'CREATE USER "${user.name}"' + ${userClauses} - ${dbOwnershipStmt} - '' - ) cfg.ensureUsers} - ''; + ${dbOwnershipStmt} + '' + ) cfg.ensureUsers} + ''; }; }; diff --git a/nixos/modules/services/databases/victorialogs.nix b/nixos/modules/services/databases/victorialogs.nix index 8a246ad666e3..eb6a54352172 100644 --- a/nixos/modules/services/databases/victorialogs.nix +++ b/nixos/modules/services/databases/victorialogs.nix @@ -23,7 +23,8 @@ let "${cfg.package}/bin/victoria-logs" "-storageDataPath=/var/lib/${cfg.stateDir}" "-httpListenAddr=${cfg.listenAddress}" - ] ++ cfg.extraOptions; + ] + ++ cfg.extraOptions; in { options.services.victorialogs = { diff --git a/nixos/modules/services/databases/victoriametrics.nix b/nixos/modules/services/databases/victoriametrics.nix index e22b85371c3a..9a5dccb5fa5b 100644 --- a/nixos/modules/services/databases/victoriametrics.nix +++ b/nixos/modules/services/databases/victoriametrics.nix @@ -9,15 +9,14 @@ let cfg = config.services.victoriametrics; settingsFormat = pkgs.formats.yaml { }; - startCLIList = - [ - "${cfg.package}/bin/victoria-metrics" - "-storageDataPath=/var/lib/${cfg.stateDir}" - "-httpListenAddr=${cfg.listenAddress}" + startCLIList = [ + "${cfg.package}/bin/victoria-metrics" + "-storageDataPath=/var/lib/${cfg.stateDir}" + "-httpListenAddr=${cfg.listenAddress}" - ] - ++ lib.optionals (cfg.retentionPeriod != null) [ "-retentionPeriod=${cfg.retentionPeriod}" ] - ++ cfg.extraOptions; + ] + ++ lib.optionals (cfg.retentionPeriod != null) [ "-retentionPeriod=${cfg.retentionPeriod}" ] + ++ cfg.extraOptions; prometheusConfigYml = checkedConfig ( settingsFormat.generate "prometheusConfig.yaml" cfg.prometheusConfig ); diff --git a/nixos/modules/services/desktop-managers/gnome.nix b/nixos/modules/services/desktop-managers/gnome.nix index 4bf6ce5f2394..39ae0d93451c 100644 --- a/nixos/modules/services/desktop-managers/gnome.nix +++ b/nixos/modules/services/desktop-managers/gnome.nix @@ -297,23 +297,23 @@ in systemd.packages = [ pkgs.gnome-flashback - ] ++ map pkgs.gnome-flashback.mkSystemdTargetForWm flashbackWms; + ] + ++ map pkgs.gnome-flashback.mkSystemdTargetForWm flashbackWms; - environment.systemPackages = - [ - pkgs.gnome-flashback - (pkgs.gnome-panel-with-modules.override { - panelModulePackages = cfg.flashback.panelModulePackages; - }) - ] - # For /share/applications/${wmName}.desktop - ++ (map ( - wm: pkgs.gnome-flashback.mkWmApplication { inherit (wm) wmName wmLabel wmCommand; } - ) flashbackWms) - # For /share/pkgs.gnome-session/sessions/gnome-flashback-${wmName}.session - ++ (map ( - wm: pkgs.gnome-flashback.mkGnomeSession { inherit (wm) wmName wmLabel enableGnomePanel; } - ) flashbackWms); + environment.systemPackages = [ + pkgs.gnome-flashback + (pkgs.gnome-panel-with-modules.override { + panelModulePackages = cfg.flashback.panelModulePackages; + }) + ] + # For /share/applications/${wmName}.desktop + ++ (map ( + wm: pkgs.gnome-flashback.mkWmApplication { inherit (wm) wmName wmLabel wmCommand; } + ) flashbackWms) + # For /share/pkgs.gnome-session/sessions/gnome-flashback-${wmName}.session + ++ (map ( + wm: pkgs.gnome-flashback.mkGnomeSession { inherit (wm) wmName wmLabel enableGnomePanel; } + ) flashbackWms); }) (lib.mkIf serviceCfg.core-os-services.enable { diff --git a/nixos/modules/services/desktop-managers/lomiri.nix b/nixos/modules/services/desktop-managers/lomiri.nix index 364acd2dfde2..f7d22e13b05b 100644 --- a/nixos/modules/services/desktop-managers/lomiri.nix +++ b/nixos/modules/services/desktop-managers/lomiri.nix @@ -61,14 +61,13 @@ in # Override GSettings defaults sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-overrides}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas"; - systemPackages = - [ - nixos-gsettings-overrides # GSettings default overrides - ] - ++ (with pkgs.lomiri; [ - lomiri-wallpapers # default + additional wallpaper - suru-icon-theme # basic indicator icons - ]); + systemPackages = [ + nixos-gsettings-overrides # GSettings default overrides + ] + ++ (with pkgs.lomiri; [ + lomiri-wallpapers # default + additional wallpaper + suru-icon-theme # basic indicator icons + ]); }; fonts.packages = with pkgs; [ @@ -276,19 +275,18 @@ in systemd.services = { "dbus-com.lomiri.UserMetrics" = { - serviceConfig = - { - Type = "dbus"; - BusName = "com.lomiri.UserMetrics"; - User = "usermetrics"; - StandardOutput = "syslog"; - SyslogIdentifier = "com.lomiri.UserMetrics"; - ExecStart = "${pkgs.lomiri.libusermetrics}/libexec/libusermetrics/usermetricsservice"; - } - // lib.optionalAttrs (!config.security.apparmor.enable) { - # Due to https://gitlab.com/ubports/development/core/libusermetrics/-/issues/8, auth must be disabled when not using AppArmor, lest the next database usage breaks - Environment = "USERMETRICS_NO_AUTH=1"; - }; + serviceConfig = { + Type = "dbus"; + BusName = "com.lomiri.UserMetrics"; + User = "usermetrics"; + StandardOutput = "syslog"; + SyslogIdentifier = "com.lomiri.UserMetrics"; + ExecStart = "${pkgs.lomiri.libusermetrics}/libexec/libusermetrics/usermetricsservice"; + } + // lib.optionalAttrs (!config.security.apparmor.enable) { + # Due to https://gitlab.com/ubports/development/core/libusermetrics/-/issues/8, auth must be disabled when not using AppArmor, lest the next database usage breaks + Environment = "USERMETRICS_NO_AUTH=1"; + }; }; }; diff --git a/nixos/modules/services/desktop-managers/plasma6.nix b/nixos/modules/services/desktop-managers/plasma6.nix index 552c6bfd1d51..c553da347d79 100644 --- a/nixos/modules/services/desktop-managers/plasma6.nix +++ b/nixos/modules/services/desktop-managers/plasma6.nix @@ -153,38 +153,37 @@ in systemsettings kcmutils ]; - optionalPackages = - [ - aurorae - plasma-browser-integration - plasma-workspace-wallpapers - konsole - kwin-x11 - (lib.getBin qttools) # Expose qdbus in PATH - ark - elisa - gwenview - okular - kate - ktexteditor # provides elevated actions for kate - khelpcenter - dolphin - baloo-widgets # baloo information in Dolphin - dolphin-plugins - spectacle - ffmpegthumbs - krdp - xwaylandvideobridge # exposes Wayland windows to X11 screen capture - ] - ++ lib.optionals config.hardware.sensor.iio.enable [ - # This is required for autorotation in Plasma 6 - qtsensors - ] - ++ lib.optionals config.services.flatpak.enable [ - # Since PackageKit Nix support is not there yet, - # only install discover if flatpak is enabled. - discover - ]; + optionalPackages = [ + aurorae + plasma-browser-integration + plasma-workspace-wallpapers + konsole + kwin-x11 + (lib.getBin qttools) # Expose qdbus in PATH + ark + elisa + gwenview + okular + kate + ktexteditor # provides elevated actions for kate + khelpcenter + dolphin + baloo-widgets # baloo information in Dolphin + dolphin-plugins + spectacle + ffmpegthumbs + krdp + xwaylandvideobridge # exposes Wayland windows to X11 screen capture + ] + ++ lib.optionals config.hardware.sensor.iio.enable [ + # This is required for autorotation in Plasma 6 + qtsensors + ] + ++ lib.optionals config.services.flatpak.enable [ + # Since PackageKit Nix support is not there yet, + # only install discover if flatpak is enabled. + discover + ]; in requiredPackages ++ utils.removePackagesByName optionalPackages config.environment.plasma6.excludePackages diff --git a/nixos/modules/services/desktops/geoclue2.nix b/nixos/modules/services/desktops/geoclue2.nix index ec7afa03c656..5bf4497dabe0 100644 --- a/nixos/modules/services/desktops/geoclue2.nix +++ b/nixos/modules/services/desktops/geoclue2.nix @@ -344,16 +344,15 @@ in modem-gps = { enable = cfg.enableModemGPS; }; - wifi = - { - enable = cfg.enableWifi; - } - // lib.optionalAttrs cfg.enableWifi { - url = cfg.geoProviderUrl; - submit-data = lib.boolToString cfg.submitData; - submission-url = cfg.submissionUrl; - submission-nick = cfg.submissionNick; - }; + wifi = { + enable = cfg.enableWifi; + } + // lib.optionalAttrs cfg.enableWifi { + url = cfg.geoProviderUrl; + submit-data = lib.boolToString cfg.submitData; + submission-url = cfg.submissionUrl; + submission-nick = cfg.submissionNick; + }; static-source = { enable = cfg.enableStatic; }; diff --git a/nixos/modules/services/desktops/gnome/gnome-initial-setup.nix b/nixos/modules/services/desktops/gnome/gnome-initial-setup.nix index f130b820b716..e0241f02b969 100644 --- a/nixos/modules/services/desktops/gnome/gnome-initial-setup.nix +++ b/nixos/modules/services/desktops/gnome/gnome-initial-setup.nix @@ -67,11 +67,10 @@ in config = lib.mkIf config.services.gnome.gnome-initial-setup.enable { - environment.systemPackages = - [ - pkgs.gnome-initial-setup - ] - ++ lib.optional (lib.versionOlder config.system.stateVersion "20.03") createGisStampFilesAutostart; + environment.systemPackages = [ + pkgs.gnome-initial-setup + ] + ++ lib.optional (lib.versionOlder config.system.stateVersion "20.03") createGisStampFilesAutostart; systemd.packages = [ pkgs.gnome-initial-setup diff --git a/nixos/modules/services/desktops/pipewire/pipewire.nix b/nixos/modules/services/desktops/pipewire/pipewire.nix index 6e90855114e0..dca78ef6d301 100644 --- a/nixos/modules/services/desktops/pipewire/pipewire.nix +++ b/nixos/modules/services/desktops/pipewire/pipewire.nix @@ -444,7 +444,8 @@ in extraGroups = [ "audio" "video" - ] ++ optional config.security.rtkit.enable "rtkit"; + ] + ++ optional config.security.rtkit.enable "rtkit"; description = "PipeWire system service user"; isSystemUser = true; home = "/var/lib/pipewire"; diff --git a/nixos/modules/services/development/corteza.nix b/nixos/modules/services/development/corteza.nix index 2f3e8abd0b68..d6264ad5eaa8 100644 --- a/nixos/modules/services/development/corteza.nix +++ b/nixos/modules/services/development/corteza.nix @@ -88,7 +88,8 @@ in environment = { HTTP_WEBAPP_BASE_DIR = "./webapp"; HTTP_ADDR = "${cfg.address}:${toString cfg.port}"; - } // cfg.settings; + } + // cfg.settings; path = [ pkgs.dart-sass ]; serviceConfig = { WorkingDirectory = cfg.package; diff --git a/nixos/modules/services/development/jupyter/default.nix b/nixos/modules/services/development/jupyter/default.nix index e6c05dd56884..4ed82b1e3d50 100644 --- a/nixos/modules/services/development/jupyter/default.nix +++ b/nixos/modules/services/development/jupyter/default.nix @@ -202,7 +202,8 @@ in environment = { JUPYTER_PATH = toString kernels; - } // cfg.extraEnvironmentVariables; + } + // cfg.extraEnvironmentVariables; serviceConfig = { Restart = "always"; diff --git a/nixos/modules/services/development/zammad.nix b/nixos/modules/services/development/zammad.nix index 63dcea187eda..b0917b6b8893 100644 --- a/nixos/modules/services/development/zammad.nix +++ b/nixos/modules/services/development/zammad.nix @@ -269,17 +269,16 @@ in # loading all the gems takes time TimeoutStartSec = 1200; }; - after = - [ - "network.target" - "systemd-tmpfiles-setup.service" - ] - ++ lib.optionals (cfg.database.createLocally) [ - "postgresql.target" - ] - ++ lib.optionals cfg.redis.createLocally [ - "redis-${cfg.redis.name}.service" - ]; + after = [ + "network.target" + "systemd-tmpfiles-setup.service" + ] + ++ lib.optionals (cfg.database.createLocally) [ + "postgresql.target" + ] + ++ lib.optionals cfg.redis.createLocally [ + "redis-${cfg.redis.name}.service" + ]; requires = lib.optionals (cfg.database.createLocally) [ "postgresql.target" ]; diff --git a/nixos/modules/services/display-managers/gdm.nix b/nixos/modules/services/display-managers/gdm.nix index 960684809711..11675e914286 100644 --- a/nixos/modules/services/display-managers/gdm.nix +++ b/nixos/modules/services/display-managers/gdm.nix @@ -198,23 +198,22 @@ in # Enable desktop session data enable = true; - environment = - { - GDM_X_SERVER_EXTRA_ARGS = toString (lib.filter (arg: arg != "-terminate") xdmcfg.xserverArgs); - XDG_DATA_DIRS = lib.makeSearchPath "share" [ - gdm # for gnome-login.session - config.services.displayManager.sessionData.desktops - pkgs.gnome-control-center # for accessibility icon - pkgs.adwaita-icon-theme - pkgs.hicolor-icon-theme # empty icon theme as a base - ]; - } - // lib.optionalAttrs (xSessionWrapper != null) { - # Make GDM use this wrapper before running the session, which runs the - # configured setupCommands. This relies on a patched GDM which supports - # this environment variable. - GDM_X_SESSION_WRAPPER = "${xSessionWrapper}"; - }; + environment = { + GDM_X_SERVER_EXTRA_ARGS = toString (lib.filter (arg: arg != "-terminate") xdmcfg.xserverArgs); + XDG_DATA_DIRS = lib.makeSearchPath "share" [ + gdm # for gnome-login.session + config.services.displayManager.sessionData.desktops + pkgs.gnome-control-center # for accessibility icon + pkgs.adwaita-icon-theme + pkgs.hicolor-icon-theme # empty icon theme as a base + ]; + } + // lib.optionalAttrs (xSessionWrapper != null) { + # Make GDM use this wrapper before running the session, which runs the + # configured setupCommands. This relies on a patched GDM which supports + # this environment variable. + GDM_X_SESSION_WRAPPER = "${xSessionWrapper}"; + }; execCmd = "exec ${gdm}/bin/gdm"; preStart = lib.optionalString (defaultSessionName != null) '' # Set default session in session chooser to a specified values – basically ignore session history. @@ -222,18 +221,17 @@ in ''; }; - systemd.tmpfiles.rules = - [ - "d /run/gdm/.config 0711 gdm gdm" - ] - ++ lib.optionals config.services.pulseaudio.enable [ - "d /run/gdm/.config/pulse 0711 gdm gdm" - "L+ /run/gdm/.config/pulse/${pulseConfig.name} - - - - ${pulseConfig}" - ] - ++ lib.optionals config.services.gnome.gnome-initial-setup.enable [ - # Create stamp file for gnome-initial-setup to prevent it starting in GDM. - "f /run/gdm/.config/gnome-initial-setup-done 0711 gdm gdm - yes" - ]; + systemd.tmpfiles.rules = [ + "d /run/gdm/.config 0711 gdm gdm" + ] + ++ lib.optionals config.services.pulseaudio.enable [ + "d /run/gdm/.config/pulse 0711 gdm gdm" + "L+ /run/gdm/.config/pulse/${pulseConfig.name} - - - - ${pulseConfig}" + ] + ++ lib.optionals config.services.gnome.gnome-initial-setup.enable [ + # Create stamp file for gnome-initial-setup to prevent it starting in GDM. + "f /run/gdm/.config/gnome-initial-setup-done 0711 gdm gdm - yes" + ]; # Otherwise GDM will not be able to start correctly and display Wayland sessions systemd.packages = [ diff --git a/nixos/modules/services/display-managers/greetd.nix b/nixos/modules/services/display-managers/greetd.nix index 2d77daacf51d..bb1e45c8adfe 100644 --- a/nixos/modules/services/display-managers/greetd.nix +++ b/nixos/modules/services/display-managers/greetd.nix @@ -84,14 +84,13 @@ in Wants = [ "systemd-user-sessions.service" ]; - After = - [ - "systemd-user-sessions.service" - "getty@${tty}.service" - ] - ++ lib.optionals (!cfg.greeterManagesPlymouth) [ - "plymouth-quit-wait.service" - ]; + After = [ + "systemd-user-sessions.service" + "getty@${tty}.service" + ] + ++ lib.optionals (!cfg.greeterManagesPlymouth) [ + "plymouth-quit-wait.service" + ]; Conflicts = [ "getty@${tty}.service" ]; diff --git a/nixos/modules/services/display-managers/sddm.nix b/nixos/modules/services/display-managers/sddm.nix index 9f70867be423..d8ce1e231b3c 100644 --- a/nixos/modules/services/display-managers/sddm.nix +++ b/nixos/modules/services/display-managers/sddm.nix @@ -50,71 +50,68 @@ let ${cfg.stopScript} ''; - defaultConfig = - { - General = - { - HaltCommand = "/run/current-system/systemd/bin/systemctl poweroff"; - RebootCommand = "/run/current-system/systemd/bin/systemctl reboot"; - Numlock = if cfg.autoNumlock then "on" else "none"; # on, off none + defaultConfig = { + General = { + HaltCommand = "/run/current-system/systemd/bin/systemctl poweroff"; + RebootCommand = "/run/current-system/systemd/bin/systemctl reboot"; + Numlock = if cfg.autoNumlock then "on" else "none"; # on, off none - # Implementation is done via pkgs/applications/display-managers/sddm/sddm-default-session.patch - DefaultSession = optionalString ( - config.services.displayManager.defaultSession != null - ) "${config.services.displayManager.defaultSession}.desktop"; - - DisplayServer = if cfg.wayland.enable then "wayland" else "x11"; - } - // optionalAttrs (cfg.wayland.enable && cfg.wayland.compositor == "kwin") { - GreeterEnvironment = "QT_WAYLAND_SHELL_INTEGRATION=layer-shell"; - InputMethod = ""; # needed if we are using --inputmethod with kwin - }; - - Theme = - { - Current = cfg.theme; - ThemeDir = "/run/current-system/sw/share/sddm/themes"; - FacesDir = "/run/current-system/sw/share/sddm/faces"; - } - // optionalAttrs (cfg.theme == "breeze") { - CursorTheme = "breeze_cursors"; - CursorSize = 24; - }; - - Users = { - MaximumUid = config.ids.uids.nixbld; - HideUsers = concatStringsSep "," dmcfg.hiddenUsers; - HideShells = "/run/current-system/sw/bin/nologin"; - }; - - Wayland = { - EnableHiDPI = cfg.enableHidpi; - SessionDir = "${dmcfg.sessionData.desktops}/share/wayland-sessions"; - CompositorCommand = lib.optionalString cfg.wayland.enable cfg.wayland.compositorCommand; - }; + # Implementation is done via pkgs/applications/display-managers/sddm/sddm-default-session.patch + DefaultSession = optionalString ( + config.services.displayManager.defaultSession != null + ) "${config.services.displayManager.defaultSession}.desktop"; + DisplayServer = if cfg.wayland.enable then "wayland" else "x11"; } - // optionalAttrs xcfg.enable { - X11 = { - MinimumVT = if xcfg.tty != null then xcfg.tty else 7; - ServerPath = toString xserverWrapper; - XephyrPath = "${pkgs.xorg.xorgserver.out}/bin/Xephyr"; - SessionCommand = toString dmcfg.sessionData.wrapper; - SessionDir = "${dmcfg.sessionData.desktops}/share/xsessions"; - XauthPath = "${pkgs.xorg.xauth}/bin/xauth"; - DisplayCommand = toString Xsetup; - DisplayStopCommand = toString Xstop; - EnableHiDPI = cfg.enableHidpi; - }; - } - // optionalAttrs dmcfg.autoLogin.enable { - Autologin = { - User = dmcfg.autoLogin.user; - Session = autoLoginSessionName; - Relogin = cfg.autoLogin.relogin; - }; + // optionalAttrs (cfg.wayland.enable && cfg.wayland.compositor == "kwin") { + GreeterEnvironment = "QT_WAYLAND_SHELL_INTEGRATION=layer-shell"; + InputMethod = ""; # needed if we are using --inputmethod with kwin }; + Theme = { + Current = cfg.theme; + ThemeDir = "/run/current-system/sw/share/sddm/themes"; + FacesDir = "/run/current-system/sw/share/sddm/faces"; + } + // optionalAttrs (cfg.theme == "breeze") { + CursorTheme = "breeze_cursors"; + CursorSize = 24; + }; + + Users = { + MaximumUid = config.ids.uids.nixbld; + HideUsers = concatStringsSep "," dmcfg.hiddenUsers; + HideShells = "/run/current-system/sw/bin/nologin"; + }; + + Wayland = { + EnableHiDPI = cfg.enableHidpi; + SessionDir = "${dmcfg.sessionData.desktops}/share/wayland-sessions"; + CompositorCommand = lib.optionalString cfg.wayland.enable cfg.wayland.compositorCommand; + }; + + } + // optionalAttrs xcfg.enable { + X11 = { + MinimumVT = if xcfg.tty != null then xcfg.tty else 7; + ServerPath = toString xserverWrapper; + XephyrPath = "${pkgs.xorg.xorgserver.out}/bin/Xephyr"; + SessionCommand = toString dmcfg.sessionData.wrapper; + SessionDir = "${dmcfg.sessionData.desktops}/share/xsessions"; + XauthPath = "${pkgs.xorg.xauth}/bin/xauth"; + DisplayCommand = toString Xsetup; + DisplayStopCommand = toString Xstop; + EnableHiDPI = cfg.enableHidpi; + }; + } + // optionalAttrs dmcfg.autoLogin.enable { + Autologin = { + User = dmcfg.autoLogin.user; + Session = autoLoginSessionName; + Relogin = cfg.autoLogin.relogin; + }; + }; + cfgFile = iniFmt.generate "sddm.conf" (lib.recursiveUpdate defaultConfig cfg.settings); autoLoginSessionName = "${dmcfg.sessionData.autologinSession}.desktop"; diff --git a/nixos/modules/services/editors/emacs.md b/nixos/modules/services/editors/emacs.md index a3c9ae5907b0..a0fe3e793d99 100644 --- a/nixos/modules/services/editors/emacs.md +++ b/nixos/modules/services/editors/emacs.md @@ -252,11 +252,9 @@ let (attrs: { # I don't want emacs.desktop file because I only use # emacsclient. - postInstall = - (attrs.postInstall or "") - + '' - rm $out/share/applications/emacs.desktop - ''; + postInstall = (attrs.postInstall or "") + '' + rm $out/share/applications/emacs.desktop + ''; }); in [ diff --git a/nixos/modules/services/editors/emacs.nix b/nixos/modules/services/editors/emacs.nix index 65211763e5a2..ff69a22f5447 100644 --- a/nixos/modules/services/editors/emacs.nix +++ b/nixos/modules/services/editors/emacs.nix @@ -66,26 +66,25 @@ in }; config = lib.mkIf (cfg.enable || cfg.install) { - systemd.user.services.emacs = - { - description = "Emacs: the extensible, self-documenting text editor"; + systemd.user.services.emacs = { + description = "Emacs: the extensible, self-documenting text editor"; - serviceConfig = { - Type = "notify"; - ExecStart = "${pkgs.runtimeShell} -c 'source ${config.system.build.setEnvironment}; exec ${cfg.package}/bin/emacs --fg-daemon'"; - # Emacs exits with exit code 15 (SIGTERM), when stopped by systemd. - SuccessExitStatus = 15; - Restart = "always"; - }; - - unitConfig = lib.optionalAttrs cfg.startWithGraphical { - After = "graphical-session.target"; - }; - } - // lib.optionalAttrs cfg.enable { - wantedBy = if cfg.startWithGraphical then [ "graphical-session.target" ] else [ "default.target" ]; + serviceConfig = { + Type = "notify"; + ExecStart = "${pkgs.runtimeShell} -c 'source ${config.system.build.setEnvironment}; exec ${cfg.package}/bin/emacs --fg-daemon'"; + # Emacs exits with exit code 15 (SIGTERM), when stopped by systemd. + SuccessExitStatus = 15; + Restart = "always"; }; + unitConfig = lib.optionalAttrs cfg.startWithGraphical { + After = "graphical-session.target"; + }; + } + // lib.optionalAttrs cfg.enable { + wantedBy = if cfg.startWithGraphical then [ "graphical-session.target" ] else [ "default.target" ]; + }; + environment.systemPackages = [ cfg.package editorScript diff --git a/nixos/modules/services/finance/libeufin/common.nix b/nixos/modules/services/finance/libeufin/common.nix index 2058f070eac9..71133248d607 100644 --- a/nixos/modules/services/finance/libeufin/common.nix +++ b/nixos/modules/services/finance/libeufin/common.nix @@ -110,19 +110,18 @@ libeufinComponent: ${lib.getExe' cfg.package "libeufin-${libeufinComponent}"} dbinit ${args} ''; # Grant DB permissions after schemas have been created - postStart = - '' - psql -U "${dbName}" -f "${dbScript}" - '' - + lib.optionalString ((!isNexus) && (cfg.initialAccounts != [ ])) '' - # only register initial accounts once - if [ ! -e /var/lib/libeufin-dbinit/init ]; then - ${initialAccountRegistration} + postStart = '' + psql -U "${dbName}" -f "${dbScript}" + '' + + lib.optionalString ((!isNexus) && (cfg.initialAccounts != [ ])) '' + # only register initial accounts once + if [ ! -e /var/lib/libeufin-dbinit/init ]; then + ${initialAccountRegistration} - touch /var/lib/libeufin-dbinit/init - echo "Bank initialisation complete" - fi - ''; + touch /var/lib/libeufin-dbinit/init + echo "Bank initialisation complete" + fi + ''; requires = lib.optionals cfg.createLocalDatabase [ "postgresql.target" ]; after = [ "network.target" ] ++ lib.optionals cfg.createLocalDatabase [ "postgresql.target" ]; }; diff --git a/nixos/modules/services/finance/odoo.nix b/nixos/modules/services/finance/odoo.nix index 9177a7f25a54..4395010fe7a0 100644 --- a/nixos/modules/services/finance/odoo.nix +++ b/nixos/modules/services/finance/odoo.nix @@ -100,14 +100,13 @@ in }; }; - services.odoo.settings.options = - { - data_dir = "/var/lib/private/odoo/data"; - proxy_mode = cfg.domain != null; - } - // (lib.optionalAttrs (cfg.addons != [ ]) { - addons_path = lib.concatMapStringsSep "," lib.escapeShellArg cfg.addons; - }); + services.odoo.settings.options = { + data_dir = "/var/lib/private/odoo/data"; + proxy_mode = cfg.domain != null; + } + // (lib.optionalAttrs (cfg.addons != [ ]) { + addons_path = lib.concatMapStringsSep "," lib.escapeShellArg cfg.addons; + }); users.users.odoo = { isSystemUser = true; diff --git a/nixos/modules/services/games/factorio.nix b/nixos/modules/services/games/factorio.nix index 611bd0fd3797..43eda28c095e 100644 --- a/nixos/modules/services/games/factorio.nix +++ b/nixos/modules/services/games/factorio.nix @@ -38,7 +38,8 @@ let only_admins_can_pause_the_game = true; autosave_only_on_server = true; non_blocking_saving = cfg.nonBlockingSaving; - } // cfg.extraSettings; + } + // cfg.extraSettings; serverSettingsString = builtins.toJSON (lib.filterAttrsRecursive (n: v: v != null) serverSettings); serverSettingsFile = pkgs.writeText "server-settings.json" serverSettingsString; playerListOption = diff --git a/nixos/modules/services/games/minecraft-server.nix b/nixos/modules/services/games/minecraft-server.nix index a4d82a6779bf..7cc2f4ff1163 100644 --- a/nixos/modules/services/games/minecraft-server.nix +++ b/nixos/modules/services/games/minecraft-server.nix @@ -259,51 +259,51 @@ in UMask = "0077"; }; - preStart = - '' - ln -sf ${eulaFile} eula.txt - '' - + ( - if cfg.declarative then - '' + preStart = '' + ln -sf ${eulaFile} eula.txt + '' + + ( + if cfg.declarative then + '' - if [ -e .declarative ]; then + if [ -e .declarative ]; then - # Was declarative before, no need to back up anything - ln -sf ${whitelistFile} whitelist.json - cp -f ${serverPropertiesFile} server.properties + # Was declarative before, no need to back up anything + ln -sf ${whitelistFile} whitelist.json + cp -f ${serverPropertiesFile} server.properties - else + else - # Declarative for the first time, backup stateful files - ln -sb --suffix=.stateful ${whitelistFile} whitelist.json - cp -b --suffix=.stateful ${serverPropertiesFile} server.properties + # Declarative for the first time, backup stateful files + ln -sb --suffix=.stateful ${whitelistFile} whitelist.json + cp -b --suffix=.stateful ${serverPropertiesFile} server.properties - # server.properties must have write permissions, because every time - # the server starts it first parses the file and then regenerates it.. - chmod +w server.properties - echo "Autogenerated file that signifies that this server configuration is managed declaratively by NixOS" \ - > .declarative + # server.properties must have write permissions, because every time + # the server starts it first parses the file and then regenerates it.. + chmod +w server.properties + echo "Autogenerated file that signifies that this server configuration is managed declaratively by NixOS" \ + > .declarative - fi - '' - else - '' - if [ -e .declarative ]; then - rm .declarative - fi - '' - ); + fi + '' + else + '' + if [ -e .declarative ]; then + rm .declarative + fi + '' + ); }; networking.firewall = lib.mkIf cfg.openFirewall ( if cfg.declarative then { allowedUDPPorts = [ serverPort ]; - allowedTCPPorts = - [ serverPort ] - ++ lib.optional (queryPort != null) queryPort - ++ lib.optional (rconPort != null) rconPort; + allowedTCPPorts = [ + serverPort + ] + ++ lib.optional (queryPort != null) queryPort + ++ lib.optional (rconPort != null) rconPort; } else { diff --git a/nixos/modules/services/games/minetest-server.nix b/nixos/modules/services/games/minetest-server.nix index 52a2b31fc622..5b9fe630a729 100644 --- a/nixos/modules/services/games/minetest-server.nix +++ b/nixos/modules/services/games/minetest-server.nix @@ -50,27 +50,26 @@ let "${toString val}" ]; - flags = - [ - "--server" - ] - ++ ( - if cfg.configPath != null then - [ - "--config" - cfg.configPath - ] - else - [ - "--config" - (builtins.toFile "minetest.conf" (toConf cfg.config)) - ] - ) - ++ (flag cfg.gameId "gameid") - ++ (flag cfg.world "world") - ++ (flag cfg.logPath "logfile") - ++ (flag cfg.port "port") - ++ cfg.extraArgs; + flags = [ + "--server" + ] + ++ ( + if cfg.configPath != null then + [ + "--config" + cfg.configPath + ] + else + [ + "--config" + (builtins.toFile "minetest.conf" (toConf cfg.config)) + ] + ) + ++ (flag cfg.gameId "gameid") + ++ (flag cfg.world "world") + ++ (flag cfg.logPath "logfile") + ++ (flag cfg.port "port") + ++ cfg.extraArgs; in { options = { diff --git a/nixos/modules/services/hardware/amdvlk.nix b/nixos/modules/services/hardware/amdvlk.nix index 95aeec16c02a..ba0349a069bc 100644 --- a/nixos/modules/services/hardware/amdvlk.nix +++ b/nixos/modules/services/hardware/amdvlk.nix @@ -37,15 +37,14 @@ in }; config = lib.mkIf cfg.enable { - hardware.graphics = - { - enable = true; - extraPackages = [ cfg.package ]; - } - // lib.optionalAttrs cfg.support32Bit.enable { - enable32Bit = true; - extraPackages32 = [ cfg.support32Bit.package ]; - }; + hardware.graphics = { + enable = true; + extraPackages = [ cfg.package ]; + } + // lib.optionalAttrs cfg.support32Bit.enable { + enable32Bit = true; + extraPackages32 = [ cfg.support32Bit.package ]; + }; environment.sessionVariables = lib.mkIf cfg.supportExperimental.enable { AMDVLK_ENABLE_DEVELOPING_EXT = "all"; diff --git a/nixos/modules/services/hardware/bitbox-bridge.nix b/nixos/modules/services/hardware/bitbox-bridge.nix index 785434aea3f7..483453de339e 100644 --- a/nixos/modules/services/hardware/bitbox-bridge.nix +++ b/nixos/modules/services/hardware/bitbox-bridge.nix @@ -34,17 +34,18 @@ in config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; - services.udev.packages = - [ cfg.package ] - ++ lib.optionals (cfg.runOnMount) [ - (pkgs.writeTextFile { - name = "bitbox-bridge-run-on-mount-udev-rules"; - destination = "/etc/udev/rules.d/99-bitbox-bridge-run-on-mount.rules"; - text = '' - SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", MODE="0660", GROUP="bitbox", TAG+="systemd", SYMLINK+="bitbox02", ENV{SYSTEMD_WANTS}="bitbox-bridge.service" - ''; - }) - ]; + services.udev.packages = [ + cfg.package + ] + ++ lib.optionals (cfg.runOnMount) [ + (pkgs.writeTextFile { + name = "bitbox-bridge-run-on-mount-udev-rules"; + destination = "/etc/udev/rules.d/99-bitbox-bridge-run-on-mount.rules"; + text = '' + SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", MODE="0660", GROUP="bitbox", TAG+="systemd", SYMLINK+="bitbox02", ENV{SYSTEMD_WANTS}="bitbox-bridge.service" + ''; + }) + ]; systemd.services.bitbox-bridge = { description = "BitBox Bridge"; diff --git a/nixos/modules/services/hardware/bluetooth.nix b/nixos/modules/services/hardware/bluetooth.nix index 47fb322e56d2..ca89737e35fd 100644 --- a/nixos/modules/services/hardware/bluetooth.nix +++ b/nixos/modules/services/hardware/bluetooth.nix @@ -127,77 +127,76 @@ in services.dbus.packages = [ package ] ++ optional cfg.hsphfpd.enable pkgs.hsphfpd; systemd.packages = [ package ]; - systemd.services = - { - bluetooth = - let - # `man bluetoothd` will refer to main.conf in the nix store but bluez - # will in fact load the configuration file at /etc/bluetooth/main.conf - # so force it here to avoid any ambiguity and things suddenly breaking - # if/when the bluez derivation is changed. - args = [ - "-f" - "/etc/bluetooth/main.conf" - ] ++ optional hasDisabledPlugins "--noplugin=${concatStringsSep "," cfg.disabledPlugins}"; - in - { - wantedBy = [ "bluetooth.target" ]; - aliases = [ "dbus-org.bluez.service" ]; - # restarting can leave people without a mouse/keyboard - restartIfChanged = false; - serviceConfig = { - ExecStart = [ - "" - "${package}/libexec/bluetooth/bluetoothd ${utils.escapeSystemdExecArgs args}" - ]; - CapabilityBoundingSet = [ - "CAP_NET_BIND_SERVICE" # sockets and tethering - ]; - ConfigurationDirectoryMode = "0755"; - NoNewPrivileges = true; - RestrictNamespaces = true; - ProtectControlGroups = true; - MemoryDenyWriteExecute = true; - RestrictSUIDSGID = true; - SystemCallArchitectures = "native"; - SystemCallFilter = "@system-service"; - LockPersonality = true; - RestrictRealtime = true; - ProtectProc = "invisible"; - PrivateTmp = true; - - PrivateUsers = false; - - # loading hardware modules - ProtectKernelModules = false; - ProtectKernelTunables = false; - - PrivateNetwork = false; # tethering - }; - }; - } - // (optionalAttrs cfg.hsphfpd.enable { - hsphfpd = { - after = [ "bluetooth.service" ]; - requires = [ "bluetooth.service" ]; + systemd.services = { + bluetooth = + let + # `man bluetoothd` will refer to main.conf in the nix store but bluez + # will in fact load the configuration file at /etc/bluetooth/main.conf + # so force it here to avoid any ambiguity and things suddenly breaking + # if/when the bluez derivation is changed. + args = [ + "-f" + "/etc/bluetooth/main.conf" + ] + ++ optional hasDisabledPlugins "--noplugin=${concatStringsSep "," cfg.disabledPlugins}"; + in + { wantedBy = [ "bluetooth.target" ]; + aliases = [ "dbus-org.bluez.service" ]; + # restarting can leave people without a mouse/keyboard + restartIfChanged = false; + serviceConfig = { + ExecStart = [ + "" + "${package}/libexec/bluetooth/bluetoothd ${utils.escapeSystemdExecArgs args}" + ]; + CapabilityBoundingSet = [ + "CAP_NET_BIND_SERVICE" # sockets and tethering + ]; + ConfigurationDirectoryMode = "0755"; + NoNewPrivileges = true; + RestrictNamespaces = true; + ProtectControlGroups = true; + MemoryDenyWriteExecute = true; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + SystemCallFilter = "@system-service"; + LockPersonality = true; + RestrictRealtime = true; + ProtectProc = "invisible"; + PrivateTmp = true; - description = "A prototype implementation used for connecting HSP/HFP Bluetooth devices"; - serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/hsphfpd.pl"; + PrivateUsers = false; + + # loading hardware modules + ProtectKernelModules = false; + ProtectKernelTunables = false; + + PrivateNetwork = false; # tethering + }; }; - }); + } + // (optionalAttrs cfg.hsphfpd.enable { + hsphfpd = { + after = [ "bluetooth.service" ]; + requires = [ "bluetooth.service" ]; + wantedBy = [ "bluetooth.target" ]; - systemd.user.services = - { - obex.aliases = [ "dbus-org.bluez.obex.service" ]; - } - // optionalAttrs cfg.hsphfpd.enable { - telephony_client = { - wantedBy = [ "default.target" ]; - - description = "telephony_client for hsphfpd"; - serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/telephony_client.pl"; - }; + description = "A prototype implementation used for connecting HSP/HFP Bluetooth devices"; + serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/hsphfpd.pl"; }; + }); + + systemd.user.services = { + obex.aliases = [ "dbus-org.bluez.obex.service" ]; + } + // optionalAttrs cfg.hsphfpd.enable { + telephony_client = { + wantedBy = [ "default.target" ]; + + description = "telephony_client for hsphfpd"; + serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/telephony_client.pl"; + }; + }; }; } diff --git a/nixos/modules/services/hardware/handheld-daemon.nix b/nixos/modules/services/hardware/handheld-daemon.nix index 4ea5eb79593f..81ee3fcf5ddd 100644 --- a/nixos/modules/services/hardware/handheld-daemon.nix +++ b/nixos/modules/services/hardware/handheld-daemon.nix @@ -30,7 +30,8 @@ in services.handheld-daemon.ui.enable = mkDefault true; environment.systemPackages = [ cfg.package - ] ++ lib.optional cfg.ui.enable cfg.ui.package; + ] + ++ lib.optional cfg.ui.enable cfg.ui.package; services.udev.packages = [ cfg.package ]; systemd.packages = [ cfg.package ]; diff --git a/nixos/modules/services/hardware/interception-tools.nix b/nixos/modules/services/hardware/interception-tools.nix index 9bba517ecff8..a8ae4f94b8df 100644 --- a/nixos/modules/services/hardware/interception-tools.nix +++ b/nixos/modules/services/hardware/interception-tools.nix @@ -52,7 +52,8 @@ in path = [ pkgs.bash pkgs.interception-tools - ] ++ cfg.plugins; + ] + ++ cfg.plugins; serviceConfig = { ExecStart = '' ${pkgs.interception-tools}/bin/udevmon -c \ diff --git a/nixos/modules/services/hardware/kmonad.nix b/nixos/modules/services/hardware/kmonad.nix index 56a6472b4411..d1b34e2a03ae 100644 --- a/nixos/modules/services/hardware/kmonad.nix +++ b/nixos/modules/services/hardware/kmonad.nix @@ -141,60 +141,60 @@ let StartLimitIntervalSec = 2; StartLimitBurst = 5; }; - serviceConfig = - { - ExecStart = '' - ${lib.getExe cfg.package} ${mkCfg keyboard} \ - ${utils.escapeSystemdExecArgs cfg.extraArgs} - ''; - Restart = "always"; - # Restart at increasing intervals from 2s to 1m - RestartSec = 2; - RestartSteps = 30; - RestartMaxDelaySec = "1min"; - Nice = -20; - DynamicUser = true; - User = "kmonad"; - Group = "kmonad"; - SupplementaryGroups = [ - # These ensure that our dynamic user has access to the device node - config.users.groups.input.name - config.users.groups.uinput.name - ] ++ keyboard.extraGroups; - } - // lib.optionalAttrs keyboard.enableHardening { - DeviceAllow = [ - "/dev/uinput w" - "char-input r" - ]; - CapabilityBoundingSet = [ "" ]; - DevicePolicy = "closed"; - IPAddressDeny = [ "any" ]; - LockPersonality = true; - MemoryDenyWriteExecute = true; - PrivateNetwork = true; - PrivateUsers = true; - ProcSubset = "pid"; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHome = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - RestrictAddressFamilies = [ "none" ]; - RestrictNamespaces = true; - RestrictRealtime = true; - SystemCallArchitectures = [ "native" ]; - SystemCallErrorNumber = "EPERM"; - SystemCallFilter = [ - "@system-service" - "~@privileged" - "~@resources" - ]; - UMask = "0077"; - }; + serviceConfig = { + ExecStart = '' + ${lib.getExe cfg.package} ${mkCfg keyboard} \ + ${utils.escapeSystemdExecArgs cfg.extraArgs} + ''; + Restart = "always"; + # Restart at increasing intervals from 2s to 1m + RestartSec = 2; + RestartSteps = 30; + RestartMaxDelaySec = "1min"; + Nice = -20; + DynamicUser = true; + User = "kmonad"; + Group = "kmonad"; + SupplementaryGroups = [ + # These ensure that our dynamic user has access to the device node + config.users.groups.input.name + config.users.groups.uinput.name + ] + ++ keyboard.extraGroups; + } + // lib.optionalAttrs keyboard.enableHardening { + DeviceAllow = [ + "/dev/uinput w" + "char-input r" + ]; + CapabilityBoundingSet = [ "" ]; + DevicePolicy = "closed"; + IPAddressDeny = [ "any" ]; + LockPersonality = true; + MemoryDenyWriteExecute = true; + PrivateNetwork = true; + PrivateUsers = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + RestrictAddressFamilies = [ "none" ]; + RestrictNamespaces = true; + RestrictRealtime = true; + SystemCallArchitectures = [ "native" ]; + SystemCallErrorNumber = "EPERM"; + SystemCallFilter = [ + "@system-service" + "~@privileged" + "~@resources" + ]; + UMask = "0077"; + }; # make sure the new config is used after nixos-rebuild switch # stopIfChanged controls[0] how a service is "restarted" during # nixos-rebuild switch. By default, stopIfChanged is true, which stops diff --git a/nixos/modules/services/hardware/monado.nix b/nixos/modules/services/hardware/monado.nix index 0fa401c35934..e7d9bb45b711 100644 --- a/nixos/modules/services/hardware/monado.nix +++ b/nixos/modules/services/hardware/monado.nix @@ -50,8 +50,7 @@ in }; highPriority = - mkEnableOption "high priority capability for monado-service" - // mkOption { default = true; }; + mkEnableOption "high priority capability for monado-service" // mkOption { default = true; }; }; config = mkIf cfg.enable { diff --git a/nixos/modules/services/hardware/openrgb.nix b/nixos/modules/services/hardware/openrgb.nix index 2f29d4a1de88..ecbea501fd24 100644 --- a/nixos/modules/services/hardware/openrgb.nix +++ b/nixos/modules/services/hardware/openrgb.nix @@ -47,10 +47,11 @@ in environment.systemPackages = [ cfg.package ]; services.udev.packages = [ cfg.package ]; - boot.kernelModules = - [ "i2c-dev" ] - ++ lib.optionals (cfg.motherboard == "amd") [ "i2c-piix4" ] - ++ lib.optionals (cfg.motherboard == "intel") [ "i2c-i801" ]; + boot.kernelModules = [ + "i2c-dev" + ] + ++ lib.optionals (cfg.motherboard == "amd") [ "i2c-piix4" ] + ++ lib.optionals (cfg.motherboard == "intel") [ "i2c-i801" ]; systemd.services.openrgb = { description = "OpenRGB server daemon"; diff --git a/nixos/modules/services/hardware/rasdaemon.nix b/nixos/modules/services/hardware/rasdaemon.nix index cd5b24281f5f..b86e8b04d5ff 100644 --- a/nixos/modules/services/hardware/rasdaemon.nix +++ b/nixos/modules/services/hardware/rasdaemon.nix @@ -100,16 +100,17 @@ in text = cfg.config; }; }; - environment.systemPackages = - [ cfg.package ] - ++ lib.optionals (cfg.testing) ( - with pkgs.error-inject; - [ - edac-inject - mce-inject - aer-inject - ] - ); + environment.systemPackages = [ + cfg.package + ] + ++ lib.optionals (cfg.testing) ( + with pkgs.error-inject; + [ + edac-inject + mce-inject + aer-inject + ] + ); boot.initrd.kernelModules = cfg.extraModules diff --git a/nixos/modules/services/hardware/sane.nix b/nixos/modules/services/hardware/sane.nix index 4a7398721f23..337bed562727 100644 --- a/nixos/modules/services/hardware/sane.nix +++ b/nixos/modules/services/hardware/sane.nix @@ -34,13 +34,12 @@ let LD_LIBRARY_PATH = [ "/etc/sane-libs" ]; }; - backends = - [ - pkg - netConf - ] - ++ lib.optional config.services.saned.enable sanedConf - ++ config.hardware.sane.extraBackends; + backends = [ + pkg + netConf + ] + ++ lib.optional config.services.saned.enable sanedConf + ++ config.hardware.sane.extraBackends; saneConfig = pkgs.mkSaneConfig { paths = backends; inherit (config.hardware.sane) disabledDefaultBackends; diff --git a/nixos/modules/services/hardware/scanservjs.nix b/nixos/modules/services/hardware/scanservjs.nix index 9bcfc76a2742..774bff45744b 100644 --- a/nixos/modules/services/hardware/scanservjs.nix +++ b/nixos/modules/services/hardware/scanservjs.nix @@ -13,7 +13,8 @@ let tesseract = lib.getExe pkgs.tesseract; # it defaults to config/devices.json, but "config" dir doesn't exist by default and scanservjs doesn't create it devicesPath = "devices.json"; - } // cfg.settings; + } + // cfg.settings; settingsFormat = pkgs.formats.json { }; leafs = diff --git a/nixos/modules/services/hardware/thinkfan.nix b/nixos/modules/services/hardware/thinkfan.nix index 33f1ae422b2d..d5d1f23f1d98 100644 --- a/nixos/modules/services/hardware/thinkfan.nix +++ b/nixos/modules/services/hardware/thinkfan.nix @@ -41,62 +41,61 @@ let name: lib.types.submodule { freeformType = lib.types.attrsOf settingsFormat.type; - options = - { - type = lib.mkOption { - type = lib.types.enum [ - "hwmon" - "atasmart" - "tpacpi" - "nvml" - ]; - description = '' - The ${name} type, can be - `hwmon` for standard ${name}s, + options = { + type = lib.mkOption { + type = lib.types.enum [ + "hwmon" + "atasmart" + "tpacpi" + "nvml" + ]; + description = '' + The ${name} type, can be + `hwmon` for standard ${name}s, - `atasmart` to read the temperature via - S.M.A.R.T (requires smartSupport to be enabled), + `atasmart` to read the temperature via + S.M.A.R.T (requires smartSupport to be enabled), - `tpacpi` for the legacy thinkpac_acpi driver, or + `tpacpi` for the legacy thinkpac_acpi driver, or - `nvml` for the (proprietary) nVidia driver. - ''; - }; - query = lib.mkOption { - type = lib.types.str; - description = '' - The query string used to match one or more ${name}s: can be - a fullpath to the temperature file (single ${name}) or a fullpath - to a driver directory (multiple ${name}s). - - ::: {.note} - When multiple ${name}s match, the query can be restricted using the - {option}`name` or {option}`indices` options. - ::: - ''; - }; - indices = lib.mkOption { - type = with lib.types; nullOr (listOf ints.unsigned); - default = null; - description = '' - A list of ${name}s to pick in case multiple ${name}s match the query. - - ::: {.note} - Indices start from 0. - ::: - ''; - }; - } - // lib.optionalAttrs (name == "sensor") { - correction = lib.mkOption { - type = with lib.types; nullOr (listOf int); - default = null; - description = '' - A list of values to be added to the temperature of each sensor, - can be used to equalize small discrepancies in temperature ratings. - ''; - }; + `nvml` for the (proprietary) nVidia driver. + ''; }; + query = lib.mkOption { + type = lib.types.str; + description = '' + The query string used to match one or more ${name}s: can be + a fullpath to the temperature file (single ${name}) or a fullpath + to a driver directory (multiple ${name}s). + + ::: {.note} + When multiple ${name}s match, the query can be restricted using the + {option}`name` or {option}`indices` options. + ::: + ''; + }; + indices = lib.mkOption { + type = with lib.types; nullOr (listOf ints.unsigned); + default = null; + description = '' + A list of ${name}s to pick in case multiple ${name}s match the query. + + ::: {.note} + Indices start from 0. + ::: + ''; + }; + } + // lib.optionalAttrs (name == "sensor") { + correction = lib.mkOption { + type = with lib.types; nullOr (listOf int); + default = null; + description = '' + A list of values to be added to the temperature of each sensor, + can be used to equalize small discrepancies in temperature ratings. + ''; + }; + }; }; # removes NixOS special and unused attributes diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix index 341784782b52..cfd18d00bfb6 100644 --- a/nixos/modules/services/hardware/tlp.nix +++ b/nixos/modules/services/hardware/tlp.nix @@ -82,14 +82,13 @@ in } ]; - environment.etc = - { - "tlp.conf".text = (mkTlpConfig cfg.settings) + cfg.extraConfig; - } - // lib.optionalAttrs enableRDW { - "NetworkManager/dispatcher.d/99tlp-rdw-nm".source = - "${cfg.package}/lib/NetworkManager/dispatcher.d/99tlp-rdw-nm"; - }; + environment.etc = { + "tlp.conf".text = (mkTlpConfig cfg.settings) + cfg.extraConfig; + } + // lib.optionalAttrs enableRDW { + "NetworkManager/dispatcher.d/99tlp-rdw-nm".source = + "${cfg.package}/lib/NetworkManager/dispatcher.d/99tlp-rdw-nm"; + }; environment.systemPackages = [ cfg.package ]; diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index 0d5a001c0e59..c7890d11dd2d 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -463,7 +463,8 @@ in "${config.boot.initrd.systemd.package}/lib/udev/cdrom_id" "${config.boot.initrd.systemd.package}/lib/udev/scsi_id" "${config.boot.initrd.systemd.package}/lib/udev/rules.d" - ] ++ map (x: "${x}/bin") config.boot.initrd.services.udev.binPackages; + ] + ++ map (x: "${x}/bin") config.boot.initrd.services.udev.binPackages; # Generate the udev rules for the initrd boot.initrd.systemd.contents = { @@ -491,22 +492,21 @@ in )) ]; - environment.etc = - { - "udev/rules.d".source = udevRulesFor { - name = "udev-rules"; - udevPackages = cfg.packages; - systemd = config.systemd.package; - binPackages = cfg.packages; - inherit udevPath udev; - }; - "udev/hwdb.bin".source = hwdbBin; - } - // lib.optionalAttrs config.boot.modprobeConfig.enable { - # We don't place this into `extraModprobeConfig` so that stage-1 ramdisk doesn't bloat. - "modprobe.d/firmware.conf".text = - "options firmware_class path=${config.hardware.firmware}/lib/firmware"; + environment.etc = { + "udev/rules.d".source = udevRulesFor { + name = "udev-rules"; + udevPackages = cfg.packages; + systemd = config.systemd.package; + binPackages = cfg.packages; + inherit udevPath udev; }; + "udev/hwdb.bin".source = hwdbBin; + } + // lib.optionalAttrs config.boot.modprobeConfig.enable { + # We don't place this into `extraModprobeConfig` so that stage-1 ramdisk doesn't bloat. + "modprobe.d/firmware.conf".text = + "options firmware_class path=${config.hardware.firmware}/lib/firmware"; + }; system.requiredKernelConfig = with config.lib.kernelConfig; [ (isEnabled "UNIX") diff --git a/nixos/modules/services/hardware/udisks2.nix b/nixos/modules/services/hardware/udisks2.nix index 88e24fea6c72..cbde9ca600d0 100644 --- a/nixos/modules/services/hardware/udisks2.nix +++ b/nixos/modules/services/hardware/udisks2.nix @@ -100,7 +100,8 @@ in systemd.tmpfiles.rules = [ "d /var/lib/udisks2 0755 root root -" - ] ++ lib.optional cfg.mountOnMedia "D! /media 0755 root root -"; + ] + ++ lib.optional cfg.mountOnMedia "D! /media 0755 root root -"; services.udev.packages = [ cfg.package ]; diff --git a/nixos/modules/services/hardware/vdr.nix b/nixos/modules/services/hardware/vdr.nix index 59aaffcb1264..063ecc1d8dc9 100644 --- a/nixos/modules/services/hardware/vdr.nix +++ b/nixos/modules/services/hardware/vdr.nix @@ -74,12 +74,11 @@ in serviceConfig = { ExecStart = let - args = - [ - "--video=${cfg.videoDir}" - ] - ++ optional cfg.enableLirc "--lirc=${config.passthru.lirc.socket}" - ++ cfg.extraArguments; + args = [ + "--video=${cfg.videoDir}" + ] + ++ optional cfg.enableLirc "--lirc=${config.passthru.lirc.socket}" + ++ cfg.extraArguments; in "${cfg.package}/bin/vdr ${lib.escapeShellArgs args}"; User = cfg.user; @@ -101,7 +100,8 @@ in extraGroups = [ "video" "audio" - ] ++ optional cfg.enableLirc "lirc"; + ] + ++ optional cfg.enableLirc "lirc"; }; }; diff --git a/nixos/modules/services/home-automation/esphome.nix b/nixos/modules/services/home-automation/esphome.nix index 6f06a704166f..7a66b8ec19f2 100644 --- a/nixos/modules/services/home-automation/esphome.nix +++ b/nixos/modules/services/home-automation/esphome.nix @@ -93,7 +93,8 @@ in environment = { # platformio fails to determine the home directory when using DynamicUser PLATFORMIO_CORE_DIR = "${stateDir}/.platformio"; - } // lib.optionalAttrs cfg.usePing { ESPHOME_DASHBOARD_USE_PING = "true"; }; + } + // lib.optionalAttrs cfg.usePing { ESPHOME_DASHBOARD_USE_PING = "true"; }; serviceConfig = { ExecStart = "${cfg.package}/bin/esphome dashboard ${esphomeParams} ${stateDir}"; diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix index 38a3c0a47e12..1c8e65a352f2 100644 --- a/nixos/modules/services/home-automation/home-assistant.nix +++ b/nixos/modules/services/home-automation/home-assistant.nix @@ -235,18 +235,17 @@ in extraComponents = mkOption { type = types.listOf (types.enum availableComponents); - default = - [ - # List of components required to complete the onboarding - "default_config" - "met" - "esphome" - ] - ++ optionals pkgs.stdenv.hostPlatform.isAarch [ - # Use the platform as an indicator that we might be running on a RaspberryPi and include - # relevant components - "rpi_power" - ]; + default = [ + # List of components required to complete the onboarding + "default_config" + "met" + "esphome" + ] + ++ optionals pkgs.stdenv.hostPlatform.isAarch [ + # Use the platform as an indicator that we might be running on a RaspberryPi and include + # relevant components + "rpi_power" + ]; example = literalExpression '' [ "analytics" @@ -935,16 +934,15 @@ in allowPaths = if isList value then value else singleton value; in [ "${cfg.configDir}" ] ++ allowPaths; - RestrictAddressFamilies = - [ - "AF_INET" - "AF_INET6" - "AF_NETLINK" - "AF_UNIX" - ] - ++ optionals (any useComponent componentsUsingBluetooth) [ - "AF_BLUETOOTH" - ]; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_NETLINK" + "AF_UNIX" + ] + ++ optionals (any useComponent componentsUsingBluetooth) [ + "AF_BLUETOOTH" + ]; RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; @@ -952,15 +950,14 @@ in "dialout" ]; SystemCallArchitectures = "native"; - SystemCallFilter = - [ - "@system-service" - "~@privileged" - ] - ++ optionals (any useComponent componentsUsingPing) [ - "capset" - "setuid" - ]; + SystemCallFilter = [ + "@system-service" + "~@privileged" + ] + ++ optionals (any useComponent componentsUsingPing) [ + "capset" + "setuid" + ]; UMask = "0077"; }; path = [ diff --git a/nixos/modules/services/logging/awstats.nix b/nixos/modules/services/logging/awstats.nix index 5cd2eee77d5d..e7fb18cc5a35 100644 --- a/nixos/modules/services/logging/awstats.nix +++ b/nixos/modules/services/logging/awstats.nix @@ -215,10 +215,11 @@ in ) cfg.configs; # create data directory with the correct permissions - systemd.tmpfiles.rules = - [ "d '${cfg.dataDir}' 755 root root - -" ] - ++ lib.mapAttrsToList (name: opts: "d '${cfg.dataDir}/${name}' 755 root root - -") cfg.configs - ++ [ "Z '${cfg.dataDir}' 755 root root - -" ]; + systemd.tmpfiles.rules = [ + "d '${cfg.dataDir}' 755 root root - -" + ] + ++ lib.mapAttrsToList (name: opts: "d '${cfg.dataDir}/${name}' 755 root root - -") cfg.configs + ++ [ "Z '${cfg.dataDir}' 755 root root - -" ]; # nginx options services.nginx.virtualHosts = lib.mapAttrs' (name: opts: { diff --git a/nixos/modules/services/logging/logrotate.nix b/nixos/modules/services/logging/logrotate.nix index b85af47d0f28..92878f055ce8 100644 --- a/nixos/modules/services/logging/logrotate.nix +++ b/nixos/modules/services/logging/logrotate.nix @@ -314,56 +314,55 @@ in ]; startAt = "hourly"; - serviceConfig = - { - Type = "oneshot"; - ExecStart = "${lib.getExe pkgs.logrotate} ${utils.escapeSystemdExecArgs cfg.extraArgs} ${mailOption} ${cfg.configFile}"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${lib.getExe pkgs.logrotate} ${utils.escapeSystemdExecArgs cfg.extraArgs} ${mailOption} ${cfg.configFile}"; - # performance - Nice = 19; - IOSchedulingClass = "best-effort"; - IOSchedulingPriority = 7; + # performance + Nice = 19; + IOSchedulingClass = "best-effort"; + IOSchedulingPriority = 7; - # hardening - CapabilityBoundingSet = [ - "CAP_CHOWN" - "CAP_DAC_OVERRIDE" - "CAP_FOWNER" - "CAP_KILL" - "CAP_SETUID" - "CAP_SETGID" - ]; - DevicePolicy = "closed"; - LockPersonality = true; - MemoryDenyWriteExecute = true; - NoNewPrivileges = true; - PrivateDevices = true; - PrivateTmp = true; - ProcSubset = "pid"; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHome = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - ProtectSystem = "full"; - RestrictNamespaces = true; - RestrictRealtime = true; - RestrictSUIDSGID = false; # can create sgid directories - SystemCallArchitectures = "native"; - SystemCallFilter = [ - "@system-service" - "~@privileged @resources" - "@chown @setuid" - ]; - UMask = "0027"; - } - // lib.optionalAttrs (!cfg.allowNetworking) { - PrivateNetwork = true; # e.g. mail delivery - RestrictAddressFamilies = [ "AF_UNIX" ]; - }; + # hardening + CapabilityBoundingSet = [ + "CAP_CHOWN" + "CAP_DAC_OVERRIDE" + "CAP_FOWNER" + "CAP_KILL" + "CAP_SETUID" + "CAP_SETGID" + ]; + DevicePolicy = "closed"; + LockPersonality = true; + MemoryDenyWriteExecute = true; + NoNewPrivileges = true; + PrivateDevices = true; + PrivateTmp = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + ProtectSystem = "full"; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = false; # can create sgid directories + SystemCallArchitectures = "native"; + SystemCallFilter = [ + "@system-service" + "~@privileged @resources" + "@chown @setuid" + ]; + UMask = "0027"; + } + // lib.optionalAttrs (!cfg.allowNetworking) { + PrivateNetwork = true; # e.g. mail delivery + RestrictAddressFamilies = [ "AF_UNIX" ]; + }; }; systemd.services.logrotate-checkconf = { description = "Logrotate configuration check"; diff --git a/nixos/modules/services/logging/promtail.nix b/nixos/modules/services/logging/promtail.nix index 634c3a888020..89985a983304 100644 --- a/nixos/modules/services/logging/promtail.nix +++ b/nixos/modules/services/logging/promtail.nix @@ -70,47 +70,46 @@ in ${lib.getExe pkgs.promtail} -config.file=${configFile} -check-syntax ''; - serviceConfig = - { - Restart = "on-failure"; - TimeoutStopSec = 10; + serviceConfig = { + Restart = "on-failure"; + TimeoutStopSec = 10; - ExecStart = "${pkgs.promtail}/bin/promtail -config.file=${configFile} ${escapeShellArgs cfg.extraFlags}"; + ExecStart = "${pkgs.promtail}/bin/promtail -config.file=${configFile} ${escapeShellArgs cfg.extraFlags}"; - ProtectSystem = "strict"; - ProtectHome = true; - PrivateTmp = true; - PrivateDevices = true; - ProtectKernelTunables = true; - ProtectControlGroups = true; - RestrictSUIDSGID = true; - PrivateMounts = true; - CacheDirectory = "promtail"; - ReadWritePaths = lib.optional allowPositionsFile (builtins.dirOf positionsFile); + ProtectSystem = "strict"; + ProtectHome = true; + PrivateTmp = true; + PrivateDevices = true; + ProtectKernelTunables = true; + ProtectControlGroups = true; + RestrictSUIDSGID = true; + PrivateMounts = true; + CacheDirectory = "promtail"; + ReadWritePaths = lib.optional allowPositionsFile (builtins.dirOf positionsFile); - User = "promtail"; - Group = "promtail"; + User = "promtail"; + Group = "promtail"; - CapabilityBoundingSet = ""; - NoNewPrivileges = true; + CapabilityBoundingSet = ""; + NoNewPrivileges = true; - ProtectKernelModules = true; - SystemCallArchitectures = "native"; - ProtectKernelLogs = true; - ProtectClock = true; + ProtectKernelModules = true; + SystemCallArchitectures = "native"; + ProtectKernelLogs = true; + ProtectClock = true; - LockPersonality = true; - ProtectHostname = true; - RestrictRealtime = true; - MemoryDenyWriteExecute = true; - PrivateUsers = true; + LockPersonality = true; + ProtectHostname = true; + RestrictRealtime = true; + MemoryDenyWriteExecute = true; + PrivateUsers = true; - SupplementaryGroups = lib.optional (allowSystemdJournal) "systemd-journal"; - } - // (optionalAttrs (!pkgs.stdenv.hostPlatform.isAarch64) { - # FIXME: figure out why this breaks on aarch64 - SystemCallFilter = "@system-service"; - }); + SupplementaryGroups = lib.optional (allowSystemdJournal) "systemd-journal"; + } + // (optionalAttrs (!pkgs.stdenv.hostPlatform.isAarch64) { + # FIXME: figure out why this breaks on aarch64 + SystemCallFilter = "@system-service"; + }); }; users.groups.promtail = { }; diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix index 8548b3107346..80397c9fd23c 100644 --- a/nixos/modules/services/mail/dovecot.nix +++ b/nixos/modules/services/mail/dovecot.nix @@ -80,15 +80,14 @@ let # Those settings are automatically set based on other parts # of this module. - automaticallySetPluginSettings = - [ - "sieve_plugins" - "sieve_extensions" - "sieve_global_extensions" - "sieve_pipe_bin_dir" - ] - ++ (builtins.attrNames sieveScriptSettings) - ++ (builtins.attrNames imapSieveMailboxSettings); + automaticallySetPluginSettings = [ + "sieve_plugins" + "sieve_extensions" + "sieve_global_extensions" + "sieve_pipe_bin_dir" + ] + ++ (builtins.attrNames sieveScriptSettings) + ++ (builtins.attrNames imapSieveMailboxSettings); # The idea is to match everything that looks like `$term =` # but not `# $term something something` @@ -671,38 +670,37 @@ in ); }; - users.users = - { - dovenull = { - uid = config.ids.uids.dovenull2; - description = "Dovecot user for untrusted logins"; - group = "dovenull"; - }; - } - // optionalAttrs (cfg.user == "dovecot2") { - dovecot2 = { - uid = config.ids.uids.dovecot2; - description = "Dovecot user"; - group = cfg.group; - }; - } - // optionalAttrs (cfg.createMailUser && cfg.mailUser != null) { - ${cfg.mailUser} = { - description = "Virtual Mail User"; - isSystemUser = true; - } // optionalAttrs (cfg.mailGroup != null) { group = cfg.mailGroup; }; + users.users = { + dovenull = { + uid = config.ids.uids.dovenull2; + description = "Dovecot user for untrusted logins"; + group = "dovenull"; }; + } + // optionalAttrs (cfg.user == "dovecot2") { + dovecot2 = { + uid = config.ids.uids.dovecot2; + description = "Dovecot user"; + group = cfg.group; + }; + } + // optionalAttrs (cfg.createMailUser && cfg.mailUser != null) { + ${cfg.mailUser} = { + description = "Virtual Mail User"; + isSystemUser = true; + } + // optionalAttrs (cfg.mailGroup != null) { group = cfg.mailGroup; }; + }; - users.groups = - { - dovenull.gid = config.ids.gids.dovenull2; - } - // optionalAttrs (cfg.group == "dovecot2") { - dovecot2.gid = config.ids.gids.dovecot2; - } - // optionalAttrs (cfg.createMailUser && cfg.mailGroup != null) { - ${cfg.mailGroup} = { }; - }; + users.groups = { + dovenull.gid = config.ids.gids.dovenull2; + } + // optionalAttrs (cfg.group == "dovecot2") { + dovecot2.gid = config.ids.gids.dovecot2; + } + // optionalAttrs (cfg.createMailUser && cfg.mailGroup != null) { + ${cfg.mailGroup} = { }; + }; environment.etc."dovecot/dovecot.conf".source = cfg.configFile; @@ -774,44 +772,43 @@ in # When copying sieve scripts preserve the original time stamp # (should be 0) so that the compiled sieve script is newer than # the source file and Dovecot won't try to compile it. - preStart = - '' - rm -rf ${stateDir}/sieve ${stateDir}/imapsieve - '' - + optionalString (cfg.sieve.scripts != { }) '' - mkdir -p ${stateDir}/sieve - ${concatStringsSep "\n" ( - mapAttrsToList (to: from: '' - if [ -d '${from}' ]; then - mkdir '${stateDir}/sieve/${to}' - cp -p "${from}/"*.sieve '${stateDir}/sieve/${to}' - else - cp -p '${from}' '${stateDir}/sieve/${to}' - fi - ${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/sieve/${to}' - '') cfg.sieve.scripts - )} - chown -R '${cfg.mailUser}:${cfg.mailGroup}' '${stateDir}/sieve' - '' - + optionalString (cfg.imapsieve.mailbox != [ ]) '' - mkdir -p ${stateDir}/imapsieve/{before,after} + preStart = '' + rm -rf ${stateDir}/sieve ${stateDir}/imapsieve + '' + + optionalString (cfg.sieve.scripts != { }) '' + mkdir -p ${stateDir}/sieve + ${concatStringsSep "\n" ( + mapAttrsToList (to: from: '' + if [ -d '${from}' ]; then + mkdir '${stateDir}/sieve/${to}' + cp -p "${from}/"*.sieve '${stateDir}/sieve/${to}' + else + cp -p '${from}' '${stateDir}/sieve/${to}' + fi + ${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/sieve/${to}' + '') cfg.sieve.scripts + )} + chown -R '${cfg.mailUser}:${cfg.mailGroup}' '${stateDir}/sieve' + '' + + optionalString (cfg.imapsieve.mailbox != [ ]) '' + mkdir -p ${stateDir}/imapsieve/{before,after} - ${concatMapStringsSep "\n" ( - el: - optionalString (el.before != null) '' - cp -p ${el.before} ${stateDir}/imapsieve/before/${baseNameOf el.before} - ${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/imapsieve/before/${baseNameOf el.before}' - '' - + optionalString (el.after != null) '' - cp -p ${el.after} ${stateDir}/imapsieve/after/${baseNameOf el.after} - ${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/imapsieve/after/${baseNameOf el.after}' - '' - ) cfg.imapsieve.mailbox} + ${concatMapStringsSep "\n" ( + el: + optionalString (el.before != null) '' + cp -p ${el.before} ${stateDir}/imapsieve/before/${baseNameOf el.before} + ${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/imapsieve/before/${baseNameOf el.before}' + '' + + optionalString (el.after != null) '' + cp -p ${el.after} ${stateDir}/imapsieve/after/${baseNameOf el.after} + ${pkgs.dovecot_pigeonhole}/bin/sievec '${stateDir}/imapsieve/after/${baseNameOf el.after}' + '' + ) cfg.imapsieve.mailbox} - ${optionalString ( - cfg.mailUser != null && cfg.mailGroup != null - ) "chown -R '${cfg.mailUser}:${cfg.mailGroup}' '${stateDir}/imapsieve'"} - ''; + ${optionalString ( + cfg.mailUser != null && cfg.mailGroup != null + ) "chown -R '${cfg.mailUser}:${cfg.mailGroup}' '${stateDir}/imapsieve'"} + ''; }; environment.systemPackages = [ dovecotPkg ]; diff --git a/nixos/modules/services/mail/mailman.nix b/nixos/modules/services/mail/mailman.nix index f31969b1aa91..29788fba4ba5 100644 --- a/nixos/modules/services/mail/mailman.nix +++ b/nixos/modules/services/mail/mailman.nix @@ -21,37 +21,37 @@ let # This deliberately doesn't use recursiveUpdate so users can # override the defaults. - webSettings = - { - DEFAULT_FROM_EMAIL = cfg.siteOwner; - SERVER_EMAIL = cfg.siteOwner; - ALLOWED_HOSTS = [ - "localhost" - "127.0.0.1" - ] ++ cfg.webHosts; - COMPRESS_OFFLINE = true; - STATIC_ROOT = "/var/lib/mailman-web-static"; - MEDIA_ROOT = "/var/lib/mailman-web/media"; - LOGGING = { - version = 1; - disable_existing_loggers = true; - handlers.console.class = "logging.StreamHandler"; - loggers.django = { - handlers = [ "console" ]; - level = "INFO"; - }; + webSettings = { + DEFAULT_FROM_EMAIL = cfg.siteOwner; + SERVER_EMAIL = cfg.siteOwner; + ALLOWED_HOSTS = [ + "localhost" + "127.0.0.1" + ] + ++ cfg.webHosts; + COMPRESS_OFFLINE = true; + STATIC_ROOT = "/var/lib/mailman-web-static"; + MEDIA_ROOT = "/var/lib/mailman-web/media"; + LOGGING = { + version = 1; + disable_existing_loggers = true; + handlers.console.class = "logging.StreamHandler"; + loggers.django = { + handlers = [ "console" ]; + level = "INFO"; }; - HAYSTACK_CONNECTIONS.default = { - ENGINE = "haystack.backends.whoosh_backend.WhooshEngine"; - PATH = "/var/lib/mailman-web/fulltext-index"; - }; - } - // lib.optionalAttrs cfg.enablePostfix { - EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"; - EMAIL_HOST = "127.0.0.1"; - EMAIL_PORT = 25; - } - // cfg.webSettings; + }; + HAYSTACK_CONNECTIONS.default = { + ENGINE = "haystack.backends.whoosh_backend.WhooshEngine"; + PATH = "/var/lib/mailman-web/fulltext-index"; + }; + } + // lib.optionalAttrs cfg.enablePostfix { + EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"; + EMAIL_HOST = "127.0.0.1"; + EMAIL_PORT = 25; + } + // cfg.webSettings; webSettingsJSON = pkgs.writeText "settings.json" (builtins.toJSON webSettings); @@ -343,60 +343,59 @@ in config = lib.mkIf cfg.enable { - services.mailman.settings = - { - mailman.site_owner = lib.mkDefault cfg.siteOwner; - mailman.layout = "fhs"; + services.mailman.settings = { + mailman.site_owner = lib.mkDefault cfg.siteOwner; + mailman.layout = "fhs"; - "paths.fhs" = { - bin_dir = "${pkgs.mailmanPackages.mailman}/bin"; - var_dir = "/var/lib/mailman"; - queue_dir = "$var_dir/queue"; - template_dir = "$var_dir/templates"; - log_dir = "/var/log/mailman"; - lock_dir = "/run/mailman/lock"; - etc_dir = "/etc"; - pid_file = "/run/mailman/master.pid"; - }; + "paths.fhs" = { + bin_dir = "${pkgs.mailmanPackages.mailman}/bin"; + var_dir = "/var/lib/mailman"; + queue_dir = "$var_dir/queue"; + template_dir = "$var_dir/templates"; + log_dir = "/var/log/mailman"; + lock_dir = "/run/mailman/lock"; + etc_dir = "/etc"; + pid_file = "/run/mailman/master.pid"; + }; - mta.configuration = lib.mkDefault ( - if cfg.enablePostfix then - "${postfixMtaConfig}" - else - throw "When Mailman Postfix integration is disabled, set `services.mailman.settings.mta.configuration` to the path of the config file required to integrate with your MTA." - ); - - "archiver.hyperkitty" = lib.mkIf cfg.hyperkitty.enable { - class = "mailman_hyperkitty.Archiver"; - enable = "yes"; - configuration = "/var/lib/mailman/mailman-hyperkitty.cfg"; - }; - } - // ( - let - loggerNames = [ - "root" - "archiver" - "bounce" - "config" - "database" - "debug" - "error" - "fromusenet" - "http" - "locks" - "mischief" - "plugins" - "runner" - "smtp" - ]; - loggerSectionNames = map (n: "logging.${n}") loggerNames; - in - lib.genAttrs loggerSectionNames (name: { - handler = "stderr"; - }) + mta.configuration = lib.mkDefault ( + if cfg.enablePostfix then + "${postfixMtaConfig}" + else + throw "When Mailman Postfix integration is disabled, set `services.mailman.settings.mta.configuration` to the path of the config file required to integrate with your MTA." ); + "archiver.hyperkitty" = lib.mkIf cfg.hyperkitty.enable { + class = "mailman_hyperkitty.Archiver"; + enable = "yes"; + configuration = "/var/lib/mailman/mailman-hyperkitty.cfg"; + }; + } + // ( + let + loggerNames = [ + "root" + "archiver" + "bounce" + "config" + "database" + "debug" + "error" + "fromusenet" + "http" + "locks" + "mischief" + "plugins" + "runner" + "smtp" + ]; + loggerSectionNames = map (n: "logging.${n}") loggerNames; + in + lib.genAttrs loggerSectionNames (name: { + handler = "stderr"; + }) + ); + assertions = let inherit (config.services) postfix; @@ -537,21 +536,20 @@ in # Only mailman-related stuff is installed, the rest is removed # in `postBuild`. ignoreCollisions = true; - postBuild = - '' - find $out/bin/ -mindepth 1 -not -name "mailman*" -delete - '' - + lib.optionalString config.security.sudo.enable '' - mv $out/bin/mailman $out/bin/.mailman-wrapped - echo '#!${pkgs.runtimeShell} - sudo=exec - if [[ "$USER" != mailman ]]; then - sudo="exec /run/wrappers/bin/sudo -u mailman" - fi - $sudo ${placeholder "out"}/bin/.mailman-wrapped "$@" - ' > $out/bin/mailman - chmod +x $out/bin/mailman - ''; + postBuild = '' + find $out/bin/ -mindepth 1 -not -name "mailman*" -delete + '' + + lib.optionalString config.security.sudo.enable '' + mv $out/bin/mailman $out/bin/.mailman-wrapped + echo '#!${pkgs.runtimeShell} + sudo=exec + if [[ "$USER" != mailman ]]; then + sudo="exec /run/wrappers/bin/sudo -u mailman" + fi + $sudo ${placeholder "out"}/bin/.mailman-wrapped "$@" + ' > $out/bin/mailman + chmod +x $out/bin/mailman + ''; }) ]; @@ -567,201 +565,202 @@ in before = [ "nginx.service" ]; socketConfig.ListenStream = "/run/mailman-web.socket"; }; - systemd.services = - { - mailman = { - description = "GNU Mailman Master Process"; - before = lib.optional cfg.enablePostfix "postfix.service"; - after = - [ "network.target" ] - ++ lib.optional cfg.enablePostfix "postfix-setup.service" - ++ lib.optional withPostgresql "postgresql.target"; - restartTriggers = [ mailmanCfgFile ]; - requires = lib.optional withPostgresql "postgresql.target"; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - ExecStart = "${mailmanEnv}/bin/mailman start"; - ExecStop = "${mailmanEnv}/bin/mailman stop"; - User = "mailman"; - Group = "mailman"; - Type = "forking"; - RuntimeDirectory = "mailman"; - LogsDirectory = "mailman"; - PIDFile = "/run/mailman/master.pid"; - Restart = "on-failure"; - TimeoutStartSec = 180; - TimeoutStopSec = 180; - }; + systemd.services = { + mailman = { + description = "GNU Mailman Master Process"; + before = lib.optional cfg.enablePostfix "postfix.service"; + after = [ + "network.target" + ] + ++ lib.optional cfg.enablePostfix "postfix-setup.service" + ++ lib.optional withPostgresql "postgresql.target"; + restartTriggers = [ mailmanCfgFile ]; + requires = lib.optional withPostgresql "postgresql.target"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${mailmanEnv}/bin/mailman start"; + ExecStop = "${mailmanEnv}/bin/mailman stop"; + User = "mailman"; + Group = "mailman"; + Type = "forking"; + RuntimeDirectory = "mailman"; + LogsDirectory = "mailman"; + PIDFile = "/run/mailman/master.pid"; + Restart = "on-failure"; + TimeoutStartSec = 180; + TimeoutStopSec = 180; }; + }; - mailman-settings = { - description = "Generate settings files (including secrets) for Mailman"; - before = [ - "mailman.service" - "mailman-web-setup.service" - "mailman-uwsgi.service" - "hyperkitty.service" - ]; - requiredBy = [ - "mailman.service" - "mailman-web-setup.service" - "mailman-uwsgi.service" - "hyperkitty.service" - ]; - path = with pkgs; [ jq ]; - after = lib.optional withPostgresql "postgresql.target"; - requires = lib.optional withPostgresql "postgresql.target"; - serviceConfig.RemainAfterExit = true; - serviceConfig.Type = "oneshot"; - script = '' - install -m0750 -o mailman -g mailman ${mailmanCfgFile} /etc/mailman.cfg - ${ - if cfg.restApiPassFile == null then - '' - sed -i "s/#NIXOS_MAILMAN_REST_API_PASS_SECRET#/$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64)/g" \ - /etc/mailman.cfg - '' - else - '' - ${pkgs.replace-secret}/bin/replace-secret \ - '#NIXOS_MAILMAN_REST_API_PASS_SECRET#' \ - ${cfg.restApiPassFile} \ - /etc/mailman.cfg - '' - } - - mailmanDir=/var/lib/mailman - mailmanWebDir=/var/lib/mailman-web - - mailmanCfg=$mailmanDir/mailman-hyperkitty.cfg - mailmanWebCfg=$mailmanWebDir/settings_local.json - - install -m 0775 -o mailman -g mailman -d /var/lib/mailman-web-static - install -m 0770 -o mailman -g mailman -d $mailmanDir - install -m 0770 -o ${cfg.webUser} -g mailman -d $mailmanWebDir - - if [ ! -e $mailmanWebCfg ]; then - hyperkittyApiKey=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64) - secretKey=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64) - - install -m 0440 -o root -g mailman \ - <(jq -n '.MAILMAN_ARCHIVER_KEY=$archiver_key | .SECRET_KEY=$secret_key' \ - --arg archiver_key "$hyperkittyApiKey" \ - --arg secret_key "$secretKey") \ - "$mailmanWebCfg" - fi - - hyperkittyApiKey="$(jq -r .MAILMAN_ARCHIVER_KEY "$mailmanWebCfg")" - mailmanCfgTmp=$(mktemp) - sed "s/@API_KEY@/$hyperkittyApiKey/g" ${mailmanHyperkittyCfg} >"$mailmanCfgTmp" - chown mailman:mailman "$mailmanCfgTmp" - mv "$mailmanCfgTmp" "$mailmanCfg" - ''; - }; - - mailman-web-setup = { - description = "Prepare mailman-web files and database"; - before = [ - "hyperkitty.service" - "mailman-uwsgi.service" - ]; - requiredBy = [ - "hyperkitty.service" - "mailman-uwsgi.service" - ]; - restartTriggers = [ config.environment.etc."mailman3/settings.py".source ]; - script = '' - [[ -e "${webSettings.STATIC_ROOT}" ]] && find "${webSettings.STATIC_ROOT}/" -mindepth 1 -delete - ${webEnv}/bin/mailman-web migrate - ${webEnv}/bin/mailman-web collectstatic - ${webEnv}/bin/mailman-web compress - ''; - serviceConfig = { - User = cfg.webUser; - Group = "mailman"; - Type = "oneshot"; - WorkingDirectory = "/var/lib/mailman-web"; - }; - }; - - mailman-uwsgi = lib.mkIf cfg.serve.enable ( - let - uwsgiConfig = lib.recursiveUpdate { - uwsgi = - { - type = "normal"; - plugins = [ "python3" ]; - home = webEnv; - http = "127.0.0.1:18507"; - buffer-size = 8192; - } - // ( - if cfg.serve.virtualRoot == "/" then - { module = "mailman_web.wsgi:application"; } - else - { - mount = "${cfg.serve.virtualRoot}=mailman_web.wsgi:application"; - manage-script-name = true; - } - ); - } cfg.serve.uwsgiSettings; - uwsgiConfigFile = pkgs.writeText "uwsgi-mailman.json" (builtins.toJSON uwsgiConfig); - in - { - wantedBy = [ "multi-user.target" ]; - after = lib.optional withPostgresql "postgresql.target"; - requires = [ - "mailman-uwsgi.socket" - "mailman-web-setup.service" - ] ++ lib.optional withPostgresql "postgresql.target"; - restartTriggers = [ config.environment.etc."mailman3/settings.py".source ]; - serviceConfig = { - # Since the mailman-web settings.py obstinately creates a logs - # dir in the cwd, change to the (writable) runtime directory before - # starting uwsgi. - ExecStart = "${pkgs.coreutils}/bin/env -C $RUNTIME_DIRECTORY ${ - pkgs.uwsgi.override { - plugins = [ "python3" ]; - python3 = webEnv.python; - } - }/bin/uwsgi --json ${uwsgiConfigFile}"; - User = cfg.webUser; - Group = "mailman"; - RuntimeDirectory = "mailman-uwsgi"; - Restart = "on-failure"; - }; + mailman-settings = { + description = "Generate settings files (including secrets) for Mailman"; + before = [ + "mailman.service" + "mailman-web-setup.service" + "mailman-uwsgi.service" + "hyperkitty.service" + ]; + requiredBy = [ + "mailman.service" + "mailman-web-setup.service" + "mailman-uwsgi.service" + "hyperkitty.service" + ]; + path = with pkgs; [ jq ]; + after = lib.optional withPostgresql "postgresql.target"; + requires = lib.optional withPostgresql "postgresql.target"; + serviceConfig.RemainAfterExit = true; + serviceConfig.Type = "oneshot"; + script = '' + install -m0750 -o mailman -g mailman ${mailmanCfgFile} /etc/mailman.cfg + ${ + if cfg.restApiPassFile == null then + '' + sed -i "s/#NIXOS_MAILMAN_REST_API_PASS_SECRET#/$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64)/g" \ + /etc/mailman.cfg + '' + else + '' + ${pkgs.replace-secret}/bin/replace-secret \ + '#NIXOS_MAILMAN_REST_API_PASS_SECRET#' \ + ${cfg.restApiPassFile} \ + /etc/mailman.cfg + '' } - ); - mailman-daily = { - description = "Trigger daily Mailman events"; - startAt = "daily"; - restartTriggers = [ mailmanCfgFile ]; - serviceConfig = { - ExecStart = "${mailmanEnv}/bin/mailman digests --send"; - User = "mailman"; - Group = "mailman"; - }; + mailmanDir=/var/lib/mailman + mailmanWebDir=/var/lib/mailman-web + + mailmanCfg=$mailmanDir/mailman-hyperkitty.cfg + mailmanWebCfg=$mailmanWebDir/settings_local.json + + install -m 0775 -o mailman -g mailman -d /var/lib/mailman-web-static + install -m 0770 -o mailman -g mailman -d $mailmanDir + install -m 0770 -o ${cfg.webUser} -g mailman -d $mailmanWebDir + + if [ ! -e $mailmanWebCfg ]; then + hyperkittyApiKey=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64) + secretKey=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64) + + install -m 0440 -o root -g mailman \ + <(jq -n '.MAILMAN_ARCHIVER_KEY=$archiver_key | .SECRET_KEY=$secret_key' \ + --arg archiver_key "$hyperkittyApiKey" \ + --arg secret_key "$secretKey") \ + "$mailmanWebCfg" + fi + + hyperkittyApiKey="$(jq -r .MAILMAN_ARCHIVER_KEY "$mailmanWebCfg")" + mailmanCfgTmp=$(mktemp) + sed "s/@API_KEY@/$hyperkittyApiKey/g" ${mailmanHyperkittyCfg} >"$mailmanCfgTmp" + chown mailman:mailman "$mailmanCfgTmp" + mv "$mailmanCfgTmp" "$mailmanCfg" + ''; + }; + + mailman-web-setup = { + description = "Prepare mailman-web files and database"; + before = [ + "hyperkitty.service" + "mailman-uwsgi.service" + ]; + requiredBy = [ + "hyperkitty.service" + "mailman-uwsgi.service" + ]; + restartTriggers = [ config.environment.etc."mailman3/settings.py".source ]; + script = '' + [[ -e "${webSettings.STATIC_ROOT}" ]] && find "${webSettings.STATIC_ROOT}/" -mindepth 1 -delete + ${webEnv}/bin/mailman-web migrate + ${webEnv}/bin/mailman-web collectstatic + ${webEnv}/bin/mailman-web compress + ''; + serviceConfig = { + User = cfg.webUser; + Group = "mailman"; + Type = "oneshot"; + WorkingDirectory = "/var/lib/mailman-web"; }; + }; - hyperkitty = lib.mkIf cfg.hyperkitty.enable { - description = "GNU Hyperkitty QCluster Process"; - after = [ "network.target" ]; + mailman-uwsgi = lib.mkIf cfg.serve.enable ( + let + uwsgiConfig = lib.recursiveUpdate { + uwsgi = { + type = "normal"; + plugins = [ "python3" ]; + home = webEnv; + http = "127.0.0.1:18507"; + buffer-size = 8192; + } + // ( + if cfg.serve.virtualRoot == "/" then + { module = "mailman_web.wsgi:application"; } + else + { + mount = "${cfg.serve.virtualRoot}=mailman_web.wsgi:application"; + manage-script-name = true; + } + ); + } cfg.serve.uwsgiSettings; + uwsgiConfigFile = pkgs.writeText "uwsgi-mailman.json" (builtins.toJSON uwsgiConfig); + in + { + wantedBy = [ "multi-user.target" ]; + after = lib.optional withPostgresql "postgresql.target"; + requires = [ + "mailman-uwsgi.socket" + "mailman-web-setup.service" + ] + ++ lib.optional withPostgresql "postgresql.target"; restartTriggers = [ config.environment.etc."mailman3/settings.py".source ]; - wantedBy = [ - "mailman.service" - "multi-user.target" - ]; serviceConfig = { - ExecStart = "${webEnv}/bin/mailman-web qcluster"; + # Since the mailman-web settings.py obstinately creates a logs + # dir in the cwd, change to the (writable) runtime directory before + # starting uwsgi. + ExecStart = "${pkgs.coreutils}/bin/env -C $RUNTIME_DIRECTORY ${ + pkgs.uwsgi.override { + plugins = [ "python3" ]; + python3 = webEnv.python; + } + }/bin/uwsgi --json ${uwsgiConfigFile}"; User = cfg.webUser; Group = "mailman"; - WorkingDirectory = "/var/lib/mailman-web"; + RuntimeDirectory = "mailman-uwsgi"; Restart = "on-failure"; }; + } + ); + + mailman-daily = { + description = "Trigger daily Mailman events"; + startAt = "daily"; + restartTriggers = [ mailmanCfgFile ]; + serviceConfig = { + ExecStart = "${mailmanEnv}/bin/mailman digests --send"; + User = "mailman"; + Group = "mailman"; }; - } - // lib.flip lib.mapAttrs' + }; + + hyperkitty = lib.mkIf cfg.hyperkitty.enable { + description = "GNU Hyperkitty QCluster Process"; + after = [ "network.target" ]; + restartTriggers = [ config.environment.etc."mailman3/settings.py".source ]; + wantedBy = [ + "mailman.service" + "multi-user.target" + ]; + serviceConfig = { + ExecStart = "${webEnv}/bin/mailman-web qcluster"; + User = cfg.webUser; + Group = "mailman"; + WorkingDirectory = "/var/lib/mailman-web"; + Restart = "on-failure"; + }; + }; + } + // + lib.flip lib.mapAttrs' { "minutely" = "minutely"; "quarter_hourly" = "*:00/15"; diff --git a/nixos/modules/services/mail/offlineimap.nix b/nixos/modules/services/mail/offlineimap.nix index 655631b1f4a1..712198932835 100644 --- a/nixos/modules/services/mail/offlineimap.nix +++ b/nixos/modules/services/mail/offlineimap.nix @@ -65,6 +65,7 @@ in # start immediately after computer is started: Persistent = "true"; }; - } // lib.optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; }; + } + // lib.optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; }; }; } diff --git a/nixos/modules/services/mail/opendkim.nix b/nixos/modules/services/mail/opendkim.nix index cf5d27405b7a..f9237ce2441e 100644 --- a/nixos/modules/services/mail/opendkim.nix +++ b/nixos/modules/services/mail/opendkim.nix @@ -10,23 +10,22 @@ let defaultSock = "local:/run/opendkim/opendkim.sock"; - args = - [ - "-f" - "-l" - "-p" - cfg.socket - "-d" - cfg.domains - "-k" - "${cfg.keyPath}/${cfg.selector}.private" - "-s" - cfg.selector - ] - ++ lib.optionals (cfg.configFile != null) [ - "-x" - cfg.configFile - ]; + args = [ + "-f" + "-l" + "-p" + cfg.socket + "-d" + cfg.domains + "-k" + "${cfg.keyPath}/${cfg.selector}.private" + "-s" + cfg.selector + ] + ++ lib.optionals (cfg.configFile != null) [ + "-x" + cfg.configFile + ]; configFile = pkgs.writeText "opendkim.conf" ( lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.settings) diff --git a/nixos/modules/services/mail/postfix-tlspol.nix b/nixos/modules/services/mail/postfix-tlspol.nix index 755c56f24d00..e7104d79b4fe 100644 --- a/nixos/modules/services/mail/postfix-tlspol.nix +++ b/nixos/modules/services/mail/postfix-tlspol.nix @@ -218,14 +218,13 @@ in ProtectSystem = "strict"; ReadOnlyPaths = [ "/etc/postfix-tlspol/config.yaml" ]; RemoveIPC = true; - RestrictAddressFamilies = - [ - "AF_INET" - "AF_INET6" - ] - ++ lib.optionals (lib.hasPrefix "unix:" cfg.settings.server.address) [ - "AF_UNIX" - ]; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + ] + ++ lib.optionals (lib.hasPrefix "unix:" cfg.settings.server.address) [ + "AF_UNIX" + ]; RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index 710f2d381e6a..dcb61e337a0e 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -252,7 +252,8 @@ let lines = [ labels labelDefaults - ] ++ (map (l: lib.init l ++ [ "" ]) masterCf); + ] + ++ (map (l: lib.init l ++ [ "" ]) masterCf); in lib.foldr foldLine (lib.genList (lib.const 0) (lib.length labels)) lines; @@ -991,7 +992,8 @@ in // lib.optionalAttrs haveLocalRecipients { local_recipient_maps = [ "hash:/etc/postfix/local_recipients" - ] ++ lib.optional haveAliases "$alias_maps"; + ] + ++ lib.optional haveAliases "$alias_maps"; } // lib.optionalAttrs (cfg.dnsBlacklists != [ ]) { smtpd_client_restrictions = clientRestrictions; } // lib.optionalAttrs cfg.enableHeaderChecks { @@ -1002,138 +1004,137 @@ in smtp_tls_security_level = lib.mkDefault "may"; }; - services.postfix.masterConfig = - { - pickup = { - private = false; - wakeup = 60; - maxproc = 1; - }; - cleanup = { - private = false; - maxproc = 0; - }; - qmgr = { - private = false; - wakeup = 300; - maxproc = 1; - }; - tlsmgr = { - wakeup = 1000; - wakeupUnusedComponent = false; - maxproc = 1; - }; - rewrite = { - command = "trivial-rewrite"; - }; - bounce = { - maxproc = 0; - }; - defer = { - maxproc = 0; - command = "bounce"; - }; - trace = { - maxproc = 0; - command = "bounce"; - }; - verify = { - maxproc = 1; - }; - flush = { - private = false; - wakeup = 1000; - wakeupUnusedComponent = false; - maxproc = 0; - }; - proxymap = { - command = "proxymap"; - }; - proxywrite = { - maxproc = 1; - command = "proxymap"; - }; - showq = { - private = false; - }; - error = { }; - retry = { - command = "error"; - }; - discard = { }; - local = { - privileged = true; - }; - virtual = { - privileged = true; - }; - lmtp = { - }; - anvil = { - maxproc = 1; - }; - scache = { - maxproc = 1; - }; - } - // lib.optionalAttrs cfg.enableSubmission { - submission = { - type = "inet"; - private = false; - command = "smtpd"; - args = - let - mkKeyVal = opt: val: [ - "-o" - (opt + "=" + val) - ]; - in - lib.concatLists (lib.mapAttrsToList mkKeyVal cfg.submissionOptions); - }; - } - // lib.optionalAttrs cfg.enableSmtp { - smtp_inet = { - name = "smtp"; - type = "inet"; - private = false; - command = "smtpd"; - }; - smtp = { }; - relay = { - command = "smtp"; - args = [ - "-o" - "smtp_fallback_relay=" - ]; - }; - } - // lib.optionalAttrs cfg.enableSubmissions { - submissions = { - type = "inet"; - private = false; - command = "smtpd"; - args = - let - mkKeyVal = opt: val: [ - "-o" - (opt + "=" + val) - ]; - adjustSmtpTlsSecurityLevel = - !(cfg.submissionsOptions ? smtpd_tls_security_level) - || cfg.submissionsOptions.smtpd_tls_security_level == "none" - || cfg.submissionsOptions.smtpd_tls_security_level == "may"; - submissionsOptions = - cfg.submissionsOptions - // { - smtpd_tls_wrappermode = "yes"; - } - // lib.optionalAttrs adjustSmtpTlsSecurityLevel { - smtpd_tls_security_level = "encrypt"; - }; - in - lib.concatLists (lib.mapAttrsToList mkKeyVal submissionsOptions); - }; + services.postfix.masterConfig = { + pickup = { + private = false; + wakeup = 60; + maxproc = 1; }; + cleanup = { + private = false; + maxproc = 0; + }; + qmgr = { + private = false; + wakeup = 300; + maxproc = 1; + }; + tlsmgr = { + wakeup = 1000; + wakeupUnusedComponent = false; + maxproc = 1; + }; + rewrite = { + command = "trivial-rewrite"; + }; + bounce = { + maxproc = 0; + }; + defer = { + maxproc = 0; + command = "bounce"; + }; + trace = { + maxproc = 0; + command = "bounce"; + }; + verify = { + maxproc = 1; + }; + flush = { + private = false; + wakeup = 1000; + wakeupUnusedComponent = false; + maxproc = 0; + }; + proxymap = { + command = "proxymap"; + }; + proxywrite = { + maxproc = 1; + command = "proxymap"; + }; + showq = { + private = false; + }; + error = { }; + retry = { + command = "error"; + }; + discard = { }; + local = { + privileged = true; + }; + virtual = { + privileged = true; + }; + lmtp = { + }; + anvil = { + maxproc = 1; + }; + scache = { + maxproc = 1; + }; + } + // lib.optionalAttrs cfg.enableSubmission { + submission = { + type = "inet"; + private = false; + command = "smtpd"; + args = + let + mkKeyVal = opt: val: [ + "-o" + (opt + "=" + val) + ]; + in + lib.concatLists (lib.mapAttrsToList mkKeyVal cfg.submissionOptions); + }; + } + // lib.optionalAttrs cfg.enableSmtp { + smtp_inet = { + name = "smtp"; + type = "inet"; + private = false; + command = "smtpd"; + }; + smtp = { }; + relay = { + command = "smtp"; + args = [ + "-o" + "smtp_fallback_relay=" + ]; + }; + } + // lib.optionalAttrs cfg.enableSubmissions { + submissions = { + type = "inet"; + private = false; + command = "smtpd"; + args = + let + mkKeyVal = opt: val: [ + "-o" + (opt + "=" + val) + ]; + adjustSmtpTlsSecurityLevel = + !(cfg.submissionsOptions ? smtpd_tls_security_level) + || cfg.submissionsOptions.smtpd_tls_security_level == "none" + || cfg.submissionsOptions.smtpd_tls_security_level == "may"; + submissionsOptions = + cfg.submissionsOptions + // { + smtpd_tls_wrappermode = "yes"; + } + // lib.optionalAttrs adjustSmtpTlsSecurityLevel { + smtpd_tls_security_level = "encrypt"; + }; + in + lib.concatLists (lib.mapAttrsToList mkKeyVal submissionsOptions); + }; + }; } (lib.mkIf haveAliases { diff --git a/nixos/modules/services/mail/postsrsd.nix b/nixos/modules/services/mail/postsrsd.nix index b264d17a1911..cda11576e260 100644 --- a/nixos/modules/services/mail/postsrsd.nix +++ b/nixos/modules/services/mail/postsrsd.nix @@ -48,21 +48,21 @@ let ); in { - imports = - [ - (mkRemovedOptionModule [ "services" "postsrsd" "socketPath" ] '' - Configure/reference `services.postsrsd.settings.socketmap` instead. Note that its now required to start with the `inet:` or `unix:` prefix. - '') - (mkRenamedOptionModule - [ "services" "postsrsd" "domains" ] - [ "services" "postsrsd" "settings" "domains" ] - ) - (mkRenamedOptionModule - [ "services" "postsrsd" "separator" ] - [ "services" "postsrsd" "settings" "separator" ] - ) - ] - ++ map + imports = [ + (mkRemovedOptionModule [ "services" "postsrsd" "socketPath" ] '' + Configure/reference `services.postsrsd.settings.socketmap` instead. Note that its now required to start with the `inet:` or `unix:` prefix. + '') + (mkRenamedOptionModule + [ "services" "postsrsd" "domains" ] + [ "services" "postsrsd" "settings" "domains" ] + ) + (mkRenamedOptionModule + [ "services" "postsrsd" "separator" ] + [ "services" "postsrsd" "settings" "separator" ] + ) + ] + ++ + map ( name: lib.mkRemovedOptionModule [ "services" "postsrsd" name ] '' diff --git a/nixos/modules/services/mail/public-inbox.nix b/nixos/modules/services/mail/public-inbox.nix index 385de9d95985..a2b536e29aef 100644 --- a/nixos/modules/services/mail/public-inbox.nix +++ b/nixos/modules/services/mail/public-inbox.nix @@ -74,17 +74,16 @@ let StateDirectory = [ "public-inbox" ]; StateDirectoryMode = "0750"; WorkingDirectory = stateDir; - BindReadOnlyPaths = - [ - "/etc" - "/run/systemd" - "${config.i18n.glibcLocales}" - ] - ++ mapAttrsToList (name: inbox: inbox.description) cfg.inboxes - ++ filter (x: x != null) [ - cfg.${proto}.cert or null - cfg.${proto}.key or null - ]; + BindReadOnlyPaths = [ + "/etc" + "/run/systemd" + "${config.i18n.glibcLocales}" + ] + ++ mapAttrsToList (name: inbox: inbox.description) cfg.inboxes + ++ filter (x: x != null) [ + cfg.${proto}.cert or null + cfg.${proto}.key or null + ]; # The following options are only for optimizing: # systemd-analyze security public-inbox-'*' AmbientCapabilities = ""; @@ -103,12 +102,13 @@ let ProtectProc = "invisible"; ProtectSystem = "strict"; RemoveIPC = true; - RestrictAddressFamilies = - [ "AF_UNIX" ] - ++ optionals needNetwork [ - "AF_INET" - "AF_INET6" - ]; + RestrictAddressFamilies = [ + "AF_UNIX" + ] + ++ optionals needNetwork [ + "AF_INET" + "AF_INET6" + ]; RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; @@ -215,7 +215,8 @@ in }; imap = { enable = mkEnableOption "the public-inbox IMAP server"; - } // publicInboxDaemonOptions "imap" 993; + } + // publicInboxDaemonOptions "imap" 993; http = { enable = mkEnableOption "the public-inbox HTTP server"; mounts = mkOption { @@ -253,7 +254,8 @@ in postfix.enable = mkEnableOption "the integration into Postfix"; nntp = { enable = mkEnableOption "the public-inbox NNTP server"; - } // publicInboxDaemonOptions "nntp" 563; + } + // publicInboxDaemonOptions "nntp" 563; spamAssassinRules = mkOption { type = with types; nullOr path; default = "${cfg.package.sa_config}/user/.spamassassin/user_prefs"; @@ -592,7 +594,8 @@ in wants = [ "public-inbox-init.service" ]; requires = [ "public-inbox-init.service" - ] ++ optional (cfg.settings.publicinboxwatch.spamcheck == "spamc") "spamassassin.service"; + ] + ++ optional (cfg.settings.publicinboxwatch.spamcheck == "spamc") "spamassassin.service"; wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = "${cfg.package}/bin/public-inbox-watch"; @@ -615,52 +618,51 @@ in wantedBy = [ "multi-user.target" ]; restartIfChanged = true; restartTriggers = [ PI_CONFIG ]; - script = - '' - set -ux - install -D -p ${PI_CONFIG} ${stateDir}/.public-inbox/config - '' - + optionalString useSpamAssassin '' - install -m 0700 -o spamd -d ${stateDir}/.spamassassin - ${optionalString (cfg.spamAssassinRules != null) '' - ln -sf ${cfg.spamAssassinRules} ${stateDir}/.spamassassin/user_prefs - ''} - '' - + concatStrings ( - mapAttrsToList (name: inbox: '' - if [ ! -e ${stateDir}/inboxes/${escapeShellArg name} ]; then - # public-inbox-init creates an inbox and adds it to a config file. - # It tries to atomically write the config file by creating - # another file in the same directory, and renaming it. - # This has the sad consequence that we can't use - # /dev/null, or it would try to create a file in /dev. - conf_dir="$(mktemp -d)" + script = '' + set -ux + install -D -p ${PI_CONFIG} ${stateDir}/.public-inbox/config + '' + + optionalString useSpamAssassin '' + install -m 0700 -o spamd -d ${stateDir}/.spamassassin + ${optionalString (cfg.spamAssassinRules != null) '' + ln -sf ${cfg.spamAssassinRules} ${stateDir}/.spamassassin/user_prefs + ''} + '' + + concatStrings ( + mapAttrsToList (name: inbox: '' + if [ ! -e ${stateDir}/inboxes/${escapeShellArg name} ]; then + # public-inbox-init creates an inbox and adds it to a config file. + # It tries to atomically write the config file by creating + # another file in the same directory, and renaming it. + # This has the sad consequence that we can't use + # /dev/null, or it would try to create a file in /dev. + conf_dir="$(mktemp -d)" - PI_CONFIG=$conf_dir/conf \ - ${cfg.package}/bin/public-inbox-init -V2 \ - ${escapeShellArgs ( - [ - name - "${stateDir}/inboxes/${name}" - inbox.url - ] - ++ inbox.address - )} + PI_CONFIG=$conf_dir/conf \ + ${cfg.package}/bin/public-inbox-init -V2 \ + ${escapeShellArgs ( + [ + name + "${stateDir}/inboxes/${name}" + inbox.url + ] + ++ inbox.address + )} - rm -rf $conf_dir - fi + rm -rf $conf_dir + fi - ln -sf ${inbox.description} \ - ${stateDir}/inboxes/${escapeShellArg name}/description + ln -sf ${inbox.description} \ + ${stateDir}/inboxes/${escapeShellArg name}/description - export GIT_DIR=${stateDir}/inboxes/${escapeShellArg name}/all.git - if test -d "$GIT_DIR"; then - # Config is inherited by each epoch repository, - # so just needs to be set for all.git. - ${pkgs.git}/bin/git config core.sharedRepository 0640 - fi - '') cfg.inboxes - ); + export GIT_DIR=${stateDir}/inboxes/${escapeShellArg name}/all.git + if test -d "$GIT_DIR"; then + # Config is inherited by each epoch repository, + # so just needs to be set for all.git. + ${pkgs.git}/bin/git config core.sharedRepository 0640 + fi + '') cfg.inboxes + ); serviceConfig = { Type = "oneshot"; RemainAfterExit = true; diff --git a/nixos/modules/services/mail/sympa.nix b/nixos/modules/services/mail/sympa.nix index f8cd19691926..f3bea32a7a9a 100644 --- a/nixos/modules/services/mail/sympa.nix +++ b/nixos/modules/services/mail/sympa.nix @@ -411,16 +411,15 @@ in }) ); - services.sympa.settingsFile = - { - "virtual.sympa" = lib.mkDefault { source = virtual; }; - "transport.sympa" = lib.mkDefault { source = transport; }; - "etc/list_aliases.tt2" = lib.mkDefault { source = listAliases; }; - } - // (lib.flip lib.mapAttrs' cfg.domains ( - fqdn: domain: - lib.nameValuePair "etc/${fqdn}/robot.conf" (lib.mkDefault { source = robotConfig fqdn domain; }) - )); + services.sympa.settingsFile = { + "virtual.sympa" = lib.mkDefault { source = virtual; }; + "transport.sympa" = lib.mkDefault { source = transport; }; + "etc/list_aliases.tt2" = lib.mkDefault { source = listAliases; }; + } + // (lib.flip lib.mapAttrs' cfg.domains ( + fqdn: domain: + lib.nameValuePair "etc/${fqdn}/robot.conf" (lib.mkDefault { source = robotConfig fqdn domain; }) + )); environment = { systemPackages = [ pkg ]; @@ -448,41 +447,40 @@ in } ]; - systemd.tmpfiles.rules = - [ - "d ${dataDir} 0711 ${user} ${group} - -" - "d ${dataDir}/etc 0700 ${user} ${group} - -" - "d ${dataDir}/spool 0700 ${user} ${group} - -" - "d ${dataDir}/list_data 0700 ${user} ${group} - -" - "d ${dataDir}/arc 0700 ${user} ${group} - -" - "d ${dataDir}/bounce 0700 ${user} ${group} - -" - "f ${dataDir}/sympa_transport 0600 ${user} ${group} - -" + systemd.tmpfiles.rules = [ + "d ${dataDir} 0711 ${user} ${group} - -" + "d ${dataDir}/etc 0700 ${user} ${group} - -" + "d ${dataDir}/spool 0700 ${user} ${group} - -" + "d ${dataDir}/list_data 0700 ${user} ${group} - -" + "d ${dataDir}/arc 0700 ${user} ${group} - -" + "d ${dataDir}/bounce 0700 ${user} ${group} - -" + "f ${dataDir}/sympa_transport 0600 ${user} ${group} - -" - # force-copy static_content so it's up to date with package - # set permissions for wwsympa which needs write access (...) - "R ${dataDir}/static_content - - - - -" - "C ${dataDir}/static_content 0711 ${user} ${group} - ${pkg}/var/lib/sympa/static_content" - "e ${dataDir}/static_content/* 0711 ${user} ${group} - -" + # force-copy static_content so it's up to date with package + # set permissions for wwsympa which needs write access (...) + "R ${dataDir}/static_content - - - - -" + "C ${dataDir}/static_content 0711 ${user} ${group} - ${pkg}/var/lib/sympa/static_content" + "e ${dataDir}/static_content/* 0711 ${user} ${group} - -" - "d /run/sympa 0755 ${user} ${group} - -" - ] - ++ (lib.flip lib.concatMap fqdns (fqdn: [ - "d ${dataDir}/etc/${fqdn} 0700 ${user} ${group} - -" - "d ${dataDir}/list_data/${fqdn} 0700 ${user} ${group} - -" - ])) - #++ (lib.flip lib.mapAttrsToList enabledFiles (k: v: - # "L+ ${dataDir}/${k} - - - - ${v.source}" - #)) - ++ (lib.concatLists ( - lib.flip lib.mapAttrsToList enabledFiles ( - k: v: [ - # sympa doesn't handle symlinks well (e.g. fails to create locks) - # force-copy instead - "R ${dataDir}/${k} - - - - -" - "C ${dataDir}/${k} 0700 ${user} ${group} - ${v.source}" - ] - ) - )); + "d /run/sympa 0755 ${user} ${group} - -" + ] + ++ (lib.flip lib.concatMap fqdns (fqdn: [ + "d ${dataDir}/etc/${fqdn} 0700 ${user} ${group} - -" + "d ${dataDir}/list_data/${fqdn} 0700 ${user} ${group} - -" + ])) + #++ (lib.flip lib.mapAttrsToList enabledFiles (k: v: + # "L+ ${dataDir}/${k} - - - - ${v.source}" + #)) + ++ (lib.concatLists ( + lib.flip lib.mapAttrsToList enabledFiles ( + k: v: [ + # sympa doesn't handle symlinks well (e.g. fails to create locks) + # force-copy instead + "R ${dataDir}/${k} - - - - -" + "C ${dataDir}/${k} 0700 ${user} ${group} - ${v.source}" + ] + ) + )); systemd.services.sympa = { description = "Sympa mailing list manager"; @@ -551,7 +549,8 @@ in -- ${pkg}/lib/sympa/cgi/wwsympa.fcgi ''; - } // commonServiceConfig; + } + // commonServiceConfig; }; services.nginx.enable = lib.mkIf usingNginx true; diff --git a/nixos/modules/services/matrix/mautrix-discord.nix b/nixos/modules/services/matrix/mautrix-discord.nix index 1f0847a07a56..0c37139b24c7 100644 --- a/nixos/modules/services/matrix/mautrix-discord.nix +++ b/nixos/modules/services/matrix/mautrix-discord.nix @@ -337,11 +337,12 @@ in serviceDependencies = lib.mkOption { type = lib.types.listOf lib.types.str; - default = - [ cfg.registrationServiceUnit ] - ++ (lib.lists.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit) - ++ (lib.lists.optional config.services.matrix-conduit.enable "matrix-conduit.service") - ++ (lib.lists.optional config.services.dendrite.enable "dendrite.service"); + default = [ + cfg.registrationServiceUnit + ] + ++ (lib.lists.optional config.services.matrix-synapse.enable config.services.matrix-synapse.serviceUnit) + ++ (lib.lists.optional config.services.matrix-conduit.enable "matrix-conduit.service") + ++ (lib.lists.optional config.services.dendrite.enable "dendrite.service"); defaultText = '' [ cfg.registrationServiceUnit ] ++ diff --git a/nixos/modules/services/matrix/mautrix-meta.nix b/nixos/modules/services/matrix/mautrix-meta.nix index e64f1d923564..c2cdcc9c0886 100644 --- a/nixos/modules/services/matrix/mautrix-meta.nix +++ b/nixos/modules/services/matrix/mautrix-meta.nix @@ -225,11 +225,12 @@ in serviceDependencies = lib.mkOption { type = lib.types.listOf lib.types.str; - default = - [ config.registrationServiceUnit ] - ++ (lib.lists.optional upperConfig.services.matrix-synapse.enable upperConfig.services.matrix-synapse.serviceUnit) - ++ (lib.lists.optional upperConfig.services.matrix-conduit.enable "matrix-conduit.service") - ++ (lib.lists.optional upperConfig.services.dendrite.enable "dendrite.service"); + default = [ + config.registrationServiceUnit + ] + ++ (lib.lists.optional upperConfig.services.matrix-synapse.enable upperConfig.services.matrix-synapse.serviceUnit) + ++ (lib.lists.optional upperConfig.services.matrix-conduit.enable "matrix-conduit.service") + ++ (lib.lists.optional upperConfig.services.dendrite.enable "dendrite.service"); defaultText = '' [ config.registrationServiceUnit ] ++ diff --git a/nixos/modules/services/matrix/mautrix-telegram.nix b/nixos/modules/services/matrix/mautrix-telegram.nix index 74f18923d790..efb966223136 100644 --- a/nixos/modules/services/matrix/mautrix-telegram.nix +++ b/nixos/modules/services/matrix/mautrix-telegram.nix @@ -189,43 +189,42 @@ in # RuntimeError: Could not determine home directory. environment.HOME = dataDir; - preStart = - '' - # substitute the settings file by environment variables - # in this case read from EnvironmentFile - test -f '${settingsFile}' && rm -f '${settingsFile}' - old_umask=$(umask) - umask 0177 - ${pkgs.envsubst}/bin/envsubst \ - -o '${settingsFile}' \ - -i '${settingsFileUnsubstituted}' - umask $old_umask + preStart = '' + # substitute the settings file by environment variables + # in this case read from EnvironmentFile + test -f '${settingsFile}' && rm -f '${settingsFile}' + old_umask=$(umask) + umask 0177 + ${pkgs.envsubst}/bin/envsubst \ + -o '${settingsFile}' \ + -i '${settingsFileUnsubstituted}' + umask $old_umask - # generate the appservice's registration file if absent - if [ ! -f '${registrationFile}' ]; then - ${cfg.package}/bin/mautrix-telegram \ - --generate-registration \ - --config='${settingsFile}' \ - --registration='${registrationFile}' - fi + # generate the appservice's registration file if absent + if [ ! -f '${registrationFile}' ]; then + ${cfg.package}/bin/mautrix-telegram \ + --generate-registration \ + --config='${settingsFile}' \ + --registration='${registrationFile}' + fi - old_umask=$(umask) - umask 0177 - # 1. Overwrite registration tokens in config - # is set, set it as the login shared secret value for the configured - # homeserver domain. - ${pkgs.yq}/bin/yq -s '.[0].appservice.as_token = .[1].as_token - | .[0].appservice.hs_token = .[1].hs_token - | .[0]' \ - '${settingsFile}' '${registrationFile}' > '${settingsFile}.tmp' - mv '${settingsFile}.tmp' '${settingsFile}' + old_umask=$(umask) + umask 0177 + # 1. Overwrite registration tokens in config + # is set, set it as the login shared secret value for the configured + # homeserver domain. + ${pkgs.yq}/bin/yq -s '.[0].appservice.as_token = .[1].as_token + | .[0].appservice.hs_token = .[1].hs_token + | .[0]' \ + '${settingsFile}' '${registrationFile}' > '${settingsFile}.tmp' + mv '${settingsFile}.tmp' '${settingsFile}' - umask $old_umask - '' - + lib.optionalString (cfg.package ? alembic) '' - # run automatic database init and migration scripts - ${cfg.package.alembic}/bin/alembic -x config='${settingsFile}' upgrade head - ''; + umask $old_umask + '' + + lib.optionalString (cfg.package ? alembic) '' + # run automatic database init and migration scripts + ${cfg.package.alembic}/bin/alembic -x config='${settingsFile}' upgrade head + ''; serviceConfig = { User = "mautrix-telegram"; diff --git a/nixos/modules/services/matrix/mjolnir.nix b/nixos/modules/services/matrix/mjolnir.nix index 46007d4e1118..e20029e2d961 100644 --- a/nixos/modules/services/matrix/mjolnir.nix +++ b/nixos/modules/services/matrix/mjolnir.nix @@ -214,10 +214,12 @@ in description = "mjolnir - a moderation tool for Matrix"; wants = [ "network-online.target" - ] ++ lib.optionals (cfg.pantalaimon.enable) [ "pantalaimon-mjolnir.service" ]; + ] + ++ lib.optionals (cfg.pantalaimon.enable) [ "pantalaimon-mjolnir.service" ]; after = [ "network-online.target" - ] ++ lib.optionals (cfg.pantalaimon.enable) [ "pantalaimon-mjolnir.service" ]; + ] + ++ lib.optionals (cfg.pantalaimon.enable) [ "pantalaimon-mjolnir.service" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { diff --git a/nixos/modules/services/matrix/synapse.nix b/nixos/modules/services/matrix/synapse.nix index 72a5aa247380..a940d5a866b9 100644 --- a/nixos/modules/services/matrix/synapse.nix +++ b/nixos/modules/services/matrix/synapse.nix @@ -925,36 +925,35 @@ in listeners = mkOption { type = types.listOf (listenerType false); - default = - [ - { - port = 8008; - bind_addresses = [ "127.0.0.1" ]; - type = "http"; - tls = false; - x_forwarded = true; - resources = [ - { - names = [ "client" ]; - compress = true; - } - { - names = [ "federation" ]; - compress = false; - } - ]; - } - ] - ++ lib.optional hasWorkers { - path = "/run/matrix-synapse/main_replication.sock"; + default = [ + { + port = 8008; + bind_addresses = [ "127.0.0.1" ]; type = "http"; + tls = false; + x_forwarded = true; resources = [ { - names = [ "replication" ]; + names = [ "client" ]; + compress = true; + } + { + names = [ "federation" ]; compress = false; } ]; - }; + } + ] + ++ lib.optional hasWorkers { + path = "/run/matrix-synapse/main_replication.sock"; + type = "http"; + resources = [ + { + names = [ "replication" ]; + compress = false; + } + ]; + }; description = '' List of ports that Synapse should listen on, their purpose and their configuration. @@ -1322,84 +1321,83 @@ in }; config = mkIf cfg.enable { - assertions = - [ - { - assertion = clientListener != null; - message = '' - At least one listener which serves the `client` resource via HTTP is required - by synapse in `services.matrix-synapse.settings.listeners` or in one of the workers! - ''; - } - { - assertion = hasWorkers -> cfg.settings.redis.enabled; - message = '' - Workers for matrix-synapse require configuring a redis instance. This can be done - automatically by setting `services.matrix-synapse.configureRedisLocally = true`. - ''; - } - { - assertion = - let - main = cfg.settings.instance_map.main; - listener = lib.findFirst ( - listener: - ( - lib.hasAttr "port" main && listener.port or null == main.port - || lib.hasAttr "path" main && listener.path or null == main.path - ) - && listenerSupportsResource "replication" listener - && ( - lib.hasAttr "host" main - && lib.any (bind: bind == main.host || bind == "0.0.0.0" || bind == "::") listener.bind_addresses - || lib.hasAttr "path" main - ) - ) null cfg.settings.listeners; - in - hasWorkers -> (cfg.settings.instance_map ? main && listener != null); - message = '' - Workers for matrix-synapse require setting `services.matrix-synapse.settings.instance_map.main` - to any listener configured in `services.matrix-synapse.settings.listeners` with a `"replication"` - resource. - - This is done by default unless you manually configure either of those settings. - ''; - } - { - assertion = cfg.enableRegistrationScript -> clientListener.path == null; - message = '' - The client listener on matrix-synapse is configured to use UNIX domain sockets. - This configuration is incompatible with the `register_new_matrix_user` script. - - Disable `services.matrix-synapse.enableRegistrationScript` to continue. - ''; - } - ] - ++ (map (listener: { - assertion = (listener.path == null) != (listener.bind_addresses == null); + assertions = [ + { + assertion = clientListener != null; message = '' - Listeners require either a UNIX domain socket `path` or `bind_addresses` for a TCP socket. + At least one listener which serves the `client` resource via HTTP is required + by synapse in `services.matrix-synapse.settings.listeners` or in one of the workers! ''; - }) cfg.settings.listeners) - ++ (map (listener: { + } + { + assertion = hasWorkers -> cfg.settings.redis.enabled; + message = '' + Workers for matrix-synapse require configuring a redis instance. This can be done + automatically by setting `services.matrix-synapse.configureRedisLocally = true`. + ''; + } + { assertion = - listener.path != null - -> (listener.bind_addresses == null && listener.port == null && listener.tls == null); - message = let - formatKeyValue = key: value: lib.optionalString (value != null) " - ${key}=${toString value}\n"; + main = cfg.settings.instance_map.main; + listener = lib.findFirst ( + listener: + ( + lib.hasAttr "port" main && listener.port or null == main.port + || lib.hasAttr "path" main && listener.path or null == main.path + ) + && listenerSupportsResource "replication" listener + && ( + lib.hasAttr "host" main + && lib.any (bind: bind == main.host || bind == "0.0.0.0" || bind == "::") listener.bind_addresses + || lib.hasAttr "path" main + ) + ) null cfg.settings.listeners; in - '' - Listener configured with UNIX domain socket (${toString listener.path}) ignores the following options: - ${formatKeyValue "bind_addresses" listener.bind_addresses}${formatKeyValue "port" listener.port}${formatKeyValue "tls" listener.tls} - ''; - }) cfg.settings.listeners) - ++ (map (listener: { - assertion = listener.path == null || listener.type == "http"; + hasWorkers -> (cfg.settings.instance_map ? main && listener != null); message = '' - Listener configured with UNIX domain socket (${toString listener.path}) only supports the "http" listener type. + Workers for matrix-synapse require setting `services.matrix-synapse.settings.instance_map.main` + to any listener configured in `services.matrix-synapse.settings.listeners` with a `"replication"` + resource. + + This is done by default unless you manually configure either of those settings. ''; - }) cfg.settings.listeners); + } + { + assertion = cfg.enableRegistrationScript -> clientListener.path == null; + message = '' + The client listener on matrix-synapse is configured to use UNIX domain sockets. + This configuration is incompatible with the `register_new_matrix_user` script. + + Disable `services.matrix-synapse.enableRegistrationScript` to continue. + ''; + } + ] + ++ (map (listener: { + assertion = (listener.path == null) != (listener.bind_addresses == null); + message = '' + Listeners require either a UNIX domain socket `path` or `bind_addresses` for a TCP socket. + ''; + }) cfg.settings.listeners) + ++ (map (listener: { + assertion = + listener.path != null + -> (listener.bind_addresses == null && listener.port == null && listener.tls == null); + message = + let + formatKeyValue = key: value: lib.optionalString (value != null) " - ${key}=${toString value}\n"; + in + '' + Listener configured with UNIX domain socket (${toString listener.path}) ignores the following options: + ${formatKeyValue "bind_addresses" listener.bind_addresses}${formatKeyValue "port" listener.port}${formatKeyValue "tls" listener.tls} + ''; + }) cfg.settings.listeners) + ++ (map (listener: { + assertion = listener.path == null || listener.type == "http"; + message = '' + Listener configured with UNIX domain socket (${toString listener.path}) only supports the "http" listener type. + ''; + }) cfg.settings.listeners); services.matrix-synapse.settings.redis = lib.mkIf cfg.configureRedisLocally { enabled = true; @@ -1491,14 +1489,13 @@ in ProtectKernelTunables = true; ProtectProc = "invisible"; ProtectSystem = "strict"; - ReadWritePaths = - [ - cfg.dataDir - cfg.settings.media_store_path - ] - ++ (map (listener: dirOf listener.path) ( - filter (listener: listener.path != null) cfg.settings.listeners - )); + ReadWritePaths = [ + cfg.dataDir + cfg.settings.media_store_path + ] + ++ (map (listener: dirOf listener.path) ( + filter (listener: listener.path != null) cfg.settings.listeners + )); RemoveIPC = true; RestrictAddressFamilies = [ "AF_INET" @@ -1515,7 +1512,8 @@ in "~@privileged" ]; }; - } // targetConfig; + } + // targetConfig; genWorkerService = name: workerCfg: let diff --git a/nixos/modules/services/misc/atuin.nix b/nixos/modules/services/misc/atuin.nix index 0ac8850c644d..43636b948030 100644 --- a/nixos/modules/services/misc/atuin.nix +++ b/nixos/modules/services/misc/atuin.nix @@ -95,10 +95,12 @@ in requires = lib.optionals cfg.database.createLocally [ "postgresql.target" ]; after = [ "network-online.target" - ] ++ lib.optionals cfg.database.createLocally [ "postgresql.target" ]; + ] + ++ lib.optionals cfg.database.createLocally [ "postgresql.target" ]; wants = [ "network-online.target" - ] ++ lib.optionals cfg.database.createLocally [ "postgresql.target" ]; + ] + ++ lib.optionals cfg.database.createLocally [ "postgresql.target" ]; wantedBy = [ "multi-user.target" ]; serviceConfig = { @@ -151,7 +153,8 @@ in ATUIN_OPEN_REGISTRATION = lib.boolToString cfg.openRegistration; ATUIN_PATH = cfg.path; ATUIN_CONFIG_DIR = "/run/atuin"; # required to start, but not used as configuration is via environment variables - } // lib.optionalAttrs (cfg.database.uri != null) { ATUIN_DB_URI = cfg.database.uri; }; + } + // lib.optionalAttrs (cfg.database.uri != null) { ATUIN_DB_URI = cfg.database.uri; }; }; networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ]; diff --git a/nixos/modules/services/misc/bcg.nix b/nixos/modules/services/misc/bcg.nix index 002ff03ab068..6adb60005a8d 100644 --- a/nixos/modules/services/misc/bcg.nix +++ b/nixos/modules/services/misc/bcg.nix @@ -159,7 +159,8 @@ in wantedBy = [ "multi-user.target" ]; wants = [ "network-online.target" - ] ++ lib.optional config.services.mosquitto.enable "mosquitto.service"; + ] + ++ lib.optional config.services.mosquitto.enable "mosquitto.service"; after = [ "network-online.target" ]; preStart = lib.mkIf envConfig '' umask 077 diff --git a/nixos/modules/services/misc/blenderfarm.nix b/nixos/modules/services/misc/blenderfarm.nix index dbe6bcad1365..b66cfa2b5be4 100644 --- a/nixos/modules/services/misc/blenderfarm.nix +++ b/nixos/modules/services/misc/blenderfarm.nix @@ -85,21 +85,20 @@ in wants = [ "network-online.target" ]; description = "blendfarm server"; path = [ cfg.blenderPackage ]; - preStart = - '' - rm -f ServerSettings - install -m640 ${configFile} ServerSettings - if [ ! -d "BlenderData/nix-blender-linux64" ]; then - mkdir -p BlenderData/nix-blender-linux64 - echo "nix-blender" > VersionCustom - fi - rm -f BlenderData/nix-blender-linux64/blender - ln -s ${lib.getExe cfg.blenderPackage} BlenderData/nix-blender-linux64/blender - '' - + lib.optionalString (cfg.basicSecurityPasswordFile != null) '' - BLENDFARM_PASSWORD=$(${pkgs.systemd}/bin/systemd-creds cat BLENDFARM_PASS_FILE) - sed -i "s/null/\"$BLENDFARM_PASSWORD\"/g" ServerSettings - ''; + preStart = '' + rm -f ServerSettings + install -m640 ${configFile} ServerSettings + if [ ! -d "BlenderData/nix-blender-linux64" ]; then + mkdir -p BlenderData/nix-blender-linux64 + echo "nix-blender" > VersionCustom + fi + rm -f BlenderData/nix-blender-linux64/blender + ln -s ${lib.getExe cfg.blenderPackage} BlenderData/nix-blender-linux64/blender + '' + + lib.optionalString (cfg.basicSecurityPasswordFile != null) '' + BLENDFARM_PASSWORD=$(${pkgs.systemd}/bin/systemd-creds cat BLENDFARM_PASS_FILE) + sed -i "s/null/\"$BLENDFARM_PASSWORD\"/g" ServerSettings + ''; serviceConfig = { ExecStart = "${cfg.package}/bin/LogicReinc.BlendFarm.Server"; DynamicUser = true; diff --git a/nixos/modules/services/misc/devpi-server.nix b/nixos/modules/services/misc/devpi-server.nix index 16c5fd34ff17..2c3f31c47e0c 100644 --- a/nixos/modules/services/misc/devpi-server.nix +++ b/nixos/modules/services/misc/devpi-server.nix @@ -71,18 +71,17 @@ in after = [ "network-online.target" ]; # Since at least devpi-server 6.10.0, devpi requires the secrets file to # have 0600 permissions. - preStart = - '' - ${lib.optionalString ( - !isNull cfg.secretFile - ) "install -Dm 0600 \${CREDENTIALS_DIRECTORY}/devpi-secret ${runtimeDir}/${secretsFileName}"} + preStart = '' + ${lib.optionalString ( + !isNull cfg.secretFile + ) "install -Dm 0600 \${CREDENTIALS_DIRECTORY}/devpi-secret ${runtimeDir}/${secretsFileName}"} - if [ -f ${serverDir}/.nodeinfo ]; then - # already initialized the package index, exit gracefully - exit 0 - fi - ${cfg.package}/bin/devpi-init --serverdir ${serverDir} '' - + lib.optionalString cfg.replica "--role=replica --master-url=${cfg.primaryUrl}"; + if [ -f ${serverDir}/.nodeinfo ]; then + # already initialized the package index, exit gracefully + exit 0 + fi + ${cfg.package}/bin/devpi-init --serverdir ${serverDir} '' + + lib.optionalString cfg.replica "--role=replica --master-url=${cfg.primaryUrl}"; serviceConfig = { LoadCredential = lib.mkIf (!isNull cfg.secretFile) [ @@ -91,25 +90,24 @@ in Restart = "always"; ExecStart = let - args = - [ - "--request-timeout=5" - "--serverdir=${serverDir}" - "--host=${cfg.host}" - "--port=${builtins.toString cfg.port}" - ] - ++ lib.optionals (!isNull cfg.secretFile) [ - "--secretfile=${runtimeDir}/${secretsFileName}" - ] - ++ ( - if cfg.replica then - [ - "--role=replica" - "--master-url=${cfg.primaryUrl}" - ] - else - [ "--role=master" ] - ); + args = [ + "--request-timeout=5" + "--serverdir=${serverDir}" + "--host=${cfg.host}" + "--port=${builtins.toString cfg.port}" + ] + ++ lib.optionals (!isNull cfg.secretFile) [ + "--secretfile=${runtimeDir}/${secretsFileName}" + ] + ++ ( + if cfg.replica then + [ + "--role=replica" + "--master-url=${cfg.primaryUrl}" + ] + else + [ "--role=master" ] + ); in "${cfg.package}/bin/devpi-server ${lib.concatStringsSep " " args}"; DynamicUser = true; diff --git a/nixos/modules/services/misc/disnix.nix b/nixos/modules/services/misc/disnix.nix index 1a71c171be87..18d1023902b5 100644 --- a/nixos/modules/services/misc/disnix.nix +++ b/nixos/modules/services/misc/disnix.nix @@ -49,7 +49,8 @@ in environment.systemPackages = [ pkgs.disnix - ] ++ lib.optional cfg.useWebServiceInterface pkgs.DisnixWebService; + ] + ++ lib.optional cfg.useWebServiceInterface pkgs.DisnixWebService; environment.variables.PATH = lib.optionals cfg.enableProfilePath ( map (profileName: "/nix/var/nix/profiles/disnix/${profileName}/bin") cfg.profiles ); @@ -73,15 +74,16 @@ in description = "Disnix server"; wants = [ "dysnomia.target" ]; wantedBy = [ "multi-user.target" ]; - after = - [ "dbus.service" ] - ++ lib.optional config.services.httpd.enable "httpd.service" - ++ lib.optional config.services.mysql.enable "mysql.service" - ++ lib.optional config.services.postgresql.enable "postgresql.target" - ++ lib.optional config.services.tomcat.enable "tomcat.service" - ++ lib.optional config.services.svnserve.enable "svnserve.service" - ++ lib.optional config.services.mongodb.enable "mongodb.service" - ++ lib.optional config.services.influxdb.enable "influxdb.service"; + after = [ + "dbus.service" + ] + ++ lib.optional config.services.httpd.enable "httpd.service" + ++ lib.optional config.services.mysql.enable "mysql.service" + ++ lib.optional config.services.postgresql.enable "postgresql.target" + ++ lib.optional config.services.tomcat.enable "tomcat.service" + ++ lib.optional config.services.svnserve.enable "svnserve.service" + ++ lib.optional config.services.mongodb.enable "mongodb.service" + ++ lib.optional config.services.influxdb.enable "influxdb.service"; restartIfChanged = false; @@ -92,16 +94,15 @@ in "/run/current-system/sw" ]; - environment = - { - HOME = "/root"; - } - // (lib.optionalAttrs (config.environment.variables ? DYSNOMIA_CONTAINERS_PATH) { - inherit (config.environment.variables) DYSNOMIA_CONTAINERS_PATH; - }) - // (lib.optionalAttrs (config.environment.variables ? DYSNOMIA_MODULES_PATH) { - inherit (config.environment.variables) DYSNOMIA_MODULES_PATH; - }); + environment = { + HOME = "/root"; + } + // (lib.optionalAttrs (config.environment.variables ? DYSNOMIA_CONTAINERS_PATH) { + inherit (config.environment.variables) DYSNOMIA_CONTAINERS_PATH; + }) + // (lib.optionalAttrs (config.environment.variables ? DYSNOMIA_MODULES_PATH) { + inherit (config.environment.variables) DYSNOMIA_MODULES_PATH; + }); serviceConfig.ExecStart = "${cfg.package}/bin/disnix-service"; }; diff --git a/nixos/modules/services/misc/docker-registry.nix b/nixos/modules/services/misc/docker-registry.nix index 66a131332e78..2c2a59052d1b 100644 --- a/nixos/modules/services/misc/docker-registry.nix +++ b/nixos/modules/services/misc/docker-registry.nix @@ -15,7 +15,8 @@ let storage = { cache.blobdescriptor = blobCache; delete.enabled = cfg.enableDelete; - } // (lib.optionalAttrs (cfg.storagePath != null) { filesystem.rootdirectory = cfg.storagePath; }); + } + // (lib.optionalAttrs (cfg.storagePath != null) { filesystem.rootdirectory = cfg.storagePath; }); http = { addr = "${cfg.listenAddress}:${builtins.toString cfg.port}"; headers.X-Content-Type-Options = [ "nosniff" ]; diff --git a/nixos/modules/services/misc/docling-serve.nix b/nixos/modules/services/misc/docling-serve.nix index b9b7274047e0..0a1ac874e04a 100644 --- a/nixos/modules/services/misc/docling-serve.nix +++ b/nixos/modules/services/misc/docling-serve.nix @@ -88,7 +88,8 @@ in HF_HOME = "."; EASYOCR_MODULE_PATH = "."; MPLCONFIGDIR = "."; - } // cfg.environment; + } + // cfg.environment; serviceConfig = { ExecStart = "${lib.getExe cfg.package} run --host \"${cfg.host}\" --port ${toString cfg.port}"; diff --git a/nixos/modules/services/misc/duckdns.nix b/nixos/modules/services/misc/duckdns.nix index a4ea0a09e313..3a9b6fa3bd42 100644 --- a/nixos/modules/services/misc/duckdns.nix +++ b/nixos/modules/services/misc/duckdns.nix @@ -105,7 +105,8 @@ in Type = "simple"; LoadCredential = [ "DUCKDNS_TOKEN_FILE:${cfg.tokenFile}" - ] ++ lib.optionals (cfg.domainsFile != null) [ "DUCKDNS_DOMAINS_FILE:${cfg.domainsFile}" ]; + ] + ++ lib.optionals (cfg.domainsFile != null) [ "DUCKDNS_DOMAINS_FILE:${cfg.domainsFile}" ]; DynamicUser = true; }; script = '' diff --git a/nixos/modules/services/misc/dysnomia.nix b/nixos/modules/services/misc/dysnomia.nix index d9e774822593..acdc9c55555f 100644 --- a/nixos/modules/services/misc/dysnomia.nix +++ b/nixos/modules/services/misc/dysnomia.nix @@ -211,28 +211,27 @@ in hostname = config.networking.hostName; inherit (pkgs.stdenv.hostPlatform) system; - supportedTypes = - [ - "echo" - "fileset" - "process" - "wrapper" + supportedTypes = [ + "echo" + "fileset" + "process" + "wrapper" - # These are not base modules, but they are still enabled because they work with technology that are always enabled in NixOS - "systemd-unit" - "sysvinit-script" - "nixos-configuration" - ] - ++ lib.optional (dysnomiaFlags.enableApacheWebApplication) "apache-webapplication" - ++ lib.optional (dysnomiaFlags.enableAxis2WebService) "axis2-webservice" - ++ lib.optional (dysnomiaFlags.enableDockerContainer) "docker-container" - ++ lib.optional (dysnomiaFlags.enableEjabberdDump) "ejabberd-dump" - ++ lib.optional (dysnomiaFlags.enableInfluxDatabase) "influx-database" - ++ lib.optional (dysnomiaFlags.enableMySQLDatabase) "mysql-database" - ++ lib.optional (dysnomiaFlags.enablePostgreSQLDatabase) "postgresql-database" - ++ lib.optional (dysnomiaFlags.enableTomcatWebApplication) "tomcat-webapplication" - ++ lib.optional (dysnomiaFlags.enableMongoDatabase) "mongo-database" - ++ lib.optional (dysnomiaFlags.enableSubversionRepository) "subversion-repository"; + # These are not base modules, but they are still enabled because they work with technology that are always enabled in NixOS + "systemd-unit" + "sysvinit-script" + "nixos-configuration" + ] + ++ lib.optional (dysnomiaFlags.enableApacheWebApplication) "apache-webapplication" + ++ lib.optional (dysnomiaFlags.enableAxis2WebService) "axis2-webservice" + ++ lib.optional (dysnomiaFlags.enableDockerContainer) "docker-container" + ++ lib.optional (dysnomiaFlags.enableEjabberdDump) "ejabberd-dump" + ++ lib.optional (dysnomiaFlags.enableInfluxDatabase) "influx-database" + ++ lib.optional (dysnomiaFlags.enableMySQLDatabase) "mysql-database" + ++ lib.optional (dysnomiaFlags.enablePostgreSQLDatabase) "postgresql-database" + ++ lib.optional (dysnomiaFlags.enableTomcatWebApplication) "tomcat-webapplication" + ++ lib.optional (dysnomiaFlags.enableMongoDatabase) "mongo-database" + ++ lib.optional (dysnomiaFlags.enableSubversionRepository) "subversion-repository"; }; services.dysnomia.containers = lib.recursiveUpdate ( @@ -252,22 +251,20 @@ in }; } // lib.optionalAttrs (config.services.mysql.enable) { - mysql-database = - { - mysqlPort = config.services.mysql.settings.mysqld.port; - mysqlSocket = "/run/mysqld/mysqld.sock"; - } - // lib.optionalAttrs cfg.enableAuthentication { - mysqlUsername = "root"; - }; + mysql-database = { + mysqlPort = config.services.mysql.settings.mysqld.port; + mysqlSocket = "/run/mysqld/mysqld.sock"; + } + // lib.optionalAttrs cfg.enableAuthentication { + mysqlUsername = "root"; + }; } // lib.optionalAttrs (config.services.postgresql.enable) { - postgresql-database = - { - } - // lib.optionalAttrs (cfg.enableAuthentication) { - postgresqlUsername = "postgres"; - }; + postgresql-database = { + } + // lib.optionalAttrs (cfg.enableAuthentication) { + postgresqlUsername = "postgres"; + }; } // lib.optionalAttrs (config.services.tomcat.enable) { tomcat-webapplication = { diff --git a/nixos/modules/services/misc/etebase-server.nix b/nixos/modules/services/misc/etebase-server.nix index cd1cf8845231..f303d763d1df 100644 --- a/nixos/modules/services/misc/etebase-server.nix +++ b/nixos/modules/services/misc/etebase-server.nix @@ -189,13 +189,12 @@ in ) ]; - systemd.tmpfiles.rules = - [ - "d '${cfg.dataDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -" - ] - ++ lib.optionals (cfg.unixSocket != null) [ - "d '${builtins.dirOf cfg.unixSocket}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -" - ]; + systemd.tmpfiles.rules = [ + "d '${cfg.dataDir}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -" + ] + ++ lib.optionals (cfg.unixSocket != null) [ + "d '${builtins.dirOf cfg.unixSocket}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -" + ]; systemd.services.etebase-server = { description = "An Etebase (EteSync 2.0) server"; diff --git a/nixos/modules/services/misc/forgejo.nix b/nixos/modules/services/misc/forgejo.nix index 9f2245e4f10b..0b49cb6d726d 100644 --- a/nixos/modules/services/misc/forgejo.nix +++ b/nixos/modules/services/misc/forgejo.nix @@ -595,35 +595,34 @@ in ]; }; - systemd.tmpfiles.rules = - [ - "d '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/.ssh' 0700 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" + systemd.tmpfiles.rules = [ + "d '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/.ssh' 0700 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" - # If we have a folder or symlink with Forgejo locales, remove it - # And symlink the current Forgejo locales in place - "L+ '${cfg.stateDir}/conf/locale' - - - - ${cfg.package.out}/locale" + # If we have a folder or symlink with Forgejo locales, remove it + # And symlink the current Forgejo locales in place + "L+ '${cfg.stateDir}/conf/locale' - - - - ${cfg.package.out}/locale" - ] - ++ optionals cfg.lfs.enable [ - "d '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" - ]; + ] + ++ optionals cfg.lfs.enable [ + "d '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" + ]; systemd.services.forgejo-secrets = mkIf (!cfg.useWizard) { description = "Forgejo secret bootstrap helper"; @@ -658,19 +657,18 @@ in systemd.services.forgejo = { description = "Forgejo (Beyond coding. We forge.)"; - after = - [ - "network.target" - ] - ++ optionals usePostgresql [ - "postgresql.target" - ] - ++ optionals useMysql [ - "mysql.service" - ] - ++ optionals (!cfg.useWizard) [ - "forgejo-secrets.service" - ]; + after = [ + "network.target" + ] + ++ optionals usePostgresql [ + "postgresql.target" + ] + ++ optionals useMysql [ + "mysql.service" + ] + ++ optionals (!cfg.useWizard) [ + "forgejo-secrets.service" + ]; requires = optionals (cfg.database.createDatabase && usePostgresql) [ "postgresql.target" @@ -786,7 +784,8 @@ in HOME = cfg.stateDir; FORGEJO_WORK_DIR = cfg.stateDir; FORGEJO_CUSTOM = cfg.customDir; - } // lib.listToAttrs (map (e: lib.nameValuePair e.env "%d/${e.env}") secrets); + } + // lib.listToAttrs (map (e: lib.nameValuePair e.env "%d/${e.env}") secrets); }; services.openssh.settings.AcceptEnv = mkIf ( diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 160e777f1f80..7c205022555b 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -749,42 +749,42 @@ in ]; }; - systemd.tmpfiles.rules = - [ - "d '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" - "d '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/.ssh' 0700 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" + systemd.tmpfiles.rules = [ + "d '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.dump.backupDir}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.repositoryRoot}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" + "d '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/.ssh' 0700 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.customDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.customDir}/conf' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/data' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.stateDir}/log' 0750 ${cfg.user} ${cfg.group} - -" - # If we have a folder or symlink with gitea locales, remove it - # And symlink the current gitea locales in place - "L+ '${cfg.stateDir}/conf/locale' - - - - ${cfg.package.out}/locale" + # If we have a folder or symlink with gitea locales, remove it + # And symlink the current gitea locales in place + "L+ '${cfg.stateDir}/conf/locale' - - - - ${cfg.package.out}/locale" - ] - ++ lib.optionals cfg.lfs.enable [ - "d '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" - "z '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" - ]; + ] + ++ lib.optionals cfg.lfs.enable [ + "d '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" + "z '${cfg.lfs.contentDir}' 0750 ${cfg.user} ${cfg.group} - -" + ]; systemd.services.gitea = { description = "gitea"; - after = - [ "network.target" ] - ++ optional usePostgresql "postgresql.target" - ++ optional useMysql "mysql.service"; + after = [ + "network.target" + ] + ++ optional usePostgresql "postgresql.target" + ++ optional useMysql "mysql.service"; requires = optional (cfg.database.createDatabase && usePostgresql) "postgresql.target" ++ optional (cfg.database.createDatabase && useMysql) "mysql.service"; @@ -909,7 +909,8 @@ in cfg.repositoryRoot cfg.stateDir cfg.lfs.contentDir - ] ++ lib.optional (useSendmail && config.services.postfix.enable) "/var/lib/postfix/queue/maildrop"; + ] + ++ lib.optional (useSendmail && config.services.postfix.enable) "/var/lib/postfix/queue/maildrop"; UMask = "0027"; # Capabilities CapabilityBoundingSet = ""; @@ -931,7 +932,8 @@ in "AF_UNIX" "AF_INET" "AF_INET6" - ] ++ lib.optional (useSendmail && config.services.postfix.enable) "AF_NETLINK"; + ] + ++ lib.optional (useSendmail && config.services.postfix.enable) "AF_NETLINK"; RestrictNamespaces = true; LockPersonality = true; MemoryDenyWriteExecute = true; @@ -941,14 +943,13 @@ in PrivateMounts = true; # System Call Filtering SystemCallArchitectures = "native"; - SystemCallFilter = - [ - "~@cpu-emulation @debug @keyring @mount @obsolete @setuid" - "setrlimit" - ] - ++ lib.optionals (!useSendmail) [ - "~@privileged" - ]; + SystemCallFilter = [ + "~@cpu-emulation @debug @keyring @mount @obsolete @setuid" + "setrlimit" + ] + ++ lib.optionals (!useSendmail) [ + "~@privileged" + ]; }; environment = { diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index dcd39b27710f..a604bc88b3bf 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -39,7 +39,8 @@ let username = cfg.databaseUsername; encoding = "utf8"; pool = cfg.databasePool; - } // cfg.extraDatabaseConfig; + } + // cfg.extraDatabaseConfig; in { production = @@ -141,15 +142,14 @@ let omniauth.enabled = false; shared.path = "${cfg.statePath}/shared"; gitaly.client_path = "${cfg.packages.gitaly}/bin"; - backup = - { - gitaly_backup_path = "${cfg.packages.gitaly}/bin/gitaly-backup"; - path = cfg.backup.path; - keep_time = cfg.backup.keepTime; - } - // (optionalAttrs (cfg.backup.uploadOptions != { }) { - upload = cfg.backup.uploadOptions; - }); + backup = { + gitaly_backup_path = "${cfg.packages.gitaly}/bin/gitaly-backup"; + path = cfg.backup.path; + keep_time = cfg.backup.keepTime; + } + // (optionalAttrs (cfg.backup.uploadOptions != { }) { + upload = cfg.backup.uploadOptions; + }); gitlab_shell = { path = "${cfg.packages.gitlab-shell}"; hooks_path = "${cfg.statePath}/shell/hooks"; @@ -209,17 +209,18 @@ let } // cfg.extraEnv; - runtimeDeps = - [ git ] - ++ (with pkgs; [ - nodejs - gzip - gnutar - postgresqlPackage - coreutils - procps - findutils # Needed for gitlab:cleanup:orphan_job_artifact_files - ]); + runtimeDeps = [ + git + ] + ++ (with pkgs; [ + nodejs + gzip + gnutar + postgresqlPackage + coreutils + procps + findutils # Needed for gitlab:cleanup:orphan_job_artifact_files + ]); gitlab-rake = pkgs.stdenv.mkDerivation { name = "gitlab-rake"; @@ -1431,13 +1432,14 @@ in systemd.services.gitlab-config = { wantedBy = [ "gitlab.target" ]; partOf = [ "gitlab.target" ]; - path = - [ git ] - ++ (with pkgs; [ - jq - openssl - replace-secret - ]); + path = [ + git + ] + ++ (with pkgs; [ + jq + openssl + replace-secret + ]); serviceConfig = { Type = "oneshot"; User = cfg.user; @@ -1614,23 +1616,24 @@ in SIDEKIQ_MEMORY_KILLER_GRACE_TIME = cfg.sidekiq.memoryKiller.graceTime; SIDEKIQ_MEMORY_KILLER_SHUTDOWN_WAIT = cfg.sidekiq.memoryKiller.shutdownWait; }); - path = - [ git ] - ++ (with pkgs; [ - postgresqlPackage - ruby - openssh - nodejs - gnupg + path = [ + git + ] + ++ (with pkgs; [ + postgresqlPackage + ruby + openssh + nodejs + gnupg - "${cfg.packages.gitlab}/share/gitlab/vendor/gems/sidekiq-${cfg.packages.gitlab.rubyEnv.gems.sidekiq.version}" + "${cfg.packages.gitlab}/share/gitlab/vendor/gems/sidekiq-${cfg.packages.gitlab.rubyEnv.gems.sidekiq.version}" - # Needed for GitLab project imports - gnutar - gzip + # Needed for GitLab project imports + gnutar + gzip - procps # Sidekiq MemoryKiller - ]); + procps # Sidekiq MemoryKiller + ]); serviceConfig = { Type = "simple"; User = cfg.user; @@ -1666,13 +1669,14 @@ in bindsTo = [ "gitlab-config.service" ]; wantedBy = [ "gitlab.target" ]; partOf = [ "gitlab.target" ]; - path = - [ git ] - ++ (with pkgs; [ - openssh - gzip - bzip2 - ]); + path = [ + git + ] + ++ (with pkgs; [ + openssh + gzip + bzip2 + ]); serviceConfig = { Type = "simple"; User = cfg.user; @@ -1771,17 +1775,18 @@ in after = [ "network.target" ]; wantedBy = [ "gitlab.target" ]; partOf = [ "gitlab.target" ]; - path = - [ git ] - ++ (with pkgs; [ - remarshal - exiftool - git - gnutar - gzip - openssh - cfg.packages.gitlab-workhorse - ]); + path = [ + git + ] + ++ (with pkgs; [ + remarshal + exiftool + git + gnutar + gzip + openssh + cfg.packages.gitlab-workhorse + ]); serviceConfig = { Type = "simple"; User = cfg.user; @@ -1851,16 +1856,17 @@ in requiredBy = [ "gitlab.target" ]; partOf = [ "gitlab.target" ]; environment = gitlabEnv; - path = - [ git ] - ++ (with pkgs; [ - postgresqlPackage - openssh - nodejs - procps - gnupg - gzip - ]); + path = [ + git + ] + ++ (with pkgs; [ + postgresqlPackage + openssh + nodejs + procps + gnupg + gzip + ]); serviceConfig = { Type = "notify"; User = cfg.user; @@ -1886,14 +1892,13 @@ in after = [ "gitlab.service" ]; bindsTo = [ "gitlab.service" ]; startAt = cfg.backup.startAt; - environment = - { - RAILS_ENV = "production"; - CRON = "1"; - } - // optionalAttrs (stringLength cfg.backup.skip > 0) { - SKIP = cfg.backup.skip; - }; + environment = { + RAILS_ENV = "production"; + CRON = "1"; + } + // optionalAttrs (stringLength cfg.backup.skip > 0) { + SKIP = cfg.backup.skip; + }; serviceConfig = { User = cfg.user; Group = cfg.group; diff --git a/nixos/modules/services/misc/gitolite.nix b/nixos/modules/services/misc/gitolite.nix index 9cb7bc769e86..4fab5fc42062 100644 --- a/nixos/modules/services/misc/gitolite.nix +++ b/nixos/modules/services/misc/gitolite.nix @@ -125,29 +125,28 @@ in let manageGitoliteRc = cfg.extraGitoliteRc != ""; rcDir = pkgs.runCommand "gitolite-rc" { preferLocalBuild = true; } rcDirScript; - rcDirScript = - '' - mkdir "$out" - export HOME=temp-home - mkdir -p "$HOME/.gitolite/logs" # gitolite can't run without it - '${pkgs.gitolite}'/bin/gitolite print-default-rc >>"$out/gitolite.rc.default" - cat <>"$out/gitolite.rc" - # This file is managed by NixOS. - # Use services.gitolite options to control it. + rcDirScript = '' + mkdir "$out" + export HOME=temp-home + mkdir -p "$HOME/.gitolite/logs" # gitolite can't run without it + '${pkgs.gitolite}'/bin/gitolite print-default-rc >>"$out/gitolite.rc.default" + cat <>"$out/gitolite.rc" + # This file is managed by NixOS. + # Use services.gitolite options to control it. - END - cat "$out/gitolite.rc.default" >>"$out/gitolite.rc" - '' - + lib.optionalString (cfg.extraGitoliteRc != "") '' - echo -n ${lib.escapeShellArg '' + END + cat "$out/gitolite.rc.default" >>"$out/gitolite.rc" + '' + + lib.optionalString (cfg.extraGitoliteRc != "") '' + echo -n ${lib.escapeShellArg '' - # Added by NixOS: - ${lib.removeSuffix "\n" cfg.extraGitoliteRc} + # Added by NixOS: + ${lib.removeSuffix "\n" cfg.extraGitoliteRc} - # per perl rules, this should be the last line in such a file: - 1; - ''} >>"$out/gitolite.rc" - ''; + # per perl rules, this should be the last line in such a file: + 1; + ''} >>"$out/gitolite.rc" + ''; in { services.gitolite.extraGitoliteRc = lib.optionalString cfg.enableGitAnnex '' @@ -256,7 +255,8 @@ in environment.systemPackages = [ pkgs.gitolite pkgs.git - ] ++ lib.optional cfg.enableGitAnnex pkgs.git-annex; + ] + ++ lib.optional cfg.enableGitAnnex pkgs.git-annex; } ); } diff --git a/nixos/modules/services/misc/gotenberg.nix b/nixos/modules/services/misc/gotenberg.nix index 6d59b905dbea..e306e530116a 100644 --- a/nixos/modules/services/misc/gotenberg.nix +++ b/nixos/modules/services/misc/gotenberg.nix @@ -7,35 +7,34 @@ let cfg = config.services.gotenberg; - args = - [ - "--api-port=${toString cfg.port}" - "--api-timeout=${cfg.timeout}" - "--api-root-path=${cfg.rootPath}" - "--log-level=${cfg.logLevel}" - "--chromium-max-queue-size=${toString cfg.chromium.maxQueueSize}" - "--libreoffice-restart-after=${toString cfg.libreoffice.restartAfter}" - "--libreoffice-max-queue-size=${toString cfg.libreoffice.maxQueueSize}" - "--pdfengines-merge-engines=${lib.concatStringsSep "," cfg.pdfEngines.merge}" - "--pdfengines-convert-engines=${lib.concatStringsSep "," cfg.pdfEngines.convert}" - "--pdfengines-read-metadata-engines=${lib.concatStringsSep "," cfg.pdfEngines.readMetadata}" - "--pdfengines-write-metadata-engines=${lib.concatStringsSep "," cfg.pdfEngines.writeMetadata}" - "--api-download-from-allow-list=${cfg.downloadFrom.allowList}" - "--api-download-from-max-retry=${toString cfg.downloadFrom.maxRetries}" - ] - ++ optional cfg.enableBasicAuth "--api-enable-basic-auth" - ++ optional cfg.chromium.autoStart "--chromium-auto-start" - ++ optional cfg.chromium.disableJavascript "--chromium-disable-javascript" - ++ optional cfg.chromium.disableRoutes "--chromium-disable-routes" - ++ optional cfg.libreoffice.autoStart "--libreoffice-auto-start" - ++ optional cfg.libreoffice.disableRoutes "--libreoffice-disable-routes" - ++ optional cfg.pdfEngines.disableRoutes "--pdfengines-disable-routes" - ++ optional ( - cfg.downloadFrom.denyList != null - ) "--api-download-from-deny-list=${cfg.downloadFrom.denyList}" - ++ optional cfg.downloadFrom.disable "--api-disable-download-from" - ++ optional (cfg.bodyLimit != null) "--api-body-limit=${cfg.bodyLimit}" - ++ lib.optionals (cfg.extraArgs != [ ]) cfg.extraArgs; + args = [ + "--api-port=${toString cfg.port}" + "--api-timeout=${cfg.timeout}" + "--api-root-path=${cfg.rootPath}" + "--log-level=${cfg.logLevel}" + "--chromium-max-queue-size=${toString cfg.chromium.maxQueueSize}" + "--libreoffice-restart-after=${toString cfg.libreoffice.restartAfter}" + "--libreoffice-max-queue-size=${toString cfg.libreoffice.maxQueueSize}" + "--pdfengines-merge-engines=${lib.concatStringsSep "," cfg.pdfEngines.merge}" + "--pdfengines-convert-engines=${lib.concatStringsSep "," cfg.pdfEngines.convert}" + "--pdfengines-read-metadata-engines=${lib.concatStringsSep "," cfg.pdfEngines.readMetadata}" + "--pdfengines-write-metadata-engines=${lib.concatStringsSep "," cfg.pdfEngines.writeMetadata}" + "--api-download-from-allow-list=${cfg.downloadFrom.allowList}" + "--api-download-from-max-retry=${toString cfg.downloadFrom.maxRetries}" + ] + ++ optional cfg.enableBasicAuth "--api-enable-basic-auth" + ++ optional cfg.chromium.autoStart "--chromium-auto-start" + ++ optional cfg.chromium.disableJavascript "--chromium-disable-javascript" + ++ optional cfg.chromium.disableRoutes "--chromium-disable-routes" + ++ optional cfg.libreoffice.autoStart "--libreoffice-auto-start" + ++ optional cfg.libreoffice.disableRoutes "--libreoffice-disable-routes" + ++ optional cfg.pdfEngines.disableRoutes "--pdfengines-disable-routes" + ++ optional ( + cfg.downloadFrom.denyList != null + ) "--api-download-from-deny-list=${cfg.downloadFrom.denyList}" + ++ optional cfg.downloadFrom.disable "--api-disable-download-from" + ++ optional (cfg.bodyLimit != null) "--api-body-limit=${cfg.bodyLimit}" + ++ lib.optionals (cfg.extraArgs != [ ]) cfg.extraArgs; inherit (lib) mkEnableOption @@ -345,7 +344,8 @@ in SystemCallArchitectures = "native"; UMask = 77; - } // optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = cfg.environmentFile; }; + } + // optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = cfg.environmentFile; }; }; }; diff --git a/nixos/modules/services/misc/heisenbridge.nix b/nixos/modules/services/misc/heisenbridge.nix index 6460b90e84f1..3abdac1faeaa 100644 --- a/nixos/modules/services/misc/heisenbridge.nix +++ b/nixos/modules/services/misc/heisenbridge.nix @@ -195,11 +195,12 @@ in RemoveIPC = true; UMask = "0077"; - CapabilityBoundingSet = - [ "CAP_CHOWN" ] - ++ lib.optional ( - cfg.port < 1024 || (cfg.identd.enable && cfg.identd.port < 1024) - ) "CAP_NET_BIND_SERVICE"; + CapabilityBoundingSet = [ + "CAP_CHOWN" + ] + ++ lib.optional ( + cfg.port < 1024 || (cfg.identd.enable && cfg.identd.port < 1024) + ) "CAP_NET_BIND_SERVICE"; AmbientCapabilities = CapabilityBoundingSet; NoNewPrivileges = true; LockPersonality = true; diff --git a/nixos/modules/services/misc/klipper.nix b/nixos/modules/services/misc/klipper.nix index d719bc511c52..9322ad5a74cc 100644 --- a/nixos/modules/services/misc/klipper.nix +++ b/nixos/modules/services/misc/klipper.nix @@ -224,32 +224,31 @@ in restartTriggers = lib.optional (!cfg.mutableConfig) [ printerConfig ]; - serviceConfig = - { - ExecStart = "${cfg.package}/bin/klippy ${klippyArgs} ${cfg.configDir}/printer.cfg"; - RuntimeDirectory = "klipper"; - StateDirectory = "klipper"; - SupplementaryGroups = [ "dialout" ]; - WorkingDirectory = "${cfg.package}/lib"; - OOMScoreAdjust = "-999"; - CPUSchedulingPolicy = "rr"; - CPUSchedulingPriority = 99; - IOSchedulingClass = "realtime"; - IOSchedulingPriority = 0; - UMask = "0002"; - } - // ( - if cfg.user != null then - { - Group = cfg.group; - User = cfg.user; - } - else - { - DynamicUser = true; - User = "klipper"; - } - ); + serviceConfig = { + ExecStart = "${cfg.package}/bin/klippy ${klippyArgs} ${cfg.configDir}/printer.cfg"; + RuntimeDirectory = "klipper"; + StateDirectory = "klipper"; + SupplementaryGroups = [ "dialout" ]; + WorkingDirectory = "${cfg.package}/lib"; + OOMScoreAdjust = "-999"; + CPUSchedulingPolicy = "rr"; + CPUSchedulingPriority = 99; + IOSchedulingClass = "realtime"; + IOSchedulingPriority = 0; + UMask = "0002"; + } + // ( + if cfg.user != null then + { + Group = cfg.group; + User = cfg.user; + } + else + { + DynamicUser = true; + User = "klipper"; + } + ); }; environment.systemPackages = diff --git a/nixos/modules/services/misc/metabase.nix b/nixos/modules/services/misc/metabase.nix index 24cc633d1779..52be4ad91426 100644 --- a/nixos/modules/services/misc/metabase.nix +++ b/nixos/modules/services/misc/metabase.nix @@ -87,18 +87,17 @@ in wantedBy = [ "multi-user.target" ]; wants = [ "network-online.target" ]; after = [ "network-online.target" ]; - environment = - { - MB_PLUGINS_DIR = "${dataDir}/plugins"; - MB_DB_FILE = "${dataDir}/metabase.db"; - MB_JETTY_HOST = cfg.listen.ip; - MB_JETTY_PORT = toString cfg.listen.port; - } - // optionalAttrs (cfg.ssl.enable) { - MB_JETTY_SSL = true; - MB_JETTY_SSL_PORT = toString cfg.ssl.port; - MB_JETTY_SSL_KEYSTORE = cfg.ssl.keystore; - }; + environment = { + MB_PLUGINS_DIR = "${dataDir}/plugins"; + MB_DB_FILE = "${dataDir}/metabase.db"; + MB_JETTY_HOST = cfg.listen.ip; + MB_JETTY_PORT = toString cfg.listen.port; + } + // optionalAttrs (cfg.ssl.enable) { + MB_JETTY_SSL = true; + MB_JETTY_SSL_PORT = toString cfg.ssl.port; + MB_JETTY_SSL_KEYSTORE = cfg.ssl.keystore; + }; serviceConfig = { DynamicUser = true; StateDirectory = baseNameOf dataDir; diff --git a/nixos/modules/services/misc/moonraker.nix b/nixos/modules/services/misc/moonraker.nix index 9c6067634209..f1fcc255704b 100644 --- a/nixos/modules/services/misc/moonraker.nix +++ b/nixos/modules/services/misc/moonraker.nix @@ -152,35 +152,33 @@ in environment.etc."moonraker.cfg".source = let - forcedConfig = - { - server = { - host = cfg.address; - port = cfg.port; - klippy_uds_address = cfg.klipperSocket; - }; - machine = { - validate_service = false; - }; - } - // (lib.optionalAttrs (cfg.configDir != null) { - file_manager = { - config_path = cfg.configDir; - }; - }); + forcedConfig = { + server = { + host = cfg.address; + port = cfg.port; + klippy_uds_address = cfg.klipperSocket; + }; + machine = { + validate_service = false; + }; + } + // (lib.optionalAttrs (cfg.configDir != null) { + file_manager = { + config_path = cfg.configDir; + }; + }); fullConfig = lib.recursiveUpdate cfg.settings forcedConfig; in format.generate "moonraker.cfg" fullConfig; - systemd.tmpfiles.rules = - [ - "d '${cfg.stateDir}' - ${cfg.user} ${cfg.group} - -" - ] - ++ lib.optional (cfg.configDir != null) "d '${cfg.configDir}' - ${cfg.user} ${cfg.group} - -" - ++ lib.optionals cfg.analysis.enable [ - "d '${cfg.stateDir}/tools/klipper_estimator' - ${cfg.user} ${cfg.group} - -" - "L+ '${cfg.stateDir}/tools/klipper_estimator/klipper_estimator_linux' - - - - ${lib.getExe pkgs.klipper-estimator}" - ]; + systemd.tmpfiles.rules = [ + "d '${cfg.stateDir}' - ${cfg.user} ${cfg.group} - -" + ] + ++ lib.optional (cfg.configDir != null) "d '${cfg.configDir}' - ${cfg.user} ${cfg.group} - -" + ++ lib.optionals cfg.analysis.enable [ + "d '${cfg.stateDir}/tools/klipper_estimator' - ${cfg.user} ${cfg.group} - -" + "L+ '${cfg.stateDir}/tools/klipper_estimator/klipper_estimator_linux' - - - - ${lib.getExe pkgs.klipper-estimator}" + ]; systemd.services.moonraker = { description = "Moonraker, an API web server for Klipper"; diff --git a/nixos/modules/services/misc/open-webui.nix b/nixos/modules/services/misc/open-webui.nix index 521aacd39939..937464fc44d9 100644 --- a/nixos/modules/services/misc/open-webui.nix +++ b/nixos/modules/services/misc/open-webui.nix @@ -94,7 +94,8 @@ in HF_HOME = "."; SENTENCE_TRANSFORMERS_HOME = "."; WEBUI_URL = "http://localhost:${toString cfg.port}"; - } // cfg.environment; + } + // cfg.environment; serviceConfig = { ExecStart = "${lib.getExe cfg.package} serve --host \"${cfg.host}\" --port ${toString cfg.port}"; diff --git a/nixos/modules/services/misc/paperless.nix b/nixos/modules/services/misc/paperless.nix index fc7563e91814..db69d7424275 100644 --- a/nixos/modules/services/misc/paperless.nix +++ b/nixos/modules/services/misc/paperless.nix @@ -15,40 +15,39 @@ let enableRedis = !(cfg.settings ? PAPERLESS_REDIS); redisServer = config.services.redis.servers.paperless; - env = - { - PAPERLESS_DATA_DIR = cfg.dataDir; - PAPERLESS_MEDIA_ROOT = cfg.mediaDir; - PAPERLESS_CONSUMPTION_DIR = cfg.consumptionDir; - PAPERLESS_THUMBNAIL_FONT_NAME = defaultFont; - GRANIAN_HOST = cfg.address; - GRANIAN_PORT = toString cfg.port; - GRANIAN_WORKERS_KILL_TIMEOUT = "60"; - } - // lib.optionalAttrs (config.time.timeZone != null) { - PAPERLESS_TIME_ZONE = config.time.timeZone; - } - // lib.optionalAttrs enableRedis { - PAPERLESS_REDIS = "unix://${redisServer.unixSocket}"; - } - // lib.optionalAttrs (cfg.settings.PAPERLESS_ENABLE_NLTK or true) { - PAPERLESS_NLTK_DIR = pkgs.symlinkJoin { - name = "paperless_ngx_nltk_data"; - paths = cfg.package.nltkData; - }; - } - // lib.optionalAttrs (cfg.openMPThreadingWorkaround) { - OMP_NUM_THREADS = "1"; - } - // (lib.mapAttrs ( - _: s: - if (lib.isAttrs s || lib.isList s) then - builtins.toJSON s - else if lib.isBool s then - lib.boolToString s - else - toString s - ) cfg.settings); + env = { + PAPERLESS_DATA_DIR = cfg.dataDir; + PAPERLESS_MEDIA_ROOT = cfg.mediaDir; + PAPERLESS_CONSUMPTION_DIR = cfg.consumptionDir; + PAPERLESS_THUMBNAIL_FONT_NAME = defaultFont; + GRANIAN_HOST = cfg.address; + GRANIAN_PORT = toString cfg.port; + GRANIAN_WORKERS_KILL_TIMEOUT = "60"; + } + // lib.optionalAttrs (config.time.timeZone != null) { + PAPERLESS_TIME_ZONE = config.time.timeZone; + } + // lib.optionalAttrs enableRedis { + PAPERLESS_REDIS = "unix://${redisServer.unixSocket}"; + } + // lib.optionalAttrs (cfg.settings.PAPERLESS_ENABLE_NLTK or true) { + PAPERLESS_NLTK_DIR = pkgs.symlinkJoin { + name = "paperless_ngx_nltk_data"; + paths = cfg.package.nltkData; + }; + } + // lib.optionalAttrs (cfg.openMPThreadingWorkaround) { + OMP_NUM_THREADS = "1"; + } + // (lib.mapAttrs ( + _: s: + if (lib.isAttrs s || lib.isList s) then + builtins.toJSON s + else if lib.isBool s then + lib.boolToString s + else + toString s + ) cfg.settings); manage = pkgs.writeShellScriptBin "paperless-manage" '' set -o allexport # Export the following env vars @@ -502,7 +501,8 @@ in requires = lib.optional cfg.database.createLocally "postgresql.target"; after = [ "paperless-scheduler.service" - ] ++ lib.optional cfg.database.createLocally "postgresql.target"; + ] + ++ lib.optional cfg.database.createLocally "postgresql.target"; serviceConfig = defaultServiceConfig // { User = cfg.user; ExecStart = "${cfg.package}/bin/celery --app paperless worker --loglevel INFO"; @@ -523,7 +523,8 @@ in requires = lib.optional cfg.database.createLocally "postgresql.target"; after = [ "paperless-scheduler.service" - ] ++ lib.optional cfg.database.createLocally "postgresql.target"; + ] + ++ lib.optional cfg.database.createLocally "postgresql.target"; serviceConfig = defaultServiceConfig // { User = cfg.user; ExecStart = "${cfg.package}/bin/paperless-ngx document_consumer"; @@ -544,7 +545,8 @@ in requires = lib.optional cfg.database.createLocally "postgresql.target"; after = [ "paperless-scheduler.service" - ] ++ lib.optional cfg.database.createLocally "postgresql.target"; + ] + ++ lib.optional cfg.database.createLocally "postgresql.target"; # Setup PAPERLESS_SECRET_KEY. # If this environment variable is left unset, paperless-ngx defaults # to a well-known value, which is insecure. diff --git a/nixos/modules/services/misc/pghero.nix b/nixos/modules/services/misc/pghero.nix index 121c606a817c..fdeeac2029b3 100644 --- a/nixos/modules/services/misc/pghero.nix +++ b/nixos/modules/services/misc/pghero.nix @@ -102,7 +102,8 @@ in environment = { RAILS_ENV = "production"; PGHERO_CONFIG_PATH = settingsFile; - } // cfg.environment; + } + // cfg.environment; serviceConfig = { Type = "notify"; diff --git a/nixos/modules/services/misc/pinchflat.nix b/nixos/modules/services/misc/pinchflat.nix index a90c197b0bba..a4eee7463697 100644 --- a/nixos/modules/services/misc/pinchflat.nix +++ b/nixos/modules/services/misc/pinchflat.nix @@ -145,23 +145,22 @@ in Group = cfg.group; StateDirectory = baseNameOf stateDir; - Environment = - [ - "PORT=${builtins.toString cfg.port}" - "TZ=${config.time.timeZone}" - "MEDIA_PATH=${cfg.mediaDir}" - "CONFIG_PATH=${stateDir}" - "DATABASE_PATH=${stateDir}/db/pinchflat.db" - "LOG_PATH=${stateDir}/logs/pinchflat.log" - "METADATA_PATH=${stateDir}/metadata" - "EXTRAS_PATH=${stateDir}/extras" - "TMPFILE_PATH=${stateDir}/tmp" - "TZ_DATA_PATH=${stateDir}/extras/elixir_tz_data" - "LOG_LEVEL=${cfg.logLevel}" - "PHX_SERVER=true" - ] - ++ optional cfg.selfhosted [ "RUN_CONTEXT=selfhosted" ] - ++ attrValues (mapAttrs (name: value: name + "=" + builtins.toString value) cfg.extraConfig); + Environment = [ + "PORT=${builtins.toString cfg.port}" + "TZ=${config.time.timeZone}" + "MEDIA_PATH=${cfg.mediaDir}" + "CONFIG_PATH=${stateDir}" + "DATABASE_PATH=${stateDir}/db/pinchflat.db" + "LOG_PATH=${stateDir}/logs/pinchflat.log" + "METADATA_PATH=${stateDir}/metadata" + "EXTRAS_PATH=${stateDir}/extras" + "TMPFILE_PATH=${stateDir}/tmp" + "TZ_DATA_PATH=${stateDir}/extras/elixir_tz_data" + "LOG_LEVEL=${cfg.logLevel}" + "PHX_SERVER=true" + ] + ++ optional cfg.selfhosted [ "RUN_CONTEXT=selfhosted" ] + ++ attrValues (mapAttrs (name: value: name + "=" + builtins.toString value) cfg.extraConfig); EnvironmentFile = optional (cfg.secretsFile != null) cfg.secretsFile; ExecStartPre = "${lib.getExe' cfg.package "migrate"}"; ExecStart = "${getExe cfg.package} start"; diff --git a/nixos/modules/services/misc/portunus.nix b/nixos/modules/services/misc/portunus.nix index 33a49fb25ee7..022efc5b9839 100644 --- a/nixos/modules/services/misc/portunus.nix +++ b/nixos/modules/services/misc/portunus.nix @@ -263,34 +263,33 @@ in ExecStart = "${cfg.package}/bin/portunus-orchestrator"; Restart = "on-failure"; }; - environment = + environment = { + PORTUNUS_LDAP_SUFFIX = cfg.ldap.suffix; + PORTUNUS_SERVER_BINARY = "${cfg.package}/bin/portunus-server"; + PORTUNUS_SERVER_GROUP = cfg.group; + PORTUNUS_SERVER_USER = cfg.user; + PORTUNUS_SERVER_HTTP_LISTEN = "127.0.0.1:${toString cfg.port}"; + PORTUNUS_SERVER_STATE_DIR = cfg.stateDir; + PORTUNUS_SLAPD_BINARY = "${cfg.ldap.package}/libexec/slapd"; + PORTUNUS_SLAPD_GROUP = cfg.ldap.group; + PORTUNUS_SLAPD_USER = cfg.ldap.user; + PORTUNUS_SLAPD_SCHEMA_DIR = "${cfg.ldap.package}/etc/schema"; + } + // (lib.optionalAttrs (cfg.seedPath != null) ({ + PORTUNUS_SEED_PATH = cfg.seedPath; + })) + // (lib.optionalAttrs cfg.ldap.tls ( + let + acmeDirectory = config.security.acme.certs."${cfg.domain}".directory; + in { - PORTUNUS_LDAP_SUFFIX = cfg.ldap.suffix; - PORTUNUS_SERVER_BINARY = "${cfg.package}/bin/portunus-server"; - PORTUNUS_SERVER_GROUP = cfg.group; - PORTUNUS_SERVER_USER = cfg.user; - PORTUNUS_SERVER_HTTP_LISTEN = "127.0.0.1:${toString cfg.port}"; - PORTUNUS_SERVER_STATE_DIR = cfg.stateDir; - PORTUNUS_SLAPD_BINARY = "${cfg.ldap.package}/libexec/slapd"; - PORTUNUS_SLAPD_GROUP = cfg.ldap.group; - PORTUNUS_SLAPD_USER = cfg.ldap.user; - PORTUNUS_SLAPD_SCHEMA_DIR = "${cfg.ldap.package}/etc/schema"; + PORTUNUS_SERVER_HTTP_SECURE = "true"; + PORTUNUS_SLAPD_TLS_CA_CERTIFICATE = config.security.pki.caBundle; + PORTUNUS_SLAPD_TLS_CERTIFICATE = "${acmeDirectory}/cert.pem"; + PORTUNUS_SLAPD_TLS_DOMAIN_NAME = cfg.domain; + PORTUNUS_SLAPD_TLS_PRIVATE_KEY = "${acmeDirectory}/key.pem"; } - // (lib.optionalAttrs (cfg.seedPath != null) ({ - PORTUNUS_SEED_PATH = cfg.seedPath; - })) - // (lib.optionalAttrs cfg.ldap.tls ( - let - acmeDirectory = config.security.acme.certs."${cfg.domain}".directory; - in - { - PORTUNUS_SERVER_HTTP_SECURE = "true"; - PORTUNUS_SLAPD_TLS_CA_CERTIFICATE = config.security.pki.caBundle; - PORTUNUS_SLAPD_TLS_CERTIFICATE = "${acmeDirectory}/cert.pem"; - PORTUNUS_SLAPD_TLS_DOMAIN_NAME = cfg.domain; - PORTUNUS_SLAPD_TLS_PRIVATE_KEY = "${acmeDirectory}/key.pem"; - } - )); + )); }; }; diff --git a/nixos/modules/services/misc/redlib.nix b/nixos/modules/services/misc/redlib.nix index 5e3529fbc846..e3158fbad43a 100644 --- a/nixos/modules/services/misc/redlib.nix +++ b/nixos/modules/services/misc/redlib.nix @@ -93,68 +93,67 @@ in systemd.services.redlib = { wantedBy = [ "default.target" ]; environment = mapAttrs (_: v: if isBool v then boolToString' v else toString v) cfg.settings; - serviceConfig = - { - # Hardening - LockPersonality = true; - MemoryDenyWriteExecute = true; - NoNewPrivileges = true; - PrivateDevices = true; - PrivateIPC = true; - PrivateTmp = true; - ProcSubset = "pid"; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHome = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - ProtectSystem = "full"; - RemoveIPC = true; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - ]; - RestrictNamespaces = true; - RestrictRealtime = true; - RestrictSUIDSGID = true; - SystemCallArchitectures = "native"; - SystemCallFilter = [ - "~@mount" - "~@swap" - "~@resources" - "~@reboot" - "~@raw-io" - "~@obsolete" - "~@module" - "~@debug" - "~@cpu-emulation" - "~@clock" - "~@privileged" - ]; - UMask = "0027"; + serviceConfig = { + # Hardening + LockPersonality = true; + MemoryDenyWriteExecute = true; + NoNewPrivileges = true; + PrivateDevices = true; + PrivateIPC = true; + PrivateTmp = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + ProtectSystem = "full"; + RemoveIPC = true; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + SystemCallFilter = [ + "~@mount" + "~@swap" + "~@resources" + "~@reboot" + "~@raw-io" + "~@obsolete" + "~@module" + "~@debug" + "~@cpu-emulation" + "~@clock" + "~@privileged" + ]; + UMask = "0027"; - ExecStart = [ - "" - "${lib.getExe cfg.package} ${args}" - ]; - } - // ( - if (cfg.port < 1024) then - { - AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; - CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; - } - else - { - # A private user cannot have process capabilities on the host's user - # namespace and thus CAP_NET_BIND_SERVICE has no effect. - PrivateUsers = true; - CapabilityBoundingSet = false; - } - ); + ExecStart = [ + "" + "${lib.getExe cfg.package} ${args}" + ]; + } + // ( + if (cfg.port < 1024) then + { + AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; + CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; + } + else + { + # A private user cannot have process capabilities on the host's user + # namespace and thus CAP_NET_BIND_SERVICE has no effect. + PrivateUsers = true; + CapabilityBoundingSet = false; + } + ); }; networking.firewall = mkIf cfg.openFirewall { diff --git a/nixos/modules/services/misc/redmine.nix b/nixos/modules/services/misc/redmine.nix index 7a736d3caa7b..5771c766d285 100644 --- a/nixos/modules/services/misc/redmine.nix +++ b/nixos/modules/services/misc/redmine.nix @@ -11,27 +11,26 @@ let bundle = "${cfg.package}/share/redmine/bin/bundle"; databaseSettings = { - production = - { - adapter = cfg.database.type; - database = - if cfg.database.type == "sqlite3" then "${cfg.stateDir}/database.sqlite3" else cfg.database.name; - } - // lib.optionalAttrs (cfg.database.type != "sqlite3") { - host = - if (cfg.database.type == "postgresql" && cfg.database.socket != null) then - cfg.database.socket - else - cfg.database.host; - port = cfg.database.port; - username = cfg.database.user; - } - // lib.optionalAttrs (cfg.database.type != "sqlite3" && cfg.database.passwordFile != null) { - password = "#dbpass#"; - } - // lib.optionalAttrs (cfg.database.type == "mysql2" && cfg.database.socket != null) { - socket = cfg.database.socket; - }; + production = { + adapter = cfg.database.type; + database = + if cfg.database.type == "sqlite3" then "${cfg.stateDir}/database.sqlite3" else cfg.database.name; + } + // lib.optionalAttrs (cfg.database.type != "sqlite3") { + host = + if (cfg.database.type == "postgresql" && cfg.database.socket != null) then + cfg.database.socket + else + cfg.database.host; + port = cfg.database.port; + username = cfg.database.user; + } + // lib.optionalAttrs (cfg.database.type != "sqlite3" && cfg.database.passwordFile != null) { + password = "#dbpass#"; + } + // lib.optionalAttrs (cfg.database.type == "mysql2" && cfg.database.socket != null) { + socket = cfg.database.socket; + }; }; databaseYml = format.generate "database.yml" databaseSettings; @@ -371,10 +370,11 @@ in ]; systemd.services.redmine = { - after = - [ "network.target" ] - ++ lib.optional mysqlLocal "mysql.service" - ++ lib.optional pgsqlLocal "postgresql.target"; + after = [ + "network.target" + ] + ++ lib.optional mysqlLocal "mysql.service" + ++ lib.optional pgsqlLocal "postgresql.target"; wantedBy = [ "multi-user.target" ]; environment.RAILS_ENV = "production"; environment.RAILS_CACHE = "${cfg.stateDir}/cache"; diff --git a/nixos/modules/services/misc/renovate.nix b/nixos/modules/services/misc/renovate.nix index 5539f17db4c6..3966e0579662 100644 --- a/nixos/modules/services/misc/renovate.nix +++ b/nixos/modules/services/misc/renovate.nix @@ -129,7 +129,8 @@ in path = [ config.systemd.package pkgs.git - ] ++ cfg.runtimePackages; + ] + ++ cfg.runtimePackages; inherit (cfg) environment; serviceConfig = { diff --git a/nixos/modules/services/misc/rmfakecloud.nix b/nixos/modules/services/misc/rmfakecloud.nix index ec3ecc612fec..674309ddbf45 100644 --- a/nixos/modules/services/misc/rmfakecloud.nix +++ b/nixos/modules/services/misc/rmfakecloud.nix @@ -83,7 +83,8 @@ in STORAGE_URL = cfg.storageUrl; PORT = toString cfg.port; LOGLEVEL = cfg.logLevel; - } // cfg.extraSettings; + } + // cfg.extraSettings; preStart = '' # Generate the secret key used to sign client session tokens. diff --git a/nixos/modules/services/misc/rshim.nix b/nixos/modules/services/misc/rshim.nix index e52135893b41..49296f0e2f05 100644 --- a/nixos/modules/services/misc/rshim.nix +++ b/nixos/modules/services/misc/rshim.nix @@ -8,12 +8,13 @@ let cfg = config.services.rshim; - rshimCommand = - [ "${cfg.package}/bin/rshim" ] - ++ lib.optionals (cfg.backend != null) [ "--backend ${cfg.backend}" ] - ++ lib.optionals (cfg.device != null) [ "--device ${cfg.device}" ] - ++ lib.optionals (cfg.index != null) [ "--index ${builtins.toString cfg.index}" ] - ++ [ "--log-level ${builtins.toString cfg.log-level}" ]; + rshimCommand = [ + "${cfg.package}/bin/rshim" + ] + ++ lib.optionals (cfg.backend != null) [ "--backend ${cfg.backend}" ] + ++ lib.optionals (cfg.device != null) [ "--device ${cfg.device}" ] + ++ lib.optionals (cfg.index != null) [ "--index ${builtins.toString cfg.index}" ] + ++ [ "--log-level ${builtins.toString cfg.log-level}" ]; in { options.services.rshim = { diff --git a/nixos/modules/services/misc/snapper.nix b/nixos/modules/services/misc/snapper.nix index 7a0c291dbfb0..8f189b22019d 100644 --- a/nixos/modules/services/misc/snapper.nix +++ b/nixos/modules/services/misc/snapper.nix @@ -257,22 +257,21 @@ in # Note: snapper/config-templates/default is only needed for create-config # which is not the NixOS way to configure. - etc = - { + etc = { - "sysconfig/snapper".text = '' - SNAPPER_CONFIGS="${lib.concatStringsSep " " (builtins.attrNames cfg.configs)}" - ''; - } - // (lib.mapAttrs' ( - name: subvolume: - lib.nameValuePair "snapper/configs/${name}" ({ - text = lib.generators.toKeyValue { inherit mkKeyValue; } ( - lib.filterAttrs (k: v: v != defaultOf k) subvolume - ); - }) - ) cfg.configs) - // (lib.optionalAttrs (cfg.filters != null) { "snapper/filters/default.txt".text = cfg.filters; }); + "sysconfig/snapper".text = '' + SNAPPER_CONFIGS="${lib.concatStringsSep " " (builtins.attrNames cfg.configs)}" + ''; + } + // (lib.mapAttrs' ( + name: subvolume: + lib.nameValuePair "snapper/configs/${name}" ({ + text = lib.generators.toKeyValue { inherit mkKeyValue; } ( + lib.filterAttrs (k: v: v != defaultOf k) subvolume + ); + }) + ) cfg.configs) + // (lib.optionalAttrs (cfg.filters != null) { "snapper/filters/default.txt".text = cfg.filters; }); }; services.dbus.packages = [ pkgs.snapper ]; diff --git a/nixos/modules/services/misc/tandoor-recipes.nix b/nixos/modules/services/misc/tandoor-recipes.nix index 6984b1ea7949..0898c32cf6ad 100644 --- a/nixos/modules/services/misc/tandoor-recipes.nix +++ b/nixos/modules/services/misc/tandoor-recipes.nix @@ -9,17 +9,16 @@ let pkg = cfg.package; # SECRET_KEY through an env file - env = - { - GUNICORN_CMD_ARGS = "--bind=${cfg.address}:${toString cfg.port}"; - DEBUG = "0"; - DEBUG_TOOLBAR = "0"; - MEDIA_ROOT = "/var/lib/tandoor-recipes"; - } - // lib.optionalAttrs (config.time.timeZone != null) { - TZ = config.time.timeZone; - } - // (lib.mapAttrs (_: toString) cfg.extraConfig); + env = { + GUNICORN_CMD_ARGS = "--bind=${cfg.address}:${toString cfg.port}"; + DEBUG = "0"; + DEBUG_TOOLBAR = "0"; + MEDIA_ROOT = "/var/lib/tandoor-recipes"; + } + // lib.optionalAttrs (config.time.timeZone != null) { + TZ = config.time.timeZone; + } + // (lib.mapAttrs (_: toString) cfg.extraConfig); manage = pkgs.writeShellScript "manage" '' set -o allexport # Export the following env vars diff --git a/nixos/modules/services/misc/taskserver/default.nix b/nixos/modules/services/misc/taskserver/default.nix index 72fff29e1052..c21b4384ba43 100644 --- a/nixos/modules/services/misc/taskserver/default.nix +++ b/nixos/modules/services/misc/taskserver/default.nix @@ -476,24 +476,23 @@ in # server trust = cfg.trust; - server = - { - listen = "${cfg.listenHost}:${toString cfg.listenPort}"; - } - // ( - if needToCreateCA then - { - cert = "${cfg.dataDir}/keys/server.cert"; - key = "${cfg.dataDir}/keys/server.key"; - crl = "${cfg.dataDir}/keys/server.crl"; - } - else - { - cert = "${cfg.pki.manual.server.cert}"; - key = "${cfg.pki.manual.server.key}"; - ${lib.mapNullable (_: "crl") cfg.pki.manual.server.crl} = "${cfg.pki.manual.server.crl}"; - } - ); + server = { + listen = "${cfg.listenHost}:${toString cfg.listenPort}"; + } + // ( + if needToCreateCA then + { + cert = "${cfg.dataDir}/keys/server.cert"; + key = "${cfg.dataDir}/keys/server.key"; + crl = "${cfg.dataDir}/keys/server.crl"; + } + else + { + cert = "${cfg.pki.manual.server.cert}"; + key = "${cfg.pki.manual.server.key}"; + ${lib.mapNullable (_: "crl") cfg.pki.manual.server.crl} = "${cfg.pki.manual.server.crl}"; + } + ); ca.cert = if needToCreateCA then "${cfg.dataDir}/keys/ca.cert" else "${cfg.pki.manual.ca.cert}"; }; diff --git a/nixos/modules/services/misc/transfer-sh.nix b/nixos/modules/services/misc/transfer-sh.nix index 0433f8971507..b5ab11883f7a 100644 --- a/nixos/modules/services/misc/transfer-sh.nix +++ b/nixos/modules/services/misc/transfer-sh.nix @@ -85,50 +85,48 @@ in stateDirectory = "/var/lib/transfer.sh"; in mkIf cfg.enable { - services.transfer-sh.settings = - { - LISTENER = mkDefault ":8080"; - } - // optionalAttrs localProvider { - BASEDIR = mkDefault stateDirectory; - }; + services.transfer-sh.settings = { + LISTENER = mkDefault ":8080"; + } + // optionalAttrs localProvider { + BASEDIR = mkDefault stateDirectory; + }; systemd.services.transfer-sh = { after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; environment = mapAttrs (_: v: if isBool v then boolToString v else toString v) cfg.settings; - serviceConfig = - { - DevicePolicy = "closed"; - DynamicUser = true; - ExecStart = "${getExe cfg.package} --provider ${cfg.provider}"; - LockPersonality = true; - MemoryDenyWriteExecute = true; - PrivateDevices = true; - PrivateUsers = true; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - ]; - RestrictNamespaces = true; - RestrictRealtime = true; - SystemCallArchitectures = [ "native" ]; - SystemCallFilter = [ "@system-service" ]; - StateDirectory = baseNameOf stateDirectory; - } - // optionalAttrs (cfg.secretFile != null) { - EnvironmentFile = cfg.secretFile; - } - // optionalAttrs localProvider { - ReadWritePaths = cfg.settings.BASEDIR; - }; + serviceConfig = { + DevicePolicy = "closed"; + DynamicUser = true; + ExecStart = "${getExe cfg.package} --provider ${cfg.provider}"; + LockPersonality = true; + MemoryDenyWriteExecute = true; + PrivateDevices = true; + PrivateUsers = true; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + RestrictRealtime = true; + SystemCallArchitectures = [ "native" ]; + SystemCallFilter = [ "@system-service" ]; + StateDirectory = baseNameOf stateDirectory; + } + // optionalAttrs (cfg.secretFile != null) { + EnvironmentFile = cfg.secretFile; + } + // optionalAttrs localProvider { + ReadWritePaths = cfg.settings.BASEDIR; + }; }; }; diff --git a/nixos/modules/services/misc/wastebin.nix b/nixos/modules/services/misc/wastebin.nix index c24067a50d03..54da1b10243d 100644 --- a/nixos/modules/services/misc/wastebin.nix +++ b/nixos/modules/services/misc/wastebin.nix @@ -143,36 +143,35 @@ in after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; environment = mapAttrs (_: v: if isBool v then boolToString v else toString v) cfg.settings; - serviceConfig = - { - DevicePolicy = "closed"; - DynamicUser = true; - ExecStart = "${getExe cfg.package}"; - LockPersonality = true; - MemoryDenyWriteExecute = true; - PrivateDevices = true; - PrivateUsers = true; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - ]; - RestrictNamespaces = true; - RestrictRealtime = true; - SystemCallArchitectures = [ "native" ]; - SystemCallFilter = [ "@system-service" ]; - StateDirectory = baseNameOf cfg.stateDir; - ReadWritePaths = cfg.stateDir; - } - // optionalAttrs (cfg.secretFile != null) { - EnvironmentFile = cfg.secretFile; - }; + serviceConfig = { + DevicePolicy = "closed"; + DynamicUser = true; + ExecStart = "${getExe cfg.package}"; + LockPersonality = true; + MemoryDenyWriteExecute = true; + PrivateDevices = true; + PrivateUsers = true; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + RestrictRealtime = true; + SystemCallArchitectures = [ "native" ]; + SystemCallFilter = [ "@system-service" ]; + StateDirectory = baseNameOf cfg.stateDir; + ReadWritePaths = cfg.stateDir; + } + // optionalAttrs (cfg.secretFile != null) { + EnvironmentFile = cfg.secretFile; + }; }; }; diff --git a/nixos/modules/services/misc/workout-tracker.nix b/nixos/modules/services/misc/workout-tracker.nix index 13555504be30..617363e6c398 100644 --- a/nixos/modules/services/misc/workout-tracker.nix +++ b/nixos/modules/services/misc/workout-tracker.nix @@ -67,7 +67,8 @@ in WT_BIND = "${cfg.address}:${toString cfg.port}"; WT_DATABASE_DRIVER = "sqlite"; WT_DSN = "./database.db"; - } // cfg.settings; + } + // cfg.settings; serviceConfig = { ExecStart = lib.getExe cfg.package; DynamicUser = true; diff --git a/nixos/modules/services/monitoring/datadog-agent.nix b/nixos/modules/services/monitoring/datadog-agent.nix index 431c8fcadcdb..dd943d4cf7dd 100644 --- a/nixos/modules/services/monitoring/datadog-agent.nix +++ b/nixos/modules/services/monitoring/datadog-agent.nix @@ -7,31 +7,30 @@ let cfg = config.services.datadog-agent; - ddConf = - { - skip_ssl_validation = false; - confd_path = "/etc/datadog-agent/conf.d"; - additional_checksd = "/etc/datadog-agent/checks.d"; - use_dogstatsd = true; - } - // lib.optionalAttrs (cfg.logLevel != null) { log_level = cfg.logLevel; } - // lib.optionalAttrs (cfg.hostname != null) { inherit (cfg) hostname; } - // lib.optionalAttrs (cfg.ddUrl != null) { dd_url = cfg.ddUrl; } - // lib.optionalAttrs (cfg.site != null) { site = cfg.site; } - // lib.optionalAttrs (cfg.tags != null) { tags = lib.concatStringsSep ", " cfg.tags; } - // lib.optionalAttrs (cfg.enableLiveProcessCollection) { - process_config = { - dd_agent_bin = "${datadogPkg}/bin/agent"; - process_collection.enabled = "true"; - container_collection.enabled = "true"; - }; - } - // lib.optionalAttrs (cfg.enableTraceAgent) { - apm_config = { - enabled = true; - }; - } - // cfg.extraConfig; + ddConf = { + skip_ssl_validation = false; + confd_path = "/etc/datadog-agent/conf.d"; + additional_checksd = "/etc/datadog-agent/checks.d"; + use_dogstatsd = true; + } + // lib.optionalAttrs (cfg.logLevel != null) { log_level = cfg.logLevel; } + // lib.optionalAttrs (cfg.hostname != null) { inherit (cfg) hostname; } + // lib.optionalAttrs (cfg.ddUrl != null) { dd_url = cfg.ddUrl; } + // lib.optionalAttrs (cfg.site != null) { site = cfg.site; } + // lib.optionalAttrs (cfg.tags != null) { tags = lib.concatStringsSep ", " cfg.tags; } + // lib.optionalAttrs (cfg.enableLiveProcessCollection) { + process_config = { + dd_agent_bin = "${datadogPkg}/bin/agent"; + process_collection.enabled = "true"; + container_collection.enabled = "true"; + }; + } + // lib.optionalAttrs (cfg.enableTraceAgent) { + apm_config = { + enabled = true; + }; + } + // cfg.extraConfig; # Generate Datadog configuration files for each configured checks. # This works because check configurations have predictable paths, diff --git a/nixos/modules/services/monitoring/goss.nix b/nixos/modules/services/monitoring/goss.nix index b53df0806d26..9ed2a3d078ad 100644 --- a/nixos/modules/services/monitoring/goss.nix +++ b/nixos/modules/services/monitoring/goss.nix @@ -74,7 +74,8 @@ in environment = { GOSS_FILE = configFile; - } // cfg.environment; + } + // cfg.environment; reloadTriggers = [ configFile ]; diff --git a/nixos/modules/services/monitoring/grafana-to-ntfy.nix b/nixos/modules/services/monitoring/grafana-to-ntfy.nix index 66e338d7b2c6..db35792363b8 100644 --- a/nixos/modules/services/monitoring/grafana-to-ntfy.nix +++ b/nixos/modules/services/monitoring/grafana-to-ntfy.nix @@ -70,23 +70,21 @@ in exec ${lib.getExe cfg.package} ''; - environment = - { - NTFY_URL = cfg.settings.ntfyUrl; - BAUTH_USER = cfg.settings.bauthUser; - } - // lib.optionalAttrs (cfg.settings.ntfyBAuthUser != null) { - NTFY_BAUTH_USER = cfg.settings.ntfyBAuthUser; - }; + environment = { + NTFY_URL = cfg.settings.ntfyUrl; + BAUTH_USER = cfg.settings.bauthUser; + } + // lib.optionalAttrs (cfg.settings.ntfyBAuthUser != null) { + NTFY_BAUTH_USER = cfg.settings.ntfyBAuthUser; + }; serviceConfig = { - LoadCredential = - [ - "BAUTH_PASS_FILE:${cfg.settings.bauthPass}" - ] - ++ lib.optional ( - cfg.settings.ntfyBAuthPass != null - ) "NTFY_BAUTH_PASS_FILE:${cfg.settings.ntfyBAuthPass}"; + LoadCredential = [ + "BAUTH_PASS_FILE:${cfg.settings.bauthPass}" + ] + ++ lib.optional ( + cfg.settings.ntfyBAuthPass != null + ) "NTFY_BAUTH_PASS_FILE:${cfg.settings.ntfyBAuthPass}"; DynamicUser = true; CapabilityBoundingSet = [ "" ]; diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index eccd7ef05fa7..cccbd7e53772 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -2018,10 +2018,11 @@ in systemd.services.grafana = { description = "Grafana Service Daemon"; wantedBy = [ "multi-user.target" ]; - after = - [ "networking.target" ] - ++ lib.optional usePostgresql "postgresql.target" - ++ lib.optional useMysql "mysql.service"; + after = [ + "networking.target" + ] + ++ lib.optional usePostgresql "postgresql.target" + ++ lib.optional useMysql "mysql.service"; script = '' set -o errexit -o pipefail -o nounset -o errtrace shopt -s inherit_errexit @@ -2067,7 +2068,8 @@ in SystemCallFilter = [ "@system-service" "~@privileged" - ] ++ lib.optionals (cfg.settings.server.protocol == "socket") [ "@chown" ]; + ] + ++ lib.optionals (cfg.settings.server.protocol == "socket") [ "@chown" ]; UMask = "0027"; }; preStart = '' diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix index fc65c07e5dfa..16d68279df3f 100644 --- a/nixos/modules/services/monitoring/graphite.nix +++ b/nixos/modules/services/monitoring/graphite.nix @@ -34,7 +34,8 @@ let SEYREN_URL = cfg.seyren.seyrenUrl; MONGO_URL = cfg.seyren.mongoUrl; GRAPHITE_URL = cfg.seyren.graphiteUrl; - } // cfg.seyren.extraConfig; + } + // cfg.seyren.extraConfig; configDir = pkgs.buildEnv { name = "graphite-config"; diff --git a/nixos/modules/services/monitoring/librenms.nix b/nixos/modules/services/monitoring/librenms.nix index 042c43fd7b65..ef3593cf038c 100644 --- a/nixos/modules/services/monitoring/librenms.nix +++ b/nixos/modules/services/monitoring/librenms.nix @@ -399,48 +399,47 @@ in users.groups.${cfg.group} = { }; - services.librenms.settings = - { - # basic configs - "user" = cfg.user; - "own_hostname" = cfg.hostname; - "base_url" = lib.mkDefault "/"; - "auth_mechanism" = lib.mkDefault "mysql"; + services.librenms.settings = { + # basic configs + "user" = cfg.user; + "own_hostname" = cfg.hostname; + "base_url" = lib.mkDefault "/"; + "auth_mechanism" = lib.mkDefault "mysql"; - # disable auto update function (won't work with NixOS) - "update" = false; + # disable auto update function (won't work with NixOS) + "update" = false; - # enable fast ping by default - "ping_rrd_step" = 60; + # enable fast ping by default + "ping_rrd_step" = 60; - # set default memory limit to 1G - "php_memory_limit" = lib.mkDefault 1024; + # set default memory limit to 1G + "php_memory_limit" = lib.mkDefault 1024; - # one minute polling - "rrd.step" = if cfg.enableOneMinutePolling then 60 else 300; - "rrd.heartbeat" = if cfg.enableOneMinutePolling then 120 else 600; - } - // (lib.optionalAttrs cfg.distributedPoller.enable { - "distributed_poller" = true; - "distributed_poller_name" = lib.mkIf ( - cfg.distributedPoller.name != null - ) cfg.distributedPoller.name; - "distributed_poller_group" = cfg.distributedPoller.group; - "distributed_billing" = cfg.distributedPoller.distributedBilling; - "distributed_poller_memcached_host" = cfg.distributedPoller.memcachedHost; - "distributed_poller_memcached_port" = cfg.distributedPoller.memcachedPort; - "rrdcached" = - "${cfg.distributedPoller.rrdcachedHost}:${toString cfg.distributedPoller.rrdcachedPort}"; - }) - // (lib.optionalAttrs cfg.useDistributedPollers { - "distributed_poller" = true; - # still enable a local poller with distributed polling - "distributed_poller_group" = lib.mkDefault "0"; - "distributed_billing" = lib.mkDefault true; - "distributed_poller_memcached_host" = "localhost"; - "distributed_poller_memcached_port" = 11211; - "rrdcached" = "localhost:42217"; - }); + # one minute polling + "rrd.step" = if cfg.enableOneMinutePolling then 60 else 300; + "rrd.heartbeat" = if cfg.enableOneMinutePolling then 120 else 600; + } + // (lib.optionalAttrs cfg.distributedPoller.enable { + "distributed_poller" = true; + "distributed_poller_name" = lib.mkIf ( + cfg.distributedPoller.name != null + ) cfg.distributedPoller.name; + "distributed_poller_group" = cfg.distributedPoller.group; + "distributed_billing" = cfg.distributedPoller.distributedBilling; + "distributed_poller_memcached_host" = cfg.distributedPoller.memcachedHost; + "distributed_poller_memcached_port" = cfg.distributedPoller.memcachedPort; + "rrdcached" = + "${cfg.distributedPoller.rrdcachedHost}:${toString cfg.distributedPoller.rrdcachedPort}"; + }) + // (lib.optionalAttrs cfg.useDistributedPollers { + "distributed_poller" = true; + # still enable a local poller with distributed polling + "distributed_poller_group" = lib.mkDefault "0"; + "distributed_billing" = lib.mkDefault true; + "distributed_poller_memcached_host" = "localhost"; + "distributed_poller_memcached_port" = 11211; + "rrdcached" = "localhost:42217"; + }); services.memcached = lib.mkIf cfg.useDistributedPollers { enable = true; @@ -466,14 +465,13 @@ in services.mysql = lib.mkIf cfg.database.createLocally { enable = true; package = lib.mkDefault pkgs.mariadb; - settings.mysqld = - { - innodb_file_per_table = 1; - lower_case_table_names = 0; - } - // (lib.optionalAttrs cfg.useDistributedPollers { - bind-address = "0.0.0.0"; - }); + settings.mysqld = { + innodb_file_per_table = 1; + lower_case_table_names = 0; + } + // (lib.optionalAttrs cfg.useDistributedPollers { + bind-address = "0.0.0.0"; + }); ensureDatabases = [ cfg.database.database ]; ensureUsers = [ { @@ -518,7 +516,8 @@ in "listen.mode" = "0660"; "listen.owner" = config.services.nginx.user; "listen.group" = config.services.nginx.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; systemd.services.librenms-scheduler = { @@ -548,7 +547,8 @@ in after = [ "systemd-tmpfiles-setup.service" "network.target" - ] ++ (lib.optional (cfg.database.host == "localhost") "mysql.service"); + ] + ++ (lib.optional (cfg.database.host == "localhost") "mysql.service"); wantedBy = [ "multi-user.target" ]; restartTriggers = [ package @@ -587,89 +587,88 @@ in }" ]; }; - script = - '' - set -euo pipefail + script = '' + set -euo pipefail - # config setup - ln -sf ${configFile} ${cfg.dataDir}/config.php - ${pkgs.envsubst}/bin/envsubst -i ${configJson} -o ${cfg.dataDir}/config.json - export PHPRC=${phpIni} + # config setup + ln -sf ${configFile} ${cfg.dataDir}/config.php + ${pkgs.envsubst}/bin/envsubst -i ${configJson} -o ${cfg.dataDir}/config.json + export PHPRC=${phpIni} - INIT=false - if [[ ! -s ${cfg.dataDir}/.env ]]; then - INIT=true - # init .env file - echo "APP_KEY=" > ${cfg.dataDir}/.env - ${artisanWrapper}/bin/librenms-artisan key:generate --ansi - ${artisanWrapper}/bin/librenms-artisan webpush:vapid - echo "" >> ${cfg.dataDir}/.env - echo -n "NODE_ID=" >> ${cfg.dataDir}/.env - ${package.phpPackage}/bin/php -r "echo uniqid();" >> ${cfg.dataDir}/.env - echo "" >> ${cfg.dataDir}/.env - else - # .env file already exists --> only update database and cache config - ${pkgs.gnused}/bin/sed -i /^DB_/d ${cfg.dataDir}/.env - ${pkgs.gnused}/bin/sed -i /^CACHE_DRIVER/d ${cfg.dataDir}/.env - fi - ${lib.optionalString (cfg.useDistributedPollers || cfg.distributedPoller.enable) '' - echo "CACHE_DRIVER=memcached" >> ${cfg.dataDir}/.env - ''} - echo "DB_DATABASE=${cfg.database.database}" >> ${cfg.dataDir}/.env - '' - + ( - if !isNull cfg.database.socket then - '' - # use socket connection - echo "DB_SOCKET=${cfg.database.socket}" >> ${cfg.dataDir}/.env - echo "DB_PASSWORD=null" >> ${cfg.dataDir}/.env - '' - else - '' - # use TCP connection - echo "DB_HOST=${cfg.database.host}" >> ${cfg.dataDir}/.env - echo "DB_PORT=${toString cfg.database.port}" >> ${cfg.dataDir}/.env - echo "DB_USERNAME=${cfg.database.username}" >> ${cfg.dataDir}/.env - echo -n "DB_PASSWORD=" >> ${cfg.dataDir}/.env - cat ${cfg.database.passwordFile} >> ${cfg.dataDir}/.env - '' - ) - + '' - # clear cache if package has changed (cache may contain cached paths - # to the old package) - OLD_PACKAGE=$(cat ${cfg.dataDir}/package) - if [[ $OLD_PACKAGE != "${package}" ]]; then - rm -r ${cfg.dataDir}/cache/* - fi + INIT=false + if [[ ! -s ${cfg.dataDir}/.env ]]; then + INIT=true + # init .env file + echo "APP_KEY=" > ${cfg.dataDir}/.env + ${artisanWrapper}/bin/librenms-artisan key:generate --ansi + ${artisanWrapper}/bin/librenms-artisan webpush:vapid + echo "" >> ${cfg.dataDir}/.env + echo -n "NODE_ID=" >> ${cfg.dataDir}/.env + ${package.phpPackage}/bin/php -r "echo uniqid();" >> ${cfg.dataDir}/.env + echo "" >> ${cfg.dataDir}/.env + else + # .env file already exists --> only update database and cache config + ${pkgs.gnused}/bin/sed -i /^DB_/d ${cfg.dataDir}/.env + ${pkgs.gnused}/bin/sed -i /^CACHE_DRIVER/d ${cfg.dataDir}/.env + fi + ${lib.optionalString (cfg.useDistributedPollers || cfg.distributedPoller.enable) '' + echo "CACHE_DRIVER=memcached" >> ${cfg.dataDir}/.env + ''} + echo "DB_DATABASE=${cfg.database.database}" >> ${cfg.dataDir}/.env + '' + + ( + if !isNull cfg.database.socket then + '' + # use socket connection + echo "DB_SOCKET=${cfg.database.socket}" >> ${cfg.dataDir}/.env + echo "DB_PASSWORD=null" >> ${cfg.dataDir}/.env + '' + else + '' + # use TCP connection + echo "DB_HOST=${cfg.database.host}" >> ${cfg.dataDir}/.env + echo "DB_PORT=${toString cfg.database.port}" >> ${cfg.dataDir}/.env + echo "DB_USERNAME=${cfg.database.username}" >> ${cfg.dataDir}/.env + echo -n "DB_PASSWORD=" >> ${cfg.dataDir}/.env + cat ${cfg.database.passwordFile} >> ${cfg.dataDir}/.env + '' + ) + + '' + # clear cache if package has changed (cache may contain cached paths + # to the old package) + OLD_PACKAGE=$(cat ${cfg.dataDir}/package) + if [[ $OLD_PACKAGE != "${package}" ]]; then + rm -r ${cfg.dataDir}/cache/* + fi - # convert rrd files when the oneMinutePolling option is changed - OLD_ENABLED=$(cat ${cfg.dataDir}/one_minute_enabled) - if [[ $OLD_ENABLED != "${lib.boolToString cfg.enableOneMinutePolling}" ]]; then - ${package}/scripts/rrdstep.php -h all - echo "${lib.boolToString cfg.enableOneMinutePolling}" > ${cfg.dataDir}/one_minute_enabled - fi + # convert rrd files when the oneMinutePolling option is changed + OLD_ENABLED=$(cat ${cfg.dataDir}/one_minute_enabled) + if [[ $OLD_ENABLED != "${lib.boolToString cfg.enableOneMinutePolling}" ]]; then + ${package}/scripts/rrdstep.php -h all + echo "${lib.boolToString cfg.enableOneMinutePolling}" > ${cfg.dataDir}/one_minute_enabled + fi - # migrate db if package version has changed - # not necessary for every package change - OLD_VERSION=$(cat ${cfg.dataDir}/version) - if [[ $OLD_VERSION != "${package.version}" ]]; then - ${artisanWrapper}/bin/librenms-artisan migrate --force --no-interaction - echo "${package.version}" > ${cfg.dataDir}/version - fi + # migrate db if package version has changed + # not necessary for every package change + OLD_VERSION=$(cat ${cfg.dataDir}/version) + if [[ $OLD_VERSION != "${package.version}" ]]; then + ${artisanWrapper}/bin/librenms-artisan migrate --force --no-interaction + echo "${package.version}" > ${cfg.dataDir}/version + fi - if [[ $INIT == "true" ]]; then - ${artisanWrapper}/bin/librenms-artisan db:seed --force --no-interaction - fi + if [[ $INIT == "true" ]]; then + ${artisanWrapper}/bin/librenms-artisan db:seed --force --no-interaction + fi - # regenerate cache if package has changed - if [[ $OLD_PACKAGE != "${package}" ]]; then - ${artisanWrapper}/bin/librenms-artisan view:clear - ${artisanWrapper}/bin/librenms-artisan optimize:clear - ${artisanWrapper}/bin/librenms-artisan view:cache - ${artisanWrapper}/bin/librenms-artisan optimize - echo "${package}" > ${cfg.dataDir}/package - fi - ''; + # regenerate cache if package has changed + if [[ $OLD_PACKAGE != "${package}" ]]; then + ${artisanWrapper}/bin/librenms-artisan view:clear + ${artisanWrapper}/bin/librenms-artisan optimize:clear + ${artisanWrapper}/bin/librenms-artisan view:cache + ${artisanWrapper}/bin/librenms-artisan optimize + echo "${package}" > ${cfg.dataDir}/package + fi + ''; }; programs.mtr.enable = true; @@ -735,30 +734,29 @@ in lnmsWrapper ]; - systemd.tmpfiles.rules = - [ - "d ${cfg.logDir} 0750 ${cfg.user} ${cfg.group} - -" - "f ${cfg.logDir}/librenms.log 0640 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir} 0750 ${cfg.user} ${cfg.group} - -" - "f ${cfg.dataDir}/.env 0600 ${cfg.user} ${cfg.group} - -" - "f ${cfg.dataDir}/version 0600 ${cfg.user} ${cfg.group} - -" - "f ${cfg.dataDir}/package 0600 ${cfg.user} ${cfg.group} - -" - "f ${cfg.dataDir}/one_minute_enabled 0600 ${cfg.user} ${cfg.group} - -" - "f ${cfg.dataDir}/config.json 0600 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage/app 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage/debugbar 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage/framework 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage/framework/cache 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage/framework/sessions 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage/framework/views 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/storage/logs 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/rrd 0700 ${cfg.user} ${cfg.group} - -" - "d ${cfg.dataDir}/cache 0700 ${cfg.user} ${cfg.group} - -" - ] - ++ lib.optionals cfg.useDistributedPollers [ - "d ${cfg.dataDir}/rrdcached-journal 0700 ${cfg.user} ${cfg.group} - -" - ]; + systemd.tmpfiles.rules = [ + "d ${cfg.logDir} 0750 ${cfg.user} ${cfg.group} - -" + "f ${cfg.logDir}/librenms.log 0640 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir} 0750 ${cfg.user} ${cfg.group} - -" + "f ${cfg.dataDir}/.env 0600 ${cfg.user} ${cfg.group} - -" + "f ${cfg.dataDir}/version 0600 ${cfg.user} ${cfg.group} - -" + "f ${cfg.dataDir}/package 0600 ${cfg.user} ${cfg.group} - -" + "f ${cfg.dataDir}/one_minute_enabled 0600 ${cfg.user} ${cfg.group} - -" + "f ${cfg.dataDir}/config.json 0600 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage/app 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage/debugbar 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage/framework 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage/framework/cache 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage/framework/sessions 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage/framework/views 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/storage/logs 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/rrd 0700 ${cfg.user} ${cfg.group} - -" + "d ${cfg.dataDir}/cache 0700 ${cfg.user} ${cfg.group} - -" + ] + ++ lib.optionals cfg.useDistributedPollers [ + "d ${cfg.dataDir}/rrdcached-journal 0700 ${cfg.user} ${cfg.group} - -" + ]; }; diff --git a/nixos/modules/services/monitoring/longview.nix b/nixos/modules/services/monitoring/longview.nix index b4a690a7f1d3..8ca975760c60 100644 --- a/nixos/modules/services/monitoring/longview.nix +++ b/nixos/modules/services/monitoring/longview.nix @@ -116,30 +116,29 @@ in serviceConfig.ExecReload = "-${pkgs.coreutils}/bin/kill -HUP $MAINPID"; serviceConfig.PIDFile = "${runDir}/longview.pid"; serviceConfig.ExecStart = "${pkgs.longview}/bin/longview"; - preStart = - '' - umask 077 - mkdir -p ${configsDir} - '' - + (lib.optionalString (cfg.apiKeyFile != null) '' - cp --no-preserve=all "${cfg.apiKeyFile}" ${runDir}/longview.key - '') - + (lib.optionalString (cfg.apacheStatusUrl != "") '' - cat > ${configsDir}/Apache.conf < ${configsDir}/MySQL.conf < ${configsDir}/Nginx.conf < ${configsDir}/Apache.conf < ${configsDir}/MySQL.conf < ${configsDir}/Nginx.conf </run/parsedmarc/dmarc_user_passwd - replace-secret '@imap-password@' '/run/parsedmarc/dmarc_user_passwd' /run/parsedmarc/parsedmarc.ini - echo "Setting new randomized password for user '${cfg.provision.localMail.recipientName}'." - cat <(echo -n "${cfg.provision.localMail.recipientName}:") /run/parsedmarc/dmarc_user_passwd | chpasswd - ''; + umask u=rwx,g=,o= + cp ${parsedmarcConfig} /run/parsedmarc/parsedmarc.ini + chown parsedmarc:parsedmarc /run/parsedmarc/parsedmarc.ini + ${secretReplacements} + '' + + lib.optionalString cfg.provision.localMail.enable '' + openssl rand -hex 64 >/run/parsedmarc/dmarc_user_passwd + replace-secret '@imap-password@' '/run/parsedmarc/dmarc_user_passwd' /run/parsedmarc/parsedmarc.ini + echo "Setting new randomized password for user '${cfg.provision.localMail.recipientName}'." + cat <(echo -n "${cfg.provision.localMail.recipientName}:") /run/parsedmarc/dmarc_user_passwd | chpasswd + ''; in "+${pkgs.writeShellScript "parsedmarc-start-pre-full-privileges" startPreFullPrivileges}"; Type = "simple"; diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index aeac6dcd5417..efd516309148 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -201,7 +201,8 @@ let tls_config = mkOpt promTypes.tls_config '' TLS configuration. ''; - } // extraOptions; + } + // extraOptions; }; # diff --git a/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixos/modules/services/monitoring/prometheus/exporters.nix index ee2e61313b81..28144b6267c2 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters.nix @@ -415,134 +415,133 @@ in config = mkMerge ( [ { - assertions = - [ - { - assertion = - cfg.ipmi.enable -> (cfg.ipmi.configFile != null) -> (!(lib.hasPrefix "/tmp/" cfg.ipmi.configFile)); - message = '' - Config file specified in `services.prometheus.exporters.ipmi.configFile' must - not reside within /tmp - it won't be visible to the systemd service. - ''; - } - { - assertion = - cfg.ipmi.enable - -> (cfg.ipmi.webConfigFile != null) - -> (!(lib.hasPrefix "/tmp/" cfg.ipmi.webConfigFile)); - message = '' - Config file specified in `services.prometheus.exporters.ipmi.webConfigFile' must - not reside within /tmp - it won't be visible to the systemd service. - ''; - } - { - assertion = - cfg.restic.enable -> ((cfg.restic.repository == null) != (cfg.restic.repositoryFile == null)); - message = '' - Please specify either 'services.prometheus.exporters.restic.repository' - or 'services.prometheus.exporters.restic.repositoryFile'. - ''; - } - { - assertion = - cfg.snmp.enable -> ((cfg.snmp.configurationPath == null) != (cfg.snmp.configuration == null)); - message = '' - Please ensure you have either `services.prometheus.exporters.snmp.configuration' - or `services.prometheus.exporters.snmp.configurationPath' set! - ''; - } - { - assertion = - cfg.mikrotik.enable -> ((cfg.mikrotik.configFile == null) != (cfg.mikrotik.configuration == null)); - message = '' - Please specify either `services.prometheus.exporters.mikrotik.configuration' - or `services.prometheus.exporters.mikrotik.configFile'. - ''; - } - { - assertion = cfg.mail.enable -> ((cfg.mail.configFile == null) != (cfg.mail.configuration == null)); - message = '' - Please specify either 'services.prometheus.exporters.mail.configuration' - or 'services.prometheus.exporters.mail.configFile'. - ''; - } - { - assertion = cfg.mysqld.runAsLocalSuperUser -> config.services.mysql.enable; - message = '' - The exporter is configured to run as 'services.mysql.user', but - 'services.mysql.enable' is set to false. - ''; - } - { - assertion = - cfg.nextcloud.enable -> ((cfg.nextcloud.passwordFile == null) != (cfg.nextcloud.tokenFile == null)); - message = '' - Please specify either 'services.prometheus.exporters.nextcloud.passwordFile' or - 'services.prometheus.exporters.nextcloud.tokenFile' - ''; - } - { - assertion = cfg.sql.enable -> ((cfg.sql.configFile == null) != (cfg.sql.configuration == null)); - message = '' - Please specify either 'services.prometheus.exporters.sql.configuration' or - 'services.prometheus.exporters.sql.configFile' - ''; - } - { - assertion = cfg.scaphandre.enable -> (pkgs.stdenv.targetPlatform.isx86_64 == true); - message = '' - Scaphandre only support x86_64 architectures. - ''; - } - { - assertion = - cfg.scaphandre.enable - -> ((lib.kernel.whenHelpers pkgs.linux.version).whenOlder "5.11" true).condition == false; - message = '' - Scaphandre requires a kernel version newer than '5.11', '${pkgs.linux.version}' given. - ''; - } - { - assertion = cfg.scaphandre.enable -> (builtins.elem "intel_rapl_common" config.boot.kernelModules); - message = '' - Scaphandre needs 'intel_rapl_common' kernel module to be enabled. Please add it in 'boot.kernelModules'. - ''; - } - { - assertion = - cfg.idrac.enable -> ((cfg.idrac.configurationPath == null) != (cfg.idrac.configuration == null)); - message = '' - Please ensure you have either `services.prometheus.exporters.idrac.configuration' - or `services.prometheus.exporters.idrac.configurationPath' set! - ''; - } - { - assertion = - cfg.deluge.enable - -> ((cfg.deluge.delugePassword == null) != (cfg.deluge.delugePasswordFile == null)); - message = '' - Please ensure you have either `services.prometheus.exporters.deluge.delugePassword' - or `services.prometheus.exporters.deluge.delugePasswordFile' set! - ''; - } - { - assertion = - cfg.pgbouncer.enable - -> (xor (cfg.pgbouncer.connectionEnvFile == null) (cfg.pgbouncer.connectionString == null)); - message = '' - Options `services.prometheus.exporters.pgbouncer.connectionEnvFile` and - `services.prometheus.exporters.pgbouncer.connectionString` are mutually exclusive! - ''; - } - ] - ++ (flip map (attrNames exporterOpts) (exporter: { - assertion = cfg.${exporter}.firewallFilter != null -> cfg.${exporter}.openFirewall; + assertions = [ + { + assertion = + cfg.ipmi.enable -> (cfg.ipmi.configFile != null) -> (!(lib.hasPrefix "/tmp/" cfg.ipmi.configFile)); message = '' - The `firewallFilter'-option of exporter ${exporter} doesn't have any effect unless - `openFirewall' is set to `true'! + Config file specified in `services.prometheus.exporters.ipmi.configFile' must + not reside within /tmp - it won't be visible to the systemd service. ''; - })) - ++ config.services.prometheus.exporters.assertions; + } + { + assertion = + cfg.ipmi.enable + -> (cfg.ipmi.webConfigFile != null) + -> (!(lib.hasPrefix "/tmp/" cfg.ipmi.webConfigFile)); + message = '' + Config file specified in `services.prometheus.exporters.ipmi.webConfigFile' must + not reside within /tmp - it won't be visible to the systemd service. + ''; + } + { + assertion = + cfg.restic.enable -> ((cfg.restic.repository == null) != (cfg.restic.repositoryFile == null)); + message = '' + Please specify either 'services.prometheus.exporters.restic.repository' + or 'services.prometheus.exporters.restic.repositoryFile'. + ''; + } + { + assertion = + cfg.snmp.enable -> ((cfg.snmp.configurationPath == null) != (cfg.snmp.configuration == null)); + message = '' + Please ensure you have either `services.prometheus.exporters.snmp.configuration' + or `services.prometheus.exporters.snmp.configurationPath' set! + ''; + } + { + assertion = + cfg.mikrotik.enable -> ((cfg.mikrotik.configFile == null) != (cfg.mikrotik.configuration == null)); + message = '' + Please specify either `services.prometheus.exporters.mikrotik.configuration' + or `services.prometheus.exporters.mikrotik.configFile'. + ''; + } + { + assertion = cfg.mail.enable -> ((cfg.mail.configFile == null) != (cfg.mail.configuration == null)); + message = '' + Please specify either 'services.prometheus.exporters.mail.configuration' + or 'services.prometheus.exporters.mail.configFile'. + ''; + } + { + assertion = cfg.mysqld.runAsLocalSuperUser -> config.services.mysql.enable; + message = '' + The exporter is configured to run as 'services.mysql.user', but + 'services.mysql.enable' is set to false. + ''; + } + { + assertion = + cfg.nextcloud.enable -> ((cfg.nextcloud.passwordFile == null) != (cfg.nextcloud.tokenFile == null)); + message = '' + Please specify either 'services.prometheus.exporters.nextcloud.passwordFile' or + 'services.prometheus.exporters.nextcloud.tokenFile' + ''; + } + { + assertion = cfg.sql.enable -> ((cfg.sql.configFile == null) != (cfg.sql.configuration == null)); + message = '' + Please specify either 'services.prometheus.exporters.sql.configuration' or + 'services.prometheus.exporters.sql.configFile' + ''; + } + { + assertion = cfg.scaphandre.enable -> (pkgs.stdenv.targetPlatform.isx86_64 == true); + message = '' + Scaphandre only support x86_64 architectures. + ''; + } + { + assertion = + cfg.scaphandre.enable + -> ((lib.kernel.whenHelpers pkgs.linux.version).whenOlder "5.11" true).condition == false; + message = '' + Scaphandre requires a kernel version newer than '5.11', '${pkgs.linux.version}' given. + ''; + } + { + assertion = cfg.scaphandre.enable -> (builtins.elem "intel_rapl_common" config.boot.kernelModules); + message = '' + Scaphandre needs 'intel_rapl_common' kernel module to be enabled. Please add it in 'boot.kernelModules'. + ''; + } + { + assertion = + cfg.idrac.enable -> ((cfg.idrac.configurationPath == null) != (cfg.idrac.configuration == null)); + message = '' + Please ensure you have either `services.prometheus.exporters.idrac.configuration' + or `services.prometheus.exporters.idrac.configurationPath' set! + ''; + } + { + assertion = + cfg.deluge.enable + -> ((cfg.deluge.delugePassword == null) != (cfg.deluge.delugePasswordFile == null)); + message = '' + Please ensure you have either `services.prometheus.exporters.deluge.delugePassword' + or `services.prometheus.exporters.deluge.delugePasswordFile' set! + ''; + } + { + assertion = + cfg.pgbouncer.enable + -> (xor (cfg.pgbouncer.connectionEnvFile == null) (cfg.pgbouncer.connectionString == null)); + message = '' + Options `services.prometheus.exporters.pgbouncer.connectionEnvFile` and + `services.prometheus.exporters.pgbouncer.connectionString` are mutually exclusive! + ''; + } + ] + ++ (flip map (attrNames exporterOpts) (exporter: { + assertion = cfg.${exporter}.firewallFilter != null -> cfg.${exporter}.openFirewall; + message = '' + The `firewallFilter'-option of exporter ${exporter} doesn't have any effect unless + `openFirewall' is set to `true'! + ''; + })) + ++ config.services.prometheus.exporters.assertions; warnings = [ (mkIf ( @@ -555,7 +554,8 @@ in Consider using `services.prometheus.exporters.idrac.configuration` instead. '' ) - ] ++ config.services.prometheus.exporters.warnings; + ] + ++ config.services.prometheus.exporters.warnings; } ] ++ [ diff --git a/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix b/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix index ca1e0f7aaa95..c13d6b369cf9 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/bitcoin.nix @@ -87,6 +87,7 @@ in METRICS_ADDR = cfg.listenAddress; METRICS_PORT = toString cfg.port; REFRESH_SECONDS = toString cfg.refreshSeconds; - } // cfg.extraEnv; + } + // cfg.extraEnv; }; } diff --git a/nixos/modules/services/monitoring/prometheus/exporters/deluge.nix b/nixos/modules/services/monitoring/prometheus/exporters/deluge.nix index ec3cbaf9c40e..5297bcd089f5 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/deluge.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/deluge.nix @@ -72,21 +72,20 @@ in ExecStart = '' ${pkgs.prometheus-deluge-exporter}/bin/deluge-exporter ''; - Environment = - [ - "LISTEN_PORT=${toString cfg.port}" - "LISTEN_ADDRESS=${toString cfg.listenAddress}" + Environment = [ + "LISTEN_PORT=${toString cfg.port}" + "LISTEN_ADDRESS=${toString cfg.listenAddress}" - "DELUGE_HOST=${cfg.delugeHost}" - "DELUGE_USER=${cfg.delugeUser}" - "DELUGE_PORT=${toString cfg.delugePort}" - ] - ++ lib.optionals (cfg.delugePassword != null) [ - "DELUGE_PASSWORD=${cfg.delugePassword}" - ] - ++ lib.optionals cfg.exportPerTorrentMetrics [ - "PER_TORRENT_METRICS=1" - ]; + "DELUGE_HOST=${cfg.delugeHost}" + "DELUGE_USER=${cfg.delugeUser}" + "DELUGE_PORT=${toString cfg.delugePort}" + ] + ++ lib.optionals (cfg.delugePassword != null) [ + "DELUGE_PASSWORD=${cfg.delugePassword}" + ] + ++ lib.optionals cfg.exportPerTorrentMetrics [ + "PER_TORRENT_METRICS=1" + ]; EnvironmentFile = lib.optionalString ( cfg.delugePasswordFile != null ) "/etc/deluge-exporter/password"; diff --git a/nixos/modules/services/monitoring/prometheus/exporters/node.nix b/nixos/modules/services/monitoring/prometheus/exporters/node.nix index d2245fb93062..c543ac9a206e 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/node.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/node.nix @@ -54,12 +54,13 @@ in # needs access to dbus via unix sockets (logind/systemd) "AF_UNIX" ] - ++ optionals - (collectorIsEnabled "network_route" || collectorIsEnabled "wifi" || !collectorIsDisabled "netdev") - [ - # needs netlink sockets for wireless collector - "AF_NETLINK" - ]; + ++ + optionals + (collectorIsEnabled "network_route" || collectorIsEnabled "wifi" || !collectorIsDisabled "netdev") + [ + # needs netlink sockets for wireless collector + "AF_NETLINK" + ]; # The timex collector needs to access clock APIs ProtectClock = collectorIsDisabled "timex"; # Allow space monitoring under /home diff --git a/nixos/modules/services/monitoring/prometheus/exporters/pve.nix b/nixos/modules/services/monitoring/prometheus/exporters/pve.nix index c13dc71cf340..c05dde9a29df 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/pve.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/pve.nix @@ -130,27 +130,26 @@ in }; }; serviceOpts = { - serviceConfig = - { - DynamicUser = cfg.environmentFile == null; - LoadCredential = "configFile:${computedConfigFile}"; - ExecStart = '' - ${cfg.package}/bin/pve_exporter \ - --${optionalString (!cfg.collectors.status) "no-"}collector.status \ - --${optionalString (!cfg.collectors.version) "no-"}collector.version \ - --${optionalString (!cfg.collectors.node) "no-"}collector.node \ - --${optionalString (!cfg.collectors.cluster) "no-"}collector.cluster \ - --${optionalString (!cfg.collectors.resources) "no-"}collector.resources \ - --${optionalString (!cfg.collectors.config) "no-"}collector.config \ - --${optionalString (!cfg.collectors.replication) "no-"}collector.replication \ - ${optionalString (cfg.server.keyFile != null) "--server.keyfile ${cfg.server.keyFile}"} \ - ${optionalString (cfg.server.certFile != null) "--server.certfile ${cfg.server.certFile}"} \ - --config.file %d/configFile \ - --web.listen-address ${cfg.listenAddress}:${toString cfg.port} - ''; - } - // optionalAttrs (cfg.environmentFile != null) { - EnvironmentFile = cfg.environmentFile; - }; + serviceConfig = { + DynamicUser = cfg.environmentFile == null; + LoadCredential = "configFile:${computedConfigFile}"; + ExecStart = '' + ${cfg.package}/bin/pve_exporter \ + --${optionalString (!cfg.collectors.status) "no-"}collector.status \ + --${optionalString (!cfg.collectors.version) "no-"}collector.version \ + --${optionalString (!cfg.collectors.node) "no-"}collector.node \ + --${optionalString (!cfg.collectors.cluster) "no-"}collector.cluster \ + --${optionalString (!cfg.collectors.resources) "no-"}collector.resources \ + --${optionalString (!cfg.collectors.config) "no-"}collector.config \ + --${optionalString (!cfg.collectors.replication) "no-"}collector.replication \ + ${optionalString (cfg.server.keyFile != null) "--server.keyfile ${cfg.server.keyFile}"} \ + ${optionalString (cfg.server.certFile != null) "--server.certfile ${cfg.server.certFile}"} \ + --config.file %d/configFile \ + --web.listen-address ${cfg.listenAddress}:${toString cfg.port} + ''; + } + // optionalAttrs (cfg.environmentFile != null) { + EnvironmentFile = cfg.environmentFile; + }; }; } diff --git a/nixos/modules/services/monitoring/prometheus/exporters/restic.nix b/nixos/modules/services/monitoring/prometheus/exporters/restic.nix index 615d78317d38..79d412bf0458 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/restic.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/restic.nix @@ -144,7 +144,8 @@ in EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile; LoadCredential = [ "RESTIC_PASSWORD_FILE:${cfg.passwordFile}" - ] ++ optional (cfg.repositoryFile != null) [ "RESTIC_REPOSITORY:${cfg.repositoryFile}" ]; + ] + ++ optional (cfg.repositoryFile != null) [ "RESTIC_REPOSITORY:${cfg.repositoryFile}" ]; }; environment = let diff --git a/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix b/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix index 80a97d42e972..73656b896085 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/unbound.nix @@ -84,28 +84,27 @@ in serviceOpts = mkMerge ( [ { - serviceConfig = - { - User = "unbound"; # to access the unbound_control.key - ExecStart = '' - ${pkgs.prometheus-unbound-exporter}/bin/unbound_exporter \ - --unbound.host "${cfg.unbound.host}" \ - --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ - --web.telemetry-path ${cfg.telemetryPath} \ - ${optionalString (cfg.unbound.ca != null) "--unbound.ca ${cfg.unbound.ca}"} \ - ${optionalString (cfg.unbound.certificate != null) "--unbound.cert ${cfg.unbound.certificate}"} \ - ${optionalString (cfg.unbound.key != null) "--unbound.key ${cfg.unbound.key}"} \ - ${toString cfg.extraFlags} - ''; - RestrictAddressFamilies = [ - "AF_UNIX" - "AF_INET" - "AF_INET6" - ]; - } - // optionalAttrs (!config.services.unbound.enable) { - DynamicUser = true; - }; + serviceConfig = { + User = "unbound"; # to access the unbound_control.key + ExecStart = '' + ${pkgs.prometheus-unbound-exporter}/bin/unbound_exporter \ + --unbound.host "${cfg.unbound.host}" \ + --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ + --web.telemetry-path ${cfg.telemetryPath} \ + ${optionalString (cfg.unbound.ca != null) "--unbound.ca ${cfg.unbound.ca}"} \ + ${optionalString (cfg.unbound.certificate != null) "--unbound.cert ${cfg.unbound.certificate}"} \ + ${optionalString (cfg.unbound.key != null) "--unbound.key ${cfg.unbound.key}"} \ + ${toString cfg.extraFlags} + ''; + RestrictAddressFamilies = [ + "AF_UNIX" + "AF_INET" + "AF_INET6" + ]; + } + // optionalAttrs (!config.services.unbound.enable) { + DynamicUser = true; + }; } ] ++ [ diff --git a/nixos/modules/services/monitoring/vmagent.nix b/nixos/modules/services/monitoring/vmagent.nix index db65e72cefff..e0d2196814cf 100644 --- a/nixos/modules/services/monitoring/vmagent.nix +++ b/nixos/modules/services/monitoring/vmagent.nix @@ -9,21 +9,20 @@ let cfg = config.services.vmagent; settingsFormat = pkgs.formats.yaml { }; - startCLIList = - [ - "${cfg.package}/bin/vmagent" - ] - ++ lib.optionals (cfg.remoteWrite.url != null) [ - "-remoteWrite.url=${cfg.remoteWrite.url}" - "-remoteWrite.tmpDataPath=%C/vmagent/remote_write_tmp" - ] - ++ lib.optional ( - cfg.remoteWrite.basicAuthUsername != null - ) "-remoteWrite.basicAuth.username=${cfg.remoteWrite.basicAuthUsername}" - ++ lib.optional ( - cfg.remoteWrite.basicAuthPasswordFile != null - ) "-remoteWrite.basicAuth.passwordFile=\${CREDENTIALS_DIRECTORY}/remote_write_basic_auth_password" - ++ cfg.extraArgs; + startCLIList = [ + "${cfg.package}/bin/vmagent" + ] + ++ lib.optionals (cfg.remoteWrite.url != null) [ + "-remoteWrite.url=${cfg.remoteWrite.url}" + "-remoteWrite.tmpDataPath=%C/vmagent/remote_write_tmp" + ] + ++ lib.optional ( + cfg.remoteWrite.basicAuthUsername != null + ) "-remoteWrite.basicAuth.username=${cfg.remoteWrite.basicAuthUsername}" + ++ lib.optional ( + cfg.remoteWrite.basicAuthPasswordFile != null + ) "-remoteWrite.basicAuth.passwordFile=\${CREDENTIALS_DIRECTORY}/remote_write_basic_auth_password" + ++ cfg.extraArgs; prometheusConfigYml = checkedConfig ( settingsFormat.generate "prometheusConfig.yaml" cfg.prometheusConfig ); diff --git a/nixos/modules/services/monitoring/zabbix-server.nix b/nixos/modules/services/monitoring/zabbix-server.nix index f3606f1c2835..50a33d26d827 100644 --- a/nixos/modules/services/monitoring/zabbix-server.nix +++ b/nixos/modules/services/monitoring/zabbix-server.nix @@ -331,33 +331,32 @@ in after = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.target"; path = [ "/run/wrappers" ] ++ cfg.extraPackages; - preStart = - '' - # pre 19.09 compatibility - if test -e "${runtimeDir}/db-created"; then - mv "${runtimeDir}/db-created" "${stateDir}/" - fi - '' - + optionalString pgsqlLocal '' - if ! test -e "${stateDir}/db-created"; then - cat ${cfg.package}/share/zabbix/database/postgresql/schema.sql | ${pgsql.package}/bin/psql ${cfg.database.name} - cat ${cfg.package}/share/zabbix/database/postgresql/images.sql | ${pgsql.package}/bin/psql ${cfg.database.name} - cat ${cfg.package}/share/zabbix/database/postgresql/data.sql | ${pgsql.package}/bin/psql ${cfg.database.name} - touch "${stateDir}/db-created" - fi - '' - + optionalString mysqlLocal '' - if ! test -e "${stateDir}/db-created"; then - cat ${cfg.package}/share/zabbix/database/mysql/schema.sql | ${mysql.package}/bin/mysql ${cfg.database.name} - cat ${cfg.package}/share/zabbix/database/mysql/images.sql | ${mysql.package}/bin/mysql ${cfg.database.name} - cat ${cfg.package}/share/zabbix/database/mysql/data.sql | ${mysql.package}/bin/mysql ${cfg.database.name} - touch "${stateDir}/db-created" - fi - '' - + optionalString (cfg.database.passwordFile != null) '' - # create a copy of the supplied password file in a format zabbix can consume - install -m 0600 <(echo "DBPassword = $(cat ${cfg.database.passwordFile})") ${passwordFile} - ''; + preStart = '' + # pre 19.09 compatibility + if test -e "${runtimeDir}/db-created"; then + mv "${runtimeDir}/db-created" "${stateDir}/" + fi + '' + + optionalString pgsqlLocal '' + if ! test -e "${stateDir}/db-created"; then + cat ${cfg.package}/share/zabbix/database/postgresql/schema.sql | ${pgsql.package}/bin/psql ${cfg.database.name} + cat ${cfg.package}/share/zabbix/database/postgresql/images.sql | ${pgsql.package}/bin/psql ${cfg.database.name} + cat ${cfg.package}/share/zabbix/database/postgresql/data.sql | ${pgsql.package}/bin/psql ${cfg.database.name} + touch "${stateDir}/db-created" + fi + '' + + optionalString mysqlLocal '' + if ! test -e "${stateDir}/db-created"; then + cat ${cfg.package}/share/zabbix/database/mysql/schema.sql | ${mysql.package}/bin/mysql ${cfg.database.name} + cat ${cfg.package}/share/zabbix/database/mysql/images.sql | ${mysql.package}/bin/mysql ${cfg.database.name} + cat ${cfg.package}/share/zabbix/database/mysql/data.sql | ${mysql.package}/bin/mysql ${cfg.database.name} + touch "${stateDir}/db-created" + fi + '' + + optionalString (cfg.database.passwordFile != null) '' + # create a copy of the supplied password file in a format zabbix can consume + install -m 0600 <(echo "DBPassword = $(cat ${cfg.database.passwordFile})") ${passwordFile} + ''; serviceConfig = { ExecStart = "@${cfg.package}/sbin/zabbix_server zabbix_server -f --config ${configFile}"; diff --git a/nixos/modules/services/network-filesystems/ceph.nix b/nixos/modules/services/network-filesystems/ceph.nix index c07986411baa..fa9c7955afde 100644 --- a/nixos/modules/services/network-filesystems/ceph.nix +++ b/nixos/modules/services/network-filesystems/ceph.nix @@ -36,7 +36,8 @@ let after = [ "network-online.target" "time-sync.target" - ] ++ lib.optional (daemonType == "osd") "ceph-mon.target"; + ] + ++ lib.optional (daemonType == "osd") "ceph-mon.target"; wants = [ "network-online.target" "time-sync.target" @@ -62,32 +63,31 @@ let 5; startLimitIntervalSec = 60 * 30; # 30 mins - serviceConfig = - { - LimitNOFILE = 1048576; - LimitNPROC = 1048576; - Environment = "CLUSTER=${clusterName}"; - ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; - PrivateDevices = "yes"; - PrivateTmp = "true"; - ProtectHome = "true"; - ProtectSystem = "full"; - Restart = "on-failure"; - StateDirectory = stateDirectory; - User = "ceph"; - Group = if daemonType == "osd" then "disk" else "ceph"; - ExecStart = '' - ${ceph.out}/bin/${if daemonType == "rgw" then "radosgw" else "ceph-${daemonType}"} \ - -f --cluster ${clusterName} --id ${daemonId}''; - } - // lib.optionalAttrs (daemonType == "osd") { - ExecStartPre = "${ceph.lib}/libexec/ceph/ceph-osd-prestart.sh --id ${daemonId} --cluster ${clusterName}"; - RestartSec = "20s"; - PrivateDevices = "no"; # osd needs disk access - } - // lib.optionalAttrs (daemonType == "mon") { - RestartSec = "10"; - }; + serviceConfig = { + LimitNOFILE = 1048576; + LimitNPROC = 1048576; + Environment = "CLUSTER=${clusterName}"; + ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; + PrivateDevices = "yes"; + PrivateTmp = "true"; + ProtectHome = "true"; + ProtectSystem = "full"; + Restart = "on-failure"; + StateDirectory = stateDirectory; + User = "ceph"; + Group = if daemonType == "osd" then "disk" else "ceph"; + ExecStart = '' + ${ceph.out}/bin/${if daemonType == "rgw" then "radosgw" else "ceph-${daemonType}"} \ + -f --cluster ${clusterName} --id ${daemonId}''; + } + // lib.optionalAttrs (daemonType == "osd") { + ExecStartPre = "${ceph.lib}/libexec/ceph/ceph-osd-prestart.sh --id ${daemonId} --cluster ${clusterName}"; + RestartSec = "20s"; + PrivateDevices = "no"; # osd needs disk access + } + // lib.optionalAttrs (daemonType == "mon") { + RestartSec = "10"; + }; }; makeTarget = daemonType: { @@ -419,14 +419,13 @@ in ); # Remove all name-value pairs with null values from the attribute set to avoid making empty sections in the ceph.conf globalSection' = lib.filterAttrs (name: value: value != null) globalSection; - totalConfig = - { - global = globalSection'; - } - // lib.optionalAttrs (cfg.mon.enable && cfg.mon.extraConfig != { }) { mon = cfg.mon.extraConfig; } - // lib.optionalAttrs (cfg.mds.enable && cfg.mds.extraConfig != { }) { mds = cfg.mds.extraConfig; } - // lib.optionalAttrs (cfg.osd.enable && cfg.osd.extraConfig != { }) { osd = cfg.osd.extraConfig; } - // lib.optionalAttrs (cfg.client.enable && cfg.client.extraConfig != { }) cfg.client.extraConfig; + totalConfig = { + global = globalSection'; + } + // lib.optionalAttrs (cfg.mon.enable && cfg.mon.extraConfig != { }) { mon = cfg.mon.extraConfig; } + // lib.optionalAttrs (cfg.mds.enable && cfg.mds.extraConfig != { }) { mds = cfg.mds.extraConfig; } + // lib.optionalAttrs (cfg.osd.enable && cfg.osd.extraConfig != { }) { osd = cfg.osd.extraConfig; } + // lib.optionalAttrs (cfg.client.enable && cfg.client.extraConfig != { }) cfg.client.extraConfig; in lib.generators.toINI { } totalConfig; @@ -455,21 +454,20 @@ in systemd.targets = let - targets = - [ - { - ceph = { - description = "Ceph target allowing to start/stop all ceph service instances at once"; - wantedBy = [ "multi-user.target" ]; - unitConfig.StopWhenUnneeded = true; - }; - } - ] - ++ lib.optional cfg.mon.enable (makeTarget "mon") - ++ lib.optional cfg.mds.enable (makeTarget "mds") - ++ lib.optional cfg.osd.enable (makeTarget "osd") - ++ lib.optional cfg.rgw.enable (makeTarget "rgw") - ++ lib.optional cfg.mgr.enable (makeTarget "mgr"); + targets = [ + { + ceph = { + description = "Ceph target allowing to start/stop all ceph service instances at once"; + wantedBy = [ "multi-user.target" ]; + unitConfig.StopWhenUnneeded = true; + }; + } + ] + ++ lib.optional cfg.mon.enable (makeTarget "mon") + ++ lib.optional cfg.mds.enable (makeTarget "mds") + ++ lib.optional cfg.osd.enable (makeTarget "osd") + ++ lib.optional cfg.rgw.enable (makeTarget "rgw") + ++ lib.optional cfg.mgr.enable (makeTarget "mgr"); in lib.mkMerge targets; diff --git a/nixos/modules/services/network-filesystems/glusterfs.nix b/nixos/modules/services/network-filesystems/glusterfs.nix index cd0ce42bba63..db00cdc11abb 100644 --- a/nixos/modules/services/network-filesystems/glusterfs.nix +++ b/nixos/modules/services/network-filesystems/glusterfs.nix @@ -173,24 +173,23 @@ in requires = lib.optional cfg.useRpcbind "rpcbind.service"; after = [ "network.target" ] ++ lib.optional cfg.useRpcbind "rpcbind.service"; - preStart = - '' - install -m 0755 -d /var/log/glusterfs - '' - # The copying of hooks is due to upstream bug https://bugzilla.redhat.com/show_bug.cgi?id=1452761 - # Excludes one hook due to missing SELinux binaries. - + '' - mkdir -p /var/lib/glusterd/hooks/ - ${rsync}/bin/rsync -a --exclude="S10selinux-label-brick.sh" ${glusterfs}/var/lib/glusterd/hooks/ /var/lib/glusterd/hooks/ + preStart = '' + install -m 0755 -d /var/log/glusterfs + '' + # The copying of hooks is due to upstream bug https://bugzilla.redhat.com/show_bug.cgi?id=1452761 + # Excludes one hook due to missing SELinux binaries. + + '' + mkdir -p /var/lib/glusterd/hooks/ + ${rsync}/bin/rsync -a --exclude="S10selinux-label-brick.sh" ${glusterfs}/var/lib/glusterd/hooks/ /var/lib/glusterd/hooks/ - ${tlsCmd} - '' - # `glusterfind` needs dirs that upstream installs at `make install` phase - # https://github.com/gluster/glusterfs/blob/v3.10.2/tools/glusterfind/Makefile.am#L16-L17 - + '' - mkdir -p /var/lib/glusterd/glusterfind/.keys - mkdir -p /var/lib/glusterd/hooks/1/delete/post/ - ''; + ${tlsCmd} + '' + # `glusterfind` needs dirs that upstream installs at `make install` phase + # https://github.com/gluster/glusterfs/blob/v3.10.2/tools/glusterfind/Makefile.am#L16-L17 + + '' + mkdir -p /var/lib/glusterd/glusterfind/.keys + mkdir -p /var/lib/glusterd/hooks/1/delete/post/ + ''; serviceConfig = { LimitNOFILE = 65536; diff --git a/nixos/modules/services/network-filesystems/kubo.nix b/nixos/modules/services/network-filesystems/kubo.nix index b28e112f14dd..87d83971c706 100644 --- a/nixos/modules/services/network-filesystems/kubo.nix +++ b/nixos/modules/services/network-filesystems/kubo.nix @@ -373,66 +373,65 @@ in Mounts.FuseAllowOther = lib.mkDefault true; }; - systemd.services.ipfs = - { - path = [ - "/run/wrappers" - cfg.package + systemd.services.ipfs = { + path = [ + "/run/wrappers" + cfg.package + ]; + environment.IPFS_PATH = cfg.dataDir; + + preStart = '' + if [[ ! -f "$IPFS_PATH/config" ]]; then + ipfs init --empty-repo=${lib.boolToString cfg.emptyRepo} + else + # After an unclean shutdown this file may exist which will cause the config command to attempt to talk to the daemon. This will hang forever if systemd is holding our sockets open. + rm -vf "$IPFS_PATH/api" + '' + + lib.optionalString cfg.autoMigrate '' + '${lib.getExe pkgs.kubo-migrator}' -to '${cfg.package.repoVersion}' -y + '' + + '' + fi + ipfs --offline config show | + ${pkgs.jq}/bin/jq -s '.[0].Pinning as $Pinning | .[0].Identity as $Identity | .[1] + {$Identity,$Pinning}' - '${configFile}' | + + # This command automatically injects the private key and other secrets from + # the old config file back into the new config file. + # Unfortunately, it doesn't keep the original `Identity.PeerID`, + # so we need `ipfs config show` and jq above. + # See https://github.com/ipfs/kubo/issues/8993 for progress on fixing this problem. + # Kubo also wants a specific version of the original "Pinning.RemoteServices" + # section (redacted by `ipfs config show`), such that that section doesn't + # change when the changes are applied. Whyyyyyy..... + ipfs --offline config replace - + ''; + postStop = lib.mkIf cfg.autoMount '' + # After an unclean shutdown the fuse mounts at cfg.settings.Mounts.IPFS, cfg.settings.Mounts.IPNS and cfg.settings.Mounts.MFS are locked + umount --quiet '${cfg.settings.Mounts.IPFS}' '${cfg.settings.Mounts.IPNS}' '${cfg.settings.Mounts.MFS}' || true + ''; + serviceConfig = { + ExecStart = [ + "" + "${cfg.package}/bin/ipfs daemon ${kuboFlags}" + ]; + User = cfg.user; + Group = cfg.group; + StateDirectory = ""; + ReadWritePaths = lib.optionals (!cfg.autoMount) [ + "" + cfg.dataDir + ]; + # Make sure the socket units are started before ipfs.service + Sockets = [ + "ipfs-gateway.socket" + "ipfs-api.socket" ]; - environment.IPFS_PATH = cfg.dataDir; - - preStart = - '' - if [[ ! -f "$IPFS_PATH/config" ]]; then - ipfs init --empty-repo=${lib.boolToString cfg.emptyRepo} - else - # After an unclean shutdown this file may exist which will cause the config command to attempt to talk to the daemon. This will hang forever if systemd is holding our sockets open. - rm -vf "$IPFS_PATH/api" - '' - + lib.optionalString cfg.autoMigrate '' - '${lib.getExe pkgs.kubo-migrator}' -to '${cfg.package.repoVersion}' -y - '' - + '' - fi - ipfs --offline config show | - ${pkgs.jq}/bin/jq -s '.[0].Pinning as $Pinning | .[0].Identity as $Identity | .[1] + {$Identity,$Pinning}' - '${configFile}' | - - # This command automatically injects the private key and other secrets from - # the old config file back into the new config file. - # Unfortunately, it doesn't keep the original `Identity.PeerID`, - # so we need `ipfs config show` and jq above. - # See https://github.com/ipfs/kubo/issues/8993 for progress on fixing this problem. - # Kubo also wants a specific version of the original "Pinning.RemoteServices" - # section (redacted by `ipfs config show`), such that that section doesn't - # change when the changes are applied. Whyyyyyy..... - ipfs --offline config replace - - ''; - postStop = lib.mkIf cfg.autoMount '' - # After an unclean shutdown the fuse mounts at cfg.settings.Mounts.IPFS, cfg.settings.Mounts.IPNS and cfg.settings.Mounts.MFS are locked - umount --quiet '${cfg.settings.Mounts.IPFS}' '${cfg.settings.Mounts.IPNS}' '${cfg.settings.Mounts.MFS}' || true - ''; - serviceConfig = { - ExecStart = [ - "" - "${cfg.package}/bin/ipfs daemon ${kuboFlags}" - ]; - User = cfg.user; - Group = cfg.group; - StateDirectory = ""; - ReadWritePaths = lib.optionals (!cfg.autoMount) [ - "" - cfg.dataDir - ]; - # Make sure the socket units are started before ipfs.service - Sockets = [ - "ipfs-gateway.socket" - "ipfs-api.socket" - ]; - } // lib.optionalAttrs (cfg.serviceFdlimit != null) { LimitNOFILE = cfg.serviceFdlimit; }; } - // lib.optionalAttrs (!cfg.startWhenNeeded) { - wantedBy = [ "default.target" ]; - }; + // lib.optionalAttrs (cfg.serviceFdlimit != null) { LimitNOFILE = cfg.serviceFdlimit; }; + } + // lib.optionalAttrs (!cfg.startWhenNeeded) { + wantedBy = [ "default.target" ]; + }; systemd.sockets.ipfs-gateway = { wantedBy = [ "sockets.target" ]; @@ -450,7 +449,8 @@ in ListenStream = [ "" "%t/ipfs.sock" - ] ++ (multiaddrsToListenStreams cfg.settings.Addresses.API); + ] + ++ (multiaddrsToListenStreams cfg.settings.Addresses.API); SocketMode = "0660"; SocketUser = cfg.user; SocketGroup = cfg.group; diff --git a/nixos/modules/services/network-filesystems/moosefs.nix b/nixos/modules/services/network-filesystems/moosefs.nix index bb30448456da..f2f0d403c8a9 100644 --- a/nixos/modules/services/network-filesystems/moosefs.nix +++ b/nixos/modules/services/network-filesystems/moosefs.nix @@ -81,7 +81,8 @@ let ExecStop = "${pkgs.moosefs}/bin/mfs${name} -c ${configFile} stop"; ExecReload = "${pkgs.moosefs}/bin/mfs${name} -c ${configFile} reload"; PIDFile = "${cfg."${name}".settings.DATA_PATH}/.mfs${name}.lock"; - } // extraConfig; + } + // extraConfig; }; in @@ -307,20 +308,19 @@ in (lib.optional (cfg.cgiserver.enable && cfg.cgiserver.openFirewall) cfg.cgiserver.settings.PORT) ]; - systemd.tmpfiles.rules = - [ - # Master directories - (lib.optionalString cfg.master.enable "d ${cfg.master.settings.DATA_PATH} 0700 ${mfsUser} ${mfsUser} -") + systemd.tmpfiles.rules = [ + # Master directories + (lib.optionalString cfg.master.enable "d ${cfg.master.settings.DATA_PATH} 0700 ${mfsUser} ${mfsUser} -") - # Metalogger directories - (lib.optionalString cfg.metalogger.enable "d ${cfg.metalogger.settings.DATA_PATH} 0700 ${mfsUser} ${mfsUser} -") + # Metalogger directories + (lib.optionalString cfg.metalogger.enable "d ${cfg.metalogger.settings.DATA_PATH} 0700 ${mfsUser} ${mfsUser} -") - # Chunkserver directories - (lib.optionalString cfg.chunkserver.enable "d ${cfg.chunkserver.settings.DATA_PATH} 0700 ${mfsUser} ${mfsUser} -") - ] - ++ lib.optionals (cfg.chunkserver.enable && cfg.chunkserver.hdds != null) ( - map (dir: "d ${dir} 0755 ${mfsUser} ${mfsUser} -") cfg.chunkserver.hdds - ); + # Chunkserver directories + (lib.optionalString cfg.chunkserver.enable "d ${cfg.chunkserver.settings.DATA_PATH} 0700 ${mfsUser} ${mfsUser} -") + ] + ++ lib.optionals (cfg.chunkserver.enable && cfg.chunkserver.hdds != null) ( + map (dir: "d ${dir} 0755 ${mfsUser} ${mfsUser} -") cfg.chunkserver.hdds + ); systemd.services = lib.mkMerge [ (lib.mkIf cfg.master.enable { diff --git a/nixos/modules/services/network-filesystems/samba.nix b/nixos/modules/services/network-filesystems/samba.nix index 9cc5a49168f6..79a0d42904f8 100644 --- a/nixos/modules/services/network-filesystems/samba.nix +++ b/nixos/modules/services/network-filesystems/samba.nix @@ -309,17 +309,16 @@ in "man:smb.conf(5)" ]; - after = - [ - "network.target" - "network-online.target" - ] - ++ lib.optionals (cfg.nmbd.enable) [ - "samba-nmbd.service" - ] - ++ lib.optionals (cfg.winbindd.enable) [ - "samba-winbindd.service" - ]; + after = [ + "network.target" + "network-online.target" + ] + ++ lib.optionals (cfg.nmbd.enable) [ + "samba-nmbd.service" + ] + ++ lib.optionals (cfg.winbindd.enable) [ + "samba-winbindd.service" + ]; partOf = [ "samba.target" ]; wantedBy = [ "samba.target" ]; @@ -352,13 +351,12 @@ in "man:smb.conf(5)" ]; - after = - [ - "network.target" - ] - ++ lib.optionals (cfg.nmbd.enable) [ - "samba-nmbd.service" - ]; + after = [ + "network.target" + ] + ++ lib.optionals (cfg.nmbd.enable) [ + "samba-nmbd.service" + ]; partOf = [ "samba.target" ]; wantedBy = [ "samba.target" ]; diff --git a/nixos/modules/services/network-filesystems/saunafs.nix b/nixos/modules/services/network-filesystems/saunafs.nix index 5c3c513c06f7..e0c8788a8738 100644 --- a/nixos/modules/services/network-filesystems/saunafs.nix +++ b/nixos/modules/services/network-filesystems/saunafs.nix @@ -80,7 +80,8 @@ let ExecStart = "${pkgs.saunafs}/bin/sfs${name} -c ${configFile} start"; ExecStop = "${pkgs.saunafs}/bin/sfs${name} -c ${configFile} stop"; ExecReload = "${pkgs.saunafs}/bin/sfs${name} -c ${configFile} reload"; - } // extraConfig; + } + // extraConfig; }; in diff --git a/nixos/modules/services/networking/asterisk.nix b/nixos/modules/services/networking/asterisk.nix index 28b169f09782..308d594a10da 100644 --- a/nixos/modules/services/networking/asterisk.nix +++ b/nixos/modules/services/networking/asterisk.nix @@ -16,45 +16,44 @@ let # Add filecontents from files of useTheseDefaultConfFiles to confFiles, do not override defaultConfFiles = lib.subtractLists (lib.attrNames cfg.confFiles) cfg.useTheseDefaultConfFiles; - allConfFiles = - { - # Default asterisk.conf file - "asterisk.conf".text = '' - [directories] - astetcdir => /etc/asterisk - astmoddir => ${cfg.package}/lib/asterisk/modules - astvarlibdir => /var/lib/asterisk - astdbdir => /var/lib/asterisk - astkeydir => /var/lib/asterisk - astdatadir => /var/lib/asterisk - astagidir => /var/lib/asterisk/agi-bin - astspooldir => /var/spool/asterisk - astrundir => /run/asterisk - astlogdir => /var/log/asterisk - astsbindir => ${cfg.package}/sbin - ${cfg.extraConfig} - ''; + allConfFiles = { + # Default asterisk.conf file + "asterisk.conf".text = '' + [directories] + astetcdir => /etc/asterisk + astmoddir => ${cfg.package}/lib/asterisk/modules + astvarlibdir => /var/lib/asterisk + astdbdir => /var/lib/asterisk + astkeydir => /var/lib/asterisk + astdatadir => /var/lib/asterisk + astagidir => /var/lib/asterisk/agi-bin + astspooldir => /var/spool/asterisk + astrundir => /run/asterisk + astlogdir => /var/log/asterisk + astsbindir => ${cfg.package}/sbin + ${cfg.extraConfig} + ''; - # Loading all modules by default is considered sensible by the authors of - # "Asterisk: The Definitive Guide". Secure sites will likely want to - # specify their own "modules.conf" in the confFiles option. - "modules.conf".text = '' - [modules] - autoload=yes - ''; + # Loading all modules by default is considered sensible by the authors of + # "Asterisk: The Definitive Guide". Secure sites will likely want to + # specify their own "modules.conf" in the confFiles option. + "modules.conf".text = '' + [modules] + autoload=yes + ''; - # Use syslog for logging so logs can be viewed with journalctl - "logger.conf".text = '' - [general] + # Use syslog for logging so logs can be viewed with journalctl + "logger.conf".text = '' + [general] - [logfiles] - syslog.local0 => notice,warning,error - ''; - } - // lib.mapAttrs (name: text: { inherit text; }) cfg.confFiles - // lib.listToAttrs ( - map (x: lib.nameValuePair x { source = cfg.package + "/etc/asterisk/" + x; }) defaultConfFiles - ); + [logfiles] + syslog.local0 => notice,warning,error + ''; + } + // lib.mapAttrs (name: text: { inherit text; }) cfg.confFiles + // lib.listToAttrs ( + map (x: lib.nameValuePair x { source = cfg.package + "/etc/asterisk/" + x; }) defaultConfFiles + ); in diff --git a/nixos/modules/services/networking/babeld.nix b/nixos/modules/services/networking/babeld.nix index bc5574139d35..7e007415acf8 100644 --- a/nixos/modules/services/networking/babeld.nix +++ b/nixos/modules/services/networking/babeld.nix @@ -96,16 +96,15 @@ in config = lib.mkIf config.services.babeld.enable { - boot.kernel.sysctl = - { - "net.ipv6.conf.all.forwarding" = 1; - "net.ipv6.conf.all.accept_redirects" = 0; - "net.ipv4.conf.all.forwarding" = 1; - "net.ipv4.conf.all.rp_filter" = 0; - } - // lib.mapAttrs' ( - ifname: _: lib.nameValuePair "net.ipv4.conf.${ifname}.rp_filter" (lib.mkDefault 0) - ) config.services.babeld.interfaces; + boot.kernel.sysctl = { + "net.ipv6.conf.all.forwarding" = 1; + "net.ipv6.conf.all.accept_redirects" = 0; + "net.ipv4.conf.all.forwarding" = 1; + "net.ipv4.conf.all.rp_filter" = 0; + } + // lib.mapAttrs' ( + ifname: _: lib.nameValuePair "net.ipv4.conf.${ifname}.rp_filter" (lib.mkDefault 0) + ) config.services.babeld.interfaces; systemd.services.babeld = { description = "Babel routing daemon"; diff --git a/nixos/modules/services/networking/cloudflare-dyndns.nix b/nixos/modules/services/networking/cloudflare-dyndns.nix index c8597d28c209..675fedeaf9b4 100644 --- a/nixos/modules/services/networking/cloudflare-dyndns.nix +++ b/nixos/modules/services/networking/cloudflare-dyndns.nix @@ -78,53 +78,53 @@ in }; config = lib.mkIf cfg.enable { - systemd.services.cloudflare-dyndns = - { - description = "CloudFlare Dynamic DNS Client"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; + systemd.services.cloudflare-dyndns = { + description = "CloudFlare Dynamic DNS Client"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; - environment = { - CLOUDFLARE_DOMAINS = toString cfg.domains; - }; - - serviceConfig = { - Type = "simple"; - DynamicUser = true; - StateDirectory = "cloudflare-dyndns"; - Environment = [ "XDG_CACHE_HOME=%S/cloudflare-dyndns/.cache" ]; - LoadCredential = [ - "apiToken:${cfg.apiTokenFile}" - ]; - }; - - script = - let - args = - [ "--cache-file /var/lib/cloudflare-dyndns/ip.cache" ] - ++ (if cfg.ipv4 then [ "-4" ] else [ "-no-4" ]) - ++ (if cfg.ipv6 then [ "-6" ] else [ "-no-6" ]) - ++ lib.optional cfg.deleteMissing "--delete-missing" - ++ lib.optional cfg.proxied "--proxied"; - in - '' - export CLOUDFLARE_API_TOKEN_FILE=''${CREDENTIALS_DIRECTORY}/apiToken - - # Added 2025-03-10: `cfg.apiTokenFile` used to be passed as an - # `EnvironmentFile` to the service, which required it to be of - # the form "CLOUDFLARE_API_TOKEN=" rather than just the secret. - # If we detect this legacy usage, error out. - token=$(< "''${CLOUDFLARE_API_TOKEN_FILE}") - if [[ $token == CLOUDFLARE_API_TOKEN* ]]; then - echo "Error: your api token starts with 'CLOUDFLARE_API_TOKEN='. Remove that, and instead specify just the token." >&2 - exit 1 - fi - - exec ${lib.getExe cfg.package} ${toString args} - ''; - } - // lib.optionalAttrs (cfg.frequency != null) { - startAt = cfg.frequency; + environment = { + CLOUDFLARE_DOMAINS = toString cfg.domains; }; + + serviceConfig = { + Type = "simple"; + DynamicUser = true; + StateDirectory = "cloudflare-dyndns"; + Environment = [ "XDG_CACHE_HOME=%S/cloudflare-dyndns/.cache" ]; + LoadCredential = [ + "apiToken:${cfg.apiTokenFile}" + ]; + }; + + script = + let + args = [ + "--cache-file /var/lib/cloudflare-dyndns/ip.cache" + ] + ++ (if cfg.ipv4 then [ "-4" ] else [ "-no-4" ]) + ++ (if cfg.ipv6 then [ "-6" ] else [ "-no-6" ]) + ++ lib.optional cfg.deleteMissing "--delete-missing" + ++ lib.optional cfg.proxied "--proxied"; + in + '' + export CLOUDFLARE_API_TOKEN_FILE=''${CREDENTIALS_DIRECTORY}/apiToken + + # Added 2025-03-10: `cfg.apiTokenFile` used to be passed as an + # `EnvironmentFile` to the service, which required it to be of + # the form "CLOUDFLARE_API_TOKEN=" rather than just the secret. + # If we detect this legacy usage, error out. + token=$(< "''${CLOUDFLARE_API_TOKEN_FILE}") + if [[ $token == CLOUDFLARE_API_TOKEN* ]]; then + echo "Error: your api token starts with 'CLOUDFLARE_API_TOKEN='. Remove that, and instead specify just the token." >&2 + exit 1 + fi + + exec ${lib.getExe cfg.package} ${toString args} + ''; + } + // lib.optionalAttrs (cfg.frequency != null) { + startAt = cfg.frequency; + }; }; } diff --git a/nixos/modules/services/networking/cloudflared.nix b/nixos/modules/services/networking/cloudflared.nix index 0a6a09dabf2b..4ba6a631a733 100644 --- a/nixos/modules/services/networking/cloudflared.nix +++ b/nixos/modules/services/networking/cloudflared.nix @@ -369,7 +369,8 @@ in RuntimeDirectoryMode = "0400"; LoadCredential = [ "credentials.json:${tunnel.credentialsFile}" - ] ++ (lib.optional (certFile != null) "cert.pem:${certFile}"); + ] + ++ (lib.optional (certFile != null) "cert.pem:${certFile}"); ExecStart = "${cfg.package}/bin/cloudflared tunnel --config=${mkConfigFile} --no-autoupdate run"; Restart = "on-failure"; diff --git a/nixos/modules/services/networking/consul.nix b/nixos/modules/services/networking/consul.nix index 74fcaaaddcdc..f20f20a87fe9 100644 --- a/nixos/modules/services/networking/consul.nix +++ b/nixos/modules/services/networking/consul.nix @@ -15,12 +15,14 @@ let ui_config = { enabled = cfg.webUi; }; - } // cfg.extraConfig; + } + // cfg.extraConfig; configFiles = [ "/etc/consul.json" "/etc/consul-addrs.json" - ] ++ cfg.extraConfigFiles; + ] + ++ cfg.extraConfigFiles; devices = lib.attrValues (lib.filterAttrs (_: i: i != null) cfg.interface); systemdDevices = lib.forEach devices ( @@ -193,26 +195,26 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" ] ++ systemdDevices; bindsTo = systemdDevices; - restartTriggers = - [ config.environment.etc."consul.json".source ] - ++ lib.mapAttrsToList (_: d: d.source) ( - lib.filterAttrs (n: _: lib.hasPrefix "consul.d/" n) config.environment.etc - ); + restartTriggers = [ + config.environment.etc."consul.json".source + ] + ++ lib.mapAttrsToList (_: d: d.source) ( + lib.filterAttrs (n: _: lib.hasPrefix "consul.d/" n) config.environment.etc + ); - serviceConfig = - { - ExecStart = - "@${lib.getExe cfg.package} consul agent -config-dir /etc/consul.d" - + lib.concatMapStrings (n: " -config-file ${n}") configFiles; - ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; - PermissionsStartOnly = true; - User = if cfg.dropPrivileges then "consul" else null; - Restart = "on-failure"; - TimeoutStartSec = "infinity"; - } - // (lib.optionalAttrs (cfg.leaveOnStop) { - ExecStop = "${lib.getExe cfg.package} leave"; - }); + serviceConfig = { + ExecStart = + "@${lib.getExe cfg.package} consul agent -config-dir /etc/consul.d" + + lib.concatMapStrings (n: " -config-file ${n}") configFiles; + ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; + PermissionsStartOnly = true; + User = if cfg.dropPrivileges then "consul" else null; + Restart = "on-failure"; + TimeoutStartSec = "infinity"; + } + // (lib.optionalAttrs (cfg.leaveOnStop) { + ExecStop = "${lib.getExe cfg.package} leave"; + }); path = with pkgs; [ iproute2 diff --git a/nixos/modules/services/networking/coturn.nix b/nixos/modules/services/networking/coturn.nix index 044d3ba0b791..8d60deda0085 100644 --- a/nixos/modules/services/networking/coturn.nix +++ b/nixos/modules/services/networking/coturn.nix @@ -409,16 +409,15 @@ in ProtectProc = "invisible"; ProtectSystem = "strict"; RemoveIPC = true; - RestrictAddressFamilies = - [ - "AF_INET" - "AF_INET6" - "AF_UNIX" - ] - ++ lib.optionals (cfg.listening-ips == [ ]) [ - # only used for interface discovery when no listening ips are configured - "AF_NETLINK" - ]; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_UNIX" + ] + ++ lib.optionals (cfg.listening-ips == [ ]) [ + # only used for interface discovery when no listening ips are configured + "AF_NETLINK" + ]; RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; diff --git a/nixos/modules/services/networking/croc.nix b/nixos/modules/services/networking/croc.nix index b6395992af82..1e8bf9026cdd 100644 --- a/nixos/modules/services/networking/croc.nix +++ b/nixos/modules/services/networking/croc.nix @@ -79,7 +79,8 @@ in InaccessiblePaths = [ "-+${rootDir}" ]; BindReadOnlyPaths = [ builtins.storeDir - ] ++ lib.optional (types.path.check cfg.pass) cfg.pass; + ] + ++ lib.optional (types.path.check cfg.pass) cfg.pass; # This is for BindReadOnlyPaths= # to allow traversal of directories they create in RootDirectory=. UMask = "0066"; diff --git a/nixos/modules/services/networking/dae.nix b/nixos/modules/services/networking/dae.nix index 328db5850dcc..bc907066749e 100644 --- a/nixos/modules/services/networking/dae.nix +++ b/nixos/modules/services/networking/dae.nix @@ -152,7 +152,8 @@ in ExecStartPre = [ "" "${daeBin} validate -c \${CREDENTIALS_DIRECTORY}/config.dae" - ] ++ (with lib; optional cfg.disableTxChecksumIpGeneric TxChecksumIpGenericWorkaround); + ] + ++ (with lib; optional cfg.disableTxChecksumIpGeneric TxChecksumIpGenericWorkaround); ExecStart = [ "" "${daeBin} run --disable-timestamp -c \${CREDENTIALS_DIRECTORY}/config.dae" diff --git a/nixos/modules/services/networking/dhcpcd.nix b/nixos/modules/services/networking/dhcpcd.nix index e3616c64b95f..7b78140b0563 100644 --- a/nixos/modules/services/networking/dhcpcd.nix +++ b/nixos/modules/services/networking/dhcpcd.nix @@ -295,16 +295,15 @@ in # dhcpcd. So do a "systemctl restart" instead. stopIfChanged = false; - path = - [ - dhcpcd - config.networking.resolvconf.package - ] - ++ lib.optional cfg.setHostname ( - pkgs.writeShellScriptBin "hostname" '' - ${lib.getExe' pkgs.systemd "hostnamectl"} set-hostname --transient $1 - '' - ); + path = [ + dhcpcd + config.networking.resolvconf.package + ] + ++ lib.optional cfg.setHostname ( + pkgs.writeShellScriptBin "hostname" '' + ${lib.getExe' pkgs.systemd "hostnamectl"} set-hostname --transient $1 + '' + ); unitConfig.ConditionCapability = "CAP_NET_ADMIN"; @@ -341,12 +340,13 @@ in "CAP_NET_RAW" "CAP_NET_BIND_SERVICE" ]; - ReadWritePaths = - [ "/proc/sys/net/ipv4" ] - ++ lib.optional cfgN.enableIPv6 "/proc/sys/net/ipv6" - ++ lib.optionals useResolvConf ( - [ "/run/resolvconf" ] ++ config.networking.resolvconf.subscriberFiles - ); + ReadWritePaths = [ + "/proc/sys/net/ipv4" + ] + ++ lib.optional cfgN.enableIPv6 "/proc/sys/net/ipv6" + ++ lib.optionals useResolvConf ( + [ "/run/resolvconf" ] ++ config.networking.resolvconf.subscriberFiles + ); DeviceAllow = ""; LockPersonality = true; MemoryDenyWriteExecute = true; @@ -375,18 +375,17 @@ in RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; - SystemCallFilter = - [ - "@system-service" - "~@aio" - "~@keyring" - "~@memlock" - "~@mount" - ] - ++ lib.optionals (!cfg.allowSetuid) [ - "~@privileged" - "~@resources" - ]; + SystemCallFilter = [ + "@system-service" + "~@aio" + "~@keyring" + "~@memlock" + "~@mount" + ] + ++ lib.optionals (!cfg.allowSetuid) [ + "~@privileged" + "~@resources" + ]; SystemCallArchitectures = "native"; UMask = "0027"; }; diff --git a/nixos/modules/services/networking/doh-server.nix b/nixos/modules/services/networking/doh-server.nix index baa3e1844946..834179ef9001 100644 --- a/nixos/modules/services/networking/doh-server.nix +++ b/nixos/modules/services/networking/doh-server.nix @@ -154,7 +154,8 @@ in documentation = [ "https://github.com/m13253/dns-over-https" ]; after = [ "network.target" - ] ++ lib.optional (cfg.useACMEHost != null) "acme-${cfg.useACMEHost}.service"; + ] + ++ lib.optional (cfg.useACMEHost != null) "acme-${cfg.useACMEHost}.service"; wants = lib.optional (cfg.useACMEHost != null) "acme-finished-${cfg.useACMEHost}.target"; wantedBy = [ "multi-user.target" ]; serviceConfig = { diff --git a/nixos/modules/services/networking/ejabberd.nix b/nixos/modules/services/networking/ejabberd.nix index b71b38a47af4..c4d692812c47 100644 --- a/nixos/modules/services/networking/ejabberd.nix +++ b/nixos/modules/services/networking/ejabberd.nix @@ -113,7 +113,8 @@ in path = [ pkgs.findutils pkgs.coreutils - ] ++ lib.optional cfg.imagemagick pkgs.imagemagick; + ] + ++ lib.optional cfg.imagemagick pkgs.imagemagick; serviceConfig = { User = cfg.user; diff --git a/nixos/modules/services/networking/firefox-syncserver.nix b/nixos/modules/services/networking/firefox-syncserver.nix index 352faed492dc..b13ce25a06c0 100644 --- a/nixos/modules/services/networking/firefox-syncserver.nix +++ b/nixos/modules/services/networking/firefox-syncserver.nix @@ -21,25 +21,24 @@ let syncstorage = { database_url = dbURL; }; - tokenserver = - { - node_type = "mysql"; - database_url = dbURL; - fxa_email_domain = "api.accounts.firefox.com"; - fxa_oauth_server_url = "https://oauth.accounts.firefox.com/v1"; - run_migrations = true; - # if JWK caching is not enabled the token server must verify tokens - # using the fxa api, on a thread pool with a static size. - additional_blocking_threads_for_fxa_requests = 10; - } - // lib.optionalAttrs cfg.singleNode.enable { - # Single-node mode is likely to be used on small instances with little - # capacity. The default value (0.1) can only ever release capacity when - # accounts are removed if the total capacity is 10 or larger to begin - # with. - # https://github.com/mozilla-services/syncstorage-rs/issues/1313#issuecomment-1145293375 - node_capacity_release_rate = 1; - }; + tokenserver = { + node_type = "mysql"; + database_url = dbURL; + fxa_email_domain = "api.accounts.firefox.com"; + fxa_oauth_server_url = "https://oauth.accounts.firefox.com/v1"; + run_migrations = true; + # if JWK caching is not enabled the token server must verify tokens + # using the fxa api, on a thread pool with a static size. + additional_blocking_threads_for_fxa_requests = 10; + } + // lib.optionalAttrs cfg.singleNode.enable { + # Single-node mode is likely to be used on small instances with little + # capacity. The default value (0.1) can only ever release capacity when + # accounts are removed if the total capacity is 10 or larger to begin + # with. + # https://github.com/mozilla-services/syncstorage-rs/issues/1313#issuecomment-1145293375 + node_capacity_release_rate = 1; + }; }; configFile = format.generate "syncstorage.toml" (lib.recursiveUpdate settings cfg.settings); setupScript = pkgs.writeShellScript "firefox-syncserver-setup" '' diff --git a/nixos/modules/services/networking/firewall.nix b/nixos/modules/services/networking/firewall.nix index af41f49ac554..e733e9e6b87b 100644 --- a/nixos/modules/services/networking/firewall.nix +++ b/nixos/modules/services/networking/firewall.nix @@ -283,13 +283,15 @@ in visible = false; default = { default = lib.mapAttrs (name: value: cfg.${name}) commonOptions; - } // cfg.interfaces; + } + // cfg.interfaces; type = with lib.types; attrsOf (submodule [ { options = commonOptions; } ]); description = '' All open ports. ''; }; - } // commonOptions; + } + // commonOptions; }; @@ -312,7 +314,8 @@ in environment.systemPackages = [ cfg.package pkgs.nixos-firewall-tool - ] ++ cfg.extraPackages; + ] + ++ cfg.extraPackages; boot.kernelModules = (lib.optional cfg.autoLoadConntrackHelpers "nf_conntrack") diff --git a/nixos/modules/services/networking/firezone/server.nix b/nixos/modules/services/networking/firezone/server.nix index f79e162cf179..3206d1d30e76 100644 --- a/nixos/modules/services/networking/firezone/server.nix +++ b/nixos/modules/services/networking/firezone/server.nix @@ -885,30 +885,29 @@ in config = mkMerge [ { - assertions = - [ - { - assertion = cfg.provision.enable -> cfg.domain.enable; - message = "Provisioning must be done on a machine running the firezone domain server"; - } - ] - ++ concatLists ( - flip mapAttrsToList cfg.provision.accounts ( - accountName: accountCfg: - [ - { - assertion = (builtins.match "^[[:lower:]_-]+$" accountName) != null; - message = "An account name must contain only lowercase characters and underscores, as it will be used as the URL slug for this account."; - } - ] - ++ flip mapAttrsToList accountCfg.auth ( - authName: _: { - assertion = (builtins.match "^[[:alnum:]_-]+$" authName) != null; - message = "The authentication provider attribute key must contain only letters, numbers, underscores or dashes."; - } - ) + assertions = [ + { + assertion = cfg.provision.enable -> cfg.domain.enable; + message = "Provisioning must be done on a machine running the firezone domain server"; + } + ] + ++ concatLists ( + flip mapAttrsToList cfg.provision.accounts ( + accountName: accountCfg: + [ + { + assertion = (builtins.match "^[[:lower:]_-]+$" accountName) != null; + message = "An account name must contain only lowercase characters and underscores, as it will be used as the URL slug for this account."; + } + ] + ++ flip mapAttrsToList accountCfg.auth ( + authName: _: { + assertion = (builtins.match "^[[:alnum:]_-]+$" authName) != null; + message = "The authentication provider attribute key must contain only letters, numbers, underscores or dashes."; + } ) - ); + ) + ); } # Enable all components if the main server is enabled (mkIf cfg.enable { @@ -1142,28 +1141,27 @@ in ''; path = [ pkgs.curl ]; - postStart = - '' - # Wait for the firezone server to come online - count=0 - while [[ "$(curl -s "http://localhost:${toString cfg.domain.settings.HEALTHZ_PORT}" 2>/dev/null || echo)" != '{"status":"ok"}' ]] - do - sleep 1 - if [[ "$count" -eq 30 ]]; then - echo "Tried for at least 30 seconds, giving up..." - exit 1 - fi - count=$((count++)) - done - '' - + optionalString cfg.provision.enable '' - # Wait for server to fully come up. Not ideal to use sleep, but at least it works. + postStart = '' + # Wait for the firezone server to come online + count=0 + while [[ "$(curl -s "http://localhost:${toString cfg.domain.settings.HEALTHZ_PORT}" 2>/dev/null || echo)" != '{"status":"ok"}' ]] + do sleep 1 + if [[ "$count" -eq 30 ]]; then + echo "Tried for at least 30 seconds, giving up..." + exit 1 + fi + count=$((count++)) + done + '' + + optionalString cfg.provision.enable '' + # Wait for server to fully come up. Not ideal to use sleep, but at least it works. + sleep 1 - ${loadSecretEnvironment "domain"} - ln -sTf ${provisionStateJson} provision-state.json - ${getExe cfg.domain.package} rpc 'Code.eval_file("${./provision.exs}")' - ''; + ${loadSecretEnvironment "domain"} + ln -sTf ${provisionStateJson} provision-state.json + ${getExe cfg.domain.package} rpc 'Code.eval_file("${./provision.exs}")' + ''; environment = collectEnvironment "domain"; serviceConfig = commonServiceConfig; diff --git a/nixos/modules/services/networking/flannel.nix b/nixos/modules/services/networking/flannel.nix index 822dbc2872a8..ad87a4bc0421 100644 --- a/nixos/modules/services/networking/flannel.nix +++ b/nixos/modules/services/networking/flannel.nix @@ -157,27 +157,26 @@ in description = "Flannel Service"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - environment = - { - FLANNELD_PUBLIC_IP = cfg.publicIp; - FLANNELD_IFACE = cfg.iface; - } - // lib.optionalAttrs (cfg.storageBackend == "etcd") { - FLANNELD_ETCD_ENDPOINTS = lib.concatStringsSep "," cfg.etcd.endpoints; - FLANNELD_ETCD_KEYFILE = cfg.etcd.keyFile; - FLANNELD_ETCD_CERTFILE = cfg.etcd.certFile; - FLANNELD_ETCD_CAFILE = cfg.etcd.caFile; - ETCDCTL_CERT = cfg.etcd.certFile; - ETCDCTL_KEY = cfg.etcd.keyFile; - ETCDCTL_CACERT = cfg.etcd.caFile; - ETCDCTL_ENDPOINTS = lib.concatStringsSep "," cfg.etcd.endpoints; - ETCDCTL_API = "3"; - } - // lib.optionalAttrs (cfg.storageBackend == "kubernetes") { - FLANNELD_KUBE_SUBNET_MGR = "true"; - FLANNELD_KUBECONFIG_FILE = cfg.kubeconfig; - NODE_NAME = cfg.nodeName; - }; + environment = { + FLANNELD_PUBLIC_IP = cfg.publicIp; + FLANNELD_IFACE = cfg.iface; + } + // lib.optionalAttrs (cfg.storageBackend == "etcd") { + FLANNELD_ETCD_ENDPOINTS = lib.concatStringsSep "," cfg.etcd.endpoints; + FLANNELD_ETCD_KEYFILE = cfg.etcd.keyFile; + FLANNELD_ETCD_CERTFILE = cfg.etcd.certFile; + FLANNELD_ETCD_CAFILE = cfg.etcd.caFile; + ETCDCTL_CERT = cfg.etcd.certFile; + ETCDCTL_KEY = cfg.etcd.keyFile; + ETCDCTL_CACERT = cfg.etcd.caFile; + ETCDCTL_ENDPOINTS = lib.concatStringsSep "," cfg.etcd.endpoints; + ETCDCTL_API = "3"; + } + // lib.optionalAttrs (cfg.storageBackend == "kubernetes") { + FLANNELD_KUBE_SUBNET_MGR = "true"; + FLANNELD_KUBECONFIG_FILE = cfg.kubeconfig; + NODE_NAME = cfg.nodeName; + }; path = [ pkgs.iptables ]; preStart = lib.optionalString (cfg.storageBackend == "etcd") '' echo "setting network configuration" diff --git a/nixos/modules/services/networking/frp.nix b/nixos/modules/services/networking/frp.nix index b09d54f47827..da731dabf082 100644 --- a/nixos/modules/services/networking/frp.nix +++ b/nixos/modules/services/networking/frp.nix @@ -80,7 +80,8 @@ in RestrictAddressFamilies = [ "AF_INET" "AF_INET6" - ] ++ lib.optionals isClient [ "AF_UNIX" ]; + ] + ++ lib.optionals isClient [ "AF_UNIX" ]; LockPersonality = true; MemoryDenyWriteExecute = true; RestrictRealtime = true; diff --git a/nixos/modules/services/networking/frr.nix b/nixos/modules/services/networking/frr.nix index dea0c9963462..fac18c6a246c 100644 --- a/nixos/modules/services/networking/frr.nix +++ b/nixos/modules/services/networking/frr.nix @@ -128,100 +128,99 @@ in { ###### interface - imports = - [ - { - options.services.frr = { - configFile = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - example = "/etc/frr/frr.conf"; - description = '' - Configuration file to use for FRR. - By default the NixOS generated files are used. - ''; - }; - config = lib.mkOption { - type = lib.types.lines; - default = ""; - example = '' - router rip - network 10.0.0.0/8 - router ospf - network 10.0.0.0/8 area 0 - router bgp 65001 - neighbor 10.0.0.1 remote-as 65001 - ''; - description = '' - FRR configuration statements. - ''; - }; - openFilesLimit = lib.mkOption { - type = lib.types.ints.unsigned; - default = 1024; - description = '' - This is the maximum number of FD's that will be available. Use a - reasonable value for your setup if you are expecting a large number - of peers in say BGP. - ''; - }; + imports = [ + { + options.services.frr = { + configFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + example = "/etc/frr/frr.conf"; + description = '' + Configuration file to use for FRR. + By default the NixOS generated files are used. + ''; }; - } - { options.services.frr = (lib.genAttrs allDaemons serviceOptions); } - (lib.mkRemovedOptionModule [ "services" "frr" "zebra" "enable" ] "FRR zebra is always enabled") - ] - ++ (map ( - d: lib.mkRenamedOptionModule [ "services" "frr" d "enable" ] [ "services" "frr" "${d}d" "enable" ] - ) renamedServices) - ++ (map - ( - d: - lib.mkRenamedOptionModule - [ "services" "frr" d "extraOptions" ] - [ "services" "frr" "${d}d" "extraOptions" ] - ) - ( - renamedServices - ++ [ - "static" - "mgmt" - ] - ) + config = lib.mkOption { + type = lib.types.lines; + default = ""; + example = '' + router rip + network 10.0.0.0/8 + router ospf + network 10.0.0.0/8 area 0 + router bgp 65001 + neighbor 10.0.0.1 remote-as 65001 + ''; + description = '' + FRR configuration statements. + ''; + }; + openFilesLimit = lib.mkOption { + type = lib.types.ints.unsigned; + default = 1024; + description = '' + This is the maximum number of FD's that will be available. Use a + reasonable value for your setup if you are expecting a large number + of peers in say BGP. + ''; + }; + }; + } + { options.services.frr = (lib.genAttrs allDaemons serviceOptions); } + (lib.mkRemovedOptionModule [ "services" "frr" "zebra" "enable" ] "FRR zebra is always enabled") + ] + ++ (map ( + d: lib.mkRenamedOptionModule [ "services" "frr" d "enable" ] [ "services" "frr" "${d}d" "enable" ] + ) renamedServices) + ++ (map + ( + d: + lib.mkRenamedOptionModule + [ "services" "frr" d "extraOptions" ] + [ "services" "frr" "${d}d" "extraOptions" ] ) - ++ (map (d: lib.mkRemovedOptionModule [ "services" "frr" d "enable" ] "FRR ${d}d is always enabled") - [ + ( + renamedServices + ++ [ "static" "mgmt" ] ) - ++ (map ( - d: - lib.mkRemovedOptionModule [ - "services" - "frr" - d - "config" - ] "FRR switched to integrated-vtysh-config, please use services.frr.config" - ) obsoleteServices) - ++ (map ( - d: - lib.mkRemovedOptionModule [ "services" "frr" d "configFile" ] - "FRR switched to integrated-vtysh-config, please use services.frr.config or services.frr.configFile" - ) obsoleteServices) - ++ (map ( - d: - lib.mkRemovedOptionModule [ - "services" - "frr" - d - "vtyListenAddress" - ] "Please change -A option in services.frr.${d}.options instead" - ) obsoleteServices) - ++ (map ( - d: - lib.mkRemovedOptionModule [ "services" "frr" d "vtyListenPort" ] - "Please use `-P «vtyListenPort»` option with services.frr.${d}.extraOptions instead, or change services.frr.${d}.options accordingly" - ) obsoleteServices); + ) + ++ (map (d: lib.mkRemovedOptionModule [ "services" "frr" d "enable" ] "FRR ${d}d is always enabled") + [ + "static" + "mgmt" + ] + ) + ++ (map ( + d: + lib.mkRemovedOptionModule [ + "services" + "frr" + d + "config" + ] "FRR switched to integrated-vtysh-config, please use services.frr.config" + ) obsoleteServices) + ++ (map ( + d: + lib.mkRemovedOptionModule [ "services" "frr" d "configFile" ] + "FRR switched to integrated-vtysh-config, please use services.frr.config or services.frr.configFile" + ) obsoleteServices) + ++ (map ( + d: + lib.mkRemovedOptionModule [ + "services" + "frr" + d + "vtyListenAddress" + ] "Please change -A option in services.frr.${d}.options instead" + ) obsoleteServices) + ++ (map ( + d: + lib.mkRemovedOptionModule [ "services" "frr" d "vtyListenPort" ] + "Please use `-P «vtyListenPort»` option with services.frr.${d}.extraOptions instead, or change services.frr.${d}.options accordingly" + ) obsoleteServices); ###### implementation diff --git a/nixos/modules/services/networking/gns3-server.nix b/nixos/modules/services/networking/gns3-server.nix index 769cde21bc20..21679a3d8364 100644 --- a/nixos/modules/services/networking/gns3-server.nix +++ b/nixos/modules/services/networking/gns3-server.nix @@ -259,15 +259,14 @@ in PrivateUsers = false; # Hardening - DeviceAllow = - [ - # ubridge needs access to tun/tap devices - "/dev/net/tap rw" - "/dev/net/tun rw" - ] - ++ lib.optionals flags.enableLibvirtd [ - "/dev/kvm" - ]; + DeviceAllow = [ + # ubridge needs access to tun/tap devices + "/dev/net/tap rw" + "/dev/net/tun rw" + ] + ++ lib.optionals flags.enableLibvirtd [ + "/dev/kvm" + ]; DevicePolicy = "closed"; LockPersonality = true; MemoryDenyWriteExecute = true; diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix index 9bf9f1a4c3a0..c7c9c60b68f9 100644 --- a/nixos/modules/services/networking/hostapd.nix +++ b/nixos/modules/services/networking/hostapd.nix @@ -1030,79 +1030,78 @@ in ); in { - settings = - { - ssid = bssCfg.ssid; - utf8_ssid = bssCfg.utf8Ssid; + settings = { + ssid = bssCfg.ssid; + utf8_ssid = bssCfg.utf8Ssid; - logger_syslog = mkDefault (-1); - logger_syslog_level = bssCfg.logLevel; - logger_stdout = mkDefault (-1); - logger_stdout_level = bssCfg.logLevel; - ctrl_interface = mkDefault "/run/hostapd"; - ctrl_interface_group = bssCfg.group; + logger_syslog = mkDefault (-1); + logger_syslog_level = bssCfg.logLevel; + logger_stdout = mkDefault (-1); + logger_stdout_level = bssCfg.logLevel; + ctrl_interface = mkDefault "/run/hostapd"; + ctrl_interface_group = bssCfg.group; - macaddr_acl = bssCfg.macAcl; + macaddr_acl = bssCfg.macAcl; - ignore_broadcast_ssid = bssCfg.ignoreBroadcastSsid; + ignore_broadcast_ssid = bssCfg.ignoreBroadcastSsid; - # IEEE 802.11i (authentication) related configuration - # Encrypt management frames to protect against deauthentication and similar attacks - ieee80211w = mkDefault 1; - sae_require_mfp = mkDefault 1; + # IEEE 802.11i (authentication) related configuration + # Encrypt management frames to protect against deauthentication and similar attacks + ieee80211w = mkDefault 1; + sae_require_mfp = mkDefault 1; - # Only allow WPA by default and disable insecure WEP - auth_algs = mkDefault 1; - # Always enable QoS, which is required for 802.11n and above - wmm_enabled = mkDefault true; - ap_isolate = bssCfg.apIsolate; - } - // optionalAttrs (bssCfg.bssid != null) { - bssid = bssCfg.bssid; - } - // - optionalAttrs - (bssCfg.macAllow != [ ] || bssCfg.macAllowFile != null || bssCfg.authentication.saeAddToMacAllow) - { - accept_mac_file = "/run/hostapd/${bssCfg._module.args.name}.mac.allow"; - } - // optionalAttrs (bssCfg.macDeny != [ ] || bssCfg.macDenyFile != null) { - deny_mac_file = "/run/hostapd/${bssCfg._module.args.name}.mac.deny"; - } - // optionalAttrs (bssCfg.authentication.mode == "none") { - wpa = mkDefault 0; - } - // optionalAttrs (bssCfg.authentication.mode == "wpa3-sae") { - wpa = 2; - wpa_key_mgmt = "SAE"; - # Derive PWE using both hunting-and-pecking loop and hash-to-element - sae_pwe = 2; - # Prevent downgrade attacks by indicating to clients that they should - # disable any transition modes from now on. - transition_disable = "0x01"; - } - // optionalAttrs (bssCfg.authentication.mode == "wpa3-sae-transition") { - wpa = 2; - wpa_key_mgmt = "WPA-PSK-SHA256 SAE"; - } - // optionalAttrs (bssCfg.authentication.mode == "wpa2-sha1") { - wpa = 2; - wpa_key_mgmt = "WPA-PSK"; - } - // optionalAttrs (bssCfg.authentication.mode == "wpa2-sha256") { - wpa = 2; - wpa_key_mgmt = "WPA-PSK-SHA256"; - } - // optionalAttrs (bssCfg.authentication.mode != "none") { - wpa_pairwise = pairwiseCiphers; - rsn_pairwise = pairwiseCiphers; - } - // optionalAttrs (bssCfg.authentication.wpaPassword != null) { - wpa_passphrase = bssCfg.authentication.wpaPassword; - } - // optionalAttrs (bssCfg.authentication.wpaPskFile != null) { - wpa_psk_file = toString bssCfg.authentication.wpaPskFile; - }; + # Only allow WPA by default and disable insecure WEP + auth_algs = mkDefault 1; + # Always enable QoS, which is required for 802.11n and above + wmm_enabled = mkDefault true; + ap_isolate = bssCfg.apIsolate; + } + // optionalAttrs (bssCfg.bssid != null) { + bssid = bssCfg.bssid; + } + // + optionalAttrs + (bssCfg.macAllow != [ ] || bssCfg.macAllowFile != null || bssCfg.authentication.saeAddToMacAllow) + { + accept_mac_file = "/run/hostapd/${bssCfg._module.args.name}.mac.allow"; + } + // optionalAttrs (bssCfg.macDeny != [ ] || bssCfg.macDenyFile != null) { + deny_mac_file = "/run/hostapd/${bssCfg._module.args.name}.mac.deny"; + } + // optionalAttrs (bssCfg.authentication.mode == "none") { + wpa = mkDefault 0; + } + // optionalAttrs (bssCfg.authentication.mode == "wpa3-sae") { + wpa = 2; + wpa_key_mgmt = "SAE"; + # Derive PWE using both hunting-and-pecking loop and hash-to-element + sae_pwe = 2; + # Prevent downgrade attacks by indicating to clients that they should + # disable any transition modes from now on. + transition_disable = "0x01"; + } + // optionalAttrs (bssCfg.authentication.mode == "wpa3-sae-transition") { + wpa = 2; + wpa_key_mgmt = "WPA-PSK-SHA256 SAE"; + } + // optionalAttrs (bssCfg.authentication.mode == "wpa2-sha1") { + wpa = 2; + wpa_key_mgmt = "WPA-PSK"; + } + // optionalAttrs (bssCfg.authentication.mode == "wpa2-sha256") { + wpa = 2; + wpa_key_mgmt = "WPA-PSK-SHA256"; + } + // optionalAttrs (bssCfg.authentication.mode != "none") { + wpa_pairwise = pairwiseCiphers; + rsn_pairwise = pairwiseCiphers; + } + // optionalAttrs (bssCfg.authentication.wpaPassword != null) { + wpa_passphrase = bssCfg.authentication.wpaPassword; + } + // optionalAttrs (bssCfg.authentication.wpaPskFile != null) { + wpa_psk_file = toString bssCfg.authentication.wpaPskFile; + }; dynamicConfigScripts = let @@ -1326,96 +1325,95 @@ in ]; config = mkIf cfg.enable { - assertions = - [ - { - assertion = cfg.radios != { }; - message = "At least one radio must be configured with hostapd!"; - } - ] - # Radio warnings - ++ (concatLists ( - mapAttrsToList ( - radio: radioCfg: - [ - { - assertion = radioCfg.networks != { }; - message = "hostapd radio ${radio}: At least one network must be configured!"; - } - # XXX: There could be many more useful assertions about (band == xy) -> ensure other required settings. - # see https://github.com/openwrt/openwrt/blob/539cb5389d9514c99ec1f87bd4465f77c7ed9b93/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh#L158 - { - assertion = length (filter (bss: bss == radio) (attrNames radioCfg.networks)) == 1; - message = ''hostapd radio ${radio}: Exactly one network must be named like the radio, for reasons internal to hostapd.''; - } - { - assertion = - (radioCfg.wifi4.enable && builtins.elem "HT40-" radioCfg.wifi4.capabilities) - -> radioCfg.channel != 0; - message = ''hostapd radio ${radio}: using ACS (channel = 0) together with HT40- (wifi4.capabilities) is unsupported by hostapd''; - } - ] - # BSS warnings - ++ (concatLists ( - mapAttrsToList ( - bss: bssCfg: - let - auth = bssCfg.authentication; - countWpaPasswordDefinitions = count (x: x != null) [ - auth.wpaPassword - auth.wpaPasswordFile - auth.wpaPskFile - ]; - in - [ - { - assertion = hasPrefix radio bss; - message = "hostapd radio ${radio} bss ${bss}: The bss (network) name ${bss} is invalid. It must be prefixed by the radio name for reasons internal to hostapd. A valid name would be e.g. ${radio}, ${radio}-1, ..."; - } - { - assertion = (length (attrNames radioCfg.networks) > 1) -> (bssCfg.bssid != null); - message = ''hostapd radio ${radio} bss ${bss}: bssid must be specified manually (for now) since this radio uses multiple BSS.''; - } - { - assertion = countWpaPasswordDefinitions <= 1; - message = ''hostapd radio ${radio} bss ${bss}: must use at most one WPA password option (wpaPassword, wpaPasswordFile, wpaPskFile)''; - } - { - assertion = - auth.wpaPassword != null - -> (stringLength auth.wpaPassword >= 8 && stringLength auth.wpaPassword <= 63); - message = ''hostapd radio ${radio} bss ${bss}: uses a wpaPassword of invalid length (must be in [8,63]).''; - } - { - assertion = auth.saePasswords == [ ] || auth.saePasswordsFile == null; - message = ''hostapd radio ${radio} bss ${bss}: must use only one SAE password option (saePasswords or saePasswordsFile)''; - } - { - assertion = auth.mode == "wpa3-sae" -> (auth.saePasswords != [ ] || auth.saePasswordsFile != null); - message = ''hostapd radio ${radio} bss ${bss}: uses WPA3-SAE which requires defining a sae password option''; - } - { - assertion = - auth.mode == "wpa3-sae-transition" - -> (auth.saePasswords != [ ] || auth.saePasswordsFile != null) && countWpaPasswordDefinitions == 1; - message = ''hostapd radio ${radio} bss ${bss}: uses WPA3-SAE in transition mode requires defining both a wpa password option and a sae password option''; - } - { - assertion = - (auth.mode == "wpa2-sha1" || auth.mode == "wpa2-sha256") -> countWpaPasswordDefinitions == 1; - message = ''hostapd radio ${radio} bss ${bss}: uses WPA2-PSK which requires defining a wpa password option''; - } - ] - ++ optionals (auth.saePasswords != [ ]) ( - imap1 (i: entry: { - assertion = (entry.password == null) != (entry.passwordFile == null); - message = ''hostapd radio ${radio} bss ${bss} saePassword entry ${i}: must set exactly one of `password` or `passwordFile`''; - }) auth.saePasswords - ) - ) radioCfg.networks - )) - ) cfg.radios - )); + assertions = [ + { + assertion = cfg.radios != { }; + message = "At least one radio must be configured with hostapd!"; + } + ] + # Radio warnings + ++ (concatLists ( + mapAttrsToList ( + radio: radioCfg: + [ + { + assertion = radioCfg.networks != { }; + message = "hostapd radio ${radio}: At least one network must be configured!"; + } + # XXX: There could be many more useful assertions about (band == xy) -> ensure other required settings. + # see https://github.com/openwrt/openwrt/blob/539cb5389d9514c99ec1f87bd4465f77c7ed9b93/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh#L158 + { + assertion = length (filter (bss: bss == radio) (attrNames radioCfg.networks)) == 1; + message = ''hostapd radio ${radio}: Exactly one network must be named like the radio, for reasons internal to hostapd.''; + } + { + assertion = + (radioCfg.wifi4.enable && builtins.elem "HT40-" radioCfg.wifi4.capabilities) + -> radioCfg.channel != 0; + message = ''hostapd radio ${radio}: using ACS (channel = 0) together with HT40- (wifi4.capabilities) is unsupported by hostapd''; + } + ] + # BSS warnings + ++ (concatLists ( + mapAttrsToList ( + bss: bssCfg: + let + auth = bssCfg.authentication; + countWpaPasswordDefinitions = count (x: x != null) [ + auth.wpaPassword + auth.wpaPasswordFile + auth.wpaPskFile + ]; + in + [ + { + assertion = hasPrefix radio bss; + message = "hostapd radio ${radio} bss ${bss}: The bss (network) name ${bss} is invalid. It must be prefixed by the radio name for reasons internal to hostapd. A valid name would be e.g. ${radio}, ${radio}-1, ..."; + } + { + assertion = (length (attrNames radioCfg.networks) > 1) -> (bssCfg.bssid != null); + message = ''hostapd radio ${radio} bss ${bss}: bssid must be specified manually (for now) since this radio uses multiple BSS.''; + } + { + assertion = countWpaPasswordDefinitions <= 1; + message = ''hostapd radio ${radio} bss ${bss}: must use at most one WPA password option (wpaPassword, wpaPasswordFile, wpaPskFile)''; + } + { + assertion = + auth.wpaPassword != null + -> (stringLength auth.wpaPassword >= 8 && stringLength auth.wpaPassword <= 63); + message = ''hostapd radio ${radio} bss ${bss}: uses a wpaPassword of invalid length (must be in [8,63]).''; + } + { + assertion = auth.saePasswords == [ ] || auth.saePasswordsFile == null; + message = ''hostapd radio ${radio} bss ${bss}: must use only one SAE password option (saePasswords or saePasswordsFile)''; + } + { + assertion = auth.mode == "wpa3-sae" -> (auth.saePasswords != [ ] || auth.saePasswordsFile != null); + message = ''hostapd radio ${radio} bss ${bss}: uses WPA3-SAE which requires defining a sae password option''; + } + { + assertion = + auth.mode == "wpa3-sae-transition" + -> (auth.saePasswords != [ ] || auth.saePasswordsFile != null) && countWpaPasswordDefinitions == 1; + message = ''hostapd radio ${radio} bss ${bss}: uses WPA3-SAE in transition mode requires defining both a wpa password option and a sae password option''; + } + { + assertion = + (auth.mode == "wpa2-sha1" || auth.mode == "wpa2-sha256") -> countWpaPasswordDefinitions == 1; + message = ''hostapd radio ${radio} bss ${bss}: uses WPA2-PSK which requires defining a wpa password option''; + } + ] + ++ optionals (auth.saePasswords != [ ]) ( + imap1 (i: entry: { + assertion = (entry.password == null) != (entry.passwordFile == null); + message = ''hostapd radio ${radio} bss ${bss} saePassword entry ${i}: must set exactly one of `password` or `passwordFile`''; + }) auth.saePasswords + ) + ) radioCfg.networks + )) + ) cfg.radios + )); environment.systemPackages = [ cfg.package ]; diff --git a/nixos/modules/services/networking/i2pd.nix b/nixos/modules/services/networking/i2pd.nix index d7784b0a1c88..054970d59e53 100644 --- a/nixos/modules/services/networking/i2pd.nix +++ b/nixos/modules/services/networking/i2pd.nix @@ -122,100 +122,98 @@ let notice = "# DO NOT EDIT -- this file has been generated automatically."; i2pdConf = let - opts = - [ - notice - (strOpt "loglevel" cfg.logLevel) - (boolOpt "logclftime" cfg.logCLFTime) - (boolOpt "ipv4" cfg.enableIPv4) - (boolOpt "ipv6" cfg.enableIPv6) - (boolOpt "notransit" cfg.notransit) - (boolOpt "floodfill" cfg.floodfill) - (intOpt "netid" cfg.netid) - ] - ++ (optionalNullInt "bandwidth" cfg.bandwidth) - ++ (optionalNullInt "port" cfg.port) - ++ (optionalNullString "family" cfg.family) - ++ (optionalNullString "datadir" cfg.dataDir) - ++ (optionalNullInt "share" cfg.share) - ++ (optionalNullBool "ssu" cfg.ssu) - ++ (optionalNullBool "ntcp" cfg.ntcp) - ++ (optionalNullString "ntcpproxy" cfg.ntcpProxy) - ++ (optionalNullString "ifname" cfg.ifname) - ++ (optionalNullString "ifname4" cfg.ifname4) - ++ (optionalNullString "ifname6" cfg.ifname6) - ++ [ - (sec "limits") - (intOpt "transittunnels" cfg.limits.transittunnels) - (intOpt "coresize" cfg.limits.coreSize) - (intOpt "openfiles" cfg.limits.openFiles) - (intOpt "ntcphard" cfg.limits.ntcpHard) - (intOpt "ntcpsoft" cfg.limits.ntcpSoft) - (intOpt "ntcpthreads" cfg.limits.ntcpThreads) - (sec "upnp") - (boolOpt "enabled" cfg.upnp.enable) - (sec "precomputation") - (boolOpt "elgamal" cfg.precomputation.elgamal) - (sec "reseed") - (boolOpt "verify" cfg.reseed.verify) - ] - ++ (optionalNullString "file" cfg.reseed.file) - ++ (optionalEmptyList "urls" cfg.reseed.urls) - ++ (optionalNullString "floodfill" cfg.reseed.floodfill) - ++ (optionalNullString "zipfile" cfg.reseed.zipfile) - ++ (optionalNullString "proxy" cfg.reseed.proxy) - ++ [ - (sec "trust") - (boolOpt "enabled" cfg.trust.enable) - (boolOpt "hidden" cfg.trust.hidden) - ] - ++ (optionalEmptyList "routers" cfg.trust.routers) - ++ (optionalNullString "family" cfg.trust.family) - ++ [ - (sec "websockets") - (boolOpt "enabled" cfg.websocket.enable) - (strOpt "address" cfg.websocket.address) - (intOpt "port" cfg.websocket.port) - (sec "exploratory") - (intOpt "inbound.length" cfg.exploratory.inbound.length) - (intOpt "inbound.quantity" cfg.exploratory.inbound.quantity) - (intOpt "outbound.length" cfg.exploratory.outbound.length) - (intOpt "outbound.quantity" cfg.exploratory.outbound.quantity) - (sec "ntcp2") - (boolOpt "enabled" cfg.ntcp2.enable) - (boolOpt "published" cfg.ntcp2.published) - (intOpt "port" cfg.ntcp2.port) - (sec "addressbook") - (strOpt "defaulturl" cfg.addressbook.defaulturl) - ] - ++ (optionalEmptyList "subscriptions" cfg.addressbook.subscriptions) - ++ [ - (sec "meshnets") - (boolOpt "yggdrasil" cfg.yggdrasil.enable) - ] - ++ (optionalNullString "yggaddress" cfg.yggdrasil.address) - ++ (lib.flip map (lib.collect (proto: proto ? port && proto ? address) cfg.proto) ( - proto: - let - protoOpts = - [ - (sec proto.name) - (boolOpt "enabled" proto.enable) - (strOpt "address" proto.address) - (intOpt "port" proto.port) - ] - ++ (optionals (proto ? keys) (optionalNullString "keys" proto.keys)) - ++ (optionals (proto ? auth) (optionalNullBool "auth" proto.auth)) - ++ (optionals (proto ? user) (optionalNullString "user" proto.user)) - ++ (optionals (proto ? pass) (optionalNullString "pass" proto.pass)) - ++ (optionals (proto ? strictHeaders) (optionalNullBool "strictheaders" proto.strictHeaders)) - ++ (optionals (proto ? hostname) (optionalNullString "hostname" proto.hostname)) - ++ (optionals (proto ? outproxy) (optionalNullString "outproxy" proto.outproxy)) - ++ (optionals (proto ? outproxyPort) (optionalNullInt "outproxyport" proto.outproxyPort)) - ++ (optionals (proto ? outproxyEnable) (optionalNullBool "outproxy.enabled" proto.outproxyEnable)); - in - (lib.concatStringsSep "\n" protoOpts) - )); + opts = [ + notice + (strOpt "loglevel" cfg.logLevel) + (boolOpt "logclftime" cfg.logCLFTime) + (boolOpt "ipv4" cfg.enableIPv4) + (boolOpt "ipv6" cfg.enableIPv6) + (boolOpt "notransit" cfg.notransit) + (boolOpt "floodfill" cfg.floodfill) + (intOpt "netid" cfg.netid) + ] + ++ (optionalNullInt "bandwidth" cfg.bandwidth) + ++ (optionalNullInt "port" cfg.port) + ++ (optionalNullString "family" cfg.family) + ++ (optionalNullString "datadir" cfg.dataDir) + ++ (optionalNullInt "share" cfg.share) + ++ (optionalNullBool "ssu" cfg.ssu) + ++ (optionalNullBool "ntcp" cfg.ntcp) + ++ (optionalNullString "ntcpproxy" cfg.ntcpProxy) + ++ (optionalNullString "ifname" cfg.ifname) + ++ (optionalNullString "ifname4" cfg.ifname4) + ++ (optionalNullString "ifname6" cfg.ifname6) + ++ [ + (sec "limits") + (intOpt "transittunnels" cfg.limits.transittunnels) + (intOpt "coresize" cfg.limits.coreSize) + (intOpt "openfiles" cfg.limits.openFiles) + (intOpt "ntcphard" cfg.limits.ntcpHard) + (intOpt "ntcpsoft" cfg.limits.ntcpSoft) + (intOpt "ntcpthreads" cfg.limits.ntcpThreads) + (sec "upnp") + (boolOpt "enabled" cfg.upnp.enable) + (sec "precomputation") + (boolOpt "elgamal" cfg.precomputation.elgamal) + (sec "reseed") + (boolOpt "verify" cfg.reseed.verify) + ] + ++ (optionalNullString "file" cfg.reseed.file) + ++ (optionalEmptyList "urls" cfg.reseed.urls) + ++ (optionalNullString "floodfill" cfg.reseed.floodfill) + ++ (optionalNullString "zipfile" cfg.reseed.zipfile) + ++ (optionalNullString "proxy" cfg.reseed.proxy) + ++ [ + (sec "trust") + (boolOpt "enabled" cfg.trust.enable) + (boolOpt "hidden" cfg.trust.hidden) + ] + ++ (optionalEmptyList "routers" cfg.trust.routers) + ++ (optionalNullString "family" cfg.trust.family) + ++ [ + (sec "websockets") + (boolOpt "enabled" cfg.websocket.enable) + (strOpt "address" cfg.websocket.address) + (intOpt "port" cfg.websocket.port) + (sec "exploratory") + (intOpt "inbound.length" cfg.exploratory.inbound.length) + (intOpt "inbound.quantity" cfg.exploratory.inbound.quantity) + (intOpt "outbound.length" cfg.exploratory.outbound.length) + (intOpt "outbound.quantity" cfg.exploratory.outbound.quantity) + (sec "ntcp2") + (boolOpt "enabled" cfg.ntcp2.enable) + (boolOpt "published" cfg.ntcp2.published) + (intOpt "port" cfg.ntcp2.port) + (sec "addressbook") + (strOpt "defaulturl" cfg.addressbook.defaulturl) + ] + ++ (optionalEmptyList "subscriptions" cfg.addressbook.subscriptions) + ++ [ + (sec "meshnets") + (boolOpt "yggdrasil" cfg.yggdrasil.enable) + ] + ++ (optionalNullString "yggaddress" cfg.yggdrasil.address) + ++ (lib.flip map (lib.collect (proto: proto ? port && proto ? address) cfg.proto) ( + proto: + let + protoOpts = [ + (sec proto.name) + (boolOpt "enabled" proto.enable) + (strOpt "address" proto.address) + (intOpt "port" proto.port) + ] + ++ (optionals (proto ? keys) (optionalNullString "keys" proto.keys)) + ++ (optionals (proto ? auth) (optionalNullBool "auth" proto.auth)) + ++ (optionals (proto ? user) (optionalNullString "user" proto.user)) + ++ (optionals (proto ? pass) (optionalNullString "pass" proto.pass)) + ++ (optionals (proto ? strictHeaders) (optionalNullBool "strictheaders" proto.strictHeaders)) + ++ (optionals (proto ? hostname) (optionalNullString "hostname" proto.hostname)) + ++ (optionals (proto ? outproxy) (optionalNullString "outproxy" proto.outproxy)) + ++ (optionals (proto ? outproxyPort) (optionalNullInt "outproxyport" proto.outproxyPort)) + ++ (optionals (proto ? outproxyEnable) (optionalNullBool "outproxy.enabled" proto.outproxyEnable)); + in + (lib.concatStringsSep "\n" protoOpts) + )); in pkgs.writeText "i2pd.conf" (lib.concatStringsSep "\n" opts); @@ -224,40 +222,38 @@ let mkOutTunnel = tun: let - outTunOpts = - [ - (sec tun.name) - "type = client" - (intOpt "port" tun.port) - (strOpt "destination" tun.destination) - ] - ++ (optionals (tun ? destinationPort) (optionalNullInt "destinationport" tun.destinationPort)) - ++ (optionals (tun ? keys) (optionalNullString "keys" tun.keys)) - ++ (optionals (tun ? address) (optionalNullString "address" tun.address)) - ++ (optionals (tun ? inbound.length) (optionalNullInt "inbound.length" tun.inbound.length)) - ++ (optionals (tun ? inbound.quantity) (optionalNullInt "inbound.quantity" tun.inbound.quantity)) - ++ (optionals (tun ? outbound.length) (optionalNullInt "outbound.length" tun.outbound.length)) - ++ (optionals (tun ? outbound.quantity) (optionalNullInt "outbound.quantity" tun.outbound.quantity)) - ++ (optionals (tun ? crypto.tagsToSend) ( - optionalNullInt "crypto.tagstosend" tun.crypto.tagsToSend - )); + outTunOpts = [ + (sec tun.name) + "type = client" + (intOpt "port" tun.port) + (strOpt "destination" tun.destination) + ] + ++ (optionals (tun ? destinationPort) (optionalNullInt "destinationport" tun.destinationPort)) + ++ (optionals (tun ? keys) (optionalNullString "keys" tun.keys)) + ++ (optionals (tun ? address) (optionalNullString "address" tun.address)) + ++ (optionals (tun ? inbound.length) (optionalNullInt "inbound.length" tun.inbound.length)) + ++ (optionals (tun ? inbound.quantity) (optionalNullInt "inbound.quantity" tun.inbound.quantity)) + ++ (optionals (tun ? outbound.length) (optionalNullInt "outbound.length" tun.outbound.length)) + ++ (optionals (tun ? outbound.quantity) (optionalNullInt "outbound.quantity" tun.outbound.quantity)) + ++ (optionals (tun ? crypto.tagsToSend) ( + optionalNullInt "crypto.tagstosend" tun.crypto.tagsToSend + )); in lib.concatStringsSep "\n" outTunOpts; mkInTunnel = tun: let - inTunOpts = - [ - (sec tun.name) - "type = server" - (intOpt "port" tun.port) - (strOpt "host" tun.address) - ] - ++ (optionals (tun ? destination) (optionalNullString "destination" tun.destination)) - ++ (optionals (tun ? keys) (optionalNullString "keys" tun.keys)) - ++ (optionals (tun ? inPort) (optionalNullInt "inport" tun.inPort)) - ++ (optionals (tun ? accessList) (optionalEmptyList "accesslist" tun.accessList)); + inTunOpts = [ + (sec tun.name) + "type = server" + (intOpt "port" tun.port) + (strOpt "host" tun.address) + ] + ++ (optionals (tun ? destination) (optionalNullString "destination" tun.destination)) + ++ (optionals (tun ? keys) (optionalNullString "keys" tun.keys)) + ++ (optionals (tun ? inPort) (optionalNullInt "inport" tun.inPort)) + ++ (optionals (tun ? accessList) (optionalEmptyList "accesslist" tun.accessList)); in lib.concatStringsSep "\n" inTunOpts; @@ -678,7 +674,8 @@ in default = null; description = "Connect to particular port at destination."; }; - } // commonTunOpts name; + } + // commonTunOpts name; config = { name = mkDefault name; }; @@ -707,7 +704,8 @@ in default = [ ]; description = "I2P nodes that are allowed to connect to this service."; }; - } // commonTunOpts name; + } + // commonTunOpts name; config = { name = mkDefault name; }; diff --git a/nixos/modules/services/networking/jibri/default.nix b/nixos/modules/services/networking/jibri/default.nix index 94018ef99f4b..ea99cb0f321e 100644 --- a/nixos/modules/services/networking/jibri/default.nix +++ b/nixos/modules/services/networking/jibri/default.nix @@ -71,7 +71,8 @@ let "--enabled" "--disable-infobars" "--autoplay-policy=no-user-gesture-required" - ] ++ lists.optional cfg.ignoreCert "--ignore-certificate-errors"; + ] + ++ lists.optional cfg.ignoreCert "--ignore-certificate-errors"; stats.enable-stats-d = true; webhook.subscribers = [ ]; diff --git a/nixos/modules/services/networking/jitsi-videobridge.nix b/nixos/modules/services/networking/jitsi-videobridge.nix index e488b07caa4a..a55760d5cae2 100644 --- a/nixos/modules/services/networking/jitsi-videobridge.nix +++ b/nixos/modules/services/networking/jitsi-videobridge.nix @@ -253,7 +253,8 @@ in "-Dconfig.file" = format.generate "jvb.conf" jvbConfig; # Mitigate CVE-2021-44228 "-Dlog4j2.formatMsgNoLookups" = true; - } // (lib.mapAttrs' (k: v: lib.nameValuePair "-D${k}" v) cfg.extraProperties); + } + // (lib.mapAttrs' (k: v: lib.nameValuePair "-D${k}" v) cfg.extraProperties); in { aliases = [ "jitsi-videobridge.service" ]; diff --git a/nixos/modules/services/networking/jool.nix b/nixos/modules/services/networking/jool.nix index e782bd587fc5..ea73eb123384 100644 --- a/nixos/modules/services/networking/jool.nix +++ b/nixos/modules/services/networking/jool.nix @@ -102,7 +102,8 @@ let ExecStartPre = "${pkgs.kmod}/bin/modprobe jool"; ExecStart = "${jool-cli}/bin/jool file handle ${nat64Conf name}"; ExecStop = "${jool-cli}/bin/jool -f ${nat64Conf name} instance remove"; - } // hardening; + } + // hardening; }; }; @@ -118,7 +119,8 @@ let ExecStartPre = "${pkgs.kmod}/bin/modprobe jool_siit"; ExecStart = "${jool-cli}/bin/jool_siit file handle ${siitConf name}"; ExecStop = "${jool-cli}/bin/jool_siit -f ${siitConf name} instance remove"; - } // hardening; + } + // hardening; }; }; diff --git a/nixos/modules/services/networking/kea.nix b/nixos/modules/services/networking/kea.nix index 39b2380cadd3..2b142f61152d 100644 --- a/nixos/modules/services/networking/kea.nix +++ b/nixos/modules/services/networking/kea.nix @@ -325,7 +325,8 @@ in ExecStart = "${package}/bin/kea-ctrl-agent -c /etc/kea/ctrl-agent.conf ${lib.escapeShellArgs cfg.ctrl-agent.extraArgs}"; KillMode = "process"; Restart = "on-failure"; - } // commonServiceConfig; + } + // commonServiceConfig; }; }) @@ -377,7 +378,8 @@ in "CAP_NET_BIND_SERVICE" "CAP_NET_RAW" ]; - } // commonServiceConfig; + } + // commonServiceConfig; }; }) @@ -427,7 +429,8 @@ in CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; - } // commonServiceConfig; + } + // commonServiceConfig; }; }) @@ -474,7 +477,8 @@ in CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; - } // commonServiceConfig; + } + // commonServiceConfig; }; }) diff --git a/nixos/modules/services/networking/knot.nix b/nixos/modules/services/networking/knot.nix index 12a72bfe02c7..9702dfdbcb2c 100644 --- a/nixos/modules/services/networking/knot.nix +++ b/nixos/modules/services/networking/knot.nix @@ -364,10 +364,12 @@ in AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" - ] ++ xdpCapabilities; + ] + ++ xdpCapabilities; CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" - ] ++ xdpCapabilities; + ] + ++ xdpCapabilities; DeviceAllow = ""; DevicePolicy = "closed"; LockPersonality = true; @@ -388,16 +390,15 @@ in ProtectSystem = "strict"; RemoveIPC = true; Restart = "on-abort"; - RestrictAddressFamilies = - [ - "AF_INET" - "AF_INET6" - "AF_UNIX" - ] - ++ optionals (cfg.enableXDP) [ - "AF_NETLINK" - "AF_XDP" - ]; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_UNIX" + ] + ++ optionals (cfg.enableXDP) [ + "AF_NETLINK" + "AF_XDP" + ]; RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; @@ -405,15 +406,14 @@ in StateDirectory = "knot"; StateDirectoryMode = "0700"; SystemCallArchitectures = "native"; - SystemCallFilter = - [ - "@system-service" - "~@privileged" - "@chown" - ] - ++ optionals (cfg.enableXDP) [ - "bpf" - ]; + SystemCallFilter = [ + "@system-service" + "~@privileged" + "@chown" + ] + ++ optionals (cfg.enableXDP) [ + "bpf" + ]; UMask = "0077"; }; }; diff --git a/nixos/modules/services/networking/kresd.nix b/nixos/modules/services/networking/kresd.nix index 5373dbf76ca9..5c7facbcb530 100644 --- a/nixos/modules/services/networking/kresd.nix +++ b/nixos/modules/services/networking/kresd.nix @@ -170,7 +170,8 @@ in wantedBy = [ "multi-user.target" ]; wants = [ "kres-cache-gc.service" - ] ++ map (i: "kresd@${toString i}.service") (lib.range 1 cfg.instances); + ] + ++ map (i: "kresd@${toString i}.service") (lib.range 1 cfg.instances); }; systemd.services."kresd@".serviceConfig = { ExecStart = diff --git a/nixos/modules/services/networking/libreswan.nix b/nixos/modules/services/networking/libreswan.nix index 57cbb9a8a6c6..3db291411509 100644 --- a/nixos/modules/services/networking/libreswan.nix +++ b/nixos/modules/services/networking/libreswan.nix @@ -153,7 +153,8 @@ in ''; "ipsec.conf".source = "${pkgs.libreswan}/etc/ipsec.conf"; "ipsec.d/01-nixos.conf".source = configFile; - } // policyFiles; + } + // policyFiles; systemd.services.ipsec = { description = "Internet Key Exchange (IKE) Protocol Daemon for IPsec"; diff --git a/nixos/modules/services/networking/microsocks.nix b/nixos/modules/services/networking/microsocks.nix index 9956b8f158eb..6d95f6db67bf 100644 --- a/nixos/modules/services/networking/microsocks.nix +++ b/nixos/modules/services/networking/microsocks.nix @@ -13,23 +13,22 @@ let "${cfg.execWrapper} ${cfg.package}/bin/microsocks" else "${cfg.package}/bin/microsocks"; - args = - [ - "-i" - cfg.ip - "-p" - (toString cfg.port) - ] - ++ lib.optionals (cfg.authOnce) [ "-1" ] - ++ lib.optionals (cfg.disableLogging) [ "-q" ] - ++ lib.optionals (cfg.outgoingBindIp != null) [ - "-b" - cfg.outgoingBindIp - ] - ++ lib.optionals (cfg.authUsername != null) [ - "-u" - cfg.authUsername - ]; + args = [ + "-i" + cfg.ip + "-p" + (toString cfg.port) + ] + ++ lib.optionals (cfg.authOnce) [ "-1" ] + ++ lib.optionals (cfg.disableLogging) [ "-q" ] + ++ lib.optionals (cfg.outgoingBindIp != null) [ + "-b" + cfg.outgoingBindIp + ] + ++ lib.optionals (cfg.authUsername != null) [ + "-u" + cfg.authUsername + ]; in { options.services.microsocks = { diff --git a/nixos/modules/services/networking/mihomo.nix b/nixos/modules/services/networking/mihomo.nix index 05d3d304d460..cc2130575260 100644 --- a/nixos/modules/services/networking/mihomo.nix +++ b/nixos/modules/services/networking/mihomo.nix @@ -62,56 +62,55 @@ in requires = [ "network-online.target" ]; after = [ "network-online.target" ]; wantedBy = [ "multi-user.target" ]; - serviceConfig = - { - ExecStart = lib.concatStringsSep " " [ - (lib.getExe cfg.package) - "-d /var/lib/private/mihomo" - "-f \${CREDENTIALS_DIRECTORY}/config.yaml" - (lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}") - (lib.optionalString (cfg.extraOpts != null) cfg.extraOpts) - ]; + serviceConfig = { + ExecStart = lib.concatStringsSep " " [ + (lib.getExe cfg.package) + "-d /var/lib/private/mihomo" + "-f \${CREDENTIALS_DIRECTORY}/config.yaml" + (lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}") + (lib.optionalString (cfg.extraOpts != null) cfg.extraOpts) + ]; - DynamicUser = true; - StateDirectory = "mihomo"; - LoadCredential = "config.yaml:${cfg.configFile}"; + DynamicUser = true; + StateDirectory = "mihomo"; + LoadCredential = "config.yaml:${cfg.configFile}"; - ### Hardening - AmbientCapabilities = ""; - CapabilityBoundingSet = ""; - DeviceAllow = ""; - LockPersonality = true; - MemoryDenyWriteExecute = true; - NoNewPrivileges = true; - PrivateDevices = true; - PrivateMounts = true; - PrivateTmp = true; - PrivateUsers = true; - ProcSubset = "pid"; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHome = true; - ProtectHostname = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - ProtectSystem = "strict"; - RestrictRealtime = true; - RestrictSUIDSGID = true; - RestrictNamespaces = true; - RestrictAddressFamilies = "AF_INET AF_INET6"; - SystemCallArchitectures = "native"; - SystemCallFilter = "@system-service bpf"; - UMask = "0077"; - } - // lib.optionalAttrs cfg.tunMode { - AmbientCapabilities = "CAP_NET_ADMIN"; - CapabilityBoundingSet = "CAP_NET_ADMIN"; - PrivateDevices = false; - PrivateUsers = false; - RestrictAddressFamilies = "AF_INET AF_INET6 AF_NETLINK"; - }; + ### Hardening + AmbientCapabilities = ""; + CapabilityBoundingSet = ""; + DeviceAllow = ""; + LockPersonality = true; + MemoryDenyWriteExecute = true; + NoNewPrivileges = true; + PrivateDevices = true; + PrivateMounts = true; + PrivateTmp = true; + PrivateUsers = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectHostname = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + ProtectSystem = "strict"; + RestrictRealtime = true; + RestrictSUIDSGID = true; + RestrictNamespaces = true; + RestrictAddressFamilies = "AF_INET AF_INET6"; + SystemCallArchitectures = "native"; + SystemCallFilter = "@system-service bpf"; + UMask = "0077"; + } + // lib.optionalAttrs cfg.tunMode { + AmbientCapabilities = "CAP_NET_ADMIN"; + CapabilityBoundingSet = "CAP_NET_ADMIN"; + PrivateDevices = false; + PrivateUsers = false; + RestrictAddressFamilies = "AF_INET AF_INET6 AF_NETLINK"; + }; }; }; diff --git a/nixos/modules/services/networking/mosquitto.nix b/nixos/modules/services/networking/mosquitto.nix index 9753d0a4a542..c9e0a2738fa5 100644 --- a/nixos/modules/services/networking/mosquitto.nix +++ b/nixos/modules/services/networking/mosquitto.nix @@ -717,7 +717,8 @@ in ReadWritePaths = [ cfg.dataDir "/tmp" # mosquitto_passwd creates files in /tmp before moving them - ] ++ lib.filter path.check cfg.logDest; + ] + ++ lib.filter path.check cfg.logDest; ReadOnlyPaths = map (p: "${p}") ( cfg.includeDirs ++ lib.filter (v: v != null) ( diff --git a/nixos/modules/services/networking/mtprotoproxy.nix b/nixos/modules/services/networking/mtprotoproxy.nix index fa97131b737a..2efe5af6f4b2 100644 --- a/nixos/modules/services/networking/mtprotoproxy.nix +++ b/nixos/modules/services/networking/mtprotoproxy.nix @@ -11,14 +11,13 @@ let cfg = config.services.mtprotoproxy; - configOpts = - { - PORT = cfg.port; - USERS = cfg.users; - SECURE_ONLY = cfg.secureOnly; - } - // lib.optionalAttrs (cfg.adTag != null) { AD_TAG = cfg.adTag; } - // cfg.extraConfig; + configOpts = { + PORT = cfg.port; + USERS = cfg.users; + SECURE_ONLY = cfg.secureOnly; + } + // lib.optionalAttrs (cfg.adTag != null) { AD_TAG = cfg.adTag; } + // cfg.extraConfig; convertOption = opt: diff --git a/nixos/modules/services/networking/murmur.nix b/nixos/modules/services/networking/murmur.nix index ff46a52ca17a..98387d5acdf8 100644 --- a/nixos/modules/services/networking/murmur.nix +++ b/nixos/modules/services/networking/murmur.nix @@ -384,44 +384,43 @@ in }) ]; - security.apparmor.policies."bin.mumble-server".profile = - '' - include + security.apparmor.policies."bin.mumble-server".profile = '' + include - ${cfg.package}/bin/{mumble-server,.mumble-server-wrapped} { - include - include - include - include "${pkgs.apparmorRulesFromClosure { name = "mumble-server"; } cfg.package}" - pix ${cfg.package}/bin/.mumble-server-wrapped, + ${cfg.package}/bin/{mumble-server,.mumble-server-wrapped} { + include + include + include + include "${pkgs.apparmorRulesFromClosure { name = "mumble-server"; } cfg.package}" + pix ${cfg.package}/bin/.mumble-server-wrapped, - r ${config.environment.etc."os-release".source}, - r ${config.environment.etc."lsb-release".source}, - owner rwk ${cfg.stateDir}/murmur.sqlite, - owner rw ${cfg.stateDir}/murmur.sqlite-journal, - owner r ${cfg.stateDir}/, - r /run/murmur/murmurd.pid, - r /run/murmur/murmurd.ini, - r ${configFile}, - '' - + lib.optionalString (cfg.logFile != null) '' - rw ${cfg.logFile}, - '' - + lib.optionalString (cfg.sslCert != "") '' - r ${cfg.sslCert}, - '' - + lib.optionalString (cfg.sslKey != "") '' - r ${cfg.sslKey}, - '' - + lib.optionalString (cfg.sslCa != "") '' - r ${cfg.sslCa}, - '' - + lib.optionalString (cfg.dbus != null) '' - dbus bus=${cfg.dbus} - '' - + '' - } - ''; + r ${config.environment.etc."os-release".source}, + r ${config.environment.etc."lsb-release".source}, + owner rwk ${cfg.stateDir}/murmur.sqlite, + owner rw ${cfg.stateDir}/murmur.sqlite-journal, + owner r ${cfg.stateDir}/, + r /run/murmur/murmurd.pid, + r /run/murmur/murmurd.ini, + r ${configFile}, + '' + + lib.optionalString (cfg.logFile != null) '' + rw ${cfg.logFile}, + '' + + lib.optionalString (cfg.sslCert != "") '' + r ${cfg.sslCert}, + '' + + lib.optionalString (cfg.sslKey != "") '' + r ${cfg.sslKey}, + '' + + lib.optionalString (cfg.sslCa != "") '' + r ${cfg.sslCa}, + '' + + lib.optionalString (cfg.dbus != null) '' + dbus bus=${cfg.dbus} + '' + + '' + } + ''; }; meta.maintainers = with lib.maintainers; [ felixsinger ]; diff --git a/nixos/modules/services/networking/nat.nix b/nixos/modules/services/networking/nat.nix index 71a719d6d8db..87457beb39a5 100644 --- a/nixos/modules/services/networking/nat.nix +++ b/nixos/modules/services/networking/nat.nix @@ -196,21 +196,20 @@ in boot = { kernelModules = [ "nf_nat_ftp" ]; - kernel.sysctl = - { - "net.ipv4.conf.all.forwarding" = mkOverride 99 true; - "net.ipv4.conf.default.forwarding" = mkOverride 99 true; - } - // optionalAttrs cfg.enableIPv6 { - # Do not prevent IPv6 autoconfiguration. - # See . - "net.ipv6.conf.all.accept_ra" = mkOverride 99 2; - "net.ipv6.conf.default.accept_ra" = mkOverride 99 2; + kernel.sysctl = { + "net.ipv4.conf.all.forwarding" = mkOverride 99 true; + "net.ipv4.conf.default.forwarding" = mkOverride 99 true; + } + // optionalAttrs cfg.enableIPv6 { + # Do not prevent IPv6 autoconfiguration. + # See . + "net.ipv6.conf.all.accept_ra" = mkOverride 99 2; + "net.ipv6.conf.default.accept_ra" = mkOverride 99 2; - # Forward IPv6 packets. - "net.ipv6.conf.all.forwarding" = mkOverride 99 true; - "net.ipv6.conf.default.forwarding" = mkOverride 99 true; - }; + # Forward IPv6 packets. + "net.ipv6.conf.all.forwarding" = mkOverride 99 true; + "net.ipv6.conf.default.forwarding" = mkOverride 99 true; + }; }; }; diff --git a/nixos/modules/services/networking/ncdns.nix b/nixos/modules/services/networking/ncdns.nix index f12a2be5f913..ee3f38f33e2a 100644 --- a/nixos/modules/services/networking/ncdns.nix +++ b/nixos/modules/services/networking/ncdns.nix @@ -202,28 +202,27 @@ in }; services.ncdns.settings = mkDefaultAttrs { - ncdns = - { - # Namecoin RPC - namecoinrpcaddress = "${cfgs.namecoind.rpc.address}:${toString cfgs.namecoind.rpc.port}"; - namecoinrpcusername = cfgs.namecoind.rpc.user; - namecoinrpcpassword = cfgs.namecoind.rpc.password; + ncdns = { + # Namecoin RPC + namecoinrpcaddress = "${cfgs.namecoind.rpc.address}:${toString cfgs.namecoind.rpc.port}"; + namecoinrpcusername = cfgs.namecoind.rpc.user; + namecoinrpcpassword = cfgs.namecoind.rpc.password; - # Identity - selfname = cfg.identity.hostname; - hostmaster = cfg.identity.hostmaster; - selfip = cfg.identity.address; + # Identity + selfname = cfg.identity.hostname; + hostmaster = cfg.identity.hostmaster; + selfip = cfg.identity.address; - # Other - bind = "${cfg.address}:${toString cfg.port}"; - } - // lib.optionalAttrs cfg.dnssec.enable { - # DNSSEC - publickey = "../.." + cfg.dnssec.keys.public; - privatekey = "../.." + cfg.dnssec.keys.private; - zonepublickey = "../.." + cfg.dnssec.keys.zonePublic; - zoneprivatekey = "../.." + cfg.dnssec.keys.zonePrivate; - }; + # Other + bind = "${cfg.address}:${toString cfg.port}"; + } + // lib.optionalAttrs cfg.dnssec.enable { + # DNSSEC + publickey = "../.." + cfg.dnssec.keys.public; + privatekey = "../.." + cfg.dnssec.keys.private; + zonepublickey = "../.." + cfg.dnssec.keys.zonePublic; + zoneprivatekey = "../.." + cfg.dnssec.keys.zonePrivate; + }; # Daemon service.daemon = true; diff --git a/nixos/modules/services/networking/netbird.nix b/nixos/modules/services/networking/netbird.nix index c41183b9d307..2d0f363e13ee 100644 --- a/nixos/modules/services/networking/netbird.nix +++ b/nixos/modules/services/networking/netbird.nix @@ -388,30 +388,28 @@ in }; }; - config.environment = - { - NB_STATE_DIR = client.dir.state; - NB_CONFIG = "${client.dir.state}/config.json"; - NB_DAEMON_ADDR = "unix://${client.dir.runtime}/sock"; - NB_INTERFACE_NAME = client.interface; - NB_LOG_FILE = mkOptionDefault "console"; - NB_LOG_LEVEL = client.logLevel; - NB_SERVICE = client.service.name; - NB_WIREGUARD_PORT = toString client.port; - } - // optionalAttrs (client.dns-resolver.address != null) { - NB_DNS_RESOLVER_ADDRESS = "${client.dns-resolver.address}:${builtins.toString client.dns-resolver.port}"; - }; + config.environment = { + NB_STATE_DIR = client.dir.state; + NB_CONFIG = "${client.dir.state}/config.json"; + NB_DAEMON_ADDR = "unix://${client.dir.runtime}/sock"; + NB_INTERFACE_NAME = client.interface; + NB_LOG_FILE = mkOptionDefault "console"; + NB_LOG_LEVEL = client.logLevel; + NB_SERVICE = client.service.name; + NB_WIREGUARD_PORT = toString client.port; + } + // optionalAttrs (client.dns-resolver.address != null) { + NB_DNS_RESOLVER_ADDRESS = "${client.dns-resolver.address}:${builtins.toString client.dns-resolver.port}"; + }; - config.config = - { - DisableAutoConnect = !client.autoStart; - WgIface = client.interface; - WgPort = client.port; - } - // optionalAttrs (client.dns-resolver.address != null) { - CustomDNSAddress = "${client.dns-resolver.address}:${builtins.toString client.dns-resolver.port}"; - }; + config.config = { + DisableAutoConnect = !client.autoStart; + WgIface = client.interface; + WgPort = client.port; + } + // optionalAttrs (client.dns-resolver.address != null) { + CustomDNSAddress = "${client.dns-resolver.address}:${builtins.toString client.dns-resolver.port}"; + }; } ) ); @@ -576,26 +574,25 @@ in ProtectSystem = "strict"; ProtectHome = "yes"; - AmbientCapabilities = - [ - # see https://man7.org/linux/man-pages/man7/capabilities.7.html - # see https://docs.netbird.io/how-to/installation#running-net-bird-in-docker - # - # seems to work fine without CAP_SYS_ADMIN and CAP_SYS_RESOURCE - # CAP_NET_BIND_SERVICE could be added to allow binding on low ports, but is not required, - # see https://github.com/netbirdio/netbird/pull/1513 + AmbientCapabilities = [ + # see https://man7.org/linux/man-pages/man7/capabilities.7.html + # see https://docs.netbird.io/how-to/installation#running-net-bird-in-docker + # + # seems to work fine without CAP_SYS_ADMIN and CAP_SYS_RESOURCE + # CAP_NET_BIND_SERVICE could be added to allow binding on low ports, but is not required, + # see https://github.com/netbirdio/netbird/pull/1513 - # failed creating tunnel interface wt-priv: [operation not permitted - "CAP_NET_ADMIN" - # failed to pull up wgInterface [wt-priv]: failed to create ipv4 raw socket: socket: operation not permitted - "CAP_NET_RAW" - ] - # required for eBPF filter, used to be subset of CAP_SYS_ADMIN - ++ optional (versionAtLeast kernel.version "5.8") "CAP_BPF" - ++ optional (versionOlder kernel.version "5.8") "CAP_SYS_ADMIN" - ++ optional ( - client.dns-resolver.address != null && client.dns-resolver.port < 1024 - ) "CAP_NET_BIND_SERVICE"; + # failed creating tunnel interface wt-priv: [operation not permitted + "CAP_NET_ADMIN" + # failed to pull up wgInterface [wt-priv]: failed to create ipv4 raw socket: socket: operation not permitted + "CAP_NET_RAW" + ] + # required for eBPF filter, used to be subset of CAP_SYS_ADMIN + ++ optional (versionAtLeast kernel.version "5.8") "CAP_BPF" + ++ optional (versionOlder kernel.version "5.8") "CAP_SYS_ADMIN" + ++ optional ( + client.dns-resolver.address != null && client.dns-resolver.port < 1024 + ) "CAP_NET_BIND_SERVICE"; }; } ) diff --git a/nixos/modules/services/networking/netbird/coturn.nix b/nixos/modules/services/networking/netbird/coturn.nix index 442b2dadba2b..d7197a4ffb1f 100644 --- a/nixos/modules/services/networking/netbird/coturn.nix +++ b/nixos/modules/services/networking/netbird/coturn.nix @@ -104,24 +104,23 @@ in } ]; - services.coturn = - { - enable = true; + services.coturn = { + enable = true; - realm = cfg.domain; - lt-cred-mech = true; - no-cli = true; + realm = cfg.domain; + lt-cred-mech = true; + no-cli = true; - extraConfig = '' - fingerprint - user=${cfg.user}:${if cfg.password != null then cfg.password else "@password@"} - no-software-attribute - ''; - } - // (optionalAttrs cfg.useAcmeCertificates { - cert = "@cert@"; - pkey = "@pkey@"; - }); + extraConfig = '' + fingerprint + user=${cfg.user}:${if cfg.password != null then cfg.password else "@password@"} + no-software-attribute + ''; + } + // (optionalAttrs cfg.useAcmeCertificates { + cert = "@cert@"; + pkey = "@pkey@"; + }); systemd.services.coturn = let diff --git a/nixos/modules/services/networking/netbird/dashboard.nix b/nixos/modules/services/networking/netbird/dashboard.nix index cc1ab9f46ff1..bee3aeadd55e 100644 --- a/nixos/modules/services/networking/netbird/dashboard.nix +++ b/nixos/modules/services/networking/netbird/dashboard.nix @@ -92,33 +92,32 @@ in ]; services.netbird.server.dashboard = { - settings = - { - # Due to how the backend and frontend work this secret will be templated into the backend - # and then served statically from your website - # This enables you to login without the normally needed indirection through the backend - # but this also means anyone that can reach your website can - # fetch this secret, which is why there is no real need to put it into - # special options as its public anyway - # As far as I know leaking this secret is just - # an information leak as one can fetch some basic app - # information from the IDP - # To actually do something one still needs to have login - # data and this secret so this being public will not - # suffice for anything just decreasing security - AUTH_CLIENT_SECRET = ""; + settings = { + # Due to how the backend and frontend work this secret will be templated into the backend + # and then served statically from your website + # This enables you to login without the normally needed indirection through the backend + # but this also means anyone that can reach your website can + # fetch this secret, which is why there is no real need to put it into + # special options as its public anyway + # As far as I know leaking this secret is just + # an information leak as one can fetch some basic app + # information from the IDP + # To actually do something one still needs to have login + # data and this secret so this being public will not + # suffice for anything just decreasing security + AUTH_CLIENT_SECRET = ""; - NETBIRD_MGMT_API_ENDPOINT = cfg.managementServer; - NETBIRD_MGMT_GRPC_API_ENDPOINT = cfg.managementServer; - } - // (mapAttrs (_: mkDefault) { - # Those values have to be easily overridable - AUTH_AUDIENCE = "netbird"; # must be set for your devices to be able to log in - AUTH_CLIENT_ID = "netbird"; - AUTH_SUPPORTED_SCOPES = "openid profile email"; - NETBIRD_TOKEN_SOURCE = "idToken"; - USE_AUTH0 = false; - }); + NETBIRD_MGMT_API_ENDPOINT = cfg.managementServer; + NETBIRD_MGMT_GRPC_API_ENDPOINT = cfg.managementServer; + } + // (mapAttrs (_: mkDefault) { + # Those values have to be easily overridable + AUTH_AUDIENCE = "netbird"; # must be set for your devices to be able to log in + AUTH_CLIENT_ID = "netbird"; + AUTH_SUPPORTED_SCOPES = "openid profile email"; + NETBIRD_TOKEN_SOURCE = "idToken"; + USE_AUTH0 = false; + }); # The derivation containing the templated dashboard finalDrv = @@ -142,7 +141,8 @@ in "$NETBIRD_TOKEN_SOURCE" "$USE_AUTH0" ]; - } // (mapAttrs (_: toStringEnv) cfg.settings); + } + // (mapAttrs (_: toStringEnv) cfg.settings); } '' cp -R ${cfg.package} build diff --git a/nixos/modules/services/networking/netbird/server.nix b/nixos/modules/services/networking/netbird/server.nix index 5865e06f18d0..78498102a452 100644 --- a/nixos/modules/services/networking/netbird/server.nix +++ b/nixos/modules/services/networking/netbird/server.nix @@ -49,31 +49,30 @@ in managementServer = "https://${cfg.domain}"; }; - management = - { - domain = mkDefault cfg.domain; - enable = mkDefault cfg.enable; - enableNginx = mkDefault cfg.enableNginx; - } - // (optionalAttrs cfg.coturn.enable rec { - turnDomain = cfg.domain; - turnPort = config.services.coturn.tls-listening-port; - # We cannot merge a list of attrsets so we have to redefine the whole list - settings = { - TURNConfig.Turns = mkDefault [ - { - Proto = "udp"; - URI = "turn:${turnDomain}:${builtins.toString turnPort}"; - Username = "netbird"; - Password = - if (cfg.coturn.password != null) then - cfg.coturn.password - else - { _secret = cfg.coturn.passwordFile; }; - } - ]; - }; - }); + management = { + domain = mkDefault cfg.domain; + enable = mkDefault cfg.enable; + enableNginx = mkDefault cfg.enableNginx; + } + // (optionalAttrs cfg.coturn.enable rec { + turnDomain = cfg.domain; + turnPort = config.services.coturn.tls-listening-port; + # We cannot merge a list of attrsets so we have to redefine the whole list + settings = { + TURNConfig.Turns = mkDefault [ + { + Proto = "udp"; + URI = "turn:${turnDomain}:${builtins.toString turnPort}"; + Username = "netbird"; + Password = + if (cfg.coturn.password != null) then + cfg.coturn.password + else + { _secret = cfg.coturn.passwordFile; }; + } + ]; + }; + }); signal = { domain = mkDefault cfg.domain; diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix index f851f2428723..35d8f370eae9 100644 --- a/nixos/modules/services/networking/networkmanager.nix +++ b/nixos/modules/services/networking/networkmanager.nix @@ -132,15 +132,14 @@ let pluginDbusDeps = concatPluginAttrs "networkManagerDbusDeps"; pluginTmpfilesRules = concatPluginAttrs "networkManagerTmpfilesRules"; - packages = - [ - cfg.package - ] - ++ cfg.plugins - ++ pluginRuntimeDeps - ++ lib.optionals (!delegateWireless && !enableIwd) [ - pkgs.wpa_supplicant - ]; + packages = [ + cfg.package + ] + ++ cfg.plugins + ++ pluginRuntimeDeps + ++ lib.optionals (!delegateWireless && !enableIwd) [ + pkgs.wpa_supplicant + ]; in { @@ -550,38 +549,37 @@ in hardware.wirelessRegulatoryDatabase = true; - environment.etc = - { - "NetworkManager/NetworkManager.conf".source = configFile; + environment.etc = { + "NetworkManager/NetworkManager.conf".source = configFile; - # The networkmanager-l2tp plugin expects /etc/ipsec.secrets to include /etc/ipsec.d/ipsec.nm-l2tp.secrets; - # see https://github.com/NixOS/nixpkgs/issues/64965 - "ipsec.secrets".text = '' - include ipsec.d/ipsec.nm-l2tp.secrets - ''; - } - // builtins.listToAttrs ( - map ( - pkg: - nameValuePair "NetworkManager/${pkg.networkManagerPlugin}" { - source = "${pkg}/lib/NetworkManager/${pkg.networkManagerPlugin}"; - } - ) cfg.plugins - ) - // optionalAttrs (cfg.appendNameservers != [ ] || cfg.insertNameservers != [ ]) { - "NetworkManager/dispatcher.d/02overridedns".source = overrideNameserversScript; - } - // listToAttrs ( - lib.imap1 (i: s: { - name = "NetworkManager/dispatcher.d/${ - dispatcherTypesSubdirMap.${s.type} - }03userscript${lib.fixedWidthNumber 4 i}"; - value = { - mode = "0544"; - inherit (s) source; - }; - }) cfg.dispatcherScripts - ); + # The networkmanager-l2tp plugin expects /etc/ipsec.secrets to include /etc/ipsec.d/ipsec.nm-l2tp.secrets; + # see https://github.com/NixOS/nixpkgs/issues/64965 + "ipsec.secrets".text = '' + include ipsec.d/ipsec.nm-l2tp.secrets + ''; + } + // builtins.listToAttrs ( + map ( + pkg: + nameValuePair "NetworkManager/${pkg.networkManagerPlugin}" { + source = "${pkg}/lib/NetworkManager/${pkg.networkManagerPlugin}"; + } + ) cfg.plugins + ) + // optionalAttrs (cfg.appendNameservers != [ ] || cfg.insertNameservers != [ ]) { + "NetworkManager/dispatcher.d/02overridedns".source = overrideNameserversScript; + } + // listToAttrs ( + lib.imap1 (i: s: { + name = "NetworkManager/dispatcher.d/${ + dispatcherTypesSubdirMap.${s.type} + }03userscript${lib.fixedWidthNumber 4 i}"; + value = { + mode = "0544"; + inherit (s) source; + }; + }) cfg.dispatcherScripts + ); environment.systemPackages = packages; @@ -609,7 +607,8 @@ in "d /var/lib/misc 0755 root root -" # for dnsmasq.leases # ppp isn't able to mkdir that directory at runtime "d /run/pppd/lock 0700 root root -" - ] ++ pluginTmpfilesRules; + ] + ++ pluginTmpfilesRules; systemd.services.NetworkManager = { wantedBy = [ "multi-user.target" ]; diff --git a/nixos/modules/services/networking/ntp/chrony.nix b/nixos/modules/services/networking/ntp/chrony.nix index ea09cef12fb6..2002f2eca8c6 100644 --- a/nixos/modules/services/networking/ntp/chrony.nix +++ b/nixos/modules/services/networking/ntp/chrony.nix @@ -36,16 +36,15 @@ let ${cfg.extraConfig} ''; - chronyFlags = - [ - "-n" - "-u" - "chrony" - "-f" - "${configFile}" - ] - ++ optional cfg.enableMemoryLocking "-m" - ++ cfg.extraFlags; + chronyFlags = [ + "-n" + "-u" + "chrony" + "-f" + "${configFile}" + ] + ++ optional cfg.enableMemoryLocking "-m" + ++ cfg.extraFlags; in { options = { @@ -208,15 +207,14 @@ in SYSTEMD_TIMEDATED_NTP_SERVICES = "chronyd.service"; }; - systemd.tmpfiles.rules = - [ - "d ${stateDir} 0750 chrony chrony - -" - "f ${driftFile} 0640 chrony chrony - -" - "f ${keyFile} 0640 chrony chrony - -" - ] - ++ lib.optionals cfg.enableRTCTrimming [ - "f ${rtcFile} 0640 chrony chrony - -" - ]; + systemd.tmpfiles.rules = [ + "d ${stateDir} 0750 chrony chrony - -" + "f ${driftFile} 0640 chrony chrony - -" + "f ${keyFile} 0640 chrony chrony - -" + ] + ++ lib.optionals cfg.enableRTCTrimming [ + "f ${rtcFile} 0640 chrony chrony - -" + ]; systemd.services.chronyd = { description = "chrony NTP daemon"; diff --git a/nixos/modules/services/networking/ntp/ntpd.nix b/nixos/modules/services/networking/ntp/ntpd.nix index 6debe11753f9..071512056bf6 100644 --- a/nixos/modules/services/networking/ntp/ntpd.nix +++ b/nixos/modules/services/networking/ntp/ntpd.nix @@ -33,7 +33,8 @@ let "${configFile}" "-u" "ntp:ntp" - ] ++ cfg.extraFlags; + ] + ++ cfg.extraFlags; in diff --git a/nixos/modules/services/networking/privoxy.nix b/nixos/modules/services/networking/privoxy.nix index c664ac341fc1..64ceb30d0fa5 100644 --- a/nixos/modules/services/networking/privoxy.nix +++ b/nixos/modules/services/networking/privoxy.nix @@ -261,30 +261,30 @@ in } ]; - services.privoxy.settings = - { - user-manual = "${pkgs.privoxy}/share/doc/privoxy/user-manual"; - # This is needed for external filters - temporary-directory = "/tmp"; - filterfile = [ "default.filter" ]; - actionsfile = [ - "match-all.action" - "default.action" - ] ++ optional cfg.inspectHttps (toString inspectAction); - } - // (optionalAttrs cfg.enableTor { - forward-socks5 = "/ 127.0.0.1:9063 ."; - toggle = true; - enable-remote-toggle = false; - enable-edit-actions = false; - enable-remote-http-toggle = false; - }) - // (optionalAttrs cfg.inspectHttps { - # This allows setting absolute key/crt paths - ca-directory = "/var/empty"; - certificate-directory = "/run/privoxy/certs"; - trusted-cas-file = config.security.pki.caBundle; - }); + services.privoxy.settings = { + user-manual = "${pkgs.privoxy}/share/doc/privoxy/user-manual"; + # This is needed for external filters + temporary-directory = "/tmp"; + filterfile = [ "default.filter" ]; + actionsfile = [ + "match-all.action" + "default.action" + ] + ++ optional cfg.inspectHttps (toString inspectAction); + } + // (optionalAttrs cfg.enableTor { + forward-socks5 = "/ 127.0.0.1:9063 ."; + toggle = true; + enable-remote-toggle = false; + enable-edit-actions = false; + enable-remote-http-toggle = false; + }) + // (optionalAttrs cfg.inspectHttps { + # This allows setting absolute key/crt paths + ca-directory = "/var/empty"; + certificate-directory = "/run/privoxy/certs"; + trusted-cas-file = config.security.pki.caBundle; + }); }; imports = diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix index 7bdcd6ccd7df..f4d9172bab3f 100644 --- a/nixos/modules/services/networking/prosody.nix +++ b/nixos/modules/services/networking/prosody.nix @@ -840,21 +840,19 @@ in errors = [ { assertion = (builtins.length cfg.muc > 0) || !cfg.xmppComplianceSuite; - message = - '' - You need to setup at least a MUC domain to comply with - XEP-0423. - '' - + genericErrMsg; + message = '' + You need to setup at least a MUC domain to comply with + XEP-0423. + '' + + genericErrMsg; } { assertion = cfg.uploadHttp != null || cfg.httpFileShare != null || !cfg.xmppComplianceSuite; - message = - '' - You need to setup the http_upload or http_file_share modules through config.services.prosody.uploadHttp - or config.services.prosody.httpFileShare to comply with XEP-0423. - '' - + genericErrMsg; + message = '' + You need to setup the http_upload or http_file_share modules through config.services.prosody.uploadHttp + or config.services.prosody.httpFileShare to comply with XEP-0423. + '' + + genericErrMsg; } ]; in diff --git a/nixos/modules/services/networking/quassel.nix b/nixos/modules/services/networking/quassel.nix index dc43ef3f60ef..ee00dd4215dc 100644 --- a/nixos/modules/services/networking/quassel.nix +++ b/nixos/modules/services/networking/quassel.nix @@ -118,10 +118,11 @@ in description = "Quassel IRC client daemon"; wantedBy = [ "multi-user.target" ]; - after = - [ "network.target" ] - ++ optional config.services.postgresql.enable "postgresql.target" - ++ optional config.services.mysql.enable "mysql.service"; + after = [ + "network.target" + ] + ++ optional config.services.postgresql.enable "postgresql.target" + ++ optional config.services.mysql.enable "mysql.service"; serviceConfig = { ExecStart = concatStringsSep " " ( diff --git a/nixos/modules/services/networking/resilio.nix b/nixos/modules/services/networking/resilio.nix index 78a72a8874e5..25ad4b13daf2 100644 --- a/nixos/modules/services/networking/resilio.nix +++ b/nixos/modules/services/networking/resilio.nix @@ -37,13 +37,12 @@ let } // optionalAttrs (cfg.directoryRoot != "") { directory_root = cfg.directoryRoot; } // optionalAttrs cfg.enableWebUI { - webui = - { - listen = "${cfg.httpListenAddr}:${toString cfg.httpListenPort}"; - } - // (optionalAttrs (cfg.httpLogin != "") { login = cfg.httpLogin; }) - // (optionalAttrs (cfg.httpPass != "") { password = cfg.httpPass; }) - // (optionalAttrs (cfg.apiKey != "") { api_key = cfg.apiKey; }); + webui = { + listen = "${cfg.httpListenAddr}:${toString cfg.httpListenPort}"; + } + // (optionalAttrs (cfg.httpLogin != "") { login = cfg.httpLogin; }) + // (optionalAttrs (cfg.httpPass != "") { password = cfg.httpPass; }) + // (optionalAttrs (cfg.apiKey != "") { api_key = cfg.apiKey; }); } // optionalAttrs (sharedFoldersRecord != [ ]) { shared_folders = sharedFoldersRecord; diff --git a/nixos/modules/services/networking/searx.nix b/nixos/modules/services/networking/searx.nix index 3e6872e5cfe1..06e9cf3c8850 100644 --- a/nixos/modules/services/networking/searx.nix +++ b/nixos/modules/services/networking/searx.nix @@ -296,26 +296,25 @@ in enable = true; plugins = [ "python3" ]; instance.type = "emperor"; - instance.vassals.searx = - { - type = "normal"; - strict = true; - immediate-uid = "searx"; - immediate-gid = "searx"; - lazy-apps = true; - enable-threads = true; - module = "searx.webapp"; - env = [ - "SEARXNG_SETTINGS_PATH=${cfg.settingsFile}" - ]; - buffer-size = 32768; - pythonPackages = _: [ cfg.package ]; - } - // lib.optionalAttrs cfg.configureNginx { - socket = "/run/searx/uwsgi.sock"; - chmod-socket = "660"; - } - // cfg.uwsgiConfig; + instance.vassals.searx = { + type = "normal"; + strict = true; + immediate-uid = "searx"; + immediate-gid = "searx"; + lazy-apps = true; + enable-threads = true; + module = "searx.webapp"; + env = [ + "SEARXNG_SETTINGS_PATH=${cfg.settingsFile}" + ]; + buffer-size = 32768; + pythonPackages = _: [ cfg.package ]; + } + // lib.optionalAttrs cfg.configureNginx { + socket = "/run/searx/uwsgi.sock"; + chmod-socket = "660"; + } + // cfg.uwsgiConfig; }; }; @@ -326,18 +325,17 @@ in searx-init = { description = "Initialise Searx settings"; - serviceConfig = - { - Type = "oneshot"; - RemainAfterExit = true; - User = "searx"; - RuntimeDirectory = "searx"; - RuntimeDirectoryMode = "750"; - RuntimeDirectoryPreserve = "yes"; - } - // optionalAttrs (cfg.environmentFile != null) { - EnvironmentFile = cfg.environmentFile; - }; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "searx"; + RuntimeDirectory = "searx"; + RuntimeDirectoryMode = "750"; + RuntimeDirectoryPreserve = "yes"; + } + // optionalAttrs (cfg.environmentFile != null) { + EnvironmentFile = cfg.environmentFile; + }; script = generateConfig; }; @@ -349,15 +347,14 @@ in "searx-init.service" "network.target" ]; - serviceConfig = - { - User = "searx"; - Group = "searx"; - ExecStart = lib.getExe cfg.package; - } - // optionalAttrs (cfg.environmentFile != null) { - EnvironmentFile = cfg.environmentFile; - }; + serviceConfig = { + User = "searx"; + Group = "searx"; + ExecStart = lib.getExe cfg.package; + } + // optionalAttrs (cfg.environmentFile != null) { + EnvironmentFile = cfg.environmentFile; + }; environment = { SEARXNG_SETTINGS_PATH = cfg.settingsFile; }; @@ -369,7 +366,8 @@ in restartTriggers = [ cfg.package cfg.settingsFile - ] ++ lib.optional (cfg.environmentFile != null) cfg.environmentFile; + ] + ++ lib.optional (cfg.environmentFile != null) cfg.environmentFile; }; }; diff --git a/nixos/modules/services/networking/shadowsocks.nix b/nixos/modules/services/networking/shadowsocks.nix index 3cf9c61bbd8a..79d749abb9d5 100644 --- a/nixos/modules/services/networking/shadowsocks.nix +++ b/nixos/modules/services/networking/shadowsocks.nix @@ -10,23 +10,22 @@ with lib; let cfg = config.services.shadowsocks; - opts = - { - server = cfg.localAddress; - server_port = cfg.port; - method = cfg.encryptionMethod; - mode = cfg.mode; - user = "nobody"; - fast_open = cfg.fastOpen; - } - // optionalAttrs (cfg.plugin != null) { - plugin = cfg.plugin; - plugin_opts = cfg.pluginOpts; - } - // optionalAttrs (cfg.password != null) { - password = cfg.password; - } - // cfg.extraConfig; + opts = { + server = cfg.localAddress; + server_port = cfg.port; + method = cfg.encryptionMethod; + mode = cfg.mode; + user = "nobody"; + fast_open = cfg.fastOpen; + } + // optionalAttrs (cfg.plugin != null) { + plugin = cfg.plugin; + plugin_opts = cfg.pluginOpts; + } + // optionalAttrs (cfg.password != null) { + password = cfg.password; + } + // cfg.extraConfig; configFile = pkgs.writeText "shadowsocks.json" (builtins.toJSON opts); @@ -170,10 +169,11 @@ in description = "shadowsocks-libev Daemon"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - path = - [ pkgs.shadowsocks-libev ] - ++ optional (cfg.plugin != null) cfg.plugin - ++ optional (cfg.passwordFile != null) pkgs.jq; + path = [ + pkgs.shadowsocks-libev + ] + ++ optional (cfg.plugin != null) cfg.plugin + ++ optional (cfg.passwordFile != null) pkgs.jq; serviceConfig.PrivateTmp = true; script = '' ${optionalString (cfg.passwordFile != null) '' diff --git a/nixos/modules/services/networking/shairport-sync.nix b/nixos/modules/services/networking/shairport-sync.nix index 9cf826597d70..ca2aa156b773 100644 --- a/nixos/modules/services/networking/shairport-sync.nix +++ b/nixos/modules/services/networking/shairport-sync.nix @@ -131,7 +131,8 @@ in group = cfg.group; extraGroups = [ "audio" - ] ++ optional (config.services.pulseaudio.enable || config.services.pipewire.pulse.enable) "pulse"; + ] + ++ optional (config.services.pulseaudio.enable || config.services.pipewire.pulse.enable) "pulse"; }; groups.${cfg.group} = { }; }; diff --git a/nixos/modules/services/networking/spacecookie.nix b/nixos/modules/services/networking/spacecookie.nix index 9bf62ca53e02..9b928f39029c 100644 --- a/nixos/modules/services/networking/spacecookie.nix +++ b/nixos/modules/services/networking/spacecookie.nix @@ -14,7 +14,8 @@ let listen = { inherit (cfg) port; }; - } // cfg.settings; + } + // cfg.settings; format = pkgs.formats.json { }; diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 12d725e1b7f9..4d794dd7f6ab 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -877,54 +877,53 @@ in ) ]; - assertions = - [ + assertions = [ + { + assertion = if cfg.settings.X11Forwarding then cfgc.setXAuthLocation else true; + message = "cannot enable X11 forwarding without setting xauth location"; + } + { + assertion = + (builtins.match "(.*\n)?(\t )*[Kk][Ee][Rr][Bb][Ee][Rr][Oo][Ss][Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii][Cc][Aa][Tt][Ii][Oo][Nn][ |\t|=|\"]+yes.*" "${configFile}\n${cfg.extraConfig}") + != null + -> cfgc.package.withKerberos; + message = "cannot enable Kerberos authentication without using a package with Kerberos support"; + } + { + assertion = + (builtins.match "(.*\n)?(\t )*[Gg][Ss][Ss][Aa][Pp][Ii][Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii][Cc][Aa][Tt][Ii][Oo][Nn][ |\t|=|\"]+yes.*" "${configFile}\n${cfg.extraConfig}") + != null + -> cfgc.package.withKerberos; + message = "cannot enable GSSAPI authentication without using a package with Kerberos support"; + } + ( + let + duplicates = + # Filter out the groups with more than 1 element + lib.filter (l: lib.length l > 1) ( + # Grab the groups, we don't care about the group identifiers + lib.attrValues ( + # Group the settings that are the same in lower case + lib.groupBy lib.strings.toLower (lib.attrNames cfg.settings) + ) + ); + formattedDuplicates = lib.concatMapStringsSep ", " ( + dupl: "(${lib.concatStringsSep ", " dupl})" + ) duplicates; + in { - assertion = if cfg.settings.X11Forwarding then cfgc.setXAuthLocation else true; - message = "cannot enable X11 forwarding without setting xauth location"; + assertion = lib.length duplicates == 0; + message = ''Duplicate sshd config key; does your capitalization match the option's? Duplicate keys: ${formattedDuplicates}''; } - { - assertion = - (builtins.match "(.*\n)?(\t )*[Kk][Ee][Rr][Bb][Ee][Rr][Oo][Ss][Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii][Cc][Aa][Tt][Ii][Oo][Nn][ |\t|=|\"]+yes.*" "${configFile}\n${cfg.extraConfig}") - != null - -> cfgc.package.withKerberos; - message = "cannot enable Kerberos authentication without using a package with Kerberos support"; - } - { - assertion = - (builtins.match "(.*\n)?(\t )*[Gg][Ss][Ss][Aa][Pp][Ii][Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii][Cc][Aa][Tt][Ii][Oo][Nn][ |\t|=|\"]+yes.*" "${configFile}\n${cfg.extraConfig}") - != null - -> cfgc.package.withKerberos; - message = "cannot enable GSSAPI authentication without using a package with Kerberos support"; - } - ( - let - duplicates = - # Filter out the groups with more than 1 element - lib.filter (l: lib.length l > 1) ( - # Grab the groups, we don't care about the group identifiers - lib.attrValues ( - # Group the settings that are the same in lower case - lib.groupBy lib.strings.toLower (lib.attrNames cfg.settings) - ) - ); - formattedDuplicates = lib.concatMapStringsSep ", " ( - dupl: "(${lib.concatStringsSep ", " dupl})" - ) duplicates; - in - { - assertion = lib.length duplicates == 0; - message = ''Duplicate sshd config key; does your capitalization match the option's? Duplicate keys: ${formattedDuplicates}''; - } - ) - ] - ++ lib.forEach cfg.listenAddresses ( - { addr, ... }: - { - assertion = addr != null; - message = "addr must be specified in each listenAddresses entry"; - } - ); + ) + ] + ++ lib.forEach cfg.listenAddresses ( + { addr, ... }: + { + assertion = addr != null; + message = "addr must be specified in each listenAddresses entry"; + } + ); }; } diff --git a/nixos/modules/services/networking/sslh.nix b/nixos/modules/services/networking/sslh.nix index b96db2dbde8f..2aa49a742ecb 100644 --- a/nixos/modules/services/networking/sslh.nix +++ b/nixos/modules/services/networking/sslh.nix @@ -277,50 +277,48 @@ in pkgs.procps ]; - preStart = - '' - # Cleanup old iptables entries which might be still there - ${concatMapStringsSep "\n" ( - { table, command }: "while iptables -w -t ${table} -D ${command} 2>/dev/null; do echo; done" - ) iptablesCommands} - ${concatMapStringsSep "\n" ( - { table, command }: "iptables -w -t ${table} -A ${command}" - ) iptablesCommands} + preStart = '' + # Cleanup old iptables entries which might be still there + ${concatMapStringsSep "\n" ( + { table, command }: "while iptables -w -t ${table} -D ${command} 2>/dev/null; do echo; done" + ) iptablesCommands} + ${concatMapStringsSep "\n" ( + { table, command }: "iptables -w -t ${table} -A ${command}" + ) iptablesCommands} - # Configure routing for those marked packets - ip rule add fwmark 0x2 lookup 100 - ip route add local 0.0.0.0/0 dev lo table 100 + # Configure routing for those marked packets + ip rule add fwmark 0x2 lookup 100 + ip route add local 0.0.0.0/0 dev lo table 100 - '' - + optionalString config.networking.enableIPv6 '' - ${concatMapStringsSep "\n" ( - { table, command }: "while ip6tables -w -t ${table} -D ${command} 2>/dev/null; do echo; done" - ) ip6tablesCommands} - ${concatMapStringsSep "\n" ( - { table, command }: "ip6tables -w -t ${table} -A ${command}" - ) ip6tablesCommands} + '' + + optionalString config.networking.enableIPv6 '' + ${concatMapStringsSep "\n" ( + { table, command }: "while ip6tables -w -t ${table} -D ${command} 2>/dev/null; do echo; done" + ) ip6tablesCommands} + ${concatMapStringsSep "\n" ( + { table, command }: "ip6tables -w -t ${table} -A ${command}" + ) ip6tablesCommands} - ip -6 rule add fwmark 0x2 lookup 100 - ip -6 route add local ::/0 dev lo table 100 - ''; + ip -6 rule add fwmark 0x2 lookup 100 + ip -6 route add local ::/0 dev lo table 100 + ''; - postStop = - '' - ${concatMapStringsSep "\n" ( - { table, command }: "iptables -w -t ${table} -D ${command}" - ) iptablesCommands} + postStop = '' + ${concatMapStringsSep "\n" ( + { table, command }: "iptables -w -t ${table} -D ${command}" + ) iptablesCommands} - ip rule del fwmark 0x2 lookup 100 - ip route del local 0.0.0.0/0 dev lo table 100 - '' - + optionalString config.networking.enableIPv6 '' - ${concatMapStringsSep "\n" ( - { table, command }: "ip6tables -w -t ${table} -D ${command}" - ) ip6tablesCommands} + ip rule del fwmark 0x2 lookup 100 + ip route del local 0.0.0.0/0 dev lo table 100 + '' + + optionalString config.networking.enableIPv6 '' + ${concatMapStringsSep "\n" ( + { table, command }: "ip6tables -w -t ${table} -D ${command}" + ) ip6tablesCommands} - ip -6 rule del fwmark 0x2 lookup 100 - ip -6 route del local ::/0 dev lo table 100 - ''; + ip -6 rule del fwmark 0x2 lookup 100 + ip -6 route del local ::/0 dev lo table 100 + ''; }; }) ]; diff --git a/nixos/modules/services/networking/stubby.nix b/nixos/modules/services/networking/stubby.nix index 0aec5c402479..68b8160597a4 100644 --- a/nixos/modules/services/networking/stubby.nix +++ b/nixos/modules/services/networking/stubby.nix @@ -13,14 +13,14 @@ let confFile = settingsFormat.generate "stubby.yml" cfg.settings; in { - imports = - [ - (mkRemovedOptionModule [ - "stubby" - "debugLogging" - ] "Use services.stubby.logLevel = \"debug\"; instead.") - ] - ++ map + imports = [ + (mkRemovedOptionModule [ + "stubby" + "debugLogging" + ] "Use services.stubby.logLevel = \"debug\"; instead.") + ] + ++ + map ( x: (mkRemovedOptionModule [ diff --git a/nixos/modules/services/networking/supybot.nix b/nixos/modules/services/networking/supybot.nix index abde8bffe8b4..f05e1fe30112 100644 --- a/nixos/modules/services/networking/supybot.nix +++ b/nixos/modules/services/networking/supybot.nix @@ -111,62 +111,60 @@ in startLimitIntervalSec = 5 * 60; # 5 min startLimitBurst = 1; - serviceConfig = - { - ExecStart = "${pyEnv}/bin/supybot ${cfg.stateDir}/supybot.cfg"; - PIDFile = "/run/supybot.pid"; - User = "supybot"; - Group = "supybot"; - UMask = "0007"; - Restart = "on-abort"; + serviceConfig = { + ExecStart = "${pyEnv}/bin/supybot ${cfg.stateDir}/supybot.cfg"; + PIDFile = "/run/supybot.pid"; + User = "supybot"; + Group = "supybot"; + UMask = "0007"; + Restart = "on-abort"; - NoNewPrivileges = true; - PrivateDevices = true; - PrivateMounts = true; - PrivateTmp = true; - ProtectControlGroups = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - ]; - RestrictSUIDSGID = true; - SystemCallArchitectures = "native"; - RestrictNamespaces = true; - RestrictRealtime = true; - LockPersonality = true; - MemoryDenyWriteExecute = true; - RemoveIPC = true; - ProtectHostname = true; - CapabilityBoundingSet = ""; - ProtectSystem = "full"; - } - // optionalAttrs isStateDirVar { - StateDirectory = "supybot"; - ProtectSystem = "strict"; - } - // optionalAttrs (!isStateDirHome) { - ProtectHome = true; - }; + NoNewPrivileges = true; + PrivateDevices = true; + PrivateMounts = true; + PrivateTmp = true; + ProtectControlGroups = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + ]; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + RestrictNamespaces = true; + RestrictRealtime = true; + LockPersonality = true; + MemoryDenyWriteExecute = true; + RemoveIPC = true; + ProtectHostname = true; + CapabilityBoundingSet = ""; + ProtectSystem = "full"; + } + // optionalAttrs isStateDirVar { + StateDirectory = "supybot"; + ProtectSystem = "strict"; + } + // optionalAttrs (!isStateDirHome) { + ProtectHome = true; + }; }; - systemd.tmpfiles.rules = - [ - "d '${cfg.stateDir}' 0700 supybot supybot - -" - "d '${cfg.stateDir}/backup' 0750 supybot supybot - -" - "d '${cfg.stateDir}/conf' 0750 supybot supybot - -" - "d '${cfg.stateDir}/data' 0750 supybot supybot - -" - "d '${cfg.stateDir}/plugins' 0750 supybot supybot - -" - "d '${cfg.stateDir}/logs' 0750 supybot supybot - -" - "d '${cfg.stateDir}/logs/plugins' 0750 supybot supybot - -" - "d '${cfg.stateDir}/tmp' 0750 supybot supybot - -" - "d '${cfg.stateDir}/web' 0750 supybot supybot - -" - "L '${cfg.stateDir}/supybot.cfg' - - - - ${cfg.configFile}" - ] - ++ (flip mapAttrsToList cfg.plugins ( - name: dest: "L+ '${cfg.stateDir}/plugins/${name}' - - - - ${dest}" - )); + systemd.tmpfiles.rules = [ + "d '${cfg.stateDir}' 0700 supybot supybot - -" + "d '${cfg.stateDir}/backup' 0750 supybot supybot - -" + "d '${cfg.stateDir}/conf' 0750 supybot supybot - -" + "d '${cfg.stateDir}/data' 0750 supybot supybot - -" + "d '${cfg.stateDir}/plugins' 0750 supybot supybot - -" + "d '${cfg.stateDir}/logs' 0750 supybot supybot - -" + "d '${cfg.stateDir}/logs/plugins' 0750 supybot supybot - -" + "d '${cfg.stateDir}/tmp' 0750 supybot supybot - -" + "d '${cfg.stateDir}/web' 0750 supybot supybot - -" + "L '${cfg.stateDir}/supybot.cfg' - - - - ${cfg.configFile}" + ] + ++ (flip mapAttrsToList cfg.plugins ( + name: dest: "L+ '${cfg.stateDir}/plugins/${name}' - - - - ${dest}" + )); }; } diff --git a/nixos/modules/services/networking/syncplay.nix b/nixos/modules/services/networking/syncplay.nix index eec0f802615f..f2e387282e14 100644 --- a/nixos/modules/services/networking/syncplay.nix +++ b/nixos/modules/services/networking/syncplay.nix @@ -10,57 +10,56 @@ with lib; let cfg = config.services.syncplay; - cmdArgs = - [ - "--port" - cfg.port - ] - ++ optionals (cfg.isolateRooms) [ "--isolate-rooms" ] - ++ optionals (!cfg.ready) [ "--disable-ready" ] - ++ optionals (!cfg.chat) [ "--disable-chat" ] - ++ optionals (cfg.salt != null) [ - "--salt" - cfg.salt - ] - ++ optionals (cfg.motdFile != null) [ - "--motd-file" - cfg.motdFile - ] - ++ optionals (cfg.roomsDBFile != null) [ - "--rooms-db-file" - cfg.roomsDBFile - ] - ++ optionals (cfg.permanentRoomsFile != null) [ - "--permanent-rooms-file" - cfg.permanentRoomsFile - ] - ++ [ - "--max-chat-message-length" - cfg.maxChatMessageLength - ] - ++ [ - "--max-username-length" - cfg.maxUsernameLength - ] - ++ optionals (cfg.statsDBFile != null) [ - "--stats-db-file" - cfg.statsDBFile - ] - ++ optionals (cfg.certDir != null) [ - "--tls" - cfg.certDir - ] - ++ optionals cfg.ipv4Only [ "--ipv4-only" ] - ++ optionals cfg.ipv6Only [ "--ipv6-only" ] - ++ optionals (cfg.interfaceIpv4 != "") [ - "--interface-ipv4" - cfg.interfaceIpv4 - ] - ++ optionals (cfg.interfaceIpv6 != "") [ - "--interface-ipv6" - cfg.interfaceIpv6 - ] - ++ cfg.extraArgs; + cmdArgs = [ + "--port" + cfg.port + ] + ++ optionals (cfg.isolateRooms) [ "--isolate-rooms" ] + ++ optionals (!cfg.ready) [ "--disable-ready" ] + ++ optionals (!cfg.chat) [ "--disable-chat" ] + ++ optionals (cfg.salt != null) [ + "--salt" + cfg.salt + ] + ++ optionals (cfg.motdFile != null) [ + "--motd-file" + cfg.motdFile + ] + ++ optionals (cfg.roomsDBFile != null) [ + "--rooms-db-file" + cfg.roomsDBFile + ] + ++ optionals (cfg.permanentRoomsFile != null) [ + "--permanent-rooms-file" + cfg.permanentRoomsFile + ] + ++ [ + "--max-chat-message-length" + cfg.maxChatMessageLength + ] + ++ [ + "--max-username-length" + cfg.maxUsernameLength + ] + ++ optionals (cfg.statsDBFile != null) [ + "--stats-db-file" + cfg.statsDBFile + ] + ++ optionals (cfg.certDir != null) [ + "--tls" + cfg.certDir + ] + ++ optionals cfg.ipv4Only [ "--ipv4-only" ] + ++ optionals cfg.ipv6Only [ "--ipv6-only" ] + ++ optionals (cfg.interfaceIpv4 != "") [ + "--interface-ipv4" + cfg.interfaceIpv4 + ] + ++ optionals (cfg.interfaceIpv6 != "") [ + "--interface-ipv6" + cfg.interfaceIpv6 + ] + ++ cfg.extraArgs; useACMEHostDir = optionalString ( cfg.useACMEHost != null @@ -321,8 +320,9 @@ in warnings = optional (cfg.interfaceIpv4 != "" && cfg.ipv6Only) "You have specified services.syncplay.interfaceIpv4 but IPv4 is disabled by services.syncplay.ipv6Only." - ++ optional (cfg.interfaceIpv6 != "" && cfg.ipv4Only) - "You have specified services.syncplay.interfaceIpv6 but IPv6 is disabled by services.syncplay.ipv4Only."; + ++ + optional (cfg.interfaceIpv6 != "" && cfg.ipv4Only) + "You have specified services.syncplay.interfaceIpv6 but IPv6 is disabled by services.syncplay.ipv4Only."; security.acme.certs = mkIf (cfg.useACMEHost != null) { "${cfg.useACMEHost}".reloadServices = [ "syncplay.service" ]; diff --git a/nixos/modules/services/networking/syncthing-relay.nix b/nixos/modules/services/networking/syncthing-relay.nix index eca369718018..c6244e6aafcd 100644 --- a/nixos/modules/services/networking/syncthing-relay.nix +++ b/nixos/modules/services/networking/syncthing-relay.nix @@ -12,17 +12,16 @@ let dataDirectory = "/var/lib/syncthing-relay"; - relayOptions = - [ - "--keys=${dataDirectory}" - "--listen=${cfg.listenAddress}:${toString cfg.port}" - "--status-srv=${cfg.statusListenAddress}:${toString cfg.statusPort}" - "--provided-by=${escapeShellArg cfg.providedBy}" - ] - ++ optional (cfg.pools != null) "--pools=${escapeShellArg (concatStringsSep "," cfg.pools)}" - ++ optional (cfg.globalRateBps != null) "--global-rate=${toString cfg.globalRateBps}" - ++ optional (cfg.perSessionRateBps != null) "--per-session-rate=${toString cfg.perSessionRateBps}" - ++ cfg.extraOptions; + relayOptions = [ + "--keys=${dataDirectory}" + "--listen=${cfg.listenAddress}:${toString cfg.port}" + "--status-srv=${cfg.statusListenAddress}:${toString cfg.statusPort}" + "--provided-by=${escapeShellArg cfg.providedBy}" + ] + ++ optional (cfg.pools != null) "--pools=${escapeShellArg (concatStringsSep "," cfg.pools)}" + ++ optional (cfg.globalRateBps != null) "--global-rate=${toString cfg.globalRateBps}" + ++ optional (cfg.perSessionRateBps != null) "--per-session-rate=${toString cfg.perSessionRateBps}" + ++ cfg.extraOptions; in { ###### interface diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index 81c415da6bfa..12e0c2bea79d 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -791,30 +791,30 @@ in }; }; - imports = - [ - (mkRemovedOptionModule [ "services" "syncthing" "useInotify" ] '' - This option was removed because Syncthing now has the inotify functionality included under the name "fswatcher". - It can be enabled on a per-folder basis through the web interface. - '') - (mkRenamedOptionModule - [ "services" "syncthing" "extraOptions" ] - [ "services" "syncthing" "settings" ] - ) - (mkRenamedOptionModule - [ "services" "syncthing" "folders" ] - [ "services" "syncthing" "settings" "folders" ] - ) - (mkRenamedOptionModule - [ "services" "syncthing" "devices" ] - [ "services" "syncthing" "settings" "devices" ] - ) - (mkRenamedOptionModule - [ "services" "syncthing" "options" ] - [ "services" "syncthing" "settings" "options" ] - ) - ] - ++ map + imports = [ + (mkRemovedOptionModule [ "services" "syncthing" "useInotify" ] '' + This option was removed because Syncthing now has the inotify functionality included under the name "fswatcher". + It can be enabled on a per-folder basis through the web interface. + '') + (mkRenamedOptionModule + [ "services" "syncthing" "extraOptions" ] + [ "services" "syncthing" "settings" ] + ) + (mkRenamedOptionModule + [ "services" "syncthing" "folders" ] + [ "services" "syncthing" "settings" "folders" ] + ) + (mkRenamedOptionModule + [ "services" "syncthing" "devices" ] + [ "services" "syncthing" "settings" "devices" ] + ) + (mkRenamedOptionModule + [ "services" "syncthing" "options" ] + [ "services" "syncthing" "settings" "options" ] + ) + ] + ++ + map (o: mkRenamedOptionModule [ "services" "syncthing" "declarative" o ] [ "services" "syncthing" o ]) [ "cert" @@ -874,7 +874,8 @@ in STNORESTART = "yes"; STNOUPGRADE = "yes"; inherit (cfg) all_proxy; - } // config.networking.proxy.envVars; + } + // config.networking.proxy.envVars; wantedBy = [ "multi-user.target" ]; serviceConfig = { Restart = "on-failure"; diff --git a/nixos/modules/services/networking/tailscale.nix b/nixos/modules/services/networking/tailscale.nix index 42e4df10564d..80d0de468ee5 100644 --- a/nixos/modules/services/networking/tailscale.nix +++ b/nixos/modules/services/networking/tailscale.nix @@ -143,18 +143,18 @@ in pkgs.procps # for collecting running services (opt-in feature) pkgs.getent # for `getent` to look up user shells pkgs.kmod # required to pass tailscale's v6nat check - ] ++ lib.optional config.networking.resolvconf.enable config.networking.resolvconf.package; - serviceConfig.Environment = - [ - "PORT=${toString cfg.port}" - ''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName} ${lib.concatStringsSep " " cfg.extraDaemonFlags}"'' - ] - ++ (lib.optionals (cfg.permitCertUid != null) [ - "TS_PERMIT_CERT_UID=${cfg.permitCertUid}" - ]) - ++ (lib.optionals (cfg.disableTaildrop) [ - "TS_DISABLE_TAILDROP=true" - ]); + ] + ++ lib.optional config.networking.resolvconf.enable config.networking.resolvconf.package; + serviceConfig.Environment = [ + "PORT=${toString cfg.port}" + ''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName} ${lib.concatStringsSep " " cfg.extraDaemonFlags}"'' + ] + ++ (lib.optionals (cfg.permitCertUid != null) [ + "TS_PERMIT_CERT_UID=${cfg.permitCertUid}" + ]) + ++ (lib.optionals (cfg.disableTaildrop) [ + "TS_DISABLE_TAILDROP=true" + ]); # Restart tailscaled with a single `systemctl restart` at the # end of activation, rather than a `stop` followed by a later # `start`. Activation over Tailscale can hang for tens of diff --git a/nixos/modules/services/networking/teamspeak3.nix b/nixos/modules/services/networking/teamspeak3.nix index 79e76cf66f28..5c8942ca6076 100644 --- a/nixos/modules/services/networking/teamspeak3.nix +++ b/nixos/modules/services/networking/teamspeak3.nix @@ -148,13 +148,14 @@ in ]; networking.firewall = mkIf cfg.openFirewall { - allowedTCPPorts = - [ cfg.fileTransferPort ] - ++ (map (port: mkIf cfg.openFirewallServerQuery port) [ - cfg.queryPort - cfg.querySshPort - cfg.queryHttpPort - ]); + allowedTCPPorts = [ + cfg.fileTransferPort + ] + ++ (map (port: mkIf cfg.openFirewallServerQuery port) [ + cfg.queryPort + cfg.querySshPort + cfg.queryHttpPort + ]); # subsequent vServers will use the incremented voice port, let's just open the next 10 allowedUDPPortRanges = [ { diff --git a/nixos/modules/services/networking/unbound.nix b/nixos/modules/services/networking/unbound.nix index f0b5c6a916f0..7ad0c53c17e9 100644 --- a/nixos/modules/services/networking/unbound.nix +++ b/nixos/modules/services/networking/unbound.nix @@ -246,19 +246,18 @@ in ip-freebind = mkDefault true; define-tag = mkDefault ""; }; - remote-control = - { - control-enable = mkDefault false; - control-interface = mkDefault ([ "127.0.0.1" ] ++ (optional config.networking.enableIPv6 "::1")); - server-key-file = mkDefault "${cfg.stateDir}/unbound_server.key"; - server-cert-file = mkDefault "${cfg.stateDir}/unbound_server.pem"; - control-key-file = mkDefault "${cfg.stateDir}/unbound_control.key"; - control-cert-file = mkDefault "${cfg.stateDir}/unbound_control.pem"; - } - // optionalAttrs (cfg.localControlSocketPath != null) { - control-enable = true; - control-interface = cfg.localControlSocketPath; - }; + remote-control = { + control-enable = mkDefault false; + control-interface = mkDefault ([ "127.0.0.1" ] ++ (optional config.networking.enableIPv6 "::1")); + server-key-file = mkDefault "${cfg.stateDir}/unbound_server.key"; + server-cert-file = mkDefault "${cfg.stateDir}/unbound_server.pem"; + control-key-file = mkDefault "${cfg.stateDir}/unbound_control.key"; + control-cert-file = mkDefault "${cfg.stateDir}/unbound_control.pem"; + } + // optionalAttrs (cfg.localControlSocketPath != null) { + control-enable = true; + control-interface = cfg.localControlSocketPath; + }; }; environment.systemPackages = [ cfg.package ]; diff --git a/nixos/modules/services/networking/v2raya.nix b/nixos/modules/services/networking/v2raya.nix index a1b574870218..acc0a38b049f 100644 --- a/nixos/modules/services/networking/v2raya.nix +++ b/nixos/modules/services/networking/v2raya.nix @@ -32,7 +32,8 @@ in nftablesEnabled = config.networking.nftables.enable; iptablesServices = [ "iptables.service" - ] ++ optional config.networking.enableIPv6 "ip6tables.service"; + ] + ++ optional config.networking.enableIPv6 "ip6tables.service"; tableServices = if nftablesEnabled then [ "nftables.service" ] else iptablesServices; in { @@ -42,7 +43,8 @@ in After = [ "network.target" "nss-lookup.target" - ] ++ tableServices; + ] + ++ tableServices; Wants = [ "network.target" ]; }; diff --git a/nixos/modules/services/networking/vdirsyncer.nix b/nixos/modules/services/networking/vdirsyncer.nix index 325c7e60a11d..cbce87f29e02 100644 --- a/nixos/modules/services/networking/vdirsyncer.nix +++ b/nixos/modules/services/networking/vdirsyncer.nix @@ -38,22 +38,21 @@ let ); userUnitConfig = name: cfg': { - serviceConfig = - { - User = if cfg'.user == null then "vdirsyncer" else cfg'.user; - Group = if cfg'.group == null then "vdirsyncer" else cfg'.group; - } - // (optionalAttrs (cfg'.user == null) { - DynamicUser = true; - ProtectHome = true; - }) - // (optionalAttrs (cfg'.additionalGroups != [ ]) { - SupplementaryGroups = cfg'.additionalGroups; - }) - // (optionalAttrs (cfg'.config.statusPath == null) { - StateDirectory = "vdirsyncer/${name}"; - StateDirectoryMode = "0700"; - }); + serviceConfig = { + User = if cfg'.user == null then "vdirsyncer" else cfg'.user; + Group = if cfg'.group == null then "vdirsyncer" else cfg'.group; + } + // (optionalAttrs (cfg'.user == null) { + DynamicUser = true; + ProtectHome = true; + }) + // (optionalAttrs (cfg'.additionalGroups != [ ]) { + SupplementaryGroups = cfg'.additionalGroups; + }) + // (optionalAttrs (cfg'.config.statusPath == null) { + StateDirectory = "vdirsyncer/${name}"; + StateDirectoryMode = "0700"; + }); }; commonUnitConfig = { diff --git a/nixos/modules/services/networking/vsftpd.nix b/nixos/modules/services/networking/vsftpd.nix index e6ef14b2e3e4..c42ef15df740 100644 --- a/nixos/modules/services/networking/vsftpd.nix +++ b/nixos/modules/services/networking/vsftpd.nix @@ -265,7 +265,8 @@ in description = "Extra configuration to add at the bottom of the generated configuration file."; }; - } // (listToAttrs (catAttrs "nixosOption" optionDescription)); + } + // (listToAttrs (catAttrs "nixosOption" optionDescription)); }; @@ -287,28 +288,27 @@ in } ]; - users.users = - { - "vsftpd" = { - group = "vsftpd"; - isSystemUser = true; - description = "VSFTPD user"; - home = - if cfg.localRoot != null then - cfg.localRoot # <= Necessary for virtual users. - else - "/homeless-shelter"; - }; - } - // optionalAttrs cfg.anonymousUser { - "ftp" = { - name = "ftp"; - uid = config.ids.uids.ftp; - group = "ftp"; - description = "Anonymous FTP user"; - home = cfg.anonymousUserHome; - }; + users.users = { + "vsftpd" = { + group = "vsftpd"; + isSystemUser = true; + description = "VSFTPD user"; + home = + if cfg.localRoot != null then + cfg.localRoot # <= Necessary for virtual users. + else + "/homeless-shelter"; }; + } + // optionalAttrs cfg.anonymousUser { + "ftp" = { + name = "ftp"; + uid = config.ids.uids.ftp; + group = "ftp"; + description = "Anonymous FTP user"; + home = cfg.anonymousUserHome; + }; + }; users.groups.vsftpd = { }; users.groups.ftp.gid = config.ids.gids.ftp; diff --git a/nixos/modules/services/networking/wasabibackend.nix b/nixos/modules/services/networking/wasabibackend.nix index 1c8c884fbe11..ed8d8f441555 100644 --- a/nixos/modules/services/networking/wasabibackend.nix +++ b/nixos/modules/services/networking/wasabibackend.nix @@ -20,25 +20,24 @@ let types ; - confOptions = - { - BitcoinRpcConnectionString = "${cfg.rpc.user}:${cfg.rpc.password}"; - } - // optionalAttrs (cfg.network == "mainnet") { - Network = "Main"; - MainNetBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}"; - MainNetBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}"; - } - // optionalAttrs (cfg.network == "testnet") { - Network = "TestNet"; - TestNetBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}"; - TestNetBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}"; - } - // optionalAttrs (cfg.network == "regtest") { - Network = "RegTest"; - RegTestBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}"; - RegTestBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}"; - }; + confOptions = { + BitcoinRpcConnectionString = "${cfg.rpc.user}:${cfg.rpc.password}"; + } + // optionalAttrs (cfg.network == "mainnet") { + Network = "Main"; + MainNetBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}"; + MainNetBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}"; + } + // optionalAttrs (cfg.network == "testnet") { + Network = "TestNet"; + TestNetBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}"; + TestNetBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}"; + } + // optionalAttrs (cfg.network == "regtest") { + Network = "RegTest"; + RegTestBitcoinP2pEndPoint = "${cfg.endpoint.ip}:${toString cfg.endpoint.port}"; + RegTestBitcoinCoreRpcEndPoint = "${cfg.rpc.ip}:${toString cfg.rpc.port}"; + }; configFile = pkgs.writeText "wasabibackend.conf" (builtins.toJSON confOptions); diff --git a/nixos/modules/services/networking/webhook.nix b/nixos/modules/services/networking/webhook.nix index 7a7c8e1e7095..6d7d62dcd6fc 100644 --- a/nixos/modules/services/networking/webhook.nix +++ b/nixos/modules/services/networking/webhook.nix @@ -210,22 +210,21 @@ in environment = config.networking.proxy.envVars // cfg.environment; script = let - args = - [ - "-ip" - cfg.ip - "-port" - (toString cfg.port) - "-urlprefix" - cfg.urlPrefix - ] - ++ concatMap (hook: [ - "-hooks" - hook - ]) hookFiles - ++ optional cfg.enableTemplates "-template" - ++ optional cfg.verbose "-verbose" - ++ cfg.extraArgs; + args = [ + "-ip" + cfg.ip + "-port" + (toString cfg.port) + "-urlprefix" + cfg.urlPrefix + ] + ++ concatMap (hook: [ + "-hooks" + hook + ]) hookFiles + ++ optional cfg.enableTemplates "-template" + ++ optional cfg.verbose "-verbose" + ++ cfg.extraArgs; in '' ${cfg.package}/bin/webhook ${escapeShellArgs args} diff --git a/nixos/modules/services/networking/wg-access-server.nix b/nixos/modules/services/networking/wg-access-server.nix index d27f891d3d2e..c5fb98d527e6 100644 --- a/nixos/modules/services/networking/wg-access-server.nix +++ b/nixos/modules/services/networking/wg-access-server.nix @@ -127,7 +127,8 @@ in let capabilities = [ "CAP_NET_ADMIN" - ] ++ lib.optional cfg.settings.dns.enabled "CAP_NET_BIND_SERVICE"; + ] + ++ lib.optional cfg.settings.dns.enabled "CAP_NET_BIND_SERVICE"; in { WorkingDirectory = "/var/lib/wg-access-server"; diff --git a/nixos/modules/services/networking/wg-quick.nix b/nixos/modules/services/networking/wg-quick.nix index 5c851a08aa7e..66c77c32f2ca 100644 --- a/nixos/modules/services/networking/wg-quick.nix +++ b/nixos/modules/services/networking/wg-quick.nix @@ -330,36 +330,35 @@ let name = "config-${name}"; executable = false; destination = "/${name}.conf"; - text = - '' - [interface] - ${concatMapStringsSep "\n" (address: "Address = ${address}") values.address} - ${concatMapStringsSep "\n" (dns: "DNS = ${dns}") values.dns} - '' - + optionalString (values.table != null) "Table = ${values.table}\n" - + optionalString (values.mtu != null) "MTU = ${toString values.mtu}\n" - + optionalString (values.privateKey != null) "PrivateKey = ${values.privateKey}\n" - + optionalString (values.listenPort != null) "ListenPort = ${toString values.listenPort}\n" - + optionalString (generateKeyScriptFile != null) "PreUp = ${generateKeyScriptFile}\n" - + optionalString (preUpFile != null) "PreUp = ${preUpFile}\n" - + optionalString (postUpFile != null) "PostUp = ${postUpFile}\n" - + optionalString (preDownFile != null) "PreDown = ${preDownFile}\n" - + optionalString (postDownFile != null) "PostDown = ${postDownFile}\n" - + concatLines (mapAttrsToList (n: v: "${n} = ${toString v}") values.extraOptions) - + concatMapStringsSep "\n" ( - peer: - assert assertMsg ( - !((peer.presharedKeyFile != null) && (peer.presharedKey != null)) - ) "Only one of presharedKey or presharedKeyFile may be set"; - "[Peer]\n" - + "PublicKey = ${peer.publicKey}\n" - + optionalString (peer.presharedKey != null) "PresharedKey = ${peer.presharedKey}\n" - + optionalString (peer.endpoint != null) "Endpoint = ${peer.endpoint}\n" - + optionalString ( - peer.persistentKeepalive != null - ) "PersistentKeepalive = ${toString peer.persistentKeepalive}\n" - + optionalString (peer.allowedIPs != [ ]) "AllowedIPs = ${concatStringsSep "," peer.allowedIPs}\n" - ) values.peers; + text = '' + [interface] + ${concatMapStringsSep "\n" (address: "Address = ${address}") values.address} + ${concatMapStringsSep "\n" (dns: "DNS = ${dns}") values.dns} + '' + + optionalString (values.table != null) "Table = ${values.table}\n" + + optionalString (values.mtu != null) "MTU = ${toString values.mtu}\n" + + optionalString (values.privateKey != null) "PrivateKey = ${values.privateKey}\n" + + optionalString (values.listenPort != null) "ListenPort = ${toString values.listenPort}\n" + + optionalString (generateKeyScriptFile != null) "PreUp = ${generateKeyScriptFile}\n" + + optionalString (preUpFile != null) "PreUp = ${preUpFile}\n" + + optionalString (postUpFile != null) "PostUp = ${postUpFile}\n" + + optionalString (preDownFile != null) "PreDown = ${preDownFile}\n" + + optionalString (postDownFile != null) "PostDown = ${postDownFile}\n" + + concatLines (mapAttrsToList (n: v: "${n} = ${toString v}") values.extraOptions) + + concatMapStringsSep "\n" ( + peer: + assert assertMsg ( + !((peer.presharedKeyFile != null) && (peer.presharedKey != null)) + ) "Only one of presharedKey or presharedKeyFile may be set"; + "[Peer]\n" + + "PublicKey = ${peer.publicKey}\n" + + optionalString (peer.presharedKey != null) "PresharedKey = ${peer.presharedKey}\n" + + optionalString (peer.endpoint != null) "Endpoint = ${peer.endpoint}\n" + + optionalString ( + peer.persistentKeepalive != null + ) "PersistentKeepalive = ${toString peer.persistentKeepalive}\n" + + optionalString (peer.allowedIPs != [ ]) "AllowedIPs = ${concatStringsSep "," peer.allowedIPs}\n" + ) values.peers; }; configPath = if values.configFile != null then diff --git a/nixos/modules/services/networking/whoogle-search.nix b/nixos/modules/services/networking/whoogle-search.nix index c0067edce7f0..d06121c7a26f 100644 --- a/nixos/modules/services/networking/whoogle-search.nix +++ b/nixos/modules/services/networking/whoogle-search.nix @@ -45,7 +45,8 @@ in environment = { CONFIG_VOLUME = "/var/lib/whoogle-search"; - } // cfg.extraEnv; + } + // cfg.extraEnv; serviceConfig = { Type = "simple"; diff --git a/nixos/modules/services/networking/wireguard.nix b/nixos/modules/services/networking/wireguard.nix index be28b1ee887d..7d266d483fb1 100644 --- a/nixos/modules/services/networking/wireguard.nix +++ b/nixos/modules/services/networking/wireguard.nix @@ -740,8 +740,7 @@ in ++ optional usingAwg kernel.amneziawg; boot.kernelModules = optional usingWg "wireguard" ++ optional usingAwg "amneziawg"; environment.systemPackages = - optional usingWg pkgs.wireguard-tools - ++ optional usingAwg pkgs.amneziawg-tools; + optional usingWg pkgs.wireguard-tools ++ optional usingAwg pkgs.amneziawg-tools; systemd.services = mkIf (!cfg.useNetworkd) ( (mapAttrs' generateInterfaceUnit cfg.interfaces) diff --git a/nixos/modules/services/networking/wpa_supplicant.nix b/nixos/modules/services/networking/wpa_supplicant.nix index f4caf21dc3b2..88eaffdc1ee1 100644 --- a/nixos/modules/services/networking/wpa_supplicant.nix +++ b/nixos/modules/services/networking/wpa_supplicant.nix @@ -80,21 +80,20 @@ let pskString = if opts.psk != null then quote opts.psk else opts.pskRaw; - options = - [ - "ssid=${quote opts.ssid}" - ( - if pskString != null || opts.auth != null then - "key_mgmt=${concatStringsSep " " opts.authProtocols}" - else - "key_mgmt=NONE" - ) - ] - ++ optional opts.hidden "scan_ssid=1" - ++ optional (pskString != null) "psk=${pskString}" - ++ optionals (opts.auth != null) (filter (x: x != "") (splitString "\n" opts.auth)) - ++ optional (opts.priority != null) "priority=${toString opts.priority}" - ++ filter (x: x != "") (splitString "\n" opts.extraConfig); + options = [ + "ssid=${quote opts.ssid}" + ( + if pskString != null || opts.auth != null then + "key_mgmt=${concatStringsSep " " opts.authProtocols}" + else + "key_mgmt=NONE" + ) + ] + ++ optional opts.hidden "scan_ssid=1" + ++ optional (pskString != null) "psk=${pskString}" + ++ optionals (opts.auth != null) (filter (x: x != "") (splitString "\n" opts.auth)) + ++ optional (opts.priority != null) "priority=${toString opts.priority}" + ++ filter (x: x != "") (splitString "\n" opts.extraConfig); in '' network={ diff --git a/nixos/modules/services/networking/wstunnel.nix b/nixos/modules/services/networking/wstunnel.nix index 80a67a602230..ce6195ec1011 100644 --- a/nixos/modules/services/networking/wstunnel.nix +++ b/nixos/modules/services/networking/wstunnel.nix @@ -66,21 +66,21 @@ let certConfig = outerConfig.security.acme.certs.${config.useACMEHost}; in { - imports = - [ - ../../misc/assertions.nix + imports = [ + ../../misc/assertions.nix - (lib.mkRenamedOptionModule - [ - "enableHTTPS" - ] - [ - "listen" - "enableHTTPS" - ] - ) - ] - ++ lib.map + (lib.mkRenamedOptionModule + [ + "enableHTTPS" + ] + [ + "listen" + "enableHTTPS" + ] + ) + ] + ++ + lib.map ( option: lib.mkRemovedOptionModule [ option ] '' @@ -205,11 +205,11 @@ let clientSubmodule = { config, ... }: { - imports = - [ - ../../misc/assertions.nix - ] - ++ lib.map + imports = [ + ../../misc/assertions.nix + ] + ++ + lib.map ( option: lib.mkRemovedOptionModule [ option ] '' diff --git a/nixos/modules/services/networking/yggdrasil.nix b/nixos/modules/services/networking/yggdrasil.nix index f40440fc3674..b9227b6ab464 100644 --- a/nixos/modules/services/networking/yggdrasil.nix +++ b/nixos/modules/services/networking/yggdrasil.nix @@ -216,42 +216,41 @@ in exec ${binYggdrasil} -useconffile /run/yggdrasil/yggdrasil.conf ${lib.strings.escapeShellArgs cfg.extraArgs} ''; - serviceConfig = - { - ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; - Restart = "always"; + serviceConfig = { + ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; + Restart = "always"; - DynamicUser = true; - StateDirectory = "yggdrasil"; - RuntimeDirectory = "yggdrasil"; - RuntimeDirectoryMode = "0750"; - BindReadOnlyPaths = lib.optional cfg.persistentKeys keysPath; - LoadCredential = mkIf configFileProvided "yggdrasil.conf:${cfg.configFile}"; + DynamicUser = true; + StateDirectory = "yggdrasil"; + RuntimeDirectory = "yggdrasil"; + RuntimeDirectoryMode = "0750"; + BindReadOnlyPaths = lib.optional cfg.persistentKeys keysPath; + LoadCredential = mkIf configFileProvided "yggdrasil.conf:${cfg.configFile}"; - AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE"; - CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE"; - MemoryDenyWriteExecute = true; - ProtectControlGroups = true; - ProtectHome = "tmpfs"; - ProtectKernelModules = true; - ProtectKernelTunables = true; - RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_NETLINK"; - RestrictNamespaces = true; - RestrictRealtime = true; - SystemCallArchitectures = "native"; - SystemCallFilter = [ - "@system-service" - "~@privileged @keyring" - ]; - } - // ( - if (cfg.group != null) then - { - Group = cfg.group; - } - else - { } - ); + AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE"; + CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE"; + MemoryDenyWriteExecute = true; + ProtectControlGroups = true; + ProtectHome = "tmpfs"; + ProtectKernelModules = true; + ProtectKernelTunables = true; + RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_NETLINK"; + RestrictNamespaces = true; + RestrictRealtime = true; + SystemCallArchitectures = "native"; + SystemCallFilter = [ + "@system-service" + "~@privileged @keyring" + ]; + } + // ( + if (cfg.group != null) then + { + Group = cfg.group; + } + else + { } + ); }; networking.dhcpcd.denyInterfaces = cfg.denyDhcpcdInterfaces; diff --git a/nixos/modules/services/networking/zerotierone.nix b/nixos/modules/services/networking/zerotierone.nix index ebf800cf3f26..5981935f38c5 100644 --- a/nixos/modules/services/networking/zerotierone.nix +++ b/nixos/modules/services/networking/zerotierone.nix @@ -61,27 +61,26 @@ in path = [ cfg.package ]; - preStart = - '' - mkdir -p /var/lib/zerotier-one/networks.d - chmod 700 /var/lib/zerotier-one - chown -R root:root /var/lib/zerotier-one + preStart = '' + mkdir -p /var/lib/zerotier-one/networks.d + chmod 700 /var/lib/zerotier-one + chown -R root:root /var/lib/zerotier-one - # cleans up old symlinks also if we unset localConf - if [[ -L "${localConfFilePath}" && "$(readlink "${localConfFilePath}")" =~ ^${builtins.storeDir}.* ]]; then - rm ${localConfFilePath} - fi - '' - + (concatMapStrings (netId: '' - touch "/var/lib/zerotier-one/networks.d/${netId}.conf" - '') cfg.joinNetworks) - + lib.optionalString (cfg.localConf != { }) '' - # in case the user has applied manual changes to the local.conf, we backup the file - if [ -f "${localConfFilePath}" ]; then - mv ${localConfFilePath} ${localConfFilePath}.bak - fi - ln -s ${localConfFile} ${localConfFilePath} - ''; + # cleans up old symlinks also if we unset localConf + if [[ -L "${localConfFilePath}" && "$(readlink "${localConfFilePath}")" =~ ^${builtins.storeDir}.* ]]; then + rm ${localConfFilePath} + fi + '' + + (concatMapStrings (netId: '' + touch "/var/lib/zerotier-one/networks.d/${netId}.conf" + '') cfg.joinNetworks) + + lib.optionalString (cfg.localConf != { }) '' + # in case the user has applied manual changes to the local.conf, we backup the file + if [ -f "${localConfFilePath}" ]; then + mv ${localConfFilePath} ${localConfFilePath}.bak + fi + ln -s ${localConfFile} ${localConfFilePath} + ''; serviceConfig = { ExecStart = "${cfg.package}/bin/zerotier-one -p${toString cfg.port}"; diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index 9e1ab0abef4b..ce0b1159470a 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -53,7 +53,8 @@ let libcupsfilters cups-filters pkgs.ghostscript - ] ++ cfg.drivers; + ] + ++ cfg.drivers; pathsToLink = [ "/lib" "/share/cups" @@ -116,15 +117,14 @@ let rootdir = pkgs.buildEnv { name = "cups-progs"; - paths = - [ - cupsFilesFile - cupsdFile - (writeConf "client.conf" cfg.clientConf) - (writeConf "snmp.conf" cfg.snmpConf) - ] - ++ optional cfg.browsed.enable browsedFile - ++ cfg.drivers; + paths = [ + cupsFilesFile + cupsdFile + (writeConf "client.conf" cfg.clientConf) + (writeConf "snmp.conf" cfg.snmpConf) + ] + ++ optional cfg.browsed.enable browsedFile + ++ cfg.drivers; pathsToLink = [ "/etc/cups" ]; ignoreCollisions = true; }; @@ -377,7 +377,8 @@ in environment.systemPackages = [ cups.out xdg-utils - ] ++ optional polkitEnabled cups-pk-helper; + ] + ++ optional polkitEnabled cups-pk-helper; environment.etc.cups.source = "/var/lib/cups"; services.dbus.packages = [ cups.out ] ++ optional polkitEnabled cups-pk-helper; @@ -406,14 +407,13 @@ in systemd.sockets.cups = mkIf cfg.startWhenNeeded { wantedBy = [ "sockets.target" ]; - listenStreams = - [ - "" - "/run/cups/cups.sock" - ] - ++ map ( - x: replaceStrings [ "localhost" ] [ "127.0.0.1" ] (removePrefix "*:" x) - ) cfg.listenAddresses; + listenStreams = [ + "" + "/run/cups/cups.sock" + ] + ++ map ( + x: replaceStrings [ "localhost" ] [ "127.0.0.1" ] (removePrefix "*:" x) + ) cfg.listenAddresses; }; systemd.services.cups = { diff --git a/nixos/modules/services/scheduling/prefect.nix b/nixos/modules/services/scheduling/prefect.nix index 409279edd692..c0a5fae52703 100644 --- a/nixos/modules/services/scheduling/prefect.nix +++ b/nixos/modules/services/scheduling/prefect.nix @@ -129,104 +129,103 @@ in config = lib.mkIf cfg.enable { # define systemd.services as the server plus any worker definitions - systemd.services = - { - "prefect-server" = { - description = "prefect server"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + systemd.services = { + "prefect-server" = { + description = "prefect server"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; - serviceConfig = { - DynamicUser = true; - StateDirectory = "prefect-server"; - # TODO all my efforts to setup the database url - # have failed with some unable to open file - Environment = [ - "PREFECT_HOME=%S/prefect-server" - "PREFECT_UI_STATIC_DIRECTORY=%S/prefect-server" - "PREFECT_SERVER_ANALYTICS_ENABLED=off" - "PREFECT_UI_API_URL=${cfg.baseUrl}/api" - "PREFECT_UI_URL=${cfg.baseUrl}" - ]; - EnvironmentFile = - if cfg.database == "postgres" && cfg.databasePasswordFile != null then - [ cfg.databasePasswordFile ] - else - [ ]; + serviceConfig = { + DynamicUser = true; + StateDirectory = "prefect-server"; + # TODO all my efforts to setup the database url + # have failed with some unable to open file + Environment = [ + "PREFECT_HOME=%S/prefect-server" + "PREFECT_UI_STATIC_DIRECTORY=%S/prefect-server" + "PREFECT_SERVER_ANALYTICS_ENABLED=off" + "PREFECT_UI_API_URL=${cfg.baseUrl}/api" + "PREFECT_UI_URL=${cfg.baseUrl}" + ]; + EnvironmentFile = + if cfg.database == "postgres" && cfg.databasePasswordFile != null then + [ cfg.databasePasswordFile ] + else + [ ]; - # ReadWritePaths = [ cfg.dataDir ]; - ProtectSystem = "strict"; - ProtectHome = true; - PrivateTmp = true; - NoNewPrivileges = true; - MemoryDenyWriteExecute = true; - LockPersonality = true; - CapabilityBoundingSet = [ ]; - AmbientCapabilities = [ ]; - RestrictSUIDSGID = true; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - "AF_UNIX" - ]; - ProtectKernelTunables = true; - ProtectKernelModules = true; - ProtectKernelLogs = true; - ProtectControlGroups = true; - MemoryAccounting = true; - CPUAccounting = true; + # ReadWritePaths = [ cfg.dataDir ]; + ProtectSystem = "strict"; + ProtectHome = true; + PrivateTmp = true; + NoNewPrivileges = true; + MemoryDenyWriteExecute = true; + LockPersonality = true; + CapabilityBoundingSet = [ ]; + AmbientCapabilities = [ ]; + RestrictSUIDSGID = true; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_UNIX" + ]; + ProtectKernelTunables = true; + ProtectKernelModules = true; + ProtectKernelLogs = true; + ProtectControlGroups = true; + MemoryAccounting = true; + CPUAccounting = true; - ExecStart = "${pkgs.prefect}/bin/prefect server start --host ${cfg.host} --port ${toString cfg.port}"; - Restart = "always"; - WorkingDirectory = cfg.dataDir; - }; + ExecStart = "${pkgs.prefect}/bin/prefect server start --host ${cfg.host} --port ${toString cfg.port}"; + Restart = "always"; + WorkingDirectory = cfg.dataDir; }; - } - // lib.concatMapAttrs (poolName: poolCfg: { - # return a partial attr set with one key: "prefect-worker-..." - "prefect-worker-${poolName}" = { - description = "prefect worker for pool '${poolName}'"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + }; + } + // lib.concatMapAttrs (poolName: poolCfg: { + # return a partial attr set with one key: "prefect-worker-..." + "prefect-worker-${poolName}" = { + description = "prefect worker for pool '${poolName}'"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; - environment.systemPackages = cfg.package; + environment.systemPackages = cfg.package; - serviceConfig = { - DynamicUser = true; - StateDirectory = "prefect-worker-${poolName}"; - Environment = [ - "PREFECT_HOME=%S/prefect-worker-${poolName}" - "PREFECT_API_URL=${cfg.baseUrl}/api" - ]; - ProtectSystem = "strict"; - ProtectHome = true; - PrivateTmp = true; - NoNewPrivileges = true; - MemoryDenyWriteExecute = true; - LockPersonality = true; - CapabilityBoundingSet = [ ]; - AmbientCapabilities = [ ]; - RestrictSUIDSGID = true; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - "AF_UNIX" - ]; - ProtectKernelTunables = true; - ProtectKernelModules = true; - ProtectKernelLogs = true; - ProtectControlGroups = true; - MemoryAccounting = true; - CPUAccounting = true; - ExecStart = '' - ${pkgs.prefect}/bin/prefect worker start \ - --pool ${poolName} \ - --type process \ - --install-policy ${poolCfg.installPolicy} - ''; - Restart = "always"; - }; + serviceConfig = { + DynamicUser = true; + StateDirectory = "prefect-worker-${poolName}"; + Environment = [ + "PREFECT_HOME=%S/prefect-worker-${poolName}" + "PREFECT_API_URL=${cfg.baseUrl}/api" + ]; + ProtectSystem = "strict"; + ProtectHome = true; + PrivateTmp = true; + NoNewPrivileges = true; + MemoryDenyWriteExecute = true; + LockPersonality = true; + CapabilityBoundingSet = [ ]; + AmbientCapabilities = [ ]; + RestrictSUIDSGID = true; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_UNIX" + ]; + ProtectKernelTunables = true; + ProtectKernelModules = true; + ProtectKernelLogs = true; + ProtectControlGroups = true; + MemoryAccounting = true; + CPUAccounting = true; + ExecStart = '' + ${pkgs.prefect}/bin/prefect worker start \ + --pool ${poolName} \ + --type process \ + --install-policy ${poolCfg.installPolicy} + ''; + Restart = "always"; }; - }) cfg.workerPools; + }; + }) cfg.workerPools; }; } diff --git a/nixos/modules/services/search/manticore.nix b/nixos/modules/services/search/manticore.nix index e69c6d8c59f2..cbedb5630d0e 100644 --- a/nixos/modules/services/search/manticore.nix +++ b/nixos/modules/services/search/manticore.nix @@ -94,51 +94,50 @@ in services.manticore = { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - serviceConfig = - { - ExecStart = [ - "" - "${pkgs.manticoresearch}/bin/searchd --config ${configFile}" - ]; - ExecStop = [ - "" - "${pkgs.manticoresearch}/bin/searchd --config ${configFile} --stopwait" - ]; - ExecStartPre = [ "" ]; - DynamicUser = true; - LogsDirectory = "manticore"; - RuntimeDirectory = "manticore"; - StateDirectory = "manticore"; - ReadWritePaths = ""; - CapabilityBoundingSet = ""; - RestrictAddressFamilies = [ - "AF_UNIX" - "AF_INET" - "AF_INET6" - ]; - RestrictNamespaces = true; - PrivateDevices = true; - PrivateUsers = true; - ProtectClock = true; - ProtectControlGroups = true; - ProtectHome = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - SystemCallArchitectures = "native"; - SystemCallFilter = [ - "@system-service" - "~@privileged" - ]; - RestrictRealtime = true; - LockPersonality = true; - MemoryDenyWriteExecute = true; - UMask = "0066"; - ProtectHostname = true; - } - // lib.optionalAttrs (cfg.settings.searchd.pid_file != null) { - PIDFile = cfg.settings.searchd.pid_file; - }; + serviceConfig = { + ExecStart = [ + "" + "${pkgs.manticoresearch}/bin/searchd --config ${configFile}" + ]; + ExecStop = [ + "" + "${pkgs.manticoresearch}/bin/searchd --config ${configFile} --stopwait" + ]; + ExecStartPre = [ "" ]; + DynamicUser = true; + LogsDirectory = "manticore"; + RuntimeDirectory = "manticore"; + StateDirectory = "manticore"; + ReadWritePaths = ""; + CapabilityBoundingSet = ""; + RestrictAddressFamilies = [ + "AF_UNIX" + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + PrivateDevices = true; + PrivateUsers = true; + ProtectClock = true; + ProtectControlGroups = true; + ProtectHome = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + SystemCallArchitectures = "native"; + SystemCallFilter = [ + "@system-service" + "~@privileged" + ]; + RestrictRealtime = true; + LockPersonality = true; + MemoryDenyWriteExecute = true; + UMask = "0066"; + ProtectHostname = true; + } + // lib.optionalAttrs (cfg.settings.searchd.pid_file != null) { + PIDFile = cfg.settings.searchd.pid_file; + }; }; }; diff --git a/nixos/modules/services/search/nominatim.nix b/nixos/modules/services/search/nominatim.nix index 5701fcc18650..39cf047a98a9 100644 --- a/nixos/modules/services/search/nominatim.nix +++ b/nixos/modules/services/search/nominatim.nix @@ -216,7 +216,8 @@ in environment = { NOMINATIM_DATABASE_DSN = nominatimSuperUserDsn; NOMINATIM_DATABASE_WEBUSER = cfg.database.apiUser; - } // cfg.settings; + } + // cfg.settings; }; # Web API service @@ -259,7 +260,8 @@ in ]; NOMINATIM_DATABASE_DSN = nominatimApiDsn; NOMINATIM_DATABASE_WEBUSER = cfg.database.apiUser; - } // cfg.settings; + } + // cfg.settings; }; systemd.sockets.nominatim = { diff --git a/nixos/modules/services/search/opensearch.nix b/nixos/modules/services/search/opensearch.nix index 6630dd017db6..eb2ec893698e 100644 --- a/nixos/modules/services/search/opensearch.nix +++ b/nixos/modules/services/search/opensearch.nix @@ -182,93 +182,91 @@ in OPENSEARCH_JAVA_OPTS = toString cfg.extraJavaOptions; OPENSEARCH_PATH_CONF = configDir; }; - serviceConfig = - { - ExecStartPre = - let - startPreFullPrivileges = - '' - set -o errexit -o pipefail -o nounset -o errtrace - shopt -s inherit_errexit - '' - + (lib.optionalString (!config.boot.isContainer) '' - # Only set vm.max_map_count if lower than ES required minimum - # This avoids conflict if configured via boot.kernel.sysctl - if [ $(${pkgs.procps}/bin/sysctl -n vm.max_map_count) -lt 262144 ]; then - ${pkgs.procps}/bin/sysctl -w vm.max_map_count=262144 - fi - ''); - startPreUnprivileged = '' - set -o errexit -o pipefail -o nounset -o errtrace - shopt -s inherit_errexit + serviceConfig = { + ExecStartPre = + let + startPreFullPrivileges = '' + set -o errexit -o pipefail -o nounset -o errtrace + shopt -s inherit_errexit + '' + + (lib.optionalString (!config.boot.isContainer) '' + # Only set vm.max_map_count if lower than ES required minimum + # This avoids conflict if configured via boot.kernel.sysctl + if [ $(${pkgs.procps}/bin/sysctl -n vm.max_map_count) -lt 262144 ]; then + ${pkgs.procps}/bin/sysctl -w vm.max_map_count=262144 + fi + ''); + startPreUnprivileged = '' + set -o errexit -o pipefail -o nounset -o errtrace + shopt -s inherit_errexit - # Install plugins + # Install plugins - # remove plugins directory if it is empty. - if [[ -d ${cfg.dataDir}/plugins && -z "$(ls -A ${cfg.dataDir}/plugins)" ]]; then - rm -r "${cfg.dataDir}/plugins" - fi + # remove plugins directory if it is empty. + if [[ -d ${cfg.dataDir}/plugins && -z "$(ls -A ${cfg.dataDir}/plugins)" ]]; then + rm -r "${cfg.dataDir}/plugins" + fi - ln -sfT "${cfg.package}/plugins" "${cfg.dataDir}/plugins" - ln -sfT ${cfg.package}/lib ${cfg.dataDir}/lib - ln -sfT ${cfg.package}/modules ${cfg.dataDir}/modules + ln -sfT "${cfg.package}/plugins" "${cfg.dataDir}/plugins" + ln -sfT ${cfg.package}/lib ${cfg.dataDir}/lib + ln -sfT ${cfg.package}/modules ${cfg.dataDir}/modules - # opensearch needs to create the opensearch.keystore in the config directory - # so this directory needs to be writable. - mkdir -p ${configDir} - chmod 0700 ${configDir} + # opensearch needs to create the opensearch.keystore in the config directory + # so this directory needs to be writable. + mkdir -p ${configDir} + chmod 0700 ${configDir} - # Note that we copy config files from the nix store instead of symbolically linking them - # because otherwise X-Pack Security will raise the following exception: - # java.security.AccessControlException: - # access denied ("java.io.FilePermission" "/var/lib/opensearch/config/opensearch.yml" "read") + # Note that we copy config files from the nix store instead of symbolically linking them + # because otherwise X-Pack Security will raise the following exception: + # java.security.AccessControlException: + # access denied ("java.io.FilePermission" "/var/lib/opensearch/config/opensearch.yml" "read") - rm -f ${configDir}/opensearch.yml - cp ${opensearchYml} ${configDir}/opensearch.yml + rm -f ${configDir}/opensearch.yml + cp ${opensearchYml} ${configDir}/opensearch.yml - # Make sure the logging configuration for old OpenSearch versions is removed: - rm -f "${configDir}/logging.yml" - rm -f ${configDir}/${loggingConfigFilename} - cp ${loggingConfigFile} ${configDir}/${loggingConfigFilename} - mkdir -p ${configDir}/scripts + # Make sure the logging configuration for old OpenSearch versions is removed: + rm -f "${configDir}/logging.yml" + rm -f ${configDir}/${loggingConfigFilename} + cp ${loggingConfigFile} ${configDir}/${loggingConfigFilename} + mkdir -p ${configDir}/scripts - rm -f ${configDir}/jvm.options - cp ${cfg.package}/config/jvm.options ${configDir}/jvm.options + rm -f ${configDir}/jvm.options + cp ${cfg.package}/config/jvm.options ${configDir}/jvm.options - # redirect jvm logs to the data directory - mkdir -p ${cfg.dataDir}/logs - chmod 0700 ${cfg.dataDir}/logs - sed -e '#logs/gc.log#${cfg.dataDir}/logs/gc.log#' -i ${configDir}/jvm.options - ''; - in - [ - "+${pkgs.writeShellScript "opensearch-start-pre-full-privileges" startPreFullPrivileges}" - "${pkgs.writeShellScript "opensearch-start-pre-unprivileged" startPreUnprivileged}" - ]; - ExecStartPost = pkgs.writeShellScript "opensearch-start-post" '' - set -o errexit -o pipefail -o nounset -o errtrace - shopt -s inherit_errexit + # redirect jvm logs to the data directory + mkdir -p ${cfg.dataDir}/logs + chmod 0700 ${cfg.dataDir}/logs + sed -e '#logs/gc.log#${cfg.dataDir}/logs/gc.log#' -i ${configDir}/jvm.options + ''; + in + [ + "+${pkgs.writeShellScript "opensearch-start-pre-full-privileges" startPreFullPrivileges}" + "${pkgs.writeShellScript "opensearch-start-pre-unprivileged" startPreUnprivileged}" + ]; + ExecStartPost = pkgs.writeShellScript "opensearch-start-post" '' + set -o errexit -o pipefail -o nounset -o errtrace + shopt -s inherit_errexit - # Make sure opensearch is up and running before dependents - # are started - while ! ${pkgs.curl}/bin/curl -sS -f http://${cfg.settings."network.host"}:${ - toString cfg.settings."http.port" - } 2>/dev/null; do - sleep 1 - done - ''; - ExecStart = "${cfg.package}/bin/opensearch ${toString cfg.extraCmdLineOptions}"; - User = cfg.user; - Group = cfg.group; - LimitNOFILE = "1024000"; - Restart = "always"; - TimeoutStartSec = "infinity"; - DynamicUser = usingDefaultUserAndGroup && usingDefaultDataDir; - } - // (lib.optionalAttrs (usingDefaultDataDir) { - StateDirectory = "opensearch"; - StateDirectoryMode = "0700"; - }); + # Make sure opensearch is up and running before dependents + # are started + while ! ${pkgs.curl}/bin/curl -sS -f http://${cfg.settings."network.host"}:${ + toString cfg.settings."http.port" + } 2>/dev/null; do + sleep 1 + done + ''; + ExecStart = "${cfg.package}/bin/opensearch ${toString cfg.extraCmdLineOptions}"; + User = cfg.user; + Group = cfg.group; + LimitNOFILE = "1024000"; + Restart = "always"; + TimeoutStartSec = "infinity"; + DynamicUser = usingDefaultUserAndGroup && usingDefaultDataDir; + } + // (lib.optionalAttrs (usingDefaultDataDir) { + StateDirectory = "opensearch"; + StateDirectoryMode = "0700"; + }); }; environment.systemPackages = [ cfg.package ]; diff --git a/nixos/modules/services/search/quickwit.nix b/nixos/modules/services/search/quickwit.nix index c8b1c1c516e9..4fd74c1543e0 100644 --- a/nixos/modules/services/search/quickwit.nix +++ b/nixos/modules/services/search/quickwit.nix @@ -136,57 +136,56 @@ in environment = { QW_DATA_DIR = cfg.dataDir; }; - serviceConfig = - { - ExecStart = '' - ${cfg.package}/bin/quickwit run --config ${quickwitYml} \ - ${lib.escapeShellArgs cfg.extraFlags} - ''; - User = cfg.user; - Group = cfg.group; - Restart = "on-failure"; - DynamicUser = usingDefaultUserAndGroup && usingDefaultDataDir; - CapabilityBoundingSet = [ "" ]; - DevicePolicy = "closed"; - LockPersonality = true; - MemoryDenyWriteExecute = true; - NoNewPrivileges = true; - PrivateDevices = true; - ProcSubset = "pid"; - ProtectClock = true; - ProtectHome = true; - ProtectHostname = true; - ProtectControlGroups = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - ProtectSystem = "strict"; - ReadWritePaths = [ - cfg.dataDir - ]; - RestrictAddressFamilies = [ - "AF_NETLINK" - "AF_INET" - "AF_INET6" - ]; - RestrictNamespaces = true; - RestrictRealtime = true; - RestrictSUIDSGID = true; - SystemCallArchitectures = "native"; - SystemCallFilter = [ - # 1. allow a reasonable set of syscalls - "@system-service @resources" - # 2. and deny unreasonable ones - "~@privileged" - # 3. then allow the required subset within denied groups - "@chown" - ]; - } - // (lib.optionalAttrs (usingDefaultDataDir) { - StateDirectory = "quickwit"; - StateDirectoryMode = "0700"; - }); + serviceConfig = { + ExecStart = '' + ${cfg.package}/bin/quickwit run --config ${quickwitYml} \ + ${lib.escapeShellArgs cfg.extraFlags} + ''; + User = cfg.user; + Group = cfg.group; + Restart = "on-failure"; + DynamicUser = usingDefaultUserAndGroup && usingDefaultDataDir; + CapabilityBoundingSet = [ "" ]; + DevicePolicy = "closed"; + LockPersonality = true; + MemoryDenyWriteExecute = true; + NoNewPrivileges = true; + PrivateDevices = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectHome = true; + ProtectHostname = true; + ProtectControlGroups = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + ProtectSystem = "strict"; + ReadWritePaths = [ + cfg.dataDir + ]; + RestrictAddressFamilies = [ + "AF_NETLINK" + "AF_INET" + "AF_INET6" + ]; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + SystemCallFilter = [ + # 1. allow a reasonable set of syscalls + "@system-service @resources" + # 2. and deny unreasonable ones + "~@privileged" + # 3. then allow the required subset within denied groups + "@chown" + ]; + } + // (lib.optionalAttrs (usingDefaultDataDir) { + StateDirectory = "quickwit"; + StateDirectoryMode = "0700"; + }); }; environment.systemPackages = [ cfg.package ]; diff --git a/nixos/modules/services/security/aesmd.nix b/nixos/modules/services/security/aesmd.nix index 4f7f55e78e99..7a05fde7d3cb 100644 --- a/nixos/modules/services/security/aesmd.nix +++ b/nixos/modules/services/security/aesmd.nix @@ -153,7 +153,8 @@ in NAME = "aesm_service"; AESM_PATH = storeAesmFolder; LD_LIBRARY_PATH = makeLibraryPath [ cfg.quoteProviderLibrary ]; - } // cfg.environment; + } + // cfg.environment; # Make sure any of the SGX application enclave devices is available unitConfig.AssertPathExists = [ diff --git a/nixos/modules/services/security/canaille.nix b/nixos/modules/services/security/canaille.nix index 43c75fee2f1a..c550e955adb7 100644 --- a/nixos/modules/services/security/canaille.nix +++ b/nixos/modules/services/security/canaille.nix @@ -264,20 +264,19 @@ in # # See this for how Pydantic maps file names/env vars to config settings: # https://docs.pydantic.dev/latest/concepts/pydantic_settings/#parsing-environment-variable-values - systemd.tmpfiles.rules = - [ - "Z ${secretsDir} 700 canaille canaille - -" - "L+ ${secretsDir}/SECRET_KEY - - - - ${cfg.secretKeyFile}" - ] - ++ optional ( - cfg.smtpPasswordFile != null - ) "L+ ${secretsDir}/CANAILLE_SMTP__PASSWORD - - - - ${cfg.smtpPasswordFile}" - ++ optional ( - cfg.jwtPrivateKeyFile != null - ) "L+ ${secretsDir}/CANAILLE_OIDC__JWT__PRIVATE_KEY - - - - ${cfg.jwtPrivateKeyFile}" - ++ optional ( - cfg.ldapBindPasswordFile != null - ) "L+ ${secretsDir}/CANAILLE_LDAP__BIND_PW - - - - ${cfg.ldapBindPasswordFile}"; + systemd.tmpfiles.rules = [ + "Z ${secretsDir} 700 canaille canaille - -" + "L+ ${secretsDir}/SECRET_KEY - - - - ${cfg.secretKeyFile}" + ] + ++ optional ( + cfg.smtpPasswordFile != null + ) "L+ ${secretsDir}/CANAILLE_SMTP__PASSWORD - - - - ${cfg.smtpPasswordFile}" + ++ optional ( + cfg.jwtPrivateKeyFile != null + ) "L+ ${secretsDir}/CANAILLE_OIDC__JWT__PRIVATE_KEY - - - - ${cfg.jwtPrivateKeyFile}" + ++ optional ( + cfg.ldapBindPasswordFile != null + ) "L+ ${secretsDir}/CANAILLE_LDAP__BIND_PW - - - - ${cfg.ldapBindPasswordFile}"; # This is not a migration, just an initial setup of schemas systemd.services.canaille-install = { @@ -296,7 +295,8 @@ in after = [ "network.target" "canaille-install.service" - ] ++ optional createLocalPostgresqlDb "postgresql.target"; + ] + ++ optional createLocalPostgresqlDb "postgresql.target"; requires = [ "canaille-install.service" "canaille.socket" diff --git a/nixos/modules/services/security/fail2ban.nix b/nixos/modules/services/security/fail2ban.nix index dffb246dd1d5..e71d04fdef9a 100644 --- a/nixos/modules/services/security/fail2ban.nix +++ b/nixos/modules/services/security/fail2ban.nix @@ -357,20 +357,19 @@ in environment.systemPackages = [ cfg.package ]; - environment.etc = - { - "fail2ban/fail2ban.local".source = fail2banConf; - "fail2ban/jail.local".source = jailConf; - "fail2ban/fail2ban.conf".source = "${cfg.package}/etc/fail2ban/fail2ban.conf"; - "fail2ban/jail.conf".source = "${cfg.package}/etc/fail2ban/jail.conf"; - "fail2ban/paths-common.conf".source = "${cfg.package}/etc/fail2ban/paths-common.conf"; - "fail2ban/paths-nixos.conf".source = pathsConf; - "fail2ban/action.d".source = "${cfg.package}/etc/fail2ban/action.d/*.conf"; - "fail2ban/filter.d".source = "${cfg.package}/etc/fail2ban/filter.d/*.conf"; - } - // (lib.mapAttrs' mkFilter ( - lib.filterAttrs (_: v: v.filter != null && !builtins.isString v.filter) attrsJails - )); + environment.etc = { + "fail2ban/fail2ban.local".source = fail2banConf; + "fail2ban/jail.local".source = jailConf; + "fail2ban/fail2ban.conf".source = "${cfg.package}/etc/fail2ban/fail2ban.conf"; + "fail2ban/jail.conf".source = "${cfg.package}/etc/fail2ban/jail.conf"; + "fail2ban/paths-common.conf".source = "${cfg.package}/etc/fail2ban/paths-common.conf"; + "fail2ban/paths-nixos.conf".source = pathsConf; + "fail2ban/action.d".source = "${cfg.package}/etc/fail2ban/action.d/*.conf"; + "fail2ban/filter.d".source = "${cfg.package}/etc/fail2ban/filter.d/*.conf"; + } + // (lib.mapAttrs' mkFilter ( + lib.filterAttrs (_: v: v.filter != null && !builtins.isString v.filter) attrsJails + )); systemd.packages = [ cfg.package ]; systemd.services.fail2ban = { @@ -387,7 +386,8 @@ in cfg.package cfg.packageFirewall pkgs.iproute2 - ] ++ cfg.extraPackages; + ] + ++ cfg.extraPackages; serviceConfig = { # Capabilities diff --git a/nixos/modules/services/security/kanidm.nix b/nixos/modules/services/security/kanidm.nix index 14927f439ca5..02774fe114da 100644 --- a/nixos/modules/services/security/kanidm.nix +++ b/nixos/modules/services/security/kanidm.nix @@ -57,7 +57,8 @@ let secretPaths = [ cfg.serverSettings.tls_chain cfg.serverSettings.tls_key - ] ++ optionals cfg.provision.enable provisionSecretFiles; + ] + ++ optionals cfg.provision.enable provisionSecretFiles; # Merge bind mount paths and remove paths where a prefix is already mounted. # This makes sure that if e.g. the tls_chain is in the nix store and /nix/store is already in the mount @@ -899,14 +900,13 @@ in User = "kanidm"; Group = "kanidm"; - BindPaths = - [ - # To store backups - cfg.serverSettings.online_backup.path - ] - ++ optional ( - cfg.enablePam && cfg.unixSettings ? home_mount_prefix - ) cfg.unixSettings.home_mount_prefix; + BindPaths = [ + # To store backups + cfg.serverSettings.online_backup.path + ] + ++ optional ( + cfg.enablePam && cfg.unixSettings ? home_mount_prefix + ) cfg.unixSettings.home_mount_prefix; AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ]; diff --git a/nixos/modules/services/security/pocket-id.nix b/nixos/modules/services/security/pocket-id.nix index c3a93869dd1e..c74707629b9e 100644 --- a/nixos/modules/services/security/pocket-id.nix +++ b/nixos/modules/services/security/pocket-id.nix @@ -122,25 +122,26 @@ in warnings = optional (cfg.settings ? MAXMIND_LICENSE_KEY) "config.services.pocket-id.settings.MAXMIND_LICENSE_KEY will be stored as plaintext in the Nix store. Use config.services.pocket-id.environmentFile instead." - ++ concatMap - ( - # Added 2025-05-27 - setting: - optional (cfg.settings ? "${setting}") '' - config.services.pocket-id.settings.${setting} is deprecated. - See https://pocket-id.org/docs/setup/migrate-to-v1/ for migration instructions. - '' - ) - [ - "PUBLIC_APP_URL" - "PUBLIC_UI_CONFIG_DISABLED" - "CADDY_DISABLED" - "CADDY_PORT" - "BACKEND_PORT" - "POSTGRES_CONNECTION_STRING" - "SQLITE_DB_PATH" - "INTERNAL_BACKEND_URL" - ]; + ++ + concatMap + ( + # Added 2025-05-27 + setting: + optional (cfg.settings ? "${setting}") '' + config.services.pocket-id.settings.${setting} is deprecated. + See https://pocket-id.org/docs/setup/migrate-to-v1/ for migration instructions. + '' + ) + [ + "PUBLIC_APP_URL" + "PUBLIC_UI_CONFIG_DISABLED" + "CADDY_DISABLED" + "CADDY_PORT" + "BACKEND_PORT" + "POSTGRES_CONNECTION_STRING" + "SQLITE_DB_PATH" + "INTERNAL_BACKEND_URL" + ]; systemd.tmpfiles.rules = [ "d ${cfg.dataDir} 0755 ${cfg.user} ${cfg.group}" diff --git a/nixos/modules/services/security/tor.nix b/nixos/modules/services/security/tor.nix index cc3f0f36e1b8..3d5c817532e5 100644 --- a/nixos/modules/services/security/tor.nix +++ b/nixos/modules/services/security/tor.nix @@ -107,23 +107,22 @@ let (submodule ( { config, ... }: { - options = - { - addr = optionAddress; - port = optionPort; - flags = optionFlags; - SessionGroup = lib.mkOption { - type = nullOr int; - default = null; - }; + options = { + addr = optionAddress; + port = optionPort; + flags = optionFlags; + SessionGroup = lib.mkOption { + type = nullOr int; + default = null; + }; + } + // lib.genAttrs isolateFlags ( + name: + lib.mkOption { + type = types.bool; + default = false; } - // lib.genAttrs isolateFlags ( - name: - lib.mkOption { - type = types.bool; - default = false; - } - ); + ); config = { flags = lib.filter (name: config.${name} == true) isolateFlags @@ -167,7 +166,8 @@ let "UseIPv4Cache" "UseIPv6Cache" "WorldWritable" - ] ++ isolateFlags; + ] + ++ isolateFlags; in with lib.types; oneOf [ @@ -175,24 +175,23 @@ let (submodule ( { config, ... }: { - options = - { - unix = optionUnix; - addr = optionAddress; - port = optionPort; - flags = optionFlags; - SessionGroup = lib.mkOption { - type = nullOr int; - default = null; - }; + options = { + unix = optionUnix; + addr = optionAddress; + port = optionPort; + flags = optionFlags; + SessionGroup = lib.mkOption { + type = nullOr int; + default = null; + }; + } + // lib.genAttrs flags ( + name: + lib.mkOption { + type = types.bool; + default = false; } - // lib.genAttrs flags ( - name: - lib.mkOption { - type = types.bool; - default = false; - } - ); + ); config = lib.mkIf doConfig { # Only add flags in SOCKSPort to avoid duplicates flags = @@ -230,19 +229,18 @@ let ]; in { - options = - { - addr = optionAddress; - port = optionPort; - flags = optionFlags; + options = { + addr = optionAddress; + port = optionPort; + flags = optionFlags; + } + // lib.genAttrs flags ( + name: + lib.mkOption { + type = types.bool; + default = false; } - // lib.genAttrs flags ( - name: - lib.mkOption { - type = types.bool; - default = false; - } - ); + ); config = { flags = lib.filter (name: config.${name} == true) flags; }; @@ -913,20 +911,19 @@ in ]; in { - options = - { - unix = optionUnix; - flags = optionFlags; - addr = optionAddress; - port = optionPort; + options = { + unix = optionUnix; + flags = optionFlags; + addr = optionAddress; + port = optionPort; + } + // lib.genAttrs flags ( + name: + lib.mkOption { + type = types.bool; + default = false; } - // lib.genAttrs flags ( - name: - lib.mkOption { - type = types.bool; - default = false; - } - ); + ); config = { flags = lib.filter (name: config.${name} == true) flags; }; @@ -1398,16 +1395,15 @@ in ]; RuntimeDirectoryMode = "0710"; StateDirectoryMode = "0700"; - StateDirectory = - [ - "tor" - "tor/onion" - ] - ++ lib.flatten ( - lib.mapAttrsToList ( - name: onion: lib.optional (onion.secretKey == null) "tor/onion/${name}" - ) cfg.relay.onionServices - ); + StateDirectory = [ + "tor" + "tor/onion" + ] + ++ lib.flatten ( + lib.mapAttrsToList ( + name: onion: lib.optional (onion.secretKey == null) "tor/onion/${name}" + ) cfg.relay.onionServices + ); # The following options are only to optimize: # systemd-analyze security tor RootDirectory = runDir + "/root"; @@ -1415,15 +1411,14 @@ in #InaccessiblePaths = [ "-+${runDir}/root" ]; UMask = "0066"; BindPaths = [ stateDir ]; - BindReadOnlyPaths = - [ - builtins.storeDir - "/etc" - ] - ++ lib.optionals config.services.resolved.enable [ - "/run/systemd/resolve/stub-resolv.conf" - "/run/systemd/resolve/resolv.conf" - ]; + BindReadOnlyPaths = [ + builtins.storeDir + "/etc" + ] + ++ lib.optionals config.services.resolved.enable [ + "/run/systemd/resolve/stub-resolv.conf" + "/run/systemd/resolve/resolv.conf" + ]; AmbientCapabilities = [ "" ] ++ lib.optional bindsPrivilegedPort "CAP_NET_BIND_SERVICE"; CapabilityBoundingSet = [ "" ] ++ lib.optional bindsPrivilegedPort "CAP_NET_BIND_SERVICE"; # ProtectClock= adds DeviceAllow=char-rtc r diff --git a/nixos/modules/services/security/vault.nix b/nixos/modules/services/security/vault.nix index f3a7eddebaf1..6ba732300579 100644 --- a/nixos/modules/services/security/vault.nix +++ b/nixos/modules/services/security/vault.nix @@ -224,11 +224,10 @@ in description = "Vault server daemon"; wantedBy = [ "multi-user.target" ]; - after = - [ - "network.target" - ] - ++ lib.optional (config.services.consul.enable && cfg.storageBackend == "consul") "consul.service"; + after = [ + "network.target" + ] + ++ lib.optional (config.services.consul.enable && cfg.storageBackend == "consul") "consul.service"; restartIfChanged = false; # do not restart on "nixos-rebuild switch". It would seal the storage and disrupt the clients. diff --git a/nixos/modules/services/security/vaultwarden/default.nix b/nixos/modules/services/security/vaultwarden/default.nix index 613b81b297d2..1f386951286b 100644 --- a/nixos/modules/services/security/vaultwarden/default.nix +++ b/nixos/modules/services/security/vaultwarden/default.nix @@ -263,13 +263,12 @@ in inherit StateDirectory; StateDirectoryMode = "0700"; SystemCallArchitectures = "native"; - SystemCallFilter = - [ - "@system-service" - ] - ++ lib.optionals (!useSendmail) [ - "~@privileged" - ]; + SystemCallFilter = [ + "@system-service" + ] + ++ lib.optionals (!useSendmail) [ + "~@privileged" + ]; Restart = "always"; UMask = "0077"; }; diff --git a/nixos/modules/services/system/cachix-watch-store.nix b/nixos/modules/services/system/cachix-watch-store.nix index 32fc5eec3964..28de56d20fb4 100644 --- a/nixos/modules/services/system/cachix-watch-store.nix +++ b/nixos/modules/services/system/cachix-watch-store.nix @@ -83,27 +83,29 @@ in DynamicUser = true; LoadCredential = [ "cachix-token:${toString cfg.cachixTokenFile}" - ] ++ lib.optional (cfg.signingKeyFile != null) "signing-key:${toString cfg.signingKeyFile}"; + ] + ++ lib.optional (cfg.signingKeyFile != null) "signing-key:${toString cfg.signingKeyFile}"; }; script = let - command = - [ "${cfg.package}/bin/cachix" ] - ++ (lib.optional cfg.verbose "--verbose") - ++ (lib.optionals (cfg.host != null) [ - "--host" - cfg.host - ]) - ++ [ "watch-store" ] - ++ (lib.optionals (cfg.compressionLevel != null) [ - "--compression-level" - (toString cfg.compressionLevel) - ]) - ++ (lib.optionals (cfg.jobs != null) [ - "--jobs" - (toString cfg.jobs) - ]) - ++ [ cfg.cacheName ]; + command = [ + "${cfg.package}/bin/cachix" + ] + ++ (lib.optional cfg.verbose "--verbose") + ++ (lib.optionals (cfg.host != null) [ + "--host" + cfg.host + ]) + ++ [ "watch-store" ] + ++ (lib.optionals (cfg.compressionLevel != null) [ + "--compression-level" + (toString cfg.compressionLevel) + ]) + ++ (lib.optionals (cfg.jobs != null) [ + "--jobs" + (toString cfg.jobs) + ]) + ++ [ cfg.cacheName ]; in '' export CACHIX_AUTH_TOKEN="$(<"$CREDENTIALS_DIRECTORY/cachix-token")" diff --git a/nixos/modules/services/system/nix-daemon.nix b/nixos/modules/services/system/nix-daemon.nix index 8a8b746e5544..2c4769da5764 100644 --- a/nixos/modules/services/system/nix-daemon.nix +++ b/nixos/modules/services/system/nix-daemon.nix @@ -191,7 +191,8 @@ in environment.systemPackages = [ nixPackage pkgs.nix-info - ] ++ lib.optional (config.programs.bash.completion.enable) pkgs.nix-bash-completions; + ] + ++ lib.optional (config.programs.bash.completion.enable) pkgs.nix-bash-completions; systemd.packages = [ nixPackage ]; @@ -213,7 +214,8 @@ in nixPackage pkgs.util-linux config.programs.ssh.package - ] ++ lib.optionals cfg.distributedBuilds [ pkgs.gzip ]; + ] + ++ lib.optionals cfg.distributedBuilds [ pkgs.gzip ]; environment = cfg.envVars diff --git a/nixos/modules/services/torrent/bitmagnet.nix b/nixos/modules/services/torrent/bitmagnet.nix index 9387a6360392..13369dab1f79 100644 --- a/nixos/modules/services/torrent/bitmagnet.nix +++ b/nixos/modules/services/torrent/bitmagnet.nix @@ -127,7 +127,8 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" - ] ++ optional cfg.useLocalPostgresDB "postgresql.target"; + ] + ++ optional cfg.useLocalPostgresDB "postgresql.target"; requires = optional cfg.useLocalPostgresDB "postgresql.target"; serviceConfig = { Type = "simple"; diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index adf4a5a24680..8454910654bf 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -339,20 +339,19 @@ in # when /home/foo is not owned by cfg.user. # Note also that using an ExecStartPre= wouldn't work either # because BindPaths= needs these directories before. - system.activationScripts.transmission-daemon = - '' - install -d -m 700 -o '${cfg.user}' -g '${cfg.group}' '${cfg.home}/${settingsDir}' - '' - + optionalString (cfg.downloadDirPermissions != null) '' - install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.download-dir}' + system.activationScripts.transmission-daemon = '' + install -d -m 700 -o '${cfg.user}' -g '${cfg.group}' '${cfg.home}/${settingsDir}' + '' + + optionalString (cfg.downloadDirPermissions != null) '' + install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.download-dir}' - ${optionalString cfg.settings.incomplete-dir-enabled '' - install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.incomplete-dir}' - ''} - ${optionalString cfg.settings.watch-dir-enabled '' - install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.watch-dir}' - ''} - ''; + ${optionalString cfg.settings.incomplete-dir-enabled '' + install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.incomplete-dir}' + ''} + ${optionalString cfg.settings.watch-dir-enabled '' + install -d -m '${cfg.downloadDirPermissions}' -o '${cfg.user}' -g '${cfg.group}' '${cfg.settings.watch-dir}' + ''} + ''; systemd.services.transmission = { description = "Transmission BitTorrent Service"; @@ -401,31 +400,29 @@ in RootDirectory = rootDir; RootDirectoryStartOnly = true; MountAPIVFS = true; - BindPaths = - [ - "${cfg.home}/${settingsDir}" - cfg.settings.download-dir - # Transmission may need to read in the host's /run (eg. /run/systemd/resolve) - # or write in its private /run (eg. /run/host). - "/run" - ] - ++ optional cfg.settings.incomplete-dir-enabled cfg.settings.incomplete-dir - ++ optional ( - cfg.settings.watch-dir-enabled && cfg.settings.trash-original-torrent-files - ) cfg.settings.watch-dir; - BindReadOnlyPaths = - [ - # No confinement done of /nix/store here like in systemd-confinement.nix, - # an AppArmor profile is provided to get a confinement based upon paths and rights. - builtins.storeDir - "/etc" - ] - ++ optional ( - cfg.settings.script-torrent-done-enabled && cfg.settings.script-torrent-done-filename != null - ) cfg.settings.script-torrent-done-filename - ++ optional ( - cfg.settings.watch-dir-enabled && !cfg.settings.trash-original-torrent-files - ) cfg.settings.watch-dir; + BindPaths = [ + "${cfg.home}/${settingsDir}" + cfg.settings.download-dir + # Transmission may need to read in the host's /run (eg. /run/systemd/resolve) + # or write in its private /run (eg. /run/host). + "/run" + ] + ++ optional cfg.settings.incomplete-dir-enabled cfg.settings.incomplete-dir + ++ optional ( + cfg.settings.watch-dir-enabled && cfg.settings.trash-original-torrent-files + ) cfg.settings.watch-dir; + BindReadOnlyPaths = [ + # No confinement done of /nix/store here like in systemd-confinement.nix, + # an AppArmor profile is provided to get a confinement based upon paths and rights. + builtins.storeDir + "/etc" + ] + ++ optional ( + cfg.settings.script-torrent-done-enabled && cfg.settings.script-torrent-done-filename != null + ) cfg.settings.script-torrent-done-filename + ++ optional ( + cfg.settings.watch-dir-enabled && !cfg.settings.trash-original-torrent-files + ) cfg.settings.watch-dir; StateDirectory = [ "transmission" "transmission/${settingsDir}" diff --git a/nixos/modules/services/ttys/getty.nix b/nixos/modules/services/ttys/getty.nix index c6093034cf75..709bbff233d6 100644 --- a/nixos/modules/services/ttys/getty.nix +++ b/nixos/modules/services/ttys/getty.nix @@ -10,20 +10,19 @@ with lib; let cfg = config.services.getty; - baseArgs = - [ - "--login-program" - "${cfg.loginProgram}" - ] - ++ optionals (cfg.autologinUser != null && !cfg.autologinOnce) [ - "--autologin" - cfg.autologinUser - ] - ++ optionals (cfg.loginOptions != null) [ - "--login-options" - cfg.loginOptions - ] - ++ cfg.extraArgs; + baseArgs = [ + "--login-program" + "${cfg.loginProgram}" + ] + ++ optionals (cfg.autologinUser != null && !cfg.autologinOnce) [ + "--autologin" + cfg.autologinUser + ] + ++ optionals (cfg.loginOptions != null) [ + "--login-options" + cfg.loginOptions + ] + ++ cfg.extraArgs; gettyCmd = args: "${lib.getExe' pkgs.util-linux "agetty"} ${escapeShellArgs baseArgs} ${args}"; diff --git a/nixos/modules/services/video/epgstation/default.nix b/nixos/modules/services/video/epgstation/default.nix index 99190297eb75..4786cbab62d5 100644 --- a/nixos/modules/services/video/epgstation/default.nix +++ b/nixos/modules/services/video/epgstation/default.nix @@ -378,10 +378,11 @@ in inherit description; wantedBy = [ "multi-user.target" ]; - after = - [ "network.target" ] - ++ lib.optional config.services.mirakurun.enable "mirakurun.service" - ++ lib.optional config.services.mysql.enable "mysql.service"; + after = [ + "network.target" + ] + ++ lib.optional config.services.mirakurun.enable "mirakurun.service" + ++ lib.optional config.services.mysql.enable "mysql.service"; environment.NODE_ENV = "production"; diff --git a/nixos/modules/services/video/frigate.nix b/nixos/modules/services/video/frigate.nix index 7bc277f89b20..f82fb0549ce9 100644 --- a/nixos/modules/services/video/frigate.nix +++ b/nixos/modules/services/video/frigate.nix @@ -294,51 +294,45 @@ in ''; }; "/vod/" = { - extraConfig = - nginxAuthRequest - + '' - aio threads; - vod hls; + extraConfig = nginxAuthRequest + '' + aio threads; + vod hls; - secure_token $args; - secure_token_types application/vnd.apple.mpegurl; + secure_token $args; + secure_token_types application/vnd.apple.mpegurl; - add_header Cache-Control "no-store"; - expires off; + add_header Cache-Control "no-store"; + expires off; - keepalive_disable safari; - ''; + keepalive_disable safari; + ''; }; "/stream/" = { alias = "/var/cache/frigate/stream/"; - extraConfig = - nginxAuthRequest - + '' - add_header Cache-Control "no-store"; - expires off; + extraConfig = nginxAuthRequest + '' + add_header Cache-Control "no-store"; + expires off; - types { - application/dash+xml mpd; - application/vnd.apple.mpegurl m3u8; - video/mp2t ts; - image/jpeg jpg; - } - ''; + types { + application/dash+xml mpd; + application/vnd.apple.mpegurl m3u8; + video/mp2t ts; + image/jpeg jpg; + } + ''; }; "/clips/" = { root = "/var/lib/frigate"; - extraConfig = - nginxAuthRequest - + '' - types { - video/mp4 mp4; - image/jpeg jpg; - } + extraConfig = nginxAuthRequest + '' + types { + video/mp4 mp4; + image/jpeg jpg; + } - expires 7d; - add_header Cache-Control "public"; - autoindex on; - ''; + expires 7d; + add_header Cache-Control "public"; + autoindex on; + ''; }; "/cache/" = { alias = "/var/cache/frigate/"; @@ -348,29 +342,25 @@ in }; "/recordings/" = { root = "/var/lib/frigate"; - extraConfig = - nginxAuthRequest - + '' - types { - video/mp4 mp4; - } + extraConfig = nginxAuthRequest + '' + types { + video/mp4 mp4; + } - autoindex on; - autoindex_format json; - ''; + autoindex on; + autoindex_format json; + ''; }; "/exports/" = { root = "/var/lib/frigate"; - extraConfig = - nginxAuthRequest - + '' - types { - video/mp4 mp4; - } + extraConfig = nginxAuthRequest + '' + types { + video/mp4 mp4; + } - autoindex on; - autoindex_format json; - ''; + autoindex on; + autoindex_format json; + ''; }; "/ws" = { proxyPass = "http://frigate-mqtt-ws/"; @@ -613,18 +603,17 @@ in wantedBy = [ "multi-user.target" ]; - environment = - { - CONFIG_FILE = "/run/frigate/frigate.yml"; - HOME = "/var/lib/frigate"; - PYTHONPATH = cfg.package.pythonPath; - } - // optionalAttrs (cfg.vaapiDriver != null) { - LIBVA_DRIVER_NAME = cfg.vaapiDriver; - } - // optionalAttrs withCoral { - LD_LIBRARY_PATH = makeLibraryPath (with pkgs; [ libedgetpu ]); - }; + environment = { + CONFIG_FILE = "/run/frigate/frigate.yml"; + HOME = "/var/lib/frigate"; + PYTHONPATH = cfg.package.pythonPath; + } + // optionalAttrs (cfg.vaapiDriver != null) { + LIBVA_DRIVER_NAME = cfg.vaapiDriver; + } + // optionalAttrs withCoral { + LD_LIBRARY_PATH = makeLibraryPath (with pkgs; [ libedgetpu ]); + }; path = with pkgs; [ diff --git a/nixos/modules/services/video/mirakurun.nix b/nixos/modules/services/video/mirakurun.nix index b1446422b988..72cf76ee76f8 100644 --- a/nixos/modules/services/video/mirakurun.nix +++ b/nixos/modules/services/video/mirakurun.nix @@ -204,12 +204,11 @@ in restartTriggers = let getconf = target: config.environment.etc."mirakurun/${target}.yml".source; - targets = - [ - "server" - ] - ++ optional (cfg.tunerSettings != null) "tuners" - ++ optional (cfg.channelSettings != null) "channels"; + targets = [ + "server" + ] + ++ optional (cfg.tunerSettings != null) "tuners" + ++ optional (cfg.channelSettings != null) "channels"; in (map getconf targets); }; diff --git a/nixos/modules/services/video/ustreamer.nix b/nixos/modules/services/video/ustreamer.nix index d32818fa3ab3..30d605a19a65 100644 --- a/nixos/modules/services/video/ustreamer.nix +++ b/nixos/modules/services/video/ustreamer.nix @@ -65,13 +65,12 @@ in }; config = mkIf cfg.enable { - services.ustreamer.extraArgs = - [ - "--device=${cfg.device}" - ] - ++ optionals (!cfg.autoStart) [ - "--exit-on-no-clients=300" - ]; + services.ustreamer.extraArgs = [ + "--device=${cfg.device}" + ] + ++ optionals (!cfg.autoStart) [ + "--exit-on-no-clients=300" + ]; systemd.services."ustreamer" = { description = "µStreamer, a lightweight MJPEG-HTTP streamer"; diff --git a/nixos/modules/services/video/v4l2-relayd.nix b/nixos/modules/services/video/v4l2-relayd.nix index 0b2c94ad9eea..bcf8725c845b 100644 --- a/nixos/modules/services/video/v4l2-relayd.nix +++ b/nixos/modules/services/video/v4l2-relayd.nix @@ -179,16 +179,15 @@ in "framerate=${toString instance.input.framerate}/1" ]; - outputPipeline = - [ - "appsrc name=appsrc ${appsrcOptions}" - "videoconvert" - ] - ++ optionals (instance.input.format != instance.output.format) [ - "video/x-raw,format=${instance.output.format}" - "queue" - ] - ++ [ "v4l2sink name=v4l2sink device=$(cat $V4L2_DEVICE_FILE)" ]; + outputPipeline = [ + "appsrc name=appsrc ${appsrcOptions}" + "videoconvert" + ] + ++ optionals (instance.input.format != instance.output.format) [ + "video/x-raw,format=${instance.output.format}" + "queue" + ] + ++ [ "v4l2sink name=v4l2sink device=$(cat $V4L2_DEVICE_FILE)" ]; in '' exec ${pkgs.v4l2-relayd}/bin/v4l2-relayd -i "${instance.input.pipeline}" -o "${concatStringsSep " ! " outputPipeline}" diff --git a/nixos/modules/services/video/wivrn.nix b/nixos/modules/services/video/wivrn.nix index f2b986720c87..0623a4ed2cca 100644 --- a/nixos/modules/services/video/wivrn.nix +++ b/nixos/modules/services/video/wivrn.nix @@ -188,7 +188,8 @@ in XRT_COMPOSITOR_LOG = "debug"; XRT_PRINT_OPTIONS = "on"; IPC_EXIT_ON_DISCONNECT = "off"; - } // cfg.monadoEnvironment; + } + // cfg.monadoEnvironment; serviceConfig = { ExecStart = serverExec; # Hardening options diff --git a/nixos/modules/services/web-apps/agorakit.nix b/nixos/modules/services/web-apps/agorakit.nix index 7ee53222dc4f..84bda144718f 100644 --- a/nixos/modules/services/web-apps/agorakit.nix +++ b/nixos/modules/services/web-apps/agorakit.nix @@ -352,7 +352,8 @@ in "listen.mode" = "0660"; "listen.owner" = user; "listen.group" = group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; services.nginx = { diff --git a/nixos/modules/services/web-apps/anuko-time-tracker.nix b/nixos/modules/services/web-apps/anuko-time-tracker.nix index 19099a3bc7e1..f626cb8cb489 100644 --- a/nixos/modules/services/web-apps/anuko-time-tracker.nix +++ b/nixos/modules/services/web-apps/anuko-time-tracker.nix @@ -322,7 +322,8 @@ in settings = { "listen.owner" = config.services.nginx.user; "listen.group" = config.services.nginx.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; }; diff --git a/nixos/modules/services/web-apps/artalk.nix b/nixos/modules/services/web-apps/artalk.nix index d3d06f1521b6..34ae4d2e3a77 100644 --- a/nixos/modules/services/web-apps/artalk.nix +++ b/nixos/modules/services/web-apps/artalk.nix @@ -93,26 +93,25 @@ in systemd.services.artalk = { after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - preStart = - '' - umask 0077 - ${utils.genJqSecretsReplacementSnippet cfg.settings "/run/artalk/new"} - '' - + ( - if cfg.allowModify then - '' - [ -e "${cfg.configFile}" ] || ${lib.getExe cfg.package} gen config "${cfg.configFile}" - cat "${cfg.configFile}" | ${lib.getExe pkgs.yj} > "/run/artalk/old" - ${lib.getExe pkgs.jq} -s '.[0] * .[1]' "/run/artalk/old" "/run/artalk/new" > "/run/artalk/result" - cat "/run/artalk/result" | ${lib.getExe pkgs.yj} -r > "${cfg.configFile}" - rm /run/artalk/{old,new,result} - '' - else - '' - cat /run/artalk/new | ${lib.getExe pkgs.yj} -r > "${cfg.configFile}" - rm /run/artalk/new - '' - ); + preStart = '' + umask 0077 + ${utils.genJqSecretsReplacementSnippet cfg.settings "/run/artalk/new"} + '' + + ( + if cfg.allowModify then + '' + [ -e "${cfg.configFile}" ] || ${lib.getExe cfg.package} gen config "${cfg.configFile}" + cat "${cfg.configFile}" | ${lib.getExe pkgs.yj} > "/run/artalk/old" + ${lib.getExe pkgs.jq} -s '.[0] * .[1]' "/run/artalk/old" "/run/artalk/new" > "/run/artalk/result" + cat "/run/artalk/result" | ${lib.getExe pkgs.yj} -r > "${cfg.configFile}" + rm /run/artalk/{old,new,result} + '' + else + '' + cat /run/artalk/new | ${lib.getExe pkgs.yj} -r > "${cfg.configFile}" + rm /run/artalk/new + '' + ); serviceConfig = { User = cfg.user; Group = cfg.group; diff --git a/nixos/modules/services/web-apps/bookstack.nix b/nixos/modules/services/web-apps/bookstack.nix index 365088decd4e..a3ed9a96b970 100644 --- a/nixos/modules/services/web-apps/bookstack.nix +++ b/nixos/modules/services/web-apps/bookstack.nix @@ -387,7 +387,8 @@ in "pm.min_spare_servers" = lib.mkDefault 2; "pm.max_spare_servers" = lib.mkDefault 4; "pm.max_requests" = lib.mkDefault 500; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; services.nginx = lib.mkIf (cfg.nginx != null) { @@ -432,7 +433,8 @@ in serviceConfig = { ExecStart = bookstack-maintenance; RemainAfterExit = true; - } // commonServiceConfig; + } + // commonServiceConfig; unitConfig.JoinsNamespaceOf = "phpfpm-bookstack.service"; restartTriggers = [ cfg.package ]; partOf = [ "phpfpm-bookstack.service" ]; diff --git a/nixos/modules/services/web-apps/calibre-web.nix b/nixos/modules/services/web-apps/calibre-web.nix index b9ece6c995af..0950dc02373d 100644 --- a/nixos/modules/services/web-apps/calibre-web.nix +++ b/nixos/modules/services/web-apps/calibre-web.nix @@ -160,29 +160,28 @@ in after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - serviceConfig = - { - Type = "simple"; - User = cfg.user; - Group = cfg.group; + serviceConfig = { + Type = "simple"; + User = cfg.user; + Group = cfg.group; - ExecStartPre = pkgs.writeShellScript "calibre-web-pre-start" ( - '' - __RUN_MIGRATIONS_AND_EXIT=1 ${calibreWebCmd} + ExecStartPre = pkgs.writeShellScript "calibre-web-pre-start" ( + '' + __RUN_MIGRATIONS_AND_EXIT=1 ${calibreWebCmd} - ${pkgs.sqlite}/bin/sqlite3 ${appDb} "update settings set ${settings}" - '' - + optionalString (cfg.options.calibreLibrary != null) '' - test -f "${cfg.options.calibreLibrary}/metadata.db" || { echo "Invalid Calibre library"; exit 1; } - '' - ); + ${pkgs.sqlite}/bin/sqlite3 ${appDb} "update settings set ${settings}" + '' + + optionalString (cfg.options.calibreLibrary != null) '' + test -f "${cfg.options.calibreLibrary}/metadata.db" || { echo "Invalid Calibre library"; exit 1; } + '' + ); - ExecStart = "${calibreWebCmd} -i ${cfg.listen.ip}"; - Restart = "on-failure"; - } - // lib.optionalAttrs (!(lib.hasPrefix "/" cfg.dataDir)) { - StateDirectory = cfg.dataDir; - }; + ExecStart = "${calibreWebCmd} -i ${cfg.listen.ip}"; + Restart = "on-failure"; + } + // lib.optionalAttrs (!(lib.hasPrefix "/" cfg.dataDir)) { + StateDirectory = cfg.dataDir; + }; }; networking.firewall = mkIf cfg.openFirewall { diff --git a/nixos/modules/services/web-apps/castopod.nix b/nixos/modules/services/web-apps/castopod.nix index 018dafd07bda..1c428cead548 100644 --- a/nixos/modules/services/web-apps/castopod.nix +++ b/nixos/modules/services/web-apps/castopod.nix @@ -204,7 +204,8 @@ in settings = { "listen.owner" = config.services.nginx.user; "listen.group" = config.services.nginx.group; - } // cfg.poolSettings; + } + // cfg.poolSettings; }; systemd.services.castopod-setup = { diff --git a/nixos/modules/services/web-apps/changedetection-io.nix b/nixos/modules/services/web-apps/changedetection-io.nix index ff710d55d40c..5104c4384e1d 100644 --- a/nixos/modules/services/web-apps/changedetection-io.nix +++ b/nixos/modules/services/web-apps/changedetection-io.nix @@ -142,12 +142,13 @@ in StateDirectory = mkIf defaultStateDir "changedetection-io"; StateDirectoryMode = mkIf defaultStateDir "0750"; WorkingDirectory = cfg.datastorePath; - Environment = - [ "HIDE_REFERER=true" ] - ++ lib.optional (cfg.baseURL != null) "BASE_URL=${cfg.baseURL}" - ++ lib.optional cfg.behindProxy "USE_X_SETTINGS=1" - ++ lib.optional cfg.webDriverSupport "WEBDRIVER_URL=http://127.0.0.1:${toString cfg.chromePort}/wd/hub" - ++ lib.optional cfg.playwrightSupport "PLAYWRIGHT_DRIVER_URL=ws://127.0.0.1:${toString cfg.chromePort}/?stealth=1&--disable-web-security=true"; + Environment = [ + "HIDE_REFERER=true" + ] + ++ lib.optional (cfg.baseURL != null) "BASE_URL=${cfg.baseURL}" + ++ lib.optional cfg.behindProxy "USE_X_SETTINGS=1" + ++ lib.optional cfg.webDriverSupport "WEBDRIVER_URL=http://127.0.0.1:${toString cfg.chromePort}/wd/hub" + ++ lib.optional cfg.playwrightSupport "PLAYWRIGHT_DRIVER_URL=ws://127.0.0.1:${toString cfg.chromePort}/?stealth=1&--disable-web-security=true"; EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile; ExecStart = '' ${pkgs.changedetection-io}/bin/changedetection.py \ diff --git a/nixos/modules/services/web-apps/cloudlog.nix b/nixos/modules/services/web-apps/cloudlog.nix index ebf733c1c6d5..bec59aa779e1 100644 --- a/nixos/modules/services/web-apps/cloudlog.nix +++ b/nixos/modules/services/web-apps/cloudlog.nix @@ -324,7 +324,8 @@ in settings = { "listen.owner" = config.services.nginx.user; "listen.group" = config.services.nginx.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; }; diff --git a/nixos/modules/services/web-apps/code-server.nix b/nixos/modules/services/web-apps/code-server.nix index 3ec119d76b0a..1f8defce5e22 100644 --- a/nixos/modules/services/web-apps/code-server.nix +++ b/nixos/modules/services/web-apps/code-server.nix @@ -221,39 +221,39 @@ in path = cfg.extraPackages; environment = { HASHED_PASSWORD = cfg.hashedPassword; - } // cfg.extraEnvironment; + } + // cfg.extraEnvironment; serviceConfig = { - ExecStart = - '' - ${lib.getExe cfg.package} \ - --auth=${cfg.auth} \ - --bind-addr=${cfg.host}:${toString cfg.port} \ - '' - + lib.optionalString (cfg.socket != null) '' - --socket=${cfg.socket} \ - '' - + lib.optionalString (cfg.userDataDir != null) '' - --user-data-dir=${cfg.userDataDir} \ - '' - + lib.optionalString (cfg.extensionsDir != null) '' - --extensions-dir=${cfg.extensionsDir} \ - '' - + lib.optionalString (cfg.disableTelemetry == true) '' - --disable-telemetry \ - '' - + lib.optionalString (cfg.disableUpdateCheck == true) '' - --disable-update-check \ - '' - + lib.optionalString (cfg.disableFileDownloads == true) '' - --disable-file-downloads \ - '' - + lib.optionalString (cfg.disableWorkspaceTrust == true) '' - --disable-workspace-trust \ - '' - + lib.optionalString (cfg.disableGettingStartedOverride == true) '' - --disable-getting-started-override \ - '' - + lib.escapeShellArgs cfg.extraArguments; + ExecStart = '' + ${lib.getExe cfg.package} \ + --auth=${cfg.auth} \ + --bind-addr=${cfg.host}:${toString cfg.port} \ + '' + + lib.optionalString (cfg.socket != null) '' + --socket=${cfg.socket} \ + '' + + lib.optionalString (cfg.userDataDir != null) '' + --user-data-dir=${cfg.userDataDir} \ + '' + + lib.optionalString (cfg.extensionsDir != null) '' + --extensions-dir=${cfg.extensionsDir} \ + '' + + lib.optionalString (cfg.disableTelemetry == true) '' + --disable-telemetry \ + '' + + lib.optionalString (cfg.disableUpdateCheck == true) '' + --disable-update-check \ + '' + + lib.optionalString (cfg.disableFileDownloads == true) '' + --disable-file-downloads \ + '' + + lib.optionalString (cfg.disableWorkspaceTrust == true) '' + --disable-workspace-trust \ + '' + + lib.optionalString (cfg.disableGettingStartedOverride == true) '' + --disable-getting-started-override \ + '' + + lib.escapeShellArgs cfg.extraArguments; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; RuntimeDirectory = cfg.user; User = cfg.user; diff --git a/nixos/modules/services/web-apps/commafeed.nix b/nixos/modules/services/web-apps/commafeed.nix index 354e3625bb99..15aad73a2585 100644 --- a/nixos/modules/services/web-apps/commafeed.nix +++ b/nixos/modules/services/web-apps/commafeed.nix @@ -106,7 +106,8 @@ in "~@privileged" ]; UMask = "0077"; - } // lib.optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = cfg.environmentFile; }; + } + // lib.optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = cfg.environmentFile; }; }; }; diff --git a/nixos/modules/services/web-apps/crabfit.nix b/nixos/modules/services/web-apps/crabfit.nix index d86708f03710..77275a6acdd9 100644 --- a/nixos/modules/services/web-apps/crabfit.nix +++ b/nixos/modules/services/web-apps/crabfit.nix @@ -121,7 +121,8 @@ in API_LISTEN = "127.0.0.1:${builtins.toString cfg.api.port}"; DATABASE_URL = "postgres:///crabfit?host=/run/postgresql"; FRONTEND_URL = "https://${cfg.frontend.host}"; - } // cfg.api.environment; + } + // cfg.api.environment; }; crabfit-frontend = { @@ -140,7 +141,8 @@ in environment = { NEXT_PUBLIC_API_URL = "https://${cfg.api.host}"; PORT = builtins.toString cfg.frontend.port; - } // cfg.frontend.environment; + } + // cfg.frontend.environment; }; }; diff --git a/nixos/modules/services/web-apps/davis.nix b/nixos/modules/services/web-apps/davis.nix index e75752d2e00e..e7cdf6a8277b 100644 --- a/nixos/modules/services/web-apps/davis.nix +++ b/nixos/modules/services/web-apps/davis.nix @@ -315,50 +315,49 @@ in message = "services.davis.mail.dsn and services.davis.mail.dsnFile cannot both be set."; } ]; - services.davis.config = - { - APP_ENV = "prod"; - APP_CACHE_DIR = "${cfg.dataDir}/var/cache"; - APP_LOG_DIR = "${cfg.dataDir}/var/log"; - LOG_FILE_PATH = "%kernel.logs_dir%/%kernel.environment%.log"; - DATABASE_DRIVER = db.driver; - INVITE_FROM_ADDRESS = mail.inviteFromAddress; - APP_SECRET._secret = cfg.appSecretFile; - ADMIN_LOGIN = cfg.adminLogin; - ADMIN_PASSWORD._secret = cfg.adminPasswordFile; - APP_TIMEZONE = config.time.timeZone; - WEBDAV_ENABLED = false; - CALDAV_ENABLED = true; - CARDDAV_ENABLED = true; - } - // ( - if mail.dsn != null then - { MAILER_DSN = mail.dsn; } - else if mail.dsnFile != null then - { MAILER_DSN._secret = mail.dsnFile; } - else - { } - ) - // ( - if db.createLocally then - { - DATABASE_URL = - if db.driver == "sqlite" then - "sqlite:///${cfg.dataDir}/davis.db" # note: sqlite needs 4 slashes for an absolute path - else if - pgsqlLocal - # note: davis expects a non-standard postgres uri (due to the underlying doctrine library) - # specifically the dummy hostname which is overridden by the host query parameter - then - "postgres://${user}@localhost/${db.name}?host=/run/postgresql" - else if mysqlLocal then - "mysql://${user}@localhost/${db.name}?socket=/run/mysqld/mysqld.sock" - else - null; - } - else - { DATABASE_URL._secret = db.urlFile; } - ); + services.davis.config = { + APP_ENV = "prod"; + APP_CACHE_DIR = "${cfg.dataDir}/var/cache"; + APP_LOG_DIR = "${cfg.dataDir}/var/log"; + LOG_FILE_PATH = "%kernel.logs_dir%/%kernel.environment%.log"; + DATABASE_DRIVER = db.driver; + INVITE_FROM_ADDRESS = mail.inviteFromAddress; + APP_SECRET._secret = cfg.appSecretFile; + ADMIN_LOGIN = cfg.adminLogin; + ADMIN_PASSWORD._secret = cfg.adminPasswordFile; + APP_TIMEZONE = config.time.timeZone; + WEBDAV_ENABLED = false; + CALDAV_ENABLED = true; + CARDDAV_ENABLED = true; + } + // ( + if mail.dsn != null then + { MAILER_DSN = mail.dsn; } + else if mail.dsnFile != null then + { MAILER_DSN._secret = mail.dsnFile; } + else + { } + ) + // ( + if db.createLocally then + { + DATABASE_URL = + if db.driver == "sqlite" then + "sqlite:///${cfg.dataDir}/davis.db" # note: sqlite needs 4 slashes for an absolute path + else if + pgsqlLocal + # note: davis expects a non-standard postgres uri (due to the underlying doctrine library) + # specifically the dummy hostname which is overridden by the host query parameter + then + "postgres://${user}@localhost/${db.name}?host=/run/postgresql" + else if mysqlLocal then + "mysql://${user}@localhost/${db.name}?socket=/run/mysqld/mysqld.sock" + else + null; + } + else + { DATABASE_URL._secret = db.urlFile; } + ); users = { users = lib.mkIf (user == "davis") { @@ -390,25 +389,24 @@ in APP_LOG_DIR = "${cfg.dataDir}/var/log"; }; phpPackage = lib.mkDefault cfg.package.passthru.php; - settings = - { - "listen.mode" = "0660"; - "pm" = "dynamic"; - "pm.max_children" = 256; - "pm.start_servers" = 10; - "pm.min_spare_servers" = 5; - "pm.max_spare_servers" = 20; - } - // ( - if cfg.nginx != null then - { - "listen.owner" = config.services.nginx.user; - "listen.group" = config.services.nginx.group; - } - else - { } - ) - // cfg.poolConfig; + settings = { + "listen.mode" = "0660"; + "pm" = "dynamic"; + "pm.max_children" = 256; + "pm.start_servers" = 10; + "pm.min_spare_servers" = 5; + "pm.max_spare_servers" = 20; + } + // ( + if cfg.nginx != null then + { + "listen.owner" = config.services.nginx.user; + "listen.group" = config.services.nginx.group; + } + else + { } + ) + // cfg.poolConfig; }; # Reading the user-provided secret files requires root access @@ -477,13 +475,12 @@ in "davis-env-setup.service" "davis-db-migrate.service" ]; - systemd.services.phpfpm-davis.requires = - [ - "davis-env-setup.service" - "davis-db-migrate.service" - ] - ++ lib.optional mysqlLocal "mysql.service" - ++ lib.optional pgsqlLocal "postgresql.target"; + systemd.services.phpfpm-davis.requires = [ + "davis-env-setup.service" + "davis-db-migrate.service" + ] + ++ lib.optional mysqlLocal "mysql.service" + ++ lib.optional pgsqlLocal "postgresql.target"; systemd.services.phpfpm-davis.serviceConfig.ReadWritePaths = [ cfg.dataDir ]; services.nginx = lib.mkIf (cfg.nginx != null) { diff --git a/nixos/modules/services/web-apps/dependency-track.nix b/nixos/modules/services/web-apps/dependency-track.nix index 224d4c1ea874..b19e3064c363 100644 --- a/nixos/modules/services/web-apps/dependency-track.nix +++ b/nixos/modules/services/web-apps/dependency-track.nix @@ -589,15 +589,18 @@ in # provide settings via env vars to allow overriding default settings. environment = { HOME = "%S/dependency-track"; - } // renderSettings cfg.settings; + } + // renderSettings cfg.settings; serviceConfig = { User = "dependency-track"; Group = "dependency-track"; DynamicUser = true; StateDirectory = "dependency-track"; - LoadCredential = - [ "db_password:${cfg.database.passwordFile}" ] - ++ lib.optional cfg.settings."alpine.ldap.enabled" + LoadCredential = [ + "db_password:${cfg.database.passwordFile}" + ] + ++ + lib.optional cfg.settings."alpine.ldap.enabled" "ldap_bind_password:${cfg.ldap.bindPasswordFile}"; }; script = '' diff --git a/nixos/modules/services/web-apps/dex.nix b/nixos/modules/services/web-apps/dex.nix index 38367f01e5d9..745d9bdb1fa8 100644 --- a/nixos/modules/services/web-apps/dex.nix +++ b/nixos/modules/services/web-apps/dex.nix @@ -100,68 +100,68 @@ in wantedBy = [ "multi-user.target" ]; after = [ "networking.target" - ] ++ (optional (cfg.settings.storage.type == "postgres") "postgresql.target"); + ] + ++ (optional (cfg.settings.storage.type == "postgres") "postgresql.target"); path = with pkgs; [ replace-secret ]; restartTriggers = restartTriggers; - serviceConfig = - { - ExecStart = "${cfg.package}/bin/dex serve /run/dex/config.yaml"; - ExecStartPre = [ - "${pkgs.coreutils}/bin/install -m 600 ${configFile} /run/dex/config.yaml" - "+${startPreScript}" - ]; + serviceConfig = { + ExecStart = "${cfg.package}/bin/dex serve /run/dex/config.yaml"; + ExecStartPre = [ + "${pkgs.coreutils}/bin/install -m 600 ${configFile} /run/dex/config.yaml" + "+${startPreScript}" + ]; - RuntimeDirectory = "dex"; - BindReadOnlyPaths = [ - "/nix/store" - "-/etc/dex" - "-/etc/hosts" - "-/etc/localtime" - "-/etc/nsswitch.conf" - "-/etc/resolv.conf" - "${config.security.pki.caBundle}:/etc/ssl/certs/ca-certificates.crt" - ]; - BindPaths = optional (cfg.settings.storage.type == "postgres") "/var/run/postgresql"; - # ProtectClock= adds DeviceAllow=char-rtc r - DeviceAllow = ""; - DynamicUser = true; - LockPersonality = true; - MemoryDenyWriteExecute = true; - NoNewPrivileges = true; - PrivateDevices = true; - PrivateMounts = true; - # Port needs to be exposed to the host network - #PrivateNetwork = true; - PrivateTmp = true; - PrivateUsers = true; - ProcSubset = "pid"; - ProtectClock = true; - ProtectHome = true; - ProtectHostname = true; - ProtectSystem = "strict"; - ProtectControlGroups = true; - ProtectKernelLogs = true; - ProtectKernelModules = true; - ProtectKernelTunables = true; - ProtectProc = "invisible"; - RestrictAddressFamilies = [ - "AF_INET" - "AF_INET6" - "AF_UNIX" - ]; - RestrictNamespaces = true; - RestrictRealtime = true; - RestrictSUIDSGID = true; - SystemCallArchitectures = "native"; - SystemCallFilter = [ - "@system-service" - "~@privileged @setuid @keyring" - ]; - UMask = "0066"; - } - // optionalAttrs (cfg.environmentFile != null) { - EnvironmentFile = cfg.environmentFile; - }; + RuntimeDirectory = "dex"; + BindReadOnlyPaths = [ + "/nix/store" + "-/etc/dex" + "-/etc/hosts" + "-/etc/localtime" + "-/etc/nsswitch.conf" + "-/etc/resolv.conf" + "${config.security.pki.caBundle}:/etc/ssl/certs/ca-certificates.crt" + ]; + BindPaths = optional (cfg.settings.storage.type == "postgres") "/var/run/postgresql"; + # ProtectClock= adds DeviceAllow=char-rtc r + DeviceAllow = ""; + DynamicUser = true; + LockPersonality = true; + MemoryDenyWriteExecute = true; + NoNewPrivileges = true; + PrivateDevices = true; + PrivateMounts = true; + # Port needs to be exposed to the host network + #PrivateNetwork = true; + PrivateTmp = true; + PrivateUsers = true; + ProcSubset = "pid"; + ProtectClock = true; + ProtectHome = true; + ProtectHostname = true; + ProtectSystem = "strict"; + ProtectControlGroups = true; + ProtectKernelLogs = true; + ProtectKernelModules = true; + ProtectKernelTunables = true; + ProtectProc = "invisible"; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + "AF_UNIX" + ]; + RestrictNamespaces = true; + RestrictRealtime = true; + RestrictSUIDSGID = true; + SystemCallArchitectures = "native"; + SystemCallFilter = [ + "@system-service" + "~@privileged @setuid @keyring" + ]; + UMask = "0066"; + } + // optionalAttrs (cfg.environmentFile != null) { + EnvironmentFile = cfg.environmentFile; + }; }; }; diff --git a/nixos/modules/services/web-apps/discourse.nix b/nixos/modules/services/web-apps/discourse.nix index ffb34abab7d1..27321686bf84 100644 --- a/nixos/modules/services/web-apps/discourse.nix +++ b/nixos/modules/services/web-apps/discourse.nix @@ -735,14 +735,13 @@ in "postgresql.target" "discourse-postgresql.target" ]; - bindsTo = - [ - "redis-discourse.service" - ] - ++ lib.optionals (cfg.database.host == null) [ - "postgresql.target" - "discourse-postgresql.target" - ]; + bindsTo = [ + "redis-discourse.service" + ] + ++ lib.optionals (cfg.database.host == null) [ + "postgresql.target" + "discourse-postgresql.target" + ]; path = cfg.package.runtimeDeps ++ [ postgresqlPackage pkgs.replace-secret @@ -899,14 +898,12 @@ in }: { proxyPass = "http://discourse"; - extraConfig = - extraConfig - + '' - proxy_set_header X-Request-Start "t=''${msec}"; - proxy_set_header X-Sendfile-Type ""; - proxy_set_header X-Accel-Mapping ""; - proxy_set_header Client-Ip ""; - ''; + extraConfig = extraConfig + '' + proxy_set_header X-Request-Start "t=''${msec}"; + proxy_set_header X-Sendfile-Type ""; + proxy_set_header X-Accel-Mapping ""; + proxy_set_header Client-Ip ""; + ''; }; cache = time: '' expires ${time}; @@ -930,11 +927,9 @@ in }; "~ ^/uploads/short-url/" = proxy { }; "~ ^/secure-media-uploads/" = proxy { }; - "~* (fonts|assets|plugins|uploads)/.*\\.(eot|ttf|woff|woff2|ico|otf)$".extraConfig = - cache_1y - + '' - add_header Access-Control-Allow-Origin *; - ''; + "~* (fonts|assets|plugins|uploads)/.*\\.(eot|ttf|woff|woff2|ico|otf)$".extraConfig = cache_1y + '' + add_header Access-Control-Allow-Origin *; + ''; "/srv/status" = proxy { extraConfig = '' access_log off; @@ -942,38 +937,34 @@ in ''; }; "~ ^/javascripts/".extraConfig = cache_1d; - "~ ^/assets/(?.+)$".extraConfig = - cache_1y - + '' - # asset pipeline enables this - brotli_static on; - gzip_static on; - ''; + "~ ^/assets/(?.+)$".extraConfig = cache_1y + '' + # asset pipeline enables this + brotli_static on; + gzip_static on; + ''; "~ ^/plugins/".extraConfig = cache_1y; "~ /images/emoji/".extraConfig = cache_1y; "~ ^/uploads/" = proxy { - extraConfig = - cache_1y - + '' - proxy_set_header X-Sendfile-Type X-Accel-Redirect; - proxy_set_header X-Accel-Mapping ${cfg.package}/share/discourse/public/=/downloads/; + extraConfig = cache_1y + '' + proxy_set_header X-Sendfile-Type X-Accel-Redirect; + proxy_set_header X-Accel-Mapping ${cfg.package}/share/discourse/public/=/downloads/; - # custom CSS - location ~ /stylesheet-cache/ { - try_files $uri =404; - } - # this allows us to bypass rails - location ~* \.(gif|png|jpg|jpeg|bmp|tif|tiff|ico|webp)$ { - try_files $uri =404; - } - # SVG needs an extra header attached - location ~* \.(svg)$ { - } - # thumbnails & optimized images - location ~ /_?optimized/ { - try_files $uri =404; - } - ''; + # custom CSS + location ~ /stylesheet-cache/ { + try_files $uri =404; + } + # this allows us to bypass rails + location ~* \.(gif|png|jpg|jpeg|bmp|tif|tiff|ico|webp)$ { + try_files $uri =404; + } + # SVG needs an extra header attached + location ~* \.(svg)$ { + } + # thumbnails & optimized images + location ~ /_?optimized/ { + try_files $uri =404; + } + ''; }; "~ ^/admin/backups/" = proxy { extraConfig = '' @@ -1127,16 +1118,15 @@ in }; }; - users.users = - { - discourse = { - group = "discourse"; - isSystemUser = true; - }; - } - // (lib.optionalAttrs cfg.nginx.enable { - ${config.services.nginx.user}.extraGroups = [ "discourse" ]; - }); + users.users = { + discourse = { + group = "discourse"; + isSystemUser = true; + }; + } + // (lib.optionalAttrs cfg.nginx.enable { + ${config.services.nginx.user}.extraGroups = [ "discourse" ]; + }); users.groups = { discourse = { }; diff --git a/nixos/modules/services/web-apps/dokuwiki.nix b/nixos/modules/services/web-apps/dokuwiki.nix index 838e2812fb54..68cbdc851f46 100644 --- a/nixos/modules/services/web-apps/dokuwiki.nix +++ b/nixos/modules/services/web-apps/dokuwiki.nix @@ -494,7 +494,8 @@ in settings = { "listen.owner" = webserver.user; "listen.group" = webserver.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }) ) eachSite; diff --git a/nixos/modules/services/web-apps/dolibarr.nix b/nixos/modules/services/web-apps/dolibarr.nix index 877490652989..86b8bd6bc892 100644 --- a/nixos/modules/services/web-apps/dolibarr.nix +++ b/nixos/modules/services/web-apps/dolibarr.nix @@ -56,26 +56,25 @@ let ''; # see https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/install/install.forced.sample.php for all possible values - install = - { - force_install_noedit = 2; - force_install_main_data_root = "${cfg.stateDir}/documents"; - force_install_nophpinfo = true; - force_install_lockinstall = "444"; - force_install_distrib = "nixos"; - force_install_type = "mysqli"; - force_install_dbserver = cfg.database.host; - force_install_port = toString cfg.database.port; - force_install_database = cfg.database.name; - force_install_databaselogin = cfg.database.user; + install = { + force_install_noedit = 2; + force_install_main_data_root = "${cfg.stateDir}/documents"; + force_install_nophpinfo = true; + force_install_lockinstall = "444"; + force_install_distrib = "nixos"; + force_install_type = "mysqli"; + force_install_dbserver = cfg.database.host; + force_install_port = toString cfg.database.port; + force_install_database = cfg.database.name; + force_install_databaselogin = cfg.database.user; - force_install_mainforcehttps = vhostCfg.forceSSL or false; - force_install_createuser = false; - force_install_dolibarrlogin = null; - } - // optionalAttrs (cfg.database.passwordFile != null) { - force_install_databasepass = ''file_get_contents("${cfg.database.passwordFile}")''; - }; + force_install_mainforcehttps = vhostCfg.forceSSL or false; + force_install_createuser = false; + force_install_dolibarrlogin = null; + } + // optionalAttrs (cfg.database.passwordFile != null) { + force_install_databasepass = ''file_get_contents("${cfg.database.passwordFile}")''; + }; in { # interface @@ -328,7 +327,8 @@ in "listen.mode" = "0660"; "listen.owner" = cfg.user; "listen.group" = cfg.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; # there are several challenges with dolibarr and NixOS which we can address here diff --git a/nixos/modules/services/web-apps/drupal.nix b/nixos/modules/services/web-apps/drupal.nix index 8e4751322b24..2a51e3672278 100644 --- a/nixos/modules/services/web-apps/drupal.nix +++ b/nixos/modules/services/web-apps/drupal.nix @@ -293,7 +293,8 @@ in settings = { "listen.owner" = webserver.user; "listen.group" = webserver.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }) ) eachSite; } diff --git a/nixos/modules/services/web-apps/fider.nix b/nixos/modules/services/web-apps/fider.nix index 51bd69deba36..e81bba18d7b5 100644 --- a/nixos/modules/services/web-apps/fider.nix +++ b/nixos/modules/services/web-apps/fider.nix @@ -87,7 +87,8 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" - ] ++ lib.optionals (cfg.database.url == "local") [ "postgresql.target" ]; + ] + ++ lib.optionals (cfg.database.url == "local") [ "postgresql.target" ]; requires = lib.optionals (cfg.database.url == "local") [ "postgresql.target" ]; environment = let diff --git a/nixos/modules/services/web-apps/filesender.nix b/nixos/modules/services/web-apps/filesender.nix index a1c4c7b0846f..f2339e6e32b1 100644 --- a/nixos/modules/services/web-apps/filesender.nix +++ b/nixos/modules/services/web-apps/filesender.nix @@ -158,7 +158,8 @@ in settings = { "listen.owner" = config.services.nginx.user; "listen.group" = config.services.nginx.group; - } // cfg.poolSettings; + } + // cfg.poolSettings; }; }; diff --git a/nixos/modules/services/web-apps/firefly-iii-data-importer.nix b/nixos/modules/services/web-apps/firefly-iii-data-importer.nix index 1370e0558538..820d2c819101 100644 --- a/nixos/modules/services/web-apps/firefly-iii-data-importer.nix +++ b/nixos/modules/services/web-apps/firefly-iii-data-importer.nix @@ -210,7 +210,8 @@ in "pm.min_spare_servers" = lib.mkDefault 2; "pm.max_spare_servers" = lib.mkDefault 4; "pm.max_requests" = lib.mkDefault 500; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; systemd.services.firefly-iii-data-importer-setup = { @@ -219,7 +220,8 @@ in serviceConfig = { ExecStart = data-importer-maintenance; RemainAfterExit = true; - } // commonServiceConfig; + } + // commonServiceConfig; unitConfig.JoinsNamespaceOf = "phpfpm-firefly-iii-data-importer.service"; restartTriggers = [ cfg.package ]; }; diff --git a/nixos/modules/services/web-apps/firefly-iii.nix b/nixos/modules/services/web-apps/firefly-iii.nix index 732095c22277..8c88dcf1a561 100644 --- a/nixos/modules/services/web-apps/firefly-iii.nix +++ b/nixos/modules/services/web-apps/firefly-iii.nix @@ -303,7 +303,8 @@ in "pm.min_spare_servers" = lib.mkDefault 2; "pm.max_spare_servers" = lib.mkDefault 4; "pm.max_requests" = lib.mkDefault 500; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; systemd.services.firefly-iii-setup = { @@ -316,7 +317,8 @@ in serviceConfig = { ExecStart = firefly-iii-maintenance; RemainAfterExit = true; - } // commonServiceConfig; + } + // commonServiceConfig; unitConfig.JoinsNamespaceOf = "phpfpm-firefly-iii.service"; restartTriggers = [ cfg.package ]; partOf = [ "phpfpm-firefly-iii.service" ]; @@ -332,7 +334,8 @@ in description = "Daily Firefly III cron job"; serviceConfig = { ExecStart = "${artisan} firefly-iii:cron"; - } // commonServiceConfig; + } + // commonServiceConfig; }; systemd.timers.firefly-iii-cron = { diff --git a/nixos/modules/services/web-apps/flarum.nix b/nixos/modules/services/web-apps/flarum.nix index ace42173cb56..2b5517d8af98 100644 --- a/nixos/modules/services/web-apps/flarum.nix +++ b/nixos/modules/services/web-apps/flarum.nix @@ -212,26 +212,25 @@ in Group = cfg.group; }; path = [ config.services.phpfpm.phpPackage ]; - script = - '' - mkdir -p ${cfg.stateDir}/{extensions,public/assets/avatars} - mkdir -p ${cfg.stateDir}/storage/{cache,formatter,sessions,views} - cd ${cfg.stateDir} - cp -f ${cfg.package}/share/php/flarum/{extend.php,site.php,flarum} . - ln -sf ${cfg.package}/share/php/flarum/vendor . - ln -sf ${cfg.package}/share/php/flarum/public/index.php public/ - '' - + optionalString (cfg.createDatabaseLocally && cfg.database.driver == "mysql") '' - if [ ! -f config.php ]; then - php flarum install --file=${flarumInstallConfig} - fi - '' - + '' - if [ -f config.php ]; then - php flarum migrate - php flarum cache:clear - fi - ''; + script = '' + mkdir -p ${cfg.stateDir}/{extensions,public/assets/avatars} + mkdir -p ${cfg.stateDir}/storage/{cache,formatter,sessions,views} + cd ${cfg.stateDir} + cp -f ${cfg.package}/share/php/flarum/{extend.php,site.php,flarum} . + ln -sf ${cfg.package}/share/php/flarum/vendor . + ln -sf ${cfg.package}/share/php/flarum/public/index.php public/ + '' + + optionalString (cfg.createDatabaseLocally && cfg.database.driver == "mysql") '' + if [ ! -f config.php ]; then + php flarum install --file=${flarumInstallConfig} + fi + '' + + '' + if [ -f config.php ]; then + php flarum migrate + php flarum cache:clear + fi + ''; }; }; diff --git a/nixos/modules/services/web-apps/freshrss.nix b/nixos/modules/services/web-apps/freshrss.nix index 77b1eb4a1843..1cacfdcbac95 100644 --- a/nixos/modules/services/web-apps/freshrss.nix +++ b/nixos/modules/services/web-apps/freshrss.nix @@ -14,13 +14,12 @@ let name = "freshrss-extensions"; paths = cfg.extensions; }; - env-vars = - { - DATA_PATH = cfg.dataDir; - } - // lib.optionalAttrs (cfg.extensions != [ ]) { - THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss/"; - }; + env-vars = { + DATA_PATH = cfg.dataDir; + } + // lib.optionalAttrs (cfg.extensions != [ ]) { + THIRDPARTY_EXTENSIONS_PATH = "${extension-env}/share/freshrss/"; + }; in { meta.maintainers = with maintainers; [ diff --git a/nixos/modules/services/web-apps/froide-govplan.nix b/nixos/modules/services/web-apps/froide-govplan.nix index 7fab1ad19310..19a041ff88fe 100644 --- a/nixos/modules/services/web-apps/froide-govplan.nix +++ b/nixos/modules/services/web-apps/froide-govplan.nix @@ -11,11 +11,9 @@ let settingsFile = pythonFmt.generate "extra_settings.py" cfg.settings; pkg = cfg.package.overridePythonAttrs (old: { - postInstall = - old.postInstall - + '' - ln -s ${settingsFile} $out/${pkg.python.sitePackages}/froide_govplan/project/extra_settings.py - ''; + postInstall = old.postInstall + '' + ln -s ${settingsFile} $out/${pkg.python.sitePackages}/froide_govplan/project/extra_settings.py + ''; }); froide-govplan = pkgs.writeShellApplication { @@ -190,15 +188,14 @@ in "systemd-tmpfiles-setup.service" ]; wantedBy = [ "multi-user.target" ]; - environment = - { - PYTHONPATH = "${pkg.pythonPath}:${pkg}/${pkg.python.sitePackages}"; - GDAL_LIBRARY_PATH = "${pkgs.gdal}/lib/libgdal.so"; - GEOS_LIBRARY_PATH = "${pkgs.geos}/lib/libgeos_c.so"; - } - // lib.optionalAttrs (cfg.secretKeyFile != null) { - SECRET_KEY_FILE = cfg.secretKeyFile; - }; + environment = { + PYTHONPATH = "${pkg.pythonPath}:${pkg}/${pkg.python.sitePackages}"; + GDAL_LIBRARY_PATH = "${pkgs.gdal}/lib/libgdal.so"; + GEOS_LIBRARY_PATH = "${pkgs.geos}/lib/libgeos_c.so"; + } + // lib.optionalAttrs (cfg.secretKeyFile != null) { + SECRET_KEY_FILE = cfg.secretKeyFile; + }; preStart = '' # Auto-migrate on first run or if the package has changed versionFile="${cfg.dataDir}/src-version" diff --git a/nixos/modules/services/web-apps/gancio.nix b/nixos/modules/services/web-apps/gancio.nix index 6e6cd3bfba37..62de57276fcd 100644 --- a/nixos/modules/services/web-apps/gancio.nix +++ b/nixos/modules/services/web-apps/gancio.nix @@ -211,7 +211,8 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" - ] ++ optional (cfg.settings.db.dialect == "postgres") "postgresql.target"; + ] + ++ optional (cfg.settings.db.dialect == "postgres") "postgresql.target"; environment = { NODE_ENV = "production"; diff --git a/nixos/modules/services/web-apps/glitchtip.nix b/nixos/modules/services/web-apps/glitchtip.nix index ecf762c8c29c..0ade0025062e 100644 --- a/nixos/modules/services/web-apps/glitchtip.nix +++ b/nixos/modules/services/web-apps/glitchtip.nix @@ -173,10 +173,11 @@ in requires = lib.optional cfg.database.createLocally "postgresql.target" ++ lib.optional cfg.redis.createLocally "redis-glitchtip.service"; - after = - [ "network-online.target" ] - ++ lib.optional cfg.database.createLocally "postgresql.target" - ++ lib.optional cfg.redis.createLocally "redis-glitchtip.service"; + after = [ + "network-online.target" + ] + ++ lib.optional cfg.database.createLocally "postgresql.target" + ++ lib.optional cfg.redis.createLocally "redis-glitchtip.service"; inherit environment; }; diff --git a/nixos/modules/services/web-apps/guacamole-server.nix b/nixos/modules/services/web-apps/guacamole-server.nix index 0662394565c3..79a90fe7df60 100644 --- a/nixos/modules/services/web-apps/guacamole-server.nix +++ b/nixos/modules/services/web-apps/guacamole-server.nix @@ -75,7 +75,8 @@ in after = [ "network.target" ]; environment = { HOME = "/run/guacamole-server"; - } // cfg.extraEnvironment; + } + // cfg.extraEnvironment; serviceConfig = { ExecStart = "${lib.getExe cfg.package} -f -b ${cfg.host} -l ${toString cfg.port}"; RuntimeDirectory = "guacamole-server"; diff --git a/nixos/modules/services/web-apps/healthchecks.nix b/nixos/modules/services/web-apps/healthchecks.nix index 866e59ffbf83..eec40a8a07f9 100644 --- a/nixos/modules/services/web-apps/healthchecks.nix +++ b/nixos/modules/services/web-apps/healthchecks.nix @@ -18,7 +18,8 @@ let environment = { PYTHONPATH = pkg.pythonPath; STATIC_ROOT = cfg.dataDir + "/static"; - } // lib.filterAttrs (_: v: !builtins.isNull v) cfg.settings; + } + // lib.filterAttrs (_: v: !builtins.isNull v) cfg.settings; environmentFile = pkgs.writeText "healthchecks-environment" ( lib.generators.toKeyValue { } environment @@ -211,7 +212,8 @@ in Group = cfg.group; EnvironmentFile = [ environmentFile - ] ++ lib.optional (cfg.settingsFile != null) cfg.settingsFile; + ] + ++ lib.optional (cfg.settingsFile != null) cfg.settingsFile; StateDirectory = mkIf (cfg.dataDir == "/var/lib/healthchecks") "healthchecks"; StateDirectoryMode = mkIf (cfg.dataDir == "/var/lib/healthchecks") "0750"; }; @@ -235,12 +237,11 @@ in wantedBy = [ "healthchecks.target" ]; after = [ "healthchecks-migration.service" ]; - preStart = - '' - ${pkg}/opt/healthchecks/manage.py collectstatic --no-input - ${pkg}/opt/healthchecks/manage.py remove_stale_contenttypes --no-input - '' - + lib.optionalString (cfg.settings.DEBUG != "True") "${pkg}/opt/healthchecks/manage.py compress"; + preStart = '' + ${pkg}/opt/healthchecks/manage.py collectstatic --no-input + ${pkg}/opt/healthchecks/manage.py remove_stale_contenttypes --no-input + '' + + lib.optionalString (cfg.settings.DEBUG != "True") "${pkg}/opt/healthchecks/manage.py compress"; serviceConfig = commonConfig // { Restart = "always"; diff --git a/nixos/modules/services/web-apps/hedgedoc.nix b/nixos/modules/services/web-apps/hedgedoc.nix index 587cf10f9c53..4c0b1d688665 100644 --- a/nixos/modules/services/web-apps/hedgedoc.nix +++ b/nixos/modules/services/web-apps/hedgedoc.nix @@ -283,7 +283,8 @@ in WorkingDirectory = "/run/${name}"; ReadWritePaths = [ "-${cfg.settings.uploadsPath}" - ] ++ lib.optionals (cfg.settings.db ? "storage") [ "-${cfg.settings.db.storage}" ]; + ] + ++ lib.optionals (cfg.settings.db ? "storage") [ "-${cfg.settings.db.storage}" ]; EnvironmentFile = lib.mkIf (cfg.environmentFile != null) [ cfg.environmentFile ]; Environment = [ "CMD_CONFIG_FILE=/run/${name}/config.json" diff --git a/nixos/modules/services/web-apps/icingaweb2/module-monitoring.nix b/nixos/modules/services/web-apps/icingaweb2/module-monitoring.nix index 8ca1d9d07103..c213185827d1 100644 --- a/nixos/modules/services/web-apps/icingaweb2/module-monitoring.nix +++ b/nixos/modules/services/web-apps/icingaweb2/module-monitoring.nix @@ -185,20 +185,19 @@ in }; config = mkIf (config.services.icingaweb2.enable && cfg.enable) { - environment.etc = - { - "icingaweb2/enabledModules/monitoring" = { - source = "${pkgs.icingaweb2}/modules/monitoring"; - }; - } - // optionalAttrs (!cfg.generalConfig.mutable) { - "icingaweb2/modules/monitoring/config.ini".text = configIni; - } - // optionalAttrs (!cfg.mutableBackends) { - "icingaweb2/modules/monitoring/backends.ini".text = backendsIni; - } - // optionalAttrs (!cfg.mutableTransports) { - "icingaweb2/modules/monitoring/commandtransports.ini".text = transportsIni; + environment.etc = { + "icingaweb2/enabledModules/monitoring" = { + source = "${pkgs.icingaweb2}/modules/monitoring"; }; + } + // optionalAttrs (!cfg.generalConfig.mutable) { + "icingaweb2/modules/monitoring/config.ini".text = configIni; + } + // optionalAttrs (!cfg.mutableBackends) { + "icingaweb2/modules/monitoring/backends.ini".text = backendsIni; + } + // optionalAttrs (!cfg.mutableTransports) { + "icingaweb2/modules/monitoring/commandtransports.ini".text = transportsIni; + }; }; } diff --git a/nixos/modules/services/web-apps/ifm.nix b/nixos/modules/services/web-apps/ifm.nix index 747a7469cd92..77ee0010c694 100644 --- a/nixos/modules/services/web-apps/ifm.nix +++ b/nixos/modules/services/web-apps/ifm.nix @@ -56,7 +56,8 @@ in wantedBy = [ "multi-user.target" ]; environment = { - } // (builtins.mapAttrs (_: val: toString val) cfg.settings); + } + // (builtins.mapAttrs (_: val: toString val) cfg.settings); serviceConfig = { DynamicUser = true; diff --git a/nixos/modules/services/web-apps/invidious.nix b/nixos/modules/services/web-apps/invidious.nix index 89795c72ee84..2b93e942896c 100644 --- a/nixos/modules/services/web-apps/invidious.nix +++ b/nixos/modules/services/web-apps/invidious.nix @@ -77,43 +77,42 @@ let wants = commonInvidousServiceConfig.wants ++ [ "invidious.service" ]; }) { - script = - '' - configParts=() - '' - # autogenerated hmac_key - + lib.optionalString generateHmac '' - configParts+=("$(${pkgs.jq}/bin/jq -R '{"hmac_key":.}' <"${generatedHmacKeyFile}")") - '' - # generated settings file - + '' - configParts+=("$(< ${lib.escapeShellArg settingsFile})") - '' - # optional database password file - + lib.optionalString (cfg.database.host != null) '' - configParts+=("$(${pkgs.jq}/bin/jq -R '{"db":{"password":.}}' ${lib.escapeShellArg cfg.database.passwordFile})") - '' - # optional extra settings file - + lib.optionalString (cfg.extraSettingsFile != null) '' - configParts+=("$(< ${lib.escapeShellArg cfg.extraSettingsFile})") - '' - # explicitly specified hmac key file - + lib.optionalString (cfg.hmacKeyFile != null) '' - configParts+=("$(< ${lib.escapeShellArg cfg.hmacKeyFile})") - '' - # configure threads for secondary instances - + lib.optionalString (scaleIndex > 0) '' - configParts+=('{"channel_threads":0, "feed_threads":0}') - '' - # configure different ports for the instances - + '' - configParts+=('{"port":${toString (cfg.port + scaleIndex)}}') - '' - # merge all parts into a single configuration with later elements overriding previous elements - + '' - export INVIDIOUS_CONFIG="$(${pkgs.jq}/bin/jq -s 'reduce .[] as $item ({}; . * $item)' <<<"''${configParts[*]}")" - exec ${cfg.package}/bin/invidious - ''; + script = '' + configParts=() + '' + # autogenerated hmac_key + + lib.optionalString generateHmac '' + configParts+=("$(${pkgs.jq}/bin/jq -R '{"hmac_key":.}' <"${generatedHmacKeyFile}")") + '' + # generated settings file + + '' + configParts+=("$(< ${lib.escapeShellArg settingsFile})") + '' + # optional database password file + + lib.optionalString (cfg.database.host != null) '' + configParts+=("$(${pkgs.jq}/bin/jq -R '{"db":{"password":.}}' ${lib.escapeShellArg cfg.database.passwordFile})") + '' + # optional extra settings file + + lib.optionalString (cfg.extraSettingsFile != null) '' + configParts+=("$(< ${lib.escapeShellArg cfg.extraSettingsFile})") + '' + # explicitly specified hmac key file + + lib.optionalString (cfg.hmacKeyFile != null) '' + configParts+=("$(< ${lib.escapeShellArg cfg.hmacKeyFile})") + '' + # configure threads for secondary instances + + lib.optionalString (scaleIndex > 0) '' + configParts+=('{"channel_threads":0, "feed_threads":0}') + '' + # configure different ports for the instances + + '' + configParts+=('{"port":${toString (cfg.port + scaleIndex)}}') + '' + # merge all parts into a single configuration with later elements overriding previous elements + + '' + export INVIDIOUS_CONFIG="$(${pkgs.jq}/bin/jq -s 'reduce .[] as $item ({}; . * $item)' <<<"''${configParts[*]}")" + exec ${cfg.package}/bin/invidious + ''; } ]; @@ -125,29 +124,28 @@ let }) cfg.serviceScale ); - services.invidious.settings = - { - # Automatically initialises and migrates the database if necessary - check_tables = true; + services.invidious.settings = { + # Automatically initialises and migrates the database if necessary + check_tables = true; - db = { - user = lib.mkDefault ( - if (lib.versionAtLeast config.system.stateVersion "24.05") then "invidious" else "kemal" - ); - dbname = lib.mkDefault "invidious"; - port = cfg.database.port; - # Blank for unix sockets, see - # https://github.com/will/crystal-pg/blob/1548bb255210/src/pq/conninfo.cr#L100-L108 - host = lib.optionalString (cfg.database.host != null) cfg.database.host; - # Not needed because peer authentication is enabled - password = lib.mkIf (cfg.database.host == null) ""; - }; + db = { + user = lib.mkDefault ( + if (lib.versionAtLeast config.system.stateVersion "24.05") then "invidious" else "kemal" + ); + dbname = lib.mkDefault "invidious"; + port = cfg.database.port; + # Blank for unix sockets, see + # https://github.com/will/crystal-pg/blob/1548bb255210/src/pq/conninfo.cr#L100-L108 + host = lib.optionalString (cfg.database.host != null) cfg.database.host; + # Not needed because peer authentication is enabled + password = lib.mkIf (cfg.database.host == null) ""; + }; - host_binding = cfg.address; - } - // (lib.optionalAttrs (cfg.domain != null) { - inherit (cfg) domain; - }); + host_binding = cfg.address; + } + // (lib.optionalAttrs (cfg.domain != null) { + inherit (cfg) domain; + }); assertions = [ { diff --git a/nixos/modules/services/web-apps/invoiceplane.nix b/nixos/modules/services/web-apps/invoiceplane.nix index 8904c41beea7..10bac784e5f0 100644 --- a/nixos/modules/services/web-apps/invoiceplane.nix +++ b/nixos/modules/services/web-apps/invoiceplane.nix @@ -320,7 +320,8 @@ in settings = { "listen.owner" = webserver.user; "listen.group" = webserver.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }) ) eachSite; }; diff --git a/nixos/modules/services/web-apps/jirafeau.nix b/nixos/modules/services/web-apps/jirafeau.nix index b377d5d30284..6065432b8976 100644 --- a/nixos/modules/services/web-apps/jirafeau.nix +++ b/nixos/modules/services/web-apps/jirafeau.nix @@ -162,7 +162,8 @@ in "listen.mode" = "0660"; "listen.owner" = user; "listen.group" = group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; }; diff --git a/nixos/modules/services/web-apps/jitsi-meet.nix b/nixos/modules/services/web-apps/jitsi-meet.nix index fa9ea8e698c6..b1cf2c74c041 100644 --- a/nixos/modules/services/web-apps/jitsi-meet.nix +++ b/nixos/modules/services/web-apps/jitsi-meet.nix @@ -445,13 +445,12 @@ in systemd.services.jitsi-meet-init-secrets = { wantedBy = [ "multi-user.target" ]; - before = - [ - "jicofo.service" - "jitsi-videobridge2.service" - ] - ++ (optional cfg.prosody.enable "prosody.service") - ++ (optional cfg.jigasi.enable "jigasi.service"); + before = [ + "jicofo.service" + "jitsi-videobridge2.service" + ] + ++ (optional cfg.prosody.enable "prosody.service") + ++ (optional cfg.jigasi.enable "jigasi.service"); serviceConfig = { Type = "oneshot"; UMask = "027"; @@ -462,18 +461,17 @@ in script = let - secrets = - [ - "jicofo-component-secret" - "jicofo-user-secret" - "jibri-auth-secret" - "jibri-recorder-secret" - ] - ++ (optionals cfg.jigasi.enable [ - "jigasi-user-secret" - "jigasi-component-secret" - ]) - ++ (optional (cfg.videobridge.passwordFile == null) "videobridge-secret"); + secrets = [ + "jicofo-component-secret" + "jicofo-user-secret" + "jibri-auth-secret" + "jibri-recorder-secret" + ] + ++ (optionals cfg.jigasi.enable [ + "jigasi-user-secret" + "jigasi-component-secret" + ]) + ++ (optional (cfg.videobridge.passwordFile == null) "videobridge-secret"); in '' ${concatMapStringsSep "\n" (s: '' diff --git a/nixos/modules/services/web-apps/karakeep.nix b/nixos/modules/services/web-apps/karakeep.nix index 14ec552a41d6..df431d89c3a9 100644 --- a/nixos/modules/services/web-apps/karakeep.nix +++ b/nixos/modules/services/web-apps/karakeep.nix @@ -20,7 +20,8 @@ let environmentFiles = [ "/var/lib/karakeep/settings.env" - ] ++ (lib.optional (cfg.environmentFile != null) cfg.environmentFile); + ] + ++ (lib.optional (cfg.environmentFile != null) cfg.environmentFile); in { options = { diff --git a/nixos/modules/services/web-apps/keycloak.nix b/nixos/modules/services/web-apps/keycloak.nix index fa7d0970707e..8501c2e874ef 100644 --- a/nixos/modules/services/web-apps/keycloak.nix +++ b/nixos/modules/services/web-apps/keycloak.nix @@ -714,15 +714,14 @@ in openssl replace-secret ]; - environment = - { - KC_HOME_DIR = "/run/keycloak"; - KC_CONF_DIR = "/run/keycloak/conf"; - } - // lib.optionalAttrs (cfg.initialAdminPassword != null) { - KC_BOOTSTRAP_ADMIN_USERNAME = "admin"; - KC_BOOTSTRAP_ADMIN_PASSWORD = cfg.initialAdminPassword; - }; + environment = { + KC_HOME_DIR = "/run/keycloak"; + KC_CONF_DIR = "/run/keycloak/conf"; + } + // lib.optionalAttrs (cfg.initialAdminPassword != null) { + KC_BOOTSTRAP_ADMIN_USERNAME = "admin"; + KC_BOOTSTRAP_ADMIN_PASSWORD = cfg.initialAdminPassword; + }; serviceConfig = { LoadCredential = map (p: "${baseNameOf p}:${p}") secretPaths @@ -739,34 +738,33 @@ in Type = "notify"; # Requires quarkus-systemd-notify plugin NotifyAccess = "all"; }; - script = - '' - set -o errexit -o pipefail -o nounset -o errtrace - shopt -s inherit_errexit + script = '' + set -o errexit -o pipefail -o nounset -o errtrace + shopt -s inherit_errexit - umask u=rwx,g=,o= + umask u=rwx,g=,o= - ln -s ${themesBundle} /run/keycloak/themes - ln -s ${keycloakBuild}/providers /run/keycloak/ - ln -s ${keycloakBuild}/lib /run/keycloak/ + ln -s ${themesBundle} /run/keycloak/themes + ln -s ${keycloakBuild}/providers /run/keycloak/ + ln -s ${keycloakBuild}/lib /run/keycloak/ - install -D -m 0600 ${confFile} /run/keycloak/conf/keycloak.conf + install -D -m 0600 ${confFile} /run/keycloak/conf/keycloak.conf - ${secretReplacements} + ${secretReplacements} - # Escape any backslashes in the db parameters, since - # they're otherwise unexpectedly read as escape - # sequences. - sed -i '/db-/ s|\\|\\\\|g' /run/keycloak/conf/keycloak.conf + # Escape any backslashes in the db parameters, since + # they're otherwise unexpectedly read as escape + # sequences. + sed -i '/db-/ s|\\|\\\\|g' /run/keycloak/conf/keycloak.conf - '' - + optionalString (cfg.sslCertificate != null && cfg.sslCertificateKey != null) '' - mkdir -p /run/keycloak/ssl - cp "$CREDENTIALS_DIRECTORY"/ssl_{cert,key} /run/keycloak/ssl/ - '' - + '' - kc.sh --verbose start --optimized ${lib.optionalString (cfg.realmFiles != [ ]) "--import-realm"} - ''; + '' + + optionalString (cfg.sslCertificate != null && cfg.sslCertificateKey != null) '' + mkdir -p /run/keycloak/ssl + cp "$CREDENTIALS_DIRECTORY"/ssl_{cert,key} /run/keycloak/ssl/ + '' + + '' + kc.sh --verbose start --optimized ${lib.optionalString (cfg.realmFiles != [ ]) "--import-realm"} + ''; enableStrictShellChecks = true; }; diff --git a/nixos/modules/services/web-apps/kimai.nix b/nixos/modules/services/web-apps/kimai.nix index 4ca464489b47..0989b97eae4e 100644 --- a/nixos/modules/services/web-apps/kimai.nix +++ b/nixos/modules/services/web-apps/kimai.nix @@ -244,7 +244,8 @@ in settings = { "listen.owner" = webserver.user; "listen.group" = webserver.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }) ) eachSite; diff --git a/nixos/modules/services/web-apps/lanraragi.nix b/nixos/modules/services/web-apps/lanraragi.nix index 1fbffa47238d..82fb83f96bae 100644 --- a/nixos/modules/services/web-apps/lanraragi.nix +++ b/nixos/modules/services/web-apps/lanraragi.nix @@ -83,29 +83,28 @@ in "LRR_NETWORK" = "http://*:${toString cfg.port}"; "HOME" = "/var/lib/lanraragi"; }; - preStart = - '' - cat > lrr.conf < "127.0.0.1:${toString cfg.redis.port}", - redis_password => "${ - lib.optionalString (cfg.redis.passwordFile != null) ''$(head -n1 ${cfg.redis.passwordFile})'' - }", - redis_database => "0", - redis_database_minion => "1", - redis_database_config => "2", - redis_database_search => "3", - } - EOF - '' - + lib.optionalString (cfg.passwordFile != null) '' - ${lib.getExe pkgs.redis} -h 127.0.0.1 -p ${toString cfg.redis.port} ${ - lib.optionalString (cfg.redis.passwordFile != null) ''-a "$(head -n1 ${cfg.redis.passwordFile})"'' - }< lrr.conf < "127.0.0.1:${toString cfg.redis.port}", + redis_password => "${ + lib.optionalString (cfg.redis.passwordFile != null) ''$(head -n1 ${cfg.redis.passwordFile})'' + }", + redis_database => "0", + redis_database_minion => "1", + redis_database_config => "2", + redis_database_search => "3", + } + EOF + '' + + lib.optionalString (cfg.passwordFile != null) '' + ${lib.getExe pkgs.redis} -h 127.0.0.1 -p ${toString cfg.redis.port} ${ + lib.optionalString (cfg.redis.passwordFile != null) ''-a "$(head -n1 ${cfg.redis.passwordFile})"'' + }< ${cfg.activeRecordEncryptionDeterministicKeyFile} - fi - if ! test -f ${cfg.activeRecordEncryptionKeyDerivationSaltFile}; then - mkdir -p $(dirname ${cfg.activeRecordEncryptionKeyDerivationSaltFile}) - bin/rails db:encryption:init | grep --only-matching "ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=[^ ]\+" | sed 's/^ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=//' > ${cfg.activeRecordEncryptionKeyDerivationSaltFile} - fi - if ! test -f ${cfg.activeRecordEncryptionPrimaryKeyFile}; then - mkdir -p $(dirname ${cfg.activeRecordEncryptionPrimaryKeyFile}) - bin/rails db:encryption:init | grep --only-matching "ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=[^ ]\+" | sed 's/^ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=//' > ${cfg.activeRecordEncryptionPrimaryKeyFile} - fi - if ! test -f ${cfg.secretKeyBaseFile}; then - mkdir -p $(dirname ${cfg.secretKeyBaseFile}) - bin/bundle exec rails secret > ${cfg.secretKeyBaseFile} - fi - if ! test -f ${cfg.vapidPrivateKeyFile}; then - mkdir -p $(dirname ${cfg.vapidPrivateKeyFile}) $(dirname ${cfg.vapidPublicKeyFile}) - keypair=$(bin/rake webpush:generate_keys) - echo $keypair | grep --only-matching "Private -> [^ ]\+" | sed 's/^Private -> //' > ${cfg.vapidPrivateKeyFile} - echo $keypair | grep --only-matching "Public -> [^ ]\+" | sed 's/^Public -> //' > ${cfg.vapidPublicKeyFile} - fi + if ! test -d /var/cache/mastodon/precompile; then + ${cfg.package}/bin/bundle exec bootsnap precompile --gemfile ${cfg.package}/app ${cfg.package}/lib + fi + if ! test -f ${cfg.activeRecordEncryptionDeterministicKeyFile}; then + mkdir -p $(dirname ${cfg.activeRecordEncryptionDeterministicKeyFile}) + bin/rails db:encryption:init | grep --only-matching "ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=[^ ]\+" | sed 's/^ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=//' > ${cfg.activeRecordEncryptionDeterministicKeyFile} + fi + if ! test -f ${cfg.activeRecordEncryptionKeyDerivationSaltFile}; then + mkdir -p $(dirname ${cfg.activeRecordEncryptionKeyDerivationSaltFile}) + bin/rails db:encryption:init | grep --only-matching "ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=[^ ]\+" | sed 's/^ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=//' > ${cfg.activeRecordEncryptionKeyDerivationSaltFile} + fi + if ! test -f ${cfg.activeRecordEncryptionPrimaryKeyFile}; then + mkdir -p $(dirname ${cfg.activeRecordEncryptionPrimaryKeyFile}) + bin/rails db:encryption:init | grep --only-matching "ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=[^ ]\+" | sed 's/^ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=//' > ${cfg.activeRecordEncryptionPrimaryKeyFile} + fi + if ! test -f ${cfg.secretKeyBaseFile}; then + mkdir -p $(dirname ${cfg.secretKeyBaseFile}) + bin/bundle exec rails secret > ${cfg.secretKeyBaseFile} + fi + if ! test -f ${cfg.vapidPrivateKeyFile}; then + mkdir -p $(dirname ${cfg.vapidPrivateKeyFile}) $(dirname ${cfg.vapidPublicKeyFile}) + keypair=$(bin/rake webpush:generate_keys) + echo $keypair | grep --only-matching "Private -> [^ ]\+" | sed 's/^Private -> //' > ${cfg.vapidPrivateKeyFile} + echo $keypair | grep --only-matching "Public -> [^ ]\+" | sed 's/^Public -> //' > ${cfg.vapidPublicKeyFile} + fi - cat > /var/lib/mastodon/.secrets_env < /var/lib/mastodon/.secrets_env <&2 - mkdir -p "$configDir" - mv "$oldConfig" "$newConfig" - touch "$configDir/.initial-created" - fi + preStart = '' + dataDir=${escapeShellArg cfg.dataDir} + configDir=${escapeShellArg cfg.configDir} + logDir=${escapeShellArg cfg.logDir} + package=${escapeShellArg cfg.package} + nixConfig=${escapeShellArg finalConfig} + '' + + optionalString (versionAtLeast config.system.stateVersion "25.05") '' + # Migrate configs in the pre-25.05 directory structure. + oldConfig="$dataDir/config/config.json" + newConfig="$configDir/config.json" + if [ "$oldConfig" != "$newConfig" ] && [ -f "$oldConfig" ] && [ ! -f "$newConfig" ]; then + # Migrate the legacy config location to the new config location + echo "Moving legacy config at $oldConfig to $newConfig" >&2 + mkdir -p "$configDir" + mv "$oldConfig" "$newConfig" + touch "$configDir/.initial-created" + fi - # Logs too. - oldLogs="$dataDir/logs" - newLogs="$logDir" - if [ "$oldLogs" != "$newLogs" ] && [ -d "$oldLogs" ] && [ ! -f "$newLogs/.initial-created" ]; then - # Migrate the legacy log location to the new log location. - # Allow this to fail if there aren't any logs to move. - echo "Moving legacy logs at $oldLogs to $newLogs" >&2 - mkdir -p "$newLogs" - mv "$oldLogs"/* "$newLogs" || true - touch "$newLogs/.initial-created" - fi - '' - + optionalString (!cfg.mutableConfig) '' + # Logs too. + oldLogs="$dataDir/logs" + newLogs="$logDir" + if [ "$oldLogs" != "$newLogs" ] && [ -d "$oldLogs" ] && [ ! -f "$newLogs/.initial-created" ]; then + # Migrate the legacy log location to the new log location. + # Allow this to fail if there aren't any logs to move. + echo "Moving legacy logs at $oldLogs to $newLogs" >&2 + mkdir -p "$newLogs" + mv "$oldLogs"/* "$newLogs" || true + touch "$newLogs/.initial-created" + fi + '' + + optionalString (!cfg.mutableConfig) '' + ${getExe pkgs.jq} -s '.[0] * .[1]' "$package/config/config.json" "$nixConfig" > "$configDir/config.json" + '' + + optionalString cfg.mutableConfig '' + if [ ! -e "$configDir/.initial-created" ]; then ${getExe pkgs.jq} -s '.[0] * .[1]' "$package/config/config.json" "$nixConfig" > "$configDir/config.json" - '' - + optionalString cfg.mutableConfig '' - if [ ! -e "$configDir/.initial-created" ]; then - ${getExe pkgs.jq} -s '.[0] * .[1]' "$package/config/config.json" "$nixConfig" > "$configDir/config.json" - touch "$configDir/.initial-created" - fi - '' - + optionalString (cfg.mutableConfig && cfg.preferNixConfig) '' - echo "$(${getExe pkgs.jq} -s '.[0] * .[1]' "$configDir/config.json" "$nixConfig")" > "$configDir/config.json" - ''; + touch "$configDir/.initial-created" + fi + '' + + optionalString (cfg.mutableConfig && cfg.preferNixConfig) '' + echo "$(${getExe pkgs.jq} -s '.[0] * .[1]' "$configDir/config.json" "$nixConfig")" > "$configDir/config.json" + ''; serviceConfig = mkMerge [ { diff --git a/nixos/modules/services/web-apps/mealie.nix b/nixos/modules/services/web-apps/mealie.nix index d86c99771731..d2176c6b10b3 100644 --- a/nixos/modules/services/web-apps/mealie.nix +++ b/nixos/modules/services/web-apps/mealie.nix @@ -77,7 +77,8 @@ in BASE_URL = "http://localhost:${toString cfg.port}"; DATA_DIR = "/var/lib/mealie"; NLTK_DATA = pkgs.nltk-data.averaged-perceptron-tagger-eng; - } // (builtins.mapAttrs (_: val: toString val) cfg.settings); + } + // (builtins.mapAttrs (_: val: toString val) cfg.settings); serviceConfig = { DynamicUser = true; diff --git a/nixos/modules/services/web-apps/mediawiki.nix b/nixos/modules/services/web-apps/mediawiki.nix index 1b8df02f9984..73d7b452432f 100644 --- a/nixos/modules/services/web-apps/mediawiki.nix +++ b/nixos/modules/services/web-apps/mediawiki.nix @@ -617,26 +617,25 @@ in cfg.httpd.virtualHost { documentRoot = mkForce "${pkg}/share/mediawiki"; - extraConfig = - '' - - - - SetHandler "proxy:unix:${fpm.socket}|fcgi://localhost/" - - + extraConfig = '' + + + + SetHandler "proxy:unix:${fpm.socket}|fcgi://localhost/" + + - Require all granted - DirectoryIndex index.php - AllowOverride All - - '' - + optionalString (cfg.uploadsDir != null) '' - Alias "/images" "${cfg.uploadsDir}" - - Require all granted - - ''; + Require all granted + DirectoryIndex index.php + AllowOverride All + + '' + + optionalString (cfg.uploadsDir != null) '' + Alias "/images" "${cfg.uploadsDir}" + + Require all granted + + ''; } ]; }; @@ -692,15 +691,14 @@ in }; }; - systemd.tmpfiles.rules = - [ - "d '${stateDir}' 0750 ${user} ${group} - -" - "d '${cacheDir}' 0750 ${user} ${group} - -" - ] - ++ optionals (cfg.uploadsDir != null) [ - "d '${cfg.uploadsDir}' 0750 ${user} ${group} - -" - "Z '${cfg.uploadsDir}' 0750 ${user} ${group} - -" - ]; + systemd.tmpfiles.rules = [ + "d '${stateDir}' 0750 ${user} ${group} - -" + "d '${cacheDir}' 0750 ${user} ${group} - -" + ] + ++ optionals (cfg.uploadsDir != null) [ + "d '${cfg.uploadsDir}' 0750 ${user} ${group} - -" + "Z '${cfg.uploadsDir}' 0750 ${user} ${group} - -" + ]; systemd.services.mediawiki-init = { wantedBy = [ "multi-user.target" ]; diff --git a/nixos/modules/services/web-apps/miniflux.nix b/nixos/modules/services/web-apps/miniflux.nix index 6743006b0eb5..8b89c03b24bc 100644 --- a/nixos/modules/services/web-apps/miniflux.nix +++ b/nixos/modules/services/web-apps/miniflux.nix @@ -123,12 +123,13 @@ in description = "Miniflux service"; wantedBy = [ "multi-user.target" ]; requires = lib.optional cfg.createDatabaseLocally "miniflux-dbsetup.service"; - after = - [ "network.target" ] - ++ lib.optionals cfg.createDatabaseLocally [ - "postgresql.target" - "miniflux-dbsetup.service" - ]; + after = [ + "network.target" + ] + ++ lib.optionals cfg.createDatabaseLocally [ + "postgresql.target" + "miniflux-dbsetup.service" + ]; serviceConfig = { Type = "notify"; diff --git a/nixos/modules/services/web-apps/misskey.nix b/nixos/modules/services/web-apps/misskey.nix index 32d0b6806863..c601943479cf 100644 --- a/nixos/modules/services/web-apps/misskey.nix +++ b/nixos/modules/services/web-apps/misskey.nix @@ -326,19 +326,18 @@ in environment = { MISSKEY_CONFIG_YML = "/run/misskey/default.yml"; }; - preStart = - '' - install -m 700 ${settingsFormat.generate "misskey-config.yml" cfg.settings} /run/misskey/default.yml - '' - + (lib.optionalString (cfg.database.passwordFile != null) '' - ${pkgs.replace-secret}/bin/replace-secret '@DATABASE_PASSWORD@' "${cfg.database.passwordFile}" /run/misskey/default.yml - '') - + (lib.optionalString (cfg.redis.passwordFile != null) '' - ${pkgs.replace-secret}/bin/replace-secret '@REDIS_PASSWORD@' "${cfg.redis.passwordFile}" /run/misskey/default.yml - '') - + (lib.optionalString (cfg.meilisearch.keyFile != null) '' - ${pkgs.replace-secret}/bin/replace-secret '@MEILISEARCH_KEY@' "${cfg.meilisearch.keyFile}" /run/misskey/default.yml - ''); + preStart = '' + install -m 700 ${settingsFormat.generate "misskey-config.yml" cfg.settings} /run/misskey/default.yml + '' + + (lib.optionalString (cfg.database.passwordFile != null) '' + ${pkgs.replace-secret}/bin/replace-secret '@DATABASE_PASSWORD@' "${cfg.database.passwordFile}" /run/misskey/default.yml + '') + + (lib.optionalString (cfg.redis.passwordFile != null) '' + ${pkgs.replace-secret}/bin/replace-secret '@REDIS_PASSWORD@' "${cfg.redis.passwordFile}" /run/misskey/default.yml + '') + + (lib.optionalString (cfg.meilisearch.keyFile != null) '' + ${pkgs.replace-secret}/bin/replace-secret '@MEILISEARCH_KEY@' "${cfg.meilisearch.keyFile}" /run/misskey/default.yml + ''); serviceConfig = { ExecStart = "${cfg.package}/bin/misskey migrateandstart"; RuntimeDirectory = "misskey"; diff --git a/nixos/modules/services/web-apps/monica.nix b/nixos/modules/services/web-apps/monica.nix index 2aec2d9f9109..2b0b1976422f 100644 --- a/nixos/modules/services/web-apps/monica.nix +++ b/nixos/modules/services/web-apps/monica.nix @@ -354,7 +354,8 @@ in "listen.mode" = "0660"; "listen.owner" = user; "listen.group" = group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; services.nginx = { diff --git a/nixos/modules/services/web-apps/moodle.nix b/nixos/modules/services/web-apps/moodle.nix index 37e0d1c33af5..037792be9c82 100644 --- a/nixos/modules/services/web-apps/moodle.nix +++ b/nixos/modules/services/web-apps/moodle.nix @@ -317,7 +317,8 @@ in settings = { "listen.owner" = config.services.httpd.user; "listen.group" = config.services.httpd.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; services.httpd = { @@ -393,8 +394,7 @@ in }; systemd.services.httpd.after = - optional mysqlLocal "mysql.service" - ++ optional pgsqlLocal "postgresql.target"; + optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.target"; users.users.${user} = { group = group; diff --git a/nixos/modules/services/web-apps/movim.nix b/nixos/modules/services/web-apps/movim.nix index 42d9a821c122..766798dd0602 100644 --- a/nixos/modules/services/web-apps/movim.nix +++ b/nixos/modules/services/web-apps/movim.nix @@ -589,19 +589,18 @@ in environment.systemPackages = [ package ]; users = { - users = - { - movim = mkIf (cfg.user == "movim") { - isSystemUser = true; - group = cfg.group; - }; - } - // lib.optionalAttrs (cfg.h2o != null) { - "${config.services.h2o.user}".extraGroups = [ cfg.group ]; - } - // lib.optionalAttrs (cfg.nginx != null) { - "${config.services.nginx.user}".extraGroups = [ cfg.group ]; + users = { + movim = mkIf (cfg.user == "movim") { + isSystemUser = true; + group = cfg.group; }; + } + // lib.optionalAttrs (cfg.h2o != null) { + "${config.services.h2o.user}".extraGroups = [ cfg.group ]; + } + // lib.optionalAttrs (cfg.nginx != null) { + "${config.services.nginx.user}".extraGroups = [ cfg.group ]; + }; groups = { ${cfg.group} = { }; }; @@ -656,25 +655,24 @@ in "proxy.tunnel" = "ON"; "proxy.reverse.url" = "http://${cfg.settings.DAEMON_INTERFACE}:${builtins.toString cfg.port}/"; }; - "/" = - { - "file.dir" = "${package}/share/php/movim/public"; - "file.index" = [ - "index.php" - "index.html" - ]; - redirect = { - url = "/index.php/"; - internal = "YES"; - status = 307; - }; - "header.set" = [ - "Content-Security-Policy: ${movimCSP}" - ]; - } - // lib.optionalAttrs (with cfg.precompressStaticFiles; brotli.enable || gzip.enable) { - "file.send-compressed" = "ON"; + "/" = { + "file.dir" = "${package}/share/php/movim/public"; + "file.index" = [ + "index.php" + "index.html" + ]; + redirect = { + url = "/index.php/"; + internal = "YES"; + status = 307; }; + "header.set" = [ + "Content-Security-Policy: ${movimCSP}" + ]; + } + // lib.optionalAttrs (with cfg.precompressStaticFiles; brotli.enable || gzip.enable) { + "file.send-compressed" = "ON"; + }; }; "file.custom-handler" = { extension = [ ".php" ]; @@ -832,7 +830,8 @@ in "listen.group" = cfg.group; "listen.mode" = "0660"; "catch_workers_output" = true; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; }; @@ -846,52 +845,51 @@ in requires = lib.optional cfg.database.createLocally dbUnit; after = lib.optional cfg.database.createLocally dbUnit; - serviceConfig = - { - Type = "oneshot"; - User = cfg.user; - Group = cfg.group; - UMask = "077"; - } - // lib.optionalAttrs (cfg.secretFile != null) { - LoadCredential = "env-secrets:${cfg.secretFile}"; - }; + serviceConfig = { + Type = "oneshot"; + User = cfg.user; + Group = cfg.group; + UMask = "077"; + } + // lib.optionalAttrs (cfg.secretFile != null) { + LoadCredential = "env-secrets:${cfg.secretFile}"; + }; script = # sh - '' - # Env vars - rm -f ${cfg.dataDir}/.env - cp --no-preserve=all ${configFile} ${cfg.dataDir}/.env + '' + # Env vars + rm -f ${cfg.dataDir}/.env + cp --no-preserve=all ${configFile} ${cfg.dataDir}/.env + echo -e '\n' >> ${cfg.dataDir}/.env + if [[ -f "$CREDENTIALS_DIRECTORY/env-secrets" ]]; then + cat "$CREDENTIALS_DIRECTORY/env-secrets" >> ${cfg.dataDir}/.env echo -e '\n' >> ${cfg.dataDir}/.env - if [[ -f "$CREDENTIALS_DIRECTORY/env-secrets" ]]; then - cat "$CREDENTIALS_DIRECTORY/env-secrets" >> ${cfg.dataDir}/.env - echo -e '\n' >> ${cfg.dataDir}/.env - fi + fi - # Caches, logs - mkdir -p ${cfg.dataDir}/public/cache ${cfg.logDir} ${cfg.runtimeDir}/cache - chmod -R ug+rw ${cfg.dataDir}/public/cache - chmod -R ug+rw ${cfg.logDir} - chmod -R ug+rwx ${cfg.runtimeDir}/cache + # Caches, logs + mkdir -p ${cfg.dataDir}/public/cache ${cfg.logDir} ${cfg.runtimeDir}/cache + chmod -R ug+rw ${cfg.dataDir}/public/cache + chmod -R ug+rw ${cfg.logDir} + chmod -R ug+rwx ${cfg.runtimeDir}/cache - # Migrations - MOVIM_VERSION="${package.version}" - if [[ ! -f "${cfg.dataDir}/.migration-version" ]] || [[ "$MOVIM_VERSION" != "$(<${cfg.dataDir}/.migration-version)" ]]; then - ${package}/bin/movim-composer movim:migrate && echo $MOVIM_VERSION > ${cfg.dataDir}/.migration-version - fi + # Migrations + MOVIM_VERSION="${package.version}" + if [[ ! -f "${cfg.dataDir}/.migration-version" ]] || [[ "$MOVIM_VERSION" != "$(<${cfg.dataDir}/.migration-version)" ]]; then + ${package}/bin/movim-composer movim:migrate && echo $MOVIM_VERSION > ${cfg.dataDir}/.migration-version + fi + '' + + lib.optionalString (podConfigFlags != "") ( + let + flags = lib.concatStringsSep " " ( + [ "--no-interaction" ] + ++ lib.optional cfg.debug "-vvv" + ++ lib.optional (!cfg.debug && cfg.verbose) "-v" + ); + in '' - + lib.optionalString (podConfigFlags != "") ( - let - flags = lib.concatStringsSep " " ( - [ "--no-interaction" ] - ++ lib.optional cfg.debug "-vvv" - ++ lib.optional (!cfg.debug && cfg.verbose) "-v" - ); - in - '' - ${lib.getExe package} config ${podConfigFlags} - '' - ); + ${lib.getExe package} config ${podConfigFlags} + '' + ); }; services.${phpExecutionUnit} = { @@ -910,20 +908,18 @@ in "network.target" "local-fs.target" ]; - requires = - [ - "movim-data-setup.service" - "${phpExecutionUnit}.service" - ] - ++ lib.optional cfg.database.createLocally dbUnit - ++ lib.optional (webServerService != null) webServerService; - after = - [ - "movim-data-setup.service" - "${phpExecutionUnit}.service" - ] - ++ lib.optional cfg.database.createLocally dbUnit - ++ lib.optional (webServerService != null) webServerService; + requires = [ + "movim-data-setup.service" + "${phpExecutionUnit}.service" + ] + ++ lib.optional cfg.database.createLocally dbUnit + ++ lib.optional (webServerService != null) webServerService; + after = [ + "movim-data-setup.service" + "${phpExecutionUnit}.service" + ] + ++ lib.optional cfg.database.createLocally dbUnit + ++ lib.optional (webServerService != null) webServerService; environment = { PUBLIC_URL = "//${cfg.domain}"; WS_PORT = builtins.toString cfg.port; diff --git a/nixos/modules/services/web-apps/netbox.nix b/nixos/modules/services/web-apps/netbox.nix index b008e46a7529..abba24d1e430 100644 --- a/nixos/modules/services/web-apps/netbox.nix +++ b/nixos/modules/services/web-apps/netbox.nix @@ -276,15 +276,14 @@ in }; }; - extraConfig = - '' - with open("${cfg.secretKeyFile}", "r") as file: - SECRET_KEY = file.readline() - '' - + (lib.optionalString (cfg.keycloakClientSecret != null) '' - with open("${cfg.keycloakClientSecret}", "r") as file: - SOCIAL_AUTH_KEYCLOAK_SECRET = file.readline() - ''); + extraConfig = '' + with open("${cfg.secretKeyFile}", "r") as file: + SECRET_KEY = file.readline() + '' + + (lib.optionalString (cfg.keycloakClientSecret != null) '' + with open("${cfg.keycloakClientSecret}", "r") as file: + SOCIAL_AUTH_KEYCLOAK_SECRET = file.readline() + ''); }; services.redis.servers.netbox.enable = true; diff --git a/nixos/modules/services/web-apps/nextcloud-notify_push.nix b/nixos/modules/services/web-apps/nextcloud-notify_push.nix index 115e61d853d6..50dc65cf3b2d 100644 --- a/nixos/modules/services/web-apps/nextcloud-notify_push.nix +++ b/nixos/modules/services/web-apps/nextcloud-notify_push.nix @@ -11,71 +11,70 @@ let cfgN = config.services.nextcloud; in { - options.services.nextcloud.notify_push = - { - enable = lib.mkEnableOption "Notify push"; + options.services.nextcloud.notify_push = { + enable = lib.mkEnableOption "Notify push"; - package = lib.mkOption { - type = lib.types.package; - default = pkgs.nextcloud-notify_push; - defaultText = lib.literalMD "pkgs.nextcloud-notify_push"; - description = "Which package to use for notify_push"; - }; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.nextcloud-notify_push; + defaultText = lib.literalMD "pkgs.nextcloud-notify_push"; + description = "Which package to use for notify_push"; + }; - socketPath = lib.mkOption { - type = lib.types.str; - default = "/run/nextcloud-notify_push/sock"; - description = "Socket path to use for notify_push"; - }; + socketPath = lib.mkOption { + type = lib.types.str; + default = "/run/nextcloud-notify_push/sock"; + description = "Socket path to use for notify_push"; + }; - logLevel = lib.mkOption { - type = lib.types.enum [ - "error" - "warn" - "info" - "debug" - "trace" - ]; - default = "error"; - description = "Log level"; - }; + logLevel = lib.mkOption { + type = lib.types.enum [ + "error" + "warn" + "info" + "debug" + "trace" + ]; + default = "error"; + description = "Log level"; + }; - nextcloudUrl = lib.mkOption { - type = lib.types.str; - default = "http${lib.optionalString cfgN.https "s"}://${cfgN.hostName}"; - defaultText = lib.literalExpression ''"http''${lib.optionalString config.services.nextcloud.https "s"}://''${config.services.nextcloud.hostName}"''; - description = "Configure the nextcloud URL notify_push tries to connect to."; - }; + nextcloudUrl = lib.mkOption { + type = lib.types.str; + default = "http${lib.optionalString cfgN.https "s"}://${cfgN.hostName}"; + defaultText = lib.literalExpression ''"http''${lib.optionalString config.services.nextcloud.https "s"}://''${config.services.nextcloud.hostName}"''; + description = "Configure the nextcloud URL notify_push tries to connect to."; + }; - bendDomainToLocalhost = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Whether to add an entry to `/etc/hosts` for the configured nextcloud domain to point to `localhost` and add `localhost `to nextcloud's `trusted_proxies` config option. + bendDomainToLocalhost = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to add an entry to `/etc/hosts` for the configured nextcloud domain to point to `localhost` and add `localhost `to nextcloud's `trusted_proxies` config option. - This is useful when nextcloud's domain is not a static IP address and when the reverse proxy cannot be bypassed because the backend connection is done via unix socket. - ''; - }; - } - // (lib.genAttrs - [ - "dbtype" - "dbname" - "dbuser" - "dbpassFile" - "dbhost" - "dbport" - "dbtableprefix" - ] - ( - opt: - options.services.nextcloud.config.${opt} - // { - default = config.services.nextcloud.config.${opt}; - defaultText = lib.literalExpression "config.services.nextcloud.config.${opt}"; - } - ) - ); + This is useful when nextcloud's domain is not a static IP address and when the reverse proxy cannot be bypassed because the backend connection is done via unix socket. + ''; + }; + } + // (lib.genAttrs + [ + "dbtype" + "dbname" + "dbuser" + "dbpassFile" + "dbhost" + "dbport" + "dbtableprefix" + ] + ( + opt: + options.services.nextcloud.config.${opt} + // { + default = config.services.nextcloud.config.${opt}; + defaultText = lib.literalExpression "config.services.nextcloud.config.${opt}"; + } + ) + ); config = lib.mkIf cfg.enable { systemd.services = { diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index b64d1d8ac609..d30f7c335357 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -1256,7 +1256,8 @@ in serviceConfig.User = "nextcloud"; serviceConfig.LoadCredential = [ "adminpass:${cfg.config.adminpassFile}" - ] ++ runtimeSystemdCredentials; + ] + ++ runtimeSystemdCredentials; # On Nextcloud ≥ 26, it is not necessary to patch the database files to prevent # an automatic creation of the database user. environment.NC_setup_create_db_user = "false"; @@ -1316,34 +1317,33 @@ in }; }; - phpfpm-nextcloud = - { - # When upgrading the Nextcloud package, Nextcloud can report errors such as - # "The files of the app [all apps in /var/lib/nextcloud/apps] were not replaced correctly" - # Restarting phpfpm on Nextcloud package update fixes these issues (but this is a workaround). - restartTriggers = [ - webroot - overrideConfig - ]; - } - // lib.optionalAttrs requiresRuntimeSystemdCredentials { - serviceConfig.LoadCredential = runtimeSystemdCredentials; + phpfpm-nextcloud = { + # When upgrading the Nextcloud package, Nextcloud can report errors such as + # "The files of the app [all apps in /var/lib/nextcloud/apps] were not replaced correctly" + # Restarting phpfpm on Nextcloud package update fixes these issues (but this is a workaround). + restartTriggers = [ + webroot + overrideConfig + ]; + } + // lib.optionalAttrs requiresRuntimeSystemdCredentials { + serviceConfig.LoadCredential = runtimeSystemdCredentials; - # FIXME: We use a hack to make the credential files readable by the nextcloud - # user by copying them somewhere else and overriding CREDENTIALS_DIRECTORY - # for php. This is currently necessary as the unit runs as root. - serviceConfig.RuntimeDirectory = lib.mkForce "phpfpm phpfpm-nextcloud"; - preStart = '' - umask 0077 + # FIXME: We use a hack to make the credential files readable by the nextcloud + # user by copying them somewhere else and overriding CREDENTIALS_DIRECTORY + # for php. This is currently necessary as the unit runs as root. + serviceConfig.RuntimeDirectory = lib.mkForce "phpfpm phpfpm-nextcloud"; + preStart = '' + umask 0077 - # NOTE: Runtime directories for this service are currently preserved - # between restarts. - rm -rf /run/phpfpm-nextcloud/credentials/ - mkdir -p /run/phpfpm-nextcloud/credentials/ - cp "$CREDENTIALS_DIRECTORY"/* /run/phpfpm-nextcloud/credentials/ - chown -R nextcloud:nextcloud /run/phpfpm-nextcloud/credentials/ - ''; - }; + # NOTE: Runtime directories for this service are currently preserved + # between restarts. + rm -rf /run/phpfpm-nextcloud/credentials/ + mkdir -p /run/phpfpm-nextcloud/credentials/ + cp "$CREDENTIALS_DIRECTORY"/* /run/phpfpm-nextcloud/credentials/ + chown -R nextcloud:nextcloud /run/phpfpm-nextcloud/credentials/ + ''; + }; }; services.phpfpm = { diff --git a/nixos/modules/services/web-apps/nipap.nix b/nixos/modules/services/web-apps/nipap.nix index 8f7f9b26b835..cee7ea116adb 100644 --- a/nixos/modules/services/web-apps/nipap.nix +++ b/nixos/modules/services/web-apps/nipap.nix @@ -234,7 +234,8 @@ in after = [ "network.target" "systemd-tmpfiles-setup.service" - ] ++ lib.optional (cfg.settings.nipapd.db_host == "") "postgresql.target"; + ] + ++ lib.optional (cfg.settings.nipapd.db_host == "") "postgresql.target"; requires = lib.optional (cfg.settings.nipapd.db_host == "") "postgresql.target"; wantedBy = [ "multi-user.target" ]; preStart = lib.optionalString (cfg.settings.auth.default_backend == defaultAuthBackend) '' @@ -276,7 +277,8 @@ in after = [ "network.target" "systemd-tmpfiles-setup.service" - ] ++ lib.optional cfg.nipapd.enable "nipapd.service"; + ] + ++ lib.optional cfg.nipapd.enable "nipapd.service"; wantedBy = [ "multi-user.target" ]; environment = { PYTHONPATH = pkg.pythonPath; diff --git a/nixos/modules/services/web-apps/ocis.nix b/nixos/modules/services/web-apps/ocis.nix index bc17dabade7f..daf4d5647a2a 100644 --- a/nixos/modules/services/web-apps/ocis.nix +++ b/nixos/modules/services/web-apps/ocis.nix @@ -162,7 +162,8 @@ in OCIS_URL = cfg.url; OCIS_CONFIG_DIR = if (cfg.configDir == null) then "${cfg.stateDir}/config" else cfg.configDir; OCIS_BASE_DATA_PATH = cfg.stateDir; - } // cfg.environment; + } + // cfg.environment; serviceConfig = { Type = "simple"; ExecStart = "${lib.getExe cfg.package} server"; diff --git a/nixos/modules/services/web-apps/opencloud.nix b/nixos/modules/services/web-apps/opencloud.nix index 90820822d64e..21b3a139ea6a 100644 --- a/nixos/modules/services/web-apps/opencloud.nix +++ b/nixos/modules/services/web-apps/opencloud.nix @@ -150,7 +150,8 @@ in WEB_ASSET_CORE_PATH = "${cfg.webPackage}"; IDP_ASSET_PATH = "${cfg.idpWebPackage}/assets"; OC_CONFIG_DIR = "/etc/opencloud"; - } // cfg.environment; + } + // cfg.environment; commonServiceConfig = { EnvironmentFile = lib.optional (cfg.environmentFile != null) cfg.environmentFile; MemoryDenyWriteExecute = true; @@ -186,7 +187,8 @@ in serviceConfig = { Type = "oneshot"; ReadWritePaths = [ "/etc/opencloud" ]; - } // commonServiceConfig; + } + // commonServiceConfig; path = [ cfg.package ]; script = '' @@ -215,7 +217,8 @@ in Group = cfg.group; Restart = "always"; ReadWritePaths = [ cfg.stateDir ]; - } // commonServiceConfig; + } + // commonServiceConfig; restartTriggers = lib.mapAttrsToList ( name: _: config.environment.etc."opencloud/${name}.yaml".source diff --git a/nixos/modules/services/web-apps/openvscode-server.nix b/nixos/modules/services/web-apps/openvscode-server.nix index 0350d715c618..e315729b8153 100644 --- a/nixos/modules/services/web-apps/openvscode-server.nix +++ b/nixos/modules/services/web-apps/openvscode-server.nix @@ -178,38 +178,37 @@ in path = cfg.extraPackages; environment = cfg.extraEnvironment; serviceConfig = { - ExecStart = - '' - ${lib.getExe cfg.package} \ - --accept-server-license-terms \ - --host=${cfg.host} \ - --port=${toString cfg.port} \ - '' - + lib.optionalString (cfg.telemetryLevel != null) '' - --telemetry-level=${cfg.telemetryLevel} \ - '' - + lib.optionalString (cfg.withoutConnectionToken) '' - --without-connection-token \ - '' - + lib.optionalString (cfg.socketPath != null) '' - --socket-path=${cfg.socketPath} \ - '' - + lib.optionalString (cfg.userDataDir != null) '' - --user-data-dir=${cfg.userDataDir} \ - '' - + lib.optionalString (cfg.serverDataDir != null) '' - --server-data-dir=${cfg.serverDataDir} \ - '' - + lib.optionalString (cfg.extensionsDir != null) '' - --extensions-dir=${cfg.extensionsDir} \ - '' - + lib.optionalString (cfg.connectionToken != null) '' - --connection-token=${cfg.connectionToken} \ - '' - + lib.optionalString (cfg.connectionTokenFile != null) '' - --connection-token-file=${cfg.connectionTokenFile} \ - '' - + lib.escapeShellArgs cfg.extraArguments; + ExecStart = '' + ${lib.getExe cfg.package} \ + --accept-server-license-terms \ + --host=${cfg.host} \ + --port=${toString cfg.port} \ + '' + + lib.optionalString (cfg.telemetryLevel != null) '' + --telemetry-level=${cfg.telemetryLevel} \ + '' + + lib.optionalString (cfg.withoutConnectionToken) '' + --without-connection-token \ + '' + + lib.optionalString (cfg.socketPath != null) '' + --socket-path=${cfg.socketPath} \ + '' + + lib.optionalString (cfg.userDataDir != null) '' + --user-data-dir=${cfg.userDataDir} \ + '' + + lib.optionalString (cfg.serverDataDir != null) '' + --server-data-dir=${cfg.serverDataDir} \ + '' + + lib.optionalString (cfg.extensionsDir != null) '' + --extensions-dir=${cfg.extensionsDir} \ + '' + + lib.optionalString (cfg.connectionToken != null) '' + --connection-token=${cfg.connectionToken} \ + '' + + lib.optionalString (cfg.connectionTokenFile != null) '' + --connection-token-file=${cfg.connectionTokenFile} \ + '' + + lib.escapeShellArgs cfg.extraArguments; ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; RuntimeDirectory = cfg.user; User = cfg.user; diff --git a/nixos/modules/services/web-apps/outline.nix b/nixos/modules/services/web-apps/outline.nix index 8943f5242138..642f806b9763 100644 --- a/nixos/modules/services/web-apps/outline.nix +++ b/nixos/modules/services/web-apps/outline.nix @@ -632,10 +632,11 @@ in { description = "Outline wiki and knowledge base"; wantedBy = [ "multi-user.target" ]; - after = - [ "networking.target" ] - ++ lib.optional (cfg.databaseUrl == "local") "postgresql.target" - ++ lib.optional (cfg.redisUrl == "local") "redis-outline.service"; + after = [ + "networking.target" + ] + ++ lib.optional (cfg.databaseUrl == "local") "postgresql.target" + ++ lib.optional (cfg.redisUrl == "local") "redis-outline.service"; requires = lib.optional (cfg.databaseUrl == "local") "postgresql.target" ++ lib.optional (cfg.redisUrl == "local") "redis-outline.service"; diff --git a/nixos/modules/services/web-apps/part-db.nix b/nixos/modules/services/web-apps/part-db.nix index d296d25c7739..086cf8b31213 100644 --- a/nixos/modules/services/web-apps/part-db.nix +++ b/nixos/modules/services/web-apps/part-db.nix @@ -149,7 +149,8 @@ in "pm.min_spare_servers" = lib.mkDefault 2; "pm.max_spare_servers" = lib.mkDefault 4; "pm.max_requests" = lib.mkDefault 500; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; postgresql = mkIf cfg.enablePostgresql { diff --git a/nixos/modules/services/web-apps/peering-manager.nix b/nixos/modules/services/web-apps/peering-manager.nix index b912ccedc27c..148d285c8587 100644 --- a/nixos/modules/services/web-apps/peering-manager.nix +++ b/nixos/modules/services/web-apps/peering-manager.nix @@ -22,16 +22,15 @@ let pkg = (pkgs.peering-manager.overrideAttrs (old: { - postInstall = - '' - ln -s ${configFile} $out/opt/peering-manager/peering_manager/configuration.py - '' - + lib.optionalString cfg.enableLdap '' - ln -s ${cfg.ldapConfigPath} $out/opt/peering-manager/peering_manager/ldap_config.py - '' - + lib.optionalString cfg.enableOidc '' - ln -s ${cfg.oidcConfigPath} $out/opt/peering-manager/peering_manager/oidc_config.py - ''; + postInstall = '' + ln -s ${configFile} $out/opt/peering-manager/peering_manager/configuration.py + '' + + lib.optionalString cfg.enableLdap '' + ln -s ${cfg.ldapConfigPath} $out/opt/peering-manager/peering_manager/ldap_config.py + '' + + lib.optionalString cfg.enableOidc '' + ln -s ${cfg.oidcConfigPath} $out/opt/peering-manager/peering_manager/oidc_config.py + ''; })).override { inherit (cfg) plugins; @@ -200,15 +199,14 @@ in }; }; - extraConfig = - '' - with open("${cfg.secretKeyFile}", "r") as file: - SECRET_KEY = file.readline() - '' - + lib.optionalString (cfg.peeringdbApiKeyFile != null) '' - with open("${cfg.peeringdbApiKeyFile}", "r") as file: - PEERINGDB_API_KEY = file.readline() - ''; + extraConfig = '' + with open("${cfg.secretKeyFile}", "r") as file: + SECRET_KEY = file.readline() + '' + + lib.optionalString (cfg.peeringdbApiKeyFile != null) '' + with open("${cfg.peeringdbApiKeyFile}", "r") as file: + PEERINGDB_API_KEY = file.readline() + ''; plugins = ( ps: diff --git a/nixos/modules/services/web-apps/peertube.nix b/nixos/modules/services/web-apps/peertube.nix index d6074d1c6146..2afac3990f16 100644 --- a/nixos/modules/services/web-apps/peertube.nix +++ b/nixos/modules/services/web-apps/peertube.nix @@ -502,18 +502,20 @@ in MemoryDenyWriteExecute = true; # System Call Filtering SystemCallFilter = "~" + lib.concatStringsSep " " (systemCallsList ++ [ "@resources" ]); - } // cfgService; + } + // cfgService; }; systemd.services.peertube = { description = "PeerTube daemon"; - after = - [ "network.target" ] - ++ lib.optional cfg.redis.createLocally "redis-peertube.service" - ++ lib.optionals cfg.database.createLocally [ - "postgresql.target" - "peertube-init-db.service" - ]; + after = [ + "network.target" + ] + ++ lib.optional cfg.redis.createLocally "redis-peertube.service" + ++ lib.optionals cfg.database.createLocally [ + "postgresql.target" + "peertube-init-db.service" + ]; requires = lib.optional cfg.redis.createLocally "redis-peertube.service" ++ lib.optionals cfg.database.createLocally [ @@ -592,7 +594,8 @@ in "pipe" "pipe2" ]; - } // cfgService; + } + // cfgService; }; services.nginx = lib.mkIf cfg.configureNginx { @@ -613,24 +616,22 @@ in tryFiles = "/dev/null @api"; priority = 1120; - extraConfig = - '' - client_max_body_size 0; - proxy_request_buffering off; - '' - + nginxCommonHeaders; + extraConfig = '' + client_max_body_size 0; + proxy_request_buffering off; + '' + + nginxCommonHeaders; }; locations."~ ^/api/v1/users/[^/]+/imports/import-resumable$" = { tryFiles = "/dev/null @api"; priority = 1130; - extraConfig = - '' - client_max_body_size 0; - proxy_request_buffering off; - '' - + nginxCommonHeaders; + extraConfig = '' + client_max_body_size 0; + proxy_request_buffering off; + '' + + nginxCommonHeaders; }; locations."~ ^/api/v1/videos/(upload|([^/]+/studio/edit))$" = { @@ -638,14 +639,13 @@ in root = cfg.settings.storage.tmp; priority = 1140; - extraConfig = - '' - limit_except POST HEAD { deny all; } + extraConfig = '' + limit_except POST HEAD { deny all; } - client_max_body_size 12G; - add_header X-File-Maximum-Size 8G always; - '' - + nginxCommonHeaders; + client_max_body_size 12G; + add_header X-File-Maximum-Size 8G always; + '' + + nginxCommonHeaders; }; locations."~ ^/api/v1/runners/jobs/[^/]+/(update|success)$" = { @@ -653,45 +653,42 @@ in root = cfg.settings.storage.tmp; priority = 1150; - extraConfig = - '' - client_max_body_size 12G; - add_header X-File-Maximum-Size 8G always; - '' - + nginxCommonHeaders; + extraConfig = '' + client_max_body_size 12G; + add_header X-File-Maximum-Size 8G always; + '' + + nginxCommonHeaders; }; locations."~ ^/api/v1/(videos|video-playlists|video-channels|users/me)" = { tryFiles = "/dev/null @api"; priority = 1160; - extraConfig = - '' - client_max_body_size 6M; - add_header X-File-Maximum-Size 4M always; - '' - + nginxCommonHeaders; + extraConfig = '' + client_max_body_size 6M; + add_header X-File-Maximum-Size 4M always; + '' + + nginxCommonHeaders; }; locations."@api" = { proxyPass = "http://peertube"; priority = 1170; - extraConfig = - '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_connect_timeout 10m; + proxy_connect_timeout 10m; - proxy_send_timeout 10m; - proxy_read_timeout 10m; + proxy_send_timeout 10m; + proxy_read_timeout 10m; - client_max_body_size 100k; - send_timeout 10m; - '' - + nginxCommonHeaders; + client_max_body_size 100k; + send_timeout 10m; + '' + + nginxCommonHeaders; }; # Websocket @@ -718,17 +715,16 @@ in proxyPass = "http://peertube"; priority = 1240; - extraConfig = - '' - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + extraConfig = '' + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - '' - + nginxCommonHeaders; + '' + + nginxCommonHeaders; }; # Bypass PeerTube for performance reasons. @@ -743,67 +739,62 @@ in locations."~ ^/client/(.*\\.(js|css|png|svg|woff2|otf|ttf|woff|eot))$" = { alias = "${cfg.package}/client/dist/$1"; priority = 1320; - extraConfig = - '' - add_header Cache-Control 'public, max-age=604800, immutable'; - '' - + nginxCommonHeaders; + extraConfig = '' + add_header Cache-Control 'public, max-age=604800, immutable'; + '' + + nginxCommonHeaders; }; locations."^~ /download/" = { proxyPass = "http://peertube"; priority = 1410; - extraConfig = - '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_limit_rate 5M; - '' - + nginxCommonHeaders; + proxy_limit_rate 5M; + '' + + nginxCommonHeaders; }; locations."^~ /static/streaming-playlists/hls/private/" = { proxyPass = "http://peertube"; priority = 1420; - extraConfig = - '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_limit_rate 5M; - '' - + nginxCommonHeaders; + proxy_limit_rate 5M; + '' + + nginxCommonHeaders; }; locations."^~ /static/web-videos/private/" = { proxyPass = "http://peertube"; priority = 1430; - extraConfig = - '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_limit_rate 5M; - '' - + nginxCommonHeaders; + proxy_limit_rate 5M; + '' + + nginxCommonHeaders; }; locations."^~ /static/webseed/private/" = { proxyPass = "http://peertube"; priority = 1440; - extraConfig = - '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_limit_rate 5M; - '' - + nginxCommonHeaders; + proxy_limit_rate 5M; + '' + + nginxCommonHeaders; }; locations."^~ /static/redundancy/" = { diff --git a/nixos/modules/services/web-apps/photoprism.nix b/nixos/modules/services/web-apps/photoprism.nix index 744a34db8b54..cb10d64bed7e 100644 --- a/nixos/modules/services/web-apps/photoprism.nix +++ b/nixos/modules/services/web-apps/photoprism.nix @@ -13,7 +13,8 @@ let PHOTOPRISM_IMPORT_PATH = cfg.importPath; PHOTOPRISM_HTTP_HOST = cfg.address; PHOTOPRISM_HTTP_PORT = toString cfg.port; - } // (lib.mapAttrs (_: toString) cfg.settings); + } + // (lib.mapAttrs (_: toString) cfg.settings); manage = pkgs.writeShellScript "manage" '' set -o allexport # Export the following env vars diff --git a/nixos/modules/services/web-apps/pixelfed.nix b/nixos/modules/services/web-apps/pixelfed.nix index c20947aa6f87..11643725e3b7 100644 --- a/nixos/modules/services/web-apps/pixelfed.nix +++ b/nixos/modules/services/web-apps/pixelfed.nix @@ -346,17 +346,17 @@ in "listen.group" = group; "listen.mode" = "0660"; "catch_workers_output" = "yes"; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; systemd.services.phpfpm-pixelfed.after = [ "pixelfed-data-setup.service" ]; - systemd.services.phpfpm-pixelfed.requires = - [ - "pixelfed-horizon.service" - "pixelfed-data-setup.service" - ] - ++ lib.optional cfg.database.createLocally dbUnit - ++ lib.optional cfg.redis.createLocally redisService; + systemd.services.phpfpm-pixelfed.requires = [ + "pixelfed-horizon.service" + "pixelfed-data-setup.service" + ] + ++ lib.optional cfg.database.createLocally dbUnit + ++ lib.optional cfg.redis.createLocally redisService; # Ensure image optimizations programs are available. systemd.services.phpfpm-pixelfed.path = extraPrograms; @@ -366,10 +366,11 @@ in "network.target" "pixelfed-data-setup.service" ]; - requires = - [ "pixelfed-data-setup.service" ] - ++ (lib.optional cfg.database.createLocally dbUnit) - ++ (lib.optional cfg.redis.createLocally redisService); + requires = [ + "pixelfed-data-setup.service" + ] + ++ (lib.optional cfg.database.createLocally dbUnit) + ++ (lib.optional cfg.redis.createLocally redisService); wantedBy = [ "multi-user.target" ]; # Ensure image optimizations programs are available. path = extraPrograms; diff --git a/nixos/modules/services/web-apps/plausible.nix b/nixos/modules/services/web-apps/plausible.nix index 2da839687f13..8e9f6aace6ab 100644 --- a/nixos/modules/services/web-apps/plausible.nix +++ b/nixos/modules/services/web-apps/plausible.nix @@ -206,67 +206,66 @@ in "plausible-postgres.service" ]; - environment = - { - # NixOS specific option to avoid that it's trying to write into its store-path. - # See also https://github.com/lau/tzdata#data-directory-and-releases - STORAGE_DIR = "/var/lib/plausible/elixir_tzdata"; + environment = { + # NixOS specific option to avoid that it's trying to write into its store-path. + # See also https://github.com/lau/tzdata#data-directory-and-releases + STORAGE_DIR = "/var/lib/plausible/elixir_tzdata"; - # Configuration options from - # https://plausible.io/docs/self-hosting-configuration - PORT = toString cfg.server.port; - LISTEN_IP = cfg.server.listenAddress; + # Configuration options from + # https://plausible.io/docs/self-hosting-configuration + PORT = toString cfg.server.port; + LISTEN_IP = cfg.server.listenAddress; - # Note [plausible-needs-no-erlang-distributed-features]: - # Plausible does not use, and does not plan to use, any of - # Erlang's distributed features, see: - # https://github.com/plausible/analytics/pull/1190#issuecomment-1018820934 - # Thus, disable distribution for improved simplicity and security: - # - # When distribution is enabled, - # Elixir spawns the Erlang VM, which will listen by default on all - # interfaces for messages between Erlang nodes (capable of - # remote code execution); it can be protected by a cookie; see - # https://erlang.org/doc/reference_manual/distributed.html#security). - # - # It would be possible to restrict the interface to one of our choice - # (e.g. localhost or a VPN IP) similar to how we do it with `listenAddress` - # for the Plausible web server; if distribution is ever needed in the future, - # https://github.com/NixOS/nixpkgs/pull/130297 shows how to do it. - # - # But since Plausible does not use this feature in any way, - # we just disable it. - RELEASE_DISTRIBUTION = "none"; - # Additional safeguard, in case `RELEASE_DISTRIBUTION=none` ever - # stops disabling the start of EPMD. - ERL_EPMD_ADDRESS = "127.0.0.1"; + # Note [plausible-needs-no-erlang-distributed-features]: + # Plausible does not use, and does not plan to use, any of + # Erlang's distributed features, see: + # https://github.com/plausible/analytics/pull/1190#issuecomment-1018820934 + # Thus, disable distribution for improved simplicity and security: + # + # When distribution is enabled, + # Elixir spawns the Erlang VM, which will listen by default on all + # interfaces for messages between Erlang nodes (capable of + # remote code execution); it can be protected by a cookie; see + # https://erlang.org/doc/reference_manual/distributed.html#security). + # + # It would be possible to restrict the interface to one of our choice + # (e.g. localhost or a VPN IP) similar to how we do it with `listenAddress` + # for the Plausible web server; if distribution is ever needed in the future, + # https://github.com/NixOS/nixpkgs/pull/130297 shows how to do it. + # + # But since Plausible does not use this feature in any way, + # we just disable it. + RELEASE_DISTRIBUTION = "none"; + # Additional safeguard, in case `RELEASE_DISTRIBUTION=none` ever + # stops disabling the start of EPMD. + ERL_EPMD_ADDRESS = "127.0.0.1"; - DISABLE_REGISTRATION = - if isBool cfg.server.disableRegistration then - boolToString cfg.server.disableRegistration - else - cfg.server.disableRegistration; + DISABLE_REGISTRATION = + if isBool cfg.server.disableRegistration then + boolToString cfg.server.disableRegistration + else + cfg.server.disableRegistration; - RELEASE_TMP = "/var/lib/plausible/tmp"; - # Home is needed to connect to the node with iex - HOME = "/var/lib/plausible"; + RELEASE_TMP = "/var/lib/plausible/tmp"; + # Home is needed to connect to the node with iex + HOME = "/var/lib/plausible"; - DATABASE_URL = "postgresql:///${cfg.database.postgres.dbname}?host=${cfg.database.postgres.socket}"; - CLICKHOUSE_DATABASE_URL = cfg.database.clickhouse.url; + DATABASE_URL = "postgresql:///${cfg.database.postgres.dbname}?host=${cfg.database.postgres.socket}"; + CLICKHOUSE_DATABASE_URL = cfg.database.clickhouse.url; - BASE_URL = cfg.server.baseUrl; + BASE_URL = cfg.server.baseUrl; - MAILER_EMAIL = cfg.mail.email; - SMTP_HOST_ADDR = cfg.mail.smtp.hostAddr; - SMTP_HOST_PORT = toString cfg.mail.smtp.hostPort; - SMTP_RETRIES = toString cfg.mail.smtp.retries; - SMTP_HOST_SSL_ENABLED = boolToString cfg.mail.smtp.enableSSL; + MAILER_EMAIL = cfg.mail.email; + SMTP_HOST_ADDR = cfg.mail.smtp.hostAddr; + SMTP_HOST_PORT = toString cfg.mail.smtp.hostPort; + SMTP_RETRIES = toString cfg.mail.smtp.retries; + SMTP_HOST_SSL_ENABLED = boolToString cfg.mail.smtp.enableSSL; - SELFHOST = "true"; - } - // (optionalAttrs (cfg.mail.smtp.user != null) { - SMTP_USER_NAME = cfg.mail.smtp.user; - }); + SELFHOST = "true"; + } + // (optionalAttrs (cfg.mail.smtp.user != null) { + SMTP_USER_NAME = cfg.mail.smtp.user; + }); path = [ cfg.package ] ++ optional cfg.database.postgres.setup config.services.postgresql.package; script = '' @@ -296,13 +295,12 @@ in PrivateTmp = true; WorkingDirectory = "/var/lib/plausible"; StateDirectory = "plausible"; - LoadCredential = - [ - "SECRET_KEY_BASE:${cfg.server.secretKeybaseFile}" - ] - ++ lib.optionals (cfg.mail.smtp.passwordFile != null) [ - "SMTP_USER_PWD:${cfg.mail.smtp.passwordFile}" - ]; + LoadCredential = [ + "SECRET_KEY_BASE:${cfg.server.secretKeybaseFile}" + ] + ++ lib.optionals (cfg.mail.smtp.passwordFile != null) [ + "SMTP_USER_PWD:${cfg.mail.smtp.passwordFile}" + ]; }; }; } diff --git a/nixos/modules/services/web-apps/powerdns-admin.nix b/nixos/modules/services/web-apps/powerdns-admin.nix index e142711555ca..e990807d00b4 100644 --- a/nixos/modules/services/web-apps/powerdns-admin.nix +++ b/nixos/modules/services/web-apps/powerdns-admin.nix @@ -10,18 +10,17 @@ with lib; let cfg = config.services.powerdns-admin; - configText = - '' - ${cfg.config} - '' - + optionalString (cfg.secretKeyFile != null) '' - with open('${cfg.secretKeyFile}') as file: - SECRET_KEY = file.read() - '' - + optionalString (cfg.saltFile != null) '' - with open('${cfg.saltFile}') as file: - SALT = file.read() - ''; + configText = '' + ${cfg.config} + '' + + optionalString (cfg.secretKeyFile != null) '' + with open('${cfg.secretKeyFile}') as file: + SECRET_KEY = file.read() + '' + + optionalString (cfg.saltFile != null) '' + with open('${cfg.saltFile}') as file: + SALT = file.read() + ''; in { options.services.powerdns-admin = { @@ -100,16 +99,15 @@ in User = "powerdnsadmin"; Group = "powerdnsadmin"; - BindReadOnlyPaths = - [ - "/nix/store" - "-/etc/resolv.conf" - "-/etc/nsswitch.conf" - "-/etc/hosts" - "-/etc/localtime" - ] - ++ (optional (cfg.secretKeyFile != null) cfg.secretKeyFile) - ++ (optional (cfg.saltFile != null) cfg.saltFile); + BindReadOnlyPaths = [ + "/nix/store" + "-/etc/resolv.conf" + "-/etc/nsswitch.conf" + "-/etc/hosts" + "-/etc/localtime" + ] + ++ (optional (cfg.secretKeyFile != null) cfg.secretKeyFile) + ++ (optional (cfg.saltFile != null) cfg.saltFile); # ProtectClock= adds DeviceAllow=char-rtc r DeviceAllow = ""; # Implies ProtectSystem=strict, which re-mounts all paths diff --git a/nixos/modules/services/web-apps/pretalx.nix b/nixos/modules/services/web-apps/pretalx.nix index 4a995e6e395f..652bccf287f3 100644 --- a/nixos/modules/services/web-apps/pretalx.nix +++ b/nixos/modules/services/web-apps/pretalx.nix @@ -428,17 +428,16 @@ in { pretalx-web = lib.recursiveUpdate commonUnitConfig { description = "pretalx web service"; - after = - [ - "network.target" - "redis-pretalx.service" - ] - ++ lib.optionals (cfg.settings.database.backend == "postgresql") [ - "postgresql.target" - ] - ++ lib.optionals (cfg.settings.database.backend == "mysql") [ - "mysql.service" - ]; + after = [ + "network.target" + "redis-pretalx.service" + ] + ++ lib.optionals (cfg.settings.database.backend == "postgresql") [ + "postgresql.target" + ] + ++ lib.optionals (cfg.settings.database.backend == "mysql") [ + "mysql.service" + ]; wantedBy = [ "multi-user.target" ]; preStart = '' versionFile="${cfg.settings.filesystem.data}/.version" @@ -478,17 +477,16 @@ in pretalx-worker = lib.mkIf cfg.celery.enable ( lib.recursiveUpdate commonUnitConfig { description = "pretalx asynchronous job runner"; - after = - [ - "network.target" - "redis-pretalx.service" - ] - ++ lib.optionals (cfg.settings.database.backend == "postgresql") [ - "postgresql.target" - ] - ++ lib.optionals (cfg.settings.database.backend == "mysql") [ - "mysql.service" - ]; + after = [ + "network.target" + "redis-pretalx.service" + ] + ++ lib.optionals (cfg.settings.database.backend == "postgresql") [ + "postgresql.target" + ] + ++ lib.optionals (cfg.settings.database.backend == "mysql") [ + "mysql.service" + ]; wantedBy = [ "multi-user.target" ]; serviceConfig.ExecStart = "${lib.getExe' pythonEnv "celery"} -A pretalx.celery_app worker ${cfg.celery.extraArgs}"; } diff --git a/nixos/modules/services/web-apps/reposilite.nix b/nixos/modules/services/web-apps/reposilite.nix index 469a1d83e030..6d16760987a6 100644 --- a/nixos/modules/services/web-apps/reposilite.nix +++ b/nixos/modules/services/web-apps/reposilite.nix @@ -395,10 +395,11 @@ in systemd.services.reposilite = { enable = true; wantedBy = [ "multi-user.target" ]; - after = - [ "network.target" ] - ++ (lib.optional useMySQL "mysql.service") - ++ (lib.optional usePostgres "postgresql.target"); + after = [ + "network.target" + ] + ++ (lib.optional useMySQL "mysql.service") + ++ (lib.optional usePostgres "postgresql.target"); script = lib.optionalString (cfg.keyPasswordFile != null && cfg.settings.keyPassword == null) '' diff --git a/nixos/modules/services/web-apps/screego.nix b/nixos/modules/services/web-apps/screego.nix index f692c7ff7958..68a9224ded22 100644 --- a/nixos/modules/services/web-apps/screego.nix +++ b/nixos/modules/services/web-apps/screego.nix @@ -90,7 +90,8 @@ in ExecStart = "${lib.getExe pkgs.screego} serve"; Restart = "on-failure"; RestartSec = "5s"; - } // lib.optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = cfg.environmentFile; }; + } + // lib.optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = cfg.environmentFile; }; }; }; } diff --git a/nixos/modules/services/web-apps/shiori.nix b/nixos/modules/services/web-apps/shiori.nix index 5f38703558c8..93e4f6421c60 100644 --- a/nixos/modules/services/web-apps/shiori.nix +++ b/nixos/modules/services/web-apps/shiori.nix @@ -65,13 +65,12 @@ in "postgresql.target" "mysql.service" ]; - environment = - { - SHIORI_DIR = "/var/lib/shiori"; - } - // lib.optionalAttrs (cfg.databaseUrl != null) { - SHIORI_DATABASE_URL = cfg.databaseUrl; - }; + environment = { + SHIORI_DIR = "/var/lib/shiori"; + } + // lib.optionalAttrs (cfg.databaseUrl != null) { + SHIORI_DATABASE_URL = cfg.databaseUrl; + }; serviceConfig = { ExecStart = "${cfg.package}/bin/shiori server --address '${cfg.address}' --port '${toString cfg.port}' --webroot '${cfg.webRoot}'"; @@ -83,23 +82,22 @@ in # Security options EnvironmentFile = lib.optional (cfg.environmentFile != null) cfg.environmentFile; - BindReadOnlyPaths = - [ - "/nix/store" + BindReadOnlyPaths = [ + "/nix/store" - # For SSL certificates, and the resolv.conf - "/etc" - ] - ++ lib.optional ( - config.services.postgresql.enable - && cfg.databaseUrl != null - && lib.strings.hasPrefix "postgres://" cfg.databaseUrl - ) "/run/postgresql" - ++ lib.optional ( - config.services.mysql.enable - && cfg.databaseUrl != null - && lib.strings.hasPrefix "mysql://" cfg.databaseUrl - ) "/var/run/mysqld"; + # For SSL certificates, and the resolv.conf + "/etc" + ] + ++ lib.optional ( + config.services.postgresql.enable + && cfg.databaseUrl != null + && lib.strings.hasPrefix "postgres://" cfg.databaseUrl + ) "/run/postgresql" + ++ lib.optional ( + config.services.mysql.enable + && cfg.databaseUrl != null + && lib.strings.hasPrefix "mysql://" cfg.databaseUrl + ) "/var/run/mysqld"; CapabilityBoundingSet = ""; diff --git a/nixos/modules/services/web-apps/snipe-it.nix b/nixos/modules/services/web-apps/snipe-it.nix index 66e1e1266881..7b8f55b55c9d 100644 --- a/nixos/modules/services/web-apps/snipe-it.nix +++ b/nixos/modules/services/web-apps/snipe-it.nix @@ -387,7 +387,8 @@ in "listen.mode" = "0660"; "listen.owner" = user; "listen.group" = group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; services.nginx = { diff --git a/nixos/modules/services/web-apps/tt-rss.nix b/nixos/modules/services/web-apps/tt-rss.nix index acc114ea1626..c937e69b9c76 100644 --- a/nixos/modules/services/web-apps/tt-rss.nix +++ b/nixos/modules/services/web-apps/tt-rss.nix @@ -668,10 +668,11 @@ in wantedBy = [ "multi-user.target" ]; requires = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.target"; - after = - [ "network.target" ] - ++ optional mysqlLocal "mysql.service" - ++ optional pgsqlLocal "postgresql.target"; + after = [ + "network.target" + ] + ++ optional mysqlLocal "mysql.service" + ++ optional pgsqlLocal "postgresql.target"; }; }; diff --git a/nixos/modules/services/web-apps/vikunja.nix b/nixos/modules/services/web-apps/vikunja.nix index 9cf06e0f1568..c273cccff1e5 100644 --- a/nixos/modules/services/web-apps/vikunja.nix +++ b/nixos/modules/services/web-apps/vikunja.nix @@ -115,10 +115,11 @@ in systemd.services.vikunja = { description = "vikunja"; - after = - [ "network.target" ] - ++ lib.optional usePostgresql "postgresql.target" - ++ lib.optional useMysql "mysql.service"; + after = [ + "network.target" + ] + ++ lib.optional usePostgresql "postgresql.target" + ++ lib.optional useMysql "mysql.service"; wantedBy = [ "multi-user.target" ]; path = [ cfg.package ]; restartTriggers = [ configFile ]; diff --git a/nixos/modules/services/web-apps/wakapi.nix b/nixos/modules/services/web-apps/wakapi.nix index 67f2761b5e53..6634e4894546 100644 --- a/nixos/modules/services/web-apps/wakapi.nix +++ b/nixos/modules/services/web-apps/wakapi.nix @@ -135,10 +135,12 @@ in description = "Wakapi (self-hosted WakaTime-compatible backend)"; wants = [ "network-online.target" - ] ++ optional (cfg.database.dialect == "postgres") "postgresql.target"; + ] + ++ optional (cfg.database.dialect == "postgres") "postgresql.target"; after = [ "network-online.target" - ] ++ optional (cfg.database.dialect == "postgres") "postgresql.target"; + ] + ++ optional (cfg.database.dialect == "postgres") "postgresql.target"; wantedBy = [ "multi-user.target" ]; script = '' diff --git a/nixos/modules/services/web-apps/weblate.nix b/nixos/modules/services/web-apps/weblate.nix index 1af45a29cbf8..17c470ffaf99 100644 --- a/nixos/modules/services/web-apps/weblate.nix +++ b/nixos/modules/services/web-apps/weblate.nix @@ -31,85 +31,84 @@ let }; # This extends and overrides the weblate/settings_example.py code found in upstream. - weblateConfig = - '' - # This was autogenerated by the NixOS module. + weblateConfig = '' + # This was autogenerated by the NixOS module. - SITE_TITLE = "Weblate" - SITE_DOMAIN = "${cfg.localDomain}" - # TLS terminates at the reverse proxy, but this setting controls how links to weblate are generated. - ENABLE_HTTPS = True - SESSION_COOKIE_SECURE = ENABLE_HTTPS - DATA_DIR = "${dataDir}" - CACHE_DIR = f"{DATA_DIR}/cache" - STATIC_ROOT = "${finalPackage.static}" - MEDIA_ROOT = "/var/lib/weblate/media" - COMPRESS_ROOT = "${finalPackage.static}" - COMPRESS_OFFLINE = True - DEBUG = False + SITE_TITLE = "Weblate" + SITE_DOMAIN = "${cfg.localDomain}" + # TLS terminates at the reverse proxy, but this setting controls how links to weblate are generated. + ENABLE_HTTPS = True + SESSION_COOKIE_SECURE = ENABLE_HTTPS + DATA_DIR = "${dataDir}" + CACHE_DIR = f"{DATA_DIR}/cache" + STATIC_ROOT = "${finalPackage.static}" + MEDIA_ROOT = "/var/lib/weblate/media" + COMPRESS_ROOT = "${finalPackage.static}" + COMPRESS_OFFLINE = True + DEBUG = False - with open("${cfg.djangoSecretKeyFile}") as f: - SECRET_KEY = f.read().rstrip("\n") + with open("${cfg.djangoSecretKeyFile}") as f: + SECRET_KEY = f.read().rstrip("\n") - CACHES = { - "default": { - "BACKEND": "django_redis.cache.RedisCache", - "LOCATION": "unix://${config.services.redis.servers.weblate.unixSocket}", - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - "PASSWORD": None, - "CONNECTION_POOL_KWARGS": {}, - }, - "KEY_PREFIX": "weblate", - "TIMEOUT": 3600, + CACHES = { + "default": { + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "unix://${config.services.redis.servers.weblate.unixSocket}", + "OPTIONS": { + "CLIENT_CLASS": "django_redis.client.DefaultClient", + "PASSWORD": None, + "CONNECTION_POOL_KWARGS": {}, }, - "avatar": { - "BACKEND": "django.core.cache.backends.filebased.FileBasedCache", - "LOCATION": "/var/lib/weblate/avatar-cache", - "TIMEOUT": 86400, - "OPTIONS": {"MAX_ENTRIES": 1000}, - } + "KEY_PREFIX": "weblate", + "TIMEOUT": 3600, + }, + "avatar": { + "BACKEND": "django.core.cache.backends.filebased.FileBasedCache", + "LOCATION": "/var/lib/weblate/avatar-cache", + "TIMEOUT": 86400, + "OPTIONS": {"MAX_ENTRIES": 1000}, } + } - CELERY_TASK_ALWAYS_EAGER = False - CELERY_BROKER_URL = "redis+socket://${config.services.redis.servers.weblate.unixSocket}" - CELERY_RESULT_BACKEND = CELERY_BROKER_URL + CELERY_TASK_ALWAYS_EAGER = False + CELERY_BROKER_URL = "redis+socket://${config.services.redis.servers.weblate.unixSocket}" + CELERY_RESULT_BACKEND = CELERY_BROKER_URL - VCS_BACKENDS = ("weblate.vcs.git.GitRepository",) + VCS_BACKENDS = ("weblate.vcs.git.GitRepository",) - SITE_URL = "https://{}".format(SITE_DOMAIN) + SITE_URL = "https://{}".format(SITE_DOMAIN) - # WebAuthn - OTP_WEBAUTHN_RP_NAME = SITE_TITLE - OTP_WEBAUTHN_RP_ID = SITE_DOMAIN.split(":")[0] - OTP_WEBAUTHN_ALLOWED_ORIGINS = [SITE_URL] - '' - + lib.optionalString cfg.configurePostgresql '' - DATABASES = { - "default": { - "ENGINE": "django.db.backends.postgresql", - "HOST": "/run/postgresql", - "NAME": "weblate", - "USER": "weblate", - } + # WebAuthn + OTP_WEBAUTHN_RP_NAME = SITE_TITLE + OTP_WEBAUTHN_RP_ID = SITE_DOMAIN.split(":")[0] + OTP_WEBAUTHN_ALLOWED_ORIGINS = [SITE_URL] + '' + + lib.optionalString cfg.configurePostgresql '' + DATABASES = { + "default": { + "ENGINE": "django.db.backends.postgresql", + "HOST": "/run/postgresql", + "NAME": "weblate", + "USER": "weblate", } - '' - + lib.optionalString cfg.smtp.enable '' - EMAIL_HOST = "${cfg.smtp.host}" - EMAIL_USE_TLS = True - EMAIL_PORT = ${builtins.toString cfg.smtp.port} - SERVER_EMAIL = "${cfg.smtp.from}" - DEFAULT_FROM_EMAIL = "${cfg.smtp.from}" - '' - + lib.optionalString (cfg.smtp.enable && cfg.smtp.user != null) '' - ADMINS = (("Weblate Admin", "${cfg.smtp.user}"),) - EMAIL_HOST_USER = "${cfg.smtp.user}" - '' - + lib.optionalString (cfg.smtp.enable && cfg.smtp.passwordFile != null) '' - with open("${cfg.smtp.passwordFile}") as f: - EMAIL_HOST_PASSWORD = f.read().rstrip("\n") - '' - + cfg.extraConfig; + } + '' + + lib.optionalString cfg.smtp.enable '' + EMAIL_HOST = "${cfg.smtp.host}" + EMAIL_USE_TLS = True + EMAIL_PORT = ${builtins.toString cfg.smtp.port} + SERVER_EMAIL = "${cfg.smtp.from}" + DEFAULT_FROM_EMAIL = "${cfg.smtp.from}" + '' + + lib.optionalString (cfg.smtp.enable && cfg.smtp.user != null) '' + ADMINS = (("Weblate Admin", "${cfg.smtp.user}"),) + EMAIL_HOST_USER = "${cfg.smtp.user}" + '' + + lib.optionalString (cfg.smtp.enable && cfg.smtp.passwordFile != null) '' + with open("${cfg.smtp.passwordFile}") as f: + EMAIL_HOST_PASSWORD = f.read().rstrip("\n") + '' + + cfg.extraConfig; settings_py = pkgs.runCommand "weblate_settings.py" { diff --git a/nixos/modules/services/web-apps/windmill.nix b/nixos/modules/services/web-apps/windmill.nix index a588adf0f77b..80d246a9c6b2 100644 --- a/nixos/modules/services/web-apps/windmill.nix +++ b/nixos/modules/services/web-apps/windmill.nix @@ -107,20 +107,19 @@ in systemd.services = let useUrlPath = (cfg.database.urlPath != null); - serviceConfig = - { - DynamicUser = true; - # using the same user to simplify db connection - User = cfg.database.user; - ExecStart = "${pkgs.windmill}/bin/windmill"; + serviceConfig = { + DynamicUser = true; + # using the same user to simplify db connection + User = cfg.database.user; + ExecStart = "${pkgs.windmill}/bin/windmill"; - Restart = "always"; - } - // lib.optionalAttrs useUrlPath { - LoadCredential = [ - "DATABASE_URL_FILE:${cfg.database.urlPath}" - ]; - }; + Restart = "always"; + } + // lib.optionalAttrs useUrlPath { + LoadCredential = [ + "DATABASE_URL_FILE:${cfg.database.urlPath}" + ]; + }; db_url_envs = lib.optionalAttrs useUrlPath { DATABASE_URL_FILE = "%d/DATABASE_URL_FILE"; @@ -176,7 +175,8 @@ in WM_BASE_URL = cfg.baseUrl; RUST_LOG = cfg.logLevel; MODE = "server"; - } // db_url_envs; + } + // db_url_envs; }; windmill-worker = { @@ -194,7 +194,8 @@ in MODE = "worker"; WORKER_GROUP = "default"; KEEP_JOB_DIR = "false"; - } // db_url_envs; + } + // db_url_envs; }; windmill-worker-native = { @@ -211,7 +212,8 @@ in RUST_LOG = cfg.logLevel; MODE = "worker"; WORKER_GROUP = "native"; - } // db_url_envs; + } + // db_url_envs; }; }; }; diff --git a/nixos/modules/services/web-apps/wordpress.nix b/nixos/modules/services/web-apps/wordpress.nix index cb925cac232a..dfe6e26c2a13 100644 --- a/nixos/modules/services/web-apps/wordpress.nix +++ b/nixos/modules/services/web-apps/wordpress.nix @@ -473,7 +473,8 @@ in settings = { "listen.owner" = webserver.user; "listen.group" = webserver.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }) ) eachSite; diff --git a/nixos/modules/services/web-apps/writefreely.nix b/nixos/modules/services/web-apps/writefreely.nix index be032d34d993..ce3ea822d0ed 100644 --- a/nixos/modules/services/web-apps/writefreely.nix +++ b/nixos/modules/services/web-apps/writefreely.nix @@ -354,11 +354,12 @@ in }; systemd.services.writefreely = { - after = - [ "network.target" ] - ++ optional isSqlite "writefreely-sqlite-init.service" - ++ optional isMysql "writefreely-mysql-init.service" - ++ optional isMysqlLocal "mysql.service"; + after = [ + "network.target" + ] + ++ optional isSqlite "writefreely-sqlite-init.service" + ++ optional isMysql "writefreely-mysql-init.service" + ++ optional isMysqlLocal "mysql.service"; wantedBy = [ "multi-user.target" ]; serviceConfig = { diff --git a/nixos/modules/services/web-apps/zabbix.nix b/nixos/modules/services/web-apps/zabbix.nix index 5c9a5865e759..8076361440d7 100644 --- a/nixos/modules/services/web-apps/zabbix.nix +++ b/nixos/modules/services/web-apps/zabbix.nix @@ -267,45 +267,46 @@ in $DB['DOUBLE_IEEE754'] = 'true'; ''; - systemd.tmpfiles.rules = - [ "d '${stateDir}' 0750 ${user} ${group} - -" ] - ++ optionals (cfg.frontend == "httpd") [ - "d '${stateDir}/session' 0750 ${user} ${config.services.httpd.group} - -" - ] - ++ optionals (cfg.frontend == "nginx") [ - "d '${stateDir}/session' 0750 ${user} ${config.services.nginx.group} - -" - ]; + systemd.tmpfiles.rules = [ + "d '${stateDir}' 0750 ${user} ${group} - -" + ] + ++ optionals (cfg.frontend == "httpd") [ + "d '${stateDir}/session' 0750 ${user} ${config.services.httpd.group} - -" + ] + ++ optionals (cfg.frontend == "nginx") [ + "d '${stateDir}/session' 0750 ${user} ${config.services.nginx.group} - -" + ]; services.phpfpm.pools.zabbix = { inherit user; group = config.services.${cfg.frontend}.group; - phpOptions = - '' - # https://www.zabbix.com/documentation/current/manual/installation/install - memory_limit = 128M - post_max_size = 16M - upload_max_filesize = 2M - max_execution_time = 300 - max_input_time = 300 - session.auto_start = 0 - mbstring.func_overload = 0 - always_populate_raw_post_data = -1 - # https://bbs.archlinux.org/viewtopic.php?pid=1745214#p1745214 - session.save_path = ${stateDir}/session - '' - + optionalString (config.time.timeZone != null) '' - date.timezone = "${config.time.timeZone}" - '' - + optionalString (cfg.database.type == "oracle") '' - extension=${pkgs.phpPackages.oci8}/lib/php/extensions/oci8.so - ''; + phpOptions = '' + # https://www.zabbix.com/documentation/current/manual/installation/install + memory_limit = 128M + post_max_size = 16M + upload_max_filesize = 2M + max_execution_time = 300 + max_input_time = 300 + session.auto_start = 0 + mbstring.func_overload = 0 + always_populate_raw_post_data = -1 + # https://bbs.archlinux.org/viewtopic.php?pid=1745214#p1745214 + session.save_path = ${stateDir}/session + '' + + optionalString (config.time.timeZone != null) '' + date.timezone = "${config.time.timeZone}" + '' + + optionalString (cfg.database.type == "oracle") '' + extension=${pkgs.phpPackages.oci8}/lib/php/extensions/oci8.so + ''; phpEnv.ZABBIX_CONFIG = "${zabbixConfig}"; settings = { "listen.owner" = if cfg.frontend == "httpd" then config.services.httpd.user else config.services.nginx.user; "listen.group" = if cfg.frontend == "httpd" then config.services.httpd.group else config.services.nginx.group; - } // cfg.poolConfig; + } + // cfg.poolConfig; }; services.httpd = mkIf (cfg.frontend == "httpd") { diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 0363b0ab6923..aa3ae96896d6 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -78,40 +78,39 @@ let enableUserDir = any (vhost: vhost.enableUserDir) vhosts; # NOTE: generally speaking order of modules is very important - modules = - [ - # required apache modules our httpd service cannot run without - "authn_core" - "authz_core" - "log_config" - "mime" - "autoindex" - "negotiation" - "dir" - "alias" - "rewrite" - "unixd" - "slotmem_shm" - "socache_shmcb" - "mpm_${cfg.mpm}" - ] - ++ (if cfg.mpm == "prefork" then [ "cgi" ] else [ "cgid" ]) - ++ optional enableHttp2 "http2" - ++ optional enableSSL "ssl" - ++ optional enableUserDir "userdir" - ++ optional cfg.enableMellon { - name = "auth_mellon"; - path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; - } - ++ optional cfg.enablePHP { - name = phpModuleName; - path = "${php}/modules/lib${phpModuleName}.so"; - } - ++ optional cfg.enablePerl { - name = "perl"; - path = "${mod_perl}/modules/mod_perl.so"; - } - ++ cfg.extraModules; + modules = [ + # required apache modules our httpd service cannot run without + "authn_core" + "authz_core" + "log_config" + "mime" + "autoindex" + "negotiation" + "dir" + "alias" + "rewrite" + "unixd" + "slotmem_shm" + "socache_shmcb" + "mpm_${cfg.mpm}" + ] + ++ (if cfg.mpm == "prefork" then [ "cgi" ] else [ "cgid" ]) + ++ optional enableHttp2 "http2" + ++ optional enableSSL "ssl" + ++ optional enableUserDir "userdir" + ++ optional cfg.enableMellon { + name = "auth_mellon"; + path = "${pkgs.apacheHttpdPackages.mod_auth_mellon}/modules/mod_auth_mellon.so"; + } + ++ optional cfg.enablePHP { + name = phpModuleName; + path = "${php}/modules/lib${phpModuleName}.so"; + } + ++ optional cfg.enablePerl { + name = "perl"; + path = "${mod_perl}/modules/mod_perl.so"; + } + ++ cfg.extraModules; loggingConf = ( if cfg.logFormat != "none" then @@ -742,51 +741,51 @@ in config = mkIf cfg.enable { - assertions = - [ - { - assertion = all (hostOpts: !hostOpts.enableSSL) vhosts; - message = '' - The option `services.httpd.virtualHosts..enableSSL` no longer has any effect; please remove it. - Select one of `services.httpd.virtualHosts..addSSL`, `services.httpd.virtualHosts..forceSSL`, - or `services.httpd.virtualHosts..onlySSL`. - ''; - } - { - assertion = all ( - hostOpts: with hostOpts; !(addSSL && onlySSL) && !(forceSSL && onlySSL) && !(addSSL && forceSSL) - ) vhosts; - message = '' - Options `services.httpd.virtualHosts..addSSL`, - `services.httpd.virtualHosts..onlySSL` and `services.httpd.virtualHosts..forceSSL` - are mutually exclusive. - ''; - } - { - assertion = all (hostOpts: !(hostOpts.enableACME && hostOpts.useACMEHost != null)) vhosts; - message = '' - Options `services.httpd.virtualHosts..enableACME` and - `services.httpd.virtualHosts..useACMEHost` are mutually exclusive. - ''; - } - { - assertion = cfg.enablePHP -> php.ztsSupport; - message = '' - The php package provided by `services.httpd.phpPackage` is not built with zts support. Please - ensure the php has zts support by settings `services.httpd.phpPackage = php.override { ztsSupport = true; }` - ''; - } - ] - ++ map ( - name: - mkCertOwnershipAssertion { - cert = config.security.acme.certs.${name}; - groups = config.users.groups; - services = [ - config.systemd.services.httpd - ] ++ lib.optional (vhostCertNames != [ ]) config.systemd.services.httpd-config-reload; - } - ) vhostCertNames; + assertions = [ + { + assertion = all (hostOpts: !hostOpts.enableSSL) vhosts; + message = '' + The option `services.httpd.virtualHosts..enableSSL` no longer has any effect; please remove it. + Select one of `services.httpd.virtualHosts..addSSL`, `services.httpd.virtualHosts..forceSSL`, + or `services.httpd.virtualHosts..onlySSL`. + ''; + } + { + assertion = all ( + hostOpts: with hostOpts; !(addSSL && onlySSL) && !(forceSSL && onlySSL) && !(addSSL && forceSSL) + ) vhosts; + message = '' + Options `services.httpd.virtualHosts..addSSL`, + `services.httpd.virtualHosts..onlySSL` and `services.httpd.virtualHosts..forceSSL` + are mutually exclusive. + ''; + } + { + assertion = all (hostOpts: !(hostOpts.enableACME && hostOpts.useACMEHost != null)) vhosts; + message = '' + Options `services.httpd.virtualHosts..enableACME` and + `services.httpd.virtualHosts..useACMEHost` are mutually exclusive. + ''; + } + { + assertion = cfg.enablePHP -> php.ztsSupport; + message = '' + The php package provided by `services.httpd.phpPackage` is not built with zts support. Please + ensure the php has zts support by settings `services.httpd.phpPackage = php.override { ztsSupport = true; }` + ''; + } + ] + ++ map ( + name: + mkCertOwnershipAssertion { + cert = config.security.acme.certs.${name}; + groups = config.users.groups; + services = [ + config.systemd.services.httpd + ] + ++ lib.optional (vhostCertNames != [ ]) config.systemd.services.httpd-config-reload; + } + ) vhostCertNames; warnings = mapAttrsToList (name: hostOpts: '' Using config.services.httpd.virtualHosts."${name}".servedFiles is deprecated and will become unsupported in a future release. Your configuration will continue to work as is but please migrate your configuration to config.services.httpd.virtualHosts."${name}".locations before the 20.09 release of NixOS. @@ -850,16 +849,15 @@ in }; }; - services.httpd.phpOptions = - '' - ; Don't advertise PHP - expose_php = off - '' - + optionalString (config.time.timeZone != null) '' + services.httpd.phpOptions = '' + ; Don't advertise PHP + expose_php = off + '' + + optionalString (config.time.timeZone != null) '' - ; Apparently PHP doesn't use $TZ. - date.timezone = "${config.time.timeZone}" - ''; + ; Apparently PHP doesn't use $TZ. + date.timezone = "${config.time.timeZone}" + ''; services.httpd.extraModules = mkBefore [ # HTTP authentication mechanisms: basic and digest. @@ -917,10 +915,11 @@ in description = "Apache HTTPD"; wantedBy = [ "multi-user.target" ]; wants = concatLists (map (certName: [ "acme-finished-${certName}.target" ]) vhostCertNames); - after = - [ "network.target" ] - ++ map (certName: "acme-selfsigned-${certName}.service") vhostCertNames - ++ map (certName: "acme-${certName}.service") independentCertNames; # avoid loading self-signed key w/ real cert, or vice-versa + after = [ + "network.target" + ] + ++ map (certName: "acme-selfsigned-${certName}.service") vhostCertNames + ++ map (certName: "acme-${certName}.service") independentCertNames; # avoid loading self-signed key w/ real cert, or vice-versa before = map (certName: "acme-${certName}.service") dependentCertNames; restartTriggers = [ cfg.configFile ]; diff --git a/nixos/modules/services/web-servers/caddy/default.nix b/nixos/modules/services/web-servers/caddy/default.nix index 9518e145c8c4..f9c50bca7210 100644 --- a/nixos/modules/services/web-servers/caddy/default.nix +++ b/nixos/modules/services/web-servers/caddy/default.nix @@ -381,21 +381,20 @@ in # implementation config = mkIf cfg.enable { - assertions = - [ - { - assertion = cfg.configFile == configFile -> cfg.adapter == "caddyfile" || cfg.adapter == null; - message = "To specify an adapter other than 'caddyfile' please provide your own configuration via `services.caddy.configFile`"; - } - ] - ++ map ( - name: - mkCertOwnershipAssertion { - cert = config.security.acme.certs.${name}; - groups = config.users.groups; - services = [ config.systemd.services.caddy ]; - } - ) vhostCertNames; + assertions = [ + { + assertion = cfg.configFile == configFile -> cfg.adapter == "caddyfile" || cfg.adapter == null; + message = "To specify an adapter other than 'caddyfile' please provide your own configuration via `services.caddy.configFile`"; + } + ] + ++ map ( + name: + mkCertOwnershipAssertion { + cert = config.security.acme.certs.${name}; + groups = config.users.groups; + services = [ config.systemd.services.caddy ]; + } + ) vhostCertNames; services.caddy.globalConfig = '' ${optionalString (cfg.email != null) "email ${cfg.email}"} @@ -440,7 +439,8 @@ in # Validating the configuration before applying it ensures we’ll get a proper error that will be reported when switching to the configuration ExecReload = [ "" - ] ++ lib.optional cfg.enableReload "${lib.getExe cfg.package} reload ${runOptions} --force"; + ] + ++ lib.optional cfg.enableReload "${lib.getExe cfg.package} reload ${runOptions} --force"; User = cfg.user; Group = cfg.group; ReadWritePaths = [ cfg.dataDir ]; diff --git a/nixos/modules/services/web-servers/fcgiwrap.nix b/nixos/modules/services/web-servers/fcgiwrap.nix index 6824938fe5a0..992f4a46ff4b 100644 --- a/nixos/modules/services/web-servers/fcgiwrap.nix +++ b/nixos/modules/services/web-servers/fcgiwrap.nix @@ -148,32 +148,31 @@ in after = [ "nss-user-lookup.target" ]; wantedBy = optional (cfg.socket.type != "unix") "multi-user.target"; - serviceConfig = - { - ExecStart = '' - ${pkgs.fcgiwrap}/sbin/fcgiwrap ${ - cli.toGNUCommandLineShell { } ( - { - c = cfg.process.prefork; - } - // (optionalAttrs (cfg.socket.type != "unix") { - s = "${cfg.socket.type}:${cfg.socket.address}"; - }) - ) - } - ''; - } - // ( - if cfg.process.user != null then - { - User = cfg.process.user; - Group = cfg.process.group; - } - else - { - DynamicUser = true; - } - ); + serviceConfig = { + ExecStart = '' + ${pkgs.fcgiwrap}/sbin/fcgiwrap ${ + cli.toGNUCommandLineShell { } ( + { + c = cfg.process.prefork; + } + // (optionalAttrs (cfg.socket.type != "unix") { + s = "${cfg.socket.type}:${cfg.socket.address}"; + }) + ) + } + ''; + } + // ( + if cfg.process.user != null then + { + User = cfg.process.user; + Group = cfg.process.group; + } + else + { + DynamicUser = true; + } + ); }); systemd.sockets = forEachInstance ( diff --git a/nixos/modules/services/web-servers/garage.nix b/nixos/modules/services/web-servers/garage.nix index 1783ca55184c..a71ba2378c44 100644 --- a/nixos/modules/services/web-servers/garage.nix +++ b/nixos/modules/services/web-servers/garage.nix @@ -120,7 +120,8 @@ in wantedBy = [ "multi-user.target" ]; restartTriggers = [ configFile - ] ++ (lib.optional (cfg.environmentFile != null) cfg.environmentFile); + ] + ++ (lib.optional (cfg.environmentFile != null) cfg.environmentFile); serviceConfig = let paths = lib.flatten ( @@ -149,7 +150,8 @@ in }; environment = { RUST_LOG = lib.mkDefault "garage=${cfg.logLevel}"; - } // cfg.extraEnvironment; + } + // cfg.extraEnvironment; }; }; } diff --git a/nixos/modules/services/web-servers/h2o/default.nix b/nixos/modules/services/web-servers/h2o/default.nix index 74928a2552e6..bd3b615ec9c8 100644 --- a/nixos/modules/services/web-servers/h2o/default.nix +++ b/nixos/modules/services/web-servers/h2o/default.nix @@ -231,16 +231,15 @@ let certificate-file = "${certs.${names.cert}.directory}/fullchain.pem"; }; - baseListen = - { - port = port.TLS; - ssl = (lib.recursiveUpdate tlsRecAttrs value.tls.extraSettings) // { - inherit identity; - }; - } - // lib.optionalAttrs (value.host != null) { - host = value.host; + baseListen = { + port = port.TLS; + ssl = (lib.recursiveUpdate tlsRecAttrs value.tls.extraSettings) // { + inherit identity; }; + } + // lib.optionalAttrs (value.host != null) { + host = value.host; + }; # QUIC, if used, will duplicate the TLS over TCP directive, but # append some extra QUIC-related settings @@ -381,55 +380,54 @@ in }; config = mkIf cfg.enable { - assertions = - [ - { - assertion = - !(builtins.hasAttr "hosts" h2oConfig) - || builtins.all ( - host: - let - hasKeyPlusCert = attrs: (attrs.key-file or "") != "" && (attrs.certificate-file or "") != ""; - in - # TLS not used - (lib.attrByPath [ "listen" "ssl" ] null host == null) - # TLS identity property - || ( - builtins.hasAttr "identity" host - && builtins.length host.identity > 0 - && builtins.all hasKeyPlusCert host.listen.ssl.identity - ) - # TLS short-hand (was manually specified) - || (hasKeyPlusCert host.listen.ssl) - ) (lib.attrValues h2oConfig.hosts); - message = '' - TLS support will require at least one non-empty certificate & key - file. Use services.h2o.hosts..acme.enable, - services.h2o.hosts..acme.useHost, - services.h2o.hosts..tls.identity, or - services.h2o.hosts..tls.extraSettings. - ''; - } - ] - ++ builtins.map ( - name: - mkCertOwnershipAssertion { - cert = certs.${name}; - groups = config.users.groups; - services = [ - config.systemd.services.h2o - ] ++ lib.optional (acmeCertNames.all != [ ]) config.systemd.services.h2o-config-reload; - } - ) acmeCertNames.all; + assertions = [ + { + assertion = + !(builtins.hasAttr "hosts" h2oConfig) + || builtins.all ( + host: + let + hasKeyPlusCert = attrs: (attrs.key-file or "") != "" && (attrs.certificate-file or "") != ""; + in + # TLS not used + (lib.attrByPath [ "listen" "ssl" ] null host == null) + # TLS identity property + || ( + builtins.hasAttr "identity" host + && builtins.length host.identity > 0 + && builtins.all hasKeyPlusCert host.listen.ssl.identity + ) + # TLS short-hand (was manually specified) + || (hasKeyPlusCert host.listen.ssl) + ) (lib.attrValues h2oConfig.hosts); + message = '' + TLS support will require at least one non-empty certificate & key + file. Use services.h2o.hosts..acme.enable, + services.h2o.hosts..acme.useHost, + services.h2o.hosts..tls.identity, or + services.h2o.hosts..tls.extraSettings. + ''; + } + ] + ++ builtins.map ( + name: + mkCertOwnershipAssertion { + cert = certs.${name}; + groups = config.users.groups; + services = [ + config.systemd.services.h2o + ] + ++ lib.optional (acmeCertNames.all != [ ]) config.systemd.services.h2o-config-reload; + } + ) acmeCertNames.all; users = { - users.${cfg.user} = - { - group = cfg.group; - } - // lib.optionalAttrs (cfg.user == "h2o") { - isSystemUser = true; - }; + users.${cfg.user} = { + group = cfg.group; + } + // lib.optionalAttrs (cfg.user == "h2o") { + isSystemUser = true; + }; groups.${cfg.group} = { }; }; @@ -439,10 +437,11 @@ in wants = lib.concatLists (map (certName: [ "acme-finished-${certName}.target" ]) acmeCertNames.all); # Since H2O will be hosting the challenges, H2O must be started before = builtins.map (certName: "acme-${certName}.service") acmeCertNames.dependent; - after = - [ "network.target" ] - ++ builtins.map (certName: "acme-selfsigned-${certName}.service") acmeCertNames.all - ++ builtins.map (certName: "acme-${certName}.service") acmeCertNames.independent; # avoid loading self-signed key w/ real cert, or vice-versa + after = [ + "network.target" + ] + ++ builtins.map (certName: "acme-selfsigned-${certName}.service") acmeCertNames.all + ++ builtins.map (certName: "acme-${certName}.service") acmeCertNames.independent; # avoid loading self-signed key w/ real cert, or vice-versa serviceConfig = { ExecStart = "${h2oExe} --mode 'master'"; diff --git a/nixos/modules/services/web-servers/hitch/default.nix b/nixos/modules/services/web-servers/hitch/default.nix index a5a536ff9917..baec5a34eb56 100644 --- a/nixos/modules/services/web-servers/hitch/default.nix +++ b/nixos/modules/services/web-servers/hitch/default.nix @@ -93,14 +93,13 @@ with lib; description = "Hitch"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - preStart = - '' - ${pkgs.hitch}/sbin/hitch -t --config ${hitchConfig} - '' - + (optionalString cfg.ocsp-stapling.enabled '' - mkdir -p ${ocspDir} - chown -R hitch:hitch ${ocspDir} - ''); + preStart = '' + ${pkgs.hitch}/sbin/hitch -t --config ${hitchConfig} + '' + + (optionalString cfg.ocsp-stapling.enabled '' + mkdir -p ${ocspDir} + chown -R hitch:hitch ${ocspDir} + ''); serviceConfig = { Type = "forking"; ExecStart = "${pkgs.hitch}/sbin/hitch --daemon --config ${hitchConfig}"; diff --git a/nixos/modules/services/web-servers/minio.nix b/nixos/modules/services/web-servers/minio.nix index ec31d06a3924..42f76ced850b 100644 --- a/nixos/modules/services/web-servers/minio.nix +++ b/nixos/modules/services/web-servers/minio.nix @@ -111,11 +111,10 @@ in systemd = lib.mkMerge [ { - tmpfiles.rules = - [ - "d '${cfg.configDir}' - minio minio - -" - ] - ++ (map (x: "d '" + x + "' - minio minio - - ") (builtins.filter lib.types.path.check cfg.dataDir)); + tmpfiles.rules = [ + "d '${cfg.configDir}' - minio minio - -" + ] + ++ (map (x: "d '" + x + "' - minio minio - - ") (builtins.filter lib.types.path.check cfg.dataDir)); services.minio = { description = "Minio Object Storage"; diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix index 6eeca99434e1..8515df0274d8 100644 --- a/nixos/modules/services/web-servers/nginx/default.nix +++ b/nixos/modules/services/web-servers/nginx/default.nix @@ -1449,11 +1449,12 @@ in mkCertOwnershipAssertion { cert = config.security.acme.certs.${name}; groups = config.users.groups; - services = - [ config.systemd.services.nginx ] - ++ lib.optional ( - cfg.enableReload || vhostCertNames != [ ] - ) config.systemd.services.nginx-config-reload; + services = [ + config.systemd.services.nginx + ] + ++ lib.optional ( + cfg.enableReload || vhostCertNames != [ ] + ) config.systemd.services.nginx-config-reload; } ) vhostCertNames; @@ -1484,10 +1485,11 @@ in description = "Nginx Web Server"; wantedBy = [ "multi-user.target" ]; wants = concatLists (map (certName: [ "acme-finished-${certName}.target" ]) vhostCertNames); - after = - [ "network.target" ] - ++ map (certName: "acme-selfsigned-${certName}.service") vhostCertNames - ++ map (certName: "acme-${certName}.service") independentCertNames; # avoid loading self-signed key w/ real cert, or vice-versa + after = [ + "network.target" + ] + ++ map (certName: "acme-selfsigned-${certName}.service") vhostCertNames + ++ map (certName: "acme-${certName}.service") independentCertNames; # avoid loading self-signed key w/ real cert, or vice-versa # Nginx needs to be started in order to be able to request certificates # (it's hosting the acme challenge after all) # This fixes https://github.com/NixOS/nixpkgs/issues/81842 @@ -1525,24 +1527,22 @@ in # New file permissions UMask = "0027"; # 0640 / 0750 # Capabilities - AmbientCapabilities = - [ - "CAP_NET_BIND_SERVICE" - "CAP_SYS_RESOURCE" - ] - ++ optionals cfg.enableQuicBPF [ - "CAP_SYS_ADMIN" - "CAP_NET_ADMIN" - ]; - CapabilityBoundingSet = - [ - "CAP_NET_BIND_SERVICE" - "CAP_SYS_RESOURCE" - ] - ++ optionals cfg.enableQuicBPF [ - "CAP_SYS_ADMIN" - "CAP_NET_ADMIN" - ]; + AmbientCapabilities = [ + "CAP_NET_BIND_SERVICE" + "CAP_SYS_RESOURCE" + ] + ++ optionals cfg.enableQuicBPF [ + "CAP_SYS_ADMIN" + "CAP_NET_ADMIN" + ]; + CapabilityBoundingSet = [ + "CAP_NET_BIND_SERVICE" + "CAP_SYS_RESOURCE" + ] + ++ optionals cfg.enableQuicBPF [ + "CAP_SYS_ADMIN" + "CAP_NET_ADMIN" + ]; # Security NoNewPrivileges = true; # Sandboxing (sorted by occurrence in https://www.freedesktop.org/software/systemd/man/systemd.exec.html) @@ -1576,7 +1576,8 @@ in SystemCallArchitectures = "native"; SystemCallFilter = [ "~@cpu-emulation @debug @keyring @mount @obsolete @privileged @setuid" - ] ++ optional cfg.enableQuicBPF [ "bpf" ]; + ] + ++ optional cfg.enableQuicBPF [ "bpf" ]; }; }; diff --git a/nixos/modules/services/web-servers/pomerium.nix b/nixos/modules/services/web-servers/pomerium.nix index 897b3985ab89..93b04425435d 100644 --- a/nixos/modules/services/web-servers/pomerium.nix +++ b/nixos/modules/services/web-servers/pomerium.nix @@ -71,10 +71,12 @@ in description = "Pomerium authenticating reverse proxy"; wants = [ "network.target" - ] ++ (optional (cfg.useACMEHost != null) "acme-finished-${cfg.useACMEHost}.target"); + ] + ++ (optional (cfg.useACMEHost != null) "acme-finished-${cfg.useACMEHost}.target"); after = [ "network.target" - ] ++ (optional (cfg.useACMEHost != null) "acme-finished-${cfg.useACMEHost}.target"); + ] + ++ (optional (cfg.useACMEHost != null) "acme-finished-${cfg.useACMEHost}.target"); wantedBy = [ "multi-user.target" ]; environment = optionalAttrs (cfg.useACMEHost != null) { CERTIFICATE_FILE = "fullchain.pem"; diff --git a/nixos/modules/services/web-servers/send.nix b/nixos/modules/services/web-servers/send.nix index 696fbbdc7c80..9c87fc1e6c98 100644 --- a/nixos/modules/services/web-servers/send.nix +++ b/nixos/modules/services/web-servers/send.nix @@ -188,31 +188,29 @@ in SystemCallArchitectures = "native"; UMask = "0077"; }; - environment = - { - IP_ADDRESS = cfg.host; - PORT = toString cfg.port; - BASE_URL = if (cfg.baseUrl == null) then "http://${cfg.host}:${toString cfg.port}" else cfg.baseUrl; - FILE_DIR = cfg.dataDir + "/uploads"; - REDIS_HOST = cfg.redis.host; - REDIS_PORT = toString cfg.redis.port; - } - // (lib.mapAttrs ( - name: value: - if lib.isList value then - "[" + lib.concatStringsSep ", " (map (x: toString x) value) + "]" - else if lib.isBool value then - lib.boolToString value - else - toString value - ) cfg.environment); - after = - [ - "network.target" - ] - ++ lib.optionals cfg.redis.createLocally [ - "redis-${cfg.redis.name}.service" - ]; + environment = { + IP_ADDRESS = cfg.host; + PORT = toString cfg.port; + BASE_URL = if (cfg.baseUrl == null) then "http://${cfg.host}:${toString cfg.port}" else cfg.baseUrl; + FILE_DIR = cfg.dataDir + "/uploads"; + REDIS_HOST = cfg.redis.host; + REDIS_PORT = toString cfg.redis.port; + } + // (lib.mapAttrs ( + name: value: + if lib.isList value then + "[" + lib.concatStringsSep ", " (map (x: toString x) value) + "]" + else if lib.isBool value then + lib.boolToString value + else + toString value + ) cfg.environment); + after = [ + "network.target" + ] + ++ lib.optionals cfg.redis.createLocally [ + "redis-${cfg.redis.name}.service" + ]; description = "Send web service"; wantedBy = [ "multi-user.target" ]; script = '' diff --git a/nixos/modules/services/web-servers/stargazer.nix b/nixos/modules/services/web-servers/stargazer.nix index 32feaf0337e7..c29f0107cd0e 100644 --- a/nixos/modules/services/web-servers/stargazer.nix +++ b/nixos/modules/services/web-servers/stargazer.nix @@ -260,26 +260,26 @@ in LockPersonality = true; RestrictRealtime = true; RemoveIPC = true; - CapabilityBoundingSet = - [ - "~CAP_SYS_PTRACE" - "~CAP_SYS_ADMIN" - "~CAP_SETPCAP" - "~CAP_SYS_TIME" - "~CAP_SYS_PACCT" - "~CAP_SYS_TTY_CONFIG " - "~CAP_SYS_CHROOT" - "~CAP_SYS_BOOT" - "~CAP_NET_ADMIN" - ] - ++ lib.lists.optional (!cfg.allowCgiUser) [ - "~CAP_SETGID" - "~CAP_SETUID" - ]; + CapabilityBoundingSet = [ + "~CAP_SYS_PTRACE" + "~CAP_SYS_ADMIN" + "~CAP_SETPCAP" + "~CAP_SYS_TIME" + "~CAP_SYS_PACCT" + "~CAP_SYS_TTY_CONFIG " + "~CAP_SYS_CHROOT" + "~CAP_SYS_BOOT" + "~CAP_NET_ADMIN" + ] + ++ lib.lists.optional (!cfg.allowCgiUser) [ + "~CAP_SETGID" + "~CAP_SETUID" + ]; SystemCallArchitectures = "native"; SystemCallFilter = [ "~@cpu-emulation @debug @keyring @mount @obsolete" - ] ++ lib.lists.optional (!cfg.allowCgiUser) [ "@privileged @setuid" ]; + ] + ++ lib.lists.optional (!cfg.allowCgiUser) [ "@privileged @setuid" ]; }; }; diff --git a/nixos/modules/services/web-servers/tomcat.nix b/nixos/modules/services/web-servers/tomcat.nix index 2fffc7cd47db..deff4f7f821b 100644 --- a/nixos/modules/services/web-servers/tomcat.nix +++ b/nixos/modules/services/web-servers/tomcat.nix @@ -427,7 +427,8 @@ in "JAVA_HOME='${cfg.jdk}'" "JAVA_OPTS='${builtins.toString cfg.javaOpts}'" "CATALINA_OPTS='${builtins.toString cfg.catalinaOpts}'" - ] ++ cfg.extraEnvironment; + ] + ++ cfg.extraEnvironment; ExecStart = "${tomcat}/bin/startup.sh"; ExecStop = "${tomcat}/bin/shutdown.sh"; }; diff --git a/nixos/modules/services/web-servers/trafficserver/default.nix b/nixos/modules/services/web-servers/trafficserver/default.nix index f6a98b1ebe2f..209583f74b10 100644 --- a/nixos/modules/services/web-servers/trafficserver/default.nix +++ b/nixos/modules/services/web-servers/trafficserver/default.nix @@ -278,23 +278,22 @@ in }; config = mkIf cfg.enable { - environment.etc = - { - "trafficserver/cache.config".text = cfg.cache; - "trafficserver/hosting.config".text = cfg.hosting; - "trafficserver/parent.config".text = cfg.parent; - "trafficserver/plugin.config".text = mkPluginConfig cfg.plugins; - "trafficserver/records.config".text = mkRecordsConfig cfg.records; - "trafficserver/remap.config".text = cfg.remap; - "trafficserver/splitdns.config".text = cfg.splitDns; - "trafficserver/ssl_multicert.config".text = cfg.sslMulticert; - "trafficserver/storage.config".text = cfg.storage; - "trafficserver/volume.config".text = cfg.volume; - } - // (mkYamlConf "ip_allow" cfg.ipAllow) - // (mkYamlConf "logging" cfg.logging) - // (mkYamlConf "sni" cfg.sni) - // (mkYamlConf "strategies" cfg.strategies); + environment.etc = { + "trafficserver/cache.config".text = cfg.cache; + "trafficserver/hosting.config".text = cfg.hosting; + "trafficserver/parent.config".text = cfg.parent; + "trafficserver/plugin.config".text = mkPluginConfig cfg.plugins; + "trafficserver/records.config".text = mkRecordsConfig cfg.records; + "trafficserver/remap.config".text = cfg.remap; + "trafficserver/splitdns.config".text = cfg.splitDns; + "trafficserver/ssl_multicert.config".text = cfg.sslMulticert; + "trafficserver/storage.config".text = cfg.storage; + "trafficserver/volume.config".text = cfg.volume; + } + // (mkYamlConf "ip_allow" cfg.ipAllow) + // (mkYamlConf "logging" cfg.logging) + // (mkYamlConf "sni" cfg.sni) + // (mkYamlConf "strategies" cfg.strategies); environment.systemPackages = [ pkgs.trafficserver ]; systemd.packages = [ pkgs.trafficserver ]; diff --git a/nixos/modules/services/web-servers/ttyd.nix b/nixos/modules/services/web-servers/ttyd.nix index f95cc62b8b67..01baa3b22fa3 100644 --- a/nixos/modules/services/web-servers/ttyd.nix +++ b/nixos/modules/services/web-servers/ttyd.nix @@ -16,59 +16,58 @@ let ; # Command line arguments for the ttyd daemon - args = - [ - "--port" - (toString cfg.port) - ] - ++ optionals (cfg.socket != null) [ - "--interface" - cfg.socket - ] - ++ optionals (cfg.interface != null) [ - "--interface" - cfg.interface - ] - ++ [ - "--signal" - (toString cfg.signal) - ] - ++ (lib.concatLists ( - lib.mapAttrsToList (_k: _v: [ - "--client-option" - "${_k}=${_v}" - ]) cfg.clientOptions - )) - ++ [ - "--terminal-type" - cfg.terminalType - ] - ++ optionals cfg.checkOrigin [ "--check-origin" ] - ++ optionals cfg.writeable [ "--writable" ] # the typo is correct - ++ [ - "--max-clients" - (toString cfg.maxClients) - ] - ++ optionals (cfg.indexFile != null) [ - "--index" - cfg.indexFile - ] - ++ optionals cfg.enableIPv6 [ "--ipv6" ] - ++ optionals cfg.enableSSL [ - "--ssl" - "--ssl-cert" - cfg.certFile - "--ssl-key" - cfg.keyFile - ] - ++ optionals (cfg.enableSSL && cfg.caFile != null) [ - "--ssl-ca" - cfg.caFile - ] - ++ [ - "--debug" - (toString cfg.logLevel) - ]; + args = [ + "--port" + (toString cfg.port) + ] + ++ optionals (cfg.socket != null) [ + "--interface" + cfg.socket + ] + ++ optionals (cfg.interface != null) [ + "--interface" + cfg.interface + ] + ++ [ + "--signal" + (toString cfg.signal) + ] + ++ (lib.concatLists ( + lib.mapAttrsToList (_k: _v: [ + "--client-option" + "${_k}=${_v}" + ]) cfg.clientOptions + )) + ++ [ + "--terminal-type" + cfg.terminalType + ] + ++ optionals cfg.checkOrigin [ "--check-origin" ] + ++ optionals cfg.writeable [ "--writable" ] # the typo is correct + ++ [ + "--max-clients" + (toString cfg.maxClients) + ] + ++ optionals (cfg.indexFile != null) [ + "--index" + cfg.indexFile + ] + ++ optionals cfg.enableIPv6 [ "--ipv6" ] + ++ optionals cfg.enableSSL [ + "--ssl" + "--ssl-cert" + cfg.certFile + "--ssl-key" + cfg.keyFile + ] + ++ optionals (cfg.enableSSL && cfg.caFile != null) [ + "--ssl-ca" + cfg.caFile + ] + ++ [ + "--debug" + (toString cfg.logLevel) + ]; in diff --git a/nixos/modules/services/x11/clight.nix b/nixos/modules/services/x11/clight.nix index 03bcbf84f853..ebdada1442a6 100644 --- a/nixos/modules/services/x11/clight.nix +++ b/nixos/modules/services/x11/clight.nix @@ -126,19 +126,18 @@ in ]; services.upower.enable = true; - services.clight.settings = - { - gamma.temp = - with cfg.temperature; - mkDefault [ - day - night - ]; - } - // (optionalAttrs (config.location.provider == "manual") { - daytime.latitude = mkDefault config.location.latitude; - daytime.longitude = mkDefault config.location.longitude; - }); + services.clight.settings = { + gamma.temp = + with cfg.temperature; + mkDefault [ + day + night + ]; + } + // (optionalAttrs (config.location.provider == "manual") { + daytime.latitude = mkDefault config.location.latitude; + daytime.longitude = mkDefault config.location.longitude; + }); services.geoclue2.appConfig.clightc = { isAllowed = true; diff --git a/nixos/modules/services/x11/desktop-managers/budgie.nix b/nixos/modules/services/x11/desktop-managers/budgie.nix index 9d7161a7560c..4ba659fd115e 100644 --- a/nixos/modules/services/x11/desktop-managers/budgie.nix +++ b/nixos/modules/services/x11/desktop-managers/budgie.nix @@ -130,25 +130,24 @@ in services.xserver.desktopManager.budgie.sessionPath = [ pkgs.budgie-desktop-view ]; - environment.extraInit = - '' - ${concatMapStrings (p: '' - if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then - export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name} - fi - if [ -d "${p}/lib/girepository-1.0" ]; then - export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib - fi - '') cfg.sessionPath} - '' - + lib.optionalString config.services.gnome.gcr-ssh-agent.enable '' - # Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still - # applies to sessions not managed by systemd. - if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then - export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" + environment.extraInit = '' + ${concatMapStrings (p: '' + if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then + export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name} fi - ''; + if [ -d "${p}/lib/girepository-1.0" ]; then + export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib + fi + '') cfg.sessionPath} + '' + + lib.optionalString config.services.gnome.gcr-ssh-agent.enable '' + # Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still + # applies to sessions not managed by systemd. + if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then + export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" + fi + ''; environment.systemPackages = with pkgs; diff --git a/nixos/modules/services/x11/desktop-managers/cinnamon.nix b/nixos/modules/services/x11/desktop-managers/cinnamon.nix index 44068bfb62d6..ef8e2000e21c 100644 --- a/nixos/modules/services/x11/desktop-managers/cinnamon.nix +++ b/nixos/modules/services/x11/desktop-managers/cinnamon.nix @@ -87,26 +87,25 @@ in }; # Have to take care of GDM + Cinnamon on Wayland users - environment.extraInit = - '' - ${concatMapStrings (p: '' - if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then - export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name} - fi - - if [ -d "${p}/lib/girepository-1.0" ]; then - export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib - fi - '') cfg.sessionPath} - '' - + lib.optionalString config.services.gnome.gcr-ssh-agent.enable '' - # Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still - # applies to sessions not managed by systemd. - if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then - export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" + environment.extraInit = '' + ${concatMapStrings (p: '' + if [ -d "${p}/share/gsettings-schemas/${p.name}" ]; then + export XDG_DATA_DIRS=$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${p}/share/gsettings-schemas/${p.name} fi - ''; + + if [ -d "${p}/lib/girepository-1.0" ]; then + export GI_TYPELIB_PATH=$GI_TYPELIB_PATH''${GI_TYPELIB_PATH:+:}${p}/lib/girepository-1.0 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${p}/lib + fi + '') cfg.sessionPath} + '' + + lib.optionalString config.services.gnome.gcr-ssh-agent.enable '' + # Hack: https://bugzilla.redhat.com/show_bug.cgi?id=2250704 still + # applies to sessions not managed by systemd. + if [ -z "$SSH_AUTH_SOCK" ] && [ -n "$XDG_RUNTIME_DIR" ]; then + export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh" + fi + ''; # Default services services.blueman.enable = mkDefault (notExcluded pkgs.blueman); diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index bb8528bb284a..8be5d1cdb7b7 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -246,15 +246,14 @@ in xdg.icons.enable = true; xdg.portal.enable = true; - xdg.portal.extraPortals = - [ - pkgs.xdg-desktop-portal-gtk - ] - ++ (with pkgs.pantheon; [ - elementary-files - elementary-settings-daemon - xdg-desktop-portal-pantheon - ]); + xdg.portal.extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ] + ++ (with pkgs.pantheon; [ + elementary-files + elementary-settings-daemon + xdg-desktop-portal-pantheon + ]); xdg.portal.configPackages = mkDefault [ pkgs.pantheon.elementary-default-settings ]; diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index f3051f7757e0..db525adc8f7f 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -213,23 +213,22 @@ in "Plasma 5 has been deprecated and will be removed in NixOS 25.11. Please migrate your configuration to Plasma 6." ]; - security.wrappers = - { - kwin_wayland = { - owner = "root"; - group = "root"; - capabilities = "cap_sys_nice+ep"; - source = "${getBin pkgs.plasma5Packages.kwin}/bin/kwin_wayland"; - }; - } - // optionalAttrs (!cfg.runUsingSystemd) { - start_kdeinit = { - setuid = true; - owner = "root"; - group = "root"; - source = "${getBin pkgs.plasma5Packages.kinit}/libexec/kf5/start_kdeinit"; - }; + security.wrappers = { + kwin_wayland = { + owner = "root"; + group = "root"; + capabilities = "cap_sys_nice+ep"; + source = "${getBin pkgs.plasma5Packages.kwin}/bin/kwin_wayland"; }; + } + // optionalAttrs (!cfg.runUsingSystemd) { + start_kdeinit = { + setuid = true; + owner = "root"; + group = "root"; + source = "${getBin pkgs.plasma5Packages.kinit}/libexec/kf5/start_kdeinit"; + }; + }; qt.enable = true; diff --git a/nixos/modules/services/x11/window-managers/wmderland.nix b/nixos/modules/services/x11/window-managers/wmderland.nix index 018c152572b5..96f3a8e34dff 100644 --- a/nixos/modules/services/x11/window-managers/wmderland.nix +++ b/nixos/modules/services/x11/window-managers/wmderland.nix @@ -62,6 +62,7 @@ in environment.systemPackages = [ pkgs.wmderland pkgs.wmderlandc - ] ++ cfg.extraPackages; + ] + ++ cfg.extraPackages; }; } diff --git a/nixos/modules/services/x11/xautolock.nix b/nixos/modules/services/x11/xautolock.nix index 1fd6c54f6b96..ecb9f7786474 100644 --- a/nixos/modules/services/x11/xautolock.nix +++ b/nixos/modules/services/x11/xautolock.nix @@ -132,20 +132,19 @@ in Restart = "always"; }; }; - assertions = - [ - { - assertion = cfg.enableNotifier -> cfg.notifier != null; - message = "When enabling the notifier for xautolock, you also need to specify the notify script"; - } - { - assertion = cfg.killer != null -> cfg.killtime >= 10; - message = "killtime has to be at least 10 minutes according to `man xautolock`"; - } - ] - ++ (lib.forEach [ "locker" "notifier" "nowlocker" "killer" ] (option: { - assertion = cfg.${option} != null -> builtins.substring 0 1 cfg.${option} == "/"; - message = "Please specify a canonical path for `services.xserver.xautolock.${option}`"; - })); + assertions = [ + { + assertion = cfg.enableNotifier -> cfg.notifier != null; + message = "When enabling the notifier for xautolock, you also need to specify the notify script"; + } + { + assertion = cfg.killer != null -> cfg.killtime >= 10; + message = "killtime has to be at least 10 minutes according to `man xautolock`"; + } + ] + ++ (lib.forEach [ "locker" "notifier" "nowlocker" "killer" ] (option: { + assertion = cfg.${option} != null -> builtins.substring 0 1 cfg.${option} == "/"; + message = "Please specify a canonical path for `services.xserver.xautolock.${option}`"; + })); }; } diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index bd41f343eb6f..8df96f40106d 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -880,21 +880,20 @@ in }; }; - services.xserver.displayManager.xserverArgs = - [ - "-config ${configFile}" - "-xkbdir" - "${cfg.xkb.dir}" - ] - ++ optional (cfg.display != null) ":${toString cfg.display}" - ++ optional (cfg.tty != null) "vt${toString cfg.tty}" - ++ optional (cfg.dpi != null) "-dpi ${toString cfg.dpi}" - ++ optional (cfg.logFile != null) "-logfile ${toString cfg.logFile}" - ++ optional (cfg.verbose != null) "-verbose ${toString cfg.verbose}" - ++ optional (!cfg.enableTCP) "-nolisten tcp" - ++ optional (cfg.autoRepeatDelay != null) "-ardelay ${toString cfg.autoRepeatDelay}" - ++ optional (cfg.autoRepeatInterval != null) "-arinterval ${toString cfg.autoRepeatInterval}" - ++ optional cfg.terminateOnReset "-terminate"; + services.xserver.displayManager.xserverArgs = [ + "-config ${configFile}" + "-xkbdir" + "${cfg.xkb.dir}" + ] + ++ optional (cfg.display != null) ":${toString cfg.display}" + ++ optional (cfg.tty != null) "vt${toString cfg.tty}" + ++ optional (cfg.dpi != null) "-dpi ${toString cfg.dpi}" + ++ optional (cfg.logFile != null) "-logfile ${toString cfg.logFile}" + ++ optional (cfg.verbose != null) "-verbose ${toString cfg.verbose}" + ++ optional (!cfg.enableTCP) "-nolisten tcp" + ++ optional (cfg.autoRepeatDelay != null) "-ardelay ${toString cfg.autoRepeatDelay}" + ++ optional (cfg.autoRepeatInterval != null) "-arinterval ${toString cfg.autoRepeatInterval}" + ++ optional cfg.terminateOnReset "-terminate"; services.xserver.modules = concatLists (catAttrs "modules" cfg.drivers) ++ [ xorg.xorgserver.out diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index 60f599ae8e22..f56be5f71f18 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -97,32 +97,31 @@ let withDry: with types; let - scriptOptions = - { - deps = mkOption { - type = types.listOf types.str; - default = [ ]; - description = "List of dependencies. The script will run after these."; - }; - text = mkOption { - type = types.lines; - description = "The content of the script."; - }; - } - // optionalAttrs withDry { - supportsDryActivation = mkOption { - type = types.bool; - default = false; - description = '' - Whether this activation script supports being dry-activated. - These activation scripts will also be executed on dry-activate - activations with the environment variable - `NIXOS_ACTION` being set to `dry-activate`. - it's important that these activation scripts don't - modify anything about the system when the variable is set. - ''; - }; + scriptOptions = { + deps = mkOption { + type = types.listOf types.str; + default = [ ]; + description = "List of dependencies. The script will run after these."; }; + text = mkOption { + type = types.lines; + description = "The content of the script."; + }; + } + // optionalAttrs withDry { + supportsDryActivation = mkOption { + type = types.bool; + default = false; + description = '' + Whether this activation script supports being dry-activated. + These activation scripts will also be executed on dry-activate + activations with the environment variable + `NIXOS_ACTION` being set to `dry-activate`. + it's important that these activation scripts don't + modify anything about the system when the variable is set. + ''; + }; + }; in either str (submodule { options = scriptOptions; @@ -275,16 +274,15 @@ in system.activationScripts.stdio = ""; # obsolete system.activationScripts.var = ""; # obsolete - systemd.tmpfiles.rules = - [ - "D /var/empty 0555 root root -" - "h /var/empty - - - - +i" - ] - ++ lib.optionals config.nix.enable [ - # Prevent the current configuration from being garbage-collected. - "d /nix/var/nix/gcroots -" - "L+ /nix/var/nix/gcroots/current-system - - - - /run/current-system" - ]; + systemd.tmpfiles.rules = [ + "D /var/empty 0555 root root -" + "h /var/empty - - - - +i" + ] + ++ lib.optionals config.nix.enable [ + # Prevent the current configuration from being garbage-collected. + "d /nix/var/nix/gcroots -" + "L+ /nix/var/nix/gcroots/current-system - - - - /run/current-system" + ]; system.activationScripts.usrbinenv = if config.environment.usrbinenv != null then diff --git a/nixos/modules/system/activation/bootspec.nix b/nixos/modules/system/activation/bootspec.nix index 99a859f91829..c625b91ec1e2 100644 --- a/nixos/modules/system/activation/bootspec.nix +++ b/nixos/modules/system/activation/bootspec.nix @@ -24,19 +24,18 @@ let ( cfg.extensions // { - "org.nixos.bootspec.v1" = - { - system = config.boot.kernelPackages.stdenv.hostPlatform.system; - kernel = "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}"; - kernelParams = config.boot.kernelParams; - label = "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"; - } - // lib.optionalAttrs config.boot.initrd.enable { - initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}"; - } - // lib.optionalAttrs hasAtLeastOneInitrdSecret { - initrdSecrets = "${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets"; - }; + "org.nixos.bootspec.v1" = { + system = config.boot.kernelPackages.stdenv.hostPlatform.system; + kernel = "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}"; + kernelParams = config.boot.kernelParams; + label = "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"; + } + // lib.optionalAttrs config.boot.initrd.enable { + initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}"; + } + // lib.optionalAttrs hasAtLeastOneInitrdSecret { + initrdSecrets = "${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets"; + }; } ) ); diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix index 56e97d3fdea9..b8662e992965 100644 --- a/nixos/modules/system/activation/top-level.nix +++ b/nixos/modules/system/activation/top-level.nix @@ -100,11 +100,9 @@ let systemWithBuildDeps = system.overrideAttrs (o: { systemBuildClosure = pkgs.closureInfo { rootPaths = [ system.drvPath ]; }; - buildCommand = - o.buildCommand - + '' - ln -sn $systemBuildClosure $out/build-closure - ''; + buildCommand = o.buildCommand + '' + ln -sn $systemBuildClosure $out/build-closure + ''; }); in @@ -360,44 +358,43 @@ in ) ); - system.systemBuilderArgs = - { + system.systemBuilderArgs = { - # Legacy environment variables. These were used by the activation script, - # but some other script might still depend on them, although unlikely. - installBootLoader = config.system.build.installBootLoader; - localeArchive = "${config.i18n.glibcLocales}/lib/locale/locale-archive"; - distroId = config.system.nixos.distroId; - perl = pkgs.perl.withPackages ( - p: with p; [ - ConfigIniFiles - FileSlurp - ] - ); - # End if legacy environment variables + # Legacy environment variables. These were used by the activation script, + # but some other script might still depend on them, although unlikely. + installBootLoader = config.system.build.installBootLoader; + localeArchive = "${config.i18n.glibcLocales}/lib/locale/locale-archive"; + distroId = config.system.nixos.distroId; + perl = pkgs.perl.withPackages ( + p: with p; [ + ConfigIniFiles + FileSlurp + ] + ); + # End if legacy environment variables - preSwitchCheck = config.system.preSwitchChecksScript; + preSwitchCheck = config.system.preSwitchChecksScript; - # Not actually used in the builder. `passedChecks` is just here to create - # the build dependencies. Checks are similar to build dependencies in the - # sense that if they fail, the system build fails. However, checks do not - # produce any output of value, so they are not used by the system builder. - # In fact, using them runs the risk of accidentally adding unneeded paths - # to the system closure, which defeats the purpose of the `system.checks` - # option, as opposed to `system.extraDependencies`. - passedChecks = concatStringsSep " " config.system.checks; - } - // lib.optionalAttrs (config.system.forbiddenDependenciesRegexes != [ ]) { - closureInfo = pkgs.closureInfo { - rootPaths = [ - # override to avoid infinite recursion (and to allow using extraDependencies to add forbidden dependencies) - (config.system.build.toplevel.overrideAttrs (_: { - extraDependencies = [ ]; - closureInfo = null; - })) - ]; - }; + # Not actually used in the builder. `passedChecks` is just here to create + # the build dependencies. Checks are similar to build dependencies in the + # sense that if they fail, the system build fails. However, checks do not + # produce any output of value, so they are not used by the system builder. + # In fact, using them runs the risk of accidentally adding unneeded paths + # to the system closure, which defeats the purpose of the `system.checks` + # option, as opposed to `system.extraDependencies`. + passedChecks = concatStringsSep " " config.system.checks; + } + // lib.optionalAttrs (config.system.forbiddenDependenciesRegexes != [ ]) { + closureInfo = pkgs.closureInfo { + rootPaths = [ + # override to avoid infinite recursion (and to allow using extraDependencies to add forbidden dependencies) + (config.system.build.toplevel.overrideAttrs (_: { + extraDependencies = [ ]; + closureInfo = null; + })) + ]; }; + }; system.build.toplevel = if config.system.includeBuildDependencies then systemWithBuildDeps else system; diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix index e7c914954f1e..5dfa85e4cd4c 100644 --- a/nixos/modules/system/boot/binfmt.nix +++ b/nixos/modules/system/boot/binfmt.nix @@ -387,8 +387,7 @@ in ); nix.settings = lib.mkIf (cfg.addEmulatedSystemsToNixSandbox && cfg.emulatedSystems != [ ]) { extra-platforms = - cfg.emulatedSystems - ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 "i686-linux"; + cfg.emulatedSystems ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 "i686-linux"; extra-sandbox-paths = let ruleFor = system: cfg.registrations.${system}; @@ -405,13 +404,12 @@ in systemd = lib.mkMerge [ ({ - tmpfiles.rules = - [ - "d /run/binfmt 0755 -" - ] - ++ lib.mapAttrsToList (name: interpreter: "L+ /run/binfmt/${name} - - - - ${interpreter}") ( - lib.mapAttrs mkInterpreter config.boot.binfmt.registrations - ); + tmpfiles.rules = [ + "d /run/binfmt 0755 -" + ] + ++ lib.mapAttrsToList (name: interpreter: "L+ /run/binfmt/${name} - - - - ${interpreter}") ( + lib.mapAttrs mkInterpreter config.boot.binfmt.registrations + ); }) (lib.mkIf (config.boot.binfmt.registrations != { }) { diff --git a/nixos/modules/system/boot/initrd-ssh.nix b/nixos/modules/system/boot/initrd-ssh.nix index 76d036766101..d43ce5960e11 100644 --- a/nixos/modules/system/boot/initrd-ssh.nix +++ b/nixos/modules/system/boot/initrd-ssh.nix @@ -171,51 +171,50 @@ in sshdCfg = config.services.openssh; - sshdConfig = - '' - UsePAM no - Port ${toString cfg.port} + sshdConfig = '' + UsePAM no + Port ${toString cfg.port} - PasswordAuthentication no - AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys2 /etc/ssh/authorized_keys.d/%u - ChallengeResponseAuthentication no + PasswordAuthentication no + AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys2 /etc/ssh/authorized_keys.d/%u + ChallengeResponseAuthentication no - ${flip concatMapStrings cfg.hostKeys (path: '' - HostKey ${initrdKeyPath path} - '')} + ${flip concatMapStrings cfg.hostKeys (path: '' + HostKey ${initrdKeyPath path} + '')} - '' - + lib.optionalString (sshdCfg.settings.KexAlgorithms != null) '' - KexAlgorithms ${concatStringsSep "," sshdCfg.settings.KexAlgorithms} - '' - + lib.optionalString (sshdCfg.settings.Ciphers != null) '' - Ciphers ${concatStringsSep "," sshdCfg.settings.Ciphers} - '' - + lib.optionalString (sshdCfg.settings.Macs != null) '' - MACs ${concatStringsSep "," sshdCfg.settings.Macs} - '' - + '' + '' + + lib.optionalString (sshdCfg.settings.KexAlgorithms != null) '' + KexAlgorithms ${concatStringsSep "," sshdCfg.settings.KexAlgorithms} + '' + + lib.optionalString (sshdCfg.settings.Ciphers != null) '' + Ciphers ${concatStringsSep "," sshdCfg.settings.Ciphers} + '' + + lib.optionalString (sshdCfg.settings.Macs != null) '' + MACs ${concatStringsSep "," sshdCfg.settings.Macs} + '' + + '' - LogLevel ${sshdCfg.settings.LogLevel} + LogLevel ${sshdCfg.settings.LogLevel} - ${ - if sshdCfg.settings.UseDns then - '' - UseDNS yes - '' - else - '' - UseDNS no - '' - } + ${ + if sshdCfg.settings.UseDns then + '' + UseDNS yes + '' + else + '' + UseDNS no + '' + } - ${optionalString (!config.boot.initrd.systemd.enable) '' - SshdAuthPath /bin/sshd-auth - SshdSessionPath /bin/sshd-session - ''} + ${optionalString (!config.boot.initrd.systemd.enable) '' + SshdAuthPath /bin/sshd-auth + SshdSessionPath /bin/sshd-session + ''} - ${cfg.extraConfig} - ''; + ${cfg.extraConfig} + ''; in mkIf enabled { assertions = [ diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index c5a2f5933b48..9cb2148d283b 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -421,12 +421,13 @@ in # Implement consoleLogLevel both in early boot and using sysctl # (so you don't need to reboot to have changes take effect). - boot.kernelParams = - [ "loglevel=${toString config.boot.consoleLogLevel}" ] - ++ optionals config.boot.vesa [ - "vga=0x317" - "nomodeset" - ]; + boot.kernelParams = [ + "loglevel=${toString config.boot.consoleLogLevel}" + ] + ++ optionals config.boot.vesa [ + "vga=0x317" + "nomodeset" + ]; boot.kernel.sysctl."kernel.printk" = mkDefault config.boot.consoleLogLevel; diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index ebd45729d2bf..4b319f969d66 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -851,54 +851,53 @@ in '') config.boot.loader.grub.extraFiles ); - assertions = + assertions = [ + { + assertion = cfg.mirroredBoots != [ ]; + message = + "You must set the option ‘boot.loader.grub.devices’ or " + + "'boot.loader.grub.mirroredBoots' to make the system bootable."; + } + { + assertion = + cfg.efiSupport + || all (c: c < 2) (mapAttrsToList (n: c: if n == "nodev" then 0 else c) bootDeviceCounters); + message = "You cannot have duplicated devices in mirroredBoots"; + } + { + assertion = cfg.efiInstallAsRemovable -> cfg.efiSupport; + message = "If you wish to to use boot.loader.grub.efiInstallAsRemovable, then turn on boot.loader.grub.efiSupport"; + } + { + assertion = cfg.efiInstallAsRemovable -> !config.boot.loader.efi.canTouchEfiVariables; + message = "If you wish to to use boot.loader.grub.efiInstallAsRemovable, then turn off boot.loader.efi.canTouchEfiVariables"; + } + { + assertion = !(options.boot.loader.grub.version.isDefined && cfg.version == 1); + message = "Support for version 0.9x of GRUB was removed after being unsupported upstream for around a decade"; + } + ] + ++ flip concatMap cfg.mirroredBoots ( + args: [ { - assertion = cfg.mirroredBoots != [ ]; - message = - "You must set the option ‘boot.loader.grub.devices’ or " - + "'boot.loader.grub.mirroredBoots' to make the system bootable."; + assertion = args.devices != [ ]; + message = "A boot path cannot have an empty devices string in ${args.path}"; } { - assertion = - cfg.efiSupport - || all (c: c < 2) (mapAttrsToList (n: c: if n == "nodev" then 0 else c) bootDeviceCounters); - message = "You cannot have duplicated devices in mirroredBoots"; + assertion = hasPrefix "/" args.path; + message = "Boot paths must be absolute, not ${args.path}"; } { - assertion = cfg.efiInstallAsRemovable -> cfg.efiSupport; - message = "If you wish to to use boot.loader.grub.efiInstallAsRemovable, then turn on boot.loader.grub.efiSupport"; - } - { - assertion = cfg.efiInstallAsRemovable -> !config.boot.loader.efi.canTouchEfiVariables; - message = "If you wish to to use boot.loader.grub.efiInstallAsRemovable, then turn off boot.loader.efi.canTouchEfiVariables"; - } - { - assertion = !(options.boot.loader.grub.version.isDefined && cfg.version == 1); - message = "Support for version 0.9x of GRUB was removed after being unsupported upstream for around a decade"; + assertion = if args.efiSysMountPoint == null then true else hasPrefix "/" args.efiSysMountPoint; + message = "EFI paths must be absolute, not ${args.efiSysMountPoint}"; } ] - ++ flip concatMap cfg.mirroredBoots ( - args: - [ - { - assertion = args.devices != [ ]; - message = "A boot path cannot have an empty devices string in ${args.path}"; - } - { - assertion = hasPrefix "/" args.path; - message = "Boot paths must be absolute, not ${args.path}"; - } - { - assertion = if args.efiSysMountPoint == null then true else hasPrefix "/" args.efiSysMountPoint; - message = "EFI paths must be absolute, not ${args.efiSysMountPoint}"; - } - ] - ++ forEach args.devices (device: { - assertion = device == "nodev" || hasPrefix "/" device; - message = "GRUB devices must be absolute paths, not ${device} in ${args.path}"; - }) - ); + ++ forEach args.devices (device: { + assertion = device == "nodev" || hasPrefix "/" device; + message = "GRUB devices must be absolute paths, not ${device} in ${args.path}"; + }) + ); }) (mkIf options.boot.loader.grub.version.isDefined { diff --git a/nixos/modules/system/boot/loader/grub/ipxe.nix b/nixos/modules/system/boot/loader/grub/ipxe.nix index a988e15a20db..9bd20ed38fee 100644 --- a/nixos/modules/system/boot/loader/grub/ipxe.nix +++ b/nixos/modules/system/boot/loader/grub/ipxe.nix @@ -51,16 +51,15 @@ in boot.loader.grub.extraEntries = toString (map grubEntry scripts); - boot.loader.grub.extraFiles = - { - "ipxe.lkrn" = "${pkgs.ipxe}/ipxe.lkrn"; - } - // builtins.listToAttrs ( - map (name: { - name = name + ".ipxe"; - value = scriptFile name; - }) scripts - ); + boot.loader.grub.extraFiles = { + "ipxe.lkrn" = "${pkgs.ipxe}/ipxe.lkrn"; + } + // builtins.listToAttrs ( + map (name: { + name = name + ".ipxe"; + value = scriptFile name; + }) scripts + ); }; } diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix index f0afb3b8f575..eed72998f565 100644 --- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix +++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot.nix @@ -518,62 +518,61 @@ in }; config = mkIf cfg.enable { - assertions = - [ - { - assertion = (hasPrefix "/" efi.efiSysMountPoint); - message = "The ESP mount point '${toString efi.efiSysMountPoint}' must be an absolute path"; - } - { - assertion = cfg.xbootldrMountPoint == null || (hasPrefix "/" cfg.xbootldrMountPoint); - message = "The XBOOTLDR mount point '${toString cfg.xbootldrMountPoint}' must be an absolute path"; - } - { - assertion = cfg.xbootldrMountPoint != efi.efiSysMountPoint; - message = "The XBOOTLDR mount point '${toString cfg.xbootldrMountPoint}' cannot be the same as the ESP mount point '${toString efi.efiSysMountPoint}'"; - } - { - assertion = (config.boot.kernelPackages.kernel.features or { efiBootStub = true; }) ? efiBootStub; - message = "This kernel does not support the EFI boot stub"; - } - { - assertion = - cfg.installDeviceTree - -> config.hardware.deviceTree.enable - -> config.hardware.deviceTree.name != null; - message = "Cannot install devicetree without 'config.hardware.deviceTree.enable' enabled and 'config.hardware.deviceTree.name' set"; - } - ] - ++ concatMap (filename: [ - { - assertion = !(hasInfix "/" filename); - message = "boot.loader.systemd-boot.extraEntries.${lib.strings.escapeNixIdentifier filename} is invalid: entries within folders are not supported"; - } - { - assertion = hasSuffix ".conf" filename; - message = "boot.loader.systemd-boot.extraEntries.${lib.strings.escapeNixIdentifier filename} is invalid: entries must have a .conf file extension"; - } - ]) (builtins.attrNames cfg.extraEntries) - ++ concatMap (filename: [ - { - assertion = !(hasPrefix "/" filename); - message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: paths must not begin with a slash"; - } - { - assertion = !(hasInfix ".." filename); - message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: paths must not reference the parent directory"; - } - { - assertion = !(hasInfix "nixos/.extra-files" (toLower filename)); - message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: files cannot be placed in the nixos/.extra-files directory"; - } - ]) (builtins.attrNames cfg.extraFiles) - ++ concatMap (winVersion: [ - { - assertion = lib.match "^[-_0-9A-Za-z]+$" winVersion != null; - message = "boot.loader.systemd-boot.windows.${winVersion} is invalid: key must only contain alphanumeric characters, hyphens, and underscores"; - } - ]) (builtins.attrNames cfg.windows); + assertions = [ + { + assertion = (hasPrefix "/" efi.efiSysMountPoint); + message = "The ESP mount point '${toString efi.efiSysMountPoint}' must be an absolute path"; + } + { + assertion = cfg.xbootldrMountPoint == null || (hasPrefix "/" cfg.xbootldrMountPoint); + message = "The XBOOTLDR mount point '${toString cfg.xbootldrMountPoint}' must be an absolute path"; + } + { + assertion = cfg.xbootldrMountPoint != efi.efiSysMountPoint; + message = "The XBOOTLDR mount point '${toString cfg.xbootldrMountPoint}' cannot be the same as the ESP mount point '${toString efi.efiSysMountPoint}'"; + } + { + assertion = (config.boot.kernelPackages.kernel.features or { efiBootStub = true; }) ? efiBootStub; + message = "This kernel does not support the EFI boot stub"; + } + { + assertion = + cfg.installDeviceTree + -> config.hardware.deviceTree.enable + -> config.hardware.deviceTree.name != null; + message = "Cannot install devicetree without 'config.hardware.deviceTree.enable' enabled and 'config.hardware.deviceTree.name' set"; + } + ] + ++ concatMap (filename: [ + { + assertion = !(hasInfix "/" filename); + message = "boot.loader.systemd-boot.extraEntries.${lib.strings.escapeNixIdentifier filename} is invalid: entries within folders are not supported"; + } + { + assertion = hasSuffix ".conf" filename; + message = "boot.loader.systemd-boot.extraEntries.${lib.strings.escapeNixIdentifier filename} is invalid: entries must have a .conf file extension"; + } + ]) (builtins.attrNames cfg.extraEntries) + ++ concatMap (filename: [ + { + assertion = !(hasPrefix "/" filename); + message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: paths must not begin with a slash"; + } + { + assertion = !(hasInfix ".." filename); + message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: paths must not reference the parent directory"; + } + { + assertion = !(hasInfix "nixos/.extra-files" (toLower filename)); + message = "boot.loader.systemd-boot.extraFiles.${lib.strings.escapeNixIdentifier filename} is invalid: files cannot be placed in the nixos/.extra-files directory"; + } + ]) (builtins.attrNames cfg.extraFiles) + ++ concatMap (winVersion: [ + { + assertion = lib.match "^[-_0-9A-Za-z]+$" winVersion != null; + message = "boot.loader.systemd-boot.windows.${winVersion} is invalid: key must only contain alphanumeric characters, hyphens, and underscores"; + } + ]) (builtins.attrNames cfg.windows); boot.loader.grub.enable = mkDefault false; diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix index af7362231ea5..9c9c56f53f90 100644 --- a/nixos/modules/system/boot/luksroot.nix +++ b/nixos/modules/system/boot/luksroot.nix @@ -163,8 +163,7 @@ let optionalString (dev.header != null) "--header=${dev.header}" }"; fido2luksCredentials = - dev.fido2.credentials - ++ optional (dev.fido2.credential != null) dev.fido2.credential; + dev.fido2.credentials ++ optional (dev.fido2.credential != null) dev.fido2.credential; in '' # Wait for luksRoot (and optionally keyFile and/or header) to appear, e.g. @@ -1133,17 +1132,16 @@ in ]; # Some modules that may be needed for mounting anything ciphered - boot.initrd.availableKernelModules = - [ - "dm_mod" - "dm_crypt" - "cryptd" - "input_leds" - ] - ++ luks.cryptoModules - # workaround until https://marc.info/?l=linux-crypto-vger&m=148783562211457&w=4 is merged - # remove once 'modprobe --show-depends xts' shows ecb as a dependency - ++ (optional (builtins.elem "xts" luks.cryptoModules) "ecb"); + boot.initrd.availableKernelModules = [ + "dm_mod" + "dm_crypt" + "cryptd" + "input_leds" + ] + ++ luks.cryptoModules + # workaround until https://marc.info/?l=linux-crypto-vger&m=148783562211457&w=4 is merged + # remove once 'modprobe --show-depends xts' shows ecb as a dependency + ++ (optional (builtins.elem "xts" luks.cryptoModules) "ecb"); # copy the cryptsetup binary and it's dependencies boot.initrd.extraUtilsCommands = @@ -1225,14 +1223,13 @@ in "cryptsetup.target" "remote-cryptsetup.target" ]; - storePaths = - [ - "${config.boot.initrd.systemd.package}/bin/systemd-cryptsetup" - "${config.boot.initrd.systemd.package}/lib/systemd/system-generators/systemd-cryptsetup-generator" - ] - ++ lib.optionals config.boot.initrd.systemd.tpm2.enable [ - "${config.boot.initrd.systemd.package}/lib/cryptsetup/libcryptsetup-token-systemd-tpm2.so" - ]; + storePaths = [ + "${config.boot.initrd.systemd.package}/bin/systemd-cryptsetup" + "${config.boot.initrd.systemd.package}/lib/systemd/system-generators/systemd-cryptsetup-generator" + ] + ++ lib.optionals config.boot.initrd.systemd.tpm2.enable [ + "${config.boot.initrd.systemd.package}/lib/cryptsetup/libcryptsetup-token-systemd-tpm2.so" + ]; }; # We do this because we need the udev rules from the package @@ -1265,7 +1262,8 @@ in after = [ "systemd-modules-load.service" "tpm2.target" - ] ++ optional clevis.useTang "network-online.target"; + ] + ++ optional clevis.useTang "network-online.target"; script = '' mkdir -p /clevis-${name} mount -t ramfs none /clevis-${name} diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 9e54440138c9..dba90620719c 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -3134,19 +3134,18 @@ let }; renderConfig = def: { - text = - '' - [Network] - ${attrsToSection def.networkConfig} - '' - + optionalString (def.dhcpV4Config != { }) '' - [DHCPv4] - ${attrsToSection def.dhcpV4Config} - '' - + optionalString (def.dhcpV6Config != { }) '' - [DHCPv6] - ${attrsToSection def.dhcpV6Config} - ''; + text = '' + [Network] + ${attrsToSection def.networkConfig} + '' + + optionalString (def.dhcpV4Config != { }) '' + [DHCPv4] + ${attrsToSection def.dhcpV4Config} + '' + + optionalString (def.dhcpV6Config != { }) '' + [DHCPv6] + ${attrsToSection def.dhcpV6Config} + ''; }; mkUnitFiles = @@ -3299,10 +3298,11 @@ let { systemd.network.units = mapAttrs' (n: v: nameValuePair "${n}.link" (mkUnit linkToUnit v)) cfg.links; - systemd.network.wait-online.extraArgs = - [ "--timeout=${toString cfg.wait-online.timeout}" ] - ++ optional cfg.wait-online.anyInterface "--any" - ++ map (i: "--ignore=${i}") cfg.wait-online.ignoredInterfaces; + systemd.network.wait-online.extraArgs = [ + "--timeout=${toString cfg.wait-online.timeout}" + ] + ++ optional cfg.wait-online.anyInterface "--any" + ++ map (i: "--ignore=${i}") cfg.wait-online.ignoredInterfaces; } (mkIf config.systemd.network.enable { diff --git a/nixos/modules/system/boot/plymouth.nix b/nixos/modules/system/boot/plymouth.nix index 53df5c214146..24861b678769 100644 --- a/nixos/modules/system/boot/plymouth.nix +++ b/nixos/modules/system/boot/plymouth.nix @@ -55,7 +55,8 @@ let paths = [ plymouth plymouthLogos - ] ++ cfg.themePackages; + ] + ++ cfg.themePackages; }; configFile = pkgs.writeText "plymouthd.conf" '' diff --git a/nixos/modules/system/boot/resolved.nix b/nixos/modules/system/boot/resolved.nix index 44d13a6fdd98..bf72d2f2747f 100644 --- a/nixos/modules/system/boot/resolved.nix +++ b/nixos/modules/system/boot/resolved.nix @@ -197,17 +197,16 @@ in stopIfChanged = false; }; - environment.etc = - { - "systemd/resolved.conf".text = resolvedConf; + environment.etc = { + "systemd/resolved.conf".text = resolvedConf; - # symlink the dynamic stub resolver of resolv.conf as recommended by upstream: - # https://www.freedesktop.org/software/systemd/man/systemd-resolved.html#/etc/resolv.conf - "resolv.conf".source = "/run/systemd/resolve/stub-resolv.conf"; - } - // optionalAttrs dnsmasqResolve { - "dnsmasq-resolv.conf".source = "/run/systemd/resolve/resolv.conf"; - }; + # symlink the dynamic stub resolver of resolv.conf as recommended by upstream: + # https://www.freedesktop.org/software/systemd/man/systemd-resolved.html#/etc/resolv.conf + "resolv.conf".source = "/run/systemd/resolve/stub-resolv.conf"; + } + // optionalAttrs dnsmasqResolve { + "dnsmasq-resolv.conf".source = "/run/systemd/resolve/resolv.conf"; + }; # If networkmanager is enabled, ask it to interface with resolved. networking.networkmanager.dns = "systemd-resolved"; diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index f5f914d8fa4d..7fa7f2ada404 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -396,50 +396,49 @@ let name = "initrd-${kernel-name}"; inherit (config.boot.initrd) compressor compressorArgs prepend; - contents = - [ - { - object = bootStage1; - symlink = "/init"; - } - { - object = "${modulesClosure}/lib"; - symlink = "/lib"; - } - { - object = "${pkgs.kmod-blacklist-ubuntu}/modprobe.conf"; - symlink = "/etc/modprobe.d/ubuntu.conf"; - } - { - object = config.environment.etc."modprobe.d/nixos.conf".source; - symlink = "/etc/modprobe.d/nixos.conf"; - } - { - object = pkgs.kmod-debian-aliases; - symlink = "/etc/modprobe.d/debian.conf"; - } - ] - ++ lib.optionals config.services.multipath.enable [ - { - object = - pkgs.runCommand "multipath.conf" - { - src = config.environment.etc."multipath.conf".text; - preferLocalBuild = true; - } - '' - target=$out - printf "$src" > $out - substituteInPlace $out \ - --replace ${config.services.multipath.package}/lib ${extraUtils}/lib - ''; - symlink = "/etc/multipath.conf"; - } - ] - ++ (lib.mapAttrsToList (symlink: options: { - inherit symlink; - object = options.source; - }) config.boot.initrd.extraFiles); + contents = [ + { + object = bootStage1; + symlink = "/init"; + } + { + object = "${modulesClosure}/lib"; + symlink = "/lib"; + } + { + object = "${pkgs.kmod-blacklist-ubuntu}/modprobe.conf"; + symlink = "/etc/modprobe.d/ubuntu.conf"; + } + { + object = config.environment.etc."modprobe.d/nixos.conf".source; + symlink = "/etc/modprobe.d/nixos.conf"; + } + { + object = pkgs.kmod-debian-aliases; + symlink = "/etc/modprobe.d/debian.conf"; + } + ] + ++ lib.optionals config.services.multipath.enable [ + { + object = + pkgs.runCommand "multipath.conf" + { + src = config.environment.etc."multipath.conf".text; + preferLocalBuild = true; + } + '' + target=$out + printf "$src" > $out + substituteInPlace $out \ + --replace ${config.services.multipath.package}/lib ${extraUtils}/lib + ''; + symlink = "/etc/multipath.conf"; + } + ] + ++ (lib.mapAttrsToList (symlink: options: { + inherit symlink; + object = options.source; + }) config.boot.initrd.extraFiles); }; # Script to add secret files to the initrd at bootloader update time diff --git a/nixos/modules/system/boot/stratisroot.nix b/nixos/modules/system/boot/stratisroot.nix index 68c387f2d3cc..1f91192c93c1 100644 --- a/nixos/modules/system/boot/stratisroot.nix +++ b/nixos/modules/system/boot/stratisroot.nix @@ -70,26 +70,25 @@ in }; }) requiredStratisFilesystems; }; - availableKernelModules = - [ - "dm-thin-pool" - "dm-crypt" - ] - ++ [ - "aes" - "aes_generic" - "blowfish" - "twofish" - "serpent" - "cbc" - "xts" - "lrw" - "sha1" - "sha256" - "sha512" - "af_alg" - "algif_skcipher" - ]; + availableKernelModules = [ + "dm-thin-pool" + "dm-crypt" + ] + ++ [ + "aes" + "aes_generic" + "blowfish" + "twofish" + "serpent" + "cbc" + "xts" + "lrw" + "sha1" + "sha256" + "sha512" + "af_alg" + "algif_skcipher" + ]; services.udev.packages = [ pkgs.stratisd.initrd pkgs.lvm2 diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 567ea9bf9233..2fa9eb16d82b 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -26,185 +26,184 @@ let sliceToUnit ; - upstreamSystemUnits = - [ - # Targets. - "basic.target" - "sysinit.target" - "sockets.target" - "exit.target" - "graphical.target" - "multi-user.target" - "network.target" - "network-pre.target" - "network-online.target" - "nss-lookup.target" - "nss-user-lookup.target" - "time-sync.target" - "first-boot-complete.target" - ] - ++ optionals cfg.package.withCryptsetup [ - "cryptsetup.target" - "cryptsetup-pre.target" - "remote-cryptsetup.target" - ] - ++ [ - "sigpwr.target" - "timers.target" - "paths.target" - "rpcbind.target" + upstreamSystemUnits = [ + # Targets. + "basic.target" + "sysinit.target" + "sockets.target" + "exit.target" + "graphical.target" + "multi-user.target" + "network.target" + "network-pre.target" + "network-online.target" + "nss-lookup.target" + "nss-user-lookup.target" + "time-sync.target" + "first-boot-complete.target" + ] + ++ optionals cfg.package.withCryptsetup [ + "cryptsetup.target" + "cryptsetup-pre.target" + "remote-cryptsetup.target" + ] + ++ [ + "sigpwr.target" + "timers.target" + "paths.target" + "rpcbind.target" - # Rescue mode. - "rescue.target" - "rescue.service" + # Rescue mode. + "rescue.target" + "rescue.service" - # systemd-debug-generator - "debug-shell.service" + # systemd-debug-generator + "debug-shell.service" - # Udev. - "systemd-udevd-control.socket" - "systemd-udevd-kernel.socket" - "systemd-udevd.service" - "systemd-udev-settle.service" - ] - ++ (optional (!config.boot.isContainer) "systemd-udev-trigger.service") - ++ [ - # hwdb.bin is managed by NixOS - # "systemd-hwdb-update.service" + # Udev. + "systemd-udevd-control.socket" + "systemd-udevd-kernel.socket" + "systemd-udevd.service" + "systemd-udev-settle.service" + ] + ++ (optional (!config.boot.isContainer) "systemd-udev-trigger.service") + ++ [ + # hwdb.bin is managed by NixOS + # "systemd-hwdb-update.service" - # Hardware (started by udev when a relevant device is plugged in). - "sound.target" - "bluetooth.target" - "printer.target" - "smartcard.target" + # Hardware (started by udev when a relevant device is plugged in). + "sound.target" + "bluetooth.target" + "printer.target" + "smartcard.target" - # Kernel module loading. - "systemd-modules-load.service" - "kmod-static-nodes.service" - "modprobe@.service" + # Kernel module loading. + "systemd-modules-load.service" + "kmod-static-nodes.service" + "modprobe@.service" - # Filesystems. - "systemd-fsck@.service" - "systemd-fsck-root.service" - "systemd-growfs@.service" - "systemd-growfs-root.service" - "systemd-remount-fs.service" - "systemd-pstore.service" - "local-fs.target" - "local-fs-pre.target" - "remote-fs.target" - "remote-fs-pre.target" - "swap.target" - "dev-hugepages.mount" - "dev-mqueue.mount" - "sys-fs-fuse-connections.mount" - ] - ++ (optional (!config.boot.isContainer) "sys-kernel-config.mount") - ++ [ - "sys-kernel-debug.mount" - "sys-kernel-tracing.mount" + # Filesystems. + "systemd-fsck@.service" + "systemd-fsck-root.service" + "systemd-growfs@.service" + "systemd-growfs-root.service" + "systemd-remount-fs.service" + "systemd-pstore.service" + "local-fs.target" + "local-fs-pre.target" + "remote-fs.target" + "remote-fs-pre.target" + "swap.target" + "dev-hugepages.mount" + "dev-mqueue.mount" + "sys-fs-fuse-connections.mount" + ] + ++ (optional (!config.boot.isContainer) "sys-kernel-config.mount") + ++ [ + "sys-kernel-debug.mount" + "sys-kernel-tracing.mount" - # Maintaining state across reboots. - "systemd-random-seed.service" - ] - ++ (optional cfg.package.withBootloader "systemd-boot-random-seed.service") - ++ [ - "systemd-backlight@.service" - "systemd-rfkill.service" - "systemd-rfkill.socket" + # Maintaining state across reboots. + "systemd-random-seed.service" + ] + ++ (optional cfg.package.withBootloader "systemd-boot-random-seed.service") + ++ [ + "systemd-backlight@.service" + "systemd-rfkill.service" + "systemd-rfkill.socket" - # Hibernate / suspend. - "hibernate.target" - "suspend.target" - "suspend-then-hibernate.target" - "sleep.target" - "hybrid-sleep.target" - "systemd-hibernate.service" - ] - ++ (lib.optional cfg.package.withEfi "systemd-hibernate-clear.service") - ++ [ - "systemd-hybrid-sleep.service" - "systemd-suspend.service" - "systemd-suspend-then-hibernate.service" + # Hibernate / suspend. + "hibernate.target" + "suspend.target" + "suspend-then-hibernate.target" + "sleep.target" + "hybrid-sleep.target" + "systemd-hibernate.service" + ] + ++ (lib.optional cfg.package.withEfi "systemd-hibernate-clear.service") + ++ [ + "systemd-hybrid-sleep.service" + "systemd-suspend.service" + "systemd-suspend-then-hibernate.service" - # Reboot stuff. - "reboot.target" - "systemd-reboot.service" - "poweroff.target" - "systemd-poweroff.service" - "halt.target" - "systemd-halt.service" - "shutdown.target" - "umount.target" - "final.target" - "kexec.target" - "systemd-kexec.service" - ] - ++ lib.optional cfg.package.withUtmp "systemd-update-utmp.service" - ++ [ + # Reboot stuff. + "reboot.target" + "systemd-reboot.service" + "poweroff.target" + "systemd-poweroff.service" + "halt.target" + "systemd-halt.service" + "shutdown.target" + "umount.target" + "final.target" + "kexec.target" + "systemd-kexec.service" + ] + ++ lib.optional cfg.package.withUtmp "systemd-update-utmp.service" + ++ [ - # Password entry. - "systemd-ask-password-console.path" - "systemd-ask-password-console.service" - "systemd-ask-password-wall.path" - "systemd-ask-password-wall.service" + # Password entry. + "systemd-ask-password-console.path" + "systemd-ask-password-console.service" + "systemd-ask-password-wall.path" + "systemd-ask-password-wall.service" - # Varlink APIs - ] - ++ lib.optionals cfg.package.withBootloader [ - "systemd-bootctl@.service" - "systemd-bootctl.socket" - ] - ++ [ - "systemd-creds@.service" - "systemd-creds.socket" - ] - ++ lib.optional cfg.package.withTpm2Units [ - "systemd-pcrlock@.service" - "systemd-pcrlock.socket" - ] - ++ [ + # Varlink APIs + ] + ++ lib.optionals cfg.package.withBootloader [ + "systemd-bootctl@.service" + "systemd-bootctl.socket" + ] + ++ [ + "systemd-creds@.service" + "systemd-creds.socket" + ] + ++ lib.optional cfg.package.withTpm2Units [ + "systemd-pcrlock@.service" + "systemd-pcrlock.socket" + ] + ++ [ - # Slices / containers. - "slices.target" - ] - ++ optionals cfg.package.withImportd [ - "systemd-importd.service" - ] - ++ optionals cfg.package.withMachined [ - "machine.slice" - "machines.target" - "systemd-machined.service" - ] - ++ [ - "systemd-nspawn@.service" + # Slices / containers. + "slices.target" + ] + ++ optionals cfg.package.withImportd [ + "systemd-importd.service" + ] + ++ optionals cfg.package.withMachined [ + "machine.slice" + "machines.target" + "systemd-machined.service" + ] + ++ [ + "systemd-nspawn@.service" - # Misc. - "systemd-sysctl.service" - "systemd-machine-id-commit.service" - ] - ++ optionals cfg.package.withTimedated [ - "dbus-org.freedesktop.timedate1.service" - "systemd-timedated.service" - ] - ++ optionals cfg.package.withLocaled [ - "dbus-org.freedesktop.locale1.service" - "systemd-localed.service" - ] - ++ optionals cfg.package.withHostnamed [ - "dbus-org.freedesktop.hostname1.service" - "systemd-hostnamed.service" - "systemd-hostnamed.socket" - ] - ++ optionals cfg.package.withPortabled [ - "dbus-org.freedesktop.portable1.service" - "systemd-portabled.service" - ] - ++ [ - "systemd-exit.service" - "systemd-update-done.service" - ] - ++ cfg.additionalUpstreamSystemUnits; + # Misc. + "systemd-sysctl.service" + "systemd-machine-id-commit.service" + ] + ++ optionals cfg.package.withTimedated [ + "dbus-org.freedesktop.timedate1.service" + "systemd-timedated.service" + ] + ++ optionals cfg.package.withLocaled [ + "dbus-org.freedesktop.locale1.service" + "systemd-localed.service" + ] + ++ optionals cfg.package.withHostnamed [ + "dbus-org.freedesktop.hostname1.service" + "systemd-hostnamed.service" + "systemd-hostnamed.socket" + ] + ++ optionals cfg.package.withPortabled [ + "dbus-org.freedesktop.portable1.service" + "systemd-portabled.service" + ] + ++ [ + "systemd-exit.service" + "systemd-update-done.service" + ] + ++ cfg.additionalUpstreamSystemUnits; upstreamSystemWants = [ "sysinit.target.wants" diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index eed6be0765ef..b76682e4d6f0 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -78,7 +78,8 @@ let "timers.target" "umount.target" "systemd-bsod.service" - ] ++ cfg.additionalUpstreamUnits; + ] + ++ cfg.additionalUpstreamUnits; upstreamWants = [ "sysinit.target.wants" @@ -379,15 +380,15 @@ in }; config = mkIf (config.boot.initrd.enable && cfg.enable) { - assertions = - [ - { - assertion = - cfg.root == "fstab" -> any (fs: fs.mountPoint == "/") (builtins.attrValues config.fileSystems); - message = "The ‘fileSystems’ option does not specify your root file system."; - } - ] - ++ map + assertions = [ + { + assertion = + cfg.root == "fstab" -> any (fs: fs.mountPoint == "/") (builtins.attrValues config.fileSystems); + message = "The ‘fileSystems’ option does not specify your root file system."; + } + ] + ++ + map (name: { assertion = lib.attrByPath name (throw "impossible") config.boot.initrd == ""; message = '' @@ -422,16 +423,16 @@ in # systemd needs this for some features "autofs" # systemd-cryptenroll - ] ++ lib.optional cfg.package.withEfi "efivarfs"; + ] + ++ lib.optional cfg.package.withEfi "efivarfs"; - boot.kernelParams = - [ - "root=${config.boot.initrd.systemd.root}" - ] - ++ lib.optional (config.boot.resumeDevice != "") "resume=${config.boot.resumeDevice}" - # `systemd` mounts root in initrd as read-only unless "rw" is on the kernel command line. - # For NixOS activation to succeed, we need to have root writable in initrd. - ++ lib.optional (config.boot.initrd.systemd.root == "gpt-auto") "rw"; + boot.kernelParams = [ + "root=${config.boot.initrd.systemd.root}" + ] + ++ lib.optional (config.boot.resumeDevice != "") "resume=${config.boot.resumeDevice}" + # `systemd` mounts root in initrd as read-only unless "rw" is on the kernel command line. + # For NixOS activation to succeed, we need to have root writable in initrd. + ++ lib.optional (config.boot.initrd.systemd.root == "gpt-auto") "rw"; boot.initrd.systemd = { # bashInteractive is easier to use and also required by debug-shell.service @@ -450,98 +451,96 @@ in managerEnvironment.PATH = "/bin:/sbin"; - contents = - { - "/tmp/.keep".text = "systemd requires the /tmp mount point in the initrd cpio archive"; - "/init".source = "${cfg.package}/lib/systemd/systemd"; - "/etc/systemd/system".source = stage1Units; + contents = { + "/tmp/.keep".text = "systemd requires the /tmp mount point in the initrd cpio archive"; + "/init".source = "${cfg.package}/lib/systemd/systemd"; + "/etc/systemd/system".source = stage1Units; - "/etc/systemd/system.conf".text = '' - [Manager] - DefaultEnvironment=PATH=/bin:/sbin - ${cfg.extraConfig} - ManagerEnvironment=${ - lib.concatStringsSep " " ( - lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment - ) - } - ''; + "/etc/systemd/system.conf".text = '' + [Manager] + DefaultEnvironment=PATH=/bin:/sbin + ${cfg.extraConfig} + ManagerEnvironment=${ + lib.concatStringsSep " " ( + lib.mapAttrsToList (n: v: "${n}=${lib.escapeShellArg v}") cfg.managerEnvironment + ) + } + ''; - "/lib".source = "${config.system.build.modulesClosure}/lib"; + "/lib".source = "${config.system.build.modulesClosure}/lib"; - "/etc/modules-load.d/nixos.conf".text = concatStringsSep "\n" config.boot.initrd.kernelModules; + "/etc/modules-load.d/nixos.conf".text = concatStringsSep "\n" config.boot.initrd.kernelModules; - # We can use either ! or * to lock the root account in the - # console, but some software like OpenSSH won't even allow you - # to log in with an SSH key if you use ! so we use * instead - "/etc/shadow".text = - let - ea = cfg.emergencyAccess; - access = ea != null && !(isBool ea && !ea); - passwd = if isString ea then ea else ""; - in - "root:${if access then passwd else "*"}:::::::"; + # We can use either ! or * to lock the root account in the + # console, but some software like OpenSSH won't even allow you + # to log in with an SSH key if you use ! so we use * instead + "/etc/shadow".text = + let + ea = cfg.emergencyAccess; + access = ea != null && !(isBool ea && !ea); + passwd = if isString ea then ea else ""; + in + "root:${if access then passwd else "*"}:::::::"; - "/bin".source = "${initrdBinEnv}/bin"; - "/sbin".source = "${initrdBinEnv}/sbin"; + "/bin".source = "${initrdBinEnv}/bin"; + "/sbin".source = "${initrdBinEnv}/sbin"; - "/etc/sysctl.d/nixos.conf".text = "kernel.modprobe = /sbin/modprobe"; - "/etc/modprobe.d/systemd.conf".source = "${cfg.package}/lib/modprobe.d/systemd.conf"; - "/etc/modprobe.d/ubuntu.conf".source = "${pkgs.kmod-blacklist-ubuntu}/modprobe.conf"; - "/etc/modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases; + "/etc/sysctl.d/nixos.conf".text = "kernel.modprobe = /sbin/modprobe"; + "/etc/modprobe.d/systemd.conf".source = "${cfg.package}/lib/modprobe.d/systemd.conf"; + "/etc/modprobe.d/ubuntu.conf".source = "${pkgs.kmod-blacklist-ubuntu}/modprobe.conf"; + "/etc/modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases; - "/etc/os-release".source = config.boot.initrd.osRelease; - "/etc/initrd-release".source = config.boot.initrd.osRelease; + "/etc/os-release".source = config.boot.initrd.osRelease; + "/etc/initrd-release".source = config.boot.initrd.osRelease; - # For systemd-journald's _HOSTNAME field; needs to be set early, cannot be backfilled. - "/etc/hostname".text = config.networking.hostName; + # For systemd-journald's _HOSTNAME field; needs to be set early, cannot be backfilled. + "/etc/hostname".text = config.networking.hostName; - } - // optionalAttrs (config.environment.etc ? "modprobe.d/nixos.conf") { - "/etc/modprobe.d/nixos.conf".source = config.environment.etc."modprobe.d/nixos.conf".source; - }; + } + // optionalAttrs (config.environment.etc ? "modprobe.d/nixos.conf") { + "/etc/modprobe.d/nixos.conf".source = config.environment.etc."modprobe.d/nixos.conf".source; + }; - storePaths = - [ - # systemd tooling - "${cfg.package}/lib/systemd/systemd-executor" - "${cfg.package}/lib/systemd/systemd-fsck" - "${cfg.package}/lib/systemd/systemd-hibernate-resume" - "${cfg.package}/lib/systemd/systemd-journald" - "${cfg.package}/lib/systemd/systemd-makefs" - "${cfg.package}/lib/systemd/systemd-modules-load" - "${cfg.package}/lib/systemd/systemd-remount-fs" - "${cfg.package}/lib/systemd/systemd-shutdown" - "${cfg.package}/lib/systemd/systemd-sulogin-shell" - "${cfg.package}/lib/systemd/systemd-sysctl" - "${cfg.package}/lib/systemd/systemd-bsod" - "${cfg.package}/lib/systemd/systemd-sysroot-fstab-check" + storePaths = [ + # systemd tooling + "${cfg.package}/lib/systemd/systemd-executor" + "${cfg.package}/lib/systemd/systemd-fsck" + "${cfg.package}/lib/systemd/systemd-hibernate-resume" + "${cfg.package}/lib/systemd/systemd-journald" + "${cfg.package}/lib/systemd/systemd-makefs" + "${cfg.package}/lib/systemd/systemd-modules-load" + "${cfg.package}/lib/systemd/systemd-remount-fs" + "${cfg.package}/lib/systemd/systemd-shutdown" + "${cfg.package}/lib/systemd/systemd-sulogin-shell" + "${cfg.package}/lib/systemd/systemd-sysctl" + "${cfg.package}/lib/systemd/systemd-bsod" + "${cfg.package}/lib/systemd/systemd-sysroot-fstab-check" - # generators - "${cfg.package}/lib/systemd/system-generators/systemd-debug-generator" - "${cfg.package}/lib/systemd/system-generators/systemd-fstab-generator" - "${cfg.package}/lib/systemd/system-generators/systemd-gpt-auto-generator" - "${cfg.package}/lib/systemd/system-generators/systemd-hibernate-resume-generator" - "${cfg.package}/lib/systemd/system-generators/systemd-run-generator" + # generators + "${cfg.package}/lib/systemd/system-generators/systemd-debug-generator" + "${cfg.package}/lib/systemd/system-generators/systemd-fstab-generator" + "${cfg.package}/lib/systemd/system-generators/systemd-gpt-auto-generator" + "${cfg.package}/lib/systemd/system-generators/systemd-hibernate-resume-generator" + "${cfg.package}/lib/systemd/system-generators/systemd-run-generator" - # utilities needed by systemd - "${cfg.package.util-linux}/bin/mount" - "${cfg.package.util-linux}/bin/umount" - "${cfg.package.util-linux}/bin/sulogin" + # utilities needed by systemd + "${cfg.package.util-linux}/bin/mount" + "${cfg.package.util-linux}/bin/umount" + "${cfg.package.util-linux}/bin/sulogin" - # required for services generated with writeShellScript and friends - pkgs.runtimeShell - # some tools like xfs still want the sh symlink - "${pkgs.bashNonInteractive}/bin" + # required for services generated with writeShellScript and friends + pkgs.runtimeShell + # some tools like xfs still want the sh symlink + "${pkgs.bashNonInteractive}/bin" - # so NSS can look up usernames - "${pkgs.glibc}/lib/libnss_files.so.2" + # so NSS can look up usernames + "${pkgs.glibc}/lib/libnss_files.so.2" - # Resolving sysroot symlinks without code exec - "${pkgs.chroot-realpath}/bin/chroot-realpath" - ] - ++ jobScripts - ++ map (c: builtins.removeAttrs c [ "text" ]) (builtins.attrValues cfg.contents); + # Resolving sysroot symlinks without code exec + "${pkgs.chroot-realpath}/bin/chroot-realpath" + ] + ++ jobScripts + ++ map (c: builtins.removeAttrs c [ "text" ]) (builtins.attrValues cfg.contents); targets.initrd.aliases = [ "default.target" ]; units = diff --git a/nixos/modules/system/boot/systemd/logind.nix b/nixos/modules/system/boot/systemd/logind.nix index 456d0d99b075..097b77a91656 100644 --- a/nixos/modules/system/boot/systemd/logind.nix +++ b/nixos/modules/system/boot/systemd/logind.nix @@ -167,26 +167,25 @@ in }; config = { - systemd.additionalUpstreamSystemUnits = - [ - "systemd-logind.service" - "autovt@.service" - "systemd-user-sessions.service" - ] - ++ lib.optionals config.systemd.package.withImportd [ - "dbus-org.freedesktop.import1.service" - ] - ++ lib.optionals config.systemd.package.withMachined [ - "dbus-org.freedesktop.machine1.service" - ] - ++ lib.optionals config.systemd.package.withPortabled [ - "dbus-org.freedesktop.portable1.service" - ] - ++ [ - "dbus-org.freedesktop.login1.service" - "user@.service" - "user-runtime-dir@.service" - ]; + systemd.additionalUpstreamSystemUnits = [ + "systemd-logind.service" + "autovt@.service" + "systemd-user-sessions.service" + ] + ++ lib.optionals config.systemd.package.withImportd [ + "dbus-org.freedesktop.import1.service" + ] + ++ lib.optionals config.systemd.package.withMachined [ + "dbus-org.freedesktop.machine1.service" + ] + ++ lib.optionals config.systemd.package.withPortabled [ + "dbus-org.freedesktop.portable1.service" + ] + ++ [ + "dbus-org.freedesktop.login1.service" + "user@.service" + "user-runtime-dir@.service" + ]; environment.etc = { "systemd/logind.conf".text = '' diff --git a/nixos/modules/system/boot/systemd/nspawn.nix b/nixos/modules/system/boot/systemd/nspawn.nix index 21684aed66d4..b57499a6b8e7 100644 --- a/nixos/modules/system/boot/systemd/nspawn.nix +++ b/nixos/modules/system/boot/systemd/nspawn.nix @@ -160,7 +160,8 @@ let [Network] ${attrsToSection def.networkConfig} ''; - } // def; + } + // def; in base // { unit = makeUnit name base; }; diff --git a/nixos/modules/system/boot/systemd/repart.nix b/nixos/modules/system/boot/systemd/repart.nix index 1240ee3244d1..fce8e417991d 100644 --- a/nixos/modules/system/boot/systemd/repart.nix +++ b/nixos/modules/system/boot/systemd/repart.nix @@ -148,7 +148,8 @@ in 'boot.initrd.systemd.repart.enable' requires 'boot.initrd.systemd.enable' to be enabled. ''; } - ] ++ partitionAssertions; + ] + ++ partitionAssertions; # systemd-repart uses loopback devices for partition creation boot.initrd.availableKernelModules = lib.optional initrdCfg.enable "loop"; diff --git a/nixos/modules/system/boot/systemd/shutdown.nix b/nixos/modules/system/boot/systemd/shutdown.nix index 242b47cc40b1..b42aaf5a0d32 100644 --- a/nixos/modules/system/boot/systemd/shutdown.nix +++ b/nixos/modules/system/boot/systemd/shutdown.nix @@ -45,7 +45,8 @@ in systemd.shutdownRamfs.storePaths = [ pkgs.runtimeShell "${pkgs.coreutils}/bin" - ] ++ map (c: builtins.removeAttrs c [ "text" ]) (builtins.attrValues cfg.contents); + ] + ++ map (c: builtins.removeAttrs c [ "text" ]) (builtins.attrValues cfg.contents); systemd.mounts = [ { diff --git a/nixos/modules/system/boot/systemd/sysusers.nix b/nixos/modules/system/boot/systemd/sysusers.nix index 083b14d6e701..99c55467dce1 100644 --- a/nixos/modules/system/boot/systemd/sysusers.nix +++ b/nixos/modules/system/boot/systemd/sysusers.nix @@ -81,23 +81,22 @@ in config = lib.mkIf cfg.enable { - assertions = - [ - { - assertion = config.system.activationScripts.users == ""; - message = "system.activationScripts.users has to be empty to use systemd-sysusers"; - } - ] - ++ (lib.mapAttrsToList (username: opts: { - assertion = opts.enable -> !opts.isNormalUser; - message = "${username} is a normal user. systemd-sysusers doesn't create normal users, only system users."; - }) userCfg.users) - ++ lib.mapAttrsToList (username: opts: { - assertion = - (opts.password == opts.initialPassword || opts.password == null) - && (opts.hashedPassword == opts.initialHashedPassword || opts.hashedPassword == null); - message = "user '${username}' uses password or hashedPassword. systemd-sysupdate only supports initial passwords. It'll never update your passwords."; - }) systemUsers; + assertions = [ + { + assertion = config.system.activationScripts.users == ""; + message = "system.activationScripts.users has to be empty to use systemd-sysusers"; + } + ] + ++ (lib.mapAttrsToList (username: opts: { + assertion = opts.enable -> !opts.isNormalUser; + message = "${username} is a normal user. systemd-sysusers doesn't create normal users, only system users."; + }) userCfg.users) + ++ lib.mapAttrsToList (username: opts: { + assertion = + (opts.password == opts.initialPassword || opts.password == null) + && (opts.hashedPassword == opts.initialHashedPassword || opts.hashedPassword == null); + message = "user '${username}' uses password or hashedPassword. systemd-sysupdate only supports initial passwords. It'll never update your passwords."; + }) systemUsers; systemd = { diff --git a/nixos/modules/system/boot/systemd/tmpfiles.nix b/nixos/modules/system/boot/systemd/tmpfiles.nix index d5541be0e966..21d14fe22cb9 100644 --- a/nixos/modules/system/boot/systemd/tmpfiles.nix +++ b/nixos/modules/system/boot/systemd/tmpfiles.nix @@ -288,21 +288,20 @@ in (pkgs.symlinkJoin { name = "tmpfiles.d"; paths = map (p: p + "/lib/tmpfiles.d") cfg.packages; - postBuild = + postBuild = '' + for i in $(cat $pathsPath); do + (test -d "$i" && test $(ls "$i"/*.conf | wc -l) -ge 1) || ( + echo "ERROR: The path '$i' from systemd.tmpfiles.packages contains no *.conf files." + exit 1 + ) + done + '' + + concatMapStrings ( + name: + optionalString (hasPrefix "tmpfiles.d/" name) '' + rm -f $out/${removePrefix "tmpfiles.d/" name} '' - for i in $(cat $pathsPath); do - (test -d "$i" && test $(ls "$i"/*.conf | wc -l) -ge 1) || ( - echo "ERROR: The path '$i' from systemd.tmpfiles.packages contains no *.conf files." - exit 1 - ) - done - '' - + concatMapStrings ( - name: - optionalString (hasPrefix "tmpfiles.d/" name) '' - rm -f $out/${removePrefix "tmpfiles.d/" name} - '' - ) config.system.build.etc.passthru.targets; + ) config.system.build.etc.passthru.targets; }) + "/*"; "mtab" = { @@ -311,61 +310,59 @@ in }; }; - systemd.tmpfiles.packages = - [ - # Default tmpfiles rules provided by systemd - (pkgs.runCommand "systemd-default-tmpfiles" { } '' - mkdir -p $out/lib/tmpfiles.d - cd $out/lib/tmpfiles.d + systemd.tmpfiles.packages = [ + # Default tmpfiles rules provided by systemd + (pkgs.runCommand "systemd-default-tmpfiles" { } '' + mkdir -p $out/lib/tmpfiles.d + cd $out/lib/tmpfiles.d - ln -s "${systemd}/example/tmpfiles.d/home.conf" - ln -s "${systemd}/example/tmpfiles.d/journal-nocow.conf" - ln -s "${systemd}/example/tmpfiles.d/portables.conf" - ln -s "${systemd}/example/tmpfiles.d/static-nodes-permissions.conf" - ln -s "${systemd}/example/tmpfiles.d/systemd.conf" - ln -s "${systemd}/example/tmpfiles.d/systemd-nologin.conf" - ln -s "${systemd}/example/tmpfiles.d/systemd-nspawn.conf" - ln -s "${systemd}/example/tmpfiles.d/systemd-tmp.conf" - ln -s "${systemd}/example/tmpfiles.d/tmp.conf" - ln -s "${systemd}/example/tmpfiles.d/var.conf" - ln -s "${systemd}/example/tmpfiles.d/x11.conf" - '') - # User-specified tmpfiles rules - (pkgs.writeTextFile { - name = "nixos-tmpfiles.d"; - destination = "/lib/tmpfiles.d/00-nixos.conf"; - text = '' - # This file is created automatically and should not be modified. - # Please change the option ‘systemd.tmpfiles.rules’ instead. + ln -s "${systemd}/example/tmpfiles.d/home.conf" + ln -s "${systemd}/example/tmpfiles.d/journal-nocow.conf" + ln -s "${systemd}/example/tmpfiles.d/portables.conf" + ln -s "${systemd}/example/tmpfiles.d/static-nodes-permissions.conf" + ln -s "${systemd}/example/tmpfiles.d/systemd.conf" + ln -s "${systemd}/example/tmpfiles.d/systemd-nologin.conf" + ln -s "${systemd}/example/tmpfiles.d/systemd-nspawn.conf" + ln -s "${systemd}/example/tmpfiles.d/systemd-tmp.conf" + ln -s "${systemd}/example/tmpfiles.d/tmp.conf" + ln -s "${systemd}/example/tmpfiles.d/var.conf" + ln -s "${systemd}/example/tmpfiles.d/x11.conf" + '') + # User-specified tmpfiles rules + (pkgs.writeTextFile { + name = "nixos-tmpfiles.d"; + destination = "/lib/tmpfiles.d/00-nixos.conf"; + text = '' + # This file is created automatically and should not be modified. + # Please change the option ‘systemd.tmpfiles.rules’ instead. - ${concatStringsSep "\n" cfg.rules} - ''; - }) - ] - ++ (mapAttrsToList ( - name: paths: pkgs.writeTextDir "lib/tmpfiles.d/${name}.conf" (mkRuleFileContent paths) - ) cfg.settings); + ${concatStringsSep "\n" cfg.rules} + ''; + }) + ] + ++ (mapAttrsToList ( + name: paths: pkgs.writeTextDir "lib/tmpfiles.d/${name}.conf" (mkRuleFileContent paths) + ) cfg.settings); - systemd.tmpfiles.rules = - [ - "d /run/lock 0755 root root - -" - "d /var/db 0755 root root - -" - "L /var/lock - - - - ../run/lock" - ] - ++ lib.optionals config.nix.enable [ - "d /nix/var 0755 root root - -" - "L+ /nix/var/nix/gcroots/booted-system 0755 root root - /run/booted-system" - ] - # Boot-time cleanup - ++ [ - "R! /etc/group.lock - - - - -" - "R! /etc/passwd.lock - - - - -" - "R! /etc/shadow.lock - - - - -" - ] - ++ lib.optionals config.nix.enable [ - "R! /nix/var/nix/gcroots/tmp - - - - -" - "R! /nix/var/nix/temproots - - - - -" - ]; + systemd.tmpfiles.rules = [ + "d /run/lock 0755 root root - -" + "d /var/db 0755 root root - -" + "L /var/lock - - - - ../run/lock" + ] + ++ lib.optionals config.nix.enable [ + "d /nix/var 0755 root root - -" + "L+ /nix/var/nix/gcroots/booted-system 0755 root root - /run/booted-system" + ] + # Boot-time cleanup + ++ [ + "R! /etc/group.lock - - - - -" + "R! /etc/passwd.lock - - - - -" + "R! /etc/shadow.lock - - - - -" + ] + ++ lib.optionals config.nix.enable [ + "R! /nix/var/nix/gcroots/tmp - - - - -" + "R! /nix/var/nix/temproots - - - - -" + ]; boot.initrd.systemd = { additionalUpstreamUnits = [ diff --git a/nixos/modules/system/boot/systemd/tpm2.nix b/nixos/modules/system/boot/systemd/tpm2.nix index 8bf3b8413574..dcdd08b24783 100644 --- a/nixos/modules/system/boot/systemd/tpm2.nix +++ b/nixos/modules/system/boot/systemd/tpm2.nix @@ -64,11 +64,12 @@ "systemd-tpm2-setup-early.service" ]; - boot.initrd.availableKernelModules = - [ "tpm-tis" ] - ++ lib.optional ( - !(pkgs.stdenv.hostPlatform.isRiscV64 || pkgs.stdenv.hostPlatform.isArmv7) - ) "tpm-crb"; + boot.initrd.availableKernelModules = [ + "tpm-tis" + ] + ++ lib.optional ( + !(pkgs.stdenv.hostPlatform.isRiscV64 || pkgs.stdenv.hostPlatform.isArmv7) + ) "tpm-crb"; boot.initrd.systemd.storePaths = [ pkgs.tpm2-tss "${cfg.package}/lib/systemd/systemd-tpm2-setup" diff --git a/nixos/modules/system/boot/systemd/user.nix b/nixos/modules/system/boot/systemd/user.nix index 8f1d92c409b3..6d60e7c1e7f1 100644 --- a/nixos/modules/system/boot/systemd/user.nix +++ b/nixos/modules/system/boot/systemd/user.nix @@ -44,7 +44,8 @@ let "systemd-exit.service" "timers.target" "xdg-desktop-autostart.target" - ] ++ config.systemd.additionalUpstreamUserUnits; + ] + ++ config.systemd.additionalUpstreamUserUnits; writeTmpfiles = { diff --git a/nixos/modules/system/boot/timesyncd.nix b/nixos/modules/system/boot/timesyncd.nix index 4a4e39c07e41..eed83af5715f 100644 --- a/nixos/modules/system/boot/timesyncd.nix +++ b/nixos/modules/system/boot/timesyncd.nix @@ -99,17 +99,16 @@ in ); }; - environment.etc."systemd/timesyncd.conf".text = - '' - [Time] - '' - + optionalString (cfg.servers != null) '' - NTP=${concatStringsSep " " cfg.servers} - '' - + optionalString (cfg.fallbackServers != null) '' - FallbackNTP=${concatStringsSep " " cfg.fallbackServers} - '' - + cfg.extraConfig; + environment.etc."systemd/timesyncd.conf".text = '' + [Time] + '' + + optionalString (cfg.servers != null) '' + NTP=${concatStringsSep " " cfg.servers} + '' + + optionalString (cfg.fallbackServers != null) '' + FallbackNTP=${concatStringsSep " " cfg.fallbackServers} + '' + + cfg.extraConfig; users.users.systemd-timesync = { uid = config.ids.uids.systemd-timesync; diff --git a/nixos/modules/system/boot/uki.nix b/nixos/modules/system/boot/uki.nix index d9f4713b307c..692261d512dd 100644 --- a/nixos/modules/system/boot/uki.nix +++ b/nixos/modules/system/boot/uki.nix @@ -77,18 +77,18 @@ in ); boot.uki.settings = { - UKI = - { - Linux = lib.mkOptionDefault "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}"; - Initrd = lib.mkOptionDefault "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}"; - Cmdline = lib.mkOptionDefault "init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}"; - Stub = lib.mkOptionDefault "${pkgs.systemd}/lib/systemd/boot/efi/linux${efiArch}.efi.stub"; - Uname = lib.mkOptionDefault "${config.boot.kernelPackages.kernel.modDirVersion}"; - OSRelease = lib.mkOptionDefault "@${config.system.build.etc}/etc/os-release"; - # This is needed for cross compiling. - EFIArch = lib.mkOptionDefault efiArch; - } - // lib.optionalAttrs (config.hardware.deviceTree.enable && config.hardware.deviceTree.name != null) + UKI = { + Linux = lib.mkOptionDefault "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}"; + Initrd = lib.mkOptionDefault "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}"; + Cmdline = lib.mkOptionDefault "init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}"; + Stub = lib.mkOptionDefault "${pkgs.systemd}/lib/systemd/boot/efi/linux${efiArch}.efi.stub"; + Uname = lib.mkOptionDefault "${config.boot.kernelPackages.kernel.modDirVersion}"; + OSRelease = lib.mkOptionDefault "@${config.system.build.etc}/etc/os-release"; + # This is needed for cross compiling. + EFIArch = lib.mkOptionDefault efiArch; + } + // + lib.optionalAttrs (config.hardware.deviceTree.enable && config.hardware.deviceTree.name != null) { DeviceTree = lib.mkOptionDefault "${config.hardware.deviceTree.package}/${config.hardware.deviceTree.name}"; }; diff --git a/nixos/modules/system/etc/etc-activation.nix b/nixos/modules/system/etc/etc-activation.nix index e539500a1ba5..40cb28d0434f 100644 --- a/nixos/modules/system/etc/etc-activation.nix +++ b/nixos/modules/system/etc/etc-activation.nix @@ -103,20 +103,18 @@ ); requiredBy = [ "initrd-fs.target" ]; before = [ "initrd-fs.target" ]; - requires = - [ - config.boot.initrd.systemd.services.initrd-find-etc.name - ] - ++ lib.optionals config.system.etc.overlay.mutable [ - config.boot.initrd.systemd.services."rw-etc".name - ]; - after = - [ - config.boot.initrd.systemd.services.initrd-find-etc.name - ] - ++ lib.optionals config.system.etc.overlay.mutable [ - config.boot.initrd.systemd.services."rw-etc".name - ]; + requires = [ + config.boot.initrd.systemd.services.initrd-find-etc.name + ] + ++ lib.optionals config.system.etc.overlay.mutable [ + config.boot.initrd.systemd.services."rw-etc".name + ]; + after = [ + config.boot.initrd.systemd.services.initrd-find-etc.name + ] + ++ lib.optionals config.system.etc.overlay.mutable [ + config.boot.initrd.systemd.services."rw-etc".name + ]; unitConfig = { RequiresMountsFor = [ "/sysroot/nix/store" diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index e52f09bd8706..0cf83ca62d44 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -223,38 +223,37 @@ let makeFstabEntries = let - fsToSkipCheck = - [ - "none" - "auto" - "overlay" - "iso9660" - "bindfs" - "udf" - "btrfs" - "zfs" - "tmpfs" - "bcachefs" - "nfs" - "nfs4" - "nilfs2" - "vboxsf" - "squashfs" - "glusterfs" - "apfs" - "9p" - "cifs" - "prl_fs" - "vmhgfs" - ] - ++ lib.optionals (!config.boot.initrd.checkJournalingFS) [ - "ext3" - "ext4" - "reiserfs" - "xfs" - "jfs" - "f2fs" - ]; + fsToSkipCheck = [ + "none" + "auto" + "overlay" + "iso9660" + "bindfs" + "udf" + "btrfs" + "zfs" + "tmpfs" + "bcachefs" + "nfs" + "nfs4" + "nilfs2" + "vboxsf" + "squashfs" + "glusterfs" + "apfs" + "9p" + "cifs" + "prl_fs" + "vmhgfs" + ] + ++ lib.optionals (!config.boot.initrd.checkJournalingFS) [ + "ext3" + "ext4" + "reiserfs" + "xfs" + "jfs" + "f2fs" + ]; isBindMount = fs: builtins.elem "bind" fs.options; skipCheck = fs: fs.noCheck || fs.device == "none" || builtins.elem fs.fsType fsToSkipCheck || isBindMount fs; @@ -555,79 +554,78 @@ in ]; # Sync mount options with systemd's src/core/mount-setup.c: mount_table. - boot.specialFileSystems = - { - "/proc" = { - fsType = "proc"; - options = [ - "nosuid" - "noexec" - "nodev" - ]; - }; - "/run" = { - fsType = "tmpfs"; - options = [ - "nosuid" - "nodev" - "strictatime" - "mode=755" - "size=${config.boot.runSize}" - ]; - }; - "/dev" = { - fsType = "devtmpfs"; - options = [ - "nosuid" - "strictatime" - "mode=755" - "size=${config.boot.devSize}" - ]; - }; - "/dev/shm" = { - fsType = "tmpfs"; - options = [ - "nosuid" - "nodev" - "strictatime" - "mode=1777" - "size=${config.boot.devShmSize}" - ]; - }; - "/dev/pts" = { - fsType = "devpts"; - options = [ - "nosuid" - "noexec" - "mode=620" - "ptmxmode=0666" - "gid=${toString config.ids.gids.tty}" - ]; - }; - - # To hold secrets that shouldn't be written to disk - "/run/keys" = { - fsType = "ramfs"; - options = [ - "nosuid" - "nodev" - "mode=750" - ]; - }; - } - // optionalAttrs (!config.boot.isContainer) { - # systemd-nspawn populates /sys by itself, and remounting it causes all - # kinds of weird issues (most noticeably, waiting for host disk device - # nodes). - "/sys" = { - fsType = "sysfs"; - options = [ - "nosuid" - "noexec" - "nodev" - ]; - }; + boot.specialFileSystems = { + "/proc" = { + fsType = "proc"; + options = [ + "nosuid" + "noexec" + "nodev" + ]; }; + "/run" = { + fsType = "tmpfs"; + options = [ + "nosuid" + "nodev" + "strictatime" + "mode=755" + "size=${config.boot.runSize}" + ]; + }; + "/dev" = { + fsType = "devtmpfs"; + options = [ + "nosuid" + "strictatime" + "mode=755" + "size=${config.boot.devSize}" + ]; + }; + "/dev/shm" = { + fsType = "tmpfs"; + options = [ + "nosuid" + "nodev" + "strictatime" + "mode=1777" + "size=${config.boot.devShmSize}" + ]; + }; + "/dev/pts" = { + fsType = "devpts"; + options = [ + "nosuid" + "noexec" + "mode=620" + "ptmxmode=0666" + "gid=${toString config.ids.gids.tty}" + ]; + }; + + # To hold secrets that shouldn't be written to disk + "/run/keys" = { + fsType = "ramfs"; + options = [ + "nosuid" + "nodev" + "mode=750" + ]; + }; + } + // optionalAttrs (!config.boot.isContainer) { + # systemd-nspawn populates /sys by itself, and remounting it causes all + # kinds of weird issues (most noticeably, waiting for host disk device + # nodes). + "/sys" = { + fsType = "sysfs"; + options = [ + "nosuid" + "noexec" + "nodev" + ]; + }; + }; }; diff --git a/nixos/modules/tasks/filesystems/bcachefs.nix b/nixos/modules/tasks/filesystems/bcachefs.nix index 97d4bd283115..d9c93ebadadc 100644 --- a/nixos/modules/tasks/filesystems/bcachefs.nix +++ b/nixos/modules/tasks/filesystems/bcachefs.nix @@ -236,18 +236,17 @@ in (lib.mkIf ((config.boot.initrd.supportedFilesystems.bcachefs or false) || (bootFs != { })) { inherit assertions; - boot.initrd.availableKernelModules = - [ - "bcachefs" - "sha256" - ] - ++ lib.optionals (config.boot.kernelPackages.kernel.kernelOlder "6.15") [ - # chacha20 and poly1305 are required only for decryption attempts - # kernel 6.15 uses kernel api libraries for poly1305/chacha20: 4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d - # kernel 6.16 removes poly1305: ceef731b0e22df80a13d67773ae9afd55a971f9e - "poly1305" - "chacha20" - ]; + boot.initrd.availableKernelModules = [ + "bcachefs" + "sha256" + ] + ++ lib.optionals (config.boot.kernelPackages.kernel.kernelOlder "6.15") [ + # chacha20 and poly1305 are required only for decryption attempts + # kernel 6.15 uses kernel api libraries for poly1305/chacha20: 4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d + # kernel 6.16 removes poly1305: ceef731b0e22df80a13d67773ae9afd55a971f9e + "poly1305" + "chacha20" + ]; boot.initrd.systemd.extraBin = { # do we need this? boot/systemd.nix:566 & boot/systemd/initrd.nix:357 "bcachefs" = "${pkgs.bcachefs-tools}/bin/bcachefs"; diff --git a/nixos/modules/tasks/filesystems/btrfs.nix b/nixos/modules/tasks/filesystems/btrfs.nix index 738fa0851006..1c14b03a0a30 100644 --- a/nixos/modules/tasks/filesystems/btrfs.nix +++ b/nixos/modules/tasks/filesystems/btrfs.nix @@ -75,14 +75,15 @@ in (mkIf inInitrd { boot.initrd.kernelModules = [ "btrfs" ]; - boot.initrd.availableKernelModules = - [ "crc32c" ] - ++ optionals (config.boot.kernelPackages.kernel.kernelAtLeast "5.5") [ - # Needed for mounting filesystems with new checksums - "xxhash_generic" - "blake2b_generic" - "sha256_generic" # Should be baked into our kernel, just to be sure - ]; + boot.initrd.availableKernelModules = [ + "crc32c" + ] + ++ optionals (config.boot.kernelPackages.kernel.kernelAtLeast "5.5") [ + # Needed for mounting filesystems with new checksums + "xxhash_generic" + "blake2b_generic" + "sha256_generic" # Should be baked into our kernel, just to be sure + ]; boot.initrd.extraUtilsCommands = mkIf (!config.boot.initrd.systemd.enable) '' copy_bin_and_libs ${pkgs.btrfs-progs}/bin/btrfs diff --git a/nixos/modules/tasks/filesystems/nfs.nix b/nixos/modules/tasks/filesystems/nfs.nix index 2c65ebcea1b0..3630b20f9ff3 100644 --- a/nixos/modules/tasks/filesystems/nfs.nix +++ b/nixos/modules/tasks/filesystems/nfs.nix @@ -35,26 +35,24 @@ let lockd.udp-port = cfg.server.lockdPort; }; - nfsConfDeprecated = - cfg.extraConfig - + '' - [nfsd] - threads=${toString cfg.server.nproc} - ${lib.optionalString (cfg.server.hostName != null) "host=${cfg.server.hostName}"} - ${cfg.server.extraNfsdConfig} + nfsConfDeprecated = cfg.extraConfig + '' + [nfsd] + threads=${toString cfg.server.nproc} + ${lib.optionalString (cfg.server.hostName != null) "host=${cfg.server.hostName}"} + ${cfg.server.extraNfsdConfig} - [mountd] - ${lib.optionalString (cfg.server.mountdPort != null) "port=${toString cfg.server.mountdPort}"} + [mountd] + ${lib.optionalString (cfg.server.mountdPort != null) "port=${toString cfg.server.mountdPort}"} - [statd] - ${lib.optionalString (cfg.server.statdPort != null) "port=${toString cfg.server.statdPort}"} + [statd] + ${lib.optionalString (cfg.server.statdPort != null) "port=${toString cfg.server.statdPort}"} - [lockd] - ${lib.optionalString (cfg.server.lockdPort != null) '' - port=${toString cfg.server.lockdPort} - udp-port=${toString cfg.server.lockdPort} - ''} - ''; + [lockd] + ${lib.optionalString (cfg.server.lockdPort != null) '' + port=${toString cfg.server.lockdPort} + udp-port=${toString cfg.server.lockdPort} + ''} + ''; nfsConfFile = if cfg.settings != { } then diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index b57b44414d21..d070b5a4c0e0 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -167,12 +167,14 @@ let # https://github.com/zfsonlinux/zfs/pull/4943 wants = [ "systemd-udev-settle.service" - ] ++ lib.optional (config.boot.initrd.clevis.useTang) "network-online.target"; + ] + ++ lib.optional (config.boot.initrd.clevis.useTang) "network-online.target"; after = [ "systemd-udev-settle.service" "systemd-modules-load.service" "systemd-ask-password-console.service" - ] ++ lib.optional (config.boot.initrd.clevis.useTang) "network-online.target"; + ] + ++ lib.optional (config.boot.initrd.clevis.useTang) "network-online.target"; requiredBy = let poolFilesystems = getPoolFilesystems pool; diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index 48d297a45d73..2b25e44294d6 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -342,11 +342,12 @@ let ]; bindsTo = deps ++ optional v.rstp "mstpd.service"; partOf = [ "network-setup.service" ] ++ optional v.rstp "mstpd.service"; - after = - [ "network-pre.target" ] - ++ deps - ++ optional v.rstp "mstpd.service" - ++ map (i: "network-addresses-${i}.service") v.interfaces; + after = [ + "network-pre.target" + ] + ++ deps + ++ optional v.rstp "mstpd.service" + ++ map (i: "network-addresses-${i}.service") v.interfaces; before = [ "network-setup.service" ]; serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; @@ -442,7 +443,8 @@ let wantedBy = [ "network-setup.service" (subsystemDevice n) - ] ++ internalConfigs; + ] + ++ internalConfigs; # before = [ "network-setup.service" ]; # should work without internalConfigs dependencies because address/link configuration depends # on the device, which is created by ovs-vswitchd with type=internal, but it does not... @@ -452,7 +454,8 @@ let after = [ "network-pre.target" "ovs-vswitchd.service" - ] ++ deps; # start switch after physical interfaces and vswitch daemon + ] + ++ deps; # start switch after physical interfaces and vswitch daemon wants = deps; # if one or more interface fails, the switch should continue to run serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; diff --git a/nixos/modules/tasks/network-interfaces-systemd.nix b/nixos/modules/tasks/network-interfaces-systemd.nix index 64cba018ca60..653fafb9b216 100644 --- a/nixos/modules/tasks/network-interfaces-systemd.nix +++ b/nixos/modules/tasks/network-interfaces-systemd.nix @@ -237,43 +237,41 @@ in vlanNetworks ]; boot.initrd.availableKernelModules = - optional (cfg.bridges != { }) "bridge" - ++ optional (cfg.vlans != { }) "8021q"; + optional (cfg.bridges != { }) "bridge" ++ optional (cfg.vlans != { }) "8021q"; }) (mkIf cfg.useNetworkd { - assertions = - [ - { - assertion = cfg.defaultGatewayWindowSize == null; - message = "networking.defaultGatewayWindowSize is not supported by networkd."; - } - { - assertion = cfg.defaultGateway != null -> cfg.defaultGateway.interface != null; - message = "networking.defaultGateway.interface is not optional when using networkd."; - } - { - assertion = cfg.defaultGateway6 != null -> cfg.defaultGateway6.interface != null; - message = "networking.defaultGateway6.interface is not optional when using networkd."; - } - ] - ++ flip mapAttrsToList cfg.bridges ( - n: - { rstp, ... }: - { - assertion = !rstp; - message = "networking.bridges.${n}.rstp is not supported by networkd."; - } - ) - ++ flip mapAttrsToList cfg.fooOverUDP ( - n: - { local, ... }: - { - assertion = local == null; - message = "networking.fooOverUDP.${n}.local is not supported by networkd."; - } - ); + assertions = [ + { + assertion = cfg.defaultGatewayWindowSize == null; + message = "networking.defaultGatewayWindowSize is not supported by networkd."; + } + { + assertion = cfg.defaultGateway != null -> cfg.defaultGateway.interface != null; + message = "networking.defaultGateway.interface is not optional when using networkd."; + } + { + assertion = cfg.defaultGateway6 != null -> cfg.defaultGateway6.interface != null; + message = "networking.defaultGateway6.interface is not optional when using networkd."; + } + ] + ++ flip mapAttrsToList cfg.bridges ( + n: + { rstp, ... }: + { + assertion = !rstp; + message = "networking.bridges.${n}.rstp is not supported by networkd."; + } + ) + ++ flip mapAttrsToList cfg.fooOverUDP ( + n: + { local, ... }: + { + assertion = local == null; + message = "networking.fooOverUDP.${n}.local is not supported by networkd."; + } + ); networking.dhcpcd.enable = mkDefault false; @@ -409,14 +407,13 @@ in # unfortunately networkd cannot encode dependencies of netdevs on addresses/routes, # so we cannot specify Local=, Peer=, PeerPort=. this looks like a missing feature # in networkd. - fooOverUDPConfig = - { - Port = fou.port; - Encapsulation = if fou.protocol != null then "FooOverUDP" else "GenericUDPEncapsulation"; - } - // (optionalAttrs (fou.protocol != null) { - Protocol = fou.protocol; - }); + fooOverUDPConfig = { + Port = fou.port; + Encapsulation = if fou.protocol != null then "FooOverUDP" else "GenericUDPEncapsulation"; + } + // (optionalAttrs (fou.protocol != null) { + Protocol = fou.protocol; + }); }; } ) @@ -554,7 +551,8 @@ in after = [ "network-pre.target" "ovs-vswitchd.service" - ] ++ deps; + ] + ++ deps; wants = deps; # if one or more interface fails, the switch should continue to run serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index 2b8a938c81ae..d056cd45655b 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -1733,31 +1733,30 @@ in # from being created. optionalString hasBonds "options bonding max_bonds=0"; - boot.kernel.sysctl = - { - "net.ipv4.conf.all.forwarding" = mkDefault (any (i: i.proxyARP) interfaces); - "net.ipv6.conf.all.disable_ipv6" = mkDefault (!cfg.enableIPv6); - "net.ipv6.conf.default.disable_ipv6" = mkDefault (!cfg.enableIPv6); - # allow all users to do ICMP echo requests (ping) - "net.ipv4.ping_group_range" = mkDefault "0 2147483647"; - # networkmanager falls back to "/proc/sys/net/ipv6/conf/default/use_tempaddr" - "net.ipv6.conf.default.use_tempaddr" = tempaddrValues.${cfg.tempAddresses}.sysctl; - } - // listToAttrs ( - forEach interfaces ( - i: nameValuePair "net.ipv4.conf.${replaceStrings [ "." ] [ "/" ] i.name}.proxy_arp" i.proxyARP - ) + boot.kernel.sysctl = { + "net.ipv4.conf.all.forwarding" = mkDefault (any (i: i.proxyARP) interfaces); + "net.ipv6.conf.all.disable_ipv6" = mkDefault (!cfg.enableIPv6); + "net.ipv6.conf.default.disable_ipv6" = mkDefault (!cfg.enableIPv6); + # allow all users to do ICMP echo requests (ping) + "net.ipv4.ping_group_range" = mkDefault "0 2147483647"; + # networkmanager falls back to "/proc/sys/net/ipv6/conf/default/use_tempaddr" + "net.ipv6.conf.default.use_tempaddr" = tempaddrValues.${cfg.tempAddresses}.sysctl; + } + // listToAttrs ( + forEach interfaces ( + i: nameValuePair "net.ipv4.conf.${replaceStrings [ "." ] [ "/" ] i.name}.proxy_arp" i.proxyARP ) - // listToAttrs ( - forEach interfaces ( - i: - let - opt = i.tempAddress; - val = tempaddrValues.${opt}.sysctl; - in - nameValuePair "net.ipv6.conf.${replaceStrings [ "." ] [ "/" ] i.name}.use_tempaddr" val - ) - ); + ) + // listToAttrs ( + forEach interfaces ( + i: + let + opt = i.tempAddress; + val = tempaddrValues.${opt}.sysctl; + in + nameValuePair "net.ipv6.conf.${replaceStrings [ "." ] [ "/" ] i.name}.use_tempaddr" val + ) + ); environment.etc.hostid = mkIf (cfg.hostId != null) { source = hostidFile; }; boot.initrd.systemd.contents."/etc/hostid" = mkIf (cfg.hostId != null) { source = hostidFile; }; @@ -1768,18 +1767,17 @@ in text = cfg.hostName + "\n"; }; - environment.systemPackages = - [ - pkgs.host - pkgs.hostname-debian - pkgs.iproute2 - pkgs.iputils - ] - ++ optionals config.networking.wireless.enable [ - pkgs.wirelesstools # FIXME: obsolete? - pkgs.iw - ] - ++ bridgeStp; + environment.systemPackages = [ + pkgs.host + pkgs.hostname-debian + pkgs.iproute2 + pkgs.iputils + ] + ++ optionals config.networking.wireless.enable [ + pkgs.wirelesstools # FIXME: obsolete? + pkgs.iw + ] + ++ bridgeStp; # Wake-on-LAN configuration is shared by the scripted and networkd backends. systemd.network.links = pipe interfaces [ @@ -1815,147 +1813,146 @@ in virtualisation.vswitch = mkIf (cfg.vswitches != { }) { enable = true; }; - services.udev.packages = - [ - (pkgs.writeTextFile rec { - name = "ipv6-privacy-extensions.rules"; - destination = "/etc/udev/rules.d/98-${name}"; - text = - let - sysctl-value = tempaddrValues.${cfg.tempAddresses}.sysctl; - in - '' - # enable and prefer IPv6 privacy addresses by default - ACTION=="add", SUBSYSTEM=="net", RUN+="${pkgs.bash}/bin/sh -c 'echo ${sysctl-value} > /proc/sys/net/ipv6/conf/$name/use_tempaddr'" - ''; - }) - (pkgs.writeTextFile rec { - name = "ipv6-privacy-extensions.rules"; - destination = "/etc/udev/rules.d/99-${name}"; - text = concatMapStrings ( - i: - let - opt = i.tempAddress; - val = tempaddrValues.${opt}.sysctl; - msg = tempaddrValues.${opt}.description; - in - '' - # override to ${msg} for ${i.name} - ACTION=="add", SUBSYSTEM=="net", NAME=="${i.name}", RUN+="${pkgs.procps}/bin/sysctl net.ipv6.conf.${ - replaceStrings [ "." ] [ "/" ] i.name - }.use_tempaddr=${val}" - '' - ) (filter (i: i.tempAddress != cfg.tempAddresses) interfaces); - }) - ] - ++ lib.optional (cfg.wlanInterfaces != { }) ( - pkgs.writeTextFile { - name = "99-zzz-40-wlanInterfaces.rules"; - destination = "/etc/udev/rules.d/99-zzz-40-wlanInterfaces.rules"; - text = - let - # Collect all interfaces that are defined for a device - # as device:interface key:value pairs. - wlanDeviceInterfaces = - let - allDevices = unique (mapAttrsToList (_: v: v.device) cfg.wlanInterfaces); - interfacesOfDevice = d: filterAttrs (_: v: v.device == d) cfg.wlanInterfaces; - in - genAttrs allDevices (d: interfacesOfDevice d); - - # Convert device:interface key:value pairs into a list, and if it exists, - # place the interface which is named after the device at the beginning. - wlanListDeviceFirst = - device: interfaces: - if hasAttr device interfaces then - mapAttrsToList (n: v: v // { _iName = n; }) (filterAttrs (n: _: n == device) interfaces) - ++ mapAttrsToList (n: v: v // { _iName = n; }) (filterAttrs (n: _: n != device) interfaces) - else - mapAttrsToList (n: v: v // { _iName = n; }) interfaces; - - # Udev script to execute for the default WLAN interface with the persistend udev name. - # The script creates the required, new WLAN interfaces interfaces and configures the - # existing, default interface. - curInterfaceScript = - device: current: new: - pkgs.writeScript "udev-run-script-wlan-interfaces-${device}.sh" '' - #!${pkgs.runtimeShell} - # Change the wireless phy device to a predictable name. - ${pkgs.iw}/bin/iw phy `${pkgs.coreutils}/bin/cat /sys/class/net/$INTERFACE/phy80211/name` set name ${device} - - # Add new WLAN interfaces - ${flip concatMapStrings new (i: '' - ${pkgs.iw}/bin/iw phy ${device} interface add ${i._iName} type managed - '')} - - # Configure the current interface - ${pkgs.iw}/bin/iw dev ${device} set type ${current.type} - ${optionalString ( - current.type == "mesh" && current.meshID != null - ) "${pkgs.iw}/bin/iw dev ${device} set meshid ${current.meshID}"} - ${optionalString ( - current.type == "monitor" && current.flags != null - ) "${pkgs.iw}/bin/iw dev ${device} set monitor ${current.flags}"} - ${optionalString ( - current.type == "managed" && current.fourAddr != null - ) "${pkgs.iw}/bin/iw dev ${device} set 4addr ${if current.fourAddr then "on" else "off"}"} - ${optionalString ( - current.mac != null - ) "${pkgs.iproute2}/bin/ip link set dev ${device} address ${current.mac}"} - ''; - - # Udev script to execute for a new WLAN interface. The script configures the new WLAN interface. - newInterfaceScript = - new: - pkgs.writeScript "udev-run-script-wlan-interfaces-${new._iName}.sh" '' - #!${pkgs.runtimeShell} - # Configure the new interface - ${pkgs.iw}/bin/iw dev ${new._iName} set type ${new.type} - ${optionalString ( - new.type == "mesh" && new.meshID != null - ) "${pkgs.iw}/bin/iw dev ${new._iName} set meshid ${new.meshID}"} - ${optionalString ( - new.type == "monitor" && new.flags != null - ) "${pkgs.iw}/bin/iw dev ${new._iName} set monitor ${new.flags}"} - ${optionalString ( - new.type == "managed" && new.fourAddr != null - ) "${pkgs.iw}/bin/iw dev ${new._iName} set 4addr ${if new.fourAddr then "on" else "off"}"} - ${optionalString ( - new.mac != null - ) "${pkgs.iproute2}/bin/ip link set dev ${new._iName} address ${new.mac}"} - ''; - - # Udev attributes for systemd to name the device and to create a .device target. - systemdAttrs = - n: - ''NAME:="${n}", ENV{INTERFACE}="${n}", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/${n}", TAG+="systemd"''; - in - flip (concatMapStringsSep "\n") (attrNames wlanDeviceInterfaces) ( - device: + services.udev.packages = [ + (pkgs.writeTextFile rec { + name = "ipv6-privacy-extensions.rules"; + destination = "/etc/udev/rules.d/98-${name}"; + text = + let + sysctl-value = tempaddrValues.${cfg.tempAddresses}.sysctl; + in + '' + # enable and prefer IPv6 privacy addresses by default + ACTION=="add", SUBSYSTEM=="net", RUN+="${pkgs.bash}/bin/sh -c 'echo ${sysctl-value} > /proc/sys/net/ipv6/conf/$name/use_tempaddr'" + ''; + }) + (pkgs.writeTextFile rec { + name = "ipv6-privacy-extensions.rules"; + destination = "/etc/udev/rules.d/99-${name}"; + text = concatMapStrings ( + i: + let + opt = i.tempAddress; + val = tempaddrValues.${opt}.sysctl; + msg = tempaddrValues.${opt}.description; + in + '' + # override to ${msg} for ${i.name} + ACTION=="add", SUBSYSTEM=="net", NAME=="${i.name}", RUN+="${pkgs.procps}/bin/sysctl net.ipv6.conf.${ + replaceStrings [ "." ] [ "/" ] i.name + }.use_tempaddr=${val}" + '' + ) (filter (i: i.tempAddress != cfg.tempAddresses) interfaces); + }) + ] + ++ lib.optional (cfg.wlanInterfaces != { }) ( + pkgs.writeTextFile { + name = "99-zzz-40-wlanInterfaces.rules"; + destination = "/etc/udev/rules.d/99-zzz-40-wlanInterfaces.rules"; + text = + let + # Collect all interfaces that are defined for a device + # as device:interface key:value pairs. + wlanDeviceInterfaces = let - interfaces = wlanListDeviceFirst device wlanDeviceInterfaces.${device}; - curInterface = elemAt interfaces 0; - newInterfaces = drop 1 interfaces; + allDevices = unique (mapAttrsToList (_: v: v.device) cfg.wlanInterfaces); + interfacesOfDevice = d: filterAttrs (_: v: v.device == d) cfg.wlanInterfaces; in - '' - # It is important to have that rule first as overwriting the NAME attribute also prevents the - # next rules from matching. - ${flip (concatMapStringsSep "\n") (wlanListDeviceFirst device wlanDeviceInterfaces.${device}) ( - interface: - ''ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", ENV{INTERFACE}=="${interface._iName}", ${systemdAttrs interface._iName}, RUN+="${newInterfaceScript interface}"'' - )} + genAttrs allDevices (d: interfacesOfDevice d); - # Add the required, new WLAN interfaces to the default WLAN interface with the - # persistent, default name as assigned by udev. - ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", NAME=="${device}", ${systemdAttrs curInterface._iName}, RUN+="${ - curInterfaceScript device curInterface newInterfaces - }" - # Generate the same systemd events for both 'add' and 'move' udev events. - ACTION=="move", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", NAME=="${device}", ${systemdAttrs curInterface._iName} - '' - ); - } - ); + # Convert device:interface key:value pairs into a list, and if it exists, + # place the interface which is named after the device at the beginning. + wlanListDeviceFirst = + device: interfaces: + if hasAttr device interfaces then + mapAttrsToList (n: v: v // { _iName = n; }) (filterAttrs (n: _: n == device) interfaces) + ++ mapAttrsToList (n: v: v // { _iName = n; }) (filterAttrs (n: _: n != device) interfaces) + else + mapAttrsToList (n: v: v // { _iName = n; }) interfaces; + + # Udev script to execute for the default WLAN interface with the persistend udev name. + # The script creates the required, new WLAN interfaces interfaces and configures the + # existing, default interface. + curInterfaceScript = + device: current: new: + pkgs.writeScript "udev-run-script-wlan-interfaces-${device}.sh" '' + #!${pkgs.runtimeShell} + # Change the wireless phy device to a predictable name. + ${pkgs.iw}/bin/iw phy `${pkgs.coreutils}/bin/cat /sys/class/net/$INTERFACE/phy80211/name` set name ${device} + + # Add new WLAN interfaces + ${flip concatMapStrings new (i: '' + ${pkgs.iw}/bin/iw phy ${device} interface add ${i._iName} type managed + '')} + + # Configure the current interface + ${pkgs.iw}/bin/iw dev ${device} set type ${current.type} + ${optionalString ( + current.type == "mesh" && current.meshID != null + ) "${pkgs.iw}/bin/iw dev ${device} set meshid ${current.meshID}"} + ${optionalString ( + current.type == "monitor" && current.flags != null + ) "${pkgs.iw}/bin/iw dev ${device} set monitor ${current.flags}"} + ${optionalString ( + current.type == "managed" && current.fourAddr != null + ) "${pkgs.iw}/bin/iw dev ${device} set 4addr ${if current.fourAddr then "on" else "off"}"} + ${optionalString ( + current.mac != null + ) "${pkgs.iproute2}/bin/ip link set dev ${device} address ${current.mac}"} + ''; + + # Udev script to execute for a new WLAN interface. The script configures the new WLAN interface. + newInterfaceScript = + new: + pkgs.writeScript "udev-run-script-wlan-interfaces-${new._iName}.sh" '' + #!${pkgs.runtimeShell} + # Configure the new interface + ${pkgs.iw}/bin/iw dev ${new._iName} set type ${new.type} + ${optionalString ( + new.type == "mesh" && new.meshID != null + ) "${pkgs.iw}/bin/iw dev ${new._iName} set meshid ${new.meshID}"} + ${optionalString ( + new.type == "monitor" && new.flags != null + ) "${pkgs.iw}/bin/iw dev ${new._iName} set monitor ${new.flags}"} + ${optionalString ( + new.type == "managed" && new.fourAddr != null + ) "${pkgs.iw}/bin/iw dev ${new._iName} set 4addr ${if new.fourAddr then "on" else "off"}"} + ${optionalString ( + new.mac != null + ) "${pkgs.iproute2}/bin/ip link set dev ${new._iName} address ${new.mac}"} + ''; + + # Udev attributes for systemd to name the device and to create a .device target. + systemdAttrs = + n: + ''NAME:="${n}", ENV{INTERFACE}="${n}", ENV{SYSTEMD_ALIAS}="/sys/subsystem/net/devices/${n}", TAG+="systemd"''; + in + flip (concatMapStringsSep "\n") (attrNames wlanDeviceInterfaces) ( + device: + let + interfaces = wlanListDeviceFirst device wlanDeviceInterfaces.${device}; + curInterface = elemAt interfaces 0; + newInterfaces = drop 1 interfaces; + in + '' + # It is important to have that rule first as overwriting the NAME attribute also prevents the + # next rules from matching. + ${flip (concatMapStringsSep "\n") (wlanListDeviceFirst device wlanDeviceInterfaces.${device}) ( + interface: + ''ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", ENV{INTERFACE}=="${interface._iName}", ${systemdAttrs interface._iName}, RUN+="${newInterfaceScript interface}"'' + )} + + # Add the required, new WLAN interfaces to the default WLAN interface with the + # persistent, default name as assigned by udev. + ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", NAME=="${device}", ${systemdAttrs curInterface._iName}, RUN+="${ + curInterfaceScript device curInterface newInterfaces + }" + # Generate the same systemd events for both 'add' and 'move' udev events. + ACTION=="move", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", NAME=="${device}", ${systemdAttrs curInterface._iName} + '' + ); + } + ); }; } diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index 4e07ec3d32bd..a0c7e826223d 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -117,13 +117,12 @@ in virtualisation.containers.containersConf.settings = { network.cni_plugin_dirs = map (p: "${lib.getBin p}/bin") cfg.containersConf.cniPlugins; - engine = - { - init_path = "${pkgs.catatonit}/bin/catatonit"; - } - // lib.optionalAttrs cfg.ociSeccompBpfHook.enable { - hooks_dir = [ config.boot.kernelPackages.oci-seccomp-bpf-hook ]; - }; + engine = { + init_path = "${pkgs.catatonit}/bin/catatonit"; + } + // lib.optionalAttrs cfg.ociSeccompBpfHook.enable { + hooks_dir = [ config.boot.kernelPackages.oci-seccomp-bpf-hook ]; + }; }; virtualisation.containers.storage.settings.storage = { diff --git a/nixos/modules/virtualisation/digital-ocean-config.nix b/nixos/modules/virtualisation/digital-ocean-config.nix index b46cf0f82131..1668153944da 100644 --- a/nixos/modules/virtualisation/digital-ocean-config.nix +++ b/nixos/modules/virtualisation/digital-ocean-config.nix @@ -100,10 +100,11 @@ with lib; }; unitConfig = { ConditionPathExists = "!${doMetadataFile}"; - After = - [ "network-pre.target" ] - ++ optional config.networking.dhcpcd.enable "dhcpcd.service" - ++ optional config.systemd.network.enable "systemd-networkd.service"; + After = [ + "network-pre.target" + ] + ++ optional config.networking.dhcpcd.enable "dhcpcd.service" + ++ optional config.systemd.network.enable "systemd-networkd.service"; }; }; diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index 6f5b67e12980..58a8de8972d0 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -286,8 +286,11 @@ in ]; }; - path = - [ pkgs.kmod ] ++ optional (cfg.storageDriver == "zfs") config.boot.zfs.package ++ cfg.extraPackages; + path = [ + pkgs.kmod + ] + ++ optional (cfg.storageDriver == "zfs") config.boot.zfs.package + ++ cfg.extraPackages; }; systemd.sockets.docker = { diff --git a/nixos/modules/virtualisation/incus.nix b/nixos/modules/virtualisation/incus.nix index 6c9ce89a7d9f..3b6b88766400 100644 --- a/nixos/modules/virtualisation/incus.nix +++ b/nixos/modules/virtualisation/incus.nix @@ -316,7 +316,8 @@ in "xt_CHECKSUM" "xt_MASQUERADE" "vhost_vsock" - ] ++ lib.optionals nvidiaEnabled [ "nvidia_uvm" ]; + ] + ++ lib.optionals nvidiaEnabled [ "nvidia_uvm" ]; environment.systemPackages = [ cfg.clientPackage @@ -358,23 +359,22 @@ in include "/var/lib/incus/security/apparmor/profiles" ''; }; - includes."abstractions/base" = - '' - # Allow incusd's various AA profiles to load dynamic libraries from Nix store - # https://discuss.linuxcontainers.org/t/creating-new-containers-vms-blocked-by-apparmor-on-nixos/21908/6 - mr /nix/store/*/lib/*.so*, - r ${pkgs.stdenv.cc.libc}/lib/gconv/gconv-modules, - r ${pkgs.stdenv.cc.libc}/lib/gconv/gconv-modules.d/, - r ${pkgs.stdenv.cc.libc}/lib/gconv/gconv-modules.d/gconv-modules-extra.conf, + includes."abstractions/base" = '' + # Allow incusd's various AA profiles to load dynamic libraries from Nix store + # https://discuss.linuxcontainers.org/t/creating-new-containers-vms-blocked-by-apparmor-on-nixos/21908/6 + mr /nix/store/*/lib/*.so*, + r ${pkgs.stdenv.cc.libc}/lib/gconv/gconv-modules, + r ${pkgs.stdenv.cc.libc}/lib/gconv/gconv-modules.d/, + r ${pkgs.stdenv.cc.libc}/lib/gconv/gconv-modules.d/gconv-modules-extra.conf, - # Support use of VM instance - mrix ${pkgs.qemu_kvm}/bin/*, - k ${OVMF2MB.fd}/FV/*.fd, - k ${pkgs.OVMFFull.fd}/FV/*.fd, - '' - + lib.optionalString pkgs.stdenv.hostPlatform.isx86_64 '' - k ${pkgs.seabios-qemu}/share/seabios/bios.bin, - ''; + # Support use of VM instance + mrix ${pkgs.qemu_kvm}/bin/*, + k ${OVMF2MB.fd}/FV/*.fd, + k ${pkgs.OVMFFull.fd}/FV/*.fd, + '' + + lib.optionalString pkgs.stdenv.hostPlatform.isx86_64 '' + k ${pkgs.seabios-qemu}/share/seabios/bios.bin, + ''; }; systemd.services.incus = { @@ -387,12 +387,14 @@ in "network-online.target" "lxcfs.service" "incus.socket" - ] ++ lib.optionals config.virtualisation.vswitch.enable [ "ovs-vswitchd.service" ]; + ] + ++ lib.optionals config.virtualisation.vswitch.enable [ "ovs-vswitchd.service" ]; requires = [ "lxcfs.service" "incus.socket" - ] ++ lib.optionals config.virtualisation.vswitch.enable [ "ovs-vswitchd.service" ]; + ] + ++ lib.optionals config.virtualisation.vswitch.enable [ "ovs-vswitchd.service" ]; wants = [ "network-online.target" ]; diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index 6d739cb0fa3d..4eac848e68a8 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -526,13 +526,12 @@ in ++ cfg.extraOptions ); - path = - [ - cfg.qemu.package - pkgs.netcat - ] # libvirtd requires qemu-img to manage disk images - ++ optional vswitch.enable vswitch.package - ++ optional cfg.qemu.swtpm.enable cfg.qemu.swtpm.package; + path = [ + cfg.qemu.package + pkgs.netcat + ] # libvirtd requires qemu-img to manage disk images + ++ optional vswitch.enable vswitch.package + ++ optional cfg.qemu.swtpm.enable cfg.qemu.swtpm.package; serviceConfig = { Type = "notify"; diff --git a/nixos/modules/virtualisation/lxc-image-metadata.nix b/nixos/modules/virtualisation/lxc-image-metadata.nix index c7c56aa5273a..ad1aad4216ef 100644 --- a/nixos/modules/virtualisation/lxc-image-metadata.nix +++ b/nixos/modules/virtualisation/lxc-image-metadata.nix @@ -134,7 +134,8 @@ in }; target = "/metadata.yaml"; } - ] ++ templates.files; + ] + ++ templates.files; }; }; } diff --git a/nixos/modules/virtualisation/lxd-agent.nix b/nixos/modules/virtualisation/lxd-agent.nix index 50d9a5f26fe9..7b7093d6f680 100644 --- a/nixos/modules/virtualisation/lxd-agent.nix +++ b/nixos/modules/virtualisation/lxd-agent.nix @@ -60,13 +60,14 @@ in systemd.services.lxd-agent = { enable = true; wantedBy = [ "multi-user.target" ]; - before = - [ "shutdown.target" ] - ++ lib.optionals config.services.cloud-init.enable [ - "cloud-init.target" - "cloud-init.service" - "cloud-init-local.service" - ]; + before = [ + "shutdown.target" + ] + ++ lib.optionals config.services.cloud-init.enable [ + "cloud-init.target" + "cloud-init.service" + "cloud-init-local.service" + ]; conflicts = [ "shutdown.target" ]; path = [ pkgs.kmod diff --git a/nixos/modules/virtualisation/lxd.nix b/nixos/modules/virtualisation/lxd.nix index 24d9701b06d6..55ad4b7ce94a 100644 --- a/nixos/modules/virtualisation/lxd.nix +++ b/nixos/modules/virtualisation/lxd.nix @@ -277,6 +277,7 @@ in "xt_CHECKSUM" "xt_MASQUERADE" "vhost_vsock" - ] ++ lib.optionals (!config.networking.nftables.enable) [ "iptable_mangle" ]; + ] + ++ lib.optionals (!config.networking.nftables.enable) [ "iptable_mangle" ]; }; } diff --git a/nixos/modules/virtualisation/nixos-containers.nix b/nixos/modules/virtualisation/nixos-containers.nix index d692da48e30b..fa353d41dc04 100644 --- a/nixos/modules/virtualisation/nixos-containers.nix +++ b/nixos/modules/virtualisation/nixos-containers.nix @@ -861,7 +861,8 @@ in # Removed option. See `checkAssertion` below for the accompanying error message. pkgs = mkOption { visible = false; }; - } // networkOptions; + } + // networkOptions; config = let diff --git a/nixos/modules/virtualisation/oci-containers.nix b/nixos/modules/virtualisation/oci-containers.nix index 0cd9acd9a042..ef1dc1a90da6 100644 --- a/nixos/modules/virtualisation/oci-containers.nix +++ b/nixos/modules/virtualisation/oci-containers.nix @@ -535,36 +535,35 @@ let RequiresMountsFor = "/run/user/${toString uid}/containers"; }; - serviceConfig = - { - ### There is no generalized way of supporting `reload` for docker - ### containers. Some containers may respond well to SIGHUP sent to their - ### init process, but it is not guaranteed; some apps have other reload - ### mechanisms, some don't have a reload signal at all, and some docker - ### images just have broken signal handling. The best compromise in this - ### case is probably to leave ExecReload undefined, so `systemctl reload` - ### will at least result in an error instead of potentially undefined - ### behaviour. - ### - ### Advanced users can still override this part of the unit to implement - ### a custom reload handler, since the result of all this is a normal - ### systemd service from the perspective of the NixOS module system. - ### - # ExecReload = ...; - ### - ExecStartPre = [ "${preStartScript}/bin/pre-start" ]; - TimeoutStartSec = 0; - TimeoutStopSec = 120; - Restart = "always"; - } - // optionalAttrs (cfg.backend == "podman") { - Environment = "PODMAN_SYSTEMD_UNIT=podman-${name}.service"; - Type = "notify"; - NotifyAccess = "all"; - Delegate = mkIf (container.podman.sdnotify == "healthy") true; - User = effectiveUser; - RuntimeDirectory = escapedName; - }; + serviceConfig = { + ### There is no generalized way of supporting `reload` for docker + ### containers. Some containers may respond well to SIGHUP sent to their + ### init process, but it is not guaranteed; some apps have other reload + ### mechanisms, some don't have a reload signal at all, and some docker + ### images just have broken signal handling. The best compromise in this + ### case is probably to leave ExecReload undefined, so `systemctl reload` + ### will at least result in an error instead of potentially undefined + ### behaviour. + ### + ### Advanced users can still override this part of the unit to implement + ### a custom reload handler, since the result of all this is a normal + ### systemd service from the perspective of the NixOS module system. + ### + # ExecReload = ...; + ### + ExecStartPre = [ "${preStartScript}/bin/pre-start" ]; + TimeoutStartSec = 0; + TimeoutStopSec = 120; + Restart = "always"; + } + // optionalAttrs (cfg.backend == "podman") { + Environment = "PODMAN_SYSTEMD_UNIT=podman-${name}.service"; + Type = "notify"; + NotifyAccess = "all"; + Delegate = mkIf (container.podman.sdnotify == "healthy") true; + User = effectiveUser; + RuntimeDirectory = escapedName; + }; }; in diff --git a/nixos/modules/virtualisation/parallels-guest.nix b/nixos/modules/virtualisation/parallels-guest.nix index 4a16f63028e1..862d606dea64 100644 --- a/nixos/modules/virtualisation/parallels-guest.nix +++ b/nixos/modules/virtualisation/parallels-guest.nix @@ -58,7 +58,8 @@ in "prl_fs" "prl_fs_freeze" "prl_tg" - ] ++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "prl_notifier"; + ] + ++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "prl_notifier"; services.timesyncd.enable = false; diff --git a/nixos/modules/virtualisation/podman/default.nix b/nixos/modules/virtualisation/podman/default.nix index 6b9f72bf57e4..62bf38e31b18 100644 --- a/nixos/modules/virtualisation/podman/default.nix +++ b/nixos/modules/virtualisation/podman/default.nix @@ -161,9 +161,11 @@ in config.systemd.package # To allow systemd-based container healthchecks ] ++ lib.optional (config.boot.supportedFilesystems.zfs or false) config.boot.zfs.package; - extraRuntimes = - [ pkgs.runc ] - ++ lib.optionals + extraRuntimes = [ + pkgs.runc + ] + ++ + lib.optionals ( config.virtualisation.containers.containersConf.settings.network.default_rootless_network_cmd or "" == "slirp4netns" diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 0b0b2136ea03..47318ca4d600 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -1185,8 +1185,7 @@ in ''; boot.initrd.availableKernelModules = - optional (cfg.qemu.diskInterface == "scsi") "sym53c8xx" - ++ optional (cfg.tpm.enable) "tpm_tis"; + optional (cfg.qemu.diskInterface == "scsi") "sym53c8xx" ++ optional (cfg.tpm.enable) "tpm_tis"; virtualisation.additionalPaths = [ config.system.build.toplevel ]; @@ -1337,7 +1336,8 @@ in "version=9p2000.L" "msize=${toString cfg.msize}" "x-systemd.requires=modprobe@9pnet_virtio.service" - ] ++ lib.optional (tag == "nix-store") "cache=loose"; + ] + ++ lib.optional (tag == "nix-store") "cache=loose"; }; in lib.mkMerge [ diff --git a/nixos/modules/virtualisation/virtualbox-host.nix b/nixos/modules/virtualisation/virtualbox-host.nix index 29e2d4340f3c..1ca612269303 100644 --- a/nixos/modules/virtualisation/virtualbox-host.nix +++ b/nixos/modules/virtualisation/virtualbox-host.nix @@ -119,18 +119,17 @@ in group = "vboxusers"; setuid = true; }; - executables = - [ - "VBoxHeadless" - "VBoxNetAdpCtl" - "VBoxNetDHCP" - "VBoxNetNAT" - "VBoxVolInfo" - ] - ++ (lib.optionals (!cfg.headless) [ - "VBoxSDL" - "VirtualBoxVM" - ]); + executables = [ + "VBoxHeadless" + "VBoxNetAdpCtl" + "VBoxNetDHCP" + "VBoxNetNAT" + "VBoxVolInfo" + ] + ++ (lib.optionals (!cfg.headless) [ + "VBoxSDL" + "VirtualBoxVM" + ]); in lib.mkIf cfg.enableHardening ( builtins.listToAttrs ( diff --git a/nixos/modules/virtualisation/virtualbox-image.nix b/nixos/modules/virtualisation/virtualbox-image.nix index 26633731f647..04d36c9ce82f 100644 --- a/nixos/modules/virtualisation/virtualbox-image.nix +++ b/nixos/modules/virtualisation/virtualbox-image.nix @@ -274,21 +274,20 @@ in ''; }; - fileSystems = - { - "/" = { - device = "/dev/disk/by-label/nixos"; - autoResize = true; - fsType = "ext4"; - }; - } - // (lib.optionalAttrs (cfg.extraDisk != null) { - ${cfg.extraDisk.mountPoint} = { - device = "/dev/disk/by-label/" + cfg.extraDisk.label; - autoResize = true; - fsType = "ext4"; - }; - }); + fileSystems = { + "/" = { + device = "/dev/disk/by-label/nixos"; + autoResize = true; + fsType = "ext4"; + }; + } + // (lib.optionalAttrs (cfg.extraDisk != null) { + ${cfg.extraDisk.mountPoint} = { + device = "/dev/disk/by-label/" + cfg.extraDisk.label; + autoResize = true; + fsType = "ext4"; + }; + }); boot.growPartition = true; boot.loader.grub.device = "/dev/sda"; diff --git a/nixos/modules/virtualisation/waagent.nix b/nixos/modules/virtualisation/waagent.nix index 40737b0d9589..83e2248b7325 100644 --- a/nixos/modules/virtualisation/waagent.nix +++ b/nixos/modules/virtualisation/waagent.nix @@ -329,7 +329,8 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" - ] ++ lib.optionals config.services.cloud-init.enable [ "cloud-init.service" ]; + ] + ++ lib.optionals config.services.cloud-init.enable [ "cloud-init.service" ]; wants = [ "network-online.target" "sshd.service" diff --git a/nixos/tests/boot.nix b/nixos/tests/boot.nix index e15797765462..863d80e41dac 100644 --- a/nixos/tests/boot.nix +++ b/nixos/tests/boot.nix @@ -23,41 +23,40 @@ let let qemu = qemu-common.qemuBinary pkgs.qemu_test; - flags = - [ - "-m" - (toString memory) - "-netdev" - ("user,id=net0" + (lib.optionalString (pxe != null) ",tftp=${pxe},bootfile=netboot.ipxe")) - "-device" - ( - "virtio-net-pci,netdev=net0" - + (lib.optionalString (pxe != null && uefi) ",romfile=${pkgs.ipxe}/ipxe.efirom") - ) - ] - ++ lib.optionals (cdrom != null) [ - "-cdrom" - cdrom - ] - ++ lib.optionals (usb != null) [ - "-device" - "usb-ehci" - "-drive" - "id=usbdisk,file=${usb},if=none,readonly" - "-device" - "usb-storage,drive=usbdisk" - ] - ++ lib.optionals (pxe != null) [ - "-boot" - "order=n" - ] - ++ lib.optionals uefi [ - "-drive" - "if=pflash,format=raw,unit=0,readonly=on,file=${pkgs.OVMF.firmware}" - "-drive" - "if=pflash,format=raw,unit=1,readonly=on,file=${pkgs.OVMF.variables}" - ] - ++ extraFlags; + flags = [ + "-m" + (toString memory) + "-netdev" + ("user,id=net0" + (lib.optionalString (pxe != null) ",tftp=${pxe},bootfile=netboot.ipxe")) + "-device" + ( + "virtio-net-pci,netdev=net0" + + (lib.optionalString (pxe != null && uefi) ",romfile=${pkgs.ipxe}/ipxe.efirom") + ) + ] + ++ lib.optionals (cdrom != null) [ + "-cdrom" + cdrom + ] + ++ lib.optionals (usb != null) [ + "-device" + "usb-ehci" + "-drive" + "id=usbdisk,file=${usb},if=none,readonly" + "-device" + "usb-storage,drive=usbdisk" + ] + ++ lib.optionals (pxe != null) [ + "-boot" + "order=n" + ] + ++ lib.optionals uefi [ + "-drive" + "if=pflash,format=raw,unit=0,readonly=on,file=${pkgs.OVMF.firmware}" + "-drive" + "if=pflash,format=raw,unit=1,readonly=on,file=${pkgs.OVMF.variables}" + ] + ++ extraFlags; flagsStr = lib.concatStringsSep " " flags; in diff --git a/nixos/tests/calibre-server.nix b/nixos/tests/calibre-server.nix index 059058778526..c2a7a4fc6fa5 100644 --- a/nixos/tests/calibre-server.nix +++ b/nixos/tests/calibre-server.nix @@ -79,7 +79,8 @@ mapAttrs ( calibreConfig = { enable = true; libraries = [ "/var/lib/calibre-server" ]; - } // testConfig.calibreConfig or { }; + } + // testConfig.calibreConfig or { }; librariesInitScript = path: '' ${nodeName}.execute("touch /tmp/test.epub") ${nodeName}.execute("zip -r /tmp/test.zip /tmp/test.epub") diff --git a/nixos/tests/cassandra.nix b/nixos/tests/cassandra.nix index 1c689fb7e043..ab6e5730fe4b 100644 --- a/nixos/tests/cassandra.nix +++ b/nixos/tests/cassandra.nix @@ -80,79 +80,78 @@ in cass2 = nodeCfg "192.168.1.3" { jvmOpts = [ "-Dcassandra.replace_address=cass1" ]; }; }; - testScript = - '' - # Check configuration - with subtest("Timers exist"): - cass0.succeed("systemctl list-timers | grep cassandra-full-repair.timer") - cass0.succeed("systemctl list-timers | grep cassandra-incremental-repair.timer") + testScript = '' + # Check configuration + with subtest("Timers exist"): + cass0.succeed("systemctl list-timers | grep cassandra-full-repair.timer") + cass0.succeed("systemctl list-timers | grep cassandra-incremental-repair.timer") - with subtest("Can connect via cqlsh"): - cass0.wait_for_unit("cassandra.service") - cass0.wait_until_succeeds("nc -z cass0 9042") - cass0.succeed("echo 'show version;' | cqlsh cass0") + with subtest("Can connect via cqlsh"): + cass0.wait_for_unit("cassandra.service") + cass0.wait_until_succeeds("nc -z cass0 9042") + cass0.succeed("echo 'show version;' | cqlsh cass0") - with subtest("Nodetool is operational"): - cass0.wait_for_unit("cassandra.service") - cass0.wait_until_succeeds("nc -z localhost ${jmxPortStr}") - cass0.succeed("nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass0'") + with subtest("Nodetool is operational"): + cass0.wait_for_unit("cassandra.service") + cass0.wait_until_succeeds("nc -z localhost ${jmxPortStr}") + cass0.succeed("nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass0'") - with subtest("Cluster name was set"): - cass0.wait_for_unit("cassandra.service") - cass0.wait_until_succeeds("nc -z localhost ${jmxPortStr}") - cass0.wait_until_succeeds( - "nodetool describecluster -p ${jmxPortStr} | grep 'Name: ${clusterName}'" - ) + with subtest("Cluster name was set"): + cass0.wait_for_unit("cassandra.service") + cass0.wait_until_succeeds("nc -z localhost ${jmxPortStr}") + cass0.wait_until_succeeds( + "nodetool describecluster -p ${jmxPortStr} | grep 'Name: ${clusterName}'" + ) - with subtest("Heap limit set correctly"): - # Nodetool takes a while until it can display info - cass0.wait_until_succeeds("nodetool info -p ${jmxPortStr}") - cass0.succeed("${checkHeapLimitCommand}") + with subtest("Heap limit set correctly"): + # Nodetool takes a while until it can display info + cass0.wait_until_succeeds("nodetool info -p ${jmxPortStr}") + cass0.succeed("${checkHeapLimitCommand}") - # Check cluster interaction - with subtest("Bring up cluster"): - cass1.wait_for_unit("cassandra.service") - cass1.wait_until_succeeds( - "nodetool -p ${jmxPortStr} ${jmxAuthArgs} status | egrep -c '^UN' | grep 2" - ) - cass0.succeed("nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass1'") - '' - + lib.optionalString testRemoteAuth '' - with subtest("Remote authenticated jmx"): - # Doesn't work if not enabled - cass0.wait_until_succeeds("nc -z localhost ${jmxPortStr}") - cass1.fail("nc -z 192.168.1.1 ${jmxPortStr}") - cass1.fail("nodetool -p ${jmxPortStr} -h 192.168.1.1 status") + # Check cluster interaction + with subtest("Bring up cluster"): + cass1.wait_for_unit("cassandra.service") + cass1.wait_until_succeeds( + "nodetool -p ${jmxPortStr} ${jmxAuthArgs} status | egrep -c '^UN' | grep 2" + ) + cass0.succeed("nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass1'") + '' + + lib.optionalString testRemoteAuth '' + with subtest("Remote authenticated jmx"): + # Doesn't work if not enabled + cass0.wait_until_succeeds("nc -z localhost ${jmxPortStr}") + cass1.fail("nc -z 192.168.1.1 ${jmxPortStr}") + cass1.fail("nodetool -p ${jmxPortStr} -h 192.168.1.1 status") - # Works if enabled - cass1.wait_until_succeeds("nc -z localhost ${jmxPortStr}") - cass0.succeed("nodetool -p ${jmxPortStr} -h 192.168.1.2 ${jmxAuthArgs} status") - '' - + '' - with subtest("Break and fix node"): - cass1.block() - cass0.wait_until_succeeds( - "nodetool status -p ${jmxPortStr} --resolve-ip | egrep -c '^DN[[:space:]]+cass1'" - ) - cass0.succeed("nodetool status -p ${jmxPortStr} | egrep -c '^UN' | grep 1") - cass1.unblock() - cass1.wait_until_succeeds( - "nodetool -p ${jmxPortStr} ${jmxAuthArgs} status | egrep -c '^UN' | grep 2" - ) - cass0.succeed("nodetool status -p ${jmxPortStr} | egrep -c '^UN' | grep 2") + # Works if enabled + cass1.wait_until_succeeds("nc -z localhost ${jmxPortStr}") + cass0.succeed("nodetool -p ${jmxPortStr} -h 192.168.1.2 ${jmxAuthArgs} status") + '' + + '' + with subtest("Break and fix node"): + cass1.block() + cass0.wait_until_succeeds( + "nodetool status -p ${jmxPortStr} --resolve-ip | egrep -c '^DN[[:space:]]+cass1'" + ) + cass0.succeed("nodetool status -p ${jmxPortStr} | egrep -c '^UN' | grep 1") + cass1.unblock() + cass1.wait_until_succeeds( + "nodetool -p ${jmxPortStr} ${jmxAuthArgs} status | egrep -c '^UN' | grep 2" + ) + cass0.succeed("nodetool status -p ${jmxPortStr} | egrep -c '^UN' | grep 2") - with subtest("Replace crashed node"): - cass1.block() # .crash() waits until it's fully shutdown - cass2.start() - cass0.wait_until_fails( - "nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass1'" - ) + with subtest("Replace crashed node"): + cass1.block() # .crash() waits until it's fully shutdown + cass2.start() + cass0.wait_until_fails( + "nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass1'" + ) - cass2.wait_for_unit("cassandra.service") - cass0.wait_until_succeeds( - "nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass2'" - ) - ''; + cass2.wait_for_unit("cassandra.service") + cass0.wait_until_succeeds( + "nodetool status -p ${jmxPortStr} --resolve-ip | egrep '^UN[[:space:]]+cass2'" + ) + ''; passthru = { inherit testPackage; diff --git a/nixos/tests/chromium.nix b/nixos/tests/chromium.nix index 6e570acbae70..1efdad4e542a 100644 --- a/nixos/tests/chromium.nix +++ b/nixos/tests/chromium.nix @@ -43,17 +43,16 @@ mapAttrs ( channel: chromiumPkg: makeTest { name = "chromium-${channel}"; - meta = - { - maintainers = with maintainers; [ - aszlig - ]; - } - // optionalAttrs (chromiumPkg.meta ? timeout) { - # https://github.com/NixOS/hydra/issues/591#issuecomment-435125621 - # Note: optionalAttrs is used since meta.timeout is not set for Google Chrome - inherit (chromiumPkg.meta) timeout; - }; + meta = { + maintainers = with maintainers; [ + aszlig + ]; + } + // optionalAttrs (chromiumPkg.meta ? timeout) { + # https://github.com/NixOS/hydra/issues/591#issuecomment-435125621 + # Note: optionalAttrs is used since meta.timeout is not set for Google Chrome + inherit (chromiumPkg.meta) timeout; + }; enableOCR = true; diff --git a/nixos/tests/common/ec2.nix b/nixos/tests/common/ec2.nix index 8210e5914afb..cb66009b5a83 100644 --- a/nixos/tests/common/ec2.nix +++ b/nixos/tests/common/ec2.nix @@ -16,72 +16,70 @@ with pkgs.lib; let metaData = pkgs.stdenv.mkDerivation { name = "metadata"; - buildCommand = - '' - mkdir -p $out/1.0/meta-data - ln -s ${pkgs.writeText "userData" userData} $out/1.0/user-data - echo "${hostname}" > $out/1.0/meta-data/hostname - echo "(unknown)" > $out/1.0/meta-data/ami-manifest-path - '' - + optionalString (sshPublicKey != null) '' - mkdir -p $out/1.0/meta-data/public-keys/0 - ln -s ${pkgs.writeText "sshPublicKey" sshPublicKey} $out/1.0/meta-data/public-keys/0/openssh-key - ''; + buildCommand = '' + mkdir -p $out/1.0/meta-data + ln -s ${pkgs.writeText "userData" userData} $out/1.0/user-data + echo "${hostname}" > $out/1.0/meta-data/hostname + echo "(unknown)" > $out/1.0/meta-data/ami-manifest-path + '' + + optionalString (sshPublicKey != null) '' + mkdir -p $out/1.0/meta-data/public-keys/0 + ln -s ${pkgs.writeText "sshPublicKey" sshPublicKey} $out/1.0/meta-data/public-keys/0/openssh-key + ''; }; indentLines = str: concatLines (map (s: " " + s) (splitString "\n" str)); in makeTest { name = "ec2-" + name; nodes = { }; - testScript = - '' - import os - import subprocess - import tempfile + testScript = '' + import os + import subprocess + import tempfile - image_dir = os.path.join( - os.environ.get("TMPDIR", tempfile.gettempdir()), "tmp", "vm-state-machine" - ) - os.makedirs(image_dir, mode=0o700, exist_ok=True) - disk_image = os.path.join(image_dir, "machine.qcow2") - subprocess.check_call( - [ - "qemu-img", - "create", - "-f", - "qcow2", - "-F", - "qcow2", - "-o", - "backing_file=${image}", - disk_image, - ] - ) - subprocess.check_call(["qemu-img", "resize", disk_image, "10G"]) + image_dir = os.path.join( + os.environ.get("TMPDIR", tempfile.gettempdir()), "tmp", "vm-state-machine" + ) + os.makedirs(image_dir, mode=0o700, exist_ok=True) + disk_image = os.path.join(image_dir, "machine.qcow2") + subprocess.check_call( + [ + "qemu-img", + "create", + "-f", + "qcow2", + "-F", + "qcow2", + "-o", + "backing_file=${image}", + disk_image, + ] + ) + subprocess.check_call(["qemu-img", "resize", disk_image, "10G"]) - # Note: we use net=169.0.0.0/8 rather than - # net=169.254.0.0/16 to prevent dhcpcd from getting horribly - # confused. (It would get a DHCP lease in the 169.254.* - # range, which it would then configure and promptly delete - # again when it deletes link-local addresses.) Ideally we'd - # turn off the DHCP server, but qemu does not have an option - # to do that. - start_command = ( - "qemu-kvm -m 1024" - + " -device virtio-net-pci,netdev=vlan0" - + " -netdev 'user,id=vlan0,net=169.0.0.0/8,guestfwd=tcp:169.254.169.254:80-cmd:${pkgs.micro-httpd}/bin/micro_httpd ${metaData}'" - + f" -drive file={disk_image},if=virtio,werror=report" - + " $QEMU_OPTS" - ) + # Note: we use net=169.0.0.0/8 rather than + # net=169.254.0.0/16 to prevent dhcpcd from getting horribly + # confused. (It would get a DHCP lease in the 169.254.* + # range, which it would then configure and promptly delete + # again when it deletes link-local addresses.) Ideally we'd + # turn off the DHCP server, but qemu does not have an option + # to do that. + start_command = ( + "qemu-kvm -m 1024" + + " -device virtio-net-pci,netdev=vlan0" + + " -netdev 'user,id=vlan0,net=169.0.0.0/8,guestfwd=tcp:169.254.169.254:80-cmd:${pkgs.micro-httpd}/bin/micro_httpd ${metaData}'" + + f" -drive file={disk_image},if=virtio,werror=report" + + " $QEMU_OPTS" + ) - machine = create_machine(start_command) - try: - '' - + indentLines script - + '' - finally: - machine.shutdown() - ''; + machine = create_machine(start_command) + try: + '' + + indentLines script + + '' + finally: + machine.shutdown() + ''; inherit meta; }; diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index e59fa409a128..8307c443f16d 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -31,11 +31,9 @@ let ''; dwWithAcronyms = pkgs.dokuwiki.overrideAttrs (prev: { - installPhase = - prev.installPhase or "" - + '' - ln -sf ${acronymsFile} $out/share/dokuwiki/conf/acronyms.local.conf - ''; + installPhase = prev.installPhase or "" + '' + ln -sf ${acronymsFile} $out/share/dokuwiki/conf/acronyms.local.conf + ''; }); mkNode = diff --git a/nixos/tests/easytier.nix b/nixos/tests/easytier.nix index 23ce88464959..9eb580169195 100644 --- a/nixos/tests/easytier.nix +++ b/nixos/tests/easytier.nix @@ -15,7 +15,8 @@ settings = { network_name = "easytier_test"; network_secret = "easytier_test_secret"; - } // settings; + } + // settings; }; }; diff --git a/nixos/tests/ergochat.nix b/nixos/tests/ergochat.nix index 30f262bf5569..e55215aab65f 100644 --- a/nixos/tests/ergochat.nix +++ b/nixos/tests/ergochat.nix @@ -12,43 +12,42 @@ in { pkgs, lib, ... }: { name = "ergochat"; - nodes = - { - "${server}" = { - networking.firewall.allowedTCPPorts = [ ircPort ]; - services.ergochat = { - enable = true; - settings.server.motd = pkgs.writeText "ergo.motd" '' - The default MOTD doesn't contain the word "nixos" in it. - This one does. - ''; - }; + nodes = { + "${server}" = { + networking.firewall.allowedTCPPorts = [ ircPort ]; + services.ergochat = { + enable = true; + settings.server.motd = pkgs.writeText "ergo.motd" '' + The default MOTD doesn't contain the word "nixos" in it. + This one does. + ''; }; - } - // lib.listToAttrs ( - builtins.map ( - client: - lib.nameValuePair client { - imports = [ - ./common/user-account.nix - ]; + }; + } + // lib.listToAttrs ( + builtins.map ( + client: + lib.nameValuePair client { + imports = [ + ./common/user-account.nix + ]; - systemd.services.ii = { - requires = [ "network.target" ]; - wantedBy = [ "default.target" ]; + systemd.services.ii = { + requires = [ "network.target" ]; + wantedBy = [ "default.target" ]; - serviceConfig = { - Type = "simple"; - ExecPreStartPre = "mkdir -p ${iiDir}"; - ExecStart = '' - ${lib.getBin pkgs.ii}/bin/ii -n ${client} -s ${server} -i ${iiDir} - ''; - User = "alice"; - }; + serviceConfig = { + Type = "simple"; + ExecPreStartPre = "mkdir -p ${iiDir}"; + ExecStart = '' + ${lib.getBin pkgs.ii}/bin/ii -n ${client} -s ${server} -i ${iiDir} + ''; + User = "alice"; }; - } - ) clients - ); + }; + } + ) clients + ); testScript = let diff --git a/nixos/tests/garage/default.nix b/nixos/tests/garage/default.nix index 93f721abe241..90ea67936c5e 100644 --- a/nixos/tests/garage/default.nix +++ b/nixos/tests/garage/default.nix @@ -41,7 +41,8 @@ let root_domain = ".web.garage"; index = "index.html"; }; - } // extraSettings; + } + // extraSettings; }; environment.systemPackages = [ pkgs.minio-client ]; diff --git a/nixos/tests/hadoop/hdfs.nix b/nixos/tests/hadoop/hdfs.nix index 31b02964b4c6..15ed56c9ebae 100644 --- a/nixos/tests/hadoop/hdfs.nix +++ b/nixos/tests/hadoop/hdfs.nix @@ -54,50 +54,49 @@ import ../make-test-python.nix ( }; }; - testScript = - '' - start_all() + testScript = '' + start_all() - namenode.wait_for_unit("hdfs-namenode") - namenode.wait_for_unit("network.target") - namenode.wait_for_open_port(8020) - namenode.succeed("systemd-cat ss -tulpne") - namenode.succeed("systemd-cat cat /etc/hadoop*/hdfs-site.xml") - namenode.wait_for_open_port(9870) + namenode.wait_for_unit("hdfs-namenode") + namenode.wait_for_unit("network.target") + namenode.wait_for_open_port(8020) + namenode.succeed("systemd-cat ss -tulpne") + namenode.succeed("systemd-cat cat /etc/hadoop*/hdfs-site.xml") + namenode.wait_for_open_port(9870) - datanode.wait_for_unit("hdfs-datanode") - datanode.wait_for_unit("network.target") - '' - + ( - if lib.versionAtLeast package.version "3" then - '' - datanode.wait_for_open_port(9864) - datanode.wait_for_open_port(9866) - datanode.wait_for_open_port(9867) + datanode.wait_for_unit("hdfs-datanode") + datanode.wait_for_unit("network.target") + '' + + ( + if lib.versionAtLeast package.version "3" then + '' + datanode.wait_for_open_port(9864) + datanode.wait_for_open_port(9866) + datanode.wait_for_open_port(9867) - datanode.succeed("curl -f http://datanode:9864") - '' - else - '' - datanode.wait_for_open_port(50075) - datanode.wait_for_open_port(50010) - datanode.wait_for_open_port(50020) + datanode.succeed("curl -f http://datanode:9864") + '' + else + '' + datanode.wait_for_open_port(50075) + datanode.wait_for_open_port(50010) + datanode.wait_for_open_port(50020) - datanode.succeed("curl -f http://datanode:50075") - '' - ) - + '' - namenode.succeed("curl -f http://namenode:9870") + datanode.succeed("curl -f http://datanode:50075") + '' + ) + + '' + namenode.succeed("curl -f http://namenode:9870") - datanode.succeed("sudo -u hdfs hdfs dfsadmin -safemode wait") - datanode.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile") - assert "testfilecontents" in datanode.succeed("sudo -u hdfs hdfs dfs -cat /testfile") + datanode.succeed("sudo -u hdfs hdfs dfsadmin -safemode wait") + datanode.succeed("echo testfilecontents | sudo -u hdfs hdfs dfs -put - /testfile") + assert "testfilecontents" in datanode.succeed("sudo -u hdfs hdfs dfs -cat /testfile") - '' - + lib.optionalString (lib.versionAtLeast package.version "3.3") '' - namenode.wait_for_unit("hdfs-httpfs") - namenode.wait_for_open_port(14000) - assert "testfilecontents" in datanode.succeed("curl -f \"http://namenode:14000/webhdfs/v1/testfile?user.name=hdfs&op=OPEN\" 2>&1") - ''; + '' + + lib.optionalString (lib.versionAtLeast package.version "3.3") '' + namenode.wait_for_unit("hdfs-httpfs") + namenode.wait_for_open_port(14000) + assert "testfilecontents" in datanode.succeed("curl -f \"http://namenode:14000/webhdfs/v1/testfile?user.name=hdfs&op=OPEN\" 2>&1") + ''; } ) diff --git a/nixos/tests/incus/incus-tests.nix b/nixos/tests/incus/incus-tests.nix index 3a9479f5ab55..fe8aed457bb5 100644 --- a/nixos/tests/incus/incus-tests.nix +++ b/nixos/tests/incus/incus-tests.nix @@ -80,28 +80,27 @@ import ../make-test-python.nix ( package = if lts then pkgs.incus-lts else pkgs.incus; preseed = { - networks = - [ - { - name = "incusbr0"; - type = "bridge"; - config = { - "ipv4.address" = "10.0.10.1/24"; - "ipv4.nat" = "true"; - }; - } - ] - ++ lib.optionals networkOvs [ - { - name = "ovsbr0"; - type = "bridge"; - config = { - "bridge.driver" = "openvswitch"; - "ipv4.address" = "10.0.20.1/24"; - "ipv4.nat" = "true"; - }; - } - ]; + networks = [ + { + name = "incusbr0"; + type = "bridge"; + config = { + "ipv4.address" = "10.0.10.1/24"; + "ipv4.nat" = "true"; + }; + } + ] + ++ lib.optionals networkOvs [ + { + name = "ovsbr0"; + type = "bridge"; + config = { + "bridge.driver" = "openvswitch"; + "ipv4.address" = "10.0.20.1/24"; + "ipv4.nat" = "true"; + }; + } + ]; profiles = [ { name = "default"; @@ -159,343 +158,343 @@ import ../make-test-python.nix ( }; testScript = # python - '' - import json + '' + import json - def wait_for_instance(name: str, project: str = "default"): - machine.wait_until_succeeds(f"incus exec {name} --disable-stdin --force-interactive --project {project} -- /run/current-system/sw/bin/systemctl is-system-running") + def wait_for_instance(name: str, project: str = "default"): + machine.wait_until_succeeds(f"incus exec {name} --disable-stdin --force-interactive --project {project} -- /run/current-system/sw/bin/systemctl is-system-running") - def wait_incus_exec_success(name: str, command: str, timeout: int = 900, project: str = "default"): - def check_command(_) -> bool: - status, _ = machine.execute(f"incus exec {name} --disable-stdin --force-interactive --project {project} -- {command}") - return status == 0 + def wait_incus_exec_success(name: str, command: str, timeout: int = 900, project: str = "default"): + def check_command(_) -> bool: + status, _ = machine.execute(f"incus exec {name} --disable-stdin --force-interactive --project {project} -- {command}") + return status == 0 - with machine.nested(f"Waiting for successful exec: {command}"): - retry(check_command, timeout) + with machine.nested(f"Waiting for successful exec: {command}"): + retry(check_command, timeout) - def set_config(name: str, config: str, restart: bool = False, unset: bool = False): - if restart: - machine.succeed(f"incus stop {name}") + def set_config(name: str, config: str, restart: bool = False, unset: bool = False): + if restart: + machine.succeed(f"incus stop {name}") - if unset: - machine.succeed(f"incus config unset {name} {config}") - else: - machine.succeed(f"incus config set {name} {config}") + if unset: + machine.succeed(f"incus config unset {name} {config}") + else: + machine.succeed(f"incus config set {name} {config}") - if restart: - machine.succeed(f"incus start {name}") - wait_for_instance(name) - else: - # give a moment to settle - machine.sleep(1) + if restart: + machine.succeed(f"incus start {name}") + wait_for_instance(name) + else: + # give a moment to settle + machine.sleep(1) - def cleanup(): - # avoid conflict between preseed and cleanup operations - machine.execute("systemctl kill incus-preseed.service") + def cleanup(): + # avoid conflict between preseed and cleanup operations + machine.execute("systemctl kill incus-preseed.service") - instances = json.loads(machine.succeed("incus list --format json --all-projects")) - with subtest("Stopping all running instances"): - for instance in [a for a in instances if a['status'] == 'Running']: - machine.execute(f"incus stop --force {instance['name']} --project {instance['project']}") - machine.execute(f"incus delete --force {instance['name']} --project {instance['project']}") + instances = json.loads(machine.succeed("incus list --format json --all-projects")) + with subtest("Stopping all running instances"): + for instance in [a for a in instances if a['status'] == 'Running']: + machine.execute(f"incus stop --force {instance['name']} --project {instance['project']}") + machine.execute(f"incus delete --force {instance['name']} --project {instance['project']}") - def check_sysctl(name: str): - with subtest("systemd sysctl settings are applied"): - machine.succeed(f"incus exec {name} -- systemctl status systemd-sysctl") - sysctl = machine.succeed(f"incus exec {name} -- sysctl net.ipv4.ip_forward").strip().split(" ")[-1] - assert "1" == sysctl, f"systemd-sysctl configuration not correctly applied, {sysctl} != 1" + def check_sysctl(name: str): + with subtest("systemd sysctl settings are applied"): + machine.succeed(f"incus exec {name} -- systemctl status systemd-sysctl") + sysctl = machine.succeed(f"incus exec {name} -- sysctl net.ipv4.ip_forward").strip().split(" ")[-1] + assert "1" == sysctl, f"systemd-sysctl configuration not correctly applied, {sysctl} != 1" - with subtest("Wait for startup"): - machine.wait_for_unit("incus.service") - machine.wait_for_unit("incus-preseed.service") + with subtest("Wait for startup"): + machine.wait_for_unit("incus.service") + machine.wait_for_unit("incus-preseed.service") - with subtest("Verify preseed resources created"): - machine.succeed("incus profile show default") - machine.succeed("incus network info incusbr0") - machine.succeed("incus storage show default") + with subtest("Verify preseed resources created"): + machine.succeed("incus profile show default") + machine.succeed("incus network info incusbr0") + machine.succeed("incus storage show default") - '' - + lib.optionalString appArmor '' - with subtest("Verify AppArmor service is started without issue"): - # restart AppArmor service since the Incus AppArmor folders are - # created after AA service is started - machine.systemctl("restart apparmor.service") - machine.succeed("systemctl --no-pager -l status apparmor.service") - machine.wait_for_unit("apparmor.service") - '' - + lib.optionalString instanceContainer ( - lib.foldl ( - acc: variant: - acc - # python - + '' - metadata = "${(images variant).container.metadata}" - rootfs = "${(images variant).container.rootfs}" - alias = "nixos/container/${variant}" - variant = "${variant}" + '' + + lib.optionalString appArmor '' + with subtest("Verify AppArmor service is started without issue"): + # restart AppArmor service since the Incus AppArmor folders are + # created after AA service is started + machine.systemctl("restart apparmor.service") + machine.succeed("systemctl --no-pager -l status apparmor.service") + machine.wait_for_unit("apparmor.service") + '' + + lib.optionalString instanceContainer ( + lib.foldl ( + acc: variant: + acc + # python + + '' + metadata = "${(images variant).container.metadata}" + rootfs = "${(images variant).container.rootfs}" + alias = "nixos/container/${variant}" + variant = "${variant}" - with subtest("container image can be imported"): - machine.succeed(f"incus image import {metadata} {rootfs} --alias {alias}") + with subtest("container image can be imported"): + machine.succeed(f"incus image import {metadata} {rootfs} --alias {alias}") - with subtest("container can be launched and managed"): - machine.succeed(f"incus launch {alias} container-{variant}1") - wait_for_instance(f"container-{variant}1") + with subtest("container can be launched and managed"): + machine.succeed(f"incus launch {alias} container-{variant}1") + wait_for_instance(f"container-{variant}1") - with subtest("container mounts lxcfs overlays"): - machine.succeed(f"incus exec container-{variant}1 mount | grep 'lxcfs on /proc/cpuinfo type fuse.lxcfs'") - machine.succeed(f"incus exec container-{variant}1 mount | grep 'lxcfs on /proc/meminfo type fuse.lxcfs'") + with subtest("container mounts lxcfs overlays"): + machine.succeed(f"incus exec container-{variant}1 mount | grep 'lxcfs on /proc/cpuinfo type fuse.lxcfs'") + machine.succeed(f"incus exec container-{variant}1 mount | grep 'lxcfs on /proc/meminfo type fuse.lxcfs'") - with subtest("container CPU limits can be managed"): - set_config(f"container-{variant}1", "limits.cpu 1", restart=True) - wait_incus_exec_success(f"container-{variant}1", "nproc | grep '^1$'", timeout=90) + with subtest("container CPU limits can be managed"): + set_config(f"container-{variant}1", "limits.cpu 1", restart=True) + wait_incus_exec_success(f"container-{variant}1", "nproc | grep '^1$'", timeout=90) - with subtest("container CPU limits can be hotplug changed"): - set_config(f"container-{variant}1", "limits.cpu 2") - wait_incus_exec_success(f"container-{variant}1", "nproc | grep '^2$'", timeout=90) + with subtest("container CPU limits can be hotplug changed"): + set_config(f"container-{variant}1", "limits.cpu 2") + wait_incus_exec_success(f"container-{variant}1", "nproc | grep '^2$'", timeout=90) - with subtest("container memory limits can be managed"): - set_config(f"container-{variant}1", "limits.memory 128MB", restart=True) - wait_incus_exec_success(f"container-{variant}1", "grep 'MemTotal:[[:space:]]*125000 kB' /proc/meminfo", timeout=90) + with subtest("container memory limits can be managed"): + set_config(f"container-{variant}1", "limits.memory 128MB", restart=True) + wait_incus_exec_success(f"container-{variant}1", "grep 'MemTotal:[[:space:]]*125000 kB' /proc/meminfo", timeout=90) - with subtest("container memory limits can be hotplug changed"): - set_config(f"container-{variant}1", "limits.memory 256MB") - wait_incus_exec_success(f"container-{variant}1", "grep 'MemTotal:[[:space:]]*250000 kB' /proc/meminfo", timeout=90) + with subtest("container memory limits can be hotplug changed"): + set_config(f"container-{variant}1", "limits.memory 256MB") + wait_incus_exec_success(f"container-{variant}1", "grep 'MemTotal:[[:space:]]*250000 kB' /proc/meminfo", timeout=90) - with subtest("container software tpm can be configured"): - machine.succeed(f"incus config device add container-{variant}1 vtpm tpm path=/dev/tpm0 pathrm=/dev/tpmrm0") - machine.succeed(f"incus exec container-{variant}1 -- test -e /dev/tpm0") - machine.succeed(f"incus exec container-{variant}1 -- test -e /dev/tpmrm0") - machine.succeed(f"incus config device remove container-{variant}1 vtpm") - machine.fail(f"incus exec container-{variant}1 -- test -e /dev/tpm0") + with subtest("container software tpm can be configured"): + machine.succeed(f"incus config device add container-{variant}1 vtpm tpm path=/dev/tpm0 pathrm=/dev/tpmrm0") + machine.succeed(f"incus exec container-{variant}1 -- test -e /dev/tpm0") + machine.succeed(f"incus exec container-{variant}1 -- test -e /dev/tpmrm0") + machine.succeed(f"incus config device remove container-{variant}1 vtpm") + machine.fail(f"incus exec container-{variant}1 -- test -e /dev/tpm0") - with subtest("container lxc-generator compatibility"): - with subtest("lxc-container generator configures plain container"): - # default container is plain - machine.succeed(f"incus exec container-{variant}1 test -- -e /run/systemd/system/service.d/zzz-lxc-service.conf") + with subtest("container lxc-generator compatibility"): + with subtest("lxc-container generator configures plain container"): + # default container is plain + machine.succeed(f"incus exec container-{variant}1 test -- -e /run/systemd/system/service.d/zzz-lxc-service.conf") - check_sysctl(f"container-{variant}1") + check_sysctl(f"container-{variant}1") - with subtest("lxc-container generator configures nested container"): - set_config(f"container-{variant}1", "security.nesting=true", restart=True) + with subtest("lxc-container generator configures nested container"): + set_config(f"container-{variant}1", "security.nesting=true", restart=True) - machine.fail(f"incus exec container-{variant}1 test -- -e /run/systemd/system/service.d/zzz-lxc-service.conf") - target = machine.succeed(f"incus exec container-{variant}1 readlink -- -f /run/systemd/system/systemd-binfmt.service").strip() - assert target == "/dev/null", "lxc generator did not correctly mask /run/systemd/system/systemd-binfmt.service" + machine.fail(f"incus exec container-{variant}1 test -- -e /run/systemd/system/service.d/zzz-lxc-service.conf") + target = machine.succeed(f"incus exec container-{variant}1 readlink -- -f /run/systemd/system/systemd-binfmt.service").strip() + assert target == "/dev/null", "lxc generator did not correctly mask /run/systemd/system/systemd-binfmt.service" - check_sysctl(f"container-{variant}1") + check_sysctl(f"container-{variant}1") - with subtest("lxc-container generator configures privileged container"): - # Create a new instance for a clean state - machine.succeed(f"incus launch {alias} container-{variant}2") - wait_for_instance(f"container-{variant}2") + with subtest("lxc-container generator configures privileged container"): + # Create a new instance for a clean state + machine.succeed(f"incus launch {alias} container-{variant}2") + wait_for_instance(f"container-{variant}2") - machine.succeed(f"incus exec container-{variant}2 test -- -e /run/systemd/system/service.d/zzz-lxc-service.conf") + machine.succeed(f"incus exec container-{variant}2 test -- -e /run/systemd/system/service.d/zzz-lxc-service.conf") - check_sysctl(f"container-{variant}2") + check_sysctl(f"container-{variant}2") - with subtest("container supports per-instance lxcfs"): - machine.succeed(f"incus stop container-{variant}1") - machine.fail(f"pgrep -a lxcfs | grep 'incus/devices/container-{variant}1/lxcfs'") + with subtest("container supports per-instance lxcfs"): + machine.succeed(f"incus stop container-{variant}1") + machine.fail(f"pgrep -a lxcfs | grep 'incus/devices/container-{variant}1/lxcfs'") - machine.succeed("incus config set instances.lxcfs.per_instance=true") + machine.succeed("incus config set instances.lxcfs.per_instance=true") - machine.succeed(f"incus start container-{variant}1") - wait_for_instance(f"container-{variant}1") - machine.succeed(f"pgrep -a lxcfs | grep 'incus/devices/container-{variant}1/lxcfs'") + machine.succeed(f"incus start container-{variant}1") + wait_for_instance(f"container-{variant}1") + machine.succeed(f"pgrep -a lxcfs | grep 'incus/devices/container-{variant}1/lxcfs'") - with subtest("container can successfully restart"): - machine.succeed(f"incus restart container-{variant}1") - wait_for_instance(f"container-{variant}1") + with subtest("container can successfully restart"): + machine.succeed(f"incus restart container-{variant}1") + wait_for_instance(f"container-{variant}1") - with subtest("container remains running when softDaemonRestart is enabled and service is stopped"): - pid = machine.succeed(f"incus info container-{variant}1 | grep 'PID'").split(":")[1].strip() - machine.succeed(f"ps {pid}") - machine.succeed("systemctl stop incus") - machine.succeed(f"ps {pid}") - machine.succeed("systemctl start incus") + with subtest("container remains running when softDaemonRestart is enabled and service is stopped"): + pid = machine.succeed(f"incus info container-{variant}1 | grep 'PID'").split(":")[1].strip() + machine.succeed(f"ps {pid}") + machine.succeed("systemctl stop incus") + machine.succeed(f"ps {pid}") + machine.succeed("systemctl start incus") - with subtest("containers stop with incus-startup.service"): - pid = machine.succeed(f"incus info container-{variant}1 | grep 'PID'").split(":")[1].strip() - machine.succeed(f"ps {pid}") - machine.succeed("systemctl stop incus-startup.service") - machine.wait_until_fails(f"ps {pid}", timeout=120) - machine.succeed("systemctl start incus-startup.service") + with subtest("containers stop with incus-startup.service"): + pid = machine.succeed(f"incus info container-{variant}1 | grep 'PID'").split(":")[1].strip() + machine.succeed(f"ps {pid}") + machine.succeed("systemctl stop incus-startup.service") + machine.wait_until_fails(f"ps {pid}", timeout=120) + machine.succeed("systemctl start incus-startup.service") - cleanup() - '' - ) "" initVariants - ) - + lib.optionalString canTestVm ( - (lib.foldl ( - acc: variant: - acc - # python - + '' - metadata = "${(images variant).virtual-machine.metadata}" - disk = "${(images variant).virtual-machine.disk}" - alias = "nixos/virtual-machine/${variant}" - variant = "${variant}" + cleanup() + '' + ) "" initVariants + ) + + lib.optionalString canTestVm ( + (lib.foldl ( + acc: variant: + acc + # python + + '' + metadata = "${(images variant).virtual-machine.metadata}" + disk = "${(images variant).virtual-machine.disk}" + alias = "nixos/virtual-machine/${variant}" + variant = "${variant}" - with subtest("virtual-machine image can be imported"): - machine.succeed(f"incus image import {metadata} {disk} --alias {alias}") + with subtest("virtual-machine image can be imported"): + machine.succeed(f"incus image import {metadata} {disk} --alias {alias}") - with subtest("virtual-machine can be created"): - machine.succeed(f"incus create {alias} vm-{variant}1 --vm --config limits.memory=512MB --config security.secureboot=false") + with subtest("virtual-machine can be created"): + machine.succeed(f"incus create {alias} vm-{variant}1 --vm --config limits.memory=512MB --config security.secureboot=false") - with subtest("virtual-machine software tpm can be configured"): - machine.succeed(f"incus config device add vm-{variant}1 vtpm tpm path=/dev/tpm0") + with subtest("virtual-machine software tpm can be configured"): + machine.succeed(f"incus config device add vm-{variant}1 vtpm tpm path=/dev/tpm0") - with subtest("virtual-machine can be launched and become available"): - machine.succeed(f"incus start vm-{variant}1") - wait_for_instance(f"vm-{variant}1") + with subtest("virtual-machine can be launched and become available"): + machine.succeed(f"incus start vm-{variant}1") + wait_for_instance(f"vm-{variant}1") - with subtest("virtual-machine incus-agent is started"): - machine.succeed(f"incus exec vm-{variant}1 systemctl is-active incus-agent") + with subtest("virtual-machine incus-agent is started"): + machine.succeed(f"incus exec vm-{variant}1 systemctl is-active incus-agent") - with subtest("virtual-machine incus-agent has a valid path"): - machine.succeed(f"incus exec vm-{variant}1 -- bash -c 'true'") + with subtest("virtual-machine incus-agent has a valid path"): + machine.succeed(f"incus exec vm-{variant}1 -- bash -c 'true'") - with subtest("virtual-machine CPU limits can be managed"): - set_config(f"vm-{variant}1", "limits.cpu 1", restart=True) - wait_incus_exec_success(f"vm-{variant}1", "nproc | grep '^1$'", timeout=90) + with subtest("virtual-machine CPU limits can be managed"): + set_config(f"vm-{variant}1", "limits.cpu 1", restart=True) + wait_incus_exec_success(f"vm-{variant}1", "nproc | grep '^1$'", timeout=90) - with subtest("virtual-machine CPU limits can be hotplug changed"): - set_config(f"vm-{variant}1", "limits.cpu 2") - wait_incus_exec_success(f"vm-{variant}1", "nproc | grep '^2$'", timeout=90) + with subtest("virtual-machine CPU limits can be hotplug changed"): + set_config(f"vm-{variant}1", "limits.cpu 2") + wait_incus_exec_success(f"vm-{variant}1", "nproc | grep '^2$'", timeout=90) - with subtest("virtual-machine can successfully restart"): - machine.succeed(f"incus restart vm-{variant}1") - wait_for_instance(f"vm-{variant}1") + with subtest("virtual-machine can successfully restart"): + machine.succeed(f"incus restart vm-{variant}1") + wait_for_instance(f"vm-{variant}1") - with subtest("virtual-machine remains running when softDaemonRestart is enabled and service is stopped"): - pid = machine.succeed(f"incus info vm-{variant}1 | grep 'PID'").split(":")[1].strip() - machine.succeed(f"ps {pid}") - machine.succeed("systemctl stop incus") - machine.succeed(f"ps {pid}") - machine.succeed("systemctl start incus") + with subtest("virtual-machine remains running when softDaemonRestart is enabled and service is stopped"): + pid = machine.succeed(f"incus info vm-{variant}1 | grep 'PID'").split(":")[1].strip() + machine.succeed(f"ps {pid}") + machine.succeed("systemctl stop incus") + machine.succeed(f"ps {pid}") + machine.succeed("systemctl start incus") - with subtest("virtual-machines stop with incus-startup.service"): - pid = machine.succeed(f"incus info vm-{variant}1 | grep 'PID'").split(":")[1].strip() - machine.succeed(f"ps {pid}") - machine.succeed("systemctl stop incus-startup.service") - machine.wait_until_fails(f"ps {pid}", timeout=120) - machine.succeed("systemctl start incus-startup.service") + with subtest("virtual-machines stop with incus-startup.service"): + pid = machine.succeed(f"incus info vm-{variant}1 | grep 'PID'").split(":")[1].strip() + machine.succeed(f"ps {pid}") + machine.succeed("systemctl stop incus-startup.service") + machine.wait_until_fails(f"ps {pid}", timeout=120) + machine.succeed("systemctl start incus-startup.service") - cleanup() - '' - ) "" initVariants) - + - # python - '' - with subtest("virtual-machine can launch CSM (BIOS)"): - machine.succeed("incus init csm --vm --empty -c security.csm=true -c security.secureboot=false") - machine.succeed("incus start csm") - - - cleanup() - '' - ) + cleanup() + '' + ) "" initVariants) + - lib.optionalString featureUser # python - '' - with subtest("incus-user allows restricted access for users"): - machine.fail("incus project show user-1000") - machine.succeed("su - testuser bash -c 'incus list'") - # a project is created dynamically for the user - machine.succeed("incus project show user-1000") - # users shouldn't be able to list storage pools - machine.fail("su - testuser bash -c 'incus storage list'") + # python + '' + with subtest("virtual-machine can launch CSM (BIOS)"): + machine.succeed("incus init csm --vm --empty -c security.csm=true -c security.secureboot=false") + machine.succeed("incus start csm") - with subtest("incus-user allows users to launch instances"): - machine.succeed("su - testuser bash -c 'incus image import ${(images "systemd").container.metadata} ${(images "systemd").container.rootfs} --alias nixos'") - machine.succeed("su - testuser bash -c 'incus launch nixos instance2'") - wait_for_instance("instance2", "user-1000") - - cleanup() - '' - + - lib.optionalString networkOvs # python - '' - with subtest("Verify openvswitch bridge"): - machine.succeed("incus network info ovsbr0") + cleanup() + '' + ) + + + lib.optionalString featureUser # python + '' + with subtest("incus-user allows restricted access for users"): + machine.fail("incus project show user-1000") + machine.succeed("su - testuser bash -c 'incus list'") + # a project is created dynamically for the user + machine.succeed("incus project show user-1000") + # users shouldn't be able to list storage pools + machine.fail("su - testuser bash -c 'incus storage list'") - with subtest("Verify openvswitch bridge"): - machine.succeed("ovs-vsctl br-exists ovsbr0") - '' + with subtest("incus-user allows users to launch instances"): + machine.succeed("su - testuser bash -c 'incus image import ${(images "systemd").container.metadata} ${(images "systemd").container.rootfs} --alias nixos'") + machine.succeed("su - testuser bash -c 'incus launch nixos instance2'") + wait_for_instance("instance2", "user-1000") - + - lib.optionalString storageZfs # python - '' - with subtest("Verify zfs pool created and usable"): - machine.succeed( - "zpool status", - "parted --script /dev/vdb mklabel gpt", - "zpool create zfs_pool /dev/vdb", - ) + cleanup() + '' + + + lib.optionalString networkOvs # python + '' + with subtest("Verify openvswitch bridge"): + machine.succeed("incus network info ovsbr0") - machine.succeed("incus storage create zfs_pool zfs source=zfs_pool/incus") - machine.succeed("zfs list zfs_pool/incus") - machine.succeed("incus storage volume create zfs_pool test_fs --type filesystem") - machine.succeed("incus storage volume create zfs_pool test_vol --type block") + with subtest("Verify openvswitch bridge"): + machine.succeed("ovs-vsctl br-exists ovsbr0") + '' - machine.succeed("incus storage show zfs_pool") - machine.succeed("incus storage volume list zfs_pool") - machine.succeed("incus storage volume show zfs_pool test_fs") - machine.succeed("incus storage volume show zfs_pool test_vol") + + + lib.optionalString storageZfs # python + '' + with subtest("Verify zfs pool created and usable"): + machine.succeed( + "zpool status", + "parted --script /dev/vdb mklabel gpt", + "zpool create zfs_pool /dev/vdb", + ) - machine.succeed("incus create zfs1 --empty --storage zfs_pool") - machine.succeed("incus list zfs1") - '' + machine.succeed("incus storage create zfs_pool zfs source=zfs_pool/incus") + machine.succeed("zfs list zfs_pool/incus") - + - lib.optionalString storageLvm # python - '' - with subtest("Verify lvm pool created and usable"): - machine.succeed("incus storage create lvm_pool lvm source=/dev/vdc lvm.vg_name=incus_pool") - machine.succeed("vgs incus_pool") + machine.succeed("incus storage volume create zfs_pool test_fs --type filesystem") + machine.succeed("incus storage volume create zfs_pool test_vol --type block") - machine.succeed("incus storage volume create lvm_pool test_fs --type filesystem") - machine.succeed("incus storage volume create lvm_pool test_vol --type block") + machine.succeed("incus storage show zfs_pool") + machine.succeed("incus storage volume list zfs_pool") + machine.succeed("incus storage volume show zfs_pool test_fs") + machine.succeed("incus storage volume show zfs_pool test_vol") - machine.succeed("incus storage show lvm_pool") + machine.succeed("incus create zfs1 --empty --storage zfs_pool") + machine.succeed("incus list zfs1") + '' - machine.succeed("incus storage volume list lvm_pool") - machine.succeed("incus storage volume show lvm_pool test_fs") - machine.succeed("incus storage volume show lvm_pool test_vol") + + + lib.optionalString storageLvm # python + '' + with subtest("Verify lvm pool created and usable"): + machine.succeed("incus storage create lvm_pool lvm source=/dev/vdc lvm.vg_name=incus_pool") + machine.succeed("vgs incus_pool") - machine.succeed("incus create lvm1 --empty --storage lvm_pool") - machine.succeed("incus list lvm1") - ''; + machine.succeed("incus storage volume create lvm_pool test_fs --type filesystem") + machine.succeed("incus storage volume create lvm_pool test_vol --type block") + + machine.succeed("incus storage show lvm_pool") + + machine.succeed("incus storage volume list lvm_pool") + machine.succeed("incus storage volume show lvm_pool test_fs") + machine.succeed("incus storage volume show lvm_pool test_vol") + + machine.succeed("incus create lvm1 --empty --storage lvm_pool") + machine.succeed("incus list lvm1") + ''; } ) diff --git a/nixos/tests/inspircd.nix b/nixos/tests/inspircd.nix index b163622dd5b5..a54ffb7bd13f 100644 --- a/nixos/tests/inspircd.nix +++ b/nixos/tests/inspircd.nix @@ -12,44 +12,43 @@ in { pkgs, lib, ... }: { name = "inspircd"; - nodes = - { - "${server}" = { - networking.firewall.allowedTCPPorts = [ ircPort ]; - services.inspircd = { - enable = true; - package = pkgs.inspircdMinimal; - config = '' - - - ''; - }; + nodes = { + "${server}" = { + networking.firewall.allowedTCPPorts = [ ircPort ]; + services.inspircd = { + enable = true; + package = pkgs.inspircdMinimal; + config = '' + + + ''; }; - } - // lib.listToAttrs ( - builtins.map ( - client: - lib.nameValuePair client { - imports = [ - ./common/user-account.nix - ]; + }; + } + // lib.listToAttrs ( + builtins.map ( + client: + lib.nameValuePair client { + imports = [ + ./common/user-account.nix + ]; - systemd.services.ii = { - requires = [ "network.target" ]; - wantedBy = [ "default.target" ]; + systemd.services.ii = { + requires = [ "network.target" ]; + wantedBy = [ "default.target" ]; - serviceConfig = { - Type = "simple"; - ExecPreStartPre = "mkdir -p ${iiDir}"; - ExecStart = '' - ${lib.getBin pkgs.ii}/bin/ii -n ${client} -s ${server} -i ${iiDir} - ''; - User = "alice"; - }; + serviceConfig = { + Type = "simple"; + ExecPreStartPre = "mkdir -p ${iiDir}"; + ExecStart = '' + ${lib.getBin pkgs.ii}/bin/ii -n ${client} -s ${server} -i ${iiDir} + ''; + User = "alice"; }; - } - ) clients - ); + }; + } + ) clients + ); testScript = let diff --git a/nixos/tests/installed-tests/default.nix b/nixos/tests/installed-tests/default.nix index f2cb02e66929..2dc0e850c066 100644 --- a/nixos/tests/installed-tests/default.nix +++ b/nixos/tests/installed-tests/default.nix @@ -50,7 +50,8 @@ let { imports = [ testConfig - ] ++ optional withX11 ../common/x11.nix; + ] + ++ optional withX11 ../common/x11.nix; environment.systemPackages = with pkgs; [ gnome-desktop-testing ]; diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 166eb32090c6..d1bed870932e 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -1045,33 +1045,32 @@ let boot.supportedFilesystems = [ "zfs" ]; environment.systemPackages = with pkgs; [ clevis ]; }; - createPartitions = - '' - installer.succeed( - "flock /dev/vda parted --script /dev/vda -- mklabel msdos" - + " mkpart primary ext2 1M 100MB" - + " mkpart primary linux-swap 100M 1024M" - + " mkpart primary 1024M -1s", - "udevadm settle", - "mkswap /dev/vda2 -L swap", - "swapon -L swap", - '' - + optionalString (!parentDataset) '' - "zpool create -O mountpoint=legacy rpool /dev/vda3", - "echo -n password | zfs create" - + " -o encryption=aes-256-gcm -o keyformat=passphrase rpool/root", - '' - + optionalString (parentDataset) '' - "echo -n password | zpool create -O mountpoint=none -O encryption=on -O keyformat=passphrase rpool /dev/vda3", - "zfs create -o mountpoint=legacy rpool/root", - '' - + '' - "mount -t zfs rpool/root /mnt", - "mkfs.ext3 -L boot /dev/vda1", - "mkdir -p /mnt/boot", - "mount LABEL=boot /mnt/boot", - "udevadm settle") - ''; + createPartitions = '' + installer.succeed( + "flock /dev/vda parted --script /dev/vda -- mklabel msdos" + + " mkpart primary ext2 1M 100MB" + + " mkpart primary linux-swap 100M 1024M" + + " mkpart primary 1024M -1s", + "udevadm settle", + "mkswap /dev/vda2 -L swap", + "swapon -L swap", + '' + + optionalString (!parentDataset) '' + "zpool create -O mountpoint=legacy rpool /dev/vda3", + "echo -n password | zfs create" + + " -o encryption=aes-256-gcm -o keyformat=passphrase rpool/root", + '' + + optionalString (parentDataset) '' + "echo -n password | zpool create -O mountpoint=none -O encryption=on -O keyformat=passphrase rpool /dev/vda3", + "zfs create -o mountpoint=legacy rpool/root", + '' + + '' + "mount -t zfs rpool/root /mnt", + "mkfs.ext3 -L boot /dev/vda1", + "mkdir -p /mnt/boot", + "mount LABEL=boot /mnt/boot", + "udevadm settle") + ''; extraConfig = optionalString (!parentDataset) '' boot.initrd.clevis.devices."rpool/root".secretFile = "/etc/nixos/clevis-secret.jwe"; diff --git a/nixos/tests/kafka/base.nix b/nixos/tests/kafka/base.nix index 80121a722465..961511525cdd 100644 --- a/nixos/tests/kafka/base.nix +++ b/nixos/tests/kafka/base.nix @@ -15,75 +15,74 @@ let maintainers = [ nequissimus ]; }; - nodes = - { - kafka = - { ... }: - { - services.apache-kafka = mkMerge [ - ({ - enable = true; - package = kafkaPackage; - settings = { - "offsets.topic.replication.factor" = 1; - "log.dirs" = [ - "/var/lib/kafka/logdir1" - "/var/lib/kafka/logdir2" - ]; - }; - }) - (mkIf (mode == "zookeeper") { - settings = { - "zookeeper.session.timeout.ms" = 600000; - "zookeeper.connect" = [ "zookeeper1:2181" ]; - }; - }) - (mkIf (mode == "kraft") { - clusterId = "ak2fIHr4S8WWarOF_ODD0g"; - formatLogDirs = true; - settings = { - "node.id" = 1; - "process.roles" = [ - "broker" - "controller" - ]; - "listeners" = [ - "PLAINTEXT://:9092" - "CONTROLLER://:9093" - ]; - "listener.security.protocol.map" = [ - "PLAINTEXT:PLAINTEXT" - "CONTROLLER:PLAINTEXT" - ]; - "controller.quorum.voters" = [ - "1@kafka:9093" - ]; - "controller.listener.names" = [ "CONTROLLER" ]; - }; - }) - ]; - - networking.firewall.allowedTCPPorts = [ - 9092 - 9093 - ]; - virtualisation.diskSize = 1024; - # i686 tests: qemu-system-i386 can simulate max 2047MB RAM (not 2048) - virtualisation.memorySize = 2047; - }; - } - // optionalAttrs (mode == "zookeeper") { - zookeeper1 = - { ... }: - { - services.zookeeper = { + nodes = { + kafka = + { ... }: + { + services.apache-kafka = mkMerge [ + ({ enable = true; - }; + package = kafkaPackage; + settings = { + "offsets.topic.replication.factor" = 1; + "log.dirs" = [ + "/var/lib/kafka/logdir1" + "/var/lib/kafka/logdir2" + ]; + }; + }) + (mkIf (mode == "zookeeper") { + settings = { + "zookeeper.session.timeout.ms" = 600000; + "zookeeper.connect" = [ "zookeeper1:2181" ]; + }; + }) + (mkIf (mode == "kraft") { + clusterId = "ak2fIHr4S8WWarOF_ODD0g"; + formatLogDirs = true; + settings = { + "node.id" = 1; + "process.roles" = [ + "broker" + "controller" + ]; + "listeners" = [ + "PLAINTEXT://:9092" + "CONTROLLER://:9093" + ]; + "listener.security.protocol.map" = [ + "PLAINTEXT:PLAINTEXT" + "CONTROLLER:PLAINTEXT" + ]; + "controller.quorum.voters" = [ + "1@kafka:9093" + ]; + "controller.listener.names" = [ "CONTROLLER" ]; + }; + }) + ]; - networking.firewall.allowedTCPPorts = [ 2181 ]; - virtualisation.diskSize = 1024; + networking.firewall.allowedTCPPorts = [ + 9092 + 9093 + ]; + virtualisation.diskSize = 1024; + # i686 tests: qemu-system-i386 can simulate max 2047MB RAM (not 2048) + virtualisation.memorySize = 2047; + }; + } + // optionalAttrs (mode == "zookeeper") { + zookeeper1 = + { ... }: + { + services.zookeeper = { + enable = true; }; - }; + + networking.firewall.allowedTCPPorts = [ 2181 ]; + virtualisation.diskSize = 1024; + }; + }; testScript = '' start_all() diff --git a/nixos/tests/kernel-rust.nix b/nixos/tests/kernel-rust.nix index 27fd29353d4d..0b8ea5505ecd 100644 --- a/nixos/tests/kernel-rust.nix +++ b/nixos/tests/kernel-rust.nix @@ -46,20 +46,19 @@ let } ); - kernels = - { - inherit (pkgs.linuxKernel.packages) linux_testing; - } - // filterAttrs (const ( - x: - let - inherit (builtins.tryEval (x.rust-out-of-tree-module or null != null)) - success - value - ; - available = meta.availableOn pkgs.stdenv.hostPlatform x.rust-out-of-tree-module; - in - success && value && available - )) pkgs.linuxKernel.vanillaPackages; + kernels = { + inherit (pkgs.linuxKernel.packages) linux_testing; + } + // filterAttrs (const ( + x: + let + inherit (builtins.tryEval (x.rust-out-of-tree-module or null != null)) + success + value + ; + available = meta.availableOn pkgs.stdenv.hostPlatform x.rust-out-of-tree-module; + in + success && value && available + )) pkgs.linuxKernel.vanillaPackages; in mapAttrs (const kernelRustTest) kernels diff --git a/nixos/tests/kubernetes/base.nix b/nixos/tests/kubernetes/base.nix index bc220654e168..6c6a5433f501 100644 --- a/nixos/tests/kubernetes/base.nix +++ b/nixos/tests/kubernetes/base.nix @@ -117,11 +117,10 @@ let ] ) machines; - testScript = - '' - start_all() - '' - + test; + testScript = '' + start_all() + '' + + test; }; mkKubernetesMultiNodeTest = diff --git a/nixos/tests/lomiri-gallery-app.nix b/nixos/tests/lomiri-gallery-app.nix index 1f5638f39ba1..7fa7b355903f 100644 --- a/nixos/tests/lomiri-gallery-app.nix +++ b/nixos/tests/lomiri-gallery-app.nix @@ -98,77 +98,76 @@ let enableOCR = true; - testScript = - '' - machine.wait_for_x() + testScript = '' + machine.wait_for_x() - machine.succeed("mkdir /root/${builtins.dirOf file}") - machine.succeed("cp -vr /etc/${imageDataDir}/${file} /root/${builtins.dirOf file}") + machine.succeed("mkdir /root/${builtins.dirOf file}") + machine.succeed("cp -vr /etc/${imageDataDir}/${file} /root/${builtins.dirOf file}") - # Start thumbnailer, wait for idle shutdown - machine.systemctl("start dbus-com.lomiri.Thumbnailer", "root") - machine.wait_until_succeeds( - "env XDG_RUNTIME_DIR=/run/user/0 " - + "systemctl --user is-active dbus-com.lomiri.Thumbnailer" - ) - machine.wait_for_console_text("thumbnail cache:") + # Start thumbnailer, wait for idle shutdown + machine.systemctl("start dbus-com.lomiri.Thumbnailer", "root") + machine.wait_until_succeeds( + "env XDG_RUNTIME_DIR=/run/user/0 " + + "systemctl --user is-active dbus-com.lomiri.Thumbnailer" + ) + machine.wait_for_console_text("thumbnail cache:") - # Request thumbnail processing, get initial thumbnail image into cache - # This can randomly take abit longer, just run it until it succeeds - # Touch file to invalidate failure cache - machine.wait_until_succeeds( - "touch '/root/${file}' && " - + "env XDG_RUNTIME_DIR=/run/user/0 " - + "gdbus call -e " - + "-d com.lomiri.Thumbnailer -o /com/lomiri/Thumbnailer " - + "-m com.lomiri.Thumbnailer.GetThumbnail " - + "'/root/${file}' " - # Same size as source, to reduce processing - we're very close to hitting 20s on slow hardware here - + "'@(ii) (500,500)'" - ) + # Request thumbnail processing, get initial thumbnail image into cache + # This can randomly take abit longer, just run it until it succeeds + # Touch file to invalidate failure cache + machine.wait_until_succeeds( + "touch '/root/${file}' && " + + "env XDG_RUNTIME_DIR=/run/user/0 " + + "gdbus call -e " + + "-d com.lomiri.Thumbnailer -o /com/lomiri/Thumbnailer " + + "-m com.lomiri.Thumbnailer.GetThumbnail " + + "'/root/${file}' " + # Same size as source, to reduce processing - we're very close to hitting 20s on slow hardware here + + "'@(ii) (500,500)'" + ) - machine.wait_for_console_text("Idle timeout reached") - machine.wait_until_fails( - "env XDG_RUNTIME_DIR=/run/user/0 " - + "systemctl --user is-active dbus-com.lomiri.Thumbnailer" - ) + machine.wait_for_console_text("Idle timeout reached") + machine.wait_until_fails( + "env XDG_RUNTIME_DIR=/run/user/0 " + + "systemctl --user is-active dbus-com.lomiri.Thumbnailer" + ) - with subtest("lomiri gallery finds files"): - machine.succeed("lomiri-gallery-app >&2 &") - machine.wait_for_console_text("qq= AlbumsOverview") # logged when album page actually gets loaded - machine.sleep(10) - machine.send_key("alt-f10") - machine.sleep(5) - machine.wait_for_text(r"(Albums|Events|Photos|${imageLabel})") + with subtest("lomiri gallery finds files"): + machine.succeed("lomiri-gallery-app >&2 &") + machine.wait_for_console_text("qq= AlbumsOverview") # logged when album page actually gets loaded + machine.sleep(10) + machine.send_key("alt-f10") + machine.sleep(5) + machine.wait_for_text(r"(Albums|Events|Photos|${imageLabel})") - machine.succeed("xdotool mousemove 30 40 click 1") # burger menu for categories - machine.sleep(2) - machine.succeed("xdotool mousemove 30 180 click 1") # photos - machine.sleep(2) - machine.screenshot("lomiri-gallery_photos") + machine.succeed("xdotool mousemove 30 40 click 1") # burger menu for categories + machine.sleep(2) + machine.succeed("xdotool mousemove 30 180 click 1") # photos + machine.sleep(2) + machine.screenshot("lomiri-gallery_photos") - machine.succeed("xdotool mousemove 80 140 click 1") # select first one - machine.sleep(2) - machine.succeed("xdotool mousemove 80 140 click 1") # enable top-bar - machine.sleep(2) + machine.succeed("xdotool mousemove 80 140 click 1") # select first one + machine.sleep(2) + machine.succeed("xdotool mousemove 80 140 click 1") # enable top-bar + machine.sleep(2) - '' - + ( - if (customTest != null) then - customTest - else - '' - with subtest("lomiri gallery handles ${format}"): - machine.succeed("xdotool mousemove ${ - if buttonIsOffset then "900" else "940" - } 50 click 1") # open media information - machine.sleep(2) - machine.screenshot("lomiri-gallery_${format}_info") - machine.send_key("esc") - machine.sleep(2) - machine.wait_for_text("${imageLabel}") # make sure media shows fine - '' - ); + '' + + ( + if (customTest != null) then + customTest + else + '' + with subtest("lomiri gallery handles ${format}"): + machine.succeed("xdotool mousemove ${ + if buttonIsOffset then "900" else "940" + } 50 click 1") # open media information + machine.sleep(2) + machine.screenshot("lomiri-gallery_${format}_info") + machine.send_key("esc") + machine.sleep(2) + machine.wait_for_text("${imageLabel}") # make sure media shows fine + '' + ); } ); diff --git a/nixos/tests/lomiri-music-app.nix b/nixos/tests/lomiri-music-app.nix index 9efff85fee20..7424847b3794 100644 --- a/nixos/tests/lomiri-music-app.nix +++ b/nixos/tests/lomiri-music-app.nix @@ -59,15 +59,13 @@ in (lib.meta.hiPrio ( suru-icon-theme.overrideAttrs (oa: { # Colour the background in special colours, which we can OCR for - postPatch = - (oa.postPatch or "") - + '' - substituteInPlace suru/actions/scalable/media-playback-pause.svg \ - --replace-fail 'fill:none' 'fill:${ocrPauseColor}' + postPatch = (oa.postPatch or "") + '' + substituteInPlace suru/actions/scalable/media-playback-pause.svg \ + --replace-fail 'fill:none' 'fill:${ocrPauseColor}' - substituteInPlace suru/actions/scalable/media-playback-start.svg \ - --replace-fail 'fill:none' 'fill:${ocrStartColor}' - ''; + substituteInPlace suru/actions/scalable/media-playback-start.svg \ + --replace-fail 'fill:none' 'fill:${ocrStartColor}' + ''; }) )) ]); diff --git a/nixos/tests/man.nix b/nixos/tests/man.nix index 5155fcbe055a..ebdf00a4f5f1 100644 --- a/nixos/tests/man.nix +++ b/nixos/tests/man.nix @@ -21,19 +21,18 @@ let enable = true; nixos.enable = lib.mkForce true; dev.enable = true; - man = - { - enable = true; - generateCaches = true; - } - // lib.listToAttrs ( - builtins.map (impl: { - name = impl; - value = { - enable = useImpl == impl; - }; - }) manImplementations - ); + man = { + enable = true; + generateCaches = true; + } + // lib.listToAttrs ( + builtins.map (impl: { + name = impl; + value = { + enable = useImpl == impl; + }; + }) manImplementations + ); }; }; @@ -50,60 +49,59 @@ in }) manImplementations ); - testScript = - '' - import re - start_all() + testScript = '' + import re + start_all() - def match_man_k(page, section, haystack): - """ - Check if the man page {page}({section}) occurs in - the output of `man -k` given as haystack. Note: - This is not super reliable, e. g. it can't deal - with man pages that are in multiple sections. - """ + def match_man_k(page, section, haystack): + """ + Check if the man page {page}({section}) occurs in + the output of `man -k` given as haystack. Note: + This is not super reliable, e. g. it can't deal + with man pages that are in multiple sections. + """ - for line in haystack.split("\n"): - # man -k can look like this: - # page(3) - bla - # page (3) - bla - # pagea, pageb (3, 3P) - foo - # pagea, pageb, pagec(3) - bar - pages = line.split("(")[0] - sections = re.search("\\([a-zA-Z1-9, ]+\\)", line) - if sections is None: - continue - else: - sections = sections.group(0)[1:-1] + for line in haystack.split("\n"): + # man -k can look like this: + # page(3) - bla + # page (3) - bla + # pagea, pageb (3, 3P) - foo + # pagea, pageb, pagec(3) - bar + pages = line.split("(")[0] + sections = re.search("\\([a-zA-Z1-9, ]+\\)", line) + if sections is None: + continue + else: + sections = sections.group(0)[1:-1] - if page in pages and f'{section}' in sections: - return True + if page in pages and f'{section}' in sections: + return True - return False + return False - '' - + lib.concatMapStrings (machine: '' - with subtest("Test direct man page lookups in ${machine}"): - # man works - ${machine}.succeed("man man > /dev/null") - # devman works - ${machine}.succeed("man 3 libunwind > /dev/null") - # NixOS configuration man page is installed - ${machine}.succeed("man configuration.nix > /dev/null") + '' + + lib.concatMapStrings (machine: '' + with subtest("Test direct man page lookups in ${machine}"): + # man works + ${machine}.succeed("man man > /dev/null") + # devman works + ${machine}.succeed("man 3 libunwind > /dev/null") + # NixOS configuration man page is installed + ${machine}.succeed("man configuration.nix > /dev/null") - with subtest("Test generateCaches via man -k in ${machine}"): - expected = [ - ("openssl", "ssl", 3), - ("unwind", "libunwind", 3), - ("user", "useradd", 8), - ("user", "userdel", 8), - ("mem", "free", 3), - ("mem", "free", 1), - ] + with subtest("Test generateCaches via man -k in ${machine}"): + expected = [ + ("openssl", "ssl", 3), + ("unwind", "libunwind", 3), + ("user", "useradd", 8), + ("user", "userdel", 8), + ("mem", "free", 3), + ("mem", "free", 1), + ] - for (keyword, page, section) in expected: - matches = ${machine}.succeed(f"man -k {keyword}") - if not match_man_k(page, section, matches): - raise Exception(f"{page}({section}) missing in matches: {matches}") - '') machineNames; + for (keyword, page, section) in expected: + matches = ${machine}.succeed(f"man -k {keyword}") + if not match_man_k(page, section, matches): + raise Exception(f"{page}({section}) missing in matches: {matches}") + '') machineNames; } diff --git a/nixos/tests/mattermost/default.nix b/nixos/tests/mattermost/default.nix index b3588c51c7a7..2783390b9082 100644 --- a/nixos/tests/mattermost/default.nix +++ b/nixos/tests/mattermost/default.nix @@ -148,11 +148,9 @@ import ../make-test-python.nix ( package = pkgs.mattermost.overrideAttrs (prev: { webapp = prev.webapp.overrideAttrs (prevWebapp: { # Ensure that users can add patches. - postPatch = - prevWebapp.postPatch or "" - + '' - substituteInPlace channels/src/root.html --replace-fail "Mattermost" "Patched Mattermost" - ''; + postPatch = prevWebapp.postPatch or "" + '' + substituteInPlace channels/src/root.html --replace-fail "Mattermost" "Patched Mattermost" + ''; }); }); mutableConfig = false; diff --git a/nixos/tests/mysql/mysql.nix b/nixos/tests/mysql/mysql.nix index 2935c02e1c46..67ef87e99481 100644 --- a/nixos/tests/mysql/mysql.nix +++ b/nixos/tests/mysql/mysql.nix @@ -95,8 +95,7 @@ let settings = { mysqld = { plugin-load-add = - lib.optional hasMroonga "ha_mroonga.so" - ++ lib.optional hasRocksDB "ha_rocksdb.so"; + lib.optional hasMroonga "ha_mroonga.so" ++ lib.optional hasRocksDB "ha_rocksdb.so"; }; }; }; diff --git a/nixos/tests/networking/networkd-and-scripted.nix b/nixos/tests/networking/networkd-and-scripted.nix index c5b8b213098d..b75f82218a69 100644 --- a/nixos/tests/networking/networkd-and-scripted.nix +++ b/nixos/tests/networking/networkd-and-scripted.nix @@ -472,30 +472,29 @@ let fou3-fou-encap.after = lib.optional (!networkd) "network-addresses-enp1s0.service"; }; }; - testScript = - '' - import json + testScript = '' + import json - machine.wait_for_unit("network.target") - fous = json.loads(machine.succeed("ip -json fou show")) - assert {"port": 9001, "gue": None, "family": "inet"} in fous, "fou1 exists" - assert {"port": 9002, "ipproto": 41, "family": "inet"} in fous, "fou2 exists" - '' - + lib.optionalString (!networkd) '' - assert { - "port": 9003, - "gue": None, - "family": "inet", - "local": "192.168.1.1", - } in fous, "fou3 exists" - assert { - "port": 9004, - "gue": None, - "family": "inet", - "local": "192.168.1.1", - "dev": "enp1s0", - } in fous, "fou4 exists" - ''; + machine.wait_for_unit("network.target") + fous = json.loads(machine.succeed("ip -json fou show")) + assert {"port": 9001, "gue": None, "family": "inet"} in fous, "fou1 exists" + assert {"port": 9002, "ipproto": 41, "family": "inet"} in fous, "fou2 exists" + '' + + lib.optionalString (!networkd) '' + assert { + "port": 9003, + "gue": None, + "family": "inet", + "local": "192.168.1.1", + } in fous, "fou3 exists" + assert { + "port": 9004, + "gue": None, + "family": "inet", + "local": "192.168.1.1", + "dev": "enp1s0", + } in fous, "fou4 exists" + ''; }; sit-6in4 = let @@ -1075,58 +1074,57 @@ let }; }; - testScript = - '' - targetList = """ - tap0: tap persist user 0 - tun0: tun persist user 0 - """.strip() + testScript = '' + targetList = """ + tap0: tap persist user 0 + tun0: tun persist user 0 + """.strip() - with subtest("Wait for networking to come up"): - machine.start() - machine.wait_for_unit("network.target") + with subtest("Wait for networking to come up"): + machine.start() + machine.wait_for_unit("network.target") - with subtest("Test interfaces set up"): - list = machine.succeed("ip tuntap list | sort").strip() - assert ( - list == targetList - ), """ - The list of virtual interfaces does not match the expected one: - Result: - {} - Expected: - {} - """.format( - list, targetList - ) - with subtest("Test MTU and MAC Address are configured"): - machine.wait_until_succeeds("ip link show dev tap0 | grep 'mtu 1342'") - machine.wait_until_succeeds("ip link show dev tun0 | grep 'mtu 1343'") - assert "02:de:ad:be:ef:01" in machine.succeed("ip link show dev tap0") - '' # network-addresses-* only exist in scripted networking - + lib.optionalString (!networkd) '' - with subtest("Test interfaces' addresses clean up"): - machine.succeed("systemctl stop network-addresses-tap0") - machine.sleep(10) - machine.succeed("systemctl stop network-addresses-tun0") - machine.sleep(10) - residue = machine.succeed("ip tuntap list | sort").strip() - assert ( - residue == targetList - ), "Some virtual interface has been removed:\n{}".format(residue) - assert "192.168.1.1" not in machine.succeed("ip address show dev tap0"), "tap0 interface address has not been removed" - assert "192.168.1.2" not in machine.succeed("ip address show dev tun0"), "tun0 interface address has not been removed" + with subtest("Test interfaces set up"): + list = machine.succeed("ip tuntap list | sort").strip() + assert ( + list == targetList + ), """ + The list of virtual interfaces does not match the expected one: + Result: + {} + Expected: + {} + """.format( + list, targetList + ) + with subtest("Test MTU and MAC Address are configured"): + machine.wait_until_succeeds("ip link show dev tap0 | grep 'mtu 1342'") + machine.wait_until_succeeds("ip link show dev tun0 | grep 'mtu 1343'") + assert "02:de:ad:be:ef:01" in machine.succeed("ip link show dev tap0") + '' # network-addresses-* only exist in scripted networking + + lib.optionalString (!networkd) '' + with subtest("Test interfaces' addresses clean up"): + machine.succeed("systemctl stop network-addresses-tap0") + machine.sleep(10) + machine.succeed("systemctl stop network-addresses-tun0") + machine.sleep(10) + residue = machine.succeed("ip tuntap list | sort").strip() + assert ( + residue == targetList + ), "Some virtual interface has been removed:\n{}".format(residue) + assert "192.168.1.1" not in machine.succeed("ip address show dev tap0"), "tap0 interface address has not been removed" + assert "192.168.1.2" not in machine.succeed("ip address show dev tun0"), "tun0 interface address has not been removed" - with subtest("Test interfaces clean up"): - machine.succeed("systemctl stop tap0-netdev") - machine.sleep(10) - machine.succeed("systemctl stop tun0-netdev") - machine.sleep(10) - residue = machine.succeed("ip tuntap list") - assert ( - residue == "" - ), "Some virtual interface has not been properly cleaned:\n{}".format(residue) - ''; + with subtest("Test interfaces clean up"): + machine.succeed("systemctl stop tap0-netdev") + machine.sleep(10) + machine.succeed("systemctl stop tun0-netdev") + machine.sleep(10) + residue = machine.succeed("ip tuntap list") + assert ( + residue == "" + ), "Some virtual interface has not been properly cleaned:\n{}".format(residue) + ''; }; privacy = { name = "Privacy"; @@ -1263,62 +1261,61 @@ let virtualisation.vlans = [ ]; }; - testScript = - '' - targetIPv4Table = [ - "10.0.0.0/16 proto static scope link mtu 1500", - "192.168.1.0/24 proto kernel scope link src 192.168.1.2", - "192.168.2.0/24 via 192.168.1.1 proto static", - ] + testScript = '' + targetIPv4Table = [ + "10.0.0.0/16 proto static scope link mtu 1500", + "192.168.1.0/24 proto kernel scope link src 192.168.1.2", + "192.168.2.0/24 via 192.168.1.1 proto static", + ] - targetIPv6Table = [ - "2001:1470:fffd:2097::/64 proto kernel metric 256 pref medium", - "2001:1470:fffd:2098::/64 via fdfd:b3f0::1 proto static metric 1024 pref medium", - "fdfd:b3f0::/48 proto static metric 1024 pref medium", - ] + targetIPv6Table = [ + "2001:1470:fffd:2097::/64 proto kernel metric 256 pref medium", + "2001:1470:fffd:2098::/64 via fdfd:b3f0::1 proto static metric 1024 pref medium", + "fdfd:b3f0::/48 proto static metric 1024 pref medium", + ] - machine.start() - machine.wait_for_unit("network.target") + machine.start() + machine.wait_for_unit("network.target") - with subtest("test routing tables"): - ipv4Table = machine.succeed("ip -4 route list dev eth0 | head -n3").strip() - ipv6Table = machine.succeed("ip -6 route list dev eth0 | head -n3").strip() - assert [ - l.strip() for l in ipv4Table.splitlines() - ] == targetIPv4Table, """ - The IPv4 routing table does not match the expected one: - Result: - {} - Expected: - {} - """.format( - ipv4Table, targetIPv4Table - ) - assert [ - l.strip() for l in ipv6Table.splitlines() - ] == targetIPv6Table, """ - The IPv6 routing table does not match the expected one: - Result: - {} - Expected: - {} - """.format( - ipv6Table, targetIPv6Table - ) + with subtest("test routing tables"): + ipv4Table = machine.succeed("ip -4 route list dev eth0 | head -n3").strip() + ipv6Table = machine.succeed("ip -6 route list dev eth0 | head -n3").strip() + assert [ + l.strip() for l in ipv4Table.splitlines() + ] == targetIPv4Table, """ + The IPv4 routing table does not match the expected one: + Result: + {} + Expected: + {} + """.format( + ipv4Table, targetIPv4Table + ) + assert [ + l.strip() for l in ipv6Table.splitlines() + ] == targetIPv6Table, """ + The IPv6 routing table does not match the expected one: + Result: + {} + Expected: + {} + """.format( + ipv6Table, targetIPv6Table + ) - '' - + lib.optionalString (!networkd) '' - with subtest("test clean-up of the tables"): - machine.succeed("systemctl stop network-addresses-eth0") - ipv4Residue = machine.succeed("ip -4 route list dev eth0 | head -n-3").strip() - ipv6Residue = machine.succeed("ip -6 route list dev eth0 | head -n-3").strip() - assert ( - ipv4Residue == "" - ), "The IPv4 routing table has not been properly cleaned:\n{}".format(ipv4Residue) - assert ( - ipv6Residue == "" - ), "The IPv6 routing table has not been properly cleaned:\n{}".format(ipv6Residue) - ''; + '' + + lib.optionalString (!networkd) '' + with subtest("test clean-up of the tables"): + machine.succeed("systemctl stop network-addresses-eth0") + ipv4Residue = machine.succeed("ip -4 route list dev eth0 | head -n-3").strip() + ipv6Residue = machine.succeed("ip -6 route list dev eth0 | head -n-3").strip() + assert ( + ipv4Residue == "" + ), "The IPv4 routing table has not been properly cleaned:\n{}".format(ipv4Residue) + assert ( + ipv6Residue == "" + ), "The IPv6 routing table has not been properly cleaned:\n{}".format(ipv6Residue) + ''; }; rename = if networkd then diff --git a/nixos/tests/opensnitch.nix b/nixos/tests/opensnitch.nix index 46366b8ec5c1..4a62bbb1e8c2 100644 --- a/nixos/tests/opensnitch.nix +++ b/nixos/tests/opensnitch.nix @@ -14,72 +14,70 @@ in maintainers = [ onny ]; }; - nodes = - { - server = { - networking.firewall.allowedTCPPorts = [ 80 ]; - services.caddy = { - enable = true; - virtualHosts."localhost".extraConfig = '' - respond "Hello, world!" - ''; - }; + nodes = { + server = { + networking.firewall.allowedTCPPorts = [ 80 ]; + services.caddy = { + enable = true; + virtualHosts."localhost".extraConfig = '' + respond "Hello, world!" + ''; }; - } - // (lib.listToAttrs ( - map ( - m: - lib.nameValuePair "client_blocked_${m}" { - services.opensnitch = { - enable = true; - settings.DefaultAction = "deny"; - settings.ProcMonitorMethod = m; - settings.LogLevel = 0; - }; - } - ) monitorMethods - )) - // (lib.listToAttrs ( - map ( - m: - lib.nameValuePair "client_allowed_${m}" { - services.opensnitch = { - enable = true; - settings.DefaultAction = "deny"; - settings.ProcMonitorMethod = m; - settings.LogLevel = 0; - rules = { - curl = { - name = "curl"; - enabled = true; - action = "allow"; - duration = "always"; - operator = { - type = "simple"; - sensitive = false; - operand = "process.path"; - data = "${pkgs.curl}/bin/curl"; - }; + }; + } + // (lib.listToAttrs ( + map ( + m: + lib.nameValuePair "client_blocked_${m}" { + services.opensnitch = { + enable = true; + settings.DefaultAction = "deny"; + settings.ProcMonitorMethod = m; + settings.LogLevel = 0; + }; + } + ) monitorMethods + )) + // (lib.listToAttrs ( + map ( + m: + lib.nameValuePair "client_allowed_${m}" { + services.opensnitch = { + enable = true; + settings.DefaultAction = "deny"; + settings.ProcMonitorMethod = m; + settings.LogLevel = 0; + rules = { + curl = { + name = "curl"; + enabled = true; + action = "allow"; + duration = "always"; + operator = { + type = "simple"; + sensitive = false; + operand = "process.path"; + data = "${pkgs.curl}/bin/curl"; }; }; }; - } - ) monitorMethods - )); + }; + } + ) monitorMethods + )); - testScript = - '' - start_all() - server.wait_for_unit("caddy.service") - server.wait_for_open_port(80) - '' - + lib.concatLines ( - map (m: '' - client_blocked_${m}.wait_for_unit("opensnitchd.service") - client_blocked_${m}.fail("curl http://server") + testScript = '' + start_all() + server.wait_for_unit("caddy.service") + server.wait_for_open_port(80) + '' + + lib.concatLines ( + map (m: '' + client_blocked_${m}.wait_for_unit("opensnitchd.service") + client_blocked_${m}.fail("curl http://server") - client_allowed_${m}.wait_for_unit("opensnitchd.service") - client_allowed_${m}.succeed("curl http://server") - '') monitorMethods - ); + client_allowed_${m}.wait_for_unit("opensnitchd.service") + client_allowed_${m}.succeed("curl http://server") + '') monitorMethods + ); } diff --git a/nixos/tests/optee.nix b/nixos/tests/optee.nix index ac049b30378c..f35f075e882a 100644 --- a/nixos/tests/optee.nix +++ b/nixos/tests/optee.nix @@ -15,12 +15,10 @@ import ./make-test-python.nix ( # Default environment for qemu-arm64 uboot does not work well with # large nixos kernel/initrds. uboot = ubootQemuAarch64.overrideAttrs (old: { - postPatch = - (old.postPatch or "") - + '' - substituteInPlace board/emulation/qemu-arm/qemu-arm.env \ - --replace-fail "ramdisk_addr_r=0x44000000" "ramdisk_addr_r=0x46000000" - ''; + postPatch = (old.postPatch or "") + '' + substituteInPlace board/emulation/qemu-arm/qemu-arm.env \ + --replace-fail "ramdisk_addr_r=0x44000000" "ramdisk_addr_r=0x46000000" + ''; }); bios = armTrustedFirmwareQemu.override { diff --git a/nixos/tests/paretosecurity.nix b/nixos/tests/paretosecurity.nix index 4a0f00e66000..0ed86e57a89e 100644 --- a/nixos/tests/paretosecurity.nix +++ b/nixos/tests/paretosecurity.nix @@ -15,13 +15,11 @@ # Create a patched version of the package that points to the local dashboard # for easier testing package = pkgs.paretosecurity.overrideAttrs (oldAttrs: { - postPatch = - oldAttrs.postPatch or "" - + '' - substituteInPlace team/report.go \ - --replace-warn 'const reportURL = "https://cloud.paretosecurity.com"' \ - 'const reportURL = "http://cloud"' - ''; + postPatch = oldAttrs.postPatch or "" + '' + substituteInPlace team/report.go \ + --replace-warn 'const reportURL = "https://cloud.paretosecurity.com"' \ + 'const reportURL = "http://cloud"' + ''; }); }; diff --git a/nixos/tests/pulseaudio.nix b/nixos/tests/pulseaudio.nix index 832696cbc633..c7791090cedb 100644 --- a/nixos/tests/pulseaudio.nix +++ b/nixos/tests/pulseaudio.nix @@ -38,20 +38,20 @@ let { imports = [ ./common/wayland-cage.nix ]; - services.pulseaudio = - { - enable = true; - support32Bit = true; - inherit systemWide; - } - // lib.optionalAttrs fullVersion { - package = pkgs.pulseaudioFull; - }; + services.pulseaudio = { + enable = true; + support32Bit = true; + inherit systemWide; + } + // lib.optionalAttrs fullVersion { + package = pkgs.pulseaudioFull; + }; environment.systemPackages = [ testers.testPlay pkgs.pavucontrol - ] ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 testers.testPlay32; + ] + ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 testers.testPlay32; } // lib.optionalAttrs systemWide { users.users.alice.extraGroups = [ "pulse-access" ]; diff --git a/nixos/tests/redis.nix b/nixos/tests/redis.nix index 8a80c0630f40..f4647ddba10f 100644 --- a/nixos/tests/redis.nix +++ b/nixos/tests/redis.nix @@ -21,7 +21,8 @@ let inherit name; meta.maintainers = [ lib.maintainers.flokli - ] ++ lib.teams.helsinki-systems.members; + ] + ++ lib.teams.helsinki-systems.members; nodes = { machine = diff --git a/nixos/tests/shadowsocks/common.nix b/nixos/tests/shadowsocks/common.nix index e81eccb3f3b3..298483f36b8f 100644 --- a/nixos/tests/shadowsocks/common.nix +++ b/nixos/tests/shadowsocks/common.nix @@ -25,20 +25,19 @@ import ../make-test-python.nix ( networking.firewall.rejectPackets = true; networking.firewall.allowedTCPPorts = [ 8488 ]; networking.firewall.allowedUDPPorts = [ 8488 ]; - services.shadowsocks = - { - enable = true; - encryptionMethod = "chacha20-ietf-poly1305"; - password = "pa$$w0rd"; - localAddress = [ "0.0.0.0" ]; - port = 8488; - fastOpen = false; - mode = "tcp_and_udp"; - } - // lib.optionalAttrs (plugin != null) { - inherit plugin; - pluginOpts = "server;${pluginOpts}"; - }; + services.shadowsocks = { + enable = true; + encryptionMethod = "chacha20-ietf-poly1305"; + password = "pa$$w0rd"; + localAddress = [ "0.0.0.0" ]; + port = 8488; + fastOpen = false; + mode = "tcp_and_udp"; + } + // lib.optionalAttrs (plugin != null) { + inherit plugin; + pluginOpts = "server;${pluginOpts}"; + }; services.nginx = { enable = true; virtualHosts.server = { diff --git a/nixos/tests/solanum.nix b/nixos/tests/solanum.nix index a2c3013125e8..9d5d554bd4ac 100644 --- a/nixos/tests/solanum.nix +++ b/nixos/tests/solanum.nix @@ -12,43 +12,42 @@ in { pkgs, lib, ... }: { name = "solanum"; - nodes = - { - "${server}" = { - networking.firewall.allowedTCPPorts = [ ircPort ]; - services.solanum = { - enable = true; - motd = '' - The default MOTD doesn't contain the word "nixos" in it. - This one does. - ''; - }; + nodes = { + "${server}" = { + networking.firewall.allowedTCPPorts = [ ircPort ]; + services.solanum = { + enable = true; + motd = '' + The default MOTD doesn't contain the word "nixos" in it. + This one does. + ''; }; - } - // lib.listToAttrs ( - builtins.map ( - client: - lib.nameValuePair client { - imports = [ - ./common/user-account.nix - ]; + }; + } + // lib.listToAttrs ( + builtins.map ( + client: + lib.nameValuePair client { + imports = [ + ./common/user-account.nix + ]; - systemd.services.ii = { - requires = [ "network.target" ]; - wantedBy = [ "default.target" ]; + systemd.services.ii = { + requires = [ "network.target" ]; + wantedBy = [ "default.target" ]; - serviceConfig = { - Type = "simple"; - ExecPreStartPre = "mkdir -p ${iiDir}"; - ExecStart = '' - ${lib.getBin pkgs.ii}/bin/ii -n ${client} -s ${server} -i ${iiDir} - ''; - User = "alice"; - }; + serviceConfig = { + Type = "simple"; + ExecPreStartPre = "mkdir -p ${iiDir}"; + ExecStart = '' + ${lib.getBin pkgs.ii}/bin/ii -n ${client} -s ${server} -i ${iiDir} + ''; + User = "alice"; }; - } - ) clients - ); + }; + } + ) clients + ); testScript = let diff --git a/nixos/tests/syncthing-many-devices.nix b/nixos/tests/syncthing-many-devices.nix index a00026faf299..0c704b3d4048 100644 --- a/nixos/tests/syncthing-many-devices.nix +++ b/nixos/tests/syncthing-many-devices.nix @@ -159,65 +159,64 @@ in settings = settingsWithoutId // settingsWithId; }; }; - testScript = - '' - machine.wait_for_unit("syncthing-init.service") - '' - + (lib.pipe settingsWithId [ - # Check that folders and devices were added properly and that all IDs exist - (lib.mapAttrsRecursive ( - path: id: - checkSettingWithId { - # plural -> solitary - t = (lib.removeSuffix "s" (builtins.elemAt path 0)); - inherit id; - } - )) - # Get all the values we applied the above function upon - (lib.collect builtins.isString) - lib.concatStrings - ]) - + (lib.pipe settingsWithoutId [ - # Check that all other syncthing.settings were added properly with correct - # values - (lib.mapAttrsRecursive ( - path: value: - checkSettingWithoutId { - t = (builtins.elemAt path 0); - n = (builtins.elemAt path 1); - v = (builtins.toString value); - } - )) - # Get all the values we applied the above function upon - (lib.collect builtins.isString) - lib.concatStrings - ]) - + '' - # Run the script on the machine - machine.succeed("${addDeviceToDeleteScript}") - '' - + (checkSettingsToDelete { - not = false; - }) - + '' - # Useful for debugging later - machine.copy_from_vm("${configPath}", "before") + testScript = '' + machine.wait_for_unit("syncthing-init.service") + '' + + (lib.pipe settingsWithId [ + # Check that folders and devices were added properly and that all IDs exist + (lib.mapAttrsRecursive ( + path: id: + checkSettingWithId { + # plural -> solitary + t = (lib.removeSuffix "s" (builtins.elemAt path 0)); + inherit id; + } + )) + # Get all the values we applied the above function upon + (lib.collect builtins.isString) + lib.concatStrings + ]) + + (lib.pipe settingsWithoutId [ + # Check that all other syncthing.settings were added properly with correct + # values + (lib.mapAttrsRecursive ( + path: value: + checkSettingWithoutId { + t = (builtins.elemAt path 0); + n = (builtins.elemAt path 1); + v = (builtins.toString value); + } + )) + # Get all the values we applied the above function upon + (lib.collect builtins.isString) + lib.concatStrings + ]) + + '' + # Run the script on the machine + machine.succeed("${addDeviceToDeleteScript}") + '' + + (checkSettingsToDelete { + not = false; + }) + + '' + # Useful for debugging later + machine.copy_from_vm("${configPath}", "before") - machine.systemctl("restart syncthing-init.service") - machine.wait_for_unit("syncthing-init.service") - '' - + (checkSettingsToDelete { - not = true; - }) - + '' - # Useful for debugging later - machine.copy_from_vm("${configPath}", "after") + machine.systemctl("restart syncthing-init.service") + machine.wait_for_unit("syncthing-init.service") + '' + + (checkSettingsToDelete { + not = true; + }) + + '' + # Useful for debugging later + machine.copy_from_vm("${configPath}", "after") - # Copy the systemd unit's bash script, to inspect it for debugging. - mergeScript = machine.succeed( - "systemctl cat syncthing-init.service | " - "${pkgs.initool}/bin/initool g - Service ExecStart --value-only" - ).strip() # strip from new lines - machine.copy_from_vm(mergeScript, "") - ''; + # Copy the systemd unit's bash script, to inspect it for debugging. + mergeScript = machine.succeed( + "systemctl cat syncthing-init.service | " + "${pkgs.initool}/bin/initool g - Service ExecStart --value-only" + ).strip() # strip from new lines + machine.copy_from_vm(mergeScript, "") + ''; } diff --git a/nixos/tests/systemd-confinement/default.nix b/nixos/tests/systemd-confinement/default.nix index 25a553380189..90cfcb8ab8af 100644 --- a/nixos/tests/systemd-confinement/default.nix +++ b/nixos/tests/systemd-confinement/default.nix @@ -67,22 +67,21 @@ import ../make-test-python.nix { } ); - systemd.services.${serviceName} = - { - inherit description; - requiredBy = [ "multi-user.target" ]; - confinement = (config.confinement or { }) // { - enable = true; - }; - serviceConfig = (config.serviceConfig or { }) // { - ExecStart = mkTest serviceName testScript; - Type = "oneshot"; - }; - } - // removeAttrs config [ - "confinement" - "serviceConfig" - ]; + systemd.services.${serviceName} = { + inherit description; + requiredBy = [ "multi-user.target" ]; + confinement = (config.confinement or { }) // { + enable = true; + }; + serviceConfig = (config.serviceConfig or { }) // { + ExecStart = mkTest serviceName testScript; + Type = "oneshot"; + }; + } + // removeAttrs config [ + "confinement" + "serviceConfig" + ]; }; parametrisedTests = diff --git a/nixos/tests/vaultwarden.nix b/nixos/tests/vaultwarden.nix index d367d372ae9d..bba165660d76 100644 --- a/nixos/tests/vaultwarden.nix +++ b/nixos/tests/vaultwarden.nix @@ -101,81 +101,80 @@ let ]; }; - nodes = - { - server = - { pkgs, ... }: - lib.mkMerge [ - { - mysql = { - services.mysql = { - enable = true; - initialScript = pkgs.writeText "mysql-init.sql" '' - CREATE DATABASE bitwarden; - CREATE USER 'bitwardenuser'@'localhost' IDENTIFIED BY '${dbPassword}'; - GRANT ALL ON `bitwarden`.* TO 'bitwardenuser'@'localhost'; - FLUSH PRIVILEGES; - ''; - package = pkgs.mariadb; - }; - - services.vaultwarden.config.databaseUrl = "mysql://bitwardenuser:${dbPassword}@localhost/bitwarden"; - - systemd.services.vaultwarden.after = [ "mysql.service" ]; - }; - - postgresql = { - services.postgresql = { - enable = true; - ensureDatabases = [ "vaultwarden" ]; - ensureUsers = [ - { - name = "vaultwarden"; - ensureDBOwnership = true; - } - ]; - }; - - services.vaultwarden.config.databaseUrl = "postgresql:///vaultwarden?host=/run/postgresql"; - - systemd.services.vaultwarden.after = [ "postgresql.target" ]; - }; - - sqlite = { - services.vaultwarden.backupDir = "/srv/backups/vaultwarden"; - - environment.systemPackages = [ pkgs.sqlite ]; - }; - } - .${backend} - - { - services.vaultwarden = { - enable = true; - dbBackend = backend; - config = { - rocketAddress = "::"; - rocketPort = 8080; - }; - }; - - networking.firewall.allowedTCPPorts = [ 8080 ]; - - environment.systemPackages = [ - pkgs.firefox-unwrapped - pkgs.geckodriver - testRunner - ]; - } - ]; - } - // lib.optionalAttrs withClient { - client = - { pkgs, ... }: + nodes = { + server = + { pkgs, ... }: + lib.mkMerge [ { - environment.systemPackages = [ pkgs.bitwarden-cli ]; - }; - }; + mysql = { + services.mysql = { + enable = true; + initialScript = pkgs.writeText "mysql-init.sql" '' + CREATE DATABASE bitwarden; + CREATE USER 'bitwardenuser'@'localhost' IDENTIFIED BY '${dbPassword}'; + GRANT ALL ON `bitwarden`.* TO 'bitwardenuser'@'localhost'; + FLUSH PRIVILEGES; + ''; + package = pkgs.mariadb; + }; + + services.vaultwarden.config.databaseUrl = "mysql://bitwardenuser:${dbPassword}@localhost/bitwarden"; + + systemd.services.vaultwarden.after = [ "mysql.service" ]; + }; + + postgresql = { + services.postgresql = { + enable = true; + ensureDatabases = [ "vaultwarden" ]; + ensureUsers = [ + { + name = "vaultwarden"; + ensureDBOwnership = true; + } + ]; + }; + + services.vaultwarden.config.databaseUrl = "postgresql:///vaultwarden?host=/run/postgresql"; + + systemd.services.vaultwarden.after = [ "postgresql.target" ]; + }; + + sqlite = { + services.vaultwarden.backupDir = "/srv/backups/vaultwarden"; + + environment.systemPackages = [ pkgs.sqlite ]; + }; + } + .${backend} + + { + services.vaultwarden = { + enable = true; + dbBackend = backend; + config = { + rocketAddress = "::"; + rocketPort = 8080; + }; + }; + + networking.firewall.allowedTCPPorts = [ 8080 ]; + + environment.systemPackages = [ + pkgs.firefox-unwrapped + pkgs.geckodriver + testRunner + ]; + } + ]; + } + // lib.optionalAttrs withClient { + client = + { pkgs, ... }: + { + environment.systemPackages = [ pkgs.bitwarden-cli ]; + }; + }; testScript = if testScript != null then diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix index da8eafa4e276..98125aec0328 100644 --- a/nixos/tests/virtualbox.nix +++ b/nixos/tests/virtualbox.nix @@ -424,7 +424,8 @@ let virtualisation.virtualbox.host = { enable = true; - } // vboxHostConfig; + } + // vboxHostConfig; nixpkgs.config.allowUnfree = config.virtualisation.virtualbox.host.enableExtensionPack; }; diff --git a/nixos/tests/ydotool.nix b/nixos/tests/ydotool.nix index 72d3ffb1f536..81c96aa12659 100644 --- a/nixos/tests/ydotool.nix +++ b/nixos/tests/ydotool.nix @@ -33,19 +33,17 @@ in services.getty.autologinUser = "alice"; }; - testScript = - asUser - + '' - start_all() + testScript = asUser + '' + start_all() - machine.wait_for_unit("multi-user.target") - machine.wait_for_text("alice") - machine.succeed(as_user("ydotool type 'echo ${textInput} > /tmp/output'")) # text input - machine.succeed(as_user("ydotool key 28:1 28:0")) # text input - machine.screenshot("headless_input") - machine.wait_for_file("/tmp/output") - machine.wait_until_succeeds("grep '${textInput}' /tmp/output") # text input - ''; + machine.wait_for_unit("multi-user.target") + machine.wait_for_text("alice") + machine.succeed(as_user("ydotool type 'echo ${textInput} > /tmp/output'")) # text input + machine.succeed(as_user("ydotool key 28:1 28:0")) # text input + machine.screenshot("headless_input") + machine.wait_for_file("/tmp/output") + machine.wait_until_succeeds("grep '${textInput}' /tmp/output") # text input + ''; meta.maintainers = with lib.maintainers; [ OPNA2608 @@ -83,21 +81,19 @@ in services.displayManager.defaultSession = lib.mkForce "none+dwm"; }; - testScript = - asUser - + '' - start_all() + testScript = asUser + '' + start_all() - machine.wait_for_x() - machine.execute(as_user("${inputBox config.node.pkgs}")) - machine.wait_for_text("${inputBoxText}") - machine.succeed(as_user("ydotool type '${textInput}'")) # text input - machine.screenshot("x11_input") - machine.succeed(as_user("ydotool mousemove -a 400 110")) # mouse input - machine.succeed(as_user("ydotool click 0xC0")) # mouse input - machine.wait_for_file("/tmp/output") - machine.wait_until_succeeds("grep '${textInput}' /tmp/output") # text input - ''; + machine.wait_for_x() + machine.execute(as_user("${inputBox config.node.pkgs}")) + machine.wait_for_text("${inputBoxText}") + machine.succeed(as_user("ydotool type '${textInput}'")) # text input + machine.screenshot("x11_input") + machine.succeed(as_user("ydotool mousemove -a 400 110")) # mouse input + machine.succeed(as_user("ydotool click 0xC0")) # mouse input + machine.wait_for_file("/tmp/output") + machine.wait_until_succeeds("grep '${textInput}' /tmp/output") # text input + ''; meta.maintainers = with lib.maintainers; [ OPNA2608 diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index 7cb2fc0f1a6e..12d9b23886f1 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -122,83 +122,82 @@ let }; }; - testScript = - '' - machine.wait_for_unit("multi-user.target") - machine.succeed( - "zpool status", - "parted --script /dev/vdb mklabel msdos", - "parted --script /dev/vdb -- mkpart primary 1024M -1s", - "parted --script /dev/vdc mklabel msdos", - "parted --script /dev/vdc -- mkpart primary 1024M -1s", - ) + testScript = '' + machine.wait_for_unit("multi-user.target") + machine.succeed( + "zpool status", + "parted --script /dev/vdb mklabel msdos", + "parted --script /dev/vdb -- mkpart primary 1024M -1s", + "parted --script /dev/vdc mklabel msdos", + "parted --script /dev/vdc -- mkpart primary 1024M -1s", + ) - with subtest("sharesmb works"): - machine.succeed( - "zpool create rpool /dev/vdb1", - "zfs create -o mountpoint=legacy rpool/root", - # shared datasets cannot have legacy mountpoint - "zfs create rpool/shared_smb", - "bootctl set-default nixos-generation-1-specialisation-samba.conf", - "sync", - ) - machine.crash() - machine.wait_for_unit("multi-user.target") - machine.succeed("zfs set sharesmb=on rpool/shared_smb") - machine.succeed( - "smbclient -gNL localhost | grep rpool_shared_smb", - "umount /tmp/mnt", - "zpool destroy rpool", - ) + with subtest("sharesmb works"): + machine.succeed( + "zpool create rpool /dev/vdb1", + "zfs create -o mountpoint=legacy rpool/root", + # shared datasets cannot have legacy mountpoint + "zfs create rpool/shared_smb", + "bootctl set-default nixos-generation-1-specialisation-samba.conf", + "sync", + ) + machine.crash() + machine.wait_for_unit("multi-user.target") + machine.succeed("zfs set sharesmb=on rpool/shared_smb") + machine.succeed( + "smbclient -gNL localhost | grep rpool_shared_smb", + "umount /tmp/mnt", + "zpool destroy rpool", + ) - with subtest("encryption works"): - machine.succeed( - 'echo password | zpool create -O mountpoint=legacy ' - + "-O encryption=aes-256-gcm -O keyformat=passphrase automatic /dev/vdb1", - "zpool create -O mountpoint=legacy manual /dev/vdc1", - "echo otherpass | zfs create " - + "-o encryption=aes-256-gcm -o keyformat=passphrase manual/encrypted", - "zfs create -o encryption=aes-256-gcm -o keyformat=passphrase " - + "-o keylocation=http://localhost/zfskey manual/httpkey", - "bootctl set-default nixos-generation-1-specialisation-encryption.conf", - "sync", - "zpool export automatic", - "zpool export manual", - ) - machine.crash() - machine.start() - machine.wait_for_console_text("Starting password query on") - machine.send_console("password\n") - machine.wait_for_unit("multi-user.target") - machine.succeed( - "zfs get -Ho value keystatus manual/encrypted | grep -Fx unavailable", - "echo otherpass | zfs load-key manual/encrypted", - "systemctl start manual-encrypted.mount", - "zfs load-key manual/httpkey", - "systemctl start manual-httpkey.mount", - "umount /automatic /manual/encrypted /manual/httpkey /manual", - "zpool destroy automatic", - "zpool destroy manual", - ) + with subtest("encryption works"): + machine.succeed( + 'echo password | zpool create -O mountpoint=legacy ' + + "-O encryption=aes-256-gcm -O keyformat=passphrase automatic /dev/vdb1", + "zpool create -O mountpoint=legacy manual /dev/vdc1", + "echo otherpass | zfs create " + + "-o encryption=aes-256-gcm -o keyformat=passphrase manual/encrypted", + "zfs create -o encryption=aes-256-gcm -o keyformat=passphrase " + + "-o keylocation=http://localhost/zfskey manual/httpkey", + "bootctl set-default nixos-generation-1-specialisation-encryption.conf", + "sync", + "zpool export automatic", + "zpool export manual", + ) + machine.crash() + machine.start() + machine.wait_for_console_text("Starting password query on") + machine.send_console("password\n") + machine.wait_for_unit("multi-user.target") + machine.succeed( + "zfs get -Ho value keystatus manual/encrypted | grep -Fx unavailable", + "echo otherpass | zfs load-key manual/encrypted", + "systemctl start manual-encrypted.mount", + "zfs load-key manual/httpkey", + "systemctl start manual-httpkey.mount", + "umount /automatic /manual/encrypted /manual/httpkey /manual", + "zpool destroy automatic", + "zpool destroy manual", + ) - with subtest("boot.zfs.forceImportAll works"): - machine.succeed( - "rm /etc/hostid", - "zgenhostid deadcafe", - "zpool create forcepool /dev/vdb1 -O mountpoint=legacy", - "bootctl set-default nixos-generation-1-specialisation-forcepool.conf", - "rm /etc/hostid", - "sync", - ) - machine.crash() - machine.wait_for_unit("multi-user.target") - machine.fail("zpool import forcepool") - machine.succeed( - "systemctl start forcepool.mount", - "mount | grep forcepool", - ) - '' - + extraTest; + with subtest("boot.zfs.forceImportAll works"): + machine.succeed( + "rm /etc/hostid", + "zgenhostid deadcafe", + "zpool create forcepool /dev/vdb1 -O mountpoint=legacy", + "bootctl set-default nixos-generation-1-specialisation-forcepool.conf", + "rm /etc/hostid", + "sync", + ) + machine.crash() + machine.wait_for_unit("multi-user.target") + machine.fail("zpool import forcepool") + machine.succeed( + "systemctl start forcepool.mount", + "mount | grep forcepool", + ) + '' + + extraTest; }; diff --git a/pkgs/applications/audio/ardour/7.nix b/pkgs/applications/audio/ardour/7.nix index 45c6b132d59b..31f67dc36ce0 100644 --- a/pkgs/applications/audio/ardour/7.nix +++ b/pkgs/applications/audio/ardour/7.nix @@ -123,56 +123,55 @@ stdenv.mkDerivation rec { wafHook ]; - buildInputs = - [ - alsa-lib - aubio - boost186 - cairomm - cppunit - curl - dbus - ffmpeg - fftw - fftwSinglePrec - flac - glibmm - gtkmm2 - itstool - libarchive - libjack2 - liblo - libogg - libpulseaudio - librdf_rasqal - libsamplerate - libsigcxx - libsndfile - libusb1 - libuv - libwebsockets - libxml2 - libxslt - lilv - lrdf - lv2 - pango - perl - python3 - readline - rubberband - serd - sord - soundtouch - sratom - suil - taglib_1 - vamp-plugin-sdk - ] - ++ lib.optionals videoSupport [ - harvid - xjadeo - ]; + buildInputs = [ + alsa-lib + aubio + boost186 + cairomm + cppunit + curl + dbus + ffmpeg + fftw + fftwSinglePrec + flac + glibmm + gtkmm2 + itstool + libarchive + libjack2 + liblo + libogg + libpulseaudio + librdf_rasqal + libsamplerate + libsigcxx + libsndfile + libusb1 + libuv + libwebsockets + libxml2 + libxslt + lilv + lrdf + lv2 + pango + perl + python3 + readline + rubberband + serd + sord + soundtouch + sratom + suil + taglib_1 + vamp-plugin-sdk + ] + ++ lib.optionals videoSupport [ + harvid + xjadeo + ]; wafConfigureFlags = [ "--cxx11" @@ -187,32 +186,31 @@ stdenv.mkDerivation rec { # removed because it fixes https://tracker.ardour.org/view.php?id=8161 and https://tracker.ardour.org/view.php?id=8437 # "--use-external-libs" - postInstall = - '' - # wscript does not install these for some reason - install -vDm 644 "build/gtk2_ardour/ardour.xml" \ - -t "$out/share/mime/packages" - install -vDm 644 "build/gtk2_ardour/ardour${lib.versions.major version}.desktop" \ - -t "$out/share/applications" - for size in 16 22 32 48 256 512; do - install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ - "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${lib.versions.major version}.png" - done - install -vDm 644 "ardour.1"* -t "$out/share/man/man1" + postInstall = '' + # wscript does not install these for some reason + install -vDm 644 "build/gtk2_ardour/ardour.xml" \ + -t "$out/share/mime/packages" + install -vDm 644 "build/gtk2_ardour/ardour${lib.versions.major version}.desktop" \ + -t "$out/share/applications" + for size in 16 22 32 48 256 512; do + install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ + "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${lib.versions.major version}.png" + done + install -vDm 644 "ardour.1"* -t "$out/share/man/man1" - # install additional bundled beats, chords and progressions - cp -rp "${bundledContent}"/* "$out/share/ardour${lib.versions.major version}/media" - '' - + lib.optionalString videoSupport '' - # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. - wrapProgram "$out/bin/ardour${lib.versions.major version}" \ - --prefix PATH : "${ - lib.makeBinPath [ - harvid - xjadeo - ] - }" - ''; + # install additional bundled beats, chords and progressions + cp -rp "${bundledContent}"/* "$out/share/ardour${lib.versions.major version}/media" + '' + + lib.optionalString videoSupport '' + # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. + wrapProgram "$out/bin/ardour${lib.versions.major version}" \ + --prefix PATH : "${ + lib.makeBinPath [ + harvid + xjadeo + ] + }" + ''; LINKFLAGS = "-lpthread"; diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix index 688e9e92599e..5ec4504270ea 100644 --- a/pkgs/applications/audio/ardour/default.nix +++ b/pkgs/applications/audio/ardour/default.nix @@ -114,61 +114,60 @@ stdenv.mkDerivation ( wafHook ]; - buildInputs = - [ - alsa-lib - aubio - boost - cairomm - cppunit - curl - dbus - ffmpeg - fftw - fftwSinglePrec - flac - fluidsynth - glibmm - gtkmm2 - hidapi - itstool - kissfft - libarchive - libjack2 - liblo - libltc - libogg - libpulseaudio - librdf_rasqal - libsamplerate - libsigcxx - libsndfile - libusb1 - libuv - libwebsockets - libxml2 - libxslt - lilv - lrdf - lv2 - pango - perl - python3 - qm-dsp - readline - rubberband - serd - sord - soundtouch - sratom - suil - taglib - vamp-plugin-sdk - ] - ++ lib.optionals videoSupport [ - harvid - xjadeo - ]; + buildInputs = [ + alsa-lib + aubio + boost + cairomm + cppunit + curl + dbus + ffmpeg + fftw + fftwSinglePrec + flac + fluidsynth + glibmm + gtkmm2 + hidapi + itstool + kissfft + libarchive + libjack2 + liblo + libltc + libogg + libpulseaudio + librdf_rasqal + libsamplerate + libsigcxx + libsndfile + libusb1 + libuv + libwebsockets + libxml2 + libxslt + lilv + lrdf + lv2 + pango + perl + python3 + qm-dsp + readline + rubberband + serd + sord + soundtouch + sratom + suil + taglib + vamp-plugin-sdk + ] + ++ lib.optionals videoSupport [ + harvid + xjadeo + ]; wafConfigureFlags = [ "--cxx17" @@ -184,34 +183,34 @@ stdenv.mkDerivation ( # and # https://discourse.ardour.org/t/ardour-8-2-released/109615/8 # "--use-external-libs" - ] ++ lib.optional optimize "--optimize"; + ] + ++ lib.optional optimize "--optimize"; - postInstall = - '' - # wscript does not install these for some reason - install -vDm 644 "build/gtk2_ardour/ardour.xml" \ - -t "$out/share/mime/packages" - install -vDm 644 "build/gtk2_ardour/ardour${majorVersion}.desktop" \ - -t "$out/share/applications" - for size in 16 22 32 48 256 512; do - install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ - "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${majorVersion}.png" - done - install -vDm 644 "ardour.1"* -t "$out/share/man/man1" + postInstall = '' + # wscript does not install these for some reason + install -vDm 644 "build/gtk2_ardour/ardour.xml" \ + -t "$out/share/mime/packages" + install -vDm 644 "build/gtk2_ardour/ardour${majorVersion}.desktop" \ + -t "$out/share/applications" + for size in 16 22 32 48 256 512; do + install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \ + "$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${majorVersion}.png" + done + install -vDm 644 "ardour.1"* -t "$out/share/man/man1" - # install additional bundled beats, chords and progressions - cp -rp "${finalAttrs.bundledContent}"/* "$out/share/ardour${majorVersion}/media" - '' - + lib.optionalString videoSupport '' - # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. - wrapProgram "$out/bin/ardour${majorVersion}" \ - --prefix PATH : "${ - lib.makeBinPath [ - harvid - xjadeo - ] - }" - ''; + # install additional bundled beats, chords and progressions + cp -rp "${finalAttrs.bundledContent}"/* "$out/share/ardour${majorVersion}/media" + '' + + lib.optionalString videoSupport '' + # `harvid` and `xjadeo` must be accessible in `PATH` for video to work. + wrapProgram "$out/bin/ardour${majorVersion}" \ + --prefix PATH : "${ + lib.makeBinPath [ + harvid + xjadeo + ] + }" + ''; LINKFLAGS = "-lpthread"; diff --git a/pkgs/applications/audio/bucklespring/default.nix b/pkgs/applications/audio/bucklespring/default.nix index a126c227f346..d853c16748b4 100644 --- a/pkgs/applications/audio/bucklespring/default.nix +++ b/pkgs/applications/audio/bucklespring/default.nix @@ -34,16 +34,15 @@ stdenv.mkDerivation rec { makeWrapper ]; - buildInputs = - [ - openal - alure - ] - ++ optionals (legacy) [ - libXtst - libX11 - ] - ++ optionals (!legacy) [ libinput ]; + buildInputs = [ + openal + alure + ] + ++ optionals (legacy) [ + libXtst + libX11 + ] + ++ optionals (!legacy) [ libinput ]; makeFlags = optionals (!legacy) [ "libinput=1" ]; diff --git a/pkgs/applications/audio/carla/default.nix b/pkgs/applications/audio/carla/default.nix index eec155591d35..2bd1c7308dfa 100644 --- a/pkgs/applications/audio/carla/default.nix +++ b/pkgs/applications/audio/carla/default.nix @@ -61,19 +61,18 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional withFrontend pyqt5; - buildInputs = - [ - file - liblo - alsa-lib - fluidsynth - jack2 - libpulseaudio - libsndfile - ] - ++ lib.optional withQt qtbase - ++ lib.optional withGtk2 gtk2 - ++ lib.optional withGtk3 gtk3; + buildInputs = [ + file + liblo + alsa-lib + fluidsynth + jack2 + libpulseaudio + libsndfile + ] + ++ lib.optional withQt qtbase + ++ lib.optional withGtk2 gtk2 + ++ lib.optional withGtk3 gtk3; propagatedBuildInputs = finalAttrs.pythonPath; @@ -81,19 +80,18 @@ stdenv.mkDerivation (finalAttrs: { installFlags = [ "PREFIX=$(out)" ]; - postPatch = - '' - # --with-appname="$0" is evaluated with $0=.carla-wrapped instead of carla. Fix that. - for file in $(grep -rl -- '--with-appname="$0"'); do - filename="$(basename -- "$file")" - substituteInPlace "$file" --replace '--with-appname="$0"' "--with-appname=\"$filename\"" - done - '' - + lib.optionalString withGtk2 '' - # Will try to dlopen() libgtk-x11-2.0 at runtime when using the bridge. - substituteInPlace source/bridges-ui/Makefile \ - --replace '$(CXX) $(OBJS_GTK2)' '$(CXX) $(OBJS_GTK2) -lgtk-x11-2.0' - ''; + postPatch = '' + # --with-appname="$0" is evaluated with $0=.carla-wrapped instead of carla. Fix that. + for file in $(grep -rl -- '--with-appname="$0"'); do + filename="$(basename -- "$file")" + substituteInPlace "$file" --replace '--with-appname="$0"' "--with-appname=\"$filename\"" + done + '' + + lib.optionalString withGtk2 '' + # Will try to dlopen() libgtk-x11-2.0 at runtime when using the bridge. + substituteInPlace source/bridges-ui/Makefile \ + --replace '$(CXX) $(OBJS_GTK2)' '$(CXX) $(OBJS_GTK2) -lgtk-x11-2.0' + ''; dontWrapQtApps = true; postFixup = '' diff --git a/pkgs/applications/audio/chuck/default.nix b/pkgs/applications/audio/chuck/default.nix index aa640b573ddd..0c9f2f1932f1 100644 --- a/pkgs/applications/audio/chuck/default.nix +++ b/pkgs/applications/audio/chuck/default.nix @@ -20,16 +20,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-hIwsC9rYgXWSTFqUufKGqoT0Gnsf4nR4KQ0iSVbj8xg="; }; - nativeBuildInputs = - [ - flex - bison - which - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - DarwinTools - xcbuild - ]; + nativeBuildInputs = [ + flex + bison + which + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + DarwinTools + xcbuild + ]; buildInputs = [ libsndfile ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) alsa-lib; diff --git a/pkgs/applications/audio/clementine/default.nix b/pkgs/applications/audio/clementine/default.nix index 429d3dff459b..55ccaffa5ae1 100644 --- a/pkgs/applications/audio/clementine/default.nix +++ b/pkgs/applications/audio/clementine/default.nix @@ -70,41 +70,40 @@ stdenv.mkDerivation (finalAttrs: { orc ]; - buildInputs = - [ - boost - chromaprint - fftw - gettext - glew - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-bad - gst_all_1.gstreamer - gvfs - liblastfm - libpulseaudio - pcre - projectm_3 - protobuf - qca-qt5 - qjson - qtbase - qtx11extras - qttools - sqlite - taglib_1 - alsa-lib - ] - # gst_plugins needed for setup-hooks - ++ gst_plugins - ++ lib.optionals (withIpod) [ - libgpod - libplist - usbmuxd - ] - ++ lib.optionals (withMTP) [ libmtp ] - ++ lib.optionals (withCD) [ libcdio ] - ++ lib.optionals (withCloud) [ sparsehash ]; + buildInputs = [ + boost + chromaprint + fftw + gettext + glew + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-bad + gst_all_1.gstreamer + gvfs + liblastfm + libpulseaudio + pcre + projectm_3 + protobuf + qca-qt5 + qjson + qtbase + qtx11extras + qttools + sqlite + taglib_1 + alsa-lib + ] + # gst_plugins needed for setup-hooks + ++ gst_plugins + ++ lib.optionals (withIpod) [ + libgpod + libplist + usbmuxd + ] + ++ lib.optionals (withMTP) [ libmtp ] + ++ lib.optionals (withCD) [ libcdio ] + ++ lib.optionals (withCloud) [ sparsehash ]; postPatch = '' sed -i src/CMakeLists.txt \ diff --git a/pkgs/applications/audio/cmus/default.nix b/pkgs/applications/audio/cmus/default.nix index 167330ef6c6d..2e6c5e0d92e0 100644 --- a/pkgs/applications/audio/cmus/default.nix +++ b/pkgs/applications/audio/cmus/default.nix @@ -145,19 +145,21 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ ncurses ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ lib.flatten (lib.concatMap (a: a.deps) opts); + buildInputs = [ + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.flatten (lib.concatMap (a: a.deps) opts); prefixKey = "prefix="; configureFlags = [ "CONFIG_WAV=y" "HOSTCC=${stdenv.cc.targetPrefix}cc" - ] ++ lib.concatMap (a: a.flags) opts; + ] + ++ lib.concatMap (a: a.flags) opts; makeFlags = [ "LD=$(CC)" ]; diff --git a/pkgs/applications/audio/csound/default.nix b/pkgs/applications/audio/csound/default.nix index dc8989ef357c..965ff2310bad 100644 --- a/pkgs/applications/audio/csound/default.nix +++ b/pkgs/applications/audio/csound/default.nix @@ -36,13 +36,14 @@ stdenv.mkDerivation { sha256 = "sha256-NDYltwmjBsX1DWCjy8/4cXMSl3/mK+HaQHSKUmRR9TI="; }; - cmakeFlags = - [ "-DBUILD_CSOUND_AC=0" ] # fails to find Score.hpp - ++ lib.optional stdenv.hostPlatform.isDarwin "-DCS_FRAMEWORK_DEST=${placeholder "out"}/lib" - # Ignore gettext in CMAKE_PREFIX_PATH on cross to prevent find_program picking up the wrong gettext - ++ lib.optional ( - stdenv.hostPlatform != stdenv.buildPlatform - ) "-DCMAKE_IGNORE_PATH=${lib.getBin gettext}/bin"; + cmakeFlags = [ + "-DBUILD_CSOUND_AC=0" + ] # fails to find Score.hpp + ++ lib.optional stdenv.hostPlatform.isDarwin "-DCS_FRAMEWORK_DEST=${placeholder "out"}/lib" + # Ignore gettext in CMAKE_PREFIX_PATH on cross to prevent find_program picking up the wrong gettext + ++ lib.optional ( + stdenv.hostPlatform != stdenv.buildPlatform + ) "-DCMAKE_IGNORE_PATH=${lib.getBin gettext}/bin"; nativeBuildInputs = [ cmake @@ -50,29 +51,28 @@ stdenv.mkDerivation { bison gettext ]; - buildInputs = - [ - libsndfile - libsamplerate - boost + buildInputs = [ + libsndfile + libsamplerate + boost + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + portaudio + ] + ++ lib.optionals stdenv.hostPlatform.isLinux ( + builtins.filter (optional: optional != null) [ + alsa-lib + libpulseaudio + libjack2 + liblo + ladspa-sdk + fluidsynth + eigen + curl + tcltk + fltk ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - portaudio - ] - ++ lib.optionals stdenv.hostPlatform.isLinux ( - builtins.filter (optional: optional != null) [ - alsa-lib - libpulseaudio - libjack2 - liblo - ladspa-sdk - fluidsynth - eigen - curl - tcltk - fltk - ] - ); + ); postInstall = lib.optional stdenv.hostPlatform.isDarwin '' mkdir -p $out/Library/Frameworks diff --git a/pkgs/applications/audio/deadbeef/default.nix b/pkgs/applications/audio/deadbeef/default.nix index 222dfa3acb4e..7393b0c80e74 100644 --- a/pkgs/applications/audio/deadbeef/default.nix +++ b/pkgs/applications/audio/deadbeef/default.nix @@ -84,91 +84,89 @@ clangStdenv.mkDerivation { hash = "sha256-qa0ULmE15lV2vkyXPNW9kSISQZEANrjwJwykTiifk5Q="; }; - buildInputs = - [ - jansson - swift-corelibs-libdispatch - ] - ++ optionals gtk2Support [ - gtk2 - ] - ++ optionals gtk3Support [ - gtk3 - gsettings-desktop-schemas - ] - ++ optionals vorbisSupport [ - libvorbis - ] - ++ optionals mp123Support [ - libmad - ] - ++ optionals flacSupport [ - flac - ] - ++ optionals wavSupport [ - libsndfile - ] - ++ optionals cdaSupport [ - libcdio - libcddb - ] - ++ optionals aacSupport [ - faad2 - ] - ++ optionals opusSupport [ - opusfile - ] - ++ optionals zipSupport [ - libzip - ] - ++ optionals ffmpegSupport [ - ffmpeg - ] - ++ optionals apeSupport [ - yasm - ] - ++ optionals artworkSupport [ - imlib2 - ] - ++ optionals hotkeysSupport [ - libX11 - ] - ++ optionals osdSupport [ - dbus - ] - ++ optionals alsaSupport [ - alsa-lib - ] - ++ optionals pulseSupport [ - libpulseaudio - ] - ++ optionals pipewireSupport [ - pipewire - ] - ++ optionals resamplerSupport [ - libsamplerate - ] - ++ optionals overloadSupport [ - zlib - ] - ++ optionals wavpackSupport [ - wavpack - ] - ++ optionals remoteSupport [ - curl - ]; + buildInputs = [ + jansson + swift-corelibs-libdispatch + ] + ++ optionals gtk2Support [ + gtk2 + ] + ++ optionals gtk3Support [ + gtk3 + gsettings-desktop-schemas + ] + ++ optionals vorbisSupport [ + libvorbis + ] + ++ optionals mp123Support [ + libmad + ] + ++ optionals flacSupport [ + flac + ] + ++ optionals wavSupport [ + libsndfile + ] + ++ optionals cdaSupport [ + libcdio + libcddb + ] + ++ optionals aacSupport [ + faad2 + ] + ++ optionals opusSupport [ + opusfile + ] + ++ optionals zipSupport [ + libzip + ] + ++ optionals ffmpegSupport [ + ffmpeg + ] + ++ optionals apeSupport [ + yasm + ] + ++ optionals artworkSupport [ + imlib2 + ] + ++ optionals hotkeysSupport [ + libX11 + ] + ++ optionals osdSupport [ + dbus + ] + ++ optionals alsaSupport [ + alsa-lib + ] + ++ optionals pulseSupport [ + libpulseaudio + ] + ++ optionals pipewireSupport [ + pipewire + ] + ++ optionals resamplerSupport [ + libsamplerate + ] + ++ optionals overloadSupport [ + zlib + ] + ++ optionals wavpackSupport [ + wavpack + ] + ++ optionals remoteSupport [ + curl + ]; - nativeBuildInputs = - [ - autoconf - automake - intltool - libtool - pkg-config - ] - ++ optionals gtk3Support [ - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + autoconf + automake + intltool + libtool + pkg-config + ] + ++ optionals gtk3Support [ + wrapGAppsHook3 + ]; enableParallelBuilding = true; diff --git a/pkgs/applications/audio/easyaudiosync/default.nix b/pkgs/applications/audio/easyaudiosync/default.nix index e7166cd9eb80..a6f744db1b65 100644 --- a/pkgs/applications/audio/easyaudiosync/default.nix +++ b/pkgs/applications/audio/easyaudiosync/default.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation rec { cmake pkg-config wrapQtAppsHook - ] ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; + ] + ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; buildInputs = [ qtbase @@ -45,27 +46,26 @@ stdenv.mkDerivation rec { taglib ]; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - mv "easyaudiosync.app" "Easy Audio Sync.app" - cp -r "Easy Audio Sync.app" $out/Applications - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm755 easyaudiosync $out/bin/easyaudiosync + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + mv "easyaudiosync.app" "Easy Audio Sync.app" + cp -r "Easy Audio Sync.app" $out/Applications + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm755 easyaudiosync $out/bin/easyaudiosync - for RES in 48 64 128 256; do - install -Dm755 "$src/assets/icons/easyaudiosync''${RES}.png" "$out/share/icons/hicolor/''${RES}x''${RES}/apps/easyaudiosync.png" - done + for RES in 48 64 128 256; do + install -Dm755 "$src/assets/icons/easyaudiosync''${RES}.png" "$out/share/icons/hicolor/''${RES}x''${RES}/apps/easyaudiosync.png" + done - install -Dm755 "$src/assets/icons/easyaudiosync.svg" "$out/share/icons/hicolor/scalable/apps/easyaudiosync.svg" - '' - + '' - runHook postInstall - ''; + install -Dm755 "$src/assets/icons/easyaudiosync.svg" "$out/share/icons/hicolor/scalable/apps/easyaudiosync.svg" + '' + + '' + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/applications/audio/espeak-ng/default.nix b/pkgs/applications/audio/espeak-ng/default.nix index 19b5dd800b5b..269a70c532c2 100644 --- a/pkgs/applications/audio/espeak-ng/default.nix +++ b/pkgs/applications/audio/espeak-ng/default.nix @@ -32,20 +32,19 @@ stdenv.mkDerivation rec { hash = "sha256-aAJ+k+kkOS6k835mEW7BvgAIYGhUHxf7Q4P5cKO8XTk="; }; - patches = - [ - # Fix build with Clang 16. - (fetchpatch { - url = "https://github.com/espeak-ng/espeak-ng/commit/497c6217d696c1190c3e8b992ff7b9110eb3bedd.patch"; - hash = "sha256-KfzqnRyQfz6nuMKnsHoUzb9rn9h/Pg54mupW1Cr+Zx0="; - }) - ] - ++ lib.optionals mbrolaSupport [ - # Hardcode correct mbrola paths. - (replaceVars ./mbrola.patch { - inherit mbrola; - }) - ]; + patches = [ + # Fix build with Clang 16. + (fetchpatch { + url = "https://github.com/espeak-ng/espeak-ng/commit/497c6217d696c1190c3e8b992ff7b9110eb3bedd.patch"; + hash = "sha256-KfzqnRyQfz6nuMKnsHoUzb9rn9h/Pg54mupW1Cr+Zx0="; + }) + ] + ++ lib.optionals mbrolaSupport [ + # Hardcode correct mbrola paths. + (replaceVars ./mbrola.patch { + inherit mbrola; + }) + ]; nativeBuildInputs = [ autoconf diff --git a/pkgs/applications/audio/espeak/default.nix b/pkgs/applications/audio/espeak/default.nix index d5a443095bf1..fa89133c76c1 100644 --- a/pkgs/applications/audio/espeak/default.nix +++ b/pkgs/applications/audio/espeak/default.nix @@ -22,14 +22,13 @@ stdenv.mkDerivation rec { ./gcc6.patch ]; - prePatch = - '' - sed -e s,/bin/ln,ln,g -i src/Makefile - sed -e 's,^CXXFLAGS=-O2,CXXFLAGS=-O2 -D PATH_ESPEAK_DATA=\\\"$(DATADIR)\\\",' -i src/Makefile - '' - + (lib.optionalString (portaudio.api_version == 19) '' - cp src/portaudio19.h src/portaudio.h - ''); + prePatch = '' + sed -e s,/bin/ln,ln,g -i src/Makefile + sed -e 's,^CXXFLAGS=-O2,CXXFLAGS=-O2 -D PATH_ESPEAK_DATA=\\\"$(DATADIR)\\\",' -i src/Makefile + '' + + (lib.optionalString (portaudio.api_version == 19) '' + cp src/portaudio19.h src/portaudio.h + ''); configurePhase = '' cd src diff --git a/pkgs/applications/audio/espeak/edit.nix b/pkgs/applications/audio/espeak/edit.nix index a4b5536e6f99..b295b792fc97 100644 --- a/pkgs/applications/audio/espeak/edit.nix +++ b/pkgs/applications/audio/espeak/edit.nix @@ -45,21 +45,20 @@ stdenv.mkDerivation rec { ./espeakedit-wxgtk30.patch ]; - postPatch = - '' - # Disable -Wall flag because it's noisy - sed -i "s/-Wall//g" src/Makefile + postPatch = '' + # Disable -Wall flag because it's noisy + sed -i "s/-Wall//g" src/Makefile - # Fixup paths (file names from above espeak-configurable* patches) - for file in src/compiledata.cpp src/readclause.cpp src/speech.h; do - sed -e "s|@sox@|${sox}/bin/sox|" \ - -e "s|@prefix@|$out|" \ - -i "$file" - done - '' - + lib.optionalString (portaudio.api_version == 19) '' - cp src/portaudio19.h src/portaudio.h - ''; + # Fixup paths (file names from above espeak-configurable* patches) + for file in src/compiledata.cpp src/readclause.cpp src/speech.h; do + sed -e "s|@sox@|${sox}/bin/sox|" \ + -e "s|@prefix@|$out|" \ + -i "$file" + done + '' + + lib.optionalString (portaudio.api_version == 19) '' + cp src/portaudio19.h src/portaudio.h + ''; buildPhase = '' make -C src diff --git a/pkgs/applications/audio/guitarix/default.nix b/pkgs/applications/audio/guitarix/default.nix index 35df0699b260..b7ae5c9f1e5e 100644 --- a/pkgs/applications/audio/guitarix/default.nix +++ b/pkgs/applications/audio/guitarix/default.nix @@ -101,7 +101,8 @@ stdenv.mkDerivation (finalAttrs: { "--no-desktop-update" "--enable-nls" "--install-roboto-font" - ] ++ optional optimizationSupport "--optimization"; + ] + ++ optional optimizationSupport "--optimization"; env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ]; diff --git a/pkgs/applications/audio/jamesdsp/default.nix b/pkgs/applications/audio/jamesdsp/default.nix index 1849a8c428a2..330b3a4ec78a 100644 --- a/pkgs/applications/audio/jamesdsp/default.nix +++ b/pkgs/applications/audio/jamesdsp/default.nix @@ -52,23 +52,22 @@ stdenv.mkDerivation (finalAttrs: { ./fix-build-on-qt6_9.diff ]; - buildInputs = - [ - glibmm - libarchive - qtbase - qtsvg - qtwayland - ] - ++ lib.optionals usePipewire [ - pipewire - ] - ++ lib.optionals usePulseaudio [ - pulseaudio - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gstreamer - ]; + buildInputs = [ + glibmm + libarchive + qtbase + qtsvg + qtwayland + ] + ++ lib.optionals usePipewire [ + pipewire + ] + ++ lib.optionals usePulseaudio [ + pulseaudio + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gstreamer + ]; preFixup = lib.optionalString usePulseaudio '' qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") diff --git a/pkgs/applications/audio/librespot/default.nix b/pkgs/applications/audio/librespot/default.nix index 04d6174c31a2..e42f43f7b7a5 100644 --- a/pkgs/applications/audio/librespot/default.nix +++ b/pkgs/applications/audio/librespot/default.nix @@ -34,21 +34,21 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-SqvJSHkyd1IicT6c4pE96dBJNNodULhpyG14HRGVWCk="; - nativeBuildInputs = - [ - pkg-config - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - rustPlatform.bindgenHook - ]; + nativeBuildInputs = [ + pkg-config + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + rustPlatform.bindgenHook + ]; - buildInputs = - [ openssl ] - ++ lib.optional withALSA alsa-lib - ++ lib.optional withDNS-SD avahi-compat - ++ lib.optional withPortAudio portaudio - ++ lib.optional withPulseAudio libpulseaudio; + buildInputs = [ + openssl + ] + ++ lib.optional withALSA alsa-lib + ++ lib.optional withDNS-SD avahi-compat + ++ lib.optional withPortAudio portaudio + ++ lib.optional withPulseAudio libpulseaudio; buildNoDefaultFeatures = true; buildFeatures = diff --git a/pkgs/applications/audio/mellowplayer/default.nix b/pkgs/applications/audio/mellowplayer/default.nix index 0b51b83f98f7..4e272459bcd4 100644 --- a/pkgs/applications/audio/mellowplayer/default.nix +++ b/pkgs/applications/audio/mellowplayer/default.nix @@ -44,29 +44,28 @@ mkDerivation rec { cmakeFlags = [ "-DBUILD_TESTS=ON" ]; - preCheck = - '' - # Running the tests requires a location at the home directory for logging. - export HOME="$NIX_BUILD_TOP/home" - mkdir -p "$HOME/.local/share/MellowPlayer.Tests/MellowPlayer.Tests/Logs" + preCheck = '' + # Running the tests requires a location at the home directory for logging. + export HOME="$NIX_BUILD_TOP/home" + mkdir -p "$HOME/.local/share/MellowPlayer.Tests/MellowPlayer.Tests/Logs" - # Without this, the tests fail because they cannot create the QT Window - export QT_QPA_PLATFORM=offscreen - '' - # TODO: The tests are failing because it can't locate QT plugins. Is there a better way to do this? - + (builtins.concatStringsSep "\n" ( - lib.lists.flatten ( - builtins.map (pkg: [ - (lib.optionalString (pkg ? qtPluginPrefix) '' - export QT_PLUGIN_PATH="${pkg}/${pkg.qtPluginPrefix}"''${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH - '') + # Without this, the tests fail because they cannot create the QT Window + export QT_QPA_PLATFORM=offscreen + '' + # TODO: The tests are failing because it can't locate QT plugins. Is there a better way to do this? + + (builtins.concatStringsSep "\n" ( + lib.lists.flatten ( + builtins.map (pkg: [ + (lib.optionalString (pkg ? qtPluginPrefix) '' + export QT_PLUGIN_PATH="${pkg}/${pkg.qtPluginPrefix}"''${QT_PLUGIN_PATH:+':'}$QT_PLUGIN_PATH + '') - (lib.optionalString (pkg ? qtQmlPrefix) '' - export QML2_IMPORT_PATH="${pkg}/${pkg.qtQmlPrefix}"''${QML2_IMPORT_PATH:+':'}$QML2_IMPORT_PATH - '') - ]) buildInputs - ) - )); + (lib.optionalString (pkg ? qtQmlPrefix) '' + export QML2_IMPORT_PATH="${pkg}/${pkg.qtQmlPrefix}"''${QML2_IMPORT_PATH:+':'}$QML2_IMPORT_PATH + '') + ]) buildInputs + ) + )); meta = with lib; { inherit (qtbase.meta) platforms; diff --git a/pkgs/applications/audio/miniaudicle/default.nix b/pkgs/applications/audio/miniaudicle/default.nix index 8e31ba3324ec..117d5b3d3450 100644 --- a/pkgs/applications/audio/miniaudicle/default.nix +++ b/pkgs/applications/audio/miniaudicle/default.nix @@ -43,14 +43,13 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - alsa-lib - libsndfile - qt6Packages.qscintilla - ] - ++ lib.optional (audioBackend == "pulse") libpulseaudio - ++ lib.optional (audioBackend == "jack") libjack2; + buildInputs = [ + alsa-lib + libsndfile + qt6Packages.qscintilla + ] + ++ lib.optional (audioBackend == "pulse") libpulseaudio + ++ lib.optional (audioBackend == "jack") libjack2; buildFlags = [ "linux-${audioBackend}" ]; diff --git a/pkgs/applications/audio/mmlgui/default.nix b/pkgs/applications/audio/mmlgui/default.nix index 24665b7ddc55..9b46307cd780 100644 --- a/pkgs/applications/audio/mmlgui/default.nix +++ b/pkgs/applications/audio/mmlgui/default.nix @@ -50,16 +50,15 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - glfw - libvgm - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXau - libXdmcp - ]; + buildInputs = [ + glfw + libvgm + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXau + libXdmcp + ]; checkInputs = [ cppunit diff --git a/pkgs/applications/audio/mopidy/youtube.nix b/pkgs/applications/audio/mopidy/youtube.nix index d10ac97b1975..a59a25aabe29 100644 --- a/pkgs/applications/audio/mopidy/youtube.nix +++ b/pkgs/applications/audio/mopidy/youtube.nix @@ -41,7 +41,8 @@ pythonPackages.buildPythonApplication rec { pythonPackages.requests pythonPackages.ytmusicapi pythonPackages.yt-dlp - ] ++ extraPkgs pkgs; # should we remove this? If we do, don't forget to also change the docs! + ] + ++ extraPkgs pkgs; # should we remove this? If we do, don't forget to also change the docs! nativeCheckInputs = with pythonPackages; [ vcrpy diff --git a/pkgs/applications/audio/mpg123/default.nix b/pkgs/applications/audio/mpg123/default.nix index f92c58b93c71..f5599a5de784 100644 --- a/pkgs/applications/audio/mpg123/default.nix +++ b/pkgs/applications/audio/mpg123/default.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { "out" "dev" "man" - ] ++ lib.optional withConplay "conplay"; + ] + ++ lib.optional withConplay "conplay"; nativeBuildInputs = lib.optionals (!libOnly) ( lib.optionals withConplay [ makeWrapper ] ++ lib.optionals (withPulse || withJack) [ pkg-config ] diff --git a/pkgs/applications/audio/munt/mt32emu-qt.nix b/pkgs/applications/audio/munt/mt32emu-qt.nix index 0a75f0620383..eb6e9aabd7d4 100644 --- a/pkgs/applications/audio/munt/mt32emu-qt.nix +++ b/pkgs/applications/audio/munt/mt32emu-qt.nix @@ -38,18 +38,17 @@ mkDerivation rec { pkg-config ]; - buildInputs = - [ - libmt32emu - portaudio - qtbase - qtmultimedia - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libpulseaudio - ] - ++ lib.optional withJack libjack2; + buildInputs = [ + libmt32emu + portaudio + qtbase + qtmultimedia + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libpulseaudio + ] + ++ lib.optional withJack libjack2; dontFixCmake = true; diff --git a/pkgs/applications/audio/musescore/default.nix b/pkgs/applications/audio/musescore/default.nix index d5937376d1d7..d0dc6f529558 100644 --- a/pkgs/applications/audio/musescore/default.nix +++ b/pkgs/applications/audio/musescore/default.nix @@ -65,21 +65,20 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "MUSE_ENABLE_UNIT_TESTS" finalAttrs.finalPackage.doCheck) ]; - qtWrapperArgs = - [ - # MuseScore JACK backend loads libjack at runtime. - "--prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : ${ - lib.makeLibraryPath [ libjack2 ] - }" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - "--set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # There are some issues with using the wayland backend, see: - # https://musescore.org/en/node/321936 - "--set-default QT_QPA_PLATFORM xcb" - ]; + qtWrapperArgs = [ + # MuseScore JACK backend loads libjack at runtime. + "--prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ libjack2 ] + }" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + "--set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # There are some issues with using the wayland backend, see: + # https://musescore.org/en/node/321936 + "--set-default QT_QPA_PLATFORM xcb" + ]; preFixup = '' qtWrapperArgs+=("''${gappsWrapperArgs[@]}") @@ -87,46 +86,44 @@ stdenv.mkDerivation (finalAttrs: { dontWrapGApps = true; - nativeBuildInputs = - [ - wrapQtAppsHook - cmake - qttools - pkg-config - ninja - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Since https://github.com/musescore/MuseScore/pull/13847/commits/685ac998 - # GTK3 is needed for file dialogs. Fixes crash with No GSettings schemas error. - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + wrapQtAppsHook + cmake + qttools + pkg-config + ninja + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # Since https://github.com/musescore/MuseScore/pull/13847/commits/685ac998 + # GTK3 is needed for file dialogs. Fixes crash with No GSettings schemas error. + wrapGAppsHook3 + ]; - buildInputs = - [ - libjack2 - freetype - lame - libogg - libpulseaudio - libsndfile - libvorbis - portaudio - portmidi - flac - libopusenc - libopus - tinyxml-2 - qtbase - qtdeclarative - qt5compat - qtsvg - qtscxml - qtnetworkauth - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - qtwayland - ]; + buildInputs = [ + libjack2 + freetype + lame + libogg + libpulseaudio + libsndfile + libvorbis + portaudio + portmidi + flac + libopusenc + libopus + tinyxml-2 + qtbase + qtdeclarative + qt5compat + qtsvg + qtscxml + qtnetworkauth + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + qtwayland + ]; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p "$out/Applications" diff --git a/pkgs/applications/audio/noson/default.nix b/pkgs/applications/audio/noson/default.nix index f99fa36c3b37..5524638023c3 100644 --- a/pkgs/applications/audio/noson/default.nix +++ b/pkgs/applications/audio/noson/default.nix @@ -30,17 +30,16 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - flac - libpulseaudio - qtbase - qtgraphicaleffects - qtquickcontrols2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ]; + buildInputs = [ + flac + libpulseaudio + qtbase + qtgraphicaleffects + qtquickcontrols2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ]; # wrapQtAppsHook doesn't automatically find noson-gui dontWrapQtApps = true; diff --git a/pkgs/applications/audio/open-music-kontrollers/generic.nix b/pkgs/applications/audio/open-music-kontrollers/generic.nix index 9d07272720ac..4d59d63857c0 100644 --- a/pkgs/applications/audio/open-music-kontrollers/generic.nix +++ b/pkgs/applications/audio/open-music-kontrollers/generic.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation { libXext glew lv2lint - ] ++ additionalBuildInputs; + ] + ++ additionalBuildInputs; meta = with lib; { broken = stdenv.hostPlatform.isDarwin; diff --git a/pkgs/applications/audio/pithos/default.nix b/pkgs/applications/audio/pithos/default.nix index c0d130b421ca..ebe2d92b38e5 100644 --- a/pkgs/applications/audio/pithos/default.nix +++ b/pkgs/applications/audio/pithos/default.nix @@ -44,27 +44,27 @@ pythonPackages.buildPythonApplication rec { gobject-introspection ]; - buildInputs = - [ - gtk3 - libnotify - libsecret - glib - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gst-plugins-bad - ]); + buildInputs = [ + gtk3 + libnotify + libsecret + glib + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gst-plugins-bad + ]); - propagatedBuildInputs = - [ adwaita-icon-theme ] - ++ (with pythonPackages; [ - pygobject3 - pylast - ]); + propagatedBuildInputs = [ + adwaita-icon-theme + ] + ++ (with pythonPackages; [ + pygobject3 + pylast + ]); meta = with lib; { broken = stdenv.hostPlatform.isDarwin; diff --git a/pkgs/applications/audio/puredata/default.nix b/pkgs/applications/audio/puredata/default.nix index 432f859c5bec..ed397e2a936f 100644 --- a/pkgs/applications/audio/puredata/default.nix +++ b/pkgs/applications/audio/puredata/default.nix @@ -33,35 +33,33 @@ stdenv.mkDerivation rec { makeWrapper ]; - buildInputs = - [ - fftw - libjack2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - portmidi - portaudio - ]; + buildInputs = [ + fftw + libjack2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + portmidi + portaudio + ]; - configureFlags = - [ - "--enable-fftw" - "--enable-jack" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-alsa" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--enable-portaudio" - "--enable-portmidi" - "--without-local-portaudio" - "--without-local-portmidi" - "--disable-jack-framework" - "--with-wish=${tk}/bin/wish8.6" - ]; + configureFlags = [ + "--enable-fftw" + "--enable-jack" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--enable-alsa" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--enable-portaudio" + "--enable-portmidi" + "--without-local-portaudio" + "--without-local-portmidi" + "--disable-jack-framework" + "--with-wish=${tk}/bin/wish8.6" + ]; postInstall = '' wrapProgram $out/bin/pd --prefix PATH : ${lib.makeBinPath [ tk ]} diff --git a/pkgs/applications/audio/quodlibet/default.nix b/pkgs/applications/audio/quodlibet/default.nix index a92b64cb87c8..c92bb85a6cbd 100644 --- a/pkgs/applications/audio/quodlibet/default.nix +++ b/pkgs/applications/audio/quodlibet/default.nix @@ -72,45 +72,43 @@ python3.pkgs.buildPythonApplication rec { --replace-fail 'quodlibet = "quodlibet.main:main"' "" ''; - nativeBuildInputs = - [ - gettext - gobject-introspection - wrapGAppsHook3 - ] - ++ (with python3.pkgs; [ - sphinx-rtd-theme - sphinxHook - ]); + nativeBuildInputs = [ + gettext + gobject-introspection + wrapGAppsHook3 + ] + ++ (with python3.pkgs; [ + sphinx-rtd-theme + sphinxHook + ]); - buildInputs = + buildInputs = [ + adwaita-icon-theme + gdk-pixbuf + glib + glib-networking + gtk3 + gtksourceview + kakasi + keybinder3 + libappindicator-gtk3 + libmodplug + libsoup_3 + ] + ++ lib.optionals (withXineBackend) [ xine-lib ] + ++ lib.optionals (withGstreamerBackend) ( + with gst_all_1; [ - adwaita-icon-theme - gdk-pixbuf - glib - glib-networking - gtk3 - gtksourceview - kakasi - keybinder3 - libappindicator-gtk3 - libmodplug - libsoup_3 + gst-plugins-base + gstreamer ] - ++ lib.optionals (withXineBackend) [ xine-lib ] - ++ lib.optionals (withGstreamerBackend) ( - with gst_all_1; - [ - gst-plugins-base - gstreamer - ] - ++ lib.optionals (withGstPlugins) [ - gst-libav - gst-plugins-bad - gst-plugins-good - gst-plugins-ugly - ] - ); + ++ lib.optionals (withGstPlugins) [ + gst-libav + gst-plugins-bad + gst-plugins-good + gst-plugins-ugly + ] + ); dependencies = with python3.pkgs; @@ -128,34 +126,32 @@ python3.pkgs.buildPythonApplication rec { ++ lib.optionals withSoco [ soco ] ++ lib.optionals (pythonAtLeast "3.13") [ standard-telnetlib ]; - nativeCheckInputs = - [ - dbus - gdk-pixbuf - glibcLocales - hicolor-icon-theme - xvfb-run - writableTmpDirAsHomeHook - ] - ++ (with python3.pkgs; [ - polib - pytest - pytest-xdist - ]); + nativeCheckInputs = [ + dbus + gdk-pixbuf + glibcLocales + hicolor-icon-theme + xvfb-run + writableTmpDirAsHomeHook + ] + ++ (with python3.pkgs; [ + polib + pytest + pytest-xdist + ]); - pytestFlags = - [ - # missing translation strings in potfiles - "--deselect=tests/test_po.py::TPOTFILESIN::test_missing" - # require networking - "--deselect=tests/plugin/test_covers.py::test_live_cover_download" - "--deselect=tests/test_browsers_iradio.py::TInternetRadio::test_click_add_station" - # upstream does actually not enforce source code linting - "--ignore=tests/quality" - ] - ++ lib.optionals (withXineBackend || !withGstPlugins) [ - "--ignore=tests/plugin/test_replaygain.py" - ]; + pytestFlags = [ + # missing translation strings in potfiles + "--deselect=tests/test_po.py::TPOTFILESIN::test_missing" + # require networking + "--deselect=tests/plugin/test_covers.py::test_live_cover_download" + "--deselect=tests/test_browsers_iradio.py::TInternetRadio::test_click_add_station" + # upstream does actually not enforce source code linting + "--ignore=tests/quality" + ] + ++ lib.optionals (withXineBackend || !withGstPlugins) [ + "--ignore=tests/plugin/test_replaygain.py" + ]; env.LC_ALL = "en_US.UTF-8"; diff --git a/pkgs/applications/audio/radiotray-ng/default.nix b/pkgs/applications/audio/radiotray-ng/default.nix index 918e2a6abcf8..393d3d5e0722 100644 --- a/pkgs/applications/audio/radiotray-ng/default.nix +++ b/pkgs/applications/audio/radiotray-ng/default.nix @@ -66,25 +66,24 @@ stdenv.mkDerivation rec { makeWrapper ]; - buildInputs = - [ - curl - boost - jsoncpp - libbsd - glibmm - hicolor-icon-theme - gsettings-desktop-schemas - libappindicator-gtk3 - libnotify - libxdg_basedir - lsb-release - wxGTK - # for https gstreamer / libsoup - glib-networking - ] - ++ gstInputs - ++ pythonInputs; + buildInputs = [ + curl + boost + jsoncpp + libbsd + glibmm + hicolor-icon-theme + gsettings-desktop-schemas + libappindicator-gtk3 + libnotify + libxdg_basedir + lsb-release + wxGTK + # for https gstreamer / libsoup + glib-networking + ] + ++ gstInputs + ++ pythonInputs; patches = [ ./no-dl-googletest.patch diff --git a/pkgs/applications/audio/reaper/default.nix b/pkgs/applications/audio/reaper/default.nix index 727ac9c201f8..1e02c972d2e4 100644 --- a/pkgs/applications/audio/reaper/default.nix +++ b/pkgs/applications/audio/reaper/default.nix @@ -53,29 +53,27 @@ stdenv.mkDerivation rec { .${stdenv.hostPlatform.system}; }; - nativeBuildInputs = - [ - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - which - autoPatchelfHook - xdg-utils # Required for desktop integration - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - undmg - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + which + autoPatchelfHook + xdg-utils # Required for desktop integration + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + undmg + ]; sourceRoot = lib.optionalString stdenv.hostPlatform.isDarwin "Reaper.app"; - buildInputs = - [ - (lib.getLib stdenv.cc.cc) # reaper and libSwell need libstdc++.so.6 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gtk3 - alsa-lib - ]; + buildInputs = [ + (lib.getLib stdenv.cc.cc) # reaper and libSwell need libstdc++.so.6 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gtk3 + alsa-lib + ]; runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux [ diff --git a/pkgs/applications/audio/sayonara/default.nix b/pkgs/applications/audio/sayonara/default.nix index 8426cc20e2e1..bd9331d6bc7e 100644 --- a/pkgs/applications/audio/sayonara/default.nix +++ b/pkgs/applications/audio/sayonara/default.nix @@ -47,22 +47,21 @@ mkDerivation rec { qttools ]; - buildInputs = - [ - libpulseaudio - pcre - qtbase - taglib - zlib - py - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - ]); + buildInputs = [ + libpulseaudio + pcre + qtbase + taglib + zlib + py + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + ]); # we carry the patched taglib 1.11.1 that doesn't break ogg but sayonara just # checks for the version diff --git a/pkgs/applications/audio/snapcast/default.nix b/pkgs/applications/audio/snapcast/default.nix index 205f8cd80749..9ba36c4b6b5a 100644 --- a/pkgs/applications/audio/snapcast/default.nix +++ b/pkgs/applications/audio/snapcast/default.nix @@ -38,22 +38,21 @@ stdenv.mkDerivation rec { ]; # snapcast also supports building against tremor but as we have libogg, that's # not needed - buildInputs = - [ - boost - asio - avahi - flac - libogg - libvorbis - libopus - aixlog - popl - soxr - openssl - ] - ++ lib.optional pulseaudioSupport libpulseaudio - ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib; + buildInputs = [ + boost + asio + avahi + flac + libogg + libvorbis + libopus + aixlog + popl + soxr + openssl + ] + ++ lib.optional pulseaudioSupport libpulseaudio + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib; TARGET = lib.optionalString stdenv.hostPlatform.isDarwin "MACOS"; diff --git a/pkgs/applications/audio/sonic-pi/default.nix b/pkgs/applications/audio/sonic-pi/default.nix index 124f3a264389..3b06912fd825 100644 --- a/pkgs/applications/audio/sonic-pi/default.nix +++ b/pkgs/applications/audio/sonic-pi/default.nix @@ -78,33 +78,32 @@ stdenv.mkDerivation rec { beamPackages.hex ]; - buildInputs = - [ - qtbase - qtsvg - qttools - qtwayland - qwt - qscintilla - kissfftFloat - catch2_3 - crossguid - reproc - platform-folders - ruby - alsa-lib - rtmidi - boost - aubio - ] - ++ lib.optionals withTauWidget [ - qtwebengine - ] - ++ lib.optionals withImGui [ - gl3w - SDL2 - fmt - ]; + buildInputs = [ + qtbase + qtsvg + qttools + qtwayland + qwt + qscintilla + kissfftFloat + catch2_3 + crossguid + reproc + platform-folders + ruby + alsa-lib + rtmidi + boost + aubio + ] + ++ lib.optionals withTauWidget [ + qtwebengine + ] + ++ lib.optionals withImGui [ + gl3w + SDL2 + fmt + ]; nativeCheckInputs = [ parallel diff --git a/pkgs/applications/audio/vorbis-tools/default.nix b/pkgs/applications/audio/vorbis-tools/default.nix index 2632fafb6751..e6a31ab4af21 100644 --- a/pkgs/applications/audio/vorbis-tools/default.nix +++ b/pkgs/applications/audio/vorbis-tools/default.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { curl speex flac - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; meta = with lib; { description = "Extra tools for Ogg-Vorbis audio codec"; diff --git a/pkgs/applications/audio/youtube-music/default.nix b/pkgs/applications/audio/youtube-music/default.nix index 05834c063e22..ba02694aa40f 100644 --- a/pkgs/applications/audio/youtube-music/default.nix +++ b/pkgs/applications/audio/youtube-music/default.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation (finalAttrs: { python3 nodejs pnpm.configHook - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ copyDesktopItems ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ copyDesktopItems ]; ELECTRON_SKIP_BINARY_DOWNLOAD = 1; @@ -50,30 +51,29 @@ stdenv.mkDerivation (finalAttrs: { -c.electronVersion=${electron.version} ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/{Applications,bin} - mv pack/mac*/YouTube\ Music.app $out/Applications - makeWrapper $out/Applications/YouTube\ Music.app/Contents/MacOS/YouTube\ Music $out/bin/youtube-music - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - mkdir -p "$out/share/lib/youtube-music" - cp -r pack/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/youtube-music" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/{Applications,bin} + mv pack/mac*/YouTube\ Music.app $out/Applications + makeWrapper $out/Applications/YouTube\ Music.app/Contents/MacOS/YouTube\ Music $out/bin/youtube-music + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + mkdir -p "$out/share/lib/youtube-music" + cp -r pack/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/youtube-music" - pushd assets/generated/icons/png - for file in *.png; do - install -Dm0644 $file $out/share/icons/hicolor/''${file//.png}/apps/youtube-music.png - done - popd - '' - + '' + pushd assets/generated/icons/png + for file in *.png; do + install -Dm0644 $file $out/share/icons/hicolor/''${file//.png}/apps/youtube-music.png + done + popd + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; postFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' makeWrapper ${electron}/bin/electron $out/bin/youtube-music \ diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix index f6ac1294fc2a..fafaee34b67a 100644 --- a/pkgs/applications/audio/zynaddsubfx/default.nix +++ b/pkgs/applications/audio/zynaddsubfx/default.nix @@ -101,47 +101,45 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - fftw - liblo - minixml - zlib - ] - ++ lib.optionals alsaSupport [ alsa-lib ] - ++ lib.optionals dssiSupport [ - dssi - ladspaH - ] - ++ lib.optionals jackSupport [ libjack2 ] - ++ lib.optionals lashSupport [ lash ] - ++ lib.optionals portaudioSupport [ portaudio ] - ++ lib.optionals sndioSupport [ sndio ] - ++ lib.optionals (guiModule == "fltk") [ - fltk - libjpeg - libXpm - ] - ++ lib.optionals (guiModule == "ntk") [ - ntk - cairo - libXpm - ] - ++ lib.optionals (guiModule == "zest") [ - libGL - libX11 - ]; + buildInputs = [ + fftw + liblo + minixml + zlib + ] + ++ lib.optionals alsaSupport [ alsa-lib ] + ++ lib.optionals dssiSupport [ + dssi + ladspaH + ] + ++ lib.optionals jackSupport [ libjack2 ] + ++ lib.optionals lashSupport [ lash ] + ++ lib.optionals portaudioSupport [ portaudio ] + ++ lib.optionals sndioSupport [ sndio ] + ++ lib.optionals (guiModule == "fltk") [ + fltk + libjpeg + libXpm + ] + ++ lib.optionals (guiModule == "ntk") [ + ntk + cairo + libXpm + ] + ++ lib.optionals (guiModule == "zest") [ + libGL + libX11 + ]; - cmakeFlags = - [ - "-DGuiModule=${guiModule}" - "-DZYN_DATADIR=${placeholder "out"}/share/zynaddsubfx" - ] - # OSS library is included in glibc. - # Must explicitly disable if support is not wanted. - ++ lib.optional (!ossSupport) "-DOssEnable=OFF" - # Find FLTK without requiring an OpenGL library in buildInputs - ++ lib.optional (guiModule == "fltk") "-DFLTK_SKIP_OPENGL=ON"; + cmakeFlags = [ + "-DGuiModule=${guiModule}" + "-DZYN_DATADIR=${placeholder "out"}/share/zynaddsubfx" + ] + # OSS library is included in glibc. + # Must explicitly disable if support is not wanted. + ++ lib.optional (!ossSupport) "-DOssEnable=OFF" + # Find FLTK without requiring an OpenGL library in buildInputs + ++ lib.optional (guiModule == "fltk") "-DFLTK_SKIP_OPENGL=ON"; CXXFLAGS = [ # GCC 13: error: 'uint8_t' does not name a type diff --git a/pkgs/applications/backup/timeshift/default.nix b/pkgs/applications/backup/timeshift/default.nix index 9c6de88703b3..c398fe58d7a5 100644 --- a/pkgs/applications/backup/timeshift/default.nix +++ b/pkgs/applications/backup/timeshift/default.nix @@ -26,11 +26,9 @@ in (oldAttrs: { meta = oldAttrs.meta // { description = oldAttrs.meta.description; - longDescription = - oldAttrs.meta.longDescription - + '' - This package comes with runtime dependencies of command utilities provided by rsync, coreutils, mount, umount, psmisc, cron and btrfs. - If you want to use the commands provided by the system, use timeshift-minimal instead. - ''; + longDescription = oldAttrs.meta.longDescription + '' + This package comes with runtime dependencies of command utilities provided by rsync, coreutils, mount, umount, psmisc, cron and btrfs. + If you want to use the commands provided by the system, use timeshift-minimal instead. + ''; }; }) diff --git a/pkgs/applications/backup/timeshift/minimal.nix b/pkgs/applications/backup/timeshift/minimal.nix index 113200c30e73..e30c143419b0 100644 --- a/pkgs/applications/backup/timeshift/minimal.nix +++ b/pkgs/applications/backup/timeshift/minimal.nix @@ -8,11 +8,9 @@ in (timeshift-wrapper timeshift-unwrapped [ ]).overrideAttrs (oldAttrs: { meta = oldAttrs.meta // { description = oldAttrs.meta.description + " (without runtime dependencies)"; - longDescription = - oldAttrs.meta.longDescription - + '' - This package is a wrapped version of timeshift-unwrapped - without runtime dependencies of command utilities. - ''; + longDescription = oldAttrs.meta.longDescription + '' + This package is a wrapped version of timeshift-unwrapped + without runtime dependencies of command utilities. + ''; }; }) diff --git a/pkgs/applications/blockchains/bitcoin-knots/default.nix b/pkgs/applications/blockchains/bitcoin-knots/default.nix index c7e2332eb37f..53f57d737d2e 100644 --- a/pkgs/applications/blockchains/bitcoin-knots/default.nix +++ b/pkgs/applications/blockchains/bitcoin-knots/default.nix @@ -32,60 +32,58 @@ stdenv.mkDerivation rec { hash = "sha256-DKO3+43Tn/BTKQVrLrCkeMtzm8SfbaJD8rPlb6lDA8A="; }; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ] - ++ lib.optionals withGui [ wrapQtAppsHook ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ] + ++ lib.optionals withGui [ wrapQtAppsHook ]; - buildInputs = - [ - boost - libevent - miniupnpc - zeromq - zlib - ] - ++ lib.optionals withWallet [ sqlite ] - ++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ] - ++ lib.optionals withGui [ - qrencode - qtbase - qttools - ]; + buildInputs = [ + boost + libevent + miniupnpc + zeromq + zlib + ] + ++ lib.optionals withWallet [ sqlite ] + ++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ] + ++ lib.optionals withGui [ + qrencode + qtbase + qttools + ]; - configureFlags = - [ - "--with-boost-libdir=${boost.out}/lib" - "--disable-bench" - ] - ++ lib.optionals (!doCheck) [ - "--disable-tests" - "--disable-gui-tests" - ] - ++ lib.optionals (!withWallet) [ - "--disable-wallet" - ] - ++ lib.optionals withGui [ - "--with-gui=qt5" - "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" - ]; + configureFlags = [ + "--with-boost-libdir=${boost.out}/lib" + "--disable-bench" + ] + ++ lib.optionals (!doCheck) [ + "--disable-tests" + "--disable-gui-tests" + ] + ++ lib.optionals (!withWallet) [ + "--disable-wallet" + ] + ++ lib.optionals withGui [ + "--with-gui=qt5" + "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" + ]; nativeCheckInputs = [ python3 ]; doCheck = true; - checkFlags = - [ "LC_ALL=en_US.UTF-8" ] - # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI. - # See also https://github.com/NixOS/nixpkgs/issues/24256 - ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; + checkFlags = [ + "LC_ALL=en_US.UTF-8" + ] + # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI. + # See also https://github.com/NixOS/nixpkgs/issues/24256 + ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; enableParallelBuilding = true; diff --git a/pkgs/applications/blockchains/bitcoin/default.nix b/pkgs/applications/blockchains/bitcoin/default.nix index 818feda76efa..809f8665050f 100644 --- a/pkgs/applications/blockchains/bitcoin/default.nix +++ b/pkgs/applications/blockchains/bitcoin/default.nix @@ -44,74 +44,70 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "882c782c34a3bf2eacd1fae5cdc58b35b869883512f197f7d6dc8f195decfdaa"; }; - nativeBuildInputs = - [ - cmake - pkg-config - installShellFiles - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ] - ++ lib.optionals withGui [ wrapQtAppsHook ]; + nativeBuildInputs = [ + cmake + pkg-config + installShellFiles + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ] + ++ lib.optionals withGui [ wrapQtAppsHook ]; - buildInputs = - [ - boost - libevent - zeromq - zlib - ] - ++ lib.optionals enableTracing [ libsystemtap ] - ++ lib.optionals withWallet [ sqlite ] - # building with db48 (for legacy descriptor wallet support) is broken on Darwin - ++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ] - ++ lib.optionals withGui [ - qrencode - qtbase - qttools - ]; + buildInputs = [ + boost + libevent + zeromq + zlib + ] + ++ lib.optionals enableTracing [ libsystemtap ] + ++ lib.optionals withWallet [ sqlite ] + # building with db48 (for legacy descriptor wallet support) is broken on Darwin + ++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ] + ++ lib.optionals withGui [ + qrencode + qtbase + qttools + ]; - postInstall = - '' - cd .. - installShellCompletion --bash contrib/completions/bash/bitcoin-cli.bash - installShellCompletion --bash contrib/completions/bash/bitcoind.bash - installShellCompletion --bash contrib/completions/bash/bitcoin-tx.bash + postInstall = '' + cd .. + installShellCompletion --bash contrib/completions/bash/bitcoin-cli.bash + installShellCompletion --bash contrib/completions/bash/bitcoind.bash + installShellCompletion --bash contrib/completions/bash/bitcoin-tx.bash - installShellCompletion --fish contrib/completions/fish/bitcoin-cli.fish - installShellCompletion --fish contrib/completions/fish/bitcoind.fish - installShellCompletion --fish contrib/completions/fish/bitcoin-tx.fish - installShellCompletion --fish contrib/completions/fish/bitcoin-util.fish - installShellCompletion --fish contrib/completions/fish/bitcoin-wallet.fish - '' - + lib.optionalString withGui '' - installShellCompletion --fish contrib/completions/fish/bitcoin-qt.fish + installShellCompletion --fish contrib/completions/fish/bitcoin-cli.fish + installShellCompletion --fish contrib/completions/fish/bitcoind.fish + installShellCompletion --fish contrib/completions/fish/bitcoin-tx.fish + installShellCompletion --fish contrib/completions/fish/bitcoin-util.fish + installShellCompletion --fish contrib/completions/fish/bitcoin-wallet.fish + '' + + lib.optionalString withGui '' + installShellCompletion --fish contrib/completions/fish/bitcoin-qt.fish - install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop - substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin" - install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png - ''; + install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop + substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin" + install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png + ''; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_BENCH" false) - (lib.cmakeBool "WITH_ZMQ" true) - # building with db48 (for legacy wallet support) is broken on Darwin - (lib.cmakeBool "WITH_BDB" (withWallet && !stdenv.hostPlatform.isDarwin)) - (lib.cmakeBool "WITH_USDT" enableTracing) - ] - ++ lib.optionals (!finalAttrs.doCheck) [ - (lib.cmakeBool "BUILD_TESTS" false) - (lib.cmakeBool "BUILD_FUZZ_BINARY" false) - (lib.cmakeBool "BUILD_GUI_TESTS" false) - ] - ++ lib.optionals (!withWallet) [ - (lib.cmakeBool "ENABLE_WALLET" false) - ] - ++ lib.optionals withGui [ - (lib.cmakeBool "BUILD_GUI" true) - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_BENCH" false) + (lib.cmakeBool "WITH_ZMQ" true) + # building with db48 (for legacy wallet support) is broken on Darwin + (lib.cmakeBool "WITH_BDB" (withWallet && !stdenv.hostPlatform.isDarwin)) + (lib.cmakeBool "WITH_USDT" enableTracing) + ] + ++ lib.optionals (!finalAttrs.doCheck) [ + (lib.cmakeBool "BUILD_TESTS" false) + (lib.cmakeBool "BUILD_FUZZ_BINARY" false) + (lib.cmakeBool "BUILD_GUI_TESTS" false) + ] + ++ lib.optionals (!withWallet) [ + (lib.cmakeBool "ENABLE_WALLET" false) + ] + ++ lib.optionals withGui [ + (lib.cmakeBool "BUILD_GUI" true) + ]; NIX_LDFLAGS = lib.optionals ( stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic @@ -121,11 +117,12 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; - checkFlags = - [ "LC_ALL=en_US.UTF-8" ] - # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI. - # See also https://github.com/NixOS/nixpkgs/issues/24256 - ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; + checkFlags = [ + "LC_ALL=en_US.UTF-8" + ] + # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI. + # See also https://github.com/NixOS/nixpkgs/issues/24256 + ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; enableParallelBuilding = true; diff --git a/pkgs/applications/blockchains/digibyte/default.nix b/pkgs/applications/blockchains/digibyte/default.nix index bb254dc0c32f..fa5dad72eb14 100644 --- a/pkgs/applications/blockchains/digibyte/default.nix +++ b/pkgs/applications/blockchains/digibyte/default.nix @@ -30,40 +30,37 @@ stdenv.mkDerivation rec { sha256 = "zPwnC2qd28fA1saG4nysPlKU1nnXhfuSG3DpCY6T+kM="; }; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - hexdump - ] - ++ lib.optionals withGui [ - wrapQtAppsHook - ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + hexdump + ] + ++ lib.optionals withGui [ + wrapQtAppsHook + ]; - buildInputs = - [ - openssl - boost - libevent - db4 - zeromq - ] - ++ lib.optionals withGui [ - qtbase - qttools - protobuf - ]; + buildInputs = [ + openssl + boost + libevent + db4 + zeromq + ] + ++ lib.optionals withGui [ + qtbase + qttools + protobuf + ]; enableParallelBuilding = true; - configureFlags = - [ - "--with-boost-libdir=${boost.out}/lib" - ] - ++ lib.optionals withGui [ - "--with-gui=qt5" - "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" - ]; + configureFlags = [ + "--with-boost-libdir=${boost.out}/lib" + ] + ++ lib.optionals withGui [ + "--with-gui=qt5" + "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" + ]; meta = with lib; { description = "DigiByte (DGB) is a rapidly growing decentralized, global blockchain"; diff --git a/pkgs/applications/blockchains/elements/default.nix b/pkgs/applications/blockchains/elements/default.nix index b62b8eb53d68..1dbda8ed0797 100644 --- a/pkgs/applications/blockchains/elements/default.nix +++ b/pkgs/applications/blockchains/elements/default.nix @@ -43,52 +43,49 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ] - ++ lib.optionals withGui [ wrapQtAppsHook ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ] + ++ lib.optionals withGui [ wrapQtAppsHook ]; - buildInputs = - [ - boost - libevent - miniupnpc - zeromq - zlib - ] - ++ lib.optionals withWallet [ - db48 - sqlite - ] - ++ lib.optionals withGui [ - qrencode - qtbase - qttools - ]; + buildInputs = [ + boost + libevent + miniupnpc + zeromq + zlib + ] + ++ lib.optionals withWallet [ + db48 + sqlite + ] + ++ lib.optionals withGui [ + qrencode + qtbase + qttools + ]; - configureFlags = - [ - "--with-boost-libdir=${boost.out}/lib" - "--disable-bench" - ] - ++ lib.optionals (!doCheck) [ - "--disable-tests" - "--disable-gui-tests" - ] - ++ lib.optionals (!withWallet) [ - "--disable-wallet" - ] - ++ lib.optionals withGui [ - "--with-gui=qt5" - "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" - ]; + configureFlags = [ + "--with-boost-libdir=${boost.out}/lib" + "--disable-bench" + ] + ++ lib.optionals (!doCheck) [ + "--disable-tests" + "--disable-gui-tests" + ] + ++ lib.optionals (!withWallet) [ + "--disable-wallet" + ] + ++ lib.optionals withGui [ + "--with-gui=qt5" + "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" + ]; # fix "Killed: 9 test/test_bitcoin" # https://github.com/NixOS/nixpkgs/issues/179474 @@ -101,11 +98,12 @@ stdenv.mkDerivation rec { doCheck = true; - checkFlags = - [ "LC_ALL=en_US.UTF-8" ] - # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI. - # See also https://github.com/NixOS/nixpkgs/issues/24256 - ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; + checkFlags = [ + "LC_ALL=en_US.UTF-8" + ] + # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI. + # See also https://github.com/NixOS/nixpkgs/issues/24256 + ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; enableParallelBuilding = true; diff --git a/pkgs/applications/blockchains/groestlcoin/default.nix b/pkgs/applications/blockchains/groestlcoin/default.nix index d0de5fa729b3..b7c3fe5f7044 100644 --- a/pkgs/applications/blockchains/groestlcoin/default.nix +++ b/pkgs/applications/blockchains/groestlcoin/default.nix @@ -43,75 +43,72 @@ stdenv.mkDerivation rec { sha256 = "0kl7nq62362clgzxwwd5c256xnaar4ilxcvbralazxg47zv95r11"; }; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ] - ++ lib.optionals withGui [ wrapQtAppsHook ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ] + ++ lib.optionals withGui [ wrapQtAppsHook ]; - buildInputs = - [ - boost - libevent - miniupnpc - zeromq - zlib - ] - ++ lib.optionals withWallet [ - db53 - sqlite - ] - ++ lib.optionals withGui [ - qrencode - qtbase - qttools - ]; + buildInputs = [ + boost + libevent + miniupnpc + zeromq + zlib + ] + ++ lib.optionals withWallet [ + db53 + sqlite + ] + ++ lib.optionals withGui [ + qrencode + qtbase + qttools + ]; - postInstall = - '' - installShellCompletion --bash contrib/completions/bash/groestlcoin-cli.bash - installShellCompletion --bash contrib/completions/bash/groestlcoind.bash - installShellCompletion --bash contrib/completions/bash/groestlcoin-tx.bash + postInstall = '' + installShellCompletion --bash contrib/completions/bash/groestlcoin-cli.bash + installShellCompletion --bash contrib/completions/bash/groestlcoind.bash + installShellCompletion --bash contrib/completions/bash/groestlcoin-tx.bash - for file in contrib/completions/fish/groestlcoin-*.fish; do - installShellCompletion --fish $file - done - '' - + lib.optionalString withGui '' - installShellCompletion --fish contrib/completions/fish/groestlcoin-qt.fish + for file in contrib/completions/fish/groestlcoin-*.fish; do + installShellCompletion --fish $file + done + '' + + lib.optionalString withGui '' + installShellCompletion --fish contrib/completions/fish/groestlcoin-qt.fish - install -Dm644 ${desktop} $out/share/applications/groestlcoin-qt.desktop - substituteInPlace $out/share/applications/groestlcoin-qt.desktop --replace "Icon=groestlcoin128" "Icon=groestlcoin" - install -Dm644 share/pixmaps/groestlcoin256.png $out/share/pixmaps/groestlcoin.png - ''; + install -Dm644 ${desktop} $out/share/applications/groestlcoin-qt.desktop + substituteInPlace $out/share/applications/groestlcoin-qt.desktop --replace "Icon=groestlcoin128" "Icon=groestlcoin" + install -Dm644 share/pixmaps/groestlcoin256.png $out/share/pixmaps/groestlcoin.png + ''; - configureFlags = - [ - "--with-boost-libdir=${boost.out}/lib" - "--disable-bench" - ] - ++ lib.optionals (!withWallet) [ - "--disable-wallet" - ] - ++ lib.optionals withGui [ - "--with-gui=qt5" - "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" - ]; + configureFlags = [ + "--with-boost-libdir=${boost.out}/lib" + "--disable-bench" + ] + ++ lib.optionals (!withWallet) [ + "--disable-wallet" + ] + ++ lib.optionals withGui [ + "--with-gui=qt5" + "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" + ]; nativeCheckInputs = [ python3 ]; - checkFlags = - [ "LC_ALL=en_US.UTF-8" ] - # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Groestlcoin's GUI. - # See also https://github.com/NixOS/nixpkgs/issues/24256 - ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; + checkFlags = [ + "LC_ALL=en_US.UTF-8" + ] + # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Groestlcoin's GUI. + # See also https://github.com/NixOS/nixpkgs/issues/24256 + ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}"; enableParallelBuilding = true; diff --git a/pkgs/applications/blockchains/vertcoin/default.nix b/pkgs/applications/blockchains/vertcoin/default.nix index 056bad01dfc6..c5abb5aabed0 100644 --- a/pkgs/applications/blockchains/vertcoin/default.nix +++ b/pkgs/applications/blockchains/vertcoin/default.nix @@ -46,41 +46,38 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - hexdump - ] - ++ lib.optionals withGui [ - wrapQtAppsHook - ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + hexdump + ] + ++ lib.optionals withGui [ + wrapQtAppsHook + ]; - buildInputs = - [ - openssl - boost - libevent - db4 - zeromq - gmp - ] - ++ lib.optionals withGui [ - qtbase - qttools - protobuf - ]; + buildInputs = [ + openssl + boost + libevent + db4 + zeromq + gmp + ] + ++ lib.optionals withGui [ + qtbase + qttools + protobuf + ]; enableParallelBuilding = true; - configureFlags = - [ - "--with-boost-libdir=${boost.out}/lib" - ] - ++ lib.optionals withGui [ - "--with-gui=qt5" - "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" - ]; + configureFlags = [ + "--with-boost-libdir=${boost.out}/lib" + ] + ++ lib.optionals withGui [ + "--with-gui=qt5" + "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" + ]; meta = with lib; { description = "Digital currency with mining decentralisation and ASIC resistance as a key focus"; diff --git a/pkgs/applications/display-managers/greetd/qtgreet.nix b/pkgs/applications/display-managers/greetd/qtgreet.nix index dc6d2955ae3e..6a55cd307b1b 100644 --- a/pkgs/applications/display-managers/greetd/qtgreet.nix +++ b/pkgs/applications/display-managers/greetd/qtgreet.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { dfl-utils dfl-applications dfl-login1 - ] ++ lib.optionals mpvSupport [ mpv ]; + ] + ++ lib.optionals mpvSupport [ mpv ]; mesonFlags = [ (lib.mesonOption "dynpath" "${placeholder "out"}/var/lib/qtgreet") diff --git a/pkgs/applications/display-managers/lightdm/default.nix b/pkgs/applications/display-managers/lightdm/default.nix index 32b6ae0e0c2f..f8a03c5ef199 100644 --- a/pkgs/applications/display-managers/lightdm/default.nix +++ b/pkgs/applications/display-managers/lightdm/default.nix @@ -73,7 +73,8 @@ stdenv.mkDerivation rec { libxklavier pam polkit - ] ++ lib.optional withQt5 qtbase; + ] + ++ lib.optional withQt5 qtbase; patches = [ # Adds option to disable writing dmrc files @@ -102,7 +103,8 @@ stdenv.mkDerivation rec { "--sysconfdir=/etc" "--disable-tests" "--disable-dmrc" - ] ++ lib.optional withQt5 "--enable-liblightdm-qt5"; + ] + ++ lib.optional withQt5 "--enable-liblightdm-qt5"; installFlags = [ "sysconfdir=${placeholder "out"}/etc" diff --git a/pkgs/applications/editors/code-browser/default.nix b/pkgs/applications/editors/code-browser/default.nix index 093b5fe3309e..4528c6a33687 100644 --- a/pkgs/applications/editors/code-browser/default.nix +++ b/pkgs/applications/editors/code-browser/default.nix @@ -29,49 +29,46 @@ mkDerivation rec { url = "https://tibleiz.net/download/code-browser-${version}-src.tar.gz"; sha256 = "sha256-beCp4lx4MI1+hVgWp2h3piE/zu51zfwQdB5g7ImgmwY="; }; - postPatch = - '' - substituteInPlace Makefile --replace "LFLAGS=-no-pie" "LFLAGS=-no-pie -L." - patchShebangs . - '' - + lib.optionalString withQt '' - substituteInPlace libs/copper-ui/Makefile --replace "moc -o" "${qtbase.dev}/bin/moc -o" - substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: qt" - '' - + lib.optionalString withGtk2 '' - substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk2" - '' - + lib.optionalString withGtk3 '' - substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk" - ''; - nativeBuildInputs = - [ - copper - python3 - pkg-config - ] - ++ lib.optionals withGtk2 [ gtk2 ] - ++ lib.optionals withGtk3 [ gtk3 ] - ++ lib.optionals withQt [ - qtbase - wrapQtAppsHook - ]; + postPatch = '' + substituteInPlace Makefile --replace "LFLAGS=-no-pie" "LFLAGS=-no-pie -L." + patchShebangs . + '' + + lib.optionalString withQt '' + substituteInPlace libs/copper-ui/Makefile --replace "moc -o" "${qtbase.dev}/bin/moc -o" + substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: qt" + '' + + lib.optionalString withGtk2 '' + substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk2" + '' + + lib.optionalString withGtk3 '' + substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk" + ''; + nativeBuildInputs = [ + copper + python3 + pkg-config + ] + ++ lib.optionals withGtk2 [ gtk2 ] + ++ lib.optionals withGtk3 [ gtk3 ] + ++ lib.optionals withQt [ + qtbase + wrapQtAppsHook + ]; buildInputs = lib.optionals withQt [ qtbase ] ++ lib.optionals withGtk2 [ gtk2 ] ++ lib.optionals withGtk3 [ gtk3 ]; - makeFlags = - [ - "prefix=$(out)" - "COPPER=${copper}/bin/copper-elf64" - "with-local-libs" - ] - ++ lib.optionals withQt [ - "QINC=${qtbase.dev}/include" - "UI=qt" - ] - ++ lib.optionals withGtk2 [ "UI=gtk2" ] - ++ lib.optionals withGtk3 [ "UI=gtk" ]; + makeFlags = [ + "prefix=$(out)" + "COPPER=${copper}/bin/copper-elf64" + "with-local-libs" + ] + ++ lib.optionals withQt [ + "QINC=${qtbase.dev}/include" + "UI=qt" + ] + ++ lib.optionals withGtk2 [ "UI=gtk2" ] + ++ lib.optionals withGtk3 [ "UI=gtk" ]; meta = with lib; { description = "Folding text editor, designed to hierarchically structure any kind of text file and especially source code"; diff --git a/pkgs/applications/editors/cudatext/default.nix b/pkgs/applications/editors/cudatext/default.nix index 6b805dbb0870..4172265c7d13 100644 --- a/pkgs/applications/editors/cudatext/default.nix +++ b/pkgs/applications/editors/cudatext/default.nix @@ -64,20 +64,22 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ lazarus fpc - ] ++ lib.optional (widgetset == "qt5") libsForQt5.wrapQtAppsHook; + ] + ++ lib.optional (widgetset == "qt5") libsForQt5.wrapQtAppsHook; - buildInputs = - [ libX11 ] - ++ lib.optionals (lib.hasPrefix "gtk" widgetset) [ - pango - cairo - glib - atk - gdk-pixbuf - ] - ++ lib.optional (widgetset == "gtk2") gtk2 - ++ lib.optional (widgetset == "gtk3") gtk3 - ++ lib.optional (widgetset == "qt5") libsForQt5.libqtpas; + buildInputs = [ + libX11 + ] + ++ lib.optionals (lib.hasPrefix "gtk" widgetset) [ + pango + cairo + glib + atk + gdk-pixbuf + ] + ++ lib.optional (widgetset == "gtk2") gtk2 + ++ lib.optional (widgetset == "gtk3") gtk3 + ++ lib.optional (widgetset == "qt5") libsForQt5.libqtpas; NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; @@ -106,24 +108,23 @@ stdenv.mkDerivation rec { app/cudatext.lpi ''; - installPhase = - '' - install -Dm755 app/cudatext -t $out/bin + installPhase = '' + install -Dm755 app/cudatext -t $out/bin - install -dm755 $out/share/cudatext - cp -r app/{data,py,settings_default} $out/share/cudatext + install -dm755 $out/share/cudatext + cp -r app/{data,py,settings_default} $out/share/cudatext - install -Dm644 setup/debfiles/cudatext-512.png -t $out/share/pixmaps - install -Dm644 setup/debfiles/cudatext.desktop -t $out/share/applications - '' - + lib.concatMapStringsSep "\n" (lexer: '' - if [ -d "CudaText-lexers/${lexer}" ]; then - install -Dm644 CudaText-lexers/${lexer}/*.{cuda-lexmap,lcf} $out/share/cudatext/data/lexlib - else - echo "${lexer} lexer not found" - exit 1 - fi - '') additionalLexers; + install -Dm644 setup/debfiles/cudatext-512.png -t $out/share/pixmaps + install -Dm644 setup/debfiles/cudatext.desktop -t $out/share/applications + '' + + lib.concatMapStringsSep "\n" (lexer: '' + if [ -d "CudaText-lexers/${lexer}" ]; then + install -Dm644 CudaText-lexers/${lexer}/*.{cuda-lexmap,lcf} $out/share/cudatext/data/lexlib + else + echo "${lexer} lexer not found" + exit 1 + fi + '') additionalLexers; passthru.updateScript = ./update.sh; diff --git a/pkgs/applications/editors/eclipse/build-eclipse.nix b/pkgs/applications/editors/eclipse/build-eclipse.nix index c6a3fa595a63..74b728362170 100644 --- a/pkgs/applications/editors/eclipse/build-eclipse.nix +++ b/pkgs/applications/editors/eclipse/build-eclipse.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation rec { libXtst libsecret zlib - ] ++ lib.optional (webkitgtk_4_1 != null) webkitgtk_4_1; + ] + ++ lib.optional (webkitgtk_4_1 != null) webkitgtk_4_1; buildCommand = '' # Unpack tarball. diff --git a/pkgs/applications/editors/eclipse/plugins.nix b/pkgs/applications/editors/eclipse/plugins.nix index 3ab4107eb206..f662322c4ce6 100644 --- a/pkgs/applications/editors/eclipse/plugins.nix +++ b/pkgs/applications/editors/eclipse/plugins.nix @@ -26,7 +26,8 @@ rec { passthru = { isEclipsePlugin = true; - } // passthru; + } + // passthru; } ); diff --git a/pkgs/applications/editors/emacs/build-support/elpa.nix b/pkgs/applications/editors/emacs/build-support/elpa.nix index 50abadccf9d9..ba4c52e24443 100644 --- a/pkgs/applications/editors/emacs/build-support/elpa.nix +++ b/pkgs/applications/editors/emacs/build-support/elpa.nix @@ -52,7 +52,8 @@ lib.extendMkDerivation { meta = { homepage = args.src.meta.homepage or "https://elpa.gnu.org/packages/${pname}.html"; - } // meta; + } + // meta; }; } diff --git a/pkgs/applications/editors/emacs/build-support/generic.nix b/pkgs/applications/editors/emacs/build-support/generic.nix index b4e96f6490fb..d0124876c6b2 100644 --- a/pkgs/applications/editors/emacs/build-support/generic.nix +++ b/pkgs/applications/editors/emacs/build-support/generic.nix @@ -56,7 +56,8 @@ lib.extendMkDerivation { nativeBuildInputs = [ emacs texinfo - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; propagatedBuildInputs = finalAttrs.packageRequires ++ propagatedBuildInputs; propagatedUserEnvPkgs = finalAttrs.packageRequires ++ propagatedUserEnvPkgs; @@ -65,47 +66,45 @@ lib.extendMkDerivation { inherit turnCompilationWarningToError ignoreCompilationError; - meta = - { - broken = false; - platforms = emacs.meta.platforms; - } - // optionalAttrs ((args.src.meta.homepage or "") != "") { - homepage = args.src.meta.homepage; - } - // meta; + meta = { + broken = false; + platforms = emacs.meta.platforms; + } + // optionalAttrs ((args.src.meta.homepage or "") != "") { + homepage = args.src.meta.homepage; + } + // meta; } // optionalAttrs (emacs.withNativeCompilation or false) { addEmacsNativeLoadPath = args.addEmacsNativeLoadPath or true; - postInstall = - '' - # Besides adding the output directory to the native load path, make sure - # the current package's elisp files are in the load path, otherwise - # (require 'file-b) from file-a.el in the same package will fail. - mkdir -p $out/share/emacs/native-lisp - addEmacsVars "$out" + postInstall = '' + # Besides adding the output directory to the native load path, make sure + # the current package's elisp files are in the load path, otherwise + # (require 'file-b) from file-a.el in the same package will fail. + mkdir -p $out/share/emacs/native-lisp + addEmacsVars "$out" - # package-activate-all is used to activate packages. In other builder - # helpers, package-initialize is used for this purpose because - # package-activate-all is not available before Emacs 27. - find $out/share/emacs -type f -name '*.el' -not -name ".dir-locals.el" -print0 \ - | xargs --verbose -0 -I {} -n 1 -P $NIX_BUILD_CORES sh -c \ - "emacs \ - --batch \ - -f package-activate-all \ - --eval '(setq native-comp-eln-load-path (cdr native-comp-eln-load-path))' \ - --eval '(let ((default-directory \"$out/share/emacs/site-lisp\")) (normal-top-level-add-subdirs-to-load-path))' \ - --eval '(setq large-file-warning-threshold nil)' \ - --eval '(setq byte-compile-error-on-warn ${ - if finalAttrs.turnCompilationWarningToError then "t" else "nil" - })' \ - -f batch-native-compile {} \ - || exit ${if finalAttrs.ignoreCompilationError then "0" else "\\$?"}" - '' - + postInstall; + # package-activate-all is used to activate packages. In other builder + # helpers, package-initialize is used for this purpose because + # package-activate-all is not available before Emacs 27. + find $out/share/emacs -type f -name '*.el' -not -name ".dir-locals.el" -print0 \ + | xargs --verbose -0 -I {} -n 1 -P $NIX_BUILD_CORES sh -c \ + "emacs \ + --batch \ + -f package-activate-all \ + --eval '(setq native-comp-eln-load-path (cdr native-comp-eln-load-path))' \ + --eval '(let ((default-directory \"$out/share/emacs/site-lisp\")) (normal-top-level-add-subdirs-to-load-path))' \ + --eval '(setq large-file-warning-threshold nil)' \ + --eval '(setq byte-compile-error-on-warn ${ + if finalAttrs.turnCompilationWarningToError then "t" else "nil" + })' \ + -f batch-native-compile {} \ + || exit ${if finalAttrs.ignoreCompilationError then "0" else "\\$?"}" + '' + + postInstall; }; } diff --git a/pkgs/applications/editors/emacs/build-support/melpa.nix b/pkgs/applications/editors/emacs/build-support/melpa.nix index 0c77acc9d6b4..e32fa2971070 100644 --- a/pkgs/applications/editors/emacs/build-support/melpa.nix +++ b/pkgs/applications/editors/emacs/build-support/melpa.nix @@ -120,39 +120,37 @@ lib.extendMkDerivation { if unstableVersionInNixFormat then date + "." + time else finalAttrs.version ); - preUnpack = - '' - mkdir -p "$NIX_BUILD_TOP/recipes" - recipeFile="$NIX_BUILD_TOP/recipes/$ename" - if [ -r "$recipe" ]; then - ln -s "$recipe" "$recipeFile" - nixInfoLog "link recipe" - elif [ -n "$recipe" ]; then - printf "%s" "$recipe" > "$recipeFile" - nixInfoLog "write recipe" - else - cat > "$recipeFile" <<'EOF' - (${finalAttrs.ename} :fetcher git :url "" ${ - lib.optionalString (finalAttrs.files != null) ":files ${finalAttrs.files}" - }) - EOF - nixInfoLog "use default recipe" - fi - nixInfoLog "recipe content:" "$(< $recipeFile)" - unset -v recipeFile + preUnpack = '' + mkdir -p "$NIX_BUILD_TOP/recipes" + recipeFile="$NIX_BUILD_TOP/recipes/$ename" + if [ -r "$recipe" ]; then + ln -s "$recipe" "$recipeFile" + nixInfoLog "link recipe" + elif [ -n "$recipe" ]; then + printf "%s" "$recipe" > "$recipeFile" + nixInfoLog "write recipe" + else + cat > "$recipeFile" <<'EOF' + (${finalAttrs.ename} :fetcher git :url "" ${ + lib.optionalString (finalAttrs.files != null) ":files ${finalAttrs.files}" + }) + EOF + nixInfoLog "use default recipe" + fi + nixInfoLog "recipe content:" "$(< $recipeFile)" + unset -v recipeFile - ln -s "$packageBuild" "$NIX_BUILD_TOP/package-build" + ln -s "$packageBuild" "$NIX_BUILD_TOP/package-build" - mkdir -p "$NIX_BUILD_TOP/packages" - '' - + preUnpack; + mkdir -p "$NIX_BUILD_TOP/packages" + '' + + preUnpack; - postUnpack = - '' - mkdir -p "$NIX_BUILD_TOP/working" - ln -s "$NIX_BUILD_TOP/$sourceRoot" "$NIX_BUILD_TOP/working/$ename" - '' - + postUnpack; + postUnpack = '' + mkdir -p "$NIX_BUILD_TOP/working" + ln -s "$NIX_BUILD_TOP/$sourceRoot" "$NIX_BUILD_TOP/working/$ename" + '' + + postUnpack; buildPhase = args.buildPhase or '' @@ -197,7 +195,8 @@ lib.extendMkDerivation { meta = { homepage = args.src.meta.homepage or "https://melpa.org/#/${pname}"; - } // meta; + } + // meta; }; } diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-common-overrides.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-common-overrides.nix index 4cc33a9766a1..333465e93c29 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-common-overrides.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-common-overrides.nix @@ -282,11 +282,9 @@ in xeft = super.xeft.overrideAttrs (old: { dontUnpack = false; buildInputs = old.buildInputs or [ ] ++ [ pkgs.xapian ]; - buildPhase = - old.buildPhase or "" - + '' - $CXX -shared -o xapian-lite${libExt} xapian-lite.cc -lxapian - ''; + buildPhase = old.buildPhase or "" + '' + $CXX -shared -o xapian-lite${libExt} xapian-lite.cc -lxapian + ''; postInstall = old.postInstall or "" + "\n" diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/tree-sitter-langs/default.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/tree-sitter-langs/default.nix index 902e8f1721bf..6ba284a8c73d 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/tree-sitter-langs/default.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/tree-sitter-langs/default.nix @@ -31,12 +31,10 @@ let in melpaStablePackages.tree-sitter-langs.overrideAttrs (old: { - postPatch = - old.postPatch or "" - + '' - substituteInPlace ./tree-sitter-langs-build.el \ - --replace "tree-sitter-langs-grammar-dir tree-sitter-langs--dir" "tree-sitter-langs-grammar-dir \"${grammarDir}/langs\"" - ''; + postPatch = old.postPatch or "" + '' + substituteInPlace ./tree-sitter-langs-build.el \ + --replace "tree-sitter-langs-grammar-dir tree-sitter-langs--dir" "tree-sitter-langs-grammar-dir \"${grammarDir}/langs\"" + ''; postInstall = old.postInstall or "" diff --git a/pkgs/applications/editors/emacs/elisp-packages/melpa-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/melpa-packages.nix index 43567db9e5fc..3fe5a34c27bb 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/melpa-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/melpa-packages.nix @@ -129,12 +129,10 @@ let ac-rtags = ignoreCompilationError (fix-rtags super.ac-rtags); # elisp error age = super.age.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace age.el \ - --replace-fail 'age-program (executable-find "age")' 'age-program "${lib.getExe pkgs.age}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace age.el \ + --replace-fail 'age-program (executable-find "age")' 'age-program "${lib.getExe pkgs.age}"' + ''; }); airline-themes = super.airline-themes.override { @@ -405,21 +403,17 @@ let forge = buildWithGit super.forge; gnuplot = super.gnuplot.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace gnuplot.el \ - --replace-fail 'gnuplot-program "gnuplot"' 'gnuplot-program "${lib.getExe pkgs.gnuplot}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace gnuplot.el \ + --replace-fail 'gnuplot-program "gnuplot"' 'gnuplot-program "${lib.getExe pkgs.gnuplot}"' + ''; }); gnuplot-mode = super.gnuplot-mode.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace gnuplot-mode.el \ - --replace-fail 'gnuplot-program "gnuplot"' 'gnuplot-program "${lib.getExe pkgs.gnuplot}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace gnuplot-mode.el \ + --replace-fail 'gnuplot-program "gnuplot"' 'gnuplot-program "${lib.getExe pkgs.gnuplot}"' + ''; }); magit = buildWithGit super.magit; @@ -492,23 +486,19 @@ let orgit-forge = buildWithGit super.orgit-forge; ormolu = super.ormolu.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace ormolu.el \ - --replace-fail 'ormolu-process-path "ormolu"' 'ormolu-process-path "${lib.getExe pkgs.ormolu}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace ormolu.el \ + --replace-fail 'ormolu-process-path "ormolu"' 'ormolu-process-path "${lib.getExe pkgs.ormolu}"' + ''; }); ox-rss = buildWithGit super.ox-rss; python-isort = super.python-isort.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace python-isort.el \ - --replace '-isort-command "isort"' '-isort-command "${lib.getExe pkgs.isort}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace python-isort.el \ + --replace '-isort-command "isort"' '-isort-command "${lib.getExe pkgs.isort}"' + ''; }); # upstream issue: missing file header @@ -524,12 +514,10 @@ let notmuch = dontConfigure super.notmuch; pikchr-mode = super.pikchr-mode.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace pikchr-mode.el \ - --replace '"pikchr")' '"${lib.getExe pkgs.pikchr}")' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace pikchr-mode.el \ + --replace '"pikchr")' '"${lib.getExe pkgs.pikchr}")' + ''; }); rtags = ignoreCompilationError (dontConfigure (externalSrc super.rtags pkgs.rtags)); # elisp error @@ -538,16 +526,12 @@ let rime = super.rime.overrideAttrs (old: { buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.librime ]; - preBuild = - (old.preBuild or "") - + '' - make lib CC=$CC MODULE_FILE_SUFFIX=${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} - ''; - postInstall = - (old.postInstall or "") - + '' - install -m444 -t $out/share/emacs/site-lisp/elpa/rime-* librime-emacs.* - ''; + preBuild = (old.preBuild or "") + '' + make lib CC=$CC MODULE_FILE_SUFFIX=${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} + ''; + postInstall = (old.postInstall or "") + '' + install -m444 -t $out/share/emacs/site-lisp/elpa/rime-* librime-emacs.* + ''; }); # https://github.com/projectional-haskell/structured-haskell-mode/issues/165 @@ -595,21 +579,17 @@ let }); tokei = super.tokei.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace tokei.el \ - --replace 'tokei-program "tokei"' 'tokei-program "${lib.getExe pkgs.tokei}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace tokei.el \ + --replace 'tokei-program "tokei"' 'tokei-program "${lib.getExe pkgs.tokei}"' + ''; }); treemacs = super.treemacs.overrideAttrs (attrs: { - postPatch = - (attrs.postPatch or "") - + '' - substituteInPlace src/elisp/treemacs-customization.el \ - --replace 'treemacs-python-executable (treemacs--find-python3)' 'treemacs-python-executable "${lib.getExe pkgs.python3}"' - ''; + postPatch = (attrs.postPatch or "") + '' + substituteInPlace src/elisp/treemacs-customization.el \ + --replace 'treemacs-python-executable (treemacs--find-python3)' 'treemacs-python-executable "${lib.getExe pkgs.python3}"' + ''; }); treemacs-magit = super.treemacs-magit.overrideAttrs (attrs: { @@ -618,21 +598,17 @@ let }); typst-mode = super.typst-mode.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace typst-mode.el \ - --replace 'typst-executable-location "typst"' 'typst-executable-location "${lib.getExe pkgs.typst}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace typst-mode.el \ + --replace 'typst-executable-location "typst"' 'typst-executable-location "${lib.getExe pkgs.typst}"' + ''; }); units-mode = super.units-mode.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace units-mode.el \ - --replace-fail 'units-binary-path "units"' 'units-binary-path "${lib.getExe pkgs.units}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace units-mode.el \ + --replace-fail 'units-binary-path "units"' 'units-binary-path "${lib.getExe pkgs.units}"' + ''; }); vdiff-magit = super.vdiff-magit.overrideAttrs (attrs: { @@ -640,12 +616,10 @@ let }); zig-mode = super.zig-mode.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace zig-mode.el \ - --replace-fail 'zig-zig-bin "zig"' 'zig-zig-bin "${lib.getExe pkgs.zig}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace zig-mode.el \ + --replace-fail 'zig-zig-bin "zig"' 'zig-zig-bin "${lib.getExe pkgs.zig}"' + ''; }); zmq = super.zmq.overrideAttrs (old: { @@ -735,12 +709,10 @@ let php-auto-yasnippets = mkHome super.php-auto-yasnippets; racer = super.racer.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace racer.el \ - --replace /usr/local/src/rust/src ${pkgs.rustPlatform.rustcSrc} - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace racer.el \ + --replace /usr/local/src/rust/src ${pkgs.rustPlatform.rustcSrc} + ''; }); spaceline = super.spaceline.override { @@ -789,32 +761,26 @@ let }); wordnut = super.wordnut.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace wordnut.el \ - --replace 'wordnut-cmd "wn"' 'wordnut-cmd "${lib.getExe pkgs.wordnet}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace wordnut.el \ + --replace 'wordnut-cmd "wn"' 'wordnut-cmd "${lib.getExe pkgs.wordnet}"' + ''; }); mozc = super.mozc.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace src/unix/emacs/mozc.el \ - --replace '"mozc_emacs_helper"' '"${pkgs.ibus-engines.mozc}/lib/mozc/mozc_emacs_helper"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace src/unix/emacs/mozc.el \ + --replace '"mozc_emacs_helper"' '"${pkgs.ibus-engines.mozc}/lib/mozc/mozc_emacs_helper"' + ''; }); # Build a helper executable that interacts with the macOS Dictionary.app osx-dictionary = if pkgs.stdenv.hostPlatform.isDarwin then super.osx-dictionary.overrideAttrs (old: { - postBuild = - (old.postBuild or "") - + '' - $CXX -O3 -framework CoreServices -framework Foundation osx-dictionary.m -o osx-dictionary-cli - ''; + postBuild = (old.postBuild or "") + '' + $CXX -O3 -framework CoreServices -framework Foundation osx-dictionary.m -o osx-dictionary-cli + ''; postInstall = (old.postInstall or "") + "\n" @@ -841,11 +807,10 @@ let ac-php-core = super.ac-php-core.overrideAttrs (old: { # empty file causing native-compiler-error-empty-byte - preBuild = - '' - rm --verbose ac-php-comm-tags-data.el - '' - + old.preBuild or ""; + preBuild = '' + rm --verbose ac-php-comm-tags-data.el + '' + + old.preBuild or ""; }); # Optimizer error: too much on the stack @@ -1150,12 +1115,10 @@ let el-secretario-mu4e = addPackageRequires super.el-secretario-mu4e [ self.mu4e ]; elfeed = super.elfeed.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace elfeed-curl.el \ - --replace-fail 'elfeed-curl-program-name "curl"' 'elfeed-curl-program-name "${lib.getExe pkgs.curl}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace elfeed-curl.el \ + --replace-fail 'elfeed-curl-program-name "curl"' 'elfeed-curl-program-name "${lib.getExe pkgs.curl}"' + ''; }); elisp-sandbox = ignoreCompilationError super.elisp-sandbox; # elisp error @@ -1403,14 +1366,12 @@ let jekyll-modes = addPackageRequires super.jekyll-modes [ self.poly-markdown ]; jq-mode = super.jq-mode.overrideAttrs (attrs: { - postPatch = - attrs.postPatch or "" - + '' - substituteInPlace jq-mode.el \ - --replace-fail 'jq-interactive-command "jq"' 'jq-interactive-command "${lib.getExe pkgs.jq}"' - substituteInPlace ob-jq.el \ - --replace-fail 'org-babel-jq-command "jq"' 'org-babel-jq-command "${lib.getExe pkgs.jq}"' - ''; + postPatch = attrs.postPatch or "" + '' + substituteInPlace jq-mode.el \ + --replace-fail 'jq-interactive-command "jq"' 'jq-interactive-command "${lib.getExe pkgs.jq}"' + substituteInPlace ob-jq.el \ + --replace-fail 'org-babel-jq-command "jq"' 'org-babel-jq-command "${lib.getExe pkgs.jq}"' + ''; }); jss = ignoreCompilationError super.jss; # elisp error diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index ac981809ca16..e088d9610b70 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -132,14 +132,13 @@ assert withPgtk -> withGTK3 && !withX; assert withXwidgets -> !noGui && (withGTK3 || withPgtk); let - libGccJitLibraryPaths = - [ - "${lib.getLib libgccjit}/lib/gcc" - "${lib.getLib stdenv.cc.libc}/lib" - ] - ++ lib.optionals (stdenv.cc ? cc.lib.libgcc) [ - "${lib.getLib stdenv.cc.cc.lib.libgcc}/lib" - ]; + libGccJitLibraryPaths = [ + "${lib.getLib libgccjit}/lib/gcc" + "${lib.getLib stdenv.cc.libc}/lib" + ] + ++ lib.optionals (stdenv.cc ? cc.lib.libgcc) [ + "${lib.getLib stdenv.cc.cc.lib.libgcc}/lib" + ]; inherit (if variant == "macport" then llvmPackages_14.stdenv else stdenv) mkDerivation @@ -245,121 +244,119 @@ mkDerivation (finalAttrs: { "" ]; - nativeBuildInputs = - [ - makeWrapper - pkg-config - ] - ++ lib.optionals (variant == "macport") [ - texinfo - ] - ++ lib.optionals srcRepo [ - autoreconfHook - texinfo - ] - ++ lib.optionals (withPgtk || withX && (withGTK3 || withXwidgets)) [ wrapGAppsHook3 ]; + nativeBuildInputs = [ + makeWrapper + pkg-config + ] + ++ lib.optionals (variant == "macport") [ + texinfo + ] + ++ lib.optionals srcRepo [ + autoreconfHook + texinfo + ] + ++ lib.optionals (withPgtk || withX && (withGTK3 || withXwidgets)) [ wrapGAppsHook3 ]; - buildInputs = - [ - gettext - gnutls - (lib.getDev harfbuzz) - ] - ++ lib.optionals withJansson [ - jansson - ] - ++ [ - libxml2 - ncurses - ] - ++ lib.optionals withAcl [ - acl - ] - ++ lib.optionals withAlsaLib [ - alsa-lib - ] - ++ lib.optionals withGpm [ - gpm - ] - ++ lib.optionals withDbus [ - dbus - ] - ++ lib.optionals withSelinux [ - libselinux - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin && withGTK3) [ - gsettings-desktop-schemas - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && withX) [ - libotf - m17n_lib - ] - ++ lib.optionals (withX && withGTK3) [ - gtk3-x11 - ] - ++ lib.optionals (withX && withMotif) [ - motif - ] - ++ lib.optionals withGlibNetworking [ - glib-networking - ] - ++ lib.optionals withNativeCompilation [ - libgccjit - zlib - ] - ++ lib.optionals withImageMagick [ - imagemagick - ] - ++ lib.optionals withPgtk [ - giflib - gtk3 - libXpm - libjpeg - libpng - librsvg - libtiff - ] - ++ lib.optionals withSQLite3 [ - sqlite - ] - ++ lib.optionals withSystemd [ - systemd - ] - ++ lib.optionals withTreeSitter [ - tree-sitter - ] - ++ lib.optionals withWebP [ - libwebp - ] - ++ lib.optionals withX [ - Xaw3d - giflib - libXaw - libXpm - libXrandr - libjpeg - libpng - librsvg - libtiff - ] - ++ lib.optionals withCairo [ - cairo - ] - ++ lib.optionals (withX && !withCairo) [ - libXft - ] - ++ lib.optionals withXinput2 [ - libXi - ] - ++ lib.optionals withXwidgets [ - webkitgtk_4_0 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - sigtool - ] - ++ lib.optionals withNS [ - librsvg - ]; + buildInputs = [ + gettext + gnutls + (lib.getDev harfbuzz) + ] + ++ lib.optionals withJansson [ + jansson + ] + ++ [ + libxml2 + ncurses + ] + ++ lib.optionals withAcl [ + acl + ] + ++ lib.optionals withAlsaLib [ + alsa-lib + ] + ++ lib.optionals withGpm [ + gpm + ] + ++ lib.optionals withDbus [ + dbus + ] + ++ lib.optionals withSelinux [ + libselinux + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin && withGTK3) [ + gsettings-desktop-schemas + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && withX) [ + libotf + m17n_lib + ] + ++ lib.optionals (withX && withGTK3) [ + gtk3-x11 + ] + ++ lib.optionals (withX && withMotif) [ + motif + ] + ++ lib.optionals withGlibNetworking [ + glib-networking + ] + ++ lib.optionals withNativeCompilation [ + libgccjit + zlib + ] + ++ lib.optionals withImageMagick [ + imagemagick + ] + ++ lib.optionals withPgtk [ + giflib + gtk3 + libXpm + libjpeg + libpng + librsvg + libtiff + ] + ++ lib.optionals withSQLite3 [ + sqlite + ] + ++ lib.optionals withSystemd [ + systemd + ] + ++ lib.optionals withTreeSitter [ + tree-sitter + ] + ++ lib.optionals withWebP [ + libwebp + ] + ++ lib.optionals withX [ + Xaw3d + giflib + libXaw + libXpm + libXrandr + libjpeg + libpng + librsvg + libtiff + ] + ++ lib.optionals withCairo [ + cairo + ] + ++ lib.optionals (withX && !withCairo) [ + libXft + ] + ++ lib.optionals withXinput2 [ + libXi + ] + ++ lib.optionals withXwidgets [ + webkitgtk_4_0 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + sigtool + ] + ++ lib.optionals withNS [ + librsvg + ]; # Emacs needs to find movemail at run time, see info (emacs) Movemail propagatedUserEnvPkgs = lib.optionals withMailutils [ @@ -368,58 +365,57 @@ mkDerivation (finalAttrs: { hardeningDisable = [ "format" ]; - configureFlags = - [ - (lib.enableFeature false "build-details") # for a (more) reproducible build - (lib.withFeature true "modules") - ] - ++ ( - if withNS then - [ - (lib.enableFeature false "ns-self-contained") - ] - else if withX then - [ - (lib.withFeatureAs true "x-toolkit" toolkit) - (lib.withFeature withCairo "cairo") - (lib.withFeature (!withCairo) "xft") - ] - else if withPgtk then - [ - (lib.withFeature true "pgtk") - ] - else - [ - (lib.withFeature false "gif") - (lib.withFeature false "jpeg") - (lib.withFeature false "png") - (lib.withFeature false "tiff") - (lib.withFeature false "x") - (lib.withFeature false "xpm") - ] - ) - ++ lib.optionals (variant == "macport") [ - (lib.enableFeatureAs true "mac-app" "$$out/Applications") - (lib.withFeature true "gnutls") - (lib.withFeature true "mac") - (lib.withFeature true "xml2") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.withFeature withNS "ns") - ] - ++ [ - (lib.withFeature withCompressInstall "compress-install") - (lib.withFeature withToolkitScrollBars "toolkit-scroll-bars") - (lib.withFeature withNativeCompilation "native-compilation") - (lib.withFeature withImageMagick "imagemagick") - (lib.withFeature withMailutils "mailutils") - (lib.withFeature withSmallJaDic "small-ja-dic") - (lib.withFeature withTreeSitter "tree-sitter") - (lib.withFeature withXinput2 "xinput2") - (lib.withFeature withXwidgets "xwidgets") - (lib.withFeature withDbus "dbus") - (lib.withFeature withSelinux "selinux") - ]; + configureFlags = [ + (lib.enableFeature false "build-details") # for a (more) reproducible build + (lib.withFeature true "modules") + ] + ++ ( + if withNS then + [ + (lib.enableFeature false "ns-self-contained") + ] + else if withX then + [ + (lib.withFeatureAs true "x-toolkit" toolkit) + (lib.withFeature withCairo "cairo") + (lib.withFeature (!withCairo) "xft") + ] + else if withPgtk then + [ + (lib.withFeature true "pgtk") + ] + else + [ + (lib.withFeature false "gif") + (lib.withFeature false "jpeg") + (lib.withFeature false "png") + (lib.withFeature false "tiff") + (lib.withFeature false "x") + (lib.withFeature false "xpm") + ] + ) + ++ lib.optionals (variant == "macport") [ + (lib.enableFeatureAs true "mac-app" "$$out/Applications") + (lib.withFeature true "gnutls") + (lib.withFeature true "mac") + (lib.withFeature true "xml2") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.withFeature withNS "ns") + ] + ++ [ + (lib.withFeature withCompressInstall "compress-install") + (lib.withFeature withToolkitScrollBars "toolkit-scroll-bars") + (lib.withFeature withNativeCompilation "native-compilation") + (lib.withFeature withImageMagick "imagemagick") + (lib.withFeature withMailutils "mailutils") + (lib.withFeature withSmallJaDic "small-ja-dic") + (lib.withFeature withTreeSitter "tree-sitter") + (lib.withFeature withXinput2 "xinput2") + (lib.withFeature withXwidgets "xwidgets") + (lib.withFeature withDbus "dbus") + (lib.withFeature withSelinux "selinux") + ]; env = lib.optionalAttrs withNativeCompilation { @@ -439,47 +435,46 @@ mkDerivation (finalAttrs: { "install" ]; - postInstall = - '' - mkdir -p $out/share/emacs/site-lisp - cp ${siteStart} $out/share/emacs/site-lisp/site-start.el + postInstall = '' + mkdir -p $out/share/emacs/site-lisp + cp ${siteStart} $out/share/emacs/site-lisp/site-start.el - $out/bin/emacs --batch -f batch-byte-compile $out/share/emacs/site-lisp/site-start.el + $out/bin/emacs --batch -f batch-byte-compile $out/share/emacs/site-lisp/site-start.el - siteVersionDir=`ls $out/share/emacs | grep -v site-lisp | head -n 1` + siteVersionDir=`ls $out/share/emacs | grep -v site-lisp | head -n 1` - rm -r $out/share/emacs/$siteVersionDir/site-lisp - '' - + lib.optionalString withCsrc '' - for srcdir in src lisp lwlib ; do - dstdir=$out/share/emacs/$siteVersionDir/$srcdir - mkdir -p $dstdir - find $srcdir -name "*.[chm]" -exec cp {} $dstdir \; - cp $srcdir/TAGS $dstdir - echo '((nil . ((tags-file-name . "TAGS"))))' > $dstdir/.dir-locals.el - done - '' - + lib.optionalString withNS '' - mkdir -p $out/Applications - mv nextstep/Emacs.app $out/Applications - '' - + lib.optionalString (withNativeCompilation && (withNS || variant == "macport")) '' - ln -snf $out/lib/emacs/*/native-lisp $out/Applications/Emacs.app/Contents/native-lisp - '' - + lib.optionalString withNativeCompilation '' - echo "Generating native-compiled trampolines..." - # precompile trampolines in parallel, but avoid spawning one process per trampoline. - # 1000 is a rough lower bound on the number of trampolines compiled. - $out/bin/emacs --batch --eval "(mapatoms (lambda (s) \ - (when (subr-primitive-p (symbol-function s)) (print s))))" \ - | xargs -n $((1000/NIX_BUILD_CORES + 1)) -P $NIX_BUILD_CORES \ - $out/bin/emacs --batch -l comp --eval "(while argv \ - (comp-trampoline-compile (intern (pop argv))))" - mkdir -p $out/share/emacs/native-lisp - $out/bin/emacs --batch \ - --eval "(add-to-list 'native-comp-eln-load-path \"$out/share/emacs/native-lisp\")" \ - -f batch-native-compile $out/share/emacs/site-lisp/site-start.el - ''; + rm -r $out/share/emacs/$siteVersionDir/site-lisp + '' + + lib.optionalString withCsrc '' + for srcdir in src lisp lwlib ; do + dstdir=$out/share/emacs/$siteVersionDir/$srcdir + mkdir -p $dstdir + find $srcdir -name "*.[chm]" -exec cp {} $dstdir \; + cp $srcdir/TAGS $dstdir + echo '((nil . ((tags-file-name . "TAGS"))))' > $dstdir/.dir-locals.el + done + '' + + lib.optionalString withNS '' + mkdir -p $out/Applications + mv nextstep/Emacs.app $out/Applications + '' + + lib.optionalString (withNativeCompilation && (withNS || variant == "macport")) '' + ln -snf $out/lib/emacs/*/native-lisp $out/Applications/Emacs.app/Contents/native-lisp + '' + + lib.optionalString withNativeCompilation '' + echo "Generating native-compiled trampolines..." + # precompile trampolines in parallel, but avoid spawning one process per trampoline. + # 1000 is a rough lower bound on the number of trampolines compiled. + $out/bin/emacs --batch --eval "(mapatoms (lambda (s) \ + (when (subr-primitive-p (symbol-function s)) (print s))))" \ + | xargs -n $((1000/NIX_BUILD_CORES + 1)) -P $NIX_BUILD_CORES \ + $out/bin/emacs --batch -l comp --eval "(while argv \ + (comp-trampoline-compile (intern (pop argv))))" + mkdir -p $out/share/emacs/native-lisp + $out/bin/emacs --batch \ + --eval "(add-to-list 'native-comp-eln-load-path \"$out/share/emacs/native-lisp\")" \ + -f batch-native-compile $out/share/emacs/site-lisp/site-start.el + ''; postFixup = lib.optionalString (stdenv.hostPlatform.isLinux && withX && toolkit == "lucid") '' patchelf --add-rpath ${lib.makeLibraryPath [ libXcursor ]} $out/bin/emacs @@ -506,5 +501,6 @@ mkDerivation (finalAttrs: { knownVulnerabilities = lib.optionals (lib.versionOlder version "30") [ "CVE-2024-53920 CVE-2025-1244, please use newer versions such as emacs30" ]; - } // meta; + } + // meta; }) diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index ee18fef14b06..77c66d758491 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -51,27 +51,26 @@ let description = "Extensible, customizable GNU text editor" + lib.optionalString (variant == "macport") " - macport variant"; - longDescription = - '' - GNU Emacs is an extensible, customizable text editor—and more. At its core - is an interpreter for Emacs Lisp, a dialect of the Lisp programming - language with extensions to support text editing. + longDescription = '' + GNU Emacs is an extensible, customizable text editor—and more. At its core + is an interpreter for Emacs Lisp, a dialect of the Lisp programming + language with extensions to support text editing. - The features of GNU Emacs include: content-sensitive editing modes, - including syntax coloring, for a wide variety of file types including - plain text, source code, and HTML; complete built-in documentation, - including a tutorial for new users; full Unicode support for nearly all - human languages and their scripts; highly customizable, using Emacs Lisp - code or a graphical interface; a large number of extensions that add other - functionality, including a project planner, mail and news reader, debugger - interface, calendar, and more. Many of these extensions are distributed - with GNU Emacs; others are available separately. - '' - + lib.optionalString (variant == "macport") '' + The features of GNU Emacs include: content-sensitive editing modes, + including syntax coloring, for a wide variety of file types including + plain text, source code, and HTML; complete built-in documentation, + including a tutorial for new users; full Unicode support for nearly all + human languages and their scripts; highly customizable, using Emacs Lisp + code or a graphical interface; a large number of extensions that add other + functionality, including a project planner, mail and news reader, debugger + interface, calendar, and more. Many of these extensions are distributed + with GNU Emacs; others are available separately. + '' + + lib.optionalString (variant == "macport") '' - This release is built from Mitsuharu Yamamoto's patched source code - tailored for macOS. - ''; + This release is built from Mitsuharu Yamamoto's patched source code + tailored for macOS. + ''; changelog = { "mainline" = "https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.${version}"; @@ -99,7 +98,8 @@ let } .${variant}; mainProgram = "emacs"; - } // meta; + } + // meta; }; in { diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix index ba84e12d14b3..2b9eb1d6fb99 100644 --- a/pkgs/applications/editors/jetbrains/default.nix +++ b/pkgs/applications/editors/jetbrains/default.nix @@ -327,20 +327,19 @@ rec { rider = (mkJetBrainsProduct { pname = "rider"; - extraBuildInputs = - [ - fontconfig - stdenv.cc.cc - openssl - libxcrypt - lttng-ust_2_12 - musl - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - expat - libxml2 - xz - ]; + extraBuildInputs = [ + fontconfig + stdenv.cc.cc + openssl + libxcrypt + lttng-ust_2_12 + musl + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + expat + libxml2 + xz + ]; extraLdPath = lib.optionals (stdenv.hostPlatform.isLinux) [ # Avalonia dependencies needed for dotMemory libICE diff --git a/pkgs/applications/editors/jupyter/console.nix b/pkgs/applications/editors/jupyter/console.nix index 255e76e85132..07eaa79cd254 100644 --- a/pkgs/applications/editors/jupyter/console.nix +++ b/pkgs/applications/editors/jupyter/console.nix @@ -12,14 +12,13 @@ let }: (python3.buildEnv.override { extraLibs = [ python3.pkgs.jupyter-console ]; - makeWrapperArgs = - [ - "--set JUPYTER_PATH ${jupyter-kernel.create { inherit definitions; }}" - ] - ++ lib.optionals (kernel != null) [ - "--add-flags --kernel" - "--add-flags ${kernel}" - ]; + makeWrapperArgs = [ + "--set JUPYTER_PATH ${jupyter-kernel.create { inherit definitions; }}" + ] + ++ lib.optionals (kernel != null) [ + "--add-flags --kernel" + "--add-flags ${kernel}" + ]; }).overrideAttrs (oldAttrs: { # To facilitate running nix run .#jupyter-console diff --git a/pkgs/applications/editors/mindforger/default.nix b/pkgs/applications/editors/mindforger/default.nix index 2883c52fafc8..5f3b23c4e013 100644 --- a/pkgs/applications/editors/mindforger/default.nix +++ b/pkgs/applications/editors/mindforger/default.nix @@ -59,13 +59,12 @@ stdenv.mkDerivation { # build MindForger's internal fork of cmark-gfm ahead of MindForger itself. # # Moreover unpack the docs that are needed for the MacOS build. - postUnpack = - '' - cp -TR ${srcs.cmark-gfm} $sourceRoot/deps/cmark-gfm - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - cp -TR ${srcs.mindforger-repository} $sourceRoot/doc - ''; + postUnpack = '' + cp -TR ${srcs.cmark-gfm} $sourceRoot/deps/cmark-gfm + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + cp -TR ${srcs.mindforger-repository} $sourceRoot/doc + ''; dontUseCmakeConfigure = true; preBuild = '' ( diff --git a/pkgs/applications/editors/neovim/gnvim/wrapper.nix b/pkgs/applications/editors/neovim/gnvim/wrapper.nix index dd651f56ff15..a8e99c265e7a 100644 --- a/pkgs/applications/editors/neovim/gnvim/wrapper.nix +++ b/pkgs/applications/editors/neovim/gnvim/wrapper.nix @@ -9,22 +9,21 @@ stdenv.mkDerivation { pname = "gnvim"; version = gnvim-unwrapped.version; - buildCommand = - '' - makeWrapper '${gnvim-unwrapped}/bin/gnvim' "$out/bin/gnvim" \ - --prefix PATH : "${neovim}/bin" \ - --set GNVIM_RUNTIME_PATH "${gnvim-unwrapped}/share/gnvim/runtime" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - mkdir -p "$out/share" - ln -s '${gnvim-unwrapped}/share/icons' "$out/share/icons" + buildCommand = '' + makeWrapper '${gnvim-unwrapped}/bin/gnvim' "$out/bin/gnvim" \ + --prefix PATH : "${neovim}/bin" \ + --set GNVIM_RUNTIME_PATH "${gnvim-unwrapped}/share/gnvim/runtime" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + mkdir -p "$out/share" + ln -s '${gnvim-unwrapped}/share/icons' "$out/share/icons" - # copy and fix .desktop file - cp -r '${gnvim-unwrapped}/share/applications' "$out/share/applications" - # Sed needs a writable directory to do inplace modifications - chmod u+rw "$out/share/applications" - sed -e "s|Exec=.\\+gnvim\\>|Exec=gnvim|" -i $out/share/applications/*.desktop - ''; + # copy and fix .desktop file + cp -r '${gnvim-unwrapped}/share/applications' "$out/share/applications" + # Sed needs a writable directory to do inplace modifications + chmod u+rw "$out/share/applications" + sed -e "s|Exec=.\\+gnvim\\>|Exec=gnvim|" -i $out/share/applications/*.desktop + ''; preferLocalBuild = true; diff --git a/pkgs/applications/editors/neovim/utils.nix b/pkgs/applications/editors/neovim/utils.nix index f82fb523d318..354b2b0c42fc 100644 --- a/pkgs/applications/editors/neovim/utils.nix +++ b/pkgs/applications/editors/neovim/utils.nix @@ -271,7 +271,8 @@ let meta = { platforms = lib.platforms.all; - } // grammar.meta; + } + // grammar.meta; } )); diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index d3bc6f347081..9bcf6b8458c7 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -115,14 +115,13 @@ let in lib.foldl' op [ ] pluginsNormalized; - rcContent = - '' - ${luaRcContent} - '' - + lib.optionalString (neovimRcContent' != "") '' - vim.cmd.source "${writeText "init.vim" neovimRcContent'}" - '' - + lib.concatStringsSep "\n" luaPluginRC; + rcContent = '' + ${luaRcContent} + '' + + lib.optionalString (neovimRcContent' != "") '' + vim.cmd.source "${writeText "init.vim" neovimRcContent'}" + '' + + lib.concatStringsSep "\n" luaPluginRC; getDeps = attrname: map (plugin: plugin.${attrname} or (_: [ ])); @@ -137,35 +136,34 @@ let wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs; - generatedWrapperArgs = - [ - # vim accepts a limited number of commands so we join all the provider ones - "--add-flags" - ''--cmd "lua ${providerLuaRc}"'' - ] - ++ - lib.optionals - ( - finalAttrs.packpathDirs.myNeovimPackages.start != [ ] - || finalAttrs.packpathDirs.myNeovimPackages.opt != [ ] - ) - [ - "--add-flags" - ''--cmd "set packpath^=${finalPackdir}"'' - "--add-flags" - ''--cmd "set rtp^=${finalPackdir}"'' - ] - ++ lib.optionals finalAttrs.withRuby [ - "--set" - "GEM_HOME" - "${rubyEnv}/${rubyEnv.ruby.gemPath}" - ] - ++ lib.optionals (finalAttrs.runtimeDeps != [ ]) [ - "--suffix" - "PATH" - ":" - (lib.makeBinPath finalAttrs.runtimeDeps) - ]; + generatedWrapperArgs = [ + # vim accepts a limited number of commands so we join all the provider ones + "--add-flags" + ''--cmd "lua ${providerLuaRc}"'' + ] + ++ + lib.optionals + ( + finalAttrs.packpathDirs.myNeovimPackages.start != [ ] + || finalAttrs.packpathDirs.myNeovimPackages.opt != [ ] + ) + [ + "--add-flags" + ''--cmd "set packpath^=${finalPackdir}"'' + "--add-flags" + ''--cmd "set rtp^=${finalPackdir}"'' + ] + ++ lib.optionals finalAttrs.withRuby [ + "--set" + "GEM_HOME" + "${rubyEnv}/${rubyEnv.ruby.gemPath}" + ] + ++ lib.optionals (finalAttrs.runtimeDeps != [ ]) [ + "--suffix" + "PATH" + ":" + (lib.makeBinPath finalAttrs.runtimeDeps) + ]; providerLuaRc = neovimUtils.generateProviderRc { inherit (finalAttrs) @@ -182,22 +180,21 @@ let # when `postBuild` is evaluated), we call makeWrapper once to generate a # wrapper with most arguments we need, excluding those that cause problems to # generate rplugin.vim, but still required for the final wrapper. - finalMakeWrapperArgs = - [ - "${neovim-unwrapped}/bin/nvim" - "${placeholder "out"}/bin/nvim" - ] - ++ [ - "--set" - "NVIM_SYSTEM_RPLUGIN_MANIFEST" - "${placeholder "out"}/rplugin.vim" - ] - ++ lib.optionals finalAttrs.wrapRc [ - "--set-default" - "VIMINIT" - "lua dofile('${writeText "init.lua" rcContent}')" - ] - ++ finalAttrs.generatedWrapperArgs; + finalMakeWrapperArgs = [ + "${neovim-unwrapped}/bin/nvim" + "${placeholder "out"}/bin/nvim" + ] + ++ [ + "--set" + "NVIM_SYSTEM_RPLUGIN_MANIFEST" + "${placeholder "out"}/rplugin.vim" + ] + ++ lib.optionals finalAttrs.wrapRc [ + "--set-default" + "VIMINIT" + "lua dofile('${writeText "init.lua" rcContent}')" + ] + ++ finalAttrs.generatedWrapperArgs; perlEnv = perl.withPackages (p: [ p.NeovimExt @@ -273,7 +270,8 @@ let manifestWrapperArgs = [ "${neovim-unwrapped}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" - ] ++ finalAttrs.generatedWrapperArgs; + ] + ++ finalAttrs.generatedWrapperArgs; in '' echo "Generating remote plugin manifest" diff --git a/pkgs/applications/editors/sublime/3/common.nix b/pkgs/applications/editors/sublime/3/common.nix index 65d01a6eedb1..da26b2a046c7 100644 --- a/pkgs/applications/editors/sublime/3/common.nix +++ b/pkgs/applications/editors/sublime/3/common.nix @@ -150,23 +150,22 @@ stdenv.mkDerivation (rec { nativeBuildInputs = [ makeWrapper ]; - installPhase = - '' - mkdir -p "$out/bin" - makeWrapper "''$${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" - '' - + builtins.concatStringsSep "" ( - map (binaryAlias: "ln -s $out/bin/${primaryBinary} $out/bin/${binaryAlias}\n") primaryBinaryAliases - ) - + '' - mkdir -p "$out/share/applications" - substitute "''$${primaryBinary}/${primaryBinary}.desktop" "$out/share/applications/${primaryBinary}.desktop" --replace "/opt/${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" - for directory in ''$${primaryBinary}/Icon/*; do - size=$(basename $directory) - mkdir -p "$out/share/icons/hicolor/$size/apps" - ln -s ''$${primaryBinary}/Icon/$size/* $out/share/icons/hicolor/$size/apps - done - ''; + installPhase = '' + mkdir -p "$out/bin" + makeWrapper "''$${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" + '' + + builtins.concatStringsSep "" ( + map (binaryAlias: "ln -s $out/bin/${primaryBinary} $out/bin/${binaryAlias}\n") primaryBinaryAliases + ) + + '' + mkdir -p "$out/share/applications" + substitute "''$${primaryBinary}/${primaryBinary}.desktop" "$out/share/applications/${primaryBinary}.desktop" --replace "/opt/${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" + for directory in ''$${primaryBinary}/Icon/*; do + size=$(basename $directory) + mkdir -p "$out/share/icons/hicolor/$size/apps" + ln -s ''$${primaryBinary}/Icon/$size/* $out/share/icons/hicolor/$size/apps + done + ''; meta = with lib; { description = "Sophisticated text editor for code, markup and prose"; diff --git a/pkgs/applications/editors/sublime/4/common.nix b/pkgs/applications/editors/sublime/4/common.nix index 5eb44da32494..6aff26de3622 100644 --- a/pkgs/applications/editors/sublime/4/common.nix +++ b/pkgs/applications/editors/sublime/4/common.nix @@ -48,21 +48,20 @@ let versionUrl = "https://download.sublimetext.com/latest/${if dev then "dev" else "stable"}"; versionFile = builtins.toString ./packages.nix; - neededLibraries = - [ - xorg.libX11 - xorg.libXtst - glib - libglvnd - openssl_1_1 - gtk3 - cairo - pango - curl - ] - ++ lib.optionals (lib.versionAtLeast buildVersion "4145") [ - sqlite - ]; + neededLibraries = [ + xorg.libX11 + xorg.libXtst + glib + libglvnd + openssl_1_1 + gtk3 + cairo + pango + curl + ] + ++ lib.optionals (lib.versionAtLeast buildVersion "4145") [ + sqlite + ]; binaryPackage = stdenv.mkDerivation rec { pname = "${pnameBase}-bin"; @@ -149,28 +148,27 @@ stdenv.mkDerivation (rec { makeWrapper ]; - installPhase = - '' - mkdir -p "$out/bin" - makeWrapper "''$${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" - '' - + builtins.concatStringsSep "" ( - map (binaryAlias: "ln -s $out/bin/${primaryBinary} $out/bin/${binaryAlias}\n") primaryBinaryAliases - ) - + '' - mkdir -p "$out/share/applications" + installPhase = '' + mkdir -p "$out/bin" + makeWrapper "''$${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" + '' + + builtins.concatStringsSep "" ( + map (binaryAlias: "ln -s $out/bin/${primaryBinary} $out/bin/${binaryAlias}\n") primaryBinaryAliases + ) + + '' + mkdir -p "$out/share/applications" - substitute \ - "''$${primaryBinary}/${primaryBinary}.desktop" \ - "$out/share/applications/${primaryBinary}.desktop" \ - --replace-fail "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}" + substitute \ + "''$${primaryBinary}/${primaryBinary}.desktop" \ + "$out/share/applications/${primaryBinary}.desktop" \ + --replace-fail "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}" - for directory in ''$${primaryBinary}/Icon/*; do - size=$(basename $directory) - mkdir -p "$out/share/icons/hicolor/$size/apps" - ln -s ''$${primaryBinary}/Icon/$size/* $out/share/icons/hicolor/$size/apps - done - ''; + for directory in ''$${primaryBinary}/Icon/*; do + size=$(basename $directory) + mkdir -p "$out/share/icons/hicolor/$size/apps" + ln -s ''$${primaryBinary}/Icon/$size/* $out/share/icons/hicolor/$size/apps + done + ''; passthru = { updateScript = diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix index b5b9026f0140..dd73dd13038a 100644 --- a/pkgs/applications/editors/texmacs/default.nix +++ b/pkgs/applications/editors/texmacs/default.nix @@ -49,12 +49,10 @@ stdenv.mkDerivation { hash = "sha256-h6aSLuDdrAtVzOnNVPqMEWX9WLDHtkCjPy9JXWnBgYY="; }; - postPatch = - common.postPatch - + '' - substituteInPlace configure \ - --replace "-mfpmath=sse -msse2" "" - ''; + postPatch = common.postPatch + '' + substituteInPlace configure \ + --replace "-mfpmath=sse -msse2" "" + ''; nativeBuildInputs = [ guile_1_8 @@ -64,21 +62,20 @@ stdenv.mkDerivation { cmake ]; - buildInputs = - [ - guile_1_8 - qtbase - qtsvg - ghostscriptX - freetype - libjpeg - sqlite - git - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - qtmacextras - ]; + buildInputs = [ + guile_1_8 + qtbase + qtsvg + ghostscriptX + freetype + libjpeg + sqlite + git + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + qtmacextras + ]; patches = [ (fetchpatch { diff --git a/pkgs/applications/editors/texworks/default.nix b/pkgs/applications/editors/texworks/default.nix index 7d746b9b8f15..68055e2af685 100644 --- a/pkgs/applications/editors/texworks/default.nix +++ b/pkgs/applications/editors/texworks/default.nix @@ -33,23 +33,21 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; - buildInputs = - [ - hunspell - poppler - qt5compat - qttools - ] - ++ lib.optional withLua lua - ++ lib.optional withPython python3 - ++ lib.optional stdenv.hostPlatform.isLinux qtwayland; + buildInputs = [ + hunspell + poppler + qt5compat + qttools + ] + ++ lib.optional withLua lua + ++ lib.optional withPython python3 + ++ lib.optional stdenv.hostPlatform.isLinux qtwayland; - cmakeFlags = - [ - "-DQT_DEFAULT_MAJOR_VERSION=6" - ] - ++ lib.optional withLua "-DWITH_LUA=ON" - ++ lib.optional withPython "-DWITH_PYTHON=ON"; + cmakeFlags = [ + "-DQT_DEFAULT_MAJOR_VERSION=6" + ] + ++ lib.optional withLua "-DWITH_LUA=ON" + ++ lib.optional withPython "-DWITH_PYTHON=ON"; meta = with lib; { changelog = "https://github.com/TeXworks/texworks/blob/${src.rev}/NEWS"; diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index ec267de59e44..809e9808b1be 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -46,31 +46,30 @@ stdenv.mkDerivation { strictDeps = true; - configureFlags = + configureFlags = [ + "--enable-multibyte" + "--enable-nls" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ( [ - "--enable-multibyte" - "--enable-nls" + "vim_cv_toupper_broken=no" + "--with-tlib=ncurses" + "vim_cv_terminfo=yes" + "vim_cv_tgetent=zero" # it does on native anyway + "vim_cv_tty_group=tty" + "vim_cv_tty_mode=0660" + "vim_cv_getcwd_broken=no" + "vim_cv_stat_ignores_slash=yes" + "vim_cv_memmove_handles_overlap=yes" ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ( - [ - "vim_cv_toupper_broken=no" - "--with-tlib=ncurses" - "vim_cv_terminfo=yes" - "vim_cv_tgetent=zero" # it does on native anyway - "vim_cv_tty_group=tty" - "vim_cv_tty_mode=0660" - "vim_cv_getcwd_broken=no" - "vim_cv_stat_ignores_slash=yes" - "vim_cv_memmove_handles_overlap=yes" - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - "vim_cv_timer_create=no" - "vim_cv_timer_create_with_lrt=yes" - ] - ++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ - "vim_cv_timer_create=yes" - ] - ); + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + "vim_cv_timer_create=no" + "vim_cv_timer_create_with_lrt=yes" + ] + ++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ + "vim_cv_timer_create=yes" + ] + ); # which.sh is used to for vim's own shebang patching, so make it find # binaries for the host platform. diff --git a/pkgs/applications/editors/vim/full.nix b/pkgs/applications/editors/vim/full.nix index 9b20629618ae..71f2f4a784fa 100644 --- a/pkgs/applications/editors/vim/full.nix +++ b/pkgs/applications/editors/vim/full.nix @@ -101,98 +101,95 @@ stdenv.mkDerivation { patches = [ ./cflags-prune.diff ]; - configureFlags = - [ - "--with-features=${features}" - "--disable-xsmp" # XSMP session management - "--disable-xsmp_interact" # XSMP interaction - "--disable-workshop" # Sun Visual Workshop support - "--disable-sniff" # Sniff interface - "--disable-hangulinput" # Hangul input support - "--disable-fontset" # X fontset output support - "--disable-acl" # ACL support - "--disable-gpm" # GPM (Linux mouse daemon) - "--disable-mzschemeinterp" - "--disable-gtk_check" - "--disable-gtk2_check" - "--disable-gnome_check" - "--disable-motif_check" - "--disable-athena_check" - "--disable-nextaf_check" - "--disable-carbon_check" - "--disable-gtktest" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "vim_cv_toupper_broken=no" - "--with-tlib=ncurses" - "vim_cv_terminfo=yes" - "vim_cv_tgetent=zero" # it does on native anyway - "vim_cv_tty_group=tty" - "vim_cv_tty_mode=0660" - "vim_cv_getcwd_broken=no" - "vim_cv_stat_ignores_slash=yes" - "vim_cv_memmove_handles_overlap=yes" - ] - ++ lib.optional (guiSupport == "gtk2" || guiSupport == "gtk3") "--enable-gui=${guiSupport}" - ++ lib.optional stdenv.hostPlatform.isDarwin ( - if darwinSupport then "--enable-darwin" else "--disable-darwin" - ) - ++ lib.optionals luaSupport [ - "--with-lua-prefix=${lua}" - "--enable-luainterp" - ] - ++ lib.optionals lua.pkgs.isLuaJIT [ - "--with-luajit" - ] - ++ lib.optionals pythonSupport [ - "--enable-python3interp=yes" - "--with-python3-config-dir=${python3}/lib" - # Disables Python 2 - "--disable-pythoninterp" - ] - ++ lib.optional nlsSupport "--enable-nls" - ++ lib.optional perlSupport "--enable-perlinterp" - ++ lib.optional rubySupport "--enable-rubyinterp" - ++ lib.optional tclSupport "--enable-tclinterp" - ++ lib.optional multibyteSupport "--enable-multibyte" - ++ lib.optional cscopeSupport "--enable-cscope" - ++ lib.optional netbeansSupport "--enable-netbeans" - ++ lib.optional ximSupport "--enable-xim" - ++ lib.optional sodiumSupport "--enable-sodium"; + configureFlags = [ + "--with-features=${features}" + "--disable-xsmp" # XSMP session management + "--disable-xsmp_interact" # XSMP interaction + "--disable-workshop" # Sun Visual Workshop support + "--disable-sniff" # Sniff interface + "--disable-hangulinput" # Hangul input support + "--disable-fontset" # X fontset output support + "--disable-acl" # ACL support + "--disable-gpm" # GPM (Linux mouse daemon) + "--disable-mzschemeinterp" + "--disable-gtk_check" + "--disable-gtk2_check" + "--disable-gnome_check" + "--disable-motif_check" + "--disable-athena_check" + "--disable-nextaf_check" + "--disable-carbon_check" + "--disable-gtktest" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "vim_cv_toupper_broken=no" + "--with-tlib=ncurses" + "vim_cv_terminfo=yes" + "vim_cv_tgetent=zero" # it does on native anyway + "vim_cv_tty_group=tty" + "vim_cv_tty_mode=0660" + "vim_cv_getcwd_broken=no" + "vim_cv_stat_ignores_slash=yes" + "vim_cv_memmove_handles_overlap=yes" + ] + ++ lib.optional (guiSupport == "gtk2" || guiSupport == "gtk3") "--enable-gui=${guiSupport}" + ++ lib.optional stdenv.hostPlatform.isDarwin ( + if darwinSupport then "--enable-darwin" else "--disable-darwin" + ) + ++ lib.optionals luaSupport [ + "--with-lua-prefix=${lua}" + "--enable-luainterp" + ] + ++ lib.optionals lua.pkgs.isLuaJIT [ + "--with-luajit" + ] + ++ lib.optionals pythonSupport [ + "--enable-python3interp=yes" + "--with-python3-config-dir=${python3}/lib" + # Disables Python 2 + "--disable-pythoninterp" + ] + ++ lib.optional nlsSupport "--enable-nls" + ++ lib.optional perlSupport "--enable-perlinterp" + ++ lib.optional rubySupport "--enable-rubyinterp" + ++ lib.optional tclSupport "--enable-tclinterp" + ++ lib.optional multibyteSupport "--enable-multibyte" + ++ lib.optional cscopeSupport "--enable-cscope" + ++ lib.optional netbeansSupport "--enable-netbeans" + ++ lib.optional ximSupport "--enable-xim" + ++ lib.optional sodiumSupport "--enable-sodium"; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optional wrapPythonDrv makeWrapper - ++ lib.optional nlsSupport gettext - ++ lib.optional perlSupport perl - ++ lib.optional (guiSupport == "gtk3") wrapGAppsHook3; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optional wrapPythonDrv makeWrapper + ++ lib.optional nlsSupport gettext + ++ lib.optional perlSupport perl + ++ lib.optional (guiSupport == "gtk3") wrapGAppsHook3; - buildInputs = - [ - ncurses - glib - ] - # All X related dependencies - ++ lib.optionals (guiSupport == "gtk2" || guiSupport == "gtk3") [ - libSM - libICE - libX11 - libXext - libXpm - libXt - libXaw - libXau - libXmu - ] - ++ lib.optional (guiSupport == "gtk2") gtk2-x11 - ++ lib.optional (guiSupport == "gtk3") gtk3-x11 - ++ lib.optional luaSupport lua - ++ lib.optional pythonSupport python3 - ++ lib.optional tclSupport tcl - ++ lib.optional rubySupport ruby - ++ lib.optional sodiumSupport libsodium; + buildInputs = [ + ncurses + glib + ] + # All X related dependencies + ++ lib.optionals (guiSupport == "gtk2" || guiSupport == "gtk3") [ + libSM + libICE + libX11 + libXext + libXpm + libXt + libXaw + libXau + libXmu + ] + ++ lib.optional (guiSupport == "gtk2") gtk2-x11 + ++ lib.optional (guiSupport == "gtk3") gtk3-x11 + ++ lib.optional luaSupport lua + ++ lib.optional pythonSupport python3 + ++ lib.optional tclSupport tcl + ++ lib.optional rubySupport ruby + ++ lib.optional sodiumSupport libsodium; # error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-fdeclspec"; @@ -206,13 +203,12 @@ stdenv.mkDerivation { mkdir -p $out/share/applications $out/share/icons/{hicolor,locolor}/{16x16,32x32,48x48}/apps ''; - postInstall = - '' - ln -s $out/bin/vim $out/bin/vi - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc - ''; + postInstall = '' + ln -s $out/bin/vim $out/bin/vi + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc + ''; postFixup = common.postFixup diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 49d81e85cab6..c3675c28893f 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -393,17 +393,16 @@ in # These usually implicitly set by cc-wrapper around clang (pkgs/build-support/cc-wrapper). # The linked ruby code shows generates the required '.clang_complete' for cmake based projects # https://gist.github.com/Mic92/135e83803ed29162817fce4098dec144 - preFixup = - '' - substituteInPlace "$out"/plugin/clang_complete.vim \ - --replace-fail "let g:clang_library_path = '' - + "''" - + '' - " "let g:clang_library_path='${lib.getLib llvmPackages.libclang}/lib/libclang.so'" + preFixup = '' + substituteInPlace "$out"/plugin/clang_complete.vim \ + --replace-fail "let g:clang_library_path = '' + + "''" + + '' + " "let g:clang_library_path='${lib.getLib llvmPackages.libclang}/lib/libclang.so'" - substituteInPlace "$out"/plugin/libclang.py \ - --replace-fail "/usr/lib/clang" "${llvmPackages.clang.cc}/lib/clang" - ''; + substituteInPlace "$out"/plugin/libclang.py \ + --replace-fail "/usr/lib/clang" "${llvmPackages.clang.cc}/lib/clang" + ''; }; claude-code-nvim = super.claude-code-nvim.overrideAttrs { @@ -1081,13 +1080,11 @@ in }; direnv-vim = super.direnv-vim.overrideAttrs (old: { - preFixup = - old.preFixup or "" - + '' - substituteInPlace $out/autoload/direnv.vim \ - --replace-fail "let s:direnv_cmd = get(g:, 'direnv_cmd', 'direnv')" \ - "let s:direnv_cmd = get(g:, 'direnv_cmd', '${lib.getBin direnv}/bin/direnv')" - ''; + preFixup = old.preFixup or "" + '' + substituteInPlace $out/autoload/direnv.vim \ + --replace-fail "let s:direnv_cmd = get(g:, 'direnv_cmd', 'direnv')" \ + "let s:direnv_cmd = get(g:, 'direnv_cmd', '${lib.getBin direnv}/bin/direnv')" + ''; }); dotnet-nvim = super.dotnet-nvim.overrideAttrs { @@ -3944,13 +3941,11 @@ in }; vim-stylish-haskell = super.vim-stylish-haskell.overrideAttrs (old: { - postPatch = - old.postPatch or "" - + '' - substituteInPlace ftplugin/haskell/stylish-haskell.vim --replace-fail \ - 'g:stylish_haskell_command = "stylish-haskell"' \ - 'g:stylish_haskell_command = "${stylish-haskell}/bin/stylish-haskell"' - ''; + postPatch = old.postPatch or "" + '' + substituteInPlace ftplugin/haskell/stylish-haskell.vim --replace-fail \ + 'g:stylish_haskell_command = "stylish-haskell"' \ + 'g:stylish_haskell_command = "${stylish-haskell}/bin/stylish-haskell"' + ''; }); vim-surround = super.vim-surround.overrideAttrs { diff --git a/pkgs/applications/editors/vim/plugins/utils/build-vim-plugin.nix b/pkgs/applications/editors/vim/plugins/utils/build-vim-plugin.nix index ac5fb20e183b..9b426edb593e 100644 --- a/pkgs/applications/editors/vim/plugins/utils/build-vim-plugin.nix +++ b/pkgs/applications/editors/vim/plugins/utils/build-vim-plugin.nix @@ -50,7 +50,8 @@ meta = { platforms = lib.platforms.all; - } // meta; + } + // meta; } ); in diff --git a/pkgs/applications/editors/vim/plugins/utils/vim-utils.nix b/pkgs/applications/editors/vim/plugins/utils/vim-utils.nix index dd12f9a442e6..dbe41260ca06 100644 --- a/pkgs/applications/editors/vim/plugins/utils/vim-utils.nix +++ b/pkgs/applications/editors/vim/plugins/utils/vim-utils.nix @@ -260,17 +260,16 @@ let let # vim-plug is an extremely popular vim plugin manager. - plugImpl = - '' - source ${vimPlugins.vim-plug}/plug.vim - silent! call plug#begin('/dev/null') + plugImpl = '' + source ${vimPlugins.vim-plug}/plug.vim + silent! call plug#begin('/dev/null') - '' - + (lib.concatMapStringsSep "\n" (pkg: "Plug '${pkg}'") plug.plugins) - + '' + '' + + (lib.concatMapStringsSep "\n" (pkg: "Plug '${pkg}'") plug.plugins) + + '' - call plug#end() - ''; + call plug#end() + ''; # vim-addon-manager = VAM (deprecated) vamImpl = @@ -289,19 +288,18 @@ let in nativeImpl vamPackages; - entries = - [ - beforePlugins - ] - ++ lib.optional (vam != null) ( - lib.warn "'vam' attribute is deprecated. Use 'packages' instead in your vim configuration" vamImpl - ) - ++ lib.optional (packages != null && packages != [ ]) (nativeImpl packages) - ++ lib.optional (pathogen != null) ( - throw "pathogen is now unsupported, replace `pathogen = {}` with `packages.home = { start = []; }`" - ) - ++ lib.optional (plug != null) plugImpl - ++ [ customRC ]; + entries = [ + beforePlugins + ] + ++ lib.optional (vam != null) ( + lib.warn "'vam' attribute is deprecated. Use 'packages' instead in your vim configuration" vamImpl + ) + ++ lib.optional (packages != null && packages != [ ]) (nativeImpl packages) + ++ lib.optional (pathogen != null) ( + throw "pathogen is now unsupported, replace `pathogen = {}` with `packages.home = { start = []; }`" + ) + ++ lib.optional (plug != null) plugImpl + ++ [ customRC ]; in lib.concatStringsSep "\n" (lib.filter (x: x != null && x != "") entries); diff --git a/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix b/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix index e5e1edbcf035..e0fc18b9345e 100644 --- a/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix +++ b/pkgs/applications/editors/vscode/extensions/ms-python.python/default.nix @@ -28,22 +28,21 @@ vscode-utils.buildVscodeMarketplaceExtension rec { jedi-language-server ]; - postPatch = - '' - # remove bundled python deps and use libs from nixpkgs - rm -r python_files/lib - mkdir -p python_files/lib/python/ - ln -s ${python3.pkgs.debugpy}/lib/*/site-packages/debugpy python_files/lib/python/ - buildPythonPath "$propagatedBuildInputs" - for i in python_files/*.py; do - patchPythonScript "$i" - done - '' - + lib.optionalString pythonUseFixed '' - # Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`. - substituteInPlace "./package.json" \ - --replace-fail "\"default\":\"python\"" "\"default\":\"${python3.interpreter}\"" - ''; + postPatch = '' + # remove bundled python deps and use libs from nixpkgs + rm -r python_files/lib + mkdir -p python_files/lib/python/ + ln -s ${python3.pkgs.debugpy}/lib/*/site-packages/debugpy python_files/lib/python/ + buildPythonPath "$propagatedBuildInputs" + for i in python_files/*.py; do + patchPythonScript "$i" + done + '' + + lib.optionalString pythonUseFixed '' + # Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`. + substituteInPlace "./package.json" \ + --replace-fail "\"default\":\"python\"" "\"default\":\"${python3.interpreter}\"" + ''; passthru.updateScript = vscode-extension-update-script { }; diff --git a/pkgs/applications/editors/vscode/extensions/ms-vscode.cpptools/default.nix b/pkgs/applications/editors/vscode/extensions/ms-vscode.cpptools/default.nix index 1800c6abb7c7..b4197f9f2832 100644 --- a/pkgs/applications/editors/vscode/extensions/ms-vscode.cpptools/default.nix +++ b/pkgs/applications/editors/vscode/extensions/ms-vscode.cpptools/default.nix @@ -76,41 +76,41 @@ vscode-utils.buildVscodeMarketplaceExtension { libkrb5 zlib (lib.getLib stdenv.cc.cc) - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ lttng-ust ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ lttng-ust ]; dontAutoPatchelf = isx86Linux || isDarwin; - postPatch = - '' - mv ./package.json ./package_orig.json + postPatch = '' + mv ./package.json ./package_orig.json - # 1. Add activation events so that the extension is functional. This listing is empty when unpacking the extension but is filled at runtime. - # 2. Patch `package.json` so that nix's *gdb* is used as default value for `miDebuggerPath`. - cat ./package_orig.json | \ - jq --slurpfile actEvts ${./package-activation-events.json} '(.activationEvents) = $actEvts[0]' | \ - jq '(.contributes.debuggers[].configurationAttributes | .attach , .launch | .properties.miDebuggerPath | select(. != null) | select(.default == "/usr/bin/gdb") | .default) = "${gdbDefaultsTo}"' > \ - ./package.json + # 1. Add activation events so that the extension is functional. This listing is empty when unpacking the extension but is filled at runtime. + # 2. Patch `package.json` so that nix's *gdb* is used as default value for `miDebuggerPath`. + cat ./package_orig.json | \ + jq --slurpfile actEvts ${./package-activation-events.json} '(.activationEvents) = $actEvts[0]' | \ + jq '(.contributes.debuggers[].configurationAttributes | .attach , .launch | .properties.miDebuggerPath | select(. != null) | select(.default == "/usr/bin/gdb") | .default) = "${gdbDefaultsTo}"' > \ + ./package.json - # Prevent download/install of extensions - touch "./install.lock" + # Prevent download/install of extensions + touch "./install.lock" - # Clang-format from nix package. - rm -rf ./LLVM - mkdir "./LLVM/" - find "${clang-tools}" -mindepth 1 -maxdepth 1 | xargs ln -s -t "./LLVM" + # Clang-format from nix package. + rm -rf ./LLVM + mkdir "./LLVM/" + find "${clang-tools}" -mindepth 1 -maxdepth 1 | xargs ln -s -t "./LLVM" - # Patching binaries - chmod +x bin/cpptools bin/cpptools-srv bin/cpptools-wordexp debugAdapters/bin/OpenDebugAD7 - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - patchelf --replace-needed liblttng-ust.so.0 liblttng-ust.so.1 ./debugAdapters/bin/libcoreclrtraceptprovider.so - '' - + lib.optionalString isx86Linux '' - chmod +x bin/libc.so - '' - + lib.optionalString isDarwin '' - chmod +x debugAdapters/lldb-mi/bin/lldb-mi - ''; + # Patching binaries + chmod +x bin/cpptools bin/cpptools-srv bin/cpptools-wordexp debugAdapters/bin/OpenDebugAD7 + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + patchelf --replace-needed liblttng-ust.so.0 liblttng-ust.so.1 ./debugAdapters/bin/libcoreclrtraceptprovider.so + '' + + lib.optionalString isx86Linux '' + chmod +x bin/libc.so + '' + + lib.optionalString isDarwin '' + chmod +x debugAdapters/lldb-mi/bin/lldb-mi + ''; # On aarch64 the binaries are statically linked # but on x86 they are not. diff --git a/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix index d3ff70cca2f6..4fc5c6892461 100644 --- a/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix +++ b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/default.nix @@ -88,14 +88,13 @@ stdenv.mkDerivation { cp -r ${nodeDeps}/lib/node_modules . ''; - postConfigure = - '' - cp -r ${nodeDeps}/lib/node_modules . - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export HOME="$TMPDIR/home" - mkdir $HOME - ''; + postConfigure = '' + cp -r ${nodeDeps}/lib/node_modules . + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export HOME="$TMPDIR/home" + mkdir $HOME + ''; cmakeFlags = [ # Do not append timestamp to version. diff --git a/pkgs/applications/editors/vscode/extensions/vscode-utils.nix b/pkgs/applications/editors/vscode/extensions/vscode-utils.nix index f0e8b1ef6305..bb15fecc67d2 100644 --- a/pkgs/applications/editors/vscode/extensions/vscode-utils.nix +++ b/pkgs/applications/editors/vscode/extensions/vscode-utils.nix @@ -41,14 +41,13 @@ let { pname = "vscode-extension-${pname}"; - passthru = - { - updateScript = vscode-extension-update-script { }; - } - // passthru - // { - inherit vscodeExtPublisher vscodeExtName vscodeExtUniqueId; - }; + passthru = { + updateScript = vscode-extension-update-script { }; + } + // passthru + // { + inherit vscodeExtPublisher vscodeExtName vscodeExtUniqueId; + }; inherit configurePhase diff --git a/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix b/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix index 37b82075e751..5fef43325c1f 100644 --- a/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix +++ b/pkgs/applications/editors/vscode/extensions/vscodeEnv.nix @@ -53,7 +53,8 @@ let "extensions.autoCheckUpdates" = false; "extensions.autoUpdate" = false; "update.mode" = "none"; - } // settings; + } + // settings; inherit userSettingsFolder; createIfDoesNotExists = createSettingsIfDoesNotExists; symlinkFromUserSetting = (user-data-dir != ""); diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index c13d92c70251..058f8dc9a34a 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -137,21 +137,20 @@ stdenv.mkDerivation ( dontFixup ; - passthru = - { - inherit - executableName - longName - tests - updateScript - vscodeVersion - ; - fhs = fhs { }; - fhsWithPackages = f: fhs { additionalPkgs = f; }; - } - // lib.optionalAttrs (vscodeServer != null) { - inherit rev vscodeServer; - }; + passthru = { + inherit + executableName + longName + tests + updateScript + vscodeVersion + ; + fhs = fhs { }; + fhsWithPackages = f: fhs { additionalPkgs = f; }; + } + // lib.optionalAttrs (vscodeServer != null) { + inherit rev vscodeServer; + }; desktopItems = [ (makeDesktopItem { @@ -197,22 +196,21 @@ stdenv.mkDerivation ( }) ]; - buildInputs = - [ - libsecret - libXScrnSaver - libxshmfence - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - alsa-lib - at-spi2-atk - libkrb5 - libgbm - nss - nspr - systemd - xorg.libxkbfile - ]; + buildInputs = [ + libsecret + libXScrnSaver + libxshmfence + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + alsa-lib + at-spi2-atk + libkrb5 + libgbm + nss + nspr + systemd + xorg.libxkbfile + ]; runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib systemd) @@ -222,16 +220,17 @@ stdenv.mkDerivation ( libsecret ]; - nativeBuildInputs = - [ unzip ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - asar - copyDesktopItems - # override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651 - # Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset. - (buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; }) - ]; + nativeBuildInputs = [ + unzip + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + asar + copyDesktopItems + # override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651 + # Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset. + (buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; }) + ]; dontBuild = true; dontConfigure = true; @@ -242,45 +241,44 @@ stdenv.mkDerivation ( "lib/vscode/resources/app/node_modules/@vscode/vsce-sign/bin/vsce-sign" ]; - installPhase = - '' - runHook preInstall - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir -p "$out/Applications/${longName}.app" "$out/bin" - cp -r ./* "$out/Applications/${longName}.app" - ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${sourceExecutableName}" "$out/bin/${executableName}" - '' - else - '' - mkdir -p "$out/lib/${libraryName}" "$out/bin" - cp -r ./* "$out/lib/${libraryName}" + installPhase = '' + runHook preInstall + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p "$out/Applications/${longName}.app" "$out/bin" + cp -r ./* "$out/Applications/${longName}.app" + ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${sourceExecutableName}" "$out/bin/${executableName}" + '' + else + '' + mkdir -p "$out/lib/${libraryName}" "$out/bin" + cp -r ./* "$out/lib/${libraryName}" - ln -s "$out/lib/${libraryName}/bin/${sourceExecutableName}" "$out/bin/${executableName}" + ln -s "$out/lib/${libraryName}/bin/${sourceExecutableName}" "$out/bin/${executableName}" - # These are named vscode.png, vscode-insiders.png, etc to match the name in upstream *.deb packages. - mkdir -p "$out/share/pixmaps" - cp "$out/lib/${libraryName}/resources/app/resources/linux/code.png" "$out/share/pixmaps/${iconName}.png" + # These are named vscode.png, vscode-insiders.png, etc to match the name in upstream *.deb packages. + mkdir -p "$out/share/pixmaps" + cp "$out/lib/${libraryName}/resources/app/resources/linux/code.png" "$out/share/pixmaps/${iconName}.png" - '' - + (lib.optionalString patchVSCodePath '' - # Override the previously determined VSCODE_PATH with the one we know to be correct - sed -i "/ELECTRON=/iVSCODE_PATH='$out/lib/${libraryName}'" "$out/bin/${executableName}" - grep -q "VSCODE_PATH='$out/lib/${libraryName}'" "$out/bin/${executableName}" # check if sed succeeded - '') - + '' + '' + + (lib.optionalString patchVSCodePath '' + # Override the previously determined VSCODE_PATH with the one we know to be correct + sed -i "/ELECTRON=/iVSCODE_PATH='$out/lib/${libraryName}'" "$out/bin/${executableName}" + grep -q "VSCODE_PATH='$out/lib/${libraryName}'" "$out/bin/${executableName}" # check if sed succeeded + '') + + '' - # Remove native encryption code, as it derives the key from the executable path which does not work for us. - # The credentials should be stored in a secure keychain already, so the benefit of this is questionable - # in the first place. - rm -rf $out/lib/${libraryName}/resources/app/node_modules/vscode-encrypt - '' - ) - + '' - runHook postInstall - ''; + # Remove native encryption code, as it derives the key from the executable path which does not work for us. + # The credentials should be stored in a secure keychain already, so the benefit of this is questionable + # in the first place. + rm -rf $out/lib/${libraryName}/resources/app/node_modules/vscode-encrypt + '' + ) + + '' + runHook postInstall + ''; preFixup = '' gappsWrapperArgs+=( diff --git a/pkgs/applications/emulators/box64/default.nix b/pkgs/applications/emulators/box64/default.nix index 537998c47eb3..894c6711a23e 100644 --- a/pkgs/applications/emulators/box64/default.nix +++ b/pkgs/applications/emulators/box64/default.nix @@ -42,27 +42,26 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - cmakeFlags = - [ - (lib.cmakeBool "NOGIT" true) + cmakeFlags = [ + (lib.cmakeBool "NOGIT" true) - # Arch mega-option - (lib.cmakeBool "ARM64" stdenv.hostPlatform.isAarch64) - (lib.cmakeBool "RV64" stdenv.hostPlatform.isRiscV64) - (lib.cmakeBool "PPC64LE" (stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian)) - (lib.cmakeBool "LARCH64" stdenv.hostPlatform.isLoongArch64) - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - # x86_64 has no arch-specific mega-option, manually enable the options that apply to it - (lib.cmakeBool "LD80BITS" true) - (lib.cmakeBool "NOALIGN" true) - ] - ++ [ - # Arch dynarec - (lib.cmakeBool "ARM_DYNAREC" (withDynarec && stdenv.hostPlatform.isAarch64)) - (lib.cmakeBool "RV64_DYNAREC" (withDynarec && stdenv.hostPlatform.isRiscV64)) - (lib.cmakeBool "LARCH64_DYNAREC" (withDynarec && stdenv.hostPlatform.isLoongArch64)) - ]; + # Arch mega-option + (lib.cmakeBool "ARM64" stdenv.hostPlatform.isAarch64) + (lib.cmakeBool "RV64" stdenv.hostPlatform.isRiscV64) + (lib.cmakeBool "PPC64LE" (stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian)) + (lib.cmakeBool "LARCH64" stdenv.hostPlatform.isLoongArch64) + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + # x86_64 has no arch-specific mega-option, manually enable the options that apply to it + (lib.cmakeBool "LD80BITS" true) + (lib.cmakeBool "NOALIGN" true) + ] + ++ [ + # Arch dynarec + (lib.cmakeBool "ARM_DYNAREC" (withDynarec && stdenv.hostPlatform.isAarch64)) + (lib.cmakeBool "RV64_DYNAREC" (withDynarec && stdenv.hostPlatform.isRiscV64)) + (lib.cmakeBool "LARCH64_DYNAREC" (withDynarec && stdenv.hostPlatform.isLoongArch64)) + ]; installPhase = '' runHook preInstall diff --git a/pkgs/applications/emulators/box86/default.nix b/pkgs/applications/emulators/box86/default.nix index 1307af0fffaa..30d4fb07e042 100644 --- a/pkgs/applications/emulators/box86/default.nix +++ b/pkgs/applications/emulators/box86/default.nix @@ -29,22 +29,21 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - cmakeFlags = - [ - (lib.cmakeBool "NOGIT" true) + cmakeFlags = [ + (lib.cmakeBool "NOGIT" true) - # Arch mega-option - (lib.cmakeBool "POWERPCLE" (stdenv.hostPlatform.isPower && stdenv.hostPlatform.isLittleEndian)) - ] - ++ lib.optionals stdenv.hostPlatform.isi686 [ - # x86 has no arch-specific mega-option, manually enable the options that apply to it - (lib.cmakeBool "LD80BITS" true) - (lib.cmakeBool "NOALIGN" true) - ] - ++ [ - # Arch dynarec - (lib.cmakeBool "ARM_DYNAREC" (withDynarec && stdenv.hostPlatform.isAarch)) - ]; + # Arch mega-option + (lib.cmakeBool "POWERPCLE" (stdenv.hostPlatform.isPower && stdenv.hostPlatform.isLittleEndian)) + ] + ++ lib.optionals stdenv.hostPlatform.isi686 [ + # x86 has no arch-specific mega-option, manually enable the options that apply to it + (lib.cmakeBool "LD80BITS" true) + (lib.cmakeBool "NOALIGN" true) + ] + ++ [ + # Arch dynarec + (lib.cmakeBool "ARM_DYNAREC" (withDynarec && stdenv.hostPlatform.isAarch)) + ]; installPhase = '' runHook preInstall diff --git a/pkgs/applications/emulators/dosbox/default.nix b/pkgs/applications/emulators/dosbox/default.nix index 7026d2f2598f..7057f08a8e9d 100644 --- a/pkgs/applications/emulators/dosbox/default.nix +++ b/pkgs/applications/emulators/dosbox/default.nix @@ -46,17 +46,16 @@ stdenv.mkDerivation rec { binutils # build calls `ar` ]; - buildInputs = - [ - SDL - SDL_net - SDL_sound - libpng - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGL - libGLU - ]; + buildInputs = [ + SDL + SDL_net + SDL_sound + libpng + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGL + libGLU + ]; # Tests for SDL_net.h for modem & IPX support, not automatically picked up due to being in SDL subdirectory env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL_net}/include/SDL"; diff --git a/pkgs/applications/emulators/libretro/mkLibretroCore.nix b/pkgs/applications/emulators/libretro/mkLibretroCore.nix index 1702f150e4ee..f9679c7c11df 100644 --- a/pkgs/applications/emulators/libretro/mkLibretroCore.nix +++ b/pkgs/applications/emulators/libretro/mkLibretroCore.nix @@ -70,7 +70,8 @@ lib.extendMkDerivation { } .${stdenv.hostPlatform.parsed.cpu.name} or stdenv.hostPlatform.parsed.cpu.name }" - ] ++ makeFlags; + ] + ++ makeFlags; installPhase = '' runHook preInstall @@ -87,12 +88,14 @@ lib.extendMkDerivation { # libretro repos sometimes has a fake tag like "Current", ignore # it by setting hardcodeZeroVersion updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; - } // passthru; + } + // passthru; meta = { inherit mainProgram; inherit (retroarch-bare.meta) platforms; teams = [ lib.teams.libretro ]; - } // meta; + } + // meta; }; } diff --git a/pkgs/applications/emulators/mame/default.nix b/pkgs/applications/emulators/mame/default.nix index de509898c751..eea29cbf3b1f 100644 --- a/pkgs/applications/emulators/mame/default.nix +++ b/pkgs/applications/emulators/mame/default.nix @@ -75,33 +75,32 @@ stdenv.mkDerivation rec { ]; # https://docs.mamedev.org/initialsetup/compilingmame.html - buildInputs = - [ - expat - zlib - flac - portmidi - portaudio - utf8proc - libjpeg - rapidjson - pugixml - glm - SDL2 - SDL2_ttf - sqlite - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libpulseaudio - libXinerama - libXi - fontconfig - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libpcap - ]; + buildInputs = [ + expat + zlib + flac + portmidi + portaudio + utf8proc + libjpeg + rapidjson + pugixml + glm + SDL2 + SDL2_ttf + sqlite + qtbase + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libpulseaudio + libXinerama + libXi + fontconfig + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libpcap + ]; nativeBuildInputs = [ copyDesktopItems @@ -113,49 +112,47 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; - patches = - [ - # by default MAME assumes that paths with stock resources are relative and - # that you run MAME changing to install directory, so we add absolute paths - # here - ./001-use-absolute-paths.diff - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # coreaudio_sound.cpp compares __MAC_OS_X_VERSION_MIN_REQUIRED to 1200 - # instead of 120000, causing it to try to use a constant that isn't - # actually defined yet when targeting macOS 11 like Nixpkgs does. - # Backport mamedev/mame#13890 until the next time we update MAME. - (fetchpatch { - url = "https://patch-diff.githubusercontent.com/raw/mamedev/mame/pull/13890.patch"; - hash = "sha256-Fqpw4fHEMns4tSSIjc1p36ss+J9Tc/O0cnN3HI/ratM="; - }) - ]; + patches = [ + # by default MAME assumes that paths with stock resources are relative and + # that you run MAME changing to install directory, so we add absolute paths + # here + ./001-use-absolute-paths.diff + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # coreaudio_sound.cpp compares __MAC_OS_X_VERSION_MIN_REQUIRED to 1200 + # instead of 120000, causing it to try to use a constant that isn't + # actually defined yet when targeting macOS 11 like Nixpkgs does. + # Backport mamedev/mame#13890 until the next time we update MAME. + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/mamedev/mame/pull/13890.patch"; + hash = "sha256-Fqpw4fHEMns4tSSIjc1p36ss+J9Tc/O0cnN3HI/ratM="; + }) + ]; # Since the bug described in https://github.com/NixOS/nixpkgs/issues/135438, # it is not possible to use substituteAll - postPatch = - '' - for file in src/emu/emuopts.cpp src/osd/modules/lib/osdobj_common.cpp; do - substituteInPlace "$file" \ - --subst-var-by mamePath "$out/opt/mame" + postPatch = '' + for file in src/emu/emuopts.cpp src/osd/modules/lib/osdobj_common.cpp; do + substituteInPlace "$file" \ + --subst-var-by mamePath "$out/opt/mame" + done + '' + # MAME's build system uses `sw_vers` to test whether it needs to link with + # the Metal framework or not. However: + # a) that would return the build system's version, not the target's, and + # b) it can't actually find `sw_vers` in $PATH, so it thinks it's on macOS + # version 0, and doesn't link with Metal - causing missing symbol errors + # when it gets to the link step, because other parts of the build system + # _do_ use the correct target version number. + # This replaces the `sw_vers` call with the macOS version actually being + # targeted, so everything gets linked correctly. + + lib.optionalString stdenv.hostPlatform.isDarwin '' + for file in scripts/src/osd/{mac,sdl}.lua; do + substituteInPlace "$file" --replace-fail \ + 'backtick("sw_vers -productVersion")' \ + "os.getenv('MACOSX_DEPLOYMENT_TARGET') or '$darwinMinVersion'" done - '' - # MAME's build system uses `sw_vers` to test whether it needs to link with - # the Metal framework or not. However: - # a) that would return the build system's version, not the target's, and - # b) it can't actually find `sw_vers` in $PATH, so it thinks it's on macOS - # version 0, and doesn't link with Metal - causing missing symbol errors - # when it gets to the link step, because other parts of the build system - # _do_ use the correct target version number. - # This replaces the `sw_vers` call with the macOS version actually being - # targeted, so everything gets linked correctly. - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for file in scripts/src/osd/{mac,sdl}.lua; do - substituteInPlace "$file" --replace-fail \ - 'backtick("sw_vers -productVersion")' \ - "os.getenv('MACOSX_DEPLOYMENT_TARGET') or '$darwinMinVersion'" - done - ''; + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/applications/emulators/punes/default.nix b/pkgs/applications/emulators/punes/default.nix index 3bbe186ab360..1267a40b4b26 100644 --- a/pkgs/applications/emulators/punes/default.nix +++ b/pkgs/applications/emulators/punes/default.nix @@ -54,21 +54,20 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - ffmpeg - libGLU - qtbase - qtsvg - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libX11 - libXrandr - ] - ++ lib.optionals stdenv.hostPlatform.isBSD [ - sndio - ]; + buildInputs = [ + ffmpeg + libGLU + qtbase + qtsvg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libX11 + libXrandr + ] + ++ lib.optionals stdenv.hostPlatform.isBSD [ + sndio + ]; cmakeFlags = [ "-DENABLE_GIT_INFO=OFF" diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index 0ca31e9695be..6c3467b6e990 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -92,17 +92,16 @@ stdenv.mkDerivation ( # Fixes "Compiler cannot create executables" building wineWow with mingwSupport strictDeps = true; - nativeBuildInputs = - [ - bison - flex - fontforge - makeWrapper - pkg-config - ] - ++ lib.optionals supportFlags.mingwSupport ( - mingwGccs ++ lib.optional stdenv.hostPlatform.isDarwin setupHookDarwin - ); + nativeBuildInputs = [ + bison + flex + fontforge + makeWrapper + pkg-config + ] + ++ lib.optionals supportFlags.mingwSupport ( + mingwGccs ++ lib.optional stdenv.hostPlatform.isDarwin setupHookDarwin + ); buildInputs = toBuildInputs pkgArches ( with supportFlags; @@ -276,13 +275,12 @@ stdenv.mkDerivation ( # https://bugs.winehq.org/show_bug.cgi?id=43530 # https://github.com/NixOS/nixpkgs/issues/31989 - hardeningDisable = - [ - "bindnow" - "stackclashprotection" - ] - ++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify" - ++ lib.optional (supportFlags.mingwSupport) "format"; + hardeningDisable = [ + "bindnow" + "stackclashprotection" + ] + ++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify" + ++ lib.optional (supportFlags.mingwSupport) "format"; passthru = { inherit pkgArches; diff --git a/pkgs/applications/emulators/wine/sources.nix b/pkgs/applications/emulators/wine/sources.nix index 3c87299d12b3..153923218c77 100644 --- a/pkgs/applications/emulators/wine/sources.nix +++ b/pkgs/applications/emulators/wine/sources.nix @@ -113,7 +113,8 @@ rec { patches = [ # Also look for root certificates at $NIX_SSL_CERT_FILE ./cert-path.patch - ] ++ patches-binutils-2_44-fix-wine-older-than-10_2; + ] + ++ patches-binutils-2_44-fix-wine-older-than-10_2; updateScript = writeShellScript "update-wine-stable" ('' ${updateScriptPreamble} @@ -202,7 +203,8 @@ rec { patches = [ # Also look for root certificates at $NIX_SSL_CERT_FILE ./cert-path.patch - ] ++ patches-binutils-2_44-fix-wine-older-than-10_2; + ] + ++ patches-binutils-2_44-fix-wine-older-than-10_2; # see https://gitlab.winehq.org/wine/wine-staging staging = fetchFromGitLab { diff --git a/pkgs/applications/emulators/wine/staging.nix b/pkgs/applications/emulators/wine/staging.nix index 981d8f9e54f6..74619c225eee 100644 --- a/pkgs/applications/emulators/wine/staging.nix +++ b/pkgs/applications/emulators/wine/staging.nix @@ -33,19 +33,18 @@ wineUnstable.overrideAttrs (self: { perl python3 gitMinimal - ] ++ self.nativeBuildInputs; + ] + ++ self.nativeBuildInputs; - prePatch = - self.prePatch or "" - + '' - patchShebangs tools - cp -r ${patch}/patches ${patch}/staging . - chmod +w patches - patchShebangs ./patches/gitapply.sh - python3 ./staging/patchinstall.py DESTDIR="$PWD" --all ${ - lib.concatMapStringsSep " " (ps: "-W ${ps}") patch.disabledPatchsets - } - ''; + prePatch = self.prePatch or "" + '' + patchShebangs tools + cp -r ${patch}/patches ${patch}/staging . + chmod +w patches + patchShebangs ./patches/gitapply.sh + python3 ./staging/patchinstall.py DESTDIR="$PWD" --all ${ + lib.concatMapStringsSep " " (ps: "-W ${ps}") patch.disabledPatchsets + } + ''; }) // { meta = wineUnstable.meta // { diff --git a/pkgs/applications/gis/qgis/unwrapped-ltr.nix b/pkgs/applications/gis/qgis/unwrapped-ltr.nix index b3e5764e1f3a..a333dc11bdf8 100644 --- a/pkgs/applications/gis/qgis/unwrapped-ltr.nix +++ b/pkgs/applications/gis/qgis/unwrapped-ltr.nix @@ -108,41 +108,40 @@ mkDerivation rec { ninja ]; - buildInputs = - [ - draco - exiv2 - fcgi - geos - gsl - hdf5 - libpq - libspatialindex - libspatialite - libzip - netcdf - openssl - pdal - proj - protobuf - qca-qt5 - qscintilla - qt3d - qtbase - qtkeychain - qtlocation - qtmultimedia - qtsensors - qtserialport - qtxmlpatterns - qwt - sqlite - txt2tags - zstd - ] - ++ lib.optional withGrass grass - ++ lib.optional withWebKit qtwebkit - ++ pythonBuildInputs; + buildInputs = [ + draco + exiv2 + fcgi + geos + gsl + hdf5 + libpq + libspatialindex + libspatialite + libzip + netcdf + openssl + pdal + proj + protobuf + qca-qt5 + qscintilla + qt3d + qtbase + qtkeychain + qtlocation + qtmultimedia + qtsensors + qtserialport + qtxmlpatterns + qwt + sqlite + txt2tags + zstd + ] + ++ lib.optional withGrass grass + ++ lib.optional withWebKit qtwebkit + ++ pythonBuildInputs; patches = [ (replaceVars ./set-pyqt-package-dirs-ltr.patch { @@ -155,29 +154,28 @@ mkDerivation rec { # (offscreen is needed by "${APIS_SRC_DIR}/generate_console_pap.py") env.QT_QPA_PLATFORM_PLUGIN_PATH = "${qtbase}/${qtbase.qtPluginPrefix}/platforms"; - cmakeFlags = - [ - "-DWITH_3D=True" - "-DWITH_PDAL=True" - "-DENABLE_TESTS=False" - "-DQT_PLUGINS_DIR=${qtbase}/${qtbase.qtPluginPrefix}" + cmakeFlags = [ + "-DWITH_3D=True" + "-DWITH_PDAL=True" + "-DENABLE_TESTS=False" + "-DQT_PLUGINS_DIR=${qtbase}/${qtbase.qtPluginPrefix}" - # Remove for QGIS 3.42 - "-DCMAKE_POLICY_DEFAULT_CMP0175=OLD" - "-DCMAKE_POLICY_DEFAULT_CMP0177=OLD" - ] - ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" - ++ lib.optional withServer [ - "-DWITH_SERVER=True" - "-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin" - ] - ++ lib.optional withGrass ( - let - gmajor = lib.versions.major grass.version; - gminor = lib.versions.minor grass.version; - in - "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}" - ); + # Remove for QGIS 3.42 + "-DCMAKE_POLICY_DEFAULT_CMP0175=OLD" + "-DCMAKE_POLICY_DEFAULT_CMP0177=OLD" + ] + ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" + ++ lib.optional withServer [ + "-DWITH_SERVER=True" + "-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin" + ] + ++ lib.optional withGrass ( + let + gmajor = lib.versions.major grass.version; + gminor = lib.versions.minor grass.version; + in + "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}" + ); qtWrapperArgs = [ "--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase}/${qtbase.qtPluginPrefix}/platforms" diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix index 8ced638ea860..baa95a3a4679 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -108,41 +108,40 @@ mkDerivation rec { ninja ]; - buildInputs = - [ - draco - exiv2 - fcgi - geos - gsl - hdf5 - libspatialindex - libspatialite - libzip - netcdf - openssl - pdal - libpq - proj - protobuf - qca-qt5 - qscintilla - qt3d - qtbase - qtkeychain - qtlocation - qtmultimedia - qtsensors - qtserialport - qtxmlpatterns - qwt - sqlite - txt2tags - zstd - ] - ++ lib.optional withGrass grass - ++ lib.optional withWebKit qtwebkit - ++ pythonBuildInputs; + buildInputs = [ + draco + exiv2 + fcgi + geos + gsl + hdf5 + libspatialindex + libspatialite + libzip + netcdf + openssl + pdal + libpq + proj + protobuf + qca-qt5 + qscintilla + qt3d + qtbase + qtkeychain + qtlocation + qtmultimedia + qtsensors + qtserialport + qtxmlpatterns + qwt + sqlite + txt2tags + zstd + ] + ++ lib.optional withGrass grass + ++ lib.optional withWebKit qtwebkit + ++ pythonBuildInputs; patches = [ (replaceVars ./set-pyqt-package-dirs.patch { @@ -155,25 +154,24 @@ mkDerivation rec { # (offscreen is needed by "${APIS_SRC_DIR}/generate_console_pap.py") env.QT_QPA_PLATFORM_PLUGIN_PATH = "${qtbase}/${qtbase.qtPluginPrefix}/platforms"; - cmakeFlags = - [ - "-DWITH_3D=True" - "-DWITH_PDAL=True" - "-DENABLE_TESTS=False" - "-DQT_PLUGINS_DIR=${qtbase}/${qtbase.qtPluginPrefix}" - ] - ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" - ++ lib.optional withServer [ - "-DWITH_SERVER=True" - "-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin" - ] - ++ lib.optional withGrass ( - let - gmajor = lib.versions.major grass.version; - gminor = lib.versions.minor grass.version; - in - "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}" - ); + cmakeFlags = [ + "-DWITH_3D=True" + "-DWITH_PDAL=True" + "-DENABLE_TESTS=False" + "-DQT_PLUGINS_DIR=${qtbase}/${qtbase.qtPluginPrefix}" + ] + ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" + ++ lib.optional withServer [ + "-DWITH_SERVER=True" + "-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin" + ] + ++ lib.optional withGrass ( + let + gmajor = lib.versions.major grass.version; + gminor = lib.versions.minor grass.version; + in + "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}" + ); qtWrapperArgs = [ "--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase}/${qtbase.qtPluginPrefix}/platforms" diff --git a/pkgs/applications/gis/zombietrackergps/default.nix b/pkgs/applications/gis/zombietrackergps/default.nix index 2cd1c823521f..3cc6bf69e45c 100644 --- a/pkgs/applications/gis/zombietrackergps/default.nix +++ b/pkgs/applications/gis/zombietrackergps/default.nix @@ -21,17 +21,16 @@ mkDerivation rec { hash = "sha256-z/LFNRFdQQFxEWyAjcuGezRbTsv8z6Q6fK8NLjP4HNM="; }; - buildInputs = - [ - marble.dev - ] - ++ (with libsForQt5; [ - qtbase - qtcharts - qtsvg - qtwebengine - ldutils - ]); + buildInputs = [ + marble.dev + ] + ++ (with libsForQt5; [ + qtbase + qtcharts + qtsvg + qtwebengine + ldutils + ]); nativeBuildInputs = [ cmake diff --git a/pkgs/applications/graphics/ImageMagick/6.x.nix b/pkgs/applications/graphics/ImageMagick/6.x.nix index f1ec2668577b..b30cbc91e46d 100644 --- a/pkgs/applications/graphics/ImageMagick/6.x.nix +++ b/pkgs/applications/graphics/ImageMagick/6.x.nix @@ -88,20 +88,19 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - configureFlags = - [ - "--with-frozenpaths" - (lib.withFeatureAs (arch != null) "gcc-arch" arch) - (lib.withFeature librsvgSupport "rsvg") - (lib.withFeature liblqr1Support "lqr") - (lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts") - (lib.withFeature ghostscriptSupport "gslib") - ] - ++ lib.optionals stdenv.hostPlatform.isMinGW [ - # due to libxml2 being without DLLs ATM - "--enable-static" - "--disable-shared" - ]; + configureFlags = [ + "--with-frozenpaths" + (lib.withFeatureAs (arch != null) "gcc-arch" arch) + (lib.withFeature librsvgSupport "rsvg") + (lib.withFeature liblqr1Support "lqr") + (lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts") + (lib.withFeature ghostscriptSupport "gslib") + ] + ++ lib.optionals stdenv.hostPlatform.isMinGW [ + # due to libxml2 being without DLLs ATM + "--enable-static" + "--disable-shared" + ]; nativeBuildInputs = [ pkg-config @@ -124,35 +123,35 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional librsvgSupport librsvg ++ lib.optional openjpegSupport openjpeg; - propagatedBuildInputs = - [ fftw ] - ++ lib.optional bzip2Support bzip2 - ++ lib.optional freetypeSupport freetype - ++ lib.optional libjpegSupport libjpeg - ++ lib.optional lcms2Support lcms2 - ++ lib.optional libX11Support libX11 - ++ lib.optional libXtSupport libXt - ++ lib.optional libwebpSupport libwebp; + propagatedBuildInputs = [ + fftw + ] + ++ lib.optional bzip2Support bzip2 + ++ lib.optional freetypeSupport freetype + ++ lib.optional libjpegSupport libjpeg + ++ lib.optional lcms2Support lcms2 + ++ lib.optional libX11Support libX11 + ++ lib.optional libXtSupport libXt + ++ lib.optional libwebpSupport libwebp; doCheck = false; # fails 2 out of 76 tests - postInstall = - '' - (cd "$dev/include" && ln -s ImageMagick* ImageMagick) - moveToOutput "bin/*-config" "$dev" - moveToOutput "lib/ImageMagick-*/config-Q16" "$dev" # includes configure params - for file in "$dev"/bin/*-config; do - substituteInPlace "$file" --replace "${pkg-config}/bin/pkg-config -config" \ - ${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config - substituteInPlace "$file" --replace ${pkg-config}/bin/pkg-config \ - "PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config'" - done - '' - + lib.optionalString ghostscriptSupport '' - for la in $out/lib/*.la; do - sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la - done - ''; + postInstall = '' + (cd "$dev/include" && ln -s ImageMagick* ImageMagick) + moveToOutput "bin/*-config" "$dev" + moveToOutput "lib/ImageMagick-*/config-Q16" "$dev" # includes configure params + for file in "$dev"/bin/*-config; do + substituteInPlace "$file" --replace "${pkg-config}/bin/pkg-config -config" \ + ${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config + substituteInPlace "$file" --replace ${pkg-config}/bin/pkg-config \ + "PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config'" + done + '' + + lib.optionalString ghostscriptSupport '' + for la in $out/lib/*.la; do + sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la + done + ''; passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix index aed3d2193ff5..8221a7c82e33 100644 --- a/pkgs/applications/graphics/ImageMagick/default.nix +++ b/pkgs/applications/graphics/ImageMagick/default.nix @@ -103,85 +103,85 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - configureFlags = - [ - # specify delegates explicitly otherwise `convert` will invoke the build - # coreutils for filetypes it doesn't natively support. - "MVDelegate=${lib.getExe' coreutils "mv"}" - "RMDelegate=${lib.getExe' coreutils "rm"}" - "--with-frozenpaths" - (lib.withFeatureAs (arch != null) "gcc-arch" arch) - (lib.withFeature librsvgSupport "rsvg") - (lib.withFeature librsvgSupport "pango") - (lib.withFeature liblqr1Support "lqr") - (lib.withFeature libjxlSupport "jxl") - (lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts") - (lib.withFeature ghostscriptSupport "gslib") - (lib.withFeature fftwSupport "fftw") - ] - ++ lib.optionals stdenv.hostPlatform.isMinGW [ - # due to libxml2 being without DLLs ATM - "--enable-static" - "--disable-shared" - ]; + configureFlags = [ + # specify delegates explicitly otherwise `convert` will invoke the build + # coreutils for filetypes it doesn't natively support. + "MVDelegate=${lib.getExe' coreutils "mv"}" + "RMDelegate=${lib.getExe' coreutils "rm"}" + "--with-frozenpaths" + (lib.withFeatureAs (arch != null) "gcc-arch" arch) + (lib.withFeature librsvgSupport "rsvg") + (lib.withFeature librsvgSupport "pango") + (lib.withFeature liblqr1Support "lqr") + (lib.withFeature libjxlSupport "jxl") + (lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts") + (lib.withFeature ghostscriptSupport "gslib") + (lib.withFeature fftwSupport "fftw") + ] + ++ lib.optionals stdenv.hostPlatform.isMinGW [ + # due to libxml2 being without DLLs ATM + "--enable-static" + "--disable-shared" + ]; nativeBuildInputs = [ pkg-config libtool ]; - buildInputs = - [ potrace ] - ++ lib.optional zlibSupport zlib - ++ lib.optional fontconfigSupport fontconfig - ++ lib.optional ghostscriptSupport ghostscript - ++ lib.optional liblqr1Support liblqr1 - ++ lib.optional libpngSupport libpng - ++ lib.optional libraqmSupport libraqm - ++ lib.optional librawSupport libraw - ++ lib.optional libtiffSupport libtiff - ++ lib.optional libxml2Support libxml2 - ++ lib.optional libheifSupport libheif - ++ lib.optional djvulibreSupport djvulibre - ++ lib.optional libjxlSupport libjxl - ++ lib.optional openexrSupport openexr - ++ lib.optionals librsvgSupport [ - librsvg - pango - ] - ++ lib.optional openjpegSupport openjpeg; + buildInputs = [ + potrace + ] + ++ lib.optional zlibSupport zlib + ++ lib.optional fontconfigSupport fontconfig + ++ lib.optional ghostscriptSupport ghostscript + ++ lib.optional liblqr1Support liblqr1 + ++ lib.optional libpngSupport libpng + ++ lib.optional libraqmSupport libraqm + ++ lib.optional librawSupport libraw + ++ lib.optional libtiffSupport libtiff + ++ lib.optional libxml2Support libxml2 + ++ lib.optional libheifSupport libheif + ++ lib.optional djvulibreSupport djvulibre + ++ lib.optional libjxlSupport libjxl + ++ lib.optional openexrSupport openexr + ++ lib.optionals librsvgSupport [ + librsvg + pango + ] + ++ lib.optional openjpegSupport openjpeg; - propagatedBuildInputs = - [ curl ] - ++ lib.optional bzip2Support bzip2 - ++ lib.optional freetypeSupport freetype - ++ lib.optional libjpegSupport libjpeg - ++ lib.optional lcms2Support lcms2 - ++ lib.optional libX11Support libX11 - ++ lib.optional libXtSupport libXt - ++ lib.optional libwebpSupport libwebp - ++ lib.optional fftwSupport fftw; + propagatedBuildInputs = [ + curl + ] + ++ lib.optional bzip2Support bzip2 + ++ lib.optional freetypeSupport freetype + ++ lib.optional libjpegSupport libjpeg + ++ lib.optional lcms2Support lcms2 + ++ lib.optional libX11Support libX11 + ++ lib.optional libXtSupport libXt + ++ lib.optional libwebpSupport libwebp + ++ lib.optional fftwSupport fftw; - postInstall = - '' - (cd "$dev/include" && ln -s ImageMagick* ImageMagick) - # Q16HDRI = 16 bit quantum depth with HDRI support, and is the default ImageMagick configuration - # If the default is changed, or the derivation is modified to use a different configuration - # this will need to be changed below. - moveToOutput "bin/*-config" "$dev" - moveToOutput "lib/ImageMagick-*/config-Q16HDRI" "$dev" # includes configure params - configDestination=($out/share/ImageMagick-*) - grep -v '/nix/store' $dev/lib/ImageMagick-*/config-Q16HDRI/configure.xml > $configDestination/configure.xml - for file in "$dev"/bin/*-config; do - substituteInPlace "$file" --replace pkg-config \ - "PKG_CONFIG_PATH='$dev/lib/pkgconfig' '$(command -v $PKG_CONFIG)'" - done - '' - + lib.optionalString ghostscriptSupport '' - for la in $out/lib/*.la; do - sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la - done - ''; + postInstall = '' + (cd "$dev/include" && ln -s ImageMagick* ImageMagick) + # Q16HDRI = 16 bit quantum depth with HDRI support, and is the default ImageMagick configuration + # If the default is changed, or the derivation is modified to use a different configuration + # this will need to be changed below. + moveToOutput "bin/*-config" "$dev" + moveToOutput "lib/ImageMagick-*/config-Q16HDRI" "$dev" # includes configure params + configDestination=($out/share/ImageMagick-*) + grep -v '/nix/store' $dev/lib/ImageMagick-*/config-Q16HDRI/configure.xml > $configDestination/configure.xml + for file in "$dev"/bin/*-config; do + substituteInPlace "$file" --replace pkg-config \ + "PKG_CONFIG_PATH='$dev/lib/pkgconfig' '$(command -v $PKG_CONFIG)'" + done + '' + + lib.optionalString ghostscriptSupport '' + for la in $out/lib/*.la; do + sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la + done + ''; passthru.tests = { version = testers.testVersion { package = finalAttrs.finalPackage; }; diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix index 6d32b12e7115..e33100980a8b 100644 --- a/pkgs/applications/graphics/apitrace/default.nix +++ b/pkgs/applications/graphics/apitrace/default.nix @@ -30,27 +30,25 @@ stdenv.mkDerivation rec { # LD_PRELOAD wrappers need to be statically linked to work against all kinds # of games -- so it's fine to use e.g. bundled snappy. - buildInputs = - [ - libX11 - procps - libdwarf - gtest - brotli - ] - ++ lib.optionals enableGui [ - qtbase - ]; + buildInputs = [ + libX11 + procps + libdwarf + gtest + brotli + ] + ++ lib.optionals enableGui [ + qtbase + ]; - nativeBuildInputs = - [ - cmake - pkg-config - python3 - ] - ++ lib.optionals enableGui [ - wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + python3 + ] + ++ lib.optionals enableGui [ + wrapQtAppsHook + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_GUI" enableGui) @@ -60,45 +58,44 @@ stdenv.mkDerivation rec { # `qapitrace`. dontWrapQtApps = true; - postFixup = - '' + postFixup = '' - # Since https://github.com/NixOS/nixpkgs/pull/60985, we add `/run-opengl-driver[-32]` - # to the `RUNPATH` of dispatcher libraries `dlopen()` ing OpenGL drivers. - # `RUNPATH` doesn't propagate throughout the whole application, but only - # from the module performing the `dlopen()`. - # - # Apitrace wraps programs by running them with `LD_PRELOAD` pointing to `.so` - # files in $out/lib/apitrace/wrappers. - # - # Theses wrappers effectively wrap the `dlopen()` calls from `libglvnd` - # and other dispatcher libraries, and run `dlopen()` by themselves. - # - # As `RUNPATH` doesn't propagate through the whole library, and they're now the - # library doing the real `dlopen()`, they also need to have - # `/run-opengl-driver[-32]` added to their `RUNPATH`. - # - # To stay simple, we add paths for 32 and 64 bits unconditionally. - # This doesn't have an impact on closure size, and if the 32 bit drivers - # are not available, that folder is ignored. - for i in $out/lib/apitrace/wrappers/*.so - do - echo "Patching OpenGL driver path for $i" - patchelf --set-rpath "/run/opengl-driver/lib:/run/opengl-driver-32/lib:$(patchelf --print-rpath $i)" $i - done + # Since https://github.com/NixOS/nixpkgs/pull/60985, we add `/run-opengl-driver[-32]` + # to the `RUNPATH` of dispatcher libraries `dlopen()` ing OpenGL drivers. + # `RUNPATH` doesn't propagate throughout the whole application, but only + # from the module performing the `dlopen()`. + # + # Apitrace wraps programs by running them with `LD_PRELOAD` pointing to `.so` + # files in $out/lib/apitrace/wrappers. + # + # Theses wrappers effectively wrap the `dlopen()` calls from `libglvnd` + # and other dispatcher libraries, and run `dlopen()` by themselves. + # + # As `RUNPATH` doesn't propagate through the whole library, and they're now the + # library doing the real `dlopen()`, they also need to have + # `/run-opengl-driver[-32]` added to their `RUNPATH`. + # + # To stay simple, we add paths for 32 and 64 bits unconditionally. + # This doesn't have an impact on closure size, and if the 32 bit drivers + # are not available, that folder is ignored. + for i in $out/lib/apitrace/wrappers/*.so + do + echo "Patching OpenGL driver path for $i" + patchelf --set-rpath "/run/opengl-driver/lib:/run/opengl-driver-32/lib:$(patchelf --print-rpath $i)" $i + done - # Theses open the OpenGL driver at runtime, but it is not listed as NEEDED libraries. They need - # a reference to libglvnd. - for i in $out/bin/eglretrace $out/bin/glretrace - do - echo "Patching RPath for $i" - patchelf --set-rpath "${lib.makeLibraryPath [ libglvnd ]}:$(patchelf --print-rpath $i)" $i - done + # Theses open the OpenGL driver at runtime, but it is not listed as NEEDED libraries. They need + # a reference to libglvnd. + for i in $out/bin/eglretrace $out/bin/glretrace + do + echo "Patching RPath for $i" + patchelf --set-rpath "${lib.makeLibraryPath [ libglvnd ]}:$(patchelf --print-rpath $i)" $i + done - '' - + lib.optionalString enableGui '' - wrapQtApp $out/bin/qapitrace - ''; + '' + + lib.optionalString enableGui '' + wrapQtApp $out/bin/qapitrace + ''; meta = with lib; { homepage = "https://apitrace.github.io"; diff --git a/pkgs/applications/graphics/drawio/default.nix b/pkgs/applications/graphics/drawio/default.nix index f9ad7182c1ca..974c5869b55c 100644 --- a/pkgs/applications/graphics/drawio/default.nix +++ b/pkgs/applications/graphics/drawio/default.nix @@ -35,19 +35,18 @@ stdenv.mkDerivation rec { hash = "sha256-kmA0z/vmWH+yD2OQ6VVSE0yPxInTAGjjG+QfcoZHlQ0="; }; - nativeBuildInputs = - [ - fixup-yarn-lock - makeWrapper - nodejs - yarn - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - copyDesktopItems - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + fixup-yarn-lock + makeWrapper + nodejs + yarn + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + copyDesktopItems + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + autoSignDarwinBinariesHook + ]; ELECTRON_SKIP_BINARY_DOWNLOAD = true; @@ -66,53 +65,51 @@ stdenv.mkDerivation rec { runHook postConfigure ''; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - cp -R ${electron.dist}/Electron.app Electron.app - chmod -R u+w Electron.app - export CSC_IDENTITY_AUTO_DISCOVERY=false - sed -i "/afterSign/d" electron-builder-linux-mac.json - '' - + '' - yarn --offline run electron-builder --dir \ - ${lib.optionalString stdenv.hostPlatform.isDarwin "--config electron-builder-linux-mac.json"} \ - -c.electronDist=${if stdenv.hostPlatform.isDarwin then "." else electron.dist} \ - -c.electronVersion=${electron.version} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + cp -R ${electron.dist}/Electron.app Electron.app + chmod -R u+w Electron.app + export CSC_IDENTITY_AUTO_DISCOVERY=false + sed -i "/afterSign/d" electron-builder-linux-mac.json + '' + + '' + yarn --offline run electron-builder --dir \ + ${lib.optionalString stdenv.hostPlatform.isDarwin "--config electron-builder-linux-mac.json"} \ + -c.electronDist=${if stdenv.hostPlatform.isDarwin then "." else electron.dist} \ + -c.electronVersion=${electron.version} - runHook postBuild - ''; + runHook postBuild + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/{Applications,bin} - mv dist/mac*/draw.io.app $out/Applications + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/{Applications,bin} + mv dist/mac*/draw.io.app $out/Applications - # Symlinking `draw.io` doesn't work; seems to look for files in the wrong place. - makeWrapper $out/Applications/draw.io.app/Contents/MacOS/draw.io $out/bin/drawio - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - mkdir -p "$out/share/lib/drawio" - cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/drawio" + # Symlinking `draw.io` doesn't work; seems to look for files in the wrong place. + makeWrapper $out/Applications/draw.io.app/Contents/MacOS/draw.io $out/bin/drawio + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + mkdir -p "$out/share/lib/drawio" + cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/drawio" - install -Dm644 build/icon.svg "$out/share/icons/hicolor/scalable/apps/drawio.svg" + install -Dm644 build/icon.svg "$out/share/icons/hicolor/scalable/apps/drawio.svg" - makeWrapper '${electron}/bin/electron' "$out/bin/drawio" \ - --add-flags "$out/share/lib/drawio/resources/app.asar" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --inherit-argv0 - '' - + '' + makeWrapper '${electron}/bin/electron' "$out/bin/drawio" \ + --add-flags "$out/share/lib/drawio/resources/app.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --inherit-argv0 + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix index 4d74eb8c0fff..fdd7cd5186a0 100644 --- a/pkgs/applications/graphics/feh/default.nix +++ b/pkgs/applications/graphics/feh/default.nix @@ -44,13 +44,12 @@ stdenv.mkDerivation (finalAttrs: { libexif ]; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - "exif=1" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "verscmp=0" - ++ lib.optional enableAutoreload "inotify=1"; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "exif=1" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "verscmp=0" + ++ lib.optional enableAutoreload "inotify=1"; installTargets = [ "install" ]; postInstall = '' diff --git a/pkgs/applications/graphics/gimp/2.0/default.nix b/pkgs/applications/graphics/gimp/2.0/default.nix index e28e084ccb60..be4bed838edf 100644 --- a/pkgs/applications/graphics/gimp/2.0/default.nix +++ b/pkgs/applications/graphics/gimp/2.0/default.nix @@ -94,87 +94,84 @@ stdenv.mkDerivation (finalAttrs: { cp ${gettext}/share/gettext/m4/nls.m4 m4macros ''; - nativeBuildInputs = - [ - autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am - pkg-config - intltool - gettext - makeWrapper - gtk-doc - libxslt - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am + pkg-config + intltool + gettext + makeWrapper + gtk-doc + libxslt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; - buildInputs = - [ - babl - gegl - gtk2 - glib - gdk-pixbuf - pango - cairo - gexiv2 - harfbuzz - isocodes - freetype - fontconfig - lcms - libpng - libjpeg - libjxl - poppler - poppler_data - libtiff - openexr - libmng - librsvg - libwmf - zlib - libzip - ghostscript - aalib - shared-mime-info - libwebp - libheif - libexif - xorg.libXpm - glib-networking - libmypaint - mypaint-brushes1 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gtk-mac-integration-gtk2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libgudev - ] - ++ lib.optionals withPython [ - python - # Duplicated here because python.withPackages does not expose the dev output with pkg-config files - python2.pkgs.pygtk - ]; + buildInputs = [ + babl + gegl + gtk2 + glib + gdk-pixbuf + pango + cairo + gexiv2 + harfbuzz + isocodes + freetype + fontconfig + lcms + libpng + libjpeg + libjxl + poppler + poppler_data + libtiff + openexr + libmng + librsvg + libwmf + zlib + libzip + ghostscript + aalib + shared-mime-info + libwebp + libheif + libexif + xorg.libXpm + glib-networking + libmypaint + mypaint-brushes1 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gtk-mac-integration-gtk2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libgudev + ] + ++ lib.optionals withPython [ + python + # Duplicated here because python.withPackages does not expose the dev output with pkg-config files + python2.pkgs.pygtk + ]; # needed by gimp-2.0.pc propagatedBuildInputs = [ gegl ]; - configureFlags = - [ - "--without-webkit" # old version is required - "--disable-check-update" - "--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new" - "--with-icc-directory=/run/current-system/sw/share/color/icc" - # fix libdir in pc files (${exec_prefix} needs to be passed verbatim) - "--libdir=\${exec_prefix}/lib" - ] - ++ lib.optionals (!withPython) [ - "--disable-python" # depends on Python2 which was EOLed on 2020-01-01 - ]; + configureFlags = [ + "--without-webkit" # old version is required + "--disable-check-update" + "--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new" + "--with-icc-directory=/run/current-system/sw/share/color/icc" + # fix libdir in pc files (${exec_prefix} needs to be passed verbatim) + "--libdir=\${exec_prefix}/lib" + ] + ++ lib.optionals (!withPython) [ + "--disable-python" # depends on Python2 which was EOLed on 2020-01-01 + ]; enableParallelBuilding = true; diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index 6d720415a5e3..c33f3c4cef0e 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -120,98 +120,96 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - wrapGAppsHook3 - libxslt # for xsltproc - gobject-introspection - perl - vala + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + wrapGAppsHook3 + libxslt # for xsltproc + gobject-introspection + perl + vala - # for docs - gi-docgen + # for docs + gi-docgen - # for tests - desktop-file-utils - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - dbus - xvfb-run - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + # for tests + desktop-file-utils + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + dbus + xvfb-run + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; - buildInputs = - [ - appstream-glib # for library - babl - cfitsio - gegl - gtk3 - glib - gdk-pixbuf - pango - cairo - libarchive - gexiv2 - harfbuzz - isocodes - freetype - fontconfig - lcms - libpng - libiff - libilbm - libjpeg - libjxl - poppler - poppler_data - libtiff - openexr - libmng - librsvg - libwmf - zlib - libzip - ghostscript - aalib - shared-mime-info - json-glib - libwebp - libheif - python - libexif - xorg.libXpm - xorg.libXmu - glib-networking - libmypaint - mypaint-brushes1 + buildInputs = [ + appstream-glib # for library + babl + cfitsio + gegl + gtk3 + glib + gdk-pixbuf + pango + cairo + libarchive + gexiv2 + harfbuzz + isocodes + freetype + fontconfig + lcms + libpng + libiff + libilbm + libjpeg + libjxl + poppler + poppler_data + libtiff + openexr + libmng + librsvg + libwmf + zlib + libzip + ghostscript + aalib + shared-mime-info + json-glib + libwebp + libheif + python + libexif + xorg.libXpm + xorg.libXmu + glib-networking + libmypaint + mypaint-brushes1 - # New file dialogue crashes with “Icon 'image-missing' not present in theme Symbolic” without an icon theme. - adwaita-icon-theme + # New file dialogue crashes with “Icon 'image-missing' not present in theme Symbolic” without an icon theme. + adwaita-icon-theme - # for Lua plug-ins - (luajit.withPackages (pp: [ - pp.lgi - ])) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib + # for Lua plug-ins + (luajit.withPackages (pp: [ + pp.lgi + ])) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib - # for JavaScript plug-ins - gjs - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages.openmp - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libgudev - ]; + # for JavaScript plug-ins + gjs + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libgudev + ]; propagatedBuildInputs = [ # needed by gimp-3.0.pc @@ -221,21 +219,20 @@ stdenv.mkDerivation (finalAttrs: { gexiv2 ]; - mesonFlags = - [ - "-Dbug-report-url=https://github.com/NixOS/nixpkgs/issues/new" - "-Dicc-directory=/run/current-system/sw/share/color/icc" - "-Dcheck-update=no" - (lib.mesonEnable "gudev" stdenv.hostPlatform.isLinux) - (lib.mesonEnable "headless-tests" stdenv.hostPlatform.isLinux) - (lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux) - # Not very important to do downstream, save a dependency. - "-Dappdata-test=disabled" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-Dalsa=disabled" - "-Djavascript=disabled" - ]; + mesonFlags = [ + "-Dbug-report-url=https://github.com/NixOS/nixpkgs/issues/new" + "-Dicc-directory=/run/current-system/sw/share/color/icc" + "-Dcheck-update=no" + (lib.mesonEnable "gudev" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "headless-tests" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux) + # Not very important to do downstream, save a dependency. + "-Dappdata-test=disabled" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-Dalsa=disabled" + "-Djavascript=disabled" + ]; doCheck = true; diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix index 9c86343599b1..80944bfe21f8 100644 --- a/pkgs/applications/graphics/gimp/plugins/default.nix +++ b/pkgs/applications/graphics/gimp/plugins/default.nix @@ -63,12 +63,14 @@ lib.makeScope pkgs.newScope ( gimp gimp.gtk glib - ] ++ (attrs.buildInputs or [ ]); + ] + ++ (attrs.buildInputs or [ ]); nativeBuildInputs = [ pkg-config intltool - ] ++ (attrs.nativeBuildInputs or [ ]); + ] + ++ (attrs.nativeBuildInputs or [ ]); # Override installation paths. env = { @@ -76,7 +78,8 @@ lib.makeScope pkgs.newScope ( "${placeholder "out"}/${gimp.targetLibDir}"; "PKG_CONFIG_GIMP_${pkgConfigMajorVersion}_0_GIMPDATADIR" = "${placeholder "out"}/${gimp.targetDataDir}"; - } // attrs.env or { }; + } + // attrs.env or { }; } ); diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix index 2f71bf8d3506..8af3ee43bd5a 100644 --- a/pkgs/applications/graphics/inkscape/default.nix +++ b/pkgs/applications/graphics/inkscape/default.nix @@ -116,63 +116,61 @@ stdenv.mkDerivation (finalAttrs: { shopt -u globstar ''; - nativeBuildInputs = - [ - pkg-config - cmake - ninja - python3Env - glib # for setup hook - gdk-pixbuf # for setup hook - wrapGAppsHook3 - gobject-introspection - ] - ++ (with perlPackages; [ - perl - XMLParser - ]) - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + pkg-config + cmake + ninja + python3Env + glib # for setup hook + gdk-pixbuf # for setup hook + wrapGAppsHook3 + gobject-introspection + ] + ++ (with perlPackages; [ + perl + XMLParser + ]) + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; - buildInputs = - [ - boehmgc - boost - gettext - glib - glibmm - gsl - gtkmm3 - imagemagick - lcms - lib2geom - libcdr - libexif - libpng - librevenge - librsvg # for loading icons - libsigcxx - libvisio - libwpg - libXft - libxml2 - libxslt - perlPackages.perl - poppler - popt - potrace - python3Env - zlib - libepoxy - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - gspell - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cairo - gtk-mac-integration - ]; + buildInputs = [ + boehmgc + boost + gettext + glib + glibmm + gsl + gtkmm3 + imagemagick + lcms + lib2geom + libcdr + libexif + libpng + librevenge + librsvg # for loading icons + libsigcxx + libvisio + libwpg + libXft + libxml2 + libxslt + perlPackages.perl + poppler + popt + potrace + python3Env + zlib + libepoxy + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + gspell + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cairo + gtk-mac-integration + ]; # Make sure PyXML modules can be found at run-time. postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' diff --git a/pkgs/applications/graphics/ipe/default.nix b/pkgs/applications/graphics/ipe/default.nix index 28797da745d5..f34826525fce 100644 --- a/pkgs/applications/graphics/ipe/default.nix +++ b/pkgs/applications/graphics/ipe/default.nix @@ -41,39 +41,37 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; - buildInputs = - [ - cairo - freetype - ghostscript - gsl - libjpeg - libpng - libspiro - lua5 - qtbase - qtsvg - zlib - ] - ++ (lib.optionals withTeXLive [ - texliveSmall - ]) - ++ (lib.optionals withQVoronoi [ - qhull - ]); + buildInputs = [ + cairo + freetype + ghostscript + gsl + libjpeg + libpng + libspiro + lua5 + qtbase + qtsvg + zlib + ] + ++ (lib.optionals withTeXLive [ + texliveSmall + ]) + ++ (lib.optionals withQVoronoi [ + qhull + ]); - makeFlags = - [ - "-C src" - "IPEPREFIX=${placeholder "out"}" - "LUA_PACKAGE=lua" - "MOC=${buildPackages.qt6Packages.qtbase}/libexec/moc" - "IPE_NO_SPELLCHECK=1" # qtSpell is not yet packaged - ] - ++ (lib.optionals withQVoronoi [ - "IPEQVORONOI=1" - "QHULL_CFLAGS=-I${qhull}/include/libqhull_r" - ]); + makeFlags = [ + "-C src" + "IPEPREFIX=${placeholder "out"}" + "LUA_PACKAGE=lua" + "MOC=${buildPackages.qt6Packages.qtbase}/libexec/moc" + "IPE_NO_SPELLCHECK=1" # qtSpell is not yet packaged + ] + ++ (lib.optionals withQVoronoi [ + "IPEQVORONOI=1" + "QHULL_CFLAGS=-I${qhull}/include/libqhull_r" + ]); qtWrapperArgs = lib.optionals withTeXLive [ "--prefix PATH : ${lib.makeBinPath [ texliveSmall ]}" ]; diff --git a/pkgs/applications/graphics/mandelbulber/default.nix b/pkgs/applications/graphics/mandelbulber/default.nix index 00e61c66a7f1..775bec9560cc 100644 --- a/pkgs/applications/graphics/mandelbulber/default.nix +++ b/pkgs/applications/graphics/mandelbulber/default.nix @@ -34,19 +34,18 @@ stdenv.mkDerivation (finalAttrs: { libsForQt5.wrapQtAppsHook libsForQt5.qttools ]; - buildInputs = - [ - libsForQt5.qtbase - libsForQt5.qtmultimedia - libpng - gsl - libsndfile - lzo - ] - ++ lib.optionals withOpenCL [ - opencl-clhpp - ocl-icd - ]; + buildInputs = [ + libsForQt5.qtbase + libsForQt5.qtmultimedia + libpng + gsl + libsndfile + lzo + ] + ++ lib.optionals withOpenCL [ + opencl-clhpp + ocl-icd + ]; sourceRoot = "${finalAttrs.src.name}/mandelbulber2"; diff --git a/pkgs/applications/graphics/nufraw/default.nix b/pkgs/applications/graphics/nufraw/default.nix index 58624aa5199d..4cc234d9c138 100644 --- a/pkgs/applications/graphics/nufraw/default.nix +++ b/pkgs/applications/graphics/nufraw/default.nix @@ -63,23 +63,22 @@ stdenv.mkDerivation rec { substituteAll ${./nufraw.thumbnailer} $out/share/thumbnailers/${pname}.thumbnailer ''; - patches = - [ - # Fixes an upstream issue where headers with templates were included in an extern-C scope - # which caused the build to fail - (fetchpatch { - name = "0001-nufraw-glib-2.70.patch"; - url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0001-nufraw-glib-2.70.patch"; - hash = "sha256-XgzgjikWTcqymHa7bKmruNZaeb2/lpN19HXoRUt5rTk="; - }) - ] - ++ lib.optionals (lib.versionAtLeast exiv2.version "0.28") [ - (fetchpatch { - name = "0002-exiv2-error.patch"; - url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0002-exiv2-error.patch"; - hash = "sha256-40/Wwk1sWiaIWp077EYgP8jFO4k1cvf30heRDMYJw3M="; - }) - ]; + patches = [ + # Fixes an upstream issue where headers with templates were included in an extern-C scope + # which caused the build to fail + (fetchpatch { + name = "0001-nufraw-glib-2.70.patch"; + url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0001-nufraw-glib-2.70.patch"; + hash = "sha256-XgzgjikWTcqymHa7bKmruNZaeb2/lpN19HXoRUt5rTk="; + }) + ] + ++ lib.optionals (lib.versionAtLeast exiv2.version "0.28") [ + (fetchpatch { + name = "0002-exiv2-error.patch"; + url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0002-exiv2-error.patch"; + hash = "sha256-40/Wwk1sWiaIWp077EYgP8jFO4k1cvf30heRDMYJw3M="; + }) + ]; meta = with lib; { homepage = "https://nufraw.sourceforge.io/"; diff --git a/pkgs/applications/graphics/rawtherapee/default.nix b/pkgs/applications/graphics/rawtherapee/default.nix index f6c1a774886f..307e3cf403ba 100644 --- a/pkgs/applications/graphics/rawtherapee/default.nix +++ b/pkgs/applications/graphics/rawtherapee/default.nix @@ -55,61 +55,58 @@ stdenv.mkDerivation rec { --replace "/Applications" "${placeholder "out"}/Applications" ''; - nativeBuildInputs = - [ - cmake - pkg-config - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeWrapper - ]; + nativeBuildInputs = [ + cmake + pkg-config + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeWrapper + ]; - buildInputs = - [ - util-linux - libselinux - libsepol - lerc - libthai - libdatrie - libxkbcommon - libepoxy - libXtst - pixman - libpthreadstubs - gtkmm3 - libXau - libXdmcp - lcms2 - libiptcdata - fftw - expat - pcre2 - libsigcxx - lensfun - librsvg - exiv2 - libraw - libjxl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcanberra-gtk3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gtk-mac-integration - ]; + buildInputs = [ + util-linux + libselinux + libsepol + lerc + libthai + libdatrie + libxkbcommon + libepoxy + libXtst + pixman + libpthreadstubs + gtkmm3 + libXau + libXdmcp + lcms2 + libiptcdata + fftw + expat + pcre2 + libsigcxx + lensfun + librsvg + exiv2 + libraw + libjxl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcanberra-gtk3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gtk-mac-integration + ]; - cmakeFlags = - [ - "-DPROC_TARGET_NUMBER=2" - "-DCACHE_NAME_SUFFIX=\"\"" - "-DWITH_SYSTEM_LIBRAW=\"ON\"" - "-DWITH_JXL=\"ON\"" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}" - ]; + cmakeFlags = [ + "-DPROC_TARGET_NUMBER=2" + "-DCACHE_NAME_SUFFIX=\"\"" + "-DWITH_SYSTEM_LIBRAW=\"ON\"" + "-DWITH_JXL=\"ON\"" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}" + ]; CMAKE_CXX_FLAGS = toString [ "-std=c++11" diff --git a/pkgs/applications/graphics/sane/backends/default.nix b/pkgs/applications/graphics/sane/backends/default.nix index 66fd491c99a4..c586ed806c73 100644 --- a/pkgs/applications/graphics/sane/backends/default.nix +++ b/pkgs/applications/graphics/sane/backends/default.nix @@ -95,34 +95,34 @@ stdenv.mkDerivation rec { python3 ]; - buildInputs = - [ - avahi - libgphoto2 - libjpeg - libpng - libtiff - libusb1 - curl - libxml2 - poppler - gawk - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libieee1284 - libv4l - net-snmp - ] - ++ lib.optionals withSystemd [ - systemd - ]; + buildInputs = [ + avahi + libgphoto2 + libjpeg + libpng + libtiff + libusb1 + curl + libxml2 + poppler + gawk + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libieee1284 + libv4l + net-snmp + ] + ++ lib.optionals withSystemd [ + systemd + ]; enableParallelBuilding = true; - configureFlags = - [ "--with-lockdir=/var/lock/sane" ] - ++ lib.optional (avahi != null) "--with-avahi" - ++ lib.optional (libusb1 != null) "--with-usb"; + configureFlags = [ + "--with-lockdir=/var/lock/sane" + ] + ++ lib.optional (avahi != null) "--with-avahi" + ++ lib.optional (libusb1 != null) "--with-usb"; # autoconf check for HAVE_MMAP is never set on cross compilation. # The pieusb backend fails compilation if HAVE_MMAP is not set. diff --git a/pkgs/applications/graphics/sane/config.nix b/pkgs/applications/graphics/sane/config.nix index 07cb0736690b..1d85bd850efb 100644 --- a/pkgs/applications/graphics/sane/config.nix +++ b/pkgs/applications/graphics/sane/config.nix @@ -39,18 +39,17 @@ stdenv.mkDerivation { name = "sane-config"; dontUnpack = true; - installPhase = - '' - function symlink () { - local target=$1 linkname=$2 - if [ -e "$linkname" ]; then - echo "warning: conflict for $linkname. Overriding $(readlink $linkname) with $target." - fi - ln -sfn "$target" "$linkname" - } + installPhase = '' + function symlink () { + local target=$1 linkname=$2 + if [ -e "$linkname" ]; then + echo "warning: conflict for $linkname. Overriding $(readlink $linkname) with $target." + fi + ln -sfn "$target" "$linkname" + } - mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane - '' - + (lib.concatMapStrings installSanePath paths) - + (lib.concatMapStrings disableBackend disabledDefaultBackends); + mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane + '' + + (lib.concatMapStrings installSanePath paths) + + (lib.concatMapStrings disableBackend disabledDefaultBackends); } diff --git a/pkgs/applications/graphics/sane/frontends.nix b/pkgs/applications/graphics/sane/frontends.nix index 280b0b846368..a4615d6cc625 100644 --- a/pkgs/applications/graphics/sane/frontends.nix +++ b/pkgs/applications/graphics/sane/frontends.nix @@ -65,7 +65,8 @@ stdenv.mkDerivation rec { sane-backends libX11 gtk2 - ] ++ lib.optional (libusb-compat-0_1 != null) libusb-compat-0_1; + ] + ++ lib.optional (libusb-compat-0_1 != null) libusb-compat-0_1; nativeBuildInputs = [ pkg-config ]; enableParallelBuilding = true; diff --git a/pkgs/applications/graphics/sane/xsane.nix b/pkgs/applications/graphics/sane/xsane.nix index ab07837bc678..d575092d9bf3 100644 --- a/pkgs/applications/graphics/sane/xsane.nix +++ b/pkgs/applications/graphics/sane/xsane.nix @@ -123,7 +123,8 @@ stdenv.mkDerivation rec { sane-frontends libX11 gtk2 - ] ++ lib.optional gimpSupport gimp; + ] + ++ lib.optional gimpSupport gimp; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/applications/kde/ark/default.nix b/pkgs/applications/kde/ark/default.nix index 931282c7f282..3a3a5810e8b7 100644 --- a/pkgs/applications/kde/ark/default.nix +++ b/pkgs/applications/kde/ark/default.nix @@ -33,7 +33,8 @@ let p7zip lrzip unar - ] ++ lib.optional unfreeEnableUnrar unrar; + ] + ++ lib.optional unfreeEnableUnrar unrar; in mkDerivation { @@ -52,7 +53,8 @@ mkDerivation { buildInputs = [ libarchive libzip - ] ++ extraTools; + ] + ++ extraTools; propagatedBuildInputs = [ breeze-icons diff --git a/pkgs/applications/kde/audiotube.nix b/pkgs/applications/kde/audiotube.nix index 9bd199d99296..f2b815c9699d 100644 --- a/pkgs/applications/kde/audiotube.nix +++ b/pkgs/applications/kde/audiotube.nix @@ -30,27 +30,26 @@ mkDerivation rec { python3Packages.pybind11 ]; - buildInputs = - [ - futuresql - kcoreaddons - kcrash - ki18n - kirigami2 - kirigami-addons - kpurpose - qcoro - qtimageformats - qtmultimedia - qtquickcontrols2 - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gstreamer - ]) - ++ pythonPath; + buildInputs = [ + futuresql + kcoreaddons + kcrash + ki18n + kirigami2 + kirigami-addons + kpurpose + qcoro + qtimageformats + qtmultimedia + qtquickcontrols2 + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gstreamer + ]) + ++ pythonPath; pythonPath = with python3Packages; [ yt-dlp diff --git a/pkgs/applications/kde/cantor.nix b/pkgs/applications/kde/cantor.nix index 6af2b207ed41..cd9d8751ba8c 100644 --- a/pkgs/applications/kde/cantor.nix +++ b/pkgs/applications/kde/cantor.nix @@ -64,46 +64,46 @@ mkDerivation { qttools ]; - buildInputs = - [ - qtbase - qtsvg - qtwebengine - qtxmlpatterns + buildInputs = [ + qtbase + qtsvg + qtwebengine + qtxmlpatterns - poppler + poppler - karchive - kcompletion - kconfig - kcoreaddons - kcrash - kdoctools - ki18n - kiconthemes - kio - knewstuff - kparts - kpty - ktexteditor - ktextwidgets - kxmlgui - syntax-highlighting + karchive + kcompletion + kconfig + kcoreaddons + kcrash + kdoctools + ki18n + kiconthemes + kio + knewstuff + kparts + kpty + ktexteditor + ktextwidgets + kxmlgui + syntax-highlighting - libspectre - ] - # backends - ++ lib.optional withAnalitza analitza - ++ lib.optional wtihJulia julia - ++ lib.optional withQalculate libqalculate - ++ lib.optional withLua luajit - ++ lib.optional withPython python3 - ++ lib.optional withR R - ++ lib.optional withSage sage-with-env; + libspectre + ] + # backends + ++ lib.optional withAnalitza analitza + ++ lib.optional wtihJulia julia + ++ lib.optional withQalculate libqalculate + ++ lib.optional withLua luajit + ++ lib.optional withPython python3 + ++ lib.optional withR R + ++ lib.optional withSage sage-with-env; qtWrapperArgs = [ "--prefix PATH : ${placeholder "out"}/bin" - ] ++ lib.optional withSage "--prefix PATH : ${sage-with-env}/bin"; + ] + ++ lib.optional withSage "--prefix PATH : ${sage-with-env}/bin"; # Causes failures on Hydra and ofborg from some reason enableParallelBuilding = false; diff --git a/pkgs/applications/kde/falkon.nix b/pkgs/applications/kde/falkon.nix index c1dca31d9f2a..e696acd20077 100644 --- a/pkgs/applications/kde/falkon.nix +++ b/pkgs/applications/kde/falkon.nix @@ -42,7 +42,8 @@ mkDerivation { kpurpose karchive kio - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ]; nativeBuildInputs = [ cmake diff --git a/pkgs/applications/kde/okular.nix b/pkgs/applications/kde/okular.nix index d604b800d7ba..10ed1ebb0a96 100644 --- a/pkgs/applications/kde/okular.nix +++ b/pkgs/applications/kde/okular.nix @@ -84,7 +84,8 @@ mkDerivation { kcrash chmlib qtx11extras - ] ++ lib.optional withSpeech qtspeech; + ] + ++ lib.optional withSpeech qtspeech; # InitialPreference values are too high and end up making okular # default for anything considered text/plain. Resetting to 1, which diff --git a/pkgs/applications/kde/plasmatube/default.nix b/pkgs/applications/kde/plasmatube/default.nix index c36554b5705d..b9f4602a731f 100644 --- a/pkgs/applications/kde/plasmatube/default.nix +++ b/pkgs/applications/kde/plasmatube/default.nix @@ -22,22 +22,21 @@ mkDerivation { wrapGAppsHook3 ]; - buildInputs = - [ - kcoreaddons - kdeclarative - ki18n - kirigami2 - mpv - qtmultimedia - qtquickcontrols2 - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gstreamer - ]); + buildInputs = [ + kcoreaddons + kdeclarative + ki18n + kirigami2 + mpv + qtmultimedia + qtquickcontrols2 + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gstreamer + ]); qtWrapperArgs = [ "--prefix" diff --git a/pkgs/applications/maui/booth.nix b/pkgs/applications/maui/booth.nix index adf9a1b68cdf..d38f4b47dfbb 100644 --- a/pkgs/applications/maui/booth.nix +++ b/pkgs/applications/maui/booth.nix @@ -23,24 +23,23 @@ mkDerivation { extra-cmake-modules ]; - buildInputs = - [ - kcoreaddons - ki18n - kirigami2 - mauikit - mauikit-filebrowsing - prison - qtgraphicaleffects - qtmultimedia - qtquickcontrols2 - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gstreamer - ]); + buildInputs = [ + kcoreaddons + ki18n + kirigami2 + mauikit + mauikit-filebrowsing + prison + qtgraphicaleffects + qtmultimedia + qtquickcontrols2 + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gstreamer + ]); preFixup = '' qtWrapperArgs+=( diff --git a/pkgs/applications/misc/avalonia-ilspy/default.nix b/pkgs/applications/misc/avalonia-ilspy/default.nix index 69aeb11e2bbd..45e3a7f02b70 100644 --- a/pkgs/applications/misc/avalonia-ilspy/default.nix +++ b/pkgs/applications/misc/avalonia-ilspy/default.nix @@ -39,18 +39,17 @@ buildDotnetModule rec { ./dotnet-8-upgrade.patch ]; - nativeBuildInputs = - [ - copyDesktopItems - icoutils - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - bintools - fixDarwinDylibNames - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + copyDesktopItems + icoutils + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + bintools + fixDarwinDylibNames + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ]; buildInputs = [ # Dependencies of nuget packages w/ native binaries @@ -71,20 +70,19 @@ buildDotnetModule rec { glew ]; - postInstall = - '' - icotool --icon -x ILSpy/ILSpy.ico - for i in 16 32 48 256; do - size=''${i}x''${i} - install -Dm444 *_''${size}x32.png $out/share/icons/hicolor/$size/apps/ILSpy.png - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install -Dm444 ILSpy/Info.plist $out/Applications/ILSpy.app/Contents/Info.plist - install -Dm444 ILSpy/ILSpy.icns $out/Applications/ILSpy.app/Contents/Resources/ILSpy.icns - mkdir -p $out/Applications/ILSpy.app/Contents/MacOS - ln -s $out/bin/ILSpy $out/Applications/ILSpy.app/Contents/MacOS/ILSpy - ''; + postInstall = '' + icotool --icon -x ILSpy/ILSpy.ico + for i in 16 32 48 256; do + size=''${i}x''${i} + install -Dm444 *_''${size}x32.png $out/share/icons/hicolor/$size/apps/ILSpy.png + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install -Dm444 ILSpy/Info.plist $out/Applications/ILSpy.app/Contents/Info.plist + install -Dm444 ILSpy/ILSpy.icns $out/Applications/ILSpy.app/Contents/Resources/ILSpy.icns + mkdir -p $out/Applications/ILSpy.app/Contents/MacOS + ln -s $out/bin/ILSpy $out/Applications/ILSpy.app/Contents/MacOS/ILSpy + ''; dotnet-sdk = dotnetCorePackages.sdk_8_0; diff --git a/pkgs/applications/misc/clight/clightd.nix b/pkgs/applications/misc/clight/clightd.nix index 39d442fab648..53678a29813e 100644 --- a/pkgs/applications/misc/clight/clightd.nix +++ b/pkgs/applications/misc/clight/clightd.nix @@ -49,18 +49,17 @@ stdenv.mkDerivation rec { sed -i "s@pkg_get_variable(POLKIT_ACTION_DIR.*@set(POLKIT_ACTION_DIR $POLKIT_ACTION_DIR)@" CMakeLists.txt ''; - cmakeFlags = - [ - "-DSYSTEMD_SERVICE_DIR=${placeholder "out"}/lib/systemd/system" - "-DDBUS_CONFIG_DIR=${placeholder "out"}/etc/dbus-1/system.d" - # systemd.pc has prefix=${systemd.out} - "-DMODULE_LOAD_DIR=${placeholder "out"}/lib/modules-load.d" - ] - ++ lib.optional enableDdc "-DENABLE_DDC=1" - ++ lib.optional enableDpms "-DENABLE_DPMS=1" - ++ lib.optional enableGamma "-DENABLE_GAMMA=1" - ++ lib.optional enableScreen "-DENABLE_SCREEN=1" - ++ lib.optional enableYoctolight "-DENABLE_YOCTOLIGHT=1"; + cmakeFlags = [ + "-DSYSTEMD_SERVICE_DIR=${placeholder "out"}/lib/systemd/system" + "-DDBUS_CONFIG_DIR=${placeholder "out"}/etc/dbus-1/system.d" + # systemd.pc has prefix=${systemd.out} + "-DMODULE_LOAD_DIR=${placeholder "out"}/lib/modules-load.d" + ] + ++ lib.optional enableDdc "-DENABLE_DDC=1" + ++ lib.optional enableDpms "-DENABLE_DPMS=1" + ++ lib.optional enableGamma "-DENABLE_GAMMA=1" + ++ lib.optional enableScreen "-DENABLE_SCREEN=1" + ++ lib.optional enableYoctolight "-DENABLE_YOCTOLIGHT=1"; depsBuildBuild = [ pkg-config @@ -72,28 +71,27 @@ stdenv.mkDerivation rec { wayland-scanner ]; - buildInputs = - [ - dbus - glib - udev - polkit - libusb1 - libjpeg - libmodule - libiio + buildInputs = [ + dbus + glib + udev + polkit + libusb1 + libjpeg + libmodule + libiio - libXdmcp - util-linux - libpthreadstubs - ] - ++ lib.optionals enableDdc [ ddcutil ] - ++ lib.optionals enableDpms [ libXext ] - ++ lib.optionals enableGamma [ libXrandr ] - ++ lib.optionals (enableDpms || enableGamma || enableScreen) [ - libdrm - wayland - ]; + libXdmcp + util-linux + libpthreadstubs + ] + ++ lib.optionals enableDdc [ ddcutil ] + ++ lib.optionals enableDpms [ libXext ] + ++ lib.optionals enableGamma [ libXrandr ] + ++ lib.optionals (enableDpms || enableGamma || enableScreen) [ + libdrm + wayland + ]; postInstall = '' mkdir -p $out/bin diff --git a/pkgs/applications/misc/clight/default.nix b/pkgs/applications/misc/clight/default.nix index 820e1f3d62fd..9211941c5ebf 100644 --- a/pkgs/applications/misc/clight/default.nix +++ b/pkgs/applications/misc/clight/default.nix @@ -36,19 +36,18 @@ stdenv.mkDerivation rec { bash-completion ]; - buildInputs = - [ - gsl - popt - upower - clightd - systemd - geoclue2 - libconfig - libmodule - ] - ++ lib.optional withGeoclue geoclue2 - ++ lib.optional withUpower upower; + buildInputs = [ + gsl + popt + upower + clightd + systemd + geoclue2 + libconfig + libmodule + ] + ++ lib.optional withGeoclue geoclue2 + ++ lib.optional withUpower upower; cmakeFlags = [ "-DSESSION_BUS_DIR=${placeholder "out"}/share/dbus-1/services" diff --git a/pkgs/applications/misc/electrum/grs.nix b/pkgs/applications/misc/electrum/grs.nix index 5c537eaab08b..e38374263361 100644 --- a/pkgs/applications/misc/electrum/grs.nix +++ b/pkgs/applications/misc/electrum/grs.nix @@ -87,28 +87,27 @@ python3.pkgs.buildPythonApplication { pyqt6 ]; - postPatch = - '' - # make compatible with protobuf4 by easing dependencies ... - substituteInPlace ./contrib/requirements/requirements.txt \ - --replace "protobuf>=3.20,<4" "protobuf>=3.20" - # ... and regenerating the paymentrequest_pb2.py file - protoc --python_out=. electrum_grs/paymentrequest.proto + postPatch = '' + # make compatible with protobuf4 by easing dependencies ... + substituteInPlace ./contrib/requirements/requirements.txt \ + --replace "protobuf>=3.20,<4" "protobuf>=3.20" + # ... and regenerating the paymentrequest_pb2.py file + protoc --python_out=. electrum_grs/paymentrequest.proto - substituteInPlace ./electrum_grs/ecc_fast.py \ - --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} - '' - + ( - if enableQt then - '' - substituteInPlace ./electrum_grs/qrscanner.py \ - --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} - '' - else - '' - sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt - '' - ); + substituteInPlace ./electrum_grs/ecc_fast.py \ + --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} + '' + + ( + if enableQt then + '' + substituteInPlace ./electrum_grs/qrscanner.py \ + --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} + '' + else + '' + sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt + '' + ); postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' substituteInPlace $out/share/applications/electrum-grs.desktop \ diff --git a/pkgs/applications/misc/electrum/ltc.nix b/pkgs/applications/misc/electrum/ltc.nix index 83853d45ec5e..268952e4747d 100644 --- a/pkgs/applications/misc/electrum/ltc.nix +++ b/pkgs/applications/misc/electrum/ltc.nix @@ -116,23 +116,22 @@ python3.pkgs.buildPythonApplication { protoc --proto_path=electrum_ltc/ --python_out=electrum_ltc/ electrum_ltc/paymentrequest.proto ''; - preBuild = - '' - sed -i 's,usr_share = .*,usr_share = "'$out'/share",g' setup.py - substituteInPlace ./electrum_ltc/ecc_fast.py \ - --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} - '' - + ( - if enableQt then - '' - substituteInPlace ./electrum_ltc/qrscanner.py \ - --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} - '' - else - '' - sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt - '' - ); + preBuild = '' + sed -i 's,usr_share = .*,usr_share = "'$out'/share",g' setup.py + substituteInPlace ./electrum_ltc/ecc_fast.py \ + --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} + '' + + ( + if enableQt then + '' + substituteInPlace ./electrum_ltc/qrscanner.py \ + --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} + '' + else + '' + sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt + '' + ); postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' # Despite setting usr_share above, these files are installed under diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix index 241207e275c5..7ef39d33b0b6 100644 --- a/pkgs/applications/misc/goldendict/default.nix +++ b/pkgs/applications/misc/goldendict/default.nix @@ -60,33 +60,32 @@ stdenv.mkDerivation rec { wrapQtAppsHook wrapGAppsHook3 ]; - buildInputs = - [ - qtbase - qtsvg - qtwebkit - qttools - libvorbis - hunspell - xz - lzo - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtx11extras - libXtst - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - bzip2 - libiconv - ] - ++ lib.optional withCC opencc - ++ lib.optional withEpwing libeb - ++ lib.optional withExtraTiff libtiff - ++ lib.optionals withFFmpeg [ - libao - ffmpeg - ] - ++ lib.optional withZim zstd; + buildInputs = [ + qtbase + qtsvg + qtwebkit + qttools + libvorbis + hunspell + xz + lzo + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtx11extras + libXtst + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + bzip2 + libiconv + ] + ++ lib.optional withCC opencc + ++ lib.optional withEpwing libeb + ++ lib.optional withExtraTiff libtiff + ++ lib.optionals withFFmpeg [ + libao + ffmpeg + ] + ++ lib.optional withZim zstd; qmakeFlags = [ "goldendict.pro" diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix index 917e2b333a1d..b295a61ac05e 100644 --- a/pkgs/applications/misc/gpsbabel/default.nix +++ b/pkgs/applications/misc/gpsbabel/default.nix @@ -38,50 +38,47 @@ stdenv.mkDerivation rec { patches = map fetchurl (import ./debian-patches.nix); - postPatch = - '' - patchShebangs testo - '' - + lib.optionalString withDoc '' - substituteInPlace gbversion.h.qmake.in \ - --replace /usr/share/doc $doc/share/doc + postPatch = '' + patchShebangs testo + '' + + lib.optionalString withDoc '' + substituteInPlace gbversion.h.qmake.in \ + --replace /usr/share/doc $doc/share/doc - substituteInPlace testo.d/serialization.test \ - --replace /usr/share/doc $doc/share/doc + substituteInPlace testo.d/serialization.test \ + --replace /usr/share/doc $doc/share/doc - substituteInPlace xmldoc/gpsbabel_man.xml \ - --replace /usr/share/doc $doc/share/doc - ''; + substituteInPlace xmldoc/gpsbabel_man.xml \ + --replace /usr/share/doc $doc/share/doc + ''; outputs = [ "out" ] ++ lib.optional withDoc "doc"; - nativeBuildInputs = - [ - pkg-config - qmake - ] - ++ lib.optionals withGUI [ - qttools - wrapQtAppsHook - ] - ++ lib.optionals withDoc [ - docbook_xml_dtd_45 - docbook_xsl - expat - fop - libxml2 - libxslt - perl - ]; + nativeBuildInputs = [ + pkg-config + qmake + ] + ++ lib.optionals withGUI [ + qttools + wrapQtAppsHook + ] + ++ lib.optionals withDoc [ + docbook_xml_dtd_45 + docbook_xsl + expat + fop + libxml2 + libxslt + perl + ]; - buildInputs = - [ - libusb1 - shapelib - zlib - ] - ++ lib.optional withGUI qtserialport - ++ lib.optional (withGUI && withMapPreview) qtwebengine; + buildInputs = [ + libusb1 + shapelib + zlib + ] + ++ lib.optional withGUI qtserialport + ++ lib.optional (withGUI && withMapPreview) qtwebengine; nativeCheckInputs = [ libxml2 @@ -92,15 +89,14 @@ stdenv.mkDerivation rec { lrelease gui/*.ts gui/coretool/*.ts ''; - qmakeFlags = - [ - "WITH_LIBUSB=pkgconfig" - "WITH_SHAPELIB=pkgconfig" - "WITH_ZLIB=pkgconfig" - ] - ++ lib.optionals (withGUI && !withMapPreview) [ - "CONFIG+=disable-mappreview" - ]; + qmakeFlags = [ + "WITH_LIBUSB=pkgconfig" + "WITH_SHAPELIB=pkgconfig" + "WITH_ZLIB=pkgconfig" + ] + ++ lib.optionals (withGUI && !withMapPreview) [ + "CONFIG+=disable-mappreview" + ]; makeFlags = lib.optional withGUI "gui" @@ -118,30 +114,29 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; - installPhase = - '' - install -Dm755 gpsbabel -t $out/bin - '' - + lib.optionalString withGUI ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir -p $out/Applications - mv gui/GPSBabelFE.app $out/Applications - install -Dm644 gui/*.qm gui/coretool/*.qm -t $out/Applications/GPSBabelFE.app/Contents/Resources/translations - ln -s $out/bin/gpsbabel $out/Applications/GPSBabelFE.app/Contents/MacOS - '' - else - '' - install -Dm755 gui/objects/gpsbabelfe -t $out/bin - install -Dm644 gui/gpsbabel.desktop -t $out/share/application - install -Dm644 gui/images/appicon.png $out/share/icons/hicolor/512x512/apps/gpsbabel.png - install -Dm644 gui/*.qm gui/coretool/*.qm -t $out/share/gpsbabel/translations - '' - ) - + lib.optionalString withDoc '' - install -Dm655 gpsbabel.{html,pdf} -t $doc/share/doc/gpsbabel - cp -r html $doc/share/doc/gpsbabel - ''; + installPhase = '' + install -Dm755 gpsbabel -t $out/bin + '' + + lib.optionalString withGUI ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p $out/Applications + mv gui/GPSBabelFE.app $out/Applications + install -Dm644 gui/*.qm gui/coretool/*.qm -t $out/Applications/GPSBabelFE.app/Contents/Resources/translations + ln -s $out/bin/gpsbabel $out/Applications/GPSBabelFE.app/Contents/MacOS + '' + else + '' + install -Dm755 gui/objects/gpsbabelfe -t $out/bin + install -Dm644 gui/gpsbabel.desktop -t $out/share/application + install -Dm644 gui/images/appicon.png $out/share/icons/hicolor/512x512/apps/gpsbabel.png + install -Dm644 gui/*.qm gui/coretool/*.qm -t $out/share/gpsbabel/translations + '' + ) + + lib.optionalString withDoc '' + install -Dm655 gpsbabel.{html,pdf} -t $doc/share/doc/gpsbabel + cp -r html $doc/share/doc/gpsbabel + ''; postFixup = lib.optionalString withGUI ( if stdenv.hostPlatform.isDarwin then diff --git a/pkgs/applications/misc/gpxsee/default.nix b/pkgs/applications/misc/gpxsee/default.nix index 571b2566f2e2..5945d13fb511 100644 --- a/pkgs/applications/misc/gpxsee/default.nix +++ b/pkgs/applications/misc/gpxsee/default.nix @@ -28,22 +28,21 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-3GPpr8L+oMHCGXo3RVaky6EjDrEiBERRU6w56o17Xhc="; }; - buildInputs = - [ - qtserialport - ] - ++ ( - if isQt6 then - [ - qtbase - qtpositioning - qtsvg - ] - else - [ - qtlocation - ] - ); + buildInputs = [ + qtserialport + ] + ++ ( + if isQt6 then + [ + qtbase + qtpositioning + qtsvg + ] + else + [ + qtlocation + ] + ); nativeBuildInputs = [ qmake diff --git a/pkgs/applications/misc/ikiwiki/default.nix b/pkgs/applications/misc/ikiwiki/default.nix index c0c18b68af7b..8f9b3e2e00c0 100644 --- a/pkgs/applications/misc/ikiwiki/default.nix +++ b/pkgs/applications/misc/ikiwiki/default.nix @@ -38,49 +38,48 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = - [ - which - highlight - ] - ++ (with perlPackages; [ - perl - TextMarkdown - URI - HTMLParser - HTMLScrubber - HTMLTemplate - TimeDate - gettext - DBFile - CGISession - CGIFormBuilder - LocaleGettext - RpcXML - XMLSimple - ImageMagick - YAML - YAMLLibYAML - HTMLTree - AuthenPassphrase - NetOpenIDConsumer - LWPxParanoidAgent - CryptSSLeay - ]) - ++ lib.optionals docutilsSupport [ - (python3.withPackages (pp: with pp; [ pygments ])) - docutils - ] - ++ lib.optionals gitSupport [ git ] - ++ lib.optionals monotoneSupport [ monotone ] - ++ lib.optionals bazaarSupport [ breezy ] - ++ lib.optionals cvsSupport [ - cvs - cvsps - perlPackages.Filechdir - ] - ++ lib.optionals subversionSupport [ subversion ] - ++ lib.optionals mercurialSupport [ mercurial ]; + buildInputs = [ + which + highlight + ] + ++ (with perlPackages; [ + perl + TextMarkdown + URI + HTMLParser + HTMLScrubber + HTMLTemplate + TimeDate + gettext + DBFile + CGISession + CGIFormBuilder + LocaleGettext + RpcXML + XMLSimple + ImageMagick + YAML + YAMLLibYAML + HTMLTree + AuthenPassphrase + NetOpenIDConsumer + LWPxParanoidAgent + CryptSSLeay + ]) + ++ lib.optionals docutilsSupport [ + (python3.withPackages (pp: with pp; [ pygments ])) + docutils + ] + ++ lib.optionals gitSupport [ git ] + ++ lib.optionals monotoneSupport [ monotone ] + ++ lib.optionals bazaarSupport [ breezy ] + ++ lib.optionals cvsSupport [ + cvs + cvsps + perlPackages.Filechdir + ] + ++ lib.optionals subversionSupport [ subversion ] + ++ lib.optionals mercurialSupport [ mercurial ]; patches = [ # A few markdown tests fail, but this is expected when using Text::Markdown diff --git a/pkgs/applications/misc/inochi2d/generic.nix b/pkgs/applications/misc/inochi2d/generic.nix index 7c9a2d1cecab..5817acd8b1c1 100644 --- a/pkgs/applications/misc/inochi2d/generic.nix +++ b/pkgs/applications/misc/inochi2d/generic.nix @@ -147,6 +147,7 @@ buildDubPackage ( license = lib.licenses.bsd2; mainProgram = pname; maintainers = with lib.maintainers; [ tomasajt ]; - } // meta; + } + // meta; } ) diff --git a/pkgs/applications/misc/input-leap/default.nix b/pkgs/applications/misc/input-leap/default.nix index 3592f13d80a8..808808b91f0d 100644 --- a/pkgs/applications/misc/input-leap/default.nix +++ b/pkgs/applications/misc/input-leap/default.nix @@ -49,31 +49,31 @@ stdenv.mkDerivation rec { qttools ]; - buildInputs = - [ - curl - qtbase - avahi - libX11 - libXext - libXtst - libXinerama - libXrandr - libXdmcp - libICE - libSM - ] - ++ lib.optionals withLibei [ - libei - libportal - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - pkgsStatic.openssl - ]; + buildInputs = [ + curl + qtbase + avahi + libX11 + libXext + libXtst + libXinerama + libXrandr + libXdmcp + libICE + libSM + ] + ++ lib.optionals withLibei [ + libei + libportal + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + pkgsStatic.openssl + ]; cmakeFlags = [ "-DINPUTLEAP_REVISION=${builtins.substring 0 8 src.rev}" - ] ++ lib.optional withLibei "-DINPUTLEAP_BUILD_LIBEI=ON"; + ] + ++ lib.optional withLibei "-DINPUTLEAP_BUILD_LIBEI=ON"; dontWrapGApps = true; preFixup = '' diff --git a/pkgs/applications/misc/kemai/default.nix b/pkgs/applications/misc/kemai/default.nix index 4a26b3b8a74c..7ca6353aa9fc 100644 --- a/pkgs/applications/misc/kemai/default.nix +++ b/pkgs/applications/misc/kemai/default.nix @@ -53,7 +53,8 @@ stdenv.mkDerivation (finalAttrs: { qttools range-v3 spdlog - ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland; + ] + ++ lib.optional stdenv.hostPlatform.isLinux qtwayland; cmakeFlags = [ (lib.cmakeBool "KEMAI_ENABLE_UPDATE_CHECK" false) diff --git a/pkgs/applications/misc/lutris/default.nix b/pkgs/applications/misc/lutris/default.nix index 03938f8aabbc..1b30138301e0 100644 --- a/pkgs/applications/misc/lutris/default.nix +++ b/pkgs/applications/misc/lutris/default.nix @@ -103,25 +103,24 @@ buildPythonApplication rec { wrapGAppsHook3 pkg-config ]; - buildInputs = - [ - atk - gdk-pixbuf - glib-networking - gnome-desktop - gtk3 - libnotify - pango - webkitgtk_4_1 - ] - ++ (with gst_all_1; [ - gst-libav - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gstreamer - ]); + buildInputs = [ + atk + gdk-pixbuf + glib-networking + gnome-desktop + gtk3 + libnotify + pango + webkitgtk_4_1 + ] + ++ (with gst_all_1; [ + gst-libav + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gstreamer + ]); # See `install_requires` in https://github.com/lutris/lutris/blob/master/setup.py propagatedBuildInputs = [ diff --git a/pkgs/applications/misc/meerk40t/default.nix b/pkgs/applications/misc/meerk40t/default.nix index 1795dd5c9480..bd0add5d69f5 100644 --- a/pkgs/applications/misc/meerk40t/default.nix +++ b/pkgs/applications/misc/meerk40t/default.nix @@ -19,13 +19,12 @@ python3Packages.buildPythonApplication rec { hash = "sha256-v3lwFl4Qls+NzR2rYwNF8PyFTH0nNcLlF/uwc0h3Pc0="; }; - nativeBuildInputs = - [ - wrapGAppsHook3 - ] - ++ (with python3Packages; [ - setuptools - ]); + nativeBuildInputs = [ + wrapGAppsHook3 + ] + ++ (with python3Packages; [ + setuptools + ]); # prevent double wrapping dontWrapGApps = true; diff --git a/pkgs/applications/misc/opencpn/default.nix b/pkgs/applications/misc/opencpn/default.nix index 32b73a4d52f4..d9c0ebe64cad 100644 --- a/pkgs/applications/misc/opencpn/default.nix +++ b/pkgs/applications/misc/opencpn/default.nix @@ -60,76 +60,73 @@ stdenv.mkDerivation (finalAttrs: { sed -i '/fixup_bundle/d; /NO_DEFAULT_PATH/d' CMakeLists.txt ''; - nativeBuildInputs = - [ - cmake - pkg-config - gtest - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - lsb-release - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - DarwinTools - makeWrapper - ]; + nativeBuildInputs = [ + cmake + pkg-config + gtest + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + lsb-release + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + DarwinTools + makeWrapper + ]; - buildInputs = - [ - at-spi2-core - curl - dbus - flac - gitMinimal - ] - ++ [ - glew - jasper - libGLU - libarchive - libdatrie - libepoxy - libexif - libogg - libopus - libsndfile - libthai - libunarr - libusb1 - libvorbis - libxkbcommon - lz4 - libmpg123 - portaudio - rapidjson - sqlite - tinyxml - wxGTK32 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-utils - libselinux - libsepol - util-linux - xorg.libXdmcp - xorg.libXtst - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ - elfutils - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - lame - ]; + buildInputs = [ + at-spi2-core + curl + dbus + flac + gitMinimal + ] + ++ [ + glew + jasper + libGLU + libarchive + libdatrie + libepoxy + libexif + libogg + libopus + libsndfile + libthai + libunarr + libusb1 + libvorbis + libxkbcommon + lz4 + libmpg123 + portaudio + rapidjson + sqlite + tinyxml + wxGTK32 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-utils + libselinux + libsepol + util-linux + xorg.libXdmcp + xorg.libXtst + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ + elfutils + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + lame + ]; - cmakeFlags = - [ - "-DOCPN_BUNDLE_DOCS=true" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Override OpenCPN platform detection. - "-DOCPN_TARGET_TUPLE=unknown;unknown;${stdenv.hostPlatform.linuxArch}" - ]; + cmakeFlags = [ + "-DOCPN_BUNDLE_DOCS=true" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # Override OpenCPN platform detection. + "-DOCPN_TARGET_TUPLE=unknown;unknown;${stdenv.hostPlatform.linuxArch}" + ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals (!stdenv.hostPlatform.isx86) [ diff --git a/pkgs/applications/misc/opentrack/default.nix b/pkgs/applications/misc/opentrack/default.nix index 1c77c8382996..097378626fe3 100644 --- a/pkgs/applications/misc/opentrack/default.nix +++ b/pkgs/applications/misc/opentrack/default.nix @@ -68,7 +68,8 @@ mkDerivation { libevdev aruco onnxruntime - ] ++ lib.optionals pkgs.stdenv.targetPlatform.isx86_64 [ wineWowPackages.stable ]; + ] + ++ lib.optionals pkgs.stdenv.targetPlatform.isx86_64 [ wineWowPackages.stable ]; env.NIX_CFLAGS_COMPILE = "-Wall -Wextra -Wpedantic -ffast-math -O3"; dontWrapQtApps = true; @@ -78,7 +79,8 @@ mkDerivation { "-DCMAKE_BUILD_TYPE=Release" "-DSDK_ARUCO_LIBPATH=${aruco}/lib/libaruco.a" "-DSDK_XPLANE=${xplaneSdk}" - ] ++ lib.optionals pkgs.stdenv.targetPlatform.isx86_64 [ "-DSDK_WINE=ON" ]; + ] + ++ lib.optionals pkgs.stdenv.targetPlatform.isx86_64 [ "-DSDK_WINE=ON" ]; postInstall = '' wrapQtApp $out/bin/opentrack diff --git a/pkgs/applications/misc/pagefind/default.nix b/pkgs/applications/misc/pagefind/default.nix index 76aef72d9736..2c36490fc736 100644 --- a/pkgs/applications/misc/pagefind/default.nix +++ b/pkgs/applications/misc/pagefind/default.nix @@ -97,19 +97,18 @@ rustPlatform.buildRustPackage rec { __darwinAllowLocalNetworking = true; - nativeBuildInputs = - [ - binaryen - gzip - nodejs - rustc - rustc.llvmPackages.lld - wasm-bindgen-cli_0_2_92 - wasm-pack - ] - ++ lib.optionals stdenv.buildPlatform.isDarwin [ - python3 - ]; + nativeBuildInputs = [ + binaryen + gzip + nodejs + rustc + rustc.llvmPackages.lld + wasm-bindgen-cli_0_2_92 + wasm-pack + ] + ++ lib.optionals stdenv.buildPlatform.isDarwin [ + python3 + ]; # build wasm and js assets # based on "test-and-build" in https://github.com/CloudCannon/pagefind/blob/main/.github/workflows/release.yml diff --git a/pkgs/applications/misc/pdfstudio/common.nix b/pkgs/applications/misc/pdfstudio/common.nix index c9834e9ec4ed..19b7c460ccf8 100644 --- a/pkgs/applications/misc/pdfstudio/common.nix +++ b/pkgs/applications/misc/pdfstudio/common.nix @@ -26,7 +26,8 @@ let buildInputs = [ sane-backends # for libsane.so.1 - ] ++ extraBuildInputs; + ] + ++ extraBuildInputs; nativeBuildInputs = [ autoPatchelfHook diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index fe9260366fdb..d7c1343026a6 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -101,42 +101,41 @@ stdenv.mkDerivation (finalAttrs: { udevCheckHook ]; - buildInputs = - [ - binutils - boost186 # does not build with 1.87, see https://github.com/prusa3d/PrusaSlicer/issues/13799 - cereal - cgal - curl - dbus - eigen - expat - glew - glib - glib-networking - gmp - gtk3 - hicolor-icon-theme - ilmbase - libpng - mpfr - nanosvg-fltk - nlopt - opencascade-override' - openvdb_tbb_2021_8 - qhull - tbb_2021 - wxGTK-override' - xorg.libX11 - libbgcode - heatshrink - catch2_3 - webkitgtk_4_1 - z3 - ] - ++ lib.optionals withSystemd [ - systemd - ]; + buildInputs = [ + binutils + boost186 # does not build with 1.87, see https://github.com/prusa3d/PrusaSlicer/issues/13799 + cereal + cgal + curl + dbus + eigen + expat + glew + glib + glib-networking + gmp + gtk3 + hicolor-icon-theme + ilmbase + libpng + mpfr + nanosvg-fltk + nlopt + opencascade-override' + openvdb_tbb_2021_8 + qhull + tbb_2021 + wxGTK-override' + xorg.libX11 + libbgcode + heatshrink + catch2_3 + webkitgtk_4_1 + z3 + ] + ++ lib.optionals withSystemd [ + systemd + ]; strictDeps = true; diff --git a/pkgs/applications/misc/prusa-slicer/super-slicer.nix b/pkgs/applications/misc/prusa-slicer/super-slicer.nix index 4435ecf6d967..2f651a8e40d9 100644 --- a/pkgs/applications/misc/prusa-slicer/super-slicer.nix +++ b/pkgs/applications/misc/prusa-slicer/super-slicer.nix @@ -83,21 +83,19 @@ let # - wxScintilla is not used on macOS # - Partially applied upstream changes cause a bug when trying to link against a nonexistent libexpat - postPatch = - (super.postPatch or "") - + '' - substituteInPlace src/CMakeLists.txt \ - --replace "scintilla" "" \ - --replace "list(APPEND wxWidgets_LIBRARIES libexpat)" "list(APPEND wxWidgets_LIBRARIES EXPAT::EXPAT)" + postPatch = (super.postPatch or "") + '' + substituteInPlace src/CMakeLists.txt \ + --replace "scintilla" "" \ + --replace "list(APPEND wxWidgets_LIBRARIES libexpat)" "list(APPEND wxWidgets_LIBRARIES EXPAT::EXPAT)" - substituteInPlace src/libslic3r/CMakeLists.txt \ - --replace "libexpat" "EXPAT::EXPAT" + substituteInPlace src/libslic3r/CMakeLists.txt \ + --replace "libexpat" "EXPAT::EXPAT" - # fixes GCC 14 error - substituteInPlace src/libslic3r/MeshBoolean.cpp \ - --replace-fail 'auto &face' 'auto face' \ - --replace-fail 'auto &vi' 'auto vi' - ''; + # fixes GCC 14 error + substituteInPlace src/libslic3r/MeshBoolean.cpp \ + --replace-fail 'auto &face' 'auto face' \ + --replace-fail 'auto &vi' 'auto vi' + ''; # We don't need PS overrides anymore, and gcode-viewer is embedded in the binary # but we do still need to move OCCTWrapper.so to the lib directory diff --git a/pkgs/applications/misc/qMasterPassword/default.nix b/pkgs/applications/misc/qMasterPassword/default.nix index 1e1f92281da8..6a3abc16bfa8 100644 --- a/pkgs/applications/misc/qMasterPassword/default.nix +++ b/pkgs/applications/misc/qMasterPassword/default.nix @@ -28,17 +28,16 @@ stdenv.mkDerivation rec { hash = "sha256-kNVdE42JFzl6HO84b793gseMhcDyiGzQCmhh6zh2epc="; }; - buildInputs = - [ - qtbase - qtwayland - openssl - libscrypt - ] - ++ lib.optionals x11Support [ - libX11 - libXtst - ]; + buildInputs = [ + qtbase + qtwayland + openssl + libscrypt + ] + ++ lib.optionals x11Support [ + libX11 + libXtst + ]; nativeBuildInputs = [ cmake qttools diff --git a/pkgs/applications/misc/qcad/default.nix b/pkgs/applications/misc/qcad/default.nix index 95735cbaf14e..0a6c171b1bc9 100644 --- a/pkgs/applications/misc/qcad/default.nix +++ b/pkgs/applications/misc/qcad/default.nix @@ -51,19 +51,18 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; - buildInputs = - [ - boost - libGLU - muparser - qtbase - qtscript - qtsvg - qtxmlpatterns - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - qtmacextras - ]; + buildInputs = [ + boost + libGLU + muparser + qtbase + qtscript + qtsvg + qtxmlpatterns + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + qtmacextras + ]; qmakeFlags = [ "MUPARSER_DIR=${muparser}" @@ -80,56 +79,55 @@ stdenv.mkDerivation rec { "--prefix DYLD_LIBRARY_PATH : ${placeholder "out"}/lib" ]; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm555 release/qcad-bin $out/bin/qcad - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install -Dm555 release/QCAD.app/Contents/MacOS/QCAD $out/bin/qcad - mkdir -p $out/lib - '' - + '' - install -Dm555 -t $out/lib release/libspatialindexnavel${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadcore${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadentity${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadgrid${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadsnap${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadoperations${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadstemmer${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadspatialindex${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadgui${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm555 -t $out/lib release/libqcadecmaapi${stdenv.hostPlatform.extensions.sharedLibrary} + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm555 release/qcad-bin $out/bin/qcad + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install -Dm555 release/QCAD.app/Contents/MacOS/QCAD $out/bin/qcad + mkdir -p $out/lib + '' + + '' + install -Dm555 -t $out/lib release/libspatialindexnavel${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadcore${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadentity${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadgrid${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadsnap${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadoperations${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadstemmer${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadspatialindex${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadgui${stdenv.hostPlatform.extensions.sharedLibrary} + install -Dm555 -t $out/lib release/libqcadecmaapi${stdenv.hostPlatform.extensions.sharedLibrary} - install -Dm444 -t $out/share/applications qcad.desktop - install -Dm644 -t $out/share/pixmaps scripts/qcad_icon.png + install -Dm444 -t $out/share/applications qcad.desktop + install -Dm644 -t $out/share/pixmaps scripts/qcad_icon.png - cp -r scripts $out/lib - cp -r plugins $out/lib/plugins - cp -r patterns $out/lib/patterns - cp -r fonts $out/lib/fonts - cp -r libraries $out/lib/libraries - cp -r linetypes $out/lib/linetypes - cp -r ts $out/lib/ts + cp -r scripts $out/lib + cp -r plugins $out/lib/plugins + cp -r patterns $out/lib/patterns + cp -r fonts $out/lib/fonts + cp -r libraries $out/lib/libraries + cp -r linetypes $out/lib/linetypes + cp -r ts $out/lib/ts - # workaround to fix the library browser: - rm -r $out/lib/plugins/sqldrivers - ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/sqldrivers + # workaround to fix the library browser: + rm -r $out/lib/plugins/sqldrivers + ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/sqldrivers - rm -r $out/lib/plugins/printsupport - ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/printsupport + rm -r $out/lib/plugins/printsupport + ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/printsupport - rm -r $out/lib/plugins/imageformats - ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/imageformats + rm -r $out/lib/plugins/imageformats + ln -s -t $out/lib/plugins ${qtbase}/${qtbase.qtPluginPrefix}/imageformats - install -Dm644 scripts/qcad_icon.svg $out/share/icons/hicolor/scalable/apps/qcad.svg + install -Dm644 scripts/qcad_icon.svg $out/share/icons/hicolor/scalable/apps/qcad.svg - installManPage qcad.1 + installManPage qcad.1 - runHook postInstall - ''; + runHook postInstall + ''; meta = { description = "2D CAD package based on Qt"; diff --git a/pkgs/applications/misc/qsyncthingtray/default.nix b/pkgs/applications/misc/qsyncthingtray/default.nix index 523a91b92f4f..b59e0e163c31 100644 --- a/pkgs/applications/misc/qsyncthingtray/default.nix +++ b/pkgs/applications/misc/qsyncthingtray/default.nix @@ -28,7 +28,8 @@ mkDerivation rec { buildInputs = [ qtbase qtwebengine - ] ++ lib.optional preferQWebView qtwebkit; + ] + ++ lib.optional preferQWebView qtwebkit; nativeBuildInputs = [ cmake ]; @@ -43,7 +44,8 @@ mkDerivation rec { url = "https://patch-diff.githubusercontent.com/raw/sieren/QSyncthingTray/pull/225.patch"; sha256 = "0w665xdlsbjxs977pdpzaclxpswf7xys1q3rxriz181lhk2y66yy"; }) - ] ++ lib.optional (!preferQWebView && !preferNative) ./qsyncthingtray-0.5.8-qt-5.6.3.patch; + ] + ++ lib.optional (!preferQWebView && !preferNative) ./qsyncthingtray-0.5.8-qt-5.6.3.patch; postPatch = '' ${lib.optionalString stdenv.hostPlatform.isLinux '' diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix index 5ec4714ad7d9..84f16b592975 100644 --- a/pkgs/applications/misc/redshift/default.nix +++ b/pkgs/applications/misc/redshift/default.nix @@ -66,33 +66,32 @@ let wrapPython gobject-introspection python - ] ++ lib.optionals (pname == "gammastep") [ wayland-scanner ]; + ] + ++ lib.optionals (pname == "gammastep") [ wayland-scanner ]; - configureFlags = - [ - "--enable-randr=${if withRandr then "yes" else "no"}" - "--enable-geoclue2=${if withGeoclue then "yes" else "no"}" - "--enable-drm=${if withDrm then "yes" else "no"}" - "--enable-vidmode=${if withVidmode then "yes" else "no"}" - "--enable-quartz=${if withQuartz then "yes" else "no"}" - "--enable-corelocation=${if withCoreLocation then "yes" else "no"}" - ] - ++ lib.optionals (pname == "gammastep") [ - "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user/" - "--enable-apparmor" - ]; + configureFlags = [ + "--enable-randr=${if withRandr then "yes" else "no"}" + "--enable-geoclue2=${if withGeoclue then "yes" else "no"}" + "--enable-drm=${if withDrm then "yes" else "no"}" + "--enable-vidmode=${if withVidmode then "yes" else "no"}" + "--enable-quartz=${if withQuartz then "yes" else "no"}" + "--enable-corelocation=${if withCoreLocation then "yes" else "no"}" + ] + ++ lib.optionals (pname == "gammastep") [ + "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user/" + "--enable-apparmor" + ]; - buildInputs = - [ - gtk3 - ] - ++ lib.optional withRandr libxcb - ++ lib.optional withGeoclue geoclue - ++ lib.optional withDrm libdrm - ++ lib.optional withVidmode libXxf86vm - ++ lib.optional withAppIndicator ( - if (pname != "gammastep") then libappindicator else libayatana-appindicator - ); + buildInputs = [ + gtk3 + ] + ++ lib.optional withRandr libxcb + ++ lib.optional withGeoclue geoclue + ++ lib.optional withDrm libdrm + ++ lib.optional withVidmode libXxf86vm + ++ lib.optional withAppIndicator ( + if (pname != "gammastep") then libappindicator else libayatana-appindicator + ); pythonPath = [ pygobject3 diff --git a/pkgs/applications/misc/resp-app/default.nix b/pkgs/applications/misc/resp-app/default.nix index 78c810c3dff6..eeb1037aadc9 100644 --- a/pkgs/applications/misc/resp-app/default.nix +++ b/pkgs/applications/misc/resp-app/default.nix @@ -58,7 +58,8 @@ mkDerivation rec { qttools snappy zstd - ] ++ pythonPath; + ] + ++ pythonPath; pythonPath = with python3Packages; [ bitstring diff --git a/pkgs/applications/misc/rofi-emoji/default.nix b/pkgs/applications/misc/rofi-emoji/default.nix index a8a83fcfe863..bb7a06377248 100644 --- a/pkgs/applications/misc/rofi-emoji/default.nix +++ b/pkgs/applications/misc/rofi-emoji/default.nix @@ -67,18 +67,17 @@ import ./versions.nix ( makeWrapper ]; - buildInputs = - [ - cairo - glib - libnotify - rofi-unwrapped - ] - ++ lib.optionals waylandSupport [ - wl-clipboard - wtype - ] - ++ lib.optionals x11Support [ xclip ]; + buildInputs = [ + cairo + glib + libnotify + rofi-unwrapped + ] + ++ lib.optionals waylandSupport [ + wl-clipboard + wtype + ] + ++ lib.optionals x11Support [ xclip ]; meta = with lib; { description = "Emoji selector plugin for Rofi (built against ${rofi-unwrapped.pname})"; diff --git a/pkgs/applications/misc/rofi-rbw/default.nix b/pkgs/applications/misc/rofi-rbw/default.nix index f9504220ef5a..13f9e91244e5 100644 --- a/pkgs/applications/misc/rofi-rbw/default.nix +++ b/pkgs/applications/misc/rofi-rbw/default.nix @@ -31,35 +31,33 @@ buildPythonApplication rec { hatchling ]; - buildInputs = - [ - rbw - ] - ++ lib.optionals waylandSupport [ - wl-clipboard - wtype - ] - ++ lib.optionals x11Support [ - xclip - xdotool - ]; + buildInputs = [ + rbw + ] + ++ lib.optionals waylandSupport [ + wl-clipboard + wtype + ] + ++ lib.optionals x11Support [ + xclip + xdotool + ]; propagatedBuildInputs = [ configargparse ]; pythonImportsCheck = [ "rofi_rbw" ]; - wrapper_paths = - [ - rbw - ] - ++ lib.optionals waylandSupport [ - wl-clipboard - wtype - ] - ++ lib.optionals x11Support [ - xclip - xdotool - ]; + wrapper_paths = [ + rbw + ] + ++ lib.optionals waylandSupport [ + wl-clipboard + wtype + ] + ++ lib.optionals x11Support [ + xclip + xdotool + ]; wrapper_flags = lib.optionalString waylandSupport "--typer wtype --clipboarder wl-copy" diff --git a/pkgs/applications/misc/rofi/wrapper.nix b/pkgs/applications/misc/rofi/wrapper.nix index 89bf267998a8..4b72f3f43f8d 100644 --- a/pkgs/applications/misc/rofi/wrapper.nix +++ b/pkgs/applications/misc/rofi/wrapper.nix @@ -16,7 +16,8 @@ symlinkJoin { paths = [ rofi-unwrapped.out - ] ++ (lib.forEach plugins (p: p.out)); + ] + ++ (lib.forEach plugins (p: p.out)); nativeBuildInputs = [ makeWrapper diff --git a/pkgs/applications/misc/syncthingtray/default.nix b/pkgs/applications/misc/syncthingtray/default.nix index 477f18a4fb36..bd18dd05a9da 100644 --- a/pkgs/applications/misc/syncthingtray/default.nix +++ b/pkgs/applications/misc/syncthingtray/default.nix @@ -48,21 +48,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-ik/UKemhSuhe3oXPPLAR/qKO7J4Mq35zimixVHNj7go="; }; - buildInputs = - [ - qtbase - qtsvg - cpp-utilities - qtutilities - boost - qtforkawesome - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ iconv ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ] - ++ lib.optionals webviewSupport [ qtwebengine ] - ++ lib.optionals jsSupport [ qtdeclarative ] - ++ lib.optionals kioPluginSupport [ kio ] - ++ lib.optionals plasmoidSupport [ plasma-framework ]; + buildInputs = [ + qtbase + qtsvg + cpp-utilities + qtutilities + boost + qtforkawesome + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ iconv ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ] + ++ lib.optionals webviewSupport [ qtwebengine ] + ++ lib.optionals jsSupport [ qtdeclarative ] + ++ lib.optionals kioPluginSupport [ kio ] + ++ lib.optionals plasmoidSupport [ plasma-framework ]; nativeBuildInputs = [ wrapQtAppsHook @@ -73,7 +72,8 @@ stdenv.mkDerivation (finalAttrs: { # still build them. cppunit syncthing - ] ++ lib.optionals plasmoidSupport [ extra-cmake-modules ]; + ] + ++ lib.optionals plasmoidSupport [ extra-cmake-modules ]; # syncthing server seems to hang on darwin, causing tests to fail. doCheck = !stdenv.hostPlatform.isDarwin; @@ -93,22 +93,21 @@ stdenv.mkDerivation (finalAttrs: { ]; doInstallCheck = true; - cmakeFlags = - [ - "-DQT_PACKAGE_PREFIX=Qt${lib.versions.major qtbase.version}" - "-DKF_PACKAGE_PREFIX=KF${lib.versions.major qtbase.version}" - "-DBUILD_TESTING=ON" - # See https://github.com/Martchus/syncthingtray/issues/208 - "-DEXCLUDE_TESTS_FROM_ALL=OFF" - "-DAUTOSTART_EXEC_PATH=${autostartExecPath}" - # See https://github.com/Martchus/syncthingtray/issues/42 - "-DQT_PLUGIN_DIR:STRING=${placeholder "out"}/${qtbase.qtPluginPrefix}" - "-DBUILD_SHARED_LIBS=ON" - ] - ++ lib.optionals (!plasmoidSupport) [ "-DNO_PLASMOID=ON" ] - ++ lib.optionals (!kioPluginSupport) [ "-DNO_FILE_ITEM_ACTION_PLUGIN=ON" ] - ++ lib.optionals systemdSupport [ "-DSYSTEMD_SUPPORT=ON" ] - ++ lib.optionals (!webviewSupport) [ "-DWEBVIEW_PROVIDER:STRING=none" ]; + cmakeFlags = [ + "-DQT_PACKAGE_PREFIX=Qt${lib.versions.major qtbase.version}" + "-DKF_PACKAGE_PREFIX=KF${lib.versions.major qtbase.version}" + "-DBUILD_TESTING=ON" + # See https://github.com/Martchus/syncthingtray/issues/208 + "-DEXCLUDE_TESTS_FROM_ALL=OFF" + "-DAUTOSTART_EXEC_PATH=${autostartExecPath}" + # See https://github.com/Martchus/syncthingtray/issues/42 + "-DQT_PLUGIN_DIR:STRING=${placeholder "out"}/${qtbase.qtPluginPrefix}" + "-DBUILD_SHARED_LIBS=ON" + ] + ++ lib.optionals (!plasmoidSupport) [ "-DNO_PLASMOID=ON" ] + ++ lib.optionals (!kioPluginSupport) [ "-DNO_FILE_ITEM_ACTION_PLUGIN=ON" ] + ++ lib.optionals systemdSupport [ "-DSYSTEMD_SUPPORT=ON" ] + ++ lib.optionals (!webviewSupport) [ "-DWEBVIEW_PROVIDER:STRING=none" ]; qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ xdg-utils ]}" diff --git a/pkgs/applications/misc/synergy/default.nix b/pkgs/applications/misc/synergy/default.nix index d395e68608ea..ab350c2509ae 100644 --- a/pkgs/applications/misc/synergy/default.nix +++ b/pkgs/applications/misc/synergy/default.nix @@ -46,44 +46,43 @@ stdenv.mkDerivation rec { ./darwin-non-static-openssl.patch ]; - postPatch = - '' - substituteInPlace src/gui/src/SslCertificate.cpp \ - --replace 'kUnixOpenSslCommand[] = "openssl";' 'kUnixOpenSslCommand[] = "${openssl}/bin/openssl";' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace src/lib/synergy/unix/AppUtilUnix.cpp \ - --replace "/usr/share/X11/xkb/rules/evdev.xml" "${xkeyboardconfig}/share/X11/xkb/rules/evdev.xml" - ''; + postPatch = '' + substituteInPlace src/gui/src/SslCertificate.cpp \ + --replace 'kUnixOpenSslCommand[] = "openssl";' 'kUnixOpenSslCommand[] = "${openssl}/bin/openssl";' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace src/lib/synergy/unix/AppUtilUnix.cpp \ + --replace "/usr/share/X11/xkb/rules/evdev.xml" "${xkeyboardconfig}/share/X11/xkb/rules/evdev.xml" + ''; nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optional withGUI wrapQtAppsHook; + ] + ++ lib.optional withGUI wrapQtAppsHook; - buildInputs = - [ - qttools # Used for translations even when not building the GUI - openssl - pcre - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linux - libselinux - libsepol - libICE - libSM - libX11 - libXi - libXtst - libXrandr - libXinerama - libxkbfile - xinput - avahi-compat - gdk-pixbuf - libnotify - ]; + buildInputs = [ + qttools # Used for translations even when not building the GUI + openssl + pcre + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linux + libselinux + libsepol + libICE + libSM + libX11 + libXi + libXtst + libXrandr + libXinerama + libxkbfile + xinput + avahi-compat + gdk-pixbuf + libnotify + ]; # Silences many warnings env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-inconsistent-missing-override"; @@ -97,43 +96,41 @@ stdenv.mkDerivation rec { doCheck = true; - checkPhase = - '' - runHook preCheck - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # filter out tests failing with sandboxing on darwin - export GTEST_FILTER=-ServerConfigTests.serverconfig_will_deem_equal_configs_with_same_cell_names:NetworkAddress.hostname_valid_parsing - '' - + '' - bin/unittests - runHook postCheck - ''; + checkPhase = '' + runHook preCheck + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # filter out tests failing with sandboxing on darwin + export GTEST_FILTER=-ServerConfigTests.serverconfig_will_deem_equal_configs_with_same_cell_names:NetworkAddress.hostname_valid_parsing + '' + + '' + bin/unittests + runHook postCheck + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin - cp bin/{synergyc,synergys,synergyd,syntool} $out/bin/ - '' - + lib.optionalString withGUI '' - cp bin/synergy $out/bin/ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/share/{applications,icons/hicolor/scalable/apps} - cp ../res/synergy.svg $out/share/icons/hicolor/scalable/apps/ - substitute ../res/synergy.desktop $out/share/applications/synergy.desktop \ - --replace "/usr/bin" "$out/bin" - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && withGUI) '' - mkdir -p $out/Applications - cp -r bundle/Synergy.app $out/Applications - ln -s $out/bin $out/Applications/Synergy.app/Contents/MacOS - '' - + '' - runHook postInstall - ''; + mkdir -p $out/bin + cp bin/{synergyc,synergys,synergyd,syntool} $out/bin/ + '' + + lib.optionalString withGUI '' + cp bin/synergy $out/bin/ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/share/{applications,icons/hicolor/scalable/apps} + cp ../res/synergy.svg $out/share/icons/hicolor/scalable/apps/ + substitute ../res/synergy.desktop $out/share/applications/synergy.desktop \ + --replace "/usr/bin" "$out/bin" + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && withGUI) '' + mkdir -p $out/Applications + cp -r bundle/Synergy.app $out/Applications + ln -s $out/bin $out/Applications/Synergy.app/Contents/MacOS + '' + + '' + runHook postInstall + ''; dontWrapQtApps = lib.optional (!withGUI) true; diff --git a/pkgs/applications/misc/visidata/default.nix b/pkgs/applications/misc/visidata/default.nix index c199f3223ab6..99ec848b8610 100644 --- a/pkgs/applications/misc/visidata/default.nix +++ b/pkgs/applications/misc/visidata/default.nix @@ -61,65 +61,64 @@ buildPythonApplication rec { hash = "sha256-ICEYC9QjYrB+oTzakfjgyg4DigzDOtYnqHRTaqF7Gw0="; }; - propagatedBuildInputs = - [ - # from visidata/requirements.txt - # packages not (yet) present in nixpkgs are commented - python-dateutil - pandas - requests - lxml - openpyxl - xlrd - xlwt - h5py - psycopg2 - boto3 - pyshp - #mapbox-vector-tile - pypng - #pyconll - msgpack - brotli - #fecfile - fonttools - #sas7bdat - #xport - #savReaderWriter - pyyaml - #namestand - #datapackage - pdfminer-six - #tabula - vobject - tabulate - wcwidth - zstandard - odfpy - urllib3 - pyarrow - seaborn - matplotlib - sh - psutil - numpy + propagatedBuildInputs = [ + # from visidata/requirements.txt + # packages not (yet) present in nixpkgs are commented + python-dateutil + pandas + requests + lxml + openpyxl + xlrd + xlwt + h5py + psycopg2 + boto3 + pyshp + #mapbox-vector-tile + pypng + #pyconll + msgpack + brotli + #fecfile + fonttools + #sas7bdat + #xport + #savReaderWriter + pyyaml + #namestand + #datapackage + pdfminer-six + #tabula + vobject + tabulate + wcwidth + zstandard + odfpy + urllib3 + pyarrow + seaborn + matplotlib + sh + psutil + numpy - #requests_cache - beautifulsoup4 + #requests_cache + beautifulsoup4 - faker - praw - zulip - #pyairtable + faker + praw + zulip + #pyairtable - setuptools - importlib-metadata - ] - ++ lib.optionals withPcap [ - dpkt - dnslib - ] - ++ lib.optional withXclip xclip; + setuptools + importlib-metadata + ] + ++ lib.optionals withPcap [ + dpkt + dnslib + ] + ++ lib.optional withXclip xclip; nativeCheckInputs = [ gitMinimal diff --git a/pkgs/applications/misc/xpdf/default.nix b/pkgs/applications/misc/xpdf/default.nix index 172da584bd0e..b089e0c39426 100644 --- a/pkgs/applications/misc/xpdf/default.nix +++ b/pkgs/applications/misc/xpdf/default.nix @@ -46,16 +46,16 @@ stdenv.mkDerivation rec { "-DSYSTEM_XPDFRC=/etc/xpdfrc" "-DA4_PAPER=ON" "-DOPI_SUPPORT=ON" - ] ++ lib.optional (!enablePrinting) "-DXPDFWIDGET_PRINTING=OFF"; + ] + ++ lib.optional (!enablePrinting) "-DXPDFWIDGET_PRINTING=OFF"; - buildInputs = - [ - zlib - libpng - ] - ++ lib.optional enableGUI qtbase - ++ lib.optional enablePrinting cups - ++ lib.optional enablePDFtoPPM freetype; + buildInputs = [ + zlib + libpng + ] + ++ lib.optional enableGUI qtbase + ++ lib.optional enablePrinting cups + ++ lib.optional enablePDFtoPPM freetype; desktopItem = makeDesktopItem { name = "xpdf"; diff --git a/pkgs/applications/misc/xygrib/default.nix b/pkgs/applications/misc/xygrib/default.nix index 4139a80696a4..a721ebfa285f 100644 --- a/pkgs/applications/misc/xygrib/default.nix +++ b/pkgs/applications/misc/xygrib/default.nix @@ -37,11 +37,10 @@ stdenv.mkDerivation { openjpeg libpng ]; - cmakeFlags = - [ - "-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/openjpeg-${lib.versions.majorMinor openjpeg.version}" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DLIBNOVA_LIBRARY=${libnova}/lib/libnova.dylib" ]; + cmakeFlags = [ + "-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/openjpeg-${lib.versions.majorMinor openjpeg.version}" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DLIBNOVA_LIBRARY=${libnova}/lib/libnova.dylib" ]; postInstall = if stdenv.hostPlatform.isDarwin then diff --git a/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix index b6de5c2eec01..c6ecf713938d 100644 --- a/pkgs/applications/misc/zathura/core/default.nix +++ b/pkgs/applications/misc/zathura/core/default.nix @@ -73,21 +73,20 @@ stdenv.mkDerivation (finalAttrs: { appstream-glib ]; - buildInputs = - [ - gtk3 - girara - libintl - sqlite - glib - file - librsvg - check - json-glib - texlive.bin.core - ] - ++ lib.optional stdenv.hostPlatform.isLinux libseccomp - ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration; + buildInputs = [ + gtk3 + girara + libintl + sqlite + glib + file + librsvg + check + json-glib + texlive.bin.core + ] + ++ lib.optional stdenv.hostPlatform.isLinux libseccomp + ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration; # add support for more image formats env.GDK_PIXBUF_MODULE_FILE = gnome._gdkPixbufCacheBuilder_DO_NOT_USE { diff --git a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix index f0fd28d4a444..c17330dec6fe 100644 --- a/pkgs/applications/misc/zathura/pdf-mupdf/default.nix +++ b/pkgs/applications/misc/zathura/pdf-mupdf/default.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation (finalAttrs: { tesseract leptonica mujs - ] ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration; env.PKG_CONFIG_ZATHURA_PLUGINDIR = "lib/zathura"; diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 23c7e5da5b79..42706e0d6925 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -290,247 +290,243 @@ let nativeBuildInputs = p.nativeBuildInputs or [ ] ++ [ zstd ]; }); - nativeBuildInputs = - [ - ninja - gnChromium - bashInteractive # needed for compgen in buildPhase -> process_template - pkg-config - python3WithPackages - perl - which - buildPackages.rustc.llvmPackages.bintools - bison - gperf - ] - ++ lib.optionals (!isElectron) [ - nodejs - npmHooks.npmConfigHook - ]; + nativeBuildInputs = [ + ninja + gnChromium + bashInteractive # needed for compgen in buildPhase -> process_template + pkg-config + python3WithPackages + perl + which + buildPackages.rustc.llvmPackages.bintools + bison + gperf + ] + ++ lib.optionals (!isElectron) [ + nodejs + npmHooks.npmConfigHook + ]; - depsBuildBuild = - [ - buildPlatformLlvmStdenv - buildPlatformLlvmStdenv.cc - pkg-config - libuuid - ] - # When cross-compiling, chromium builds a huge proportion of its - # components for both the `buildPlatform` (which it calls - # `host`) as well as for the `hostPlatform` -- easily more than - # half of the dependencies are needed here. To avoid having to - # maintain a separate list of buildPlatform-dependencies, we - # simply throw in the kitchen sink. - # ** Because of overrides, we have to copy the list as it otherwise mess with splicing ** - ++ [ - (buildPackages.libpng.override { apngSupport = false; }) # https://bugs.chromium.org/p/chromium/issues/detail?id=752403 - (buildPackages.libopus.override { withCustomModes = true; }) - bzip2 - flac - speex - libevent - expat - libjpeg - snappy - libcap - minizip - libwebp - libusb1 - re2 - ffmpeg - libxslt - libxml2 - nasm - nspr - nss - util-linux - alsa-lib - libkrb5 - glib - gtk3 - dbus-glib - libXScrnSaver - libXcursor - libXtst - libxshmfence - libGLU - libGL - libgbm - pciutils - protobuf - speechd-minimal - libXdamage - at-spi2-core - pipewire - libva - libdrm - wayland - libxkbcommon - curl - libepoxy - libffi - libevdev - ] - ++ lib.optional systemdSupport systemd - ++ lib.optionals cupsSupport [ - libgcrypt - cups - ] - ++ lib.optional pulseSupport libpulseaudio; + depsBuildBuild = [ + buildPlatformLlvmStdenv + buildPlatformLlvmStdenv.cc + pkg-config + libuuid + ] + # When cross-compiling, chromium builds a huge proportion of its + # components for both the `buildPlatform` (which it calls + # `host`) as well as for the `hostPlatform` -- easily more than + # half of the dependencies are needed here. To avoid having to + # maintain a separate list of buildPlatform-dependencies, we + # simply throw in the kitchen sink. + # ** Because of overrides, we have to copy the list as it otherwise mess with splicing ** + ++ [ + (buildPackages.libpng.override { apngSupport = false; }) # https://bugs.chromium.org/p/chromium/issues/detail?id=752403 + (buildPackages.libopus.override { withCustomModes = true; }) + bzip2 + flac + speex + libevent + expat + libjpeg + snappy + libcap + minizip + libwebp + libusb1 + re2 + ffmpeg + libxslt + libxml2 + nasm + nspr + nss + util-linux + alsa-lib + libkrb5 + glib + gtk3 + dbus-glib + libXScrnSaver + libXcursor + libXtst + libxshmfence + libGLU + libGL + libgbm + pciutils + protobuf + speechd-minimal + libXdamage + at-spi2-core + pipewire + libva + libdrm + wayland + libxkbcommon + curl + libepoxy + libffi + libevdev + ] + ++ lib.optional systemdSupport systemd + ++ lib.optionals cupsSupport [ + libgcrypt + cups + ] + ++ lib.optional pulseSupport libpulseaudio; - buildInputs = - [ - (libpng.override { apngSupport = false; }) # https://bugs.chromium.org/p/chromium/issues/detail?id=752403 - (libopus.override { withCustomModes = true; }) - bzip2 - flac - speex - libevent - expat - libjpeg - snappy - libcap - minizip - libwebp - libusb1 - re2 - ffmpeg - libxslt - libxml2 - nasm - nspr - nss - util-linux - alsa-lib - libkrb5 - glib - gtk3 - dbus-glib - libXScrnSaver - libXcursor - libXtst - libxshmfence - libGLU - libGL - dri-pkgconfig-stub - libgbm - pciutils - protobuf - speechd-minimal - libXdamage - at-spi2-core - pipewire - libva - libdrm - wayland - libxkbcommon - curl - libepoxy - libffi - libevdev - ] - ++ lib.optional systemdSupport systemd - ++ lib.optionals cupsSupport [ - libgcrypt - cups - ] - ++ lib.optional pulseSupport libpulseaudio; + buildInputs = [ + (libpng.override { apngSupport = false; }) # https://bugs.chromium.org/p/chromium/issues/detail?id=752403 + (libopus.override { withCustomModes = true; }) + bzip2 + flac + speex + libevent + expat + libjpeg + snappy + libcap + minizip + libwebp + libusb1 + re2 + ffmpeg + libxslt + libxml2 + nasm + nspr + nss + util-linux + alsa-lib + libkrb5 + glib + gtk3 + dbus-glib + libXScrnSaver + libXcursor + libXtst + libxshmfence + libGLU + libGL + dri-pkgconfig-stub + libgbm + pciutils + protobuf + speechd-minimal + libXdamage + at-spi2-core + pipewire + libva + libdrm + wayland + libxkbcommon + curl + libepoxy + libffi + libevdev + ] + ++ lib.optional systemdSupport systemd + ++ lib.optionals cupsSupport [ + libgcrypt + cups + ] + ++ lib.optional pulseSupport libpulseaudio; - patches = - [ - ./patches/cross-compile.patch - # Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed): - ./patches/no-build-timestamps.patch - ] - ++ lib.optionals (!chromiumVersionAtLeast "136") [ - # Fix build with Pipewire 1.4 - # Submitted upstream: https://webrtc-review.googlesource.com/c/src/+/380500 - # Got merged, started shipping with M136+. - ./patches/webrtc-pipewire-1.4.patch - ] - ++ lib.optionals (packageName == "chromium") [ - # This patch is limited to chromium and ungoogled-chromium because electron-source sets - # enable_widevine to false. - # - # The patch disables the automatic Widevine download (component) that happens at runtime - # completely (~/.config/chromium/WidevineCdm/). This would happen if chromium encounters DRM - # protected content or when manually opening chrome://components. - # - # It also prevents previously downloaded Widevine blobs in that location from being loaded and - # used at all, while still allowing the use of our -wv wrapper. This is because those old - # versions are out of out our control and may be vulnerable, given we literally disable their - # auto updater. - # - # bundle_widevine_cdm is available as gn flag, but we cannot use it, as it expects a bunch of - # files Widevine files at configure/compile phase that we don't have. Changing the value of the - # BUNDLE_WIDEVINE_CDM build flag does work in the way we want though. - # We also need enable_widevine_cdm_component to be false. Unfortunately it isn't exposed as gn - # flag (declare_args) so we simply hardcode it to false. - ./patches/widevine-disable-auto-download-allow-bundle.patch - ] - ++ [ - # Required to fix the build with a more recent wayland-protocols version - # (we currently package 1.26 in Nixpkgs while Chromium bundles 1.21): - # Source: https://bugs.chromium.org/p/angleproject/issues/detail?id=7582#c1 - ./patches/angle-wayland-include-protocol.patch - # Chromium reads initial_preferences from its own executable directory - # This patch modifies it to read /etc/chromium/initial_preferences - ./patches/chromium-initial-prefs.patch - # https://github.com/chromium/chromium/commit/02b6456643700771597c00741937e22068b0f956 - # https://github.com/chromium/chromium/commit/69736ffe943ff996d4a88d15eb30103a8c854e29 - # Rebased variant of patch to build M126+ with LLVM 17. - # staging-next will bump LLVM to 18, so we will be able to drop this soon. - ./patches/chromium-126-llvm-17.patch - # Partial revert of https://github.com/chromium/chromium/commit/3687976b0c6d36cf4157419a24a39f6770098d61 - # allowing us to use our rustc and our clang. - ./patches/chromium-129-rust.patch - ] - ++ lib.optionals (!ungoogled && !chromiumVersionAtLeast "136") [ - # Note: We since use LLVM v19.1+ on unstable *and* release-24.11 for all version and as such - # no longer need this patch. We opt to arbitrarily limit it to versions prior to M136 just - # because that's when this revert stopped applying cleanly and defer fully dropping it for - # the next cleanup to bundle rebuilding all of chromium and electron. - # - # Our rustc.llvmPackages is too old for std::hardware_destructive_interference_size - # and std::hardware_constructive_interference_size. - # So let's revert the change for now and hope that our rustc.llvmPackages and - # nixpkgs-stable catch up sooner than later. - # https://groups.google.com/a/chromium.org/g/cxx/c/cwktrFxxUY4 - # https://chromium-review.googlesource.com/c/chromium/src/+/5767325 - # Note: We exclude the changes made to the partition_allocator (PA), as the revert - # would otherwise not apply because upstream reverted those changes to PA already - # in https://chromium-review.googlesource.com/c/chromium/src/+/5841144 - # Note: ungoogled-chromium already reverts this as part of its patchset. - (githubPatch { - commit = "fc838e8cc887adbe95110045d146b9d5885bf2a9"; - hash = "sha256-NNKzIp6NYdeZaqBLWDW/qNxiDB1VFRz7msjMXuMOrZ8="; - excludes = [ "base/allocator/partition_allocator/src/partition_alloc/*" ]; - revert = true; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # Reverts decommit pooled pages which causes random crashes of tabs on systems - # with page sizes different than 4k. It 'supports' runtime page sizes, but has - # a hardcode for aarch64 systems. - # https://issues.chromium.org/issues/378017037 - (fetchpatch { - name = "reverted-v8-decommit-pooled-paged-by-default.patch"; - # https://chromium-review.googlesource.com/c/v8/v8/+/5864909 - url = "https://chromium.googlesource.com/v8/v8/+/1ab1a14ad97394d384d8dc6de51bb229625e66d6^!?format=TEXT"; - decode = "base64 -d"; - stripLen = 1; - extraPrefix = "v8/"; - revert = true; - hash = "sha256-PuinMLhJ2W4KPXI5K0ujw85ENTB1wG7Hv785SZ55xnY="; - }) - ] - ++ lib.optionals (chromiumVersionAtLeast "136") [ - # Modify the nodejs version check added in https://chromium-review.googlesource.com/c/chromium/src/+/6334038 - # to look for the minimal version, not the exact version (major.minor.patch). The linked CL makes a case for - # preventing compilations of chromium with versions below their intended version, not about running the very - # exact version or even running a newer version. - ./patches/chromium-136-nodejs-assert-minimal-version-instead-of-exact-match.patch - ]; + patches = [ + ./patches/cross-compile.patch + # Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed): + ./patches/no-build-timestamps.patch + ] + ++ lib.optionals (!chromiumVersionAtLeast "136") [ + # Fix build with Pipewire 1.4 + # Submitted upstream: https://webrtc-review.googlesource.com/c/src/+/380500 + # Got merged, started shipping with M136+. + ./patches/webrtc-pipewire-1.4.patch + ] + ++ lib.optionals (packageName == "chromium") [ + # This patch is limited to chromium and ungoogled-chromium because electron-source sets + # enable_widevine to false. + # + # The patch disables the automatic Widevine download (component) that happens at runtime + # completely (~/.config/chromium/WidevineCdm/). This would happen if chromium encounters DRM + # protected content or when manually opening chrome://components. + # + # It also prevents previously downloaded Widevine blobs in that location from being loaded and + # used at all, while still allowing the use of our -wv wrapper. This is because those old + # versions are out of out our control and may be vulnerable, given we literally disable their + # auto updater. + # + # bundle_widevine_cdm is available as gn flag, but we cannot use it, as it expects a bunch of + # files Widevine files at configure/compile phase that we don't have. Changing the value of the + # BUNDLE_WIDEVINE_CDM build flag does work in the way we want though. + # We also need enable_widevine_cdm_component to be false. Unfortunately it isn't exposed as gn + # flag (declare_args) so we simply hardcode it to false. + ./patches/widevine-disable-auto-download-allow-bundle.patch + ] + ++ [ + # Required to fix the build with a more recent wayland-protocols version + # (we currently package 1.26 in Nixpkgs while Chromium bundles 1.21): + # Source: https://bugs.chromium.org/p/angleproject/issues/detail?id=7582#c1 + ./patches/angle-wayland-include-protocol.patch + # Chromium reads initial_preferences from its own executable directory + # This patch modifies it to read /etc/chromium/initial_preferences + ./patches/chromium-initial-prefs.patch + # https://github.com/chromium/chromium/commit/02b6456643700771597c00741937e22068b0f956 + # https://github.com/chromium/chromium/commit/69736ffe943ff996d4a88d15eb30103a8c854e29 + # Rebased variant of patch to build M126+ with LLVM 17. + # staging-next will bump LLVM to 18, so we will be able to drop this soon. + ./patches/chromium-126-llvm-17.patch + # Partial revert of https://github.com/chromium/chromium/commit/3687976b0c6d36cf4157419a24a39f6770098d61 + # allowing us to use our rustc and our clang. + ./patches/chromium-129-rust.patch + ] + ++ lib.optionals (!ungoogled && !chromiumVersionAtLeast "136") [ + # Note: We since use LLVM v19.1+ on unstable *and* release-24.11 for all version and as such + # no longer need this patch. We opt to arbitrarily limit it to versions prior to M136 just + # because that's when this revert stopped applying cleanly and defer fully dropping it for + # the next cleanup to bundle rebuilding all of chromium and electron. + # + # Our rustc.llvmPackages is too old for std::hardware_destructive_interference_size + # and std::hardware_constructive_interference_size. + # So let's revert the change for now and hope that our rustc.llvmPackages and + # nixpkgs-stable catch up sooner than later. + # https://groups.google.com/a/chromium.org/g/cxx/c/cwktrFxxUY4 + # https://chromium-review.googlesource.com/c/chromium/src/+/5767325 + # Note: We exclude the changes made to the partition_allocator (PA), as the revert + # would otherwise not apply because upstream reverted those changes to PA already + # in https://chromium-review.googlesource.com/c/chromium/src/+/5841144 + # Note: ungoogled-chromium already reverts this as part of its patchset. + (githubPatch { + commit = "fc838e8cc887adbe95110045d146b9d5885bf2a9"; + hash = "sha256-NNKzIp6NYdeZaqBLWDW/qNxiDB1VFRz7msjMXuMOrZ8="; + excludes = [ "base/allocator/partition_allocator/src/partition_alloc/*" ]; + revert = true; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # Reverts decommit pooled pages which causes random crashes of tabs on systems + # with page sizes different than 4k. It 'supports' runtime page sizes, but has + # a hardcode for aarch64 systems. + # https://issues.chromium.org/issues/378017037 + (fetchpatch { + name = "reverted-v8-decommit-pooled-paged-by-default.patch"; + # https://chromium-review.googlesource.com/c/v8/v8/+/5864909 + url = "https://chromium.googlesource.com/v8/v8/+/1ab1a14ad97394d384d8dc6de51bb229625e66d6^!?format=TEXT"; + decode = "base64 -d"; + stripLen = 1; + extraPrefix = "v8/"; + revert = true; + hash = "sha256-PuinMLhJ2W4KPXI5K0ujw85ENTB1wG7Hv785SZ55xnY="; + }) + ] + ++ lib.optionals (chromiumVersionAtLeast "136") [ + # Modify the nodejs version check added in https://chromium-review.googlesource.com/c/chromium/src/+/6334038 + # to look for the minimal version, not the exact version (major.minor.patch). The linked CL makes a case for + # preventing compilations of chromium with versions below their intended version, not about running the very + # exact version or even running a newer version. + ./patches/chromium-136-nodejs-assert-minimal-version-instead-of-exact-match.patch + ]; postPatch = lib.optionalString (!isElectron) @@ -798,16 +794,15 @@ let # Our rustc in nixpkgs follows stable, but since bootstrapping rustc requires # nightly features too, we can (ab-)use RUSTC_BOOTSTRAP here as well to # enable those features in our stable builds. - preConfigure = - '' - export RUSTC_BOOTSTRAP=1 - '' - + lib.optionalString (!isElectron) '' - ( - cd third_party/node - grep patch update_npm_deps | sh - ) - ''; + preConfigure = '' + export RUSTC_BOOTSTRAP=1 + '' + + lib.optionalString (!isElectron) '' + ( + cd third_party/node + grep patch update_npm_deps | sh + ) + ''; configurePhase = '' runHook preConfigure @@ -875,13 +870,12 @@ let ln -s -t "$libExecPath" "${lib.getLib vulkan-loader}/lib/libvulkan.so.1" ''; - passthru = - { - updateScript = ./update.mjs; - } - // lib.optionalAttrs (!isElectron) { - inherit chromiumDeps npmDeps; - }; + passthru = { + updateScript = ./update.mjs; + } + // lib.optionalAttrs (!isElectron) { + inherit chromiumDeps npmDeps; + }; }; in diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix index 7bececfc29de..a25d95e76172 100644 --- a/pkgs/applications/networking/browsers/elinks/default.nix +++ b/pkgs/applications/networking/browsers/elinks/default.nix @@ -42,25 +42,24 @@ stdenv.mkDerivation rec { hash = "sha256-TTb/v24gIWKiCQCESHo0Pz6rvRtw5anoXK0b35dzfLM="; }; - buildInputs = - [ - ncurses - libX11 - bzip2 - zlib - brotli - zstd - xz - openssl - libidn - tre - expat - libev - ] - ++ lib.optional stdenv.hostPlatform.isLinux gpm - ++ lib.optional enableGuile guile - ++ lib.optional enablePython python - ++ lib.optional enablePerl perl; + buildInputs = [ + ncurses + libX11 + bzip2 + zlib + brotli + zstd + xz + openssl + libidn + tre + expat + libev + ] + ++ lib.optional stdenv.hostPlatform.isLinux gpm + ++ lib.optional enableGuile guile + ++ lib.optional enablePython python + ++ lib.optional enablePerl perl; nativeBuildInputs = [ autoreconfHook @@ -68,25 +67,24 @@ stdenv.mkDerivation rec { pkg-config ]; - configureFlags = - [ - "--enable-finger" - "--enable-html-highlight" - "--enable-gopher" - "--enable-gemini" - "--enable-cgi" - "--enable-bittorrent" - "--enable-nntp" - "--enable-256-colors" - "--enable-true-color" - "--with-brotli" - "--with-lzma" - "--with-libev" - "--with-terminfo" - ] - ++ lib.optional enableGuile "--with-guile" - ++ lib.optional enablePython "--with-python" - ++ lib.optional enablePerl "--with-perl"; + configureFlags = [ + "--enable-finger" + "--enable-html-highlight" + "--enable-gopher" + "--enable-gemini" + "--enable-cgi" + "--enable-bittorrent" + "--enable-nntp" + "--enable-256-colors" + "--enable-true-color" + "--with-brotli" + "--with-lzma" + "--with-libev" + "--with-terminfo" + ] + ++ lib.optional enableGuile "--with-guile" + ++ lib.optional enablePython "--with-python" + ++ lib.optional enablePerl "--with-perl"; meta = with lib; { description = "Full-featured text-mode web browser"; diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix index dba0cf0e30cb..7780edc2f9d9 100644 --- a/pkgs/applications/networking/browsers/firefox-bin/default.nix +++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix @@ -52,7 +52,8 @@ let policies = { DisableAppUpdate = true; - } // config.firefox.policies or { }; + } + // config.firefox.policies or { }; policiesJson = writeText "firefox-policies.json" (builtins.toJSON { inherit policies; }); @@ -76,17 +77,16 @@ stdenv.mkDerivation { sourceRoot = lib.optional stdenv.hostPlatform.isDarwin "."; - nativeBuildInputs = - [ - wrapGAppsHook3 - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - autoPatchelfHook - patchelfUnstable - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - undmg - ]; + nativeBuildInputs = [ + wrapGAppsHook3 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + autoPatchelfHook + patchelfUnstable + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + undmg + ]; buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ gtk3 adwaita-icon-theme @@ -94,14 +94,13 @@ stdenv.mkDerivation { dbus-glib libXtst ]; - runtimeDependencies = - [ - curl - pciutils - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libva.out - ]; + runtimeDependencies = [ + curl + pciutils + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libva.out + ]; appendRunpaths = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "${pipewire}/lib" ]; diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index b51cc38cbc0d..80c185d12f65 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -292,7 +292,8 @@ buildStdenv.mkDerivation { outputs = [ "out" - ] ++ lib.optionals crashreporterSupport [ "symbols" ]; + ] + ++ lib.optionals crashreporterSupport [ "symbols" ]; # Add another configure-build-profiling run before the final configure phase if we build with pgo preConfigurePhases = lib.optionals pgoSupport [ @@ -336,16 +337,15 @@ buildStdenv.mkDerivation { ] ++ extraPatches; - postPatch = - '' - rm -rf obj-x86_64-pc-linux-gnu - patchShebangs mach build - '' - # https://bugzilla.mozilla.org/show_bug.cgi?id=1927380 - + lib.optionalString (lib.versionAtLeast version "134") '' - sed -i "s/icu-i18n/icu-uc &/" js/moz.configure - '' - + extraPostPatch; + postPatch = '' + rm -rf obj-x86_64-pc-linux-gnu + patchShebangs mach build + '' + # https://bugzilla.mozilla.org/show_bug.cgi?id=1927380 + + lib.optionalString (lib.versionAtLeast version "134") '' + sed -i "s/icu-i18n/icu-uc &/" js/moz.configure + '' + + extraPostPatch; # Ignore trivial whitespace changes in patches, this fixes compatibility of # ./env_var_for_system_dir-*.patch with Firefox >=65 without having to track @@ -359,236 +359,232 @@ buildStdenv.mkDerivation { HOST_CC = "${llvmPackagesBuildBuild.stdenv.cc}/bin/cc"; HOST_CXX = "${llvmPackagesBuildBuild.stdenv.cc}/bin/c++"; - nativeBuildInputs = - [ - autoconf - cargo - gnum4 - llvmPackagesBuildBuild.bintools - makeWrapper - nodejs - perl - python3 - rust-cbindgen - rustPlatform.bindgenHook - rustc - unzip - which - wrapGAppsHook3 - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ rsync ] - ++ lib.optionals stdenv.hostPlatform.isx86 [ nasm ] - ++ lib.optionals crashreporterSupport [ - dump_syms - patchelf - ] - ++ lib.optionals pgoSupport [ xvfb-run ] - ++ extraNativeBuildInputs; + nativeBuildInputs = [ + autoconf + cargo + gnum4 + llvmPackagesBuildBuild.bintools + makeWrapper + nodejs + perl + python3 + rust-cbindgen + rustPlatform.bindgenHook + rustc + unzip + which + wrapGAppsHook3 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ rsync ] + ++ lib.optionals stdenv.hostPlatform.isx86 [ nasm ] + ++ lib.optionals crashreporterSupport [ + dump_syms + patchelf + ] + ++ lib.optionals pgoSupport [ xvfb-run ] + ++ extraNativeBuildInputs; setOutputFlags = false; # `./mach configure` doesn't understand `--*dir=` flags. - preConfigure = - '' - # Runs autoconf through ./mach configure in configurePhase - configureScript="$(realpath ./mach) configure" + preConfigure = '' + # Runs autoconf through ./mach configure in configurePhase + configureScript="$(realpath ./mach) configure" - # Set reproducible build date; https://bugzilla.mozilla.org/show_bug.cgi?id=885777#c21 - export MOZ_BUILD_DATE=$(head -n1 sourcestamp.txt) + # Set reproducible build date; https://bugzilla.mozilla.org/show_bug.cgi?id=885777#c21 + export MOZ_BUILD_DATE=$(head -n1 sourcestamp.txt) - # Set predictable directories for build and state - export MOZ_OBJDIR=$(pwd)/objdir - export MOZBUILD_STATE_PATH=$TMPDIR/mozbuild + # Set predictable directories for build and state + export MOZ_OBJDIR=$(pwd)/objdir + export MOZBUILD_STATE_PATH=$TMPDIR/mozbuild - # Don't try to send libnotify notifications during build - export MOZ_NOSPAM=1 + # Don't try to send libnotify notifications during build + export MOZ_NOSPAM=1 - # Set consistent remoting name to ensure wmclass matches with desktop file - export MOZ_APP_REMOTINGNAME="${binaryName}" + # Set consistent remoting name to ensure wmclass matches with desktop file + export MOZ_APP_REMOTINGNAME="${binaryName}" - # AS=as in the environment causes build failure - # https://bugzilla.mozilla.org/show_bug.cgi?id=1497286 - unset AS + # AS=as in the environment causes build failure + # https://bugzilla.mozilla.org/show_bug.cgi?id=1497286 + unset AS - # Use our own python - export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system + # Use our own python + export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system - # RBox WASM Sandboxing - export WASM_CC=${pkgsCross.wasi32.stdenv.cc}/bin/${pkgsCross.wasi32.stdenv.cc.targetPrefix}cc - export WASM_CXX=${pkgsCross.wasi32.stdenv.cc}/bin/${pkgsCross.wasi32.stdenv.cc.targetPrefix}c++ - '' - + lib.optionalString pgoSupport '' - if [ -e "$TMPDIR/merged.profdata" ]; then - echo "Configuring with profiling data" - for i in "''${!configureFlagsArray[@]}"; do - if [[ ''${configureFlagsArray[i]} = "--enable-profile-generate=cross" ]]; then - unset 'configureFlagsArray[i]' - fi - done - appendToVar configureFlags --enable-profile-use=cross - appendToVar configureFlags --with-pgo-profile-path=$TMPDIR/merged.profdata - appendToVar configureFlags --with-pgo-jarlog=$TMPDIR/jarlog - ${lib.optionalString stdenv.hostPlatform.isMusl '' - LDFLAGS="$OLD_LDFLAGS" - unset OLD_LDFLAGS - ''} - else - echo "Configuring to generate profiling data" - configureFlagsArray+=( - "--enable-profile-generate=cross" - ) - ${lib.optionalString stdenv.hostPlatform.isMusl - # Set the rpath appropriately for the profiling run - # During the profiling run, loading libraries from $out would fail, - # since the profiling build has not been installed to $out - '' - OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="-Wl,-rpath,$(pwd)/objdir/dist/${binaryName}" - '' - } - fi - '' - + lib.optionalString (enableOfficialBranding && !stdenv.hostPlatform.is32bit) '' - export MOZILLA_OFFICIAL=1 - '' - + lib.optionalString (!requireSigning) '' - export MOZ_REQUIRE_SIGNING= - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - # linking firefox hits the vm.max_map_count kernel limit with the default musl allocator - # TODO: Default vm.max_map_count has been increased, retest without this - export LD_PRELOAD=${mimalloc}/lib/libmimalloc.so - ''; + # RBox WASM Sandboxing + export WASM_CC=${pkgsCross.wasi32.stdenv.cc}/bin/${pkgsCross.wasi32.stdenv.cc.targetPrefix}cc + export WASM_CXX=${pkgsCross.wasi32.stdenv.cc}/bin/${pkgsCross.wasi32.stdenv.cc.targetPrefix}c++ + '' + + lib.optionalString pgoSupport '' + if [ -e "$TMPDIR/merged.profdata" ]; then + echo "Configuring with profiling data" + for i in "''${!configureFlagsArray[@]}"; do + if [[ ''${configureFlagsArray[i]} = "--enable-profile-generate=cross" ]]; then + unset 'configureFlagsArray[i]' + fi + done + appendToVar configureFlags --enable-profile-use=cross + appendToVar configureFlags --with-pgo-profile-path=$TMPDIR/merged.profdata + appendToVar configureFlags --with-pgo-jarlog=$TMPDIR/jarlog + ${lib.optionalString stdenv.hostPlatform.isMusl '' + LDFLAGS="$OLD_LDFLAGS" + unset OLD_LDFLAGS + ''} + else + echo "Configuring to generate profiling data" + configureFlagsArray+=( + "--enable-profile-generate=cross" + ) + ${lib.optionalString stdenv.hostPlatform.isMusl + # Set the rpath appropriately for the profiling run + # During the profiling run, loading libraries from $out would fail, + # since the profiling build has not been installed to $out + '' + OLD_LDFLAGS="$LDFLAGS" + LDFLAGS="-Wl,-rpath,$(pwd)/objdir/dist/${binaryName}" + '' + } + fi + '' + + lib.optionalString (enableOfficialBranding && !stdenv.hostPlatform.is32bit) '' + export MOZILLA_OFFICIAL=1 + '' + + lib.optionalString (!requireSigning) '' + export MOZ_REQUIRE_SIGNING= + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + # linking firefox hits the vm.max_map_count kernel limit with the default musl allocator + # TODO: Default vm.max_map_count has been increased, retest without this + export LD_PRELOAD=${mimalloc}/lib/libmimalloc.so + ''; # firefox has a different definition of configurePlatforms from nixpkgs, see configureFlags configurePlatforms = [ ]; - configureFlags = + configureFlags = [ + "--disable-tests" + "--disable-updater" + "--enable-application=${application}" + "--enable-default-toolkit=${toolkit}" + "--with-app-name=${binaryName}" + "--with-distribution-id=org.nixos" + "--with-libclang-path=${lib.getLib llvmPackagesBuildBuild.libclang}/lib" + "--with-wasi-sysroot=${wasiSysRoot}" + # for firefox, host is buildPlatform, target is hostPlatform + "--host=${buildStdenv.buildPlatform.config}" + "--target=${buildStdenv.hostPlatform.config}" + ] + # LTO is done using clang and lld on Linux. + ++ lib.optionals ltoSupport [ + "--enable-lto=cross,full" # Cross-Language LTO + "--enable-linker=lld" + ] + ++ lib.optional (isElfhackPlatform stdenv) (enableFeature elfhackSupport "elf-hack") + ++ lib.optional (!drmSupport) "--disable-eme" + ++ lib.optional allowAddonSideload "--allow-addon-sideload" + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # MacOS builds use bundled versions of libraries: https://bugzilla.mozilla.org/show_bug.cgi?id=1776255 + "--enable-system-pixman" + "--with-system-ffi" + "--with-system-icu" + "--with-system-jpeg" + "--with-system-libevent" + "--with-system-libvpx" + "--with-system-nspr" + "--with-system-nss" + "--with-system-png" # needs APNG support + "--with-system-webp" + "--with-system-zlib" + + # These options are not available on MacOS, even --disable-* + (enableFeature alsaSupport "alsa") + (enableFeature jackSupport "jack") + (enableFeature pulseaudioSupport "pulseaudio") + (enableFeature sndioSupport "sndio") + ] + ++ [ + (enableFeature crashreporterSupport "crashreporter") + (enableFeature ffmpegSupport "ffmpeg") + (enableFeature geolocationSupport "necko-wifi") + (enableFeature gssSupport "negotiateauth") + (enableFeature jemallocSupport "jemalloc") + (enableFeature webrtcSupport "webrtc") + + (enableFeature debugBuild "debug") + (if debugBuild then "--enable-profiling" else "--enable-optimize") + # --enable-release adds -ffunction-sections & LTO that require a big amount + # of RAM, and the 32-bit memory space cannot handle that linking + (enableFeature (!debugBuild && !stdenv.hostPlatform.is32bit) "release") + (enableFeature enableDebugSymbols "debug-symbols") + ] + ++ lib.optionals enableDebugSymbols [ + "--disable-strip" + "--disable-install-strip" + ] + # As of Firefox 137 (https://bugzilla.mozilla.org/show_bug.cgi?id=1943009), + # the --enable-official-branding flag overrides the --with-branding flag. + ++ lib.optional (enableOfficialBranding && branding == null) "--enable-official-branding" + ++ lib.optional (branding != null) "--with-branding=${branding}" + ++ extraConfigureFlags; + + buildInputs = [ + bzip2 + file + libGL + libGLU + libstartup_notification + perl + zip + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (if lib.versionAtLeast version "138" then apple-sdk_15 else apple-sdk_14) + cups + ] + ++ (lib.optionals (!stdenv.hostPlatform.isDarwin) ( [ - "--disable-tests" - "--disable-updater" - "--enable-application=${application}" - "--enable-default-toolkit=${toolkit}" - "--with-app-name=${binaryName}" - "--with-distribution-id=org.nixos" - "--with-libclang-path=${lib.getLib llvmPackagesBuildBuild.libclang}/lib" - "--with-wasi-sysroot=${wasiSysRoot}" - # for firefox, host is buildPlatform, target is hostPlatform - "--host=${buildStdenv.buildPlatform.config}" - "--target=${buildStdenv.hostPlatform.config}" + dbus + dbus-glib + fontconfig + freetype + glib + gtk3 + libffi + libevent + libjpeg + libpng + libvpx + libwebp + nspr + pango + xorg.libX11 + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXft + xorg.libXi + xorg.libXrender + xorg.libXt + xorg.libXtst + xorg.pixman + xorg.xorgproto + zlib + ( + if (lib.versionAtLeast version "129") then nss_latest else nss_esr # 3.90 + ) ] - # LTO is done using clang and lld on Linux. - ++ lib.optionals ltoSupport [ - "--enable-lto=cross,full" # Cross-Language LTO - "--enable-linker=lld" + ++ lib.optional alsaSupport alsa-lib + ++ lib.optional jackSupport libjack2 + ++ lib.optional pulseaudioSupport libpulseaudio # only headers are needed + ++ lib.optional sndioSupport sndio + ++ lib.optionals waylandSupport [ + libxkbcommon + libdrm ] - ++ lib.optional (isElfhackPlatform stdenv) (enableFeature elfhackSupport "elf-hack") - ++ lib.optional (!drmSupport) "--disable-eme" - ++ lib.optional allowAddonSideload "--allow-addon-sideload" - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # MacOS builds use bundled versions of libraries: https://bugzilla.mozilla.org/show_bug.cgi?id=1776255 - "--enable-system-pixman" - "--with-system-ffi" - "--with-system-icu" - "--with-system-jpeg" - "--with-system-libevent" - "--with-system-libvpx" - "--with-system-nspr" - "--with-system-nss" - "--with-system-png" # needs APNG support - "--with-system-webp" - "--with-system-zlib" - - # These options are not available on MacOS, even --disable-* - (enableFeature alsaSupport "alsa") - (enableFeature jackSupport "jack") - (enableFeature pulseaudioSupport "pulseaudio") - (enableFeature sndioSupport "sndio") - ] - ++ [ - (enableFeature crashreporterSupport "crashreporter") - (enableFeature ffmpegSupport "ffmpeg") - (enableFeature geolocationSupport "necko-wifi") - (enableFeature gssSupport "negotiateauth") - (enableFeature jemallocSupport "jemalloc") - (enableFeature webrtcSupport "webrtc") - - (enableFeature debugBuild "debug") - (if debugBuild then "--enable-profiling" else "--enable-optimize") - # --enable-release adds -ffunction-sections & LTO that require a big amount - # of RAM, and the 32-bit memory space cannot handle that linking - (enableFeature (!debugBuild && !stdenv.hostPlatform.is32bit) "release") - (enableFeature enableDebugSymbols "debug-symbols") - ] - ++ lib.optionals enableDebugSymbols [ - "--disable-strip" - "--disable-install-strip" - ] - # As of Firefox 137 (https://bugzilla.mozilla.org/show_bug.cgi?id=1943009), - # the --enable-official-branding flag overrides the --with-branding flag. - ++ lib.optional (enableOfficialBranding && branding == null) "--enable-official-branding" - ++ lib.optional (branding != null) "--with-branding=${branding}" - ++ extraConfigureFlags; - - buildInputs = - [ - bzip2 - file - libGL - libGLU - libstartup_notification - perl - zip - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (if lib.versionAtLeast version "138" then apple-sdk_15 else apple-sdk_14) - cups - ] - ++ (lib.optionals (!stdenv.hostPlatform.isDarwin) ( - [ - dbus - dbus-glib - fontconfig - freetype - glib - gtk3 - libffi - libevent - libjpeg - libpng - libvpx - libwebp - nspr - pango - xorg.libX11 - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXft - xorg.libXi - xorg.libXrender - xorg.libXt - xorg.libXtst - xorg.pixman - xorg.xorgproto - zlib - ( - if (lib.versionAtLeast version "129") then nss_latest else nss_esr # 3.90 - ) - ] - ++ lib.optional alsaSupport alsa-lib - ++ lib.optional jackSupport libjack2 - ++ lib.optional pulseaudioSupport libpulseaudio # only headers are needed - ++ lib.optional sndioSupport sndio - ++ lib.optionals waylandSupport [ - libxkbcommon - libdrm - ] - )) - ++ [ (if (lib.versionAtLeast version "138") then icu77 else icu73) ] - ++ lib.optional gssSupport libkrb5 - ++ lib.optional jemallocSupport jemalloc - ++ extraBuildInputs; + )) + ++ [ (if (lib.versionAtLeast version "138") then icu77 else icu73) ] + ++ lib.optional gssSupport libkrb5 + ++ lib.optional jemallocSupport jemalloc + ++ extraBuildInputs; profilingPhase = lib.optionalString pgoSupport '' # Package up Firefox for profiling @@ -706,7 +702,8 @@ buildStdenv.mkDerivation { inherit gtk3; inherit wasiSysRoot; version = packageVersion; - } // extraPassthru; + } + // extraPassthru; hardeningDisable = [ "format" ]; # -Werror=format-security diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index e994dbd9fe16..cdb5ff484a9a 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -149,38 +149,36 @@ let ) (lib.optionals usesNixExtensions nixExtensions); enterprisePolicies = { - policies = - { - DisableAppUpdate = true; + policies = { + DisableAppUpdate = true; + } + // lib.optionalAttrs usesNixExtensions { + ExtensionSettings = { + "*" = { + blocked_install_message = "You can't have manual extension mixed with nix extensions"; + installation_mode = "blocked"; + }; } - // lib.optionalAttrs usesNixExtensions { - ExtensionSettings = - { - "*" = { - blocked_install_message = "You can't have manual extension mixed with nix extensions"; - installation_mode = "blocked"; - }; - } - // lib.foldr ( - e: ret: - ret - // { - "${e.extid}" = { - installation_mode = "allowed"; - }; - } - ) { } extensions; + // lib.foldr ( + e: ret: + ret + // { + "${e.extid}" = { + installation_mode = "allowed"; + }; + } + ) { } extensions; - Extensions = { - Install = lib.foldr (e: ret: ret ++ [ "${e.outPath}/${e.extid}.xpi" ]) [ ] extensions; - }; - } - // lib.optionalAttrs smartcardSupport { - SecurityDevices = { - "OpenSC PKCS#11 Module" = "opensc-pkcs11.so"; - }; - } - // extraPolicies; + Extensions = { + Install = lib.foldr (e: ret: ret ++ [ "${e.outPath}/${e.extid}.xpi" ]) [ ] extensions; + }; + } + // lib.optionalAttrs smartcardSupport { + SecurityDevices = { + "OpenSC PKCS#11 Module" = "opensc-pkcs11.so"; + }; + } + // extraPolicies; }; mozillaCfg = '' @@ -291,71 +289,70 @@ let ]; buildInputs = lib.optionals (!isDarwin) [ browser.gtk3 ]; - makeWrapperArgs = - [ - "--prefix" - "LD_LIBRARY_PATH" - ":" - "${finalAttrs.libs}" + makeWrapperArgs = [ + "--prefix" + "LD_LIBRARY_PATH" + ":" + "${finalAttrs.libs}" - "--suffix" - "PATH" - ":" - "${placeholder "out"}/bin" + "--suffix" + "PATH" + ":" + "${placeholder "out"}/bin" - "--set" - "MOZ_APP_LAUNCHER" - launcherName + "--set" + "MOZ_APP_LAUNCHER" + launcherName - "--set" - "MOZ_LEGACY_PROFILES" - "1" + "--set" + "MOZ_LEGACY_PROFILES" + "1" - "--set" - "MOZ_ALLOW_DOWNGRADE" - "1" - ] - ++ lib.optionals (!isDarwin) [ - "--suffix" - "GTK_PATH" - ":" - "${lib.concatStringsSep ":" finalAttrs.gtk_modules}" + "--set" + "MOZ_ALLOW_DOWNGRADE" + "1" + ] + ++ lib.optionals (!isDarwin) [ + "--suffix" + "GTK_PATH" + ":" + "${lib.concatStringsSep ":" finalAttrs.gtk_modules}" - "--suffix" - "XDG_DATA_DIRS" - ":" - "${adwaita-icon-theme}/share" + "--suffix" + "XDG_DATA_DIRS" + ":" + "${adwaita-icon-theme}/share" - "--set-default" - "MOZ_ENABLE_WAYLAND" - "1" + "--set-default" + "MOZ_ENABLE_WAYLAND" + "1" - ] - ++ lib.optionals (!xdg-utils.meta.broken && !isDarwin) [ - # make xdg-open overridable at runtime - "--suffix" - "PATH" - ":" - "${lib.makeBinPath [ xdg-utils ]}" + ] + ++ lib.optionals (!xdg-utils.meta.broken && !isDarwin) [ + # make xdg-open overridable at runtime + "--suffix" + "PATH" + ":" + "${lib.makeBinPath [ xdg-utils ]}" - ] - ++ lib.optionals hasMozSystemDirPatch [ - "--set" - "MOZ_SYSTEM_DIR" - "${placeholder "out"}/lib/mozilla" + ] + ++ lib.optionals hasMozSystemDirPatch [ + "--set" + "MOZ_SYSTEM_DIR" + "${placeholder "out"}/lib/mozilla" - ] - ++ lib.optionals (!hasMozSystemDirPatch && allNativeMessagingHosts != [ ]) [ + ] + ++ lib.optionals (!hasMozSystemDirPatch && allNativeMessagingHosts != [ ]) [ + "--run" + ''mkdir -p ''${MOZ_HOME:-~/.mozilla}/native-messaging-hosts'' + + ] + ++ lib.optionals (!hasMozSystemDirPatch) ( + lib.concatMap (ext: [ "--run" - ''mkdir -p ''${MOZ_HOME:-~/.mozilla}/native-messaging-hosts'' - - ] - ++ lib.optionals (!hasMozSystemDirPatch) ( - lib.concatMap (ext: [ - "--run" - ''ln -sfLt ''${MOZ_HOME:-~/.mozilla}/native-messaging-hosts ${ext}/lib/mozilla/native-messaging-hosts/*'' - ]) allNativeMessagingHosts - ); + ''ln -sfLt ''${MOZ_HOME:-~/.mozilla}/native-messaging-hosts ${ext}/lib/mozilla/native-messaging-hosts/*'' + ]) allNativeMessagingHosts + ); buildCommand = let diff --git a/pkgs/applications/networking/browsers/netsurf/browser.nix b/pkgs/applications/networking/browsers/netsurf/browser.nix index 6396009fd47a..bc734f614071 100644 --- a/pkgs/applications/networking/browsers/netsurf/browser.nix +++ b/pkgs/applications/networking/browsers/netsurf/browser.nix @@ -60,44 +60,44 @@ stdenv.mkDerivation (finalAttrs: { perlPackages.perl pkg-config xxd - ] ++ lib.optional (uilib == "gtk2" || uilib == "gtk3") wrapGAppsHook3; + ] + ++ lib.optional (uilib == "gtk2" || uilib == "gtk3") wrapGAppsHook3; - buildInputs = - [ - check - curl - gperf - libXcursor - libXrandr - libidn - libjpeg - libjxl - libpng - libwebp - libxml2 - openssl + buildInputs = [ + check + curl + gperf + libXcursor + libXrandr + libidn + libjpeg + libjxl + libpng + libwebp + libxml2 + openssl - libcss - libdom - libhubbub - libnsbmp - libnsfb - libnsgif - libnslog - libnspsl - libnsutils - libparserutils - libsvgtiny - libutf8proc - libwapcaplet - nsgenbind - ] - ++ lib.optionals (uilib == "framebuffer") [ - expat - SDL - ] - ++ lib.optional (uilib == "gtk2") gtk2 - ++ lib.optional (uilib == "gtk3") gtk3; + libcss + libdom + libhubbub + libnsbmp + libnsfb + libnsgif + libnslog + libnspsl + libnsutils + libparserutils + libsvgtiny + libutf8proc + libwapcaplet + nsgenbind + ] + ++ lib.optionals (uilib == "framebuffer") [ + expat + SDL + ] + ++ lib.optional (uilib == "gtk2") gtk2 + ++ lib.optional (uilib == "gtk3") gtk3; # Since at least 2018 AD, GCC and other compilers run in `-fno-common` mode as # default, in order to comply with C standards and also get rid of some bad diff --git a/pkgs/applications/networking/browsers/netsurf/libparserutils.nix b/pkgs/applications/networking/browsers/netsurf/libparserutils.nix index 55bc05cbbf11..9541103975a6 100644 --- a/pkgs/applications/networking/browsers/netsurf/libparserutils.nix +++ b/pkgs/applications/networking/browsers/netsurf/libparserutils.nix @@ -16,14 +16,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-MX7VxxjxeSe1chl0uuXeMsP9bQVdsTGtMbQxKgMu0Tk="; }; - buildInputs = - [ - perl - buildsystem - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + perl + buildsystem + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; makeFlags = [ "PREFIX=$(out)" diff --git a/pkgs/applications/networking/browsers/palemoon/bin.nix b/pkgs/applications/networking/browsers/palemoon/bin.nix index f06f97e6cf0a..20658e875909 100644 --- a/pkgs/applications/networking/browsers/palemoon/bin.nix +++ b/pkgs/applications/networking/browsers/palemoon/bin.nix @@ -37,17 +37,16 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - alsa-lib - dbus-glib - gtk2-x11 - libXt - (lib.getLib stdenv.cc.cc) - ] - ++ lib.optionals withGTK3 [ - gtk3 - ]; + buildInputs = [ + alsa-lib + dbus-glib + gtk2-x11 + libXt + (lib.getLib stdenv.cc.cc) + ] + ++ lib.optionals withGTK3 [ + gtk3 + ]; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/applications/networking/cluster/docker-machine/kvm2.nix b/pkgs/applications/networking/cluster/docker-machine/kvm2.nix index bf4bb2734f42..45baa6d8079a 100644 --- a/pkgs/applications/networking/cluster/docker-machine/kvm2.nix +++ b/pkgs/applications/networking/cluster/docker-machine/kvm2.nix @@ -16,11 +16,9 @@ buildGoModule rec { pname = "docker-machine-kvm2"; - postPatch = - minikube.postPatch - + '' - sed -i '/GOARCH=$*/d' Makefile - ''; + postPatch = minikube.postPatch + '' + sed -i '/GOARCH=$*/d' Makefile + ''; buildPhase = '' make docker-machine-driver-kvm2 COMMIT=${src.rev} diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 554e4fa4b29a..105621a2598a 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -65,7 +65,8 @@ let nativeBuildInputs = [ makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib stdenv.cc.cc) openssl @@ -75,67 +76,66 @@ let libtirpc ]; - installPhase = - '' - mkdir $out - mv * $out/ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - for n in $(find ${finalAttrs.containerExecutor}/bin -type f); do - ln -sf "$n" $out/bin - done + installPhase = '' + mkdir $out + mv * $out/ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + for n in $(find ${finalAttrs.containerExecutor}/bin -type f); do + ln -sf "$n" $out/bin + done - # these libraries are loaded at runtime by the JVM - ln -s ${lib.getLib cyrus_sasl}/lib/libsasl2.so $out/lib/native/libsasl2.so.2 - ln -s ${lib.getLib openssl}/lib/libcrypto.so $out/lib/native/ - ln -s ${lib.getLib zlib}/lib/libz.so.1 $out/lib/native/ - ln -s ${lib.getLib zstd}/lib/libzstd.so.1 $out/lib/native/ - ln -s ${lib.getLib bzip2}/lib/libbz2.so.1 $out/lib/native/ - ln -s ${lib.getLib snappy}/lib/libsnappy.so.1 $out/lib/native/ + # these libraries are loaded at runtime by the JVM + ln -s ${lib.getLib cyrus_sasl}/lib/libsasl2.so $out/lib/native/libsasl2.so.2 + ln -s ${lib.getLib openssl}/lib/libcrypto.so $out/lib/native/ + ln -s ${lib.getLib zlib}/lib/libz.so.1 $out/lib/native/ + ln -s ${lib.getLib zstd}/lib/libzstd.so.1 $out/lib/native/ + ln -s ${lib.getLib bzip2}/lib/libbz2.so.1 $out/lib/native/ + ln -s ${lib.getLib snappy}/lib/libsnappy.so.1 $out/lib/native/ - # libjvm.so is in different paths for java 8 and 11 - # libnativetask.so in hadooop 3 and libhdfs.so in hadoop 2 depend on it - find $out/lib/native/ -name 'libnativetask.so*' -o -name 'libhdfs.so*' | \ - xargs -n1 patchelf --add-rpath $(dirname $(find ${finalAttrs.jdk.home} -name libjvm.so | head -n1)) + # libjvm.so is in different paths for java 8 and 11 + # libnativetask.so in hadooop 3 and libhdfs.so in hadoop 2 depend on it + find $out/lib/native/ -name 'libnativetask.so*' -o -name 'libhdfs.so*' | \ + xargs -n1 patchelf --add-rpath $(dirname $(find ${finalAttrs.jdk.home} -name libjvm.so | head -n1)) - # NixOS/nixpkgs#193370 - # This workaround is needed to use protobuf 3.19 - # hadoop 3.3+ depends on protobuf 3.18, 3.2 depends on 3.8 - find $out/lib/native -name 'libhdfspp.so*' | \ - xargs -r -n1 patchelf --replace-needed libprotobuf.so.${ - if (lib.versionAtLeast finalAttrs.version "3.4.1") then - "32" - else if (lib.versionAtLeast finalAttrs.version "3.3") then - "18" - else - "8" - } libprotobuf.so + # NixOS/nixpkgs#193370 + # This workaround is needed to use protobuf 3.19 + # hadoop 3.3+ depends on protobuf 3.18, 3.2 depends on 3.8 + find $out/lib/native -name 'libhdfspp.so*' | \ + xargs -r -n1 patchelf --replace-needed libprotobuf.so.${ + if (lib.versionAtLeast finalAttrs.version "3.4.1") then + "32" + else if (lib.versionAtLeast finalAttrs.version "3.3") then + "18" + else + "8" + } libprotobuf.so - patchelf --replace-needed libcrypto.so.1.1 libcrypto.so \ - $out/lib/native/{libhdfs{pp,}.so*,examples/{pipes-sort,wordcount-nopipe,wordcount-part,wordcount-simple}} + patchelf --replace-needed libcrypto.so.1.1 libcrypto.so \ + $out/lib/native/{libhdfs{pp,}.so*,examples/{pipes-sort,wordcount-nopipe,wordcount-part,wordcount-simple}} - '' - + '' - for n in $(find $out/bin -type f ! -name "*.*"); do - wrapProgram "$n"\ - --set-default JAVA_HOME ${finalAttrs.jdk.home}\ - --set-default HADOOP_HOME $out/\ - --run "test -d /etc/hadoop-conf && export HADOOP_CONF_DIR=\''${HADOOP_CONF_DIR-'/etc/hadoop-conf/'}"\ - --set-default HADOOP_CONF_DIR $out/etc/hadoop/\ - --prefix PATH : "${ - lib.makeBinPath [ - bash - coreutils - which - ] - }"\ - --prefix JAVA_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" - done - '' - + (lib.optionalString sparkSupport '' - # Add the spark shuffle service jar to YARN - cp ${spark.src}/yarn/spark-${spark.version}-yarn-shuffle.jar $out/share/hadoop/yarn/ - ''); + '' + + '' + for n in $(find $out/bin -type f ! -name "*.*"); do + wrapProgram "$n"\ + --set-default JAVA_HOME ${finalAttrs.jdk.home}\ + --set-default HADOOP_HOME $out/\ + --run "test -d /etc/hadoop-conf && export HADOOP_CONF_DIR=\''${HADOOP_CONF_DIR-'/etc/hadoop-conf/'}"\ + --set-default HADOOP_CONF_DIR $out/etc/hadoop/\ + --prefix PATH : "${ + lib.makeBinPath [ + bash + coreutils + which + ] + }"\ + --prefix JAVA_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" + done + '' + + (lib.optionalString sparkSupport '' + # Add the spark shuffle service jar to YARN + cp ${spark.src}/yarn/spark-${spark.version}-yarn-shuffle.jar $out/share/hadoop/yarn/ + ''); passthru = { inherit tests; }; diff --git a/pkgs/applications/networking/cluster/k3s/builder.nix b/pkgs/applications/networking/cluster/k3s/builder.nix index 6d23342c9136..a165b8f68fb7 100644 --- a/pkgs/applications/networking/cluster/k3s/builder.nix +++ b/pkgs/applications/networking/cluster/k3s/builder.nix @@ -466,26 +466,25 @@ buildGoModule rec { runHook postInstallCheck ''; - passthru = - { - inherit airgapImages; - k3sCNIPlugins = k3sCNIPlugins; - k3sContainerd = k3sContainerd; - k3sRepo = k3sRepo; - k3sRoot = k3sRoot; - k3sBundle = k3sBundle; - mkTests = - version: - let - k3s_version = "k3s_" + lib.replaceStrings [ "." ] [ "_" ] (lib.versions.majorMinor version); - in - lib.mapAttrs (name: value: nixosTests.k3s.${name}.${k3s_version}) nixosTests.k3s; - tests = passthru.mkTests k3sVersion; - updateScript = updateScript; - } - // (lib.mapAttrs' ( - name: _: lib.nameValuePair (kebabToCamel name) (fetchurl imagesVersions.${name}) - ) imagesVersions); + passthru = { + inherit airgapImages; + k3sCNIPlugins = k3sCNIPlugins; + k3sContainerd = k3sContainerd; + k3sRepo = k3sRepo; + k3sRoot = k3sRoot; + k3sBundle = k3sBundle; + mkTests = + version: + let + k3s_version = "k3s_" + lib.replaceStrings [ "." ] [ "_" ] (lib.versions.majorMinor version); + in + lib.mapAttrs (name: value: nixosTests.k3s.${name}.${k3s_version}) nixosTests.k3s; + tests = passthru.mkTests k3sVersion; + updateScript = updateScript; + } + // (lib.mapAttrs' ( + name: _: lib.nameValuePair (kebabToCamel name) (fetchurl imagesVersions.${name}) + ) imagesVersions); meta = baseMeta; } diff --git a/pkgs/applications/networking/cluster/rke2/builder.nix b/pkgs/applications/networking/cluster/rke2/builder.nix index bd8795f6ccaa..e8b3809b6156 100644 --- a/pkgs/applications/networking/cluster/rke2/builder.nix +++ b/pkgs/applications/networking/cluster/rke2/builder.nix @@ -148,7 +148,8 @@ buildGoModule (finalAttrs: { }; } // moduleTests; - } // (lib.mapAttrs (_: value: fetchurl value) imagesVersions); + } + // (lib.mapAttrs (_: value: fetchurl value) imagesVersions); meta = { homepage = "https://github.com/rancher/rke2"; diff --git a/pkgs/applications/networking/cluster/spark/default.nix b/pkgs/applications/networking/cluster/spark/default.nix index 4ce7f56f2197..2609c4fd0a2b 100644 --- a/pkgs/applications/networking/cluster/spark/default.nix +++ b/pkgs/applications/networking/cluster/spark/default.nix @@ -83,7 +83,8 @@ let kamilchm illustris ]; - } // extraMeta; + } + // extraMeta; }); in { diff --git a/pkgs/applications/networking/firehol/default.nix b/pkgs/applications/networking/firehol/default.nix index 18ebf9e1618d..a05258dcfcac 100644 --- a/pkgs/applications/networking/firehol/default.nix +++ b/pkgs/applications/networking/firehol/default.nix @@ -73,7 +73,8 @@ stdenv.mkDerivation rec { "--disable-doc" "--disable-man" "--disable-update-ipsets" - ] ++ lib.optionals onlyQOS [ "--disable-firehol" ]; + ] + ++ lib.optionals onlyQOS [ "--disable-firehol" ]; meta = with lib; { description = "Firewall for humans"; diff --git a/pkgs/applications/networking/hpmyroom/default.nix b/pkgs/applications/networking/hpmyroom/default.nix index fd68b718d40b..38bab9d0ce62 100644 --- a/pkgs/applications/networking/hpmyroom/default.nix +++ b/pkgs/applications/networking/hpmyroom/default.nix @@ -36,29 +36,28 @@ mkDerivation rec { autoPatchelfHook ]; - buildInputs = - [ - libuuid - libXtst - libXScrnSaver - libXfixes - alsa-lib - freetype - fontconfig - libXext - libGL - libpng - libxcb - libpulseaudio - libdrm - glib # For libgobject - stdenv.cc.cc # For libstdc++ - xorg.libX11 - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - ]); + buildInputs = [ + libuuid + libXtst + libXScrnSaver + libXfixes + alsa-lib + freetype + fontconfig + libXext + libGL + libpng + libxcb + libpulseaudio + libdrm + glib # For libgobject + stdenv.cc.cc # For libstdc++ + xorg.libX11 + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + ]); unpackPhase = '' rpmextract $src diff --git a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix index b1cac93af625..7014d5ba3a6c 100644 --- a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix +++ b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix @@ -26,25 +26,23 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ] ++ lib.optional doCheck check; - buildInputs = - [ - gnutls - libotr - python3 - ] - ++ lib.optional enableLibPurple pidgin - ++ lib.optional enablePam pam; + buildInputs = [ + gnutls + libotr + python3 + ] + ++ lib.optional enableLibPurple pidgin + ++ lib.optional enablePam pam; propagatedBuildInputs = [ glib ]; - configureFlags = - [ - "--otr=1" - "--ssl=gnutls" - "--pidfile=/var/lib/bitlbee/bitlbee.pid" - ] - ++ lib.optional enableLibPurple "--purple=1" - ++ lib.optional enablePam "--pam=1"; + configureFlags = [ + "--otr=1" + "--ssl=gnutls" + "--pidfile=/var/lib/bitlbee/bitlbee.pid" + ] + ++ lib.optional enableLibPurple "--purple=1" + ++ lib.optional enablePam "--pam=1"; patches = [ # This should be dropped once the issue is fixed upstream. diff --git a/pkgs/applications/networking/instant-messengers/gajim/default.nix b/pkgs/applications/networking/instant-messengers/gajim/default.nix index 76e575fc1afd..2ac8aa22808f 100644 --- a/pkgs/applications/networking/instant-messengers/gajim/default.nix +++ b/pkgs/applications/networking/instant-messengers/gajim/default.nix @@ -49,25 +49,24 @@ python3.pkgs.buildPythonApplication rec { format = "pyproject"; - buildInputs = - [ - gtk4 - adwaita-icon-theme - gtksourceview5 - glib-networking - ] - ++ lib.optionals enableJingle [ - farstream - gstreamer - gst-plugins-base - gst-libav - gst-plugins-good - libnice - ] - ++ lib.optional enableSecrets libsecret - ++ lib.optional enableSpelling gspell - ++ lib.optional enableUPnP gupnp-igd - ++ lib.optional enableAppIndicator libappindicator-gtk3; + buildInputs = [ + gtk4 + adwaita-icon-theme + gtksourceview5 + glib-networking + ] + ++ lib.optionals enableJingle [ + farstream + gstreamer + gst-plugins-base + gst-libav + gst-plugins-good + libnice + ] + ++ lib.optional enableSecrets libsecret + ++ lib.optional enableSpelling gspell + ++ lib.optional enableUPnP gupnp-igd + ++ lib.optional enableAppIndicator libappindicator-gtk3; nativeBuildInputs = [ gettext diff --git a/pkgs/applications/networking/instant-messengers/jami/default.nix b/pkgs/applications/networking/instant-messengers/jami/default.nix index 5524ed9fcf0e..91ea5934b35f 100644 --- a/pkgs/applications/networking/instant-messengers/jami/default.nix +++ b/pkgs/applications/networking/instant-messengers/jami/default.nix @@ -111,7 +111,8 @@ stdenv.mkDerivation rec { "--disable-resample" "--disable-libwebrtc" "--with-gnutls=yes" - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "--enable-epoll" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "--enable-epoll" ]; buildInputs = old.buildInputs ++ [ gnutls ]; }); @@ -275,7 +276,8 @@ stdenv.mkDerivation rec { qtpositioning qtsvg qtwebchannel - ] ++ lib.optionals withWebengine [ qtwebengine ]; + ] + ++ lib.optionals withWebengine [ qtwebengine ]; cmakeFlags = lib.optionals (!withWebengine) [ "-DWITH_WEBENGINE=false" ]; diff --git a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix index 1addd4fe76db..105f579db066 100644 --- a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix +++ b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix @@ -22,13 +22,12 @@ python3Packages.buildPythonApplication rec { hash = "sha256-g+ZWarZnjlSOpD75yf53Upqj1qDlil7pdbfEsMAsjh0="; }; - build-system = - [ - installShellFiles - ] - ++ (with python3Packages; [ - setuptools - ]); + build-system = [ + installShellFiles + ] + ++ (with python3Packages; [ + setuptools + ]); pythonRelaxDeps = [ "matrix-nio" diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix index 725fb267f615..f3878220f640 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix @@ -99,46 +99,44 @@ let ] ++ lib.optional stdenv.hostPlatform.isDarwin gtk2-x11; - propagatedBuildInputs = - [ - pkg-config - gettext - ] - ++ (with perlPackages; [ - perl - XMLParser - ]) - ++ lib.optional stdenv.hostPlatform.isLinux gtk2 - ++ lib.optional stdenv.hostPlatform.isDarwin gtk2-x11; + propagatedBuildInputs = [ + pkg-config + gettext + ] + ++ (with perlPackages; [ + perl + XMLParser + ]) + ++ lib.optional stdenv.hostPlatform.isLinux gtk2 + ++ lib.optional stdenv.hostPlatform.isDarwin gtk2-x11; patches = [ ./add-search-path.patch ./pidgin-makefile.patch ]; - configureFlags = - [ - "--with-nspr-includes=${nspr.dev}/include/nspr" - "--with-nspr-libs=${nspr.out}/lib" - "--with-nss-includes=${nss.dev}/include/nss" - "--with-nss-libs=${nss.out}/lib" - "--with-ncurses-headers=${ncurses.dev}/include" - "--with-system-ssl-certs=${cacert}/etc/ssl/certs" - "--disable-meanwhile" - "--disable-nm" - "--disable-tcl" - "--disable-gevolution" - ] - ++ lib.optionals withCyrus_sasl [ "--enable-cyrus-sasl=yes" ] - ++ lib.optionals withGnutls [ - "--enable-gnutls=yes" - "--enable-nss=no" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--disable-gtkspell" - "--disable-vv" - ] - ++ lib.optionals stdenv.cc.isClang [ "CFLAGS=-Wno-error=int-conversion" ]; + configureFlags = [ + "--with-nspr-includes=${nspr.dev}/include/nspr" + "--with-nspr-libs=${nspr.out}/lib" + "--with-nss-includes=${nss.dev}/include/nss" + "--with-nss-libs=${nss.out}/lib" + "--with-ncurses-headers=${ncurses.dev}/include" + "--with-system-ssl-certs=${cacert}/etc/ssl/certs" + "--disable-meanwhile" + "--disable-nm" + "--disable-tcl" + "--disable-gevolution" + ] + ++ lib.optionals withCyrus_sasl [ "--enable-cyrus-sasl=yes" ] + ++ lib.optionals withGnutls [ + "--enable-gnutls=yes" + "--enable-nss=no" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--disable-gtkspell" + "--disable-vv" + ] + ++ lib.optionals stdenv.cc.isClang [ "CFLAGS=-Wno-error=int-conversion" ]; enableParallelBuilding = true; diff --git a/pkgs/applications/networking/instant-messengers/profanity/default.nix b/pkgs/applications/networking/instant-messengers/profanity/default.nix index fa4ca8190625..82f4dafc83d5 100644 --- a/pkgs/applications/networking/instant-messengers/profanity/default.nix +++ b/pkgs/applications/networking/instant-messengers/profanity/default.nix @@ -61,50 +61,48 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - cmocka - curl - expat - expect - glib - libstrophe - libmicrohttpd - libotr - libuuid - ncurses - openssl - readline - sqlite - ] - ++ lib.optionals autoAwaySupport [ - libXScrnSaver - libX11 - ] - ++ lib.optionals notifySupport [ - libnotify - gdk-pixbuf - ] - ++ lib.optionals omemoSupport [ - libsignal-protocol-c - libgcrypt - qrencode - ] - ++ lib.optionals pgpSupport [ gpgme ] - ++ lib.optionals pythonPluginSupport [ python3 ] - ++ lib.optionals traySupport [ gtk3 ]; + buildInputs = [ + cmocka + curl + expat + expect + glib + libstrophe + libmicrohttpd + libotr + libuuid + ncurses + openssl + readline + sqlite + ] + ++ lib.optionals autoAwaySupport [ + libXScrnSaver + libX11 + ] + ++ lib.optionals notifySupport [ + libnotify + gdk-pixbuf + ] + ++ lib.optionals omemoSupport [ + libsignal-protocol-c + libgcrypt + qrencode + ] + ++ lib.optionals pgpSupport [ gpgme ] + ++ lib.optionals pythonPluginSupport [ python3 ] + ++ lib.optionals traySupport [ gtk3 ]; # Enable feature flags, so that build fail if libs are missing - configureFlags = - [ - "--enable-c-plugins" - "--enable-otr" - ] - ++ lib.optionals notifySupport [ "--enable-notifications" ] - ++ lib.optionals traySupport [ "--enable-icons-and-clipboard" ] - ++ lib.optionals pgpSupport [ "--enable-pgp" ] - ++ lib.optionals pythonPluginSupport [ "--enable-python-plugins" ] - ++ lib.optionals omemoSupport [ "--enable-omemo" ]; + configureFlags = [ + "--enable-c-plugins" + "--enable-otr" + ] + ++ lib.optionals notifySupport [ "--enable-notifications" ] + ++ lib.optionals traySupport [ "--enable-icons-and-clipboard" ] + ++ lib.optionals pgpSupport [ "--enable-pgp" ] + ++ lib.optionals pythonPluginSupport [ "--enable-python-plugins" ] + ++ lib.optionals omemoSupport [ "--enable-omemo" ]; doCheck = true; diff --git a/pkgs/applications/networking/instant-messengers/psi-plus/default.nix b/pkgs/applications/networking/instant-messengers/psi-plus/default.nix index f34afe35601e..252c42aabd7f 100644 --- a/pkgs/applications/networking/instant-messengers/psi-plus/default.nix +++ b/pkgs/applications/networking/instant-messengers/psi-plus/default.nix @@ -60,47 +60,45 @@ mkDerivation rec { "-DBUILD_PSIMEDIA=${if enablePsiMedia then "ON" else "OFF"}" ]; - nativeBuildInputs = - [ - cmake - qttools - ] - ++ lib.optionals enablePsiMedia [ - pkg-config - ]; + nativeBuildInputs = [ + cmake + qttools + ] + ++ lib.optionals enablePsiMedia [ + pkg-config + ]; - buildInputs = - [ - qtbase - qtmultimedia - qtimageformats - qtx11extras - libidn - qca-qt5 - libXScrnSaver - hunspell - libsecret - libgcrypt - libgpg-error - usrsctp - qtkeychain - ] - ++ lib.optionals voiceMessagesSupport [ - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - ] - ++ lib.optionals enablePlugins [ - html-tidy - http-parser - libotr - libomemo-c - ] - ++ lib.optionals (chatType == "webkit") [ - qtwebkit - ] - ++ lib.optionals (chatType == "webengine") [ - qtwebengine - ]; + buildInputs = [ + qtbase + qtmultimedia + qtimageformats + qtx11extras + libidn + qca-qt5 + libXScrnSaver + hunspell + libsecret + libgcrypt + libgpg-error + usrsctp + qtkeychain + ] + ++ lib.optionals voiceMessagesSupport [ + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + ] + ++ lib.optionals enablePlugins [ + html-tidy + http-parser + libotr + libomemo-c + ] + ++ lib.optionals (chatType == "webkit") [ + qtwebkit + ] + ++ lib.optionals (chatType == "webengine") [ + qtwebengine + ]; preFixup = lib.optionalString voiceMessagesSupport '' qtWrapperArgs+=( diff --git a/pkgs/applications/networking/instant-messengers/ripcord/default.nix b/pkgs/applications/networking/instant-messengers/ripcord/default.nix index fdfa1fd0184e..97e66ff4a258 100644 --- a/pkgs/applications/networking/instant-messengers/ripcord/default.nix +++ b/pkgs/applications/networking/instant-messengers/ripcord/default.nix @@ -42,26 +42,25 @@ mkDerivation rec { desktop-file-utils imagemagick ]; - buildInputs = - [ - libsodium - libopus - libGL - alsa-lib - ] - ++ [ - qtbase - qtsvg - qtmultimedia - qtwebsockets - qtimageformats - ] - ++ (with xorg; [ - libX11 - libXScrnSaver - libXcursor - xkeyboardconfig - ]); + buildInputs = [ + libsodium + libopus + libGL + alsa-lib + ] + ++ [ + qtbase + qtsvg + qtmultimedia + qtwebsockets + qtimageformats + ] + ++ (with xorg; [ + libX11 + libXScrnSaver + libXcursor + xkeyboardconfig + ]); fontsConf = makeFontsConf { fontDirectories = [ twemoji-color-font ]; diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix index 642f6c22de4f..96b84b979a89 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/default.nix @@ -24,32 +24,30 @@ stdenv.mkDerivation (finalAttrs: { inherit unwrapped; - nativeBuildInputs = - [ - wrapQtAppsHook - ] - ++ lib.optionals withWebkit [ - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + wrapQtAppsHook + ] + ++ lib.optionals withWebkit [ + wrapGAppsHook3 + ]; - buildInputs = - [ - qtbase - qtimageformats - qtsvg - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - kimageformats - qtwayland - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libavif - libheif - libjxl - ] - ++ lib.optionals withWebkit [ - glib-networking - ]; + buildInputs = [ + qtbase + qtimageformats + qtsvg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + kimageformats + qtwayland + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libavif + libheif + libjxl + ] + ++ lib.optionals withWebkit [ + glib-networking + ]; qtWrapperArgs = lib.optionals (stdenv.hostPlatform.isLinux && withWebkit) [ "--prefix" diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/tg_owt.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/tg_owt.nix index b0329f76eed8..2a8509ac30b4 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/tg_owt.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/tg_owt.nix @@ -63,35 +63,34 @@ stdenv.mkDerivation { python3 ]; - propagatedBuildInputs = - [ - libjpeg - openssl - libopus - ffmpeg_6 - openh264 - crc32c - libvpx - abseil-cpp - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXtst - libXcomposite - libXdamage - libXext - libXrender - libXrandr - libXi - glib - pipewire - libgbm - libdrm - libGL - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_15 - ]; + propagatedBuildInputs = [ + libjpeg + openssl + libopus + ffmpeg_6 + openh264 + crc32c + libvpx + abseil-cpp + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXtst + libXcomposite + libXdamage + libXext + libXrender + libXrandr + libXi + glib + pipewire + libgbm + libdrm + libGL + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_15 + ]; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/unwrapped.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/unwrapped.nix index 09e45cb750c7..e99b37ffc1ec 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/unwrapped.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-desktop/unwrapped.nix @@ -52,47 +52,45 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-yU2Ai2JgxDlaTK5GsL+yWkwtFbk14tPRAj1Rdt+gmmQ="; }; - nativeBuildInputs = - [ - pkg-config - cmake - ninja - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # to build bundled libdispatch - clang - gobject-introspection - ]; + nativeBuildInputs = [ + pkg-config + cmake + ninja + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # to build bundled libdispatch + clang + gobject-introspection + ]; - buildInputs = - [ - qtbase - qtsvg - lz4 - xxHash - ffmpeg_6 - openalSoft - minizip - range-v3 - tl-expected - rnnoise - tg_owt - microsoft-gsl - boost - ada - (tdlib.override { tde2eOnly = true; }) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - protobuf - qtwayland - kcoreaddons - hunspell - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_15 - libicns - ]; + buildInputs = [ + qtbase + qtsvg + lz4 + xxHash + ffmpeg_6 + openalSoft + minizip + range-v3 + tl-expected + rnnoise + tg_owt + microsoft-gsl + boost + ada + (tdlib.override { tde2eOnly = true; }) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + protobuf + qtwayland + kcoreaddons + hunspell + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_15 + libicns + ]; dontWrapQtApps = true; diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix index e87c9896370a..9fffbd27288c 100644 --- a/pkgs/applications/networking/irc/quassel/default.nix +++ b/pkgs/applications/networking/irc/quassel/default.nix @@ -63,43 +63,41 @@ in cmake makeWrapper ]; - buildInputs = - [ - qtbase - boost - zlib - ] - ++ lib.optionals buildCore [ - qtscript - qca-qt5 - openldap - ] - ++ lib.optionals buildClient [ - libdbusmenu - phonon - ] - ++ lib.optionals (buildClient && withKDE) [ - extra-cmake-modules - kconfigwidgets - kcoreaddons - knotifications - knotifyconfig - ktextwidgets - kwidgetsaddons - kxmlgui - ]; + buildInputs = [ + qtbase + boost + zlib + ] + ++ lib.optionals buildCore [ + qtscript + qca-qt5 + openldap + ] + ++ lib.optionals buildClient [ + libdbusmenu + phonon + ] + ++ lib.optionals (buildClient && withKDE) [ + extra-cmake-modules + kconfigwidgets + kcoreaddons + knotifications + knotifyconfig + ktextwidgets + kwidgetsaddons + kxmlgui + ]; - cmakeFlags = - [ - "-DEMBED_DATA=OFF" - "-DUSE_QT5=ON" - ] - ++ edf static "STATIC" - ++ edf monolithic "WANT_MONO" - ++ edf enableDaemon "WANT_CORE" - ++ edf enableDaemon "WITH_LDAP" - ++ edf client "WANT_QTCLIENT" - ++ edf withKDE "WITH_KDE"; + cmakeFlags = [ + "-DEMBED_DATA=OFF" + "-DUSE_QT5=ON" + ] + ++ edf static "STATIC" + ++ edf monolithic "WANT_MONO" + ++ edf enableDaemon "WANT_CORE" + ++ edf enableDaemon "WITH_LDAP" + ++ edf client "WANT_QTCLIENT" + ++ edf withKDE "WITH_KDE"; dontWrapQtApps = true; diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix index e57d2bd58bca..d87c8b6b7f4d 100644 --- a/pkgs/applications/networking/irc/weechat/default.nix +++ b/pkgs/applications/networking/irc/weechat/default.nix @@ -92,7 +92,8 @@ let libxml2 pcre2 libargon2 - ] ++ lib.optional stdenv.hostPlatform.isLinux systemd; + ] + ++ lib.optional stdenv.hostPlatform.isLinux systemd; } ]; enabledPlugins = builtins.filter (p: p.enabled) plugins; @@ -116,43 +117,43 @@ stdenv.mkDerivation rec { outputs = [ "out" "man" - ] ++ map (p: p.name) enabledPlugins; + ] + ++ map (p: p.name) enabledPlugins; - cmakeFlags = - [ - (lib.cmakeBool "ENABLE_MAN" true) - (lib.cmakeBool "ENABLE_DOC" true) - (lib.cmakeBool "ENABLE_DOC_INCOMPLETE" true) - (lib.cmakeBool "ENABLE_TESTS" enableTests) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeFeature "ICONV_LIBRARY" "${libiconv}/lib/libiconv.dylib") - ] - ++ map (p: lib.cmakeBool p.cmakeFlag p.enabled) plugins; + cmakeFlags = [ + (lib.cmakeBool "ENABLE_MAN" true) + (lib.cmakeBool "ENABLE_DOC" true) + (lib.cmakeBool "ENABLE_DOC_INCOMPLETE" true) + (lib.cmakeBool "ENABLE_TESTS" enableTests) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeFeature "ICONV_LIBRARY" "${libiconv}/lib/libiconv.dylib") + ] + ++ map (p: lib.cmakeBool p.cmakeFlag p.enabled) plugins; nativeBuildInputs = [ cmake pkg-config asciidoctor - ] ++ lib.optional enableTests cpputest; + ] + ++ lib.optional enableTests cpputest; - buildInputs = - [ - ncurses - openssl - aspell - cjson - gnutls - gettext - zlib - curl - libgcrypt - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libresolv - ] - ++ lib.concatMap (p: p.buildInputs) enabledPlugins - ++ extraBuildInputs; + buildInputs = [ + ncurses + openssl + aspell + cjson + gnutls + gettext + zlib + curl + libgcrypt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libresolv + ] + ++ lib.concatMap (p: p.buildInputs) enabledPlugins + ++ extraBuildInputs; hardeningEnable = [ "pie" ]; diff --git a/pkgs/applications/networking/libcoap/default.nix b/pkgs/applications/networking/libcoap/default.nix index bef56def692c..239ef8516a7f 100644 --- a/pkgs/applications/networking/libcoap/default.nix +++ b/pkgs/applications/networking/libcoap/default.nix @@ -23,24 +23,24 @@ stdenv.mkDerivation rec { fetchSubmodules = true; hash = "sha256-QNrsR6VarZ2favvTZ9pMhVafwF2fOjYLKcyNqZyUl6s="; }; - nativeBuildInputs = - [ - automake - autoconf - which - libtool - pkg-config - ] - ++ lib.optional withTLS gnutls - ++ lib.optionals withDocs [ - doxygen - asciidoc - ]; + nativeBuildInputs = [ + automake + autoconf + which + libtool + pkg-config + ] + ++ lib.optional withTLS gnutls + ++ lib.optionals withDocs [ + doxygen + asciidoc + ]; preConfigure = "./autogen.sh"; - configureFlags = - [ "--disable-shared" ] - ++ lib.optional (!withDocs) "--disable-documentation" - ++ lib.optional withTLS "--enable-dtls"; + configureFlags = [ + "--disable-shared" + ] + ++ lib.optional (!withDocs) "--disable-documentation" + ++ lib.optional withTLS "--enable-dtls"; meta = with lib; { homepage = "https://github.com/obgm/libcoap"; description = "CoAP (RFC 7252) implementation in C"; diff --git a/pkgs/applications/networking/mailreaders/mailnag/default.nix b/pkgs/applications/networking/mailreaders/mailnag/default.nix index 65e5332d2039..fdde80e8f0b5 100644 --- a/pkgs/applications/networking/mailreaders/mailnag/default.nix +++ b/pkgs/applications/networking/mailreaders/mailnag/default.nix @@ -44,7 +44,8 @@ python3Packages.buildPythonApplication rec { gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad libsecret - ] ++ pluginsDeps; + ] + ++ pluginsDeps; nativeBuildInputs = [ gettext diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix index a00eb83a2a5e..1a21bdd6ae25 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/default.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix @@ -43,57 +43,53 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-uIuwKnbEa62NMT/Su0+OOSmLUfZvy+swTZ+Aw+73BOM="; }; - nativeBuildInputs = - [ - pkg-config - doxygen # (optional) api docs - pythonPackages.sphinx # (optional) documentation -> doc/INSTALL - texinfo # (optional) documentation -> doc/INSTALL - pythonPackages.cffi - ] - ++ lib.optional withEmacs emacs - ++ lib.optional withRuby ruby - ++ lib.optional withSfsexp makeWrapper; + nativeBuildInputs = [ + pkg-config + doxygen # (optional) api docs + pythonPackages.sphinx # (optional) documentation -> doc/INSTALL + texinfo # (optional) documentation -> doc/INSTALL + pythonPackages.cffi + ] + ++ lib.optional withEmacs emacs + ++ lib.optional withRuby ruby + ++ lib.optional withSfsexp makeWrapper; - buildInputs = - [ - gnupg # undefined dependencies - xapian - gmime3 - talloc - zlib # dependencies described in INSTALL - perl - pythonPackages.python - ] - ++ lib.optional withRuby ruby - ++ lib.optional withSfsexp sfsexp; + buildInputs = [ + gnupg # undefined dependencies + xapian + gmime3 + talloc + zlib # dependencies described in INSTALL + perl + pythonPackages.python + ] + ++ lib.optional withRuby ruby + ++ lib.optional withSfsexp sfsexp; - postPatch = - '' - patchShebangs configure test/ + postPatch = '' + patchShebangs configure test/ - substituteInPlace lib/Makefile.local \ - --replace '-install_name $(libdir)' "-install_name $out/lib" + substituteInPlace lib/Makefile.local \ + --replace '-install_name $(libdir)' "-install_name $out/lib" - # do not override CFLAGS of the Makefile created by mkmf - substituteInPlace bindings/Makefile.local \ - --replace 'CFLAGS="$(CFLAGS) -pipe -fno-plt -fPIC"' "" - '' - + lib.optionalString withEmacs '' - substituteInPlace emacs/notmuch-emacs-mua \ - --replace 'EMACS:-emacs' 'EMACS:-${emacs}/bin/emacs' \ - --replace 'EMACSCLIENT:-emacsclient' 'EMACSCLIENT:-${emacs}/bin/emacsclient' - ''; + # do not override CFLAGS of the Makefile created by mkmf + substituteInPlace bindings/Makefile.local \ + --replace 'CFLAGS="$(CFLAGS) -pipe -fno-plt -fPIC"' "" + '' + + lib.optionalString withEmacs '' + substituteInPlace emacs/notmuch-emacs-mua \ + --replace 'EMACS:-emacs' 'EMACS:-${emacs}/bin/emacs' \ + --replace 'EMACSCLIENT:-emacsclient' 'EMACSCLIENT:-${emacs}/bin/emacsclient' + ''; - configureFlags = - [ - "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions" - "--bashcompletiondir=${placeholder "out"}/share/bash-completion/completions" - "--infodir=${placeholder "info"}/share/info" - ] - ++ lib.optional (!withEmacs) "--without-emacs" - ++ lib.optional withEmacs "--emacslispdir=${placeholder "emacs"}/share/emacs/site-lisp" - ++ lib.optional (!withRuby) "--without-ruby"; + configureFlags = [ + "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions" + "--bashcompletiondir=${placeholder "out"}/share/bash-completion/completions" + "--infodir=${placeholder "info"}/share/info" + ] + ++ lib.optional (!withEmacs) "--without-emacs" + ++ lib.optional withEmacs "--emacslispdir=${placeholder "emacs"}/share/emacs/site-lisp" + ++ lib.optional (!withRuby) "--without-ruby"; # Notmuch doesn't use autoconf and consequently doesn't tag --bindir and # friends @@ -106,15 +102,14 @@ stdenv.mkDerivation (finalAttrs: { cp bindings/python-cffi/_notmuch_config.py ${placeholder "bindingconfig"}/ ''; - outputs = - [ - "out" - "man" - "info" - "bindingconfig" - ] - ++ lib.optional withEmacs "emacs" - ++ lib.optional withVim "vim"; + outputs = [ + "out" + "man" + "info" + "bindingconfig" + ] + ++ lib.optional withEmacs "emacs" + ++ lib.optional withVim "vim"; # if notmuch is built with s-expression support, the testsuite (T-850.sh) only # passes if notmuch-git can be executed, so we need to patch its shebang. @@ -144,19 +139,18 @@ stdenv.mkDerivation (finalAttrs: { doCheck = !stdenv.hostPlatform.isDarwin && (lib.versionAtLeast gmime3.version "3.0.3"); checkTarget = "test"; - nativeCheckInputs = - [ - which - dtach - openssl - bash - gdb - man - ] - # for the test T-850.sh for notmuch-git, which is skipped when notmuch is - # built without sexp-support - ++ lib.optional withEmacs emacs - ++ lib.optional withSfsexp git; + nativeCheckInputs = [ + which + dtach + openssl + bash + gdb + man + ] + # for the test T-850.sh for notmuch-git, which is skipped when notmuch is + # built without sexp-support + ++ lib.optional withEmacs emacs + ++ lib.optional withSfsexp git; installTargets = [ "install" diff --git a/pkgs/applications/networking/mailreaders/notmuch/mutt.nix b/pkgs/applications/networking/mailreaders/notmuch/mutt.nix index c1a1137564d1..a8e304a65b42 100644 --- a/pkgs/applications/networking/mailreaders/notmuch/mutt.nix +++ b/pkgs/applications/networking/mailreaders/notmuch/mutt.nix @@ -17,20 +17,19 @@ stdenv.mkDerivation { dontStrip = true; nativeBuildInputs = [ makeWrapper ]; - buildInputs = - [ - perl - ] - ++ (with perlPackages; [ - FileRemove - DigestSHA1 - Later - MailBox - MailMaildir - MailTools - StringShellQuote - TermReadLineGnu - ]); + buildInputs = [ + perl + ] + ++ (with perlPackages; [ + FileRemove + DigestSHA1 + Later + MailBox + MailMaildir + MailTools + StringShellQuote + TermReadLineGnu + ]); src = notmuch.src; diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix index a94c451aa0e7..06377f89c6fe 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix @@ -45,7 +45,8 @@ let policies = { DisableAppUpdate = true; - } // config.thunderbird.policies or { }; + } + // config.thunderbird.policies or { }; policiesJson = writeText "thunderbird-policies.json" (builtins.toJSON { inherit policies; }); defaultSource = lib.findFirst (sourceMatches "en-US") { } sources; diff --git a/pkgs/applications/networking/mailreaders/thunderbird/packages.nix b/pkgs/applications/networking/mailreaders/thunderbird/packages.nix index 2c18e5d84221..3a77c7fd60c8 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/packages.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/packages.nix @@ -44,19 +44,18 @@ let url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz"; inherit sha512; }; - extraPatches = - [ - # The file to be patched is different from firefox's `no-buildconfig-ffx90.patch`. - (if lib.versionOlder version "140" then ./no-buildconfig.patch else ./no-buildconfig-tb140.patch) - ] - ++ lib.optionals (lib.versionOlder version "139") [ - # clang-19 fixes for char_traits build issue - # https://github.com/rnpgp/rnp/pull/2242/commits/e0790a2c4ff8e09d52522785cec1c9db23d304ac - # https://github.com/rnpgp/sexpp/pull/54/commits/46744a14ffc235330bb99cebfaf294829c31bba4 - # Remove when upstream bumps bundled rnp version: https://bugzilla.mozilla.org/show_bug.cgi?id=1893950 - ./0001-Removed-lookup-against-basic_string-uint8_t.patch - ./0001-Implemented-char_traits-for-SEXP-octet_t.patch - ]; + extraPatches = [ + # The file to be patched is different from firefox's `no-buildconfig-ffx90.patch`. + (if lib.versionOlder version "140" then ./no-buildconfig.patch else ./no-buildconfig-tb140.patch) + ] + ++ lib.optionals (lib.versionOlder version "139") [ + # clang-19 fixes for char_traits build issue + # https://github.com/rnpgp/rnp/pull/2242/commits/e0790a2c4ff8e09d52522785cec1c9db23d304ac + # https://github.com/rnpgp/sexpp/pull/54/commits/46744a14ffc235330bb99cebfaf294829c31bba4 + # Remove when upstream bumps bundled rnp version: https://bugzilla.mozilla.org/show_bug.cgi?id=1893950 + ./0001-Removed-lookup-against-basic_string-uint8_t.patch + ./0001-Implemented-char_traits-for-SEXP-octet_t.patch + ]; extraPassthru = { icu73 = icu73'; diff --git a/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix b/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix index 88499068e953..6ecddebe7845 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix @@ -23,11 +23,9 @@ browser: args: # https://anweshadas.in/how-to-use-yubikey-or-any-gpg-smartcard-in-thunderbird-78/ # For that to work out of the box, it requires `gnupg` on PATH and # `gpgme` in `LD_LIBRARY_PATH`; we do this below. - buildCommand = - old.buildCommand - + '' - wrapProgram "$executablePath" \ - --prefix LD_LIBRARY_PATH ':' "${lib.makeLibraryPath [ gpgme ]}" \ - --prefix PATH ':' "${lib.makeBinPath [ gnupg ]}" - ''; + buildCommand = old.buildCommand + '' + wrapProgram "$executablePath" \ + --prefix LD_LIBRARY_PATH ':' "${lib.makeLibraryPath [ gpgme ]}" \ + --prefix PATH ':' "${lib.makeBinPath [ gnupg ]}" + ''; }) diff --git a/pkgs/applications/networking/mkchromecast/default.nix b/pkgs/applications/networking/mkchromecast/default.nix index 3bbe97d7538c..dec636d0bf85 100644 --- a/pkgs/applications/networking/mkchromecast/default.nix +++ b/pkgs/applications/networking/mkchromecast/default.nix @@ -28,7 +28,8 @@ let nodejs ffmpeg youtube-dl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pulseaudio ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pulseaudio ]; in python3Packages.buildPythonApplication { @@ -78,16 +79,15 @@ python3Packages.buildPythonApplication { "--prefix PATH : ${lib.makeBinPath packages}" ]; - postInstall = - '' - substituteInPlace $out/${python3Packages.python.sitePackages}/mkchromecast/video.py \ - --replace '/usr/share/mkchromecast/nodejs/' '${placeholder "out"}/share/mkchromecast/nodejs/' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install -Dm 755 -t $out/bin bin/audiodevice - substituteInPlace $out/${python3Packages.python.sitePackages}/mkchromecast/audio_devices.py \ - --replace './bin/audiodevice' '${placeholder "out"}/bin/audiodevice' - ''; + postInstall = '' + substituteInPlace $out/${python3Packages.python.sitePackages}/mkchromecast/video.py \ + --replace '/usr/share/mkchromecast/nodejs/' '${placeholder "out"}/share/mkchromecast/nodejs/' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install -Dm 755 -t $out/bin bin/audiodevice + substituteInPlace $out/${python3Packages.python.sitePackages}/mkchromecast/audio_devices.py \ + --replace './bin/audiodevice' '${placeholder "out"}/bin/audiodevice' + ''; meta = with lib; { homepage = "https://mkchromecast.com/"; diff --git a/pkgs/applications/networking/mullvad/mullvad.nix b/pkgs/applications/networking/mullvad/mullvad.nix index c193e5e0a48e..a759861a3571 100644 --- a/pkgs/applications/networking/mullvad/mullvad.nix +++ b/pkgs/applications/networking/mullvad/mullvad.nix @@ -97,14 +97,14 @@ rustPlatform.buildRustPackage rec { ln -s ${shadowsocks-rust}/bin/sslocal $out/share/mullvad '' + - # Set the directory where Mullvad will look for its resources by default to - # `$out/share`, so that we can avoid putting the files in `$out/bin` -- - # Mullvad defaults to looking inside the directory its binary is located in - # for its resources. - '' - wrapProgram $out/bin/mullvad-daemon \ - --set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad" - ''; + # Set the directory where Mullvad will look for its resources by default to + # `$out/share`, so that we can avoid putting the files in `$out/bin` -- + # Mullvad defaults to looking inside the directory its binary is located in + # for its resources. + '' + wrapProgram $out/bin/mullvad-daemon \ + --set-default MULLVAD_RESOURCE_DIR "$out/share/mullvad" + ''; __darwinAllowLocalNetworking = true; diff --git a/pkgs/applications/networking/mullvad/openvpn.nix b/pkgs/applications/networking/mullvad/openvpn.nix index 9b9a3d85590b..f851f85796cf 100644 --- a/pkgs/applications/networking/mullvad/openvpn.nix +++ b/pkgs/applications/networking/mullvad/openvpn.nix @@ -36,31 +36,30 @@ openvpn.overrideAttrs ( buildInputs = oldAttrs.buildInputs or [ ] ++ optional stdenv.hostPlatform.isLinux [ libnl.dev ]; - configureFlags = - [ - # Assignment instead of appending to make sure to use exactly the flags required by mullvad + configureFlags = [ + # Assignment instead of appending to make sure to use exactly the flags required by mullvad - # Flags are based on https://github.com/mullvad/mullvadvpn-app-binaries/blob/main/Makefile#L17 - "--enable-static" - "--disable-shared" - "--disable-debug" - "--disable-plugin-down-root" - "--disable-management" - "--disable-port-share" - "--disable-systemd" - "--disable-dependency-tracking" - "--disable-pkcs11" - "--disable-plugin-auth-pam" - "--enable-plugins" - "--disable-lzo" - "--disable-lz4" - "--enable-comp-stub" - ] - ++ optional stdenv.hostPlatform.isLinux [ - # Flags are based on https://github.com/mullvad/mullvadvpn-app-binaries/blob/main/Makefile#L35 - "--enable-dco" # requires libnl - "--disable-iproute2" - ]; + # Flags are based on https://github.com/mullvad/mullvadvpn-app-binaries/blob/main/Makefile#L17 + "--enable-static" + "--disable-shared" + "--disable-debug" + "--disable-plugin-down-root" + "--disable-management" + "--disable-port-share" + "--disable-systemd" + "--disable-dependency-tracking" + "--disable-pkcs11" + "--disable-plugin-auth-pam" + "--enable-plugins" + "--disable-lzo" + "--disable-lz4" + "--enable-comp-stub" + ] + ++ optional stdenv.hostPlatform.isLinux [ + # Flags are based on https://github.com/mullvad/mullvadvpn-app-binaries/blob/main/Makefile#L35 + "--enable-dco" # requires libnl + "--disable-iproute2" + ]; patches = oldAttrs.patches or [ ] ++ [ # look at compare to find the relevant commits @@ -103,11 +102,9 @@ openvpn.overrideAttrs ( sha256 = "sha256-Eeci6U6go1ujmbVQvIVM/xa4GSambLPSaowVIvtYlzQ="; }) ]; - postPatch = - oldAttrs.postPatch or "" - + '' - rm ./configure - ''; + postPatch = oldAttrs.postPatch or "" + '' + rm ./configure + ''; meta = oldAttrs.meta or { } // { description = "OpenVPN with Mullvad-specific patches applied"; diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index 2b85dcdf17d1..fda05185adff 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -55,18 +55,18 @@ let python3 qt5.wrapQtAppsHook qt5.qttools - ] ++ (overrides.nativeBuildInputs or [ ]); + ] + ++ (overrides.nativeBuildInputs or [ ]); - buildInputs = - [ - boost - poco - protobuf - microsoft-gsl - nlohmann_json - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ avahi ] - ++ (overrides.buildInputs or [ ]); + buildInputs = [ + boost + poco + protobuf + microsoft-gsl + nlohmann_json + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ avahi ] + ++ (overrides.buildInputs or [ ]); cmakeFlags = [ "-D g15=OFF" @@ -74,7 +74,8 @@ let "-D BUILD_NUMBER=${lib.versions.patch source.version}" "-D bundled-gsl=OFF" "-D bundled-json=OFF" - ] ++ (overrides.cmakeFlags or [ ]); + ] + ++ (overrides.cmakeFlags or [ ]); preConfigure = '' patchShebangs scripts @@ -101,31 +102,31 @@ let type = "mumble"; platforms = lib.platforms.darwin; - nativeBuildInputs = - [ qt5.qttools ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeWrapper - ]; + nativeBuildInputs = [ + qt5.qttools + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeWrapper + ]; - buildInputs = - [ - flac - libogg - libopus - libsndfile - libvorbis - speexdsp - qt5.qtsvg - rnnoise - ] - ++ lib.optional (!jackSupport && alsaSupport) alsa-lib - ++ lib.optional jackSupport libjack2 - ++ lib.optional speechdSupport speechd-minimal - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional pipewireSupport pipewire - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xar - ]; + buildInputs = [ + flac + libogg + libopus + libsndfile + libvorbis + speexdsp + qt5.qtsvg + rnnoise + ] + ++ lib.optional (!jackSupport && alsaSupport) alsa-lib + ++ lib.optional jackSupport libjack2 + ++ lib.optional speechdSupport speechd-minimal + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional pipewireSupport pipewire + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xar + ]; cmakeFlags = [ "-D server=OFF" @@ -194,15 +195,14 @@ let generic { type = "murmur"; - cmakeFlags = - [ - "-D client=OFF" - (lib.cmakeBool "ice" iceSupport) - ] - ++ lib.optionals iceSupport [ - "-D Ice_HOME=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}" - "-D Ice_SLICE_DIR=${lib.getDev zeroc-ice}/share/ice/slice" - ]; + cmakeFlags = [ + "-D client=OFF" + (lib.cmakeBool "ice" iceSupport) + ] + ++ lib.optionals iceSupport [ + "-D Ice_HOME=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}" + "-D Ice_SLICE_DIR=${lib.getDev zeroc-ice}/share/ice/slice" + ]; buildInputs = [ libcap ] ++ lib.optional iceSupport zeroc-ice; } source; diff --git a/pkgs/applications/networking/p2p/deluge/default.nix b/pkgs/applications/networking/p2p/deluge/default.nix index 183191f7a825..848c81bbe448 100644 --- a/pkgs/applications/networking/p2p/deluge/default.nix +++ b/pkgs/applications/networking/p2p/deluge/default.nix @@ -56,15 +56,14 @@ let pygobject3 ]; - nativeBuildInputs = - [ - intltool - glib - ] - ++ optionals withGUI [ - gobject-introspection - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + intltool + glib + ] + ++ optionals withGUI [ + gobject-introspection + wrapGAppsHook3 + ]; nativeCheckInputs = with pypkgs; [ pytestCheckHook @@ -77,24 +76,23 @@ let doCheck = false; # tests are not working at all - postInstall = - '' - install -Dm444 -t $out/lib/systemd/system packaging/systemd/*.service - '' - + ( - if withGUI then - '' - mkdir -p $out/share - cp -R deluge/ui/data/{icons,pixmaps} $out/share/ - install -Dm444 -t $out/share/applications deluge/ui/data/share/applications/deluge.desktop - '' - else - '' - rm -r $out/bin/deluge-gtk - rm -r $out/${python3Packages.python.sitePackages}/deluge/ui/gtk3 - rm -r $out/share/{icons,man/man1/deluge-gtk*,pixmaps} - '' - ); + postInstall = '' + install -Dm444 -t $out/lib/systemd/system packaging/systemd/*.service + '' + + ( + if withGUI then + '' + mkdir -p $out/share + cp -R deluge/ui/data/{icons,pixmaps} $out/share/ + install -Dm444 -t $out/share/applications deluge/ui/data/share/applications/deluge.desktop + '' + else + '' + rm -r $out/bin/deluge-gtk + rm -r $out/${python3Packages.python.sitePackages}/deluge/ui/gtk3 + rm -r $out/share/{icons,man/man1/deluge-gtk*,pixmaps} + '' + ); postFixup = '' for f in $out/lib/systemd/system/*; do diff --git a/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix b/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix index 5b122cc3fe55..116a1faaced0 100644 --- a/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix +++ b/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix @@ -63,7 +63,8 @@ mkDerivation rec { TermShellUI ] )) - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; cmakeFlags = [ "-DDBUS_NOTIFY=ON" diff --git a/pkgs/applications/networking/p2p/gnunet/default.nix b/pkgs/applications/networking/p2p/gnunet/default.nix index 849d94bb59e9..a7f7dbf90f5c 100644 --- a/pkgs/applications/networking/p2p/gnunet/default.nix +++ b/pkgs/applications/networking/p2p/gnunet/default.nix @@ -78,7 +78,8 @@ stdenv.mkDerivation (finalAttrs: { ncurses sqlite zlib - ] ++ lib.optional postgresqlSupport libpq; + ] + ++ lib.optional postgresqlSupport libpq; strictDeps = true; diff --git a/pkgs/applications/networking/p2p/jesec-rtorrent/default.nix b/pkgs/applications/networking/p2p/jesec-rtorrent/default.nix index 78f804fc6bce..ecc0ff81ad70 100644 --- a/pkgs/applications/networking/p2p/jesec-rtorrent/default.nix +++ b/pkgs/applications/networking/p2p/jesec-rtorrent/default.nix @@ -36,21 +36,19 @@ stdenv.mkDerivation rec { cmake ]; - buildInputs = - [ - curl - libtorrent - ncurses - ] - ++ lib.optional jsonRpcSupport nlohmann_json - ++ lib.optional xmlRpcSupport xmlrpc_c; + buildInputs = [ + curl + libtorrent + ncurses + ] + ++ lib.optional jsonRpcSupport nlohmann_json + ++ lib.optional xmlRpcSupport xmlrpc_c; - cmakeFlags = - [ - "-DUSE_RUNTIME_CA_DETECTION=NO" - ] - ++ lib.optional (!jsonRpcSupport) "-DUSE_JSONRPC=NO" - ++ lib.optional (!xmlRpcSupport) "-DUSE_XMLRPC=NO"; + cmakeFlags = [ + "-DUSE_RUNTIME_CA_DETECTION=NO" + ] + ++ lib.optional (!jsonRpcSupport) "-DUSE_JSONRPC=NO" + ++ lib.optional (!xmlRpcSupport) "-DUSE_XMLRPC=NO"; doCheck = true; diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix index ff24546291d7..b9cba535c37a 100644 --- a/pkgs/applications/networking/p2p/mldonkey/default.nix +++ b/pkgs/applications/networking/p2p/mldonkey/default.nix @@ -53,17 +53,16 @@ stdenv.mkDerivation rec { cd .. ''; - env = - { - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; - } - # https://github.com/ygrek/mldonkey/issues/117 - // lib.optionalAttrs stdenv.cc.isClang { - CXXFLAGS = "-std=c++98"; - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - NIX_LDFLAGS = "-liconv"; - }; + env = { + NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; + } + # https://github.com/ygrek/mldonkey/issues/117 + // lib.optionalAttrs stdenv.cc.isClang { + CXXFLAGS = "-std=c++98"; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-liconv"; + }; meta = { description = "Client for many p2p networks, with multiple frontends"; diff --git a/pkgs/applications/networking/p2p/transmission/4.nix b/pkgs/applications/networking/p2p/transmission/4.nix index 5a303aa17a94..be91f8d4bf07 100644 --- a/pkgs/applications/networking/p2p/transmission/4.nix +++ b/pkgs/applications/networking/p2p/transmission/4.nix @@ -91,19 +91,18 @@ stdenv.mkDerivation (finalAttrs: { "apparmor" ]; - cmakeFlags = - [ - (cmakeBool "ENABLE_CLI" enableCli) - (cmakeBool "ENABLE_DAEMON" enableDaemon) - (cmakeBool "ENABLE_GTK" enableGTK3) - (cmakeBool "ENABLE_MAC" false) # requires xcodebuild - (cmakeBool "ENABLE_QT" (enableQt5 || enableQt6)) - (cmakeBool "INSTALL_LIB" installLib) - ] - ++ optionals stdenv.hostPlatform.isDarwin [ - # Transmission sets this to 10.13 if not explicitly specified, see https://github.com/transmission/transmission/blob/0be7091eb12f4eb55f6690f313ef70a66795ee72/CMakeLists.txt#L7-L16. - "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}" - ]; + cmakeFlags = [ + (cmakeBool "ENABLE_CLI" enableCli) + (cmakeBool "ENABLE_DAEMON" enableDaemon) + (cmakeBool "ENABLE_GTK" enableGTK3) + (cmakeBool "ENABLE_MAC" false) # requires xcodebuild + (cmakeBool "ENABLE_QT" (enableQt5 || enableQt6)) + (cmakeBool "INSTALL_LIB" installLib) + ] + ++ optionals stdenv.hostPlatform.isDarwin [ + # Transmission sets this to 10.13 if not explicitly specified, see https://github.com/transmission/transmission/blob/0be7091eb12f4eb55f6690f313ef70a66795ee72/CMakeLists.txt#L7-L16. + "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}" + ]; postPatch = '' # Clean third-party libraries to ensure system ones are used. @@ -126,54 +125,52 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail '#if defined(HAVE_GETTEXT) && !defined(__APPLE__)' '#if defined(HAVE_GETTEXT)' ''; - nativeBuildInputs = - [ - pkg-config - cmake - python3 - ] - ++ optionals enableGTK3 [ wrapGAppsHook3 ] - ++ optionals enableQt5 [ qt5.wrapQtAppsHook ] - ++ optionals enableQt6 [ qt6Packages.wrapQtAppsHook ]; + nativeBuildInputs = [ + pkg-config + cmake + python3 + ] + ++ optionals enableGTK3 [ wrapGAppsHook3 ] + ++ optionals enableQt5 [ qt5.wrapQtAppsHook ] + ++ optionals enableQt6 [ qt6Packages.wrapQtAppsHook ]; - buildInputs = + buildInputs = [ + curl + dht + fmt + libb64 + libdeflate + libevent + libnatpmp + libpsl + libutp + miniupnpc + openssl + pcre + utf8cpp + zlib + ] + ++ optionals enableQt5 ( + with qt5; [ - curl - dht - fmt - libb64 - libdeflate - libevent - libnatpmp - libpsl - libutp - miniupnpc - openssl - pcre - utf8cpp - zlib + qttools + qtbase ] - ++ optionals enableQt5 ( - with qt5; - [ - qttools - qtbase - ] - ) - ++ optionals enableQt6 ( - with qt6Packages; - [ - qttools - qtbase - qtsvg - ] - ) - ++ optionals enableGTK3 [ - gtkmm3 - xorg.libpthreadstubs + ) + ++ optionals enableQt6 ( + with qt6Packages; + [ + qttools + qtbase + qtsvg ] - ++ optionals enableSystemd [ systemd ] - ++ optionals stdenv.hostPlatform.isLinux [ inotify-tools ]; + ) + ++ optionals enableGTK3 [ + gtkmm3 + xorg.libpthreadstubs + ] + ++ optionals enableSystemd [ systemd ] + ++ optionals stdenv.hostPlatform.isLinux [ inotify-tools ]; postInstall = '' mkdir $apparmor diff --git a/pkgs/applications/networking/protonvpn-gui/default.nix b/pkgs/applications/networking/protonvpn-gui/default.nix index af16cdc05a44..6a998264ead7 100644 --- a/pkgs/applications/networking/protonvpn-gui/default.nix +++ b/pkgs/applications/networking/protonvpn-gui/default.nix @@ -38,16 +38,15 @@ buildPythonApplication rec { wrapGAppsHook3 ]; - buildInputs = - [ - libnotify # gir typelib is used - ] - ++ lib.optionals withIndicator [ - # Adds AppIndicator3 namespace - libappindicator-gtk3 - # Adds AyatanaAppIndicator3 namespace - libayatana-appindicator - ]; + buildInputs = [ + libnotify # gir typelib is used + ] + ++ lib.optionals withIndicator [ + # Adds AppIndicator3 namespace + libappindicator-gtk3 + # Adds AyatanaAppIndicator3 namespace + libayatana-appindicator + ]; build-system = [ setuptools diff --git a/pkgs/applications/networking/seafile-client/default.nix b/pkgs/applications/networking/seafile-client/default.nix index 7b3ae093fcc1..9908879b4fb7 100644 --- a/pkgs/applications/networking/seafile-client/default.nix +++ b/pkgs/applications/networking/seafile-client/default.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { seafile-shared jansson libsearpc - ] ++ lib.optional withShibboleth qtwebengine; + ] + ++ lib.optional withShibboleth qtwebengine; cmakeFlags = lib.optional withShibboleth "-DBUILD_SHIBBOLETH_SUPPORT=ON"; diff --git a/pkgs/applications/networking/sniffers/qtwirediff/default.nix b/pkgs/applications/networking/sniffers/qtwirediff/default.nix index ba42abae84c8..f5be6f968381 100644 --- a/pkgs/applications/networking/sniffers/qtwirediff/default.nix +++ b/pkgs/applications/networking/sniffers/qtwirediff/default.nix @@ -25,31 +25,29 @@ stdenv.mkDerivation { wrapQtAppsHook ]; - buildInputs = - [ - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ]; + buildInputs = [ + qtbase + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ]; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r qtwirediff.app $out/Applications - makeWrapper $out/{Applications/qtwirediff.app/Contents/MacOS,bin}/qtwirediff - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm755 -T qtwirediff $out/bin/qtwirediff - wrapProgram $out/bin/qtwirediff \ - --prefix PATH : "${lib.makeBinPath [ wireshark-cli ]}" - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r qtwirediff.app $out/Applications + makeWrapper $out/{Applications/qtwirediff.app/Contents/MacOS,bin}/qtwirediff + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm755 -T qtwirediff $out/bin/qtwirediff + wrapProgram $out/bin/qtwirediff \ + --prefix PATH : "${lib.makeBinPath [ wireshark-cli ]}" + '' + + '' + runHook postInstall + ''; meta = { description = "Debugging tool to diff network traffic leveraging Wireshark"; diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 328d425b2a12..63917c553aae 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -78,91 +78,88 @@ stdenv.mkDerivation rec { buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - asciidoctor - bison - cmake - flex - makeWrapper - ninja - perl - pkg-config - python3 - ] - ++ lib.optionals withQt [ - qt6.wrapQtAppsHook - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + asciidoctor + bison + cmake + flex + makeWrapper + ninja + perl + pkg-config + python3 + ] + ++ lib.optionals withQt [ + qt6.wrapQtAppsHook + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; - buildInputs = + buildInputs = [ + bcg729 + c-ares + gettext + glib + gnutls + libgcrypt + libgpg-error + libkrb5 + libmaxminddb + libopus + libpcap + libsmi + libssh + lua5_4 + lz4 + minizip + nghttp2 + nghttp3 + opencore-amr + openssl + pcre2 + snappy + spandsp3 + speexdsp + zlib-ng + zstd + ] + ++ lib.optionals withQt ( + with qt6; [ - bcg729 - c-ares - gettext - glib - gnutls - libgcrypt - libgpg-error - libkrb5 - libmaxminddb - libopus - libpcap - libsmi - libssh - lua5_4 - lz4 - minizip - nghttp2 - nghttp3 - opencore-amr - openssl - pcre2 - snappy - spandsp3 - speexdsp - zlib-ng - zstd + qt5compat + qtbase + qtmultimedia + qtsvg + qttools ] - ++ lib.optionals withQt ( - with qt6; - [ - qt5compat - qtbase - qtmultimedia - qtsvg - qttools - ] - ) - ++ lib.optionals (withQt && stdenv.hostPlatform.isLinux) [ - qt6.qtwayland - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - libnl - sbc - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gmp - ]; + ) + ++ lib.optionals (withQt && stdenv.hostPlatform.isLinux) [ + qt6.qtwayland + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + libnl + sbc + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gmp + ]; strictDeps = true; - cmakeFlags = - [ - "-DBUILD_wireshark=${if withQt then "ON" else "OFF"}" - # Fix `extcap` and `plugins` paths. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16444 - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DENABLE_APPLICATION_BUNDLE=${if isAppBundle then "ON" else "OFF"}" - "-DLEMON_C_COMPILER=cc" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT=" - "-DHAVE_C99_VSNPRINTF_EXITCODE=0" - ]; + cmakeFlags = [ + "-DBUILD_wireshark=${if withQt then "ON" else "OFF"}" + # Fix `extcap` and `plugins` paths. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16444 + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DENABLE_APPLICATION_BUNDLE=${if isAppBundle then "ON" else "OFF"}" + "-DLEMON_C_COMPILER=cc" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT=" + "-DHAVE_C99_VSNPRINTF_EXITCODE=0" + ]; # Avoid referencing -dev paths because of debug assertions. env.NIX_CFLAGS_COMPILE = toString [ "-DQT_NO_DEBUG" ]; @@ -179,29 +176,28 @@ stdenv.mkDerivation rec { sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt ''; - postInstall = - '' - cmake --install . --prefix "''${!outputDev}" --component Development - '' - + lib.optionalString isAppBundle '' - mkdir -p $out/Applications - mv $out/bin/Wireshark.app $out/Applications/Wireshark.app + postInstall = '' + cmake --install . --prefix "''${!outputDev}" --component Development + '' + + lib.optionalString isAppBundle '' + mkdir -p $out/Applications + mv $out/bin/Wireshark.app $out/Applications/Wireshark.app - ln -s $out/Applications/Wireshark.app/Contents/MacOS/Wireshark $out/bin/wireshark - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - local flags=() - for file in $out/lib/*.dylib; do - flags+=(-change @rpath/"$(basename "$file")" "$file") - done + ln -s $out/Applications/Wireshark.app/Contents/MacOS/Wireshark $out/bin/wireshark + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + local flags=() + for file in $out/lib/*.dylib; do + flags+=(-change @rpath/"$(basename "$file")" "$file") + done - for file in $out/lib/wireshark/extcap/*; do - if [ -L "$file" ]; then continue; fi - echo "$file: fixing dylib references" - # note that -id does nothing on binaries - install_name_tool -id "$file" "''${flags[@]}" "$file" - done - ''; + for file in $out/lib/wireshark/extcap/*; do + if [ -L "$file" ]; then continue; fi + echo "$file: fixing dylib references" + # note that -id does nothing on binaries + install_name_tool -id "$file" "''${flags[@]}" "$file" + done + ''; preFixup = '' qtWrapperArgs+=("''${gappsWrapperArgs[@]}") diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index e222e276e3e9..6d486e5040fe 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -36,40 +36,38 @@ stdenv.mkDerivation rec { perl ]; - buildInputs = - [ - libiconv - zlib - popt - ] - ++ lib.optional enableACLs acl - ++ lib.optional enableZstd zstd - ++ lib.optional enableLZ4 lz4 - ++ lib.optional enableOpenSSL openssl - ++ lib.optional enableXXHash xxHash; + buildInputs = [ + libiconv + zlib + popt + ] + ++ lib.optional enableACLs acl + ++ lib.optional enableZstd zstd + ++ lib.optional enableLZ4 lz4 + ++ lib.optional enableOpenSSL openssl + ++ lib.optional enableXXHash xxHash; # fakeroot doesn't work well on darwin anymore, apparently checkInputs = lib.optionals (!stdenv.isDarwin) [ fakeroot ]; - configureFlags = - [ - (lib.enableFeature enableLZ4 "lz4") - (lib.enableFeature enableOpenSSL "openssl") - (lib.enableFeature enableXXHash "xxhash") - (lib.enableFeature enableZstd "zstd") - # Feature detection does a runtime check which varies according to ipv6 - # availability, so force it on to make reproducible, see #360152. - (lib.enableFeature true "ipv6") - "--with-nobody-group=nogroup" + configureFlags = [ + (lib.enableFeature enableLZ4 "lz4") + (lib.enableFeature enableOpenSSL "openssl") + (lib.enableFeature enableXXHash "xxhash") + (lib.enableFeature enableZstd "zstd") + # Feature detection does a runtime check which varies according to ipv6 + # availability, so force it on to make reproducible, see #360152. + (lib.enableFeature true "ipv6") + "--with-nobody-group=nogroup" - # disable the included zlib explicitly as it otherwise still compiles and - # links them even. - "--with-included-zlib=no" - ] - ++ lib.optionals (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_64) [ - # fix `multiversioning needs 'ifunc' which is not supported on this target` error - "--disable-roll-simd" - ]; + # disable the included zlib explicitly as it otherwise still compiles and + # links them even. + "--with-included-zlib=no" + ] + ++ lib.optionals (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_64) [ + # fix `multiversioning needs 'ifunc' which is not supported on this target` error + "--disable-roll-simd" + ]; enableParallelBuilding = true; diff --git a/pkgs/applications/networking/syncplay/default.nix b/pkgs/applications/networking/syncplay/default.nix index cbe24744f029..76360dd32e2c 100644 --- a/pkgs/applications/networking/syncplay/default.nix +++ b/pkgs/applications/networking/syncplay/default.nix @@ -32,15 +32,14 @@ buildPythonApplication rec { buildInputs = lib.optionals enableGUI [ (if stdenv.hostPlatform.isLinux then qt6.qtwayland else qt6.qtbase) ]; - propagatedBuildInputs = - [ - certifi - pem - twisted - ] - ++ twisted.optional-dependencies.tls - ++ lib.optional enableGUI pyside6 - ++ lib.optional (stdenv.hostPlatform.isDarwin && enableGUI) appnope; + propagatedBuildInputs = [ + certifi + pem + twisted + ] + ++ twisted.optional-dependencies.tls + ++ lib.optional enableGUI pyside6 + ++ lib.optional (stdenv.hostPlatform.isDarwin && enableGUI) appnope; nativeBuildInputs = lib.optionals enableGUI [ qt6.wrapQtAppsHook ]; makeFlags = [ diff --git a/pkgs/applications/networking/syncthing/default.nix b/pkgs/applications/networking/syncthing/default.nix index 2e99fb527b5d..09827ae5c663 100644 --- a/pkgs/applications/networking/syncthing/default.nix +++ b/pkgs/applications/networking/syncthing/default.nix @@ -96,30 +96,29 @@ in stname = "syncthing"; target = "syncthing"; - postInstall = - '' - # This installs man pages in the correct directory according to the suffix - # on the filename - for mf in man/*.[1-9]; do - mantype="$(echo "$mf" | awk -F"." '{print $NF}')" - mandir="$out/share/man/man$mantype" - install -Dm644 "$mf" "$mandir/$(basename "$mf")" - done + postInstall = '' + # This installs man pages in the correct directory according to the suffix + # on the filename + for mf in man/*.[1-9]; do + mantype="$(echo "$mf" | awk -F"." '{print $NF}')" + mandir="$out/share/man/man$mantype" + install -Dm644 "$mf" "$mandir/$(basename "$mf")" + done - install -Dm644 etc/linux-desktop/syncthing-ui.desktop $out/share/applications/syncthing-ui.desktop + install -Dm644 etc/linux-desktop/syncthing-ui.desktop $out/share/applications/syncthing-ui.desktop - '' - + lib.optionalString (stdenv.hostPlatform.isLinux) '' - mkdir -p $out/lib/systemd/{system,user} + '' + + lib.optionalString (stdenv.hostPlatform.isLinux) '' + mkdir -p $out/lib/systemd/{system,user} - substitute etc/linux-systemd/system/syncthing@.service \ - $out/lib/systemd/system/syncthing@.service \ - --replace-fail /usr/bin/syncthing $out/bin/syncthing + substitute etc/linux-systemd/system/syncthing@.service \ + $out/lib/systemd/system/syncthing@.service \ + --replace-fail /usr/bin/syncthing $out/bin/syncthing - substitute etc/linux-systemd/user/syncthing.service \ - $out/lib/systemd/user/syncthing.service \ - --replace-fail /usr/bin/syncthing $out/bin/syncthing - ''; + substitute etc/linux-systemd/user/syncthing.service \ + $out/lib/systemd/user/syncthing.service \ + --replace-fail /usr/bin/syncthing $out/bin/syncthing + ''; }; syncthing-discovery = common { diff --git a/pkgs/applications/networking/znc/default.nix b/pkgs/applications/networking/znc/default.nix index dff22b594a30..d6ac9988d553 100644 --- a/pkgs/applications/networking/znc/default.nix +++ b/pkgs/applications/networking/znc/default.nix @@ -44,25 +44,25 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optional withPerl perl - ++ lib.optional withPython python3 - ++ lib.optional withTcl tcl - ++ lib.optional withCyrus cyrus_sasl - ++ lib.optional withUnicode icu - ++ lib.optional withZlib zlib; + buildInputs = [ + openssl + ] + ++ lib.optional withPerl perl + ++ lib.optional withPython python3 + ++ lib.optional withTcl tcl + ++ lib.optional withCyrus cyrus_sasl + ++ lib.optional withUnicode icu + ++ lib.optional withZlib zlib; - configureFlags = - [ - (lib.enableFeature withPerl "perl") - (lib.enableFeature withPython "python") - (lib.enableFeature withTcl "tcl") - (lib.withFeatureAs withTcl "tcl" "${tcl}/lib") - (lib.enableFeature withCyrus "cyrus") - ] - ++ lib.optionals (!withIPv6) [ "--disable-ipv6" ] - ++ lib.optionals withDebug [ "--enable-debug" ]; + configureFlags = [ + (lib.enableFeature withPerl "perl") + (lib.enableFeature withPython "python") + (lib.enableFeature withTcl "tcl") + (lib.withFeatureAs withTcl "tcl" "${tcl}/lib") + (lib.enableFeature withCyrus "cyrus") + ] + ++ lib.optionals (!withIPv6) [ "--disable-ipv6" ] + ++ lib.optionals withDebug [ "--enable-debug" ]; enableParallelBuilding = true; diff --git a/pkgs/applications/office/activitywatch/wrapper.nix b/pkgs/applications/office/activitywatch/wrapper.nix index 5ae59a16df3e..67ecb30769ad 100644 --- a/pkgs/applications/office/activitywatch/wrapper.nix +++ b/pkgs/applications/office/activitywatch/wrapper.nix @@ -17,7 +17,8 @@ symlinkJoin { aw-notify.out aw-watcher-afk.out aw-watcher-window.out - ] ++ (lib.forEach extraWatchers (p: p.out)); + ] + ++ (lib.forEach extraWatchers (p: p.out)); meta = with lib; { description = "The best free and open-source automated time tracker"; diff --git a/pkgs/applications/office/beamerpresenter/default.nix b/pkgs/applications/office/beamerpresenter/default.nix index 887ded477918..b9e5b3a0308a 100644 --- a/pkgs/applications/office/beamerpresenter/default.nix +++ b/pkgs/applications/office/beamerpresenter/default.nix @@ -47,30 +47,29 @@ stdenv.mkDerivation rec { dontWrapGApps = true; - buildInputs = - [ - gst_all_1.gst-libav - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - zlib - qtbase - qtsvg - qtmultimedia - qttools - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ] - ++ lib.optionals useMupdf [ - freetype - gumbo - jbig2dec - mupdf - openjpeg - ] - ++ lib.optionals usePoppler [ - poppler - ]; + buildInputs = [ + gst_all_1.gst-libav + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + zlib + qtbase + qtsvg + qtmultimedia + qttools + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ] + ++ lib.optionals useMupdf [ + freetype + gumbo + jbig2dec + mupdf + openjpeg + ] + ++ lib.optionals usePoppler [ + poppler + ]; cmakeFlags = [ "-DGIT_VERSION=OFF" diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix index 53b1944dcb56..19a34a5f3f9e 100644 --- a/pkgs/applications/office/libreoffice/default.nix +++ b/pkgs/applications/office/libreoffice/default.nix @@ -304,65 +304,63 @@ stdenv.mkDerivation (finalAttrs: { src = srcsAttributes.main { inherit fetchurl fetchgit; }; - postUnpack = - '' - mkdir -v $sourceRoot/${tarballPath} + postUnpack = '' + mkdir -v $sourceRoot/${tarballPath} - ${flip concatMapStrings srcs.third_party (f: '' - ln -sfv ${f} $sourceRoot/${tarballPath}/${f.md5name} - ln -sfv ${f} $sourceRoot/${tarballPath}/${f.name} - '')} + ${flip concatMapStrings srcs.third_party (f: '' + ln -sfv ${f} $sourceRoot/${tarballPath}/${f.md5name} + ln -sfv ${f} $sourceRoot/${tarballPath}/${f.name} + '')} - '' - + ( - if (variant != "collabora") then - '' - ln -sv ${srcs.help} $sourceRoot/${tarballPath}/${srcs.help.name} - ln -svf ${srcs.translations} $sourceRoot/${tarballPath}/${srcs.translations.name} + '' + + ( + if (variant != "collabora") then + '' + ln -sv ${srcs.help} $sourceRoot/${tarballPath}/${srcs.help.name} + ln -svf ${srcs.translations} $sourceRoot/${tarballPath}/${srcs.translations.name} - tar -xf ${srcs.help} - tar -xf ${srcs.translations} - '' - else - '' - cp -r --no-preserve=mode ${srcs.help}/. $sourceRoot/helpcontent2/ - cp -r --no-preserve=mode ${srcs.translations}/. $sourceRoot/translations/ - '' - ); + tar -xf ${srcs.help} + tar -xf ${srcs.translations} + '' + else + '' + cp -r --no-preserve=mode ${srcs.help}/. $sourceRoot/helpcontent2/ + cp -r --no-preserve=mode ${srcs.translations}/. $sourceRoot/translations/ + '' + ); - patches = - [ - # Skip some broken tests: - # - tdf160386 does not fall back to a CJK font properly for some reason - # - the remaining tests have notes in the patches - # FIXME: get rid of this ASAP - ./skip-broken-tests.patch - (./skip-broken-tests- + variant + ".patch") + patches = [ + # Skip some broken tests: + # - tdf160386 does not fall back to a CJK font properly for some reason + # - the remaining tests have notes in the patches + # FIXME: get rid of this ASAP + ./skip-broken-tests.patch + (./skip-broken-tests- + variant + ".patch") - # Don't detect Qt paths from qmake, so our patched-in onese are used - ./dont-detect-qt-paths-from-qmake.patch + # Don't detect Qt paths from qmake, so our patched-in onese are used + ./dont-detect-qt-paths-from-qmake.patch - # Revert part of https://github.com/LibreOffice/core/commit/6f60670877208612b5ea320b3677480ef6508abb that broke zlib linking - ./readd-explicit-zlib-link.patch + # Revert part of https://github.com/LibreOffice/core/commit/6f60670877208612b5ea320b3677480ef6508abb that broke zlib linking + ./readd-explicit-zlib-link.patch - # Backport patch to fix build with Poppler 25.05 - # FIXME: conditionalize/remove as upstream updates - (fetchpatch2 { - url = "https://github.com/LibreOffice/core/commit/0ee2636304ac049f21415c67e92040f7d6c14d35.patch"; - includes = [ "sdext/*" ]; - hash = "sha256-8yipl5ln1yCNfVM8SuWowsw1Iy/SXIwbdT1ZfNw4cJA="; - }) - ] - ++ lib.optionals (lib.versionOlder version "24.8") [ - (fetchpatch2 { - name = "icu74-compat.patch"; - url = "https://gitlab.archlinux.org/archlinux/packaging/packages/libreoffice-fresh/-/raw/main/libreoffice-7.5.8.2-icu-74-compatibility.patch?ref_type=heads.patch"; - hash = "sha256-OGBPIVQj8JTYlkKywt4QpH7ULAzKmet5jTLztGpIS0Y="; - }) - ] - ++ lib.optionals (variant == "collabora") [ - ./fix-unpack-collabora.patch - ]; + # Backport patch to fix build with Poppler 25.05 + # FIXME: conditionalize/remove as upstream updates + (fetchpatch2 { + url = "https://github.com/LibreOffice/core/commit/0ee2636304ac049f21415c67e92040f7d6c14d35.patch"; + includes = [ "sdext/*" ]; + hash = "sha256-8yipl5ln1yCNfVM8SuWowsw1Iy/SXIwbdT1ZfNw4cJA="; + }) + ] + ++ lib.optionals (lib.versionOlder version "24.8") [ + (fetchpatch2 { + name = "icu74-compat.patch"; + url = "https://gitlab.archlinux.org/archlinux/packaging/packages/libreoffice-fresh/-/raw/main/libreoffice-7.5.8.2-icu-74-compatibility.patch?ref_type=heads.patch"; + hash = "sha256-OGBPIVQj8JTYlkKywt4QpH7ULAzKmet5jTLztGpIS0Y="; + }) + ] + ++ lib.optionals (variant == "collabora") [ + ./fix-unpack-collabora.patch + ]; postPatch = '' # configure checks for header 'gpgme++/gpgmepp_version.h', @@ -379,34 +377,33 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace configure.ac --replace-fail distutils.sysconfig sysconfig ''; - nativeBuildInputs = - [ - ant - autoconf - automake - bison - flex - fontforge - gdb - gettext - gperf - icu - jdk21 - libmysqlclient - libtool - libxml2 - libxslt - perl - perlPackages.ArchiveZip - perlPackages.IOCompress - pkg-config - python311 - unzip - zip - ] - ++ optionals kdeIntegration [ - qtbase - ]; + nativeBuildInputs = [ + ant + autoconf + automake + bison + flex + fontforge + gdb + gettext + gperf + icu + jdk21 + libmysqlclient + libtool + libxml2 + libxslt + perl + perlPackages.ArchiveZip + perlPackages.IOCompress + pkg-config + python311 + unzip + zip + ] + ++ optionals kdeIntegration [ + qtbase + ]; buildInputs = finalAttrs.passthru.gst_packages @@ -512,139 +509,137 @@ stdenv.mkDerivation (finalAttrs: { kio ]; - preConfigure = - '' - configureFlagsArray=( - "--with-parallelism=$NIX_BUILD_CORES" - # here because we need to be very specific about spaces - "--with-lang=${concatStringsSep " " langs}" - ); - - patchShebangs . - - NOCONFIGURE=1 ./autogen.sh - '' - + optionalString kdeIntegration '' - # configure.ac assumes that the first directory that contains headers and - # libraries during its checks contains *all* the relevant headers/libs which - # obviously doesn't work for us, so we have 2 options: - # - # 1. patch configure.ac in order to specify the direct paths to various Qt/KDE - # dependencies which is ugly and brittle, or - # - # 2. use symlinkJoin to pull in the relevant dependencies and just patch in - # that path which is *also* ugly, but far less likely to break - # - # The 2nd option is not very Nix'y, but I'll take robust over nice any day. - # Additionally, it's much easier to fix if LO breaks on the next upgrade (just - # add the missing dependencies to it). - export QT${qtMajor}INC=${kdeDeps}/include - export QT${qtMajor}LIB=${kdeDeps}/lib - export KF${qtMajor}INC="${kdeDeps}/include ${kdeDeps}/include/KF${qtMajor}" - export KF${qtMajor}LIB=${kdeDeps}/lib - ''; - - configureFlags = - [ - # Explicitly passing in --host even on non-cross, because - # LibreOffice will attempt to detect WSL and cross-compile - # itself to Windows automatically, and we don't want it - # doing that. - "--host=${stdenv.hostPlatform.config}" - "--without-buildconfig-recorded" - - (lib.withFeature withHelp "help") - "--with-boost=${getDev boost}" - "--with-boost-libdir=${getLib boost}/lib" - "--with-beanshell-jar=${bsh}" - "--with-vendor=NixOS" - "--disable-report-builder" - "--disable-online-update" - "--enable-python=system" - "--enable-dbus" - "--enable-release-build" - "--enable-epm" - "--with-ant-home=${ant.home}" - - # Without these, configure does not finish - "--without-junit" - - # Schema files for validation are not included in the source tarball - "--without-export-validation" - - # We do tarball prefetching ourselves - "--disable-fetch-external" - "--enable-build-opensymbol" - - # I imagine this helps. Copied from go-oo. - # Modified on every upgrade, though - "--disable-odk" - "--disable-firebird-sdbc" - (lib.withFeature withFonts "fonts") - "--without-doxygen" - - "--with-system-beanshell" - "--with-system-cairo" - "--with-system-coinmp" - "--with-system-headers" - "--with-system-libabw" - "--with-system-libcmis" - "--with-system-libepubgen" - "--with-system-libetonyek" - "--with-system-liblangtag" - "--with-system-libs" - "--with-system-libwps" - "--with-system-lpsolve" - "--with-system-mdds" - "--with-system-openldap" - "--with-system-openssl" - "--with-system-orcus" - "--with-system-postgresql" - "--with-system-xmlsec" - - # TODO: package these as system libraries - "--without-system-altlinuxhyph" - "--without-system-frozen" - "--without-system-libfreehand" - "--without-system-libmspub" - "--without-system-libnumbertext" - "--without-system-libpagemaker" - "--without-system-libstaroffice" - "--without-system-libqxp" - "--without-system-dragonbox" - "--without-system-libfixmath" - - # requires an oddly specific, old version - "--without-system-hsqldb" - - # searches hardcoded paths that are wrong - "--without-system-zxing" - - # is packaged but headers can't be found because there is no pkg-config file - "--without-system-zxcvbn" - ] - ++ optionals kdeIntegration [ - "--enable-kf${qtMajor}" - "--enable-qt${qtMajor}" - ] - ++ optionals (kdeIntegration && qtMajor == "5") [ - "--enable-gtk3-kde5" - ] - ++ ( - if variant == "fresh" || variant == "collabora" then - [ - "--with-system-rhino" - "--with-rhino-jar=${rhino}/share/java/js.jar" - - "--without-system-java-websocket" - ] - else - [ - # our Rhino is too new for older versions - "--without-system-rhino" - ] + preConfigure = '' + configureFlagsArray=( + "--with-parallelism=$NIX_BUILD_CORES" + # here because we need to be very specific about spaces + "--with-lang=${concatStringsSep " " langs}" ); + patchShebangs . + + NOCONFIGURE=1 ./autogen.sh + '' + + optionalString kdeIntegration '' + # configure.ac assumes that the first directory that contains headers and + # libraries during its checks contains *all* the relevant headers/libs which + # obviously doesn't work for us, so we have 2 options: + # + # 1. patch configure.ac in order to specify the direct paths to various Qt/KDE + # dependencies which is ugly and brittle, or + # + # 2. use symlinkJoin to pull in the relevant dependencies and just patch in + # that path which is *also* ugly, but far less likely to break + # + # The 2nd option is not very Nix'y, but I'll take robust over nice any day. + # Additionally, it's much easier to fix if LO breaks on the next upgrade (just + # add the missing dependencies to it). + export QT${qtMajor}INC=${kdeDeps}/include + export QT${qtMajor}LIB=${kdeDeps}/lib + export KF${qtMajor}INC="${kdeDeps}/include ${kdeDeps}/include/KF${qtMajor}" + export KF${qtMajor}LIB=${kdeDeps}/lib + ''; + + configureFlags = [ + # Explicitly passing in --host even on non-cross, because + # LibreOffice will attempt to detect WSL and cross-compile + # itself to Windows automatically, and we don't want it + # doing that. + "--host=${stdenv.hostPlatform.config}" + "--without-buildconfig-recorded" + + (lib.withFeature withHelp "help") + "--with-boost=${getDev boost}" + "--with-boost-libdir=${getLib boost}/lib" + "--with-beanshell-jar=${bsh}" + "--with-vendor=NixOS" + "--disable-report-builder" + "--disable-online-update" + "--enable-python=system" + "--enable-dbus" + "--enable-release-build" + "--enable-epm" + "--with-ant-home=${ant.home}" + + # Without these, configure does not finish + "--without-junit" + + # Schema files for validation are not included in the source tarball + "--without-export-validation" + + # We do tarball prefetching ourselves + "--disable-fetch-external" + "--enable-build-opensymbol" + + # I imagine this helps. Copied from go-oo. + # Modified on every upgrade, though + "--disable-odk" + "--disable-firebird-sdbc" + (lib.withFeature withFonts "fonts") + "--without-doxygen" + + "--with-system-beanshell" + "--with-system-cairo" + "--with-system-coinmp" + "--with-system-headers" + "--with-system-libabw" + "--with-system-libcmis" + "--with-system-libepubgen" + "--with-system-libetonyek" + "--with-system-liblangtag" + "--with-system-libs" + "--with-system-libwps" + "--with-system-lpsolve" + "--with-system-mdds" + "--with-system-openldap" + "--with-system-openssl" + "--with-system-orcus" + "--with-system-postgresql" + "--with-system-xmlsec" + + # TODO: package these as system libraries + "--without-system-altlinuxhyph" + "--without-system-frozen" + "--without-system-libfreehand" + "--without-system-libmspub" + "--without-system-libnumbertext" + "--without-system-libpagemaker" + "--without-system-libstaroffice" + "--without-system-libqxp" + "--without-system-dragonbox" + "--without-system-libfixmath" + + # requires an oddly specific, old version + "--without-system-hsqldb" + + # searches hardcoded paths that are wrong + "--without-system-zxing" + + # is packaged but headers can't be found because there is no pkg-config file + "--without-system-zxcvbn" + ] + ++ optionals kdeIntegration [ + "--enable-kf${qtMajor}" + "--enable-qt${qtMajor}" + ] + ++ optionals (kdeIntegration && qtMajor == "5") [ + "--enable-gtk3-kde5" + ] + ++ ( + if variant == "fresh" || variant == "collabora" then + [ + "--with-system-rhino" + "--with-rhino-jar=${rhino}/share/java/js.jar" + + "--without-system-java-websocket" + ] + else + [ + # our Rhino is too new for older versions + "--without-system-rhino" + ] + ); + env = { # FIXME: this is a hack, because the right cflags are not being picked up # from rasqal's .pc file. Needs more investigation. diff --git a/pkgs/applications/office/paperwork/paperwork-gtk.nix b/pkgs/applications/office/paperwork/paperwork-gtk.nix index 0ff7a13e031f..fa4428e9862f 100644 --- a/pkgs/applications/office/paperwork/paperwork-gtk.nix +++ b/pkgs/applications/office/paperwork/paperwork-gtk.nix @@ -92,7 +92,8 @@ python3Packages.buildPythonApplication rec { (lib.getBin gettext) which gdk-pixbuf # for the setup hook - ] ++ documentation_deps; + ] + ++ documentation_deps; buildInputs = [ adwaita-icon-theme diff --git a/pkgs/applications/office/scribus/default.nix b/pkgs/applications/office/scribus/default.nix index 6e5fbf8b34ad..3132d297ed94 100644 --- a/pkgs/applications/office/scribus/default.nix +++ b/pkgs/applications/office/scribus/default.nix @@ -92,7 +92,8 @@ stdenv.mkDerivation (finalAttrs: { qt6.qtimageformats qt6.qtsvg qt6.qttools - ] ++ lib.optionals libmspub.meta.available [ libmspub ]; + ] + ++ lib.optionals libmspub.meta.available [ libmspub ]; cmakeFlags = [ (lib.cmakeBool "WANT_GRAPHICSMAGICK" true) ]; diff --git a/pkgs/applications/radio/direwolf/default.nix b/pkgs/applications/radio/direwolf/default.nix index d90ea4269101..487b96445f79 100644 --- a/pkgs/applications/radio/direwolf/default.nix +++ b/pkgs/applications/radio/direwolf/default.nix @@ -53,27 +53,26 @@ stdenv.mkDerivation rec { echo "" > scripts/CMakeLists.txt ''; - postPatch = - '' - substituteInPlace conf/CMakeLists.txt \ - --replace /etc/udev/rules.d/ $out/lib/udev/rules.d/ - substituteInPlace src/symbols.c \ - --replace /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \ - --replace /opt/local/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt - substituteInPlace src/decode_aprs.c \ - --replace /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \ - --replace /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt - substituteInPlace cmake/cpack/direwolf.desktop.in \ - --replace 'Terminal=false' 'Terminal=true' \ - --replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf' - substituteInPlace src/dwgpsd.c \ - --replace 'GPSD_API_MAJOR_VERSION > 11' 'GPSD_API_MAJOR_VERSION > 14' - '' - + lib.optionalString extraScripts '' - patchShebangs scripts/dwespeak.sh - substituteInPlace scripts/dwespeak.sh \ - --replace espeak ${espeak}/bin/espeak - ''; + postPatch = '' + substituteInPlace conf/CMakeLists.txt \ + --replace /etc/udev/rules.d/ $out/lib/udev/rules.d/ + substituteInPlace src/symbols.c \ + --replace /usr/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt \ + --replace /opt/local/share/direwolf/symbols-new.txt $out/share/direwolf/symbols-new.txt + substituteInPlace src/decode_aprs.c \ + --replace /usr/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt \ + --replace /opt/local/share/direwolf/tocalls.txt $out/share/direwolf/tocalls.txt + substituteInPlace cmake/cpack/direwolf.desktop.in \ + --replace 'Terminal=false' 'Terminal=true' \ + --replace 'Exec=@APPLICATION_DESKTOP_EXEC@' 'Exec=direwolf' + substituteInPlace src/dwgpsd.c \ + --replace 'GPSD_API_MAJOR_VERSION > 11' 'GPSD_API_MAJOR_VERSION > 14' + '' + + lib.optionalString extraScripts '' + patchShebangs scripts/dwespeak.sh + substituteInPlace scripts/dwespeak.sh \ + --replace espeak ${espeak}/bin/espeak + ''; doInstallCheck = true; diff --git a/pkgs/applications/radio/fldigi/default.nix b/pkgs/applications/radio/fldigi/default.nix index 6764bed6e72c..9b0e814a61fd 100644 --- a/pkgs/applications/radio/fldigi/default.nix +++ b/pkgs/applications/radio/fldigi/default.nix @@ -28,23 +28,22 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libXinerama - gettext - hamlib - fltk13 - libjpeg - libpng - portaudio - libsndfile - libsamplerate - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - libpulseaudio - alsa-lib - udev - ]; + buildInputs = [ + libXinerama + gettext + hamlib + fltk13 + libjpeg + libpng + portaudio + libsndfile + libsamplerate + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + libpulseaudio + alsa-lib + udev + ]; env.CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++14"; diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index 05d7d5530f2e..f376fe9e5061 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -58,16 +58,15 @@ let pkg-config orc ]; - runtime = - [ - volk - boost - spdlog - mpir - ] - # when gr-qtgui is disabled, icu needs to be included, otherwise - # building with boost 1.7x fails - ++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ]; + runtime = [ + volk + boost + spdlog + mpir + ] + # when gr-qtgui is disabled, icu needs to be included, otherwise + # building with boost 1.7x fails + ++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ]; pythonNative = with python.pkgs; [ mako six diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index ef1b5feb6a8d..f0f712e8a916 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -36,17 +36,18 @@ in rev = "v${version}"; sha256 = sourceSha256; }; - nativeBuildInputs = - [ removeReferencesTo ] - ++ lib.flatten ( - lib.mapAttrsToList ( - feat: info: - (lib.optionals (hasFeature feat) ( - (lib.optionals (builtins.hasAttr "native" info) info.native) - ++ (lib.optionals (builtins.hasAttr "pythonNative" info) info.pythonNative) - )) - ) featuresInfo - ); + nativeBuildInputs = [ + removeReferencesTo + ] + ++ lib.flatten ( + lib.mapAttrsToList ( + feat: info: + (lib.optionals (hasFeature feat) ( + (lib.optionals (builtins.hasAttr "native" info) info.native) + ++ (lib.optionals (builtins.hasAttr "pythonNative" info) info.pythonNative) + )) + ) featuresInfo + ); buildInputs = lib.flatten ( lib.mapAttrsToList ( feat: info: @@ -70,23 +71,21 @@ in "-DENABLE_${info.cmakeEnableFlag}=OFF" ) ) featuresInfo; - disallowedReferences = - [ - # TODO: Should this be conditional? - stdenv.cc - stdenv.cc.cc - ] - # If python-support is disabled, we probably don't want it referenced - ++ lib.optionals (!hasFeature "python-support") [ python ]; + disallowedReferences = [ + # TODO: Should this be conditional? + stdenv.cc + stdenv.cc.cc + ] + # If python-support is disabled, we probably don't want it referenced + ++ lib.optionals (!hasFeature "python-support") [ python ]; # Gcc references from examples - stripDebugList = - [ - "lib" - "bin" - ] - ++ lib.optionals (hasFeature "gr-audio") [ "share/gnuradio/examples/audio" ] - ++ lib.optionals (hasFeature "gr-uhd") [ "share/gnuradio/examples/uhd" ] - ++ lib.optionals (hasFeature "gr-qtgui") [ "share/gnuradio/examples/qt-gui" ]; + stripDebugList = [ + "lib" + "bin" + ] + ++ lib.optionals (hasFeature "gr-audio") [ "share/gnuradio/examples/audio" ] + ++ lib.optionals (hasFeature "gr-uhd") [ "share/gnuradio/examples/uhd" ] + ++ lib.optionals (hasFeature "gr-qtgui") [ "share/gnuradio/examples/qt-gui" ]; postInstall = "" # Gcc references @@ -101,24 +100,23 @@ in # module. It's not that bad since it's a development package for most # purposes. If closure size needs to be reduced, features should be disabled # via an override. - passthru = - { - inherit - hasFeature - versionAttr - features - featuresInfo - python - ; - gnuradioOlder = lib.versionOlder versionAttr.major; - gnuradioAtLeast = lib.versionAtLeast versionAttr.major; - } - // lib.optionalAttrs (hasFeature "gr-qtgui") { - inherit qt; - } - // lib.optionalAttrs (hasFeature "gnuradio-companion") { - inherit gtk; - }; + passthru = { + inherit + hasFeature + versionAttr + features + featuresInfo + python + ; + gnuradioOlder = lib.versionOlder versionAttr.major; + gnuradioAtLeast = lib.versionAtLeast versionAttr.major; + } + // lib.optionalAttrs (hasFeature "gr-qtgui") { + inherit qt; + } + // lib.optionalAttrs (hasFeature "gnuradio-companion") { + inherit gtk; + }; # Wrapping is done with an external wrapper dontWrapPythonPrograms = true; dontWrapQtApps = true; diff --git a/pkgs/applications/radio/limesuite/default.nix b/pkgs/applications/radio/limesuite/default.nix index 70fea61eff97..e54c5974c192 100644 --- a/pkgs/applications/radio/limesuite/default.nix +++ b/pkgs/applications/radio/limesuite/default.nix @@ -29,22 +29,22 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DOpenGL_GL_PREFERENCE=GLVND" - ] ++ lib.optional (!withGui) "-DENABLE_GUI=OFF"; + ] + ++ lib.optional (!withGui) "-DENABLE_GUI=OFF"; - buildInputs = - [ - libusb1 - sqlite - gnuplot - libusb1 - soapysdr - ] - ++ lib.optionals withGui [ - fltk - libX11 - mesa_glu - wxGTK32 - ]; + buildInputs = [ + libusb1 + sqlite + gnuplot + libusb1 + soapysdr + ] + ++ lib.optionals withGui [ + fltk + libX11 + mesa_glu + wxGTK32 + ]; doInstallCheck = true; diff --git a/pkgs/applications/radio/qradiolink/default.nix b/pkgs/applications/radio/qradiolink/default.nix index 51449acdc1f6..ccdb9ffe3df6 100644 --- a/pkgs/applications/radio/qradiolink/default.nix +++ b/pkgs/applications/radio/qradiolink/default.nix @@ -50,39 +50,38 @@ gnuradio.pkgs.mkDerivation { install -Dm644 qradiolink.desktop $out/share/applications/qradiolink.desktop ''; - buildInputs = - [ - gnuradio.unwrapped.boost - codec2 - gnuradio.unwrapped.logLib - # gnuradio uses it's own log library (spdlog), and qradiolink is still - # using the old gnuradio log library log4cpp. Perhaps this won't be needed - # once the gr_3.10 branch will mature enough to be merged into qradiolink's - # master branch. - log4cpp - gmp - libpulseaudio - libconfig - gsm - gnuradio.pkgs.osmosdr - libopus - libjpeg - limesuite - soapysdr-with-plugins - speex - speexdsp - gnuradio.qt.qtbase - gnuradio.qt.qtmultimedia - libftdi - libsndfile - cppzmq - gnuradio.qwt - uhd - ] - ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ - thrift - gnuradio.unwrapped.python.pkgs.thrift - ]; + buildInputs = [ + gnuradio.unwrapped.boost + codec2 + gnuradio.unwrapped.logLib + # gnuradio uses it's own log library (spdlog), and qradiolink is still + # using the old gnuradio log library log4cpp. Perhaps this won't be needed + # once the gr_3.10 branch will mature enough to be merged into qradiolink's + # master branch. + log4cpp + gmp + libpulseaudio + libconfig + gsm + gnuradio.pkgs.osmosdr + libopus + libjpeg + limesuite + soapysdr-with-plugins + speex + speexdsp + gnuradio.qt.qtbase + gnuradio.qt.qtmultimedia + libftdi + libsndfile + cppzmq + gnuradio.qwt + uhd + ] + ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ + thrift + gnuradio.unwrapped.python.pkgs.thrift + ]; nativeBuildInputs = [ protobuf gnuradio.qt.qmake diff --git a/pkgs/applications/radio/sdr-j-fm/default.nix b/pkgs/applications/radio/sdr-j-fm/default.nix index 0ccb332bd0aa..b970a59139d4 100644 --- a/pkgs/applications/radio/sdr-j-fm/default.nix +++ b/pkgs/applications/radio/sdr-j-fm/default.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation (finalAttrs: { PLUTO = true; # Some more cmake flags are mentioned in upstream's CMakeLists.txt file # but they don't actually make a difference. - } // featuresOverride; + } + // featuresOverride; }; postInstall = '' diff --git a/pkgs/applications/radio/soapysdr/default.nix b/pkgs/applications/radio/soapysdr/default.nix index 02d915ffa202..4b28ee5cb398 100644 --- a/pkgs/applications/radio/soapysdr/default.nix +++ b/pkgs/applications/radio/soapysdr/default.nix @@ -35,15 +35,14 @@ stdenv.mkDerivation (finalAttrs: { pkg-config makeWrapper ]; - buildInputs = - [ - libusb-compat-0_1 - ncurses - ] - ++ lib.optionals usePython [ - python - swig - ]; + buildInputs = [ + libusb-compat-0_1 + ncurses + ] + ++ lib.optionals usePython [ + python + swig + ]; propagatedBuildInputs = lib.optionals usePython [ python.pkgs.numpy ]; diff --git a/pkgs/applications/radio/welle-io/default.nix b/pkgs/applications/radio/welle-io/default.nix index c6246788c2cf..7437974e5ba0 100644 --- a/pkgs/applications/radio/welle-io/default.nix +++ b/pkgs/applications/radio/welle-io/default.nix @@ -51,12 +51,14 @@ stdenv.mkDerivation (finalAttrs: { qt5compat rtl-sdr soapysdr-with-plugins - ] ++ lib.optional withFlac flac; + ] + ++ lib.optional withFlac flac; cmakeFlags = [ "-DRTLSDR=true" "-DSOAPYSDR=true" - ] ++ lib.optional withFlac "-DFLAC=true"; + ] + ++ lib.optional withFlac "-DFLAC=true"; meta = { description = "DAB/DAB+ Software Radio"; @@ -69,6 +71,7 @@ stdenv.mkDerivation (finalAttrs: { platforms = [ "x86_64-linux" "i686-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; }; }) diff --git a/pkgs/applications/science/astronomy/stellarium/default.nix b/pkgs/applications/science/astronomy/stellarium/default.nix index 30c772a5e992..1b5f4a2d8355 100644 --- a/pkgs/applications/science/astronomy/stellarium/default.nix +++ b/pkgs/applications/science/astronomy/stellarium/default.nix @@ -53,33 +53,31 @@ stdenv.mkDerivation (finalAttrs: { qttools ]; - buildInputs = - [ - qtbase - qtcharts - qtpositioning - qtmultimedia - qtserialport - qtwebengine - calcmysky - qxlsx - indilib - libnova - exiv2 - md4c - nlopt - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ]; + buildInputs = [ + qtbase + qtcharts + qtpositioning + qtmultimedia + qtserialport + qtwebengine + calcmysky + qxlsx + indilib + libnova + exiv2 + md4c + nlopt + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ]; - preConfigure = - '' - export SOURCE_DATE_EPOCH=$(date -d 20${lib.versions.major finalAttrs.version}0101 +%s) - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export LC_ALL=en_US.UTF-8 - ''; + preConfigure = '' + export SOURCE_DATE_EPOCH=$(date -d 20${lib.versions.major finalAttrs.version}0101 +%s) + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export LC_ALL=en_US.UTF-8 + ''; # fatal error: 'QtSerialPort/QSerialPortInfo' file not found env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-F${qtserialport}/lib"; diff --git a/pkgs/applications/science/biology/blast/bin.nix b/pkgs/applications/science/biology/blast/bin.nix index 630ef07fd88c..3f317d999fbc 100644 --- a/pkgs/applications/science/biology/blast/bin.nix +++ b/pkgs/applications/science/biology/blast/bin.nix @@ -42,18 +42,17 @@ stdenv.mkDerivation { nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = - [ - python3 - perl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - zlib - bzip2 - glib - libxml2 - sqlite - ]; + buildInputs = [ + python3 + perl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + zlib + bzip2 + glib + libxml2 + sqlite + ]; installPhase = '' runHook preInstall diff --git a/pkgs/applications/science/biology/nest/default.nix b/pkgs/applications/science/biology/nest/default.nix index d386a374c46e..827e0a2f417a 100644 --- a/pkgs/applications/science/biology/nest/default.nix +++ b/pkgs/applications/science/biology/nest/default.nix @@ -43,19 +43,18 @@ stdenv.mkDerivation rec { findutils ]; - buildInputs = - [ - gsl - readline - libtool # libltdl - boost - ] - ++ lib.optionals withPython [ - python3 - python3.pkgs.cython - ] - ++ lib.optional withMpi mpi - ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; + buildInputs = [ + gsl + readline + libtool # libltdl + boost + ] + ++ lib.optionals withPython [ + python3 + python3.pkgs.cython + ] + ++ lib.optional withMpi mpi + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; propagatedBuildInputs = with python3.pkgs; [ numpy diff --git a/pkgs/applications/science/biology/truvari/default.nix b/pkgs/applications/science/biology/truvari/default.nix index 51fd73ea2493..826def39c1e5 100644 --- a/pkgs/applications/science/biology/truvari/default.nix +++ b/pkgs/applications/science/biology/truvari/default.nix @@ -63,14 +63,13 @@ python3Packages.buildPythonApplication rec { pythonImportsCheck = [ "truvari" ]; - nativeCheckInputs = - [ - bcftools - htslib - ] - ++ (with python3Packages; [ - coverage - ]); + nativeCheckInputs = [ + bcftools + htslib + ] + ++ (with python3Packages; [ + coverage + ]); checkPhase = '' runHook preCheck diff --git a/pkgs/applications/science/chemistry/autodock-vina/default.nix b/pkgs/applications/science/chemistry/autodock-vina/default.nix index 4720d536351e..66d1f3506a1b 100644 --- a/pkgs/applications/science/chemistry/autodock-vina/default.nix +++ b/pkgs/applications/science/chemistry/autodock-vina/default.nix @@ -25,13 +25,12 @@ stdenv.mkDerivation (finalAttrs: { if stdenv.hostPlatform.isDarwin then "mac" else "linux" }/release"; - buildInputs = - [ - boost' - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glibc.static - ]; + buildInputs = [ + boost' + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glibc.static + ]; makeFlags = [ "GPP=${stdenv.cc.targetPrefix}c++" diff --git a/pkgs/applications/science/chemistry/quantum-espresso/default.nix b/pkgs/applications/science/chemistry/quantum-espresso/default.nix index 89c5f8a5c2fa..42f482e9e016 100644 --- a/pkgs/applications/science/chemistry/quantum-espresso/default.nix +++ b/pkgs/applications/science/chemistry/quantum-espresso/default.nix @@ -99,26 +99,26 @@ stdenv.mkDerivation rec { libmbd libxc hdf5 - ] ++ lib.optional enableMpi scalapack; + ] + ++ lib.optional enableMpi scalapack; propagatedBuildInputs = lib.optional enableMpi mpi; propagatedUserEnvPkgs = lib.optional enableMpi mpi; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=ON" - "-DWANNIER90_ROOT=${wannier90}" - "-DMBD_ROOT=${libmbd}" - "-DQE_ENABLE_OPENMP=ON" - "-DQE_ENABLE_LIBXC=ON" - "-DQE_ENABLE_HDF5=ON" - "-DQE_ENABLE_PLUGINS=pw2qmcpack" - ] - ++ lib.optionals enableMpi [ - "-DQE_ENABLE_MPI=ON" - "-DQE_ENABLE_MPI_MODULE=ON" - "-DQE_ENABLE_SCALAPACK=ON" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DWANNIER90_ROOT=${wannier90}" + "-DMBD_ROOT=${libmbd}" + "-DQE_ENABLE_OPENMP=ON" + "-DQE_ENABLE_LIBXC=ON" + "-DQE_ENABLE_HDF5=ON" + "-DQE_ENABLE_PLUGINS=pw2qmcpack" + ] + ++ lib.optionals enableMpi [ + "-DQE_ENABLE_MPI=ON" + "-DQE_ENABLE_MPI_MODULE=ON" + "-DQE_ENABLE_SCALAPACK=ON" + ]; meta = with lib; { description = "Electronic-structure calculations and materials modeling at the nanoscale"; diff --git a/pkgs/applications/science/chemistry/siesta/default.nix b/pkgs/applications/science/chemistry/siesta/default.nix index c88b85be9e3e..2a10942d8880 100644 --- a/pkgs/applications/science/chemistry/siesta/default.nix +++ b/pkgs/applications/science/chemistry/siesta/default.nix @@ -38,17 +38,16 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - blas - lapack - readline - elpa - ] - ++ lib.optionals useMpi [ - mpi - scalapack - ]; + buildInputs = [ + blas + lapack + readline + elpa + ] + ++ lib.optionals useMpi [ + mpi + scalapack + ]; NIX_LDFLAGS = "-lm"; @@ -59,30 +58,29 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = false; # Started making trouble with gcc-11 - preBuild = - '' - # See https://gitlab.com/siesta-project/siesta/-/commit/a10bf1628e7141ba263841889c3503c263de1582 - # This may be fixed in the next release. - makeFlagsArray=( - FFLAGS="-fallow-argument-mismatch" - ) - '' - + ( - if useMpi then - '' - makeFlagsArray+=( - CC="mpicc" FC="mpifort" - FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="." - COMP_LIBS="" LIBS="-lblas -llapack -lscalapack" - ); - '' - else - '' - makeFlagsArray+=( - COMP_LIBS="" LIBS="-lblas -llapack" - ); - '' - ); + preBuild = '' + # See https://gitlab.com/siesta-project/siesta/-/commit/a10bf1628e7141ba263841889c3503c263de1582 + # This may be fixed in the next release. + makeFlagsArray=( + FFLAGS="-fallow-argument-mismatch" + ) + '' + + ( + if useMpi then + '' + makeFlagsArray+=( + CC="mpicc" FC="mpifort" + FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="." + COMP_LIBS="" LIBS="-lblas -llapack -lscalapack" + ); + '' + else + '' + makeFlagsArray+=( + COMP_LIBS="" LIBS="-lblas -llapack" + ); + '' + ); meta = { description = "First-principles materials simulation code using DFT"; diff --git a/pkgs/applications/science/electronics/dsview/default.nix b/pkgs/applications/science/electronics/dsview/default.nix index 661bf9f3fc08..379cd27af0b9 100644 --- a/pkgs/applications/science/electronics/dsview/default.nix +++ b/pkgs/applications/science/electronics/dsview/default.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { cmake pkg-config wrapQtAppsHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; buildInputs = [ boost @@ -50,7 +51,8 @@ stdenv.mkDerivation (finalAttrs: { libusb1 libzip python3 - ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland; + ] + ++ lib.optional stdenv.hostPlatform.isLinux qtwayland; doInstallCheck = true; diff --git a/pkgs/applications/science/electronics/fritzing/default.nix b/pkgs/applications/science/electronics/fritzing/default.nix index 8b0fd62a5564..f6f535eb01aa 100644 --- a/pkgs/applications/science/electronics/fritzing/default.nix +++ b/pkgs/applications/science/electronics/fritzing/default.nix @@ -62,21 +62,20 @@ stdenv.mkDerivation { wrapQtAppsHook ]; - buildInputs = - [ - qtbase - qtsvg - qtserialport - qt5compat - boost - libgit2 - quazip - libngspice - clipper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ]; + buildInputs = [ + qtbase + qtsvg + qtserialport + qt5compat + boost + libgit2 + quazip + libngspice + clipper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ]; postPatch = '' # Use packaged quazip, libgit and ngspice diff --git a/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix b/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix index cfb13ffab886..4fed26932415 100644 --- a/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix +++ b/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix @@ -66,25 +66,24 @@ stdenv.mkDerivation rec { pkg-config wrapQtAppsHook ]; - buildInputs = - [ - qtbase - qtsvg - boost - rapidjson - igraph - nlohmann_json - spdlog - graphviz - verilator - z3 - quazip - ] - ++ (with python3Packages; [ - python - pybind11 - ]) - ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; + buildInputs = [ + qtbase + qtsvg + boost + rapidjson + igraph + nlohmann_json + spdlog + graphviz + verilator + z3 + quazip + ] + ++ (with python3Packages; [ + python + pybind11 + ]) + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; cmakeFlags = with lib.versions; [ "-DHAL_VERSION_RETURN=${version}" diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix index 0c543022d270..bb9b954281e5 100644 --- a/pkgs/applications/science/electronics/kicad/base.nix +++ b/pkgs/applications/science/electronics/kicad/base.nix @@ -100,98 +100,95 @@ stdenv.mkDerivation rec { export CXXFLAGS="''${CXXFLAGS:-} -Og -ggdb" ''; - cmakeFlags = - [ - "-DKICAD_USE_EGL=ON" - "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade" - # https://gitlab.com/kicad/code/kicad/-/issues/17133 - "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_spice'" - "-DKICAD_USE_CMAKE_FINDPROTOBUF=OFF" - ] - ++ optional ( - stdenv.hostPlatform.system == "aarch64-linux" - ) "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;'qa_spice|qa_cli'" - ++ optional (stable && !withNgspice) "-DKICAD_SPICE=OFF" - ++ optionals (!withScripting) [ - "-DKICAD_SCRIPTING_WXPYTHON=OFF" - ] - ++ optionals (withI18n) [ - "-DKICAD_BUILD_I18N=ON" - ] - ++ optionals (!doInstallCheck) [ - "-DKICAD_BUILD_QA_TESTS=OFF" - ] - ++ optionals (debug) [ - "-DKICAD_STDLIB_DEBUG=ON" - "-DKICAD_USE_VALGRIND=ON" - ] - ++ optionals (sanitizeAddress) [ - "-DKICAD_SANITIZE_ADDRESS=ON" - ] - ++ optionals (sanitizeThreads) [ - "-DKICAD_SANITIZE_THREADS=ON" - ]; + cmakeFlags = [ + "-DKICAD_USE_EGL=ON" + "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade" + # https://gitlab.com/kicad/code/kicad/-/issues/17133 + "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_spice'" + "-DKICAD_USE_CMAKE_FINDPROTOBUF=OFF" + ] + ++ optional ( + stdenv.hostPlatform.system == "aarch64-linux" + ) "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;'qa_spice|qa_cli'" + ++ optional (stable && !withNgspice) "-DKICAD_SPICE=OFF" + ++ optionals (!withScripting) [ + "-DKICAD_SCRIPTING_WXPYTHON=OFF" + ] + ++ optionals (withI18n) [ + "-DKICAD_BUILD_I18N=ON" + ] + ++ optionals (!doInstallCheck) [ + "-DKICAD_BUILD_QA_TESTS=OFF" + ] + ++ optionals (debug) [ + "-DKICAD_STDLIB_DEBUG=ON" + "-DKICAD_USE_VALGRIND=ON" + ] + ++ optionals (sanitizeAddress) [ + "-DKICAD_SANITIZE_ADDRESS=ON" + ] + ++ optionals (sanitizeThreads) [ + "-DKICAD_SANITIZE_THREADS=ON" + ]; cmakeBuildType = if debug then "Debug" else "Release"; - nativeBuildInputs = - [ - cmake - ninja - doxygen - graphviz - pkg-config - libgit2 - libsecret - libgcrypt - libgpg-error - ] - # wanted by configuration on linux, doesn't seem to affect performance - # no effect on closure size - ++ optionals (stdenv.hostPlatform.isLinux) [ - util-linux - libselinux - libsepol - libthai - libdatrie - libxkbcommon - libepoxy - dbus - at-spi2-core - libXtst - pcre2 - ]; + nativeBuildInputs = [ + cmake + ninja + doxygen + graphviz + pkg-config + libgit2 + libsecret + libgcrypt + libgpg-error + ] + # wanted by configuration on linux, doesn't seem to affect performance + # no effect on closure size + ++ optionals (stdenv.hostPlatform.isLinux) [ + util-linux + libselinux + libsepol + libthai + libdatrie + libxkbcommon + libepoxy + dbus + at-spi2-core + libXtst + pcre2 + ]; - buildInputs = - [ - libGLU - libGL - zlib - libX11 - wxGTK - gtk3 - libXdmcp - gettext - glew - glm - libpthreadstubs - cairo - curl - openssl - boost - swig - python - unixODBC - libdeflate - opencascade-occt - protobuf_29 + buildInputs = [ + libGLU + libGL + zlib + libX11 + wxGTK + gtk3 + libXdmcp + gettext + glew + glm + libpthreadstubs + cairo + curl + openssl + boost + swig + python + unixODBC + libdeflate + opencascade-occt + protobuf_29 - # This would otherwise cause a linking requirement for mbedtls. - (nng.override { mbedtlsSupport = false; }) - ] - ++ optional (withScripting) wxPython - ++ optional (withNgspice) libngspice - ++ optional (debug) valgrind; + # This would otherwise cause a linking requirement for mbedtls. + (nng.override { mbedtlsSupport = false; }) + ] + ++ optional (withScripting) wxPython + ++ optional (withNgspice) libngspice + ++ optional (debug) valgrind; # some ngspice tests attempt to write to $HOME/.cache/ # this could be and was resolved with XDG_CACHE_HOME = "$TMP"; diff --git a/pkgs/applications/science/electronics/kicad/libraries.nix b/pkgs/applications/science/electronics/kicad/libraries.nix index e26b73c4f04c..c0026d382dc8 100644 --- a/pkgs/applications/science/electronics/kicad/libraries.nix +++ b/pkgs/applications/science/electronics/kicad/libraries.nix @@ -16,13 +16,14 @@ let src = libSrc name; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals (name == "packages3d") [ - stepreduce - parallel - zip - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals (name == "packages3d") [ + stepreduce + parallel + zip + ]; postInstall = lib.optionalString (name == "packages3d") '' diff --git a/pkgs/applications/science/electronics/openems/default.nix b/pkgs/applications/science/electronics/openems/default.nix index b286c9234afb..22e92e81fa35 100644 --- a/pkgs/applications/science/electronics/openems/default.nix +++ b/pkgs/applications/science/electronics/openems/default.nix @@ -36,20 +36,19 @@ stdenv.mkDerivation rec { cmakeFlags = lib.optionals withMPI [ "-DWITH_MPI=ON" ]; - buildInputs = - [ - fparser - tinyxml - hdf5 - vtk - boost - zlib - csxcad - (octave.override { inherit hdf5; }) - ] - ++ lib.optionals withQcsxcad [ qcsxcad ] - ++ lib.optionals withMPI [ mpi ] - ++ lib.optionals withHyp2mat [ hyp2mat ]; + buildInputs = [ + fparser + tinyxml + hdf5 + vtk + boost + zlib + csxcad + (octave.override { inherit hdf5; }) + ] + ++ lib.optionals withQcsxcad [ qcsxcad ] + ++ lib.optionals withMPI [ mpi ] + ++ lib.optionals withHyp2mat [ hyp2mat ]; postFixup = '' substituteInPlace $out/share/openEMS/matlab/setup.m \ diff --git a/pkgs/applications/science/electronics/pulseview/default.nix b/pkgs/applications/science/electronics/pulseview/default.nix index 6bbcc4f54fa5..ff66e511ce21 100644 --- a/pkgs/applications/science/electronics/pulseview/default.nix +++ b/pkgs/applications/science/electronics/pulseview/default.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation { pkg-config qttools wrapQtAppsHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; buildInputs = [ glib @@ -52,7 +53,8 @@ stdenv.mkDerivation { pcre python3 qtsvg - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ bluez ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ bluez ]; meta = with lib; { description = "Qt-based LA/scope/MSO GUI for sigrok (a signal analysis software suite)"; diff --git a/pkgs/applications/science/electronics/qucs-s/default.nix b/pkgs/applications/science/electronics/qucs-s/default.nix index 8ced7004f1a2..0b3d5b738b9f 100644 --- a/pkgs/applications/science/electronics/qucs-s/default.nix +++ b/pkgs/applications/science/electronics/qucs-s/default.nix @@ -58,20 +58,19 @@ stdenv.mkDerivation rec { wrapQtAppsHook cmake ]; - buildInputs = - [ - qtbase - qttools - qtcharts - qtsvg - gperf - adms - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - libX11 - ] - ++ kernels; + buildInputs = [ + qtbase + qttools + qtcharts + qtsvg + gperf + adms + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + libX11 + ] + ++ kernels; cmakeFlags = [ "-DWITH_QT6=ON" diff --git a/pkgs/applications/science/logic/abella/default.nix b/pkgs/applications/science/logic/abella/default.nix index 62da3a42e067..b8557f9e7bf3 100644 --- a/pkgs/applications/science/logic/abella/default.nix +++ b/pkgs/applications/science/logic/abella/default.nix @@ -17,14 +17,15 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ rsync ] - ++ (with ocamlPackages; [ - ocaml - dune_3 - menhir - findlib - ]); + nativeBuildInputs = [ + rsync + ] + ++ (with ocamlPackages; [ + ocaml + dune_3 + menhir + findlib + ]); buildInputs = with ocamlPackages; [ cmdliner yojson diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index a4ef2509f2c3..65e97f22ab4d 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -128,7 +128,8 @@ let ocamlNativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib - ] ++ lib.optional (coqAtLeast "8.14") ocamlPackages.dune_3; + ] + ++ lib.optional (coqAtLeast "8.14") ocamlPackages.dune_3; ocamlPropagatedBuildInputs = [ ] ++ lib.optional (!coqAtLeast "8.10") ocamlPackages.camlp5 @@ -198,24 +199,26 @@ let ''; }; - nativeBuildInputs = - [ pkg-config ] - ++ ocamlNativeBuildInputs - ++ lib.optional buildIde copyDesktopItems - ++ lib.optional (buildIde && coqAtLeast "8.10") wrapGAppsHook3 - ++ lib.optional (!coqAtLeast "8.6") gnumake42; - buildInputs = - [ ncurses ] - ++ lib.optionals buildIde ( - if coqAtLeast "8.10" then - [ - ocamlPackages.lablgtk3-sourceview3 - glib - adwaita-icon-theme - ] - else - [ ocamlPackages.lablgtk ] - ); + nativeBuildInputs = [ + pkg-config + ] + ++ ocamlNativeBuildInputs + ++ lib.optional buildIde copyDesktopItems + ++ lib.optional (buildIde && coqAtLeast "8.10") wrapGAppsHook3 + ++ lib.optional (!coqAtLeast "8.6") gnumake42; + buildInputs = [ + ncurses + ] + ++ lib.optionals buildIde ( + if coqAtLeast "8.10" then + [ + ocamlPackages.lablgtk3-sourceview3 + glib + adwaita-icon-theme + ] + else + [ ocamlPackages.lablgtk ] + ); propagatedBuildInputs = ocamlPropagatedBuildInputs; @@ -253,13 +256,12 @@ let prefixKey = "-prefix "; - buildFlags = - [ - "revision" - "coq" - ] - ++ lib.optional buildIde "coqide" - ++ lib.optional (!coqAtLeast "8.14") "bin/votour"; + buildFlags = [ + "revision" + "coq" + ] + ++ lib.optional buildIde "coqide" + ++ lib.optional (!coqAtLeast "8.14") "bin/votour"; enableParallelBuilding = true; createFindlibDestdir = true; diff --git a/pkgs/applications/science/logic/cubicle/default.nix b/pkgs/applications/science/logic/cubicle/default.nix index 1aef01858dbc..60c0e82ca4de 100644 --- a/pkgs/applications/science/logic/cubicle/default.nix +++ b/pkgs/applications/science/logic/cubicle/default.nix @@ -17,15 +17,14 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - which - ] - ++ (with ocamlPackages; [ - findlib - ocaml - ]); + nativeBuildInputs = [ + autoreconfHook + which + ] + ++ (with ocamlPackages; [ + findlib + ocaml + ]); buildInputs = with ocamlPackages; [ functory diff --git a/pkgs/applications/science/logic/eprover/default.nix b/pkgs/applications/science/logic/eprover/default.nix index d8685390bc1d..e9153ef2ddae 100644 --- a/pkgs/applications/science/logic/eprover/default.nix +++ b/pkgs/applications/science/logic/eprover/default.nix @@ -21,14 +21,13 @@ stdenv.mkDerivation (finalAttrs: { sed -e 's/ *CC *= *gcc$//' -i Makefile.vars ''; - configureFlags = - [ - "--exec-prefix=$(out)" - "--man-prefix=$(out)/share/man" - ] - ++ lib.optionals enableHO [ - "--enable-ho" - ]; + configureFlags = [ + "--exec-prefix=$(out)" + "--man-prefix=$(out)/share/man" + ] + ++ lib.optionals enableHO [ + "--enable-ho" + ]; meta = { description = "Automated theorem prover for full first-order logic with equality"; diff --git a/pkgs/applications/science/logic/prooftree/default.nix b/pkgs/applications/science/logic/prooftree/default.nix index 5f09e6d23d20..1ba82e1e05d1 100644 --- a/pkgs/applications/science/logic/prooftree/default.nix +++ b/pkgs/applications/science/logic/prooftree/default.nix @@ -18,13 +18,14 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ pkg-config ] - ++ (with ocamlPackages; [ - ocaml - findlib - camlp5 - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with ocamlPackages; [ + ocaml + findlib + camlp5 + ]); buildInputs = [ ncurses ] ++ (with ocamlPackages; [ lablgtk ]); prefixKey = "--prefix "; diff --git a/pkgs/applications/science/logic/tamarin-prover/default.nix b/pkgs/applications/science/logic/tamarin-prover/default.nix index 4c6c20fe80c8..c03d1825e152 100644 --- a/pkgs/applications/science/logic/tamarin-prover/default.nix +++ b/pkgs/applications/science/logic/tamarin-prover/default.nix @@ -159,29 +159,28 @@ mkDerivation ( maude graphviz ]; - postInstall = - '' - wrapProgram $out/bin/tamarin-prover \ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \ - '' - + '' - --prefix PATH : ${ - lib.makeBinPath [ - which - maude - graphviz - ] - } - # so that the package can be used as a vim plugin to install syntax coloration - install -Dt $out/share/vim-plugins/tamarin-prover/syntax/ etc/syntax/spthy.vim - install etc/filetype.vim -D $out/share/vim-plugins/tamarin-prover/ftdetect/tamarin.vim - mkdir -p $out/share/nvim - ln -s $out/share/vim-plugins/tamarin-prover $out/share/nvim/site - # Emacs SPTHY major mode - install -Dt $out/share/emacs/site-lisp etc/spthy-mode.el - ''; + postInstall = '' + wrapProgram $out/bin/tamarin-prover \ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \ + '' + + '' + --prefix PATH : ${ + lib.makeBinPath [ + which + maude + graphviz + ] + } + # so that the package can be used as a vim plugin to install syntax coloration + install -Dt $out/share/vim-plugins/tamarin-prover/syntax/ etc/syntax/spthy.vim + install etc/filetype.vim -D $out/share/vim-plugins/tamarin-prover/ftdetect/tamarin.vim + mkdir -p $out/share/nvim + ln -s $out/share/vim-plugins/tamarin-prover $out/share/nvim/site + # Emacs SPTHY major mode + install -Dt $out/share/emacs/site-lisp etc/spthy-mode.el + ''; checkPhase = "./dist/build/tamarin-prover/tamarin-prover test"; diff --git a/pkgs/applications/science/machine-learning/shogun/default.nix b/pkgs/applications/science/machine-learning/shogun/default.nix index fd990735e6be..b7861cddfffc 100644 --- a/pkgs/applications/science/machine-learning/shogun/default.nix +++ b/pkgs/applications/science/machine-learning/shogun/default.nix @@ -111,48 +111,47 @@ stdenv.mkDerivation (finalAttrs: { # Fix compile errors with Eigen 3.4 ./eigen-3.4.patch - ] ++ lib.optional (!withSvmLight) ./svmlight-scrubber.patch; + ] + ++ lib.optional (!withSvmLight) ./svmlight-scrubber.patch; - nativeBuildInputs = + nativeBuildInputs = [ + cmake + swig + ctags + ] + ++ (with python3Packages; [ + python + jinja2 + ply + ]); + + buildInputs = [ + eigen + blas + lapack + glpk + protobuf + json_c + libxml2 + hdf5 + curl + libarchive + bzip2 + xz + snappy + lzo + nlopt + lp_solve + colpack + ] + ++ lib.optionals pythonSupport ( + with python3Packages; [ - cmake - swig - ctags - ] - ++ (with python3Packages; [ python - jinja2 - ply - ]); - - buildInputs = - [ - eigen - blas - lapack - glpk - protobuf - json_c - libxml2 - hdf5 - curl - libarchive - bzip2 - xz - snappy - lzo - nlopt - lp_solve - colpack + numpy ] - ++ lib.optionals pythonSupport ( - with python3Packages; - [ - python - numpy - ] - ) - ++ lib.optional opencvSupport opencv; + ) + ++ lib.optional opencvSupport opencv; cmakeFlags = let @@ -202,23 +201,22 @@ stdenv.mkDerivation (finalAttrs: { ln -s ${srcs.gtest} $sourceRoot/third_party/GoogleMock/release-${gtestVersion}.tar.gz ''; - postPatch = - '' - # Fix preprocessing SVMlight code - sed -i \ - -e 's@#ifdef SVMLIGHT@#ifdef USE_SVMLIGHT@' \ - -e '/^#ifdef USE_SVMLIGHT/,/^#endif/ s@#endif@#endif //USE_SVMLIGHT@' \ - src/shogun/kernel/string/CommUlongStringKernel.cpp - sed -i -e 's/#if USE_SVMLIGHT/#ifdef USE_SVMLIGHT/' src/interfaces/swig/Machine.i - sed -i -e 's@// USE_SVMLIGHT@//USE_SVMLIGHT@' src/interfaces/swig/Transfer.i - sed -i -e 's@/\* USE_SVMLIGHT \*/@//USE_SVMLIGHT@' src/interfaces/swig/Transfer_includes.i - '' - + lib.optionalString (!withSvmLight) '' - # Run SVMlight scrubber - patchShebangs scripts/light-scrubber.sh - echo "removing SVMlight code" - ./scripts/light-scrubber.sh - ''; + postPatch = '' + # Fix preprocessing SVMlight code + sed -i \ + -e 's@#ifdef SVMLIGHT@#ifdef USE_SVMLIGHT@' \ + -e '/^#ifdef USE_SVMLIGHT/,/^#endif/ s@#endif@#endif //USE_SVMLIGHT@' \ + src/shogun/kernel/string/CommUlongStringKernel.cpp + sed -i -e 's/#if USE_SVMLIGHT/#ifdef USE_SVMLIGHT/' src/interfaces/swig/Machine.i + sed -i -e 's@// USE_SVMLIGHT@//USE_SVMLIGHT@' src/interfaces/swig/Transfer.i + sed -i -e 's@/\* USE_SVMLIGHT \*/@//USE_SVMLIGHT@' src/interfaces/swig/Transfer_includes.i + '' + + lib.optionalString (!withSvmLight) '' + # Run SVMlight scrubber + patchShebangs scripts/light-scrubber.sh + echo "removing SVMlight code" + ./scripts/light-scrubber.sh + ''; postInstall = '' mkdir -p $doc/share/doc/shogun/examples diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix index 0aeae564fcaa..a4d920389d8a 100644 --- a/pkgs/applications/science/math/R/default.nix +++ b/pkgs/applications/science/math/R/default.nix @@ -130,46 +130,45 @@ stdenv.mkDerivation (finalAttrs: { dontDisableStatic = static; - preConfigure = - '' - configureFlagsArray=( - --disable-lto - --with${lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages - --with-blas="-L${blas}/lib -lblas" - --with-lapack="-L${lapack}/lib -llapack" - --with-readline - --with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh" - --with-cairo - --with-libpng - --with-jpeglib - --with-libtiff - --with-ICU - ${lib.optionalString enableStrictBarrier "--enable-strict-barrier"} - ${lib.optionalString enableMemoryProfiling "--enable-memory-profiling"} - ${if static then "--enable-R-static-lib" else "--enable-R-shlib"} - AR=$(type -p ar) - AWK=$(type -p gawk) - CC=$(type -p cc) - CXX=$(type -p c++) - FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran" - JAVA_HOME="${jdk}" - RANLIB=$(type -p ranlib) - CURL_CONFIG="${lib.getExe' (lib.getDev curl) "curl-config"}" - r_cv_have_curl728=yes - R_SHELL="${stdenv.shell}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - --disable-R-framework - --without-x - OBJC="clang" - CPPFLAGS="-isystem ${lib.getInclude stdenv.cc.libcxx}/include/c++/v1" - LDFLAGS="-L${lib.getLib stdenv.cc.libcxx}/lib" - '' - + '' - ) - echo >>etc/Renviron.in "TCLLIBPATH=${tk}/lib" - echo >>etc/Renviron.in "TZDIR=${tzdata}/share/zoneinfo" - ''; + preConfigure = '' + configureFlagsArray=( + --disable-lto + --with${lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages + --with-blas="-L${blas}/lib -lblas" + --with-lapack="-L${lapack}/lib -llapack" + --with-readline + --with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh" + --with-cairo + --with-libpng + --with-jpeglib + --with-libtiff + --with-ICU + ${lib.optionalString enableStrictBarrier "--enable-strict-barrier"} + ${lib.optionalString enableMemoryProfiling "--enable-memory-profiling"} + ${if static then "--enable-R-static-lib" else "--enable-R-shlib"} + AR=$(type -p ar) + AWK=$(type -p gawk) + CC=$(type -p cc) + CXX=$(type -p c++) + FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran" + JAVA_HOME="${jdk}" + RANLIB=$(type -p ranlib) + CURL_CONFIG="${lib.getExe' (lib.getDev curl) "curl-config"}" + r_cv_have_curl728=yes + R_SHELL="${stdenv.shell}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + --disable-R-framework + --without-x + OBJC="clang" + CPPFLAGS="-isystem ${lib.getInclude stdenv.cc.libcxx}/include/c++/v1" + LDFLAGS="-L${lib.getLib stdenv.cc.libcxx}/lib" + '' + + '' + ) + echo >>etc/Renviron.in "TCLLIBPATH=${tk}/lib" + echo >>etc/Renviron.in "TZDIR=${tzdata}/share/zoneinfo" + ''; installTargets = [ "install" diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix index 6592e9e3b81c..a022fcd8e1dd 100644 --- a/pkgs/applications/science/math/caffe/default.nix +++ b/pkgs/applications/science/math/caffe/default.nix @@ -60,25 +60,24 @@ stdenv.mkDerivation rec { ++ [ "-DUSE_LEVELDB=${toggle leveldbSupport}" ] ++ [ "-DUSE_LMDB=${toggle lmdbSupport}" ]; - buildInputs = - [ - boost - gflags - glog - protobuf - hdf5-cpp - opencv4 - blas - ] - ++ lib.optional lmdbSupport lmdb - ++ lib.optionals leveldbSupport [ - leveldb - snappy - ] - ++ lib.optionals pythonSupport [ - python - numpy - ]; + buildInputs = [ + boost + gflags + glog + protobuf + hdf5-cpp + opencv4 + blas + ] + ++ lib.optional lmdbSupport lmdb + ++ lib.optionals leveldbSupport [ + leveldb + snappy + ] + ++ lib.optionals pythonSupport [ + python + numpy + ]; propagatedBuildInputs = lib.optionals pythonSupport ( # requirements.txt @@ -112,22 +111,21 @@ stdenv.mkDerivation rec { ]; propagatedBuildOutputs = [ ]; # otherwise propagates out -> bin cycle - patches = - [ - ./darwin.patch - ./glog-cmake.patch - ./random-shuffle.patch - (fetchpatch { - name = "support-opencv4"; - url = "https://github.com/BVLC/caffe/pull/6638/commits/0a04cc2ccd37ba36843c18fea2d5cbae6e7dd2b5.patch"; - hash = "sha256-ZegTvp0tTHlopQv+UzHDigs6XLkP2VfqLCWXl6aKJSI="; - }) - ] - ++ lib.optional pythonSupport ( - replaceVars ./python.patch { - inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy - } - ); + patches = [ + ./darwin.patch + ./glog-cmake.patch + ./random-shuffle.patch + (fetchpatch { + name = "support-opencv4"; + url = "https://github.com/BVLC/caffe/pull/6638/commits/0a04cc2ccd37ba36843c18fea2d5cbae6e7dd2b5.patch"; + hash = "sha256-ZegTvp0tTHlopQv+UzHDigs6XLkP2VfqLCWXl6aKJSI="; + }) + ] + ++ lib.optional pythonSupport ( + replaceVars ./python.patch { + inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy + } + ); postPatch = '' substituteInPlace src/caffe/util/io.cpp --replace \ @@ -140,21 +138,20 @@ stdenv.mkDerivation rec { export BOOST_LIBRARYDIR="${boost.out}/lib"; ''; - postInstall = - '' - # Internal static library. - rm $out/lib/libproto.a + postInstall = '' + # Internal static library. + rm $out/lib/libproto.a - # Install models - cp -a ../models $out/share/Caffe/models + # Install models + cp -a ../models $out/share/Caffe/models - moveToOutput "bin" "$bin" - '' - + lib.optionalString pythonSupport '' - mkdir -p $out/${python.sitePackages} - mv $out/python/caffe $out/${python.sitePackages} - rm -rf $out/python - ''; + moveToOutput "bin" "$bin" + '' + + lib.optionalString pythonSupport '' + mkdir -p $out/${python.sitePackages} + mv $out/python/caffe $out/${python.sitePackages} + rm -rf $out/python + ''; doInstallCheck = false; # build takes more than 30 min otherwise installCheckPhase = '' diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix index f2cb98c5963f..88c278dfd627 100644 --- a/pkgs/applications/science/math/glsurf/default.nix +++ b/pkgs/applications/science/math/glsurf/default.nix @@ -25,29 +25,27 @@ stdenv.mkDerivation rec { sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7"; }; - nativeBuildInputs = - [ - makeWrapper - ] - ++ (with ocamlPackages; [ - ocaml - findlib - ]); + nativeBuildInputs = [ + makeWrapper + ] + ++ (with ocamlPackages; [ + ocaml + findlib + ]); - buildInputs = - [ - libglut - libGL - libGLU - mpfr - gmp - ] - ++ (with ocamlPackages; [ - camlp4 - lablgl - camlimages - num - ]); + buildInputs = [ + libglut + libGL + libGLU + mpfr + gmp + ] + ++ (with ocamlPackages; [ + camlp4 + lablgl + camlimages + num + ]); postPatch = '' for f in callbacks*/Makefile; do diff --git a/pkgs/applications/science/math/lp_solve/default.nix b/pkgs/applications/science/math/lp_solve/default.nix index c7c2eb05b334..891dd15194f4 100644 --- a/pkgs/applications/science/math/lp_solve/default.nix +++ b/pkgs/applications/science/math/lp_solve/default.nix @@ -19,25 +19,23 @@ stdenv.mkDerivation rec { sha256 = "sha256-bUq/9cxqqpM66ObBeiJt8PwLZxxDj2lxXUHQn+gfkC8="; }; - nativeBuildInputs = - [ - binutils - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - fixDarwinDylibNames - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + binutils + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + fixDarwinDylibNames + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ]; - env = - { - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int"; - } - // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) { - NIX_LDFLAGS = "-headerpad_max_install_names"; - }; + env = { + NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int"; + } + // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) { + NIX_LDFLAGS = "-headerpad_max_install_names"; + }; dontConfigure = true; diff --git a/pkgs/applications/science/math/mathematica/generic.nix b/pkgs/applications/science/math/mathematica/generic.nix index 2efd952995bd..d12763cae73e 100644 --- a/pkgs/applications/science/math/mathematica/generic.nix +++ b/pkgs/applications/science/math/mathematica/generic.nix @@ -82,83 +82,82 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoPatchelfHook makeWrapper - ] ++ lib.optional cudaSupport addDriverRunpath; + ] + ++ lib.optional cudaSupport addDriverRunpath; - buildInputs = - [ - alsa-lib - cups.lib - dbus - flite - fontconfig - freetype - glib - gmpxx - keyutils.lib - libGL - libGLU - libpcap - libtins - libuuid - libxkbcommon - libxml2 - llvmPackages_13.libllvm.lib - matio - mpfr - ncurses - opencv4 - openjdk11 - openssl - pciutils - tre - unixODBC - xcbutilimage - xcbutilkeysyms - xkeyboard_config - ] - ++ (with xorg; [ - libICE - libSM - libX11 - libXScrnSaver - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXinerama - libXmu - libXrandr - libXrender - libXtst - libxcb - ]) - ++ lib.optional cudaSupport cudaEnv; + buildInputs = [ + alsa-lib + cups.lib + dbus + flite + fontconfig + freetype + glib + gmpxx + keyutils.lib + libGL + libGLU + libpcap + libtins + libuuid + libxkbcommon + libxml2 + llvmPackages_13.libllvm.lib + matio + mpfr + ncurses + opencv4 + openjdk11 + openssl + pciutils + tre + unixODBC + xcbutilimage + xcbutilkeysyms + xkeyboard_config + ] + ++ (with xorg; [ + libICE + libSM + libX11 + libXScrnSaver + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libXinerama + libXmu + libXrandr + libXrender + libXtst + libxcb + ]) + ++ lib.optional cudaSupport cudaEnv; - wrapProgramFlags = - [ - "--prefix LD_LIBRARY_PATH : ${ - lib.makeLibraryPath [ - dbus - gcc-unwrapped.lib - zlib - ] - }" - "--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}" - # Fix libQt errors - #96490 - "--set USE_WOLFRAM_LD_LIBRARY_PATH 1" - # Fix xkeyboard config path for Qt - "--set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb" - # if wayland isn't supported we fail over to xcb - # see https://github.com/qt/qtbase/blob/35d0f012ee9b95e8cf3563a41d710ff3c023d841/src/gui/kernel/qguiapplication.cpp#L1218 - "--set QT_QPA_PLATFORM wayland;xcb" - ] - ++ lib.optionals cudaSupport [ - "--set CUDA_PATH ${cudaEnv}" - "--set NVIDIA_DRIVER_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libnvidia-tls.so" - "--set CUDA_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libcuda.so" - ]; + wrapProgramFlags = [ + "--prefix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ + dbus + gcc-unwrapped.lib + zlib + ] + }" + "--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}" + # Fix libQt errors - #96490 + "--set USE_WOLFRAM_LD_LIBRARY_PATH 1" + # Fix xkeyboard config path for Qt + "--set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb" + # if wayland isn't supported we fail over to xcb + # see https://github.com/qt/qtbase/blob/35d0f012ee9b95e8cf3563a41d710ff3c023d841/src/gui/kernel/qguiapplication.cpp#L1218 + "--set QT_QPA_PLATFORM wayland;xcb" + ] + ++ lib.optionals cudaSupport [ + "--set CUDA_PATH ${cudaEnv}" + "--set NVIDIA_DRIVER_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libnvidia-tls.so" + "--set CUDA_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libcuda.so" + ]; unpackPhase = '' runHook preUnpack diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix index 632bc9e4d1b3..f93929880410 100644 --- a/pkgs/applications/science/math/maxima/default.nix +++ b/pkgs/applications/science/math/maxima/default.nix @@ -52,19 +52,18 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace doc/info/Makefile.am --replace "/usr/bin/env perl" "${perl}/bin/perl" ''; - postInstall = - '' - # Make sure that maxima can find its runtime dependencies. - for prog in "$out/bin/"*; do - wrapProgram "$prog" --prefix PATH ":" "$out/bin:${searchPath}" - done - # Move documentation into the right place. - mkdir -p $out/share/doc - ln -s ../maxima/${finalAttrs.version}/doc $out/share/doc/maxima - '' - + (lib.optionalString (lisp-compiler.pname == "ecl") '' - cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${finalAttrs.version}/binary-ecl/" - ''); + postInstall = '' + # Make sure that maxima can find its runtime dependencies. + for prog in "$out/bin/"*; do + wrapProgram "$prog" --prefix PATH ":" "$out/bin:${searchPath}" + done + # Move documentation into the right place. + mkdir -p $out/share/doc + ln -s ../maxima/${finalAttrs.version}/doc $out/share/doc/maxima + '' + + (lib.optionalString (lisp-compiler.pname == "ecl") '' + cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${finalAttrs.version}/binary-ecl/" + ''); patches = [ # fix path to info dir (see https://trac.sagemath.org/ticket/11348) diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix index 46a90105b61f..d51d6875cbc2 100644 --- a/pkgs/applications/science/math/pari/default.nix +++ b/pkgs/applications/science/math/pari/default.nix @@ -26,23 +26,23 @@ stdenv.mkDerivation rec { hash = "sha256-fTBXj1z5exN6KB9FSNExqvwM3oa8/RDMHhvXKoHmUGE="; }; - buildInputs = - [ - gmp - libX11 - perl - readline - texliveBasic - ] - ++ lib.optionals withThread [ - libpthreadstubs - ]; + buildInputs = [ + gmp + libX11 + perl + readline + texliveBasic + ] + ++ lib.optionals withThread [ + libpthreadstubs + ]; configureScript = "./Configure"; configureFlags = [ "--with-gmp=${lib.getDev gmp}" "--with-readline=${lib.getDev readline}" - ] ++ lib.optional withThread "--mt=pthread"; + ] + ++ lib.optional withThread "--mt=pthread"; preConfigure = '' export LD=$CC diff --git a/pkgs/applications/science/math/weka/default.nix b/pkgs/applications/science/math/weka/default.nix index bb255dc52c6c..e7b94aa9eb61 100644 --- a/pkgs/applications/science/math/weka/default.nix +++ b/pkgs/applications/science/math/weka/default.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation rec { makeWrapper unzip imagemagick - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; # The -Xmx1000M comes suggested from their download page: # https://www.cs.waikato.ac.nz/ml/weka/downloading.html diff --git a/pkgs/applications/science/math/wolfram-engine/default.nix b/pkgs/applications/science/math/wolfram-engine/default.nix index bd3d9fbf769c..f597da73c190 100644 --- a/pkgs/applications/science/math/wolfram-engine/default.nix +++ b/pkgs/applications/science/math/wolfram-engine/default.nix @@ -43,42 +43,41 @@ stdenv.mkDerivation rec { ]; dontWrapQtApps = true; - buildInputs = - [ - alsa-lib - dbus - fontconfig - freetype - gcc.cc - gcc.libc - glib - libssh2 - ncurses - opencv4 - openssl - (lib.getLib stdenv.cc.cc) - unixODBC - xkeyboard_config - libxml2 - libuuid - zlib - libGL - libGLU - ] - ++ (with xorg; [ - libX11 - libXext - libXtst - libXi - libXmu - libXrender - libxcb - libXcursor - libXfixes - libXrandr - libICE - libSM - ]); + buildInputs = [ + alsa-lib + dbus + fontconfig + freetype + gcc.cc + gcc.libc + glib + libssh2 + ncurses + opencv4 + openssl + (lib.getLib stdenv.cc.cc) + unixODBC + xkeyboard_config + libxml2 + libuuid + zlib + libGL + libGLU + ] + ++ (with xorg; [ + libX11 + libXext + libXtst + libXi + libXmu + libXrender + libxcb + libXcursor + libXfixes + libXrandr + libICE + libSM + ]); # some bundled libs are found through LD_LIBRARY_PATH autoPatchelfIgnoreMissingDeps = true; diff --git a/pkgs/applications/science/math/yacas/default.nix b/pkgs/applications/science/math/yacas/default.nix index 26744a19f86f..27617bf98b52 100644 --- a/pkgs/applications/science/math/yacas/default.nix +++ b/pkgs/applications/science/math/yacas/default.nix @@ -58,29 +58,27 @@ stdenv.mkDerivation rec { ]; doCheck = true; - nativeBuildInputs = - [ - cmake - # Perl is only for the documentation - perl - ] - ++ lib.optionals enableJava [ - openjdk - ]; - buildInputs = - [ - ] - ++ lib.optionals enableGui [ - qtbase - wrapQtAppsHook - qtwebengine - ] - ++ lib.optionals enableJupyter [ - boost - jsoncpp - openssl - zmqpp - ]; + nativeBuildInputs = [ + cmake + # Perl is only for the documentation + perl + ] + ++ lib.optionals enableJava [ + openjdk + ]; + buildInputs = [ + ] + ++ lib.optionals enableGui [ + qtbase + wrapQtAppsHook + qtwebengine + ] + ++ lib.optionals enableJupyter [ + boost + jsoncpp + openssl + zmqpp + ]; meta = { description = "Easy to use, general purpose Computer Algebra System${lib.optionalString enableGui ", built with GUI."}"; diff --git a/pkgs/applications/science/misc/boinc/default.nix b/pkgs/applications/science/misc/boinc/default.nix index cdf2609e6372..347d7e958f52 100644 --- a/pkgs/applications/science/misc/boinc/default.nix +++ b/pkgs/applications/science/misc/boinc/default.nix @@ -46,27 +46,26 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - curl - sqlite - patchelf - ] - ++ lib.optionals (!headless) [ - libGLU - libGL - libXmu - libXi - libglut - libjpeg - wxGTK32 - gtk3 - libXScrnSaver - libnotify - libX11 - libxcb - xcbutil - ]; + buildInputs = [ + curl + sqlite + patchelf + ] + ++ lib.optionals (!headless) [ + libGLU + libGL + libXmu + libXi + libglut + libjpeg + wxGTK32 + gtk3 + libXScrnSaver + libnotify + libX11 + libxcb + xcbutil + ]; NIX_LDFLAGS = lib.optionalString (!headless) "-lX11"; @@ -79,7 +78,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-server" "--sysconfdir=${placeholder "out"}/etc" - ] ++ lib.optionals headless [ "--disable-manager" ]; + ] + ++ lib.optionals headless [ "--disable-manager" ]; postInstall = '' install --mode=444 -D 'client/scripts/boinc-client.service' "$out/etc/systemd/system/boinc.service" diff --git a/pkgs/applications/science/misc/colmap/default.nix b/pkgs/applications/science/misc/colmap/default.nix index 96625c2beeca..70f359b545d7 100644 --- a/pkgs/applications/science/misc/colmap/default.nix +++ b/pkgs/applications/science/misc/colmap/default.nix @@ -50,35 +50,33 @@ stdenv'.mkDerivation rec { )) ]; - buildInputs = - [ - boost_static - ceres-solver - eigen - freeimage - glog - libGLU - glew - qtbase - flann - cgal - gmp - mpfr - xorg.libSM - ] - ++ lib.optionals cudaSupport [ - cudatoolkit - cudaPackages.cuda_cudart.static - ]; + buildInputs = [ + boost_static + ceres-solver + eigen + freeimage + glog + libGLU + glew + qtbase + flann + cgal + gmp + mpfr + xorg.libSM + ] + ++ lib.optionals cudaSupport [ + cudatoolkit + cudaPackages.cuda_cudart.static + ]; - nativeBuildInputs = - [ - cmake - qt5.wrapQtAppsHook - ] - ++ lib.optionals cudaSupport [ - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + qt5.wrapQtAppsHook + ] + ++ lib.optionals cudaSupport [ + autoAddDriverRunpath + ]; meta = with lib; { description = "Structure-From-Motion and Multi-View Stereo pipeline"; diff --git a/pkgs/applications/science/misc/golly/default.nix b/pkgs/applications/science/misc/golly/default.nix index ed983b878d40..b45a945fec46 100644 --- a/pkgs/applications/science/misc/golly/default.nix +++ b/pkgs/applications/science/misc/golly/default.nix @@ -42,17 +42,16 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot=$(echo */gui-wx) ''; - postPatch = - '' - substituteInPlace wxprefs.cpp \ - --replace-fail 'PYTHON_SHLIB' '${python3}/lib/libpython3.so' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace makefile-gtk \ - --replace-fail '-Wl,--as-needed' "" \ - --replace-fail '-lGL ' "" \ - --replace-fail '-lGLU' "" - ''; + postPatch = '' + substituteInPlace wxprefs.cpp \ + --replace-fail 'PYTHON_SHLIB' '${python3}/lib/libpython3.so' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace makefile-gtk \ + --replace-fail '-Wl,--as-needed' "" \ + --replace-fail '-lGL ' "" \ + --replace-fail '-lGLU' "" + ''; makeFlags = [ "-f" diff --git a/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix b/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix index e1807fe82bd2..c5b7648e5558 100644 --- a/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix +++ b/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix @@ -71,8 +71,7 @@ let # Tell OpenModelica where built dependencies are located. configureFlags = - lib.optional ifDeps "--with-openmodelicahome=${joinedDeps}" - ++ getAttrDef "configureFlags" [ ] pkg; + lib.optional ifDeps "--with-openmodelicahome=${joinedDeps}" ++ getAttrDef "configureFlags" [ ] pkg; # Our own configurePhase that accounts for omautoconf configurePhase = '' @@ -87,13 +86,12 @@ let deptargets = lib.forEach pkg.omdeps (dep: dep.omtarget); # ... so we ask openmodelica makefile to skip those targets. - preBuild = - '' - for target in ${concatStringsSep " " deptargets}; do - touch ''${target}.skip; - done - '' - + appendByAttr "preBuild" "\n" pkg; + preBuild = '' + for target in ${concatStringsSep " " deptargets}; do + touch ''${target}.skip; + done + '' + + appendByAttr "preBuild" "\n" pkg; makeFlags = "${omtarget}" + appendByAttr "makeFlags" " " pkg; diff --git a/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix b/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix index 3d0891648267..aae2c071fc35 100644 --- a/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix +++ b/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix @@ -35,7 +35,8 @@ mkOpenModelicaDerivation ( flex bison pkg-config - ] ++ lib.optional isCross nativeOMCompiler; + ] + ++ lib.optional isCross nativeOMCompiler; buildInputs = [ targetPackages.stdenv.cc.cc diff --git a/pkgs/applications/science/misc/openmvg/default.nix b/pkgs/applications/science/misc/openmvg/default.nix index caacdd108819..8f757c3ae865 100644 --- a/pkgs/applications/science/misc/openmvg/default.nix +++ b/pkgs/applications/science/misc/openmvg/default.nix @@ -67,7 +67,8 @@ stdenv.mkDerivation rec { "-DCOINUTILS_INCLUDE_DIR_HINTS=${lib.getDev coin-utils}/include" "-DLEMON_INCLUDE_DIR_HINTS=${lib.getDev lemon-graph}/include" "-DOSI_INCLUDE_DIR_HINTS=${lib.getDev osi}/include" - ] ++ lib.optional enableShared "-DOpenMVG_BUILD_SHARED=ON"; + ] + ++ lib.optional enableShared "-DOpenMVG_BUILD_SHARED=ON"; cmakeDir = "./src"; diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix index 747231e738bc..1fa111378329 100644 --- a/pkgs/applications/science/misc/tulip/default.nix +++ b/pkgs/applications/science/misc/tulip/default.nix @@ -28,22 +28,22 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake wrapQtAppsHook - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = - [ - libxml2 - freetype - glew - libjpeg - qtbase - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - libGL - ]; + buildInputs = [ + libxml2 + freetype + glew + libjpeg + qtbase + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGLU + libGL + ]; qtWrapperArgs = [ ''--prefix PATH : ${lib.makeBinPath [ python3 ]}'' ]; diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix index d8bc2a855598..f13c5487a4bf 100644 --- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix +++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix @@ -79,67 +79,66 @@ stdenv.mkDerivation rec { "man" ]; - nativeBuildInputs = - [ cmake ] - ++ lib.optional enablePlumed plumed - ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optional enablePlumed plumed + ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]; - buildInputs = - [ - fftw - perl - hwloc - blas - lapack - ] - ++ lib.optional enableMpi mpi - ++ lib.optionals enableCuda [ - cudaPackages.cuda_cccl - cudaPackages.cuda_cudart - cudaPackages.libcufft - cudaPackages.cuda_profiler_api - ] - ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; + buildInputs = [ + fftw + perl + hwloc + blas + lapack + ] + ++ lib.optional enableMpi mpi + ++ lib.optionals enableCuda [ + cudaPackages.cuda_cccl + cudaPackages.cuda_cudart + cudaPackages.libcufft + cudaPackages.cuda_profiler_api + ] + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; propagatedBuildInputs = lib.optional enableMpi mpi; propagatedUserEnvPkgs = lib.optional enableMpi mpi; - cmakeFlags = - [ - (lib.cmakeBool "GMX_HWLOC" true) - "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}" - "-DGMX_OPENMP:BOOL=TRUE" - "-DBUILD_SHARED_LIBS=ON" - ] - ++ ( - if singlePrec then - [ - "-DGMX_DOUBLE=OFF" - ] - else - [ - "-DGMX_DOUBLE=ON" - "-DGMX_DEFAULT_SUFFIX=OFF" - ] - ) - ++ ( - if enableMpi then - [ - "-DGMX_MPI:BOOL=TRUE" - "-DGMX_THREAD_MPI:BOOL=FALSE" - ] - else - [ - "-DGMX_MPI:BOOL=FALSE" - ] - ) - ++ lib.optionals enableCuda [ - "-DGMX_GPU=CUDA" - (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cmakeCudaArchitecturesString) + cmakeFlags = [ + (lib.cmakeBool "GMX_HWLOC" true) + "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}" + "-DGMX_OPENMP:BOOL=TRUE" + "-DBUILD_SHARED_LIBS=ON" + ] + ++ ( + if singlePrec then + [ + "-DGMX_DOUBLE=OFF" + ] + else + [ + "-DGMX_DOUBLE=ON" + "-DGMX_DEFAULT_SUFFIX=OFF" + ] + ) + ++ ( + if enableMpi then + [ + "-DGMX_MPI:BOOL=TRUE" + "-DGMX_THREAD_MPI:BOOL=FALSE" + ] + else + [ + "-DGMX_MPI:BOOL=FALSE" + ] + ) + ++ lib.optionals enableCuda [ + "-DGMX_GPU=CUDA" + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cmakeCudaArchitecturesString) - # Gromacs seems to ignore and override the normal variables, so we add this ad hoc: - (lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" cmakeCudaArchitecturesString) - ]; + # Gromacs seems to ignore and override the normal variables, so we add this ad hoc: + (lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" cmakeCudaArchitecturesString) + ]; postInstall = '' moveToOutput share/cmake $dev diff --git a/pkgs/applications/science/physics/crystfel/default.nix b/pkgs/applications/science/physics/crystfel/default.nix index 7ec0a5b8b991..23804c22c700 100644 --- a/pkgs/applications/science/physics/crystfel/default.nix +++ b/pkgs/applications/science/physics/crystfel/default.nix @@ -229,31 +229,31 @@ stdenv.mkDerivation rec { doxygen opencl-headers makeWrapper - ] ++ lib.optionals withGui [ wrapGAppsHook3 ]; - buildInputs = - [ - hdf5 - gsl - ncurses - msgpack - fftw - fdip - zeromq - ocl-icd - libccp4 - mosflm - pinkIndexer - xgandalf - pandoc - ] - ++ lib.optionals withGui [ - gtk3 - gdk-pixbuf - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - argp-standalone - ] - ++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ]; + ] + ++ lib.optionals withGui [ wrapGAppsHook3 ]; + buildInputs = [ + hdf5 + gsl + ncurses + msgpack + fftw + fdip + zeromq + ocl-icd + libccp4 + mosflm + pinkIndexer + xgandalf + pandoc + ] + ++ lib.optionals withGui [ + gtk3 + gdk-pixbuf + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + argp-standalone + ] + ++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ]; patches = [ # on darwin at least, we need to link to a separate argp library; diff --git a/pkgs/applications/science/robotics/mavproxy/default.nix b/pkgs/applications/science/robotics/mavproxy/default.nix index 45db22699e42..fb5bd2314554 100644 --- a/pkgs/applications/science/robotics/mavproxy/default.nix +++ b/pkgs/applications/science/robotics/mavproxy/default.nix @@ -27,21 +27,20 @@ buildPythonApplication rec { hash = "sha256-A7tqV1kBCSuWHJUTdUZGcPY/r7X1edGZs6xDctpMbMI="; }; - propagatedBuildInputs = - [ - lxml - matplotlib - numpy - opencv-python - pymavlink - pyserial - setuptools - wxpython - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - billiard - gnureadline - ]; + propagatedBuildInputs = [ + lxml + matplotlib + numpy + opencv-python + pymavlink + pyserial + setuptools + wxpython + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + billiard + gnureadline + ]; # No tests doCheck = false; diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix index 21911c93390d..92aac25623f1 100644 --- a/pkgs/applications/search/recoll/default.nix +++ b/pkgs/applications/search/recoll/default.nix @@ -82,29 +82,28 @@ mkDerivation rec { hash = "sha256-FbDXknumjktcikOfAe4FKtPmggJGGHasq8dpD+8mNzE="; }; - mesonFlags = - [ - "-Drecollq=true" - "-Dwebkit=false" - "-Dsystemd=false" + mesonFlags = [ + "-Drecollq=true" + "-Dwebkit=false" + "-Dsystemd=false" - # this leaks into the final `librecoll-*.so` binary, so we need - # to be sure it is taken from `pkgs.file` rather than `stdenv`, - # especially when cross-compiling - "-Dfile-command=${file}/bin/file" + # this leaks into the final `librecoll-*.so` binary, so we need + # to be sure it is taken from `pkgs.file` rather than `stdenv`, + # especially when cross-compiling + "-Dfile-command=${file}/bin/file" - ] - ++ lib.optionals (!withPython) [ - "-Dpython-module=false" - "-Dpython-chm=false" - ] - ++ lib.optionals (!withGui) [ - "-Dqtgui=false" - "-Dx11mon=false" - ] - ++ [ - "-Dinotify=${useInotify}" - ]; + ] + ++ lib.optionals (!withPython) [ + "-Dpython-module=false" + "-Dpython-chm=false" + ] + ++ lib.optionals (!withGui) [ + "-Dqtgui=false" + "-Dx11mon=false" + ] + ++ [ + "-Dinotify=${useInotify}" + ]; env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" # libxml2-2.12 changed const qualifiers @@ -115,43 +114,41 @@ mkDerivation rec { ./0001-no-qtgui-darwin-bundle.patch ]; - nativeBuildInputs = - [ - makeWrapper - meson - ninja - pkg-config - which - ] - ++ lib.optionals withGui [ - qtbase - qttools - ] - ++ lib.optionals withPython [ - python3Packages.setuptools - ]; + nativeBuildInputs = [ + makeWrapper + meson + ninja + pkg-config + which + ] + ++ lib.optionals withGui [ + qtbase + qttools + ] + ++ lib.optionals withPython [ + python3Packages.setuptools + ]; - buildInputs = - [ - aspell - bison - chmlib - ] - ++ lib.optionals withPython [ - python3Packages.python - python3Packages.mutagen - ] - ++ [ - xapian - zlib - file - ] - ++ lib.optionals withGui [ - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + aspell + bison + chmlib + ] + ++ lib.optionals withPython [ + python3Packages.python + python3Packages.mutagen + ] + ++ [ + xapian + zlib + file + ] + ++ lib.optionals withGui [ + qtbase + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; qtWrapperArgs = [ "--prefix PATH : ${filterPath}" @@ -160,39 +157,38 @@ mkDerivation rec { # the filters search through ${PATH} using a sh proc 'checkcmds' for the # filtering utils. Short circuit this by replacing the filtering command with # the absolute path to the filtering command. - postInstall = - '' - substituteInPlace $out/lib/*/site-packages/recoll/rclconfig.py --replace /usr/share/recoll $out/share/recoll - substituteInPlace $out/share/recoll/filters/rclconfig.py --replace /usr/share/recoll $out/share/recoll - for f in $out/share/recoll/filters/* ; do - if [[ ! "$f" =~ \.zip$ ]]; then - '' - + lib.concatStrings ( - lib.mapAttrsToList (k: v: ('' - substituteInPlace $f --replace '"${k}"' '"${lib.getBin v}/bin/${k}"' - '')) filters - ) - + '' - substituteInPlace $f --replace '"pstotext"' '"${lib.getBin ghostscript}/bin/ps2ascii"' - substituteInPlace $f --replace /usr/bin/perl ${ - lib.getBin (perl.passthru.withPackages (p: [ p.ImageExifTool ])) - }/bin/perl - fi - done - wrapProgram $out/share/recoll/filters/rclaudio.py \ - --prefix PYTHONPATH : $PYTHONPATH - wrapProgram $out/share/recoll/filters/rcljoplin.py \ - --prefix PYTHONPATH : $out/${python3Packages.python.sitePackages} - wrapProgram $out/share/recoll/filters/rclimg \ - --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ ImageExifTool ]}" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $f --replace '"lyx"' '"${lib.getBin lyx}/bin/lyx"' - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && withGui) '' - mkdir $out/Applications - mv $out/bin/recoll.app $out/Applications - ''; + postInstall = '' + substituteInPlace $out/lib/*/site-packages/recoll/rclconfig.py --replace /usr/share/recoll $out/share/recoll + substituteInPlace $out/share/recoll/filters/rclconfig.py --replace /usr/share/recoll $out/share/recoll + for f in $out/share/recoll/filters/* ; do + if [[ ! "$f" =~ \.zip$ ]]; then + '' + + lib.concatStrings ( + lib.mapAttrsToList (k: v: ('' + substituteInPlace $f --replace '"${k}"' '"${lib.getBin v}/bin/${k}"' + '')) filters + ) + + '' + substituteInPlace $f --replace '"pstotext"' '"${lib.getBin ghostscript}/bin/ps2ascii"' + substituteInPlace $f --replace /usr/bin/perl ${ + lib.getBin (perl.passthru.withPackages (p: [ p.ImageExifTool ])) + }/bin/perl + fi + done + wrapProgram $out/share/recoll/filters/rclaudio.py \ + --prefix PYTHONPATH : $PYTHONPATH + wrapProgram $out/share/recoll/filters/rcljoplin.py \ + --prefix PYTHONPATH : $out/${python3Packages.python.sitePackages} + wrapProgram $out/share/recoll/filters/rclimg \ + --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ ImageExifTool ]}" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $f --replace '"lyx"' '"${lib.getBin lyx}/bin/lyx"' + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && withGui) '' + mkdir $out/Applications + mv $out/bin/recoll.app $out/Applications + ''; # create symlink after fixup to prevent double wrapping of recoll postFixup = lib.optionalString (stdenv.hostPlatform.isDarwin && withGui) '' diff --git a/pkgs/applications/system/glances/default.nix b/pkgs/applications/system/glances/default.nix index 5f5c0e62d8a9..3457085148f5 100644 --- a/pkgs/applications/system/glances/default.nix +++ b/pkgs/applications/system/glances/default.nix @@ -66,7 +66,8 @@ buildPythonApplication rec { jinja2 which prometheus-client - ] ++ lib.optional stdenv.hostPlatform.isLinux hddtemp; + ] + ++ lib.optional stdenv.hostPlatform.isLinux hddtemp; passthru.tests = { service = nixosTests.glances; diff --git a/pkgs/applications/terminal-emulators/cool-retro-term/default.nix b/pkgs/applications/terminal-emulators/cool-retro-term/default.nix index ee47e968d8b0..2e91884aa2d2 100644 --- a/pkgs/applications/terminal-emulators/cool-retro-term/default.nix +++ b/pkgs/applications/terminal-emulators/cool-retro-term/default.nix @@ -37,15 +37,14 @@ mkDerivation rec { installFlags = [ "INSTALL_ROOT=$(out)" ]; - preFixup = - '' - mv $out/usr/share $out/share - mv $out/usr/bin $out/bin - rmdir $out/usr - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - ln -s $out/bin/cool-retro-term.app/Contents/MacOS/cool-retro-term $out/bin/cool-retro-term - ''; + preFixup = '' + mv $out/usr/share $out/share + mv $out/usr/bin $out/bin + rmdir $out/usr + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + ln -s $out/bin/cool-retro-term.app/Contents/MacOS/cool-retro-term $out/bin/cool-retro-term + ''; passthru.tests.test = nixosTests.terminal-emulators.cool-retro-term; diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix index ee21013ecae0..7d11d972cbdb 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix @@ -65,22 +65,21 @@ stdenv.mkDerivation { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libX11 - libXt - libXft - ncurses # required to build the terminfo file - fontconfig - freetype - libXrender - libptytty - ] - ++ lib.optionals perlSupport [ - perl - libXext - ] - ++ lib.optional gdkPixbufSupport gdk-pixbuf; + buildInputs = [ + libX11 + libXt + libXft + ncurses # required to build the terminfo file + fontconfig + freetype + libXrender + libptytty + ] + ++ lib.optionals perlSupport [ + perl + libXext + ] + ++ lib.optional gdkPixbufSupport gdk-pixbuf; outputs = [ "out" @@ -133,7 +132,8 @@ stdenv.mkDerivation { "--enable-256-color" (lib.enableFeature perlSupport "perl") (lib.enableFeature unicode3Support "unicode3") - ] ++ lib.optional emojiSupport "--enable-wide-glyphs"; + ] + ++ lib.optional emojiSupport "--enable-wide-glyphs"; LDFLAGS = [ "-lfontconfig" @@ -142,18 +142,17 @@ stdenv.mkDerivation { ]; CFLAGS = [ "-I${freetype.dev}/include/freetype2" ]; - preConfigure = - '' - # without this the terminfo won't be compiled by tic, see man tic - mkdir -p $terminfo/share/terminfo - export TERMINFO=$terminfo/share/terminfo - '' - + lib.optionalString perlSupport '' - # make urxvt find its perl file lib/perl5/site_perl - # is added to PERL5LIB automatically - mkdir -p $out/$(dirname ${perl.libPrefix}) - ln -s $out/lib/urxvt $out/${perl.libPrefix} - ''; + preConfigure = '' + # without this the terminfo won't be compiled by tic, see man tic + mkdir -p $terminfo/share/terminfo + export TERMINFO=$terminfo/share/terminfo + '' + + lib.optionalString perlSupport '' + # make urxvt find its perl file lib/perl5/site_perl + # is added to PERL5LIB automatically + mkdir -p $out/$(dirname ${perl.libPrefix}) + ln -s $out/lib/urxvt $out/${perl.libPrefix} + ''; postInstall = '' mkdir -p $out/nix-support diff --git a/pkgs/applications/terminal-emulators/termite/default.nix b/pkgs/applications/terminal-emulators/termite/default.nix index 9e03345a63a9..ec8118dd5d56 100644 --- a/pkgs/applications/terminal-emulators/termite/default.nix +++ b/pkgs/applications/terminal-emulators/termite/default.nix @@ -62,7 +62,8 @@ stdenv.mkDerivation rec { url = "https://github.com/thestinger/termite/commit/7e9a93b421b9596f8980645a46ac2ad5468dac06.patch"; sha256 = "0vph2m5919f7w1xnc8i6z0j44clsm1chxkfg7l71nahxyfw5yh4j"; }) - ] ++ lib.optional stdenv.hostPlatform.isDarwin ./remove_ldflags_macos.patch; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin ./remove_ldflags_macos.patch; makeFlags = [ "VERSION=v${version}" diff --git a/pkgs/applications/version-management/cgit/common.nix b/pkgs/applications/version-management/cgit/common.nix index 03300018d135..ccd202fa3fe3 100644 --- a/pkgs/applications/version-management/cgit/common.nix +++ b/pkgs/applications/version-management/cgit/common.nix @@ -43,15 +43,14 @@ stdenv.mkDerivation { separateDebugInfo = true; - nativeBuildInputs = - [ - pkg-config - asciidoc - ] - ++ (with python3Packages; [ - python - wrapPython - ]); + nativeBuildInputs = [ + pkg-config + asciidoc + ] + ++ (with python3Packages; [ + python + wrapPython + ]); buildInputs = buildInputs ++ [ openssl zlib diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix index 60ac736f2649..01395975b149 100644 --- a/pkgs/applications/version-management/fossil/default.nix +++ b/pkgs/applications/version-management/fossil/default.nix @@ -34,24 +34,22 @@ stdenv.mkDerivation (finalAttrs: { tcl ]; - buildInputs = - [ - zlib - openssl - readline - which - ed - ] - ++ lib.optional stdenv.hostPlatform.isDarwin libiconv - ++ lib.optional (!withInternalSqlite) sqlite; + buildInputs = [ + zlib + openssl + readline + which + ed + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv + ++ lib.optional (!withInternalSqlite) sqlite; enableParallelBuilding = true; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; configureFlags = - lib.optional (!withInternalSqlite) "--disable-internal-sqlite" - ++ lib.optional withJson "--json"; + lib.optional (!withInternalSqlite) "--disable-internal-sqlite" ++ lib.optional withJson "--json"; preBuild = '' export USER=nonexistent-but-specified-user diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index f57cfd6ee054..bcaeafce029e 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -101,157 +101,150 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; enableParallelInstalling = true; - patches = - [ - ./docbook2texi.patch - ./git-sh-i18n.patch - ./git-send-email-honor-PATH.patch - ./installCheck-path.patch - ] - ++ lib.optionals withSsh [ - ./ssh-path.patch - ]; + patches = [ + ./docbook2texi.patch + ./git-sh-i18n.patch + ./git-send-email-honor-PATH.patch + ./installCheck-path.patch + ] + ++ lib.optionals withSsh [ + ./ssh-path.patch + ]; - postPatch = - '' - # Fix references to gettext introduced by ./git-sh-i18n.patch - substituteInPlace git-sh-i18n.sh \ - --subst-var-by gettext ${gettext} - '' - + lib.optionalString doInstallCheck '' - # ensure we are using the correct shell when executing the test scripts - patchShebangs t/*.sh - '' - + lib.optionalString withSsh '' - for x in connect.c git-gui/lib/remote_add.tcl ; do - substituteInPlace "$x" \ - --subst-var-by ssh "${openssh}/bin/ssh" - done - ''; + postPatch = '' + # Fix references to gettext introduced by ./git-sh-i18n.patch + substituteInPlace git-sh-i18n.sh \ + --subst-var-by gettext ${gettext} + '' + + lib.optionalString doInstallCheck '' + # ensure we are using the correct shell when executing the test scripts + patchShebangs t/*.sh + '' + + lib.optionalString withSsh '' + for x in connect.c git-gui/lib/remote_add.tcl ; do + substituteInPlace "$x" \ + --subst-var-by ssh "${openssh}/bin/ssh" + done + ''; - nativeBuildInputs = - [ - deterministic-host-uname - gettext - perlPackages.perl - makeWrapper - pkg-config - ] - ++ lib.optionals withManual [ - asciidoc - texinfo - xmlto - docbook2x - docbook_xsl - docbook_xml_dtd_45 - libxslt - ]; - buildInputs = - [ - curl - openssl - zlib-ng - expat - (if stdenv.hostPlatform.isFreeBSD then libiconvReal else libiconv) - bash - ] - ++ lib.optionals perlSupport [ perlPackages.perl ] - ++ lib.optionals guiSupport [ - tcl - tk - ] - ++ lib.optionals withpcre2 [ pcre2 ] - ++ lib.optionals withLibsecret [ - glib - libsecret - ]; + nativeBuildInputs = [ + deterministic-host-uname + gettext + perlPackages.perl + makeWrapper + pkg-config + ] + ++ lib.optionals withManual [ + asciidoc + texinfo + xmlto + docbook2x + docbook_xsl + docbook_xml_dtd_45 + libxslt + ]; + buildInputs = [ + curl + openssl + zlib-ng + expat + (if stdenv.hostPlatform.isFreeBSD then libiconvReal else libiconv) + bash + ] + ++ lib.optionals perlSupport [ perlPackages.perl ] + ++ lib.optionals guiSupport [ + tcl + tk + ] + ++ lib.optionals withpcre2 [ pcre2 ] + ++ lib.optionals withLibsecret [ + glib + libsecret + ]; # required to support pthread_cancel() env.NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && stdenv.hostPlatform.libc == "glibc") "-lgcc_s" + lib.optionalString (stdenv.hostPlatform.isFreeBSD) "-lthr"; - configureFlags = - [ - "ac_cv_prog_CURL_CONFIG=${lib.getDev curl}/bin/curl-config" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "ac_cv_fread_reads_directories=yes" - "ac_cv_snprintf_returns_bogus=no" - "ac_cv_iconv_omits_bom=no" - ]; + configureFlags = [ + "ac_cv_prog_CURL_CONFIG=${lib.getDev curl}/bin/curl-config" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "ac_cv_fread_reads_directories=yes" + "ac_cv_snprintf_returns_bogus=no" + "ac_cv_iconv_omits_bom=no" + ]; preBuild = '' makeFlagsArray+=( perllibdir=$out/$(perl -MConfig -wle 'print substr $Config{installsitelib}, 1 + length $Config{siteprefixexp}') ) ''; - makeFlags = - [ - "prefix=\${out}" - "ZLIB_NG=1" - ] - # Git does not allow setting a shell separately for building and run-time. - # Therefore lets leave it at the default /bin/sh when cross-compiling - ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "SHELL_PATH=${stdenv.shell}" - ++ (if perlSupport then [ "PERL_PATH=${perlPackages.perl}/bin/perl" ] else [ "NO_PERL=1" ]) - ++ (if pythonSupport then [ "PYTHON_PATH=${python3}/bin/python" ] else [ "NO_PYTHON=1" ]) - ++ lib.optionals stdenv.hostPlatform.isSunOS [ - "INSTALL=install" - "NO_INET_NTOP=" - "NO_INET_PTON=" - ] - ++ (if stdenv.hostPlatform.isDarwin then [ "NO_APPLE_COMMON_CRYPTO=1" ] else [ "sysconfdir=/etc" ]) - ++ lib.optionals stdenv.hostPlatform.isMusl [ - "NO_SYS_POLL_H=1" - "NO_GETTEXT=YesPlease" - ] - ++ lib.optional withpcre2 "USE_LIBPCRE2=1" - ++ lib.optional (!nlsSupport) "NO_GETTEXT=1" - # git-gui refuses to start with the version of tk distributed with - # macOS Catalina. We can prevent git from building the .app bundle - # by specifying an invalid tk framework. The postInstall step will - # then ensure that git-gui uses tcl/tk from nixpkgs, which is an - # acceptable version. - # - # See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706 - ++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent"; + makeFlags = [ + "prefix=\${out}" + "ZLIB_NG=1" + ] + # Git does not allow setting a shell separately for building and run-time. + # Therefore lets leave it at the default /bin/sh when cross-compiling + ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "SHELL_PATH=${stdenv.shell}" + ++ (if perlSupport then [ "PERL_PATH=${perlPackages.perl}/bin/perl" ] else [ "NO_PERL=1" ]) + ++ (if pythonSupport then [ "PYTHON_PATH=${python3}/bin/python" ] else [ "NO_PYTHON=1" ]) + ++ lib.optionals stdenv.hostPlatform.isSunOS [ + "INSTALL=install" + "NO_INET_NTOP=" + "NO_INET_PTON=" + ] + ++ (if stdenv.hostPlatform.isDarwin then [ "NO_APPLE_COMMON_CRYPTO=1" ] else [ "sysconfdir=/etc" ]) + ++ lib.optionals stdenv.hostPlatform.isMusl [ + "NO_SYS_POLL_H=1" + "NO_GETTEXT=YesPlease" + ] + ++ lib.optional withpcre2 "USE_LIBPCRE2=1" + ++ lib.optional (!nlsSupport) "NO_GETTEXT=1" + # git-gui refuses to start with the version of tk distributed with + # macOS Catalina. We can prevent git from building the .app bundle + # by specifying an invalid tk framework. The postInstall step will + # then ensure that git-gui uses tcl/tk from nixpkgs, which is an + # acceptable version. + # + # See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706 + ++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent"; disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ stdenv.shellPackage ]; - postBuild = - '' - # Set up the flags array for make in the same way as for the main build - # phase from stdenv. - local flagsArray=( - ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES}} - SHELL="$SHELL" - ) - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray - echoCmd 'build flags' "''${flagsArray[@]}" - '' - + lib.optionalString withManual '' - # Need to build the main Git documentation before building the - # contrib/subtree documentation, as the latter depends on the - # asciidoc.conf file created by the former. - make -C Documentation PERL_PATH=${lib.getExe buildPackages.perlPackages.perl} "''${flagsArray[@]}" - '' - + '' - make -C contrib/subtree "''${flagsArray[@]}" all ${lib.optionalString withManual "doc"} - '' - + lib.optionalString perlSupport '' - make -C contrib/diff-highlight "''${flagsArray[@]}" - '' - + lib.optionalString osxkeychainSupport '' - make -C contrib/credential/osxkeychain "''${flagsArray[@]}" - '' - + lib.optionalString withLibsecret '' - make -C contrib/credential/libsecret "''${flagsArray[@]}" - '' - + '' - unset flagsArray - ''; + postBuild = '' + # Set up the flags array for make in the same way as for the main build + # phase from stdenv. + local flagsArray=( + ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES}} + SHELL="$SHELL" + ) + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray + echoCmd 'build flags' "''${flagsArray[@]}" + '' + + lib.optionalString withManual '' + # Need to build the main Git documentation before building the + # contrib/subtree documentation, as the latter depends on the + # asciidoc.conf file created by the former. + make -C Documentation PERL_PATH=${lib.getExe buildPackages.perlPackages.perl} "''${flagsArray[@]}" + '' + + '' + make -C contrib/subtree "''${flagsArray[@]}" all ${lib.optionalString withManual "doc"} + '' + + lib.optionalString perlSupport '' + make -C contrib/diff-highlight "''${flagsArray[@]}" + '' + + lib.optionalString osxkeychainSupport '' + make -C contrib/credential/osxkeychain "''${flagsArray[@]}" + '' + + lib.optionalString withLibsecret '' + make -C contrib/credential/libsecret "''${flagsArray[@]}" + '' + + '' + unset flagsArray + ''; ## Install @@ -282,155 +275,154 @@ stdenv.mkDerivation (finalAttrs: { rm -f $PWD/contrib/credential/libsecret/git-credential-libsecret.o ''; - postInstall = - '' - # Set up the flags array for make in the same way as for the main install - # phase from stdenv. - local flagsArray=( - ''${enableParallelInstalling:+-j''${NIX_BUILD_CORES}} - SHELL="$SHELL" - ) - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray - echoCmd 'install flags' "''${flagsArray[@]}" + postInstall = '' + # Set up the flags array for make in the same way as for the main install + # phase from stdenv. + local flagsArray=( + ''${enableParallelInstalling:+-j''${NIX_BUILD_CORES}} + SHELL="$SHELL" + ) + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray + echoCmd 'install flags' "''${flagsArray[@]}" - # Install git-subtree. - make -C contrib/subtree "''${flagsArray[@]}" install ${lib.optionalString withManual "install-doc"} - rm -rf contrib/subtree + # Install git-subtree. + make -C contrib/subtree "''${flagsArray[@]}" install ${lib.optionalString withManual "install-doc"} + rm -rf contrib/subtree - # Install contrib stuff. - mkdir -p $out/share/git - cp -a contrib $out/share/git/ - mkdir -p $out/share/bash-completion/completions - ln -s $out/share/git/contrib/completion/git-prompt.sh $out/share/bash-completion/completions/ - # only readme, developed in another repo - rm -r contrib/hooks/multimail - mkdir -p $out/share/git-core/contrib - cp -a contrib/hooks/ $out/share/git-core/contrib/ - substituteInPlace $out/share/git-core/contrib/hooks/pre-auto-gc-battery \ + # Install contrib stuff. + mkdir -p $out/share/git + cp -a contrib $out/share/git/ + mkdir -p $out/share/bash-completion/completions + ln -s $out/share/git/contrib/completion/git-prompt.sh $out/share/bash-completion/completions/ + # only readme, developed in another repo + rm -r contrib/hooks/multimail + mkdir -p $out/share/git-core/contrib + cp -a contrib/hooks/ $out/share/git-core/contrib/ + substituteInPlace $out/share/git-core/contrib/hooks/pre-auto-gc-battery \ + --replace ' grep' ' ${gnugrep}/bin/grep' \ + + # grep is a runtime dependency, need to patch so that it's found + substituteInPlace $out/libexec/git-core/git-sh-setup \ --replace ' grep' ' ${gnugrep}/bin/grep' \ + --replace ' egrep' ' ${gnugrep}/bin/egrep' - # grep is a runtime dependency, need to patch so that it's found - substituteInPlace $out/libexec/git-core/git-sh-setup \ - --replace ' grep' ' ${gnugrep}/bin/grep' \ - --replace ' egrep' ' ${gnugrep}/bin/egrep' - - # Fix references to the perl, sed, awk and various coreutil binaries used by - # shell scripts that git calls (e.g. filter-branch) - SCRIPT="$(cat <<'EOS' - BEGIN{ - @a=( - '${gnugrep}/bin/grep', '${gnused}/bin/sed', '${gawk}/bin/awk', - '${coreutils}/bin/cut', '${coreutils}/bin/basename', '${coreutils}/bin/dirname', - '${coreutils}/bin/wc', '${coreutils}/bin/tr' - ${lib.optionalString perlSupport ", '${perlPackages.perl}/bin/perl'"} - ); - } - foreach $c (@a) { - $n=(split("/", $c))[-1]; - s|(?<=[^#][^/.-])\b''${n}(?=\s)|''${c}|g - } - EOS - )" - perl -0777 -i -pe "$SCRIPT" \ - $out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,submodule,subtree,web--browse} + # Fix references to the perl, sed, awk and various coreutil binaries used by + # shell scripts that git calls (e.g. filter-branch) + SCRIPT="$(cat <<'EOS' + BEGIN{ + @a=( + '${gnugrep}/bin/grep', '${gnused}/bin/sed', '${gawk}/bin/awk', + '${coreutils}/bin/cut', '${coreutils}/bin/basename', '${coreutils}/bin/dirname', + '${coreutils}/bin/wc', '${coreutils}/bin/tr' + ${lib.optionalString perlSupport ", '${perlPackages.perl}/bin/perl'"} + ); + } + foreach $c (@a) { + $n=(split("/", $c))[-1]; + s|(?<=[^#][^/.-])\b''${n}(?=\s)|''${c}|g + } + EOS + )" + perl -0777 -i -pe "$SCRIPT" \ + $out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,submodule,subtree,web--browse} - # Also put git-http-backend into $PATH, so that we can use smart - # HTTP(s) transports for pushing - ln -s $out/libexec/git-core/git-http-backend $out/bin/git-http-backend - ln -s $out/share/git/contrib/git-jump/git-jump $out/bin/git-jump - '' - + lib.optionalString perlSupport '' - # wrap perl commands - makeWrapper "$out/share/git/contrib/credential/netrc/git-credential-netrc.perl" $out/libexec/git-core/git-credential-netrc \ - --set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" - # ideally unneeded, but added for backwards compatibility - ln -s $out/libexec/git-core/git-credential-netrc $out/bin/ + # Also put git-http-backend into $PATH, so that we can use smart + # HTTP(s) transports for pushing + ln -s $out/libexec/git-core/git-http-backend $out/bin/git-http-backend + ln -s $out/share/git/contrib/git-jump/git-jump $out/bin/git-jump + '' + + lib.optionalString perlSupport '' + # wrap perl commands + makeWrapper "$out/share/git/contrib/credential/netrc/git-credential-netrc.perl" $out/libexec/git-core/git-credential-netrc \ + --set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" + # ideally unneeded, but added for backwards compatibility + ln -s $out/libexec/git-core/git-credential-netrc $out/bin/ - wrapProgram $out/libexec/git-core/git-cvsimport \ - --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" - wrapProgram $out/libexec/git-core/git-archimport \ - --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" - wrapProgram $out/libexec/git-core/git-instaweb \ - --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" - wrapProgram $out/libexec/git-core/git-cvsexportcommit \ - --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" + wrapProgram $out/libexec/git-core/git-cvsimport \ + --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" + wrapProgram $out/libexec/git-core/git-archimport \ + --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" + wrapProgram $out/libexec/git-core/git-instaweb \ + --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" + wrapProgram $out/libexec/git-core/git-cvsexportcommit \ + --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath perlLibs}" - # gzip (and optionally bzip2, xz, zip) are runtime dependencies for - # gitweb.cgi, need to patch so that it's found - sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \ - $out/share/gitweb/gitweb.cgi - # Give access to CGI.pm and friends (was removed from perl core in 5.22) - for p in ${lib.concatStringsSep " " gitwebPerlLibs}; do - sed -i -e "/use CGI /i use lib \"$p/${perlPackages.perl.libPrefix}\";" \ - "$out/share/gitweb/gitweb.cgi" - done - '' + # gzip (and optionally bzip2, xz, zip) are runtime dependencies for + # gitweb.cgi, need to patch so that it's found + sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \ + $out/share/gitweb/gitweb.cgi + # Give access to CGI.pm and friends (was removed from perl core in 5.22) + for p in ${lib.concatStringsSep " " gitwebPerlLibs}; do + sed -i -e "/use CGI /i use lib \"$p/${perlPackages.perl.libPrefix}\";" \ + "$out/share/gitweb/gitweb.cgi" + done + '' - + ( - if svnSupport then - '' - # wrap git-svn - wrapProgram $out/libexec/git-core/git-svn \ - --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${ - perlPackages.makePerlPath (perlLibs ++ [ svn.out ]) - }" \ - --prefix PATH : "${svn.out}/bin" - '' - else - '' - rm $out/libexec/git-core/git-svn - '' - ) + + ( + if svnSupport then + '' + # wrap git-svn + wrapProgram $out/libexec/git-core/git-svn \ + --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${ + perlPackages.makePerlPath (perlLibs ++ [ svn.out ]) + }" \ + --prefix PATH : "${svn.out}/bin" + '' + else + '' + rm $out/libexec/git-core/git-svn + '' + ) - + ( - if sendEmailSupport then - '' - # wrap git-send-email - wrapProgram $out/libexec/git-core/git-send-email \ - --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath smtpPerlLibs}" - '' - else - '' - rm $out/libexec/git-core/git-send-email - '' - ) + + ( + if sendEmailSupport then + '' + # wrap git-send-email + wrapProgram $out/libexec/git-core/git-send-email \ + --set GITPERLLIB "$out/${perlPackages.perl.libPrefix}:${perlPackages.makePerlPath smtpPerlLibs}" + '' + else + '' + rm $out/libexec/git-core/git-send-email + '' + ) - + lib.optionalString withManual '' - # Install man pages - make "''${flagsArray[@]}" install install-html \ - -C Documentation - '' + + lib.optionalString withManual '' + # Install man pages + make "''${flagsArray[@]}" install install-html \ + -C Documentation + '' - + ( - if guiSupport then - '' - # Wrap Tcl/Tk programs - for prog in bin/gitk libexec/git-core/{git-gui,git-citool,git-gui--askpass}; do - sed -i -e "s|exec 'wish'|exec '${tk}/bin/wish'|g" \ - -e "s|exec wish|exec '${tk}/bin/wish'|g" \ - "$out/$prog" - done - ln -s $out/share/git/contrib/completion/git-completion.bash $out/share/bash-completion/completions/gitk - '' - else - '' - for prog in bin/gitk libexec/git-core/git-gui; do - rm "$out/$prog" - done - '' - ) - + lib.optionalString osxkeychainSupport '' - # enable git-credential-osxkeychain on darwin if desired (default) - mkdir -p $out/etc - cat > $out/etc/gitconfig << EOF - [credential] - helper = osxkeychain - EOF - '' - + '' - unset flagsArray - ''; + + ( + if guiSupport then + '' + # Wrap Tcl/Tk programs + for prog in bin/gitk libexec/git-core/{git-gui,git-citool,git-gui--askpass}; do + sed -i -e "s|exec 'wish'|exec '${tk}/bin/wish'|g" \ + -e "s|exec wish|exec '${tk}/bin/wish'|g" \ + "$out/$prog" + done + ln -s $out/share/git/contrib/completion/git-completion.bash $out/share/bash-completion/completions/gitk + '' + else + '' + for prog in bin/gitk libexec/git-core/git-gui; do + rm "$out/$prog" + done + '' + ) + + lib.optionalString osxkeychainSupport '' + # enable git-credential-osxkeychain on darwin if desired (default) + mkdir -p $out/etc + cat > $out/etc/gitconfig << EOF + [credential] + helper = osxkeychain + EOF + '' + + '' + unset flagsArray + ''; ## InstallCheck @@ -449,89 +441,88 @@ stdenv.mkDerivation (finalAttrs: { stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD ) sysctl; - preInstallCheck = - '' - # Some tests break with high concurrency - # https://github.com/NixOS/nixpkgs/pull/403237 - if ((NIX_BUILD_CORES > 32)); then - NIX_BUILD_CORES=32 + preInstallCheck = '' + # Some tests break with high concurrency + # https://github.com/NixOS/nixpkgs/pull/403237 + if ((NIX_BUILD_CORES > 32)); then + NIX_BUILD_CORES=32 + fi + + installCheckFlagsArray+=( + GIT_PROVE_OPTS="--jobs $NIX_BUILD_CORES --failures --state=failed,save" + GIT_TEST_INSTALLED=$out/bin + ${lib.optionalString (!svnSupport) "NO_SVN_TESTS=y"} + ) + + function disable_test { + local test=$1 pattern=$2 + if [ $# -eq 1 ]; then + mv t/{,skip-}$test.sh || true + else + sed -i t/$test.sh \ + -e "/^\s*test_expect_.*$pattern/,/^\s*' *\$/{s/^/: #/}" fi + } - installCheckFlagsArray+=( - GIT_PROVE_OPTS="--jobs $NIX_BUILD_CORES --failures --state=failed,save" - GIT_TEST_INSTALLED=$out/bin - ${lib.optionalString (!svnSupport) "NO_SVN_TESTS=y"} - ) + # Shared permissions are forbidden in sandbox builds: + substituteInPlace t/test-lib.sh \ + --replace "test_set_prereq POSIXPERM" "" + # TODO: Investigate while these still fail (without POSIXPERM): + # Tested to fail: 2.46.0 + disable_test t0001-init 'shared overrides system' + # Tested to fail: 2.46.0 + disable_test t0001-init 'init honors global core.sharedRepository' + # Tested to fail: 2.46.0 + disable_test t1301-shared-repo + # /build/git-2.44.0/contrib/completion/git-completion.bash: line 452: compgen: command not found + disable_test t9902-completion - function disable_test { - local test=$1 pattern=$2 - if [ $# -eq 1 ]; then - mv t/{,skip-}$test.sh || true - else - sed -i t/$test.sh \ - -e "/^\s*test_expect_.*$pattern/,/^\s*' *\$/{s/^/: #/}" - fi - } + # Our patched gettext never fallbacks + disable_test t0201-gettext-fallbacks + '' + + lib.optionalString (!sendEmailSupport) '' + # Disable sendmail tests + disable_test t9001-send-email + '' + + '' + # Flaky tests: + disable_test t0027-auto-crlf + disable_test t1451-fsck-buffer + disable_test t5319-multi-pack-index + disable_test t6421-merge-partial-clone + disable_test t7504-commit-msg-hook - # Shared permissions are forbidden in sandbox builds: - substituteInPlace t/test-lib.sh \ - --replace "test_set_prereq POSIXPERM" "" - # TODO: Investigate while these still fail (without POSIXPERM): - # Tested to fail: 2.46.0 - disable_test t0001-init 'shared overrides system' - # Tested to fail: 2.46.0 - disable_test t0001-init 'init honors global core.sharedRepository' - # Tested to fail: 2.46.0 - disable_test t1301-shared-repo - # /build/git-2.44.0/contrib/completion/git-completion.bash: line 452: compgen: command not found - disable_test t9902-completion - - # Our patched gettext never fallbacks - disable_test t0201-gettext-fallbacks - '' - + lib.optionalString (!sendEmailSupport) '' - # Disable sendmail tests - disable_test t9001-send-email - '' - + '' - # Flaky tests: - disable_test t0027-auto-crlf - disable_test t1451-fsck-buffer - disable_test t5319-multi-pack-index - disable_test t6421-merge-partial-clone - disable_test t7504-commit-msg-hook - - # Fails reproducibly on ZFS on Linux with formD normalization - disable_test t0021-conversion - disable_test t3910-mac-os-precompose - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # XXX: Some tests added in 2.24.0 fail. - # Please try to re-enable on the next release. - disable_test t7816-grep-binary-pattern - # fail (as of 2.33.0) - #===( 18623;1208 8/? 224/? 2/? )= =fatal: Not a valid object name refs/tags/signed-empty - disable_test t6300-for-each-ref - # not ok 1 - populate workdir (with 2.33.1 on x86_64-darwin) - disable_test t5003-archive-zip - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' - disable_test t7527-builtin-fsmonitor - '' - + - lib.optionalString (stdenv.hostPlatform.isStatic && stdenv.hostPlatform.system == "x86_64-linux") - '' - # https://github.com/NixOS/nixpkgs/pull/394957 - # > t2082-parallel-checkout-attributes.sh (Wstat: 256 (exited 1) Tests: 5 Failed: 1) - disable_test t2082-parallel-checkout-attributes - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - # Test fails (as of 2.17.0, musl 1.1.19) - disable_test t3900-i18n-commit - # Fails largely due to assumptions about BOM - # Tested to fail: 2.18.0 - disable_test t0028-working-tree-encoding - ''; + # Fails reproducibly on ZFS on Linux with formD normalization + disable_test t0021-conversion + disable_test t3910-mac-os-precompose + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # XXX: Some tests added in 2.24.0 fail. + # Please try to re-enable on the next release. + disable_test t7816-grep-binary-pattern + # fail (as of 2.33.0) + #===( 18623;1208 8/? 224/? 2/? )= =fatal: Not a valid object name refs/tags/signed-empty + disable_test t6300-for-each-ref + # not ok 1 - populate workdir (with 2.33.1 on x86_64-darwin) + disable_test t5003-archive-zip + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + disable_test t7527-builtin-fsmonitor + '' + + + lib.optionalString (stdenv.hostPlatform.isStatic && stdenv.hostPlatform.system == "x86_64-linux") + '' + # https://github.com/NixOS/nixpkgs/pull/394957 + # > t2082-parallel-checkout-attributes.sh (Wstat: 256 (exited 1) Tests: 5 Failed: 1) + disable_test t2082-parallel-checkout-attributes + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + # Test fails (as of 2.17.0, musl 1.1.19) + disable_test t3900-i18n-commit + # Fails largely due to assumptions about BOM + # Tested to fail: 2.18.0 + disable_test t0028-working-tree-encoding + ''; stripDebugList = [ "lib" @@ -547,7 +538,8 @@ stdenv.mkDerivation (finalAttrs: { doInstallCheck = true; }); buildbot-integration = nixosTests.buildbot; - } // tests.fetchgit; + } + // tests.fetchgit; updateScript = ./update.sh; }; diff --git a/pkgs/applications/version-management/monotone-viz/graphviz-2.0.nix b/pkgs/applications/version-management/monotone-viz/graphviz-2.0.nix index 28e55d446ae1..88fa657da437 100644 --- a/pkgs/applications/version-management/monotone-viz/graphviz-2.0.nix +++ b/pkgs/applications/version-management/monotone-viz/graphviz-2.0.nix @@ -54,7 +54,8 @@ stdenv.mkDerivation rec { "--with-expatlibdir=${expat.out}/lib" "--with-ltdl-include=${libtool}/include" "--with-ltdl-lib=${libtool.lib}/lib" - ] ++ lib.optional (libX11 == null) "--without-x"; + ] + ++ lib.optional (libX11 == null) "--without-x"; meta = { description = "Program for visualising graphs"; diff --git a/pkgs/applications/version-management/monotone/default.nix b/pkgs/applications/version-management/monotone/default.nix index 216175b8ee88..b72173aef2fd 100644 --- a/pkgs/applications/version-management/monotone/default.nix +++ b/pkgs/applications/version-management/monotone/default.nix @@ -59,16 +59,15 @@ stdenv.mkDerivation rec { ./monotone-1.1-gcc-14.patch ]; - postPatch = - '' - sed -e 's@/usr/bin/less@${less}/bin/less@' -i src/unix/terminal.cc - '' - + lib.optionalString (lib.versionAtLeast boost.version "1.73") '' - find . -type f -exec sed -i \ - -e 's/ E(/ internal_E(/g' \ - -e 's/{E(/{internal_E(/g' \ - {} + - ''; + postPatch = '' + sed -e 's@/usr/bin/less@${less}/bin/less@' -i src/unix/terminal.cc + '' + + lib.optionalString (lib.versionAtLeast boost.version "1.73") '' + find . -type f -exec sed -i \ + -e 's/ E(/ internal_E(/g' \ + -e 's/{E(/{internal_E(/g' \ + {} + + ''; CXXFLAGS = " --std=c++11 "; diff --git a/pkgs/applications/version-management/silver-platter/default.nix b/pkgs/applications/version-management/silver-platter/default.nix index 21592a1f174b..e99884ebe5a8 100644 --- a/pkgs/applications/version-management/silver-platter/default.nix +++ b/pkgs/applications/version-management/silver-platter/default.nix @@ -48,7 +48,8 @@ buildPythonApplication rec { rustPlatform.cargoSetupHook cargo rustc - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; diff --git a/pkgs/applications/version-management/sublime-merge/common.nix b/pkgs/applications/version-management/sublime-merge/common.nix index 5398fe6b781b..f586b7e64cbf 100644 --- a/pkgs/applications/version-management/sublime-merge/common.nix +++ b/pkgs/applications/version-management/sublime-merge/common.nix @@ -150,30 +150,29 @@ stdenv.mkDerivation (rec { makeWrapper ]; - installPhase = - '' - runHook preInstall - mkdir -p "$out/bin" - makeWrapper "''$${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" - '' - + builtins.concatStringsSep "" ( - map (binaryAlias: "ln -s $out/bin/${primaryBinary} $out/bin/${binaryAlias}\n") primaryBinaryAliases - ) - + '' - mkdir -p "$out/share/applications" + installPhase = '' + runHook preInstall + mkdir -p "$out/bin" + makeWrapper "''$${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}" + '' + + builtins.concatStringsSep "" ( + map (binaryAlias: "ln -s $out/bin/${primaryBinary} $out/bin/${binaryAlias}\n") primaryBinaryAliases + ) + + '' + mkdir -p "$out/share/applications" - substitute \ - "''$${primaryBinary}/${primaryBinary}.desktop" \ - "$out/share/applications/${primaryBinary}.desktop" \ - --replace-fail "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}" + substitute \ + "''$${primaryBinary}/${primaryBinary}.desktop" \ + "$out/share/applications/${primaryBinary}.desktop" \ + --replace-fail "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}" - for directory in ''$${primaryBinary}/Icon/*; do - size=$(basename $directory) - mkdir -p "$out/share/icons/hicolor/$size/apps" - ln -s ''$${primaryBinary}/Icon/$size/* $out/share/icons/hicolor/$size/apps - done - runHook postInstall - ''; + for directory in ''$${primaryBinary}/Icon/*; do + size=$(basename $directory) + mkdir -p "$out/share/icons/hicolor/$size/apps" + ln -s ''$${primaryBinary}/Icon/$size/* $out/share/icons/hicolor/$size/apps + done + runHook postInstall + ''; passthru = { updateScript = diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix index 5513f8bfd0f5..4a87cbd4f308 100644 --- a/pkgs/applications/version-management/subversion/default.nix +++ b/pkgs/applications/version-management/subversion/default.nix @@ -64,23 +64,22 @@ let python3 ]; - buildInputs = - [ - zlib - apr - aprutil - sqlite - openssl - lz4 - utf8proc - ] - ++ lib.optional httpSupport serf - ++ lib.optionals pythonBindings [ - python3 - py3c - ] - ++ lib.optional perlBindings perl - ++ lib.optional saslSupport sasl; + buildInputs = [ + zlib + apr + aprutil + sqlite + openssl + lz4 + utf8proc + ] + ++ lib.optional httpSupport serf + ++ lib.optionals pythonBindings [ + python3 + py3c + ] + ++ lib.optional perlBindings perl + ++ lib.optional saslSupport sasl; patches = [ ./apr-1.patch ] ++ extraPatches; @@ -99,22 +98,21 @@ let ./autogen.sh ''; - configureFlags = - [ - (lib.withFeature bdbSupport "berkeley-db") - (lib.withFeatureAs httpServer "apxs" "${apacheHttpd.dev}/bin/apxs") - (lib.withFeatureAs (pythonBindings || perlBindings) "swig" swig) - (lib.withFeatureAs saslSupport "sasl" sasl) - (lib.withFeatureAs httpSupport "serf" serf) - "--with-zlib=${zlib.dev}" - "--with-sqlite=${sqlite.dev}" - "--with-apr=${apr.dev}" - "--with-apr-util=${aprutil.dev}" - ] - ++ lib.optionals javahlBindings [ - "--enable-javahl" - "--with-jdk=${jdk}" - ]; + configureFlags = [ + (lib.withFeature bdbSupport "berkeley-db") + (lib.withFeatureAs httpServer "apxs" "${apacheHttpd.dev}/bin/apxs") + (lib.withFeatureAs (pythonBindings || perlBindings) "swig" swig) + (lib.withFeatureAs saslSupport "sasl" sasl) + (lib.withFeatureAs httpSupport "serf" serf) + "--with-zlib=${zlib.dev}" + "--with-sqlite=${sqlite.dev}" + "--with-apr=${apr.dev}" + "--with-apr-util=${aprutil.dev}" + ] + ++ lib.optionals javahlBindings [ + "--enable-javahl" + "--with-jdk=${jdk}" + ]; preBuild = '' makeFlagsArray=(APACHE_LIBEXECDIR=$out/modules) diff --git a/pkgs/applications/video/anilibria-winmaclinux/default.nix b/pkgs/applications/video/anilibria-winmaclinux/default.nix index 508d36294b51..082db1169636 100644 --- a/pkgs/applications/video/anilibria-winmaclinux/default.nix +++ b/pkgs/applications/video/anilibria-winmaclinux/default.nix @@ -32,10 +32,11 @@ mkDerivation rec { sourceRoot = "${src.name}/src"; - qmakeFlags = - [ "PREFIX=${placeholder "out"}" ] - ++ lib.optionals withVLC [ "CONFIG+=unixvlc" ] - ++ lib.optionals withMPV [ "CONFIG+=unixmpv" ]; + qmakeFlags = [ + "PREFIX=${placeholder "out"}" + ] + ++ lib.optionals withVLC [ "CONFIG+=unixvlc" ] + ++ lib.optionals withMPV [ "CONFIG+=unixmpv" ]; patches = [ ./0001-fix-installation-paths.patch @@ -69,22 +70,21 @@ mkDerivation rec { copyDesktopItems ]; - buildInputs = - [ - qtbase - qtquickcontrols2 - qtwebsockets - qtmultimedia - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-good - gst-plugins-base - gst-libav - gstreamer - ]) - ++ lib.optionals withVLC [ libvlc ] - ++ lib.optionals withMPV [ mpv-unwrapped.dev ]; + buildInputs = [ + qtbase + qtquickcontrols2 + qtwebsockets + qtmultimedia + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-good + gst-plugins-base + gst-libav + gstreamer + ]) + ++ lib.optionals withVLC [ libvlc ] + ++ lib.optionals withMPV [ mpv-unwrapped.dev ]; desktopItems = [ (makeDesktopItem (rec { diff --git a/pkgs/applications/video/clipgrab/default.nix b/pkgs/applications/video/clipgrab/default.nix index 0ac6cae8d569..edc680fad6ba 100644 --- a/pkgs/applications/video/clipgrab/default.nix +++ b/pkgs/applications/video/clipgrab/default.nix @@ -43,17 +43,16 @@ mkDerivation rec { ./yt-dlp-path.patch ]; - postPatch = - '' - substituteInPlace youtube_dl.cpp \ - --replace 'QString YoutubeDl::path = QString();' \ - 'QString YoutubeDl::path = QString("${yt-dlp}/bin/yt-dlp");' - '' - + lib.optionalString (ffmpeg != null) '' - substituteInPlace converter_ffmpeg.cpp \ - --replace '"ffmpeg"' '"${ffmpeg.bin}/bin/ffmpeg"' \ - --replace '"ffmpeg ' '"${ffmpeg.bin}/bin/ffmpeg ' - ''; + postPatch = '' + substituteInPlace youtube_dl.cpp \ + --replace 'QString YoutubeDl::path = QString();' \ + 'QString YoutubeDl::path = QString("${yt-dlp}/bin/yt-dlp");' + '' + + lib.optionalString (ffmpeg != null) '' + substituteInPlace converter_ffmpeg.cpp \ + --replace '"ffmpeg"' '"${ffmpeg.bin}/bin/ffmpeg"' \ + --replace '"ffmpeg ' '"${ffmpeg.bin}/bin/ffmpeg ' + ''; qmakeFlags = [ "clipgrab.pro" ]; diff --git a/pkgs/applications/video/hyperion-ng/default.nix b/pkgs/applications/video/hyperion-ng/default.nix index f803f0f694de..6b4a4bf32bb4 100644 --- a/pkgs/applications/video/hyperion-ng/default.nix +++ b/pkgs/applications/video/hyperion-ng/default.nix @@ -39,30 +39,30 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - buildInputs = - [ - alsa-lib - hidapi - libusb1 - libX11 - libxcb - libXrandr - flatbuffers - protobuf - mbedtls - python3 - qtbase - qtserialport - qtsvg - qtx11extras - ] - ++ lib.optional stdenv.hostPlatform.isLinux libcec - ++ lib.optional withRPiDispmanx libraspberrypi; + buildInputs = [ + alsa-lib + hidapi + libusb1 + libX11 + libxcb + libXrandr + flatbuffers + protobuf + mbedtls + python3 + qtbase + qtserialport + qtsvg + qtx11extras + ] + ++ lib.optional stdenv.hostPlatform.isLinux libcec + ++ lib.optional withRPiDispmanx libraspberrypi; nativeBuildInputs = [ cmake wrapQtAppsHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin perl; # for macos bundle + ] + ++ lib.optional stdenv.hostPlatform.isDarwin perl; # for macos bundle patchPhase = '' patchShebangs test/testrunner.sh @@ -76,7 +76,8 @@ stdenv.mkDerivation rec { "-DUSE_SYSTEM_MBEDTLS_LIBS=ON" # "-DUSE_SYSTEM_QMDNS_LIBS=ON" # qmdnsengine not in nixpkgs yet "-DENABLE_TESTS=ON" - ] ++ lib.optional (withRPiDispmanx == false) "-DENABLE_DISPMANX=OFF"; + ] + ++ lib.optional (withRPiDispmanx == false) "-DENABLE_DISPMANX=OFF"; doCheck = true; checkPhase = '' diff --git a/pkgs/applications/video/jellyfin-media-player/default.nix b/pkgs/applications/video/jellyfin-media-player/default.nix index ebcdc89f4f1e..57300cd86484 100644 --- a/pkgs/applications/video/jellyfin-media-player/default.nix +++ b/pkgs/applications/video/jellyfin-media-player/default.nix @@ -40,22 +40,21 @@ mkDerivation rec { ./disable-update-notifications.patch ]; - buildInputs = - [ - SDL2 - libGL - libX11 - libXrandr - libvdpau - mpv - qtbase - qtwebchannel - qtwebengine - qtx11extras - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ]; + buildInputs = [ + SDL2 + libGL + libX11 + libXrandr + libvdpau + mpv + qtbase + qtwebchannel + qtwebengine + qtx11extras + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ]; nativeBuildInputs = [ cmake @@ -64,14 +63,13 @@ mkDerivation rec { python3 ]; - cmakeFlags = - [ - "-DQTROOT=${qtbase}" - "-GNinja" - ] - ++ lib.optionals (!withDbus) [ - "-DLINUX_X11POWER=ON" - ]; + cmakeFlags = [ + "-DQTROOT=${qtbase}" + "-GNinja" + ] + ++ lib.optionals (!withDbus) [ + "-DLINUX_X11POWER=ON" + ]; preConfigure = '' # link the jellyfin-web files to be copied by cmake (see fix-web-path.patch) diff --git a/pkgs/applications/video/kodi/build-kodi-binary-addon.nix b/pkgs/applications/video/kodi/build-kodi-binary-addon.nix index 53700cb6f77d..894a476540cc 100644 --- a/pkgs/applications/video/kodi/build-kodi-binary-addon.nix +++ b/pkgs/applications/video/kodi/build-kodi-binary-addon.nix @@ -30,14 +30,16 @@ toKodiAddon ( kodi kodi-platform libcec_platform - ] ++ extraBuildInputs; + ] + ++ extraBuildInputs; inherit extraRuntimeDependencies; # disables check ensuring install prefix is that of kodi cmakeFlags = [ "-DOVERRIDE_PATHS=1" - ] ++ extraCMakeFlags; + ] + ++ extraCMakeFlags; # kodi checks for addon .so libs existence in the addon folder (share/...) # and the non-wrapped kodi lib/... folder before even trying to dlopen diff --git a/pkgs/applications/video/kodi/unwrapped.nix b/pkgs/applications/video/kodi/unwrapped.nix index 937a2274548f..1b9e7f4314fa 100644 --- a/pkgs/applications/video/kodi/unwrapped.nix +++ b/pkgs/applications/video/kodi/unwrapped.nix @@ -276,189 +276,186 @@ stdenv.mkDerivation ( apache_commons_text ; - buildInputs = - [ - gnutls - libidn2 - libtasn1 - nasm - p11-kit - libxml2 - python3Packages.python - boost - libmicrohttpd - gettext - pcre-cpp - yajl - fribidi - libva - libdrm - openssl - gperf - tinyxml2 - tinyxml-2 - taglib - libssh - gtest - ncurses - spdlog - alsa-lib - libGL - libGLU - fontconfig - freetype - ftgl - libjpeg - libpng - libtiff - libmpeg2 - libsamplerate - libmad - libogg - libvorbis - flac - libxslt - systemd - lzo - libcdio - libmodplug - libass - libbluray - libudfread - sqlite - libmysqlclient - avahi - lame - curl - bzip2 - zip - unzip - mesa-demos - libcec - libcec_platform - dcadec - libuuid - libxcrypt - libgcrypt - libgpg-error - libunistring - libcrossguid - libplist - bluez - glib - harfbuzz - lcms2 - libpthreadstubs - ffmpeg - flatbuffers - fstrcmp - rapidjson - lirc - mesa-gl-headers + buildInputs = [ + gnutls + libidn2 + libtasn1 + nasm + p11-kit + libxml2 + python3Packages.python + boost + libmicrohttpd + gettext + pcre-cpp + yajl + fribidi + libva + libdrm + openssl + gperf + tinyxml2 + tinyxml-2 + taglib + libssh + gtest + ncurses + spdlog + alsa-lib + libGL + libGLU + fontconfig + freetype + ftgl + libjpeg + libpng + libtiff + libmpeg2 + libsamplerate + libmad + libogg + libvorbis + flac + libxslt + systemd + lzo + libcdio + libmodplug + libass + libbluray + libudfread + sqlite + libmysqlclient + avahi + lame + curl + bzip2 + zip + unzip + mesa-demos + libcec + libcec_platform + dcadec + libuuid + libxcrypt + libgcrypt + libgpg-error + libunistring + libcrossguid + libplist + bluez + glib + harfbuzz + lcms2 + libpthreadstubs + ffmpeg + flatbuffers + fstrcmp + rapidjson + lirc + mesa-gl-headers - # Deps needed by TexturePacker, which is built and installed in normal - # kodi build, however the one used during the build is not this one - # in order to support cross-compilation. - giflib - zlib - ] - ++ lib.optionals x11Support [ - libX11 - xorgproto - libXt - libXmu - libXext.dev - libXdmcp - libXinerama - libXrandr.dev - libXtst - libXfixes - ] - ++ lib.optional dbusSupport dbus - ++ lib.optional joystickSupport cwiid - ++ lib.optional nfsSupport libnfs - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional pipewireSupport pipewire - ++ lib.optional rtmpSupport rtmpdump - ++ lib.optional sambaSupport samba - ++ lib.optional udevSupport udev - ++ lib.optional usbSupport libusb-compat-0_1 - ++ lib.optional vdpauSupport libvdpau - ++ lib.optionals waylandSupport [ - wayland - waylandpp.dev - wayland-protocols - # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise - libxkbcommon.dev - ] - ++ lib.optionals gbmSupport [ - libxkbcommon.dev - libgbm - libinput.dev - libdisplay-info - ]; + # Deps needed by TexturePacker, which is built and installed in normal + # kodi build, however the one used during the build is not this one + # in order to support cross-compilation. + giflib + zlib + ] + ++ lib.optionals x11Support [ + libX11 + xorgproto + libXt + libXmu + libXext.dev + libXdmcp + libXinerama + libXrandr.dev + libXtst + libXfixes + ] + ++ lib.optional dbusSupport dbus + ++ lib.optional joystickSupport cwiid + ++ lib.optional nfsSupport libnfs + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional pipewireSupport pipewire + ++ lib.optional rtmpSupport rtmpdump + ++ lib.optional sambaSupport samba + ++ lib.optional udevSupport udev + ++ lib.optional usbSupport libusb-compat-0_1 + ++ lib.optional vdpauSupport libvdpau + ++ lib.optionals waylandSupport [ + wayland + waylandpp.dev + wayland-protocols + # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise + libxkbcommon.dev + ] + ++ lib.optionals gbmSupport [ + libxkbcommon.dev + libgbm + libinput.dev + libdisplay-info + ]; - nativeBuildInputs = - [ - cmake - doxygen - makeWrapper - which - pkg-config - autoconf - automake - libtool # still needed for some components. Check if that is the case with 19.0 - jre_headless - yasm - gettext - python3Packages.python - flatbuffers - ] - ++ lib.optionals waylandSupport [ - wayland-protocols - waylandpp.bin - ]; + nativeBuildInputs = [ + cmake + doxygen + makeWrapper + which + pkg-config + autoconf + automake + libtool # still needed for some components. Check if that is the case with 19.0 + jre_headless + yasm + gettext + python3Packages.python + flatbuffers + ] + ++ lib.optionals waylandSupport [ + wayland-protocols + waylandpp.bin + ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; - cmakeFlags = - [ - "-DAPP_RENDER_SYSTEM=${if gbmSupport then "gles" else "gl"}" - "-Dlibdvdcss_URL=${finalAttrs.libdvdcss}" - "-Dlibdvdnav_URL=${finalAttrs.libdvdnav}" - "-Dlibdvdread_URL=${finalAttrs.libdvdread}" - "-Dgroovy_SOURCE_DIR=${finalAttrs.groovy}" - "-Dapache-commons-lang_SOURCE_DIR=${finalAttrs.apache_commons_lang}" - "-Dapache-commons-text_SOURCE_DIR=${finalAttrs.apache_commons_text}" - # Upstream derives this from the git HEADs hash and date. - # LibreElec (minimal distro for kodi) uses the equivalent to this. - "-DGIT_VERSION=${finalAttrs.version}-${finalAttrs.kodiReleaseName}" - "-DENABLE_EVENTCLIENTS=ON" - "-DENABLE_INTERNAL_CROSSGUID=OFF" - "-DENABLE_INTERNAL_RapidJSON=OFF" - "-DENABLE_OPTICAL=${if opticalSupport then "ON" else "OFF"}" - "-DENABLE_VDPAU=${if vdpauSupport then "ON" else "OFF"}" - "-DLIRC_DEVICE=/run/lirc/lircd" - "-DSWIG_EXECUTABLE=${buildPackages.swig}/bin/swig" - "-DFLATBUFFERS_FLATC_EXECUTABLE=${buildPackages.flatbuffers}/bin/flatc" - "-DPYTHON_EXECUTABLE=${buildPackages.python3Packages.python}/bin/python" - "-DPYTHON_LIB_PATH=${python3Packages.python.sitePackages}" - "-DWITH_JSONSCHEMABUILDER=${lib.getExe jsonSchemaBuilder}" - # When wrapped KODI_HOME will likely contain symlinks to static assets - # that Kodi's built in webserver will cautiously refuse to serve up - # (because their realpaths are outside of KODI_HOME and the other - # whitelisted directories). This adds the entire nix store to the Kodi - # webserver whitelist to avoid this problem. - "-DKODI_WEBSERVER_EXTRA_WHITELIST=${builtins.storeDir}" - ] - ++ lib.optionals waylandSupport [ - "-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-DWITH_TEXTUREPACKER=${lib.getExe texturePacker}" - ]; + cmakeFlags = [ + "-DAPP_RENDER_SYSTEM=${if gbmSupport then "gles" else "gl"}" + "-Dlibdvdcss_URL=${finalAttrs.libdvdcss}" + "-Dlibdvdnav_URL=${finalAttrs.libdvdnav}" + "-Dlibdvdread_URL=${finalAttrs.libdvdread}" + "-Dgroovy_SOURCE_DIR=${finalAttrs.groovy}" + "-Dapache-commons-lang_SOURCE_DIR=${finalAttrs.apache_commons_lang}" + "-Dapache-commons-text_SOURCE_DIR=${finalAttrs.apache_commons_text}" + # Upstream derives this from the git HEADs hash and date. + # LibreElec (minimal distro for kodi) uses the equivalent to this. + "-DGIT_VERSION=${finalAttrs.version}-${finalAttrs.kodiReleaseName}" + "-DENABLE_EVENTCLIENTS=ON" + "-DENABLE_INTERNAL_CROSSGUID=OFF" + "-DENABLE_INTERNAL_RapidJSON=OFF" + "-DENABLE_OPTICAL=${if opticalSupport then "ON" else "OFF"}" + "-DENABLE_VDPAU=${if vdpauSupport then "ON" else "OFF"}" + "-DLIRC_DEVICE=/run/lirc/lircd" + "-DSWIG_EXECUTABLE=${buildPackages.swig}/bin/swig" + "-DFLATBUFFERS_FLATC_EXECUTABLE=${buildPackages.flatbuffers}/bin/flatc" + "-DPYTHON_EXECUTABLE=${buildPackages.python3Packages.python}/bin/python" + "-DPYTHON_LIB_PATH=${python3Packages.python.sitePackages}" + "-DWITH_JSONSCHEMABUILDER=${lib.getExe jsonSchemaBuilder}" + # When wrapped KODI_HOME will likely contain symlinks to static assets + # that Kodi's built in webserver will cautiously refuse to serve up + # (because their realpaths are outside of KODI_HOME and the other + # whitelisted directories). This adds the entire nix store to the Kodi + # webserver whitelist to avoid this problem. + "-DKODI_WEBSERVER_EXTRA_WHITELIST=${builtins.storeDir}" + ] + ++ lib.optionals waylandSupport [ + "-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DWITH_TEXTUREPACKER=${lib.getExe texturePacker}" + ]; # 14 tests fail but the biggest issue is that every test takes 30 seconds - # I'm guessing there is a thing waiting to time out diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index e880ffb89266..e29b7b34a4f7 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -138,91 +138,89 @@ stdenv.mkDerivation { pkg-config yasm ]; - buildInputs = - [ - freetype - ffmpeg - ] - ++ lib.optional aalibSupport aalib - ++ lib.optional fontconfigSupport fontconfig - ++ lib.optional fribidiSupport fribidi - ++ lib.optionals x11Support [ - libX11 - libXext - libGLU - libGL - ] - ++ lib.optional alsaSupport alsa-lib - ++ lib.optional xvSupport libXv - ++ lib.optional theoraSupport libtheora - ++ lib.optional cacaSupport libcaca - ++ lib.optional xineramaSupport libXinerama - ++ lib.optional dvdnavSupport libdvdnav - ++ lib.optional dvdreadSupport libdvdread - ++ lib.optional bluraySupport libbluray - ++ lib.optional cddaSupport cdparanoia - ++ lib.optional jackaudioSupport libjack2 - ++ lib.optionals amrSupport [ - amrnb - amrwb - ] - ++ lib.optional x264Support x264 - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional screenSaverSupport libXScrnSaver - ++ lib.optional lameSupport lame - ++ lib.optional vdpauSupport libvdpau - ++ lib.optional speexSupport speex - ++ lib.optional libpngSupport libpng - ++ lib.optional libjpegSupport libjpeg - ++ lib.optional bs2bSupport libbs2b - ++ lib.optional v4lSupport libv4l; + buildInputs = [ + freetype + ffmpeg + ] + ++ lib.optional aalibSupport aalib + ++ lib.optional fontconfigSupport fontconfig + ++ lib.optional fribidiSupport fribidi + ++ lib.optionals x11Support [ + libX11 + libXext + libGLU + libGL + ] + ++ lib.optional alsaSupport alsa-lib + ++ lib.optional xvSupport libXv + ++ lib.optional theoraSupport libtheora + ++ lib.optional cacaSupport libcaca + ++ lib.optional xineramaSupport libXinerama + ++ lib.optional dvdnavSupport libdvdnav + ++ lib.optional dvdreadSupport libdvdread + ++ lib.optional bluraySupport libbluray + ++ lib.optional cddaSupport cdparanoia + ++ lib.optional jackaudioSupport libjack2 + ++ lib.optionals amrSupport [ + amrnb + amrwb + ] + ++ lib.optional x264Support x264 + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional screenSaverSupport libXScrnSaver + ++ lib.optional lameSupport lame + ++ lib.optional vdpauSupport libvdpau + ++ lib.optional speexSupport speex + ++ lib.optional libpngSupport libpng + ++ lib.optional libjpegSupport libjpeg + ++ lib.optional bs2bSupport libbs2b + ++ lib.optional v4lSupport libv4l; configurePlatforms = [ ]; - configureFlags = - [ - "--enable-freetype" - (if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig") - (if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl") - (if xineramaSupport then "--enable-xinerama" else "--disable-xinerama") - (if xvSupport then "--enable-xv" else "--disable-xv") - (if alsaSupport then "--enable-alsa" else "--disable-alsa") - (if screenSaverSupport then "--enable-xss" else "--disable-xss") - (if vdpauSupport then "--enable-vdpau" else "--disable-vdpau") - (if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia") - (if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav") - (if bluraySupport then "--enable-bluray" else "--disable-bluray") - (if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb") - (if cacaSupport then "--enable-caca" else "--disable-caca") - ( - if lameSupport then - "--enable-mp3lame --disable-mp3lame-lavc" - else - "--disable-mp3lame --enable-mp3lame-lavc" - ) - (if speexSupport then "--enable-speex" else "--disable-speex") - (if theoraSupport then "--enable-theora" else "--disable-theora") - (if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc") - (if jackaudioSupport then "" else "--disable-jack") - (if pulseSupport then "--enable-pulse" else "--disable-pulse") - (if v4lSupport then "--enable-v4l2 --enable-tv-v4l2" else "--disable-v4l2 --disable-tv-v4l2") - "--disable-xanim" - "--disable-xvid --disable-xvid-lavc" - "--disable-ossaudio" - "--disable-ffmpeg_a" - "--yasm=${buildPackages.yasm}/bin/yasm" - # Note, the `target` vs `host` confusion is intentional. - "--target=${stdenv.hostPlatform.config}" - ] - ++ lib.optional (useUnfreeCodecs && codecs != null && !crossBuild) "--codecsdir=${codecs}" - ++ lib.optional (stdenv.hostPlatform.isx86 && !crossBuild) "--enable-runtime-cpudetection" - ++ lib.optional fribidiSupport "--enable-fribidi" - ++ lib.optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch64) "--enable-vidix" - ++ lib.optional stdenv.hostPlatform.isLinux "--enable-fbdev" - ++ lib.optionals (crossBuild) [ - "--enable-cross-compile" - "--disable-vidix-pcidb" - "--with-vidix-drivers=no" - ]; + configureFlags = [ + "--enable-freetype" + (if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig") + (if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl") + (if xineramaSupport then "--enable-xinerama" else "--disable-xinerama") + (if xvSupport then "--enable-xv" else "--disable-xv") + (if alsaSupport then "--enable-alsa" else "--disable-alsa") + (if screenSaverSupport then "--enable-xss" else "--disable-xss") + (if vdpauSupport then "--enable-vdpau" else "--disable-vdpau") + (if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia") + (if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav") + (if bluraySupport then "--enable-bluray" else "--disable-bluray") + (if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb") + (if cacaSupport then "--enable-caca" else "--disable-caca") + ( + if lameSupport then + "--enable-mp3lame --disable-mp3lame-lavc" + else + "--disable-mp3lame --enable-mp3lame-lavc" + ) + (if speexSupport then "--enable-speex" else "--disable-speex") + (if theoraSupport then "--enable-theora" else "--disable-theora") + (if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc") + (if jackaudioSupport then "" else "--disable-jack") + (if pulseSupport then "--enable-pulse" else "--disable-pulse") + (if v4lSupport then "--enable-v4l2 --enable-tv-v4l2" else "--disable-v4l2 --disable-tv-v4l2") + "--disable-xanim" + "--disable-xvid --disable-xvid-lavc" + "--disable-ossaudio" + "--disable-ffmpeg_a" + "--yasm=${buildPackages.yasm}/bin/yasm" + # Note, the `target` vs `host` confusion is intentional. + "--target=${stdenv.hostPlatform.config}" + ] + ++ lib.optional (useUnfreeCodecs && codecs != null && !crossBuild) "--codecsdir=${codecs}" + ++ lib.optional (stdenv.hostPlatform.isx86 && !crossBuild) "--enable-runtime-cpudetection" + ++ lib.optional fribidiSupport "--enable-fribidi" + ++ lib.optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch64) "--enable-vidix" + ++ lib.optional stdenv.hostPlatform.isLinux "--enable-fbdev" + ++ lib.optionals (crossBuild) [ + "--enable-cross-compile" + "--disable-vidix-pcidb" + "--with-vidix-drivers=no" + ]; preConfigure = '' configureFlagsArray+=( diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 4edc2c35c49e..8bb0d9277411 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -149,83 +149,81 @@ stdenv.mkDerivation (finalAttrs: { mesonAutoFeatures = "auto"; - nativeBuildInputs = - [ - addDriverRunpath - docutils # for rst2man - meson - ninja - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - buildPackages.darwin.sigtool - swift - makeWrapper - ] - ++ lib.optionals waylandSupport [ wayland-scanner ]; + nativeBuildInputs = [ + addDriverRunpath + docutils # for rst2man + meson + ninja + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + buildPackages.darwin.sigtool + swift + makeWrapper + ] + ++ lib.optionals waylandSupport [ wayland-scanner ]; - buildInputs = - [ - bash - ffmpeg - freetype - libass - libplacebo - libpthreadstubs - libuchardet - luaEnv - python3 - ] - ++ lib.optionals alsaSupport [ alsa-lib ] - ++ lib.optionals archiveSupport [ libarchive ] - ++ lib.optionals bluraySupport [ libbluray ] - ++ lib.optionals bs2bSupport [ libbs2b ] - ++ lib.optionals cacaSupport [ libcaca ] - ++ lib.optionals cddaSupport [ - libcdio - libcdio-paranoia - ] - ++ lib.optionals cmsSupport [ lcms2 ] - ++ lib.optionals drmSupport [ - libdrm - libdisplay-info - libgbm - ] - ++ lib.optionals dvdnavSupport [ - libdvdnav - libdvdnav.libdvdread - ] - ++ lib.optionals jackaudioSupport [ libjack2 ] - ++ lib.optionals javascriptSupport [ mujs ] - ++ lib.optionals openalSupport [ openalSoft ] - ++ lib.optionals pipewireSupport [ pipewire ] - ++ lib.optionals pulseSupport [ libpulseaudio ] - ++ lib.optionals rubberbandSupport [ rubberband ] - ++ lib.optionals sdl2Support [ SDL2 ] - ++ lib.optionals sixelSupport [ libsixel ] - ++ lib.optionals vaapiSupport [ libva ] - ++ lib.optionals vapoursynthSupport [ vapoursynth ] - ++ lib.optionals vdpauSupport [ libvdpau ] - ++ lib.optionals vulkanSupport [ - shaderc - vulkan-headers - vulkan-loader - ] - ++ lib.optionals waylandSupport [ - wayland - wayland-protocols - libxkbcommon - ] - ++ lib.optionals x11Support [ - libX11 - libXext - libGL - libXrandr - libXpresent - libXScrnSaver - ] - ++ lib.optionals zimgSupport [ zimg ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ]; + buildInputs = [ + bash + ffmpeg + freetype + libass + libplacebo + libpthreadstubs + libuchardet + luaEnv + python3 + ] + ++ lib.optionals alsaSupport [ alsa-lib ] + ++ lib.optionals archiveSupport [ libarchive ] + ++ lib.optionals bluraySupport [ libbluray ] + ++ lib.optionals bs2bSupport [ libbs2b ] + ++ lib.optionals cacaSupport [ libcaca ] + ++ lib.optionals cddaSupport [ + libcdio + libcdio-paranoia + ] + ++ lib.optionals cmsSupport [ lcms2 ] + ++ lib.optionals drmSupport [ + libdrm + libdisplay-info + libgbm + ] + ++ lib.optionals dvdnavSupport [ + libdvdnav + libdvdnav.libdvdread + ] + ++ lib.optionals jackaudioSupport [ libjack2 ] + ++ lib.optionals javascriptSupport [ mujs ] + ++ lib.optionals openalSupport [ openalSoft ] + ++ lib.optionals pipewireSupport [ pipewire ] + ++ lib.optionals pulseSupport [ libpulseaudio ] + ++ lib.optionals rubberbandSupport [ rubberband ] + ++ lib.optionals sdl2Support [ SDL2 ] + ++ lib.optionals sixelSupport [ libsixel ] + ++ lib.optionals vaapiSupport [ libva ] + ++ lib.optionals vapoursynthSupport [ vapoursynth ] + ++ lib.optionals vdpauSupport [ libvdpau ] + ++ lib.optionals vulkanSupport [ + shaderc + vulkan-headers + vulkan-loader + ] + ++ lib.optionals waylandSupport [ + wayland + wayland-protocols + libxkbcommon + ] + ++ lib.optionals x11Support [ + libX11 + libXext + libGL + libXrandr + libXpresent + libXScrnSaver + ] + ++ lib.optionals zimgSupport [ zimg ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ]; # https://github.com/mpv-player/mpv/issues/15591#issuecomment-2764797522 # In file included from ../player/clipboard/clipboard-mac.m:19: @@ -240,35 +238,34 @@ stdenv.mkDerivation (finalAttrs: { popd ''; - postInstall = - '' - # Use a standard font - mkdir -p $out/share/mpv - ln -s ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mpv/subfont.ttf + postInstall = '' + # Use a standard font + mkdir -p $out/share/mpv + ln -s ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mpv/subfont.ttf - pushd ../TOOLS - cp mpv_identify.sh umpv $out/bin/ - popd - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - pushd $out/share/applications + pushd ../TOOLS + cp mpv_identify.sh umpv $out/bin/ + popd + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + pushd $out/share/applications - sed -e '/Icon=/ ! s|mpv|umpv|g; s|^Exec=.*|Exec=umpv %U|' \ - mpv.desktop > umpv.desktop - printf "NoDisplay=true\n" >> umpv.desktop - popd - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r mpv.app $out/Applications + sed -e '/Icon=/ ! s|mpv|umpv|g; s|^Exec=.*|Exec=umpv %U|' \ + mpv.desktop > umpv.desktop + printf "NoDisplay=true\n" >> umpv.desktop + popd + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r mpv.app $out/Applications - # On macOS, many things won’t work properly unless `mpv(1)` is - # executed from the app bundle, such as spatial audio with - # `--ao=avfoundation`. This wrapper ensures that those features - # work reliably and also avoids shipping two copies of the entire - # `mpv` executable. - makeWrapper $out/Applications/mpv.app/Contents/MacOS/mpv $out/bin/mpv - ''; + # On macOS, many things won’t work properly unless `mpv(1)` is + # executed from the app bundle, such as spatial audio with + # `--ao=avfoundation`. This wrapper ensures that those features + # work reliably and also avoids shipping two copies of the entire + # `mpv` executable. + makeWrapper $out/Applications/mpv.app/Contents/MacOS/mpv $out/bin/mpv + ''; # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found. # See the explanation in addDriverRunpath. diff --git a/pkgs/applications/video/mpv/scripts/buildLua.nix b/pkgs/applications/video/mpv/scripts/buildLua.nix index b21df5478a3e..7e4b5b3882ce 100644 --- a/pkgs/applications/video/mpv/scripts/buildLua.nix +++ b/pkgs/applications/video/mpv/scripts/buildLua.nix @@ -76,32 +76,31 @@ lib.makeOverridable ( runHook postInstall ''; - passthru = - { - inherit scriptName; - } - // lib.optionalAttrs (runtime-dependencies != [ ]) { - extraWrapperArgs = [ - "--prefix" - "PATH" - ":" - (lib.makeBinPath runtime-dependencies) - ] ++ args.passthru.extraWrapperArgs or [ ]; - }; - meta = - { - platforms = lib.platforms.all; - } - // ( - let - pos = - if (args.meta or { }) ? description then - builtins.unsafeGetAttrPos "description" args.meta - else - builtins.unsafeGetAttrPos "pname" args; - in - lib.optionalAttrs (pos != null) { position = "${pos.file}:${toString pos.line}"; } - ); + passthru = { + inherit scriptName; + } + // lib.optionalAttrs (runtime-dependencies != [ ]) { + extraWrapperArgs = [ + "--prefix" + "PATH" + ":" + (lib.makeBinPath runtime-dependencies) + ] + ++ args.passthru.extraWrapperArgs or [ ]; + }; + meta = { + platforms = lib.platforms.all; + } + // ( + let + pos = + if (args.meta or { }) ? description then + builtins.unsafeGetAttrPos "description" args.meta + else + builtins.unsafeGetAttrPos "pname" args; + in + lib.optionalAttrs (pos != null) { position = "${pos.file}:${toString pos.line}"; } + ); } ) ) diff --git a/pkgs/applications/video/mpv/scripts/videoclip.nix b/pkgs/applications/video/mpv/scripts/videoclip.nix index ecfb427e2069..445f58cb98fb 100644 --- a/pkgs/applications/video/mpv/scripts/videoclip.nix +++ b/pkgs/applications/video/mpv/scripts/videoclip.nix @@ -19,15 +19,14 @@ buildLua { hash = "sha256-oanc9MggMjVDrSW42XrQwwWw2YTrifiCVrg/r42oGx8="; }; - patchPhase = - '' - substituteInPlace platform.lua \ - --replace \'curl\' \'${lib.getExe curl}\' \ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - --replace xclip ${lib.getExe xclip} \ - --replace wl-copy ${lib.getExe' wl-clipboard "wl-copy"} - ''; + patchPhase = '' + substituteInPlace platform.lua \ + --replace \'curl\' \'${lib.getExe curl}\' \ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + --replace xclip ${lib.getExe xclip} \ + --replace wl-copy ${lib.getExe' wl-clipboard "wl-copy"} + ''; scriptPath = "."; passthru.scriptName = "videoclip"; diff --git a/pkgs/applications/video/mpv/wrapper.nix b/pkgs/applications/video/mpv/wrapper.nix index 54fa65890b03..874aedb7c076 100644 --- a/pkgs/applications/video/mpv/wrapper.nix +++ b/pkgs/applications/video/mpv/wrapper.nix @@ -122,19 +122,18 @@ let ]; }; - postBuild = - '' - # wrapProgram can't operate on symlinks - rm "$out/bin/mpv" - makeWrapper "${mpv}/bin/mpv" "$out/bin/mpv" ${mostMakeWrapperArgs} - rm "$out/bin/umpv" - makeWrapper "${mpv}/bin/umpv" "$out/bin/umpv" ${umpvWrapperArgs} - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # wrapProgram can't operate on symlinks - rm "$out/Applications/mpv.app/Contents/MacOS/mpv" - makeWrapper "${mpv}/Applications/mpv.app/Contents/MacOS/mpv" "$out/Applications/mpv.app/Contents/MacOS/mpv" ${mostMakeWrapperArgs} - ''; + postBuild = '' + # wrapProgram can't operate on symlinks + rm "$out/bin/mpv" + makeWrapper "${mpv}/bin/mpv" "$out/bin/mpv" ${mostMakeWrapperArgs} + rm "$out/bin/umpv" + makeWrapper "${mpv}/bin/umpv" "$out/bin/umpv" ${umpvWrapperArgs} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # wrapProgram can't operate on symlinks + rm "$out/Applications/mpv.app/Contents/MacOS/mpv" + makeWrapper "${mpv}/Applications/mpv.app/Contents/MacOS/mpv" "$out/Applications/mpv.app/Contents/MacOS/mpv" ${mostMakeWrapperArgs} + ''; meta = { inherit (mpv.meta) diff --git a/pkgs/applications/video/mythtv/default.nix b/pkgs/applications/video/mythtv/default.nix index 88f29a6f718c..4f38d13efc97 100644 --- a/pkgs/applications/video/mythtv/default.nix +++ b/pkgs/applications/video/mythtv/default.nix @@ -88,7 +88,8 @@ mkDerivation rec { soundtouch libzip libhdhomerun - ] ++ lib.optional withWebKit qtwebkit; + ] + ++ lib.optional withWebKit qtwebkit; nativeBuildInputs = [ pkg-config which diff --git a/pkgs/applications/video/obs-studio/default.nix b/pkgs/applications/video/obs-studio/default.nix index fe66465836fe..6efd68d99809 100644 --- a/pkgs/applications/video/obs-studio/default.nix +++ b/pkgs/applications/video/obs-studio/default.nix @@ -100,63 +100,61 @@ stdenv.mkDerivation (finalAttrs: { ./fix-nix-plugin-path.patch ]; - nativeBuildInputs = - [ - addDriverRunpath - cmake - ninja - pkg-config - wrapGAppsHook3 - wrapQtAppsHook - extra-cmake-modules - ] - ++ optional scriptingSupport swig - ++ optional cudaSupport autoAddDriverRunpath; + nativeBuildInputs = [ + addDriverRunpath + cmake + ninja + pkg-config + wrapGAppsHook3 + wrapQtAppsHook + extra-cmake-modules + ] + ++ optional scriptingSupport swig + ++ optional cudaSupport autoAddDriverRunpath; - buildInputs = - [ - curl - ffmpeg - jansson - libjack2 - libv4l - libxkbcommon - libpthreadstubs - libXdmcp - qtbase - qtsvg - speex - wayland - x264 - libvlc - mbedtls - pciutils - librist - cjson - libva - srt - qtwayland - nlohmann_json - websocketpp - asio - libdatachannel - libvpl - qrcodegencpp - uthash - nv-codec-headers-12 - ] - ++ optionals scriptingSupport [ - luajit - python3 - ] - ++ optional alsaSupport alsa-lib - ++ optional pulseaudioSupport libpulseaudio - ++ optionals pipewireSupport [ - pipewire - libdrm - ] - ++ optional browserSupport cef - ++ optional withFdk fdk_aac; + buildInputs = [ + curl + ffmpeg + jansson + libjack2 + libv4l + libxkbcommon + libpthreadstubs + libXdmcp + qtbase + qtsvg + speex + wayland + x264 + libvlc + mbedtls + pciutils + librist + cjson + libva + srt + qtwayland + nlohmann_json + websocketpp + asio + libdatachannel + libvpl + qrcodegencpp + uthash + nv-codec-headers-12 + ] + ++ optionals scriptingSupport [ + luajit + python3 + ] + ++ optional alsaSupport alsa-lib + ++ optional pulseaudioSupport libpulseaudio + ++ optionals pipewireSupport [ + pipewire + libdrm + ] + ++ optional browserSupport cef + ++ optional withFdk fdk_aac; # Copied from the obs-linuxbrowser postUnpack = lib.optionalString browserSupport '' @@ -181,7 +179,8 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "ENABLE_PIPEWIRE" pipewireSupport) (lib.cmakeBool "ENABLE_AJA" false) # TODO: fix linking against libajantv2 (lib.cmakeBool "ENABLE_BROWSER" browserSupport) - ] ++ lib.optional browserSupport "-DCEF_ROOT_DIR=../../cef"; + ] + ++ lib.optional browserSupport "-DCEF_ROOT_DIR=../../cef"; env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=deprecated-declarations" @@ -196,7 +195,8 @@ stdenv.mkDerivation (finalAttrs: { xorg.libX11 libvlc libGL - ] ++ optionals decklinkSupport [ blackmagic-desktop-video ]; + ] + ++ optionals decklinkSupport [ blackmagic-desktop-video ]; in '' qtWrapperArgs+=( diff --git a/pkgs/applications/video/obs-studio/plugins/obs-vkcapture.nix b/pkgs/applications/video/obs-studio/plugins/obs-vkcapture.nix index f01050fffa25..4ce54c9c7a6f 100644 --- a/pkgs/applications/video/obs-studio/plugins/obs-vkcapture.nix +++ b/pkgs/applications/video/obs-studio/plugins/obs-vkcapture.nix @@ -42,21 +42,20 @@ stdenv.mkDerivation (finalAttrs: { pkg-config wayland-scanner ]; - buildInputs = - [ - libGL - libffi - libX11 - libXau - libXdmcp - libxcb - vulkan-headers - vulkan-loader - wayland - ] - ++ lib.optionals (!stdenv.hostPlatform.isi686) [ - obs-studio - ]; + buildInputs = [ + libGL + libffi + libX11 + libXau + libXdmcp + libxcb + vulkan-headers + vulkan-loader + wayland + ] + ++ lib.optionals (!stdenv.hostPlatform.isi686) [ + obs-studio + ]; postPatch = '' substituteInPlace src/glinject.c \ diff --git a/pkgs/applications/video/obs-studio/wrapper.nix b/pkgs/applications/video/obs-studio/wrapper.nix index c093d64cf6c3..a5c8082501d0 100644 --- a/pkgs/applications/video/obs-studio/wrapper.nix +++ b/pkgs/applications/video/obs-studio/wrapper.nix @@ -30,7 +30,8 @@ symlinkJoin { "$out/bin/obs" ''--set OBS_PLUGINS_PATH "${pluginsJoined}/lib/obs-plugins"'' ''--set OBS_PLUGINS_DATA_PATH "${pluginsJoined}/share/obs/obs-plugins"'' - ] ++ lib.lists.unique pluginArguments; + ] + ++ lib.lists.unique pluginArguments; in '' ${lib.concatStringsSep " " wrapCommandLine} diff --git a/pkgs/applications/video/openshot-qt/default.nix b/pkgs/applications/video/openshot-qt/default.nix index 94dfc75fb7ca..a7244ddb901c 100644 --- a/pkgs/applications/video/openshot-qt/default.nix +++ b/pkgs/applications/video/openshot-qt/default.nix @@ -36,14 +36,13 @@ mkDerivationWith python3.pkgs.buildPythonApplication { wrapGAppsHook3 ]; - buildInputs = - [ - gtk3 - ] - ++ lib.optionals waylandSupport [ - qtwayland - wayland - ]; + buildInputs = [ + gtk3 + ] + ++ lib.optionals waylandSupport [ + qtwayland + wayland + ]; propagatedBuildInputs = with python3.pkgs; [ httplib2 @@ -66,18 +65,17 @@ mkDerivationWith python3.pkgs.buildPythonApplication { dontWrapGApps = true; dontWrapQtApps = true; - postFixup = - '' - wrapProgram $out/bin/openshot-qt \ - '' - # Fix toolbar icons on Darwin - + lib.optionalString stdenv.hostPlatform.isDarwin '' - --suffix QT_PLUGIN_PATH : "${lib.getBin qtsvg}/${qtbase.qtPluginPrefix}" \ - '' - + '' - "''${gappsWrapperArgs[@]}" \ - "''${qtWrapperArgs[@]}" - ''; + postFixup = '' + wrapProgram $out/bin/openshot-qt \ + '' + # Fix toolbar icons on Darwin + + lib.optionalString stdenv.hostPlatform.isDarwin '' + --suffix QT_PLUGIN_PATH : "${lib.getBin qtsvg}/${qtbase.qtPluginPrefix}" \ + '' + + '' + "''${gappsWrapperArgs[@]}" \ + "''${qtWrapperArgs[@]}" + ''; passthru = { inherit libopenshot; diff --git a/pkgs/applications/video/pipe-viewer/default.nix b/pkgs/applications/video/pipe-viewer/default.nix index a6ffd25afc2d..919339af09ad 100644 --- a/pkgs/applications/video/pipe-viewer/default.nix +++ b/pkgs/applications/video/pipe-viewer/default.nix @@ -54,10 +54,11 @@ buildPerlModule rec { nativeBuildInputs = [ makeWrapper ] ++ lib.optionals withGtk3 [ wrapGAppsHook3 ]; - buildInputs = - [ perlEnv ] - # Can't be in perlEnv for wrapGAppsHook3 to work correctly - ++ lib.optional withGtk3 Gtk3; + buildInputs = [ + perlEnv + ] + # Can't be in perlEnv for wrapGAppsHook3 to work correctly + ++ lib.optional withGtk3 Gtk3; # Not supported by buildPerlModule # and the Perl code fails anyway @@ -78,31 +79,30 @@ buildPerlModule rec { cp -r share/* $out/share ''; - postFixup = - '' - wrapProgram "$out/bin/pipe-viewer" \ - --prefix PATH : "${ - lib.makeBinPath [ - ffmpeg - mpv - wget - yt-dlp - ] - }" - '' - + lib.optionalString withGtk3 '' - # make xdg-open overrideable at runtime - wrapProgram "$out/bin/gtk-pipe-viewer" ''${gappsWrapperArgs[@]} \ - --prefix PATH : "${ - lib.makeBinPath [ - ffmpeg - mpv - wget - yt-dlp - ] - }" \ - --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" - ''; + postFixup = '' + wrapProgram "$out/bin/pipe-viewer" \ + --prefix PATH : "${ + lib.makeBinPath [ + ffmpeg + mpv + wget + yt-dlp + ] + }" + '' + + lib.optionalString withGtk3 '' + # make xdg-open overrideable at runtime + wrapProgram "$out/bin/gtk-pipe-viewer" ''${gappsWrapperArgs[@]} \ + --prefix PATH : "${ + lib.makeBinPath [ + ffmpeg + mpv + wget + yt-dlp + ] + }" \ + --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" + ''; meta = with lib; { homepage = "https://github.com/trizen/pipe-viewer"; diff --git a/pkgs/applications/video/vdr/default.nix b/pkgs/applications/video/vdr/default.nix index 9d776fd67047..a86b9482d7b9 100644 --- a/pkgs/applications/video/vdr/default.nix +++ b/pkgs/applications/video/vdr/default.nix @@ -29,24 +29,22 @@ stdenv.mkDerivation rec { postPatch = "substituteInPlace Makefile --replace libsystemd-daemon libsystemd"; - buildInputs = - [ - fontconfig - libjpeg - libcap - freetype - perl - ] - ++ lib.optional enableSystemd systemd - ++ lib.optional enableBidi fribidi; + buildInputs = [ + fontconfig + libjpeg + libcap + freetype + perl + ] + ++ lib.optional enableSystemd systemd + ++ lib.optional enableBidi fribidi; - buildFlags = - [ - "vdr" - "i18n" - ] - ++ lib.optional enableSystemd "SDNOTIFY=1" - ++ lib.optional enableBidi "BIDI=1"; + buildFlags = [ + "vdr" + "i18n" + ] + ++ lib.optional enableSystemd "SDNOTIFY=1" + ++ lib.optional enableBidi "BIDI=1"; nativeBuildInputs = [ perl ]; diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index cd5c8796f172..52a93ebe387f 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -117,24 +117,23 @@ edk2.mkDerivation projectDscPath (finalAttrs: { "fd" ]; - nativeBuildInputs = - [ - util-linux - nasm - acpica-tools - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.bintools - llvmPackages.llvm - ] - ++ lib.optionals msVarsTemplate [ - python3 - pexpect - xorriso - qemu - dosfstools - mtools - ]; + nativeBuildInputs = [ + util-linux + nasm + acpica-tools + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.bintools + llvmPackages.llvm + ] + ++ lib.optionals msVarsTemplate [ + python3 + pexpect + xorriso + qemu + dosfstools + mtools + ]; strictDeps = true; hardeningDisable = [ @@ -216,35 +215,34 @@ edk2.mkDerivation projectDscPath (finalAttrs: { # TODO: Usage of -bios OVMF.fd is discouraged: https://lists.katacontainers.io/pipermail/kata-dev/2021-January/001650.html # We should remove the isx86-specific block here once we're ready to update nixpkgs to stop using that and update the # release notes accordingly. - postInstall = - '' - mkdir -vp $fd/FV - '' - + - lib.optionalString - (builtins.elem fwPrefix [ - "OVMF" - "AAVMF" - "RISCV_VIRT" - "LOONGARCH_VIRT" - ]) - '' - mv -v $out/FV/${fwPrefix}_{CODE,VARS}.fd $fd/FV - '' - + lib.optionalString stdenv.hostPlatform.isx86 '' - mv -v $out/FV/${fwPrefix}.fd $fd/FV - '' - + lib.optionalString msVarsTemplate '' - mv -v $out/FV/${fwPrefix}_VARS.ms.fd $fd/FV - ln -sv $fd/FV/${fwPrefix}_CODE{,.ms}.fd - '' - + lib.optionalString stdenv.hostPlatform.isAarch '' - mv -v $out/FV/QEMU_{EFI,VARS}.fd $fd/FV - # Add symlinks for Fedora dir layout: https://src.fedoraproject.org/rpms/edk2/blob/main/f/edk2.spec - mkdir -vp $fd/AAVMF - ln -s $fd/FV/AAVMF_CODE.fd $fd/AAVMF/QEMU_EFI-pflash.raw - ln -s $fd/FV/AAVMF_VARS.fd $fd/AAVMF/vars-template-pflash.raw - ''; + postInstall = '' + mkdir -vp $fd/FV + '' + + + lib.optionalString + (builtins.elem fwPrefix [ + "OVMF" + "AAVMF" + "RISCV_VIRT" + "LOONGARCH_VIRT" + ]) + '' + mv -v $out/FV/${fwPrefix}_{CODE,VARS}.fd $fd/FV + '' + + lib.optionalString stdenv.hostPlatform.isx86 '' + mv -v $out/FV/${fwPrefix}.fd $fd/FV + '' + + lib.optionalString msVarsTemplate '' + mv -v $out/FV/${fwPrefix}_VARS.ms.fd $fd/FV + ln -sv $fd/FV/${fwPrefix}_CODE{,.ms}.fd + '' + + lib.optionalString stdenv.hostPlatform.isAarch '' + mv -v $out/FV/QEMU_{EFI,VARS}.fd $fd/FV + # Add symlinks for Fedora dir layout: https://src.fedoraproject.org/rpms/edk2/blob/main/f/edk2.spec + mkdir -vp $fd/AAVMF + ln -s $fd/FV/AAVMF_CODE.fd $fd/AAVMF/QEMU_EFI-pflash.raw + ln -s $fd/FV/AAVMF_VARS.fd $fd/AAVMF/vars-template-pflash.raw + ''; dontPatchELF = true; diff --git a/pkgs/applications/virtualization/cri-o/default.nix b/pkgs/applications/virtualization/cri-o/default.nix index 39db872e8fa3..2587f9c78c0e 100644 --- a/pkgs/applications/virtualization/cri-o/default.nix +++ b/pkgs/applications/virtualization/cri-o/default.nix @@ -39,19 +39,18 @@ buildGoModule rec { pkg-config ]; - buildInputs = - [ - btrfs-progs - gpgme - libapparmor - libseccomp - libselinux - lvm2 - ] - ++ lib.optionals (glibc != null) [ - glibc - glibc.static - ]; + buildInputs = [ + btrfs-progs + gpgme + libapparmor + libseccomp + libselinux + lvm2 + ] + ++ lib.optionals (glibc != null) [ + glibc + glibc.static + ]; BUILDTAGS = "apparmor seccomp selinux containers_image_openpgp containers_image_ostree_stub"; buildPhase = '' diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index db07c47dae97..9fe086e4ffeb 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -159,12 +159,13 @@ rec { libtool installShellFiles ]; - buildInputs = - [ sqlite ] - ++ lib.optional withLvm lvm2 - ++ lib.optional withBtrfs btrfs-progs - ++ lib.optional withSystemd systemd - ++ lib.optional withSeccomp libseccomp; + buildInputs = [ + sqlite + ] + ++ lib.optional withLvm lvm2 + ++ lib.optional withBtrfs btrfs-progs + ++ lib.optional withSystemd systemd + ++ lib.optional withSeccomp libseccomp; extraPath = lib.optionals stdenv.hostPlatform.isLinux ( lib.makeBinPath [ @@ -286,15 +287,14 @@ rec { glibc.static ]; - postPatch = - '' - patchShebangs man scripts/build/ - substituteInPlace ./scripts/build/.variables --replace-fail "set -eu" "" - '' - + lib.optionalString (plugins != [ ]) '' - substituteInPlace ./cli-plugins/manager/manager_unix.go --replace-fail /usr/libexec/docker/cli-plugins \ - "${pluginsRef}/libexec/docker/cli-plugins" - ''; + postPatch = '' + patchShebangs man scripts/build/ + substituteInPlace ./scripts/build/.variables --replace-fail "set -eu" "" + '' + + lib.optionalString (plugins != [ ]) '' + substituteInPlace ./cli-plugins/manager/manager_unix.go --replace-fail /usr/libexec/docker/cli-plugins \ + "${pluginsRef}/libexec/docker/cli-plugins" + ''; # Keep eyes on BUILDTIME format - https://github.com/docker/cli/blob/${version}/scripts/build/.variables buildPhase = '' @@ -313,36 +313,35 @@ rec { outputs = [ "out" ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - install -Dm755 ./build/docker $out/libexec/docker/docker + install -Dm755 ./build/docker $out/libexec/docker/docker - makeWrapper $out/libexec/docker/docker $out/bin/docker \ - --prefix PATH : "$out/libexec/docker:$extraPath" - '' - + lib.optionalString (!clientOnly) '' - # symlink docker daemon to docker cli derivation - ln -s ${moby}/bin/dockerd $out/bin/dockerd - ln -s ${moby}/bin/dockerd-rootless $out/bin/dockerd-rootless + makeWrapper $out/libexec/docker/docker $out/bin/docker \ + --prefix PATH : "$out/libexec/docker:$extraPath" + '' + + lib.optionalString (!clientOnly) '' + # symlink docker daemon to docker cli derivation + ln -s ${moby}/bin/dockerd $out/bin/dockerd + ln -s ${moby}/bin/dockerd-rootless $out/bin/dockerd-rootless - # systemd - mkdir -p $out/etc/systemd/system - ln -s ${moby}/etc/systemd/system/docker.service $out/etc/systemd/system/docker.service - ln -s ${moby}/etc/systemd/system/docker.socket $out/etc/systemd/system/docker.socket - '' - # Required to avoid breaking cross builds - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # completion (cli) - installShellCompletion --cmd docker \ - --bash <($out/bin/docker completion bash) \ - --fish <($out/bin/docker completion fish) \ - --zsh <($out/bin/docker completion zsh) - '' - + '' - runHook postInstall - ''; + # systemd + mkdir -p $out/etc/systemd/system + ln -s ${moby}/etc/systemd/system/docker.service $out/etc/systemd/system/docker.service + ln -s ${moby}/etc/systemd/system/docker.socket $out/etc/systemd/system/docker.socket + '' + # Required to avoid breaking cross builds + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # completion (cli) + installShellCompletion --cmd docker \ + --bash <($out/bin/docker completion bash) \ + --fish <($out/bin/docker completion fish) \ + --zsh <($out/bin/docker completion zsh) + '' + + '' + runHook postInstall + ''; passthru = { # Exposed for tarsum build on non-linux systems (build-support/docker/default.nix) diff --git a/pkgs/applications/virtualization/krunvm/default.nix b/pkgs/applications/virtualization/krunvm/default.nix index 8d100b93d439..d67c4e64b78c 100644 --- a/pkgs/applications/virtualization/krunvm/default.nix +++ b/pkgs/applications/virtualization/krunvm/default.nix @@ -36,13 +36,15 @@ stdenv.mkDerivation rec { rustc asciidoctor makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ]; - buildInputs = - [ libkrun ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + libkrun + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; makeFlags = [ "PREFIX=${placeholder "out"}" ]; diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 4724364e6786..e37809a8e6f5 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -151,105 +151,104 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-73hvI5jLUYRgD2mu9NXWke/URXajz/QSbTjUxv7Id1k="; }; - depsBuildBuild = - [ buildPackages.stdenv.cc ] - ++ lib.optionals stdenv.buildPlatform.isDarwin darwinSDK - ++ lib.optionals hexagonSupport [ pkg-config ]; + depsBuildBuild = [ + buildPackages.stdenv.cc + ] + ++ lib.optionals stdenv.buildPlatform.isDarwin darwinSDK + ++ lib.optionals hexagonSupport [ pkg-config ]; - nativeBuildInputs = - [ - makeWrapper - removeReferencesTo - pkg-config - flex - bison - meson - ninja - perl + nativeBuildInputs = [ + makeWrapper + removeReferencesTo + pkg-config + flex + bison + meson + ninja + perl - # Don't change this to python3 and python3.pkgs.*, breaks cross-compilation - python3Packages.python - ] - ++ lib.optionals gtkSupport [ wrapGAppsHook3 ] - ++ lib.optionals enableDocs [ - python3Packages.sphinx - python3Packages.sphinx-rtd-theme - ] - ++ lib.optionals hexagonSupport [ glib ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - sigtool - ] - ++ lib.optionals (!userOnly) [ dtc ]; + # Don't change this to python3 and python3.pkgs.*, breaks cross-compilation + python3Packages.python + ] + ++ lib.optionals gtkSupport [ wrapGAppsHook3 ] + ++ lib.optionals enableDocs [ + python3Packages.sphinx + python3Packages.sphinx-rtd-theme + ] + ++ lib.optionals hexagonSupport [ glib ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + sigtool + ] + ++ lib.optionals (!userOnly) [ dtc ]; # gnutls is required for crypto support (luks) in qemu-img - buildInputs = - [ - glib - gnutls - zlib - ] - ++ lib.optionals (!minimal) [ - dtc - pixman - vde2 - lzo - snappy - libtasn1 - libslirp - libcbor - ] - ++ lib.optionals (!userOnly) [ curl ] - ++ lib.optionals ncursesSupport [ ncurses ] - ++ lib.optionals stdenv.hostPlatform.isDarwin darwinSDK - ++ lib.optionals seccompSupport [ libseccomp ] - ++ lib.optionals numaSupport [ numactl ] - ++ lib.optionals alsaSupport [ alsa-lib ] - ++ lib.optionals pulseSupport [ libpulseaudio ] - ++ lib.optionals pipewireSupport [ pipewire ] - ++ lib.optionals sdlSupport [ - SDL2 - SDL2_image - ] - ++ lib.optionals jackSupport [ libjack2 ] - ++ lib.optionals gtkSupport [ - gtk3 - gettext - vte - ] - ++ lib.optionals vncSupport [ - libjpeg - libpng - ] - ++ lib.optionals smartcardSupport [ libcacard ] - ++ lib.optionals spiceSupport [ - spice-protocol - spice - ] - ++ lib.optionals usbredirSupport [ usbredir ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && !userOnly) [ - libcap_ng - libcap - attr - libaio - ] - ++ lib.optionals xenSupport [ xen ] - ++ lib.optionals cephSupport [ ceph ] - ++ lib.optionals glusterfsSupport [ - glusterfs - libuuid - ] - ++ lib.optionals openGLSupport [ - libgbm - libepoxy - libdrm - ] - ++ lib.optionals rutabagaSupport [ rutabaga_gfx ] - ++ lib.optionals virglSupport [ virglrenderer ] - ++ lib.optionals libiscsiSupport [ libiscsi ] - ++ lib.optionals smbdSupport [ samba ] - ++ lib.optionals uringSupport [ liburing ] - ++ lib.optionals canokeySupport [ canokey-qemu ] - ++ lib.optionals capstoneSupport [ capstone ]; + buildInputs = [ + glib + gnutls + zlib + ] + ++ lib.optionals (!minimal) [ + dtc + pixman + vde2 + lzo + snappy + libtasn1 + libslirp + libcbor + ] + ++ lib.optionals (!userOnly) [ curl ] + ++ lib.optionals ncursesSupport [ ncurses ] + ++ lib.optionals stdenv.hostPlatform.isDarwin darwinSDK + ++ lib.optionals seccompSupport [ libseccomp ] + ++ lib.optionals numaSupport [ numactl ] + ++ lib.optionals alsaSupport [ alsa-lib ] + ++ lib.optionals pulseSupport [ libpulseaudio ] + ++ lib.optionals pipewireSupport [ pipewire ] + ++ lib.optionals sdlSupport [ + SDL2 + SDL2_image + ] + ++ lib.optionals jackSupport [ libjack2 ] + ++ lib.optionals gtkSupport [ + gtk3 + gettext + vte + ] + ++ lib.optionals vncSupport [ + libjpeg + libpng + ] + ++ lib.optionals smartcardSupport [ libcacard ] + ++ lib.optionals spiceSupport [ + spice-protocol + spice + ] + ++ lib.optionals usbredirSupport [ usbredir ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && !userOnly) [ + libcap_ng + libcap + attr + libaio + ] + ++ lib.optionals xenSupport [ xen ] + ++ lib.optionals cephSupport [ ceph ] + ++ lib.optionals glusterfsSupport [ + glusterfs + libuuid + ] + ++ lib.optionals openGLSupport [ + libgbm + libepoxy + libdrm + ] + ++ lib.optionals rutabagaSupport [ rutabaga_gfx ] + ++ lib.optionals virglSupport [ virglrenderer ] + ++ lib.optionals libiscsiSupport [ libiscsi ] + ++ lib.optionals smbdSupport [ samba ] + ++ lib.optionals uringSupport [ liburing ] + ++ lib.optionals canokeySupport [ canokey-qemu ] + ++ lib.optionals capstoneSupport [ capstone ]; dontUseMesonConfigure = true; # meson's configurePhase isn't compatible with qemu build dontAddStaticConfigureFlags = true; @@ -274,7 +273,8 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-oC+bRjEHixv1QEFO9XAm4HHOwoiT+NkhknKGPydnZ5E="; revert = true; }) - ] ++ lib.optional nixosTestRunner ./force-uid0-on-9p.patch; + ] + ++ lib.optional nixosTestRunner ./force-uid0-on-9p.patch; postPatch = '' # Otherwise tries to ensure /var/run exists. @@ -297,44 +297,43 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail /var/tmp "$TMPDIR" ''; - configureFlags = - [ - "--disable-strip" # We'll strip ourselves after separating debug info. - "--enable-gnutls" # auto detection only works when building with --enable-system - (lib.enableFeature enableDocs "docs") - (lib.enableFeature enableTools "tools") - "--localstatedir=/var" - "--sysconfdir=/etc" - "--cross-prefix=${stdenv.cc.targetPrefix}" - (lib.enableFeature guestAgentSupport "guest-agent") - ] - ++ lib.optional numaSupport "--enable-numa" - ++ lib.optional seccompSupport "--enable-seccomp" - ++ lib.optional smartcardSupport "--enable-smartcard" - ++ lib.optional spiceSupport "--enable-spice" - ++ lib.optional usbredirSupport "--enable-usb-redir" - ++ lib.optional (hostCpuTargets != null) "--target-list=${lib.concatStringsSep "," hostCpuTargets}" - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--enable-cocoa" - "--enable-hvf" - ] - ++ lib.optional (stdenv.hostPlatform.isLinux && !userOnly) "--enable-linux-aio" - ++ lib.optional gtkSupport "--enable-gtk" - ++ lib.optional xenSupport "--enable-xen" - ++ lib.optional cephSupport "--enable-rbd" - ++ lib.optional glusterfsSupport "--enable-glusterfs" - ++ lib.optional openGLSupport "--enable-opengl" - ++ lib.optional virglSupport "--enable-virglrenderer" - ++ lib.optional tpmSupport "--enable-tpm" - ++ lib.optional libiscsiSupport "--enable-libiscsi" - ++ lib.optional smbdSupport "--smbd=${samba}/bin/smbd" - ++ lib.optional uringSupport "--enable-linux-io-uring" - ++ lib.optional canokeySupport "--enable-canokey" - ++ lib.optional capstoneSupport "--enable-capstone" - ++ lib.optional (!pluginsSupport) "--disable-plugins" - ++ lib.optional (!enableBlobs) "--disable-install-blobs" - ++ lib.optional userOnly "--disable-system" - ++ lib.optional stdenv.hostPlatform.isStatic "--static"; + configureFlags = [ + "--disable-strip" # We'll strip ourselves after separating debug info. + "--enable-gnutls" # auto detection only works when building with --enable-system + (lib.enableFeature enableDocs "docs") + (lib.enableFeature enableTools "tools") + "--localstatedir=/var" + "--sysconfdir=/etc" + "--cross-prefix=${stdenv.cc.targetPrefix}" + (lib.enableFeature guestAgentSupport "guest-agent") + ] + ++ lib.optional numaSupport "--enable-numa" + ++ lib.optional seccompSupport "--enable-seccomp" + ++ lib.optional smartcardSupport "--enable-smartcard" + ++ lib.optional spiceSupport "--enable-spice" + ++ lib.optional usbredirSupport "--enable-usb-redir" + ++ lib.optional (hostCpuTargets != null) "--target-list=${lib.concatStringsSep "," hostCpuTargets}" + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--enable-cocoa" + "--enable-hvf" + ] + ++ lib.optional (stdenv.hostPlatform.isLinux && !userOnly) "--enable-linux-aio" + ++ lib.optional gtkSupport "--enable-gtk" + ++ lib.optional xenSupport "--enable-xen" + ++ lib.optional cephSupport "--enable-rbd" + ++ lib.optional glusterfsSupport "--enable-glusterfs" + ++ lib.optional openGLSupport "--enable-opengl" + ++ lib.optional virglSupport "--enable-virglrenderer" + ++ lib.optional tpmSupport "--enable-tpm" + ++ lib.optional libiscsiSupport "--enable-libiscsi" + ++ lib.optional smbdSupport "--smbd=${samba}/bin/smbd" + ++ lib.optional uringSupport "--enable-linux-io-uring" + ++ lib.optional canokeySupport "--enable-canokey" + ++ lib.optional capstoneSupport "--enable-capstone" + ++ lib.optional (!pluginsSupport) "--disable-plugins" + ++ lib.optional (!enableBlobs) "--disable-install-blobs" + ++ lib.optional userOnly "--disable-system" + ++ lib.optional stdenv.hostPlatform.isStatic "--static"; dontWrapGApps = true; @@ -344,72 +343,70 @@ stdenv.mkDerivation (finalAttrs: { # * https://github.com/qemu/qemu/blob/v6.1.0/scripts/entitlement.sh#L25 dontStrip = stdenv.hostPlatform.isDarwin; - postFixup = - '' - # the .desktop is both invalid and pointless - rm -f $out/share/applications/qemu.desktop - '' - + lib.optionalString guestAgentSupport '' - # move qemu-ga (guest agent) to separate output - mkdir -p $ga/bin - mv $out/bin/qemu-ga $ga/bin/ - ln -s $ga/bin/qemu-ga $out/bin - remove-references-to -t $out $ga/bin/qemu-ga - '' - + lib.optionalString gtkSupport '' - # wrap GTK Binaries - for f in $out/bin/qemu-system-*; do - wrapGApp $f - done - '' - + lib.optionalString stdenv.hostPlatform.isStatic '' - # HACK: Otherwise the result will have the entire buildInputs closure - # injected by the pkgsStatic stdenv - # - rm -f $out/nix-support/propagated-build-inputs - ''; + postFixup = '' + # the .desktop is both invalid and pointless + rm -f $out/share/applications/qemu.desktop + '' + + lib.optionalString guestAgentSupport '' + # move qemu-ga (guest agent) to separate output + mkdir -p $ga/bin + mv $out/bin/qemu-ga $ga/bin/ + ln -s $ga/bin/qemu-ga $out/bin + remove-references-to -t $out $ga/bin/qemu-ga + '' + + lib.optionalString gtkSupport '' + # wrap GTK Binaries + for f in $out/bin/qemu-system-*; do + wrapGApp $f + done + '' + + lib.optionalString stdenv.hostPlatform.isStatic '' + # HACK: Otherwise the result will have the entire buildInputs closure + # injected by the pkgsStatic stdenv + # + rm -f $out/nix-support/propagated-build-inputs + ''; preBuild = "cd build"; # tests can still timeout on slower systems doCheck = false; nativeCheckInputs = [ socat ]; - preCheck = - '' - # time limits are a little meagre for a build machine that's - # potentially under load. - substituteInPlace ../tests/unit/meson.build \ - --replace 'timeout: slow_tests' 'timeout: 50 * slow_tests' - substituteInPlace ../tests/qtest/meson.build \ - --replace 'timeout: slow_qtests' 'timeout: 50 * slow_qtests' - substituteInPlace ../tests/fp/meson.build \ - --replace 'timeout: 90)' 'timeout: 300)' + preCheck = '' + # time limits are a little meagre for a build machine that's + # potentially under load. + substituteInPlace ../tests/unit/meson.build \ + --replace 'timeout: slow_tests' 'timeout: 50 * slow_tests' + substituteInPlace ../tests/qtest/meson.build \ + --replace 'timeout: slow_qtests' 'timeout: 50 * slow_qtests' + substituteInPlace ../tests/fp/meson.build \ + --replace 'timeout: 90)' 'timeout: 300)' - # point tests towards correct binaries - substituteInPlace ../tests/unit/test-qga.c \ - --replace '/bin/bash' "$(type -P bash)" \ - --replace '/bin/echo' "$(type -P echo)" - substituteInPlace ../tests/unit/test-io-channel-command.c \ - --replace '/bin/socat' "$(type -P socat)" + # point tests towards correct binaries + substituteInPlace ../tests/unit/test-qga.c \ + --replace '/bin/bash' "$(type -P bash)" \ + --replace '/bin/echo' "$(type -P echo)" + substituteInPlace ../tests/unit/test-io-channel-command.c \ + --replace '/bin/socat' "$(type -P socat)" - # combined with a long package name, some temp socket paths - # can end up exceeding max socket name len - substituteInPlace ../tests/qtest/bios-tables-test.c \ - --replace 'qemu-test_acpi_%s_tcg_%s' '%s_%s' + # combined with a long package name, some temp socket paths + # can end up exceeding max socket name len + substituteInPlace ../tests/qtest/bios-tables-test.c \ + --replace 'qemu-test_acpi_%s_tcg_%s' '%s_%s' - # get-fsinfo attempts to access block devices, disallowed by sandbox - sed -i -e '/\/qga\/get-fsinfo/d' -e '/\/qga\/blacklist/d' \ - ../tests/unit/test-qga.c + # get-fsinfo attempts to access block devices, disallowed by sandbox + sed -i -e '/\/qga\/get-fsinfo/d' -e '/\/qga\/blacklist/d' \ + ../tests/unit/test-qga.c - # xattrs are not allowed in the sandbox - substituteInPlace ../tests/qtest/virtio-9p-test.c \ - --replace-fail mapped-xattr mapped-file - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # skip test that stalls on darwin, perhaps due to subtle differences - # in fifo behaviour - substituteInPlace ../tests/unit/meson.build \ - --replace "'test-io-channel-command'" "#'test-io-channel-command'" - ''; + # xattrs are not allowed in the sandbox + substituteInPlace ../tests/qtest/virtio-9p-test.c \ + --replace-fail mapped-xattr mapped-file + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # skip test that stalls on darwin, perhaps due to subtle differences + # in fifo behaviour + substituteInPlace ../tests/unit/meson.build \ + --replace "'test-io-channel-command'" "#'test-io-channel-command'" + ''; # Add a ‘qemu-kvm’ wrapper for compatibility/convenience. postInstall = lib.optionalString (!minimal && !xenSupport) '' diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index f0e6af36de96..1d75a9885fb0 100644 --- a/pkgs/applications/virtualization/singularity/generic.nix +++ b/pkgs/applications/virtualization/singularity/generic.nix @@ -164,36 +164,34 @@ in # apptainer/apptainer: https://github.com/apptainer/apptainer/blob/main/dist/debian/control # sylabs/singularity: https://github.com/sylabs/singularity/blob/main/debian/control - buildInputs = - [ - bash # To patch /bin/sh shebangs. - conmon - cryptsetup - gpgme - libuuid - openssl - squashfsTools # Required at build time by SingularityCE - ] - # Optional dependencies. - # Formatting: Optional dependencies are likely to increase. - # Don't squash them into the same line. - ++ lib.optional enableNvidiaContainerCli nvidia-docker - ++ lib.optional enableSeccomp libseccomp; + buildInputs = [ + bash # To patch /bin/sh shebangs. + conmon + cryptsetup + gpgme + libuuid + openssl + squashfsTools # Required at build time by SingularityCE + ] + # Optional dependencies. + # Formatting: Optional dependencies are likely to increase. + # Don't squash them into the same line. + ++ lib.optional enableNvidiaContainerCli nvidia-docker + ++ lib.optional enableSeccomp libseccomp; configureScript = "./mconfig"; - configureFlags = - [ - "--localstatedir=${ - if externalLocalStateDir != null then externalLocalStateDir else "${placeholder "out"}/var/lib" - }" - "--runstatedir=/var/run" - ] - ++ lib.optional (!enableSeccomp) "--without-seccomp" - ++ lib.optional (enableSuid != defaultToSuid) ( - if enableSuid then "--with-suid" else "--without-suid" - ) - ++ extraConfigureFlags; + configureFlags = [ + "--localstatedir=${ + if externalLocalStateDir != null then externalLocalStateDir else "${placeholder "out"}/var/lib" + }" + "--runstatedir=/var/run" + ] + ++ lib.optional (!enableSeccomp) "--without-seccomp" + ++ lib.optional (enableSuid != defaultToSuid) ( + if enableSuid then "--with-suid" else "--without-suid" + ) + ++ extraConfigureFlags; # causes redefinition of _FORTIFY_SOURCE hardeningDisable = [ "fortify3" ]; @@ -211,7 +209,8 @@ in mount # mount squashfsTools # mksquashfs unsquashfs # Make / unpack squashfs image squashfuse # squashfuse_ll squashfuse # Mount (without unpacking) a squashfs image without privileges - ] ++ lib.optional enableNvidiaContainerCli nvidia-docker; + ] + ++ lib.optional enableNvidiaContainerCli nvidia-docker; postPatch = '' if [[ ! -e .git || ! -e VERSION ]]; then @@ -326,7 +325,8 @@ in ShamrockLee ]; mainProgram = projectName; - } // extraMeta; + } + // extraMeta; }).overrideAttrs ( finalAttrs: prevAttrs: { diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix index 593cd4d63c78..68dd83330c9f 100644 --- a/pkgs/applications/virtualization/virt-manager/default.nix +++ b/pkgs/applications/virtualization/virt-manager/default.nix @@ -56,25 +56,25 @@ stdenv.mkDerivation rec { docutils wrapGAppsHook4 pkg-config - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; - buildInputs = - [ - python3 - libvirt-glib - vte - dconf - gtk-vnc - adwaita-icon-theme - gsettings-desktop-schemas - libosinfo - gtksourceview4 - ] - ++ lib.optionals spiceSupport [ - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - spice-gtk - ]; + buildInputs = [ + python3 + libvirt-glib + vte + dconf + gtk-vnc + adwaita-icon-theme + gsettings-desktop-schemas + libosinfo + gtksourceview4 + ] + ++ lib.optionals spiceSupport [ + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + spice-gtk + ]; postInstall = '' if ! grep -q StartupWMClass= "$out/share/applications/virt-manager.desktop"; then diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index 6a6b819f2770..24cd144288f5 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -132,54 +132,54 @@ stdenv.mkDerivation (finalAttrs: { docbook_xml_dtd_43 yasm glslang - ] ++ optional (!headless) wrapQtAppsHook; + ] + ++ optional (!headless) wrapQtAppsHook; # Wrap manually because we wrap just a small number of executables. dontWrapQtApps = true; - buildInputs = - [ - acpica-tools - dev86 - libxslt - libxml2 - xorgproto - libX11 - libXext - libXcursor - libcap - glib - lvm2 - alsa-lib - curl - libvpx - pam - makeself - perl - libXmu - libXrandr - libpng - libopus - libtpms - python3 - xz - ] - ++ optional javaBindings jdk - ++ optional pythonBindings python3 # Python is needed even when not building bindings - ++ optional pulseSupport libpulseaudio - ++ optionals headless [ libGL ] - ++ optionals (!headless) [ - qtbase - qttools - qtscxml - libXinerama - SDL2 - libGLU - ] - ++ optionals enableWebService [ - gsoap - zlib - ]; + buildInputs = [ + acpica-tools + dev86 + libxslt + libxml2 + xorgproto + libX11 + libXext + libXcursor + libcap + glib + lvm2 + alsa-lib + curl + libvpx + pam + makeself + perl + libXmu + libXrandr + libpng + libopus + libtpms + python3 + xz + ] + ++ optional javaBindings jdk + ++ optional pythonBindings python3 # Python is needed even when not building bindings + ++ optional pulseSupport libpulseaudio + ++ optionals headless [ libGL ] + ++ optionals (!headless) [ + qtbase + qttools + qtscxml + libXinerama + SDL2 + libGLU + ] + ++ optionals enableWebService [ + gsoap + zlib + ]; hardeningDisable = [ "format" diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/builder.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/builder.nix index 9cb17616805d..a955a9551ed4 100644 --- a/pkgs/applications/virtualization/virtualbox/guest-additions/builder.nix +++ b/pkgs/applications/virtualization/virtualbox/guest-additions/builder.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation (finalAttrs: { openssl linuxHeaders xz - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; buildInputs = [ dbus libxslt diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix index 3d69d726dbe5..9a7d0e2e6227 100644 --- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix +++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix @@ -70,7 +70,8 @@ stdenv.mkDerivation { patchelf makeWrapper virtualBoxNixGuestAdditionsBuilder - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; buildPhase = '' runHook preBuild diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix index c2ac127b6841..b7be83f5d33c 100644 --- a/pkgs/applications/window-managers/awesome/default.nix +++ b/pkgs/applications/window-managers/awesome/default.nix @@ -119,12 +119,14 @@ stdenv.mkDerivation rec { xorg.xcbutilwm libxkbcommon xcbutilxrm - ] ++ lib.optional gtk3Support gtk3; + ] + ++ lib.optional gtk3Support gtk3; cmakeFlags = [ #"-DGENERATE_MANPAGES=ON" "-DOVERRIDE_VERSION=${version}" - ] ++ lib.optional lua.pkgs.isLuaJIT "-DLUA_LIBRARY=${lua}/lib/libluajit-5.1.so"; + ] + ++ lib.optional lua.pkgs.isLuaJIT "-DLUA_LIBRARY=${lua}/lib/libluajit-5.1.so"; GI_TYPELIB_PATH = "${pango.out}/lib/girepository-1.0"; # LUA_CPATH and LUA_PATH are used only for *building*, see the --search flags diff --git a/pkgs/applications/window-managers/i3/lock-fancy.nix b/pkgs/applications/window-managers/i3/lock-fancy.nix index 768f067397bd..cd6e8c006360 100644 --- a/pkgs/applications/window-managers/i3/lock-fancy.nix +++ b/pkgs/applications/window-managers/i3/lock-fancy.nix @@ -31,17 +31,16 @@ stdenv.mkDerivation { installShellFiles ]; - postPatch = - '' - sed -i i3lock-fancy \ - -e 's|icon="/usr/share/i3lock-fancy/icons/lockdark.png"|icon="'$out'/share/i3lock-fancy/icons/lockdark.png"|' \ - -e 's|icon="/usr/share/i3lock-fancy/icons/lock.png"|icon="'$out'/share/i3lock-fancy/icons/lock.png"|' - rm Makefile - '' - + lib.optionalString (screenshotCommand != "") '' - sed -i i3lock-fancy \ - -e "s|shot=(import -silent -window root)|shot=(${screenshotCommand})|"; - ''; + postPatch = '' + sed -i i3lock-fancy \ + -e 's|icon="/usr/share/i3lock-fancy/icons/lockdark.png"|icon="'$out'/share/i3lock-fancy/icons/lockdark.png"|' \ + -e 's|icon="/usr/share/i3lock-fancy/icons/lock.png"|icon="'$out'/share/i3lock-fancy/icons/lock.png"|' + rm Makefile + '' + + lib.optionalString (screenshotCommand != "") '' + sed -i i3lock-fancy \ + -e "s|shot=(import -silent -window root)|shot=(${screenshotCommand})|"; + ''; installPhase = '' runHook preInstall diff --git a/pkgs/applications/window-managers/i3/status-rust.nix b/pkgs/applications/window-managers/i3/status-rust.nix index eeddfb58bdf7..33564b2d6554 100644 --- a/pkgs/applications/window-managers/i3/status-rust.nix +++ b/pkgs/applications/window-managers/i3/status-rust.nix @@ -35,26 +35,25 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config makeWrapper - ] ++ (lib.optionals withPipewire [ rustPlatform.bindgenHook ]); + ] + ++ (lib.optionals withPipewire [ rustPlatform.bindgenHook ]); - buildInputs = - [ - dbus - libpulseaudio - openssl - lm_sensors - ] - ++ (lib.optionals withPipewire [ pipewire ]) - ++ (lib.optionals withNotmuch [ notmuch ]); + buildInputs = [ + dbus + libpulseaudio + openssl + lm_sensors + ] + ++ (lib.optionals withPipewire [ pipewire ]) + ++ (lib.optionals withNotmuch [ notmuch ]); - buildFeatures = - [ - "maildir" - "pulseaudio" - ] - ++ (lib.optionals withICUCalendar [ "icu_calendar" ]) - ++ (lib.optionals withPipewire [ "pipewire" ]) - ++ (lib.optionals withNotmuch [ "notmuch" ]); + buildFeatures = [ + "maildir" + "pulseaudio" + ] + ++ (lib.optionals withICUCalendar [ "icu_calendar" ]) + ++ (lib.optionals withPipewire [ "pipewire" ]) + ++ (lib.optionals withNotmuch [ "notmuch" ]); prePatch = '' substituteInPlace src/util.rs \ diff --git a/pkgs/applications/window-managers/wayfire/wrapper.nix b/pkgs/applications/window-managers/wayfire/wrapper.nix index b8193bbc63fd..ae6866b6c44c 100644 --- a/pkgs/applications/window-managers/wayfire/wrapper.nix +++ b/pkgs/applications/window-managers/wayfire/wrapper.nix @@ -13,7 +13,8 @@ symlinkJoin { paths = [ wayfire - ] ++ plugins; + ] + ++ plugins; postBuild = '' for binary in $out/bin/*; do diff --git a/pkgs/applications/window-managers/xmonad/log-applet/default.nix b/pkgs/applications/window-managers/xmonad/log-applet/default.nix index da3aa7c42865..2d93fa25bd1a 100644 --- a/pkgs/applications/window-managers/xmonad/log-applet/default.nix +++ b/pkgs/applications/window-managers/xmonad/log-applet/default.nix @@ -30,25 +30,24 @@ stdenv.mkDerivation rec { sha256 = "042307grf4zvn61gnflhsj5xsjykrk9sjjsprprm4iij0qpybxcw"; }; - buildInputs = - [ - glib - dbus-glib - xorg.xcbutilwm - ] - ++ lib.optionals (desktopSupport == "gnomeflashback") [ - gtk3 - gnome-panel - ] - ++ lib.optionals (desktopSupport == "mate") [ - gtk3 - mate.mate-panel - ] - ++ lib.optionals (desktopSupport == "xfce4") [ - gtk2 - libxfce4util - xfce4-panel - ]; + buildInputs = [ + glib + dbus-glib + xorg.xcbutilwm + ] + ++ lib.optionals (desktopSupport == "gnomeflashback") [ + gtk3 + gnome-panel + ] + ++ lib.optionals (desktopSupport == "mate") [ + gtk3 + mate.mate-panel + ] + ++ lib.optionals (desktopSupport == "xfce4") [ + gtk2 + libxfce4util + xfce4-panel + ]; nativeBuildInputs = [ autoreconfHook diff --git a/pkgs/build-support/appimage/default.nix b/pkgs/build-support/appimage/default.nix index 935387f670f6..1235c039377d 100644 --- a/pkgs/build-support/appimage/default.nix +++ b/pkgs/build-support/appimage/default.nix @@ -73,7 +73,8 @@ rec { meta = { sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; - } // meta; + } + // meta; } // (removeAttrs args (builtins.attrNames (builtins.functionArgs wrapAppImage))) ); diff --git a/pkgs/build-support/binary-cache/default.nix b/pkgs/build-support/binary-cache/default.nix index ec3dc0b5b137..0ef27887820a 100644 --- a/pkgs/build-support/binary-cache/default.nix +++ b/pkgs/build-support/binary-cache/default.nix @@ -36,15 +36,14 @@ stdenv.mkDerivation { preferLocalBuild = true; - nativeBuildInputs = - [ - coreutils - jq - python3 - nix - ] - ++ lib.optional (compression == "xz") xz - ++ lib.optional (compression == "zstd") zstd; + nativeBuildInputs = [ + coreutils + jq + python3 + nix + ] + ++ lib.optional (compression == "xz") xz + ++ lib.optional (compression == "zstd") zstd; buildCommand = '' mkdir -p $out/nar diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 4618b1cbba52..05f6980f0be4 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -44,36 +44,35 @@ # Note: the hardening flags are part of the bintools-wrapper, rather than # the cc-wrapper, because a few of them are handled by the linker. - defaultHardeningFlags ? - [ - "bindnow" - "format" - "fortify" - "fortify3" - "pic" - "relro" - "stackclashprotection" - "stackprotector" - "strictoverflow" - "zerocallusedregs" + defaultHardeningFlags ? [ + "bindnow" + "format" + "fortify" + "fortify3" + "pic" + "relro" + "stackclashprotection" + "stackprotector" + "strictoverflow" + "zerocallusedregs" + ] + ++ lib.optional ( + with stdenvNoCC; + lib.any (x: x) [ + # OpenBSD static linking requires PIE + (with targetPlatform; isOpenBSD && isStatic) + (lib.all (x: x) [ + # Musl-based platforms will keep "pie", other platforms will not. + # If you change this, make sure to update section `{#sec-hardening-in-nixpkgs}` + # in the nixpkgs manual to inform users about the defaults. + (targetPlatform.libc == "musl") + # Except when: + # - static aarch64, where compilation works, but produces segfaulting dynamically linked binaries. + # - static armv7l, where compilation fails. + (!(targetPlatform.isAarch && targetPlatform.isStatic)) + ]) ] - ++ lib.optional ( - with stdenvNoCC; - lib.any (x: x) [ - # OpenBSD static linking requires PIE - (with targetPlatform; isOpenBSD && isStatic) - (lib.all (x: x) [ - # Musl-based platforms will keep "pie", other platforms will not. - # If you change this, make sure to update section `{#sec-hardening-in-nixpkgs}` - # in the nixpkgs manual to inform users about the defaults. - (targetPlatform.libc == "musl") - # Except when: - # - static aarch64, where compilation works, but produces segfaulting dynamically linked binaries. - # - static armv7l, where compilation fails. - (!(targetPlatform.isAarch && targetPlatform.isStatic)) - ]) - ] - ) "pie", + ) "pie", }: assert propagateDoc -> bintools ? man; @@ -222,72 +221,71 @@ stdenvNoCC.mkDerivation { src=$PWD ''; - installPhase = - '' - mkdir -p $out/bin $out/nix-support + installPhase = '' + mkdir -p $out/bin $out/nix-support - wrap() { - local dst="$1" - local wrapper="$2" - export prog="$3" - export use_response_file_by_default=${if isCCTools then "1" else "0"} - substituteAll "$wrapper" "$out/bin/$dst" - chmod +x "$out/bin/$dst" - } - '' + wrap() { + local dst="$1" + local wrapper="$2" + export prog="$3" + export use_response_file_by_default=${if isCCTools then "1" else "0"} + substituteAll "$wrapper" "$out/bin/$dst" + chmod +x "$out/bin/$dst" + } + '' - + ( - if nativeTools then - '' - echo ${nativePrefix} > $out/nix-support/orig-bintools + + ( + if nativeTools then + '' + echo ${nativePrefix} > $out/nix-support/orig-bintools - ldPath="${nativePrefix}/bin" - '' - else - '' - echo $bintools_bin > $out/nix-support/orig-bintools + ldPath="${nativePrefix}/bin" + '' + else + '' + echo $bintools_bin > $out/nix-support/orig-bintools - ldPath="${bintools_bin}/bin" - '' + ldPath="${bintools_bin}/bin" + '' - # Solaris needs an additional ld wrapper. - + optionalString (targetPlatform.isSunOS && nativePrefix != "") '' - ldPath="${nativePrefix}/bin" - exec="$ldPath/${targetPrefix}ld" - wrap ld-solaris ${./ld-solaris-wrapper.sh} - '' - ) + # Solaris needs an additional ld wrapper. + + optionalString (targetPlatform.isSunOS && nativePrefix != "") '' + ldPath="${nativePrefix}/bin" + exec="$ldPath/${targetPrefix}ld" + wrap ld-solaris ${./ld-solaris-wrapper.sh} + '' + ) - # If we are asked to wrap `gas` and this bintools has it, - # then symlink it (`as` will be symlinked next). - # This is mainly for the wrapped gnat-bootstrap on x86-64 Darwin, - # as it must have both the GNU assembler from cctools (installed as `gas`) - # and the Clang integrated assembler (installed as `as`). - # See pkgs/os-specific/darwin/binutils/default.nix for details. - + optionalString wrapGas '' - if [ -e $ldPath/${targetPrefix}gas ]; then - ln -s $ldPath/${targetPrefix}gas $out/bin/${targetPrefix}gas + # If we are asked to wrap `gas` and this bintools has it, + # then symlink it (`as` will be symlinked next). + # This is mainly for the wrapped gnat-bootstrap on x86-64 Darwin, + # as it must have both the GNU assembler from cctools (installed as `gas`) + # and the Clang integrated assembler (installed as `as`). + # See pkgs/os-specific/darwin/binutils/default.nix for details. + + optionalString wrapGas '' + if [ -e $ldPath/${targetPrefix}gas ]; then + ln -s $ldPath/${targetPrefix}gas $out/bin/${targetPrefix}gas + fi + '' + + # Create symlinks for rest of the binaries. + + '' + for binary in objdump objcopy size strings as ar nm gprof dwp c++filt addr2line \ + ranlib readelf elfedit dlltool dllwrap windmc windres; do + if [ -e $ldPath/${targetPrefix}''${binary} ]; then + ln -s $ldPath/${targetPrefix}''${binary} $out/bin/${targetPrefix}''${binary} fi - '' + done - # Create symlinks for rest of the binaries. - + '' - for binary in objdump objcopy size strings as ar nm gprof dwp c++filt addr2line \ - ranlib readelf elfedit dlltool dllwrap windmc windres; do - if [ -e $ldPath/${targetPrefix}''${binary} ]; then - ln -s $ldPath/${targetPrefix}''${binary} $out/bin/${targetPrefix}''${binary} - fi - done + if [ -e ''${ld:-$ldPath/${targetPrefix}ld} ]; then + wrap ${targetPrefix}ld ${./ld-wrapper.sh} ''${ld:-$ldPath/${targetPrefix}ld} + fi - if [ -e ''${ld:-$ldPath/${targetPrefix}ld} ]; then - wrap ${targetPrefix}ld ${./ld-wrapper.sh} ''${ld:-$ldPath/${targetPrefix}ld} - fi - - for variant in $ldPath/${targetPrefix}ld.*; do - basename=$(basename "$variant") - wrap $basename ${./ld-wrapper.sh} $variant - done - ''; + for variant in $ldPath/${targetPrefix}ld.*; do + basename=$(basename "$variant") + wrap $basename ${./ld-wrapper.sh} $variant + done + ''; strictDeps = true; depsTargetTargetPropagated = extraPackages; @@ -458,44 +456,43 @@ stdenvNoCC.mkDerivation { ## + extraBuildCommands; - env = - { - # for substitution in utils.bash - # TODO(@sternenseemann): invent something cleaner than passing in "" in case of absence - expandResponseParams = "${expand-response-params}/bin/expand-response-params"; - # TODO(@sternenseemann): rename env var via stdenv rebuild - shell = (getBin runtimeShell + runtimeShell.shellPath or ""); - gnugrep_bin = optionalString (!nativeTools) gnugrep; - rm = if nativeTools then "rm" else lib.getExe' coreutils "rm"; - mktemp = if nativeTools then "mktemp" else lib.getExe' coreutils "mktemp"; - wrapperName = "BINTOOLS_WRAPPER"; - inherit - dynamicLinker - targetPrefix - suffixSalt - coreutils_bin - ; - inherit - bintools_bin - libc_bin - libc_dev - libc_lib - ; - default_hardening_flags_str = builtins.toString defaultHardeningFlags; - } - // lib.mapAttrs (_: lib.optionalString targetPlatform.isDarwin) { - # These will become empty strings when not targeting Darwin. - inherit (targetPlatform) - darwinPlatform - darwinSdkVersion - darwinMinVersion - darwinMinVersionVariable - ; - } - // lib.optionalAttrs (stdenvNoCC.targetPlatform.isDarwin && apple-sdk != null) { - # Wrapped compilers should do something useful even when no SDK is provided at `DEVELOPER_DIR`. - fallback_sdk = apple-sdk.__spliced.buildTarget or apple-sdk; - }; + env = { + # for substitution in utils.bash + # TODO(@sternenseemann): invent something cleaner than passing in "" in case of absence + expandResponseParams = "${expand-response-params}/bin/expand-response-params"; + # TODO(@sternenseemann): rename env var via stdenv rebuild + shell = (getBin runtimeShell + runtimeShell.shellPath or ""); + gnugrep_bin = optionalString (!nativeTools) gnugrep; + rm = if nativeTools then "rm" else lib.getExe' coreutils "rm"; + mktemp = if nativeTools then "mktemp" else lib.getExe' coreutils "mktemp"; + wrapperName = "BINTOOLS_WRAPPER"; + inherit + dynamicLinker + targetPrefix + suffixSalt + coreutils_bin + ; + inherit + bintools_bin + libc_bin + libc_dev + libc_lib + ; + default_hardening_flags_str = builtins.toString defaultHardeningFlags; + } + // lib.mapAttrs (_: lib.optionalString targetPlatform.isDarwin) { + # These will become empty strings when not targeting Darwin. + inherit (targetPlatform) + darwinPlatform + darwinSdkVersion + darwinMinVersion + darwinMinVersionVariable + ; + } + // lib.optionalAttrs (stdenvNoCC.targetPlatform.isDarwin && apple-sdk != null) { + # Wrapped compilers should do something useful even when no SDK is provided at `DEVELOPER_DIR`. + fallback_sdk = apple-sdk.__spliced.buildTarget or apple-sdk; + }; meta = let diff --git a/pkgs/build-support/build-bazel-package/default.nix b/pkgs/build-support/build-bazel-package/default.nix index f2c68c0984bb..10c6982ada25 100644 --- a/pkgs/build-support/build-bazel-package/default.nix +++ b/pkgs/build-support/build-bazel-package/default.nix @@ -142,19 +142,17 @@ stdenv.mkDerivation ( nativeBuildInputs = fFetchAttrs.nativeBuildInputs or [ ] ++ [ bazel ]; - preHook = - fFetchAttrs.preHook or "" - + '' - export bazelOut="$(echo ''${NIX_BUILD_TOP}/output | sed -e 's,//,/,g')" - export bazelUserRoot="$(echo ''${NIX_BUILD_TOP}/tmp | sed -e 's,//,/,g')" - export HOME="$NIX_BUILD_TOP" - export USER="nix" - # This is needed for git_repository with https remotes - export GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt" - # This is needed for Bazel fetchers that are themselves programs (e.g. - # rules_go using the go toolchain) - export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt" - ''; + preHook = fFetchAttrs.preHook or "" + '' + export bazelOut="$(echo ''${NIX_BUILD_TOP}/output | sed -e 's,//,/,g')" + export bazelUserRoot="$(echo ''${NIX_BUILD_TOP}/tmp | sed -e 's,//,/,g')" + export HOME="$NIX_BUILD_TOP" + export USER="nix" + # This is needed for git_repository with https remotes + export GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt" + # This is needed for Bazel fetchers that are themselves programs (e.g. + # rules_go using the go toolchain) + export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt" + ''; buildPhase = fFetchAttrs.buildPhase or '' @@ -162,22 +160,21 @@ stdenv.mkDerivation ( ${bazelCmd { cmd = if fetchConfigured then "build --nobuild" else "fetch"; - additionalFlags = - [ - # We disable multithreading for the fetching phase since it can lead to timeouts with many dependencies/threads: - # https://github.com/bazelbuild/bazel/issues/6502 - "--loading_phase_threads=1" - "$bazelFetchFlags" - ] - ++ ( - if fetchConfigured then - [ - "--jobs" - "$NIX_BUILD_CORES" - ] - else - [ ] - ); + additionalFlags = [ + # We disable multithreading for the fetching phase since it can lead to timeouts with many dependencies/threads: + # https://github.com/bazelbuild/bazel/issues/6502 + "--loading_phase_threads=1" + "$bazelFetchFlags" + ] + ++ ( + if fetchConfigured then + [ + "--jobs" + "$NIX_BUILD_CORES" + ] + else + [ ] + ); targets = fFetchAttrs.bazelTargets ++ fFetchAttrs.bazelTestTargets; }} @@ -255,35 +252,32 @@ stdenv.mkDerivation ( (bazel.override { enableNixHacks = true; }) ]; - preHook = - fBuildAttrs.preHook or "" - + '' - export bazelOut="$NIX_BUILD_TOP/output" - export bazelUserRoot="$NIX_BUILD_TOP/tmp" - export HOME="$NIX_BUILD_TOP" - ''; + preHook = fBuildAttrs.preHook or "" + '' + export bazelOut="$NIX_BUILD_TOP/output" + export bazelUserRoot="$NIX_BUILD_TOP/tmp" + export HOME="$NIX_BUILD_TOP" + ''; - preConfigure = - '' - mkdir -p "$bazelOut" + preConfigure = '' + mkdir -p "$bazelOut" - (cd $bazelOut && tar xfz $deps) + (cd $bazelOut && tar xfz $deps) - test "${bazel.name}" = "$(<$bazelOut/external/.nix-bazel-version)" || { - echo "fixed output derivation was built for a different bazel version" >&2 - echo " got: $(<$bazelOut/external/.nix-bazel-version)" >&2 - echo "expected: ${bazel.name}" >&2 - exit 1 - } + test "${bazel.name}" = "$(<$bazelOut/external/.nix-bazel-version)" || { + echo "fixed output derivation was built for a different bazel version" >&2 + echo " got: $(<$bazelOut/external/.nix-bazel-version)" >&2 + echo "expected: ${bazel.name}" >&2 + exit 1 + } - chmod -R +w $bazelOut - find $bazelOut -type l | while read symlink; do - if [[ $(readlink "$symlink") == *NIX_BUILD_TOP* ]]; then - ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink" - fi - done - '' - + fBuildAttrs.preConfigure or ""; + chmod -R +w $bazelOut + find $bazelOut -type l | while read symlink; do + if [[ $(readlink "$symlink") == *NIX_BUILD_TOP* ]]; then + ln -sf $(readlink "$symlink" | sed "s,NIX_BUILD_TOP,$NIX_BUILD_TOP,") "$symlink" + fi + done + '' + + fBuildAttrs.preConfigure or ""; buildPhase = fBuildAttrs.buildPhase or '' @@ -316,13 +310,14 @@ stdenv.mkDerivation ( ${bazelCmd { cmd = "test"; - additionalFlags = - [ "--test_output=errors" ] - ++ fBuildAttrs.bazelTestFlags - ++ [ - "--jobs" - "$NIX_BUILD_CORES" - ]; + additionalFlags = [ + "--test_output=errors" + ] + ++ fBuildAttrs.bazelTestFlags + ++ [ + "--jobs" + "$NIX_BUILD_CORES" + ]; targets = fBuildAttrs.bazelTestTargets; }} ${bazelCmd { diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix index ef9735590ad1..b85cd9a04a6c 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix @@ -170,18 +170,17 @@ let paths = let - basePaths = - [ - etcProfile - # ldconfig wrapper must come first so it overrides the original ldconfig - ldconfig - # magic package that just creates a directory, to ensure that - # the entire directory can't be a symlink, as we will write - # compiled schemas to it - ensureGsettingsSchemasIsDirectory - ] - ++ baseTargetPaths - ++ targetPaths; + basePaths = [ + etcProfile + # ldconfig wrapper must come first so it overrides the original ldconfig + ldconfig + # magic package that just creates a directory, to ensure that + # the entire directory can't be a symlink, as we will write + # compiled schemas to it + ensureGsettingsSchemasIsDirectory + ] + ++ baseTargetPaths + ++ targetPaths; in pickOutputs basePaths [ "out" diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix index e23d5040aa09..e69e990d3f29 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix @@ -350,7 +350,8 @@ runCommandLocal name meta = { mainProgram = executableName; - } // meta; + } + // meta; } ) '' diff --git a/pkgs/build-support/build-fhsenv-chroot/env.nix b/pkgs/build-support/build-fhsenv-chroot/env.nix index 7dbbfbf8d508..1f774da847a7 100644 --- a/pkgs/build-support/build-fhsenv-chroot/env.nix +++ b/pkgs/build-support/build-fhsenv-chroot/env.nix @@ -175,7 +175,8 @@ let "out" "lib" "bin" - ] ++ extraOutputsToInstall; + ] + ++ extraOutputsToInstall; ignoreCollisions = true; postBuild = '' if [[ -d $out/share/gsettings-schemas/ ]]; then @@ -214,7 +215,8 @@ let extraOutputsToInstall = [ "out" "lib" - ] ++ extraOutputsToInstall; + ] + ++ extraOutputsToInstall; ignoreCollisions = true; }; diff --git a/pkgs/build-support/build-graalvm-native-image/default.nix b/pkgs/build-support/build-graalvm-native-image/default.nix index fc7bf7741601..35e47713a644 100644 --- a/pkgs/build-support/build-graalvm-native-image/default.nix +++ b/pkgs/build-support/build-graalvm-native-image/default.nix @@ -55,7 +55,8 @@ lib.extendMkDerivation { { env = { LC_ALL = "en_US.UTF-8"; - } // env; + } + // env; inherit dontUnpack strictDeps __structuredAttrs; @@ -98,11 +99,13 @@ lib.extendMkDerivation { passthru = { inherit graalvmDrv; - } // passthru; + } + // passthru; meta = { # default to graalvm's platforms inherit (graalvmDrv.meta) platforms; - } // meta; + } + // meta; }; } diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index ad4adaee5e29..18714dd4440f 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -381,12 +381,13 @@ stdenvNoCC.mkDerivation { preferLocalBuild = true; - outputs = - [ "out" ] - ++ optionals propagateDoc [ - "man" - "info" - ]; + outputs = [ + "out" + ] + ++ optionals propagateDoc [ + "man" + "info" + ]; # Cannot be in "passthru" due to "substituteAll" inherit isArocc; @@ -443,139 +444,140 @@ stdenvNoCC.mkDerivation { wrapper = ./cc-wrapper.sh; - installPhase = - '' - mkdir -p $out/bin $out/nix-support + installPhase = '' + mkdir -p $out/bin $out/nix-support - wrap() { - local dst="$1" - local wrapper="$2" - export prog="$3" - export use_response_file_by_default=${if isClang && !isCcache then "1" else "0"} - substituteAll "$wrapper" "$out/bin/$dst" - chmod +x "$out/bin/$dst" - } - '' + wrap() { + local dst="$1" + local wrapper="$2" + export prog="$3" + export use_response_file_by_default=${if isClang && !isCcache then "1" else "0"} + substituteAll "$wrapper" "$out/bin/$dst" + chmod +x "$out/bin/$dst" + } + '' - + ( - if nativeTools then - '' - echo ${if targetPlatform.isDarwin then cc else nativePrefix} > $out/nix-support/orig-cc + + ( + if nativeTools then + '' + echo ${if targetPlatform.isDarwin then cc else nativePrefix} > $out/nix-support/orig-cc - ccPath="${if targetPlatform.isDarwin then cc else nativePrefix}/bin" - '' - else - '' - echo $cc > $out/nix-support/orig-cc + ccPath="${if targetPlatform.isDarwin then cc else nativePrefix}/bin" + '' + else + '' + echo $cc > $out/nix-support/orig-cc - ccPath="${cc}/bin" - '' - ) + ccPath="${cc}/bin" + '' + ) - # Create symlinks to everything in the bintools wrapper. - + '' - for bbin in $bintools/bin/*; do - mkdir -p "$out/bin" - ln -s "$bbin" "$out/bin/$(basename $bbin)" - done - '' + # Create symlinks to everything in the bintools wrapper. + + '' + for bbin in $bintools/bin/*; do + mkdir -p "$out/bin" + ln -s "$bbin" "$out/bin/$(basename $bbin)" + done + '' - # We export environment variables pointing to the wrapped nonstandard - # cmds, lest some lousy configure script use those to guess compiler - # version. - + '' - export named_cc=${targetPrefix}cc - export named_cxx=${targetPrefix}c++ + # We export environment variables pointing to the wrapped nonstandard + # cmds, lest some lousy configure script use those to guess compiler + # version. + + '' + export named_cc=${targetPrefix}cc + export named_cxx=${targetPrefix}c++ - if [ -e $ccPath/${targetPrefix}gcc ]; then - wrap ${targetPrefix}gcc $wrapper $ccPath/${targetPrefix}gcc - ln -s ${targetPrefix}gcc $out/bin/${targetPrefix}cc - export named_cc=${targetPrefix}gcc - export named_cxx=${targetPrefix}g++ - elif [ -e $ccPath/clang ]; then - wrap ${targetPrefix}clang $wrapper $ccPath/clang - ln -s ${targetPrefix}clang $out/bin/${targetPrefix}cc - export named_cc=${targetPrefix}clang - export named_cxx=${targetPrefix}clang++ - elif [ -e $ccPath/arocc ]; then - wrap ${targetPrefix}arocc $wrapper $ccPath/arocc - ln -s ${targetPrefix}arocc $out/bin/${targetPrefix}cc - export named_cc=${targetPrefix}arocc - fi + if [ -e $ccPath/${targetPrefix}gcc ]; then + wrap ${targetPrefix}gcc $wrapper $ccPath/${targetPrefix}gcc + ln -s ${targetPrefix}gcc $out/bin/${targetPrefix}cc + export named_cc=${targetPrefix}gcc + export named_cxx=${targetPrefix}g++ + elif [ -e $ccPath/clang ]; then + wrap ${targetPrefix}clang $wrapper $ccPath/clang + ln -s ${targetPrefix}clang $out/bin/${targetPrefix}cc + export named_cc=${targetPrefix}clang + export named_cxx=${targetPrefix}clang++ + elif [ -e $ccPath/arocc ]; then + wrap ${targetPrefix}arocc $wrapper $ccPath/arocc + ln -s ${targetPrefix}arocc $out/bin/${targetPrefix}cc + export named_cc=${targetPrefix}arocc + fi - if [ -e $ccPath/${targetPrefix}g++ ]; then - wrap ${targetPrefix}g++ $wrapper $ccPath/${targetPrefix}g++ - ln -s ${targetPrefix}g++ $out/bin/${targetPrefix}c++ - elif [ -e $ccPath/clang++ ]; then - wrap ${targetPrefix}clang++ $wrapper $ccPath/clang++ - ln -s ${targetPrefix}clang++ $out/bin/${targetPrefix}c++ - fi + if [ -e $ccPath/${targetPrefix}g++ ]; then + wrap ${targetPrefix}g++ $wrapper $ccPath/${targetPrefix}g++ + ln -s ${targetPrefix}g++ $out/bin/${targetPrefix}c++ + elif [ -e $ccPath/clang++ ]; then + wrap ${targetPrefix}clang++ $wrapper $ccPath/clang++ + ln -s ${targetPrefix}clang++ $out/bin/${targetPrefix}c++ + fi - if [ -e $ccPath/${targetPrefix}cpp ]; then - wrap ${targetPrefix}cpp $wrapper $ccPath/${targetPrefix}cpp - elif [ -e $ccPath/cpp ]; then - wrap ${targetPrefix}cpp $wrapper $ccPath/cpp - fi - '' + if [ -e $ccPath/${targetPrefix}cpp ]; then + wrap ${targetPrefix}cpp $wrapper $ccPath/${targetPrefix}cpp + elif [ -e $ccPath/cpp ]; then + wrap ${targetPrefix}cpp $wrapper $ccPath/cpp + fi + '' - # No need to wrap gnat, gnatkr, gnatname or gnatprep; we can just symlink them in - + optionalString cc.langAda or false '' - for cmd in gnatbind gnatchop gnatclean gnatlink gnatls gnatmake; do - wrap ${targetPrefix}$cmd ${./gnat-wrapper.sh} $ccPath/${targetPrefix}$cmd - done + # No need to wrap gnat, gnatkr, gnatname or gnatprep; we can just symlink them in + + optionalString cc.langAda or false '' + for cmd in gnatbind gnatchop gnatclean gnatlink gnatls gnatmake; do + wrap ${targetPrefix}$cmd ${./gnat-wrapper.sh} $ccPath/${targetPrefix}$cmd + done - for cmd in gnat gnatkr gnatname gnatprep; do - ln -s $ccPath/${targetPrefix}$cmd $out/bin/${targetPrefix}$cmd - done + for cmd in gnat gnatkr gnatname gnatprep; do + ln -s $ccPath/${targetPrefix}$cmd $out/bin/${targetPrefix}$cmd + done - # this symlink points to the unwrapped gnat's output "out". It is used by - # our custom gprconfig compiler description to find GNAT's ada runtime. See - # ../../development/ada-modules/gprbuild/{boot.nix, nixpkgs-gnat.xml} - ln -sf ${cc} $out/nix-support/gprconfig-gnat-unwrapped - '' + # this symlink points to the unwrapped gnat's output "out". It is used by + # our custom gprconfig compiler description to find GNAT's ada runtime. See + # ../../development/ada-modules/gprbuild/{boot.nix, nixpkgs-gnat.xml} + ln -sf ${cc} $out/nix-support/gprconfig-gnat-unwrapped + '' - + optionalString cc.langD or false '' - wrap ${targetPrefix}gdc $wrapper $ccPath/${targetPrefix}gdc - '' + + optionalString cc.langD or false '' + wrap ${targetPrefix}gdc $wrapper $ccPath/${targetPrefix}gdc + '' - + optionalString cc.langFortran or false '' - wrap ${targetPrefix}gfortran $wrapper $ccPath/${targetPrefix}gfortran - ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}g77 - ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}f77 - export named_fc=${targetPrefix}gfortran - '' + + optionalString cc.langFortran or false '' + wrap ${targetPrefix}gfortran $wrapper $ccPath/${targetPrefix}gfortran + ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}g77 + ln -sv ${targetPrefix}gfortran $out/bin/${targetPrefix}f77 + export named_fc=${targetPrefix}gfortran + '' - + optionalString cc.langJava or false '' - wrap ${targetPrefix}gcj $wrapper $ccPath/${targetPrefix}gcj - '' + + optionalString cc.langJava or false '' + wrap ${targetPrefix}gcj $wrapper $ccPath/${targetPrefix}gcj + '' - + optionalString cc.langGo or false '' - wrap ${targetPrefix}gccgo $wrapper $ccPath/${targetPrefix}gccgo - wrap ${targetPrefix}go ${./go-wrapper.sh} $ccPath/${targetPrefix}go - ''; + + optionalString cc.langGo or false '' + wrap ${targetPrefix}gccgo $wrapper $ccPath/${targetPrefix}gccgo + wrap ${targetPrefix}go ${./go-wrapper.sh} $ccPath/${targetPrefix}go + ''; strictDeps = true; - propagatedBuildInputs = - [ bintools ] ++ extraTools ++ optionals cc.langD or cc.langJava or false [ zlib ]; + propagatedBuildInputs = [ + bintools + ] + ++ extraTools + ++ optionals cc.langD or cc.langJava or false [ zlib ]; depsTargetTargetPropagated = optional (libcxx != null) libcxx ++ extraPackages; - setupHooks = - [ - ../setup-hooks/role.bash - ] - ++ optional (cc.langC or true) ./setup-hook.sh - ++ optional (cc.langFortran or false) ./fortran-hook.sh - ++ optional (targetPlatform.isWindows) ( - stdenvNoCC.mkDerivation { - name = "win-dll-hook.sh"; - dontUnpack = true; - installPhase = '' - echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib" > $out - echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib64" >> $out - echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib32" >> $out - ''; - } - ); + setupHooks = [ + ../setup-hooks/role.bash + ] + ++ optional (cc.langC or true) ./setup-hook.sh + ++ optional (cc.langFortran or false) ./fortran-hook.sh + ++ optional (targetPlatform.isWindows) ( + stdenvNoCC.mkDerivation { + name = "win-dll-hook.sh"; + dontUnpack = true; + installPhase = '' + echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib" > $out + echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib64" >> $out + echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_solib}/lib32" >> $out + ''; + } + ); postFixup = # Ensure flags files exists, as some other programs cat them. (That these @@ -910,37 +912,36 @@ stdenvNoCC.mkDerivation { mapAttrsToList (name: value: "echo ${toString value} >> $out/nix-support/${name}") nixSupport ); - env = - { - inherit isClang; + env = { + inherit isClang; - # for substitution in utils.bash - # TODO(@sternenseemann): invent something cleaner than passing in "" in case of absence - expandResponseParams = lib.optionalString (expand-response-params != "") ( - lib.getExe expand-response-params - ); - # TODO(@sternenseemann): rename env var via stdenv rebuild - shell = getBin runtimeShell + runtimeShell.shellPath or ""; - gnugrep_bin = optionalString (!nativeTools) gnugrep; - rm = if nativeTools then "rm" else lib.getExe' coreutils "rm"; - mktemp = if nativeTools then "mktemp" else lib.getExe' coreutils "mktemp"; - # stdenv.cc.cc should not be null and we have nothing better for now. - # if the native impure bootstrap is gotten rid of this can become `inherit cc;` again. - cc = optionalString (!nativeTools) cc; - wrapperName = "CC_WRAPPER"; - inherit suffixSalt coreutils_bin bintools; - inherit libc_bin libc_dev libc_lib; - inherit darwinPlatformForCC; - default_hardening_flags_str = builtins.toString defaultHardeningFlags; - } - // lib.mapAttrs (_: lib.optionalString targetPlatform.isDarwin) { - # These will become empty strings when not targeting Darwin. - inherit (targetPlatform) darwinMinVersion darwinMinVersionVariable; - } - // lib.optionalAttrs (stdenvNoCC.targetPlatform.isDarwin && apple-sdk != null) { - # Wrapped compilers should do something useful even when no SDK is provided at `DEVELOPER_DIR`. - fallback_sdk = apple-sdk.__spliced.buildTarget or apple-sdk; - }; + # for substitution in utils.bash + # TODO(@sternenseemann): invent something cleaner than passing in "" in case of absence + expandResponseParams = lib.optionalString (expand-response-params != "") ( + lib.getExe expand-response-params + ); + # TODO(@sternenseemann): rename env var via stdenv rebuild + shell = getBin runtimeShell + runtimeShell.shellPath or ""; + gnugrep_bin = optionalString (!nativeTools) gnugrep; + rm = if nativeTools then "rm" else lib.getExe' coreutils "rm"; + mktemp = if nativeTools then "mktemp" else lib.getExe' coreutils "mktemp"; + # stdenv.cc.cc should not be null and we have nothing better for now. + # if the native impure bootstrap is gotten rid of this can become `inherit cc;` again. + cc = optionalString (!nativeTools) cc; + wrapperName = "CC_WRAPPER"; + inherit suffixSalt coreutils_bin bintools; + inherit libc_bin libc_dev libc_lib; + inherit darwinPlatformForCC; + default_hardening_flags_str = builtins.toString defaultHardeningFlags; + } + // lib.mapAttrs (_: lib.optionalString targetPlatform.isDarwin) { + # These will become empty strings when not targeting Darwin. + inherit (targetPlatform) darwinMinVersion darwinMinVersionVariable; + } + // lib.optionalAttrs (stdenvNoCC.targetPlatform.isDarwin && apple-sdk != null) { + # Wrapped compilers should do something useful even when no SDK is provided at `DEVELOPER_DIR`. + fallback_sdk = apple-sdk.__spliced.buildTarget or apple-sdk; + }; meta = let diff --git a/pkgs/build-support/checkpoint-build.nix b/pkgs/build-support/checkpoint-build.nix index 6a28e7556d67..5071ad4ac5b7 100644 --- a/pkgs/build-support/checkpoint-build.nix +++ b/pkgs/build-support/checkpoint-build.nix @@ -28,21 +28,19 @@ let # We compare the changed sources from a previous build with the current and create a patch. # Afterwards we clean the build directory and copy the previous output files (including the sources). # The source difference patch is then applied to get the latest changes again to allow short build times. - preBuild = - (old.preBuild or "") - + '' - set +e - sourceDifferencePatchFile=$(${mktemp}/bin/mktemp) - diff -ur ${checkpointArtifacts}/sources ./ > "$sourceDifferencePatchFile" - set -e - shopt -s dotglob - rm -r * - ${rsync}/bin/rsync \ - --checksum --times --atimes --chown=$USER:$USER --chmod=+w \ - -r ${checkpointArtifacts}/outputs/ . - patch -p 1 -i "$sourceDifferencePatchFile" - rm "$sourceDifferencePatchFile" - ''; + preBuild = (old.preBuild or "") + '' + set +e + sourceDifferencePatchFile=$(${mktemp}/bin/mktemp) + diff -ur ${checkpointArtifacts}/sources ./ > "$sourceDifferencePatchFile" + set -e + shopt -s dotglob + rm -r * + ${rsync}/bin/rsync \ + --checksum --times --atimes --chown=$USER:$USER --chmod=+w \ + -r ${checkpointArtifacts}/outputs/ . + patch -p 1 -i "$sourceDifferencePatchFile" + rm "$sourceDifferencePatchFile" + ''; }); in @@ -77,12 +75,10 @@ rec { # directory before build, but after patch phases. # This way, the same derivation can be used multiple times and only changes are detected. # Additionally, removed files are handled correctly in later builds. - preBuild = - (old.preBuild or "") - + '' - mkdir -p $out/sources - cp -r ./* $out/sources/ - ''; + preBuild = (old.preBuild or "") + '' + mkdir -p $out/sources + cp -r ./* $out/sources/ + ''; # After the build, the build directory is copied again # to get the output files. diff --git a/pkgs/build-support/dart/build-dart-application/default.nix b/pkgs/build-support/dart/build-dart-application/default.nix index 5ff4d0a3ef23..5b1526b5977e 100644 --- a/pkgs/build-support/dart/build-dart-application/default.nix +++ b/pkgs/build-support/dart/build-dart-application/default.nix @@ -98,7 +98,8 @@ let exit 1 fi ''; - } // sdkSourceBuilders; + } + // sdkSourceBuilders; }; packageConfig = generators.linkPackageConfig { inherit pubspecLock; @@ -150,7 +151,8 @@ let outputs = [ "out" "pubcache" - ] ++ args.outputs or [ ]; + ] + ++ args.outputs or [ ]; dartEntryPoints = if (dartEntryPoints != null) then @@ -178,11 +180,9 @@ let # Ensure that we inherit the propagated build inputs from the dependencies. builtins.attrValues pubspecLockData.dependencySources; - preConfigure = - args.preConfigure or "" - + '' - ln -sf "$pubspecLockFilePath" pubspec.lock - ''; + preConfigure = args.preConfigure or "" + '' + ln -sf "$pubspecLockFilePath" pubspec.lock + ''; # When stripping, it seems some ELF information is lost and the dart VM cli # runs instead of the expected program. Don't strip if it's an exe output. @@ -192,7 +192,8 @@ let passthru = { pubspecLock = pubspecLockData; - } // (args.passthru or { }); + } + // (args.passthru or { }); meta = (args.meta or { }) // { platforms = args.meta.platforms or dart.meta.platforms; diff --git a/pkgs/build-support/dlang/builddubpackage/default.nix b/pkgs/build-support/dlang/builddubpackage/default.nix index 31454d5cd69b..2a32b4d17fc3 100644 --- a/pkgs/build-support/dlang/builddubpackage/default.nix +++ b/pkgs/build-support/dlang/builddubpackage/default.nix @@ -142,6 +142,7 @@ stdenv.mkDerivation ( meta = { platforms = dub.meta.platforms; - } // args.meta or { }; + } + // args.meta or { }; } ) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 09096dfc78a2..14b952424ca0 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -719,7 +719,8 @@ rec { jshon jq moreutils - ] ++ compress.nativeInputs; + ] + ++ compress.nativeInputs; # Image name must be lowercase imageName = lib.toLower name; imageTag = lib.optionalString (tag != null) tag; @@ -893,14 +894,13 @@ rec { runCommand "merge-docker-images" { inherit images; - nativeBuildInputs = - [ - file - jq - ] - ++ compressors.none.nativeInputs - ++ compressors.gz.nativeInputs - ++ compressors.zstd.nativeInputs; + nativeBuildInputs = [ + file + jq + ] + ++ compressors.none.nativeInputs + ++ compressors.gz.nativeInputs + ++ compressors.zstd.nativeInputs; } '' mkdir image inputs @@ -1061,13 +1061,12 @@ rec { paths = contentsList; extraCommands = (lib.optionalString includeNixDB (mkDbExtraCommand contents)) + extraCommands; inherit fakeRootCommands; - nativeBuildInputs = - [ - fakeroot - ] - ++ optionals enableFakechroot [ - proot - ]; + nativeBuildInputs = [ + fakeroot + ] + ++ optionals enableFakechroot [ + proot + ]; postBuild = '' mv $out old_out (cd old_out; eval "$extraCommands" ) @@ -1296,51 +1295,50 @@ rec { }; # Environment variables set in the image - envVars = - { + envVars = { - # Root certificates for internet access - SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + # Root certificates for internet access + SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1027-L1030 - # PATH = "/path-not-set"; - # Allows calling bash and `buildDerivation` as the Cmd - PATH = staticPath; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1027-L1030 + # PATH = "/path-not-set"; + # Allows calling bash and `buildDerivation` as the Cmd + PATH = staticPath; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1032-L1038 - HOME = homeDirectory; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1032-L1038 + HOME = homeDirectory; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1040-L1044 - NIX_STORE = storeDir; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1040-L1044 + NIX_STORE = storeDir; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1046-L1047 - # TODO: Make configurable? - NIX_BUILD_CORES = "1"; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1046-L1047 + # TODO: Make configurable? + NIX_BUILD_CORES = "1"; - } - // drvEnv - // { + } + // drvEnv + // { - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1008-L1010 - NIX_BUILD_TOP = sandboxBuildDir; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1008-L1010 + NIX_BUILD_TOP = sandboxBuildDir; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1012-L1013 - TMPDIR = sandboxBuildDir; - TEMPDIR = sandboxBuildDir; - TMP = sandboxBuildDir; - TEMP = sandboxBuildDir; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1012-L1013 + TMPDIR = sandboxBuildDir; + TEMPDIR = sandboxBuildDir; + TMP = sandboxBuildDir; + TEMP = sandboxBuildDir; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1015-L1019 - PWD = sandboxBuildDir; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1015-L1019 + PWD = sandboxBuildDir; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1071-L1074 - # We don't set it here because the output here isn't handled in any special way - # NIX_LOG_FD = "2"; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1071-L1074 + # We don't set it here because the output here isn't handled in any special way + # NIX_LOG_FD = "2"; - # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1076-L1077 - TERM = "xterm-256color"; - }; + # https://github.com/NixOS/nix/blob/2.8.0/src/libstore/build/local-derivation-goal.cc#L1076-L1077 + TERM = "xterm-256color"; + }; in streamLayeredImage { diff --git a/pkgs/build-support/docker/examples.nix b/pkgs/build-support/docker/examples.nix index 5edc1db78ee8..aa522350a3f2 100644 --- a/pkgs/build-support/docker/examples.nix +++ b/pkgs/build-support/docker/examples.nix @@ -619,15 +619,14 @@ rec { pkgs.dockerTools.buildLayeredImage { name = "bash-layered-with-user"; tag = "latest"; - contents = - [ - pkgs.bash - pkgs.coreutils - ] - ++ nonRootShadowSetup { - uid = 999; - user = "somebody"; - }; + contents = [ + pkgs.bash + pkgs.coreutils + ] + ++ nonRootShadowSetup { + uid = 999; + user = "somebody"; + }; }; # basic example, with cross compilation diff --git a/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix b/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix index 82137b30e24c..686c16f4a70d 100644 --- a/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-global-tool/default.nix @@ -72,7 +72,8 @@ buildDotnetModule ( passthru = { updateScript = ./update.sh; nupkg = nupkg; - } // args.passthru or { }; + } + // args.passthru or { }; } ) (if lib.isFunction fnOrAttrs then fnOrAttrs finalAttrs else fnOrAttrs) diff --git a/pkgs/build-support/dotnet/build-dotnet-package/default.nix b/pkgs/build-support/dotnet/build-dotnet-package/default.nix index 64bf19addb27..582084095e3d 100644 --- a/pkgs/build-support/dotnet/build-dotnet-package/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-package/default.nix @@ -32,7 +32,8 @@ let makeWrapper dotnetbuildhelpers mono - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; configurePhase = '' runHook preConfigure diff --git a/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix b/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix index 923f8b4e917d..b33910cc9c1f 100644 --- a/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix +++ b/pkgs/build-support/dotnet/fetch-nupkg/overrides.nix @@ -72,16 +72,14 @@ buildInputs = old.buildInputs or [ ] ++ [ fontconfig ]; - preInstall = - old.preInstall or "" - + '' - cd runtimes - for platform in *; do - [[ $platform == "${dotnetCorePackages.systemToDotnetRid stdenv.hostPlatform.system}" ]] || - rm -r "$platform" - done - cd - >/dev/null - ''; + preInstall = old.preInstall or "" + '' + cd runtimes + for platform in *; do + [[ $platform == "${dotnetCorePackages.systemToDotnetRid stdenv.hostPlatform.system}" ]] || + rm -r "$platform" + done + cd - >/dev/null + ''; } ); } diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 374d55b0456c..55b90ec32547 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -109,13 +109,12 @@ lib.makeOverridable ( builder = ./builder.sh; fetcher = ./nix-prefetch-git; - nativeBuildInputs = - [ - git - cacert - ] - ++ lib.optionals fetchLFS [ git-lfs ] - ++ nativeBuildInputs; + nativeBuildInputs = [ + git + cacert + ] + ++ lib.optionals fetchLFS [ git-lfs ] + ++ nativeBuildInputs; inherit outputHash outputHashAlgo; outputHashMode = "recursive"; diff --git a/pkgs/build-support/fetchnextcloudapp/default.nix b/pkgs/build-support/fetchnextcloudapp/default.nix index 31f35c0568d3..193b2b82a354 100644 --- a/pkgs/build-support/fetchnextcloudapp/default.nix +++ b/pkgs/build-support/fetchnextcloudapp/default.nix @@ -24,18 +24,17 @@ applyPatches ( inherit patches; src = (if unpack then fetchzip else fetchurl) { inherit url hash sha256; - meta = - { - license = lib.licenses.${license}; - longDescription = description; - inherit homepage maintainers teams; - } - // lib.optionalAttrs (description != null) { - longDescription = description; - } - // lib.optionalAttrs (homepage != null) { - inherit homepage; - }; + meta = { + license = lib.licenses.${license}; + longDescription = description; + inherit homepage maintainers teams; + } + // lib.optionalAttrs (description != null) { + longDescription = description; + } + // lib.optionalAttrs (homepage != null) { + inherit homepage; + }; }; prePatch = '' if [ ! -f ./appinfo/info.xml ]; then diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix index fa06d8631be4..428001bba7ad 100644 --- a/pkgs/build-support/fetchpatch/default.nix +++ b/pkgs/build-support/fetchpatch/default.nix @@ -43,69 +43,68 @@ lib.throwIfNot (excludes == [ ] || includes == [ ]) ( { nativeBuildInputs = [ patchutils ] ++ nativeBuildInputs; - postFetch = - '' - tmpfile="$TMPDIR/patch" + postFetch = '' + tmpfile="$TMPDIR/patch" - if [ ! -s "$out" ]; then - echo "error: Fetched patch file '$out' is empty!" 1>&2 + if [ ! -s "$out" ]; then + echo "error: Fetched patch file '$out' is empty!" 1>&2 + exit 1 + fi + + set +e + ${decode} < "$out" > "$tmpfile" + if [ $? -ne 0 ] || [ ! -s "$tmpfile" ]; then + echo 'Failed to decode patch with command "'${lib.escapeShellArg decode}'"' >&2 + echo 'Fetched file was (limited to 128 bytes):' >&2 + od -A x -t x1z -v -N 128 "$out" >&2 exit 1 - fi - - set +e - ${decode} < "$out" > "$tmpfile" - if [ $? -ne 0 ] || [ ! -s "$tmpfile" ]; then - echo 'Failed to decode patch with command "'${lib.escapeShellArg decode}'"' >&2 - echo 'Fetched file was (limited to 128 bytes):' >&2 - od -A x -t x1z -v -N 128 "$out" >&2 - exit 1 - fi - set -e - mv "$tmpfile" "$out" - - lsdiff \ - ${lib.optionalString (relative != null) "-p1 -i ${lib.escapeShellArg relative}/'*'"} \ - "$out" \ - | sort -u | sed -e 's/[*?]/\\&/g' \ - | xargs -I{} --delimiter='\n' \ - filterdiff \ - --include={} \ - --strip=${toString stripLen} \ - ${ - lib.optionalString (extraPrefix != null) '' - --addoldprefix=a/${lib.escapeShellArg extraPrefix} \ - --addnewprefix=b/${lib.escapeShellArg extraPrefix} \ - '' - } \ - --clean "$out" > "$tmpfile" - - if [ ! -s "$tmpfile" ]; then - echo "error: Normalized patch '$tmpfile' is empty (while the fetched file was not)!" 1>&2 - echo "Did you maybe fetch a HTML representation of a patch instead of a raw patch?" 1>&2 - echo "Fetched file was:" 1>&2 - cat "$out" 1>&2 - exit 1 - fi + fi + set -e + mv "$tmpfile" "$out" + lsdiff \ + ${lib.optionalString (relative != null) "-p1 -i ${lib.escapeShellArg relative}/'*'"} \ + "$out" \ + | sort -u | sed -e 's/[*?]/\\&/g' \ + | xargs -I{} --delimiter='\n' \ filterdiff \ - -p1 \ - ${builtins.toString (builtins.map (x: "-x ${lib.escapeShellArg x}") excludes)} \ - ${builtins.toString (builtins.map (x: "-i ${lib.escapeShellArg x}") includes)} \ - "$tmpfile" > "$out" + --include={} \ + --strip=${toString stripLen} \ + ${ + lib.optionalString (extraPrefix != null) '' + --addoldprefix=a/${lib.escapeShellArg extraPrefix} \ + --addnewprefix=b/${lib.escapeShellArg extraPrefix} \ + '' + } \ + --clean "$out" > "$tmpfile" - if [ ! -s "$out" ]; then - echo "error: Filtered patch '$out' is empty (while the original patch file was not)!" 1>&2 - echo "Check your includes and excludes." 1>&2 - echo "Normalized patch file was:" 1>&2 - cat "$tmpfile" 1>&2 - exit 1 - fi - '' - + lib.optionalString revert '' - interdiff "$out" /dev/null > "$tmpfile" - mv "$tmpfile" "$out" - '' - + postFetch; + if [ ! -s "$tmpfile" ]; then + echo "error: Normalized patch '$tmpfile' is empty (while the fetched file was not)!" 1>&2 + echo "Did you maybe fetch a HTML representation of a patch instead of a raw patch?" 1>&2 + echo "Fetched file was:" 1>&2 + cat "$out" 1>&2 + exit 1 + fi + + filterdiff \ + -p1 \ + ${builtins.toString (builtins.map (x: "-x ${lib.escapeShellArg x}") excludes)} \ + ${builtins.toString (builtins.map (x: "-i ${lib.escapeShellArg x}") includes)} \ + "$tmpfile" > "$out" + + if [ ! -s "$out" ]; then + echo "error: Filtered patch '$out' is empty (while the original patch file was not)!" 1>&2 + echo "Check your includes and excludes." 1>&2 + echo "Normalized patch file was:" 1>&2 + cat "$tmpfile" 1>&2 + exit 1 + fi + '' + + lib.optionalString revert '' + interdiff "$out" /dev/null > "$tmpfile" + mv "$tmpfile" "$out" + '' + + postFetch; } // builtins.removeAttrs args [ "relative" diff --git a/pkgs/build-support/fetchrepoproject/default.nix b/pkgs/build-support/fetchrepoproject/default.nix index fb9ac8588464..5f10c7eebf45 100644 --- a/pkgs/build-support/fetchrepoproject/default.nix +++ b/pkgs/build-support/fetchrepoproject/default.nix @@ -46,7 +46,8 @@ lib.fetchers.withNormalizedHash { } ( "--depth=1" (optionalString createMirror "--mirror") (optionalString useArchive "--archive") - ] ++ extraRepoInitFlags; + ] + ++ extraRepoInitFlags; local_manifests = copyPathsToStore localManifests; diff --git a/pkgs/build-support/fetchsourcehut/default.nix b/pkgs/build-support/fetchsourcehut/default.nix index fb36805733b8..bf1b2a58b4d7 100644 --- a/pkgs/build-support/fetchsourcehut/default.nix +++ b/pkgs/build-support/fetchsourcehut/default.nix @@ -36,19 +36,18 @@ makeOverridable ( let urlFor = resource: "https://${resource}.${domain}/${owner}/${repo}"; baseUrl = urlFor vc; - baseArgs = - { - inherit name; - } - // removeAttrs args [ - "owner" - "repo" - "rev" - "domain" - "vc" - "name" - "fetchSubmodules" - ]; + baseArgs = { + inherit name; + } + // removeAttrs args [ + "owner" + "repo" + "rev" + "domain" + "vc" + "name" + "fetchSubmodules" + ]; vcArgs = baseArgs // { inherit rev; url = baseUrl; diff --git a/pkgs/build-support/fetchsvn/default.nix b/pkgs/build-support/fetchsvn/default.nix index 156c360986f3..6f07626f69c1 100644 --- a/pkgs/build-support/fetchsvn/default.nix +++ b/pkgs/build-support/fetchsvn/default.nix @@ -63,7 +63,8 @@ else cacert subversion glibcLocales - ] ++ lib.optional sshSupport openssh; + ] + ++ lib.optional sshSupport openssh; SVN_SSH = if sshSupport then "${buildPackages.openssh}/bin/ssh" else null; diff --git a/pkgs/build-support/fetchtorrent/default.nix b/pkgs/build-support/fetchtorrent/default.nix index 6e154a076500..91bd35012319 100644 --- a/pkgs/build-support/fetchtorrent/default.nix +++ b/pkgs/build-support/fetchtorrent/default.nix @@ -47,16 +47,17 @@ in runCommand name { inherit meta; - nativeBuildInputs = - [ cacert ] - ++ ( - if (backend == "transmission") then - [ transmission_3_noSystemd ] - else if (backend == "rqbit") then - [ rqbit ] - else - throw "rqbit or transmission are the only available backends for fetchtorrent" - ); + nativeBuildInputs = [ + cacert + ] + ++ ( + if (backend == "transmission") then + [ transmission_3_noSystemd ] + else if (backend == "rqbit") then + [ rqbit ] + else + throw "rqbit or transmission are the only available backends for fetchtorrent" + ); outputHashAlgo = if hash != "" then null else "sha256"; outputHash = hash; outputHashMode = if recursiveHash then "recursive" else "flat"; diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index f948b9ee88aa..65831e73a0b8 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -280,6 +280,7 @@ stdenvNoCC.mkDerivation ( inherit meta; passthru = { inherit url; - } // passthru; + } + // passthru; } ) diff --git a/pkgs/build-support/fetchzip/default.nix b/pkgs/build-support/fetchzip/default.nix index 50be0c38f1e5..7e1452ae54a2 100644 --- a/pkgs/build-support/fetchzip/default.nix +++ b/pkgs/build-support/fetchzip/default.nix @@ -62,41 +62,40 @@ fetchurl ( ] ++ nativeBuildInputs; - postFetch = - '' - unpackDir="$TMPDIR/unpack" - mkdir "$unpackDir" - cd "$unpackDir" + postFetch = '' + unpackDir="$TMPDIR/unpack" + mkdir "$unpackDir" + cd "$unpackDir" - renamed="$TMPDIR/${tmpFilename}" - mv "$downloadedFile" "$renamed" - unpackFile "$renamed" - chmod -R +w "$unpackDir" - '' - + ( - if stripRoot then - '' - if [ $(ls -A "$unpackDir" | wc -l) != 1 ]; then - echo "error: zip file must contain a single file or directory." - echo "hint: Pass stripRoot=false; to fetchzip to assume flat list of files." - exit 1 - fi - fn=$(cd "$unpackDir" && ls -A) - if [ -f "$unpackDir/$fn" ]; then - mkdir $out - fi - mv "$unpackDir/$fn" "$out" - '' - else - '' - mv "$unpackDir" "$out" - '' - ) - + '' - ${postFetch} - ${extraPostFetch} - chmod 755 "$out" - ''; + renamed="$TMPDIR/${tmpFilename}" + mv "$downloadedFile" "$renamed" + unpackFile "$renamed" + chmod -R +w "$unpackDir" + '' + + ( + if stripRoot then + '' + if [ $(ls -A "$unpackDir" | wc -l) != 1 ]; then + echo "error: zip file must contain a single file or directory." + echo "hint: Pass stripRoot=false; to fetchzip to assume flat list of files." + exit 1 + fi + fn=$(cd "$unpackDir" && ls -A) + if [ -f "$unpackDir/$fn" ]; then + mkdir $out + fi + mv "$unpackDir/$fn" "$out" + '' + else + '' + mv "$unpackDir" "$out" + '' + ) + + '' + ${postFetch} + ${extraPostFetch} + chmod 755 "$out" + ''; # ^ Remove non-owner write permissions # Fixes https://github.com/NixOS/nixpkgs/issues/38649 } diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index 9b692b4f6dec..5c9b7a84f8a3 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -394,11 +394,13 @@ lib.extendMkDerivation { # `passthru.overrideModAttrs` will be overridden # when users want to override `goModules`. overrideModAttrs = lib.toExtension overrideModAttrs; - } // passthru; + } + // passthru; meta = { # Add default meta information. platforms = go.meta.platforms or lib.platforms.all; - } // meta; + } + // meta; }; } diff --git a/pkgs/build-support/kernel/compress-firmware.nix b/pkgs/build-support/kernel/compress-firmware.nix index 16d209aed26e..5eadcc9df589 100644 --- a/pkgs/build-support/kernel/compress-firmware.nix +++ b/pkgs/build-support/kernel/compress-firmware.nix @@ -26,7 +26,8 @@ let args = { allowedRequisites = [ ]; inherit (compressor) nativeBuildInputs; - } // lib.optionalAttrs (firmware ? meta) { inherit (firmware) meta; }; + } + // lib.optionalAttrs (firmware ? meta) { inherit (firmware) meta; }; in runCommand "${firmware.name}-${type}" args '' diff --git a/pkgs/build-support/kernel/make-initrd-ng.nix b/pkgs/build-support/kernel/make-initrd-ng.nix index da2941cdd6f2..b5cfc55c695e 100644 --- a/pkgs/build-support/kernel/make-initrd-ng.nix +++ b/pkgs/build-support/kernel/make-initrd-ng.nix @@ -96,7 +96,8 @@ runCommand name nativeBuildInputs = [ makeInitrdNGTool cpio - ] ++ lib.optional makeUInitrd ubootTools; + ] + ++ lib.optional makeUInitrd ubootTools; }) '' mkdir -p ./root/var/empty diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix index 946db43afdee..4b31bf225a48 100644 --- a/pkgs/build-support/kernel/make-initrd.nix +++ b/pkgs/build-support/kernel/make-initrd.nix @@ -101,7 +101,8 @@ stdenvNoCC.mkDerivation ( nativeBuildInputs = [ cpio - ] ++ lib.optional makeUInitrd ubootTools; + ] + ++ lib.optional makeUInitrd ubootTools; compress = "${_compressorExecutable} ${lib.escapeShellArgs _compressorArgsReal}"; diff --git a/pkgs/build-support/make-desktopitem/default.nix b/pkgs/build-support/make-desktopitem/default.nix index bfbab0ca51a5..15321131ca64 100644 --- a/pkgs/build-support/make-desktopitem/default.nix +++ b/pkgs/build-support/make-desktopitem/default.nix @@ -156,7 +156,8 @@ lib.makeOverridable ( "URL" = url; "PrefersNonDefaultGPU" = boolOrNullToString prefersNonDefaultGPU; # "SingleMainWindow" = boolOrNullToString singleMainWindow; - } // extraConfig; + } + // extraConfig; # Render a single attribute pair to a Key=Value line. # FIXME: this isn't entirely correct for arbitrary strings, as some characters diff --git a/pkgs/build-support/node/build-npm-package/default.nix b/pkgs/build-support/node/build-npm-package/default.nix index 69181aee399c..3383f14ba5f7 100644 --- a/pkgs/build-support/node/build-npm-package/default.nix +++ b/pkgs/build-support/node/build-npm-package/default.nix @@ -111,7 +111,8 @@ lib.extendMkDerivation { } .${stdenv.hostPlatform.parsed.cpu.name} or stdenv.hostPlatform.parsed.cpu.name; npm_config_platform = stdenv.hostPlatform.parsed.kernel.name; - } // (args.env or { }); + } + // (args.env or { }); meta = (args.meta or { }) // { platforms = args.meta.platforms or nodejs.meta.platforms; diff --git a/pkgs/build-support/node/import-npm-lock/default.nix b/pkgs/build-support/node/import-npm-lock/default.nix index 8b8281778bc7..cfea6ef4e1b5 100644 --- a/pkgs/build-support/node/import-npm-lock/default.nix +++ b/pkgs/build-support/node/import-npm-lock/default.nix @@ -205,26 +205,25 @@ lib.fix (self: { } // derivationArgs // { - nativeBuildInputs = - [ - nodejs - nodejs.passthru.python - hooks.npmConfigHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ] - ++ derivationArgs.nativeBuildInputs or [ ]; + nativeBuildInputs = [ + nodejs + nodejs.passthru.python + hooks.npmConfigHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ] + ++ derivationArgs.nativeBuildInputs or [ ]; passAsFile = [ "package" "packageLock" - ] ++ derivationArgs.passAsFile or [ ]; + ] + ++ derivationArgs.passAsFile or [ ]; - postPatch = - '' - cp --no-preserve=mode "$packagePath" package.json - cp --no-preserve=mode "$packageLockPath" package-lock.json - '' - + derivationArgs.postPatch or ""; + postPatch = '' + cp --no-preserve=mode "$packagePath" package.json + cp --no-preserve=mode "$packageLockPath" package-lock.json + '' + + derivationArgs.postPatch or ""; } ); diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index 1d77d1c1e9b6..cc550775dd3e 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -78,7 +78,8 @@ else ocaml Dune findlib - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; meta = (args.meta or { }) // { platforms = args.meta.platforms or ocaml.meta.platforms; diff --git a/pkgs/build-support/ocaml/oasis.nix b/pkgs/build-support/ocaml/oasis.nix index f4319fcd99ce..269a433caad4 100644 --- a/pkgs/build-support/ocaml/oasis.nix +++ b/pkgs/build-support/ocaml/oasis.nix @@ -34,7 +34,8 @@ else findlib ocamlbuild ocaml_oasis - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; inherit createFindlibDestdir; inherit dontStrip; diff --git a/pkgs/build-support/ocaml/topkg.nix b/pkgs/build-support/ocaml/topkg.nix index 4b387b16ed84..4c2d5d26d6c6 100644 --- a/pkgs/build-support/ocaml/topkg.nix +++ b/pkgs/build-support/ocaml/topkg.nix @@ -42,7 +42,8 @@ lib.throwIf (args ? minimalOCamlVersion && lib.versionOlder ocaml.version args.m findlib ocamlbuild topkg - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; buildInputs = [ topkg ] ++ buildInputs; meta = (args.meta or { }) // { diff --git a/pkgs/build-support/php/build-pecl.nix b/pkgs/build-support/php/build-pecl.nix index be02be6c76ed..c94bc156334d 100644 --- a/pkgs/build-support/php/build-pecl.nix +++ b/pkgs/build-support/php/build-pecl.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation ( php autoreconfHook re2c - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; buildInputs = [ php ] ++ peclDeps ++ buildInputs; makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags; diff --git a/pkgs/build-support/pkg-config-wrapper/default.nix b/pkgs/build-support/pkg-config-wrapper/default.nix index da77765f82d3..cb0eb5635bee 100644 --- a/pkgs/build-support/pkg-config-wrapper/default.nix +++ b/pkgs/build-support/pkg-config-wrapper/default.nix @@ -61,31 +61,30 @@ stdenv.mkDerivation { # Additional flags passed to pkg-config. env.addFlags = optionalString stdenv.targetPlatform.isStatic "--static"; - installPhase = - '' - mkdir -p $out/bin $out/nix-support + installPhase = '' + mkdir -p $out/bin $out/nix-support - wrap() { - local dst="$1" - local wrapper="$2" - export prog="$3" - substituteAll "$wrapper" "$out/bin/$dst" - chmod +x "$out/bin/$dst" - } + wrap() { + local dst="$1" + local wrapper="$2" + export prog="$3" + substituteAll "$wrapper" "$out/bin/$dst" + chmod +x "$out/bin/$dst" + } - echo $pkg-config > $out/nix-support/orig-pkg-config + echo $pkg-config > $out/nix-support/orig-pkg-config - wrap ${wrapperBinName} ${./pkg-config-wrapper.sh} "${getBin pkg-config}/bin/${baseBinName}" - '' - # symlink in share for autoconf to find macros + wrap ${wrapperBinName} ${./pkg-config-wrapper.sh} "${getBin pkg-config}/bin/${baseBinName}" + '' + # symlink in share for autoconf to find macros - # TODO(@Ericson2314): in the future just make the unwrapped pkg-config a - # propagated dep once we can rely on downstream deps coming first in - # search paths. (https://github.com/NixOS/nixpkgs/pull/31414 took a crack - # at this.) - + '' - ln -s ${pkg-config}/share $out/share - ''; + # TODO(@Ericson2314): in the future just make the unwrapped pkg-config a + # propagated dep once we can rely on downstream deps coming first in + # search paths. (https://github.com/NixOS/nixpkgs/pull/31414 took a crack + # at this.) + + '' + ln -s ${pkg-config}/share $out/share + ''; setupHooks = [ ../setup-hooks/role.bash diff --git a/pkgs/build-support/portable-service/default.nix b/pkgs/build-support/portable-service/default.nix index ea45249d5bbc..48237af5370f 100644 --- a/pkgs/build-support/portable-service/default.nix +++ b/pkgs/build-support/portable-service/default.nix @@ -64,27 +64,26 @@ let pname = "root-fs-scaffold"; inherit version; - buildCommand = - '' - # scaffold a file system layout - mkdir -p $out/etc/systemd/system $out/proc $out/sys $out/dev $out/run \ - $out/tmp $out/var/tmp $out/var/lib $out/var/cache $out/var/log + buildCommand = '' + # scaffold a file system layout + mkdir -p $out/etc/systemd/system $out/proc $out/sys $out/dev $out/run \ + $out/tmp $out/var/tmp $out/var/lib $out/var/cache $out/var/log - # empty files to mount over with host's version - touch $out/etc/resolv.conf $out/etc/machine-id + # empty files to mount over with host's version + touch $out/etc/resolv.conf $out/etc/machine-id - # required for portable services - cp ${os-release} $out/etc/os-release + # required for portable services + cp ${os-release} $out/etc/os-release + '' + # units **must** be copied to /etc/systemd/system/ + + (lib.concatMapStringsSep "\n" (u: "cp ${u} $out/etc/systemd/system/${u.name};") units) + + (lib.concatMapStringsSep "\n" ( + { object, symlink }: '' - # units **must** be copied to /etc/systemd/system/ - + (lib.concatMapStringsSep "\n" (u: "cp ${u} $out/etc/systemd/system/${u.name};") units) - + (lib.concatMapStringsSep "\n" ( - { object, symlink }: - '' - mkdir -p $(dirname $out/${symlink}); - ln -s ${object} $out/${symlink}; - '' - ) symlinks); + mkdir -p $(dirname $out/${symlink}); + ln -s ${object} $out/${symlink}; + '' + ) symlinks); }; in diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix index 6686aee601b0..2c6d041f7684 100644 --- a/pkgs/build-support/release/nix-build.nix +++ b/pkgs/build-support/release/nix-build.nix @@ -72,18 +72,16 @@ stdenv.mkDerivation ( fi ''; - failureHook = - (lib.optionalString (failureHook != null) failureHook) - + '' - if test -n "$succeedOnFailure"; then - if test -n "$keepBuildDirectory"; then - KEEPBUILDDIR="$out/`basename $TMPDIR`" - echo "Copying build directory to $KEEPBUILDDIR" - mkdir -p $KEEPBUILDDIR - cp -R "$TMPDIR/"* $KEEPBUILDDIR - fi - fi - ''; + failureHook = (lib.optionalString (failureHook != null) failureHook) + '' + if test -n "$succeedOnFailure"; then + if test -n "$keepBuildDirectory"; then + KEEPBUILDDIR="$out/`basename $TMPDIR`" + echo "Copying build directory to $KEEPBUILDDIR" + mkdir -p $KEEPBUILDDIR + cp -R "$TMPDIR/"* $KEEPBUILDDIR + fi + fi + ''; } // removeAttrs args [ "lib" ] # Propagating lib causes the evaluation to fail, because lib is a function that can't be converted to a string diff --git a/pkgs/build-support/remove-references-to/default.nix b/pkgs/build-support/remove-references-to/default.nix index 794c44572265..6ae3e3125c85 100644 --- a/pkgs/build-support/remove-references-to/default.nix +++ b/pkgs/build-support/remove-references-to/default.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation { env = { inherit (builtins) storeDir; shell = lib.getBin shell + (shell.shellPath or ""); - } // lib.optionalAttrs darwinCodeSign { inherit signingUtils; }; + } + // lib.optionalAttrs darwinCodeSign { inherit signingUtils; }; meta.mainProgram = "remove-references-to"; } diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix index 32ab0fd55c3b..24d51ce11382 100644 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -27,32 +27,31 @@ }: let - baseRustcOpts = - [ - (if release then "-C opt-level=3" else "-C debuginfo=2") - "-C codegen-units=${toString codegenUnits}" - "--remap-path-prefix=$NIX_BUILD_TOP=/" - (mkRustcDepArgs dependencies crateRenames) - (mkRustcFeatureArgs crateFeatures) - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--target" - stdenv.hostPlatform.rust.rustcTargetSpec - ] - ++ lib.optionals (needUnstableCLI dependencies) [ - "-Z" - "unstable-options" - ] - ++ extraRustcOpts - # since rustc 1.42 the "proc_macro" crate is part of the default crate prelude - # https://github.com/rust-lang/cargo/commit/4d64eb99a4#diff-7f98585dbf9d30aa100c8318e2c77e79R1021-R1022 - ++ lib.optional (lib.elem "proc-macro" crateType) "--extern proc_macro" - ++ - lib.optional (stdenv.hostPlatform.linker == "lld" && rustc ? llvmPackages.lld) # Needed when building for targets that use lld. e.g. 'wasm32-unknown-unknown' - "-C linker=${rustc.llvmPackages.lld}/bin/lld" - ++ lib.optional ( - stdenv.hasCC && stdenv.hostPlatform.linker != "lld" - ) "-C linker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; + baseRustcOpts = [ + (if release then "-C opt-level=3" else "-C debuginfo=2") + "-C codegen-units=${toString codegenUnits}" + "--remap-path-prefix=$NIX_BUILD_TOP=/" + (mkRustcDepArgs dependencies crateRenames) + (mkRustcFeatureArgs crateFeatures) + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--target" + stdenv.hostPlatform.rust.rustcTargetSpec + ] + ++ lib.optionals (needUnstableCLI dependencies) [ + "-Z" + "unstable-options" + ] + ++ extraRustcOpts + # since rustc 1.42 the "proc_macro" crate is part of the default crate prelude + # https://github.com/rust-lang/cargo/commit/4d64eb99a4#diff-7f98585dbf9d30aa100c8318e2c77e79R1021-R1022 + ++ lib.optional (lib.elem "proc-macro" crateType) "--extern proc_macro" + ++ + lib.optional (stdenv.hostPlatform.linker == "lld" && rustc ? llvmPackages.lld) # Needed when building for targets that use lld. e.g. 'wasm32-unknown-unknown' + "-C linker=${rustc.llvmPackages.lld}/bin/lld" + ++ lib.optional ( + stdenv.hasCC && stdenv.hostPlatform.linker != "lld" + ) "-C linker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; rustcMeta = "-C metadata=${metadata} -C extra-filename=-${metadata}"; # build the final rustc arguments that can be different between different diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index 323b39c2e1f0..e54e76ff8aa4 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -297,16 +297,15 @@ lib.makeOverridable name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}"; version = crate.version; depsBuildBuild = [ pkgsBuildBuild.stdenv.cc ]; - nativeBuildInputs = - [ - rust - cargo - jq - ] - ++ lib.optionals stdenv.hasCC [ stdenv.cc ] - ++ lib.optionals stdenv.buildPlatform.isDarwin [ libiconv ] - ++ (crate.nativeBuildInputs or [ ]) - ++ nativeBuildInputs_; + nativeBuildInputs = [ + rust + cargo + jq + ] + ++ lib.optionals stdenv.hasCC [ stdenv.cc ] + ++ lib.optionals stdenv.buildPlatform.isDarwin [ libiconv ] + ++ (crate.nativeBuildInputs or [ ]) + ++ nativeBuildInputs_; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] ++ (crate.buildInputs or [ ]) diff --git a/pkgs/build-support/rust/build-rust-crate/test/default.nix b/pkgs/build-support/rust/build-rust-crate/test/default.nix index f4a417a6a8e6..b0551c314638 100644 --- a/pkgs/build-support/rust/build-rust-crate/test/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/test/default.nix @@ -20,7 +20,8 @@ let crateName = "nixtestcrate"; version = "0.1.0"; authors = [ "Test " ]; - } // args; + } + // args; in buildRustCrate p; mkHostCrate = mkCrate buildRustCrate; @@ -766,15 +767,14 @@ rec { ]; src = mkBin "src/foobar.rs"; }; - expectedFiles = - [ - "./bin/test_binary1" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # On Darwin, the debug symbols are in a separate directory. - "./bin/test_binary1.dSYM/Contents/Info.plist" - "./bin/test_binary1.dSYM/Contents/Resources/DWARF/test_binary1" - ]; + expectedFiles = [ + "./bin/test_binary1" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # On Darwin, the debug symbols are in a separate directory. + "./bin/test_binary1.dSYM/Contents/Info.plist" + "./bin/test_binary1.dSYM/Contents/Resources/DWARF/test_binary1" + ]; }; crateBinNoPath1Outputs = assertOutputs { diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 9a139a7e2c73..9c9b70684474 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -141,13 +141,12 @@ lib.extendMkDerivation { PKG_CONFIG_ALLOW_CROSS = if stdenv.buildPlatform != stdenv.hostPlatform then 1 else 0; - postUnpack = - '' - eval "$cargoDepsHook" + postUnpack = '' + eval "$cargoDepsHook" - export RUST_LOG=${logLevel} - '' - + (args.postUnpack or ""); + export RUST_LOG=${logLevel} + '' + + (args.postUnpack or ""); configurePhase = args.configurePhase or '' diff --git a/pkgs/build-support/rust/default-crate-overrides.nix b/pkgs/build-support/rust/default-crate-overrides.nix index cee76b967d3b..58bd218b68de 100644 --- a/pkgs/build-support/rust/default-crate-overrides.nix +++ b/pkgs/build-support/rust/default-crate-overrides.nix @@ -100,16 +100,15 @@ }; evdev-sys = attrs: { - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals (stdenv.buildPlatform.config != stdenv.hostPlatform.config) [ - python3 - autoconf - automake - libtool - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (stdenv.buildPlatform.config != stdenv.hostPlatform.config) [ + python3 + autoconf + automake + libtool + ]; buildInputs = [ libevdev ]; # This prevents libevdev's build.rs from trying to `git fetch` when HOST!=TARGET @@ -397,14 +396,12 @@ proc-macro-crate = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "2.0") { - postPatch = - (attrs.postPatch or "") - + '' - substituteInPlace \ - src/lib.rs \ - --replace-fail \ - 'env::var("CARGO")' \ - 'Ok::<_, core::convert::Infallible>("${lib.getBin buildPackages.cargo}/bin/cargo")' - ''; + postPatch = (attrs.postPatch or "") + '' + substituteInPlace \ + src/lib.rs \ + --replace-fail \ + 'env::var("CARGO")' \ + 'Ok::<_, core::convert::Infallible>("${lib.getBin buildPackages.cargo}/bin/cargo")' + ''; }; } diff --git a/pkgs/build-support/rust/fetch-cargo-vendor.nix b/pkgs/build-support/rust/fetch-cargo-vendor.nix index 5f5a16440778..ff9b8a87ebbf 100644 --- a/pkgs/build-support/rust/fetch-cargo-vendor.nix +++ b/pkgs/build-support/rust/fetch-cargo-vendor.nix @@ -61,7 +61,8 @@ let # break loop of nix-prefetch-git -> git-lfs -> asciidoctor -> ruby (yjit) -> fetchCargoVendor -> nix-prefetch-git # Cargo does not currently handle git-lfs: https://github.com/rust-lang/cargo/issues/9692 (nix-prefetch-git.override { git-lfs = null; }) - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; buildPhase = '' runHook preBuild diff --git a/pkgs/build-support/rust/hooks/default.nix b/pkgs/build-support/rust/hooks/default.nix index 9f27a44480a9..b9ea694c7c03 100644 --- a/pkgs/build-support/rust/hooks/default.nix +++ b/pkgs/build-support/rust/hooks/default.nix @@ -24,13 +24,12 @@ inherit (rust.envVars) setEnv; }; - passthru.tests = - { - test = tests.rust-hooks.cargoBuildHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoBuildHook; - }; + passthru.tests = { + test = tests.rust-hooks.cargoBuildHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoBuildHook; + }; } ./cargo-build-hook.sh; cargoCheckHook = makeSetupHook { @@ -39,13 +38,12 @@ inherit (stdenv.targetPlatform.rust) rustcTarget; inherit (rust.envVars) setEnv; }; - passthru.tests = - { - test = tests.rust-hooks.cargoCheckHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoCheckHook; - }; + passthru.tests = { + test = tests.rust-hooks.cargoCheckHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoCheckHook; + }; } ./cargo-check-hook.sh; cargoInstallHook = makeSetupHook { @@ -53,13 +51,12 @@ substitutions = { targetSubdirectory = target; }; - passthru.tests = - { - test = tests.rust-hooks.cargoInstallHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoInstallHook; - }; + passthru.tests = { + test = tests.rust-hooks.cargoInstallHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoInstallHook; + }; } ./cargo-install-hook.sh; cargoNextestHook = makeSetupHook { @@ -68,13 +65,12 @@ substitutions = { inherit (stdenv.targetPlatform.rust) rustcTarget; }; - passthru.tests = - { - test = tests.rust-hooks.cargoNextestHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoNextestHook; - }; + passthru.tests = { + test = tests.rust-hooks.cargoNextestHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoNextestHook; + }; } ./cargo-nextest-hook.sh; cargoSetupHook = makeSetupHook { @@ -109,13 +105,12 @@ ''; }; - passthru.tests = - { - test = tests.rust-hooks.cargoSetupHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoSetupHook; - }; + passthru.tests = { + test = tests.rust-hooks.cargoSetupHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoSetupHook; + }; } ./cargo-setup-hook.sh; maturinBuildHook = makeSetupHook { diff --git a/pkgs/build-support/rust/import-cargo-lock.nix b/pkgs/build-support/rust/import-cargo-lock.nix index d63cfb8c52b9..ded382f42247 100644 --- a/pkgs/build-support/rust/import-cargo-lock.nix +++ b/pkgs/build-support/rust/import-cargo-lock.nix @@ -131,7 +131,8 @@ let registries = { "https://github.com/rust-lang/crates.io-index" = "https://crates.io/api/v1/crates"; - } // extraRegistries; + } + // extraRegistries; # Replaces values inherited by workspace members. replaceWorkspaceValues = writers.writePython3 "replace-workspace-values" { diff --git a/pkgs/build-support/rust/lib/default.nix b/pkgs/build-support/rust/lib/default.nix index 1a38818af67d..86be047af73b 100644 --- a/pkgs/build-support/rust/lib/default.nix +++ b/pkgs/build-support/rust/lib/default.nix @@ -55,31 +55,30 @@ rec { # Prefix this onto a command invocation in order to set the # variables needed by cargo. # - setEnv = - '' - env \ - "CC_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${ccForBuild}" \ - "CXX_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${cxxForBuild}" \ - "CARGO_TARGET_${stdenv.buildPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForBuild}" \ - "CARGO_BUILD_TARGET=${rustBuildPlatform}" \ - "HOST_CC=${pkgsBuildHost.stdenv.cc}/bin/cc" \ - "HOST_CXX=${pkgsBuildHost.stdenv.cc}/bin/c++" \ - '' - + '' - "CC_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${ccForHost}" \ - "CXX_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${cxxForHost}" \ - "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForHost}" \ - '' - # Due to a bug in how splicing and pkgsTargetTarget works, in - # situations where pkgsTargetTarget is irrelevant - # pkgsTargetTarget.stdenv.cc is often simply wrong. We must omit - # the following lines when rustTargetPlatform collides with - # rustHostPlatform. - + lib.optionalString (rustTargetPlatform != rustHostPlatform) '' - "CC_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${ccForTarget}" \ - "CXX_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${cxxForTarget}" \ - "CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForTarget}" \ - ''; + setEnv = '' + env \ + "CC_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${ccForBuild}" \ + "CXX_${stdenv.buildPlatform.rust.cargoEnvVarTarget}=${cxxForBuild}" \ + "CARGO_TARGET_${stdenv.buildPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForBuild}" \ + "CARGO_BUILD_TARGET=${rustBuildPlatform}" \ + "HOST_CC=${pkgsBuildHost.stdenv.cc}/bin/cc" \ + "HOST_CXX=${pkgsBuildHost.stdenv.cc}/bin/c++" \ + '' + + '' + "CC_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${ccForHost}" \ + "CXX_${stdenv.hostPlatform.rust.cargoEnvVarTarget}=${cxxForHost}" \ + "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForHost}" \ + '' + # Due to a bug in how splicing and pkgsTargetTarget works, in + # situations where pkgsTargetTarget is irrelevant + # pkgsTargetTarget.stdenv.cc is often simply wrong. We must omit + # the following lines when rustTargetPlatform collides with + # rustHostPlatform. + + lib.optionalString (rustTargetPlatform != rustHostPlatform) '' + "CC_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${ccForTarget}" \ + "CXX_${stdenv.targetPlatform.rust.cargoEnvVarTarget}=${cxxForTarget}" \ + "CARGO_TARGET_${stdenv.targetPlatform.rust.cargoEnvVarTarget}_LINKER=${ccForTarget}" \ + ''; }; } // diff --git a/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix b/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix index 0ff6305fe5de..c5df25d4066d 100644 --- a/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix +++ b/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix @@ -16,17 +16,16 @@ makeSetupHook { name = "wrap-gapps-hook"; - propagatedBuildInputs = - [ - # We use the wrapProgram function. - makeWrapper - ] - ++ lib.optionals isGraphical [ - # TODO: remove this, packages should depend on GTK explicitly. - gtk3 + propagatedBuildInputs = [ + # We use the wrapProgram function. + makeWrapper + ] + ++ lib.optionals isGraphical [ + # TODO: remove this, packages should depend on GTK explicitly. + gtk3 - librsvg - ]; + librsvg + ]; # depsTargetTargetPropagated will essentially be buildInputs when wrapGAppsHook3 is placed into nativeBuildInputs # the librsvg and gtk3 above should be removed but kept to not break anything that implicitly depended on its binaries diff --git a/pkgs/build-support/testers/default.nix b/pkgs/build-support/testers/default.nix index 3a2fcbfa4d1d..ca6731722ec1 100644 --- a/pkgs/build-support/testers/default.nix +++ b/pkgs/build-support/testers/default.nix @@ -25,21 +25,20 @@ drv: drv.overrideAttrs (orig: { builder = buildPackages.bash; - args = - [ - (replaceVars ./expect-failure.sh { - coreutils = buildPackages.coreutils; - vars = lib.toShellVars { - outputNames = (orig.outputs or [ "out" ]); - }; - }) - orig.realBuilder or stdenv.shell - ] - ++ orig.args or [ - "-e" - ../../stdenv/generic/source-stdenv.sh - (orig.builder or ../../stdenv/generic/default-builder.sh) - ]; + args = [ + (replaceVars ./expect-failure.sh { + coreutils = buildPackages.coreutils; + vars = lib.toShellVars { + outputNames = (orig.outputs or [ "out" ]); + }; + }) + orig.realBuilder or stdenv.shell + ] + ++ orig.args or [ + "-e" + ../../stdenv/generic/source-stdenv.sh + (orig.builder or ../../stdenv/generic/default-builder.sh) + ]; }); # See https://nixos.org/manual/nixpkgs/unstable/#tester-testBuildFailurePrime @@ -149,17 +148,16 @@ runCommandWith { inherit name stdenv; - derivationArgs = - { - outputHash = hash; - outputHashMode = "recursive"; - } - // lib.removeAttrs args [ - "hash" - "name" - "script" - "stdenv" - ]; + derivationArgs = { + outputHash = hash; + outputHashMode = "recursive"; + } + // lib.removeAttrs args [ + "hash" + "name" + "script" + "stdenv" + ]; } script ); diff --git a/pkgs/build-support/testers/hasCmakeConfigModules/tester.nix b/pkgs/build-support/testers/hasCmakeConfigModules/tester.nix index 85938ef3bf4f..103794b13f6c 100644 --- a/pkgs/build-support/testers/hasCmakeConfigModules/tester.nix +++ b/pkgs/build-support/testers/hasCmakeConfigModules/tester.nix @@ -33,26 +33,26 @@ runCommandCC testName version = if versionCheck then version else null; nativeBuildInputs = [ cmake - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; buildInputs = [ package ] ++ buildInputs; - meta = - { - description = "Test whether ${package.name} exposes cmake-config modules ${lib.concatStringsSep ", " moduleNames}"; - } - # Make sure licensing info etc is preserved, as this is a concern for e.g. cache.nixos.org, - # as hydra can't check this meta info in dependencies. - # The test itself is just Nixpkgs, with MIT license. - // builtins.intersectAttrs { - available = throw "unused"; - broken = throw "unused"; - insecure = throw "unused"; - license = throw "unused"; - maintainers = throw "unused"; - teams = throw "unused"; - platforms = throw "unused"; - unfree = throw "unused"; - unsupported = throw "unused"; - } package.meta; + meta = { + description = "Test whether ${package.name} exposes cmake-config modules ${lib.concatStringsSep ", " moduleNames}"; + } + # Make sure licensing info etc is preserved, as this is a concern for e.g. cache.nixos.org, + # as hydra can't check this meta info in dependencies. + # The test itself is just Nixpkgs, with MIT license. + // builtins.intersectAttrs { + available = throw "unused"; + broken = throw "unused"; + insecure = throw "unused"; + license = throw "unused"; + maintainers = throw "unused"; + teams = throw "unused"; + platforms = throw "unused"; + unfree = throw "unused"; + unsupported = throw "unused"; + } package.meta; } '' touch "$out" diff --git a/pkgs/build-support/testers/hasPkgConfigModules/tester.nix b/pkgs/build-support/testers/hasPkgConfigModules/tester.nix index 1d9e3ff50986..b0053820a3d2 100644 --- a/pkgs/build-support/testers/hasPkgConfigModules/tester.nix +++ b/pkgs/build-support/testers/hasPkgConfigModules/tester.nix @@ -19,24 +19,23 @@ runCommand testName nativeBuildInputs = [ pkg-config ]; buildInputs = [ package ]; inherit moduleNames version versionCheck; - meta = - { - description = "Test whether ${package.name} exposes pkg-config modules ${lib.concatStringsSep ", " moduleNames}"; - } - # Make sure licensing info etc is preserved, as this is a concern for e.g. cache.nixos.org, - # as hydra can't check this meta info in dependencies. - # The test itself is just Nixpkgs, with MIT license. - // builtins.intersectAttrs { - available = throw "unused"; - broken = throw "unused"; - insecure = throw "unused"; - license = throw "unused"; - maintainers = throw "unused"; - teams = throw "unused"; - platforms = throw "unused"; - unfree = throw "unused"; - unsupported = throw "unused"; - } package.meta; + meta = { + description = "Test whether ${package.name} exposes pkg-config modules ${lib.concatStringsSep ", " moduleNames}"; + } + # Make sure licensing info etc is preserved, as this is a concern for e.g. cache.nixos.org, + # as hydra can't check this meta info in dependencies. + # The test itself is just Nixpkgs, with MIT license. + // builtins.intersectAttrs { + available = throw "unused"; + broken = throw "unused"; + insecure = throw "unused"; + license = throw "unused"; + maintainers = throw "unused"; + teams = throw "unused"; + platforms = throw "unused"; + unfree = throw "unused"; + unsupported = throw "unused"; + } package.meta; } '' touch "$out" diff --git a/pkgs/build-support/testers/lychee.nix b/pkgs/build-support/testers/lychee.nix index 28395c9784f6..ec0aa4c7f305 100644 --- a/pkgs/build-support/testers/lychee.nix +++ b/pkgs/build-support/testers/lychee.nix @@ -46,16 +46,15 @@ let # These can be overridden with overrideAttrs if needed. passthru = { inherit lychee remap; - config = - { - include_fragments = true; - } - // lib.optionalAttrs (finalAttrs.passthru.remap != { }) { - remap = mapAttrsToList ( - name: value: withCheckedName name "${name} ${toURL value}" - ) finalAttrs.passthru.remap; - } - // extraConfig; + config = { + include_fragments = true; + } + // lib.optionalAttrs (finalAttrs.passthru.remap != { }) { + remap = mapAttrsToList ( + name: value: withCheckedName name "${name} ${toURL value}" + ) finalAttrs.passthru.remap; + } + // extraConfig; online = writeShellApplication { name = "run-lychee-online"; runtimeInputs = [ finalAttrs.passthru.lychee ]; diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 7af40f9f002e..645090be02d4 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -344,27 +344,26 @@ rec { destination = "/bin/${name}"; allowSubstitutes = true; preferLocalBuild = false; - text = - '' - #!${runtimeShell} - ${lib.concatMapStringsSep "\n" (option: "set -o ${option}") bashOptions} - '' - + lib.optionalString (runtimeEnv != null) ( - lib.concatStrings ( - lib.mapAttrsToList (name: value: '' - ${lib.toShellVar name value} - export ${name} - '') runtimeEnv - ) + text = '' + #!${runtimeShell} + ${lib.concatMapStringsSep "\n" (option: "set -o ${option}") bashOptions} + '' + + lib.optionalString (runtimeEnv != null) ( + lib.concatStrings ( + lib.mapAttrsToList (name: value: '' + ${lib.toShellVar name value} + export ${name} + '') runtimeEnv ) - + lib.optionalString (runtimeInputs != [ ]) '' + ) + + lib.optionalString (runtimeInputs != [ ]) '' - export PATH="${lib.makeBinPath runtimeInputs}${lib.optionalString inheritPath ":$PATH"}" - '' - + '' + export PATH="${lib.makeBinPath runtimeInputs}${lib.optionalString inheritPath ":$PATH"}" + '' + + '' - ${text} - ''; + ${text} + ''; checkPhase = let diff --git a/pkgs/build-support/trivial-builders/test/write-shell-script.nix b/pkgs/build-support/trivial-builders/test/write-shell-script.nix index 2e20588fad6b..0e62bf46c860 100644 --- a/pkgs/build-support/trivial-builders/test/write-shell-script.nix +++ b/pkgs/build-support/trivial-builders/test/write-shell-script.nix @@ -6,14 +6,12 @@ in echo ${lib.escapeShellArg output} '').overrideAttrs (old: { - checkPhase = - old.checkPhase or "" - + '' - expected=${lib.escapeShellArg output} - got=$("$target") - if [[ "$got" != "$expected" ]]; then - echo "wrong output: expected $expected, got $got" - exit 1 - fi - ''; + checkPhase = old.checkPhase or "" + '' + expected=${lib.escapeShellArg output} + got=$("$target") + if [[ "$got" != "$expected" ]]; then + echo "wrong output: expected $expected, got $got" + exit 1 + fi + ''; }) diff --git a/pkgs/build-support/wasm-bindgen-cli/default.nix b/pkgs/build-support/wasm-bindgen-cli/default.nix index 1cdbd5d9906a..112e999323ed 100644 --- a/pkgs/build-support/wasm-bindgen-cli/default.nix +++ b/pkgs/build-support/wasm-bindgen-cli/default.nix @@ -23,11 +23,12 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; nativeCheckInputs = [ nodejs_latest ]; diff --git a/pkgs/by-name/_1/_1fps/package.nix b/pkgs/by-name/_1/_1fps/package.nix index 59ba4349191d..48b8be2acb04 100644 --- a/pkgs/by-name/_1/_1fps/package.nix +++ b/pkgs/by-name/_1/_1fps/package.nix @@ -25,7 +25,8 @@ buildGoModule rec { xorg.libX11 xorg.libXtst xorg.libXi - ] ++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk_14; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin apple-sdk_14; meta = { description = "Encrypted Screen Sharing"; diff --git a/pkgs/by-name/_1/_1password-cli/package.nix b/pkgs/by-name/_1/_1password-cli/package.nix index c5f84562267a..6b5ddbf11dd8 100644 --- a/pkgs/by-name/_1/_1password-cli/package.nix +++ b/pkgs/by-name/_1/_1password-cli/package.nix @@ -18,7 +18,8 @@ let args = { url = "https://cache.agilebits.com/dist/1P/op2/pkg/v${version}/op_${srcPlatform}_v${version}.${extension}"; inherit hash; - } // lib.optionalAttrs (extension == "zip") { stripRoot = false; }; + } + // lib.optionalAttrs (extension == "zip") { stripRoot = false; }; in if extension == "zip" then fetchzip args else fetchurl args; @@ -45,16 +46,15 @@ stdenv.mkDerivation { else throw "Source for ${pname} is not available for ${system}"; - nativeBuildInputs = - [ - installShellFiles - versionCheckHook - ] - ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook - ++ lib.optional stdenv.hostPlatform.isDarwin [ - xar - cpio - ]; + nativeBuildInputs = [ + installShellFiles + versionCheckHook + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook + ++ lib.optional stdenv.hostPlatform.isDarwin [ + xar + cpio + ]; unpackPhase = lib.optionalString stdenv.hostPlatform.isDarwin '' xar -xf $src diff --git a/pkgs/by-name/_3/_389-ds-base/package.nix b/pkgs/by-name/_3/_389-ds-base/package.nix index a31f30360c7c..ea9dcf136a40 100644 --- a/pkgs/by-name/_3/_389-ds-base/package.nix +++ b/pkgs/by-name/_3/_389-ds-base/package.nix @@ -64,29 +64,29 @@ stdenv.mkDerivation (finalAttrs: { python3 cargo rustc - ] ++ lib.optional withCockpit rsync; + ] + ++ lib.optional withCockpit rsync; - buildInputs = - [ - cracklib - lmdb - json_c - linux-pam - libevent - libxcrypt - nspr - nss - cyrus_sasl - icu - krb5 - pcre2 - openssl - zlib - ] - ++ lib.optional withSystemd systemd - ++ lib.optional withOpenldap openldap - ++ lib.optional withBdb db - ++ lib.optional withNetSnmp net-snmp; + buildInputs = [ + cracklib + lmdb + json_c + linux-pam + libevent + libxcrypt + nspr + nss + cyrus_sasl + icu + krb5 + pcre2 + openssl + zlib + ] + ++ lib.optional withSystemd systemd + ++ lib.optional withOpenldap openldap + ++ lib.optional withBdb db + ++ lib.optional withNetSnmp net-snmp; postPatch = '' patchShebangs ./buildnum.py ./ldap/servers/slapd/mkDBErrStrs.py @@ -100,33 +100,32 @@ stdenv.mkDerivation (finalAttrs: { ln -s ${finalAttrs.cargoDeps} ./vendor ''; - configureFlags = - [ - "--enable-rust-offline" - "--enable-autobind" - ] - ++ lib.optionals withSystemd [ - "--with-systemd" - "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" - ] - ++ lib.optionals withOpenldap [ - "--with-openldap" - ] - ++ lib.optionals withBdb [ - "--with-db-inc=${lib.getDev db}/include" - "--with-db-lib=${lib.getLib db}/lib" - ] - ++ lib.optionals withNetSnmp [ - "--with-netsnmp-inc=${lib.getDev net-snmp}/include" - "--with-netsnmp-lib=${lib.getLib net-snmp}/lib" - ] - ++ lib.optionals (!withCockpit) [ - "--disable-cockpit" - ] - ++ lib.optionals withAsan [ - "--enable-asan" - "--enable-debug" - ]; + configureFlags = [ + "--enable-rust-offline" + "--enable-autobind" + ] + ++ lib.optionals withSystemd [ + "--with-systemd" + "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" + ] + ++ lib.optionals withOpenldap [ + "--with-openldap" + ] + ++ lib.optionals withBdb [ + "--with-db-inc=${lib.getDev db}/include" + "--with-db-lib=${lib.getLib db}/lib" + ] + ++ lib.optionals withNetSnmp [ + "--with-netsnmp-inc=${lib.getDev net-snmp}/include" + "--with-netsnmp-lib=${lib.getLib net-snmp}/lib" + ] + ++ lib.optionals (!withCockpit) [ + "--disable-cockpit" + ] + ++ lib.optionals withAsan [ + "--enable-asan" + "--enable-debug" + ]; enableParallelBuilding = true; # Disable parallel builds as those lack some dependencies: diff --git a/pkgs/by-name/_7/_7zz/package.nix b/pkgs/by-name/_7/_7zz/package.nix index bf4e59f8e26e..92244f056b2e 100644 --- a/pkgs/by-name/_7/_7zz/package.nix +++ b/pkgs/by-name/_7/_7zz/package.nix @@ -80,19 +80,18 @@ stdenv.mkDerivation (finalAttrs: { inherit makefile; - makeFlags = - [ - "CC=${stdenv.cc.targetPrefix}cc" - "CXX=${stdenv.cc.targetPrefix}c++" - ] - ++ lib.optionals useUasm [ "MY_ASM=uasm" ] - ++ lib.optionals (!useUasm && stdenv.hostPlatform.isx86) [ "USE_ASM=" ] - # it's the compression code with the restriction, see DOC/License.txt - ++ lib.optionals (!enableUnfree) [ "DISABLE_RAR_COMPRESS=true" ] - ++ lib.optionals (stdenv.hostPlatform.isMinGW) [ - "IS_MINGW=1" - "MSYSTEM=1" - ]; + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "CXX=${stdenv.cc.targetPrefix}c++" + ] + ++ lib.optionals useUasm [ "MY_ASM=uasm" ] + ++ lib.optionals (!useUasm && stdenv.hostPlatform.isx86) [ "USE_ASM=" ] + # it's the compression code with the restriction, see DOC/License.txt + ++ lib.optionals (!enableUnfree) [ "DISABLE_RAR_COMPRESS=true" ] + ++ lib.optionals (stdenv.hostPlatform.isMinGW) [ + "IS_MINGW=1" + "MSYSTEM=1" + ]; nativeBuildInputs = lib.optionals useUasm [ uasm ]; diff --git a/pkgs/by-name/_8/_86Box/package.nix b/pkgs/by-name/_8/_86Box/package.nix index f2392a6677b0..4e2cdb3eac5e 100644 --- a/pkgs/by-name/_8/_86Box/package.nix +++ b/pkgs/by-name/_8/_86Box/package.nix @@ -54,42 +54,40 @@ stdenv.mkDerivation (finalAttrs: { substituteAllInPlace src/qt/qt_platform.cpp ''; - nativeBuildInputs = - [ - cmake - pkg-config - makeWrapper - qt5.wrapQtAppsHook - ] - ++ lib.optionals enableWayland [ - extra-cmake-modules - wayland-scanner - ]; + nativeBuildInputs = [ + cmake + pkg-config + makeWrapper + qt5.wrapQtAppsHook + ] + ++ lib.optionals enableWayland [ + extra-cmake-modules + wayland-scanner + ]; - buildInputs = - [ - freetype - fluidsynth - SDL2 - glib - openal - rtmidi - pcre2 - jack2 - libpcap - libslirp - qt5.qtbase - qt5.qttools - libsndfile - flac.dev - libogg.dev - libvorbis.dev - libopus.dev - libmpg123.dev - ] - ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib - ++ lib.optional enableWayland wayland - ++ lib.optional enableVncRenderer libvncserver; + buildInputs = [ + freetype + fluidsynth + SDL2 + glib + openal + rtmidi + pcre2 + jack2 + libpcap + libslirp + qt5.qtbase + qt5.qttools + libsndfile + flac.dev + libogg.dev + libvorbis.dev + libopus.dev + libmpg123.dev + ] + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib + ++ lib.optional enableWayland wayland + ++ lib.optional enableVncRenderer libvncserver; cmakeFlags = lib.optional stdenv.hostPlatform.isDarwin "-DCMAKE_MACOSX_BUNDLE=OFF" diff --git a/pkgs/by-name/_9/_9base/package.nix b/pkgs/by-name/_9/_9base/package.nix index 4153315e04e3..da3a54fc9206 100644 --- a/pkgs/by-name/_9/_9base/package.nix +++ b/pkgs/by-name/_9/_9base/package.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation { # https://github.com/9fans/plan9port/commit/540caa5873bcc3bc2a0e1896119f5b53a0e8e630 # https://github.com/9fans/plan9port/commit/323e1a8fac276f008e6d5146a83cbc88edeabc87 ./getcallerpc-use-macro-or-stub.patch - ] ++ patches; + ] + ++ patches; # the 9yacc script needs to be executed to build other items preBuild = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' diff --git a/pkgs/by-name/a2/a2jmidid/package.nix b/pkgs/by-name/a2/a2jmidid/package.nix index 2812ad10733c..7fa64f740e50 100644 --- a/pkgs/by-name/a2/a2jmidid/package.nix +++ b/pkgs/by-name/a2/a2jmidid/package.nix @@ -32,16 +32,15 @@ stdenv.mkDerivation rec { meson ninja ]; - buildInputs = - [ - alsa-lib - dbus - libjack2 - ] - ++ (with python3Packages; [ - python - dbus-python - ]); + buildInputs = [ + alsa-lib + dbus + libjack2 + ] + ++ (with python3Packages; [ + python + dbus-python + ]); postInstall = '' wrapProgram $out/bin/a2j_control --set PYTHONPATH $PYTHONPATH diff --git a/pkgs/by-name/aa/aalib/package.nix b/pkgs/by-name/aa/aalib/package.nix index 4b1885005d08..2dc9439397a8 100644 --- a/pkgs/by-name/aa/aalib/package.nix +++ b/pkgs/by-name/aa/aalib/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { ./clang.patch # Fix build against opaque aalib API ./ncurses-6.5.patch - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ ./darwin.patch ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ ./darwin.patch ]; # The fuloong2f is not supported by aalib still preConfigure = '' diff --git a/pkgs/by-name/ab/abseil-cpp_202501/package.nix b/pkgs/by-name/ab/abseil-cpp_202501/package.nix index 5ab286f3d012..c1884d4a953d 100644 --- a/pkgs/by-name/ab/abseil-cpp_202501/package.nix +++ b/pkgs/by-name/ab/abseil-cpp_202501/package.nix @@ -19,15 +19,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-eB7OqTO9Vwts9nYQ/Mdq0Ds4T1KgmmpYdzU09VPWOhk="; }; - cmakeFlags = - [ - (lib.cmakeBool "ABSL_BUILD_TEST_HELPERS" true) - (lib.cmakeBool "ABSL_USE_EXTERNAL_GOOGLETEST" true) - (lib.cmakeBool "BUILD_SHARED_LIBS" (!static)) - ] - ++ lib.optionals (cxxStandard != null) [ - (lib.cmakeFeature "CMAKE_CXX_STANDARD" cxxStandard) - ]; + cmakeFlags = [ + (lib.cmakeBool "ABSL_BUILD_TEST_HELPERS" true) + (lib.cmakeBool "ABSL_USE_EXTERNAL_GOOGLETEST" true) + (lib.cmakeBool "BUILD_SHARED_LIBS" (!static)) + ] + ++ lib.optionals (cxxStandard != null) [ + (lib.cmakeFeature "CMAKE_CXX_STANDARD" cxxStandard) + ]; strictDeps = true; diff --git a/pkgs/by-name/ac/accountsservice/package.nix b/pkgs/by-name/ac/accountsservice/package.nix index 64c24bb66b0b..6401c52f0184 100644 --- a/pkgs/by-name/ac/accountsservice/package.nix +++ b/pkgs/by-name/ac/accountsservice/package.nix @@ -55,20 +55,19 @@ stdenv.mkDerivation rec { ./get-dm-type-from-config.patch ]; - nativeBuildInputs = - [ - gettext - gobject-introspection - meson - ninja - pkg-config - python3 - vala - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - # meson.build:88:2: ERROR: Can not run test applications in this cross environment. - mesonEmulatorHook - ]; + nativeBuildInputs = [ + gettext + gobject-introspection + meson + ninja + pkg-config + python3 + vala + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # meson.build:88:2: ERROR: Can not run test applications in this cross environment. + mesonEmulatorHook + ]; buildInputs = [ dbus diff --git a/pkgs/by-name/ac/acsccid/package.nix b/pkgs/by-name/ac/acsccid/package.nix index 8505cce2e71b..28cb34aa4bce 100644 --- a/pkgs/by-name/ac/acsccid/package.nix +++ b/pkgs/by-name/ac/acsccid/package.nix @@ -35,14 +35,13 @@ stdenv.mkDerivation rec { perl ]; - buildInputs = - [ - pcsclite - libusb1 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + pcsclite + libusb1 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; configureFlags = [ "--enable-usbdropdir=${placeholder "out"}/pcsc/drivers" diff --git a/pkgs/by-name/ac/actiona/package.nix b/pkgs/by-name/ac/actiona/package.nix index 739ada6e5b38..0e022282ced7 100644 --- a/pkgs/by-name/ac/actiona/package.nix +++ b/pkgs/by-name/ac/actiona/package.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation (finalAttrs: { qt6.qtmultimedia qt6.qttools qt6.qt5compat - ] ++ lib.optionals textToSpeechSupport [ qt6.qtspeech ]; + ] + ++ lib.optionals textToSpeechSupport [ qt6.qtspeech ]; meta = { description = "Cross-platform automation tool"; diff --git a/pkgs/by-name/ad/adaptivecpp/package.nix b/pkgs/by-name/ad/adaptivecpp/package.nix index 31dcc1419818..a59389109be1 100644 --- a/pkgs/by-name/ad/adaptivecpp/package.nix +++ b/pkgs/by-name/ad/adaptivecpp/package.nix @@ -59,44 +59,41 @@ stdenv.mkDerivation (finalAttrs: { ''; }; - nativeBuildInputs = - [ - cmake - makeWrapper - ] - ++ lib.optionals cudaSupport [ - autoAddDriverRunpath - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + cmake + makeWrapper + ] + ++ lib.optionals cudaSupport [ + autoAddDriverRunpath + cudaPackages.cuda_nvcc + ]; - buildInputs = - [ - libxml2 - libffi - boost - python3 - llvmPackages.openmp - llvmPackages.libclang.dev - llvmPackages.llvm - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - (lib.getOutput "stubs" cudaPackages.cuda_cudart) - ]; + buildInputs = [ + libxml2 + libffi + boost + python3 + llvmPackages.openmp + llvmPackages.libclang.dev + llvmPackages.llvm + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + (lib.getOutput "stubs" cudaPackages.cuda_cudart) + ]; # adaptivecpp makes use of clangs internal headers. Its cmake does not successfully discover them automatically on nixos, so we supply the path manually - cmakeFlags = - [ - (lib.cmakeFeature "CLANG_INCLUDE_PATH" "${llvmPackages.libclang.dev}/include") - (lib.cmakeBool "WITH_CPU_BACKEND" ompSupport) - (lib.cmakeBool "WITH_CUDA_BACKEND" cudaSupport) - (lib.cmakeBool "WITH_ROCM_BACKEND" rocmSupport) - (lib.cmakeBool "WITH_OPENCL_BACKEND" openclSupport) - ] - ++ lib.optionals rocmSupport [ - (lib.cmakeFeature "HIPCC_COMPILER" "${finalAttrs.rocmMerged}/bin/hipcc") - (lib.cmakeFeature "ROCM_PATH" "${finalAttrs.rocmMerged}") - ]; + cmakeFlags = [ + (lib.cmakeFeature "CLANG_INCLUDE_PATH" "${llvmPackages.libclang.dev}/include") + (lib.cmakeBool "WITH_CPU_BACKEND" ompSupport) + (lib.cmakeBool "WITH_CUDA_BACKEND" cudaSupport) + (lib.cmakeBool "WITH_ROCM_BACKEND" rocmSupport) + (lib.cmakeBool "WITH_OPENCL_BACKEND" openclSupport) + ] + ++ lib.optionals rocmSupport [ + (lib.cmakeFeature "HIPCC_COMPILER" "${finalAttrs.rocmMerged}/bin/hipcc") + (lib.cmakeFeature "ROCM_PATH" "${finalAttrs.rocmMerged}") + ]; # this hardening option breaks rocm builds hardeningDisable = [ "zerocallusedregs" ]; diff --git a/pkgs/by-name/ad/adaptivecpp/tests.nix b/pkgs/by-name/ad/adaptivecpp/tests.nix index cf8e1d9516f7..7ce1149ff6b7 100644 --- a/pkgs/by-name/ad/adaptivecpp/tests.nix +++ b/pkgs/by-name/ad/adaptivecpp/tests.nix @@ -28,25 +28,23 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot = "${adaptivecpp.src.name}/tests"; - cmakeFlags = - [ - (lib.cmakeFeature "AdaptiveCpp_DIR" "${adaptivecpp}/lib/cmake/AdaptiveCpp") - (lib.cmakeBool "WITH_PSTL_TESTS" enablePstlTests) - ] - ++ lib.optionals (targets != null) [ - (lib.cmakeFeature "DACCP_TARGETS" "${targets}") - ]; + cmakeFlags = [ + (lib.cmakeFeature "AdaptiveCpp_DIR" "${adaptivecpp}/lib/cmake/AdaptiveCpp") + (lib.cmakeBool "WITH_PSTL_TESTS" enablePstlTests) + ] + ++ lib.optionals (targets != null) [ + (lib.cmakeFeature "DACCP_TARGETS" "${targets}") + ]; - installPhase = - '' - mkdir $out - install -Dm755 sycl_tests -t $out/bin/ - install -Dm755 rt_tests -t $out/bin/ - install -Dm755 device_compilation_tests -t $out/bin/ - install -Dm755 dump_test/dump_test -t $out/bin/ - install -Dm755 platform_api/platform_api -t $out/bin/ - '' - + lib.optionalString enablePstlTests '' - install -Dm755 pstl_tests -t $out/bin/ - ''; + installPhase = '' + mkdir $out + install -Dm755 sycl_tests -t $out/bin/ + install -Dm755 rt_tests -t $out/bin/ + install -Dm755 device_compilation_tests -t $out/bin/ + install -Dm755 dump_test/dump_test -t $out/bin/ + install -Dm755 platform_api/platform_api -t $out/bin/ + '' + + lib.optionalString enablePstlTests '' + install -Dm755 pstl_tests -t $out/bin/ + ''; }) diff --git a/pkgs/by-name/ad/adios2/package.nix b/pkgs/by-name/ad/adios2/package.nix index cdaf7a797c97..0b2685d13de4 100644 --- a/pkgs/by-name/ad/adios2/package.nix +++ b/pkgs/by-name/ad/adios2/package.nix @@ -60,55 +60,52 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-NVyw7xoPutXeUS87jjVv1YxJnwNGZAT4QfkBLzvQbwg="; }; - postPatch = - '' - chmod +x cmake/install/post/adios2-config.pre.sh.in - patchShebangs cmake/install/post/{generate-adios2-config,adios2-config.pre}.sh.in - '' - # Dynamic cast to nullptr on darwin platform, switch to unsafe reinterpret cast. - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace bindings/Python/py11{Attribute,Engine,Variable}.cpp \ - --replace-fail "dynamic_cast" "reinterpret_cast" - ''; + postPatch = '' + chmod +x cmake/install/post/adios2-config.pre.sh.in + patchShebangs cmake/install/post/{generate-adios2-config,adios2-config.pre}.sh.in + '' + # Dynamic cast to nullptr on darwin platform, switch to unsafe reinterpret cast. + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace bindings/Python/py11{Attribute,Engine,Variable}.cpp \ + --replace-fail "dynamic_cast" "reinterpret_cast" + ''; - nativeBuildInputs = - [ - perl - cmake - ninja - gfortran - pkg-config - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pybind11 - python3Packages.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + perl + cmake + ninja + gfortran + pkg-config + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pybind11 + python3Packages.pythonImportsCheckHook + ]; - buildInputs = - [ - bzip2 - c-blosc2 - adios2Packages.catalyst - adios2Packages.hdf5 - libfabric - libpng - libsodium - pugixml - sqlite - zeromq - zfp - zlib - yaml-cpp - nlohmann_json + buildInputs = [ + bzip2 + c-blosc2 + adios2Packages.catalyst + adios2Packages.hdf5 + libfabric + libpng + libsodium + pugixml + sqlite + zeromq + zfp + zlib + yaml-cpp + nlohmann_json - # Todo: add these optional dependencies in nixpkgs. - # sz - # mgard - ] - ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform ucx) ucx - # openmp required by zfp - ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; + # Todo: add these optional dependencies in nixpkgs. + # sz + # mgard + ] + ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform ucx) ucx + # openmp required by zfp + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; propagatedBuildInputs = lib.optional mpiSupport mpi diff --git a/pkgs/by-name/ad/adlplug/package.nix b/pkgs/by-name/ad/adlplug/package.nix index 16fb9beb6825..2902d59de731 100644 --- a/pkgs/by-name/ad/adlplug/package.nix +++ b/pkgs/by-name/ad/adlplug/package.nix @@ -74,21 +74,20 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - fmt - liblo - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - freetype - libX11 - libXrandr - libXinerama - libXext - libXcursor - ] - ++ lib.optionals withJack [ libjack2 ]; + buildInputs = [ + fmt + liblo + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + freetype + libX11 + libXrandr + libXinerama + libXext + libXcursor + ] + ++ lib.optionals withJack [ libjack2 ]; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p $out/{Applications,Library/Audio/Plug-Ins/{VST,Components}} diff --git a/pkgs/by-name/ae/aegisub/package.nix b/pkgs/by-name/ae/aegisub/package.nix index 114abcf5dd2b..5571e8051691 100644 --- a/pkgs/by-name/ae/aegisub/package.nix +++ b/pkgs/by-name/ae/aegisub/package.nix @@ -60,30 +60,29 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - boost - expat - ffmpeg - ffms - fftw - fontconfig - freetype - fribidi - harfbuzz - icu - libGL - libass - libuchardet - wxGTK32 - zlib - ] - ++ lib.optionals alsaSupport [ alsa-lib ] - ++ lib.optionals (openalSupport && !stdenv.hostPlatform.isDarwin) [ openal ] - ++ lib.optionals portaudioSupport [ portaudio ] - ++ lib.optionals pulseaudioSupport [ libpulseaudio ] - ++ lib.optionals spellcheckSupport [ hunspell ] - ++ lib.optionals (!useBundledLuaJIT) [ luajit ]; + buildInputs = [ + boost + expat + ffmpeg + ffms + fftw + fontconfig + freetype + fribidi + harfbuzz + icu + libGL + libass + libuchardet + wxGTK32 + zlib + ] + ++ lib.optionals alsaSupport [ alsa-lib ] + ++ lib.optionals (openalSupport && !stdenv.hostPlatform.isDarwin) [ openal ] + ++ lib.optionals portaudioSupport [ portaudio ] + ++ lib.optionals pulseaudioSupport [ libpulseaudio ] + ++ lib.optionals spellcheckSupport [ hunspell ] + ++ lib.optionals (!useBundledLuaJIT) [ luajit ]; mesonFlags = [ (lib.mesonEnable "alsa" alsaSupport) diff --git a/pkgs/by-name/ae/aerc/package.nix b/pkgs/by-name/ae/aerc/package.nix index 906c9a39f7f6..12ebcc226eb6 100644 --- a/pkgs/by-name/ae/aerc/package.nix +++ b/pkgs/by-name/ae/aerc/package.nix @@ -59,7 +59,8 @@ buildGoModule (finalAttrs: { buildInputs = [ python3Packages.python gawk - ] ++ lib.optional withNotmuch notmuch; + ] + ++ lib.optional withNotmuch notmuch; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/af/afew/package.nix b/pkgs/by-name/af/afew/package.nix index a3fc331f1bff..f9d14a814bd4 100644 --- a/pkgs/by-name/af/afew/package.nix +++ b/pkgs/by-name/af/afew/package.nix @@ -35,14 +35,13 @@ python3Packages.buildPythonApplication rec { setuptools ]; - nativeCheckInputs = - [ - pkgs.notmuch - ] - ++ (with python3Packages; [ - freezegun - pytestCheckHook - ]); + nativeCheckInputs = [ + pkgs.notmuch + ] + ++ (with python3Packages; [ + freezegun + pytestCheckHook + ]); makeWrapperArgs = [ ''--prefix PATH ':' "${pkgs.notmuch}/bin"'' diff --git a/pkgs/by-name/af/affine-bin/package.nix b/pkgs/by-name/af/affine-bin/package.nix index b576208ee505..1ad8f5064466 100644 --- a/pkgs/by-name/af/affine-bin/package.nix +++ b/pkgs/by-name/af/affine-bin/package.nix @@ -37,32 +37,31 @@ stdenvNoCC.mkDerivation ( productName = if buildType == "stable" then "AFFiNE" else "AFFiNE-" + buildType; binName = lib.toLower finalAttrs.productName; pname = "${finalAttrs.binName}-bin"; - meta = - { - description = "Workspace with fully merged docs, whiteboards and databases"; - longDescription = '' - AFFiNE is an open-source, all-in-one workspace and an operating - system for all the building blocks that assemble your knowledge - base and much more -- wiki, knowledge management, presentation - and digital assets - ''; - homepage = "https://affine.pro/"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ - richar - redyf - xiaoxiangmoe - ]; - platforms = [ - "aarch64-darwin" - "x86_64-darwin" - "x86_64-linux" - ]; - sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; - } - // lib.optionalAttrs hostPlatform.isLinux { - mainProgram = finalAttrs.binName; - }; + meta = { + description = "Workspace with fully merged docs, whiteboards and databases"; + longDescription = '' + AFFiNE is an open-source, all-in-one workspace and an operating + system for all the building blocks that assemble your knowledge + base and much more -- wiki, knowledge management, presentation + and digital assets + ''; + homepage = "https://affine.pro/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ + richar + redyf + xiaoxiangmoe + ]; + platforms = [ + "aarch64-darwin" + "x86_64-darwin" + "x86_64-linux" + ]; + sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; + } + // lib.optionalAttrs hostPlatform.isLinux { + mainProgram = finalAttrs.binName; + }; src = ( let @@ -81,14 +80,13 @@ stdenvNoCC.mkDerivation ( } ); - nativeBuildInputs = - [ - unzip - ] - ++ lib.optionals hostPlatform.isLinux [ - copyDesktopItems - makeWrapper - ]; + nativeBuildInputs = [ + unzip + ] + ++ lib.optionals hostPlatform.isLinux [ + copyDesktopItems + makeWrapper + ]; installPhase = let diff --git a/pkgs/by-name/af/affine/package.nix b/pkgs/by-name/af/affine/package.nix index 51045670eb1f..ef3c0a7c1458 100644 --- a/pkgs/by-name/af/affine/package.nix +++ b/pkgs/by-name/af/affine/package.nix @@ -105,26 +105,25 @@ stdenv.mkDerivation (finalAttrs: { apple-sdk_15 ]; - nativeBuildInputs = - [ - nodejs - yarn-berry - cargo - rustc - findutils - zip - jq - rsync - writableTmpDirAsHomeHook - ] - ++ lib.optionals hostPlatform.isLinux [ - copyDesktopItems - makeWrapper - ] - ++ lib.optionals hostPlatform.isDarwin [ - # bindgenHook is needed to build `coreaudio-sys` on darwin - rustPlatform.bindgenHook - ]; + nativeBuildInputs = [ + nodejs + yarn-berry + cargo + rustc + findutils + zip + jq + rsync + writableTmpDirAsHomeHook + ] + ++ lib.optionals hostPlatform.isLinux [ + copyDesktopItems + makeWrapper + ] + ++ lib.optionals hostPlatform.isDarwin [ + # bindgenHook is needed to build `coreaudio-sys` on darwin + rustPlatform.bindgenHook + ]; env = { # force yarn install run in CI mode diff --git a/pkgs/by-name/af/afflib/package.nix b/pkgs/by-name/af/afflib/package.nix index 416987b88fbc..cee4a263a09c 100644 --- a/pkgs/by-name/af/afflib/package.nix +++ b/pkgs/by-name/af/afflib/package.nix @@ -24,16 +24,15 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ - zlib - curl - expat - openssl - python3 - ] - ++ lib.optionals (with stdenv; isLinux || isDarwin) [ fuse ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + buildInputs = [ + zlib + curl + expat + openssl + python3 + ] + ++ lib.optionals (with stdenv; isLinux || isDarwin) [ fuse ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; meta = { homepage = "http://afflib.sourceforge.net/"; diff --git a/pkgs/by-name/ag/age-plugin-yubikey/package.nix b/pkgs/by-name/ag/age-plugin-yubikey/package.nix index 0584961dc788..8968bedba184 100644 --- a/pkgs/by-name/ag/age-plugin-yubikey/package.nix +++ b/pkgs/by-name/ag/age-plugin-yubikey/package.nix @@ -28,7 +28,8 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pcsclite ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pcsclite ]; meta = with lib; { description = "YubiKey plugin for age"; diff --git a/pkgs/by-name/ag/ags/bundle.nix b/pkgs/by-name/ag/ags/bundle.nix index d1aa9a91b391..7609fd51e248 100644 --- a/pkgs/by-name/ag/ags/bundle.nix +++ b/pkgs/by-name/ag/ags/bundle.nix @@ -40,27 +40,26 @@ stdenvNoCC.mkDerivation ( astal.io ]; - preFixup = - '' - gappsWrapperArgs+=( - --prefix PATH : ${ - lib.makeBinPath ( - dependencies - ++ [ - dart-sass - fzf - gtk3 - ] - ) - } - ) - '' - + lib.optionalString enableGtk4 '' - gappsWrapperArgs+=( - --set LD_PRELOAD "${gtk4-layer-shell}/lib/libgtk4-layer-shell.so" - ) - '' - + (attrs.preFixup or ""); + preFixup = '' + gappsWrapperArgs+=( + --prefix PATH : ${ + lib.makeBinPath ( + dependencies + ++ [ + dart-sass + fzf + gtk3 + ] + ) + } + ) + '' + + lib.optionalString enableGtk4 '' + gappsWrapperArgs+=( + --set LD_PRELOAD "${gtk4-layer-shell}/lib/libgtk4-layer-shell.so" + ) + '' + + (attrs.preFixup or ""); installPhase = let diff --git a/pkgs/by-name/ah/ahoviewer/package.nix b/pkgs/by-name/ah/ahoviewer/package.nix index cf1f95645ffd..bf811cf6347d 100644 --- a/pkgs/by-name/ah/ahoviewer/package.nix +++ b/pkgs/by-name/ah/ahoviewer/package.nix @@ -53,7 +53,8 @@ stdenv.mkDerivation rec { gst_all_1.gst-plugins-good gst_all_1.gst-libav gst_all_1.gst-plugins-base - ] ++ lib.optional useUnrar unrar; + ] + ++ lib.optional useUnrar unrar; NIX_LDFLAGS = "-lpthread"; diff --git a/pkgs/by-name/ai/aider-chat/package.nix b/pkgs/by-name/ai/aider-chat/package.nix index 3cfc044433cf..08ea22cd6967 100644 --- a/pkgs/by-name/ai/aider-chat/package.nix +++ b/pkgs/by-name/ai/aider-chat/package.nix @@ -160,29 +160,28 @@ let "tests/help/test_help.py" ]; - disabledTests = - [ - # Tests require network - "test_urls" - "test_get_commit_message_with_custom_prompt" - # FileNotFoundError - "test_get_commit_message" - # Expected 'launch_gui' to have been called once - "test_browser_flag_imports_streamlit" - # AttributeError - "test_simple_send_with_retries" - # Expected 'check_version' to have been called once - "test_main_exit_calls_version_check" - # AssertionError: assert 2 == 1 - "test_simple_send_non_retryable_error" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Tests fails on darwin - "test_dark_mode_sets_code_theme" - "test_default_env_file_sets_automatic_variable" - # FileNotFoundError: [Errno 2] No such file or directory: 'vim' - "test_pipe_editor" - ]; + disabledTests = [ + # Tests require network + "test_urls" + "test_get_commit_message_with_custom_prompt" + # FileNotFoundError + "test_get_commit_message" + # Expected 'launch_gui' to have been called once + "test_browser_flag_imports_streamlit" + # AttributeError + "test_simple_send_with_retries" + # Expected 'check_version' to have been called once + "test_main_exit_calls_version_check" + # AssertionError: assert 2 == 1 + "test_simple_send_non_retryable_error" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Tests fails on darwin + "test_dark_mode_sets_code_theme" + "test_default_env_file_sets_automatic_variable" + # FileNotFoundError: [Errno 2] No such file or directory: 'vim' + "test_pipe_editor" + ]; makeWrapperArgs = [ "--set" @@ -254,8 +253,7 @@ let ++ lib.optionals withBedrock aider-chat.optional-dependencies.bedrock; propagatedBuildInputs = - propagatedBuildInputs - ++ lib.optionals withPlaywright [ playwright-driver.browsers ]; + propagatedBuildInputs ++ lib.optionals withPlaywright [ playwright-driver.browsers ]; makeWrapperArgs = makeWrapperArgs diff --git a/pkgs/by-name/ai/aircrack-ng/package.nix b/pkgs/by-name/ai/aircrack-ng/package.nix index b9c42d6cb30b..fa846eb32859 100644 --- a/pkgs/by-name/ai/aircrack-ng/package.nix +++ b/pkgs/by-name/ai/aircrack-ng/package.nix @@ -113,17 +113,16 @@ stdenv.mkDerivation rec { ''; installCheckTarget = "integration"; - nativeInstallCheckInputs = - [ - cmocka - expect - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - tcpdump - hostapd - wpa_supplicant - screen - ]; + nativeInstallCheckInputs = [ + cmocka + expect + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + tcpdump + hostapd + wpa_supplicant + screen + ]; meta = { description = "WiFi security auditing tools suite"; diff --git a/pkgs/by-name/ai/airgeddon/package.nix b/pkgs/by-name/ai/airgeddon/package.nix index fb742524fadd..0b417a301a7f 100644 --- a/pkgs/by-name/ai/airgeddon/package.nix +++ b/pkgs/by-name/ai/airgeddon/package.nix @@ -58,60 +58,59 @@ supportX11 ? false, # Allow using xterm instead of tmux, hard to test }: let - deps = - [ - aircrack-ng - bash - coreutils-full - curl - gawk - glibc - gnugrep - gnused - iproute2 - iw - networkmanager - ncurses - pciutils - procps - tmux - usbutils - wget - ethtool - util-linux - ccze - systemd - ] - ++ lib.optionals supportWpaWps [ - bully - pixiewps - reaverwps-t6x - ] - ++ lib.optionals supportHashCracking [ - asleap - crunch - hashcat - hcxdumptool - hcxtools - john - wireshark-cli - ] - ++ lib.optionals supportEvilTwin [ - bettercap - dnsmasq - ettercap - hostapd - lighttpd - openssl - mdk4 - nftables - apparmor-bin-utils - ] - ++ lib.optionals supportX11 [ - xterm - xorg.xset - xorg.xdpyinfo - ]; + deps = [ + aircrack-ng + bash + coreutils-full + curl + gawk + glibc + gnugrep + gnused + iproute2 + iw + networkmanager + ncurses + pciutils + procps + tmux + usbutils + wget + ethtool + util-linux + ccze + systemd + ] + ++ lib.optionals supportWpaWps [ + bully + pixiewps + reaverwps-t6x + ] + ++ lib.optionals supportHashCracking [ + asleap + crunch + hashcat + hcxdumptool + hcxtools + john + wireshark-cli + ] + ++ lib.optionals supportEvilTwin [ + bettercap + dnsmasq + ettercap + hostapd + lighttpd + openssl + mdk4 + nftables + apparmor-bin-utils + ] + ++ lib.optionals supportX11 [ + xterm + xorg.xset + xorg.xdpyinfo + ]; in stdenv.mkDerivation rec { pname = "airgeddon"; diff --git a/pkgs/by-name/ai/airtame/package.nix b/pkgs/by-name/ai/airtame/package.nix index e67d572ccdef..2c7b1994e3b4 100644 --- a/pkgs/by-name/ai/airtame/package.nix +++ b/pkgs/by-name/ai/airtame/package.nix @@ -59,7 +59,8 @@ let libGL vulkan-loader curlWithGnuTls - ] ++ xorgDeps; + ] + ++ xorgDeps; libPath = lib.makeLibraryPath deps + ":" + lib.makeSearchPathOutput "lib" "lib64" deps; binPath = lib.makeBinPath deps; diff --git a/pkgs/by-name/ai/airwin2rack/package.nix b/pkgs/by-name/ai/airwin2rack/package.nix index f622c15f192e..3203ae4a60d1 100644 --- a/pkgs/by-name/ai/airwin2rack/package.nix +++ b/pkgs/by-name/ai/airwin2rack/package.nix @@ -83,71 +83,68 @@ stdenv.mkDerivation { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - copyDesktopItems - ] - ++ lib.optionals enableVCVRack [ - jq - zstd - ]; + nativeBuildInputs = [ + cmake + pkg-config + copyDesktopItems + ] + ++ lib.optionals enableVCVRack [ + jq + zstd + ]; - buildInputs = - [ - alsa-lib - xorg.libX11 - xorg.libXcomposite - xorg.libXcursor - xorg.libXext - xorg.libXinerama - xorg.libXrandr - xorg.libXrender - xorg.libXtst - xorg.libXdmcp - libGLU - libjack2 - freetype - webkitgtk_4_0 - glib - gtk3-x11 - curl - libsysprof-capture - pcre2 - util-linux - libselinux - libsepol - libthai - libxkbcommon - libdatrie - libepoxy - libsoup_2_4 - lerc - sqlite - ] - ++ lib.optionals enableVCVRack [ - vcv-rack - jansson - glew - glfw - libarchive - speexdsp - libpulseaudio - libsamplerate - rtmidi - zstd - ]; + buildInputs = [ + alsa-lib + xorg.libX11 + xorg.libXcomposite + xorg.libXcursor + xorg.libXext + xorg.libXinerama + xorg.libXrandr + xorg.libXrender + xorg.libXtst + xorg.libXdmcp + libGLU + libjack2 + freetype + webkitgtk_4_0 + glib + gtk3-x11 + curl + libsysprof-capture + pcre2 + util-linux + libselinux + libsepol + libthai + libxkbcommon + libdatrie + libepoxy + libsoup_2_4 + lerc + sqlite + ] + ++ lib.optionals enableVCVRack [ + vcv-rack + jansson + glew + glfw + libarchive + speexdsp + libpulseaudio + libsamplerate + rtmidi + zstd + ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_JUCE_PLUGIN" true) - (lib.cmakeBool "USE_JUCE_PROGRAMS" true) - ] - ++ lib.optionals enableVCVRack [ - (lib.cmakeBool "BUILD_RACK_PLUGIN" true) - (lib.cmakeFeature "RACK_SDK_DIR" "${vcvRackSdk}") - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_JUCE_PLUGIN" true) + (lib.cmakeBool "USE_JUCE_PROGRAMS" true) + ] + ++ lib.optionals enableVCVRack [ + (lib.cmakeBool "BUILD_RACK_PLUGIN" true) + (lib.cmakeFeature "RACK_SDK_DIR" "${vcvRackSdk}") + ]; cmakeBuildType = "Release"; diff --git a/pkgs/by-name/ak/akkoma-admin-fe/package.nix b/pkgs/by-name/ak/akkoma-admin-fe/package.nix index 5560eefa7f8b..e6cc16e74125 100644 --- a/pkgs/by-name/ak/akkoma-admin-fe/package.nix +++ b/pkgs/by-name/ak/akkoma-admin-fe/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: { python3 git libsass - ] ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; configurePhase = '' runHook preConfigure diff --git a/pkgs/by-name/al/alacritty/package.nix b/pkgs/by-name/al/alacritty/package.nix index cb57b10a43f0..061e5143a8c0 100644 --- a/pkgs/by-name/al/alacritty/package.nix +++ b/pkgs/by-name/al/alacritty/package.nix @@ -26,22 +26,21 @@ withGraphics ? false, }: let - rpathLibs = - [ - expat - fontconfig - freetype - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGL - xorg.libX11 - xorg.libXcursor - xorg.libXi - xorg.libXxf86vm - xorg.libxcb - libxkbcommon - wayland - ]; + rpathLibs = [ + expat + fontconfig + freetype + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGL + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXxf86vm + xorg.libxcb + libxkbcommon + wayland + ]; in rustPlatform.buildRustPackage rec { pname = "alacritty"; diff --git a/pkgs/by-name/al/albert/package.nix b/pkgs/by-name/al/albert/package.nix index d9f8559fa634..92cf1b771fd4 100644 --- a/pkgs/by-name/al/albert/package.nix +++ b/pkgs/by-name/al/albert/package.nix @@ -31,26 +31,25 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook ]; - buildInputs = - [ - kdePackages.qtkeychain - libqalculate - libarchive - muparser - ] - ++ (with qt6; [ - qt5compat - qtbase - qtdeclarative - qtscxml - qtsvg - qttools - qtwayland - ]) - ++ (with python3Packages; [ - python - pybind11 - ]); + buildInputs = [ + kdePackages.qtkeychain + libqalculate + libarchive + muparser + ] + ++ (with qt6; [ + qt5compat + qtbase + qtdeclarative + qtscxml + qtsvg + qttools + qtwayland + ]) + ++ (with python3Packages; [ + python + pybind11 + ]); postPatch = '' find -type f -name CMakeLists.txt -exec sed -i {} -e '/INSTALL_RPATH/d' \; diff --git a/pkgs/by-name/al/alcom/package.nix b/pkgs/by-name/al/alcom/package.nix index 75ed8045fbc5..b022cfce8a6f 100644 --- a/pkgs/by-name/al/alcom/package.nix +++ b/pkgs/by-name/al/alcom/package.nix @@ -65,16 +65,17 @@ rustPlatform.buildRustPackage { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glib-networking - libsoup_3 - makeBinaryWrapper - webkitgtk_4_1 - ] - ++ dotnetSdk.packages - ++ dotnetBuild.nugetDeps; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glib-networking + libsoup_3 + makeBinaryWrapper + webkitgtk_4_1 + ] + ++ dotnetSdk.packages + ++ dotnetBuild.nugetDeps; useFetchCargoVendor = true; cargoHash = "sha256-Ph6QZW21JYQJgrUecN+MklWuY51iKC2glPEdgxw+3r8="; diff --git a/pkgs/by-name/al/algol68g/package.nix b/pkgs/by-name/al/algol68g/package.nix index 70c862e4e610..31549c54bf5e 100644 --- a/pkgs/by-name/al/algol68g/package.nix +++ b/pkgs/by-name/al/algol68g/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "man" - ] ++ lib.optionals withPDFDoc [ "doc" ]; + ] + ++ lib.optionals withPDFDoc [ "doc" ]; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/al/aliae/package.nix b/pkgs/by-name/al/aliae/package.nix index 342cb01d9e0e..eed27dad9603 100644 --- a/pkgs/by-name/al/aliae/package.nix +++ b/pkgs/by-name/al/aliae/package.nix @@ -34,16 +34,15 @@ buildGoModule rec { "osusergo" ]; - postInstall = - '' - mv $out/bin/{src,aliae} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd aliae \ - --bash <($out/bin/aliae completion bash) \ - --fish <($out/bin/aliae completion fish) \ - --zsh <($out/bin/aliae completion zsh) - ''; + postInstall = '' + mv $out/bin/{src,aliae} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd aliae \ + --bash <($out/bin/aliae completion bash) \ + --fish <($out/bin/aliae completion fish) \ + --zsh <($out/bin/aliae completion zsh) + ''; meta = { description = "Cross shell and platform alias management"; diff --git a/pkgs/by-name/al/aligator/package.nix b/pkgs/by-name/al/aligator/package.nix index 95b48a12cdb3..4b21d4326b45 100644 --- a/pkgs/by-name/al/aligator/package.nix +++ b/pkgs/by-name/al/aligator/package.nix @@ -44,53 +44,54 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - doxygen - cmake - graphviz - pkg-config - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pythonImportsCheckHook - ]; - buildInputs = - [ fmt ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages.openmp - ]; - propagatedBuildInputs = - [ suitesparse ] - ++ lib.optionals pythonSupport [ - python3Packages.crocoddyl - python3Packages.matplotlib - python3Packages.pinocchio - ] - ++ lib.optionals (!pythonSupport) [ - crocoddyl - pinocchio - ]; - checkInputs = - [ gbenchmark ] - ++ lib.optionals pythonSupport [ - python3Packages.matplotlib - python3Packages.pytest - ]; + nativeBuildInputs = [ + doxygen + cmake + graphviz + pkg-config + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pythonImportsCheckHook + ]; + buildInputs = [ + fmt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp + ]; + propagatedBuildInputs = [ + suitesparse + ] + ++ lib.optionals pythonSupport [ + python3Packages.crocoddyl + python3Packages.matplotlib + python3Packages.pinocchio + ] + ++ lib.optionals (!pythonSupport) [ + crocoddyl + pinocchio + ]; + checkInputs = [ + gbenchmark + ] + ++ lib.optionals pythonSupport [ + python3Packages.matplotlib + python3Packages.pytest + ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) - (lib.cmakeBool "BUILD_WITH_PINOCCHIO_SUPPORT" true) - (lib.cmakeBool "BUILD_CROCODDYL_COMPAT" true) - (lib.cmakeBool "BUILD_WITH_OPENMP_SUPPORT" true) - (lib.cmakeBool "BUILD_WITH_CHOLMOD_SUPPORT" true) - (lib.cmakeBool "GENERATE_PYTHON_STUBS" false) # this need git at configure time - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && pythonSupport) [ - # ignore one failing test for now - (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'aligator-test-py-rollout|aligator-test-py-frames'") - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) + (lib.cmakeBool "BUILD_WITH_PINOCCHIO_SUPPORT" true) + (lib.cmakeBool "BUILD_CROCODDYL_COMPAT" true) + (lib.cmakeBool "BUILD_WITH_OPENMP_SUPPORT" true) + (lib.cmakeBool "BUILD_WITH_CHOLMOD_SUPPORT" true) + (lib.cmakeBool "GENERATE_PYTHON_STUBS" false) # this need git at configure time + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && pythonSupport) [ + # ignore one failing test for now + (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'aligator-test-py-rollout|aligator-test-py-frames'") + ]; # Fontconfig error: Cannot load default config file: No such file: (null) env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf"; diff --git a/pkgs/by-name/al/alot/package.nix b/pkgs/by-name/al/alot/package.nix index c720e0b8374e..753ef96c167e 100644 --- a/pkgs/by-name/al/alot/package.nix +++ b/pkgs/by-name/al/alot/package.nix @@ -16,13 +16,12 @@ buildPythonApplication rec { version = "0.11"; pyproject = true; - outputs = - [ - "out" - ] - ++ lib.optionals withManpage [ - "man" - ]; + outputs = [ + "out" + ] + ++ lib.optionals withManpage [ + "man" + ]; disabled = !isPy3k; @@ -40,7 +39,8 @@ buildPythonApplication rec { nativeBuildInputs = [ setuptools-scm - ] ++ lib.optional withManpage sphinx; + ] + ++ lib.optional withManpage sphinx; propagatedBuildInputs = [ configobj diff --git a/pkgs/by-name/al/alsa-ucm-conf/package.nix b/pkgs/by-name/al/alsa-ucm-conf/package.nix index ea27eed8fbc6..9827a1d2839f 100644 --- a/pkgs/by-name/al/alsa-ucm-conf/package.nix +++ b/pkgs/by-name/al/alsa-ucm-conf/package.nix @@ -18,36 +18,35 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - substituteInPlace ucm2/lib/card-init.conf \ - --replace-fail "/bin/rm" "${coreutils}/bin/rm" \ - --replace-fail "/bin/mkdir" "${coreutils}/bin/mkdir" + substituteInPlace ucm2/lib/card-init.conf \ + --replace-fail "/bin/rm" "${coreutils}/bin/rm" \ + --replace-fail "/bin/mkdir" "${coreutils}/bin/mkdir" - files=( - "ucm2/HDA/HDA.conf" - "ucm2/codecs/rt715/init.conf" - "ucm2/codecs/rt715-sdca/init.conf" - "ucm2/Intel/cht-bsw-rt5672/cht-bsw-rt5672.conf" - "ucm2/Intel/bytcr-rt5640/bytcr-rt5640.conf" - ) + files=( + "ucm2/HDA/HDA.conf" + "ucm2/codecs/rt715/init.conf" + "ucm2/codecs/rt715-sdca/init.conf" + "ucm2/Intel/cht-bsw-rt5672/cht-bsw-rt5672.conf" + "ucm2/Intel/bytcr-rt5640/bytcr-rt5640.conf" + ) - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - for file in "''${files[@]}"; do - substituteInPlace "$file" \ - --replace-fail '/sbin/modprobe' '${kmod}/bin/modprobe' - done - '' - + '' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + for file in "''${files[@]}"; do + substituteInPlace "$file" \ + --replace-fail '/sbin/modprobe' '${kmod}/bin/modprobe' + done + '' + + '' - mkdir -p $out/share/alsa - cp -r ucm ucm2 $out/share/alsa + mkdir -p $out/share/alsa + cp -r ucm ucm2 $out/share/alsa - runHook postInstall - ''; + runHook postInstall + ''; passthru.updateScript = directoryListingUpdater { url = "https://www.alsa-project.org/files/pub/lib/"; diff --git a/pkgs/by-name/al/alt-ergo/package.nix b/pkgs/by-name/al/alt-ergo/package.nix index 4adef6770175..a29807e8476c 100644 --- a/pkgs/by-name/al/alt-ergo/package.nix +++ b/pkgs/by-name/al/alt-ergo/package.nix @@ -50,14 +50,16 @@ ocamlPackages.buildDunePackage { nativeBuildInputs = [ ocamlPackages.menhir - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]; - propagatedBuildInputs = - [ alt-ergo-parsers ] - ++ (with ocamlPackages; [ - cmdliner - dune-site - ppxlib - ]); + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]; + propagatedBuildInputs = [ + alt-ergo-parsers + ] + ++ (with ocamlPackages; [ + cmdliner + dune-site + ppxlib + ]); outputs = [ "bin" diff --git a/pkgs/by-name/al/alttpr-opentracker/package.nix b/pkgs/by-name/al/alttpr-opentracker/package.nix index 3b8406650896..21fbc80973ec 100644 --- a/pkgs/by-name/al/alttpr-opentracker/package.nix +++ b/pkgs/by-name/al/alttpr-opentracker/package.nix @@ -48,18 +48,17 @@ buildDotnetModule rec { openssl ]; - runtimeDeps = - [ - gtk3 - openssl - xinput - ] - ++ (with xorg; [ - libICE - libSM - libX11 - libXi - ]); + runtimeDeps = [ + gtk3 + openssl + xinput + ] + ++ (with xorg; [ + libICE + libSM + libX11 + libXi + ]); autoPatchelfIgnoreMissingDeps = [ "libc.musl-x86_64.so.1" diff --git a/pkgs/by-name/am/amazon-ssm-agent/package.nix b/pkgs/by-name/am/amazon-ssm-agent/package.nix index 8266e3596036..2bcdd3b50dc1 100644 --- a/pkgs/by-name/am/amazon-ssm-agent/package.nix +++ b/pkgs/by-name/am/amazon-ssm-agent/package.nix @@ -62,13 +62,12 @@ buildGoModule rec { ./0002-version-gen-don-t-use-unnecessary-constants.patch ]; - nativeBuildInputs = - [ - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.DarwinTools - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.DarwinTools + ]; # See the list https://github.com/aws/amazon-ssm-agent/blob/3.2.2143.0/makefile#L121-L147 # The updater is not built because it cannot work on NixOS @@ -86,27 +85,26 @@ buildGoModule rec { "-w" ]; - postPatch = - '' - printf "#!/bin/sh\ntrue" > ./Tools/src/checkstyle.sh + postPatch = '' + printf "#!/bin/sh\ntrue" > ./Tools/src/checkstyle.sh - substituteInPlace agent/platform/platform_unix.go \ - --replace-fail "/usr/bin/uname" "${coreutils}/bin/uname" \ - --replace-fail '"/bin", "hostname"' '"${net-tools}/bin/hostname"' \ - --replace-fail '"lsb_release"' '"${fake-lsb-release}/bin/lsb_release"' + substituteInPlace agent/platform/platform_unix.go \ + --replace-fail "/usr/bin/uname" "${coreutils}/bin/uname" \ + --replace-fail '"/bin", "hostname"' '"${net-tools}/bin/hostname"' \ + --replace-fail '"lsb_release"' '"${fake-lsb-release}/bin/lsb_release"' - substituteInPlace agent/session/shell/shell_unix.go \ - --replace-fail '"script"' '"${util-linux}/bin/script"' + substituteInPlace agent/session/shell/shell_unix.go \ + --replace-fail '"script"' '"${util-linux}/bin/script"' - substituteInPlace agent/rebooter/rebooter_unix.go \ - --replace-fail "/sbin/shutdown" "shutdown" + substituteInPlace agent/rebooter/rebooter_unix.go \ + --replace-fail "/sbin/shutdown" "shutdown" - echo "${version}" > VERSION - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace agent/managedInstances/fingerprint/hardwareInfo_unix.go \ - --replace-fail /usr/sbin/dmidecode ${dmidecode}/bin/dmidecode - ''; + echo "${version}" > VERSION + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace agent/managedInstances/fingerprint/hardwareInfo_unix.go \ + --replace-fail /usr/sbin/dmidecode ${dmidecode}/bin/dmidecode + ''; preBuild = '' # Note: if this step fails, please patch the code to fix it! Please only skip diff --git a/pkgs/by-name/am/amber-lang/package.nix b/pkgs/by-name/am/amber-lang/package.nix index 115d613926dd..ed81873248ab 100644 --- a/pkgs/by-name/am/amber-lang/package.nix +++ b/pkgs/by-name/am/amber-lang/package.nix @@ -54,14 +54,13 @@ rustPlatform.buildRustPackage rec { "--skip=tests::formatter::all_exist" ]; - postInstall = - '' - wrapProgram "$out/bin/amber" --prefix PATH : "${lib.makeBinPath [ bc ]}" - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd amber \ - --bash <($out/bin/amber completion) - ''; + postInstall = '' + wrapProgram "$out/bin/amber" --prefix PATH : "${lib.makeBinPath [ bc ]}" + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd amber \ + --bash <($out/bin/amber completion) + ''; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/am/amberol/package.nix b/pkgs/by-name/am/amberol/package.nix index 67c87323b67b..f8c67fda8918 100644 --- a/pkgs/by-name/am/amberol/package.nix +++ b/pkgs/by-name/am/amberol/package.nix @@ -57,21 +57,20 @@ stdenv.mkDerivation rec { wrapGAppsHook4 ]; - buildInputs = - [ - dbus - glib - gtk4 - libadwaita - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ]); + buildInputs = [ + dbus + glib + gtk4 + libadwaita + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav + ]); passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/am/amd-blis/package.nix b/pkgs/by-name/am/amd-blis/package.nix index 7cb8b272d384..65106043809c 100644 --- a/pkgs/by-name/am/amd-blis/package.nix +++ b/pkgs/by-name/am/amd-blis/package.nix @@ -47,13 +47,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - configureFlags = - [ - "--enable-cblas" - "--blas-int-size=${blasIntSize}" - ] - ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ] - ++ [ withArchitecture ]; + configureFlags = [ + "--enable-cblas" + "--blas-int-size=${blasIntSize}" + ] + ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ] + ++ [ withArchitecture ]; postPatch = '' patchShebangs configure build/flatten-headers.py diff --git a/pkgs/by-name/am/amd-libflame/package.nix b/pkgs/by-name/am/amd-libflame/package.nix index 8da26d47f60b..2ace3bcf5ff0 100644 --- a/pkgs/by-name/am/amd-libflame/package.nix +++ b/pkgs/by-name/am/amd-libflame/package.nix @@ -48,17 +48,16 @@ stdenv.mkDerivation rec { aocl-utils ]; - cmakeFlags = - [ - "-DLIBAOCLUTILS_LIBRARY_PATH=${lib.getLib aocl-utils}/lib/libaoclutils${stdenv.hostPlatform.extensions.sharedLibrary}" - "-DLIBAOCLUTILS_INCLUDE_PATH=${lib.getDev aocl-utils}/include" - "-DENABLE_BUILTIN_LAPACK2FLAME=ON" - "-DENABLE_CBLAS_INTERFACES=ON" - "-DENABLE_EXT_LAPACK_INTERFACE=ON" - ] - ++ lib.optional (!withOpenMP) "-DENABLE_MULTITHREADING=OFF" - ++ lib.optional blas64 "-DENABLE_ILP64=ON" - ++ lib.optional withAMDOpt "-DENABLE_AMD_OPT=ON"; + cmakeFlags = [ + "-DLIBAOCLUTILS_LIBRARY_PATH=${lib.getLib aocl-utils}/lib/libaoclutils${stdenv.hostPlatform.extensions.sharedLibrary}" + "-DLIBAOCLUTILS_INCLUDE_PATH=${lib.getDev aocl-utils}/include" + "-DENABLE_BUILTIN_LAPACK2FLAME=ON" + "-DENABLE_CBLAS_INTERFACES=ON" + "-DENABLE_EXT_LAPACK_INTERFACE=ON" + ] + ++ lib.optional (!withOpenMP) "-DENABLE_MULTITHREADING=OFF" + ++ lib.optional blas64 "-DENABLE_ILP64=ON" + ++ lib.optional withAMDOpt "-DENABLE_AMD_OPT=ON"; postInstall = '' ln -s $out/lib/libflame.so $out/lib/liblapack.so.3 diff --git a/pkgs/by-name/am/amdvlk/package.nix b/pkgs/by-name/am/amdvlk/package.nix index 7612f3376d53..d743655d1eba 100644 --- a/pkgs/by-name/am/amdvlk/package.nix +++ b/pkgs/by-name/am/amdvlk/package.nix @@ -36,40 +36,38 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-ZXou5g0emeK++NyV/hQllZAdZAMEY9TYs9c+umFdcfo="; }; - buildInputs = - [ - expat - libdrm - ncurses - openssl - wayland - zlib - ] - ++ (with xorg; [ - libX11 - libxcb - xcbproto - libXext - libXrandr - libXft - libxshmfence - ]); + buildInputs = [ + expat + libdrm + ncurses + openssl + wayland + zlib + ] + ++ (with xorg; [ + libX11 + libxcb + xcbproto + libXext + libXrandr + libXft + libxshmfence + ]); - nativeBuildInputs = - [ - cmake - directx-shader-compiler - glslang - ninja - patchelf - perl - pkg-config - python3 - ] - ++ (with python3.pkgs; [ - jinja2 - ruamel-yaml - ]); + nativeBuildInputs = [ + cmake + directx-shader-compiler + glslang + ninja + patchelf + perl + pkg-config + python3 + ] + ++ (with python3.pkgs; [ + jinja2 + ruamel-yaml + ]); rpath = lib.makeLibraryPath ( [ diff --git a/pkgs/by-name/am/amneziawg-tools/package.nix b/pkgs/by-name/am/amneziawg-tools/package.nix index df1d7f2e6bcd..f5c8f3a30a65 100644 --- a/pkgs/by-name/am/amneziawg-tools/package.nix +++ b/pkgs/by-name/am/amneziawg-tools/package.nix @@ -41,36 +41,35 @@ stdenv.mkDerivation (finalAttrs: { "WITH_WGQUICK=yes" ]; - postFixup = - '' - substituteInPlace $out/lib/systemd/system/awg-quick@.service \ - --replace-fail /usr/bin $out/bin - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - for f in $out/bin/*; do - # Which firewall and resolvconf implementations to use should be determined by the - # environment, we provide the "default" ones as fallback. - wrapProgram $f \ - --prefix PATH : ${ - lib.makeBinPath [ - procps - iproute2 - ] - } \ - --suffix PATH : ${ - lib.makeBinPath [ - iptables - openresolv - ] - } - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for f in $out/bin/*; do - wrapProgram $f \ - --prefix PATH : ${lib.makeBinPath [ amneziawg-go ]} - done - ''; + postFixup = '' + substituteInPlace $out/lib/systemd/system/awg-quick@.service \ + --replace-fail /usr/bin $out/bin + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + for f in $out/bin/*; do + # Which firewall and resolvconf implementations to use should be determined by the + # environment, we provide the "default" ones as fallback. + wrapProgram $f \ + --prefix PATH : ${ + lib.makeBinPath [ + procps + iproute2 + ] + } \ + --suffix PATH : ${ + lib.makeBinPath [ + iptables + openresolv + ] + } + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + for f in $out/bin/*; do + wrapProgram $f \ + --prefix PATH : ${lib.makeBinPath [ amneziawg-go ]} + done + ''; strictDeps = true; diff --git a/pkgs/by-name/am/ams/package.nix b/pkgs/by-name/am/ams/package.nix index 9b6a8107177e..86b8f2f1c4da 100644 --- a/pkgs/by-name/am/ams/package.nix +++ b/pkgs/by-name/am/ams/package.nix @@ -28,18 +28,17 @@ stdenv.mkDerivation { qt5.wrapQtAppsHook ]; - buildInputs = - [ - alsa-lib - ladspaH - libjack2 - fftw - zita-alsa-pcmi - ] - ++ (with qt5; [ - qtbase - qttools - ]); + buildInputs = [ + alsa-lib + ladspaH + libjack2 + fftw + zita-alsa-pcmi + ] + ++ (with qt5; [ + qtbase + qttools + ]); meta = with lib; { description = "Realtime modular synthesizer for ALSA"; diff --git a/pkgs/by-name/am/amule/package.nix b/pkgs/by-name/am/amule/package.nix index 73e1ad752ec5..69b7348417bc 100644 --- a/pkgs/by-name/am/amule/package.nix +++ b/pkgs/by-name/am/amule/package.nix @@ -53,17 +53,16 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - zlib - wxGTK32 - perl - cryptopp.dev - libupnp - boost186 - ] - ++ lib.optional httpServer libpng - ++ lib.optional client libX11; + buildInputs = [ + zlib + wxGTK32 + perl + cryptopp.dev + libupnp + boost186 + ] + ++ lib.optional httpServer libpng + ++ lib.optional client libX11; cmakeFlags = [ "-DBUILD_MONOLITHIC=${if monolithic then "ON" else "OFF"}" diff --git a/pkgs/by-name/an/ananicy-cpp/package.nix b/pkgs/by-name/an/ananicy-cpp/package.nix index d38286307085..d70de414965e 100644 --- a/pkgs/by-name/an/ananicy-cpp/package.nix +++ b/pkgs/by-name/an/ananicy-cpp/package.nix @@ -52,27 +52,25 @@ clangStdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals withBpf [ - bpftools - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals withBpf [ + bpftools + ]; - buildInputs = - [ - pcre2 - spdlog - nlohmann_json - systemd - zlib - ] - ++ lib.optionals withBpf [ - libbpf - elfutils - ]; + buildInputs = [ + pcre2 + spdlog + nlohmann_json + systemd + zlib + ] + ++ lib.optionals withBpf [ + libbpf + elfutils + ]; # BPF A call to built-in function '__stack_chk_fail' is not supported. hardeningDisable = [ diff --git a/pkgs/by-name/an/andi/package.nix b/pkgs/by-name/an/andi/package.nix index 06efb791d54e..17b89a5b4d6f 100644 --- a/pkgs/by-name/an/andi/package.nix +++ b/pkgs/by-name/an/andi/package.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ gsl libdivsufsort - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; configureFlags = [ (lib.enableFeature finalAttrs.finalPackage.doCheck "unit-tests") ]; diff --git a/pkgs/by-name/an/android-studio-tools/package.nix b/pkgs/by-name/an/android-studio-tools/package.nix index 271051255c31..21cf5da0d646 100644 --- a/pkgs/by-name/an/android-studio-tools/package.nix +++ b/pkgs/by-name/an/android-studio-tools/package.nix @@ -17,15 +17,14 @@ stdenvNoCC.mkDerivation { hash = "sha256-dt8nwjL8wyRfBZOedCPYXh7zyeMUeH0gOPpTcpxCegU="; }; - postPatch = - '' - find . -type f -not -path "./bin/*" -exec chmod -x {} \; - '' - + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' - for f in cmdline-tools/bin/*; do - sed -i 's|start up script for Linux|start up script for Mac|' $f - done - ''; + postPatch = '' + find . -type f -not -path "./bin/*" -exec chmod -x {} \; + '' + + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' + for f in cmdline-tools/bin/*; do + sed -i 's|start up script for Linux|start up script for Mac|' $f + done + ''; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/by-name/an/angband/package.nix b/pkgs/by-name/an/angband/package.nix index 9c2e47a20e4e..9bb9a7e09de8 100644 --- a/pkgs/by-name/an/angband/package.nix +++ b/pkgs/by-name/an/angband/package.nix @@ -23,14 +23,15 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ ncurses5 ] - ++ lib.optionals enableSdl2 [ - SDL2 - SDL2_image - SDL2_mixer - SDL2_ttf - ]; + buildInputs = [ + ncurses5 + ] + ++ lib.optionals enableSdl2 [ + SDL2 + SDL2_image + SDL2_mixer + SDL2_ttf + ]; configureFlags = lib.optional enableSdl2 "--enable-sdl2"; diff --git a/pkgs/by-name/an/ani-cli/package.nix b/pkgs/by-name/an/ani-cli/package.nix index 566af2484b7f..b399dd8a704d 100644 --- a/pkgs/by-name/an/ani-cli/package.nix +++ b/pkgs/by-name/an/ani-cli/package.nix @@ -37,17 +37,16 @@ stdenvNoCC.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ makeWrapper ]; - runtimeInputs = - [ - gnugrep - gnused - curl - fzf - ffmpeg - aria2 - ] - ++ lib.optional chromecastSupport catt - ++ lib.optional syncSupport syncplay; + runtimeInputs = [ + gnugrep + gnused + curl + fzf + ffmpeg + aria2 + ] + ++ lib.optional chromecastSupport catt + ++ lib.optional syncSupport syncplay; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/an/anime-downloader/package.nix b/pkgs/by-name/an/anime-downloader/package.nix index 567ed0960cae..5167e9414b94 100644 --- a/pkgs/by-name/an/anime-downloader/package.nix +++ b/pkgs/by-name/an/anime-downloader/package.nix @@ -22,27 +22,26 @@ python3.pkgs.buildPythonApplication rec { nativeBuildInputs = [ qt5.wrapQtAppsHook ]; - propagatedBuildInputs = - [ - aria2 - mpv - nodejs - ] - ++ (with python3.pkgs; [ - beautifulsoup4 - cfscrape - click - coloredlogs - fuzzywuzzy - jsbeautifier - pycryptodome - pysmartdl - pyqt5 - requests - requests-cache - selenium - tabulate - ]); + propagatedBuildInputs = [ + aria2 + mpv + nodejs + ] + ++ (with python3.pkgs; [ + beautifulsoup4 + cfscrape + click + coloredlogs + fuzzywuzzy + jsbeautifier + pycryptodome + pysmartdl + pyqt5 + requests + requests-cache + selenium + tabulate + ]); preFixup = '' wrapQtApp "$out/bin/anime" --prefix PATH : ${lib.makeBinPath propagatedBuildInputs} diff --git a/pkgs/by-name/an/anubis/package.nix b/pkgs/by-name/an/anubis/package.nix index 43a00eefe288..fd38fd2c91eb 100644 --- a/pkgs/by-name/an/anubis/package.nix +++ b/pkgs/by-name/an/anubis/package.nix @@ -55,7 +55,8 @@ buildGoModule (finalAttrs: { "-s" "-w" "-X=github.com/TecharoHQ/anubis.Version=v${finalAttrs.version}" - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "-extldflags=-static" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "-extldflags=-static" ]; postPatch = '' patchShebangs ./web/build.sh diff --git a/pkgs/by-name/an/anvil-editor/package.nix b/pkgs/by-name/an/anvil-editor/package.nix index 918554209356..4f2e1a51d41f 100644 --- a/pkgs/by-name/an/anvil-editor/package.nix +++ b/pkgs/by-name/an/anvil-editor/package.nix @@ -37,14 +37,13 @@ buildGo123Module (finalAttrs: { modRoot = "anvil-extras"; }; - nativeBuildInputs = - [ - pkg-config - copyDesktopItems - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + pkg-config + copyDesktopItems + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ wayland diff --git a/pkgs/by-name/an/anydesk/package.nix b/pkgs/by-name/an/anydesk/package.nix index c5901a1806b7..274f726d5ba6 100644 --- a/pkgs/by-name/an/anydesk/package.nix +++ b/pkgs/by-name/an/anydesk/package.nix @@ -44,43 +44,42 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-qE49rV/QPYkbyAppDML/n6brzmiA93w47bDOwiKDuUo="; }; - buildInputs = - [ - atk - cairo - gdk-pixbuf - glib - gtk3 - dbus - harfbuzz - libz - stdenv.cc.cc - pango - libGLU - libGL - minizip - freetype - fontconfig - polkit - polkit_gnome - pulseaudio - ] - ++ (with xorg; [ - libxcb - libxkbfile - libX11 - libXdamage - libXext - libXfixes - libXi - libXmu - libXrandr - libXtst - libXt - libICE - libSM - libXrender - ]); + buildInputs = [ + atk + cairo + gdk-pixbuf + glib + gtk3 + dbus + harfbuzz + libz + stdenv.cc.cc + pango + libGLU + libGL + minizip + freetype + fontconfig + polkit + polkit_gnome + pulseaudio + ] + ++ (with xorg; [ + libxcb + libxkbfile + libX11 + libXdamage + libXext + libXfixes + libXi + libXmu + libXrandr + libXtst + libXt + libICE + libSM + libXrender + ]); nativeBuildInputs = [ copyDesktopItems diff --git a/pkgs/by-name/ap/apache-airflow/python-package.nix b/pkgs/by-name/ap/apache-airflow/python-package.nix index 3dcf950f02c5..93f1369d6b71 100644 --- a/pkgs/by-name/ap/apache-airflow/python-package.nix +++ b/pkgs/by-name/ap/apache-airflow/python-package.nix @@ -152,82 +152,81 @@ buildPythonPackage rec { disabled = pythonOlder "3.7"; - propagatedBuildInputs = - [ - alembic - argcomplete - asgiref - attrs - blinker - cached-property - cattrs - clickclick - colorlog - configupdater - connexion - cron-descriptor - croniter - cryptography - deprecated - dill - flask - flask-appbuilder - flask-caching - flask-session - flask-wtf - flask-login - gitpython - google-re2 - graphviz - gunicorn - httpx - iso8601 - importlib-resources - inflection - itsdangerous - jinja2 - jsonschema - lazy-object-proxy - linkify-it-py - lockfile - markdown - markupsafe - marshmallow-oneofschema - mdit-py-plugins - numpy - openapi-spec-validator - opentelemetry-api - opentelemetry-exporter-otlp - pandas - pathspec - pendulum - psutil - pydantic - pygments - pyjwt - python-daemon - python-dateutil - python-nvd3 - python-slugify - python3-openid - pyyaml - rich - rich-argparse - setproctitle - sqlalchemy - sqlalchemy-jsonfield - swagger-ui-bundle - tabulate - tenacity - termcolor - typing-extensions - unicodecsv - werkzeug - ] - ++ lib.optionals (pythonOlder "3.9") [ - importlib-metadata - ] - ++ providerDependencies; + propagatedBuildInputs = [ + alembic + argcomplete + asgiref + attrs + blinker + cached-property + cattrs + clickclick + colorlog + configupdater + connexion + cron-descriptor + croniter + cryptography + deprecated + dill + flask + flask-appbuilder + flask-caching + flask-session + flask-wtf + flask-login + gitpython + google-re2 + graphviz + gunicorn + httpx + iso8601 + importlib-resources + inflection + itsdangerous + jinja2 + jsonschema + lazy-object-proxy + linkify-it-py + lockfile + markdown + markupsafe + marshmallow-oneofschema + mdit-py-plugins + numpy + openapi-spec-validator + opentelemetry-api + opentelemetry-exporter-otlp + pandas + pathspec + pendulum + psutil + pydantic + pygments + pyjwt + python-daemon + python-dateutil + python-nvd3 + python-slugify + python3-openid + pyyaml + rich + rich-argparse + setproctitle + sqlalchemy + sqlalchemy-jsonfield + swagger-ui-bundle + tabulate + tenacity + termcolor + typing-extensions + unicodecsv + werkzeug + ] + ++ lib.optionals (pythonOlder "3.9") [ + importlib-metadata + ] + ++ providerDependencies; buildInputs = [ airflow-frontend @@ -245,17 +244,16 @@ buildPythonPackage rec { # above INSTALL_PROVIDERS_FROM_SOURCES = "true"; - postPatch = - '' - # https://github.com/apache/airflow/issues/33854 - substituteInPlace pyproject.toml \ - --replace '[project]' $'[project]\nname = "apache-airflow"\nversion = "${version}"' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Fix failing test on Hydra - substituteInPlace airflow/utils/db.py \ - --replace "/tmp/sqlite_default.db" "$TMPDIR/sqlite_default.db" - ''; + postPatch = '' + # https://github.com/apache/airflow/issues/33854 + substituteInPlace pyproject.toml \ + --replace '[project]' $'[project]\nname = "apache-airflow"\nversion = "${version}"' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Fix failing test on Hydra + substituteInPlace airflow/utils/db.py \ + --replace "/tmp/sqlite_default.db" "$TMPDIR/sqlite_default.db" + ''; pythonRelaxDeps = [ "colorlog" @@ -277,7 +275,8 @@ buildPythonPackage rec { pythonImportsCheck = [ "airflow" - ] ++ providerImports; + ] + ++ providerImports; preCheck = '' export AIRFLOW_HOME=$HOME diff --git a/pkgs/by-name/ap/apache-orc/package.nix b/pkgs/by-name/ap/apache-orc/package.nix index d48b2dfaee33..344a867dea46 100644 --- a/pkgs/by-name/ap/apache-orc/package.nix +++ b/pkgs/by-name/ap/apache-orc/package.nix @@ -44,20 +44,19 @@ stdenv.mkDerivation (finalAttrs: { zstd ]; - cmakeFlags = - [ - (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") - (lib.cmakeBool "BUILD_JAVA" false) - (lib.cmakeBool "STOP_BUILD_ON_WARNING" true) - (lib.cmakeBool "INSTALL_VENDORED_LIBS" false) - ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ - # Fix (RiscV) cross-compilation - # See https://github.com/apache/orc/issues/2334 - (lib.cmakeFeature "HAS_PRE_1970_EXITCODE" "0") - (lib.cmakeFeature "HAS_POST_2038_EXITCODE" "0") - (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Wno-unused-parameter") - ]; + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") + (lib.cmakeBool "BUILD_JAVA" false) + (lib.cmakeBool "STOP_BUILD_ON_WARNING" true) + (lib.cmakeBool "INSTALL_VENDORED_LIBS" false) + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + # Fix (RiscV) cross-compilation + # See https://github.com/apache/orc/issues/2334 + (lib.cmakeFeature "HAS_PRE_1970_EXITCODE" "0") + (lib.cmakeFeature "HAS_POST_2038_EXITCODE" "0") + (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Wno-unused-parameter") + ]; env = { GTEST_HOME = gtest.dev; diff --git a/pkgs/by-name/ap/apbs/package.nix b/pkgs/by-name/ap/apbs/package.nix index ef3affff4068..db801d5ad865 100644 --- a/pkgs/by-name/ap/apbs/package.nix +++ b/pkgs/by-name/ap/apbs/package.nix @@ -76,16 +76,15 @@ stdenv.mkDerivation (finalAttrs: { cmake ]; - buildInputs = - [ - fetk - suitesparse - blas - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libintl - ]; + buildInputs = [ + fetk + suitesparse + blas + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libintl + ]; cmakeFlags = [ "-DPYTHON_VERSION=${python3.version}" diff --git a/pkgs/by-name/ap/apcupsd/package.nix b/pkgs/by-name/ap/apcupsd/package.nix index 2c04890a04b3..aba4a4a1b9bd 100644 --- a/pkgs/by-name/ap/apcupsd/package.nix +++ b/pkgs/by-name/ap/apcupsd/package.nix @@ -38,20 +38,19 @@ stdenv.mkDerivation rec { libusb-compat-0_1 ]; - prePatch = - '' - sed -e "s,\$(INSTALL_PROGRAM) \$(STRIP),\$(INSTALL_PROGRAM)," \ - -i ./src/apcagent/Makefile ./autoconf/targets.mak - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/apcagent/Makefile \ - --replace-fail "Applications" "$out/Applications" - substituteInPlace include/libusb.h.in \ - --replace-fail "@LIBUSBH@" "${libusb-compat-0_1.dev}/include/usb.h" - substituteInPlace platforms/darwin/Makefile \ - --replace-fail "/Library/LaunchDaemons" "$out/Library/LaunchDaemons" \ - --replace-fail "/System/Library/Extensions" "$out/System/Library/Extensions" - ''; + prePatch = '' + sed -e "s,\$(INSTALL_PROGRAM) \$(STRIP),\$(INSTALL_PROGRAM)," \ + -i ./src/apcagent/Makefile ./autoconf/targets.mak + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/apcagent/Makefile \ + --replace-fail "Applications" "$out/Applications" + substituteInPlace include/libusb.h.in \ + --replace-fail "@LIBUSBH@" "${libusb-compat-0_1.dev}/include/usb.h" + substituteInPlace platforms/darwin/Makefile \ + --replace-fail "/Library/LaunchDaemons" "$out/Library/LaunchDaemons" \ + --replace-fail "/System/Library/Extensions" "$out/System/Library/Extensions" + ''; preConfigure = '' sed -i 's|/bin/cat|${coreutils}/bin/cat|' configure @@ -59,33 +58,32 @@ stdenv.mkDerivation rec { # ./configure ignores --prefix, so we must specify some paths manually # There is no real reason for a bin/sbin split, so just use bin. - configureFlags = - [ - "--bindir=${placeholder "out"}/bin" - "--sbindir=${placeholder "out"}/bin" - "--sysconfdir=${placeholder "out"}/etc/apcupsd" - "--mandir=${placeholder "out"}/share/man" - "--with-halpolicydir=${placeholder "out"}/share/halpolicy" - "--localstatedir=/var" - "--with-nologin=/run" - "--with-log-dir=/var/log/apcupsd" - "--with-pwrfail-dir=/run/apcupsd" - "--with-lock-dir=/run/lock" - "--with-pid-dir=/run" - "--enable-usb" - "ac_cv_path_WALL=${wall}/bin/wall" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "ac_cv_path_SHUTDOWN=${systemd}/sbin/shutdown" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "ac_cv_path_SHUTDOWN=/sbin/shutdown" - "ac_cv_func_which_gethostbyname_r=no" - ] - ++ lib.optionals enableCgiScripts [ - "--enable-cgi" - "--with-cgi-bin=${placeholder "out"}/libexec/cgi-bin" - ]; + configureFlags = [ + "--bindir=${placeholder "out"}/bin" + "--sbindir=${placeholder "out"}/bin" + "--sysconfdir=${placeholder "out"}/etc/apcupsd" + "--mandir=${placeholder "out"}/share/man" + "--with-halpolicydir=${placeholder "out"}/share/halpolicy" + "--localstatedir=/var" + "--with-nologin=/run" + "--with-log-dir=/var/log/apcupsd" + "--with-pwrfail-dir=/run/apcupsd" + "--with-lock-dir=/run/lock" + "--with-pid-dir=/run" + "--enable-usb" + "ac_cv_path_WALL=${wall}/bin/wall" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "ac_cv_path_SHUTDOWN=${systemd}/sbin/shutdown" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "ac_cv_path_SHUTDOWN=/sbin/shutdown" + "ac_cv_func_which_gethostbyname_r=no" + ] + ++ lib.optionals enableCgiScripts [ + "--enable-cgi" + "--with-cgi-bin=${placeholder "out"}/libexec/cgi-bin" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ap/apfs-fuse/package.nix b/pkgs/by-name/ap/apfs-fuse/package.nix index 279c6a3e62de..a7a3ec534c00 100644 --- a/pkgs/by-name/ap/apfs-fuse/package.nix +++ b/pkgs/by-name/ap/apfs-fuse/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation { (if stdenv.hostPlatform.isDarwin then fuse else fuse3) bzip2 zlib - ] ++ lib.optional stdenv.hostPlatform.isLinux attr; + ] + ++ lib.optional stdenv.hostPlatform.isLinux attr; cmakeFlags = lib.optional stdenv.hostPlatform.isDarwin "-DUSE_FUSE3=OFF"; diff --git a/pkgs/by-name/ap/apkeditor/package.nix b/pkgs/by-name/ap/apkeditor/package.nix index 19a8a983dcbe..04f1d608a952 100644 --- a/pkgs/by-name/ap/apkeditor/package.nix +++ b/pkgs/by-name/ap/apkeditor/package.nix @@ -40,7 +40,8 @@ let fromSource binaryBytecode # mitm cache ]; - } // args.meta; + } + // args.meta; } ); in diff --git a/pkgs/by-name/ap/apostrophe/package.nix b/pkgs/by-name/ap/apostrophe/package.nix index 195e72ef6857..1d63ca61b2ce 100644 --- a/pkgs/by-name/ap/apostrophe/package.nix +++ b/pkgs/by-name/ap/apostrophe/package.nix @@ -48,18 +48,17 @@ python312Packages.buildPythonApplication { pname = "apostrophe"; pyproject = false; - postPatch = - '' - substituteInPlace build-aux/meson_post_install.py \ - --replace-fail 'gtk-update-icon-cache' 'gtk4-update-icon-cache' + postPatch = '' + substituteInPlace build-aux/meson_post_install.py \ + --replace-fail 'gtk-update-icon-cache' 'gtk4-update-icon-cache' - patchShebangs --build build-aux/meson_post_install.py - '' - # Use mathjax from nixpkgs to avoid loading from CDN - + '' - substituteInPlace apostrophe/preview_converter.py \ - --replace-fail "--mathjax" "--mathjax=file://${nodePackages.mathjax}/lib/node_modules/mathjax/es5/tex-chtml-full.js" - ''; + patchShebangs --build build-aux/meson_post_install.py + '' + # Use mathjax from nixpkgs to avoid loading from CDN + + '' + substituteInPlace apostrophe/preview_converter.py \ + --replace-fail "--mathjax" "--mathjax=file://${nodePackages.mathjax}/lib/node_modules/mathjax/es5/tex-chtml-full.js" + ''; # Should be done in postInstall, but meson checks this eagerly before build preConfigure = '' diff --git a/pkgs/by-name/ap/apparmor-parser/package.nix b/pkgs/by-name/ap/apparmor-parser/package.nix index 2199423a37be..aa21b93bf592 100644 --- a/pkgs/by-name/ap/apparmor-parser/package.nix +++ b/pkgs/by-name/ap/apparmor-parser/package.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation (finalAttrs: { "POD2MAN=${lib.getExe' buildPackages.perl "pod2man"}" "POD2HTML=${lib.getExe' buildPackages.perl "pod2html"}" "MANDIR=share/man" - ] ++ lib.optional finalAttrs.doCheck "PROVE=${lib.getExe' perl "prove"}"; + ] + ++ lib.optional finalAttrs.doCheck "PROVE=${lib.getExe' perl "prove"}"; installFlags = [ "DESTDIR=$(out)" diff --git a/pkgs/by-name/ap/apparmor-utils/package.nix b/pkgs/by-name/ap/apparmor-utils/package.nix index 06e773dcc5f9..62cb71d218f5 100644 --- a/pkgs/by-name/ap/apparmor-utils/package.nix +++ b/pkgs/by-name/ap/apparmor-utils/package.nix @@ -20,21 +20,20 @@ python3Packages.buildPythonApplication { pname = "apparmor-utils"; inherit (libapparmor) version src; - postPatch = - '' - patchShebangs . - cd utils + postPatch = '' + patchShebangs . + cd utils - substituteInPlace aa-remove-unknown \ - --replace-fail "/lib/apparmor/rc.apparmor.functions" "${apparmor-parser}/lib/apparmor/rc.apparmor.functions" - substituteInPlace Makefile \ - --replace-fail "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h" - sed -i -E 's/^(DESTDIR|BINDIR|PYPREFIX)=.*//g' Makefile - sed -i aa-unconfined -e "/my_env\['PATH'\]/d" - '' - + (lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i Makefile -e "/\/d" - ''); + substituteInPlace aa-remove-unknown \ + --replace-fail "/lib/apparmor/rc.apparmor.functions" "${apparmor-parser}/lib/apparmor/rc.apparmor.functions" + substituteInPlace Makefile \ + --replace-fail "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h" + sed -i -E 's/^(DESTDIR|BINDIR|PYPREFIX)=.*//g' Makefile + sed -i aa-unconfined -e "/my_env\['PATH'\]/d" + '' + + (lib.optionalString stdenv.hostPlatform.isMusl '' + sed -i Makefile -e "/\/d" + ''); format = "other"; strictDeps = true; diff --git a/pkgs/by-name/ap/appflowy/package.nix b/pkgs/by-name/ap/appflowy/package.nix index bece5b84e9a5..febc79e01d3f 100644 --- a/pkgs/by-name/ap/appflowy/package.nix +++ b/pkgs/by-name/ap/appflowy/package.nix @@ -41,7 +41,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { nativeBuildInputs = [ makeWrapper copyDesktopItems - ] ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ autoPatchelfHook ]; buildInputs = [ gtk3 diff --git a/pkgs/by-name/ap/appimageupdate/package.nix b/pkgs/by-name/ap/appimageupdate/package.nix index a39187409b4b..b0ff7b158f7e 100644 --- a/pkgs/by-name/ap/appimageupdate/package.nix +++ b/pkgs/by-name/ap/appimageupdate/package.nix @@ -44,28 +44,26 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail '' '' ''; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals withQtUI [ - qt5.wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals withQtUI [ + qt5.wrapQtAppsHook + ]; - buildInputs = - [ - zsync2 - libcpr - libgcrypt - libappimage - argagg - nlohmann_json - gpgme - ] - ++ lib.optionals withQtUI [ - qt5.qtbase - ]; + buildInputs = [ + zsync2 + libcpr + libgcrypt + libappimage + argagg + nlohmann_json + gpgme + ] + ++ lib.optionals withQtUI [ + qt5.qtbase + ]; cmakeFlags = [ (lib.cmakeBool "USE_SYSTEM_ZSYNC2" true) diff --git a/pkgs/by-name/ap/apple-sdk/common/add-core-symbolication.nix b/pkgs/by-name/ap/apple-sdk/common/add-core-symbolication.nix index ebf7bf69ca30..68704a0d4a4c 100644 --- a/pkgs/by-name/ap/apple-sdk/common/add-core-symbolication.nix +++ b/pkgs/by-name/ap/apple-sdk/common/add-core-symbolication.nix @@ -40,12 +40,10 @@ let }); in self: super: { - buildPhase = - super.buildPhase or "" - + '' - mkdir -p System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers - ln -s A System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/Current - ln -s Versions/Current/Headers System/Library/PrivateFrameworks/CoreSymbolication.framework/Headers - cp '${CoreSymbolication}/include/'*.h System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers - ''; + buildPhase = super.buildPhase or "" + '' + mkdir -p System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers + ln -s A System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/Current + ln -s Versions/Current/Headers System/Library/PrivateFrameworks/CoreSymbolication.framework/Headers + cp '${CoreSymbolication}/include/'*.h System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/Headers + ''; } diff --git a/pkgs/by-name/ap/apple-sdk/common/derivation-options.nix b/pkgs/by-name/ap/apple-sdk/common/derivation-options.nix index 361e8df0f8d1..9c99206a59e3 100644 --- a/pkgs/by-name/ap/apple-sdk/common/derivation-options.nix +++ b/pkgs/by-name/ap/apple-sdk/common/derivation-options.nix @@ -1,17 +1,13 @@ { lib, config }: self: super: { - preBuild = - super.preBuild or "" - + '' - platformPath=$out/Platforms/MacOSX.platform - sdkpath=$platformPath/Developer/SDKs - ''; + preBuild = super.preBuild or "" + '' + platformPath=$out/Platforms/MacOSX.platform + sdkpath=$platformPath/Developer/SDKs + ''; - preInstall = - super.preInstall or "" - + '' - platformPath=$out/Platforms/MacOSX.platform - sdkpath=$platformPath/Developer/SDKs - ''; + preInstall = super.preInstall or "" + '' + platformPath=$out/Platforms/MacOSX.platform + sdkpath=$platformPath/Developer/SDKs + ''; } diff --git a/pkgs/by-name/ap/apple-sdk/common/process-stubs.nix b/pkgs/by-name/ap/apple-sdk/common/process-stubs.nix index 0f87f9c326bd..28679553b7bf 100644 --- a/pkgs/by-name/ap/apple-sdk/common/process-stubs.nix +++ b/pkgs/by-name/ap/apple-sdk/common/process-stubs.nix @@ -19,40 +19,38 @@ self: super: { llvm ]; - buildPhase = - super.buildPhase or "" - + '' - echo "Removing the following dylibs from the libSystem reexported libraries list: ${lib.escapeShellArg (lib.concatStringsSep ", " removedDylibs)}" - for libSystem in libSystem.B.tbd libSystem.B_asan.tbd; do - # tbd-v5 is a JSON-based format, which can be manipulated by `jq`. - llvm-readtapi --filetype=tbd-v5 usr/lib/$libSystem \ - | jq --argjson libs ${lib.escapeShellArg (builtins.toJSON removedDylibs)} ' - if .libraries then - .libraries[] |= select(.install_names[] | any([.] | inside($libs)) | not) - else - . - end - | .main_library.reexported_libraries[].names[] |= select([.] | inside($libs) | not) - ' > usr/lib/$libSystem~ - # Convert libSystem back to tbd-v4 because not all tooling supports the JSON-based format yet. - llvm-readtapi --filetype=tbd-v4 usr/lib/$libSystem~ -o usr/lib/$libSystem - rm usr/lib/$libSystem~ - done + buildPhase = super.buildPhase or "" + '' + echo "Removing the following dylibs from the libSystem reexported libraries list: ${lib.escapeShellArg (lib.concatStringsSep ", " removedDylibs)}" + for libSystem in libSystem.B.tbd libSystem.B_asan.tbd; do + # tbd-v5 is a JSON-based format, which can be manipulated by `jq`. + llvm-readtapi --filetype=tbd-v5 usr/lib/$libSystem \ + | jq --argjson libs ${lib.escapeShellArg (builtins.toJSON removedDylibs)} ' + if .libraries then + .libraries[] |= select(.install_names[] | any([.] | inside($libs)) | not) + else + . + end + | .main_library.reexported_libraries[].names[] |= select([.] | inside($libs) | not) + ' > usr/lib/$libSystem~ + # Convert libSystem back to tbd-v4 because not all tooling supports the JSON-based format yet. + llvm-readtapi --filetype=tbd-v4 usr/lib/$libSystem~ -o usr/lib/$libSystem + rm usr/lib/$libSystem~ + done - # Strip weak C++ symbols to work around `libc++` leakage in system - # frameworks for now. These are only present on `x86_64-darwin`, so - # it should hopefully be harmless. - # - # TODO FIXME: This is kind of horrible. - while read -r -d "" stub; do - printf 'Stripping weak C++ symbols from %s\n' "$stub" - llvm-readtapi --filetype=tbd-v5 "$stub" \ - | jq ' - (.main_library, .libraries[]?).exported_symbols[]?.data.weak[]? |= - select(startswith("__Z") | not) - ' > $stub~ - llvm-readtapi --filetype=tbd-v4 $stub~ -o $stub - rm $stub~ - done < <(find . -name '*.tbd' -print0) - ''; + # Strip weak C++ symbols to work around `libc++` leakage in system + # frameworks for now. These are only present on `x86_64-darwin`, so + # it should hopefully be harmless. + # + # TODO FIXME: This is kind of horrible. + while read -r -d "" stub; do + printf 'Stripping weak C++ symbols from %s\n' "$stub" + llvm-readtapi --filetype=tbd-v5 "$stub" \ + | jq ' + (.main_library, .libraries[]?).exported_symbols[]?.data.weak[]? |= + select(startswith("__Z") | not) + ' > $stub~ + llvm-readtapi --filetype=tbd-v4 $stub~ -o $stub + rm $stub~ + done < <(find . -name '*.tbd' -print0) + ''; } diff --git a/pkgs/by-name/ap/apple-sdk/common/propagate-inputs.nix b/pkgs/by-name/ap/apple-sdk/common/propagate-inputs.nix index 668ac586cb01..fe58181980b6 100644 --- a/pkgs/by-name/ap/apple-sdk/common/propagate-inputs.nix +++ b/pkgs/by-name/ap/apple-sdk/common/propagate-inputs.nix @@ -63,11 +63,9 @@ self: super: { ++ lib.optionals stdenvNoCC.hostPlatform.isx86_64 [ darwin.Csu ]; # The Darwin module for Swift requires certain headers to be included in the SDK (and not just be propagated). - buildPhase = - super.buildPhase or "" - + '' - for header in '${lib.getDev libiconv}/include/'* '${lib.getDev ncurses}/include/'*; do - ln -s "$header" "usr/include/$(basename "$header")" - done - ''; + buildPhase = super.buildPhase or "" + '' + for header in '${lib.getDev libiconv}/include/'* '${lib.getDev ncurses}/include/'*; do + ln -s "$header" "usr/include/$(basename "$header")" + done + ''; } diff --git a/pkgs/by-name/ap/apple-sdk/common/propagate-xcrun.nix b/pkgs/by-name/ap/apple-sdk/common/propagate-xcrun.nix index 441b36698688..f993441c757e 100644 --- a/pkgs/by-name/ap/apple-sdk/common/propagate-xcrun.nix +++ b/pkgs/by-name/ap/apple-sdk/common/propagate-xcrun.nix @@ -15,36 +15,34 @@ in self: super: { propagatedNativeBuildInputs = super.propagatedNativeBuildInputs or [ ] ++ [ xcbuild.xcrun ]; - postInstall = - super.postInstall or "" - + '' - specspath=$out/Library/Xcode/Specifications - toolchainsPath=$out/Toolchains/XcodeDefault.xctoolchain - mkdir -p "$specspath" "$toolchainsPath" + postInstall = super.postInstall or "" + '' + specspath=$out/Library/Xcode/Specifications + toolchainsPath=$out/Toolchains/XcodeDefault.xctoolchain + mkdir -p "$specspath" "$toolchainsPath" - # xcbuild expects to find things relative to the plist locations. If these are linked instead of copied, - # it won’t find any platforms or SDKs. - cp '${plists."Info.plist"}' "$platformPath/Info.plist" - cp '${plists."ToolchainInfo.plist"}' "$toolchainsPath/ToolchainInfo.plist" + # xcbuild expects to find things relative to the plist locations. If these are linked instead of copied, + # it won’t find any platforms or SDKs. + cp '${plists."Info.plist"}' "$platformPath/Info.plist" + cp '${plists."ToolchainInfo.plist"}' "$toolchainsPath/ToolchainInfo.plist" - for spec in '${xcbuild}/Library/Xcode/Specifications/'*; do - ln -s "$spec" "$specspath/$(basename "$spec")" - done - cp '${plists."Architectures.xcspec"}' "$specspath/Architectures.xcspec" - cp '${plists."PackageTypes.xcspec"}' "$specspath/PackageTypes.xcspec" - cp '${plists."ProductTypes.xcspec"}' "$specspath/ProductTypes.xcspec" + for spec in '${xcbuild}/Library/Xcode/Specifications/'*; do + ln -s "$spec" "$specspath/$(basename "$spec")" + done + cp '${plists."Architectures.xcspec"}' "$specspath/Architectures.xcspec" + cp '${plists."PackageTypes.xcspec"}' "$specspath/PackageTypes.xcspec" + cp '${plists."ProductTypes.xcspec"}' "$specspath/ProductTypes.xcspec" - mkdir -p "$out/usr/bin" - ln -s '${xcbuild.xcrun}/bin/xcrun' "$out/usr/bin/xcrun" + mkdir -p "$out/usr/bin" + ln -s '${xcbuild.xcrun}/bin/xcrun' "$out/usr/bin/xcrun" - # Include `libtool` in the toolchain, so `xcrun -find libtool` can find it without requiring `cctools.libtool` - # as a `nativeBuildInput`. - mkdir -p "$toolchainsPath/usr/bin" - ln -s '${cctools.libtool}/bin/${stdenv.cc.targetPrefix}libtool' "$toolchainsPath/usr/bin/libtool" + # Include `libtool` in the toolchain, so `xcrun -find libtool` can find it without requiring `cctools.libtool` + # as a `nativeBuildInput`. + mkdir -p "$toolchainsPath/usr/bin" + ln -s '${cctools.libtool}/bin/${stdenv.cc.targetPrefix}libtool' "$toolchainsPath/usr/bin/libtool" - # Include additional binutils required by some packages (such as Chromium). - for tool in lipo nm otool size strip; do - ln -s '${darwin.binutils-unwrapped}/bin/${stdenv.cc.targetPrefix}'$tool "$toolchainsPath/usr/bin/$tool" - done - ''; + # Include additional binutils required by some packages (such as Chromium). + for tool in lipo nm otool size strip; do + ln -s '${darwin.binutils-unwrapped}/bin/${stdenv.cc.targetPrefix}'$tool "$toolchainsPath/usr/bin/$tool" + done + ''; } diff --git a/pkgs/by-name/ap/apple-sdk/common/remove-disallowed-packages.nix b/pkgs/by-name/ap/apple-sdk/common/remove-disallowed-packages.nix index e413f9289249..05bb6750c4f8 100644 --- a/pkgs/by-name/ap/apple-sdk/common/remove-disallowed-packages.nix +++ b/pkgs/by-name/ap/apple-sdk/common/remove-disallowed-packages.nix @@ -10,17 +10,15 @@ in self: super: { # Remove headers and stubs for packages that are available in nixpkgs. - buildPhase = - super.buildPhase or "" - + '' - ${lib.concatMapStringsSep "\n" ( - pkg: - lib.concatLines ( - [ ''echo "Removing headers and libraries from ${pkg.package}"'' ] - ++ (map (header: "rm -rf -- usr/include/${header}") pkg.headers or [ ]) - ++ (map (framework: "rm -rf -- System/Library/Frameworks/${framework}") pkg.frameworks or [ ]) - ++ (map (library: "rm -rf -- usr/lib/${library}") pkg.libraries or [ ]) - ) - ) disallowedPackages} - ''; + buildPhase = super.buildPhase or "" + '' + ${lib.concatMapStringsSep "\n" ( + pkg: + lib.concatLines ( + [ ''echo "Removing headers and libraries from ${pkg.package}"'' ] + ++ (map (header: "rm -rf -- usr/include/${header}") pkg.headers or [ ]) + ++ (map (framework: "rm -rf -- System/Library/Frameworks/${framework}") pkg.frameworks or [ ]) + ++ (map (library: "rm -rf -- usr/lib/${library}") pkg.libraries or [ ]) + ) + ) disallowedPackages} + ''; } diff --git a/pkgs/by-name/ap/applgrid/package.nix b/pkgs/by-name/ap/applgrid/package.nix index 1eaba97039ec..e239286c4151 100644 --- a/pkgs/by-name/ap/applgrid/package.nix +++ b/pkgs/by-name/ap/applgrid/package.nix @@ -32,15 +32,14 @@ stdenv.mkDerivation rec { zlib ]; - preConfigure = - '' - substituteInPlace src/Makefile.in \ - --replace-fail "-L\$(subst /libgfortran.a, ,\$(FRTLIB) )" "-L${gfortran.cc.lib}/lib" - '' - + (lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/Makefile.in \ - --replace-fail "gfortran -print-file-name=libgfortran.a" "gfortran -print-file-name=libgfortran.dylib" - ''); + preConfigure = '' + substituteInPlace src/Makefile.in \ + --replace-fail "-L\$(subst /libgfortran.a, ,\$(FRTLIB) )" "-L${gfortran.cc.lib}/lib" + '' + + (lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/Makefile.in \ + --replace-fail "gfortran -print-file-name=libgfortran.a" "gfortran -print-file-name=libgfortran.dylib" + ''); enableParallelBuilding = false; # broken diff --git a/pkgs/by-name/ap/aprutil/package.nix b/pkgs/by-name/ap/aprutil/package.nix index 1f23af533b76..da6da9d000a7 100644 --- a/pkgs/by-name/ap/aprutil/package.nix +++ b/pkgs/by-name/ap/aprutil/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation rec { ./fix-libxcrypt-build.patch # Fix incorrect Berkeley DB detection with newer versions of clang due to implicit `int` on main errors. ./clang-bdb.patch - ] ++ lib.optional stdenv.hostPlatform.isFreeBSD ./include-static-dependencies.patch; + ] + ++ lib.optional stdenv.hostPlatform.isFreeBSD ./include-static-dependencies.patch; NIX_CFLAGS_LINK = [ "-lcrypt" ]; @@ -50,50 +51,47 @@ stdenv.mkDerivation rec { autoreconfHook ]; - configureFlags = - [ - "--with-apr=${apr.dev}" - "--with-expat=${expat.dev}" - ] - ++ lib.optional (!stdenv.hostPlatform.isCygwin) "--with-crypto" - ++ lib.optional sslSupport "--with-openssl=${openssl.dev}" - ++ lib.optional bdbSupport "--with-berkeley-db=${db.dev}" - ++ lib.optional ldapSupport "--with-ldap=ldap" - ++ lib.optionals stdenv.hostPlatform.isCygwin [ - "--without-pgsql" - "--without-sqlite2" - "--without-sqlite3" - "--without-freetds" - "--without-berkeley-db" - "--without-crypto" - ]; + configureFlags = [ + "--with-apr=${apr.dev}" + "--with-expat=${expat.dev}" + ] + ++ lib.optional (!stdenv.hostPlatform.isCygwin) "--with-crypto" + ++ lib.optional sslSupport "--with-openssl=${openssl.dev}" + ++ lib.optional bdbSupport "--with-berkeley-db=${db.dev}" + ++ lib.optional ldapSupport "--with-ldap=ldap" + ++ lib.optionals stdenv.hostPlatform.isCygwin [ + "--without-pgsql" + "--without-sqlite2" + "--without-sqlite3" + "--without-freetds" + "--without-berkeley-db" + "--without-crypto" + ]; - postConfigure = - '' - echo '#define APR_HAVE_CRYPT_H 1' >> confdefs.h - '' - + - # For some reason, db version 6.9 is selected when cross-compiling. - # It's unclear as to why, it requires someone with more autotools / configure knowledge to go deeper into that. - # Always replacing the link flag with a generic link flag seems to help though, so let's do that for now. - lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - substituteInPlace Makefile \ - --replace "-ldb-6.9" "-ldb" - substituteInPlace apu-1-config \ - --replace "-ldb-6.9" "-ldb" - ''; + postConfigure = '' + echo '#define APR_HAVE_CRYPT_H 1' >> confdefs.h + '' + + + # For some reason, db version 6.9 is selected when cross-compiling. + # It's unclear as to why, it requires someone with more autotools / configure knowledge to go deeper into that. + # Always replacing the link flag with a generic link flag seems to help though, so let's do that for now. + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + substituteInPlace Makefile \ + --replace "-ldb-6.9" "-ldb" + substituteInPlace apu-1-config \ + --replace "-ldb-6.9" "-ldb" + ''; - propagatedBuildInputs = - [ - apr - expat - libiconv - libxcrypt - ] - ++ lib.optional sslSupport openssl - ++ lib.optional bdbSupport db - ++ lib.optional ldapSupport openldap - ++ lib.optional stdenv.hostPlatform.isFreeBSD cyrus_sasl; + propagatedBuildInputs = [ + apr + expat + libiconv + libxcrypt + ] + ++ lib.optional sslSupport openssl + ++ lib.optional bdbSupport db + ++ lib.optional ldapSupport openldap + ++ lib.optional stdenv.hostPlatform.isFreeBSD cyrus_sasl; postInstall = '' for f in $out/lib/*.la $out/lib/apr-util-1/*.la $dev/bin/apu-1-config; do diff --git a/pkgs/by-name/ap/apt/package.nix b/pkgs/by-name/ap/apt/package.nix index 0e7f33d3ba14..671c638f2724 100644 --- a/pkgs/by-name/ap/apt/package.nix +++ b/pkgs/by-name/ap/apt/package.nix @@ -52,46 +52,44 @@ stdenv.mkDerivation (finalAttrs: { "man" ]; - nativeBuildInputs = - [ - cmake - dpkg # dpkg-architecture - gettext # msgfmt - gtest - (lib.getBin libxslt) - pkg-config - triehash - perlPackages.perl - ] - ++ lib.optionals withDocs [ - docbook_xml_dtd_45 - doxygen - perlPackages.Po4a - w3m - ]; + nativeBuildInputs = [ + cmake + dpkg # dpkg-architecture + gettext # msgfmt + gtest + (lib.getBin libxslt) + pkg-config + triehash + perlPackages.perl + ] + ++ lib.optionals withDocs [ + docbook_xml_dtd_45 + doxygen + perlPackages.Po4a + w3m + ]; - buildInputs = - [ - bzip2 - curl - db - dpkg - gnutls - gtest - libgcrypt - libgpg-error - libseccomp - libtasn1 - lz4 - p11-kit - udev - xxHash - xz - zstd - ] - ++ lib.optionals withNLS [ - gettext - ]; + buildInputs = [ + bzip2 + curl + db + dpkg + gnutls + gtest + libgcrypt + libgpg-error + libseccomp + libtasn1 + lz4 + p11-kit + udev + xxHash + xz + zstd + ] + ++ lib.optionals withNLS [ + gettext + ]; cmakeFlags = [ (lib.cmakeOptionType "filepath" "BERKELEY_INCLUDE_DIRS" "${lib.getDev db}/include") diff --git a/pkgs/by-name/ar/arangodb/package.nix b/pkgs/by-name/ar/arangodb/package.nix index 79dcbc11e400..8afc588a967e 100644 --- a/pkgs/by-name/ar/arangodb/package.nix +++ b/pkgs/by-name/ar/arangodb/package.nix @@ -69,18 +69,17 @@ gcc10Stdenv.mkDerivation rec { cmakeBuildType = "RelWithDebInfo"; - cmakeFlags = - [ - "-DUSE_MAINTAINER_MODE=OFF" - "-DUSE_GOOGLE_TESTS=OFF" + cmakeFlags = [ + "-DUSE_MAINTAINER_MODE=OFF" + "-DUSE_GOOGLE_TESTS=OFF" - # avoid reading /proc/cpuinfo for feature detection - "-DTARGET_ARCHITECTURE=${targetArch}" - ] - ++ lib.optionals asmOptimizations [ - "-DASM_OPTIMIZATIONS=ON" - "-DHAVE_SSE42=${if gcc10Stdenv.hostPlatform.sse4_2Support then "ON" else "OFF"}" - ]; + # avoid reading /proc/cpuinfo for feature detection + "-DTARGET_ARCHITECTURE=${targetArch}" + ] + ++ lib.optionals asmOptimizations [ + "-DASM_OPTIMIZATIONS=ON" + "-DHAVE_SSE42=${if gcc10Stdenv.hostPlatform.sse4_2Support then "ON" else "OFF"}" + ]; meta = with lib; { homepage = "https://www.arangodb.com"; diff --git a/pkgs/by-name/ar/aravis/package.nix b/pkgs/by-name/ar/aravis/package.nix index a16eb1fb6600..fa458868a498 100644 --- a/pkgs/by-name/ar/aravis/package.nix +++ b/pkgs/by-name/ar/aravis/package.nix @@ -52,33 +52,32 @@ stdenv.mkDerivation rec { pkg-config gi-docgen gobject-introspection - ] ++ lib.optional enableViewer wrapGAppsHook3; + ] + ++ lib.optional enableViewer wrapGAppsHook3; - buildInputs = + buildInputs = [ + glib + libxml2 + ] + ++ lib.optional enableUsb libusb1 + ++ lib.optionals (enableViewer || enableGstPlugin) ( + with gst_all_1; [ - glib - libxml2 + gstreamer + gst-plugins-base + (gst-plugins-good.override { gtkSupport = true; }) + gst-plugins-bad ] - ++ lib.optional enableUsb libusb1 - ++ lib.optionals (enableViewer || enableGstPlugin) ( - with gst_all_1; - [ - gstreamer - gst-plugins-base - (gst-plugins-good.override { gtkSupport = true; }) - gst-plugins-bad - ] - ) - ++ lib.optionals (enableViewer) [ gtk3 ]; + ) + ++ lib.optionals (enableViewer) [ gtk3 ]; - mesonFlags = - [ - ] - ++ lib.optional enableFastHeartbeat "-Dfast-heartbeat=enabled" - ++ lib.optional (!enableGstPlugin) "-Dgst-plugin=disabled" - ++ lib.optional (!enableViewer) "-Dviewer=disabled" - ++ lib.optional (!enableUsb) "-Dviewer=disabled" - ++ lib.optional (!enablePacketSocket) "-Dpacket-socket=disabled"; + mesonFlags = [ + ] + ++ lib.optional enableFastHeartbeat "-Dfast-heartbeat=enabled" + ++ lib.optional (!enableGstPlugin) "-Dgst-plugin=disabled" + ++ lib.optional (!enableViewer) "-Dviewer=disabled" + ++ lib.optional (!enableUsb) "-Dviewer=disabled" + ++ lib.optional (!enablePacketSocket) "-Dpacket-socket=disabled"; doCheck = true; diff --git a/pkgs/by-name/ar/arcan/package.nix b/pkgs/by-name/ar/arcan/package.nix index acff817af09b..6c0b6a8ef9b0 100644 --- a/pkgs/by-name/ar/arcan/package.nix +++ b/pkgs/by-name/ar/arcan/package.nix @@ -75,7 +75,8 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper pkg-config wayland-scanner - ] ++ lib.optionals buildManPages [ ruby ]; + ] + ++ lib.optionals buildManPages [ ruby ]; buildInputs = [ SDL2 @@ -115,7 +116,8 @@ stdenv.mkDerivation (finalAttrs: { xcbutil xcbutilwm xz - ] ++ lib.optionals useEspeak [ espeak-ng ]; + ] + ++ lib.optionals useEspeak [ espeak-ng ]; cmakeFlags = [ # The upstream project recommends tagging the distribution diff --git a/pkgs/by-name/ar/archi/package.nix b/pkgs/by-name/ar/archi/package.nix index 5d3bc9a91c8d..f65360f2afad 100644 --- a/pkgs/by-name/ar/archi/package.nix +++ b/pkgs/by-name/ar/archi/package.nix @@ -40,18 +40,17 @@ stdenv.mkDerivation rec { libsecret ]; - nativeBuildInputs = - [ - makeWrapper - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - _7zz - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - copyDesktopItems - ]; + nativeBuildInputs = [ + makeWrapper + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + _7zz + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + copyDesktopItems + ]; sourceRoot = if stdenv.hostPlatform.isDarwin then "." else null; diff --git a/pkgs/by-name/ar/archivebox/package.nix b/pkgs/by-name/ar/archivebox/package.nix index bb222095da26..4ea2b56a7217 100644 --- a/pkgs/by-name/ar/archivebox/package.nix +++ b/pkgs/by-name/ar/archivebox/package.nix @@ -85,28 +85,27 @@ python.pkgs.buildPythonApplication rec { yt-dlp ]; - makeWrapperArgs = - [ - "--set USE_NODE True" # used through dependencies, not needed explicitly - "--set READABILITY_BINARY ${lib.meta.getExe readability-extractor}" - "--set MERCURY_BINARY ${lib.meta.getExe postlight-parser}" - "--set CURL_BINARY ${lib.meta.getExe curl}" - "--set RIPGREP_BINARY ${lib.meta.getExe ripgrep}" - "--set WGET_BINARY ${lib.meta.getExe wget}" - "--set GIT_BINARY ${lib.meta.getExe git}" - "--set YOUTUBEDL_BINARY ${lib.meta.getExe python.pkgs.yt-dlp}" - "--set SINGLEFILE_BINARY ${lib.meta.getExe single-file-cli}" - ] - ++ ( - if (lib.meta.availableOn stdenv.hostPlatform chromium) then - [ - "--set CHROME_BINARY ${chromium}/bin/chromium-browser" - ] - else - [ - "--set-default USE_CHROME False" - ] - ); + makeWrapperArgs = [ + "--set USE_NODE True" # used through dependencies, not needed explicitly + "--set READABILITY_BINARY ${lib.meta.getExe readability-extractor}" + "--set MERCURY_BINARY ${lib.meta.getExe postlight-parser}" + "--set CURL_BINARY ${lib.meta.getExe curl}" + "--set RIPGREP_BINARY ${lib.meta.getExe ripgrep}" + "--set WGET_BINARY ${lib.meta.getExe wget}" + "--set GIT_BINARY ${lib.meta.getExe git}" + "--set YOUTUBEDL_BINARY ${lib.meta.getExe python.pkgs.yt-dlp}" + "--set SINGLEFILE_BINARY ${lib.meta.getExe single-file-cli}" + ] + ++ ( + if (lib.meta.availableOn stdenv.hostPlatform chromium) then + [ + "--set CHROME_BINARY ${chromium}/bin/chromium-browser" + ] + else + [ + "--set-default USE_CHROME False" + ] + ); meta = with lib; { description = "Open source self-hosted web archiving"; diff --git a/pkgs/by-name/ar/arduino-cli/package.nix b/pkgs/by-name/ar/arduino-cli/package.nix index d1023f24e958..ab7c7eaa85c2 100644 --- a/pkgs/by-name/ar/arduino-cli/package.nix +++ b/pkgs/by-name/ar/arduino-cli/package.nix @@ -60,7 +60,8 @@ let "-w" "-X github.com/arduino/arduino-cli/internal/version.versionString=${version}" "-X github.com/arduino/arduino-cli/internal/version.commit=unknown" - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "-extldflags '-static'" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "-extldflags '-static'" ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' export HOME="$(mktemp -d)" diff --git a/pkgs/by-name/ar/arduino-language-server/package.nix b/pkgs/by-name/ar/arduino-language-server/package.nix index 0c78013478a4..8d9632bfd289 100644 --- a/pkgs/by-name/ar/arduino-language-server/package.nix +++ b/pkgs/by-name/ar/arduino-language-server/package.nix @@ -22,16 +22,15 @@ buildGoModule rec { doCheck = false; - ldflags = - [ - "-s" - "-w" - "-X github.com/arduino/arduino-language-server/version.versionString=${version}" - "-X github.com/arduino/arduino-language-server/version.commit=unknown" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-extldflags '-static'" - ]; + ldflags = [ + "-s" + "-w" + "-X github.com/arduino/arduino-language-server/version.versionString=${version}" + "-X github.com/arduino/arduino-language-server/version.commit=unknown" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-extldflags '-static'" + ]; meta = { description = "Arduino Language Server based on Clangd to Arduino code autocompletion"; diff --git a/pkgs/by-name/ar/ares/package.nix b/pkgs/by-name/ar/ares/package.nix index 48a80bbf01b1..49889b2ee150 100644 --- a/pkgs/by-name/ar/ares/package.nix +++ b/pkgs/by-name/ar/ares/package.nix @@ -38,40 +38,38 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-es+K5+qlK7FcJCFEIMcOsXCZSnoXEEmtS0yhpCvaILM"; }; - nativeBuildInputs = - [ - cmake - ninja - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wrapGAppsHook3 + ]; - buildInputs = - [ - sdl3 - libao - librashader - vulkan-loader - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_14 - moltenvk - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - gtk3 - gtksourceview3 - libGL - libGLU - libX11 - libXv - libpulseaudio - openal - udev - ]; + buildInputs = [ + sdl3 + libao + librashader + vulkan-loader + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_14 + moltenvk + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + gtk3 + gtksourceview3 + libGL + libGLU + libX11 + libXv + libpulseaudio + openal + udev + ]; patches = [ (replaceVars ./darwin-build-fixes.patch { diff --git a/pkgs/by-name/ar/argc/package.nix b/pkgs/by-name/ar/argc/package.nix index 709cb2c92e47..efdcf82a9080 100644 --- a/pkgs/by-name/ar/argc/package.nix +++ b/pkgs/by-name/ar/argc/package.nix @@ -39,13 +39,12 @@ rustPlatform.buildRustPackage rec { disallowedReferences = lib.optional (!canExecuteHost) buildPackages.argc; - env = - { - LANG = "C.UTF-8"; - } - // lib.optionalAttrs (glibcLocales != null) { - LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; - }; + env = { + LANG = "C.UTF-8"; + } + // lib.optionalAttrs (glibcLocales != null) { + LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; + }; passthru = { tests = { diff --git a/pkgs/by-name/ar/argon/package.nix b/pkgs/by-name/ar/argon/package.nix index 6b7dcd90abb4..6007dabb1029 100644 --- a/pkgs/by-name/ar/argon/package.nix +++ b/pkgs/by-name/ar/argon/package.nix @@ -23,13 +23,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - udev - ]; + buildInputs = [ + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + udev + ]; env = { ZSTD_SYS_USE_PKG_CONFIG = true; diff --git a/pkgs/by-name/ar/arion/package.nix b/pkgs/by-name/ar/arion/package.nix index 7cb643d72867..d6f806fbb7df 100644 --- a/pkgs/by-name/ar/arion/package.nix +++ b/pkgs/by-name/ar/arion/package.nix @@ -45,16 +45,14 @@ let # feature, but rather to make the program more robustly self- # contained. - postInstall = - o.postInstall or "" - + '' - mkdir -p $out/libexec - mv $out/bin/arion $out/libexec - makeWrapper $out/libexec/arion $out/bin/arion \ - --unset PYTHONPATH \ - --prefix PATH : ${lib.makeBinPath [ pkgs.docker-compose ]} \ - ; - ''; + postInstall = o.postInstall or "" + '' + mkdir -p $out/libexec + mv $out/bin/arion $out/libexec + makeWrapper $out/libexec/arion $out/bin/arion \ + --unset PYTHONPATH \ + --prefix PATH : ${lib.makeBinPath [ pkgs.docker-compose ]} \ + ; + ''; }; # Unpacked sources for evaluation by `eval` diff --git a/pkgs/by-name/ar/armitage/package.nix b/pkgs/by-name/ar/armitage/package.nix index de374059dfb2..91b219c024bf 100644 --- a/pkgs/by-name/ar/armitage/package.nix +++ b/pkgs/by-name/ar/armitage/package.nix @@ -75,16 +75,15 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - jdk11 - gradle - makeWrapper - copyDesktopItems - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - writeDarwinBundle - ]; + nativeBuildInputs = [ + jdk11 + gradle + makeWrapper + copyDesktopItems + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + writeDarwinBundle + ]; mitmCache = gradle.fetchDeps { inherit pname; diff --git a/pkgs/by-name/ar/arpack/package.nix b/pkgs/by-name/ar/arpack/package.nix index cbd95d6eab5a..488f5257fe87 100644 --- a/pkgs/by-name/ar/arpack/package.nix +++ b/pkgs/by-name/ar/arpack/package.nix @@ -36,18 +36,17 @@ stdenv.mkDerivation (finalAttrs: { gfortran ninja ]; - buildInputs = + buildInputs = [ + eigen + ] + ++ lib.optionals (!useAccel) ( + assert (blas.isILP64 == lapack.isILP64); [ - eigen + blas + lapack ] - ++ lib.optionals (!useAccel) ( - assert (blas.isILP64 == lapack.isILP64); - [ - blas - lapack - ] - ) - ++ lib.optional useMpi mpi; + ) + ++ lib.optional useMpi mpi; nativeCheckInputs = lib.optional useMpi mpiCheckPhaseHook; checkInputs = @@ -68,19 +67,18 @@ stdenv.mkDerivation (finalAttrs: { FFLAGS = "-ff2c -fno-second-underscore"; }; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_SHARED_LIBS" stdenv.hostPlatform.hasSharedLibraries) - (lib.cmakeBool "EIGEN" true) - (lib.cmakeBool "EXAMPLES" finalAttrs.finalPackage.doCheck) - (lib.cmakeBool "ICB" true) - (lib.cmakeBool "INTERFACE64" (!useAccel && blas.isILP64)) - (lib.cmakeBool "MPI" useMpi) - (lib.cmakeBool "TESTS" finalAttrs.finalPackage.doCheck) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DBLA_VENDOR=${if useAccel then "Apple" else "Generic"}" - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" stdenv.hostPlatform.hasSharedLibraries) + (lib.cmakeBool "EIGEN" true) + (lib.cmakeBool "EXAMPLES" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "ICB" true) + (lib.cmakeBool "INTERFACE64" (!useAccel && blas.isILP64)) + (lib.cmakeBool "MPI" useMpi) + (lib.cmakeBool "TESTS" finalAttrs.finalPackage.doCheck) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DBLA_VENDOR=${if useAccel then "Apple" else "Generic"}" + ]; passthru = { isILP64 = !useAccel && blas.isILP64; diff --git a/pkgs/by-name/ar/arrayfire/package.nix b/pkgs/by-name/ar/arrayfire/package.nix index 96a564dfe128..0cc0623a995d 100644 --- a/pkgs/by-name/ar/arrayfire/package.nix +++ b/pkgs/by-name/ar/arrayfire/package.nix @@ -107,30 +107,29 @@ stdenv.mkDerivation rec { hash = "sha256-GSUdHtvV/97RyDKy8i+ticnSlQCubGGWHg4Oo+YAr8Y="; }; - cmakeFlags = - [ - "-DBUILD_TESTING=ON" - # We do not build examples, because building tests already takes long enough... - "-DAF_BUILD_EXAMPLES=OFF" - # No need to build forge, because it's a separate package - "-DAF_BUILD_FORGE=OFF" - "-DAF_COMPUTE_LIBRARY='FFTW/LAPACK/BLAS'" - # Prevent ArrayFire from trying to download some matrices from the Internet - "-DAF_TEST_WITH_MTX_FILES=OFF" - # Have to use the header-only version, because we're not using the version - # from Nixpkgs. Otherwise, libaf.so won't be able to find the shared - # library, because ArrayFire's CMake files do not run the install step of - # spdlog. - "-DAF_WITH_SPDLOG_HEADER_ONLY=ON" - (if cpuSupport then "-DAF_BUILD_CPU=ON" else "-DAF_BUILD_CPU=OFF") - (if openclSupport then "-DAF_BUILD_OPENCL=ON" else "-DAF_BUILD_OPENCL=OFF") - (if cudaSupport then "-DAF_BUILD_CUDA=ON" else "-DAF_BUILD_CUDA=OFF") - ] - ++ lib.optionals cudaSupport [ - # ArrayFire use deprecated FindCUDA in their CMake files, so we help CMake - # locate cudatoolkit. - "-DCUDA_LIBRARIES_PATH=${cudaPackages.cudatoolkit}/lib" - ]; + cmakeFlags = [ + "-DBUILD_TESTING=ON" + # We do not build examples, because building tests already takes long enough... + "-DAF_BUILD_EXAMPLES=OFF" + # No need to build forge, because it's a separate package + "-DAF_BUILD_FORGE=OFF" + "-DAF_COMPUTE_LIBRARY='FFTW/LAPACK/BLAS'" + # Prevent ArrayFire from trying to download some matrices from the Internet + "-DAF_TEST_WITH_MTX_FILES=OFF" + # Have to use the header-only version, because we're not using the version + # from Nixpkgs. Otherwise, libaf.so won't be able to find the shared + # library, because ArrayFire's CMake files do not run the install step of + # spdlog. + "-DAF_WITH_SPDLOG_HEADER_ONLY=ON" + (if cpuSupport then "-DAF_BUILD_CPU=ON" else "-DAF_BUILD_CPU=OFF") + (if openclSupport then "-DAF_BUILD_OPENCL=ON" else "-DAF_BUILD_OPENCL=OFF") + (if cudaSupport then "-DAF_BUILD_CUDA=ON" else "-DAF_BUILD_CUDA=OFF") + ] + ++ lib.optionals cudaSupport [ + # ArrayFire use deprecated FindCUDA in their CMake files, so we help CMake + # locate cudatoolkit. + "-DCUDA_LIBRARIES_PATH=${cudaPackages.cudatoolkit}/lib" + ]; # ArrayFire have a repo with assets for the examples. Since we don't build # the examples anyway, remove the dependency on assets. @@ -199,33 +198,32 @@ stdenv.mkDerivation rec { AF_PRINT_ERRORS=1 ctest ${ctestFlags} ''; - buildInputs = - [ - blas - boost.dev - boost.out - clblast - fftw - fftwFloat - # We need fmt_9 because ArrayFire fails to compile with newer versions. - fmt_9 - forge - freeimage - gtest - lapack - libGL - ocl-icd - opencl-clhpp - span-lite - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cudatoolkit - cudaPackages.cudnn - cudaPackages.cuda_cccl - ] - ++ lib.optionals openclSupport [ - mesa - ]; + buildInputs = [ + blas + boost.dev + boost.out + clblast + fftw + fftwFloat + # We need fmt_9 because ArrayFire fails to compile with newer versions. + fmt_9 + forge + freeimage + gtest + lapack + libGL + ocl-icd + opencl-clhpp + span-lite + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cudatoolkit + cudaPackages.cudnn + cudaPackages.cuda_cccl + ] + ++ lib.optionals openclSupport [ + mesa + ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/ar/arrow-cpp/package.nix b/pkgs/by-name/ar/arrow-cpp/package.nix index 4ae15af60d36..afc3879f6ad6 100644 --- a/pkgs/by-name/ar/arrow-cpp/package.nix +++ b/pkgs/by-name/ar/arrow-cpp/package.nix @@ -131,46 +131,46 @@ stdenv.mkDerivation (finalAttrs: { ninja autoconf # for vendored jemalloc flatbuffers - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = - [ - apache-orc - boost - brotli - bzip2 - flatbuffers - gflags - glog - gtest - libbacktrace - lz4 - nlohmann_json # alternative JSON parser to rapidjson - protobuf # substrait requires protobuf - rapidjson - re2 - snappy - thrift - utf8proc - zlib - zstd - ] - ++ lib.optionals enableFlight [ - grpc - openssl - protobuf - sqlite - ] - ++ lib.optionals enableS3 [ - aws-sdk-cpp-arrow - openssl - ] - ++ lib.optionals enableGcs [ - crc32c - curl - google-cloud-cpp - grpc - nlohmann_json - ]; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + buildInputs = [ + apache-orc + boost + brotli + bzip2 + flatbuffers + gflags + glog + gtest + libbacktrace + lz4 + nlohmann_json # alternative JSON parser to rapidjson + protobuf # substrait requires protobuf + rapidjson + re2 + snappy + thrift + utf8proc + zlib + zstd + ] + ++ lib.optionals enableFlight [ + grpc + openssl + protobuf + sqlite + ] + ++ lib.optionals enableS3 [ + aws-sdk-cpp-arrow + openssl + ] + ++ lib.optionals enableGcs [ + crc32c + curl + google-cloud-cpp + grpc + nlohmann_json + ]; # apache-orc looks for things in caps env = { @@ -184,58 +184,57 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail 'discover_tz_dir();' '"${tzdata}/share/zoneinfo";' ''; - cmakeFlags = - [ - "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON" - "-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}" - "-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}" - "-DARROW_BUILD_TESTS=${if enableShared then "ON" else "OFF"}" - "-DARROW_BUILD_INTEGRATION=ON" - "-DARROW_BUILD_UTILITIES=ON" - "-DARROW_EXTRA_ERROR_CONTEXT=ON" - "-DARROW_VERBOSE_THIRDPARTY_BUILD=ON" - "-DARROW_DEPENDENCY_SOURCE=SYSTEM" - "-Dxsimd_SOURCE=AUTO" - "-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}" - "-DARROW_COMPUTE=ON" - "-DARROW_CSV=ON" - "-DARROW_DATASET=ON" - "-DARROW_FILESYSTEM=ON" - "-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}" - "-DARROW_HDFS=ON" - "-DARROW_IPC=ON" - "-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}" - "-DARROW_JSON=ON" - "-DARROW_USE_GLOG=ON" - "-DARROW_WITH_BACKTRACE=ON" - "-DARROW_WITH_BROTLI=ON" - "-DARROW_WITH_BZ2=ON" - "-DARROW_WITH_LZ4=ON" - "-DARROW_WITH_NLOHMANN_JSON=ON" - "-DARROW_WITH_SNAPPY=ON" - "-DARROW_WITH_UTF8PROC=ON" - "-DARROW_WITH_ZLIB=ON" - "-DARROW_WITH_ZSTD=ON" - "-DARROW_MIMALLOC=ON" - "-DARROW_SUBSTRAIT=ON" - "-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}" - "-DARROW_FLIGHT_TESTING=${if enableFlight then "ON" else "OFF"}" - "-DARROW_S3=${if enableS3 then "ON" else "OFF"}" - "-DARROW_GCS=${if enableGcs then "ON" else "OFF"}" - "-DARROW_ORC=ON" - # Parquet options: - "-DARROW_PARQUET=ON" - "-DPARQUET_BUILD_EXECUTABLES=ON" - "-DPARQUET_REQUIRE_ENCRYPTION=ON" - ] - ++ lib.optionals (!enableShared) [ "-DARROW_TEST_LINKAGE=static" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables - ] - ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "-DARROW_USE_SIMD=OFF" ] - ++ lib.optionals enableS3 [ - "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp-arrow}/include/aws/core/Aws.h" - ]; + cmakeFlags = [ + "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON" + "-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}" + "-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}" + "-DARROW_BUILD_TESTS=${if enableShared then "ON" else "OFF"}" + "-DARROW_BUILD_INTEGRATION=ON" + "-DARROW_BUILD_UTILITIES=ON" + "-DARROW_EXTRA_ERROR_CONTEXT=ON" + "-DARROW_VERBOSE_THIRDPARTY_BUILD=ON" + "-DARROW_DEPENDENCY_SOURCE=SYSTEM" + "-Dxsimd_SOURCE=AUTO" + "-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}" + "-DARROW_COMPUTE=ON" + "-DARROW_CSV=ON" + "-DARROW_DATASET=ON" + "-DARROW_FILESYSTEM=ON" + "-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}" + "-DARROW_HDFS=ON" + "-DARROW_IPC=ON" + "-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}" + "-DARROW_JSON=ON" + "-DARROW_USE_GLOG=ON" + "-DARROW_WITH_BACKTRACE=ON" + "-DARROW_WITH_BROTLI=ON" + "-DARROW_WITH_BZ2=ON" + "-DARROW_WITH_LZ4=ON" + "-DARROW_WITH_NLOHMANN_JSON=ON" + "-DARROW_WITH_SNAPPY=ON" + "-DARROW_WITH_UTF8PROC=ON" + "-DARROW_WITH_ZLIB=ON" + "-DARROW_WITH_ZSTD=ON" + "-DARROW_MIMALLOC=ON" + "-DARROW_SUBSTRAIT=ON" + "-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}" + "-DARROW_FLIGHT_TESTING=${if enableFlight then "ON" else "OFF"}" + "-DARROW_S3=${if enableS3 then "ON" else "OFF"}" + "-DARROW_GCS=${if enableGcs then "ON" else "OFF"}" + "-DARROW_ORC=ON" + # Parquet options: + "-DARROW_PARQUET=ON" + "-DPARQUET_BUILD_EXECUTABLES=ON" + "-DPARQUET_REQUIRE_ENCRYPTION=ON" + ] + ++ lib.optionals (!enableShared) [ "-DARROW_TEST_LINKAGE=static" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "-DARROW_USE_SIMD=OFF" ] + ++ lib.optionals enableS3 [ + "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp-arrow}/include/aws/core/Aws.h" + ]; doInstallCheck = true; ARROW_TEST_DATA = lib.optionalString finalAttrs.doInstallCheck "${arrow-testing}/data"; @@ -270,14 +269,13 @@ stdenv.mkDerivation (finalAttrs: { __darwinAllowLocalNetworking = true; - nativeInstallCheckInputs = - [ - perl - which - sqlite - ] - ++ lib.optionals enableS3 [ minio ] - ++ lib.optionals enableFlight [ python3 ]; + nativeInstallCheckInputs = [ + perl + which + sqlite + ] + ++ lib.optionals enableS3 [ minio ] + ++ lib.optionals enableFlight [ python3 ]; installCheckPhase = let diff --git a/pkgs/by-name/as/asc-key-to-qr-code-gif/package.nix b/pkgs/by-name/as/asc-key-to-qr-code-gif/package.nix index f3fe53a3ecfa..88a247debc2e 100644 --- a/pkgs/by-name/as/asc-key-to-qr-code-gif/package.nix +++ b/pkgs/by-name/as/asc-key-to-qr-code-gif/package.nix @@ -23,15 +23,14 @@ stdenvNoCC.mkDerivation { postPatch = let - substitutions = - [ - ''--replace-fail "convert" "${lib.getExe imagemagick}"'' - ''--replace-fail "qrencode" "${lib.getExe qrencode}"'' - ] - ++ lib.optionals testQR [ - ''--replace-fail "hash zbarimg" "true"'' # hash does not work on NixOS - ''--replace-fail "$(zbarimg --raw" "$(${zbar}/bin/zbarimg --raw"'' - ]; + substitutions = [ + ''--replace-fail "convert" "${lib.getExe imagemagick}"'' + ''--replace-fail "qrencode" "${lib.getExe qrencode}"'' + ] + ++ lib.optionals testQR [ + ''--replace-fail "hash zbarimg" "true"'' # hash does not work on NixOS + ''--replace-fail "$(zbarimg --raw" "$(${zbar}/bin/zbarimg --raw"'' + ]; in '' substituteInPlace asc-to-gif.sh ${lib.concatStringsSep " " substitutions} diff --git a/pkgs/by-name/as/ashell/package.nix b/pkgs/by-name/as/ashell/package.nix index 1197f97b5fb6..2cec24a99b6f 100644 --- a/pkgs/by-name/as/ashell/package.nix +++ b/pkgs/by-name/as/ashell/package.nix @@ -43,7 +43,8 @@ rustPlatform.buildRustPackage rec { libxkbcommon pipewire udev - ] ++ runtimeDependencies; + ] + ++ runtimeDependencies; meta = { description = "Ready to go Wayland status bar for Hyprland"; diff --git a/pkgs/by-name/as/assaultcube/package.nix b/pkgs/by-name/as/assaultcube/package.nix index 7db82cf87f44..69332a0a81bb 100644 --- a/pkgs/by-name/as/assaultcube/package.nix +++ b/pkgs/by-name/as/assaultcube/package.nix @@ -36,20 +36,19 @@ stdenv.mkDerivation rec { copyDesktopItems ]; - buildInputs = - [ - file - zlib - ] - ++ lib.optionals client [ - openal - SDL2 - SDL2_image - libGL - libX11 - libogg - libvorbis - ]; + buildInputs = [ + file + zlib + ] + ++ lib.optionals client [ + openal + SDL2 + SDL2_image + libGL + libX11 + libogg + libvorbis + ]; targets = (lib.optionalString server "server") + (lib.optionalString client " client"); makeFlags = [ diff --git a/pkgs/by-name/as/ast-grep/package.nix b/pkgs/by-name/as/ast-grep/package.nix index 3ce0830fa891..dc29d01d11c2 100644 --- a/pkgs/by-name/as/ast-grep/package.nix +++ b/pkgs/by-name/as/ast-grep/package.nix @@ -32,7 +32,8 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoBuildFlags = [ "--package ast-grep --bin ast-grep" - ] ++ lib.optionals enableLegacySg [ "--package ast-grep --bin sg" ]; + ] + ++ lib.optionals enableLegacySg [ "--package ast-grep --bin sg" ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd ast-grep \ diff --git a/pkgs/by-name/at/at-spi2-core/package.nix b/pkgs/by-name/at/at-spi2-core/package.nix index 84f77fc7fb56..461d2002ddf7 100644 --- a/pkgs/by-name/at/at-spi2-core/package.nix +++ b/pkgs/by-name/at/at-spi2-core/package.nix @@ -40,32 +40,30 @@ stdenv.mkDerivation rec { hash = "sha256-4bHJg2qJR4UvdEDDLiMXkjTHa9mM2cxAAfN2QF+LeDs="; }; - nativeBuildInputs = - [ - glib - meson - ninja - pkg-config - makeWrapper - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + glib + meson + ninja + pkg-config + makeWrapper + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; - buildInputs = - [ - libX11 - libxml2 - # at-spi2-core can be build without X support, but due it is a client-side library, GUI-less usage is a very rare case - libXtst - libXi - # libXext is a transitive dependency of libXi - libXext - ] - ++ lib.optionals systemdSupport [ - # libsystemd is a needed for dbus-broker support - systemd - ]; + buildInputs = [ + libX11 + libxml2 + # at-spi2-core can be build without X support, but due it is a client-side library, GUI-less usage is a very rare case + libXtst + libXi + # libXext is a transitive dependency of libXi + libXext + ] + ++ lib.optionals systemdSupport [ + # libsystemd is a needed for dbus-broker support + systemd + ]; # In atspi-2.pc dbus-1 glib-2.0 # In atk.pc gobject-2.0 @@ -77,21 +75,20 @@ stdenv.mkDerivation rec { # fails with "AT-SPI: Couldn't connect to accessibility bus. Is at-spi-bus-launcher running?" doCheck = false; - mesonFlags = - [ - # Provide dbus-daemon fallback when it is not already running when - # at-spi2-bus-launcher is executed. This allows us to avoid - # including the entire dbus closure in libraries linked with - # the at-spi2-core libraries. - "-Ddbus_daemon=/run/current-system/sw/bin/dbus-daemon" - ] - ++ lib.optionals systemdSupport [ - # Same as the above, but for dbus-broker - "-Ddbus_broker=/run/current-system/sw/bin/dbus-broker-launch" - ] - ++ lib.optionals (!systemdSupport) [ - "-Duse_systemd=false" - ]; + mesonFlags = [ + # Provide dbus-daemon fallback when it is not already running when + # at-spi2-bus-launcher is executed. This allows us to avoid + # including the entire dbus closure in libraries linked with + # the at-spi2-core libraries. + "-Ddbus_daemon=/run/current-system/sw/bin/dbus-daemon" + ] + ++ lib.optionals systemdSupport [ + # Same as the above, but for dbus-broker + "-Ddbus_broker=/run/current-system/sw/bin/dbus-broker-launch" + ] + ++ lib.optionals (!systemdSupport) [ + "-Duse_systemd=false" + ]; passthru = { updateScript = gnome.updateScript { diff --git a/pkgs/by-name/at/atlauncher/package.nix b/pkgs/by-name/at/atlauncher/package.nix index c894d159138b..2ec41ca791d2 100644 --- a/pkgs/by-name/at/atlauncher/package.nix +++ b/pkgs/by-name/at/atlauncher/package.nix @@ -59,18 +59,17 @@ stdenvNoCC.mkDerivation (finalAttrs: { installPhase = let - runtimeLibraries = - [ - libglvnd - libpulseaudio - udev - xorg.libX11 - xorg.libXcursor - xorg.libXxf86vm - ] - ++ lib.optional gamemodeSupport gamemode.lib - ++ lib.optional textToSpeechSupport flite - ++ additionalLibs; + runtimeLibraries = [ + libglvnd + libpulseaudio + udev + xorg.libX11 + xorg.libXcursor + xorg.libXxf86vm + ] + ++ lib.optional gamemodeSupport gamemode.lib + ++ lib.optional textToSpeechSupport flite + ++ additionalLibs; in '' runHook preInstall diff --git a/pkgs/by-name/at/atop/package.nix b/pkgs/by-name/at/atop/package.nix index 9566310b7fe1..cea7301713de 100644 --- a/pkgs/by-name/at/atop/package.nix +++ b/pkgs/by-name/at/atop/package.nix @@ -23,23 +23,21 @@ stdenv.mkDerivation rec { hash = "sha256-DQnsyQwU5u9Bwi48V8FCw+T7nPPJQ3kHejPJYdU0MIY="; }; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals withAtopgpu [ - python3.pkgs.wrapPython - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals withAtopgpu [ + python3.pkgs.wrapPython + ]; - buildInputs = - [ - glib - zlib - ncurses - ] - ++ lib.optionals withAtopgpu [ - python3 - ]; + buildInputs = [ + glib + zlib + ncurses + ] + ++ lib.optionals withAtopgpu [ + python3 + ]; pythonPath = lib.optionals withAtopgpu [ python3.pkgs.pynvml @@ -77,21 +75,20 @@ stdenv.mkDerivation rec { mkdir -p $out/bin ''; - postInstall = - '' - # Remove extra files we don't need - rm -r $out/{var,etc} $out/bin/atop{sar,}-${version} - '' - + ( - if withAtopgpu then - '' - wrapPythonPrograms - '' - else - '' - rm $out/lib/systemd/system/atopgpu.service $out/bin/atopgpud $out/share/man/man8/atopgpud.8 - '' - ); + postInstall = '' + # Remove extra files we don't need + rm -r $out/{var,etc} $out/bin/atop{sar,}-${version} + '' + + ( + if withAtopgpu then + '' + wrapPythonPrograms + '' + else + '' + rm $out/lib/systemd/system/atopgpu.service $out/bin/atopgpud $out/share/man/man8/atopgpud.8 + '' + ); passthru.tests = { inherit (nixosTests) atop; }; diff --git a/pkgs/by-name/at/ats2/package.nix b/pkgs/by-name/at/ats2/package.nix index 8a648c98238d..172ba12c1342 100644 --- a/pkgs/by-name/at/ats2/package.nix +++ b/pkgs/by-name/at/ats2/package.nix @@ -37,18 +37,17 @@ stdenv.mkDerivation rec { hash = "sha256-UWgDjFojPBYgykrCrJyYvVWY+Gc5d4aRGjTWjc528AM="; }; - postPatch = - '' - for i in cstream intinf libgmp libjson-c libpcre; do - ln -sf ../../../../../share/Makefile.gen contrib/atscntrb/atscntrb-hx-$i/SATS/DOCUGEN/Makefile.gen - done - for i in libcairo libsdl2; do - ln -sf ../../../../../../share/Makefile.gen npm-utils/contrib/atscntrb/atscntrb-hx-$i/SATS/DOCUGEN/Makefile.gen - done - '' - + lib.optionalString stdenv.cc.isClang '' - sed -i 's/gcc/clang/g' utils/*/DATS/atscc_util.dats - ''; + postPatch = '' + for i in cstream intinf libgmp libjson-c libpcre; do + ln -sf ../../../../../share/Makefile.gen contrib/atscntrb/atscntrb-hx-$i/SATS/DOCUGEN/Makefile.gen + done + for i in libcairo libsdl2; do + ln -sf ../../../../../../share/Makefile.gen npm-utils/contrib/atscntrb/atscntrb-hx-$i/SATS/DOCUGEN/Makefile.gen + done + '' + + lib.optionalString stdenv.cc.isClang '' + sed -i 's/gcc/clang/g' utils/*/DATS/atscc_util.dats + ''; buildInputs = [ gmp ]; diff --git a/pkgs/by-name/at/attic-client/package.nix b/pkgs/by-name/at/attic-client/package.nix index b9f1d8300afd..105400d926a3 100644 --- a/pkgs/by-name/at/attic-client/package.nix +++ b/pkgs/by-name/at/attic-client/package.nix @@ -43,7 +43,8 @@ rustPlatform.buildRustPackage { env = { ATTIC_DISTRIBUTOR = "nixpkgs"; - } // lib.optionalAttrs needNixInclude { NIX_INCLUDE_PATH = "${lib.getDev nix}/include"; }; + } + // lib.optionalAttrs needNixInclude { NIX_INCLUDE_PATH = "${lib.getDev nix}/include"; }; # Attic interacts with Nix directly and its tests require trusted-user access # to nix-daemon to import NARs, which is not possible in the build sandbox. diff --git a/pkgs/by-name/at/attract-mode/package.nix b/pkgs/by-name/at/attract-mode/package.nix index b769b674a039..7e67e3fedee2 100644 --- a/pkgs/by-name/at/attract-mode/package.nix +++ b/pkgs/by-name/at/attract-mode/package.nix @@ -28,21 +28,20 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - expat - ffmpeg - freetype - libarchive - libjpeg - libGLU - sfml_2 - zlib - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - openal - fontconfig - ]; + buildInputs = [ + expat + ffmpeg + freetype + libarchive + libjpeg + libGLU + sfml_2 + zlib + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + openal + fontconfig + ]; makeFlags = [ "prefix=$(out)" @@ -53,7 +52,8 @@ stdenv.mkDerivation { "PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config" "AR=${stdenv.cc.targetPrefix}ar" "BUILD_EXPAT=0" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "USE_FONTCONFIG=0" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "USE_FONTCONFIG=0" ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/au/aucatctl/package.nix b/pkgs/by-name/au/aucatctl/package.nix index 2e0671876015..e3d0ca43d98f 100644 --- a/pkgs/by-name/au/aucatctl/package.nix +++ b/pkgs/by-name/au/aucatctl/package.nix @@ -17,24 +17,24 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ sndio - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isBSD) libbsd; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isBSD) libbsd; outputs = [ "out" "man" ]; - preBuild = - '' - makeFlagsArray+=("PREFIX=$out") - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isBSD) '' - makeFlagsArray+=(LDADD="-lsndio -lbsd") + preBuild = '' + makeFlagsArray+=("PREFIX=$out") + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isBSD) '' + makeFlagsArray+=(LDADD="-lsndio -lbsd") - # Fix warning about implicit declaration of function 'strlcpy' - substituteInPlace aucatctl.c \ - --replace '#include ' '#include ' - ''; + # Fix warning about implicit declaration of function 'strlcpy' + substituteInPlace aucatctl.c \ + --replace '#include ' '#include ' + ''; meta = with lib; { description = "Utility that allows to send MIDI messages to control sndiod and/or aucat volumes"; diff --git a/pkgs/by-name/au/audacity/package.nix b/pkgs/by-name/au/audacity/package.nix index da1c92d1c441..563324bd94c4 100644 --- a/pkgs/by-name/au/audacity/package.nix +++ b/pkgs/by-name/au/audacity/package.nix @@ -70,82 +70,79 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-kESKpIke9Xi4A55i3mUu1JkDjp8voBJBixiAK8pUkKA="; }; - postPatch = - '' - mkdir src/private - substituteInPlace scripts/build/macOS/fix_bundle.py \ - --replace-fail "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace libraries/lib-files/FileNames.cpp \ - --replace-fail /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h - ''; + postPatch = '' + mkdir src/private + substituteInPlace scripts/build/macOS/fix_bundle.py \ + --replace-fail "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace libraries/lib-files/FileNames.cpp \ + --replace-fail /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h + ''; - nativeBuildInputs = - [ - cmake - gettext - pkg-config - python3 - makeWrapper - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - linuxHeaders - ]; + nativeBuildInputs = [ + cmake + gettext + pkg-config + python3 + makeWrapper + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + linuxHeaders + ]; - buildInputs = - [ - expat - ffmpeg - file - flac - gtk3 - lame - libid3tag - libjack2 - libmad - libopus - libsbsms_2_3_0 - libsndfile - libvorbis - lilv - lv2 - mpg123 - opusfile - pcre - portmidi - rapidjson - serd - sord - soundtouch - soxr - sqlite - sratom - suil - twolame - portaudio - wavpack - wxGTK32 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib # for portaudio - at-spi2-core - dbus - libepoxy - libXdmcp - libXtst - libpthreadstubs - libxkbcommon - libselinux - libsepol - libuuid - util-linux - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libpng - libjpeg - ]; + buildInputs = [ + expat + ffmpeg + file + flac + gtk3 + lame + libid3tag + libjack2 + libmad + libopus + libsbsms_2_3_0 + libsndfile + libvorbis + lilv + lv2 + mpg123 + opusfile + pcre + portmidi + rapidjson + serd + sord + soundtouch + soxr + sqlite + sratom + suil + twolame + portaudio + wavpack + wxGTK32 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib # for portaudio + at-spi2-core + dbus + libepoxy + libXdmcp + libXtst + libpthreadstubs + libxkbcommon + libselinux + libsepol + libuuid + util-linux + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libpng + libjpeg + ]; cmakeFlags = [ "-DAUDACITY_BUILD_LEVEL=2" diff --git a/pkgs/by-name/au/audio-recorder/package.nix b/pkgs/by-name/au/audio-recorder/package.nix index 729c431817ca..ae7e4da5e294 100644 --- a/pkgs/by-name/au/audio-recorder/package.nix +++ b/pkgs/by-name/au/audio-recorder/package.nix @@ -34,23 +34,22 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - glib - dbus - gtk3 - librsvg - libappindicator-gtk3 - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ]) - ++ lib.optional pulseaudioSupport libpulseaudio; + buildInputs = [ + glib + dbus + gtk3 + librsvg + libappindicator-gtk3 + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav + ]) + ++ lib.optional pulseaudioSupport libpulseaudio; meta = { description = "Audio recorder for GNOME and Unity Desktops"; diff --git a/pkgs/by-name/au/audio-sharing/package.nix b/pkgs/by-name/au/audio-sharing/package.nix index 56ae0176498d..2767b17793f2 100644 --- a/pkgs/by-name/au/audio-sharing/package.nix +++ b/pkgs/by-name/au/audio-sharing/package.nix @@ -37,22 +37,21 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-ePgEAVYXLOHWQXG92Grb9nmenyGj0JkgVy1UDsQF0xw="; }; - nativeBuildInputs = - [ - appstream-glib - cargo - desktop-file-utils - git - meson - ninja - pkg-config - python3 - rustc - wrapGAppsHook4 - ] - ++ (with rustPlatform; [ - cargoSetupHook - ]); + nativeBuildInputs = [ + appstream-glib + cargo + desktop-file-utils + git + meson + ninja + pkg-config + python3 + rustc + wrapGAppsHook4 + ] + ++ (with rustPlatform; [ + cargoSetupHook + ]); buildInputs = [ glib diff --git a/pkgs/by-name/au/audit/package.nix b/pkgs/by-name/au/audit/package.nix index 62732842d66a..5d4817447d99 100644 --- a/pkgs/by-name/au/audit/package.nix +++ b/pkgs/by-name/au/audit/package.nix @@ -68,14 +68,13 @@ stdenv.mkDerivation (finalAttrs: { buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - autoreconfHook - ] - ++ lib.optionals enablePython [ - python3 - swig - ]; + nativeBuildInputs = [ + autoreconfHook + ] + ++ lib.optionals enablePython [ + python3 + swig + ]; buildInputs = [ bash diff --git a/pkgs/by-name/au/augustus/package.nix b/pkgs/by-name/au/augustus/package.nix index e2aa70b1694f..262147c9ee17 100644 --- a/pkgs/by-name/au/augustus/package.nix +++ b/pkgs/by-name/au/augustus/package.nix @@ -24,13 +24,14 @@ stdenv.mkDerivation rec { patches = [ ./darwin-fixes.patch ]; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.sigtool - libicns - imagemagick - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.sigtool + libicns + imagemagick + ]; buildInputs = [ SDL2 diff --git a/pkgs/by-name/au/ausweiskopie/package.nix b/pkgs/by-name/au/ausweiskopie/package.nix index e7b6db1c15f6..5a9a266dc1b4 100644 --- a/pkgs/by-name/au/ausweiskopie/package.nix +++ b/pkgs/by-name/au/ausweiskopie/package.nix @@ -23,7 +23,8 @@ python3Packages.buildPythonApplication rec { nativeBuildInputs = [ copyDesktopItems - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; build-system = with python3Packages; [ setuptools diff --git a/pkgs/by-name/au/auto-multiple-choice/package.nix b/pkgs/by-name/au/auto-multiple-choice/package.nix index bb3c234b8d0c..516fde63bc6d 100644 --- a/pkgs/by-name/au/auto-multiple-choice/package.nix +++ b/pkgs/by-name/au/auto-multiple-choice/package.nix @@ -104,41 +104,40 @@ stdenv.mkDerivation (finalAttrs: { gobject-introspection ]; - buildInputs = - [ - cairo - cairo.dev - dblatex - gnumake - graphicsmagick - gsettings-desktop-schemas - gtk3 - hicolor-icon-theme - libnotify - librsvg - libxslt - netpbm - opencv - pango - poppler - ] - ++ (with perlPackages; [ - perl - ArchiveZip - Cairo - CairoGObject - DBDSQLite - DBI - Glib - GlibObjectIntrospection - Gtk3 - LocaleGettext - PerlMagick - TextCSV - XMLParser - XMLSimple - XMLWriter - ]); + buildInputs = [ + cairo + cairo.dev + dblatex + gnumake + graphicsmagick + gsettings-desktop-schemas + gtk3 + hicolor-icon-theme + libnotify + librsvg + libxslt + netpbm + opencv + pango + poppler + ] + ++ (with perlPackages; [ + perl + ArchiveZip + Cairo + CairoGObject + DBDSQLite + DBI + Glib + GlibObjectIntrospection + Gtk3 + LocaleGettext + PerlMagick + TextCSV + XMLParser + XMLSimple + XMLWriter + ]); passthru = { tlType = "run"; diff --git a/pkgs/by-name/au/autogen/package.nix b/pkgs/by-name/au/autogen/package.nix index 2c8578b8e949..4298b8ca2e41 100644 --- a/pkgs/by-name/au/autogen/package.nix +++ b/pkgs/by-name/au/autogen/package.nix @@ -89,18 +89,17 @@ stdenv.mkDerivation rec { "info" ]; - nativeBuildInputs = - [ - which - pkg-config - perl - autoreconfHook # patches applied - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # autogen needs a build autogen when cross-compiling - buildPackages.buildPackages.autogen - buildPackages.texinfo - ]; + nativeBuildInputs = [ + which + pkg-config + perl + autoreconfHook # patches applied + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # autogen needs a build autogen when cross-compiling + buildPackages.buildPackages.autogen + buildPackages.texinfo + ]; buildInputs = [ guile_2_2 libxml2 @@ -110,48 +109,46 @@ stdenv.mkDerivation rec { export MAN_PAGE_DATE=$(date '+%Y-%m-%d' -d "@$SOURCE_DATE_EPOCH") ''; - configureFlags = - [ - "--with-libxml2=${libxml2.dev}" - "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2" - # Make sure to use a static value for the timeout. If we do not set a value - # here autogen will select one based on the execution time of the configure - # phase which is not really reproducible. - # - # If you are curious about the number 78, it has been cargo-culted from - # Debian: https://salsa.debian.org/debian/autogen/-/blob/master/debian/rules#L21 - "--enable-timeout=78" - "CFLAGS=-D_FILE_OFFSET_BITS=64" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # the configure check for regcomp wants to run a host program - "libopts_cv_with_libregex=yes" - #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo" - ] - # See: https://sourceforge.net/p/autogen/bugs/187/ - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "ac_cv_func_utimensat=no" ]; + configureFlags = [ + "--with-libxml2=${libxml2.dev}" + "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2" + # Make sure to use a static value for the timeout. If we do not set a value + # here autogen will select one based on the execution time of the configure + # phase which is not really reproducible. + # + # If you are curious about the number 78, it has been cargo-culted from + # Debian: https://salsa.debian.org/debian/autogen/-/blob/master/debian/rules#L21 + "--enable-timeout=78" + "CFLAGS=-D_FILE_OFFSET_BITS=64" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # the configure check for regcomp wants to run a host program + "libopts_cv_with_libregex=yes" + #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo" + ] + # See: https://sourceforge.net/p/autogen/bugs/187/ + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "ac_cv_func_utimensat=no" ]; #doCheck = true; # not reliable - postInstall = - '' - mkdir -p $dev/bin - mv $bin/bin/autoopts-config $dev/bin + postInstall = '' + mkdir -p $dev/bin + mv $bin/bin/autoopts-config $dev/bin - for f in $lib/lib/autogen/tpl-config.tlib $out/share/autogen/tpl-config.tlib; do - sed -e "s|$dev/include|/no-such-autogen-include-path|" -i $f - sed -e "s|$bin/bin|/no-such-autogen-bin-path|" -i $f - sed -e "s|$lib/lib|/no-such-autogen-lib-path|" -i $f - done + for f in $lib/lib/autogen/tpl-config.tlib $out/share/autogen/tpl-config.tlib; do + sed -e "s|$dev/include|/no-such-autogen-include-path|" -i $f + sed -e "s|$bin/bin|/no-such-autogen-bin-path|" -i $f + sed -e "s|$lib/lib|/no-such-autogen-lib-path|" -i $f + done - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - # remove build directory (/build/**, or /tmp/nix-build-**) from RPATHs - for f in "$bin"/bin/*; do - local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)'$NIX_BUILD_TOP'[^:]*:@\1@g')" - patchelf --set-rpath "$nrp" "$f" - done - ''; + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + # remove build directory (/build/**, or /tmp/nix-build-**) from RPATHs + for f in "$bin"/bin/*; do + local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)'$NIX_BUILD_TOP'[^:]*:@\1@g')" + patchelf --set-rpath "$nrp" "$f" + done + ''; meta = with lib; { description = "Automated text and program generation tool"; diff --git a/pkgs/by-name/av/av1an/package.nix b/pkgs/by-name/av/av1an/package.nix index 2a7b7c05e527..10b53cb9ad4c 100644 --- a/pkgs/by-name/av/av1an/package.nix +++ b/pkgs/by-name/av/av1an/package.nix @@ -46,19 +46,18 @@ symlinkJoin { postBuild = let - runtimePrograms = - [ - vapoursynth - (ffmpeg.override { inherit withVmaf; }) - ] - ++ lib.optional withAom libaom - ++ lib.optional withMkvtoolnix mkvtoolnix-cli - ++ lib.optional withRav1e rav1e - ++ lib.optional withSvtav1 svt-av1 - ++ lib.optional withVmaf libvmaf - ++ lib.optional withVpx libvpx - ++ lib.optional withX264 x264 - ++ lib.optional withX265 x265; + runtimePrograms = [ + vapoursynth + (ffmpeg.override { inherit withVmaf; }) + ] + ++ lib.optional withAom libaom + ++ lib.optional withMkvtoolnix mkvtoolnix-cli + ++ lib.optional withRav1e rav1e + ++ lib.optional withSvtav1 svt-av1 + ++ lib.optional withVmaf libvmaf + ++ lib.optional withVpx libvpx + ++ lib.optional withX264 x264 + ++ lib.optional withX265 x265; in '' wrapProgram $out/bin/av1an \ diff --git a/pkgs/by-name/av/avalonia/package.nix b/pkgs/by-name/av/avalonia/package.nix index fa93d59ca2b9..d778706177c5 100644 --- a/pkgs/by-name/av/avalonia/package.nix +++ b/pkgs/by-name/av/avalonia/package.nix @@ -71,58 +71,57 @@ stdenvNoCC.mkDerivation ( stripRoot = false; }; - postPatch = - '' - patchShebangs build.sh + postPatch = '' + patchShebangs build.sh - substituteInPlace src/Avalonia.X11/ICELib.cs \ - --replace-fail '"libICE.so.6"' '"${lib.getLib libICE}/lib/libICE.so.6"' - substituteInPlace src/Avalonia.X11/SMLib.cs \ - --replace-fail '"libSM.so.6"' '"${lib.getLib libSM}/lib/libSM.so.6"' - substituteInPlace src/Avalonia.X11/XLib.cs \ - --replace-fail '"libX11.so.6"' '"${lib.getLib libX11}/lib/libX11.so.6"' \ - --replace-fail '"libXrandr.so.2"' '"${lib.getLib libXrandr}/lib/libXrandr.so.2"' \ - --replace-fail '"libXext.so.6"' '"${lib.getLib libXext}/lib/libXext.so.6"' \ - --replace-fail '"libXi.so.6"' '"${lib.getLib libXi}/lib/libXi.so.6"' \ - --replace-fail '"libXcursor.so.1"' '"${lib.getLib libXcursor}/lib/libXcursor.so.1"' + substituteInPlace src/Avalonia.X11/ICELib.cs \ + --replace-fail '"libICE.so.6"' '"${lib.getLib libICE}/lib/libICE.so.6"' + substituteInPlace src/Avalonia.X11/SMLib.cs \ + --replace-fail '"libSM.so.6"' '"${lib.getLib libSM}/lib/libSM.so.6"' + substituteInPlace src/Avalonia.X11/XLib.cs \ + --replace-fail '"libX11.so.6"' '"${lib.getLib libX11}/lib/libX11.so.6"' \ + --replace-fail '"libXrandr.so.2"' '"${lib.getLib libXrandr}/lib/libXrandr.so.2"' \ + --replace-fail '"libXext.so.6"' '"${lib.getLib libXext}/lib/libXext.so.6"' \ + --replace-fail '"libXi.so.6"' '"${lib.getLib libXi}/lib/libXi.so.6"' \ + --replace-fail '"libXcursor.so.1"' '"${lib.getLib libXcursor}/lib/libXcursor.so.1"' - # from RestoreAdditionalProjectSources, which isn't supported by nuget-to-json - dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8-transport/nuget/v3/index.json + # from RestoreAdditionalProjectSources, which isn't supported by nuget-to-json + dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8-transport/nuget/v3/index.json - # Tricky way to run npmConfigHook multiple times (borrowed from pagefind) - ( - local postPatchHooks=() # written to by npmConfigHook - source ${npmHooks.npmConfigHook}/nix-support/setup-hook - '' - + - # TODO: implement updateScript - lib.concatMapStrings ( - { path, hash }: - let - deps = fetchNpmDeps { - src = "${src}/${path}"; - inherit hash; - }; - in - '' - npmRoot=${path} npmDeps="${deps}" npmConfigHook - rm -rf "$TMPDIR/cache" - '' - ) (import npmDepsFile) - + '' - ) - # Avalonia.Native is normally only packed on darwin. - substituteInPlace src/Avalonia.Native/Avalonia.Native.csproj \ - --replace-fail \ - '$(PackAvaloniaNative)' \ - 'true' + # Tricky way to run npmConfigHook multiple times (borrowed from pagefind) + ( + local postPatchHooks=() # written to by npmConfigHook + source ${npmHooks.npmConfigHook}/nix-support/setup-hook + '' + + + # TODO: implement updateScript + lib.concatMapStrings ( + { path, hash }: + let + deps = fetchNpmDeps { + src = "${src}/${path}"; + inherit hash; + }; + in + '' + npmRoot=${path} npmDeps="${deps}" npmConfigHook + rm -rf "$TMPDIR/cache" + '' + ) (import npmDepsFile) + + '' + ) + # Avalonia.Native is normally only packed on darwin. + substituteInPlace src/Avalonia.Native/Avalonia.Native.csproj \ + --replace-fail \ + '$(PackAvaloniaNative)' \ + 'true' - # stop 'Clean' target from removing node_modules - substituteInPlace nukebuild/Build.cs \ - --replace-fail \ - 'Parameters.BuildDirs.ForEach(DeleteDirectory);' \ - "" - ''; + # stop 'Clean' target from removing node_modules + substituteInPlace nukebuild/Build.cs \ + --replace-fail \ + 'Parameters.BuildDirs.ForEach(DeleteDirectory);' \ + "" + ''; makeCacheWritable = true; diff --git a/pkgs/by-name/av/avidemux/package.nix b/pkgs/by-name/av/avidemux/package.nix index c08cfd2f49a0..804251f8ab3a 100644 --- a/pkgs/by-name/av/avidemux/package.nix +++ b/pkgs/by-name/av/avidemux/package.nix @@ -87,39 +87,39 @@ stdenv.mkDerivation rec { cmake pkg-config makeWrapper - ] ++ lib.optional withQT libsForQt5.wrapQtAppsHook; - buildInputs = + ] + ++ lib.optional withQT libsForQt5.wrapQtAppsHook; + buildInputs = [ + zlib + gettext + libvdpau + libva + libXv + sqlite + fribidi + fontconfig + freetype + alsa-lib + libXext + libGLU + ] + ++ lib.optional withX264 x264 + ++ lib.optional withX265 x265 + ++ lib.optional withXvid xvidcore + ++ lib.optional withLAME lame + ++ lib.optional withFAAC faac + ++ lib.optional withVorbis libvorbis + ++ lib.optional withPulse libpulseaudio + ++ lib.optional withFAAD faad2 + ++ lib.optional withOpus libopus + ++ lib.optionals withQT ( + with libsForQt5; [ - zlib - gettext - libvdpau - libva - libXv - sqlite - fribidi - fontconfig - freetype - alsa-lib - libXext - libGLU + qttools + qtbase ] - ++ lib.optional withX264 x264 - ++ lib.optional withX265 x265 - ++ lib.optional withXvid xvidcore - ++ lib.optional withLAME lame - ++ lib.optional withFAAC faac - ++ lib.optional withVorbis libvorbis - ++ lib.optional withPulse libpulseaudio - ++ lib.optional withFAAD faad2 - ++ lib.optional withOpus libopus - ++ lib.optionals withQT ( - with libsForQt5; - [ - qttools - qtbase - ] - ) - ++ lib.optional withVPX libvpx; + ) + ++ lib.optional withVPX libvpx; dontWrapQtApps = true; diff --git a/pkgs/by-name/av/avrdude/package.nix b/pkgs/by-name/av/avrdude/package.nix index 30227818dd69..4d0b12f6cc8e 100644 --- a/pkgs/by-name/av/avrdude/package.nix +++ b/pkgs/by-name/av/avrdude/package.nix @@ -40,19 +40,18 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-i1q0NQKVd/wiOm1Amop3hW+FWuefFOQCCivuEtEH38k="; }; - nativeBuildInputs = - [ - cmake - bison - flex - pkg-config - ] - ++ lib.optionals docSupport [ - unixtools.more - texliveMedium - texinfo - texi2html - ]; + nativeBuildInputs = [ + cmake + bison + flex + pkg-config + ] + ++ lib.optionals docSupport [ + unixtools.more + texliveMedium + texinfo + texi2html + ]; buildInputs = [ (if useElfutils then elfutils else finalAttrs.finalPackage.passthru.libelf) diff --git a/pkgs/by-name/aw/aws-c-common/package.nix b/pkgs/by-name/aw/aws-c-common/package.nix index 10f0884243b6..4dc2d76162bf 100644 --- a/pkgs/by-name/aw/aws-c-common/package.nix +++ b/pkgs/by-name/aw/aws-c-common/package.nix @@ -20,13 +20,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isRiscV [ - "-DCMAKE_C_FLAGS=-fasynchronous-unwind-tables" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isRiscV [ + "-DCMAKE_C_FLAGS=-fasynchronous-unwind-tables" + ]; # aws-c-common misuses cmake modules, so we need # to manually add a MODULE_PATH to its consumers diff --git a/pkgs/by-name/aw/aws-c-event-stream/package.nix b/pkgs/by-name/aw/aws-c-event-stream/package.nix index 24ad66a12d85..30b47942fe50 100644 --- a/pkgs/by-name/aw/aws-c-event-stream/package.nix +++ b/pkgs/by-name/aw/aws-c-event-stream/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { aws-c-io aws-checksums s2n-tls - ] ++ lib.optional stdenv.hostPlatform.isMusl libexecinfo; + ] + ++ lib.optional stdenv.hostPlatform.isMusl libexecinfo; cmakeFlags = [ "-DBUILD_SHARED_LIBS:BOOL=ON" diff --git a/pkgs/by-name/aw/aws-sdk-cpp/package.nix b/pkgs/by-name/aw/aws-sdk-cpp/package.nix index a0854db31509..82147ae7213c 100644 --- a/pkgs/by-name/aw/aws-sdk-cpp/package.nix +++ b/pkgs/by-name/aw/aws-sdk-cpp/package.nix @@ -42,34 +42,33 @@ stdenv.mkDerivation rec { hash = "sha256-K0UFs7vOeZeQIs3G5L4FfEWXDGTXT9ssr/vQwa1l2lw="; }; - postPatch = - '' - # Append the dev output to path hints in finding Aws.h to avoid - # having to pass `AWS_CORE_HEADER_FILE` explicitly to cmake configure - # when using find_package(AWSSDK CONFIG) - substituteInPlace cmake/AWSSDKConfig.cmake \ - --replace 'C:/AWSSDK/''${AWSSDK_INSTALL_INCLUDEDIR}/aws/core' \ - 'C:/AWSSDK/''${AWSSDK_INSTALL_INCLUDEDIR}/aws/core" - "${placeholder "dev"}/include/aws/core' + postPatch = '' + # Append the dev output to path hints in finding Aws.h to avoid + # having to pass `AWS_CORE_HEADER_FILE` explicitly to cmake configure + # when using find_package(AWSSDK CONFIG) + substituteInPlace cmake/AWSSDKConfig.cmake \ + --replace 'C:/AWSSDK/''${AWSSDK_INSTALL_INCLUDEDIR}/aws/core' \ + 'C:/AWSSDK/''${AWSSDK_INSTALL_INCLUDEDIR}/aws/core" + "${placeholder "dev"}/include/aws/core' - # Avoid blanket -Werror to evade build failures on less - # tested compilers. - substituteInPlace cmake/compiler_settings.cmake \ - --replace '"-Werror"' ' ' + # Avoid blanket -Werror to evade build failures on less + # tested compilers. + substituteInPlace cmake/compiler_settings.cmake \ + --replace '"-Werror"' ' ' - # Flaky on Hydra - rm tests/aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp - rm tests/aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp - rm tests/aws-cpp-sdk-core-tests/aws/client/AwsConfigTest.cpp - # Includes aws-c-auth private headers, so only works with submodule build - rm tests/aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp - # TestRandomURLMultiThreaded fails - rm tests/aws-cpp-sdk-core-tests/http/HttpClientTest.cpp - '' - + lib.optionalString stdenv.hostPlatform.isi686 '' - # EPSILON is exceeded - rm tests/aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp - ''; + # Flaky on Hydra + rm tests/aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp + rm tests/aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp + rm tests/aws-cpp-sdk-core-tests/aws/client/AwsConfigTest.cpp + # Includes aws-c-auth private headers, so only works with submodule build + rm tests/aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp + # TestRandomURLMultiThreaded fails + rm tests/aws-cpp-sdk-core-tests/http/HttpClientTest.cpp + '' + + lib.optionalString stdenv.hostPlatform.isi686 '' + # EPSILON is exceeded + rm tests/aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp + ''; # FIXME: might be nice to put different APIs in different outputs # (e.g. libaws-cpp-sdk-s3.so in output "s3"). @@ -92,18 +91,17 @@ stdenv.mkDerivation rec { # propagation is needed for Security.framework to be available when linking propagatedBuildInputs = [ aws-crt-cpp ]; - cmakeFlags = - [ - "-DBUILD_DEPS=OFF" - ] - ++ lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0" - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-DENABLE_TESTING=OFF" - "-DCURL_HAS_H2=1" - "-DCURL_HAS_TLS_PROXY=1" - "-DTARGET_ARCH=${host_os}" - ] - ++ lib.optional (apis != [ "*" ]) "-DBUILD_ONLY=${lib.concatStringsSep ";" apis}"; + cmakeFlags = [ + "-DBUILD_DEPS=OFF" + ] + ++ lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0" + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-DENABLE_TESTING=OFF" + "-DCURL_HAS_H2=1" + "-DCURL_HAS_TLS_PROXY=1" + "-DTARGET_ARCH=${host_os}" + ] + ++ lib.optional (apis != [ "*" ]) "-DBUILD_ONLY=${lib.concatStringsSep ";" apis}"; env.NIX_CFLAGS_COMPILE = toString [ # openssl 3 generates several deprecation warnings diff --git a/pkgs/by-name/aw/aws-sso-cli/package.nix b/pkgs/by-name/aw/aws-sso-cli/package.nix index 635481d2f9b1..b5fbba475475 100644 --- a/pkgs/by-name/aw/aws-sso-cli/package.nix +++ b/pkgs/by-name/aw/aws-sso-cli/package.nix @@ -30,17 +30,16 @@ buildGoModule rec { "-X main.Tag=nixpkgs" ]; - postInstall = - '' - wrapProgram $out/bin/aws-sso \ - --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd aws-sso \ - --bash <($out/bin/aws-sso setup completions --source --shell=bash) \ - --fish <($out/bin/aws-sso setup completions --source --shell=fish) \ - --zsh <($out/bin/aws-sso setup completions --source --shell=zsh) - ''; + postInstall = '' + wrapProgram $out/bin/aws-sso \ + --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd aws-sso \ + --bash <($out/bin/aws-sso setup completions --source --shell=bash) \ + --fish <($out/bin/aws-sso setup completions --source --shell=fish) \ + --zsh <($out/bin/aws-sso setup completions --source --shell=zsh) + ''; nativeCheckInputs = [ getent ]; @@ -50,7 +49,8 @@ buildGoModule rec { "TestAWSConsoleUrl" "TestAWSFederatedUrl" "TestServerWithSSL" # https://github.com/synfinatic/aws-sso-cli/issues/1030 -- remove when version >= 2.x - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestDetectShellBash" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestDetectShellBash" ]; in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; diff --git a/pkgs/by-name/aw/awscli2/package.nix b/pkgs/by-name/aw/awscli2/package.nix index dcf23d26e92d..972a638c10ec 100644 --- a/pkgs/by-name/aw/awscli2/package.nix +++ b/pkgs/by-name/aw/awscli2/package.nix @@ -126,15 +126,14 @@ py.pkgs.buildPythonApplication rec { writableTmpDirAsHomeHook ]; - postInstall = - '' - installShellCompletion --cmd aws \ - --bash <(echo "complete -C $out/bin/aws_completer aws") \ - --zsh $out/bin/aws_zsh_completer.sh - '' - + lib.optionalString (!stdenv.hostPlatform.isWindows) '' - rm $out/bin/aws.cmd - ''; + postInstall = '' + installShellCompletion --cmd aws \ + --bash <(echo "complete -C $out/bin/aws_completer aws") \ + --zsh $out/bin/aws_zsh_completer.sh + '' + + lib.optionalString (!stdenv.hostPlatform.isWindows) '' + rm $out/bin/aws.cmd + ''; # Propagating dependencies leaks them through $PYTHONPATH which causes issues # when used in nix-shell. diff --git a/pkgs/by-name/ay/ayatana-indicator-datetime/package.nix b/pkgs/by-name/ay/ayatana-indicator-datetime/package.nix index 64cafe4c63c2..43b66e34aceb 100644 --- a/pkgs/by-name/ay/ayatana-indicator-datetime/package.nix +++ b/pkgs/by-name/ay/ayatana-indicator-datetime/package.nix @@ -46,75 +46,72 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-8E9ucy8I0w9DDzsLtzJgICz/e0TNqOHgls9LrgA5nk4="; }; - postPatch = - '' - # Override systemd prefix - substituteInPlace data/CMakeLists.txt \ - --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \ - --replace-fail 'XDG_AUTOSTART_DIR "/etc' 'XDG_AUTOSTART_DIR "''${CMAKE_INSTALL_FULL_SYSCONFDIR}' - '' - + lib.optionalString enableLomiriFeatures '' - # Looking for Lomiri schemas for code generation - substituteInPlace src/CMakeLists.txt \ - --replace-fail '/usr/share/accountsservice' '${lomiri.lomiri-schemas}/share/accountsservice' - ''; + postPatch = '' + # Override systemd prefix + substituteInPlace data/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \ + --replace-fail 'XDG_AUTOSTART_DIR "/etc' 'XDG_AUTOSTART_DIR "''${CMAKE_INSTALL_FULL_SYSCONFDIR}' + '' + + lib.optionalString enableLomiriFeatures '' + # Looking for Lomiri schemas for code generation + substituteInPlace src/CMakeLists.txt \ + --replace-fail '/usr/share/accountsservice' '${lomiri.lomiri-schemas}/share/accountsservice' + ''; strictDeps = true; - nativeBuildInputs = - [ - cmake - glib # for schema hook - intltool - pkg-config - wrapGAppsHook3 - ] - ++ lib.optionals enableLomiriFeatures [ - libsForQt5.wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + glib # for schema hook + intltool + pkg-config + wrapGAppsHook3 + ] + ++ lib.optionals enableLomiriFeatures [ + libsForQt5.wrapQtAppsHook + ]; - buildInputs = - [ - ayatana-indicator-messages - glib - libaccounts-glib - libayatana-common - libnotify - libuuid - properties-cpp - systemd - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - ]) - ++ (with lomiri; [ - cmake-extras - ]) - ++ ( - if enableLomiriFeatures then - ( - [ - extra-cmake-modules - mkcal - ] - ++ (with libsForQt5; [ - kcalendarcore - qtbase - ]) - ++ (with lomiri; [ - lomiri-schemas - lomiri-sounds - lomiri-url-dispatcher - ]) - ) - else + buildInputs = [ + ayatana-indicator-messages + glib + libaccounts-glib + libayatana-common + libnotify + libuuid + properties-cpp + systemd + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + ]) + ++ (with lomiri; [ + cmake-extras + ]) + ++ ( + if enableLomiriFeatures then + ( [ - evolution-data-server - libical + extra-cmake-modules + mkcal ] - ); + ++ (with libsForQt5; [ + kcalendarcore + qtbase + ]) + ++ (with lomiri; [ + lomiri-schemas + lomiri-sounds + lomiri-url-dispatcher + ]) + ) + else + [ + evolution-data-server + libical + ] + ); nativeCheckInputs = [ dbus @@ -130,29 +127,28 @@ stdenv.mkDerivation (finalAttrs: { dontWrapQtApps = true; - cmakeFlags = - [ - (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true) - (lib.cmakeBool "GSETTINGS_COMPILE" true) - (lib.cmakeBool "ENABLE_LOMIRI_FEATURES" enableLomiriFeatures) - (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) - ] - ++ lib.optionals enableLomiriFeatures [ - (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" ( - lib.concatStringsSep ";" [ - # Exclude tests - "-E" - (lib.strings.escapeShellArg "(${ - lib.concatStringsSep "|" [ - # Don't know why these fail yet - "^test-eds-ics-repeating-events" - "^test-eds-ics-nonrepeating-events" - "^test-eds-ics-missing-trigger" - ] - })") - ] - )) - ]; + cmakeFlags = [ + (lib.cmakeBool "GSETTINGS_LOCALINSTALL" true) + (lib.cmakeBool "GSETTINGS_COMPILE" true) + (lib.cmakeBool "ENABLE_LOMIRI_FEATURES" enableLomiriFeatures) + (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) + ] + ++ lib.optionals enableLomiriFeatures [ + (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" ( + lib.concatStringsSep ";" [ + # Exclude tests + "-E" + (lib.strings.escapeShellArg "(${ + lib.concatStringsSep "|" [ + # Don't know why these fail yet + "^test-eds-ics-repeating-events" + "^test-eds-ics-nonrepeating-events" + "^test-eds-ics-missing-trigger" + ] + })") + ] + )) + ]; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; @@ -173,24 +169,23 @@ stdenv.mkDerivation (finalAttrs: { } ''; - preFixup = - '' - gappsWrapperArgs+=( - '' - + ( - if enableLomiriFeatures then - '' - "''${qtWrapperArgs[@]}" - '' - else - # schema is already added automatically by wrapper, EDS needs to be added explicitly - '' - --prefix XDG_DATA_DIRS : "${edsDataDir}" - '' + preFixup = '' + gappsWrapperArgs+=( + '' + + ( + if enableLomiriFeatures then + '' + "''${qtWrapperArgs[@]}" + '' + else + # schema is already added automatically by wrapper, EDS needs to be added explicitly + '' + --prefix XDG_DATA_DIRS : "${edsDataDir}" + '' + ) + + '' ) - + '' - ) - ''; + ''; passthru = { ayatana-indicators = { @@ -198,13 +193,12 @@ stdenv.mkDerivation (finalAttrs: { (if enableLomiriFeatures then "lomiri" else "ayatana") ]; }; - tests = - { - startup = nixosTests.ayatana-indicators; - } - // lib.optionalAttrs enableLomiriFeatures { - lomiri = nixosTests.lomiri.desktop-ayatana-indicator-datetime; - }; + tests = { + startup = nixosTests.ayatana-indicators; + } + // lib.optionalAttrs enableLomiriFeatures { + lomiri = nixosTests.lomiri.desktop-ayatana-indicator-datetime; + }; updateScript = gitUpdater { }; }; diff --git a/pkgs/by-name/ay/ayatana-indicator-display/package.nix b/pkgs/by-name/ay/ayatana-indicator-display/package.nix index 5777b40952d0..d4d24be8b052 100644 --- a/pkgs/by-name/ay/ayatana-indicator-display/package.nix +++ b/pkgs/by-name/ay/ayatana-indicator-display/package.nix @@ -62,26 +62,25 @@ stdenv.mkDerivation (finalAttrs: { ]; # TODO Can we get around requiring every desktop's schemas just to avoid segfaulting on some systems? - buildInputs = - [ - accountsservice - geoclue2 - gsettings-desktop-schemas # gnome schemas - glib - libayatana-common - libgudev - librda - libsForQt5.qtbase - systemd - ] - ++ (with lomiri; [ - cmake-extras - lomiri-schemas # lomiri schema - ]) - ++ (with mate; [ - mate.marco # marco schema - mate.mate-settings-daemon # mate mouse schema - ]); + buildInputs = [ + accountsservice + geoclue2 + gsettings-desktop-schemas # gnome schemas + glib + libayatana-common + libgudev + librda + libsForQt5.qtbase + systemd + ] + ++ (with lomiri; [ + cmake-extras + lomiri-schemas # lomiri schema + ]) + ++ (with mate; [ + mate.marco # marco schema + mate.mate-settings-daemon # mate mouse schema + ]); nativeCheckInputs = [ cppcheck diff --git a/pkgs/by-name/ay/ayatana-indicator-messages/package.nix b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix index 0ee00b0b3236..b839b089fd9e 100644 --- a/pkgs/by-name/ay/ayatana-indicator-messages/package.nix +++ b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix @@ -38,44 +38,43 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optionals withDocumentation [ "devdoc" ]; + ] + ++ lib.optionals withDocumentation [ "devdoc" ]; - postPatch = - '' - # Uses pkg_get_variable, cannot substitute prefix with that - substituteInPlace data/CMakeLists.txt \ - --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' + postPatch = '' + # Uses pkg_get_variable, cannot substitute prefix with that + substituteInPlace data/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' - # Bad concatenation - substituteInPlace libmessaging-menu/messaging-menu.pc.in \ - --replace-fail "\''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" '@CMAKE_INSTALL_FULL_LIBDIR@' \ - --replace-fail "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" '@CMAKE_INSTALL_FULL_INCLUDEDIR@' + # Bad concatenation + substituteInPlace libmessaging-menu/messaging-menu.pc.in \ + --replace-fail "\''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" '@CMAKE_INSTALL_FULL_LIBDIR@' \ + --replace-fail "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" '@CMAKE_INSTALL_FULL_INCLUDEDIR@' - # Fix tests with gobject-introspection 1.80 not installing GLib introspection data - substituteInPlace tests/CMakeLists.txt \ - --replace-fail 'GI_TYPELIB_PATH=\"' 'GI_TYPELIB_PATH=\"$GI_TYPELIB_PATH$\{GI_TYPELIB_PATH\:+\:\}' - '' - + lib.optionalString (!withDocumentation) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'add_subdirectory(doc)' '# add_subdirectory(doc)' - ''; + # Fix tests with gobject-introspection 1.80 not installing GLib introspection data + substituteInPlace tests/CMakeLists.txt \ + --replace-fail 'GI_TYPELIB_PATH=\"' 'GI_TYPELIB_PATH=\"$GI_TYPELIB_PATH$\{GI_TYPELIB_PATH\:+\:\}' + '' + + lib.optionalString (!withDocumentation) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(doc)' '# add_subdirectory(doc)' + ''; strictDeps = true; - nativeBuildInputs = - [ - cmake - glib # For glib-compile-schemas - intltool - pkg-config - vala - wrapGAppsHook3 - ] - ++ lib.optionals withDocumentation [ - docbook_xsl - docbook_xml_dtd_45 - gtk-doc - ]; + nativeBuildInputs = [ + cmake + glib # For glib-compile-schemas + intltool + pkg-config + vala + wrapGAppsHook3 + ] + ++ lib.optionals withDocumentation [ + docbook_xsl + docbook_xml_dtd_45 + gtk-doc + ]; buildInputs = [ accountsservice diff --git a/pkgs/by-name/ay/ayatana-indicator-power/package.nix b/pkgs/by-name/ay/ayatana-indicator-power/package.nix index a586f05f1ced..90674e4fd631 100644 --- a/pkgs/by-name/ay/ayatana-indicator-power/package.nix +++ b/pkgs/by-name/ay/ayatana-indicator-power/package.nix @@ -51,20 +51,19 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - glib - libayatana-common - libnotify - librda - systemd - ] - ++ (with lomiri; [ - cmake-extras - deviceinfo - lomiri-schemas - lomiri-sounds - ]); + buildInputs = [ + glib + libayatana-common + libnotify + librda + systemd + ] + ++ (with lomiri; [ + cmake-extras + deviceinfo + lomiri-schemas + lomiri-sounds + ]); nativeCheckInputs = [ dbus diff --git a/pkgs/by-name/ay/ayatana-indicator-sound/package.nix b/pkgs/by-name/ay/ayatana-indicator-sound/package.nix index 24fec1368290..cb21509d75ed 100644 --- a/pkgs/by-name/ay/ayatana-indicator-sound/package.nix +++ b/pkgs/by-name/ay/ayatana-indicator-sound/package.nix @@ -62,23 +62,22 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - accountsservice - glib - gobject-introspection - libayatana-common - libgee - libnotify - libpulseaudio - libxml2 - systemd - ] - ++ (with lomiri; [ - cmake-extras - lomiri-api - lomiri-schemas - ]); + buildInputs = [ + accountsservice + glib + gobject-introspection + libayatana-common + libgee + libnotify + libpulseaudio + libxml2 + systemd + ] + ++ (with lomiri; [ + cmake-extras + lomiri-api + lomiri-schemas + ]); nativeCheckInputs = [ dbus diff --git a/pkgs/by-name/az/azahar/package.nix b/pkgs/by-name/az/azahar/package.nix index b27eb7adbb65..824845a0bc6f 100644 --- a/pkgs/by-name/az/azahar/package.nix +++ b/pkgs/by-name/az/azahar/package.nix @@ -68,49 +68,48 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook ]; - buildInputs = - [ - boost - catch2_3 - cryptopp - cpp-jwt - dynarmic - enet - fmt - ffmpeg_6-headless - glslang - httplib - inih - libGL - libunwind - libusb1 - nlohmann_json - openal - openssl - portaudio - robin-map - qt6.qtbase - qt6.qtmultimedia - qt6.qttools - soundtouch - SDL2 - spirv-tools - vulkan-headers - xbyak - zstd - ] - ++ optionals enableQtTranslations [ qt6.qttools ] - ++ optionals enableCubeb [ cubeb ] - ++ optionals useDiscordRichPresence [ rapidjson ] - ++ optionals stdenv.hostPlatform.isLinux [ - pipewire - qt6.qtwayland - xorg.libX11 - xorg.libXext - ] - ++ optionals stdenv.hostPlatform.isDarwin [ - moltenvk - ]; + buildInputs = [ + boost + catch2_3 + cryptopp + cpp-jwt + dynarmic + enet + fmt + ffmpeg_6-headless + glslang + httplib + inih + libGL + libunwind + libusb1 + nlohmann_json + openal + openssl + portaudio + robin-map + qt6.qtbase + qt6.qtmultimedia + qt6.qttools + soundtouch + SDL2 + spirv-tools + vulkan-headers + xbyak + zstd + ] + ++ optionals enableQtTranslations [ qt6.qttools ] + ++ optionals enableCubeb [ cubeb ] + ++ optionals useDiscordRichPresence [ rapidjson ] + ++ optionals stdenv.hostPlatform.isLinux [ + pipewire + qt6.qtwayland + xorg.libX11 + xorg.libXext + ] + ++ optionals stdenv.hostPlatform.isDarwin [ + moltenvk + ]; patches = [ # Fix boost errors @@ -129,17 +128,16 @@ stdenv.mkDerivation (finalAttrs: { ./update-cmake-lists.patch ]; - postPatch = - '' - # We already know the submodules are present - substituteInPlace CMakeLists.txt \ - --replace-fail "check_submodules_present()" "" - '' - # Add gamemode - + optionalString enableGamemode '' - substituteInPlace externals/gamemode/include/gamemode_client.h \ - --replace-fail "libgamemode.so.0" "${getLib gamemode}/lib/libgamemode.so.0" - ''; + postPatch = '' + # We already know the submodules are present + substituteInPlace CMakeLists.txt \ + --replace-fail "check_submodules_present()" "" + '' + # Add gamemode + + optionalString enableGamemode '' + substituteInPlace externals/gamemode/include/gamemode_client.h \ + --replace-fail "libgamemode.so.0" "${getLib gamemode}/lib/libgamemode.so.0" + ''; cmakeFlags = [ (cmakeBool "USE_SYSTEM_LIBS" true) diff --git a/pkgs/by-name/az/azimuth/package.nix b/pkgs/by-name/az/azimuth/package.nix index 98680949229f..c0bf9a664cf2 100644 --- a/pkgs/by-name/az/azimuth/package.nix +++ b/pkgs/by-name/az/azimuth/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation rec { makeFlags = [ "BUILDTYPE=release" "INSTALLDIR=$(out)" - ] ++ (if installTool then [ "INSTALLTOOL=true" ] else [ "INSTALLTOOL=false" ]); + ] + ++ (if installTool then [ "INSTALLTOOL=true" ] else [ "INSTALLTOOL=false" ]); enableParallelBuilding = true; diff --git a/pkgs/by-name/az/azpainter/package.nix b/pkgs/by-name/az/azpainter/package.nix index e13781a27c30..5b9b34d80263 100644 --- a/pkgs/by-name/az/azpainter/package.nix +++ b/pkgs/by-name/az/azpainter/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { shared-mime-info # for update-mime-info ninja pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ libX11 @@ -51,7 +52,8 @@ stdenv.mkDerivation rec { libtiff libwebp zlib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; preBuild = '' cd build diff --git a/pkgs/by-name/az/azure-cli/package.nix b/pkgs/by-name/az/azure-cli/package.nix index d028066046cb..2390004e2b07 100644 --- a/pkgs/by-name/az/azure-cli/package.nix +++ b/pkgs/by-name/az/azure-cli/package.nix @@ -58,7 +58,8 @@ let passthru = { updateScript = extensionUpdateScript { inherit pname; }; tests.azWithExtension = testAzWithExts [ self ]; - } // args.passthru or { }; + } + // args.passthru or { }; meta = { inherit description; inherit (azure-cli.meta) platforms maintainers; @@ -66,7 +67,8 @@ let changelog = "https://github.com/Azure/azure-cli-extensions/blob/main/src/${pname}/HISTORY.rst"; license = lib.licenses.mit; sourceProvenance = [ lib.sourceTypes.fromSource ]; - } // args.meta or { }; + } + // args.meta or { }; } // (removeAttrs args [ "url" @@ -294,19 +296,18 @@ py.pkgs.toPythonApplication ( # wrap the executable so that the python packages are available # it's just a shebang script which calls `python -m azure.cli "$@"` - postFixup = - '' - wrapProgram $out/bin/az \ - '' - + lib.optionalString withImmutableConfig '' - --set AZURE_IMMUTABLE_DIR $out/etc/azure \ - '' - + lib.optionalString (withExtensions != [ ]) '' - --set AZURE_EXTENSION_DIR ${extensionDir} \ - '' - + '' - --set PYTHONPATH "${python3.pkgs.makePythonPath propagatedBuildInputs}:$out/${python3.sitePackages}" - ''; + postFixup = '' + wrapProgram $out/bin/az \ + '' + + lib.optionalString withImmutableConfig '' + --set AZURE_IMMUTABLE_DIR $out/etc/azure \ + '' + + lib.optionalString (withExtensions != [ ]) '' + --set AZURE_EXTENSION_DIR ${extensionDir} \ + '' + + '' + --set PYTHONPATH "${python3.pkgs.makePythonPath propagatedBuildInputs}:$out/${python3.sitePackages}" + ''; doInstallCheck = true; installCheckPhase = '' diff --git a/pkgs/by-name/ba/babeltrace/package.nix b/pkgs/by-name/ba/babeltrace/package.nix index eb36ac7a0753..da6a3cfe92a5 100644 --- a/pkgs/by-name/ba/babeltrace/package.nix +++ b/pkgs/by-name/ba/babeltrace/package.nix @@ -23,20 +23,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-Z7Q6qu9clR+nrxpVfPcgGhH+iYdrfCK6CgPLwxbbWpw="; }; - nativeBuildInputs = - [ - # The pre-generated ./configure script uses an old autoconf version which - # breaks cross-compilation (replaces references to malloc with rpl_malloc). - # Re-generate with nixpkgs's autoconf. This requires glib to be present in - # nativeBuildInputs for its m4 macros to be present. - autoreconfHook - glib - pkg-config - ] - ++ lib.optionals enablePython [ - swig - pythonPackages.setuptools - ]; + nativeBuildInputs = [ + # The pre-generated ./configure script uses an old autoconf version which + # breaks cross-compilation (replaces references to malloc with rpl_malloc). + # Re-generate with nixpkgs's autoconf. This requires glib to be present in + # nativeBuildInputs for its m4 macros to be present. + autoreconfHook + glib + pkg-config + ] + ++ lib.optionals enablePython [ + swig + pythonPackages.setuptools + ]; buildInputs = [ glib libuuid @@ -44,20 +43,19 @@ stdenv.mkDerivation (finalAttrs: { elfutils ]; - configureFlags = - [ - # --enable-debug-info (default) requires the configure script to run host - # executables to determine the elfutils library version, which cannot be done - # while cross compiling. - (lib.enableFeature (stdenv.hostPlatform == stdenv.buildPlatform) "debug-info") - ] - ++ lib.optionals enablePython [ - # Using (lib.enableFeature enablePython "python-bindings") makes the - # configure script look for python dependencies even when - # enablePython==false. Adding the configure flag conditionally seems to - # solve this. - "--enable-python-bindings" - ]; + configureFlags = [ + # --enable-debug-info (default) requires the configure script to run host + # executables to determine the elfutils library version, which cannot be done + # while cross compiling. + (lib.enableFeature (stdenv.hostPlatform == stdenv.buildPlatform) "debug-info") + ] + ++ lib.optionals enablePython [ + # Using (lib.enableFeature enablePython "python-bindings") makes the + # configure script look for python dependencies even when + # enablePython==false. Adding the configure flag conditionally seems to + # solve this. + "--enable-python-bindings" + ]; # passthru.updateScript = gitUpdater { diff --git a/pkgs/by-name/ba/babeltrace2/package.nix b/pkgs/by-name/ba/babeltrace2/package.nix index 91d6c8e35441..131f57d81412 100644 --- a/pkgs/by-name/ba/babeltrace2/package.nix +++ b/pkgs/by-name/ba/babeltrace2/package.nix @@ -37,28 +37,28 @@ stdenv.mkDerivation rec { "dev" ]; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - glib - bison - flex - asciidoc - xmlto - docbook_xml_dtd_45 - docbook_xsl - ] - ++ lib.optionals enablePython [ - swig - pythonPackages.setuptools - ensureNewerSourcesForZipFilesHook - ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + glib + bison + flex + asciidoc + xmlto + docbook_xml_dtd_45 + docbook_xsl + ] + ++ lib.optionals enablePython [ + swig + pythonPackages.setuptools + ensureNewerSourcesForZipFilesHook + ]; buildInputs = [ glib elfutils - ] ++ lib.optional enablePython python; + ] + ++ lib.optional enablePython python; configureFlags = [ (lib.enableFeature enablePython "python-bindings") diff --git a/pkgs/by-name/ba/babl/package.nix b/pkgs/by-name/ba/babl/package.nix index 9a9c7f5ac305..4028e7a9716c 100644 --- a/pkgs/by-name/ba/babl/package.nix +++ b/pkgs/by-name/ba/babl/package.nix @@ -44,15 +44,14 @@ stdenv.mkDerivation (finalAttrs: { lcms2 ]; - mesonFlags = - [ - "-Dprefix-dev=${placeholder "dev"}" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - # Docs are opt-out in native but opt-in in cross builds. - "-Dwith-docs=true" - "-Denable-gir=true" - ]; + mesonFlags = [ + "-Dprefix-dev=${placeholder "dev"}" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + # Docs are opt-out in native but opt-in in cross builds. + "-Dwith-docs=true" + "-Denable-gir=true" + ]; postFixup = '' # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. diff --git a/pkgs/by-name/ba/backrest/package.nix b/pkgs/by-name/ba/backrest/package.nix index 66c51c3bdf91..320034884852 100644 --- a/pkgs/by-name/ba/backrest/package.nix +++ b/pkgs/by-name/ba/backrest/package.nix @@ -80,16 +80,15 @@ buildGoModule { checkFlags = let - skippedTests = - [ - "TestMultihostIndexSnapshots" - "TestRunCommand" - "TestSnapshot" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "TestBackup" # relies on ionice - "TestCancelBackup" - ]; + skippedTests = [ + "TestMultihostIndexSnapshots" + "TestRunCommand" + "TestSnapshot" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "TestBackup" # relies on ionice + "TestCancelBackup" + ]; in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; diff --git a/pkgs/by-name/ba/bacon/package.nix b/pkgs/by-name/ba/bacon/package.nix index c24dd3b81c86..dd71cc1412ce 100644 --- a/pkgs/by-name/ba/bacon/package.nix +++ b/pkgs/by-name/ba/bacon/package.nix @@ -43,13 +43,12 @@ rustPlatform.buildRustPackage (finalAttrs: { "sound" ]; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals withSound [ - pkg-config - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals withSound [ + pkg-config + ]; buildInputs = lib.optionals withSound soundDependencies; diff --git a/pkgs/by-name/ba/bacula/package.nix b/pkgs/by-name/ba/bacula/package.nix index b76e7569aece..74007248fd63 100644 --- a/pkgs/by-name/ba/bacula/package.nix +++ b/pkgs/by-name/ba/bacula/package.nix @@ -27,38 +27,36 @@ stdenv.mkDerivation rec { --replace "10.*)" "*)" ''; - buildInputs = - [ - libpq - sqlite - zlib - ncurses - openssl - readline - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gettext # bacula requires CoreFoundation, but its `configure` script will only link it when it detects libintl. - ] - # acl relies on attr, which I can't get to build on darwin - ++ lib.optional (!stdenv.hostPlatform.isDarwin) acl; + buildInputs = [ + libpq + sqlite + zlib + ncurses + openssl + readline + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gettext # bacula requires CoreFoundation, but its `configure` script will only link it when it detects libintl. + ] + # acl relies on attr, which I can't get to build on darwin + ++ lib.optional (!stdenv.hostPlatform.isDarwin) acl; - configureFlags = - [ - "--with-sqlite3=${sqlite.dev}" - "--with-postgresql=${lib.getDev libpq}" - "--with-logdir=/var/log/bacula" - "--with-working-dir=/var/lib/bacula" - "--mandir=\${out}/share/man" - ] - ++ - lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) - "ac_cv_func_setpgrp_void=${if stdenv.hostPlatform.isBSD then "no" else "yes"}" - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # bacula’s `configure` script fails to detect CoreFoundation correctly, - # but these symbols are available in the nixpkgs CoreFoundation framework. - "gt_cv_func_CFLocaleCopyCurrent=yes" - "gt_cv_func_CFPreferencesCopyAppValue=yes" - ]; + configureFlags = [ + "--with-sqlite3=${sqlite.dev}" + "--with-postgresql=${lib.getDev libpq}" + "--with-logdir=/var/log/bacula" + "--with-working-dir=/var/lib/bacula" + "--mandir=\${out}/share/man" + ] + ++ + lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) + "ac_cv_func_setpgrp_void=${if stdenv.hostPlatform.isBSD then "no" else "yes"}" + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # bacula’s `configure` script fails to detect CoreFoundation correctly, + # but these symbols are available in the nixpkgs CoreFoundation framework. + "gt_cv_func_CFLocaleCopyCurrent=yes" + "gt_cv_func_CFPreferencesCopyAppValue=yes" + ]; installFlags = [ "logdir=\${out}/logdir" diff --git a/pkgs/by-name/ba/bagels/package.nix b/pkgs/by-name/ba/bagels/package.nix index e387b98b54ef..8c9dfea10a38 100644 --- a/pkgs/by-name/ba/bagels/package.nix +++ b/pkgs/by-name/ba/bagels/package.nix @@ -65,14 +65,13 @@ python3Packages.buildPythonApplication rec { yarl ]; - nativeCheckInputs = - [ - writableTmpDirAsHomeHook - ] - ++ (with python3Packages; [ - freezegun - pytestCheckHook - ]); + nativeCheckInputs = [ + writableTmpDirAsHomeHook + ] + ++ (with python3Packages; [ + freezegun + pytestCheckHook + ]); disabledTests = [ # AssertionError: assert 1 == 0 diff --git a/pkgs/by-name/ba/balena-cli/package.nix b/pkgs/by-name/ba/balena-cli/package.nix index 5818f54b71c2..8233c42c1bf3 100644 --- a/pkgs/by-name/ba/balena-cli/package.nix +++ b/pkgs/by-name/ba/balena-cli/package.nix @@ -38,15 +38,14 @@ buildNpmPackage' rec { ''; makeCacheWritable = true; - nativeBuildInputs = - [ - node-gyp' - python3 - versionCheckHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ]; + nativeBuildInputs = [ + node-gyp' + python3 + versionCheckHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ diff --git a/pkgs/by-name/ba/bambootracker/package.nix b/pkgs/by-name/ba/bambootracker/package.nix index 5b96caa3e842..4f9651fef79b 100644 --- a/pkgs/by-name/ba/bambootracker/package.nix +++ b/pkgs/by-name/ba/bambootracker/package.nix @@ -57,44 +57,41 @@ stdenv.mkDerivation (finalAttrs: { --replace 'equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12)' 'if(true)' ''; - nativeBuildInputs = - [ - pkg-config - ] - ++ (with qtPackages; [ - qmake - qttools - wrapQtAppsHook - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with qtPackages; [ + qmake + qttools + wrapQtAppsHook + ]); - buildInputs = + buildInputs = [ + rtaudio_6 + rtmidi + ] + ++ ( + with qtPackages; [ - rtaudio_6 - rtmidi + qtbase ] - ++ ( - with qtPackages; - [ - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ] - ++ lib.optionals withQt6 [ - qt5compat - ] - ); + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ] + ++ lib.optionals withQt6 [ + qt5compat + ] + ); - qmakeFlags = - [ - "CONFIG+=system_rtaudio" - "CONFIG+=system_rtmidi" - ] - ++ lib.optionals stdenv.cc.isClang [ - # Clang is extra-strict about some deprecations - # https://github.com/BambooTracker/BambooTracker/issues/506 - "CONFIG+=no_warnings_are_errors" - ]; + qmakeFlags = [ + "CONFIG+=system_rtaudio" + "CONFIG+=system_rtmidi" + ] + ++ lib.optionals stdenv.cc.isClang [ + # Clang is extra-strict about some deprecations + # https://github.com/BambooTracker/BambooTracker/issues/506 + "CONFIG+=no_warnings_are_errors" + ]; postConfigure = "make qmake_all"; diff --git a/pkgs/by-name/ba/bambu-studio/package.nix b/pkgs/by-name/ba/bambu-studio/package.nix index 389b7c0cd724..21d1f0203892 100644 --- a/pkgs/by-name/ba/bambu-studio/package.nix +++ b/pkgs/by-name/ba/bambu-studio/package.nix @@ -72,44 +72,43 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - binutils - boost186 - cereal - cgal - curl - dbus - eigen - expat - ffmpeg - gcc-unwrapped - glew - glfw - glib - glib-networking - gmp - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-good - gtk3 - hicolor-icon-theme - ilmbase - libpng - mpfr - nlopt - opencascade-occt_7_6 - openvdb - pcre - tbb_2021 - webkitgtk_4_0 - wxGTK' - xorg.libX11 - opencv.cxxdev - ] - ++ lib.optionals withSystemd [ systemd ] - ++ checkInputs; + buildInputs = [ + binutils + boost186 + cereal + cgal + curl + dbus + eigen + expat + ffmpeg + gcc-unwrapped + glew + glfw + glib + glib-networking + gmp + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-good + gtk3 + hicolor-icon-theme + ilmbase + libpng + mpfr + nlopt + opencascade-occt_7_6 + openvdb + pcre + tbb_2021 + webkitgtk_4_0 + wxGTK' + xorg.libX11 + opencv.cxxdev + ] + ++ lib.optionals withSystemd [ systemd ] + ++ checkInputs; patches = [ # Fix for webkitgtk linking diff --git a/pkgs/by-name/ba/bamf/package.nix b/pkgs/by-name/ba/bamf/package.nix index 94276bfa2565..66df815448ba 100644 --- a/pkgs/by-name/ba/bamf/package.nix +++ b/pkgs/by-name/ba/bamf/package.nix @@ -26,14 +26,13 @@ stdenv.mkDerivation rec { pname = "bamf"; version = "0.5.6"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withDocs [ - "devdoc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withDocs [ + "devdoc" + ]; src = fetchgit { url = "https://git.launchpad.net/~unity-team/bamf"; @@ -74,13 +73,12 @@ stdenv.mkDerivation rec { --replace '/usr/lib/systemd/user' '@prefix@/lib/systemd/user' ''; - configureFlags = - [ - "--enable-headless-tests" - ] - ++ lib.optionals withDocs [ - "--enable-gtk-doc" - ]; + configureFlags = [ + "--enable-headless-tests" + ] + ++ lib.optionals withDocs [ + "--enable-gtk-doc" + ]; # Fix paths makeFlags = [ diff --git a/pkgs/by-name/ba/baresip/package.nix b/pkgs/by-name/ba/baresip/package.nix index b0d677f0310d..904042be942e 100644 --- a/pkgs/by-name/ba/baresip/package.nix +++ b/pkgs/by-name/ba/baresip/package.nix @@ -38,48 +38,46 @@ stdenv.mkDerivation rec { rev = "v${version}"; hash = "sha256-0huZP1hopHaN5R1Hki6YutpvoASfIHzHMl/Y4czHHMo="; }; - prePatch = - '' - substituteInPlace cmake/FindGTK3.cmake --replace-fail GTK3_CFLAGS_OTHER "" - '' - + lib.optionalString (!dbusSupport) '' - substituteInPlace cmake/modules.cmake --replace-fail 'list(APPEND MODULES ctrl_dbus)' "" - ''; + prePatch = '' + substituteInPlace cmake/FindGTK3.cmake --replace-fail GTK3_CFLAGS_OTHER "" + '' + + lib.optionalString (!dbusSupport) '' + substituteInPlace cmake/modules.cmake --replace-fail 'list(APPEND MODULES ctrl_dbus)' "" + ''; nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = - [ - SDL2 - alsa-lib - cairo - celt - ffmpeg - gsm - gtk3 - libre - librem - libsndfile - libuuid - libv4l - libvpx - mpg123 - openssl - pipewire - portaudio - spandsp3 - speex - srtp - zlib - ] - ++ (with gst_all_1; [ - gstreamer - gst-libav - gst-plugins-base - gst-plugins-bad - gst-plugins-good - ]); + buildInputs = [ + SDL2 + alsa-lib + cairo + celt + ffmpeg + gsm + gtk3 + libre + librem + libsndfile + libuuid + libv4l + libvpx + mpg123 + openssl + pipewire + portaudio + spandsp3 + speex + srtp + zlib + ] + ++ (with gst_all_1; [ + gstreamer + gst-libav + gst-plugins-base + gst-plugins-bad + gst-plugins-good + ]); cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=ON" @@ -89,13 +87,12 @@ stdenv.mkDerivation rec { "-DGST_INCLUDE_DIRS=${lib.getDev gst_all_1.gstreamer}/include/gstreamer-1.0" ]; - makeFlags = - [ - "PREFIX=$(out)" - "CCACHE_DISABLE=1" - ] - ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}" - ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}"; + makeFlags = [ + "PREFIX=$(out)" + "CCACHE_DISABLE=1" + ] + ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}" + ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.cc.libc}"; enableParallelBuilding = true; diff --git a/pkgs/by-name/ba/barman/package.nix b/pkgs/by-name/ba/barman/package.nix index 1e2f1e8e06c4..5142a23e4ec3 100644 --- a/pkgs/by-name/ba/barman/package.nix +++ b/pkgs/by-name/ba/barman/package.nix @@ -66,16 +66,15 @@ python3Packages.buildPythonApplication rec { versionCheckHook ]; - disabledTests = - [ - # Assertion error - "test_help_output" - "test_exits_on_unsupported_target" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # FsOperationFailed - "test_get_file_mode" - ]; + disabledTests = [ + # Assertion error + "test_help_output" + "test_exits_on_unsupported_target" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # FsOperationFailed + "test_get_file_mode" + ]; passthru = { updateScript = nix-update-script { diff --git a/pkgs/by-name/ba/baserow/package.nix b/pkgs/by-name/ba/baserow/package.nix index b78cd6679862..27b9a1961fd2 100644 --- a/pkgs/by-name/ba/baserow/package.nix +++ b/pkgs/by-name/ba/baserow/package.nix @@ -106,7 +106,8 @@ buildPythonApplication rec { uvicorn watchgod zipp - ] ++ uvicorn.optional-dependencies.standard; + ] + ++ uvicorn.optional-dependencies.standard; postInstall = '' wrapProgram $out/bin/baserow \ diff --git a/pkgs/by-name/ba/bats/package.nix b/pkgs/by-name/ba/bats/package.nix index cbc059cb8654..2f28e4093b2e 100644 --- a/pkgs/by-name/ba/bats/package.nix +++ b/pkgs/by-name/ba/bats/package.nix @@ -67,14 +67,13 @@ resholve.mkDerivation rec { procps ]; fake = { - external = - [ - "greadlink" - "shlock" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "pkill" # procps doesn't supply this on darwin - ]; + external = [ + "greadlink" + "shlock" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "pkill" # procps doesn't supply this on darwin + ]; }; fix = { "$BATS_ROOT" = [ "${placeholder "out"}" ]; @@ -106,30 +105,29 @@ resholve.mkDerivation rec { "$parallel_binary_name" = "${parallel}/bin/parallel"; "${placeholder "out"}/libexec/bats-core/bats-preprocess" = true; }; - execer = - [ - /* - both blatant lies for expedience; these can certainly exec args - they may be safe here, because they may always run things that - are ultimately in libexec? - TODO: handle parallel and flock in binlore/resholve - */ - "cannot:${parallel}/bin/parallel" - "cannot:${flock}/bin/flock" + execer = [ + /* + both blatant lies for expedience; these can certainly exec args + they may be safe here, because they may always run things that + are ultimately in libexec? + TODO: handle parallel and flock in binlore/resholve + */ + "cannot:${parallel}/bin/parallel" + "cannot:${flock}/bin/flock" - "cannot:libexec/bats-core/bats-preprocess" + "cannot:libexec/bats-core/bats-preprocess" - # these do exec, but other internal files - "cannot:libexec/bats-core/bats-exec-file" - "cannot:libexec/bats-core/bats-exec-suite" - "cannot:libexec/bats-core/bats-gather-tests" + # these do exec, but other internal files + "cannot:libexec/bats-core/bats-exec-file" + "cannot:libexec/bats-core/bats-exec-suite" + "cannot:libexec/bats-core/bats-gather-tests" - "cannot:${procps}/bin/ps" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # checked invocations for exec - "cannot:${procps}/bin/pkill" - ]; + "cannot:${procps}/bin/ps" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # checked invocations for exec + "cannot:${procps}/bin/pkill" + ]; }; }; @@ -142,7 +140,8 @@ resholve.mkDerivation rec { paths = [ bats - ] ++ selector bats.libraries; + ] + ++ selector bats.libraries; nativeBuildInputs = [ makeWrapper @@ -154,105 +153,104 @@ resholve.mkDerivation rec { ''; }; - passthru.tests = - { - libraries = - runCommand "${bats.name}-with-libraries-test" - { - testScript = '' - setup() { - bats_load_library bats-support - bats_load_library bats-assert - bats_load_library bats-file - bats_load_library bats-detik/detik.bash + passthru.tests = { + libraries = + runCommand "${bats.name}-with-libraries-test" + { + testScript = '' + setup() { + bats_load_library bats-support + bats_load_library bats-assert + bats_load_library bats-file + bats_load_library bats-detik/detik.bash - bats_require_minimum_version 1.5.0 + bats_require_minimum_version 1.5.0 - TEST_TEMP_DIR="$(temp_make --prefix 'nixpkgs-bats-test')" - } + TEST_TEMP_DIR="$(temp_make --prefix 'nixpkgs-bats-test')" + } - teardown() { - temp_del "$TEST_TEMP_DIR" - } + teardown() { + temp_del "$TEST_TEMP_DIR" + } - @test echo_hi { - run -0 echo hi - assert_output "hi" - } + @test echo_hi { + run -0 echo hi + assert_output "hi" + } - @test cp_failure { - run ! cp - assert_line --index 0 "cp: missing file operand" - assert_line --index 1 "Try 'cp --help' for more information." - } + @test cp_failure { + run ! cp + assert_line --index 0 "cp: missing file operand" + assert_line --index 1 "Try 'cp --help' for more information." + } - @test file_exists { - echo "hi" > "$TEST_TEMP_DIR/hello.txt" - assert_file_exist "$TEST_TEMP_DIR/hello.txt" - run cat "$TEST_TEMP_DIR/hello.txt" - assert_output "hi" - } - ''; - passAsFile = [ "testScript" ]; - } - '' - ${ - bats.withLibraries (p: [ - p.bats-support - p.bats-assert - p.bats-file - p.bats-detik - ]) - }/bin/bats "$testScriptPath" - touch "$out" + @test file_exists { + echo "hi" > "$TEST_TEMP_DIR/hello.txt" + assert_file_exist "$TEST_TEMP_DIR/hello.txt" + run cat "$TEST_TEMP_DIR/hello.txt" + assert_output "hi" + } ''; + passAsFile = [ "testScript" ]; + } + '' + ${ + bats.withLibraries (p: [ + p.bats-support + p.bats-assert + p.bats-file + p.bats-detik + ]) + }/bin/bats "$testScriptPath" + touch "$out" + ''; - upstream = bats.unresholved.overrideAttrs (old: { - name = "${bats.name}-tests"; - dontInstall = true; # just need the build directory - nativeInstallCheckInputs = [ - ncurses - parallel # skips some tests if it can't detect - flock # skips some tests if it can't detect - procps - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ lsof ]; - inherit doInstallCheck; - installCheckPhase = - '' - # TODO: cut if https://github.com/bats-core/bats-core/issues/418 allows - sed -i '/test works even if PATH is reset/a skip "disabled for nix build"' test/bats.bats + upstream = bats.unresholved.overrideAttrs (old: { + name = "${bats.name}-tests"; + dontInstall = true; # just need the build directory + nativeInstallCheckInputs = [ + ncurses + parallel # skips some tests if it can't detect + flock # skips some tests if it can't detect + procps + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ lsof ]; + inherit doInstallCheck; + installCheckPhase = '' + # TODO: cut if https://github.com/bats-core/bats-core/issues/418 allows + sed -i '/test works even if PATH is reset/a skip "disabled for nix build"' test/bats.bats - # skip tests that assume bats `install.sh` will be in BATS_ROOT - rm test/root.bats + # skip tests that assume bats `install.sh` will be in BATS_ROOT + rm test/root.bats - '' - + (lib.optionalString stdenv.hostPlatform.isDarwin '' - # skip new timeout tests which are failing on macOS for unclear reasons - # This might relate to procps not having a pkill? - rm test/timeout.bats - '') - + '' + '' + + (lib.optionalString stdenv.hostPlatform.isDarwin '' + # skip new timeout tests which are failing on macOS for unclear reasons + # This might relate to procps not having a pkill? + rm test/timeout.bats + '') + + '' - # test generates file with absolute shebang dynamically - substituteInPlace test/install.bats --replace \ - "/usr/bin/env bash" "${bash}/bin/bash" + # test generates file with absolute shebang dynamically + substituteInPlace test/install.bats --replace \ + "/usr/bin/env bash" "${bash}/bin/bash" - ${bats}/bin/bats test - touch $out - ''; - }); + ${bats}/bin/bats test + touch $out + ''; + }); - # to see when updates would break things, include packages - # that use nixpkgs' bats for testing (as long as they - # aren't massive builds) - inherit bash-preexec locate-dominating-file packcc; - resholve = resholve.tests.cli; - } - // lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) { - # TODO: kikit's kicad dependency is marked broken on darwin atm - # may be able to fold this up if that resolves. - inherit kikit; - }; + # to see when updates would break things, include packages + # that use nixpkgs' bats for testing (as long as they + # aren't massive builds) + inherit bash-preexec locate-dominating-file packcc; + resholve = resholve.tests.cli; + } + // lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) { + # TODO: kikit's kicad dependency is marked broken on darwin atm + # may be able to fold this up if that resolves. + inherit kikit; + }; meta = with lib; { homepage = "https://github.com/bats-core/bats-core"; diff --git a/pkgs/by-name/ba/bazarr/package.nix b/pkgs/by-name/ba/bazarr/package.nix index 2be266020229..af33ef7b074e 100644 --- a/pkgs/by-name/ba/bazarr/package.nix +++ b/pkgs/by-name/ba/bazarr/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { ps.setuptools ps.psycopg2 ])) - ] ++ runtimeProgDeps; + ] + ++ runtimeProgDeps; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/bc/bcachefs-tools/package.nix b/pkgs/by-name/bc/bcachefs-tools/package.nix index 6fb5ca6cd9e9..537a4c520508 100644 --- a/pkgs/by-name/bc/bcachefs-tools/package.nix +++ b/pkgs/by-name/bc/bcachefs-tools/package.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation (finalAttrs: { zlib attr udev - ] ++ lib.optional fuseSupport fuse3; + ] + ++ lib.optional fuseSupport fuse3; cargoDeps = rustPlatform.fetchCargoVendor { src = finalAttrs.src; @@ -76,7 +77,8 @@ stdenv.mkDerivation (finalAttrs: { # Tries to install to the 'systemd-minimal' and 'udev' nix installation paths "PKGCONFIG_SERVICEDIR=$(out)/lib/systemd/system" "PKGCONFIG_UDEVDIR=$(out)/lib/udev" - ] ++ lib.optional fuseSupport "BCACHEFS_FUSE=1"; + ] + ++ lib.optional fuseSupport "BCACHEFS_FUSE=1"; env = { CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec; @@ -98,17 +100,16 @@ stdenv.mkDerivation (finalAttrs: { ''; checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ]; - postInstall = - '' - substituteInPlace $out/libexec/bcachefsck_all \ - --replace-fail "/usr/bin/python3" "${python3.interpreter}" - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd bcachefs \ - --bash <($out/sbin/bcachefs completions bash) \ - --zsh <($out/sbin/bcachefs completions zsh) \ - --fish <($out/sbin/bcachefs completions fish) - ''; + postInstall = '' + substituteInPlace $out/libexec/bcachefsck_all \ + --replace-fail "/usr/bin/python3" "${python3.interpreter}" + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd bcachefs \ + --bash <($out/sbin/bcachefs completions bash) \ + --zsh <($out/sbin/bcachefs completions zsh) \ + --fish <($out/sbin/bcachefs completions fish) + ''; passthru = { tests = { diff --git a/pkgs/by-name/be/bearssl/package.nix b/pkgs/by-name/be/bearssl/package.nix index 4dc9a2c488a5..2aff5e07108b 100644 --- a/pkgs/by-name/be/bearssl/package.nix +++ b/pkgs/by-name/be/bearssl/package.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation rec { "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" "LDDLL=${stdenv.cc.targetPrefix}cc" - ] ++ lib.optional stdenv.hostPlatform.isStatic "DLL=no"; + ] + ++ lib.optional stdenv.hostPlatform.isStatic "DLL=no"; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/be/bemenu/package.nix b/pkgs/by-name/be/bemenu/package.nix index 0da5facf1bbe..dfca37bbc0c5 100644 --- a/pkgs/by-name/be/bemenu/package.nix +++ b/pkgs/by-name/be/bemenu/package.nix @@ -36,43 +36,42 @@ stdenv.mkDerivation (finalAttrs: { ''; strictDeps = true; - nativeBuildInputs = - [ - pkg-config - scdoc - ] - ++ lib.optional stdenv.hostPlatform.isDarwin makeWrapper - ++ lib.optional waylandSupport wayland-scanner; + nativeBuildInputs = [ + pkg-config + scdoc + ] + ++ lib.optional stdenv.hostPlatform.isDarwin makeWrapper + ++ lib.optional waylandSupport wayland-scanner; - buildInputs = - [ - cairo - fribidi - harfbuzz - libxkbcommon - pango - ] - ++ lib.optional ncursesSupport ncurses - ++ lib.optionals waylandSupport [ - wayland - wayland-protocols - ] - ++ lib.optionals x11Support [ - xorg.libX11 - xorg.libXinerama - xorg.libXft - xorg.libXdmcp - xorg.libpthreadstubs - xorg.libxcb - ]; + buildInputs = [ + cairo + fribidi + harfbuzz + libxkbcommon + pango + ] + ++ lib.optional ncursesSupport ncurses + ++ lib.optionals waylandSupport [ + wayland + wayland-protocols + ] + ++ lib.optionals x11Support [ + xorg.libX11 + xorg.libXinerama + xorg.libXft + xorg.libXdmcp + xorg.libpthreadstubs + xorg.libxcb + ]; makeFlags = [ "PREFIX=$(out)" ]; - buildFlags = - [ "clients" ] - ++ lib.optional ncursesSupport "curses" - ++ lib.optional waylandSupport "wayland" - ++ lib.optional x11Support "x11"; + buildFlags = [ + "clients" + ] + ++ lib.optional ncursesSupport "curses" + ++ lib.optional waylandSupport "wayland" + ++ lib.optional x11Support "x11"; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' so="$(find "$out/lib" -name "libbemenu.so.[0-9]" -print -quit)" diff --git a/pkgs/by-name/be/bento4/package.nix b/pkgs/by-name/be/bento4/package.nix index 2b7dc79faf2d..d32d54457110 100644 --- a/pkgs/by-name/be/bento4/package.nix +++ b/pkgs/by-name/be/bento4/package.nix @@ -21,13 +21,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DCMAKE_OSX_ARCHITECTURES=" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_OSX_ARCHITECTURES=" + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/be/bespokesynth/package.nix b/pkgs/by-name/be/bespokesynth/package.nix index d9bd14d19e2f..1e95ca7792a2 100644 --- a/pkgs/by-name/be/bespokesynth/package.nix +++ b/pkgs/by-name/be/bespokesynth/package.nix @@ -68,14 +68,13 @@ stdenv.mkDerivation (finalAttrs: { cmakeBuildType = "Release"; - cmakeFlags = - [ - (lib.cmakeBool "BESPOKE_SYSTEM_PYBIND11" true) - (lib.cmakeBool "BESPOKE_SYSTEM_JSONCPP" true) - ] - ++ lib.optionals enableVST2 [ - (lib.cmakeFeature "BESPOKE_VST2_SDK_LOCATION" "${vst2-sdk}") - ]; + cmakeFlags = [ + (lib.cmakeBool "BESPOKE_SYSTEM_PYBIND11" true) + (lib.cmakeBool "BESPOKE_SYSTEM_JSONCPP" true) + ] + ++ lib.optionals enableVST2 [ + (lib.cmakeFeature "BESPOKE_VST2_SDK_LOCATION" "${vst2-sdk}") + ]; strictDeps = true; @@ -87,45 +86,44 @@ stdenv.mkDerivation (finalAttrs: { ninja ]; - buildInputs = - [ - jsoncpp - # library & headers - (python3.withPackages ( - ps: with ps; [ - pybind11 - ] - )) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # List obtained from https://github.com/BespokeSynth/BespokeSynth/blob/main/azure-pipelines.yml - libX11 - libXrandr - libXinerama - libXext - libXcursor - libXScrnSaver - curl - gtk3 - webkitgtk_4_1 - freetype - libGL - libusb1 - alsa-lib - libjack2 - zenity - alsa-tools - libxcb - xcbutil - libxkbcommon - xcbutilkeysyms - xcb-util-cursor - pcre - mount - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_11 - ]; + buildInputs = [ + jsoncpp + # library & headers + (python3.withPackages ( + ps: with ps; [ + pybind11 + ] + )) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # List obtained from https://github.com/BespokeSynth/BespokeSynth/blob/main/azure-pipelines.yml + libX11 + libXrandr + libXinerama + libXext + libXcursor + libXScrnSaver + curl + gtk3 + webkitgtk_4_1 + freetype + libGL + libusb1 + alsa-lib + libjack2 + zenity + alsa-tools + libxcb + xcbutil + libxkbcommon + xcbutilkeysyms + xcb-util-cursor + pcre + mount + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_11 + ]; postInstall = if stdenv.hostPlatform.isDarwin then diff --git a/pkgs/by-name/be/bettercap/package.nix b/pkgs/by-name/be/bettercap/package.nix index 5350ae76ebe0..6fd5bf71f1ff 100644 --- a/pkgs/by-name/be/bettercap/package.nix +++ b/pkgs/by-name/be/bettercap/package.nix @@ -26,15 +26,14 @@ buildGoModule rec { doCheck = false; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libpcap - libusb1 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libnfnetlink - libnetfilter_queue - ]; + buildInputs = [ + libpcap + libusb1 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libnfnetlink + libnetfilter_queue + ]; meta = with lib; { description = "Man in the middle tool"; diff --git a/pkgs/by-name/be/betterlockscreen/package.nix b/pkgs/by-name/be/betterlockscreen/package.nix index eb0dec9f184d..71c86c823b28 100644 --- a/pkgs/by-name/be/betterlockscreen/package.nix +++ b/pkgs/by-name/be/betterlockscreen/package.nix @@ -33,7 +33,8 @@ let xorg.xdpyinfo xorg.xrandr xorg.xset - ] ++ lib.optionals withDunst [ dunst ]; + ] + ++ lib.optionals withDunst [ dunst ]; in stdenv.mkDerivation rec { diff --git a/pkgs/by-name/bf/bfs/package.nix b/pkgs/by-name/bf/bfs/package.nix index f2327395e4f1..cc7b30030b0c 100644 --- a/pkgs/by-name/bf/bfs/package.nix +++ b/pkgs/by-name/bf/bfs/package.nix @@ -20,14 +20,15 @@ stdenv.mkDerivation rec { hash = "sha256-yZoyDa8um3UA8K9Ty17xaGUvQmJA/agZPBsNo+/6weI="; }; - buildInputs = - [ oniguruma ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - acl - attr - libcap - liburing - ]; + buildInputs = [ + oniguruma + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + acl + attr + libcap + liburing + ]; configureFlags = [ "--enable-release" ]; makeFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/by-name/bi/biber-ms/package.nix b/pkgs/by-name/bi/biber-ms/package.nix index b2f7000539c8..0ab78240ec49 100644 --- a/pkgs/by-name/bi/biber-ms/package.nix +++ b/pkgs/by-name/bi/biber-ms/package.nix @@ -84,13 +84,12 @@ perlPackages.buildPerlModule { cp '${multiscriptBltxml}' t/tdata/multiscript.bltxml ''; - postInstall = - '' - mv "$out"/bin/biber{,-ms} - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang "$out"/bin/biber-ms - ''; + postInstall = '' + mv "$out"/bin/biber{,-ms} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + shortenPerlShebang "$out"/bin/biber-ms + ''; meta = with lib; { description = "Backend for BibLaTeX (multiscript version)"; diff --git a/pkgs/by-name/bi/biblioteca/package.nix b/pkgs/by-name/bi/biblioteca/package.nix index da7aaefd56ad..df7d93fd492f 100644 --- a/pkgs/by-name/bi/biblioteca/package.nix +++ b/pkgs/by-name/bi/biblioteca/package.nix @@ -65,7 +65,8 @@ stdenv.mkDerivation (finalAttrs: { libadwaita.devdoc webkitgtk.devdoc gobject-introspection.devdoc - ] ++ extraDocsPackage; + ] + ++ extraDocsPackage; }; postPatch = '' diff --git a/pkgs/by-name/bi/biboumi/package.nix b/pkgs/by-name/bi/biboumi/package.nix index cf7f744e2f84..107c6e79c1a1 100644 --- a/pkgs/by-name/bi/biboumi/package.nix +++ b/pkgs/by-name/bi/biboumi/package.nix @@ -48,18 +48,17 @@ stdenv.mkDerivation rec { pkg-config python3Packages.sphinx ]; - buildInputs = - [ - libuuid - expat - libiconv - systemd - botan2 - ] - ++ lib.optional withIDN libidn - ++ lib.optional withPostgreSQL libpq - ++ lib.optional withSQLite sqlite - ++ lib.optional withUDNS udns; + buildInputs = [ + libuuid + expat + libiconv + systemd + botan2 + ] + ++ lib.optional withIDN libidn + ++ lib.optional withPostgreSQL libpq + ++ lib.optional withSQLite sqlite + ++ lib.optional withUDNS udns; buildFlags = [ "all" diff --git a/pkgs/by-name/bi/bind/package.nix b/pkgs/by-name/bi/bind/package.nix index d2caaadd4999..3add9a0b6121 100644 --- a/pkgs/by-name/bi/bind/package.nix +++ b/pkgs/by-name/bi/bind/package.nix @@ -52,31 +52,29 @@ stdenv.mkDerivation (finalAttrs: { pkg-config removeReferencesTo ]; - buildInputs = - [ - libidn2 - libtool - libxml2 - openssl - liburcu - libuv - nghttp2 - jemalloc - ] - ++ lib.optional stdenv.hostPlatform.isLinux libcap - ++ lib.optional enableGSSAPI libkrb5 - ++ lib.optional enablePython (python3.withPackages (ps: with ps; [ ply ])); + buildInputs = [ + libidn2 + libtool + libxml2 + openssl + liburcu + libuv + nghttp2 + jemalloc + ] + ++ lib.optional stdenv.hostPlatform.isLinux libcap + ++ lib.optional enableGSSAPI libkrb5 + ++ lib.optional enablePython (python3.withPackages (ps: with ps; [ ply ])); depsBuildBuild = [ buildPackages.stdenv.cc ]; - configureFlags = - [ - "--localstatedir=/var" - "--without-lmdb" - "--with-libidn2" - ] - ++ lib.optional enableGSSAPI "--with-gssapi=${libkrb5.dev}/bin/krb5-config" - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "BUILD_CC=$(CC_FOR_BUILD)"; + configureFlags = [ + "--localstatedir=/var" + "--without-lmdb" + "--with-libidn2" + ] + ++ lib.optional enableGSSAPI "--with-gssapi=${libkrb5.dev}/bin/krb5-config" + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "BUILD_CC=$(CC_FOR_BUILD)"; postInstall = '' moveToOutput bin/bind9-config $dev @@ -114,13 +112,12 @@ stdenv.mkDerivation (finalAttrs: { && !is32bit; */ checkTarget = "unit"; - checkInputs = - [ - cmocka - ] - ++ lib.optionals (!stdenv.hostPlatform.isMusl) [ - tzdata - ]; + checkInputs = [ + cmocka + ] + ++ lib.optionals (!stdenv.hostPlatform.isMusl) [ + tzdata + ]; preCheck = lib.optionalString stdenv.hostPlatform.isMusl '' # musl doesn't respect TZDIR, skip timezone-related tests @@ -136,16 +133,15 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru = { - tests = - { - withCheck = finalAttrs.finalPackage.overrideAttrs { doCheck = true; }; - inherit (nixosTests) bind; - prometheus-exporter = nixosTests.prometheus-exporters.bind; - } - // lib.optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux") { - kubernetes-dns-single-node = nixosTests.kubernetes.dns-single-node; - kubernetes-dns-multi-node = nixosTests.kubernetes.dns-multi-node; - }; + tests = { + withCheck = finalAttrs.finalPackage.overrideAttrs { doCheck = true; }; + inherit (nixosTests) bind; + prometheus-exporter = nixosTests.prometheus-exporters.bind; + } + // lib.optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux") { + kubernetes-dns-single-node = nixosTests.kubernetes.dns-single-node; + kubernetes-dns-multi-node = nixosTests.kubernetes.dns-multi-node; + }; updateScript = gitUpdater { # No nicer place to find latest stable release. diff --git a/pkgs/by-name/bi/binwalk/package.nix b/pkgs/by-name/bi/binwalk/package.nix index 69b3d8405d18..ebc0b937de76 100644 --- a/pkgs/by-name/bi/binwalk/package.nix +++ b/pkgs/by-name/bi/binwalk/package.nix @@ -73,27 +73,26 @@ rustPlatform.buildRustPackage (finalAttrs: { dontUseCargoParallelTests = true; # skip broken tests - checkFlags = - [ - "--skip=binwalk::Binwalk" - "--skip=binwalk::Binwalk::scan" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--skip=binwalk::Binwalk::analyze" - "--skip=binwalk::Binwalk::extract" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--skip=extractors::common::Chroot::append_to_file" - "--skip=extractors::common::Chroot::carve_file" - "--skip=extractors::common::Chroot::create_block_device" - "--skip=extractors::common::Chroot::create_character_device" - "--skip=extractors::common::Chroot::create_directory" - "--skip=extractors::common::Chroot::create_fifo" - "--skip=extractors::common::Chroot::create_file" - "--skip=extractors::common::Chroot::create_socket" - "--skip=extractors::common::Chroot::create_symlink" - "--skip=extractors::common::Chroot::make_executable" - ]; + checkFlags = [ + "--skip=binwalk::Binwalk" + "--skip=binwalk::Binwalk::scan" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--skip=binwalk::Binwalk::analyze" + "--skip=binwalk::Binwalk::extract" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--skip=extractors::common::Chroot::append_to_file" + "--skip=extractors::common::Chroot::carve_file" + "--skip=extractors::common::Chroot::create_block_device" + "--skip=extractors::common::Chroot::create_character_device" + "--skip=extractors::common::Chroot::create_directory" + "--skip=extractors::common::Chroot::create_fifo" + "--skip=extractors::common::Chroot::create_file" + "--skip=extractors::common::Chroot::create_socket" + "--skip=extractors::common::Chroot::create_symlink" + "--skip=extractors::common::Chroot::make_executable" + ]; nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; diff --git a/pkgs/by-name/bi/bison/package.nix b/pkgs/by-name/bi/bison/package.nix index f4b83b2bdec3..d1c015601320 100644 --- a/pkgs/by-name/bi/bison/package.nix +++ b/pkgs/by-name/bi/bison/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ m4 perl - ] ++ lib.optional stdenv.hostPlatform.isSunOS help2man; + ] + ++ lib.optional stdenv.hostPlatform.isSunOS help2man; propagatedBuildInputs = [ m4 ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/bi/bite/package.nix b/pkgs/by-name/bi/bite/package.nix index c33b80ca7938..18f7073e914e 100644 --- a/pkgs/by-name/bi/bite/package.nix +++ b/pkgs/by-name/bi/bite/package.nix @@ -40,32 +40,30 @@ rustPlatform.buildRustPackage rec { imagemagick ]; - buildInputs = - [ - atk - cairo - gdk-pixbuf - glib - gtk3 - libxkbcommon - pango - vulkan-loader - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_15 - ]; + buildInputs = [ + atk + cairo + gdk-pixbuf + glib + gtk3 + libxkbcommon + pango + vulkan-loader + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_15 + ]; - runtimeDependencies = - [ - libxkbcommon - vulkan-loader - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - ]; + runtimeDependencies = [ + libxkbcommon + vulkan-loader + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + ]; postInstall = '' wrapProgram $out/bin/bite \ diff --git a/pkgs/by-name/bi/bitsnpicas/package.nix b/pkgs/by-name/bi/bitsnpicas/package.nix index bd168a684389..a4657a92fd96 100644 --- a/pkgs/by-name/bi/bitsnpicas/package.nix +++ b/pkgs/by-name/bi/bitsnpicas/package.nix @@ -22,45 +22,43 @@ stdenvNoCC.mkDerivation (finalAttrs: { hash = "sha256-hw7UuzesqpmnTjgpfikAIYyY70ni7BxjaUtHAPEdkXI="; }; - nativeBuildInputs = - [ - jdk - zip - makeWrapper - ] - ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ - desktop-file-utils - ]; + nativeBuildInputs = [ + jdk + zip + makeWrapper + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ + desktop-file-utils + ]; sourceRoot = "${finalAttrs.src.name}/main/java/BitsNPicas"; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - install -Dm444 BitsNPicas.jar "$out/share/java/bitsnpicas.jar" - install -Dm444 MapEdit.jar "$out/share/java/mapedit.jar" - install -Dm444 KeyEdit.jar "$out/share/java/keyedit.jar" + install -Dm444 BitsNPicas.jar "$out/share/java/bitsnpicas.jar" + install -Dm444 MapEdit.jar "$out/share/java/mapedit.jar" + install -Dm444 KeyEdit.jar "$out/share/java/keyedit.jar" - makeWrapper "${jre}/bin/java" "$out/bin/bitsnpicas" \ - --add-flags "-jar $out/share/java/bitsnpicas.jar" - makeWrapper "${jre}/bin/java" "$out/bin/mapedit" \ - --add-flags "-jar $out/share/java/mapedit.jar" - makeWrapper "${jre}/bin/java" "$out/bin/keyedit" \ - --add-flags "-jar $out/share/java/keyedit.jar" + makeWrapper "${jre}/bin/java" "$out/bin/bitsnpicas" \ + --add-flags "-jar $out/share/java/bitsnpicas.jar" + makeWrapper "${jre}/bin/java" "$out/bin/mapedit" \ + --add-flags "-jar $out/share/java/mapedit.jar" + makeWrapper "${jre}/bin/java" "$out/bin/keyedit" \ + --add-flags "-jar $out/share/java/keyedit.jar" - install -Dm444 dep/bitsnpicas.png "$out/share/icons/hicolor/128x128/apps/bitsnpicas.png" - install -Dm444 dep/kbnp-icon.png "$out/share/icons/hicolor/512x512/apps/bitsnpicas.png" - install -Dm444 dep/mapedit-icon.png "$out/share/icons/hicolor/512x512/apps/mapedit.png" - install -Dm444 dep/keyedit-icon.png "$out/share/icons/hicolor/256x256/apps/keyedit.png" - '' - + lib.optionalString stdenvNoCC.hostPlatform.isLinux '' - mkdir -p "$out/share/applications/" - cp dep/*.desktop "$out/share/applications/" - '' - + '' - runHook postInstall - ''; + install -Dm444 dep/bitsnpicas.png "$out/share/icons/hicolor/128x128/apps/bitsnpicas.png" + install -Dm444 dep/kbnp-icon.png "$out/share/icons/hicolor/512x512/apps/bitsnpicas.png" + install -Dm444 dep/mapedit-icon.png "$out/share/icons/hicolor/512x512/apps/mapedit.png" + install -Dm444 dep/keyedit-icon.png "$out/share/icons/hicolor/256x256/apps/keyedit.png" + '' + + lib.optionalString stdenvNoCC.hostPlatform.isLinux '' + mkdir -p "$out/share/applications/" + cp dep/*.desktop "$out/share/applications/" + '' + + '' + runHook postInstall + ''; postFixup = lib.optionalString stdenvNoCC.hostPlatform.isLinux '' desktop-file-edit "$out/share/applications/bitsnpicas.desktop" \ diff --git a/pkgs/by-name/bi/bitwarden-cli/package.nix b/pkgs/by-name/bi/bitwarden-cli/package.nix index 773a788ed663..85ee2cb8631f 100644 --- a/pkgs/by-name/bi/bitwarden-cli/package.nix +++ b/pkgs/by-name/bi/bitwarden-cli/package.nix @@ -74,16 +74,15 @@ buildNpmPackage rec { shopt -u globstar ''; - postInstall = - '' - # The @bitwarden modules are actually npm workspaces inside the source tree, which - # leave dangling symlinks behind. They can be safely removed, because their source is - # bundled via webpack and thus not needed at run-time. - rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/{@bitwarden,.bin} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd bw --zsh <($out/bin/bw completion --shell zsh) - ''; + postInstall = '' + # The @bitwarden modules are actually npm workspaces inside the source tree, which + # leave dangling symlinks behind. They can be safely removed, because their source is + # bundled via webpack and thus not needed at run-time. + rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/{@bitwarden,.bin} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd bw --zsh <($out/bin/bw completion --shell zsh) + ''; passthru = { tests = { diff --git a/pkgs/by-name/bi/bitwarden-desktop/package.nix b/pkgs/by-name/bi/bitwarden-desktop/package.nix index 88fa988bc615..d872ba2ae8f8 100644 --- a/pkgs/by-name/bi/bitwarden-desktop/package.nix +++ b/pkgs/by-name/bi/bitwarden-desktop/package.nix @@ -101,24 +101,23 @@ buildNpmPackage' rec { # make electron-builder not attempt to codesign the app on darwin env.CSC_IDENTITY_AUTO_DISCOVERY = "false"; - nativeBuildInputs = - [ - cargo - jq - makeWrapper - napi-rs-cli - pkg-config - rustc - rustPlatform.cargoCheckHook - rustPlatform.cargoSetupHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - copyDesktopItems - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + cargo + jq + makeWrapper + napi-rs-cli + pkg-config + rustc + rustPlatform.cargoCheckHook + rustPlatform.cargoSetupHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + copyDesktopItems + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild + darwin.autoSignDarwinBinariesHook + ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_14 @@ -157,13 +156,12 @@ buildNpmPackage' rec { (gnome-keyring.override { useWrappedDaemon = false; }) ]; - checkFlags = - [ - "--skip=password::password::tests::test" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--skip=clipboard::tests::test_write_read" - ]; + checkFlags = [ + "--skip=password::password::tests::test" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--skip=clipboard::tests::test_write_read" + ]; preCheck = '' pushd ${cargoRoot} @@ -175,43 +173,42 @@ buildNpmPackage' rec { popd ''; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r apps/desktop/dist/mac*/Bitwarden.app $out/Applications - makeWrapper $out/Applications/Bitwarden.app/Contents/MacOS/Bitwarden $out/bin/bitwarden - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/opt/Bitwarden - cp -r apps/desktop/dist/linux-*unpacked/{locales,resources{,.pak}} $out/opt/Bitwarden + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r apps/desktop/dist/mac*/Bitwarden.app $out/Applications + makeWrapper $out/Applications/Bitwarden.app/Contents/MacOS/Bitwarden $out/bin/bitwarden + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/opt/Bitwarden + cp -r apps/desktop/dist/linux-*unpacked/{locales,resources{,.pak}} $out/opt/Bitwarden - makeWrapper '${lib.getExe electron}' "$out/bin/bitwarden" \ - --add-flags $out/opt/Bitwarden/resources/app.asar \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --set-default ELECTRON_IS_DEV 0 \ - --inherit-argv0 + makeWrapper '${lib.getExe electron}' "$out/bin/bitwarden" \ + --add-flags $out/opt/Bitwarden/resources/app.asar \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --set-default ELECTRON_IS_DEV 0 \ + --inherit-argv0 - # Extract the polkit policy file from the multiline string in the source code. - # This may break in the future but its better than copy-pasting it manually. - mkdir -p $out/share/polkit-1/actions/ - pushd apps/desktop/src/key-management/biometrics - awk '/const polkitPolicy = `/{gsub(/^.*`/, ""); print; str=1; next} str{if (/`;/) str=0; gsub(/`;/, ""); print}' os-biometrics-linux.service.ts > $out/share/polkit-1/actions/com.bitwarden.Bitwarden.policy - popd + # Extract the polkit policy file from the multiline string in the source code. + # This may break in the future but its better than copy-pasting it manually. + mkdir -p $out/share/polkit-1/actions/ + pushd apps/desktop/src/key-management/biometrics + awk '/const polkitPolicy = `/{gsub(/^.*`/, ""); print; str=1; next} str{if (/`;/) str=0; gsub(/`;/, ""); print}' os-biometrics-linux.service.ts > $out/share/polkit-1/actions/com.bitwarden.Bitwarden.policy + popd - pushd apps/desktop/resources/icons - for icon in *.png; do - dir=$out/share/icons/hicolor/"''${icon%.png}"/apps - mkdir -p "$dir" - cp "$icon" "$dir"/${icon}.png - done - popd - '' - + '' - runHook postInstall - ''; + pushd apps/desktop/resources/icons + for icon in *.png; do + dir=$out/share/icons/hicolor/"''${icon%.png}"/apps + mkdir -p "$dir" + cp "$icon" "$dir"/${icon}.png + done + popd + '' + + '' + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/bl/blackbox-terminal/package.nix b/pkgs/by-name/bl/blackbox-terminal/package.nix index 34942572c5b1..60c8e647791b 100644 --- a/pkgs/by-name/bl/blackbox-terminal/package.nix +++ b/pkgs/by-name/bl/blackbox-terminal/package.nix @@ -84,11 +84,9 @@ stdenv.mkDerivation rec { hash = "sha256-vz9ircmPy2Q4fxNnjurkgJtuTSS49rBq/m61p1B43eU="; }; patches = lib.optional (old ? patches) (lib.head old.patches); - postPatch = - (old.postPatch or "") - + '' - patchShebangs src/box_drawing_generate.sh - ''; + postPatch = (old.postPatch or "") + '' + patchShebangs src/box_drawing_generate.sh + ''; } // lib.optionalAttrs sixelSupport { buildInputs = old.buildInputs ++ [ libsixel ]; diff --git a/pkgs/by-name/bl/blahtexml/package.nix b/pkgs/by-name/bl/blahtexml/package.nix index bc451c32034e..2053eb68790e 100644 --- a/pkgs/by-name/bl/blahtexml/package.nix +++ b/pkgs/by-name/bl/blahtexml/package.nix @@ -24,11 +24,11 @@ stdenv.mkDerivation rec { --replace "\$(CXX)" "\$(CXX) -std=c++98" '' + - # fix the doc build on TeX Live 2023 - '' - substituteInPlace Documentation/manual.tex \ - --replace '\usepackage[utf8x]{inputenc}' '\usepackage[utf8]{inputenc}' - ''; + # fix the doc build on TeX Live 2023 + '' + substituteInPlace Documentation/manual.tex \ + --replace '\usepackage[utf8x]{inputenc}' '\usepackage[utf8]{inputenc}' + ''; outputs = [ "out" @@ -38,20 +38,21 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ texliveFull ]; # scheme-full needed for ucs package buildInputs = [ xercesc ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; - buildFlags = - [ "doc" ] - ++ ( - if stdenv.hostPlatform.isDarwin then - [ - "blahtex-mac" - "blahtexml-mac" - ] - else - [ - "blahtex-linux" - "blahtexml-linux" - ] - ); + buildFlags = [ + "doc" + ] + ++ ( + if stdenv.hostPlatform.isDarwin then + [ + "blahtex-mac" + "blahtexml-mac" + ] + else + [ + "blahtex-linux" + "blahtexml-linux" + ] + ); installPhase = '' install -D -t "$out/bin" blahtex blahtexml diff --git a/pkgs/by-name/bl/bleep/package.nix b/pkgs/by-name/bl/bleep/package.nix index 469f43f6a195..e6a722fc185a 100644 --- a/pkgs/by-name/bl/bleep/package.nix +++ b/pkgs/by-name/bl/bleep/package.nix @@ -36,7 +36,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { nativeBuildInputs = [ installShellFiles makeWrapper - ] ++ lib.optional stdenvNoCC.hostPlatform.isLinux autoPatchelfHook; + ] + ++ lib.optional stdenvNoCC.hostPlatform.isLinux autoPatchelfHook; buildInputs = [ zlib ]; diff --git a/pkgs/by-name/bl/blender/package.nix b/pkgs/by-name/bl/blender/package.nix index d5c20f992107..dbc625085c3d 100644 --- a/pkgs/by-name/bl/blender/package.nix +++ b/pkgs/by-name/bl/blender/package.nix @@ -143,65 +143,64 @@ stdenv'.mkDerivation (finalAttrs: { env.NIX_CFLAGS_COMPILE = "-I${python3}/include/${python3.libPrefix}"; - cmakeFlags = - [ - "-DMaterialX_DIR=${python3Packages.materialx}/lib/cmake/MaterialX" - "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}" - "-DPYTHON_LIBPATH=${python3}/lib" - "-DPYTHON_LIBRARY=${python3.libPrefix}" - "-DPYTHON_NUMPY_INCLUDE_DIRS=${python3Packages.numpy_1}/${python3.sitePackages}/numpy/core/include" - "-DPYTHON_NUMPY_PATH=${python3Packages.numpy_1}/${python3.sitePackages}" - "-DPYTHON_VERSION=${python3.pythonVersion}" - "-DWITH_ALEMBIC=ON" - "-DWITH_ASSERT_ABORT=OFF" - "-DWITH_BUILDINFO=OFF" - "-DWITH_CODEC_FFMPEG=ON" - "-DWITH_CODEC_SNDFILE=ON" - "-DWITH_CPU_CHECK=OFF" - "-DWITH_CYCLES_DEVICE_OPTIX=${if cudaSupport then "ON" else "OFF"}" - "-DWITH_CYCLES_EMBREE=${if embreeSupport then "ON" else "OFF"}" - "-DWITH_CYCLES_OSL=OFF" - "-DWITH_FFTW3=ON" - "-DWITH_HYDRA=${if openUsdSupport then "ON" else "OFF"}" - "-DWITH_IMAGE_OPENJPEG=ON" - "-DWITH_INSTALL_PORTABLE=OFF" - "-DWITH_JACK=${if jackaudioSupport then "ON" else "OFF"}" - "-DWITH_LIBS_PRECOMPILED=OFF" - "-DWITH_MOD_OCEANSIM=ON" - "-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}" - "-DWITH_OPENCOLORIO=ON" - "-DWITH_OPENIMAGEDENOISE=${if openImageDenoiseSupport then "ON" else "OFF"}" - "-DWITH_OPENSUBDIV=ON" - "-DWITH_OPENVDB=ON" - "-DWITH_PIPEWIRE=OFF" - "-DWITH_PULSEAUDIO=OFF" - "-DWITH_PYTHON_INSTALL=OFF" - "-DWITH_PYTHON_INSTALL_NUMPY=OFF" - "-DWITH_PYTHON_INSTALL_REQUESTS=OFF" - "-DWITH_SDL=OFF" - "-DWITH_STRICT_BUILD_OPTIONS=ON" - "-DWITH_TBB=ON" - "-DWITH_USD=${if openUsdSupport then "ON" else "OFF"}" + cmakeFlags = [ + "-DMaterialX_DIR=${python3Packages.materialx}/lib/cmake/MaterialX" + "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}" + "-DPYTHON_LIBPATH=${python3}/lib" + "-DPYTHON_LIBRARY=${python3.libPrefix}" + "-DPYTHON_NUMPY_INCLUDE_DIRS=${python3Packages.numpy_1}/${python3.sitePackages}/numpy/core/include" + "-DPYTHON_NUMPY_PATH=${python3Packages.numpy_1}/${python3.sitePackages}" + "-DPYTHON_VERSION=${python3.pythonVersion}" + "-DWITH_ALEMBIC=ON" + "-DWITH_ASSERT_ABORT=OFF" + "-DWITH_BUILDINFO=OFF" + "-DWITH_CODEC_FFMPEG=ON" + "-DWITH_CODEC_SNDFILE=ON" + "-DWITH_CPU_CHECK=OFF" + "-DWITH_CYCLES_DEVICE_OPTIX=${if cudaSupport then "ON" else "OFF"}" + "-DWITH_CYCLES_EMBREE=${if embreeSupport then "ON" else "OFF"}" + "-DWITH_CYCLES_OSL=OFF" + "-DWITH_FFTW3=ON" + "-DWITH_HYDRA=${if openUsdSupport then "ON" else "OFF"}" + "-DWITH_IMAGE_OPENJPEG=ON" + "-DWITH_INSTALL_PORTABLE=OFF" + "-DWITH_JACK=${if jackaudioSupport then "ON" else "OFF"}" + "-DWITH_LIBS_PRECOMPILED=OFF" + "-DWITH_MOD_OCEANSIM=ON" + "-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}" + "-DWITH_OPENCOLORIO=ON" + "-DWITH_OPENIMAGEDENOISE=${if openImageDenoiseSupport then "ON" else "OFF"}" + "-DWITH_OPENSUBDIV=ON" + "-DWITH_OPENVDB=ON" + "-DWITH_PIPEWIRE=OFF" + "-DWITH_PULSEAUDIO=OFF" + "-DWITH_PYTHON_INSTALL=OFF" + "-DWITH_PYTHON_INSTALL_NUMPY=OFF" + "-DWITH_PYTHON_INSTALL_REQUESTS=OFF" + "-DWITH_SDL=OFF" + "-DWITH_STRICT_BUILD_OPTIONS=ON" + "-DWITH_TBB=ON" + "-DWITH_USD=${if openUsdSupport then "ON" else "OFF"}" - # Blender supplies its own FindAlembic.cmake (incompatible with the Alembic-supplied config file) - "-DALEMBIC_INCLUDE_DIR=${lib.getDev alembic}/include" - "-DALEMBIC_LIBRARY=${lib.getLib alembic}/lib/libAlembic${stdenv.hostPlatform.extensions.sharedLibrary}" - ] - ++ lib.optionals waylandSupport [ - "-DWITH_GHOST_WAYLAND=ON" - "-DWITH_GHOST_WAYLAND_DBUS=ON" - "-DWITH_GHOST_WAYLAND_DYNLOAD=OFF" - "-DWITH_GHOST_WAYLAND_LIBDECOR=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DLIBDIR=/does-not-exist" - "-DSSE2NEON_INCLUDE_DIR=${sse2neon}/lib" - ] - ++ lib.optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS=" # Clang doesn't support "-export-dynamic" - ++ lib.optionals cudaSupport [ - "-DOPTIX_ROOT_DIR=${optix}" - "-DWITH_CYCLES_CUDA_BINARIES=ON" - ]; + # Blender supplies its own FindAlembic.cmake (incompatible with the Alembic-supplied config file) + "-DALEMBIC_INCLUDE_DIR=${lib.getDev alembic}/include" + "-DALEMBIC_LIBRARY=${lib.getLib alembic}/lib/libAlembic${stdenv.hostPlatform.extensions.sharedLibrary}" + ] + ++ lib.optionals waylandSupport [ + "-DWITH_GHOST_WAYLAND=ON" + "-DWITH_GHOST_WAYLAND_DBUS=ON" + "-DWITH_GHOST_WAYLAND_DYNLOAD=OFF" + "-DWITH_GHOST_WAYLAND_LIBDECOR=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DLIBDIR=/does-not-exist" + "-DSSE2NEON_INCLUDE_DIR=${sse2neon}/lib" + ] + ++ lib.optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS=" # Clang doesn't support "-export-dynamic" + ++ lib.optionals cudaSupport [ + "-DOPTIX_ROOT_DIR=${optix}" + "-DWITH_CYCLES_CUDA_BINARIES=ON" + ]; preConfigure = '' ( @@ -214,102 +213,100 @@ stdenv'.mkDerivation (finalAttrs: { ) ''; - nativeBuildInputs = - [ - cmake - llvmPackages.llvm.dev - makeWrapper - python3Packages.wrapPython - ] - ++ lib.optionals cudaSupport [ - addDriverRunpath - cudaPackages.cuda_nvcc - ] - ++ lib.optionals waylandSupport [ - pkg-config - wayland-scanner - ]; + nativeBuildInputs = [ + cmake + llvmPackages.llvm.dev + makeWrapper + python3Packages.wrapPython + ] + ++ lib.optionals cudaSupport [ + addDriverRunpath + cudaPackages.cuda_nvcc + ] + ++ lib.optionals waylandSupport [ + pkg-config + wayland-scanner + ]; - buildInputs = - [ - alembic - boost - ffmpeg - fftw - fftwFloat - freetype - gettext - glew - gmp - jemalloc - libepoxy - libharu - libjpeg - libpng - libsamplerate - libsndfile - libtiff - libwebp - (manifold.override { tbb_2021 = tbb; }) - opencolorio - openexr - openimageio_2 - openjpeg - (openpgl.override { inherit tbb; }) - (opensubdiv.override { inherit cudaSupport; }) - (openvdb.override { inherit tbb; }) - potrace - pugixml - python3 - python3Packages.materialx - tbb - zlib - zstd - ] - ++ lib.optional embreeSupport embree - ++ lib.optional openImageDenoiseSupport (openimagedenoise.override { inherit cudaSupport tbb; }) - ++ ( - if (!stdenv.hostPlatform.isDarwin) then - [ - libGL - libGLU - libX11 - libXext - libXi - libXrender - libXxf86vm - openal - openxr-loader - ] - else - [ - SDL - # blender chooses Metal features based on runtime system version - # lets use the latest SDK and let Blender handle falling back on older systems. - apple-sdk_15 - brotli - llvmPackages.openmp - sse2neon - ] - ) - ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] - ++ lib.optionals openUsdSupport [ pyPkgsOpenusd ] - ++ lib.optionals waylandSupport [ - dbus - libdecor' - libffi - libxkbcommon - wayland - wayland-protocols - ] - ++ lib.optional colladaSupport opencollada-blender - ++ lib.optional jackaudioSupport libjack2 - ++ lib.optional spaceNavSupport libspnav - ++ lib.optionals vulkanSupport [ - shaderc - vulkan-headers - vulkan-loader - ]; + buildInputs = [ + alembic + boost + ffmpeg + fftw + fftwFloat + freetype + gettext + glew + gmp + jemalloc + libepoxy + libharu + libjpeg + libpng + libsamplerate + libsndfile + libtiff + libwebp + (manifold.override { tbb_2021 = tbb; }) + opencolorio + openexr + openimageio_2 + openjpeg + (openpgl.override { inherit tbb; }) + (opensubdiv.override { inherit cudaSupport; }) + (openvdb.override { inherit tbb; }) + potrace + pugixml + python3 + python3Packages.materialx + tbb + zlib + zstd + ] + ++ lib.optional embreeSupport embree + ++ lib.optional openImageDenoiseSupport (openimagedenoise.override { inherit cudaSupport tbb; }) + ++ ( + if (!stdenv.hostPlatform.isDarwin) then + [ + libGL + libGLU + libX11 + libXext + libXi + libXrender + libXxf86vm + openal + openxr-loader + ] + else + [ + SDL + # blender chooses Metal features based on runtime system version + # lets use the latest SDK and let Blender handle falling back on older systems. + apple-sdk_15 + brotli + llvmPackages.openmp + sse2neon + ] + ) + ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] + ++ lib.optionals openUsdSupport [ pyPkgsOpenusd ] + ++ lib.optionals waylandSupport [ + dbus + libdecor' + libffi + libxkbcommon + wayland + wayland-protocols + ] + ++ lib.optional colladaSupport opencollada-blender + ++ lib.optional jackaudioSupport libjack2 + ++ lib.optional spaceNavSupport libspnav + ++ lib.optionals vulkanSupport [ + shaderc + vulkan-headers + vulkan-loader + ]; pythonPath = let diff --git a/pkgs/by-name/bl/blendfarm/package.nix b/pkgs/by-name/bl/blendfarm/package.nix index 50b22274ece4..19ba76ac5dc2 100644 --- a/pkgs/by-name/bl/blendfarm/package.nix +++ b/pkgs/by-name/bl/blendfarm/package.nix @@ -90,7 +90,8 @@ buildDotnetModule rec { libgdiplus glib libXrandr - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ blender ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ blender ]; # there is no "*.so.3" or "*.so.5" in nixpkgs. So ignore the warning # and add it later diff --git a/pkgs/by-name/bl/blis/package.nix b/pkgs/by-name/bl/blis/package.nix index 753ae5adf61a..6537877d804c 100644 --- a/pkgs/by-name/bl/blis/package.nix +++ b/pkgs/by-name/bl/blis/package.nix @@ -40,13 +40,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - configureFlags = - [ - "--enable-cblas" - "--blas-int-size=${blasIntSize}" - ] - ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ] - ++ [ withArchitecture ]; + configureFlags = [ + "--enable-cblas" + "--blas-int-size=${blasIntSize}" + ] + ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ] + ++ [ withArchitecture ]; postPatch = '' patchShebangs configure build/flatten-headers.py diff --git a/pkgs/by-name/bl/blobdrop/package.nix b/pkgs/by-name/bl/blobdrop/package.nix index d067deb18c72..78a470b814e2 100644 --- a/pkgs/by-name/bl/blobdrop/package.nix +++ b/pkgs/by-name/bl/blobdrop/package.nix @@ -20,23 +20,21 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - qt6.wrapQtAppsHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - ]; + nativeBuildInputs = [ + cmake + qt6.wrapQtAppsHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + ]; - buildInputs = - [ - qt6.qtdeclarative - qt6.qtsvg - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6.qtwayland - ]; + buildInputs = [ + qt6.qtdeclarative + qt6.qtsvg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6.qtwayland + ]; cmakeFlags = [ (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) diff --git a/pkgs/by-name/bl/blockbench/package.nix b/pkgs/by-name/bl/blockbench/package.nix index 3d6cc968a68a..941f98931f38 100644 --- a/pkgs/by-name/bl/blockbench/package.nix +++ b/pkgs/by-name/bl/blockbench/package.nix @@ -21,12 +21,13 @@ buildNpmPackage rec { hash = "sha256-u8NjwEsy3vimcvwtsUANckEx0Uz4vJLAiuUmN5lm5eQ="; }; - nativeBuildInputs = - [ makeWrapper ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - imagemagick # for icon resizing - copyDesktopItems - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + imagemagick # for icon resizing + copyDesktopItems + ]; npmDepsHash = "sha256-WiBQpd8Qlw5QTXh3kB2dG4dGZ1zfpYst5MgfHoK8UU4="; diff --git a/pkgs/by-name/bl/bloop/package.nix b/pkgs/by-name/bl/bloop/package.nix index ab2b5897d490..59e3e0d77af5 100644 --- a/pkgs/by-name/bl/bloop/package.nix +++ b/pkgs/by-name/bl/bloop/package.nix @@ -55,7 +55,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ installShellFiles makeWrapper - ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; buildInputs = [ (lib.getLib stdenv.cc.cc) zlib diff --git a/pkgs/by-name/bl/blueman/package.nix b/pkgs/by-name/bl/blueman/package.nix index 71eb2aa7346f..a446c718fc80 100644 --- a/pkgs/by-name/bl/blueman/package.nix +++ b/pkgs/by-name/bl/blueman/package.nix @@ -45,18 +45,17 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - bluez - gtk3 - pythonPackages.python - librsvg - adwaita-icon-theme - networkmanager - procps - ] - ++ pythonPath - ++ lib.optional withPulseAudio libpulseaudio; + buildInputs = [ + bluez + gtk3 + pythonPackages.python + librsvg + adwaita-icon-theme + networkmanager + procps + ] + ++ pythonPath + ++ lib.optional withPulseAudio libpulseaudio; postPatch = lib.optionalString withPulseAudio '' sed -i 's,CDLL(",CDLL("${libpulseaudio.out}/lib/,g' blueman/main/PulseAudioUtils.py diff --git a/pkgs/by-name/bl/bluespec/package.nix b/pkgs/by-name/bl/bluespec/package.nix index 5f9fd46c3aa0..2064ea2e70ce 100644 --- a/pkgs/by-name/bl/bluespec/package.nix +++ b/pkgs/by-name/bl/bluespec/package.nix @@ -71,13 +71,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - outputs = - [ - "out" - ] - ++ lib.optionals withDocs [ - "doc" - ]; + outputs = [ + "out" + ] + ++ lib.optionals withDocs [ + "doc" + ]; # https://github.com/B-Lang-org/bsc/pull/278 is still applicable, but will probably not be applied as such # there is work ongoing: https://github.com/B-Lang-org/bsc/issues/595 https://github.com/B-Lang-org/bsc/pull/600 @@ -88,54 +87,53 @@ stdenv.mkDerivation rec { chmod -R +rwX $sourceRoot/src/vendor/yices/v2.6/yices2 ''; - postPatch = - '' - patchShebangs \ - src/vendor/stp/src/AST/genkinds.pl \ - src/Verilog/copy_module.pl \ - src/comp/update-build-version.sh \ - src/comp/update-build-system.sh \ - src/comp/wrapper.sh + postPatch = '' + patchShebangs \ + src/vendor/stp/src/AST/genkinds.pl \ + src/Verilog/copy_module.pl \ + src/comp/update-build-version.sh \ + src/comp/update-build-system.sh \ + src/comp/wrapper.sh - substituteInPlace src/comp/Makefile \ - --replace-fail 'install-bsc install-bluetcl' 'install-bsc install-bluetcl $(UTILEXES) $(SHOWRULESEXES) install-utils install-showrules' + substituteInPlace src/comp/Makefile \ + --replace-fail 'install-bsc install-bluetcl' 'install-bsc install-bluetcl $(UTILEXES) $(SHOWRULESEXES) install-utils install-showrules' - # For darwin - # ld: library not found for -ltcl8.5 - substituteInPlace ./platform.sh \ - --replace-fail 'TCLSH=/usr/bin/tclsh' 'TCLSH=`which tclsh`' - '' - + lib.optionalString withSuiteCheck '' - substituteInPlace testsuite/bsc.options/verilog-e/verilog-e.exp \ - --replace-fail "/bin/echo" "${lib.getExe' buildPackages.coreutils "echo"}" + # For darwin + # ld: library not found for -ltcl8.5 + substituteInPlace ./platform.sh \ + --replace-fail 'TCLSH=/usr/bin/tclsh' 'TCLSH=`which tclsh`' + '' + + lib.optionalString withSuiteCheck '' + substituteInPlace testsuite/bsc.options/verilog-e/verilog-e.exp \ + --replace-fail "/bin/echo" "${lib.getExe' buildPackages.coreutils "echo"}" - substituteInPlace testsuite/test_list.sh testsuite/findfailures.csh \ - --replace-fail "bin/csh" "${lib.getExe buildPackages.tcsh}" + substituteInPlace testsuite/test_list.sh testsuite/findfailures.csh \ + --replace-fail "bin/csh" "${lib.getExe buildPackages.tcsh}" - patchShebangs \ - testsuite/test_list.sh \ - testsuite/findfailures.csh \ - scripts/tool-find.sh \ - testsuite/bsc.bluetcl/packages/expandPorts/compareOutput.pl \ - testsuite/bsc.bsv_examples/AES/funcit.pl \ - testsuite/bsc.bsv_examples/AES/makeVecs.pl \ - testsuite/bsc.bsv_examples/AES/makeVecs192.pl \ - testsuite/bsc.bsv_examples/AES/makeVecs256.pl \ - testsuite/bsc.if/split/canonicalize.pl \ - testsuite/bsc.interra/operators/Arith/generate/gen.pl \ - testsuite/bsc.interra/operators/Arith/generate/sort.pl \ - testsuite/bsc.interra/operators/BitSel/generate/gen.pl \ - testsuite/bsc.interra/operators/BitSel/generate/sort.pl \ - testsuite/bsc.interra/operators/Logic/generate/gen.pl \ - testsuite/bsc.interra/operators/Logic/generate/sort.pl \ - testsuite/bsc.preprocessor/ifdef/iftestcase-perl.pl \ - testsuite/bsc.verilog/filter/basicinout.pl \ - testsuite/scripts/collapse.pl \ - testsuite/scripts/double-directory.pl \ - testsuite/scripts/process-summary-file.pl \ - testsuite/scripts/sort-by-time.pl \ - testsuite/scripts/times-by-directory.pl - ''; + patchShebangs \ + testsuite/test_list.sh \ + testsuite/findfailures.csh \ + scripts/tool-find.sh \ + testsuite/bsc.bluetcl/packages/expandPorts/compareOutput.pl \ + testsuite/bsc.bsv_examples/AES/funcit.pl \ + testsuite/bsc.bsv_examples/AES/makeVecs.pl \ + testsuite/bsc.bsv_examples/AES/makeVecs192.pl \ + testsuite/bsc.bsv_examples/AES/makeVecs256.pl \ + testsuite/bsc.if/split/canonicalize.pl \ + testsuite/bsc.interra/operators/Arith/generate/gen.pl \ + testsuite/bsc.interra/operators/Arith/generate/sort.pl \ + testsuite/bsc.interra/operators/BitSel/generate/gen.pl \ + testsuite/bsc.interra/operators/BitSel/generate/sort.pl \ + testsuite/bsc.interra/operators/Logic/generate/gen.pl \ + testsuite/bsc.interra/operators/Logic/generate/sort.pl \ + testsuite/bsc.preprocessor/ifdef/iftestcase-perl.pl \ + testsuite/bsc.verilog/filter/basicinout.pl \ + testsuite/scripts/collapse.pl \ + testsuite/scripts/double-directory.pl \ + testsuite/scripts/process-summary-file.pl \ + testsuite/scripts/sort-by-time.pl \ + testsuite/scripts/times-by-directory.pl + ''; preBuild = '' # allow running bsc to bootstrap @@ -156,28 +154,27 @@ stdenv.mkDerivation rec { zlib ]; - nativeBuildInputs = - [ - automake - autoconf - bison - flex - ghcWithPackages - perl - pkg-config - tcl - makeBinaryWrapper - ] - ++ lib.optionals withDocs [ - texliveFull - asciidoctor - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # https://github.com/B-Lang-org/bsc/blob/main/src/comp/bsc.hs#L1838 - # /nix/store/7y0vlsf6l8lr3vjsbrirqrsbx4mwqiwf-cctools-binutils-darwin-1010.6/bin/strip: error: unknown argument '-u' - # make[1]: *** [Makefile:97: smoke_test_bluesim] Error 1 - cctools - ]; + nativeBuildInputs = [ + automake + autoconf + bison + flex + ghcWithPackages + perl + pkg-config + tcl + makeBinaryWrapper + ] + ++ lib.optionals withDocs [ + texliveFull + asciidoctor + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # https://github.com/B-Lang-org/bsc/blob/main/src/comp/bsc.hs#L1838 + # /nix/store/7y0vlsf6l8lr3vjsbrirqrsbx4mwqiwf-cctools-binutils-darwin-1010.6/bin/strip: error: unknown argument '-u' + # make[1]: *** [Makefile:97: smoke_test_bluesim] Error 1 + cctools + ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals (stdenv.cc.isClang) [ @@ -186,31 +183,29 @@ stdenv.mkDerivation rec { ] ); - makeFlags = - [ - "NO_DEPS_CHECKS=1" # skip the subrepo check (this deriviation uses yices-src instead of the subrepo) - "NOGIT=1" # https://github.com/B-Lang-org/bsc/issues/12 - "LDCONFIG=ldconfig" # https://github.com/SRI-CSL/yices2/blob/fda0a325ea7923f152ea9f9a5d20eddfd1d96224/Makefile.build#L66 - (if withDocs then "release" else "install-src") - ] - ++ lib.optionals stubStp [ - "STP_STUB=1" # uses yices as a SMT solver and stub out STP - ]; + makeFlags = [ + "NO_DEPS_CHECKS=1" # skip the subrepo check (this deriviation uses yices-src instead of the subrepo) + "NOGIT=1" # https://github.com/B-Lang-org/bsc/issues/12 + "LDCONFIG=ldconfig" # https://github.com/SRI-CSL/yices2/blob/fda0a325ea7923f152ea9f9a5d20eddfd1d96224/Makefile.build#L66 + (if withDocs then "release" else "install-src") + ] + ++ lib.optionals stubStp [ + "STP_STUB=1" # uses yices as a SMT solver and stub out STP + ]; - installPhase = - '' - mkdir -p $out - mv inst/bin $out - mv inst/lib $out + installPhase = '' + mkdir -p $out + mv inst/bin $out + mv inst/lib $out - '' - + lib.optionalString withDocs '' - # fragile, I know.. - mkdir -p $doc/share/doc/bsc - mv inst/README $doc/share/doc/bsc - mv inst/ReleaseNotes.* $doc/share/doc/bsc - mv inst/doc/*.pdf $doc/share/doc/bsc - ''; + '' + + lib.optionalString withDocs '' + # fragile, I know.. + mkdir -p $doc/share/doc/bsc + mv inst/README $doc/share/doc/bsc + mv inst/ReleaseNotes.* $doc/share/doc/bsc + mv inst/doc/*.pdf $doc/share/doc/bsc + ''; postFixup = '' # https://github.com/B-Lang-org/bsc/blob/65e3a87a17f6b9cf38cbb7b6ad7a4473f025c098/src/comp/bsc.hs#L1839 @@ -244,16 +239,15 @@ stdenv.mkDerivation rec { withSuiteCheck && stdenv.hostPlatform.isLinux ) "${glibcLocales}/lib/locale/locale-archive"; - nativeCheckInputs = - [ - gmp-static - iverilog - ] - ++ lib.optionals withSuiteCheck [ - time - dejagnu # for `/bin/runtest` in `check-suite` - gnugrep # `testsuite/bsc.interra/operators/Arith/arith.exp` and more - ]; + nativeCheckInputs = [ + gmp-static + iverilog + ] + ++ lib.optionals withSuiteCheck [ + time + dejagnu # for `/bin/runtest` in `check-suite` + gnugrep # `testsuite/bsc.interra/operators/Arith/arith.exp` and more + ]; checkInputs = lib.optionals withSuiteCheck [ systemc @@ -296,7 +290,8 @@ stdenv.mkDerivation rec { platforms = [ "aarch64-linux" "x86_64-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; mainProgram = "bsc"; maintainers = with lib.maintainers; [ jcumming diff --git a/pkgs/by-name/bl/bluez-alsa/package.nix b/pkgs/by-name/bl/bluez-alsa/package.nix index 24fbbc765b66..bc7500df3b5b 100644 --- a/pkgs/by-name/bl/bluez-alsa/package.nix +++ b/pkgs/by-name/bl/bluez-alsa/package.nix @@ -39,20 +39,19 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - alsa-lib - bluez - glib - sbc - dbus - readline - libbsd - ncurses - ] - ++ lib.optionals aacSupport [ - fdk_aac - ]; + buildInputs = [ + alsa-lib + bluez + glib + sbc + dbus + readline + libbsd + ncurses + ] + ++ lib.optionals aacSupport [ + fdk_aac + ]; configureFlags = [ (lib.enableFeature aacSupport "aac") diff --git a/pkgs/by-name/bl/bluez/package.nix b/pkgs/by-name/bl/bluez/package.nix index 82fb412451be..aa30c56faba6 100644 --- a/pkgs/by-name/bl/bluez/package.nix +++ b/pkgs/by-name/bl/bluez/package.nix @@ -57,34 +57,34 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optional installTests "test"; + ] + ++ lib.optional installTests "test"; - postPatch = + postPatch = '' + substituteInPlace tools/hid2hci.rules \ + --replace-fail /sbin/udevadm ${udev}/bin/udevadm \ + --replace-fail "hid2hci " "$out/lib/udev/hid2hci " + '' + + + # Disable some tests: + # - test-mesh-crypto depends on the following kernel settings: + # CONFIG_CRYPTO_[USER|USER_API|USER_API_AEAD|USER_API_HASH|AES|CCM|AEAD|CMAC] + # - test-vcp is flaky (?), see: + # - https://github.com/bluez/bluez/issues/683 + # - https://github.com/bluez/bluez/issues/726 '' - substituteInPlace tools/hid2hci.rules \ - --replace-fail /sbin/udevadm ${udev}/bin/udevadm \ - --replace-fail "hid2hci " "$out/lib/udev/hid2hci " - '' - + - # Disable some tests: - # - test-mesh-crypto depends on the following kernel settings: - # CONFIG_CRYPTO_[USER|USER_API|USER_API_AEAD|USER_API_HASH|AES|CCM|AEAD|CMAC] - # - test-vcp is flaky (?), see: - # - https://github.com/bluez/bluez/issues/683 - # - https://github.com/bluez/bluez/issues/726 - '' - skipTest() { - if [[ ! -f unit/$1.c ]]; then - echo "unit/$1.c no longer exists" - false - fi + skipTest() { + if [[ ! -f unit/$1.c ]]; then + echo "unit/$1.c no longer exists" + false + fi - echo 'int main() { return 77; }' > unit/$1.c - } + echo 'int main() { return 77; }' > unit/$1.c + } - skipTest test-mesh-crypto - skipTest test-vcp - ''; + skipTest test-mesh-crypto + skipTest test-vcp + ''; configureFlags = [ "--localstatedir=/var" diff --git a/pkgs/by-name/bm/bmake/package.nix b/pkgs/by-name/bm/bmake/package.nix index d84d16e05577..c97b416ff037 100644 --- a/pkgs/by-name/bm/bmake/package.nix +++ b/pkgs/by-name/bm/bmake/package.nix @@ -36,14 +36,13 @@ stdenv.mkDerivation (finalAttrs: { getopt ]; - nativeCheckInputs = - [ - bc - tzdata - ] - ++ lib.optionals (stdenv.hostPlatform.libc != "musl") [ - ksh - ]; + nativeCheckInputs = [ + bc + tzdata + ] + ++ lib.optionals (stdenv.hostPlatform.libc != "musl") [ + ksh + ]; # The generated makefile is a small wrapper for calling ./boot-strap with a # given op. On a case-insensitive filesystem this generated makefile clobbers diff --git a/pkgs/by-name/bm/bmon/package.nix b/pkgs/by-name/bm/bmon/package.nix index 49dfc9e71fad..01f0d49323fb 100644 --- a/pkgs/by-name/bm/bmon/package.nix +++ b/pkgs/by-name/bm/bmon/package.nix @@ -39,7 +39,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses libconfuse - ] ++ lib.optional stdenv.hostPlatform.isLinux libnl; + ] + ++ lib.optional stdenv.hostPlatform.isLinux libnl; preConfigure = '' # Must be an absolute path diff --git a/pkgs/by-name/bn/bngblaster/package.nix b/pkgs/by-name/bn/bngblaster/package.nix index 1344246cb5e3..b316b3004765 100644 --- a/pkgs/by-name/bn/bngblaster/package.nix +++ b/pkgs/by-name/bn/bngblaster/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation (finalAttrs: { jansson openssl cmocka - ] ++ lib.optionals finalAttrs.finalPackage.doCheck [ libpcap ]; + ] + ++ lib.optionals finalAttrs.finalPackage.doCheck [ libpcap ]; cmakeFlags = [ "-DBNGBLASTER_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" diff --git a/pkgs/by-name/bo/bochs/package.nix b/pkgs/by-name/bo/bochs/package.nix index 843452c8126f..8a8859546f98 100644 --- a/pkgs/by-name/bo/bochs/package.nix +++ b/pkgs/by-name/bo/bochs/package.nix @@ -43,102 +43,100 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - curl - readline - wget - ] - ++ lib.optionals enableSDL2 [ - SDL2 - ] - ++ lib.optionals enableTerm [ - ncurses - ] - ++ lib.optionals enableWx [ - gtk3 - wxGTK32 - ] - ++ lib.optionals enableX11 [ - libGL - libGLU - libX11 - libXpm - ]; + buildInputs = [ + curl + readline + wget + ] + ++ lib.optionals enableSDL2 [ + SDL2 + ] + ++ lib.optionals enableTerm [ + ncurses + ] + ++ lib.optionals enableWx [ + gtk3 + wxGTK32 + ] + ++ lib.optionals enableX11 [ + libGL + libGLU + libX11 + libXpm + ]; - configureFlags = - [ - (lib.withFeature false "rfb") - (lib.withFeature false "vncsrv") - (lib.withFeature true "nogui") + configureFlags = [ + (lib.withFeature false "rfb") + (lib.withFeature false "vncsrv") + (lib.withFeature true "nogui") - # These will always be "yes" on NixOS - (lib.enableFeature true "ltdl-install") - (lib.enableFeature true "readline") - (lib.enableFeature true "all-optimizations") - (lib.enableFeature true "logging") - (lib.enableFeature true "xpm") + # These will always be "yes" on NixOS + (lib.enableFeature true "ltdl-install") + (lib.enableFeature true "readline") + (lib.enableFeature true "all-optimizations") + (lib.enableFeature true "logging") + (lib.enableFeature true "xpm") - # ... whereas these, always "no"! - (lib.enableFeature false "cpp") - (lib.enableFeature false "instrumentation") + # ... whereas these, always "no"! + (lib.enableFeature false "cpp") + (lib.enableFeature false "instrumentation") - (lib.enableFeature false "docbook") # Broken - it requires docbook2html + (lib.enableFeature false "docbook") # Broken - it requires docbook2html - # These are completely configurable, and they don't depend of external tools - (lib.enableFeature true "a20-pin") - (lib.enableFeature true "avx") - (lib.enableFeature true "busmouse") - (lib.enableFeature true "cdrom") - (lib.enableFeature true "clgd54xx") - (lib.enableFeature true "configurable-msrs") - (lib.enableFeatureAs true "cpu-level" "6") # from 3 to 6 - (lib.enableFeature true "debugger") # conflicts with gdb-stub option - (lib.enableFeature true "debugger-gui") - (lib.enableFeature true "evex") - (lib.enableFeature true "fpu") - (lib.enableFeature false "gdb-stub") # conflicts with debugger option - (lib.enableFeature true "handlers-chaining") - (lib.enableFeature true "idle-hack") - (lib.enableFeature true "iodebug") - (lib.enableFeature true "large-ramfile") - (lib.enableFeature true "largefile") - (lib.enableFeature true "pci") - (lib.enableFeature true "repeat-speedups") - (lib.enableFeature true "show-ips") - (lib.enableFeature true "smp") - (lib.enableFeatureAs true "vmx" "2") - (lib.enableFeature true "svm") - (lib.enableFeature true "trace-linking") - (lib.enableFeature true "usb") - (lib.enableFeature true "usb-ehci") - (lib.enableFeature true "usb-ohci") - (lib.enableFeature true "usb-xhci") - (lib.enableFeature true "voodoo") - (lib.enableFeature true "x86-64") - (lib.enableFeature true "x86-debugger") - ] - ++ lib.optionals enableSDL2 [ - (lib.withFeature true "sdl2") - ] - ++ lib.optionals enableTerm [ - (lib.withFeature true "term") - ] - ++ lib.optionals enableWx [ - (lib.withFeature true "wx") - ] - ++ lib.optionals enableX11 [ - (lib.withFeature true "x") - (lib.withFeature true "x11") - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - (lib.enableFeature true "e1000") - (lib.enableFeature true "es1370") - (lib.enableFeature true "ne2000") - (lib.enableFeature true "plugins") - (lib.enableFeature true "pnic") - (lib.enableFeature true "sb16") - ]; + # These are completely configurable, and they don't depend of external tools + (lib.enableFeature true "a20-pin") + (lib.enableFeature true "avx") + (lib.enableFeature true "busmouse") + (lib.enableFeature true "cdrom") + (lib.enableFeature true "clgd54xx") + (lib.enableFeature true "configurable-msrs") + (lib.enableFeatureAs true "cpu-level" "6") # from 3 to 6 + (lib.enableFeature true "debugger") # conflicts with gdb-stub option + (lib.enableFeature true "debugger-gui") + (lib.enableFeature true "evex") + (lib.enableFeature true "fpu") + (lib.enableFeature false "gdb-stub") # conflicts with debugger option + (lib.enableFeature true "handlers-chaining") + (lib.enableFeature true "idle-hack") + (lib.enableFeature true "iodebug") + (lib.enableFeature true "large-ramfile") + (lib.enableFeature true "largefile") + (lib.enableFeature true "pci") + (lib.enableFeature true "repeat-speedups") + (lib.enableFeature true "show-ips") + (lib.enableFeature true "smp") + (lib.enableFeatureAs true "vmx" "2") + (lib.enableFeature true "svm") + (lib.enableFeature true "trace-linking") + (lib.enableFeature true "usb") + (lib.enableFeature true "usb-ehci") + (lib.enableFeature true "usb-ohci") + (lib.enableFeature true "usb-xhci") + (lib.enableFeature true "voodoo") + (lib.enableFeature true "x86-64") + (lib.enableFeature true "x86-debugger") + ] + ++ lib.optionals enableSDL2 [ + (lib.withFeature true "sdl2") + ] + ++ lib.optionals enableTerm [ + (lib.withFeature true "term") + ] + ++ lib.optionals enableWx [ + (lib.withFeature true "wx") + ] + ++ lib.optionals enableX11 [ + (lib.withFeature true "x") + (lib.withFeature true "x11") + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + (lib.enableFeature true "e1000") + (lib.enableFeature true "es1370") + (lib.enableFeature true "ne2000") + (lib.enableFeature true "plugins") + (lib.enableFeature true "pnic") + (lib.enableFeature true "sb16") + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/bo/boehmgc/package.nix b/pkgs/by-name/bo/boehmgc/package.nix index dbd575ea4b6b..69bc48b1c852 100644 --- a/pkgs/by-name/bo/boehmgc/package.nix +++ b/pkgs/by-name/bo/boehmgc/package.nix @@ -32,14 +32,13 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook ]; - configureFlags = - [ - "--enable-cplusplus" - "--with-libatomic-ops=none" - ] - ++ lib.optional enableStatic "--enable-static" - ++ lib.optional enableMmap "--enable-mmap" - ++ lib.optional enableLargeConfig "--enable-large-config"; + configureFlags = [ + "--enable-cplusplus" + "--with-libatomic-ops=none" + ] + ++ lib.optional enableStatic "--enable-static" + ++ lib.optional enableMmap "--enable-mmap" + ++ lib.optional enableLargeConfig "--enable-large-config"; # This stanza can be dropped when a release fixes this issue: # https://github.com/ivmai/bdwgc/issues/376 diff --git a/pkgs/by-name/bo/bolt-launcher/package.nix b/pkgs/by-name/bo/bolt-launcher/package.nix index ed4788159c1e..2e6d2f1d7405 100644 --- a/pkgs/by-name/bo/bolt-launcher/package.nix +++ b/pkgs/by-name/bo/bolt-launcher/package.nix @@ -66,15 +66,14 @@ let jdk17 ]; - cmakeFlags = - [ - "-D CMAKE_BUILD_TYPE=Release" - "-D BOLT_LUAJIT_INCLUDE_DIR=${luajit}/include" - "-G Ninja" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64) [ - (lib.cmakeFeature "PROJECT_ARCH" "arm64") - ]; + cmakeFlags = [ + "-D CMAKE_BUILD_TYPE=Release" + "-D BOLT_LUAJIT_INCLUDE_DIR=${luajit}/include" + "-G Ninja" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64) [ + (lib.cmakeFeature "PROJECT_ARCH" "arm64") + ]; preConfigure = '' mkdir -p cef diff --git a/pkgs/by-name/bo/boofuzz/package.nix b/pkgs/by-name/bo/boofuzz/package.nix index 95a9bec60144..48ce79cbf809 100644 --- a/pkgs/by-name/bo/boofuzz/package.nix +++ b/pkgs/by-name/bo/boofuzz/package.nix @@ -43,7 +43,8 @@ python3.pkgs.buildPythonApplication rec { "TestNoResponseFailure" "TestProcessMonitor" "TestSocketConnection" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_time_repeater" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_time_repeater" ]; pythonImportsCheck = [ "boofuzz" ]; diff --git a/pkgs/by-name/bo/boolector/package.nix b/pkgs/by-name/bo/boolector/package.nix index d9c6d5de82cc..072fb079a63c 100644 --- a/pkgs/by-name/bo/boolector/package.nix +++ b/pkgs/by-name/bo/boolector/package.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation rec { "-DBUILD_SHARED_LIBS=ON" "-DUSE_LINGELING=YES" "-DBtor2Tools_INCLUDE_DIR=${btor2tools.dev}/include/btor2parser" - ] ++ (lib.optional (gmp != null) "-DUSE_GMP=YES"); + ] + ++ (lib.optional (gmp != null) "-DUSE_GMP=YES"); nativeCheckInputs = [ python3 ]; doCheck = true; diff --git a/pkgs/by-name/bo/bore/package.nix b/pkgs/by-name/bo/bore/package.nix index 6b1c58f072a2..97f1fea7f86a 100644 --- a/pkgs/by-name/bo/bore/package.nix +++ b/pkgs/by-name/bo/bore/package.nix @@ -36,7 +36,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ installShellFiles - ] ++ lib.optional stdenv.hostPlatform.isDarwin rustPlatform.bindgenHook; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin rustPlatform.bindgenHook; postInstall = '' installManPage $src/bore/doc/bore.1 diff --git a/pkgs/by-name/bo/borgbackup/package.nix b/pkgs/by-name/bo/borgbackup/package.nix index aa301a94b4c5..a3a49005af9f 100644 --- a/pkgs/by-name/bo/borgbackup/package.nix +++ b/pkgs/by-name/bo/borgbackup/package.nix @@ -57,17 +57,16 @@ python.pkgs.buildPythonApplication rec { "man" ]; - buildInputs = - [ - libb2 - lz4 - xxHash - zstd - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - acl - ]; + buildInputs = [ + libb2 + lz4 + xxHash + zstd + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + acl + ]; dependencies = with python.pkgs; [ msgpack diff --git a/pkgs/by-name/bo/borgmatic/package.nix b/pkgs/by-name/bo/borgmatic/package.nix index 4b8b1c0b746e..f3350b363d48 100644 --- a/pkgs/by-name/bo/borgmatic/package.nix +++ b/pkgs/by-name/bo/borgmatic/package.nix @@ -56,22 +56,21 @@ python3Packages.buildPythonApplication rec { apprise = [ python3Packages.apprise ]; }; - postInstall = - '' - installShellCompletion --cmd borgmatic \ - --bash <($out/bin/borgmatic --bash-completion) - '' - + lib.optionalString enableSystemd '' - mkdir -p $out/lib/systemd/system - cp sample/systemd/borgmatic.timer $out/lib/systemd/system/ - # there is another "sleep", so choose the one with the space after it - # due to https://github.com/borgmatic-collective/borgmatic/commit/2e9f70d49647d47fb4ca05f428c592b0e4319544 - substitute sample/systemd/borgmatic.service \ - $out/lib/systemd/system/borgmatic.service \ - --replace /root/.local/bin/borgmatic $out/bin/borgmatic \ - --replace systemd-inhibit ${systemd}/bin/systemd-inhibit \ - --replace "sleep " "${coreutils}/bin/sleep " - ''; + postInstall = '' + installShellCompletion --cmd borgmatic \ + --bash <($out/bin/borgmatic --bash-completion) + '' + + lib.optionalString enableSystemd '' + mkdir -p $out/lib/systemd/system + cp sample/systemd/borgmatic.timer $out/lib/systemd/system/ + # there is another "sleep", so choose the one with the space after it + # due to https://github.com/borgmatic-collective/borgmatic/commit/2e9f70d49647d47fb4ca05f428c592b0e4319544 + substitute sample/systemd/borgmatic.service \ + $out/lib/systemd/system/borgmatic.service \ + --replace /root/.local/bin/borgmatic $out/bin/borgmatic \ + --replace systemd-inhibit ${systemd}/bin/systemd-inhibit \ + --replace "sleep " "${coreutils}/bin/sleep " + ''; passthru.tests = { version = testers.testVersion { package = borgmatic; }; diff --git a/pkgs/by-name/bo/boringssl/package.nix b/pkgs/by-name/bo/boringssl/package.nix index fa45b473b54a..628c374cd3a7 100644 --- a/pkgs/by-name/bo/boringssl/package.nix +++ b/pkgs/by-name/bo/boringssl/package.nix @@ -30,13 +30,12 @@ buildGoModule { # hack to get both go and cmake configure phase # (if we use postConfigure then cmake will loop runHook postConfigure) - preBuild = - '' - cmakeConfigurePhase - '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - export GOARCH=$(go env GOHOSTARCH) - ''; + preBuild = '' + cmakeConfigurePhase + '' + + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + export GOARCH=$(go env GOHOSTARCH) + ''; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.cc.isGNU [ @@ -52,7 +51,8 @@ buildGoModule { # CMAKE_OSX_ARCHITECTURES is set to x86_64 by Nix, but it confuses boringssl on aarch64-linux. cmakeFlags = [ "-GNinja" - ] ++ lib.optionals (stdenv.hostPlatform.isLinux) [ "-DCMAKE_OSX_ARCHITECTURES=" ]; + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ "-DCMAKE_OSX_ARCHITECTURES=" ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/bo/bottles-unwrapped/package.nix b/pkgs/by-name/bo/bottles-unwrapped/package.nix index 4849b370911d..be62985a1590 100644 --- a/pkgs/by-name/bo/bottles-unwrapped/package.nix +++ b/pkgs/by-name/bo/bottles-unwrapped/package.nix @@ -41,20 +41,19 @@ python3Packages.buildPythonApplication rec { hash = "sha256-cKW2b8MVpVksDnthn9kPBtUoCiiCMTQ993KTJSJuZDE="; }; - patches = - [ - ./vulkan_icd.patch - ./redirect-bugtracker.patch - ./remove-flatpak-check.patch - ] - ++ ( - if removeWarningPopup then - [ ./remove-unsupported-warning.patch ] - else - [ - ./warn-unsupported.patch - ] - ); + patches = [ + ./vulkan_icd.patch + ./redirect-bugtracker.patch + ./remove-flatpak-check.patch + ] + ++ ( + if removeWarningPopup then + [ ./remove-unsupported-warning.patch ] + else + [ + ./warn-unsupported.patch + ] + ); # https://github.com/bottlesdevs/Bottles/wiki/Packaging nativeBuildInputs = [ diff --git a/pkgs/by-name/bo/boxfs/package.nix b/pkgs/by-name/bo/boxfs/package.nix index b1d699928dbc..111b7c73b4f3 100644 --- a/pkgs/by-name/bo/boxfs/package.nix +++ b/pkgs/by-name/bo/boxfs/package.nix @@ -56,7 +56,8 @@ stdenv.mkDerivation { buildFlags = [ "static" "CC=${stdenv.cc.targetPrefix}cc" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "CFLAGS=-D_BSD_SOURCE"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "CFLAGS=-D_BSD_SOURCE"; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/by-name/bo/bozohttpd/package.nix b/pkgs/by-name/bo/bozohttpd/package.nix index 4ff11c5a66ca..f36598c62775 100644 --- a/pkgs/by-name/bo/bozohttpd/package.nix +++ b/pkgs/by-name/bo/bozohttpd/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libxcrypt openssl - ] ++ lib.optionals (luaSupport) [ lua ]; + ] + ++ lib.optionals (luaSupport) [ lua ]; nativeBuildInputs = [ bmake diff --git a/pkgs/by-name/br/brainflow/package.nix b/pkgs/by-name/br/brainflow/package.nix index 8adad4cc3700..40b70705ced5 100644 --- a/pkgs/by-name/br/brainflow/package.nix +++ b/pkgs/by-name/br/brainflow/package.nix @@ -37,10 +37,11 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_ONNX" buildONNX) ]; - buildInputs = - [ dbus ] - ++ lib.optional (buildBluetooth || buildBluetoothLowEnergy) bluez - ++ lib.optional useLibFTDI libftdi1; + buildInputs = [ + dbus + ] + ++ lib.optional (buildBluetooth || buildBluetoothLowEnergy) bluez + ++ lib.optional useLibFTDI libftdi1; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/br/brave/make-brave.nix b/pkgs/by-name/br/brave/make-brave.nix index a743bfbe0f8b..5a55283544fc 100644 --- a/pkgs/by-name/br/brave/make-brave.nix +++ b/pkgs/by-name/br/brave/make-brave.nix @@ -94,53 +94,52 @@ let escapeShellArg ; - deps = - [ - alsa-lib - at-spi2-atk - at-spi2-core - atk - cairo - cups - dbus - expat - fontconfig - freetype - gdk-pixbuf - glib - gtk3 - gtk4 - libdrm - libX11 - libGL - libxkbcommon - libXScrnSaver - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXrandr - libXrender - libxshmfence - libXtst - libuuid - libgbm - nspr - nss - pango - pipewire - udev - wayland - xorg.libxcb - zlib - snappy - libkrb5 - qt6.qtbase - ] - ++ optional pulseSupport libpulseaudio - ++ optional libvaSupport libva; + deps = [ + alsa-lib + at-spi2-atk + at-spi2-core + atk + cairo + cups + dbus + expat + fontconfig + freetype + gdk-pixbuf + glib + gtk3 + gtk4 + libdrm + libX11 + libGL + libxkbcommon + libXScrnSaver + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libXrandr + libXrender + libxshmfence + libXtst + libuuid + libgbm + nspr + nss + pango + pipewire + udev + wayland + xorg.libxcb + zlib + snappy + libkrb5 + qt6.qtbase + ] + ++ optional pulseSupport libpulseaudio + ++ optional libvaSupport libva; rpath = makeLibraryPath deps + ":" + makeSearchPathOutput "lib" "lib64" deps; binpath = makeBinPath deps; @@ -152,10 +151,11 @@ let ] ++ optional enableVulkan "Vulkan"; - disableFeatures = - [ "OutdatedBuildDetector" ] # disable automatic updates - # The feature disable is needed for VAAPI to work correctly: https://github.com/brave/brave-browser/issues/20935 - ++ optionals enableVideoAcceleration [ "UseChromeOSDirectVideoDecoder" ]; + disableFeatures = [ + "OutdatedBuildDetector" + ] # disable automatic updates + # The feature disable is needed for VAAPI to work correctly: https://github.com/brave/brave-browser/issues/20935 + ++ optionals enableVideoAcceleration [ "UseChromeOSDirectVideoDecoder" ]; in stdenv.mkDerivation { inherit pname version; diff --git a/pkgs/by-name/br/breeze-hacked-cursor-theme/package.nix b/pkgs/by-name/br/breeze-hacked-cursor-theme/package.nix index 1a02f7fe8d82..40df55b370bc 100644 --- a/pkgs/by-name/br/breeze-hacked-cursor-theme/package.nix +++ b/pkgs/by-name/br/breeze-hacked-cursor-theme/package.nix @@ -21,25 +21,24 @@ stdenvNoCC.mkDerivation { hash = "sha256-gm50qgHdbjDYMz/ksbDD8tMqY9AqJ23DKl4rPFNEDX8="; }; - postPatch = - '' - patchShebangs build.sh recolor-cursor.sh - substituteInPlace Makefile \ - --replace "~/.icons" "$out/share/icons" - ./recolor-cursor.sh \ - '' - + lib.optionalString (accentColor != null) '' - --accent-color "${accentColor}" \ - '' - + lib.optionalString (baseColor != null) '' - --base-color "${baseColor}" \ - '' - + lib.optionalString (borderColor != null) '' - --border-color "${borderColor}" \ - '' - + lib.optionalString (logoColor != null) '' - --logo-color "${logoColor}" - ''; + postPatch = '' + patchShebangs build.sh recolor-cursor.sh + substituteInPlace Makefile \ + --replace "~/.icons" "$out/share/icons" + ./recolor-cursor.sh \ + '' + + lib.optionalString (accentColor != null) '' + --accent-color "${accentColor}" \ + '' + + lib.optionalString (baseColor != null) '' + --base-color "${baseColor}" \ + '' + + lib.optionalString (borderColor != null) '' + --border-color "${borderColor}" \ + '' + + lib.optionalString (logoColor != null) '' + --logo-color "${logoColor}" + ''; nativeBuildInputs = [ inkscape diff --git a/pkgs/by-name/br/brig/package.nix b/pkgs/by-name/br/brig/package.nix index f4914eeda873..6e20c75ea67c 100644 --- a/pkgs/by-name/br/brig/package.nix +++ b/pkgs/by-name/br/brig/package.nix @@ -22,19 +22,18 @@ buildGoModule rec { subPackages = [ "." ]; - ldflags = - [ - "-s" - "-w" - ] - ++ lib.mapAttrsToList (n: v: "-X github.com/sahib/brig/version.${n}=${v}") { - Major = lib.versions.major version; - Minor = lib.versions.minor version; - Patch = lib.versions.patch version; - ReleaseType = ""; - BuildTime = "1970-01-01T00:00:00+0000"; - GitRev = src.rev; - }; + ldflags = [ + "-s" + "-w" + ] + ++ lib.mapAttrsToList (n: v: "-X github.com/sahib/brig/version.${n}=${v}") { + Major = lib.versions.major version; + Minor = lib.versions.minor version; + Patch = lib.versions.patch version; + ReleaseType = ""; + BuildTime = "1970-01-01T00:00:00+0000"; + GitRev = src.rev; + }; postInstall = '' installShellCompletion --cmd brig \ diff --git a/pkgs/by-name/br/brltty/package.nix b/pkgs/by-name/br/brltty/package.nix index 53cc98decf21..5885c511d333 100644 --- a/pkgs/by-name/br/brltty/package.nix +++ b/pkgs/by-name/br/brltty/package.nix @@ -36,14 +36,13 @@ stdenv.mkDerivation rec { tcl # One of build scripts require tclsh udevCheckHook ]; - buildInputs = - [ - bluez - ncurses.dev - tcl # For TCL bindings - ] - ++ lib.optional alsaSupport alsa-lib - ++ lib.optional systemdSupport systemd; + buildInputs = [ + bluez + ncurses.dev + tcl # For TCL bindings + ] + ++ lib.optional alsaSupport alsa-lib + ++ lib.optional systemdSupport systemd; doInstallCheck = true; @@ -89,27 +88,26 @@ stdenv.mkDerivation rec { CC_FOR_BUILD = "${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"; }; - preConfigure = - '' - substituteInPlace configure --replace-fail "/sbin/ldconfig -n" "true" + preConfigure = '' + substituteInPlace configure --replace-fail "/sbin/ldconfig -n" "true" - # Some script needs a working tclsh shebang - patchShebangs . + # Some script needs a working tclsh shebang + patchShebangs . - # Skip impure operations - substituteInPlace Programs/Makefile.in \ - --replace-fail install-apisoc-directory "" \ - --replace-fail install-api-key "" - '' - + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' - # ./configure call itself second time for build platform, if it fail -- it fails silently, make it visible - # (this is not mandatory changing, but make further maintaining easier) - substituteInPlace mk4build \ - --replace-fail "--quiet" "" - # Respect targetPrefix when invoking ar - substituteInPlace Programs/Makefile.in \ - --replace-fail "ar " "$AR " - ''; + # Skip impure operations + substituteInPlace Programs/Makefile.in \ + --replace-fail install-apisoc-directory "" \ + --replace-fail install-api-key "" + '' + + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + # ./configure call itself second time for build platform, if it fail -- it fails silently, make it visible + # (this is not mandatory changing, but make further maintaining easier) + substituteInPlace mk4build \ + --replace-fail "--quiet" "" + # Respect targetPrefix when invoking ar + substituteInPlace Programs/Makefile.in \ + --replace-fail "ar " "$AR " + ''; postInstall = '' # Rewrite absolute paths diff --git a/pkgs/by-name/br/broot/package.nix b/pkgs/by-name/br/broot/package.nix index 82a961dae3c6..761a62203687 100644 --- a/pkgs/by-name/br/broot/package.nix +++ b/pkgs/by-name/br/broot/package.nix @@ -34,13 +34,12 @@ rustPlatform.buildRustPackage (finalAttrs: { pkg-config ]; - buildInputs = - [ - libgit2 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - zlib - ]; + buildInputs = [ + libgit2 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + zlib + ]; buildFeatures = lib.optionals withTrash [ "trash" ] ++ lib.optionals withClipboard [ "clipboard" ]; diff --git a/pkgs/by-name/br/browserpass/package.nix b/pkgs/by-name/br/browserpass/package.nix index 3c8fbaad9a7b..950e7aabd373 100644 --- a/pkgs/by-name/br/browserpass/package.nix +++ b/pkgs/by-name/br/browserpass/package.nix @@ -23,7 +23,8 @@ buildGoModule rec { nativeBuildInputs = [ makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; vendorHash = "sha256-CjuH4ANP2bJDeA+o+1j+obbtk5/NVLet/OFS3Rms4r0="; diff --git a/pkgs/by-name/br/bruno/package.nix b/pkgs/by-name/br/bruno/package.nix index 4eb4e5175505..597c26bb17f1 100644 --- a/pkgs/by-name/br/bruno/package.nix +++ b/pkgs/by-name/br/bruno/package.nix @@ -35,14 +35,13 @@ buildNpmPackage rec { npmDepsHash = "sha256-osdjtn9jn6T1YizQM7I9cfiHvIkrZ8HRDNjsR+FS/DE="; npmFlags = [ "--legacy-peer-deps" ]; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - makeWrapper - copyDesktopItems - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + makeWrapper + copyDesktopItems + ]; buildInputs = [ pixman diff --git a/pkgs/by-name/br/brunsli/package.nix b/pkgs/by-name/br/brunsli/package.nix index 398d7b034698..c687020c0a31 100644 --- a/pkgs/by-name/br/brunsli/package.nix +++ b/pkgs/by-name/br/brunsli/package.nix @@ -37,13 +37,12 @@ stdenv.mkDerivation rec { }) ]; - postPatch = - '' - rm -r third_party - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - rm -r build - ''; + postPatch = '' + rm -r third_party + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + rm -r build + ''; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/bs/bsdiff/package.nix b/pkgs/by-name/bs/bsdiff/package.nix index 666d9c2690fd..91062c64ab32 100644 --- a/pkgs/by-name/bs/bsdiff/package.nix +++ b/pkgs/by-name/bs/bsdiff/package.nix @@ -16,29 +16,28 @@ stdenv.mkDerivation rec { }; buildInputs = [ bzip2 ]; - patches = - [ - (fetchpatch { - url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/20-CVE-2014-9862.patch"; - sha256 = "sha256-3UuUfNvShQ8fLqxCKUTb/n4BmjL4+Nl7aEqCxYrrERQ="; - }) - ./CVE-2020-14315.patch - ./include-systypes.patch - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - (fetchpatch { - url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/30-bug-632585-mmap-src-file-instead-of-malloc-read-it.patch"; - sha256 = "sha256-esbhz2/efUiuQDuF7LGfSeEn3/f1WbqCxQpTs2A0ulI="; - }) - (fetchpatch { - url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/31-bug-632585-mmap-dst-file-instead-of-malloc-read-it.patch"; - sha256 = "sha256-Of4aOcI0rsgdRzPqyw2VRn2p9wQuo3hdlgDTBdXGzoc="; - }) - (fetchpatch { - url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/32-bug-632585-use-int32_t-instead-off_t-for-file-size.patch"; - sha256 = "sha256-SooFnFK4uKNXvXQb/LEcH8GocnRtkryExI4b3BZTsAY="; - }) - ]; + patches = [ + (fetchpatch { + url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/20-CVE-2014-9862.patch"; + sha256 = "sha256-3UuUfNvShQ8fLqxCKUTb/n4BmjL4+Nl7aEqCxYrrERQ="; + }) + ./CVE-2020-14315.patch + ./include-systypes.patch + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + (fetchpatch { + url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/30-bug-632585-mmap-src-file-instead-of-malloc-read-it.patch"; + sha256 = "sha256-esbhz2/efUiuQDuF7LGfSeEn3/f1WbqCxQpTs2A0ulI="; + }) + (fetchpatch { + url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/31-bug-632585-mmap-dst-file-instead-of-malloc-read-it.patch"; + sha256 = "sha256-Of4aOcI0rsgdRzPqyw2VRn2p9wQuo3hdlgDTBdXGzoc="; + }) + (fetchpatch { + url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/32-bug-632585-use-int32_t-instead-off_t-for-file-size.patch"; + sha256 = "sha256-SooFnFK4uKNXvXQb/LEcH8GocnRtkryExI4b3BZTsAY="; + }) + ]; buildPhase = '' $CC -O3 -lbz2 bspatch.c -o bspatch diff --git a/pkgs/by-name/bs/bsnes-hd/package.nix b/pkgs/by-name/bs/bsnes-hd/package.nix index bad94f7b922c..6e18d86fe0c8 100644 --- a/pkgs/by-name/bs/bsnes-hd/package.nix +++ b/pkgs/by-name/bs/bsnes-hd/package.nix @@ -45,37 +45,36 @@ stdenv.mkDerivation { ./patches/0001-macos-copy-app-to-prefix.patch ]; - nativeBuildInputs = - [ pkg-config ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libicns - makeWrapper - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libicns + makeWrapper + ]; - buildInputs = - [ - SDL2 - libao - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXv - udev - gtk3 - gtksourceview3 - alsa-lib - openal - libpulseaudio - ]; + buildInputs = [ + SDL2 + libao + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXv + udev + gtk3 + gtksourceview3 + alsa-lib + openal + libpulseaudio + ]; - makeFlags = - [ - "-C bsnes" - "prefix=$(out)" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ "hiro=gtk3" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "hiro=cocoa" ]; + makeFlags = [ + "-C bsnes" + "prefix=$(out)" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "hiro=gtk3" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "hiro=cocoa" ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/bt/btop/package.nix b/pkgs/by-name/bt/btop/package.nix index 8aff3075ac40..041fc92998af 100644 --- a/pkgs/by-name/bt/btop/package.nix +++ b/pkgs/by-name/bt/btop/package.nix @@ -24,13 +24,12 @@ stdenv.mkDerivation rec { hash = "sha256-4H9UjewJ7UFQtTQYwvHZL3ecPiChpfT6LEZwbdBCIa0="; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals cudaSupport [ - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals cudaSupport [ + autoAddDriverRunpath + ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_15 diff --git a/pkgs/by-name/bt/btor2tools/package.nix b/pkgs/by-name/bt/btor2tools/package.nix index 76008417fb9e..4d8757d881f0 100644 --- a/pkgs/by-name/bt/btor2tools/package.nix +++ b/pkgs/by-name/bt/btor2tools/package.nix @@ -44,14 +44,13 @@ stdenv.mkDerivation { "lib" ]; - cmakeFlags = - [ - # RPATH of binary /nix/store/.../bin/btorsim contains a forbidden reference to /build/ - "-DCMAKE_SKIP_BUILD_RPATH=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" - ]; + cmakeFlags = [ + # RPATH of binary /nix/store/.../bin/btorsim contains a forbidden reference to /build/ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" + ]; meta = with lib; { description = "Generic parser and tool package for the BTOR2 format"; diff --git a/pkgs/by-name/bt/btrfs-assistant/package.nix b/pkgs/by-name/bt/btrfs-assistant/package.nix index e6db481d4174..08b6df49b264 100644 --- a/pkgs/by-name/bt/btrfs-assistant/package.nix +++ b/pkgs/by-name/bt/btrfs-assistant/package.nix @@ -40,28 +40,28 @@ stdenv.mkDerivation (finalAttrs: { qt6.qttools qt6.qtwayland util-linux - ] ++ lib.optionals enableSnapper [ snapper ]; + ] + ++ lib.optionals enableSnapper [ snapper ]; prePatch = lib.optionalString enableSnapper '' substituteInPlace src/main.cpp \ --replace-fail '/usr/bin/snapper' "${lib.getExe snapper}" ''; - postPatch = - '' - substituteInPlace src/org.btrfs-assistant.pkexec.policy \ - --replace-fail '/usr/bin' "$out/bin" + postPatch = '' + substituteInPlace src/org.btrfs-assistant.pkexec.policy \ + --replace-fail '/usr/bin' "$out/bin" - substituteInPlace src/btrfs-assistant \ - --replace-fail 'btrfs-assistant-bin' "$out/bin/btrfs-assistant-bin" + substituteInPlace src/btrfs-assistant \ + --replace-fail 'btrfs-assistant-bin' "$out/bin/btrfs-assistant-bin" - substituteInPlace src/btrfs-assistant-launcher \ - --replace-fail 'btrfs-assistant' "$out/bin/btrfs-assistant" - '' - + lib.optionalString enableSnapper '' - substituteInPlace src/btrfs-assistant.conf \ - --replace-fail '/usr/bin/snapper' "${lib.getExe snapper}" - ''; + substituteInPlace src/btrfs-assistant-launcher \ + --replace-fail 'btrfs-assistant' "$out/bin/btrfs-assistant" + '' + + lib.optionalString enableSnapper '' + substituteInPlace src/btrfs-assistant.conf \ + --replace-fail '/usr/bin/snapper' "${lib.getExe snapper}" + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/bt/btrfs-progs/package.nix b/pkgs/by-name/bt/btrfs-progs/package.nix index d53271a7d9d2..fe0c06274516 100644 --- a/pkgs/by-name/bt/btrfs-progs/package.nix +++ b/pkgs/by-name/bt/btrfs-progs/package.nix @@ -28,21 +28,20 @@ stdenv.mkDerivation rec { hash = "sha256-V9pCjdIZn9iNg+zxytBWeM54ZA735S12M76Yh872dLs="; }; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals udevSupport [ - udevCheckHook - ] - ++ [ - (buildPackages.python3.withPackages ( - ps: with ps; [ - sphinx - sphinx-rtd-theme - ] - )) - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals udevSupport [ + udevCheckHook + ] + ++ [ + (buildPackages.python3.withPackages ( + ps: with ps; [ + sphinx + sphinx-rtd-theme + ] + )) + ]; buildInputs = [ acl @@ -63,17 +62,16 @@ stdenv.mkDerivation rec { install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs ''; - configureFlags = - [ - # Built separately, see python3Packages.btrfsutil - "--disable-python" - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - "--disable-backtrace" - ] - ++ lib.optionals (!udevSupport) [ - "--disable-libudev" - ]; + configureFlags = [ + # Built separately, see python3Packages.btrfsutil + "--disable-python" + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + "--disable-backtrace" + ] + ++ lib.optionals (!udevSupport) [ + "--disable-libudev" + ]; makeFlags = [ "udevruledir=$(out)/lib/udev/rules.d" ]; diff --git a/pkgs/by-name/bu/budgie-gsettings-overrides/package.nix b/pkgs/by-name/bu/budgie-gsettings-overrides/package.nix index ca3def9789ff..f45fc84c8341 100644 --- a/pkgs/by-name/bu/budgie-gsettings-overrides/package.nix +++ b/pkgs/by-name/bu/budgie-gsettings-overrides/package.nix @@ -57,7 +57,8 @@ let budgie-desktop-view gsettings-desktop-schemas mutter - ] ++ extraGSettingsOverridePackages; + ] + ++ extraGSettingsOverridePackages; in runCommand "budgie-gsettings-overrides" { preferLocalBuild = true; } '' diff --git a/pkgs/by-name/bu/bugdom/package.nix b/pkgs/by-name/bu/bugdom/package.nix index 32fa26ad1b72..d3ad6d6f7653 100644 --- a/pkgs/by-name/bu/bugdom/package.nix +++ b/pkgs/by-name/bu/bugdom/package.nix @@ -46,32 +46,31 @@ stdenv.mkDerivation rec { "-DSDL2_INCLUDE_DIRS=${lib.getInclude SDL2}/include/SDL2" ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir -p $out/{bin,Applications} - mv {,$out/Applications/}Bugdom.app - makeWrapper $out/{Applications/Bugdom.app/Contents/MacOS,bin}/Bugdom - '' - else - '' - mkdir -p $out/share/bugdom - mv Data $out/share/bugdom - install -Dm755 {.,$out/bin}/Bugdom - wrapProgram $out/bin/Bugdom --run "cd $out/share/bugdom" - install -Dm644 $src/packaging/io.jor.bugdom.desktop $out/share/applications/io.jor.bugdom.desktop - install -Dm644 $src/packaging/io.jor.bugdom.png $out/share/pixmaps/io.jor.bugdom.png - '' - ) - + '' + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p $out/{bin,Applications} + mv {,$out/Applications/}Bugdom.app + makeWrapper $out/{Applications/Bugdom.app/Contents/MacOS,bin}/Bugdom + '' + else + '' + mkdir -p $out/share/bugdom + mv Data $out/share/bugdom + install -Dm755 {.,$out/bin}/Bugdom + wrapProgram $out/bin/Bugdom --run "cd $out/share/bugdom" + install -Dm644 $src/packaging/io.jor.bugdom.desktop $out/share/applications/io.jor.bugdom.desktop + install -Dm644 $src/packaging/io.jor.bugdom.png $out/share/pixmaps/io.jor.bugdom.png + '' + ) + + '' - runHook postInstall - ''; + runHook postInstall + ''; meta = with lib; { description = "Port of Bugdom, a 1999 Macintosh game by Pangea Software, for modern operating systems"; diff --git a/pkgs/by-name/bu/buildstream/package.nix b/pkgs/by-name/bu/buildstream/package.nix index 17e7b3a146d8..c78558047149 100644 --- a/pkgs/by-name/bu/buildstream/package.nix +++ b/pkgs/by-name/bu/buildstream/package.nix @@ -34,25 +34,26 @@ python3Packages.buildPythonApplication rec { setuptools-scm ]; - dependencies = - [ buildbox ] - ++ (with python3Packages; [ - click - dulwich - grpcio - jinja2 - markupsafe - packaging - pluginbase - protobuf - psutil - pyroaring - requests - ruamel-yaml - ruamel-yaml-clib - tomlkit - ujson - ]); + dependencies = [ + buildbox + ] + ++ (with python3Packages; [ + click + dulwich + grpcio + jinja2 + markupsafe + packaging + pluginbase + protobuf + psutil + pyroaring + requests + ruamel-yaml + ruamel-yaml-clib + tomlkit + ujson + ]); buildInputs = [ fuse3 diff --git a/pkgs/by-name/bu/buku/package.nix b/pkgs/by-name/bu/buku/package.nix index ee862b474df0..49daf6e7930a 100644 --- a/pkgs/by-name/bu/buku/package.nix +++ b/pkgs/by-name/bu/buku/package.nix @@ -57,34 +57,33 @@ buildPythonApplication rec { certifi urllib3 html5lib - ] ++ lib.optionals withServer serverRequire; + ] + ++ lib.optionals withServer serverRequire; - preCheck = - '' - # Disables a test which requires internet - substituteInPlace tests/test_bukuDb.py \ - --replace "@pytest.mark.slowtest" "@unittest.skip('skipping')" \ - --replace "self.assertEqual(shorturl, \"http://tny.im/yt\")" "" \ - --replace "self.assertEqual(url, \"https://www.google.com\")" "" - substituteInPlace setup.py \ - --replace mypy-extensions==0.4.1 mypy-extensions>=0.4.1 - '' - + lib.optionalString (!withServer) '' - rm tests/test_{server,views}.py - ''; + preCheck = '' + # Disables a test which requires internet + substituteInPlace tests/test_bukuDb.py \ + --replace "@pytest.mark.slowtest" "@unittest.skip('skipping')" \ + --replace "self.assertEqual(shorturl, \"http://tny.im/yt\")" "" \ + --replace "self.assertEqual(url, \"https://www.google.com\")" "" + substituteInPlace setup.py \ + --replace mypy-extensions==0.4.1 mypy-extensions>=0.4.1 + '' + + lib.optionalString (!withServer) '' + rm tests/test_{server,views}.py + ''; - postInstall = - '' - make install PREFIX=$out + postInstall = '' + make install PREFIX=$out - mkdir -p $out/share/zsh/site-functions $out/share/bash-completion/completions $out/share/fish/vendor_completions.d - cp auto-completion/zsh/* $out/share/zsh/site-functions - cp auto-completion/bash/* $out/share/bash-completion/completions - cp auto-completion/fish/* $out/share/fish/vendor_completions.d - '' - + lib.optionalString (!withServer) '' - rm $out/bin/bukuserver - ''; + mkdir -p $out/share/zsh/site-functions $out/share/bash-completion/completions $out/share/fish/vendor_completions.d + cp auto-completion/zsh/* $out/share/zsh/site-functions + cp auto-completion/bash/* $out/share/bash-completion/completions + cp auto-completion/fish/* $out/share/fish/vendor_completions.d + '' + + lib.optionalString (!withServer) '' + rm $out/bin/bukuserver + ''; meta = with lib; { description = "Private cmdline bookmark manager"; diff --git a/pkgs/by-name/bu/bumblebee/package.nix b/pkgs/by-name/bu/bumblebee/package.nix index 142ba0523280..396de3a8e486 100644 --- a/pkgs/by-name/bu/bumblebee/package.nix +++ b/pkgs/by-name/bu/bumblebee/package.nix @@ -53,12 +53,13 @@ }: let - nvidia_x11s = - [ nvidia_x11 ] - ++ lib.optional nvidia_x11.useGLVND libglvnd - ++ lib.optionals (nvidia_x11_i686 != null) ( - [ nvidia_x11_i686 ] ++ lib.optional nvidia_x11_i686.useGLVND libglvnd_i686 - ); + nvidia_x11s = [ + nvidia_x11 + ] + ++ lib.optional nvidia_x11.useGLVND libglvnd + ++ lib.optionals (nvidia_x11_i686 != null) ( + [ nvidia_x11_i686 ] ++ lib.optional nvidia_x11_i686.useGLVND libglvnd_i686 + ); nvidiaLibs = lib.makeLibraryPath nvidia_x11s; @@ -153,18 +154,17 @@ stdenv.mkDerivation rec { # includes the acceleration driver. As this is used for the X11 # server, which runs under the host architecture, this does not # include the sub architecture components. - configureFlags = - [ - "--with-udev-rules=$out/lib/udev/rules.d" - # Don't use a special group, just reuse wheel. - "CONF_GID=wheel" - # see #10282 - #"CONF_PRIMUS_LD_PATH=${primusLibs}" - ] - ++ lib.optionals useNvidia [ - "CONF_LDPATH_NVIDIA=${nvidiaLibs}" - "CONF_MODPATH_NVIDIA=${nvidia_x11.bin}/lib/xorg/modules" - ]; + configureFlags = [ + "--with-udev-rules=$out/lib/udev/rules.d" + # Don't use a special group, just reuse wheel. + "CONF_GID=wheel" + # see #10282 + #"CONF_PRIMUS_LD_PATH=${primusLibs}" + ] + ++ lib.optionals useNvidia [ + "CONF_LDPATH_NVIDIA=${nvidiaLibs}" + "CONF_MODPATH_NVIDIA=${nvidia_x11.bin}/lib/xorg/modules" + ]; CFLAGS = [ "-DX_MODULE_APPENDS=\\\"${xmodules}\\\"" diff --git a/pkgs/by-name/bu/bun/package.nix b/pkgs/by-name/bu/bun/package.nix index ceeb62523e3c..38d600519689 100644 --- a/pkgs/by-name/bu/bun/package.nix +++ b/pkgs/by-name/bu/bun/package.nix @@ -36,7 +36,8 @@ stdenvNoCC.mkDerivation rec { unzip installShellFiles makeWrapper - ] ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ autoPatchelfHook ]; buildInputs = [ openssl ]; dontConfigure = true; diff --git a/pkgs/by-name/bu/burp/package.nix b/pkgs/by-name/bu/burp/package.nix index 4190bb458b6a..1ce4d3570e4b 100644 --- a/pkgs/by-name/bu/burp/package.nix +++ b/pkgs/by-name/bu/burp/package.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation rec { openssl_legacy zlib uthash - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) acl; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) acl; configureFlags = [ "--localstatedir=/var" ]; diff --git a/pkgs/by-name/bu/buteo-syncfw/package.nix b/pkgs/by-name/bu/buteo-syncfw/package.nix index 9acf267e799c..995c1c2ab369 100644 --- a/pkgs/by-name/bu/buteo-syncfw/package.nix +++ b/pkgs/by-name/bu/buteo-syncfw/package.nix @@ -67,27 +67,25 @@ stdenv.mkDerivation (finalAttrs: { # QMake doesn't handle strictDeps well strictDeps = false; - nativeBuildInputs = - [ - doxygen - glib - pkg-config - wrapGAppsHook3 - ] - ++ (with libsForQt5; [ - qmake - wrapQtAppsHook - ]); + nativeBuildInputs = [ + doxygen + glib + pkg-config + wrapGAppsHook3 + ] + ++ (with libsForQt5; [ + qmake + wrapQtAppsHook + ]); - buildInputs = - [ - dbus - ] - ++ (with libsForQt5; [ - accounts-qt - qtdeclarative - signond - ]); + buildInputs = [ + dbus + ] + ++ (with libsForQt5; [ + accounts-qt + qtdeclarative + signond + ]); dontWrapGApps = true; diff --git a/pkgs/by-name/bw/bws/package.nix b/pkgs/by-name/bw/bws/package.nix index 8bc8bdd91761..75ee85f0e5a4 100644 --- a/pkgs/by-name/bw/bws/package.nix +++ b/pkgs/by-name/bw/bws/package.nix @@ -25,22 +25,20 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-SJn00C7vkNoghdVPUszep40RSL8fD+/ELUeuf9GBD7c="; - nativeBuildInputs = - [ - installShellFiles - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - perl - ]; + nativeBuildInputs = [ + installShellFiles + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + perl + ]; - buildInputs = - [ - oniguruma - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - openssl - ]; + buildInputs = [ + oniguruma + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + openssl + ]; env = { PYO3_PYTHON = "${python3}/bin/python3"; diff --git a/pkgs/by-name/by/byzanz/package.nix b/pkgs/by-name/by/byzanz/package.nix index e0956297a69c..9c4ac245201b 100644 --- a/pkgs/by-name/by/byzanz/package.nix +++ b/pkgs/by-name/by/byzanz/package.nix @@ -50,26 +50,25 @@ stdenv.mkDerivation { pkg-config intltool ]; - buildInputs = - [ - which - gnome-common - glib - libtool - cairo - gtk3 - xorg.xwininfo - xorg.libXdamage - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-bad - gst-plugins-good - gst-plugins-ugly - gst-libav - wrapGAppsHook3 - ]); + buildInputs = [ + which + gnome-common + glib + libtool + cairo + gtk3 + xorg.xwininfo + xorg.libXdamage + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-bad + gst-plugins-good + gst-plugins-ugly + gst-libav + wrapGAppsHook3 + ]); meta = { description = "Tool to record a running X desktop to an animation suitable for presentation in a web browser"; diff --git a/pkgs/by-name/c3/c3c/package.nix b/pkgs/by-name/c3/c3c/package.nix index 842a51c33ffa..588d1fe1c35d 100644 --- a/pkgs/by-name/c3/c3c/package.nix +++ b/pkgs/by-name/c3/c3c/package.nix @@ -51,7 +51,8 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { curl libxml2 libffi - ] ++ lib.optionals llvmPackages.stdenv.hostPlatform.isDarwin [ xar ]; + ] + ++ lib.optionals llvmPackages.stdenv.hostPlatform.isDarwin [ xar ]; nativeCheckInputs = [ python3 ]; diff --git a/pkgs/by-name/ca/caddy/package.nix b/pkgs/by-name/ca/caddy/package.nix index 2786618a4cc2..7e01ddc7a67c 100644 --- a/pkgs/by-name/ca/caddy/package.nix +++ b/pkgs/by-name/ca/caddy/package.nix @@ -48,27 +48,26 @@ buildGoModule { nativeBuildInputs = [ installShellFiles ]; - postInstall = - '' - install -Dm644 ${dist}/init/caddy.service ${dist}/init/caddy-api.service -t $out/lib/systemd/system + postInstall = '' + install -Dm644 ${dist}/init/caddy.service ${dist}/init/caddy-api.service -t $out/lib/systemd/system - substituteInPlace $out/lib/systemd/system/caddy.service \ - --replace-fail "/usr/bin/caddy" "$out/bin/caddy" - substituteInPlace $out/lib/systemd/system/caddy-api.service \ - --replace-fail "/usr/bin/caddy" "$out/bin/caddy" - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # Generating man pages and completions fail on cross-compilation - # https://github.com/NixOS/nixpkgs/issues/308283 + substituteInPlace $out/lib/systemd/system/caddy.service \ + --replace-fail "/usr/bin/caddy" "$out/bin/caddy" + substituteInPlace $out/lib/systemd/system/caddy-api.service \ + --replace-fail "/usr/bin/caddy" "$out/bin/caddy" + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # Generating man pages and completions fail on cross-compilation + # https://github.com/NixOS/nixpkgs/issues/308283 - $out/bin/caddy manpage --directory manpages - installManPage manpages/* + $out/bin/caddy manpage --directory manpages + installManPage manpages/* - installShellCompletion --cmd caddy \ - --bash <($out/bin/caddy completion bash) \ - --fish <($out/bin/caddy completion fish) \ - --zsh <($out/bin/caddy completion zsh) - ''; + installShellCompletion --cmd caddy \ + --bash <($out/bin/caddy completion bash) \ + --fish <($out/bin/caddy completion fish) \ + --zsh <($out/bin/caddy completion zsh) + ''; passthru = { tests = { diff --git a/pkgs/by-name/ca/cadical/package.nix b/pkgs/by-name/ca/cadical/package.nix index dfc2727379cc..c25118a876dc 100644 --- a/pkgs/by-name/ca/cadical/package.nix +++ b/pkgs/by-name/ca/cadical/package.nix @@ -58,15 +58,14 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; # fix static build - postPatch = - '' - substituteInPlace makefile.in --replace-fail "ar rc" '$(AR) rc' - '' - # Racy/flaky tests that sometimes spontaneously combust on darwin. - + lib.optionalString (stdenv.hostPlatform.isDarwin && (lib.versionAtLeast version "2.1.1")) '' - substituteInPlace test/api/run.sh --replace-fail 'run parcompwrite' "" - substituteInPlace test/api/run.sh --replace-fail 'run example_tracer' "" - ''; + postPatch = '' + substituteInPlace makefile.in --replace-fail "ar rc" '$(AR) rc' + '' + # Racy/flaky tests that sometimes spontaneously combust on darwin. + + lib.optionalString (stdenv.hostPlatform.isDarwin && (lib.versionAtLeast version "2.1.1")) '' + substituteInPlace test/api/run.sh --replace-fail 'run parcompwrite' "" + substituteInPlace test/api/run.sh --replace-fail 'run example_tracer' "" + ''; # the configure script is not generated by autotools and does not accept the # arguments that the default configurePhase passes like --prefix and --libdir diff --git a/pkgs/by-name/ca/cairo/package.nix b/pkgs/by-name/ca/cairo/package.nix index 5fc6bd6f0319..727afc713046 100644 --- a/pkgs/by-name/ca/cairo/package.nix +++ b/pkgs/by-name/ca/cairo/package.nix @@ -64,49 +64,47 @@ stdenv.mkDerivation ( lzo ]; - propagatedBuildInputs = - [ - fontconfig - freetype - pixman - libpng - zlib - ] - ++ optionals x11Support [ - libXext - libXrender - ] - ++ optionals xcbSupport [ libxcb ] - ++ optional gobjectSupport glib; # TODO: maybe liblzo but what would it be for here? + propagatedBuildInputs = [ + fontconfig + freetype + pixman + libpng + zlib + ] + ++ optionals x11Support [ + libXext + libXrender + ] + ++ optionals xcbSupport [ libxcb ] + ++ optional gobjectSupport glib; # TODO: maybe liblzo but what would it be for here? - mesonFlags = - [ - "-Dgtk_doc=true" + mesonFlags = [ + "-Dgtk_doc=true" - # error: #error config.h must be included before this header - "-Dsymbol-lookup=disabled" + # error: #error config.h must be included before this header + "-Dsymbol-lookup=disabled" - # Only used in tests, causes a dependency cycle - "-Dspectre=disabled" + # Only used in tests, causes a dependency cycle + "-Dspectre=disabled" - (lib.mesonEnable "glib" gobjectSupport) - (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) - (lib.mesonEnable "xlib" x11Support) - (lib.mesonEnable "xcb" xcbSupport) - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "--cross-file=${builtins.toFile "cross-file.conf" '' - [properties] - ipc_rmid_deferred_release = ${ - { - linux = "true"; - freebsd = "true"; - netbsd = "false"; - } - .${stdenv.hostPlatform.parsed.kernel.name} or (throw "Unknown value for ipc_rmid_deferred_release") + (lib.mesonEnable "glib" gobjectSupport) + (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) + (lib.mesonEnable "xlib" x11Support) + (lib.mesonEnable "xcb" xcbSupport) + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "--cross-file=${builtins.toFile "cross-file.conf" '' + [properties] + ipc_rmid_deferred_release = ${ + { + linux = "true"; + freebsd = "true"; + netbsd = "false"; } - ''}" - ]; + .${stdenv.hostPlatform.parsed.kernel.name} or (throw "Unknown value for ipc_rmid_deferred_release") + } + ''}" + ]; preConfigure = '' patchShebangs version.py @@ -147,7 +145,8 @@ stdenv.mkDerivation ( "cairo-pdf" "cairo-ps" "cairo-svg" - ] ++ lib.optional gobjectSupport "cairo-gobject"; + ] + ++ lib.optional gobjectSupport "cairo-gobject"; platforms = platforms.all; }; } diff --git a/pkgs/by-name/ca/cakelisp/package.nix b/pkgs/by-name/ca/cakelisp/package.nix index 53db7144b233..88cf6b82658a 100644 --- a/pkgs/by-name/ca/cakelisp/package.nix +++ b/pkgs/by-name/ca/cakelisp/package.nix @@ -19,18 +19,17 @@ stdenv.mkDerivation { buildInputs = [ gcc ]; - postPatch = - '' - substituteInPlace runtime/HotReloading.cake \ - --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"' - substituteInPlace src/ModuleManager.cpp \ - --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic' - substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic' - substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic' - ''; + postPatch = '' + substituteInPlace runtime/HotReloading.cake \ + --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"' + substituteInPlace src/ModuleManager.cpp \ + --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic' + substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic' + substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic' + ''; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/ca/calc/package.nix b/pkgs/by-name/ca/calc/package.nix index 79ae9befe1ea..b34f79a269c7 100644 --- a/pkgs/by-name/ca/calc/package.nix +++ b/pkgs/by-name/ca/calc/package.nix @@ -37,23 +37,22 @@ stdenv.mkDerivation (finalAttrs: { readline ]; - makeFlags = - [ - "T=$(out)" - "INCDIR=" - "BINDIR=/bin" - "LIBDIR=/lib" - "CALC_SHAREDIR=/share/calc" - "CALC_INCDIR=/include" - "MANDIR=/share/man/man1" + makeFlags = [ + "T=$(out)" + "INCDIR=" + "BINDIR=/bin" + "LIBDIR=/lib" + "CALC_SHAREDIR=/share/calc" + "CALC_INCDIR=/include" + "MANDIR=/share/man/man1" - # Handle LDFLAGS defaults in calc - "DEFAULT_LIB_INSTALL_PATH=$(out)/lib" - ] - ++ lib.optionals enableReadline [ - "READLINE_LIB=-lreadline" - "USE_READLINE=-DUSE_READLINE" - ]; + # Handle LDFLAGS defaults in calc + "DEFAULT_LIB_INSTALL_PATH=$(out)/lib" + ] + ++ lib.optionals enableReadline [ + "READLINE_LIB=-lreadline" + "USE_READLINE=-DUSE_READLINE" + ]; meta = { homepage = "http://www.isthe.com/chongo/tech/comp/calc/"; diff --git a/pkgs/by-name/ca/calibre/package.nix b/pkgs/by-name/ca/calibre/package.nix index ad0c9a0e6e59..e571927cfe68 100644 --- a/pkgs/by-name/ca/calibre/package.nix +++ b/pkgs/by-name/ca/calibre/package.nix @@ -55,7 +55,8 @@ stdenv.mkDerivation (finalAttrs: { url = "https://raw.githubusercontent.com/debian-calibre/calibre/debian/${finalAttrs.version}+ds-1/debian/patches/hardening/0007-Hardening-Qt-code.patch"; hash = "sha256-V/ZUTH0l4QSfM0dHrgLGdJjF/CCQ0S/fnCP/ZKD563U="; }) - ] ++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch; + ] + ++ lib.optional (!unrarSupport) ./dont_build_unrar_plugin.patch; prePatch = '' sed -i "s@\[tool.sip.project\]@[tool.sip.project]\nsip-include-dirs = [\"${python3Packages.pyqt6}/${python3Packages.python.sitePackages}/PyQt6/bindings\"]@g" \ @@ -144,7 +145,8 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional unrarSupport unrardll )) xdg-utils - ] ++ lib.optional speechSupport speechd-minimal; + ] + ++ lib.optional speechSupport speechd-minimal; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/ca/calls/package.nix b/pkgs/by-name/ca/calls/package.nix index 290aec730546..c785ae2d70ba 100644 --- a/pkgs/by-name/ca/calls/package.nix +++ b/pkgs/by-name/ca/calls/package.nix @@ -52,23 +52,22 @@ stdenv.mkDerivation (finalAttrs: { "devdoc" ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - desktop-file-utils - appstream-glib - vala - wrapGAppsHook4 - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - docutils - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + desktop-file-utils + appstream-glib + vala + wrapGAppsHook4 + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 + docutils + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ modemmanager diff --git a/pkgs/by-name/ca/cameractrls/package.nix b/pkgs/by-name/ca/cameractrls/package.nix index d56b75124ddc..9d7f988d7009 100644 --- a/pkgs/by-name/ca/cameractrls/package.nix +++ b/pkgs/by-name/ca/cameractrls/package.nix @@ -35,7 +35,8 @@ let "cameraptzmidi" "cameraptzspnav" "cameraview" - ] ++ lib.optionals (withGtk != null) [ mainExecutable ]; + ] + ++ lib.optionals (withGtk != null) [ mainExecutable ]; in python3Packages.buildPythonApplication rec { pname = "cameractrls"; @@ -73,29 +74,28 @@ python3Packages.buildPythonApplication rec { # Only used when withGtk != null dependencies = with python3Packages; [ pygobject3 ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin + mkdir -p $out/bin - for file in ${lib.concatStringsSep " " installExecutables}; do - install -Dm755 $file.py -t ${modulePath} - ln -s ${modulePath}/$file.py $out/bin/$file - done - '' - + lib.optionalString (withGtk != null) '' - install -Dm644 pkg/hu.irl.cameractrls.svg -t $out/share/icons/hicolor/scalable/apps - install -Dm644 pkg/hu.irl.cameractrls.metainfo.xml -t $out/share/metainfo - mkdir -p $out/share/applications - desktop-file-install \ - --dir="$out/share/applications" \ - --set-key=Exec --set-value="${mainExecutable}" \ - pkg/hu.irl.cameractrls.desktop - '' - + '' - runHook postInstall - ''; + for file in ${lib.concatStringsSep " " installExecutables}; do + install -Dm755 $file.py -t ${modulePath} + ln -s ${modulePath}/$file.py $out/bin/$file + done + '' + + lib.optionalString (withGtk != null) '' + install -Dm644 pkg/hu.irl.cameractrls.svg -t $out/share/icons/hicolor/scalable/apps + install -Dm644 pkg/hu.irl.cameractrls.metainfo.xml -t $out/share/metainfo + mkdir -p $out/share/applications + desktop-file-install \ + --dir="$out/share/applications" \ + --set-key=Exec --set-value="${mainExecutable}" \ + pkg/hu.irl.cameractrls.desktop + '' + + '' + runHook postInstall + ''; dontWrapGApps = true; dontWrapPythonPrograms = true; diff --git a/pkgs/by-name/ca/camilladsp/package.nix b/pkgs/by-name/ca/camilladsp/package.nix index 753bae7f1c39..61a915021c63 100644 --- a/pkgs/by-name/ca/camilladsp/package.nix +++ b/pkgs/by-name/ca/camilladsp/package.nix @@ -37,7 +37,8 @@ rustPlatform.buildRustPackage (finalAttrs: { buildInputs = [ libpulseaudio openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; passthru.updateScript = nix-update-script { extraArgs = [ "--generate-lockfile" ]; }; diff --git a/pkgs/by-name/ca/canaille/package.nix b/pkgs/by-name/ca/canaille/package.nix index 5c2d23b62323..9b1d6043b80b 100644 --- a/pkgs/by-name/ca/canaille/package.nix +++ b/pkgs/by-name/ca/canaille/package.nix @@ -123,7 +123,8 @@ python.pkgs.buildPythonApplication rec { sqlalchemy sqlalchemy-json sqlalchemy-utils - ] ++ sqlalchemy.optional-dependencies.postgresql_psycopg2binary; + ] + ++ sqlalchemy.optional-dependencies.postgresql_psycopg2binary; otp = [ otpauth pillow diff --git a/pkgs/by-name/ca/cantata/package.nix b/pkgs/by-name/ca/cantata/package.nix index db7fa65c00d3..8671ce1e690f 100644 --- a/pkgs/by-name/ca/cantata/package.nix +++ b/pkgs/by-name/ca/cantata/package.nix @@ -187,7 +187,8 @@ stdenv.mkDerivation (finalAttrs: { qt6.qtsvg qt6.qtwayland (perl.withPackages (ppkgs: with ppkgs; [ URI ])) - ] ++ lib.flatten (builtins.catAttrs "pkgs" (builtins.filter (e: e.enable) options)); + ] + ++ lib.flatten (builtins.catAttrs "pkgs" (builtins.filter (e: e.enable) options)); nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/ca/capnproto/package.nix b/pkgs/by-name/ca/capnproto/package.nix index 193f1dccee04..e02665fe0c50 100644 --- a/pkgs/by-name/ca/capnproto/package.nix +++ b/pkgs/by-name/ca/capnproto/package.nix @@ -44,7 +44,8 @@ clangStdenv.mkDerivation rec { propagatedBuildInputs = [ openssl zlib - ] ++ lib.optional (clangStdenv.cc.isClang && clangStdenv.targetPlatform.isStatic) empty-libgcc_eh; + ] + ++ lib.optional (clangStdenv.cc.isClang && clangStdenv.targetPlatform.isStatic) empty-libgcc_eh; # FIXME: separate the binaries from the stuff that user systems actually use # This runs into a terrible UX issue in Lix and I just don't want to debug it diff --git a/pkgs/by-name/ca/cardinal/package.nix b/pkgs/by-name/ca/cardinal/package.nix index 7e8d35256a0e..cfd49ad3ca1a 100644 --- a/pkgs/by-name/ca/cardinal/package.nix +++ b/pkgs/by-name/ca/cardinal/package.nix @@ -70,13 +70,12 @@ stdenv.mkDerivation rec { ]; hardeningDisable = [ "format" ]; - makeFlags = - [ - "SYSDEPS=true" - "PREFIX=$(out)" - ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "CROSS_COMPILING=true" - ++ lib.optional headless "HEADLESS=true"; + makeFlags = [ + "SYSDEPS=true" + "PREFIX=$(out)" + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "CROSS_COMPILING=true" + ++ lib.optional headless "HEADLESS=true"; postInstall = '' wrapProgram $out/bin/Cardinal \ diff --git a/pkgs/by-name/ca/cardpeek/package.nix b/pkgs/by-name/ca/cardpeek/package.nix index 84c2f283d035..6d10b364f128 100644 --- a/pkgs/by-name/ca/cardpeek/package.nix +++ b/pkgs/by-name/ca/cardpeek/package.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation { lua5_2 curl readline - ] ++ lib.optional stdenv.hostPlatform.isLinux pcsclite; + ] + ++ lib.optional stdenv.hostPlatform.isLinux pcsclite; enableParallelBuilding = true; diff --git a/pkgs/by-name/ca/cargo-c/package.nix b/pkgs/by-name/ca/cargo-c/package.nix index 3624b19e5388..a29184834f0f 100644 --- a/pkgs/by-name/ca/cargo-c/package.nix +++ b/pkgs/by-name/ca/cargo-c/package.nix @@ -28,14 +28,13 @@ rustPlatform.buildRustPackage rec { pkg-config (lib.getDev curl) ]; - buildInputs = - [ - openssl - curl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + curl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; # Ensure that we are avoiding build of the curl vendored in curl-sys doInstallCheck = stdenv.hostPlatform.libc == "glibc"; diff --git a/pkgs/by-name/ca/cargo-crev/package.nix b/pkgs/by-name/ca/cargo-crev/package.nix index 11b1a97c8724..93425cc26597 100644 --- a/pkgs/by-name/ca/cargo-crev/package.nix +++ b/pkgs/by-name/ca/cargo-crev/package.nix @@ -36,12 +36,13 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - curl - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + curl + ]; nativeCheckInputs = [ gitMinimal ]; diff --git a/pkgs/by-name/ca/cargo-cyclonedx/package.nix b/pkgs/by-name/ca/cargo-cyclonedx/package.nix index 193a967a79f7..2c77ee4e097d 100644 --- a/pkgs/by-name/ca/cargo-cyclonedx/package.nix +++ b/pkgs/by-name/ca/cargo-cyclonedx/package.nix @@ -26,13 +26,12 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; meta = with lib; { description = "Creates CycloneDX Software Bill of Materials (SBOM) from Rust (Cargo) projects"; diff --git a/pkgs/by-name/ca/cargo-deadlinks/package.nix b/pkgs/by-name/ca/cargo-deadlinks/package.nix index 73d187923c05..b246ff91f6ef 100644 --- a/pkgs/by-name/ca/cargo-deadlinks/package.nix +++ b/pkgs/by-name/ca/cargo-deadlinks/package.nix @@ -19,15 +19,15 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-d5e5CpO/c6KrIQE8dJqXT19Qe0CRbIqgCDHNWz4TK8Q="; - checkFlags = - [ - # uses internet - "--skip non_existent_http_link --skip working_http_check" - # makes assumption about HTML paths that changed in rust 1.82.0 - "--skip simple_project::it_checks_okay_project_correctly" - "--skip cli_args::it_passes_arguments_through_to_cargo" - ] - ++ lib.optional (stdenv.hostPlatform.system != "x86_64-linux") + checkFlags = [ + # uses internet + "--skip non_existent_http_link --skip working_http_check" + # makes assumption about HTML paths that changed in rust 1.82.0 + "--skip simple_project::it_checks_okay_project_correctly" + "--skip cli_args::it_passes_arguments_through_to_cargo" + ] + ++ + lib.optional (stdenv.hostPlatform.system != "x86_64-linux") # assumes the target is x86_64-unknown-linux-gnu "--skip simple_project::it_checks_okay_project_correctly"; diff --git a/pkgs/by-name/ca/cargo-dephell/package.nix b/pkgs/by-name/ca/cargo-dephell/package.nix index 2d20d48146b7..0d5d8f5dc928 100644 --- a/pkgs/by-name/ca/cargo-dephell/package.nix +++ b/pkgs/by-name/ca/cargo-dephell/package.nix @@ -24,22 +24,20 @@ rustPlatform.buildRustPackage rec { lockFile = ./Cargo.lock; }; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - libgit2 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + libgit2 + ]; # update Cargo.lock to work with openssl 3 postPatch = '' diff --git a/pkgs/by-name/ca/cargo-fund/package.nix b/pkgs/by-name/ca/cargo-fund/package.nix index 01acf17c95af..ec97acb47be6 100644 --- a/pkgs/by-name/ca/cargo-fund/package.nix +++ b/pkgs/by-name/ca/cargo-fund/package.nix @@ -28,12 +28,13 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - curl - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + curl + ]; meta = with lib; { description = "Discover funding links for your project's dependencies"; diff --git a/pkgs/by-name/ca/cargo-geiger/package.nix b/pkgs/by-name/ca/cargo-geiger/package.nix index c32c8cd452b6..fbbf57bd70e9 100644 --- a/pkgs/by-name/ca/cargo-geiger/package.nix +++ b/pkgs/by-name/ca/cargo-geiger/package.nix @@ -27,16 +27,18 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-aDgpEfX0QRkQD6c4ant6uSN18WLHVnZISRr7lyu9IzA="; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - curl - ]; - nativeBuildInputs = - [ pkg-config ] - # curl-sys wants to run curl-config on darwin - ++ lib.optionals stdenv.hostPlatform.isDarwin [ curl.dev ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + curl + ]; + nativeBuildInputs = [ + pkg-config + ] + # curl-sys wants to run curl-config on darwin + ++ lib.optionals stdenv.hostPlatform.isDarwin [ curl.dev ]; preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/by-name/ca/cargo-generate/package.nix b/pkgs/by-name/ca/cargo-generate/package.nix index 23582ad3c2bf..add51b458969 100644 --- a/pkgs/by-name/ca/cargo-generate/package.nix +++ b/pkgs/by-name/ca/cargo-generate/package.nix @@ -54,18 +54,17 @@ rustPlatform.buildRustPackage rec { # Exclude some tests that don't work in sandbox: # - favorites_default_to_git_if_not_defined: requires network access to github.com # - should_canonicalize: the test assumes that it will be called from the /Users// folder on darwin variant. - checkFlags = - [ - "--skip=favorites::favorites_default_to_git_if_not_defined" - "--skip=git_instead_of::should_read_the_instead_of_config_and_rewrite_an_git_at_url_to_https" - "--skip=git_instead_of::should_read_the_instead_of_config_and_rewrite_an_ssh_url_to_https" - "--skip=git_over_ssh::it_should_retrieve_the_private_key_from_ssh_agent" - "--skip=git_over_ssh::it_should_support_a_public_repo" - "--skip=git_over_ssh::it_should_use_a_ssh_key_provided_by_identity_argument" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--skip=git::utils::should_canonicalize" - ]; + checkFlags = [ + "--skip=favorites::favorites_default_to_git_if_not_defined" + "--skip=git_instead_of::should_read_the_instead_of_config_and_rewrite_an_git_at_url_to_https" + "--skip=git_instead_of::should_read_the_instead_of_config_and_rewrite_an_ssh_url_to_https" + "--skip=git_over_ssh::it_should_retrieve_the_private_key_from_ssh_agent" + "--skip=git_over_ssh::it_should_support_a_public_repo" + "--skip=git_over_ssh::it_should_use_a_ssh_key_provided_by_identity_argument" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--skip=git::utils::should_canonicalize" + ]; env = { LIBGIT2_NO_VENDOR = 1; diff --git a/pkgs/by-name/ca/cargo-lambda/package.nix b/pkgs/by-name/ca/cargo-lambda/package.nix index ff0b0a820001..b9f81bbd6287 100644 --- a/pkgs/by-name/ca/cargo-lambda/package.nix +++ b/pkgs/by-name/ca/cargo-lambda/package.nix @@ -33,11 +33,12 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; # Remove files that don't make builds reproducible: # - Remove build.rs file that adds the build date to the version. diff --git a/pkgs/by-name/ca/cargo-leptos/package.nix b/pkgs/by-name/ca/cargo-leptos/package.nix index 53fdabb0d3f6..ce3c4f30febd 100644 --- a/pkgs/by-name/ca/cargo-leptos/package.nix +++ b/pkgs/by-name/ca/cargo-leptos/package.nix @@ -24,14 +24,13 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl ]; - env = - { - OPENSSL_NO_VENDOR = 1; - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - # Fix for C++ compiler version on darwin for wasm-opt - CRATE_CC_NO_DEFAULTS = 1; - }; + env = { + OPENSSL_NO_VENDOR = 1; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # Fix for C++ compiler version on darwin for wasm-opt + CRATE_CC_NO_DEFAULTS = 1; + }; # https://github.com/leptos-rs/cargo-leptos#dependencies buildFeatures = [ "no_downloads" ]; # cargo-leptos will try to install missing dependencies on its own otherwise diff --git a/pkgs/by-name/ca/cargo-release/package.nix b/pkgs/by-name/ca/cargo-release/package.nix index e866adbec781..c7f7d3326f86 100644 --- a/pkgs/by-name/ca/cargo-release/package.nix +++ b/pkgs/by-name/ca/cargo-release/package.nix @@ -28,14 +28,13 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - libgit2 - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + buildInputs = [ + libgit2 + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; nativeCheckInputs = [ git diff --git a/pkgs/by-name/ca/cargo-tarpaulin/package.nix b/pkgs/by-name/ca/cargo-tarpaulin/package.nix index ac4d34075b86..e0999531ac22 100644 --- a/pkgs/by-name/ca/cargo-tarpaulin/package.nix +++ b/pkgs/by-name/ca/cargo-tarpaulin/package.nix @@ -25,11 +25,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; doCheck = false; diff --git a/pkgs/by-name/ca/cargo-tauri/package.nix b/pkgs/by-name/ca/cargo-tauri/package.nix index e864859d2497..23998fa836d2 100644 --- a/pkgs/by-name/ca/cargo-tauri/package.nix +++ b/pkgs/by-name/ca/cargo-tauri/package.nix @@ -27,12 +27,13 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gtk4 - webkitgtk_4_1 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gtk4 + webkitgtk_4_1 + ]; cargoBuildFlags = [ "--package tauri-cli" ]; cargoTestFlags = cargoBuildFlags; diff --git a/pkgs/by-name/ca/cargo-tauri/test-app.nix b/pkgs/by-name/ca/cargo-tauri/test-app.nix index 865aa902dc46..bfc6cac5eaae 100644 --- a/pkgs/by-name/ca/cargo-tauri/test-app.nix +++ b/pkgs/by-name/ca/cargo-tauri/test-app.nix @@ -49,13 +49,14 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook4 ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glib-networking - libayatana-appindicator - webkitgtk_4_1 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glib-networking + libayatana-appindicator + webkitgtk_4_1 + ]; buildAndTestSubdir = "examples/api/src-tauri"; diff --git a/pkgs/by-name/ca/cargo-tauri_1/package.nix b/pkgs/by-name/ca/cargo-tauri_1/package.nix index c8f7ee7ba7b7..453295d5fa78 100644 --- a/pkgs/by-name/ca/cargo-tauri_1/package.nix +++ b/pkgs/by-name/ca/cargo-tauri_1/package.nix @@ -36,13 +36,14 @@ cargo-tauri.overrideAttrs ( hash = "sha256-t5sR02qC06H7A2vukwyZYKA2XMVUzJrgIOYuNSf42mE="; }; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gtk3 - libsoup_2_4 - webkitgtk_4_0 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gtk3 + libsoup_2_4 + webkitgtk_4_0 + ]; passthru = { hook = cargo-tauri.hook.override { cargo-tauri = cargo-tauri_1; }; diff --git a/pkgs/by-name/ca/cargo-udeps/package.nix b/pkgs/by-name/ca/cargo-udeps/package.nix index b22c2ac78f90..d735f07d88f0 100644 --- a/pkgs/by-name/ca/cargo-udeps/package.nix +++ b/pkgs/by-name/ca/cargo-udeps/package.nix @@ -25,11 +25,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; # TODO figure out how to use provided curl instead of compiling curl from curl-sys - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; # Requires network access doCheck = false; diff --git a/pkgs/by-name/ca/cargo-ui/package.nix b/pkgs/by-name/ca/cargo-ui/package.nix index ae4f18708aa6..394c3a463c86 100644 --- a/pkgs/by-name/ca/cargo-ui/package.nix +++ b/pkgs/by-name/ca/cargo-ui/package.nix @@ -28,21 +28,20 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - libgit2 - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - expat - fontconfig - libGL - xorg.libX11 - xorg.libXcursor - xorg.libXi - xorg.libXrandr - xorg.libxcb - ]; + buildInputs = [ + libgit2 + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + expat + fontconfig + libGL + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXrandr + xorg.libxcb + ]; postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' patchelf $out/bin/cargo-ui \ diff --git a/pkgs/by-name/ca/cargo-update/package.nix b/pkgs/by-name/ca/cargo-update/package.nix index 6414969caeb0..2438d46751c5 100644 --- a/pkgs/by-name/ca/cargo-update/package.nix +++ b/pkgs/by-name/ca/cargo-update/package.nix @@ -26,27 +26,25 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-PD6HycP6+/tKafirCc2Oj0MffHizLqTmDIrdIOmXY/w="; - nativeBuildInputs = - [ - cmake - installShellFiles - pkg-config - ronn - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + nativeBuildInputs = [ + cmake + installShellFiles + pkg-config + ronn + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; - buildInputs = - [ - libgit2 - libssh2 - openssl - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + buildInputs = [ + libgit2 + libssh2 + openssl + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; postBuild = '' # Man pages contain non-ASCII, so explicitly set encoding to UTF-8. diff --git a/pkgs/by-name/ca/cargo-vibe/package.nix b/pkgs/by-name/ca/cargo-vibe/package.nix index 1f0afa5289b0..f339d434a3df 100644 --- a/pkgs/by-name/ca/cargo-vibe/package.nix +++ b/pkgs/by-name/ca/cargo-vibe/package.nix @@ -28,7 +28,8 @@ rustPlatform.buildRustPackage { buildInputs = [ dbus openssl - ] ++ lib.optional stdenv.hostPlatform.isLinux udev; + ] + ++ lib.optional stdenv.hostPlatform.isLinux udev; meta = with lib; { description = "Cargo x Buttplug.io"; diff --git a/pkgs/by-name/ca/casadi/package.nix b/pkgs/by-name/ca/casadi/package.nix index 8cf856a27a8f..139aa6dce48d 100644 --- a/pkgs/by-name/ca/casadi/package.nix +++ b/pkgs/by-name/ca/casadi/package.nix @@ -58,50 +58,49 @@ stdenv.mkDerivation (finalAttrs: { ./clang-19.diff ]; - postPatch = - '' - # fix case of hpipmConfig.cmake - substituteInPlace CMakeLists.txt --replace-fail \ - "FATROP HPIPM" \ - "FATROP hpipm" + postPatch = '' + # fix case of hpipmConfig.cmake + substituteInPlace CMakeLists.txt --replace-fail \ + "FATROP HPIPM" \ + "FATROP hpipm" - # nix provide lib/clang headers in libclang, not in llvm. - substituteInPlace casadi/interfaces/clang/CMakeLists.txt --replace-fail \ - '$'{CLANG_LLVM_LIB_DIR} \ - ${lib.getLib llvmPackages.libclang}/lib + # nix provide lib/clang headers in libclang, not in llvm. + substituteInPlace casadi/interfaces/clang/CMakeLists.txt --replace-fail \ + '$'{CLANG_LLVM_LIB_DIR} \ + ${lib.getLib llvmPackages.libclang}/lib - # help casadi find its own libs - substituteInPlace casadi/core/casadi_os.cpp --replace-fail \ - "std::vector search_paths;" \ - "std::vector search_paths; - search_paths.push_back(\"$out/lib\");" - '' - + lib.optionalString pythonSupport '' - # fix including Python.h issue - substituteInPlace swig/python/CMakeLists.txt --replace-fail \ - "add_library(_casadi MODULE \''${PYTHON_FILE})" \ - "add_library(_casadi MODULE \''${PYTHON_FILE}) - target_include_directories(_casadi SYSTEM PRIVATE - ${python3Packages.python}/include/python3.${python3Packages.python.sourceVersion.minor})" + # help casadi find its own libs + substituteInPlace casadi/core/casadi_os.cpp --replace-fail \ + "std::vector search_paths;" \ + "std::vector search_paths; + search_paths.push_back(\"$out/lib\");" + '' + + lib.optionalString pythonSupport '' + # fix including Python.h issue + substituteInPlace swig/python/CMakeLists.txt --replace-fail \ + "add_library(_casadi MODULE \''${PYTHON_FILE})" \ + "add_library(_casadi MODULE \''${PYTHON_FILE}) + target_include_directories(_casadi SYSTEM PRIVATE + ${python3Packages.python}/include/python3.${python3Packages.python.sourceVersion.minor})" - # I have no clue. without this, it tries to install a non existent file. - # maybe a run without SWIG_IMPORT is required before a run with SWIG_IMPORT. - # but we need SWIG_IMPORT at some point for something else TODO - substituteInPlace swig/python/CMakeLists.txt --replace-fail \ - "if (SWIG_IMPORT)" \ - "if (NOT SWIG_IMPORT)" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # this is only printing stuff, and is not defined on all CPU - substituteInPlace casadi/interfaces/hpipm/hpipm_runtime.hpp --replace-fail \ - "d_print_exp_tran_mat" \ - "//d_print_exp_tran_mat" + # I have no clue. without this, it tries to install a non existent file. + # maybe a run without SWIG_IMPORT is required before a run with SWIG_IMPORT. + # but we need SWIG_IMPORT at some point for something else TODO + substituteInPlace swig/python/CMakeLists.txt --replace-fail \ + "if (SWIG_IMPORT)" \ + "if (NOT SWIG_IMPORT)" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # this is only printing stuff, and is not defined on all CPU + substituteInPlace casadi/interfaces/hpipm/hpipm_runtime.hpp --replace-fail \ + "d_print_exp_tran_mat" \ + "//d_print_exp_tran_mat" - # fix missing symbols - substituteInPlace cmake/FindCLANG.cmake --replace-fail \ - "clangBasic)" \ - "clangBasic clangASTMatchers clangSupport)" - ''; + # fix missing symbols + substituteInPlace cmake/FindCLANG.cmake --replace-fail \ + "clangBasic)" \ + "clangBasic clangASTMatchers clangSupport)" + ''; nativeBuildInputs = [ cmake @@ -109,43 +108,42 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - #alpaqa - blas - blasfeo - bzip2 - bonmin - cbc - clp - fatrop - highs - hpipm - ipopt - lapack - llvmPackages.clang - llvmPackages.libclang - llvmPackages.llvm - mumps - osqp - proxsuite - sleqp - suitesparse - #sundials - superscs - spral - swig - tinyxml-2 - ] - ++ lib.optionals withUnfree [ - cplex - gurobi - ] - ++ lib.optionals pythonSupport [ - python3Packages.numpy - python3Packages.python - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; + buildInputs = [ + #alpaqa + blas + blasfeo + bzip2 + bonmin + cbc + clp + fatrop + highs + hpipm + ipopt + lapack + llvmPackages.clang + llvmPackages.libclang + llvmPackages.llvm + mumps + osqp + proxsuite + sleqp + suitesparse + #sundials + superscs + spral + swig + tinyxml-2 + ] + ++ lib.optionals withUnfree [ + cplex + gurobi + ] + ++ lib.optionals pythonSupport [ + python3Packages.numpy + python3Packages.python + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; cmakeFlags = [ (lib.cmakeBool "WITH_PYTHON" pythonSupport) diff --git a/pkgs/by-name/ca/casync/package.nix b/pkgs/by-name/ca/casync/package.nix index 4f2863a6be60..7fa983f85ff3 100644 --- a/pkgs/by-name/ca/casync/package.nix +++ b/pkgs/by-name/ca/casync/package.nix @@ -33,16 +33,15 @@ stdenv.mkDerivation { hash = "sha256-L7I80kSG4/ES2tGvHHgvOxJZzF76yeqy2WquKCPhnFk="; }; - buildInputs = - [ - acl - curl - xz - zstd - ] - ++ lib.optionals fuseSupport [ fuse ] - ++ lib.optionals selinuxSupport [ libselinux ] - ++ lib.optionals udevSupport [ udev ]; + buildInputs = [ + acl + curl + xz + zstd + ] + ++ lib.optionals fuseSupport [ fuse ] + ++ lib.optionals selinuxSupport [ libselinux ] + ++ lib.optionals udevSupport [ udev ]; nativeBuildInputs = [ meson ninja @@ -50,14 +49,13 @@ stdenv.mkDerivation { python3 sphinx ]; - nativeCheckInputs = - [ - glibcLocales - rsync - ] - ++ lib.optionals udevSupport [ - udevCheckHook - ]; + nativeCheckInputs = [ + glibcLocales + rsync + ] + ++ lib.optionals udevSupport [ + udevCheckHook + ]; postPatch = '' for f in test/test-*.sh.in; do diff --git a/pkgs/by-name/ca/catalyst/package.nix b/pkgs/by-name/ca/catalyst/package.nix index d6e7f00903b7..0f0ef574fab7 100644 --- a/pkgs/by-name/ca/catalyst/package.nix +++ b/pkgs/by-name/ca/catalyst/package.nix @@ -29,17 +29,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-uPb7vgJpKquZVmSMxeWDVMiNkUdYv3oVVKu7t4+zkbs="; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pythonImportsCheckHook - ] - ++ lib.optionals fortranSupport [ - gfortran - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pythonImportsCheckHook + ] + ++ lib.optionals fortranSupport [ + gfortran + ]; propagatedBuildInputs = # create meta package providing dist-info for python3Pacakges.catalyst that common cmake build does not do diff --git a/pkgs/by-name/ca/catboost/package.nix b/pkgs/by-name/ca/catboost/package.nix index d79ad9ef84cb..f8dc6d272ed5 100644 --- a/pkgs/by-name/ca/catboost/package.nix +++ b/pkgs/by-name/ca/catboost/package.nix @@ -57,35 +57,33 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - nativeBuildInputs = - [ - cmake - llvmPackages.bintools - ninja - (python3Packages.python.withPackages (ps: with ps; [ six ])) - ragel - yasm - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + cmake + llvmPackages.bintools + ninja + (python3Packages.python.withPackages (ps: with ps; [ six ])) + ragel + yasm + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; - buildInputs = - [ - openssl - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - cudaPackages.cuda_cccl - cudaPackages.libcublas - ]; + buildInputs = [ + openssl + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + cudaPackages.cuda_cccl + cudaPackages.libcublas + ]; env = { PROGRAM_VERSION = finalAttrs.version; diff --git a/pkgs/by-name/ca/catclock/package.nix b/pkgs/by-name/ca/catclock/package.nix index 54fff59769e6..4d4071fa193a 100644 --- a/pkgs/by-name/ca/catclock/package.nix +++ b/pkgs/by-name/ca/catclock/package.nix @@ -29,19 +29,19 @@ stdenv.mkDerivation { makeFlags = [ "DESTINATION=$(out)/bin/" "CFLAGS=-Wno-incompatible-pointer-types" - ] ++ lib.optional withAudioTracking "WITH_TEMPO_TRACKER=1"; + ] + ++ lib.optional withAudioTracking "WITH_TEMPO_TRACKER=1"; - buildInputs = - [ - motif - xorg.libX11 - xorg.libXext - xorg.libXt - ] - ++ lib.optionals withAudioTracking [ - libpulseaudio - aubio - ]; + buildInputs = [ + motif + xorg.libX11 + xorg.libXext + xorg.libXt + ] + ++ lib.optionals withAudioTracking [ + libpulseaudio + aubio + ]; meta = with lib; { homepage = "http://codefromabove.com/2014/05/catclock/"; diff --git a/pkgs/by-name/ca/catdvi/package.nix b/pkgs/by-name/ca/catdvi/package.nix index cdbe3bddc5b5..5af575707a55 100644 --- a/pkgs/by-name/ca/catdvi/package.nix +++ b/pkgs/by-name/ca/catdvi/package.nix @@ -60,13 +60,12 @@ stdenv.mkDerivation (finalAttrs: { tex ]; - makeFlags = - [ - "catdvi" # to avoid running tests until checkPhase - ] - ++ lib.optionals (with stdenv; !buildPlatform.canExecute hostPlatform) ( - map (tool: "--assume-old=${tool}") buildPlatformTools - ); + makeFlags = [ + "catdvi" # to avoid running tests until checkPhase + ] + ++ lib.optionals (with stdenv; !buildPlatform.canExecute hostPlatform) ( + map (tool: "--assume-old=${tool}") buildPlatformTools + ); nativeCheckInputs = [ texlive diff --git a/pkgs/by-name/ca/catppuccin-fcitx5/package.nix b/pkgs/by-name/ca/catppuccin-fcitx5/package.nix index ef769a011d05..bc719eb21095 100644 --- a/pkgs/by-name/ca/catppuccin-fcitx5/package.nix +++ b/pkgs/by-name/ca/catppuccin-fcitx5/package.nix @@ -20,19 +20,18 @@ stdenvNoCC.mkDerivation { dontConfigure = true; dontBuild = true; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString withRoundedCorners '' - find src -name theme.conf -exec sed -iE 's/^# (Image=(panel|highlight).svg)/\1/' {} + - '' - + '' - mkdir -p $out/share/fcitx5 - cp -r src $out/share/fcitx5/themes + installPhase = '' + runHook preInstall + '' + + lib.optionalString withRoundedCorners '' + find src -name theme.conf -exec sed -iE 's/^# (Image=(panel|highlight).svg)/\1/' {} + + '' + + '' + mkdir -p $out/share/fcitx5 + cp -r src $out/share/fcitx5/themes - runHook postInstall - ''; + runHook postInstall + ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/by-name/ca/catppuccin/package.nix b/pkgs/by-name/ca/catppuccin/package.nix index dbd858137473..9435bd31dfc6 100644 --- a/pkgs/by-name/ca/catppuccin/package.nix +++ b/pkgs/by-name/ca/catppuccin/package.nix @@ -224,111 +224,110 @@ lib.checkListOfEnum "${pname}: variant" validVariants [ variant ] lib.checkListO done ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - local capitalizedVariant=$(sed 's/^\(.\)/\U\1/' <<< "${variant}") - local capitalizedAccent=$(sed 's/^\(.\)/\U\1/' <<< "${accent}") + local capitalizedVariant=$(sed 's/^\(.\)/\U\1/' <<< "${variant}") + local capitalizedAccent=$(sed 's/^\(.\)/\U\1/' <<< "${accent}") - '' - + lib.optionalString (lib.elem "alacritty" themeList) '' - mkdir -p "$out/alacritty" - cp "${sources.alacritty}/catppuccin-${variant}.toml" "$out/alacritty/" + '' + + lib.optionalString (lib.elem "alacritty" themeList) '' + mkdir -p "$out/alacritty" + cp "${sources.alacritty}/catppuccin-${variant}.toml" "$out/alacritty/" - '' - + lib.optionalString (lib.elem "bat" themeList) '' - mkdir -p "$out/bat" - cp "${sources.bat}/themes/Catppuccin "$capitalizedVariant".tmTheme" "$out/bat/" + '' + + lib.optionalString (lib.elem "bat" themeList) '' + mkdir -p "$out/bat" + cp "${sources.bat}/themes/Catppuccin "$capitalizedVariant".tmTheme" "$out/bat/" - '' - + lib.optionalString (lib.elem "btop" themeList) '' - mkdir -p "$out/btop" - cp "${sources.btop}/themes/catppuccin_${variant}.theme" "$out/btop/" + '' + + lib.optionalString (lib.elem "btop" themeList) '' + mkdir -p "$out/btop" + cp "${sources.btop}/themes/catppuccin_${variant}.theme" "$out/btop/" - '' - + lib.optionalString (lib.elem "bottom" themeList) '' - mkdir -p "$out/bottom" - cp "${sources.bottom}/themes/${variant}.toml" "$out/bottom/" + '' + + lib.optionalString (lib.elem "bottom" themeList) '' + mkdir -p "$out/bottom" + cp "${sources.bottom}/themes/${variant}.toml" "$out/bottom/" - '' - + lib.optionalString (lib.elem "element" themeList) '' - mkdir -p "$out/element" - cp -r "${sources.element}/themes/${variant}/${accent}.json" "$out/element/" + '' + + lib.optionalString (lib.elem "element" themeList) '' + mkdir -p "$out/element" + cp -r "${sources.element}/themes/${variant}/${accent}.json" "$out/element/" - '' - + lib.optionalString (lib.elem "grub" themeList) '' - mkdir -p "$out/grub" - cp -r "${sources.grub}/src/catppuccin-${variant}-grub-theme/"* "$out/grub/" + '' + + lib.optionalString (lib.elem "grub" themeList) '' + mkdir -p "$out/grub" + cp -r "${sources.grub}/src/catppuccin-${variant}-grub-theme/"* "$out/grub/" - '' - + lib.optionalString (lib.elem "hyprland" themeList) '' - mkdir -p "$out/hyprland" - cp "${sources.hyprland}/themes/${variant}.conf" "$out/hyprland/" + '' + + lib.optionalString (lib.elem "hyprland" themeList) '' + mkdir -p "$out/hyprland" + cp "${sources.hyprland}/themes/${variant}.conf" "$out/hyprland/" - '' - + lib.optionalString (lib.elem "k9s" themeList) '' - mkdir -p "$out/k9s" - cp "${sources.k9s}/dist/catppuccin-${variant}.yaml" "$out/k9s/" - cp "${sources.k9s}/dist/catppuccin-${variant}-transparent.yaml" "$out/k9s/" + '' + + lib.optionalString (lib.elem "k9s" themeList) '' + mkdir -p "$out/k9s" + cp "${sources.k9s}/dist/catppuccin-${variant}.yaml" "$out/k9s/" + cp "${sources.k9s}/dist/catppuccin-${variant}-transparent.yaml" "$out/k9s/" - '' - + lib.optionalString (lib.elem "kvantum" themeList) '' - mkdir -p "$out/share/Kvantum" - cp -r "${sources.kvantum}/themes/catppuccin-${variant}-${accent}" "$out/share/Kvantum" + '' + + lib.optionalString (lib.elem "kvantum" themeList) '' + mkdir -p "$out/share/Kvantum" + cp -r "${sources.kvantum}/themes/catppuccin-${variant}-${accent}" "$out/share/Kvantum" - '' - + lib.optionalString (lib.elem "lazygit" themeList) '' - mkdir -p "$out/lazygit/"{themes,themes-mergable} - cp "${sources.lazygit}/themes/${variant}/${accent}.yml" "$out/lazygit/themes/" - cp "${sources.lazygit}/themes-mergable/${variant}/${accent}.yml" "$out/lazygit/themes-mergable/" + '' + + lib.optionalString (lib.elem "lazygit" themeList) '' + mkdir -p "$out/lazygit/"{themes,themes-mergable} + cp "${sources.lazygit}/themes/${variant}/${accent}.yml" "$out/lazygit/themes/" + cp "${sources.lazygit}/themes-mergable/${variant}/${accent}.yml" "$out/lazygit/themes-mergable/" - '' - + lib.optionalString (lib.elem "lxqt" themeList) '' - mkdir -p "$out/share/lxqt/themes/catppuccin-${variant}" - cp -r "${sources.lxqt}/src/catppuccin-${variant}/"* "$out/share/lxqt/themes/catppuccin-${variant}" + '' + + lib.optionalString (lib.elem "lxqt" themeList) '' + mkdir -p "$out/share/lxqt/themes/catppuccin-${variant}" + cp -r "${sources.lxqt}/src/catppuccin-${variant}/"* "$out/share/lxqt/themes/catppuccin-${variant}" - '' - + lib.optionalString (lib.elem "plymouth" themeList) '' - mkdir -p "$out/share/plymouth/themes/catppuccin-${variant}" - cp ${sources.plymouth}/themes/catppuccin-${variant}/* $out/share/plymouth/themes/catppuccin-${variant} - sed -i 's:\(^ImageDir=\)/usr:\1'"$out"':' $out/share/plymouth/themes/catppuccin-${variant}/catppuccin-${variant}.plymouth + '' + + lib.optionalString (lib.elem "plymouth" themeList) '' + mkdir -p "$out/share/plymouth/themes/catppuccin-${variant}" + cp ${sources.plymouth}/themes/catppuccin-${variant}/* $out/share/plymouth/themes/catppuccin-${variant} + sed -i 's:\(^ImageDir=\)/usr:\1'"$out"':' $out/share/plymouth/themes/catppuccin-${variant}/catppuccin-${variant}.plymouth - '' - + lib.optionalString (lib.elem "qt5ct" themeList) '' - mkdir -p "$out/qt5ct" - cp "${sources.qt5ct}/themes/catppuccin-${variant}-${accent}.conf" "$out/qt5ct" + '' + + lib.optionalString (lib.elem "qt5ct" themeList) '' + mkdir -p "$out/qt5ct" + cp "${sources.qt5ct}/themes/catppuccin-${variant}-${accent}.conf" "$out/qt5ct" - '' - + lib.optionalString (lib.elem "rofi" themeList) '' - mkdir -p "$out/rofi" - cp "${sources.rofi}/themes/catppuccin-${variant}.rasi" "$out/rofi" + '' + + lib.optionalString (lib.elem "rofi" themeList) '' + mkdir -p "$out/rofi" + cp "${sources.rofi}/themes/catppuccin-${variant}.rasi" "$out/rofi" - '' - + lib.optionalString (lib.elem "refind" themeList) '' - mkdir -p "$out/refind/assets" - cp "${sources.refind}/${variant}.conf" "$out/refind" - cp -r "${sources.refind}/assets/${variant}" "$out/refind/assets" + '' + + lib.optionalString (lib.elem "refind" themeList) '' + mkdir -p "$out/refind/assets" + cp "${sources.refind}/${variant}.conf" "$out/refind" + cp -r "${sources.refind}/assets/${variant}" "$out/refind/assets" - '' - + lib.optionalString (lib.elem "starship" themeList) '' - mkdir -p "$out/starship" - cp "${sources.starship}/themes/${variant}.toml" "$out/starship" + '' + + lib.optionalString (lib.elem "starship" themeList) '' + mkdir -p "$out/starship" + cp "${sources.starship}/themes/${variant}.toml" "$out/starship" - '' - + lib.optionalString (lib.elem "thunderbird" themeList) '' - mkdir -p "$out/thunderbird" - cp "${sources.thunderbird}/themes/${variant}/${variant}-${accent}.xpi" "$out/thunderbird" + '' + + lib.optionalString (lib.elem "thunderbird" themeList) '' + mkdir -p "$out/thunderbird" + cp "${sources.thunderbird}/themes/${variant}/${variant}-${accent}.xpi" "$out/thunderbird" - '' - + lib.optionalString (lib.elem "waybar" themeList) '' - mkdir -p "$out/waybar" - cp "${sources.waybar}/themes/${variant}.css" "$out/waybar" + '' + + lib.optionalString (lib.elem "waybar" themeList) '' + mkdir -p "$out/waybar" + cp "${sources.waybar}/themes/${variant}.css" "$out/waybar" - '' - + '' - runHook postInstall - ''; + '' + + '' + runHook postInstall + ''; meta = { description = "Soothing pastel themes"; diff --git a/pkgs/by-name/ca/cava/package.nix b/pkgs/by-name/ca/cava/package.nix index 8deb020998ad..637d5515b53b 100644 --- a/pkgs/by-name/ca/cava/package.nix +++ b/pkgs/by-name/ca/cava/package.nix @@ -31,27 +31,26 @@ stdenv.mkDerivation rec { hash = "sha256-oKEUddzg7Gt3uu6x9D65JX0PvuC59r7Psb9VZz3+nCc="; }; - buildInputs = - [ - fftw - iniparser - libpulseaudio - libtool - ncurses - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - portaudio - ] - ++ lib.optionals withSDL2 [ - libGL - SDL2 - ] - ++ lib.optionals withPipewire [ - pipewire - ]; + buildInputs = [ + fftw + iniparser + libpulseaudio + libtool + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + portaudio + ] + ++ lib.optionals withSDL2 [ + libGL + SDL2 + ] + ++ lib.optionals withPipewire [ + pipewire + ]; nativeBuildInputs = [ autoreconfHook diff --git a/pkgs/by-name/cb/cbc/package.nix b/pkgs/by-name/cb/cbc/package.nix index c96cbc2e7a7d..3cc7618781eb 100644 --- a/pkgs/by-name/cb/cbc/package.nix +++ b/pkgs/by-name/cb/cbc/package.nix @@ -22,7 +22,8 @@ stdenv.mkDerivation rec { configureFlags = [ "-C" "--enable-static" - ] ++ lib.optionals stdenv.cc.isClang [ "CXXFLAGS=-std=c++14" ]; + ] + ++ lib.optionals stdenv.cc.isClang [ "CXXFLAGS=-std=c++14" ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/cb/cbmc/package.nix b/pkgs/by-name/cb/cbmc/package.nix index 58be8229c1c9..e82c400614ea 100644 --- a/pkgs/by-name/cb/cbmc/package.nix +++ b/pkgs/by-name/cb/cbmc/package.nix @@ -53,27 +53,26 @@ stdenv.mkDerivation (finalAttrs: { ./0002-Do-not-download-sources-in-cmake.patch ]; - postPatch = - '' - # fix library_check.sh interpreter error - patchShebangs . + postPatch = '' + # fix library_check.sh interpreter error + patchShebangs . - mkdir -p srccadical - cp -r ${finalAttrs.srccadical}/* srccadical + mkdir -p srccadical + cp -r ${finalAttrs.srccadical}/* srccadical - mkdir -p srcglucose - cp -r ${finalAttrs.srcglucose}/* srcglucose - find -exec chmod +w {} \; + mkdir -p srcglucose + cp -r ${finalAttrs.srcglucose}/* srcglucose + find -exec chmod +w {} \; - substituteInPlace src/solvers/CMakeLists.txt \ - --replace-fail "@srccadical@" "$PWD/srccadical" \ - --replace-fail "@srcglucose@" "$PWD/srcglucose" - '' - + lib.optionalString (!stdenv.cc.isGNU) '' - # goto-gcc rely on gcc - substituteInPlace "regression/CMakeLists.txt" \ - --replace-fail "add_subdirectory(goto-gcc)" "" - ''; + substituteInPlace src/solvers/CMakeLists.txt \ + --replace-fail "@srccadical@" "$PWD/srccadical" \ + --replace-fail "@srcglucose@" "$PWD/srcglucose" + '' + + lib.optionalString (!stdenv.cc.isGNU) '' + # goto-gcc rely on gcc + substituteInPlace "regression/CMakeLists.txt" \ + --replace-fail "add_subdirectory(goto-gcc)" "" + ''; postInstall = '' # goto-cc expects ls_parse.py in PATH diff --git a/pkgs/by-name/cc/ccache/package.nix b/pkgs/by-name/cc/ccache/package.nix index 00162a46eb58..58957dbddec4 100644 --- a/pkgs/by-name/cc/ccache/package.nix +++ b/pkgs/by-name/cc/ccache/package.nix @@ -86,22 +86,22 @@ stdenv.mkDerivation (finalAttrs: { bashInteractive ctestCheckHook writableTmpDirAsHomeHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin xcodebuild; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin xcodebuild; checkInputs = [ doctest ]; - disabledTests = - [ - "test.trim_dir" # flaky on hydra (possibly filesystem-specific?) - "test.fileclone" # flaky on hydra, also seems to fail on zfs - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test.basedir" - "test.multi_arch" - "test.nocpp2" - ]; + disabledTests = [ + "test.trim_dir" # flaky on hydra (possibly filesystem-specific?) + "test.fileclone" # flaky on hydra, also seems to fail on zfs + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test.basedir" + "test.multi_arch" + "test.nocpp2" + ]; passthru = { # A derivation that provides gcc and g++ commands, but that diff --git a/pkgs/by-name/cc/ccextractor/package.nix b/pkgs/by-name/cc/ccextractor/package.nix index 923490264df7..7d47d17201b6 100644 --- a/pkgs/by-name/cc/ccextractor/package.nix +++ b/pkgs/by-name/cc/ccextractor/package.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./remove-default-commit-hash.patch ./remove-vendored-libraries.patch - ] ++ finalAttrs.cargoDeps.vendorStaging.patches; + ] + ++ finalAttrs.cargoDeps.vendorStaging.patches; cmakeDir = "../src"; @@ -65,38 +66,36 @@ stdenv.mkDerivation (finalAttrs: { rustPlatform.bindgenHook ]; - buildInputs = - [ - gpac - protobufc - libpng - zlib - utf8proc - freetype - ffmpeg - libarchive - curl - libiconv - ] - ++ lib.optionals enableOcr [ - leptonica - tesseract - ]; + buildInputs = [ + gpac + protobufc + libpng + zlib + utf8proc + freetype + ffmpeg + libarchive + curl + libiconv + ] + ++ lib.optionals enableOcr [ + leptonica + tesseract + ]; - cmakeFlags = - [ - # The tests are all part of one `cargo test` invocation, so let’s - # get the output from it. - (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--verbose") + cmakeFlags = [ + # The tests are all part of one `cargo test` invocation, so let’s + # get the output from it. + (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--verbose") - # TODO: This (and the corresponding patch) should probably be - # removed for the next stable release. - (lib.cmakeFeature "GIT_COMMIT_HASH" finalAttrs.src.rev) - ] - ++ lib.optionals enableOcr [ - (lib.cmakeBool "WITH_OCR" true) - (lib.cmakeBool "WITH_HARDSUBX" true) - ]; + # TODO: This (and the corresponding patch) should probably be + # removed for the next stable release. + (lib.cmakeFeature "GIT_COMMIT_HASH" finalAttrs.src.rev) + ] + ++ lib.optionals enableOcr [ + (lib.cmakeBool "WITH_OCR" true) + (lib.cmakeBool "WITH_HARDSUBX" true) + ]; env = { FFMPEG_INCLUDE_DIR = "${lib.getDev ffmpeg}/include"; diff --git a/pkgs/by-name/cc/cctools/package.nix b/pkgs/by-name/cc/cctools/package.nix index cc6e8f2ab2d1..553897770acf 100644 --- a/pkgs/by-name/cc/cctools/package.nix +++ b/pkgs/by-name/cc/cctools/package.nix @@ -129,7 +129,8 @@ stdenv.mkDerivation (finalAttrs: { mesonFlags = [ (lib.mesonOption "b_ndebug" "if-release") - ] ++ lib.optionals (targetPrefix != "") [ (lib.mesonOption "target_prefix" targetPrefix) ]; + ] + ++ lib.optionals (targetPrefix != "") [ (lib.mesonOption "target_prefix" targetPrefix) ]; postInstall = '' ln -s ${targetPrefix}libtool "$out/bin/${targetPrefix}ranlib" diff --git a/pkgs/by-name/cc/cctz/package.nix b/pkgs/by-name/cc/cctz/package.nix index c9b40acb01f2..e8fb32213268 100644 --- a/pkgs/by-name/cc/cctz/package.nix +++ b/pkgs/by-name/cc/cctz/package.nix @@ -19,10 +19,11 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" ]; - installTargets = - [ "install_hdrs" ] - ++ lib.optional (!stdenv.hostPlatform.isStatic) "install_shared_lib" - ++ lib.optional stdenv.hostPlatform.isStatic "install_lib"; + installTargets = [ + "install_hdrs" + ] + ++ lib.optional (!stdenv.hostPlatform.isStatic) "install_shared_lib" + ++ lib.optional stdenv.hostPlatform.isStatic "install_lib"; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' install_name_tool -id $out/lib/libcctz.so $out/lib/libcctz.so diff --git a/pkgs/by-name/cd/cdo/package.nix b/pkgs/by-name/cd/cdo/package.nix index e3f10732ed21..992e8e141062 100644 --- a/pkgs/by-name/cd/cdo/package.nix +++ b/pkgs/by-name/cd/cdo/package.nix @@ -32,15 +32,14 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - configureFlags = - [ - "--with-netcdf=${netcdf}" - "--with-hdf5=${hdf5}" - "--with-eccodes=${eccodes}" - ] - ++ lib.optional enable_cdi_lib "--enable-cdi-lib" - ++ lib.optional enable_all_static "--enable-all-static" - ++ lib.optional enable_cxx "--enable-cxx"; + configureFlags = [ + "--with-netcdf=${netcdf}" + "--with-hdf5=${hdf5}" + "--with-eccodes=${eccodes}" + ] + ++ lib.optional enable_cdi_lib "--enable-cdi-lib" + ++ lib.optional enable_all_static "--enable-all-static" + ++ lib.optional enable_cxx "--enable-cxx"; meta = { description = "Collection of command line Operators to manipulate and analyse Climate and NWP model Data"; diff --git a/pkgs/by-name/cd/cdrkit/package.nix b/pkgs/by-name/cd/cdrkit/package.nix index 689b37621bb0..38f7594874df 100644 --- a/pkgs/by-name/cd/cdrkit/package.nix +++ b/pkgs/by-name/cd/cdrkit/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation (finalAttrs: { zlib bzip2 perl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libcap ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libcap ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.hostPlatform.isMusl [ @@ -41,22 +42,21 @@ stdenv.mkDerivation (finalAttrs: { ] ); - postPatch = - '' - QUILT_PATCHES=debian/patches quilt push -a - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace libusal/scsi-mac-iokit.c \ - --replace "IOKit/scsi-commands/SCSITaskLib.h" "IOKit/scsi/SCSITaskLib.h" - substituteInPlace genisoimage/sha256.c \ - --replace "" "" - substituteInPlace genisoimage/sha512.c \ - --replace "" "" - substituteInPlace genisoimage/sha256.h \ - --replace "__THROW" "" - substituteInPlace genisoimage/sha512.h \ - --replace "__THROW" "" - ''; + postPatch = '' + QUILT_PATCHES=debian/patches quilt push -a + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace libusal/scsi-mac-iokit.c \ + --replace "IOKit/scsi-commands/SCSITaskLib.h" "IOKit/scsi/SCSITaskLib.h" + substituteInPlace genisoimage/sha256.c \ + --replace "" "" + substituteInPlace genisoimage/sha512.c \ + --replace "" "" + substituteInPlace genisoimage/sha256.h \ + --replace "__THROW" "" + substituteInPlace genisoimage/sha512.h \ + --replace "__THROW" "" + ''; preConfigure = lib.optionalString stdenv.hostPlatform.isMusl '' substituteInPlace include/xconfig.h.in \ diff --git a/pkgs/by-name/cd/cdxgen/package.nix b/pkgs/by-name/cd/cdxgen/package.nix index 7baf4185d643..d695a0b1d238 100644 --- a/pkgs/by-name/cd/cdxgen/package.nix +++ b/pkgs/by-name/cd/cdxgen/package.nix @@ -22,18 +22,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-H83HEiBdXBIhSR18EtYcQey6aXy8URSjpeNVEs3UBm8="; }; - nativeBuildInputs = - [ - makeWrapper - nodejs - node-gyp # required for sqlite3 bindings - pnpm_9.configHook - python3 # required for sqlite3 bindings - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ - xcbuild - cctools.libtool - ]; + nativeBuildInputs = [ + makeWrapper + nodejs + node-gyp # required for sqlite3 bindings + pnpm_9.configHook + python3 # required for sqlite3 bindings + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ + xcbuild + cctools.libtool + ]; pnpmDeps = pnpm_9.fetchDeps { inherit (finalAttrs) pname version src; diff --git a/pkgs/by-name/ce/cegui/package.nix b/pkgs/by-name/ce/cegui/package.nix index 241624683aeb..f95bd65faef8 100644 --- a/pkgs/by-name/ce/cegui/package.nix +++ b/pkgs/by-name/ce/cegui/package.nix @@ -28,24 +28,22 @@ stdenv.mkDerivation { cmake ]; - buildInputs = - [ - ogre - freetype - boost - expat - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + ogre + freetype + boost + expat + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; - cmakeFlags = - [ - "-DCEGUI_OPTION_DEFAULT_IMAGECODEC=OgreRenderer-0" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - "-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}" - ]; + cmakeFlags = [ + "-DCEGUI_OPTION_DEFAULT_IMAGECODEC=OgreRenderer-0" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + "-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}" + ]; passthru.updateScript = unstableGitUpdater { branch = "v0"; diff --git a/pkgs/by-name/ce/celeste64/package.nix b/pkgs/by-name/ce/celeste64/package.nix index e24921723e4b..0fd0850ecdaf 100644 --- a/pkgs/by-name/ce/celeste64/package.nix +++ b/pkgs/by-name/ce/celeste64/package.nix @@ -50,7 +50,8 @@ buildDotnetModule rec { xorg.libXcursor xorg.libXi xorg.libXrandr - ] ++ lib.optionals withSELinux [ libselinux ]; + ] + ++ lib.optionals withSELinux [ libselinux ]; postInstall = '' export ICON_DIR=$out/share/icons/hicolor/256x256/apps diff --git a/pkgs/by-name/ce/centerpiece/package.nix b/pkgs/by-name/ce/centerpiece/package.nix index 7e11eefbca64..d487884f4d7d 100644 --- a/pkgs/by-name/ce/centerpiece/package.nix +++ b/pkgs/by-name/ce/centerpiece/package.nix @@ -28,23 +28,22 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-qwKn9NN7+F/S8ojObjWBU2y2wG0TNeYbYHiwou8AhnI="; nativeBuildInputs = [ pkg-config ]; - buildInputs = + buildInputs = [ + dbus + libGL + libxkbcommon + vulkan-loader + wayland + ] + ++ lib.optionals enableX11 ( + with xorg; [ - dbus - libGL - libxkbcommon - vulkan-loader - wayland + libX11 + libXcursor + libXi + libXrandr ] - ++ lib.optionals enableX11 ( - with xorg; - [ - libX11 - libXcursor - libXi - libXrandr - ] - ); + ); postFixup = lib.optional stdenv.hostPlatform.isLinux '' rpath=$(patchelf --print-rpath $out/bin/centerpiece) diff --git a/pkgs/by-name/cf/cflow/package.nix b/pkgs/by-name/cf/cflow/package.nix index b8d5ad527532..e6685a63ab7d 100644 --- a/pkgs/by-name/cf/cflow/package.nix +++ b/pkgs/by-name/cf/cflow/package.nix @@ -21,9 +21,10 @@ stdenv.mkDerivation rec { "$(cat ${stdenv.cc}/nix-support/orig-cc)/bin/cpp" ''; - buildInputs = - [ gettext ] - ++ + buildInputs = [ + gettext + ] + ++ # We don't have Emacs/GTK/etc. on {Dar,Cyg}win. lib.optional (!(lib.lists.any (x: stdenv.hostPlatform.system == x) [ "i686-cygwin" ])) emacs; diff --git a/pkgs/by-name/cg/cgns/package.nix b/pkgs/by-name/cg/cgns/package.nix index 2a6c6add38b7..6eea0db29d4b 100644 --- a/pkgs/by-name/cg/cgns/package.nix +++ b/pkgs/by-name/cg/cgns/package.nix @@ -32,15 +32,14 @@ stdenv.mkDerivation (finalAttrs: { gfortran ]; - buildInputs = - [ - hdf5 - ] - ++ lib.optionals withTools [ - tk - xorg.libXmu - libGLU - ]; + buildInputs = [ + hdf5 + ] + ++ lib.optionals withTools [ + tk + xorg.libXmu + libGLU + ]; cmakeFlags = [ (lib.cmakeBool "CGNS_ENABLE_FORTRAN" true) diff --git a/pkgs/by-name/ch/chatd/package.nix b/pkgs/by-name/ch/chatd/package.nix index fa8b090c740c..70e5ba36afeb 100644 --- a/pkgs/by-name/ch/chatd/package.nix +++ b/pkgs/by-name/ch/chatd/package.nix @@ -34,7 +34,8 @@ buildNpmPackage rec { makeWrapper electron pkg-config - ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; # for onnx libs + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; # for onnx libs buildInputs = [ (lib.getLib stdenv.cc.cc) # for libstdc++.so, required by onnxruntime diff --git a/pkgs/by-name/ch/checkinstall/package.nix b/pkgs/by-name/ch/checkinstall/package.nix index b236de7254f1..71ff625361b3 100644 --- a/pkgs/by-name/ch/checkinstall/package.nix +++ b/pkgs/by-name/ch/checkinstall/package.nix @@ -14,44 +14,43 @@ stdenv.mkDerivation rec { sha256 = "1x4kslyvfd6lm6zd1ylbq2pjxrafb77ydfjaqi16sa5qywn1jqfw"; }; - patches = - [ - # Include empty directories created by the installation script in - # generated packages. (E.g., if a `make install' does `mkdir - # /var/lib/mystuff', then /var/lib/mystuff should be included in - # the package.) - ./empty-dirs.patch + patches = [ + # Include empty directories created by the installation script in + # generated packages. (E.g., if a `make install' does `mkdir + # /var/lib/mystuff', then /var/lib/mystuff should be included in + # the package.) + ./empty-dirs.patch - # Implement the getxattr(), lgetxattr(), __open_2() and - # __open64_2() functions. Needed for doing builds on Ubuntu 8.10. - ./missing-functions.patch + # Implement the getxattr(), lgetxattr(), __open_2() and + # __open64_2() functions. Needed for doing builds on Ubuntu 8.10. + ./missing-functions.patch - # Don't include directories in the Debian `conffiles' file. - ./etc-dirs.patch + # Don't include directories in the Debian `conffiles' file. + ./etc-dirs.patch - # Support Glibc >= 2.8. - ./glibc-check.patch + # Support Glibc >= 2.8. + ./glibc-check.patch - # Fix a `conflicting types for 'scandir'' error on Glibc 2.11. - ./scandir.patch + # Fix a `conflicting types for 'scandir'' error on Glibc 2.11. + ./scandir.patch - # Fix a `conflicting types for 'readlink'' error since Glibc 2.19 - ./readlink-types.patch + # Fix a `conflicting types for 'readlink'' error since Glibc 2.19 + ./readlink-types.patch - # Fix BuildRoot handling in RPM builds. - ./set-buildroot.patch + # Fix BuildRoot handling in RPM builds. + ./set-buildroot.patch - (fetchurl { - url = "https://salsa.debian.org/debian/checkinstall/-/raw/7175ae9de0e45f42fdd7f185ab9a12043d5efeeb/debian/patches/0016-Define-_STAT_VER-_MKNOD_VER-locally-dropped-in-glibc.patch"; - hash = "sha256-InodEfvVMuN708yjXPrVXb+q8aUcyFhCLx35PHls0Eo="; - }) - ] + (fetchurl { + url = "https://salsa.debian.org/debian/checkinstall/-/raw/7175ae9de0e45f42fdd7f185ab9a12043d5efeeb/debian/patches/0016-Define-_STAT_VER-_MKNOD_VER-locally-dropped-in-glibc.patch"; + hash = "sha256-InodEfvVMuN708yjXPrVXb+q8aUcyFhCLx35PHls0Eo="; + }) + ] - ++ - lib.optional (stdenv.hostPlatform.system == "x86_64-linux") - # Force use of old memcpy so that installwatch works on Glibc < - # 2.14. - ./use-old-memcpy.patch; + ++ + lib.optional (stdenv.hostPlatform.system == "x86_64-linux") + # Force use of old memcpy so that installwatch works on Glibc < + # 2.14. + ./use-old-memcpy.patch; buildInputs = [ gettext ]; diff --git a/pkgs/by-name/ch/cheesecutter/package.nix b/pkgs/by-name/ch/cheesecutter/package.nix index c8760d8b8a3b..46bdd57d2376 100644 --- a/pkgs/by-name/ch/cheesecutter/package.nix +++ b/pkgs/by-name/ch/cheesecutter/package.nix @@ -18,16 +18,16 @@ stdenv.mkDerivation { sha256 = "sha256:0q4a791nayya6n01l0f4kk497rdq6kiq0n72fqdpwqy138pfwydn"; }; - patches = - [ - ./0001-Drop-baked-in-build-date-for-r13y.patch - ] - ++ lib.optional stdenv.hostPlatform.isDarwin ./0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch; + patches = [ + ./0001-Drop-baked-in-build-date-for-r13y.patch + ] + ++ lib.optional stdenv.hostPlatform.isDarwin ./0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch; nativeBuildInputs = [ acme ldc - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) patchelf; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) patchelf; buildInputs = [ SDL ]; diff --git a/pkgs/by-name/ch/chessx/package.nix b/pkgs/by-name/ch/chessx/package.nix index 94d6f8c7c8fe..13e77f602379 100644 --- a/pkgs/by-name/ch/chessx/package.nix +++ b/pkgs/by-name/ch/chessx/package.nix @@ -17,25 +17,23 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-76YOe1WpB+vdEoEKGTHeaWJLpCVE4RoyYu1WLy3Dxhg="; }; - nativeBuildInputs = - [ - pkg-config - ] - ++ (with libsForQt5; [ - qmake - wrapQtAppsHook - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with libsForQt5; [ + qmake + wrapQtAppsHook + ]); - buildInputs = - [ - zlib - ] - ++ (with libsForQt5; [ - qtbase - qtmultimedia - qtsvg - qttools - ]); + buildInputs = [ + zlib + ] + ++ (with libsForQt5; [ + qtbase + qtmultimedia + qtsvg + qttools + ]); patches = # needed to backport patches to successfully build, due to broken release diff --git a/pkgs/by-name/ch/chiptrack/package.nix b/pkgs/by-name/ch/chiptrack/package.nix index 44491818e6b6..efbf9268e811 100644 --- a/pkgs/by-name/ch/chiptrack/package.nix +++ b/pkgs/by-name/ch/chiptrack/package.nix @@ -61,7 +61,8 @@ rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec { harfbuzz icu libjpeg - ] ++ lib.optionals clangStdenv.hostPlatform.isLinux [ alsa-lib ]; + ] + ++ lib.optionals clangStdenv.hostPlatform.isLinux [ alsa-lib ]; # Has git dependencies useFetchCargoVendor = true; diff --git a/pkgs/by-name/ch/chromaprint/package.nix b/pkgs/by-name/ch/chromaprint/package.nix index 3f56672f23ae..e4a4f48ecba2 100644 --- a/pkgs/by-name/ch/chromaprint/package.nix +++ b/pkgs/by-name/ch/chromaprint/package.nix @@ -54,11 +54,12 @@ stdenv.mkDerivation (finalAttrs: { validatePkgConfig ]; - buildInputs = - [ ffmpeg-headless ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - zlib - ]; + buildInputs = [ + ffmpeg-headless + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + zlib + ]; # with trivialautovarinit enabled can produce an empty .pc file hardeningDisable = [ "trivialautovarinit" ]; @@ -93,16 +94,15 @@ stdenv.mkDerivation (finalAttrs: { runHook postCheck ''; - meta = - { - changelog = "https://github.com/acoustid/chromaprint/releases/tag/v${finalAttrs.version}"; - homepage = "https://acoustid.org/chromaprint"; - description = "AcoustID audio fingerprinting library"; - license = lib.licenses.lgpl21Plus; - platforms = lib.platforms.unix; - pkgConfigModules = [ "libchromaprint" ]; - } - // lib.attrsets.optionalAttrs withTools { - mainProgram = "fpcalc"; - }; + meta = { + changelog = "https://github.com/acoustid/chromaprint/releases/tag/v${finalAttrs.version}"; + homepage = "https://acoustid.org/chromaprint"; + description = "AcoustID audio fingerprinting library"; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.unix; + pkgConfigModules = [ "libchromaprint" ]; + } + // lib.attrsets.optionalAttrs withTools { + mainProgram = "fpcalc"; + }; }) diff --git a/pkgs/by-name/ch/chrony/package.nix b/pkgs/by-name/ch/chrony/package.nix index 4b95ca262320..5e9f5758b656 100644 --- a/pkgs/by-name/ch/chrony/package.nix +++ b/pkgs/by-name/ch/chrony/package.nix @@ -28,23 +28,23 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - gnutls - libedit - texinfo - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - libseccomp - pps-tools - ]; + buildInputs = [ + gnutls + libedit + texinfo + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + libseccomp + pps-tools + ]; configureFlags = [ "--enable-ntp-signd" "--sbindir=$(out)/bin" "--chronyrundir=/run/chrony" - ] ++ lib.optional stdenv.hostPlatform.isLinux "--enable-scfilter"; + ] + ++ lib.optional stdenv.hostPlatform.isLinux "--enable-scfilter"; patches = [ # Cleanup the installation script diff --git a/pkgs/by-name/ci/cifs-utils/package.nix b/pkgs/by-name/ci/cifs-utils/package.nix index c836ea5f80f1..9d7d307459bd 100644 --- a/pkgs/by-name/ci/cifs-utils/package.nix +++ b/pkgs/by-name/ci/cifs-utils/package.nix @@ -39,13 +39,14 @@ stdenv.mkDerivation rec { talloc ]; - configureFlags = - [ "ROOTSBINDIR=$(out)/sbin" ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # AC_FUNC_MALLOC is broken on cross builds. - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ]; + configureFlags = [ + "ROOTSBINDIR=$(out)/sbin" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # AC_FUNC_MALLOC is broken on cross builds. + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; meta = with lib; { homepage = "https://wiki.samba.org/index.php/LinuxCIFS_utils"; diff --git a/pkgs/by-name/ci/cinnamon-gsettings-overrides/package.nix b/pkgs/by-name/ci/cinnamon-gsettings-overrides/package.nix index 52bf50d5abb8..e2984b5e00a3 100644 --- a/pkgs/by-name/ci/cinnamon-gsettings-overrides/package.nix +++ b/pkgs/by-name/ci/cinnamon-gsettings-overrides/package.nix @@ -39,7 +39,8 @@ let gnome-terminal gsettings-desktop-schemas gtk3 - ] ++ extraGSettingsOverridePackages; + ] + ++ extraGSettingsOverridePackages; gsettingsOverrides = '' # Use Fedora's default to make text readable and diff --git a/pkgs/by-name/ci/cinny-desktop/package.nix b/pkgs/by-name/ci/cinny-desktop/package.nix index c78f7d1958a6..314e2412badc 100644 --- a/pkgs/by-name/ci/cinny-desktop/package.nix +++ b/pkgs/by-name/ci/cinny-desktop/package.nix @@ -68,15 +68,14 @@ rustPlatform.buildRustPackage (finalAttrs: { ) ''; - nativeBuildInputs = - [ - cargo-tauri_1.hook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - desktop-file-utils - pkg-config - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + cargo-tauri_1.hook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + desktop-file-utils + pkg-config + wrapGAppsHook3 + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ glib-networking diff --git a/pkgs/by-name/ci/cinny-unwrapped/package.nix b/pkgs/by-name/ci/cinny-unwrapped/package.nix index 53ce6b4bc7ad..2fd7b23861af 100644 --- a/pkgs/by-name/ci/cinny-unwrapped/package.nix +++ b/pkgs/by-name/ci/cinny-unwrapped/package.nix @@ -33,7 +33,8 @@ buildNpmPackage rec { pixman cairo pango - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ giflib ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ giflib ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/ci/ciscoPacketTracer8/package.nix b/pkgs/by-name/ci/ciscoPacketTracer8/package.nix index 6032f5407ed5..114eb60728f1 100644 --- a/pkgs/by-name/ci/ciscoPacketTracer8/package.nix +++ b/pkgs/by-name/ci/ciscoPacketTracer8/package.nix @@ -68,46 +68,45 @@ let url = "https://www.netacad.com"; }; - buildInputs = - [ - autoPatchelfHook - makeWrapper - alsa-lib - dbus - expat - fontconfig - glib - libdrm - libglvnd - libpulseaudio - libudev0-shim - libxkbcommon - libxml2' - libxslt - nspr - nss - wayland - ] - ++ (with xorg; [ - libICE - libSM - libX11 - libXScrnSaver - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libXrandr - libXrender - libXtst - libxcb - xcbutilimage - xcbutilkeysyms - xcbutilrenderutil - xcbutilwm - ]); + buildInputs = [ + autoPatchelfHook + makeWrapper + alsa-lib + dbus + expat + fontconfig + glib + libdrm + libglvnd + libpulseaudio + libudev0-shim + libxkbcommon + libxml2' + libxslt + nspr + nss + wayland + ] + ++ (with xorg; [ + libICE + libSM + libX11 + libXScrnSaver + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libXrandr + libXrender + libXtst + libxcb + xcbutilimage + xcbutilkeysyms + xcbutilrenderutil + xcbutilwm + ]); unpackPhase = '' runHook preUnpack diff --git a/pkgs/by-name/cj/cjdns/package.nix b/pkgs/by-name/cj/cjdns/package.nix index 45616081a481..305566a15a3a 100644 --- a/pkgs/by-name/cj/cjdns/package.nix +++ b/pkgs/by-name/cj/cjdns/package.nix @@ -34,14 +34,13 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-LJEKjhyAsK6b7mKObX8tNJdKt53iagMD/YLzoY5GVPw="; - nativeBuildInputs = - [ - which - python3 - nodejs - pkg-config - ] - ++ + nativeBuildInputs = [ + which + python3 + nodejs + pkg-config + ] + ++ # for flock lib.optional stdenv.hostPlatform.isLinux util-linux; diff --git a/pkgs/by-name/cj/cjs/package.nix b/pkgs/by-name/cj/cjs/package.nix index 9d3339369515..6a55db2dea23 100644 --- a/pkgs/by-name/cj/cjs/package.nix +++ b/pkgs/by-name/cj/cjs/package.nix @@ -35,19 +35,18 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - which # for locale detection - libxml2 # for xml-stripblanks - dbus # for dbus-run-session - gobject-introspection - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + which # for locale detection + libxml2 # for xml-stripblanks + dbus # for dbus-run-session + gobject-introspection + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ cairo diff --git a/pkgs/by-name/cl/clamav/package.nix b/pkgs/by-name/cl/clamav/package.nix index e1c0fb47a873..92ff9ed70751 100644 --- a/pkgs/by-name/cl/clamav/package.nix +++ b/pkgs/by-name/cl/clamav/package.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation rec { libmspack json_c check - ] ++ lib.optional stdenv.hostPlatform.isLinux systemd; + ] + ++ lib.optional stdenv.hostPlatform.isLinux systemd; cmakeFlags = [ "-DSYSTEMD_UNIT_DIR=${placeholder "out"}/lib/systemd" diff --git a/pkgs/by-name/cl/clang-uml/package.nix b/pkgs/by-name/cl/clang-uml/package.nix index 2a119ac37b8e..4a0809afe1cd 100644 --- a/pkgs/by-name/cl/clang-uml/package.nix +++ b/pkgs/by-name/cl/clang-uml/package.nix @@ -26,21 +26,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-mY6kJnwWLgCeKXSquNTxsnr4S3bKwedgiRixzyLWTK8="; }; - nativeBuildInputs = - [ - cmake - pkg-config - installShellFiles - ] - ++ ( - if debug then - [ - elfutils - libunwind - ] - else - [ ] - ); + nativeBuildInputs = [ + cmake + pkg-config + installShellFiles + ] + ++ ( + if debug then + [ + elfutils + libunwind + ] + else + [ ] + ); cmakeFlags = [ "-DCUSTOM_COMPILE_OPTIONS=-Wno-error=sign-compare" diff --git a/pkgs/by-name/cl/claws-mail/package.nix b/pkgs/by-name/cl/claws-mail/package.nix index 88adbe8526e6..43c7b2a91651 100644 --- a/pkgs/by-name/cl/claws-mail/package.nix +++ b/pkgs/by-name/cl/claws-mail/package.nix @@ -319,17 +319,17 @@ stdenv.mkDerivation rec { gsettings-desktop-schemas glib-networking gtk3 - ] ++ lib.concatMap (f: lib.optionals f.enabled f.deps) (lib.filter (f: f ? deps) features); + ] + ++ lib.concatMap (f: lib.optionals f.enabled f.deps) (lib.filter (f: f ? deps) features); - configureFlags = - [ - "--disable-manual" # Missing docbook-tools, e.g., docbook2html - "--disable-compface" # Missing compface library - "--disable-jpilot" # Missing jpilot library - ] - ++ (map ( - feature: map (flag: lib.strings.enableFeature feature.enabled flag) feature.flags - ) features); + configureFlags = [ + "--disable-manual" # Missing docbook-tools, e.g., docbook2html + "--disable-compface" # Missing compface library + "--disable-jpilot" # Missing jpilot library + ] + ++ (map ( + feature: map (flag: lib.strings.enableFeature feature.enabled flag) feature.flags + ) features); enableParallelBuilding = true; diff --git a/pkgs/by-name/cl/clblas/package.nix b/pkgs/by-name/cl/clblas/package.nix index 463f36deca47..12d59ec6d89e 100644 --- a/pkgs/by-name/cl/clblas/package.nix +++ b/pkgs/by-name/cl/clblas/package.nix @@ -48,15 +48,14 @@ stdenv.mkDerivation rec { gfortran python3 ]; - buildInputs = - [ - blas - boost - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - ocl-icd - opencl-headers - ]; + buildInputs = [ + blas + boost + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + ocl-icd + opencl-headers + ]; strictDeps = true; diff --git a/pkgs/by-name/cl/clfft/package.nix b/pkgs/by-name/cl/clfft/package.nix index 5b12ce60d3d1..e81f6aac8ceb 100644 --- a/pkgs/by-name/cl/clfft/package.nix +++ b/pkgs/by-name/cl/clfft/package.nix @@ -32,16 +32,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - fftw - fftwFloat - boost - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - opencl-clhpp - ocl-icd - ]; + buildInputs = [ + fftw + fftwFloat + boost + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + opencl-clhpp + ocl-icd + ]; # https://github.com/clMathLibraries/clFFT/issues/237 CXXFLAGS = "-std=c++98"; diff --git a/pkgs/by-name/cl/clickable/package.nix b/pkgs/by-name/cl/clickable/package.nix index e0f088ccd88c..5c47cbf6d919 100644 --- a/pkgs/by-name/cl/clickable/package.nix +++ b/pkgs/by-name/cl/clickable/package.nix @@ -31,43 +31,42 @@ python3Packages.buildPythonApplication rec { nativeCheckInputs = [ python3Packages.pytestCheckHook ]; - disabledTests = - [ - # Tests require docker - "test_cpp_plugin" - "test_html" - "test_python" - "test_qml_only" - "test_rust" - "test_review" - "test_click_build" - "test_no_device" - "test_no_file_temp" - "test_update" - "test_lib_build" - "test_clean" - "test_temp_exception" - "test_create_interactive" - "test_create_non_interactive" - "test_kill" - "test_writable_image" - "test_no_desktop_mode" - "test_no_lock" - "test_run_default_command" - "test_run" - "test_no_container_mode_log" - "test_custom_mode_log" - "test_skip_desktop_mode" - "test_log" - "test_custom_lock_file" - "test_launch_custom" - "test_launch" - "test_devices" - "test_install" - "test_skip_container_mode" - "test_godot_plugin" - ] - ++ + disabledTests = [ + # Tests require docker + "test_cpp_plugin" + "test_html" + "test_python" + "test_qml_only" + "test_rust" + "test_review" + "test_click_build" + "test_no_device" + "test_no_file_temp" + "test_update" + "test_lib_build" + "test_clean" + "test_temp_exception" + "test_create_interactive" + "test_create_non_interactive" + "test_kill" + "test_writable_image" + "test_no_desktop_mode" + "test_no_lock" + "test_run_default_command" + "test_run" + "test_no_container_mode_log" + "test_custom_mode_log" + "test_skip_desktop_mode" + "test_log" + "test_custom_lock_file" + "test_launch_custom" + "test_launch" + "test_devices" + "test_install" + "test_skip_container_mode" + "test_godot_plugin" + ] + ++ # There are no docker images available for the aarch64 architecture # which are required for tests. lib.optionals stdenv.hostPlatform.isAarch64 [ diff --git a/pkgs/by-name/cl/clickhouse/package.nix b/pkgs/by-name/cl/clickhouse/package.nix index e931fb642040..e19aa2b51b95 100644 --- a/pkgs/by-name/cl/clickhouse/package.nix +++ b/pkgs/by-name/cl/clickhouse/package.nix @@ -55,68 +55,65 @@ llvmPackages_19.stdenv.mkDerivation (finalAttrs: { }; strictDeps = true; - nativeBuildInputs = - [ - cmake - ninja - python3 - perl - llvmPackages_19.lld - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - nasm - yasm - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages_19.bintools - findutils - darwin.bootstrap_cmds - ] - ++ lib.optionals rustSupport [ - rustc - cargo - rustPlatform.cargoSetupHook - ]; + nativeBuildInputs = [ + cmake + ninja + python3 + perl + llvmPackages_19.lld + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + nasm + yasm + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages_19.bintools + findutils + darwin.bootstrap_cmds + ] + ++ lib.optionals rustSupport [ + rustc + cargo + rustPlatform.cargoSetupHook + ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; dontCargoSetupPostUnpack = true; - postPatch = - '' - patchShebangs src/ - patchShebangs utils/ + postPatch = '' + patchShebangs src/ + patchShebangs utils/ - sed -i 's|/usr/bin/env perl|"${lib.getExe perl}"|' contrib/openssl-cmake/CMakeLists.txt + sed -i 's|/usr/bin/env perl|"${lib.getExe perl}"|' contrib/openssl-cmake/CMakeLists.txt - substituteInPlace src/Storages/System/StorageSystemLicenses.sh \ - --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" - substituteInPlace utils/check-style/check-ungrouped-includes.sh \ - --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" - substituteInPlace utils/list-licenses/list-licenses.sh \ - --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - sed -i 's|gfind|find|' cmake/tools.cmake - sed -i 's|ggrep|grep|' cmake/tools.cmake + substituteInPlace src/Storages/System/StorageSystemLicenses.sh \ + --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" + substituteInPlace utils/check-style/check-ungrouped-includes.sh \ + --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" + substituteInPlace utils/list-licenses/list-licenses.sh \ + --replace-fail '$(git rev-parse --show-toplevel)' "$NIX_BUILD_TOP/$sourceRoot" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + sed -i 's|gfind|find|' cmake/tools.cmake + sed -i 's|ggrep|grep|' cmake/tools.cmake - # Make sure Darwin invokes lld.ld64 not lld. - substituteInPlace cmake/tools.cmake \ - --replace '--ld-path=''${LLD_PATH}' '-fuse-ld=lld' - '' - + lib.optionalString rustSupport '' - cargoSetupPostPatchHook() { true; } - ''; + # Make sure Darwin invokes lld.ld64 not lld. + substituteInPlace cmake/tools.cmake \ + --replace '--ld-path=''${LLD_PATH}' '-fuse-ld=lld' + '' + + lib.optionalString rustSupport '' + cargoSetupPostPatchHook() { true; } + ''; - cmakeFlags = - [ - "-DENABLE_TESTS=OFF" - "-DENABLE_DELTA_KERNEL_RS=0" - "-DCOMPILER_CACHE=disabled" - ] - ++ lib.optional ( - stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64 - ) "-DNO_ARMV81_OR_HIGHER=1"; + cmakeFlags = [ + "-DENABLE_TESTS=OFF" + "-DENABLE_DELTA_KERNEL_RS=0" + "-DCOMPILER_CACHE=disabled" + ] + ++ lib.optional ( + stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64 + ) "-DNO_ARMV81_OR_HIGHER=1"; env = { CARGO_HOME = "$PWD/../.cargo/"; diff --git a/pkgs/by-name/cl/clightning/package.nix b/pkgs/by-name/cl/clightning/package.nix index 1e339bc5481c..27f07acd62bd 100644 --- a/pkgs/by-name/cl/clightning/package.nix +++ b/pkgs/by-name/cl/clightning/package.nix @@ -39,24 +39,23 @@ stdenv.mkDerivation rec { # when building on darwin we need cctools to provide the correct libtool # as libwally-core detects the host as darwin and tries to add the -static # option to libtool, also we have to add the modified gsed package. - nativeBuildInputs = - [ - autoconf - autogen - automake - gettext - libtool - lowdown-unsandboxed - protobuf - py3 - unzip - which - libpq.pg_config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + autoconf + autogen + automake + gettext + libtool + lowdown-unsandboxed + protobuf + py3 + unzip + which + libpq.pg_config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + darwin.autoSignDarwinBinariesHook + ]; buildInputs = [ gmp diff --git a/pkgs/by-name/cl/cling/package.nix b/pkgs/by-name/cl/cling/package.nix index 701128be2bf0..60cbaabe1fb9 100644 --- a/pkgs/by-name/cl/cling/package.nix +++ b/pkgs/by-name/cl/cling/package.nix @@ -83,32 +83,31 @@ let strictDeps = true; - cmakeFlags = - [ - "-DLLVM_BINARY_DIR=${llvm.out}" - "-DLLVM_CONFIG=${llvm.dev}/bin/llvm-config" - "-DLLVM_LIBRARY_DIR=${llvm.lib}/lib" - "-DLLVM_MAIN_INCLUDE_DIR=${llvm.dev}/include" - "-DLLVM_TABLEGEN_EXE=${llvm.out}/bin/llvm-tblgen" - "-DLLVM_TOOLS_BINARY_DIR=${llvm.out}/bin" - "-DLLVM_BUILD_TOOLS=Off" - "-DLLVM_TOOL_CLING_BUILD=ON" + cmakeFlags = [ + "-DLLVM_BINARY_DIR=${llvm.out}" + "-DLLVM_CONFIG=${llvm.dev}/bin/llvm-config" + "-DLLVM_LIBRARY_DIR=${llvm.lib}/lib" + "-DLLVM_MAIN_INCLUDE_DIR=${llvm.dev}/include" + "-DLLVM_TABLEGEN_EXE=${llvm.out}/bin/llvm-tblgen" + "-DLLVM_TOOLS_BINARY_DIR=${llvm.out}/bin" + "-DLLVM_BUILD_TOOLS=Off" + "-DLLVM_TOOL_CLING_BUILD=ON" - "-DLLVM_TARGETS_TO_BUILD=host;NVPTX" - "-DLLVM_ENABLE_RTTI=ON" + "-DLLVM_TARGETS_TO_BUILD=host;NVPTX" + "-DLLVM_ENABLE_RTTI=ON" - # Setting -DCLING_INCLUDE_TESTS=ON causes the cling/tools targets to be built; - # see cling/tools/CMakeLists.txt - "-DCLING_INCLUDE_TESTS=ON" - "-DCLANG-TOOLS=OFF" - ] - ++ lib.optionals debug [ - "-DCMAKE_BUILD_TYPE=Debug" - ] - ++ lib.optionals useLLVMLibcxx [ - "-DLLVM_ENABLE_LIBCXX=ON" - "-DLLVM_ENABLE_LIBCXXABI=ON" - ]; + # Setting -DCLING_INCLUDE_TESTS=ON causes the cling/tools targets to be built; + # see cling/tools/CMakeLists.txt + "-DCLING_INCLUDE_TESTS=ON" + "-DCLANG-TOOLS=OFF" + ] + ++ lib.optionals debug [ + "-DCMAKE_BUILD_TYPE=Debug" + ] + ++ lib.optionals useLLVMLibcxx [ + "-DLLVM_ENABLE_LIBCXX=ON" + "-DLLVM_ENABLE_LIBCXXABI=ON" + ]; CPPFLAGS = if useLLVMLibcxx then [ "-stdlib=libc++" ] else [ ]; @@ -143,47 +142,46 @@ let # Thus, if you're packaging a Jupyter kernel, you either need to pass these flags as extra # args to xcpp (for xeus-cling) or put them in the environment variable CLING_OPTS # (for jupyter-cling-kernel). - flags = - [ - "-nostdinc" - "-nostdinc++" + flags = [ + "-nostdinc" + "-nostdinc++" - "-resource-dir" - "${llvm.lib}/lib" + "-resource-dir" + "${llvm.lib}/lib" - "-isystem" - "${lib.getLib unwrapped}/lib/clang/${llvmPackages_13.clang.version}/include" - ] - ++ lib.optionals useLLVMLibcxx [ - "-I" - "${lib.getDev llvmPackages_13.libcxx}/include/c++/v1" - "-L" - "${llvmPackages_13.libcxx}/lib" - "-l" - "${llvmPackages_13.libcxx}/lib/libc++${stdenv.hostPlatform.extensions.sharedLibrary}" - ] - ++ lib.optionals (!useLLVMLibcxx) [ - "-I" - "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}" - "-I" - "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}/${stdenv.hostPlatform.config}" - ] - ++ [ - # System libc on Linux - # On Darwin, this is an empty directory, so we need a separate include with - # apple-sdk (see below) - "-isystem" - "${lib.getDev stdenv.cc.libc}/include" + "-isystem" + "${lib.getLib unwrapped}/lib/clang/${llvmPackages_13.clang.version}/include" + ] + ++ lib.optionals useLLVMLibcxx [ + "-I" + "${lib.getDev llvmPackages_13.libcxx}/include/c++/v1" + "-L" + "${llvmPackages_13.libcxx}/lib" + "-l" + "${llvmPackages_13.libcxx}/lib/libc++${stdenv.hostPlatform.extensions.sharedLibrary}" + ] + ++ lib.optionals (!useLLVMLibcxx) [ + "-I" + "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}" + "-I" + "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}/${stdenv.hostPlatform.config}" + ] + ++ [ + # System libc on Linux + # On Darwin, this is an empty directory, so we need a separate include with + # apple-sdk (see below) + "-isystem" + "${lib.getDev stdenv.cc.libc}/include" - # cling includes - "-isystem" - "${lib.getDev unwrapped}/include" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # On Darwin, we need the system includes - "-isystem" - "${apple-sdk}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" - ]; + # cling includes + "-isystem" + "${lib.getDev unwrapped}/include" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # On Darwin, we need the system includes + "-isystem" + "${apple-sdk}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" + ]; in diff --git a/pkgs/by-name/cl/clipboard-jh/package.nix b/pkgs/by-name/cl/clipboard-jh/package.nix index 5ed2283649a3..a6e58c26e227 100644 --- a/pkgs/by-name/cl/clipboard-jh/package.nix +++ b/pkgs/by-name/cl/clipboard-jh/package.nix @@ -35,15 +35,16 @@ stdenv.mkDerivation rec { wayland-scanner ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libffi - wayland-protocols - wayland - xorg.libX11 - alsa-lib - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libffi + wayland-protocols + wayland + xorg.libX11 + alsa-lib + ]; cmakeBuildType = "MinSizeRel"; diff --git a/pkgs/by-name/cl/clutter/package.nix b/pkgs/by-name/cl/clutter/package.nix index 8d3fa575cf71..d4f6cf46fdc0 100644 --- a/pkgs/by-name/cl/clutter/package.nix +++ b/pkgs/by-name/cl/clutter/package.nix @@ -46,38 +46,36 @@ stdenv.mkDerivation rec { pkg-config gobject-introspection ]; - propagatedBuildInputs = - [ - cogl - pango - atk - json-glib - gobject-introspection - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libX11 - libGL - libGLU - libXext - libXfixes - libXdamage - libXcomposite - libXi - libxcb - libinput - libgudev - libxkbcommon - ]; + propagatedBuildInputs = [ + cogl + pango + atk + json-glib + gobject-introspection + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libX11 + libGL + libGLU + libXext + libXfixes + libXdamage + libXcomposite + libXi + libxcb + libinput + libgudev + libxkbcommon + ]; - configureFlags = - [ - "--enable-introspection" # needed by muffin AFAIK - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--without-x" - "--enable-x11-backend=no" - "--enable-quartz-backend=yes" - ]; + configureFlags = [ + "--enable-introspection" # needed by muffin AFAIK + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--without-x" + "--enable-x11-backend=no" + "--enable-quartz-backend=yes" + ]; env = lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index b4e3749dce91..8f2f690f90aa 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -55,35 +55,35 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-ptLrHr65kTDf5j71o0DD/bEUMczj18oUhSTBJZJM6mg="; }; - patches = - [ - # Add NIXPKGS_CMAKE_PREFIX_PATH to cmake which is like CMAKE_PREFIX_PATH - # except it is not searched for programs - ./000-nixpkgs-cmake-prefix-path.diff - # Don't search in non-Nix locations such as /usr, but do search in our libc. - ./001-search-path.diff - ] - ++ lib.optional stdenv.hostPlatform.isCygwin ./004-cygwin.diff - # On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG. - ++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff - # On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path. - ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) ( - replaceVars ./007-darwin-bsd-ps-abspath.diff { - ps = lib.getExe ps; - } - ) - ++ [ - # Backport of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9900 - # Needed to correctly link curl in pkgsStatic. - ./008-FindCURL-Add-more-target-properties-from-pkg-config.diff - ]; + patches = [ + # Add NIXPKGS_CMAKE_PREFIX_PATH to cmake which is like CMAKE_PREFIX_PATH + # except it is not searched for programs + ./000-nixpkgs-cmake-prefix-path.diff + # Don't search in non-Nix locations such as /usr, but do search in our libc. + ./001-search-path.diff + ] + ++ lib.optional stdenv.hostPlatform.isCygwin ./004-cygwin.diff + # On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG. + ++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff + # On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path. + ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) ( + replaceVars ./007-darwin-bsd-ps-abspath.diff { + ps = lib.getExe ps; + } + ) + ++ [ + # Backport of https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9900 + # Needed to correctly link curl in pkgsStatic. + ./008-FindCURL-Add-more-target-properties-from-pkg-config.diff + ]; - outputs = - [ "out" ] - ++ lib.optionals buildDocs [ - "man" - "info" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "man" + "info" + ]; separateDebugInfo = true; setOutputFlags = false; @@ -132,51 +132,50 @@ stdenv.mkDerivation (finalAttrs: { # variables and commandline switches configurePlatforms = [ ]; - configureFlags = - [ - "CXXFLAGS=-Wno-elaborated-enum-base" - "--docdir=share/doc/${finalAttrs.pname}-${finalAttrs.version}" - ] - ++ ( - if useSharedLibraries then - [ - "--no-system-cppdap" - "--no-system-jsoncpp" - "--system-libs" - ] - else - [ - "--no-system-libs" - ] - ) # FIXME: cleanup - ++ lib.optional qt5UI "--qt-gui" - ++ lib.optionals buildDocs [ - "--sphinx-build=${sphinx}/bin/sphinx-build" - "--sphinx-info" - "--sphinx-man" - ] - # Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20568 - ++ lib.optionals stdenv.hostPlatform.is32bit [ - "CFLAGS=-D_FILE_OFFSET_BITS=64" - "CXXFLAGS=-D_FILE_OFFSET_BITS=64" - ] - ++ [ - "--" - # We should set the proper `CMAKE_SYSTEM_NAME`. - # http://www.cmake.org/Wiki/CMake_Cross_Compiling - # - # Unfortunately cmake seems to expect absolute paths for ar, ranlib, and - # strip. Otherwise they are taken to be relative to the source root of the - # package being built. - (lib.cmakeFeature "CMAKE_CXX_COMPILER" "${stdenv.cc.targetPrefix}c++") - (lib.cmakeFeature "CMAKE_C_COMPILER" "${stdenv.cc.targetPrefix}cc") - (lib.cmakeFeature "CMAKE_AR" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar") - (lib.cmakeFeature "CMAKE_RANLIB" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib") - (lib.cmakeFeature "CMAKE_STRIP" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip") + configureFlags = [ + "CXXFLAGS=-Wno-elaborated-enum-base" + "--docdir=share/doc/${finalAttrs.pname}-${finalAttrs.version}" + ] + ++ ( + if useSharedLibraries then + [ + "--no-system-cppdap" + "--no-system-jsoncpp" + "--system-libs" + ] + else + [ + "--no-system-libs" + ] + ) # FIXME: cleanup + ++ lib.optional qt5UI "--qt-gui" + ++ lib.optionals buildDocs [ + "--sphinx-build=${sphinx}/bin/sphinx-build" + "--sphinx-info" + "--sphinx-man" + ] + # Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20568 + ++ lib.optionals stdenv.hostPlatform.is32bit [ + "CFLAGS=-D_FILE_OFFSET_BITS=64" + "CXXFLAGS=-D_FILE_OFFSET_BITS=64" + ] + ++ [ + "--" + # We should set the proper `CMAKE_SYSTEM_NAME`. + # http://www.cmake.org/Wiki/CMake_Cross_Compiling + # + # Unfortunately cmake seems to expect absolute paths for ar, ranlib, and + # strip. Otherwise they are taken to be relative to the source root of the + # package being built. + (lib.cmakeFeature "CMAKE_CXX_COMPILER" "${stdenv.cc.targetPrefix}c++") + (lib.cmakeFeature "CMAKE_C_COMPILER" "${stdenv.cc.targetPrefix}cc") + (lib.cmakeFeature "CMAKE_AR" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar") + (lib.cmakeFeature "CMAKE_RANLIB" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib") + (lib.cmakeFeature "CMAKE_STRIP" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip") - (lib.cmakeBool "CMAKE_USE_OPENSSL" useOpenSSL) - (lib.cmakeBool "BUILD_CursesDialog" cursesUI) - ]; + (lib.cmakeBool "CMAKE_USE_OPENSSL" useOpenSSL) + (lib.cmakeBool "BUILD_CursesDialog" cursesUI) + ]; # `pkgsCross.musl64.cmake.override { stdenv = pkgsCross.musl64.llvmPackages_16.libcxxStdenv; }` # fails with `The C++ compiler does not support C++11 (e.g. std::unique_ptr).` diff --git a/pkgs/by-name/cm/cmdstan/package.nix b/pkgs/by-name/cm/cmdstan/package.nix index 7be852409821..022f27e74cb8 100644 --- a/pkgs/by-name/cm/cmdstan/package.nix +++ b/pkgs/by-name/cm/cmdstan/package.nix @@ -32,26 +32,24 @@ stdenv.mkDerivation rec { stanc ]; - preConfigure = - '' - patchShebangs test-all.sh runCmdStanTests.py stan/ - '' - # Fix inclusion of hardcoded paths in PCH files, by building in the store. - + '' - mkdir -p $out/opt - cp -R . $out/opt/cmdstan - cd $out/opt/cmdstan - mkdir -p bin - ln -s ${buildPackages.stanc}/bin/stanc bin/stanc - ''; + preConfigure = '' + patchShebangs test-all.sh runCmdStanTests.py stan/ + '' + # Fix inclusion of hardcoded paths in PCH files, by building in the store. + + '' + mkdir -p $out/opt + cp -R . $out/opt/cmdstan + cd $out/opt/cmdstan + mkdir -p bin + ln -s ${buildPackages.stanc}/bin/stanc bin/stanc + ''; - makeFlags = - [ - "build" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "arch=${stdenv.hostPlatform.darwinArch}" - ]; + makeFlags = [ + "build" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "arch=${stdenv.hostPlatform.darwinArch}" + ]; # Disable inclusion of timestamps in PCH files when using Clang. env.CXXFLAGS = lib.optionalString stdenv.cc.isClang "-Xclang -fno-pch-timestamp"; diff --git a/pkgs/by-name/cm/cmtk/package.nix b/pkgs/by-name/cm/cmtk/package.nix index c7fa4fb79e5f..e7fc907704ce 100644 --- a/pkgs/by-name/cm/cmtk/package.nix +++ b/pkgs/by-name/cm/cmtk/package.nix @@ -27,23 +27,21 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - bzip2 - fftw - zlib - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ]; + buildInputs = [ + bzip2 + fftw + zlib + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ]; - cmakeFlags = - [ - (lib.cmakeFeature "CMAKE_CXX_STANDARD" "14") - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Dfinite=isfinite") - ]; + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_CXX_STANDARD" "14") + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-Dfinite=isfinite") + ]; meta = with lib; { description = "Computational Morphometry Toolkit"; diff --git a/pkgs/by-name/cm/cmusfm/package.nix b/pkgs/by-name/cm/cmusfm/package.nix index 996103874d1f..fbc0b60f4398 100644 --- a/pkgs/by-name/cm/cmusfm/package.nix +++ b/pkgs/by-name/cm/cmusfm/package.nix @@ -23,8 +23,7 @@ stdenv.mkDerivation rec { }; configureFlags = - lib.optional libnotifySupport "--enable-libnotify" - ++ lib.optional debug "--enable-debug"; + lib.optional libnotifySupport "--enable-libnotify" ++ lib.optional debug "--enable-debug"; nativeBuildInputs = [ autoreconfHook @@ -34,7 +33,8 @@ stdenv.mkDerivation rec { buildInputs = [ curl gdk-pixbuf - ] ++ lib.optional libnotifySupport libnotify; + ] + ++ lib.optional libnotifySupport libnotify; meta = with lib; { description = "Last.fm and Libre.fm standalone scrobbler for the cmus music player"; diff --git a/pkgs/by-name/cn/cnijfilter2/package.nix b/pkgs/by-name/cn/cnijfilter2/package.nix index 2a25ed7b212e..ef28042fd6be 100644 --- a/pkgs/by-name/cn/cnijfilter2/package.nix +++ b/pkgs/by-name/cn/cnijfilter2/package.nix @@ -46,70 +46,69 @@ stdenv.mkDerivation { # # Note that the drivers attempt to dlopen # $out/lib/cups/filter/libcnbpcnclapicom2.so - buildPhase = - '' - mkdir -p $out/lib - cp com/libs_bin_x86_64/* $out/lib - mkdir -p $out/lib/cups/filter - ln -s $out/lib/libcnbpcnclapicom2.so $out/lib/cups/filter + buildPhase = '' + mkdir -p $out/lib + cp com/libs_bin_x86_64/* $out/lib + mkdir -p $out/lib/cups/filter + ln -s $out/lib/libcnbpcnclapicom2.so $out/lib/cups/filter - export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib" - '' - + lib.optionalString withDebug '' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D__DEBUG__ -DDEBUG_LOG" - '' - + '' + export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib" + '' + + lib.optionalString withDebug '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D__DEBUG__ -DDEBUG_LOG" + '' + + '' - ( - cd lgmon3 - substituteInPlace src/Makefile.am \ - --replace /usr/include/libusb-1.0 \ - ${libusb1.dev}/include/libusb-1.0 - ./autogen.sh --prefix=$out --enable-progpath=$out/bin \ - --datadir=$out/share \ - --enable-libdir=/var/cache/cups - make - ) + ( + cd lgmon3 + substituteInPlace src/Makefile.am \ + --replace /usr/include/libusb-1.0 \ + ${libusb1.dev}/include/libusb-1.0 + ./autogen.sh --prefix=$out --enable-progpath=$out/bin \ + --datadir=$out/share \ + --enable-libdir=/var/cache/cups + make + ) - ( - cd cmdtocanonij2 - ./autogen.sh --prefix=$out - make - ) + ( + cd cmdtocanonij2 + ./autogen.sh --prefix=$out + make + ) - ( - cd cmdtocanonij3 - ./autogen.sh --prefix=$out - make - ) + ( + cd cmdtocanonij3 + ./autogen.sh --prefix=$out + make + ) - ( - cd cnijbe2 - substituteInPlace src/Makefile.am \ - --replace "/usr/lib/cups/backend" \ - "$out/lib/cups/backend" - ./autogen.sh --prefix=$out --enable-progpath=$out/bin - make - ) + ( + cd cnijbe2 + substituteInPlace src/Makefile.am \ + --replace "/usr/lib/cups/backend" \ + "$out/lib/cups/backend" + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + make + ) - ( - cd rastertocanonij - ./autogen.sh --prefix=$out --enable-progpath=$out/bin - make - ) + ( + cd rastertocanonij + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + make + ) - ( - cd tocanonij - ./autogen.sh --prefix=$out --enable-progpath=$out/bin - make - ) + ( + cd tocanonij + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + make + ) - ( - cd tocnpwg - ./autogen.sh --prefix=$out --enable-progpath=$out/bin - make - ) - ''; + ( + cd tocnpwg + ./autogen.sh --prefix=$out --enable-progpath=$out/bin + make + ) + ''; installPhase = '' ( diff --git a/pkgs/by-name/co/coal/package.nix b/pkgs/by-name/co/coal/package.nix index c1024bb275c7..22c9d456f0c1 100644 --- a/pkgs/by-name/co/coal/package.nix +++ b/pkgs/by-name/co/coal/package.nix @@ -28,32 +28,30 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - doxygen - ] - ++ lib.optionals pythonSupport [ - python3Packages.numpy - python3Packages.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + cmake + doxygen + ] + ++ lib.optionals pythonSupport [ + python3Packages.numpy + python3Packages.pythonImportsCheckHook + ]; - propagatedBuildInputs = - [ - assimp - jrl-cmakemodules - octomap - qhull - zlib - ] - ++ lib.optionals (!pythonSupport) [ - boost - eigen - ] - ++ lib.optionals pythonSupport [ - python3Packages.boost - python3Packages.eigenpy - ]; + propagatedBuildInputs = [ + assimp + jrl-cmakemodules + octomap + qhull + zlib + ] + ++ lib.optionals (!pythonSupport) [ + boost + eigen + ] + ++ lib.optionals pythonSupport [ + python3Packages.boost + python3Packages.eigenpy + ]; cmakeFlags = [ (lib.cmakeBool "COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL" true) diff --git a/pkgs/by-name/co/code-cursor/package.nix b/pkgs/by-name/co/code-cursor/package.nix index 8b884edea82f..02de5e2a9464 100644 --- a/pkgs/by-name/co/code-cursor/package.nix +++ b/pkgs/by-name/co/code-cursor/package.nix @@ -89,14 +89,14 @@ in platforms = [ "aarch64-linux" "x86_64-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; mainProgram = "cursor"; }; }).overrideAttrs (oldAttrs: { nativeBuildInputs = - (oldAttrs.nativeBuildInputs or [ ]) - ++ lib.optionals hostPlatform.isDarwin [ undmg ]; + (oldAttrs.nativeBuildInputs or [ ]) ++ lib.optionals hostPlatform.isDarwin [ undmg ]; preInstall = (oldAttrs.preInstall or "") diff --git a/pkgs/by-name/co/codeblocks/package.nix b/pkgs/by-name/co/codeblocks/package.nix index c668c9e39a73..93c28e9d333b 100644 --- a/pkgs/by-name/co/codeblocks/package.nix +++ b/pkgs/by-name/co/codeblocks/package.nix @@ -31,15 +31,14 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - wxGTK32 - gtk3 - ] - ++ lib.optionals contribPlugins [ - hunspell - boost - ]; + buildInputs = [ + wxGTK32 + gtk3 + ] + ++ lib.optionals contribPlugins [ + hunspell + boost + ]; enableParallelBuilding = true; @@ -49,15 +48,16 @@ stdenv.mkDerivation rec { postConfigure = lib.optionalString stdenv.hostPlatform.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig"; - configureFlags = - [ "--enable-pch=no" ] - ++ lib.optionals contribPlugins [ - ( - "--with-contrib-plugins=all,-FileManager" - + lib.optionalString stdenv.hostPlatform.isDarwin ",-NassiShneiderman" - ) - "--with-boost-libdir=${boost}/lib" - ]; + configureFlags = [ + "--enable-pch=no" + ] + ++ lib.optionals contribPlugins [ + ( + "--with-contrib-plugins=all,-FileManager" + + lib.optionalString stdenv.hostPlatform.isDarwin ",-NassiShneiderman" + ) + "--with-boost-libdir=${boost}/lib" + ]; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' ln -s $out/lib/codeblocks/plugins $out/share/codeblocks/plugins diff --git a/pkgs/by-name/co/codec2/package.nix b/pkgs/by-name/co/codec2/package.nix index a158cf390cfb..d223c9cc83cd 100644 --- a/pkgs/by-name/co/codec2/package.nix +++ b/pkgs/by-name/co/codec2/package.nix @@ -58,23 +58,22 @@ stdenv.mkDerivation (finalAttrs: { sed -r -i 's/(\<_Complex)(\s+)(float|double)/\3\2\1/' $dev/include/$pname/freedv_api.h '' + - # generated cmake module is not compatible with multiple outputs - '' - substituteInPlace $dev/lib/cmake/codec2/codec2-config.cmake --replace-fail \ - '"''${_IMPORT_PREFIX}/include/codec2' \ - "\"$dev/include/codec2" - ''; + # generated cmake module is not compatible with multiple outputs + '' + substituteInPlace $dev/lib/cmake/codec2/codec2-config.cmake --replace-fail \ + '"''${_IMPORT_PREFIX}/include/codec2' \ + "\"$dev/include/codec2" + ''; - cmakeFlags = - [ - # RPATH of binary /nix/store/.../bin/freedv_rx contains a forbidden reference to /build/ - "-DCMAKE_SKIP_BUILD_RPATH=ON" - "-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc" - "-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++" - ] - ++ lib.optionals freedvSupport [ - "-DLPCNET=ON" - ]; + cmakeFlags = [ + # RPATH of binary /nix/store/.../bin/freedv_rx contains a forbidden reference to /build/ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + "-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc" + "-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++" + ] + ++ lib.optionals freedvSupport [ + "-DLPCNET=ON" + ]; passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; diff --git a/pkgs/by-name/co/cogl/package.nix b/pkgs/by-name/co/cogl/package.nix index 76bf395f125d..5b944683a0a6 100644 --- a/pkgs/by-name/co/cogl/package.nix +++ b/pkgs/by-name/co/cogl/package.nix @@ -54,50 +54,48 @@ stdenv.mkDerivation rec { gobject-introspection ]; - configureFlags = - [ - "--enable-introspection" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "--enable-kms-egl-platform" - "--enable-wayland-egl-platform" - "--enable-wayland-egl-server" - "--enable-gles1" - "--enable-gles2" - # Force linking against libGL. - # Otherwise, it tries to load it from the runtime library path. - "LIBS=-lGL" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--disable-glx" - "--without-x" - ] - ++ lib.optionals gstreamerSupport [ - "--enable-cogl-gst" - ]; + configureFlags = [ + "--enable-introspection" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "--enable-kms-egl-platform" + "--enable-wayland-egl-platform" + "--enable-wayland-egl-server" + "--enable-gles1" + "--enable-gles2" + # Force linking against libGL. + # Otherwise, it tries to load it from the runtime library path. + "LIBS=-lGL" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--disable-glx" + "--without-x" + ] + ++ lib.optionals gstreamerSupport [ + "--enable-cogl-gst" + ]; # TODO: this shouldn't propagate so many things # especially not gobject-introspection - propagatedBuildInputs = - [ - glib - gdk-pixbuf - gobject-introspection - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - libgbm - mesa-gl-headers - libGL - xorg.libXrandr - xorg.libXfixes - xorg.libXcomposite - xorg.libXdamage - ] - ++ lib.optionals gstreamerSupport [ - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - ]; + propagatedBuildInputs = [ + glib + gdk-pixbuf + gobject-introspection + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + libgbm + mesa-gl-headers + libGL + xorg.libXrandr + xorg.libXfixes + xorg.libXcomposite + xorg.libXdamage + ] + ++ lib.optionals gstreamerSupport [ + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + ]; buildInputs = lib.optionals pangoSupport [ pango @@ -105,19 +103,18 @@ stdenv.mkDerivation rec { harfbuzz ]; - env = - { - COGL_PANGO_DEP_CFLAGS = toString ( - lib.optionals (stdenv.hostPlatform.isDarwin && pangoSupport) [ - "-I${pango.dev}/include/pango-1.0" - "-I${cairo.dev}/include/cairo" - "-I${harfbuzz.dev}/include/harfbuzz" - ] - ); - } - // lib.optionalAttrs stdenv.cc.isClang { - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; - }; + env = { + COGL_PANGO_DEP_CFLAGS = toString ( + lib.optionals (stdenv.hostPlatform.isDarwin && pangoSupport) [ + "-I${pango.dev}/include/pango-1.0" + "-I${cairo.dev}/include/cairo" + "-I${harfbuzz.dev}/include/harfbuzz" + ] + ); + } + // lib.optionalAttrs stdenv.cc.isClang { + NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; + }; #doCheck = true; # all tests fail (no idea why) diff --git a/pkgs/by-name/co/coin3d/package.nix b/pkgs/by-name/co/coin3d/package.nix index 4afb78c92724..1d50662a8560 100644 --- a/pkgs/by-name/co/coin3d/package.nix +++ b/pkgs/by-name/co/coin3d/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation (finalAttrs: { boost libGL libGLU - ] ++ lib.optional stdenv.hostPlatform.isLinux libX11; + ] + ++ lib.optional stdenv.hostPlatform.isLinux libX11; cmakeFlags = [ "-DCOIN_USE_CPACK=OFF" ]; diff --git a/pkgs/by-name/co/colima/package.nix b/pkgs/by-name/co/colima/package.nix index 4158c7027c73..ca4b9a17660d 100644 --- a/pkgs/by-name/co/colima/package.nix +++ b/pkgs/by-name/co/colima/package.nix @@ -32,7 +32,8 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; vendorHash = "sha256-rqCPpO/Va31U++sfELcN1X6oDtDiCXoGj0RHKZUM6rY="; diff --git a/pkgs/by-name/co/collision/package.nix b/pkgs/by-name/co/collision/package.nix index eb2552c1e097..8531bba760bc 100644 --- a/pkgs/by-name/co/collision/package.nix +++ b/pkgs/by-name/co/collision/package.nix @@ -47,15 +47,14 @@ crystal.buildCrystalPackage rec { # main_module:(.text+0x6f0): undefined reference to `SSL_library_init' # There is an explanation for this https://danilafe.com/blog/crystal_nix_revisited/ # Shortly, adding pkg-config to buildInputs along with openssl fixes the issue. - nativeBuildInputs = - [ - wrapGAppsHook4 - pkg-config - gobject-introspection - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + wrapGAppsHook4 + pkg-config + gobject-introspection + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; buildInputs = [ libadwaita diff --git a/pkgs/by-name/co/colord-gtk/package.nix b/pkgs/by-name/co/colord-gtk/package.nix index 7c6895d10d1b..89ad41085954 100644 --- a/pkgs/by-name/co/colord-gtk/package.nix +++ b/pkgs/by-name/co/colord-gtk/package.nix @@ -53,20 +53,19 @@ stdenv.mkDerivation rec { lcms2 ]; - propagatedBuildInputs = - [ - colord - ] - ++ ( - if withGtk4 then - [ - gtk4 - ] - else - [ - gtk3 - ] - ); + propagatedBuildInputs = [ + colord + ] + ++ ( + if withGtk4 then + [ + gtk4 + ] + else + [ + gtk3 + ] + ); mesonFlags = [ "-Dgtk4=${lib.boolToString withGtk4}" diff --git a/pkgs/by-name/co/colord/package.nix b/pkgs/by-name/co/colord/package.nix index 52b99912eb97..280a583f6066 100644 --- a/pkgs/by-name/co/colord/package.nix +++ b/pkgs/by-name/co/colord/package.nix @@ -77,46 +77,44 @@ stdenv.mkDerivation rec { (lib.mesonBool "udev_rules" (lib.elem "udev" udev.meta.pkgConfigModules)) ]; - nativeBuildInputs = - [ - docbook_xml_dtd_412 - docbook_xsl - docbook_xsl_ns - gettext - gobject-introspection - gtk-doc - libxslt - meson - ninja - pkg-config - shared-mime-info - vala - wrapGAppsNoGuiHook - udevCheckHook - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + docbook_xml_dtd_412 + docbook_xsl + docbook_xsl_ns + gettext + gobject-introspection + gtk-doc + libxslt + meson + ninja + pkg-config + shared-mime-info + vala + wrapGAppsNoGuiHook + udevCheckHook + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - argyllcms - bash-completion - dbus - glib - gusb - lcms2 - libgudev - sane-backends - sqlite - udev - ] - ++ lib.optionals enableSystemd [ - systemd - ] - ++ lib.optionals enableDaemon [ - polkit - ]; + buildInputs = [ + argyllcms + bash-completion + dbus + glib + gusb + lcms2 + libgudev + sane-backends + sqlite + udev + ] + ++ lib.optionals enableSystemd [ + systemd + ] + ++ lib.optionals enableDaemon [ + polkit + ]; doInstallCheck = true; diff --git a/pkgs/by-name/co/composefs/package.nix b/pkgs/by-name/co/composefs/package.nix index ac51d2fd5086..add95896414a 100644 --- a/pkgs/by-name/co/composefs/package.nix +++ b/pkgs/by-name/co/composefs/package.nix @@ -59,25 +59,25 @@ stdenv.mkDerivation (finalAttrs: { go-md2man pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optional fuseSupport fuse3 - ++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) ([ - libcap - ]); + buildInputs = [ + openssl + ] + ++ lib.optional fuseSupport fuse3 + ++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) ([ + libcap + ]); doCheck = true; - nativeCheckInputs = - [ - python3 - which - ] - ++ lib.optional enableValgrindCheck valgrind - ++ lib.optional fuseSupport fuse3 - ++ lib.filter (lib.meta.availableOn stdenv.buildPlatform) [ - erofs-utils - fsverity-utils - ]; + nativeCheckInputs = [ + python3 + which + ] + ++ lib.optional enableValgrindCheck valgrind + ++ lib.optional fuseSupport fuse3 + ++ lib.filter (lib.meta.availableOn stdenv.buildPlatform) [ + erofs-utils + fsverity-utils + ]; mesonCheckFlags = lib.optionals enableValgrindCheck "--setup=valgrind"; diff --git a/pkgs/by-name/co/conan/package.nix b/pkgs/by-name/co/conan/package.nix index 54a8359b177d..537e8e76ce2a 100644 --- a/pkgs/by-name/co/conan/package.nix +++ b/pkgs/by-name/co/conan/package.nix @@ -54,21 +54,20 @@ python3Packages.buildPythonApplication rec { "distro" ]; - nativeCheckInputs = - [ - git - pkg-config - zlib - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ xcbuild.xcrun ] - ++ (with python3Packages; [ - mock - parameterized - pytest-xdist - pytestCheckHook - webtest - cmake - ]); + nativeCheckInputs = [ + git + pkg-config + zlib + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ xcbuild.xcrun ] + ++ (with python3Packages; [ + mock + parameterized + pytest-xdist + pytestCheckHook + webtest + cmake + ]); dontUseCmakeConfigure = true; @@ -76,29 +75,28 @@ python3Packages.buildPythonApplication rec { pythonImportsCheck = [ "conan" ]; - disabledTests = - [ - # Tests require network access - "TestFTP" - # Unstable test - "test_shared_windows_find_libraries" - # 'cmake' tool version 'Any' is not available - "test_build" - # 'cmake' tool version '3.27' is not available - "test_metabuild" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Rejects paths containing nix - "test_conditional_os" - # Requires Apple Clang - "test_detect_default_compilers" - "test_detect_default_in_mac_os_using_gcc_as_default" - # Incompatible with darwin.xattr and xcbuild from nixpkgs - "test_dot_files" - "test_xcrun" - "test_xcrun_in_required_by_tool_requires" - "test_xcrun_in_tool_requires" - ]; + disabledTests = [ + # Tests require network access + "TestFTP" + # Unstable test + "test_shared_windows_find_libraries" + # 'cmake' tool version 'Any' is not available + "test_build" + # 'cmake' tool version '3.27' is not available + "test_metabuild" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Rejects paths containing nix + "test_conditional_os" + # Requires Apple Clang + "test_detect_default_compilers" + "test_detect_default_in_mac_os_using_gcc_as_default" + # Incompatible with darwin.xattr and xcbuild from nixpkgs + "test_dot_files" + "test_xcrun" + "test_xcrun_in_required_by_tool_requires" + "test_xcrun_in_tool_requires" + ]; disabledTestPaths = [ # Requires cmake, meson, autotools, apt-get, etc. diff --git a/pkgs/by-name/co/conduktor-ctl/package.nix b/pkgs/by-name/co/conduktor-ctl/package.nix index c79ad89eb0ac..8b6a244e900c 100644 --- a/pkgs/by-name/co/conduktor-ctl/package.nix +++ b/pkgs/by-name/co/conduktor-ctl/package.nix @@ -27,16 +27,15 @@ buildGoModule rec { go test ./... ''; - postInstall = - '' - mv $out/bin/ctl $out/bin/conduktor - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd conduktor \ - --bash <($out/bin/conduktor completion bash) \ - --fish <($out/bin/conduktor completion fish) \ - --zsh <($out/bin/conduktor completion zsh) - ''; + postInstall = '' + mv $out/bin/ctl $out/bin/conduktor + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd conduktor \ + --bash <($out/bin/conduktor completion bash) \ + --fish <($out/bin/conduktor completion fish) \ + --zsh <($out/bin/conduktor completion zsh) + ''; doInstallCheck = true; diff --git a/pkgs/by-name/co/conduwuit/package.nix b/pkgs/by-name/co/conduwuit/package.nix index 15ebfc2e3649..9a2ced086343 100644 --- a/pkgs/by-name/co/conduwuit/package.nix +++ b/pkgs/by-name/co/conduwuit/package.nix @@ -46,13 +46,12 @@ rustPlatform.buildRustPackage rec { rustPlatform.bindgenHook ]; - buildInputs = - [ - bzip2 - zstd - ] - ++ lib.optional enableJemalloc rust-jemalloc-sys' - ++ lib.optional enableLiburing liburing; + buildInputs = [ + bzip2 + zstd + ] + ++ lib.optional enableJemalloc rust-jemalloc-sys' + ++ lib.optional enableLiburing liburing; env = { ZSTD_SYS_USE_PKG_CONFIG = true; @@ -65,18 +64,17 @@ rustPlatform.buildRustPackage rec { # for available features. # We enable all default features except jemalloc and io_uring, which # we guard behind our own (default-enabled) flags. - buildFeatures = - [ - "brotli_compression" - "element_hacks" - "gzip_compression" - "release_max_log_level" - "sentry_telemetry" - "systemd" - "zstd_compression" - ] - ++ lib.optional enableJemalloc "jemalloc" - ++ lib.optional enableLiburing "io_uring"; + buildFeatures = [ + "brotli_compression" + "element_hacks" + "gzip_compression" + "release_max_log_level" + "sentry_telemetry" + "systemd" + "zstd_compression" + ] + ++ lib.optional enableJemalloc "jemalloc" + ++ lib.optional enableLiburing "io_uring"; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/co/conglomerate/package.nix b/pkgs/by-name/co/conglomerate/package.nix index c3193a90009a..5c4fc39a8ddc 100644 --- a/pkgs/by-name/co/conglomerate/package.nix +++ b/pkgs/by-name/co/conglomerate/package.nix @@ -32,16 +32,15 @@ stdenv.mkDerivation { zlib bicpl ]; - propagatedBuildInputs = - [ - coreutils - minc_tools - ] - ++ (with perlPackages; [ - perl - GetoptTabular - MNI-Perllib - ]); + propagatedBuildInputs = [ + coreutils + minc_tools + ] + ++ (with perlPackages; [ + perl + GetoptTabular + MNI-Perllib + ]); cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" diff --git a/pkgs/by-name/co/conmon/package.nix b/pkgs/by-name/co/conmon/package.nix index 52ad5403811f..5cdf2d780249 100644 --- a/pkgs/by-name/co/conmon/package.nix +++ b/pkgs/by-name/co/conmon/package.nix @@ -22,16 +22,15 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - glib - libseccomp - systemd - ] - ++ lib.optionals (!stdenv.hostPlatform.isMusl) [ - glibc - glibc.static - ]; + buildInputs = [ + glib + libseccomp + systemd + ] + ++ lib.optionals (!stdenv.hostPlatform.isMusl) [ + glibc + glibc.static + ]; # manpage requires building the vendored go-md2man makeFlags = [ diff --git a/pkgs/by-name/co/connectome-workbench/package.nix b/pkgs/by-name/co/connectome-workbench/package.nix index 6634f29839a2..0f3ed3d244cf 100644 --- a/pkgs/by-name/co/connectome-workbench/package.nix +++ b/pkgs/by-name/co/connectome-workbench/package.nix @@ -48,14 +48,13 @@ stdenv.mkDerivation (finalAttrs: { libsForQt5.wrapQtAppsHook ]; - buildInputs = - [ - libGL - libGLU - ] - ++ (with libsForQt5; [ - qtbase - ]); + buildInputs = [ + libGL + libGLU + ] + ++ (with libsForQt5; [ + qtbase + ]); # note: we should be able to unvendor a few libs (ftgl, quazip, qwt) but they aren't detected properly meta = { diff --git a/pkgs/by-name/co/connman/package.nix b/pkgs/by-name/co/connman/package.nix index 1995a54fa143..7990bf6dbef3 100644 --- a/pkgs/by-name/co/connman/package.nix +++ b/pkgs/by-name/co/connman/package.nix @@ -79,26 +79,25 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-ElfOvjJ+eQC34rhMD7MwqpCBXkVYmM0vlB9DCO0r47w="; }; - patches = - [ - (fetchpatch { - name = "CVE-2025-32366.patch"; - url = "https://git.kernel.org/pub/scm/network/connman/connman.git/patch/?id=8d3be0285f1d4667bfe85dba555c663eb3d704b4"; - hash = "sha256-kPb4pZVWvnvTUcpc4wRc8x/pMUTXGIywj3w8IYKRTBs="; - }) - (fetchpatch { - name = "CVE-2025-32743.patch"; - url = "https://git.kernel.org/pub/scm/network/connman/connman.git/patch/?id=d90b911f6760959bdf1393c39fe8d1118315490f"; - hash = "sha256-odkjYC/iM6dTIJx2WM/KKotXdTtgv8NMFNJMzx5+YU4="; - }) - ] - ++ optionals stdenv.hostPlatform.isMusl [ - # Fix Musl build by avoiding a Glibc-only API. - (fetchurl { - url = "https://git.alpinelinux.org/aports/plain/community/connman/libresolv.patch?id=e393ea84386878cbde3cccadd36a30396e357d1e"; - hash = "sha256-7Q1bp8rD/gGVYUqnIXqjr9vypR8jlC926p3KYWl9kLw="; - }) - ]; + patches = [ + (fetchpatch { + name = "CVE-2025-32366.patch"; + url = "https://git.kernel.org/pub/scm/network/connman/connman.git/patch/?id=8d3be0285f1d4667bfe85dba555c663eb3d704b4"; + hash = "sha256-kPb4pZVWvnvTUcpc4wRc8x/pMUTXGIywj3w8IYKRTBs="; + }) + (fetchpatch { + name = "CVE-2025-32743.patch"; + url = "https://git.kernel.org/pub/scm/network/connman/connman.git/patch/?id=d90b911f6760959bdf1393c39fe8d1118315490f"; + hash = "sha256-odkjYC/iM6dTIJx2WM/KKotXdTtgv8NMFNJMzx5+YU4="; + }) + ] + ++ optionals stdenv.hostPlatform.isMusl [ + # Fix Musl build by avoiding a Glibc-only API. + (fetchurl { + url = "https://git.alpinelinux.org/aports/plain/community/connman/libresolv.patch?id=e393ea84386878cbde3cccadd36a30396e357d1e"; + hash = "sha256-7Q1bp8rD/gGVYUqnIXqjr9vypR8jlC926p3KYWl9kLw="; + }) + ]; nativeBuildInputs = [ autoreconfHook @@ -106,85 +105,83 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - glib - dbus - libmnl - gnutls - readline - ] - ++ optionals (firewallType == "iptables") [ iptables ] - ++ optionals (firewallType == "nftables") [ libnftnl ] - ++ optionals (enableOpenconnect) [ openconnect ] - ++ optionals (enablePolkit) [ polkit ] - ++ optionals (enablePptp) [ - pptp - ppp - ]; + buildInputs = [ + glib + dbus + libmnl + gnutls + readline + ] + ++ optionals (firewallType == "iptables") [ iptables ] + ++ optionals (firewallType == "nftables") [ libnftnl ] + ++ optionals (enableOpenconnect) [ openconnect ] + ++ optionals (enablePolkit) [ polkit ] + ++ optionals (enablePptp) [ + pptp + ppp + ]; postPatch = '' sed -i "s@/usr/bin/file@file@g" ./configure ''; - configureFlags = - [ - # directories flags - "--sysconfdir=/etc" - "--localstatedir=/var" - ] - ++ [ - # production build flags - (enableFeature false "maintainer-mode") - (enableFeatureAs true "session-policy-local" "builtin") - # for building and running tests - # (enableFeature true "tests") # installs the tests, we don't want that - (enableFeature true "tools") - (enableFeature enableLoopback "loopback") - (enableFeature enableEthernet "ethernet") - (enableFeature enableWireguard "wireguard") - (enableFeature enableGadget "gadget") - (enableFeature enableWifi "wifi") - # enable IWD support for wifi as it doesn't require any new dependencies and - # it's easier for the NixOS module to use only one connman package when IWD - # is requested - (enableFeature enableWifi "iwd") - (enableFeature enableBluetooth "bluetooth") - (enableFeature enableOfono "ofono") - (enableFeature enableDundee "dundee") - (enableFeature enablePacrunner "pacrunner") - (enableFeature enableNeard "neard") - (enableFeature enableWispr "wispr") - (enableFeature enableTools "tools") - (enableFeature enableStats "stats") - (enableFeature enableClient "client") - (enableFeature enableDatafiles "datafiles") - (enableFeature enablePolkit "polkit") - (enableFeature enablePptp "pptp") - (enableFeature enableWireguard "wireguard") - (enableFeature enableNetworkManagerCompatibility "nmcompat") - (enableFeature enableHh2serialGps "hh2serial-gps") - (enableFeature enableL2tp "l2tp") - (enableFeature enableIospm "iospm") - (enableFeature enableTist "tist") - ] - ++ [ - (enableFeatureAs enableOpenconnect "openconnect" "builtin") - (enableFeatureAs enableOpenvpn "openvpn" "builtin") - (enableFeatureAs enableVpnc "vpnc" "builtin") - ] - ++ [ - (withFeatureAs true "dbusconfdir" "${placeholder "out"}/share") - (withFeatureAs true "dbusdatadir" "${placeholder "out"}/share") - (withFeatureAs true "tmpfilesdir" "${placeholder "out"}/tmpfiles.d") - (withFeatureAs true "systemdunitdir" "${placeholder "out"}/systemd/system") - (withFeatureAs true "dns-backend" "${dnsType}") - (withFeatureAs true "firewall" "${firewallType}") - (withFeatureAs enableOpenconnect "openconnect" "${openconnect}/sbin/openconnect") - (withFeatureAs enableOpenvpn "openvpn" "${openvpn}/sbin/openvpn") - (withFeatureAs enableVpnc "vpnc" "${vpnc}/sbin/vpnc") - (withFeatureAs enablePptp "pptp" "${pptp}/sbin/pptp") - ]; + configureFlags = [ + # directories flags + "--sysconfdir=/etc" + "--localstatedir=/var" + ] + ++ [ + # production build flags + (enableFeature false "maintainer-mode") + (enableFeatureAs true "session-policy-local" "builtin") + # for building and running tests + # (enableFeature true "tests") # installs the tests, we don't want that + (enableFeature true "tools") + (enableFeature enableLoopback "loopback") + (enableFeature enableEthernet "ethernet") + (enableFeature enableWireguard "wireguard") + (enableFeature enableGadget "gadget") + (enableFeature enableWifi "wifi") + # enable IWD support for wifi as it doesn't require any new dependencies and + # it's easier for the NixOS module to use only one connman package when IWD + # is requested + (enableFeature enableWifi "iwd") + (enableFeature enableBluetooth "bluetooth") + (enableFeature enableOfono "ofono") + (enableFeature enableDundee "dundee") + (enableFeature enablePacrunner "pacrunner") + (enableFeature enableNeard "neard") + (enableFeature enableWispr "wispr") + (enableFeature enableTools "tools") + (enableFeature enableStats "stats") + (enableFeature enableClient "client") + (enableFeature enableDatafiles "datafiles") + (enableFeature enablePolkit "polkit") + (enableFeature enablePptp "pptp") + (enableFeature enableWireguard "wireguard") + (enableFeature enableNetworkManagerCompatibility "nmcompat") + (enableFeature enableHh2serialGps "hh2serial-gps") + (enableFeature enableL2tp "l2tp") + (enableFeature enableIospm "iospm") + (enableFeature enableTist "tist") + ] + ++ [ + (enableFeatureAs enableOpenconnect "openconnect" "builtin") + (enableFeatureAs enableOpenvpn "openvpn" "builtin") + (enableFeatureAs enableVpnc "vpnc" "builtin") + ] + ++ [ + (withFeatureAs true "dbusconfdir" "${placeholder "out"}/share") + (withFeatureAs true "dbusdatadir" "${placeholder "out"}/share") + (withFeatureAs true "tmpfilesdir" "${placeholder "out"}/tmpfiles.d") + (withFeatureAs true "systemdunitdir" "${placeholder "out"}/systemd/system") + (withFeatureAs true "dns-backend" "${dnsType}") + (withFeatureAs true "firewall" "${firewallType}") + (withFeatureAs enableOpenconnect "openconnect" "${openconnect}/sbin/openconnect") + (withFeatureAs enableOpenvpn "openvpn" "${openvpn}/sbin/openvpn") + (withFeatureAs enableVpnc "vpnc" "${vpnc}/sbin/vpnc") + (withFeatureAs enablePptp "pptp" "${pptp}/sbin/pptp") + ]; doCheck = true; diff --git a/pkgs/by-name/co/conntrack-tools/package.nix b/pkgs/by-name/co/conntrack-tools/package.nix index 09b3f4c5825f..e641c0fecdcd 100644 --- a/pkgs/by-name/co/conntrack-tools/package.nix +++ b/pkgs/by-name/co/conntrack-tools/package.nix @@ -25,19 +25,18 @@ stdenv.mkDerivation rec { hash = "sha256-BnZ39MX2VkgZ547TqdSomAk16pJz86uyKkIOowq13tY="; }; - buildInputs = - [ - libmnl - libnfnetlink - libnetfilter_conntrack - libnetfilter_queue - libnetfilter_cttimeout - libnetfilter_cthelper - libtirpc - ] - ++ lib.optionals systemdSupport [ - systemd - ]; + buildInputs = [ + libmnl + libnfnetlink + libnetfilter_conntrack + libnetfilter_queue + libnetfilter_cttimeout + libnetfilter_cthelper + libtirpc + ] + ++ lib.optionals systemdSupport [ + systemd + ]; nativeBuildInputs = [ flex bison diff --git a/pkgs/by-name/co/conserver/package.nix b/pkgs/by-name/co/conserver/package.nix index cb741ecc4590..d522c939b74e 100644 --- a/pkgs/by-name/co/conserver/package.nix +++ b/pkgs/by-name/co/conserver/package.nix @@ -38,23 +38,23 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ libxcrypt ] - ++ lib.optionals freeipmiSupport [ freeipmi ] - ++ lib.optionals gssapiSupport [ libkrb5 ] - ++ lib.optionals opensslSupport [ openssl ]; + buildInputs = [ + libxcrypt + ] + ++ lib.optionals freeipmiSupport [ freeipmi ] + ++ lib.optionals gssapiSupport [ libkrb5 ] + ++ lib.optionals opensslSupport [ openssl ]; - configureFlags = - [ - "--with-ccffile=/dev/null" - "--with-cffile=/dev/null" - ] - ++ lib.optionals freeipmiSupport [ "--with-freeipmi=${freeipmi}/include" ] - ++ lib.optionals gssapiSupport [ "--with-gssapi=${libkrb5.dev}/include" ] - ++ lib.optionals ipv6Support [ "--with-ipv6" ] - ++ lib.optionals opensslSupport [ "--with-openssl=${openssl.dev}/include" ] - ++ lib.optionals trustUdsCredSupport [ "--with-trust-uds-cred" ] - ++ lib.optionals udsSupport [ "--with-uds" ]; + configureFlags = [ + "--with-ccffile=/dev/null" + "--with-cffile=/dev/null" + ] + ++ lib.optionals freeipmiSupport [ "--with-freeipmi=${freeipmi}/include" ] + ++ lib.optionals gssapiSupport [ "--with-gssapi=${libkrb5.dev}/include" ] + ++ lib.optionals ipv6Support [ "--with-ipv6" ] + ++ lib.optionals opensslSupport [ "--with-openssl=${openssl.dev}/include" ] + ++ lib.optionals trustUdsCredSupport [ "--with-trust-uds-cred" ] + ++ lib.optionals udsSupport [ "--with-uds" ]; # Disabled due to exist upstream cases failing 8/15 tests doCheck = false; diff --git a/pkgs/by-name/co/containerd/package.nix b/pkgs/by-name/co/containerd/package.nix index 355d3ce4241f..cac2dfd530a7 100644 --- a/pkgs/by-name/co/containerd/package.nix +++ b/pkgs/by-name/co/containerd/package.nix @@ -21,7 +21,8 @@ buildGoModule rec { outputs = [ "out" "doc" - ] ++ lib.optional withMan "man"; + ] + ++ lib.optional withMan "man"; src = fetchFromGitHub { owner = "containerd"; @@ -38,7 +39,8 @@ buildGoModule rec { nativeBuildInputs = [ util-linux - ] ++ lib.optional withMan go-md2man; + ] + ++ lib.optional withMan go-md2man; buildInputs = lib.optional btrfsSupport btrfs-progs; @@ -55,7 +57,8 @@ buildGoModule rec { installTargets = [ "install" "install-doc" - ] ++ lib.optional withMan "install-man"; + ] + ++ lib.optional withMan "install-man"; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/co/contour/package.nix b/pkgs/by-name/co/contour/package.nix index 5346ab80d3ff..67282ea8a1aa 100644 --- a/pkgs/by-name/co/contour/package.nix +++ b/pkgs/by-name/co/contour/package.nix @@ -52,50 +52,49 @@ stdenv.mkDerivation (finalAttrs: { file qt6.wrapQtAppsHook installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ]; - buildInputs = - [ - boxed-cpp - fontconfig - freetype - libunicode - termbench-pro - qt6.qtmultimedia - qt6.qt5compat - pcre - boost - catch2_3 - fmt - microsoft-gsl - range-v3 - yaml-cpp - reflection-cpp - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ libutempter ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libutil - ]; + buildInputs = [ + boxed-cpp + fontconfig + freetype + libunicode + termbench-pro + qt6.qtmultimedia + qt6.qt5compat + pcre + boost + catch2_3 + fmt + microsoft-gsl + range-v3 + yaml-cpp + reflection-cpp + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libutempter ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libutil + ]; cmakeFlags = [ "-DCONTOUR_QT_VERSION=6" ]; - postInstall = - '' - mkdir -p $out/nix-support $terminfo/share - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir $out/Applications - cp -r $out/contour.app/Contents/Resources/terminfo $terminfo/share - mv $out/contour.app $out/Applications - ln -s $out/bin $out/Applications/contour.app/Contents/MacOS - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mv $out/share/terminfo $terminfo/share/ - '' - + '' - echo "$terminfo" >> $out/nix-support/propagated-user-env-packages - rm -r $out/share/contour - ''; + postInstall = '' + mkdir -p $out/nix-support $terminfo/share + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir $out/Applications + cp -r $out/contour.app/Contents/Resources/terminfo $terminfo/share + mv $out/contour.app $out/Applications + ln -s $out/bin $out/Applications/contour.app/Contents/MacOS + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mv $out/share/terminfo $terminfo/share/ + '' + + '' + echo "$terminfo" >> $out/nix-support/propagated-user-env-packages + rm -r $out/share/contour + ''; passthru.tests.test = nixosTests.terminal-emulators.contour; diff --git a/pkgs/by-name/co/convco/package.nix b/pkgs/by-name/co/convco/package.nix index 81ca074ff9cb..166158157abb 100644 --- a/pkgs/by-name/co/convco/package.nix +++ b/pkgs/by-name/co/convco/package.nix @@ -28,11 +28,12 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; checkFlags = [ # disable test requiring networking diff --git a/pkgs/by-name/co/convos/package.nix b/pkgs/by-name/co/convos/package.nix index f71868f38886..d9ccbff23519 100644 --- a/pkgs/by-name/co/convos/package.nix +++ b/pkgs/by-name/co/convos/package.nix @@ -23,7 +23,8 @@ perlPackages.buildPerlPackage rec { nativeBuildInputs = [ makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ shortenPerlShebang ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ shortenPerlShebang ]; buildInputs = with perlPackages; [ CryptPassphrase @@ -99,21 +100,20 @@ perlPackages.buildPerlPackage rec { # Convos expects to find assets in both auto/share/dist/Convos, and $MOJO_HOME # which is set to $out # - postInstall = - '' - AUTO_SHARE_PATH=$out/${perl.libPrefix}/auto/share/dist/Convos - mkdir -p $AUTO_SHARE_PATH - cp -vR public assets $AUTO_SHARE_PATH/ - ln -s $AUTO_SHARE_PATH/public/assets $out/assets - cp -vR templates $out/templates - cp Makefile.PL $out/Makefile.PL - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/convos - '' - + '' - wrapProgram $out/bin/convos --set MOJO_HOME $out - ''; + postInstall = '' + AUTO_SHARE_PATH=$out/${perl.libPrefix}/auto/share/dist/Convos + mkdir -p $AUTO_SHARE_PATH + cp -vR public assets $AUTO_SHARE_PATH/ + ln -s $AUTO_SHARE_PATH/public/assets $out/assets + cp -vR templates $out/templates + cp Makefile.PL $out/Makefile.PL + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + shortenPerlShebang $out/bin/convos + '' + + '' + wrapProgram $out/bin/convos --set MOJO_HOME $out + ''; passthru.tests = nixosTests.convos; diff --git a/pkgs/by-name/co/coost/package.nix b/pkgs/by-name/co/coost/package.nix index 9b07ee0aca15..e3ccf660a240 100644 --- a/pkgs/by-name/co/coost/package.nix +++ b/pkgs/by-name/co/coost/package.nix @@ -30,12 +30,11 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; buildInputs = lib.optional withCurl curl ++ lib.optional withOpenSSL openssl; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=ON" - ] - ++ lib.optional withCurl "-DWITH_LIBCURL=ON" - ++ lib.optional withOpenSSL "-DWITH_OPENSSL=ON"; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + ] + ++ lib.optional withCurl "-DWITH_LIBCURL=ON" + ++ lib.optional withOpenSSL "-DWITH_OPENSSL=ON"; outputs = [ "out" diff --git a/pkgs/by-name/co/copacetic/package.nix b/pkgs/by-name/co/copacetic/package.nix index 1ac52077c77d..c8b434f33a35 100644 --- a/pkgs/by-name/co/copacetic/package.nix +++ b/pkgs/by-name/co/copacetic/package.nix @@ -45,16 +45,15 @@ buildGoModule rec { doInstallCheck = true; versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}"; - postInstall = - '' - mv $out/bin/copacetic $out/bin/copa - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd copa \ - --bash <($out/bin/copa completion bash) \ - --fish <($out/bin/copa completion fish) \ - --zsh <($out/bin/copa completion zsh) - ''; + postInstall = '' + mv $out/bin/copacetic $out/bin/copa + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd copa \ + --bash <($out/bin/copa completion bash) \ + --fish <($out/bin/copa completion fish) \ + --zsh <($out/bin/copa completion zsh) + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/co/coredns/package.nix b/pkgs/by-name/co/coredns/package.nix index 9ec093cf4084..57a01b6aa50b 100644 --- a/pkgs/by-name/co/coredns/package.nix +++ b/pkgs/by-name/co/coredns/package.nix @@ -92,29 +92,28 @@ buildGoModule (finalAttrs: { GOOS= GOARCH= go generate ''; - postPatch = - '' - substituteInPlace test/file_cname_proxy_test.go \ - --replace-fail \ - "TestZoneExternalCNAMELookupWithProxy" \ - "SkipZoneExternalCNAMELookupWithProxy" + postPatch = '' + substituteInPlace test/file_cname_proxy_test.go \ + --replace-fail \ + "TestZoneExternalCNAMELookupWithProxy" \ + "SkipZoneExternalCNAMELookupWithProxy" - substituteInPlace test/readme_test.go \ - --replace-fail "TestReadme" "SkipReadme" + substituteInPlace test/readme_test.go \ + --replace-fail "TestReadme" "SkipReadme" - # this test fails if any external plugins were imported. - # it's a lint rather than a test of functionality, so it's safe to disable. - substituteInPlace test/presubmit_test.go \ - --replace-fail "TestImportOrdering" "SkipImportOrdering" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # loopback interface is lo0 on macos - sed -E -i 's/\blo\b/lo0/' plugin/bind/setup_test.go + # this test fails if any external plugins were imported. + # it's a lint rather than a test of functionality, so it's safe to disable. + substituteInPlace test/presubmit_test.go \ + --replace-fail "TestImportOrdering" "SkipImportOrdering" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # loopback interface is lo0 on macos + sed -E -i 's/\blo\b/lo0/' plugin/bind/setup_test.go - # test is apparently outdated but only exhibits this on darwin - substituteInPlace test/corefile_test.go \ - --replace-fail "TestCorefile1" "SkipCorefile1" - ''; + # test is apparently outdated but only exhibits this on darwin + substituteInPlace test/corefile_test.go \ + --replace-fail "TestCorefile1" "SkipCorefile1" + ''; __darwinAllowLocalNetworking = true; diff --git a/pkgs/by-name/co/corosync/package.nix b/pkgs/by-name/co/corosync/package.nix index b3bf4bd5c463..6225fa443c8e 100644 --- a/pkgs/by-name/co/corosync/package.nix +++ b/pkgs/by-name/co/corosync/package.nix @@ -37,33 +37,31 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - kronosnet - nss - nspr - libqb - systemd.dev - ] - ++ optional enableDbus dbus - ++ optional enableInfiniBandRdma rdma-core - ++ optional enableMonitoring libstatgrab - ++ optional enableSnmp net-snmp; + buildInputs = [ + kronosnet + nss + nspr + libqb + systemd.dev + ] + ++ optional enableDbus dbus + ++ optional enableInfiniBandRdma rdma-core + ++ optional enableMonitoring libstatgrab + ++ optional enableSnmp net-snmp; - configureFlags = - [ - "--sysconfdir=/etc" - "--localstatedir=/var" - "--with-logdir=/var/log/corosync" - "--enable-watchdog" - "--enable-qdevices" - # allows Type=notify in the systemd service - "--enable-systemd" - ] - ++ optional enableDbus "--enable-dbus" - ++ optional enableInfiniBandRdma "--enable-rdma" - ++ optional enableMonitoring "--enable-monitoring" - ++ optional enableSnmp "--enable-snmp"; + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + "--with-logdir=/var/log/corosync" + "--enable-watchdog" + "--enable-qdevices" + # allows Type=notify in the systemd service + "--enable-systemd" + ] + ++ optional enableDbus "--enable-dbus" + ++ optional enableInfiniBandRdma "--enable-rdma" + ++ optional enableMonitoring "--enable-monitoring" + ++ optional enableSnmp "--enable-snmp"; installFlags = [ "sysconfdir=$(out)/etc" diff --git a/pkgs/by-name/co/corrscope/package.nix b/pkgs/by-name/co/corrscope/package.nix index 5c2d087fa2a3..0750edccfc6c 100644 --- a/pkgs/by-name/co/corrscope/package.nix +++ b/pkgs/by-name/co/corrscope/package.nix @@ -29,19 +29,18 @@ python3Packages.buildPythonApplication rec { hatchling ]; - buildInputs = + buildInputs = [ + ffmpeg + ] + ++ ( + with qt6Packages; [ - ffmpeg + qtbase ] - ++ ( - with qt6Packages; - [ - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ] - ); + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ] + ); dependencies = ( with python3Packages; diff --git a/pkgs/by-name/co/corteza/package.nix b/pkgs/by-name/co/corteza/package.nix index 612a3769b835..072f8d9b14fb 100644 --- a/pkgs/by-name/co/corteza/package.nix +++ b/pkgs/by-name/co/corteza/package.nix @@ -111,14 +111,13 @@ let # already vendored vendorHash = null; - preBuild = - '' - cp -r ../locale/en pkg/locale/src/ - cp -r ${server-webconsole}/* webconsole/dist/ - '' - + lib.optionalString withLocales '' - cp -r ${corteza-locale}/src/* pkg/locale/src/ - ''; + preBuild = '' + cp -r ../locale/en pkg/locale/src/ + cp -r ${server-webconsole}/* webconsole/dist/ + '' + + lib.optionalString withLocales '' + cp -r ${corteza-locale}/src/* pkg/locale/src/ + ''; subPackages = [ "cmd/corteza" ]; diff --git a/pkgs/by-name/co/cosmic-comp/package.nix b/pkgs/by-name/co/cosmic-comp/package.nix index 6cb3d5b49d3a..b9c9f2d7c85b 100644 --- a/pkgs/by-name/co/cosmic-comp/package.nix +++ b/pkgs/by-name/co/cosmic-comp/package.nix @@ -47,7 +47,8 @@ rustPlatform.buildRustPackage (finalAttrs: { pixman seatd udev - ] ++ lib.optional useSystemd systemd; + ] + ++ lib.optional useSystemd systemd; # Only default feature is systemd buildNoDefaultFeatures = !useSystemd; diff --git a/pkgs/by-name/co/coturn/package.nix b/pkgs/by-name/co/coturn/package.nix index 8752afe1c2a2..d58e76e8f3ba 100644 --- a/pkgs/by-name/co/coturn/package.nix +++ b/pkgs/by-name/co/coturn/package.nix @@ -27,17 +27,16 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - openssl - (libevent.override { inherit openssl; }) - libprom - libmicrohttpd - sqlite.dev - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform systemdMinimal) [ - systemdMinimal - ]; + buildInputs = [ + openssl + (libevent.override { inherit openssl; }) + libprom + libmicrohttpd + sqlite.dev + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform systemdMinimal) [ + systemdMinimal + ]; patches = [ ./pure-configure.patch diff --git a/pkgs/by-name/co/cozy/package.nix b/pkgs/by-name/co/cozy/package.nix index d0182f75792a..ff77b3ab05b2 100644 --- a/pkgs/by-name/co/cozy/package.nix +++ b/pkgs/by-name/co/cozy/package.nix @@ -43,17 +43,16 @@ python3Packages.buildPythonApplication rec { gobject-introspection ]; - buildInputs = - [ - libadwaita - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-good - gst-plugins-ugly - gst-plugins-base - gst-plugins-bad - ]); + buildInputs = [ + libadwaita + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-good + gst-plugins-ugly + gst-plugins-base + gst-plugins-bad + ]); propagatedBuildInputs = with python3Packages; [ distro diff --git a/pkgs/by-name/cp/cp2k/package.nix b/pkgs/by-name/cp/cp2k/package.nix index 64673800373e..535d0adbf6d6 100644 --- a/pkgs/by-name/cp/cp2k/package.nix +++ b/pkgs/by-name/cp/cp2k/package.nix @@ -84,47 +84,47 @@ stdenv.mkDerivation rec { which makeWrapper pkg-config - ] ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc; + ] + ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc; - buildInputs = - [ - gfortran - fftw - gsl - libint - libvori - libxc - dftd4 - mctc-lib - mstore - multicharge - libxsmm - mpi - spglib - scalapack - blas - lapack - plumed - zlib - hdf5-fortran - sirius - spla - spfft - libvdwxc - ] - ++ lib.optional enableElpa elpa - ++ lib.optionals (gpuBackend == "cuda") [ - cudaPackages.cuda_cudart - cudaPackages.libcublas - cudaPackages.cuda_nvrtc - ] - ++ lib.optionals (gpuBackend == "rocm") [ - rocmPackages.clr - rocmPackages.rocm-core - rocmPackages.hipblas - rocmPackages.hipfft - rocmPackages.rocblas - ]; + buildInputs = [ + gfortran + fftw + gsl + libint + libvori + libxc + dftd4 + mctc-lib + mstore + multicharge + libxsmm + mpi + spglib + scalapack + blas + lapack + plumed + zlib + hdf5-fortran + sirius + spla + spfft + libvdwxc + ] + ++ lib.optional enableElpa elpa + ++ lib.optionals (gpuBackend == "cuda") [ + cudaPackages.cuda_cudart + cudaPackages.libcublas + cudaPackages.cuda_nvrtc + ] + ++ lib.optionals (gpuBackend == "rocm") [ + rocmPackages.clr + rocmPackages.rocm-core + rocmPackages.hipblas + rocmPackages.hipfft + rocmPackages.rocblas + ]; propagatedBuildInputs = [ (lib.getBin mpi) ]; propagatedUserEnvPkgs = [ mpi ]; diff --git a/pkgs/by-name/cp/cppcheck/package.nix b/pkgs/by-name/cp/cppcheck/package.nix index 265dead86b3a..b7edb7089491 100644 --- a/pkgs/by-name/cp/cppcheck/package.nix +++ b/pkgs/by-name/cp/cppcheck/package.nix @@ -64,25 +64,24 @@ stdenv.mkDerivation (finalAttrs: { doCheck = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64); doInstallCheck = true; - postPatch = - '' - substituteInPlace Makefile \ - --replace-fail 'PCRE_CONFIG = $(shell which pcre-config)' 'PCRE_CONFIG = $(PKG_CONFIG) libpcre' - '' - # Expected: - # Internal Error. MathLib::toDoubleNumber: conversion failed: 1invalid - # - # Actual: - # Internal Error. MathLib::toDoubleNumber: input was not completely consumed: 1invalid - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace test/testmathlib.cpp \ - --replace-fail \ - 'ASSERT_THROW_INTERNAL_EQUALS(MathLib::toDoubleNumber("1invalid"), INTERNAL, "Internal Error. MathLib::toDoubleNumber: conversion failed: 1invalid");' \ - "" \ - --replace-fail \ - 'ASSERT_THROW_INTERNAL_EQUALS(MathLib::toDoubleNumber("1.1invalid"), INTERNAL, "Internal Error. MathLib::toDoubleNumber: conversion failed: 1.1invalid");' \ - "" - ''; + postPatch = '' + substituteInPlace Makefile \ + --replace-fail 'PCRE_CONFIG = $(shell which pcre-config)' 'PCRE_CONFIG = $(PKG_CONFIG) libpcre' + '' + # Expected: + # Internal Error. MathLib::toDoubleNumber: conversion failed: 1invalid + # + # Actual: + # Internal Error. MathLib::toDoubleNumber: input was not completely consumed: 1invalid + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace test/testmathlib.cpp \ + --replace-fail \ + 'ASSERT_THROW_INTERNAL_EQUALS(MathLib::toDoubleNumber("1invalid"), INTERNAL, "Internal Error. MathLib::toDoubleNumber: conversion failed: 1invalid");' \ + "" \ + --replace-fail \ + 'ASSERT_THROW_INTERNAL_EQUALS(MathLib::toDoubleNumber("1.1invalid"), INTERNAL, "Internal Error. MathLib::toDoubleNumber: conversion failed: 1.1invalid");' \ + "" + ''; postBuild = '' make DB2MAN=${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl man diff --git a/pkgs/by-name/cp/cppitertools/package.nix b/pkgs/by-name/cp/cppitertools/package.nix index e484d70c3294..99c363273d52 100644 --- a/pkgs/by-name/cp/cppitertools/package.nix +++ b/pkgs/by-name/cp/cppitertools/package.nix @@ -58,16 +58,15 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-Dcppitertools_INSTALL_CMAKE_DIR=${finalAttrs.cmakeInstallDir}" ]; - prePatch = - '' - # Mark the `.` install target as non-default. - substituteInPlace CMakeLists.txt \ - --replace-fail " DIRECTORY ." " DIRECTORY . EXCLUDE_FROM_ALL" - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - # Required for tests. - cp ${lib.getDev catch2}/include/catch2/catch.hpp test/ - ''; + prePatch = '' + # Mark the `.` install target as non-default. + substituteInPlace CMakeLists.txt \ + --replace-fail " DIRECTORY ." " DIRECTORY . EXCLUDE_FROM_ALL" + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + # Required for tests. + cp ${lib.getDev catch2}/include/catch2/catch.hpp test/ + ''; checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/cr/cri-tools/package.nix b/pkgs/by-name/cr/cri-tools/package.nix index 260bc42cc800..13a301626b67 100644 --- a/pkgs/by-name/cr/cri-tools/package.nix +++ b/pkgs/by-name/cr/cri-tools/package.nix @@ -29,20 +29,19 @@ buildGoModule rec { runHook postBuild ''; - installPhase = - '' - runHook preInstall - make install BINDIR=$out/bin - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - for shell in bash fish zsh; do - installShellCompletion --cmd crictl \ - --$shell <($out/bin/crictl completion $shell) - done - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + make install BINDIR=$out/bin + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for shell in bash fish zsh; do + installShellCompletion --cmd crictl \ + --$shell <($out/bin/crictl completion $shell) + done + '' + + '' + runHook postInstall + ''; meta = with lib; { description = "CLI and validation tools for Kubelet Container Runtime Interface (CRI)"; diff --git a/pkgs/by-name/cr/criu/package.nix b/pkgs/by-name/cr/criu/package.nix index a07fb3169214..848576385f81 100644 --- a/pkgs/by-name/cr/criu/package.nix +++ b/pkgs/by-name/cr/criu/package.nix @@ -65,14 +65,13 @@ stdenv.mkDerivation rec { libbsd libuuid ]; - propagatedBuildInputs = - [ - protobufc - ] - ++ (with python3.pkgs; [ - python - python3.pkgs.protobuf - ]); + propagatedBuildInputs = [ + protobufc + ] + ++ (with python3.pkgs; [ + python + python3.pkgs.protobuf + ]); postPatch = '' substituteInPlace ./Documentation/Makefile \ diff --git a/pkgs/by-name/cr/crocoddyl/package.nix b/pkgs/by-name/cr/crocoddyl/package.nix index 78ddc5abfa55..4962baa7287b 100644 --- a/pkgs/by-name/cr/crocoddyl/package.nix +++ b/pkgs/by-name/cr/crocoddyl/package.nix @@ -32,32 +32,30 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - doxygen - pkg-config - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + cmake + doxygen + pkg-config + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pythonImportsCheckHook + ]; - propagatedBuildInputs = - [ - blas - ipopt - lapack - ] - ++ lib.optionals (!pythonSupport) [ - example-robot-data - pinocchio - ] - ++ lib.optionals pythonSupport [ - python3Packages.example-robot-data - python3Packages.pinocchio - python3Packages.scipy - ]; + propagatedBuildInputs = [ + blas + ipopt + lapack + ] + ++ lib.optionals (!pythonSupport) [ + example-robot-data + pinocchio + ] + ++ lib.optionals pythonSupport [ + python3Packages.example-robot-data + python3Packages.pinocchio + python3Packages.scipy + ]; cmakeFlags = [ (lib.cmakeBool "INSTALL_DOCUMENTATION" true) diff --git a/pkgs/by-name/cr/crow-translate/package.nix b/pkgs/by-name/cr/crow-translate/package.nix index 3b8dc307fa12..be12eb2859f8 100644 --- a/pkgs/by-name/cr/crow-translate/package.nix +++ b/pkgs/by-name/cr/crow-translate/package.nix @@ -37,20 +37,19 @@ stdenv.mkDerivation (finalAttrs: { qt5.wrapQtAppsHook ]; - buildInputs = - [ - libsForQt5.kwayland - leptonica - tesseract4 - qt5.qtmultimedia - qt5.qtx11extras - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ]); + buildInputs = [ + libsForQt5.kwayland + leptonica + tesseract4 + qt5.qtmultimedia + qt5.qtx11extras + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ]); preFixup = '' qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") diff --git a/pkgs/by-name/cr/crusader/package.nix b/pkgs/by-name/cr/crusader/package.nix index 057accbabd86..47f2dd413487 100644 --- a/pkgs/by-name/cr/crusader/package.nix +++ b/pkgs/by-name/cr/crusader/package.nix @@ -37,26 +37,24 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-f0TWiRX203/gNsa9UEr/1Bv+kUxLAK/Zlw+S693xZlE="; # autoPatchelfHook required on linux for crusader-gui - nativeBuildInputs = - [ - makeWrapper - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + makeWrapper + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ]; - buildInputs = - [ - fontconfig - libgcc - libxkbcommon - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - xorg.libX11 - xorg.libXcursor - xorg.libXi - ]; + buildInputs = [ + fontconfig + libgcc + libxkbcommon + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + xorg.libX11 + xorg.libXcursor + xorg.libXi + ]; # required for crusader-gui runtimeDependencies = [ diff --git a/pkgs/by-name/cr/cryfs/package.nix b/pkgs/by-name/cr/cryfs/package.nix index 583852811605..a72838a1b53e 100644 --- a/pkgs/by-name/cr/cryfs/package.nix +++ b/pkgs/by-name/cr/cryfs/package.nix @@ -62,7 +62,8 @@ stdenv.mkDerivation rec { openssl range-v3 spdlog - ] ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; + ] + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; #nativeCheckInputs = [ gtest ]; diff --git a/pkgs/by-name/cr/cryptsetup/package.nix b/pkgs/by-name/cr/cryptsetup/package.nix index 49087c07ec7b..277208c0be3a 100644 --- a/pkgs/by-name/cr/cryptsetup/package.nix +++ b/pkgs/by-name/cr/cryptsetup/package.nix @@ -56,26 +56,25 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s"; - configureFlags = - [ - "--with-crypto_backend=openssl" - "--disable-ssh-token" - "--with-tmpfilesdir=${placeholder "out"}/lib/tmpfiles.d" - ] - ++ lib.optionals (!rebuildMan) [ - "--disable-asciidoc" - ] - ++ lib.optionals (!withInternalArgon2) [ - "--enable-libargon2" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "--disable-external-tokens" - # We have to override this even though we're removing token - # support, because the path still gets included in the binary even - # though it isn't used. - "--with-luks2-external-tokens-path=/" - ] - ++ (lib.mapAttrsToList (lib.flip lib.enableFeature)) programs; + configureFlags = [ + "--with-crypto_backend=openssl" + "--disable-ssh-token" + "--with-tmpfilesdir=${placeholder "out"}/lib/tmpfiles.d" + ] + ++ lib.optionals (!rebuildMan) [ + "--disable-asciidoc" + ] + ++ lib.optionals (!withInternalArgon2) [ + "--enable-libargon2" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "--disable-external-tokens" + # We have to override this even though we're removing token + # support, because the path still gets included in the binary even + # though it isn't used. + "--with-luks2-external-tokens-path=/" + ] + ++ (lib.mapAttrsToList (lib.flip lib.enableFeature)) programs; nativeBuildInputs = [ pkg-config ] ++ lib.optionals rebuildMan [ asciidoctor ]; propagatedBuildInputs = [ @@ -84,7 +83,8 @@ stdenv.mkDerivation rec { openssl libuuid popt - ] ++ lib.optional (!withInternalArgon2) libargon2; + ] + ++ lib.optional (!withInternalArgon2) libargon2; enableParallelBuilding = true; diff --git a/pkgs/by-name/cs/csmith/package.nix b/pkgs/by-name/cs/csmith/package.nix index f14f2644aac5..bdcda4e57885 100644 --- a/pkgs/by-name/cs/csmith/package.nix +++ b/pkgs/by-name/cs/csmith/package.nix @@ -21,12 +21,13 @@ stdenv.mkDerivation rec { m4 makeWrapper ]; - buildInputs = - [ libbsd ] - ++ (with perlPackages; [ - perl - SysCPU - ]); + buildInputs = [ + libbsd + ] + ++ (with perlPackages; [ + perl + SysCPU + ]); CXXFLAGS = "-std=c++98"; diff --git a/pkgs/by-name/cu/cubeb/package.nix b/pkgs/by-name/cu/cubeb/package.nix index 8086302d1e23..a53904ef71a9 100644 --- a/pkgs/by-name/cu/cubeb/package.nix +++ b/pkgs/by-name/cu/cubeb/package.nix @@ -45,14 +45,15 @@ stdenv.mkDerivation (finalAttrs: { validatePkgConfig ]; - buildInputs = - [ speexdsp ] - # In the default configuration these inputs are lazy-loaded. If your package builds a vendored cubeb please make - # sure to include these in the runtime LD path. - ++ lib.optional alsaSupport alsa-lib - ++ lib.optional jackSupport jack2 - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional sndioSupport sndio; + buildInputs = [ + speexdsp + ] + # In the default configuration these inputs are lazy-loaded. If your package builds a vendored cubeb please make + # sure to include these in the runtime LD path. + ++ lib.optional alsaSupport alsa-lib + ++ lib.optional jackSupport jack2 + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional sndioSupport sndio; cmakeFlags = [ (lib.cmakeBool "BUILD_SHARED_LIBS" enableShared) diff --git a/pkgs/by-name/cu/cubicsdr/package.nix b/pkgs/by-name/cu/cubicsdr/package.nix index ab7e8d6ac8aa..7f7a9f0d67e5 100644 --- a/pkgs/by-name/cu/cubicsdr/package.nix +++ b/pkgs/by-name/cu/cubicsdr/package.nix @@ -40,19 +40,18 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - fftw - hamlib - liquid-dsp - soapysdr-with-plugins - wxGTK32 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libpulseaudio - libGL - libX11 - ]; + buildInputs = [ + fftw + hamlib + liquid-dsp + soapysdr-with-plugins + wxGTK32 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libpulseaudio + libGL + libX11 + ]; cmakeFlags = [ "-DUSE_HAMLIB=ON" ] ++ lib.optional enableDigitalLab "-DENABLE_DIGITAL_LAB=ON"; diff --git a/pkgs/by-name/cu/cup-docker/package.nix b/pkgs/by-name/cu/cup-docker/package.nix index db44b6a69986..0a95db2c0810 100644 --- a/pkgs/by-name/cu/cup-docker/package.nix +++ b/pkgs/by-name/cu/cup-docker/package.nix @@ -62,13 +62,12 @@ rustPlatform.buildRustPackage { cargoHash = "sha256-L9zugOwlPwpdtjV87dT1PH7FAMJYHYFuvfyOfPe5b2k="; buildNoDefaultFeatures = true; - buildFeatures = - [ - "cli" - ] - ++ lib.optional withServer [ - "server" - ]; + buildFeatures = [ + "cli" + ] + ++ lib.optional withServer [ + "server" + ]; preConfigure = lib.optionalString withServer '' cp -r ${web}/dist src/static diff --git a/pkgs/by-name/cu/cups-brother-hll2350dw/package.nix b/pkgs/by-name/cu/cups-brother-hll2350dw/package.nix index c793308aa5b1..515370a06f0b 100644 --- a/pkgs/by-name/cu/cups-brother-hll2350dw/package.nix +++ b/pkgs/by-name/cu/cups-brother-hll2350dw/package.nix @@ -49,51 +49,50 @@ stdenv.mkDerivation rec { sha256 = "0b7hhln105agc3rwpi7cjlx5nf4d2yk9iksahdv3725nnd06lg46"; }; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out - dpkg-deb -x $src $out + mkdir -p $out + dpkg-deb -x $src $out - # delete unnecessary files for the current architecture - '' - + lib.concatMapStrings (arch: '' - echo Deleting files for ${arch} - rm -r "$out/opt/brother/Printers/HLL2350DW/lpd/${arch}" - '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) - + '' + # delete unnecessary files for the current architecture + '' + + lib.concatMapStrings (arch: '' + echo Deleting files for ${arch} + rm -r "$out/opt/brother/Printers/HLL2350DW/lpd/${arch}" + '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) + + '' - # bundled scripts don't understand the arch subdirectories for some reason - ln -s \ - "$out/opt/brother/Printers/HLL2350DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ - "$out/opt/brother/Printers/HLL2350DW/lpd/" + # bundled scripts don't understand the arch subdirectories for some reason + ln -s \ + "$out/opt/brother/Printers/HLL2350DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ + "$out/opt/brother/Printers/HLL2350DW/lpd/" - # Fix global references and replace auto discovery mechanism with hardcoded values - substituteInPlace $out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \ - --replace /opt "$out/opt" \ - --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2350DW\"; #" \ - --replace "PRINTER =~" "PRINTER = \"HLL2350DW\"; #" + # Fix global references and replace auto discovery mechanism with hardcoded values + substituteInPlace $out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \ + --replace /opt "$out/opt" \ + --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2350DW\"; #" \ + --replace "PRINTER =~" "PRINTER = \"HLL2350DW\"; #" - # Make sure all executables have the necessary runtime dependencies available - find "$out" -executable -and -type f | while read file; do - wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" - done + # Make sure all executables have the necessary runtime dependencies available + find "$out" -executable -and -type f | while read file; do + wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" + done - # Symlink filter and ppd into a location where CUPS will discover it - mkdir -p $out/lib/cups/filter - mkdir -p $out/share/cups/model + # Symlink filter and ppd into a location where CUPS will discover it + mkdir -p $out/lib/cups/filter + mkdir -p $out/share/cups/model - ln -s \ - $out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \ - $out/lib/cups/filter/brother_lpdwrapper_HLL2350DW + ln -s \ + $out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \ + $out/lib/cups/filter/brother_lpdwrapper_HLL2350DW - ln -s \ - $out/opt/brother/Printers/HLL2350DW/cupswrapper/brother-HLL2350DW-cups-en.ppd \ - $out/share/cups/model/ + ln -s \ + $out/opt/brother/Printers/HLL2350DW/cupswrapper/brother-HLL2350DW-cups-en.ppd \ + $out/share/cups/model/ - runHook postInstall - ''; + runHook postInstall + ''; meta = with lib; { homepage = "http://www.brother.com/"; diff --git a/pkgs/by-name/cu/cups-brother-hll2375dw/package.nix b/pkgs/by-name/cu/cups-brother-hll2375dw/package.nix index 99d1dc12527d..8cfaf540ecba 100644 --- a/pkgs/by-name/cu/cups-brother-hll2375dw/package.nix +++ b/pkgs/by-name/cu/cups-brother-hll2375dw/package.nix @@ -56,51 +56,50 @@ stdenv.mkDerivation rec { ./fix-perm.patch ]; - installPhase = - '' - runHook preInstall - mkdir -p $out - cp -ar opt $out/opt - # delete unnecessary files for the current architecture - '' - + lib.concatMapStrings (arch: '' - echo Deleting files for ${arch} - rm -r "$out/opt/brother/Printers/HLL2375DW/lpd/${arch}" - '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) - + '' - # bundled scripts don't understand the arch subdirectories for some reason - ln -s \ - "$out/opt/brother/Printers/HLL2375DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ - "$out/opt/brother/Printers/HLL2375DW/lpd/" + installPhase = '' + runHook preInstall + mkdir -p $out + cp -ar opt $out/opt + # delete unnecessary files for the current architecture + '' + + lib.concatMapStrings (arch: '' + echo Deleting files for ${arch} + rm -r "$out/opt/brother/Printers/HLL2375DW/lpd/${arch}" + '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) + + '' + # bundled scripts don't understand the arch subdirectories for some reason + ln -s \ + "$out/opt/brother/Printers/HLL2375DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ + "$out/opt/brother/Printers/HLL2375DW/lpd/" - # Fix global references and replace auto discovery mechanism with hardcoded values - substituteInPlace $out/opt/brother/Printers/HLL2375DW/lpd/lpdfilter \ - --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2375DW\"; #" \ - --replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #" - substituteInPlace $out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \ - --replace "my \$basedir = C" "my \$basedir = \"$out/opt/brother/Printers/HLL2375DW\" ; #" \ - --replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #" + # Fix global references and replace auto discovery mechanism with hardcoded values + substituteInPlace $out/opt/brother/Printers/HLL2375DW/lpd/lpdfilter \ + --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2375DW\"; #" \ + --replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #" + substituteInPlace $out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \ + --replace "my \$basedir = C" "my \$basedir = \"$out/opt/brother/Printers/HLL2375DW\" ; #" \ + --replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #" - # Make sure all executables have the necessary runtime dependencies available - find "$out" -executable -and -type f | while read file; do - wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" - done + # Make sure all executables have the necessary runtime dependencies available + find "$out" -executable -and -type f | while read file; do + wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" + done - # Symlink filter and ppd into a location where CUPS will discover it - mkdir -p $out/lib/cups/filter - mkdir -p $out/share/cups/model - mkdir -p $out/etc/opt/brother/Printers/HLL2375DW/inf + # Symlink filter and ppd into a location where CUPS will discover it + mkdir -p $out/lib/cups/filter + mkdir -p $out/share/cups/model + mkdir -p $out/etc/opt/brother/Printers/HLL2375DW/inf - ln -s $out/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc \ - $out/etc/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc - ln -s \ - $out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \ - $out/lib/cups/filter/brother_lpdwrapper_HLL2375DW - ln -s \ - $out/opt/brother/Printers/HLL2375DW/cupswrapper/brother-HLL2375DW-cups-en.ppd \ - $out/share/cups/model/ - runHook postInstall - ''; + ln -s $out/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc \ + $out/etc/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc + ln -s \ + $out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \ + $out/lib/cups/filter/brother_lpdwrapper_HLL2375DW + ln -s \ + $out/opt/brother/Printers/HLL2375DW/cupswrapper/brother-HLL2375DW-cups-en.ppd \ + $out/share/cups/model/ + runHook postInstall + ''; meta = with lib; { homepage = "http://www.brother.com/"; diff --git a/pkgs/by-name/cu/cups-brother-mfcl2750dw/package.nix b/pkgs/by-name/cu/cups-brother-mfcl2750dw/package.nix index 25485338be51..2e286d529ad6 100644 --- a/pkgs/by-name/cu/cups-brother-mfcl2750dw/package.nix +++ b/pkgs/by-name/cu/cups-brother-mfcl2750dw/package.nix @@ -49,51 +49,50 @@ stdenv.mkDerivation rec { hash = "sha256-3uDwzLQTF8r1tsGZ7ChGhk4ryQmVsZYdUaj9eFaC0jc="; }; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out - dpkg-deb -x $src $out + mkdir -p $out + dpkg-deb -x $src $out - # delete unnecessary files for the current architecture - '' - + lib.concatMapStrings (arch: '' - echo Deleting files for ${arch} - rm -r "$out/opt/brother/Printers/MFCL2750DW/lpd/${arch}" - '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) - + '' + # delete unnecessary files for the current architecture + '' + + lib.concatMapStrings (arch: '' + echo Deleting files for ${arch} + rm -r "$out/opt/brother/Printers/MFCL2750DW/lpd/${arch}" + '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) + + '' - # bundled scripts don't understand the arch subdirectories for some reason - ln -s \ - "$out/opt/brother/Printers/MFCL2750DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ - "$out/opt/brother/Printers/MFCL2750DW/lpd/" + # bundled scripts don't understand the arch subdirectories for some reason + ln -s \ + "$out/opt/brother/Printers/MFCL2750DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ + "$out/opt/brother/Printers/MFCL2750DW/lpd/" - # Fix global references and replace auto discovery mechanism with hardcoded values - substituteInPlace $out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \ - --replace /opt "$out/opt" \ - --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2750DW\"; #" \ - --replace "PRINTER =~" "PRINTER = \"MFCL2750DW\"; #" + # Fix global references and replace auto discovery mechanism with hardcoded values + substituteInPlace $out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \ + --replace /opt "$out/opt" \ + --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2750DW\"; #" \ + --replace "PRINTER =~" "PRINTER = \"MFCL2750DW\"; #" - # Make sure all executables have the necessary runtime dependencies available - find "$out" -executable -and -type f | while read file; do - wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" - done + # Make sure all executables have the necessary runtime dependencies available + find "$out" -executable -and -type f | while read file; do + wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" + done - # Symlink filter and ppd into a location where CUPS will discover it - mkdir -p $out/lib/cups/filter - mkdir -p $out/share/cups/model + # Symlink filter and ppd into a location where CUPS will discover it + mkdir -p $out/lib/cups/filter + mkdir -p $out/share/cups/model - ln -s \ - $out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \ - $out/lib/cups/filter/brother_lpdwrapper_MFCL2750DW + ln -s \ + $out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \ + $out/lib/cups/filter/brother_lpdwrapper_MFCL2750DW - ln -s \ - $out/opt/brother/Printers/MFCL2750DW/cupswrapper/brother-MFCL2750DW-cups-en.ppd \ - $out/share/cups/model/ + ln -s \ + $out/opt/brother/Printers/MFCL2750DW/cupswrapper/brother-MFCL2750DW-cups-en.ppd \ + $out/share/cups/model/ - runHook postInstall - ''; + runHook postInstall + ''; meta = with lib; { homepage = "http://www.brother.com/"; diff --git a/pkgs/by-name/cu/cups-brother-mfcl2800dw/package.nix b/pkgs/by-name/cu/cups-brother-mfcl2800dw/package.nix index a8eef17291a8..6de620531193 100644 --- a/pkgs/by-name/cu/cups-brother-mfcl2800dw/package.nix +++ b/pkgs/by-name/cu/cups-brother-mfcl2800dw/package.nix @@ -47,50 +47,49 @@ stdenv.mkDerivation { hash = "sha256-sY92w0EFI69LxoNrhluIhqFOWZQOI+SJKKyuExvasgA="; }; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out - dpkg-deb -x $src $out + mkdir -p $out + dpkg-deb -x $src $out - # delete unnecessary files for the current architecture - '' - + lib.concatMapStrings (arch: '' - echo Deleting files for ${arch} - rm -r "$out/opt/brother/Printers/MFCL2800DW/lpd/${arch}" - '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) - + '' + # delete unnecessary files for the current architecture + '' + + lib.concatMapStrings (arch: '' + echo Deleting files for ${arch} + rm -r "$out/opt/brother/Printers/MFCL2800DW/lpd/${arch}" + '') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches) + + '' - # bundled scripts don't understand the arch subdirectories for some reason - ln -s \ - "$out/opt/brother/Printers/MFCL2800DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ - "$out/opt/brother/Printers/MFCL2800DW/lpd/" + # bundled scripts don't understand the arch subdirectories for some reason + ln -s \ + "$out/opt/brother/Printers/MFCL2800DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \ + "$out/opt/brother/Printers/MFCL2800DW/lpd/" - # Fix global references and replace auto discovery mechanism with hardcoded values - substituteInPlace $out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \ - --replace-fail /opt "$out/opt" \ - --replace-fail "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2800DW\"; #" \ - --replace-fail "PRINTER =~" "PRINTER = \"MFCL2800DW\"; #" + # Fix global references and replace auto discovery mechanism with hardcoded values + substituteInPlace $out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \ + --replace-fail /opt "$out/opt" \ + --replace-fail "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2800DW\"; #" \ + --replace-fail "PRINTER =~" "PRINTER = \"MFCL2800DW\"; #" - # Make sure all executables have the necessary runtime dependencies available - find "$out" -executable -and -type f | while read file; do - wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" - done + # Make sure all executables have the necessary runtime dependencies available + find "$out" -executable -and -type f | while read file; do + wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" + done - # Symlink filter and ppd into a location where CUPS will discover it - mkdir -p $out/lib/cups/filter $out/share/cups/model + # Symlink filter and ppd into a location where CUPS will discover it + mkdir -p $out/lib/cups/filter $out/share/cups/model - ln -s \ - $out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \ - $out/lib/cups/filter/brother_lpdwrapper_MFCL2800DW + ln -s \ + $out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \ + $out/lib/cups/filter/brother_lpdwrapper_MFCL2800DW - ln -s \ - $out/opt/brother/Printers/MFCL2800DW/cupswrapper/brother-MFCL2800DW-cups-en.ppd \ - $out/share/cups/model/ + ln -s \ + $out/opt/brother/Printers/MFCL2800DW/cupswrapper/brother-MFCL2800DW-cups-en.ppd \ + $out/share/cups/model/ - runHook postInstall - ''; + runHook postInstall + ''; meta = { homepage = "http://www.brother.com/"; diff --git a/pkgs/by-name/cu/cups-kyodialog/package.nix b/pkgs/by-name/cu/cups-kyodialog/package.nix index 2cd8ea911140..ca655ee05eb6 100644 --- a/pkgs/by-name/cu/cups-kyodialog/package.nix +++ b/pkgs/by-name/cu/cups-kyodialog/package.nix @@ -70,7 +70,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoPatchelfHook python3Packages.wrapPython - ] ++ lib.optionals withQtGui [ qt5.wrapQtAppsHook ]; + ] + ++ lib.optionals withQtGui [ qt5.wrapQtAppsHook ]; buildInputs = [ cups ] ++ lib.optionals withQtGui [ qt5.qtbase ]; @@ -82,35 +83,34 @@ stdenv.mkDerivation rec { setuptools ]; - installPhase = - '' - # allow cups to find the ppd files - mkdir -p $out/share/cups/model - mv ./usr/share/kyocera${kyodialog_version}/ppd${kyodialog_version} $out/share/cups/model/Kyocera + installPhase = '' + # allow cups to find the ppd files + mkdir -p $out/share/cups/model + mv ./usr/share/kyocera${kyodialog_version}/ppd${kyodialog_version} $out/share/cups/model/Kyocera - # remove absolute path prefixes to filters in ppd - find $out -name "*.ppd" -exec sed -E -i "s:/usr/lib/cups/filter/::g" {} \; + # remove absolute path prefixes to filters in ppd + find $out -name "*.ppd" -exec sed -E -i "s:/usr/lib/cups/filter/::g" {} \; - mkdir -p $out/lib/cups/ - mv ./usr/lib/cups/filter/ $out/lib/cups/ - # for lib/cups/filter/kyofilter_pre_H - wrapPythonProgramsIn $out/lib/cups/filter "$propagatedBuildInputs" + mkdir -p $out/lib/cups/ + mv ./usr/lib/cups/filter/ $out/lib/cups/ + # for lib/cups/filter/kyofilter_pre_H + wrapPythonProgramsIn $out/lib/cups/filter "$propagatedBuildInputs" - install -Dm444 usr/share/doc/kyodialog/copyright $out/share/doc/${pname}/copyright - '' - + lib.optionalString withQtGui '' - install -D usr/bin/kyoPPDWrite_H $out/bin/kyoPPDWrite_H - install -D usr/bin/kyodialog${kyodialog_version} $out/bin/kyodialog + install -Dm444 usr/share/doc/kyodialog/copyright $out/share/doc/${pname}/copyright + '' + + lib.optionalString withQtGui '' + install -D usr/bin/kyoPPDWrite_H $out/bin/kyoPPDWrite_H + install -D usr/bin/kyodialog${kyodialog_version} $out/bin/kyodialog - install -Dm444 usr/share/kyocera${kyodialog_version}/appicon_H.png $out/share/${pname}/icons/appicon_H.png + install -Dm444 usr/share/kyocera${kyodialog_version}/appicon_H.png $out/share/${pname}/icons/appicon_H.png - install -Dm444 usr/share/applications/kyodialog${kyodialog_version}.desktop $out/share/applications/kyodialog.desktop - substituteInPlace $out/share/applications/kyodialog.desktop \ - --replace Exec=\"/usr/bin/kyodialog${kyodialog_version}\" Exec=\"$out/bin/kyodialog\" \ - --replace Icon=/usr/share/kyocera/appicon_H.png Icon=$out/share/${pname}/icons/appicon_H.png - ''; + install -Dm444 usr/share/applications/kyodialog${kyodialog_version}.desktop $out/share/applications/kyodialog.desktop + substituteInPlace $out/share/applications/kyodialog.desktop \ + --replace Exec=\"/usr/bin/kyodialog${kyodialog_version}\" Exec=\"$out/bin/kyodialog\" \ + --replace Icon=/usr/share/kyocera/appicon_H.png Icon=$out/share/${pname}/icons/appicon_H.png + ''; meta = with lib; { description = "CUPS drivers for several Kyocera printers"; diff --git a/pkgs/by-name/cu/curl-impersonate/chrome/default.nix b/pkgs/by-name/cu/curl-impersonate/chrome/default.nix index dce29e548661..efdd2c69fba3 100644 --- a/pkgs/by-name/cu/curl-impersonate/chrome/default.nix +++ b/pkgs/by-name/cu/curl-impersonate/chrome/default.nix @@ -127,36 +127,35 @@ stdenv.mkDerivation rec { configureFlagsArray+=("--with-libnssckbi=$out/lib") ''; - postInstall = - '' - # Remove vestigial *-config script - rm $out/bin/curl-impersonate-chrome-config + postInstall = '' + # Remove vestigial *-config script + rm $out/bin/curl-impersonate-chrome-config - # Patch all shebangs of installed scripts - patchShebangs $out/bin + # Patch all shebangs of installed scripts + patchShebangs $out/bin - # Install headers - make -C curl-*/include install - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # Build and install completions for each curl binary + # Install headers + make -C curl-*/include install + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # Build and install completions for each curl binary - # Patch in correct binary name and alias it to all scripts - perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-chrome --shell zsh >$TMPDIR/curl-impersonate-chrome.zsh - substituteInPlace $TMPDIR/curl-impersonate-chrome.zsh \ - --replace-fail \ - '#compdef curl' \ - "#compdef curl-impersonate-chrome$(find $out/bin -name 'curl_*' -printf ' %f=curl-impersonate-chrome')" + # Patch in correct binary name and alias it to all scripts + perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-chrome --shell zsh >$TMPDIR/curl-impersonate-chrome.zsh + substituteInPlace $TMPDIR/curl-impersonate-chrome.zsh \ + --replace-fail \ + '#compdef curl' \ + "#compdef curl-impersonate-chrome$(find $out/bin -name 'curl_*' -printf ' %f=curl-impersonate-chrome')" - perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-chrome --shell fish >$TMPDIR/curl-impersonate-chrome.fish - substituteInPlace $TMPDIR/curl-impersonate-chrome.fish \ - --replace-fail \ - '--command curl' \ - "--command curl-impersonate-chrome$(find $out/bin -name 'curl_*' -printf ' --command %f')" + perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-chrome --shell fish >$TMPDIR/curl-impersonate-chrome.fish + substituteInPlace $TMPDIR/curl-impersonate-chrome.fish \ + --replace-fail \ + '--command curl' \ + "--command curl-impersonate-chrome$(find $out/bin -name 'curl_*' -printf ' --command %f')" - # Install zsh and fish completions - installShellCompletion $TMPDIR/curl-impersonate-chrome.{zsh,fish} - ''; + # Install zsh and fish completions + installShellCompletion $TMPDIR/curl-impersonate-chrome.{zsh,fish} + ''; preFixup = let diff --git a/pkgs/by-name/cu/curl-impersonate/firefox/default.nix b/pkgs/by-name/cu/curl-impersonate/firefox/default.nix index e0d178466ea2..c82f81e4a4df 100644 --- a/pkgs/by-name/cu/curl-impersonate/firefox/default.nix +++ b/pkgs/by-name/cu/curl-impersonate/firefox/default.nix @@ -119,36 +119,35 @@ stdenv.mkDerivation rec { configureFlagsArray+=("--with-libnssckbi=$out/lib") ''; - postInstall = - '' - # Remove vestigial *-config script - rm $out/bin/curl-impersonate-ff-config + postInstall = '' + # Remove vestigial *-config script + rm $out/bin/curl-impersonate-ff-config - # Patch all shebangs of installed scripts - patchShebangs $out/bin + # Patch all shebangs of installed scripts + patchShebangs $out/bin - # Install headers - make -C curl-*/include install - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # Build and install completions for each curl binary + # Install headers + make -C curl-*/include install + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # Build and install completions for each curl binary - # Patch in correct binary name and alias it to all scripts - perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-ff --shell zsh >$TMPDIR/curl-impersonate-ff.zsh - substituteInPlace $TMPDIR/curl-impersonate-ff.zsh \ - --replace-fail \ - '#compdef curl' \ - "#compdef curl-impersonate-ff$(find $out/bin -name 'curl_*' -printf ' %f=curl-impersonate-ff')" + # Patch in correct binary name and alias it to all scripts + perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-ff --shell zsh >$TMPDIR/curl-impersonate-ff.zsh + substituteInPlace $TMPDIR/curl-impersonate-ff.zsh \ + --replace-fail \ + '#compdef curl' \ + "#compdef curl-impersonate-ff$(find $out/bin -name 'curl_*' -printf ' %f=curl-impersonate-ff')" - perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-ff --shell fish >$TMPDIR/curl-impersonate-ff.fish - substituteInPlace $TMPDIR/curl-impersonate-ff.fish \ - --replace-fail \ - '--command curl' \ - "--command curl-impersonate-ff$(find $out/bin -name 'curl_*' -printf ' --command %f')" + perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-ff --shell fish >$TMPDIR/curl-impersonate-ff.fish + substituteInPlace $TMPDIR/curl-impersonate-ff.fish \ + --replace-fail \ + '--command curl' \ + "--command curl-impersonate-ff$(find $out/bin -name 'curl_*' -printf ' --command %f')" - # Install zsh and fish completions - installShellCompletion $TMPDIR/curl-impersonate-ff.{zsh,fish} - ''; + # Install zsh and fish completions + installShellCompletion $TMPDIR/curl-impersonate-ff.{zsh,fish} + ''; preFixup = let diff --git a/pkgs/by-name/cu/curlMinimal/package.nix b/pkgs/by-name/cu/curlMinimal/package.nix index e84bce6fafd9..a2d1835da18e 100644 --- a/pkgs/by-name/cu/curlMinimal/package.nix +++ b/pkgs/by-name/cu/curlMinimal/package.nix @@ -132,7 +132,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config perl - ] ++ lib.optionals stdenv.hostPlatform.isOpenBSD [ autoreconfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isOpenBSD [ autoreconfHook ]; nativeCheckInputs = [ # See https://github.com/curl/curl/pull/16928 @@ -170,48 +171,47 @@ stdenv.mkDerivation (finalAttrs: { rm src/tool_hugehelp.c ''; - configureFlags = - [ - "--enable-versioned-symbols" - # Build without manual - "--disable-manual" - (lib.enableFeature c-aresSupport "ares") - (lib.enableFeature ldapSupport "ldap") - (lib.enableFeature ldapSupport "ldaps") - (lib.enableFeature websocketSupport "websockets") - # --with-ca-fallback is only supported for openssl and gnutls https://github.com/curl/curl/blame/curl-8_0_1/acinclude.m4#L1640 - (lib.withFeature (opensslSupport || gnutlsSupport) "ca-fallback") - (lib.withFeature http3Support "nghttp3") - (lib.withFeature http3Support "ngtcp2") - (lib.withFeature rtmpSupport "librtmp") - (lib.withFeature rustlsSupport "rustls") - (lib.withFeature zstdSupport "zstd") - (lib.withFeature pslSupport "libpsl") - (lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli)) - (lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls)) - (lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2)) - (lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl')) - (lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2)) - (lib.withFeatureAs wolfsslSupport "wolfssl" (lib.getDev wolfssl)) - ] - ++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}" - # For the 'urandom', maybe it should be a cross-system option - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--with-random=/dev/urandom" - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback to nss-cacert from the default profile. - # Without this curl might detect /etc/ssl/cert.pem at build time on macOS, causing curl to ignore NIX_SSL_CERT_FILE. - "--without-ca-bundle" - "--without-ca-path" - ] - ++ lib.optionals (!gnutlsSupport && !opensslSupport && !wolfsslSupport && !rustlsSupport) [ - "--without-ssl" - ] - ++ lib.optionals (rustlsSupport && !stdenv.hostPlatform.isDarwin) [ - "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt" - ] - ++ lib.optionals (gnutlsSupport && !stdenv.hostPlatform.isDarwin) [ - "--with-ca-path=/etc/ssl/certs" - ]; + configureFlags = [ + "--enable-versioned-symbols" + # Build without manual + "--disable-manual" + (lib.enableFeature c-aresSupport "ares") + (lib.enableFeature ldapSupport "ldap") + (lib.enableFeature ldapSupport "ldaps") + (lib.enableFeature websocketSupport "websockets") + # --with-ca-fallback is only supported for openssl and gnutls https://github.com/curl/curl/blame/curl-8_0_1/acinclude.m4#L1640 + (lib.withFeature (opensslSupport || gnutlsSupport) "ca-fallback") + (lib.withFeature http3Support "nghttp3") + (lib.withFeature http3Support "ngtcp2") + (lib.withFeature rtmpSupport "librtmp") + (lib.withFeature rustlsSupport "rustls") + (lib.withFeature zstdSupport "zstd") + (lib.withFeature pslSupport "libpsl") + (lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli)) + (lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls)) + (lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2)) + (lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl')) + (lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2)) + (lib.withFeatureAs wolfsslSupport "wolfssl" (lib.getDev wolfssl)) + ] + ++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}" + # For the 'urandom', maybe it should be a cross-system option + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--with-random=/dev/urandom" + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback to nss-cacert from the default profile. + # Without this curl might detect /etc/ssl/cert.pem at build time on macOS, causing curl to ignore NIX_SSL_CERT_FILE. + "--without-ca-bundle" + "--without-ca-path" + ] + ++ lib.optionals (!gnutlsSupport && !opensslSupport && !wolfsslSupport && !rustlsSupport) [ + "--without-ssl" + ] + ++ lib.optionals (rustlsSupport && !stdenv.hostPlatform.isDarwin) [ + "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt" + ] + ++ lib.optionals (gnutlsSupport && !stdenv.hostPlatform.isDarwin) [ + "--with-ca-path=/etc/ssl/certs" + ]; CXX = "${stdenv.cc.targetPrefix}c++"; CXXCPP = "${stdenv.cc.targetPrefix}c++ -E"; @@ -220,37 +220,35 @@ stdenv.mkDerivation (finalAttrs: { # they cannot be run concurrently and are a bottleneck # tests are available in passthru.tests.withCheck doCheck = false; - preCheck = - '' - patchShebangs tests/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # bad interaction with sandbox if enabled? - rm tests/data/test1453 - rm tests/data/test1086 - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - # different resolving behaviour? - rm tests/data/test1592 - ''; + preCheck = '' + patchShebangs tests/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # bad interaction with sandbox if enabled? + rm tests/data/test1453 + rm tests/data/test1086 + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + # different resolving behaviour? + rm tests/data/test1592 + ''; __darwinAllowLocalNetworking = true; - postInstall = - '' - moveToOutput bin/curl-config "$dev" + postInstall = '' + moveToOutput bin/curl-config "$dev" - # Install completions - make -C scripts install - '' - + lib.optionalString scpSupport '' - sed '/^dependency_libs/s|${lib.getDev libssh2}|${lib.getLib libssh2}|' -i "$out"/lib/*.la - '' - + lib.optionalString gnutlsSupport '' - ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary} - ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}.4 - ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}.4.4.0 - ''; + # Install completions + make -C scripts install + '' + + lib.optionalString scpSupport '' + sed '/^dependency_libs/s|${lib.getDev libssh2}|${lib.getLib libssh2}|' -i "$out"/lib/*.la + '' + + lib.optionalString gnutlsSupport '' + ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary} + ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}.4 + ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}.4.4.0 + ''; passthru = let diff --git a/pkgs/by-name/cu/curv/package.nix b/pkgs/by-name/cu/curv/package.nix index 2f63ddd9534f..2d68ac3aeef0 100644 --- a/pkgs/by-name/cu/curv/package.nix +++ b/pkgs/by-name/cu/curv/package.nix @@ -38,26 +38,25 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - boost - eigen_3_4_0 - glm - libGL - libpng - openexr - tbb - xorg.libX11 - xorg.libXcursor - xorg.libXext - xorg.libXi - xorg.libXinerama - xorg.libXrandr - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ilmbase - llvmPackages.openmp - ]; + buildInputs = [ + boost + eigen_3_4_0 + glm + libGL + libpng + openexr + tbb + xorg.libX11 + xorg.libXcursor + xorg.libXext + xorg.libXi + xorg.libXinerama + xorg.libXrandr + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ilmbase + llvmPackages.openmp + ]; # force char to be unsigned on aarch64 # https://codeberg.org/doug-moen/curv/issues/227 diff --git a/pkgs/by-name/cv/cvc4/package.nix b/pkgs/by-name/cv/cvc4/package.nix index 62fc9a50e06f..039ec5617dbc 100644 --- a/pkgs/by-name/cv/cvc4/package.nix +++ b/pkgs/by-name/cv/cvc4/package.nix @@ -42,13 +42,15 @@ stdenv.mkDerivation rec { boost jdk python3 - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ cln ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ cln ]; configureFlags = [ "--enable-language-bindings=c,c++,java" "--enable-gpl" "--with-readline" "--with-boost=${boost.dev}" - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "--with-cln" ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "--with-cln" ]; prePatch = '' patch -p1 -i ${./minisat-fenv.patch} -d src/prop/minisat diff --git a/pkgs/by-name/cv/cvs/package.nix b/pkgs/by-name/cv/cvs/package.nix index 869bbb301a59..6108d1fc3bc3 100644 --- a/pkgs/by-name/cv/cvs/package.nix +++ b/pkgs/by-name/cv/cvs/package.nix @@ -46,27 +46,25 @@ stdenv.mkDerivation { texinfo ]; - configureFlags = - [ - "--with-editor=${nano}/bin/nano" + configureFlags = [ + "--with-editor=${nano}/bin/nano" - # Required for cross-compilation. - "cvs_cv_func_printf_ptr=yes" - ] - ++ lib.optionals (stdenv.hostPlatform.libc == "glibc") [ - # So that fputs_unlocked is defined - "CFLAGS=-D_GNU_SOURCE" - ]; + # Required for cross-compilation. + "cvs_cv_func_printf_ptr=yes" + ] + ++ lib.optionals (stdenv.hostPlatform.libc == "glibc") [ + # So that fputs_unlocked is defined + "CFLAGS=-D_GNU_SOURCE" + ]; - makeFlags = - [ - "AR=${stdenv.cc.targetPrefix}ar" - ] - ++ lib.optionals (!stdenv.cc.bintools.isGNU) [ - # Don't pass --as-needed to linkers that don't support it - # (introduced in debian patchset) - "cvs_LDFLAGS=" - ]; + makeFlags = [ + "AR=${stdenv.cc.targetPrefix}ar" + ] + ++ lib.optionals (!stdenv.cc.bintools.isGNU) [ + # Don't pass --as-needed to linkers that don't support it + # (introduced in debian patchset) + "cvs_LDFLAGS=" + ]; doCheck = false; # fails 1 of 1 tests diff --git a/pkgs/by-name/cx/cxxopts/package.nix b/pkgs/by-name/cx/cxxopts/package.nix index 667a6450d1ed..a00858fb2fff 100644 --- a/pkgs/by-name/cx/cxxopts/package.nix +++ b/pkgs/by-name/cx/cxxopts/package.nix @@ -22,7 +22,8 @@ stdenv.mkDerivation rec { buildInputs = lib.optionals enableUnicodeHelp [ icu74.dev ]; cmakeFlags = [ "-DCXXOPTS_BUILD_EXAMPLES=OFF" - ] ++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE"; + ] + ++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE"; nativeBuildInputs = [ cmake ] ++ lib.optionals enableUnicodeHelp [ pkg-config ]; doCheck = true; diff --git a/pkgs/by-name/cy/cyme/package.nix b/pkgs/by-name/cy/cyme/package.nix index 24ec4b887088..3b3d700041f3 100644 --- a/pkgs/by-name/cy/cyme/package.nix +++ b/pkgs/by-name/cy/cyme/package.nix @@ -24,14 +24,13 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-HdlhsOctPxOanbPAIJnlUoY4QeIluVsJlPglFXHBpFY="; - nativeBuildInputs = - [ - pkg-config - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.DarwinTools - ]; + nativeBuildInputs = [ + pkg-config + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.DarwinTools + ]; checkFlags = [ # doctest that requires access outside sandbox diff --git a/pkgs/by-name/cy/cypress/package.nix b/pkgs/by-name/cy/cypress/package.nix index f3e38c316bb3..fd4bea26ea8d 100644 --- a/pkgs/by-name/cy/cypress/package.nix +++ b/pkgs/by-name/cy/cypress/package.nix @@ -52,17 +52,16 @@ stdenv.mkDerivation rec { # don't remove runtime deps dontPatchELF = true; - nativeBuildInputs = - [ - unzip - makeShellWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - # override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651 - # Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset. - (buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; }) - ]; + nativeBuildInputs = [ + unzip + makeShellWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + # override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651 + # Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset. + (buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; }) + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ nss diff --git a/pkgs/by-name/cy/cyrus-imapd/package.nix b/pkgs/by-name/cy/cyrus-imapd/package.nix index c390f82234dc..d59565107167 100644 --- a/pkgs/by-name/cy/cyrus-imapd/package.nix +++ b/pkgs/by-name/cy/cyrus-imapd/package.nix @@ -80,56 +80,54 @@ stdenv.mkDerivation (finalAttrs: { pkg-config autoreconfHook ]; - buildInputs = - [ - unixtools.xxd - pcre2 - flex - valgrind - fig2dev - perl - cyrus_sasl.dev - icu - jansson - libbsd - libuuid - openssl - zlib - bison - libsrs2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ libcap ] - ++ lib.optionals (enableHttp || enableCalalarmd || enableJMAP) [ - brotli.dev - libical.dev - libxml2.dev - nghttp2.dev - shapelib - ] - ++ lib.optionals enableJMAP [ - libchardet - wslay - ] - ++ lib.optionals enableXapian [ - rsync - xapian - ] - ++ lib.optionals withMySQL [ libmysqlclient ] - ++ lib.optionals withPgSQL [ libpq ] - ++ lib.optionals withSQLite [ sqlite ]; + buildInputs = [ + unixtools.xxd + pcre2 + flex + valgrind + fig2dev + perl + cyrus_sasl.dev + icu + jansson + libbsd + libuuid + openssl + zlib + bison + libsrs2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libcap ] + ++ lib.optionals (enableHttp || enableCalalarmd || enableJMAP) [ + brotli.dev + libical.dev + libxml2.dev + nghttp2.dev + shapelib + ] + ++ lib.optionals enableJMAP [ + libchardet + wslay + ] + ++ lib.optionals enableXapian [ + rsync + xapian + ] + ++ lib.optionals withMySQL [ libmysqlclient ] + ++ lib.optionals withPgSQL [ libpq ] + ++ lib.optionals withSQLite [ sqlite ]; enableParallelBuilding = true; postPatch = let - managesieveLibs = - [ - zlib - cyrus_sasl - sqlite - ] - # Darwin doesn't have libuuid, try to build without it - ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid; + managesieveLibs = [ + zlib + cyrus_sasl + sqlite + ] + # Darwin doesn't have libuuid, try to build without it + ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid; imapLibs = managesieveLibs ++ [ pcre2 ]; mkLibsString = lib.strings.concatMapStringsSep " " (l: "-L${lib.getLib l}/lib"); in diff --git a/pkgs/by-name/cy/cyrus_sasl/package.nix b/pkgs/by-name/cy/cyrus_sasl/package.nix index 68d019ca2619..c6dc04e136f3 100644 --- a/pkgs/by-name/cy/cyrus_sasl/package.nix +++ b/pkgs/by-name/cy/cyrus_sasl/package.nix @@ -53,31 +53,30 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pruneLibtoolFiles - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = - [ - openssl - db - gettext - libkrb5 - libxcrypt - ] - ++ lib.optional enableLdap openldap - ++ lib.optional stdenv.hostPlatform.isLinux pam; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + buildInputs = [ + openssl + db + gettext + libkrb5 + libxcrypt + ] + ++ lib.optional enableLdap openldap + ++ lib.optional stdenv.hostPlatform.isLinux pam; - configureFlags = - [ - "--with-openssl=${openssl.dev}" - "--with-plugindir=${placeholder "out"}/lib/sasl2" - "--with-saslauthd=/run/saslauthd" - "--enable-login" - "--enable-shared" - ] - ++ lib.optional enableLdap "--with-ldap=${openldap.dev}" - ++ lib.optionals (stdenv.targetPlatform.useLLVM or false) [ - "--disable-sample" - "CFLAGS=-DTIME_WITH_SYS_TIME" - ]; + configureFlags = [ + "--with-openssl=${openssl.dev}" + "--with-plugindir=${placeholder "out"}/lib/sasl2" + "--with-saslauthd=/run/saslauthd" + "--enable-login" + "--enable-shared" + ] + ++ lib.optional enableLdap "--with-ldap=${openldap.dev}" + ++ lib.optionals (stdenv.targetPlatform.useLLVM or false) [ + "--disable-sample" + "CFLAGS=-DTIME_WITH_SYS_TIME" + ]; env = lib.optionalAttrs stdenv.cc.isGNU { NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; diff --git a/pkgs/by-name/da/daggerfall-unity/package.nix b/pkgs/by-name/da/daggerfall-unity/package.nix index a0387df8cb35..4e15a46526e2 100644 --- a/pkgs/by-name/da/daggerfall-unity/package.nix +++ b/pkgs/by-name/da/daggerfall-unity/package.nix @@ -22,22 +22,21 @@ includeUnfree ? false, }: let - docFiles = - [ - (fetchurl { - url = "https://www.dfworkshop.net/static_files/daggerfallunity/Daggerfall%20Unity%20Manual.pdf"; - hash = "sha256-FywlD0K5b4vUWzyzANlF9575XTDLivbsym7F+qe0Dm8="; - name = "Daggerfall Unity Manual.pdf"; - meta.license = lib.licenses.mit; - }) - ] - ++ lib.optionals includeUnfree [ - (fetchurl { - url = "https://cdn.bethsoft.com/bethsoft.com/manuals/Daggerfall/daggerfall-en.pdf"; - hash = "sha256-24KSP/E7+KvSRTMDq63NVlVWTFZnQj1yya8wc36yrC0="; - meta.license = lib.licenses.unfree; - }) - ]; + docFiles = [ + (fetchurl { + url = "https://www.dfworkshop.net/static_files/daggerfallunity/Daggerfall%20Unity%20Manual.pdf"; + hash = "sha256-FywlD0K5b4vUWzyzANlF9575XTDLivbsym7F+qe0Dm8="; + name = "Daggerfall Unity Manual.pdf"; + meta.license = lib.licenses.mit; + }) + ] + ++ lib.optionals includeUnfree [ + (fetchurl { + url = "https://cdn.bethsoft.com/bethsoft.com/manuals/Daggerfall/daggerfall-en.pdf"; + hash = "sha256-24KSP/E7+KvSRTMDq63NVlVWTFZnQj1yya8wc36yrC0="; + meta.license = lib.licenses.unfree; + }) + ]; in stdenv.mkDerivation (finalAttrs: { inherit pname; diff --git a/pkgs/by-name/da/dante/package.nix b/pkgs/by-name/da/dante/package.nix index 85524a14af6c..ddb495471cef 100644 --- a/pkgs/by-name/da/dante/package.nix +++ b/pkgs/by-name/da/dante/package.nix @@ -41,19 +41,18 @@ stdenv.mkDerivation rec { dontAddDisableDepTrack = stdenv.hostPlatform.isDarwin; - patches = - [ - # Fixes several issues with `osint.m4` that causes incorrect check failures when using newer - # versions of clang: missing `stdint.h` for `uint8_t` and unused `sa_len_ptr`. - ./clang-osint-m4.patch - ] - ++ lib.optionals remove_getaddrinfo_checks [ - (fetchpatch { - name = "0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; - url = "https://raw.githubusercontent.com/buildroot/buildroot/master/package/dante/0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; - sha256 = "sha256-e+qF8lB5tkiA7RlJ+tX5O6KxQrQp33RSPdP1TxU961Y="; - }) - ]; + patches = [ + # Fixes several issues with `osint.m4` that causes incorrect check failures when using newer + # versions of clang: missing `stdint.h` for `uint8_t` and unused `sa_len_ptr`. + ./clang-osint-m4.patch + ] + ++ lib.optionals remove_getaddrinfo_checks [ + (fetchpatch { + name = "0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; + url = "https://raw.githubusercontent.com/buildroot/buildroot/master/package/dante/0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; + sha256 = "sha256-e+qF8lB5tkiA7RlJ+tX5O6KxQrQp33RSPdP1TxU961Y="; + }) + ]; postPatch = '' substituteInPlace include/redefgen.sh --replace 'PATH=/bin:/usr/bin:/sbin:/usr/sbin' "" diff --git a/pkgs/by-name/da/dar/package.nix b/pkgs/by-name/da/dar/package.nix index 471ce76e6347..dc6135dc5c86 100644 --- a/pkgs/by-name/da/dar/package.nix +++ b/pkgs/by-name/da/dar/package.nix @@ -36,26 +36,25 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ which ]; - buildInputs = - [ - curl - librsync - libthreadar - gpgme - libargon2 - libgcrypt - openssl - bzip2 - lz4 - lzo - xz - zlib - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - attr - e2fsprogs - ]; + buildInputs = [ + curl + librsync + libthreadar + gpgme + libargon2 + libgcrypt + openssl + bzip2 + lz4 + lzo + xz + zlib + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + attr + e2fsprogs + ]; configureFlags = [ "--disable-birthtime" diff --git a/pkgs/by-name/da/darkly/package.nix b/pkgs/by-name/da/darkly/package.nix index acb9ace1912c..c7644c91217a 100644 --- a/pkgs/by-name/da/darkly/package.nix +++ b/pkgs/by-name/da/darkly/package.nix @@ -57,16 +57,15 @@ stdenv.mkDerivation (finalAttrs: { passthru.updateScript = gitUpdater { rev-prefix = "v"; }; - meta = - { - description = "Modern style for Qt applications (fork of Lightly)"; - homepage = "https://github.com/Bali10050/Darkly"; - changelog = "https://github.com/Bali10050/Darkly/releases/tag/v${finalAttrs.version}"; - platforms = lib.platforms.linux; - license = with lib.licenses; [ gpl2Plus ]; - maintainers = with lib.maintainers; [ pluiedev ]; - } - // lib.optionalAttrs (qtMajorVersion == "6") { - mainProgram = "darkly-settings6"; - }; + meta = { + description = "Modern style for Qt applications (fork of Lightly)"; + homepage = "https://github.com/Bali10050/Darkly"; + changelog = "https://github.com/Bali10050/Darkly/releases/tag/v${finalAttrs.version}"; + platforms = lib.platforms.linux; + license = with lib.licenses; [ gpl2Plus ]; + maintainers = with lib.maintainers; [ pluiedev ]; + } + // lib.optionalAttrs (qtMajorVersion == "6") { + mainProgram = "darkly-settings6"; + }; }) diff --git a/pkgs/by-name/da/darkradiant/package.nix b/pkgs/by-name/da/darkradiant/package.nix index b4b185178d5d..b050e643c752 100644 --- a/pkgs/by-name/da/darkradiant/package.nix +++ b/pkgs/by-name/da/darkradiant/package.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation (finalAttrs: { glib libgit2 python3 - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 ]; doCheck = true; diff --git a/pkgs/by-name/da/darktable/package.nix b/pkgs/by-name/da/darktable/package.nix index 78d8e6218267..bbc7e240487e 100644 --- a/pkgs/by-name/da/darktable/package.nix +++ b/pkgs/by-name/da/darktable/package.nix @@ -112,78 +112,76 @@ stdenv.mkDerivation rec { saxon-xslt # Use Saxon instead of libxslt to fix XSLT generate-id() consistency issues ]; - buildInputs = - [ - SDL2 - adwaita-icon-theme - cairo - curl - exiv2 - glib - glib-networking - gmic - graphicsmagick - gtk3 - icu - ilmbase - isocodes - jasper - json-glib - lcms2 - lensfun - lerc - libaom - #libavif # TODO re-enable once cmake files are fixed (#425306) - libdatrie - libepoxy - libexif - libgcrypt - libgpg-error - libgphoto2 - libheif - libjpeg - libjxl - libpng - librsvg - libsecret - libsysprof-capture - libthai - libtiff - libwebp - libxml2 - lua - openexr - openjpeg - osm-gps-map - pcre2 - portmidi - pugixml - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - colord - colord-gtk - libselinux - libsepol - libX11 - libXdmcp - libxkbcommon - libXtst - ocl-icd - util-linux - ] - ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration - ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; + buildInputs = [ + SDL2 + adwaita-icon-theme + cairo + curl + exiv2 + glib + glib-networking + gmic + graphicsmagick + gtk3 + icu + ilmbase + isocodes + jasper + json-glib + lcms2 + lensfun + lerc + libaom + #libavif # TODO re-enable once cmake files are fixed (#425306) + libdatrie + libepoxy + libexif + libgcrypt + libgpg-error + libgphoto2 + libheif + libjpeg + libjxl + libpng + librsvg + libsecret + libsysprof-capture + libthai + libtiff + libwebp + libxml2 + lua + openexr + openjpeg + osm-gps-map + pcre2 + portmidi + pugixml + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + colord + colord-gtk + libselinux + libsepol + libX11 + libXdmcp + libxkbcommon + libXtst + ocl-icd + util-linux + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; - cmakeFlags = - [ - "-DBUILD_USERMANUAL=False" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DUSE_COLORD=OFF" - "-DUSE_KWALLET=OFF" - ]; + cmakeFlags = [ + "-DBUILD_USERMANUAL=False" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DUSE_COLORD=OFF" + "-DUSE_KWALLET=OFF" + ]; # darktable changed its rpath handling in commit # 83c70b876af6484506901e6b381304ae0d073d3c and as a result the diff --git a/pkgs/by-name/da/darling-dmg/package.nix b/pkgs/by-name/da/darling-dmg/package.nix index e33350d939a4..0e6072e4e841 100644 --- a/pkgs/by-name/da/darling-dmg/package.nix +++ b/pkgs/by-name/da/darling-dmg/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation { libxml2 icu lzfse - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; CXXFLAGS = [ "-DCOMPILE_WITH_LZFSE=1" diff --git a/pkgs/by-name/da/dartsim/package.nix b/pkgs/by-name/da/dartsim/package.nix index 7345cee85d4a..e0a1b0627708 100644 --- a/pkgs/by-name/da/dartsim/package.nix +++ b/pkgs/by-name/da/dartsim/package.nix @@ -85,43 +85,41 @@ stdenv.mkDerivation (finalAttrs: { >> python/dartpy/CMakeLists.txt ''; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pybind11 - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pybind11 + ]; - propagatedBuildInputs = - [ - blas - boost - assimp - bullet - eigen - fcl - fmt - libglut - gbenchmark - nlopt - # requires imgui_impl_opengl2.h - (imgui.override { IMGUI_BUILD_OPENGL2_BINDING = true; }) - ipopt - lapack - libGL - libGLU - ode - openscenegraph - pagmo2 - tinyxml-2 - urdfdom - ] - ++ lib.optionals pythonSupport [ - python3Packages.numpy - ]; + propagatedBuildInputs = [ + blas + boost + assimp + bullet + eigen + fcl + fmt + libglut + gbenchmark + nlopt + # requires imgui_impl_opengl2.h + (imgui.override { IMGUI_BUILD_OPENGL2_BINDING = true; }) + ipopt + lapack + libGL + libGLU + ode + openscenegraph + pagmo2 + tinyxml-2 + urdfdom + ] + ++ lib.optionals pythonSupport [ + python3Packages.numpy + ]; checkInputs = [ gbenchmark diff --git a/pkgs/by-name/da/dasher/package.nix b/pkgs/by-name/da/dasher/package.nix index dadc218e6fd1..fb3456dbd295 100644 --- a/pkgs/by-name/da/dasher/package.nix +++ b/pkgs/by-name/da/dasher/package.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation { # at-spi2 needs dbus to be recognized by pkg-config at-spi2-core dbus - ] ++ lib.optional speechSupport speechd-minimal; + ] + ++ lib.optional speechSupport speechd-minimal; enableParallelBuilding = true; diff --git a/pkgs/by-name/da/dav1d/package.nix b/pkgs/by-name/da/dav1d/package.nix index fdd843312685..9fb04cd742f0 100644 --- a/pkgs/by-name/da/dav1d/package.nix +++ b/pkgs/by-name/da/dav1d/package.nix @@ -48,14 +48,15 @@ stdenv.mkDerivation rec { pkg-config ]; # TODO: doxygen (currently only HTML and not build by default). - buildInputs = - [ xxHash ] - ++ lib.optional withExamples SDL2 - ++ lib.optionals useVulkan [ - libplacebo - vulkan-loader - vulkan-headers - ]; + buildInputs = [ + xxHash + ] + ++ lib.optional withExamples SDL2 + ++ lib.optionals useVulkan [ + libplacebo + vulkan-loader + vulkan-headers + ]; mesonFlags = [ "-Denable_tools=${lib.boolToString withTools}" diff --git a/pkgs/by-name/da/davix/package.nix b/pkgs/by-name/da/davix/package.nix index dd29f9f561b0..8af041600482 100644 --- a/pkgs/by-name/da/davix/package.nix +++ b/pkgs/by-name/da/davix/package.nix @@ -34,16 +34,15 @@ stdenv.mkDerivation rec { pkg-config python3 ]; - buildInputs = - [ - boost - curl - libxml2 - openssl - rapidjson - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid - ++ lib.optional (enableThirdPartyCopy) gsoap; + buildInputs = [ + boost + curl + libxml2 + openssl + rapidjson + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid + ++ lib.optional (enableThirdPartyCopy) gsoap; # using the url below since the github release page states # "please ignore the GitHub-generated tarballs, as they are incomplete" diff --git a/pkgs/by-name/db/dbd/package.nix b/pkgs/by-name/db/dbd/package.nix index d7c2b69649fc..e2b450265cec 100644 --- a/pkgs/by-name/db/dbd/package.nix +++ b/pkgs/by-name/db/dbd/package.nix @@ -15,13 +15,12 @@ stdenv.mkDerivation { hash = "sha256-b2yBZ2/Ab+SviKNlyZgdfiZ7GGZ1sonZnblD0i+vuFw="; }; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - "CC=${stdenv.cc.targetPrefix}cc" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "darwin" ] - ++ lib.optionals (stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isDarwin) [ "unix" ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "CC=${stdenv.cc.targetPrefix}cc" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "darwin" ] + ++ lib.optionals (stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isDarwin) [ "unix" ]; meta = with lib; { description = "Netcat-clone, designed to be portable and offer strong encryption"; diff --git a/pkgs/by-name/db/dbeaver-bin/package.nix b/pkgs/by-name/db/dbeaver-bin/package.nix index f65d9751c069..017e50983efa 100644 --- a/pkgs/by-name/db/dbeaver-bin/package.nix +++ b/pkgs/by-name/db/dbeaver-bin/package.nix @@ -44,44 +44,43 @@ stdenvNoCC.mkDerivation (finalAttrs: { sourceRoot = lib.optional stdenvNoCC.hostPlatform.isDarwin "DBeaver.app"; - nativeBuildInputs = - [ makeWrapper ] - ++ lib.optionals (!stdenvNoCC.hostPlatform.isDarwin) [ - gnused - wrapGAppsHook3 - autoPatchelfHook - ] - ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ - undmg - autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals (!stdenvNoCC.hostPlatform.isDarwin) [ + gnused + wrapGAppsHook3 + autoPatchelfHook + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ + undmg + autoSignDarwinBinariesHook + ]; dontConfigure = true; dontBuild = true; - prePatch = - '' - substituteInPlace ${lib.optionalString stdenvNoCC.hostPlatform.isDarwin "Contents/Eclipse/"}dbeaver.ini \ - --replace-fail '-Xmx1024m' '-Xmx${override_xmx}' - '' - # remove the bundled JRE configuration on Darwin - # dont use substituteInPlace here because it would match "-vmargs" - + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' - sed -i -e '/^-vm$/ { N; d; }' Contents/Eclipse/dbeaver.ini - ''; + prePatch = '' + substituteInPlace ${lib.optionalString stdenvNoCC.hostPlatform.isDarwin "Contents/Eclipse/"}dbeaver.ini \ + --replace-fail '-Xmx1024m' '-Xmx${override_xmx}' + '' + # remove the bundled JRE configuration on Darwin + # dont use substituteInPlace here because it would match "-vmargs" + + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' + sed -i -e '/^-vm$/ { N; d; }' Contents/Eclipse/dbeaver.ini + ''; - preInstall = - '' - # most directories are for different architectures, only keep what we need - shopt -s extglob - pushd ${lib.optionalString stdenvNoCC.hostPlatform.isDarwin "Contents/Eclipse/"}plugins/com.sun.jna_*/com/sun/jna/ - rm -r !(ptr|internal|linux-x86-64|linux-aarch64|darwin-x86-64|darwin-aarch64)/ - popd - '' - # remove the bundled JRE on Darwin - + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' - rm -r Contents/Eclipse/jre/ - ''; + preInstall = '' + # most directories are for different architectures, only keep what we need + shopt -s extglob + pushd ${lib.optionalString stdenvNoCC.hostPlatform.isDarwin "Contents/Eclipse/"}plugins/com.sun.jna_*/com/sun/jna/ + rm -r !(ptr|internal|linux-x86-64|linux-aarch64|darwin-x86-64|darwin-aarch64)/ + popd + '' + # remove the bundled JRE on Darwin + + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' + rm -r Contents/Eclipse/jre/ + ''; installPhase = if !stdenvNoCC.hostPlatform.isDarwin then diff --git a/pkgs/by-name/db/dblatex/package.nix b/pkgs/by-name/db/dblatex/package.nix index a73f0b92771c..3bed1f8cc05f 100644 --- a/pkgs/by-name/db/dblatex/package.nix +++ b/pkgs/by-name/db/dblatex/package.nix @@ -62,42 +62,40 @@ stdenv.mkDerivation rec { sha256 = "0yd09nypswy3q4scri1dg7dr99d7gd6r2dwx0xm81l9f4y32gs0n"; }; - buildInputs = - [ - python311 - libxslt - tex - ] - ++ lib.optionals enableAllFeatures [ - imagemagick - fig2dev - ]; + buildInputs = [ + python311 + libxslt + tex + ] + ++ lib.optionals enableAllFeatures [ + imagemagick + fig2dev + ]; # TODO: dblatex tries to execute texindy command, but nixpkgs doesn't have # that yet. In Ubuntu, texindy is a part of the xindy package. - preConfigure = - '' - sed -i 's|self.install_layout == "deb"|False|' setup.py - '' - + lib.optionalString enableAllFeatures '' - for file in $(find -name "*.py"); do - sed -e 's|cmd = \["xsltproc|cmd = \["${libxslt.bin}/bin/xsltproc|g' \ - -e 's|Popen(\["xsltproc|Popen(\["${libxslt.bin}/bin/xsltproc|g' \ - -e 's|cmd = \["texindy|cmd = ["nixpkgs_is_missing_texindy|g' \ - -e 's|cmd = "epstopdf|cmd = "${tex}/bin/epstopdf|g' \ - -e 's|cmd = \["makeindex|cmd = ["${tex}/bin/makeindex|g' \ - -e 's|doc.program = "pdflatex"|doc.program = "${tex}/bin/pdflatex"|g' \ - -e 's|self.program = "latex"|self.program = "${tex}/bin/latex"|g' \ - -e 's|Popen("pdflatex|Popen("${tex}/bin/pdflatex|g' \ - -e 's|"fc-match"|"${fontconfig.bin}/bin/fc-match"|g' \ - -e 's|"fc-list"|"${fontconfig.bin}/bin/fc-list"|g' \ - -e 's|cmd = "inkscape|cmd = "${inkscape}/bin/inkscape|g' \ - -e 's|cmd = "fig2dev|cmd = "${fig2dev}/bin/fig2dev|g' \ - -e 's|cmd = \["ps2pdf|cmd = ["${ghostscript}/bin/ps2pdf|g' \ - -e 's|cmd = "convert|cmd = "${imagemagick.out}/bin/convert|g' \ - -i "$file" - done - ''; + preConfigure = '' + sed -i 's|self.install_layout == "deb"|False|' setup.py + '' + + lib.optionalString enableAllFeatures '' + for file in $(find -name "*.py"); do + sed -e 's|cmd = \["xsltproc|cmd = \["${libxslt.bin}/bin/xsltproc|g' \ + -e 's|Popen(\["xsltproc|Popen(\["${libxslt.bin}/bin/xsltproc|g' \ + -e 's|cmd = \["texindy|cmd = ["nixpkgs_is_missing_texindy|g' \ + -e 's|cmd = "epstopdf|cmd = "${tex}/bin/epstopdf|g' \ + -e 's|cmd = \["makeindex|cmd = ["${tex}/bin/makeindex|g' \ + -e 's|doc.program = "pdflatex"|doc.program = "${tex}/bin/pdflatex"|g' \ + -e 's|self.program = "latex"|self.program = "${tex}/bin/latex"|g' \ + -e 's|Popen("pdflatex|Popen("${tex}/bin/pdflatex|g' \ + -e 's|"fc-match"|"${fontconfig.bin}/bin/fc-match"|g' \ + -e 's|"fc-list"|"${fontconfig.bin}/bin/fc-list"|g' \ + -e 's|cmd = "inkscape|cmd = "${inkscape}/bin/inkscape|g' \ + -e 's|cmd = "fig2dev|cmd = "${fig2dev}/bin/fig2dev|g' \ + -e 's|cmd = \["ps2pdf|cmd = ["${ghostscript}/bin/ps2pdf|g' \ + -e 's|cmd = "convert|cmd = "${imagemagick.out}/bin/convert|g' \ + -i "$file" + done + ''; dontBuild = true; diff --git a/pkgs/by-name/db/dbmonster/package.nix b/pkgs/by-name/db/dbmonster/package.nix index 1adfad927850..c3f14969a9cd 100644 --- a/pkgs/by-name/db/dbmonster/package.nix +++ b/pkgs/by-name/db/dbmonster/package.nix @@ -21,17 +21,16 @@ python3.pkgs.buildPythonApplication { hash = "sha256-9RP3LmZF7P2c0+Jt/kMSVPb4cBtyH6P3FZ5UrQpBP0I="; }; - propagatedBuildInputs = - [ - aircrack-ng - iproute2 - networkmanager - tshark - wirelesstools - ] - ++ (with python3.pkgs; [ - matplotlib - ]); + propagatedBuildInputs = [ + aircrack-ng + iproute2 + networkmanager + tshark + wirelesstools + ] + ++ (with python3.pkgs; [ + matplotlib + ]); dontBuild = true; diff --git a/pkgs/by-name/db/dbqn/package.nix b/pkgs/by-name/db/dbqn/package.nix index 81be3e7141ff..0787eaa8ac39 100644 --- a/pkgs/by-name/db/dbqn/package.nix +++ b/pkgs/by-name/db/dbqn/package.nix @@ -29,47 +29,45 @@ stdenv.mkDerivation rec { patchShebangs --build ./build8 ''; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - ./build8 - '' - + lib.optionalString buildNativeImage '' - native-image --report-unsupported-elements-at-runtime \ - -H:CLibraryPath=${lib.getLib jdk}/lib -J-Dfile.encoding=UTF-8 \ - -jar BQN.jar dbqn - '' - + '' - runHook postBuild - ''; + ./build8 + '' + + lib.optionalString buildNativeImage '' + native-image --report-unsupported-elements-at-runtime \ + -H:CLibraryPath=${lib.getLib jdk}/lib -J-Dfile.encoding=UTF-8 \ + -jar BQN.jar dbqn + '' + + '' + runHook postBuild + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin + mkdir -p $out/bin - '' - + ( - if buildNativeImage then - '' - mv dbqn $out/bin - '' - else - '' - mkdir -p $out/share/dbqn - mv BQN.jar $out/share/dbqn/ + '' + + ( + if buildNativeImage then + '' + mv dbqn $out/bin + '' + else + '' + mkdir -p $out/share/dbqn + mv BQN.jar $out/share/dbqn/ - makeWrapper "${lib.getBin jdk}/bin/java" "$out/bin/dbqn" \ - --add-flags "-jar $out/share/dbqn/BQN.jar" - '' - ) - + '' - ln -s $out/bin/dbqn $out/bin/bqn + makeWrapper "${lib.getBin jdk}/bin/java" "$out/bin/dbqn" \ + --add-flags "-jar $out/share/dbqn/BQN.jar" + '' + ) + + '' + ln -s $out/bin/dbqn $out/bin/bqn - runHook postInstall - ''; + runHook postInstall + ''; meta = with lib; { homepage = "https://github.com/dzaima/BQN"; diff --git a/pkgs/by-name/db/dbus-cpp/package.nix b/pkgs/by-name/db/dbus-cpp/package.nix index 976125f91625..d00ffc4d1e84 100644 --- a/pkgs/by-name/db/dbus-cpp/package.nix +++ b/pkgs/by-name/db/dbus-cpp/package.nix @@ -35,23 +35,22 @@ stdenv.mkDerivation (finalAttrs: { "examples" ]; - postPatch = - '' - substituteInPlace doc/CMakeLists.txt \ - --replace-fail 'DESTINATION share/''${CMAKE_PROJECT_NAME}/doc' 'DESTINATION ''${CMAKE_INSTALL_DOCDIR}' + postPatch = '' + substituteInPlace doc/CMakeLists.txt \ + --replace-fail 'DESTINATION share/''${CMAKE_PROJECT_NAME}/doc' 'DESTINATION ''${CMAKE_INSTALL_DOCDIR}' - # Warning on aarch64-linux breaks build due to -Werror - substituteInPlace CMakeLists.txt \ - --replace-fail '-Werror' "" + # Warning on aarch64-linux breaks build due to -Werror + substituteInPlace CMakeLists.txt \ + --replace-fail '-Werror' "" - # pkg-config output patching hook expects prefix variable here - substituteInPlace data/dbus-cpp.pc.in \ - --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'add_subdirectory(tests)' '# add_subdirectory(tests)' - ''; + # pkg-config output patching hook expects prefix variable here + substituteInPlace data/dbus-cpp.pc.in \ + --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(tests)' '# add_subdirectory(tests)' + ''; strictDeps = true; diff --git a/pkgs/by-name/db/dbus-glib/package.nix b/pkgs/by-name/db/dbus-glib/package.nix index e5e4854aadbd..ba2029a5ec91 100644 --- a/pkgs/by-name/db/dbus-glib/package.nix +++ b/pkgs/by-name/db/dbus-glib/package.nix @@ -43,11 +43,12 @@ stdenv.mkDerivation rec { glib ]; - configureFlags = - [ "--exec-prefix=${placeholder "dev"}" ] - ++ lib.optional ( - stdenv.buildPlatform != stdenv.hostPlatform - ) "--with-dbus-binding-tool=${buildPackages.dbus-glib.dev}/bin/dbus-binding-tool"; + configureFlags = [ + "--exec-prefix=${placeholder "dev"}" + ] + ++ lib.optional ( + stdenv.buildPlatform != stdenv.hostPlatform + ) "--with-dbus-binding-tool=${buildPackages.dbus-glib.dev}/bin/dbus-binding-tool"; doCheck = false; diff --git a/pkgs/by-name/db/dbus_cplusplus/package.nix b/pkgs/by-name/db/dbus_cplusplus/package.nix index 34094c14ba6d..449987a8db6a 100644 --- a/pkgs/by-name/db/dbus_cplusplus/package.nix +++ b/pkgs/by-name/db/dbus_cplusplus/package.nix @@ -66,14 +66,13 @@ stdenv.mkDerivation rec { expat ]; - configureFlags = - [ - "--disable-ecore" - "--disable-tests" - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "--disable-examples" - ]; + configureFlags = [ + "--disable-ecore" + "--disable-tests" + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "--disable-examples" + ]; meta = with lib; { homepage = "https://dbus-cplusplus.sourceforge.net"; diff --git a/pkgs/by-name/db/dbx/package.nix b/pkgs/by-name/db/dbx/package.nix index 2864b1acb388..b27f0ccfff09 100644 --- a/pkgs/by-name/db/dbx/package.nix +++ b/pkgs/by-name/db/dbx/package.nix @@ -25,7 +25,8 @@ let disabledTestPaths = [ # Requires python-on-whales "tests/autobahn/test_autobahn.py" - ] ++ (old.disabledTestPaths or [ ]); + ] + ++ (old.disabledTestPaths or [ ]); }); databricks-sdk = super.databricks-sdk.overridePythonAttrs (old: { @@ -109,20 +110,19 @@ python.pkgs.buildPythonApplication rec { gcp = [ google-cloud-storage ]; }; - nativeCheckInputs = - [ - addBinToPathHook - gitMinimal - versionCheckHook - writableTmpDirAsHomeHook - ] - ++ (with python.pkgs; [ - pytest-asyncio - pytest-mock - pytest-timeout - pytest-xdist - pytestCheckHook - ]); + nativeCheckInputs = [ + addBinToPathHook + gitMinimal + versionCheckHook + writableTmpDirAsHomeHook + ] + ++ (with python.pkgs; [ + pytest-asyncio + pytest-mock + pytest-timeout + pytest-xdist + pytestCheckHook + ]); versionCheckProgramArg = "--version"; disabledTests = [ diff --git a/pkgs/by-name/dc/dclxvi/package.nix b/pkgs/by-name/dc/dclxvi/package.nix index 870cf8a211a1..307ea58f8c7d 100644 --- a/pkgs/by-name/dc/dclxvi/package.nix +++ b/pkgs/by-name/dc/dclxvi/package.nix @@ -17,15 +17,14 @@ stdenv.mkDerivation { buildFlags = [ "libdclxvipairing.so" ]; - patchPhase = - '' - substituteInPlace Makefile \ - --replace "gcc" "cc" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Makefile \ - --replace "-soname=libdclxvipairing.so" "-install_name,libdclxvipairing.so" - ''; + patchPhase = '' + substituteInPlace Makefile \ + --replace "gcc" "cc" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Makefile \ + --replace "-soname=libdclxvipairing.so" "-install_name,libdclxvipairing.so" + ''; installPhase = '' mkdir -p $out/{include,lib} diff --git a/pkgs/by-name/dc/dconf/package.nix b/pkgs/by-name/dc/dconf/package.nix index 547295d2a96e..916d5551f93c 100644 --- a/pkgs/by-name/dc/dconf/package.nix +++ b/pkgs/by-name/dc/dconf/package.nix @@ -33,38 +33,37 @@ stdenv.mkDerivation rec { "out" "lib" "dev" - ] ++ lib.optional withDocs "devdoc"; + ] + ++ lib.optional withDocs "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "0cs5nayg080y8pb9b7qccm1ni8wkicdmqp1jsgc22110r6j24zyg"; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - libxslt - glib - docbook-xsl-nons - docbook_xml_dtd_42 - gtk-doc - ] - ++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook # gtkdoc invokes the host binary to produce documentation - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + libxslt + glib + docbook-xsl-nons + docbook_xml_dtd_42 + gtk-doc + ] + ++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook # gtkdoc invokes the host binary to produce documentation + ]; - buildInputs = - [ - glib - bash-completion - dbus - ] - ++ lib.optionals withIntrospection [ - vala - ]; + buildInputs = [ + glib + bash-completion + dbus + ] + ++ lib.optionals withIntrospection [ + vala + ]; mesonFlags = [ "--sysconfdir=/etc" diff --git a/pkgs/by-name/dd/ddd/package.nix b/pkgs/by-name/dd/ddd/package.nix index f33f08825799..e6a90e53b518 100644 --- a/pkgs/by-name/dd/ddd/package.nix +++ b/pkgs/by-name/dd/ddd/package.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ imagemagick - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ motif diff --git a/pkgs/by-name/dd/ddm/package.nix b/pkgs/by-name/dd/ddm/package.nix index 5d8e10e52412..c5884aa7779b 100644 --- a/pkgs/by-name/dd/ddm/package.nix +++ b/pkgs/by-name/dd/ddm/package.nix @@ -36,38 +36,37 @@ stdenvNoCC.mkDerivation (finalAttrs: { dontConfigure = true; dontBuild = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/{bin,share/icons/hicolor/512x512/apps,share/ddm} + mkdir -p $out/{bin,share/icons/hicolor/512x512/apps,share/ddm} - asar extract ./resources/app.asar $out/share/ddm/ + asar extract ./resources/app.asar $out/share/ddm/ - patch -d $out/share/ddm/ -p1 < ${./0001-Make-findPath-its-calls-behave-well-with-store.patch} + patch -d $out/share/ddm/ -p1 < ${./0001-Make-findPath-its-calls-behave-well-with-store.patch} - ln -s $out/share/ddm/icon.png $out/share/icons/hicolor/512x512/apps/ddm.png + ln -s $out/share/ddm/icon.png $out/share/icons/hicolor/512x512/apps/ddm.png - makeWrapper ${lib.getExe electron} $out/bin/ddm \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --add-flags "$out/share/ddm" + makeWrapper ${lib.getExe electron} $out/bin/ddm \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --add-flags "$out/share/ddm" - # Install externally-downloaded campaign packs and cube & constructed lists - mkdir $out/share/ddm/{campaigns,cubes,constructed} - '' - + lib.concatMapStringsSep "\n" (campaignZip: '' - unzip "${campaignZip}" -d $out/share/ddm/campaigns/ - '') campaigns - + lib.concatMapStringsSep "\n" (cubeFile: '' - cp "${cubeFile}" $out/share/ddm/cubes/ - '') cubes - + lib.concatMapStringsSep "\n" (constructedFile: '' - cp "${constructedFile}" $out/share/ddm/constructed/ - '') constructed - + '' + # Install externally-downloaded campaign packs and cube & constructed lists + mkdir $out/share/ddm/{campaigns,cubes,constructed} + '' + + lib.concatMapStringsSep "\n" (campaignZip: '' + unzip "${campaignZip}" -d $out/share/ddm/campaigns/ + '') campaigns + + lib.concatMapStringsSep "\n" (cubeFile: '' + cp "${cubeFile}" $out/share/ddm/cubes/ + '') cubes + + lib.concatMapStringsSep "\n" (constructedFile: '' + cp "${constructedFile}" $out/share/ddm/constructed/ + '') constructed + + '' - runHook postInstall - ''; + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/dd/ddnet/package.nix b/pkgs/by-name/dd/ddnet/package.nix index 0160e308bd06..d32acac05923 100644 --- a/pkgs/by-name/dd/ddnet/package.nix +++ b/pkgs/by-name/dd/ddnet/package.nix @@ -59,33 +59,32 @@ stdenv.mkDerivation rec { gtest ]; - buildInputs = + buildInputs = [ + curl + libnotify + pcre + python3 + sqlite + ] + ++ lib.optionals buildClient ( [ - curl - libnotify - pcre - python3 - sqlite + freetype + libGLU + libogg + opusfile + SDL2 + wavpack + ffmpeg + x264 + vulkan-loader + vulkan-headers + glslang + spirv-tools ] - ++ lib.optionals buildClient ( - [ - freetype - libGLU - libogg - opusfile - SDL2 - wavpack - ffmpeg - x264 - vulkan-loader - vulkan-headers - glslang - spirv-tools - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - ] - ); + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + ] + ); postPatch = '' substituteInPlace src/engine/shared/storage.cpp \ diff --git a/pkgs/by-name/de/debian-devscripts/package.nix b/pkgs/by-name/de/debian-devscripts/package.nix index f276a0d33477..8ab67d35da14 100644 --- a/pkgs/by-name/de/debian-devscripts/package.nix +++ b/pkgs/by-name/de/debian-devscripts/package.nix @@ -61,34 +61,33 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - xz - dpkg - libxslt - python - setuptools - curl - gnupg - diffutils - bash-completion - help2man - ] - ++ (with perlPackages; [ - perl - CryptSSLeay - LWP - TimeDate - DBFile - FileDesktopEntry - ParseDebControl - LWPProtocolHttps - Moo - FileHomeDir - IPCRun - FileDirList - FileTouch - ]); + buildInputs = [ + xz + dpkg + libxslt + python + setuptools + curl + gnupg + diffutils + bash-completion + help2man + ] + ++ (with perlPackages; [ + perl + CryptSSLeay + LWP + TimeDate + DBFile + FileDesktopEntry + ParseDebControl + LWPProtocolHttps + Moo + FileHomeDir + IPCRun + FileDirList + FileTouch + ]); preConfigure = '' export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}${dpkg}"; diff --git a/pkgs/by-name/de/delly/package.nix b/pkgs/by-name/de/delly/package.nix index cb5f86e2ef25..c29ee7023e18 100644 --- a/pkgs/by-name/de/delly/package.nix +++ b/pkgs/by-name/de/delly/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation (finalAttrs: { htslib xz zlib - ] ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; makeFlags = [ "EBROOTHTSLIB=${htslib}" diff --git a/pkgs/by-name/de/delta/package.nix b/pkgs/by-name/de/delta/package.nix index 4df4d0922678..f9e2184515c1 100644 --- a/pkgs/by-name/de/delta/package.nix +++ b/pkgs/by-name/de/delta/package.nix @@ -29,13 +29,12 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - oniguruma - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - zlib - ]; + buildInputs = [ + oniguruma + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + zlib + ]; nativeCheckInputs = [ git ]; diff --git a/pkgs/by-name/de/deltachat-desktop/package.nix b/pkgs/by-name/de/deltachat-desktop/package.nix index ee3c55ae5a74..106319a9d8dd 100644 --- a/pkgs/by-name/de/deltachat-desktop/package.nix +++ b/pkgs/by-name/de/deltachat-desktop/package.nix @@ -52,18 +52,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-PBCmyNmlH88y5s7+8WHcei8SP3Q0lIAAnAQn9uaFxLc="; }; - nativeBuildInputs = - [ - yq - makeWrapper - nodejs - pkg-config - pnpm.configHook - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - copyDesktopItems - ]; + nativeBuildInputs = [ + yq + makeWrapper + nodejs + pkg-config + pnpm.configHook + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + copyDesktopItems + ]; env = { ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; diff --git a/pkgs/by-name/de/deno/package.nix b/pkgs/by-name/de/deno/package.nix index 5ece4a05954e..3bbed1488729 100644 --- a/pkgs/by-name/de/deno/package.nix +++ b/pkgs/by-name/de/deno/package.nix @@ -47,20 +47,19 @@ rustPlatform.buildRustPackage (finalAttrs: { ./tests-darwin-differences.patch ./tests-no-chown.patch ]; - postPatch = - '' - # Use patched nixpkgs libffi in order to fix https://github.com/libffi/libffi/pull/857 - tomlq -ti '.workspace.dependencies.libffi = { "version": .workspace.dependencies.libffi, "features": ["system"] }' Cargo.toml - '' - + - lib.optionalString - (stdenv.hostPlatform.isLinux || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64)) - '' - # LTO crashes with the latest Rust + LLVM combination. - # https://github.com/rust-lang/rust/issues/141737 - # TODO: remove this once LLVM is upgraded to 20.1.7 - tomlq -ti '.profile.release.lto = false' Cargo.toml - ''; + postPatch = '' + # Use patched nixpkgs libffi in order to fix https://github.com/libffi/libffi/pull/857 + tomlq -ti '.workspace.dependencies.libffi = { "version": .workspace.dependencies.libffi, "features": ["system"] }' Cargo.toml + '' + + + lib.optionalString + (stdenv.hostPlatform.isLinux || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64)) + '' + # LTO crashes with the latest Rust + LLVM combination. + # https://github.com/rust-lang/rust/issues/141737 + # TODO: remove this once LLVM is upgraded to 20.1.7 + tomlq -ti '.profile.release.lto = false' Cargo.toml + ''; buildInputs = [ libffi @@ -78,7 +77,8 @@ rustPlatform.buildRustPackage (finalAttrs: { # required by deno_kv crate protobuf installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ lld ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ lld ]; configureFlags = lib.optionals stdenv.cc.isClang [ # This never worked with clang, but became a hard error recently: https://github.com/llvm/llvm-project/commit/3d5b610c864c8f5980eaa16c22b71ff1cf462fae @@ -140,48 +140,47 @@ rustPlatform.buildRustPackage (finalAttrs: { # - https://github.com/denoland/deno/blob/2212d7d814914e43f43dfd945ee24197f50fa6fa/tests/Cargo.toml#L25 # - https://github.com/denoland/file_test_runner/blob/9c78319a4e4c6180dde0e9e6c2751017176e65c9/src/collection/mod.rs#L49 ]; - checkFlags = - [ - # Internet access - "--skip=check::ts_no_recheck_on_redirect" - "--skip=js_unit_tests::quic_test" - "--skip=js_unit_tests::net_test" - "--skip=node_unit_tests::http_test" - "--skip=node_unit_tests::http2_test" - "--skip=node_unit_tests::net_test" - "--skip=node_unit_tests::tls_test" - "--skip=npm::lock_file_lock_write" + checkFlags = [ + # Internet access + "--skip=check::ts_no_recheck_on_redirect" + "--skip=js_unit_tests::quic_test" + "--skip=js_unit_tests::net_test" + "--skip=node_unit_tests::http_test" + "--skip=node_unit_tests::http2_test" + "--skip=node_unit_tests::net_test" + "--skip=node_unit_tests::tls_test" + "--skip=npm::lock_file_lock_write" - # GPU access - "--skip=js_unit_tests::webgpu_test" - "--skip=js_unit_tests::jupyter_test" + # GPU access + "--skip=js_unit_tests::webgpu_test" + "--skip=js_unit_tests::jupyter_test" - # Use of /usr/bin - "--skip=specs::permission::proc_self_fd" + # Use of /usr/bin + "--skip=specs::permission::proc_self_fd" - # Flaky - "--skip=init::init_subcommand_serve" - "--skip=serve::deno_serve_parallel" - "--skip=js_unit_tests::stat_test" # timing-sensitive - "--skip=repl::pty_complete_imports" - "--skip=repl::pty_complete_expression" + # Flaky + "--skip=init::init_subcommand_serve" + "--skip=serve::deno_serve_parallel" + "--skip=js_unit_tests::stat_test" # timing-sensitive + "--skip=repl::pty_complete_imports" + "--skip=repl::pty_complete_expression" - # Test hangs, needs investigation - "--skip=repl::pty_complete_imports_no_panic_empty_specifier" + # Test hangs, needs investigation + "--skip=repl::pty_complete_imports_no_panic_empty_specifier" - # Use of VSOCK, might not be available on all platforms - "--skip=js_unit_tests::serve_test" - "--skip=js_unit_tests::fetch_test" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Expects specific shared libraries from macOS to be linked - "--skip=shared_library_tests::macos_shared_libraries" + # Use of VSOCK, might not be available on all platforms + "--skip=js_unit_tests::serve_test" + "--skip=js_unit_tests::fetch_test" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Expects specific shared libraries from macOS to be linked + "--skip=shared_library_tests::macos_shared_libraries" - # Darwin sandbox issues - "--skip=watcher" - "--skip=node_unit_tests::_fs_watch_test" - "--skip=js_unit_tests::fs_events_test" - ]; + # Darwin sandbox issues + "--skip=watcher" + "--skip=node_unit_tests::_fs_watch_test" + "--skip=js_unit_tests::fs_events_test" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/by-name/de/descent3-unwrapped/package.nix b/pkgs/by-name/de/descent3-unwrapped/package.nix index e196bc59eb14..7bb77c678b71 100644 --- a/pkgs/by-name/de/descent3-unwrapped/package.nix +++ b/pkgs/by-name/de/descent3-unwrapped/package.nix @@ -152,6 +152,7 @@ stdenv.mkDerivation rec { # have any Darwin systems to test things on at the moment. # # [1]: - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; }; } diff --git a/pkgs/by-name/de/devpi-client/package.nix b/pkgs/by-name/de/devpi-client/package.nix index 22b8ad286aff..229a592e25b8 100644 --- a/pkgs/by-name/de/devpi-client/package.nix +++ b/pkgs/by-name/de/devpi-client/package.nix @@ -36,21 +36,20 @@ python3.pkgs.buildPythonApplication rec { platformdirs ]; - nativeCheckInputs = - [ - devpi-server - git - ] - ++ (with python3.pkgs; [ - mercurial - mock - pypitoken - pytestCheckHook - sphinx - virtualenv - webtest - wheel - ]); + nativeCheckInputs = [ + devpi-server + git + ] + ++ (with python3.pkgs; [ + mercurial + mock + pypitoken + pytestCheckHook + sphinx + virtualenv + webtest + wheel + ]); preCheck = '' export HOME=$(mktemp -d); diff --git a/pkgs/by-name/de/dexed/package.nix b/pkgs/by-name/de/dexed/package.nix index 93e607a1f927..542526820a23 100644 --- a/pkgs/by-name/de/dexed/package.nix +++ b/pkgs/by-name/de/dexed/package.nix @@ -27,19 +27,18 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-mXr1KGzA+DF2dEgAJE4lpnefPqO8pqfnKa43vyjSJgU="; }; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")' '# Not forcing output archs' + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")' '# Not forcing output archs' - substituteInPlace Source/CMakeLists.txt \ - --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' - '' - # LTO needs special setup on Linux - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace Source/CMakeLists.txt \ - --replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' - ''; + substituteInPlace Source/CMakeLists.txt \ + --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' + '' + # LTO needs special setup on Linux + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace Source/CMakeLists.txt \ + --replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' + ''; strictDeps = true; diff --git a/pkgs/by-name/dh/dhcpcd/package.nix b/pkgs/by-name/dh/dhcpcd/package.nix index d78024d5cdb3..9e29bb0dda0d 100644 --- a/pkgs/by-name/dh/dhcpcd/package.nix +++ b/pkgs/by-name/dh/dhcpcd/package.nix @@ -25,17 +25,16 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts - ] - ++ lib.optionals withUdev [ - udev - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - freebsd.libcapsicum - freebsd.libcasper - ]; + buildInputs = [ + runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts + ] + ++ lib.optionals withUdev [ + udev + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + freebsd.libcapsicum + freebsd.libcasper + ]; postPatch = '' substituteInPlace hooks/dhcpcd-run-hooks.in --replace /bin/sh ${runtimeShell} @@ -48,7 +47,8 @@ stdenv.mkDerivation rec { "--dbdir=/var/lib/dhcpcd" "--with-default-hostname=nixos" (lib.enableFeature enablePrivSep "privsep") - ] ++ lib.optional enablePrivSep "--privsepuser=dhcpcd"; + ] + ++ lib.optional enablePrivSep "--privsepuser=dhcpcd"; makeFlags = [ "PREFIX=${placeholder "out"}" ]; diff --git a/pkgs/by-name/di/dia/package.nix b/pkgs/by-name/di/dia/package.nix index fb9b8df29c84..2f6671196bfe 100644 --- a/pkgs/by-name/di/dia/package.nix +++ b/pkgs/by-name/di/dia/package.nix @@ -40,34 +40,32 @@ stdenv.mkDerivation { patchShebangs . ''; - buildInputs = - [ - graphene - gtk3 - (libxml2.override { zlibSupport = true; }) - python3 - poppler - ] - ++ lib.optionals withDocs [ - libxslt - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gtk-mac-integration-gtk3 - ]; + buildInputs = [ + graphene + gtk3 + (libxml2.override { zlibSupport = true; }) + python3 + poppler + ] + ++ lib.optionals withDocs [ + libxslt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gtk-mac-integration-gtk3 + ]; - nativeBuildInputs = - [ - appstream-glib - desktop-file-utils - intltool - meson - ninja - pkg-config - wrapGAppsHook3 - ] - ++ lib.optionals withDocs [ - dblatex - ]; + nativeBuildInputs = [ + appstream-glib + desktop-file-utils + intltool + meson + ninja + pkg-config + wrapGAppsHook3 + ] + ++ lib.optionals withDocs [ + dblatex + ]; meta = with lib; { description = "Gnome Diagram drawing software"; diff --git a/pkgs/by-name/di/dictu/package.nix b/pkgs/by-name/di/dictu/package.nix index c2a051c00895..7d818a8c0b93 100644 --- a/pkgs/by-name/di/dictu/package.nix +++ b/pkgs/by-name/di/dictu/package.nix @@ -27,12 +27,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - sqlite - ] - ++ lib.optional httpSupport curl - ++ lib.optional linenoiseSupport linenoise; + buildInputs = [ + sqlite + ] + ++ lib.optional httpSupport curl + ++ lib.optional linenoiseSupport linenoise; patches = [ ./0001-force-sqlite-to-be-found.patch @@ -43,17 +42,16 @@ stdenv.mkDerivation rec { -e 's/-flto/${lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation"}/' ''; - cmakeFlags = - [ - "-DBUILD_CLI=${if cliSupport then "ON" else "OFF"}" - "-DDISABLE_HTTP=${if httpSupport then "OFF" else "ON"}" - "-DDISABLE_LINENOISE=${if linenoiseSupport then "OFF" else "ON"}" - ] - ++ lib.optionals enableLTO [ - # TODO: LTO with LLVM - "-DCMAKE_AR=${stdenv.cc.cc}/bin/gcc-ar" - "-DCMAKE_RANLIB=${stdenv.cc.cc}/bin/gcc-ranlib" - ]; + cmakeFlags = [ + "-DBUILD_CLI=${if cliSupport then "ON" else "OFF"}" + "-DDISABLE_HTTP=${if httpSupport then "OFF" else "ON"}" + "-DDISABLE_LINENOISE=${if linenoiseSupport then "OFF" else "ON"}" + ] + ++ lib.optionals enableLTO [ + # TODO: LTO with LLVM + "-DCMAKE_AR=${stdenv.cc.cc}/bin/gcc-ar" + "-DCMAKE_RANLIB=${stdenv.cc.cc}/bin/gcc-ranlib" + ]; postBuild = '' cd .. # move out of cmakeBuildDir @@ -76,16 +74,15 @@ stdenv.mkDerivation rec { ./dictu tests/runTests.du ''; - installPhase = - '' - mkdir -p $out - cp -r src/include $out/include - mkdir -p $out/lib - cp build/src/libdictu_api* $out/lib - '' - + lib.optionalString cliSupport '' - install -Dm755 dictu $out/bin/dictu - ''; + installPhase = '' + mkdir -p $out + cp -r src/include $out/include + mkdir -p $out/lib + cp build/src/libdictu_api* $out/lib + '' + + lib.optionalString cliSupport '' + install -Dm755 dictu $out/bin/dictu + ''; meta = with lib; { description = "High-level dynamically typed, multi-paradigm, interpreted programming language"; diff --git a/pkgs/by-name/di/didyoumean/package.nix b/pkgs/by-name/di/didyoumean/package.nix index 6af7fdffe2d0..ec6989ed9c54 100644 --- a/pkgs/by-name/di/didyoumean/package.nix +++ b/pkgs/by-name/di/didyoumean/package.nix @@ -23,13 +23,12 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-BASM0gBQFuJY2ze9X9HJUkiP4WrOP/inD87bVFraeAY="; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libxcb diff --git a/pkgs/by-name/di/diesel-cli/package.nix b/pkgs/by-name/di/diesel-cli/package.nix index 0205540f90df..6ebbf22bf84b 100644 --- a/pkgs/by-name/di/diesel-cli/package.nix +++ b/pkgs/by-name/di/diesel-cli/package.nix @@ -43,14 +43,15 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optional sqliteSupport sqlite - ++ lib.optional postgresqlSupport libpq - ++ lib.optionals mysqlSupport [ - libmysqlclient - zlib - ]; + buildInputs = [ + openssl + ] + ++ lib.optional sqliteSupport sqlite + ++ lib.optional postgresqlSupport libpq + ++ lib.optionals mysqlSupport [ + libmysqlclient + zlib + ]; buildNoDefaultFeatures = true; buildFeatures = diff --git a/pkgs/by-name/di/diffoscope/package.nix b/pkgs/by-name/di/diffoscope/package.nix index 447d0d897621..792dc071f795 100644 --- a/pkgs/by-name/di/diffoscope/package.nix +++ b/pkgs/by-name/di/diffoscope/package.nix @@ -270,32 +270,31 @@ python.pkgs.buildPythonApplication rec { installManPage doc/diffoscope.1 ''; - disabledTests = - [ - "test_sbin_added_to_path" - "test_diff_meta" - "test_diff_meta2" + disabledTests = [ + "test_sbin_added_to_path" + "test_diff_meta" + "test_diff_meta2" - # Fails because it fails to determine llvm version - "test_item3_deflate_llvm_bitcode" + # Fails because it fails to determine llvm version + "test_item3_deflate_llvm_bitcode" - # Flaky test on Linux and Darwin - "test_non_unicode_filename" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Disable flaky tests on Darwin - "test_listing" - "test_symlink_root" + # Flaky test on Linux and Darwin + "test_non_unicode_filename" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Disable flaky tests on Darwin + "test_listing" + "test_symlink_root" - # Appears to be a sandbox related issue - "test_trim_stderr_in_command" - # Seems to be a bug caused by having different versions of rdata than - # expected. Will file upstream. - "test_item_rdb" - # Caused by getting an otool command instead of llvm-objdump. Could be Nix - # setup, could be upstream bug. Will file upstream. - "test_libmix_differences" - ]; + # Appears to be a sandbox related issue + "test_trim_stderr_in_command" + # Seems to be a bug caused by having different versions of rdata than + # expected. Will file upstream. + "test_item_rdb" + # Caused by getting an otool command instead of llvm-objdump. Could be Nix + # setup, could be upstream bug. Will file upstream. + "test_libmix_differences" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/comparators/test_git.py" diff --git a/pkgs/by-name/di/directfb/package.nix b/pkgs/by-name/di/directfb/package.nix index d2506fd97e81..00c91ce04745 100644 --- a/pkgs/by-name/di/directfb/package.nix +++ b/pkgs/by-name/di/directfb/package.nix @@ -56,21 +56,20 @@ stdenv.mkDerivation rec { }) ]; - postPatch = - '' - # https://github.com/deniskropp/DirectFB/blob/master/src/core/Makefile.am#L15 - # BUILDTIME is embedded in the result - # if switching to cmake then a similar substitution has to be done - substituteInPlace src/core/Makefile.am \ - --replace '`date -u "+%Y-%m-%d %H:%M"`' "`date -u \"+%Y-%m-%d %H:%M\" --date="@''${SOURCE_DATE_EPOCH}"`" - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - # Specifically patch out two drivers that have build errors with musl libc, - # while leaving the rest of the default selection enabled - substituteInPlace configure.in \ - --replace checkfor_lirc={yes,no} \ - --replace checkfor_matrox={yes,no} - ''; + postPatch = '' + # https://github.com/deniskropp/DirectFB/blob/master/src/core/Makefile.am#L15 + # BUILDTIME is embedded in the result + # if switching to cmake then a similar substitution has to be done + substituteInPlace src/core/Makefile.am \ + --replace '`date -u "+%Y-%m-%d %H:%M"`' "`date -u \"+%Y-%m-%d %H:%M\" --date="@''${SOURCE_DATE_EPOCH}"`" + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + # Specifically patch out two drivers that have build errors with musl libc, + # while leaving the rest of the default selection enabled + substituteInPlace configure.in \ + --replace checkfor_lirc={yes,no} \ + --replace checkfor_matrox={yes,no} + ''; nativeBuildInputs = [ autoreconfHook @@ -79,46 +78,43 @@ stdenv.mkDerivation rec { flux ]; - buildInputs = + buildInputs = [ + zlib + libjpeg + freetype + giflib + libpng + ] + ++ lib.optional enableSDL SDL + ++ lib.optionals enableX11 ( + with xorg; [ - zlib - libjpeg - freetype - giflib - libpng + xorgproto + libX11 + libXext + libXrender ] - ++ lib.optional enableSDL SDL - ++ lib.optionals enableX11 ( - with xorg; - [ - xorgproto - libX11 - libXext - libXrender - ] - ); + ); - env = - { - NIX_LDFLAGS = "-lgcc_s"; - } - // lib.optionalAttrs stdenv.cc.isGNU { - NIX_CFLAGS_COMPILE = "-fpermissive"; - }; + env = { + NIX_LDFLAGS = "-lgcc_s"; + } + // lib.optionalAttrs stdenv.cc.isGNU { + NIX_CFLAGS_COMPILE = "-fpermissive"; + }; - configureFlags = - [ - "--enable-sdl" - "--enable-zlib" - "--with-gfxdrivers=all" - "--enable-devmem" - "--enable-fbdev" - "--enable-mmx" - "--enable-sse" - "--with-software" - ] - ++ lib.optional (!stdenv.hostPlatform.isMusl) "--with-smooth-scaling" - ++ lib.optional enableX11 "--enable-x11"; + configureFlags = [ + "--enable-sdl" + "--enable-zlib" + "--with-gfxdrivers=all" + "--enable-devmem" + "--enable-fbdev" + "--enable-mmx" + "--enable-sse" + "--with-software" + ] + ++ lib.optional (!stdenv.hostPlatform.isMusl) "--with-smooth-scaling" + ++ lib.optional enableX11 "--enable-x11"; # Disable parallel building as parallel builds fail due to incomplete # depends between autogenerated CoreSlave.h and it's include sites: diff --git a/pkgs/by-name/di/dirvish/package.nix b/pkgs/by-name/di/dirvish/package.nix index 432662f0fd1a..ee82f246a7f6 100644 --- a/pkgs/by-name/di/dirvish/package.nix +++ b/pkgs/by-name/di/dirvish/package.nix @@ -17,13 +17,14 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = - [ perl ] - ++ (with perlPackages; [ - GetoptLong - TimeParseDate - TimePeriod - ]); + buildInputs = [ + perl + ] + ++ (with perlPackages; [ + GetoptLong + TimeParseDate + TimePeriod + ]); executables = [ "dirvish" diff --git a/pkgs/by-name/di/discocss/package.nix b/pkgs/by-name/di/discocss/package.nix index c2ae554b59ad..55f8f002826f 100644 --- a/pkgs/by-name/di/discocss/package.nix +++ b/pkgs/by-name/di/discocss/package.nix @@ -22,17 +22,16 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; - installPhase = - '' - install -Dm755 discocss $out/bin/discocss - '' - + lib.optionalString discordAlias '' - wrapProgram $out/bin/discocss --set DISCOCSS_DISCORD_BIN ${discord}/bin/Discord - ln -s $out/bin/discocss $out/bin/Discord - ln -s $out/bin/discocss $out/bin/discord - mkdir -p $out/share - ln -s ${discord}/share/* $out/share - ''; + installPhase = '' + install -Dm755 discocss $out/bin/discocss + '' + + lib.optionalString discordAlias '' + wrapProgram $out/bin/discocss --set DISCOCSS_DISCORD_BIN ${discord}/bin/Discord + ln -s $out/bin/discocss $out/bin/Discord + ln -s $out/bin/discocss $out/bin/discord + mkdir -p $out/share + ln -s ${discord}/share/* $out/share + ''; meta = { description = "Tiny Discord css-injector"; diff --git a/pkgs/by-name/di/displaycal/package.nix b/pkgs/by-name/di/displaycal/package.nix index 0cc84d63161a..f7466271e41a 100644 --- a/pkgs/by-name/di/displaycal/package.nix +++ b/pkgs/by-name/di/displaycal/package.nix @@ -38,18 +38,17 @@ python3.pkgs.buildPythonApplication rec { zeroconf ]; - buildInputs = - [ - gtk3 - librsvg - ] - ++ (with xorg; [ - libX11 - libXxf86vm - libXext - libXinerama - libXrandr - ]); + buildInputs = [ + gtk3 + librsvg + ] + ++ (with xorg; [ + libX11 + libXxf86vm + libXext + libXinerama + libXrandr + ]); # Workaround for eoyilmaz/displaycal-py3#261 setupPyGlobalFlags = [ "appdata" ]; diff --git a/pkgs/by-name/di/distant/package.nix b/pkgs/by-name/di/distant/package.nix index 2153efe0a10d..cd5ae71304b6 100644 --- a/pkgs/by-name/di/distant/package.nix +++ b/pkgs/by-name/di/distant/package.nix @@ -47,21 +47,20 @@ rustPlatform.buildRustPackage (finalAttrs: { writableTmpDirAsHomeHook ]; - checkFlags = - [ - # Requires network access: - # failed to lookup address information: Temporary failure in name resolution - "--skip=options::common::address::tests::resolve_should_properly_resolve_bind_address" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Timeout on darwin - # Custom { kind: TimedOut, error: "" } - "--skip=cli::api::watch::should_support_json_reporting_changes_using_correct_request_id" - "--skip=cli::api::watch::should_support_json_watching_directory_recursively" - "--skip=cli::api::watch::should_support_json_watching_single_file" - "--skip=cli::client::fs_watch::should_support_watching_a_directory_recursively" - "--skip=cli::client::fs_watch::should_support_watching_a_single_file" - ]; + checkFlags = [ + # Requires network access: + # failed to lookup address information: Temporary failure in name resolution + "--skip=options::common::address::tests::resolve_should_properly_resolve_bind_address" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Timeout on darwin + # Custom { kind: TimedOut, error: "" } + "--skip=cli::api::watch::should_support_json_reporting_changes_using_correct_request_id" + "--skip=cli::api::watch::should_support_json_watching_directory_recursively" + "--skip=cli::api::watch::should_support_json_watching_single_file" + "--skip=cli::client::fs_watch::should_support_watching_a_directory_recursively" + "--skip=cli::client::fs_watch::should_support_watching_a_single_file" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/by-name/di/distrobuilder/package.nix b/pkgs/by-name/di/distrobuilder/package.nix index 657aaf6419c0..40fab4408ca9 100644 --- a/pkgs/by-name/di/distrobuilder/package.nix +++ b/pkgs/by-name/di/distrobuilder/package.nix @@ -19,20 +19,19 @@ }: let - bins = - [ - coreutils - debootstrap - gnupg - gnutar - squashfsTools - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - # repack-windows deps - cdrkit - hivex - wimlib - ]; + bins = [ + coreutils + debootstrap + gnupg + gnutar + squashfsTools + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + # repack-windows deps + cdrkit + hivex + wimlib + ]; in buildGoModule rec { pname = "distrobuilder"; @@ -55,7 +54,8 @@ buildGoModule rec { nativeBuildInputs = [ pkg-config makeWrapper - ] ++ bins; + ] + ++ bins; postInstall = '' wrapProgram $out/bin/distrobuilder --prefix PATH ":" ${lib.makeBinPath bins} diff --git a/pkgs/by-name/di/dit/package.nix b/pkgs/by-name/di/dit/package.nix index 102bb0fe202a..3bc2a2baf068 100644 --- a/pkgs/by-name/di/dit/package.nix +++ b/pkgs/by-name/di/dit/package.nix @@ -19,7 +19,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses lua - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; # fix paths prePatch = '' diff --git a/pkgs/by-name/dj/djenrandom/package.nix b/pkgs/by-name/dj/djenrandom/package.nix index 5a88117159ca..1130e3fe0550 100644 --- a/pkgs/by-name/dj/djenrandom/package.nix +++ b/pkgs/by-name/dj/djenrandom/package.nix @@ -15,13 +15,12 @@ stdenv.mkDerivation rec { hash = "sha256-r5UT8z8vvFZDffsl6CqBXuvBaZ/sl1WLxJi26CxkpAw="; }; - preBuild = - '' - sed -i s/gcc/${stdenv.cc.targetPrefix}gcc/g Makefile - '' - + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' - sed -i s/-m64//g Makefile - ''; + preBuild = '' + sed -i s/gcc/${stdenv.cc.targetPrefix}gcc/g Makefile + '' + + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' + sed -i s/-m64//g Makefile + ''; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/dj/djent/package.nix b/pkgs/by-name/dj/djent/package.nix index a5d0d45313a7..8a1e404f67e2 100644 --- a/pkgs/by-name/dj/djent/package.nix +++ b/pkgs/by-name/dj/djent/package.nix @@ -18,13 +18,12 @@ stdenv.mkDerivation rec { buildInputs = [ mpfr ]; - preBuild = - '' - sed -i s/gcc/${stdenv.cc.targetPrefix}gcc/g Makefile - '' - + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' - sed -i s/-m64//g Makefile - ''; + preBuild = '' + sed -i s/gcc/${stdenv.cc.targetPrefix}gcc/g Makefile + '' + + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' + sed -i s/-m64//g Makefile + ''; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; diff --git a/pkgs/by-name/dl/dl-librescore/package.nix b/pkgs/by-name/dl/dl-librescore/package.nix index 31051981140d..2a6ac9b87131 100644 --- a/pkgs/by-name/dl/dl-librescore/package.nix +++ b/pkgs/by-name/dl/dl-librescore/package.nix @@ -29,13 +29,12 @@ buildNpmPackage rec { makeCacheWritable = true; - nativeBuildInputs = - [ - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ]; + nativeBuildInputs = [ + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ]; meta = { description = "Download sheet music"; diff --git a/pkgs/by-name/dl/dlib/package.nix b/pkgs/by-name/dl/dlib/package.nix index 4b0e21b208da..e868c36c9be6 100644 --- a/pkgs/by-name/dl/dlib/package.nix +++ b/pkgs/by-name/dl/dlib/package.nix @@ -33,55 +33,52 @@ rm -rf dlib/external ''; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_SHARED_LIBS" enableShared) - (lib.cmakeBool "USE_SSE4_INSTRUCTIONS" sse4Support) - (lib.cmakeBool "USE_AVX_INSTRUCTIONS" avxSupport) - (lib.cmakeBool "DLIB_USE_CUDA" cudaSupport) - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - (lib.cmakeBool "USE_NEON_INSTRUCTIONS" false) - ] - ++ lib.optionals cudaSupport [ - (lib.cmakeFeature "DLIB_USE_CUDA_COMPUTE_CAPABILITIES" ( - builtins.concatStringsSep "," (with cudaPackages.flags; map dropDots cudaCapabilities) - )) - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" enableShared) + (lib.cmakeBool "USE_SSE4_INSTRUCTIONS" sse4Support) + (lib.cmakeBool "USE_AVX_INSTRUCTIONS" avxSupport) + (lib.cmakeBool "DLIB_USE_CUDA" cudaSupport) + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + (lib.cmakeBool "USE_NEON_INSTRUCTIONS" false) + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeFeature "DLIB_USE_CUDA_COMPUTE_CAPABILITIES" ( + builtins.concatStringsSep "," (with cudaPackages.flags; map dropDots cudaCapabilities) + )) + ]; - nativeBuildInputs = + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals cudaSupport ( + with cudaPackages; [ - cmake - pkg-config + cuda_nvcc ] - ++ lib.optionals cudaSupport ( - with cudaPackages; - [ - cuda_nvcc - ] - ); + ); - buildInputs = + buildInputs = [ + libpng + libjpeg + libwebp + blas + lapack + ] + ++ lib.optionals guiSupport [ libX11 ] + ++ lib.optionals cudaSupport ( + with cudaPackages; [ - libpng - libjpeg - libwebp - blas - lapack + cuda_cudart + cuda_nvcc + libcublas + libcurand + libcusolver + cudnn + cuda_cccl ] - ++ lib.optionals guiSupport [ libX11 ] - ++ lib.optionals cudaSupport ( - with cudaPackages; - [ - cuda_cudart - cuda_nvcc - libcublas - libcurand - libcusolver - cudnn - cuda_cccl - ] - ); + ); passthru = { inherit diff --git a/pkgs/by-name/dm/dmd/binary.nix b/pkgs/by-name/dm/dmd/binary.nix index 096580ea4a23..a248aa38e245 100644 --- a/pkgs/by-name/dm/dmd/binary.nix +++ b/pkgs/by-name/dm/dmd/binary.nix @@ -40,15 +40,14 @@ stdenv.mkDerivation { ++ lib.optionals hostPlatform.isDarwin [ fixDarwinDylibNames ]; - propagatedBuildInputs = - [ - curl - tzdata - ] - ++ lib.optionals hostPlatform.isLinux [ - glibc - stdenv.cc.cc.libgcc - ]; + propagatedBuildInputs = [ + curl + tzdata + ] + ++ lib.optionals hostPlatform.isLinux [ + glibc + stdenv.cc.cc.libgcc + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/dm/dmd/generic.nix b/pkgs/by-name/dm/dmd/generic.nix index 0bd513a08e5c..433b894e3822 100644 --- a/pkgs/by-name/dm/dmd/generic.nix +++ b/pkgs/by-name/dm/dmd/generic.nix @@ -94,61 +94,58 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = - '' - patchShebangs dmd/compiler/test/{runnable,fail_compilation,compilable,tools}{,/extra-files}/*.sh + postPatch = '' + patchShebangs dmd/compiler/test/{runnable,fail_compilation,compilable,tools}{,/extra-files}/*.sh - rm dmd/compiler/test/runnable/gdb1.d - rm dmd/compiler/test/runnable/gdb10311.d - rm dmd/compiler/test/runnable/gdb14225.d - rm dmd/compiler/test/runnable/gdb14276.d - rm dmd/compiler/test/runnable/gdb14313.d - rm dmd/compiler/test/runnable/gdb14330.d - rm dmd/compiler/test/runnable/gdb15729.sh - rm dmd/compiler/test/runnable/gdb4149.d - rm dmd/compiler/test/runnable/gdb4181.d - rm dmd/compiler/test/compilable/ddocYear.d + rm dmd/compiler/test/runnable/gdb1.d + rm dmd/compiler/test/runnable/gdb10311.d + rm dmd/compiler/test/runnable/gdb14225.d + rm dmd/compiler/test/runnable/gdb14276.d + rm dmd/compiler/test/runnable/gdb14313.d + rm dmd/compiler/test/runnable/gdb14330.d + rm dmd/compiler/test/runnable/gdb15729.sh + rm dmd/compiler/test/runnable/gdb4149.d + rm dmd/compiler/test/runnable/gdb4181.d + rm dmd/compiler/test/compilable/ddocYear.d - # Disable tests that rely on objdump whitespace until fixed upstream: - # https://issues.dlang.org/show_bug.cgi?id=23317 - rm dmd/compiler/test/runnable/cdvecfill.sh - rm dmd/compiler/test/compilable/cdcmp.d - '' - + lib.optionalString (lib.versionAtLeast version "2.089.0" && lib.versionOlder version "2.092.2") '' - rm dmd/compiler/test/dshell/test6952.d - '' - + lib.optionalString (lib.versionAtLeast version "2.092.2") '' - substituteInPlace dmd/compiler/test/dshell/test6952.d --replace-fail "/usr/bin/env bash" "${bash}/bin/bash" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace phobos/std/socket.d --replace-fail "assert(ih.addrList[0] == 0x7F_00_00_01);" "" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)" - ''; + # Disable tests that rely on objdump whitespace until fixed upstream: + # https://issues.dlang.org/show_bug.cgi?id=23317 + rm dmd/compiler/test/runnable/cdvecfill.sh + rm dmd/compiler/test/compilable/cdcmp.d + '' + + lib.optionalString (lib.versionAtLeast version "2.089.0" && lib.versionOlder version "2.092.2") '' + rm dmd/compiler/test/dshell/test6952.d + '' + + lib.optionalString (lib.versionAtLeast version "2.092.2") '' + substituteInPlace dmd/compiler/test/dshell/test6952.d --replace-fail "/usr/bin/env bash" "${bash}/bin/bash" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace phobos/std/socket.d --replace-fail "assert(ih.addrList[0] == 0x7F_00_00_01);" "" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)" + ''; - nativeBuildInputs = - [ - makeWrapper - which - installShellFiles - ] - ++ lib.optionals (lib.versionOlder version "2.088.0") [ - git - ]; + nativeBuildInputs = [ + makeWrapper + which + installShellFiles + ] + ++ lib.optionals (lib.versionOlder version "2.088.0") [ + git + ]; buildInputs = [ curl tzdata ]; - nativeCheckInputs = - [ - gdb - ] - ++ lib.optionals (lib.versionOlder version "2.089.0") [ - unzip - ]; + nativeCheckInputs = [ + gdb + ] + ++ lib.optionals (lib.versionOlder version "2.089.0") [ + unzip + ]; buildFlags = [ "BUILD=release" diff --git a/pkgs/by-name/dm/dmenu-rs/package.nix b/pkgs/by-name/dm/dmenu-rs/package.nix index 20df1141d3df..7ba8db6c7b45 100644 --- a/pkgs/by-name/dm/dmenu-rs/package.nix +++ b/pkgs/by-name/dm/dmenu-rs/package.nix @@ -56,18 +56,17 @@ stdenv.mkDerivation rec { rustPlatform.cargoSetupHook ]; - buildInputs = - [ - expat - fontconfig - libXft - libXinerama - ] - ++ lib.optionals enablePlugins [ - aspell - xclip - xdg-utils - ]; + buildInputs = [ + expat + fontconfig + libXft + libXinerama + ] + ++ lib.optionals enablePlugins [ + aspell + xclip + xdg-utils + ]; # The dmenu-rs repository does not include a Cargo.lock because of its # dynamic build and plugin support. Generating it with make and checking it @@ -78,13 +77,12 @@ stdenv.mkDerivation rec { }; # Copy the Cargo.lock stored here in nixpkgs into the build directory. - postPatch = - '' - cp ${cargoLockFile} src/Cargo.lock - '' - + lib.optionalString enablePlugins '' - chmod +w src/Cargo.lock - ''; + postPatch = '' + cp ${cargoLockFile} src/Cargo.lock + '' + + lib.optionalString enablePlugins '' + chmod +w src/Cargo.lock + ''; # Include all plugins in the dmenu-rs repository under src/plugins. # See https://github.com/Shizcow/dmenu-rs/tree/master/src/plugins diff --git a/pkgs/by-name/dm/dmenu/package.nix b/pkgs/by-name/dm/dmenu/package.nix index 6996b62c0e47..35820ea4dafa 100644 --- a/pkgs/by-name/dm/dmenu/package.nix +++ b/pkgs/by-name/dm/dmenu/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation (finalAttrs: { libX11 libXinerama libXft - ] ++ extraLibs; + ] + ++ extraLibs; inherit patches; diff --git a/pkgs/by-name/dn/dnf5/package.nix b/pkgs/by-name/dn/dnf5/package.nix index 78c6e4fbb9d7..bb7ac4ffff25 100644 --- a/pkgs/by-name/dn/dnf5/package.nix +++ b/pkgs/by-name/dn/dnf5/package.nix @@ -47,21 +47,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-WlQfvWDd9Eay9TPq2EfFlQGljEskJqL3xyNIJDdaNps="; }; - nativeBuildInputs = - [ - cmake - createrepo_c - doxygen - gettext - help2man - pkg-config - sphinx - ] - ++ (with python3Packages; [ - breathe - sphinx-autoapi - sphinx-rtd-theme - ]); + nativeBuildInputs = [ + cmake + createrepo_c + doxygen + gettext + help2man + pkg-config + sphinx + ] + ++ (with python3Packages; [ + breathe + sphinx-autoapi + sphinx-rtd-theme + ]); buildInputs = [ appstream diff --git a/pkgs/by-name/dn/dnsmasq/package.nix b/pkgs/by-name/dn/dnsmasq/package.nix index b2179b0ef5c1..e97483f04979 100644 --- a/pkgs/by-name/dn/dnsmasq/package.nix +++ b/pkgs/by-name/dn/dnsmasq/package.nix @@ -61,45 +61,43 @@ stdenv.mkDerivation rec { # XXX: Does the systemd service definition really belong here when our NixOS # module can create it in Nix-land? - postInstall = - '' - install -Dm644 trust-anchors.conf $out/share/dnsmasq/trust-anchors.conf - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install -Dm644 contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist \ - $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist - substituteInPlace $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist \ - --replace "/usr/local/sbin" "$out/bin" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm755 contrib/lease-tools/dhcp_lease_time $out/bin/dhcp_lease_time - install -Dm755 contrib/lease-tools/dhcp_release $out/bin/dhcp_release - install -Dm755 contrib/lease-tools/dhcp_release6 $out/bin/dhcp_release6 + postInstall = '' + install -Dm644 trust-anchors.conf $out/share/dnsmasq/trust-anchors.conf + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install -Dm644 contrib/MacOSX-launchd/uk.org.thekelleys.dnsmasq.plist \ + $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist + substituteInPlace $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist \ + --replace "/usr/local/sbin" "$out/bin" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm755 contrib/lease-tools/dhcp_lease_time $out/bin/dhcp_lease_time + install -Dm755 contrib/lease-tools/dhcp_release $out/bin/dhcp_release + install -Dm755 contrib/lease-tools/dhcp_release6 $out/bin/dhcp_release6 - '' - + lib.optionalString dbusSupport '' - install -Dm644 dbus/dnsmasq.conf $out/share/dbus-1/system.d/dnsmasq.conf - mkdir -p $out/share/dbus-1/system-services - cat < $out/share/dbus-1/system-services/uk.org.thekelleys.dnsmasq.service - [D-BUS Service] - Name=uk.org.thekelleys.dnsmasq - Exec=$out/bin/dnsmasq -k -1 - User=root - SystemdService=dnsmasq.service - END - ''; + '' + + lib.optionalString dbusSupport '' + install -Dm644 dbus/dnsmasq.conf $out/share/dbus-1/system.d/dnsmasq.conf + mkdir -p $out/share/dbus-1/system-services + cat < $out/share/dbus-1/system-services/uk.org.thekelleys.dnsmasq.service + [D-BUS Service] + Name=uk.org.thekelleys.dnsmasq + Exec=$out/bin/dnsmasq -k -1 + User=root + SystemdService=dnsmasq.service + END + ''; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - nettle - libidn - ] - ++ lib.optionals dbusSupport [ dbus ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libnetfilter_conntrack - nftables - ]; + buildInputs = [ + nettle + libidn + ] + ++ lib.optionals dbusSupport [ dbus ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libnetfilter_conntrack + nftables + ]; passthru.tests = { prometheus-exporter = nixosTests.prometheus-exporters.dnsmasq; diff --git a/pkgs/by-name/do/doas/package.nix b/pkgs/by-name/do/doas/package.nix index 7da262cacbae..26306f990c5f 100644 --- a/pkgs/by-name/do/doas/package.nix +++ b/pkgs/by-name/do/doas/package.nix @@ -39,13 +39,12 @@ stdenv.mkDerivation rec { # ./configure script does not understand `--disable-shared` dontAddStaticConfigureFlags = true; - postPatch = - '' - sed -i '/\(chown\|chmod\)/d' GNUmakefile - '' - + lib.optionalString (withPAM && stdenv.hostPlatform.isStatic) '' - sed -i 's/-lpam/-lpam -laudit/' configure - ''; + postPatch = '' + sed -i '/\(chown\|chmod\)/d' GNUmakefile + '' + + lib.optionalString (withPAM && stdenv.hostPlatform.isStatic) '' + sed -i 's/-lpam/-lpam -laudit/' configure + ''; nativeBuildInputs = [ bison ]; buildInputs = [ ] ++ lib.optional withPAM pam ++ lib.optional (!withPAM) libxcrypt; diff --git a/pkgs/by-name/do/docbook2x/package.nix b/pkgs/by-name/do/docbook2x/package.nix index 7833b91a3c39..b786b97cdb58 100644 --- a/pkgs/by-name/do/docbook2x/package.nix +++ b/pkgs/by-name/do/docbook2x/package.nix @@ -37,20 +37,19 @@ stdenv.mkDerivation rec { libxslt iconv ]; - buildInputs = - [ - groff - libxml2 - opensp - libiconv - bash - ] - ++ (with perlPackages; [ - perl - XMLSAX - XMLParser - XMLNamespaceSupport - ]); + buildInputs = [ + groff + libxml2 + opensp + libiconv + bash + ] + ++ (with perlPackages; [ + perl + XMLSAX + XMLParser + XMLNamespaceSupport + ]); # configure tries to find osx in PATH and hardcodes the resulting path # (if any) on the Perl code. this fails under strictDeps, so override diff --git a/pkgs/by-name/do/dogdns/package.nix b/pkgs/by-name/do/dogdns/package.nix index 58775dde22a4..5e6cbf077397 100644 --- a/pkgs/by-name/do/dogdns/package.nix +++ b/pkgs/by-name/do/dogdns/package.nix @@ -31,7 +31,8 @@ rustPlatform.buildRustPackage { installShellFiles just pandoc - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]; outputs = [ diff --git a/pkgs/by-name/do/dogedns/package.nix b/pkgs/by-name/do/dogedns/package.nix index 23f798d7061a..a8ec3cd67c82 100644 --- a/pkgs/by-name/do/dogedns/package.nix +++ b/pkgs/by-name/do/dogedns/package.nix @@ -43,7 +43,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ installShellFiles pandoc - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]; postInstall = '' diff --git a/pkgs/by-name/do/dokuwiki/package.nix b/pkgs/by-name/do/dokuwiki/package.nix index d74462abd484..f80b8d6bfa91 100644 --- a/pkgs/by-name/do/dokuwiki/package.nix +++ b/pkgs/by-name/do/dokuwiki/package.nix @@ -80,19 +80,17 @@ stdenv.mkDerivation rec { basePackage.overrideAttrs (prev: { pname = if builtins.isFunction pname then pname prev else pname; - postInstall = - prev.postInstall or "" - + '' - ${lib.concatMapStringsSep "\n" ( - tpl: "cp -r ${toString tpl} $out/share/dokuwiki/lib/tpl/${tpl.name}" - ) templates} - ${lib.concatMapStringsSep "\n" ( - plugin: "cp -r ${toString plugin} $out/share/dokuwiki/lib/plugins/${plugin.name}" - ) plugins} - ${isNotEmpty localConfig "ln -sf ${localConfig} $out/share/dokuwiki/conf/local.php"} - ${isNotEmpty pluginsConfig "ln -sf ${pluginsConfig} $out/share/dokuwiki/conf/plugins.local.php"} - ${isNotEmpty aclConfig "ln -sf ${aclConfig} $out/share/dokuwiki/acl.auth.php"} - ''; + postInstall = prev.postInstall or "" + '' + ${lib.concatMapStringsSep "\n" ( + tpl: "cp -r ${toString tpl} $out/share/dokuwiki/lib/tpl/${tpl.name}" + ) templates} + ${lib.concatMapStringsSep "\n" ( + plugin: "cp -r ${toString plugin} $out/share/dokuwiki/lib/plugins/${plugin.name}" + ) plugins} + ${isNotEmpty localConfig "ln -sf ${localConfig} $out/share/dokuwiki/conf/local.php"} + ${isNotEmpty pluginsConfig "ln -sf ${pluginsConfig} $out/share/dokuwiki/conf/plugins.local.php"} + ${isNotEmpty aclConfig "ln -sf ${aclConfig} $out/share/dokuwiki/acl.auth.php"} + ''; }); tests = { inherit (nixosTests) dokuwiki; diff --git a/pkgs/by-name/do/dolfinx/package.nix b/pkgs/by-name/do/dolfinx/package.nix index db7d0659601f..383b7132bb81 100644 --- a/pkgs/by-name/do/dolfinx/package.nix +++ b/pkgs/by-name/do/dolfinx/package.nix @@ -47,7 +47,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ dolfinxPackages.kahip dolfinxPackages.scotch - ] ++ lib.optional withParmetis dolfinxPackages.parmetis; + ] + ++ lib.optional withParmetis dolfinxPackages.parmetis; propagatedBuildInputs = [ spdlog diff --git a/pkgs/by-name/do/dolphin-emu-primehack/package.nix b/pkgs/by-name/do/dolphin-emu-primehack/package.nix index 7e7b985fca40..7a7651ca334d 100644 --- a/pkgs/by-name/do/dolphin-emu-primehack/package.nix +++ b/pkgs/by-name/do/dolphin-emu-primehack/package.nix @@ -62,66 +62,63 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-/9AabEJ2ZOvHeSGXWRuOucmjleBMRcJfhX+VDeldbgo="; }; - nativeBuildInputs = - [ - pkg-config - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6.wrapQtAppsHook - ]; + nativeBuildInputs = [ + pkg-config + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6.wrapQtAppsHook + ]; - buildInputs = - [ - curl - enet - ffmpeg - fmt - gettext - libGL - libGLU - libSM - libXdmcp - libXext - libXinerama - libXrandr - libXxf86vm - libao - libpthreadstubs - libpulseaudio - libusb1 - mbedtls_2 - miniupnpc - openal - pcre - portaudio - qt6.qtbase - qt6.qtsvg - readline - sfml - soundtouch - xz - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - bluez - libevdev - udev - vulkan-loader - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - hidapi - libpng - ]; + buildInputs = [ + curl + enet + ffmpeg + fmt + gettext + libGL + libGLU + libSM + libXdmcp + libXext + libXinerama + libXrandr + libXxf86vm + libao + libpthreadstubs + libpulseaudio + libusb1 + mbedtls_2 + miniupnpc + openal + pcre + portaudio + qt6.qtbase + qt6.qtsvg + readline + sfml + soundtouch + xz + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + bluez + libevdev + udev + vulkan-loader + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + hidapi + libpng + ]; - cmakeFlags = - [ - (lib.cmakeBool "USE_SHARED_ENET" true) - (lib.cmakeBool "ENABLE_LTO" true) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeBool "OSX_USE_DEFAULT_SEARCH_PATH" true) - ]; + cmakeFlags = [ + (lib.cmakeBool "USE_SHARED_ENET" true) + (lib.cmakeBool "ENABLE_LTO" true) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeBool "OSX_USE_DEFAULT_SEARCH_PATH" true) + ]; qtWrapperArgs = lib.optionals stdenv.hostPlatform.isLinux [ "--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib" @@ -131,32 +128,30 @@ stdenv.mkDerivation (finalAttrs: { ]; # - Allow Dolphin to use nix-provided libraries instead of building them - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'DISTRIBUTOR "None"' 'DISTRIBUTOR "NixOS"' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'if(NOT APPLE)' 'if(true)' \ - --replace-fail 'if(LIBUSB_FOUND AND NOT APPLE)' 'if(LIBUSB_FOUND)' - ''; + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'DISTRIBUTOR "None"' 'DISTRIBUTOR "NixOS"' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'if(NOT APPLE)' 'if(true)' \ + --replace-fail 'if(LIBUSB_FOUND AND NOT APPLE)' 'if(LIBUSB_FOUND)' + ''; doInstallCheck = true; - postInstall = - '' - mv $out/bin/dolphin-emu $out/bin/dolphin-emu-primehack - mv $out/bin/dolphin-emu-nogui $out/bin/dolphin-emu-primehack-nogui - mv $out/share/applications/dolphin-emu.desktop $out/share/applications/dolphin-emu-primehack.desktop - mv $out/share/icons/hicolor/256x256/apps/dolphin-emu.png $out/share/icons/hicolor/256x256/apps/dolphin-emu-primehack.png - substituteInPlace $out/share/applications/dolphin-emu-primehack.desktop \ - --replace-fail 'dolphin-emu' 'dolphin-emu-primehack' \ - --replace-fail 'Dolphin Emulator' 'PrimeHack' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules - ''; + postInstall = '' + mv $out/bin/dolphin-emu $out/bin/dolphin-emu-primehack + mv $out/bin/dolphin-emu-nogui $out/bin/dolphin-emu-primehack-nogui + mv $out/share/applications/dolphin-emu.desktop $out/share/applications/dolphin-emu-primehack.desktop + mv $out/share/icons/hicolor/256x256/apps/dolphin-emu.png $out/share/icons/hicolor/256x256/apps/dolphin-emu-primehack.png + substituteInPlace $out/share/applications/dolphin-emu-primehack.desktop \ + --replace-fail 'dolphin-emu' 'dolphin-emu-primehack' \ + --replace-fail 'Dolphin Emulator' 'PrimeHack' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -D $src/Data/51-usb-device.rules $out/etc/udev/rules.d/51-usb-device.rules + ''; passthru = { tests = { diff --git a/pkgs/by-name/do/dolphin-emu/package.nix b/pkgs/by-name/do/dolphin-emu/package.nix index 681980a6f3ee..c25ea0359c01 100644 --- a/pkgs/by-name/do/dolphin-emu/package.nix +++ b/pkgs/by-name/do/dolphin-emu/package.nix @@ -73,79 +73,76 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - qt6.wrapQtAppsHook - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild # for plutil - ]; + nativeBuildInputs = [ + cmake + pkg-config + qt6.wrapQtAppsHook + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild # for plutil + ]; - buildInputs = - [ - bzip2 - cubeb - curl - enet - ffmpeg - fmt_10 - gtest - hidapi - libXdmcp - libpulseaudio - libspng - libusb1 - lz4 - lzo - mbedtls_2 - miniupnpc - minizip-ng - openal - pugixml - qt6.qtbase - qt6.qtsvg - SDL2 - sfml - xxHash - xz - # Causes linker errors with minizip-ng, prefer vendored. Possible reason why: https://github.com/dolphin-emu/dolphin/pull/12070#issuecomment-1677311838 - #zlib-ng - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - bluez - libGL - libXext - libXrandr - libevdev - # FIXME: Vendored version is newer than mgba's stable release, remove the comment on next mgba's version - #mgba # Derivation doesn't support Darwin - udev - vulkan-loader - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - moltenvk - ]; + buildInputs = [ + bzip2 + cubeb + curl + enet + ffmpeg + fmt_10 + gtest + hidapi + libXdmcp + libpulseaudio + libspng + libusb1 + lz4 + lzo + mbedtls_2 + miniupnpc + minizip-ng + openal + pugixml + qt6.qtbase + qt6.qtsvg + SDL2 + sfml + xxHash + xz + # Causes linker errors with minizip-ng, prefer vendored. Possible reason why: https://github.com/dolphin-emu/dolphin/pull/12070#issuecomment-1677311838 + #zlib-ng + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + bluez + libGL + libXext + libXrandr + libevdev + # FIXME: Vendored version is newer than mgba's stable release, remove the comment on next mgba's version + #mgba # Derivation doesn't support Darwin + udev + vulkan-loader + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + moltenvk + ]; - cmakeFlags = - [ - (lib.cmakeFeature "DISTRIBUTOR" "NixOS") - (lib.cmakeFeature "DOLPHIN_WC_DESCRIBE" finalAttrs.version) - (lib.cmakeFeature "DOLPHIN_WC_BRANCH" "master") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeBool "OSX_USE_DEFAULT_SEARCH_PATH" true) - (lib.cmakeBool "USE_BUNDLED_MOLTENVK" false) - (lib.cmakeBool "MACOS_CODE_SIGNING" false) - # Bundles the application folder into a standalone executable, so we cannot devendor libraries - (lib.cmakeBool "SKIP_POSTPROCESS_BUNDLE" true) - # Needs xcode so compilation fails with it enabled. We would want the version to be fixed anyways. - # Note: The updater isn't available on linux, so we don't need to disable it there. - (lib.cmakeBool "ENABLE_AUTOUPDATE" false) - ]; + cmakeFlags = [ + (lib.cmakeFeature "DISTRIBUTOR" "NixOS") + (lib.cmakeFeature "DOLPHIN_WC_DESCRIBE" finalAttrs.version) + (lib.cmakeFeature "DOLPHIN_WC_BRANCH" "master") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeBool "OSX_USE_DEFAULT_SEARCH_PATH" true) + (lib.cmakeBool "USE_BUNDLED_MOLTENVK" false) + (lib.cmakeBool "MACOS_CODE_SIGNING" false) + # Bundles the application folder into a standalone executable, so we cannot devendor libraries + (lib.cmakeBool "SKIP_POSTPROCESS_BUNDLE" true) + # Needs xcode so compilation fails with it enabled. We would want the version to be fixed anyways. + # Note: The updater isn't available on linux, so we don't need to disable it there. + (lib.cmakeBool "ENABLE_AUTOUPDATE" false) + ]; preConfigure = '' appendToVar cmakeFlags "-DDOLPHIN_WC_REVISION=$(cat COMMIT)" rm COMMIT diff --git a/pkgs/by-name/do/doppler/package.nix b/pkgs/by-name/do/doppler/package.nix index d494dbe6ed19..ee448409994e 100644 --- a/pkgs/by-name/do/doppler/package.nix +++ b/pkgs/by-name/do/doppler/package.nix @@ -28,18 +28,17 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; - postInstall = - '' - mv $out/bin/cli $out/bin/doppler - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - export HOME=$TMPDIR - mkdir $HOME/.doppler # to avoid race conditions below - installShellCompletion --cmd doppler \ - --bash <($out/bin/doppler completion bash) \ - --fish <($out/bin/doppler completion fish) \ - --zsh <($out/bin/doppler completion zsh) - ''; + postInstall = '' + mv $out/bin/cli $out/bin/doppler + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + export HOME=$TMPDIR + mkdir $HOME/.doppler # to avoid race conditions below + installShellCompletion --cmd doppler \ + --bash <($out/bin/doppler completion bash) \ + --fish <($out/bin/doppler completion fish) \ + --zsh <($out/bin/doppler completion zsh) + ''; passthru.tests.version = testers.testVersion { package = doppler; diff --git a/pkgs/by-name/do/dosbox-staging/package.nix b/pkgs/by-name/do/dosbox-staging/package.nix index 909530579007..44db68ed9cb7 100644 --- a/pkgs/by-name/do/dosbox-staging/package.nix +++ b/pkgs/by-name/do/dosbox-staging/package.nix @@ -67,7 +67,8 @@ stdenv.mkDerivation (finalAttrs: { opusfile speexdsp zlib-ng - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; outputs = [ "out" diff --git a/pkgs/by-name/do/dosbox-x/package.nix b/pkgs/by-name/do/dosbox-x/package.nix index 46e0477866c4..2f9ef0c9f061 100644 --- a/pkgs/by-name/do/dosbox-x/package.nix +++ b/pkgs/by-name/do/dosbox-x/package.nix @@ -40,50 +40,47 @@ stdenv.mkDerivation (finalAttrs: { # iconutil is unavailable, replace with png2icns from libicns # Patch bad hardcoded compiler # Don't mess with codesign, doesn't seem to work? - postPatch = - '' - substituteInPlace Makefile.am \ - --replace-fail 'sips' '## sips' \ - --replace-fail 'iconutil -c icns -o contrib/macos/dosbox.icns src/dosbox.iconset' 'png2icns contrib/macos/dosbox.icns contrib/macos/dosbox-x.png' \ - --replace-fail 'g++' "$CXX" \ - --replace-fail 'codesign' '## codesign' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - patchShebangs appbundledeps.py - ''; + postPatch = '' + substituteInPlace Makefile.am \ + --replace-fail 'sips' '## sips' \ + --replace-fail 'iconutil -c icns -o contrib/macos/dosbox.icns src/dosbox.iconset' 'png2icns contrib/macos/dosbox.icns contrib/macos/dosbox-x.png' \ + --replace-fail 'g++' "$CXX" \ + --replace-fail 'codesign' '## codesign' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + patchShebangs appbundledeps.py + ''; strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - makeWrapper - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libicns - python3 - ]; + nativeBuildInputs = [ + autoreconfHook + makeWrapper + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libicns + python3 + ]; - buildInputs = - [ - ffmpeg - fluidsynth - freetype - glib - libpcap - libpng - libslirp - ncurses - SDL2 - SDL2_net - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libxkbfile - libXrandr - ]; + buildInputs = [ + ffmpeg + fluidsynth + freetype + glib + libpcap + libpng + libslirp + ncurses + SDL2 + SDL2_net + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libxkbfile + libXrandr + ]; # Tests for SDL_net.h for modem & IPX support, not automatically picked up due to being in SDL2 subdirectory env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2_net}/include/SDL2"; diff --git a/pkgs/by-name/do/dosfstools/package.nix b/pkgs/by-name/do/dosfstools/package.nix index 2ebf8b479b74..02fe10faf169 100644 --- a/pkgs/by-name/do/dosfstools/package.nix +++ b/pkgs/by-name/do/dosfstools/package.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation rec { autoreconfHook gettext pkg-config - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; configureFlags = [ "--enable-compat-symlinks" ]; diff --git a/pkgs/by-name/do/dovecot/package.nix b/pkgs/by-name/do/dovecot/package.nix index 22c6290c923a..43773164c394 100644 --- a/pkgs/by-name/do/dovecot/package.nix +++ b/pkgs/by-name/do/dovecot/package.nix @@ -53,37 +53,37 @@ stdenv.mkDerivation rec { bison perl pkg-config - ] ++ lib.optionals (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; - buildInputs = - [ - openssl - bzip2 - lz4 - zlib - zstd - xz - clucene_core_2 - icu75 - libexttextcat - libsodium - libstemmer - cyrus_sasl.dev - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - systemd - pam - libcap - inotify-tools - ] - ++ lib.optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin) libtirpc - ++ lib.optional withApparmor libapparmor - ++ lib.optional withLDAP openldap - ++ lib.optional withUnwind libunwind - ++ lib.optional withMySQL libmysqlclient - ++ lib.optional withPgSQL libpq - ++ lib.optional withSQLite sqlite - ++ lib.optional withLua lua5_3; + buildInputs = [ + openssl + bzip2 + lz4 + zlib + zstd + xz + clucene_core_2 + icu75 + libexttextcat + libsodium + libstemmer + cyrus_sasl.dev + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + systemd + pam + libcap + inotify-tools + ] + ++ lib.optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isDarwin) libtirpc + ++ lib.optional withApparmor libapparmor + ++ lib.optional withLDAP openldap + ++ lib.optional withUnwind libunwind + ++ lib.optional withMySQL libmysqlclient + ++ lib.optional withPgSQL libpq + ++ lib.optional withSQLite sqlite + ++ lib.optional withLua lua5_3; src = fetchurl { url = "https://dovecot.org/releases/${lib.versions.majorMinor version}/${pname}-${version}.tar.gz"; @@ -92,25 +92,24 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - postPatch = - '' - sed -i -E \ - -e 's!/bin/sh\b!${stdenv.shell}!g' \ - -e 's!([^[:alnum:]/_-])/bin/([[:alnum:]]+)\b!\1${coreutils}/bin/\2!g' \ - -e 's!([^[:alnum:]/_-])(head|sleep|cat)\b!\1${coreutils}/bin/\2!g' \ - src/lib-program-client/test-program-client-local.c + postPatch = '' + sed -i -E \ + -e 's!/bin/sh\b!${stdenv.shell}!g' \ + -e 's!([^[:alnum:]/_-])/bin/([[:alnum:]]+)\b!\1${coreutils}/bin/\2!g' \ + -e 's!([^[:alnum:]/_-])(head|sleep|cat)\b!\1${coreutils}/bin/\2!g' \ + src/lib-program-client/test-program-client-local.c - patchShebangs src/lib-smtp/test-bin/*.sh - sed -i -s -E 's!\bcat\b!${coreutils}/bin/cat!g' src/lib-smtp/test-bin/*.sh + patchShebangs src/lib-smtp/test-bin/*.sh + sed -i -s -E 's!\bcat\b!${coreutils}/bin/cat!g' src/lib-smtp/test-bin/*.sh - patchShebangs src/config/settings-get.pl + patchShebangs src/config/settings-get.pl - # DES-encrypted passwords are not supported by NixPkgs anymore - sed '/test_password_scheme("CRYPT"/d' -i src/auth/test-libpassword.c - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - export systemdsystemunitdir=$out/etc/systemd/system - ''; + # DES-encrypted passwords are not supported by NixPkgs anymore + sed '/test_password_scheme("CRYPT"/d' -i src/auth/test-libpassword.c + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + export systemdsystemunitdir=$out/etc/systemd/system + ''; # We need this for sysconfdir, see remark below. installFlags = [ "DESTDIR=$(out)" ]; @@ -120,60 +119,58 @@ stdenv.mkDerivation rec { rm -rf $out/$(echo "$out" | cut -d "/" -f2) ''; - patches = - [ - # Fix loading extended modules. - ./load-extended-modules.patch - # fix openssl 3.0 compatibility - (fetchpatch { - url = "https://salsa.debian.org/debian/dovecot/-/raw/debian/1%252.3.19.1+dfsg1-2/debian/patches/Support-openssl-3.0.patch"; - hash = "sha256-PbBB1jIY3jIC8Js1NY93zkV0gISGUq7Nc67Ul5tN7sw="; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fix timespec calls - ./timespec.patch - ]; + patches = [ + # Fix loading extended modules. + ./load-extended-modules.patch + # fix openssl 3.0 compatibility + (fetchpatch { + url = "https://salsa.debian.org/debian/dovecot/-/raw/debian/1%252.3.19.1+dfsg1-2/debian/patches/Support-openssl-3.0.patch"; + hash = "sha256-PbBB1jIY3jIC8Js1NY93zkV0gISGUq7Nc67Ul5tN7sw="; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fix timespec calls + ./timespec.patch + ]; - configureFlags = - [ - # It will hardcode this for /var/lib/dovecot. - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211 - "--localstatedir=/var" - # We need this so utilities default to reading /etc/dovecot/dovecot.conf file. - "--sysconfdir=/etc" - "--with-moduledir=${placeholder "out"}/lib/dovecot/modules" - "--with-ssl=openssl" - "--with-zlib" - "--with-bzlib" - "--with-lz4" - "--with-lucene" - "--with-icu" - "--with-textcat" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "i_cv_epoll_works=${if stdenv.hostPlatform.isLinux then "yes" else "no"}" - "i_cv_posix_fallocate_works=${if stdenv.hostPlatform.isDarwin then "no" else "yes"}" - "i_cv_inotify_works=${if stdenv.hostPlatform.isLinux then "yes" else "no"}" - "i_cv_signed_size_t=no" - "i_cv_signed_time_t=yes" - "i_cv_c99_vsnprintf=yes" - "lib_cv_va_copy=yes" - "i_cv_mmap_plays_with_write=yes" - "i_cv_gmtime_max_time_t=${toString stdenv.hostPlatform.parsed.cpu.bits}" - "i_cv_signed_time_t=yes" - "i_cv_fd_passing=yes" - "lib_cv_va_copy=yes" - "lib_cv___va_copy=yes" - "lib_cv_va_val_copy=yes" - ] - ++ lib.optional stdenv.hostPlatform.isLinux "--with-systemd" - ++ lib.optional stdenv.hostPlatform.isDarwin "--enable-static" - ++ lib.optional withLDAP "--with-ldap" - ++ lib.optional withLua "--with-lua" - ++ lib.optional withMySQL "--with-mysql" - ++ lib.optional withPgSQL "--with-pgsql" - ++ lib.optional withSQLite "--with-sqlite"; + configureFlags = [ + # It will hardcode this for /var/lib/dovecot. + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211 + "--localstatedir=/var" + # We need this so utilities default to reading /etc/dovecot/dovecot.conf file. + "--sysconfdir=/etc" + "--with-moduledir=${placeholder "out"}/lib/dovecot/modules" + "--with-ssl=openssl" + "--with-zlib" + "--with-bzlib" + "--with-lz4" + "--with-lucene" + "--with-icu" + "--with-textcat" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "i_cv_epoll_works=${if stdenv.hostPlatform.isLinux then "yes" else "no"}" + "i_cv_posix_fallocate_works=${if stdenv.hostPlatform.isDarwin then "no" else "yes"}" + "i_cv_inotify_works=${if stdenv.hostPlatform.isLinux then "yes" else "no"}" + "i_cv_signed_size_t=no" + "i_cv_signed_time_t=yes" + "i_cv_c99_vsnprintf=yes" + "lib_cv_va_copy=yes" + "i_cv_mmap_plays_with_write=yes" + "i_cv_gmtime_max_time_t=${toString stdenv.hostPlatform.parsed.cpu.bits}" + "i_cv_signed_time_t=yes" + "i_cv_fd_passing=yes" + "lib_cv_va_copy=yes" + "lib_cv___va_copy=yes" + "lib_cv_va_val_copy=yes" + ] + ++ lib.optional stdenv.hostPlatform.isLinux "--with-systemd" + ++ lib.optional stdenv.hostPlatform.isDarwin "--enable-static" + ++ lib.optional withLDAP "--with-ldap" + ++ lib.optional withLua "--with-lua" + ++ lib.optional withMySQL "--with-mysql" + ++ lib.optional withPgSQL "--with-pgsql" + ++ lib.optional withSQLite "--with-sqlite"; doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/by-name/dp/dpdk/package.nix b/pkgs/by-name/dp/dpdk/package.nix index 2bee92b61cf9..dcc70b1815ae 100644 --- a/pkgs/by-name/dp/dpdk/package.nix +++ b/pkgs/by-name/dp/dpdk/package.nix @@ -73,34 +73,33 @@ stdenv.mkDerivation rec { patchShebangs config/arm buildtools ''; - mesonFlags = - [ - "-Dtests=false" - "-Denable_docs=true" - "-Ddeveloper_mode=disabled" - ] - ++ [ (if shared then "-Ddefault_library=shared" else "-Ddefault_library=static") ] - ++ lib.optional (machine != null) "-Dmachine=${machine}" - ++ lib.optional (withExamples != [ ]) "-Dexamples=${builtins.concatStringsSep "," withExamples}"; + mesonFlags = [ + "-Dtests=false" + "-Denable_docs=true" + "-Ddeveloper_mode=disabled" + ] + ++ [ (if shared then "-Ddefault_library=shared" else "-Ddefault_library=static") ] + ++ lib.optional (machine != null) "-Dmachine=${machine}" + ++ lib.optional (withExamples != [ ]) "-Dexamples=${builtins.concatStringsSep "," withExamples}"; - postInstall = - '' - # Remove Sphinx cache files. Not only are they not useful, but they also - # contain store paths causing spurious dependencies. - rm -rf $out/share/doc/dpdk/html/.doctrees + postInstall = '' + # Remove Sphinx cache files. Not only are they not useful, but they also + # contain store paths causing spurious dependencies. + rm -rf $out/share/doc/dpdk/html/.doctrees - wrapProgram $out/bin/dpdk-devbind.py \ - --prefix PATH : "${lib.makeBinPath [ pciutils ]}" - '' - + lib.optionalString (withExamples != [ ]) '' - mkdir -p $examples/bin - find examples -type f -executable -exec install {} $examples/bin \; - ''; + wrapProgram $out/bin/dpdk-devbind.py \ + --prefix PATH : "${lib.makeBinPath [ pciutils ]}" + '' + + lib.optionalString (withExamples != [ ]) '' + mkdir -p $examples/bin + find examples -type f -executable -exec install {} $examples/bin \; + ''; outputs = [ "out" "doc" - ] ++ lib.optional (withExamples != [ ]) "examples"; + ] + ++ lib.optional (withExamples != [ ]) "examples"; meta = with lib; { description = "Set of libraries and drivers for fast packet processing"; diff --git a/pkgs/by-name/dp/dpkg/package.nix b/pkgs/by-name/dp/dpkg/package.nix index c8b0adb974dd..ba081f159197 100644 --- a/pkgs/by-name/dp/dpkg/package.nix +++ b/pkgs/by-name/dp/dpkg/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { "--with-admindir=/var/lib/dpkg" "PERL_LIBDIR=$(out)/${perl.libPrefix}" "TAR=${gnutar}/bin/tar" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-linker-optimisations"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-linker-optimisations"; enableParallelBuilding = true; @@ -55,28 +56,27 @@ stdenv.mkDerivation rec { --replace-fail 'as_fn_error $? "cannot find a GNU tar program"' "#" ''; - postPatch = - '' - patchShebangs --host . + postPatch = '' + patchShebangs --host . - # Dpkg commands sometimes calls out to shell commands - substituteInPlace lib/dpkg/dpkg.h \ - --replace '"dpkg-deb"' \"$out/bin/dpkg-deb\" \ - --replace '"dpkg-split"' \"$out/bin/dpkg-split\" \ - --replace '"dpkg-query"' \"$out/bin/dpkg-query\" \ - --replace '"dpkg-divert"' \"$out/bin/dpkg-divert\" \ - --replace '"dpkg-statoverride"' \"$out/bin/dpkg-statoverride\" \ - --replace '"dpkg-trigger"' \"$out/bin/dpkg-trigger\" \ - --replace '"dpkg"' \"$out/bin/dpkg\" \ - --replace '"debsig-verify"' \"$out/bin/debsig-verify\" \ - --replace '"rm"' \"${coreutils}/bin/rm\" \ - --replace '"cat"' \"${coreutils}/bin/cat\" \ - --replace '"diff"' \"${diffutils}/bin/diff\" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - substituteInPlace src/main/help.c \ - --replace '"ldconfig"' \"${glibc.bin}/bin/ldconfig\" - ''; + # Dpkg commands sometimes calls out to shell commands + substituteInPlace lib/dpkg/dpkg.h \ + --replace '"dpkg-deb"' \"$out/bin/dpkg-deb\" \ + --replace '"dpkg-split"' \"$out/bin/dpkg-split\" \ + --replace '"dpkg-query"' \"$out/bin/dpkg-query\" \ + --replace '"dpkg-divert"' \"$out/bin/dpkg-divert\" \ + --replace '"dpkg-statoverride"' \"$out/bin/dpkg-statoverride\" \ + --replace '"dpkg-trigger"' \"$out/bin/dpkg-trigger\" \ + --replace '"dpkg"' \"$out/bin/dpkg\" \ + --replace '"debsig-verify"' \"$out/bin/debsig-verify\" \ + --replace '"rm"' \"${coreutils}/bin/rm\" \ + --replace '"cat"' \"${coreutils}/bin/cat\" \ + --replace '"diff"' \"${diffutils}/bin/diff\" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + substituteInPlace src/main/help.c \ + --replace '"ldconfig"' \"${glibc.bin}/bin/ldconfig\" + ''; buildInputs = [ perl diff --git a/pkgs/by-name/dr/drawpile/package.nix b/pkgs/by-name/dr/drawpile/package.nix index 14674d048d71..5863b9f75087 100644 --- a/pkgs/by-name/dr/drawpile/package.nix +++ b/pkgs/by-name/dr/drawpile/package.nix @@ -58,7 +58,8 @@ let # optional: libmicrohttpd # HTTP admin api libsodium # ext-auth support - ] ++ lib.optional withSystemd systemd; + ] + ++ lib.optional withSystemd systemd; in stdenv.mkDerivation rec { @@ -90,13 +91,12 @@ stdenv.mkDerivation rec { ) ]; - buildInputs = - [ - libzip - qt6Packages.qtwebsockets - ] - ++ lib.optionals buildClient clientDeps - ++ lib.optionals buildServer serverDeps; + buildInputs = [ + libzip + qt6Packages.qtwebsockets + ] + ++ lib.optionals buildClient clientDeps + ++ lib.optionals buildServer serverDeps; cmakeFlags = [ (lib.cmakeFeature "INITSYS" (lib.optionalString withSystemd "systemd")) @@ -106,20 +106,19 @@ stdenv.mkDerivation rec { (lib.cmakeBool "TOOLS" buildExtraTools) ]; - meta = - { - description = "Collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously"; - homepage = "https://drawpile.net/"; - downloadPage = "https://drawpile.net/download/"; - license = lib.licenses.gpl3Plus; - maintainers = with lib.maintainers; [ fgaz ]; - platforms = lib.platforms.unix; - broken = stdenv.hostPlatform.isDarwin; - } - // lib.optionalAttrs buildServer { - mainProgram = "drawpile-srv"; - } - // lib.optionalAttrs buildClient { - mainProgram = "drawpile"; - }; + meta = { + description = "Collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously"; + homepage = "https://drawpile.net/"; + downloadPage = "https://drawpile.net/download/"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ fgaz ]; + platforms = lib.platforms.unix; + broken = stdenv.hostPlatform.isDarwin; + } + // lib.optionalAttrs buildServer { + mainProgram = "drawpile-srv"; + } + // lib.optionalAttrs buildClient { + mainProgram = "drawpile"; + }; } diff --git a/pkgs/by-name/dr/drawterm/package.nix b/pkgs/by-name/dr/drawterm/package.nix index 9501e867b5b0..da8175e8b3d9 100644 --- a/pkgs/by-name/dr/drawterm/package.nix +++ b/pkgs/by-name/dr/drawterm/package.nix @@ -34,15 +34,14 @@ stdenv.mkDerivation { enableParallelBuilding = true; strictDeps = true; - nativeBuildInputs = - [ - installShellFiles - makeWrapper - ] - ++ lib.optionals withWayland [ - pkg-config - wayland-scanner - ]; + nativeBuildInputs = [ + installShellFiles + makeWrapper + ] + ++ lib.optionals withWayland [ + pkg-config + wayland-scanner + ]; buildInputs = lib.optionals withWayland [ @@ -66,25 +65,24 @@ stdenv.mkDerivation { "CC=clang" ]; - installPhase = - '' - installManPage drawterm.1 - '' - + lib.optionalString withWayland '' - install -Dm755 -t $out/bin/ drawterm - '' - + lib.optionalString (!(withWayland || stdenv.hostPlatform.isDarwin)) '' - # wrapping the oss output with pulse seems to be the easiest - mv drawterm drawterm.bin - install -Dm755 -t $out/bin/ drawterm.bin - makeWrapper ${pulseaudio}/bin/padsp $out/bin/drawterm --add-flags $out/bin/drawterm.bin - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/{Applications,bin} - mv gui-cocoa/drawterm.app $out/Applications/ - mv drawterm $out/Applications/drawterm.app/ - ln -s $out/Applications/drawterm.app/drawterm $out/bin/ - ''; + installPhase = '' + installManPage drawterm.1 + '' + + lib.optionalString withWayland '' + install -Dm755 -t $out/bin/ drawterm + '' + + lib.optionalString (!(withWayland || stdenv.hostPlatform.isDarwin)) '' + # wrapping the oss output with pulse seems to be the easiest + mv drawterm drawterm.bin + install -Dm755 -t $out/bin/ drawterm.bin + makeWrapper ${pulseaudio}/bin/padsp $out/bin/drawterm --add-flags $out/bin/drawterm.bin + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/{Applications,bin} + mv gui-cocoa/drawterm.app $out/Applications/ + mv drawterm $out/Applications/drawterm.app/ + ln -s $out/Applications/drawterm.app/drawterm $out/bin/ + ''; passthru = { updateScript = unstableGitUpdater { shallowClone = false; }; diff --git a/pkgs/by-name/dr/drogon/package.nix b/pkgs/by-name/dr/drogon/package.nix index 52c3a6ad4c58..6b7f29dd1a33 100644 --- a/pkgs/by-name/dr/drogon/package.nix +++ b/pkgs/by-name/dr/drogon/package.nix @@ -41,23 +41,22 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_EXAMPLES" false) ]; - propagatedBuildInputs = - [ - jsoncpp - libossp_uuid - zlib - openssl - brotli - c-ares - ] - ++ lib.optional sqliteSupport sqlite - ++ lib.optional postgresSupport libpq - ++ lib.optional redisSupport hiredis - # drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies) - ++ lib.optionals mysqlSupport [ - libmysqlclient - mariadb - ]; + propagatedBuildInputs = [ + jsoncpp + libossp_uuid + zlib + openssl + brotli + c-ares + ] + ++ lib.optional sqliteSupport sqlite + ++ lib.optional postgresSupport libpq + ++ lib.optional redisSupport hiredis + # drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies) + ++ lib.optionals mysqlSupport [ + libmysqlclient + mariadb + ]; patches = [ # this part of the test would normally fail because it attempts to configure a CMake project that uses find_package on itself diff --git a/pkgs/by-name/ds/dsd/package.nix b/pkgs/by-name/ds/dsd/package.nix index d45d20b9259f..eb5aaa2cc0bb 100644 --- a/pkgs/by-name/ds/dsd/package.nix +++ b/pkgs/by-name/ds/dsd/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation { mbelib libsndfile itpp - ] ++ lib.optionals portaudioSupport [ portaudio ]; + ] + ++ lib.optionals portaudioSupport [ portaudio ]; doCheck = true; diff --git a/pkgs/by-name/ds/dspam/package.nix b/pkgs/by-name/ds/dspam/package.nix index 2c7dd35ef952..2458bde95bd7 100644 --- a/pkgs/by-name/ds/dspam/package.nix +++ b/pkgs/by-name/ds/dspam/package.nix @@ -50,15 +50,16 @@ stdenv.mkDerivation rec { ./mariadb.patch ]; - buildInputs = - [ perlPackages.perl ] - ++ lib.optionals withMySQL [ - zlib - mariadb-connector-c.out - ] - ++ lib.optional withPgSQL libpq - ++ lib.optional withSQLite sqlite - ++ lib.optional withDB db; + buildInputs = [ + perlPackages.perl + ] + ++ lib.optionals withMySQL [ + zlib + mariadb-connector-c.out + ] + ++ lib.optional withPgSQL libpq + ++ lib.optional withSQLite sqlite + ++ lib.optional withDB db; nativeBuildInputs = [ libpq.pg_config makeWrapper @@ -68,29 +69,28 @@ stdenv.mkDerivation rec { sed -i 's/atoi(m) >= 5/1/g' configure m4/mysql_drv.m4 ''; - configureFlags = - [ - "--with-storage-driver=${drivers}" - "--sysconfdir=/etc/dspam" - "--localstatedir=/var" - "--with-dspam-home=/var/lib/dspam" - "--with-logdir=/var/log/dspam" - "--with-logfile=/var/log/dspam/dspam.log" + configureFlags = [ + "--with-storage-driver=${drivers}" + "--sysconfdir=/etc/dspam" + "--localstatedir=/var" + "--with-dspam-home=/var/lib/dspam" + "--with-logdir=/var/log/dspam" + "--with-logfile=/var/log/dspam/dspam.log" - "--enable-daemon" - "--enable-clamav" - "--enable-syslog" - "--enable-large-scale" - "--enable-virtual-users" - "--enable-split-configuration" - "--enable-preferences-extension" - "--enable-long-usernames" - "--enable-external-lookup" - ] - ++ lib.optionals withMySQL [ - "--with-mysql-includes=${mariadb-connector-c.dev}/include/mysql" - "--with-mysql-libraries=${mariadb-connector-c.out}/lib/mysql" - ]; + "--enable-daemon" + "--enable-clamav" + "--enable-syslog" + "--enable-large-scale" + "--enable-virtual-users" + "--enable-split-configuration" + "--enable-preferences-extension" + "--enable-long-usernames" + "--enable-external-lookup" + ] + ++ lib.optionals withMySQL [ + "--with-mysql-includes=${mariadb-connector-c.dev}/include/mysql" + "--with-mysql-libraries=${mariadb-connector-c.out}/lib/mysql" + ]; # Workaround build failure on -fno-common toolchains like upstream # gcc-10. Otherwise build fails as: diff --git a/pkgs/by-name/dt/dtc/package.nix b/pkgs/by-name/dt/dtc/package.nix index 978c7f58544c..527ffe873bb2 100644 --- a/pkgs/by-name/dt/dtc/package.nix +++ b/pkgs/by-name/dt/dtc/package.nix @@ -42,20 +42,19 @@ stdenv.mkDerivation (finalAttrs: { env.SETUPTOOLS_SCM_PRETEND_VERSION = finalAttrs.version; - nativeBuildInputs = - [ - meson - ninja - flex - bison - pkg-config - which - ] - ++ lib.optionals pythonSupport [ - python - python.pkgs.setuptools-scm - swig - ]; + nativeBuildInputs = [ + meson + ninja + flex + bison + pkg-config + which + ] + ++ lib.optionals pythonSupport [ + python + python.pkgs.setuptools-scm + swig + ]; buildInputs = [ libyaml ]; diff --git a/pkgs/by-name/du/duc/package.nix b/pkgs/by-name/du/duc/package.nix index ad33cea6cae2..7da393dae979 100644 --- a/pkgs/by-name/du/duc/package.nix +++ b/pkgs/by-name/du/duc/package.nix @@ -28,15 +28,14 @@ stdenv.mkDerivation rec { autoreconfHook pkg-config ]; - buildInputs = - [ - tokyocabinet - ncurses - ] - ++ lib.optionals enableCairo [ - cairo - pango - ]; + buildInputs = [ + tokyocabinet + ncurses + ] + ++ lib.optionals enableCairo [ + cairo + pango + ]; configureFlags = lib.optionals (!enableCairo) [ "--disable-x11" diff --git a/pkgs/by-name/du/duckdb/package.nix b/pkgs/by-name/du/duckdb/package.nix index c4481a8ece8b..9c267cf93cae 100644 --- a/pkgs/by-name/du/duckdb/package.nix +++ b/pkgs/by-name/du/duckdb/package.nix @@ -40,20 +40,22 @@ stdenv.mkDerivation (finalAttrs: { ninja python3 ]; - buildInputs = - [ openssl ] ++ lib.optionals withJdbc [ openjdk11 ] ++ lib.optionals withOdbc [ unixODBC ]; + buildInputs = [ + openssl + ] + ++ lib.optionals withJdbc [ openjdk11 ] + ++ lib.optionals withOdbc [ unixODBC ]; - cmakeFlags = - [ - "-DDUCKDB_EXTENSION_CONFIGS=${finalAttrs.src}/.github/config/in_tree_extensions.cmake" - "-DBUILD_ODBC_DRIVER=${enableFeature withOdbc}" - "-DJDBC_DRIVER=${enableFeature withJdbc}" - "-DOVERRIDE_GIT_DESCRIBE=v${finalAttrs.version}-0-g${finalAttrs.rev}" - ] - ++ lib.optionals finalAttrs.doInstallCheck [ - # development settings - "-DBUILD_UNITTESTS=ON" - ]; + cmakeFlags = [ + "-DDUCKDB_EXTENSION_CONFIGS=${finalAttrs.src}/.github/config/in_tree_extensions.cmake" + "-DBUILD_ODBC_DRIVER=${enableFeature withOdbc}" + "-DJDBC_DRIVER=${enableFeature withJdbc}" + "-DOVERRIDE_GIT_DESCRIBE=v${finalAttrs.version}-0-g${finalAttrs.rev}" + ] + ++ lib.optionals finalAttrs.doInstallCheck [ + # development settings + "-DBUILD_UNITTESTS=ON" + ]; doInstallCheck = true; diff --git a/pkgs/by-name/du/duckscript/package.nix b/pkgs/by-name/du/duckscript/package.nix index d3866bdfaac4..f4f136c2fd53 100644 --- a/pkgs/by-name/du/duckscript/package.nix +++ b/pkgs/by-name/du/duckscript/package.nix @@ -19,11 +19,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; useFetchCargoVendor = true; cargoHash = "sha256-ft6EUajAj+Zw3cEhdajwwHAaMaUf+/vtTuUYni8E+o0="; diff --git a/pkgs/by-name/du/duktape/package.nix b/pkgs/by-name/du/duktape/package.nix index c7443c99ce15..ed51312da482 100644 --- a/pkgs/by-name/du/duktape/package.nix +++ b/pkgs/by-name/du/duktape/package.nix @@ -19,27 +19,26 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ validatePkgConfig - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; - buildPhase = - '' - make -f Makefile.cmdline - '' - + lib.optionalString (!stdenv.hostPlatform.isStatic) '' - make INSTALL_PREFIX="$out" -f Makefile.sharedlibrary - ''; + buildPhase = '' + make -f Makefile.cmdline + '' + + lib.optionalString (!stdenv.hostPlatform.isStatic) '' + make INSTALL_PREFIX="$out" -f Makefile.sharedlibrary + ''; - installPhase = - '' - install -d $out/bin - install -m755 duk $out/bin/ - '' - + lib.optionalString (!stdenv.hostPlatform.isStatic) '' - install -d $out/lib/pkgconfig - install -d $out/include + installPhase = '' + install -d $out/bin + install -m755 duk $out/bin/ + '' + + lib.optionalString (!stdenv.hostPlatform.isStatic) '' + install -d $out/lib/pkgconfig + install -d $out/include - make INSTALL_PREFIX="$out" -f Makefile.sharedlibrary install - ''; + make INSTALL_PREFIX="$out" -f Makefile.sharedlibrary install + ''; enableParallelBuilding = true; diff --git a/pkgs/by-name/du/dump1090-fa/package.nix b/pkgs/by-name/du/dump1090-fa/package.nix index b542aa6f7dc5..681db8400e7e 100644 --- a/pkgs/by-name/du/dump1090-fa/package.nix +++ b/pkgs/by-name/du/dump1090-fa/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation (finalAttrs: { ncurses rtl-sdr soapysdr-with-plugins - ] ++ lib.optional stdenv.hostPlatform.isLinux limesuite; + ] + ++ lib.optional stdenv.hostPlatform.isLinux limesuite; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-implicit-function-declaration -Wno-int-conversion -Wno-unknown-warning-option"; diff --git a/pkgs/by-name/du/dumpvdl2/package.nix b/pkgs/by-name/du/dumpvdl2/package.nix index 06af53f19177..fd9a276a845c 100644 --- a/pkgs/by-name/du/dumpvdl2/package.nix +++ b/pkgs/by-name/du/dumpvdl2/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { sqlite zeromq libacars - ] ++ lib.optionals sdrplaySupport [ sdrplay ]; + ] + ++ lib.optionals sdrplaySupport [ sdrplay ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/du/dune3d/package.nix b/pkgs/by-name/du/dune3d/package.nix index dfe2bd16293a..5b59f7197b63 100644 --- a/pkgs/by-name/du/dune3d/package.nix +++ b/pkgs/by-name/du/dune3d/package.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation (finalAttrs: { pkg-config wrapGAppsHook3 libxml2 # for xmllints - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; buildInputs = [ cmake diff --git a/pkgs/by-name/du/dunst/package.nix b/pkgs/by-name/du/dunst/package.nix index d3507eb51972..c252f439cc3e 100644 --- a/pkgs/by-name/du/dunst/package.nix +++ b/pkgs/by-name/du/dunst/package.nix @@ -48,43 +48,41 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - cairo - dbus - gdk-pixbuf - glib - libnotify - pango - librsvg - ] - ++ lib.optionals withX11 [ - libX11 - libXScrnSaver - libXinerama - xorgproto - libXrandr - ] - ++ lib.optionals withWayland [ - wayland - wayland-protocols - ]; + buildInputs = [ + cairo + dbus + gdk-pixbuf + glib + libnotify + pango + librsvg + ] + ++ lib.optionals withX11 [ + libX11 + libXScrnSaver + libXinerama + xorgproto + libXrandr + ] + ++ lib.optionals withWayland [ + wayland + wayland-protocols + ]; outputs = [ "out" "man" ]; - makeFlags = - [ - "PREFIX=$(out)" - "VERSION=$(version)" - "SYSCONFDIR=$(out)/etc" - "SERVICEDIR_DBUS=$(out)/share/dbus-1/services" - "SERVICEDIR_SYSTEMD=$(out)/lib/systemd/user" - ] - ++ lib.optional (!withX11) "X11=0" - ++ lib.optional (!withWayland) "WAYLAND=0"; + makeFlags = [ + "PREFIX=$(out)" + "VERSION=$(version)" + "SYSCONFDIR=$(out)/etc" + "SERVICEDIR_DBUS=$(out)/share/dbus-1/services" + "SERVICEDIR_SYSTEMD=$(out)/lib/systemd/user" + ] + ++ lib.optional (!withX11) "X11=0" + ++ lib.optional (!withWayland) "WAYLAND=0"; postInstall = '' wrapProgram $out/bin/dunst \ diff --git a/pkgs/by-name/du/duplicity/package.nix b/pkgs/by-name/du/duplicity/package.nix index 9a6f9352379d..161efe0f35ee 100644 --- a/pkgs/by-name/du/duplicity/package.nix +++ b/pkgs/by-name/du/duplicity/package.nix @@ -36,21 +36,20 @@ let ./keep-pythonpath-in-testing.patch ]; - postPatch = - '' - patchShebangs duplicity/__main__.py + postPatch = '' + patchShebangs duplicity/__main__.py - # don't try to use gtar on darwin/bsd - substituteInPlace testing/functional/test_restart.py \ - --replace-fail 'tarcmd = "gtar"' 'tarcmd = "tar"' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # tests try to access these files in the sandbox, but can't deal with EPERM - substituteInPlace testing/unit/test_globmatch.py \ - --replace-fail /var/log /test/log - substituteInPlace testing/unit/test_selection.py \ - --replace-fail /usr/bin /dev - ''; + # don't try to use gtar on darwin/bsd + substituteInPlace testing/functional/test_restart.py \ + --replace-fail 'tarcmd = "gtar"' 'tarcmd = "tar"' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # tests try to access these files in the sandbox, but can't deal with EPERM + substituteInPlace testing/unit/test_globmatch.py \ + --replace-fail /var/log /test/log + substituteInPlace testing/unit/test_selection.py \ + --replace-fail /usr/bin /dev + ''; disabledTests = [ # fails on some unsupported backends, e.g. @@ -96,26 +95,25 @@ let ] ++ paramiko.optional-dependencies.invoke; - nativeCheckInputs = - [ - gnupg # Add 'gpg' to PATH. - gnutar # Add 'tar' to PATH. - librsync # Add 'rdiff' to PATH. - par2cmdline # Add 'par2' to PATH. - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linux # Add 'setsid' to PATH. - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - getconf - ] - ++ (with python3.pkgs; [ - lockfile - mock - pexpect - pytestCheckHook - fasteners - ]); + nativeCheckInputs = [ + gnupg # Add 'gpg' to PATH. + gnutar # Add 'tar' to PATH. + librsync # Add 'rdiff' to PATH. + par2cmdline # Add 'par2' to PATH. + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linux # Add 'setsid' to PATH. + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + getconf + ] + ++ (with python3.pkgs; [ + lockfile + mock + pexpect + pytestCheckHook + fasteners + ]); # Prevent double wrapping, let the Python wrapper use the args in preFixup. dontWrapGApps = true; diff --git a/pkgs/by-name/dv/dvdisaster/package.nix b/pkgs/by-name/dv/dvdisaster/package.nix index d654c0fb377c..5511faaee11b 100644 --- a/pkgs/by-name/dv/dvdisaster/package.nix +++ b/pkgs/by-name/dv/dvdisaster/package.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation rec { "--docdir=share/doc" "--with-nls=yes" "--with-embedded-src-path=no" - ] ++ lib.optional (stdenv.hostPlatform.isx86_64) "--with-sse2=yes"; + ] + ++ lib.optional (stdenv.hostPlatform.isx86_64) "--with-sse2=yes"; # fatal error: inlined-icons.h: No such file or directory enableParallelBuilding = false; diff --git a/pkgs/by-name/dv/dvdplusrwtools/package.nix b/pkgs/by-name/dv/dvdplusrwtools/package.nix index 49bb2b6e1948..d61702cc13d6 100644 --- a/pkgs/by-name/dv/dvdplusrwtools/package.nix +++ b/pkgs/by-name/dv/dvdplusrwtools/package.nix @@ -16,60 +16,61 @@ stdenv.mkDerivation rec { sha256 = "1jkjvvnjcyxpql97xjjx0kwvy70kxpiznr2zpjy2hhci5s10zmpq"; }; - patches = - [ ./darwin.patch ] - # Patches from Gentoo - ++ - builtins.map - ( - { pfile, sha256 }: - fetchpatch { - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-cdr/dvd+rw-tools/files/${pfile}?id=b510df361241e8f16314b1f14642305f0111dac6"; - inherit sha256; - } - ) - [ - { - pfile = "dvd+rw-tools-7.0-dvddl-r1.patch"; - sha256 = "12l33jq6405shfwdycrj52qmd07h5bsp1vjaddknfri456azjny5"; - } - { - pfile = "dvd+rw-tools-7.0-glibc2.6.90.patch"; - sha256 = "1fb3gap2in782pa4164h1w0ha8ggsq3inissa1k0zn2p2r3rb5ln"; - } - { - pfile = "dvd+rw-tools-7.0-reload.patch"; - sha256 = "12v2y2y6ci5hh6lbmsk97dzgznrm4bxwhc81mq684ix0qspb9mq4"; - } - { - pfile = "dvd+rw-tools-7.0-sysmacros.patch"; - sha256 = "1rkb26cyhfxklkmna3l9b4797f6gzlxyqqin44jwnq3jmwfrs6v0"; - } - { - pfile = "dvd+rw-tools-7.0-wctomb-r1.patch"; - sha256 = "1xg770l0b4bjn30y7nqg619v4m5ickcn2n8hv9k2an6r191daq58"; - } - { - pfile = "dvd+rw-tools-7.0-wexit.patch"; - sha256 = "0sqzlkm19fmjx4lzxkxwn2ymrj9fq0zk0jkys3xm6xvd2ibb6kxl"; - } - { - pfile = "dvd+rw-tools-7.1-bluray_pow_freespace.patch"; - sha256 = "0iscz8fs5002ymk6wl2fz4x06b7bdnc57rfz8kbv3216acqi5rv3"; - } - { - pfile = "dvd+rw-tools-7.1-bluray_srm+pow.patch"; - sha256 = "0sy40m12w987i6g0cyxv8cfmab4vp7cd222lv05apknfi2y7smmw"; - } - { - pfile = "dvd+rw-tools-7.1-lastshort.patch"; - sha256 = "01wspv70sil20khkg5kj086b1x8rrig4yhcq9s88bdjd42nv0vpx"; - } - { - pfile = "dvd+rw-tools-7.1-noevent.patch"; - sha256 = "1kbmxpg15wci33f2h6pxxvf3qm0kpyzx9wj5a3l67sk34hvza3z6"; - } - ]; + patches = [ + ./darwin.patch + ] + # Patches from Gentoo + ++ + builtins.map + ( + { pfile, sha256 }: + fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-cdr/dvd+rw-tools/files/${pfile}?id=b510df361241e8f16314b1f14642305f0111dac6"; + inherit sha256; + } + ) + [ + { + pfile = "dvd+rw-tools-7.0-dvddl-r1.patch"; + sha256 = "12l33jq6405shfwdycrj52qmd07h5bsp1vjaddknfri456azjny5"; + } + { + pfile = "dvd+rw-tools-7.0-glibc2.6.90.patch"; + sha256 = "1fb3gap2in782pa4164h1w0ha8ggsq3inissa1k0zn2p2r3rb5ln"; + } + { + pfile = "dvd+rw-tools-7.0-reload.patch"; + sha256 = "12v2y2y6ci5hh6lbmsk97dzgznrm4bxwhc81mq684ix0qspb9mq4"; + } + { + pfile = "dvd+rw-tools-7.0-sysmacros.patch"; + sha256 = "1rkb26cyhfxklkmna3l9b4797f6gzlxyqqin44jwnq3jmwfrs6v0"; + } + { + pfile = "dvd+rw-tools-7.0-wctomb-r1.patch"; + sha256 = "1xg770l0b4bjn30y7nqg619v4m5ickcn2n8hv9k2an6r191daq58"; + } + { + pfile = "dvd+rw-tools-7.0-wexit.patch"; + sha256 = "0sqzlkm19fmjx4lzxkxwn2ymrj9fq0zk0jkys3xm6xvd2ibb6kxl"; + } + { + pfile = "dvd+rw-tools-7.1-bluray_pow_freespace.patch"; + sha256 = "0iscz8fs5002ymk6wl2fz4x06b7bdnc57rfz8kbv3216acqi5rv3"; + } + { + pfile = "dvd+rw-tools-7.1-bluray_srm+pow.patch"; + sha256 = "0sy40m12w987i6g0cyxv8cfmab4vp7cd222lv05apknfi2y7smmw"; + } + { + pfile = "dvd+rw-tools-7.1-lastshort.patch"; + sha256 = "01wspv70sil20khkg5kj086b1x8rrig4yhcq9s88bdjd42nv0vpx"; + } + { + pfile = "dvd+rw-tools-7.1-noevent.patch"; + sha256 = "1kbmxpg15wci33f2h6pxxvf3qm0kpyzx9wj5a3l67sk34hvza3z6"; + } + ]; nativeBuildInputs = [ m4 ]; buildInputs = [ cdrtools ]; diff --git a/pkgs/by-name/dv/dvdstyler/package.nix b/pkgs/by-name/dv/dvdstyler/package.nix index 390438fe2da9..050cc09b78b4 100644 --- a/pkgs/by-name/dv/dvdstyler/package.nix +++ b/pkgs/by-name/dv/dvdstyler/package.nix @@ -56,23 +56,22 @@ stdenv.mkDerivation rec { xmlto zip ]; - buildInputs = - [ - cdrtools - dvdauthor - dvdplusrwtools - ffmpeg - fontconfig - glib - libexif - libjpeg - wxSVG - wxGTK32 - xine-ui - ] - ++ optionals dvdisasterSupport [ dvdisaster ] - ++ optionals udevSupport [ udev ] - ++ optionals dbusSupport [ dbus ]; + buildInputs = [ + cdrtools + dvdauthor + dvdplusrwtools + ffmpeg + fontconfig + glib + libexif + libjpeg + wxSVG + wxGTK32 + xine-ui + ] + ++ optionals dvdisasterSupport [ dvdisaster ] + ++ optionals udevSupport [ udev ] + ++ optionals dbusSupport [ dbus ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/dw/dwl/package.nix b/pkgs/by-name/dw/dwl/package.nix index ac4845a42ee3..f5e52b90cbf2 100644 --- a/pkgs/by-name/dw/dwl/package.nix +++ b/pkgs/by-name/dw/dwl/package.nix @@ -55,21 +55,20 @@ stdenv.mkDerivation (finalAttrs: { wayland-scanner ]; - buildInputs = - [ - libinput - libxcb - libxkbcommon - pixman - wayland - wayland-protocols - wlroots - ] - ++ lib.optionals enableXWayland [ - libX11 - xcbutilwm - xwayland - ]; + buildInputs = [ + libinput + libxcb + libxkbcommon + pixman + wayland + wayland-protocols + wlroots + ] + ++ lib.optionals enableXWayland [ + libX11 + xcbutilwm + xwayland + ]; outputs = [ "out" @@ -86,17 +85,16 @@ stdenv.mkDerivation (finalAttrs: { in lib.optionalString withCustomConfigH "cp ${configFile} config.h"; - makeFlags = - [ - "PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config" - "WAYLAND_SCANNER=wayland-scanner" - "PREFIX=$(out)" - "MANDIR=$(man)/share/man" - ] - ++ lib.optionals enableXWayland [ - ''XWAYLAND="-DXWAYLAND"'' - ''XLIBS="xcb xcb-icccm"'' - ]; + makeFlags = [ + "PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config" + "WAYLAND_SCANNER=wayland-scanner" + "PREFIX=$(out)" + "MANDIR=$(man)/share/man" + ] + ++ lib.optionals enableXWayland [ + ''XWAYLAND="-DXWAYLAND"'' + ''XLIBS="xcb xcb-icccm"'' + ]; strictDeps = true; diff --git a/pkgs/by-name/dw/dwm/package.nix b/pkgs/by-name/dw/dwm/package.nix index 39dcd69080b4..939bc608f40b 100644 --- a/pkgs/by-name/dw/dwm/package.nix +++ b/pkgs/by-name/dw/dwm/package.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation (finalAttrs: { libX11 libXinerama libXft - ] ++ extraLibs; + ] + ++ extraLibs; preBuild = '' makeFlagsArray+=( diff --git a/pkgs/by-name/dx/dxvk_1/package.nix b/pkgs/by-name/dx/dxvk_1/package.nix index ace6746f3f2a..889a037eb501 100644 --- a/pkgs/by-name/dx/dxvk_1/package.nix +++ b/pkgs/by-name/dx/dxvk_1/package.nix @@ -22,24 +22,23 @@ stdenv.mkDerivation (finalAttrs: { }; # These patches are required when using DXVK with Wine on Darwin. - patches = - [ - # Fixes errors building with GCC 13. - (fetchpatch { - url = "https://github.com/doitsujin/dxvk/commit/1a5afc77b1859e6c7e31b55e11ece899e3b5295a.patch"; - hash = "sha256-tTAsQOMAazgH/6laLNTuG2lki257VUR9EBivnD4vCuY="; - }) - # Fixes errors building with GCC 14. - ./gcc14-compat.patch - ] - ++ lib.optionals enableMoltenVKCompat [ - # Patch DXVK to work with MoltenVK even though it doesn’t support some required features. - # Some games work poorly (particularly Unreal Engine 4 games), but others work pretty well. - ./darwin-dxvk-compat.patch - # Use synchronization primitives from the C++ standard library to avoid deadlocks on Darwin. - # See: https://www.reddit.com/r/macgaming/comments/t8liua/comment/hzsuce9/ - ./darwin-thread-primitives.patch - ]; + patches = [ + # Fixes errors building with GCC 13. + (fetchpatch { + url = "https://github.com/doitsujin/dxvk/commit/1a5afc77b1859e6c7e31b55e11ece899e3b5295a.patch"; + hash = "sha256-tTAsQOMAazgH/6laLNTuG2lki257VUR9EBivnD4vCuY="; + }) + # Fixes errors building with GCC 14. + ./gcc14-compat.patch + ] + ++ lib.optionals enableMoltenVKCompat [ + # Patch DXVK to work with MoltenVK even though it doesn’t support some required features. + # Some games work poorly (particularly Unreal Engine 4 games), but others work pretty well. + ./darwin-dxvk-compat.patch + # Use synchronization primitives from the C++ standard library to avoid deadlocks on Darwin. + # See: https://www.reddit.com/r/macgaming/comments/t8liua/comment/hzsuce9/ + ./darwin-thread-primitives.patch + ]; strictDeps = true; diff --git a/pkgs/by-name/dx/dxvk_2/package.nix b/pkgs/by-name/dx/dxvk_2/package.nix index 240b73c34fe3..154987407116 100644 --- a/pkgs/by-name/dx/dxvk_2/package.nix +++ b/pkgs/by-name/dx/dxvk_2/package.nix @@ -47,21 +47,20 @@ stdenv.mkDerivation (finalAttrs: { fetchSubmodules = true; # Needed for the DirectX headers and libdisplay-info }; - postPatch = - '' - substituteInPlace meson.build \ - --replace-fail "dependency('glfw'" "dependency('glfw3'" - substituteInPlace subprojects/libdisplay-info/tool/gen-search-table.py \ - --replace-fail "/usr/bin/env python3" "${lib.getBin pkgsBuildHost.python3}/bin/python3" - '' - + lib.optionalString glfwSupport '' - substituteInPlace src/wsi/glfw/wsi_platform_glfw.cpp \ - --replace-fail '${libglfw}' '${lib.getLib glfw}/lib/${libglfw}' - '' - + lib.optionalString sdl2Support '' - substituteInPlace src/wsi/sdl2/wsi_platform_sdl2.cpp \ - --replace-fail '${libSDL2}' '${lib.getLib SDL2}/lib/${libSDL2}' - ''; + postPatch = '' + substituteInPlace meson.build \ + --replace-fail "dependency('glfw'" "dependency('glfw3'" + substituteInPlace subprojects/libdisplay-info/tool/gen-search-table.py \ + --replace-fail "/usr/bin/env python3" "${lib.getBin pkgsBuildHost.python3}/bin/python3" + '' + + lib.optionalString glfwSupport '' + substituteInPlace src/wsi/glfw/wsi_platform_glfw.cpp \ + --replace-fail '${libglfw}' '${lib.getLib glfw}/lib/${libglfw}' + '' + + lib.optionalString sdl2Support '' + substituteInPlace src/wsi/sdl2/wsi_platform_sdl2.cpp \ + --replace-fail '${libSDL2}' '${lib.getLib SDL2}/lib/${libSDL2}' + ''; strictDeps = true; @@ -69,16 +68,16 @@ stdenv.mkDerivation (finalAttrs: { glslang meson ninja - ] ++ lib.optionals (glfwSupport || sdl2Support) [ pkg-config ]; + ] + ++ lib.optionals (glfwSupport || sdl2Support) [ pkg-config ]; - buildInputs = - [ - spirv-headers - vulkan-headers - ] - ++ lib.optionals sdl2Support [ SDL2 ] - ++ lib.optionals glfwSupport [ glfw ] - ++ lib.optionals hostPlatform.isWindows [ windows.pthreads ]; + buildInputs = [ + spirv-headers + vulkan-headers + ] + ++ lib.optionals sdl2Support [ SDL2 ] + ++ lib.optionals glfwSupport [ glfw ] + ++ lib.optionals hostPlatform.isWindows [ windows.pthreads ]; # Build with the Vulkan SDK in nixpkgs. preConfigure = '' diff --git a/pkgs/by-name/dy/dyalog/package.nix b/pkgs/by-name/dy/dyalog/package.nix index 3b39b5c86428..8a9f5502db2e 100644 --- a/pkgs/by-name/dy/dyalog/package.nix +++ b/pkgs/by-name/dy/dyalog/package.nix @@ -76,86 +76,83 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - (lib.getLib stdenv.cc.cc) # Used by Conga and .NET Bridge - ncurses5 # Used by the dyalog binary to correctly display in the terminal - ] - ++ lib.optionals htmlRendererSupport [ - alsa-lib - gtk3 - libdrm - libGL - libgbm - nss - ] - ++ lib.optional sqaplSupport unixODBC; + buildInputs = [ + (lib.getLib stdenv.cc.cc) # Used by Conga and .NET Bridge + ncurses5 # Used by the dyalog binary to correctly display in the terminal + ] + ++ lib.optionals htmlRendererSupport [ + alsa-lib + gtk3 + libdrm + libGL + libgbm + nss + ] + ++ lib.optional sqaplSupport unixODBC; # See which files are not really important: `https://github.com/Dyalog/DyalogDocker/blob/master/rmfiles.sh` - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p ${dyalogHome} - cp -r aplfmt aplkeys apltrans Experimental fonts Library PublicCACerts SALT StartupSession ${dyalogHome} - cp aplkeys.sh default.dse dyalog dyalogc dyalog.rt dyalog.dcfg.template dyalog.ver.dcfg.template languagebar.json mapl StartupSession.aplf ${dyalogHome} + mkdir -p ${dyalogHome} + cp -r aplfmt aplkeys apltrans Experimental fonts Library PublicCACerts SALT StartupSession ${dyalogHome} + cp aplkeys.sh default.dse dyalog dyalogc dyalog.rt dyalog.dcfg.template dyalog.ver.dcfg.template languagebar.json mapl StartupSession.aplf ${dyalogHome} - mkdir ${dyalogHome}/lib - cp lib/{conga35_64.so,dyalog64.so,libconga35ssl64.so} ${dyalogHome}/lib + mkdir ${dyalogHome}/lib + cp lib/{conga35_64.so,dyalog64.so,libconga35ssl64.so} ${dyalogHome}/lib - # Only keep the most useful workspaces - mkdir ${dyalogHome}/ws - cp ws/{conga,dfns,isolate,loaddata,salt,sharpplot,util}.dws ${dyalogHome}/ws - '' - + lib.optionalString dotnetSupport '' - cp libnethost.so Dyalog.Net.Bridge.* Lokad.ILPack.dll ${dyalogHome} - '' - + lib.optionalString htmlRendererSupport '' - cp -r locales ${dyalogHome} - cp libcef.so libEGL.so libGLESv2.so libvk_swiftshader.so libvulkan.so.1 ${dyalogHome} - cp chrome-sandbox icudtl.dat snapshot_blob.bin v8_context_snapshot.bin vk_swiftshader_icd.json *.pak ${dyalogHome} - cp lib/htmlrenderer.so ${dyalogHome}/lib - '' - + lib.optionalString sqaplSupport '' - cp lib/cxdya65u64u.so ${dyalogHome}/lib - cp ws/sqapl.dws ${dyalogHome}/ws - cp odbc.ini.sample sqapl.err sqapl.ini ${dyalogHome} - '' - + lib.optionalString zeroFootprintRideSupport '' - cp -r RIDEapp ${dyalogHome} - '' - + lib.optionalString enableDocs '' - mkdir -p $doc/share/doc/dyalog - cp -r help/* $doc/share/doc/dyalog - ln -s $doc/share/doc/dyalog ${dyalogHome}/help - '' - + '' - install -Dm644 dyalog.svg -t $out/share/icons/hicolor/scalable/apps - install -Dm644 dyalog.desktop -t $out/share/applications + # Only keep the most useful workspaces + mkdir ${dyalogHome}/ws + cp ws/{conga,dfns,isolate,loaddata,salt,sharpplot,util}.dws ${dyalogHome}/ws + '' + + lib.optionalString dotnetSupport '' + cp libnethost.so Dyalog.Net.Bridge.* Lokad.ILPack.dll ${dyalogHome} + '' + + lib.optionalString htmlRendererSupport '' + cp -r locales ${dyalogHome} + cp libcef.so libEGL.so libGLESv2.so libvk_swiftshader.so libvulkan.so.1 ${dyalogHome} + cp chrome-sandbox icudtl.dat snapshot_blob.bin v8_context_snapshot.bin vk_swiftshader_icd.json *.pak ${dyalogHome} + cp lib/htmlrenderer.so ${dyalogHome}/lib + '' + + lib.optionalString sqaplSupport '' + cp lib/cxdya65u64u.so ${dyalogHome}/lib + cp ws/sqapl.dws ${dyalogHome}/ws + cp odbc.ini.sample sqapl.err sqapl.ini ${dyalogHome} + '' + + lib.optionalString zeroFootprintRideSupport '' + cp -r RIDEapp ${dyalogHome} + '' + + lib.optionalString enableDocs '' + mkdir -p $doc/share/doc/dyalog + cp -r help/* $doc/share/doc/dyalog + ln -s $doc/share/doc/dyalog ${dyalogHome}/help + '' + + '' + install -Dm644 dyalog.svg -t $out/share/icons/hicolor/scalable/apps + install -Dm644 dyalog.desktop -t $out/share/applications - for exec in "dyalog" "mapl"; do - makeWrapper ${dyalogHome}/$exec $out/bin/$exec ${toString makeWrapperArgs} - done + for exec in "dyalog" "mapl"; do + makeWrapper ${dyalogHome}/$exec $out/bin/$exec ${toString makeWrapperArgs} + done - install -Dm755 scriptbin/dyalogscript $out/bin/dyalogscript - substituteInPlace $out/bin/dyalogscript \ - --subst-var-by installdir ${dyalogHome} \ - --subst-var-by scriptdir $out/bin + install -Dm755 scriptbin/dyalogscript $out/bin/dyalogscript + substituteInPlace $out/bin/dyalogscript \ + --subst-var-by installdir ${dyalogHome} \ + --subst-var-by scriptdir $out/bin - runHook postInstall - ''; + runHook postInstall + ''; # Register some undeclared runtime dependencies to be patched in by autoPatchelfHook # Note: dyalog.rt is used internally to run child APL processes in - preFixup = - '' - for exec in "dyalog" "dyalog.rt"; do - patchelf ${dyalogHome}/$exec --add-needed libncurses.so - done - '' - + lib.optionalString htmlRendererSupport '' - patchelf ${dyalogHome}/libcef.so --add-needed libudev.so --add-needed libGL.so - ''; + preFixup = '' + for exec in "dyalog" "dyalog.rt"; do + patchelf ${dyalogHome}/$exec --add-needed libncurses.so + done + '' + + lib.optionalString htmlRendererSupport '' + patchelf ${dyalogHome}/libcef.so --add-needed libudev.so --add-needed libGL.so + ''; meta = { changelog = "https://dyalog.com/dyalog/dyalog-versions/${ diff --git a/pkgs/by-name/dy/dynarmic/package.nix b/pkgs/by-name/dy/dynarmic/package.nix index 00988dadc887..446cd544b346 100644 --- a/pkgs/by-name/dy/dynarmic/package.nix +++ b/pkgs/by-name/dy/dynarmic/package.nix @@ -82,30 +82,28 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - ninja - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.DarwinTools # sw_ver - darwin.bootstrap_cmds # mig - ]; + nativeBuildInputs = [ + cmake + ninja + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.DarwinTools # sw_ver + darwin.bootstrap_cmds # mig + ]; - buildInputs = - [ - boost - robin-map - mcl - fmt - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - oaknut - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - xbyak - zydis - ]; + buildInputs = [ + boost + robin-map + mcl + fmt + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + oaknut + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + xbyak + zydis + ]; checkInputs = [ catch2_3 diff --git a/pkgs/by-name/e2/e2fsprogs/package.nix b/pkgs/by-name/e2/e2fsprogs/package.nix index b50d99f801e3..be1620f2ffe8 100644 --- a/pkgs/by-name/e2/e2fsprogs/package.nix +++ b/pkgs/by-name/e2/e2fsprogs/package.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation rec { "out" "man" "info" - ] ++ lib.optionals withFuse [ "fuse2fs" ]; + ] + ++ lib.optionals withFuse [ "fuse2fs" ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ @@ -57,44 +58,43 @@ stdenv.mkDerivation rec { libuuid gettext libarchive - ] ++ lib.optionals withFuse [ fuse3 ]; + ] + ++ lib.optionals withFuse [ fuse3 ]; - configureFlags = - [ - "--with-libarchive=direct" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # It seems that the e2fsprogs is one of the few packages that cannot be - # build with shared and static libs. - (if shared then "--enable-elf-shlibs" else "--disable-elf-shlibs") - "--enable-symlink-install" - "--enable-relative-symlinks" - "--with-crond-dir=no" - # fsck, libblkid, libuuid and uuidd are in util-linux-ng (the "libuuid" dependency) - "--disable-fsck" - "--disable-libblkid" - "--disable-libuuid" - "--disable-uuidd" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "--enable-libuuid" - "--disable-e2initrd-helper" - ]; + configureFlags = [ + "--with-libarchive=direct" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # It seems that the e2fsprogs is one of the few packages that cannot be + # build with shared and static libs. + (if shared then "--enable-elf-shlibs" else "--disable-elf-shlibs") + "--enable-symlink-install" + "--enable-relative-symlinks" + "--with-crond-dir=no" + # fsck, libblkid, libuuid and uuidd are in util-linux-ng (the "libuuid" dependency) + "--disable-fsck" + "--disable-libblkid" + "--disable-libuuid" + "--disable-uuidd" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "--enable-libuuid" + "--disable-e2initrd-helper" + ]; nativeCheckInputs = [ buildPackages.perl ]; doCheck = true; - postInstall = - '' - # avoid cycle between outputs - if [ -f $out/lib/${pname}/e2scrub_all_cron ]; then - mv $out/lib/${pname}/e2scrub_all_cron $bin/bin/ - fi - '' - + lib.optionalString withFuse '' - mkdir -p $fuse2fs/bin - mv $bin/bin/fuse2fs $fuse2fs/bin/fuse2fs - ''; + postInstall = '' + # avoid cycle between outputs + if [ -f $out/lib/${pname}/e2scrub_all_cron ]; then + mv $out/lib/${pname}/e2scrub_all_cron $bin/bin/ + fi + '' + + lib.optionalString withFuse '' + mkdir -p $fuse2fs/bin + mv $bin/bin/fuse2fs $fuse2fs/bin/fuse2fs + ''; enableParallelBuilding = true; diff --git a/pkgs/by-name/ea/earlyoom/package.nix b/pkgs/by-name/ea/earlyoom/package.nix index ed3f0006b466..442632cd4914 100644 --- a/pkgs/by-name/ea/earlyoom/package.nix +++ b/pkgs/by-name/ea/earlyoom/package.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "VERSION=${finalAttrs.version}" "PREFIX=${placeholder "out"}" - ] ++ lib.optional withManpage "MANDIR=${placeholder "man"}/share/man"; + ] + ++ lib.optional withManpage "MANDIR=${placeholder "man"}/share/man"; passthru.tests = { inherit (nixosTests) earlyoom; diff --git a/pkgs/by-name/ea/eartag/package.nix b/pkgs/by-name/ea/eartag/package.nix index 52c063b6f548..46ec9fd4ea5a 100644 --- a/pkgs/by-name/ea/eartag/package.nix +++ b/pkgs/by-name/ea/eartag/package.nix @@ -52,7 +52,8 @@ python3Packages.buildPythonApplication rec { gobject-introspection wrapGAppsHook4 blueprint-compiler - ] ++ lib.optional stdenv.hostPlatform.isDarwin gtk4; # for gtk4-update-icon-cache + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gtk4; # for gtk4-update-icon-cache buildInputs = [ librsvg diff --git a/pkgs/by-name/ea/earthly/package.nix b/pkgs/by-name/ea/earthly/package.nix index 157ed63fd5d5..cf1bedfff18c 100644 --- a/pkgs/by-name/ea/earthly/package.nix +++ b/pkgs/by-name/ea/earthly/package.nix @@ -26,18 +26,17 @@ buildGoModule rec { env.CGO_ENABLED = 0; - ldflags = - [ - "-s" - "-w" - "-X main.Version=v${version}" - "-X main.DefaultBuildkitdImage=docker.io/earthly/buildkitd:v${version}" - "-X main.GitSha=v${version}" - "-X main.DefaultInstallationName=earthly" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-extldflags '-static'" - ]; + ldflags = [ + "-s" + "-w" + "-X main.Version=v${version}" + "-X main.DefaultBuildkitdImage=docker.io/earthly/buildkitd:v${version}" + "-X main.GitSha=v${version}" + "-X main.DefaultInstallationName=earthly" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-extldflags '-static'" + ]; tags = [ "dfrunmount" diff --git a/pkgs/by-name/ea/easypdkprog/package.nix b/pkgs/by-name/ea/easypdkprog/package.nix index 82ddba4c4404..a0a40700041c 100644 --- a/pkgs/by-name/ea/easypdkprog/package.nix +++ b/pkgs/by-name/ea/easypdkprog/package.nix @@ -22,13 +22,12 @@ stdenv.mkDerivation rec { doInstallCheck = true; - installPhase = - '' - install -Dm755 -t $out/bin easypdkprog - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm644 -t $out/etc/udev/rules.d Linux_udevrules/70-stm32vcp.rules - ''; + installPhase = '' + install -Dm755 -t $out/bin easypdkprog + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm644 -t $out/etc/udev/rules.d Linux_udevrules/70-stm32vcp.rules + ''; meta = with lib; { description = "Read, write and execute programs on PADAUK microcontroller"; diff --git a/pkgs/by-name/ea/easyrpg-player/package.nix b/pkgs/by-name/ea/easyrpg-player/package.nix index 6e996f245fbe..1105324c7f32 100644 --- a/pkgs/by-name/ea/easyrpg-player/package.nix +++ b/pkgs/by-name/ea/easyrpg-player/package.nix @@ -60,42 +60,41 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - flac # needed by libsndfile - fluidsynth - fmt - freetype - glib - harfbuzz - lhasa - liblcf - libpng - libsndfile - libsysprof-capture # needed by glib - libvorbis - libxmp - mpg123 - nlohmann_json - opusfile - pcre2 # needed by glib - pixman - sdl3 - speexdsp - wildmidi - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libXcursor - libXext - libXi - libXinerama - libXrandr - libXScrnSaver - libXxf86vm - libdecor - ]; + buildInputs = [ + flac # needed by libsndfile + fluidsynth + fmt + freetype + glib + harfbuzz + lhasa + liblcf + libpng + libsndfile + libsysprof-capture # needed by glib + libvorbis + libxmp + mpg123 + nlohmann_json + opusfile + pcre2 # needed by glib + pixman + sdl3 + speexdsp + wildmidi + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libXcursor + libXext + libXi + libXinerama + libXrandr + libXScrnSaver + libXxf86vm + libdecor + ]; cmakeFlags = [ "-DPLAYER_ENABLE_TESTS=${lib.boolToString doCheck}" diff --git a/pkgs/by-name/eb/ebpf-usb/package.nix b/pkgs/by-name/eb/ebpf-usb/package.nix index e030816c2392..3a2e041da2a6 100644 --- a/pkgs/by-name/eb/ebpf-usb/package.nix +++ b/pkgs/by-name/eb/ebpf-usb/package.nix @@ -21,11 +21,12 @@ python3Packages.buildPythonApplication { "--set PYTHONUNBUFFERED 1" ]; - pythonPath = - [ bcc ] - ++ (with python3Packages; [ - hexdump - ]); + pythonPath = [ + bcc + ] + ++ (with python3Packages; [ + hexdump + ]); postPatch = '' substituteInPlace ebpf-usb.py \ diff --git a/pkgs/by-name/eb/ebtks/package.nix b/pkgs/by-name/eb/ebtks/package.nix index e1d62ad41d0d..49ebea565d7a 100644 --- a/pkgs/by-name/eb/ebtks/package.nix +++ b/pkgs/by-name/eb/ebtks/package.nix @@ -18,15 +18,14 @@ stdenv.mkDerivation { }; # error: use of undeclared identifier 'finite'; did you mean 'isfinite'? - postPatch = - '' - substituteInPlace templates/EBTKS/SimpleArray.h \ - --replace "#define FINITE(x) finite(x)" "#define FINITE(x) isfinite(x)" - '' - # error: ISO C++17 does not allow 'register' storage class specifier - + '' - find . -type f -exec sed -i -e 's/register //g' {} + - ''; + postPatch = '' + substituteInPlace templates/EBTKS/SimpleArray.h \ + --replace "#define FINITE(x) finite(x)" "#define FINITE(x) isfinite(x)" + '' + # error: ISO C++17 does not allow 'register' storage class specifier + + '' + find . -type f -exec sed -i -e 's/register //g' {} + + ''; nativeBuildInputs = [ cmake ]; buildInputs = [ libminc ]; diff --git a/pkgs/by-name/ec/ecapture/package.nix b/pkgs/by-name/ec/ecapture/package.nix index f80d7754a033..e9f1d32455c0 100644 --- a/pkgs/by-name/ec/ecapture/package.nix +++ b/pkgs/by-name/ec/ecapture/package.nix @@ -97,23 +97,22 @@ buildGoModule rec { --replace-fail '"errors"' ' ' ''; - postConfigure = - '' - sed -i '/git/d' Makefile - sed -i '/git/d' variables.mk + postConfigure = '' + sed -i '/git/d' Makefile + sed -i '/git/d' variables.mk - substituteInPlace Makefile \ - --replace-fail '/bin/bash' '${lib.getExe bash}' - '' - + lib.optionalString withNonBTF '' - substituteInPlace variables.mk \ - --replace-fail "-emit-llvm" "-emit-llvm -I${kernel.dev}/lib/modules/${kernel.modDirVersion}/build/include -Wno-error=implicit-function-declaration" - KERN_BUILD_PATH=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build KERN_SRC_PATH=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source make ebpf_noncore - '' - + '' - make ebpf - go-bindata -pkg assets -o "assets/ebpf_probe.go" $(find user/bytecode -name "*.o" -printf "./%p ") - ''; + substituteInPlace Makefile \ + --replace-fail '/bin/bash' '${lib.getExe bash}' + '' + + lib.optionalString withNonBTF '' + substituteInPlace variables.mk \ + --replace-fail "-emit-llvm" "-emit-llvm -I${kernel.dev}/lib/modules/${kernel.modDirVersion}/build/include -Wno-error=implicit-function-declaration" + KERN_BUILD_PATH=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build KERN_SRC_PATH=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source make ebpf_noncore + '' + + '' + make ebpf + go-bindata -pkg assets -o "assets/ebpf_probe.go" $(find user/bytecode -name "*.o" -printf "./%p ") + ''; checkFlags = let diff --git a/pkgs/by-name/ec/eclib/package.nix b/pkgs/by-name/ec/eclib/package.nix index 23a8783d819a..906a5a2e44ac 100644 --- a/pkgs/by-name/ec/eclib/package.nix +++ b/pkgs/by-name/ec/eclib/package.nix @@ -34,15 +34,14 @@ stdenv.mkDerivation rec { url = "https://github.com/JohnCremona/eclib/releases/download/${version}/eclib-${version}.tar.bz2"; hash = "sha256-uI1LUmEuSRxUFZRtnjXyBiyhAV7n+74LYfFY+nTLS8k="; }; - buildInputs = - [ - pari - ntl - gmp - ] - ++ lib.optionals withFlint [ - flint - ]; + buildInputs = [ + pari + ntl + gmp + ] + ++ lib.optionals withFlint [ + flint + ]; nativeBuildInputs = [ autoreconfHook ]; diff --git a/pkgs/by-name/ec/ecryptfs/package.nix b/pkgs/by-name/ec/ecryptfs/package.nix index 2d94a4a27ba3..d38fc3e91101 100644 --- a/pkgs/by-name/ec/ecryptfs/package.nix +++ b/pkgs/by-name/ec/ecryptfs/package.nix @@ -58,20 +58,20 @@ stdenv.mkDerivation rec { configureFlags = [ " --disable-openssl" ] ++ lib.optionals (!enablePython) [ "--disable-pywrap" ]; - nativeBuildInputs = - [ - pkg-config - makeWrapper - intltool - ] - # if python2 support is requested, it is needed at builtime as well as runtime. - ++ lib.optionals (enablePython) [ python2 ]; + nativeBuildInputs = [ + pkg-config + makeWrapper + intltool + ] + # if python2 support is requested, it is needed at builtime as well as runtime. + ++ lib.optionals (enablePython) [ python2 ]; buildInputs = [ perl nss nspr pam - ] ++ lib.optionals (enablePython) [ python2 ]; + ] + ++ lib.optionals (enablePython) [ python2 ]; propagatedBuildInputs = [ coreutils gettext diff --git a/pkgs/by-name/ec/ecwolf/package.nix b/pkgs/by-name/ec/ecwolf/package.nix index f8c3a8fe638a..1d899af79e91 100644 --- a/pkgs/by-name/ec/ecwolf/package.nix +++ b/pkgs/by-name/ec/ecwolf/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; buildInputs = [ zlib bzip2 diff --git a/pkgs/by-name/ed/edencommon/package.nix b/pkgs/by-name/ed/edencommon/package.nix index 69f00ab94a52..85fe05ee86ab 100644 --- a/pkgs/by-name/ed/edencommon/package.nix +++ b/pkgs/by-name/ed/edencommon/package.nix @@ -35,14 +35,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-WlLQb4O4rGhXp+bQrJA12CvrwcIS6vzO4W6bX04vKMM="; }; - patches = - [ - ./glog-0.7.patch - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # Test discovery timeout is bizarrely flaky on `x86_64-darwin` - ./increase-test-discovery-timeout.patch - ]; + patches = [ + ./glog-0.7.patch + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # Test discovery timeout is bizarrely flaky on `x86_64-darwin` + ./increase-test-discovery-timeout.patch + ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/ed/edk2-uefi-shell/package.nix b/pkgs/by-name/ed/edk2-uefi-shell/package.nix index b1d1beb266ef..8853243cc597 100644 --- a/pkgs/by-name/ed/edk2-uefi-shell/package.nix +++ b/pkgs/by-name/ed/edk2-uefi-shell/package.nix @@ -12,16 +12,15 @@ edk2.mkDerivation "ShellPkg/ShellPkg.dsc" (finalAttrs: { pname = "edk2-uefi-shell"; inherit (edk2) version; - nativeBuildInputs = - [ - util-linux - nasm - python3 - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.bintools - llvmPackages.llvm - ]; + nativeBuildInputs = [ + util-linux + nasm + python3 + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.bintools + llvmPackages.llvm + ]; strictDeps = true; env.NIX_CFLAGS_COMPILE = toString ( diff --git a/pkgs/by-name/ed/edk2/package.nix b/pkgs/by-name/ed/edk2/package.nix index f4b09fd67509..df99f6598093 100644 --- a/pkgs/by-name/ed/edk2/package.nix +++ b/pkgs/by-name/ed/edk2/package.nix @@ -158,7 +158,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ bc pythonEnv - ] ++ attrs.nativeBuildInputs or [ ]; + ] + ++ attrs.nativeBuildInputs or [ ]; strictDeps = true; ${"GCC5_${targetArch}_PREFIX"} = stdenv.cc.targetPrefix; diff --git a/pkgs/by-name/ed/eduke32/package.nix b/pkgs/by-name/ed/eduke32/package.nix index 561eafad8a9f..6f8644c2d827 100644 --- a/pkgs/by-name/ed/eduke32/package.nix +++ b/pkgs/by-name/ed/eduke32/package.nix @@ -50,44 +50,41 @@ stdenv.mkDerivation (finalAttrs: { ./convert-bmp-to-png.diff ]; - buildInputs = - [ - flac - libvorbis - libvpx - SDL2 - SDL2_mixer - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libGL - xorg.libX11 - ]; + buildInputs = [ + flac + libvorbis + libvpx + SDL2 + SDL2_mixer + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libGL + xorg.libX11 + ]; - nativeBuildInputs = - [ - makeWrapper - pkg-config - copyDesktopItems - graphicsmagick - ] - ++ lib.optionals (stdenv.hostPlatform.system == "i686-linux") [ - nasm - ]; + nativeBuildInputs = [ + makeWrapper + pkg-config + copyDesktopItems + graphicsmagick + ] + ++ lib.optionals (stdenv.hostPlatform.system == "i686-linux") [ + nasm + ]; - postPatch = - '' - substituteInPlace source/imgui/src/imgui_impl_sdl2.cpp \ - --replace-fail '#include ' '#include ' \ - --replace-fail '#include ' '#include ' \ - --replace-fail '#include ' '#include ' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - for f in glad.c glad_wgl.c ; do - substituteInPlace source/glad/src/$f \ - --replace-fail libGL.so ${libGL}/lib/libGL.so - done - ''; + postPatch = '' + substituteInPlace source/imgui/src/imgui_impl_sdl2.cpp \ + --replace-fail '#include ' '#include ' \ + --replace-fail '#include ' '#include ' \ + --replace-fail '#include ' '#include ' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + for f in glad.c glad_wgl.c ; do + substituteInPlace source/glad/src/$f \ + --replace-fail libGL.so ${libGL}/lib/libGL.so + done + ''; makeFlags = [ "SDLCONFIG=${SDL2}/bin/sdl2-config" @@ -137,48 +134,47 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - install -Dm755 -t $out/bin eduke32 mapster32 voidsw wangulator - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - makeWrapper $out/bin/eduke32 $out/bin/${wrapper} \ - --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ - --add-flags '-j"$EDUKE32_DATA_DIR"' \ - --add-flags '-gamegrp DUKE3D.GRP' - makeWrapper $out/bin/voidsw $out/bin/${swWrapper} \ - --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ - --add-flags '-j"$EDUKE32_DATA_DIR"' - makeWrapper $out/bin/eduke32 $out/bin/${furyWrapper} \ - --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ - --add-flags '-j"$EDUKE32_DATA_DIR"' \ - --add-flags '-gamegrp FURY.GRP' - mkdir -p $out/share/icons/hicolor/scalable/apps - gm convert "./source/duke3d/rsrc/game_icon.ico[10]" $out/share/icons/hicolor/scalable/apps/eduke32.png - install -Dm644 ./source/sw/rsrc/game_icon.svg $out/share/icons/hicolor/scalable/apps/voidsw.svg - gm convert "./source/duke3d/rsrc/fury/game_icon.ico[4]" $out/share/icons/hicolor/scalable/apps/fury.png - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications/EDuke32.app/Contents/MacOS - mkdir -p $out/Applications/Mapster32.app/Contents/MacOS - mkdir -p $out/Applications/VoidSW.app/Contents/MacOS - mkdir -p $out/Applications/Wangulator.app/Contents/MacOS + install -Dm755 -t $out/bin eduke32 mapster32 voidsw wangulator + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + makeWrapper $out/bin/eduke32 $out/bin/${wrapper} \ + --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ + --add-flags '-j"$EDUKE32_DATA_DIR"' \ + --add-flags '-gamegrp DUKE3D.GRP' + makeWrapper $out/bin/voidsw $out/bin/${swWrapper} \ + --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ + --add-flags '-j"$EDUKE32_DATA_DIR"' + makeWrapper $out/bin/eduke32 $out/bin/${furyWrapper} \ + --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ + --add-flags '-j"$EDUKE32_DATA_DIR"' \ + --add-flags '-gamegrp FURY.GRP' + mkdir -p $out/share/icons/hicolor/scalable/apps + gm convert "./source/duke3d/rsrc/game_icon.ico[10]" $out/share/icons/hicolor/scalable/apps/eduke32.png + install -Dm644 ./source/sw/rsrc/game_icon.svg $out/share/icons/hicolor/scalable/apps/voidsw.svg + gm convert "./source/duke3d/rsrc/fury/game_icon.ico[4]" $out/share/icons/hicolor/scalable/apps/fury.png + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications/EDuke32.app/Contents/MacOS + mkdir -p $out/Applications/Mapster32.app/Contents/MacOS + mkdir -p $out/Applications/VoidSW.app/Contents/MacOS + mkdir -p $out/Applications/Wangulator.app/Contents/MacOS - cp -r platform/Apple/bundles/EDuke32.app/* $out/Applications/EDuke32.app/ - cp -r platform/Apple/bundles/Mapster32.app/* $out/Applications/Mapster32.app/ - cp -r platform/Apple/bundles/VoidSW.app/* $out/Applications/VoidSW.app/ - cp -r platform/Apple/bundles/Wangulator.app/* $out/Applications/Wangulator.app/ + cp -r platform/Apple/bundles/EDuke32.app/* $out/Applications/EDuke32.app/ + cp -r platform/Apple/bundles/Mapster32.app/* $out/Applications/Mapster32.app/ + cp -r platform/Apple/bundles/VoidSW.app/* $out/Applications/VoidSW.app/ + cp -r platform/Apple/bundles/Wangulator.app/* $out/Applications/Wangulator.app/ - ln -sf $out/bin/eduke32 $out/Applications/EDuke32.app/Contents/MacOS/eduke32 - ln -sf $out/bin/mapster32 $out/Applications/Mapster32.app/Contents/MacOS/mapster32 - ln -sf $out/bin/voidsw $out/Applications/VoidSW.app/Contents/MacOS/voidsw - ln -sf $out/bin/wangulator $out/Applications/Wangulator.app/Contents/MacOS/wangulator - '' - + '' - runHook postInstall - ''; + ln -sf $out/bin/eduke32 $out/Applications/EDuke32.app/Contents/MacOS/eduke32 + ln -sf $out/bin/mapster32 $out/Applications/Mapster32.app/Contents/MacOS/mapster32 + ln -sf $out/bin/voidsw $out/Applications/VoidSW.app/Contents/MacOS/voidsw + ln -sf $out/bin/wangulator $out/Applications/Wangulator.app/Contents/MacOS/wangulator + '' + + '' + runHook postInstall + ''; passthru.updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; diff --git a/pkgs/by-name/eg/eggnog-mapper/package.nix b/pkgs/by-name/eg/eggnog-mapper/package.nix index 7b5e2cd464d7..815c2dd5851d 100644 --- a/pkgs/by-name/eg/eggnog-mapper/package.nix +++ b/pkgs/by-name/eg/eggnog-mapper/package.nix @@ -33,15 +33,14 @@ python3Packages.buildPythonApplication rec { zlib ]; - propagatedBuildInputs = - [ - wget - ] - ++ (with python3Packages; [ - biopython - psutil - xlsxwriter - ]); + propagatedBuildInputs = [ + wget + ] + ++ (with python3Packages; [ + biopython + psutil + xlsxwriter + ]); # Tests rely on some of the databases being available, which is not bundled # with this package as (1) in total, they represent >100GB of data, and (2) diff --git a/pkgs/by-name/ei/eiwd/package.nix b/pkgs/by-name/ei/eiwd/package.nix index 91c06efbb0d1..d5af257d8937 100644 --- a/pkgs/by-name/ei/eiwd/package.nix +++ b/pkgs/by-name/ei/eiwd/package.nix @@ -22,43 +22,40 @@ stdenv.mkDerivation (finalAttrs: { fetchSubmodules = true; }; - outputs = - [ - "out" - "doc" - ] - ++ lib.optionals enableManpages [ - "man" - ] - ++ lib.optionals finalAttrs.doCheck [ - "test" - ]; + outputs = [ + "out" + "doc" + ] + ++ lib.optionals enableManpages [ + "man" + ] + ++ lib.optionals finalAttrs.doCheck [ + "test" + ]; postUnpack = '' patchShebangs . ''; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - ] - ++ lib.optionals enableManpages [ - docutils # only for the man pages - ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ] + ++ lib.optionals enableManpages [ + docutils # only for the man pages + ]; checkInputs = [ python3Packages.python (lib.getBin openssl) ]; - configureFlags = - [ - "--disable-dbus" - ] - ++ lib.optionals (!enableManpages) [ - "--disable-manual-pages" - ]; + configureFlags = [ + "--disable-dbus" + ] + ++ lib.optionals (!enableManpages) [ + "--disable-manual-pages" + ]; enableParallelBuilding = true; @@ -74,16 +71,15 @@ stdenv.mkDerivation (finalAttrs: { 'true' ''; - postInstall = - '' - mkdir -p $doc/share/doc - cp -a doc $doc/share/doc/iwd - cp -a README AUTHORS TODO $doc/share/doc/iwd - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - mkdir -p $test/bin - cp -a test/* $test/bin/ - ''; + postInstall = '' + mkdir -p $doc/share/doc + cp -a doc $doc/share/doc/iwd + cp -a README AUTHORS TODO $doc/share/doc/iwd + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + mkdir -p $test/bin + cp -a test/* $test/bin/ + ''; meta = with lib; { homepage = "https://github.com/illiliti/eiwd/"; diff --git a/pkgs/by-name/ej/ejabberd/package.nix b/pkgs/by-name/ej/ejabberd/package.nix index dee0cad6572c..433e2022d3a3 100644 --- a/pkgs/by-name/ej/ejabberd/package.nix +++ b/pkgs/by-name/ej/ejabberd/package.nix @@ -154,17 +154,18 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - buildInputs = - [ beamPackages.erlang ] - ++ builtins.attrValues beamDeps - ++ lib.optional withMysql allBeamDeps.p1_mysql - ++ lib.optional withPgsql allBeamDeps.p1_pgsql - ++ lib.optional withSqlite allBeamDeps.sqlite3 - ++ lib.optional withPam allBeamDeps.epam - ++ lib.optional withZlib allBeamDeps.ezlib - ++ lib.optional withSip allBeamDeps.esip - ++ lib.optional withLua allBeamDeps.luerl - ++ lib.optional withRedis allBeamDeps.eredis; + buildInputs = [ + beamPackages.erlang + ] + ++ builtins.attrValues beamDeps + ++ lib.optional withMysql allBeamDeps.p1_mysql + ++ lib.optional withPgsql allBeamDeps.p1_pgsql + ++ lib.optional withSqlite allBeamDeps.sqlite3 + ++ lib.optional withPam allBeamDeps.epam + ++ lib.optional withZlib allBeamDeps.ezlib + ++ lib.optional withSip allBeamDeps.esip + ++ lib.optional withLua allBeamDeps.luerl + ++ lib.optional withRedis allBeamDeps.eredis; src = fetchFromGitHub { owner = "processone"; @@ -187,7 +188,8 @@ stdenv.mkDerivation (finalAttrs: { (lib.enableFeature withLua "lua") (lib.enableFeature withTools "tools") (lib.enableFeature withRedis "redis") - ] ++ lib.optional withSqlite "--with-sqlite3=${sqlite.dev}"; + ] + ++ lib.optional withSqlite "--with-sqlite3=${sqlite.dev}"; enableParallelBuilding = true; diff --git a/pkgs/by-name/el/elan/package.nix b/pkgs/by-name/el/elan/package.nix index c32b54a724fc..48876eca651b 100644 --- a/pkgs/by-name/el/elan/package.nix +++ b/pkgs/by-name/el/elan/package.nix @@ -38,7 +38,8 @@ rustPlatform.buildRustPackage rec { curl zlib openssl - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; buildFeatures = [ "no-self-update" ]; diff --git a/pkgs/by-name/el/element-desktop/keytar/default.nix b/pkgs/by-name/el/element-desktop/keytar/default.nix index 56a49eef1459..38461bbbc1e7 100644 --- a/pkgs/by-name/el/element-desktop/keytar/default.nix +++ b/pkgs/by-name/el/element-desktop/keytar/default.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { python3 pkg-config npmHooks.npmConfigHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ libsecret ]; diff --git a/pkgs/by-name/el/element-desktop/package.nix b/pkgs/by-name/el/element-desktop/package.nix index 65e9a611ae30..a0f9eb7b35fe 100644 --- a/pkgs/by-name/el/element-desktop/package.nix +++ b/pkgs/by-name/el/element-desktop/package.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation ( jq yarn typescript - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; inherit seshat; diff --git a/pkgs/by-name/el/elfutils/package.nix b/pkgs/by-name/el/elfutils/package.nix index 25ddfb23fce8..9b69efdc42de 100644 --- a/pkgs/by-name/el/elfutils/package.nix +++ b/pkgs/by-name/el/elfutils/package.nix @@ -57,18 +57,18 @@ stdenv.mkDerivation rec { url = "https://git.alpinelinux.org/aports/plain/main/elfutils/musl-strndupa.patch?id=2e3d4976eeffb4704cf83e2cc3306293b7c7b2e9"; sha256 = "sha256-7daehJj1t0wPtQzTv+/Rpuqqs5Ng/EYnZzrcf2o/Lb0="; }) - ] ++ lib.optionals stdenv.hostPlatform.isMusl [ ./musl-error_h.patch ]; + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ ./musl-error_h.patch ]; - postPatch = - '' - patchShebangs tests/*.sh - '' - + lib.optionalString stdenv.hostPlatform.isRiscV '' - # disable failing test: - # - # > dwfl_thread_getframes: No DWARF information found - sed -i s/run-backtrace-dwarf.sh//g tests/Makefile.in - ''; + postPatch = '' + patchShebangs tests/*.sh + '' + + lib.optionalString stdenv.hostPlatform.isRiscV '' + # disable failing test: + # + # > dwfl_thread_getframes: No DWARF information found + sed -i s/run-backtrace-dwarf.sh//g tests/Makefile.in + ''; outputs = [ "bin" @@ -85,26 +85,26 @@ stdenv.mkDerivation rec { flex gettext bzip2 - ] ++ lib.optional enableDebuginfod pkg-config; - buildInputs = - [ - zlib - zstd - bzip2 - xz - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - argp-standalone - musl-fts - musl-obstack - ] - ++ lib.optionals enableDebuginfod [ - sqlite - curl - json_c - libmicrohttpd - libarchive - ]; + ] + ++ lib.optional enableDebuginfod pkg-config; + buildInputs = [ + zlib + zstd + bzip2 + xz + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + argp-standalone + musl-fts + musl-obstack + ] + ++ lib.optionals enableDebuginfod [ + sqlite + curl + json_c + libmicrohttpd + libarchive + ]; propagatedNativeBuildInputs = [ setupDebugInfoDirs ]; @@ -131,7 +131,8 @@ stdenv.mkDerivation rec { # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766 # Versioned symbols are nice to have, but we can do without. (lib.enableFeature (!stdenv.hostPlatform.isMicroBlaze) "symbol-versioning") - ] ++ lib.optional (stdenv.targetPlatform.useLLVM or false) "--disable-demangler"; + ] + ++ lib.optional (stdenv.targetPlatform.useLLVM or false) "--disable-demangler"; enableParallelBuilding = true; diff --git a/pkgs/by-name/el/eli/package.nix b/pkgs/by-name/el/eli/package.nix index fb052cc170a6..40bc6e607c94 100644 --- a/pkgs/by-name/el/eli/package.nix +++ b/pkgs/by-name/el/eli/package.nix @@ -38,17 +38,16 @@ stdenv.mkDerivation rec { sha256 = "1vran8583hbwrr5dciji4zkhz3f88w4mn8n9sdpr6zw0plpf1whj"; }; - buildInputs = - [ - ncurses - fontconfig - ] - ++ (with xorg; [ - libX11.dev - libXt.dev - libXaw.dev - libXext.dev - ]); + buildInputs = [ + ncurses + fontconfig + ] + ++ (with xorg; [ + libX11.dev + libXt.dev + libXaw.dev + libXext.dev + ]); nativeBuildInputs = [ file diff --git a/pkgs/by-name/el/elmerfem/package.nix b/pkgs/by-name/el/elmerfem/package.nix index 8e91683a6d56..21f21231f5fa 100644 --- a/pkgs/by-name/el/elmerfem/package.nix +++ b/pkgs/by-name/el/elmerfem/package.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation rec { opencascade-occt tbb vtkWithQt5 - ] ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; + ] + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; preConfigure = '' patchShebangs ./ diff --git a/pkgs/by-name/el/elogind/package.nix b/pkgs/by-name/el/elogind/package.nix index 205f81de2781..c22056ac24f9 100644 --- a/pkgs/by-name/el/elogind/package.nix +++ b/pkgs/by-name/el/elogind/package.nix @@ -46,30 +46,29 @@ stdenv.mkDerivation rec { hash = "sha256-4KZr/NiiGVwzdDROhiX3GEQTUyIGva6ezb+xC2U3bkg="; }; - nativeBuildInputs = - [ - meson - ninja - m4 - pkg-config - gperf - getent - libcap - gettext - libxslt.bin # xsltproc - docbook5 - docbook_xsl - docbook_xsl_ns - docbook_xml_dtd_42 - docbook_xml_dtd_45 # needed for docbook without Internet + nativeBuildInputs = [ + meson + ninja + m4 + pkg-config + gperf + getent + libcap + gettext + libxslt.bin # xsltproc + docbook5 + docbook_xsl + docbook_xsl_ns + docbook_xml_dtd_42 + docbook_xml_dtd_45 # needed for docbook without Internet - python3Packages.python - python3Packages.jinja2 - ] - ++ lib.optionals enableSystemd [ - # udevCheckHook introduces a dependency on systemdMinimal - udevCheckHook - ]; + python3Packages.python + python3Packages.jinja2 + ] + ++ lib.optionals enableSystemd [ + # udevCheckHook introduces a dependency on systemdMinimal + udevCheckHook + ]; buildInputs = [ acl @@ -79,7 +78,8 @@ stdenv.mkDerivation rec { libselinux pam util-linux - ] ++ (if enableSystemd then [ udev ] else [ eudev ]); + ] + ++ (if enableSystemd then [ udev ] else [ eudev ]); postPatch = '' substituteInPlace meson.build --replace-fail "install_emptydir(elogindstatedir)" "" diff --git a/pkgs/by-name/el/elpa/package.nix b/pkgs/by-name/el/elpa/package.nix index a2901aacea0f..684d1e90c670 100644 --- a/pkgs/by-name/el/elpa/package.nix +++ b/pkgs/by-name/el/elpa/package.nix @@ -60,19 +60,19 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook perl - ] ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]; + ] + ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]; - buildInputs = - [ - mpi - blas - lapack - scalapack - ] - ++ lib.optionals enableCuda [ - cudaPackages.cuda_cudart - cudaPackages.libcublas - ]; + buildInputs = [ + mpi + blas + lapack + scalapack + ] + ++ lib.optionals enableCuda [ + cudaPackages.cuda_cudart + cudaPackages.libcublas + ]; preConfigure = '' export FC="mpifort" @@ -91,23 +91,22 @@ stdenv.mkDerivation rec { export CFLAGS=$FCFLAGS ''; - configureFlags = - [ - "--with-mpi" - "--enable-openmp" - "--without-threading-support-check-during-build" - ] - ++ lib.optional blas.isILP64 "--enable-64bit-integer-math-support" - ++ lib.optional (!avxSupport) "--disable-avx" - ++ lib.optional (!avx2Support) "--disable-avx2" - ++ lib.optional (!avx512Support) "--disable-avx512" - ++ lib.optional (!stdenv.hostPlatform.isx86_64) "--disable-sse" - ++ lib.optional (!stdenv.hostPlatform.isx86_64) "--disable-sse-assembly" - ++ lib.optional stdenv.hostPlatform.isx86_64 "--enable-sse-assembly" - ++ lib.optionals enableCuda [ - "--enable-nvidia-gpu" - "--with-NVIDIA-GPU-compute-capability=${nvidiaArch}" - ]; + configureFlags = [ + "--with-mpi" + "--enable-openmp" + "--without-threading-support-check-during-build" + ] + ++ lib.optional blas.isILP64 "--enable-64bit-integer-math-support" + ++ lib.optional (!avxSupport) "--disable-avx" + ++ lib.optional (!avx2Support) "--disable-avx2" + ++ lib.optional (!avx512Support) "--disable-avx512" + ++ lib.optional (!stdenv.hostPlatform.isx86_64) "--disable-sse" + ++ lib.optional (!stdenv.hostPlatform.isx86_64) "--disable-sse-assembly" + ++ lib.optional stdenv.hostPlatform.isx86_64 "--enable-sse-assembly" + ++ lib.optionals enableCuda [ + "--enable-nvidia-gpu" + "--with-NVIDIA-GPU-compute-capability=${nvidiaArch}" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/em/emojipick/package.nix b/pkgs/by-name/em/emojipick/package.nix index bb2bf0c3fede..c9f4b5bf1668 100644 --- a/pkgs/by-name/em/emojipick/package.nix +++ b/pkgs/by-name/em/emojipick/package.nix @@ -50,7 +50,8 @@ stdenvNoCC.mkDerivation { python3 xclip libnotify - ] ++ (if emojipick-use-rofi then [ rofi ] else [ dmenu ]); + ] + ++ (if emojipick-use-rofi then [ rofi ] else [ dmenu ]); installPhase = '' runHook preInstall diff --git a/pkgs/by-name/em/emulsion/package.nix b/pkgs/by-name/em/emulsion/package.nix index 2e6f6ac12deb..8102fb581190 100644 --- a/pkgs/by-name/em/emulsion/package.nix +++ b/pkgs/by-name/em/emulsion/package.nix @@ -18,20 +18,19 @@ wayland, }: let - rpathLibs = - [ - libGL - libX11 - libXcursor - libXi - libXrandr - libXxf86vm - libxcb - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libxkbcommon - wayland - ]; + rpathLibs = [ + libGL + libX11 + libXcursor + libXi + libXrandr + libXxf86vm + libxcb + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libxkbcommon + wayland + ]; in rustPlatform.buildRustPackage rec { pname = "emulsion"; diff --git a/pkgs/by-name/en/en-croissant/package.nix b/pkgs/by-name/en/en-croissant/package.nix index a35536ad30f1..f4b7b0ad914d 100644 --- a/pkgs/by-name/en/en-croissant/package.nix +++ b/pkgs/by-name/en/en-croissant/package.nix @@ -41,15 +41,14 @@ rustPlatform.buildRustPackage rec { buildAndTestSubdir = cargoRoot; - nativeBuildInputs = - [ - pnpm_9.configHook - nodejs - cargo-tauri_1.hook - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeBinaryWrapper ]; + nativeBuildInputs = [ + pnpm_9.configHook + nodejs + cargo-tauri_1.hook + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeBinaryWrapper ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl diff --git a/pkgs/by-name/en/entangle/package.nix b/pkgs/by-name/en/entangle/package.nix index dab4bd89fe73..bfd5c8dbae19 100644 --- a/pkgs/by-name/en/entangle/package.nix +++ b/pkgs/by-name/en/entangle/package.nix @@ -77,38 +77,37 @@ stdenv.mkDerivation (finalAttrs: { gobject-introspection ]; - buildInputs = - [ - at-spi2-core - dbus - libepoxy - elfutils - gexiv2 - glib - lerc - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - gtk3 - lcms2 - libdatrie - libgphoto2 - libgudev - libpeas - libraw - libselinux - libsepol - libthai - libunwind - libxkbcommon - orc - udev - util-linux - zstd - ] - ++ (with xorg; [ - libXdmcp - libXtst - ]); + buildInputs = [ + at-spi2-core + dbus + libepoxy + elfutils + gexiv2 + glib + lerc + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + gtk3 + lcms2 + libdatrie + libgphoto2 + libgudev + libpeas + libraw + libselinux + libsepol + libthai + libunwind + libxkbcommon + orc + udev + util-linux + zstd + ] + ++ (with xorg; [ + libXdmcp + libXtst + ]); # Disable building of doc/reference since it requires network connection to render XML to HTML # Patch build script shebangs diff --git a/pkgs/by-name/en/ente-cli/package.nix b/pkgs/by-name/en/ente-cli/package.nix index 05d8ea33570c..4d909100026f 100644 --- a/pkgs/by-name/en/ente-cli/package.nix +++ b/pkgs/by-name/en/ente-cli/package.nix @@ -34,29 +34,28 @@ buildGoModule (finalAttrs: { nativeBuildInputs = [ installShellFiles ]; - postInstall = - '' - mv $out/bin/{cli,ente} - '' - # running ente results in the following errors: - # > mkdir /homeless-shelter: permission denied - # > error getting password from keyring: exec: "dbus-launch": executable file not found in $PATH - # fix by setting ENTE_CLI_CONFIG_PATH to $TMP and ENTE_CLI_SECRETS_PATH to a non existing path - # also guarding with `isLinux` because ENTE_CLI_SECRETS_PATH doesn't help on darwin: - # > error setting password in keyring: exit status 195 - # - + - lib.optionalString - (stdenv.buildPlatform.isLinux && stdenv.buildPlatform.canExecute stdenv.hostPlatform) - '' - export ENTE_CLI_CONFIG_PATH=$TMP - export ENTE_CLI_SECRETS_PATH=$TMP/secrets + postInstall = '' + mv $out/bin/{cli,ente} + '' + # running ente results in the following errors: + # > mkdir /homeless-shelter: permission denied + # > error getting password from keyring: exec: "dbus-launch": executable file not found in $PATH + # fix by setting ENTE_CLI_CONFIG_PATH to $TMP and ENTE_CLI_SECRETS_PATH to a non existing path + # also guarding with `isLinux` because ENTE_CLI_SECRETS_PATH doesn't help on darwin: + # > error setting password in keyring: exit status 195 + # + + + lib.optionalString + (stdenv.buildPlatform.isLinux && stdenv.buildPlatform.canExecute stdenv.hostPlatform) + '' + export ENTE_CLI_CONFIG_PATH=$TMP + export ENTE_CLI_SECRETS_PATH=$TMP/secrets - installShellCompletion --cmd ente \ - --bash <($out/bin/ente completion bash) \ - --fish <($out/bin/ente completion fish) \ - --zsh <($out/bin/ente completion zsh) - ''; + installShellCompletion --cmd ente \ + --bash <($out/bin/ente completion bash) \ + --fish <($out/bin/ente completion fish) \ + --zsh <($out/bin/ente completion zsh) + ''; passthru = { # only works on linux, see comment above about ENTE_CLI_SECRETS_PATH on darwin diff --git a/pkgs/by-name/en/enum4linux-ng/package.nix b/pkgs/by-name/en/enum4linux-ng/package.nix index ef6e5d47cdff..4c277ad57e8e 100644 --- a/pkgs/by-name/en/enum4linux-ng/package.nix +++ b/pkgs/by-name/en/enum4linux-ng/package.nix @@ -19,13 +19,14 @@ python3.pkgs.buildPythonApplication rec { build-system = with python3.pkgs; [ setuptools ]; - dependencies = - [ samba ] - ++ (with python3.pkgs; [ - impacket - ldap3 - pyyaml - ]); + dependencies = [ + samba + ] + ++ (with python3.pkgs; [ + impacket + ldap3 + pyyaml + ]); # It's only a script and not a Python module. Project has no tests doCheck = false; diff --git a/pkgs/by-name/en/envchain/package.nix b/pkgs/by-name/en/envchain/package.nix index 9a1391028f93..56826304056d 100644 --- a/pkgs/by-name/en/envchain/package.nix +++ b/pkgs/by-name/en/envchain/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libsecret - readline - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libedit - ncurses - ]; + buildInputs = [ + libsecret + readline + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libedit + ncurses + ]; makeFlags = [ "DESTDIR=$(out)" ]; diff --git a/pkgs/by-name/en/envision/package.nix b/pkgs/by-name/en/envision/package.nix index d1e8b798d02a..60361501033d 100644 --- a/pkgs/by-name/en/envision/package.nix +++ b/pkgs/by-name/en/envision/package.nix @@ -149,28 +149,27 @@ buildFHSEnv { allProfilesPresent = testers.runCommand { name = "envision-all-profiles-present-test"; # TODO: Is there a better way to escape ${}? - script = - '' - export ALL_PROFILES=(${lib.concatStringsSep " " (profiles ++ [ "UUID" ])}) - export ENVISION_PROFILES=($(envision -l | grep -oP '^\w+(?=:)')) + script = '' + export ALL_PROFILES=(${lib.concatStringsSep " " (profiles ++ [ "UUID" ])}) + export ENVISION_PROFILES=($(envision -l | grep -oP '^\w+(?=:)')) - # This is dark magic - missing_from_array=($(grep -vf <(printf "%s\n" "$'' - + ''{ALL_PROFILES[@]}") <(printf "%s\n" "$'' - + '' - {ENVISION_PROFILES[@]}") || true)) + # This is dark magic + missing_from_array=($(grep -vf <(printf "%s\n" "$'' + + ''{ALL_PROFILES[@]}") <(printf "%s\n" "$'' + + '' + {ENVISION_PROFILES[@]}") || true)) - if [ $'' - + '' - {#missing_from_array[@]} -gt 0 ]; then - echo "Missing profiles: $'' - + '' - {missing_from_array[@]}" - exit 1 - fi + if [ $'' + + '' + {#missing_from_array[@]} -gt 0 ]; then + echo "Missing profiles: $'' + + '' + {missing_from_array[@]}" + exit 1 + fi - touch $out - ''; + touch $out + ''; nativeBuildInputs = [ envision ]; }; } diff --git a/pkgs/by-name/en/envoy/package.nix b/pkgs/by-name/en/envoy/package.nix index 505ee744c3d3..e1ddae74bffe 100644 --- a/pkgs/by-name/en/envoy/package.nix +++ b/pkgs/by-name/en/envoy/package.nix @@ -211,40 +211,39 @@ buildBazelPackage rec { removeLocalConfigCc = true; removeLocal = false; bazelTargets = [ "//source/exe:envoy-static" ]; - bazelBuildFlags = - [ - "-c opt" - "--spawn_strategy=standalone" - "--noexperimental_strict_action_env" - "--cxxopt=-Wno-error" - "--linkopt=-Wl,-z,noexecstack" - "--config=gcc" - "--verbose_failures" + bazelBuildFlags = [ + "-c opt" + "--spawn_strategy=standalone" + "--noexperimental_strict_action_env" + "--cxxopt=-Wno-error" + "--linkopt=-Wl,-z,noexecstack" + "--config=gcc" + "--verbose_failures" - # Force use of system Java. - "--extra_toolchains=@local_jdk//:all" - "--java_runtime_version=local_jdk" - "--tool_java_runtime_version=local_jdk" + # Force use of system Java. + "--extra_toolchains=@local_jdk//:all" + "--java_runtime_version=local_jdk" + "--tool_java_runtime_version=local_jdk" - # Force use of system Rust. - "--extra_toolchains=//bazel/nix:rust_nix_aarch64,//bazel/nix:rust_nix_x86_64" + # Force use of system Rust. + "--extra_toolchains=//bazel/nix:rust_nix_aarch64,//bazel/nix:rust_nix_x86_64" - # undefined reference to 'grpc_core::*Metadata*::*Memento* - # - # During linking of the final binary, we see undefined references to grpc_core related symbols. - # The missing symbols would be instantiations of a template class from https://github.com/grpc/grpc/blob/v1.59.4/src/core/lib/transport/metadata_batch.h - # "ParseMemento" and "MementoToValue" are only implemented for some types - # and appear unused and unimplemented for the undefined cases reported by the linker. - "--linkopt=-Wl,--unresolved-symbols=ignore-in-object-files" + # undefined reference to 'grpc_core::*Metadata*::*Memento* + # + # During linking of the final binary, we see undefined references to grpc_core related symbols. + # The missing symbols would be instantiations of a template class from https://github.com/grpc/grpc/blob/v1.59.4/src/core/lib/transport/metadata_batch.h + # "ParseMemento" and "MementoToValue" are only implemented for some types + # and appear unused and unimplemented for the undefined cases reported by the linker. + "--linkopt=-Wl,--unresolved-symbols=ignore-in-object-files" - "--define=wasm=${wasmRuntime}" - ] - ++ (lib.optionals stdenv.hostPlatform.isAarch64 [ - # external/com_github_google_tcmalloc/tcmalloc/internal/percpu_tcmalloc.h:611:9: error: expected ':' or '::' before '[' token - # 611 | : [end_ptr] "=&r"(end_ptr), [cpu_id] "=&r"(cpu_id), - # | ^ - "--define=tcmalloc=disabled" - ]); + "--define=wasm=${wasmRuntime}" + ] + ++ (lib.optionals stdenv.hostPlatform.isAarch64 [ + # external/com_github_google_tcmalloc/tcmalloc/internal/percpu_tcmalloc.h:611:9: error: expected ':' or '::' before '[' token + # 611 | : [end_ptr] "=&r"(end_ptr), [cpu_id] "=&r"(cpu_id), + # | ^ + "--define=tcmalloc=disabled" + ]); bazelFetchFlags = [ "--define=wasm=${wasmRuntime}" diff --git a/pkgs/by-name/ep/epic5/package.nix b/pkgs/by-name/ep/epic5/package.nix index d106d64c658b..ae822e72a2b7 100644 --- a/pkgs/by-name/ep/epic5/package.nix +++ b/pkgs/by-name/ep/epic5/package.nix @@ -20,17 +20,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-Y6QRIVwUBAtltdcor/EPdSPVXhcPYpj7AeHPlY150yY="; }; - buildInputs = - [ - openssl - ncurses - libxcrypt - ruby - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - tcl - ]; + buildInputs = [ + openssl + ncurses + libxcrypt + ruby + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + tcl + ]; configureFlags = [ "--with-ipv6" diff --git a/pkgs/by-name/ep/epiphany/package.nix b/pkgs/by-name/ep/epiphany/package.nix index f837c1c53e70..2f5cbe602e99 100644 --- a/pkgs/by-name/ep/epiphany/package.nix +++ b/pkgs/by-name/ep/epiphany/package.nix @@ -56,46 +56,44 @@ stdenv.mkDerivation (finalAttrs: { buildPackages.gtk4 ]; - buildInputs = - [ - gcr_4 - gdk-pixbuf - glib - glib-networking - gnome-desktop - gst_all_1.gst-libav - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gst-plugins-ugly - gst_all_1.gstreamer - gtk4 - icu - isocodes - json-glib - libadwaita - libportal-gtk4 - libarchive - libsecret - libsoup_3 - libxml2 - nettle - p11-kit - sqlite - webkitgtk_6_0 - ] - ++ lib.optionals withPantheon [ - pantheon.granite7 - ]; + buildInputs = [ + gcr_4 + gdk-pixbuf + glib + glib-networking + gnome-desktop + gst_all_1.gst-libav + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gst-plugins-ugly + gst_all_1.gstreamer + gtk4 + icu + isocodes + json-glib + libadwaita + libportal-gtk4 + libarchive + libsecret + libsoup_3 + libxml2 + nettle + p11-kit + sqlite + webkitgtk_6_0 + ] + ++ lib.optionals withPantheon [ + pantheon.granite7 + ]; # Tests need an X display - mesonFlags = - [ - "-Dunit_tests=disabled" - ] - ++ lib.optionals withPantheon [ - "-Dgranite=enabled" - ]; + mesonFlags = [ + "-Dunit_tests=disabled" + ] + ++ lib.optionals withPantheon [ + "-Dgranite=enabled" + ]; passthru = { updateScript = gnome.updateScript { diff --git a/pkgs/by-name/ep/epoll-shim/package.nix b/pkgs/by-name/ep/epoll-shim/package.nix index 34731bd53579..a618150a8f70 100644 --- a/pkgs/by-name/ep/epoll-shim/package.nix +++ b/pkgs/by-name/ep/epoll-shim/package.nix @@ -20,15 +20,14 @@ stdenv.mkDerivation (finalAttrs: { cmake ]; - cmakeFlags = - [ - "-DCMAKE_INSTALL_PKGCONFIGDIR=${placeholder "out"}/lib/pkgconfig" - "-DBUILD_TESTING=${lib.boolToString finalAttrs.finalPackage.doCheck}" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform && stdenv.hostPlatform.isFreeBSD) [ - # fails in cross configurations for not being able to detect this value - "-DALLOWS_ONESHOT_TIMERS_WITH_TIMEOUT_ZERO=YES" - ]; + cmakeFlags = [ + "-DCMAKE_INSTALL_PKGCONFIGDIR=${placeholder "out"}/lib/pkgconfig" + "-DBUILD_TESTING=${lib.boolToString finalAttrs.finalPackage.doCheck}" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform && stdenv.hostPlatform.isFreeBSD) [ + # fails in cross configurations for not being able to detect this value + "-DALLOWS_ONESHOT_TIMERS_WITH_TIMEOUT_ZERO=YES" + ]; # https://github.com/jiixyj/epoll-shim/issues/41 # https://github.com/jiixyj/epoll-shim/pull/34 diff --git a/pkgs/by-name/ep/epsonscan2/package.nix b/pkgs/by-name/ep/epsonscan2/package.nix index bf596d39b4b1..db914a676625 100644 --- a/pkgs/by-name/ep/epsonscan2/package.nix +++ b/pkgs/by-name/ep/epsonscan2/package.nix @@ -76,66 +76,62 @@ stdenv.mkDerivation { --replace-fail '@OCR_ENGINE_GETROTATE@' $out/libexec/epsonscan2-ocr/ocr-engine-getrotate ''; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals withGui [ - imagemagick # to make icons - wrapQtAppsHook - ] - ++ lib.optionals withNonFreePlugins [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals withGui [ + imagemagick # to make icons + wrapQtAppsHook + ] + ++ lib.optionals withNonFreePlugins [ + autoPatchelfHook + ]; - buildInputs = - [ - boost186 # uses Boost.Optional but epsonscan2 is pre-C++11. - libjpeg - libpng - libtiff - libusb1 - ] - ++ lib.optionals withGui [ - copyDesktopItems - qtbase - ] - ++ lib.optionals withNonFreePlugins [ - libtool.lib - ]; + buildInputs = [ + boost186 # uses Boost.Optional but epsonscan2 is pre-C++11. + libjpeg + libpng + libtiff + libusb1 + ] + ++ lib.optionals withGui [ + copyDesktopItems + qtbase + ] + ++ lib.optionals withNonFreePlugins [ + libtool.lib + ]; - cmakeFlags = - [ - # The non-free (Debian) packages uses this directory structure so do the same when compiling - # from source so we can easily merge them. - "-DCMAKE_INSTALL_LIBDIR=lib/${system}-gnu" - ] - ++ lib.optionals (!withGui) [ - "-DNO_GUI=ON" - ]; + cmakeFlags = [ + # The non-free (Debian) packages uses this directory structure so do the same when compiling + # from source so we can easily merge them. + "-DCMAKE_INSTALL_LIBDIR=lib/${system}-gnu" + ] + ++ lib.optionals (!withGui) [ + "-DNO_GUI=ON" + ]; doInstallCheck = true; - postInstall = - '' - # But when we put all the libraries in lib/${system}-gnu, then SANE can't find the - # required libraries so create a symlink to where it expects them to be. - mkdir -p $out/lib/sane - for file in $out/lib/${system}-gnu/sane/*.so.*; do - ln -s $file $out/lib/sane/ - done - '' - + lib.optionalString withGui '' - # The icon file extension is .ico but it's actually a png! - mkdir -p $out/share/icons/hicolor/{48x48,128x128}/apps - magick $src/Resources/Icons/escan2_app.ico -resize 48x48 -delete 1,2,3 $out/share/icons/hicolor/48x48/apps/epsonscan2.png - magick $src/Resources/Icons/escan2_app.ico -resize 128x128 -delete 1,2,3 $out/share/icons/hicolor/128x128/apps/epsonscan2.png - '' - + lib.optionalString withNonFreePlugins '' - ar xf ${bundle}/plugins/epsonscan2-non-free-plugin_*.deb - tar Jxf data.tar.xz - cp -r usr/* $out - ''; + postInstall = '' + # But when we put all the libraries in lib/${system}-gnu, then SANE can't find the + # required libraries so create a symlink to where it expects them to be. + mkdir -p $out/lib/sane + for file in $out/lib/${system}-gnu/sane/*.so.*; do + ln -s $file $out/lib/sane/ + done + '' + + lib.optionalString withGui '' + # The icon file extension is .ico but it's actually a png! + mkdir -p $out/share/icons/hicolor/{48x48,128x128}/apps + magick $src/Resources/Icons/escan2_app.ico -resize 48x48 -delete 1,2,3 $out/share/icons/hicolor/48x48/apps/epsonscan2.png + magick $src/Resources/Icons/escan2_app.ico -resize 128x128 -delete 1,2,3 $out/share/icons/hicolor/128x128/apps/epsonscan2.png + '' + + lib.optionalString withNonFreePlugins '' + ar xf ${bundle}/plugins/epsonscan2-non-free-plugin_*.deb + tar Jxf data.tar.xz + cp -r usr/* $out + ''; desktopItems = lib.optionals withGui [ (makeDesktopItem { diff --git a/pkgs/by-name/eq/equibop/package.nix b/pkgs/by-name/eq/equibop/package.nix index b52c61d53b76..56c6f5540c0d 100644 --- a/pkgs/by-name/eq/equibop/package.nix +++ b/pkgs/by-name/eq/equibop/package.nix @@ -63,13 +63,14 @@ stdenv.mkDerivation (finalAttrs: { (lib.getLib stdenv.cc.cc) ]; - patches = - [ ./disable_update_checking.patch ] - ++ lib.optional withSystemEquicord ( - replaceVars ./use_system_equicord.patch { - inherit equicord; - } - ); + patches = [ + ./disable_update_checking.patch + ] + ++ lib.optional withSystemEquicord ( + replaceVars ./use_system_equicord.patch { + inherit equicord; + } + ); env = { ELECTRON_SKIP_BINARY_DOWNLOAD = 1; diff --git a/pkgs/by-name/er/ergoscf/package.nix b/pkgs/by-name/er/ergoscf/package.nix index d074d974c123..897edc536454 100644 --- a/pkgs/by-name/er/ergoscf/package.nix +++ b/pkgs/by-name/er/ergoscf/package.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-linalgebra-templates" "--enable-performance" - ] ++ lib.optional stdenv.hostPlatform.isx86_64 "--enable-sse-intrinsics"; + ] + ++ lib.optional stdenv.hostPlatform.isx86_64 "--enable-sse-intrinsics"; env = { # Required for compilation with gcc-14 diff --git a/pkgs/by-name/er/erofs-utils/package.nix b/pkgs/by-name/er/erofs-utils/package.nix index 8b3d5c2a3a8c..7cca8736c35d 100644 --- a/pkgs/by-name/er/erofs-utils/package.nix +++ b/pkgs/by-name/er/erofs-utils/package.nix @@ -37,27 +37,25 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook pkg-config ]; - buildInputs = - [ - util-linux - xxHash - lz4 - zlib - xz - zstd - libdeflate - ] - ++ lib.optionals fuseSupport [ fuse ] - ++ lib.optionals selinuxSupport [ libselinux ]; + buildInputs = [ + util-linux + xxHash + lz4 + zlib + xz + zstd + libdeflate + ] + ++ lib.optionals fuseSupport [ fuse ] + ++ lib.optionals selinuxSupport [ libselinux ]; - configureFlags = - [ - "MAX_BLOCK_SIZE=4096" - "--enable-multithreading" - "--with-libdeflate" - ] - ++ lib.optional fuseSupport "--enable-fuse" - ++ lib.optional selinuxSupport "--with-selinux"; + configureFlags = [ + "MAX_BLOCK_SIZE=4096" + "--enable-multithreading" + "--with-libdeflate" + ] + ++ lib.optional fuseSupport "--enable-fuse" + ++ lib.optional selinuxSupport "--with-selinux"; meta = { homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/about/"; diff --git a/pkgs/by-name/es/espanso/package.nix b/pkgs/by-name/es/espanso/package.nix index e9217bbf40a0..33649bc9ab18 100644 --- a/pkgs/by-name/es/espanso/package.nix +++ b/pkgs/by-name/es/espanso/package.nix @@ -51,41 +51,39 @@ rustPlatform.buildRustPackage (finalAttrs: { # Ref: https://github.com/espanso/espanso/blob/78df1b704fe2cc5ea26f88fdc443b6ae1df8a989/scripts/build_binary.rs#LL49C3-L62C4 buildNoDefaultFeatures = true; - buildFeatures = - [ - "modulo" - ] - ++ lib.optionals waylandSupport [ - "wayland" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "vendored-tls" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "native-tls" - ]; + buildFeatures = [ + "modulo" + ] + ++ lib.optionals waylandSupport [ + "wayland" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "vendored-tls" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "native-tls" + ]; - buildInputs = - [ - libpng - wxGTK32 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - openssl - dbus - libnotify - libxkbcommon - ] - ++ lib.optionals waylandSupport [ - wl-clipboard - ] - ++ lib.optionals x11Support [ - libXi - libXtst - libX11 - xclip - xdotool - ]; + buildInputs = [ + libpng + wxGTK32 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + openssl + dbus + libnotify + libxkbcommon + ] + ++ lib.optionals waylandSupport [ + wl-clipboard + ] + ++ lib.optionals x11Support [ + libXi + libXtst + libX11 + xclip + xdotool + ]; postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace scripts/create_bundle.sh \ diff --git a/pkgs/by-name/ev/evince/package.nix b/pkgs/by-name/ev/evince/package.nix index 49722821b258..57b71e2b1455 100644 --- a/pkgs/by-name/ev/evince/package.nix +++ b/pkgs/by-name/ev/evince/package.nix @@ -73,54 +73,52 @@ stdenv.mkDerivation (finalAttrs: { yelp-tools ]; - buildInputs = + buildInputs = [ + atk + dbus # only needed to find the service directory + djvulibre + gdk-pixbuf + ghostscriptX + glib + gnome-desktop + gsettings-desktop-schemas + gspell + gtk3 + libarchive + libgxps + libhandy + librsvg + libspectre + libxml2 + pango + poppler + texlive.bin.core # kpathsea for DVI support + ] + ++ lib.optionals withLibsecret [ + libsecret + ] + ++ lib.optionals supportMultimedia ( + with gst_all_1; [ - atk - dbus # only needed to find the service directory - djvulibre - gdk-pixbuf - ghostscriptX - glib - gnome-desktop - gsettings-desktop-schemas - gspell - gtk3 - libarchive - libgxps - libhandy - librsvg - libspectre - libxml2 - pango - poppler - texlive.bin.core # kpathsea for DVI support + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav ] - ++ lib.optionals withLibsecret [ - libsecret - ] - ++ lib.optionals supportMultimedia ( - with gst_all_1; - [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ] - ); + ); - mesonFlags = - [ - "-Dnautilus=false" - "-Dps=enabled" - ] - ++ lib.optionals (!withLibsecret) [ - "-Dkeyring=disabled" - ] - ++ lib.optionals (!supportMultimedia) [ - "-Dmultimedia=disabled" - ]; + mesonFlags = [ + "-Dnautilus=false" + "-Dps=enabled" + ] + ++ lib.optionals (!withLibsecret) [ + "-Dkeyring=disabled" + ] + ++ lib.optionals (!supportMultimedia) [ + "-Dmultimedia=disabled" + ]; preFixup = '' gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared-mime-info}/share") diff --git a/pkgs/by-name/ev/evolution-data-server/package.nix b/pkgs/by-name/ev/evolution-data-server/package.nix index 8d1ce60fd6ef..3a29f92c0c2a 100644 --- a/pkgs/by-name/ev/evolution-data-server/package.nix +++ b/pkgs/by-name/ev/evolution-data-server/package.nix @@ -87,40 +87,39 @@ stdenv.mkDerivation rec { vala ]; - buildInputs = - [ - glib - libsecret - libsoup_3 - gnome-online-accounts - p11-kit - libgweather - icu - sqlite - libkrb5 - openldap - glib-networking - libcanberra-gtk3 - libphonenumber - libuuid - boost - protobuf - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ lib.optionals withGtk3 [ - gtk3 - ] - ++ lib.optionals (withGtk3 && enableOAuth2) [ - webkitgtk_4_1 - ] - ++ lib.optionals withGtk4 [ - gtk4 - ] - ++ lib.optionals (withGtk4 && enableOAuth2) [ - webkitgtk_6_0 - ]; + buildInputs = [ + glib + libsecret + libsoup_3 + gnome-online-accounts + p11-kit + libgweather + icu + sqlite + libkrb5 + openldap + glib-networking + libcanberra-gtk3 + libphonenumber + libuuid + boost + protobuf + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.optionals withGtk3 [ + gtk3 + ] + ++ lib.optionals (withGtk3 && enableOAuth2) [ + webkitgtk_4_1 + ] + ++ lib.optionals withGtk4 [ + gtk4 + ] + ++ lib.optionals (withGtk4 && enableOAuth2) [ + webkitgtk_6_0 + ]; propagatedBuildInputs = [ db @@ -132,22 +131,21 @@ stdenv.mkDerivation rec { json-glib ]; - cmakeFlags = - [ - "-DENABLE_VALA_BINDINGS=ON" - "-DENABLE_INTROSPECTION=ON" - "-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include" - "-DWITH_PHONENUMBER=ON" - "-DENABLE_GTK=${lib.boolToString withGtk3}" - "-DENABLE_EXAMPLES=${lib.boolToString withGtk3}" - "-DENABLE_CANBERRA=${lib.boolToString withGtk3}" - "-DENABLE_GTK4=${lib.boolToString withGtk4}" - "-DENABLE_OAUTH2_WEBKITGTK=${lib.boolToString (withGtk3 && enableOAuth2)}" - "-DENABLE_OAUTH2_WEBKITGTK4=${lib.boolToString (withGtk4 && enableOAuth2)}" - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - (lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages)) - ]; + cmakeFlags = [ + "-DENABLE_VALA_BINDINGS=ON" + "-DENABLE_INTROSPECTION=ON" + "-DINCLUDE_INSTALL_DIR=${placeholder "dev"}/include" + "-DWITH_PHONENUMBER=ON" + "-DENABLE_GTK=${lib.boolToString withGtk3}" + "-DENABLE_EXAMPLES=${lib.boolToString withGtk3}" + "-DENABLE_CANBERRA=${lib.boolToString withGtk3}" + "-DENABLE_GTK4=${lib.boolToString withGtk4}" + "-DENABLE_OAUTH2_WEBKITGTK=${lib.boolToString (withGtk3 && enableOAuth2)}" + "-DENABLE_OAUTH2_WEBKITGTK4=${lib.boolToString (withGtk4 && enableOAuth2)}" + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + (lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages)) + ]; strictDeps = true; diff --git a/pkgs/by-name/ex/exaile/package.nix b/pkgs/by-name/ex/exaile/package.nix index e9810139b3c0..e99fa3d0a5b9 100644 --- a/pkgs/by-name/ex/exaile/package.nix +++ b/pkgs/by-name/ex/exaile/package.nix @@ -45,51 +45,49 @@ stdenv.mkDerivation rec { sha256 = "sha256-iyK2txutlWe67CyfKuyesBrYQypkS5FOf1ZWUkRCq24="; }; - nativeBuildInputs = - [ - gobject-introspection - makeWrapper - wrapGAppsHook3 - ] - ++ lib.optionals documentationSupport [ - help2man - python3.pkgs.sphinx - python3.pkgs.sphinx-rtd-theme - ] - ++ lib.optional translationSupport gettext; + nativeBuildInputs = [ + gobject-introspection + makeWrapper + wrapGAppsHook3 + ] + ++ lib.optionals documentationSupport [ + help2man + python3.pkgs.sphinx + python3.pkgs.sphinx-rtd-theme + ] + ++ lib.optional translationSupport gettext; - buildInputs = - [ - iconTheme - gtk3 - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ]) - ++ (with python3.pkgs; [ - berkeleydb - dbus-python - mutagen - pygobject3 - pycairo - gst-python - ]) - ++ lib.optional deviceDetectionSupport udisks - ++ lib.optional notificationSupport libnotify - ++ lib.optional scalableIconSupport librsvg - ++ lib.optional ipythonSupport python3.pkgs.ipython - ++ lib.optional cdMetadataSupport python3.pkgs.discid - ++ lib.optional lastfmSupport python3.pkgs.pylast - ++ lib.optional lyricsManiaSupport python3.pkgs.lxml - ++ lib.optional multimediaKeySupport keybinder3 - ++ lib.optional (musicBrainzSupport || cdMetadataSupport) python3.pkgs.musicbrainzngs - ++ lib.optional podcastSupport python3.pkgs.feedparser - ++ lib.optional wikipediaSupport webkitgtk_4_1; + buildInputs = [ + iconTheme + gtk3 + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav + ]) + ++ (with python3.pkgs; [ + berkeleydb + dbus-python + mutagen + pygobject3 + pycairo + gst-python + ]) + ++ lib.optional deviceDetectionSupport udisks + ++ lib.optional notificationSupport libnotify + ++ lib.optional scalableIconSupport librsvg + ++ lib.optional ipythonSupport python3.pkgs.ipython + ++ lib.optional cdMetadataSupport python3.pkgs.discid + ++ lib.optional lastfmSupport python3.pkgs.pylast + ++ lib.optional lyricsManiaSupport python3.pkgs.lxml + ++ lib.optional multimediaKeySupport keybinder3 + ++ lib.optional (musicBrainzSupport || cdMetadataSupport) python3.pkgs.musicbrainzngs + ++ lib.optional podcastSupport python3.pkgs.feedparser + ++ lib.optional wikipediaSupport webkitgtk_4_1; nativeCheckInputs = with python3.pkgs; [ pytest diff --git a/pkgs/by-name/ex/example-robot-data/package.nix b/pkgs/by-name/ex/example-robot-data/package.nix index 430220c06e65..20a2b2366b8f 100644 --- a/pkgs/by-name/ex/example-robot-data/package.nix +++ b/pkgs/by-name/ex/example-robot-data/package.nix @@ -28,20 +28,20 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - doxygen - pkg-config - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + cmake + doxygen + pkg-config + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pythonImportsCheckHook + ]; propagatedBuildInputs = [ jrl-cmakemodules - ] ++ lib.optionals pythonSupport [ python3Packages.pinocchio ]; + ] + ++ lib.optionals pythonSupport [ python3Packages.pinocchio ]; cmakeFlags = [ (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) ]; diff --git a/pkgs/by-name/ex/exatorrent/package.nix b/pkgs/by-name/ex/exatorrent/package.nix index d02f363d5c4d..e9b3be4104b9 100644 --- a/pkgs/by-name/ex/exatorrent/package.nix +++ b/pkgs/by-name/ex/exatorrent/package.nix @@ -54,15 +54,14 @@ buildGoModule (finalAttrs: { tags = lib.optionals (!withUI) [ "noui" ]; - ldflags = - [ - "-s" - "-w" - ] - ++ lib.optionals stdenv.hostPlatform.isGnu [ - # upstream also tries to compile statically if possible - "-extldflags '-static'" - ]; + ldflags = [ + "-s" + "-w" + ] + ++ lib.optionals stdenv.hostPlatform.isGnu [ + # upstream also tries to compile statically if possible + "-extldflags '-static'" + ]; buildInputs = lib.optionals stdenv.hostPlatform.isGnu [ stdenv.cc.libc.static diff --git a/pkgs/by-name/ex/exempi/package.nix b/pkgs/by-name/ex/exempi/package.nix index 2c7b040bf575..748a4bdbbce1 100644 --- a/pkgs/by-name/ex/exempi/package.nix +++ b/pkgs/by-name/ex/exempi/package.nix @@ -17,23 +17,21 @@ stdenv.mkDerivation rec { sha256 = "sha256-dRO35Cw72QpY132TjGDS6Hxo+BZG58uLEtcf4zQ5HG8="; }; - configureFlags = - [ - "--with-boost=${boost.dev}" - ] - ++ lib.optionals (!doCheck) [ - "--enable-unittest=no" - ]; + configureFlags = [ + "--with-boost=${boost.dev}" + ] + ++ lib.optionals (!doCheck) [ + "--enable-unittest=no" + ]; - buildInputs = - [ - expat - zlib - boost - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + expat + zlib + boost + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; doCheck = stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit; dontDisableStatic = doCheck; diff --git a/pkgs/by-name/ex/exim/package.nix b/pkgs/by-name/ex/exim/package.nix index 6068aad78bda..beb459c582b5 100644 --- a/pkgs/by-name/ex/exim/package.nix +++ b/pkgs/by-name/ex/exim/package.nix @@ -49,32 +49,31 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - coreutils - db - openssl - perl' - pcre2 - libxcrypt - ] - ++ lib.optional enableLDAP openldap - ++ lib.optionals enableMySQL [ - libmysqlclient - zlib - ] - ++ lib.optional enablePgSQL libpq - ++ lib.optionals enableSqlite [ - sqlite - sqlite.dev - zlib - ] - ++ lib.optional enableAuthDovecot dovecot - ++ lib.optional enablePAM pam - ++ lib.optional enableSPF libspf2 - ++ lib.optional enableDMARC opendmarc - ++ lib.optional enableRedis hiredis - ++ lib.optional enableJSON jansson; + buildInputs = [ + coreutils + db + openssl + perl' + pcre2 + libxcrypt + ] + ++ lib.optional enableLDAP openldap + ++ lib.optionals enableMySQL [ + libmysqlclient + zlib + ] + ++ lib.optional enablePgSQL libpq + ++ lib.optionals enableSqlite [ + sqlite + sqlite.dev + zlib + ] + ++ lib.optional enableAuthDovecot dovecot + ++ lib.optional enablePAM pam + ++ lib.optional enableSPF libspf2 + ++ lib.optional enableDMARC opendmarc + ++ lib.optional enableRedis hiredis + ++ lib.optional enableJSON jansson; configurePhase = '' runHook preConfigure diff --git a/pkgs/by-name/ex/exiv2/package.nix b/pkgs/by-name/ex/exiv2/package.nix index f86a8cacab9d..25275b39fc6d 100644 --- a/pkgs/by-name/ex/exiv2/package.nix +++ b/pkgs/by-name/ex/exiv2/package.nix @@ -76,24 +76,23 @@ stdenv.mkDerivation rec { doCheck = true; - preCheck = - '' - patchShebangs ../test/ - mkdir ../test/tmp - '' - + lib.optionalString stdenv.hostPlatform.isAarch32 '' - # Fix tests on arm - # https://github.com/Exiv2/exiv2/issues/933 - rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib - export LC_ALL=C + preCheck = '' + patchShebangs ../test/ + mkdir ../test/tmp + '' + + lib.optionalString stdenv.hostPlatform.isAarch32 '' + # Fix tests on arm + # https://github.com/Exiv2/exiv2/issues/933 + rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib + export LC_ALL=C - # disable tests that requires loopback networking - substituteInPlace ../tests/bash_tests/testcases.py \ - --replace "def io_test(self):" "def io_disabled(self):" - ''; + # disable tests that requires loopback networking + substituteInPlace ../tests/bash_tests/testcases.py \ + --replace "def io_test(self):" "def io_disabled(self):" + ''; preFixup = '' remove-references-to -t ${stdenv.cc.cc} $lib/lib/*.so.*.*.* $out/bin/exiv2 diff --git a/pkgs/by-name/ex/extract_url/package.nix b/pkgs/by-name/ex/extract_url/package.nix index b7b8e4824f75..a5437970bf83 100644 --- a/pkgs/by-name/ex/extract_url/package.nix +++ b/pkgs/by-name/ex/extract_url/package.nix @@ -9,13 +9,12 @@ }: let - perlDeps = - [ - perlPackages.MIMETools - perlPackages.HTMLParser - ] - ++ lib.optional cursesSupport perlPackages.CursesUI - ++ lib.optional uriFindSupport perlPackages.URIFind; + perlDeps = [ + perlPackages.MIMETools + perlPackages.HTMLParser + ] + ++ lib.optional cursesSupport perlPackages.CursesUI + ++ lib.optional uriFindSupport perlPackages.URIFind; in stdenv.mkDerivation rec { diff --git a/pkgs/by-name/ez/eza/package.nix b/pkgs/by-name/ez/eza/package.nix index 8997f4045791..d87dfba68dff 100644 --- a/pkgs/by-name/ez/eza/package.nix +++ b/pkgs/by-name/ez/eza/package.nix @@ -43,21 +43,20 @@ rustPlatform.buildRustPackage (finalAttrs: { "man" ]; - postInstall = - '' - for page in eza.1 eza_colors.5 eza_colors-explanation.5; do - sed "s/\$version/v${finalAttrs.version}/g" "man/$page.md" | - pandoc --standalone -f markdown -t man >"man/$page" - done - installManPage man/eza.1 man/eza_colors.5 man/eza_colors-explanation.5 - installShellCompletion \ - --bash completions/bash/eza \ - --fish completions/fish/eza.fish \ - --zsh completions/zsh/_eza - '' - + lib.optionalString exaAlias '' - ln -s eza $out/bin/exa - ''; + postInstall = '' + for page in eza.1 eza_colors.5 eza_colors-explanation.5; do + sed "s/\$version/v${finalAttrs.version}/g" "man/$page.md" | + pandoc --standalone -f markdown -t man >"man/$page" + done + installManPage man/eza.1 man/eza_colors.5 man/eza_colors-explanation.5 + installShellCompletion \ + --bash completions/bash/eza \ + --fish completions/fish/eza.fish \ + --zsh completions/zsh/_eza + '' + + lib.optionalString exaAlias '' + ln -s eza $out/bin/exa + ''; meta = { description = "Modern, maintained replacement for ls"; diff --git a/pkgs/by-name/f3/f3/package.nix b/pkgs/by-name/f3/f3/package.nix index 5526cedf27e6..dacee40225d1 100644 --- a/pkgs/by-name/f3/f3/package.nix +++ b/pkgs/by-name/f3/f3/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation rec { buildFlags = [ "all" # f3read, f3write - ] ++ lib.optional stdenv.hostPlatform.isLinux "extra"; # f3brew, f3fix, f3probe + ] + ++ lib.optional stdenv.hostPlatform.isLinux "extra"; # f3brew, f3fix, f3probe installFlags = [ "PREFIX=${placeholder "out"}" @@ -44,7 +45,8 @@ stdenv.mkDerivation rec { installTargets = [ "install" - ] ++ lib.optional stdenv.hostPlatform.isLinux "install-extra"; + ] + ++ lib.optional stdenv.hostPlatform.isLinux "install-extra"; postInstall = '' install -Dm555 -t $out/bin f3write.h2w log-f3wr diff --git a/pkgs/by-name/f3/f3d/package.nix b/pkgs/by-name/f3/f3d/package.nix index 99828cc959e9..28b9e4dbf253 100644 --- a/pkgs/by-name/f3/f3d/package.nix +++ b/pkgs/by-name/f3/f3d/package.nix @@ -36,58 +36,55 @@ stdenv.mkDerivation rec { hash = "sha256-p1Cqam3sYDXJCU1A2sC/fV1ohxS3FGiVrxeGooNXVBQ="; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals withManual [ - # manpage - help2man - gzip - ] - ++ lib.optionals stdenv.hostPlatform.isElf [ - # https://github.com/f3d-app/f3d/pull/1217 - autoPatchelfHook - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals withManual [ + # manpage + help2man + gzip + ] + ++ lib.optionals stdenv.hostPlatform.isElf [ + # https://github.com/f3d-app/f3d/pull/1217 + autoPatchelfHook + ]; - buildInputs = - [ - vtk_9 - opencascade-occt - assimp - fontconfig - ] - ++ lib.optionals withPythonBinding [ - python3Packages.python - # Using C++ header files, not Python import - python3Packages.pybind11 - ] - ++ lib.optionals withUsd [ - libXt - openusd - tbb - ]; + buildInputs = [ + vtk_9 + opencascade-occt + assimp + fontconfig + ] + ++ lib.optionals withPythonBinding [ + python3Packages.python + # Using C++ header files, not Python import + python3Packages.pybind11 + ] + ++ lib.optionals withUsd [ + libXt + openusd + tbb + ]; - cmakeFlags = - [ - # conflict between VTK and Nixpkgs; - # see https://github.com/NixOS/nixpkgs/issues/89167 - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_BINDIR=bin" - "-DF3D_MODULE_EXTERNAL_RENDERING=ON" - "-DF3D_PLUGIN_BUILD_ASSIMP=ON" - "-DF3D_PLUGIN_BUILD_OCCT=ON" - ] - ++ lib.optionals withManual [ - "-DF3D_LINUX_GENERATE_MAN=ON" - ] - ++ lib.optionals withPythonBinding [ - "-DF3D_BINDINGS_PYTHON=ON" - ] - ++ lib.optionals withUsd [ - "-DF3D_PLUGIN_BUILD_USD=ON" - ]; + cmakeFlags = [ + # conflict between VTK and Nixpkgs; + # see https://github.com/NixOS/nixpkgs/issues/89167 + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_BINDIR=bin" + "-DF3D_MODULE_EXTERNAL_RENDERING=ON" + "-DF3D_PLUGIN_BUILD_ASSIMP=ON" + "-DF3D_PLUGIN_BUILD_OCCT=ON" + ] + ++ lib.optionals withManual [ + "-DF3D_LINUX_GENERATE_MAN=ON" + ] + ++ lib.optionals withPythonBinding [ + "-DF3D_BINDINGS_PYTHON=ON" + ] + ++ lib.optionals withUsd [ + "-DF3D_PLUGIN_BUILD_USD=ON" + ]; meta = { description = "Fast and minimalist 3D viewer using VTK"; diff --git a/pkgs/by-name/fa/faac/package.nix b/pkgs/by-name/fa/faac/package.nix index 6caf048cee50..59f6c44a91ad 100644 --- a/pkgs/by-name/fa/faac/package.nix +++ b/pkgs/by-name/fa/faac/package.nix @@ -20,8 +20,7 @@ stdenv.mkDerivation rec { }; configureFlags = - lib.optional mp4v2Support "--with-external-mp4v2" - ++ lib.optional drmSupport "--enable-drm"; + lib.optional mp4v2Support "--with-external-mp4v2" ++ lib.optional drmSupport "--enable-drm"; hardeningDisable = [ "format" ]; diff --git a/pkgs/by-name/fa/facetimehd-calibration/package.nix b/pkgs/by-name/fa/facetimehd-calibration/package.nix index 6a0d236e7361..79ac6fc64c3d 100644 --- a/pkgs/by-name/fa/facetimehd-calibration/package.nix +++ b/pkgs/by-name/fa/facetimehd-calibration/package.nix @@ -60,26 +60,25 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ unrar-wrapper ]; - buildPhase = - '' - { printf '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00' - cat $src - printf '${gzFooter}' - } | zcat > AppleCamera64.exe - unrar x AppleCamera64.exe AppleCamera.sys + buildPhase = '' + { printf '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00' + cat $src + printf '${gzFooter}' + } | zcat > AppleCamera64.exe + unrar x AppleCamera64.exe AppleCamera.sys - mkdir -p $out/lib/firmware/facetimehd + mkdir -p $out/lib/firmware/facetimehd + '' + + lib.concatMapStrings ( + { + file, + offset, + size, + }: '' - + lib.concatMapStrings ( - { - file, - offset, - size, - }: - '' - dd bs=1 skip=${offset} count=${size} if=AppleCamera.sys of=$out/lib/firmware/facetimehd/${file} - '' - ) calibrationFiles; + dd bs=1 skip=${offset} count=${size} if=AppleCamera.sys of=$out/lib/firmware/facetimehd/${file} + '' + ) calibrationFiles; meta = with lib; { description = "facetimehd calibration"; diff --git a/pkgs/by-name/fa/facter/package.nix b/pkgs/by-name/fa/facter/package.nix index 095730aaf27e..f6f17d982e27 100644 --- a/pkgs/by-name/fa/facter/package.nix +++ b/pkgs/by-name/fa/facter/package.nix @@ -26,20 +26,19 @@ bundlerApp { postBuild = let - runtimeDependencies = - [ - coreutils - gnugrep - net-tools - pciutils - procps - util-linux - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - iproute2 - virt-what - zfs - ]; + runtimeDependencies = [ + coreutils + gnugrep + net-tools + pciutils + procps + util-linux + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + iproute2 + virt-what + zfs + ]; in '' wrapProgram $out/bin/facter --prefix PATH : ${lib.makeBinPath runtimeDependencies} diff --git a/pkgs/by-name/fa/factorio/package.nix b/pkgs/by-name/fa/factorio/package.nix index 917c7a2bfb3a..378bba199366 100644 --- a/pkgs/by-name/fa/factorio/package.nix +++ b/pkgs/by-name/fa/factorio/package.nix @@ -257,55 +257,51 @@ let wayland ]; - installPhase = - base.installPhase - + '' - wrapProgram $out/bin/factorio \ - --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath \ - --run "$out/share/factorio/update-config.sh" \ - --argv0 "" \ - --add-flags "-c \$HOME/.factorio/config.cfg" \ - ${lib.optionalString (mods != [ ]) "--add-flags --mod-directory=${modDir}"} + installPhase = base.installPhase + '' + wrapProgram $out/bin/factorio \ + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath \ + --run "$out/share/factorio/update-config.sh" \ + --argv0 "" \ + --add-flags "-c \$HOME/.factorio/config.cfg" \ + ${lib.optionalString (mods != [ ]) "--add-flags --mod-directory=${modDir}"} - # TODO Currently, every time a mod is changed/added/removed using the - # modlist, a new derivation will take up the entire footprint of the - # client. The only way to avoid this is to remove the mods arg from the - # package function. The modsDir derivation will have to be built - # separately and have the user specify it in the .factorio config or - # right along side it using a symlink into the store I think i will - # just remove mods for the client derivation entirely. this is much - # cleaner and more useful for headless mode. + # TODO Currently, every time a mod is changed/added/removed using the + # modlist, a new derivation will take up the entire footprint of the + # client. The only way to avoid this is to remove the mods arg from the + # package function. The modsDir derivation will have to be built + # separately and have the user specify it in the .factorio config or + # right along side it using a symlink into the store I think i will + # just remove mods for the client derivation entirely. this is much + # cleaner and more useful for headless mode. - # TODO: trying to toggle off a mod will result in read-only-fs-error. - # not much we can do about that except warn the user somewhere. In - # fact, no exit will be clean, since this error will happen on close - # regardless. just prints an ugly stacktrace but seems to be otherwise - # harmless, unless maybe the user forgets and tries to use the mod - # manager. + # TODO: trying to toggle off a mod will result in read-only-fs-error. + # not much we can do about that except warn the user somewhere. In + # fact, no exit will be clean, since this error will happen on close + # regardless. just prints an ugly stacktrace but seems to be otherwise + # harmless, unless maybe the user forgets and tries to use the mod + # manager. - install -m0644 <(cat << EOF - ${configBaseCfg} - EOF - ) $out/share/factorio/config-base.cfg + install -m0644 <(cat << EOF + ${configBaseCfg} + EOF + ) $out/share/factorio/config-base.cfg - install -m0755 <(cat << EOF - ${updateConfigSh} - EOF - ) $out/share/factorio/update-config.sh + install -m0755 <(cat << EOF + ${updateConfigSh} + EOF + ) $out/share/factorio/update-config.sh - mkdir -p $out/share/icons/hicolor/{64x64,128x128}/apps - cp -a data/core/graphics/factorio-icon.png $out/share/icons/hicolor/64x64/apps/factorio.png - cp -a data/core/graphics/factorio-icon@2x.png $out/share/icons/hicolor/128x128/apps/factorio.png - ln -s ${desktopItem}/share/applications $out/share/ - ''; + mkdir -p $out/share/icons/hicolor/{64x64,128x128}/apps + cp -a data/core/graphics/factorio-icon.png $out/share/icons/hicolor/64x64/apps/factorio.png + cp -a data/core/graphics/factorio-icon@2x.png $out/share/icons/hicolor/128x128/apps/factorio.png + ln -s ${desktopItem}/share/applications $out/share/ + ''; }; alpha = demo // { - installPhase = - demo.installPhase - + '' - cp -a doc-html $out/share/factorio - ''; + installPhase = demo.installPhase + '' + cp -a doc-html $out/share/factorio + ''; }; expansion = alpha; }; diff --git a/pkgs/by-name/fa/factorio/utils.nix b/pkgs/by-name/fa/factorio/utils.nix index 89965a59540b..c22d3ea3f499 100644 --- a/pkgs/by-name/fa/factorio/utils.nix +++ b/pkgs/by-name/fa/factorio/utils.nix @@ -24,17 +24,16 @@ in name = "factorio-mod-directory"; preferLocalBuild = true; - buildCommand = - '' - mkdir -p $out - for modDrv in ${toString modDrvs}; do - # NB: there will only ever be a single zip file in each mod derivation's output dir - ln -s $modDrv/*.zip $out - done - '' - + (optionalString (modsDatFile != null) '' - cp ${modsDatFile} $out/mod-settings.dat - ''); + buildCommand = '' + mkdir -p $out + for modDrv in ${toString modDrvs}; do + # NB: there will only ever be a single zip file in each mod derivation's output dir + ln -s $modDrv/*.zip $out + done + '' + + (optionalString (modsDatFile != null) '' + cp ${modsDatFile} $out/mod-settings.dat + ''); }; modDrv = diff --git a/pkgs/by-name/fa/faiss/package.nix b/pkgs/by-name/fa/faiss/package.nix index 940dff5185dc..d8bbc97f50af 100644 --- a/pkgs/by-name/fa/faiss/package.nix +++ b/pkgs/by-name/fa/faiss/package.nix @@ -53,36 +53,35 @@ stdenv.mkDerivation { hash = "sha256-N8UkL+KS9Da6RtaHI9pY5gAzFtTSMJ9R5h4RSX9b1Ro="; }; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.setuptools - python3Packages.pip - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.setuptools + python3Packages.pip + ]; - buildInputs = - [ - blas - swig - ] - ++ lib.optionals pythonSupport [ python3Packages.numpy ] - ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ] - ++ lib.optionals cudaSupport cudaComponents; + buildInputs = [ + blas + swig + ] + ++ lib.optionals pythonSupport [ python3Packages.numpy ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ] + ++ lib.optionals cudaSupport cudaComponents; - cmakeFlags = - [ - (lib.cmakeBool "FAISS_ENABLE_GPU" cudaSupport) - (lib.cmakeBool "FAISS_ENABLE_PYTHON" pythonSupport) - (lib.cmakeFeature "FAISS_OPT_LEVEL" optLevel) - ] - ++ lib.optionals cudaSupport [ - (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" flags.cmakeCudaArchitecturesString) - ]; + cmakeFlags = [ + (lib.cmakeBool "FAISS_ENABLE_GPU" cudaSupport) + (lib.cmakeBool "FAISS_ENABLE_PYTHON" pythonSupport) + (lib.cmakeFeature "FAISS_OPT_LEVEL" optLevel) + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" flags.cmakeCudaArchitecturesString) + ]; buildFlags = [ "faiss" ] ++ lib.optionals pythonSupport [ "swigfaiss" ]; diff --git a/pkgs/by-name/fa/famistudio/package.nix b/pkgs/by-name/fa/famistudio/package.nix index 6655645b3db6..ff3eb931f7f0 100644 --- a/pkgs/by-name/fa/famistudio/package.nix +++ b/pkgs/by-name/fa/famistudio/package.nix @@ -60,56 +60,55 @@ buildDotnetModule (finalAttrs: { expectedName = "${libPrefix}${args.depname}"; ourName = "${libPrefix}${args.depname}"; }; - librariesToReplace = - [ - # Unmodified native libraries that we can fully substitute - { - package = glfw; - expectedName = "libglfw"; - ourName = "libglfw"; - } - { - package = rtmidi; - expectedName = "librtmidi"; - ourName = "librtmidi"; - } - ] - ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ - { - package = openal; - expectedName = "libopenal32"; - ourName = "libopenal"; - } - ] - ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ - { - package = portaudio; - expectedName = "libportaudio.2"; - ourName = "libportaudio.2"; - } - ] - ++ [ - # Native libraries, with extra code for the C# wrapping - (nativeWrapperToReplaceFormat { depname = "GifDec"; }) - (nativeWrapperToReplaceFormat { depname = "NesSndEmu"; }) - (nativeWrapperToReplaceFormat { - depname = "NotSoFatso"; - extraPostPatch = '' - # C++17 does not allow register storage class specifier - substituteInPlace build.sh \ - --replace-fail "$CXX" "$CXX -std=c++14" - ''; - }) - (nativeWrapperToReplaceFormat { depname = "ShineMp3"; }) - (nativeWrapperToReplaceFormat { depname = "Stb"; }) - (nativeWrapperToReplaceFormat { - depname = "Vorbis"; - buildInputs = [ - libogg - libvorbis - ]; - }) - ]; + librariesToReplace = [ + # Unmodified native libraries that we can fully substitute + { + package = glfw; + expectedName = "libglfw"; + ourName = "libglfw"; + } + { + package = rtmidi; + expectedName = "librtmidi"; + ourName = "librtmidi"; + } + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ + { + package = openal; + expectedName = "libopenal32"; + ourName = "libopenal"; + } + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ + { + package = portaudio; + expectedName = "libportaudio.2"; + ourName = "libportaudio.2"; + } + ] + ++ [ + # Native libraries, with extra code for the C# wrapping + (nativeWrapperToReplaceFormat { depname = "GifDec"; }) + (nativeWrapperToReplaceFormat { depname = "NesSndEmu"; }) + (nativeWrapperToReplaceFormat { + depname = "NotSoFatso"; + extraPostPatch = '' + # C++17 does not allow register storage class specifier + substituteInPlace build.sh \ + --replace-fail "$CXX" "$CXX -std=c++14" + ''; + }) + (nativeWrapperToReplaceFormat { depname = "ShineMp3"; }) + (nativeWrapperToReplaceFormat { depname = "Stb"; }) + (nativeWrapperToReplaceFormat { + depname = "Vorbis"; + buildInputs = [ + libogg + libvorbis + ]; + }) + ]; libraryReplaceArgs = lib.strings.concatMapStringsSep " " ( library: "--replace-fail '${libname library.expectedName}' '${lib.getLib library.package}/lib/${libname library.ourName}'" diff --git a/pkgs/by-name/fa/far2l/package.nix b/pkgs/by-name/fa/far2l/package.nix index 501f360f0493..5ad12479f2ef 100644 --- a/pkgs/by-name/fa/far2l/package.nix +++ b/pkgs/by-name/fa/far2l/package.nix @@ -95,20 +95,19 @@ stdenv.mkDerivation rec { patchShebangs far2l/bootstrap/view.sh ''; - cmakeFlags = - [ - (lib.cmakeBool "TTYX" withTTYX) - (lib.cmakeBool "USEWX" withGUI) - (lib.cmakeBool "USEUCD" withUCD) - (lib.cmakeBool "COLORER" withColorer) - (lib.cmakeBool "MULTIARC" withMultiArc) - (lib.cmakeBool "NETROCKS" withNetRocks) - (lib.cmakeBool "PYTHON" withPython) - ] - ++ lib.optionals withPython [ - (lib.cmakeFeature "VIRTUAL_PYTHON" "python") - (lib.cmakeFeature "VIRTUAL_PYTHON_VERSION" "python") - ]; + cmakeFlags = [ + (lib.cmakeBool "TTYX" withTTYX) + (lib.cmakeBool "USEWX" withGUI) + (lib.cmakeBool "USEUCD" withUCD) + (lib.cmakeBool "COLORER" withColorer) + (lib.cmakeBool "MULTIARC" withMultiArc) + (lib.cmakeBool "NETROCKS" withNetRocks) + (lib.cmakeBool "PYTHON" withPython) + ] + ++ lib.optionals withPython [ + (lib.cmakeFeature "VIRTUAL_PYTHON" "python") + (lib.cmakeFeature "VIRTUAL_PYTHON_VERSION" "python") + ]; runtimeDeps = [ unzip diff --git a/pkgs/by-name/fa/fastcdr/package.nix b/pkgs/by-name/fa/fastcdr/package.nix index 7f66c051cc95..46b1247e9722 100644 --- a/pkgs/by-name/fa/fastcdr/package.nix +++ b/pkgs/by-name/fa/fastcdr/package.nix @@ -32,14 +32,13 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" ] ++ lib.optional withDocs "doc"; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals withDocs [ - doxygen - graphviz-nox - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals withDocs [ + doxygen + graphviz-nox + ]; doCheck = true; diff --git a/pkgs/by-name/fa/fastd/package.nix b/pkgs/by-name/fa/fastd/package.nix index bb883d23549e..5766360847a5 100644 --- a/pkgs/by-name/fa/fastd/package.nix +++ b/pkgs/by-name/fa/fastd/package.nix @@ -32,17 +32,16 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - json_c - libcap - libsodium - libuecc - openssl - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - libmnl - ]; + buildInputs = [ + json_c + libcap + libsodium + libuecc + openssl + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + libmnl + ]; # some options are only available on x86 mesonFlags = lib.optionals (!stdenv.hostPlatform.isx86) [ diff --git a/pkgs/by-name/fa/fastfetch/package.nix b/pkgs/by-name/fa/fastfetch/package.nix index 7ae2635a1575..7c31d6341ed6 100644 --- a/pkgs/by-name/fa/fastfetch/package.nix +++ b/pkgs/by-name/fa/fastfetch/package.nix @@ -190,73 +190,71 @@ stdenv.mkDerivation (finalAttrs: { in commonDeps ++ imageDeps ++ sqliteDeps ++ linuxCoreDeps ++ linuxFeatureDeps ++ macosDeps; - cmakeFlags = - [ - (lib.cmakeOptionType "filepath" "CMAKE_INSTALL_SYSCONFDIR" "${placeholder "out"}/etc") - (lib.cmakeBool "ENABLE_DIRECTX_HEADERS" false) - (lib.cmakeBool "ENABLE_SYSTEM_YYJSON" true) + cmakeFlags = [ + (lib.cmakeOptionType "filepath" "CMAKE_INSTALL_SYSCONFDIR" "${placeholder "out"}/etc") + (lib.cmakeBool "ENABLE_DIRECTX_HEADERS" false) + (lib.cmakeBool "ENABLE_SYSTEM_YYJSON" true) - # Feature flags - (lib.cmakeBool "BUILD_FLASHFETCH" flashfetchSupport) + # Feature flags + (lib.cmakeBool "BUILD_FLASHFETCH" flashfetchSupport) - (lib.cmakeBool "ENABLE_IMAGEMAGICK6" false) - (lib.cmakeBool "ENABLE_IMAGEMAGICK7" imageSupport) - (lib.cmakeBool "ENABLE_CHAFA" imageSupport) + (lib.cmakeBool "ENABLE_IMAGEMAGICK6" false) + (lib.cmakeBool "ENABLE_IMAGEMAGICK7" imageSupport) + (lib.cmakeBool "ENABLE_CHAFA" imageSupport) - (lib.cmakeBool "ENABLE_SQLITE3" sqliteSupport) + (lib.cmakeBool "ENABLE_SQLITE3" sqliteSupport) - (lib.cmakeBool "ENABLE_LIBZFS" zfsSupport) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - (lib.cmakeBool "ENABLE_PULSE" audioSupport) + (lib.cmakeBool "ENABLE_LIBZFS" zfsSupport) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + (lib.cmakeBool "ENABLE_PULSE" audioSupport) - (lib.cmakeBool "ENABLE_DDCUTIL" brightnessSupport) + (lib.cmakeBool "ENABLE_DDCUTIL" brightnessSupport) - (lib.cmakeBool "ENABLE_DBUS" dbusSupport) + (lib.cmakeBool "ENABLE_DBUS" dbusSupport) - (lib.cmakeBool "ENABLE_ELF" terminalSupport) + (lib.cmakeBool "ENABLE_ELF" terminalSupport) - (lib.cmakeBool "ENABLE_GIO" gnomeSupport) - (lib.cmakeBool "ENABLE_DCONF" gnomeSupport) + (lib.cmakeBool "ENABLE_GIO" gnomeSupport) + (lib.cmakeBool "ENABLE_DCONF" gnomeSupport) - (lib.cmakeBool "ENABLE_ZLIB" imageSupport) + (lib.cmakeBool "ENABLE_ZLIB" imageSupport) - (lib.cmakeBool "ENABLE_OPENCL" openclSupport) + (lib.cmakeBool "ENABLE_OPENCL" openclSupport) - (lib.cmakeBool "ENABLE_EGL" openglSupport) - (lib.cmakeBool "ENABLE_GLX" openglSupport) + (lib.cmakeBool "ENABLE_EGL" openglSupport) + (lib.cmakeBool "ENABLE_GLX" openglSupport) - (lib.cmakeBool "ENABLE_RPM" rpmSupport) + (lib.cmakeBool "ENABLE_RPM" rpmSupport) - (lib.cmakeBool "ENABLE_DRM" (!x11Support && !waylandSupport)) - (lib.cmakeBool "ENABLE_DRM_AMDGPU" (!x11Support && !waylandSupport)) + (lib.cmakeBool "ENABLE_DRM" (!x11Support && !waylandSupport)) + (lib.cmakeBool "ENABLE_DRM_AMDGPU" (!x11Support && !waylandSupport)) - (lib.cmakeBool "ENABLE_VULKAN" vulkanSupport) + (lib.cmakeBool "ENABLE_VULKAN" vulkanSupport) - (lib.cmakeBool "ENABLE_WAYLAND" waylandSupport) + (lib.cmakeBool "ENABLE_WAYLAND" waylandSupport) - (lib.cmakeBool "ENABLE_XCB_RANDR" x11Support) - (lib.cmakeBool "ENABLE_XRANDR" x11Support) + (lib.cmakeBool "ENABLE_XCB_RANDR" x11Support) + (lib.cmakeBool "ENABLE_XRANDR" x11Support) - (lib.cmakeBool "ENABLE_XFCONF" xfceSupport) + (lib.cmakeBool "ENABLE_XFCONF" xfceSupport) - (lib.cmakeOptionType "filepath" "CUSTOM_PCI_IDS_PATH" "${hwdata}/share/hwdata/pci.ids") - (lib.cmakeOptionType "filepath" "CUSTOM_AMDGPU_IDS_PATH" "${libdrm}/share/libdrm/amdgpu.ids") - ]; + (lib.cmakeOptionType "filepath" "CUSTOM_PCI_IDS_PATH" "${hwdata}/share/hwdata/pci.ids") + (lib.cmakeOptionType "filepath" "CUSTOM_AMDGPU_IDS_PATH" "${libdrm}/share/libdrm/amdgpu.ids") + ]; postPatch = '' substituteInPlace completions/fastfetch.{bash,fish,zsh} --replace-fail python3 '${python3.interpreter}' ''; - postInstall = - '' - wrapProgram $out/bin/fastfetch \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" - '' - + lib.optionalString flashfetchSupport '' - wrapProgram $out/bin/flashfetch \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" - ''; + postInstall = '' + wrapProgram $out/bin/fastfetch \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" + '' + + lib.optionalString flashfetchSupport '' + wrapProgram $out/bin/flashfetch \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.buildInputs}" + ''; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgramArg = "--version"; diff --git a/pkgs/by-name/fa/fastjet/package.nix b/pkgs/by-name/fa/fastjet/package.nix index 4ca40d8af55d..c09fc2999519 100644 --- a/pkgs/by-name/fa/fastjet/package.nix +++ b/pkgs/by-name/fa/fastjet/package.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-allcxxplugins" - ] ++ lib.optional withPython "--enable-pyext"; + ] + ++ lib.optional withPython "--enable-pyext"; enableParallelBuilding = true; diff --git a/pkgs/by-name/fa/fastnlo-toolkit/package.nix b/pkgs/by-name/fa/fastnlo-toolkit/package.nix index aa5e76c036d3..2a2cef7de1ab 100644 --- a/pkgs/by-name/fa/fastnlo-toolkit/package.nix +++ b/pkgs/by-name/fa/fastnlo-toolkit/package.nix @@ -37,25 +37,24 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ lhapdf # lhapdf-config yoda # yoda-config - ] ++ lib.optional withPython python; + ] + ++ lib.optional withPython python; - buildInputs = - [ - boost - lhapdf - yoda - ] - ++ lib.optional withPython python - ++ lib.optional (withPython && python.isPy3k) ncurses; + buildInputs = [ + boost + lhapdf + yoda + ] + ++ lib.optional withPython python + ++ lib.optional (withPython && python.isPy3k) ncurses; propagatedNativeBuildInputs = lib.optional withPython [ swig ]; - propagatedBuildInputs = - [ - zlib - ] - ++ lib.optional withPython [ - python.pkgs.distutils - ]; + propagatedBuildInputs = [ + zlib + ] + ++ lib.optional withPython [ + python.pkgs.distutils + ]; preConfigure = '' substituteInPlace ./fastnlotoolkit/Makefile.in \ @@ -68,7 +67,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-yoda=${yoda}" - ] ++ lib.optional withPython "--enable-pyext"; + ] + ++ lib.optional withPython "--enable-pyext"; strictDeps = true; diff --git a/pkgs/by-name/fa/fastqc/package.nix b/pkgs/by-name/fa/fastqc/package.nix index 5cd4a557e3b4..406ca4c89042 100644 --- a/pkgs/by-name/fa/fastqc/package.nix +++ b/pkgs/by-name/fa/fastqc/package.nix @@ -23,13 +23,12 @@ stdenv.mkDerivation (finalAttrs: { dontBuild = true; - nativeBuildInputs = - [ - makeWrapper - imagemagick - ] - ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems # postInstallHook - ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; # fixupOutputHook + nativeBuildInputs = [ + makeWrapper + imagemagick + ] + ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems # postInstallHook + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; # fixupOutputHook buildInputs = [ jre perl diff --git a/pkgs/by-name/fa/fatrop/package.nix b/pkgs/by-name/fa/fatrop/package.nix index f575b763d04a..554a8f52cbdf 100644 --- a/pkgs/by-name/fa/fatrop/package.nix +++ b/pkgs/by-name/fa/fatrop/package.nix @@ -21,10 +21,11 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ cmake ]; - buildInputs = - [ blasfeo ] - ++ lib.optionals pythonSupport [ python3Packages.pybind11 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; + buildInputs = [ + blasfeo + ] + ++ lib.optionals pythonSupport [ python3Packages.pybind11 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; cmakeFlags = [ (lib.cmakeBool "BUILD_DOCS" true) diff --git a/pkgs/by-name/fa/fawltydeps/package.nix b/pkgs/by-name/fa/fawltydeps/package.nix index 391c03a4c156..3a84630db2a3 100644 --- a/pkgs/by-name/fa/fawltydeps/package.nix +++ b/pkgs/by-name/fa/fawltydeps/package.nix @@ -27,14 +27,13 @@ python3Packages.buildPythonApplication rec { pydantic ]; - nativeCheckInputs = - [ - writableTmpDirAsHomeHook - ] - ++ (with python3Packages; [ - pytestCheckHook - hypothesis - ]); + nativeCheckInputs = [ + writableTmpDirAsHomeHook + ] + ++ (with python3Packages; [ + pytestCheckHook + hypothesis + ]); disabledTestPaths = [ # Disable tests that require network diff --git a/pkgs/by-name/fb/fbthrift/package.nix b/pkgs/by-name/fb/fbthrift/package.nix index a55807541051..b7b61a363a82 100644 --- a/pkgs/by-name/fb/fbthrift/package.nix +++ b/pkgs/by-name/fb/fbthrift/package.nix @@ -83,26 +83,25 @@ stdenv.mkDerivation (finalAttrs: { xxHash ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) - (lib.cmakeBool "thriftpy" false) + (lib.cmakeBool "thriftpy" false) - # TODO: Can’t figure out where the C++ tests are wired up in the - # CMake build, if anywhere, and this requires Python. - #(lib.cmakeBool "enable_tests" finalAttrs.finalPackage.doCheck) + # TODO: Can’t figure out where the C++ tests are wired up in the + # CMake build, if anywhere, and this requires Python. + #(lib.cmakeBool "enable_tests" finalAttrs.finalPackage.doCheck) - (lib.cmakeFeature "BIN_INSTALL_DIR" "${placeholder "out"}/bin") - (lib.cmakeFeature "INCLUDE_INSTALL_DIR" "${placeholder "out"}/include") - (lib.cmakeFeature "LIB_INSTALL_DIR" "${placeholder "lib"}/lib") - (lib.cmakeFeature "CMAKE_INSTALL_DIR" "${placeholder "out"}/lib/cmake/fbthrift") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Homebrew sets this, and the shared library build fails without - # it. I don’t know, either. It scares me. - (lib.cmakeFeature "CMAKE_SHARED_LINKER_FLAGS" "-Wl,-undefined,dynamic_lookup") - ]; + (lib.cmakeFeature "BIN_INSTALL_DIR" "${placeholder "out"}/bin") + (lib.cmakeFeature "INCLUDE_INSTALL_DIR" "${placeholder "out"}/include") + (lib.cmakeFeature "LIB_INSTALL_DIR" "${placeholder "lib"}/lib") + (lib.cmakeFeature "CMAKE_INSTALL_DIR" "${placeholder "out"}/lib/cmake/fbthrift") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Homebrew sets this, and the shared library build fails without + # it. I don’t know, either. It scares me. + (lib.cmakeFeature "CMAKE_SHARED_LINKER_FLAGS" "-Wl,-undefined,dynamic_lookup") + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/fc/fcft/package.nix b/pkgs/by-name/fc/fcft/package.nix index d9a026008195..1e2392b7b544 100644 --- a/pkgs/by-name/fc/fcft/package.nix +++ b/pkgs/by-name/fc/fcft/package.nix @@ -50,26 +50,24 @@ stdenv.mkDerivation rec { ninja scdoc ]; - buildInputs = - [ - freetype - fontconfig - nanosvg - pixman - tllist - ] - ++ lib.optionals (withShapingTypes != [ ]) [ harfbuzz ] - ++ lib.optionals (builtins.elem "run" withShapingTypes) [ utf8proc ]; + buildInputs = [ + freetype + fontconfig + nanosvg + pixman + tllist + ] + ++ lib.optionals (withShapingTypes != [ ]) [ harfbuzz ] + ++ lib.optionals (builtins.elem "run" withShapingTypes) [ utf8proc ]; nativeCheckInputs = [ check ]; mesonBuildType = "release"; - mesonFlags = - [ - (lib.mesonEnable "system-nanosvg" true) - ] - ++ builtins.map ( - t: lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes) - ) availableShapingTypes; + mesonFlags = [ + (lib.mesonEnable "system-nanosvg" true) + ] + ++ builtins.map ( + t: lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes) + ) availableShapingTypes; doCheck = true; diff --git a/pkgs/by-name/fd/fd/package.nix b/pkgs/by-name/fd/fd/package.nix index e556c04e0770..23d59f1d8935 100644 --- a/pkgs/by-name/fd/fd/package.nix +++ b/pkgs/by-name/fd/fd/package.nix @@ -35,16 +35,15 @@ rustPlatform.buildRustPackage rec { "--skip=test_invalid_utf8" ]; - postInstall = - '' - installManPage doc/fd.1 - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd fd \ - --bash <($out/bin/fd --gen-completions bash) \ - --fish <($out/bin/fd --gen-completions fish) - installShellCompletion --zsh contrib/completion/_fd - ''; + postInstall = '' + installManPage doc/fd.1 + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd fd \ + --bash <($out/bin/fd --gen-completions bash) \ + --fish <($out/bin/fd --gen-completions fish) + installShellCompletion --zsh contrib/completion/_fd + ''; passthru.tests.version = testers.testVersion { package = fd; diff --git a/pkgs/by-name/fe/feather-tk/package.nix b/pkgs/by-name/fe/feather-tk/package.nix index 4a20a2e65246..fad1927e3710 100644 --- a/pkgs/by-name/fe/feather-tk/package.nix +++ b/pkgs/by-name/fe/feather-tk/package.nix @@ -41,26 +41,25 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - freetype - glfw - lunasvg - plutovg - nlohmann_json - libpng - zlib - libGL - ] - ++ lib.optionals (enableNFD && nativeFileDialog != null) [ - nativeFileDialog - ] - ++ lib.optionals (enableNFD && stdenv.isLinux) [ - gtk3 - ] - ++ lib.optionals enablePython [ - python3Packages.pybind11 - ]; + buildInputs = [ + freetype + glfw + lunasvg + plutovg + nlohmann_json + libpng + zlib + libGL + ] + ++ lib.optionals (enableNFD && nativeFileDialog != null) [ + nativeFileDialog + ] + ++ lib.optionals (enableNFD && stdenv.isLinux) [ + gtk3 + ] + ++ lib.optionals enablePython [ + python3Packages.pybind11 + ]; cmakeFlags = [ (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") diff --git a/pkgs/by-name/fe/feather/package.nix b/pkgs/by-name/fe/feather/package.nix index 8c715b25df18..f23bb0f1fc99 100644 --- a/pkgs/by-name/fe/feather/package.nix +++ b/pkgs/by-name/fe/feather/package.nix @@ -40,27 +40,26 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook ]; - buildInputs = - [ - bc-ur - boost186 - hidapi - libsodium - libusb1 - openssl - protobuf - qrencode - unbound - zxing-cpp - ] - ++ (with qt6; [ - qtbase - qtmultimedia - qtsvg - qttools - qtwayland - qtwebsockets - ]); + buildInputs = [ + bc-ur + boost186 + hidapi + libsodium + libusb1 + openssl + protobuf + qrencode + unbound + zxing-cpp + ] + ++ (with qt6; [ + qtbase + qtmultimedia + qtsvg + qttools + qtwayland + qtwebsockets + ]); cmakeFlags = [ "-DProtobuf_INCLUDE_DIR=${lib.getDev protobuf}/include" diff --git a/pkgs/by-name/fe/febio-studio/package.nix b/pkgs/by-name/fe/febio-studio/package.nix index aecec37c9523..09613f96e9b3 100644 --- a/pkgs/by-name/fe/febio-studio/package.nix +++ b/pkgs/by-name/fe/febio-studio/package.nix @@ -43,14 +43,15 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - cmakeFlags = - [ (lib.cmakeFeature "Qt_Root" "${qt6Packages.qtbase}") ] - ++ lib.optional sshSupport "-DUSE_SSH=On" - ++ lib.optional tetgenSupport "-DUSE_TETGEN=On" - ++ lib.optional ffmpegSupport "-DUSE_FFMPEG=On" - ++ lib.optional dicomSupport "-DUSE_DICOM=On" - ++ lib.optional withModelRepo "-DMODEL_REPO=On" - ++ lib.optional withCadFeatures "-DCAD_FEATURES=On"; + cmakeFlags = [ + (lib.cmakeFeature "Qt_Root" "${qt6Packages.qtbase}") + ] + ++ lib.optional sshSupport "-DUSE_SSH=On" + ++ lib.optional tetgenSupport "-DUSE_TETGEN=On" + ++ lib.optional ffmpegSupport "-DUSE_FFMPEG=On" + ++ lib.optional dicomSupport "-DUSE_DICOM=On" + ++ lib.optional withModelRepo "-DMODEL_REPO=On" + ++ lib.optional withCadFeatures "-DCAD_FEATURES=On"; nativeBuildInputs = [ cmake @@ -58,21 +59,20 @@ stdenv.mkDerivation (finalAttrs: { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - zlib - libGLU - glew - qt6Packages.qtbase - febio - ] - ++ lib.optionals sshSupport [ - openssl - libssh - ] - ++ lib.optional tetgenSupport tetgen - ++ lib.optional ffmpegSupport ffmpeg - ++ lib.optional dicomSupport dcmtk; + buildInputs = [ + zlib + libGLU + glew + qt6Packages.qtbase + febio + ] + ++ lib.optionals sshSupport [ + openssl + libssh + ] + ++ lib.optional tetgenSupport tetgen + ++ lib.optional ffmpegSupport ffmpeg + ++ lib.optional dicomSupport dcmtk; meta = { description = "FEBio Suite Solver"; diff --git a/pkgs/by-name/fe/fedistar/package.nix b/pkgs/by-name/fe/fedistar/package.nix index ba8866e2da0a..2b9351d9bf2a 100644 --- a/pkgs/by-name/fe/fedistar/package.nix +++ b/pkgs/by-name/fe/fedistar/package.nix @@ -53,12 +53,13 @@ rustPlatform.buildRustPackage (finalAttrs: { wrapGAppsHook4 ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ - glib-networking - webkitgtk_4_1 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ + glib-networking + webkitgtk_4_1 + ]; doCheck = false; # This version's tests do not pass diff --git a/pkgs/by-name/fe/feedgnuplot/package.nix b/pkgs/by-name/fe/feedgnuplot/package.nix index 9d1590ba947b..9b1f5e7380e3 100644 --- a/pkgs/by-name/fe/feedgnuplot/package.nix +++ b/pkgs/by-name/fe/feedgnuplot/package.nix @@ -34,18 +34,18 @@ perlPackages.buildPerlPackage rec { nativeBuildInputs = [ makeWrapper installShellFiles - ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; - buildInputs = - [ - gnuplot - perl - ] - ++ (with perlPackages; [ - ListMoreUtils - IPCRun - StringShellQuote - ]); + buildInputs = [ + gnuplot + perl + ] + ++ (with perlPackages; [ + ListMoreUtils + IPCRun + StringShellQuote + ]); # Fontconfig error: Cannot load default config file FONTCONFIG_FILE = fontsConf; diff --git a/pkgs/by-name/fe/feishin/package.nix b/pkgs/by-name/fe/feishin/package.nix index bee6b0ee8841..633339f976a7 100644 --- a/pkgs/by-name/fe/feishin/package.nix +++ b/pkgs/by-name/fe/feishin/package.nix @@ -37,21 +37,20 @@ buildNpmPackage { lib.optionals (stdenv.hostPlatform.isLinux) [ copyDesktopItems ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.autoSignDarwinBinariesHook ]; - postPatch = - '' - # release/app dependencies are installed on preConfigure - substituteInPlace package.json \ - --replace-fail "electron-builder install-app-deps &&" "" + postPatch = '' + # release/app dependencies are installed on preConfigure + substituteInPlace package.json \ + --replace-fail "electron-builder install-app-deps &&" "" - # Don't check for updates. - substituteInPlace src/main/main.ts \ - --replace-fail "autoUpdater.checkForUpdatesAndNotify();" "" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # https://github.com/electron/electron/issues/31121 - substituteInPlace src/main/main.ts \ - --replace-fail "process.resourcesPath" "'$out/share/feishin/resources'" - ''; + # Don't check for updates. + substituteInPlace src/main/main.ts \ + --replace-fail "autoUpdater.checkForUpdatesAndNotify();" "" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # https://github.com/electron/electron/issues/31121 + substituteInPlace src/main/main.ts \ + --replace-fail "process.resourcesPath" "'$out/share/feishin/resources'" + ''; preConfigure = let @@ -95,40 +94,39 @@ buildNpmPackage { -c.npmRebuild=false ''; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/{Applications,bin} - cp -r release/build/**/Feishin.app $out/Applications/ - makeWrapper $out/Applications/Feishin.app/Contents/MacOS/Feishin $out/bin/feishin - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/share/feishin - pushd release/build/*/ - cp -r locales resources{,.pak} $out/share/feishin - popd + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/{Applications,bin} + cp -r release/build/**/Feishin.app $out/Applications/ + makeWrapper $out/Applications/Feishin.app/Contents/MacOS/Feishin $out/bin/feishin + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/share/feishin + pushd release/build/*/ + cp -r locales resources{,.pak} $out/share/feishin + popd - # Code relies on checking app.isPackaged, which returns false if the executable is electron. - # Set ELECTRON_FORCE_IS_PACKAGED=1. - # https://github.com/electron/electron/issues/35153#issuecomment-1202718531 - makeWrapper ${lib.getExe electron} $out/bin/feishin \ - --add-flags $out/share/feishin/resources/app.asar \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --set ELECTRON_FORCE_IS_PACKAGED=1 \ - --inherit-argv0 + # Code relies on checking app.isPackaged, which returns false if the executable is electron. + # Set ELECTRON_FORCE_IS_PACKAGED=1. + # https://github.com/electron/electron/issues/35153#issuecomment-1202718531 + makeWrapper ${lib.getExe electron} $out/bin/feishin \ + --add-flags $out/share/feishin/resources/app.asar \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --set ELECTRON_FORCE_IS_PACKAGED=1 \ + --inherit-argv0 - for size in 32 64 128 256 512 1024; do - mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps - ln -s \ - $out/share/feishin/resources/assets/icons/"$size"x"$size".png \ - $out/share/icons/hicolor/"$size"x"$size"/apps/feishin.png - done - '' - + '' - runHook postInstall - ''; + for size in 32 64 128 256 512 1024; do + mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps + ln -s \ + $out/share/feishin/resources/assets/icons/"$size"x"$size".png \ + $out/share/icons/hicolor/"$size"x"$size"/apps/feishin.png + done + '' + + '' + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/fe/ferrishot/package.nix b/pkgs/by-name/fe/ferrishot/package.nix index ef4dfe09093d..942ffdc21dee 100644 --- a/pkgs/by-name/fe/ferrishot/package.nix +++ b/pkgs/by-name/fe/ferrishot/package.nix @@ -27,14 +27,13 @@ rustPlatform.buildRustPackage (finalAttrs: { useFetchCargoVendor = true; cargoHash = "sha256-TJWS8LzLTQSr+0uw0x38mNJrjYvMzr90URYI8UcRQqc="; - nativeBuildInputs = - [ - makeBinaryWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # error: unable to open output file '/homeless-shelter/.cache/clang/ModuleCache/354UBE8EJRBZ3/Cocoa-31YYBL2V1XGQP.pcm': 'No such file or directory' - writableTmpDirAsHomeHook - ]; + nativeBuildInputs = [ + makeBinaryWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # error: unable to open output file '/homeless-shelter/.cache/clang/ModuleCache/354UBE8EJRBZ3/Cocoa-31YYBL2V1XGQP.pcm': 'No such file or directory' + writableTmpDirAsHomeHook + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libxcb @@ -42,15 +41,14 @@ rustPlatform.buildRustPackage (finalAttrs: { postInstall = let - runtimeDeps = - [ - libGL - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libxkbcommon - wayland - ]; + runtimeDeps = [ + libGL + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libxkbcommon + wayland + ]; in '' wrapProgram $out/bin/ferrishot \ diff --git a/pkgs/by-name/fe/fex/package.nix b/pkgs/by-name/fe/fex/package.nix index fb4c4ece16f1..8b7bfd978ea5 100644 --- a/pkgs/by-name/fe/fex/package.nix +++ b/pkgs/by-name/fe/fex/package.nix @@ -66,17 +66,16 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { nativeCheckInputs = [ nasm ]; - buildInputs = - [ - xxHash - fmt - ] - ++ (with qt5; [ - qtbase - qtdeclarative - qtquickcontrols - qtquickcontrols2 - ]); + buildInputs = [ + xxHash + fmt + ] + ++ (with qt5; [ + qtbase + qtdeclarative + qtquickcontrols + qtquickcontrols2 + ]); cmakeFlags = [ (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") diff --git a/pkgs/by-name/ff/fflas-ffpack/package.nix b/pkgs/by-name/ff/fflas-ffpack/package.nix index ca1f53c63f7a..98a5b5b9e58d 100644 --- a/pkgs/by-name/ff/fflas-ffpack/package.nix +++ b/pkgs/by-name/ff/fflas-ffpack/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ lib.optionals doCheck nativeCheckInputs; + ] + ++ lib.optionals doCheck nativeCheckInputs; buildInputs = [ givaro @@ -40,27 +41,26 @@ stdenv.mkDerivation rec { lapack ]; - configureFlags = - [ - "--with-blas-libs=-lcblas" - "--with-lapack-libs=-llapacke" - "--without-archnative" - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - # disable SIMD instructions (which are enabled *when available* by default) - # for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284) - "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" - "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" - "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" - "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" - "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" - "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" - "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512f" - "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512dq" - "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512vl" - "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" - "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" - ]; + configureFlags = [ + "--with-blas-libs=-lcblas" + "--with-lapack-libs=-llapacke" + "--without-archnative" + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + # disable SIMD instructions (which are enabled *when available* by default) + # for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284) + "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" + "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" + "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" + "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" + "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" + "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" + "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512f" + "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512dq" + "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512vl" + "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" + "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" + ]; doCheck = true; meta = with lib; { diff --git a/pkgs/by-name/ff/ffsend/package.nix b/pkgs/by-name/ff/ffsend/package.nix index 85acebce3992..943da0f12c8b 100644 --- a/pkgs/by-name/ff/ffsend/package.nix +++ b/pkgs/by-name/ff/ffsend/package.nix @@ -44,7 +44,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ openssl ]; preBuild = lib.optionalString (x11Support && usesX11) ( diff --git a/pkgs/by-name/ff/fftw/package.nix b/pkgs/by-name/ff/fftw/package.nix index f41573a3dc55..4c34f1c330af 100644 --- a/pkgs/by-name/ff/fftw/package.nix +++ b/pkgs/by-name/ff/fftw/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation (finalAttrs: { "out" "dev" "man" - ] ++ lib.optional withDoc "info"; # it's dev-doc only + ] + ++ lib.optional withDoc "info"; # it's dev-doc only outputBin = "dev"; # fftw-wisdom nativeBuildInputs = [ gfortran ]; @@ -56,22 +57,21 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional enableMpi mpi; - configureFlags = - [ - "--enable-shared" - "--enable-threads" - "--enable-openmp" - ] + configureFlags = [ + "--enable-shared" + "--enable-threads" + "--enable-openmp" + ] - ++ lib.optional (precision != "double") "--enable-${precision}" - # https://www.fftw.org/fftw3_doc/SIMD-alignment-and-fftw_005fmalloc.html - # FFTW will try to detect at runtime whether the CPU supports these extensions - ++ lib.optional ( - stdenv.hostPlatform.isx86_64 && (precision == "single" || precision == "double") - ) "--enable-sse2 --enable-avx --enable-avx2 --enable-avx512 --enable-avx128-fma" - ++ lib.optional enableMpi "--enable-mpi" - # doc generation causes Fortran wrapper generation which hard-codes gcc - ++ lib.optional (!withDoc) "--disable-doc"; + ++ lib.optional (precision != "double") "--enable-${precision}" + # https://www.fftw.org/fftw3_doc/SIMD-alignment-and-fftw_005fmalloc.html + # FFTW will try to detect at runtime whether the CPU supports these extensions + ++ lib.optional ( + stdenv.hostPlatform.isx86_64 && (precision == "single" || precision == "double") + ) "--enable-sse2 --enable-avx --enable-avx2 --enable-avx512 --enable-avx128-fma" + ++ lib.optional enableMpi "--enable-mpi" + # doc generation causes Fortran wrapper generation which hard-codes gcc + ++ lib.optional (!withDoc) "--disable-doc"; # fftw builds with -mtune=native by default postPatch = '' diff --git a/pkgs/by-name/fh/fheroes2/package.nix b/pkgs/by-name/fh/fheroes2/package.nix index 0ed17fff0a24..111eded615a4 100644 --- a/pkgs/by-name/fh/fheroes2/package.nix +++ b/pkgs/by-name/fh/fheroes2/package.nix @@ -38,7 +38,8 @@ stdenv.mkDerivation rec { SDL2_mixer SDL2_ttf zlib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; makeFlags = [ "FHEROES2_STRICT_COMPILATION=1" diff --git a/pkgs/by-name/fi/fido2-manage/package.nix b/pkgs/by-name/fi/fido2-manage/package.nix index f83f11ac2117..9cd1a5375c2a 100644 --- a/pkgs/by-name/fi/fido2-manage/package.nix +++ b/pkgs/by-name/fi/fido2-manage/package.nix @@ -46,44 +46,41 @@ stdenv.mkDerivation rec { hash = "sha256-UpxRzn24v1vigMFlofVU+YOzKrkxCu2Pk5iktqFgNO8="; }; - nativeBuildInputs = - [ - pkg-config - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - copyDesktopItems - imagemagick - ]; + nativeBuildInputs = [ + pkg-config + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + copyDesktopItems + imagemagick + ]; - buildInputs = - [ - libcbor - openssl - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - xterm - udev - pcsclite - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libuv - libsolv - libcouchbase - ]; + buildInputs = [ + libcbor + openssl + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + xterm + udev + pcsclite + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libuv + libsolv + libcouchbase + ]; cmakeFlags = [ "-USE_PCSC=ON" ]; - postPatch = - '' - substituteInPlace ./src/libfido2.pc.in \ - --replace-fail "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "@CMAKE_INSTALL_FULL_LIBDIR@" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace ./CMakeLists.txt \ - --replace-fail "/\''${CMAKE_INSTALL_LIBDIR}" "/lib" - ''; + postPatch = '' + substituteInPlace ./src/libfido2.pc.in \ + --replace-fail "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "@CMAKE_INSTALL_FULL_LIBDIR@" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace ./CMakeLists.txt \ + --replace-fail "/\''${CMAKE_INSTALL_LIBDIR}" "/lib" + ''; postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' @@ -109,29 +106,28 @@ stdenv.mkDerivation rec { }) ]; - postFixup = - '' - substituteInPlace $out/bin/fido2-manage \ - --replace-fail "/usr/local/bin/" "$out/bin/" \ - --replace-fail "./fido2-manage.sh" "fido2-manage" \ - --replace-fail "awk" "${gawk}/bin/awk" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $out/bin/fido2-manage-gui \ - --replace-fail "./fido2-manage.sh" "$out/bin/fido2-manage" \ - --replace-fail "x-terminal-emulator" "${xterm}/bin/xterm" \ - --replace-fail "tk.Tk()" "tk.Tk(className='fido2-manage')" \ - --replace-fail 'root.title("FIDO2.1 Manager - Python version 0.1 - (c) Token2")' "root.title('Fido2 Manager')" + postFixup = '' + substituteInPlace $out/bin/fido2-manage \ + --replace-fail "/usr/local/bin/" "$out/bin/" \ + --replace-fail "./fido2-manage.sh" "fido2-manage" \ + --replace-fail "awk" "${gawk}/bin/awk" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $out/bin/fido2-manage-gui \ + --replace-fail "./fido2-manage.sh" "$out/bin/fido2-manage" \ + --replace-fail "x-terminal-emulator" "${xterm}/bin/xterm" \ + --replace-fail "tk.Tk()" "tk.Tk(className='fido2-manage')" \ + --replace-fail 'root.title("FIDO2.1 Manager - Python version 0.1 - (c) Token2")' "root.title('Fido2 Manager')" - substituteInPlace $out/bin/fido2-manage \ - --replace-fail "grep" "${gnugrep}/bin/grep" + substituteInPlace $out/bin/fido2-manage \ + --replace-fail "grep" "${gnugrep}/bin/grep" - sed -i '1i #!${pythonEnv.interpreter}' $out/bin/fido2-manage-gui - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace $out/bin/fido2-manage \ - --replace-fail "ggrep" "${gnugrep}/bin/grep" - ''; + sed -i '1i #!${pythonEnv.interpreter}' $out/bin/fido2-manage-gui + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace $out/bin/fido2-manage \ + --replace-fail "ggrep" "${gnugrep}/bin/grep" + ''; meta = { description = "Manage FIDO2.1 devices over USB or NFC, including Passkeys"; diff --git a/pkgs/by-name/fi/filen-cli/package.nix b/pkgs/by-name/fi/filen-cli/package.nix index 75908d67afa1..3a89fbaa1b0d 100644 --- a/pkgs/by-name/fi/filen-cli/package.nix +++ b/pkgs/by-name/fi/filen-cli/package.nix @@ -29,16 +29,15 @@ buildNpmPackage (finalAttrs: { env.npm_config_build_from_source = "true"; - nativeBuildInputs = - [ - makeWrapper - pkg-config # for keytar - ] - ++ lib.optionals stdenv.buildPlatform.isDarwin [ - # for utf-8-validate - # https://github.com/websockets/utf-8-validate/blob/1439ad4cdf99d421084ae3a5f81e2cf43199a690/binding.gyp#L17 - perl - ]; + nativeBuildInputs = [ + makeWrapper + pkg-config # for keytar + ] + ++ lib.optionals stdenv.buildPlatform.isDarwin [ + # for utf-8-validate + # https://github.com/websockets/utf-8-validate/blob/1439ad4cdf99d421084ae3a5f81e2cf43199a690/binding.gyp#L17 + perl + ]; # for keytar buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libsecret ]; diff --git a/pkgs/by-name/fi/fim/package.nix b/pkgs/by-name/fi/fim/package.nix index 5e5cf53f3031..d80e8e7f2198 100644 --- a/pkgs/by-name/fi/fim/package.nix +++ b/pkgs/by-name/fi/fim/package.nix @@ -62,20 +62,19 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - flex - readline - libexif - bash - ] - ++ lib.optional x11Support SDL - ++ lib.optional svgSupport inkscape - ++ lib.optional asciiArtSupport aalib - ++ lib.optional gifSupport giflib - ++ lib.optional tiffSupport libtiff - ++ lib.optional jpegSupport libjpeg - ++ lib.optional pngSupport libpng; + buildInputs = [ + flex + readline + libexif + bash + ] + ++ lib.optional x11Support SDL + ++ lib.optional svgSupport inkscape + ++ lib.optional asciiArtSupport aalib + ++ lib.optional gifSupport giflib + ++ lib.optional tiffSupport libtiff + ++ lib.optional jpegSupport libjpeg + ++ lib.optional pngSupport libpng; configureFlags = [ # mmap works on all relevant platforms diff --git a/pkgs/by-name/fi/finalfrontier/package.nix b/pkgs/by-name/fi/finalfrontier/package.nix index 646a1d413271..cc12d8b86a27 100644 --- a/pkgs/by-name/fi/finalfrontier/package.nix +++ b/pkgs/by-name/fi/finalfrontier/package.nix @@ -28,11 +28,12 @@ rustPlatform.buildRustPackage { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; postInstall = '' installManPage man/*.1 diff --git a/pkgs/by-name/fi/fio/package.nix b/pkgs/by-name/fi/fio/package.nix index 2bda9881e0e1..776ff1cefcef 100644 --- a/pkgs/by-name/fi/fio/package.nix +++ b/pkgs/by-name/fi/fio/package.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation rec { buildInputs = [ python3 zlib - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) libaio; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) libaio; # ./configure does not support autoconf-style --build=/--host=. # We use $CC instead. diff --git a/pkgs/by-name/fi/fire/package.nix b/pkgs/by-name/fi/fire/package.nix index f45d67eac22d..6625ad8a9314 100644 --- a/pkgs/by-name/fi/fire/package.nix +++ b/pkgs/by-name/fi/fire/package.nix @@ -27,23 +27,22 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-d8w+b4OpU2/kQdcAimR4ihDEgVTM1V7J0hj7saDrQpY="; }; - postPatch = - '' - # Disable automatic copying of built plugins during buildPhase, it defaults - # into user home and we want to have building & installing separated. - substituteInPlace CMakeLists.txt \ - --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Remove hardcoded LTO flags: needs extra setup on Linux - substituteInPlace CMakeLists.txt \ - --replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'include(Tests)' '# Not building tests' \ - --replace-fail 'include(Benchmarks)' '# Not building benchmark test' - ''; + postPatch = '' + # Disable automatic copying of built plugins during buildPhase, it defaults + # into user home and we want to have building & installing separated. + substituteInPlace CMakeLists.txt \ + --replace-fail 'COPY_PLUGIN_AFTER_BUILD TRUE' 'COPY_PLUGIN_AFTER_BUILD FALSE' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # Remove hardcoded LTO flags: needs extra setup on Linux + substituteInPlace CMakeLists.txt \ + --replace-fail 'juce::juce_recommended_lto_flags' '# Not forcing LTO' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'include(Tests)' '# Not building tests' \ + --replace-fail 'include(Benchmarks)' '# Not building benchmark test' + ''; strictDeps = true; @@ -69,34 +68,33 @@ stdenv.mkDerivation (finalAttrs: { installPhase = let - pathMappings = - [ - { - from = "LV2"; - to = "${placeholder "out"}/${ - if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/LV2" else "lib/lv2" - }"; - } - { - from = "VST3"; - to = "${placeholder "out"}/${ - if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/VST3" else "lib/vst3" - }"; - } - # this one's a guess, don't know where ppl have agreed to put them yet - { - from = "CLAP"; - to = "${placeholder "out"}/${ - if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/CLAP" else "lib/clap" - }"; - } - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - { - from = "AU"; - to = "${placeholder "out"}/Library/Audio/Plug-Ins/Components"; - } - ]; + pathMappings = [ + { + from = "LV2"; + to = "${placeholder "out"}/${ + if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/LV2" else "lib/lv2" + }"; + } + { + from = "VST3"; + to = "${placeholder "out"}/${ + if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/VST3" else "lib/vst3" + }"; + } + # this one's a guess, don't know where ppl have agreed to put them yet + { + from = "CLAP"; + to = "${placeholder "out"}/${ + if stdenv.hostPlatform.isDarwin then "Library/Audio/Plug-Ins/CLAP" else "lib/clap" + }"; + } + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + { + from = "AU"; + to = "${placeholder "out"}/Library/Audio/Plug-Ins/Components"; + } + ]; in '' runHook preInstall diff --git a/pkgs/by-name/fi/firebase-tools/package.nix b/pkgs/by-name/fi/firebase-tools/package.nix index 88a10c2ffa41..e0db25ed6308 100644 --- a/pkgs/by-name/fi/firebase-tools/package.nix +++ b/pkgs/by-name/fi/firebase-tools/package.nix @@ -25,13 +25,12 @@ buildNpmPackage rec { ln -s npm-shrinkwrap.json package-lock.json ''; - nativeBuildInputs = - [ - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild - ]; + nativeBuildInputs = [ + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild + ]; env.PUPPETEER_SKIP_DOWNLOAD = true; diff --git a/pkgs/by-name/fi/firestarter/package.nix b/pkgs/by-name/fi/firestarter/package.nix index 748f2b44e726..8319aa613aed 100644 --- a/pkgs/by-name/fi/firestarter/package.nix +++ b/pkgs/by-name/fi/firestarter/package.nix @@ -69,41 +69,40 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - nativeBuildInputs = - [ - cmake - git - pkg-config - ] - ++ lib.optionals withCuda [ - addDriverRunpath - ]; + nativeBuildInputs = [ + cmake + git + pkg-config + ] + ++ lib.optionals withCuda [ + addDriverRunpath + ]; - buildInputs = - [ hwloc ] - ++ ( - if withCuda then - [ - glibc_multi - cudatoolkit - ] - else - [ glibc.static ] - ); + buildInputs = [ + hwloc + ] + ++ ( + if withCuda then + [ + glibc_multi + cudatoolkit + ] + else + [ glibc.static ] + ); NIX_LDFLAGS = lib.optionals withCuda [ "-L${cudatoolkit}/lib/stubs" ]; - cmakeFlags = - [ - "-DFIRESTARTER_BUILD_HWLOC=OFF" - "-DCMAKE_C_COMPILER_WORKS=1" - "-DCMAKE_CXX_COMPILER_WORKS=1" - ] - ++ lib.optionals withCuda [ - "-DFIRESTARTER_BUILD_TYPE=FIRESTARTER_CUDA" - ]; + cmakeFlags = [ + "-DFIRESTARTER_BUILD_HWLOC=OFF" + "-DCMAKE_C_COMPILER_WORKS=1" + "-DCMAKE_CXX_COMPILER_WORKS=1" + ] + ++ lib.optionals withCuda [ + "-DFIRESTARTER_BUILD_TYPE=FIRESTARTER_CUDA" + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/fi/firewalld/package.nix b/pkgs/by-name/fi/firewalld/package.nix index 630b85bf35bf..fbab1684c4e8 100644 --- a/pkgs/by-name/fi/firewalld/package.nix +++ b/pkgs/by-name/fi/firewalld/package.nix @@ -61,59 +61,56 @@ stdenv.mkDerivation rec { ./gettext-0.25.patch ]; - postPatch = - '' - substituteInPlace config/xmlschema/check.sh \ - --replace-fail /usr/bin/ "" + postPatch = '' + substituteInPlace config/xmlschema/check.sh \ + --replace-fail /usr/bin/ "" - for file in src/{firewall-offline-cmd.in,firewall/config/__init__.py.in} \ - config/firewall-{applet,config}.desktop.in; do - substituteInPlace $file \ - --replace-fail /usr "$out" - done - '' - + lib.optionalString withGui '' - substituteInPlace src/firewall-applet.in \ - --replace-fail "/usr/bin/systemsettings" "${kdePackages.systemsettings}/bin/systemsettings" \ - --replace-fail "/usr/bin/nm-connection-editor" "${networkmanagerapplet}/bin/nm-connection-editor" - ''; + for file in src/{firewall-offline-cmd.in,firewall/config/__init__.py.in} \ + config/firewall-{applet,config}.desktop.in; do + substituteInPlace $file \ + --replace-fail /usr "$out" + done + '' + + lib.optionalString withGui '' + substituteInPlace src/firewall-applet.in \ + --replace-fail "/usr/bin/systemsettings" "${kdePackages.systemsettings}/bin/systemsettings" \ + --replace-fail "/usr/bin/nm-connection-editor" "${networkmanagerapplet}/bin/nm-connection-editor" + ''; - nativeBuildInputs = - [ - autoconf - automake - docbook_xml_dtd_42 - docbook-xsl-nons - glib - intltool - libxml2 - libxslt - pkg-config - python3 - python3.pkgs.wrapPython - wrapGAppsNoGuiHook - ] - ++ lib.optionals withGui [ - qt6.wrapQtAppsHook - ]; + nativeBuildInputs = [ + autoconf + automake + docbook_xml_dtd_42 + docbook-xsl-nons + glib + intltool + libxml2 + libxslt + pkg-config + python3 + python3.pkgs.wrapPython + wrapGAppsNoGuiHook + ] + ++ lib.optionals withGui [ + qt6.wrapQtAppsHook + ]; - buildInputs = - [ - glib - gobject-introspection - ipset - iptables - kmod - networkmanager - pythonPath - sysctl - ] - ++ lib.optionals withGui [ - gtk3 - libnotify - librsvg - qt6.qtbase - ]; + buildInputs = [ + glib + gobject-introspection + ipset + iptables + kmod + networkmanager + pythonPath + sysctl + ] + ++ lib.optionals withGui [ + gtk3 + libnotify + librsvg + qt6.qtbase + ]; preConfigure = '' ./autogen.sh @@ -133,24 +130,22 @@ stdenv.mkDerivation rec { "--with-ipset=${lib.getExe' ipset "ipset"}" ]; - postInstall = - '' - rm -r $out/share/firewalld/testsuite - '' - + lib.optionalString (!withGui) '' - rm $out/bin/firewall-{applet,config} - ''; + postInstall = '' + rm -r $out/share/firewalld/testsuite + '' + + lib.optionalString (!withGui) '' + rm $out/bin/firewall-{applet,config} + ''; dontWrapGApps = true; dontWrapQtApps = true; - preFixup = - '' - makeWrapperArgs+=("''${gappsWrapperArgs[@]}") - '' - + lib.optionalString withGui '' - makeWrapperArgs+=("''${qtWrapperArgs[@]}") - ''; + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + '' + + lib.optionalString withGui '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") + ''; postFixup = '' chmod +x $out/share/firewalld/*.py diff --git a/pkgs/by-name/fi/fish/package.nix b/pkgs/by-name/fi/fish/package.nix index 1b4c0b375201..949abee00fa2 100644 --- a/pkgs/by-name/fi/fish/package.nix +++ b/pkgs/by-name/fi/fish/package.nix @@ -191,55 +191,54 @@ stdenv.mkDerivation (finalAttrs: { ]; # Fix FHS paths in tests - postPatch = - '' - substituteInPlace src/builtins/tests/test_tests.rs \ - --replace-fail '"/bin/ls"' '"${lib.getExe' coreutils "ls"}"' + postPatch = '' + substituteInPlace src/builtins/tests/test_tests.rs \ + --replace-fail '"/bin/ls"' '"${lib.getExe' coreutils "ls"}"' - substituteInPlace src/tests/highlight.rs \ - --replace-fail '"/bin/echo"' '"${lib.getExe' coreutils "echo"}"' \ - --replace-fail '"/bin/c"' '"${lib.getExe' coreutils "c"}"' \ - --replace-fail '"/bin/ca"' '"${lib.getExe' coreutils "ca"}"' \ - --replace-fail '/usr' '/' + substituteInPlace src/tests/highlight.rs \ + --replace-fail '"/bin/echo"' '"${lib.getExe' coreutils "echo"}"' \ + --replace-fail '"/bin/c"' '"${lib.getExe' coreutils "c"}"' \ + --replace-fail '"/bin/ca"' '"${lib.getExe' coreutils "ca"}"' \ + --replace-fail '/usr' '/' - substituteInPlace tests/checks/cd.fish \ - --replace-fail '/bin/pwd' '${lib.getExe' coreutils "pwd"}' + substituteInPlace tests/checks/cd.fish \ + --replace-fail '/bin/pwd' '${lib.getExe' coreutils "pwd"}' - substituteInPlace tests/checks/redirect.fish \ - --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' + substituteInPlace tests/checks/redirect.fish \ + --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' - substituteInPlace tests/checks/vars_as_commands.fish \ - --replace-fail '/usr/bin' '${coreutils}/bin' + substituteInPlace tests/checks/vars_as_commands.fish \ + --replace-fail '/usr/bin' '${coreutils}/bin' - substituteInPlace tests/checks/jobs.fish \ - --replace-fail 'ps -o' '${lib.getExe' procps "ps"} -o' \ - --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' + substituteInPlace tests/checks/jobs.fish \ + --replace-fail 'ps -o' '${lib.getExe' procps "ps"} -o' \ + --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' - substituteInPlace tests/checks/job-control-noninteractive.fish \ - --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' + substituteInPlace tests/checks/job-control-noninteractive.fish \ + --replace-fail '/bin/echo' '${lib.getExe' coreutils "echo"}' - substituteInPlace tests/checks/complete.fish \ - --replace-fail '/bin/ls' '${lib.getExe' coreutils "ls"}' + substituteInPlace tests/checks/complete.fish \ + --replace-fail '/bin/ls' '${lib.getExe' coreutils "ls"}' - # Several pexpect tests are flaky - # See https://github.com/fish-shell/fish-shell/issues/8789 - rm tests/pexpects/exit_handlers.py - rm tests/pexpects/private_mode.py - rm tests/pexpects/history.py - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Tests use pkill/pgrep which are currently not built on Darwin - # See https://github.com/NixOS/nixpkgs/pull/103180 - # and https://github.com/NixOS/nixpkgs/issues/141157 - rm tests/pexpects/exit.py - rm tests/pexpects/job_summary.py - rm tests/pexpects/signals.py - rm tests/pexpects/fg.py - '' - + lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isDarwin) '' - # This test seems to consistently fail on aarch64 and darwin - rm tests/checks/cd.fish - ''; + # Several pexpect tests are flaky + # See https://github.com/fish-shell/fish-shell/issues/8789 + rm tests/pexpects/exit_handlers.py + rm tests/pexpects/private_mode.py + rm tests/pexpects/history.py + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Tests use pkill/pgrep which are currently not built on Darwin + # See https://github.com/NixOS/nixpkgs/pull/103180 + # and https://github.com/NixOS/nixpkgs/issues/141157 + rm tests/pexpects/exit.py + rm tests/pexpects/job_summary.py + rm tests/pexpects/signals.py + rm tests/pexpects/fg.py + '' + + lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isDarwin) '' + # This test seems to consistently fail on aarch64 and darwin + rm tests/checks/cd.fish + ''; outputs = [ "out" @@ -265,14 +264,13 @@ stdenv.mkDerivation (finalAttrs: { pcre2 ]; - cmakeFlags = - [ - (lib.cmakeFeature "CMAKE_INSTALL_DOCDIR" "${placeholder "doc"}/share/doc/fish") - (lib.cmakeFeature "Rust_CARGO_TARGET" stdenv.hostPlatform.rust.rustcTarget) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeBool "MAC_CODESIGN_ID" false) - ]; + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_INSTALL_DOCDIR" "${placeholder "doc"}/share/doc/fish") + (lib.cmakeFeature "Rust_CARGO_TARGET" stdenv.hostPlatform.rust.rustcTarget) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeBool "MAC_CODESIGN_ID" false) + ]; # Fish’s test suite needs to be able to look up process information and send signals. sandboxProfile = lib.optionalString stdenv.hostPlatform.isDarwin '' @@ -284,14 +282,13 @@ stdenv.mkDerivation (finalAttrs: { # Fish needs coreutils as a runtime dependency, and it gets put into # CMAKE_PREFIX_PATH, which cmake uses to look up build time programs, so it # was clobbering the PATH. It probably needs to be fixed at a lower level. - preConfigure = - '' - patchShebangs ./build_tools/git_version_gen.sh - patchShebangs ./tests/test_driver.py - '' - + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' - export CMAKE_PREFIX_PATH= - ''; + preConfigure = '' + patchShebangs ./build_tools/git_version_gen.sh + patchShebangs ./tests/test_driver.py + '' + + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + export CMAKE_PREFIX_PATH= + ''; # Required binaries during execution propagatedBuildInputs = [ @@ -300,22 +297,22 @@ stdenv.mkDerivation (finalAttrs: { gnused groff gettext - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) man-db; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) man-db; doCheck = true; - nativeCheckInputs = - [ - coreutils - glibcLocales - (python3.withPackages (ps: [ ps.pexpect ])) - procps - sphinx - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # For the getconf command, used in default-setup-path.fish - darwin.system_cmds - ]; + nativeCheckInputs = [ + coreutils + glibcLocales + (python3.withPackages (ps: [ ps.pexpect ])) + procps + sphinx + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # For the getconf command, used in default-setup-path.fish + darwin.system_cmds + ]; # we target the top-level make target which runs all the cmake/ctest # tests, including test_cargo-test @@ -340,42 +337,41 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstallCheck ''; - postInstall = - '' - substituteInPlace "$out/share/fish/functions/grep.fish" \ - --replace-fail "command grep" "command ${lib.getExe gnugrep}" + postInstall = '' + substituteInPlace "$out/share/fish/functions/grep.fish" \ + --replace-fail "command grep" "command ${lib.getExe gnugrep}" - substituteInPlace "$out/share/fish/functions/__fish_print_help.fish" \ - --replace-fail "nroff" "${lib.getExe' groff "nroff"}" + substituteInPlace "$out/share/fish/functions/__fish_print_help.fish" \ + --replace-fail "nroff" "${lib.getExe' groff "nroff"}" - substituteInPlace $out/share/fish/completions/{sudo.fish,doas.fish} \ - --replace-fail "/usr/local/sbin /sbin /usr/sbin" "" - '' - + lib.optionalString usePython '' - cat > $out/share/fish/functions/__fish_anypython.fish < $out/share/fish/functions/__fish_anypython.fish < HDF_INCLUDE_DIRS. - (fetchpatch { - url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0001-Updated-fix-cmake-hdf5.patch"; - sha256 = "yM1ONU4mu6lctttM5YcSTg8F344TNUJXwjxXLqzr5Pk="; - }) - # Patch no-source library workaround that breaks on CMake > 3.11. - (fetchpatch { - url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0001-src-cpp-fix-cmake-3.11-build.patch"; - sha256 = "REsBnbe6vlrZ+iCcw43kR5wy2o6q10RM73xjW5kBsr4="; - }) - ] - ++ lib.optionals (!stdenv.cc.isClang) [ - # Avoid the bundled version of LZ4 and instead use the system one. - (fetchpatch { - url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0003-Use-system-version-of-liblz4.patch"; - sha256 = "xi+GyFn9PEjLgbJeAIEmsbp7ut9G9KIBkVulyT3nfsg="; - }) - # Fix LZ4 string separator issue, see: https://github.com/flann-lib/flann/pull/480 - (fetchpatch { - url = "https://github.com/flann-lib/flann/commit/25eb56ec78472bd419a121c6905095a793cf8992.patch"; - sha256 = "qt8h576Gn8uR7+T9u9bEBIRz6e6AoTKpa1JfdZVvW9s="; - }) - ] - ++ lib.optionals stdenv.cc.isClang [ - # Fix build with Clang 16. - (fetchpatch { - url = "https://github.com/flann-lib/flann/commit/be80cefa69b314a3d9e1ab971715e84145863ebb.patch"; - hash = "sha256-4SUKzQCm0Sx8N43Z6ShuMbgbbe7q8b2Ibk3WgkB0qa4="; - }) - ]; + patches = [ + # Patch HDF5_INCLUDE_DIR -> HDF_INCLUDE_DIRS. + (fetchpatch { + url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0001-Updated-fix-cmake-hdf5.patch"; + sha256 = "yM1ONU4mu6lctttM5YcSTg8F344TNUJXwjxXLqzr5Pk="; + }) + # Patch no-source library workaround that breaks on CMake > 3.11. + (fetchpatch { + url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0001-src-cpp-fix-cmake-3.11-build.patch"; + sha256 = "REsBnbe6vlrZ+iCcw43kR5wy2o6q10RM73xjW5kBsr4="; + }) + ] + ++ lib.optionals (!stdenv.cc.isClang) [ + # Avoid the bundled version of LZ4 and instead use the system one. + (fetchpatch { + url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0003-Use-system-version-of-liblz4.patch"; + sha256 = "xi+GyFn9PEjLgbJeAIEmsbp7ut9G9KIBkVulyT3nfsg="; + }) + # Fix LZ4 string separator issue, see: https://github.com/flann-lib/flann/pull/480 + (fetchpatch { + url = "https://github.com/flann-lib/flann/commit/25eb56ec78472bd419a121c6905095a793cf8992.patch"; + sha256 = "qt8h576Gn8uR7+T9u9bEBIRz6e6AoTKpa1JfdZVvW9s="; + }) + ] + ++ lib.optionals stdenv.cc.isClang [ + # Fix build with Clang 16. + (fetchpatch { + url = "https://github.com/flann-lib/flann/commit/be80cefa69b314a3d9e1ab971715e84145863ebb.patch"; + hash = "sha256-4SUKzQCm0Sx8N43Z6ShuMbgbbe7q8b2Ibk3WgkB0qa4="; + }) + ]; cmakeFlags = [ "-DBUILD_EXAMPLES:BOOL=OFF" diff --git a/pkgs/by-name/fl/flashprog/package.nix b/pkgs/by-name/fl/flashprog/package.nix index e78025cea23f..a43e3301ef72 100644 --- a/pkgs/by-name/fl/flashprog/package.nix +++ b/pkgs/by-name/fl/flashprog/package.nix @@ -31,20 +31,19 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - libftdi1 - libusb1 - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - pciutils - ] - ++ lib.optionals (withJlink) [ - libjaylink - ] - ++ lib.optionals (withGpio) [ - libgpiod - ]; + buildInputs = [ + libftdi1 + libusb1 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + pciutils + ] + ++ lib.optionals (withJlink) [ + libjaylink + ] + ++ lib.optionals (withGpio) [ + libgpiod + ]; postPatch = '' # Remove these rules from flashprog to avoid conflicts with libftdi diff --git a/pkgs/by-name/fl/flashrom/package.nix b/pkgs/by-name/fl/flashrom/package.nix index 2994a67399da..05c5693cf458 100644 --- a/pkgs/by-name/fl/flashrom/package.nix +++ b/pkgs/by-name/fl/flashrom/package.nix @@ -41,15 +41,14 @@ stdenv.mkDerivation (finalAttrs: { sphinx bash-completion ]; - buildInputs = - [ - openssl - cmocka - libftdi1 - libusb1 - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pciutils ] - ++ lib.optional jlinkSupport libjaylink; + buildInputs = [ + openssl + cmocka + libftdi1 + libusb1 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pciutils ] + ++ lib.optional jlinkSupport libjaylink; postPatch = '' substituteInPlace util/flashrom_udev.rules \ diff --git a/pkgs/by-name/fl/flatpak/package.nix b/pkgs/by-name/fl/flatpak/package.nix index 382b91393d8d..6412d8166338 100644 --- a/pkgs/by-name/fl/flatpak/package.nix +++ b/pkgs/by-name/fl/flatpak/package.nix @@ -83,66 +83,64 @@ stdenv.mkDerivation (finalAttrs: { version = "1.16.1"; # TODO: split out lib once we figure out what to do with triggerdir - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withDocbookDocs [ - "doc" - ] - ++ lib.optionals withGtkDoc [ - "devdoc" - ] - ++ lib.optional finalAttrs.doCheck "installedTests" - ++ lib.optional withMan "man"; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withDocbookDocs [ + "doc" + ] + ++ lib.optionals withGtkDoc [ + "devdoc" + ] + ++ lib.optional finalAttrs.doCheck "installedTests" + ++ lib.optional withMan "man"; src = fetchurl { url = "https://github.com/flatpak/flatpak/releases/download/${finalAttrs.version}/flatpak-${finalAttrs.version}.tar.xz"; hash = "sha256-K0fo8tkNNdKTOe144abquzbu+pz6WlyjsNHydQLENnU="; }; - patches = - [ - # Use flatpak from PATH to avoid references to `/nix/store` in `/desktop` files. - # Applications containing `DBusActivatable` entries should be able to find the flatpak binary. - # https://github.com/NixOS/nixpkgs/issues/138956 - ./binary-path.patch + patches = [ + # Use flatpak from PATH to avoid references to `/nix/store` in `/desktop` files. + # Applications containing `DBusActivatable` entries should be able to find the flatpak binary. + # https://github.com/NixOS/nixpkgs/issues/138956 + ./binary-path.patch - # Try mounting fonts and icons from NixOS locations if FHS locations don't exist. - # https://github.com/NixOS/nixpkgs/issues/119433 - ./fix-fonts-icons.patch + # Try mounting fonts and icons from NixOS locations if FHS locations don't exist. + # https://github.com/NixOS/nixpkgs/issues/119433 + ./fix-fonts-icons.patch - # Nix environment hacks should not leak into the apps. - # https://github.com/NixOS/nixpkgs/issues/53441 - ./unset-env-vars.patch + # Nix environment hacks should not leak into the apps. + # https://github.com/NixOS/nixpkgs/issues/53441 + ./unset-env-vars.patch - # The icon validator needs to access the gdk-pixbuf loaders in the Nix store - # and cannot bind FHS paths since those are not available on NixOS. - finalAttrs.passthru.icon-validator-patch - ] - ++ lib.optionals finalAttrs.doCheck [ - # Hardcode paths used by tests and change test runtime generation to use files from Nix store. - # https://github.com/flatpak/flatpak/issues/1460 - (replaceVars ./fix-test-paths.patch { - inherit - coreutils - gettext - gtk3 - socat - ; - dfu = desktop-file-utils; - hicolorIconTheme = hicolor-icon-theme; - smi = shared-mime-info; - }) - ] - ++ lib.optionals withP11Kit [ - # Hardcode p11-kit path used by Flatpak itself. - # If disabled, will have to be on PATH. - (replaceVars ./fix-paths.patch { - p11kit = lib.getExe p11-kit; - }) - ]; + # The icon validator needs to access the gdk-pixbuf loaders in the Nix store + # and cannot bind FHS paths since those are not available on NixOS. + finalAttrs.passthru.icon-validator-patch + ] + ++ lib.optionals finalAttrs.doCheck [ + # Hardcode paths used by tests and change test runtime generation to use files from Nix store. + # https://github.com/flatpak/flatpak/issues/1460 + (replaceVars ./fix-test-paths.patch { + inherit + coreutils + gettext + gtk3 + socat + ; + dfu = desktop-file-utils; + hicolorIconTheme = hicolor-icon-theme; + smi = shared-mime-info; + }) + ] + ++ lib.optionals withP11Kit [ + # Hardcode p11-kit path used by Flatpak itself. + # If disabled, will have to be on PATH. + (replaceVars ./fix-paths.patch { + p11kit = lib.getExe p11-kit; + }) + ]; # Fixup shebangs in some scripts # @@ -159,53 +157,51 @@ stdenv.mkDerivation (finalAttrs: { depsBuildBuild = [ pkg-config ]; - nativeBuildInputs = - [ - (python3.pythonOnBuildForHost.withPackages (p: [ p.pyparsing ])) - bison - glib - meson - ninja - pkg-config - validatePkgConfig - wayland-scanner - wrapGAppsNoGuiHook - ] - ++ lib.optional withGtkDoc gtk-doc - ++ lib.optional withIntrospection gobject-introspection - ++ lib.optional withMan libxslt - ++ lib.optional withSELinuxModule bzip2 - ++ lib.optionals withDocbookDocs [ - docbook-xsl-nons - docbook_xml_dtd_45 - xmlto - ]; + nativeBuildInputs = [ + (python3.pythonOnBuildForHost.withPackages (p: [ p.pyparsing ])) + bison + glib + meson + ninja + pkg-config + validatePkgConfig + wayland-scanner + wrapGAppsNoGuiHook + ] + ++ lib.optional withGtkDoc gtk-doc + ++ lib.optional withIntrospection gobject-introspection + ++ lib.optional withMan libxslt + ++ lib.optional withSELinuxModule bzip2 + ++ lib.optionals withDocbookDocs [ + docbook-xsl-nons + docbook_xml_dtd_45 + xmlto + ]; - buildInputs = - [ - appstream - curl - fuse3 - gdk-pixbuf - gpgme - gsettings-desktop-schemas - json-glib - libarchive - libcap - librsvg # for flatpak-validate-icon - libseccomp - libxml2 - python3 - wayland - wayland-protocols - xorg.libXau - zstd - ] - ++ lib.optional withDconf dconf - ++ lib.optional withGlibNetworking glib-networking - ++ lib.optional withMalcontent malcontent - ++ lib.optional withPolkit polkit - ++ lib.optional withSystemd systemd; + buildInputs = [ + appstream + curl + fuse3 + gdk-pixbuf + gpgme + gsettings-desktop-schemas + json-glib + libarchive + libcap + librsvg # for flatpak-validate-icon + libseccomp + libxml2 + python3 + wayland + wayland-protocols + xorg.libXau + zstd + ] + ++ lib.optional withDconf dconf + ++ lib.optional withGlibNetworking glib-networking + ++ lib.optional withMalcontent malcontent + ++ lib.optional withPolkit polkit + ++ lib.optional withSystemd systemd; # Required by flatpak.pc propagatedBuildInputs = [ diff --git a/pkgs/by-name/fl/flatter/package.nix b/pkgs/by-name/fl/flatter/package.nix index 8af87f3f2809..d1e69a658fe0 100644 --- a/pkgs/by-name/fl/flatter/package.nix +++ b/pkgs/by-name/fl/flatter/package.nix @@ -29,17 +29,16 @@ stdenv.mkDerivation { cmake ]; - buildInputs = - [ - blas - gmp - mpfr - fplll - eigen - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages.openmp - ]; + buildInputs = [ + blas + gmp + mpfr + fplll + eigen + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp + ]; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/by-name/fl/flet-client-flutter/package.nix b/pkgs/by-name/fl/flet-client-flutter/package.nix index d3668ce55c0d..cf2bbab86e8a 100644 --- a/pkgs/by-name/fl/flet-client-flutter/package.nix +++ b/pkgs/by-name/fl/flet-client-flutter/package.nix @@ -47,19 +47,18 @@ flutter329.buildFlutterApplication rec { pkg-config ]; - buildInputs = - [ - mpv-unwrapped - gst_all_1.gst-libav - gst_all_1.gst-plugins-base - gst_all_1.gst-vaapi - gst_all_1.gstreamer - libunwind - orc - mimalloc - ] - ++ mpv-unwrapped.buildInputs - ++ libplacebo.buildInputs; + buildInputs = [ + mpv-unwrapped + gst_all_1.gst-libav + gst_all_1.gst-plugins-base + gst_all_1.gst-vaapi + gst_all_1.gstreamer + libunwind + orc + mimalloc + ] + ++ mpv-unwrapped.buildInputs + ++ libplacebo.buildInputs; passthru = { updateScript = _experimental-update-script-combinators.sequence [ diff --git a/pkgs/by-name/fl/flips/package.nix b/pkgs/by-name/fl/flips/package.nix index c7a629ca7a42..f67902b8d945 100644 --- a/pkgs/by-name/fl/flips/package.nix +++ b/pkgs/by-name/fl/flips/package.nix @@ -24,14 +24,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config - ] ++ lib.optional withGTK3 wrapGAppsHook3; + ] + ++ lib.optional withGTK3 wrapGAppsHook3; - buildInputs = - [ - libdivsufsort - ] - ++ lib.optional withGTK3 gtk3 - ++ lib.optional (withGTK3 && stdenv.hostPlatform.isDarwin) llvmPackages.openmp; + buildInputs = [ + libdivsufsort + ] + ++ lib.optional withGTK3 gtk3 + ++ lib.optional (withGTK3 && stdenv.hostPlatform.isDarwin) llvmPackages.openmp; patches = [ ./use-system-libdivsufsort.patch ]; diff --git a/pkgs/by-name/fl/flite/package.nix b/pkgs/by-name/fl/flite/package.nix index 641697bf286a..9c3b7078489a 100644 --- a/pkgs/by-name/fl/flite/package.nix +++ b/pkgs/by-name/fl/flite/package.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--enable-shared" - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "--with-audio=${audioBackend}" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "--with-audio=${audioBackend}" ]; # main/Makefile creates and removes 'flite_voice_list.c' from multiple targets: # make[1]: *** No rule to make target 'flite_voice_list.c', needed by 'all'. Stop diff --git a/pkgs/by-name/fl/flowtime/package.nix b/pkgs/by-name/fl/flowtime/package.nix index 534c57904241..c33c3a21c9b8 100644 --- a/pkgs/by-name/fl/flowtime/package.nix +++ b/pkgs/by-name/fl/flowtime/package.nix @@ -38,16 +38,15 @@ stdenv.mkDerivation rec { appstream-glib ]; - buildInputs = - [ - libadwaita - libxml2 - libportal-gtk4 - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - ]); + buildInputs = [ + libadwaita + libxml2 + libportal-gtk4 + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + ]); meta = with lib; { description = "Get what motivates you done, without losing concentration"; diff --git a/pkgs/by-name/fl/fluent-bit/package.nix b/pkgs/by-name/fl/fluent-bit/package.nix index 829d03a6f055..c4d3ff6f5f2e 100644 --- a/pkgs/by-name/fl/fluent-bit/package.nix +++ b/pkgs/by-name/fl/fluent-bit/package.nix @@ -60,37 +60,35 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - arrow-glib - c-ares - jemalloc - libbacktrace - libpq - libyaml - luajit - msgpack-c - nghttp2.dev - openssl - rdkafka - sqlite.dev - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # libbpf doesn't build for Darwin yet. - libbpf - systemd - ]; + buildInputs = [ + arrow-glib + c-ares + jemalloc + libbacktrace + libpq + libyaml + luajit + msgpack-c + nghttp2.dev + openssl + rdkafka + sqlite.dev + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # libbpf doesn't build for Darwin yet. + libbpf + systemd + ]; - cmakeFlags = - [ - (lib.cmakeBool "FLB_RELEASE" true) - (lib.cmakeBool "FLB_PREFER_SYSTEM_LIBS" true) - ] - ++ lib.optionals stdenv.cc.isClang [ - # `FLB_SECURITY` causes bad linker options for Clang to be set. - (lib.cmakeBool "FLB_SECURITY" false) - ]; + cmakeFlags = [ + (lib.cmakeBool "FLB_RELEASE" true) + (lib.cmakeBool "FLB_PREFER_SYSTEM_LIBS" true) + ] + ++ lib.optionals stdenv.cc.isClang [ + # `FLB_SECURITY` causes bad linker options for Clang to be set. + (lib.cmakeBool "FLB_SECURITY" false) + ]; # `src/CMakeLists.txt` installs fluent-bit's systemd unit files at the path in the `SYSTEMD_UNITDIR` CMake variable. # diff --git a/pkgs/by-name/fl/fluffychat/package.nix b/pkgs/by-name/fl/fluffychat/package.nix index f0b293728bd8..06ecd9a28373 100644 --- a/pkgs/by-name/fl/fluffychat/package.nix +++ b/pkgs/by-name/fl/fluffychat/package.nix @@ -44,21 +44,20 @@ flutter332.buildFlutterApplication ( inherit targetFlutterPlatform; - meta = - { - description = "Chat with your friends (matrix client)"; - homepage = "https://fluffychat.im/"; - license = lib.licenses.agpl3Plus; - maintainers = with lib.maintainers; [ - mkg20001 - tebriel - aleksana - ]; - badPlatforms = lib.platforms.darwin; - } - // lib.optionalAttrs (targetFlutterPlatform == "linux") { - mainProgram = "fluffychat"; - }; + meta = { + description = "Chat with your friends (matrix client)"; + homepage = "https://fluffychat.im/"; + license = lib.licenses.agpl3Plus; + maintainers = with lib.maintainers; [ + mkg20001 + tebriel + aleksana + ]; + badPlatforms = lib.platforms.darwin; + } + // lib.optionalAttrs (targetFlutterPlatform == "linux") { + mainProgram = "fluffychat"; + }; } // lib.optionalAttrs (targetFlutterPlatform == "linux") { nativeBuildInputs = [ diff --git a/pkgs/by-name/fl/fluidsynth/package.nix b/pkgs/by-name/fl/fluidsynth/package.nix index 18ae634968d9..1c0b3bcbca12 100644 --- a/pkgs/by-name/fl/fluidsynth/package.nix +++ b/pkgs/by-name/fl/fluidsynth/package.nix @@ -35,16 +35,15 @@ stdenv.mkDerivation (finalAttrs: { cmake ]; - buildInputs = - [ - glib - libsndfile - libjack2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libpulseaudio - ]; + buildInputs = [ + glib + libsndfile + libjack2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libpulseaudio + ]; cmakeFlags = [ "-Denable-framework=off" diff --git a/pkgs/by-name/fl/flutter_rust_bridge_codegen/package.nix b/pkgs/by-name/fl/flutter_rust_bridge_codegen/package.nix index 5106012acd4d..f13cd4f6dad1 100644 --- a/pkgs/by-name/fl/flutter_rust_bridge_codegen/package.nix +++ b/pkgs/by-name/fl/flutter_rust_bridge_codegen/package.nix @@ -27,17 +27,16 @@ rustPlatform.buildRustPackage rec { # needed to run text (see https://github.com/fzyzcjy/flutter_rust_bridge/blob/ae970bfafdf80b9eb283a2167b972fb2e6504511/frb_codegen/src/library/utils/logs.rs#L43) logLevel = "debug"; - checkFlags = - [ - # Disabled because these tests need a different version of anyhow than the package itself - "--skip=tests::test_execute_generate_on_frb_example_dart_minimal" - "--skip=tests::test_execute_generate_on_frb_example_pure_dart" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Timeout on darwin, not related to networking in sandbox - "--skip=library::codegen::controller::tests::test_run_with_watch" - "--skip=library::codegen::generator::api_dart::tests::test_functions" - ]; + checkFlags = [ + # Disabled because these tests need a different version of anyhow than the package itself + "--skip=tests::test_execute_generate_on_frb_example_dart_minimal" + "--skip=tests::test_execute_generate_on_frb_example_pure_dart" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Timeout on darwin, not related to networking in sandbox + "--skip=library::codegen::controller::tests::test_run_with_watch" + "--skip=library::codegen::generator::api_dart::tests::test_functions" + ]; meta = { mainProgram = "flutter_rust_bridge_codegen"; diff --git a/pkgs/by-name/fl/fluxcd-operator-mcp/package.nix b/pkgs/by-name/fl/fluxcd-operator-mcp/package.nix index 8c4f7805acc3..6b4c08df6737 100644 --- a/pkgs/by-name/fl/fluxcd-operator-mcp/package.nix +++ b/pkgs/by-name/fl/fluxcd-operator-mcp/package.nix @@ -37,16 +37,15 @@ buildGoModule (finalAttrs: { env.CGO_ENABLED = 0; - postInstall = - '' - mv $out/bin/mcp $out/bin/flux-operator-mcp - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - for shell in bash fish zsh; do - installShellCompletion --cmd flux-operator-mcp \ - --$shell <($out/bin/flux-operator-mcp completion $shell) - done - ''; + postInstall = '' + mv $out/bin/mcp $out/bin/flux-operator-mcp + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for shell in bash fish zsh; do + installShellCompletion --cmd flux-operator-mcp \ + --$shell <($out/bin/flux-operator-mcp completion $shell) + done + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/fm/fmit/package.nix b/pkgs/by-name/fm/fmit/package.nix index 16fca47c5506..327732c18860 100644 --- a/pkgs/by-name/fm/fmit/package.nix +++ b/pkgs/by-name/fm/fmit/package.nix @@ -33,33 +33,31 @@ stdenv.mkDerivation (finalAttrs: { itstool libsForQt5.wrapQtAppsHook ]; - buildInputs = - [ - fftw - libsForQt5.qtbase - libsForQt5.qtmultimedia - ] - ++ lib.optionals alsaSupport [ alsa-lib ] - ++ lib.optionals jackSupport [ libjack2 ] - ++ lib.optionals portaudioSupport [ portaudio ]; + buildInputs = [ + fftw + libsForQt5.qtbase + libsForQt5.qtmultimedia + ] + ++ lib.optionals alsaSupport [ alsa-lib ] + ++ lib.optionals jackSupport [ libjack2 ] + ++ lib.optionals portaudioSupport [ portaudio ]; postPatch = '' substituteInPlace fmit.pro --replace '$$FMITVERSIONGITPRO' '${finalAttrs.version}' ''; - qmakeFlags = - [ - "PREFIXSHORTCUT=${placeholder "out"}" - ] - ++ lib.optionals alsaSupport [ - "CONFIG+=acs_alsa" - ] - ++ lib.optionals jackSupport [ - "CONFIG+=acs_jack" - ] - ++ lib.optionals portaudioSupport [ - "CONFIG+=acs_portaudio" - ]; + qmakeFlags = [ + "PREFIXSHORTCUT=${placeholder "out"}" + ] + ++ lib.optionals alsaSupport [ + "CONFIG+=acs_alsa" + ] + ++ lib.optionals jackSupport [ + "CONFIG+=acs_jack" + ] + ++ lib.optionals portaudioSupport [ + "CONFIG+=acs_portaudio" + ]; meta = { description = "Free Musical Instrument Tuner"; diff --git a/pkgs/by-name/fo/folks/package.nix b/pkgs/by-name/fo/folks/package.nix index 1e62fa5100c1..3ccadbae1430 100644 --- a/pkgs/by-name/fo/folks/package.nix +++ b/pkgs/by-name/fo/folks/package.nix @@ -41,31 +41,29 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-IxGzc1XDUfM/Fj/cOUh0oioKBoLDGUk9bYpuQgcRQV8="; }; - nativeBuildInputs = - [ - gettext - gobject-introspection - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - meson - ninja - pkg-config - vala - ] - ++ lib.optionals telepathySupport [ - python3 - ]; + nativeBuildInputs = [ + gettext + gobject-introspection + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 + meson + ninja + pkg-config + vala + ] + ++ lib.optionals telepathySupport [ + python3 + ]; - buildInputs = - [ - dbus-glib - evolution-data-server-gtk4 # UI part not needed, using gtk4 version to reduce system closure. - readline - ] - ++ lib.optionals telepathySupport [ - telepathy-glib - ]; + buildInputs = [ + dbus-glib + evolution-data-server-gtk4 # UI part not needed, using gtk4 version to reduce system closure. + readline + ] + ++ lib.optionals telepathySupport [ + telepathy-glib + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/by-name/fo/folly/package.nix b/pkgs/by-name/fo/folly/package.nix index 33f945777718..0d6ab08f0dbd 100644 --- a/pkgs/by-name/fo/folly/package.nix +++ b/pkgs/by-name/fo/folly/package.nix @@ -79,16 +79,15 @@ stdenv.mkDerivation (finalAttrs: { libunwind ]; - propagatedBuildInputs = - [ - # `folly-config.cmake` pulls these in. - boost - fmt_11 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # jemalloc headers are required in include/folly/portability/Malloc.h - jemalloc - ]; + propagatedBuildInputs = [ + # `folly-config.cmake` pulls these in. + boost + fmt_11 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # jemalloc headers are required in include/folly/portability/Malloc.h + jemalloc + ]; checkInputs = [ gtest diff --git a/pkgs/by-name/fo/font-manager/package.nix b/pkgs/by-name/fo/font-manager/package.nix index c74d5b86e39f..3a9dd2606da8 100644 --- a/pkgs/by-name/fo/font-manager/package.nix +++ b/pkgs/by-name/fo/font-manager/package.nix @@ -64,21 +64,20 @@ stdenv.mkDerivation (finalAttrs: { gobject-introspection ]; - buildInputs = - [ - libxml2 - json-glib - sqlite - gsettings-desktop-schemas # for font settings - gtk4 - adwaita-icon-theme - libarchive - ] - ++ lib.optionals withWebkit [ - glib-networking # for SSL so that Google Fonts can load - libsoup_3 - webkitgtk_6_0 - ]; + buildInputs = [ + libxml2 + json-glib + sqlite + gsettings-desktop-schemas # for font settings + gtk4 + adwaita-icon-theme + libarchive + ] + ++ lib.optionals withWebkit [ + glib-networking # for SSL so that Google Fonts can load + libsoup_3 + webkitgtk_6_0 + ]; mesonFlags = [ "-Dreproducible=true" # Do not hardcode build directory… diff --git a/pkgs/by-name/fo/fontforge/package.nix b/pkgs/by-name/fo/fontforge/package.nix index 86d50584db48..4145a509a2f0 100644 --- a/pkgs/by-name/fo/fontforge/package.nix +++ b/pkgs/by-name/fo/fontforge/package.nix @@ -96,37 +96,37 @@ stdenv.mkDerivation rec { cmake ]; - buildInputs = - [ - readline - uthash - woff2 - zeromq - py - freetype - zlib - glib - giflib - libpng - libjpeg - libtiff - libxml2 - ] - ++ lib.optionals withPython [ py ] - ++ lib.optionals withSpiro [ libspiro ] - ++ lib.optionals withGUI [ - gtk3 - cairo - pango - ]; + buildInputs = [ + readline + uthash + woff2 + zeromq + py + freetype + zlib + glib + giflib + libpng + libjpeg + libtiff + libxml2 + ] + ++ lib.optionals withPython [ py ] + ++ lib.optionals withSpiro [ libspiro ] + ++ lib.optionals withGUI [ + gtk3 + cairo + pango + ]; - cmakeFlags = - [ "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ] - ++ lib.optional (!withSpiro) "-DENABLE_LIBSPIRO=OFF" - ++ lib.optional (!withGUI) "-DENABLE_GUI=OFF" - ++ lib.optional (!withGTK) "-DENABLE_X11=ON" - ++ lib.optional (!withPython) "-DENABLE_PYTHON_SCRIPTING=OFF" - ++ lib.optional withExtras "-DENABLE_FONTFORGE_EXTRAS=ON"; + cmakeFlags = [ + "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" + ] + ++ lib.optional (!withSpiro) "-DENABLE_LIBSPIRO=OFF" + ++ lib.optional (!withGUI) "-DENABLE_GUI=OFF" + ++ lib.optional (!withGTK) "-DENABLE_X11=ON" + ++ lib.optional (!withPython) "-DENABLE_PYTHON_SCRIPTING=OFF" + ++ lib.optional withExtras "-DENABLE_FONTFORGE_EXTRAS=ON"; preConfigure = '' # The way $version propagates to $version of .pe-scripts (https://github.com/dejavu-fonts/dejavu-fonts/blob/358190f/scripts/generate.pe#L19) diff --git a/pkgs/by-name/fo/foomatic-db-engine/package.nix b/pkgs/by-name/fo/foomatic-db-engine/package.nix index 32ceaf6bf8fb..59f70a550469 100644 --- a/pkgs/by-name/fo/foomatic-db-engine/package.nix +++ b/pkgs/by-name/fo/foomatic-db-engine/package.nix @@ -37,21 +37,22 @@ perlPackages.buildPerlPackage rec { perlPackages.XMLLibXML ]; - buildInputs = - [ curl ] - # provide some "cups-*" commands to `foomatic-{configure,printjob}` - # so that they can manage a local cups server (add queues, add jobs...) - ++ lib.optionals withCupsAccess [ - cups - cups-filters - ] - # the commands `foomatic-{configure,getpjloptions}` need - # netcat if they are used to query or alter a network - # printer via AppSocket/HP JetDirect protocol - ++ lib.optional withSocketAccess netcat-gnu - # `foomatic-configure` can be used to access printers that are - # shared via the SMB protocol, but it needs the `smbclient` binary - ++ lib.optional withSMBAccess samba; + buildInputs = [ + curl + ] + # provide some "cups-*" commands to `foomatic-{configure,printjob}` + # so that they can manage a local cups server (add queues, add jobs...) + ++ lib.optionals withCupsAccess [ + cups + cups-filters + ] + # the commands `foomatic-{configure,getpjloptions}` need + # netcat if they are used to query or alter a network + # printer via AppSocket/HP JetDirect protocol + ++ lib.optional withSocketAccess netcat-gnu + # `foomatic-configure` can be used to access printers that are + # shared via the SMB protocol, but it needs the `smbclient` binary + ++ lib.optional withSMBAccess samba; nativeBuildInputs = [ autoconf diff --git a/pkgs/by-name/fo/foot/package.nix b/pkgs/by-name/fo/foot/package.nix index a1a8054227e2..3655b5f10494 100644 --- a/pkgs/by-name/fo/foot/package.nix +++ b/pkgs/by-name/fo/foot/package.nix @@ -113,18 +113,17 @@ stdenv.mkDerivation { pkg-config ]; - nativeBuildInputs = - [ - wayland-scanner - meson - ninja - ncurses - scdoc - pkg-config - ] - ++ lib.optionals (compilerName == "clang") [ - stdenv.cc.cc.libllvm.out - ]; + nativeBuildInputs = [ + wayland-scanner + meson + ninja + ncurses + scdoc + pkg-config + ] + ++ lib.optionals (compilerName == "clang") [ + stdenv.cc.cc.libllvm.out + ]; buildInputs = [ tllist diff --git a/pkgs/by-name/fo/footage/package.nix b/pkgs/by-name/fo/footage/package.nix index c0b1fab98b1a..cf8ef95163e7 100644 --- a/pkgs/by-name/fo/footage/package.nix +++ b/pkgs/by-name/fo/footage/package.nix @@ -59,30 +59,29 @@ stdenv.mkDerivation rec { wrapGAppsHook4 ]; - buildInputs = - [ - glib - gtk4 - libadwaita - a52dec - fdk_aac - ffmpeg - x264 - x265 - vo-aacenc - svt-av1 - libmpeg2 - ] - ++ (with gst_all_1; [ - gst-plugins-base - gst-plugins-good - gst-plugins-rs - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gstreamer - gst-editing-services - ]); + buildInputs = [ + glib + gtk4 + libadwaita + a52dec + fdk_aac + ffmpeg + x264 + x265 + vo-aacenc + svt-av1 + libmpeg2 + ] + ++ (with gst_all_1; [ + gst-plugins-base + gst-plugins-good + gst-plugins-rs + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gstreamer + gst-editing-services + ]); preFixup = '' gappsWrapperArgs+=( diff --git a/pkgs/by-name/fo/fortune-kind/package.nix b/pkgs/by-name/fo/fortune-kind/package.nix index 87bf5a8b006e..8477aaf0139d 100644 --- a/pkgs/by-name/fo/fortune-kind/package.nix +++ b/pkgs/by-name/fo/fortune-kind/package.nix @@ -49,14 +49,13 @@ rustPlatform.buildRustPackage rec { cp -r $src/fortunes $out/fortunes; ''; - postInstall = - '' - wrapProgram $out/bin/fortune-kind \ - --set-default FORTUNE_DIR "$out/fortunes" - '' - + lib.optionalString fortuneAlias '' - ln -s fortune-kind $out/bin/fortune - ''; + postInstall = '' + wrapProgram $out/bin/fortune-kind \ + --set-default FORTUNE_DIR "$out/fortunes" + '' + + lib.optionalString fortuneAlias '' + ln -s fortune-kind $out/bin/fortune + ''; meta = { description = "Kinder, curated fortune, written in rust"; diff --git a/pkgs/by-name/fo/fortune/package.nix b/pkgs/by-name/fo/fortune/package.nix index 33e607f389a7..ab889f64e5b3 100644 --- a/pkgs/by-name/fo/fortune/package.nix +++ b/pkgs/by-name/fo/fortune/package.nix @@ -21,22 +21,22 @@ stdenv.mkDerivation rec { sha256 = "sha256-Hzh4dyVOleq2H5NyV7QmCfKbmU7wVxUxZVu/w6KsdKw="; }; - nativeBuildInputs = - [ - cmake - perl - rinutils - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - # "strfile" must be in PATH for cross-compiling builds. - fortune - ]; + nativeBuildInputs = [ + cmake + perl + rinutils + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # "strfile" must be in PATH for cross-compiling builds. + fortune + ]; buildInputs = [ recode ]; cmakeFlags = [ "-DLOCALDIR=${placeholder "out"}/share/fortunes" - ] ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true"; + ] + ++ lib.optional (!withOffensive) "-DNO_OFFENSIVE=true"; patches = [ (builtins.toFile "not-a-game.patch" '' diff --git a/pkgs/by-name/fo/foundry/package.nix b/pkgs/by-name/fo/foundry/package.nix index d06d45b5efe1..c2870a58c875 100644 --- a/pkgs/by-name/fo/foundry/package.nix +++ b/pkgs/by-name/fo/foundry/package.nix @@ -27,7 +27,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; buildInputs = [ solc ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libusb1 ]; diff --git a/pkgs/by-name/fo/foxotron/package.nix b/pkgs/by-name/fo/foxotron/package.nix index fd541500c049..503ce17f68e6 100644 --- a/pkgs/by-name/fo/foxotron/package.nix +++ b/pkgs/by-name/fo/foxotron/package.nix @@ -57,19 +57,20 @@ stdenv.mkDerivation rec { makeWrapper ]; - buildInputs = - [ zlib ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXrandr - libXinerama - libXcursor - libXi - libXext - alsa-lib - fontconfig - libGLU - ]; + buildInputs = [ + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXrandr + libXinerama + libXcursor + libXi + libXext + alsa-lib + fontconfig + libGLU + ]; env.NIX_CFLAGS_COMPILE = toString [ # Needed with GCC 12 diff --git a/pkgs/by-name/fp/fprintd-tod/package.nix b/pkgs/by-name/fp/fprintd-tod/package.nix index bb34e1b88de2..161f94bfd38c 100644 --- a/pkgs/by-name/fp/fprintd-tod/package.nix +++ b/pkgs/by-name/fp/fprintd-tod/package.nix @@ -60,13 +60,11 @@ }) ]; - postPatch = - previousAttrs.postPatch or "" - + '' - # part of "remove-pointless-copying-of-files-into-build-directory" but git-apply doesn't handle renaming - mv src/device.xml src/net.reactivated.Fprint.Device.xml - mv src/manager.xml src/net.reactivated.Fprint.Manager.xml - ''; + postPatch = previousAttrs.postPatch or "" + '' + # part of "remove-pointless-copying-of-files-into-build-directory" but git-apply doesn't handle renaming + mv src/device.xml src/net.reactivated.Fprint.Device.xml + mv src/manager.xml src/net.reactivated.Fprint.Manager.xml + ''; meta = { homepage = "https://fprint.freedesktop.org/"; diff --git a/pkgs/by-name/fr/fractal/package.nix b/pkgs/by-name/fr/fractal/package.nix index 8b8fc47635d4..7c9121570d42 100644 --- a/pkgs/by-name/fr/fractal/package.nix +++ b/pkgs/by-name/fr/fractal/package.nix @@ -75,27 +75,26 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook4 ]; - buildInputs = - [ - glib - gtk4 - gtksourceview5 - lcms2 - libadwaita - openssl - pipewire - libshumate - sqlite - xdg-desktop-portal - libseccomp - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-bad - gst-plugins-good - gst-plugins-rs - ]); + buildInputs = [ + glib + gtk4 + gtksourceview5 + lcms2 + libadwaita + openssl + pipewire + libshumate + sqlite + xdg-desktop-portal + libseccomp + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-bad + gst-plugins-good + gst-plugins-rs + ]); preFixup = '' gappsWrapperArgs+=( diff --git a/pkgs/by-name/fr/framac/package.nix b/pkgs/by-name/fr/framac/package.nix index e26047b7aaf4..b3ef7520555c 100644 --- a/pkgs/by-name/fr/framac/package.nix +++ b/pkgs/by-name/fr/framac/package.nix @@ -62,14 +62,15 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ wrapGAppsHook3 ] - ++ (with ocamlPackages; [ - ocaml - findlib - dune_3 - menhir - ]); + nativeBuildInputs = [ + wrapGAppsHook3 + ] + ++ (with ocamlPackages; [ + ocaml + findlib + dune_3 + menhir + ]); buildInputs = with ocamlPackages; [ dune-site diff --git a/pkgs/by-name/fr/frame/package.nix b/pkgs/by-name/fr/frame/package.nix index e7c06a2d34e5..b3fa616561ae 100644 --- a/pkgs/by-name/fr/frame/package.nix +++ b/pkgs/by-name/fr/frame/package.nix @@ -16,16 +16,15 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - stdenv - ] - ++ lib.optionals enableX11 [ - xorg.xorgserver - xorg.libX11 - xorg.libXext - xorg.libXi - ]; + buildInputs = [ + stdenv + ] + ++ lib.optionals enableX11 [ + xorg.xorgserver + xorg.libX11 + xorg.libXext + xorg.libXi + ]; configureFlags = lib.optional enableX11 "--with-x11"; diff --git a/pkgs/by-name/fr/frankenphp/package.nix b/pkgs/by-name/fr/frankenphp/package.nix index 3fd73b786855..6ca75b2e12af 100644 --- a/pkgs/by-name/fr/frankenphp/package.nix +++ b/pkgs/by-name/fr/frankenphp/package.nix @@ -51,14 +51,16 @@ buildGoModule rec { phpUnwrapped brotli watcher - ] ++ phpUnwrapped.buildInputs; - nativeBuildInputs = - [ makeBinaryWrapper ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - pkg-config - cctools - darwin.autoSignDarwinBinariesHook - ]; + ] + ++ phpUnwrapped.buildInputs; + nativeBuildInputs = [ + makeBinaryWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + pkg-config + cctools + darwin.autoSignDarwinBinariesHook + ]; subPackages = [ "frankenphp" ]; @@ -77,20 +79,20 @@ buildGoModule rec { "-w" "-X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ${version} PHP ${phpUnwrapped.version} Caddy'" # pie mode is only available with pkgsMusl, it also automatically add -buildmode=pie to $GOFLAGS - ] ++ (lib.optional pieBuild [ "-static-pie" ]); + ] + ++ (lib.optional pieBuild [ "-static-pie" ]); - preBuild = - '' - export CGO_CFLAGS="$(${phpConfig} --includes)" - export CGO_LDFLAGS="-DFRANKENPHP_VERSION=${version} \ - $(${phpConfig} --ldflags) \ - $(${phpConfig} --libs)" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # replace hard-code homebrew path - substituteInPlace ../frankenphp.go \ - --replace "-L/opt/homebrew/opt/libiconv/lib" "-L${libiconv}/lib" - ''; + preBuild = '' + export CGO_CFLAGS="$(${phpConfig} --includes)" + export CGO_LDFLAGS="-DFRANKENPHP_VERSION=${version} \ + $(${phpConfig} --ldflags) \ + $(${phpConfig} --libs)" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # replace hard-code homebrew path + substituteInPlace ../frankenphp.go \ + --replace "-L/opt/homebrew/opt/libiconv/lib" "-L${libiconv}/lib" + ''; preFixup = '' mkdir -p $out/lib diff --git a/pkgs/by-name/fr/freecad/package.nix b/pkgs/by-name/fr/freecad/package.nix index 65ba69585468..30f485de8179 100644 --- a/pkgs/by-name/fr/freecad/package.nix +++ b/pkgs/by-name/fr/freecad/package.nix @@ -78,31 +78,30 @@ freecad-utils.makeCustomizable ( qt6.wrapQtAppsHook ]; - buildInputs = - [ - coin3d - eigen - fmt - gts - hdf5 - libGLU - libXmu - medfile - mpi - ode - vtk - xercesc - yaml-cpp - zlib - opencascade-occt - qt6.qtbase - qt6.qtsvg - qt6.qttools - qt6.qtwayland - qt6.qtwebengine - ] - ++ pythonDeps - ++ lib.optionals spaceNavSupport [ libspnav ]; + buildInputs = [ + coin3d + eigen + fmt + gts + hdf5 + libGLU + libXmu + medfile + mpi + ode + vtk + xercesc + yaml-cpp + zlib + opencascade-occt + qt6.qtbase + qt6.qtsvg + qt6.qttools + qt6.qtwayland + qt6.qtwebengine + ] + ++ pythonDeps + ++ lib.optionals spaceNavSupport [ libspnav ]; patches = [ ./0001-NIXOS-don-t-ignore-PYTHONPATH.patch diff --git a/pkgs/by-name/fr/freecell-solver/package.nix b/pkgs/by-name/fr/freecell-solver/package.nix index 75b39358afb1..5f9411e2febb 100644 --- a/pkgs/by-name/fr/freecell-solver/package.nix +++ b/pkgs/by-name/fr/freecell-solver/package.nix @@ -37,32 +37,31 @@ stdenv.mkDerivation (finalAttrs: { six ]; - nativeBuildInputs = - [ - cmake - cmocka - gperf - ninja - perl - pkg-config - python3 + nativeBuildInputs = [ + cmake + cmocka + gperf + ninja + perl + pkg-config + python3 + ] + ++ ( + with perl.pkgs; + TaskFreecellSolverTesting.buildInputs + ++ [ + GamesSolitaireVerify + HTMLTemplate + Moo + PathTiny + StringShellQuote + TaskFreecellSolverTesting + TemplateToolkit + TextTemplate ] - ++ ( - with perl.pkgs; - TaskFreecellSolverTesting.buildInputs - ++ [ - GamesSolitaireVerify - HTMLTemplate - Moo - PathTiny - StringShellQuote - TaskFreecellSolverTesting - TemplateToolkit - TextTemplate - ] - ) - ++ [ python3.pkgs.wrapPython ] - ++ finalAttrs.pythonPath; + ) + ++ [ python3.pkgs.wrapPython ] + ++ finalAttrs.pythonPath; buildInputs = [ gmp diff --git a/pkgs/by-name/fr/freedroidrpg/package.nix b/pkgs/by-name/fr/freedroidrpg/package.nix index d6cdcf46ee3f..4388944a309b 100644 --- a/pkgs/by-name/fr/freedroidrpg/package.nix +++ b/pkgs/by-name/fr/freedroidrpg/package.nix @@ -54,7 +54,8 @@ stdenv.mkDerivation { libjpeg libpng zlib - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; env.SDL_CONFIG = lib.getExe' (lib.getDev SDL) "sdl-config"; diff --git a/pkgs/by-name/fr/freedv/package.nix b/pkgs/by-name/fr/freedv/package.nix index 57ba6b6b930e..59e81b9cc729 100644 --- a/pkgs/by-name/fr/freedv/package.nix +++ b/pkgs/by-name/fr/freedv/package.nix @@ -47,74 +47,71 @@ stdenv.mkDerivation (finalAttrs: { ./no-framework.patch ]; - postPatch = - '' - cp -R ${radaeSrc} radae - chmod -R u+w radae - substituteInPlace radae/cmake/BuildOpus.cmake \ - --replace-fail "https://gitlab.xiph.org/xiph/opus/-/archive/main/opus-main.tar.gz" "${libopus.src}" \ - --replace-fail "./autogen.sh && " "" - substituteInPlace cmake/BuildRADE.cmake \ - --replace-fail "GIT_REPOSITORY https://github.com/drowe67/radae.git" "URL $(realpath radae)" \ - --replace-fail "GIT_TAG main" "" - patchShebangs test/test_*.sh - substituteInPlace cmake/CheckGit.cmake \ - --replace-fail "git describe --abbrev=4 --always HEAD" "echo v${finalAttrs.version}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace CMakeLists.txt \ - --replace-fail "-Wl,-ld_classic" "" - substituteInPlace src/CMakeLists.txt \ - --replace-fail "\''${CMAKE_SOURCE_DIR}/macdylibbundler/dylibbundler" "dylibbundler" - sed -i "/codesign/d;/hdiutil/d" src/CMakeLists.txt - ''; + postPatch = '' + cp -R ${radaeSrc} radae + chmod -R u+w radae + substituteInPlace radae/cmake/BuildOpus.cmake \ + --replace-fail "https://gitlab.xiph.org/xiph/opus/-/archive/main/opus-main.tar.gz" "${libopus.src}" \ + --replace-fail "./autogen.sh && " "" + substituteInPlace cmake/BuildRADE.cmake \ + --replace-fail "GIT_REPOSITORY https://github.com/drowe67/radae.git" "URL $(realpath radae)" \ + --replace-fail "GIT_TAG main" "" + patchShebangs test/test_*.sh + substituteInPlace cmake/CheckGit.cmake \ + --replace-fail "git describe --abbrev=4 --always HEAD" "echo v${finalAttrs.version}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace CMakeLists.txt \ + --replace-fail "-Wl,-ld_classic" "" + substituteInPlace src/CMakeLists.txt \ + --replace-fail "\''${CMAKE_SOURCE_DIR}/macdylibbundler/dylibbundler" "dylibbundler" + sed -i "/codesign/d;/hdiutil/d" src/CMakeLists.txt + ''; - nativeBuildInputs = - [ - cmake - pkg-config - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (macdylibbundler.overrideAttrs { - # incompatible with darwin.sigtool in Nixpkgs - postPatch = '' - substituteInPlace src/Utils.cpp \ - --replace-fail "--deep --preserve-metadata=entitlements,requirements,flags,runtime" "" - ''; - }) - makeWrapper - darwin.autoSignDarwinBinariesHook - darwin.sigtool - ]; + nativeBuildInputs = [ + cmake + pkg-config + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (macdylibbundler.overrideAttrs { + # incompatible with darwin.sigtool in Nixpkgs + postPatch = '' + substituteInPlace src/Utils.cpp \ + --replace-fail "--deep --preserve-metadata=entitlements,requirements,flags,runtime" "" + ''; + }) + makeWrapper + darwin.autoSignDarwinBinariesHook + darwin.sigtool + ]; - buildInputs = - [ - codec2 - libsamplerate - libsndfile - lpcnet - speexdsp - hamlib_4 - wxGTK32 - sioclient - python3.pkgs.numpy - ] - ++ ( - if stdenv.hostPlatform.isLinux then - [ - libpulseaudio - dbus - ] - else if stdenv.hostPlatform.isDarwin then - [ - apple-sdk_15 - ] - else - [ - portaudio - ] - ); + buildInputs = [ + codec2 + libsamplerate + libsndfile + lpcnet + speexdsp + hamlib_4 + wxGTK32 + sioclient + python3.pkgs.numpy + ] + ++ ( + if stdenv.hostPlatform.isLinux then + [ + libpulseaudio + dbus + ] + else if stdenv.hostPlatform.isDarwin then + [ + apple-sdk_15 + ] + else + [ + portaudio + ] + ); cmakeFlags = [ (lib.cmakeBool "USE_INTERNAL_CODEC2" false) @@ -127,15 +124,14 @@ stdenv.mkDerivation (finalAttrs: { doCheck = false; - postInstall = - '' - install -Dm755 rade_build/src/librade.* -t $out/lib - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - mv $out/bin/FreeDV.app $out/Applications - makeWrapper $out/Applications/FreeDV.app/Contents/MacOS/FreeDV $out/bin/freedv - ''; + postInstall = '' + install -Dm755 rade_build/src/librade.* -t $out/lib + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + mv $out/bin/FreeDV.app $out/Applications + makeWrapper $out/Applications/FreeDV.app/Contents/MacOS/FreeDV $out/bin/freedv + ''; passthru.updateScript = nix-update-script { extraArgs = [ diff --git a/pkgs/by-name/fr/freeimage/package.nix b/pkgs/by-name/fr/freeimage/package.nix index bb8f8bb2ea9c..e0331774258a 100644 --- a/pkgs/by-name/fr/freeimage/package.nix +++ b/pkgs/by-name/fr/freeimage/package.nix @@ -51,27 +51,25 @@ stdenv.mkDerivation (finalAttrs: { ./CVE-2023-47997.patch ]; - postPatch = - '' - # To support cross compilation, use the correct `pkg-config`. - substituteInPlace Makefile.fip \ - --replace "pkg-config" "$PKG_CONFIG" - substituteInPlace Makefile.gnu \ - --replace "pkg-config" "$PKG_CONFIG" - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' - # Upstream Makefile hardcodes i386 and x86_64 architectures only - substituteInPlace Makefile.osx --replace "x86_64" "arm64" - ''; + postPatch = '' + # To support cross compilation, use the correct `pkg-config`. + substituteInPlace Makefile.fip \ + --replace "pkg-config" "$PKG_CONFIG" + substituteInPlace Makefile.gnu \ + --replace "pkg-config" "$PKG_CONFIG" + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + # Upstream Makefile hardcodes i386 and x86_64 architectures only + substituteInPlace Makefile.osx --replace "x86_64" "arm64" + ''; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + fixDarwinDylibNames + ]; buildInputs = [ libtiff @@ -94,14 +92,13 @@ stdenv.mkDerivation (finalAttrs: { INCDIR = "${placeholder "out"}/include"; INSTALLDIR = "${placeholder "out"}/lib"; - preInstall = - '' - mkdir -p $INCDIR $INSTALLDIR - '' - # Workaround for Makefiles.osx not using ?= - + lib.optionalString stdenv.hostPlatform.isDarwin '' - makeFlagsArray+=( "INCDIR=$INCDIR" "INSTALLDIR=$INSTALLDIR" ) - ''; + preInstall = '' + mkdir -p $INCDIR $INSTALLDIR + '' + # Workaround for Makefiles.osx not using ?= + + lib.optionalString stdenv.hostPlatform.isDarwin '' + makeFlagsArray+=( "INCDIR=$INCDIR" "INSTALLDIR=$INSTALLDIR" ) + ''; postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' diff --git a/pkgs/by-name/fr/freeradius/package.nix b/pkgs/by-name/fr/freeradius/package.nix index 17fe983e7c32..bb8e8f792c81 100644 --- a/pkgs/by-name/fr/freeradius/package.nix +++ b/pkgs/by-name/fr/freeradius/package.nix @@ -49,30 +49,30 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ - openssl - talloc - bsd-finger - perl - ] - ++ lib.optional withCap libcap - ++ lib.optional withCollectd collectd - ++ lib.optional withJson json_c - ++ lib.optional withLdap openldap - ++ lib.optional withMemcached libmemcached - ++ lib.optional withMysql libmysqlclient - ++ lib.optional withPostgresql libpq - ++ lib.optional withPcap libpcap - ++ lib.optional withRedis hiredis - ++ lib.optional withRest curl - ++ lib.optional withSqlite sqlite - ++ lib.optional withYubikey libyubikey; + buildInputs = [ + openssl + talloc + bsd-finger + perl + ] + ++ lib.optional withCap libcap + ++ lib.optional withCollectd collectd + ++ lib.optional withJson json_c + ++ lib.optional withLdap openldap + ++ lib.optional withMemcached libmemcached + ++ lib.optional withMysql libmysqlclient + ++ lib.optional withPostgresql libpq + ++ lib.optional withPcap libpcap + ++ lib.optional withRedis hiredis + ++ lib.optional withRest curl + ++ lib.optional withSqlite sqlite + ++ lib.optional withYubikey libyubikey; configureFlags = [ "--sysconfdir=/etc" "--localstatedir=/var" - ] ++ lib.optional (!linkOpenssl) "--with-openssl=no"; + ] + ++ lib.optional (!linkOpenssl) "--with-openssl=no"; postPatch = '' substituteInPlace src/main/checkrad.in \ diff --git a/pkgs/by-name/fr/freerdp/package.nix b/pkgs/by-name/fr/freerdp/package.nix index f8a72d6f8010..e8a60ea8b340 100644 --- a/pkgs/by-name/fr/freerdp/package.nix +++ b/pkgs/by-name/fr/freerdp/package.nix @@ -72,26 +72,25 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-HF4Is3ak2nYD2Fq6HGHwyM5OTBVqYqbB22otOprzfiQ="; }; - postPatch = - '' - # skip NIB file generation on darwin - substituteInPlace "client/Mac/CMakeLists.txt" "client/Mac/cli/CMakeLists.txt" \ - --replace-fail "if(NOT IS_XCODE)" "if(FALSE)" + postPatch = '' + # skip NIB file generation on darwin + substituteInPlace "client/Mac/CMakeLists.txt" "client/Mac/cli/CMakeLists.txt" \ + --replace-fail "if(NOT IS_XCODE)" "if(FALSE)" - substituteInPlace "libfreerdp/freerdp.pc.in" \ - --replace-fail "Requires:" "Requires: @WINPR_PKG_CONFIG_FILENAME@" + substituteInPlace "libfreerdp/freerdp.pc.in" \ + --replace-fail "Requires:" "Requires: @WINPR_PKG_CONFIG_FILENAME@" - substituteInPlace client/SDL/SDL2/dialogs/{sdl_input.cpp,sdl_select.cpp,sdl_widget.cpp,sdl_widget.hpp} \ - --replace-fail "" "" - '' - + lib.optionalString (pcsclite != null) '' - substituteInPlace "winpr/libwinpr/smartcard/smartcard_pcsc.c" \ - --replace-fail "libpcsclite.so" "${lib.getLib pcsclite}/lib/libpcsclite.so" - '' - + lib.optionalString nocaps '' - substituteInPlace "libfreerdp/locale/keyboard_xkbfile.c" \ - --replace-fail "RDP_SCANCODE_CAPSLOCK" "RDP_SCANCODE_LCONTROL" - ''; + substituteInPlace client/SDL/SDL2/dialogs/{sdl_input.cpp,sdl_select.cpp,sdl_widget.cpp,sdl_widget.hpp} \ + --replace-fail "" "" + '' + + lib.optionalString (pcsclite != null) '' + substituteInPlace "winpr/libwinpr/smartcard/smartcard_pcsc.c" \ + --replace-fail "libpcsclite.so" "${lib.getLib pcsclite}/lib/libpcsclite.so" + '' + + lib.optionalString nocaps '' + substituteInPlace "libfreerdp/locale/keyboard_xkbfile.c" \ + --replace-fail "RDP_SCANCODE_CAPSLOCK" "RDP_SCANCODE_LCONTROL" + ''; nativeBuildInputs = [ cmake @@ -102,87 +101,85 @@ stdenv.mkDerivation (finalAttrs: { writableTmpDirAsHomeHook ]; - buildInputs = - [ - cairo - cjson - cups - faad2 - ffmpeg - glib - icu - libX11 - libXcursor - libXdamage - libXdmcp - libXext - libXi - libXinerama - libXrandr - libXrender - libXtst - libXv - libjpeg_turbo - libkrb5 - libopus - libpulseaudio - libunwind - libusb1 - libxkbcommon - libxkbfile - openh264 - openssl - orc - pcre2 - pcsclite - pkcs11helper - SDL2 - SDL2_ttf - SDL2_image - uriparser - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - fuse3 - systemd - wayland - wayland-scanner - ] - ++ lib.optionals withUnfree [ - faac - ]; + buildInputs = [ + cairo + cjson + cups + faad2 + ffmpeg + glib + icu + libX11 + libXcursor + libXdamage + libXdmcp + libXext + libXi + libXinerama + libXrandr + libXrender + libXtst + libXv + libjpeg_turbo + libkrb5 + libopus + libpulseaudio + libunwind + libusb1 + libxkbcommon + libxkbfile + openh264 + openssl + orc + pcre2 + pcsclite + pkcs11helper + SDL2 + SDL2_ttf + SDL2_image + uriparser + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + fuse3 + systemd + wayland + wayland-scanner + ] + ++ lib.optionals withUnfree [ + faac + ]; # https://github.com/FreeRDP/FreeRDP/issues/8526#issuecomment-1357134746 - cmakeFlags = - [ - "-Wno-dev" - (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") - (lib.cmakeFeature "DOCBOOKXSL_DIR" "${docbook-xsl-nons}/xml/xsl/docbook") - ] - ++ lib.mapAttrsToList lib.cmakeBool { - BUILD_TESTING = false; # false is recommended by upstream - WITH_CAIRO = cairo != null; - WITH_CUPS = cups != null; - WITH_FAAC = withUnfree && faac != null; - WITH_FAAD2 = faad2 != null; - WITH_FUSE = stdenv.hostPlatform.isLinux && fuse3 != null; - WITH_JPEG = libjpeg_turbo != null; - WITH_KRB5 = libkrb5 != null; - WITH_OPENH264 = openh264 != null; - WITH_OPUS = libopus != null; - WITH_OSS = false; - WITH_MANPAGES = withManPages; - WITH_PCSC = pcsclite != null; - WITH_PULSE = libpulseaudio != null; - WITH_SERVER = buildServer; - WITH_WEBVIEW = false; # avoid introducing webkit2gtk-4.0 - WITH_VAAPI = false; # false is recommended by upstream - WITH_X11 = true; - } - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - (lib.cmakeBool "SDL_USE_COMPILED_RESOURCES" false) - ]; + cmakeFlags = [ + "-Wno-dev" + (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") + (lib.cmakeFeature "DOCBOOKXSL_DIR" "${docbook-xsl-nons}/xml/xsl/docbook") + ] + ++ lib.mapAttrsToList lib.cmakeBool { + BUILD_TESTING = false; # false is recommended by upstream + WITH_CAIRO = cairo != null; + WITH_CUPS = cups != null; + WITH_FAAC = withUnfree && faac != null; + WITH_FAAD2 = faad2 != null; + WITH_FUSE = stdenv.hostPlatform.isLinux && fuse3 != null; + WITH_JPEG = libjpeg_turbo != null; + WITH_KRB5 = libkrb5 != null; + WITH_OPENH264 = openh264 != null; + WITH_OPUS = libopus != null; + WITH_OSS = false; + WITH_MANPAGES = withManPages; + WITH_PCSC = pcsclite != null; + WITH_PULSE = libpulseaudio != null; + WITH_SERVER = buildServer; + WITH_WEBVIEW = false; # avoid introducing webkit2gtk-4.0 + WITH_VAAPI = false; # false is recommended by upstream + WITH_X11 = true; + } + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + (lib.cmakeBool "SDL_USE_COMPILED_RESOURCES" false) + ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.hostPlatform.isDarwin [ diff --git a/pkgs/by-name/fr/freeswitch/package.nix b/pkgs/by-name/fr/freeswitch/package.nix index 06fa719b7579..04f6be81d886 100644 --- a/pkgs/by-name/fr/freeswitch/package.nix +++ b/pkgs/by-name/fr/freeswitch/package.nix @@ -154,7 +154,8 @@ stdenv.mkDerivation rec { libtiff libuuid libxcrypt - ] ++ lib.unique (lib.concatMap (mod: mod.inputs) enabledModules); + ] + ++ lib.unique (lib.concatMap (mod: mod.inputs) enabledModules); enableParallelBuilding = true; diff --git a/pkgs/by-name/fr/freetalk/package.nix b/pkgs/by-name/fr/freetalk/package.nix index 7c1f9c00c5d4..eb1d8d851ae8 100644 --- a/pkgs/by-name/fr/freetalk/package.nix +++ b/pkgs/by-name/fr/freetalk/package.nix @@ -30,23 +30,22 @@ stdenv.mkDerivation rec { pkg-config texinfo ]; - buildInputs = - [ - guile - glib - loudmouth - gmp - libidn - readline - libtool - libunwind - ncurses - curl - jansson - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - argp-standalone - ]; + buildInputs = [ + guile + glib + loudmouth + gmp + libidn + readline + libtool + libunwind + ncurses + curl + jansson + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + argp-standalone + ]; env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-largp"; diff --git a/pkgs/by-name/fr/freetds/package.nix b/pkgs/by-name/fr/freetds/package.nix index 9a01adc25221..f47243e2fc57 100644 --- a/pkgs/by-name/fr/freetds/package.nix +++ b/pkgs/by-name/fr/freetds/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { buildInputs = [ openssl - ] ++ lib.optional odbcSupport unixODBC; + ] + ++ lib.optional odbcSupport unixODBC; nativeBuildInputs = [ autoreconfHook diff --git a/pkgs/by-name/fr/freetube/package.nix b/pkgs/by-name/fr/freetube/package.nix index d20bbcb9bc10..3daf94c56da4 100644 --- a/pkgs/by-name/fr/freetube/package.nix +++ b/pkgs/by-name/fr/freetube/package.nix @@ -60,28 +60,27 @@ stdenvNoCC.mkDerivation (finalAttrs: { copyDesktopItems ]; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenvNoCC.hostPlatform.isLinux '' - mkdir -p $out/share/freetube - cp -r build/*-unpacked/{locales,resources{,.pak}} -t $out/share/freetube + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenvNoCC.hostPlatform.isLinux '' + mkdir -p $out/share/freetube + cp -r build/*-unpacked/{locales,resources{,.pak}} -t $out/share/freetube - makeWrapper ${lib.getExe electron} $out/bin/freetube \ - --add-flags "$out/share/freetube/resources/app.asar" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" + makeWrapper ${lib.getExe electron} $out/bin/freetube \ + --add-flags "$out/share/freetube/resources/app.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" - install -D _icons/icon.svg $out/share/icons/hicolor/scalable/apps/freetube.svg - '' - + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r build/mac*/FreeTube.app $out/Applications - ln -s "$out/Applications/FreeTube.app/Contents/MacOS/FreeTube" $out/bin/freetube - '' - + '' - runHook postInstall - ''; + install -D _icons/icon.svg $out/share/icons/hicolor/scalable/apps/freetube.svg + '' + + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r build/mac*/FreeTube.app $out/Applications + ln -s "$out/Applications/FreeTube.app/Contents/MacOS/FreeTube" $out/bin/freetube + '' + + '' + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/fr/freetype/package.nix b/pkgs/by-name/fr/freetype/package.nix index a1644a35a3fb..2ffbca5c44f6 100644 --- a/pkgs/by-name/fr/freetype/package.nix +++ b/pkgs/by-name/fr/freetype/package.nix @@ -58,19 +58,19 @@ stdenv.mkDerivation (finalAttrs: { ]; # needed when linking against freetype # dependence on harfbuzz is looser than the reverse dependence - nativeBuildInputs = - [ - pkg-config - which - __flattenIncludeHackHook - ] - ++ lib.optional (!stdenv.hostPlatform.isWindows) makeWrapper - # FreeType requires GNU Make, which is not part of stdenv on FreeBSD. - ++ lib.optional (!stdenv.hostPlatform.isLinux) gnumake; + nativeBuildInputs = [ + pkg-config + which + __flattenIncludeHackHook + ] + ++ lib.optional (!stdenv.hostPlatform.isWindows) makeWrapper + # FreeType requires GNU Make, which is not part of stdenv on FreeBSD. + ++ lib.optional (!stdenv.hostPlatform.isLinux) gnumake; patches = [ ./enable-table-validation.patch - ] ++ lib.optional useEncumberedCode ./enable-subpixel-rendering.patch; + ] + ++ lib.optional useEncumberedCode ./enable-subpixel-rendering.patch; outputs = [ "out" @@ -96,16 +96,15 @@ stdenv.mkDerivation (finalAttrs: { # pkgsCross.mingwW64.pkg-config doesn't build # makeWrapper doesn't cross-compile to windows #120726 - postInstall = - '' - substituteInPlace $dev/bin/freetype-config \ - --replace ${buildPackages.pkg-config} ${pkgsHostHost.pkg-config} - '' - + lib.optionalString (!stdenv.hostPlatform.isMinGW) '' + postInstall = '' + substituteInPlace $dev/bin/freetype-config \ + --replace ${buildPackages.pkg-config} ${pkgsHostHost.pkg-config} + '' + + lib.optionalString (!stdenv.hostPlatform.isMinGW) '' - wrapProgram "$dev/bin/freetype-config" \ - --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig" - ''; + wrapProgram "$dev/bin/freetype-config" \ + --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig" + ''; passthru.tests = { inherit diff --git a/pkgs/by-name/fr/freexl/package.nix b/pkgs/by-name/fr/freexl/package.nix index 1509121ee4d0..b3137b6613f4 100644 --- a/pkgs/by-name/fr/freexl/package.nix +++ b/pkgs/by-name/fr/freexl/package.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation rec { expat minizip zlib - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; enableParallelBuilding = true; diff --git a/pkgs/by-name/fr/frei0r/package.nix b/pkgs/by-name/fr/frei0r/package.nix index e9ebe6fd03d8..33e4bce96c39 100644 --- a/pkgs/by-name/fr/frei0r/package.nix +++ b/pkgs/by-name/fr/frei0r/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation rec { cmake pkg-config ]; - buildInputs = - [ - cairo - opencv - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - cudaPackages.cuda_nvcc - ]; + buildInputs = [ + cairo + opencv + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + cudaPackages.cuda_nvcc + ]; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' for f in $out/lib/frei0r-1/*.so* ; do diff --git a/pkgs/by-name/fr/fribidi/package.nix b/pkgs/by-name/fr/fribidi/package.nix index 5fedf8f1d396..0d506b3ad8b8 100644 --- a/pkgs/by-name/fr/fribidi/package.nix +++ b/pkgs/by-name/fr/fribidi/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation (finalAttrs: { meson ninja pkg-config - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; depsBuildBuild = [ buildPackages.stdenv.cc ]; diff --git a/pkgs/by-name/fr/frigate/package.nix b/pkgs/by-name/fr/frigate/package.nix index 5b8024232b6c..1ba1470bdadf 100644 --- a/pkgs/by-name/fr/frigate/package.nix +++ b/pkgs/by-name/fr/frigate/package.nix @@ -64,54 +64,53 @@ python.pkgs.buildPythonApplication rec { patches = [ ./constants.patch ]; - postPatch = - '' - echo 'VERSION = "${version}"' > frigate/version.py + postPatch = '' + echo 'VERSION = "${version}"' > frigate/version.py - substituteInPlace \ - frigate/app.py \ - frigate/test/test_{http,storage}.py \ - frigate/test/http_api/base_http_test.py \ - --replace-fail "Router(migrate_db)" 'Router(migrate_db, "${placeholder "out"}/share/frigate/migrations")' + substituteInPlace \ + frigate/app.py \ + frigate/test/test_{http,storage}.py \ + frigate/test/http_api/base_http_test.py \ + --replace-fail "Router(migrate_db)" 'Router(migrate_db, "${placeholder "out"}/share/frigate/migrations")' - substituteInPlace frigate/const.py \ - --replace-fail "/opt/frigate" "${placeholder "out"}/${python.sitePackages}" \ - --replace-fail "/media/frigate" "/var/lib/frigate" \ - --replace-fail "/tmp/cache" "/var/cache/frigate" \ - --replace-fail "/config" "/var/lib/frigate" \ - --replace-fail "{CONFIG_DIR}/model_cache" "/var/cache/frigate/model_cache" + substituteInPlace frigate/const.py \ + --replace-fail "/opt/frigate" "${placeholder "out"}/${python.sitePackages}" \ + --replace-fail "/media/frigate" "/var/lib/frigate" \ + --replace-fail "/tmp/cache" "/var/cache/frigate" \ + --replace-fail "/config" "/var/lib/frigate" \ + --replace-fail "{CONFIG_DIR}/model_cache" "/var/cache/frigate/model_cache" - substituteInPlace frigate/comms/{config,embeddings}_updater.py frigate/comms/{zmq_proxy,inter_process}.py \ - --replace-fail "ipc:///tmp/cache" "ipc:///run/frigate" + substituteInPlace frigate/comms/{config,embeddings}_updater.py frigate/comms/{zmq_proxy,inter_process}.py \ + --replace-fail "ipc:///tmp/cache" "ipc:///run/frigate" - substituteInPlace frigate/db/sqlitevecq.py \ - --replace-fail "/usr/local/lib/vec0" "${lib.getLib sqlite-vec}/lib/vec0${stdenv.hostPlatform.extensions.sharedLibrary}" + substituteInPlace frigate/db/sqlitevecq.py \ + --replace-fail "/usr/local/lib/vec0" "${lib.getLib sqlite-vec}/lib/vec0${stdenv.hostPlatform.extensions.sharedLibrary}" - '' - # clang-rocm, provided by `rocmPackages.clr`, only works on x86_64-linux specifically - + lib.optionalString (with stdenv.hostPlatform; isx86_64 && isLinux) '' - substituteInPlace frigate/detectors/plugins/rocm.py \ - --replace-fail "/opt/rocm/bin/rocminfo" "rocminfo" \ - --replace-fail "/opt/rocm/lib" "${rocmPackages.clr}/lib" + '' + # clang-rocm, provided by `rocmPackages.clr`, only works on x86_64-linux specifically + + lib.optionalString (with stdenv.hostPlatform; isx86_64 && isLinux) '' + substituteInPlace frigate/detectors/plugins/rocm.py \ + --replace-fail "/opt/rocm/bin/rocminfo" "rocminfo" \ + --replace-fail "/opt/rocm/lib" "${rocmPackages.clr}/lib" - '' - + '' - # provide default paths for models and maps that are shipped with frigate - substituteInPlace frigate/config/config.py \ - --replace-fail "/cpu_model.tflite" "${tflite_cpu_model}" \ - --replace-fail "/edgetpu_model.tflite" "${tflite_edgetpu_model}" + '' + + '' + # provide default paths for models and maps that are shipped with frigate + substituteInPlace frigate/config/config.py \ + --replace-fail "/cpu_model.tflite" "${tflite_cpu_model}" \ + --replace-fail "/edgetpu_model.tflite" "${tflite_edgetpu_model}" - substituteInPlace frigate/detectors/detector_config.py \ - --replace-fail "/labelmap.txt" "${placeholder "out"}/share/frigate/labelmap.txt" + substituteInPlace frigate/detectors/detector_config.py \ + --replace-fail "/labelmap.txt" "${placeholder "out"}/share/frigate/labelmap.txt" - substituteInPlace frigate/events/audio.py \ - --replace-fail "/cpu_audio_model.tflite" "${placeholder "out"}/share/frigate/cpu_audio_model.tflite" \ - --replace-fail "/audio-labelmap.txt" "${placeholder "out"}/share/frigate/audio-labelmap.txt" + substituteInPlace frigate/events/audio.py \ + --replace-fail "/cpu_audio_model.tflite" "${placeholder "out"}/share/frigate/cpu_audio_model.tflite" \ + --replace-fail "/audio-labelmap.txt" "${placeholder "out"}/share/frigate/audio-labelmap.txt" - # work around onvif-zeep idiosyncrasy - substituteInPlace frigate/ptz/onvif.py \ - --replace-fail dist-packages site-packages - ''; + # work around onvif-zeep idiosyncrasy + substituteInPlace frigate/ptz/onvif.py \ + --replace-fail dist-packages site-packages + ''; dontBuild = true; diff --git a/pkgs/by-name/fr/froide/package.nix b/pkgs/by-name/fr/froide/package.nix index 0219d4da8462..8b5e9ffc64d9 100644 --- a/pkgs/by-name/fr/froide/package.nix +++ b/pkgs/by-name/fr/froide/package.nix @@ -177,17 +177,16 @@ python.pkgs.buildPythonApplication rec { "test_make_request_logged_out_with_existing_account" ]; - preCheck = - '' - export PGUSER="froide" - export postgresqlEnableTCP=1 - export postgresqlTestUserOptions="LOGIN SUPERUSER" - export GDAL_LIBRARY_PATH="${gdal}/lib/libgdal.so" - export GEOS_LIBRARY_PATH="${geos}/lib/libgeos_c.so" - '' - + lib.optionalString (!stdenv.hostPlatform.isRiscV) '' - export PLAYWRIGHT_BROWSERS_PATH="${playwright-driver.browsers}" - ''; + preCheck = '' + export PGUSER="froide" + export postgresqlEnableTCP=1 + export postgresqlTestUserOptions="LOGIN SUPERUSER" + export GDAL_LIBRARY_PATH="${gdal}/lib/libgdal.so" + export GEOS_LIBRARY_PATH="${geos}/lib/libgeos_c.so" + '' + + lib.optionalString (!stdenv.hostPlatform.isRiscV) '' + export PLAYWRIGHT_BROWSERS_PATH="${playwright-driver.browsers}" + ''; # Playwright tests not supported on RiscV yet doCheck = lib.meta.availableOn stdenv.hostPlatform playwright-driver.browsers; diff --git a/pkgs/by-name/fr/frr/clippy-helper.nix b/pkgs/by-name/fr/frr/clippy-helper.nix index 6df78f385f8a..11165b512068 100644 --- a/pkgs/by-name/fr/frr/clippy-helper.nix +++ b/pkgs/by-name/fr/frr/clippy-helper.nix @@ -29,13 +29,12 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - python3 - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ - elfutils - ]; + buildInputs = [ + python3 + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ + elfutils + ]; configureFlags = [ "--enable-clippy-only" diff --git a/pkgs/by-name/fr/frr/package.nix b/pkgs/by-name/fr/frr/package.nix index dd67f5047b0c..657a37e5b18a 100644 --- a/pkgs/by-name/fr/frr/package.nix +++ b/pkgs/by-name/fr/frr/package.nix @@ -95,49 +95,47 @@ stdenv.mkDerivation (finalAttrs: { # compilation errors. CXXFLAGS = "-std=gnu++23"; - nativeBuildInputs = - [ - autoreconfHook - bison - flex - perl - pkg-config - protobufc - python3.pkgs.sphinx - texinfo - ] - ++ lib.optionals grpcSupport [ - which - ]; + nativeBuildInputs = [ + autoreconfHook + bison + flex + perl + pkg-config + protobufc + python3.pkgs.sphinx + texinfo + ] + ++ lib.optionals grpcSupport [ + which + ]; - buildInputs = - [ - c-ares - json_c - libunwind - libyang - openssl - pam - pcre2 - protobufc - python3 - readline - rtrlib - zeromq - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - ] - ++ lib.optionals snmpSupport [ - net-snmp - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ - elfutils - ] - ++ lib.optionals grpcSupport [ - grpc - protobuf - ]; + buildInputs = [ + c-ares + json_c + libunwind + libyang + openssl + pam + pcre2 + protobufc + python3 + readline + rtrlib + zeromq + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + ] + ++ lib.optionals snmpSupport [ + net-snmp + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ + elfutils + ] + ++ lib.optionals grpcSupport [ + grpc + protobuf + ]; # otherwise in cross-compilation: "configure: error: no working python version found" depsBuildBuild = [ @@ -151,63 +149,62 @@ stdenv.mkDerivation (finalAttrs: { frrSource = finalAttrs.src; }; - configureFlags = - [ - "--disable-silent-rules" - "--disable-exampledir" - "--enable-configfile-mask=0640" - "--enable-group=frr" - "--enable-logfile-mask=0640" - "--enable-multipath=${toString numMultipath}" - "--enable-user=frr" - "--enable-vty-group=frrvty" - "--localstatedir=/run/frr" - "--sbindir=${placeholder "out"}/libexec/frr" - "--sysconfdir=/etc/frr" - "--with-clippy=${finalAttrs.clippy-helper}/bin/clippy" - # general options - (lib.strings.enableFeature snmpSupport "snmp") - (lib.strings.enableFeature rpkiSupport "rpki") - (lib.strings.enableFeature watchfrrSupport "watchfrr") - (lib.strings.enableFeature rtadvSupport "rtadv") - (lib.strings.enableFeature irdpSupport "irdp") - (lib.strings.enableFeature routeReplacementSupport "rr-semantics") - (lib.strings.enableFeature mgmtdSupport "mgmtd") - (lib.strings.enableFeature grpcSupport "grpc") + configureFlags = [ + "--disable-silent-rules" + "--disable-exampledir" + "--enable-configfile-mask=0640" + "--enable-group=frr" + "--enable-logfile-mask=0640" + "--enable-multipath=${toString numMultipath}" + "--enable-user=frr" + "--enable-vty-group=frrvty" + "--localstatedir=/run/frr" + "--sbindir=${placeholder "out"}/libexec/frr" + "--sysconfdir=/etc/frr" + "--with-clippy=${finalAttrs.clippy-helper}/bin/clippy" + # general options + (lib.strings.enableFeature snmpSupport "snmp") + (lib.strings.enableFeature rpkiSupport "rpki") + (lib.strings.enableFeature watchfrrSupport "watchfrr") + (lib.strings.enableFeature rtadvSupport "rtadv") + (lib.strings.enableFeature irdpSupport "irdp") + (lib.strings.enableFeature routeReplacementSupport "rr-semantics") + (lib.strings.enableFeature mgmtdSupport "mgmtd") + (lib.strings.enableFeature grpcSupport "grpc") - # routing protocols - (lib.strings.enableFeature bgpdSupport "bgpd") - (lib.strings.enableFeature ripdSupport "ripd") - (lib.strings.enableFeature ripngdSupport "ripngd") - (lib.strings.enableFeature ospfdSupport "ospfd") - (lib.strings.enableFeature ospf6dSupport "ospf6d") - (lib.strings.enableFeature ldpdSupport "ldpd") - (lib.strings.enableFeature nhrpdSupport "nhrpd") - (lib.strings.enableFeature eigrpdSupport "eigrpd") - (lib.strings.enableFeature babeldSupport "babeld") - (lib.strings.enableFeature isisdSupport "isisd") - (lib.strings.enableFeature pimdSupport "pimd") - (lib.strings.enableFeature pim6dSupport "pim6d") - (lib.strings.enableFeature sharpdSupport "sharpd") - (lib.strings.enableFeature fabricdSupport "fabricd") - (lib.strings.enableFeature vrrpdSupport "vrrpd") - (lib.strings.enableFeature pathdSupport "pathd") - (lib.strings.enableFeature bfddSupport "bfdd") - (lib.strings.enableFeature pbrdSupport "pbrd") - (lib.strings.enableFeature staticdSupport "staticd") - # BGP options - (lib.strings.enableFeature bgpAnnounce "bgp-announce") - (lib.strings.enableFeature bgpBmp "bgp-bmp") - (lib.strings.enableFeature bgpVnc "bgp-vnc") - # OSPF options - (lib.strings.enableFeature ospfApi "ospfapi") - # Cumulus options - (lib.strings.enableFeature cumulusSupport "cumulus") - ] - ++ lib.optionals snmpSupport [ - # Used during build for paths, `dev` has build shebangs so can be run during build. - "NETSNMP_CONFIG=${lib.getDev net-snmp}/bin/net-snmp-config" - ]; + # routing protocols + (lib.strings.enableFeature bgpdSupport "bgpd") + (lib.strings.enableFeature ripdSupport "ripd") + (lib.strings.enableFeature ripngdSupport "ripngd") + (lib.strings.enableFeature ospfdSupport "ospfd") + (lib.strings.enableFeature ospf6dSupport "ospf6d") + (lib.strings.enableFeature ldpdSupport "ldpd") + (lib.strings.enableFeature nhrpdSupport "nhrpd") + (lib.strings.enableFeature eigrpdSupport "eigrpd") + (lib.strings.enableFeature babeldSupport "babeld") + (lib.strings.enableFeature isisdSupport "isisd") + (lib.strings.enableFeature pimdSupport "pimd") + (lib.strings.enableFeature pim6dSupport "pim6d") + (lib.strings.enableFeature sharpdSupport "sharpd") + (lib.strings.enableFeature fabricdSupport "fabricd") + (lib.strings.enableFeature vrrpdSupport "vrrpd") + (lib.strings.enableFeature pathdSupport "pathd") + (lib.strings.enableFeature bfddSupport "bfdd") + (lib.strings.enableFeature pbrdSupport "pbrd") + (lib.strings.enableFeature staticdSupport "staticd") + # BGP options + (lib.strings.enableFeature bgpAnnounce "bgp-announce") + (lib.strings.enableFeature bgpBmp "bgp-bmp") + (lib.strings.enableFeature bgpVnc "bgp-vnc") + # OSPF options + (lib.strings.enableFeature ospfApi "ospfapi") + # Cumulus options + (lib.strings.enableFeature cumulusSupport "cumulus") + ] + ++ lib.optionals snmpSupport [ + # Used during build for paths, `dev` has build shebangs so can be run during build. + "NETSNMP_CONFIG=${lib.getDev net-snmp}/bin/net-snmp-config" + ]; postPatch = '' substituteInPlace tools/frr-reload \ diff --git a/pkgs/by-name/fr/frugally-deep/package.nix b/pkgs/by-name/fr/frugally-deep/package.nix index baa42437f5f0..7435378c68f4 100644 --- a/pkgs/by-name/fr/frugally-deep/package.nix +++ b/pkgs/by-name/fr/frugally-deep/package.nix @@ -23,14 +23,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-yg2SMsYOOSOgsdwIH1bU3iPM45z6c7WeIrgOddt3um4="; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals buildTests [ - python3Packages.python - python3Packages.numpy - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals buildTests [ + python3Packages.python + python3Packages.numpy + ]; buildInputs = lib.optionals buildTests [ doctest diff --git a/pkgs/by-name/fs/fsverity-utils/package.nix b/pkgs/by-name/fs/fsverity-utils/package.nix index 4ef7a2357b83..babacd82e2c0 100644 --- a/pkgs/by-name/fs/fsverity-utils/package.nix +++ b/pkgs/by-name/fs/fsverity-utils/package.nix @@ -16,7 +16,8 @@ stdenv.mkDerivation rec { "out" "lib" "dev" - ] ++ lib.optional enableManpages "man"; + ] + ++ lib.optional enableManpages "man"; src = fetchzip { url = "https://git.kernel.org/pub/scm/fs/fsverity/fsverity-utils.git/snapshot/fsverity-utils-v${version}.tar.gz"; @@ -36,7 +37,8 @@ stdenv.mkDerivation rec { makeFlags = [ "DESTDIR=$(out)" "PREFIX=" - ] ++ lib.optional enableShared "USE_SHARED_LIB=1"; + ] + ++ lib.optional enableShared "USE_SHARED_LIB=1"; doCheck = true; diff --git a/pkgs/by-name/ft/ft2-clone/package.nix b/pkgs/by-name/ft/ft2-clone/package.nix index 64ae56dfd956..1babddd933da 100644 --- a/pkgs/by-name/ft/ft2-clone/package.nix +++ b/pkgs/by-name/ft/ft2-clone/package.nix @@ -21,12 +21,13 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake ]; - buildInputs = - [ SDL2 ] - ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + SDL2 + ] + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; passthru.tests = { ft2-clone-starts = nixosTests.ft2-clone; diff --git a/pkgs/by-name/fu/furmark/package.nix b/pkgs/by-name/fu/furmark/package.nix index adc2f9dc66d4..c4a4f2b18e62 100644 --- a/pkgs/by-name/fu/furmark/package.nix +++ b/pkgs/by-name/fu/furmark/package.nix @@ -55,7 +55,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libGL libGLU - ] ++ lib.optionals stdenv.hostPlatform.isAarch64 [ libxcrypt-legacy ]; + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ libxcrypt-legacy ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/fu/furnace/package.nix b/pkgs/by-name/fu/furnace/package.nix index 321b7e00ca9c..09e633804f6c 100644 --- a/pkgs/by-name/fu/furnace/package.nix +++ b/pkgs/by-name/fu/furnace/package.nix @@ -46,37 +46,35 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail 'libX11.so' '${lib.getLib libX11}/lib/libX11.so' ''; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeWrapper - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeWrapper + ]; - buildInputs = - [ - fftw - fmt - freetype - libsndfile - rtmidi - SDL2 - zlib - portaudio - ] - ++ lib.optionals withGL [ - libGL - ] - ++ lib.optionals withJACK [ - libjack2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # portaudio pkg-config is pulling this in as a link dependency, not set in propagatedBuildInputs - alsa-lib - libX11 - ]; + buildInputs = [ + fftw + fmt + freetype + libsndfile + rtmidi + SDL2 + zlib + portaudio + ] + ++ lib.optionals withGL [ + libGL + ] + ++ lib.optionals withJACK [ + libjack2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # portaudio pkg-config is pulling this in as a link dependency, not set in propagatedBuildInputs + alsa-lib + libX11 + ]; cmakeFlags = [ (lib.cmakeBool "BUILD_GUI" withGUI) diff --git a/pkgs/by-name/fu/fuse-archive/package.nix b/pkgs/by-name/fu/fuse-archive/package.nix index 4dd183b0569f..ce3b9b338cfd 100644 --- a/pkgs/by-name/fu/fuse-archive/package.nix +++ b/pkgs/by-name/fu/fuse-archive/package.nix @@ -19,16 +19,15 @@ stdenv.mkDerivation rec { hash = "sha256-Fta/IYKWsB4ZuPOWtGO6p6l03eoRXaO0lIGaCU3SRag="; }; - postPatch = - '' - substituteInPlace Makefile \ - --replace-fail "/usr" "$out" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/main.cc \ - --replace-fail "!defined(__OpenBSD__)" "!defined(__OpenBSD__) && !defined(__APPLE__)" \ - --replace-fail " | O_PATH" "" - ''; + postPatch = '' + substituteInPlace Makefile \ + --replace-fail "/usr" "$out" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/main.cc \ + --replace-fail "!defined(__OpenBSD__)" "!defined(__OpenBSD__) && !defined(__APPLE__)" \ + --replace-fail " | O_PATH" "" + ''; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/by-name/fu/fuzzel/package.nix b/pkgs/by-name/fu/fuzzel/package.nix index bfe63be3ef39..8e3e76bdf7d0 100644 --- a/pkgs/by-name/fu/fuzzel/package.nix +++ b/pkgs/by-name/fu/fuzzel/package.nix @@ -49,18 +49,17 @@ stdenv.mkDerivation (finalAttrs: { scdoc ]; - buildInputs = - [ - wayland - pixman - wayland-protocols - libxkbcommon - tllist - fcft - ] - ++ lib.optional enableCairo cairo - ++ lib.optional pngSupport libpng - ++ lib.optional (svgSupport && svgBackend == "librsvg") librsvg; + buildInputs = [ + wayland + pixman + wayland-protocols + libxkbcommon + tllist + fcft + ] + ++ lib.optional enableCairo cairo + ++ lib.optional pngSupport libpng + ++ lib.optional (svgSupport && svgBackend == "librsvg") librsvg; mesonBuildType = "release"; diff --git a/pkgs/by-name/fv/fvwm2/package.nix b/pkgs/by-name/fv/fvwm2/package.nix index 8f541fca0e75..515e156b02da 100644 --- a/pkgs/by-name/fv/fvwm2/package.nix +++ b/pkgs/by-name/fv/fvwm2/package.nix @@ -56,7 +56,8 @@ stdenv.mkDerivation rec { perl python3Packages.python readline - ] ++ lib.optional enableGestures libstroke; + ] + ++ lib.optional enableGestures libstroke; pythonPath = [ python3Packages.pyxdg diff --git a/pkgs/by-name/fw/fwknop/package.nix b/pkgs/by-name/fw/fwknop/package.nix index 48bfd7428bc3..f88870ba9640 100644 --- a/pkgs/by-name/fw/fwknop/package.nix +++ b/pkgs/by-name/fw/fwknop/package.nix @@ -28,31 +28,29 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ - libpcap - texinfo - ] - ++ lib.optionals gnupgSupport [ - gnupg - gpgme.dev - ] - ++ lib.optionals wgetSupport [ wget ]; + buildInputs = [ + libpcap + texinfo + ] + ++ lib.optionals gnupgSupport [ + gnupg + gpgme.dev + ] + ++ lib.optionals wgetSupport [ wget ]; - configureFlags = - [ - "--sysconfdir=/etc" - "--localstatedir=/run" - "--with-iptables=${iptables}/sbin/iptables" - (lib.enableFeature buildServer "server") - (lib.enableFeature buildClient "client") - (lib.withFeatureAs wgetSupport "wget" "${wget}/bin/wget") - ] - ++ lib.optionalString gnupgSupport [ - "--with-gpgme" - "--with-gpgme-prefix=${gpgme.dev}" - "--with-gpg=${gnupg}" - ]; + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/run" + "--with-iptables=${iptables}/sbin/iptables" + (lib.enableFeature buildServer "server") + (lib.enableFeature buildClient "client") + (lib.withFeatureAs wgetSupport "wget" "${wget}/bin/wget") + ] + ++ lib.optionalString gnupgSupport [ + "--with-gpgme" + "--with-gpgme-prefix=${gpgme.dev}" + "--with-gpg=${gnupg}" + ]; # Temporary hack to copy the example configuration files into the nix-store, # this'll probably be helpful until there's a NixOS module for that (feel free diff --git a/pkgs/by-name/fw/fwup/package.nix b/pkgs/by-name/fw/fwup/package.nix index 6fd8851f285e..337815611052 100644 --- a/pkgs/by-name/fw/fwup/package.nix +++ b/pkgs/by-name/fw/fwup/package.nix @@ -44,16 +44,15 @@ stdenv.mkDerivation rec { zlib ]; - propagatedBuildInputs = - [ - coreutils - unzip - zip - ] - ++ lib.optionals doCheck [ - mtools - dosfstools - ]; + propagatedBuildInputs = [ + coreutils + unzip + zip + ] + ++ lib.optionals doCheck [ + mtools + dosfstools + ]; nativeCheckInputs = [ which diff --git a/pkgs/by-name/fw/fwupd/package.nix b/pkgs/by-name/fw/fwupd/package.nix index 901505481c22..4d0f12f4a495 100644 --- a/pkgs/by-name/fw/fwupd/package.nix +++ b/pkgs/by-name/fw/fwupd/package.nix @@ -174,20 +174,19 @@ stdenv.mkDerivation (finalAttrs: { ./efi-app-path.patch ]; - postPatch = - '' - patchShebangs \ - generate-build/generate-version-script.py \ - generate-build/generate-man.py \ - po/test-deps \ - plugins/uefi-capsule/tests/grub2-mkconfig \ - plugins/uefi-capsule/tests/grub2-reboot - '' - # in nixos test tries to chmod 0777 $out/share/installed-tests/fwupd/tests/redfish.conf - + '' - substituteInPlace plugins/redfish/meson.build \ - --replace-fail "get_option('tests')" "false" - ''; + postPatch = '' + patchShebangs \ + generate-build/generate-version-script.py \ + generate-build/generate-man.py \ + po/test-deps \ + plugins/uefi-capsule/tests/grub2-mkconfig \ + plugins/uefi-capsule/tests/grub2-reboot + '' + # in nixos test tries to chmod 0777 $out/share/installed-tests/fwupd/tests/redfish.conf + + '' + substituteInPlace plugins/redfish/meson.build \ + --replace-fail "get_option('tests')" "false" + ''; strictDeps = true; @@ -200,86 +199,83 @@ stdenv.mkDerivation (finalAttrs: { json-glib ]; - nativeBuildInputs = - [ - ensureNewerSourcesForZipFilesHook # required for firmware zipping - gettext - gi-docgen - gobject-introspection - libxml2 - meson - ninja - pkg-config - protobuf # for protoc - protobufc # for protoc-gen-c - shared-mime-info - vala - wrapGAppsNoGuiHook + nativeBuildInputs = [ + ensureNewerSourcesForZipFilesHook # required for firmware zipping + gettext + gi-docgen + gobject-introspection + libxml2 + meson + ninja + pkg-config + protobuf # for protoc + protobufc # for protoc-gen-c + shared-mime-info + vala + wrapGAppsNoGuiHook - # jcat-tool at buildtime requires a home directory - writableTmpDirAsHomeHook - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + # jcat-tool at buildtime requires a home directory + writableTmpDirAsHomeHook + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - bash-completion - curl - elfutils - fwupd-efi - gnutls - gusb - libarchive - libcbor - libdrm - libgudev - libjcat - libmbim - libqmi - libuuid - libxmlb - modemmanager - pango - polkit - protobufc - readline - sqlite - tpm2-tss - valgrind - xz # for liblzma - ] - ++ lib.optionals haveFlashrom [ - flashrom - ]; + buildInputs = [ + bash-completion + curl + elfutils + fwupd-efi + gnutls + gusb + libarchive + libcbor + libdrm + libgudev + libjcat + libmbim + libqmi + libuuid + libxmlb + modemmanager + pango + polkit + protobufc + readline + sqlite + tpm2-tss + valgrind + xz # for liblzma + ] + ++ lib.optionals haveFlashrom [ + flashrom + ]; - mesonFlags = - [ - (lib.mesonEnable "docs" true) - # We are building the official releases. - (lib.mesonEnable "supported_build" true) - (lib.mesonOption "systemd_root_prefix" "${placeholder "out"}") - (lib.mesonOption "installed_test_prefix" "${placeholder "installedTests"}") - "--localstatedir=/var" - "--sysconfdir=/etc" - (lib.mesonOption "sysconfdir_install" "${placeholder "out"}/etc") - (lib.mesonOption "efi_os_dir" "nixos") - (lib.mesonEnable "plugin_modem_manager" true) - (lib.mesonBool "vendor_metadata" true) - (lib.mesonBool "plugin_uefi_capsule_splash" false) - # TODO: what should this be? - (lib.mesonOption "vendor_ids_dir" "${hwdata}/share/hwdata") - (lib.mesonEnable "umockdev_tests" false) - # We do not want to place the daemon into lib (cyclic reference) - "--libexecdir=${placeholder "out"}/libexec" - ] - ++ lib.optionals (!enablePassim) [ - (lib.mesonEnable "passim" false) - ] - ++ lib.optionals (!haveFlashrom) [ - (lib.mesonEnable "plugin_flashrom" false) - ]; + mesonFlags = [ + (lib.mesonEnable "docs" true) + # We are building the official releases. + (lib.mesonEnable "supported_build" true) + (lib.mesonOption "systemd_root_prefix" "${placeholder "out"}") + (lib.mesonOption "installed_test_prefix" "${placeholder "installedTests"}") + "--localstatedir=/var" + "--sysconfdir=/etc" + (lib.mesonOption "sysconfdir_install" "${placeholder "out"}/etc") + (lib.mesonOption "efi_os_dir" "nixos") + (lib.mesonEnable "plugin_modem_manager" true) + (lib.mesonBool "vendor_metadata" true) + (lib.mesonBool "plugin_uefi_capsule_splash" false) + # TODO: what should this be? + (lib.mesonOption "vendor_ids_dir" "${hwdata}/share/hwdata") + (lib.mesonEnable "umockdev_tests" false) + # We do not want to place the daemon into lib (cyclic reference) + "--libexecdir=${placeholder "out"}/libexec" + ] + ++ lib.optionals (!enablePassim) [ + (lib.mesonEnable "passim" false) + ] + ++ lib.optionals (!haveFlashrom) [ + (lib.mesonEnable "plugin_flashrom" false) + ]; # TODO: wrapGAppsHook3 wraps efi capsule even though it is not ELF dontWrapGApps = true; diff --git a/pkgs/by-name/ga/galario/package.nix b/pkgs/by-name/ga/galario/package.nix index 6abfa0fe519e..7dcfafe08f3e 100644 --- a/pkgs/by-name/ga/galario/package.nix +++ b/pkgs/by-name/ga/galario/package.nix @@ -32,13 +32,12 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - fftw - fftwFloat - ] - ++ lib.optional enablePython pythonPackages.python - ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; + buildInputs = [ + fftw + fftwFloat + ] + ++ lib.optional enablePython pythonPackages.python + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; propagatedBuildInputs = lib.optionals enablePython [ pythonPackages.numpy diff --git a/pkgs/by-name/ga/galene-stream/package.nix b/pkgs/by-name/ga/galene-stream/package.nix index e2f2e07bc52f..5f117560e909 100644 --- a/pkgs/by-name/ga/galene-stream/package.nix +++ b/pkgs/by-name/ga/galene-stream/package.nix @@ -43,16 +43,15 @@ python3Packages.buildPythonApplication rec { setuptools-scm ]; - buildInputs = - [ - libnice # libgstnice.so - ] - ++ (with gst_all_1; [ - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly # libgstx264.so - ]); + buildInputs = [ + libnice # libgstnice.so + ] + ++ (with gst_all_1; [ + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly # libgstx264.so + ]); dependencies = with python3Packages; [ pygobject3 diff --git a/pkgs/by-name/ga/gamescope/package.nix b/pkgs/by-name/ga/gamescope/package.nix index 795701f89d5c..183fc3345bd0 100644 --- a/pkgs/by-name/ga/gamescope/package.nix +++ b/pkgs/by-name/ga/gamescope/package.nix @@ -106,69 +106,67 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - pkg-config - ninja - wayland-scanner - # For `libdisplay-info` - python3 - hwdata - v4l-utils - # For OpenVR - cmake + nativeBuildInputs = [ + meson + pkg-config + ninja + wayland-scanner + # For `libdisplay-info` + python3 + hwdata + v4l-utils + # For OpenVR + cmake - # calls git describe to encode its own version into the build - (buildPackages.writeShellScriptBin "git" "echo ${finalAttrs.version}") - ] - ++ lib.optionals enableExecutable [ - makeBinaryWrapper - glslang - ]; + # calls git describe to encode its own version into the build + (buildPackages.writeShellScriptBin "git" "echo ${finalAttrs.version}") + ] + ++ lib.optionals enableExecutable [ + makeBinaryWrapper + glslang + ]; - buildInputs = - [ - pipewire - hwdata - xorg.libX11 - wayland - wayland-protocols - vulkan-loader - glm - luajit + buildInputs = [ + pipewire + hwdata + xorg.libX11 + wayland + wayland-protocols + vulkan-loader + glm + luajit + ] + ++ lib.optionals enableWsi [ + vulkan-headers + ] + ++ lib.optionals enableExecutable ( + wlroots.buildInputs + ++ [ + # gamescope uses a custom wlroots branch + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXi + xorg.libXmu + xorg.libXrender + xorg.libXres + xorg.libXtst + xorg.libXxf86vm + libavif + libdrm + libei + SDL2 + libdecor + libinput + libxkbcommon + gbenchmark + pixman + libcap + stb + lcms ] - ++ lib.optionals enableWsi [ - vulkan-headers - ] - ++ lib.optionals enableExecutable ( - wlroots.buildInputs - ++ [ - # gamescope uses a custom wlroots branch - xorg.libXcomposite - xorg.libXcursor - xorg.libXdamage - xorg.libXext - xorg.libXi - xorg.libXmu - xorg.libXrender - xorg.libXres - xorg.libXtst - xorg.libXxf86vm - libavif - libdrm - libei - SDL2 - libdecor - libinput - libxkbcommon - gbenchmark - pixman - libcap - stb - lcms - ] - ); + ); postInstall = lib.optionalString enableExecutable '' # using patchelf unstable because the stable version corrupts the binary diff --git a/pkgs/by-name/ga/gammu/package.nix b/pkgs/by-name/ga/gammu/package.nix index e914f59357e4..95e6d79598a2 100644 --- a/pkgs/by-name/ga/gammu/package.nix +++ b/pkgs/by-name/ga/gammu/package.nix @@ -46,21 +46,20 @@ stdenv.mkDerivation rec { strictDeps = true; - buildInputs = - [ - bash - bluez - libusb1 - curl - gettext - sqlite - libiconv - ] - ++ lib.optionals dbiSupport [ - libdbi - libdbiDrivers - ] - ++ lib.optionals postgresSupport [ libpq ]; + buildInputs = [ + bash + bluez + libusb1 + curl + gettext + sqlite + libiconv + ] + ++ lib.optionals dbiSupport [ + libdbi + libdbiDrivers + ] + ++ lib.optionals postgresSupport [ libpq ]; meta = with lib; { homepage = "https://wammu.eu/gammu/"; diff --git a/pkgs/by-name/ga/gap/package.nix b/pkgs/by-name/ga/gap/package.nix index e3cef3d777e1..73df812a7cc2 100644 --- a/pkgs/by-name/ga/gap/package.nix +++ b/pkgs/by-name/ga/gap/package.nix @@ -79,11 +79,9 @@ stdenv.mkDerivation rec { }; # remove all non-essential packages (which take up a lot of space) - preConfigure = - lib.optionalString (!keepAll) (removeNonWhitelistedPkgs packagesToKeep) - + '' - patchShebangs . - ''; + preConfigure = lib.optionalString (!keepAll) (removeNonWhitelistedPkgs packagesToKeep) + '' + patchShebangs . + ''; buildInputs = [ readline diff --git a/pkgs/by-name/ga/gapless/package.nix b/pkgs/by-name/ga/gapless/package.nix index 132870f96951..ce00a4aacad5 100644 --- a/pkgs/by-name/ga/gapless/package.nix +++ b/pkgs/by-name/ga/gapless/package.nix @@ -36,17 +36,16 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook4 ]; - buildInputs = - [ - gtk4 - libadwaita - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gstreamer - ]); + buildInputs = [ + gtk4 + libadwaita + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gstreamer + ]); passthru.updateScript = gitUpdater { rev-prefix = "v"; diff --git a/pkgs/by-name/ga/gargoyle/package.nix b/pkgs/by-name/ga/gargoyle/package.nix index 017bd76d7c18..3722c7a16240 100644 --- a/pkgs/by-name/ga/gargoyle/package.nix +++ b/pkgs/by-name/ga/gargoyle/package.nix @@ -50,23 +50,22 @@ stdenv.mkDerivation rec { qt6.wrapQtAppsHook ]; - buildInputs = - [ - fluidsynth - fmt - freetype - libjpeg - libopenmpt - libpng - libsndfile - libvorbis - mpg123 - qt6.qtbase - qt6.qtmultimedia - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - qt6.qtwayland - ]; + buildInputs = [ + fluidsynth + fmt + freetype + libjpeg + libopenmpt + libpng + libsndfile + libvorbis + mpg123 + qt6.qtbase + qt6.qtmultimedia + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + qt6.qtwayland + ]; cmakeFlags = [ (lib.cmakeFeature "INTERFACE" "QT") diff --git a/pkgs/by-name/ga/gavin-bc/package.nix b/pkgs/by-name/ga/gavin-bc/package.nix index 5cb9eaf1d887..fe884ea4bf3b 100644 --- a/pkgs/by-name/ga/gavin-bc/package.nix +++ b/pkgs/by-name/ga/gavin-bc/package.nix @@ -36,14 +36,13 @@ stdenv.mkDerivation (finalAttrs: { (lib.optional (historyType == "editline") editline) ++ (lib.optional (historyType == "readline") readline); - configureFlags = - [ - "--disable-nls" - ] - ++ (lib.optional (predefinedBuildType != "") "--predefined-build-type=${predefinedBuildType}") - ++ (lib.optional (historyType == "editline") "--enable-editline") - ++ (lib.optional (historyType == "readline") "--enable-readline") - ++ (lib.optional (historyType == "internal") "--enable-internal-history"); + configureFlags = [ + "--disable-nls" + ] + ++ (lib.optional (predefinedBuildType != "") "--predefined-build-type=${predefinedBuildType}") + ++ (lib.optional (historyType == "editline") "--enable-editline") + ++ (lib.optional (historyType == "readline") "--enable-readline") + ++ (lib.optional (historyType == "internal") "--enable-internal-history"); meta = { homepage = "https://git.gavinhoward.com/gavin/bc"; diff --git a/pkgs/by-name/gc/gcs/package.nix b/pkgs/by-name/gc/gcs/package.nix index da2f8de3a62c..57d359f45a16 100644 --- a/pkgs/by-name/gc/gcs/package.nix +++ b/pkgs/by-name/gc/gcs/package.nix @@ -37,21 +37,20 @@ buildGoModule rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - mupdf - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGL - libX11 - libXcursor - libXrandr - libXinerama - libXi - libXxf86vm - fontconfig - freetype - ]; + buildInputs = [ + mupdf + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGL + libX11 + libXcursor + libXrandr + libXinerama + libXi + libXxf86vm + fontconfig + freetype + ]; # flags are based on https://github.com/richardwilkes/gcs/blob/master/build.sh flags = [ "-a" ]; diff --git a/pkgs/by-name/gd/gd/package.nix b/pkgs/by-name/gd/gd/package.nix index cadb226b1190..7bc498ef1fdd 100644 --- a/pkgs/by-name/gd/gd/package.nix +++ b/pkgs/by-name/gd/gd/package.nix @@ -38,12 +38,11 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - configureFlags = - [ - "--enable-gd-formats" - ] - # -pthread gets passed to clang, causing warnings - ++ lib.optional stdenv.hostPlatform.isDarwin "--enable-werror=no"; + configureFlags = [ + "--enable-gd-formats" + ] + # -pthread gets passed to clang, causing warnings + ++ lib.optional stdenv.hostPlatform.isDarwin "--enable-werror=no"; nativeBuildInputs = [ autoconf @@ -51,20 +50,19 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - zlib - freetype - libpng - libjpeg - libwebp - libtiff - libavif - ] - ++ lib.optionals withXorg [ - fontconfig - libXpm - ]; + buildInputs = [ + zlib + freetype + libpng + libjpeg + libwebp + libtiff + libavif + ] + ++ lib.optionals withXorg [ + fontconfig + libXpm + ]; outputs = [ "bin" diff --git a/pkgs/by-name/gd/gdal/package.nix b/pkgs/by-name/gd/gdal/package.nix index c10c88a916ca..cff3c5d29174 100644 --- a/pkgs/by-name/gd/gdal/package.nix +++ b/pkgs/by-name/gd/gdal/package.nix @@ -105,49 +105,47 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - bison - cmake - doxygen - graphviz - pkg-config - python3.pkgs.setuptools - python3.pkgs.wrapPython - swig - ] - ++ lib.optionals useJava [ - ant - jdk - ]; + nativeBuildInputs = [ + bison + cmake + doxygen + graphviz + pkg-config + python3.pkgs.setuptools + python3.pkgs.wrapPython + swig + ] + ++ lib.optionals useJava [ + ant + jdk + ]; - cmakeFlags = - [ - "-DGDAL_USE_INTERNAL_LIBS=OFF" - "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include" - "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" - "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" - "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${ - lib.optionalString (libmysqlclient.pname != "mysql") "mysql/" - }libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" - ] - ++ lib.optionals finalAttrs.doInstallCheck [ - "-DBUILD_TESTING=ON" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" - ] - ++ lib.optionals (!useTiledb) [ - "-DGDAL_USE_TILEDB=OFF" - ] - ++ lib.optionals (!useJava) [ - # This is not strictly needed as the Java bindings wouldn't build anyway if - # ant/jdk were not available. - "-DBUILD_JAVA_BINDINGS=OFF" - ]; + cmakeFlags = [ + "-DGDAL_USE_INTERNAL_LIBS=OFF" + "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include" + "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" + "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" + "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${ + lib.optionalString (libmysqlclient.pname != "mysql") "mysql/" + }libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" + ] + ++ lib.optionals finalAttrs.doInstallCheck [ + "-DBUILD_TESTING=ON" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" + ] + ++ lib.optionals (!useTiledb) [ + "-DGDAL_USE_TILEDB=OFF" + ] + ++ lib.optionals (!useJava) [ + # This is not strictly needed as the Java bindings wouldn't build anyway if + # ant/jdk were not available. + "-DBUILD_JAVA_BINDINGS=OFF" + ]; buildInputs = let @@ -235,15 +233,14 @@ stdenv.mkDerivation (finalAttrs: { ++ nonDarwinDeps; pythonPath = [ python3.pkgs.numpy ]; - postInstall = - '' - wrapPythonProgramsIn "$out/bin" "$out $pythonPath" - '' - + lib.optionalString useJava '' - cd $out/lib - ln -s ./jni/libgdalalljni${stdenv.hostPlatform.extensions.sharedLibrary} - cd - - ''; + postInstall = '' + wrapPythonProgramsIn "$out/bin" "$out $pythonPath" + '' + + lib.optionalString useJava '' + cd $out/lib + ln -s ./jni/libgdalalljni${stdenv.hostPlatform.extensions.sharedLibrary} + cd - + ''; enableParallelBuilding = true; @@ -277,48 +274,47 @@ stdenv.mkDerivation (finalAttrs: { "gdrivers/gdalhttp.py" "gdrivers/wms.py" ]; - disabledTests = - [ - # tests that attempt to make network requests - "test_jp2openjpeg_45" - # tests that require the full proj dataset which we don't package yet - # https://github.com/OSGeo/gdal/issues/5523 - "test_transformer_dem_overrride_srs" - "test_osr_ct_options_area_of_interest" - # ZIP does not support timestamps before 1980 - "test_sentinel2_zipped" - # tries to call unwrapped executable - "test_SetPROJAuxDbPaths" - # failing for unknown reason - # https://github.com/OSGeo/gdal/pull/10806#issuecomment-2362054085 - "test_ogr_gmlas_billion_laugh" - # Flaky on hydra, collected in https://github.com/NixOS/nixpkgs/pull/327323. - "test_ogr_gmlas_huge_processing_time" - "test_ogr_gpkg_background_rtree_build" - "test_vsiaz_fake_write" - "test_vsioss_6" - # flaky? - "test_tiledb_read_arbitrary_array" - # tests for magic numbers, seem to change with different poppler versions, - # and architectures - "test_pdf_extra_rasters" - ] - ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ - # likely precision-related expecting x87 behaviour - "test_jp2openjpeg_22" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # flaky on macos - "test_rda_download_queue" - # https://github.com/OSGeo/gdal/commit/fa0ac7544af837613e9831d4d2841dd6bf735e1f - "test_ogr_gpkg_arrow_stream_huge_array" - ] - ++ lib.optionals (lib.versionOlder proj.version "8") [ - "test_ogr_parquet_write_crs_without_id_in_datum_ensemble_members" - ] - ++ lib.optionals (!usePoppler) [ - "test_pdf_jpx_compression" - ]; + disabledTests = [ + # tests that attempt to make network requests + "test_jp2openjpeg_45" + # tests that require the full proj dataset which we don't package yet + # https://github.com/OSGeo/gdal/issues/5523 + "test_transformer_dem_overrride_srs" + "test_osr_ct_options_area_of_interest" + # ZIP does not support timestamps before 1980 + "test_sentinel2_zipped" + # tries to call unwrapped executable + "test_SetPROJAuxDbPaths" + # failing for unknown reason + # https://github.com/OSGeo/gdal/pull/10806#issuecomment-2362054085 + "test_ogr_gmlas_billion_laugh" + # Flaky on hydra, collected in https://github.com/NixOS/nixpkgs/pull/327323. + "test_ogr_gmlas_huge_processing_time" + "test_ogr_gpkg_background_rtree_build" + "test_vsiaz_fake_write" + "test_vsioss_6" + # flaky? + "test_tiledb_read_arbitrary_array" + # tests for magic numbers, seem to change with different poppler versions, + # and architectures + "test_pdf_extra_rasters" + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ + # likely precision-related expecting x87 behaviour + "test_jp2openjpeg_22" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # flaky on macos + "test_rda_download_queue" + # https://github.com/OSGeo/gdal/commit/fa0ac7544af837613e9831d4d2841dd6bf735e1f + "test_ogr_gpkg_arrow_stream_huge_array" + ] + ++ lib.optionals (lib.versionOlder proj.version "8") [ + "test_ogr_parquet_write_crs_without_id_in_datum_ensemble_members" + ] + ++ lib.optionals (!usePoppler) [ + "test_pdf_jpx_compression" + ]; postCheck = '' popd # autotest ''; diff --git a/pkgs/by-name/gd/gdbm/package.nix b/pkgs/by-name/gd/gdbm/package.nix index 28cfd69edadb..0e21e7657331 100644 --- a/pkgs/by-name/gd/gdbm/package.nix +++ b/pkgs/by-name/gd/gdbm/package.nix @@ -16,16 +16,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-0C2zxZJu2Hf4gXuBzR+S9T73TKjG21Q/u6AnGzTzk+w="; }; - patches = - [ - # Remove on next release. - ./upstream-darwin-clock-nanosleep-fix.patch - ./upstream-lockwait-test-fixes.patch - ./upstream-musl-ssize_t-fix.patch - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - ./freebsd-patch-src-lock-c.patch - ]; + patches = [ + # Remove on next release. + ./upstream-darwin-clock-nanosleep-fix.patch + ./upstream-lockwait-test-fixes.patch + ./upstream-musl-ssize_t-fix.patch + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + ./freebsd-patch-src-lock-c.patch + ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; diff --git a/pkgs/by-name/ge/geant4/package.nix b/pkgs/by-name/ge/geant4/package.nix index 8f0ad718f4e7..2e11d73ee03f 100644 --- a/pkgs/by-name/ge/geant4/package.nix +++ b/pkgs/by-name/ge/geant4/package.nix @@ -52,33 +52,32 @@ stdenv.mkDerivation rec { --replace '${"$"}{prefix}/${"$"}{PTL_INSTALL_' '${"$"}{PTL_INSTALL_' ''; - cmakeFlags = - [ - "-DGEANT4_INSTALL_DATA=OFF" - "-DGEANT4_USE_GDML=ON" - "-DGEANT4_USE_G3TOG4=ON" - "-DGEANT4_USE_QT=${if enableQt then "ON" else "OFF"}" - "-DGEANT4_USE_XM=${if enableXM then "ON" else "OFF"}" - "-DGEANT4_USE_OPENGL_X11=${if enableOpenGLX11 then "ON" else "OFF"}" - "-DGEANT4_USE_INVENTOR=${if enableInventor then "ON" else "OFF"}" - "-DGEANT4_USE_PYTHON=${if enablePython then "ON" else "OFF"}" - "-DGEANT4_USE_RAYTRACER_X11=${if enableRaytracerX11 then "ON" else "OFF"}" - "-DGEANT4_USE_SYSTEM_CLHEP=ON" - "-DGEANT4_USE_SYSTEM_EXPAT=ON" - "-DGEANT4_USE_SYSTEM_ZLIB=ON" - "-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}" - ] - ++ lib.optionals (enableOpenGLX11 && stdenv.hostPlatform.isDarwin) [ - "-DXQuartzGL_INCLUDE_DIR=${libGLX.dev}/include" - "-DXQuartzGL_gl_LIBRARY=${libGLX}/lib/libGL.dylib" - ] - ++ lib.optionals (enableMultiThreading && enablePython) [ - "-DGEANT4_BUILD_TLS_MODEL=global-dynamic" - ] - ++ lib.optionals enableInventor [ - "-DINVENTOR_INCLUDE_DIR=${coin3d}/include" - "-DINVENTOR_LIBRARY_RELEASE=${coin3d}/lib/libCoin.so" - ]; + cmakeFlags = [ + "-DGEANT4_INSTALL_DATA=OFF" + "-DGEANT4_USE_GDML=ON" + "-DGEANT4_USE_G3TOG4=ON" + "-DGEANT4_USE_QT=${if enableQt then "ON" else "OFF"}" + "-DGEANT4_USE_XM=${if enableXM then "ON" else "OFF"}" + "-DGEANT4_USE_OPENGL_X11=${if enableOpenGLX11 then "ON" else "OFF"}" + "-DGEANT4_USE_INVENTOR=${if enableInventor then "ON" else "OFF"}" + "-DGEANT4_USE_PYTHON=${if enablePython then "ON" else "OFF"}" + "-DGEANT4_USE_RAYTRACER_X11=${if enableRaytracerX11 then "ON" else "OFF"}" + "-DGEANT4_USE_SYSTEM_CLHEP=ON" + "-DGEANT4_USE_SYSTEM_EXPAT=ON" + "-DGEANT4_USE_SYSTEM_ZLIB=ON" + "-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}" + ] + ++ lib.optionals (enableOpenGLX11 && stdenv.hostPlatform.isDarwin) [ + "-DXQuartzGL_INCLUDE_DIR=${libGLX.dev}/include" + "-DXQuartzGL_gl_LIBRARY=${libGLX}/lib/libGL.dylib" + ] + ++ lib.optionals (enableMultiThreading && enablePython) [ + "-DGEANT4_BUILD_TLS_MODEL=global-dynamic" + ] + ++ lib.optionals enableInventor [ + "-DINVENTOR_INCLUDE_DIR=${coin3d}/include" + "-DINVENTOR_LIBRARY_RELEASE=${coin3d}/lib/libCoin.so" + ]; nativeBuildInputs = [ cmake ]; @@ -102,28 +101,26 @@ stdenv.mkDerivation rec { python3 ]; - propagatedBuildInputs = - [ - clhep - expat - xercesc - zlib - ] - ++ lib.optionals enableOpenGLX11 [ - libGL - libX11 - ] - ++ lib.optionals enableXM [ motif ] - ++ lib.optionals enableQt [ qt5.qtbase ]; + propagatedBuildInputs = [ + clhep + expat + xercesc + zlib + ] + ++ lib.optionals enableOpenGLX11 [ + libGL + libX11 + ] + ++ lib.optionals enableXM [ motif ] + ++ lib.optionals enableQt [ qt5.qtbase ]; - postFixup = - '' - substituteInPlace "$out"/bin/geant4.sh \ - --replace-fail "export GEANT4_DATA_DIR" "# export GEANT4_DATA_DIR" - '' - + lib.optionalString enableQt '' - wrapQtAppsHook - ''; + postFixup = '' + substituteInPlace "$out"/bin/geant4.sh \ + --replace-fail "export GEANT4_DATA_DIR" "# export GEANT4_DATA_DIR" + '' + + lib.optionalString enableQt '' + wrapQtAppsHook + ''; setupHook = ./geant4-hook.sh; diff --git a/pkgs/by-name/ge/gedit/package.nix b/pkgs/by-name/ge/gedit/package.nix index d76cfd91456a..92b370875960 100644 --- a/pkgs/by-name/ge/gedit/package.nix +++ b/pkgs/by-name/ge/gedit/package.nix @@ -51,38 +51,36 @@ stdenv.mkDerivation rec { ./correct-gir-lib-path.patch ]; - nativeBuildInputs = - [ - desktop-file-utils - itstool - libxml2 - meson - ninja - pkg-config - vala - wrapGAppsHook3 - gtk-doc - gobject-introspection - docbook-xsl-nons - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + desktop-file-utils + itstool + libxml2 + meson + ninja + pkg-config + vala + wrapGAppsHook3 + gtk-doc + gobject-introspection + docbook-xsl-nons + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - glib - gsettings-desktop-schemas - gspell - gtk3 - libgedit-amtk - libgedit-gtksourceview - libgedit-tepl - libpeas - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gtk-mac-integration - ]; + buildInputs = [ + glib + gsettings-desktop-schemas + gspell + gtk3 + libgedit-amtk + libgedit-gtksourceview + libgedit-tepl + libpeas + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gtk-mac-integration + ]; # Reliably fails to generate gedit-file-browser-enum-types.h in time enableParallelBuilding = false; diff --git a/pkgs/by-name/ge/gel/package.nix b/pkgs/by-name/ge/gel/package.nix index 353f6745ea98..e3d3056a7f37 100644 --- a/pkgs/by-name/ge/gel/package.nix +++ b/pkgs/by-name/ge/gel/package.nix @@ -35,16 +35,15 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - curl - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xz - ]; + buildInputs = [ + curl + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xz + ]; checkFeatures = [ ]; diff --git a/pkgs/by-name/ge/gemmi/package.nix b/pkgs/by-name/ge/gemmi/package.nix index 64ee05b65a6c..ba1e841b18cb 100644 --- a/pkgs/by-name/ge/gemmi/package.nix +++ b/pkgs/by-name/ge/gemmi/package.nix @@ -21,16 +21,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-T7vmQEP7+3yNkQ7l36xbeLJsm5eYZvt7oRq/ksy6zQU="; }; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals enablePython ( - with python3Packages; - [ - nanobind - python - pythonImportsCheckHook - ] - ); + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals enablePython ( + with python3Packages; + [ + nanobind + python + pythonImportsCheckHook + ] + ); buildInputs = [ zlib ]; diff --git a/pkgs/by-name/ge/gemrb/package.nix b/pkgs/by-name/ge/gemrb/package.nix index aa000df15212..c5f8fb1516bf 100644 --- a/pkgs/by-name/ge/gemrb/package.nix +++ b/pkgs/by-name/ge/gemrb/package.nix @@ -70,7 +70,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optionals (finalAttrs.finalPackage.doCheck or false) [ gtest ]; + ] + ++ lib.optionals (finalAttrs.finalPackage.doCheck or false) [ gtest ]; cmakeFlags = [ (lib.cmakeFeature "DATA_DIR" "${placeholder "out"}/share/gemrb") diff --git a/pkgs/by-name/ge/geoclue2/package.nix b/pkgs/by-name/ge/geoclue2/package.nix index 0abca745cb33..f3f0d0f49d42 100644 --- a/pkgs/by-name/ge/geoclue2/package.nix +++ b/pkgs/by-name/ge/geoclue2/package.nix @@ -49,59 +49,56 @@ stdenv.mkDerivation (finalAttrs: { ./add-option-for-installation-sysconfdir.patch ]; - nativeBuildInputs = - [ - pkg-config - intltool - meson - ninja - wrapGAppsHook3 - python3 - vala - gobject-introspection - # devdoc - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_412 - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + pkg-config + intltool + meson + ninja + wrapGAppsHook3 + python3 + vala + gobject-introspection + # devdoc + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_412 + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - glib - json-glib - libsoup_3 - avahi - ] - ++ lib.optionals withDemoAgent [ - libnotify - gdk-pixbuf - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - modemmanager - ]; + buildInputs = [ + glib + json-glib + libsoup_3 + avahi + ] + ++ lib.optionals withDemoAgent [ + libnotify + gdk-pixbuf + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + modemmanager + ]; propagatedBuildInputs = [ glib glib-networking ]; - mesonFlags = - [ - "-Dsystemd-system-unit-dir=${placeholder "out"}/lib/systemd/system" - "-Ddemo-agent=${lib.boolToString withDemoAgent}" - "--sysconfdir=/etc" - "-Dsysconfdir_install=${placeholder "out"}/etc" - "-Ddbus-srv-user=geoclue" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-D3g-source=false" - "-Dcdma-source=false" - "-Dmodem-gps-source=false" - "-Dnmea-source=false" - ]; + mesonFlags = [ + "-Dsystemd-system-unit-dir=${placeholder "out"}/lib/systemd/system" + "-Ddemo-agent=${lib.boolToString withDemoAgent}" + "--sysconfdir=/etc" + "-Dsysconfdir_install=${placeholder "out"}/etc" + "-Ddbus-srv-user=geoclue" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-D3g-source=false" + "-Dcdma-source=false" + "-Dmodem-gps-source=false" + "-Dnmea-source=false" + ]; postPatch = '' chmod +x demo/install-file.py diff --git a/pkgs/by-name/ge/geocode-glib_2/package.nix b/pkgs/by-name/ge/geocode-glib_2/package.nix index 31fc68259b27..965909a322c1 100644 --- a/pkgs/by-name/ge/geocode-glib_2/package.nix +++ b/pkgs/by-name/ge/geocode-glib_2/package.nix @@ -37,19 +37,18 @@ stdenv.mkDerivation (finalAttrs: { ./installed-tests-path.patch ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - gtk-doc - docbook-xsl-nons - gobject-introspection - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + gtk-doc + docbook-xsl-nons + gobject-introspection + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/ge/geoserver/package.nix b/pkgs/by-name/ge/geoserver/package.nix index dd1194979e00..572a4d044149 100644 --- a/pkgs/by-name/ge/geoserver/package.nix +++ b/pkgs/by-name/ge/geoserver/package.nix @@ -71,15 +71,13 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = lib.lists.unique ( (previousAttrs.buildInputs or [ ]) ++ lib.lists.concatMap (drv: drv.buildInputs) selectedExtensions ); - postInstall = - (previousAttrs.postInstall or "") - + '' - for extension in ${builtins.toString selectedExtensions} ; do - cp -r $extension/* $out - # Some files are the same for all/several extensions. We allow overwriting them again. - chmod -R +w $out - done - ''; + postInstall = (previousAttrs.postInstall or "") + '' + for extension in ${builtins.toString selectedExtensions} ; do + cp -r $extension/* $out + # Some files are the same for all/several extensions. We allow overwriting them again. + chmod -R +w $out + done + ''; } ); tests.geoserver = nixosTests.geoserver; diff --git a/pkgs/by-name/ge/gepetto-viewer/package.nix b/pkgs/by-name/ge/gepetto-viewer/package.nix index 8332b1cbfe5d..ed7eb146f06f 100644 --- a/pkgs/by-name/ge/gepetto-viewer/package.nix +++ b/pkgs/by-name/ge/gepetto-viewer/package.nix @@ -47,17 +47,16 @@ let libsForQt5.qtbase ]; - nativeBuildInputs = - [ - cmake - doxygen - libsForQt5.wrapQtAppsHook - pkg-config - python3Packages.python - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + cmake + doxygen + libsForQt5.wrapQtAppsHook + pkg-config + python3Packages.python + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + darwin.autoSignDarwinBinariesHook + ]; propagatedBuildInputs = [ jrl-cmakemodules diff --git a/pkgs/by-name/ge/gerbera/package.nix b/pkgs/by-name/ge/gerbera/package.nix index 9165d79a5033..9d0fa9389025 100644 --- a/pkgs/by-name/ge/gerbera/package.nix +++ b/pkgs/by-name/ge/gerbera/package.nix @@ -145,7 +145,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ # systemd service will be generated alongside the service "-DWITH_SYSTEMD=OFF" - ] ++ map (e: "-DWITH_${e.name}=${if e.enable then "ON" else "OFF"}") options; + ] + ++ map (e: "-DWITH_${e.name}=${if e.enable then "ON" else "OFF"}") options; nativeBuildInputs = [ cmake @@ -161,7 +162,8 @@ stdenv.mkDerivation rec { sqlite zlib fmt_11 - ] ++ flatten (builtins.catAttrs "packages" (builtins.filter (e: e.enable) options)); + ] + ++ flatten (builtins.catAttrs "packages" (builtins.filter (e: e.enable) options)); passthru.tests = { inherit (nixosTests) mediatomb; }; diff --git a/pkgs/by-name/ge/getdns/package.nix b/pkgs/by-name/ge/getdns/package.nix index 977933b092d0..71395863b39a 100644 --- a/pkgs/by-name/ge/getdns/package.nix +++ b/pkgs/by-name/ge/getdns/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libidn2 openssl - ] ++ lib.optional (!enableStubOnly) unbound; + ] + ++ lib.optional (!enableStubOnly) unbound; cmakeFlags = [ (lib.strings.cmakeBool "ENABLE_STUB_ONLY" enableStubOnly) ]; diff --git a/pkgs/by-name/ge/getdp/package.nix b/pkgs/by-name/ge/getdp/package.nix index 99127704968e..e911a6570942 100644 --- a/pkgs/by-name/ge/getdp/package.nix +++ b/pkgs/by-name/ge/getdp/package.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { blas lapack petsc - ] ++ lib.optional mpiSupport mpi; + ] + ++ lib.optional mpiSupport mpi; cmakeFlags = lib.optional mpiSupport "-DENABLE_MPI=1"; meta = with lib; { diff --git a/pkgs/by-name/ge/getoptions/package.nix b/pkgs/by-name/ge/getoptions/package.nix index 344658b1962a..d70a457a4af8 100644 --- a/pkgs/by-name/ge/getoptions/package.nix +++ b/pkgs/by-name/ge/getoptions/package.nix @@ -31,18 +31,18 @@ stdenvNoCC.mkDerivation rec { mksh yash zsh - ] ++ lib.lists.optional (!stdenvNoCC.hostPlatform.isDarwin) busybox-sandbox-shell; + ] + ++ lib.lists.optional (!stdenvNoCC.hostPlatform.isDarwin) busybox-sandbox-shell; # Disable checks against yash, since shellspec seems to be broken for yash>=2.54 # (see: https://github.com/NixOS/nixpkgs/pull/218264#pullrequestreview-1434402054) - preCheck = - '' - sed -i '/shellspec -s posh/d' Makefile - sed -i '/shellspec -s yash/d' Makefile - '' - + lib.strings.optionalString stdenvNoCC.hostPlatform.isDarwin '' - sed -i "/shellspec -s 'busybox ash'/d" Makefile - ''; + preCheck = '' + sed -i '/shellspec -s posh/d' Makefile + sed -i '/shellspec -s yash/d' Makefile + '' + + lib.strings.optionalString stdenvNoCC.hostPlatform.isDarwin '' + sed -i "/shellspec -s 'busybox ash'/d" Makefile + ''; checkTarget = "test_in_various_shells"; diff --git a/pkgs/by-name/ge/gex/package.nix b/pkgs/by-name/ge/gex/package.nix index d0422f2b142c..9a08905cc97a 100644 --- a/pkgs/by-name/ge/gex/package.nix +++ b/pkgs/by-name/ge/gex/package.nix @@ -26,7 +26,8 @@ rustPlatform.buildRustPackage rec { buildInputs = [ libgit2 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ zlib ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ zlib ]; env = { LIBGIT2_NO_VENDOR = 1; diff --git a/pkgs/by-name/ge/gexiv2/package.nix b/pkgs/by-name/ge/gexiv2/package.nix index 602a9332c4e1..e38d656937cd 100644 --- a/pkgs/by-name/ge/gexiv2/package.nix +++ b/pkgs/by-name/ge/gexiv2/package.nix @@ -32,21 +32,20 @@ stdenv.mkDerivation rec { sha256 = "CRPFPaq6sfGrWGr9VbtVNweW8rirzG43ZAq3cErZnOE="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - vala - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - (python3.pythonOnBuildForHost.withPackages (ps: [ ps.pygobject3 ])) - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + vala + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 + (python3.pythonOnBuildForHost.withPackages (ps: [ ps.pygobject3 ])) + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/gf/gf/package.nix b/pkgs/by-name/gf/gf/package.nix index 8ee246edd7bb..d24d9bf22c1e 100644 --- a/pkgs/by-name/gf/gf/package.nix +++ b/pkgs/by-name/gf/gf/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation { buildInputs = [ libX11 gdb - ] ++ lib.optional freetypeSupport freetype; + ] + ++ lib.optional freetypeSupport freetype; patches = [ ./build-use-optional-freetype-with-pkg-config.patch diff --git a/pkgs/by-name/gf/gfan/package.nix b/pkgs/by-name/gf/gfan/package.nix index a4b202e829da..858fb61b44ea 100644 --- a/pkgs/by-name/gf/gfan/package.nix +++ b/pkgs/by-name/gf/gfan/package.nix @@ -16,25 +16,24 @@ stdenv.mkDerivation rec { sha256 = "02pihqb1lb76a0xbfwjzs1cd6ay3ldfxsm8dvsbl6qs3vkjxax56"; }; - patches = - [ - ./gfan-0.6.2-cddlib-prefix.patch - (fetchpatch { - # removes dead code with invalid member reference in gfanlib - name = "clang-19.patch"; - url = "https://github.com/Singular/Singular/commit/d3f73432d73ac0dd041af83cb35301498e9b57d9.patch"; - stripLen = 2; - extraPrefix = "src/"; - hash = "sha256-jPGMYx/GOFV7Tk3CqaRWeX/UHkzjeL57eZj4r40s8/g="; - }) - ] - ++ lib.optionals (stdenv.cc.isClang) [ - (fetchpatch { - name = "clang-fix-miscompilation.patch"; - url = "https://raw.githubusercontent.com/sagemath/sage/eea1f59394a5066e9acd8ae39a90302820914ee3/build/pkgs/gfan/patches/nodel.patch"; - sha256 = "sha256-RrncSgFyrBIk/Bwe3accxiJ2rpOSJKQ84cV/uBvQsDc="; - }) - ]; + patches = [ + ./gfan-0.6.2-cddlib-prefix.patch + (fetchpatch { + # removes dead code with invalid member reference in gfanlib + name = "clang-19.patch"; + url = "https://github.com/Singular/Singular/commit/d3f73432d73ac0dd041af83cb35301498e9b57d9.patch"; + stripLen = 2; + extraPrefix = "src/"; + hash = "sha256-jPGMYx/GOFV7Tk3CqaRWeX/UHkzjeL57eZj4r40s8/g="; + }) + ] + ++ lib.optionals (stdenv.cc.isClang) [ + (fetchpatch { + name = "clang-fix-miscompilation.patch"; + url = "https://raw.githubusercontent.com/sagemath/sage/eea1f59394a5066e9acd8ae39a90302820914ee3/build/pkgs/gfan/patches/nodel.patch"; + sha256 = "sha256-RrncSgFyrBIk/Bwe3accxiJ2rpOSJKQ84cV/uBvQsDc="; + }) + ]; postPatch = lib.optionalString stdenv.cc.isClang '' substituteInPlace Makefile --replace "-fno-guess-branch-probability" "" diff --git a/pkgs/by-name/gf/gforth/package.nix b/pkgs/by-name/gf/gforth/package.nix index ac3834f5ad3f..28862942a62a 100644 --- a/pkgs/by-name/gf/gforth/package.nix +++ b/pkgs/by-name/gf/gforth/package.nix @@ -37,13 +37,12 @@ stdenv.mkDerivation rec { passthru = { inherit bootForth; }; - configureFlags = - [ - "--with-lispdir=${lispDir}" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - "--build=x86_64-apple-darwin" - ]; + configureFlags = [ + "--with-lispdir=${lispDir}" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + "--build=x86_64-apple-darwin" + ]; preConfigure = '' mkdir -p ${lispDir} diff --git a/pkgs/by-name/gf/gfxstream/package.nix b/pkgs/by-name/gf/gfxstream/package.nix index 8bb81731f3d4..60eaf27d23be 100644 --- a/pkgs/by-name/gf/gfxstream/package.nix +++ b/pkgs/by-name/gf/gfxstream/package.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation (finalAttrs: { vulkan-headers vulkan-loader xorg.libX11 - ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [ libdrm ]; + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [ libdrm ]; env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_LDFLAGS = toString [ diff --git a/pkgs/by-name/gg/gg-jj/package.nix b/pkgs/by-name/gg/gg-jj/package.nix index 6d3a016075eb..d9a668feea32 100644 --- a/pkgs/by-name/gg/gg-jj/package.nix +++ b/pkgs/by-name/gg/gg-jj/package.nix @@ -37,22 +37,22 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-izCl3pE15ocEGYOYCUR1iTR+82nDB06Ed4YOGRGByfI="; }; - nativeBuildInputs = - [ - cargo-tauri.hook - nodejs - npmHooks.npmConfigHook - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + cargo-tauri.hook + nodejs + npmHooks.npmConfigHook + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wrapGAppsHook3 + ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - webkitgtk_4_1 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + webkitgtk_4_1 + ]; env.OPENSSL_NO_VENDOR = true; diff --git a/pkgs/by-name/gh/gh/package.nix b/pkgs/by-name/gh/gh/package.nix index 2af5d3736a3b..157125cca416 100644 --- a/pkgs/by-name/gh/gh/package.nix +++ b/pkgs/by-name/gh/gh/package.nix @@ -31,22 +31,21 @@ buildGoModule rec { runHook postBuild ''; - installPhase = - '' - runHook preInstall - install -Dm755 bin/gh -t $out/bin - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installManPage share/man/*/*.[1-9] + installPhase = '' + runHook preInstall + install -Dm755 bin/gh -t $out/bin + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installManPage share/man/*/*.[1-9] - installShellCompletion --cmd gh \ - --bash <($out/bin/gh completion -s bash) \ - --fish <($out/bin/gh completion -s fish) \ - --zsh <($out/bin/gh completion -s zsh) - '' - + '' - runHook postInstall - ''; + installShellCompletion --cmd gh \ + --bash <($out/bin/gh completion -s bash) \ + --fish <($out/bin/gh completion -s fish) \ + --zsh <($out/bin/gh completion -s zsh) + '' + + '' + runHook postInstall + ''; # most tests require network access doCheck = false; diff --git a/pkgs/by-name/gh/ghdl/package.nix b/pkgs/by-name/gh/ghdl/package.nix index 10fc7f1cf713..c69c0cf14a31 100644 --- a/pkgs/by-name/gh/ghdl/package.nix +++ b/pkgs/by-name/gh/ghdl/package.nix @@ -32,54 +32,49 @@ stdenv.mkDerivation (finalAttrs: { LIBRARY_PATH = "${stdenv.cc.libc}/lib"; - nativeBuildInputs = - [ - gnat - ] - ++ lib.optionals (backend == "gcc") [ - texinfo - makeWrapper - ]; - buildInputs = - [ - zlib - ] - ++ lib.optionals (backend == "llvm") [ - llvm - ] - ++ lib.optionals (backend == "gcc") [ - gmp - mpfr - libmpc - ]; - propagatedBuildInputs = - [ - ] - ++ lib.optionals (backend == "llvm" || backend == "gcc") [ - zlib - ]; + nativeBuildInputs = [ + gnat + ] + ++ lib.optionals (backend == "gcc") [ + texinfo + makeWrapper + ]; + buildInputs = [ + zlib + ] + ++ lib.optionals (backend == "llvm") [ + llvm + ] + ++ lib.optionals (backend == "gcc") [ + gmp + mpfr + libmpc + ]; + propagatedBuildInputs = [ + ] + ++ lib.optionals (backend == "llvm" || backend == "gcc") [ + zlib + ]; - preConfigure = - '' - # If llvm 7.0 works, 7.x releases should work too. - sed -i 's/check_version 7.0/check_version 7/g' configure - '' - + lib.optionalString (backend == "gcc") '' - ${gnutar}/bin/tar -xf ${gcc-unwrapped.src} - ''; + preConfigure = '' + # If llvm 7.0 works, 7.x releases should work too. + sed -i 's/check_version 7.0/check_version 7/g' configure + '' + + lib.optionalString (backend == "gcc") '' + ${gnutar}/bin/tar -xf ${gcc-unwrapped.src} + ''; - configureFlags = - [ - # See https://github.com/ghdl/ghdl/pull/2058 - "--disable-werror" - "--enable-synth" - ] - ++ lib.optionals (backend == "llvm") [ - "--with-llvm-config=${llvm.dev}/bin/llvm-config" - ] - ++ lib.optionals (backend == "gcc") [ - "--with-gcc=gcc-${gcc-unwrapped.version}" - ]; + configureFlags = [ + # See https://github.com/ghdl/ghdl/pull/2058 + "--disable-werror" + "--enable-synth" + ] + ++ lib.optionals (backend == "llvm") [ + "--with-llvm-config=${llvm.dev}/bin/llvm-config" + ] + ++ lib.optionals (backend == "gcc") [ + "--with-gcc=gcc-${gcc-unwrapped.version}" + ]; buildPhase = lib.optionalString (backend == "gcc") '' make copy-sources @@ -111,13 +106,12 @@ stdenv.mkDerivation (finalAttrs: { } ''; - hardeningDisable = - [ - ] - ++ lib.optionals (backend == "gcc") [ - # GCC compilation fails with format errors - "format" - ]; + hardeningDisable = [ + ] + ++ lib.optionals (backend == "gcc") [ + # GCC compilation fails with format errors + "format" + ]; enableParallelBuilding = true; @@ -141,7 +135,6 @@ stdenv.mkDerivation (finalAttrs: { thoughtpolice ]; platforms = - lib.platforms.linux - ++ lib.optionals (backend == "mcode" || backend == "llvm") [ "x86_64-darwin" ]; + lib.platforms.linux ++ lib.optionals (backend == "mcode" || backend == "llvm") [ "x86_64-darwin" ]; }; }) diff --git a/pkgs/by-name/gh/ghdl/test-simple.nix b/pkgs/by-name/gh/ghdl/test-simple.nix index 66c81977bf77..f83891172d28 100644 --- a/pkgs/by-name/gh/ghdl/test-simple.nix +++ b/pkgs/by-name/gh/ghdl/test-simple.nix @@ -19,25 +19,24 @@ stdenv.mkDerivation { name = "ghdl-test-simple"; meta.timeout = 300; nativeBuildInputs = [ ghdl ]; - buildCommand = - '' - cp ${./simple.vhd} simple.vhd - cp ${./simple-tb.vhd} simple-tb.vhd - mkdir -p ghdlwork - ghdl -a --workdir=ghdlwork --ieee=synopsys simple.vhd simple-tb.vhd - ghdl -e --workdir=ghdlwork --ieee=synopsys -o sim-simple tb - '' - + ( - if backend == "llvm" || backend == "gcc" then - '' - ./sim-simple --assert-level=warning > output.txt - '' - else - '' - ghdl -r --workdir=ghdlwork --ieee=synopsys tb > output.txt - '' - ) - + '' - diff output.txt ${./expected-output.txt} && touch $out - ''; + buildCommand = '' + cp ${./simple.vhd} simple.vhd + cp ${./simple-tb.vhd} simple-tb.vhd + mkdir -p ghdlwork + ghdl -a --workdir=ghdlwork --ieee=synopsys simple.vhd simple-tb.vhd + ghdl -e --workdir=ghdlwork --ieee=synopsys -o sim-simple tb + '' + + ( + if backend == "llvm" || backend == "gcc" then + '' + ./sim-simple --assert-level=warning > output.txt + '' + else + '' + ghdl -r --workdir=ghdlwork --ieee=synopsys tb > output.txt + '' + ) + + '' + diff output.txt ${./expected-output.txt} && touch $out + ''; } diff --git a/pkgs/by-name/gh/ghex/package.nix b/pkgs/by-name/gh/ghex/package.nix index 862c31e12173..9f76418519e7 100644 --- a/pkgs/by-name/gh/ghex/package.nix +++ b/pkgs/by-name/gh/ghex/package.nix @@ -54,15 +54,14 @@ stdenv.mkDerivation (finalAttrs: { glib ]; - mesonFlags = - [ - "-Dgtk_doc=true" - "-Dvapi=true" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # mremap does not exist on darwin - "-Dmmap-buffer-backend=false" - ]; + mesonFlags = [ + "-Dgtk_doc=true" + "-Dvapi=true" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # mremap does not exist on darwin + "-Dmmap-buffer-backend=false" + ]; postFixup = '' # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. diff --git a/pkgs/by-name/gh/ghostscript/package.nix b/pkgs/by-name/gh/ghostscript/package.nix index f663327ee3f5..9fac60a8c5f7 100644 --- a/pkgs/by-name/gh/ghostscript/package.nix +++ b/pkgs/by-name/gh/ghostscript/package.nix @@ -97,91 +97,88 @@ stdenv.mkDerivation rec { buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - pkg-config - autoconf - zlib - ] - ++ lib.optional cupsSupport cups - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + nativeBuildInputs = [ + pkg-config + autoconf + zlib + ] + ++ lib.optional cupsSupport cups + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = - [ - zlib - expat - openssl - libjpeg - libpng - libtiff - freetype - fontconfig - libpaper - jbig2dec - libiconv - ijs - lcms2 - bash - openjpeg - ] - ++ lib.optionals x11Support [ - xorg.libICE - xorg.libX11 - xorg.libXext - xorg.libXt - ] - ++ lib.optional cupsSupport cups; + buildInputs = [ + zlib + expat + openssl + libjpeg + libpng + libtiff + freetype + fontconfig + libpaper + jbig2dec + libiconv + ijs + lcms2 + bash + openjpeg + ] + ++ lib.optionals x11Support [ + xorg.libICE + xorg.libX11 + xorg.libXext + xorg.libXt + ] + ++ lib.optional cupsSupport cups; - preConfigure = - '' - # https://ghostscript.com/doc/current/Make.htm - export CCAUX=$CC_FOR_BUILD - ${lib.optionalString cupsSupport ''export CUPSCONFIG="${cups.dev}/bin/cups-config"''} + preConfigure = '' + # https://ghostscript.com/doc/current/Make.htm + export CCAUX=$CC_FOR_BUILD + ${lib.optionalString cupsSupport ''export CUPSCONFIG="${cups.dev}/bin/cups-config"''} - rm -rf jpeg libpng zlib jasper expat tiff lcms2mt jbig2dec freetype cups/libs ijs openjpeg + rm -rf jpeg libpng zlib jasper expat tiff lcms2mt jbig2dec freetype cups/libs ijs openjpeg - sed "s@if ( test -f \$(INCLUDE)[^ ]* )@if ( true )@; s@INCLUDE=/usr/include@INCLUDE=/no-such-path@" -i base/unix-aux.mak - sed "s@^ZLIBDIR=.*@ZLIBDIR=${zlib.dev}/include@" -i configure.ac + sed "s@if ( test -f \$(INCLUDE)[^ ]* )@if ( true )@; s@INCLUDE=/usr/include@INCLUDE=/no-such-path@" -i base/unix-aux.mak + sed "s@^ZLIBDIR=.*@ZLIBDIR=${zlib.dev}/include@" -i configure.ac - # Sidestep a bug in autoconf-2.69 that sets the compiler for all checks to - # $CXX after the part for the vendored copy of tesseract. - # `--without-tesseract` is already passed to the outer ./configure, here we - # make sure it is also passed to its recursive invocation for buildPlatform - # checks when cross-compiling. - substituteInPlace configure.ac \ - --replace-fail "--without-x" "--without-x --without-tesseract" + # Sidestep a bug in autoconf-2.69 that sets the compiler for all checks to + # $CXX after the part for the vendored copy of tesseract. + # `--without-tesseract` is already passed to the outer ./configure, here we + # make sure it is also passed to its recursive invocation for buildPlatform + # checks when cross-compiling. + substituteInPlace configure.ac \ + --replace-fail "--without-x" "--without-x --without-tesseract" - autoconf - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export DARWIN_LDFLAGS_SO_PREFIX=$out/lib/ - ''; + autoconf + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export DARWIN_LDFLAGS_SO_PREFIX=$out/lib/ + ''; - configureFlags = - [ - "--with-system-libtiff" - "--without-tesseract" - ] - ++ lib.optionals dynamicDrivers [ - "--enable-dynamic" - "--disable-hidden-visibility" - ] - ++ lib.optionals x11Support [ - "--with-x" - ] - ++ lib.optionals cupsSupport [ - "--enable-cups" - ]; + configureFlags = [ + "--with-system-libtiff" + "--without-tesseract" + ] + ++ lib.optionals dynamicDrivers [ + "--enable-dynamic" + "--disable-hidden-visibility" + ] + ++ lib.optionals x11Support [ + "--with-x" + ] + ++ lib.optionals cupsSupport [ + "--enable-cups" + ]; # make check does nothing useful doCheck = false; # don't build/install statically linked bin/gs - buildFlags = - [ "so" ] - # without -headerpad, the following error occurs on Darwin when compiling with X11 support (as of 10.02.0) - # error: install_name_tool: changing install names or rpaths can't be redone for: [...]libgs.dylib.10 (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names) - ++ lib.optional (x11Support && stdenv.hostPlatform.isDarwin) "LDFLAGS=-headerpad_max_install_names"; + buildFlags = [ + "so" + ] + # without -headerpad, the following error occurs on Darwin when compiling with X11 support (as of 10.02.0) + # error: install_name_tool: changing install names or rpaths can't be redone for: [...]libgs.dylib.10 (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names) + ++ lib.optional (x11Support && stdenv.hostPlatform.isDarwin) "LDFLAGS=-headerpad_max_install_names"; installTargets = [ "soinstall" ]; postInstall = '' diff --git a/pkgs/by-name/gh/ghostty/package.nix b/pkgs/by-name/gh/ghostty/package.nix index da7bb441965f..c794bf16ee2e 100644 --- a/pkgs/by-name/gh/ghostty/package.nix +++ b/pkgs/by-name/gh/ghostty/package.nix @@ -65,48 +65,45 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - ncurses - pandoc - pkg-config - removeReferencesTo - zig_hook - ] - ++ lib.optionals (appRuntime == "gtk") [ - glib # Required for `glib-compile-schemas` - wrapGAppsHook4 - ]; + nativeBuildInputs = [ + ncurses + pandoc + pkg-config + removeReferencesTo + zig_hook + ] + ++ lib.optionals (appRuntime == "gtk") [ + glib # Required for `glib-compile-schemas` + wrapGAppsHook4 + ]; - buildInputs = - [ - glslang - oniguruma - ] - ++ lib.optional (appRuntime == "gtk" && withAdwaita) libadwaita - ++ lib.optional (appRuntime == "gtk") libX11 - ++ lib.optional (renderer == "opengl") libGL - ++ lib.optionals (fontBackend == "fontconfig_freetype") [ - bzip2 - fontconfig - freetype - harfbuzz - ]; + buildInputs = [ + glslang + oniguruma + ] + ++ lib.optional (appRuntime == "gtk" && withAdwaita) libadwaita + ++ lib.optional (appRuntime == "gtk") libX11 + ++ lib.optional (renderer == "opengl") libGL + ++ lib.optionals (fontBackend == "fontconfig_freetype") [ + bzip2 + fontconfig + freetype + harfbuzz + ]; - zigBuildFlags = - [ - "--system" - "${finalAttrs.deps}" - "-Dversion-string=${finalAttrs.version}" + zigBuildFlags = [ + "--system" + "${finalAttrs.deps}" + "-Dversion-string=${finalAttrs.version}" - "-Dapp-runtime=${appRuntime}" - "-Dfont-backend=${fontBackend}" - "-Dgtk-adwaita=${lib.boolToString withAdwaita}" - "-Drenderer=${renderer}" - ] - ++ lib.mapAttrsToList (name: package: "-fsys=${name} --search-prefix ${lib.getLib package}") { - inherit glslang; - }; + "-Dapp-runtime=${appRuntime}" + "-Dfont-backend=${fontBackend}" + "-Dgtk-adwaita=${lib.boolToString withAdwaita}" + "-Drenderer=${renderer}" + ] + ++ lib.mapAttrsToList (name: package: "-fsys=${name} --search-prefix ${lib.getLib package}") { + inherit glslang; + }; zigCheckFlags = finalAttrs.zigBuildFlags; diff --git a/pkgs/by-name/gi/gImageReader/package.nix b/pkgs/by-name/gi/gImageReader/package.nix index b3fec01f2d3d..60a6533f7935 100644 --- a/pkgs/by-name/gi/gImageReader/package.nix +++ b/pkgs/by-name/gi/gImageReader/package.nix @@ -59,43 +59,44 @@ stdenv.mkDerivation rec { enchant gobject-introspection wrapGAppsHook3 - ] ++ lib.optionals withQt6 [ qt6Packages.wrapQtAppsHook ]; + ] + ++ lib.optionals withQt6 [ qt6Packages.wrapQtAppsHook ]; - buildInputs = + buildInputs = [ + libxmlxx3 + libzip + libuuid + sane-backends + podofo_0_10 + libjpeg + djvulibre + tesseract + poppler + doxygen + cairomm + gtkmm3 + gtksourceview3 + gtksourceviewmm + gtkspell3 + gtkspellmm + json-glib + ] + ++ lib.optionals withQt6 ( + with qt6Packages; [ - libxmlxx3 - libzip - libuuid - sane-backends - podofo_0_10 - libjpeg - djvulibre - tesseract - poppler - doxygen - cairomm - gtkmm3 - gtksourceview3 - gtksourceviewmm - gtkspell3 - gtkspellmm - json-glib + kdePackages.poppler + qtbase + qtspell + qttools + quazip ] - ++ lib.optionals withQt6 ( - with qt6Packages; - [ - kdePackages.poppler - qtbase - qtspell - qttools - quazip - ] - ); + ); # interface type can be where is either gtk, qt6 cmakeFlags = [ "-DINTERFACE_TYPE=gtk" - ] ++ lib.optionals withQt6 [ "-DINTERFACE_TYPE=qt6 -DQT_VER=6" ]; + ] + ++ lib.optionals withQt6 [ "-DINTERFACE_TYPE=qt6 -DQT_VER=6" ]; meta = with lib; { description = "Simple Gtk/Qt front-end to tesseract-ocr"; diff --git a/pkgs/by-name/gi/giac/package.nix b/pkgs/by-name/gi/giac/package.nix index cf218da403a0..410cae74a7e2 100644 --- a/pkgs/by-name/gi/giac/package.nix +++ b/pkgs/by-name/gi/giac/package.nix @@ -45,50 +45,49 @@ stdenv.mkDerivation rec { sha256 = "sha256-pqytFWrSWfEwQqRdRbaigGCq68s8mdgj2j8M+kclslE="; }; - patches = - [ - ./remove-old-functional-patterns.patch - ./fix-fltk-guard.patch + patches = [ + ./remove-old-functional-patterns.patch + ./fix-fltk-guard.patch - (fetchpatch { - name = "pari_2_15.patch"; - url = "https://raw.githubusercontent.com/sagemath/sage/07a2afd65fb4b0a1c9cbc43ede7d4a18c921a000/build/pkgs/giac/patches/pari_2_15.patch"; - sha256 = "sha256-Q3xBFED7XEAyNz6AHjzt63XtospmdGAIdS6iPq1C2UE="; - }) + (fetchpatch { + name = "pari_2_15.patch"; + url = "https://raw.githubusercontent.com/sagemath/sage/07a2afd65fb4b0a1c9cbc43ede7d4a18c921a000/build/pkgs/giac/patches/pari_2_15.patch"; + sha256 = "sha256-Q3xBFED7XEAyNz6AHjzt63XtospmdGAIdS6iPq1C2UE="; + }) - (fetchpatch { - name = "infinity.patch"; - url = "https://github.com/geogebra/giac/commit/851c2cd91e879c79d6652f8a5d5bed03b65c6d39.patch"; - sha256 = "sha256-WJRT2b8I9kgAkRuIugMiXoF4hT7yR7qyad8A6IspNTM="; - stripLen = 5; - extraPrefix = "/src/"; - excludes = [ "src/kdisplay.cc" ]; - }) + (fetchpatch { + name = "infinity.patch"; + url = "https://github.com/geogebra/giac/commit/851c2cd91e879c79d6652f8a5d5bed03b65c6d39.patch"; + sha256 = "sha256-WJRT2b8I9kgAkRuIugMiXoF4hT7yR7qyad8A6IspNTM="; + stripLen = 5; + extraPrefix = "/src/"; + excludes = [ "src/kdisplay.cc" ]; + }) - # giac calls scanf/printf with non-constant first arguments, which - # the compiler rightfully warns about (with an error nowadays). - (fetchpatch { - name = "fix-string-compiler-error.patch"; - url = "https://salsa.debian.org/science-team/giac/-/raw/9ca8dbf4bb16d9d96948aa4024326d32485d7917/debian/patches/fix-string-compiler-error.patch"; - sha256 = "sha256-r+M+9MRPRqhHcdhYWI6inxyNvWbXUbBcPCeDY7aulvk="; - }) + # giac calls scanf/printf with non-constant first arguments, which + # the compiler rightfully warns about (with an error nowadays). + (fetchpatch { + name = "fix-string-compiler-error.patch"; + url = "https://salsa.debian.org/science-team/giac/-/raw/9ca8dbf4bb16d9d96948aa4024326d32485d7917/debian/patches/fix-string-compiler-error.patch"; + sha256 = "sha256-r+M+9MRPRqhHcdhYWI6inxyNvWbXUbBcPCeDY7aulvk="; + }) - # issue with include path precedence - (fetchpatch { - name = "fix_implicit_declaration.patch"; - url = "https://salsa.debian.org/science-team/giac/-/raw/c05ae9b9e74d3c6ee6411d391071989426a76201/debian/patches/fix_implicit_declaration.patch"; - sha256 = "sha256-ompUceYJLiL0ftfjBkIMcYvX1YqG2/XA7e1yDyFY0IY="; - }) - ] - ++ lib.optionals (!enableGUI) [ - # when enableGui is false, giac is compiled without fltk. That - # means some outputs differ in the make check. Patch around this: - (fetchpatch { - name = "nofltk-check.patch"; - url = "https://raw.githubusercontent.com/sagemath/sage/7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26/build/pkgs/giac/patches/nofltk-check.patch"; - sha256 = "sha256-nAl5q3ufLjK3X9s0qMlGNowdRRf3EaC24eVtJABzdXY="; - }) - ]; + # issue with include path precedence + (fetchpatch { + name = "fix_implicit_declaration.patch"; + url = "https://salsa.debian.org/science-team/giac/-/raw/c05ae9b9e74d3c6ee6411d391071989426a76201/debian/patches/fix_implicit_declaration.patch"; + sha256 = "sha256-ompUceYJLiL0ftfjBkIMcYvX1YqG2/XA7e1yDyFY0IY="; + }) + ] + ++ lib.optionals (!enableGUI) [ + # when enableGui is false, giac is compiled without fltk. That + # means some outputs differ in the make check. Patch around this: + (fetchpatch { + name = "nofltk-check.patch"; + url = "https://raw.githubusercontent.com/sagemath/sage/7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26/build/pkgs/giac/patches/nofltk-check.patch"; + sha256 = "sha256-nAl5q3ufLjK3X9s0qMlGNowdRRf3EaC24eVtJABzdXY="; + }) + ]; # 1.9.0-5's tarball contains a binary (src/mkjs) which is executed # at build time. we will delete and rebuild it. @@ -114,36 +113,35 @@ stdenv.mkDerivation rec { ]; # perl is only needed for patchShebangs fixup. - buildInputs = - [ - gmp - mpfr - pari - ntl - gsl - blas - mpfi - glpk - nauty - readline - gettext - libpng - libao - perl - ecm - # gfortran.cc default output contains static libraries compiled without -fPIC - # we want libgfortran.so.3 instead - (lib.getLib gfortran.cc) - lapack - blas - ] - ++ lib.optionals enableGUI [ - libGL - libGLU - fltk - xorg.libX11 - ] - ++ lib.optional enableMicroPy python3; + buildInputs = [ + gmp + mpfr + pari + ntl + gsl + blas + mpfi + glpk + nauty + readline + gettext + libpng + libao + perl + ecm + # gfortran.cc default output contains static libraries compiled without -fPIC + # we want libgfortran.so.3 instead + (lib.getLib gfortran.cc) + lapack + blas + ] + ++ lib.optionals enableGUI [ + libGL + libGLU + fltk + xorg.libX11 + ] + ++ lib.optional enableMicroPy python3; # xcas Phys and Turtle menus are broken with split outputs # and interactive use is likely to need docs @@ -168,58 +166,56 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - configureFlags = - [ - "--enable-gc" - "--enable-png" - "--enable-gsl" - "--enable-lapack" - "--enable-pari" - "--enable-ntl" - "--enable-gmpxx" # "--enable-cocoa" - "--enable-ao" - "--enable-ecm" - "--enable-glpk" - ] - ++ lib.optionals enableGUI [ - "--enable-gui" - "--with-x" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--disable-nls" - ] - ++ lib.optionals (!enableGUI) [ - "--disable-fltk" - ] - ++ lib.optionals (!enableMicroPy) [ - "--disable-micropy" - ]; + configureFlags = [ + "--enable-gc" + "--enable-png" + "--enable-gsl" + "--enable-lapack" + "--enable-pari" + "--enable-ntl" + "--enable-gmpxx" # "--enable-cocoa" + "--enable-ao" + "--enable-ecm" + "--enable-glpk" + ] + ++ lib.optionals enableGUI [ + "--enable-gui" + "--with-x" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--disable-nls" + ] + ++ lib.optionals (!enableGUI) [ + "--disable-fltk" + ] + ++ lib.optionals (!enableMicroPy) [ + "--disable-micropy" + ]; - postInstall = - '' - # example Makefiles contain the full path to some commands - # notably texlive, and we don't want texlive to become a runtime - # dependency - for file in $(find $out -name Makefile) ; do - sed -i "s@${builtins.storeDir}/[^/]*/bin/@@" "$file" ; - done; + postInstall = '' + # example Makefiles contain the full path to some commands + # notably texlive, and we don't want texlive to become a runtime + # dependency + for file in $(find $out -name Makefile) ; do + sed -i "s@${builtins.storeDir}/[^/]*/bin/@@" "$file" ; + done; - # reference cycle - rm "$out/share/giac/doc/el/"{casinter,tutoriel}/Makefile + # reference cycle + rm "$out/share/giac/doc/el/"{casinter,tutoriel}/Makefile - if [ -n "$doc" ]; then - mkdir -p "$doc/share/giac" - # $out/share/giac/doc/aide_cas is a symlink to ../aide_cas - mv "$out/share/giac/doc" "$doc/share/giac" - ln -sf "$out/share/giac/aide_cas" "$doc/share/giac/doc/aide_cas" - mv "$out/share/giac/examples" "$doc/share/giac" - fi - '' - + lib.optionalString (!enableGUI) '' - for i in pixmaps application-registry applications icons; do - rm -r "$out/share/$i"; - done; - ''; + if [ -n "$doc" ]; then + mkdir -p "$doc/share/giac" + # $out/share/giac/doc/aide_cas is a symlink to ../aide_cas + mv "$out/share/giac/doc" "$doc/share/giac" + ln -sf "$out/share/giac/aide_cas" "$doc/share/giac/doc/aide_cas" + mv "$out/share/giac/examples" "$doc/share/giac" + fi + '' + + lib.optionalString (!enableGUI) '' + for i in pixmaps application-registry applications icons; do + rm -r "$out/share/$i"; + done; + ''; meta = with lib; { description = "Free computer algebra system (CAS)"; diff --git a/pkgs/by-name/gi/giada/package.nix b/pkgs/by-name/gi/giada/package.nix index 87412743d1bf..0f634b1d889e 100644 --- a/pkgs/by-name/gi/giada/package.nix +++ b/pkgs/by-name/gi/giada/package.nix @@ -54,33 +54,32 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - alsa-lib - curl - expat - flac - fltk - fmt - gtk3 - jack2 - libGL - libXpm - libXrandr - libogg - libopus - libpulseaudio - libsamplerate - libsndfile - libvorbis - libmpg123 - nlohmann_json - rtmidi - webkitgtk_4_1 - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isFreeBSD) [ - fontconfig - ]; + buildInputs = [ + alsa-lib + curl + expat + flac + fltk + fmt + gtk3 + jack2 + libGL + libXpm + libXrandr + libogg + libopus + libpulseaudio + libsamplerate + libsndfile + libvorbis + libmpg123 + nlohmann_json + rtmidi + webkitgtk_4_1 + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isFreeBSD) [ + fontconfig + ]; meta = { description = "Free, minimal, hardcore audio tool for DJs, live performers and electronic musicians"; diff --git a/pkgs/by-name/gi/giflib/package.nix b/pkgs/by-name/gi/giflib/package.nix index b1c4a62a2ee4..bf6a84007ab8 100644 --- a/pkgs/by-name/gi/giflib/package.nix +++ b/pkgs/by-name/gi/giflib/package.nix @@ -15,21 +15,20 @@ stdenv.mkDerivation rec { hash = "sha256-vn/70FfK3r4qoURUL9kMaDjGoIO16KkEi47jtmsp1fs="; }; - patches = - [ - ./CVE-2021-40633.patch - ./CVE-2025-31344.patch - ] - ++ lib.optionals stdenv.hostPlatform.isMinGW [ - # Build dll libraries. - (fetchurl { - url = "https://aur.archlinux.org/cgit/aur.git/plain/001-mingw-build.patch?h=mingw-w64-giflib&id=b7311edf54824ac797c7916cd3ddc3a4b2368a19"; - hash = "sha256-bBx7lw7FWtxZJ+E9AAbKIpCGcJnS5lrGpjYcv/zBtKk="; - }) + patches = [ + ./CVE-2021-40633.patch + ./CVE-2025-31344.patch + ] + ++ lib.optionals stdenv.hostPlatform.isMinGW [ + # Build dll libraries. + (fetchurl { + url = "https://aur.archlinux.org/cgit/aur.git/plain/001-mingw-build.patch?h=mingw-w64-giflib&id=b7311edf54824ac797c7916cd3ddc3a4b2368a19"; + hash = "sha256-bBx7lw7FWtxZJ+E9AAbKIpCGcJnS5lrGpjYcv/zBtKk="; + }) - # Install executables. - ./mingw-install-exes.patch - ]; + # Install executables. + ./mingw-install-exes.patch + ]; nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames @@ -39,20 +38,19 @@ stdenv.mkDerivation rec { "PREFIX=${builtins.placeholder "out"}" ]; - postPatch = - '' - # we don't want to build HTML documentation - substituteInPlace doc/Makefile \ - --replace-fail "all: allhtml manpages" "all: manpages" - '' - + lib.optionalString stdenv.hostPlatform.isStatic '' - # Upstream build system does not support NOT building shared libraries. - sed -i '/all:/ s/$(LIBGIFSO)//' Makefile - sed -i '/all:/ s/$(LIBUTILSO)//' Makefile - sed -i '/-m 755 $(LIBGIFSO)/ d' Makefile - sed -i '/ln -sf $(LIBGIFSOVER)/ d' Makefile - sed -i '/ln -sf $(LIBGIFSOMAJOR)/ d' Makefile - ''; + postPatch = '' + # we don't want to build HTML documentation + substituteInPlace doc/Makefile \ + --replace-fail "all: allhtml manpages" "all: manpages" + '' + + lib.optionalString stdenv.hostPlatform.isStatic '' + # Upstream build system does not support NOT building shared libraries. + sed -i '/all:/ s/$(LIBGIFSO)//' Makefile + sed -i '/all:/ s/$(LIBUTILSO)//' Makefile + sed -i '/-m 755 $(LIBGIFSO)/ d' Makefile + sed -i '/ln -sf $(LIBGIFSOVER)/ d' Makefile + sed -i '/ln -sf $(LIBGIFSOMAJOR)/ d' Makefile + ''; passthru.tests = { static = pkgsStatic.giflib; diff --git a/pkgs/by-name/gi/gildas/package.nix b/pkgs/by-name/gi/gildas/package.nix index ea7c307ee290..9956ddef9fb6 100644 --- a/pkgs/by-name/gi/gildas/package.nix +++ b/pkgs/by-name/gi/gildas/package.nix @@ -54,12 +54,13 @@ stdenv.mkDerivation rec { ncurses ]; - patches = - [ ./wrapper.patch ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./clang.patch - ./cpp-darwin.patch - ]; + patches = [ + ./wrapper.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./clang.patch + ./cpp-darwin.patch + ]; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; diff --git a/pkgs/by-name/gi/git-absorb/package.nix b/pkgs/by-name/gi/git-absorb/package.nix index 4cbe68946f74..88bdf0a0b973 100644 --- a/pkgs/by-name/gi/git-absorb/package.nix +++ b/pkgs/by-name/gi/git-absorb/package.nix @@ -33,19 +33,18 @@ rustPlatform.buildRustPackage rec { gitMinimal ]; - postInstall = - '' - cd Documentation/ - make - installManPage git-absorb.1 - cd - - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd git-absorb \ - --bash <($out/bin/git-absorb --gen-completions bash) \ - --fish <($out/bin/git-absorb --gen-completions fish) \ - --zsh <($out/bin/git-absorb --gen-completions zsh) - ''; + postInstall = '' + cd Documentation/ + make + installManPage git-absorb.1 + cd - + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd git-absorb \ + --bash <($out/bin/git-absorb --gen-completions bash) \ + --fish <($out/bin/git-absorb --gen-completions fish) \ + --zsh <($out/bin/git-absorb --gen-completions zsh) + ''; meta = with lib; { homepage = "https://github.com/tummychow/git-absorb"; diff --git a/pkgs/by-name/gi/git-buildpackage/package.nix b/pkgs/by-name/gi/git-buildpackage/package.nix index 3c17e4c280e7..1c23f7cc4dae 100644 --- a/pkgs/by-name/gi/git-buildpackage/package.nix +++ b/pkgs/by-name/gi/git-buildpackage/package.nix @@ -45,39 +45,37 @@ python3Packages.buildPythonApplication rec { "gbp" ]; - nativeCheckInputs = - [ - debian-devscripts - dpkg - gitMinimal - gitSetupHook - man - ] - ++ (with python3Packages; [ - coverage - pytest-cov - pytestCheckHook - pyyaml - rpm - ]); + nativeCheckInputs = [ + debian-devscripts + dpkg + gitMinimal + gitSetupHook + man + ] + ++ (with python3Packages; [ + coverage + pytest-cov + pytestCheckHook + pyyaml + rpm + ]); - disabledTests = - [ - # gbp.command_wrappers.CommandExecFailed: - # Couldn't commit to 'pristine-tar' with upstream 'upstream': - # execution failed: [Errno 2] No such file or directory: 'pristine-tar' - "tests.doctests.test_PristineTar.test_pristine_tar" + disabledTests = [ + # gbp.command_wrappers.CommandExecFailed: + # Couldn't commit to 'pristine-tar' with upstream 'upstream': + # execution failed: [Errno 2] No such file or directory: 'pristine-tar' + "tests.doctests.test_PristineTar.test_pristine_tar" - # When gitMinimal is used instead of git: - # UNEXPECTED EXCEPTION: GitRepositoryError("Invalid git command 'branch': No manual entry for git-branch") - "tests.doctests.test_GitRepository.test_repo" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # gbp.git.repository.GitRepositoryError: - # Cannot create Git repository at '/does/not/exist': - # [Errno 30] Read-only file system: '/does' - "tests.doctests.test_GitRepository.test_create_noperm" - ]; + # When gitMinimal is used instead of git: + # UNEXPECTED EXCEPTION: GitRepositoryError("Invalid git command 'branch': No manual entry for git-branch") + "tests.doctests.test_GitRepository.test_repo" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # gbp.git.repository.GitRepositoryError: + # Cannot create Git repository at '/does/not/exist': + # [Errno 30] Read-only file system: '/does' + "tests.doctests.test_GitRepository.test_create_noperm" + ]; meta = { description = "Suite to help with maintaining Debian packages in Git repositories"; diff --git a/pkgs/by-name/gi/git-cola/package.nix b/pkgs/by-name/gi/git-cola/package.nix index cf9f2f170226..8dc673fa23ce 100644 --- a/pkgs/by-name/gi/git-cola/package.nix +++ b/pkgs/by-name/gi/git-cola/package.nix @@ -26,22 +26,24 @@ python3Packages.buildPythonApplication rec { buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ qt5.qtwayland ]; - propagatedBuildInputs = - [ git ] - ++ (with python3Packages; [ - setuptools - pyqt5 - qtpy - send2trash - polib - ]); + propagatedBuildInputs = [ + git + ] + ++ (with python3Packages; [ + setuptools + pyqt5 + qtpy + send2trash + polib + ]); nativeBuildInputs = [ gettext qt5.wrapQtAppsHook python3Packages.setuptools-scm imagemagick - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; nativeCheckInputs = [ git @@ -54,7 +56,8 @@ python3Packages.buildPythonApplication rec { disabledTestPaths = [ "qtpy/" "contrib/win32" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "cola/inotify.py" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "cola/inotify.py" ]; preFixup = '' makeWrapperArgs+=("''${qtWrapperArgs[@]}") diff --git a/pkgs/by-name/gi/git-lfs/package.nix b/pkgs/by-name/gi/git-lfs/package.nix index 42d7b2b17abc..b73a41617b04 100644 --- a/pkgs/by-name/gi/git-lfs/package.nix +++ b/pkgs/by-name/gi/git-lfs/package.nix @@ -81,16 +81,15 @@ buildGoModule rec { [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ] ); - postInstall = - '' - installManPage man/man*/* - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd git-lfs \ - --bash <($out/bin/git-lfs completion bash) \ - --fish <($out/bin/git-lfs completion fish) \ - --zsh <($out/bin/git-lfs completion zsh) - ''; + postInstall = '' + installManPage man/man*/* + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd git-lfs \ + --bash <($out/bin/git-lfs completion bash) \ + --fish <($out/bin/git-lfs completion fish) \ + --zsh <($out/bin/git-lfs completion zsh) + ''; nativeInstallCheckInputs = [ versionCheckHook diff --git a/pkgs/by-name/gi/git-machete/package.nix b/pkgs/by-name/gi/git-machete/package.nix index 06fd09c38bec..51db5daeba06 100644 --- a/pkgs/by-name/gi/git-machete/package.nix +++ b/pkgs/by-name/gi/git-machete/package.nix @@ -23,14 +23,13 @@ python3.pkgs.buildPythonApplication rec { nativeBuildInputs = [ installShellFiles ]; - nativeCheckInputs = - [ - git - ] - ++ (with python3.pkgs; [ - pytest-mock - pytestCheckHook - ]); + nativeCheckInputs = [ + git + ] + ++ (with python3.pkgs; [ + pytest-mock + pytestCheckHook + ]); disabledTests = [ # Requires fully functioning shells including zsh modules and bash diff --git a/pkgs/by-name/gi/git-quickfix/package.nix b/pkgs/by-name/gi/git-quickfix/package.nix index def39e31894d..3223e5e9ada0 100644 --- a/pkgs/by-name/gi/git-quickfix/package.nix +++ b/pkgs/by-name/gi/git-quickfix/package.nix @@ -23,12 +23,13 @@ rustPlatform.buildRustPackage rec { doCheck = false; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - zlib - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + zlib + ]; useFetchCargoVendor = true; cargoHash = "sha256-2VhbvhGeQHAbQLW0iBAgl0ICAX/X+PnwcGdodJG2Hsw="; diff --git a/pkgs/by-name/gi/git-remote-codecommit/package.nix b/pkgs/by-name/gi/git-remote-codecommit/package.nix index 6e929ec79877..db165d5487d6 100644 --- a/pkgs/by-name/gi/git-remote-codecommit/package.nix +++ b/pkgs/by-name/gi/git-remote-codecommit/package.nix @@ -29,16 +29,15 @@ python3Packages.buildPythonApplication rec { dependencies = with python3Packages; [ botocore ]; - nativeCheckInputs = - [ - awscli - ] - ++ (with python3Packages; [ - pytestCheckHook - mock - flake8 - tox - ]); + nativeCheckInputs = [ + awscli + ] + ++ (with python3Packages; [ + pytestCheckHook + mock + flake8 + tox + ]); meta = { description = "Git remote prefix to simplify pushing to and pulling from CodeCommit"; diff --git a/pkgs/by-name/gi/git-series/package.nix b/pkgs/by-name/gi/git-series/package.nix index 3eb3b357a559..c5bf21efe8c1 100644 --- a/pkgs/by-name/gi/git-series/package.nix +++ b/pkgs/by-name/gi/git-series/package.nix @@ -29,14 +29,16 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ pkg-config installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ curl ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ curl ]; buildInputs = [ libgit2 libssh2 openssl zlib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ curl ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ curl ]; env = { LIBGIT2_SYS_USE_PKG_CONFIG = true; diff --git a/pkgs/by-name/gi/gitbutler/package.nix b/pkgs/by-name/gi/gitbutler/package.nix index ba50b5ef3b25..06db57d9c054 100644 --- a/pkgs/by-name/gi/gitbutler/package.nix +++ b/pkgs/by-name/gi/gitbutler/package.nix @@ -81,18 +81,18 @@ rustPlatform.buildRustPackage rec { turbo wrapGAppsHook4 yq # For `tomlq` - ] ++ lib.optional stdenv.hostPlatform.isDarwin makeBinaryWrapper; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin makeBinaryWrapper; - buildInputs = - [ - libgit2 - openssl - ] - ++ lib.optional stdenv.hostPlatform.isDarwin curl - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glib-networking - webkitgtk_4_1 - ]; + buildInputs = [ + libgit2 + openssl + ] + ++ lib.optional stdenv.hostPlatform.isDarwin curl + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glib-networking + webkitgtk_4_1 + ]; tauriBuildFlags = [ "--config" @@ -103,24 +103,23 @@ rustPlatform.buildRustPackage rec { # `gitbutler-git`'s checks do not support release mode checkType = "debug"; - cargoTestFlags = - [ - "--workspace" - ] - ++ lib.concatMap excludeSpec [ - # Requires Git directories - "but-core" - "but-rebase" - "but-workspace" - # Fails due to the issues above and below - "but-hunk-dependency" - # Errors with "Lazy instance has previously been poisoned" - "gitbutler-branch-actions" - "gitbutler-stack" - # `Expecting driver to be located at "../../target/debug/gitbutler-cli" - we also assume a certain crate location` - # We're not (usually) building in debug mode and always have a different target directory, so... - "gitbutler-edit-mode" - ]; + cargoTestFlags = [ + "--workspace" + ] + ++ lib.concatMap excludeSpec [ + # Requires Git directories + "but-core" + "but-rebase" + "but-workspace" + # Fails due to the issues above and below + "but-hunk-dependency" + # Errors with "Lazy instance has previously been poisoned" + "gitbutler-branch-actions" + "gitbutler-stack" + # `Expecting driver to be located at "../../target/debug/gitbutler-cli" - we also assume a certain crate location` + # We're not (usually) building in debug mode and always have a different target directory, so... + "gitbutler-edit-mode" + ]; env = { # Make sure `crates/gitbutler-tauri/inject-git-binaries.sh` can find our diff --git a/pkgs/by-name/gi/github-runner/package.nix b/pkgs/by-name/gi/github-runner/package.nix index a3263af9f43a..2e1009700f2e 100644 --- a/pkgs/by-name/gi/github-runner/package.nix +++ b/pkgs/by-name/gi/github-runner/package.nix @@ -109,16 +109,15 @@ buildDotnetModule (finalAttrs: { src/dir.proj ''; - nativeBuildInputs = - [ - which - gitMinimal - # needed for `uname` - coreutils - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + which + gitMinimal + # needed for `uname` + coreutils + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + darwin.autoSignDarwinBinariesHook + ]; buildInputs = [ (lib.getLib stdenv.cc.cc) @@ -149,152 +148,149 @@ buildDotnetModule (finalAttrs: { __darwinAllowLocalNetworking = true; # Fully qualified name of disabled tests - disabledTests = - [ - "GitHub.Runner.Common.Tests.Listener.SelfUpdaterL0.TestSelfUpdateAsync" - "GitHub.Runner.Common.Tests.ProcessInvokerL0.OomScoreAdjIsInherited" - ] - ++ map (x: "GitHub.Runner.Common.Tests.Listener.SelfUpdaterL0.TestSelfUpdateAsync_${x}") [ - "Cancel_CloneHashTask_WhenNotNeeded" - "CloneHash_RuntimeAndExternals" - "DownloadRetry" - "FallbackToFullPackage" - "NoUpdateOnOldVersion" - "NotUseExternalsRuntimeTrimmedPackageOnHashMismatch" - "UseExternalsRuntimeTrimmedPackage" - "UseExternalsTrimmedPackage" - "ValidateHash" - ] - ++ map (x: "GitHub.Runner.Common.Tests.Listener.SelfUpdaterV2L0.${x}") [ - "TestSelfUpdateAsync_DownloadRetry" - "TestSelfUpdateAsync_ValidateHash" - "TestSelfUpdateAsync" - ] - ++ map (x: "GitHub.Runner.Common.Tests.Worker.ActionManagerL0.PrepareActions_${x}") [ - "CompositeActionWithActionfile_CompositeContainerNested" - "CompositeActionWithActionfile_CompositePrestepNested" - "CompositeActionWithActionfile_MaxLimit" - "CompositeActionWithActionfile_Node" - "DownloadActionFromGraph" - "NotPullOrBuildImagesMultipleTimes" - "RepositoryActionWithActionYamlFile_DockerHubImage" - "RepositoryActionWithActionfileAndDockerfile" - "RepositoryActionWithActionfile_DockerHubImage" - "RepositoryActionWithActionfile_Dockerfile" - "RepositoryActionWithActionfile_DockerfileRelativePath" - "RepositoryActionWithActionfile_Node" - "RepositoryActionWithDockerfile" - "RepositoryActionWithDockerfileInRelativePath" - "RepositoryActionWithDockerfilePrepareActions_Repository" - "RepositoryActionWithInvalidWrapperActionfile_Node" - "RepositoryActionWithWrapperActionfile_PreSteps" - ] - ++ map (x: "GitHub.Runner.Common.Tests.DotnetsdkDownloadScriptL0.${x}") [ - "EnsureDotnetsdkBashDownloadScriptUpToDate" - "EnsureDotnetsdkPowershellDownloadScriptUpToDate" - ] - ++ [ "GitHub.Runner.Common.Tests.Listener.RunnerL0.TestRunOnceHandleUpdateMessage" ] - # Tests for trimmed runner packages which aim at reducing the update size. Not relevant for Nix. - ++ map (x: "GitHub.Runner.Common.Tests.PackagesTrimL0.${x}") [ - "RunnerLayoutParts_CheckExternalsHash" - "RunnerLayoutParts_CheckDotnetRuntimeHash" - ] - # Strictly require a Debug configuration to work - ++ [ - # https://github.com/actions/runner/blob/da3412e/src/Runner.Common/HostContext.cs#L260-L266 - "GitHub.Runner.Common.Tests.HostContextL0.AuthMigrationAutoReset" - ] - ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ - # "JavaScript Actions in Alpine containers are only supported on x64 Linux runners. Detected Linux Arm64" - "GitHub.Runner.Common.Tests.Worker.StepHostL0.DetermineNodeRuntimeVersionInAlpineContainerAsync" - "GitHub.Runner.Common.Tests.Worker.StepHostL0.DetermineNode20RuntimeVersionInAlpineContainerAsync" - ] - ++ lib.optionals finalAttrs.DOTNET_SYSTEM_GLOBALIZATION_INVARIANT [ - "GitHub.Runner.Common.Tests.ProcessExtensionL0.SuccessReadProcessEnv" - "GitHub.Runner.Common.Tests.Util.StringUtilL0.FormatUsesInvariantCulture" - "GitHub.Runner.Common.Tests.Worker.VariablesL0.Constructor_SetsOrdinalIgnoreCaseComparer" - "GitHub.Runner.Common.Tests.Worker.WorkerL0.DispatchCancellation" - "GitHub.Runner.Common.Tests.Worker.WorkerL0.DispatchRunNewJob" - "GitHub.Runner.Common.Tests.ProcessExtensionL0.SuccessReadProcessEnv" - ]; + disabledTests = [ + "GitHub.Runner.Common.Tests.Listener.SelfUpdaterL0.TestSelfUpdateAsync" + "GitHub.Runner.Common.Tests.ProcessInvokerL0.OomScoreAdjIsInherited" + ] + ++ map (x: "GitHub.Runner.Common.Tests.Listener.SelfUpdaterL0.TestSelfUpdateAsync_${x}") [ + "Cancel_CloneHashTask_WhenNotNeeded" + "CloneHash_RuntimeAndExternals" + "DownloadRetry" + "FallbackToFullPackage" + "NoUpdateOnOldVersion" + "NotUseExternalsRuntimeTrimmedPackageOnHashMismatch" + "UseExternalsRuntimeTrimmedPackage" + "UseExternalsTrimmedPackage" + "ValidateHash" + ] + ++ map (x: "GitHub.Runner.Common.Tests.Listener.SelfUpdaterV2L0.${x}") [ + "TestSelfUpdateAsync_DownloadRetry" + "TestSelfUpdateAsync_ValidateHash" + "TestSelfUpdateAsync" + ] + ++ map (x: "GitHub.Runner.Common.Tests.Worker.ActionManagerL0.PrepareActions_${x}") [ + "CompositeActionWithActionfile_CompositeContainerNested" + "CompositeActionWithActionfile_CompositePrestepNested" + "CompositeActionWithActionfile_MaxLimit" + "CompositeActionWithActionfile_Node" + "DownloadActionFromGraph" + "NotPullOrBuildImagesMultipleTimes" + "RepositoryActionWithActionYamlFile_DockerHubImage" + "RepositoryActionWithActionfileAndDockerfile" + "RepositoryActionWithActionfile_DockerHubImage" + "RepositoryActionWithActionfile_Dockerfile" + "RepositoryActionWithActionfile_DockerfileRelativePath" + "RepositoryActionWithActionfile_Node" + "RepositoryActionWithDockerfile" + "RepositoryActionWithDockerfileInRelativePath" + "RepositoryActionWithDockerfilePrepareActions_Repository" + "RepositoryActionWithInvalidWrapperActionfile_Node" + "RepositoryActionWithWrapperActionfile_PreSteps" + ] + ++ map (x: "GitHub.Runner.Common.Tests.DotnetsdkDownloadScriptL0.${x}") [ + "EnsureDotnetsdkBashDownloadScriptUpToDate" + "EnsureDotnetsdkPowershellDownloadScriptUpToDate" + ] + ++ [ "GitHub.Runner.Common.Tests.Listener.RunnerL0.TestRunOnceHandleUpdateMessage" ] + # Tests for trimmed runner packages which aim at reducing the update size. Not relevant for Nix. + ++ map (x: "GitHub.Runner.Common.Tests.PackagesTrimL0.${x}") [ + "RunnerLayoutParts_CheckExternalsHash" + "RunnerLayoutParts_CheckDotnetRuntimeHash" + ] + # Strictly require a Debug configuration to work + ++ [ + # https://github.com/actions/runner/blob/da3412e/src/Runner.Common/HostContext.cs#L260-L266 + "GitHub.Runner.Common.Tests.HostContextL0.AuthMigrationAutoReset" + ] + ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ + # "JavaScript Actions in Alpine containers are only supported on x64 Linux runners. Detected Linux Arm64" + "GitHub.Runner.Common.Tests.Worker.StepHostL0.DetermineNodeRuntimeVersionInAlpineContainerAsync" + "GitHub.Runner.Common.Tests.Worker.StepHostL0.DetermineNode20RuntimeVersionInAlpineContainerAsync" + ] + ++ lib.optionals finalAttrs.DOTNET_SYSTEM_GLOBALIZATION_INVARIANT [ + "GitHub.Runner.Common.Tests.ProcessExtensionL0.SuccessReadProcessEnv" + "GitHub.Runner.Common.Tests.Util.StringUtilL0.FormatUsesInvariantCulture" + "GitHub.Runner.Common.Tests.Worker.VariablesL0.Constructor_SetsOrdinalIgnoreCaseComparer" + "GitHub.Runner.Common.Tests.Worker.WorkerL0.DispatchCancellation" + "GitHub.Runner.Common.Tests.Worker.WorkerL0.DispatchRunNewJob" + "GitHub.Runner.Common.Tests.ProcessExtensionL0.SuccessReadProcessEnv" + ]; testProjectFile = [ "src/Test/Test.csproj" ]; - preCheck = - '' - # Required by some tests - export GITHUB_ACTIONS_RUNNER_TRACE=1 - mkdir -p _layout/externals - '' - + lib.optionalString (lib.elem "node20" nodeRuntimes) '' - ln -s ${nodejs_20} _layout/externals/node20 - ''; + preCheck = '' + # Required by some tests + export GITHUB_ACTIONS_RUNNER_TRACE=1 + mkdir -p _layout/externals + '' + + lib.optionalString (lib.elem "node20" nodeRuntimes) '' + ln -s ${nodejs_20} _layout/externals/node20 + ''; - postInstall = - '' - mkdir -p $out/bin + postInstall = '' + mkdir -p $out/bin - install -m755 src/Misc/layoutbin/runsvc.sh $out/lib/github-runner - install -m755 src/Misc/layoutbin/RunnerService.js $out/lib/github-runner - install -m755 src/Misc/layoutroot/run.sh $out/lib/github-runner - install -m755 src/Misc/layoutroot/run-helper.sh.template $out/lib/github-runner/run-helper.sh - install -m755 src/Misc/layoutroot/config.sh $out/lib/github-runner - install -m755 src/Misc/layoutroot/env.sh $out/lib/github-runner + install -m755 src/Misc/layoutbin/runsvc.sh $out/lib/github-runner + install -m755 src/Misc/layoutbin/RunnerService.js $out/lib/github-runner + install -m755 src/Misc/layoutroot/run.sh $out/lib/github-runner + install -m755 src/Misc/layoutroot/run-helper.sh.template $out/lib/github-runner/run-helper.sh + install -m755 src/Misc/layoutroot/config.sh $out/lib/github-runner + install -m755 src/Misc/layoutroot/env.sh $out/lib/github-runner - # env.sh is patched to not require any wrapping - ln -sr "$out/lib/github-runner/env.sh" "$out/bin/" + # env.sh is patched to not require any wrapping + ln -sr "$out/lib/github-runner/env.sh" "$out/bin/" - substituteInPlace $out/lib/github-runner/config.sh \ - --replace './bin/Runner.Listener' "$out/bin/Runner.Listener" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $out/lib/github-runner/config.sh \ - --replace 'command -v ldd' 'command -v ${glibc.bin}/bin/ldd' \ - --replace 'ldd ./bin' '${glibc.bin}/bin/ldd ${finalAttrs.dotnet-runtime}/share/dotnet/shared/Microsoft.NETCore.App/${finalAttrs.dotnet-runtime.version}/' \ - --replace '/sbin/ldconfig' '${glibc.bin}/bin/ldconfig' - '' - + '' - # Remove uneeded copy for run-helper template - substituteInPlace $out/lib/github-runner/run.sh --replace 'cp -f "$DIR"/run-helper.sh.template "$DIR"/run-helper.sh' ' ' - substituteInPlace $out/lib/github-runner/run-helper.sh --replace '"$DIR"/bin/' '"$DIR"/' + substituteInPlace $out/lib/github-runner/config.sh \ + --replace './bin/Runner.Listener' "$out/bin/Runner.Listener" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $out/lib/github-runner/config.sh \ + --replace 'command -v ldd' 'command -v ${glibc.bin}/bin/ldd' \ + --replace 'ldd ./bin' '${glibc.bin}/bin/ldd ${finalAttrs.dotnet-runtime}/share/dotnet/shared/Microsoft.NETCore.App/${finalAttrs.dotnet-runtime.version}/' \ + --replace '/sbin/ldconfig' '${glibc.bin}/bin/ldconfig' + '' + + '' + # Remove uneeded copy for run-helper template + substituteInPlace $out/lib/github-runner/run.sh --replace 'cp -f "$DIR"/run-helper.sh.template "$DIR"/run-helper.sh' ' ' + substituteInPlace $out/lib/github-runner/run-helper.sh --replace '"$DIR"/bin/' '"$DIR"/' - # Make paths absolute - substituteInPlace $out/lib/github-runner/runsvc.sh \ - --replace './externals' "$out/lib/externals" \ - --replace './bin/RunnerService.js' "$out/lib/github-runner/RunnerService.js" + # Make paths absolute + substituteInPlace $out/lib/github-runner/runsvc.sh \ + --replace './externals' "$out/lib/externals" \ + --replace './bin/RunnerService.js' "$out/lib/github-runner/RunnerService.js" - # The upstream package includes Node and expects it at the path - # externals/node$version. As opposed to the official releases, we don't - # link the Alpine Node flavors. - mkdir -p $out/lib/externals - '' - + lib.optionalString (lib.elem "node20" nodeRuntimes) '' - ln -s ${nodejs_20} $out/lib/externals/node20 - '' - + '' - # Install Nodejs scripts called from workflows - install -D src/Misc/layoutbin/hashFiles/index.js $out/lib/github-runner/hashFiles/index.js - mkdir -p $out/lib/github-runner/checkScripts - install src/Misc/layoutbin/checkScripts/* $out/lib/github-runner/checkScripts/ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Wrap explicitly to, e.g., prevent extra entries for LD_LIBRARY_PATH - makeWrapperArgs=() + # The upstream package includes Node and expects it at the path + # externals/node$version. As opposed to the official releases, we don't + # link the Alpine Node flavors. + mkdir -p $out/lib/externals + '' + + lib.optionalString (lib.elem "node20" nodeRuntimes) '' + ln -s ${nodejs_20} $out/lib/externals/node20 + '' + + '' + # Install Nodejs scripts called from workflows + install -D src/Misc/layoutbin/hashFiles/index.js $out/lib/github-runner/hashFiles/index.js + mkdir -p $out/lib/github-runner/checkScripts + install src/Misc/layoutbin/checkScripts/* $out/lib/github-runner/checkScripts/ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # Wrap explicitly to, e.g., prevent extra entries for LD_LIBRARY_PATH + makeWrapperArgs=() - # We don't wrap with libicu - substituteInPlace $out/lib/github-runner/config.sh \ - --replace '$LDCONFIG_COMMAND -NXv ''${libpath//:/ }' 'echo libicu' - '' - + '' - # XXX: Using the corresponding Nix argument does not work as expected: - # https://github.com/NixOS/nixpkgs/issues/218449 - # Common wrapper args for `executables` - makeWrapperArgs+=( - --run 'export RUNNER_ROOT="''${RUNNER_ROOT:-"$HOME/.github-runner"}"' - --run 'mkdir -p "$RUNNER_ROOT"' - --chdir "$out" - ) - ''; + # We don't wrap with libicu + substituteInPlace $out/lib/github-runner/config.sh \ + --replace '$LDCONFIG_COMMAND -NXv ''${libpath//:/ }' 'echo libicu' + '' + + '' + # XXX: Using the corresponding Nix argument does not work as expected: + # https://github.com/NixOS/nixpkgs/issues/218449 + # Common wrapper args for `executables` + makeWrapperArgs+=( + --run 'export RUNNER_ROOT="''${RUNNER_ROOT:-"$HOME/.github-runner"}"' + --run 'mkdir -p "$RUNNER_ROOT"' + --chdir "$out" + ) + ''; # List of files to wrap executables = [ diff --git a/pkgs/by-name/gi/gitlab-runner/package.nix b/pkgs/by-name/gi/gitlab-runner/package.nix index 77db18ccf2a2..e0a1ba8b85e2 100644 --- a/pkgs/by-name/gi/gitlab-runner/package.nix +++ b/pkgs/by-name/gi/gitlab-runner/package.nix @@ -29,43 +29,42 @@ buildGoModule (finalAttrs: { ./remove-bash-test.patch ]; - prePatch = - '' - # Remove some tests that can't work during a nix build + prePatch = '' + # Remove some tests that can't work during a nix build - # Needs the build directory to be a git repo - substituteInPlace commands/helpers/file_archiver_test.go \ - --replace-fail "func TestCacheArchiverAddingUntrackedFiles" "func OFF_TestCacheArchiverAddingUntrackedFiles" \ - --replace-fail "func TestCacheArchiverAddingUntrackedUnicodeFiles" "func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles" - rm shells/abstract_test.go + # Needs the build directory to be a git repo + substituteInPlace commands/helpers/file_archiver_test.go \ + --replace-fail "func TestCacheArchiverAddingUntrackedFiles" "func OFF_TestCacheArchiverAddingUntrackedFiles" \ + --replace-fail "func TestCacheArchiverAddingUntrackedUnicodeFiles" "func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles" + rm shells/abstract_test.go - # No writable developer environment - rm common/build_settings_test.go - rm common/build_test.go - rm executors/custom/custom_test.go + # No writable developer environment + rm common/build_settings_test.go + rm common/build_test.go + rm executors/custom/custom_test.go - # No Docker during build - rm executors/docker/docker_test.go - rm executors/docker/services_test.go - rm executors/docker/terminal_test.go - rm helpers/docker/auth/auth_test.go + # No Docker during build + rm executors/docker/docker_test.go + rm executors/docker/services_test.go + rm executors/docker/terminal_test.go + rm helpers/docker/auth/auth_test.go - # No Kubernetes during build - rm executors/kubernetes/feature_test.go - rm executors/kubernetes/kubernetes_test.go - rm executors/kubernetes/overwrites_test.go - '' - + lib.optionalString stdenv.buildPlatform.isDarwin '' - # Invalid bind arguments break Unix socket tests - substituteInPlace commands/wrapper_test.go \ - --replace-fail "func TestRunnerWrapperCommand_createListener" "func OFF_TestRunnerWrapperCommand_createListener" + # No Kubernetes during build + rm executors/kubernetes/feature_test.go + rm executors/kubernetes/kubernetes_test.go + rm executors/kubernetes/overwrites_test.go + '' + + lib.optionalString stdenv.buildPlatform.isDarwin '' + # Invalid bind arguments break Unix socket tests + substituteInPlace commands/wrapper_test.go \ + --replace-fail "func TestRunnerWrapperCommand_createListener" "func OFF_TestRunnerWrapperCommand_createListener" - # No keychain access during build breaks X.509 certificate tests - substituteInPlace helpers/certificate/x509_test.go \ - --replace-fail "func TestCertificate" "func OFF_TestCertificate" - substituteInPlace network/client_test.go \ - --replace-fail "func TestClientInvalidSSL" "func OFF_TestClientInvalidSSL" - ''; + # No keychain access during build breaks X.509 certificate tests + substituteInPlace helpers/certificate/x509_test.go \ + --replace-fail "func TestCertificate" "func OFF_TestCertificate" + substituteInPlace network/client_test.go \ + --replace-fail "func TestClientInvalidSSL" "func OFF_TestClientInvalidSSL" + ''; excludedPackages = [ # Nested dependency Go module, used with go.mod replace directive diff --git a/pkgs/by-name/gi/gitlab-timelogs/package.nix b/pkgs/by-name/gi/gitlab-timelogs/package.nix index ab05db21574e..0fff2fc6f48a 100644 --- a/pkgs/by-name/gi/gitlab-timelogs/package.nix +++ b/pkgs/by-name/gi/gitlab-timelogs/package.nix @@ -19,11 +19,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - iconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + iconv + ]; useFetchCargoVendor = true; cargoHash = "sha256-qSIRcf0HpRg1Eu12L6UcJajHBgjJgfhsHmF1oV1h8HM="; diff --git a/pkgs/by-name/gi/gitnr/package.nix b/pkgs/by-name/gi/gitnr/package.nix index 404aaaaf90fc..035c51204724 100644 --- a/pkgs/by-name/gi/gitnr/package.nix +++ b/pkgs/by-name/gi/gitnr/package.nix @@ -27,14 +27,13 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libxkbcommon - wayland - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libxkbcommon + wayland + ]; # requires internet access doCheck = false; diff --git a/pkgs/by-name/gi/gitrs/package.nix b/pkgs/by-name/gi/gitrs/package.nix index d4155f294a13..7d7761d849fe 100644 --- a/pkgs/by-name/gi/gitrs/package.nix +++ b/pkgs/by-name/gi/gitrs/package.nix @@ -27,12 +27,13 @@ rustPlatform.buildRustPackage rec { pkg-config # for openssl ]; - buildInputs = - [ openssl.dev ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - libz - ]; + buildInputs = [ + openssl.dev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + libz + ]; meta = with lib; { description = "Simple, opinionated, tool, written in Rust, for declaratively managing Git repos on your machine"; diff --git a/pkgs/by-name/gi/gitui/package.nix b/pkgs/by-name/gi/gitui/package.nix index 2f24dbef6752..3f4b4a901769 100644 --- a/pkgs/by-name/gi/gitui/package.nix +++ b/pkgs/by-name/gi/gitui/package.nix @@ -32,12 +32,13 @@ rustPlatform.buildRustPackage { cmake ]; - buildInputs = - [ openssl ] - ++ lib.optional stdenv.hostPlatform.isLinux xclip - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optional stdenv.hostPlatform.isLinux xclip + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; postPatch = '' # The cargo config overrides linkers for some targets, breaking the build diff --git a/pkgs/by-name/gi/givaro/package.nix b/pkgs/by-name/gi/givaro/package.nix index 4271952e11d1..957f94c56109 100644 --- a/pkgs/by-name/gi/givaro/package.nix +++ b/pkgs/by-name/gi/givaro/package.nix @@ -60,22 +60,21 @@ stdenv.mkDerivation rec { buildInputs = [ libtool ]; propagatedBuildInputs = [ gmpxx ]; - configureFlags = - [ - "--without-archnative" - "CCNAM=${stdenv.cc.cc.pname}" - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - # disable SIMD instructions (which are enabled *when available* by default) - "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" - "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" - "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" - "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" - "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" - "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" - "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" - "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" - ]; + configureFlags = [ + "--without-archnative" + "CCNAM=${stdenv.cc.cc.pname}" + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + # disable SIMD instructions (which are enabled *when available* by default) + "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" + "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" + "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" + "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" + "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" + "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" + "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" + "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" + ]; # On darwin, tests are linked to dylib in the nix store, so we need to make # sure tests run after installPhase. diff --git a/pkgs/by-name/gj/gjs/package.nix b/pkgs/by-name/gj/gjs/package.nix index 5c38bc00413f..691575c5a93c 100644 --- a/pkgs/by-name/gj/gjs/package.nix +++ b/pkgs/by-name/gj/gjs/package.nix @@ -66,20 +66,19 @@ stdenv.mkDerivation (finalAttrs: { ./disable-introspection-test.patch ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - makeWrapper - which # for locale detection - libxml2 # for xml-stripblanks - dbus # for dbus-run-session - gobject-introspection - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + makeWrapper + which # for locale detection + libxml2 # for xml-stripblanks + dbus # for dbus-run-session + gobject-introspection + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ cairo @@ -90,31 +89,30 @@ stdenv.mkDerivation (finalAttrs: { nativeCheckInputs = [ xvfb-run - ] ++ testDeps; + ] + ++ testDeps; propagatedBuildInputs = [ glib ]; - mesonFlags = - [ - "-Dinstalled_test_prefix=${placeholder "installedTests"}" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isMusl) [ - "-Dprofiler=disabled" - ]; + mesonFlags = [ + "-Dinstalled_test_prefix=${placeholder "installedTests"}" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isMusl) [ + "-Dprofiler=disabled" + ]; doCheck = !stdenv.hostPlatform.isDarwin; - postPatch = - '' - patchShebangs build/choose-tests-locale.sh - substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - substituteInPlace installed-tests/js/meson.build \ - --replace "'Encoding'," "#'Encoding'," - ''; + postPatch = '' + patchShebangs build/choose-tests-locale.sh + substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + substituteInPlace installed-tests/js/meson.build \ + --replace "'Encoding'," "#'Encoding'," + ''; preCheck = '' # Our gobject-introspection patches make the shared library paths absolute diff --git a/pkgs/by-name/gl/gl2ps/package.nix b/pkgs/by-name/gl/gl2ps/package.nix index f1a5a9746f4f..7e92c09dd9bb 100644 --- a/pkgs/by-name/gl/gl2ps/package.nix +++ b/pkgs/by-name/gl/gl2ps/package.nix @@ -23,16 +23,15 @@ stdenv.mkDerivation rec { cmake ]; - buildInputs = - [ - zlib - libpng - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGL - libGLU - libglut - ]; + buildInputs = [ + zlib + libpng + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGL + libGLU + libglut + ]; meta = with lib; { homepage = "http://geuz.org/gl2ps"; diff --git a/pkgs/by-name/gl/glade/package.nix b/pkgs/by-name/gl/glade/package.nix index 06e25521e876..7e8b2d3b3a40 100644 --- a/pkgs/by-name/gl/glade/package.nix +++ b/pkgs/by-name/gl/glade/package.nix @@ -48,21 +48,20 @@ stdenv.mkDerivation rec { gobject-introspection ]; - buildInputs = - [ - gtk3 - glib - gjs - libxml2 - python3 - python3.pkgs.pygobject3 - gsettings-desktop-schemas - gdk-pixbuf - adwaita-icon-theme - ] - ++ lib.optionals enableWebkit2gtk [ - webkitgtk_4_1 - ]; + buildInputs = [ + gtk3 + glib + gjs + libxml2 + python3 + python3.pkgs.pygobject3 + gsettings-desktop-schemas + gdk-pixbuf + adwaita-icon-theme + ] + ++ lib.optionals enableWebkit2gtk [ + webkitgtk_4_1 + ]; mesonFlags = [ (lib.mesonEnable "webkit2gtk" enableWebkit2gtk) diff --git a/pkgs/by-name/gl/glava/package.nix b/pkgs/by-name/gl/glava/package.nix index 742fbe2a72d0..11d739d8d4ae 100644 --- a/pkgs/by-name/gl/glava/package.nix +++ b/pkgs/by-name/gl/glava/package.nix @@ -52,7 +52,8 @@ stdenv.mkDerivation rec { libXrender libpulseaudio libXcomposite - ] ++ optional enableGlfw glfw; + ] + ++ optional enableGlfw glfw; nativeBuildInputs = [ python3 diff --git a/pkgs/by-name/gl/glfw3/package.nix b/pkgs/by-name/gl/glfw3/package.nix index fa740ddbaccf..d5511c2ad8d3 100644 --- a/pkgs/by-name/gl/glfw3/package.nix +++ b/pkgs/by-name/gl/glfw3/package.nix @@ -36,23 +36,21 @@ stdenv.mkDerivation { }; # Fix linkage issues on X11 (https://github.com/NixOS/nixpkgs/issues/142583) - patches = - [ - ./x11.patch - ] - ++ lib.optionals withMinecraftPatch [ - ./0009-Defer-setting-cursor-position-until-the-cursor-is-lo.patch - ]; + patches = [ + ./x11.patch + ] + ++ lib.optionals withMinecraftPatch [ + ./0009-Defer-setting-cursor-position-until-the-cursor-is-lo.patch + ]; propagatedBuildInputs = lib.optionals (!stdenv.hostPlatform.isWindows) [ libGL ]; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ wayland-scanner ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ wayland-scanner ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ wayland diff --git a/pkgs/by-name/gl/glib/package.nix b/pkgs/by-name/gl/glib/package.nix index 45e1b27165ae..763bb75f6956 100644 --- a/pkgs/by-name/gl/glib/package.nix +++ b/pkgs/by-name/gl/glib/package.nix @@ -153,58 +153,56 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - buildInputs = - [ - finalAttrs.setupHook - ] - ++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ - libsysprof-capture - ] - ++ [ - pcre2 - ] - ++ lib.optionals (!stdenv.hostPlatform.isWindows) [ - bash - gnum4 # install glib-gettextize and m4 macros for other apps to use - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ - elfutils - ] - ++ lib.optionals withDtrace [ - libsystemtap - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libselinux - util-linuxMinimal # for libmount - ]; + buildInputs = [ + finalAttrs.setupHook + ] + ++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ + libsysprof-capture + ] + ++ [ + pcre2 + ] + ++ lib.optionals (!stdenv.hostPlatform.isWindows) [ + bash + gnum4 # install glib-gettextize and m4 macros for other apps to use + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ + elfutils + ] + ++ lib.optionals withDtrace [ + libsystemtap + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libselinux + util-linuxMinimal # for libmount + ]; depsBuildBuild = [ pkg-config # required to find native gi-docgen ]; - nativeBuildInputs = - [ - docutils # for rst2man, rst2html5 - meson - ninja - pkg-config - perl - python3 - python3Packages.packaging # mostly used to make meson happy - python3Packages.wrapPython # for patchPythonScript - gettext - libxslt - ] - ++ lib.optionals withIntrospection [ - gi-docgen - gobject-introspection' - ] - ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ] - ++ lib.optionals withDtrace [ - systemtap' # for dtrace - ]; + nativeBuildInputs = [ + docutils # for rst2man, rst2html5 + meson + ninja + pkg-config + perl + python3 + python3Packages.packaging # mostly used to make meson happy + python3Packages.wrapPython # for patchPythonScript + gettext + libxslt + ] + ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection' + ] + ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ] + ++ lib.optionals withDtrace [ + systemtap' # for dtrace + ]; propagatedBuildInputs = [ zlib @@ -219,26 +217,25 @@ stdenv.mkDerivation (finalAttrs: { shared-mime-info ]; - mesonFlags = - [ - "-Dglib_debug=disabled" # https://gitlab.gnome.org/GNOME/glib/-/issues/3421#note_2206315 - "-Ddocumentation=true" # gvariant specification can be built without gi-docgen - (lib.mesonEnable "dtrace" withDtrace) - (lib.mesonEnable "systemtap" withDtrace) # requires dtrace option to be enabled - "-Dnls=enabled" - "-Ddevbindir=${placeholder "dev"}/bin" - (lib.mesonEnable "introspection" withIntrospection) - # FIXME: Fails when linking target glib/tests/libconstructor-helper.so - # relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object - "-Dtests=${lib.boolToString (!stdenv.hostPlatform.isStatic)}" - ] - ++ lib.optionals (!lib.meta.availableOn stdenv.hostPlatform elfutils) [ - "-Dlibelf=disabled" - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - "-Dxattr=false" - "-Dsysprof=disabled" # sysprof-capture does not build on FreeBSD - ]; + mesonFlags = [ + "-Dglib_debug=disabled" # https://gitlab.gnome.org/GNOME/glib/-/issues/3421#note_2206315 + "-Ddocumentation=true" # gvariant specification can be built without gi-docgen + (lib.mesonEnable "dtrace" withDtrace) + (lib.mesonEnable "systemtap" withDtrace) # requires dtrace option to be enabled + "-Dnls=enabled" + "-Ddevbindir=${placeholder "dev"}/bin" + (lib.mesonEnable "introspection" withIntrospection) + # FIXME: Fails when linking target glib/tests/libconstructor-helper.so + # relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object + "-Dtests=${lib.boolToString (!stdenv.hostPlatform.isStatic)}" + ] + ++ lib.optionals (!lib.meta.availableOn stdenv.hostPlatform elfutils) [ + "-Dlibelf=disabled" + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + "-Dxattr=false" + "-Dsysprof=disabled" # sysprof-capture does not build on FreeBSD + ]; env = { NIX_CFLAGS_COMPILE = toString [ @@ -249,28 +246,27 @@ stdenv.mkDerivation (finalAttrs: { ]; }; - postPatch = - '' - patchShebangs glib/gen-unicode-tables.pl - patchShebangs glib/tests/gen-casefold-txt.py - patchShebangs glib/tests/gen-casemap-txt.py - patchShebangs tools/gen-visibility-macros.py - patchShebangs tests + postPatch = '' + patchShebangs glib/gen-unicode-tables.pl + patchShebangs glib/tests/gen-casefold-txt.py + patchShebangs glib/tests/gen-casemap-txt.py + patchShebangs tools/gen-visibility-macros.py + patchShebangs tests - # Needs machine-id, comment the test - sed -e '/\/gdbus\/codegen-peer-to-peer/ s/^\/*/\/\//' -i gio/tests/gdbus-peer.c - sed -e '/g_test_add_func/ s/^\/*/\/\//' -i gio/tests/gdbus-address-get-session.c - # All gschemas fail to pass the test, upstream bug? - sed -e '/g_test_add_data_func/ s/^\/*/\/\//' -i gio/tests/gschema-compile.c - # Cannot reproduce the failing test_associations on hydra - sed -e '/\/appinfo\/associations/d' -i gio/tests/appinfo.c - # Needed because of libtool wrappers - sed -e '/g_subprocess_launcher_set_environ (launcher, envp);/a g_subprocess_launcher_setenv (launcher, "PATH", g_getenv("PATH"), TRUE);' -i gio/tests/gsubprocess.c - '' - + lib.optionalString stdenv.hostPlatform.isWindows '' - substituteInPlace gio/win32/meson.build \ - --replace "libintl, " "" - ''; + # Needs machine-id, comment the test + sed -e '/\/gdbus\/codegen-peer-to-peer/ s/^\/*/\/\//' -i gio/tests/gdbus-peer.c + sed -e '/g_test_add_func/ s/^\/*/\/\//' -i gio/tests/gdbus-address-get-session.c + # All gschemas fail to pass the test, upstream bug? + sed -e '/g_test_add_data_func/ s/^\/*/\/\//' -i gio/tests/gschema-compile.c + # Cannot reproduce the failing test_associations on hydra + sed -e '/\/appinfo\/associations/d' -i gio/tests/appinfo.c + # Needed because of libtool wrappers + sed -e '/g_subprocess_launcher_set_environ (launcher, envp);/a g_subprocess_launcher_setenv (launcher, "PATH", g_getenv("PATH"), TRUE);' -i gio/tests/gsubprocess.c + '' + + lib.optionalString stdenv.hostPlatform.isWindows '' + substituteInPlace gio/win32/meson.build \ + --replace "libintl, " "" + ''; postConfigure = '' patchShebangs gio/gdbus-2.0/codegen/gdbus-codegen gobject/glib-{genmarshal,mkenums} diff --git a/pkgs/by-name/gl/globalping-cli/package.nix b/pkgs/by-name/gl/globalping-cli/package.nix index 367f3d85ceed..d8d220d8306d 100644 --- a/pkgs/by-name/gl/globalping-cli/package.nix +++ b/pkgs/by-name/gl/globalping-cli/package.nix @@ -49,16 +49,15 @@ buildGoModule rec { in [ "-skip=^${builtins.concatStringsSep "|^" skippedTests}" ]; - postInstall = - '' - mv $out/bin/globalping-cli $out/bin/globalping - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd globalping \ - --bash <($out/bin/globalping completion bash) \ - --fish <($out/bin/globalping completion fish) \ - --zsh <($out/bin/globalping completion zsh) - ''; + postInstall = '' + mv $out/bin/globalping-cli $out/bin/globalping + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd globalping \ + --bash <($out/bin/globalping completion bash) \ + --fish <($out/bin/globalping completion fish) \ + --zsh <($out/bin/globalping completion zsh) + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/gl/globalplatform/package.nix b/pkgs/by-name/gl/globalplatform/package.nix index ed6469b940b0..1cc8925584a1 100644 --- a/pkgs/by-name/gl/globalplatform/package.nix +++ b/pkgs/by-name/gl/globalplatform/package.nix @@ -32,14 +32,13 @@ stdenv.mkDerivation (finalAttrs: { graphviz ]; - buildInputs = - [ - zlib - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pcsclite - ]; + buildInputs = [ + zlib + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pcsclite + ]; cmakeFlags = [ "-DTESTING=ON" diff --git a/pkgs/by-name/gl/glom/package.nix b/pkgs/by-name/gl/glom/package.nix index 3da677d706ba..a1b637990d8f 100644 --- a/pkgs/by-name/gl/glom/package.nix +++ b/pkgs/by-name/gl/glom/package.nix @@ -69,12 +69,10 @@ stdenv.mkDerivation (finalAttrs: { python_boost = python311.withPackages (pkgs: with pkgs; [ pygobject3 ]); sphinx-build = python311.pkgs.sphinx.overrideAttrs (super: { - postFixup = - super.postFixup or "" - + '' - # Do not propagate Python - rm $out/nix-support/propagated-build-inputs - ''; + postFixup = super.postFixup or "" + '' + # Do not propagate Python + rm $out/nix-support/propagated-build-inputs + ''; }); boost_python = boost.override { diff --git a/pkgs/by-name/gl/glpk/package.nix b/pkgs/by-name/gl/glpk/package.nix index 012865ab26b9..ab7cae435b80 100644 --- a/pkgs/by-name/gl/glpk/package.nix +++ b/pkgs/by-name/gl/glpk/package.nix @@ -24,13 +24,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-ShAT7rtQ9yj8YBvdgzsLKHAzPDs+WoFu66kh2VvsbxU="; }; - buildInputs = - [ - libmysqlclient - ] - ++ lib.optionals withGmp [ - gmp - ]; + buildInputs = [ + libmysqlclient + ] + ++ lib.optionals withGmp [ + gmp + ]; configureFlags = lib.optionals withGmp [ "--with-gmp" diff --git a/pkgs/by-name/gm/gmic-qt/package.nix b/pkgs/by-name/gm/gmic-qt/package.nix index 629097841c03..2c7d8e70d890 100644 --- a/pkgs/by-name/gm/gmic-qt/package.nix +++ b/pkgs/by-name/gm/gmic-qt/package.nix @@ -66,27 +66,26 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - cimg - curl - fftw - gmic - graphicsmagick - libjpeg - libpng - libtiff - openexr - zlib - ] - ++ (with libsForQt5; [ - qtbase - qttools - ]) - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ] - ++ variants.${variant}.extraDeps; + buildInputs = [ + cimg + curl + fftw + gmic + graphicsmagick + libjpeg + libpng + libtiff + openexr + zlib + ] + ++ (with libsForQt5; [ + qtbase + qttools + ]) + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ] + ++ variants.${variant}.extraDeps; postPatch = '' patchShebangs \ diff --git a/pkgs/by-name/gm/gmic/package.nix b/pkgs/by-name/gm/gmic/package.nix index 06a04541628f..38f0691a5313 100644 --- a/pkgs/by-name/gm/gmic/package.nix +++ b/pkgs/by-name/gm/gmic/package.nix @@ -63,23 +63,22 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - cimg - fftw - graphicsmagick - libX11 - libXext - libjpeg - libpng - libtiff - opencv - openexr - zlib - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ]; + buildInputs = [ + cimg + fftw + graphicsmagick + libX11 + libXext + libjpeg + libpng + libtiff + opencv + openexr + zlib + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ]; cmakeFlags = [ (lib.cmakeBool "BUILD_LIB_STATIC" false) @@ -90,19 +89,18 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "USE_SYSTEM_CIMG" true) ]; - postPatch = - '' - cp -r ${finalAttrs.gmic_stdlib} src/gmic_stdlib_community.h - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace CMakeLists.txt \ - --replace "LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH" - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace CMakeLists.txt --replace-fail \ - 'LD_LIBRARY_PATH=''${GMIC_BINARIES_PATH} ''${GMIC_BINARIES_PATH}/gmic' \ - '${lib.getExe buildPackages.gmic}' - ''; + postPatch = '' + cp -r ${finalAttrs.gmic_stdlib} src/gmic_stdlib_community.h + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace CMakeLists.txt \ + --replace "LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH" + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace CMakeLists.txt --replace-fail \ + 'LD_LIBRARY_PATH=''${GMIC_BINARIES_PATH} ''${GMIC_BINARIES_PATH}/gmic' \ + '${lib.getExe buildPackages.gmic}' + ''; passthru = { tests = { diff --git a/pkgs/by-name/gm/gmsh/package.nix b/pkgs/by-name/gm/gmsh/package.nix index dd3d3efd0a31..d0be8fc8fc50 100644 --- a/pkgs/by-name/gm/gmsh/package.nix +++ b/pkgs/by-name/gm/gmsh/package.nix @@ -32,31 +32,30 @@ stdenv.mkDerivation rec { hash = "sha256-d5chRfQxcmAm1QWWpqRPs8HJXCElUhjWaVWAa4btvo0="; }; - buildInputs = - [ - blas - lapack - gmm - fltk - libjpeg - zlib - opencascade-occt - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGL - libGLU - xorg.libXrender - xorg.libXcursor - xorg.libXfixes - xorg.libXext - xorg.libXft - xorg.libXinerama - xorg.libX11 - xorg.libSM - xorg.libICE - ] - ++ lib.optional stdenv.cc.isClang llvmPackages.openmp - ++ lib.optional enablePython python; + buildInputs = [ + blas + lapack + gmm + fltk + libjpeg + zlib + opencascade-occt + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGL + libGLU + xorg.libXrender + xorg.libXcursor + xorg.libXfixes + xorg.libXext + xorg.libXft + xorg.libXinerama + xorg.libX11 + xorg.libSM + xorg.libICE + ] + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp + ++ lib.optional enablePython python; enableParallelBuilding = true; diff --git a/pkgs/by-name/gm/gmt/package.nix b/pkgs/by-name/gm/gmt/package.nix index 4f688d9b8041..f5ec5e6cf184 100644 --- a/pkgs/by-name/gm/gmt/package.nix +++ b/pkgs/by-name/gm/gmt/package.nix @@ -38,45 +38,43 @@ stdenv.mkDerivation (finalAttrs: { ) "-D__LAPACK_int=int"; }; - buildInputs = - [ - curl - gdal - netcdf - pcre - dcw-gmt - gshhg-gmt - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - fftwSinglePrec - blas - lapack - ]; + buildInputs = [ + curl + gdal + netcdf + pcre + dcw-gmt + gshhg-gmt + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + fftwSinglePrec + blas + lapack + ]; propagatedBuildInputs = [ ghostscript ]; - cmakeFlags = - [ - (lib.cmakeFeature "GMT_DOCDIR" "share/doc/gmt") - (lib.cmakeFeature "GMT_MANDIR" "share/man") - (lib.cmakeFeature "GMT_LIBDIR" "lib") - (lib.cmakeBool "COPY_GSHHG" false) - (lib.cmakeFeature "GSHHG_ROOT" "${gshhg-gmt.out}/share/gshhg-gmt") - (lib.cmakeBool "COPY_DCW" false) - (lib.cmakeFeature "DCW_ROOT" "${dcw-gmt.out}/share/dcw-gmt") - (lib.cmakeFeature "GDAL_ROOT" "${gdal.out}") - (lib.cmakeFeature "NETCDF_ROOT" "${netcdf.out}") - (lib.cmakeFeature "PCRE_ROOT" "${pcre.out}") - (lib.cmakeBool "GMT_INSTALL_TRADITIONAL_FOLDERNAMES" false) - (lib.cmakeBool "GMT_ENABLE_OPENMP" true) - (lib.cmakeBool "GMT_INSTALL_MODULE_LINKS" false) - (lib.cmakeFeature "LICENSE_RESTRICTED" "LGPL") - ] - ++ (lib.optionals (!stdenv.hostPlatform.isDarwin) [ - (lib.cmakeFeature "FFTW3_ROOT" "${fftwSinglePrec.dev}") - (lib.cmakeFeature "LAPACK_LIBRARY" "${lib.getLib lapack}/lib/liblapack.so") - (lib.cmakeFeature "BLAS_LIBRARY" "${lib.getLib blas}/lib/libblas.so") - ]); + cmakeFlags = [ + (lib.cmakeFeature "GMT_DOCDIR" "share/doc/gmt") + (lib.cmakeFeature "GMT_MANDIR" "share/man") + (lib.cmakeFeature "GMT_LIBDIR" "lib") + (lib.cmakeBool "COPY_GSHHG" false) + (lib.cmakeFeature "GSHHG_ROOT" "${gshhg-gmt.out}/share/gshhg-gmt") + (lib.cmakeBool "COPY_DCW" false) + (lib.cmakeFeature "DCW_ROOT" "${dcw-gmt.out}/share/dcw-gmt") + (lib.cmakeFeature "GDAL_ROOT" "${gdal.out}") + (lib.cmakeFeature "NETCDF_ROOT" "${netcdf.out}") + (lib.cmakeFeature "PCRE_ROOT" "${pcre.out}") + (lib.cmakeBool "GMT_INSTALL_TRADITIONAL_FOLDERNAMES" false) + (lib.cmakeBool "GMT_ENABLE_OPENMP" true) + (lib.cmakeBool "GMT_INSTALL_MODULE_LINKS" false) + (lib.cmakeFeature "LICENSE_RESTRICTED" "LGPL") + ] + ++ (lib.optionals (!stdenv.hostPlatform.isDarwin) [ + (lib.cmakeFeature "FFTW3_ROOT" "${fftwSinglePrec.dev}") + (lib.cmakeFeature "LAPACK_LIBRARY" "${lib.getLib lapack}/lib/liblapack.so") + (lib.cmakeFeature "BLAS_LIBRARY" "${lib.getLib blas}/lib/libblas.so") + ]); meta = { homepage = "https://www.generic-mapping-tools.org"; diff --git a/pkgs/by-name/gn/gnome-bluetooth/package.nix b/pkgs/by-name/gn/gnome-bluetooth/package.nix index 01043b9d5f5e..14f5865c7dab 100644 --- a/pkgs/by-name/gn/gnome-bluetooth/package.nix +++ b/pkgs/by-name/gn/gnome-bluetooth/package.nix @@ -56,7 +56,8 @@ stdenv.mkDerivation (finalAttrs: { docbook-xsl-nons docbook_xml_dtd_43 python3 - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; buildInputs = [ glib diff --git a/pkgs/by-name/gn/gnome-bluetooth_1_0/package.nix b/pkgs/by-name/gn/gnome-bluetooth_1_0/package.nix index 722453d3cd2c..f6ceac6ae176 100644 --- a/pkgs/by-name/gn/gnome-bluetooth_1_0/package.nix +++ b/pkgs/by-name/gn/gnome-bluetooth_1_0/package.nix @@ -52,24 +52,23 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - meson - ninja - gettext - itstool - pkg-config - libxml2 - wrapGAppsHook3 - gobject-introspection - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - python3 - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + gettext + itstool + pkg-config + libxml2 + wrapGAppsHook3 + gobject-introspection + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 + python3 + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/gn/gnome-clocks/package.nix b/pkgs/by-name/gn/gnome-clocks/package.nix index 21ee134bd933..15c66b54168f 100644 --- a/pkgs/by-name/gn/gnome-clocks/package.nix +++ b/pkgs/by-name/gn/gnome-clocks/package.nix @@ -45,24 +45,23 @@ stdenv.mkDerivation (finalAttrs: { libxml2 ]; - buildInputs = - [ - gtk4 - glib - gsettings-desktop-schemas - gdk-pixbuf - gnome-desktop - geocode-glib_2 - geoclue2 - libgweather - libadwaita - ] - ++ (with gst_all_1; [ - # GStreamer plugins needed for Alarms - gstreamer - gst-plugins-base - gst-plugins-good - ]); + buildInputs = [ + gtk4 + glib + gsettings-desktop-schemas + gdk-pixbuf + gnome-desktop + geocode-glib_2 + geoclue2 + libgweather + libadwaita + ] + ++ (with gst_all_1; [ + # GStreamer plugins needed for Alarms + gstreamer + gst-plugins-base + gst-plugins-good + ]); doCheck = true; diff --git a/pkgs/by-name/gn/gnome-desktop/package.nix b/pkgs/by-name/gn/gnome-desktop/package.nix index 9a9d68d7f960..567f272183f1 100644 --- a/pkgs/by-name/gn/gnome-desktop/package.nix +++ b/pkgs/by-name/gn/gnome-desktop/package.nix @@ -63,38 +63,36 @@ stdenv.mkDerivation (finalAttrs: { glib ]; - buildInputs = - [ - xkeyboard_config - libxkbcommon # for xkbregistry - isocodes - gtk3 - gtk4 - glib - ] - ++ lib.optionals withSystemd [ - systemd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - bubblewrap - wayland - libseccomp - udev - ]; + buildInputs = [ + xkeyboard_config + libxkbcommon # for xkbregistry + isocodes + gtk3 + gtk4 + glib + ] + ++ lib.optionals withSystemd [ + systemd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + bubblewrap + wayland + libseccomp + udev + ]; propagatedBuildInputs = [ gsettings-desktop-schemas ]; - mesonFlags = - [ - "-Dgtk_doc=true" - "-Ddesktop_docs=false" - (lib.mesonEnable "systemd" withSystemd) - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "-Dudev=disabled" - ]; + mesonFlags = [ + "-Dgtk_doc=true" + "-Ddesktop_docs=false" + (lib.mesonEnable "systemd" withSystemd) + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "-Dudev=disabled" + ]; separateDebugInfo = stdenv.hostPlatform.isLinux; diff --git a/pkgs/by-name/gn/gnome-keysign/package.nix b/pkgs/by-name/gn/gnome-keysign/package.nix index b7422d9ee7db..0e17038371b9 100644 --- a/pkgs/by-name/gn/gnome-keysign/package.nix +++ b/pkgs/by-name/gn/gnome-keysign/package.nix @@ -22,15 +22,14 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-k77z8Yligzs4rHpPckRGcC5qnCHynHQRjdDkzxwt1Ss="; }; - nativeBuildInputs = - [ - wrapGAppsHook3 - gobject-introspection - ] - ++ (with python3.pkgs; [ - babel - babelgladeextractor - ]); + nativeBuildInputs = [ + wrapGAppsHook3 + gobject-introspection + ] + ++ (with python3.pkgs; [ + babel + babelgladeextractor + ]); buildInputs = [ # TODO: add avahi support diff --git a/pkgs/by-name/gn/gnome-music/package.nix b/pkgs/by-name/gn/gnome-music/package.nix index 32bfa64b6f78..c13a6cb8da5a 100644 --- a/pkgs/by-name/gn/gnome-music/package.nix +++ b/pkgs/by-name/gn/gnome-music/package.nix @@ -53,31 +53,30 @@ python3.pkgs.buildPythonApplication rec { gobject-introspection ]; - buildInputs = - [ - gtk4 - pango - glib - libmediaart - gnome-online-accounts - gdk-pixbuf - python3 - grilo - grilo-plugins - libnotify - libsoup_3 - libadwaita - gsettings-desktop-schemas - tinysparql - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ]); + buildInputs = [ + gtk4 + pango + glib + libmediaart + gnome-online-accounts + gdk-pixbuf + python3 + grilo + grilo-plugins + libnotify + libsoup_3 + libadwaita + gsettings-desktop-schemas + tinysparql + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav + ]); pythonPath = with python3.pkgs; [ pycairo diff --git a/pkgs/by-name/gn/gnome-online-accounts/package.nix b/pkgs/by-name/gn/gnome-online-accounts/package.nix index 178c1ae9b02b..9fd684483143 100644 --- a/pkgs/by-name/gn/gnome-online-accounts/package.nix +++ b/pkgs/by-name/gn/gnome-online-accounts/package.nix @@ -34,15 +34,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "gnome-online-accounts"; version = "3.54.4"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals enableBackend [ - "man" - "devdoc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals enableBackend [ + "man" + "devdoc" + ]; src = fetchurl { url = "mirror://gnome/sources/gnome-online-accounts/${lib.versions.majorMinor finalAttrs.version}/gnome-online-accounts-${finalAttrs.version}.tar.xz"; @@ -70,25 +69,24 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook4 ]; - buildInputs = - [ - dbus - gcr_4 - glib - glib-networking - gtk4 - libadwaita - gvfs # OwnCloud, Google Drive - json-glib - libkrb5 - librest_1_0 - libxml2 - libsecret - libsoup_3 - ] - ++ lib.optionals enableBackend [ - keyutils - ]; + buildInputs = [ + dbus + gcr_4 + glib + glib-networking + gtk4 + libadwaita + gvfs # OwnCloud, Google Drive + json-glib + libkrb5 + librest_1_0 + libxml2 + libsecret + libsoup_3 + ] + ++ lib.optionals enableBackend [ + keyutils + ]; postFixup = '' # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. diff --git a/pkgs/by-name/gn/gnome-panel/wrapper.nix b/pkgs/by-name/gn/gnome-panel/wrapper.nix index 5490c0f6258b..30f9c1823857 100644 --- a/pkgs/by-name/gn/gnome-panel/wrapper.nix +++ b/pkgs/by-name/gn/gnome-panel/wrapper.nix @@ -15,7 +15,8 @@ let selectedPanelModulePackages = [ gnome-panel gnome-flashback - ] ++ panelModulePackages; + ] + ++ panelModulePackages; panelModulesEnv = buildEnv { name = "gnome-panel-modules-env"; @@ -33,8 +34,7 @@ stdenv.mkDerivation { ]; buildInputs = - selectedPanelModulePackages - ++ lib.forEach selectedPanelModulePackages (x: x.buildInputs or [ ]); + selectedPanelModulePackages ++ lib.forEach selectedPanelModulePackages (x: x.buildInputs or [ ]); dontUnpack = true; dontConfigure = true; diff --git a/pkgs/by-name/gn/gnome-settings-daemon/package.nix b/pkgs/by-name/gn/gnome-settings-daemon/package.nix index a4fd4a916ed1..11d273c81492 100644 --- a/pkgs/by-name/gn/gnome-settings-daemon/package.nix +++ b/pkgs/by-name/gn/gnome-settings-daemon/package.nix @@ -80,41 +80,39 @@ stdenv.mkDerivation (finalAttrs: { udevCheckHook ]; - buildInputs = - [ - gtk3 - glib - gsettings-desktop-schemas - modemmanager - networkmanager - libnotify - libgnomekbd # for org.gnome.libgnomekbd.keyboard schema - gnome-desktop - libpulseaudio - alsa-lib - libcanberra-gtk3 - upower - colord - libgweather - polkit - geocode-glib_2 - geoclue2 - libgudev - libwacom - gcr_4 - ] - ++ lib.optionals withSystemd [ - systemd - ]; + buildInputs = [ + gtk3 + glib + gsettings-desktop-schemas + modemmanager + networkmanager + libnotify + libgnomekbd # for org.gnome.libgnomekbd.keyboard schema + gnome-desktop + libpulseaudio + alsa-lib + libcanberra-gtk3 + upower + colord + libgweather + polkit + geocode-glib_2 + geoclue2 + libgudev + libwacom + gcr_4 + ] + ++ lib.optionals withSystemd [ + systemd + ]; - mesonFlags = - [ - "-Dudev_dir=${placeholder "out"}/lib/udev" - (lib.mesonBool "systemd" withSystemd) - ] - ++ lib.optionals withSystemd [ - "-Dgnome_session_ctl_path=${gnome-session-ctl}/libexec/gnome-session-ctl" - ]; + mesonFlags = [ + "-Dudev_dir=${placeholder "out"}/lib/udev" + (lib.mesonBool "systemd" withSystemd) + ] + ++ lib.optionals withSystemd [ + "-Dgnome_session_ctl_path=${gnome-session-ctl}/libexec/gnome-session-ctl" + ]; # Default for release buildtype but passed manually because # we're using plain diff --git a/pkgs/by-name/gn/gnome-software/package.nix b/pkgs/by-name/gn/gnome-software/package.nix index 475449737e09..aca565e89de5 100644 --- a/pkgs/by-name/gn/gnome-software/package.nix +++ b/pkgs/by-name/gn/gnome-software/package.nix @@ -101,12 +101,14 @@ stdenv.mkDerivation (finalAttrs: { # For video screenshots gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good - ] ++ lib.optionals withFwupd [ fwupd ]; + ] + ++ lib.optionals withFwupd [ fwupd ]; mesonFlags = [ # Requires /etc/machine-id, D-Bus system bus, etc. "-Dtests=false" - ] ++ lib.optionals (!withFwupd) [ "-Dfwupd=false" ]; + ] + ++ lib.optionals (!withFwupd) [ "-Dfwupd=false" ]; passthru = { updateScript = gnome.updateScript { packageName = "gnome-software"; }; diff --git a/pkgs/by-name/gn/gnome-sound-recorder/package.nix b/pkgs/by-name/gn/gnome-sound-recorder/package.nix index 8d0d97461c18..34739b77d926 100644 --- a/pkgs/by-name/gn/gnome-sound-recorder/package.nix +++ b/pkgs/by-name/gn/gnome-sound-recorder/package.nix @@ -39,20 +39,19 @@ stdenv.mkDerivation rec { desktop-file-utils ]; - buildInputs = - [ - gjs - glib - gtk4 - gdk-pixbuf - libadwaita - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad # for gstreamer-player-1.0 - ]); + buildInputs = [ + gjs + glib + gtk4 + gdk-pixbuf + libadwaita + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad # for gstreamer-player-1.0 + ]); postPatch = '' chmod +x build-aux/meson_post_install.py diff --git a/pkgs/by-name/gn/gnome-user-share/package.nix b/pkgs/by-name/gn/gnome-user-share/package.nix index cb300d5afd47..130c293073eb 100644 --- a/pkgs/by-name/gn/gnome-user-share/package.nix +++ b/pkgs/by-name/gn/gnome-user-share/package.nix @@ -39,21 +39,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-tQoP0yBOCesj2kwgBUoqmcVtFttwML2N+wfSULtfC4w="; }; - preConfigure = - '' - substituteInPlace data/dav_user_2.4.conf \ - --replace-fail \ - 'LoadModule dnssd_module ''${HTTP_MODULES_PATH}/mod_dnssd.so' \ - 'LoadModule dnssd_module ${mod_dnssd}/modules/mod_dnssd.so' \ - --replace-fail \ - '${"$"}{HTTP_MODULES_PATH}' \ - '${apacheHttpd}/modules' - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace meson.build --replace-fail \ - "run_command([httpd, '-v']" \ - "run_command(['${stdenv.hostPlatform.emulator buildPackages}', httpd, '-v']" - ''; + preConfigure = '' + substituteInPlace data/dav_user_2.4.conf \ + --replace-fail \ + 'LoadModule dnssd_module ''${HTTP_MODULES_PATH}/mod_dnssd.so' \ + 'LoadModule dnssd_module ${mod_dnssd}/modules/mod_dnssd.so' \ + --replace-fail \ + '${"$"}{HTTP_MODULES_PATH}' \ + '${apacheHttpd}/modules' + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace meson.build --replace-fail \ + "run_command([httpd, '-v']" \ + "run_command(['${stdenv.hostPlatform.emulator buildPackages}', httpd, '-v']" + ''; mesonFlags = [ "-Dhttpd=${apacheHttpd.out}/bin/httpd" diff --git a/pkgs/by-name/gn/gnss-sdr/package.nix b/pkgs/by-name/gn/gnss-sdr/package.nix index 3ed4bc4e415a..b1eddee05f54 100644 --- a/pkgs/by-name/gn/gnss-sdr/package.nix +++ b/pkgs/by-name/gn/gnss-sdr/package.nix @@ -51,41 +51,40 @@ gnuradio.pkgs.mkDerivation rec { gtest ]; - buildInputs = - [ - gmp - armadillo - glog - gflags - openssl - orc - blas - lapack - matio - pugixml - protobuf - gnuradio.unwrapped.boost - gnuradio.unwrapped.logLib - ] - ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [ - gnuradio.unwrapped.uhd - ] - ++ lib.optionals (enableRawUdp) [ - libpcap - ] - ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ - thrift - gnuradio.unwrapped.python.pkgs.thrift - ] - ++ lib.optionals (gnuradio.hasFeature "gr-pdu" || gnuradio.hasFeature "gr-iio") [ - gnuradio.unwrapped.libiio - ] - ++ lib.optionals (gnuradio.hasFeature "gr-pdu") [ - gnuradio.unwrapped.libad9361 - ] - ++ lib.optionals (enableOsmosdr) [ - gnuradio.pkgs.osmosdr - ]; + buildInputs = [ + gmp + armadillo + glog + gflags + openssl + orc + blas + lapack + matio + pugixml + protobuf + gnuradio.unwrapped.boost + gnuradio.unwrapped.logLib + ] + ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [ + gnuradio.unwrapped.uhd + ] + ++ lib.optionals (enableRawUdp) [ + libpcap + ] + ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ + thrift + gnuradio.unwrapped.python.pkgs.thrift + ] + ++ lib.optionals (gnuradio.hasFeature "gr-pdu" || gnuradio.hasFeature "gr-iio") [ + gnuradio.unwrapped.libiio + ] + ++ lib.optionals (gnuradio.hasFeature "gr-pdu") [ + gnuradio.unwrapped.libad9361 + ] + ++ lib.optionals (enableOsmosdr) [ + gnuradio.pkgs.osmosdr + ]; cmakeFlags = [ (lib.cmakeFeature "GFlags_INCLUDE_DIRS" "${gflags}/include") diff --git a/pkgs/by-name/gn/gnu-smalltalk/package.nix b/pkgs/by-name/gn/gnu-smalltalk/package.nix index b6c961a5c72b..07d83d8bdd13 100644 --- a/pkgs/by-name/gn/gnu-smalltalk/package.nix +++ b/pkgs/by-name/gn/gnu-smalltalk/package.nix @@ -64,7 +64,8 @@ stdenv.mkDerivation rec { cairo SDL sqlite - ] ++ lib.optional emacsSupport emacs; + ] + ++ lib.optional emacsSupport emacs; configureFlags = lib.optional (!emacsSupport) "--without-emacs"; diff --git a/pkgs/by-name/gn/gnucash/package.nix b/pkgs/by-name/gn/gnucash/package.nix index ea19e4deae3e..51d18d83fb91 100644 --- a/pkgs/by-name/gn/gnucash/package.nix +++ b/pkgs/by-name/gn/gnucash/package.nix @@ -53,31 +53,30 @@ stdenv.mkDerivation rec { "-DPYTHON_SYSCONFIG_BUILD=\"$out\"" ]; - buildInputs = - [ - aqbanking - boost - glib - glibcLocales - gtest - guile - gwenhywfar - icu - libdbi - libdbiDrivers - libofx - libsecret - libxml2 - libxslt - swig - webkitgtk_4_0 - python3 - ] - ++ (with perlPackages; [ - JSONParse - FinanceQuote - perl - ]); + buildInputs = [ + aqbanking + boost + glib + glibcLocales + gtest + guile + gwenhywfar + icu + libdbi + libdbiDrivers + libofx + libsecret + libxml2 + libxslt + swig + webkitgtk_4_0 + python3 + ] + ++ (with perlPackages; [ + JSONParse + FinanceQuote + perl + ]); patches = [ # this patch disables test-gnc-timezone and test-gnc-datetime which fail due to nix datetime challenges diff --git a/pkgs/by-name/gn/gnucobol/package.nix b/pkgs/by-name/gn/gnucobol/package.nix index 5aa662f00406..fb420d14264f 100644 --- a/pkgs/by-name/gn/gnucobol/package.nix +++ b/pkgs/by-name/gn/gnucobol/package.nix @@ -77,17 +77,16 @@ stdenv.mkDerivation (finalAttrs: { sed -i "/^875;/d" tests/testsuite ''; - preConfigure = - '' - autoconf - aclocal - automake - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # when building with nix on darwin, configure will use GNU strip, - # which fails due to using --strip-unneeded, which is not supported - substituteInPlace configure --replace-fail '"GNU strip"' 'FAKE GNU strip' - ''; + preConfigure = '' + autoconf + aclocal + automake + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # when building with nix on darwin, configure will use GNU strip, + # which fails due to using --strip-unneeded, which is not supported + substituteInPlace configure --replace-fail '"GNU strip"' 'FAKE GNU strip' + ''; # error: call to undeclared function 'xmlCleanupParser' # ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] diff --git a/pkgs/by-name/gn/gnum4/package.nix b/pkgs/by-name/gn/gnum4/package.nix index 4a096c117ec5..7f11614842a2 100644 --- a/pkgs/by-name/gn/gnum4/package.nix +++ b/pkgs/by-name/gn/gnum4/package.nix @@ -20,14 +20,13 @@ stdenv.mkDerivation (finalAttrs: { # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion # necessary for FreeBSD code path in configure - postPatch = - '' - substituteInPlace ./build-aux/config.guess --replace-fail /usr/bin/uname uname - '' - + lib.optionalString stdenv.hostPlatform.isLoongArch64 '' - touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die - find . -name Makefile.in -exec touch {} + || die - ''; + postPatch = '' + substituteInPlace ./build-aux/config.guess --replace-fail /usr/bin/uname uname + '' + + lib.optionalString stdenv.hostPlatform.isLoongArch64 '' + touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die + find . -name Makefile.in -exec touch {} + || die + ''; strictDeps = true; @@ -42,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--with-syscmd-shell=${stdenv.shell}" - ] ++ lib.optional stdenv.hostPlatform.isMinGW "CFLAGS=-fno-stack-protector"; + ] + ++ lib.optional stdenv.hostPlatform.isMinGW "CFLAGS=-fno-stack-protector"; meta = { description = "GNU M4, a macro processor"; diff --git a/pkgs/by-name/gn/gnumeric/package.nix b/pkgs/by-name/gn/gnumeric/package.nix index a31fc31d5357..12a5ed975906 100644 --- a/pkgs/by-name/gn/gnumeric/package.nix +++ b/pkgs/by-name/gn/gnumeric/package.nix @@ -48,18 +48,17 @@ stdenv.mkDerivation (finalAttrs: { # ToDo: optional libgda, introspection? # TODO: fix Perl plugin when cross-compiling - buildInputs = - [ - goffice - gtk3 - adwaita-icon-theme - python - pygobject3 - ] - ++ (with perlPackages; [ - perl - XMLParser - ]); + buildInputs = [ + goffice + gtk3 + adwaita-icon-theme + python + pygobject3 + ] + ++ (with perlPackages; [ + perl + XMLParser + ]); enableParallelBuilding = true; diff --git a/pkgs/by-name/go/go-musicfox/package.nix b/pkgs/by-name/go/go-musicfox/package.nix index 8fc71f8323fe..c31408679b83 100644 --- a/pkgs/by-name/go/go-musicfox/package.nix +++ b/pkgs/by-name/go/go-musicfox/package.nix @@ -36,13 +36,12 @@ buildGoModule rec { pkg-config ]; - buildInputs = - [ - flac - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ]; + buildInputs = [ + flac + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/go/go-task/package.nix b/pkgs/by-name/go/go-task/package.nix index 1f9f7b11da70..b9da79f98aed 100644 --- a/pkgs/by-name/go/go-task/package.nix +++ b/pkgs/by-name/go/go-task/package.nix @@ -33,16 +33,15 @@ buildGoModule (finalAttrs: { env.CGO_ENABLED = 0; - postInstall = - '' - ln -s $out/bin/task $out/bin/go-task - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd task \ - --bash <($out/bin/task --completion bash) \ - --fish <($out/bin/task --completion fish) \ - --zsh <($out/bin/task --completion zsh) - ''; + postInstall = '' + ln -s $out/bin/task $out/bin/go-task + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd task \ + --bash <($out/bin/task --completion bash) \ + --fish <($out/bin/task --completion fish) \ + --zsh <($out/bin/task --completion zsh) + ''; nativeInstallCheckInputs = [ versionCheckHook diff --git a/pkgs/by-name/go/goaccess/package.nix b/pkgs/by-name/go/goaccess/package.nix index c3a8865f9b92..1a242c9ec589 100644 --- a/pkgs/by-name/go/goaccess/package.nix +++ b/pkgs/by-name/go/goaccess/package.nix @@ -23,18 +23,18 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ - ncurses - openssl - ] - ++ lib.optionals withGeolocation [ libmaxminddb ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ gettext ]; + buildInputs = [ + ncurses + openssl + ] + ++ lib.optionals withGeolocation [ libmaxminddb ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ gettext ]; configureFlags = [ "--enable-utf8" "--with-openssl" - ] ++ lib.optionals withGeolocation [ "--enable-geoip=mmdb" ]; + ] + ++ lib.optionals withGeolocation [ "--enable-geoip=mmdb" ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.hostPlatform.isDarwin [ diff --git a/pkgs/by-name/go/goarista/package.nix b/pkgs/by-name/go/goarista/package.nix index 87f68addd919..04b897a6fcda 100644 --- a/pkgs/by-name/go/goarista/package.nix +++ b/pkgs/by-name/go/goarista/package.nix @@ -22,7 +22,8 @@ buildGoModule { let skippedTests = [ "TestDeepSizeof" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestDialTCPTimeoutWithTOS" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestDialTCPTimeoutWithTOS" ]; in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; diff --git a/pkgs/by-name/go/golden-cheetah/package.nix b/pkgs/by-name/go/golden-cheetah/package.nix index f1dde6dc67db..021f016f8245 100644 --- a/pkgs/by-name/go/golden-cheetah/package.nix +++ b/pkgs/by-name/go/golden-cheetah/package.nix @@ -54,15 +54,14 @@ stdenv.mkDerivation (finalAttrs: { libusb-compat-0_1 zlib ]; - nativeBuildInputs = - [ - bison - flex - ] - ++ (with qt6; [ - qmake - wrapQtAppsHook - ]); + nativeBuildInputs = [ + bison + flex + ] + ++ (with qt6; [ + qmake + wrapQtAppsHook + ]); patches = [ # allow building with bison 3.7 diff --git a/pkgs/by-name/go/gomanagedocker/package.nix b/pkgs/by-name/go/gomanagedocker/package.nix index b9245766f566..04b7afaf56ee 100644 --- a/pkgs/by-name/go/gomanagedocker/package.nix +++ b/pkgs/by-name/go/gomanagedocker/package.nix @@ -33,7 +33,8 @@ buildGoModule { buildInputs = [ gpgme btrfs-progs - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ xorg.libX11 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ xorg.libX11 ]; ldflags = [ "-s" diff --git a/pkgs/by-name/go/goodvibes/package.nix b/pkgs/by-name/go/goodvibes/package.nix index 653f3cf1ed9a..02944b66b646 100644 --- a/pkgs/by-name/go/goodvibes/package.nix +++ b/pkgs/by-name/go/goodvibes/package.nix @@ -36,22 +36,21 @@ stdenv.mkDerivation rec { desktop-file-utils ]; - buildInputs = - [ - glib - # for libsoup TLS support - glib-networking - gtk3 - libsoup_3 - keybinder3 - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - ]); + buildInputs = [ + glib + # for libsoup TLS support + glib-networking + gtk3 + libsoup_3 + keybinder3 + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + ]); postPatch = '' patchShebangs scripts diff --git a/pkgs/by-name/go/google-amber/package.nix b/pkgs/by-name/go/google-amber/package.nix index 187ba46ab539..270db1e31b8a 100644 --- a/pkgs/by-name/go/google-amber/package.nix +++ b/pkgs/by-name/go/google-amber/package.nix @@ -67,16 +67,15 @@ stdenv.mkDerivation (finalAttrs: { vulkan-loader ]; - nativeBuildInputs = - [ - cmake - makeWrapper - pkg-config - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ]; + nativeBuildInputs = [ + cmake + makeWrapper + pkg-config + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ]; # Tests are disabled so we do not have to pull in googletest and more dependencies cmakeFlags = [ diff --git a/pkgs/by-name/go/google-chrome/package.nix b/pkgs/by-name/go/google-chrome/package.nix index 655656401dde..e70a9db428fd 100644 --- a/pkgs/by-name/go/google-chrome/package.nix +++ b/pkgs/by-name/go/google-chrome/package.nix @@ -103,71 +103,70 @@ let opusWithCustomModes = libopus.override { withCustomModes = true; }; - deps = - [ - alsa-lib - at-spi2-atk - at-spi2-core - atk - bzip2 - cairo - coreutils - cups - curl - dbus - expat - flac - fontconfig - freetype - gcc-unwrapped.lib - gdk-pixbuf - glib - harfbuzz - icu - libcap - libdrm - liberation_ttf - libexif - libglvnd - libkrb5 - libpng - libX11 - libxcb - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libxkbcommon - libXrandr - libXrender - libXScrnSaver - libxshmfence - libXtst - libgbm - nspr - nss - opusWithCustomModes - pango - pciutils - pipewire - snappy - speechd-minimal - systemd - util-linux - vulkan-loader - wayland - wget - ] - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional libvaSupport libva - ++ [ - gtk3 - gtk4 - qt6.qtbase - qt6.qtwayland - ]; + deps = [ + alsa-lib + at-spi2-atk + at-spi2-core + atk + bzip2 + cairo + coreutils + cups + curl + dbus + expat + flac + fontconfig + freetype + gcc-unwrapped.lib + gdk-pixbuf + glib + harfbuzz + icu + libcap + libdrm + liberation_ttf + libexif + libglvnd + libkrb5 + libpng + libX11 + libxcb + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libxkbcommon + libXrandr + libXrender + libXScrnSaver + libxshmfence + libXtst + libgbm + nspr + nss + opusWithCustomModes + pango + pciutils + pipewire + snappy + speechd-minimal + systemd + util-linux + vulkan-loader + wayland + wget + ] + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional libvaSupport libva + ++ [ + gtk3 + gtk4 + qt6.qtbase + qt6.qtwayland + ]; linux = stdenvNoCC.mkDerivation (finalAttrs: { inherit pname meta passthru; diff --git a/pkgs/by-name/go/google-cloud-cpp/package.nix b/pkgs/by-name/go/google-cloud-cpp/package.nix index 13d04e8a2da9..4446c8105dc2 100644 --- a/pkgs/by-name/go/google-cloud-cpp/package.nix +++ b/pkgs/by-name/go/google-cloud-cpp/package.nix @@ -119,20 +119,19 @@ stdenv.mkDerivation rec { gtest ]; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS:BOOL=${if staticOnly then "OFF" else "ON"}" - # unconditionally build tests to catch linker errors as early as possible - # this adds a good chunk of time to the build - "-DBUILD_TESTING:BOOL=ON" - "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF" - ] - ++ lib.optionals (apis != [ "*" ]) [ - "-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-DGOOGLE_CLOUD_CPP_GRPC_PLUGIN_EXECUTABLE=${lib.getBin pkgsBuildHost.grpc}/bin/grpc_cpp_plugin" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS:BOOL=${if staticOnly then "OFF" else "ON"}" + # unconditionally build tests to catch linker errors as early as possible + # this adds a good chunk of time to the build + "-DBUILD_TESTING:BOOL=ON" + "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF" + ] + ++ lib.optionals (apis != [ "*" ]) [ + "-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-DGOOGLE_CLOUD_CPP_GRPC_PLUGIN_EXECUTABLE=${lib.getBin pkgsBuildHost.grpc}/bin/grpc_cpp_plugin" + ]; requiredSystemFeatures = [ "big-parallel" ]; diff --git a/pkgs/by-name/go/google-fonts/package.nix b/pkgs/by-name/go/google-fonts/package.nix index 8e1338bbd880..e4af1e844e0e 100644 --- a/pkgs/by-name/go/google-fonts/package.nix +++ b/pkgs/by-name/go/google-fonts/package.nix @@ -49,25 +49,24 @@ stdenvNoCC.mkDerivation { # FamilyName.ttf. This installs all fonts if fonts is empty and otherwise # only the specified fonts by FamilyName. fonts = map (font: builtins.replaceStrings [ " " ] [ "" ] font) fonts; - installPhase = - '' - adobeBlankDest=$adobeBlank/share/fonts/truetype - install -m 444 -Dt $adobeBlankDest ofl/adobeblank/AdobeBlank-Regular.ttf - rm -r ofl/adobeblank - dest=$out/share/fonts/truetype - '' - + ( - if fonts == [ ] then - '' - find . -name '*.ttf' -exec install -m 444 -Dt $dest '{}' + - '' - else - '' - for font in $fonts; do - find . \( -name "$font-*.ttf" -o -name "$font[*.ttf" -o -name "$font.ttf" \) -exec install -m 444 -Dt $dest '{}' + - done - '' - ); + installPhase = '' + adobeBlankDest=$adobeBlank/share/fonts/truetype + install -m 444 -Dt $adobeBlankDest ofl/adobeblank/AdobeBlank-Regular.ttf + rm -r ofl/adobeblank + dest=$out/share/fonts/truetype + '' + + ( + if fonts == [ ] then + '' + find . -name '*.ttf' -exec install -m 444 -Dt $dest '{}' + + '' + else + '' + for font in $fonts; do + find . \( -name "$font-*.ttf" -o -name "$font[*.ttf" -o -name "$font.ttf" \) -exec install -m 444 -Dt $dest '{}' + + done + '' + ); meta = with lib; { homepage = "https://fonts.google.com"; diff --git a/pkgs/by-name/go/goose-cli/package.nix b/pkgs/by-name/go/goose-cli/package.nix index af469a871f05..34b48736e29d 100644 --- a/pkgs/by-name/go/goose-cli/package.nix +++ b/pkgs/by-name/go/goose-cli/package.nix @@ -58,34 +58,33 @@ rustPlatform.buildRustPackage (finalAttrs: { __darwinAllowLocalNetworking = true; - checkFlags = - [ - # need dbus-daemon - "--skip=config::base::tests::test_multiple_secrets" - "--skip=config::base::tests::test_secret_management" - "--skip=config::base::tests::test_concurrent_extension_writes" - # Observer should be Some with both init project keys set - "--skip=tracing::langfuse_layer::tests::test_create_langfuse_observer" - "--skip=providers::gcpauth::tests::test_token_refresh_race_condition" - # Lazy instance has previously been poisoned - "--skip=jetbrains::tests::test_capabilities" - "--skip=jetbrains::tests::test_router_creation" - "--skip=logging::tests::test_log_file_name::with_session_name_and_error_capture" - "--skip=logging::tests::test_log_file_name::with_session_name_without_error_capture" - "--skip=logging::tests::test_log_file_name::without_session_name" - "--skip=developer::tests::test_text_editor_str_replace" - # need API keys - "--skip=providers::factory::tests::test_create_lead_worker_provider" - "--skip=providers::factory::tests::test_create_regular_provider_without_lead_config" - "--skip=providers::factory::tests::test_lead_model_env_vars_with_defaults" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--skip=providers::gcpauth::tests::test_load_from_metadata_server" - "--skip=providers::oauth::tests::test_get_workspace_endpoints" - "--skip=tracing::langfuse_layer::tests::test_batch_manager_spawn_sender" - "--skip=tracing::langfuse_layer::tests::test_batch_send_partial_failure" - "--skip=tracing::langfuse_layer::tests::test_batch_send_success" - ]; + checkFlags = [ + # need dbus-daemon + "--skip=config::base::tests::test_multiple_secrets" + "--skip=config::base::tests::test_secret_management" + "--skip=config::base::tests::test_concurrent_extension_writes" + # Observer should be Some with both init project keys set + "--skip=tracing::langfuse_layer::tests::test_create_langfuse_observer" + "--skip=providers::gcpauth::tests::test_token_refresh_race_condition" + # Lazy instance has previously been poisoned + "--skip=jetbrains::tests::test_capabilities" + "--skip=jetbrains::tests::test_router_creation" + "--skip=logging::tests::test_log_file_name::with_session_name_and_error_capture" + "--skip=logging::tests::test_log_file_name::with_session_name_without_error_capture" + "--skip=logging::tests::test_log_file_name::without_session_name" + "--skip=developer::tests::test_text_editor_str_replace" + # need API keys + "--skip=providers::factory::tests::test_create_lead_worker_provider" + "--skip=providers::factory::tests::test_create_regular_provider_without_lead_config" + "--skip=providers::factory::tests::test_lead_model_env_vars_with_defaults" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--skip=providers::gcpauth::tests::test_load_from_metadata_server" + "--skip=providers::oauth::tests::test_get_workspace_endpoints" + "--skip=tracing::langfuse_layer::tests::test_batch_manager_spawn_sender" + "--skip=tracing::langfuse_layer::tests::test_batch_send_partial_failure" + "--skip=tracing::langfuse_layer::tests::test_batch_send_success" + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/go/gopher64/package.nix b/pkgs/by-name/go/gopher64/package.nix index 38837227cdc4..ee4e06f10b3d 100644 --- a/pkgs/by-name/go/gopher64/package.nix +++ b/pkgs/by-name/go/gopher64/package.nix @@ -60,15 +60,14 @@ rustPlatform.buildRustPackage (finalAttrs: { rustPlatform.bindgenHook ]; - buildInputs = - [ - bzip2 - sdl3 - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - moltenvk - ]; + buildInputs = [ + bzip2 + sdl3 + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + moltenvk + ]; # these are dlopen-ed during runtime runtimeDependencies = lib.optionalString stdenv.hostPlatform.isLinux [ diff --git a/pkgs/by-name/go/goss/package.nix b/pkgs/by-name/go/goss/package.nix index f081c5ab3801..5264b17d8603 100644 --- a/pkgs/by-name/go/goss/package.nix +++ b/pkgs/by-name/go/goss/package.nix @@ -41,7 +41,8 @@ buildGoModule rec { runtimeDependencies = [ bash getent - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]; in '' wrapProgram $out/bin/goss \ diff --git a/pkgs/by-name/go/gossip/package.nix b/pkgs/by-name/go/gossip/package.nix index 33eec234f389..d671cefc5cdc 100644 --- a/pkgs/by-name/go/gossip/package.nix +++ b/pkgs/by-name/go/gossip/package.nix @@ -45,33 +45,31 @@ rustPlatform.buildRustPackage rec { "lang-cjk" ]; - nativeBuildInputs = - [ - cmake - git - pkg-config - rustPlatform.bindgenHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland-scanner - ]; + nativeBuildInputs = [ + cmake + git + pkg-config + rustPlatform.bindgenHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland-scanner + ]; - buildInputs = - [ - SDL2 - ffmpeg_6 - fontconfig - libGL - libxkbcommon - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - libX11 - libXcursor - libXi - libXrandr - ]; + buildInputs = [ + SDL2 + ffmpeg_6 + fontconfig + libGL + libxkbcommon + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + libX11 + libXcursor + libXi + libXrandr + ]; # Tests rely on local files, so disable them. (I'm too lazy to patch it.) doCheck = false; diff --git a/pkgs/by-name/go/got/package.nix b/pkgs/by-name/go/got/package.nix index d523352a1759..fb1c03c11cc2 100644 --- a/pkgs/by-name/go/got/package.nix +++ b/pkgs/by-name/go/got/package.nix @@ -35,22 +35,22 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config bison - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = - [ - libressl - libbsd - libevent - libuuid - libmd - zlib - ncurses - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libossp_uuid - apple-sdk_15 - ]; + buildInputs = [ + libressl + libbsd + libevent + libuuid + libmd + zlib + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libossp_uuid + apple-sdk_15 + ]; preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' # The configure script assumes dependencies on Darwin are installed via diff --git a/pkgs/by-name/gp/gpac/package.nix b/pkgs/by-name/gp/gpac/package.nix index 837ea06a44ae..44da242fca32 100644 --- a/pkgs/by-name/gp/gpac/package.nix +++ b/pkgs/by-name/gp/gpac/package.nix @@ -20,13 +20,12 @@ stdenv.mkDerivation rec { # this is the bare minimum configuration, as I'm only interested in MP4Box # For most other functionality, this should probably be extended - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ]; buildInputs = [ zlib diff --git a/pkgs/by-name/gp/gperftools/package.nix b/pkgs/by-name/gp/gperftools/package.nix index 8a6048c09215..6a4fe6e6af6c 100644 --- a/pkgs/by-name/gp/gperftools/package.nix +++ b/pkgs/by-name/gp/gperftools/package.nix @@ -31,11 +31,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; # tcmalloc uses libunwind in a way that works correctly only on non-ARM dynamically linked linux - buildInputs = - [ perl ] - ++ lib.optional ( - stdenv.hostPlatform.isLinux && !(stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isStatic) - ) libunwind; + buildInputs = [ + perl + ] + ++ lib.optional ( + stdenv.hostPlatform.isLinux && !(stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isStatic) + ) libunwind; # Disable general dynamic TLS on AArch to support dlopen()'ing the library: # https://bugzilla.redhat.com/show_bug.cgi?id=1483558 diff --git a/pkgs/by-name/gp/gpscorrelate/package.nix b/pkgs/by-name/gp/gpscorrelate/package.nix index 5d9107343c26..4bd63153db4f 100644 --- a/pkgs/by-name/gp/gpscorrelate/package.nix +++ b/pkgs/by-name/gp/gpscorrelate/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { libxslt pkg-config wrapGAppsHook3 - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; buildInputs = [ exiv2 diff --git a/pkgs/by-name/gp/gpsd/package.nix b/pkgs/by-name/gp/gpsd/package.nix index 871e82736f7d..4b9ce26531fc 100644 --- a/pkgs/by-name/gp/gpsd/package.nix +++ b/pkgs/by-name/gp/gpsd/package.nix @@ -43,38 +43,36 @@ stdenv.mkDerivation rec { }; # TODO: render & install HTML documentation using asciidoctor - nativeBuildInputs = - [ - pkg-config - python3Packages.wrapPython - scons - ] - ++ lib.optionals guiSupport [ - gobject-introspection - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + pkg-config + python3Packages.wrapPython + scons + ] + ++ lib.optionals guiSupport [ + gobject-introspection + wrapGAppsHook3 + ]; - buildInputs = - [ - dbus - libusb1 - ncurses - python3Packages.python - ] - ++ lib.optionals kppsSupport [ - pps-tools - ] - ++ lib.optionals guiSupport [ - atk - dbus-glib - gdk-pixbuf - libX11 - libXaw - libXext - libXpm - libXt - pango - ]; + buildInputs = [ + dbus + libusb1 + ncurses + python3Packages.python + ] + ++ lib.optionals kppsSupport [ + pps-tools + ] + ++ lib.optionals guiSupport [ + atk + dbus-glib + gdk-pixbuf + libX11 + libXaw + libXext + libXpm + libXt + pango + ]; pythonPath = lib.optionals guiSupport [ python3Packages.pygobject3 diff --git a/pkgs/by-name/gp/gpt4all/package.nix b/pkgs/by-name/gp/gpt4all/package.nix index 35b32f300c39..fbc125b5e854 100644 --- a/pkgs/by-name/gp/gpt4all/package.nix +++ b/pkgs/by-name/gp/gpt4all/package.nix @@ -44,54 +44,51 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot = "${finalAttrs.src.name}/gpt4all-chat"; - nativeBuildInputs = - [ - cmake - qt6.wrapQtAppsHook - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + qt6.wrapQtAppsHook + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; - buildInputs = + buildInputs = [ + duckx + fmt + qt6.qt5compat + qt6.qtbase + qt6.qtdeclarative + qt6.qthttpserver + qt6.qtsvg + qt6.qttools + qt6.qtwayland + qt6.qtwebengine + shaderc + vulkan-headers + wayland + ] + ++ lib.optionals cudaSupport ( + with cudaPackages; [ - duckx - fmt - qt6.qt5compat - qt6.qtbase - qt6.qtdeclarative - qt6.qthttpserver - qt6.qtsvg - qt6.qttools - qt6.qtwayland - qt6.qtwebengine - shaderc - vulkan-headers - wayland + cuda_cccl + cuda_cudart + libcublas ] - ++ lib.optionals cudaSupport ( - with cudaPackages; - [ - cuda_cccl - cuda_cudart - libcublas - ] - ); + ); - cmakeFlags = - [ - (lib.cmakeBool "KOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER" false) - (lib.cmakeBool "KOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK" true) - (lib.cmakeBool "KOMPUTE_OPT_USE_BUILT_IN_FMT" false) + cmakeFlags = [ + (lib.cmakeBool "KOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER" false) + (lib.cmakeBool "KOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK" true) + (lib.cmakeBool "KOMPUTE_OPT_USE_BUILT_IN_FMT" false) - # https://github.com/NixOS/nixpkgs/issues/298997 - # https://github.com/nomic-ai/gpt4all/issues/3468 - (lib.cmakeBool "LLMODEL_KOMPUTE" false) - ] - ++ lib.optionals (!cudaSupport) [ - (lib.cmakeBool "LLMODEL_CUDA" false) - ]; + # https://github.com/NixOS/nixpkgs/issues/298997 + # https://github.com/nomic-ai/gpt4all/issues/3468 + (lib.cmakeBool "LLMODEL_KOMPUTE" false) + ] + ++ lib.optionals (!cudaSupport) [ + (lib.cmakeBool "LLMODEL_CUDA" false) + ]; postInstall = '' rm -rf $out/include diff --git a/pkgs/by-name/gp/gptfdisk/package.nix b/pkgs/by-name/gp/gptfdisk/package.nix index 4965084857a6..e376f5fddb56 100644 --- a/pkgs/by-name/gp/gptfdisk/package.nix +++ b/pkgs/by-name/gp/gptfdisk/package.nix @@ -20,24 +20,23 @@ stdenv.mkDerivation rec { sha256 = "sha256-Kr7WG8bSuexJiXPARAuLgEt6ctcUQGm1qSCbKtaTooI="; }; - postPatch = - '' - patchShebangs gdisk_test.sh - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Makefile.mac --replace \ - "-mmacosx-version-min=10.4" "-mmacosx-version-min=10.6" - substituteInPlace Makefile.mac --replace \ - " -arch i386" "" - substituteInPlace Makefile.mac --replace \ - "-arch x86_64" "" - substituteInPlace Makefile.mac --replace \ - "-arch arm64" "" - substituteInPlace Makefile.mac --replace \ - " -I/opt/local/include -I /usr/local/include -I/opt/local/include" "" - substituteInPlace Makefile.mac --replace \ - "/usr/local/Cellar/ncurses/6.2/lib/libncurses.dylib" "${ncurses.out}/lib/libncurses.dylib" - ''; + postPatch = '' + patchShebangs gdisk_test.sh + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Makefile.mac --replace \ + "-mmacosx-version-min=10.4" "-mmacosx-version-min=10.6" + substituteInPlace Makefile.mac --replace \ + " -arch i386" "" + substituteInPlace Makefile.mac --replace \ + "-arch x86_64" "" + substituteInPlace Makefile.mac --replace \ + "-arch arm64" "" + substituteInPlace Makefile.mac --replace \ + " -I/opt/local/include -I /usr/local/include -I/opt/local/include" "" + substituteInPlace Makefile.mac --replace \ + "/usr/local/Cellar/ncurses/6.2/lib/libncurses.dylib" "${ncurses.out}/lib/libncurses.dylib" + ''; buildPhase = lib.optionalString stdenv.hostPlatform.isDarwin "make -f Makefile.mac"; buildInputs = [ diff --git a/pkgs/by-name/gp/gpufetch/package.nix b/pkgs/by-name/gp/gpufetch/package.nix index 712ea4975a33..123dbe399224 100644 --- a/pkgs/by-name/gp/gpufetch/package.nix +++ b/pkgs/by-name/gp/gpufetch/package.nix @@ -25,25 +25,23 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-1j23h3TDxa2xu03o37fXfRL3XFYyhMWFGupAlkrYpBY="; }; - nativeBuildInputs = - [ - cmake - installShellFiles - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + installShellFiles + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; - buildInputs = - [ - zlib - pciutils - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - cudaPackages.cuda_nvml_dev - ]; + buildInputs = [ + zlib + pciutils + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + cudaPackages.cuda_nvml_dev + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/gq/gqrx/package.nix b/pkgs/by-name/gq/gqrx/package.nix index d9ddb2c6c3a6..1d91b52ce7a8 100644 --- a/pkgs/by-name/gq/gqrx/package.nix +++ b/pkgs/by-name/gq/gqrx/package.nix @@ -43,31 +43,31 @@ gnuradioMinimal.pkgs.mkDerivation rec { pkg-config qt6Packages.wrapQtAppsHook wrapGAppsHook3 - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; - buildInputs = - [ - gnuradioMinimal.unwrapped.logLib - mpir - fftwFloat - libjack2 - gnuradioMinimal.unwrapped.boost - qt6Packages.qtbase - qt6Packages.qtsvg - gnuradioMinimal.pkgs.osmosdr - rtl-sdr - hackrf - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - qt6Packages.qtwayland - ] - ++ lib.optionals (gnuradioMinimal.hasFeature "gr-ctrlport") [ - thrift - gnuradioMinimal.unwrapped.python.pkgs.thrift - ] - ++ lib.optionals pulseaudioSupport [ libpulseaudio ] - ++ lib.optionals portaudioSupport [ portaudio ]; + buildInputs = [ + gnuradioMinimal.unwrapped.logLib + mpir + fftwFloat + libjack2 + gnuradioMinimal.unwrapped.boost + qt6Packages.qtbase + qt6Packages.qtsvg + gnuradioMinimal.pkgs.osmosdr + rtl-sdr + hackrf + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + qt6Packages.qtwayland + ] + ++ lib.optionals (gnuradioMinimal.hasFeature "gr-ctrlport") [ + thrift + gnuradioMinimal.unwrapped.python.pkgs.thrift + ] + ++ lib.optionals pulseaudioSupport [ libpulseaudio ] + ++ lib.optionals portaudioSupport [ portaudio ]; cmakeFlags = let diff --git a/pkgs/by-name/gr/grail/package.nix b/pkgs/by-name/gr/grail/package.nix index 85e61cbc7031..93a3bd282d96 100644 --- a/pkgs/by-name/gr/grail/package.nix +++ b/pkgs/by-name/gr/grail/package.nix @@ -19,18 +19,17 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - python3 - frame - ] - ++ lib.optionals enableX11 [ - xorg.libX11 - xorg.libXtst - xorg.libXext - xorg.libXi - xorg.libXfixes - ]; + buildInputs = [ + python3 + frame + ] + ++ lib.optionals enableX11 [ + xorg.libX11 + xorg.libXtst + xorg.libXext + xorg.libXi + xorg.libXfixes + ]; configureFlags = lib.optional enableX11 "--with-x11"; diff --git a/pkgs/by-name/gr/gramps/package.nix b/pkgs/by-name/gr/gramps/package.nix index 68f3e0178d23..970e84a93218 100644 --- a/pkgs/by-name/gr/gramps/package.nix +++ b/pkgs/by-name/gr/gramps/package.nix @@ -60,34 +60,32 @@ python3Packages.buildPythonApplication rec { gobject-introspection ]; - nativeCheckInputs = - [ - glibcLocales - python3Packages.unittestCheckHook - python3Packages.jsonschema - python3Packages.mock - python3Packages.lxml - ] - # TODO: use JHBuild to build the Gramps' bundle - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeCheckInputs = [ + glibcLocales + python3Packages.unittestCheckHook + python3Packages.jsonschema + python3Packages.mock + python3Packages.lxml + ] + # TODO: use JHBuild to build the Gramps' bundle + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; - buildInputs = - [ - gtk3 - pango - gexiv2 - ] - # Map support - ++ lib.optionals enableOSM [ - osm-gps-map - glib-networking - ] - # Graphviz support - ++ lib.optional enableGraphviz graphviz - # Ghostscript support - ++ lib.optional enableGhostscript ghostscript; + buildInputs = [ + gtk3 + pango + gexiv2 + ] + # Map support + ++ lib.optionals enableOSM [ + osm-gps-map + glib-networking + ] + # Graphviz support + ++ lib.optional enableGraphviz graphviz + # Ghostscript support + ++ lib.optional enableGhostscript ghostscript; preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/by-name/gr/grandorgue/package.nix b/pkgs/by-name/gr/grandorgue/package.nix index 50cb8076b3c0..e39ac03091a9 100644 --- a/pkgs/by-name/gr/grandorgue/package.nix +++ b/pkgs/by-name/gr/grandorgue/package.nix @@ -43,19 +43,18 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - fftwFloat - zlib - wavpack - wxGTK32 - yaml-cpp - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - udev - ] - ++ lib.optional jackaudioSupport libjack2; + buildInputs = [ + fftwFloat + zlib + wavpack + wxGTK32 + yaml-cpp + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + udev + ] + ++ lib.optional jackaudioSupport libjack2; cmakeFlags = lib.optionals (!jackaudioSupport) [ diff --git a/pkgs/by-name/gr/graphene/package.nix b/pkgs/by-name/gr/graphene/package.nix index 0cdf6d7c83ab..9502ae099818 100644 --- a/pkgs/by-name/gr/graphene/package.nix +++ b/pkgs/by-name/gr/graphene/package.nix @@ -34,13 +34,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "graphene"; version = "1.10.8"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withDocumentation [ "devdoc" ] - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "installedTests" ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withDocumentation [ "devdoc" ] + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "installedTests" ]; src = fetchFromGitHub { owner = "ebassi"; @@ -67,25 +66,24 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - makeWrapper - ] - ++ lib.optionals withDocumentation [ - docbook_xml_dtd_43 - docbook_xsl - gtk-doc - ] - ++ lib.optionals (withDocumentation && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + makeWrapper + ] + ++ lib.optionals withDocumentation [ + docbook_xml_dtd_43 + docbook_xsl + gtk-doc + ] + ++ lib.optionals (withDocumentation && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; buildInputs = [ glib @@ -95,33 +93,31 @@ stdenv.mkDerivation (finalAttrs: { mutest ]; - mesonFlags = - [ - (lib.mesonBool "gtk_doc" withDocumentation) - (lib.mesonEnable "introspection" withIntrospection) - "-Dinstalled_test_datadir=${placeholder "installedTests"}/share" - "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - # the box test is failing with SIGBUS on armv7l-linux - # https://github.com/ebassi/graphene/issues/215 - "-Darm_neon=false" - ]; + mesonFlags = [ + (lib.mesonBool "gtk_doc" withDocumentation) + (lib.mesonEnable "introspection" withIntrospection) + "-Dinstalled_test_datadir=${placeholder "installedTests"}/share" + "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + # the box test is failing with SIGBUS on armv7l-linux + # https://github.com/ebassi/graphene/issues/215 + "-Darm_neon=false" + ]; doCheck = true; - postPatch = - '' - patchShebangs tests/gen-installed-test.py - '' - + lib.optionalString withIntrospection '' - PATH=${ - python3.withPackages (pp: [ - pp.pygobject3 - pp.tappy - ]) - }/bin:$PATH patchShebangs tests/introspection.py - ''; + postPatch = '' + patchShebangs tests/gen-installed-test.py + '' + + lib.optionalString withIntrospection '' + PATH=${ + python3.withPackages (pp: [ + pp.pygobject3 + pp.tappy + ]) + }/bin:$PATH patchShebangs tests/introspection.py + ''; postFixup = let diff --git a/pkgs/by-name/gr/graphicsmagick/package.nix b/pkgs/by-name/gr/graphicsmagick/package.nix index 427f37b2c8f5..e4e0743990aa 100644 --- a/pkgs/by-name/gr/graphicsmagick/package.nix +++ b/pkgs/by-name/gr/graphicsmagick/package.nix @@ -53,13 +53,15 @@ stdenv.mkDerivation (finalAttrs: { libwebp libxml2 zlib - ] ++ lib.optionals libheifSupport [ libheif ]; + ] + ++ lib.optionals libheifSupport [ libheif ]; nativeBuildInputs = [ nukeReferences pkg-config xz - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; configureFlags = [ # specify delegates explicitly otherwise `gm` will invoke the build diff --git a/pkgs/by-name/gr/grass/package.nix b/pkgs/by-name/gr/grass/package.nix index 9cfecce436da..2843a22a57c0 100644 --- a/pkgs/by-name/gr/grass/package.nix +++ b/pkgs/by-name/gr/grass/package.nix @@ -49,87 +49,84 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-q1jOimQi+24I1ZBf6Z0cvAyXcBFBpT5aWSNeG6n6y0k="; }; - nativeBuildInputs = - [ - makeWrapper - wrapGAppsHook3 + nativeBuildInputs = [ + makeWrapper + wrapGAppsHook3 - bison - flex - gdal # for `gdal-config` - geos # for `geos-config` - netcdf # for `nc-config` - pkg-config - ] - ++ (with python3Packages; [ - python-dateutil - numpy - wxpython - ]); + bison + flex + gdal # for `gdal-config` + geos # for `geos-config` + netcdf # for `nc-config` + pkg-config + ] + ++ (with python3Packages; [ + python-dateutil + numpy + wxpython + ]); - buildInputs = - [ - blas - cairo - ffmpeg - fftw - freetype - gdal - geos - lapack - libpng - libsvm - libtiff - libxml2 - netcdf - pdal - libpq - proj - readline - sqlite - wxGTK32 - zlib - zstd - ] - ++ lib.optionals withOpenGL [ libGLU ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] - ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + buildInputs = [ + blas + cairo + ffmpeg + fftw + freetype + gdal + geos + lapack + libpng + libsvm + libtiff + libxml2 + netcdf + pdal + libpq + proj + readline + sqlite + wxGTK32 + zlib + zstd + ] + ++ lib.optionals withOpenGL [ libGLU ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; strictDeps = true; - configureFlags = - [ - "--with-blas" - "--with-cairo-ldflags=-lfontconfig" - "--with-cxx" - "--with-fftw" - "--with-freetype" - "--with-geos" - "--with-gdal" - "--with-lapack" - "--with-libsvm" - "--with-nls" - "--with-openmp" - "--with-pdal" - "--with-postgres" - "--with-postgres-libs=${libpq}/lib/" - "--with-proj-includes=${proj.dev}/include" - "--with-proj-libs=${proj}/lib" - "--with-proj-share=${proj}/share/proj" - "--with-sqlite" - "--with-zstd" - "--without-bzlib" - "--without-mysql" - "--without-odbc" - ] - ++ lib.optionals (!withOpenGL) [ - "--without-opengl" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--without-cairo" - "--without-freetype" - "--without-x" - ]; + configureFlags = [ + "--with-blas" + "--with-cairo-ldflags=-lfontconfig" + "--with-cxx" + "--with-fftw" + "--with-freetype" + "--with-geos" + "--with-gdal" + "--with-lapack" + "--with-libsvm" + "--with-nls" + "--with-openmp" + "--with-pdal" + "--with-postgres" + "--with-postgres-libs=${libpq}/lib/" + "--with-proj-includes=${proj.dev}/include" + "--with-proj-libs=${proj}/lib" + "--with-proj-share=${proj}/share/proj" + "--with-sqlite" + "--with-zstd" + "--without-bzlib" + "--without-mysql" + "--without-odbc" + ] + ++ lib.optionals (!withOpenGL) [ + "--without-opengl" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--without-cairo" + "--without-freetype" + "--without-x" + ]; # Otherwise a very confusing "Can't load GDAL library" error makeFlags = lib.optional stdenv.hostPlatform.isDarwin "GDAL_DYNAMIC="; diff --git a/pkgs/by-name/gr/gretl/package.nix b/pkgs/by-name/gr/gretl/package.nix index 17ce63306bd2..2dc3941efac5 100644 --- a/pkgs/by-name/gr/gretl/package.nix +++ b/pkgs/by-name/gr/gretl/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { mpfr openblas readline - ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/gr/gridtracker2/package.nix b/pkgs/by-name/gr/gridtracker2/package.nix index 8e0f50737b77..c56bb4f340e4 100644 --- a/pkgs/by-name/gr/gridtracker2/package.nix +++ b/pkgs/by-name/gr/gridtracker2/package.nix @@ -64,79 +64,76 @@ buildNpmPackage (finalAttrs: { install -Dvm644 ${./package-lock.json} package-lock.json ''; - buildPhase = - '' - runHook preBuild - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # electronDist needs to be modifiable on Darwin - cp -r ${electron.dist} electron-dist - chmod -R u+w electron-dist + buildPhase = '' + runHook preBuild + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # electronDist needs to be modifiable on Darwin + cp -r ${electron.dist} electron-dist + chmod -R u+w electron-dist - # Disable code signing during build on macOS. - # https://github.com/electron-userland/electron-builder/blob/fa6fc16/docs/code-signing.md#how-to-disable-code-signing-during-the-build-process-on-macos - export CSC_IDENTITY_AUTO_DISCOVERY=false + # Disable code signing during build on macOS. + # https://github.com/electron-userland/electron-builder/blob/fa6fc16/docs/code-signing.md#how-to-disable-code-signing-during-the-build-process-on-macos + export CSC_IDENTITY_AUTO_DISCOVERY=false - npm exec electron-builder -- \ - --dir \ - -c.electronDist=electron-dist \ - -c.electronVersion=${electron.version} - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - npm exec electron-builder -- \ - --dir \ - -c.electronDist=${electron.dist} \ - -c.electronVersion=${electron.version} - '' - + '' - runHook postBuild - ''; + npm exec electron-builder -- \ + --dir \ + -c.electronDist=electron-dist \ + -c.electronVersion=${electron.version} + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + npm exec electron-builder -- \ + --dir \ + -c.electronDist=${electron.dist} \ + -c.electronVersion=${electron.version} + '' + + '' + runHook postBuild + ''; - runtimeInputs = - [ - at-spi2-atk - gtk3 - libnotify - libsecret - libuuid - nss - xdg-utils - xorg.libXScrnSaver - xorg.libXtst - ] - ++ lib.optionals stdenv.isLinux [ - libappindicator-gtk3 - ]; + runtimeInputs = [ + at-spi2-atk + gtk3 + libnotify + libsecret + libuuid + nss + xdg-utils + xorg.libXScrnSaver + xorg.libXtst + ] + ++ lib.optionals stdenv.isLinux [ + libappindicator-gtk3 + ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dvm644 -t "$out/share/gridtracker2/resources" \ - ./dist/linux*/resources/* - install -Dvm644 -t "$out/share/gridtracker2/locales" \ - ./dist/linux*/locales/* - install -Dvm644 ./resources/icon.png \ - "$out/share/pixmaps/gridtracker2.png" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dvm644 -t "$out/share/gridtracker2/resources" \ + ./dist/linux*/resources/* + install -Dvm644 -t "$out/share/gridtracker2/locales" \ + ./dist/linux*/locales/* + install -Dvm644 ./resources/icon.png \ + "$out/share/pixmaps/gridtracker2.png" - makeWrapper ${lib.getExe electron} $out/bin/gridtracker2 \ - --add-flags $out/share/gridtracker2/resources/app.asar \ - --prefix PATH : "${lib.makeBinPath finalAttrs.runtimeInputs}" \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.runtimeInputs}" \ - --add-flags "--no-sandbox --disable-gpu-sandbox" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --inherit-argv0 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications $out/bin - cp -r dist/mac*/GridTracker2.app $out/Applications - ln -s $out/Applications/GridTracker2.app/Contents/MacOS/GridTracker2 $out/bin/gridtracker2 - '' - + '' - runHook postInstall - ''; + makeWrapper ${lib.getExe electron} $out/bin/gridtracker2 \ + --add-flags $out/share/gridtracker2/resources/app.asar \ + --prefix PATH : "${lib.makeBinPath finalAttrs.runtimeInputs}" \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath finalAttrs.runtimeInputs}" \ + --add-flags "--no-sandbox --disable-gpu-sandbox" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --inherit-argv0 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications $out/bin + cp -r dist/mac*/GridTracker2.app $out/Applications + ln -s $out/Applications/GridTracker2.app/Contents/MacOS/GridTracker2 $out/bin/gridtracker2 + '' + + '' + runHook postInstall + ''; meta = { description = "Warehouse of amateur radio information"; diff --git a/pkgs/by-name/gr/grilo/package.nix b/pkgs/by-name/gr/grilo/package.nix index 20334e4cda1b..fc85bed3a689 100644 --- a/pkgs/by-name/gr/grilo/package.nix +++ b/pkgs/by-name/gr/grilo/package.nix @@ -45,22 +45,21 @@ stdenv.mkDerivation rec { "-Denable-gtk-doc=true" ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - gettext - gobject-introspection - vala - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + gettext + gobject-introspection + vala + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/gr/groff/package.nix b/pkgs/by-name/gr/groff/package.nix index fe25d58d66ec..3077330609d0 100644 --- a/pkgs/by-name/gr/groff/package.nix +++ b/pkgs/by-name/gr/groff/package.nix @@ -44,57 +44,54 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - postPatch = - '' - # BASH_PROG gets replaced with a path to the build bash which doesn't get automatically patched by patchShebangs - substituteInPlace contrib/gdiffmk/gdiffmk.sh \ - --replace "@BASH_PROG@" "/bin/sh" - '' - + lib.optionalString enableHtml '' - substituteInPlace src/preproc/html/pre-html.cpp \ - --replace "psselect" "${psutils}/bin/psselect" \ - --replace "pnmcut" "${lib.getBin netpbm}/bin/pnmcut" \ - --replace "pnmcrop" "${lib.getBin netpbm}/bin/pnmcrop" \ - --replace "pnmtopng" "${lib.getBin netpbm}/bin/pnmtopng" - substituteInPlace tmac/www.tmac.in \ - --replace "pnmcrop" "${lib.getBin netpbm}/bin/pnmcrop" \ - --replace "pngtopnm" "${lib.getBin netpbm}/bin/pngtopnm" \ - --replace "@PNMTOPS_NOSETPAGE@" "${lib.getBin netpbm}/bin/pnmtops -nosetpage" - '' - + lib.optionalString (enableGhostscript || enableHtml) '' - substituteInPlace contrib/pdfmark/pdfroff.sh \ - --replace '$GROFF_GHOSTSCRIPT_INTERPRETER' "${lib.getBin ghostscript}/bin/gs" \ - --replace '$GROFF_AWK_INTERPRETER' "${lib.getBin gawk}/bin/gawk" - ''; + postPatch = '' + # BASH_PROG gets replaced with a path to the build bash which doesn't get automatically patched by patchShebangs + substituteInPlace contrib/gdiffmk/gdiffmk.sh \ + --replace "@BASH_PROG@" "/bin/sh" + '' + + lib.optionalString enableHtml '' + substituteInPlace src/preproc/html/pre-html.cpp \ + --replace "psselect" "${psutils}/bin/psselect" \ + --replace "pnmcut" "${lib.getBin netpbm}/bin/pnmcut" \ + --replace "pnmcrop" "${lib.getBin netpbm}/bin/pnmcrop" \ + --replace "pnmtopng" "${lib.getBin netpbm}/bin/pnmtopng" + substituteInPlace tmac/www.tmac.in \ + --replace "pnmcrop" "${lib.getBin netpbm}/bin/pnmcrop" \ + --replace "pngtopnm" "${lib.getBin netpbm}/bin/pngtopnm" \ + --replace "@PNMTOPS_NOSETPAGE@" "${lib.getBin netpbm}/bin/pnmtops -nosetpage" + '' + + lib.optionalString (enableGhostscript || enableHtml) '' + substituteInPlace contrib/pdfmark/pdfroff.sh \ + --replace '$GROFF_GHOSTSCRIPT_INTERPRETER' "${lib.getBin ghostscript}/bin/gs" \ + --replace '$GROFF_AWK_INTERPRETER' "${lib.getBin gawk}/bin/gawk" + ''; strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - texinfo - ] - # Required due to the patch that changes .ypp files. - ++ lib.optional (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "9") bison; - buildInputs = - [ - perl - bashNonInteractive - ] - ++ lib.optionals enableGhostscript [ - ghostscript - gawk - libX11 - libXaw - libXt - libXmu - ] - ++ lib.optionals enableHtml [ - psutils - netpbm - ] - ++ lib.optionals enableIconv [ iconv ] - ++ lib.optionals enableLibuchardet [ libuchardet ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + texinfo + ] + # Required due to the patch that changes .ypp files. + ++ lib.optional (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "9") bison; + buildInputs = [ + perl + bashNonInteractive + ] + ++ lib.optionals enableGhostscript [ + ghostscript + gawk + libX11 + libXaw + libXt + libXmu + ] + ++ lib.optionals enableHtml [ + psutils + netpbm + ] + ++ lib.optionals enableIconv [ iconv ] + ++ lib.optionals enableLibuchardet [ libuchardet ]; # Builds running without a chroot environment may detect the presence # of /usr/X11 in the host system, leading to an impure build of the diff --git a/pkgs/by-name/gr/groonga/package.nix b/pkgs/by-name/gr/groonga/package.nix index 3f7442292250..3ed9105b56b3 100644 --- a/pkgs/by-name/gr/groonga/package.nix +++ b/pkgs/by-name/gr/groonga/package.nix @@ -40,25 +40,24 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - rapidjson - xxHash - zstd - mecab - kytea - msgpack-c - ] - ++ lib.optionals lz4Support [ - lz4 - ] - ++ lib.optional zlibSupport [ - zlib - ] - ++ lib.optionals suggestSupport [ - zeromq - libevent - ]; + buildInputs = [ + rapidjson + xxHash + zstd + mecab + kytea + msgpack-c + ] + ++ lib.optionals lz4Support [ + lz4 + ] + ++ lib.optional zlibSupport [ + zlib + ] + ++ lib.optionals suggestSupport [ + zeromq + libevent + ]; env.NIX_CFLAGS_COMPILE = lib.optionalString zlibSupport "-I${zlib.dev}/include"; diff --git a/pkgs/by-name/gr/grpc/package.nix b/pkgs/by-name/gr/grpc/package.nix index 0d5df0db0002..34ca53f27bc1 100644 --- a/pkgs/by-name/gr/grpc/package.nix +++ b/pkgs/by-name/gr/grpc/package.nix @@ -43,29 +43,29 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - patches = - [ - (fetchpatch { - # armv6l support, https://github.com/grpc/grpc/pull/21341 - name = "grpc-link-libatomic.patch"; - url = "https://github.com/lopsided98/grpc/commit/a9b917666234f5665c347123d699055d8c2537b2.patch"; - hash = "sha256-Lm0GQsz/UjBbXXEE14lT0dcRzVmCKycrlrdBJj+KLu8="; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fix build of 1.63.0 and newer on darwin: https://github.com/grpc/grpc/issues/36654 - ./dynamic-lookup-darwin.patch - # https://github.com/grpc/grpc/issues/39170 - (fetchurl { - url = "https://raw.githubusercontent.com/rdhafidh/vcpkg/0ae97b7b81562bd66ab99d022551db1449c079f9/ports/grpc/00017-add-src-upb.patch"; - hash = "sha256-0zaJqeCM90DTtUR6xCUorahUpiJF3D/KODYkUXQh2ok="; - }) - ]; + patches = [ + (fetchpatch { + # armv6l support, https://github.com/grpc/grpc/pull/21341 + name = "grpc-link-libatomic.patch"; + url = "https://github.com/lopsided98/grpc/commit/a9b917666234f5665c347123d699055d8c2537b2.patch"; + hash = "sha256-Lm0GQsz/UjBbXXEE14lT0dcRzVmCKycrlrdBJj+KLu8="; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fix build of 1.63.0 and newer on darwin: https://github.com/grpc/grpc/issues/36654 + ./dynamic-lookup-darwin.patch + # https://github.com/grpc/grpc/issues/39170 + (fetchurl { + url = "https://raw.githubusercontent.com/rdhafidh/vcpkg/0ae97b7b81562bd66ab99d022551db1449c079f9/ports/grpc/00017-add-src-upb.patch"; + hash = "sha256-0zaJqeCM90DTtUR6xCUorahUpiJF3D/KODYkUXQh2ok="; + }) + ]; nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) grpc; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) grpc; propagatedBuildInputs = [ c-ares re2 @@ -75,37 +75,37 @@ stdenv.mkDerivation rec { buildInputs = [ openssl protobuf - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libnsl ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libnsl ]; - cmakeFlags = - [ - "-DgRPC_ZLIB_PROVIDER=package" - "-DgRPC_CARES_PROVIDER=package" - "-DgRPC_RE2_PROVIDER=package" - "-DgRPC_SSL_PROVIDER=package" - "-DgRPC_PROTOBUF_PROVIDER=package" - "-DgRPC_ABSL_PROVIDER=package" - "-DBUILD_SHARED_LIBS=ON" + cmakeFlags = [ + "-DgRPC_ZLIB_PROVIDER=package" + "-DgRPC_CARES_PROVIDER=package" + "-DgRPC_RE2_PROVIDER=package" + "-DgRPC_SSL_PROVIDER=package" + "-DgRPC_PROTOBUF_PROVIDER=package" + "-DgRPC_ABSL_PROVIDER=package" + "-DBUILD_SHARED_LIBS=ON" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" + "-D_gRPC_CPP_PLUGIN=${buildPackages.grpc}/bin/grpc_cpp_plugin" + ] + # The build scaffold defaults to c++14 on darwin, even when the compiler uses + # a more recent c++ version by default [1]. However, downgrades are + # problematic, because the compatibility types in abseil will have different + # interface definitions than the ones used for building abseil itself. + # [1] https://github.com/grpc/grpc/blob/v1.57.0/CMakeLists.txt#L239-L243 + ++ ( + let + defaultCxxIsOlderThan17 = + (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.cc.version "16.0") + || (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.cc.version "11.0"); + in + lib.optionals (stdenv.hostPlatform.isDarwin && defaultCxxIsOlderThan17) [ + "-DCMAKE_CXX_STANDARD=17" ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" - "-D_gRPC_CPP_PLUGIN=${buildPackages.grpc}/bin/grpc_cpp_plugin" - ] - # The build scaffold defaults to c++14 on darwin, even when the compiler uses - # a more recent c++ version by default [1]. However, downgrades are - # problematic, because the compatibility types in abseil will have different - # interface definitions than the ones used for building abseil itself. - # [1] https://github.com/grpc/grpc/blob/v1.57.0/CMakeLists.txt#L239-L243 - ++ ( - let - defaultCxxIsOlderThan17 = - (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.cc.version "16.0") - || (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.cc.version "11.0"); - in - lib.optionals (stdenv.hostPlatform.isDarwin && defaultCxxIsOlderThan17) [ - "-DCMAKE_CXX_STANDARD=17" - ] - ); + ); # CMake creates a build directory by default, this conflicts with the # basel BUILD file on case-insensitive filesystems. diff --git a/pkgs/by-name/gs/gscan2pdf/package.nix b/pkgs/by-name/gs/gscan2pdf/package.nix index 599bf6d44513..c0ac37768c9d 100644 --- a/pkgs/by-name/gs/gscan2pdf/package.nix +++ b/pkgs/by-name/gs/gscan2pdf/package.nix @@ -38,42 +38,41 @@ perlPackages.buildPerlPackage rec { nativeBuildInputs = [ wrapGAppsHook3 ]; - buildInputs = - [ - librsvg - sane-backends - sane-frontends - ] - ++ (with perlPackages; [ - Gtk3 - Gtk3ImageView - Gtk3SimpleList - Cairo - CairoGObject - Glib - GlibObjectIntrospection - GooCanvas2 - GraphicsTIFF - IPCSystemSimple - LocaleCodes - LocaleGettext - PDFBuilder - ImagePNGLibpng - ImageSane - SetIntSpan - ImageMagick - ConfigGeneral - ListMoreUtils - HTMLParser - ProcProcessTable - LogLog4perl - TryTiny - DataUUID - DateCalc - IOString - FilesysDf - SubOverride - ]); + buildInputs = [ + librsvg + sane-backends + sane-frontends + ] + ++ (with perlPackages; [ + Gtk3 + Gtk3ImageView + Gtk3SimpleList + Cairo + CairoGObject + Glib + GlibObjectIntrospection + GooCanvas2 + GraphicsTIFF + IPCSystemSimple + LocaleCodes + LocaleGettext + PDFBuilder + ImagePNGLibpng + ImageSane + SetIntSpan + ImageMagick + ConfigGeneral + ListMoreUtils + HTMLParser + ProcProcessTable + LogLog4perl + TryTiny + DataUUID + DateCalc + IOString + FilesysDf + SubOverride + ]); postPatch = let @@ -113,23 +112,22 @@ perlPackages.buildPerlPackage rec { "man" ]; - nativeCheckInputs = - [ - imagemagick - libtiff - djvulibre - poppler-utils - ghostscript - unpaper - pdftk + nativeCheckInputs = [ + imagemagick + libtiff + djvulibre + poppler-utils + ghostscript + unpaper + pdftk - xvfb-run - file - tesseract3 # tests are expecting tesseract 3.x precisely - ] - ++ (with perlPackages; [ - TestPod - ]); + xvfb-run + file + tesseract3 # tests are expecting tesseract 3.x precisely + ] + ++ (with perlPackages; [ + TestPod + ]); checkPhase = '' # Temporarily disable a dubiously failing test: diff --git a/pkgs/by-name/gs/gscreenshot/package.nix b/pkgs/by-name/gs/gscreenshot/package.nix index abc1ac904e64..99488bd9307f 100644 --- a/pkgs/by-name/gs/gscreenshot/package.nix +++ b/pkgs/by-name/gs/gscreenshot/package.nix @@ -35,31 +35,30 @@ python3Packages.buildPythonApplication rec { doCheck = false; nativeBuildInputs = [ wrapGAppsHook3 ]; - propagatedBuildInputs = - [ - gettext - gobject-introspection - gtk3 - xdg-utils - ] - ++ lib.optionals waylandSupport [ - # wayland deps - grim - slurp - wl-clipboard - ] - ++ lib.optionals x11Support [ - # X11 deps - scrot - slop - xclip - python3Packages.xlib - ] - ++ (with python3Packages; [ - pillow - pygobject3 - setuptools - ]); + propagatedBuildInputs = [ + gettext + gobject-introspection + gtk3 + xdg-utils + ] + ++ lib.optionals waylandSupport [ + # wayland deps + grim + slurp + wl-clipboard + ] + ++ lib.optionals x11Support [ + # X11 deps + scrot + slop + xclip + python3Packages.xlib + ] + ++ (with python3Packages; [ + pillow + pygobject3 + setuptools + ]); patches = [ ./0001-Changing-paths-to-be-nix-compatible.patch ]; diff --git a/pkgs/by-name/gs/gsettings-desktop-schemas/package.nix b/pkgs/by-name/gs/gsettings-desktop-schemas/package.nix index 61baf68d5f80..cb40b950a43e 100644 --- a/pkgs/by-name/gs/gsettings-desktop-schemas/package.nix +++ b/pkgs/by-name/gs/gsettings-desktop-schemas/package.nix @@ -26,16 +26,15 @@ stdenv.mkDerivation rec { strictDeps = true; depsBuildBuild = [ pkg-config ]; - nativeBuildInputs = - [ - glib - meson - ninja - pkg-config - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + glib + meson + ninja + pkg-config + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; mesonFlags = [ (lib.mesonBool "introspection" withIntrospection) diff --git a/pkgs/by-name/gs/gsm/package.nix b/pkgs/by-name/gs/gsm/package.nix index 44beb9398df1..85dc7b187ce5 100644 --- a/pkgs/by-name/gs/gsm/package.nix +++ b/pkgs/by-name/gs/gsm/package.nix @@ -20,31 +20,30 @@ stdenv.mkDerivation rec { sha256 = "sha256-8Acukfa7hah4svbb9KC3yFDE3rgEnVVMZTQLO/ad8Kw="; }; - patchPhase = + patchPhase = '' + # Fix include directory + sed -e 's,$(GSM_INSTALL_ROOT)/inc,$(GSM_INSTALL_ROOT)/include/gsm,' -i Makefile + '' + + optionalString (!staticSupport) ( + ( + if isDarwin then + '' + # Build dylib on Darwin + sed -e 's,libgsm.a,libgsm.dylib,' -i Makefile + sed -e 's,$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS),$(LD) -o $(LIBGSM) -dynamiclib -install_name $(GSM_INSTALL_ROOT)/$(LIBGSM) $(GSM_OBJECTS) -lc,' -i Makefile + '' + else + '' + # Build ELF shared object by default + sed -e 's,libgsm.a,libgsm.so,' -i Makefile + sed -e 's/$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)/$(LD) -shared -Wl,-soname,libgsm.so -o $(LIBGSM) $(GSM_OBJECTS) -lc/' -i Makefile + '' + ) + + '' + # Remove line that is unused when building shared libraries + sed -e 's,$(RANLIB) $(LIBGSM),,' -i Makefile '' - # Fix include directory - sed -e 's,$(GSM_INSTALL_ROOT)/inc,$(GSM_INSTALL_ROOT)/include/gsm,' -i Makefile - '' - + optionalString (!staticSupport) ( - ( - if isDarwin then - '' - # Build dylib on Darwin - sed -e 's,libgsm.a,libgsm.dylib,' -i Makefile - sed -e 's,$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS),$(LD) -o $(LIBGSM) -dynamiclib -install_name $(GSM_INSTALL_ROOT)/$(LIBGSM) $(GSM_OBJECTS) -lc,' -i Makefile - '' - else - '' - # Build ELF shared object by default - sed -e 's,libgsm.a,libgsm.so,' -i Makefile - sed -e 's/$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)/$(LD) -shared -Wl,-soname,libgsm.so -o $(LIBGSM) $(GSM_OBJECTS) -lc/' -i Makefile - '' - ) - + '' - # Remove line that is unused when building shared libraries - sed -e 's,$(RANLIB) $(LIBGSM),,' -i Makefile - '' - ); + ); preBuild = '' makeFlagsArray+=(CC="$CC") diff --git a/pkgs/by-name/gs/gspell/package.nix b/pkgs/by-name/gs/gspell/package.nix index eb9d6f29c99c..94990edd6239 100644 --- a/pkgs/by-name/gs/gspell/package.nix +++ b/pkgs/by-name/gs/gspell/package.nix @@ -34,20 +34,19 @@ stdenv.mkDerivation rec { sha256 = "ZOodjp7cHCW0WpIOgNr2dVnRhm/81/hDL+z+ptD+iJc="; }; - nativeBuildInputs = - [ - docbook-xsl-nons - glib # glib-mkenums - gobject-introspection - gtk-doc - meson - ninja - pkg-config - vala - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + docbook-xsl-nons + glib # glib-mkenums + gobject-introspection + gtk-doc + meson + ninja + pkg-config + vala + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ gtk3 diff --git a/pkgs/by-name/gs/gst123/package.nix b/pkgs/by-name/gs/gst123/package.nix index 46b2fa3008f7..5bf2cdfa75f3 100644 --- a/pkgs/by-name/gs/gst123/package.nix +++ b/pkgs/by-name/gs/gst123/package.nix @@ -27,19 +27,18 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - gtk3 - ncurses - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ]); + buildInputs = [ + gtk3 + ncurses + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav + ]); enableParallelBuilding = true; diff --git a/pkgs/by-name/gt/gtest/package.nix b/pkgs/by-name/gt/gtest/package.nix index 6c3d41f31be4..33c07f339651 100644 --- a/pkgs/by-name/gt/gtest/package.nix +++ b/pkgs/by-name/gt/gtest/package.nix @@ -51,13 +51,12 @@ stdenv.mkDerivation rec { sanitiseHeaderPathsHook ]; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" - ] - ++ lib.optionals (cxx_standard != null) [ - "-DCMAKE_CXX_STANDARD=${cxx_standard}" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" + ] + ++ lib.optionals (cxx_standard != null) [ + "-DCMAKE_CXX_STANDARD=${cxx_standard}" + ]; meta = with lib; { description = "Google's framework for writing C++ tests"; diff --git a/pkgs/by-name/gt/gthumb/package.nix b/pkgs/by-name/gt/gthumb/package.nix index 7473b14d885e..5ecf555b233c 100644 --- a/pkgs/by-name/gt/gthumb/package.nix +++ b/pkgs/by-name/gt/gthumb/package.nix @@ -83,7 +83,8 @@ stdenv.mkDerivation (finalAttrs: { libtiff libwebp libX11 - ] ++ lib.optional withWebservices webkitgtk_4_0; + ] + ++ lib.optional withWebservices webkitgtk_4_0; mesonFlags = [ "-Dlibchamplain=true" diff --git a/pkgs/by-name/gt/gtk-doc/package.nix b/pkgs/by-name/gt/gtk-doc/package.nix index a609563d1725..716b2fa57947 100644 --- a/pkgs/by-name/gt/gtk-doc/package.nix +++ b/pkgs/by-name/gt/gtk-doc/package.nix @@ -54,15 +54,14 @@ python3.pkgs.buildPythonApplication rec { libxslt # for xsltproc ]; - buildInputs = - [ - docbook_xml_dtd_43 - docbook-xsl-nons - libxslt - ] - ++ lib.optionals withDblatex [ - dblatex - ]; + buildInputs = [ + docbook_xml_dtd_43 + docbook-xsl-nons + libxslt + ] + ++ lib.optionals withDblatex [ + dblatex + ]; pythonPath = with python3.pkgs; [ pygments # Needed for https://gitlab.gnome.org/GNOME/gtk-doc/blob/GTK_DOC_1_32/meson.build#L42 diff --git a/pkgs/by-name/gt/gtk-vnc/package.nix b/pkgs/by-name/gt/gtk-vnc/package.nix index 3732c0d94f9b..ee7d68fb48cb 100644 --- a/pkgs/by-name/gt/gtk-vnc/package.nix +++ b/pkgs/by-name/gt/gtk-vnc/package.nix @@ -53,20 +53,19 @@ stdenv.mkDerivation (finalAttrs: { gi-docgen ]; - buildInputs = - [ - gnutls - cairo - gdk-pixbuf - zlib - glib - gmp - cyrus_sasl - gtk3 - ] - ++ lib.optionals pulseaudioSupport [ - libpulseaudio - ]; + buildInputs = [ + gnutls + cairo + gdk-pixbuf + zlib + glib + gmp + cyrus_sasl + gtk3 + ] + ++ lib.optionals pulseaudioSupport [ + libpulseaudio + ]; mesonFlags = lib.optionals (!pulseaudioSupport) [ "-Dpulseaudio=disabled" diff --git a/pkgs/by-name/gt/gtk4-layer-shell/package.nix b/pkgs/by-name/gt/gtk4-layer-shell/package.nix index c47de743da1b..1c7099c0caa8 100644 --- a/pkgs/by-name/gt/gtk4-layer-shell/package.nix +++ b/pkgs/by-name/gt/gtk4-layer-shell/package.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation (finalAttrs: { docbook_xml_dtd_43 vala wayland-scanner - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; buildInputs = [ gtk4 diff --git a/pkgs/by-name/gt/gtkgnutella/package.nix b/pkgs/by-name/gt/gtkgnutella/package.nix index 5cd2eeb1680a..c27d79e5be10 100644 --- a/pkgs/by-name/gt/gtkgnutella/package.nix +++ b/pkgs/by-name/gt/gtkgnutella/package.nix @@ -32,28 +32,26 @@ stdenv.mkDerivation (finalAttrs: { gettext pkg-config ]; - buildInputs = - [ - glib - gnutls - libbfd - libxml2 - zlib - ] - ++ lib.optionals enableGui [ - gtk2 - ]; + buildInputs = [ + glib + gnutls + libbfd + libxml2 + zlib + ] + ++ lib.optionals enableGui [ + gtk2 + ]; configureScript = "./build.sh"; - configureFlags = - [ - "--configure-only" - # See https://sourceforge.net/p/gtk-gnutella/bugs/555/ - "--disable-malloc" - ] - ++ lib.optionals (!enableGui) [ - "--topless" - ]; + configureFlags = [ + "--configure-only" + # See https://sourceforge.net/p/gtk-gnutella/bugs/555/ + "--disable-malloc" + ] + ++ lib.optionals (!enableGui) [ + "--topless" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/gt/gtkwave/package.nix b/pkgs/by-name/gt/gtkwave/package.nix index 791c20365117..6ae23ab2b8a4 100644 --- a/pkgs/by-name/gt/gtkwave/package.nix +++ b/pkgs/by-name/gt/gtkwave/package.nix @@ -25,14 +25,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-VKpFeI1tUq+2WcOu8zWq/eDvLImQp3cPjqpk5X8ic0Y="; }; - nativeBuildInputs = - [ - pkg-config - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + pkg-config + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; buildInputs = [ bzip2 glib @@ -42,7 +41,8 @@ stdenv.mkDerivation rec { tcl tk xz - ] ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration; # fix compilation under Darwin # remove these patches upon next release diff --git a/pkgs/by-name/gt/gtypist/package.nix b/pkgs/by-name/gt/gtypist/package.nix index e1ee7c369730..facac531cc67 100644 --- a/pkgs/by-name/gt/gtypist/package.nix +++ b/pkgs/by-name/gt/gtypist/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation (finalAttrs: { ncurses perl fortune - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; preFixup = '' wrapProgram "$out/bin/typefortune" \ diff --git a/pkgs/by-name/gu/gucharmap/package.nix b/pkgs/by-name/gu/gucharmap/package.nix index a4f8e78ef38d..9eec9079f8e2 100644 --- a/pkgs/by-name/gu/gucharmap/package.nix +++ b/pkgs/by-name/gu/gucharmap/package.nix @@ -65,27 +65,26 @@ stdenv.mkDerivation (finalAttrs: { }; strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - wrapGAppsHook3 - unzip - intltool - itstool - gtk-doc - docbook_xsl - docbook_xml_dtd_45 - yelp-tools - libxml2 - desktop-file-utils - gobject-introspection - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + wrapGAppsHook3 + unzip + intltool + itstool + gtk-doc + docbook_xsl + docbook_xml_dtd_45 + yelp-tools + libxml2 + desktop-file-utils + gobject-introspection + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ gtk3 diff --git a/pkgs/by-name/gu/guestfs-tools/package.nix b/pkgs/by-name/gu/guestfs-tools/package.nix index ed1d1eff68e2..f1354419c178 100644 --- a/pkgs/by-name/gu/guestfs-tools/package.nix +++ b/pkgs/by-name/gu/guestfs-tools/package.nix @@ -38,29 +38,28 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-0xLCwj6TXU5b+tUewhKE9X0E+FN0MpX6+V+WHFxmiEc="; }; - nativeBuildInputs = - [ - bison - cdrkit - cpio - flex - getopt - makeWrapper - pkg-config - qemu - ] - ++ (with perlPackages; [ - GetoptLong - libintl-perl - ModuleBuild - perl - Po4a - ]) - ++ (with ocamlPackages; [ - findlib - ocaml - ounit2 - ]); + nativeBuildInputs = [ + bison + cdrkit + cpio + flex + getopt + makeWrapper + pkg-config + qemu + ] + ++ (with perlPackages; [ + GetoptLong + libintl-perl + ModuleBuild + perl + Po4a + ]) + ++ (with ocamlPackages; [ + findlib + ocaml + ounit2 + ]); buildInputs = [ bash-completion diff --git a/pkgs/by-name/gu/guilt/package.nix b/pkgs/by-name/gu/guilt/package.nix index 77152b5930bc..c8f1389da050 100644 --- a/pkgs/by-name/gu/guilt/package.nix +++ b/pkgs/by-name/gu/guilt/package.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation rec { gawk git gnused - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ openssl ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ openssl ]; makeFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/by-name/gu/gum/package.nix b/pkgs/by-name/gu/gum/package.nix index b6d9b5831172..4a822e25a380 100644 --- a/pkgs/by-name/gu/gum/package.nix +++ b/pkgs/by-name/gu/gum/package.nix @@ -23,17 +23,16 @@ buildGoModule rec { installShellFiles ]; - ldflags = - [ - "-s" - "-w" - "-X=main.Version=${version}" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) [ - "-linkmode=external" - "-extldflags" - "-static" - ]; + ldflags = [ + "-s" + "-w" + "-X=main.Version=${version}" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) [ + "-linkmode=external" + "-extldflags" + "-static" + ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' $out/bin/gum man > gum.1 diff --git a/pkgs/by-name/gu/gupnp-igd/package.nix b/pkgs/by-name/gu/gupnp-igd/package.nix index 245f9bbcb4d9..3ba55f2e462d 100644 --- a/pkgs/by-name/gu/gupnp-igd/package.nix +++ b/pkgs/by-name/gu/gupnp-igd/package.nix @@ -22,7 +22,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/gupnp-igd/${lib.versions.majorMinor finalAttrs.version}/gupnp-igd-${finalAttrs.version}.tar.xz"; diff --git a/pkgs/by-name/gu/gusb/package.nix b/pkgs/by-name/gu/gusb/package.nix index bbc21fcc2104..8ec444615ab9 100644 --- a/pkgs/by-name/gu/gusb/package.nix +++ b/pkgs/by-name/gu/gusb/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation rec { "bin" "out" "dev" - ] ++ lib.optionals withIntrospection [ "devdoc" ]; + ] + ++ lib.optionals withIntrospection [ "devdoc" ]; src = fetchFromGitHub { owner = "hughsie"; @@ -57,17 +58,16 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - gi-docgen - vala - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + gi-docgen + vala + ]; # all required in gusb.pc propagatedBuildInputs = [ diff --git a/pkgs/by-name/gv/gv/package.nix b/pkgs/by-name/gv/gv/package.nix index a35771ed0be3..1038447e9720 100644 --- a/pkgs/by-name/gv/gv/package.nix +++ b/pkgs/by-name/gv/gv/package.nix @@ -24,16 +24,15 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libXext - Xaw3d - ghostscriptX - perl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + libXext + Xaw3d + ghostscriptX + perl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; patchPhase = '' sed 's|\|${ghostscriptX}/bin/gs|g' -i "src/"*.in diff --git a/pkgs/by-name/gv/gvfs/package.nix b/pkgs/by-name/gv/gvfs/package.nix index b44ec36390a3..eafc3a83a2b1 100644 --- a/pkgs/by-name/gv/gvfs/package.nix +++ b/pkgs/by-name/gv/gvfs/package.nix @@ -76,72 +76,70 @@ stdenv.mkDerivation (finalAttrs: { docbook_xml_dtd_42 ]; - buildInputs = - [ - glib - libgcrypt - dbus - libgphoto2 - avahi - libarchive - libimobiledevice - libbluray - libnfs - libxml2 - gsettings-desktop-schemas - libsoup_3 - ] - ++ lib.optionals udevSupport [ - libgudev - udisks2 - fuse3 - libcdio - samba - libmtp - libcap - polkit - libcdio-paranoia - ] - ++ lib.optionals gnomeSupport [ - gcr_4 - glib-networking # TLS support - gnome-online-accounts - libsecret - libgdata - libmsgraph - ]; + buildInputs = [ + glib + libgcrypt + dbus + libgphoto2 + avahi + libarchive + libimobiledevice + libbluray + libnfs + libxml2 + gsettings-desktop-schemas + libsoup_3 + ] + ++ lib.optionals udevSupport [ + libgudev + udisks2 + fuse3 + libcdio + samba + libmtp + libcap + polkit + libcdio-paranoia + ] + ++ lib.optionals gnomeSupport [ + gcr_4 + glib-networking # TLS support + gnome-online-accounts + libsecret + libgdata + libmsgraph + ]; - mesonFlags = - [ - "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user" - "-Dtmpfilesdir=no" - ] - ++ lib.optionals (!udevSupport) [ - "-Dgudev=false" - "-Dudisks2=false" - "-Dfuse=false" - "-Dcdda=false" - "-Dsmb=false" - "-Dmtp=false" - "-Dadmin=false" - "-Dgphoto2=false" - "-Dlibusb=false" - "-Dlogind=false" - ] - ++ lib.optionals (!gnomeSupport) [ - "-Dgcr=false" - "-Dgoa=false" - "-Dkeyring=false" - "-Dgoogle=false" - "-Donedrive=false" - ] - ++ lib.optionals (avahi == null) [ - "-Ddnssd=false" - ] - ++ lib.optionals (samba == null) [ - # Xfce don't want samba - "-Dsmb=false" - ]; + mesonFlags = [ + "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user" + "-Dtmpfilesdir=no" + ] + ++ lib.optionals (!udevSupport) [ + "-Dgudev=false" + "-Dudisks2=false" + "-Dfuse=false" + "-Dcdda=false" + "-Dsmb=false" + "-Dmtp=false" + "-Dadmin=false" + "-Dgphoto2=false" + "-Dlibusb=false" + "-Dlogind=false" + ] + ++ lib.optionals (!gnomeSupport) [ + "-Dgcr=false" + "-Dgoa=false" + "-Dkeyring=false" + "-Dgoogle=false" + "-Donedrive=false" + ] + ++ lib.optionals (avahi == null) [ + "-Ddnssd=false" + ] + ++ lib.optionals (samba == null) [ + # Xfce don't want samba + "-Dsmb=false" + ]; doCheck = false; # fails with "ModuleNotFoundError: No module named 'gi'" doInstallCheck = finalAttrs.finalPackage.doCheck; diff --git a/pkgs/by-name/gw/gwyddion/package.nix b/pkgs/by-name/gw/gwyddion/package.nix index dd7681baa9df..6e2a96f439ce 100644 --- a/pkgs/by-name/gw/gwyddion/package.nix +++ b/pkgs/by-name/gw/gwyddion/package.nix @@ -45,25 +45,24 @@ stdenv.mkDerivation rec { file ]; - buildInputs = - [ - gtk2 - fftw - ] - ++ lib.optionals openglSupport [ - gnome2.gtkglext - libGL - ] - ++ lib.optional openexrSupport openexr - ++ lib.optional libXmuSupport xorg.libXmu - ++ lib.optional fitsSupport cfitsio - ++ lib.optional libpngSupport libpng - ++ lib.optional libxsltSupport libxslt - ++ lib.optional libxml2Support libxml2 - ++ lib.optional libwebpSupport libwebp - ++ lib.optional zlibSupport zlib - ++ lib.optional libuniqueSupport libunique - ++ lib.optional libzipSupport libzip; + buildInputs = [ + gtk2 + fftw + ] + ++ lib.optionals openglSupport [ + gnome2.gtkglext + libGL + ] + ++ lib.optional openexrSupport openexr + ++ lib.optional libXmuSupport xorg.libXmu + ++ lib.optional fitsSupport cfitsio + ++ lib.optional libpngSupport libpng + ++ lib.optional libxsltSupport libxslt + ++ lib.optional libxml2Support libxml2 + ++ lib.optional libwebpSupport libwebp + ++ lib.optional zlibSupport zlib + ++ lib.optional libuniqueSupport libunique + ++ lib.optional libzipSupport libzip; # This patch corrects problems with python support, but should apply cleanly # regardless of whether python support is enabled, and have no effects if diff --git a/pkgs/by-name/gx/gxkb/package.nix b/pkgs/by-name/gx/gxkb/package.nix index 2692a6523926..ecee614012a5 100644 --- a/pkgs/by-name/gx/gxkb/package.nix +++ b/pkgs/by-name/gx/gxkb/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { gtk3 libwnck libxklavier - ] ++ lib.optional appindicatorSupport libayatana-appindicator; + ] + ++ lib.optional appindicatorSupport libayatana-appindicator; configureFlags = lib.optional appindicatorSupport "--enable-appindicator=yes"; outputs = [ diff --git a/pkgs/by-name/gz/gzdoom/package.nix b/pkgs/by-name/gz/gzdoom/package.nix index 641b82cd1647..6aac6b724567 100644 --- a/pkgs/by-name/gz/gzdoom/package.nix +++ b/pkgs/by-name/gz/gzdoom/package.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation rec { makeWrapper ninja pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; buildInputs = [ SDL2 @@ -77,7 +78,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DDYN_GTK=OFF" "-DDYN_OPENAL=OFF" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DHAVE_GLES2=OFF" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DHAVE_GLES2=OFF" ]; desktopItems = lib.optionals stdenv.hostPlatform.isLinux [ (makeDesktopItem { diff --git a/pkgs/by-name/h2/h2o/package.nix b/pkgs/by-name/h2/h2o/package.nix index f1a10981f88f..05c323ff8376 100644 --- a/pkgs/by-name/h2/h2o/package.nix +++ b/pkgs/by-name/h2/h2o/package.nix @@ -39,18 +39,17 @@ stdenv.mkDerivation (finalAttrs: { "lib" ]; - nativeBuildInputs = - [ - pkg-config - cmake - makeWrapper - ninja - ] - ++ lib.optionals withMruby [ - bison - ruby - ] - ++ lib.optional withUring liburing; + nativeBuildInputs = [ + pkg-config + cmake + makeWrapper + ninja + ] + ++ lib.optionals withMruby [ + bison + ruby + ] + ++ lib.optional withUring liburing; buildInputs = [ brotli diff --git a/pkgs/by-name/h5/h5utils/package.nix b/pkgs/by-name/h5/h5utils/package.nix index 3c93a3f2a407..ac2ea6164fd7 100644 --- a/pkgs/by-name/h5/h5utils/package.nix +++ b/pkgs/by-name/h5/h5utils/package.nix @@ -28,15 +28,14 @@ stdenv.mkDerivation (finalAttrs: { preBuild = lib.optionalString hdf5.mpiSupport "export CC=${lib.getBin hdf5.mpi}/mpicc"; - buildInputs = - [ - hdf5 - libjpeg - libpng - ] - ++ lib.optional hdf5.mpiSupport hdf5.mpi - ++ lib.optional (hdf4 != null) hdf4 - ++ lib.optional (libmatheval != null) libmatheval; + buildInputs = [ + hdf5 + libjpeg + libpng + ] + ++ lib.optional hdf5.mpiSupport hdf5.mpi + ++ lib.optional (hdf4 != null) hdf4 + ++ lib.optional (libmatheval != null) libmatheval; meta = { description = "Set of utilities for visualization and conversion of scientific data in the free, portable HDF5 format"; diff --git a/pkgs/by-name/ha/halloy/package.nix b/pkgs/by-name/ha/halloy/package.nix index 4c9f4dc3986a..d268c1ec0c2a 100644 --- a/pkgs/by-name/ha/halloy/package.nix +++ b/pkgs/by-name/ha/halloy/package.nix @@ -36,19 +36,18 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libxkbcommon - vulkan-loader - wayland - xorg.libX11 - xorg.libXcursor - xorg.libXi - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libxkbcommon + vulkan-loader + wayland + xorg.libX11 + xorg.libXcursor + xorg.libXi + ]; desktopItems = [ (makeDesktopItem { @@ -89,23 +88,22 @@ rustPlatform.buildRustPackage rec { '' ); - postInstall = - '' - install -Dm644 assets/linux/icons/hicolor/128x128/apps/org.squidowl.halloy.png \ - $out/share/icons/hicolor/128x128/apps/org.squidowl.halloy.png - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - APP_DIR="$out/Applications/Halloy.app/Contents" + postInstall = '' + install -Dm644 assets/linux/icons/hicolor/128x128/apps/org.squidowl.halloy.png \ + $out/share/icons/hicolor/128x128/apps/org.squidowl.halloy.png + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + APP_DIR="$out/Applications/Halloy.app/Contents" - mkdir -p "$APP_DIR/MacOS" - cp -r ${src}/assets/macos/Halloy.app/Contents/* "$APP_DIR" + mkdir -p "$APP_DIR/MacOS" + cp -r ${src}/assets/macos/Halloy.app/Contents/* "$APP_DIR" - substituteInPlace "$APP_DIR/Info.plist" \ - --replace-fail "{{ VERSION }}" "${version}" \ - --replace-fail "{{ BUILD }}" "${version}-nixpkgs" + substituteInPlace "$APP_DIR/Info.plist" \ + --replace-fail "{{ VERSION }}" "${version}" \ + --replace-fail "{{ BUILD }}" "${version}-nixpkgs" - makeWrapper "$out/bin/halloy" "$APP_DIR/MacOS/halloy" - ''; + makeWrapper "$out/bin/halloy" "$APP_DIR/MacOS/halloy" + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/ha/handbrake/package.nix b/pkgs/by-name/ha/handbrake/package.nix index f8c121d7ab92..74730286e427 100644 --- a/pkgs/by-name/ha/handbrake/package.nix +++ b/pkgs/by-name/ha/handbrake/package.nix @@ -147,19 +147,17 @@ let # nixpkgs' x265 sourceRoot is x265-.../source whereas handbrake's x265 patches # are written with respect to the parent directory instead of that source directory. # patches which don't cleanly apply are commented out. - postPatch = - (old.postPatch or "") - + '' - pushd .. - patch -p1 < ${src}/contrib/x265/A01-Do-not-set-thread-priority-on-Windows.patch - # patch -p1 < ${src}/contrib/x265/A02-Apple-Silicon-tuning.patch - patch -p1 < ${src}/contrib/x265/A03-fix-crash-when-SEI-length-is-variable.patch - patch -p1 < ${src}/contrib/x265/A04-implement-ambient-viewing-environment-sei.patch - # patch -p1 < ${src}/contrib/x265/A05-Fix-Dolby-Vision-RPU-memory-management.patch - # patch -p1 < ${src}/contrib/x265/A06-Simplify-macOS-cross-compilation.patch - # patch -p1 < ${src}/contrib/x265/A07-add-new-matrix-coefficients-from-H.273-v3.patch - popd - ''; + postPatch = (old.postPatch or "") + '' + pushd .. + patch -p1 < ${src}/contrib/x265/A01-Do-not-set-thread-priority-on-Windows.patch + # patch -p1 < ${src}/contrib/x265/A02-Apple-Silicon-tuning.patch + patch -p1 < ${src}/contrib/x265/A03-fix-crash-when-SEI-length-is-variable.patch + patch -p1 < ${src}/contrib/x265/A04-implement-ambient-viewing-environment-sei.patch + # patch -p1 < ${src}/contrib/x265/A05-Fix-Dolby-Vision-RPU-memory-management.patch + # patch -p1 < ${src}/contrib/x265/A06-Simplify-macOS-cross-compilation.patch + # patch -p1 < ${src}/contrib/x265/A07-add-new-matrix-coefficients-from-H.273-v3.patch + popd + ''; }); versionFile = writeText "version.txt" '' @@ -193,123 +191,119 @@ let }) ]; - postPatch = - '' - install -Dm444 ${versionFile} ${versionFile.name} + postPatch = '' + install -Dm444 ${versionFile} ${versionFile.name} - patchShebangs scripts - patchShebangs gtk/data/ + patchShebangs scripts + patchShebangs gtk/data/ - substituteInPlace libhb/hb.c \ - --replace-fail 'return hb_version;' 'return "${version}";' + substituteInPlace libhb/hb.c \ + --replace-fail 'return hb_version;' 'return "${version}";' - # Force using nixpkgs dependencies - sed -i '/MODULES += contrib/d' make/include/main.defs - sed -e 's/^[[:space:]]*\(meson\|ninja\|nasm\)[[:space:]]*= ToolProbe.*$//g' \ - -e '/ ## Additional library and tool checks/,/ ## MinGW specific library and tool checks/d' \ - -i make/configure.py - '' - + optionalString stdenv.hostPlatform.isDarwin '' - # Prevent the configure script from failing if xcodebuild isn't available, - # which it isn't in the Nix context. (The actual build goes fine without - # xcodebuild.) - sed -e '/xcodebuild = ToolProbe/s/abort=.\+)/abort=False)/' -i make/configure.py - '' - + optionalString useGtk '' - substituteInPlace gtk/module.rules \ - --replace-fail '$(MESON.exe)' 'meson' \ - --replace-fail '$(NINJA.exe)' 'ninja' \ - # Force using nixpkgs dependencies - substituteInPlace gtk/meson.build \ - --replace-fail \ - "hb_incdirs = include_directories(hb_dir / 'libhb', hb_dir / 'contrib/include')" \ - "hb_incdirs = include_directories(hb_dir / 'libhb')" - substituteInPlace gtk/ghb.spec \ - --replace-fail "gtk-update-icon-cache" "gtk4-update-icon-cache" - substituteInPlace gtk/data/post_install.py \ - --replace-fail "gtk-update-icon-cache" "gtk4-update-icon-cache" - ''; + # Force using nixpkgs dependencies + sed -i '/MODULES += contrib/d' make/include/main.defs + sed -e 's/^[[:space:]]*\(meson\|ninja\|nasm\)[[:space:]]*= ToolProbe.*$//g' \ + -e '/ ## Additional library and tool checks/,/ ## MinGW specific library and tool checks/d' \ + -i make/configure.py + '' + + optionalString stdenv.hostPlatform.isDarwin '' + # Prevent the configure script from failing if xcodebuild isn't available, + # which it isn't in the Nix context. (The actual build goes fine without + # xcodebuild.) + sed -e '/xcodebuild = ToolProbe/s/abort=.\+)/abort=False)/' -i make/configure.py + '' + + optionalString useGtk '' + substituteInPlace gtk/module.rules \ + --replace-fail '$(MESON.exe)' 'meson' \ + --replace-fail '$(NINJA.exe)' 'ninja' \ + # Force using nixpkgs dependencies + substituteInPlace gtk/meson.build \ + --replace-fail \ + "hb_incdirs = include_directories(hb_dir / 'libhb', hb_dir / 'contrib/include')" \ + "hb_incdirs = include_directories(hb_dir / 'libhb')" + substituteInPlace gtk/ghb.spec \ + --replace-fail "gtk-update-icon-cache" "gtk4-update-icon-cache" + substituteInPlace gtk/data/post_install.py \ + --replace-fail "gtk-update-icon-cache" "gtk4-update-icon-cache" + ''; - nativeBuildInputs = - [ - autoconf - automake - libtool - m4 - pkg-config - python3 - ] - ++ optionals useGtk [ - appstream - desktop-file-utils - intltool - meson - ninja - wrapGAppsHook4 - ]; + nativeBuildInputs = [ + autoconf + automake + libtool + m4 + pkg-config + python3 + ] + ++ optionals useGtk [ + appstream + desktop-file-utils + intltool + meson + ninja + wrapGAppsHook4 + ]; - buildInputs = - [ - a52dec - dav1d - ffmpeg-hb - fontconfig - freetype - fribidi - harfbuzz - jansson - lame - libass - libbluray - libdvdcss - libdvdnav - libdvdread - libiconv - libjpeg_turbo - libogg - libopus - libsamplerate - libtheora - libvorbis - libvpx - libxml2 - speex - svt-av1 - x264 - x265-hb - xz - zimg - ] - ++ optional (!stdenv.hostPlatform.isDarwin) numactl - ++ optionals useGtk [ - dbus-glib - glib - gst_all_1.gst-libav - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gstreamer - gtk4 - hicolor-icon-theme - libappindicator-gtk3 - libgudev - libnotify - udev - ] - ++ optional useFdk fdk_aac - # NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only, - # look at ./make/configure.py search "enable_nvenc" - ++ optional stdenv.hostPlatform.isLinux nv-codec-headers; + buildInputs = [ + a52dec + dav1d + ffmpeg-hb + fontconfig + freetype + fribidi + harfbuzz + jansson + lame + libass + libbluray + libdvdcss + libdvdnav + libdvdread + libiconv + libjpeg_turbo + libogg + libopus + libsamplerate + libtheora + libvorbis + libvpx + libxml2 + speex + svt-av1 + x264 + x265-hb + xz + zimg + ] + ++ optional (!stdenv.hostPlatform.isDarwin) numactl + ++ optionals useGtk [ + dbus-glib + glib + gst_all_1.gst-libav + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gstreamer + gtk4 + hicolor-icon-theme + libappindicator-gtk3 + libgudev + libnotify + udev + ] + ++ optional useFdk fdk_aac + # NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only, + # look at ./make/configure.py search "enable_nvenc" + ++ optional stdenv.hostPlatform.isLinux nv-codec-headers; - configureFlags = - [ - "--disable-df-fetch" - "--disable-df-verify" - ] - ++ optional (!useGtk) "--disable-gtk" - ++ optional useFdk "--enable-fdk-aac" - ++ optional stdenv.hostPlatform.isDarwin "--disable-xcode" - ++ optional stdenv.hostPlatform.isx86 "--harden"; + configureFlags = [ + "--disable-df-fetch" + "--disable-df-verify" + ] + ++ optional (!useGtk) "--disable-gtk" + ++ optional useFdk "--enable-fdk-aac" + ++ optional stdenv.hostPlatform.isDarwin "--disable-xcode" + ++ optional stdenv.hostPlatform.isx86 "--harden"; # NOTE: 2018-12-27: Check NixOS HandBrake test if changing NIX_LDFLAGS = [ "-lx265" ]; diff --git a/pkgs/by-name/ha/haproxy/package.nix b/pkgs/by-name/ha/haproxy/package.nix index 774c8ee3b82b..805bfcf8d1bb 100644 --- a/pkgs/by-name/ha/haproxy/package.nix +++ b/pkgs/by-name/ha/haproxy/package.nix @@ -49,14 +49,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-r472Qoa93ckyMsXb5OpDaozLXchBfPoeiFvsUohPk0c="; }; - buildInputs = - [ - sslPkg - zlib - libxcrypt - ] - ++ lib.optional useLua lua5_4 - ++ lib.optional usePcre pcre2; + buildInputs = [ + sslPkg + zlib + libxcrypt + ] + ++ lib.optional useLua lua5_4 + ++ lib.optional usePcre pcre2; # TODO: make it work on bsd as well makeFlags = [ @@ -76,40 +75,39 @@ stdenv.mkDerivation (finalAttrs: { ) ]; - buildFlags = - [ - "USE_ZLIB=yes" - "USE_OPENSSL=yes" - "SSL_INC=${lib.getDev sslPkg}/include" - "SSL_LIB=${lib.getDev sslPkg}/lib" - "USE_QUIC=yes" - ] - ++ lib.optionals (sslLibrary == "aws-lc") [ - "USE_OPENSSL_AWSLC=true" - ] - ++ lib.optionals (sslLibrary == "openssl") [ - "USE_QUIC_OPENSSL_COMPAT=yes" - ] - ++ lib.optionals (sslLibrary == "wolfssl") [ - "USE_OPENSSL_WOLFSSL=yes" - ] - ++ lib.optionals usePcre [ - "USE_PCRE2=yes" - "USE_PCRE2_JIT=yes" - ] - ++ lib.optionals useLua [ - "USE_LUA=yes" - "LUA_LIB_NAME=lua" - "LUA_LIB=${lua5_4}/lib" - "LUA_INC=${lua5_4}/include" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "USE_GETADDRINFO=1" - ] - ++ lib.optionals withPrometheusExporter [ - "USE_PROMEX=yes" - ] - ++ [ "CC=${stdenv.cc.targetPrefix}cc" ]; + buildFlags = [ + "USE_ZLIB=yes" + "USE_OPENSSL=yes" + "SSL_INC=${lib.getDev sslPkg}/include" + "SSL_LIB=${lib.getDev sslPkg}/lib" + "USE_QUIC=yes" + ] + ++ lib.optionals (sslLibrary == "aws-lc") [ + "USE_OPENSSL_AWSLC=true" + ] + ++ lib.optionals (sslLibrary == "openssl") [ + "USE_QUIC_OPENSSL_COMPAT=yes" + ] + ++ lib.optionals (sslLibrary == "wolfssl") [ + "USE_OPENSSL_WOLFSSL=yes" + ] + ++ lib.optionals usePcre [ + "USE_PCRE2=yes" + "USE_PCRE2_JIT=yes" + ] + ++ lib.optionals useLua [ + "USE_LUA=yes" + "LUA_LIB_NAME=lua" + "LUA_LIB=${lua5_4}/lib" + "LUA_INC=${lua5_4}/include" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "USE_GETADDRINFO=1" + ] + ++ lib.optionals withPrometheusExporter [ + "USE_PROMEX=yes" + ] + ++ [ "CC=${stdenv.cc.targetPrefix}cc" ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ha/hare/package.nix b/pkgs/by-name/ha/hare/package.nix index b79cd7b8e298..8f9b1bc89fbe 100644 --- a/pkgs/by-name/ha/hare/package.nix +++ b/pkgs/by-name/ha/hare/package.nix @@ -133,7 +133,8 @@ stdenv.mkDerivation (finalAttrs: { # Strip the variable of an empty $(SRCDIR)/hare/third-party, since nix does # not follow the FHS. "HAREPATH=$(SRCDIR)/hare/stdlib" - ] ++ lib.optionals enableCrossCompilation crossCompMakeFlags; + ] + ++ lib.optionals enableCrossCompilation crossCompMakeFlags; enableParallelBuilding = true; diff --git a/pkgs/by-name/ha/harfbuzz/package.nix b/pkgs/by-name/ha/harfbuzz/package.nix index 92f3eb567c3c..080dac7b48ed 100644 --- a/pkgs/by-name/ha/harfbuzz/package.nix +++ b/pkgs/by-name/ha/harfbuzz/package.nix @@ -41,15 +41,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-CTcUyFSKKFCUaF8L3JmeIC1ma1nus98v+SGraLgzakk="; }; - postPatch = - '' - patchShebangs src/*.py test - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # ApplicationServices.framework headers have cast-align warnings. - substituteInPlace src/hb.hh \ - --replace '#pragma GCC diagnostic error "-Wcast-align"' "" - ''; + postPatch = '' + patchShebangs src/*.py test + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # ApplicationServices.framework headers have cast-align warnings. + substituteInPlace src/hb.hh \ + --replace '#pragma GCC diagnostic error "-Wcast-align"' "" + ''; outputs = [ "out" @@ -87,7 +86,8 @@ stdenv.mkDerivation (finalAttrs: { gtk-doc docbook-xsl-nons docbook_xml_dtd_43 - ] ++ lib.optional withIntrospection gobject-introspection; + ] + ++ lib.optional withIntrospection gobject-introspection; buildInputs = [ glib diff --git a/pkgs/by-name/ha/harlequin/package.nix b/pkgs/by-name/ha/harlequin/package.nix index f39be8baec1f..553a70fcbf36 100644 --- a/pkgs/by-name/ha/harlequin/package.nix +++ b/pkgs/by-name/ha/harlequin/package.nix @@ -75,16 +75,15 @@ python3Packages.buildPythonApplication rec { versionCheckHook ]; - disabledTests = - [ - # Tests require network access - "test_connect_extensions" - "test_connect_prql" - ] - ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ - # Test incorrectly tries to load a dylib/so compiled for x86_64 - "test_load_extension" - ]; + disabledTests = [ + # Tests require network access + "test_connect_extensions" + "test_connect_prql" + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ + # Test incorrectly tries to load a dylib/so compiled for x86_64 + "test_load_extension" + ]; disabledTestPaths = [ # Tests requires more setup diff --git a/pkgs/by-name/ha/harvid/package.nix b/pkgs/by-name/ha/harvid/package.nix index efbe45d667c0..345f23987abc 100644 --- a/pkgs/by-name/ha/harvid/package.nix +++ b/pkgs/by-name/ha/harvid/package.nix @@ -23,12 +23,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-p0W+rKHH/iuGOcRjl6b4s6jQYkm7bqWCz849SDI/7fQ="; }; - nativeBuildInputs = - [ pkg-config ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - which - unixtools.xxd - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + which + unixtools.xxd + ]; buildInputs = [ ffmpeg diff --git a/pkgs/by-name/ha/hash-slinger/package.nix b/pkgs/by-name/ha/hash-slinger/package.nix index 1bf69ea7ecac..2cd281fc1565 100644 --- a/pkgs/by-name/ha/hash-slinger/package.nix +++ b/pkgs/by-name/ha/hash-slinger/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ unbound libreswan - ] ++ pythonPath; + ] + ++ pythonPath; propagatedUserEnvPkgs = [ unbound diff --git a/pkgs/by-name/ha/hashcat/package.nix b/pkgs/by-name/ha/hashcat/package.nix index 442b46b4d974..24b3b76bb837 100644 --- a/pkgs/by-name/ha/hashcat/package.nix +++ b/pkgs/by-name/ha/hashcat/package.nix @@ -34,37 +34,34 @@ stdenv.mkDerivation rec { --replace '-i ""' '-i' ''; - nativeBuildInputs = - [ - makeWrapper - ] - ++ lib.optionals cudaSupport [ - addDriverRunpath - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals cudaSupport [ + addDriverRunpath + ]; - buildInputs = - [ - minizip - opencl-headers - xxHash - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + minizip + opencl-headers + xxHash + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - "COMPTIME=1337" - "VERSION_TAG=${version}" - "USE_SYSTEM_OPENCL=1" - "USE_SYSTEM_XXHASH=1" - "USE_SYSTEM_ZLIB=1" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform == stdenv.buildPlatform) [ - "IS_APPLE_SILICON='${if stdenv.hostPlatform.isAarch64 then "1" else "0"}'" - ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "COMPTIME=1337" + "VERSION_TAG=${version}" + "USE_SYSTEM_OPENCL=1" + "USE_SYSTEM_XXHASH=1" + "USE_SYSTEM_ZLIB=1" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform == stdenv.buildPlatform) [ + "IS_APPLE_SILICON='${if stdenv.hostPlatform.isAarch64 then "1" else "0"}'" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ha/hatch/package.nix b/pkgs/by-name/ha/hatch/package.nix index da80f9ed5b67..7b1005ed41b3 100644 --- a/pkgs/by-name/ha/hatch/package.nix +++ b/pkgs/by-name/ha/hatch/package.nix @@ -72,100 +72,97 @@ python3Packages.buildPythonApplication rec { versionCheckProgramArg = "--version"; - pytestFlagsArray = - [ - # AssertionError on the version metadata - # https://github.com/pypa/hatch/issues/1877 - "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_all" - "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_license_expression" - "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_all" - "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_license_expression" - "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_all" - "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_expression" - "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_files" - "--deselect=tests/backend/metadata/test_spec.py::TestProjectMetadataFromCoreMetadata::test_license_files" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Dependency/versioning errors in the CLI tests, only seem to show up on Darwin - # https://github.com/pypa/hatch/issues/1893 - "--deselect=tests/cli/env/test_create.py::test_sync_dependencies_pip" - "--deselect=tests/cli/env/test_create.py::test_sync_dependencies_uv" - "--deselect=tests/cli/project/test_metadata.py::TestBuildDependenciesMissing::test_no_compatibility_check_if_exists" - "--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies" - "--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies_from_tool_config" - "--deselect=tests/cli/run/test_run.py::test_dependency_hash_checking" - "--deselect=tests/cli/run/test_run.py::test_sync_dependencies" - "--deselect=tests/cli/run/test_run.py::test_sync_project_dependencies" - "--deselect=tests/cli/run/test_run.py::test_sync_project_features" - "--deselect=tests/cli/version/test_version.py::test_no_compatibility_check_if_exists" - ]; + pytestFlagsArray = [ + # AssertionError on the version metadata + # https://github.com/pypa/hatch/issues/1877 + "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_all" + "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_license_expression" + "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_all" + "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_license_expression" + "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_all" + "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_expression" + "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_files" + "--deselect=tests/backend/metadata/test_spec.py::TestProjectMetadataFromCoreMetadata::test_license_files" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Dependency/versioning errors in the CLI tests, only seem to show up on Darwin + # https://github.com/pypa/hatch/issues/1893 + "--deselect=tests/cli/env/test_create.py::test_sync_dependencies_pip" + "--deselect=tests/cli/env/test_create.py::test_sync_dependencies_uv" + "--deselect=tests/cli/project/test_metadata.py::TestBuildDependenciesMissing::test_no_compatibility_check_if_exists" + "--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies" + "--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies_from_tool_config" + "--deselect=tests/cli/run/test_run.py::test_dependency_hash_checking" + "--deselect=tests/cli/run/test_run.py::test_sync_dependencies" + "--deselect=tests/cli/run/test_run.py::test_sync_project_dependencies" + "--deselect=tests/cli/run/test_run.py::test_sync_project_features" + "--deselect=tests/cli/version/test_version.py::test_no_compatibility_check_if_exists" + ]; - disabledTests = - [ - # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0) - "test_default" - "test_editable_default" - "test_editable_default_extra_dependencies" - "test_editable_default_force_include" - "test_editable_default_force_include_option" - "test_editable_default_symlink" - "test_editable_exact" - "test_editable_exact_extra_dependencies" - "test_editable_exact_force_include" - "test_editable_exact_force_include_build_data_precedence" - "test_editable_exact_force_include_option" - "test_editable_pth" - "test_explicit_path" + disabledTests = [ + # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0) + "test_default" + "test_editable_default" + "test_editable_default_extra_dependencies" + "test_editable_default_force_include" + "test_editable_default_force_include_option" + "test_editable_default_symlink" + "test_editable_exact" + "test_editable_exact_extra_dependencies" + "test_editable_exact_force_include" + "test_editable_exact_force_include_build_data_precedence" + "test_editable_exact_force_include_option" + "test_editable_pth" + "test_explicit_path" - # Loosen hatchling runtime version dependency - "test_core" - # New failing - "test_guess_variant" - "test_open" - "test_no_open" - "test_uv_env" - "test_pyenv" - "test_pypirc" - # Relies on FHS - # Could not read ELF interpreter from any of the following paths: /bin/sh, /usr/bin/env, /bin/dash, /bin/ls - "test_new_selected_python" + # Loosen hatchling runtime version dependency + "test_core" + # New failing + "test_guess_variant" + "test_open" + "test_no_open" + "test_uv_env" + "test_pyenv" + "test_pypirc" + # Relies on FHS + # Could not read ELF interpreter from any of the following paths: /bin/sh, /usr/bin/env, /bin/dash, /bin/ls + "test_new_selected_python" - # https://github.com/pypa/hatch/issues/2006 - "test_project_location_basic_set_first_project" - "test_project_location_complex_set_first_project" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # This test assumes it is running on macOS with a system shell on the PATH. - # It is not possible to run it in a nix build using a /nix/store shell. - # See https://github.com/pypa/hatch/pull/709 for the relevant code. - "test_populate_default_popen_kwargs_executable" + # https://github.com/pypa/hatch/issues/2006 + "test_project_location_basic_set_first_project" + "test_project_location_complex_set_first_project" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # This test assumes it is running on macOS with a system shell on the PATH. + # It is not possible to run it in a nix build using a /nix/store shell. + # See https://github.com/pypa/hatch/pull/709 for the relevant code. + "test_populate_default_popen_kwargs_executable" - # Those tests fail because the final wheel is named '...2-macosx_11_0_arm64.whl' instead of - # '...2-macosx_14_0_arm64.whl' - "test_macos_archflags" - "test_macos_max_compat" + # Those tests fail because the final wheel is named '...2-macosx_11_0_arm64.whl' instead of + # '...2-macosx_14_0_arm64.whl' + "test_macos_archflags" + "test_macos_max_compat" - # https://github.com/pypa/hatch/issues/1942 - "test_features" - "test_sync_dynamic_dependencies" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_resolve" ]; + # https://github.com/pypa/hatch/issues/1942 + "test_features" + "test_sync_dynamic_dependencies" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_resolve" ]; - disabledTestPaths = - [ - # ModuleNotFoundError: No module named 'hatchling.licenses.parse' - # https://github.com/pypa/hatch/issues/1850 - "tests/backend/licenses/test_parse.py" - "tests/backend/licenses/test_supported.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # AssertionError: assert [call('test h...2p32/bin/sh')] == [call('test h..., shell=True)] - # At index 0 diff: - # call('test hatch-test.py3.10', shell=True, executable='/nix/store/b34ianga4diikh0kymkpqwmvba0mmzf7-bash-5.2p32/bin/sh') - # != call('test hatch-test.py3.10', shell=True) - "tests/cli/fmt/test_fmt.py" - "tests/cli/test/test_test.py" - ]; + disabledTestPaths = [ + # ModuleNotFoundError: No module named 'hatchling.licenses.parse' + # https://github.com/pypa/hatch/issues/1850 + "tests/backend/licenses/test_parse.py" + "tests/backend/licenses/test_supported.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # AssertionError: assert [call('test h...2p32/bin/sh')] == [call('test h..., shell=True)] + # At index 0 diff: + # call('test hatch-test.py3.10', shell=True, executable='/nix/store/b34ianga4diikh0kymkpqwmvba0mmzf7-bash-5.2p32/bin/sh') + # != call('test hatch-test.py3.10', shell=True) + "tests/cli/fmt/test_fmt.py" + "tests/cli/test/test_test.py" + ]; passthru = { updateScript = nix-update-script { diff --git a/pkgs/by-name/hd/hdf4/package.nix b/pkgs/by-name/hd/hdf4/package.nix index 3e28f92cdd1d..5f369d2be486 100644 --- a/pkgs/by-name/hd/hdf4/package.nix +++ b/pkgs/by-name/hd/hdf4/package.nix @@ -31,45 +31,44 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ninja - ] ++ lib.optional fortranSupport gfortran; + ] + ++ lib.optional fortranSupport gfortran; - buildInputs = - [ - libjpeg - zlib - ] - ++ lib.optional javaSupport jdk - ++ lib.optional szipSupport szip - ++ lib.optional uselibtirpc libtirpc; + buildInputs = [ + libjpeg + zlib + ] + ++ lib.optional javaSupport jdk + ++ lib.optional szipSupport szip + ++ lib.optional uselibtirpc libtirpc; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_SHARED_LIBS" true) - (lib.cmakeBool "HDF4_BUILD_TOOLS" true) - (lib.cmakeBool "HDF4_BUILD_UTILS" true) - (lib.cmakeBool "HDF4_BUILD_WITH_INSTALL_NAME" true) - (lib.cmakeBool "HDF4_ENABLE_JPEG_LIB_SUPPORT" true) - (lib.cmakeBool "HDF4_ENABLE_Z_LIB_SUPPORT" true) - (lib.cmakeBool "HDF4_ENABLE_NETCDF" netcdfSupport) - (lib.cmakeBool "HDF4_BUILD_FORTRAN" fortranSupport) - (lib.cmakeBool "HDF4_ENABLE_SZIP_SUPPORT" szipSupport) - (lib.cmakeBool "HDF4_ENABLE_SZIP_ENCODING" szipSupport) - (lib.cmakeBool "HDF4_BUILD_JAVA" javaSupport) - (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) - ] - ++ lib.optionals javaSupport [ - (lib.cmakeFeature "JAVA_HOME" "${jdk}") - ] - ++ lib.optionals fortranSupport [ - (lib.cmakeFeature "CMAKE_Fortran_FLAGS" "-fallow-argument-mismatch") - ] - # using try_run would set these, but that requires a cross-compiling emulator to be available - # instead, we mark them as if the try_run calls returned a non-zero exit code - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - (lib.cmakeFeature "TEST_LFS_WORKS_RUN" "1") - (lib.cmakeFeature "H4_PRINTF_LL_TEST_RUN" "1") - (lib.cmakeFeature "H4_PRINTF_LL_TEST_RUN__TRYRUN_OUTPUT" "") - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + (lib.cmakeBool "HDF4_BUILD_TOOLS" true) + (lib.cmakeBool "HDF4_BUILD_UTILS" true) + (lib.cmakeBool "HDF4_BUILD_WITH_INSTALL_NAME" true) + (lib.cmakeBool "HDF4_ENABLE_JPEG_LIB_SUPPORT" true) + (lib.cmakeBool "HDF4_ENABLE_Z_LIB_SUPPORT" true) + (lib.cmakeBool "HDF4_ENABLE_NETCDF" netcdfSupport) + (lib.cmakeBool "HDF4_BUILD_FORTRAN" fortranSupport) + (lib.cmakeBool "HDF4_ENABLE_SZIP_SUPPORT" szipSupport) + (lib.cmakeBool "HDF4_ENABLE_SZIP_ENCODING" szipSupport) + (lib.cmakeBool "HDF4_BUILD_JAVA" javaSupport) + (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) + ] + ++ lib.optionals javaSupport [ + (lib.cmakeFeature "JAVA_HOME" "${jdk}") + ] + ++ lib.optionals fortranSupport [ + (lib.cmakeFeature "CMAKE_Fortran_FLAGS" "-fallow-argument-mismatch") + ] + # using try_run would set these, but that requires a cross-compiling emulator to be available + # instead, we mark them as if the try_run calls returned a non-zero exit code + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + (lib.cmakeFeature "TEST_LFS_WORKS_RUN" "1") + (lib.cmakeFeature "H4_PRINTF_LL_TEST_RUN" "1") + (lib.cmakeFeature "H4_PRINTF_LL_TEST_RUN__TRYRUN_OUTPUT" "") + ]; doCheck = true; diff --git a/pkgs/by-name/hd/hdfview/package.nix b/pkgs/by-name/hd/hdfview/package.nix index a74bd1274479..d1a0a43f2c38 100644 --- a/pkgs/by-name/hd/hdfview/package.nix +++ b/pkgs/by-name/hd/hdfview/package.nix @@ -67,27 +67,26 @@ stdenv.mkDerivation (finalAttrs: { ]; }; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/bin $out/lib - cp -a build/dist/HDFView/bin/HDFView $out/bin/ - cp -a build/dist/HDFView/lib/app $out/lib/ - cp -a build/dist/HDFView/lib/libapplauncher.so $out/lib/ - ln -s ${jdk}/lib/openjdk $out/lib/runtime + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/bin $out/lib + cp -a build/dist/HDFView/bin/HDFView $out/bin/ + cp -a build/dist/HDFView/lib/app $out/lib/ + cp -a build/dist/HDFView/lib/libapplauncher.so $out/lib/ + ln -s ${jdk}/lib/openjdk $out/lib/runtime - mkdir -p $out/share/applications $out/share/icons/hicolor/32x32/apps - cp src/HDFView.png $out/share/icons/hicolor/32x32/apps/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -a build/dist/HDFView.app $out/Applications/ - '' - + '' - runHook postInstall - ''; + mkdir -p $out/share/applications $out/share/icons/hicolor/32x32/apps + cp src/HDFView.png $out/share/icons/hicolor/32x32/apps/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -a build/dist/HDFView.app $out/Applications/ + '' + + '' + runHook postInstall + ''; preFixup = '' # Remove build timestamp from javadoc files diff --git a/pkgs/by-name/he/headlines/package.nix b/pkgs/by-name/he/headlines/package.nix index 74b01862ad19..96951f9ae6ac 100644 --- a/pkgs/by-name/he/headlines/package.nix +++ b/pkgs/by-name/he/headlines/package.nix @@ -38,26 +38,25 @@ stdenv.mkDerivation rec { wrapGAppsHook4 ]; - buildInputs = - [ - libmicrohttpd - curl - openssl - jsoncpp - libxml2 - boost - websocketpp - libadwaita - gtkmm4 - libsecret - ] - ++ (with gst_all_1; [ - gstreamer - gst-libav - gst-plugins-base - (gst-plugins-good.override { gtkSupport = true; }) - gst-plugins-bad - ]); + buildInputs = [ + libmicrohttpd + curl + openssl + jsoncpp + libxml2 + boost + websocketpp + libadwaita + gtkmm4 + libsecret + ] + ++ (with gst_all_1; [ + gstreamer + gst-libav + gst-plugins-base + (gst-plugins-good.override { gtkSupport = true; }) + gst-plugins-bad + ]); preFixup = '' gappsWrapperArgs+=( diff --git a/pkgs/by-name/he/hebbot/package.nix b/pkgs/by-name/he/hebbot/package.nix index 2a37463e1bc2..abad3b0a0492 100644 --- a/pkgs/by-name/he/hebbot/package.nix +++ b/pkgs/by-name/he/hebbot/package.nix @@ -26,15 +26,14 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-xRTl6Z6sn44yaEIFxG2vVKlbruDmOS2CdPZeVmWYOoA="; - nativeBuildInputs = - [ - pkg-config - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - autoconf - automake - ]; + nativeBuildInputs = [ + pkg-config + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + autoconf + automake + ]; buildInputs = [ openssl diff --git a/pkgs/by-name/he/hedgewars/package.nix b/pkgs/by-name/he/hedgewars/package.nix index 94ae498d69b9..685e1e5c9109 100644 --- a/pkgs/by-name/he/hedgewars/package.nix +++ b/pkgs/by-name/he/hedgewars/package.nix @@ -81,7 +81,8 @@ stdenv.mkDerivation { libglut physfs qtbase - ] ++ lib.optional withServer ghc; + ] + ++ lib.optional withServer ghc; cmakeFlags = [ "-DNOVERSIONINFOUPDATE=ON" diff --git a/pkgs/by-name/he/heimdall/package.nix b/pkgs/by-name/he/heimdall/package.nix index c11e381b470a..3f62a708927f 100644 --- a/pkgs/by-name/he/heimdall/package.nix +++ b/pkgs/by-name/he/heimdall/package.nix @@ -37,11 +37,13 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optional enableGUI qt6.wrapQtAppsHook; + ] + ++ lib.optional enableGUI qt6.wrapQtAppsHook; buildInputs = [ (libusb1.override { withStatic = stdenv.hostPlatform.isWindows; }) - ] ++ lib.optional enableGUI qt6.qtbase; + ] + ++ lib.optional enableGUI qt6.qtbase; preInstall = '' mkdir -p $udev/lib/udev/rules.d diff --git a/pkgs/by-name/he/herbe/package.nix b/pkgs/by-name/he/herbe/package.nix index a3759ebfd978..2916cf79a09e 100644 --- a/pkgs/by-name/he/herbe/package.nix +++ b/pkgs/by-name/he/herbe/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation rec { libX11 libXft freetype - ] ++ extraLibs; + ] + ++ extraLibs; makeFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/by-name/he/hercules/package.nix b/pkgs/by-name/he/hercules/package.nix index d7a3df6d6053..58be1d753826 100644 --- a/pkgs/by-name/he/hercules/package.nix +++ b/pkgs/by-name/he/hercules/package.nix @@ -122,28 +122,26 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ libtool ]; - buildInputs = - [ - (lib.getOutput "lib" libtool) - zlib - bzip2 - extpkgs - ] - ++ lib.optionals enableRexx [ - regina - ]; + buildInputs = [ + (lib.getOutput "lib" libtool) + zlib + bzip2 + extpkgs + ] + ++ lib.optionals enableRexx [ + regina + ]; - configureFlags = - [ - "--enable-extpkgs=${extpkgs}" - "--without-included-ltdl" - "--enable-ipv6" - "--enable-cckd-bzip2" - "--enable-het-bzip2" - ] - ++ lib.optionals enableRexx [ - "--enable-regina-rexx" - ]; + configureFlags = [ + "--enable-extpkgs=${extpkgs}" + "--without-included-ltdl" + "--enable-ipv6" + "--enable-cckd-bzip2" + "--enable-het-bzip2" + ] + ++ lib.optionals enableRexx [ + "--enable-regina-rexx" + ]; meta = with lib; { homepage = "https://sdl-hercules-390.github.io/html/"; diff --git a/pkgs/by-name/he/herwig/package.nix b/pkgs/by-name/he/herwig/package.nix index 9e6ea0e4586a..cf9a4ac9094b 100644 --- a/pkgs/by-name/he/herwig/package.nix +++ b/pkgs/by-name/he/herwig/package.nix @@ -30,19 +30,18 @@ stdenv.mkDerivation rec { gfortran ]; - buildInputs = - [ - boost - fastjet - gsl - thepeg - zlib - ] - # There is a bug that requires for default PDF's to be present during the build - ++ (with lhapdf.pdf_sets; [ - CT14lo - CT14nlo - ]); + buildInputs = [ + boost + fastjet + gsl + thepeg + zlib + ] + # There is a bug that requires for default PDF's to be present during the build + ++ (with lhapdf.pdf_sets; [ + CT14lo + CT14nlo + ]); postPatch = '' patchShebangs ./ diff --git a/pkgs/by-name/he/hexbinhex/package.nix b/pkgs/by-name/he/hexbinhex/package.nix index a4a012bdad74..ec0dd6db3325 100644 --- a/pkgs/by-name/he/hexbinhex/package.nix +++ b/pkgs/by-name/he/hexbinhex/package.nix @@ -15,14 +15,13 @@ stdenv.mkDerivation rec { hash = "sha256-nfOmiF+t5QtAl1I7CSz26C9SGo7ZkdSziO2eiHbk6pA="; }; - preBuild = - '' - substituteInPlace Makefile --replace '/usr/local' $out - mkdir -p $out/bin - '' - + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' - sed -i s/-m64//g Makefile - ''; + preBuild = '' + substituteInPlace Makefile --replace '/usr/local' $out + mkdir -p $out/bin + '' + + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' + sed -i s/-m64//g Makefile + ''; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; diff --git a/pkgs/by-name/hi/hiawatha/package.nix b/pkgs/by-name/hi/hiawatha/package.nix index 727651369179..ae6d50abf579 100644 --- a/pkgs/by-name/hi/hiawatha/package.nix +++ b/pkgs/by-name/hi/hiawatha/package.nix @@ -37,16 +37,15 @@ stdenv.mkDerivation (finalAttrs: { cmake ninja ]; - buildInputs = - [ - mbedtls - libxcrypt - zlib - ] - ++ lib.optionals enableXslt [ - libxslt - libxml2 - ]; + buildInputs = [ + mbedtls + libxcrypt + zlib + ] + ++ lib.optionals enableXslt [ + libxslt + libxml2 + ]; prePatch = '' substituteInPlace CMakeLists.txt --replace SETUID "" diff --git a/pkgs/by-name/hi/hiawatha/test.nix b/pkgs/by-name/hi/hiawatha/test.nix index 3287a6266127..8f17a6874563 100644 --- a/pkgs/by-name/hi/hiawatha/test.nix +++ b/pkgs/by-name/hi/hiawatha/test.nix @@ -13,7 +13,8 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ hiawatha curl - ] ++ lib.optional enableTls mbedtls; + ] + ++ lib.optional enableTls mbedtls; env = { inherit enableTls; diff --git a/pkgs/by-name/hi/higan/package.nix b/pkgs/by-name/hi/higan/package.nix index e47d722f95eb..9947742b3b1c 100644 --- a/pkgs/by-name/hi/higan/package.nix +++ b/pkgs/by-name/hi/higan/package.nix @@ -32,32 +32,30 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-VpwHjA0LufKDnGRAS906Qh3R2pVt4uUGXxsRcca9SyM="; }; - nativeBuildInputs = - [ - installShellFiles - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libicns - ]; + nativeBuildInputs = [ + installShellFiles + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libicns + ]; - buildInputs = - [ - SDL2 - libao - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - gtk3 - gtksourceview3 - libGL - libGLU - libX11 - libXv - libpulseaudio - openal - udev - ]; + buildInputs = [ + SDL2 + libao + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + gtk3 + gtksourceview3 + libGL + libGLU + libX11 + libXv + libpulseaudio + openal + udev + ]; patches = [ # Includes cmath header @@ -105,67 +103,66 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir $out - mv higan/out/higan.app $out/ - mv icarus/out/icarus.app $out/ - '' - else - '' - installBin higan-ui/out/higan icarus/out/icarus - - install -d $out/share/applications - install higan-ui/resource/higan.desktop -t $out/share/applications/ - install icarus/resource/icarus.desktop -t $out/share/applications/ - - install -d $out/share/pixmaps - install higan/higan/resource/higan.svg $out/share/pixmaps/higan-icon.svg - install higan/higan/resource/logo.png $out/share/pixmaps/higan-icon.png - install icarus/resource/icarus.svg $out/share/pixmaps/icarus-icon.svg - install icarus/resource/icarus.png $out/share/pixmaps/icarus-icon.png - '' - ) - + '' - install -d $out/share/higan - cp -rd extras/ higan/System/ $out/share/higan/ - - install -d $out/share/icarus - cp -rd icarus/Database icarus/Firmware $out/share/icarus/ - '' - + ( - # A dirty workaround, suggested by @cpages: - # we create a first-run script to populate - # $HOME with all the stuff needed at runtime - let - dest = - if stdenv.hostPlatform.isDarwin then - "\\$HOME/Library/Application Support/higan" - else - "\\$HOME/higan"; - in + '' + + ( + if stdenv.hostPlatform.isDarwin then '' - mkdir -p $out/bin - cat < $out/bin/higan-init.sh - #!${runtimeShell} - - cp --recursive --update $out/share/higan/System/ "${dest}"/ - - EOF - - chmod +x $out/bin/higan-init.sh + mkdir $out + mv higan/out/higan.app $out/ + mv icarus/out/icarus.app $out/ '' - ) - + '' + else + '' + installBin higan-ui/out/higan icarus/out/icarus - runHook postInstall - ''; + install -d $out/share/applications + install higan-ui/resource/higan.desktop -t $out/share/applications/ + install icarus/resource/icarus.desktop -t $out/share/applications/ + + install -d $out/share/pixmaps + install higan/higan/resource/higan.svg $out/share/pixmaps/higan-icon.svg + install higan/higan/resource/logo.png $out/share/pixmaps/higan-icon.png + install icarus/resource/icarus.svg $out/share/pixmaps/icarus-icon.svg + install icarus/resource/icarus.png $out/share/pixmaps/icarus-icon.png + '' + ) + + '' + install -d $out/share/higan + cp -rd extras/ higan/System/ $out/share/higan/ + + install -d $out/share/icarus + cp -rd icarus/Database icarus/Firmware $out/share/icarus/ + '' + + ( + # A dirty workaround, suggested by @cpages: + # we create a first-run script to populate + # $HOME with all the stuff needed at runtime + let + dest = + if stdenv.hostPlatform.isDarwin then + "\\$HOME/Library/Application Support/higan" + else + "\\$HOME/higan"; + in + '' + mkdir -p $out/bin + cat < $out/bin/higan-init.sh + #!${runtimeShell} + + cp --recursive --update $out/share/higan/System/ "${dest}"/ + + EOF + + chmod +x $out/bin/higan-init.sh + '' + ) + + '' + + runHook postInstall + ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/by-name/hi/high-tide/package.nix b/pkgs/by-name/hi/high-tide/package.nix index 3bd740c7a68a..f2c5f581a67a 100644 --- a/pkgs/by-name/hi/high-tide/package.nix +++ b/pkgs/by-name/hi/high-tide/package.nix @@ -37,18 +37,17 @@ python313Packages.buildPythonApplication rec { desktop-file-utils ]; - buildInputs = - [ - glib-networking - libadwaita - libportal - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - libsecret - ]); + buildInputs = [ + glib-networking + libadwaita + libportal + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + libsecret + ]); dependencies = with python313Packages; [ pygobject3 diff --git a/pkgs/by-name/hi/highfive/package.nix b/pkgs/by-name/hi/highfive/package.nix index db3e6a19f6c8..5551230ace59 100644 --- a/pkgs/by-name/hi/highfive/package.nix +++ b/pkgs/by-name/hi/highfive/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation rec { "-DHIGHFIVE_EXAMPLES=OFF" "-DHIGHFIVE_UNIT_TESTS=OFF" "-DHIGHFIVE_USE_INSTALL_DEPS=ON" - ] ++ (lib.optionals mpiSupport [ "-DHIGHFIVE_PARALLEL_HDF5=ON" ]); + ] + ++ (lib.optionals mpiSupport [ "-DHIGHFIVE_PARALLEL_HDF5=ON" ]); meta = with lib; { description = "Header-only C++ HDF5 interface"; diff --git a/pkgs/by-name/hi/himalaya/package.nix b/pkgs/by-name/hi/himalaya/package.nix index c1be11d43712..3028e33b51fd 100644 --- a/pkgs/by-name/hi/himalaya/package.nix +++ b/pkgs/by-name/hi/himalaya/package.nix @@ -52,7 +52,8 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ pkg-config - ] ++ lib.optional (installManPages || installShellCompletions) installShellFiles; + ] + ++ lib.optional (installManPages || installShellCompletions) installShellFiles; buildInputs = [ ] diff --git a/pkgs/by-name/hm/hmat-oss/package.nix b/pkgs/by-name/hm/hmat-oss/package.nix index 9b6ccf16c572..569ec114d158 100644 --- a/pkgs/by-name/hm/hmat-oss/package.nix +++ b/pkgs/by-name/hm/hmat-oss/package.nix @@ -23,13 +23,12 @@ stdenv.mkDerivation (finalAttrs: { "-DHMAT_GIT_VERSION=OFF" ]; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - pkg-config # used to find the LAPACK - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + pkg-config # used to find the LAPACK + ]; buildInputs = [ blas diff --git a/pkgs/by-name/ho/homebridge-config-ui-x/package.nix b/pkgs/by-name/ho/homebridge-config-ui-x/package.nix index e63069768dda..98a41f89a2e9 100644 --- a/pkgs/by-name/ho/homebridge-config-ui-x/package.nix +++ b/pkgs/by-name/ho/homebridge-config-ui-x/package.nix @@ -50,7 +50,8 @@ buildNpmPackage (finalAttrs: { nativeBuildInputs = [ python3 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ cacert ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cacert ]; meta = { description = "Configure Homebridge, monitor and backup from a browser"; diff --git a/pkgs/by-name/ho/homepage-dashboard/package.nix b/pkgs/by-name/ho/homepage-dashboard/package.nix index e3dd75595a7b..a77cf4c41fc0 100644 --- a/pkgs/by-name/ho/homepage-dashboard/package.nix +++ b/pkgs/by-name/ho/homepage-dashboard/package.nix @@ -58,7 +58,8 @@ stdenv.mkDerivation (finalAttrs: { makeBinaryWrapper nodejs pnpm_10.configHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ]; buildInputs = [ nodePackages.node-gyp-build diff --git a/pkgs/by-name/ho/hostapd/package.nix b/pkgs/by-name/ho/hostapd/package.nix index 30eba3baca91..337d4c95c150 100644 --- a/pkgs/by-name/ho/hostapd/package.nix +++ b/pkgs/by-name/ho/hostapd/package.nix @@ -40,68 +40,67 @@ stdenv.mkDerivation rec { ]; # Based on hostapd's defconfig. Only differences are tracked. - extraConfig = - '' - # Use epoll(7) instead of select(2) on linux - CONFIG_ELOOP_EPOLL=y + extraConfig = '' + # Use epoll(7) instead of select(2) on linux + CONFIG_ELOOP_EPOLL=y - # Drivers - CONFIG_DRIVER_WIRED=y - CONFIG_DRIVER_NONE=y + # Drivers + CONFIG_DRIVER_WIRED=y + CONFIG_DRIVER_NONE=y - # Integrated EAP server - CONFIG_EAP_SIM=y - CONFIG_EAP_AKA=y - CONFIG_EAP_AKA_PRIME=y - CONFIG_EAP_PAX=y - CONFIG_EAP_PSK=y - CONFIG_EAP_PWD=y - CONFIG_EAP_SAKE=y - CONFIG_EAP_GPSK=y - CONFIG_EAP_GPSK_SHA256=y - CONFIG_EAP_FAST=y - CONFIG_EAP_IKEV2=y - CONFIG_EAP_TNC=y - CONFIG_EAP_EKE=y + # Integrated EAP server + CONFIG_EAP_SIM=y + CONFIG_EAP_AKA=y + CONFIG_EAP_AKA_PRIME=y + CONFIG_EAP_PAX=y + CONFIG_EAP_PSK=y + CONFIG_EAP_PWD=y + CONFIG_EAP_SAKE=y + CONFIG_EAP_GPSK=y + CONFIG_EAP_GPSK_SHA256=y + CONFIG_EAP_FAST=y + CONFIG_EAP_IKEV2=y + CONFIG_EAP_TNC=y + CONFIG_EAP_EKE=y - CONFIG_TLS=openssl - CONFIG_TLSV11=y - CONFIG_TLSV12=y + CONFIG_TLS=openssl + CONFIG_TLSV11=y + CONFIG_TLSV12=y - CONFIG_SAE=y - CONFIG_SAE_PK=y + CONFIG_SAE=y + CONFIG_SAE_PK=y - CONFIG_OWE=y - CONFIG_OCV=y + CONFIG_OWE=y + CONFIG_OCV=y - # TKIP is considered insecure and upstream support will be removed in the future - CONFIG_NO_TKIP=y + # TKIP is considered insecure and upstream support will be removed in the future + CONFIG_NO_TKIP=y - # Misc - CONFIG_RADIUS_SERVER=y - CONFIG_MACSEC=y - CONFIG_DRIVER_MACSEC_LINUX=y - CONFIG_FULL_DYNAMIC_VLAN=y - CONFIG_VLAN_NETLINK=y - CONFIG_GETRANDOM=y - CONFIG_INTERWORKING=y - CONFIG_HS20=y - CONFIG_FST=y - CONFIG_FST_TEST=y - CONFIG_ACS=y - CONFIG_WNM=y - CONFIG_MBO=y + # Misc + CONFIG_RADIUS_SERVER=y + CONFIG_MACSEC=y + CONFIG_DRIVER_MACSEC_LINUX=y + CONFIG_FULL_DYNAMIC_VLAN=y + CONFIG_VLAN_NETLINK=y + CONFIG_GETRANDOM=y + CONFIG_INTERWORKING=y + CONFIG_HS20=y + CONFIG_FST=y + CONFIG_FST_TEST=y + CONFIG_ACS=y + CONFIG_WNM=y + CONFIG_MBO=y - CONFIG_IEEE80211R=y - CONFIG_IEEE80211W=y - CONFIG_IEEE80211N=y - CONFIG_IEEE80211AC=y - CONFIG_IEEE80211AX=y - CONFIG_IEEE80211BE=y - '' - + lib.optionalString (sqlite != null) '' - CONFIG_SQLITE=y - ''; + CONFIG_IEEE80211R=y + CONFIG_IEEE80211W=y + CONFIG_IEEE80211N=y + CONFIG_IEEE80211AC=y + CONFIG_IEEE80211AX=y + CONFIG_IEEE80211BE=y + '' + + lib.optionalString (sqlite != null) '' + CONFIG_SQLITE=y + ''; passAsFile = [ "extraConfig" ]; diff --git a/pkgs/by-name/ho/hotspot/package.nix b/pkgs/by-name/ho/hotspot/package.nix index cf6c26885172..c58566cd3ae9 100644 --- a/pkgs/by-name/ho/hotspot/package.nix +++ b/pkgs/by-name/ho/hotspot/package.nix @@ -46,31 +46,30 @@ stdenv.mkDerivation rec { cmakeFlags = [ (lib.strings.cmakeBool "QT6_BUILD" true) ]; - buildInputs = - [ - (elfutils.override { enableDebuginfod = true; }) # perfparser needs to find debuginfod.h - kddockwidgets - libelf - qt6.qtbase - qt6.qtsvg - rustc-demangle - zstd - ] - ++ (with kdePackages; [ - kconfig - kconfigwidgets - kgraphviewer - ki18n - kio - kitemmodels - kitemviews - konsole - kparts - kwindowsystem - qcustomplot - syntax-highlighting - threadweaver - ]); + buildInputs = [ + (elfutils.override { enableDebuginfod = true; }) # perfparser needs to find debuginfod.h + kddockwidgets + libelf + qt6.qtbase + qt6.qtsvg + rustc-demangle + zstd + ] + ++ (with kdePackages; [ + kconfig + kconfigwidgets + kgraphviewer + ki18n + kio + kitemmodels + kitemviews + konsole + kparts + kwindowsystem + qcustomplot + syntax-highlighting + threadweaver + ]); qtWrapperArgs = [ "--suffix PATH : ${ diff --git a/pkgs/by-name/hp/hp2p/package.nix b/pkgs/by-name/hp/hp2p/package.nix index 433e85657f29..62d5179b8828 100644 --- a/pkgs/by-name/hp/hp2p/package.nix +++ b/pkgs/by-name/hp/hp2p/package.nix @@ -26,12 +26,13 @@ stdenv.mkDerivation (finalAttrs: { automake python3Packages.wrapPython ]; - buildInputs = - [ mpi ] - ++ (with python3Packages; [ - python - plotly - ]); + buildInputs = [ + mpi + ] + ++ (with python3Packages; [ + python + plotly + ]); pythonPath = (with python3Packages; [ plotly ]); preConfigure = '' diff --git a/pkgs/by-name/hp/hping/package.nix b/pkgs/by-name/hp/hping/package.nix index 2872c3d1df34..ff8d2a72302b 100644 --- a/pkgs/by-name/hp/hping/package.nix +++ b/pkgs/by-name/hp/hping/package.nix @@ -30,25 +30,24 @@ stdenv.mkDerivation { buildInputs = [ libpcap ] ++ lib.optional withTcl tcl; - postPatch = - '' - substituteInPlace Makefile.in --replace "gcc" "$CC" - substituteInPlace version.c --replace "RELEASE_DATE" "\"$version\"" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - sed -i -e 's|#include |#include |' \ - libpcap_stuff.c script.c - '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - substituteInPlace configure --replace 'BYTEORDER=`./byteorder -m`' BYTEORDER=${ - { - littleEndian = "__LITTLE_ENDIAN_BITFIELD"; - bigEndian = "__BIG_ENDIAN_BITFIELD"; - } - .${stdenv.hostPlatform.parsed.cpu.significantByte.name} + postPatch = '' + substituteInPlace Makefile.in --replace "gcc" "$CC" + substituteInPlace version.c --replace "RELEASE_DATE" "\"$version\"" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + sed -i -e 's|#include |#include |' \ + libpcap_stuff.c script.c + '' + + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + substituteInPlace configure --replace 'BYTEORDER=`./byteorder -m`' BYTEORDER=${ + { + littleEndian = "__LITTLE_ENDIAN_BITFIELD"; + bigEndian = "__BIG_ENDIAN_BITFIELD"; } - substituteInPlace Makefile.in --replace './hping3 -v' "" - ''; + .${stdenv.hostPlatform.parsed.cpu.significantByte.name} + } + substituteInPlace Makefile.in --replace './hping3 -v' "" + ''; configureFlags = [ (if withTcl then "TCLSH=${tcl}/bin/tclsh" else "--no-tcl") ]; diff --git a/pkgs/by-name/hp/hpipm/package.nix b/pkgs/by-name/hp/hpipm/package.nix index 88899d752b91..534697dd1983 100644 --- a/pkgs/by-name/hp/hpipm/package.nix +++ b/pkgs/by-name/hp/hpipm/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DHPIPM_FIND_BLASFEO=ON" "-DBUILD_SHARED_LIBS=ON" - ] ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "-DTARGET=GENERIC" ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "-DTARGET=GENERIC" ]; meta = { description = "High-performance interior-point-method QP and QCQP solvers"; diff --git a/pkgs/by-name/hp/hplip/package.nix b/pkgs/by-name/hp/hplip/package.nix index 65133270291f..fa9cd6bf492d 100644 --- a/pkgs/by-name/hp/hplip/package.nix +++ b/pkgs/by-name/hp/hplip/package.nix @@ -87,24 +87,23 @@ python3Packages.buildPythonApplication { sourceRoot = "${pname}-${version}"; - buildInputs = - [ - libjpeg - cups - libusb1 - sane-backends - dbus - file - ghostscript - net-snmp - openssl - perl - zlib - avahi - ] - ++ lib.optionals withQt5 [ - qt5.qtwayland - ]; + buildInputs = [ + libjpeg + cups + libusb1 + sane-backends + dbus + file + ghostscript + net-snmp + openssl + perl + zlib + avahi + ] + ++ lib.optionals withQt5 [ + qt5.qtwayland + ]; nativeBuildInputs = [ pkg-config @@ -112,7 +111,8 @@ python3Packages.buildPythonApplication { autoreconfHook gobject-introspection wrapGAppsHook3 - ] ++ lib.optional withQt5 qt5.wrapQtAppsHook; + ] + ++ lib.optional withQt5 qt5.wrapQtAppsHook; pythonPath = with python3Packages; @@ -245,54 +245,53 @@ python3Packages.buildPythonApplication { # Running `hp-diagnose_plugin -g` can be used to diagnose # issues with plugins. # - postInstall = - '' - for resolution in 16x16 32x32 64x64 128x128 256x256; do - mkdir -p $out/share/icons/hicolor/$resolution/apps - ln -s $out/share/hplip/data/images/$resolution/hp_logo.png \ - $out/share/icons/hicolor/$resolution/apps/hp_logo.png - done - '' - + lib.optionalString withPlugin '' - pushd $NIX_BUILD_TOP/plugin_tmp + postInstall = '' + for resolution in 16x16 32x32 64x64 128x128 256x256; do + mkdir -p $out/share/icons/hicolor/$resolution/apps + ln -s $out/share/hplip/data/images/$resolution/hp_logo.png \ + $out/share/icons/hicolor/$resolution/apps/hp_logo.png + done + '' + + lib.optionalString withPlugin '' + pushd $NIX_BUILD_TOP/plugin_tmp - cp plugin.spec $out/share/hplip/ + cp plugin.spec $out/share/hplip/ - mkdir -p $out/share/hplip/data/firmware - cp *.fw.gz $out/share/hplip/data/firmware + mkdir -p $out/share/hplip/data/firmware + cp *.fw.gz $out/share/hplip/data/firmware - mkdir -p $out/share/hplip/data/plugins - cp license.txt $out/share/hplip/data/plugins + mkdir -p $out/share/hplip/data/plugins + cp license.txt $out/share/hplip/data/plugins - mkdir -p $out/share/hplip/prnt/plugins - for plugin in lj hbpl1; do - cp $plugin-${hplipArch}.so $out/share/hplip/prnt/plugins - chmod 0755 $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so - ln -s $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so \ - $out/share/hplip/prnt/plugins/$plugin.so - done + mkdir -p $out/share/hplip/prnt/plugins + for plugin in lj hbpl1; do + cp $plugin-${hplipArch}.so $out/share/hplip/prnt/plugins + chmod 0755 $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so + ln -s $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so \ + $out/share/hplip/prnt/plugins/$plugin.so + done - mkdir -p $out/share/hplip/scan/plugins - for plugin in bb_soap bb_marvell bb_soapht bb_escl; do - cp $plugin-${hplipArch}.so $out/share/hplip/scan/plugins - chmod 0755 $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so - ln -s $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so \ - $out/share/hplip/scan/plugins/$plugin.so - done + mkdir -p $out/share/hplip/scan/plugins + for plugin in bb_soap bb_marvell bb_soapht bb_escl; do + cp $plugin-${hplipArch}.so $out/share/hplip/scan/plugins + chmod 0755 $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so + ln -s $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so \ + $out/share/hplip/scan/plugins/$plugin.so + done - mkdir -p $out/share/hplip/fax/plugins - for plugin in fax_marvell; do - cp $plugin-${hplipArch}.so $out/share/hplip/fax/plugins - chmod 0755 $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so - ln -s $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so \ - $out/share/hplip/fax/plugins/$plugin.so - done + mkdir -p $out/share/hplip/fax/plugins + for plugin in fax_marvell; do + cp $plugin-${hplipArch}.so $out/share/hplip/fax/plugins + chmod 0755 $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so + ln -s $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so \ + $out/share/hplip/fax/plugins/$plugin.so + done - mkdir -p $out/var/lib/hp - cp ${hplipState} $out/var/lib/hp/hplip.state + mkdir -p $out/var/lib/hp + cp ${hplipState} $out/var/lib/hp/hplip.state - popd - ''; + popd + ''; # The installed executables are just symlinks into $out/share/hplip, # but wrapPythonPrograms ignores symlinks. We cannot replace the Python diff --git a/pkgs/by-name/hq/hqplayerd/rygel.nix b/pkgs/by-name/hq/hqplayerd/rygel.nix index 13e6d13a01aa..1eaac1362ee4 100644 --- a/pkgs/by-name/hq/hqplayerd/rygel.nix +++ b/pkgs/by-name/hq/hqplayerd/rygel.nix @@ -59,30 +59,29 @@ stdenv.mkDerivation rec { python3 ]; - buildInputs = - [ - glib - gssdp - gupnp - gupnp-av - gupnp-dlna - libgee - libsoup_2_4 - gtk3 - libmediaart - sqlite - systemd - tinysparql - shared-mime-info - ] - ++ (with gst_all_1; [ - gstreamer - gst-editing-services - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - ]); + buildInputs = [ + glib + gssdp + gupnp + gupnp-av + gupnp-dlna + libgee + libsoup_2_4 + gtk3 + libmediaart + sqlite + systemd + tinysparql + shared-mime-info + ] + ++ (with gst_all_1; [ + gstreamer + gst-editing-services + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + ]); mesonFlags = [ "-Dsystemd-user-units-dir=${placeholder "out"}/lib/systemd/user" diff --git a/pkgs/by-name/hs/hsd/package.nix b/pkgs/by-name/hs/hsd/package.nix index 278f9b6254e9..96d516ee90ca 100644 --- a/pkgs/by-name/hs/hsd/package.nix +++ b/pkgs/by-name/hs/hsd/package.nix @@ -21,13 +21,12 @@ buildNpmPackage rec { npmDepsHash = "sha256-qM1oPTKffJHlHWhF5huCBPmBSajiYstjhC2GB/iMQ7E="; - nativeBuildInputs = - [ - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ]; + nativeBuildInputs = [ + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ]; buildInputs = [ unbound diff --git a/pkgs/by-name/ht/htb-toolkit/package.nix b/pkgs/by-name/ht/htb-toolkit/package.nix index bc3ec4f995cc..fcbe4894d368 100644 --- a/pkgs/by-name/ht/htb-toolkit/package.nix +++ b/pkgs/by-name/ht/htb-toolkit/package.nix @@ -37,13 +37,12 @@ rustPlatform.buildRustPackage { pkg-config ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gnome-keyring - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gnome-keyring + ]; postPatch = '' substituteInPlace src/manage.rs \ diff --git a/pkgs/by-name/ht/html-tidy/package.nix b/pkgs/by-name/ht/html-tidy/package.nix index 00fa778dd53a..c75bfdbb1f7e 100644 --- a/pkgs/by-name/ht/html-tidy/package.nix +++ b/pkgs/by-name/ht/html-tidy/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake libxslt # manpage - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) html-tidy; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) html-tidy; cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "-DHOST_TIDY=tidy" diff --git a/pkgs/by-name/ht/html5validator/package.nix b/pkgs/by-name/ht/html5validator/package.nix index 7cf3e20c339f..d2c5d6cd266b 100644 --- a/pkgs/by-name/ht/html5validator/package.nix +++ b/pkgs/by-name/ht/html5validator/package.nix @@ -17,13 +17,12 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-yvclqE4+2R9q/UJU9W95U1/xVJeNj+5eKvT6VQel9k8="; }; - propagatedBuildInputs = - [ - openjdk - ] - ++ (with python3.pkgs; [ - pyyaml - ]); + propagatedBuildInputs = [ + openjdk + ] + ++ (with python3.pkgs; [ + pyyaml + ]); nativeCheckInputs = with python3.pkgs; [ hacking diff --git a/pkgs/by-name/ht/htop-vim/package.nix b/pkgs/by-name/ht/htop-vim/package.nix index 5c91528a0383..ad177ae75139 100644 --- a/pkgs/by-name/ht/htop-vim/package.nix +++ b/pkgs/by-name/ht/htop-vim/package.nix @@ -50,26 +50,26 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ] ++ lib.optional stdenv.hostPlatform.isLinux pkg-config; - buildInputs = - [ ncurses ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - libnl - ] - ++ lib.optional sensorsSupport lm_sensors - ++ lib.optional systemdSupport systemd; + buildInputs = [ + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + libnl + ] + ++ lib.optional sensorsSupport lm_sensors + ++ lib.optional systemdSupport systemd; - configureFlags = - [ - "--enable-unicode" - "--sysconfdir=/etc" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-affinity" - "--enable-capabilities" - "--enable-delayacct" - ] - ++ lib.optional sensorsSupport "--enable-sensors"; + configureFlags = [ + "--enable-unicode" + "--sysconfdir=/etc" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--enable-affinity" + "--enable-capabilities" + "--enable-delayacct" + ] + ++ lib.optional sensorsSupport "--enable-sensors"; postFixup = let diff --git a/pkgs/by-name/ht/htop/package.nix b/pkgs/by-name/ht/htop/package.nix index f57a645ced6e..b219ccaa2615 100644 --- a/pkgs/by-name/ht/htop/package.nix +++ b/pkgs/by-name/ht/htop/package.nix @@ -41,26 +41,26 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ] ++ lib.optional stdenv.hostPlatform.isLinux pkg-config; - buildInputs = - [ ncurses ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - libnl - ] - ++ lib.optional sensorsSupport lm_sensors - ++ lib.optional systemdSupport systemd; + buildInputs = [ + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + libnl + ] + ++ lib.optional sensorsSupport lm_sensors + ++ lib.optional systemdSupport systemd; - configureFlags = - [ - "--enable-unicode" - "--sysconfdir=/etc" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-affinity" - "--enable-capabilities" - "--enable-delayacct" - ] - ++ lib.optional sensorsSupport "--enable-sensors"; + configureFlags = [ + "--enable-unicode" + "--sysconfdir=/etc" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--enable-affinity" + "--enable-capabilities" + "--enable-delayacct" + ] + ++ lib.optional sensorsSupport "--enable-sensors"; postFixup = let diff --git a/pkgs/by-name/ht/http-parser/package.nix b/pkgs/by-name/ht/http-parser/package.nix index 30e33e13130a..6a0635e5511c 100644 --- a/pkgs/by-name/ht/http-parser/package.nix +++ b/pkgs/by-name/ht/http-parser/package.nix @@ -20,39 +20,37 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-Wno-error"; - patches = - [ - ./enable-static-shared.patch - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - # https://github.com/nodejs/http-parser/pull/510 - (fetchpatch { - url = "https://github.com/nodejs/http-parser/commit/4f15b7d510dc7c6361a26a7c6d2f7c3a17f8d878.patch"; - sha256 = "sha256-rZZMJeow3V1fTnjadRaRa+xTq3pdhZn/eJ4xjxEDoU4="; - }) - ]; + patches = [ + ./enable-static-shared.patch + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + # https://github.com/nodejs/http-parser/pull/510 + (fetchpatch { + url = "https://github.com/nodejs/http-parser/commit/4f15b7d510dc7c6361a26a7c6d2f7c3a17f8d878.patch"; + sha256 = "sha256-rZZMJeow3V1fTnjadRaRa+xTq3pdhZn/eJ4xjxEDoU4="; + }) + ]; - makeFlags = - [ - "DESTDIR=" - "PREFIX=$(out)" - "BINEXT=${stdenv.hostPlatform.extensions.executable}" - "Platform=${lib.toLower stdenv.hostPlatform.uname.system}" - "AEXT=${lib.strings.removePrefix "." stdenv.hostPlatform.extensions.staticLibrary}" - "ENABLE_SHARED=${if enableShared then "1" else "0"}" - "ENABLE_STATIC=${if enableStatic then "1" else "0"}" - ] - ++ lib.optionals enableShared [ - "SOEXT=${lib.strings.removePrefix "." stdenv.hostPlatform.extensions.sharedLibrary}" - ] - ++ lib.optionals enableStatic [ - "AEXT=${lib.strings.removePrefix "." stdenv.hostPlatform.extensions.staticLibrary}" - ] - ++ lib.optionals (enableShared && stdenv.hostPlatform.isWindows) [ - "SONAME=$(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOEXT)" - "LIBNAME=$(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOREV).$(SOEXT)" - "LDFLAGS=-Wl,--out-implib=$(LIBNAME).a" - ]; + makeFlags = [ + "DESTDIR=" + "PREFIX=$(out)" + "BINEXT=${stdenv.hostPlatform.extensions.executable}" + "Platform=${lib.toLower stdenv.hostPlatform.uname.system}" + "AEXT=${lib.strings.removePrefix "." stdenv.hostPlatform.extensions.staticLibrary}" + "ENABLE_SHARED=${if enableShared then "1" else "0"}" + "ENABLE_STATIC=${if enableStatic then "1" else "0"}" + ] + ++ lib.optionals enableShared [ + "SOEXT=${lib.strings.removePrefix "." stdenv.hostPlatform.extensions.sharedLibrary}" + ] + ++ lib.optionals enableStatic [ + "AEXT=${lib.strings.removePrefix "." stdenv.hostPlatform.extensions.staticLibrary}" + ] + ++ lib.optionals (enableShared && stdenv.hostPlatform.isWindows) [ + "SONAME=$(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOEXT)" + "LIBNAME=$(SOLIBNAME).$(SOMAJOR).$(SOMINOR).$(SOREV).$(SOEXT)" + "LDFLAGS=-Wl,--out-implib=$(LIBNAME).a" + ]; buildFlags = lib.optional enableShared "library" ++ lib.optional enableStatic "package"; diff --git a/pkgs/by-name/ht/httptoolkit/package.nix b/pkgs/by-name/ht/httptoolkit/package.nix index 71bb4d1dc716..fd78ff33ee91 100644 --- a/pkgs/by-name/ht/httptoolkit/package.nix +++ b/pkgs/by-name/ht/httptoolkit/package.nix @@ -35,7 +35,8 @@ buildNpmPackage rec { nativeBuildInputs = [ makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; npmBuildScript = "build:src"; diff --git a/pkgs/by-name/hw/hwloc/package.nix b/pkgs/by-name/hw/hwloc/package.nix index bbf0e11f2b7b..4bc0ed5a1bd2 100644 --- a/pkgs/by-name/hw/hwloc/package.nix +++ b/pkgs/by-name/hw/hwloc/package.nix @@ -32,17 +32,16 @@ stdenv.mkDerivation rec { # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo. nativeBuildInputs = [ pkg-config ] ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]; - buildInputs = - [ - expat - ncurses - ] - ++ lib.optionals x11Support [ - cairo - libX11 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ numactl ] - ++ lib.optionals enableCuda [ cudaPackages.cuda_cudart ]; + buildInputs = [ + expat + ncurses + ] + ++ lib.optionals x11Support [ + cairo + libX11 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ numactl ] + ++ lib.optionals enableCuda [ cudaPackages.cuda_cudart ]; # Since `libpci' appears in `hwloc.pc', it must be propagated. propagatedBuildInputs = lib.optional stdenv.hostPlatform.isLinux pciutils; diff --git a/pkgs/by-name/hy/hydrogen/package.nix b/pkgs/by-name/hy/hydrogen/package.nix index 89b2f022f093..fe1696391e03 100644 --- a/pkgs/by-name/hy/hydrogen/package.nix +++ b/pkgs/by-name/hy/hydrogen/package.nix @@ -32,23 +32,22 @@ stdenv.mkDerivation (finalAttrs: { pkg-config qt5.wrapQtAppsHook ]; - buildInputs = - [ - alsa-lib - ladspa-sdk - lash - libarchive - libjack2 - liblo - libpulseaudio - libsndfile - lrdf - ] - ++ (with qt5; [ - qtbase - qttools - qtxmlpatterns - ]); + buildInputs = [ + alsa-lib + ladspa-sdk + lash + libarchive + libjack2 + liblo + libpulseaudio + libsndfile + lrdf + ] + ++ (with qt5; [ + qtbase + qttools + qtxmlpatterns + ]); cmakeFlags = [ "-DWANT_DEBUG=OFF" diff --git a/pkgs/by-name/hy/hydrus/package.nix b/pkgs/by-name/hy/hydrus/package.nix index 3076f26a4c93..acebcbb05d6f 100644 --- a/pkgs/by-name/hy/hydrus/package.nix +++ b/pkgs/by-name/hy/hydrus/package.nix @@ -99,40 +99,39 @@ python3Packages.buildPythonApplication rec { "doc" ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - # Move the hydrus module and related directories - mkdir -p $out/${python3Packages.python.sitePackages} - mv {hydrus,static,db} $out/${python3Packages.python.sitePackages} - # Fix random files being marked with execute permissions - chmod -x $out/${python3Packages.python.sitePackages}/static/*.{png,svg,ico} - # Build docs - mkdocs build -d help - mkdir -p $doc/share/doc - mv help $doc/share/doc/hydrus + # Move the hydrus module and related directories + mkdir -p $out/${python3Packages.python.sitePackages} + mv {hydrus,static,db} $out/${python3Packages.python.sitePackages} + # Fix random files being marked with execute permissions + chmod -x $out/${python3Packages.python.sitePackages}/static/*.{png,svg,ico} + # Build docs + mkdocs build -d help + mkdir -p $doc/share/doc + mv help $doc/share/doc/hydrus - # install the hydrus binaries - mkdir -p $out/bin - install -m0755 hydrus_server.py $out/bin/hydrus-server - install -m0755 hydrus_client.py $out/bin/hydrus-client - install -m0755 hydrus_test.py $out/bin/hydrus-test + # install the hydrus binaries + mkdir -p $out/bin + install -m0755 hydrus_server.py $out/bin/hydrus-server + install -m0755 hydrus_client.py $out/bin/hydrus-client + install -m0755 hydrus_test.py $out/bin/hydrus-test - # desktop item - mkdir -p "$out/share/icons/hicolor/scalable/apps" - ln -s "$doc/share/doc/hydrus/assets/hydrus-white.svg" "$out/share/icons/hicolor/scalable/apps/hydrus-client.svg" - '' - + lib.optionalString enableSwftools '' - mkdir -p $out/${python3Packages.python.sitePackages}/bin - # swfrender seems to have to be called sfwrender_linux - # not sure if it can be loaded through PATH, but this is simpler - # $out/python3Packages.python.sitePackages/bin is correct NOT .../hydrus/bin - ln -s ${swftools}/bin/swfrender $out/${python3Packages.python.sitePackages}/bin/swfrender_linux - '' - + '' - runHook postInstall - ''; + # desktop item + mkdir -p "$out/share/icons/hicolor/scalable/apps" + ln -s "$doc/share/doc/hydrus/assets/hydrus-white.svg" "$out/share/icons/hicolor/scalable/apps/hydrus-client.svg" + '' + + lib.optionalString enableSwftools '' + mkdir -p $out/${python3Packages.python.sitePackages}/bin + # swfrender seems to have to be called sfwrender_linux + # not sure if it can be loaded through PATH, but this is simpler + # $out/python3Packages.python.sitePackages/bin is correct NOT .../hydrus/bin + ln -s ${swftools}/bin/swfrender $out/${python3Packages.python.sitePackages}/bin/swfrender_linux + '' + + '' + runHook postInstall + ''; checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/hy/hyperscan/package.nix b/pkgs/by-name/hy/hyperscan/package.nix index fa01b1b8013c..0b1e5cf5db0f 100644 --- a/pkgs/by-name/hy/hyperscan/package.nix +++ b/pkgs/by-name/hy/hyperscan/package.nix @@ -37,13 +37,12 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - cmakeFlags = - [ - "-DBUILD_AVX512=ON" - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) "-DFAT_RUNTIME=ON" - ++ lib.optional (withStatic) "-DBUILD_STATIC_AND_SHARED=ON" - ++ lib.optional (!withStatic) "-DBUILD_SHARED_LIBS=ON"; + cmakeFlags = [ + "-DBUILD_AVX512=ON" + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) "-DFAT_RUNTIME=ON" + ++ lib.optional (withStatic) "-DBUILD_STATIC_AND_SHARED=ON" + ++ lib.optional (!withStatic) "-DBUILD_SHARED_LIBS=ON"; # hyperscan CMake is completely broken for chimera builds when pcre is compiled # the only option to make it build - building from source diff --git a/pkgs/by-name/hy/hyprpanel/package.nix b/pkgs/by-name/hy/hyprpanel/package.nix index f6953012d783..f0e20c49c119 100644 --- a/pkgs/by-name/hy/hyprpanel/package.nix +++ b/pkgs/by-name/hy/hyprpanel/package.nix @@ -93,7 +93,8 @@ ags.bundle { ] ++ lib.optional enableCuda gpustat )) - ] ++ (lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ gpu-screen-recorder ]); + ] + ++ (lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ gpu-screen-recorder ]); passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; diff --git a/pkgs/by-name/hy/hypseus-singe/package.nix b/pkgs/by-name/hy/hypseus-singe/package.nix index 5def65d686ab..b40a26f0aa29 100644 --- a/pkgs/by-name/hy/hypseus-singe/package.nix +++ b/pkgs/by-name/hy/hypseus-singe/package.nix @@ -39,20 +39,19 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - bash - SDL2 - SDL2_image - SDL2_ttf - SDL2_mixer - libmpeg2 - libvorbis - libzip - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - ]; + buildInputs = [ + bash + SDL2 + SDL2_image + SDL2_ttf + SDL2_mixer + libmpeg2 + libvorbis + libzip + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + ]; env.NIX_CFLAGS_COMPILE = toString [ "-I${lib.getDev SDL2_image}/include/SDL2" diff --git a/pkgs/by-name/i2/i2p/package.nix b/pkgs/by-name/i2/i2p/package.nix index 92c44e1f6222..82a58347dda2 100644 --- a/pkgs/by-name/i2/i2p/package.nix +++ b/pkgs/by-name/i2/i2p/package.nix @@ -17,15 +17,14 @@ stdenv.mkDerivation (finalAttrs: { version = "2.9.0"; src = fetchzip { - urls = - [ - "https://github.com/i2p/i2p.i2p/archive/i2p-${finalAttrs.version}.tar.gz" - ] - ++ (map (mirror: "${mirror}${finalAttrs.version}/i2psource_${finalAttrs.version}.tar.bz2") [ - "https://download.i2p2.de/releases/" - "https://files.i2p-projekt.de/" - "https://download.i2p2.no/releases/" - ]); + urls = [ + "https://github.com/i2p/i2p.i2p/archive/i2p-${finalAttrs.version}.tar.gz" + ] + ++ (map (mirror: "${mirror}${finalAttrs.version}/i2psource_${finalAttrs.version}.tar.bz2") [ + "https://download.i2p2.de/releases/" + "https://files.i2p-projekt.de/" + "https://download.i2p2.no/releases/" + ]); hash = "sha256-8gnCjSBcTz8KxNPo9KUnnn2IWfCswA/sGDkqzOjNX34="; }; diff --git a/pkgs/by-name/i2/i2pd/package.nix b/pkgs/by-name/i2/i2pd/package.nix index 84f2306c8437..369420753541 100644 --- a/pkgs/by-name/i2/i2pd/package.nix +++ b/pkgs/by-name/i2/i2pd/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation rec { boost zlib openssl - ] ++ lib.optional upnpSupport miniupnpc; + ] + ++ lib.optional upnpSupport miniupnpc; nativeBuildInputs = [ installShellFiles diff --git a/pkgs/by-name/ig/igraph/package.nix b/pkgs/by-name/ig/igraph/package.nix index 4347cbec101e..0b6525f6e774 100644 --- a/pkgs/by-name/ig/igraph/package.nix +++ b/pkgs/by-name/ig/igraph/package.nix @@ -57,19 +57,18 @@ stdenv.mkDerivation (finalAttrs: { xmlto ]; - buildInputs = - [ - arpack - blas - glpk - gmp - lapack - libxml2 - plfit - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ]; + buildInputs = [ + arpack + blas + glpk + gmp + lapack + libxml2 + plfit + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ]; cmakeFlags = [ "-DIGRAPH_USE_INTERNAL_BLAS=OFF" @@ -93,14 +92,13 @@ stdenv.mkDerivation (finalAttrs: { cp -r doc "$out/share" ''; - postFixup = - '' - substituteInPlace $dev/lib/cmake/igraph/igraph-targets.cmake \ - --replace-fail "_IMPORT_PREFIX \"$out\"" "_IMPORT_PREFIX \"$dev\"" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libigraph.dylib - ''; + postFixup = '' + substituteInPlace $dev/lib/cmake/igraph/igraph-targets.cmake \ + --replace-fail "_IMPORT_PREFIX \"$out\"" "_IMPORT_PREFIX \"$dev\"" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libigraph.dylib + ''; passthru.tests = { python = python3.pkgs.igraph; diff --git a/pkgs/by-name/ii/iio-oscilloscope/package.nix b/pkgs/by-name/ii/iio-oscilloscope/package.nix index d4447b6bd8c8..f144b89da8e6 100644 --- a/pkgs/by-name/ii/iio-oscilloscope/package.nix +++ b/pkgs/by-name/ii/iio-oscilloscope/package.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation (finalAttrs: { libxml2 curl jansson - ] ++ lib.optional enable9361 libad9361; + ] + ++ lib.optional enable9361 libad9361; cmakeFlags = [ "-DCMAKE_POLKIT_PREFIX=${placeholder "out"}" diff --git a/pkgs/by-name/im/imagelol/package.nix b/pkgs/by-name/im/imagelol/package.nix index fadf9b716226..664955fbea6a 100644 --- a/pkgs/by-name/im/imagelol/package.nix +++ b/pkgs/by-name/im/imagelol/package.nix @@ -46,11 +46,12 @@ stdenv.mkDerivation rec { cp ./ImageLOL $out/bin ''; - cmakeFlags = - [ (lib.cmakeFeature "CMAKE_C_FLAGS" "-std=gnu90") ] - ++ lib.optional ( - stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 - ) "-DPNG_ARM_NEON=off"; + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_C_FLAGS" "-std=gnu90") + ] + ++ lib.optional ( + stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 + ) "-DPNG_ARM_NEON=off"; meta = with lib; { homepage = "https://github.com/MCredstoner2004/ImageLOL"; diff --git a/pkgs/by-name/im/imhex/package.nix b/pkgs/by-name/im/imhex/package.nix index 06d786255197..5fbc9e98ab53 100644 --- a/pkgs/by-name/im/imhex/package.nix +++ b/pkgs/by-name/im/imhex/package.nix @@ -62,7 +62,8 @@ stdenv.mkDerivation (finalAttrs: { pkg-config rsync makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; buildInputs = [ capstone diff --git a/pkgs/by-name/im/imlib2/package.nix b/pkgs/by-name/im/imlib2/package.nix index 3183dc6306ef..15289326506a 100644 --- a/pkgs/by-name/im/imlib2/package.nix +++ b/pkgs/by-name/im/imlib2/package.nix @@ -50,25 +50,24 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-+iMV8oN5tDCm5mBbQoSwe+BqPvQi1PXhybskcUxM9t0="; }; - buildInputs = - [ - libjpeg - libtiff - giflib - libpng - bzip2 - freetype - libid3tag - ] - ++ optionals x11Support [ - xorg.libXft - xorg.libXext - ] - ++ optional heifSupport libheif - ++ optional svgSupport librsvg - ++ optional webpSupport libwebp - ++ optional jxlSupport libjxl - ++ optional psSupport libspectre; + buildInputs = [ + libjpeg + libtiff + giflib + libpng + bzip2 + freetype + libid3tag + ] + ++ optionals x11Support [ + xorg.libXft + xorg.libXext + ] + ++ optional heifSupport libheif + ++ optional svgSupport librsvg + ++ optional webpSupport libwebp + ++ optional jxlSupport libjxl + ++ optional psSupport libspectre; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/by-name/im/imnodes/package.nix b/pkgs/by-name/im/imnodes/package.nix index 7179cfe3fbaf..d7fae28fd0db 100644 --- a/pkgs/by-name/im/imnodes/package.nix +++ b/pkgs/by-name/im/imnodes/package.nix @@ -34,12 +34,13 @@ stdenv.mkDerivation { ]; nativeBuildInputs = [ cmake ]; - buildInputs = - [ imgui ] - ++ lib.optionals withExamples [ - SDL2 - xorg.libXext - ]; + buildInputs = [ + imgui + ] + ++ lib.optionals withExamples [ + SDL2 + xorg.libXext + ]; cmakeFlags = [ (lib.cmakeBool "IMNODES_EXAMPLES" withExamples) ]; diff --git a/pkgs/by-name/im/implot/demos/default.nix b/pkgs/by-name/im/implot/demos/default.nix index 45d5d54ac83a..6ddde64aaaae 100644 --- a/pkgs/by-name/im/implot/demos/default.nix +++ b/pkgs/by-name/im/implot/demos/default.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation { imnodes implot openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk3 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk3 ]; meta = { description = "Standalone ImPlot Demos"; diff --git a/pkgs/by-name/im/imtui/package.nix b/pkgs/by-name/im/imtui/package.nix index a587f8bce7ab..f6dcca799d1a 100644 --- a/pkgs/by-name/im/imtui/package.nix +++ b/pkgs/by-name/im/imtui/package.nix @@ -35,15 +35,14 @@ stdenv.mkDerivation rec { ++ lib.optional withCurl curl ++ lib.optional withNcurses ncurses; - postPatch = - '' - cp -r ${imgui.src}/* third-party/imgui/imgui - chmod -R u+w third-party/imgui - '' - + lib.optionalString (lib.versionAtLeast imgui.version "1.90.1") '' - substituteInPlace src/imtui-impl-{emscripten,ncurses}.cpp \ - --replace "ImGuiKey_KeyPadEnter" "ImGuiKey_KeypadEnter" - ''; + postPatch = '' + cp -r ${imgui.src}/* third-party/imgui/imgui + chmod -R u+w third-party/imgui + '' + + lib.optionalString (lib.versionAtLeast imgui.version "1.90.1") '' + substituteInPlace src/imtui-impl-{emscripten,ncurses}.cpp \ + --replace "ImGuiKey_KeyPadEnter" "ImGuiKey_KeypadEnter" + ''; cmakeFlags = [ "-DEMSCRIPTEN:BOOL=${if withEmscripten then "ON" else "OFF"}" diff --git a/pkgs/by-name/im/imv/package.nix b/pkgs/by-name/im/imv/package.nix index 95b2f8976c93..aab4fe4ab54c 100644 --- a/pkgs/by-name/im/imv/package.nix +++ b/pkgs/by-name/im/imv/package.nix @@ -92,7 +92,8 @@ stdenv.mkDerivation rec { "-Dwindows=${withWindowSystem}" "-Dtest=enabled" "-Dman=enabled" - ] ++ backendFlags; + ] + ++ backendFlags; strictDeps = true; @@ -105,16 +106,15 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - cmocka - icu75 - libxkbcommon - pango - inih - ] - ++ windowSystems."${withWindowSystem}" - ++ builtins.map (b: backends."${b}") withBackends; + buildInputs = [ + cmocka + icu75 + libxkbcommon + pango + inih + ] + ++ windowSystems."${withWindowSystem}" + ++ builtins.map (b: backends."${b}") withBackends; patches = [ (fetchpatch { diff --git a/pkgs/by-name/in/inchi/package.nix b/pkgs/by-name/in/inchi/package.nix index d738d62e1cd6..d5a271a81c8f 100644 --- a/pkgs/by-name/in/inchi/package.nix +++ b/pkgs/by-name/in/inchi/package.nix @@ -33,17 +33,16 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - preConfigure = - '' - cd ./INCHI_API/libinchi/gcc - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace makefile \ - --replace ",--version-script=libinchi.map" "" \ - --replace "LINUX_Z_RELRO = ,-z,relro" "" \ - --replace "-soname" "-install_name" \ - --replace "gcc" $CC - ''; + preConfigure = '' + cd ./INCHI_API/libinchi/gcc + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace makefile \ + --replace ",--version-script=libinchi.map" "" \ + --replace "LINUX_Z_RELRO = ,-z,relro" "" \ + --replace "-soname" "-install_name" \ + --replace "gcc" $CC + ''; installPhase = let versionOneDot = versionMajor + "." + removeDots versionMinor; diff --git a/pkgs/by-name/in/inetutils/package.nix b/pkgs/by-name/in/inetutils/package.nix index 8908c5b906b9..20f5519a6d7d 100644 --- a/pkgs/by-name/in/inetutils/package.nix +++ b/pkgs/by-name/in/inetutils/package.nix @@ -50,16 +50,17 @@ stdenv.mkDerivation rec { export HELP2MAN=true ''; - configureFlags = - [ "--with-ncurses-include-dir=${ncurses.dev}/include" ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - # Musl doesn't define rcmd - "--disable-rcp" - "--disable-rsh" - "--disable-rlogin" - "--disable-rexec" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-servers"; + configureFlags = [ + "--with-ncurses-include-dir=${ncurses.dev}/include" + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + # Musl doesn't define rcmd + "--disable-rcp" + "--disable-rsh" + "--disable-rlogin" + "--disable-rexec" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-servers"; doCheck = true; diff --git a/pkgs/by-name/in/influxdb-cxx/package.nix b/pkgs/by-name/in/influxdb-cxx/package.nix index 3a209c90a909..073934c53830 100644 --- a/pkgs/by-name/in/influxdb-cxx/package.nix +++ b/pkgs/by-name/in/influxdb-cxx/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - boost - libcpr_1_10_5 - ] - ++ lib.optionals finalAttrs.finalPackage.doCheck [ - catch2_3 - trompeloeil - ]; + buildInputs = [ + boost + libcpr_1_10_5 + ] + ++ lib.optionals finalAttrs.finalPackage.doCheck [ + catch2_3 + trompeloeil + ]; cmakeFlags = [ (lib.cmakeBool "INFLUXCXX_TESTING" finalAttrs.finalPackage.doCheck) diff --git a/pkgs/by-name/in/inlyne/package.nix b/pkgs/by-name/in/inlyne/package.nix index 9141ea0ab818..06a58b0426f3 100644 --- a/pkgs/by-name/in/inlyne/package.nix +++ b/pkgs/by-name/in/inlyne/package.nix @@ -27,13 +27,12 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-jSUqpryUgOL0qo0gbbH4s24krrPsLOSNc6FQUEUeeUQ="; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ fontconfig diff --git a/pkgs/by-name/in/innernet/package.nix b/pkgs/by-name/in/innernet/package.nix index 0dbc42711705..7e4c60150b41 100644 --- a/pkgs/by-name/in/innernet/package.nix +++ b/pkgs/by-name/in/innernet/package.nix @@ -29,25 +29,23 @@ rustPlatform.buildRustPackage rec { installShellFiles ]; - buildInputs = - [ - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; - postInstall = - '' - installManPage doc/innernet-server.8.gz - installManPage doc/innernet.8.gz - installShellCompletion doc/innernet.completions.{bash,fish,zsh} - installShellCompletion doc/innernet-server.completions.{bash,fish,zsh} - '' - + (lib.optionalString stdenv.hostPlatform.isLinux '' - find . -regex '.*\.\(target\|service\)' | xargs install -Dt $out/lib/systemd/system - find $out/lib/systemd/system -type f | xargs sed -i "s|/usr/bin/innernet|$out/bin/innernet|" - ''); + postInstall = '' + installManPage doc/innernet-server.8.gz + installManPage doc/innernet.8.gz + installShellCompletion doc/innernet.completions.{bash,fish,zsh} + installShellCompletion doc/innernet-server.completions.{bash,fish,zsh} + '' + + (lib.optionalString stdenv.hostPlatform.isLinux '' + find . -regex '.*\.\(target\|service\)' | xargs install -Dt $out/lib/systemd/system + find $out/lib/systemd/system -type f | xargs sed -i "s|/usr/bin/innernet|$out/bin/innernet|" + ''); passthru.tests = { serverVersion = testers.testVersion { diff --git a/pkgs/by-name/in/innoextract/package.nix b/pkgs/by-name/in/innoextract/package.nix index 6e145f31300c..922d4d8d0e19 100644 --- a/pkgs/by-name/in/innoextract/package.nix +++ b/pkgs/by-name/in/innoextract/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation rec { buildInputs = [ xz boost - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; # Python is reported as missing during the build, however # including Python does not change the output. diff --git a/pkgs/by-name/in/inspectrum/package.nix b/pkgs/by-name/in/inspectrum/package.nix index 06647204ef6e..2e6a8cb81eea 100644 --- a/pkgs/by-name/in/inspectrum/package.nix +++ b/pkgs/by-name/in/inspectrum/package.nix @@ -26,16 +26,15 @@ gnuradioMinimal.pkgs.mkDerivation rec { qt5.wrapQtAppsHook pkg-config ]; - buildInputs = - [ - fftwFloat - liquid-dsp - qt5.qtbase - ] - ++ lib.optionals (gnuradioMinimal.hasFeature "gr-ctrlport") [ - thrift - gnuradioMinimal.unwrapped.python.pkgs.thrift - ]; + buildInputs = [ + fftwFloat + liquid-dsp + qt5.qtbase + ] + ++ lib.optionals (gnuradioMinimal.hasFeature "gr-ctrlport") [ + thrift + gnuradioMinimal.unwrapped.python.pkgs.thrift + ]; meta = with lib; { description = "Tool for analysing captured signals from sdr receivers"; diff --git a/pkgs/by-name/in/inspircd/package.nix b/pkgs/by-name/in/inspircd/package.nix index 6fc1890a63a1..caf666705e90 100644 --- a/pkgs/by-name/in/inspircd/package.nix +++ b/pkgs/by-name/in/inspircd/package.nix @@ -168,14 +168,13 @@ stdenv.mkDerivation rec { "out" ]; - nativeBuildInputs = - [ - perl - pkg-config - ] - ++ lib.optionals (lib.elem "pgsql" extraModules) [ - libpq.pg_config - ]; + nativeBuildInputs = [ + perl + pkg-config + ] + ++ lib.optionals (lib.elem "pgsql" extraModules) [ + libpq.pg_config + ]; buildInputs = extraInputs; configurePhase = '' @@ -219,29 +218,29 @@ stdenv.mkDerivation rec { nixos-test = nixosTests.inspircd; }; - meta = - { - description = "Modular C++ IRC server"; - license = - [ lib.licenses.gpl2Only ] - ++ lib.concatMap getLicenses extraInputs - ++ lib.optionals (anyMembers extraModules libcModules) (getLicenses stdenv.cc.libc) - # FIXME(sternenseemann): get license of used lib(std)c++ somehow - ++ lib.optional (anyMembers extraModules libcxxModules) "Unknown" - # Hack: Definitely prevent a hydra from building this package on - # a GPL 2 incompatibility even if it is not in a top-level attribute, - # but pulled in indirectly somehow. - ++ lib.optional gpl2Conflict lib.licenses.unfree; - maintainers = [ lib.maintainers.sternenseemann ]; - # windows is theoretically possible, but requires extra work - # which I am not willing to do and can't test. - # https://github.com/inspircd/inspircd/blob/master/win/README.txt - platforms = lib.platforms.unix; - homepage = "https://www.inspircd.org/"; - } - // lib.optionalAttrs gpl2Conflict { - # make sure we never distribute a GPLv2-violating module - # in binary form. They can be built locally of course. - hydraPlatforms = [ ]; - }; + meta = { + description = "Modular C++ IRC server"; + license = [ + lib.licenses.gpl2Only + ] + ++ lib.concatMap getLicenses extraInputs + ++ lib.optionals (anyMembers extraModules libcModules) (getLicenses stdenv.cc.libc) + # FIXME(sternenseemann): get license of used lib(std)c++ somehow + ++ lib.optional (anyMembers extraModules libcxxModules) "Unknown" + # Hack: Definitely prevent a hydra from building this package on + # a GPL 2 incompatibility even if it is not in a top-level attribute, + # but pulled in indirectly somehow. + ++ lib.optional gpl2Conflict lib.licenses.unfree; + maintainers = [ lib.maintainers.sternenseemann ]; + # windows is theoretically possible, but requires extra work + # which I am not willing to do and can't test. + # https://github.com/inspircd/inspircd/blob/master/win/README.txt + platforms = lib.platforms.unix; + homepage = "https://www.inspircd.org/"; + } + // lib.optionalAttrs gpl2Conflict { + # make sure we never distribute a GPLv2-violating module + # in binary form. They can be built locally of course. + hydraPlatforms = [ ]; + }; } diff --git a/pkgs/by-name/in/insync/package.nix b/pkgs/by-name/in/insync/package.nix index 07c9f1f745ae..1cdc8816d1ea 100644 --- a/pkgs/by-name/in/insync/package.nix +++ b/pkgs/by-name/in/insync/package.nix @@ -47,7 +47,8 @@ let libgcrypt libthai xz - ] ++ (with libsForQt5; [ qt5.qtvirtualkeyboard ]); + ] + ++ (with libsForQt5; [ qt5.qtvirtualkeyboard ]); installPhase = '' runHook preInstall diff --git a/pkgs/by-name/in/intel-media-driver/package.nix b/pkgs/by-name/in/intel-media-driver/package.nix index 3686516b8c08..25607964f966 100644 --- a/pkgs/by-name/in/intel-media-driver/package.nix +++ b/pkgs/by-name/in/intel-media-driver/package.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation rec { libpciaccess intel-gmmlib libdrm - ] ++ lib.optional enableX11 libX11; + ] + ++ lib.optional enableX11 libX11; postFixup = lib.optionalString enableX11 '' patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${lib.makeLibraryPath [ libX11 ]}" \ diff --git a/pkgs/by-name/in/intel-vaapi-driver/package.nix b/pkgs/by-name/in/intel-vaapi-driver/package.nix index ec93f3efe588..b63f84cae016 100644 --- a/pkgs/by-name/in/intel-vaapi-driver/package.nix +++ b/pkgs/by-name/in/intel-vaapi-driver/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation { configureFlags = [ (lib.enableFeature enableGui "x11") (lib.enableFeature enableGui "wayland") - ] ++ lib.optional enableHybridCodec "--enable-hybrid-codec"; + ] + ++ lib.optional enableHybridCodec "--enable-hybrid-codec"; nativeBuildInputs = [ autoreconfHook @@ -51,19 +52,18 @@ stdenv.mkDerivation { wayland-scanner ]; - buildInputs = - [ - intel-gpu-tools - libdrm - libva - ] - ++ lib.optionals enableGui [ - libX11 - libXext - libGL - wayland - ] - ++ lib.optional enableHybridCodec vaapi-intel-hybrid; + buildInputs = [ + intel-gpu-tools + libdrm + libva + ] + ++ lib.optionals enableGui [ + libX11 + libXext + libGL + wayland + ] + ++ lib.optional enableHybridCodec vaapi-intel-hybrid; enableParallelBuilding = true; diff --git a/pkgs/by-name/in/intltool/package.nix b/pkgs/by-name/in/intltool/package.nix index e972dc7d5a1e..c138375e071d 100644 --- a/pkgs/by-name/in/intltool/package.nix +++ b/pkgs/by-name/in/intltool/package.nix @@ -33,12 +33,13 @@ stdenv.mkDerivation rec { perl XMLParser ]; - propagatedBuildInputs = - [ gettext ] - ++ (with perlPackages; [ - perl - XMLParser - ]); + propagatedBuildInputs = [ + gettext + ] + ++ (with perlPackages; [ + perl + XMLParser + ]); postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' for f in $out/bin/*; do diff --git a/pkgs/by-name/in/inxi/package.nix b/pkgs/by-name/in/inxi/package.nix index 8010260e3658..30d583709aa2 100644 --- a/pkgs/by-name/in/inxi/package.nix +++ b/pkgs/by-name/in/inxi/package.nix @@ -54,13 +54,12 @@ let xrandr ]) ); - programs = - [ - ps - dnsutils - ] # Core programs - ++ recommendedSystemPrograms - ++ recommendedDisplayInformationPrograms; + programs = [ + ps + dnsutils + ] # Core programs + ++ recommendedSystemPrograms + ++ recommendedDisplayInformationPrograms; in stdenv.mkDerivation (finalAttrs: { pname = "inxi"; diff --git a/pkgs/by-name/io/ioquake3/package.nix b/pkgs/by-name/io/ioquake3/package.nix index a28fccee5f32..5e659b2e3404 100644 --- a/pkgs/by-name/io/ioquake3/package.nix +++ b/pkgs/by-name/io/ioquake3/package.nix @@ -94,17 +94,16 @@ stdenv.mkDerivation (finalAttrs: { installFlags = [ "COPYDIR=$(out)/share/ioquake3" ]; - postInstall = - '' - install -Dm644 misc/quake3.svg $out/share/icons/hicolor/scalable/apps/ioquake3.svg + postInstall = '' + install -Dm644 misc/quake3.svg $out/share/icons/hicolor/scalable/apps/ioquake3.svg - makeWrapper $out/share/ioquake3/ioquake3.* $out/bin/ioquake3 - makeWrapper $out/share/ioquake3/ioq3ded.* $out/bin/ioq3ded - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - mv build/release-darwin-${stdenv.hostPlatform.darwinArch}/ioquake3.app $out/Applications/ - ''; + makeWrapper $out/share/ioquake3/ioquake3.* $out/bin/ioquake3 + makeWrapper $out/share/ioquake3/ioq3ded.* $out/bin/ioq3ded + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + mv build/release-darwin-${stdenv.hostPlatform.darwinArch}/ioquake3.app $out/Applications/ + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/io/iosevka/package.nix b/pkgs/by-name/io/iosevka/package.nix index ef59bce0d16d..3e43ef255cd0 100644 --- a/pkgs/by-name/io/iosevka/package.nix +++ b/pkgs/by-name/io/iosevka/package.nix @@ -67,15 +67,14 @@ buildNpmPackage rec { npmDepsHash = "sha256-DyExvgNJBRlz8iVezlrJfTyobK0L6CMQN+gIMGoYYrw="; - nativeBuildInputs = - [ - remarshal - ttfautohint-nox - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # libtool - cctools - ]; + nativeBuildInputs = [ + remarshal + ttfautohint-nox + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # libtool + cctools + ]; buildPlan = if builtins.isAttrs privateBuildPlan then @@ -84,11 +83,12 @@ buildNpmPackage rec { privateBuildPlan; inherit extraParameters; - passAsFile = - [ "extraParameters" ] - ++ lib.optionals ( - !(builtins.isString privateBuildPlan && lib.hasPrefix builtins.storeDir privateBuildPlan) - ) [ "buildPlan" ]; + passAsFile = [ + "extraParameters" + ] + ++ lib.optionals ( + !(builtins.isString privateBuildPlan && lib.hasPrefix builtins.storeDir privateBuildPlan) + ) [ "buildPlan" ]; configurePhase = '' runHook preConfigure diff --git a/pkgs/by-name/ip/ip2unix/package.nix b/pkgs/by-name/ip/ip2unix/package.nix index c134eedcdeda..3ffc7068370d 100644 --- a/pkgs/by-name/ip/ip2unix/package.nix +++ b/pkgs/by-name/ip/ip2unix/package.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation rec { python3Packages.pytest python3Packages.pytest-timeout systemd - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; buildInputs = [ yaml-cpp ]; diff --git a/pkgs/by-name/ip/ipopt/package.nix b/pkgs/by-name/ip/ipopt/package.nix index b4715462bc82..13b083cb7eb8 100644 --- a/pkgs/by-name/ip/ipopt/package.nix +++ b/pkgs/by-name/ip/ipopt/package.nix @@ -52,17 +52,16 @@ stdenv.mkDerivation rec { pkg-config gfortran ]; - buildInputs = - [ - blas - lapack - ] - ++ lib.optionals enableAMPL [ libamplsolver ] - ++ lib.optionals enableMUMPS [ - mumps - mpi - ] - ++ lib.optionals enableSPRAL [ spral ]; + buildInputs = [ + blas + lapack + ] + ++ lib.optionals enableAMPL [ libamplsolver ] + ++ lib.optionals enableMUMPS [ + mumps + mpi + ] + ++ lib.optionals enableSPRAL [ spral ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ip/iproute2/package.nix b/pkgs/by-name/ip/iproute2/package.nix index 0355f71c7c9a..254c37e6b473 100644 --- a/pkgs/by-name/ip/iproute2/package.nix +++ b/pkgs/by-name/ip/iproute2/package.nix @@ -52,21 +52,20 @@ stdenv.mkDerivation rec { "auto" ]; - makeFlags = - [ - "PREFIX=$(out)" - "SBINDIR=$(out)/sbin" - "DOCDIR=$(TMPDIR)/share/doc/${pname}" # Don't install docs - "HDRDIR=$(dev)/include/iproute2" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "SHARED_LIBS=n" - # all build .so plugins: - "TC_CONFIG_NO_XT=y" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "HOSTCC=$(CC_FOR_BUILD)" - ]; + makeFlags = [ + "PREFIX=$(out)" + "SBINDIR=$(out)/sbin" + "DOCDIR=$(TMPDIR)/share/doc/${pname}" # Don't install docs + "HDRDIR=$(dev)/include/iproute2" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "SHARED_LIBS=n" + # all build .so plugins: + "TC_CONFIG_NO_XT=y" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "HOSTCC=$(CC_FOR_BUILD)" + ]; buildFlags = [ "CONFDIR=/etc/iproute2" @@ -82,17 +81,16 @@ stdenv.mkDerivation rec { flex pkg-config ]; - buildInputs = - [ - db - iptables - libmnl - ] - # needed to uploaded bpf programs - ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ - elfutils - libbpf - ]; + buildInputs = [ + db + iptables + libmnl + ] + # needed to uploaded bpf programs + ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ + elfutils + libbpf + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ip/iprover/package.nix b/pkgs/by-name/ip/iprover/package.nix index a4d043540cef..992cffafc94e 100644 --- a/pkgs/by-name/ip/iprover/package.nix +++ b/pkgs/by-name/ip/iprover/package.nix @@ -25,23 +25,23 @@ stdenv.mkDerivation { strictDeps = true; - nativeBuildInputs = - [ eprover ] - ++ (with ocamlPackages; [ - ocaml - findlib - ]); - buildInputs = - [ - zlib - ocamlPackages.z3 - z3 - ] - ++ (with ocamlPackages; [ - ocamlgraph - yojson - zarith - ]); + nativeBuildInputs = [ + eprover + ] + ++ (with ocamlPackages; [ + ocaml + findlib + ]); + buildInputs = [ + zlib + ocamlPackages.z3 + z3 + ] + ++ (with ocamlPackages; [ + ocamlgraph + yojson + zarith + ]); preConfigure = "patchShebangs ."; diff --git a/pkgs/by-name/ip/ipv6calc/package.nix b/pkgs/by-name/ip/ipv6calc/package.nix index 18405199e661..bcdc3ad5c87a 100644 --- a/pkgs/by-name/ip/ipv6calc/package.nix +++ b/pkgs/by-name/ip/ipv6calc/package.nix @@ -37,25 +37,24 @@ stdenv.mkDerivation rec { done ''; - configureFlags = - [ - "--prefix=${placeholder "out"}" - "--libdir=${placeholder "out"}/lib" - "--datadir=${placeholder "out"}/share" - "--disable-bundled-getopt" - "--disable-bundled-md5" - "--disable-dynamic-load" - "--enable-shared" - ] - ++ lib.optionals (libmaxminddb != null) [ - "--enable-mmdb" - ] - ++ lib.optionals (geolite-legacy != null) [ - "--with-geoip-db=${geolite-legacy}/share/GeoIP" - ] - ++ lib.optionals (ip2location-c != null) [ - "--enable-ip2location" - ]; + configureFlags = [ + "--prefix=${placeholder "out"}" + "--libdir=${placeholder "out"}/lib" + "--datadir=${placeholder "out"}/share" + "--disable-bundled-getopt" + "--disable-bundled-md5" + "--disable-dynamic-load" + "--enable-shared" + ] + ++ lib.optionals (libmaxminddb != null) [ + "--enable-mmdb" + ] + ++ lib.optionals (geolite-legacy != null) [ + "--with-geoip-db=${geolite-legacy}/share/GeoIP" + ] + ++ lib.optionals (ip2location-c != null) [ + "--enable-ip2location" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ip/ipxe/package.nix b/pkgs/by-name/ip/ipxe/package.nix index 9f120adbb122..58fa43cc291b 100644 --- a/pkgs/by-name/ip/ipxe/package.nix +++ b/pkgs/by-name/ip/ipxe/package.nix @@ -56,7 +56,8 @@ stdenv.mkDerivation (finalAttrs: { perl xorriso xz - ] ++ lib.optional stdenv.hostPlatform.isx86 syslinux; + ] + ++ lib.optional stdenv.hostPlatform.isx86 syslinux; depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -84,51 +85,51 @@ stdenv.mkDerivation (finalAttrs: { "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here. "CROSS=${stdenv.cc.targetPrefix}" - ] ++ lib.optional (embedScript != null) "EMBED=${embedScript}"; + ] + ++ lib.optional (embedScript != null) "EMBED=${embedScript}"; enabledOptions = [ "PING_CMD" "IMAGE_TRUST_CMD" "DOWNLOAD_PROTO_HTTP" "DOWNLOAD_PROTO_HTTPS" - ] ++ additionalOptions; + ] + ++ additionalOptions; - configurePhase = - '' - runHook preConfigure - for opt in ${lib.escapeShellArgs finalAttrs.enabledOptions}; do echo "#define $opt" >> src/config/general.h; done - substituteInPlace src/Makefile.housekeeping --replace '/bin/echo' echo - '' - + lib.optionalString stdenv.hostPlatform.isx86 '' - substituteInPlace src/util/genfsimg --replace /usr/lib/syslinux ${syslinux}/share/syslinux - '' - + '' - runHook postConfigure - ''; + configurePhase = '' + runHook preConfigure + for opt in ${lib.escapeShellArgs finalAttrs.enabledOptions}; do echo "#define $opt" >> src/config/general.h; done + substituteInPlace src/Makefile.housekeeping --replace '/bin/echo' echo + '' + + lib.optionalString stdenv.hostPlatform.isx86 '' + substituteInPlace src/util/genfsimg --replace /usr/lib/syslinux ${syslinux}/share/syslinux + '' + + '' + runHook postConfigure + ''; preBuild = "cd src"; buildFlags = lib.attrNames targets; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out - ${lib.concatStringsSep "\n" ( - lib.mapAttrsToList ( - from: to: if to == null then "cp -v ${from} $out" else "cp -v ${from} $out/${to}" - ) targets - )} - '' - + lib.optionalString stdenv.hostPlatform.isx86 '' - # Some PXE constellations especially with dnsmasq are looking for the file with .0 ending - # let's provide it as a symlink to be compatible in this case. - ln -s undionly.kpxe $out/undionly.kpxe.0 - '' - + '' - runHook postInstall - ''; + mkdir -p $out + ${lib.concatStringsSep "\n" ( + lib.mapAttrsToList ( + from: to: if to == null then "cp -v ${from} $out" else "cp -v ${from} $out/${to}" + ) targets + )} + '' + + lib.optionalString stdenv.hostPlatform.isx86 '' + # Some PXE constellations especially with dnsmasq are looking for the file with .0 ending + # let's provide it as a symlink to be compatible in this case. + ln -s undionly.kpxe $out/undionly.kpxe.0 + '' + + '' + runHook postInstall + ''; enableParallelBuilding = true; diff --git a/pkgs/by-name/iq/iqtree/package.nix b/pkgs/by-name/iq/iqtree/package.nix index 67fb7b145025..4b71ea69c896 100644 --- a/pkgs/by-name/iq/iqtree/package.nix +++ b/pkgs/by-name/iq/iqtree/package.nix @@ -23,15 +23,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - boost - eigen - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages.openmp - ]; + buildInputs = [ + boost + eigen + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp + ]; meta = with lib; { homepage = "http://www.iqtree.org/"; diff --git a/pkgs/by-name/ir/iredis/package.nix b/pkgs/by-name/ir/iredis/package.nix index f66a871376f6..13f16108d737 100644 --- a/pkgs/by-name/ir/iredis/package.nix +++ b/pkgs/by-name/ir/iredis/package.nix @@ -45,20 +45,19 @@ python3.pkgs.buildPythonApplication rec { pytestCheckHook ]; - pytestFlagsArray = - [ - # Fails on sandbox - "--ignore=tests/unittests/test_client.py" - "--deselect=tests/unittests/test_render_functions.py::test_render_unixtime_config_raw" - "--deselect=tests/unittests/test_render_functions.py::test_render_time" - # Only execute unittests, because cli tests require a running Redis - "tests/unittests/" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Flaky tests - "--deselect=tests/unittests/test_entry.py::test_command_shell_options_higher_priority" - "--deselect=tests/unittests/test_utils.py::test_timer" - ]; + pytestFlagsArray = [ + # Fails on sandbox + "--ignore=tests/unittests/test_client.py" + "--deselect=tests/unittests/test_render_functions.py::test_render_unixtime_config_raw" + "--deselect=tests/unittests/test_render_functions.py::test_render_time" + # Only execute unittests, because cli tests require a running Redis + "tests/unittests/" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Flaky tests + "--deselect=tests/unittests/test_entry.py::test_command_shell_options_higher_priority" + "--deselect=tests/unittests/test_utils.py::test_timer" + ]; pythonImportsCheck = [ "iredis" ]; diff --git a/pkgs/by-name/ir/ironbar/package.nix b/pkgs/by-name/ir/ironbar/package.nix index 076c44fcb4f1..45002f90850a 100644 --- a/pkgs/by-name/ir/ironbar/package.nix +++ b/pkgs/by-name/ir/ironbar/package.nix @@ -42,23 +42,22 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-l+Y/ntuqaasDL0cEHSwscFxAs1jC0bm9oTU0J/K60AY="; - buildInputs = - [ - gtk3 - gdk-pixbuf - glib - gtk-layer-shell - glib-networking - shared-mime-info - adwaita-icon-theme - hicolor-icon-theme - gsettings-desktop-schemas - libxkbcommon - ] - ++ lib.optionals (hasFeature "http") [ openssl ] - ++ lib.optionals (hasFeature "volume") [ libpulseaudio ] - ++ lib.optionals (hasFeature "cairo") [ luajit ] - ++ lib.optionals (hasFeature "tray") [ libdbusmenu-gtk3 ]; + buildInputs = [ + gtk3 + gdk-pixbuf + glib + gtk-layer-shell + glib-networking + shared-mime-info + adwaita-icon-theme + hicolor-icon-theme + gsettings-desktop-schemas + libxkbcommon + ] + ++ lib.optionals (hasFeature "http") [ openssl ] + ++ lib.optionals (hasFeature "volume") [ libpulseaudio ] + ++ lib.optionals (hasFeature "cairo") [ luajit ] + ++ lib.optionals (hasFeature "tray") [ libdbusmenu-gtk3 ]; nativeBuildInputs = [ pkg-config @@ -72,21 +71,20 @@ rustPlatform.buildRustPackage rec { buildNoDefaultFeatures = features != [ ]; buildFeatures = features; - gappsWrapperArgs = - '' - # Thumbnailers - --prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share" - --prefix XDG_DATA_DIRS : "${librsvg}/share" - --prefix XDG_DATA_DIRS : "${webp-pixbuf-loader}/share" - --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" + gappsWrapperArgs = '' + # Thumbnailers + --prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share" + --prefix XDG_DATA_DIRS : "${librsvg}/share" + --prefix XDG_DATA_DIRS : "${webp-pixbuf-loader}/share" + --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" - # gtk-launch - --suffix PATH : "${lib.makeBinPath [ gtk3 ]}" - '' - + lib.optionalString (hasFeature "cairo") '' - --prefix LUA_PATH : "./?.lua;${luajitPackages.lgi}/share/lua/5.1/?.lua;${luajitPackages.lgi}/share/lua/5.1/?/init.lua;${luajit}/share/lua/5.1/\?.lua;${luajit}/share/lua/5.1/?/init.lua" - --prefix LUA_CPATH : "./?.so;${luajitPackages.lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so" - ''; + # gtk-launch + --suffix PATH : "${lib.makeBinPath [ gtk3 ]}" + '' + + lib.optionalString (hasFeature "cairo") '' + --prefix LUA_PATH : "./?.lua;${luajitPackages.lgi}/share/lua/5.1/?.lua;${luajitPackages.lgi}/share/lua/5.1/?/init.lua;${luajit}/share/lua/5.1/\?.lua;${luajit}/share/lua/5.1/?/init.lua" + --prefix LUA_CPATH : "./?.so;${luajitPackages.lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so" + ''; preFixup = '' gappsWrapperArgs+=( diff --git a/pkgs/by-name/ir/irqbalance/package.nix b/pkgs/by-name/ir/irqbalance/package.nix index c1837d0e7e96..ff9f4cd655fc 100644 --- a/pkgs/by-name/ir/irqbalance/package.nix +++ b/pkgs/by-name/ir/irqbalance/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation rec { autoreconfHook pkg-config ]; - buildInputs = - [ - glib - ncurses - libcap_ng - ] - ++ (lib.optionals enableSystemd [ - systemdMinimal - ]); + buildInputs = [ + glib + ncurses + libcap_ng + ] + ++ (lib.optionals enableSystemd [ + systemdMinimal + ]); configureFlags = lib.optionals enableSystemd [ "--with-systemd" diff --git a/pkgs/by-name/ir/irrd/package.nix b/pkgs/by-name/ir/irrd/package.nix index 44165dfa4518..aa2c1522b5eb 100644 --- a/pkgs/by-name/ir/irrd/package.nix +++ b/pkgs/by-name/ir/irrd/package.nix @@ -61,21 +61,20 @@ py.pkgs.buildPythonPackage rec { poetry-core ]; - nativeCheckInputs = - [ - git - valkey - redisTestHook - postgresql - postgresqlTestHook - ] - ++ (with py.pkgs; [ - pytest-asyncio - pytest-freezegun - pytestCheckHook - smtpdfix - httpx - ]); + nativeCheckInputs = [ + git + valkey + redisTestHook + postgresql + postgresqlTestHook + ] + ++ (with py.pkgs; [ + pytest-asyncio + pytest-freezegun + pytestCheckHook + smtpdfix + httpx + ]); propagatedBuildInputs = with py.pkgs; diff --git a/pkgs/by-name/is/isabelle/package.nix b/pkgs/by-name/is/isabelle/package.nix index 556f71b15b68..e9d3ec865eca 100644 --- a/pkgs/by-name/is/isabelle/package.nix +++ b/pkgs/by-name/is/isabelle/package.nix @@ -99,83 +99,82 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot=${finalAttrs.dirname} ''; - postPatch = - '' - patchShebangs lib/Tools/ bin/ + postPatch = '' + patchShebangs lib/Tools/ bin/ - cat >contrib/verit-*/etc/settings <contrib/verit-*/etc/settings <contrib/e-*/etc/settings <contrib/e-*/etc/settings <contrib/vampire-*/etc/settings <contrib/vampire-*/etc/settings <contrib/polyml-*/etc/settings <contrib/polyml-*/etc/settings <contrib/jdk*/etc/settings <contrib/jdk*/etc/settings <>etc/settings + echo ISABELLE_LINE_EDITOR=${rlwrap}/bin/rlwrap >>etc/settings - for comp in contrib/jdk* contrib/polyml-* contrib/verit-* contrib/vampire-* contrib/e-*; do - rm -rf $comp/${if stdenv.hostPlatform.isx86 then "x86" else "arm"}* - done - rm -rf contrib/*/src + for comp in contrib/jdk* contrib/polyml-* contrib/verit-* contrib/vampire-* contrib/e-*; do + rm -rf $comp/${if stdenv.hostPlatform.isx86 then "x86" else "arm"}* + done + rm -rf contrib/*/src - substituteInPlace lib/Tools/env \ - --replace-fail /usr/bin/env ${coreutils}/bin/env + substituteInPlace lib/Tools/env \ + --replace-fail /usr/bin/env ${coreutils}/bin/env - substituteInPlace src/Tools/Setup/src/Environment.java \ - --replace-fail 'cmd.add("/usr/bin/env");' "" \ - --replace-fail 'cmd.add("bash");' "cmd.add(\"$SHELL\");" + substituteInPlace src/Tools/Setup/src/Environment.java \ + --replace-fail 'cmd.add("/usr/bin/env");' "" \ + --replace-fail 'cmd.add("bash");' "cmd.add(\"$SHELL\");" - substituteInPlace src/Pure/General/sha1.ML \ - --replace-fail '"$ML_HOME/" ^ (if ML_System.platform_is_windows then "sha1.dll" else "libsha1.so")' '"${sha1}/lib/libsha1.so"' + substituteInPlace src/Pure/General/sha1.ML \ + --replace-fail '"$ML_HOME/" ^ (if ML_System.platform_is_windows then "sha1.dll" else "libsha1.so")' '"${sha1}/lib/libsha1.so"' - rm -r heaps - '' - + lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") '' - substituteInPlace lib/scripts/isabelle-platform \ - --replace-fail 'ISABELLE_APPLE_PLATFORM64=arm64-darwin' "" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - arch=${ - if stdenv.hostPlatform.system == "aarch64-linux" then "arm64-linux" else stdenv.hostPlatform.system - } - for f in contrib/*/$arch/{z3,nunchaku,spass,zipperposition}; do - patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f"${lib.optionalString stdenv.hostPlatform.isAarch64 " || true"} - done - patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) contrib/bash_process-*/$arch/bash_process - for d in contrib/kodkodi-*/jni/$arch; do - patchelf --set-rpath "${ - lib.concatStringsSep ":" [ - "${java}/lib/openjdk/lib/server" - "${lib.getLib stdenv.cc.cc}/lib" - ] - }" $d/*.so - done - '' - + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") '' - patchelf --set-rpath "${lib.getLib stdenv.cc.cc}/lib" contrib/z3-*/$arch/z3 - ''; + rm -r heaps + '' + + lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") '' + substituteInPlace lib/scripts/isabelle-platform \ + --replace-fail 'ISABELLE_APPLE_PLATFORM64=arm64-darwin' "" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + arch=${ + if stdenv.hostPlatform.system == "aarch64-linux" then "arm64-linux" else stdenv.hostPlatform.system + } + for f in contrib/*/$arch/{z3,nunchaku,spass,zipperposition}; do + patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f"${lib.optionalString stdenv.hostPlatform.isAarch64 " || true"} + done + patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) contrib/bash_process-*/$arch/bash_process + for d in contrib/kodkodi-*/jni/$arch; do + patchelf --set-rpath "${ + lib.concatStringsSep ":" [ + "${java}/lib/openjdk/lib/server" + "${lib.getLib stdenv.cc.cc}/lib" + ] + }" $d/*.so + done + '' + + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") '' + patchelf --set-rpath "${lib.getLib stdenv.cc.cc}/lib" contrib/z3-*/$arch/z3 + ''; buildPhase = '' export HOME=$TMP # The build fails if home is not set @@ -261,22 +260,21 @@ stdenv.mkDerivation (finalAttrs: { name = "isabelle-with-components-${isabelle.version}"; paths = [ isabelle ] ++ (builtins.map (c: c.override { inherit isabelle; }) components); - postBuild = - '' - rm $out/bin/* + postBuild = '' + rm $out/bin/* - cd ${base} - rm bin/* - cp ${isabelle}/${isabelle.dirname}/bin/* bin/ - rm etc/components - cat ${isabelle}/${isabelle.dirname}/etc/components > etc/components + cd ${base} + rm bin/* + cp ${isabelle}/${isabelle.dirname}/bin/* bin/ + rm etc/components + cat ${isabelle}/${isabelle.dirname}/etc/components > etc/components - export HOME=$TMP - bin/isabelle install $out/bin - patchShebangs $out/bin - '' - + lib.concatMapStringsSep "\n" (c: '' - echo contrib/${c.pname}-${c.version} >> ${base}/etc/components - '') components; + export HOME=$TMP + bin/isabelle install $out/bin + patchShebangs $out/bin + '' + + lib.concatMapStringsSep "\n" (c: '' + echo contrib/${c.pname}-${c.version} >> ${base}/etc/components + '') components; }; }) diff --git a/pkgs/by-name/is/isync/package.nix b/pkgs/by-name/is/isync/package.nix index 23d6dad5bbc1..74794d19acec 100644 --- a/pkgs/by-name/is/isync/package.nix +++ b/pkgs/by-name/is/isync/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook pkg-config perl - ] ++ lib.optionals withCyrusSaslXoauth2 [ makeWrapper ]; + ] + ++ lib.optionals withCyrusSaslXoauth2 [ makeWrapper ]; buildInputs = [ perl538Packages.TimeDate openssl diff --git a/pkgs/by-name/iw/iwd/package.nix b/pkgs/by-name/iw/iwd/package.nix index 11c1522c747d..ebf3f4324a86 100644 --- a/pkgs/by-name/iw/iwd/package.nix +++ b/pkgs/by-name/iw/iwd/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation (finalAttrs: { "out" "man" "doc" - ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "test"; + ] + ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "test"; separateDebugInfo = true; nativeBuildInputs = [ @@ -78,16 +79,15 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; - postInstall = - '' - mkdir -p $doc/share/doc - cp -a doc $doc/share/doc/iwd - cp -a README AUTHORS TODO $doc/share/doc/iwd - '' - + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' - mkdir -p $test/bin - cp -a test/* $test/bin/ - ''; + postInstall = '' + mkdir -p $doc/share/doc + cp -a doc $doc/share/doc/iwd + cp -a README AUTHORS TODO $doc/share/doc/iwd + '' + + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + mkdir -p $test/bin + cp -a test/* $test/bin/ + ''; preFixup = '' wrapPythonPrograms diff --git a/pkgs/by-name/ja/jadx/package.nix b/pkgs/by-name/ja/jadx/package.nix index 0fe71e06db65..a3e14509699e 100644 --- a/pkgs/by-name/ja/jadx/package.nix +++ b/pkgs/by-name/ja/jadx/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation (finalAttrs: { imagemagick makeBinaryWrapper copyDesktopItems - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; # Otherwise, Gradle fails with `java.net.SocketException: Operation not permitted` __darwinAllowLocalNetworking = true; diff --git a/pkgs/by-name/ja/jalv/package.nix b/pkgs/by-name/ja/jalv/package.nix index 9212178151c9..4e574bab4c30 100644 --- a/pkgs/by-name/ja/jalv/package.nix +++ b/pkgs/by-name/ja/jalv/package.nix @@ -30,28 +30,26 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-MAQoc+WcuoG6Psa44VRaZ2TWB2LBpvf6EmqbUZPUf38="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - ] - ++ lib.optionals (!useQt) [ wrapGAppsHook3 ] - ++ lib.optionals useQt [ libsForQt5.wrapQtAppsHook ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ] + ++ lib.optionals (!useQt) [ wrapGAppsHook3 ] + ++ lib.optionals useQt [ libsForQt5.wrapQtAppsHook ]; - buildInputs = - [ - lilv - lv2 - portaudio - serd - sord - sratom - suil - ] - ++ lib.optionals (!useJack) [ portaudio ] - ++ lib.optionals useJack [ libjack2 ] - ++ lib.optionals useQt [ libsForQt5.qtbase ]; + buildInputs = [ + lilv + lv2 + portaudio + serd + sord + sratom + suil + ] + ++ lib.optionals (!useJack) [ portaudio ] + ++ lib.optionals useJack [ libjack2 ] + ++ lib.optionals useQt [ libsForQt5.qtbase ]; mesonFlags = [ (lib.mesonEnable "portaudio" (!useJack)) diff --git a/pkgs/by-name/ja/jam/package.nix b/pkgs/by-name/ja/jam/package.nix index 1fb3fc3e1e51..6f981814d4cc 100644 --- a/pkgs/by-name/ja/jam/package.nix +++ b/pkgs/by-name/ja/jam/package.nix @@ -49,26 +49,25 @@ stdenv.mkDerivation (finalAttrs: { export AR="$AR rc" ''; - postPatch = - '' - substituteInPlace jam.h --replace-fail 'ifdef linux' 'ifdef __linux__' - '' - + - # When cross-compiling, we need to set the preprocessor macros - # OSMAJOR/OSMINOR/OSPLAT to the values from the target platform, not the host - # platform. This looks a little ridiculous because the vast majority of build - # tools don't embed target-specific information into their binary, but in this - # case we behave more like a compiler than a make(1)-alike. - lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) '' - cat >>jam.h <>jam.h <> vs. - # std::basic_string<..., [default allocator]> - ++ lib.optional ( - (stdenv.buildPlatform != stdenv.hostPlatform) || secureMemory - ) "-DJSONCPP_WITH_TESTS=OFF"; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DBUILD_OBJECT_LIBS=OFF" + "-DJSONCPP_WITH_CMAKE_PACKAGE=ON" + "-DBUILD_STATIC_LIBS=${if enableStatic then "ON" else "OFF"}" + ] + # the test's won't compile if secureMemory is used because there is no + # comparison operators and conversion functions between + # std::basic_string<..., Json::SecureAllocator> vs. + # std::basic_string<..., [default allocator]> + ++ lib.optional ( + (stdenv.buildPlatform != stdenv.hostPlatform) || secureMemory + ) "-DJSONCPP_WITH_TESTS=OFF"; meta = with lib; { homepage = "https://github.com/open-source-parsers/jsoncpp"; diff --git a/pkgs/by-name/js/jsonnet/package.nix b/pkgs/by-name/js/jsonnet/package.nix index 4d7136f01eb1..b1f40c5252a0 100644 --- a/pkgs/by-name/js/jsonnet/package.nix +++ b/pkgs/by-name/js/jsonnet/package.nix @@ -28,14 +28,13 @@ stdenv.mkDerivation rec { ]; buildInputs = [ gtest ]; - cmakeFlags = - [ - "-DUSE_SYSTEM_GTEST=ON" - "-DBUILD_STATIC_LIBS=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "-DBUILD_SHARED_BINARIES=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" - ]; + cmakeFlags = [ + "-DUSE_SYSTEM_GTEST=ON" + "-DBUILD_STATIC_LIBS=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "-DBUILD_SHARED_BINARIES=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ju/juce/package.nix b/pkgs/by-name/ju/juce/package.nix index a18cd169b05c..df319aa7a094 100644 --- a/pkgs/by-name/ju/juce/package.nix +++ b/pkgs/by-name/ju/juce/package.nix @@ -55,30 +55,29 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - freetype # libfreetype.so - curl # libcurl.so - (lib.getLib stdenv.cc.cc) # libstdc++.so libgcc_s.so - pcre2 # libpcre2.pc - libsysprof-capture - libthai - libdatrie - lerc - libepoxy - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib # libasound.so - libglvnd # libGL.so - webkitgtk_4_1 # webkit2gtk-4.0 - util-linuxMinimal - libselinux - libsepol - libXdmcp - libxkbcommon - libXtst - ]; + buildInputs = [ + freetype # libfreetype.so + curl # libcurl.so + (lib.getLib stdenv.cc.cc) # libstdc++.so libgcc_s.so + pcre2 # libpcre2.pc + libsysprof-capture + libthai + libdatrie + lerc + libepoxy + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib # libasound.so + libglvnd # libGL.so + webkitgtk_4_1 # webkit2gtk-4.0 + util-linuxMinimal + libselinux + libsepol + libXdmcp + libxkbcommon + libXtst + ]; propagatedBuildInputs = [ fontconfig ]; diff --git a/pkgs/by-name/ju/julius/package.nix b/pkgs/by-name/ju/julius/package.nix index 2d9cec42ba95..81b48a28771f 100644 --- a/pkgs/by-name/ju/julius/package.nix +++ b/pkgs/by-name/ju/julius/package.nix @@ -27,15 +27,14 @@ stdenv.mkDerivation rec { ./darwin-fixes.patch ]; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.sigtool - libicns - imagemagick - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.sigtool + libicns + imagemagick + ]; buildInputs = [ SDL2 diff --git a/pkgs/by-name/ju/jumpy/package.nix b/pkgs/by-name/ju/jumpy/package.nix index 08da47828918..c4ccf3511824 100644 --- a/pkgs/by-name/ju/jumpy/package.nix +++ b/pkgs/by-name/ju/jumpy/package.nix @@ -42,24 +42,23 @@ rustPlatform.buildRustPackage (finalAttrs: { pkg-config ]; - buildInputs = - [ - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libxkbcommon - udev - vulkan-loader - wayland - xorg.libX11 - xorg.libXcursor - xorg.libXi - xorg.libXrandr - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - rustPlatform.bindgenHook - ]; + buildInputs = [ + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libxkbcommon + udev + vulkan-loader + wayland + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXrandr + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + rustPlatform.bindgenHook + ]; cargoBuildFlags = [ "--bin" diff --git a/pkgs/by-name/ju/just/package.nix b/pkgs/by-name/ju/just/package.nix index a4591cdea885..583347b9cc46 100644 --- a/pkgs/by-name/ju/just/package.nix +++ b/pkgs/by-name/ju/just/package.nix @@ -20,14 +20,13 @@ rustPlatform.buildRustPackage rec { pname = "just"; version = "1.42.3"; - outputs = - [ - "out" - ] - ++ lib.optionals installManPages [ - "man" - ] - ++ lib.optionals withDocumentation [ "doc" ]; + outputs = [ + "out" + ] + ++ lib.optionals installManPages [ + "man" + ] + ++ lib.optionals withDocumentation [ "doc" ]; src = fetchFromGitHub { owner = "casey"; @@ -72,7 +71,8 @@ rustPlatform.buildRustPackage rec { cargoBuildFlags = [ "--package=just" - ] ++ (lib.optionals withDocumentation [ "--package=generate-book" ]); + ] + ++ (lib.optionals withDocumentation [ "--package=generate-book" ]); checkFlags = [ "--skip=backticks::trailing_newlines_are_stripped" # Wants to use python3 as alternate shell diff --git a/pkgs/by-name/ju/justbuild/package.nix b/pkgs/by-name/ju/justbuild/package.nix index ec81a228209e..3399824bee11 100644 --- a/pkgs/by-name/ju/justbuild/package.nix +++ b/pkgs/by-name/ju/justbuild/package.nix @@ -85,20 +85,19 @@ stdenv.mkDerivation rec { python3 ]; - postPatch = - '' - sed -i -e 's|\./bin/just-mr.py|${python3}/bin/python3 ./bin/just-mr.py|' bin/bootstrap.py - sed -i -e 's|#!/usr/bin/env python3|#!${python3}/bin/python3|' bin/parallel-bootstrap-traverser.py - jq '.repositories.protobuf.pkg_bootstrap.local_path = "${protobuf}"' etc/repos.in.json > etc/repos.in.json.patched - mv etc/repos.in.json.patched etc/repos.in.json - jq '.repositories.com_github_grpc_grpc.pkg_bootstrap.local_path = "${grpc}"' etc/repos.in.json > etc/repos.in.json.patched - mv etc/repos.in.json.patched etc/repos.in.json - jq '.unknown.PATH = []' etc/toolchain/CC/TARGETS > etc/toolchain/CC/TARGETS.patched - mv etc/toolchain/CC/TARGETS.patched etc/toolchain/CC/TARGETS - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - sed -i -e 's|-Wl,-z,stack-size=8388608|-Wl,-stack_size,0x800000|' bin/bootstrap.py - ''; + postPatch = '' + sed -i -e 's|\./bin/just-mr.py|${python3}/bin/python3 ./bin/just-mr.py|' bin/bootstrap.py + sed -i -e 's|#!/usr/bin/env python3|#!${python3}/bin/python3|' bin/parallel-bootstrap-traverser.py + jq '.repositories.protobuf.pkg_bootstrap.local_path = "${protobuf}"' etc/repos.in.json > etc/repos.in.json.patched + mv etc/repos.in.json.patched etc/repos.in.json + jq '.repositories.com_github_grpc_grpc.pkg_bootstrap.local_path = "${grpc}"' etc/repos.in.json > etc/repos.in.json.patched + mv etc/repos.in.json.patched etc/repos.in.json + jq '.unknown.PATH = []' etc/toolchain/CC/TARGETS > etc/toolchain/CC/TARGETS.patched + mv etc/toolchain/CC/TARGETS.patched etc/toolchain/CC/TARGETS + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + sed -i -e 's|-Wl,-z,stack-size=8388608|-Wl,-stack_size,0x800000|' bin/bootstrap.py + ''; /* The build phase follows the bootstrap procedure that is explained in diff --git a/pkgs/by-name/ka/kafka-delta-ingest/package.nix b/pkgs/by-name/ka/kafka-delta-ingest/package.nix index 2ae7edfb8bd9..26e6e1b1181b 100644 --- a/pkgs/by-name/ka/kafka-delta-ingest/package.nix +++ b/pkgs/by-name/ka/kafka-delta-ingest/package.nix @@ -29,12 +29,11 @@ rustPlatform.buildRustPackage { perl ]; - buildFeatures = - [ - "dynamic-linking" - ] - ++ lib.optional enableS3 "s3" - ++ lib.optional enableAzure "azure"; + buildFeatures = [ + "dynamic-linking" + ] + ++ lib.optional enableS3 "s3" + ++ lib.optional enableAzure "azure"; buildInputs = [ openssl diff --git a/pkgs/by-name/ka/kahip/package.nix b/pkgs/by-name/ka/kahip/package.nix index 19b79ba4ac33..17f12f7725aa 100644 --- a/pkgs/by-name/ka/kahip/package.nix +++ b/pkgs/by-name/ka/kahip/package.nix @@ -28,12 +28,13 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pybind11 - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pybind11 + ]; buildInputs = [ mpi diff --git a/pkgs/by-name/ka/kana/package.nix b/pkgs/by-name/ka/kana/package.nix index fc4d2aa1b860..93fe877665f6 100644 --- a/pkgs/by-name/ka/kana/package.nix +++ b/pkgs/by-name/ka/kana/package.nix @@ -43,16 +43,15 @@ stdenv.mkDerivation rec { desktop-file-utils ]; - buildInputs = - [ - libadwaita - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-bad - gst-plugins-good - ]); + buildInputs = [ + libadwaita + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-bad + gst-plugins-good + ]); # Workaround for the gettext-sys issue # https://github.com/Koka/gettext-rs/issues/114 diff --git a/pkgs/by-name/ka/kando/package.nix b/pkgs/by-name/ka/kando/package.nix index 6132c44268cf..4721a905462c 100644 --- a/pkgs/by-name/ka/kando/package.nix +++ b/pkgs/by-name/ka/kando/package.nix @@ -38,16 +38,15 @@ buildNpmPackage rec { makeCacheWritable = true; - nativeBuildInputs = - [ - cmake - zip - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland-scanner - copyDesktopItems - ]; + nativeBuildInputs = [ + cmake + zip + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland-scanner + copyDesktopItems + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libxkbcommon diff --git a/pkgs/by-name/ka/kanidm/generic.nix b/pkgs/by-name/ka/kanidm/generic.nix index cd4e9e4af0e5..1b26c4d49450 100644 --- a/pkgs/by-name/ka/kanidm/generic.nix +++ b/pkgs/by-name/ka/kanidm/generic.nix @@ -60,27 +60,26 @@ rustPlatform.buildRustPackage rec { let format = (formats.toml { }).generate "${KANIDM_BUILD_PROFILE}.toml"; socket_path = if stdenv.hostPlatform.isLinux then "/run/kanidmd/sock" else "/var/run/kanidm.socket"; - profile = - { - cpu_flags = if stdenv.hostPlatform.isx86_64 then "x86_64_legacy" else "none"; - } - // lib.optionalAttrs (lib.versionAtLeast version "1.5") { - client_config_path = "/etc/kanidm/config"; - resolver_config_path = "/etc/kanidm/unixd"; - resolver_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash"; - server_admin_bind_path = socket_path; - server_config_path = "/etc/kanidm/server.toml"; - server_ui_pkg_path = "@htmx_ui_pkg_path@"; - } - // lib.optionalAttrs (lib.versionOlder version "1.5") { - admin_bind_path = socket_path; - default_config_path = "/etc/kanidm/server.toml"; - default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash"; - htmx_ui_pkg_path = "@htmx_ui_pkg_path@"; - } - // lib.optionalAttrs (lib.versions.majorMinor version == "1.3") { - web_ui_pkg_path = "@web_ui_pkg_path@"; - }; + profile = { + cpu_flags = if stdenv.hostPlatform.isx86_64 then "x86_64_legacy" else "none"; + } + // lib.optionalAttrs (lib.versionAtLeast version "1.5") { + client_config_path = "/etc/kanidm/config"; + resolver_config_path = "/etc/kanidm/unixd"; + resolver_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash"; + server_admin_bind_path = socket_path; + server_config_path = "/etc/kanidm/server.toml"; + server_ui_pkg_path = "@htmx_ui_pkg_path@"; + } + // lib.optionalAttrs (lib.versionOlder version "1.5") { + admin_bind_path = socket_path; + default_config_path = "/etc/kanidm/server.toml"; + default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash"; + htmx_ui_pkg_path = "@htmx_ui_pkg_path@"; + } + // lib.optionalAttrs (lib.versions.majorMinor version == "1.3") { + web_ui_pkg_path = "@web_ui_pkg_path@"; + }; in '' cp ${format profile} libs/profiles/${KANIDM_BUILD_PROFILE}.toml @@ -95,26 +94,24 @@ rustPlatform.buildRustPackage rec { installShellFiles ]; - buildInputs = - [ - openssl - sqlite - pam - rust-jemalloc-sys - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - udev - ]; + buildInputs = [ + openssl + sqlite + pam + rust-jemalloc-sys + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + udev + ]; # The UI needs to be in place before the tests are run. - postBuild = - '' - mkdir -p $out/ui - cp -r server/core/static $out/ui/hpkg - '' - + lib.optionalString (lib.versions.majorMinor version == "1.3") '' - cp -r server/web_ui/pkg $out/ui/pkg - ''; + postBuild = '' + mkdir -p $out/ui + cp -r server/core/static $out/ui/hpkg + '' + + lib.optionalString (lib.versions.majorMinor version == "1.3") '' + cp -r server/web_ui/pkg $out/ui/pkg + ''; # Upstream runs with the Rust equivalent of -Werror, # which breaks when we upgrade to new Rust before them. @@ -129,17 +126,16 @@ rustPlatform.buildRustPackage rec { ''profile.release.lto="off"'' ]; - preFixup = - '' - installShellCompletion \ - --bash $releaseDir/build/completions/*.bash \ - --zsh $releaseDir/build/completions/_* - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - # PAM and NSS need fix library names - mv $out/lib/libnss_kanidm.so $out/lib/libnss_kanidm.so.2 - mv $out/lib/libpam_kanidm.so $out/lib/pam_kanidm.so - ''; + preFixup = '' + installShellCompletion \ + --bash $releaseDir/build/completions/*.bash \ + --zsh $releaseDir/build/completions/_* + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + # PAM and NSS need fix library names + mv $out/lib/libnss_kanidm.so $out/lib/libnss_kanidm.so.2 + mv $out/lib/libpam_kanidm.so $out/lib/pam_kanidm.so + ''; passthru = { tests = { diff --git a/pkgs/by-name/ka/kapacitor/package.nix b/pkgs/by-name/ka/kapacitor/package.nix index dacbcf2b4432..1c294d5e3fcb 100644 --- a/pkgs/by-name/ka/kapacitor/package.nix +++ b/pkgs/by-name/ka/kapacitor/package.nix @@ -55,16 +55,15 @@ let Libs: -L/out/lib -lflux -lpthread ''; passAsFile = [ "pkgcfg" ]; - postInstall = - '' - mkdir -p $out/include $out/pkgconfig - cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include - substitute $pkgcfgPath $out/pkgconfig/flux.pc \ - --replace-fail /out $out - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib - ''; + postInstall = '' + mkdir -p $out/include $out/pkgconfig + cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include + substitute $pkgcfgPath $out/pkgconfig/flux.pc \ + --replace-fail /out $out + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib + ''; }; in buildGoModule rec { diff --git a/pkgs/by-name/ka/katago/package.nix b/pkgs/by-name/ka/katago/package.nix index f4b32cdeae8e..d580be37282d 100644 --- a/pkgs/by-name/ka/katago/package.nix +++ b/pkgs/by-name/ka/katago/package.nix @@ -61,71 +61,67 @@ stdenv'.mkDerivation rec { makeWrapper ]; - buildInputs = + buildInputs = [ + libzip + boost + ] + ++ lib.optionals (backend == "eigen") [ eigen ] + ++ lib.optionals (backend == "cuda") ( + with cudaPackages; [ - libzip - boost + cuda_cccl + cuda_cudart + cuda_nvcc + cudnn + libcublas ] - ++ lib.optionals (backend == "eigen") [ eigen ] - ++ lib.optionals (backend == "cuda") ( - with cudaPackages; - [ - cuda_cccl - cuda_cudart - cuda_nvcc - cudnn - libcublas - ] - ) - ++ lib.optionals (backend == "tensorrt") ( - with cudaPackages; - [ - cuda_cudart - tensorrt - ] - ) - ++ lib.optionals (backend == "opencl") [ - opencl-headers - ocl-icd - ] - ++ lib.optionals enableContrib [ openssl ] - ++ lib.optionals enableTcmalloc [ gperftools ]; - - cmakeFlags = + ) + ++ lib.optionals (backend == "tensorrt") ( + with cudaPackages; [ - (lib.cmakeFeature "USE_BACKEND" (lib.toUpper backend)) - (lib.cmakeBool "USE_AVX2" enableAVX2) - (lib.cmakeBool "USE_TCMALLOC" enableTcmalloc) - (lib.cmakeBool "USE_BIGGER_BOARDS_EXPENSIVE" enableBigBoards) - (lib.cmakeBool "USE_CACHE_TENSORRT_PLAN" enableTrtPlanCache) - (lib.cmakeBool "NO_GIT_REVISION" (!enableContrib)) + cuda_cudart + tensorrt ] - ++ lib.optionals enableContrib [ - (lib.cmakeBool "BUILD_DISTRIBUTED" true) - (lib.cmakeFeature "GIT_EXECUTABLE" "${fakegit}/bin/git") - ]; + ) + ++ lib.optionals (backend == "opencl") [ + opencl-headers + ocl-icd + ] + ++ lib.optionals enableContrib [ openssl ] + ++ lib.optionals enableTcmalloc [ gperftools ]; - preConfigure = - '' - cd cpp/ - '' - + lib.optionalString (backend == "cuda" || backend == "tensorrt") '' - export CUDA_PATH="${cudaPackages.cuda_nvcc}" - export EXTRA_LDFLAGS="-L/run/opengl-driver/lib" - ''; + cmakeFlags = [ + (lib.cmakeFeature "USE_BACKEND" (lib.toUpper backend)) + (lib.cmakeBool "USE_AVX2" enableAVX2) + (lib.cmakeBool "USE_TCMALLOC" enableTcmalloc) + (lib.cmakeBool "USE_BIGGER_BOARDS_EXPENSIVE" enableBigBoards) + (lib.cmakeBool "USE_CACHE_TENSORRT_PLAN" enableTrtPlanCache) + (lib.cmakeBool "NO_GIT_REVISION" (!enableContrib)) + ] + ++ lib.optionals enableContrib [ + (lib.cmakeBool "BUILD_DISTRIBUTED" true) + (lib.cmakeFeature "GIT_EXECUTABLE" "${fakegit}/bin/git") + ]; - installPhase = - '' - runHook preInstall - mkdir -p $out/bin; cp katago $out/bin; - '' - + lib.optionalString (backend == "cuda" || backend == "tensorrt") '' - wrapProgram $out/bin/katago \ - --prefix LD_LIBRARY_PATH : "/run/opengl-driver/lib" - '' - + '' - runHook postInstall - ''; + preConfigure = '' + cd cpp/ + '' + + lib.optionalString (backend == "cuda" || backend == "tensorrt") '' + export CUDA_PATH="${cudaPackages.cuda_nvcc}" + export EXTRA_LDFLAGS="-L/run/opengl-driver/lib" + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin; cp katago $out/bin; + '' + + lib.optionalString (backend == "cuda" || backend == "tensorrt") '' + wrapProgram $out/bin/katago \ + --prefix LD_LIBRARY_PATH : "/run/opengl-driver/lib" + '' + + '' + runHook postInstall + ''; meta = with lib; { description = "Go engine modeled after AlphaGo Zero"; diff --git a/pkgs/by-name/ka/katawa-shoujo/package.nix b/pkgs/by-name/ka/katawa-shoujo/package.nix index 23b8d7aa503e..664565b21141 100644 --- a/pkgs/by-name/ka/katawa-shoujo/package.nix +++ b/pkgs/by-name/ka/katawa-shoujo/package.nix @@ -70,24 +70,23 @@ stdenv.mkDerivation rec { undmg ]; - buildInputs = - [ - freetype - SDL_compat - zlib - ] - ++ lib.optionals devendorImageLibs [ - libjpeg - libpng12 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXext - libXi - libXmu - libGL - libGLU - ]; + buildInputs = [ + freetype + SDL_compat + zlib + ] + ++ lib.optionals devendorImageLibs [ + libjpeg + libpng12 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXext + libXi + libXmu + libGL + libGLU + ]; desktopItems = [ (makeDesktopItem rec { diff --git a/pkgs/by-name/kb/kbd/package.nix b/pkgs/by-name/kb/kbd/package.nix index c85e05fc552f..986d1c15cdce 100644 --- a/pkgs/by-name/kb/kbd/package.nix +++ b/pkgs/by-name/kb/kbd/package.nix @@ -33,16 +33,15 @@ stdenv.mkDerivation rec { "dev" ]; - configureFlags = - [ - "--enable-optional-progs" - "--enable-libkeymap" - "--disable-nls" - ] - ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ]; + configureFlags = [ + "--enable-optional-progs" + "--enable-libkeymap" + "--disable-nls" + ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; patches = [ ./search-paths.patch diff --git a/pkgs/by-name/kb/kbs2/package.nix b/pkgs/by-name/kb/kbs2/package.nix index b4f35b7fa93d..42f8d5e848b3 100644 --- a/pkgs/by-name/kb/kbs2/package.nix +++ b/pkgs/by-name/kb/kbs2/package.nix @@ -32,19 +32,19 @@ rustPlatform.buildRustPackage rec { checkFlags = [ "--skip=kbs2::config::tests::test_find_config_dir" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--skip=test_ragelib_rewrap_keyfile" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--skip=test_ragelib_rewrap_keyfile" ]; - postInstall = - '' - mkdir -p $out/share/kbs2 - cp -r contrib/ $out/share/kbs2 - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd kbs2 \ - --bash <($out/bin/kbs2 --completions bash) \ - --fish <($out/bin/kbs2 --completions fish) \ - --zsh <($out/bin/kbs2 --completions zsh) - ''; + postInstall = '' + mkdir -p $out/share/kbs2 + cp -r contrib/ $out/share/kbs2 + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd kbs2 \ + --bash <($out/bin/kbs2 --completions bash) \ + --fish <($out/bin/kbs2 --completions fish) \ + --zsh <($out/bin/kbs2 --completions zsh) + ''; meta = { description = "Secret manager backed by age"; diff --git a/pkgs/by-name/kc/kcollectd/package.nix b/pkgs/by-name/kc/kcollectd/package.nix index edcfc716e802..e8ad620b4df7 100644 --- a/pkgs/by-name/kc/kcollectd/package.nix +++ b/pkgs/by-name/kc/kcollectd/package.nix @@ -23,31 +23,29 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace kcollectd/rrd_interface.cc --replace-fail 'char *arg[] =' 'const char *arg[] =' ''; - nativeBuildInputs = - [ - shared-mime-info - cmake - ] - ++ (with kdePackages; [ - wrapQtAppsHook - extra-cmake-modules - ]); + nativeBuildInputs = [ + shared-mime-info + cmake + ] + ++ (with kdePackages; [ + wrapQtAppsHook + extra-cmake-modules + ]); - buildInputs = - [ - boost - rrdtool - ] - ++ (with kdePackages; [ - qtbase - kconfig - kio - kxmlgui - kiconthemes - ki18n - kguiaddons - breeze-icons - ]); + buildInputs = [ + boost + rrdtool + ] + ++ (with kdePackages; [ + qtbase + kconfig + kio + kxmlgui + kiconthemes + ki18n + kguiaddons + breeze-icons + ]); meta = with lib; { description = "Graphical frontend to collectd"; diff --git a/pkgs/by-name/ke/kea/package.nix b/pkgs/by-name/ke/kea/package.nix index b16752118d77..4b26df50523a 100644 --- a/pkgs/by-name/ke/kea/package.nix +++ b/pkgs/by-name/ke/kea/package.nix @@ -47,30 +47,28 @@ stdenv.mkDerivation rec { "man" ]; - configureFlags = - [ - "--enable-perfdhcp" - "--enable-shell" - "--localstatedir=/var" - "--with-openssl=${lib.getDev openssl}" - ] - ++ lib.optional withPostgres "--with-pgsql=${libpq.pg_config}/bin/pg_config" - ++ lib.optional withMysql "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config"; + configureFlags = [ + "--enable-perfdhcp" + "--enable-shell" + "--localstatedir=/var" + "--with-openssl=${lib.getDev openssl}" + ] + ++ lib.optional withPostgres "--with-pgsql=${libpq.pg_config}/bin/pg_config" + ++ lib.optional withMysql "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config"; postConfigure = '' # Mangle embedded paths to dev-only inputs. sed -e "s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" -i config.report ''; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - ] - ++ (with python3Packages; [ - sphinxHook - sphinx-rtd-theme - ]); + nativeBuildInputs = [ + autoreconfHook + pkg-config + ] + ++ (with python3Packages; [ + sphinxHook + sphinx-rtd-theme + ]); sphinxBuilders = [ "html" diff --git a/pkgs/by-name/ke/keepalived/package.nix b/pkgs/by-name/ke/keepalived/package.nix index e105977a99ad..fed5d5ae8395 100644 --- a/pkgs/by-name/ke/keepalived/package.nix +++ b/pkgs/by-name/ke/keepalived/package.nix @@ -25,17 +25,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-Xv/UGIeZhRHQO5lxkaWgHDUW+3qBi3wFU4+Us1A2uE0="; }; - buildInputs = - [ - file - libmnl - libnftnl - libnl - openssl - ] - ++ lib.optionals withNetSnmp [ - net-snmp - ]; + buildInputs = [ + file + libmnl + libnftnl + libnl + openssl + ] + ++ lib.optionals withNetSnmp [ + net-snmp + ]; enableParallelBuilding = true; @@ -46,13 +45,12 @@ stdenv.mkDerivation rec { autoreconfHook ]; - configureFlags = - [ - "--enable-sha1" - ] - ++ lib.optionals withNetSnmp [ - "--enable-snmp" - ]; + configureFlags = [ + "--enable-sha1" + ] + ++ lib.optionals withNetSnmp [ + "--enable-snmp" + ]; meta = with lib; { homepage = "https://keepalived.org"; diff --git a/pkgs/by-name/ke/keepassxc/package.nix b/pkgs/by-name/ke/keepassxc/package.nix index 2fff05417b8e..3215de670aa4 100644 --- a/pkgs/by-name/ke/keepassxc/package.nix +++ b/pkgs/by-name/ke/keepassxc/package.nix @@ -109,16 +109,16 @@ stdenv.mkDerivation (finalAttrs: { libsForQt5.wrapQtAppsHook libsForQt5.qttools pkg-config - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) wrapGAppsHook3; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) wrapGAppsHook3; dontWrapGApps = true; - preFixup = - '' - qtWrapperArgs+=("''${gappsWrapperArgs[@]}") - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - wrapQtApp "$out/Applications/KeePassXC.app/Contents/MacOS/KeePassXC" - ''; + preFixup = '' + qtWrapperArgs+=("''${gappsWrapperArgs[@]}") + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + wrapQtApp "$out/Applications/KeePassXC.app/Contents/MacOS/KeePassXC" + ''; postInstall = lib.concatLines [ (lib.optionalString stdenv.hostPlatform.isDarwin '' @@ -135,35 +135,34 @@ stdenv.mkDerivation (finalAttrs: { '') ]; - buildInputs = - [ - botan3 - curl - libXi - libXtst - libargon2 - libsForQt5.qtbase - libsForQt5.qtsvg - minizip - pcsclite - qrencode - readline - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libsForQt5.qtmacextras + buildInputs = [ + botan3 + curl + libXi + libXtst + libargon2 + libsForQt5.qtbase + libsForQt5.qtsvg + minizip + pcsclite + qrencode + readline + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libsForQt5.qtmacextras - apple-sdk_15 - # ScreenCaptureKit, required by livekit, is only available on 12.3 and up: - # https://developer.apple.com/documentation/screencapturekit - (darwinMinVersionHook "12.3") - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libusb1 - ] - ++ lib.optionals withKeePassX11 [ - libsForQt5.qtx11extras - ]; + apple-sdk_15 + # ScreenCaptureKit, required by livekit, is only available on 12.3 and up: + # https://developer.apple.com/documentation/screencapturekit + (darwinMinVersionHook "12.3") + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libusb1 + ] + ++ lib.optionals withKeePassX11 [ + libsForQt5.qtx11extras + ]; passthru = { tests = { diff --git a/pkgs/by-name/ke/kew/package.nix b/pkgs/by-name/ke/kew/package.nix index 3e31325173aa..5c344ae06c73 100644 --- a/pkgs/by-name/ke/kew/package.nix +++ b/pkgs/by-name/ke/kew/package.nix @@ -48,13 +48,12 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail '$(shell uname -m)' '${stdenv.hostPlatform.parsed.cpu.name}' ''; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ]; buildInputs = [ fftwFloat.dev diff --git a/pkgs/by-name/ke/kexec-tools/package.nix b/pkgs/by-name/ke/kexec-tools/package.nix index 3ad5fd9ca07f..40c35d974779 100644 --- a/pkgs/by-name/ke/kexec-tools/package.nix +++ b/pkgs/by-name/ke/kexec-tools/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { url = "https://raw.githubusercontent.com/void-linux/void-packages/6c1192cbf166698932030c2e3de71db1885a572d/srcpkgs/kexec-tools/patches/ppc64-elfv2.patch"; sha256 = "19wzfwb0azm932v0vhywv4221818qmlmvdfwpvvpfyw4hjsc2s1l"; }) - ] ++ lib.optional (stdenv.hostPlatform.useLLVM or false) ./fix-purgatory-llvm-libunwind.patch; + ] + ++ lib.optional (stdenv.hostPlatform.useLLVM or false) ./fix-purgatory-llvm-libunwind.patch; hardeningDisable = [ "format" diff --git a/pkgs/by-name/ke/keycloak/package.nix b/pkgs/by-name/ke/keycloak/package.nix index 14861246630a..1a227750d7fd 100644 --- a/pkgs/by-name/ke/keycloak/package.nix +++ b/pkgs/by-name/ke/keycloak/package.nix @@ -42,31 +42,30 @@ stdenv.mkDerivation (finalAttrs: { ./config_vars.patch ]; - buildPhase = - '' - runHook preBuild - '' - + lib.optionalString (confFile != null) '' - install -m 0600 ${confFile} conf/keycloak.conf - '' - + '' - install_plugin() { - if [ -d "$1" ]; then - find "$1" -type f \( -iname \*.ear -o -iname \*.jar \) -exec install -p -m 0500 "{}" "providers/" \; - else - install -p -m 0500 "$1" "providers/" - fi - } - ${lib.concatMapStringsSep "\n" (pl: "install_plugin ${lib.escapeShellArg pl}") plugins} - '' - + '' - patchShebangs bin/kc.sh - export KC_HOME_DIR=$(pwd) - export KC_CONF_DIR=$(pwd)/conf - bin/kc.sh build ${featuresSubcommand} + buildPhase = '' + runHook preBuild + '' + + lib.optionalString (confFile != null) '' + install -m 0600 ${confFile} conf/keycloak.conf + '' + + '' + install_plugin() { + if [ -d "$1" ]; then + find "$1" -type f \( -iname \*.ear -o -iname \*.jar \) -exec install -p -m 0500 "{}" "providers/" \; + else + install -p -m 0500 "$1" "providers/" + fi + } + ${lib.concatMapStringsSep "\n" (pl: "install_plugin ${lib.escapeShellArg pl}") plugins} + '' + + '' + patchShebangs bin/kc.sh + export KC_HOME_DIR=$(pwd) + export KC_CONF_DIR=$(pwd)/conf + bin/kc.sh build ${featuresSubcommand} - runHook postBuild - ''; + runHook postBuild + ''; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/ke/keydb/package.nix b/pkgs/by-name/ke/keydb/package.nix index 8bec09390283..c0fc9248be38 100644 --- a/pkgs/by-name/ke/keydb/package.nix +++ b/pkgs/by-name/ke/keydb/package.nix @@ -37,25 +37,23 @@ stdenv.mkDerivation (finalAttrs: { ''; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - jemalloc - curl - libuuid - ] - ++ lib.optionals tlsSupport [ openssl ] - ++ lib.optionals withSystemd [ systemd ]; + buildInputs = [ + jemalloc + curl + libuuid + ] + ++ lib.optionals tlsSupport [ openssl ] + ++ lib.optionals withSystemd [ systemd ]; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - "AR=${stdenv.cc.targetPrefix}ar" - "RANLIB=${stdenv.cc.targetPrefix}ranlib" - "USEASM=${if stdenv.hostPlatform.isx86_64 then "true" else "false"}" - ] - ++ lib.optionals (!tlsSupport) [ "BUILD_TLS=no" ] - ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] - ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "MALLOC=libc" ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "AR=${stdenv.cc.targetPrefix}ar" + "RANLIB=${stdenv.cc.targetPrefix}ranlib" + "USEASM=${if stdenv.hostPlatform.isx86_64 then "true" else "false"}" + ] + ++ lib.optionals (!tlsSupport) [ "BUILD_TLS=no" ] + ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "MALLOC=libc" ]; enableParallelBuilding = true; @@ -63,14 +61,13 @@ stdenv.mkDerivation (finalAttrs: { # darwin currently lacks a pure `pgrep` which is extensively used here doCheck = !stdenv.hostPlatform.isDarwin; - nativeCheckInputs = - [ - which - tcl - ps - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ] - ++ lib.optionals tlsSupport [ tclPackages.tcltls ]; + nativeCheckInputs = [ + which + tcl + ps + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ] + ++ lib.optionals tlsSupport [ tclPackages.tcltls ]; checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/ke/keylight-controller-mschneider82/package.nix b/pkgs/by-name/ke/keylight-controller-mschneider82/package.nix index daf7309de2b3..82a82703e4ad 100644 --- a/pkgs/by-name/ke/keylight-controller-mschneider82/package.nix +++ b/pkgs/by-name/ke/keylight-controller-mschneider82/package.nix @@ -25,22 +25,21 @@ buildGoModule rec { pkg-config ]; - buildInputs = - [ - libGL - nssmdns - ] - ++ (with xorg; [ - libX11 - libX11.dev - libXcursor - libXext - libXi - libXinerama - libXrandr - libXxf86vm - xinput - ]); + buildInputs = [ + libGL + nssmdns + ] + ++ (with xorg; [ + libX11 + libX11.dev + libXcursor + libXext + libXi + libXinerama + libXrandr + libXxf86vm + xinput + ]); meta = with lib; { description = "Desktop application to control Elgato Keylights"; diff --git a/pkgs/by-name/ke/keystone/package.nix b/pkgs/by-name/ke/keystone/package.nix index efa845b4e7b7..d06237c85f64 100644 --- a/pkgs/by-name/ke/keystone/package.nix +++ b/pkgs/by-name/ke/keystone/package.nix @@ -24,16 +24,15 @@ stdenv.mkDerivation rec { "-DCMAKE_INSTALL_LIBDIR=lib" ]; - nativeBuildInputs = - [ - pkg-config - cmake - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # TODO: could be replaced by setting CMAKE_INSTALL_NAME_DIR? - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + pkg-config + cmake + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # TODO: could be replaced by setting CMAKE_INSTALL_NAME_DIR? + fixDarwinDylibNames + ]; meta = with lib; { description = "Lightweight multi-platform, multi-architecture assembler framework"; diff --git a/pkgs/by-name/ki/ki/package.nix b/pkgs/by-name/ki/ki/package.nix index cbe61fc23dd3..5d6e0842f94a 100644 --- a/pkgs/by-name/ki/ki/package.nix +++ b/pkgs/by-name/ki/ki/package.nix @@ -29,18 +29,19 @@ python3Packages.buildPythonApplication { nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = - [ anki ] - ++ (with python3Packages; [ - beartype - click - colorama - git-filter-repo - gitpython - lark - tqdm - whatthepatch - ]); + propagatedBuildInputs = [ + anki + ] + ++ (with python3Packages; [ + beartype + click + colorama + git-filter-repo + gitpython + lark + tqdm + whatthepatch + ]); nativeCheckInputs = with python3Packages; [ bitstring diff --git a/pkgs/by-name/ki/kid3/package.nix b/pkgs/by-name/ki/kid3/package.nix index f19d9f75b03d..984f7139cac4 100644 --- a/pkgs/by-name/ki/kid3/package.nix +++ b/pkgs/by-name/ki/kid3/package.nix @@ -59,34 +59,33 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = + buildInputs = [ + chromaprint + ffmpeg + flac + id3lib + libogg + libvorbis + libxslt + mp4v2 + qtbase + qtdeclarative + qtmultimedia + readline + taglib + zlib + ] + ++ lib.optionals withKDE ( + with kdePackages; [ - chromaprint - ffmpeg - flac - id3lib - libogg - libvorbis - libxslt - mp4v2 - qtbase - qtdeclarative - qtmultimedia - readline - taglib - zlib + kconfig + kconfigwidgets + kcoreaddons + kio + kxmlgui + phonon ] - ++ lib.optionals withKDE ( - with kdePackages; - [ - kconfig - kconfigwidgets - kcoreaddons - kio - kxmlgui - phonon - ] - ); + ); cmakeFlags = [ (lib.cmakeFeature "WITH_APPS" apps) diff --git a/pkgs/by-name/ki/kismet/package.nix b/pkgs/by-name/ki/kismet/package.nix index cc38baff02f9..deba8d723e87 100644 --- a/pkgs/by-name/ki/kismet/package.nix +++ b/pkgs/by-name/ki/kismet/package.nix @@ -57,61 +57,58 @@ stdenv.mkDerivation (finalPackage: { strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - protobuf - protobufc - ] - ++ lib.optionals withPython [ - (python3.withPackages (ps: [ - ps.numpy - ps.protobuf - ps.pyserial - ps.setuptools - ps.websockets - ])) - ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + protobuf + protobufc + ] + ++ lib.optionals withPython [ + (python3.withPackages (ps: [ + ps.numpy + ps.protobuf + ps.pyserial + ps.setuptools + ps.websockets + ])) + ]; - buildInputs = - [ - binutils - elfutils - libcap - libmicrohttpd - libnl - libpcap - openssl - libusb1 - libwebsockets - pcre2 - protobuf - protobufc - sqlite - zlib - ] - ++ lib.optionals withNetworkManager [ - networkmanager - glib - ] - ++ lib.optionals withSensors [ - lm_sensors - ]; + buildInputs = [ + binutils + elfutils + libcap + libmicrohttpd + libnl + libpcap + openssl + libusb1 + libwebsockets + pcre2 + protobuf + protobufc + sqlite + zlib + ] + ++ lib.optionals withNetworkManager [ + networkmanager + glib + ] + ++ lib.optionals withSensors [ + lm_sensors + ]; - configureFlags = - [ - "--disable-wifi-coconut" # Until https://github.com/kismetwireless/kismet/issues/478 - ] - ++ lib.optionals (!withNetworkManager) [ - "--disable-libnm" - ] - ++ lib.optionals (!withPython) [ - "--disable-python-tools" - ] - ++ lib.optionals (!withSensors) [ - "--disable-lmsensors" - ]; + configureFlags = [ + "--disable-wifi-coconut" # Until https://github.com/kismetwireless/kismet/issues/478 + ] + ++ lib.optionals (!withNetworkManager) [ + "--disable-libnm" + ] + ++ lib.optionals (!withPython) [ + "--disable-python-tools" + ] + ++ lib.optionals (!withSensors) [ + "--disable-lmsensors" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ki/kitsas/package.nix b/pkgs/by-name/ki/kitsas/package.nix index 448f01e1cd55..f39b61eb7638 100644 --- a/pkgs/by-name/ki/kitsas/package.nix +++ b/pkgs/by-name/ki/kitsas/package.nix @@ -25,17 +25,16 @@ stdenv.mkDerivation rec { qt6.wrapQtAppsHook ]; - buildInputs = - [ - libzip - poppler - qt6.qt5compat - qt6.qtsvg - qt6.qtwebengine - ] - ++ lib.optional stdenv.hostPlatform.isLinux [ - qt6.qtwayland - ]; + buildInputs = [ + libzip + poppler + qt6.qt5compat + qt6.qtsvg + qt6.qtwebengine + ] + ++ lib.optional stdenv.hostPlatform.isLinux [ + qt6.qtwayland + ]; # We use a separate build-dir as otherwise ld seems to get confused between # directory and executable name on buildPhase. diff --git a/pkgs/by-name/ki/kitty/package.nix b/pkgs/by-name/ki/kitty/package.nix index 41baa10af466..bdde5f7fc485 100644 --- a/pkgs/by-name/ki/kitty/package.nix +++ b/pkgs/by-name/ki/kitty/package.nix @@ -67,62 +67,60 @@ buildPythonApplication rec { vendorHash = "sha256-q5LMyogAqgUFfln7LVkhuXzYSMuYmOif5sj15KkOjB4="; }).goModules; - buildInputs = - [ - harfbuzz - ncurses - simde - lcms2 - librsync - matplotlib - openssl.dev - xxHash - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libpng - python3 - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - fontconfig - libunistring - libcanberra - libX11 - libXrandr - libXinerama - libXcursor - libxkbcommon - libXi - libXext - wayland-protocols - wayland - dbus - libGL - cairo - ]; + buildInputs = [ + harfbuzz + ncurses + simde + lcms2 + librsync + matplotlib + openssl.dev + xxHash + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libpng + python3 + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + fontconfig + libunistring + libcanberra + libX11 + libXrandr + libXinerama + libXcursor + libxkbcommon + libXi + libXext + wayland-protocols + wayland + dbus + libGL + cairo + ]; - nativeBuildInputs = - [ - installShellFiles - ncurses - pkg-config - sphinx - furo - sphinx-copybutton - sphinxext-opengraph - sphinx-inline-tabs - go_1_24 - fontconfig - makeBinaryWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - imagemagick - libicns # For the png2icns tool. - autoSignDarwinBinariesHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland-scanner - ]; + nativeBuildInputs = [ + installShellFiles + ncurses + pkg-config + sphinx + furo + sphinx-copybutton + sphinxext-opengraph + sphinx-inline-tabs + go_1_24 + fontconfig + makeBinaryWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + imagemagick + libicns # For the png2icns tool. + autoSignDarwinBinariesHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland-scanner + ]; depsBuildBuild = [ pkg-config ]; @@ -200,19 +198,18 @@ buildPythonApplication rec { runHook postBuild ''; - nativeCheckInputs = - [ - pillow + nativeCheckInputs = [ + pillow - # Shells needed for shell integration tests - bashInteractive - zsh - fish - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # integration tests need sudo - sudo - ]; + # Shells needed for shell integration tests + bashInteractive + zsh + fish + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # integration tests need sudo + sudo + ]; # skip failing tests due to darwin sandbox preCheck = lib.optionalString stdenv.hostPlatform.isDarwin '' diff --git a/pkgs/by-name/kl/klipper-estimator/package.nix b/pkgs/by-name/kl/klipper-estimator/package.nix index 33282e64f9ac..b2da873428d0 100644 --- a/pkgs/by-name/kl/klipper-estimator/package.nix +++ b/pkgs/by-name/kl/klipper-estimator/package.nix @@ -24,11 +24,12 @@ rustPlatform.buildRustPackage rec { env.TOOL_VERSION = "v${version}"; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libgit2 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libgit2 + ]; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/by-name/km/kmscube/package.nix b/pkgs/by-name/km/kmscube/package.nix index a6c42798a00e..d2192b58895e 100644 --- a/pkgs/by-name/km/kmscube/package.nix +++ b/pkgs/by-name/km/kmscube/package.nix @@ -29,17 +29,16 @@ stdenv.mkDerivation { pkg-config ninja ]; - buildInputs = - [ - libdrm - libX11 - libGL - libgbm - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - ]); + buildInputs = [ + libdrm + libX11 + libGL + libgbm + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + ]); meta = with lib; { description = "Example OpenGL app using KMS/GBM"; diff --git a/pkgs/by-name/km/kmsxx/package.nix b/pkgs/by-name/km/kmsxx/package.nix index 5c5b28321ed3..94e936ab484b 100644 --- a/pkgs/by-name/km/kmsxx/package.nix +++ b/pkgs/by-name/km/kmsxx/package.nix @@ -30,20 +30,20 @@ stdenv.mkDerivation { meson ninja pkg-config - ] ++ lib.optionals withPython [ cmake ]; - buildInputs = + ] + ++ lib.optionals withPython [ cmake ]; + buildInputs = [ + libdrm + fmt + libevdev + ] + ++ lib.optionals withPython ( + with python3Packages; [ - libdrm - fmt - libevdev + python + pybind11 ] - ++ lib.optionals withPython ( - with python3Packages; - [ - python - pybind11 - ] - ); + ); dontUseCmakeConfigure = true; diff --git a/pkgs/by-name/kn/knot-dns/package.nix b/pkgs/by-name/kn/knot-dns/package.nix index 16da2ead4b7f..b1402ea7fe56 100644 --- a/pkgs/by-name/kn/knot-dns/package.nix +++ b/pkgs/by-name/kn/knot-dns/package.nix @@ -67,32 +67,31 @@ stdenv.mkDerivation rec { autoreconfHook sphinx ]; - buildInputs = - [ - gnutls - liburcu - libidn2 - libunistring - nettle - libedit - libiconv - lmdb - libintl - nghttp2 # DoH support in kdig - ngtcp2-gnutls # DoQ support in kdig (and elsewhere but not much use there yet) - libmaxminddb # optional for geoip module (it's tiny) - # without sphinx &al. for developer documentation - fstrm - protobufc # dnstap support - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap_ng - systemd - xdp-tools - libbpf - libmnl # XDP support (it's Linux kernel API) - ] - ++ lib.optional stdenv.hostPlatform.isDarwin zlib; # perhaps due to gnutls + buildInputs = [ + gnutls + liburcu + libidn2 + libunistring + nettle + libedit + libiconv + lmdb + libintl + nghttp2 # DoH support in kdig + ngtcp2-gnutls # DoQ support in kdig (and elsewhere but not much use there yet) + libmaxminddb # optional for geoip module (it's tiny) + # without sphinx &al. for developer documentation + fstrm + protobufc # dnstap support + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap_ng + systemd + xdp-tools + libbpf + libmnl # XDP support (it's Linux kernel API) + ] + ++ lib.optional stdenv.hostPlatform.isDarwin zlib; # perhaps due to gnutls enableParallelBuilding = true; @@ -111,25 +110,24 @@ stdenv.mkDerivation rec { rm -r "$out"/lib/*.la ''; - passthru.tests = - { - inherit knot-resolver; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit (nixosTests) knot kea; - prometheus-exporter = nixosTests.prometheus-exporters.knot; - # Some dependencies are very version-sensitive, so the might get dropped - # or embedded after some update, even if the nixPackagers didn't intend to. - # For non-linux I don't know a good replacement for `ldd`. - deps = runCommandLocal "knot-deps-test" { nativeBuildInputs = [ (lib.getBin stdenv.cc.libc) ]; } '' - for libname in libngtcp2 libxdp libbpf; do - echo "Checking for $libname:" - ldd '${knot-dns.bin}/bin/knotd' | grep -F "$libname" - echo "OK" - done - touch "$out" - ''; - }; + passthru.tests = { + inherit knot-resolver; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit (nixosTests) knot kea; + prometheus-exporter = nixosTests.prometheus-exporters.knot; + # Some dependencies are very version-sensitive, so the might get dropped + # or embedded after some update, even if the nixPackagers didn't intend to. + # For non-linux I don't know a good replacement for `ldd`. + deps = runCommandLocal "knot-deps-test" { nativeBuildInputs = [ (lib.getBin stdenv.cc.libc) ]; } '' + for libname in libngtcp2 libxdp libbpf; do + echo "Checking for $libname:" + ldd '${knot-dns.bin}/bin/knotd' | grep -F "$libname" + echo "OK" + done + touch "$out" + ''; + }; meta = { description = "Authoritative-only DNS server from .cz domain registry"; diff --git a/pkgs/by-name/kn/knxd/package.nix b/pkgs/by-name/kn/knxd/package.nix index adeeec2d1145..74d6944221ae 100644 --- a/pkgs/by-name/kn/knxd/package.nix +++ b/pkgs/by-name/kn/knxd/package.nix @@ -39,14 +39,13 @@ stdenv.mkDerivation (finalAttrs: { perl ]; - buildInputs = - [ - fmt_9 - libev - ] - ++ lib.optional withSystemd systemd - ++ lib.optional withUsb libusb1 - ++ lib.optional stdenv.hostPlatform.isDarwin argp-standalone; + buildInputs = [ + fmt_9 + libev + ] + ++ lib.optional withSystemd systemd + ++ lib.optional withUsb libusb1 + ++ lib.optional stdenv.hostPlatform.isDarwin argp-standalone; configureFlags = [ (lib.enableFeature withSystemd "systemd") diff --git a/pkgs/by-name/ko/koboldcpp/package.nix b/pkgs/by-name/ko/koboldcpp/package.nix index d5fc0c3e8122..8c9d3adf969f 100644 --- a/pkgs/by-name/ko/koboldcpp/package.nix +++ b/pkgs/by-name/ko/koboldcpp/package.nix @@ -59,24 +59,25 @@ effectiveStdenv.mkDerivation (finalAttrs: { pythonInputs = builtins.attrValues { inherit (python3Packages) tkinter customtkinter packaging; }; - buildInputs = - [ tk ] - ++ finalAttrs.pythonInputs - ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_12 ] - ++ lib.optionals cublasSupport [ - cudaPackages.libcublas - cudaPackages.cuda_nvcc - cudaPackages.cuda_cudart - cudaPackages.cuda_cccl - ] - ++ lib.optionals clblastSupport [ - clblast - ocl-icd - ] - ++ lib.optionals vulkanSupport [ - vulkan-loader - shaderc - ]; + buildInputs = [ + tk + ] + ++ finalAttrs.pythonInputs + ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_12 ] + ++ lib.optionals cublasSupport [ + cudaPackages.libcublas + cudaPackages.cuda_nvcc + cudaPackages.cuda_cudart + cudaPackages.cuda_cccl + ] + ++ lib.optionals clblastSupport [ + clblast + ocl-icd + ] + ++ lib.optionals vulkanSupport [ + vulkan-loader + shaderc + ]; pythonPath = finalAttrs.pythonInputs; diff --git a/pkgs/by-name/ko/kohighlights/package.nix b/pkgs/by-name/ko/kohighlights/package.nix index b1b64f33e504..82ed66b1e60f 100644 --- a/pkgs/by-name/ko/kohighlights/package.nix +++ b/pkgs/by-name/ko/kohighlights/package.nix @@ -27,13 +27,12 @@ python3Packages.buildPythonApplication rec { dontWrapPythonPrograms = true; dontBuild = true; - buildInputs = - [ - qt5.qtbase - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - qt5.qtwayland - ]; + buildInputs = [ + qt5.qtbase + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + qt5.qtwayland + ]; nativeBuildInputs = [ qt5.wrapQtAppsHook diff --git a/pkgs/by-name/ko/koji/package.nix b/pkgs/by-name/ko/koji/package.nix index 42f605d553c1..64a927d3ad86 100644 --- a/pkgs/by-name/ko/koji/package.nix +++ b/pkgs/by-name/ko/koji/package.nix @@ -37,7 +37,8 @@ rustPlatform.buildRustPackage (finalAttrs: { buildInputs = [ openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ]; nativeCheckInputs = [ gitMinimal diff --git a/pkgs/by-name/ko/komac/package.nix b/pkgs/by-name/ko/komac/package.nix index b05665cd6395..2bd891531d65 100644 --- a/pkgs/by-name/ko/komac/package.nix +++ b/pkgs/by-name/ko/komac/package.nix @@ -28,13 +28,12 @@ rustPlatform.buildRustPackage (finalAttrs: { useFetchCargoVendor = true; cargoHash = "sha256-FMxt98wbes1PWqeOE95epK4uwOEgLU3zvCu1cyDPxGA="; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - installShellFiles - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + installShellFiles + ]; buildInputs = [ dbus diff --git a/pkgs/by-name/ko/koodo-reader/package.nix b/pkgs/by-name/ko/koodo-reader/package.nix index 7f78429568ae..58e24532da6c 100644 --- a/pkgs/by-name/ko/koodo-reader/package.nix +++ b/pkgs/by-name/ko/koodo-reader/package.nix @@ -29,17 +29,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-58mxYt2wD6SGzhvo9c44CPmdX+/tLnbJCMPafo4txbY="; }; - nativeBuildInputs = - [ - makeWrapper - yarnConfigHook - yarnBuildHook - nodejs - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - copyDesktopItems - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + makeWrapper + yarnConfigHook + yarnBuildHook + nodejs + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + copyDesktopItems + wrapGAppsHook3 + ]; dontWrapGApps = true; diff --git a/pkgs/by-name/kr/kraft/package.nix b/pkgs/by-name/kr/kraft/package.nix index d8f2466afa0e..da51742bc073 100644 --- a/pkgs/by-name/kr/kraft/package.nix +++ b/pkgs/by-name/kr/kraft/package.nix @@ -24,13 +24,12 @@ buildGoModule rec { pkg-config ]; - buildInputs = - [ - gpgme - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - btrfs-progs - ]; + buildInputs = [ + gpgme + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + btrfs-progs + ]; vendorHash = "sha256-lwgxedKLcuV6RucbU26sDO+9j+8uWkignJDomFHaSXU="; diff --git a/pkgs/by-name/kr/krunker/package.nix b/pkgs/by-name/kr/krunker/package.nix index 76430102a0e6..f0f7eb300533 100644 --- a/pkgs/by-name/kr/krunker/package.nix +++ b/pkgs/by-name/kr/krunker/package.nix @@ -13,7 +13,8 @@ package.overrideAttrs ( finalAttrs: oldAttrs: { passthru = { updateScript = ./update.sh; - } // oldAttrs.passthru or { }; + } + // oldAttrs.passthru or { }; # Point `nix edit`, etc. to the file that defines the attribute, not this # entry point @@ -27,6 +28,7 @@ package.overrideAttrs ( mainProgram = "krunker"; platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; - } // oldAttrs.meta or { }; + } + // oldAttrs.meta or { }; } ) diff --git a/pkgs/by-name/ks/ksmbd-tools/package.nix b/pkgs/by-name/ks/ksmbd-tools/package.nix index 0a13560f08bd..9c885eb6e2ca 100644 --- a/pkgs/by-name/ks/ksmbd-tools/package.nix +++ b/pkgs/by-name/ks/ksmbd-tools/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { buildInputs = [ glib libnl - ] ++ lib.optional withKerberos libkrb5; + ] + ++ lib.optional withKerberos libkrb5; nativeBuildInputs = [ meson diff --git a/pkgs/by-name/ks/ksnip/package.nix b/pkgs/by-name/ks/ksnip/package.nix index 0359919131db..bcc93b06418a 100644 --- a/pkgs/by-name/ks/ksnip/package.nix +++ b/pkgs/by-name/ks/ksnip/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - cmake - ] - ++ (with libsForQt5; [ - extra-cmake-modules - wrapQtAppsHook - qttools - ]); + nativeBuildInputs = [ + cmake + ] + ++ (with libsForQt5; [ + extra-cmake-modules + wrapQtAppsHook + qttools + ]); buildInputs = with libsForQt5; [ kcolorpicker diff --git a/pkgs/by-name/ks/kstart/package.nix b/pkgs/by-name/ks/kstart/package.nix index c82b80804ed5..d520d45a31a0 100644 --- a/pkgs/by-name/ks/kstart/package.nix +++ b/pkgs/by-name/ks/kstart/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--enable-silent-rules" - ] ++ (lib.optional enableSetPAG "--enable-setpag"); + ] + ++ (lib.optional enableSetPAG "--enable-setpag"); preBuild = '' for f in k5start krenew; do diff --git a/pkgs/by-name/kv/kvmtool/package.nix b/pkgs/by-name/kv/kvmtool/package.nix index 5a7fdd6e9ddd..e9b32618a57d 100644 --- a/pkgs/by-name/kv/kvmtool/package.nix +++ b/pkgs/by-name/kv/kvmtool/package.nix @@ -21,15 +21,14 @@ stdenv.mkDerivation { enableParallelBuilding = true; - makeFlags = - [ - "prefix=${placeholder "out"}" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - "ARCH=${stdenv.hostPlatform.linuxArch}" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 ([ - "LIBFDT_DIR=${dtc}/lib" - ]); + makeFlags = [ + "prefix=${placeholder "out"}" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + "ARCH=${stdenv.hostPlatform.linuxArch}" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 ([ + "LIBFDT_DIR=${dtc}/lib" + ]); meta = with lib; { description = "Lightweight tool for hosting KVM guests"; diff --git a/pkgs/by-name/ky/kyua/package.nix b/pkgs/by-name/ky/kyua/package.nix index c3d4b7fc49b1..5bf2a62927ae 100644 --- a/pkgs/by-name/ky/kyua/package.nix +++ b/pkgs/by-name/ky/kyua/package.nix @@ -29,49 +29,48 @@ stdenv.mkDerivation (finalAttrs: { setupHooks = ./kyua-check-hook.sh; - postPatch = - '' - # Fix a linking error on Darwin. Embedding an archive in an archive isn’t portable. - substituteInPlace cli/Makefile.am.inc \ - --replace-fail 'libcli_a_LIBADD = libutils.a' "" \ - --replace-fail 'CLI_LIBS = ' 'CLI_LIBS = libutils.a ' - '' - # These tests fail on Darwin or are unreliable. - + lib.optionalString (finalAttrs.doInstallCheck && stdenv.hostPlatform.isDarwin) '' - sed -i utils/process/Makefile.am.inc -e '/executor_pid_test/d' - substituteInPlace utils/process/Kyuafile \ - --replace-fail 'atf_test_program{name="executor_pid_test"}' "" - substituteInPlace engine/atf_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, test__body_only__crashes);' "" - substituteInPlace engine/scheduler_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, integration__stacktrace);' "" - substituteInPlace utils/stacktrace_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, unlimit_core_size);' "" - substituteInPlace utils/process/isolation_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, isolate_child__enable_core_dumps);' "" - substituteInPlace utils/process/operations_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, terminate_self_with__termsig_and_core);' "" - substituteInPlace utils/process/status_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, integration__coredump);' "" - substituteInPlace integration/cmd_test_test.sh \ - --replace-fail 'atf_add_test_case premature_exit' "" - '' - # fchflags and UF_NOUNLINK are not supported on Linux. Other tests also fail. - + lib.optionalString (finalAttrs.doInstallCheck && stdenv.hostPlatform.isLinux) '' - sed -i utils/process/Makefile.am.inc -e '/executor_pid_test/d' - substituteInPlace utils/process/Kyuafile \ - --replace-fail 'atf_test_program{name="executor_pid_test"}' "" - substituteInPlace engine/atf_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, test__body_only__crashes);' "" - substituteInPlace utils/stacktrace_test.cpp \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, dump_stacktrace__ok);' "" \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, dump_stacktrace_if_available__append);' "" \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, find_core__found__long);' "" \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, find_core__found__short);' "" \ - --replace-fail 'ATF_ADD_TEST_CASE(tcs, unlimit_core_size__hard_is_zero);' "" - substituteInPlace integration/cmd_test_test.sh \ - --replace-fail 'atf_add_test_case premature_exit' "" - ''; + postPatch = '' + # Fix a linking error on Darwin. Embedding an archive in an archive isn’t portable. + substituteInPlace cli/Makefile.am.inc \ + --replace-fail 'libcli_a_LIBADD = libutils.a' "" \ + --replace-fail 'CLI_LIBS = ' 'CLI_LIBS = libutils.a ' + '' + # These tests fail on Darwin or are unreliable. + + lib.optionalString (finalAttrs.doInstallCheck && stdenv.hostPlatform.isDarwin) '' + sed -i utils/process/Makefile.am.inc -e '/executor_pid_test/d' + substituteInPlace utils/process/Kyuafile \ + --replace-fail 'atf_test_program{name="executor_pid_test"}' "" + substituteInPlace engine/atf_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, test__body_only__crashes);' "" + substituteInPlace engine/scheduler_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, integration__stacktrace);' "" + substituteInPlace utils/stacktrace_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, unlimit_core_size);' "" + substituteInPlace utils/process/isolation_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, isolate_child__enable_core_dumps);' "" + substituteInPlace utils/process/operations_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, terminate_self_with__termsig_and_core);' "" + substituteInPlace utils/process/status_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, integration__coredump);' "" + substituteInPlace integration/cmd_test_test.sh \ + --replace-fail 'atf_add_test_case premature_exit' "" + '' + # fchflags and UF_NOUNLINK are not supported on Linux. Other tests also fail. + + lib.optionalString (finalAttrs.doInstallCheck && stdenv.hostPlatform.isLinux) '' + sed -i utils/process/Makefile.am.inc -e '/executor_pid_test/d' + substituteInPlace utils/process/Kyuafile \ + --replace-fail 'atf_test_program{name="executor_pid_test"}' "" + substituteInPlace engine/atf_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, test__body_only__crashes);' "" + substituteInPlace utils/stacktrace_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, dump_stacktrace__ok);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, dump_stacktrace_if_available__append);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, find_core__found__long);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, find_core__found__short);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, unlimit_core_size__hard_is_zero);' "" + substituteInPlace integration/cmd_test_test.sh \ + --replace-fail 'atf_add_test_case premature_exit' "" + ''; strictDeps = true; diff --git a/pkgs/by-name/la/ladybird/package.nix b/pkgs/by-name/la/ladybird/package.nix index c5b4543e8eb5..3999aea83e12 100644 --- a/pkgs/by-name/la/ladybird/package.nix +++ b/pkgs/by-name/la/ladybird/package.nix @@ -92,49 +92,47 @@ stdenv.mkDerivation (finalAttrs: { libtommath ]; - buildInputs = - [ - curl - ffmpeg - fontconfig - libavif - libGL - libjxl - libwebp - libxcrypt - openssl - qt6Packages.qtbase - qt6Packages.qtmultimedia - simdutf - (skia.overrideAttrs (prev: { - gnFlags = prev.gnFlags ++ [ - # https://github.com/LadybirdBrowser/ladybird/commit/af3d46dc06829dad65309306be5ea6fbc6a587ec - # https://github.com/LadybirdBrowser/ladybird/commit/4d7b7178f9d50fff97101ea18277ebc9b60e2c7c - # Remove when/if this gets upstreamed in skia. - "extra_cflags+=[\"-DSKCMS_API=__attribute__((visibility(\\\"default\\\")))\"]" - ]; - })) - woff2 - ] - ++ lib.optional stdenv.hostPlatform.isLinux [ - libpulseaudio.dev - qt6Packages.qtwayland - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_14 - ]; + buildInputs = [ + curl + ffmpeg + fontconfig + libavif + libGL + libjxl + libwebp + libxcrypt + openssl + qt6Packages.qtbase + qt6Packages.qtmultimedia + simdutf + (skia.overrideAttrs (prev: { + gnFlags = prev.gnFlags ++ [ + # https://github.com/LadybirdBrowser/ladybird/commit/af3d46dc06829dad65309306be5ea6fbc6a587ec + # https://github.com/LadybirdBrowser/ladybird/commit/4d7b7178f9d50fff97101ea18277ebc9b60e2c7c + # Remove when/if this gets upstreamed in skia. + "extra_cflags+=[\"-DSKCMS_API=__attribute__((visibility(\\\"default\\\")))\"]" + ]; + })) + woff2 + ] + ++ lib.optional stdenv.hostPlatform.isLinux [ + libpulseaudio.dev + qt6Packages.qtwayland + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_14 + ]; - cmakeFlags = - [ - # Takes an enormous amount of resources, even with mold - (lib.cmakeBool "ENABLE_LTO_FOR_RELEASE" false) - # Disable network operations - "-DSERENITY_CACHE_DIR=Caches" - "-DENABLE_NETWORK_DOWNLOADS=OFF" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DCMAKE_INSTALL_LIBEXECDIR=libexec" - ]; + cmakeFlags = [ + # Takes an enormous amount of resources, even with mold + (lib.cmakeBool "ENABLE_LTO_FOR_RELEASE" false) + # Disable network operations + "-DSERENITY_CACHE_DIR=Caches" + "-DENABLE_NETWORK_DOWNLOADS=OFF" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DCMAKE_INSTALL_LIBEXECDIR=libexec" + ]; # FIXME: Add an option to -DENABLE_QT=ON on macOS to use Qt rather than Cocoa for the GUI @@ -143,18 +141,17 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/LadybirdBrowser/ladybird/issues/371#issuecomment-2616415434 env.NIX_LDFLAGS = "-lGL -lfontconfig"; - postInstall = - '' - for size in 48x48 128x128; do - mkdir -p $out/share/icons/hicolor/$size/apps - ln -s $out/share/Lagom/icons/$size/app-browser.png \ - $out/share/icons/hicolor/$size/apps/ladybird.png - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications $out/bin - mv $out/bundle/Ladybird.app $out/Applications - ''; + postInstall = '' + for size in 48x48 128x128; do + mkdir -p $out/share/icons/hicolor/$size/apps + ln -s $out/share/Lagom/icons/$size/app-browser.png \ + $out/share/icons/hicolor/$size/apps/ladybird.png + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications $out/bin + mv $out/bundle/Ladybird.app $out/Applications + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/la/lagrange/package.nix b/pkgs/by-name/la/lagrange/package.nix index 68fdce4c3cc7..476f746b0105 100644 --- a/pkgs/by-name/la/lagrange/package.nix +++ b/pkgs/by-name/la/lagrange/package.nix @@ -37,22 +37,21 @@ stdenv.mkDerivation (finalAttrs: { zip ]; - buildInputs = - [ - the-foundation - fribidi - harfbuzz - libogg - libwebp - libX11 - mpg123 - opusfile - SDL2 - ] - ++ lib.optionals enableTUI [ - ncurses - sealcurses - ]; + buildInputs = [ + the-foundation + fribidi + harfbuzz + libogg + libwebp + libX11 + mpg123 + opusfile + SDL2 + ] + ++ lib.optionals enableTUI [ + ncurses + sealcurses + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_TUI" enableTUI) diff --git a/pkgs/by-name/la/lammps/package.nix b/pkgs/by-name/la/lammps/package.nix index bd0ee29a3d71..0e3a84be719f 100644 --- a/pkgs/by-name/la/lammps/package.nix +++ b/pkgs/by-name/la/lammps/package.nix @@ -74,23 +74,21 @@ stdenv.mkDerivation (finalAttrs: { inherit extraCmakeFlags; inherit extraBuildInputs; }; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_SHARED_LIBS" true) - ] - ++ (lib.mapAttrsToList (n: v: lib.cmakeBool "PKG_${n}" v) packages) - ++ (lib.mapAttrsToList (n: v: "-D${n}=${v}") extraCmakeFlags); + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + ] + ++ (lib.mapAttrsToList (n: v: lib.cmakeBool "PKG_${n}" v) packages) + ++ (lib.mapAttrsToList (n: v: "-D${n}=${v}") extraCmakeFlags); - buildInputs = - [ - fftw - libpng - blas - lapack - gzip - ] - ++ lib.optionals packages.PYTHON [ python3 ] - ++ extraBuildInputs; + buildInputs = [ + fftw + libpng + blas + lapack + gzip + ] + ++ lib.optionals packages.PYTHON [ python3 ] + ++ extraBuildInputs; postInstall = '' # For backwards compatibility diff --git a/pkgs/by-name/la/lapack-reference/package.nix b/pkgs/by-name/la/lapack-reference/package.nix index 5b5ecaa1d330..f690529cbeed 100644 --- a/pkgs/by-name/la/lapack-reference/package.nix +++ b/pkgs/by-name/la/lapack-reference/package.nix @@ -31,21 +31,20 @@ stdenv.mkDerivation (finalAttrs: { "stackprotector" ]; - cmakeFlags = - [ - "-DCMAKE_Fortran_FLAGS=-fPIC" - "-DLAPACKE=ON" - "-DCBLAS=ON" - "-DBUILD_TESTING=ON" - ] - ++ lib.optional shared "-DBUILD_SHARED_LIBS=ON" - ++ lib.optional blas64 "-DBUILD_INDEX64=ON" - # Tries to run host platform binaries during the build - # Will likely be disabled by default in 3.12, see: - # https://github.com/Reference-LAPACK/lapack/issues/757 - ++ lib.optional ( - !stdenv.buildPlatform.canExecute stdenv.hostPlatform - ) "-DTEST_FORTRAN_COMPILER=OFF"; + cmakeFlags = [ + "-DCMAKE_Fortran_FLAGS=-fPIC" + "-DLAPACKE=ON" + "-DCBLAS=ON" + "-DBUILD_TESTING=ON" + ] + ++ lib.optional shared "-DBUILD_SHARED_LIBS=ON" + ++ lib.optional blas64 "-DBUILD_INDEX64=ON" + # Tries to run host platform binaries during the build + # Will likely be disabled by default in 3.12, see: + # https://github.com/Reference-LAPACK/lapack/issues/757 + ++ lib.optional ( + !stdenv.buildPlatform.canExecute stdenv.hostPlatform + ) "-DTEST_FORTRAN_COMPILER=OFF"; passthru = { inherit blas64; }; diff --git a/pkgs/by-name/la/laszip/package.nix b/pkgs/by-name/la/laszip/package.nix index 270d715db99e..0f82562f2ffd 100644 --- a/pkgs/by-name/la/laszip/package.nix +++ b/pkgs/by-name/la/laszip/package.nix @@ -17,13 +17,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-9fzal54YaocONtguOCxnP7h1LejQPQ0dKFiCzfvTjCY="; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; meta = { description = "Turn quickly bulky LAS files into compact LAZ files without information loss"; diff --git a/pkgs/by-name/la/laze/package.nix b/pkgs/by-name/la/laze/package.nix index ef2fde52be98..16175da48a30 100644 --- a/pkgs/by-name/la/laze/package.nix +++ b/pkgs/by-name/la/laze/package.nix @@ -33,17 +33,16 @@ rustPlatform.buildRustPackage (finalAttrs: { writableTmpDirAsHomeHook ]; - postInstall = - '' - wrapProgram "$out/bin/laze" \ - --suffix PATH : ${lib.makeBinPath [ ninja ]} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd laze \ - --bash <($out/bin/laze completion --generate bash) \ - --fish <($out/bin/laze completion --generate fish) \ - --zsh <($out/bin/laze completion --generate zsh) - ''; + postInstall = '' + wrapProgram "$out/bin/laze" \ + --suffix PATH : ${lib.makeBinPath [ ninja ]} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd laze \ + --bash <($out/bin/laze completion --generate bash) \ + --fish <($out/bin/laze completion --generate fish) \ + --zsh <($out/bin/laze completion --generate zsh) + ''; nativeInstallCheckInputs = [ versionCheckHook diff --git a/pkgs/by-name/lb/lbdb/package.nix b/pkgs/by-name/lb/lbdb/package.nix index 557d248cdbe5..746cda2bc5e1 100644 --- a/pkgs/by-name/lb/lbdb/package.nix +++ b/pkgs/by-name/lb/lbdb/package.nix @@ -35,14 +35,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-uqaiO2E5TXkreyIeGWHZulcQYUyTJOj1mzXBJsK0504="; }; - buildInputs = - [ perl' ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) bsd-finger - ++ lib.optional withAbook abook - ++ lib.optional withGnupg gnupg - ++ lib.optional withGoobook goobook - ++ lib.optional withKhard khard - ++ lib.optional withMu mu; + buildInputs = [ + perl' + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) bsd-finger + ++ lib.optional withAbook abook + ++ lib.optional withGnupg gnupg + ++ lib.optional withGoobook goobook + ++ lib.optional withKhard khard + ++ lib.optional withMu mu; configureFlags = [ ] diff --git a/pkgs/by-name/lc/lc0/package.nix b/pkgs/by-name/lc/lc0/package.nix index a133323f18a3..8cd071e95adb 100644 --- a/pkgs/by-name/lc/lc0/package.nix +++ b/pkgs/by-name/lc/lc0/package.nix @@ -46,15 +46,14 @@ stdenv.mkDerivation rec { zlib ]; - mesonFlags = - [ - "-Dplain_cuda=false" - "-Daccelerate=false" - "-Dmetal=disabled" - "-Dembed=false" - ] - # in version 31 this option will be required - ++ lib.optionals (lib.versionAtLeast version "0.31") [ "-Dnative_cuda=false" ]; + mesonFlags = [ + "-Dplain_cuda=false" + "-Daccelerate=false" + "-Dmetal=disabled" + "-Dembed=false" + ] + # in version 31 this option will be required + ++ lib.optionals (lib.versionAtLeast version "0.31") [ "-Dnative_cuda=false" ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/lc/lcevcdec/package.nix b/pkgs/by-name/lc/lcevcdec/package.nix index 2799d2fc8919..6ca495b21718 100644 --- a/pkgs/by-name/lc/lcevcdec/package.nix +++ b/pkgs/by-name/lc/lcevcdec/package.nix @@ -36,23 +36,22 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = - '' - substituteInPlace cmake/tools/version_files.py \ - --replace-fail "args.git_version" '"${finalAttrs.version}"' \ - --replace-fail "args.git_hash" '"${finalAttrs.src.rev}"' \ - --replace-fail "args.git_date" '"1970-01-01"' - substituteInPlace cmake/templates/lcevc_dec.pc.in \ - --replace-fail "@GIT_SHORT_VERSION@" "${finalAttrs.version}" + postPatch = '' + substituteInPlace cmake/tools/version_files.py \ + --replace-fail "args.git_version" '"${finalAttrs.version}"' \ + --replace-fail "args.git_hash" '"${finalAttrs.src.rev}"' \ + --replace-fail "args.git_date" '"1970-01-01"' + substituteInPlace cmake/templates/lcevc_dec.pc.in \ + --replace-fail "@GIT_SHORT_VERSION@" "${finalAttrs.version}" - '' - + lib.optionalString (!stdenv.hostPlatform.avxSupport) '' - substituteInPlace cmake/modules/Compiler/GNU.cmake \ - --replace-fail "-mavx" "" + '' + + lib.optionalString (!stdenv.hostPlatform.avxSupport) '' + substituteInPlace cmake/modules/Compiler/GNU.cmake \ + --replace-fail "-mavx" "" - substituteInPlace src/core/decoder/src/common/simd.c \ - --replace-fail "((_xgetbv(kControlRegister) & kOSXSaveMask) == kOSXSaveMask)" "false" - ''; + substituteInPlace src/core/decoder/src/common/simd.c \ + --replace-fail "((_xgetbv(kControlRegister) & kOSXSaveMask) == kOSXSaveMask)" "false" + ''; env = { includedir = "${placeholder "dev"}/include"; diff --git a/pkgs/by-name/lc/lcov/package.nix b/pkgs/by-name/lc/lcov/package.nix index 93f55c4b7027..27f58d6cc919 100644 --- a/pkgs/by-name/lc/lcov/package.nix +++ b/pkgs/by-name/lc/lcov/package.nix @@ -18,7 +18,8 @@ let perlPackages.GD perlPackages.JSONXS perlPackages.PathTools - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ perlPackages.MemoryProcess ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ perlPackages.MemoryProcess ]; in stdenv.mkDerivation (finalAttrs: { pname = "lcov"; diff --git a/pkgs/by-name/ld/ldb/package.nix b/pkgs/by-name/ld/ldb/package.nix index a83148a6b8e0..1ff91e9c5ca2 100644 --- a/pkgs/by-name/ld/ldb/package.nix +++ b/pkgs/by-name/ld/ldb/package.nix @@ -64,16 +64,15 @@ stdenv.mkDerivation (finalAttrs: { wafPath = "buildtools/bin/waf"; - wafConfigureFlags = - [ - "--bundled-libraries=NONE" - "--builtin-libraries=replace" - "--without-ldb-lmdb" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--cross-compile" - "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" - ]; + wafConfigureFlags = [ + "--bundled-libraries=NONE" + "--builtin-libraries=replace" + "--without-ldb-lmdb" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--cross-compile" + "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" + ]; # python-config from build Python gives incorrect values when cross-compiling. # If python-config is not found, the build falls back to using the sysconfig diff --git a/pkgs/by-name/ld/ldc/package.nix b/pkgs/by-name/ld/ldc/package.nix index 9563124d44fc..90e362a9952f 100644 --- a/pkgs/by-name/ld/ldc/package.nix +++ b/pkgs/by-name/ld/ldc/package.nix @@ -45,42 +45,40 @@ stdenv.mkDerivation (finalAttrs: { # https://issues.dlang.org/show_bug.cgi?id=19553 hardeningDisable = [ "fortify" ]; - postPatch = - '' - patchShebangs runtime tools tests + postPatch = '' + patchShebangs runtime tools tests - rm tests/dmd/fail_compilation/mixin_gc.d - rm tests/dmd/runnable/xtest46_gc.d - rm tests/dmd/runnable/testptrref_gc.d + rm tests/dmd/fail_compilation/mixin_gc.d + rm tests/dmd/runnable/xtest46_gc.d + rm tests/dmd/runnable/testptrref_gc.d - # test depends on current year - rm tests/dmd/compilable/ddocYear.d - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace runtime/phobos/std/socket.d --replace-fail "assert(ih.addrList[0] == 0x7F_00_00_01);" "" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace runtime/phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)" + # test depends on current year + rm tests/dmd/compilable/ddocYear.d + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace runtime/phobos/std/socket.d --replace-fail "assert(ih.addrList[0] == 0x7F_00_00_01);" "" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace runtime/phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)" - # https://github.com/NixOS/nixpkgs/issues/34817 - rm -r tests/plugins/addFuncEntryCall - ''; + # https://github.com/NixOS/nixpkgs/issues/34817 + rm -r tests/plugins/addFuncEntryCall + ''; - nativeBuildInputs = - [ - cmake - ldcBootstrap - lit - lit.python - llvm_18.dev - makeWrapper - ninja - unzip - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818 - gdb - ]; + nativeBuildInputs = [ + cmake + ldcBootstrap + lit + lit.python + llvm_18.dev + makeWrapper + ninja + unzip + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818 + gdb + ]; buildInputs = [ curl diff --git a/pkgs/by-name/ld/ldmud/package.nix b/pkgs/by-name/ld/ldmud/package.nix index f97923fa4e59..18c778ff1340 100644 --- a/pkgs/by-name/ld/ldmud/package.nix +++ b/pkgs/by-name/ld/ldmud/package.nix @@ -49,21 +49,20 @@ stdenv.mkDerivation (finalAttrs: { bison ]; - buildInputs = - [ - libgcrypt - libxcrypt-legacy - pcre - json_c - libxml2 - ] - ++ lib.optional mccpSupport zlib - ++ lib.optional mysqlSupport libmysqlclient - ++ lib.optional postgresSupport libpq - ++ lib.optional sqliteSupport sqlite - ++ lib.optional tlsSupport openssl - ++ lib.optional pythonSupport python310 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + buildInputs = [ + libgcrypt + libxcrypt-legacy + pcre + json_c + libxml2 + ] + ++ lib.optional mccpSupport zlib + ++ lib.optional mysqlSupport libmysqlclient + ++ lib.optional postgresSupport libpq + ++ lib.optional sqliteSupport sqlite + ++ lib.optional tlsSupport openssl + ++ lib.optional pythonSupport python310 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; # To support systems without autoconf LD puts its configure.ac in a non-default # location and uses a helper script. We skip that script and symlink the .ac diff --git a/pkgs/by-name/ld/ldns/package.nix b/pkgs/by-name/ld/ldns/package.nix index 3020d2d33d9c..4d2671f6fbb8 100644 --- a/pkgs/by-name/ld/ldns/package.nix +++ b/pkgs/by-name/ld/ldns/package.nix @@ -36,18 +36,17 @@ stdenv.mkDerivation rec { buildInputs = [ openssl ]; - configureFlags = - [ - "--with-ssl=${openssl.dev}" - "--with-trust-anchor=${dns-root-data}/root.key" - "--with-drill" - "--disable-gost" - "--with-examples" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ]; + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--with-trust-anchor=${dns-root-data}/root.key" + "--with-drill" + "--disable-gost" + "--with-examples" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; nativeCheckInputs = [ which ]; doCheck = false; # fails. missing some files diff --git a/pkgs/by-name/le/ledger/package.nix b/pkgs/by-name/le/ledger/package.nix index 219de9e88678..83968f43d1bd 100644 --- a/pkgs/by-name/le/ledger/package.nix +++ b/pkgs/by-name/le/ledger/package.nix @@ -54,30 +54,30 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optionals usePython [ "py" ]; + ] + ++ lib.optionals usePython [ "py" ]; - buildInputs = - [ - gmp - mpfr - libedit - gnused - ] - ++ lib.optionals gpgmeSupport [ - gpgme - ] - ++ ( - if usePython then - [ - python3 - (boost.override { - enablePython = true; - python = python3; - }) - ] - else - [ boost ] - ); + buildInputs = [ + gmp + mpfr + libedit + gnused + ] + ++ lib.optionals gpgmeSupport [ + gpgme + ] + ++ ( + if usePython then + [ + python3 + (boost.override { + enablePython = true; + python = python3; + }) + ] + else + [ boost ] + ); nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/le/ledger2beancount/package.nix b/pkgs/by-name/le/ledger2beancount/package.nix index ee6c17494df0..51cd01a9ff19 100644 --- a/pkgs/by-name/le/ledger2beancount/package.nix +++ b/pkgs/by-name/le/ledger2beancount/package.nix @@ -38,7 +38,8 @@ stdenv.mkDerivation rec { buildInputs = [ perlPackages.perl beancount - ] ++ perlDeps; + ] + ++ perlDeps; makeFlags = [ "prefix=$(out)" ]; installFlags = [ "INSTALL=install" ]; diff --git a/pkgs/by-name/le/legends-of-equestria/package.nix b/pkgs/by-name/le/legends-of-equestria/package.nix index 37a85b52b6a7..12107ca9a2f6 100644 --- a/pkgs/by-name/le/legends-of-equestria/package.nix +++ b/pkgs/by-name/le/legends-of-equestria/package.nix @@ -51,37 +51,36 @@ let }; }; - runtimeDeps = - [ - dbus.lib - xorg_sys_opengl - systemd - libcap.lib - libdrm - pulseaudio - libsndfile - flac - libvorbis - mpg123 - lame.lib - libGL - vulkan-loader - libasyncns - ] - ++ (with xorg; [ - libX11 - libxcb - libXau - libXdmcp - libXext - libXcursor - libXrender - libXfixes - libXinerama - libXi - libXrandr - libXScrnSaver - ]); + runtimeDeps = [ + dbus.lib + xorg_sys_opengl + systemd + libcap.lib + libdrm + pulseaudio + libsndfile + flac + libvorbis + mpg123 + lame.lib + libGL + vulkan-loader + libasyncns + ] + ++ (with xorg; [ + libX11 + libxcb + libXau + libXdmcp + libXext + libXcursor + libXrender + libXfixes + libXinerama + libXi + libXrandr + libXScrnSaver + ]); in stdenv.mkDerivation { inherit pname version; @@ -110,25 +109,23 @@ stdenv.mkDerivation { ''; dontBuild = true; - buildInputs = - [ - libgcc - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - cairo - dbus - glib - pango - wayland - ]; - nativeBuildInputs = - [ - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - copyDesktopItems - autoPatchelfHook - ]; + buildInputs = [ + libgcc + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + cairo + dbus + glib + pango + wayland + ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + copyDesktopItems + autoPatchelfHook + ]; installPhase = if stdenv.hostPlatform.isLinux then diff --git a/pkgs/by-name/le/lenmus/package.nix b/pkgs/by-name/le/lenmus/package.nix index 5b01f4f6aef6..c01af1a84756 100644 --- a/pkgs/by-name/le/lenmus/package.nix +++ b/pkgs/by-name/le/lenmus/package.nix @@ -41,14 +41,13 @@ stdenv.mkDerivation (finalAttrs: { sed -i 's/fixup_bundle.*")/")/g' CMakeLists.txt ''; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeWrapper - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeWrapper + ]; buildInputs = [ boost diff --git a/pkgs/by-name/le/lerc/package.nix b/pkgs/by-name/le/lerc/package.nix index 1443ce855449..e164c6e00761 100644 --- a/pkgs/by-name/le/lerc/package.nix +++ b/pkgs/by-name/le/lerc/package.nix @@ -30,22 +30,21 @@ stdenv.mkDerivation (finalAttrs: { ${buildPackages.dos2unix}/bin/dos2unix src/LercLib/fpl_EsriHuffman.cpp src/LercLib/fpl_Lerc2Ext.cpp ''; - patches = - [ - # https://github.com/Esri/lerc/pull/227 - (fetchpatch { - name = "use-cmake-install-full-dir.patch"; - url = "https://github.com/Esri/lerc/commit/5462ca7f7dfb38c65e16f5abfd96873af177a0f8.patch"; - hash = "sha256-qaNR3QwLe0AB6vu1nXOh9KhlPdWM3DmgCJj4d0VdOUk="; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - (fetchpatch { - url = "https://raw.githubusercontent.com/freebsd/freebsd-ports/ee9e39ceb1af729ac33854b5f3de652cb5ce0eca/graphics/lerc/files/patch-_assert"; - hash = "sha256-agvGqgIsKS8v43UZdTVxDRDGbZdj2+AzKoQONvQumB4="; - extraPrefix = ""; - }) - ]; + patches = [ + # https://github.com/Esri/lerc/pull/227 + (fetchpatch { + name = "use-cmake-install-full-dir.patch"; + url = "https://github.com/Esri/lerc/commit/5462ca7f7dfb38c65e16f5abfd96873af177a0f8.patch"; + hash = "sha256-qaNR3QwLe0AB6vu1nXOh9KhlPdWM3DmgCJj4d0VdOUk="; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + (fetchpatch { + url = "https://raw.githubusercontent.com/freebsd/freebsd-ports/ee9e39ceb1af729ac33854b5f3de652cb5ce0eca/graphics/lerc/files/patch-_assert"; + hash = "sha256-agvGqgIsKS8v43UZdTVxDRDGbZdj2+AzKoQONvQumB4="; + extraPrefix = ""; + }) + ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/lg/lgogdownloader/package.nix b/pkgs/by-name/lg/lgogdownloader/package.nix index 4136ae04bcd7..da559b62daaa 100644 --- a/pkgs/by-name/lg/lgogdownloader/package.nix +++ b/pkgs/by-name/lg/lgogdownloader/package.nix @@ -35,22 +35,22 @@ stdenv.mkDerivation (finalAttrs: { pkg-config help2man html-tidy - ] ++ lib.optional enableGui libsForQt5.wrapQtAppsHook; + ] + ++ lib.optional enableGui libsForQt5.wrapQtAppsHook; - buildInputs = - [ - boost - curl - htmlcxx - jsoncpp - liboauth - rhash - tinyxml-2 - ] - ++ lib.optionals enableGui [ - libsForQt5.qtbase - libsForQt5.qtwebengine - ]; + buildInputs = [ + boost + curl + htmlcxx + jsoncpp + liboauth + rhash + tinyxml-2 + ] + ++ lib.optionals enableGui [ + libsForQt5.qtbase + libsForQt5.qtwebengine + ]; cmakeFlags = lib.optional enableGui "-DUSE_QT_GUI=ON"; diff --git a/pkgs/by-name/lh/lhapdf/package.nix b/pkgs/by-name/lh/lhapdf/package.nix index 962d437e2fc1..f9f607d0991b 100644 --- a/pkgs/by-name/lh/lhapdf/package.nix +++ b/pkgs/by-name/lh/lhapdf/package.nix @@ -22,14 +22,13 @@ stdenv.mkDerivation rec { substituteInPlace src/GridPDF.cc --replace '#include ' '#include ' ''; - nativeBuildInputs = - [ - bash - makeWrapper - ] - ++ lib.optionals (python3 != null && lib.versionAtLeast python3.version "3.10") [ - python3.pkgs.cython - ]; + nativeBuildInputs = [ + bash + makeWrapper + ] + ++ lib.optionals (python3 != null && lib.versionAtLeast python3.version "3.10") [ + python3.pkgs.cython + ]; buildInputs = [ python3 ]; configureFlags = lib.optionals (python3 == null) [ "--disable-python" ]; diff --git a/pkgs/by-name/li/lib2geom/package.nix b/pkgs/by-name/li/lib2geom/package.nix index 1168e7bc2384..437c79c94500 100644 --- a/pkgs/by-name/li/lib2geom/package.nix +++ b/pkgs/by-name/li/lib2geom/package.nix @@ -93,14 +93,13 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru = { - tests = - { - inherit inkscape; - } - # Make sure x86_64-linux -> aarch64-linux cross compilation works - // lib.optionalAttrs (stdenv.buildPlatform.system == "x86_64-linux") { - aarch64-cross = pkgsCross.aarch64-multiplatform.lib2geom; - }; + tests = { + inherit inkscape; + } + # Make sure x86_64-linux -> aarch64-linux cross compilation works + // lib.optionalAttrs (stdenv.buildPlatform.system == "x86_64-linux") { + aarch64-cross = pkgsCross.aarch64-multiplatform.lib2geom; + }; }; meta = with lib; { diff --git a/pkgs/by-name/li/lib3mf/package.nix b/pkgs/by-name/li/lib3mf/package.nix index c7b987841844..cc23872e70b6 100644 --- a/pkgs/by-name/li/lib3mf/package.nix +++ b/pkgs/by-name/li/lib3mf/package.nix @@ -66,7 +66,8 @@ stdenv.mkDerivation (finalAttrs: { gtest openssl zlib - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid; postPatch = '' # fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ diff --git a/pkgs/by-name/li/libaccounts-glib/package.nix b/pkgs/by-name/li/libaccounts-glib/package.nix index aa4fd5f15009..150d394e7075 100644 --- a/pkgs/by-name/li/libaccounts-glib/package.nix +++ b/pkgs/by-name/li/libaccounts-glib/package.nix @@ -39,22 +39,21 @@ stdenv.mkDerivation rec { hash = "sha256-mLhcwp8rhCGSB1K6rTWT0tuiINzgwULwXINfCbgPKEg="; }; - nativeBuildInputs = - [ - check - docbook_xml_dtd_43 - docbook_xsl - glibcLocales - gobject-introspection - gtk-doc - meson - ninja - pkg-config - vala - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + check + docbook_xml_dtd_43 + docbook_xsl + glibcLocales + gobject-introspection + gtk-doc + meson + ninja + pkg-config + vala + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/li/libadwaita/package.nix b/pkgs/by-name/li/libadwaita/package.nix index 427eac7604c9..db1fed30f662 100644 --- a/pkgs/by-name/li/libadwaita/package.nix +++ b/pkgs/by-name/li/libadwaita/package.nix @@ -55,13 +55,12 @@ stdenv.mkDerivation (finalAttrs: { desktop-file-utils # for validate-desktop-file ]; - mesonFlags = - [ - "-Ddocumentation=true" - ] - ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [ - "-Dtests=false" - ]; + mesonFlags = [ + "-Ddocumentation=true" + ] + ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [ + "-Dtests=false" + ]; buildInputs = [ appstream @@ -72,13 +71,12 @@ stdenv.mkDerivation (finalAttrs: { gtk4 ]; - nativeCheckInputs = - [ - adwaita-icon-theme - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - xvfb-run - ]; + nativeCheckInputs = [ + adwaita-icon-theme + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + xvfb-run + ]; # Tests had to be disabled on Darwin because test-button-content fails # diff --git a/pkgs/by-name/li/libaio/package.nix b/pkgs/by-name/li/libaio/package.nix index ca30fc15d6bc..13f12dad696e 100644 --- a/pkgs/by-name/li/libaio/package.nix +++ b/pkgs/by-name/li/libaio/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { makeFlags = [ "prefix=${placeholder "out"}" - ] ++ lib.optional stdenv.hostPlatform.isStatic "ENABLE_SHARED=0"; + ] + ++ lib.optional stdenv.hostPlatform.isStatic "ENABLE_SHARED=0"; hardeningDisable = lib.optional (stdenv.hostPlatform.isi686) "stackprotector"; diff --git a/pkgs/by-name/li/libamplsolver/package.nix b/pkgs/by-name/li/libamplsolver/package.nix index e83085570eba..3ad35f748471 100644 --- a/pkgs/by-name/li/libamplsolver/package.nix +++ b/pkgs/by-name/li/libamplsolver/package.nix @@ -25,21 +25,20 @@ stdenv.mkDerivation { }) ]; - installPhase = - '' - runHook preInstall - pushd sys.$(uname -m).$(uname -s) - install -D -m 0644 *.h -t $out/include - install -D -m 0644 *${stdenv.hostPlatform.extensions.sharedLibrary}* -t $out/lib - install -D -m 0644 *.a -t $out/lib - popd - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -id $out/lib/libamplsolver.dylib $out/lib/libamplsolver.dylib - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + pushd sys.$(uname -m).$(uname -s) + install -D -m 0644 *.h -t $out/include + install -D -m 0644 *${stdenv.hostPlatform.extensions.sharedLibrary}* -t $out/lib + install -D -m 0644 *.a -t $out/lib + popd + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -id $out/lib/libamplsolver.dylib $out/lib/libamplsolver.dylib + '' + + '' + runHook postInstall + ''; meta = with lib; { description = "Library of routines that help solvers work with AMPL"; diff --git a/pkgs/by-name/li/libaom/package.nix b/pkgs/by-name/li/libaom/package.nix index 66e24e3c91ff..07524dcdbece 100644 --- a/pkgs/by-name/li/libaom/package.nix +++ b/pkgs/by-name/li/libaom/package.nix @@ -31,19 +31,18 @@ stdenv.mkDerivation rec { stripRoot = false; }; - patches = - [ - ./outputs.patch - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # This patch defines `_POSIX_C_SOURCE`, which breaks system headers - # on Darwin. - (fetchurl { - name = "musl.patch"; - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libaom/files/libaom-3.4.0-posix-c-source-ftello.patch?id=50c7c4021e347ee549164595280cf8a23c960959"; - hash = "sha256-6+u7GTxZcSNJgN7D+s+XAVwbMnULufkTcQ0s7l+Ydl0="; - }) - ]; + patches = [ + ./outputs.patch + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # This patch defines `_POSIX_C_SOURCE`, which breaks system headers + # on Darwin. + (fetchurl { + name = "musl.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libaom/files/libaom-3.4.0-posix-c-source-ftello.patch?id=50c7c4021e347ee549164595280cf8a23c960959"; + hash = "sha256-6+u7GTxZcSNJgN7D+s+XAVwbMnULufkTcQ0s7l+Ydl0="; + }) + ]; nativeBuildInputs = [ yasm @@ -74,30 +73,28 @@ stdenv.mkDerivation rec { # Configuration options: # https://aomedia.googlesource.com/aom/+/refs/heads/master/build/cmake/aom_config_defaults.cmake - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=ON" - "-DENABLE_TESTS=OFF" - ] - ++ lib.optionals enableVmaf [ - "-DCONFIG_TUNE_VMAF=1" - ] - ++ lib.optionals (isCross && !stdenv.hostPlatform.isx86) [ - "-DCMAKE_ASM_COMPILER=${lib.getBin stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - # armv7l-hf-multiplatform does not support NEON - # see lib/systems/platform.nix - "-DENABLE_NEON=0" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DENABLE_TESTS=OFF" + ] + ++ lib.optionals enableVmaf [ + "-DCONFIG_TUNE_VMAF=1" + ] + ++ lib.optionals (isCross && !stdenv.hostPlatform.isx86) [ + "-DCMAKE_ASM_COMPILER=${lib.getBin stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + # armv7l-hf-multiplatform does not support NEON + # see lib/systems/platform.nix + "-DENABLE_NEON=0" + ]; - postFixup = - '' - moveToOutput lib/libaom.a "$static" - '' - + lib.optionalString stdenv.hostPlatform.isStatic '' - ln -s $static $out - ''; + postFixup = '' + moveToOutput lib/libaom.a "$static" + '' + + lib.optionalString stdenv.hostPlatform.isStatic '' + ln -s $static $out + ''; outputs = [ "out" diff --git a/pkgs/by-name/li/libapparmor/package.nix b/pkgs/by-name/li/libapparmor/package.nix index caba93785756..31e499717224 100644 --- a/pkgs/by-name/li/libapparmor/package.nix +++ b/pkgs/by-name/li/libapparmor/package.nix @@ -49,29 +49,31 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - autoconf-archive - autoreconfHook - bison - flex - pkg-config - swig - ncurses - which - dejagnu - perl # podchecker - ] - ++ lib.optionals withPython [ - python3Packages.setuptools - ]; + nativeBuildInputs = [ + autoconf-archive + autoreconfHook + bison + flex + pkg-config + swig + ncurses + which + dejagnu + perl # podchecker + ] + ++ lib.optionals withPython [ + python3Packages.setuptools + ]; nativeCheckInputs = [ python3Packages.pythonImportsCheckHook ]; - buildInputs = - [ libxcrypt ] ++ (lib.optional withPerl perl) ++ (lib.optional withPython python3Packages.python); + buildInputs = [ + libxcrypt + ] + ++ (lib.optional withPerl perl) + ++ (lib.optional withPython python3Packages.python); # required to build apparmor-parser dontDisableStatic = true; diff --git a/pkgs/by-name/li/libappindicator/package.nix b/pkgs/by-name/li/libappindicator/package.nix index 8de5d08ed941..ac61fc224788 100644 --- a/pkgs/by-name/li/libappindicator/package.nix +++ b/pkgs/by-name/li/libappindicator/package.nix @@ -67,24 +67,23 @@ stdenv.mkDerivation (finalAttrs: { } .${gtkVersion} or throwBadGtkVersion; - buildInputs = - [ - glib - dbus-glib - { - "2" = libindicator-gtk2; - "3" = libindicator-gtk3; - } - .${gtkVersion} or throwBadGtkVersion - ] - ++ lib.optionals monoSupport [ - mono - { - "2" = gtk-sharp-2_0; - "3" = gtk-sharp-3_0; - } - .${gtkVersion} or throwBadGtkVersion - ]; + buildInputs = [ + glib + dbus-glib + { + "2" = libindicator-gtk2; + "3" = libindicator-gtk3; + } + .${gtkVersion} or throwBadGtkVersion + ] + ++ lib.optionals monoSupport [ + mono + { + "2" = gtk-sharp-2_0; + "3" = gtk-sharp-3_0; + } + .${gtkVersion} or throwBadGtkVersion + ]; preAutoreconf = '' gtkdocize diff --git a/pkgs/by-name/li/libarchive/package.nix b/pkgs/by-name/li/libarchive/package.nix index 8a2a308a6958..640914afd9a0 100644 --- a/pkgs/by-name/li/libarchive/package.nix +++ b/pkgs/by-name/li/libarchive/package.nix @@ -58,24 +58,23 @@ stdenv.mkDerivation (finalAttrs: { 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 - "libarchive/test/test_read_disk_directory_traversals.c" - "cpio/test/test_option_a.c" - "cpio/test/test_option_t.c" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ - # only on some aarch64-linux systems? - "cpio/test/test_basic.c" - "cpio/test/test_format_newc.c" - ]; + 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 + "libarchive/test/test_read_disk_directory_traversals.c" + "cpio/test/test_option_a.c" + "cpio/test/test_option_t.c" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ + # only on some aarch64-linux systems? + "cpio/test/test_basic.c" + "cpio/test/test_format_newc.c" + ]; removeTest = testPath: '' substituteInPlace Makefile.am --replace-fail "${testPath}" "" rm "${testPath}" @@ -93,20 +92,19 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - bzip2 - lzo - openssl - xz - zlib - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - acl - attr - ] - ++ lib.optional xarSupport libxml2; + buildInputs = [ + bzip2 + lzo + openssl + xz + zlib + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + acl + attr + ] + ++ lib.optional xarSupport libxml2; # Without this, pkg-config-based dependencies are unhappy propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ diff --git a/pkgs/by-name/li/libargon2/package.nix b/pkgs/by-name/li/libargon2/package.nix index 0dbedc23577c..09117757372e 100644 --- a/pkgs/by-name/li/libargon2/package.nix +++ b/pkgs/by-name/li/libargon2/package.nix @@ -29,18 +29,17 @@ stdenv.mkDerivation rec { }) ]; - makeFlags = - [ - "AR=${stdenv.cc.targetPrefix}ar" # Fix cross-compilation - "PREFIX=${placeholder "out"}" - "ARGON2_VERSION=${version}" - "LIBRARY_REL=lib" - "PKGCONFIG_REL=lib" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "LIBRARIES=$(LIB_ST)" - "LINKED_LIB_EXT=" - ]; + makeFlags = [ + "AR=${stdenv.cc.targetPrefix}ar" # Fix cross-compilation + "PREFIX=${placeholder "out"}" + "ARGON2_VERSION=${version}" + "LIBRARY_REL=lib" + "PKGCONFIG_REL=lib" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "LIBRARIES=$(LIB_ST)" + "LINKED_LIB_EXT=" + ]; meta = with lib; { description = "Key derivation function that was selected as the winner of the Password Hashing Competition in July 2015"; diff --git a/pkgs/by-name/li/libass/package.nix b/pkgs/by-name/li/libass/package.nix index 452bdf92d108..ce543e9e36a1 100644 --- a/pkgs/by-name/li/libass/package.nix +++ b/pkgs/by-name/li/libass/package.nix @@ -39,16 +39,15 @@ stdenv.mkDerivation rec { yasm ]; - buildInputs = - [ - freetype - fribidi - harfbuzz - ] - ++ lib.optional fontconfigSupport fontconfig - ++ lib.optional stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + freetype + fribidi + harfbuzz + ] + ++ lib.optional fontconfigSupport fontconfig + ++ lib.optional stdenv.hostPlatform.isDarwin [ + libiconv + ]; meta = with lib; { description = "Portable ASS/SSA subtitle renderer"; diff --git a/pkgs/by-name/li/libavif/package.nix b/pkgs/by-name/li/libavif/package.nix index fddc260fc8c4..1b4b46d12202 100644 --- a/pkgs/by-name/li/libavif/package.nix +++ b/pkgs/by-name/li/libavif/package.nix @@ -93,19 +93,18 @@ stdenv.mkDerivation rec { doCheck = true; - postInstall = - '' - GDK_PIXBUF_MODULEDIR=${gdkPixbufModuleDir} \ - GDK_PIXBUF_MODULE_FILE=${gdkPixbufModuleFile} \ - gdk-pixbuf-query-loaders --update-cache + postInstall = '' + GDK_PIXBUF_MODULEDIR=${gdkPixbufModuleDir} \ + GDK_PIXBUF_MODULE_FILE=${gdkPixbufModuleFile} \ + gdk-pixbuf-query-loaders --update-cache - '' - # Cross-compiled gdk-pixbuf doesn't support thumbnailers - + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' - mkdir -p "$out/bin" - makeWrapper ${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer "$out/libexec/gdk-pixbuf-thumbnailer-avif" \ - --set GDK_PIXBUF_MODULE_FILE ${gdkPixbufModuleFile} - ''; + '' + # Cross-compiled gdk-pixbuf doesn't support thumbnailers + + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + mkdir -p "$out/bin" + makeWrapper ${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer "$out/libexec/gdk-pixbuf-thumbnailer-avif" \ + --set GDK_PIXBUF_MODULE_FILE ${gdkPixbufModuleFile} + ''; meta = { description = "C implementation of the AV1 Image File Format"; diff --git a/pkgs/by-name/li/libb64/package.nix b/pkgs/by-name/li/libb64/package.nix index 2f73c45d0d9e..398c430cc623 100644 --- a/pkgs/by-name/li/libb64/package.nix +++ b/pkgs/by-name/li/libb64/package.nix @@ -16,39 +16,38 @@ stdenv.mkDerivation rec { sha256 = "sha256-9loDftr769qnIi00MueO86kjha2EiG9pnCLogp0Iq3c="; }; - patches = - [ - # Fix parallel build failure: https://github.com/libb64/libb64/pull/9 - # make[1]: *** No rule to make target 'libb64.a', needed by 'c-example1'. Stop. - (fetchpatch { - name = "parallel-make.patch"; - url = "https://github.com/libb64/libb64/commit/4fe47c052e9123da8f751545deb48be08c3411f6.patch"; - sha256 = "18b3np3gpyzimqmk6001riqv5n70wfbclky6zzsrvj5zl1dj4ljf"; - }) - # Fix i686-linux build failure. - (fetchpatch { - name = "elif.patch"; - url = "https://github.com/libb64/libb64/commit/819e43c8b34261ea3ee694bdc27865a033966083.patch"; - hash = "sha256-r2jI6Q3rWDtArLlkAuyy7vcjsuRvX+2fBd5yk8XOMcc"; - }) - (fetchpatch { - name = "size_t.patch"; - url = "https://github.com/libb64/libb64/commit/b5edeafc89853c48fa41a4c16393a1fdc8638ab6.patch"; - hash = "sha256-+bqfOOlT/t0FLQEMHuxW1BxJcx9rk0yYM3wD43mcymo"; - }) - # Fix build with Clang 16. - # https://github.com/libb64/libb64/pull/10 - (fetchpatch { - name = "use-proper-function-prototype-for-main.patch"; - url = "https://github.com/libb64/libb64/commit/98eaf510f40e384b32c01ad4bd5c3a697fdd8560.patch"; - hash = "sha256-CGslJUw0og/bBBirLm0J5Q7cf2WW/vniVAkXHlb6lbQ="; - }) - ] - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) (fetchpatch { - name = "0001-example-Do-not-run-the-tests.patch"; - url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch?id=484e0de1e4ee107f21ae2a5c5f976ed987978baf"; - sha256 = "sha256-KTsiIWJe66BKlu/A43FWfW0XAu4E7lWX/RY4NITRrm4="; - }); + patches = [ + # Fix parallel build failure: https://github.com/libb64/libb64/pull/9 + # make[1]: *** No rule to make target 'libb64.a', needed by 'c-example1'. Stop. + (fetchpatch { + name = "parallel-make.patch"; + url = "https://github.com/libb64/libb64/commit/4fe47c052e9123da8f751545deb48be08c3411f6.patch"; + sha256 = "18b3np3gpyzimqmk6001riqv5n70wfbclky6zzsrvj5zl1dj4ljf"; + }) + # Fix i686-linux build failure. + (fetchpatch { + name = "elif.patch"; + url = "https://github.com/libb64/libb64/commit/819e43c8b34261ea3ee694bdc27865a033966083.patch"; + hash = "sha256-r2jI6Q3rWDtArLlkAuyy7vcjsuRvX+2fBd5yk8XOMcc"; + }) + (fetchpatch { + name = "size_t.patch"; + url = "https://github.com/libb64/libb64/commit/b5edeafc89853c48fa41a4c16393a1fdc8638ab6.patch"; + hash = "sha256-+bqfOOlT/t0FLQEMHuxW1BxJcx9rk0yYM3wD43mcymo"; + }) + # Fix build with Clang 16. + # https://github.com/libb64/libb64/pull/10 + (fetchpatch { + name = "use-proper-function-prototype-for-main.patch"; + url = "https://github.com/libb64/libb64/commit/98eaf510f40e384b32c01ad4bd5c3a697fdd8560.patch"; + hash = "sha256-CGslJUw0og/bBBirLm0J5Q7cf2WW/vniVAkXHlb6lbQ="; + }) + ] + ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) (fetchpatch { + name = "0001-example-Do-not-run-the-tests.patch"; + url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch?id=484e0de1e4ee107f21ae2a5c5f976ed987978baf"; + sha256 = "sha256-KTsiIWJe66BKlu/A43FWfW0XAu4E7lWX/RY4NITRrm4="; + }); enableParallelBuilding = true; diff --git a/pkgs/by-name/li/libbladeRF/package.nix b/pkgs/by-name/li/libbladeRF/package.nix index 0f5364bc21b9..8e9cb3b10532 100644 --- a/pkgs/by-name/li/libbladeRF/package.nix +++ b/pkgs/by-name/li/libbladeRF/package.nix @@ -38,13 +38,12 @@ stdenv.mkDerivation rec { help2man ]; # ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208 - buildInputs = - [ - tecla - libusb1 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ ncurses ]; + buildInputs = [ + tecla + libusb1 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ ncurses ]; # Fixup shebang prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash"; @@ -56,15 +55,14 @@ stdenv.mkDerivation rec { doInstallCheck = true; - cmakeFlags = - [ - "-DBUILD_DOCUMENTATION=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DUDEV_RULES_PATH=etc/udev/rules.d" - "-DINSTALL_UDEV_RULES=ON" - "-DBLADERF_GROUP=bladerf" - ]; + cmakeFlags = [ + "-DBUILD_DOCUMENTATION=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DUDEV_RULES_PATH=etc/udev/rules.d" + "-DINSTALL_UDEV_RULES=ON" + "-DBLADERF_GROUP=bladerf" + ]; env = lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable"; diff --git a/pkgs/by-name/li/libbluray/package.nix b/pkgs/by-name/li/libbluray/package.nix index 9ab07b4dbfdb..684c53c62d00 100644 --- a/pkgs/by-name/li/libbluray/package.nix +++ b/pkgs/by-name/li/libbluray/package.nix @@ -31,19 +31,21 @@ stdenv.mkDerivation rec { hash = "sha256-R4/9aKD13ejvbKmJt/A1taCiLFmRQuXNP/ewO76+Xys="; }; - nativeBuildInputs = - [ - pkg-config - autoreconfHook - ] - ++ lib.optionals withJava [ - jdk17 - ant - stripJavaArchivesHook - ]; + nativeBuildInputs = [ + pkg-config + autoreconfHook + ] + ++ lib.optionals withJava [ + jdk17 + ant + stripJavaArchivesHook + ]; - buildInputs = - [ fontconfig ] ++ lib.optional withMetadata libxml2 ++ lib.optional withFonts freetype; + buildInputs = [ + fontconfig + ] + ++ lib.optional withMetadata libxml2 + ++ lib.optional withFonts freetype; propagatedBuildInputs = lib.optional withAACS libaacs; diff --git a/pkgs/by-name/li/libcaca/package.nix b/pkgs/by-name/li/libcaca/package.nix index d83ed369c1eb..c5b636a7934c 100644 --- a/pkgs/by-name/li/libcaca/package.nix +++ b/pkgs/by-name/li/libcaca/package.nix @@ -27,16 +27,15 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - ncurses - zlib - (imlib2.override { inherit x11Support; }) - ] - ++ lib.optionals x11Support [ - xorg.libX11 - xorg.libXext - ]; + buildInputs = [ + ncurses + zlib + (imlib2.override { inherit x11Support; }) + ] + ++ lib.optionals x11Support [ + xorg.libX11 + xorg.libXext + ]; outputs = [ "bin" @@ -45,15 +44,14 @@ stdenv.mkDerivation rec { "man" ]; - configureFlags = - [ - (if x11Support then "--enable-x11" else "--disable-x11") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Suppresses a build failure building Cocoa support due to accessing private ivar `_running`, - # which no longer available. - (lib.enableFeature false "cocoa") - ]; + configureFlags = [ + (if x11Support then "--enable-x11" else "--disable-x11") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Suppresses a build failure building Cocoa support due to accessing private ivar `_running`, + # which no longer available. + (lib.enableFeature false "cocoa") + ]; env.NIX_CFLAGS_COMPILE = lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING"; diff --git a/pkgs/by-name/li/libcamera/package.nix b/pkgs/by-name/li/libcamera/package.nix index dca021ffbe13..0822c26bf80e 100644 --- a/pkgs/by-name/li/libcamera/package.nix +++ b/pkgs/by-name/li/libcamera/package.nix @@ -62,37 +62,36 @@ stdenv.mkDerivation rec { strictDeps = true; - buildInputs = - [ - # IPA and signing - openssl + buildInputs = [ + # IPA and signing + openssl - # gstreamer integration - gst_all_1.gstreamer - gst_all_1.gst-plugins-base + # gstreamer integration + gst_all_1.gstreamer + gst_all_1.gst-plugins-base - # cam integration - libevent - libdrm + # cam integration + libevent + libdrm - # hotplugging - udev + # hotplugging + udev - # pycamera - python3Packages.pybind11 + # pycamera + python3Packages.pybind11 - # yamlparser - libyaml + # yamlparser + libyaml - gtest - ] - ++ lib.optionals stdenv.hostPlatform.isAarch [ libpisp ] - ++ lib.optionals withTracing [ lttng-ust ] - ++ lib.optionals withQcam [ - libtiff - qt6.qtbase - qt6.qttools - ]; + gtest + ] + ++ lib.optionals stdenv.hostPlatform.isAarch [ libpisp ] + ++ lib.optionals withTracing [ lttng-ust ] + ++ lib.optionals withQcam [ + libtiff + qt6.qtbase + qt6.qttools + ]; nativeBuildInputs = [ meson @@ -106,7 +105,8 @@ stdenv.mkDerivation rec { graphviz doxygen openssl - ] ++ lib.optional withQcam qt6.wrapQtAppsHook; + ] + ++ lib.optional withQcam qt6.wrapQtAppsHook; mesonFlags = [ "-Dv4l2=true" diff --git a/pkgs/by-name/li/libcanberra/package.nix b/pkgs/by-name/li/libcanberra/package.nix index 6f54155a265f..41521927cdaa 100644 --- a/pkgs/by-name/li/libcanberra/package.nix +++ b/pkgs/by-name/li/libcanberra/package.nix @@ -34,46 +34,45 @@ stdenv.mkDerivation rec { strictDeps = true; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libpulseaudio - libvorbis - libtool # in buildInputs rather than nativeBuildInputs since libltdl is used (not libtool itself) - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - ]) - ++ lib.optional (gtkSupport == "gtk2") gtk2-x11 - ++ lib.optional (gtkSupport == "gtk3") gtk3-x11 - ++ lib.optional stdenv.hostPlatform.isLinux libcap - ++ lib.optional withSystemd systemd - ++ lib.optional withAlsa alsa-lib; + buildInputs = [ + libpulseaudio + libvorbis + libtool # in buildInputs rather than nativeBuildInputs since libltdl is used (not libtool itself) + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + ]) + ++ lib.optional (gtkSupport == "gtk2") gtk2-x11 + ++ lib.optional (gtkSupport == "gtk3") gtk3-x11 + ++ lib.optional stdenv.hostPlatform.isLinux libcap + ++ lib.optional withSystemd systemd + ++ lib.optional withAlsa alsa-lib; - configureFlags = - [ "--disable-oss" ] - ++ lib.optional stdenv.hostPlatform.isLinux "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"; + configureFlags = [ + "--disable-oss" + ] + ++ lib.optional stdenv.hostPlatform.isLinux "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"; - patches = - [ - (fetchpatch { - name = "0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch"; - url = "http://git.0pointer.net/libcanberra.git/patch/?id=c0620e432650e81062c1967cc669829dbd29b310"; - sha256 = "0rc7zwn39yxzxp37qh329g7375r5ywcqcaak8ryd0dgvg8m5hcx9"; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (fetchpatch { - url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/patch-configure.diff"; - sha256 = "sha256-pEJy1krciUEg5BFIS8FJ4BubjfS/nt9aqi6BLnS1+4M="; - extraPrefix = ""; - }) - (fetchpatch { - url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/dynamic_lookup-11.patch"; - sha256 = "sha256-nUjha2pKh5VZl0ZZzcr9NTo1TVuMqF4OcLiztxW+ofQ="; - extraPrefix = ""; - }) - ]; + patches = [ + (fetchpatch { + name = "0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch"; + url = "http://git.0pointer.net/libcanberra.git/patch/?id=c0620e432650e81062c1967cc669829dbd29b310"; + sha256 = "0rc7zwn39yxzxp37qh329g7375r5ywcqcaak8ryd0dgvg8m5hcx9"; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (fetchpatch { + url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/patch-configure.diff"; + sha256 = "sha256-pEJy1krciUEg5BFIS8FJ4BubjfS/nt9aqi6BLnS1+4M="; + extraPrefix = ""; + }) + (fetchpatch { + url = "https://github.com/macports/macports-ports/raw/5a7965dfea7727d1ceedee46c7b0ccee9cb23468/audio/libcanberra/files/dynamic_lookup-11.patch"; + sha256 = "sha256-nUjha2pKh5VZl0ZZzcr9NTo1TVuMqF4OcLiztxW+ofQ="; + extraPrefix = ""; + }) + ]; postInstall = '' for f in $out/lib/*.la; do diff --git a/pkgs/by-name/li/libcap/package.nix b/pkgs/by-name/li/libcap/package.nix index 8643f0b1abbb..7abcdb8d24b8 100644 --- a/pkgs/by-name/li/libcap/package.nix +++ b/pkgs/by-name/li/libcap/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation rec { "lib" "man" "doc" - ] ++ lib.optional usePam "pam"; + ] + ++ lib.optional usePam "pam"; depsBuildBuild = [ buildPackages.stdenv.cc @@ -53,59 +54,56 @@ stdenv.mkDerivation rec { buildInputs = lib.optional usePam pam; - makeFlags = - [ - "lib=lib" - "PAM_CAP=${if usePam then "yes" else "no"}" - "BUILD_CC=$(CC_FOR_BUILD)" - "CC:=$(CC)" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ] - ++ lib.optionals withGo [ - "GOLANG=yes" - ''GOCACHE=''${TMPDIR}/go-cache'' - "GOFLAGS=-trimpath" - "GOARCH=${pkgsBuildHost.go.GOARCH}" - "GOOS=${pkgsBuildHost.go.GOOS}" - ] - ++ lib.optionals isStatic [ - "SHARED=no" - "LIBCSTATIC=yes" - ]; + makeFlags = [ + "lib=lib" + "PAM_CAP=${if usePam then "yes" else "no"}" + "BUILD_CC=$(CC_FOR_BUILD)" + "CC:=$(CC)" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ] + ++ lib.optionals withGo [ + "GOLANG=yes" + ''GOCACHE=''${TMPDIR}/go-cache'' + "GOFLAGS=-trimpath" + "GOARCH=${pkgsBuildHost.go.GOARCH}" + "GOOS=${pkgsBuildHost.go.GOOS}" + ] + ++ lib.optionals isStatic [ + "SHARED=no" + "LIBCSTATIC=yes" + ]; - postPatch = - '' - patchShebangs ./progs/mkcapshdoc.sh + postPatch = '' + patchShebangs ./progs/mkcapshdoc.sh - # use full path to bash - substituteInPlace progs/capsh.c --replace "/bin/bash" "${runtimeShell}" + # use full path to bash + substituteInPlace progs/capsh.c --replace "/bin/bash" "${runtimeShell}" - # set prefixes - substituteInPlace Make.Rules \ - --replace 'prefix=/usr' "prefix=$lib" \ - --replace 'exec_prefix=' "exec_prefix=$out" \ - --replace 'lib_prefix=$(exec_prefix)' "lib_prefix=$lib" \ - --replace 'inc_prefix=$(prefix)' "inc_prefix=$dev" \ - --replace 'man_prefix=$(prefix)' "man_prefix=$doc" - '' - + lib.optionalString withGo '' - # disable cross compilation for artifacts which are run as part of the build - substituteInPlace go/Makefile \ - --replace-fail '$(GO) run' 'GOOS= GOARCH= $(GO) run' - ''; + # set prefixes + substituteInPlace Make.Rules \ + --replace 'prefix=/usr' "prefix=$lib" \ + --replace 'exec_prefix=' "exec_prefix=$out" \ + --replace 'lib_prefix=$(exec_prefix)' "lib_prefix=$lib" \ + --replace 'inc_prefix=$(prefix)' "inc_prefix=$dev" \ + --replace 'man_prefix=$(prefix)' "man_prefix=$doc" + '' + + lib.optionalString withGo '' + # disable cross compilation for artifacts which are run as part of the build + substituteInPlace go/Makefile \ + --replace-fail '$(GO) run' 'GOOS= GOARCH= $(GO) run' + ''; installFlags = [ "RAISE_SETFCAP=no" ]; - postInstall = - '' - ${lib.optionalString (!isStatic) ''rm "$lib"/lib/*.a''} - mkdir -p "$doc/share/doc/${pname}-${version}" - cp License "$doc/share/doc/${pname}-${version}/" - '' - + lib.optionalString usePam '' - mkdir -p "$pam/lib/security" - mv "$lib"/lib/security "$pam/lib" - ''; + postInstall = '' + ${lib.optionalString (!isStatic) ''rm "$lib"/lib/*.a''} + mkdir -p "$doc/share/doc/${pname}-${version}" + cp License "$doc/share/doc/${pname}-${version}/" + '' + + lib.optionalString usePam '' + mkdir -p "$pam/lib/security" + mv "$lib"/lib/security "$pam/lib" + ''; strictDeps = true; diff --git a/pkgs/by-name/li/libcdio-paranoia/package.nix b/pkgs/by-name/li/libcdio-paranoia/package.nix index 90a5782b3520..4ac39a32362f 100644 --- a/pkgs/by-name/li/libcdio-paranoia/package.nix +++ b/pkgs/by-name/li/libcdio-paranoia/package.nix @@ -23,11 +23,12 @@ stdenv.mkDerivation rec { autoreconfHook pkg-config ]; - buildInputs = - [ libcdio ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + libcdio + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-ld-version-script" ]; diff --git a/pkgs/by-name/li/libcdio/package.nix b/pkgs/by-name/li/libcdio/package.nix index 026248eedfd3..483868b4ea99 100644 --- a/pkgs/by-name/li/libcdio/package.nix +++ b/pkgs/by-name/li/libcdio/package.nix @@ -29,38 +29,36 @@ stdenv.mkDerivation (finalAttrs: { NIX_CFLAGS_COMPILE = "-D_LARGEFILE64_SOURCE"; }; - postPatch = - '' - patchShebangs . - echo " - @set UPDATED 1 January 1970 - @set UPDATED-MONTH January 1970 - @set EDITION ${finalAttrs.version} - @set VERSION ${finalAttrs.version} - " > doc/version.texi - '' - + lib.optionalString (!withMan) '' - substituteInPlace src/Makefile.am \ - --replace-fail 'man_cd_drive = cd-drive.1' "" \ - --replace-fail 'man_cd_info = cd-info.1' "" \ - --replace-fail 'man_cd_read = cd-read.1' "" \ - --replace-fail 'man_iso_info = iso-info.1' "" \ - --replace-fail 'man_iso_read = iso-read.1' "" - ''; + postPatch = '' + patchShebangs . + echo " + @set UPDATED 1 January 1970 + @set UPDATED-MONTH January 1970 + @set EDITION ${finalAttrs.version} + @set VERSION ${finalAttrs.version} + " > doc/version.texi + '' + + lib.optionalString (!withMan) '' + substituteInPlace src/Makefile.am \ + --replace-fail 'man_cd_drive = cd-drive.1' "" \ + --replace-fail 'man_cd_info = cd-info.1' "" \ + --replace-fail 'man_cd_read = cd-read.1' "" \ + --replace-fail 'man_iso_info = iso-info.1' "" \ + --replace-fail 'man_iso_read = iso-read.1' "" + ''; configureFlags = [ (lib.enableFeature withMan "maintainer-mode") ]; - nativeBuildInputs = - [ - pkg-config - autoreconfHook - texinfo - ] - ++ lib.optionals withMan [ - help2man - ]; + nativeBuildInputs = [ + pkg-config + autoreconfHook + texinfo + ] + ++ lib.optionals withMan [ + help2man + ]; buildInputs = [ libcddb @@ -72,16 +70,15 @@ stdenv.mkDerivation (finalAttrs: { doCheck = !stdenv.hostPlatform.isDarwin; - outputs = - [ - "out" - "lib" - "dev" - "info" - ] - ++ lib.optionals withMan [ - "man" - ]; + outputs = [ + "out" + "lib" + "dev" + "info" + ] + ++ lib.optionals withMan [ + "man" + ]; passthru = { tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; diff --git a/pkgs/by-name/li/libcgroup/package.nix b/pkgs/by-name/li/libcgroup/package.nix index c2032d1511db..d6d603ccceee 100644 --- a/pkgs/by-name/li/libcgroup/package.nix +++ b/pkgs/by-name/li/libcgroup/package.nix @@ -23,30 +23,28 @@ stdenv.mkDerivation rec { hash = "sha256-kWW9ID/eYZH0O/Ge8pf3Cso4yu644R5EiQFYfZMcizs="; }; - configureFlags = - [ - (lib.enableFeature enableSystemd "systemd") - ] - # implicit declaration of function 'rpl_malloc', ; did you mean 'realloc' - # - # It looks like in case of cross-compilation, autoconf assumes that malloc of the - # target platform is broken. - ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ]; + configureFlags = [ + (lib.enableFeature enableSystemd "systemd") + ] + # implicit declaration of function 'rpl_malloc', ; did you mean 'realloc' + # + # It looks like in case of cross-compilation, autoconf assumes that malloc of the + # target platform is broken. + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; nativeBuildInputs = [ autoreconfHook bison flex ]; - buildInputs = - [ - pam - ] - ++ lib.optional enableSystemd systemdLibs - ++ lib.optional stdenv.hostPlatform.isMusl musl-fts; + buildInputs = [ + pam + ] + ++ lib.optional enableSystemd systemdLibs + ++ lib.optional stdenv.hostPlatform.isMusl musl-fts; postPatch = '' substituteInPlace src/tools/Makefile.am \ diff --git a/pkgs/by-name/li/libchamplain/package.nix b/pkgs/by-name/li/libchamplain/package.nix index cef91831f668..a37ccdd95264 100644 --- a/pkgs/by-name/li/libchamplain/package.nix +++ b/pkgs/by-name/li/libchamplain/package.nix @@ -28,26 +28,26 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "qRXNFyoMUpRMVXn8tGg/ioeMVxv16SglS12v78cn5ac="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - vala - ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ - gtk-doc - docbook_xsl - docbook_xml_dtd_412 - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + vala + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + gtk-doc + docbook_xsl + docbook_xml_dtd_412 + ]; buildInputs = [ sqlite diff --git a/pkgs/by-name/li/libcloudproviders/package.nix b/pkgs/by-name/li/libcloudproviders/package.nix index c69a9ecc6cee..128aba939454 100644 --- a/pkgs/by-name/li/libcloudproviders/package.nix +++ b/pkgs/by-name/li/libcloudproviders/package.nix @@ -36,19 +36,18 @@ stdenv.mkDerivation rec { ]; strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - vala - gtk-doc - docbook_xsl - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + vala + gtk-doc + docbook_xsl + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib ]; diff --git a/pkgs/by-name/li/libdaemon/package.nix b/pkgs/by-name/li/libdaemon/package.nix index 15b3790a3c94..7be36bcece73 100644 --- a/pkgs/by-name/li/libdaemon/package.nix +++ b/pkgs/by-name/li/libdaemon/package.nix @@ -21,12 +21,13 @@ stdenv.mkDerivation rec { patches = [ ./fix-includes.patch ]; - configureFlags = - [ "--disable-lynx" ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # Can't run this test while cross-compiling - "ac_cv_func_setpgrp_void=${if stdenv.hostPlatform.isBSD then "no" else "yes"}" - ]; + configureFlags = [ + "--disable-lynx" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # Can't run this test while cross-compiling + "ac_cv_func_setpgrp_void=${if stdenv.hostPlatform.isBSD then "no" else "yes"}" + ]; meta = { description = "Lightweight C library that eases the writing of UNIX daemons"; diff --git a/pkgs/by-name/li/libdazzle/package.nix b/pkgs/by-name/li/libdazzle/package.nix index 484d2968752f..2c967eeb3125 100644 --- a/pkgs/by-name/li/libdazzle/package.nix +++ b/pkgs/by-name/li/libdazzle/package.nix @@ -35,26 +35,25 @@ stdenv.mkDerivation rec { sha256 = "PNPkXrbiaAywXVLh6A3Y+dWdR2UhLw4o945sF4PRjq4="; }; - nativeBuildInputs = - [ - ninja - meson - pkg-config - vala - gobject-introspection - libxml2 - gtk-doc - docbook_xsl - docbook_xml_dtd_43 - dbus - glib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - xvfb-run - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + ninja + meson + pkg-config + vala + gobject-introspection + libxml2 + gtk-doc + docbook_xsl + docbook_xml_dtd_43 + dbus + glib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + xvfb-run + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/li/libdbiDrivers/package.nix b/pkgs/by-name/li/libdbiDrivers/package.nix index 7b8c38174138..d9677e6f1732 100644 --- a/pkgs/by-name/li/libdbiDrivers/package.nix +++ b/pkgs/by-name/li/libdbiDrivers/package.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation rec { buildInputs = [ libdbi sqlite - ] ++ lib.optional (libmysqlclient != null) libmysqlclient; + ] + ++ lib.optional (libmysqlclient != null) libmysqlclient; patches = [ # https://sourceforge.net/p/libdbi-drivers/libdbi-drivers/ci/24f48b86c8988ee3aaebc5f303d71e9d789f77b6 @@ -38,30 +39,29 @@ stdenv.mkDerivation rec { sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure; ''; - configureFlags = - [ - "--sysconfdir=/etc" - "--localstatedir=/var" - "--disable-docs" - "--enable-libdbi" - "--with-dbi-incdir=${libdbi}/include" - "--with-dbi-libdir=${libdbi}/lib" - ] - ++ lib.optionals (libmysqlclient != null) [ - "--with-mysql" - "--with-mysql-incdir=${lib.getDev libmysqlclient}/include/mysql" - "--with-mysql-libdir=${libmysqlclient}/lib/mysql" - ] - ++ lib.optionals (sqlite != null) [ - "--with-sqlite3" - "--with-sqlite3-incdir=${sqlite.dev}/include/sqlite" - "--with-sqlite3-libdir=${sqlite.out}/lib/sqlite" - ] - ++ lib.optionals (libpq != null) [ - "--with-pgsql" - "--with-pgsql-incdir=${libpq.dev}/include" - "--with-pgsql-libdir=${libpq}/lib/" - ]; + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + "--disable-docs" + "--enable-libdbi" + "--with-dbi-incdir=${libdbi}/include" + "--with-dbi-libdir=${libdbi}/lib" + ] + ++ lib.optionals (libmysqlclient != null) [ + "--with-mysql" + "--with-mysql-incdir=${lib.getDev libmysqlclient}/include/mysql" + "--with-mysql-libdir=${libmysqlclient}/lib/mysql" + ] + ++ lib.optionals (sqlite != null) [ + "--with-sqlite3" + "--with-sqlite3-incdir=${sqlite.dev}/include/sqlite" + "--with-sqlite3-libdir=${sqlite.out}/lib/sqlite" + ] + ++ lib.optionals (libpq != null) [ + "--with-pgsql" + "--with-pgsql-incdir=${libpq.dev}/include" + "--with-pgsql-libdir=${libpq}/lib/" + ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.cc.isClang [ diff --git a/pkgs/by-name/li/libdbusmenu/package.nix b/pkgs/by-name/li/libdbusmenu/package.nix index 504b1954d068..1bd881db3142 100644 --- a/pkgs/by-name/li/libdbusmenu/package.nix +++ b/pkgs/by-name/li/libdbusmenu/package.nix @@ -36,13 +36,13 @@ stdenv.mkDerivation (finalAttrs: { gobject-introspection ]; - buildInputs = - [ - glib - dbus-glib - json-glib - ] - ++ lib.optional (gtkVersion != null) + buildInputs = [ + glib + dbus-glib + json-glib + ] + ++ + lib.optional (gtkVersion != null) { "2" = gtk2; "3" = gtk3; @@ -73,7 +73,8 @@ stdenv.mkDerivation (finalAttrs: { # TODO use `lib.withFeatureAs` (if gtkVersion == null then "--disable-gtk" else "--with-gtk=${gtkVersion}") "--disable-scrollkeeper" - ] ++ lib.optional (gtkVersion != "2") "--disable-dumper"; + ] + ++ lib.optional (gtkVersion != "2") "--disable-dumper"; doCheck = false; # generates shebangs in check phase, too lazy to fix @@ -96,7 +97,8 @@ stdenv.mkDerivation (finalAttrs: { pkgConfigModules = [ "dbusmenu-glib-0.4" "dbusmenu-jsonloader-0.4" - ] ++ lib.optional (gtkVersion == "3") "dbusmenu-gtk${gtkVersion}-0.4"; + ] + ++ lib.optional (gtkVersion == "3") "dbusmenu-gtk${gtkVersion}-0.4"; platforms = platforms.linux; maintainers = [ maintainers.msteen ]; }; diff --git a/pkgs/by-name/li/libdeflate/package.nix b/pkgs/by-name/li/libdeflate/package.nix index d05c7ec64845..0a14d75ea7dc 100644 --- a/pkgs/by-name/li/libdeflate/package.nix +++ b/pkgs/by-name/li/libdeflate/package.nix @@ -22,7 +22,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DLIBDEFLATE_BUILD_TESTS=ON" - ] ++ lib.optionals stdenv.hostPlatform.isStatic [ "-DLIBDEFLATE_BUILD_SHARED_LIB=OFF" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ "-DLIBDEFLATE_BUILD_SHARED_LIB=OFF" ]; nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = [ zlib ]; diff --git a/pkgs/by-name/li/libdeltachat/package.nix b/pkgs/by-name/li/libdeltachat/package.nix index fd551a2e7b66..5139844f4352 100644 --- a/pkgs/by-name/li/libdeltachat/package.nix +++ b/pkgs/by-name/li/libdeltachat/package.nix @@ -39,27 +39,25 @@ stdenv.mkDerivation rec { hash = "sha256-PToZYRnAIcvbRBOzUHaFdtS6t0xCULcsSp4ydohCQi8="; }; - nativeBuildInputs = - [ - cmake - perl - pkg-config - rustPlatform.cargoSetupHook - cargo - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + cmake + perl + pkg-config + rustPlatform.cargoSetupHook + cargo + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; - buildInputs = - [ - openssl - sqlcipher - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + sqlcipher + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; nativeCheckInputs = with rustPlatform; [ cargoCheckHook diff --git a/pkgs/by-name/li/libdicom/package.nix b/pkgs/by-name/li/libdicom/package.nix index b23fc37c56f8..c064e6007a30 100644 --- a/pkgs/by-name/li/libdicom/package.nix +++ b/pkgs/by-name/li/libdicom/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation (finalAttrs: { meson ninja pkg-config - ] ++ lib.optionals (finalAttrs.finalPackage.doCheck) [ check ]; + ] + ++ lib.optionals (finalAttrs.finalPackage.doCheck) [ check ]; mesonBuildType = "release"; diff --git a/pkgs/by-name/li/libdmapsharing/package.nix b/pkgs/by-name/li/libdmapsharing/package.nix index 91d1388b3812..cbc8f9d2f169 100644 --- a/pkgs/by-name/li/libdmapsharing/package.nix +++ b/pkgs/by-name/li/libdmapsharing/package.nix @@ -23,14 +23,13 @@ stdenv.mkDerivation rec { pname = "libdmapsharing"; version = "3.9.13"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withGtkDoc [ - "devdoc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withGtkDoc [ + "devdoc" + ]; outputBin = "dev"; @@ -44,31 +43,29 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - autoconf - automake - libtool - gtk-doc # gtkdocize - pkg-config - gobject-introspection - vala - ] - ++ lib.optionals withGtkDoc [ - docbook-xsl-nons - docbook_xml_dtd_43 - ]; + nativeBuildInputs = [ + autoconf + automake + libtool + gtk-doc # gtkdocize + pkg-config + gobject-introspection + vala + ] + ++ lib.optionals withGtkDoc [ + docbook-xsl-nons + docbook_xml_dtd_43 + ]; - buildInputs = - [ - avahi - gdk-pixbuf - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - ] - ++ lib.optionals withGtkDoc [ - gtk-doc - ]; + buildInputs = [ + avahi + gdk-pixbuf + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + ] + ++ lib.optionals withGtkDoc [ + gtk-doc + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/by-name/li/libdrm/package.nix b/pkgs/by-name/li/libdrm/package.nix index 3d0d6501016a..d4a6345f6ac4 100644 --- a/pkgs/by-name/li/libdrm/package.nix +++ b/pkgs/by-name/li/libdrm/package.nix @@ -35,25 +35,25 @@ stdenv.mkDerivation rec { ninja docutils ]; - buildInputs = - [ libpthreadstubs ] - ++ lib.optional withIntel libpciaccess - ++ lib.optional withValgrind valgrind-light; + buildInputs = [ + libpthreadstubs + ] + ++ lib.optional withIntel libpciaccess + ++ lib.optional withValgrind valgrind-light; - mesonFlags = - [ - "-Dinstall-test-programs=true" - "-Dcairo-tests=disabled" - (lib.mesonEnable "intel" withIntel) - (lib.mesonEnable "omap" stdenv.hostPlatform.isLinux) - (lib.mesonEnable "valgrind" withValgrind) - ] - ++ lib.optionals stdenv.hostPlatform.isAarch [ - "-Dtegra=enabled" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "-Detnaviv=disabled" - ]; + mesonFlags = [ + "-Dinstall-test-programs=true" + "-Dcairo-tests=disabled" + (lib.mesonEnable "intel" withIntel) + (lib.mesonEnable "omap" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "valgrind" withValgrind) + ] + ++ lib.optionals stdenv.hostPlatform.isAarch [ + "-Dtegra=enabled" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "-Detnaviv=disabled" + ]; passthru = { updateScript = gitUpdater { diff --git a/pkgs/by-name/li/libepoxy/package.nix b/pkgs/by-name/li/libepoxy/package.nix index 4f261f313372..c408b12bac40 100644 --- a/pkgs/by-name/li/libepoxy/package.nix +++ b/pkgs/by-name/li/libepoxy/package.nix @@ -28,19 +28,18 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./libgl-path.patch ]; - postPatch = - '' - patchShebangs src/*.py - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/dispatch_common.h --replace-fail "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1" - '' - # cgl_core and cgl_epoxy_api fail in darwin sandbox and on Hydra (because it's headless?) - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace test/meson.build \ - --replace-fail "[ 'cgl_core', [ 'cgl_core.c' ] ]," "" \ - --replace-fail "[ 'cgl_epoxy_api', [ 'cgl_epoxy_api.c' ] ]," "" - ''; + postPatch = '' + patchShebangs src/*.py + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/dispatch_common.h --replace-fail "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1" + '' + # cgl_core and cgl_epoxy_api fail in darwin sandbox and on Hydra (because it's headless?) + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace test/meson.build \ + --replace-fail "[ 'cgl_core', [ 'cgl_core.c' ] ]," "" \ + --replace-fail "[ 'cgl_epoxy_api', [ 'cgl_epoxy_api.c' ] ]," "" + ''; outputs = [ "out" diff --git a/pkgs/by-name/li/libevent/package.nix b/pkgs/by-name/li/libevent/package.nix index 42c2d2fe120e..d57718c75356 100644 --- a/pkgs/by-name/li/libevent/package.nix +++ b/pkgs/by-name/li/libevent/package.nix @@ -46,17 +46,18 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional sslSupport "openssl"; + ] + ++ lib.optional sslSupport "openssl"; outputBin = "dev"; propagatedBuildOutputs = [ "out" ] ++ lib.optional sslSupport "openssl"; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = - lib.optional sslSupport openssl - ++ lib.optional stdenv.hostPlatform.isCygwin findutils; + lib.optional sslSupport openssl ++ lib.optional stdenv.hostPlatform.isCygwin findutils; doCheck = false; # needs the net diff --git a/pkgs/by-name/li/libewf-legacy/package.nix b/pkgs/by-name/li/libewf-legacy/package.nix index 4cb9f3c324bf..97063944a33e 100644 --- a/pkgs/by-name/li/libewf-legacy/package.nix +++ b/pkgs/by-name/li/libewf-legacy/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation (finalAttrs: { zlib openssl libuuid - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ bzip2 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ bzip2 ]; meta = { description = "Legacy library for support of the Expert Witness Compression Format"; diff --git a/pkgs/by-name/li/libewf/package.nix b/pkgs/by-name/li/libewf/package.nix index 977365863e2f..ad4398490d51 100644 --- a/pkgs/by-name/li/libewf/package.nix +++ b/pkgs/by-name/li/libewf/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { zlib openssl libuuid - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ bzip2 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ bzip2 ]; # cannot run test program while cross compiling configureFlags = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ diff --git a/pkgs/by-name/li/libexecinfo/package.nix b/pkgs/by-name/li/libexecinfo/package.nix index 066a29a580bc..ca6fe44dabf2 100644 --- a/pkgs/by-name/li/libexecinfo/package.nix +++ b/pkgs/by-name/li/libexecinfo/package.nix @@ -40,17 +40,16 @@ stdenv.mkDerivation rec { patchFlags = [ "-p0" ]; - installPhase = - '' - install -Dm644 execinfo.h stacktraverse.h -t $out/include - '' - + lib.optionalString enableShared '' - install -Dm755 libexecinfo.so.1 -t $out/lib - ln -s $out/lib/libexecinfo.so{.1,} - '' - + lib.optionalString enableStatic '' - install -Dm755 libexecinfo.a -t $out/lib - ''; + installPhase = '' + install -Dm644 execinfo.h stacktraverse.h -t $out/include + '' + + lib.optionalString enableShared '' + install -Dm755 libexecinfo.so.1 -t $out/lib + ln -s $out/lib/libexecinfo.so{.1,} + '' + + lib.optionalString enableStatic '' + install -Dm755 libexecinfo.a -t $out/lib + ''; meta = with lib; { description = "Quick-n-dirty BSD licensed clone of the GNU libc backtrace facility"; diff --git a/pkgs/by-name/li/libexsid/package.nix b/pkgs/by-name/li/libexsid/package.nix index e6bd0eb7997f..74fa4db8b818 100644 --- a/pkgs/by-name/li/libexsid/package.nix +++ b/pkgs/by-name/li/libexsid/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ lib.optional docSupport doxygen; + ] + ++ lib.optional docSupport doxygen; buildInputs = [ libftdi1 ]; diff --git a/pkgs/by-name/li/libfaketime/package.nix b/pkgs/by-name/li/libfaketime/package.nix index 029a24c29398..706c1e5df9e2 100644 --- a/pkgs/by-name/li/libfaketime/package.nix +++ b/pkgs/by-name/li/libfaketime/package.nix @@ -26,24 +26,23 @@ stdenv.mkDerivation (finalAttrs: { hash = hashes.${finalAttrs.version}; }; - patches = - [ - ./nix-store-date.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (fetchpatch { - name = "0001-libfaketime.c-wrap-timespec_get-in-TIME_UTC-macro.patch"; - url = "https://github.com/wolfcw/libfaketime/commit/e0e6b79568d36a8fd2b3c41f7214769221182128.patch"; - sha256 = "sha256-KwwP76v0DXNW73p/YBvwUOPdKMAcVdbQSKexD/uFOYo="; - }) - (fetchpatch { - name = "LFS64.patch"; - url = "https://github.com/wolfcw/libfaketime/commit/f32986867addc9d22b0fab29c1c927f079d44ac1.patch"; - hash = "sha256-fIXuxxcV9J2IcgwcwSrMo4maObkH9WYv1DC/wdtbq/g="; - }) - # https://github.com/wolfcw/libfaketime/issues/277 - ./0001-Remove-unsupported-clang-flags.patch - ]; + patches = [ + ./nix-store-date.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (fetchpatch { + name = "0001-libfaketime.c-wrap-timespec_get-in-TIME_UTC-macro.patch"; + url = "https://github.com/wolfcw/libfaketime/commit/e0e6b79568d36a8fd2b3c41f7214769221182128.patch"; + sha256 = "sha256-KwwP76v0DXNW73p/YBvwUOPdKMAcVdbQSKexD/uFOYo="; + }) + (fetchpatch { + name = "LFS64.patch"; + url = "https://github.com/wolfcw/libfaketime/commit/f32986867addc9d22b0fab29c1c927f079d44ac1.patch"; + hash = "sha256-fIXuxxcV9J2IcgwcwSrMo4maObkH9WYv1DC/wdtbq/g="; + }) + # https://github.com/wolfcw/libfaketime/issues/277 + ./0001-Remove-unsupported-clang-flags.patch + ]; postPatch = '' patchShebangs test src diff --git a/pkgs/by-name/li/libff/package.nix b/pkgs/by-name/li/libff/package.nix index 0a03e00978cf..bb6413beaa7c 100644 --- a/pkgs/by-name/li/libff/package.nix +++ b/pkgs/by-name/li/libff/package.nix @@ -21,12 +21,13 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - cmakeFlags = - [ "-DWITH_PROCPS=Off" ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - "-DCURVE=ALT_BN128" - "-DUSE_ASM=OFF" - ]; + cmakeFlags = [ + "-DWITH_PROCPS=Off" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + "-DCURVE=ALT_BN128" + "-DUSE_ASM=OFF" + ]; postPatch = lib.optionalString (!enableStatic) '' substituteInPlace libff/CMakeLists.txt --replace "STATIC" "SHARED" diff --git a/pkgs/by-name/li/libfido2/package.nix b/pkgs/by-name/li/libfido2/package.nix index 60c41b852445..5821d0b7b1de 100644 --- a/pkgs/by-name/li/libfido2/package.nix +++ b/pkgs/by-name/li/libfido2/package.nix @@ -30,14 +30,13 @@ stdenv.mkDerivation rec { udevCheckHook ]; - buildInputs = - [ - libcbor - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ hidapi ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && withPcsclite) [ pcsclite ]; + buildInputs = [ + libcbor + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ hidapi ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && withPcsclite) [ pcsclite ]; propagatedBuildInputs = [ openssl ]; @@ -49,20 +48,19 @@ stdenv.mkDerivation rec { doInstallCheck = true; - cmakeFlags = - [ - "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d" - "-DCMAKE_INSTALL_LIBDIR=lib" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DUSE_HIDAPI=1" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DNFC_LINUX=1" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && withPcsclite) [ - "-DUSE_PCSC=1" - ]; + cmakeFlags = [ + "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d" + "-DCMAKE_INSTALL_LIBDIR=lib" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DUSE_HIDAPI=1" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DNFC_LINUX=1" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && withPcsclite) [ + "-DUSE_PCSC=1" + ]; # causes possible redefinition of _FORTIFY_SOURCE? hardeningDisable = [ "fortify3" ]; diff --git a/pkgs/by-name/li/libfilezilla/package.nix b/pkgs/by-name/li/libfilezilla/package.nix index a4c738f6d30f..0f2b1fc9619b 100644 --- a/pkgs/by-name/li/libfilezilla/package.nix +++ b/pkgs/by-name/li/libfilezilla/package.nix @@ -26,16 +26,15 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - gettext - gnutls - nettle - libxcrypt - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + gettext + gnutls + nettle + libxcrypt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/li/libfixposix/package.nix b/pkgs/by-name/li/libfixposix/package.nix index db66032af7e8..7dbb03078a04 100644 --- a/pkgs/by-name/li/libfixposix/package.nix +++ b/pkgs/by-name/li/libfixposix/package.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]; meta = with lib; { homepage = "https://github.com/sionescu/libfixposix"; diff --git a/pkgs/by-name/li/libfm/package.nix b/pkgs/by-name/li/libfm/package.nix index 4ced9fda207a..f536195d36e5 100644 --- a/pkgs/by-name/li/libfm/package.nix +++ b/pkgs/by-name/li/libfm/package.nix @@ -45,12 +45,14 @@ stdenv.mkDerivation (finalAttrs: { glib gtk pango - ] ++ optional (!extraOnly) menu-cache; + ] + ++ optional (!extraOnly) menu-cache; - configureFlags = - [ "--sysconfdir=/etc" ] - ++ optional extraOnly "--with-extra-only" - ++ optional withGtk3 "--with-gtk=3"; + configureFlags = [ + "--sysconfdir=/etc" + ] + ++ optional extraOnly "--with-extra-only" + ++ optional withGtk3 "--with-gtk=3"; installFlags = [ "sysconfdir=${placeholder "out"}/etc" ]; diff --git a/pkgs/by-name/li/libftdi/package.nix b/pkgs/by-name/li/libftdi/package.nix index 67e119c811be..f3d493c2acad 100644 --- a/pkgs/by-name/li/libftdi/package.nix +++ b/pkgs/by-name/li/libftdi/package.nix @@ -20,7 +20,8 @@ stdenv.mkDerivation rec { configureFlags = [ "ac_cv_prog_HAVELIBUSB=${lib.getExe' (lib.getDev libusb-compat-0_1) "libusb-config"}" - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) "--with-async-mode"; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) "--with-async-mode"; # allow async mode. from ubuntu. see: # https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff diff --git a/pkgs/by-name/li/libftdi1/package.nix b/pkgs/by-name/li/libftdi1/package.nix index c2c3613c9f7f..cc0fb6d3c248 100644 --- a/pkgs/by-name/li/libftdi1/package.nix +++ b/pkgs/by-name/li/libftdi1/package.nix @@ -45,31 +45,29 @@ stdenv.mkDerivation { doInstallCheck = true; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ optionals docSupport [ - doxygen - graphviz - ] - ++ optionals pythonSupport [ swig ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ optionals docSupport [ + doxygen + graphviz + ] + ++ optionals pythonSupport [ swig ]; buildInputs = [ libconfuse ] ++ optionals cppSupport [ boost ]; - cmakeFlags = - [ - "-DFTDIPP=${onOff cppSupport}" - "-DBUILD_TESTS=${onOff cppSupport}" - "-DLINK_PYTHON_LIBRARY=${onOff pythonSupport}" - "-DPYTHON_BINDINGS=${onOff pythonSupport}" - "-DDOCUMENTATION=${onOff docSupport}" - ] - ++ lib.optionals pythonSupport [ - "-DPYTHON_EXECUTABLE=${python3.pythonOnBuildForHost.interpreter}" - "-DPYTHON_LIBRARY=${python3}/lib/libpython${python3.pythonVersion}${stdenv.hostPlatform.extensions.sharedLibrary}" - ]; + cmakeFlags = [ + "-DFTDIPP=${onOff cppSupport}" + "-DBUILD_TESTS=${onOff cppSupport}" + "-DLINK_PYTHON_LIBRARY=${onOff pythonSupport}" + "-DPYTHON_BINDINGS=${onOff pythonSupport}" + "-DDOCUMENTATION=${onOff docSupport}" + ] + ++ lib.optionals pythonSupport [ + "-DPYTHON_EXECUTABLE=${python3.pythonOnBuildForHost.interpreter}" + "-DPYTHON_LIBRARY=${python3}/lib/libpython${python3.pythonVersion}${stdenv.hostPlatform.extensions.sharedLibrary}" + ]; propagatedBuildInputs = [ libusb1 ]; @@ -81,14 +79,13 @@ stdenv.mkDerivation { --replace-fail 'GROUP="ftdi"' 'GROUP="ftdi", TAG+="uaccess"' ''; - postInstall = - '' - install -Dm644 ../packages/99-libftdi.rules "$out/etc/udev/rules.d/60-libftdi.rules" - '' - + optionalString docSupport '' - cp -r doc/man "$out/share/" - cp -r doc/html "$out/share/doc/libftdi1/" - ''; + postInstall = '' + install -Dm644 ../packages/99-libftdi.rules "$out/etc/udev/rules.d/60-libftdi.rules" + '' + + optionalString docSupport '' + cp -r doc/man "$out/share/" + cp -r doc/html "$out/share/doc/libftdi1/" + ''; meta = with lib; { description = "Library to talk to FTDI chips using libusb"; diff --git a/pkgs/by-name/li/libgcrypt/package.nix b/pkgs/by-name/li/libgcrypt/package.nix index 9ae48ef2ddac..219ebec7c2d8 100644 --- a/pkgs/by-name/li/libgcrypt/package.nix +++ b/pkgs/by-name/li/libgcrypt/package.nix @@ -32,35 +32,36 @@ stdenv.mkDerivation rec { "out" ]; - hardeningDisable = - [ - "strictflexarrays3" - ] - ++ lib.optionals stdenv.cc.isClang [ - # The CPU Jitter random number generator must not be compiled with - # optimizations and the optimize -O0 pragma only works for gcc. - # The build enables -O2 by default for everything else. - "fortify" - ]; + hardeningDisable = [ + "strictflexarrays3" + ] + ++ lib.optionals stdenv.cc.isClang [ + # The CPU Jitter random number generator must not be compiled with + # optimizations and the optimize -O0 pragma only works for gcc. + # The build enables -O2 by default for everything else. + "fortify" + ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; - buildInputs = - [ libgpg-error ] - ++ lib.optional stdenv.hostPlatform.isDarwin gettext - ++ lib.optional enableCapabilities libcap; + buildInputs = [ + libgpg-error + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gettext + ++ lib.optional enableCapabilities libcap; strictDeps = true; - configureFlags = - [ "--with-libgpg-error-prefix=${libgpg-error.dev}" ] - ++ lib.optional ( - stdenv.hostPlatform.isMusl || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) - ) "--disable-asm" # for darwin see https://dev.gnupg.org/T5157 - # Fix undefined reference errors with version script under LLVM. - ++ lib.optional ( - stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17" - ) "LDFLAGS=-Wl,--undefined-version"; + configureFlags = [ + "--with-libgpg-error-prefix=${libgpg-error.dev}" + ] + ++ lib.optional ( + stdenv.hostPlatform.isMusl || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) + ) "--disable-asm" # for darwin see https://dev.gnupg.org/T5157 + # Fix undefined reference errors with version script under LLVM. + ++ lib.optional ( + stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17" + ) "LDFLAGS=-Wl,--undefined-version"; # Necessary to generate correct assembly when compiling for aarch32 on # aarch64 @@ -69,41 +70,39 @@ stdenv.mkDerivation rec { "build" ]; - postConfigure = - '' - sed -i configure \ - -e 's/NOEXECSTACK_FLAGS=$/NOEXECSTACK_FLAGS="-Wa,--noexecstack"/' - '' - # The cipher/simd-common-riscv.h wasn't added to the release tarball, please remove this hack on next version update - # https://dev.gnupg.org/T7647 - + lib.optionalString stdenv.hostPlatform.isRiscV '' - cp ${ - fetchurl { - url = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob_plain;f=cipher/simd-common-riscv.h;h=8381000f9ac148c60a6963a1d9ec14a3fee1c576;hb=81ce5321b1b79bde6dfdc3c164efb40c13cf656b"; - hash = "sha256-Toe15YLAOYULnLc2fGMMv/xzs/q1t3LsyiqtL7imc+8="; - name = "simd-common-riscv.h"; - } - } cipher/simd-common-riscv.h - ''; + postConfigure = '' + sed -i configure \ + -e 's/NOEXECSTACK_FLAGS=$/NOEXECSTACK_FLAGS="-Wa,--noexecstack"/' + '' + # The cipher/simd-common-riscv.h wasn't added to the release tarball, please remove this hack on next version update + # https://dev.gnupg.org/T7647 + + lib.optionalString stdenv.hostPlatform.isRiscV '' + cp ${ + fetchurl { + url = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob_plain;f=cipher/simd-common-riscv.h;h=8381000f9ac148c60a6963a1d9ec14a3fee1c576;hb=81ce5321b1b79bde6dfdc3c164efb40c13cf656b"; + hash = "sha256-Toe15YLAOYULnLc2fGMMv/xzs/q1t3LsyiqtL7imc+8="; + name = "simd-common-riscv.h"; + } + } cipher/simd-common-riscv.h + ''; enableParallelBuilding = true; # Make sure libraries are correct for .pc and .la files # Also make sure includes are fixed for callers who don't use libgpgcrypt-config - postFixup = - '' - sed -i 's,#include ,#include "${libgpg-error.dev}/include/gpg-error.h",g' "$dev/include/gcrypt.h" - '' - # The `libgcrypt-config` script references $dev and in the $dev output, the - # stdenv automagically puts the $bin output into propagatedBuildInputs. This - # would cause a cycle. This is a weird tool anyways, so let's stuff it in $dev - # instead. - + '' - moveToOutput bin/libgcrypt-config $dev - '' - + lib.optionalString enableCapabilities '' - sed -i 's,\(-lcap\),-L${libcap.lib}/lib \1,' $lib/lib/libgcrypt.la - ''; + postFixup = '' + sed -i 's,#include ,#include "${libgpg-error.dev}/include/gpg-error.h",g' "$dev/include/gcrypt.h" + '' + # The `libgcrypt-config` script references $dev and in the $dev output, the + # stdenv automagically puts the $bin output into propagatedBuildInputs. This + # would cause a cycle. This is a weird tool anyways, so let's stuff it in $dev + # instead. + + '' + moveToOutput bin/libgcrypt-config $dev + '' + + lib.optionalString enableCapabilities '' + sed -i 's,\(-lcap\),-L${libcap.lib}/lib \1,' $lib/lib/libgcrypt.la + ''; # TODO: figure out why this is even necessary and why the missing dylib only crashes # random instead of every test diff --git a/pkgs/by-name/li/libgedit-amtk/package.nix b/pkgs/by-name/li/libgedit-amtk/package.nix index 3b866ffba3f1..412affb4d6c4 100644 --- a/pkgs/by-name/li/libgedit-amtk/package.nix +++ b/pkgs/by-name/li/libgedit-amtk/package.nix @@ -36,18 +36,17 @@ stdenv.mkDerivation rec { }; strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - gtk-doc - docbook-xsl-nons - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + gtk-doc + docbook-xsl-nons + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; propagatedBuildInputs = [ # Required by libgedit-amtk-5.pc diff --git a/pkgs/by-name/li/libgedit-gfls/package.nix b/pkgs/by-name/li/libgedit-gfls/package.nix index 4177af865e1d..ef62e4b8cc00 100644 --- a/pkgs/by-name/li/libgedit-gfls/package.nix +++ b/pkgs/by-name/li/libgedit-gfls/package.nix @@ -33,18 +33,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-X56QPcmNB0Ey+kzSqDnb6/j6/w7IU7MFSAxW8mX8I3w="; }; - nativeBuildInputs = - [ - docbook-xsl-nons - gobject-introspection - gtk-doc - meson - ninja - pkg-config - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + docbook-xsl-nons + gobject-introspection + gtk-doc + meson + ninja + pkg-config + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ gtk3 diff --git a/pkgs/by-name/li/libgedit-tepl/package.nix b/pkgs/by-name/li/libgedit-tepl/package.nix index 0f81c4e9e414..6d132e7ff89f 100644 --- a/pkgs/by-name/li/libgedit-tepl/package.nix +++ b/pkgs/by-name/li/libgedit-tepl/package.nix @@ -38,18 +38,17 @@ stdenv.mkDerivation rec { }; strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - gobject-introspection - pkg-config - gtk-doc - docbook-xsl-nons - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + gobject-introspection + pkg-config + gtk-doc + docbook-xsl-nons + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ icu diff --git a/pkgs/by-name/li/libgee/package.nix b/pkgs/by-name/li/libgee/package.nix index 817ee9cb0994..8ec7a73b330b 100644 --- a/pkgs/by-name/li/libgee/package.nix +++ b/pkgs/by-name/li/libgee/package.nix @@ -37,15 +37,14 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; - env = - { - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types"; - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "dev"}/share/gir-1.0"; - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0"; - } - // lib.optionalAttrs stdenv.cc.isGNU { - NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - }; + env = { + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types"; + PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "dev"}/share/gir-1.0"; + PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0"; + } + // lib.optionalAttrs stdenv.cc.isGNU { + NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; + }; passthru = { updateScript = gnome.updateScript { diff --git a/pkgs/by-name/li/libgit2/package.nix b/pkgs/by-name/li/libgit2/package.nix index a136f92e82e8..a46c13c4bcca 100644 --- a/pkgs/by-name/li/libgit2/package.nix +++ b/pkgs/by-name/li/libgit2/package.nix @@ -39,23 +39,22 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-/xI3v7LNhpgfjv/m+sZwYDhhYvS6kQYxiiiG3+EF8Mw="; }; - cmakeFlags = - [ - "-DREGEX_BACKEND=pcre2" - "-DUSE_HTTP_PARSER=llhttp" - "-DUSE_SSH=ON" - (lib.cmakeBool "USE_GSSAPI" withGssapi) - "-DBUILD_SHARED_LIBS=${if staticBuild then "OFF" else "ON"}" - ] - ++ lib.optionals stdenv.hostPlatform.isWindows [ - "-DDLLTOOL=${stdenv.cc.bintools.targetPrefix}dlltool" - # For ws2_32, referred to by a `*.pc` file - "-DCMAKE_LIBRARY_PATH=${stdenv.cc.libc}/lib" - ] - ++ lib.optionals stdenv.hostPlatform.isOpenBSD [ - # openbsd headers fail with default c90 - "-DCMAKE_C_STANDARD=99" - ]; + cmakeFlags = [ + "-DREGEX_BACKEND=pcre2" + "-DUSE_HTTP_PARSER=llhttp" + "-DUSE_SSH=ON" + (lib.cmakeBool "USE_GSSAPI" withGssapi) + "-DBUILD_SHARED_LIBS=${if staticBuild then "OFF" else "ON"}" + ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ + "-DDLLTOOL=${stdenv.cc.bintools.targetPrefix}dlltool" + # For ws2_32, referred to by a `*.pc` file + "-DCMAKE_LIBRARY_PATH=${stdenv.cc.libc}/lib" + ] + ++ lib.optionals stdenv.hostPlatform.isOpenBSD [ + # openbsd headers fail with default c90 + "-DCMAKE_C_STANDARD=99" + ]; nativeBuildInputs = [ cmake @@ -69,7 +68,8 @@ stdenv.mkDerivation (finalAttrs: { openssl pcre2 llhttp - ] ++ lib.optional withGssapi krb5; + ] + ++ lib.optional withGssapi krb5; propagatedBuildInputs = lib.optional (!stdenv.hostPlatform.isLinux) libiconv; diff --git a/pkgs/by-name/li/libglycin/package.nix b/pkgs/by-name/li/libglycin/package.nix index 389977babf4f..cdef5453e0d3 100644 --- a/pkgs/by-name/li/libglycin/package.nix +++ b/pkgs/by-name/li/libglycin/package.nix @@ -34,19 +34,18 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-K+cR+0a/zRpOvMsX1ZljjJYYOXbHkyDGE9Q9vY1qJBg="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - rustc - cargo - rustPlatform.cargoSetupHook - ] - ++ lib.optionals withIntrospection [ - vala - gi-docgen - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + rustc + cargo + rustPlatform.cargoSetupHook + ] + ++ lib.optionals withIntrospection [ + vala + gi-docgen + ]; cargoDeps = rustPlatform.fetchCargoVendor { inherit (finalAttrs) pname version src; @@ -57,7 +56,8 @@ stdenv.mkDerivation (finalAttrs: { libseccomp lcms2 gtk4 - ] ++ lib.optionals withIntrospection [ gobject-introspection ]; + ] + ++ lib.optionals withIntrospection [ gobject-introspection ]; propagatedBuildInputs = [ libseccomp diff --git a/pkgs/by-name/li/libgnt/package.nix b/pkgs/by-name/li/libgnt/package.nix index 26f44f71dc25..96b7f6608869 100644 --- a/pkgs/by-name/li/libgnt/package.nix +++ b/pkgs/by-name/li/libgnt/package.nix @@ -20,27 +20,27 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional buildDocs "devdoc"; + ] + ++ lib.optional buildDocs "devdoc"; src = fetchurl { url = "mirror://sourceforge/pidgin/${pname}-${version}.tar.xz"; hash = "sha256-GVkzqacx01dXkbiBulzArSpxXh6cTCPMqqKhfhZMluw="; }; - nativeBuildInputs = - [ - glib - meson - ninja - pkg-config - ] - ++ lib.optionals buildDocs [ - gtk-doc - docbook-xsl-nons - ] - ++ lib.optionals (buildDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + glib + meson + ninja + pkg-config + ] + ++ lib.optionals buildDocs [ + gtk-doc + docbook-xsl-nons + ] + ++ lib.optionals (buildDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/li/libgpiod_1/package.nix b/pkgs/by-name/li/libgpiod_1/package.nix index 444459d66018..f1c4908a2683 100644 --- a/pkgs/by-name/li/libgpiod_1/package.nix +++ b/pkgs/by-name/li/libgpiod_1/package.nix @@ -27,12 +27,13 @@ stdenv.mkDerivation rec { ./0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch ]; - buildInputs = - [ kmod ] - ++ lib.optionals enablePython [ - python3 - ncurses - ]; + buildInputs = [ + kmod + ] + ++ lib.optionals enablePython [ + python3 + ncurses + ]; nativeBuildInputs = [ autoconf-archive pkg-config @@ -43,7 +44,8 @@ stdenv.mkDerivation rec { "--enable-tools=${if enable-tools then "yes" else "no"}" "--enable-bindings-cxx" "--prefix=${placeholder "out"}" - ] ++ lib.optional enablePython "--enable-bindings-python"; + ] + ++ lib.optional enablePython "--enable-bindings-python"; meta = with lib; { description = "C library and tools for interacting with the linux GPIO character device"; diff --git a/pkgs/by-name/li/libgpod/package.nix b/pkgs/by-name/li/libgpod/package.nix index 89cd588a4b04..f67a218345a8 100644 --- a/pkgs/by-name/li/libgpod/package.nix +++ b/pkgs/by-name/li/libgpod/package.nix @@ -57,30 +57,31 @@ stdenv.mkDerivation rec { "--without-hal" "--enable-udev" "--with-udev-dir=${placeholder "out"}/lib/udev" - ] ++ lib.optionals monoSupport [ "--with-mono" ]; + ] + ++ lib.optionals monoSupport [ "--with-mono" ]; dontStrip = monoSupport; - nativeBuildInputs = - [ - autoreconfHook - gtk-doc - intltool - pkg-config - udevCheckHook - ] - ++ (with perlPackages; [ - perl - XMLParser - ]) - ++ lib.optional monoSupport mono; + nativeBuildInputs = [ + autoreconfHook + gtk-doc + intltool + pkg-config + udevCheckHook + ] + ++ (with perlPackages; [ + perl + XMLParser + ]) + ++ lib.optional monoSupport mono; buildInputs = [ libxml2 sg3_utils sqlite taglib - ] ++ lib.optional monoSupport gtk-sharp-2_0; + ] + ++ lib.optional monoSupport gtk-sharp-2_0; propagatedBuildInputs = [ gdk-pixbuf diff --git a/pkgs/by-name/li/libgudev/package.nix b/pkgs/by-name/li/libgudev/package.nix index ee82d06c45e9..a3b8e58f3b91 100644 --- a/pkgs/by-name/li/libgudev/package.nix +++ b/pkgs/by-name/li/libgudev/package.nix @@ -46,17 +46,16 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - pkg-config - meson - ninja - glib # for glib-mkenums needed during the build - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala - ]; + nativeBuildInputs = [ + pkg-config + meson + ninja + glib # for glib-mkenums needed during the build + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala + ]; buildInputs = [ udev diff --git a/pkgs/by-name/li/libguestfs/package.nix b/pkgs/by-name/li/libguestfs/package.nix index 7f1518f1e1b5..306bdd38a48e 100644 --- a/pkgs/by-name/li/libguestfs/package.nix +++ b/pkgs/by-name/li/libguestfs/package.nix @@ -53,31 +53,30 @@ stdenv.mkDerivation (finalAttrs: { }; strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - removeReferencesTo - cdrkit - cpio - getopt - gperf - makeWrapper - pkg-config - python3 - python3.pkgs.pycodestyle - qemu - zstd - ] - ++ (with perlPackages; [ - perl - libintl-perl - GetoptLong - ModuleBuild - ]) - ++ (with ocamlPackages; [ - ocaml - findlib - ]); + nativeBuildInputs = [ + autoreconfHook + removeReferencesTo + cdrkit + cpio + getopt + gperf + makeWrapper + pkg-config + python3 + python3.pkgs.pycodestyle + qemu + zstd + ] + ++ (with perlPackages; [ + perl + libintl-perl + GetoptLong + ModuleBuild + ]) + ++ (with ocamlPackages; [ + ocaml + findlib + ]); buildInputs = [ libxcrypt ncurses @@ -107,7 +106,8 @@ stdenv.mkDerivation (finalAttrs: { ocamlPackages.ocaml_libvirt ocamlPackages.augeas ocamlPackages.ocamlbuild - ] ++ lib.optional javaSupport jdk; + ] + ++ lib.optional javaSupport jdk; prePatch = '' patchShebangs . @@ -122,7 +122,8 @@ stdenv.mkDerivation (finalAttrs: { "CPPFLAGS=-I${lib.getDev libxml2}/include/libxml2" "INSTALL_OCAMLLIB=${placeholder "out"}/lib/ocaml" "--with-guestfs-path=${placeholder "out"}/lib/guestfs" - ] ++ lib.optionals (!javaSupport) [ "--without-java" ]; + ] + ++ lib.optionals (!javaSupport) [ "--without-java" ]; patches = [ ./libguestfs-syms.patch diff --git a/pkgs/by-name/li/libgweather/package.nix b/pkgs/by-name/li/libgweather/package.nix index d91b1c45e2eb..85dcb9b2a661 100644 --- a/pkgs/by-name/li/libgweather/package.nix +++ b/pkgs/by-name/li/libgweather/package.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional withIntrospection "devdoc"; + ] + ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -50,20 +51,19 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - glib - (python3.pythonOnBuildForHost.withPackages (ps: [ ps.pygobject3 ])) - ] - ++ lib.optionals withIntrospection [ - gi-docgen - gobject-introspection - vala - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + glib + (python3.pythonOnBuildForHost.withPackages (ps: [ ps.pygobject3 ])) + ] + ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection + vala + ]; buildInputs = [ glib @@ -73,14 +73,13 @@ stdenv.mkDerivation rec { geocode-glib_2 ]; - mesonFlags = - [ - "-Dzoneinfo_dir=${tzdata}/share/zoneinfo" - (lib.mesonBool "introspection" withIntrospection) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-Dc_args=-D_DARWIN_C_SOURCE" - ]; + mesonFlags = [ + "-Dzoneinfo_dir=${tzdata}/share/zoneinfo" + (lib.mesonBool "introspection" withIntrospection) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-Dc_args=-D_DARWIN_C_SOURCE" + ]; postPatch = '' patchShebangs --build build-aux/meson/gen_locations_variant.py diff --git a/pkgs/by-name/li/libgxps/package.nix b/pkgs/by-name/li/libgxps/package.nix index e837b661d727..95fdbe9710e7 100644 --- a/pkgs/by-name/li/libgxps/package.nix +++ b/pkgs/by-name/li/libgxps/package.nix @@ -46,13 +46,12 @@ stdenv.mkDerivation rec { ]; propagatedBuildInputs = [ libarchive ]; - mesonFlags = - [ - "-Denable-test=false" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Ddisable-introspection=true" - ]; + mesonFlags = [ + "-Denable-test=false" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Ddisable-introspection=true" + ]; passthru = { updateScript = gnome.updateScript { diff --git a/pkgs/by-name/li/libhugetlbfs/package.nix b/pkgs/by-name/li/libhugetlbfs/package.nix index 348a33c81add..4819eec78fdb 100644 --- a/pkgs/by-name/li/libhugetlbfs/package.nix +++ b/pkgs/by-name/li/libhugetlbfs/package.nix @@ -30,21 +30,20 @@ stdenv.mkDerivation rec { ''; enableParallelBuilding = true; - makeFlags = - [ - "BUILDTYPE=NATIVEONLY" - "PREFIX=$(out)" - "HEADERDIR=$(dev)/include" - "LIBDIR32=$(lib)/$(LIB32)" - "LIBDIR64=$(lib)/$(LIB64)" - "EXEDIR=$(bin)/bin" - "DOCDIR=$(doc)/share/doc/libhugetlbfs" - "MANDIR=$(man)/share/man" - ] - ++ lib.optionals (stdenv.buildPlatform.system != stdenv.hostPlatform.system) [ - # The ARCH logic defaults to querying `uname`, which will return build platform arch - "ARCH=${stdenv.hostPlatform.uname.processor}" - ]; + makeFlags = [ + "BUILDTYPE=NATIVEONLY" + "PREFIX=$(out)" + "HEADERDIR=$(dev)/include" + "LIBDIR32=$(lib)/$(LIB32)" + "LIBDIR64=$(lib)/$(LIB64)" + "EXEDIR=$(bin)/bin" + "DOCDIR=$(doc)/share/doc/libhugetlbfs" + "MANDIR=$(man)/share/man" + ] + ++ lib.optionals (stdenv.buildPlatform.system != stdenv.hostPlatform.system) [ + # The ARCH logic defaults to querying `uname`, which will return build platform arch + "ARCH=${stdenv.hostPlatform.uname.processor}" + ]; # Default target builds tests as well, and the tests want a static # libc. diff --git a/pkgs/by-name/li/libical/package.nix b/pkgs/by-name/li/libical/package.nix index 6015ecb0a668..4bacbb14f70a 100644 --- a/pkgs/by-name/li/libical/package.nix +++ b/pkgs/by-name/li/libical/package.nix @@ -43,25 +43,24 @@ stdenv.mkDerivation (finalAttrs: { libical ]; - nativeBuildInputs = - [ - cmake - icu - ninja - perl - pkg-config - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala - # Docs building fails: - # https://github.com/NixOS/nixpkgs/pull/67204 - # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 - # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + cmake + icu + ninja + perl + pkg-config + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala + # Docs building fails: + # https://github.com/NixOS/nixpkgs/pull/67204 + # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489 + # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; nativeInstallCheckInputs = [ # running libical-glib tests (python3.pythonOnBuildForHost.withPackages ( @@ -77,15 +76,14 @@ stdenv.mkDerivation (finalAttrs: { icu ]; - cmakeFlags = - [ - "-DENABLE_GTK_DOC=False" - "-DGOBJECT_INTROSPECTION=${if withIntrospection then "True" else "False"}" - "-DICAL_GLIB_VAPI=${if withIntrospection then "True" else "False"}" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev pkgsBuildBuild.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake" - ]; + cmakeFlags = [ + "-DENABLE_GTK_DOC=False" + "-DGOBJECT_INTROSPECTION=${if withIntrospection then "True" else "False"}" + "-DICAL_GLIB_VAPI=${if withIntrospection then "True" else "False"}" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev pkgsBuildBuild.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake" + ]; patches = [ # Will appear in 3.1.0 diff --git a/pkgs/by-name/li/libieee1284/package.nix b/pkgs/by-name/li/libieee1284/package.nix index 6dc86ab3da5e..1d476916be85 100644 --- a/pkgs/by-name/li/libieee1284/package.nix +++ b/pkgs/by-name/li/libieee1284/package.nix @@ -39,16 +39,15 @@ stdenv.mkDerivation rec { docbook_xsl ]; - configureFlags = - [ - "--without-python" - ] - ++ lib.optionals (stdenv.hostPlatform.isMusl && !stdenv.hostPlatform.isx86) [ - # musl always provides , even though the functionality - # is x86-specific. - # https://www.openwall.com/lists/musl/2024/10/25/2 - "ac_cv_header_sys_io_h=no" - ]; + configureFlags = [ + "--without-python" + ] + ++ lib.optionals (stdenv.hostPlatform.isMusl && !stdenv.hostPlatform.isx86) [ + # musl always provides , even though the functionality + # is x86-specific. + # https://www.openwall.com/lists/musl/2024/10/25/2 + "ac_cv_header_sys_io_h=no" + ]; prePatch = '' ./bootstrap diff --git a/pkgs/by-name/li/libiio/package.nix b/pkgs/by-name/li/libiio/package.nix index 67c1a406d920..1c0690012b57 100644 --- a/pkgs/by-name/li/libiio/package.nix +++ b/pkgs/by-name/li/libiio/package.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation rec { "out" "lib" "dev" - ] ++ lib.optional pythonSupport "python"; + ] + ++ lib.optional pythonSupport "python"; src = fetchFromGitHub { owner = "analogdevicesinc"; @@ -39,54 +40,50 @@ stdenv.mkDerivation rec { ./cmake-fix-libxml2-find-package.patch ]; - nativeBuildInputs = + nativeBuildInputs = [ + cmake + flex + bison + pkg-config + ] + ++ lib.optionals pythonSupport ( [ - cmake - flex - bison - pkg-config + python3 ] - ++ lib.optionals pythonSupport ( - [ - python3 - ] - ++ lib.optional python3.isPy3k python3.pkgs.setuptools - ); + ++ lib.optional python3.isPy3k python3.pkgs.setuptools + ); - buildInputs = - [ - libxml2 - libusb1 - ] - ++ lib.optional avahiSupport avahi - ++ lib.optional stdenv.hostPlatform.isLinux libaio; + buildInputs = [ + libxml2 + libusb1 + ] + ++ lib.optional avahiSupport avahi + ++ lib.optional stdenv.hostPlatform.isLinux libaio; doInstallCheck = true; - cmakeFlags = - [ - "-DUDEV_RULES_INSTALL_DIR=${placeholder "out"}/lib/udev/rules.d" - # osx framework is disabled, - # the linux-like directory structure is used for proper output splitting - "-DOSX_PACKAGE=off" - "-DOSX_FRAMEWORK=off" - ] - ++ lib.optionals pythonSupport [ - "-DPython_EXECUTABLE=${python3.pythonOnBuildForHost.interpreter}" - "-DPYTHON_BINDINGS=on" - ] - ++ lib.optionals (!avahiSupport) [ - "-DHAVE_DNS_SD=OFF" - ]; + cmakeFlags = [ + "-DUDEV_RULES_INSTALL_DIR=${placeholder "out"}/lib/udev/rules.d" + # osx framework is disabled, + # the linux-like directory structure is used for proper output splitting + "-DOSX_PACKAGE=off" + "-DOSX_FRAMEWORK=off" + ] + ++ lib.optionals pythonSupport [ + "-DPython_EXECUTABLE=${python3.pythonOnBuildForHost.interpreter}" + "-DPYTHON_BINDINGS=on" + ] + ++ lib.optionals (!avahiSupport) [ + "-DHAVE_DNS_SD=OFF" + ]; - postPatch = - '' - patchShebangs libiio.rules.cmakein - '' - + lib.optionalString pythonSupport '' - # Hardcode path to the shared library into the bindings. - sed "s#@libiio@#$lib/lib/libiio${stdenv.hostPlatform.extensions.sharedLibrary}#g" ${./hardcode-library-path.patch} | patch -p1 - ''; + postPatch = '' + patchShebangs libiio.rules.cmakein + '' + + lib.optionalString pythonSupport '' + # Hardcode path to the shared library into the bindings. + sed "s#@libiio@#$lib/lib/libiio${stdenv.hostPlatform.extensions.sharedLibrary}#g" ${./hardcode-library-path.patch} | patch -p1 + ''; postInstall = lib.optionalString pythonSupport '' # Move Python bindings into a separate output. diff --git a/pkgs/by-name/li/libinfinity/package.nix b/pkgs/by-name/li/libinfinity/package.nix index dd76a585a709..f2fe5897e98f 100644 --- a/pkgs/by-name/li/libinfinity/package.nix +++ b/pkgs/by-name/li/libinfinity/package.nix @@ -48,18 +48,17 @@ let docbook_xml_dtd_412 gobject-introspection ]; - buildInputs = - [ - glib - libxml2 - gsasl - libidn - gss - libintl - libdaemon - ] - ++ lib.optional gtkWidgets gtk3 - ++ lib.optional avahiSupport avahi; + buildInputs = [ + glib + libxml2 + gsasl + libidn + gss + libintl + libdaemon + ] + ++ lib.optional gtkWidgets gtk3 + ++ lib.optional avahiSupport avahi; propagatedBuildInputs = [ gnutls ]; diff --git a/pkgs/by-name/li/libisoburn/package.nix b/pkgs/by-name/li/libisoburn/package.nix index c22954354475..b607d656f88f 100644 --- a/pkgs/by-name/li/libisoburn/package.nix +++ b/pkgs/by-name/li/libisoburn/package.nix @@ -32,20 +32,19 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - bzip2 - libcdio - libiconv - readline - zlib - libburn - libisofs - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - acl - attr - ]; + buildInputs = [ + bzip2 + libcdio + libiconv + readline + zlib + libburn + libisofs + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + acl + attr + ]; propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ acl diff --git a/pkgs/by-name/li/libjpeg_turbo/package.nix b/pkgs/by-name/li/libjpeg_turbo/package.nix index a965175ad511..1499c1378e83 100644 --- a/pkgs/by-name/li/libjpeg_turbo/package.nix +++ b/pkgs/by-name/li/libjpeg_turbo/package.nix @@ -55,34 +55,32 @@ stdenv.mkDerivation (finalAttrs: { "doc" ]; - nativeBuildInputs = - [ - cmake - nasm - ] - ++ lib.optionals enableJava [ - openjdk - ]; + nativeBuildInputs = [ + cmake + nasm + ] + ++ lib.optionals enableJava [ + openjdk + ]; - cmakeFlags = - [ - "-DENABLE_STATIC=${if enableStatic then "1" else "0"}" - "-DENABLE_SHARED=${if enableShared then "1" else "0"}" - ] - ++ lib.optionals enableJava [ - "-DWITH_JAVA=1" - ] - ++ lib.optionals enableJpeg7 [ - "-DWITH_JPEG7=1" - ] - ++ lib.optionals enableJpeg8 [ - "-DWITH_JPEG8=1" - ] - ++ lib.optionals stdenv.hostPlatform.isRiscV [ - # https://github.com/libjpeg-turbo/libjpeg-turbo/issues/428 - # https://github.com/libjpeg-turbo/libjpeg-turbo/commit/88bf1d16786c74f76f2e4f6ec2873d092f577c75 - "-DFLOATTEST=fp-contract" - ]; + cmakeFlags = [ + "-DENABLE_STATIC=${if enableStatic then "1" else "0"}" + "-DENABLE_SHARED=${if enableShared then "1" else "0"}" + ] + ++ lib.optionals enableJava [ + "-DWITH_JAVA=1" + ] + ++ lib.optionals enableJpeg7 [ + "-DWITH_JPEG7=1" + ] + ++ lib.optionals enableJpeg8 [ + "-DWITH_JPEG8=1" + ] + ++ lib.optionals stdenv.hostPlatform.isRiscV [ + # https://github.com/libjpeg-turbo/libjpeg-turbo/issues/428 + # https://github.com/libjpeg-turbo/libjpeg-turbo/commit/88bf1d16786c74f76f2e4f6ec2873d092f577c75 + "-DFLOATTEST=fp-contract" + ]; doInstallCheck = true; installCheckTarget = "test"; diff --git a/pkgs/by-name/li/libjxl/package.nix b/pkgs/by-name/li/libjxl/package.nix index 0a91d21f128e..79977aeba872 100644 --- a/pkgs/by-name/li/libjxl/package.nix +++ b/pkgs/by-name/li/libjxl/package.nix @@ -96,40 +96,39 @@ stdenv.mkDerivation rec { libhwy ]; - cmakeFlags = - [ - # For C dependencies like brotli, which are dynamically linked, - # we want to use the system libraries, so that we don't have to care about - # installing their .so files generated by this build. - # The other C++ dependencies are statically linked in, so there - # using the vendorered ones is easier. - "-DJPEGXL_FORCE_SYSTEM_BROTLI=ON" + cmakeFlags = [ + # For C dependencies like brotli, which are dynamically linked, + # we want to use the system libraries, so that we don't have to care about + # installing their .so files generated by this build. + # The other C++ dependencies are statically linked in, so there + # using the vendorered ones is easier. + "-DJPEGXL_FORCE_SYSTEM_BROTLI=ON" - # Use our version of highway, though it is still statically linked in - "-DJPEGXL_FORCE_SYSTEM_HWY=ON" + # Use our version of highway, though it is still statically linked in + "-DJPEGXL_FORCE_SYSTEM_HWY=ON" - # Use our version of gtest - "-DJPEGXL_FORCE_SYSTEM_GTEST=ON" + # Use our version of gtest + "-DJPEGXL_FORCE_SYSTEM_GTEST=ON" - "-DJPEGXL_ENABLE_SKCMS=OFF" - "-DJPEGXL_FORCE_SYSTEM_LCMS2=ON" + "-DJPEGXL_ENABLE_SKCMS=OFF" + "-DJPEGXL_FORCE_SYSTEM_LCMS2=ON" - # TODO: Update this package to enable this (overridably via an option): - # Viewer tools for evaluation. - # "-DJPEGXL_ENABLE_VIEWERS=ON" - ] - ++ lib.optionals enablePlugins [ - # Enable plugins, such as: - # * the `gdk-pixbuf` one, which allows applications like `eog` to load jpeg-xl files - # * the `gimp` one, which allows GIMP to load jpeg-xl files - "-DJPEGXL_ENABLE_PLUGINS=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "-DJPEGXL_STATIC=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - "-DJPEGXL_FORCE_NEON=ON" - ]; + # TODO: Update this package to enable this (overridably via an option): + # Viewer tools for evaluation. + # "-DJPEGXL_ENABLE_VIEWERS=ON" + ] + ++ lib.optionals enablePlugins [ + # Enable plugins, such as: + # * the `gdk-pixbuf` one, which allows applications like `eog` to load jpeg-xl files + # * the `gimp` one, which allows GIMP to load jpeg-xl files + "-DJPEGXL_ENABLE_PLUGINS=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "-DJPEGXL_STATIC=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + "-DJPEGXL_FORCE_NEON=ON" + ]; # the second substitution fix regex for a2x script # https://github.com/libjxl/libjxl/pull/3842 diff --git a/pkgs/by-name/li/libkrun/package.nix b/pkgs/by-name/li/libkrun/package.nix index 8276a93ce909..4659c00b715a 100644 --- a/pkgs/by-name/li/libkrun/package.nix +++ b/pkgs/by-name/li/libkrun/package.nix @@ -56,31 +56,30 @@ stdenv.mkDerivation (finalAttrs: { rustPlatform.bindgenHook cargo rustc - ] ++ lib.optional (sevVariant || withGpu) pkg-config; + ] + ++ lib.optional (sevVariant || withGpu) pkg-config; - buildInputs = - [ - (libkrunfw.override { inherit sevVariant; }) - glibc - glibc.static - ] - ++ lib.optionals withGpu [ - libepoxy - libdrm - virglrenderer - ] - ++ lib.optional withSound pipewire - ++ lib.optional sevVariant openssl; + buildInputs = [ + (libkrunfw.override { inherit sevVariant; }) + glibc + glibc.static + ] + ++ lib.optionals withGpu [ + libepoxy + libdrm + virglrenderer + ] + ++ lib.optional withSound pipewire + ++ lib.optional sevVariant openssl; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - ] - ++ lib.optional withBlk "BLK=1" - ++ lib.optional withGpu "GPU=1" - ++ lib.optional withSound "SND=1" - ++ lib.optional withNet "NET=1" - ++ lib.optional sevVariant "SEV=1"; + makeFlags = [ + "PREFIX=${placeholder "out"}" + ] + ++ lib.optional withBlk "BLK=1" + ++ lib.optional withGpu "GPU=1" + ++ lib.optional withSound "SND=1" + ++ lib.optional withNet "NET=1" + ++ lib.optional sevVariant "SEV=1"; postInstall = '' mkdir -p $dev/lib/pkgconfig diff --git a/pkgs/by-name/li/libkrunfw/package.nix b/pkgs/by-name/li/libkrunfw/package.nix index 9496c7cfdc7e..395d892c971e 100644 --- a/pkgs/by-name/li/libkrunfw/package.nix +++ b/pkgs/by-name/li/libkrunfw/package.nix @@ -48,13 +48,12 @@ stdenv.mkDerivation (finalAttrs: { elfutils ]; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - ] - ++ lib.optionals sevVariant [ - "SEV=1" - ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + ] + ++ lib.optionals sevVariant [ + "SEV=1" + ]; # Fixes https://github.com/containers/libkrunfw/issues/55 NIX_CFLAGS_COMPILE = lib.optionalString stdenv.targetPlatform.isAarch64 "-march=armv8-a+crypto"; diff --git a/pkgs/by-name/li/libks/package.nix b/pkgs/by-name/li/libks/package.nix index 2e71d40abf8e..ec0937c50037 100644 --- a/pkgs/by-name/li/libks/package.nix +++ b/pkgs/by-name/li/libks/package.nix @@ -37,10 +37,11 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optional stdenv.hostPlatform.isLinux libuuid - ++ lib.optional stdenv.hostPlatform.isDarwin libossp_uuid; + buildInputs = [ + openssl + ] + ++ lib.optional stdenv.hostPlatform.isLinux libuuid + ++ lib.optional stdenv.hostPlatform.isDarwin libossp_uuid; passthru = { tests.freeswitch = freeswitch; diff --git a/pkgs/by-name/li/liblangtag/package.nix b/pkgs/by-name/li/liblangtag/package.nix index 8022ca523003..63168b55d899 100644 --- a/pkgs/by-name/li/liblangtag/package.nix +++ b/pkgs/by-name/li/liblangtag/package.nix @@ -42,13 +42,12 @@ stdenv.mkDerivation rec { cp "${language_subtag_registry}" data/language-subtag-registry ''; - configureFlags = - [ - "ac_cv_va_copy=1" - ] - ++ lib.optional ( - stdenv.hostPlatform.libc == "glibc" - ) "--with-locale-alias=${stdenv.cc.libc}/share/locale/locale.alias"; + configureFlags = [ + "ac_cv_va_copy=1" + ] + ++ lib.optional ( + stdenv.hostPlatform.libc == "glibc" + ) "--with-locale-alias=${stdenv.cc.libc}/share/locale/locale.alias"; buildInputs = [ gettext diff --git a/pkgs/by-name/li/libloot/package.nix b/pkgs/by-name/li/libloot/package.nix index 97ffa6940c36..ce44dc32ef8c 100644 --- a/pkgs/by-name/li/libloot/package.nix +++ b/pkgs/by-name/li/libloot/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optionals withDocs [ "doc" ]; + ] + ++ lib.optionals withDocs [ "doc" ]; src = fetchFromGitHub { owner = "loot"; @@ -52,17 +53,16 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals withDocs [ - doxygen - python3Packages.sphinx - python3Packages.sphinx-rtd-theme - python3Packages.breathe - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals withDocs [ + doxygen + python3Packages.sphinx + python3Packages.sphinx-rtd-theme + python3Packages.breathe + ]; buildInputs = [ boost diff --git a/pkgs/by-name/li/liblouis/package.nix b/pkgs/by-name/li/liblouis/package.nix index a02dba7b18ee..584d657a5f82 100644 --- a/pkgs/by-name/li/liblouis/package.nix +++ b/pkgs/by-name/li/liblouis/package.nix @@ -16,15 +16,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "liblouis"; version = "3.33.0"; - outputs = - [ - "out" - "dev" - "info" - "doc" - ] - # configure: WARNING: cannot generate manual pages while cross compiling - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "man" ]; + outputs = [ + "out" + "dev" + "info" + "doc" + ] + # configure: WARNING: cannot generate manual pages while cross compiling + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "man" ]; src = fetchFromGitHub { owner = "liblouis"; diff --git a/pkgs/by-name/li/libmad/package.nix b/pkgs/by-name/li/libmad/package.nix index f6772748edb7..1c947bf35c5b 100644 --- a/pkgs/by-name/li/libmad/package.nix +++ b/pkgs/by-name/li/libmad/package.nix @@ -28,40 +28,39 @@ stdenv.mkDerivation rec { "dev" ]; - patches = - [ - (fetchpatch { - url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/001-mips_removal_h_constraint.patch"; - sha256 = "0layswr6qg6axf4vyz6xrv73jwga34mkma3ifk9w9vrk41454hr5"; - }) - (fetchpatch { - url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/libmad.patch"; - sha256 = "0rysq0sn3dfdz6pa6bfqkmk4ymc4rzk5ym7p16dyk37sldg1pbzs"; - }) - (fetchpatch { - url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/amd64-64bit.diff"; - sha256 = "0mx56dmkbvw3zxnqd2hjng48q0d7q7473pns4n0ksdam29b0c5ar"; - }) - (fetchpatch { - name = "CVE-2017-8372-CVE-2017-8373.patch"; - url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/102-CVE-2017-8373-CVE-2017-8372-md-size.patch"; - sha256 = "0p6mkpn66h1ds8jvww28q4vlr58jwm58m9vb7pkvvyvy764agqnk"; - }) - (fetchpatch { - name = "CVE-2017-8374.patch"; - url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/101-CVE-2017-8374-length-check.patch"; - sha256 = "1j1ssxwmx9nfahzl62frbzck93xrjc2v3w30c12vmk29iflf1890"; - }) - ] - # optimize.diff is taken from https://projects.archlinux.org/svntogit/packages.git/tree/trunk/optimize.diff?h=packages/libmad - # It is included here in order to fix a build failure in Clang - # But it may be useful to fix other, currently unknown problems as well - ++ lib.optionals stdenv.cc.isClang [ - (fetchpatch { - url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/optimize.diff"; - sha256 = "0hcxzz9ql1fizyqbsgdchdwi7bvchfr72172j43hpyj53p0yabc6"; - }) - ]; + patches = [ + (fetchpatch { + url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/001-mips_removal_h_constraint.patch"; + sha256 = "0layswr6qg6axf4vyz6xrv73jwga34mkma3ifk9w9vrk41454hr5"; + }) + (fetchpatch { + url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/libmad.patch"; + sha256 = "0rysq0sn3dfdz6pa6bfqkmk4ymc4rzk5ym7p16dyk37sldg1pbzs"; + }) + (fetchpatch { + url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/amd64-64bit.diff"; + sha256 = "0mx56dmkbvw3zxnqd2hjng48q0d7q7473pns4n0ksdam29b0c5ar"; + }) + (fetchpatch { + name = "CVE-2017-8372-CVE-2017-8373.patch"; + url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/102-CVE-2017-8373-CVE-2017-8372-md-size.patch"; + sha256 = "0p6mkpn66h1ds8jvww28q4vlr58jwm58m9vb7pkvvyvy764agqnk"; + }) + (fetchpatch { + name = "CVE-2017-8374.patch"; + url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/101-CVE-2017-8374-length-check.patch"; + sha256 = "1j1ssxwmx9nfahzl62frbzck93xrjc2v3w30c12vmk29iflf1890"; + }) + ] + # optimize.diff is taken from https://projects.archlinux.org/svntogit/packages.git/tree/trunk/optimize.diff?h=packages/libmad + # It is included here in order to fix a build failure in Clang + # But it may be useful to fix other, currently unknown problems as well + ++ lib.optionals stdenv.cc.isClang [ + (fetchpatch { + url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/optimize.diff"; + sha256 = "0hcxzz9ql1fizyqbsgdchdwi7bvchfr72172j43hpyj53p0yabc6"; + }) + ]; # The -fforce-mem flag has been removed in GCC 4.3. postPatch = '' diff --git a/pkgs/by-name/li/libmanette/package.nix b/pkgs/by-name/li/libmanette/package.nix index 54380dfcce70..4baaa27c7178 100644 --- a/pkgs/by-name/li/libmanette/package.nix +++ b/pkgs/by-name/li/libmanette/package.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optional withIntrospection "devdoc"; + ] + ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/libmanette/${lib.versions.majorMinor finalAttrs.version}/libmanette-${finalAttrs.version}.tar.xz"; @@ -38,31 +39,29 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - glib - ] - ++ lib.optionals withIntrospection [ - vala - gobject-introspection - gi-docgen - ] - ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + glib + ] + ++ lib.optionals withIntrospection [ + vala + gobject-introspection + gi-docgen + ] + ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - glib - libevdev - hidapi - ] - ++ lib.optionals withIntrospection [ - libgudev - ]; + buildInputs = [ + glib + libevdev + hidapi + ] + ++ lib.optionals withIntrospection [ + libgudev + ]; mesonFlags = [ (lib.mesonBool "doc" withIntrospection) diff --git a/pkgs/by-name/li/libmbim/package.nix b/pkgs/by-name/li/libmbim/package.nix index 8a3467f987dc..213f74d0815e 100644 --- a/pkgs/by-name/li/libmbim/package.nix +++ b/pkgs/by-name/li/libmbim/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optionals withDocs [ "man" ]; + ] + ++ lib.optionals withDocs [ "man" ]; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; @@ -43,19 +44,18 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - ] - ++ lib.optionals withDocs [ - help2man - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + ] + ++ lib.optionals withDocs [ + help2man + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; buildInputs = [ glib diff --git a/pkgs/by-name/li/libmediaart/package.nix b/pkgs/by-name/li/libmediaart/package.nix index 7d04fbe91941..24013758b159 100644 --- a/pkgs/by-name/li/libmediaart/package.nix +++ b/pkgs/by-name/li/libmediaart/package.nix @@ -31,20 +31,19 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "K0Pdn1Tw2NC4nirduDNBqwbXuYyxsucEODWEr5xWD2s="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - vala - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_412 - gobject-introspection - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + vala + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_412 + gobject-introspection + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/li/libmediainfo/package.nix b/pkgs/by-name/li/libmediainfo/package.nix index cb70032493cb..dd380cad4b51 100644 --- a/pkgs/by-name/li/libmediainfo/package.nix +++ b/pkgs/by-name/li/libmediainfo/package.nix @@ -35,13 +35,12 @@ stdenv.mkDerivation rec { --replace "pkg-config " "${stdenv.cc.targetPrefix}pkg-config " ''; - configureFlags = - [ - "--enable-shared" - ] - ++ lib.optionals curlSupport [ - "--with-libcurl" - ]; + configureFlags = [ + "--enable-shared" + ] + ++ lib.optionals curlSupport [ + "--with-libcurl" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/li/libmpdclient/package.nix b/pkgs/by-name/li/libmpdclient/package.nix index fcc8c2636a47..6fe5ca48bb35 100644 --- a/pkgs/by-name/li/libmpdclient/package.nix +++ b/pkgs/by-name/li/libmpdclient/package.nix @@ -18,14 +18,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-KF8IR9YV6b9ro+L9m6nHs1IggakEZddfcBKm/oKCVZY="; }; - nativeBuildInputs = - [ - meson - ninja - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + meson + ninja + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; meta = { description = "Client library for MPD (music player daemon)"; diff --git a/pkgs/by-name/li/libmsquic/package.nix b/pkgs/by-name/li/libmsquic/package.nix index cdaea8883174..b7e71ff3bd20 100644 --- a/pkgs/by-name/li/libmsquic/package.nix +++ b/pkgs/by-name/li/libmsquic/package.nix @@ -26,13 +26,12 @@ stdenv.mkDerivation (finalAttrs: { perl ]; - buildInputs = - [ - libatomic_ops - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - lttng-tools - ]; + buildInputs = [ + libatomic_ops + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + lttng-tools + ]; postUnpack = '' for f in "$(find . -type f -name "*.pl")"; do diff --git a/pkgs/by-name/li/libnbd/package.nix b/pkgs/by-name/li/libnbd/package.nix index ce86d89eaa20..55fca95e0493 100644 --- a/pkgs/by-name/li/libnbd/package.nix +++ b/pkgs/by-name/li/libnbd/package.nix @@ -29,21 +29,20 @@ lib.throwIf (buildOcamlBindings && !lib.versionAtLeast ocamlPackages.ocaml.versi hash = "sha256-9oVJrU2YcXGnKaDf8SoHKGtG7vpH5355/DKIiYrchHI="; }; - nativeBuildInputs = + nativeBuildInputs = [ + bash-completion + pkg-config + perl + autoreconfHook + ] + ++ lib.optionals buildPythonBindings [ python3 ] + ++ lib.optionals buildOcamlBindings ( + with ocamlPackages; [ - bash-completion - pkg-config - perl - autoreconfHook + findlib + ocaml ] - ++ lib.optionals buildPythonBindings [ python3 ] - ++ lib.optionals buildOcamlBindings ( - with ocamlPackages; - [ - findlib - ocaml - ] - ); + ); buildInputs = [ fuse diff --git a/pkgs/by-name/li/libnfc-nci/package.nix b/pkgs/by-name/li/libnfc-nci/package.nix index 55e98b1f9be9..041b7f5362f1 100644 --- a/pkgs/by-name/li/libnfc-nci/package.nix +++ b/pkgs/by-name/li/libnfc-nci/package.nix @@ -24,13 +24,12 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook ]; - configureFlags = - [ - "--enable-i2c" - ] - ++ lib.optionals debug [ - "--enable-debug" - ]; + configureFlags = [ + "--enable-i2c" + ] + ++ lib.optionals debug [ + "--enable-debug" + ]; dontStrip = debug; postInstall = '' diff --git a/pkgs/by-name/li/libngspice/package.nix b/pkgs/by-name/li/libngspice/package.nix index 58ccd41a8cb9..f29591ed0c23 100644 --- a/pkgs/by-name/li/libngspice/package.nix +++ b/pkgs/by-name/li/libngspice/package.nix @@ -26,18 +26,17 @@ stdenv.mkDerivation rec { bison ]; - buildInputs = - [ - fftw - readline - ] - ++ lib.optionals (!withNgshared) [ - libXaw - libXext - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages.openmp - ]; + buildInputs = [ + fftw + readline + ] + ++ lib.optionals (!withNgshared) [ + libXaw + libXext + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp + ]; configureFlags = lib.optionals withNgshared [ diff --git a/pkgs/by-name/li/libnice/package.nix b/pkgs/by-name/li/libnice/package.nix index cdb839c464b0..6d2361b25d2e 100644 --- a/pkgs/by-name/li/libnice/package.nix +++ b/pkgs/by-name/li/libnice/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation (finalAttrs: { "bin" "out" "dev" - ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "https://libnice.freedesktop.org/releases/libnice-${finalAttrs.version}.tar.gz"; diff --git a/pkgs/by-name/li/libnick/package.nix b/pkgs/by-name/li/libnick/package.nix index e3f3c187ff0b..e3830e273ad6 100644 --- a/pkgs/by-name/li/libnick/package.nix +++ b/pkgs/by-name/li/libnick/package.nix @@ -28,26 +28,24 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-Ir2Jke1zK4pKldQJHaT0Ju0ubz7H6nx16hDNl6u48Ck="; }; - nativeBuildInputs = - [ - cmake - ninja - ] - ++ lib.optionals stdenv.hostPlatform.isUnix [ - pkg-config - validatePkgConfig - ]; + nativeBuildInputs = [ + cmake + ninja + ] + ++ lib.optionals stdenv.hostPlatform.isUnix [ + pkg-config + validatePkgConfig + ]; - buildInputs = - [ - boost - libmaddy-markdown - ] - ++ lib.optionals stdenv.hostPlatform.isUnix [ - glib - openssl - ] - ++ lib.optional stdenv.hostPlatform.isWindows sqlcipher; + buildInputs = [ + boost + libmaddy-markdown + ] + ++ lib.optionals stdenv.hostPlatform.isUnix [ + glib + openssl + ] + ++ lib.optional stdenv.hostPlatform.isWindows sqlcipher; propagatedBuildInputs = [ curl diff --git a/pkgs/by-name/li/libnl/package.nix b/pkgs/by-name/li/libnl/package.nix index 0b579b88f7fe..2038f109726f 100644 --- a/pkgs/by-name/li/libnl/package.nix +++ b/pkgs/by-name/li/libnl/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { "dev" "out" "man" - ] ++ lib.optional pythonSupport "py"; + ] + ++ lib.optional pythonSupport "py"; enableParallelBuilding = true; @@ -48,7 +49,8 @@ stdenv.mkDerivation rec { mscgen asciidoc sourceHighlight - ] ++ lib.optional pythonSupport swig; + ] + ++ lib.optional pythonSupport swig; postBuild = lib.optionalString (pythonSupport) '' cd python diff --git a/pkgs/by-name/li/libnma/package.nix b/pkgs/by-name/li/libnma/package.nix index 9fdf26c82626..ddd16147d587 100644 --- a/pkgs/by-name/li/libnma/package.nix +++ b/pkgs/by-name/li/libnma/package.nix @@ -47,37 +47,35 @@ stdenv.mkDerivation rec { ./hardcode-gsettings.patch ]; - nativeBuildInputs = - [ - meson - ninja - gettext - pkg-config - gobject-introspection - gtk-doc - docbook_xsl - docbook_xml_dtd_43 - libxml2 - vala - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + gobject-introspection + gtk-doc + docbook_xsl + docbook_xml_dtd_43 + libxml2 + vala + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - gtk3 - networkmanager - isocodes - mobile-broadband-provider-info - ] - ++ lib.optionals withGtk4 [ - gtk4 - ] - ++ lib.optionals withGnome [ - # advanced certificate chooser - gcr_4 - ]; + buildInputs = [ + gtk3 + networkmanager + isocodes + mobile-broadband-provider-info + ] + ++ lib.optionals withGtk4 [ + gtk4 + ] + ++ lib.optionals withGnome [ + # advanced certificate chooser + gcr_4 + ]; mesonFlags = [ "-Dgcr=${lib.boolToString withGnome}" diff --git a/pkgs/by-name/li/libnotify/package.nix b/pkgs/by-name/li/libnotify/package.nix index 8911bb208812..8345b27ae222 100644 --- a/pkgs/by-name/li/libnotify/package.nix +++ b/pkgs/by-name/li/libnotify/package.nix @@ -42,18 +42,17 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - libxslt - docbook-xsl-ns - glib # for glib-mkenums needed during the build - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + libxslt + docbook-xsl-ns + glib # for glib-mkenums needed during the build + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; propagatedBuildInputs = [ gdk-pixbuf diff --git a/pkgs/by-name/li/libofx/package.nix b/pkgs/by-name/li/libofx/package.nix index e305e6e66a32..7511ea6b63da 100644 --- a/pkgs/by-name/li/libofx/package.nix +++ b/pkgs/by-name/li/libofx/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { opensp libxml2 curl - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; meta = { description = "Opensource implementation of the Open Financial eXchange specification"; diff --git a/pkgs/by-name/li/libopenglrecorder/package.nix b/pkgs/by-name/li/libopenglrecorder/package.nix index fd33a57d9103..cf9cd8cd224e 100644 --- a/pkgs/by-name/li/libopenglrecorder/package.nix +++ b/pkgs/by-name/li/libopenglrecorder/package.nix @@ -28,16 +28,15 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - libjpeg - libvpx - openh264 - ] - ++ lib.optionals withPulse [ - libpulseaudio - libvorbis - ]; + buildInputs = [ + libjpeg + libvpx + openh264 + ] + ++ lib.optionals withPulse [ + libpulseaudio + libvorbis + ]; meta = with lib; { description = "Library allowing Optional async readback OpenGL frame buffer with optional audio recording"; diff --git a/pkgs/by-name/li/libopenmpt/package.nix b/pkgs/by-name/li/libopenmpt/package.nix index 2098ceb2cfa8..12a8f08529cb 100644 --- a/pkgs/by-name/li/libopenmpt/package.nix +++ b/pkgs/by-name/li/libopenmpt/package.nix @@ -36,19 +36,18 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - zlib - mpg123 - libogg - libvorbis - portaudio - libsndfile - flac - ] - ++ lib.optionals usePulseAudio [ - libpulseaudio - ]; + buildInputs = [ + zlib + mpg123 + libogg + libvorbis + portaudio + libsndfile + flac + ] + ++ lib.optionals usePulseAudio [ + libpulseaudio + ]; configureFlags = [ (lib.strings.withFeature usePulseAudio "pulseaudio") diff --git a/pkgs/by-name/li/liboping/package.nix b/pkgs/by-name/li/liboping/package.nix index 92e3666dbb4b..9b3924158aea 100644 --- a/pkgs/by-name/li/liboping/package.nix +++ b/pkgs/by-name/li/liboping/package.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "ac_cv_func_malloc_0_nonnull=yes" - ] ++ lib.optional (perl == null) "--with-perl-bindings=no"; + ] + ++ lib.optional (perl == null) "--with-perl-bindings=no"; buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" diff --git a/pkgs/by-name/li/liborcus/package.nix b/pkgs/by-name/li/liborcus/package.nix index d50b469fc91e..e354a4c514ce 100644 --- a/pkgs/by-name/li/liborcus/package.nix +++ b/pkgs/by-name/li/liborcus/package.nix @@ -36,20 +36,19 @@ stdenv.mkDerivation rec { zlib ]; - preCheck = - '' - patchShebangs test/python - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}${ - lib.concatMapStringsSep ":" (d: "$(pwd)/src/${d}/.libs") [ - "liborcus" - "parser" - "python" - "spreadsheet" - ] - } - ''; + preCheck = '' + patchShebangs test/python + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}${ + lib.concatMapStringsSep ":" (d: "$(pwd)/src/${d}/.libs") [ + "liborcus" + "parser" + "python" + "spreadsheet" + ] + } + ''; strictDeps = true; doCheck = true; diff --git a/pkgs/by-name/li/libosinfo/package.nix b/pkgs/by-name/li/libosinfo/package.nix index ad90ba535c3b..1c9b9b44a8e0 100644 --- a/pkgs/by-name/li/libosinfo/package.nix +++ b/pkgs/by-name/li/libosinfo/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc"; + ] + ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc"; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/li/libossp_uuid/package.nix b/pkgs/by-name/li/libossp_uuid/package.nix index 57078f4741eb..a0ed6e50b467 100644 --- a/pkgs/by-name/li/libossp_uuid/package.nix +++ b/pkgs/by-name/li/libossp_uuid/package.nix @@ -15,7 +15,8 @@ stdenv.mkDerivation rec { configureFlags = [ "ac_cv_va_copy=C99" - ] ++ lib.optional stdenv.hostPlatform.isFreeBSD "--with-pic"; + ] + ++ lib.optional stdenv.hostPlatform.isFreeBSD "--with-pic"; patches = [ ./shtool.patch ]; diff --git a/pkgs/by-name/li/libpcap/package.nix b/pkgs/by-name/li/libpcap/package.nix index 72996ff96cef..1e77e3388084 100644 --- a/pkgs/by-name/li/libpcap/package.nix +++ b/pkgs/by-name/li/libpcap/package.nix @@ -32,30 +32,27 @@ stdenv.mkDerivation rec { }; buildInputs = - lib.optionals stdenv.hostPlatform.isLinux [ libnl ] - ++ lib.optionals withRemote [ libxcrypt ]; + lib.optionals stdenv.hostPlatform.isLinux [ libnl ] ++ lib.optionals withRemote [ libxcrypt ]; - nativeBuildInputs = - [ - flex - bison - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ] - ++ lib.optionals withBluez [ bluez.dev ]; + nativeBuildInputs = [ + flex + bison + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ] + ++ lib.optionals withBluez [ bluez.dev ]; # We need to force the autodetection because detection doesn't # work in pure build environments. - configureFlags = - [ - "--with-pcap=${if stdenv.hostPlatform.isLinux then "linux" else "bpf"}" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--disable-universal" - ] - ++ lib.optionals withRemote [ - "--enable-remote" - ] - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "ac_cv_linux_vers=2" ]; + configureFlags = [ + "--with-pcap=${if stdenv.hostPlatform.isLinux then "linux" else "bpf"}" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--disable-universal" + ] + ++ lib.optionals withRemote [ + "--enable-remote" + ] + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "ac_cv_linux_vers=2" ]; postInstall = '' if [ "$dontDisableStatic" -ne "1" ]; then diff --git a/pkgs/by-name/li/libpciaccess/package.nix b/pkgs/by-name/li/libpciaccess/package.nix index e18595b1caf2..2815baac2da5 100644 --- a/pkgs/by-name/li/libpciaccess/package.nix +++ b/pkgs/by-name/li/libpciaccess/package.nix @@ -29,12 +29,13 @@ stdenv.mkDerivation (finalAttrs: { ninja ]; - buildInputs = - [ zlib ] - ++ lib.optionals stdenv.hostPlatform.isNetBSD [ - netbsd.libarch - netbsd.libpci - ]; + buildInputs = [ + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isNetBSD [ + netbsd.libarch + netbsd.libpci + ]; mesonFlags = [ (lib.mesonOption "pci-ids" "${hwdata}/share/hwdata") diff --git a/pkgs/by-name/li/libpkgconf/package.nix b/pkgs/by-name/li/libpkgconf/package.nix index bbda6d817ebe..707a4234cc1a 100644 --- a/pkgs/by-name/li/libpkgconf/package.nix +++ b/pkgs/by-name/li/libpkgconf/package.nix @@ -30,24 +30,23 @@ stdenv.mkDerivation (finalAttrs: { # Debian has outputs like these too # (https://packages.debian.org/source/bullseye/pkgconf), so it is safe to # remove those references - postFixup = - '' - remove-references-to \ - -t "${placeholder "out"}" \ - "${placeholder "lib"}"/lib/* - remove-references-to \ - -t "${placeholder "dev"}" \ - "${placeholder "lib"}"/lib/* \ - "${placeholder "out"}"/bin/* - '' - # Move back share/aclocal. Yes, this normally goes in the dev output for good - # reason, but in this case the dev output is for the `libpkgconf` library, - # while the aclocal stuff is for the tool. The tool is already for use during - # development, so there is no reason to have separate "dev-bin" and "dev-lib" - # outputs or something. - + '' - mv ${placeholder "dev"}/share ${placeholder "out"} - ''; + postFixup = '' + remove-references-to \ + -t "${placeholder "out"}" \ + "${placeholder "lib"}"/lib/* + remove-references-to \ + -t "${placeholder "dev"}" \ + "${placeholder "lib"}"/lib/* \ + "${placeholder "out"}"/bin/* + '' + # Move back share/aclocal. Yes, this normally goes in the dev output for good + # reason, but in this case the dev output is for the `libpkgconf` library, + # while the aclocal stuff is for the tool. The tool is already for use during + # development, so there is no reason to have separate "dev-bin" and "dev-lib" + # outputs or something. + + '' + mv ${placeholder "dev"}/share ${placeholder "out"} + ''; passthru.updateScript = gitUpdater { url = "https://gitea.treehouse.systems/ariadne/pkgconf"; diff --git a/pkgs/by-name/li/libplacebo/package.nix b/pkgs/by-name/li/libplacebo/package.nix index 82bb4c3c6e6a..6960879bdc8a 100644 --- a/pkgs/by-name/li/libplacebo/package.nix +++ b/pkgs/by-name/li/libplacebo/package.nix @@ -39,35 +39,33 @@ stdenv.mkDerivation rec { python3Packages.glad2 ]; - buildInputs = - [ - shaderc - lcms2 - libGL - libX11 - libunwind - libdovi - xxHash - vulkan-headers - ] - ++ lib.optionals vulkanSupport [ - vulkan-loader - ] - ++ lib.optionals (!stdenv.cc.isGNU) [ - fast-float - ]; + buildInputs = [ + shaderc + lcms2 + libGL + libX11 + libunwind + libdovi + xxHash + vulkan-headers + ] + ++ lib.optionals vulkanSupport [ + vulkan-loader + ] + ++ lib.optionals (!stdenv.cc.isGNU) [ + fast-float + ]; - mesonFlags = - [ - (lib.mesonBool "demos" false) # Don't build and install the demo programs - (lib.mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer - (lib.mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead - (lib.mesonEnable "vk-proc-addr" vulkanSupport) - (lib.mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` - ]; + mesonFlags = [ + (lib.mesonBool "demos" false) # Don't build and install the demo programs + (lib.mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer + (lib.mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead + (lib.mesonEnable "vk-proc-addr" vulkanSupport) + (lib.mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` + ]; postPatch = '' substituteInPlace meson.build \ diff --git a/pkgs/by-name/li/libplacebo_5/package.nix b/pkgs/by-name/li/libplacebo_5/package.nix index a4e5cb5e1c51..9691db7ca0ef 100644 --- a/pkgs/by-name/li/libplacebo_5/package.nix +++ b/pkgs/by-name/li/libplacebo_5/package.nix @@ -47,16 +47,15 @@ stdenv.mkDerivation rec { libdovi ]; - mesonFlags = - [ - (lib.mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") - (lib.mesonBool "demos" false) # Don't build and install the demo programs - (lib.mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer - (lib.mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` - ]; + mesonFlags = [ + (lib.mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") + (lib.mesonBool "demos" false) # Don't build and install the demo programs + (lib.mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer + (lib.mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` + ]; postPatch = '' substituteInPlace meson.build \ diff --git a/pkgs/by-name/li/libplist/package.nix b/pkgs/by-name/li/libplist/package.nix index f85a8ac73398..c8e553ef514e 100644 --- a/pkgs/by-name/li/libplist/package.nix +++ b/pkgs/by-name/li/libplist/package.nix @@ -17,7 +17,8 @@ stdenv.mkDerivation rec { "bin" "dev" "out" - ] ++ lib.optional enablePython "py"; + ] + ++ lib.optional enablePython "py"; src = fetchFromGitHub { owner = "libimobiledevice"; @@ -40,13 +41,12 @@ stdenv.mkDerivation rec { export RELEASE_VERSION=${version} ''; - configureFlags = - [ - "--enable-debug" - ] - ++ lib.optionals (!enablePython) [ - "--without-cython" - ]; + configureFlags = [ + "--enable-debug" + ] + ++ lib.optionals (!enablePython) [ + "--without-cython" + ]; doCheck = true; diff --git a/pkgs/by-name/li/libportal/package.nix b/pkgs/by-name/li/libportal/package.nix index d796d55cf600..86f9068dc88d 100644 --- a/pkgs/by-name/li/libportal/package.nix +++ b/pkgs/by-name/li/libportal/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional (variant != "qt5") "devdoc"; + ] + ++ lib.optional (variant != "qt5") "devdoc"; src = fetchFromGitHub { owner = "flatpak"; @@ -39,35 +40,33 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gi-docgen - ] - ++ lib.optionals (variant != "qt5") [ - gobject-introspection - vala - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gi-docgen + ] + ++ lib.optionals (variant != "qt5") [ + gobject-introspection + vala + ]; - propagatedBuildInputs = - [ - glib - ] - ++ lib.optionals (variant == "gtk3") [ - gtk3 - ] - ++ lib.optionals (variant == "gtk4") [ - gtk4 - ] - ++ lib.optionals (variant == "qt5") [ - libsForQt5.qtbase - libsForQt5.qtx11extras - ] - ++ lib.optionals (variant == "qt6") [ - qt6Packages.qtbase - ]; + propagatedBuildInputs = [ + glib + ] + ++ lib.optionals (variant == "gtk3") [ + gtk3 + ] + ++ lib.optionals (variant == "gtk4") [ + gtk4 + ] + ++ lib.optionals (variant == "qt5") [ + libsForQt5.qtbase + libsForQt5.qtx11extras + ] + ++ lib.optionals (variant == "qt6") [ + qt6Packages.qtbase + ]; mesonFlags = [ (lib.mesonEnable "backend-gtk3" (variant == "gtk3")) diff --git a/pkgs/by-name/li/libpostal/package.nix b/pkgs/by-name/li/libpostal/package.nix index 112054168dc1..517960dff51e 100644 --- a/pkgs/by-name/li/libpostal/package.nix +++ b/pkgs/by-name/li/libpostal/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-data-download" - ] ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "--disable-sse2" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "--disable-sse2" ]; env = { NIX_CFLAGS_COMPILE = "-Wno-incompatible-pointer-types"; diff --git a/pkgs/by-name/li/libproxy/package.nix b/pkgs/by-name/li/libproxy/package.nix index 191a7d484d69..8118ea54d198 100644 --- a/pkgs/by-name/li/libproxy/package.nix +++ b/pkgs/by-name/li/libproxy/package.nix @@ -26,14 +26,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "libproxy"; version = "0.5.9"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withIntrospection [ - "devdoc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withIntrospection [ + "devdoc" + ]; src = fetchFromGitHub { owner = "libproxy"; @@ -42,20 +41,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-Z70TjLk5zulyYMAK+uMDhpsdvLa6m25pY8jahUA6ASE="; }; - patches = - [ - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # Disable schema presence detection, it would fail because it cannot be autopatched, - # and it will be hardcoded by the next patch anyway. - ./skip-gsettings-detection.patch + patches = [ + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # Disable schema presence detection, it would fail because it cannot be autopatched, + # and it will be hardcoded by the next patch anyway. + ./skip-gsettings-detection.patch - # Hardcode path to Settings schemas for GNOME & related desktops. - # Otherwise every app using libproxy would need to be wrapped individually. - (replaceVars ./hardcode-gsettings.patch { - gds = glib.getSchemaPath gsettings-desktop-schemas; - }) - ]; + # Hardcode path to Settings schemas for GNOME & related desktops. + # Otherwise every app using libproxy would need to be wrapped individually. + (replaceVars ./hardcode-gsettings.patch { + gds = glib.getSchemaPath gsettings-desktop-schemas; + }) + ]; postPatch = '' # Fix running script that will try to install git hooks. @@ -70,38 +68,35 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "requires_private: 'gobject-2.0'" "requires: 'gobject-2.0'" ''; - nativeBuildInputs = - [ - meson - ninja - pkg-config - ] - ++ lib.optionals withIntrospection [ - gi-docgen - gobject-introspection - vala - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + ] + ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection + vala + ]; - buildInputs = - [ - curl - duktape - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - glib - gsettings-desktop-schemas - ]; + buildInputs = [ + curl + duktape + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + glib + gsettings-desktop-schemas + ]; - mesonFlags = - [ - # Prevent installing commit hook. - "-Drelease=true" - (lib.mesonBool "docs" withIntrospection) - (lib.mesonBool "introspection" withIntrospection) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-Dconfig-gnome=false" - ]; + mesonFlags = [ + # Prevent installing commit hook. + "-Drelease=true" + (lib.mesonBool "docs" withIntrospection) + (lib.mesonBool "introspection" withIntrospection) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-Dconfig-gnome=false" + ]; doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/by-name/li/libpwquality/package.nix b/pkgs/by-name/li/libpwquality/package.nix index 525738a09896..6cb79b823a18 100644 --- a/pkgs/by-name/li/libpwquality/package.nix +++ b/pkgs/by-name/li/libpwquality/package.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation rec { "dev" "lib" "man" - ] ++ lib.optionals enablePython [ "py" ]; + ] + ++ lib.optionals enablePython [ "py" ]; src = fetchFromGitHub { owner = "libpwquality"; @@ -67,7 +68,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook perl - ] ++ lib.optionals enablePython [ (python3.withPackages (ps: with ps; [ setuptools ])) ]; + ] + ++ lib.optionals enablePython [ (python3.withPackages (ps: with ps; [ setuptools ])) ]; buildInputs = [ cracklib ] ++ lib.optionals enablePAM [ pam ]; configureFlags = diff --git a/pkgs/by-name/li/libqmi/package.nix b/pkgs/by-name/li/libqmi/package.nix index b57bba62a4b2..6508bbc1f663 100644 --- a/pkgs/by-name/li/libqmi/package.nix +++ b/pkgs/by-name/li/libqmi/package.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional withIntrospection "devdoc"; + ] + ++ lib.optional withIntrospection "devdoc"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; @@ -41,42 +42,39 @@ stdenv.mkDerivation rec { hash = "sha256-cGNnw0vO/Hr9o/eIf6lLTsoGiEkTvZiArgO7tAc208U="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - ] - ++ lib.optionals withMan [ - help2man - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - ] - ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + ] + ++ lib.optionals withMan [ + help2man + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 + ] + ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - bash-completion - libmbim - ] - ++ lib.optionals withIntrospection [ - libgudev - ]; + buildInputs = [ + bash-completion + libmbim + ] + ++ lib.optionals withIntrospection [ + libgudev + ]; - propagatedBuildInputs = - [ - glib - ] - ++ lib.optionals withIntrospection [ - libqrtr-glib - ]; + propagatedBuildInputs = [ + glib + ] + ++ lib.optionals withIntrospection [ + libqrtr-glib + ]; mesonFlags = [ "-Dudevdir=${placeholder "out"}/lib/udev" diff --git a/pkgs/by-name/li/libqrtr-glib/package.nix b/pkgs/by-name/li/libqrtr-glib/package.nix index 1d0eec5c17dc..887ffbac429e 100644 --- a/pkgs/by-name/li/libqrtr-glib/package.nix +++ b/pkgs/by-name/li/libqrtr-glib/package.nix @@ -37,19 +37,18 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_43 - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_43 + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/li/librandombytes/package.nix b/pkgs/by-name/li/librandombytes/package.nix index cb19ead59257..9850c011d244 100644 --- a/pkgs/by-name/li/librandombytes/package.nix +++ b/pkgs/by-name/li/librandombytes/package.nix @@ -85,6 +85,7 @@ stdenv.mkDerivation (finalAttrs: { "riscv64-linux" "s390x-linux" # Upstream package supports sparc, but nix does not - ] ++ lib.platforms.darwin; # Work on MacOS X mentioned: https://randombytes.cr.yp.to/download.html + ] + ++ lib.platforms.darwin; # Work on MacOS X mentioned: https://randombytes.cr.yp.to/download.html }; }) diff --git a/pkgs/by-name/li/librashader/package.nix b/pkgs/by-name/li/librashader/package.nix index cdb4fa85d3de..964068966ade 100644 --- a/pkgs/by-name/li/librashader/package.nix +++ b/pkgs/by-name/li/librashader/package.nix @@ -32,30 +32,29 @@ rustPlatform.buildRustPackage (finalAttrs: { doCheck = false; - installPhase = - '' - runHook preInstall - cd target/optimized - mkdir -p $out/lib $out/include/librashader - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - install_name_tool -id $out/lib/librashader.dylib librashader.dylib - install -m755 librashader.dylib $out/lib/librashader.dylib - '' - else - '' - patchelf --set-soname librashader.so.2 librashader.so - install -m755 librashader.so $out/lib/librashader.so.2 - ln -s $out/lib/librashader.so.2 $out/lib/librashader.so - '' - ) - + '' - install -m644 ../../include/librashader.h -t $out/include/librashader - install -m644 ../../include/librashader_ld.h -t $out/include/librashader - runHook postInstall - ''; + installPhase = '' + runHook preInstall + cd target/optimized + mkdir -p $out/lib $out/include/librashader + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + install_name_tool -id $out/lib/librashader.dylib librashader.dylib + install -m755 librashader.dylib $out/lib/librashader.dylib + '' + else + '' + patchelf --set-soname librashader.so.2 librashader.so + install -m755 librashader.so $out/lib/librashader.so.2 + ln -s $out/lib/librashader.so.2 $out/lib/librashader.so + '' + ) + + '' + install -m644 ../../include/librashader.h -t $out/include/librashader + install -m644 ../../include/librashader_ld.h -t $out/include/librashader + runHook postInstall + ''; passthru.updateScript = nix-update-script { extraArgs = [ diff --git a/pkgs/by-name/li/libre/package.nix b/pkgs/by-name/li/libre/package.nix index 97749fc5ea0b..1058fe8b16d1 100644 --- a/pkgs/by-name/li/libre/package.nix +++ b/pkgs/by-name/li/libre/package.nix @@ -23,14 +23,13 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ cmake ]; - makeFlags = - [ - "USE_ZLIB=1" - "USE_OPENSSL=1" - "PREFIX=$(out)" - ] - ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}" - ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"; + makeFlags = [ + "USE_ZLIB=1" + "USE_OPENSSL=1" + "PREFIX=$(out)" + ] + ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}" + ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"; enableParallelBuilding = true; meta = { description = "Library for real-time communications with async IO support and a complete SIP stack"; diff --git a/pkgs/by-name/li/libredirect/package.nix b/pkgs/by-name/li/libredirect/package.nix index d700a9afca70..fe76b3d1f2c8 100644 --- a/pkgs/by-name/li/libredirect/package.nix +++ b/pkgs/by-name/li/libredirect/package.nix @@ -87,38 +87,37 @@ else # existing ones do not have the intended effect. dontStrip = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - install -vD "$libName" "$out/lib/$libName" + install -vD "$libName" "$out/lib/$libName" - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' - # dylib will be rejected unless dylib rpath gets explicitly set - install_name_tool \ - -change $libName $out/lib/$libName \ - $out/lib/$libName - '' - + '' - # Provide a setup hook that injects our library into every process. - mkdir -p "$hook/nix-support" - cat < "$hook/nix-support/setup-hook" - echo "Setting up libredirect" - ${ - if stdenv.hostPlatform.isDarwin then - '' - export DYLD_INSERT_LIBRARIES="$out/lib/$libName" - '' - else - '' - export LD_PRELOAD="$out/lib/$libName" - '' - } - SETUP_HOOK + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + # dylib will be rejected unless dylib rpath gets explicitly set + install_name_tool \ + -change $libName $out/lib/$libName \ + $out/lib/$libName + '' + + '' + # Provide a setup hook that injects our library into every process. + mkdir -p "$hook/nix-support" + cat < "$hook/nix-support/setup-hook" + echo "Setting up libredirect" + ${ + if stdenv.hostPlatform.isDarwin then + '' + export DYLD_INSERT_LIBRARIES="$out/lib/$libName" + '' + else + '' + export LD_PRELOAD="$out/lib/$libName" + '' + } + SETUP_HOOK - runHook postInstall - ''; + runHook postInstall + ''; doInstallCheck = true; diff --git a/pkgs/by-name/li/libredwg/package.nix b/pkgs/by-name/li/libredwg/package.nix index ce2cd032d0c7..a9853d3a5faa 100644 --- a/pkgs/by-name/li/libredwg/package.nix +++ b/pkgs/by-name/li/libredwg/package.nix @@ -48,13 +48,15 @@ stdenv.mkDerivation rec { autoreconfHook pkg-config texinfo - ] ++ lib.optional enablePython swig; + ] + ++ lib.optional enablePython swig; - buildInputs = - [ pcre2 ] - ++ lib.optionals enablePython [ python ] - # configurePhase fails with python 3 when ncurses is missing - ++ lib.optional isPython3 ncurses; + buildInputs = [ + pcre2 + ] + ++ lib.optionals enablePython [ python ] + # configurePhase fails with python 3 when ncurses is missing + ++ lib.optional isPython3 ncurses; # prevent python tests from running when not building with python configureFlags = lib.optional (!enablePython) "--disable-python"; diff --git a/pkgs/by-name/li/librem/package.nix b/pkgs/by-name/li/librem/package.nix index 8d75bb111661..a39f5301cd05 100644 --- a/pkgs/by-name/li/librem/package.nix +++ b/pkgs/by-name/li/librem/package.nix @@ -26,14 +26,13 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DRE_INCLUDE_DIR=${libre}/include/re" ]; - makeFlags = - [ - "LIBRE_MK=${libre}/share/re/re.mk" - "PREFIX=$(out)" - "AR=${stdenv.cc.targetPrefix}ar" - ] - ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${lib.getDev stdenv.cc.cc}" - ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"; + makeFlags = [ + "LIBRE_MK=${libre}/share/re/re.mk" + "PREFIX=$(out)" + "AR=${stdenv.cc.targetPrefix}ar" + ] + ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${lib.getDev stdenv.cc.cc}" + ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"; enableParallelBuilding = true; meta = { description = "Library for real-time audio and video processing"; diff --git a/pkgs/by-name/li/libremines/package.nix b/pkgs/by-name/li/libremines/package.nix index 2023e5ca9e01..3485b8394677 100644 --- a/pkgs/by-name/li/libremines/package.nix +++ b/pkgs/by-name/li/libremines/package.nix @@ -23,13 +23,12 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook ]; - buildInputs = - [ - qt6Packages.qtmultimedia - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6Packages.qtwayland - ]; + buildInputs = [ + qt6Packages.qtmultimedia + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6Packages.qtwayland + ]; cmakeFlags = [ "-DUSE_QT6=TRUE" ]; diff --git a/pkgs/by-name/li/libresample/package.nix b/pkgs/by-name/li/libresample/package.nix index 2b8f3b2cd5a3..aa2b60d84175 100644 --- a/pkgs/by-name/li/libresample/package.nix +++ b/pkgs/by-name/li/libresample/package.nix @@ -38,15 +38,14 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - # For `resample-sndfile` - libsndfile - ] - ++ lib.optionals (!libsamplerate.meta.broken) [ - # For `compareresample` - libsamplerate - ]; + buildInputs = [ + # For `resample-sndfile` + libsndfile + ] + ++ lib.optionals (!libsamplerate.meta.broken) [ + # For `compareresample` + libsamplerate + ]; mesonFlags = [ (lib.mesonEnable "compareresample" (!libsamplerate.meta.broken)) ]; diff --git a/pkgs/by-name/li/libresprite/package.nix b/pkgs/by-name/li/libresprite/package.nix index eb3ed3e133d7..bec2bcf0549f 100644 --- a/pkgs/by-name/li/libresprite/package.nix +++ b/pkgs/by-name/li/libresprite/package.nix @@ -46,27 +46,26 @@ stdenv.mkDerivation (finalAttrs: { gtest ]; - buildInputs = - [ - curl - freetype - giflib - libjpeg - libpng - libwebp - libarchive - libX11 - pixman - tinyxml-2 - zlib - SDL2 - SDL2_image - lua - # no v8 due to missing libplatform and libbase - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - xorg.libXi - ]; + buildInputs = [ + curl + freetype + giflib + libjpeg + libpng + libwebp + libarchive + libX11 + pixman + tinyxml-2 + zlib + SDL2 + SDL2_image + lua + # no v8 due to missing libplatform and libbase + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + xorg.libXi + ]; cmakeFlags = [ "-DWITH_DESKTOP_INTEGRATION=ON" diff --git a/pkgs/by-name/li/libreswan/package.nix b/pkgs/by-name/li/libreswan/package.nix index 5fb6c5f395d5..cee8f4320820 100644 --- a/pkgs/by-name/li/libreswan/package.nix +++ b/pkgs/by-name/li/libreswan/package.nix @@ -88,7 +88,8 @@ stdenv.mkDerivation rec { # needed to patch shebangs python3 bash - ] ++ lib.optional stdenv.hostPlatform.isLinux libselinux; + ] + ++ lib.optional stdenv.hostPlatform.isLinux libselinux; prePatch = '' # Replace wget with curl to save a dependency diff --git a/pkgs/by-name/li/librime/package.nix b/pkgs/by-name/li/librime/package.nix index b847adda5e7a..0fe02f722c0f 100644 --- a/pkgs/by-name/li/librime/package.nix +++ b/pkgs/by-name/li/librime/package.nix @@ -53,7 +53,8 @@ stdenv.mkDerivation rec { yaml-cpp gtest capnproto - ] ++ plugins; # for propagated build inputs + ] + ++ plugins; # for propagated build inputs preConfigure = copyPlugins; diff --git a/pkgs/by-name/li/librsvg/package.nix b/pkgs/by-name/li/librsvg/package.nix index 9e156eaccbe6..3fd49e8885d4 100644 --- a/pkgs/by-name/li/librsvg/package.nix +++ b/pkgs/by-name/li/librsvg/package.nix @@ -51,14 +51,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "librsvg"; version = "2.60.0"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withIntrospection [ - "devdoc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withIntrospection [ + "devdoc" + ]; src = fetchurl { url = "mirror://gnome/sources/librsvg/${lib.versions.majorMinor finalAttrs.version}/librsvg-${finalAttrs.version}.tar.xz"; @@ -78,38 +77,36 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - installShellFiles - pkg-config - meson - ninja - rustc - cargo-c - cargo-auditable-cargo-wrapper - python3Packages.docutils - rustPlatform.cargoSetupHook - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - gi-docgen - vala # vala bindings require GObject introspection - ] - ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + installShellFiles + pkg-config + meson + ninja + rustc + cargo-c + cargo-auditable-cargo-wrapper + python3Packages.docutils + rustPlatform.cargoSetupHook + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + gi-docgen + vala # vala bindings require GObject introspection + ] + ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - libxml2 - bzip2 - dav1d - pango - freetype - ] - ++ lib.optionals withIntrospection [ - vala # for share/vala/Makefile.vapigen - ]; + buildInputs = [ + libxml2 + bzip2 + dav1d + pango + freetype + ] + ++ lib.optionals withIntrospection [ + vala # for share/vala/Makefile.vapigen + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/by-name/li/librum/package.nix b/pkgs/by-name/li/librum/package.nix index 821c9da8396a..004188253cba 100644 --- a/pkgs/by-name/li/librum/package.nix +++ b/pkgs/by-name/li/librum/package.nix @@ -31,24 +31,22 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = - [ - cmake - qt6.qttools - qt6.wrapQtAppsHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + cmake + qt6.qttools + qt6.wrapQtAppsHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; - buildInputs = - [ - qt6.qtbase - qt6.qtsvg - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6.qtwayland - ]; + buildInputs = [ + qt6.qtbase + qt6.qtsvg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6.qtwayland + ]; meta = with lib; { description = "Application designed to make reading enjoyable and straightforward"; diff --git a/pkgs/by-name/li/libsbml/package.nix b/pkgs/by-name/li/libsbml/package.nix index 9fbb674f5d62..08fe4d1e7b90 100644 --- a/pkgs/by-name/li/libsbml/package.nix +++ b/pkgs/by-name/li/libsbml/package.nix @@ -25,12 +25,14 @@ stdenv.mkDerivation (attrs: { cmake pkg-config swig - ] ++ lib.optional withPython python.pkgs.pythonImportsCheckHook; + ] + ++ lib.optional withPython python.pkgs.pythonImportsCheckHook; buildInputs = [ bzip2.dev libxml2 - ] ++ lib.optional withPython python; + ] + ++ lib.optional withPython python; # libSBML doesn't always make use of pkg-config cmakeFlags = [ @@ -38,7 +40,8 @@ stdenv.mkDerivation (attrs: { "-DLIBXML_LIBRARY=${lib.getLib libxml2}/lib/libxml2${stdenv.hostPlatform.extensions.sharedLibrary}" "-DPKG_CONFIG_EXECUTABLE=${lib.getBin pkg-config}/bin/pkg-config" "-DSWIG_EXECUTABLE=${lib.getBin swig}/bin/swig" - ] ++ lib.optional withPython "-DWITH_PYTHON=ON"; + ] + ++ lib.optional withPython "-DWITH_PYTHON=ON"; postInstall = lib.optional withPython '' mv $out/${python.sitePackages}/libsbml/libsbml.py $out/${python.sitePackages}/libsbml/__init__.py diff --git a/pkgs/by-name/li/libsecret/package.nix b/pkgs/by-name/li/libsecret/package.nix index 8ab83e3b6888..92cdc3e13c45 100644 --- a/pkgs/by-name/li/libsecret/package.nix +++ b/pkgs/by-name/li/libsecret/package.nix @@ -76,7 +76,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional withIntrospection "devdoc"; + ] + ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/libsecret/${lib.versions.majorMinor version}/libsecret-${version}.tar.xz"; @@ -87,30 +88,28 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - libxslt # for xsltproc for building man pages - docbook-xsl-nons - docbook_xml_dtd_42 - libintl - vala - glib - ] - ++ lib.optionals withIntrospection [ - gi-docgen - gobject-introspection - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + libxslt # for xsltproc for building man pages + docbook-xsl-nons + docbook_xml_dtd_42 + libintl + vala + glib + ] + ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection + ]; - buildInputs = - [ - libgcrypt - ] - ++ lib.optionals withTpm2Tss [ tpm2-tss ] - ++ lib.optionals abrmdSupport [ tpm2-abrmd ]; + buildInputs = [ + libgcrypt + ] + ++ lib.optionals withTpm2Tss [ tpm2-tss ] + ++ lib.optionals abrmdSupport [ tpm2-abrmd ]; propagatedBuildInputs = [ glib @@ -149,29 +148,28 @@ stdenv.mkDerivation rec { mesonFlagsArray+=("-Dc_link_args=-Wl,--push-state,--no-as-needed -ltss2-tcti-tabrmd -ltss2-tcti-device -Wl,--pop-state") ''; - preCheck = - '' - # Our gobject-introspection patches make the shared library paths absolute - # in the GIR files. When running tests, the library is not yet installed, - # though, so we need to replace the absolute path with a local one during build. - # We are using a symlink that will be overwitten during installation. - mkdir -p $out/lib $out/lib - ln -s "$PWD/libsecret/libmock-service.so" "$out/lib/libmock-service.so" - ln -s "$PWD/libsecret/libsecret-1.so.0" "$out/lib/libsecret-1.so.0" - '' - + lib.optionalString (withTpm2Tss && !abrmdSupport) '' - # If abrmdSupport is disabled, the user‐space resource manager TCTI - # module is not linked at compile time. It is however needed during - # testing because the TPM emulator lacks an integrated resource manager - # The module path is therefore injected temporarly using the - # LD_LIBRARY_PATH environment variable, so that it may be found by - # dlopen(). - # - # If abrmdSupport is enabled, this is avoided to check that the - # module has been properly linked and can be located through the - # DT_RUNPATH and DT_NEEDED entries in libsecret-1.so. - export LD_LIBRARY_PATH+=":${lib.makeLibraryPath [ tpm2-abrmd ]}" - ''; + preCheck = '' + # Our gobject-introspection patches make the shared library paths absolute + # in the GIR files. When running tests, the library is not yet installed, + # though, so we need to replace the absolute path with a local one during build. + # We are using a symlink that will be overwitten during installation. + mkdir -p $out/lib $out/lib + ln -s "$PWD/libsecret/libmock-service.so" "$out/lib/libmock-service.so" + ln -s "$PWD/libsecret/libsecret-1.so.0" "$out/lib/libsecret-1.so.0" + '' + + lib.optionalString (withTpm2Tss && !abrmdSupport) '' + # If abrmdSupport is disabled, the user‐space resource manager TCTI + # module is not linked at compile time. It is however needed during + # testing because the TPM emulator lacks an integrated resource manager + # The module path is therefore injected temporarly using the + # LD_LIBRARY_PATH environment variable, so that it may be found by + # dlopen(). + # + # If abrmdSupport is enabled, this is avoided to check that the + # module has been properly linked and can be located through the + # DT_RUNPATH and DT_NEEDED entries in libsecret-1.so. + export LD_LIBRARY_PATH+=":${lib.makeLibraryPath [ tpm2-abrmd ]}" + ''; checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/li/libselinux/package.nix b/pkgs/by-name/li/libselinux/package.nix index 9c799e0199bc..b893700936e3 100644 --- a/pkgs/by-name/li/libselinux/package.nix +++ b/pkgs/by-name/li/libselinux/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation (finalAttrs: { "out" "dev" "man" - ] ++ lib.optional enablePython "py"; + ] + ++ lib.optional enablePython "py"; src = fetchurl { url = "${finalAttrs.se_url}/${finalAttrs.version}/libselinux-${finalAttrs.version}.tar.gz"; @@ -64,62 +65,60 @@ stdenv.mkDerivation (finalAttrs: { ./fix-build-32bit-lfs.patch ]; - nativeBuildInputs = - [ - pkg-config - python3 - ] - ++ lib.optionals enablePython [ - python3Packages.pip - python3Packages.setuptools - python3Packages.wheel - swig - ]; + nativeBuildInputs = [ + pkg-config + python3 + ] + ++ lib.optionals enablePython [ + python3Packages.pip + python3Packages.setuptools + python3Packages.wheel + swig + ]; buildInputs = [ libsepol pcre2 fts - ] ++ lib.optionals enablePython [ python3 ]; + ] + ++ lib.optionals enablePython [ python3 ]; # drop fortify here since package uses it by default, leading to compile error: # command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] hardeningDisable = [ "fortify" ]; - env = - { - NIX_CFLAGS_COMPILE = "-Wno-error -D_FILE_OFFSET_BITS=64"; - } - // lib.optionalAttrs - (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") + env = { + NIX_CFLAGS_COMPILE = "-Wno-error -D_FILE_OFFSET_BITS=64"; + } + // + lib.optionalAttrs (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") { NIX_LDFLAGS = "--undefined-version"; }; - makeFlags = - [ - "PREFIX=$(out)" - "INCDIR=$(dev)/include/selinux" - "INCLUDEDIR=$(dev)/include" - "MAN3DIR=$(man)/share/man/man3" - "MAN5DIR=$(man)/share/man/man5" - "MAN8DIR=$(man)/share/man/man8" - "SBINDIR=$(bin)/sbin" - "SHLIBDIR=$(out)/lib" + makeFlags = [ + "PREFIX=$(out)" + "INCDIR=$(dev)/include/selinux" + "INCLUDEDIR=$(dev)/include" + "MAN3DIR=$(man)/share/man/man3" + "MAN5DIR=$(man)/share/man/man5" + "MAN8DIR=$(man)/share/man/man8" + "SBINDIR=$(bin)/sbin" + "SHLIBDIR=$(out)/lib" - "LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a" - "ARCH=${stdenv.hostPlatform.linuxArch}" - ] - ++ lib.optionals (fts != null) [ - "FTS_LDLIBS=-lfts" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "DISABLE_SHARED=y" - ] - ++ lib.optionals enablePython [ - "PYTHON=${python3.pythonOnBuildForHost.interpreter}" - "PYTHONLIBDIR=$(py)/${python3.sitePackages}" - "PYTHON_SETUP_ARGS=--no-build-isolation" - ]; + "LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a" + "ARCH=${stdenv.hostPlatform.linuxArch}" + ] + ++ lib.optionals (fts != null) [ + "FTS_LDLIBS=-lfts" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "DISABLE_SHARED=y" + ] + ++ lib.optionals enablePython [ + "PYTHON=${python3.pythonOnBuildForHost.interpreter}" + "PYTHONLIBDIR=$(py)/${python3.sitePackages}" + "PYTHON_SETUP_ARGS=--no-build-isolation" + ]; preInstall = lib.optionalString enablePython '' mkdir -p $py/${python3.sitePackages}/selinux diff --git a/pkgs/by-name/li/libsemanage/package.nix b/pkgs/by-name/li/libsemanage/package.nix index 277d7d5238b3..9b97ce3d3b3b 100644 --- a/pkgs/by-name/li/libsemanage/package.nix +++ b/pkgs/by-name/li/libsemanage/package.nix @@ -28,27 +28,28 @@ stdenv.mkDerivation rec { "out" "dev" "man" - ] ++ lib.optional enablePython "py"; + ] + ++ lib.optional enablePython "py"; strictDeps = true; - nativeBuildInputs = - [ - bison - flex - pkg-config - ] - ++ lib.optionals enablePython [ - python3 - swig - ]; + nativeBuildInputs = [ + bison + flex + pkg-config + ] + ++ lib.optionals enablePython [ + python3 + swig + ]; buildInputs = [ libsepol libselinux bzip2 audit - ] ++ lib.optional enablePython python3; + ] + ++ lib.optional enablePython python3; makeFlags = [ "PREFIX=$(out)" diff --git a/pkgs/by-name/li/libsidplayfp/package.nix b/pkgs/by-name/li/libsidplayfp/package.nix index 45f6c2892ba5..1c2c943b88eb 100644 --- a/pkgs/by-name/li/libsidplayfp/package.nix +++ b/pkgs/by-name/li/libsidplayfp/package.nix @@ -37,17 +37,16 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - perl - pkg-config - xa - ] - ++ lib.optionals docSupport [ - doxygen - graphviz - ]; + nativeBuildInputs = [ + autoreconfHook + perl + pkg-config + xa + ] + ++ lib.optionals docSupport [ + doxygen + graphviz + ]; buildInputs = [ libexsid diff --git a/pkgs/by-name/li/libsignal-ffi/package.nix b/pkgs/by-name/li/libsignal-ffi/package.nix index 9017d7d13b83..e3096d8360a6 100644 --- a/pkgs/by-name/li/libsignal-ffi/package.nix +++ b/pkgs/by-name/li/libsignal-ffi/package.nix @@ -34,7 +34,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ protobuf rustPlatform.bindgenHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ]; env.BORING_BSSL_PATH = "${boringssl-wrapper}"; env.NIX_LDFLAGS = if stdenv.hostPlatform.isDarwin then "-lc++" else "-lstdc++"; diff --git a/pkgs/by-name/li/libsigrok/package.nix b/pkgs/by-name/li/libsigrok/package.nix index 691d4f60ca27..c934f236c818 100644 --- a/pkgs/by-name/li/libsigrok/package.nix +++ b/pkgs/by-name/li/libsigrok/package.nix @@ -37,21 +37,20 @@ stdenv.mkDerivation { pkg-config python3 ]; - buildInputs = - [ - libzip - glib - libusb1 - libftdi1 - check - libserialport - glibmm - hidapi - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libieee1284 - bluez - ]; + buildInputs = [ + libzip + glib + libusb1 + libftdi1 + check + libserialport + glibmm + hidapi + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libieee1284 + bluez + ]; strictDeps = true; diff --git a/pkgs/by-name/li/libsnark/package.nix b/pkgs/by-name/li/libsnark/package.nix index 199ab79c169b..52871ae2f69b 100644 --- a/pkgs/by-name/li/libsnark/package.nix +++ b/pkgs/by-name/li/libsnark/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation { openssl boost gmp - ] ++ lib.optional withProcps procps; + ] + ++ lib.optional withProcps procps; cmakeFlags = lib.optionals (!withProcps) [ "-DWITH_PROCPS=OFF" ] diff --git a/pkgs/by-name/li/libsndfile/package.nix b/pkgs/by-name/li/libsndfile/package.nix index c1f6242f9d27..3e894e8e40f4 100644 --- a/pkgs/by-name/li/libsndfile/package.nix +++ b/pkgs/by-name/li/libsndfile/package.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation rec { libogg libopus libvorbis - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/li/libsolv/package.nix b/pkgs/by-name/li/libsolv/package.nix index cd0b5e0eb43d..d4d0d5077fdc 100644 --- a/pkgs/by-name/li/libsolv/package.nix +++ b/pkgs/by-name/li/libsolv/package.nix @@ -28,23 +28,22 @@ stdenv.mkDerivation rec { hash = "sha256-jOYz0p5oWMnPtQbpkCIUgw6e0W5PfR6teA9IdjYSghk="; }; - cmakeFlags = - [ - "-DENABLE_COMPLEX_DEPS=true" - (lib.cmakeBool "ENABLE_CONDA" withConda) - "-DENABLE_LZMA_COMPRESSION=true" - "-DENABLE_BZIP2_COMPRESSION=true" - "-DENABLE_ZSTD_COMPRESSION=true" - "-DENABLE_ZCHUNK_COMPRESSION=true" - "-DWITH_SYSTEM_ZCHUNK=true" - ] - ++ lib.optionals withRpm [ - "-DENABLE_COMPS=true" - "-DENABLE_PUBKEY=true" - "-DENABLE_RPMDB=true" - "-DENABLE_RPMDB_BYRPMHEADER=true" - "-DENABLE_RPMMD=true" - ]; + cmakeFlags = [ + "-DENABLE_COMPLEX_DEPS=true" + (lib.cmakeBool "ENABLE_CONDA" withConda) + "-DENABLE_LZMA_COMPRESSION=true" + "-DENABLE_BZIP2_COMPRESSION=true" + "-DENABLE_ZSTD_COMPRESSION=true" + "-DENABLE_ZCHUNK_COMPRESSION=true" + "-DWITH_SYSTEM_ZCHUNK=true" + ] + ++ lib.optionals withRpm [ + "-DENABLE_COMPS=true" + "-DENABLE_PUBKEY=true" + "-DENABLE_RPMDB=true" + "-DENABLE_RPMDB_BYRPMHEADER=true" + "-DENABLE_RPMMD=true" + ]; nativeBuildInputs = [ cmake @@ -59,7 +58,8 @@ stdenv.mkDerivation rec { zstd expat db - ] ++ lib.optional withRpm rpm; + ] + ++ lib.optional withRpm rpm; meta = with lib; { description = "Free package dependency solver"; diff --git a/pkgs/by-name/li/libsoundio/package.nix b/pkgs/by-name/li/libsoundio/package.nix index 4c8c5fbf49a6..b7c1167cd72c 100644 --- a/pkgs/by-name/li/libsoundio/package.nix +++ b/pkgs/by-name/li/libsoundio/package.nix @@ -21,12 +21,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - buildInputs = - [ libjack2 ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libpulseaudio - alsa-lib - ]; + buildInputs = [ + libjack2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libpulseaudio + alsa-lib + ]; cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "-DBUILD_TESTS=OFF" diff --git a/pkgs/by-name/li/libspatialite/package.nix b/pkgs/by-name/li/libspatialite/package.nix index 3e6fe92078ab..483c54c33917 100644 --- a/pkgs/by-name/li/libspatialite/package.nix +++ b/pkgs/by-name/li/libspatialite/package.nix @@ -48,20 +48,19 @@ stdenv.mkDerivation (finalAttrs: { geos # for geos-config ]; - buildInputs = - [ - freexl - geos - librttopo - libxml2 - minizip - proj - sqlite - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + freexl + geos + librttopo + libxml2 + minizip + proj + sqlite + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/li/libspnav/package.nix b/pkgs/by-name/li/libspnav/package.nix index b6fbbc4001cc..e4a523036eed 100644 --- a/pkgs/by-name/li/libspnav/package.nix +++ b/pkgs/by-name/li/libspnav/package.nix @@ -19,15 +19,14 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 ]; configureFlags = [ "--disable-debug" ]; - makeFlags = - [ - "CC=${stdenv.cc.targetPrefix}cc" - "AR=${stdenv.cc.targetPrefix}ar" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "shared=-dynamiclib" - "shared+=-Wl,-install_name,$(out)/lib/$(lib_so)" - ]; + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "AR=${stdenv.cc.targetPrefix}ar" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "shared=-dynamiclib" + "shared+=-Wl,-install_name,$(out)/lib/$(lib_so)" + ]; preInstall = '' mkdir -p $out/{lib,include} diff --git a/pkgs/by-name/li/libstemmer/package.nix b/pkgs/by-name/li/libstemmer/package.nix index 2df64013e2b6..b3bc59115d26 100644 --- a/pkgs/by-name/li/libstemmer/package.nix +++ b/pkgs/by-name/li/libstemmer/package.nix @@ -19,14 +19,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl ]; - prePatch = - '' - patchShebangs . - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace GNUmakefile \ - --replace './snowball' '${lib.getBin buildPackages.libstemmer}/bin/snowball' - ''; + prePatch = '' + patchShebangs . + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace GNUmakefile \ + --replace './snowball' '${lib.getBin buildPackages.libstemmer}/bin/snowball' + ''; makeTarget = "libstemmer.a"; diff --git a/pkgs/by-name/li/libtapi/package.nix b/pkgs/by-name/li/libtapi/package.nix index 012ed846b96a..fafa79593590 100644 --- a/pkgs/by-name/li/libtapi/package.nix +++ b/pkgs/by-name/li/libtapi/package.nix @@ -59,37 +59,36 @@ stdenv.mkDerivation (finalAttrs: { ./0003-Match-designator-order-with-declaration-order.patch ]; - postPatch = - '' - # Enable building on non-Darwin platforms - substituteInPlace tapi/CMakeLists.txt \ - --replace-fail 'message(FATAL_ERROR "Unsupported configuration.")' "" + postPatch = '' + # Enable building on non-Darwin platforms + substituteInPlace tapi/CMakeLists.txt \ + --replace-fail 'message(FATAL_ERROR "Unsupported configuration.")' "" - # Remove the client limitation on linking to libtapi.dylib. - substituteInPlace tapi/tools/libtapi/CMakeLists.txt \ - --replace-fail '-allowable_client ld' "" - # Replace hard-coded installation paths with standard ones. - declare -A installdirs=( - [bin]=BINDIR - [include]=INCLUDEDIR - [lib]=LIBDIR - [local/bin]=BINDIR - [local/share/man]=MANDIR - [share/man]=MANDIR - ) - for dir in "''${!installdirs[@]}"; do - cmakevar=CMAKE_INSTALL_''${installdirs[$dir]} - for cmakelist in $(grep -rl "DESTINATION $dir" tapi); do - substituteInPlace "$cmakelist" \ - --replace-fail "DESTINATION $dir" "DESTINATION \''${$cmakevar}" - done + # Remove the client limitation on linking to libtapi.dylib. + substituteInPlace tapi/tools/libtapi/CMakeLists.txt \ + --replace-fail '-allowable_client ld' "" + # Replace hard-coded installation paths with standard ones. + declare -A installdirs=( + [bin]=BINDIR + [include]=INCLUDEDIR + [lib]=LIBDIR + [local/bin]=BINDIR + [local/share/man]=MANDIR + [share/man]=MANDIR + ) + for dir in "''${!installdirs[@]}"; do + cmakevar=CMAKE_INSTALL_''${installdirs[$dir]} + for cmakelist in $(grep -rl "DESTINATION $dir" tapi); do + substituteInPlace "$cmakelist" \ + --replace-fail "DESTINATION $dir" "DESTINATION \''${$cmakevar}" done - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Remove Darwin-specific versioning flags. - substituteInPlace tapi/tools/libtapi/CMakeLists.txt \ - --replace-fail '-current_version ''${DYLIB_VERSION} -compatibility_version 1' "" - ''; + done + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # Remove Darwin-specific versioning flags. + substituteInPlace tapi/tools/libtapi/CMakeLists.txt \ + --replace-fail '-current_version ''${DYLIB_VERSION} -compatibility_version 1' "" + ''; preUnpack = '' mkdir source diff --git a/pkgs/by-name/li/libtheora/package.nix b/pkgs/by-name/li/libtheora/package.nix index 74c5b0691a9a..f372aada393a 100644 --- a/pkgs/by-name/li/libtheora/package.nix +++ b/pkgs/by-name/li/libtheora/package.nix @@ -37,16 +37,15 @@ stdenv.mkDerivation (finalAttrs: { ]; outputDoc = "devdoc"; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - validatePkgConfig - ] - ++ lib.optionals stdenv.hostPlatform.isArmv7 [ - # Needed to run lib/arm/arm2gnu.pl for ARM assembly optimizations - perl - ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + validatePkgConfig + ] + ++ lib.optionals stdenv.hostPlatform.isArmv7 [ + # Needed to run lib/arm/arm2gnu.pl for ARM assembly optimizations + perl + ]; propagatedBuildInputs = [ libogg diff --git a/pkgs/by-name/li/libticalcs2/package.nix b/pkgs/by-name/li/libticalcs2/package.nix index 9cc1111328cc..a4a085c43d81 100644 --- a/pkgs/by-name/li/libticalcs2/package.nix +++ b/pkgs/by-name/li/libticalcs2/package.nix @@ -26,18 +26,17 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - glib - libticonv - libtifiles2 - libticables2 - xz - bzip2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - acl - ]; + buildInputs = [ + glib + libticonv + libtifiles2 + libticables2 + xz + bzip2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + acl + ]; meta = with lib; { changelog = "http://lpg.ticalc.org/prj_tilp/news.html"; diff --git a/pkgs/by-name/li/libticonv/package.nix b/pkgs/by-name/li/libticonv/package.nix index 395f5e002023..8b4db12b9b54 100644 --- a/pkgs/by-name/li/libticonv/package.nix +++ b/pkgs/by-name/li/libticonv/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-iconv" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "LDFLAGS=-liconv"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "LDFLAGS=-liconv"; meta = with lib; { changelog = "http://lpg.ticalc.org/prj_tilp/news.html"; diff --git a/pkgs/by-name/li/libtiff/package.nix b/pkgs/by-name/li/libtiff/package.nix index 8018672a7f3f..c73dfa2d0c94 100644 --- a/pkgs/by-name/li/libtiff/package.nix +++ b/pkgs/by-name/li/libtiff/package.nix @@ -83,13 +83,12 @@ stdenv.mkDerivation (finalAttrs: { sphinx ]; - buildInputs = - [ - zstd - ] - ++ lib.optionals withLerc [ - lerc - ]; + buildInputs = [ + zstd + ] + ++ lib.optionals withLerc [ + lerc + ]; # TODO: opengl support (bogus configure detection) propagatedBuildInputs = [ diff --git a/pkgs/by-name/li/libtoxcore/package.nix b/pkgs/by-name/li/libtoxcore/package.nix index 41d60e68363f..a24ea4588357 100644 --- a/pkgs/by-name/li/libtoxcore/package.nix +++ b/pkgs/by-name/li/libtoxcore/package.nix @@ -29,18 +29,18 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DDHT_BOOTSTRAP=ON" "-DBOOTSTRAP_DAEMON=ON" - ] ++ lib.optional buildToxAV "-DMUST_BUILD_TOXAV=ON"; + ] + ++ lib.optional buildToxAV "-DMUST_BUILD_TOXAV=ON"; - buildInputs = - [ - libsodium - ncurses - libconfig - ] - ++ lib.optionals buildToxAV [ - libopus - libvpx - ]; + buildInputs = [ + libsodium + ncurses + libconfig + ] + ++ lib.optionals buildToxAV [ + libopus + libvpx + ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/li/libui/package.nix b/pkgs/by-name/li/libui/package.nix index 0ee54f7c45a1..5f5430a72fca 100644 --- a/pkgs/by-name/li/libui/package.nix +++ b/pkgs/by-name/li/libui/package.nix @@ -36,28 +36,27 @@ stdenv.mkDerivation rec { sed -i 's/set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8")//' ./CMakeLists.txt ''; - installPhase = - '' - mkdir -p $out/{include,lib} - mkdir -p $out/lib/pkgconfig - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mv ./out/libui.so.0 $out/lib/ - ln -s $out/lib/libui.so.0 $out/lib/libui.so - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mv ./out/libui.A.dylib $out/lib/ - ln -s $out/lib/libui.A.dylib $out/lib/libui.dylib - '' - + '' - cp $src/ui.h $out/include - cp $src/ui_${backend}.h $out/include + installPhase = '' + mkdir -p $out/{include,lib} + mkdir -p $out/lib/pkgconfig + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mv ./out/libui.so.0 $out/lib/ + ln -s $out/lib/libui.so.0 $out/lib/libui.so + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mv ./out/libui.A.dylib $out/lib/ + ln -s $out/lib/libui.A.dylib $out/lib/libui.dylib + '' + + '' + cp $src/ui.h $out/include + cp $src/ui_${backend}.h $out/include - cp ${./libui.pc} $out/lib/pkgconfig/libui.pc - substituteInPlace $out/lib/pkgconfig/libui.pc \ - --subst-var-by out $out \ - --subst-var-by version "${version}" - ''; + cp ${./libui.pc} $out/lib/pkgconfig/libui.pc + substituteInPlace $out/lib/pkgconfig/libui.pc \ + --subst-var-by out $out \ + --subst-var-by version "${version}" + ''; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' install_name_tool -id $out/lib/libui.A.dylib $out/lib/libui.A.dylib ''; diff --git a/pkgs/by-name/li/libusb1/package.nix b/pkgs/by-name/li/libusb1/package.nix index 4ec95125a008..fdbb55f8903e 100644 --- a/pkgs/by-name/li/libusb1/package.nix +++ b/pkgs/by-name/li/libusb1/package.nix @@ -28,12 +28,14 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optionals withDocs [ "doc" ]; + ] + ++ lib.optionals withDocs [ "doc" ]; nativeBuildInputs = [ pkg-config autoreconfHook - ] ++ lib.optionals withDocs [ doxygen ]; + ] + ++ lib.optionals withDocs [ doxygen ]; propagatedBuildInputs = lib.optional enableUdev udev; # Many dependents are dealing with hardware devices, exposing udev rules for them. diff --git a/pkgs/by-name/li/libusbsio/package.nix b/pkgs/by-name/li/libusbsio/package.nix index d1b762b4e014..a489fccc59ee 100644 --- a/pkgs/by-name/li/libusbsio/package.nix +++ b/pkgs/by-name/li/libusbsio/package.nix @@ -26,22 +26,20 @@ stdenv.mkDerivation rec { "BINDIR=" ]; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; - buildInputs = - [ - libusb1 - ] + buildInputs = [ + libusb1 + ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - systemdMinimal # libudev - ]; + ++ lib.optionals stdenv.hostPlatform.isLinux [ + systemdMinimal # libudev + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/li/libuv/package.nix b/pkgs/by-name/li/libuv/package.nix index 949fb489eb23..d520ec04b3e0 100644 --- a/pkgs/by-name/li/libuv/package.nix +++ b/pkgs/by-name/li/libuv/package.nix @@ -41,105 +41,104 @@ stdenv.mkDerivation (finalAttrs: { postPatch = let - toDisable = - [ - "getnameinfo_basic" - "udp_send_hang_loop" # probably network-dependent - "tcp_connect_timeout" # tries to reach out to 8.8.8.8 - "spawn_setuid_fails" - "spawn_setgid_fails" - "fs_chown" # user namespaces - "getaddrinfo_fail" - "getaddrinfo_fail_sync" - "tcp_connect6_link_local" - "thread_affinity" # else "test must be run with cpu 0 affinity" when affinity is set - "threadpool_multiple_event_loops" # times out on slow machines - "get_passwd" # passed on NixOS but failed on other Linuxes - "tcp_writealot" - "udp_multicast_join" - "udp_multicast_join6" - "metrics_pool_events" # times out sometimes - "fs_fstat" # https://github.com/libuv/libuv/issues/2235#issuecomment-1012086927 + toDisable = [ + "getnameinfo_basic" + "udp_send_hang_loop" # probably network-dependent + "tcp_connect_timeout" # tries to reach out to 8.8.8.8 + "spawn_setuid_fails" + "spawn_setgid_fails" + "fs_chown" # user namespaces + "getaddrinfo_fail" + "getaddrinfo_fail_sync" + "tcp_connect6_link_local" + "thread_affinity" # else "test must be run with cpu 0 affinity" when affinity is set + "threadpool_multiple_event_loops" # times out on slow machines + "get_passwd" # passed on NixOS but failed on other Linuxes + "tcp_writealot" + "udp_multicast_join" + "udp_multicast_join6" + "metrics_pool_events" # times out sometimes + "fs_fstat" # https://github.com/libuv/libuv/issues/2235#issuecomment-1012086927 - # Assertion failed in test/test-tcp-bind6-error.c on line 60: r == UV_EADDRINUSE - # Assertion failed in test/test-tcp-bind-error.c on line 99: r == UV_EADDRINUSE - "tcp_bind6_error_addrinuse" - "tcp_bind_error_addrinuse_listen" - # https://github.com/libuv/libuv/pull/4075#issuecomment-1935572237 - "thread_priority" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Sometimes: timeout (no output), failed uv_listen. Someone - # should report these failures to libuv team. There tests should - # be much more robust. - "process_title" - "emfile" - "poll_duplex" - "poll_unidirectional" - "ipc_listen_before_write" - "ipc_listen_after_write" - "ipc_tcp_connection" - "tcp_alloc_cb_fail" - "tcp_ping_pong" - "tcp_ref3" - "tcp_ref4" - "tcp_bind6_error_inval" - "tcp_read_stop" - "tcp_unexpected_read" - "tcp_write_to_half_open_connection" - "tcp_oob" - "tcp_close_accept" - "tcp_create_early_accept" - "tcp_create_early" - "tcp_close" - "tcp_bind_error_inval" - "tcp_bind_error_addrinuse" - "tcp_shutdown_after_write" - "tcp_open" - "tcp_write_queue_order" - "tcp_try_write" - "multiple_listen" - "delayed_accept" - "udp_recv_in_a_row" - "shutdown_close_tcp" - "shutdown_eof" - "shutdown_twice" - "callback_stack" - "tty_pty" - "condvar_5" - "hrtime" - # Tests that fail when sandboxing is enabled. - "fs_event_close_in_callback" - "fs_event_watch_dir" - "fs_event_error_reporting" - "fs_event_watch_dir_recursive" - "fs_event_watch_file" - "fs_event_watch_file_current_dir" - "fs_event_watch_file_exact_path" - "process_priority" - "udp_create_early_bad_bind" - "fs_event_watch_delete_dir" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && lib.versionOlder finalAttrs.version "1.49.3") [ - # https://github.com/libuv/libuv/issues/4650 - # can enable on upgrade from 1.49.2 - "udp_mmsg" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - # I observe this test failing with some regularity on ARMv7: - # https://github.com/libuv/libuv/issues/1871 - "shutdown_close_pipe" - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - # EOPNOTSUPP when performed in jailed build env - "tcp_reuseport" - "udp_reuseport" - # jailed build env does not have a hostname - "gethostname" - # Fails when built on non-nix FreeBSD - # https://github.com/libuv/libuv/issues/4606 - "fs_event_watch_delete_dir" - ]; + # Assertion failed in test/test-tcp-bind6-error.c on line 60: r == UV_EADDRINUSE + # Assertion failed in test/test-tcp-bind-error.c on line 99: r == UV_EADDRINUSE + "tcp_bind6_error_addrinuse" + "tcp_bind_error_addrinuse_listen" + # https://github.com/libuv/libuv/pull/4075#issuecomment-1935572237 + "thread_priority" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Sometimes: timeout (no output), failed uv_listen. Someone + # should report these failures to libuv team. There tests should + # be much more robust. + "process_title" + "emfile" + "poll_duplex" + "poll_unidirectional" + "ipc_listen_before_write" + "ipc_listen_after_write" + "ipc_tcp_connection" + "tcp_alloc_cb_fail" + "tcp_ping_pong" + "tcp_ref3" + "tcp_ref4" + "tcp_bind6_error_inval" + "tcp_read_stop" + "tcp_unexpected_read" + "tcp_write_to_half_open_connection" + "tcp_oob" + "tcp_close_accept" + "tcp_create_early_accept" + "tcp_create_early" + "tcp_close" + "tcp_bind_error_inval" + "tcp_bind_error_addrinuse" + "tcp_shutdown_after_write" + "tcp_open" + "tcp_write_queue_order" + "tcp_try_write" + "multiple_listen" + "delayed_accept" + "udp_recv_in_a_row" + "shutdown_close_tcp" + "shutdown_eof" + "shutdown_twice" + "callback_stack" + "tty_pty" + "condvar_5" + "hrtime" + # Tests that fail when sandboxing is enabled. + "fs_event_close_in_callback" + "fs_event_watch_dir" + "fs_event_error_reporting" + "fs_event_watch_dir_recursive" + "fs_event_watch_file" + "fs_event_watch_file_current_dir" + "fs_event_watch_file_exact_path" + "process_priority" + "udp_create_early_bad_bind" + "fs_event_watch_delete_dir" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && lib.versionOlder finalAttrs.version "1.49.3") [ + # https://github.com/libuv/libuv/issues/4650 + # can enable on upgrade from 1.49.2 + "udp_mmsg" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + # I observe this test failing with some regularity on ARMv7: + # https://github.com/libuv/libuv/issues/1871 + "shutdown_close_pipe" + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + # EOPNOTSUPP when performed in jailed build env + "tcp_reuseport" + "udp_reuseport" + # jailed build env does not have a hostname + "gethostname" + # Fails when built on non-nix FreeBSD + # https://github.com/libuv/libuv/issues/4606 + "fs_event_watch_delete_dir" + ]; tdRegexp = lib.concatStringsSep "\\|" toDisable; in lib.optionalString (finalAttrs.finalPackage.doCheck) '' diff --git a/pkgs/by-name/li/libvgm/package.nix b/pkgs/by-name/li/libvgm/package.nix index 746175ac375d..4d4bb3c0797e 100644 --- a/pkgs/by-name/li/libvgm/package.nix +++ b/pkgs/by-name/li/libvgm/package.nix @@ -50,53 +50,52 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optionals enableTools [ "bin" ]; + ] + ++ lib.optionals enableTools [ "bin" ]; nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = - [ - libiconv - zlib - ] - ++ lib.optionals withALSA [ alsa-lib ] - ++ lib.optionals withPulseAudio [ libpulseaudio ] - ++ lib.optionals withLibao [ libao ]; + propagatedBuildInputs = [ + libiconv + zlib + ] + ++ lib.optionals withALSA [ alsa-lib ] + ++ lib.optionals withPulseAudio [ libpulseaudio ] + ++ lib.optionals withLibao [ libao ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_LIBAUDIO" enableAudio) - (lib.cmakeBool "BUILD_LIBEMU" enableEmulation) - (lib.cmakeBool "BUILD_LIBPLAYER" enableLibplayer) - (lib.cmakeBool "BUILD_TESTS" enableTools) - (lib.cmakeBool "BUILD_PLAYER" enableTools) - (lib.cmakeBool "BUILD_VGM2WAV" enableTools) - (lib.cmakeFeature "LIBRARY_TYPE" (if enableShared then "SHARED" else "STATIC")) - (lib.cmakeBool "USE_SANITIZERS" true) - ] - ++ lib.optionals enableAudio [ - (lib.cmakeBool "AUDIODRV_WAVEWRITE" withWaveWrite) - (lib.cmakeBool "AUDIODRV_WINMM" withWinMM) - (lib.cmakeBool "AUDIODRV_DSOUND" withDirectSound) - (lib.cmakeBool "AUDIODRV_XAUDIO2" withXAudio2) - (lib.cmakeBool "AUDIODRV_WASAPI" withWASAPI) - (lib.cmakeBool "AUDIODRV_OSS" withOSS) - (lib.cmakeBool "AUDIODRV_SADA" withSADA) - (lib.cmakeBool "AUDIODRV_ALSA" withALSA) - (lib.cmakeBool "AUDIODRV_PULSE" withPulseAudio) - (lib.cmakeBool "AUDIODRV_APPLE" withCoreAudio) - (lib.cmakeBool "AUDIODRV_LIBAO" withLibao) - ] - ++ lib.optionals enableEmulation ( - [ (lib.cmakeBool "SNDEMU__ALL" withAllEmulators) ] - ++ lib.optionals (!withAllEmulators) ( - lib.lists.forEach emulators (x: (lib.cmakeBool "SNDEMU_${x}" true)) - ) + cmakeFlags = [ + (lib.cmakeBool "BUILD_LIBAUDIO" enableAudio) + (lib.cmakeBool "BUILD_LIBEMU" enableEmulation) + (lib.cmakeBool "BUILD_LIBPLAYER" enableLibplayer) + (lib.cmakeBool "BUILD_TESTS" enableTools) + (lib.cmakeBool "BUILD_PLAYER" enableTools) + (lib.cmakeBool "BUILD_VGM2WAV" enableTools) + (lib.cmakeFeature "LIBRARY_TYPE" (if enableShared then "SHARED" else "STATIC")) + (lib.cmakeBool "USE_SANITIZERS" true) + ] + ++ lib.optionals enableAudio [ + (lib.cmakeBool "AUDIODRV_WAVEWRITE" withWaveWrite) + (lib.cmakeBool "AUDIODRV_WINMM" withWinMM) + (lib.cmakeBool "AUDIODRV_DSOUND" withDirectSound) + (lib.cmakeBool "AUDIODRV_XAUDIO2" withXAudio2) + (lib.cmakeBool "AUDIODRV_WASAPI" withWASAPI) + (lib.cmakeBool "AUDIODRV_OSS" withOSS) + (lib.cmakeBool "AUDIODRV_SADA" withSADA) + (lib.cmakeBool "AUDIODRV_ALSA" withALSA) + (lib.cmakeBool "AUDIODRV_PULSE" withPulseAudio) + (lib.cmakeBool "AUDIODRV_APPLE" withCoreAudio) + (lib.cmakeBool "AUDIODRV_LIBAO" withLibao) + ] + ++ lib.optionals enableEmulation ( + [ (lib.cmakeBool "SNDEMU__ALL" withAllEmulators) ] + ++ lib.optionals (!withAllEmulators) ( + lib.lists.forEach emulators (x: (lib.cmakeBool "SNDEMU_${x}" true)) ) - ++ lib.optionals enableTools [ - (lib.cmakeBool "UTIL_CHARCNV_ICONV" true) - (lib.cmakeBool "UTIL_CHARCNV_WINAPI" stdenv.hostPlatform.isWindows) - ]; + ) + ++ lib.optionals enableTools [ + (lib.cmakeBool "UTIL_CHARCNV_ICONV" true) + (lib.cmakeBool "UTIL_CHARCNV_WINAPI" stdenv.hostPlatform.isWindows) + ]; passthru = { tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; @@ -115,10 +114,11 @@ stdenv.mkDerivation (finalAttrs: { lib.licenses.gpl2Only; maintainers = with lib.maintainers; [ OPNA2608 ]; platforms = lib.platforms.all; - pkgConfigModules = - [ "vgm-utils" ] - ++ lib.optionals enableAudio [ "vgm-audio" ] - ++ lib.optionals enableEmulation [ "vgm-emu" ] - ++ lib.optionals enableLibplayer [ "vgm-player" ]; + pkgConfigModules = [ + "vgm-utils" + ] + ++ lib.optionals enableAudio [ "vgm-audio" ] + ++ lib.optionals enableEmulation [ "vgm-emu" ] + ++ lib.optionals enableLibplayer [ "vgm-player" ]; }; }) diff --git a/pkgs/by-name/li/libvirt-glib/package.nix b/pkgs/by-name/li/libvirt-glib/package.nix index 8fa4aedf377e..b358c1d5bd30 100644 --- a/pkgs/by-name/li/libvirt-glib/package.nix +++ b/pkgs/by-name/li/libvirt-glib/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional withDocs "devdoc"; + ] + ++ lib.optional withDocs "devdoc"; src = fetchurl { url = "https://libvirt.org/sources/glib/${pname}-${version}.tar.xz"; @@ -43,31 +44,29 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - vala - gobject-introspection - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ] - ++ lib.optionals withDocs [ - gtk-doc - docbook-xsl-nons - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + vala + gobject-introspection + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ] + ++ lib.optionals withDocs [ + gtk-doc + docbook-xsl-nons + ]; - buildInputs = - [ - libvirt - libxml2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap_ng - ]; + buildInputs = [ + libvirt + libxml2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap_ng + ]; strictDeps = true; diff --git a/pkgs/by-name/li/libvirt/package.nix b/pkgs/by-name/li/libvirt/package.nix index 184be831452b..cd3d4cef3ab8 100644 --- a/pkgs/by-name/li/libvirt/package.nix +++ b/pkgs/by-name/li/libvirt/package.nix @@ -127,127 +127,123 @@ stdenv.mkDerivation rec { hash = "sha256-wp/igqlyGqJiMCxcXFmPQgVDarVhR87Qlvuct+Eb8zA="; }; - patches = - [ - ./0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch - ] - ++ lib.optionals enableZfs [ - (replaceVars ./0002-substitute-zfs-and-zpool-commands.patch { - zfs = "${zfs}/bin/zfs"; - zpool = "${zfs}/bin/zpool"; - }) - ]; + patches = [ + ./0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch + ] + ++ lib.optionals enableZfs [ + (replaceVars ./0002-substitute-zfs-and-zpool-commands.patch { + zfs = "${zfs}/bin/zfs"; + zpool = "${zfs}/bin/zpool"; + }) + ]; # remove some broken tests - postPatch = - '' - sed -i '/commandtest/d' tests/meson.build - sed -i '/virnetsockettest/d' tests/meson.build - # delete only the first occurrence of this - sed -i '0,/qemuxmlconftest/{/qemuxmlconftest/d;}' tests/meson.build + postPatch = '' + sed -i '/commandtest/d' tests/meson.build + sed -i '/virnetsockettest/d' tests/meson.build + # delete only the first occurrence of this + sed -i '0,/qemuxmlconftest/{/qemuxmlconftest/d;}' tests/meson.build - '' - + lib.optionalString isLinux '' - for binary in mount umount mkfs; do - substituteInPlace meson.build \ - --replace "find_program('$binary'" "find_program('${lib.getBin util-linux}/bin/$binary'" - done - - '' - + '' + '' + + lib.optionalString isLinux '' + for binary in mount umount mkfs; do substituteInPlace meson.build \ - --replace "'dbus-daemon'," "'${lib.getBin dbus}/bin/dbus-daemon'," - '' - + lib.optionalString isLinux '' - sed -i 's,define PARTED "parted",define PARTED "${parted}/bin/parted",' \ - src/storage/storage_backend_disk.c \ - src/storage/storage_util.c - '' - + lib.optionalString isDarwin '' - # Darwin doesn’t support -fsemantic-interposition, but the problem doesn’t seem to affect Mach-O. - # See https://gitlab.com/libvirt/libvirt/-/merge_requests/235 - sed -i "s/not supported_cc_flags.contains('-fsemantic-interposition')/false/" meson.build - sed -i '/qemufirmwaretest/d' tests/meson.build - sed -i '/qemuhotplugtest/d' tests/meson.build - sed -i '/qemuvhostusertest/d' tests/meson.build - sed -i '/qemuxml2xmltest/d' tests/meson.build - sed -i '/domaincapstest/d' tests/meson.build - # virshtest frequently times out on Darwin - substituteInPlace tests/meson.build \ - --replace-fail "data.get('timeout', 30)" "data.get('timeout', 120)" - '' - + lib.optionalString enableXen '' - # Has various hardcoded paths that don't exist outside of a Xen dom0. - sed -i '/libxlxml2domconfigtest/d' tests/meson.build - substituteInPlace src/libxl/libxl_capabilities.h \ - --replace-fail /usr/lib/xen ${xen}/libexec/xen - ''; + --replace "find_program('$binary'" "find_program('${lib.getBin util-linux}/bin/$binary'" + done + + '' + + '' + substituteInPlace meson.build \ + --replace "'dbus-daemon'," "'${lib.getBin dbus}/bin/dbus-daemon'," + '' + + lib.optionalString isLinux '' + sed -i 's,define PARTED "parted",define PARTED "${parted}/bin/parted",' \ + src/storage/storage_backend_disk.c \ + src/storage/storage_util.c + '' + + lib.optionalString isDarwin '' + # Darwin doesn’t support -fsemantic-interposition, but the problem doesn’t seem to affect Mach-O. + # See https://gitlab.com/libvirt/libvirt/-/merge_requests/235 + sed -i "s/not supported_cc_flags.contains('-fsemantic-interposition')/false/" meson.build + sed -i '/qemufirmwaretest/d' tests/meson.build + sed -i '/qemuhotplugtest/d' tests/meson.build + sed -i '/qemuvhostusertest/d' tests/meson.build + sed -i '/qemuxml2xmltest/d' tests/meson.build + sed -i '/domaincapstest/d' tests/meson.build + # virshtest frequently times out on Darwin + substituteInPlace tests/meson.build \ + --replace-fail "data.get('timeout', 30)" "data.get('timeout', 120)" + '' + + lib.optionalString enableXen '' + # Has various hardcoded paths that don't exist outside of a Xen dom0. + sed -i '/libxlxml2domconfigtest/d' tests/meson.build + substituteInPlace src/libxl/libxl_capabilities.h \ + --replace-fail /usr/lib/xen ${xen}/libexec/xen + ''; strictDeps = true; - nativeBuildInputs = - [ - meson - docutils - libxml2 # for xmllint - libxslt # for xsltproc - gettext - makeWrapper - ninja - pkg-config - perl - perlPackages.XMLXPath - ] - ++ lib.optional (!isDarwin) rpcsvc-proto - # NOTE: needed for rpcgen - ++ lib.optional isDarwin darwin.developer_cmds; + nativeBuildInputs = [ + meson + docutils + libxml2 # for xmllint + libxslt # for xsltproc + gettext + makeWrapper + ninja + pkg-config + perl + perlPackages.XMLXPath + ] + ++ lib.optional (!isDarwin) rpcsvc-proto + # NOTE: needed for rpcgen + ++ lib.optional isDarwin darwin.developer_cmds; - buildInputs = - [ - bash - bash-completion - curl - dbus - glib - gnutls - libgcrypt - libpcap - libtasn1 - libxml2 - python3 - readline - xhtml1 - json_c - ] - ++ lib.optionals isLinux [ - acl - attr - audit - fuse3 - libapparmor - libcap_ng - libnl - libpciaccess - libtirpc - lvm2 - numactl - numad - parted - systemd - util-linux - ] - ++ lib.optionals isDarwin [ - gmp - libiconv - ] - ++ lib.optionals enableCeph [ ceph ] - ++ lib.optionals enableGlusterfs [ glusterfs ] - ++ lib.optionals enableIscsi [ - libiscsi - openiscsi - ] - ++ lib.optionals enableXen [ xen ] - ++ lib.optionals enableZfs [ zfs ]; + buildInputs = [ + bash + bash-completion + curl + dbus + glib + gnutls + libgcrypt + libpcap + libtasn1 + libxml2 + python3 + readline + xhtml1 + json_c + ] + ++ lib.optionals isLinux [ + acl + attr + audit + fuse3 + libapparmor + libcap_ng + libnl + libpciaccess + libtirpc + lvm2 + numactl + numad + parted + systemd + util-linux + ] + ++ lib.optionals isDarwin [ + gmp + libiconv + ] + ++ lib.optionals enableCeph [ ceph ] + ++ lib.optionals enableGlusterfs [ glusterfs ] + ++ lib.optionals enableIscsi [ + libiscsi + openiscsi + ] + ++ lib.optionals enableXen [ xen ] + ++ lib.optionals enableZfs [ zfs ]; preConfigure = let @@ -365,34 +361,33 @@ stdenv.mkDerivation rec { doCheck = true; - postInstall = - '' - substituteInPlace $out/bin/virt-xml-validate \ - --replace xmllint ${libxml2}/bin/xmllint + postInstall = '' + substituteInPlace $out/bin/virt-xml-validate \ + --replace xmllint ${libxml2}/bin/xmllint - # Enable to set some options from the corresponding NixOS module (or other - # places) via environment variables. - substituteInPlace $out/libexec/libvirt-guests.sh \ - --replace 'ON_BOOT="start"' 'ON_BOOT=''${ON_BOOT:-start}' \ - --replace 'ON_SHUTDOWN="suspend"' 'ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}' \ - --replace 'PARALLEL_SHUTDOWN=0' 'PARALLEL_SHUTDOWN=''${PARALLEL_SHUTDOWN:-0}' \ - --replace 'SHUTDOWN_TIMEOUT=300' 'SHUTDOWN_TIMEOUT=''${SHUTDOWN_TIMEOUT:-300}' \ - --replace 'START_DELAY=0' 'START_DELAY=''${START_DELAY:-0}' \ - --replace "$out/bin" '${gettext}/bin' \ - --replace 'lock/subsys' 'lock' \ - --replace 'gettext.sh' 'gettext.sh - # Added in nixpkgs: - gettext() { "${gettext}/bin/gettext" "$@"; } - ' - '' - + lib.optionalString isLinux '' - for f in $out/lib/systemd/system/*.service ; do - substituteInPlace $f --replace /bin/kill ${coreutils}/bin/kill - done - rm $out/lib/systemd/system/{virtlockd,virtlogd}.* - wrapProgram $out/sbin/libvirtd \ - --prefix PATH : /run/libvirt/nix-emulators:${binPath} - ''; + # Enable to set some options from the corresponding NixOS module (or other + # places) via environment variables. + substituteInPlace $out/libexec/libvirt-guests.sh \ + --replace 'ON_BOOT="start"' 'ON_BOOT=''${ON_BOOT:-start}' \ + --replace 'ON_SHUTDOWN="suspend"' 'ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}' \ + --replace 'PARALLEL_SHUTDOWN=0' 'PARALLEL_SHUTDOWN=''${PARALLEL_SHUTDOWN:-0}' \ + --replace 'SHUTDOWN_TIMEOUT=300' 'SHUTDOWN_TIMEOUT=''${SHUTDOWN_TIMEOUT:-300}' \ + --replace 'START_DELAY=0' 'START_DELAY=''${START_DELAY:-0}' \ + --replace "$out/bin" '${gettext}/bin' \ + --replace 'lock/subsys' 'lock' \ + --replace 'gettext.sh' 'gettext.sh + # Added in nixpkgs: + gettext() { "${gettext}/bin/gettext" "$@"; } + ' + '' + + lib.optionalString isLinux '' + for f in $out/lib/systemd/system/*.service ; do + substituteInPlace $f --replace /bin/kill ${coreutils}/bin/kill + done + rm $out/lib/systemd/system/{virtlockd,virtlogd}.* + wrapProgram $out/sbin/libvirtd \ + --prefix PATH : /run/libvirt/nix-emulators:${binPath} + ''; passthru.updateScript = writeScript "update-libvirt" '' #!/usr/bin/env nix-shell diff --git a/pkgs/by-name/li/libvmi/package.nix b/pkgs/by-name/li/libvmi/package.nix index 56f5baf3c663..d8e240b5db67 100644 --- a/pkgs/by-name/li/libvmi/package.nix +++ b/pkgs/by-name/li/libvmi/package.nix @@ -52,15 +52,14 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - glib - json_c - libvirt - ] - ++ lib.optionals xenSupport [ xen ] - ++ lib.optionals (!legacyKVM) [ libkvmi ] - ++ lib.optionals withVMIFS [ fuse ]; + buildInputs = [ + glib + json_c + libvirt + ] + ++ lib.optionals xenSupport [ xen ] + ++ lib.optionals (!legacyKVM) [ libkvmi ] + ++ lib.optionals withVMIFS [ fuse ]; configureFlags = lib.optionals (!xenSupport) [ "--disable-xen" ] diff --git a/pkgs/by-name/li/libvncserver/package.nix b/pkgs/by-name/li/libvncserver/package.nix index 5daa8e6d1f17..85e83d0b0460 100644 --- a/pkgs/by-name/li/libvncserver/package.nix +++ b/pkgs/by-name/li/libvncserver/package.nix @@ -55,16 +55,15 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail 'add_test(NAME includetest COMMAND' '# add_test(NAME includetest COMMAND' ''; - buildInputs = - [ - libjpeg - openssl - libgcrypt - libpng - ] - ++ lib.optionals withSystemd [ - systemd - ]; + buildInputs = [ + libjpeg + openssl + libgcrypt + libpng + ] + ++ lib.optionals withSystemd [ + systemd + ]; propagatedBuildInputs = [ zlib diff --git a/pkgs/by-name/li/libvpx/package.nix b/pkgs/by-name/li/libvpx/package.nix index f5a313cdc5c5..3887adeddd39 100644 --- a/pkgs/by-name/li/libvpx/package.nix +++ b/pkgs/by-name/li/libvpx/package.nix @@ -164,74 +164,73 @@ stdenv.mkDerivation rec { setOutputFlags = false; configurePlatforms = [ ]; - configureFlags = - [ - (enableFeature (vp8EncoderSupport || vp8DecoderSupport) "vp8") - (enableFeature vp8EncoderSupport "vp8-encoder") - (enableFeature vp8DecoderSupport "vp8-decoder") - (enableFeature (vp9EncoderSupport || vp9DecoderSupport) "vp9") - (enableFeature vp9EncoderSupport "vp9-encoder") - (enableFeature vp9DecoderSupport "vp9-decoder") - (enableFeature extraWarningsSupport "extra-warnings") - (enableFeature werrorSupport "werror") - "--disable-install-docs" - (enableFeature examplesSupport "install-bins") - "--enable-install-libs" - "--disable-install-srcs" - (enableFeature debugSupport "debug") - (enableFeature gprofSupport "gprof") - (enableFeature gcovSupport "gcov") - # Required to build shared libraries - (enableFeature (!isCygwin) "pic") - (enableFeature optimizationsSupport "optimizations") - (enableFeature runtimeCpuDetectSupport "runtime-cpu-detect") - (enableFeature thumbSupport "thumb") - "--enable-libs" - (enableFeature examplesSupport "examples") - "--disable-docs" - "--as=yasm" - # Limit default decoder max to WHXGA - (if sizeLimitSupport then "--size-limit=5120x3200" else null) - "--disable-codec-srcs" - (enableFeature debugLibsSupport "debug-libs") - (enableFeature isMips "dequant-tokens") - (enableFeature isMips "dc-recon") - (enableFeature postprocSupport "postproc") - (enableFeature (postprocSupport && (vp9DecoderSupport || vp9EncoderSupport)) "vp9-postproc") - (enableFeature multithreadSupport "multithread") - (enableFeature internalStatsSupport "internal-stats") - (enableFeature spatialResamplingSupport "spatial-resampling") - (enableFeature realtimeOnlySupport "realtime-only") - (enableFeature ontheflyBitpackingSupport "onthefly-bitpacking") - (enableFeature errorConcealmentSupport "error-concealment") - # Shared libraries are only supported on ELF platforms - (if isDarwin || isCygwin then "--enable-static --disable-shared" else "--enable-shared") - (enableFeature smallSupport "small") - (enableFeature postprocVisualizerSupport "postproc-visualizer") - (enableFeature unitTestsSupport "unit-tests") - (enableFeature webmIOSupport "webm-io") - (enableFeature libyuvSupport "libyuv") - (enableFeature decodePerfTestsSupport "decode-perf-tests") - (enableFeature encodePerfTestsSupport "encode-perf-tests") - (enableFeature multiResEncodingSupport "multi-res-encoding") - (enableFeature temporalDenoisingSupport "temporal-denoising") - (enableFeature ( - temporalDenoisingSupport && (vp9DecoderSupport || vp9EncoderSupport) - ) "vp9-temporal-denoising") - (enableFeature coefficientRangeCheckingSupport "coefficient-range-checking") - (enableFeature (vp9HighbitdepthSupport && is64bit) "vp9-highbitdepth") - (enableFeature ( - experimentalSpatialSvcSupport || experimentalFpMbStatsSupport || experimentalEmulateHardwareSupport - ) "experimental") - ] - ++ optionals (target != null) [ - "--target=${target}" - (lib.optionalString stdenv.hostPlatform.isCygwin "--enable-static-msvcrt") - ] - # Experimental features - ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" - ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats" - ++ optional experimentalEmulateHardwareSupport "--enable-emulate-hardware"; + configureFlags = [ + (enableFeature (vp8EncoderSupport || vp8DecoderSupport) "vp8") + (enableFeature vp8EncoderSupport "vp8-encoder") + (enableFeature vp8DecoderSupport "vp8-decoder") + (enableFeature (vp9EncoderSupport || vp9DecoderSupport) "vp9") + (enableFeature vp9EncoderSupport "vp9-encoder") + (enableFeature vp9DecoderSupport "vp9-decoder") + (enableFeature extraWarningsSupport "extra-warnings") + (enableFeature werrorSupport "werror") + "--disable-install-docs" + (enableFeature examplesSupport "install-bins") + "--enable-install-libs" + "--disable-install-srcs" + (enableFeature debugSupport "debug") + (enableFeature gprofSupport "gprof") + (enableFeature gcovSupport "gcov") + # Required to build shared libraries + (enableFeature (!isCygwin) "pic") + (enableFeature optimizationsSupport "optimizations") + (enableFeature runtimeCpuDetectSupport "runtime-cpu-detect") + (enableFeature thumbSupport "thumb") + "--enable-libs" + (enableFeature examplesSupport "examples") + "--disable-docs" + "--as=yasm" + # Limit default decoder max to WHXGA + (if sizeLimitSupport then "--size-limit=5120x3200" else null) + "--disable-codec-srcs" + (enableFeature debugLibsSupport "debug-libs") + (enableFeature isMips "dequant-tokens") + (enableFeature isMips "dc-recon") + (enableFeature postprocSupport "postproc") + (enableFeature (postprocSupport && (vp9DecoderSupport || vp9EncoderSupport)) "vp9-postproc") + (enableFeature multithreadSupport "multithread") + (enableFeature internalStatsSupport "internal-stats") + (enableFeature spatialResamplingSupport "spatial-resampling") + (enableFeature realtimeOnlySupport "realtime-only") + (enableFeature ontheflyBitpackingSupport "onthefly-bitpacking") + (enableFeature errorConcealmentSupport "error-concealment") + # Shared libraries are only supported on ELF platforms + (if isDarwin || isCygwin then "--enable-static --disable-shared" else "--enable-shared") + (enableFeature smallSupport "small") + (enableFeature postprocVisualizerSupport "postproc-visualizer") + (enableFeature unitTestsSupport "unit-tests") + (enableFeature webmIOSupport "webm-io") + (enableFeature libyuvSupport "libyuv") + (enableFeature decodePerfTestsSupport "decode-perf-tests") + (enableFeature encodePerfTestsSupport "encode-perf-tests") + (enableFeature multiResEncodingSupport "multi-res-encoding") + (enableFeature temporalDenoisingSupport "temporal-denoising") + (enableFeature ( + temporalDenoisingSupport && (vp9DecoderSupport || vp9EncoderSupport) + ) "vp9-temporal-denoising") + (enableFeature coefficientRangeCheckingSupport "coefficient-range-checking") + (enableFeature (vp9HighbitdepthSupport && is64bit) "vp9-highbitdepth") + (enableFeature ( + experimentalSpatialSvcSupport || experimentalFpMbStatsSupport || experimentalEmulateHardwareSupport + ) "experimental") + ] + ++ optionals (target != null) [ + "--target=${target}" + (lib.optionalString stdenv.hostPlatform.isCygwin "--enable-static-msvcrt") + ] + # Experimental features + ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" + ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats" + ++ optional experimentalEmulateHardwareSupport "--enable-emulate-hardware"; nativeBuildInputs = [ perl diff --git a/pkgs/by-name/li/libwebsockets/package.nix b/pkgs/by-name/li/libwebsockets/package.nix index 84e55117c74b..928764569233 100644 --- a/pkgs/by-name/li/libwebsockets/package.nix +++ b/pkgs/by-name/li/libwebsockets/package.nix @@ -34,25 +34,24 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = - [ - "-DLWS_WITH_PLUGINS=ON" - "-DLWS_WITH_IPV6=ON" - "-DLWS_WITH_SOCKS5=ON" - "-DDISABLE_WERROR=ON" - "-DLWS_BUILD_HASH=no_hash" - ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON" - ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON" - ++ ( - if stdenv.hostPlatform.isStatic then - [ "-DLWS_WITH_SHARED=OFF" ] - else - [ - "-DLWS_WITH_STATIC=OFF" - "-DLWS_LINK_TESTAPPS_DYNAMIC=ON" - ] - ); + cmakeFlags = [ + "-DLWS_WITH_PLUGINS=ON" + "-DLWS_WITH_IPV6=ON" + "-DLWS_WITH_SOCKS5=ON" + "-DDISABLE_WERROR=ON" + "-DLWS_BUILD_HASH=no_hash" + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON" + ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON" + ++ ( + if stdenv.hostPlatform.isStatic then + [ "-DLWS_WITH_SHARED=OFF" ] + else + [ + "-DLWS_WITH_STATIC=OFF" + "-DLWS_LINK_TESTAPPS_DYNAMIC=ON" + ] + ); postInstall = '' # Fix path that will be incorrect on move to "dev" output. diff --git a/pkgs/by-name/li/libx86/package.nix b/pkgs/by-name/li/libx86/package.nix index 487c24e18cd6..c32d53d8651c 100644 --- a/pkgs/by-name/li/libx86/package.nix +++ b/pkgs/by-name/li/libx86/package.nix @@ -20,7 +20,8 @@ stdenv.mkDerivation rec { # http://www.mail-archive.com/suspend-devel@lists.sourceforge.net/msg02355.html makeFlags = [ "DESTDIR=$(out)" - ] ++ lib.optional (!stdenv.hostPlatform.isi686) "BACKEND=x86emu"; + ] + ++ lib.optional (!stdenv.hostPlatform.isi686) "BACKEND=x86emu"; preBuild = '' sed -i lrmi.c -e 's@defined(__i386__)@(defined(__i386__) || defined(__x86_64__))@' diff --git a/pkgs/by-name/li/libxisf/package.nix b/pkgs/by-name/li/libxisf/package.nix index 60cea171bfde..a421b6594b2f 100644 --- a/pkgs/by-name/li/libxisf/package.nix +++ b/pkgs/by-name/li/libxisf/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DUSE_BUNDLED_LIBS=OFF" - ] ++ lib.optional stdenv.hostPlatform.isStatic "-DBUILD_SHARED_LIBS=OFF"; + ] + ++ lib.optional stdenv.hostPlatform.isStatic "-DBUILD_SHARED_LIBS=OFF"; buildInputs = [ lz4 diff --git a/pkgs/by-name/li/libxkbcommon_8/package.nix b/pkgs/by-name/li/libxkbcommon_8/package.nix index 3a35ac192a2e..c776aa0ab9fb 100644 --- a/pkgs/by-name/li/libxkbcommon_8/package.nix +++ b/pkgs/by-name/li/libxkbcommon_8/package.nix @@ -52,17 +52,17 @@ stdenv.mkDerivation (finalAttrs: { bison doxygen xorg.xvfb - ] ++ lib.optional withWaylandTools wayland-scanner; - buildInputs = - [ - xkeyboard_config - libxcb - libxml2 - ] - ++ lib.optionals withWaylandTools [ - wayland - wayland-protocols - ]; + ] + ++ lib.optional withWaylandTools wayland-scanner; + buildInputs = [ + xkeyboard_config + libxcb + libxml2 + ] + ++ lib.optionals withWaylandTools [ + wayland + wayland-protocols + ]; nativeCheckInputs = [ python3 ]; mesonFlags = [ diff --git a/pkgs/by-name/li/libxklavier/package.nix b/pkgs/by-name/li/libxklavier/package.nix index aacab4527abb..acb02a343f54 100644 --- a/pkgs/by-name/li/libxklavier/package.nix +++ b/pkgs/by-name/li/libxklavier/package.nix @@ -26,21 +26,21 @@ stdenv.mkDerivation rec { sha256 = "1w1x5mrgly2ldiw3q2r6y620zgd89gk7n90ja46775lhaswxzv7a"; }; - patches = - [ - ./honor-XKB_CONFIG_ROOT.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (fetchpatch { - url = "https://gitlab.freedesktop.org/archived-projects/libxklavier/-/commit/1387c21a788ec1ea203c8392ea1460fc29d83f70.patch"; - sha256 = "sha256-fyWu7sVfDv/ozjhLSLCVsv+iNFawWgJqHUsQHHSkQn4="; - }) - ]; + patches = [ + ./honor-XKB_CONFIG_ROOT.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (fetchpatch { + url = "https://gitlab.freedesktop.org/archived-projects/libxklavier/-/commit/1387c21a788ec1ea203c8392ea1460fc29d83f70.patch"; + sha256 = "sha256-fyWu7sVfDv/ozjhLSLCVsv+iNFawWgJqHUsQHHSkQn4="; + }) + ]; outputs = [ "out" "dev" - ] ++ lib.optionals withDoc [ "devdoc" ]; + ] + ++ lib.optionals withDoc [ "devdoc" ]; # TODO: enable xmodmap support, needs xmodmap DB propagatedBuildInputs = with xorg; [ diff --git a/pkgs/by-name/li/libxmlb/package.nix b/pkgs/by-name/li/libxmlb/package.nix index 91137b535c89..e0d778528d5d 100644 --- a/pkgs/by-name/li/libxmlb/package.nix +++ b/pkgs/by-name/li/libxmlb/package.nix @@ -25,16 +25,15 @@ stdenv.mkDerivation rec { pname = "libxmlb"; version = "0.3.22"; - outputs = - [ - "out" - "lib" - "dev" - "installedTests" - ] - ++ lib.optionals withIntrospection [ - "devdoc" - ]; + outputs = [ + "out" + "lib" + "dev" + "installedTests" + ] + ++ lib.optionals withIntrospection [ + "devdoc" + ]; src = fetchFromGitHub { owner = "hughsie"; @@ -47,20 +46,19 @@ stdenv.mkDerivation rec { ./installed-tests-path.patch ]; - nativeBuildInputs = - [ - docbook_xml_dtd_43 - docbook-xsl-nons - meson - ninja - pkg-config - python3 - shared-mime-info - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - gtk-doc - ]; + nativeBuildInputs = [ + docbook_xml_dtd_43 + docbook-xsl-nons + meson + ninja + pkg-config + python3 + shared-mime-info + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + gtk-doc + ]; buildInputs = [ glib diff --git a/pkgs/by-name/li/libyafaray/package.nix b/pkgs/by-name/li/libyafaray/package.nix index 69d2aaad0466..921393408c3b 100644 --- a/pkgs/by-name/li/libyafaray/package.nix +++ b/pkgs/by-name/li/libyafaray/package.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation { openexr swig zlib - ] ++ lib.optional withPython python3; + ] + ++ lib.optional withPython python3; meta = with lib; { description = "Free, open source raytracer"; diff --git a/pkgs/by-name/li/libzakalwe/package.nix b/pkgs/by-name/li/libzakalwe/package.nix index 912eae924579..6d7e3c427fb5 100644 --- a/pkgs/by-name/li/libzakalwe/package.nix +++ b/pkgs/by-name/li/libzakalwe/package.nix @@ -21,15 +21,14 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - postPatch = - '' - substituteInPlace Makefile.in \ - --replace-fail 'libzakalwe.so' "libzakalwe${stdenv.hostPlatform.extensions.sharedLibrary}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Makefile.in \ - --replace-fail '-soname' '-install_name' - ''; + postPatch = '' + substituteInPlace Makefile.in \ + --replace-fail 'libzakalwe.so' "libzakalwe${stdenv.hostPlatform.extensions.sharedLibrary}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Makefile.in \ + --replace-fail '-soname' '-install_name' + ''; strictDeps = true; diff --git a/pkgs/by-name/li/libzbc/package.nix b/pkgs/by-name/li/libzbc/package.nix index d7c00b7b296e..f4e935ae12e7 100644 --- a/pkgs/by-name/li/libzbc/package.nix +++ b/pkgs/by-name/li/libzbc/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook libtool - ] ++ lib.optionals guiSupport [ pkg-config ]; + ] + ++ lib.optionals guiSupport [ pkg-config ]; buildInputs = lib.optionals guiSupport [ gtk3 ]; diff --git a/pkgs/by-name/li/libzbd/package.nix b/pkgs/by-name/li/libzbd/package.nix index 2276e1dfc4d5..d40745a6b825 100644 --- a/pkgs/by-name/li/libzbd/package.nix +++ b/pkgs/by-name/li/libzbd/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation rec { autoconf-archive # this can be removed with the next release autoreconfHook libtool - ] ++ lib.optionals guiSupport [ pkg-config ]; + ] + ++ lib.optionals guiSupport [ pkg-config ]; buildInputs = lib.optionals guiSupport [ gtk3 ]; diff --git a/pkgs/by-name/li/liferea/package.nix b/pkgs/by-name/li/liferea/package.nix index 270a2a49e7b9..2611b3396f91 100644 --- a/pkgs/by-name/li/liferea/package.nix +++ b/pkgs/by-name/li/liferea/package.nix @@ -41,28 +41,27 @@ stdenv.mkDerivation rec { gobject-introspection ]; - buildInputs = - [ - glib - gtk3 - webkitgtk_4_1 - libxml2 - libxslt - sqlite - libsoup_3 - libpeas - gsettings-desktop-schemas - json-glib - libsecret - glib-networking - libnotify - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ]); + buildInputs = [ + glib + gtk3 + webkitgtk_4_1 + libxml2 + libxslt + sqlite + libsoup_3 + libpeas + gsettings-desktop-schemas + json-glib + libsecret + glib-networking + libnotify + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ]); enableParallelBuilding = true; diff --git a/pkgs/by-name/li/lightgbm/package.nix b/pkgs/by-name/li/lightgbm/package.nix index dead207507f8..37a6eb92ab6d 100644 --- a/pkgs/by-name/li/lightgbm/package.nix +++ b/pkgs/by-name/li/lightgbm/package.nix @@ -92,22 +92,23 @@ stdenv.mkDerivation (finalAttrs: { rm tests/cpp_tests/test_arrow.cpp ''; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ] - ++ lib.optionals openclSupport [ - opencl-headers - ocl-icd - boost - ] - ++ lib.optionals mpiSupport [ openmpi ] - ++ lib.optionals hdfsSupport [ hadoop ] - ++ lib.optionals (hdfsSupport || javaWrapper) [ openjdk ] - ++ lib.optionals javaWrapper [ swig ] - ++ lib.optionals rLibrary [ - R - pandoc - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ] + ++ lib.optionals openclSupport [ + opencl-headers + ocl-icd + boost + ] + ++ lib.optionals mpiSupport [ openmpi ] + ++ lib.optionals hdfsSupport [ hadoop ] + ++ lib.optionals (hdfsSupport || javaWrapper) [ openjdk ] + ++ lib.optionals javaWrapper [ swig ] + ++ lib.optionals rLibrary [ + R + pandoc + ]; buildInputs = [ gtest ] ++ lib.optional cudaSupport cudaPackages.cudatoolkit; @@ -161,48 +162,47 @@ stdenv.mkDerivation (finalAttrs: { inherit doCheck; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString (!rLibrary) '' - mkdir -p $out - mkdir -p $out/lib - mkdir -p $out/bin - cp -r ../include $out - install -Dm755 ../lib_lightgbm${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/lib_lightgbm${stdenv.hostPlatform.extensions.sharedLibrary} - '' - + lib.optionalString (!rLibrary && !pythonLibrary) '' - install -Dm755 ../lightgbm $out/bin/lightgbm - '' - + lib.optionalString javaWrapper '' - cp -r java $out - cp -r com $out - cp -r lightgbmlib.jar $out - '' - + '''' - + lib.optionalString rLibrary '' - mkdir $out - mkdir $out/tmp - mkdir $out/library - mkdir $out/library/lightgbm - '' - + lib.optionalString (rLibrary && (!openclSupport)) '' - Rscript build_r.R \ - -j$NIX_BUILD_CORES - rm -rf $out/tmp - '' - + lib.optionalString (rLibrary && openclSupport) '' - Rscript build_r.R --use-gpu \ - --opencl-library=${ocl-icd}/lib/libOpenCL.so \ - --opencl-include-dir=${opencl-headers}/include \ - --boost-librarydir=${boost} \ - -j$NIX_BUILD_CORES - rm -rf $out/tmp - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + lib.optionalString (!rLibrary) '' + mkdir -p $out + mkdir -p $out/lib + mkdir -p $out/bin + cp -r ../include $out + install -Dm755 ../lib_lightgbm${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/lib_lightgbm${stdenv.hostPlatform.extensions.sharedLibrary} + '' + + lib.optionalString (!rLibrary && !pythonLibrary) '' + install -Dm755 ../lightgbm $out/bin/lightgbm + '' + + lib.optionalString javaWrapper '' + cp -r java $out + cp -r com $out + cp -r lightgbmlib.jar $out + '' + + '''' + + lib.optionalString rLibrary '' + mkdir $out + mkdir $out/tmp + mkdir $out/library + mkdir $out/library/lightgbm + '' + + lib.optionalString (rLibrary && (!openclSupport)) '' + Rscript build_r.R \ + -j$NIX_BUILD_CORES + rm -rf $out/tmp + '' + + lib.optionalString (rLibrary && openclSupport) '' + Rscript build_r.R --use-gpu \ + --opencl-library=${ocl-icd}/lib/libOpenCL.so \ + --opencl-include-dir=${opencl-headers}/include \ + --boost-librarydir=${boost} \ + -j$NIX_BUILD_CORES + rm -rf $out/tmp + '' + + '' + runHook postInstall + ''; postFixup = lib.optionalString rLibrary '' if test -e $out/nix-support/propagated-build-inputs; then diff --git a/pkgs/by-name/li/lighthouse/package.nix b/pkgs/by-name/li/lighthouse/package.nix index 20984f24075c..44316dfd12f7 100644 --- a/pkgs/by-name/li/lighthouse/package.nix +++ b/pkgs/by-name/li/lighthouse/package.nix @@ -50,14 +50,13 @@ rustPlatform.buildRustPackage rec { protobuf ]; - buildInputs = - [ - rust-jemalloc-sys - sqlite - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - openssl - ]; + buildInputs = [ + rust-jemalloc-sys + sqlite + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + openssl + ]; depositContractSpec = fetchurl { url = "https://raw.githubusercontent.com/ethereum/eth2.0-specs/v${depositContractSpecVersion}/deposit_contract/contracts/validator_registration.json"; @@ -97,232 +96,231 @@ rustPlatform.buildRustPackage rec { ]; # All of these tests require network access - checkFlags = - [ - "--skip tests::broadcast_should_send_to_all_bns" - "--skip tests::check_candidate_order" - "--skip tests::first_success_should_try_nodes_in_order" - "--skip tests::update_all_candidates_should_update_sync_status" - "--skip engine_api::http::test::forkchoice_updated_v1_request" - "--skip engine_api::http::test::forkchoice_updated_v1_with_payload_attributes_request" - "--skip engine_api::http::test::get_block_by_hash_request" - "--skip engine_api::http::test::get_block_by_number_request" - "--skip engine_api::http::test::get_payload_v1_request" - "--skip engine_api::http::test::geth_test_vectors" - "--skip engine_api::http::test::new_payload_v1_request" - "--skip test::finds_valid_terminal_block_hash" - "--skip test::produce_three_valid_pos_execution_blocks" - "--skip test::rejects_invalid_terminal_block_hash" - "--skip test::rejects_terminal_block_with_equal_timestamp" - "--skip test::rejects_unknown_terminal_block_hash" - "--skip test::test_forked_terminal_block" - "--skip test::verifies_valid_terminal_block_hash" - "--skip deposit_tree::cache_consistency" - "--skip deposit_tree::double_update" - "--skip deposit_tree::updating" - "--skip eth1_cache::big_skip" - "--skip eth1_cache::double_update" - "--skip eth1_cache::pruning" - "--skip eth1_cache::simple_scenario" - "--skip fast::deposit_cache_query" - "--skip http::incrementing_deposits" - "--skip persist::test_persist_caches" - "--skip can_read_finalized_block" - "--skip invalid_attestation_delayed_slot" - "--skip invalid_attestation_empty_bitfield" - "--skip invalid_attestation_future_block" - "--skip invalid_attestation_future_epoch" - "--skip invalid_attestation_inconsistent_ffg_vote" - "--skip invalid_attestation_past_epoch" - "--skip invalid_attestation_target_epoch" - "--skip invalid_attestation_unknown_beacon_block_root" - "--skip invalid_attestation_unknown_target_root" - "--skip invalid_block_finalized_descendant" - "--skip invalid_block_finalized_slot" - "--skip invalid_block_future_slot" - "--skip invalid_block_unknown_parent" - "--skip justified_and_finalized_blocks" - "--skip justified_balances" - "--skip justified_checkpoint_updates_with_descendent" - "--skip justified_checkpoint_updates_with_descendent_first_justification" - "--skip justified_checkpoint_updates_with_non_descendent" - "--skip progressive_balances_cache_attester_slashing" - "--skip progressive_balances_cache_proposer_slashing" - "--skip valid_attestation" - "--skip valid_attestation_skip_across_epoch" - "--skip weak_subjectivity_check_epoch_boundary_is_skip_slot" - "--skip weak_subjectivity_check_epoch_boundary_is_skip_slot_failure" - "--skip weak_subjectivity_check_fails_early_epoch" - "--skip weak_subjectivity_check_fails_incorrect_root" - "--skip weak_subjectivity_check_fails_late_epoch" - "--skip weak_subjectivity_check_passes" - "--skip weak_subjectivity_pass_on_startup" - "--skip basic" - "--skip returns_200_ok" - "--skip release_tests::attestation_aggregation_insert_get_prune" - "--skip release_tests::attestation_duplicate" - "--skip release_tests::attestation_get_max" - "--skip release_tests::attestation_pairwise_overlapping" - "--skip release_tests::attestation_rewards" - "--skip release_tests::cross_fork_attester_slashings" - "--skip release_tests::cross_fork_exits" - "--skip release_tests::cross_fork_proposer_slashings" - "--skip release_tests::duplicate_proposer_slashing" - "--skip release_tests::max_coverage_attester_proposer_slashings" - "--skip release_tests::max_coverage_different_indices_set" - "--skip release_tests::max_coverage_effective_balances" - "--skip release_tests::overlapping_max_cover_attester_slashing" - "--skip release_tests::prune_attester_slashing_noop" - "--skip release_tests::prune_proposer_slashing_noop" - "--skip release_tests::simple_max_cover_attester_slashing" - "--skip release_tests::sync_contribution_aggregation_insert_get_prune" - "--skip release_tests::sync_contribution_duplicate" - "--skip release_tests::sync_contribution_with_fewer_bits" - "--skip release_tests::sync_contribution_with_more_bits" - "--skip release_tests::test_earliest_attestation" - "--skip per_block_processing::tests::block_replayer_peeking_state_roots" - "--skip per_block_processing::tests::fork_spanning_exit" - "--skip per_block_processing::tests::invalid_attester_slashing_1_invalid" - "--skip per_block_processing::tests::invalid_attester_slashing_2_invalid" - "--skip per_block_processing::tests::invalid_attester_slashing_not_slashable" - "--skip per_block_processing::tests::invalid_bad_proposal_1_signature" - "--skip per_block_processing::tests::invalid_bad_proposal_2_signature" - "--skip per_block_processing::tests::invalid_block_header_state_slot" - "--skip per_block_processing::tests::invalid_block_signature" - "--skip per_block_processing::tests::invalid_deposit_bad_merkle_proof" - "--skip per_block_processing::tests::invalid_deposit_count_too_small" - "--skip per_block_processing::tests::invalid_deposit_deposit_count_too_big" - "--skip per_block_processing::tests::invalid_deposit_invalid_pub_key" - "--skip per_block_processing::tests::invalid_deposit_wrong_sig" - "--skip per_block_processing::tests::invalid_parent_block_root" - "--skip per_block_processing::tests::invalid_proposer_slashing_duplicate_slashing" - "--skip per_block_processing::tests::invalid_proposer_slashing_proposal_epoch_mismatch" - "--skip per_block_processing::tests::invalid_proposer_slashing_proposals_identical" - "--skip per_block_processing::tests::invalid_proposer_slashing_proposer_unknown" - "--skip per_block_processing::tests::invalid_randao_reveal_signature" - "--skip per_block_processing::tests::valid_4_deposits" - "--skip per_block_processing::tests::valid_block_ok" - "--skip per_block_processing::tests::valid_insert_attester_slashing" - "--skip per_block_processing::tests::valid_insert_proposer_slashing" - "--skip per_epoch_processing::tests::release_tests::altair_state_on_base_fork" - "--skip per_epoch_processing::tests::release_tests::base_state_on_altair_fork" - "--skip per_epoch_processing::tests::runs_without_error" - "--skip exit::custom_tests::valid" - "--skip exit::custom_tests::valid_three" - "--skip exit::tests::invalid_bad_signature" - "--skip exit::tests::invalid_duplicate" - "--skip exit::tests::invalid_exit_already_initiated" - "--skip exit::tests::invalid_future_exit_epoch" - "--skip exit::tests::invalid_not_active_after_exit_epoch" - "--skip exit::tests::invalid_not_active_before_activation_epoch" - "--skip exit::tests::invalid_too_young_by_a_lot" - "--skip exit::tests::invalid_too_young_by_one_epoch" - "--skip exit::tests::invalid_validator_unknown" - "--skip exit::tests::valid_genesis_epoch" - "--skip exit::tests::valid_previous_epoch" - "--skip exit::tests::valid_single_exit" - "--skip exit::tests::valid_three_exits" - "--skip iter::test::block_root_iter" - "--skip iter::test::state_root_iter" - "--skip beacon_state::committee_cache::tests::initializes_with_the_right_epoch" - "--skip beacon_state::committee_cache::tests::min_randao_epoch_correct" - "--skip beacon_state::committee_cache::tests::shuffles_for_the_right_epoch" - "--skip beacon_state::tests::beacon_proposer_index" - "--skip beacon_state::tests::cache_initialization" - "--skip beacon_state::tests::committees::current_epoch_committee_consistency" - "--skip beacon_state::tests::committees::next_epoch_committee_consistency" - "--skip beacon_state::tests::committees::previous_epoch_committee_consistency" - "--skip tests::hd_validator_creation" - "--skip tests::invalid_pubkey" - "--skip tests::keystore_validator_creation" - "--skip tests::keystores::check_get_set_fee_recipient" - "--skip tests::keystores::check_get_set_gas_limit" - "--skip tests::keystores::delete_concurrent_with_signing" - "--skip tests::keystores::delete_keystores_twice" - "--skip tests::keystores::delete_nonexistent_keystores" - "--skip tests::keystores::delete_nonexistent_remotekey" - "--skip tests::keystores::delete_remotekey_then_reimport_different_url" - "--skip tests::keystores::delete_remotekeys_twice" - "--skip tests::keystores::delete_then_reimport" - "--skip tests::keystores::delete_then_reimport_remotekeys" - "--skip tests::keystores::get_auth_no_token" - "--skip tests::keystores::get_empty_keystores" - "--skip tests::keystores::get_empty_remotekeys" - "--skip tests::keystores::get_web3_signer_keystores" - "--skip tests::keystores::import_and_delete_conflicting_web3_signer_keystores" - "--skip tests::keystores::import_invalid_slashing_protection" - "--skip tests::keystores::import_keystores_wrong_password" - "--skip tests::keystores::import_new_keystores" - "--skip tests::keystores::import_new_remotekeys" - "--skip tests::keystores::import_only_duplicate_keystores" - "--skip tests::keystores::import_only_duplicate_remotekeys" - "--skip tests::keystores::import_remote_and_local_keys" - "--skip tests::keystores::import_remotekey_web3signer" - "--skip tests::keystores::import_remotekey_web3signer_disabled" - "--skip tests::keystores::import_remotekey_web3signer_enabled" - "--skip tests::keystores::import_same_local_and_remote_keys" - "--skip tests::keystores::import_same_remote_and_local_keys" - "--skip tests::keystores::import_same_remotekey_different_url" - "--skip tests::keystores::import_some_duplicate_keystores" - "--skip tests::keystores::import_some_duplicate_remotekeys" - "--skip tests::keystores::import_wrong_number_of_passwords" - "--skip tests::keystores::migrate_all_with_slashing_protection" - "--skip tests::keystores::migrate_some_extra_slashing_protection" - "--skip tests::keystores::migrate_some_missing_slashing_protection" - "--skip tests::keystores::migrate_some_with_slashing_protection" - "--skip tests::prefer_builder_proposals_validator" - "--skip tests::routes_with_invalid_auth" - "--skip tests::simple_getters" - "--skip tests::validator_builder_boost_factor" - "--skip tests::validator_builder_boost_factor_global_builder_proposals_false" - "--skip tests::validator_builder_boost_factor_global_builder_proposals_true" - "--skip tests::validator_builder_boost_factor_global_prefer_builder_proposals_true" - "--skip tests::validator_builder_boost_factor_global_prefer_builder_proposals_true_override" - "--skip tests::validator_builder_proposals" - "--skip tests::validator_derived_builder_boost_factor_with_process_defaults" - "--skip tests::validator_enabling" - "--skip tests::validator_exit" - "--skip tests::validator_gas_limit" - "--skip tests::validator_graffiti" - "--skip tests::validator_graffiti_api" - "--skip tests::web3signer_validator_creation" - "--skip create_validators::tests::bogus_bn_url" - "--skip delete_validators::test::delete_multiple_validators" - "--skip import_validators::tests::create_one_validator" - "--skip import_validators::tests::create_one_validator_keystore_format" - "--skip import_validators::tests::create_one_validator_with_offset" - "--skip import_validators::tests::create_one_validator_with_offset_keystore_format" - "--skip import_validators::tests::create_three_validators" - "--skip import_validators::tests::create_three_validators_with_offset" - "--skip import_validators::tests::import_duplicates_when_allowed" - "--skip import_validators::tests::import_duplicates_when_allowed_keystore_format" - "--skip import_validators::tests::import_duplicates_when_disallowed" - "--skip import_validators::tests::import_duplicates_when_disallowed_keystore_format" - "--skip list_validators::test::list_all_validators" - "--skip move_validators::test::no_validators" - "--skip move_validators::test::one_validator_move_all" - "--skip move_validators::test::one_validator_move_all_with_password_files" - "--skip move_validators::test::one_validator_move_one" - "--skip move_validators::test::one_validator_to_non_empty_dest" - "--skip move_validators::test::one_validators_move_two_by_count" - "--skip move_validators::test::three_validators_move_all" - "--skip move_validators::test::three_validators_move_one" - "--skip move_validators::test::three_validators_move_one_by_count" - "--skip move_validators::test::three_validators_move_three" - "--skip move_validators::test::three_validators_move_two" - "--skip move_validators::test::three_validators_move_two_by_count" - "--skip move_validators::test::two_validator_move_all_and_back_again" - "--skip move_validators::test::two_validator_move_all_passwords_removed" - "--skip move_validators::test::two_validator_move_all_passwords_removed_failed_password_attempt" - "--skip move_validators::test::two_validators_move_all_where_one_is_a_duplicate" - "--skip move_validators::test::two_validators_move_one_where_one_is_a_duplicate" - "--skip move_validators::test::two_validators_move_one_with_identical_password_files" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin) [ - "--skip subnet_service::tests::attestation_service::test_subscribe_same_subnet_several_slots_apart" - "--skip subnet_service::tests::sync_committee_service::same_subscription_with_lower_until_epoch" - "--skip subnet_service::tests::sync_committee_service::subscribe_and_unsubscribe" - ]; + checkFlags = [ + "--skip tests::broadcast_should_send_to_all_bns" + "--skip tests::check_candidate_order" + "--skip tests::first_success_should_try_nodes_in_order" + "--skip tests::update_all_candidates_should_update_sync_status" + "--skip engine_api::http::test::forkchoice_updated_v1_request" + "--skip engine_api::http::test::forkchoice_updated_v1_with_payload_attributes_request" + "--skip engine_api::http::test::get_block_by_hash_request" + "--skip engine_api::http::test::get_block_by_number_request" + "--skip engine_api::http::test::get_payload_v1_request" + "--skip engine_api::http::test::geth_test_vectors" + "--skip engine_api::http::test::new_payload_v1_request" + "--skip test::finds_valid_terminal_block_hash" + "--skip test::produce_three_valid_pos_execution_blocks" + "--skip test::rejects_invalid_terminal_block_hash" + "--skip test::rejects_terminal_block_with_equal_timestamp" + "--skip test::rejects_unknown_terminal_block_hash" + "--skip test::test_forked_terminal_block" + "--skip test::verifies_valid_terminal_block_hash" + "--skip deposit_tree::cache_consistency" + "--skip deposit_tree::double_update" + "--skip deposit_tree::updating" + "--skip eth1_cache::big_skip" + "--skip eth1_cache::double_update" + "--skip eth1_cache::pruning" + "--skip eth1_cache::simple_scenario" + "--skip fast::deposit_cache_query" + "--skip http::incrementing_deposits" + "--skip persist::test_persist_caches" + "--skip can_read_finalized_block" + "--skip invalid_attestation_delayed_slot" + "--skip invalid_attestation_empty_bitfield" + "--skip invalid_attestation_future_block" + "--skip invalid_attestation_future_epoch" + "--skip invalid_attestation_inconsistent_ffg_vote" + "--skip invalid_attestation_past_epoch" + "--skip invalid_attestation_target_epoch" + "--skip invalid_attestation_unknown_beacon_block_root" + "--skip invalid_attestation_unknown_target_root" + "--skip invalid_block_finalized_descendant" + "--skip invalid_block_finalized_slot" + "--skip invalid_block_future_slot" + "--skip invalid_block_unknown_parent" + "--skip justified_and_finalized_blocks" + "--skip justified_balances" + "--skip justified_checkpoint_updates_with_descendent" + "--skip justified_checkpoint_updates_with_descendent_first_justification" + "--skip justified_checkpoint_updates_with_non_descendent" + "--skip progressive_balances_cache_attester_slashing" + "--skip progressive_balances_cache_proposer_slashing" + "--skip valid_attestation" + "--skip valid_attestation_skip_across_epoch" + "--skip weak_subjectivity_check_epoch_boundary_is_skip_slot" + "--skip weak_subjectivity_check_epoch_boundary_is_skip_slot_failure" + "--skip weak_subjectivity_check_fails_early_epoch" + "--skip weak_subjectivity_check_fails_incorrect_root" + "--skip weak_subjectivity_check_fails_late_epoch" + "--skip weak_subjectivity_check_passes" + "--skip weak_subjectivity_pass_on_startup" + "--skip basic" + "--skip returns_200_ok" + "--skip release_tests::attestation_aggregation_insert_get_prune" + "--skip release_tests::attestation_duplicate" + "--skip release_tests::attestation_get_max" + "--skip release_tests::attestation_pairwise_overlapping" + "--skip release_tests::attestation_rewards" + "--skip release_tests::cross_fork_attester_slashings" + "--skip release_tests::cross_fork_exits" + "--skip release_tests::cross_fork_proposer_slashings" + "--skip release_tests::duplicate_proposer_slashing" + "--skip release_tests::max_coverage_attester_proposer_slashings" + "--skip release_tests::max_coverage_different_indices_set" + "--skip release_tests::max_coverage_effective_balances" + "--skip release_tests::overlapping_max_cover_attester_slashing" + "--skip release_tests::prune_attester_slashing_noop" + "--skip release_tests::prune_proposer_slashing_noop" + "--skip release_tests::simple_max_cover_attester_slashing" + "--skip release_tests::sync_contribution_aggregation_insert_get_prune" + "--skip release_tests::sync_contribution_duplicate" + "--skip release_tests::sync_contribution_with_fewer_bits" + "--skip release_tests::sync_contribution_with_more_bits" + "--skip release_tests::test_earliest_attestation" + "--skip per_block_processing::tests::block_replayer_peeking_state_roots" + "--skip per_block_processing::tests::fork_spanning_exit" + "--skip per_block_processing::tests::invalid_attester_slashing_1_invalid" + "--skip per_block_processing::tests::invalid_attester_slashing_2_invalid" + "--skip per_block_processing::tests::invalid_attester_slashing_not_slashable" + "--skip per_block_processing::tests::invalid_bad_proposal_1_signature" + "--skip per_block_processing::tests::invalid_bad_proposal_2_signature" + "--skip per_block_processing::tests::invalid_block_header_state_slot" + "--skip per_block_processing::tests::invalid_block_signature" + "--skip per_block_processing::tests::invalid_deposit_bad_merkle_proof" + "--skip per_block_processing::tests::invalid_deposit_count_too_small" + "--skip per_block_processing::tests::invalid_deposit_deposit_count_too_big" + "--skip per_block_processing::tests::invalid_deposit_invalid_pub_key" + "--skip per_block_processing::tests::invalid_deposit_wrong_sig" + "--skip per_block_processing::tests::invalid_parent_block_root" + "--skip per_block_processing::tests::invalid_proposer_slashing_duplicate_slashing" + "--skip per_block_processing::tests::invalid_proposer_slashing_proposal_epoch_mismatch" + "--skip per_block_processing::tests::invalid_proposer_slashing_proposals_identical" + "--skip per_block_processing::tests::invalid_proposer_slashing_proposer_unknown" + "--skip per_block_processing::tests::invalid_randao_reveal_signature" + "--skip per_block_processing::tests::valid_4_deposits" + "--skip per_block_processing::tests::valid_block_ok" + "--skip per_block_processing::tests::valid_insert_attester_slashing" + "--skip per_block_processing::tests::valid_insert_proposer_slashing" + "--skip per_epoch_processing::tests::release_tests::altair_state_on_base_fork" + "--skip per_epoch_processing::tests::release_tests::base_state_on_altair_fork" + "--skip per_epoch_processing::tests::runs_without_error" + "--skip exit::custom_tests::valid" + "--skip exit::custom_tests::valid_three" + "--skip exit::tests::invalid_bad_signature" + "--skip exit::tests::invalid_duplicate" + "--skip exit::tests::invalid_exit_already_initiated" + "--skip exit::tests::invalid_future_exit_epoch" + "--skip exit::tests::invalid_not_active_after_exit_epoch" + "--skip exit::tests::invalid_not_active_before_activation_epoch" + "--skip exit::tests::invalid_too_young_by_a_lot" + "--skip exit::tests::invalid_too_young_by_one_epoch" + "--skip exit::tests::invalid_validator_unknown" + "--skip exit::tests::valid_genesis_epoch" + "--skip exit::tests::valid_previous_epoch" + "--skip exit::tests::valid_single_exit" + "--skip exit::tests::valid_three_exits" + "--skip iter::test::block_root_iter" + "--skip iter::test::state_root_iter" + "--skip beacon_state::committee_cache::tests::initializes_with_the_right_epoch" + "--skip beacon_state::committee_cache::tests::min_randao_epoch_correct" + "--skip beacon_state::committee_cache::tests::shuffles_for_the_right_epoch" + "--skip beacon_state::tests::beacon_proposer_index" + "--skip beacon_state::tests::cache_initialization" + "--skip beacon_state::tests::committees::current_epoch_committee_consistency" + "--skip beacon_state::tests::committees::next_epoch_committee_consistency" + "--skip beacon_state::tests::committees::previous_epoch_committee_consistency" + "--skip tests::hd_validator_creation" + "--skip tests::invalid_pubkey" + "--skip tests::keystore_validator_creation" + "--skip tests::keystores::check_get_set_fee_recipient" + "--skip tests::keystores::check_get_set_gas_limit" + "--skip tests::keystores::delete_concurrent_with_signing" + "--skip tests::keystores::delete_keystores_twice" + "--skip tests::keystores::delete_nonexistent_keystores" + "--skip tests::keystores::delete_nonexistent_remotekey" + "--skip tests::keystores::delete_remotekey_then_reimport_different_url" + "--skip tests::keystores::delete_remotekeys_twice" + "--skip tests::keystores::delete_then_reimport" + "--skip tests::keystores::delete_then_reimport_remotekeys" + "--skip tests::keystores::get_auth_no_token" + "--skip tests::keystores::get_empty_keystores" + "--skip tests::keystores::get_empty_remotekeys" + "--skip tests::keystores::get_web3_signer_keystores" + "--skip tests::keystores::import_and_delete_conflicting_web3_signer_keystores" + "--skip tests::keystores::import_invalid_slashing_protection" + "--skip tests::keystores::import_keystores_wrong_password" + "--skip tests::keystores::import_new_keystores" + "--skip tests::keystores::import_new_remotekeys" + "--skip tests::keystores::import_only_duplicate_keystores" + "--skip tests::keystores::import_only_duplicate_remotekeys" + "--skip tests::keystores::import_remote_and_local_keys" + "--skip tests::keystores::import_remotekey_web3signer" + "--skip tests::keystores::import_remotekey_web3signer_disabled" + "--skip tests::keystores::import_remotekey_web3signer_enabled" + "--skip tests::keystores::import_same_local_and_remote_keys" + "--skip tests::keystores::import_same_remote_and_local_keys" + "--skip tests::keystores::import_same_remotekey_different_url" + "--skip tests::keystores::import_some_duplicate_keystores" + "--skip tests::keystores::import_some_duplicate_remotekeys" + "--skip tests::keystores::import_wrong_number_of_passwords" + "--skip tests::keystores::migrate_all_with_slashing_protection" + "--skip tests::keystores::migrate_some_extra_slashing_protection" + "--skip tests::keystores::migrate_some_missing_slashing_protection" + "--skip tests::keystores::migrate_some_with_slashing_protection" + "--skip tests::prefer_builder_proposals_validator" + "--skip tests::routes_with_invalid_auth" + "--skip tests::simple_getters" + "--skip tests::validator_builder_boost_factor" + "--skip tests::validator_builder_boost_factor_global_builder_proposals_false" + "--skip tests::validator_builder_boost_factor_global_builder_proposals_true" + "--skip tests::validator_builder_boost_factor_global_prefer_builder_proposals_true" + "--skip tests::validator_builder_boost_factor_global_prefer_builder_proposals_true_override" + "--skip tests::validator_builder_proposals" + "--skip tests::validator_derived_builder_boost_factor_with_process_defaults" + "--skip tests::validator_enabling" + "--skip tests::validator_exit" + "--skip tests::validator_gas_limit" + "--skip tests::validator_graffiti" + "--skip tests::validator_graffiti_api" + "--skip tests::web3signer_validator_creation" + "--skip create_validators::tests::bogus_bn_url" + "--skip delete_validators::test::delete_multiple_validators" + "--skip import_validators::tests::create_one_validator" + "--skip import_validators::tests::create_one_validator_keystore_format" + "--skip import_validators::tests::create_one_validator_with_offset" + "--skip import_validators::tests::create_one_validator_with_offset_keystore_format" + "--skip import_validators::tests::create_three_validators" + "--skip import_validators::tests::create_three_validators_with_offset" + "--skip import_validators::tests::import_duplicates_when_allowed" + "--skip import_validators::tests::import_duplicates_when_allowed_keystore_format" + "--skip import_validators::tests::import_duplicates_when_disallowed" + "--skip import_validators::tests::import_duplicates_when_disallowed_keystore_format" + "--skip list_validators::test::list_all_validators" + "--skip move_validators::test::no_validators" + "--skip move_validators::test::one_validator_move_all" + "--skip move_validators::test::one_validator_move_all_with_password_files" + "--skip move_validators::test::one_validator_move_one" + "--skip move_validators::test::one_validator_to_non_empty_dest" + "--skip move_validators::test::one_validators_move_two_by_count" + "--skip move_validators::test::three_validators_move_all" + "--skip move_validators::test::three_validators_move_one" + "--skip move_validators::test::three_validators_move_one_by_count" + "--skip move_validators::test::three_validators_move_three" + "--skip move_validators::test::three_validators_move_two" + "--skip move_validators::test::three_validators_move_two_by_count" + "--skip move_validators::test::two_validator_move_all_and_back_again" + "--skip move_validators::test::two_validator_move_all_passwords_removed" + "--skip move_validators::test::two_validator_move_all_passwords_removed_failed_password_attempt" + "--skip move_validators::test::two_validators_move_all_where_one_is_a_duplicate" + "--skip move_validators::test::two_validators_move_one_where_one_is_a_duplicate" + "--skip move_validators::test::two_validators_move_one_with_identical_password_files" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin) [ + "--skip subnet_service::tests::attestation_service::test_subscribe_same_subnet_several_slots_apart" + "--skip subnet_service::tests::sync_committee_service::same_subscription_with_lower_until_epoch" + "--skip subnet_service::tests::sync_committee_service::subscribe_and_unsubscribe" + ]; passthru = { tests.version = testers.testVersion { diff --git a/pkgs/by-name/li/lighttpd/package.nix b/pkgs/by-name/li/lighttpd/package.nix index edfd21231602..6962e9bcc0c0 100644 --- a/pkgs/by-name/li/lighttpd/package.nix +++ b/pkgs/by-name/li/lighttpd/package.nix @@ -53,37 +53,37 @@ stdenv.mkDerivation rec { autoreconfHook pkg-config ]; - buildInputs = - [ - pcre2 - pcre2.dev - libxml2 - zlib - bzip2 - which - file - openssl - ] - ++ lib.optional enableDbi libdbi - ++ lib.optional enableMagnet lua5_1 - ++ lib.optional enableMysql libmysqlclient - ++ lib.optional enableLdap openldap - ++ lib.optional enablePam linux-pam - ++ lib.optional enableSasl cyrus_sasl - ++ lib.optional enableWebDAV sqlite - ++ lib.optional enableWebDAV libuuid; + buildInputs = [ + pcre2 + pcre2.dev + libxml2 + zlib + bzip2 + which + file + openssl + ] + ++ lib.optional enableDbi libdbi + ++ lib.optional enableMagnet lua5_1 + ++ lib.optional enableMysql libmysqlclient + ++ lib.optional enableLdap openldap + ++ lib.optional enablePam linux-pam + ++ lib.optional enableSasl cyrus_sasl + ++ lib.optional enableWebDAV sqlite + ++ lib.optional enableWebDAV libuuid; - configureFlags = - [ "--with-openssl" ] - ++ lib.optional enableDbi "--with-dbi" - ++ lib.optional enableMagnet "--with-lua" - ++ lib.optional enableMysql "--with-mysql" - ++ lib.optional enableLdap "--with-ldap" - ++ lib.optional enablePam "--with-pam" - ++ lib.optional enableSasl "--with-sasl" - ++ lib.optional enableWebDAV "--with-webdav-props" - ++ lib.optional enableWebDAV "--with-webdav-locks" - ++ lib.optional enableExtendedAttrs "--with-attr"; + configureFlags = [ + "--with-openssl" + ] + ++ lib.optional enableDbi "--with-dbi" + ++ lib.optional enableMagnet "--with-lua" + ++ lib.optional enableMysql "--with-mysql" + ++ lib.optional enableLdap "--with-ldap" + ++ lib.optional enablePam "--with-pam" + ++ lib.optional enableSasl "--with-sasl" + ++ lib.optional enableWebDAV "--with-webdav-props" + ++ lib.optional enableWebDAV "--with-webdav-locks" + ++ lib.optional enableExtendedAttrs "--with-attr"; preConfigure = '' export PATH=$PATH:${pcre2.dev}/bin diff --git a/pkgs/by-name/li/lilv/package.nix b/pkgs/by-name/li/lilv/package.nix index 32b0bb70bf36..4935cb394ee9 100644 --- a/pkgs/by-name/li/lilv/package.nix +++ b/pkgs/by-name/li/lilv/package.nix @@ -46,24 +46,23 @@ stdenv.mkDerivation rec { ]; propagatedBuildInputs = [ lv2 ]; - mesonFlags = - [ - (lib.mesonOption "docs" "disabled") - # Tests require building a shared library. - (lib.mesonEnable "tests" (!stdenv.hostPlatform.isStatic)) - ] - # Add nix and NixOS specific lv2 paths - # The default values are from: https://github.com/lv2/lilv/blob/master/src/lilv_config.h - ++ lib.optional stdenv.hostPlatform.isDarwin ( - lib.mesonOption "default_lv2_path" "~/.lv2:~/Library/Audio/Plug-Ins/LV2:" - + "/usr/local/lib/lv2:/usr/lib/lv2:" - + "/Library/Audio/Plug-Ins/LV2:" - + "~/.nix-profile/lib/lv2" - ) - ++ lib.optional stdenv.hostPlatform.isLinux ( - lib.mesonOption "default_lv2_path" "~/.lv2:/usr/local/lib/lv2:/usr/lib/lv2:" - + "~/.nix-profile/lib/lv2:/run/current-system/sw/lib/lv2" - ); + mesonFlags = [ + (lib.mesonOption "docs" "disabled") + # Tests require building a shared library. + (lib.mesonEnable "tests" (!stdenv.hostPlatform.isStatic)) + ] + # Add nix and NixOS specific lv2 paths + # The default values are from: https://github.com/lv2/lilv/blob/master/src/lilv_config.h + ++ lib.optional stdenv.hostPlatform.isDarwin ( + lib.mesonOption "default_lv2_path" "~/.lv2:~/Library/Audio/Plug-Ins/LV2:" + + "/usr/local/lib/lv2:/usr/lib/lv2:" + + "/Library/Audio/Plug-Ins/LV2:" + + "~/.nix-profile/lib/lv2" + ) + ++ lib.optional stdenv.hostPlatform.isLinux ( + lib.mesonOption "default_lv2_path" "~/.lv2:/usr/local/lib/lv2:/usr/lib/lv2:" + + "~/.nix-profile/lib/lv2:/run/current-system/sw/lib/lv2" + ); passthru = { tests = { diff --git a/pkgs/by-name/li/lima/package.nix b/pkgs/by-name/li/lima/package.nix index 10cae8a9f38d..ce0c159f5a20 100644 --- a/pkgs/by-name/li/lima/package.nix +++ b/pkgs/by-name/li/lima/package.nix @@ -39,7 +39,8 @@ buildGoModule (finalAttrs: { # For checkPhase, and installPhase(required to build completion) writableTmpDirAsHomeHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_15 ]; @@ -68,23 +69,22 @@ buildGoModule (finalAttrs: { runHook postBuild ''; - installPhase = - '' - runHook preInstall - mkdir -p $out - cp -r _output/* $out - wrapProgram $out/bin/limactl \ - --prefix PATH : ${lib.makeBinPath [ qemu ]} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd limactl \ - --bash <($out/bin/limactl completion bash) \ - --fish <($out/bin/limactl completion fish) \ - --zsh <($out/bin/limactl completion zsh) - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r _output/* $out + wrapProgram $out/bin/limactl \ + --prefix PATH : ${lib.makeBinPath [ qemu ]} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd limactl \ + --bash <($out/bin/limactl completion bash) \ + --fish <($out/bin/limactl completion fish) \ + --zsh <($out/bin/limactl completion zsh) + '' + + '' + runHook postInstall + ''; postInstall = lib.optionalString withAdditionalGuestAgents '' cp -rs '${lima-additional-guestagents}/share/lima/.' "$out/share/lima/" diff --git a/pkgs/by-name/li/limine/package.nix b/pkgs/by-name/li/limine/package.nix index 25d8afd115be..de2f850afae9 100644 --- a/pkgs/by-name/li/limine/package.nix +++ b/pkgs/by-name/li/limine/package.nix @@ -54,16 +54,15 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - nativeBuildInputs = - [ - llvmPackages.clang-unwrapped - llvmPackages.libllvm - llvmPackages.lld - ] - ++ lib.optionals (enableAll || buildCDs) [ - mtools - ] - ++ lib.optionals hasX86 [ nasm ]; + nativeBuildInputs = [ + llvmPackages.clang-unwrapped + llvmPackages.libllvm + llvmPackages.lld + ] + ++ lib.optionals (enableAll || buildCDs) [ + mtools + ] + ++ lib.optionals hasX86 [ nasm ]; outputs = [ "out" diff --git a/pkgs/by-name/li/limo/package.nix b/pkgs/by-name/li/limo/package.nix index 2efce77c2cd4..d6ee2077b721 100644 --- a/pkgs/by-name/li/limo/package.nix +++ b/pkgs/by-name/li/limo/package.nix @@ -43,34 +43,32 @@ stdenv.mkDerivation (finalAttrs: { libsForQt5.wrapQtAppsHook ]; - buildInputs = - [ - jsoncpp - libarchive - libcpr - libloot - lz4 - pugixml + buildInputs = [ + jsoncpp + libarchive + libcpr + libloot + lz4 + pugixml - libsForQt5.qtbase - libsForQt5.qtsvg - libsForQt5.qtwayland - ] - ++ lib.optionals withUnrar [ - unrar - ]; + libsForQt5.qtbase + libsForQt5.qtsvg + libsForQt5.qtwayland + ] + ++ lib.optionals withUnrar [ + unrar + ]; - cmakeFlags = - [ - (lib.cmakeFeature "LIMO_INSTALL_PREFIX" (placeholder "out")) - ] - ++ lib.optionals (withUnrar) [ - (lib.cmakeBool "USE_SYSTEM_LIBUNRAR" true) - ] - ++ lib.optionals (!withUnrar) [ - (lib.cmakeFeature "LIBUNRAR_PATH" "") - (lib.cmakeFeature "LIBUNRAR_INCLUDE_DIR" "") - ]; + cmakeFlags = [ + (lib.cmakeFeature "LIMO_INSTALL_PREFIX" (placeholder "out")) + ] + ++ lib.optionals (withUnrar) [ + (lib.cmakeBool "USE_SYSTEM_LIBUNRAR" true) + ] + ++ lib.optionals (!withUnrar) [ + (lib.cmakeFeature "LIBUNRAR_PATH" "") + (lib.cmakeFeature "LIBUNRAR_INCLUDE_DIR" "") + ]; meta = { description = "General purpose mod manager with support for the NexusMods API and LOOT"; diff --git a/pkgs/by-name/li/linbox/package.nix b/pkgs/by-name/li/linbox/package.nix index c6821aa2f872..fe715967282b 100644 --- a/pkgs/by-name/li/linbox/package.nix +++ b/pkgs/by-name/li/linbox/package.nix @@ -63,22 +63,21 @@ stdenv.mkDerivation rec { fflas-ffpack ]; - configureFlags = - [ - "--with-blas-libs=-lblas" - "--without-archnative" - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - # disable SIMD instructions (which are enabled *when available* by default) - "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" - "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" - "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" - "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" - "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" - "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" - "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" - "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" - ]; + configureFlags = [ + "--with-blas-libs=-lblas" + "--without-archnative" + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + # disable SIMD instructions (which are enabled *when available* by default) + "--${if stdenv.hostPlatform.sse3Support then "enable" else "disable"}-sse3" + "--${if stdenv.hostPlatform.ssse3Support then "enable" else "disable"}-ssse3" + "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41" + "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42" + "--${if stdenv.hostPlatform.avxSupport then "enable" else "disable"}-avx" + "--${if stdenv.hostPlatform.avx2Support then "enable" else "disable"}-avx2" + "--${if stdenv.hostPlatform.fmaSupport then "enable" else "disable"}-fma" + "--${if stdenv.hostPlatform.fma4Support then "enable" else "disable"}-fma4" + ]; # https://github.com/linbox-team/linbox/issues/304 hardeningDisable = [ "fortify3" ]; diff --git a/pkgs/by-name/li/linenoise/package.nix b/pkgs/by-name/li/linenoise/package.nix index acf8cf3e258c..ed7560ca8fae 100644 --- a/pkgs/by-name/li/linenoise/package.nix +++ b/pkgs/by-name/li/linenoise/package.nix @@ -19,7 +19,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ validatePkgConfig - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/li/lingot/package.nix b/pkgs/by-name/li/lingot/package.nix index 88df150b004e..a9f6019f97c3 100644 --- a/pkgs/by-name/li/lingot/package.nix +++ b/pkgs/by-name/li/lingot/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { fftw fftwFloat json_c - ] ++ lib.optional jackSupport libjack2; + ] + ++ lib.optional jackSupport libjack2; configureFlags = lib.optional (!jackSupport) "--disable-jack"; diff --git a/pkgs/by-name/li/links2/package.nix b/pkgs/by-name/li/links2/package.nix index fbeed583d485..4d9e4d4628b0 100644 --- a/pkgs/by-name/li/links2/package.nix +++ b/pkgs/by-name/li/links2/package.nix @@ -32,38 +32,38 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-xGMca1oRUnzcPLeHL8I7fyslwrAh1Za+QQ2ttAMV8WY="; }; - buildInputs = - [ - libev - librsvg - libpng - libjpeg - libtiff - libavif - openssl - xz - bzip2 - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ gpm ] - ++ lib.optionals enableX11 [ - libX11 - libXau - libXt - ] - ++ lib.optionals enableDirectFB [ directfb ]; + buildInputs = [ + libev + librsvg + libpng + libjpeg + libtiff + libavif + openssl + xz + bzip2 + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ gpm ] + ++ lib.optionals enableX11 [ + libX11 + libXau + libXt + ] + ++ lib.optionals enableDirectFB [ directfb ]; nativeBuildInputs = [ pkg-config bzip2 ]; - configureFlags = - [ "--with-ssl" ] - ++ lib.optional (enableX11 || enableFB || enableDirectFB) "--enable-graphics" - ++ lib.optional enableX11 "--with-x" - ++ lib.optional enableFB "--with-fb" - ++ lib.optional enableDirectFB "--with-directfb"; + configureFlags = [ + "--with-ssl" + ] + ++ lib.optional (enableX11 || enableFB || enableDirectFB) "--enable-graphics" + ++ lib.optional enableX11 "--with-x" + ++ lib.optional enableFB "--with-fb" + ++ lib.optional enableDirectFB "--with-directfb"; env = lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int"; diff --git a/pkgs/by-name/li/linux-pam/package.nix b/pkgs/by-name/li/linux-pam/package.nix index 52aec1393dcb..1078aaebbba2 100644 --- a/pkgs/by-name/li/linux-pam/package.nix +++ b/pkgs/by-name/li/linux-pam/package.nix @@ -55,12 +55,14 @@ stdenv.mkDerivation rec { flex autoreconfHook269 pkg-config-unwrapped - ] ++ lib.optional stdenv.buildPlatform.isDarwin gettext; + ] + ++ lib.optional stdenv.buildPlatform.isDarwin gettext; buildInputs = [ db4 libxcrypt - ] ++ lib.optional stdenv.buildPlatform.isLinux audit; + ] + ++ lib.optional stdenv.buildPlatform.isLinux audit; enableParallelBuilding = true; diff --git a/pkgs/by-name/li/linuxdoc-tools/package.nix b/pkgs/by-name/li/linuxdoc-tools/package.nix index ce39d91de2a0..3da32b0f6fd4 100644 --- a/pkgs/by-name/li/linuxdoc-tools/package.nix +++ b/pkgs/by-name/li/linuxdoc-tools/package.nix @@ -73,7 +73,8 @@ stdenv.mkDerivation rec { perl gnused coreutils - ] ++ lib.optionals withLatex [ texliveMedium ]; + ] + ++ lib.optionals withLatex [ texliveMedium ]; meta = with lib; { description = "Toolset for processing LinuxDoc DTD SGML files"; diff --git a/pkgs/by-name/li/listenbrainz-mpd/package.nix b/pkgs/by-name/li/listenbrainz-mpd/package.nix index 18243dabfe10..637b696617e6 100644 --- a/pkgs/by-name/li/listenbrainz-mpd/package.nix +++ b/pkgs/by-name/li/listenbrainz-mpd/package.nix @@ -32,26 +32,26 @@ rustPlatform.buildRustPackage rec { asciidoctor ]; - buildInputs = - [ sqlite ] - ++ ( - if stdenv.hostPlatform.isDarwin then - [ - libiconv - ] - else - [ - openssl - ] - ); + buildInputs = [ + sqlite + ] + ++ ( + if stdenv.hostPlatform.isDarwin then + [ + libiconv + ] + else + [ + openssl + ] + ); - buildFeatures = - [ - "shell_completion" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "systemd" - ]; + buildFeatures = [ + "shell_completion" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "systemd" + ]; postInstall = '' installShellCompletion \ diff --git a/pkgs/by-name/li/littlegptracker/package.nix b/pkgs/by-name/li/littlegptracker/package.nix index 12e6940ccc87..62d0dca5bd3d 100644 --- a/pkgs/by-name/li/littlegptracker/package.nix +++ b/pkgs/by-name/li/littlegptracker/package.nix @@ -27,10 +27,11 @@ stdenv.mkDerivation (finalAttrs: { pkg-config python ]; - buildInputs = - [ SDL2 ] - ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform alsa-lib) alsa-lib - ++ lib.optional stdenv.hostPlatform.isLinux jack2; + buildInputs = [ + SDL2 + ] + ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform alsa-lib) alsa-lib + ++ lib.optional stdenv.hostPlatform.isLinux jack2; preBuild = '' cd projects diff --git a/pkgs/by-name/li/live555/package.nix b/pkgs/by-name/li/live555/package.nix index 735de09707e5..8431ff9e3974 100644 --- a/pkgs/by-name/li/live555/package.nix +++ b/pkgs/by-name/li/live555/package.nix @@ -66,27 +66,26 @@ stdenv.mkDerivation (finalAttrs: { # required for whitespaces in makeFlags __structuredAttrs = true; - postPatch = - '' - substituteInPlace config.macosx-catalina \ - --replace '/usr/lib/libssl.46.dylib' "${lib.getLib openssl}/lib/libssl.dylib" \ - --replace '/usr/lib/libcrypto.44.dylib' "${lib.getLib openssl}/lib/libcrypto.dylib" - sed -i -e 's|/bin/rm|rm|g' genMakefiles - sed -i \ - -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ - config.linux - '' - # condition from icu/base.nix - + - lib.optionalString - (lib.elem stdenv.hostPlatform.libc [ - "glibc" - "musl" - ]) - '' - substituteInPlace liveMedia/include/Locale.hh \ - --replace '' '' - ''; + postPatch = '' + substituteInPlace config.macosx-catalina \ + --replace '/usr/lib/libssl.46.dylib' "${lib.getLib openssl}/lib/libssl.dylib" \ + --replace '/usr/lib/libcrypto.44.dylib' "${lib.getLib openssl}/lib/libcrypto.dylib" + sed -i -e 's|/bin/rm|rm|g' genMakefiles + sed -i \ + -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ + config.linux + '' + # condition from icu/base.nix + + + lib.optionalString + (lib.elem stdenv.hostPlatform.libc [ + "glibc" + "musl" + ]) + '' + substituteInPlace liveMedia/include/Locale.hh \ + --replace '' '' + ''; configurePhase = let diff --git a/pkgs/by-name/li/livekit-libwebrtc/package.nix b/pkgs/by-name/li/livekit-libwebrtc/package.nix index 3c392e3b6036..fe5235d5b492 100644 --- a/pkgs/by-name/li/livekit-libwebrtc/package.nix +++ b/pkgs/by-name/li/livekit-libwebrtc/package.nix @@ -78,91 +78,89 @@ stdenv.mkDerivation { src = "${sources}/src"; - patches = - [ - # Adds missing dependencies to generated LICENSE - (fetchpatch { - url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_licenses.patch"; - hash = "sha256-9A4KyRW1K3eoQxsTbPX0vOnj66TCs2Fxjpsu5wO8mGI="; - }) - # Fixes the certificate chain, required for Let's Encrypt certs - (fetchpatch { - url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch"; - hash = "sha256-/gneuCac4VGJCWCjJZlgLKFOTV+x7Lc5KVFnNIKenwM="; - }) - # Adds dependencies and features required by livekit - (fetchpatch { - url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_deps.patch"; - hash = "sha256-EMNYcTcBYh51Tt96+HP43ND11qGKClfx3xIPQmIBSo0="; - }) - # Fixes "error: no matching member function for call to 'emplace'" - (fetchpatch { - url = "https://raw.githubusercontent.com/zed-industries/livekit-rust-sdks/refs/heads/main/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch"; - hash = "sha256-FOwlwOqgv5IEBCMogPACbXXxdNhGzpYcVfsolcwA7qU="; + patches = [ + # Adds missing dependencies to generated LICENSE + (fetchpatch { + url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_licenses.patch"; + hash = "sha256-9A4KyRW1K3eoQxsTbPX0vOnj66TCs2Fxjpsu5wO8mGI="; + }) + # Fixes the certificate chain, required for Let's Encrypt certs + (fetchpatch { + url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/ssl_verify_callback_with_native_handle.patch"; + hash = "sha256-/gneuCac4VGJCWCjJZlgLKFOTV+x7Lc5KVFnNIKenwM="; + }) + # Adds dependencies and features required by livekit + (fetchpatch { + url = "https://raw.githubusercontent.com/livekit/rust-sdks/b41861c7b71762d5d85b3de07ae67ffcae7c3fa2/webrtc-sys/libwebrtc/patches/add_deps.patch"; + hash = "sha256-EMNYcTcBYh51Tt96+HP43ND11qGKClfx3xIPQmIBSo0="; + }) + # Fixes "error: no matching member function for call to 'emplace'" + (fetchpatch { + url = "https://raw.githubusercontent.com/zed-industries/livekit-rust-sdks/refs/heads/main/webrtc-sys/libwebrtc/patches/abseil_use_optional.patch"; + hash = "sha256-FOwlwOqgv5IEBCMogPACbXXxdNhGzpYcVfsolcwA7qU="; - extraPrefix = "third_party/"; - stripLen = 1; - }) - # Required for dynamically linking to ffmpeg libraries and exposing symbols - ./0001-shared-libraries.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./0002-disable-narrowing-const-reference.patch - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # GCC does not support C11 _Generic in C++ mode. Fixes boringssl build with GCC - (fetchpatch { - name = "fix-gcc-c11-generic-boringssl"; + extraPrefix = "third_party/"; + stripLen = 1; + }) + # Required for dynamically linking to ffmpeg libraries and exposing symbols + ./0001-shared-libraries.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./0002-disable-narrowing-const-reference.patch + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # GCC does not support C11 _Generic in C++ mode. Fixes boringssl build with GCC + (fetchpatch { + name = "fix-gcc-c11-generic-boringssl"; - url = "https://github.com/google/boringssl/commit/c70190368c7040c37c1d655f0690bcde2b109a0d.patch"; - hash = "sha256-xkmYulDOw5Ny5LOCl7rsheZSFbSF6md2NkZ3+azjFQk="; - stripLen = 1; - extraPrefix = "third_party/boringssl/src/"; - }) - ]; + url = "https://github.com/google/boringssl/commit/c70190368c7040c37c1d655f0690bcde2b109a0d.patch"; + hash = "sha256-xkmYulDOw5Ny5LOCl7rsheZSFbSF6md2NkZ3+azjFQk="; + stripLen = 1; + extraPrefix = "third_party/boringssl/src/"; + }) + ]; - postPatch = - '' - substituteInPlace .gn \ - --replace-fail "vpython3" "python3" + postPatch = '' + substituteInPlace .gn \ + --replace-fail "vpython3" "python3" - substituteInPlace tools/generate_shim_headers/generate_shim_headers.py \ - --replace-fail "OFFICIAL_BUILD" "GOOGLE_CHROME_BUILD" + substituteInPlace tools/generate_shim_headers/generate_shim_headers.py \ + --replace-fail "OFFICIAL_BUILD" "GOOGLE_CHROME_BUILD" - substituteInPlace BUILD.gn \ - --replace-fail "rtc_static_library" "rtc_shared_library" \ - --replace-fail "complete_static_lib = true" "" + substituteInPlace BUILD.gn \ + --replace-fail "rtc_static_library" "rtc_shared_library" \ + --replace-fail "complete_static_lib = true" "" - substituteInPlace webrtc.gni \ - --replace-fail "!build_with_chromium && is_component_build" "false" + substituteInPlace webrtc.gni \ + --replace-fail "!build_with_chromium && is_component_build" "false" - substituteInPlace rtc_tools/BUILD.gn \ - --replace-fail "\":frame_analyzer\"," "" + substituteInPlace rtc_tools/BUILD.gn \ + --replace-fail "\":frame_analyzer\"," "" - for lib in ${toString (builtins.attrNames gnSystemLibraries)}; do - if [ -d "third_party/$lib" ]; then - find "third_party/$lib" -type f \ - \! -path "third_party/$lib/chromium/*" \ - \! -path "third_party/$lib/google/*" \ - \! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \ - \! -regex '.*\.\(gn\|gni\|isolate\)' \ - \! -name 'LICENSE*' \ - \! -name 'COPYING*' \ - -delete - fi - done - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - ln -sf ${lib.getExe gn} buildtools/linux64/gn - substituteInPlace build/toolchain/linux/BUILD.gn \ - --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - ln -sf ${lib.getExe gn} buildtools/mac/gn - chmod +x build/toolchain/apple/linker_driver.py - patchShebangs build/toolchain/apple/linker_driver.py - substituteInPlace build/toolchain/apple/toolchain.gni --replace-fail "/bin/cp -Rc" "cp -a" - ''; + for lib in ${toString (builtins.attrNames gnSystemLibraries)}; do + if [ -d "third_party/$lib" ]; then + find "third_party/$lib" -type f \ + \! -path "third_party/$lib/chromium/*" \ + \! -path "third_party/$lib/google/*" \ + \! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \ + \! -regex '.*\.\(gn\|gni\|isolate\)' \ + \! -name 'LICENSE*' \ + \! -name 'COPYING*' \ + -delete + fi + done + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + ln -sf ${lib.getExe gn} buildtools/linux64/gn + substituteInPlace build/toolchain/linux/BUILD.gn \ + --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + ln -sf ${lib.getExe gn} buildtools/mac/gn + chmod +x build/toolchain/apple/linker_driver.py + patchShebangs build/toolchain/apple/linker_driver.py + substituteInPlace build/toolchain/apple/toolchain.gni --replace-fail "/bin/cp -Rc" "cp -a" + ''; outputs = [ "dev" @@ -185,18 +183,19 @@ stdenv.mkDerivation { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; - buildInputs = - [ nasm ] - ++ (lib.mapAttrsToList (_: library: library.package) gnSystemLibraries) - ++ (lib.optionals stdenv.hostPlatform.isLinux [ - glib - alsa-lib - pulseaudio - ]) - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_14 - (darwinMinVersionHook "12.3") - ]; + buildInputs = [ + nasm + ] + ++ (lib.mapAttrsToList (_: library: library.package) gnSystemLibraries) + ++ (lib.optionals stdenv.hostPlatform.isLinux [ + glib + alsa-lib + pulseaudio + ]) + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_14 + (darwinMinVersionHook "12.3") + ]; preConfigure = '' echo "generate_location_tags = true" >> build/config/gclient_args.gni @@ -206,56 +205,56 @@ stdenv.mkDerivation { --system-libraries ${toString (builtins.attrNames gnSystemLibraries)} ''; - gnFlags = - [ - "is_debug=false" - "rtc_include_tests=false" - ''target_os="${gnOs}"'' - ''target_cpu="${gnArch}"'' - "treat_warnings_as_errors=false" - "rtc_enable_protobuf=false" - "rtc_include_tests=false" - "rtc_build_examples=false" - "rtc_build_tools=false" - "rtc_libvpx_build_vp9=true" - "enable_libaom=true" - "use_dummy_lastchange=true" - "is_component_build=true" - "enable_stripping=true" - "rtc_use_h264=true" - "use_custom_libcxx=false" - "use_rtti=true" - ] - ++ (lib.optionals stdenv.hostPlatform.isLinux [ - "use_goma=false" - "rtc_use_pipewire=false" - "symbol_level=0" - "enable_iterator_debugging=false" - "rtc_use_x11=false" - "use_sysroot=false" - "is_clang=false" - ]) - ++ (lib.optionals stdenv.hostPlatform.isDarwin [ - ''mac_deployment_target="12.3"'' - "rtc_enable_symbol_export=true" - "rtc_enable_objc_symbol_export=true" - "rtc_include_dav1d_in_internal_decoder_factory=true" - "clang_use_chrome_plugins=false" - "use_lld=false" - ''clang_base_path="${clang}"'' - ]); + gnFlags = [ + "is_debug=false" + "rtc_include_tests=false" + ''target_os="${gnOs}"'' + ''target_cpu="${gnArch}"'' + "treat_warnings_as_errors=false" + "rtc_enable_protobuf=false" + "rtc_include_tests=false" + "rtc_build_examples=false" + "rtc_build_tools=false" + "rtc_libvpx_build_vp9=true" + "enable_libaom=true" + "use_dummy_lastchange=true" + "is_component_build=true" + "enable_stripping=true" + "rtc_use_h264=true" + "use_custom_libcxx=false" + "use_rtti=true" + ] + ++ (lib.optionals stdenv.hostPlatform.isLinux [ + "use_goma=false" + "rtc_use_pipewire=false" + "symbol_level=0" + "enable_iterator_debugging=false" + "rtc_use_x11=false" + "use_sysroot=false" + "is_clang=false" + ]) + ++ (lib.optionals stdenv.hostPlatform.isDarwin [ + ''mac_deployment_target="12.3"'' + "rtc_enable_symbol_export=true" + "rtc_enable_objc_symbol_export=true" + "rtc_include_dav1d_in_internal_decoder_factory=true" + "clang_use_chrome_plugins=false" + "use_lld=false" + ''clang_base_path="${clang}"'' + ]); - ninjaFlags = - [ ":default" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "api/audio_codecs:builtin_audio_decoder_factory" - "api/task_queue:default_task_queue_factory" - "sdk:native_api" - "sdk:default_codec_factory_objc" - "pc:peer_connection" - "sdk:videocapture_objc" - "sdk:mac_framework_objc" - ]; + ninjaFlags = [ + ":default" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "api/audio_codecs:builtin_audio_decoder_factory" + "api/task_queue:default_task_queue_factory" + "sdk:native_api" + "sdk:default_codec_factory_objc" + "pc:peer_connection" + "sdk:videocapture_objc" + "sdk:mac_framework_objc" + ]; postBuild = lib.optionalString stdenv.hostPlatform.isLinux '' @@ -267,31 +266,30 @@ stdenv.mkDerivation { --target ${if stdenv.hostPlatform.isDarwin then ":webrtc" else ":default"} $PWD $PWD ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/lib - mkdir -p $dev/include + mkdir -p $out/lib + mkdir -p $dev/include - install -m0644 obj/webrtc.ninja args.gn LICENSE.md $dev + install -m0644 obj/webrtc.ninja args.gn LICENSE.md $dev - pushd ../.. - find . -name "*.h" -print | cpio -pd $dev/include - popd - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -m0644 libwebrtc.so libthird_party_boringssl.so $out/lib - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install -m0644 WebRTC.framework/Versions/A/WebRTC $out/lib/libwebrtc.dylib - install -m0644 libthird_party_boringssl.dylib $out/lib - '' - + '' - ln -s $out/lib $dev/lib + pushd ../.. + find . -name "*.h" -print | cpio -pd $dev/include + popd + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -m0644 libwebrtc.so libthird_party_boringssl.so $out/lib + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install -m0644 WebRTC.framework/Versions/A/WebRTC $out/lib/libwebrtc.dylib + install -m0644 libthird_party_boringssl.dylib $out/lib + '' + + '' + ln -s $out/lib $dev/lib - runHook postInstall - ''; + runHook postInstall + ''; postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' boringssl="$out/lib/libthird_party_boringssl.dylib" diff --git a/pkgs/by-name/lk/lkl/package.nix b/pkgs/by-name/lk/lkl/package.nix index f9b208c05d56..5c545428ef5e 100644 --- a/pkgs/by-name/lk/lkl/package.nix +++ b/pkgs/by-name/lk/lkl/package.nix @@ -43,23 +43,22 @@ stdenv.mkDerivation { libarchive ]; - postPatch = - '' - # Fix a /usr/bin/env reference in here that breaks sandboxed builds - patchShebangs arch/lkl/scripts + postPatch = '' + # Fix a /usr/bin/env reference in here that breaks sandboxed builds + patchShebangs arch/lkl/scripts - patchShebangs scripts/ld-version.sh + patchShebangs scripts/ld-version.sh - # Fixup build with newer Linux headers: https://github.com/lkl/linux/pull/484 - sed '1i#include ' -i tools/lkl/lib/hijack/xlate.c - '' - + lib.optionalString (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isLoongArch64) '' - echo CONFIG_KALLSYMS=n >> arch/lkl/configs/defconfig - echo CONFIG_KALLSYMS_BASE_RELATIVE=n >> arch/lkl/configs/defconfig - '' - + lib.optionalString firewallSupport '' - cat ${./lkl-defconfig-enable-nftables} >> arch/lkl/configs/defconfig - ''; + # Fixup build with newer Linux headers: https://github.com/lkl/linux/pull/484 + sed '1i#include ' -i tools/lkl/lib/hijack/xlate.c + '' + + lib.optionalString (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isLoongArch64) '' + echo CONFIG_KALLSYMS=n >> arch/lkl/configs/defconfig + echo CONFIG_KALLSYMS_BASE_RELATIVE=n >> arch/lkl/configs/defconfig + '' + + lib.optionalString firewallSupport '' + cat ${./lkl-defconfig-enable-nftables} >> arch/lkl/configs/defconfig + ''; installPhase = '' mkdir -p $out/bin $lib/lib $dev diff --git a/pkgs/by-name/ll/llama-cpp/package.nix b/pkgs/by-name/ll/llama-cpp/package.nix index b0f206f78ac6..ff08792d5036 100644 --- a/pkgs/by-name/ll/llama-cpp/package.nix +++ b/pkgs/by-name/ll/llama-cpp/package.nix @@ -103,17 +103,16 @@ effectiveStdenv.mkDerivation (finalAttrs: { --replace-fail 'build_commit="unknown"' "build_commit=\"$(cat COMMIT)\"" ''; - nativeBuildInputs = - [ - cmake - ninja - pkg-config - git - ] - ++ optionals cudaSupport [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + git + ] + ++ optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; buildInputs = optionals cudaSupport cudaBuildInputs @@ -123,50 +122,48 @@ effectiveStdenv.mkDerivation (finalAttrs: { ++ optionals vulkanSupport vulkanBuildInputs ++ [ curl ]; - cmakeFlags = - [ - # -march=native is non-deterministic; override with platform-specific flags if needed - (cmakeBool "GGML_NATIVE" false) - (cmakeBool "LLAMA_BUILD_SERVER" true) - (cmakeBool "LLAMA_CURL" true) - (cmakeBool "BUILD_SHARED_LIBS" true) - (cmakeBool "GGML_BLAS" blasSupport) - (cmakeBool "GGML_CLBLAST" openclSupport) - (cmakeBool "GGML_CUDA" cudaSupport) - (cmakeBool "GGML_HIP" rocmSupport) - (cmakeBool "GGML_METAL" metalSupport) - (cmakeBool "GGML_RPC" rpcSupport) - (cmakeBool "GGML_VULKAN" vulkanSupport) - ] - ++ optionals cudaSupport [ - (cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) - ] - ++ optionals rocmSupport ([ - (cmakeFeature "CMAKE_HIP_COMPILER" "${rocmPackages.clr.hipClangPath}/clang++") - # TODO: this should become `clr.gpuTargets` in the future. - (cmakeFeature "CMAKE_HIP_ARCHITECTURES" rocmPackages.rocblas.amdgpu_targets) - ]) - ++ optionals metalSupport [ - (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1") - (cmakeBool "LLAMA_METAL_EMBED_LIBRARY" true) - ] - ++ optionals rpcSupport [ - # This is done so we can move rpc-server out of bin because llama.cpp doesn't - # install rpc-server in their install target. - "-DCMAKE_SKIP_BUILD_RPATH=ON" - ]; + cmakeFlags = [ + # -march=native is non-deterministic; override with platform-specific flags if needed + (cmakeBool "GGML_NATIVE" false) + (cmakeBool "LLAMA_BUILD_SERVER" true) + (cmakeBool "LLAMA_CURL" true) + (cmakeBool "BUILD_SHARED_LIBS" true) + (cmakeBool "GGML_BLAS" blasSupport) + (cmakeBool "GGML_CLBLAST" openclSupport) + (cmakeBool "GGML_CUDA" cudaSupport) + (cmakeBool "GGML_HIP" rocmSupport) + (cmakeBool "GGML_METAL" metalSupport) + (cmakeBool "GGML_RPC" rpcSupport) + (cmakeBool "GGML_VULKAN" vulkanSupport) + ] + ++ optionals cudaSupport [ + (cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) + ] + ++ optionals rocmSupport ([ + (cmakeFeature "CMAKE_HIP_COMPILER" "${rocmPackages.clr.hipClangPath}/clang++") + # TODO: this should become `clr.gpuTargets` in the future. + (cmakeFeature "CMAKE_HIP_ARCHITECTURES" rocmPackages.rocblas.amdgpu_targets) + ]) + ++ optionals metalSupport [ + (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1") + (cmakeBool "LLAMA_METAL_EMBED_LIBRARY" true) + ] + ++ optionals rpcSupport [ + # This is done so we can move rpc-server out of bin because llama.cpp doesn't + # install rpc-server in their install target. + "-DCMAKE_SKIP_BUILD_RPATH=ON" + ]; # upstream plans on adding targets at the cmakelevel, remove those # additional steps after that - postInstall = - '' - # Match previous binary name for this package - ln -sf $out/bin/llama-cli $out/bin/llama + postInstall = '' + # Match previous binary name for this package + ln -sf $out/bin/llama-cli $out/bin/llama - mkdir -p $out/include - cp $src/include/llama.h $out/include/ - '' - + optionalString rpcSupport "cp bin/rpc-server $out/bin/llama-rpc-server"; + mkdir -p $out/include + cp $src/include/llama.h $out/include/ + '' + + optionalString rpcSupport "cp bin/rpc-server $out/bin/llama-rpc-server"; passthru.updateScript = nix-update-script { attrPath = "llama-cpp"; diff --git a/pkgs/by-name/ll/lldpd/package.nix b/pkgs/by-name/ll/lldpd/package.nix index ff6ea5e3d2a7..8089fd578c96 100644 --- a/pkgs/by-name/ll/lldpd/package.nix +++ b/pkgs/by-name/ll/lldpd/package.nix @@ -19,19 +19,18 @@ stdenv.mkDerivation rec { hash = "sha256-+H3zFj1eUTjakB0FWzhACXhdHrUP2xeiNDkQ/PMKmX8="; }; - configureFlags = - [ - "--localstatedir=/var" - "--enable-pie" - "--with-snmp" - "--with-systemdsystemunitdir=\${out}/lib/systemd/system" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--with-launchddaemonsdir=no" - "--with-privsep-chroot=/var/empty" - "--with-privsep-group=nogroup" - "--with-privsep-user=nobody" - ]; + configureFlags = [ + "--localstatedir=/var" + "--enable-pie" + "--with-snmp" + "--with-systemdsystemunitdir=\${out}/lib/systemd/system" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--with-launchddaemonsdir=no" + "--with-privsep-chroot=/var/empty" + "--with-privsep-group=nogroup" + "--with-privsep-user=nobody" + ]; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/ll/llpp/package.nix b/pkgs/by-name/ll/llpp/package.nix index 12d0e5d54c90..aba77bc08557 100644 --- a/pkgs/by-name/ll/llpp/package.nix +++ b/pkgs/by-name/ll/llpp/package.nix @@ -46,23 +46,22 @@ stdenv.mkDerivation rec { ocaml pkg-config ]; - buildInputs = - [ - mupdf - libX11 - freetype - zlib - gumbo - jbig2dec - openjpeg - libjpeg - lcms2 - harfbuzz - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - libGL - ]; + buildInputs = [ + mupdf + libX11 + freetype + zlib + gumbo + jbig2dec + openjpeg + libjpeg + lcms2 + harfbuzz + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGLU + libGL + ]; dontStrip = true; @@ -70,22 +69,21 @@ stdenv.mkDerivation rec { bash ./build.bash build ''; - installPhase = - '' - install -d $out/bin - install build/llpp $out/bin - install misc/llpp.inotify $out/bin/llpp.inotify - install -Dm444 misc/llpp.desktop -t $out/share/applications - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/llpp \ - --prefix PATH ":" "${xclip}/bin" + installPhase = '' + install -d $out/bin + install build/llpp $out/bin + install misc/llpp.inotify $out/bin/llpp.inotify + install -Dm444 misc/llpp.desktop -t $out/share/applications + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram $out/bin/llpp \ + --prefix PATH ":" "${xclip}/bin" - wrapProgram $out/bin/llpp.inotify \ - --prefix PATH ":" "$out/bin" \ - --prefix PATH ":" "${inotify-tools}/bin" \ - --prefix PATH ":" "${procps}/bin" - ''; + wrapProgram $out/bin/llpp.inotify \ + --prefix PATH ":" "$out/bin" \ + --prefix PATH ":" "${inotify-tools}/bin" \ + --prefix PATH ":" "${procps}/bin" + ''; meta = with lib; { homepage = "https://github.com/criticic/llpp"; diff --git a/pkgs/by-name/lm/lm_sensors/package.nix b/pkgs/by-name/lm/lm_sensors/package.nix index a68a12891262..17af2f0afb8d 100644 --- a/pkgs/by-name/lm/lm_sensors/package.nix +++ b/pkgs/by-name/lm/lm_sensors/package.nix @@ -53,7 +53,8 @@ stdenv.mkDerivation { buildInputs = [ bash perl - ] ++ lib.optional sensord rrdtool; + ] + ++ lib.optional sensord rrdtool; makeFlags = [ "PREFIX=${placeholder "out"}" @@ -68,7 +69,8 @@ stdenv.mkDerivation { "CC=${stdenv.cc.targetPrefix}cc" "AR=${stdenv.cc.targetPrefix}ar" - ] ++ lib.optional sensord "PROG_EXTRA=sensord"; + ] + ++ lib.optional sensord "PROG_EXTRA=sensord"; enableParallelBuilding = true; diff --git a/pkgs/by-name/lm/lmdb/package.nix b/pkgs/by-name/lm/lmdb/package.nix index dcb05051d155..a1c592565271 100644 --- a/pkgs/by-name/lm/lmdb/package.nix +++ b/pkgs/by-name/lm/lmdb/package.nix @@ -38,40 +38,38 @@ stdenv.mkDerivation rec { buildInputs = lib.optional stdenv.hostPlatform.isWindows windows.pthreads; - makeFlags = - [ - "prefix=$(out)" - "CC=${stdenv.cc.targetPrefix}cc" - "AR=${stdenv.cc.targetPrefix}ar" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so" - ++ lib.optionals stdenv.hostPlatform.isWindows [ - "SOEXT=.dll" - "BINEXT=.exe" - ]; + makeFlags = [ + "prefix=$(out)" + "CC=${stdenv.cc.targetPrefix}cc" + "AR=${stdenv.cc.targetPrefix}ar" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so" + ++ lib.optionals stdenv.hostPlatform.isWindows [ + "SOEXT=.dll" + "BINEXT=.exe" + ]; doCheck = true; checkTarget = "test"; - postInstall = - '' - moveToOutput bin "$bin" - '' - # add lmdb.pc (dynamic only) - + '' - mkdir -p "$dev/lib/pkgconfig" - cat > "$dev/lib/pkgconfig/lmdb.pc" < "$dev/lib/pkgconfig/lmdb.pc" <> CMakeLists.txt + postPatch = prev.postPatch + '' + cd examples + cp -r --no-preserve=mode ${src}/backend/cpp/llama grpc-server + cp llava/clip* llava/llava.* grpc-server + printf "\nadd_subdirectory(grpc-server)" >> CMakeLists.txt - cp ${src}/backend/backend.proto grpc-server - sed -i grpc-server/CMakeLists.txt \ - -e '/get_filename_component/ s;[.\/]*backend/;;' \ - -e '$a\install(TARGETS ''${TARGET} RUNTIME)' - cd .. - ''; + cp ${src}/backend/backend.proto grpc-server + sed -i grpc-server/CMakeLists.txt \ + -e '/get_filename_component/ s;[.\/]*backend/;;' \ + -e '$a\install(TARGETS ''${TARGET} RUNTIME)' + cd .. + ''; cmakeFlags = prev.cmakeFlags ++ [ (lib.cmakeBool "BUILD_SHARED_LIBS" false) (lib.cmakeBool "GGML_AVX" enable_avx) @@ -251,7 +249,8 @@ let nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optionals with_cublas [ cuda_nvcc ]; + ] + ++ lib.optionals with_cublas [ cuda_nvcc ]; buildInputs = [ ] @@ -364,43 +363,40 @@ let env.NIX_CFLAGS_COMPILE = " -isystem ${opencv}/include/opencv4"; - postPatch = - '' - # TODO: add silero-vad - sed -i Makefile \ - -e '/mod download/ d' \ - -e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/llama-cpp-avx/ d' \ - -e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/llama-cpp-cuda/ d' \ - -e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/silero-vad/ d' \ + postPatch = '' + # TODO: add silero-vad + sed -i Makefile \ + -e '/mod download/ d' \ + -e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/llama-cpp-avx/ d' \ + -e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/llama-cpp-cuda/ d' \ + -e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/silero-vad/ d' \ - sed -i backend/go/image/stablediffusion-ggml/Makefile \ - -e '/^libsd/ s,$, $(COMBINED_LIB),' + sed -i backend/go/image/stablediffusion-ggml/Makefile \ + -e '/^libsd/ s,$, $(COMBINED_LIB),' - '' - + lib.optionalString with_cublas '' - sed -i Makefile \ - -e '/^CGO_LDFLAGS_WHISPER?=/ s;$;-L${libcufft}/lib -L${cuda_cudart}/lib;' - ''; + '' + + lib.optionalString with_cublas '' + sed -i Makefile \ + -e '/^CGO_LDFLAGS_WHISPER?=/ s;$;-L${libcufft}/lib -L${cuda_cudart}/lib;' + ''; - postConfigure = - prepare-sources - + '' - shopt -s extglob - mkdir -p backend-assets/grpc - cp ${llama-cpp-grpc}/bin/grpc-server backend-assets/grpc/llama-cpp-fallback - cp ${llama-cpp-rpc}/bin/grpc-server backend-assets/grpc/llama-cpp-grpc + postConfigure = prepare-sources + '' + shopt -s extglob + mkdir -p backend-assets/grpc + cp ${llama-cpp-grpc}/bin/grpc-server backend-assets/grpc/llama-cpp-fallback + cp ${llama-cpp-rpc}/bin/grpc-server backend-assets/grpc/llama-cpp-grpc - mkdir -p backend/cpp/llama/llama.cpp + mkdir -p backend/cpp/llama/llama.cpp - mkdir -p backend-assets/util - cp ${llama-cpp-rpc}/bin/llama-rpc-server backend-assets/util/llama-cpp-rpc-server + mkdir -p backend-assets/util + cp ${llama-cpp-rpc}/bin/llama-rpc-server backend-assets/util/llama-cpp-rpc-server - cp -r --no-preserve=mode,ownership ${stable-diffusion}/build backend/go/image/stablediffusion-ggml/build + cp -r --no-preserve=mode,ownership ${stable-diffusion}/build backend/go/image/stablediffusion-ggml/build - # avoid rebuild of prebuilt make targets - touch backend-assets/grpc/* backend-assets/util/* - find sources -name "lib*.a" -exec touch {} + - ''; + # avoid rebuild of prebuilt make targets + touch backend-assets/grpc/* backend-assets/util/* + find sources -name "lib*.a" -exec touch {} + + ''; buildInputs = [ ] @@ -417,26 +413,23 @@ let ++ lib.optionals with_openblas [ openblas.dev ] ++ lib.optionals with_tts go-piper.buildInputs; - nativeBuildInputs = - [ - protobuf - protoc-gen-go - protoc-gen-go-grpc - makeWrapper - ncurses # tput - which - ] - ++ lib.optional enable_upx upx - ++ lib.optionals with_cublas [ cuda_nvcc ]; + nativeBuildInputs = [ + protobuf + protoc-gen-go + protoc-gen-go-grpc + makeWrapper + ncurses # tput + which + ] + ++ lib.optional enable_upx upx + ++ lib.optionals with_cublas [ cuda_nvcc ]; enableParallelBuilding = false; - modBuildPhase = - prepare-sources - + '' - make protogen-go - go mod tidy -v - ''; + modBuildPhase = prepare-sources + '' + make protogen-go + go mod tidy -v + ''; proxyVendor = true; @@ -444,13 +437,12 @@ let # containing spaces env.GO_TAGS = builtins.concatStringsSep " " GO_TAGS; - makeFlags = - [ - "VERSION=v${version}" - "BUILD_TYPE=${BUILD_TYPE}" - ] - ++ lib.optional with_cublas "CUDA_LIBPATH=${cuda_cudart}/lib" - ++ lib.optional with_tts "PIPER_CGO_CXXFLAGS=-DSPDLOG_FMT_EXTERNAL=1"; + makeFlags = [ + "VERSION=v${version}" + "BUILD_TYPE=${BUILD_TYPE}" + ] + ++ lib.optional with_cublas "CUDA_LIBPATH=${cuda_cudart}/lib" + ++ lib.optional with_tts "PIPER_CGO_CXXFLAGS=-DSPDLOG_FMT_EXTERNAL=1"; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/lo/localsearch/package.nix b/pkgs/by-name/lo/localsearch/package.nix index a2e0f6e95475..361545417bf8 100644 --- a/pkgs/by-name/lo/localsearch/package.nix +++ b/pkgs/by-name/lo/localsearch/package.nix @@ -60,73 +60,70 @@ stdenv.mkDerivation (finalAttrs: { ./tracker-landlock-nix-store-permission.patch ]; - nativeBuildInputs = - [ - asciidoc - docbook-xsl-nons - docbook_xml_dtd_45 - gettext - glib - gobject-introspection - itstool - libxslt - meson - ninja - pkg-config - vala - wrapGAppsNoGuiHook - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + asciidoc + docbook-xsl-nons + docbook_xml_dtd_45 + gettext + glib + gobject-introspection + itstool + libxslt + meson + ninja + pkg-config + vala + wrapGAppsNoGuiHook + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; # TODO: add libenca, libosinfo - buildInputs = - [ - bzip2 - dbus - exempi - ffmpeg - giflib - gexiv2 - totem-pl-parser - tinysparql - icu - json-glib - libcue - libexif - libgsf - libgudev - libgxps - libiptcdata - libjpeg - libosinfo - libpng - libtiff - libuuid - libxml2 - poppler - taglib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libseccomp - systemd - upower - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - e2fsprogs - ]; + buildInputs = [ + bzip2 + dbus + exempi + ffmpeg + giflib + gexiv2 + totem-pl-parser + tinysparql + icu + json-glib + libcue + libexif + libgsf + libgudev + libgxps + libiptcdata + libjpeg + libosinfo + libpng + libtiff + libuuid + libxml2 + poppler + taglib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libseccomp + systemd + upower + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + e2fsprogs + ]; - mesonFlags = - [ - # TODO: tests do not like our sandbox - "-Dfunctional_tests=false" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "-Dbattery_detection=none" - "-Dnetwork_manager=disabled" - "-Dsystemd_user_services=false" - ]; + mesonFlags = [ + # TODO: tests do not like our sandbox + "-Dfunctional_tests=false" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "-Dbattery_detection=none" + "-Dnetwork_manager=disabled" + "-Dsystemd_user_services=false" + ]; postInstall = '' glib-compile-schemas "$out/share/glib-2.0/schemas" diff --git a/pkgs/by-name/lo/logisim-evolution/package.nix b/pkgs/by-name/lo/logisim-evolution/package.nix index 9be23ab7dc60..07a6dde8c7fa 100644 --- a/pkgs/by-name/lo/logisim-evolution/package.nix +++ b/pkgs/by-name/lo/logisim-evolution/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation (finalAttrs: { }; dontUnpack = true; - nativeBuildInputs = - [ - makeBinaryWrapper - copyDesktopItems - unzip - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + makeBinaryWrapper + copyDesktopItems + unzip + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/lo/logisim/package.nix b/pkgs/by-name/lo/logisim/package.nix index 40eb34b93721..f5dca04224e3 100644 --- a/pkgs/by-name/lo/logisim/package.nix +++ b/pkgs/by-name/lo/logisim/package.nix @@ -20,15 +20,14 @@ stdenv.mkDerivation (finalAttrs: { }; dontUnpack = true; - nativeBuildInputs = - [ - makeBinaryWrapper - copyDesktopItems - unzip - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + makeBinaryWrapper + copyDesktopItems + unzip + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/lo/logseq/package.nix b/pkgs/by-name/lo/logseq/package.nix index fb243ffb49c2..fb7785ede426 100644 --- a/pkgs/by-name/lo/logseq/package.nix +++ b/pkgs/by-name/lo/logseq/package.nix @@ -233,37 +233,36 @@ stdenv.mkDerivation (finalAttrs: { yarnBuildScript = "release-electron"; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - # remove references to nodejs - find static/out/*/resources/app/node_modules -type f -executable -exec remove-references-to -t ${nodejs} '{}' \; - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm644 static/icons/logseq.png "$out/share/icons/hicolor/512x512/apps/logseq.png" + # remove references to nodejs + find static/out/*/resources/app/node_modules -type f -executable -exec remove-references-to -t ${nodejs} '{}' \; + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm644 static/icons/logseq.png "$out/share/icons/hicolor/512x512/apps/logseq.png" - mkdir -p $out/share/logseq - cp -r static/out/*/{locales,resources{,.pak}} $out/share/logseq + mkdir -p $out/share/logseq + cp -r static/out/*/{locales,resources{,.pak}} $out/share/logseq - makeWrapper ${lib.getExe electron} $out/bin/logseq \ - --add-flags $out/share/logseq/resources/app \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --set-default LOCAL_GIT_DIRECTORY ${git} \ - --inherit-argv0 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r static/out/*/Logseq.app $out/Applications + makeWrapper ${lib.getExe electron} $out/bin/logseq \ + --add-flags $out/share/logseq/resources/app \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --set-default LOCAL_GIT_DIRECTORY ${git} \ + --inherit-argv0 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r static/out/*/Logseq.app $out/Applications - wrapProgram $out/Applications/Logseq.app/Contents/MacOS/Logseq \ - --set-default LOCAL_GIT_DIRECTORY ${git} + wrapProgram $out/Applications/Logseq.app/Contents/MacOS/Logseq \ + --set-default LOCAL_GIT_DIRECTORY ${git} - makeWrapper $out/Applications/Logseq.app/Contents/MacOS/Logseq $out/bin/logseq - '' - + '' - runHook postInstall - ''; + makeWrapper $out/Applications/Logseq.app/Contents/MacOS/Logseq $out/bin/logseq + '' + + '' + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/lo/longview/package.nix b/pkgs/by-name/lo/longview/package.nix index d35bd0592ea6..4ee5e4f983de 100644 --- a/pkgs/by-name/lo/longview/package.nix +++ b/pkgs/by-name/lo/longview/package.nix @@ -34,25 +34,24 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ makeWrapper ]; - buildInputs = - [ - perl - glibc - ] - ++ (with perlPackages; [ - LWP - LWPProtocolHttps - MozillaCA - CryptSSLeay - IOSocketINET6 - LinuxDistribution - JSONPP - JSON - LogLogLite - TryTiny - DBI - DBDmysql - ]); + buildInputs = [ + perl + glibc + ] + ++ (with perlPackages; [ + LWP + LWPProtocolHttps + MozillaCA + CryptSSLeay + IOSocketINET6 + LinuxDistribution + JSONPP + JSON + LogLogLite + TryTiny + DBI + DBDmysql + ]); dontBuild = true; diff --git a/pkgs/by-name/lo/looking-glass-client/package.nix b/pkgs/by-name/lo/looking-glass-client/package.nix index 5e8ee0d2a684..cc2c8f8172a1 100644 --- a/pkgs/by-name/lo/looking-glass-client/package.nix +++ b/pkgs/by-name/lo/looking-glass-client/package.nix @@ -61,51 +61,51 @@ stdenv.mkDerivation (finalAttrs: { wayland-scanner ]; - buildInputs = - [ - libX11 - libGL - freefont_ttf - spice-protocol - expat - libbfd - nettle - fontconfig - libffi - nanosvg - ] - ++ lib.optionals xorgSupport [ - libxkbcommon - libXi - libXScrnSaver - libXinerama - libXcursor - libXpresent - libXext - libXrandr - libXdmcp - ] - ++ lib.optionals waylandSupport [ - libxkbcommon - wayland - wayland-protocols - ] - ++ lib.optionals pipewireSupport [ - pipewire - libsamplerate - ] - ++ lib.optionals pulseSupport [ - pulseaudio - libsamplerate - ]; + buildInputs = [ + libX11 + libGL + freefont_ttf + spice-protocol + expat + libbfd + nettle + fontconfig + libffi + nanosvg + ] + ++ lib.optionals xorgSupport [ + libxkbcommon + libXi + libXScrnSaver + libXinerama + libXcursor + libXpresent + libXext + libXrandr + libXdmcp + ] + ++ lib.optionals waylandSupport [ + libxkbcommon + wayland + wayland-protocols + ] + ++ lib.optionals pipewireSupport [ + pipewire + libsamplerate + ] + ++ lib.optionals pulseSupport [ + pulseaudio + libsamplerate + ]; - cmakeFlags = - [ "-DOPTIMIZE_FOR_NATIVE=OFF" ] - ++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ] - ++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ] - ++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ] - ++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ] - ++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ]; + cmakeFlags = [ + "-DOPTIMIZE_FOR_NATIVE=OFF" + ] + ++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ] + ++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ] + ++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ] + ++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ] + ++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ]; postUnpack = '' echo ${finalAttrs.src.rev} > source/VERSION diff --git a/pkgs/by-name/lo/lowdown/package.nix b/pkgs/by-name/lo/lowdown/package.nix index 76900e0acbd8..8c393af15ac2 100644 --- a/pkgs/by-name/lo/lowdown/package.nix +++ b/pkgs/by-name/lo/lowdown/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ which dieHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; # The Darwin sandbox calls fail inside Nix builds, presumably due to # being nested inside another sandbox. @@ -61,16 +62,15 @@ stdenv.mkDerivation rec { "bins" # prevents shared object from being built unnecessarily ]; - installTargets = - [ - "install" - ] - ++ lib.optionals enableShared [ - "install_shared" - ] - ++ lib.optionals enableStatic [ - "install_static" - ]; + installTargets = [ + "install" + ] + ++ lib.optionals enableShared [ + "install_shared" + ] + ++ lib.optionals enableStatic [ + "install_static" + ]; postInstall = let diff --git a/pkgs/by-name/lo/lowfi/package.nix b/pkgs/by-name/lo/lowfi/package.nix index 365f87477ab6..0d5351fdd07d 100644 --- a/pkgs/by-name/lo/lowfi/package.nix +++ b/pkgs/by-name/lo/lowfi/package.nix @@ -29,13 +29,12 @@ rustPlatform.buildRustPackage rec { rustPlatform.bindgenHook ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ]; meta = { description = "Extremely simple lofi player"; diff --git a/pkgs/by-name/lr/lrcget/package.nix b/pkgs/by-name/lr/lrcget/package.nix index 0fdc42ec23dd..a2045feec571 100644 --- a/pkgs/by-name/lr/lrcget/package.nix +++ b/pkgs/by-name/lr/lrcget/package.nix @@ -52,20 +52,19 @@ rustPlatform.buildRustPackage rec { hash = "sha256-N48+C3NNPYg/rOpnRNmkZfZU/ZHp8imrG/tiDaMGsCE="; }; - nativeBuildInputs = - [ - cargo-tauri.hook - nodejs - npmHooks.npmConfigHook - rustPlatform.bindgenHook - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - pkg-config - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeBinaryWrapper - ]; + nativeBuildInputs = [ + cargo-tauri.hook + nodejs + npmHooks.npmConfigHook + rustPlatform.bindgenHook + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + pkg-config + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeBinaryWrapper + ]; buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ alsa-lib diff --git a/pkgs/by-name/lr/lrzip/package.nix b/pkgs/by-name/lr/lrzip/package.nix index e1b257fcd09a..9e10ed9013d2 100644 --- a/pkgs/by-name/lr/lrzip/package.nix +++ b/pkgs/by-name/lr/lrzip/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook perl - ] ++ lib.optionals isx86 [ nasm ]; + ] + ++ lib.optionals isx86 [ nasm ]; buildInputs = [ zlib diff --git a/pkgs/by-name/ls/lsd2dsl/package.nix b/pkgs/by-name/ls/lsd2dsl/package.nix index 73ad7e21a23e..c2b9719e3ab8 100644 --- a/pkgs/by-name/ls/lsd2dsl/package.nix +++ b/pkgs/by-name/ls/lsd2dsl/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake qt6.wrapQtAppsHook - ] ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; + ] + ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; buildInputs = [ boost diff --git a/pkgs/by-name/ls/lshw/package.nix b/pkgs/by-name/ls/lshw/package.nix index b0ed05e9f07b..9937c4c81e6c 100644 --- a/pkgs/by-name/ls/lshw/package.nix +++ b/pkgs/by-name/ls/lshw/package.nix @@ -29,12 +29,13 @@ stdenv.mkDerivation rec { gettext ]; - buildInputs = - [ hwdata ] - ++ lib.optionals withGUI [ - gtk3 - sqlite - ]; + buildInputs = [ + hwdata + ] + ++ lib.optionals withGUI [ + gtk3 + sqlite + ]; makeFlags = [ "PREFIX=$(out)" diff --git a/pkgs/by-name/ls/lsof/package.nix b/pkgs/by-name/ls/lsof/package.nix index 3d3a0b7a0a7f..5c8d02f446fe 100644 --- a/pkgs/by-name/ls/lsof/package.nix +++ b/pkgs/by-name/ls/lsof/package.nix @@ -26,19 +26,18 @@ stdenv.mkDerivation rec { hash = "sha256-zn09cwFFz5ZNJu8GwGGSSGNx5jvXbKLT6/+Lcmn1wK8="; }; - postPatch = - '' - patchShebangs --build lib/dialects/*/Mksrc - # Do not re-build version.h in every 'make' to allow nuke-refs below. - # We remove phony 'FRC' target that forces rebuilds: - # 'version.h: FRC ...' is translated to 'version.h: ...'. - sed -i lib/dialects/*/Makefile -e 's/version.h:\s*FRC/version.h:/' - '' - # help Configure find libproc.h in $SDKROOT - + lib.optionalString stdenv.hostPlatform.isDarwin '' - sed -i -e 's|lcurses|lncurses|g' \ - -e "s|/Library.*/MacOSX.sdk/|\"$SDKROOT\"/|" Configure - ''; + postPatch = '' + patchShebangs --build lib/dialects/*/Mksrc + # Do not re-build version.h in every 'make' to allow nuke-refs below. + # We remove phony 'FRC' target that forces rebuilds: + # 'version.h: FRC ...' is translated to 'version.h: ...'. + sed -i lib/dialects/*/Makefile -e 's/version.h:\s*FRC/version.h:/' + '' + # help Configure find libproc.h in $SDKROOT + + lib.optionalString stdenv.hostPlatform.isDarwin '' + sed -i -e 's|lcurses|lncurses|g' \ + -e "s|/Library.*/MacOSX.sdk/|\"$SDKROOT\"/|" Configure + ''; depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ diff --git a/pkgs/by-name/lu/lua-language-server/package.nix b/pkgs/by-name/lu/lua-language-server/package.nix index e74effd84328..ca5af2e800dd 100644 --- a/pkgs/by-name/lu/lua-language-server/package.nix +++ b/pkgs/by-name/lu/lua-language-server/package.nix @@ -32,62 +32,60 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - fmt - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - rsync - ]; + buildInputs = [ + fmt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + rsync + ]; env.NIX_LDFLAGS = "-lfmt"; - postPatch = + postPatch = '' + # filewatch tests are failing on darwin + # this feature is not used in lua-language-server + substituteInPlace 3rd/bee.lua/test/test.lua \ + --replace-fail 'require "test_filewatch"' "" + + # use nixpkgs fmt library + for d in 3rd/bee.lua 3rd/luamake/bee.lua + do + rm -r $d/3rd/fmt/* + touch $d/3rd/fmt/format.cc + substituteInPlace $d/bee/nonstd/format.h $d/bee/nonstd/print.h \ + --replace-fail "include <3rd/fmt/fmt" "include > src/man_db.conf.in ''; - configureFlags = - [ - "--disable-setuid" - "--disable-cache-owner" - "--localstatedir=/var" - "--with-config-file=${placeholder "out"}/etc/man_db.conf" - "--with-systemdtmpfilesdir=${placeholder "out"}/lib/tmpfiles.d" - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "--with-pager=less" - ] - ++ lib.optionals util-linuxMinimal.hasCol [ - "--with-col=${util-linuxMinimal}/bin/col" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "ac_cv_func__set_invalid_parameter_handler=no" - "ac_cv_func_posix_fadvise=no" - "ac_cv_func_mempcpy=no" - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - "--enable-mandirs=" - ]; + configureFlags = [ + "--disable-setuid" + "--disable-cache-owner" + "--localstatedir=/var" + "--with-config-file=${placeholder "out"}/etc/man_db.conf" + "--with-systemdtmpfilesdir=${placeholder "out"}/lib/tmpfiles.d" + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "--with-pager=less" + ] + ++ lib.optionals util-linuxMinimal.hasCol [ + "--with-col=${util-linuxMinimal}/bin/col" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "ac_cv_func__set_invalid_parameter_handler=no" + "ac_cv_func_posix_fadvise=no" + "ac_cv_func_mempcpy=no" + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + "--enable-mandirs=" + ]; preConfigure = '' configureFlagsArray+=("--with-sections=1 n l 8 3 0 2 5 4 9 6 7") diff --git a/pkgs/by-name/ma/manifest-tool/package.nix b/pkgs/by-name/ma/manifest-tool/package.nix index 9d3de5a520f9..4fafbd72dbb2 100644 --- a/pkgs/by-name/ma/manifest-tool/package.nix +++ b/pkgs/by-name/ma/manifest-tool/package.nix @@ -29,17 +29,16 @@ buildGoModule rec { nativeBuildInputs = [ git ]; - ldflags = - [ - "-s" - "-w" - "-X main.version=${version}" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "-linkmode=external" - "-extldflags" - "-static" - ]; + ldflags = [ + "-s" + "-w" + "-X main.version=${version}" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "-linkmode=external" + "-extldflags" + "-static" + ]; preConfigure = '' export ldflags+=" -X main.gitCommit=$(cat .git-revision)" diff --git a/pkgs/by-name/ma/mapcache/package.nix b/pkgs/by-name/ma/mapcache/package.nix index 23fd47c9e291..8f11bf0a3ae1 100644 --- a/pkgs/by-name/ma/mapcache/package.nix +++ b/pkgs/by-name/ma/mapcache/package.nix @@ -35,15 +35,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-AwdZdOEq9SZ5VzuBllg4U1gdVxZ9IVdqiDrn3QuRdCk="; }; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # work around for `ld: file not found: @rpath/libquadmath.0.dylib` - gfortran.cc - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # work around for `ld: file not found: @rpath/libquadmath.0.dylib` + gfortran.cc + ]; buildInputs = [ apacheHttpd diff --git a/pkgs/by-name/ma/mapserver/package.nix b/pkgs/by-name/ma/mapserver/package.nix index 8e2dc6fc06e2..07852853af50 100644 --- a/pkgs/by-name/ma/mapserver/package.nix +++ b/pkgs/by-name/ma/mapserver/package.nix @@ -39,16 +39,15 @@ stdenv.mkDerivation rec { hash = "sha256-XEjRklbvYV7UoVX12iW6s1mS8pzIljla488CQNuFfto="; }; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals withPython [ - swig - python3.pkgs.setuptools - python3.pkgs.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals withPython [ + swig + python3.pkgs.setuptools + python3.pkgs.pythonImportsCheckHook + ]; buildInputs = [ cairo @@ -68,7 +67,8 @@ stdenv.mkDerivation rec { proj protobufc zlib - ] ++ lib.optional withPython python3; + ] + ++ lib.optional withPython python3; cmakeFlags = [ (lib.cmakeBool "WITH_KML" true) diff --git a/pkgs/by-name/ma/marktext/package.nix b/pkgs/by-name/ma/marktext/package.nix index fd433457c330..fc418ea69c26 100644 --- a/pkgs/by-name/ma/marktext/package.nix +++ b/pkgs/by-name/ma/marktext/package.nix @@ -41,21 +41,20 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-mr79FV/LHkoY3vX9B5yv95IQIJQ9akwfslKndKYmwCo="; }; - nativeBuildInputs = - [ - yarn - fixup-yarn-lock - makeShellWrapper - yarnBuildHook - (python3.withPackages (ps: with ps; [ packaging ])) - pkg-config - nodejs - nodePackages.node-gyp-build - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild - libtool - ]; + nativeBuildInputs = [ + yarn + fixup-yarn-lock + makeShellWrapper + yarnBuildHook + (python3.withPackages (ps: with ps; [ packaging ])) + pkg-config + nodejs + nodePackages.node-gyp-build + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild + libtool + ]; buildInputs = [ libsecret diff --git a/pkgs/by-name/ma/mars-mips/package.nix b/pkgs/by-name/ma/mars-mips/package.nix index 2e1474e676b9..2465c6dd761e 100644 --- a/pkgs/by-name/ma/mars-mips/package.nix +++ b/pkgs/by-name/ma/mars-mips/package.nix @@ -24,16 +24,15 @@ stdenv.mkDerivation (finalAttrs: { dontUnpack = true; - nativeBuildInputs = - [ - makeBinaryWrapper - copyDesktopItems - unzip - imagemagick - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + makeBinaryWrapper + copyDesktopItems + unzip + imagemagick + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/ma/master_me/package.nix b/pkgs/by-name/ma/master_me/package.nix index 38836aa35544..d18aa22b713d 100644 --- a/pkgs/by-name/ma/master_me/package.nix +++ b/pkgs/by-name/ma/master_me/package.nix @@ -22,16 +22,15 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libGL - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXext - libXrandr - ]; + buildInputs = [ + libGL + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXext + libXrandr + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ma/materialize/package.nix b/pkgs/by-name/ma/materialize/package.nix index d46ddefb2d80..f840c9e6c703 100644 --- a/pkgs/by-name/ma/materialize/package.nix +++ b/pkgs/by-name/ma/materialize/package.nix @@ -123,15 +123,14 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-+OREisZ/vw3Oi5MNCYn7u06pZKtf+2trlGyn//uAGws="; - nativeBuildInputs = - [ - cmake - perl - pkg-config - rustPlatform.bindgenHook - ] - # Provides the mig command used by the krb5-src build script - ++ lib.optional stdenv.hostPlatform.isDarwin darwin.bootstrap_cmds; + nativeBuildInputs = [ + cmake + perl + pkg-config + rustPlatform.bindgenHook + ] + # Provides the mig command used by the krb5-src build script + ++ lib.optional stdenv.hostPlatform.isDarwin darwin.bootstrap_cmds; # Needed to get openssl-sys to use pkg-config. OPENSSL_NO_VENDOR = 1; diff --git a/pkgs/by-name/ma/matrix-authentication-service/package.nix b/pkgs/by-name/ma/matrix-authentication-service/package.nix index b2c82cbf283c..3ea79af15c59 100644 --- a/pkgs/by-name/ma/matrix-authentication-service/package.nix +++ b/pkgs/by-name/ma/matrix-authentication-service/package.nix @@ -45,7 +45,8 @@ rustPlatform.buildRustPackage (finalAttrs: { npmHooks.npmConfigHook nodejs (python3.withPackages (ps: [ ps.setuptools ])) # Used by gyp - ] ++ lib.optional stdenv.hostPlatform.isDarwin cctools; # libtool used by gyp; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin cctools; # libtool used by gyp; buildInputs = [ sqlite diff --git a/pkgs/by-name/ma/matrix-continuwuity/package.nix b/pkgs/by-name/ma/matrix-continuwuity/package.nix index 67427c3ad2aa..4b6fe10195d1 100644 --- a/pkgs/by-name/ma/matrix-continuwuity/package.nix +++ b/pkgs/by-name/ma/matrix-continuwuity/package.nix @@ -49,13 +49,12 @@ rustPlatform.buildRustPackage (finalAttrs: { rustPlatform.bindgenHook ]; - buildInputs = - [ - bzip2 - zstd - ] - ++ lib.optional enableJemalloc rust-jemalloc-sys' - ++ lib.optional enableLiburing liburing; + buildInputs = [ + bzip2 + zstd + ] + ++ lib.optional enableJemalloc rust-jemalloc-sys' + ++ lib.optional enableLiburing liburing; env = { ZSTD_SYS_USE_PKG_CONFIG = true; @@ -68,38 +67,36 @@ rustPlatform.buildRustPackage (finalAttrs: { # for available features. # We enable all default features except jemalloc, blurhashing, and io_uring, which # we guard behind our own (default-enabled) flags. - buildFeatures = - [ - "brotli_compression" - "direct_tls" - "element_hacks" - "gzip_compression" - "media_thumbnail" - "release_max_log_level" - "systemd" - "url_preview" - "zstd_compression" - ] - ++ lib.optional enableBlurhashing "blurhashing" - ++ lib.optional enableJemalloc [ - "jemalloc" - "jemalloc_conf" - ] - ++ lib.optional enableLiburing "io_uring"; + buildFeatures = [ + "brotli_compression" + "direct_tls" + "element_hacks" + "gzip_compression" + "media_thumbnail" + "release_max_log_level" + "systemd" + "url_preview" + "zstd_compression" + ] + ++ lib.optional enableBlurhashing "blurhashing" + ++ lib.optional enableJemalloc [ + "jemalloc" + "jemalloc_conf" + ] + ++ lib.optional enableLiburing "io_uring"; passthru = { rocksdb = rocksdb'; # make used rocksdb version available (e.g., for backup scripts) updateScript = nix-update-script { }; - tests = - { - version = testers.testVersion { - inherit (finalAttrs) version; - package = matrix-continuwuity; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit (nixosTests) matrix-continuwuity; + tests = { + version = testers.testVersion { + inherit (finalAttrs) version; + package = matrix-continuwuity; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit (nixosTests) matrix-continuwuity; + }; }; meta = { diff --git a/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix b/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix index 014e15d0a363..55ae682862fa 100644 --- a/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix +++ b/pkgs/by-name/ma/matrix-synapse-unwrapped/package.nix @@ -69,13 +69,12 @@ python3.pkgs.buildPythonApplication rec { rustc ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; propagatedBuildInputs = with python3.pkgs; @@ -150,15 +149,14 @@ python3.pkgs.buildPythonApplication rec { ]; }; - nativeCheckInputs = - [ - openssl - ] - ++ (with python3.pkgs; [ - mock - parameterized - ]) - ++ builtins.filter (p: !p.meta.broken) (lib.flatten (lib.attrValues optional-dependencies)); + nativeCheckInputs = [ + openssl + ] + ++ (with python3.pkgs; [ + mock + parameterized + ]) + ++ builtins.filter (p: !p.meta.broken) (lib.flatten (lib.attrValues optional-dependencies)); doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/rendezvous.nix b/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/rendezvous.nix index bb872ac98920..2cfbd50403bc 100644 --- a/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/rendezvous.nix +++ b/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/rendezvous.nix @@ -32,14 +32,13 @@ buildPythonPackage rec { hash = "sha256-CDUyH08s96xUy0VhK+4ym0w9IgAq9P1UjUipVjlpl9c="; }; - nativeBuildInputs = - [ - setuptools-rust - ] - ++ (with rustPlatform; [ - cargoSetupHook - maturinBuildHook - ]); + nativeBuildInputs = [ + setuptools-rust + ] + ++ (with rustPlatform; [ + cargoSetupHook + maturinBuildHook + ]); buildAndTestSubdir = "synapse"; diff --git a/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/s3-storage-provider.nix b/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/s3-storage-provider.nix index 01e80eba9d66..8acfbaad952f 100644 --- a/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/s3-storage-provider.nix +++ b/pkgs/by-name/ma/matrix-synapse-unwrapped/plugins/s3-storage-provider.nix @@ -34,16 +34,15 @@ buildPythonPackage rec { matrix-synapse-unwrapped ]; - propagatedBuildInputs = - [ - boto3 - humanize - tqdm - twisted - psycopg2 - ] - # For the s3_media_upload script - ++ matrix-synapse-unwrapped.propagatedBuildInputs; + propagatedBuildInputs = [ + boto3 + humanize + tqdm + twisted + psycopg2 + ] + # For the s3_media_upload script + ++ matrix-synapse-unwrapped.propagatedBuildInputs; # Tests need network access doCheck = false; diff --git a/pkgs/by-name/ma/matrix-synapse/package.nix b/pkgs/by-name/ma/matrix-synapse/package.nix index 5935b69234d3..26678a8da2d3 100644 --- a/pkgs/by-name/ma/matrix-synapse/package.nix +++ b/pkgs/by-name/ma/matrix-synapse/package.nix @@ -3,12 +3,11 @@ stdenv, makeWrapper, matrix-synapse-unwrapped, - extras ? - [ - "postgres" - "url-preview" - ] - ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform matrix-synapse-unwrapped.python.pkgs.systemd) "systemd", + extras ? [ + "postgres" + "url-preview" + ] + ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform matrix-synapse-unwrapped.python.pkgs.systemd) "systemd", plugins ? [ ], ... }: diff --git a/pkgs/by-name/ma/matrix-tuwunel/package.nix b/pkgs/by-name/ma/matrix-tuwunel/package.nix index 2ec0dbb26a2f..b4b3436e8bfa 100644 --- a/pkgs/by-name/ma/matrix-tuwunel/package.nix +++ b/pkgs/by-name/ma/matrix-tuwunel/package.nix @@ -102,13 +102,12 @@ rustPlatform.buildRustPackage (finalAttrs: { rustPlatform.bindgenHook ]; - buildInputs = - [ - bzip2 - zstd - ] - ++ lib.optional enableJemalloc rust-jemalloc-sys' - ++ lib.optional enableLiburing liburing; + buildInputs = [ + bzip2 + zstd + ] + ++ lib.optional enableJemalloc rust-jemalloc-sys' + ++ lib.optional enableLiburing liburing; env = { ZSTD_SYS_USE_PKG_CONFIG = true; @@ -121,38 +120,36 @@ rustPlatform.buildRustPackage (finalAttrs: { # for available features. # We enable all default features except jemalloc, blurhashing, and io_uring, which # we guard behind our own (default-enabled) flags. - buildFeatures = - [ - "brotli_compression" - "direct_tls" - "element_hacks" - "gzip_compression" - "media_thumbnail" - "release_max_log_level" - "systemd" - "url_preview" - "zstd_compression" - ] - ++ lib.optional enableBlurhashing "blurhashing" - ++ lib.optional enableJemalloc [ - "jemalloc" - "jemalloc_conf" - ] - ++ lib.optional enableLiburing "io_uring"; + buildFeatures = [ + "brotli_compression" + "direct_tls" + "element_hacks" + "gzip_compression" + "media_thumbnail" + "release_max_log_level" + "systemd" + "url_preview" + "zstd_compression" + ] + ++ lib.optional enableBlurhashing "blurhashing" + ++ lib.optional enableJemalloc [ + "jemalloc" + "jemalloc_conf" + ] + ++ lib.optional enableLiburing "io_uring"; passthru = { rocksdb = rocksdb'; # make used rocksdb version available (e.g., for backup scripts) updateScript = nix-update-script { }; - tests = - { - version = testers.testVersion { - inherit (finalAttrs) version; - package = matrix-tuwunel; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit (nixosTests) matrix-tuwunel; + tests = { + version = testers.testVersion { + inherit (finalAttrs) version; + package = matrix-tuwunel; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit (nixosTests) matrix-tuwunel; + }; }; meta = { diff --git a/pkgs/by-name/ma/mattermost/package.nix b/pkgs/by-name/ma/mattermost/package.nix index b0fb169d6944..40eabefa83c9 100644 --- a/pkgs/by-name/ma/mattermost/package.nix +++ b/pkgs/by-name/ma/mattermost/package.nix @@ -192,15 +192,14 @@ buildMattermost rec { passthru = { updateScript = nix-update-script { - extraArgs = - [ - "--version-regex" - versionInfo.regex - ] - ++ lib.optionals (versionInfo.autoUpdate or null != null) [ - "--override-filename" - versionInfo.autoUpdate - ]; + extraArgs = [ + "--version-regex" + versionInfo.regex + ] + ++ lib.optionals (versionInfo.autoUpdate or null != null) [ + "--override-filename" + versionInfo.autoUpdate + ]; }; tests.mattermost = nixosTests.mattermost; diff --git a/pkgs/by-name/ma/mattermost/tests.nix b/pkgs/by-name/ma/mattermost/tests.nix index 4b81872a65d8..77563b6210ed 100644 --- a/pkgs/by-name/ma/mattermost/tests.nix +++ b/pkgs/by-name/ma/mattermost/tests.nix @@ -34,19 +34,17 @@ mattermost.overrideAttrs ( gotestsum ]; - postPatch = - prev.postPatch or "" - + '' - # Just echo install/get/mod commands in the Makefile, since the dependencies are locked. - substituteInPlace server/Makefile \ - --replace-warn '$(GO) install' 'echo $(GO) install' \ - --replace-warn '$(GOBIN)/go$$version download' 'echo $(GOBIN)/go$$version download' \ - --replace-warn '$(GO) get' 'echo $(GO) get' \ - --replace-warn '$(GO) get' 'echo $(GO) mod' - # mmctl tests shell out by writing a bash script to a tempfile - substituteInPlace server/cmd/mmctl/commands/config_e2e_test.go \ - --replace-fail '#!/bin/bash' '#!${runtimeShell}' - ''; + postPatch = prev.postPatch or "" + '' + # Just echo install/get/mod commands in the Makefile, since the dependencies are locked. + substituteInPlace server/Makefile \ + --replace-warn '$(GO) install' 'echo $(GO) install' \ + --replace-warn '$(GOBIN)/go$$version download' 'echo $(GOBIN)/go$$version download' \ + --replace-warn '$(GO) get' 'echo $(GO) get' \ + --replace-warn '$(GO) get' 'echo $(GO) mod' + # mmctl tests shell out by writing a bash script to a tempfile + substituteInPlace server/cmd/mmctl/commands/config_e2e_test.go \ + --replace-fail '#!/bin/bash' '#!${runtimeShell}' + ''; # Make sure we disable tests that are broken. # Use: `nix log | grep FAIL: | awk '{print $3}' | sort` @@ -54,114 +52,113 @@ mattermost.overrideAttrs ( # X TestFoo # X TestFoo/TestBar # -> TestFoo/TestBar/baz_test - disabledTests = - [ - # All these plugin tests for mmctl reach out to the marketplace, which is impossible in the sandbox - "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Plugin/SystemAdminClient" - "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Plugin/LocalClient" - "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_a_Plugin_without_permissions" - "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Unknown_Plugin/SystemAdminClient" - "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Unknown_Plugin/LocalClient" - "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_new_plugins/SystemAdminClient" - "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_new_plugins/LocalClient" - "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_without_force/SystemAdminClient" - "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_without_force/LocalClient" - "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_with_force/SystemAdminClient" - "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_with_force/LocalClient" - "TestMmctlE2ESuite/TestPluginMarketplaceInstallCmd/install_a_plugin/SystemAdminClient" - "TestMmctlE2ESuite/TestPluginMarketplaceInstallCmd/install_a_plugin/LocalClient" - "TestMmctlE2ESuite/TestPluginMarketplaceListCmd/List_Marketplace_Plugins_for_Admin_User/SystemAdminClient" - "TestMmctlE2ESuite/TestPluginMarketplaceListCmd/List_Marketplace_Plugins_for_Admin_User/LocalClient" + disabledTests = [ + # All these plugin tests for mmctl reach out to the marketplace, which is impossible in the sandbox + "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Plugin/SystemAdminClient" + "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Plugin/LocalClient" + "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_a_Plugin_without_permissions" + "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Unknown_Plugin/SystemAdminClient" + "TestMmctlE2ESuite/TestPluginDeleteCmd/Delete_Unknown_Plugin/LocalClient" + "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_new_plugins/SystemAdminClient" + "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_new_plugins/LocalClient" + "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_without_force/SystemAdminClient" + "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_without_force/LocalClient" + "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_with_force/SystemAdminClient" + "TestMmctlE2ESuite/TestPluginInstallURLCmd/install_an_already_installed_plugin_with_force/LocalClient" + "TestMmctlE2ESuite/TestPluginMarketplaceInstallCmd/install_a_plugin/SystemAdminClient" + "TestMmctlE2ESuite/TestPluginMarketplaceInstallCmd/install_a_plugin/LocalClient" + "TestMmctlE2ESuite/TestPluginMarketplaceListCmd/List_Marketplace_Plugins_for_Admin_User/SystemAdminClient" + "TestMmctlE2ESuite/TestPluginMarketplaceListCmd/List_Marketplace_Plugins_for_Admin_User/LocalClient" - # Seems to just be broken. - "TestMmctlE2ESuite/TestPreferenceUpdateCmd" + # Seems to just be broken. + "TestMmctlE2ESuite/TestPreferenceUpdateCmd" - # Has a hardcoded "google.com" test which also verifies that the address isn't loopback, - # so we also can't just substituteInPlace to one that will resolve - "TestDialContextFilter" + # Has a hardcoded "google.com" test which also verifies that the address isn't loopback, + # so we also can't just substituteInPlace to one that will resolve + "TestDialContextFilter" - # No interfaces but loopback in the sandbox, so returns empty - "TestGetServerIPAddress" + # No interfaces but loopback in the sandbox, so returns empty + "TestGetServerIPAddress" - # S3 bucket tests (needs Minio) - "TestInsecureMakeBucket" - "TestMakeBucket" - "TestListDirectory" - "TestTimeout" - "TestStartServerNoS3Bucket" - "TestS3TestConnection" - "TestS3FileBackendTestSuite" - "TestS3FileBackendTestSuiteWithEncryption" + # S3 bucket tests (needs Minio) + "TestInsecureMakeBucket" + "TestMakeBucket" + "TestListDirectory" + "TestTimeout" + "TestStartServerNoS3Bucket" + "TestS3TestConnection" + "TestS3FileBackendTestSuite" + "TestS3FileBackendTestSuiteWithEncryption" - # Mail tests (needs a SMTP server) - "TestSendMailUsingConfig" - "TestSendMailUsingConfigAdvanced" - "TestSendMailWithEmbeddedFilesUsingConfig" - "TestSendCloudWelcomeEmail" - "TestMailConnectionAdvanced" - "TestMailConnectionFromConfig" - "TestEmailTest" - "TestBasicAPIPlugins/test_send_mail_plugin" + # Mail tests (needs a SMTP server) + "TestSendMailUsingConfig" + "TestSendMailUsingConfigAdvanced" + "TestSendMailWithEmbeddedFilesUsingConfig" + "TestSendCloudWelcomeEmail" + "TestMailConnectionAdvanced" + "TestMailConnectionFromConfig" + "TestEmailTest" + "TestBasicAPIPlugins/test_send_mail_plugin" - # Seems to be unreliable - "TestPluginAPIUpdateUserPreferences" - "TestPluginAPIGetUserPreferences" + # Seems to be unreliable + "TestPluginAPIUpdateUserPreferences" + "TestPluginAPIGetUserPreferences" - # These invite tests try to send a welcome email and we don't have a SMTP server up. - "TestInviteUsersToTeam" - "TestInviteGuestsToTeam" - "TestSendInviteEmails" - "TestDeliver" + # These invite tests try to send a welcome email and we don't have a SMTP server up. + "TestInviteUsersToTeam" + "TestInviteGuestsToTeam" + "TestSendInviteEmails" + "TestDeliver" - # https://github.com/mattermost/mattermost/issues/29184 - "TestUpAndDownMigrations/Should_be_reversible_for_mysql" - ] - ++ optionals (is10 final.version) [ - ## mattermostLatest test ignores + # https://github.com/mattermost/mattermost/issues/29184 + "TestUpAndDownMigrations/Should_be_reversible_for_mysql" + ] + ++ optionals (is10 final.version) [ + ## mattermostLatest test ignores - # These bot related tests appear to be broken. - "TestCreateBot" - "TestPatchBot" - "TestGetBot" - "TestEnableBot" - "TestDisableBot" - "TestAssignBot" - "TestConvertBotToUser" + # These bot related tests appear to be broken. + "TestCreateBot" + "TestPatchBot" + "TestGetBot" + "TestEnableBot" + "TestDisableBot" + "TestAssignBot" + "TestConvertBotToUser" - # Need Elasticsearch or Opensearch - "TestBlevePurgeIndexes" - "TestOpensearchAggregation" - "TestOpensearchInterfaceTestSuite" - "TestOpenSearchIndexerJobIsEnabled" - "TestOpenSearchIndexerPending" - "TestBulkProcessor" - "TestElasticsearchAggregation" - "TestElasticsearchInterfaceTestSuite" - "TestElasticSearchIndexerJobIsEnabled" - "TestElasticSearchIndexerPending" + # Need Elasticsearch or Opensearch + "TestBlevePurgeIndexes" + "TestOpensearchAggregation" + "TestOpensearchInterfaceTestSuite" + "TestOpenSearchIndexerJobIsEnabled" + "TestOpenSearchIndexerPending" + "TestBulkProcessor" + "TestElasticsearchAggregation" + "TestElasticsearchInterfaceTestSuite" + "TestElasticSearchIndexerJobIsEnabled" + "TestElasticSearchIndexerPending" - # Broken in the sandbox. - "TestVersion" - "TestRunServerNoSystemd" + # Broken in the sandbox. + "TestVersion" + "TestRunServerNoSystemd" - # Appear to be broken. - "TestSessionStore/MySQL" - "TestAccessControlPolicyStore/MySQL" - "TestAttributesStore/MySQL" - "TestBasicAPIPlugins" + # Appear to be broken. + "TestSessionStore/MySQL" + "TestAccessControlPolicyStore/MySQL" + "TestAttributesStore/MySQL" + "TestBasicAPIPlugins" - "TestRunExportJobE2EByType" - "TestUpdateTeam" - "TestSyncSyncableRoles" - ] - ++ optionals (!stdenv.hostPlatform.isx86_64) [ - # aarch64: invalid operating system or processor architecture - "TestCanIUpgradeToE0" + "TestRunExportJobE2EByType" + "TestUpdateTeam" + "TestSyncSyncableRoles" + ] + ++ optionals (!stdenv.hostPlatform.isx86_64) [ + # aarch64: invalid operating system or processor architecture + "TestCanIUpgradeToE0" - # aarch64: thumbnail previews are nondeterministic - "TestUploadFiles/multipart_Happy_image_thumbnail" - "TestUploadFiles/simple_Happy_image_thumbnail" - ]; + # aarch64: thumbnail previews are nondeterministic + "TestUploadFiles/multipart_Happy_image_thumbnail" + "TestUploadFiles/simple_Happy_image_thumbnail" + ]; preCheck = '' cleanup() { diff --git a/pkgs/by-name/ma/maude/package.nix b/pkgs/by-name/ma/maude/package.nix index 2bf8fa9fa036..deea3053d2cf 100644 --- a/pkgs/by-name/ma/maude/package.nix +++ b/pkgs/by-name/ma/maude/package.nix @@ -46,12 +46,13 @@ stdenv.mkDerivation { yices ]; - hardeningDisable = - [ "stackprotector" ] - ++ lib.optionals stdenv.hostPlatform.isi686 [ - "pic" - "fortify" - ]; + hardeningDisable = [ + "stackprotector" + ] + ++ lib.optionals stdenv.hostPlatform.isi686 [ + "pic" + "fortify" + ]; # Fix for glibc-2.34, see # https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-lang/maude/maude-3.1-r1.ebuild?id=f021cc6cfa1e35eb9c59955830f1fd89bfcb26b4 diff --git a/pkgs/by-name/ma/mautrix-signal/package.nix b/pkgs/by-name/ma/mautrix-signal/package.nix index 43f32bfbaf0d..a85cd20a2364 100644 --- a/pkgs/by-name/ma/mautrix-signal/package.nix +++ b/pkgs/by-name/ma/mautrix-signal/package.nix @@ -44,15 +44,14 @@ buildGoModule rec { vendorHash = "sha256-NmIWxc+6Leaqm1W+g2XdbMv4iU7Z7k8/g88U0iw/+98="; doCheck = true; - preCheck = - '' - # Needed by the tests to be able to find libstdc++ - export LD_LIBRARY_PATH="${stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH" - '' - + (lib.optionalString (!withGoolm) '' - # When using libolm, the tests need explicit linking to libstdc++ - export CGO_LDFLAGS="${cppStdLib}" - ''); + preCheck = '' + # Needed by the tests to be able to find libstdc++ + export LD_LIBRARY_PATH="${stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH" + '' + + (lib.optionalString (!withGoolm) '' + # When using libolm, the tests need explicit linking to libstdc++ + export CGO_LDFLAGS="${cppStdLib}" + ''); postCheck = '' unset LD_LIBRARY_PATH diff --git a/pkgs/by-name/ma/maven/build-maven-package.nix b/pkgs/by-name/ma/maven/build-maven-package.nix index c6ce59179f51..4ed6380752fd 100644 --- a/pkgs/by-name/ma/maven/build-maven-package.nix +++ b/pkgs/by-name/ma/maven/build-maven-package.nix @@ -39,56 +39,56 @@ let nativeBuildInputs = [ maven - ] ++ args.nativeBuildInputs or [ ]; + ] + ++ args.nativeBuildInputs or [ ]; JAVA_HOME = mvnJdk; impureEnvVars = lib.fetchers.proxyImpureEnvVars; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - MAVEN_EXTRA_ARGS="" + MAVEN_EXTRA_ARGS="" - # handle proxy - if [[ -n "''${HTTP_PROXY-}" ]] || [[ -n "''${HTTPS_PROXY-}" ]] || [[ -n "''${NO_PROXY-}" ]];then - mvnSettingsFile="$(mktemp -d)/settings.xml" - ${writeProxySettings} $mvnSettingsFile - MAVEN_EXTRA_ARGS="-s=$mvnSettingsFile" - fi + # handle proxy + if [[ -n "''${HTTP_PROXY-}" ]] || [[ -n "''${HTTPS_PROXY-}" ]] || [[ -n "''${NO_PROXY-}" ]];then + mvnSettingsFile="$(mktemp -d)/settings.xml" + ${writeProxySettings} $mvnSettingsFile + MAVEN_EXTRA_ARGS="-s=$mvnSettingsFile" + fi - # handle cacert by populating a trust store on the fly - if [[ -n "''${NIX_SSL_CERT_FILE-}" ]] && [[ "''${NIX_SSL_CERT_FILE-}" != "/no-cert-file.crt" ]];then - keyStoreFile="$(mktemp -d)/keystore" - keyStorePwd="$(head -c10 /dev/random | base32)" - echo y | ${jdk}/bin/keytool -importcert -file "$NIX_SSL_CERT_FILE" -alias alias -keystore "$keyStoreFile" -storepass "$keyStorePwd" - MAVEN_EXTRA_ARGS="$MAVEN_EXTRA_ARGS -Djavax.net.ssl.trustStore=$keyStoreFile -Djavax.net.ssl.trustStorePassword=$keyStorePwd" - fi - '' - + lib.optionalString buildOffline '' - mvn $MAVEN_EXTRA_ARGS de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters} + # handle cacert by populating a trust store on the fly + if [[ -n "''${NIX_SSL_CERT_FILE-}" ]] && [[ "''${NIX_SSL_CERT_FILE-}" != "/no-cert-file.crt" ]];then + keyStoreFile="$(mktemp -d)/keystore" + keyStorePwd="$(head -c10 /dev/random | base32)" + echo y | ${jdk}/bin/keytool -importcert -file "$NIX_SSL_CERT_FILE" -alias alias -keystore "$keyStoreFile" -storepass "$keyStorePwd" + MAVEN_EXTRA_ARGS="$MAVEN_EXTRA_ARGS -Djavax.net.ssl.trustStore=$keyStoreFile -Djavax.net.ssl.trustStorePassword=$keyStorePwd" + fi + '' + + lib.optionalString buildOffline '' + mvn $MAVEN_EXTRA_ARGS de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters} - for artifactId in ${builtins.toString manualMvnArtifacts} - do - echo "downloading manual $artifactId" - mvn $MAVEN_EXTRA_ARGS dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2 - done + for artifactId in ${builtins.toString manualMvnArtifacts} + do + echo "downloading manual $artifactId" + mvn $MAVEN_EXTRA_ARGS dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2 + done - for artifactId in ${builtins.toString manualMvnSources} - do - group=$(echo $artifactId | cut -d':' -f1) - artifact=$(echo $artifactId | cut -d':' -f2) - echo "downloading manual sources $artifactId" - mvn $MAVEN_EXTRA_ARGS dependency:sources -DincludeGroupIds="$group" -DincludeArtifactIds="$artifact" -Dmaven.repo.local=$out/.m2 - done - '' - + lib.optionalString (!buildOffline) '' - mvn $MAVEN_EXTRA_ARGS package -Dmaven.repo.local=$out/.m2 ${mvnSkipTests} ${mvnParameters} - '' - + '' - runHook postBuild - ''; + for artifactId in ${builtins.toString manualMvnSources} + do + group=$(echo $artifactId | cut -d':' -f1) + artifact=$(echo $artifactId | cut -d':' -f2) + echo "downloading manual sources $artifactId" + mvn $MAVEN_EXTRA_ARGS dependency:sources -DincludeGroupIds="$group" -DincludeArtifactIds="$artifact" -Dmaven.repo.local=$out/.m2 + done + '' + + lib.optionalString (!buildOffline) '' + mvn $MAVEN_EXTRA_ARGS package -Dmaven.repo.local=$out/.m2 ${mvnSkipTests} ${mvnParameters} + '' + + '' + runHook postBuild + ''; # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside installPhase = '' diff --git a/pkgs/by-name/mb/mblaze/package.nix b/pkgs/by-name/mb/mblaze/package.nix index 69f19859ca11..ce58fc30fb80 100644 --- a/pkgs/by-name/mb/mblaze/package.nix +++ b/pkgs/by-name/mb/mblaze/package.nix @@ -37,37 +37,36 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - postInstall = - '' - installShellCompletion contrib/_mblaze - '' - + lib.optionalString (ruby != null) '' - install -Dt $out/bin contrib/msuck contrib/mblow + postInstall = '' + installShellCompletion contrib/_mblaze + '' + + lib.optionalString (ruby != null) '' + install -Dt $out/bin contrib/msuck contrib/mblow - # The following wrappings are used to preserve the executable - # names (the value of $0 in a script). The script mcom is - # designed to be run directly or via symlinks such as mrep. Using - # symlinks changes the value of $0 in the script, and makes it - # behave differently. When using the wrapProgram tool, the resulting - # wrapper breaks this behaviour. The following wrappers preserve it. + # The following wrappings are used to preserve the executable + # names (the value of $0 in a script). The script mcom is + # designed to be run directly or via symlinks such as mrep. Using + # symlinks changes the value of $0 in the script, and makes it + # behave differently. When using the wrapProgram tool, the resulting + # wrapper breaks this behaviour. The following wrappers preserve it. - mkdir -p $out/wrapped - for x in mcom mbnc mfwd mrep; do - mv $out/bin/$x $out/wrapped - makeWrapper $out/wrapped/$x $out/bin/$x \ - --argv0 $out/bin/$x \ - --prefix PATH : $out/bin \ - --prefix PATH : ${ - lib.makeBinPath [ - coreutils - file - gawk - gnugrep - gnused - ] - } - done - ''; + mkdir -p $out/wrapped + for x in mcom mbnc mfwd mrep; do + mv $out/bin/$x $out/wrapped + makeWrapper $out/wrapped/$x $out/bin/$x \ + --argv0 $out/bin/$x \ + --prefix PATH : $out/bin \ + --prefix PATH : ${ + lib.makeBinPath [ + coreutils + file + gawk + gnugrep + gnused + ] + } + done + ''; meta = with lib; { homepage = "https://github.com/leahneukirchen/mblaze"; diff --git a/pkgs/by-name/mc/mc/package.nix b/pkgs/by-name/mc/mc/package.nix index 76e563bbbb21..e5eb3720e42a 100644 --- a/pkgs/by-name/mc/mc/package.nix +++ b/pkgs/by-name/mc/mc/package.nix @@ -34,33 +34,31 @@ stdenv.mkDerivation rec { hash = "sha256-yuFJ1C+ETlGF2MgdfbOROo+iFMZfhSIAqdiWtGivFkw="; }; - nativeBuildInputs = - [ - pkg-config - unzip - ] - # The preFixup hook rewrites the binary, which invaliates the code - # signature. Add the fixup hook to sign the output. - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + pkg-config + unzip + ] + # The preFixup hook rewrites the binary, which invaliates the code + # signature. Add the fixup hook to sign the output. + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + darwin.autoSignDarwinBinariesHook + ]; - buildInputs = - [ - file - gettext - glib - libICE - libssh2 - openssl - slang - zip - ] - ++ lib.optionals x11Support [ libX11 ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - e2fsprogs - gpm - ]; + buildInputs = [ + file + gettext + glib + libICE + libssh2 + openssl + slang + zip + ] + ++ lib.optionals x11Support [ libX11 ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + e2fsprogs + gpm + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/mc/mcpelauncher-client/package.nix b/pkgs/by-name/mc/mcpelauncher-client/package.nix index bf09a4ab8ee8..a040bae9f356 100644 --- a/pkgs/by-name/mc/mcpelauncher-client/package.nix +++ b/pkgs/by-name/mc/mcpelauncher-client/package.nix @@ -52,38 +52,36 @@ clangStdenv.mkDerivation (finalAttrs: { # FORTIFY_SOURCE breaks libc_shim and the project will fail to compile hardeningDisable = [ "fortify" ]; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals (withQtWebview || withQtErrorWindow) [ - qt6.wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals (withQtWebview || withQtErrorWindow) [ + qt6.wrapQtAppsHook + ]; - buildInputs = - [ - openssl - zlib - libpng - libglvnd - xorg.libX11 - xorg.libXi - xorg.libXtst - libevdev - curl - pulseaudio - glfw - sdl3 - ] - ++ lib.optionals (withQtWebview || withQtErrorWindow) [ - qt6.qtbase - qt6.qttools - qt6.qtwayland - ] - ++ lib.optionals withQtWebview [ - qt6.qtwebengine - ]; + buildInputs = [ + openssl + zlib + libpng + libglvnd + xorg.libX11 + xorg.libXi + xorg.libXtst + libevdev + curl + pulseaudio + glfw + sdl3 + ] + ++ lib.optionals (withQtWebview || withQtErrorWindow) [ + qt6.qtbase + qt6.qttools + qt6.qtwayland + ] + ++ lib.optionals withQtWebview [ + qt6.qtwebengine + ]; cmakeFlags = [ (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) diff --git a/pkgs/by-name/md/mdadm4/package.nix b/pkgs/by-name/md/mdadm4/package.nix index 28ff372478a5..7806e313f583 100644 --- a/pkgs/by-name/md/mdadm4/package.nix +++ b/pkgs/by-name/md/mdadm4/package.nix @@ -38,19 +38,18 @@ stdenv.mkDerivation rec { }) ]; - makeFlags = - [ - "NIXOS=1" - "INSTALL=install" - "BINDIR=$(out)/sbin" - "SYSTEMD_DIR=$(out)/lib/systemd/system" - "MANDIR=$(out)/share/man" - "RUN_DIR=/dev/.mdadm" - "STRIP=" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "NIXOS=1" + "INSTALL=install" + "BINDIR=$(out)/sbin" + "SYSTEMD_DIR=$(out)/lib/systemd/system" + "MANDIR=$(out)/share/man" + "RUN_DIR=/dev/.mdadm" + "STRIP=" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; installFlags = [ "install-systemd" ]; diff --git a/pkgs/by-name/me/mediaelch/package.nix b/pkgs/by-name/me/mediaelch/package.nix index e2c18c560f98..1b4121976e7a 100644 --- a/pkgs/by-name/me/mediaelch/package.nix +++ b/pkgs/by-name/me/mediaelch/package.nix @@ -46,22 +46,21 @@ stdenv.mkDerivation (finalAttrs: { qt'.wrapQtAppsHook ]; - buildInputs = - [ - curl - ffmpeg - libmediainfo - libzen - qt'.qtbase - qt'.qtdeclarative - qt'.qtmultimedia - qt'.qtsvg - qt'.qtwayland - qt'.quazip - ] - ++ lib.optionals (qtVersion == 6) [ - qt'.qt5compat - ]; + buildInputs = [ + curl + ffmpeg + libmediainfo + libzen + qt'.qtbase + qt'.qtdeclarative + qt'.qtmultimedia + qt'.qtsvg + qt'.qtwayland + qt'.quazip + ] + ++ lib.optionals (qtVersion == 6) [ + qt'.qt5compat + ]; cmakeFlags = [ (lib.cmakeBool "DISABLE_UPDATER" true) diff --git a/pkgs/by-name/me/mednafen/package.nix b/pkgs/by-name/me/mednafen/package.nix index 685bffa05486..ab7665120b46 100644 --- a/pkgs/by-name/me/mednafen/package.nix +++ b/pkgs/by-name/me/mednafen/package.nix @@ -38,27 +38,26 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - SDL2 - SDL2_net - flac - libglut - libcdio - libjack2 - libsamplerate - libsndfile - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libGL - libGLU - libX11 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + SDL2 + SDL2_net + flac + libglut + libcdio + libjack2 + libsamplerate + libsndfile + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libGL + libGLU + libX11 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; hardeningDisable = [ "format" diff --git a/pkgs/by-name/me/megacmd/package.nix b/pkgs/by-name/me/megacmd/package.nix index cf98f886d1a0..b8e02743871f 100644 --- a/pkgs/by-name/me/megacmd/package.nix +++ b/pkgs/by-name/me/megacmd/package.nix @@ -88,7 +88,8 @@ stdenv.mkDerivation { "--with-readline" "--with-sodium" "--with-termcap" - ] ++ (if withFreeImage then [ "--with-freeimage" ] else [ "--without-freeimage" ]); + ] + ++ (if withFreeImage then [ "--with-freeimage" ] else [ "--without-freeimage" ]); # On darwin, some macros defined in AssertMacros.h (from apple-sdk) are conflicting. postConfigure = '' diff --git a/pkgs/by-name/me/megatools/package.nix b/pkgs/by-name/me/megatools/package.nix index f3ce5bdd97ce..fff0624ae19d 100644 --- a/pkgs/by-name/me/megatools/package.nix +++ b/pkgs/by-name/me/megatools/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { buildInputs = [ curl glib - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ fuse ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ fuse ]; enableParallelBuilding = true; strictDeps = true; diff --git a/pkgs/by-name/me/meld/package.nix b/pkgs/by-name/me/meld/package.nix index 35ef072d6b25..8a36faf0565b 100644 --- a/pkgs/by-name/me/meld/package.nix +++ b/pkgs/by-name/me/meld/package.nix @@ -42,7 +42,8 @@ python3.pkgs.buildPythonApplication rec { gobject-introspection wrapGAppsHook3 gtk3 # for gtk-update-icon-cache - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ gtk3 diff --git a/pkgs/by-name/me/melonDS/package.nix b/pkgs/by-name/me/melonDS/package.nix index da276eb36199..6390b5473418 100644 --- a/pkgs/by-name/me/melonDS/package.nix +++ b/pkgs/by-name/me/melonDS/package.nix @@ -44,21 +44,20 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - SDL2 - enet - libarchive - libslirp - libGL - qtbase - qtmultimedia - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - qtwayland - ]; + buildInputs = [ + SDL2 + enet + libarchive + libslirp + libGL + qtbase + qtmultimedia + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + qtwayland + ]; cmakeFlags = [ (lib.cmakeBool "USE_QT6" true) ]; diff --git a/pkgs/by-name/me/memray/package.nix b/pkgs/by-name/me/memray/package.nix index dbcdc70c739f..51b16f81a501 100644 --- a/pkgs/by-name/me/memray/package.nix +++ b/pkgs/by-name/me/memray/package.nix @@ -31,7 +31,8 @@ python3Packages.buildPythonApplication rec { elfutils # for `-ldebuginfod` libunwind lz4 - ] ++ (with python3Packages; [ cython ]); + ] + ++ (with python3Packages; [ cython ]); dependencies = with python3Packages; [ pkgconfig diff --git a/pkgs/by-name/me/mercurial/package.nix b/pkgs/by-name/me/mercurial/package.nix index bc60bd3fcb54..1b2fae4ac84a 100644 --- a/pkgs/by-name/me/mercurial/package.nix +++ b/pkgs/by-name/me/mercurial/package.nix @@ -65,18 +65,17 @@ let lib.optional re2Support fb-re2 ++ lib.optional gitSupport pygit2 ++ lib.optional highlightSupport pygments; - nativeBuildInputs = - [ - makeWrapper - gettext - installShellFiles - setuptools - ] - ++ lib.optionals rustSupport [ - rustPlatform.cargoSetupHook - cargo - rustc - ]; + nativeBuildInputs = [ + makeWrapper + gettext + installShellFiles + setuptools + ] + ++ lib.optionals rustSupport [ + rustPlatform.cargoSetupHook + cargo + rustc + ]; buildInputs = [ docutils ]; makeFlags = [ "PREFIX=$(out)" ] ++ lib.optional rustSupport "PURE=--rust"; diff --git a/pkgs/by-name/me/merkaartor/package.nix b/pkgs/by-name/me/merkaartor/package.nix index c56f9ce4b8a1..c206410dfddf 100644 --- a/pkgs/by-name/me/merkaartor/package.nix +++ b/pkgs/by-name/me/merkaartor/package.nix @@ -36,19 +36,18 @@ stdenv.mkDerivation rec { qt5.wrapQtAppsHook ]; - buildInputs = - [ - gdal - proj - protobuf - qt5.qtnetworkauth - qt5.qtsvg - qt5.qtwebengine - ] - ++ lib.optional withGeoimage exiv2 - ++ lib.optional withGpsdlib gpsd - ++ lib.optional withLibproxy libproxy - ++ lib.optional withZbar zbar; + buildInputs = [ + gdal + proj + protobuf + qt5.qtnetworkauth + qt5.qtsvg + qt5.qtwebengine + ] + ++ lib.optional withGeoimage exiv2 + ++ lib.optional withGpsdlib gpsd + ++ lib.optional withLibproxy libproxy + ++ lib.optional withZbar zbar; cmakeFlags = [ (lib.cmakeBool "GEOIMAGE" withGeoimage) diff --git a/pkgs/by-name/me/meshoptimizer/package.nix b/pkgs/by-name/me/meshoptimizer/package.nix index 2e128ab9f0fe..70c5e2fe9b68 100644 --- a/pkgs/by-name/me/meshoptimizer/package.nix +++ b/pkgs/by-name/me/meshoptimizer/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DMESHOPT_BUILD_GLTFPACK=ON" "-DMESHOPT_BASISU_PATH=${basis_universal}" - ] ++ lib.optional (!stdenv.hostPlatform.isStatic) "-DMESHOPT_BUILD_SHARED_LIBS:BOOL=ON"; + ] + ++ lib.optional (!stdenv.hostPlatform.isStatic) "-DMESHOPT_BUILD_SHARED_LIBS:BOOL=ON"; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/me/meson/package.nix b/pkgs/by-name/me/meson/package.nix index 7674462985cc..78680308f346 100644 --- a/pkgs/by-name/me/meson/package.nix +++ b/pkgs/by-name/me/meson/package.nix @@ -87,26 +87,24 @@ python3.pkgs.buildPythonApplication rec { nativeBuildInputs = [ installShellFiles ]; - nativeCheckInputs = - [ - ninja - pkg-config - ] - ++ lib.optionals python3.isPyPy [ - # Several tests hardcode python3. - (writeShellScriptBin "python3" ''exec pypy3 "$@"'') - ]; + nativeCheckInputs = [ + ninja + pkg-config + ] + ++ lib.optionals python3.isPyPy [ + # Several tests hardcode python3. + (writeShellScriptBin "python3" ''exec pypy3 "$@"'') + ]; - checkInputs = - [ - zlib - ] - ++ lib.optionals (stdenv.cc.isClang && !stdenv.hostPlatform.isDarwin) [ - # https://github.com/mesonbuild/meson/blob/bd3f1b2e0e70ef16dfa4f441686003212440a09b/test%20cases/common/184%20openmp/meson.build - llvmPackages.openmp - # https://github.com/mesonbuild/meson/blob/1670fca36fcb1a4fe4780e96731e954515501a35/test%20cases/frameworks/29%20blocks/meson.build - libblocksruntime - ]; + checkInputs = [ + zlib + ] + ++ lib.optionals (stdenv.cc.isClang && !stdenv.hostPlatform.isDarwin) [ + # https://github.com/mesonbuild/meson/blob/bd3f1b2e0e70ef16dfa4f441686003212440a09b/test%20cases/common/184%20openmp/meson.build + llvmPackages.openmp + # https://github.com/mesonbuild/meson/blob/1670fca36fcb1a4fe4780e96731e954515501a35/test%20cases/frameworks/29%20blocks/meson.build + libblocksruntime + ]; checkPhase = lib.concatStringsSep "\n" ( [ diff --git a/pkgs/by-name/me/mesonlsp/package.nix b/pkgs/by-name/me/mesonlsp/package.nix index 40977ad93a5c..0346ea5a08ee 100644 --- a/pkgs/by-name/me/mesonlsp/package.nix +++ b/pkgs/by-name/me/mesonlsp/package.nix @@ -49,18 +49,17 @@ stdenv'.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - curl - libarchive - libpkgconf - nlohmann_json - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libossp_uuid - pkgsStatic.fmt - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ libuuid ]; + buildInputs = [ + curl + libarchive + libpkgconf + nlohmann_json + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libossp_uuid + pkgsStatic.fmt + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libuuid ]; mesonFlags = [ "-Dbenchmarks=false" ]; diff --git a/pkgs/by-name/mf/mfcl5750dw/package.nix b/pkgs/by-name/mf/mfcl5750dw/package.nix index 117c8a802dad..752edbc51b23 100644 --- a/pkgs/by-name/mf/mfcl5750dw/package.nix +++ b/pkgs/by-name/mf/mfcl5750dw/package.nix @@ -65,51 +65,50 @@ stdenvNoCC.mkDerivation (finalAttrs: { ./fix-perm.patch ]; - installPhase = - '' - runHook preInstall - mkdir -p $out - cp -ar opt $out/opt + installPhase = '' + runHook preInstall + mkdir -p $out + cp -ar opt $out/opt - # delete unnecessary files for the current architecture - '' - + lib.concatMapStrings (arch: '' - echo Deleting files for ${arch} - rm -r "$out/opt/brother/Printers/MFCL5750DW/lpd/${arch}" - '') (builtins.filter (arch: arch != stdenvNoCC.hostPlatform.linuxArch) arches) - + '' - # bundled scripts don't understand the arch subdirectories for some reason - ln -s \ - "$out/opt/brother/Printers/MFCL5750DW/lpd/${stdenvNoCC.hostPlatform.linuxArch}/"* \ - "$out/opt/brother/Printers/MFCL5750DW/lpd/" + # delete unnecessary files for the current architecture + '' + + lib.concatMapStrings (arch: '' + echo Deleting files for ${arch} + rm -r "$out/opt/brother/Printers/MFCL5750DW/lpd/${arch}" + '') (builtins.filter (arch: arch != stdenvNoCC.hostPlatform.linuxArch) arches) + + '' + # bundled scripts don't understand the arch subdirectories for some reason + ln -s \ + "$out/opt/brother/Printers/MFCL5750DW/lpd/${stdenvNoCC.hostPlatform.linuxArch}/"* \ + "$out/opt/brother/Printers/MFCL5750DW/lpd/" - # Fix global references and replace auto discovery mechanism with hardcoded values - substituteInPlace $out/opt/brother/Printers/MFCL5750DW/lpd/lpdfilter \ - --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL5750DW\"; #" \ - --replace "PRINTER =~" "PRINTER = \"MFCL5750DW\"; #" - - substituteInPlace $out/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper \ - --replace "my \$basedir = C" "my \$basedir = \"$out/opt/brother/Printers/MFCL5750DW\" ; #" \ + # Fix global references and replace auto discovery mechanism with hardcoded values + substituteInPlace $out/opt/brother/Printers/MFCL5750DW/lpd/lpdfilter \ + --replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL5750DW\"; #" \ --replace "PRINTER =~" "PRINTER = \"MFCL5750DW\"; #" - # Make sure all executables have the necessary runtime dependencies available - find "$out" -executable -and -type f | while read file; do - wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" - done - # Symlink filter and ppd into a location where CUPS will discover it - mkdir -p $out/lib/cups/filter - mkdir -p $out/share/cups/model - mkdir -p $out/etc/opt/brother/Printers/MFCL5750DW/inf - ln -s $out/opt/brother/Printers/MFCL5750DW/inf/brMFCL5750DWrc \ - $out/etc/opt/brother/Printers/MFCL5750DW/inf/brMFCL5750DWrc - ln -s \ - $out/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper \ - $out/lib/cups/filter/brother_lpdwrapper_MFCL5750DW - ln -s \ - $out/opt/brother/Printers/MFCL5750DW/cupswrapper/brother-MFCL5750DW-cups-en.ppd \ - $out/share/cups/model/ - runHook postInstall - ''; + substituteInPlace $out/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper \ + --replace "my \$basedir = C" "my \$basedir = \"$out/opt/brother/Printers/MFCL5750DW\" ; #" \ + --replace "PRINTER =~" "PRINTER = \"MFCL5750DW\"; #" + + # Make sure all executables have the necessary runtime dependencies available + find "$out" -executable -and -type f | while read file; do + wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}" + done + # Symlink filter and ppd into a location where CUPS will discover it + mkdir -p $out/lib/cups/filter + mkdir -p $out/share/cups/model + mkdir -p $out/etc/opt/brother/Printers/MFCL5750DW/inf + ln -s $out/opt/brother/Printers/MFCL5750DW/inf/brMFCL5750DWrc \ + $out/etc/opt/brother/Printers/MFCL5750DW/inf/brMFCL5750DWrc + ln -s \ + $out/opt/brother/Printers/MFCL5750DW/cupswrapper/lpdwrapper \ + $out/lib/cups/filter/brother_lpdwrapper_MFCL5750DW + ln -s \ + $out/opt/brother/Printers/MFCL5750DW/cupswrapper/brother-MFCL5750DW-cups-en.ppd \ + $out/share/cups/model/ + runHook postInstall + ''; meta = { homepage = "https://www.brother.com/"; description = "Brother MFCL5750DW CUPS driver"; diff --git a/pkgs/by-name/mg/mgba/package.nix b/pkgs/by-name/mg/mgba/package.nix index c63ce1fd8e01..5d42106e7fe9 100644 --- a/pkgs/by-name/mg/mgba/package.nix +++ b/pkgs/by-name/mg/mgba/package.nix @@ -65,7 +65,8 @@ stdenv.mkDerivation (finalAttrs: { qtbase qtmultimedia qttools - ] ++ lib.optionals enableDiscordRpc [ discord-rpc ]; + ] + ++ lib.optionals enableDiscordRpc [ discord-rpc ]; cmakeFlags = [ (lib.cmakeBool "USE_DISCORD_RPC" enableDiscordRpc) diff --git a/pkgs/by-name/mi/microsoft-edge/package.nix b/pkgs/by-name/mi/microsoft-edge/package.nix index afce640ebf11..b3a4c24b5478 100644 --- a/pkgs/by-name/mi/microsoft-edge/package.nix +++ b/pkgs/by-name/mi/microsoft-edge/package.nix @@ -109,72 +109,71 @@ let opusWithCustomModes = libopus.override { withCustomModes = true; }; - deps = - [ - alsa-lib - at-spi2-atk - at-spi2-core - atk - bzip2 - cacert - cairo - coreutils - cups - curl - dbus - expat - flac - fontconfig - freetype - gcc-unwrapped.lib - gdk-pixbuf - glib - harfbuzz - icu - libcap - libdrm - liberation_ttf - libexif - libglvnd - libkrb5 - libpng - libX11 - libxcb - libXcomposite - libXcursor - libXdamage - libXext - libXfixes - libXi - libxkbcommon - libXrandr - libXrender - libXScrnSaver - libxshmfence - libXtst - libgbm - nspr - nss - opusWithCustomModes - pango - pciutils - pipewire - snappy - speechd-minimal - systemd - util-linux - vulkan-loader - wayland - wget - libsecret - libuuid - gtk3 - gtk4 - qt6.qtbase - qt6.qtwayland - ] - ++ lib.optionals pulseSupport [ libpulseaudio ] - ++ lib.optionals libvaSupport [ libva ]; + deps = [ + alsa-lib + at-spi2-atk + at-spi2-core + atk + bzip2 + cacert + cairo + coreutils + cups + curl + dbus + expat + flac + fontconfig + freetype + gcc-unwrapped.lib + gdk-pixbuf + glib + harfbuzz + icu + libcap + libdrm + liberation_ttf + libexif + libglvnd + libkrb5 + libpng + libX11 + libxcb + libXcomposite + libXcursor + libXdamage + libXext + libXfixes + libXi + libxkbcommon + libXrandr + libXrender + libXScrnSaver + libxshmfence + libXtst + libgbm + nspr + nss + opusWithCustomModes + pango + pciutils + pipewire + snappy + speechd-minimal + systemd + util-linux + vulkan-loader + wayland + wget + libsecret + libuuid + gtk3 + gtk4 + qt6.qtbase + qt6.qtwayland + ] + ++ lib.optionals pulseSupport [ libpulseaudio ] + ++ lib.optionals libvaSupport [ libva ]; in stdenvNoCC.mkDerivation (finalAttrs: { diff --git a/pkgs/by-name/mi/midivisualizer/package.nix b/pkgs/by-name/mi/midivisualizer/package.nix index 911d9688d286..d9ff9bf1ec6c 100644 --- a/pkgs/by-name/mi/midivisualizer/package.nix +++ b/pkgs/by-name/mi/midivisualizer/package.nix @@ -31,18 +31,17 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - glfw - ffmpeg-full - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXrandr - libXinerama - libXcursor - gtk3 - ]; + buildInputs = [ + glfw + ffmpeg-full + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXrandr + libXinerama + libXcursor + gtk3 + ]; installPhase = if stdenv.hostPlatform.isDarwin then diff --git a/pkgs/by-name/mi/miktex/package.nix b/pkgs/by-name/mi/miktex/package.nix index 05ebf8c1c2cc..a4167bf79a6d 100644 --- a/pkgs/by-name/mi/miktex/package.nix +++ b/pkgs/by-name/mi/miktex/package.nix @@ -114,36 +114,35 @@ stdenv.mkDerivation (finalAttrs: { ./find-exectables-in-path.patch ]; - postPatch = - '' - # dont symlink fontconfig to /etc/fonts/conf.d - substituteInPlace Programs/MiKTeX/miktex/topics/fontmaps/commands/FontMapManager.cpp \ - --replace-fail 'this->ctx->session->IsAdminMode()' 'false' + postPatch = '' + # dont symlink fontconfig to /etc/fonts/conf.d + substituteInPlace Programs/MiKTeX/miktex/topics/fontmaps/commands/FontMapManager.cpp \ + --replace-fail 'this->ctx->session->IsAdminMode()' 'false' - substituteInPlace \ - Libraries/MiKTeX/App/app.cpp \ - Programs/Editors/TeXworks/miktex/miktex-texworks.cpp \ - Programs/MiKTeX/Console/Qt/main.cpp \ - Programs/MiKTeX/PackageManager/mpm/mpm.cpp \ - Programs/MiKTeX/Yap/MFC/StdAfx.h \ - Programs/MiKTeX/initexmf/initexmf.cpp \ - Programs/MiKTeX/miktex/miktex.cpp \ - --replace-fail "log4cxx/rollingfileappender.h" "log4cxx/rolling/rollingfileappender.h" + substituteInPlace \ + Libraries/MiKTeX/App/app.cpp \ + Programs/Editors/TeXworks/miktex/miktex-texworks.cpp \ + Programs/MiKTeX/Console/Qt/main.cpp \ + Programs/MiKTeX/PackageManager/mpm/mpm.cpp \ + Programs/MiKTeX/Yap/MFC/StdAfx.h \ + Programs/MiKTeX/initexmf/initexmf.cpp \ + Programs/MiKTeX/miktex/miktex.cpp \ + --replace-fail "log4cxx/rollingfileappender.h" "log4cxx/rolling/rollingfileappender.h" - substitute cmake/modules/FindPOPPLER_QT5.cmake \ - cmake/modules/FindPOPPLER_QT6.cmake \ - --replace-fail "QT5" "QT6" \ - --replace-fail "qt5" "qt6" + substitute cmake/modules/FindPOPPLER_QT5.cmake \ + cmake/modules/FindPOPPLER_QT6.cmake \ + --replace-fail "QT5" "QT6" \ + --replace-fail "qt5" "qt6" - substituteInPlace Programs/TeXAndFriends/omega/otps/source/outocp.c \ - --replace-fail 'fprintf(stderr, s);' 'fprintf(stderr, "%s", s);' - '' - # This patch fixes mismatch char types (signed int and unsigned int) on aarch64-linux platform. - # Should not be applied to other platforms otherwise the build will fail. - + lib.optionalString (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) '' - sed -i 's/--using-namespace=MiKTeX::TeXAndFriends/& --chars-are-unsigned/g' \ - Programs/TeXAndFriends/Knuth/web/CMakeLists.txt - ''; + substituteInPlace Programs/TeXAndFriends/omega/otps/source/outocp.c \ + --replace-fail 'fprintf(stderr, s);' 'fprintf(stderr, "%s", s);' + '' + # This patch fixes mismatch char types (signed int and unsigned int) on aarch64-linux platform. + # Should not be applied to other platforms otherwise the build will fail. + + lib.optionalString (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) '' + sed -i 's/--using-namespace=MiKTeX::TeXAndFriends/& --chars-are-unsigned/g' \ + Programs/TeXAndFriends/Knuth/web/CMakeLists.txt + ''; strictDeps = true; @@ -218,16 +217,15 @@ stdenv.mkDerivation (finalAttrs: { # Todo: figure out the exact binary to be Qt wrapped. dontWrapQtApps = true; - postFixup = - '' - wrapQtApp $out/bin/miktex-console - wrapQtApp $out/bin/miktex-texworks - $out/bin/miktexsetup finish --verbose - '' - # Biber binary is missing on ctan.org for aarch64-linux platform. - + lib.optionalString (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) '' - ln -sf ${biber}/bin/biber $out/bin/biber - ''; + postFixup = '' + wrapQtApp $out/bin/miktex-console + wrapQtApp $out/bin/miktex-texworks + $out/bin/miktexsetup finish --verbose + '' + # Biber binary is missing on ctan.org for aarch64-linux platform. + + lib.optionalString (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) '' + ln -sf ${biber}/bin/biber $out/bin/biber + ''; meta = { description = "Modern TeX distribution"; diff --git a/pkgs/by-name/mi/milkytracker/package.nix b/pkgs/by-name/mi/milkytracker/package.nix index 480415bcb57c..79984316f1dc 100644 --- a/pkgs/by-name/mi/milkytracker/package.nix +++ b/pkgs/by-name/mi/milkytracker/package.nix @@ -34,18 +34,17 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - lhasa - libjack2 - rtmidi - SDL2 - zlib - zziplib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ]; + buildInputs = [ + lhasa + libjack2 + rtmidi + SDL2 + zlib + zziplib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ]; postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' install -Dm644 $src/resources/milkytracker.desktop $out/share/applications/milkytracker.desktop diff --git a/pkgs/by-name/mi/mim-solvers/package.nix b/pkgs/by-name/mi/mim-solvers/package.nix index 31ec43338ec0..9df420c765d9 100644 --- a/pkgs/by-name/mi/mim-solvers/package.nix +++ b/pkgs/by-name/mi/mim-solvers/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook; + ] + ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook; buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; propagatedBuildInputs = lib.optionals pythonSupport [ @@ -46,17 +47,16 @@ stdenv.mkDerivation (finalAttrs: { proxsuite ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) - (lib.cmakeBool "BUILD_WITH_PROXSUITE" true) - ] - ++ lib.optional (stdenv.hostPlatform.isDarwin) ( - lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'py-test-clqr-osqp'" - ) - ++ lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) ( - lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'test_solvers'" - ); + cmakeFlags = [ + (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) + (lib.cmakeBool "BUILD_WITH_PROXSUITE" true) + ] + ++ lib.optional (stdenv.hostPlatform.isDarwin) ( + lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'py-test-clqr-osqp'" + ) + ++ lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) ( + lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'test_solvers'" + ); doCheck = true; pythonImportsCheck = [ "mim_solvers" ]; diff --git a/pkgs/by-name/mi/mimalloc/package.nix b/pkgs/by-name/mi/mimalloc/package.nix index ba6f34718d5d..fc3e135cf813 100644 --- a/pkgs/by-name/mi/mimalloc/package.nix +++ b/pkgs/by-name/mi/mimalloc/package.nix @@ -34,11 +34,12 @@ stdenv.mkDerivation rec { cmake ninja ]; - cmakeFlags = - [ "-DMI_INSTALL_TOPLEVEL=ON" ] - ++ lib.optionals secureBuild [ "-DMI_SECURE=ON" ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ "-DMI_BUILD_SHARED=OFF" ] - ++ lib.optionals (!doCheck) [ "-DMI_BUILD_TESTS=OFF" ]; + cmakeFlags = [ + "-DMI_INSTALL_TOPLEVEL=ON" + ] + ++ lib.optionals secureBuild [ "-DMI_SECURE=ON" ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ "-DMI_BUILD_SHARED=OFF" ] + ++ lib.optionals (!doCheck) [ "-DMI_BUILD_TESTS=OFF" ]; postInstall = let diff --git a/pkgs/by-name/mi/mimetic/package.nix b/pkgs/by-name/mi/mimetic/package.nix index 38a843b809e5..9a8f60d94b8e 100644 --- a/pkgs/by-name/mi/mimetic/package.nix +++ b/pkgs/by-name/mi/mimetic/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { url = "https://github.com/tat/mimetic/commit/bf84940f9021950c80846e6b1a5f8b0b55991b00.patch"; sha256 = "sha256-1JW9zPg67BgNsdIjK/jp9j7QMg50eRMz5FsDsbbzBlI="; }) - ] ++ lib.optional stdenv.hostPlatform.isAarch64 ./narrowing.patch; + ] + ++ lib.optional stdenv.hostPlatform.isAarch64 ./narrowing.patch; meta = with lib; { description = "MIME handling library"; diff --git a/pkgs/by-name/mi/mimic/package.nix b/pkgs/by-name/mi/mimic/package.nix index 70a9b0e33a83..9d8a9436696c 100644 --- a/pkgs/by-name/mi/mimic/package.nix +++ b/pkgs/by-name/mi/mimic/package.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation rec { libtool icu pcre2 - ] ++ lib.optional pulseaudioSupport libpulseaudio; + ] + ++ lib.optional pulseaudioSupport libpulseaudio; env.NIX_CFLAGS_COMPILE = toString [ # Needed with GCC 12 diff --git a/pkgs/by-name/mi/mimir/package.nix b/pkgs/by-name/mi/mimir/package.nix index 3ab197888b85..166629bfcde7 100644 --- a/pkgs/by-name/mi/mimir/package.nix +++ b/pkgs/by-name/mi/mimir/package.nix @@ -18,21 +18,20 @@ buildGoModule rec { vendorHash = null; - subPackages = - [ - "cmd/mimir" - "cmd/mimirtool" - ] - ++ (map (pathName: "tools/${pathName}") [ - "compaction-planner" - "copyblocks" - "copyprefix" - "delete-objects" - "list-deduplicated-blocks" - "listblocks" - "mark-blocks" - "undelete-blocks" - ]); + subPackages = [ + "cmd/mimir" + "cmd/mimirtool" + ] + ++ (map (pathName: "tools/${pathName}") [ + "compaction-planner" + "copyblocks" + "copyprefix" + "delete-objects" + "list-deduplicated-blocks" + "listblocks" + "mark-blocks" + "undelete-blocks" + ]); passthru = { updateScript = nix-update-script { diff --git a/pkgs/by-name/mi/mindustry/package.nix b/pkgs/by-name/mi/mindustry/package.nix index 50c781bc3321..410e475f0509 100644 --- a/pkgs/by-name/mi/mindustry/package.nix +++ b/pkgs/by-name/mi/mindustry/package.nix @@ -131,25 +131,24 @@ stdenv.mkDerivation { }) ]; - postPatch = - '' - # Ensure the prebuilt shared objects don't accidentally get shipped - rm -r Arc/natives/natives-*/libs/* - rm -r Arc/backends/backend-*/libs/* + postPatch = '' + # Ensure the prebuilt shared objects don't accidentally get shipped + rm -r Arc/natives/natives-*/libs/* + rm -r Arc/backends/backend-*/libs/* - cd Mindustry + cd Mindustry - # Remove unbuildable iOS stuff - sed -i '/^project(":ios"){/,/^}/d' build.gradle - sed -i '/robo(vm|VM)/d' build.gradle - rm ios/build.gradle - '' - + lib.optionalString (!stdenv.hostPlatform.isx86) '' - substituteInPlace ../Arc/arc-core/build.gradle \ - --replace-fail "-msse" "" - substituteInPlace ../Arc/backends/backend-sdl/build.gradle \ - --replace-fail "-m64" "" - ''; + # Remove unbuildable iOS stuff + sed -i '/^project(":ios"){/,/^}/d' build.gradle + sed -i '/robo(vm|VM)/d' build.gradle + rm ios/build.gradle + '' + + lib.optionalString (!stdenv.hostPlatform.isx86) '' + substituteInPlace ../Arc/arc-core/build.gradle \ + --replace-fail "-msse" "" + substituteInPlace ../Arc/backends/backend-sdl/build.gradle \ + --replace-fail "-m64" "" + ''; mitmCache = gradle.fetchDeps { inherit pname; @@ -163,19 +162,18 @@ stdenv.mkDerivation { alsa-lib glew ]; - nativeBuildInputs = - [ - pkg-config - gradle - makeWrapper - jdk - ] - ++ lib.optionals enableClient [ - ant - copyDesktopItems - curl - wget - ]; + nativeBuildInputs = [ + pkg-config + gradle + makeWrapper + jdk + ] + ++ lib.optionals enableClient [ + ant + copyDesktopItems + curl + wget + ]; desktopItems = lib.optional enableClient desktopItem; @@ -184,32 +182,31 @@ stdenv.mkDerivation { "-Dorg.gradle.java.home=${jdk}" ]; - buildPhase = - '' - runHook preBuild - '' - + lib.optionalString enableServer '' - gradle server:dist - '' - + lib.optionalString enableClient '' - pushd ../Arc - gradle jnigenBuild - gradle jnigenJarNativesDesktop - glewlib=${lib.getLib glew}/lib/libGLEW.so - sdllib=${lib.getLib SDL2}/lib/libSDL2.so - patchelf backends/backend-sdl/libs/linux64/libsdl-arc*.so \ - --add-needed $glewlib \ - --add-needed $sdllib - # Put the freshly-built libraries where the pre-built libraries used to be: - cp arc-core/libs/*/* natives/natives-desktop/libs/ - cp extensions/freetype/libs/*/* natives/natives-freetype-desktop/libs/ - popd + buildPhase = '' + runHook preBuild + '' + + lib.optionalString enableServer '' + gradle server:dist + '' + + lib.optionalString enableClient '' + pushd ../Arc + gradle jnigenBuild + gradle jnigenJarNativesDesktop + glewlib=${lib.getLib glew}/lib/libGLEW.so + sdllib=${lib.getLib SDL2}/lib/libSDL2.so + patchelf backends/backend-sdl/libs/linux64/libsdl-arc*.so \ + --add-needed $glewlib \ + --add-needed $sdllib + # Put the freshly-built libraries where the pre-built libraries used to be: + cp arc-core/libs/*/* natives/natives-desktop/libs/ + cp extensions/freetype/libs/*/* natives/natives-freetype-desktop/libs/ + popd - gradle desktop:dist - '' - + '' - runHook postBuild - ''; + gradle desktop:dist + '' + + '' + runHook postBuild + ''; installPhase = let diff --git a/pkgs/by-name/mi/minicom/package.nix b/pkgs/by-name/mi/minicom/package.nix index c6358136efd4..4eaa1a74b42d 100644 --- a/pkgs/by-name/mi/minicom/package.nix +++ b/pkgs/by-name/mi/minicom/package.nix @@ -22,11 +22,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-wC6VlMRwuhV1zQ26wNx7gijuze8E2CvnzpqOSIPzq2s="; }; - buildInputs = - [ ncurses ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; nativeBuildInputs = [ autoreconfHook diff --git a/pkgs/by-name/mi/minikube/package.nix b/pkgs/by-name/mi/minikube/package.nix index 8b6369696010..9d5b6a8b4466 100644 --- a/pkgs/by-name/mi/minikube/package.nix +++ b/pkgs/by-name/mi/minikube/package.nix @@ -27,23 +27,22 @@ buildGoModule rec { rev = "v${version}"; sha256 = "sha256-We5EyEWvrQ/k27920kE1XMijQWSYvLle7N3KUOsTfbc="; }; - postPatch = - '' - substituteInPlace Makefile \ - --replace-fail "export GOTOOLCHAIN := go\$(GO_VERSION)" "export GOTOOLCHAIN := local" - '' - + (lib.optionalString (withQemu && stdenv.hostPlatform.isDarwin) '' - substituteInPlace \ - pkg/minikube/registry/drvs/qemu2/qemu2.go \ - --replace "/usr/local/opt/qemu/share/qemu" "${qemu}/share/qemu" \ - --replace "/opt/homebrew/opt/qemu/share/qemu" "${qemu}/share/qemu" - '') - + (lib.optionalString (withQemu && stdenv.hostPlatform.isLinux) '' - substituteInPlace \ - pkg/minikube/registry/drvs/qemu2/qemu2.go \ - --replace "/usr/share/OVMF/OVMF_CODE.fd" "${OVMF.firmware}" \ - --replace "/usr/share/AAVMF/AAVMF_CODE.fd" "${OVMF.firmware}" - ''); + postPatch = '' + substituteInPlace Makefile \ + --replace-fail "export GOTOOLCHAIN := go\$(GO_VERSION)" "export GOTOOLCHAIN := local" + '' + + (lib.optionalString (withQemu && stdenv.hostPlatform.isDarwin) '' + substituteInPlace \ + pkg/minikube/registry/drvs/qemu2/qemu2.go \ + --replace "/usr/local/opt/qemu/share/qemu" "${qemu}/share/qemu" \ + --replace "/opt/homebrew/opt/qemu/share/qemu" "${qemu}/share/qemu" + '') + + (lib.optionalString (withQemu && stdenv.hostPlatform.isLinux) '' + substituteInPlace \ + pkg/minikube/registry/drvs/qemu2/qemu2.go \ + --replace "/usr/share/OVMF/OVMF_CODE.fd" "${OVMF.firmware}" \ + --replace "/usr/share/AAVMF/AAVMF_CODE.fd" "${OVMF.firmware}" + ''); nativeBuildInputs = [ installShellFiles diff --git a/pkgs/by-name/mi/minimacy/package.nix b/pkgs/by-name/mi/minimacy/package.nix index a05df86a88be..aa53e55a9635 100644 --- a/pkgs/by-name/mi/minimacy/package.nix +++ b/pkgs/by-name/mi/minimacy/package.nix @@ -23,16 +23,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeBinaryWrapper ]; - buildInputs = - [ - libGL - libGLU - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libX11 - libXext - ]; + buildInputs = [ + libGL + libGLU + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libX11 + libXext + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/mi/minizip-ng/package.nix b/pkgs/by-name/mi/minizip-ng/package.nix index 21643bc581b2..9f4afd5d87a7 100644 --- a/pkgs/by-name/mi/minizip-ng/package.nix +++ b/pkgs/by-name/mi/minizip-ng/package.nix @@ -35,18 +35,17 @@ stdenv.mkDerivation (finalAttrs: { openssl ]; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" - "-DMZ_OPENSSL=ON" - "-DMZ_BUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" - "-DMZ_BUILD_UNIT_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" - "-DMZ_LIB_SUFFIX='-ng'" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # missing header file - "-DMZ_LIBCOMP=OFF" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" + "-DMZ_OPENSSL=ON" + "-DMZ_BUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" + "-DMZ_BUILD_UNIT_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" + "-DMZ_LIB_SUFFIX='-ng'" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # missing header file + "-DMZ_LIBCOMP=OFF" + ]; NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-register"; diff --git a/pkgs/by-name/mi/miracle-wm/package.nix b/pkgs/by-name/mi/miracle-wm/package.nix index 446642a285e9..75e68d82f983 100644 --- a/pkgs/by-name/mi/miracle-wm/package.nix +++ b/pkgs/by-name/mi/miracle-wm/package.nix @@ -39,17 +39,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-1AZLxD/VyBt60ZHXVN/OpKNigN9NdEBJ9svOOVI0JCI="; }; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'DESTINATION /usr/lib' 'DESTINATION ''${CMAKE_INSTALL_LIBDIR}' \ - --replace-fail '-march=native' '# -march=native' \ - --replace-fail '-flto' '# -flto' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'add_subdirectory(tests/)' "" - ''; + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'DESTINATION /usr/lib' 'DESTINATION ''${CMAKE_INSTALL_LIBDIR}' \ + --replace-fail '-march=native' '# -march=native' \ + --replace-fail '-flto' '# -flto' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(tests/)' "" + ''; strictDeps = true; diff --git a/pkgs/by-name/mi/miraclecast/package.nix b/pkgs/by-name/mi/miraclecast/package.nix index 681a38624963..c255ae5ed211 100644 --- a/pkgs/by-name/mi/miraclecast/package.nix +++ b/pkgs/by-name/mi/miraclecast/package.nix @@ -57,14 +57,13 @@ stdenv.mkDerivation { wpa_supplicant ]; - mesonFlags = - [ - "-Dbuild-tests=true" - "-Dip-binary=${iproute2}/bin/ip" - ] - ++ lib.optionals relyUdev [ - "-Drely-udev=true" - ]; + mesonFlags = [ + "-Dbuild-tests=true" + "-Dip-binary=${iproute2}/bin/ip" + ] + ++ lib.optionals relyUdev [ + "-Drely-udev=true" + ]; postPatch = '' substituteInPlace res/miracle-gst \ diff --git a/pkgs/by-name/mi/mirakurun/package.nix b/pkgs/by-name/mi/mirakurun/package.nix index 0ae8bc87856c..3f12eeaa77bc 100644 --- a/pkgs/by-name/mi/mirakurun/package.nix +++ b/pkgs/by-name/mi/mirakurun/package.nix @@ -45,7 +45,8 @@ buildNpmPackage rec { bash nodejs which - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ v4l-utils ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ v4l-utils ]; crc32Patch = replaceVars ./fix-musl-detection.patch { isMusl = if stdenv.hostPlatform.isMusl then "true" else "false"; }; diff --git a/pkgs/by-name/mi/mise/package.nix b/pkgs/by-name/mi/mise/package.nix index 092a5a93820d..9ee020908ef9 100644 --- a/pkgs/by-name/mi/mise/package.nix +++ b/pkgs/by-name/mi/mise/package.nix @@ -63,16 +63,15 @@ rustPlatform.buildRustPackage rec { nativeCheckInputs = [ cacert ]; - checkFlags = - [ - # last_modified will always be different in nix - "--skip=tera::tests::test_last_modified" - ] - ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-darwin") [ - # started failing mid-April 2025 - "--skip=task::task_file_providers::remote_task_http::tests::test_http_remote_task_get_local_path_with_cache" - "--skip=task::task_file_providers::remote_task_http::tests::test_http_remote_task_get_local_path_without_cache" - ]; + checkFlags = [ + # last_modified will always be different in nix + "--skip=tera::tests::test_last_modified" + ] + ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-darwin") [ + # started failing mid-April 2025 + "--skip=task::task_file_providers::remote_task_http::tests::test_http_remote_task_get_local_path_with_cache" + "--skip=task::task_file_providers::remote_task_http::tests::test_http_remote_task_get_local_path_without_cache" + ]; cargoTestFlags = [ "--all-features" ]; # some tests access the same folders, don't test in parallel to avoid race conditions diff --git a/pkgs/by-name/mi/misskey/package.nix b/pkgs/by-name/mi/misskey/package.nix index 8f96f1353067..1fdff9d1b014 100644 --- a/pkgs/by-name/mi/misskey/package.nix +++ b/pkgs/by-name/mi/misskey/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation (finalAttrs: { pnpm_9.configHook makeWrapper python3 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; # https://nixos.org/manual/nixpkgs/unstable/#javascript-pnpm pnpmDeps = pnpm_9.fetchDeps { diff --git a/pkgs/by-name/mi/mistral-rs/package.nix b/pkgs/by-name/mi/mistral-rs/package.nix index a3c22e807014..c300e0964d51 100644 --- a/pkgs/by-name/mi/mistral-rs/package.nix +++ b/pkgs/by-name/mi/mistral-rs/package.nix @@ -90,66 +90,63 @@ rustPlatform.buildRustPackage (finalAttrs: { useFetchCargoVendor = true; cargoHash = "sha256-YGGtS8gJJQKIgXxMWjO05ikSVdfVNs+cORbJ+Wf88y4="; - nativeBuildInputs = - [ - pkg-config - python3 - ] - ++ lib.optionals cudaSupport [ - # WARNING: autoAddDriverRunpath must run AFTER autoPatchelfHook - # Otherwise, autoPatchelfHook removes driverLink from RUNPATH - autoPatchelfHook - autoAddDriverRunpath + nativeBuildInputs = [ + pkg-config + python3 + ] + ++ lib.optionals cudaSupport [ + # WARNING: autoAddDriverRunpath must run AFTER autoPatchelfHook + # Otherwise, autoPatchelfHook removes driverLink from RUNPATH + autoPatchelfHook + autoAddDriverRunpath - cudaPackages.cuda_nvcc - ]; + cudaPackages.cuda_nvcc + ]; - buildInputs = - [ - oniguruma - openssl - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cccl - cudaPackages.cuda_cudart - cudaPackages.cuda_nvrtc - cudaPackages.libcublas - cudaPackages.libcurand - ] - ++ lib.optionals mklSupport [ mkl ]; + buildInputs = [ + oniguruma + openssl + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cccl + cudaPackages.cuda_cudart + cudaPackages.cuda_nvrtc + cudaPackages.libcublas + cudaPackages.libcurand + ] + ++ lib.optionals mklSupport [ mkl ]; buildFeatures = lib.optionals cudaSupport [ "cuda" ] ++ lib.optionals mklSupport [ "mkl" ] ++ lib.optionals (hostPlatform.isDarwin && metalSupport) [ "metal" ]; - env = - { - SWAGGER_UI_DOWNLOAD_URL = - let - # When updating: - # - Look for the version of `utoipa-swagger-ui` at: - # https://github.com/EricLBuehler/mistral.rs/blob/v/mistralrs-server/Cargo.toml - # - Look at the corresponding version of `swagger-ui` at: - # https://github.com/juhaku/utoipa/blob/utoipa-swagger-ui-/utoipa-swagger-ui/build.rs#L21-L22 - swaggerUiVersion = "5.17.12"; + env = { + SWAGGER_UI_DOWNLOAD_URL = + let + # When updating: + # - Look for the version of `utoipa-swagger-ui` at: + # https://github.com/EricLBuehler/mistral.rs/blob/v/mistralrs-server/Cargo.toml + # - Look at the corresponding version of `swagger-ui` at: + # https://github.com/juhaku/utoipa/blob/utoipa-swagger-ui-/utoipa-swagger-ui/build.rs#L21-L22 + swaggerUiVersion = "5.17.12"; - swaggerUi = fetchurl { - url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${swaggerUiVersion}.zip"; - hash = "sha256-HK4z/JI+1yq8BTBJveYXv9bpN/sXru7bn/8g5mf2B/I="; - }; - in - "file://${swaggerUi}"; + swaggerUi = fetchurl { + url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${swaggerUiVersion}.zip"; + hash = "sha256-HK4z/JI+1yq8BTBJveYXv9bpN/sXru7bn/8g5mf2B/I="; + }; + in + "file://${swaggerUi}"; - RUSTONIG_SYSTEM_LIBONIG = true; - } - // (lib.optionalAttrs cudaSupport { - CUDA_COMPUTE_CAP = cudaCapability'; + RUSTONIG_SYSTEM_LIBONIG = true; + } + // (lib.optionalAttrs cudaSupport { + CUDA_COMPUTE_CAP = cudaCapability'; - # We already list CUDA dependencies in buildInputs - # We only set CUDA_TOOLKIT_ROOT_DIR to satisfy some redundant checks from upstream - CUDA_TOOLKIT_ROOT_DIR = lib.getDev cudaPackages.cuda_cudart; - }); + # We already list CUDA dependencies in buildInputs + # We only set CUDA_TOOLKIT_ROOT_DIR to satisfy some redundant checks from upstream + CUDA_TOOLKIT_ROOT_DIR = lib.getDev cudaPackages.cuda_cudart; + }); appendRunpaths = lib.optionals cudaSupport [ (lib.makeLibraryPath [ diff --git a/pkgs/by-name/mi/mitm-cache/fetch.nix b/pkgs/by-name/mi/mitm-cache/fetch.nix index fb8798c43bc2..0136fb54f87b 100644 --- a/pkgs/by-name/mi/mitm-cache/fetch.nix +++ b/pkgs/by-name/mi/mitm-cache/fetch.nix @@ -28,36 +28,35 @@ let ) else builtins.replaceStrings [ "://" ] [ "/" ] url; - code = - '' - mkdir -p "$out" - cd "$out" - '' - + builtins.concatStringsSep "" ( - lib.mapAttrsToList ( - url: info: - let - key = builtins.head (builtins.attrNames info); - val = info.${key}; - path = urlToPath url; - name = baseNameOf path; - source = - { - redirect = "$out/${urlToPath val}"; - hash = fetchurl { - inherit url; - hash = val; - }; - text = writeText name val; - } - .${key} or (throw "Unknown key: ${url}"); - in - '' - mkdir -p "${dirOf path}" - ln -s "${source}" "${path}" - '' - ) data' - ); + code = '' + mkdir -p "$out" + cd "$out" + '' + + builtins.concatStringsSep "" ( + lib.mapAttrsToList ( + url: info: + let + key = builtins.head (builtins.attrNames info); + val = info.${key}; + path = urlToPath url; + name = baseNameOf path; + source = + { + redirect = "$out/${urlToPath val}"; + hash = fetchurl { + inherit url; + hash = val; + }; + text = writeText name val; + } + .${key} or (throw "Unknown key: ${url}"); + in + '' + mkdir -p "${dirOf path}" + ln -s "${source}" "${path}" + '' + ) data' + ); in runCommand name ( builtins.removeAttrs attrs [ diff --git a/pkgs/by-name/mj/mjpegtools/package.nix b/pkgs/by-name/mj/mjpegtools/package.nix index 741a06ee88d5..afdc37a8b839 100644 --- a/pkgs/by-name/mj/mjpegtools/package.nix +++ b/pkgs/by-name/mj/mjpegtools/package.nix @@ -40,18 +40,17 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libdv - libjpeg - libpng - ] - ++ lib.optionals (!withMinimal) [ - gtk2 - libX11 - SDL - SDL_gfx - ]; + buildInputs = [ + libdv + libjpeg + libpng + ] + ++ lib.optionals (!withMinimal) [ + gtk2 + libX11 + SDL + SDL_gfx + ]; env.NIX_CFLAGS_COMPILE = lib.optionalString (!withMinimal) "-I${lib.getDev SDL}/include/SDL"; diff --git a/pkgs/by-name/mk/mkcal/package.nix b/pkgs/by-name/mk/mkcal/package.nix index f401fb0135e7..22f115c3a5b7 100644 --- a/pkgs/by-name/mk/mkcal/package.nix +++ b/pkgs/by-name/mk/mkcal/package.nix @@ -41,18 +41,17 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - extra-cmake-modules - doxygen - graphviz - perl - pkg-config - ] - ++ (with libsForQt5; [ - wrapQtAppsHook - ]); + nativeBuildInputs = [ + cmake + extra-cmake-modules + doxygen + graphviz + perl + pkg-config + ] + ++ (with libsForQt5; [ + wrapQtAppsHook + ]); buildInputs = with libsForQt5; [ kcalendarcore diff --git a/pkgs/by-name/mk/mkl/package.nix b/pkgs/by-name/mk/mkl/package.nix index 9f223473c097..bdac3135da31 100644 --- a/pkgs/by-name/mk/mkl/package.nix +++ b/pkgs/by-name/mk/mkl/package.nix @@ -73,17 +73,18 @@ stdenvNoCC.mkDerivation ( sourceRoot = if stdenvNoCC.hostPlatform.isDarwin then "." else null; - nativeBuildInputs = - [ validatePkgConfig ] - ++ ( - if stdenvNoCC.hostPlatform.isDarwin then - [ - _7zz - cctools - ] - else - [ rpmextract ] - ); + nativeBuildInputs = [ + validatePkgConfig + ] + ++ ( + if stdenvNoCC.hostPlatform.isDarwin then + [ + _7zz + cctools + ] + else + [ rpmextract ] + ); buildPhase = if stdenvNoCC.hostPlatform.isDarwin then @@ -104,63 +105,62 @@ stdenvNoCC.mkDerivation ( rpmextract ${oneapi-tbb} ''; - installPhase = - '' - for f in $(find . -name 'mkl*.pc') ; do - bn=$(basename $f) - substituteInPlace $f \ - --replace $\{MKLROOT} "$out" \ - --replace "lib/intel64" "lib" + installPhase = '' + for f in $(find . -name 'mkl*.pc') ; do + bn=$(basename $f) + substituteInPlace $f \ + --replace $\{MKLROOT} "$out" \ + --replace "lib/intel64" "lib" - sed -r -i "s|^prefix=.*|prefix=$out|g" $f - done + sed -r -i "s|^prefix=.*|prefix=$out|g" $f + done - for f in $(find opt/intel -name 'mkl*iomp.pc') ; do - substituteInPlace $f --replace "../compiler/lib" "lib" - done + for f in $(find opt/intel -name 'mkl*iomp.pc') ; do + substituteInPlace $f --replace "../compiler/lib" "lib" + done - # License - install -Dm0655 -t $out/share/doc/mkl opt/intel/oneapi/mkl/${mklVersion}/licensing/license.txt + # License + install -Dm0655 -t $out/share/doc/mkl opt/intel/oneapi/mkl/${mklVersion}/licensing/license.txt - # Dynamic libraries - mkdir -p $out/lib - cp -a opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*${shlibExt}* $out/lib - cp -a opt/intel/oneapi/compiler/${mklVersion}/${ - if stdenvNoCC.hostPlatform.isDarwin then "mac" else "linux" - }/compiler/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64_lin"}/*${shlibExt}* $out/lib - cp -a opt/intel/oneapi/tbb/${tbbVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64/gcc4.8"}/*${shlibExt}* $out/lib + # Dynamic libraries + mkdir -p $out/lib + cp -a opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*${shlibExt}* $out/lib + cp -a opt/intel/oneapi/compiler/${mklVersion}/${ + if stdenvNoCC.hostPlatform.isDarwin then "mac" else "linux" + }/compiler/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64_lin"}/*${shlibExt}* $out/lib + cp -a opt/intel/oneapi/tbb/${tbbVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64/gcc4.8"}/*${shlibExt}* $out/lib - # Headers - cp -r opt/intel/oneapi/mkl/${mklVersion}/include $out/ + # Headers + cp -r opt/intel/oneapi/mkl/${mklVersion}/include $out/ - # CMake config - cp -r opt/intel/oneapi/mkl/${mklVersion}/lib/cmake $out/lib - '' - + ( - if enableStatic then - '' - install -Dm0644 -t $out/lib opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*.a - install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/${mklVersion}/lib/pkgconfig/*.pc - '' - else - '' - cp opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*${shlibExt}* $out/lib - install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/${mklVersion}/lib/pkgconfig/*dynamic*.pc - '' - ) - + '' - # Setup symlinks for blas / lapack - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt} - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt} - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt} - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt} - '' - + lib.optionalString stdenvNoCC.hostPlatform.isLinux '' - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}".3" - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}".3" - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}".3" - ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}".3" - ''; + # CMake config + cp -r opt/intel/oneapi/mkl/${mklVersion}/lib/cmake $out/lib + '' + + ( + if enableStatic then + '' + install -Dm0644 -t $out/lib opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*.a + install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/${mklVersion}/lib/pkgconfig/*.pc + '' + else + '' + cp opt/intel/oneapi/mkl/${mklVersion}/lib/${lib.optionalString stdenvNoCC.hostPlatform.isLinux "intel64"}/*${shlibExt}* $out/lib + install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/${mklVersion}/lib/pkgconfig/*dynamic*.pc + '' + ) + + '' + # Setup symlinks for blas / lapack + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt} + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt} + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt} + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt} + '' + + lib.optionalString stdenvNoCC.hostPlatform.isLinux '' + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}".3" + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}".3" + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}".3" + ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}".3" + ''; # fixDarwinDylibName fails for libmkl_cdft_core.dylib because the # larger updated load commands do not fit. Use install_name_tool diff --git a/pkgs/by-name/mk/mkp224o/package.nix b/pkgs/by-name/mk/mkp224o/package.nix index b6d12752d9ad..b28e7ec71b1f 100644 --- a/pkgs/by-name/mk/mkp224o/package.nix +++ b/pkgs/by-name/mk/mkp224o/package.nix @@ -21,33 +21,32 @@ stdenv.mkDerivation rec { let # compile few variants with different implementation of crypto # the fastest depends on a particular cpu - variants = - [ - { - suffix = "ref10"; - configureFlags = [ "--enable-ref10" ]; - } - { - suffix = "donna"; - configureFlags = [ "--enable-donna" ]; - } - ] - ++ lib.optionals stdenv.hostPlatform.isx86 [ - { - suffix = "donna-sse2"; - configureFlags = [ "--enable-donna-sse2" ]; - } - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - { - suffix = "amd64-51-30k"; - configureFlags = [ "--enable-amd64-51-30k" ]; - } - { - suffix = "amd64-64-24k"; - configureFlags = [ "--enable-amd64-64-24k" ]; - } - ]; + variants = [ + { + suffix = "ref10"; + configureFlags = [ "--enable-ref10" ]; + } + { + suffix = "donna"; + configureFlags = [ "--enable-donna" ]; + } + ] + ++ lib.optionals stdenv.hostPlatform.isx86 [ + { + suffix = "donna-sse2"; + configureFlags = [ "--enable-donna-sse2" ]; + } + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + { + suffix = "amd64-51-30k"; + configureFlags = [ "--enable-amd64-51-30k" ]; + } + { + suffix = "amd64-64-24k"; + configureFlags = [ "--enable-amd64-64-24k" ]; + } + ]; in lib.concatMapStrings ( { suffix, configureFlags }: diff --git a/pkgs/by-name/mk/mktorrent/package.nix b/pkgs/by-name/mk/mktorrent/package.nix index 4edbb1acab46..451989ddf65b 100644 --- a/pkgs/by-name/mk/mktorrent/package.nix +++ b/pkgs/by-name/mk/mktorrent/package.nix @@ -16,14 +16,13 @@ stdenv.mkDerivation rec { sha256 = "17pdc5mandl739f8q26n5is8ga56s83aqcrwhlnnplbxwx2inidr"; }; - makeFlags = - [ - "USE_PTHREADS=1" - "USE_OPENSSL=1" - "USE_LONG_OPTIONS=1" - ] - ++ lib.optional stdenv.hostPlatform.isi686 "USE_LARGE_FILES=1" - ++ lib.optional stdenv.hostPlatform.isLinux "CFLAGS=-lgcc_s"; + makeFlags = [ + "USE_PTHREADS=1" + "USE_OPENSSL=1" + "USE_LONG_OPTIONS=1" + ] + ++ lib.optional stdenv.hostPlatform.isi686 "USE_LARGE_FILES=1" + ++ lib.optional stdenv.hostPlatform.isLinux "CFLAGS=-lgcc_s"; installFlags = [ "PREFIX=${placeholder "out"}" ]; diff --git a/pkgs/by-name/mk/mkvtoolnix/package.nix b/pkgs/by-name/mk/mkvtoolnix/package.nix index 8ee0bb3b28a7..925dc5a5ef59 100644 --- a/pkgs/by-name/mk/mkvtoolnix/package.nix +++ b/pkgs/by-name/mk/mkvtoolnix/package.nix @@ -76,32 +76,32 @@ stdenv.mkDerivation (finalAttrs: { libxslt pkg-config rake - ] ++ optionals withGUI [ qt6.wrapQtAppsHook ]; + ] + ++ optionals withGUI [ qt6.wrapQtAppsHook ]; # qtbase and qtmultimedia are needed without the GUI - buildInputs = - [ - boost - expat - file - flac - fmt - gmp - libdvdread - libebml - libmatroska - libogg - libvorbis - nlohmann_json - pugixml - qt6.qtbase - qt6.qtmultimedia - utf8cpp - xdg-utils - zlib - ] - ++ optionals withGUI [ cmark ] - ++ optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ]; + buildInputs = [ + boost + expat + file + flac + fmt + gmp + libdvdread + libebml + libmatroska + libogg + libvorbis + nlohmann_json + pugixml + qt6.qtbase + qt6.qtmultimedia + utf8cpp + xdg-utils + zlib + ] + ++ optionals withGUI [ cmark ] + ++ optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ]; # autoupdate is not needed but it silences a ton of pointless warnings postPatch = '' diff --git a/pkgs/by-name/ml/mlflow-server/package.nix b/pkgs/by-name/ml/mlflow-server/package.nix index 82ac934dc888..8155f9b5c0c5 100644 --- a/pkgs/by-name/ml/mlflow-server/package.nix +++ b/pkgs/by-name/ml/mlflow-server/package.nix @@ -20,15 +20,13 @@ py.toPythonApplication ( py.mysqlclient ]; - postPatch = - (old.postPatch or "") - + '' - cat mlflow/utils/process.py + postPatch = (old.postPatch or "") + '' + cat mlflow/utils/process.py - substituteInPlace mlflow/utils/process.py --replace-fail \ - "process = subprocess.Popen(" \ - "cmd[0]='${gunicornScript}'; process = subprocess.Popen(" - ''; + substituteInPlace mlflow/utils/process.py --replace-fail \ + "process = subprocess.Popen(" \ + "cmd[0]='${gunicornScript}'; process = subprocess.Popen(" + ''; postInstall = '' gpath=$out/bin/gunicornMlflow diff --git a/pkgs/by-name/ml/mlt/package.nix b/pkgs/by-name/ml/mlt/package.nix index 82cc2dbaf76d..80a4e6dd6222 100644 --- a/pkgs/by-name/ml/mlt/package.nix +++ b/pkgs/by-name/ml/mlt/package.nix @@ -53,78 +53,75 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - nativeBuildInputs = - [ - cmake - pkg-config - which - makeWrapper - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ] - ++ lib.optionals enablePython [ - python3 - swig - ] - ++ lib.optionals (qt != null) [ - qt.wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + which + makeWrapper + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ] + ++ lib.optionals enablePython [ + python3 + swig + ] + ++ lib.optionals (qt != null) [ + qt.wrapQtAppsHook + ]; - buildInputs = - [ - (opencv4.override { inherit ffmpeg; }) - ffmpeg - fftw - frei0r - libdv - libjack2 - libsamplerate - libvorbis - libxml2 - movit - rtaudio - rubberband - sox - vid-stab - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - ] - ++ lib.optionals enableJackrack [ - glib - ladspa-sdk - ladspaPlugins - ] - ++ lib.optionals (qt != null) [ - qt.qtbase - qt.qtsvg - (qt.qt5compat or null) - libarchive - ] - ++ lib.optionals enableSDL2 [ - SDL2 - libX11 - ]; + buildInputs = [ + (opencv4.override { inherit ffmpeg; }) + ffmpeg + fftw + frei0r + libdv + libjack2 + libsamplerate + libvorbis + libxml2 + movit + rtaudio + rubberband + sox + vid-stab + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + ] + ++ lib.optionals enableJackrack [ + glib + ladspa-sdk + ladspaPlugins + ] + ++ lib.optionals (qt != null) [ + qt.qtbase + qt.qtsvg + (qt.qt5compat or null) + libarchive + ] + ++ lib.optionals enableSDL2 [ + SDL2 + libX11 + ]; outputs = [ "out" "dev" ]; - cmakeFlags = - [ - # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/ - "-DCMAKE_SKIP_BUILD_RPATH=ON" - "-DMOD_OPENCV=ON" - ] - ++ lib.optionals enablePython [ - "-DSWIG_PYTHON=ON" - ] - ++ lib.optionals (qt != null) [ - "-DMOD_QT${lib.versions.major qt.qtbase.version}=ON" - "-DMOD_GLAXNIMATE${if lib.versions.major qt.qtbase.version == "5" then "" else "_QT6"}=ON" - ]; + cmakeFlags = [ + # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + "-DMOD_OPENCV=ON" + ] + ++ lib.optionals enablePython [ + "-DSWIG_PYTHON=ON" + ] + ++ lib.optionals (qt != null) [ + "-DMOD_QT${lib.versions.major qt.qtbase.version}=ON" + "-DMOD_GLAXNIMATE${if lib.versions.major qt.qtbase.version == "5" then "" else "_QT6"}=ON" + ]; preFixup = '' wrapProgram $out/bin/melt \ diff --git a/pkgs/by-name/ml/mlterm/package.nix b/pkgs/by-name/ml/mlterm/package.nix index 5e56f2f5b1a4..aad72f74a164 100644 --- a/pkgs/by-name/ml/mlterm/package.nix +++ b/pkgs/by-name/ml/mlterm/package.nix @@ -110,58 +110,56 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-YogapVTmW4HAyVgvhR4ZvW4Q6v0kGiW11CCxN6SpPCY="; }; - nativeBuildInputs = - [ - pkg-config - autoconf - ] - ++ lib.optionals enableTools.mlconfig [ - wrapGAppsHook3 - ]; - buildInputs = - [ - gtk - vte - gdk-pixbuf - ] - ++ lib.optionals enableTypeEngines.xcore [ - libX11 - ] - ++ lib.optionals enableTypeEngines.xft [ - libXft - ] - ++ lib.optionals enableTypeEngines.cairo [ - cairo - ] - ++ lib.optionals enableGuis.wayland [ - libxkbcommon - wayland - ] - ++ lib.optionals enableGuis.sdl2 [ - SDL2 - ] - ++ lib.optionals enableFeatures.otl [ - harfbuzz - ] - ++ lib.optionals enableFeatures.bidi [ - fribidi - ] - ++ lib.optionals enableFeatures.ssh2 [ - libssh2 - ] - ++ lib.optionals enableFeatures.m17n [ - m17n_lib - ] - ++ lib.optionals enableFeatures.fcitx [ - fcitx5 - fcitx5-gtk - ] - ++ lib.optionals enableFeatures.ibus [ - ibus - ] - ++ lib.optionals enableFeatures.uim [ - uim - ]; + nativeBuildInputs = [ + pkg-config + autoconf + ] + ++ lib.optionals enableTools.mlconfig [ + wrapGAppsHook3 + ]; + buildInputs = [ + gtk + vte + gdk-pixbuf + ] + ++ lib.optionals enableTypeEngines.xcore [ + libX11 + ] + ++ lib.optionals enableTypeEngines.xft [ + libXft + ] + ++ lib.optionals enableTypeEngines.cairo [ + cairo + ] + ++ lib.optionals enableGuis.wayland [ + libxkbcommon + wayland + ] + ++ lib.optionals enableGuis.sdl2 [ + SDL2 + ] + ++ lib.optionals enableFeatures.otl [ + harfbuzz + ] + ++ lib.optionals enableFeatures.bidi [ + fribidi + ] + ++ lib.optionals enableFeatures.ssh2 [ + libssh2 + ] + ++ lib.optionals enableFeatures.m17n [ + m17n_lib + ] + ++ lib.optionals enableFeatures.fcitx [ + fcitx5 + fcitx5-gtk + ] + ++ lib.optionals enableFeatures.ibus [ + ibus + ] + ++ lib.optionals enableFeatures.uim [ + uim + ]; #bad configure.ac and Makefile.in everywhere preConfigure = '' @@ -187,33 +185,31 @@ stdenv.mkDerivation (finalAttrs: { NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion -Wno-error=incompatible-function-pointer-types"; }; - configureFlags = - [ - (withFeaturesList "type-engines" enableTypeEngines) - (withFeaturesList "tools" enableTools) - (withFeaturesList "gui" enableGuis) - (lib.withFeature enableX11 "x") - ] - ++ lib.optionals (gtk != null) [ - "--with-gtk=${lib.versions.major gtk.version}.0" - ] - ++ (lib.mapAttrsToList (n: v: lib.enableFeature v n) enableFeatures) - ++ [ - ]; + configureFlags = [ + (withFeaturesList "type-engines" enableTypeEngines) + (withFeaturesList "tools" enableTools) + (withFeaturesList "gui" enableGuis) + (lib.withFeature enableX11 "x") + ] + ++ lib.optionals (gtk != null) [ + "--with-gtk=${lib.versions.major gtk.version}.0" + ] + ++ (lib.mapAttrsToList (n: v: lib.enableFeature v n) enableFeatures) + ++ [ + ]; enableParallelBuilding = true; - postInstall = - '' - install -D contrib/icon/mlterm-icon.svg "$out/share/icons/hicolor/scalable/apps/mlterm.svg" - install -D contrib/icon/mlterm-icon-gnome2.png "$out/share/icons/hicolor/48x48/apps/mlterm.png" - install -D -t $out/share/applications $desktopItem/share/applications/* - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications/ - cp -a cocoa/mlterm.app $out/Applications/ - install $out/bin/mlterm -Dt $out/Applications/mlterm.app/Contents/MacOS/ - ''; + postInstall = '' + install -D contrib/icon/mlterm-icon.svg "$out/share/icons/hicolor/scalable/apps/mlterm.svg" + install -D contrib/icon/mlterm-icon-gnome2.png "$out/share/icons/hicolor/48x48/apps/mlterm.png" + install -D -t $out/share/applications $desktopItem/share/applications/* + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications/ + cp -a cocoa/mlterm.app $out/Applications/ + install $out/bin/mlterm -Dt $out/Applications/mlterm.app/Contents/MacOS/ + ''; desktopItem = makeDesktopItem { name = "mlterm"; diff --git a/pkgs/by-name/ml/mlx42/package.nix b/pkgs/by-name/ml/mlx42/package.nix index 387a7966b871..6fa29dbe4161 100644 --- a/pkgs/by-name/ml/mlx42/package.nix +++ b/pkgs/by-name/ml/mlx42/package.nix @@ -30,14 +30,13 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = - '' - patchShebangs --build ./tools - '' - + lib.optionalString enableShared '' - substituteInPlace CMakeLists.txt \ - --replace-fail "mlx42 STATIC" "mlx42 SHARED" - ''; + postPatch = '' + patchShebangs --build ./tools + '' + + lib.optionalString enableShared '' + substituteInPlace CMakeLists.txt \ + --replace-fail "mlx42 STATIC" "mlx42 SHARED" + ''; strictDeps = true; diff --git a/pkgs/by-name/mm/mmex/package.nix b/pkgs/by-name/mm/mmex/package.nix index 449ea009b429..66e754624784 100644 --- a/pkgs/by-name/mm/mmex/package.nix +++ b/pkgs/by-name/mm/mmex/package.nix @@ -35,20 +35,19 @@ stdenv.mkDerivation rec { --replace-fail "sqlite3mc_amalgamation.h" "sqlite3.h" ''; - nativeBuildInputs = - [ - appstream # for appstreamcli - cmake - gettext - git - makeWrapper - pkg-config - wrapGAppsHook3 - wxGTK32 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - lsb-release - ]; + nativeBuildInputs = [ + appstream # for appstreamcli + cmake + gettext + git + makeWrapper + pkg-config + wrapGAppsHook3 + wxGTK32 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + lsb-release + ]; buildInputs = [ curl diff --git a/pkgs/by-name/mm/mmseqs2/package.nix b/pkgs/by-name/mm/mmseqs2/package.nix index e4e558124f97..c5448a47c0f7 100644 --- a/pkgs/by-name/mm/mmseqs2/package.nix +++ b/pkgs/by-name/mm/mmseqs2/package.nix @@ -35,30 +35,28 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-nmvFoW+Ey18NcM2w14Ak/3D/Kic52Vka/RxvBd0YoKI="; }; - nativeBuildInputs = - [ - cmake - xxd - perl - installShellFiles - zstd - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + cmake + xxd + perl + installShellFiles + zstd + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; - cmakeFlags = - [ - (lib.cmakeBool "HAVE_AVX2" enableAvx2) - (lib.cmakeBool "HAVE_SSE4_1" enableSse4_1) - (lib.cmakeBool "HAVE_MPI" enableMpi) - (lib.cmakeBool "USE_SYSTEM_ZSTD" true) - (lib.cmakeBool "HAVE_ARM8" stdenv.hostPlatform.isAarch64) - ] - ++ lib.optionals cudaSupport [ - (lib.cmakeBool "ENABLE_CUDA" true) - (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) - ]; + cmakeFlags = [ + (lib.cmakeBool "HAVE_AVX2" enableAvx2) + (lib.cmakeBool "HAVE_SSE4_1" enableSse4_1) + (lib.cmakeBool "HAVE_MPI" enableMpi) + (lib.cmakeBool "USE_SYSTEM_ZSTD" true) + (lib.cmakeBool "HAVE_ARM8" stdenv.hostPlatform.isAarch64) + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeBool "ENABLE_CUDA" true) + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) + ]; buildInputs = lib.optionals stdenv.cc.isClang [ diff --git a/pkgs/by-name/mo/moc/package.nix b/pkgs/by-name/mo/moc/package.nix index 08d71f5b1684..ee093e43eb4c 100644 --- a/pkgs/by-name/mo/moc/package.nix +++ b/pkgs/by-name/mo/moc/package.nix @@ -79,7 +79,8 @@ stdenv.mkDerivation { }) ./use-ax-check-compile-flag.patch - ] ++ lib.optional pulseSupport ./pulseaudio.patch; + ] + ++ lib.optional pulseSupport ./pulseaudio.patch; postPatch = '' rm m4/* @@ -91,40 +92,39 @@ stdenv.mkDerivation { autoconf-archive ]; - buildInputs = - [ - ncurses - db - popt - libtool - ] - # Sound sub-systems - ++ lib.optional alsaSupport alsa-lib - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional jackSupport libjack2 - # Audio formats - ++ lib.optional (aacSupport || mp3Support) libid3tag - ++ lib.optional aacSupport faad2 - ++ lib.optional flacSupport flac - ++ lib.optional midiSupport timidity - ++ lib.optional modplugSupport libmodplug - ++ lib.optional mp3Support libmad - ++ lib.optionals musepackSupport [ - libmpc - libmpcdec - taglib - ] - ++ lib.optional vorbisSupport libvorbis - ++ lib.optional speexSupport speex - ++ lib.optional ffmpegSupport ffmpeg - ++ lib.optional sndfileSupport libsndfile - ++ lib.optional wavpackSupport wavpack - # Misc - ++ lib.optional curlSupport curl - ++ lib.optional samplerateSupport libsamplerate - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + ncurses + db + popt + libtool + ] + # Sound sub-systems + ++ lib.optional alsaSupport alsa-lib + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional jackSupport libjack2 + # Audio formats + ++ lib.optional (aacSupport || mp3Support) libid3tag + ++ lib.optional aacSupport faad2 + ++ lib.optional flacSupport flac + ++ lib.optional midiSupport timidity + ++ lib.optional modplugSupport libmodplug + ++ lib.optional mp3Support libmad + ++ lib.optionals musepackSupport [ + libmpc + libmpcdec + taglib + ] + ++ lib.optional vorbisSupport libvorbis + ++ lib.optional speexSupport speex + ++ lib.optional ffmpegSupport ffmpeg + ++ lib.optional sndfileSupport libsndfile + ++ lib.optional wavpackSupport wavpack + # Misc + ++ lib.optional curlSupport curl + ++ lib.optional samplerateSupport libsamplerate + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; configureFlags = [ # Sound sub-systems diff --git a/pkgs/by-name/mo/modemmanager/package.nix b/pkgs/by-name/mo/modemmanager/package.nix index 17a26744666c..54050cf7b296 100644 --- a/pkgs/by-name/mo/modemmanager/package.nix +++ b/pkgs/by-name/mo/modemmanager/package.nix @@ -56,39 +56,37 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - gettext - glib - pkg-config - libxslt - python3 - udevCheckHook - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala - ]; + nativeBuildInputs = [ + meson + ninja + gettext + glib + pkg-config + libxslt + python3 + udevCheckHook + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala + ]; - buildInputs = - [ - glib - libgudev - ppp - libmbim - libqmi - bash-completion - dbus - bash # shebangs in share/ModemManager/fcc-unlock.available.d/ - ] - ++ lib.optionals withPolkit [ - polkit - ] - ++ lib.optionals withSystemd [ - systemd - ]; + buildInputs = [ + glib + libgudev + ppp + libmbim + libqmi + bash-completion + dbus + bash # shebangs in share/ModemManager/fcc-unlock.available.d/ + ] + ++ lib.optionals withPolkit [ + polkit + ] + ++ lib.optionals withSystemd [ + systemd + ]; nativeInstallCheckInputs = [ python3 diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix index 5f7a5f0cb9c9..42224a081cec 100644 --- a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix +++ b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix @@ -47,7 +47,8 @@ rustPlatform.buildRustPackage (finalAttrs: { nodejs pkg-config pnpm.configHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin makeBinaryWrapper; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin makeBinaryWrapper; buildInputs = [ openssl ] ++ lib.optional stdenv.hostPlatform.isLinux webkitgtk_4_1; diff --git a/pkgs/by-name/mo/mods/package.nix b/pkgs/by-name/mo/mods/package.nix index 81249486e604..5a59b215537d 100644 --- a/pkgs/by-name/mo/mods/package.nix +++ b/pkgs/by-name/mo/mods/package.nix @@ -49,20 +49,19 @@ buildGoModule (finalAttrs: { }; }; - postInstall = - '' - export HOME=$(mktemp -d) - '' - + lib.optionalString installManPages '' - $out/bin/mods man > ./mods.1 - installManPage ./mods.1 - '' - + lib.optionalString installShellCompletions '' - installShellCompletion --cmd mods \ - --bash <($out/bin/mods completion bash) \ - --fish <($out/bin/mods completion fish) \ - --zsh <($out/bin/mods completion zsh) - ''; + postInstall = '' + export HOME=$(mktemp -d) + '' + + lib.optionalString installManPages '' + $out/bin/mods man > ./mods.1 + installManPage ./mods.1 + '' + + lib.optionalString installShellCompletions '' + installShellCompletion --cmd mods \ + --bash <($out/bin/mods completion bash) \ + --fish <($out/bin/mods completion fish) \ + --zsh <($out/bin/mods completion zsh) + ''; meta = { description = "AI on the command line"; diff --git a/pkgs/by-name/mo/modsecurity_standalone/package.nix b/pkgs/by-name/mo/modsecurity_standalone/package.nix index 5a1ee330d2b7..064e589f0887 100644 --- a/pkgs/by-name/mo/modsecurity_standalone/package.nix +++ b/pkgs/by-name/mo/modsecurity_standalone/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation (finalAttrs: { apr aprutil libxml2 - ] ++ optional luaSupport lua5; + ] + ++ optional luaSupport lua5; configureFlags = [ "--enable-standalone-module" diff --git a/pkgs/by-name/mo/mold/package.nix b/pkgs/by-name/mo/mold/package.nix index 85c09132b6ae..16307ac2dc3c 100644 --- a/pkgs/by-name/mo/mold/package.nix +++ b/pkgs/by-name/mo/mold/package.nix @@ -40,15 +40,14 @@ stdenv.mkDerivation (finalAttrs: { ninja ]; - buildInputs = - [ - tbb_2022 - zlib - zstd - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - mimalloc - ]; + buildInputs = [ + tbb_2022 + zlib + zstd + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + mimalloc + ]; cmakeFlags = [ "-DMOLD_USE_SYSTEM_MIMALLOC:BOOL=ON" diff --git a/pkgs/by-name/mo/monado/package.nix b/pkgs/by-name/mo/monado/package.nix index 108f0cbbf246..d6d1cfff8c0f 100644 --- a/pkgs/by-name/mo/monado/package.nix +++ b/pkgs/by-name/mo/monado/package.nix @@ -98,53 +98,52 @@ stdenv.mkDerivation (finalAttrs: { # - DRIVER_ULV2 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624) # - DRIVER_ULV5 - Needs proprietary Leapmotion SDK https://api.leapmotion.com/documentation/v2/unity/devguide/Leap_SDK_Overview.html (See https://github.com/NixOS/nixpkgs/issues/292624) - buildInputs = - [ - bluez - cjson - dbus - eigen - elfutils - gst-plugins-base - gstreamer - hidapi - libbsd - libdrm - libffi - libGL - libjpeg - librealsense - libsurvive - libunwind - libusb1 - libuv - libuvc - libv4l - libXau - libxcb - libXdmcp - libXext - libXrandr - onnxruntime - opencv4 - openhmd - openvr - orc - pcre2 - SDL2 - shaderc - udev - vulkan-headers - vulkan-loader - wayland - wayland-protocols - wayland-scanner - zlib - zstd - ] - ++ lib.optionals tracingSupport [ - tracy - ]; + buildInputs = [ + bluez + cjson + dbus + eigen + elfutils + gst-plugins-base + gstreamer + hidapi + libbsd + libdrm + libffi + libGL + libjpeg + librealsense + libsurvive + libunwind + libusb1 + libuv + libuvc + libv4l + libXau + libxcb + libXdmcp + libXext + libXrandr + onnxruntime + opencv4 + openhmd + openvr + orc + pcre2 + SDL2 + shaderc + udev + vulkan-headers + vulkan-loader + wayland + wayland-protocols + wayland-scanner + zlib + zstd + ] + ++ lib.optionals tracingSupport [ + tracy + ]; cmakeFlags = [ (lib.cmakeBool "XRT_FEATURE_SERVICE" serviceSupport) diff --git a/pkgs/by-name/mo/monero-cli/package.nix b/pkgs/by-name/mo/monero-cli/package.nix index 2fddc205709d..5207b19a90da 100644 --- a/pkgs/by-name/mo/monero-cli/package.nix +++ b/pkgs/by-name/mo/monero-cli/package.nix @@ -67,41 +67,39 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - boost186 # uses boost/asio/io_service.hpp - libsodium - miniupnpc - openssl - randomx - rapidjson - readline - unbound - zeromq - ] - ++ lib.optionals trezorSupport [ - python3 - hidapi - libusb1 - protobuf_21 - ] - ++ lib.optionals (trezorSupport && stdenv.hostPlatform.isLinux) [ udev ]; + buildInputs = [ + boost186 # uses boost/asio/io_service.hpp + libsodium + miniupnpc + openssl + randomx + rapidjson + readline + unbound + zeromq + ] + ++ lib.optionals trezorSupport [ + python3 + hidapi + libusb1 + protobuf_21 + ] + ++ lib.optionals (trezorSupport && stdenv.hostPlatform.isLinux) [ udev ]; - cmakeFlags = - [ - # skip submodules init - "-DMANUAL_SUBMODULES=ON" - # required by monero-gui - "-DBUILD_GUI_DEPS=ON" - "-DReadline_ROOT_DIR=${readline.dev}" - "-Wno-dev" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "-DBoost_USE_MULTITHREADED=OFF" - ++ lib.optional trezorSupport [ - "-DUSE_DEVICE_TREZOR=ON" - # fix build on recent gcc versions - "-DCMAKE_CXX_FLAGS=-fpermissive" - ]; + cmakeFlags = [ + # skip submodules init + "-DMANUAL_SUBMODULES=ON" + # required by monero-gui + "-DBUILD_GUI_DEPS=ON" + "-DReadline_ROOT_DIR=${readline.dev}" + "-Wno-dev" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "-DBoost_USE_MULTITHREADED=OFF" + ++ lib.optional trezorSupport [ + "-DUSE_DEVICE_TREZOR=ON" + # fix build on recent gcc versions + "-DCMAKE_CXX_FLAGS=-fpermissive" + ]; outputs = [ "out" diff --git a/pkgs/by-name/mo/monero-gui/package.nix b/pkgs/by-name/mo/monero-gui/package.nix index d1683b09a684..6084d60b96b1 100644 --- a/pkgs/by-name/mo/monero-gui/package.nix +++ b/pkgs/by-name/mo/monero-gui/package.nix @@ -44,36 +44,35 @@ stdenv.mkDerivation rec { (lib.getDev qt5.qttools) ]; - buildInputs = - [ - boost186 # uses boost/asio/io_service.hpp - libgcrypt - libgpg-error - libsodium - miniupnpc - qt5.qtbase - qt5.qtdeclarative - qt5.qtgraphicaleffects - qt5.qtmultimedia - qt5.qtquickcontrols - qt5.qtquickcontrols2 - qt5.qtxmlpatterns - quirc - randomx - rapidjson - unbound - zeromq - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ qt5.qtmacextras ] - ++ lib.optionals trezorSupport [ - hidapi - libusb1 - protobuf_21 - python3 - ] - ++ lib.optionals (trezorSupport && stdenv.hostPlatform.isLinux) [ - udev - ]; + buildInputs = [ + boost186 # uses boost/asio/io_service.hpp + libgcrypt + libgpg-error + libsodium + miniupnpc + qt5.qtbase + qt5.qtdeclarative + qt5.qtgraphicaleffects + qt5.qtmultimedia + qt5.qtquickcontrols + qt5.qtquickcontrols2 + qt5.qtxmlpatterns + quirc + randomx + rapidjson + unbound + zeromq + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ qt5.qtmacextras ] + ++ lib.optionals trezorSupport [ + hidapi + libusb1 + protobuf_21 + python3 + ] + ++ lib.optionals (trezorSupport && stdenv.hostPlatform.isLinux) [ + udev + ]; postUnpack = '' # copy monero sources here @@ -104,12 +103,13 @@ stdenv.mkDerivation rec { --replace 'add_subdirectory(external)' "" ''; - cmakeFlags = - [ "-DARCH=default" ] - ++ lib.optional trezorSupport [ - # fix build on recent gcc versions - "-DCMAKE_CXX_FLAGS=-fpermissive" - ]; + cmakeFlags = [ + "-DARCH=default" + ] + ++ lib.optional trezorSupport [ + # fix build on recent gcc versions + "-DCMAKE_CXX_FLAGS=-fpermissive" + ]; desktopItem = makeDesktopItem { name = "monero-wallet-gui"; diff --git a/pkgs/by-name/mo/moneydance/package.nix b/pkgs/by-name/mo/moneydance/package.nix index f08eda658829..b020ace87177 100644 --- a/pkgs/by-name/mo/moneydance/package.nix +++ b/pkgs/by-name/mo/moneydance/package.nix @@ -54,16 +54,15 @@ stdenv.mkDerivation (finalAttrs: { # 2. https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh postFixup = let - finalJvmFlags = - [ - "-client" - "--add-modules" - "javafx.swing,javafx.controls,javafx.graphics" - "-classpath" - "${placeholder "out"}/libexec/*" - ] - ++ jvmFlags - ++ [ "Moneydance" ]; + finalJvmFlags = [ + "-client" + "--add-modules" + "javafx.swing,javafx.controls,javafx.graphics" + "-classpath" + "${placeholder "out"}/libexec/*" + ] + ++ jvmFlags + ++ [ "Moneydance" ]; in '' # This is in postFixup because gappsWrapperArgs is generated in preFixup diff --git a/pkgs/by-name/mo/mongodb-ce/package.nix b/pkgs/by-name/mo/mongodb-ce/package.nix index 5618e4ca5b1a..f7c0ad3e98b7 100644 --- a/pkgs/by-name/mo/mongodb-ce/package.nix +++ b/pkgs/by-name/mo/mongodb-ce/package.nix @@ -85,24 +85,23 @@ stdenv.mkDerivation (finalAttrs: { pup ]; - text = - '' - # Get latest version string from Github - NEW_VERSION=$(curl -s "https://api.github.com/repos/mongodb/mongo/tags?per_page=1000" | jq -r 'first(.[] | .name | select(startswith("r8.0")) | select(contains("rc") | not) | .[1:])') + text = '' + # Get latest version string from Github + NEW_VERSION=$(curl -s "https://api.github.com/repos/mongodb/mongo/tags?per_page=1000" | jq -r 'first(.[] | .name | select(startswith("r8.0")) | select(contains("rc") | not) | .[1:])') - # Check if the new version is available for download, if not, exit - curl -s https://www.mongodb.com/try/download/community-edition/releases | pup 'h3:not([id]) text{}' | grep "$NEW_VERSION" + # Check if the new version is available for download, if not, exit + curl -s https://www.mongodb.com/try/download/community-edition/releases | pup 'h3:not([id]) text{}' | grep "$NEW_VERSION" - if [[ "${version}" = "$NEW_VERSION" ]]; then - echo "The new version same as the old version." - exit 0 - fi - '' - + lib.concatStrings ( - map (system: '' - nix-update --system ${system} --version "$NEW_VERSION" ${finalAttrs.pname} - '') finalAttrs.meta.platforms - ); + if [[ "${version}" = "$NEW_VERSION" ]]; then + echo "The new version same as the old version." + exit 0 + fi + '' + + lib.concatStrings ( + map (system: '' + nix-update --system ${system} --version "$NEW_VERSION" ${finalAttrs.pname} + '') finalAttrs.meta.platforms + ); }; in { diff --git a/pkgs/by-name/mo/mongoose/package.nix b/pkgs/by-name/mo/mongoose/package.nix index 8679c07c1a44..6acdfe34a21a 100644 --- a/pkgs/by-name/mo/mongoose/package.nix +++ b/pkgs/by-name/mo/mongoose/package.nix @@ -31,13 +31,12 @@ stdenv.mkDerivation { cmake ]; - buildInputs = - [ - blas - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ]; + buildInputs = [ + blas + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ]; dontUseCmakeConfigure = true; diff --git a/pkgs/by-name/mo/monit/package.nix b/pkgs/by-name/mo/monit/package.nix index 6823dde5e890..157a5149f9d9 100644 --- a/pkgs/by-name/mo/monit/package.nix +++ b/pkgs/by-name/mo/monit/package.nix @@ -26,34 +26,32 @@ stdenv.mkDerivation rec { flex ]; - buildInputs = - [ - zlib.dev - libxcrypt - ] - ++ lib.optionals useSSL [ openssl ] - ++ lib.optionals usePAM [ pam ]; + buildInputs = [ + zlib.dev + libxcrypt + ] + ++ lib.optionals useSSL [ openssl ] + ++ lib.optionals usePAM [ pam ]; - configureFlags = - [ - (lib.withFeature usePAM "pam") - ] - ++ ( - if useSSL then - [ - "--with-ssl-incl-dir=${openssl.dev}/include" - "--with-ssl-lib-dir=${lib.getLib openssl}/lib" - ] - else - [ - "--without-ssl" - ] - ) - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # will need to check both these are true for musl - "libmonit_cv_setjmp_available=yes" - "libmonit_cv_vsnprintf_c99_conformant=yes" - ]; + configureFlags = [ + (lib.withFeature usePAM "pam") + ] + ++ ( + if useSSL then + [ + "--with-ssl-incl-dir=${openssl.dev}/include" + "--with-ssl-lib-dir=${lib.getLib openssl}/lib" + ] + else + [ + "--without-ssl" + ] + ) + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # will need to check both these are true for musl + "libmonit_cv_setjmp_available=yes" + "libmonit_cv_vsnprintf_c99_conformant=yes" + ]; meta = { homepage = "https://mmonit.com/monit/"; diff --git a/pkgs/by-name/mo/monkeysphere/package.nix b/pkgs/by-name/mo/monkeysphere/package.nix index a27fe91a8f71..9206530afd00 100644 --- a/pkgs/by-name/mo/monkeysphere/package.nix +++ b/pkgs/by-name/mo/monkeysphere/package.nix @@ -47,28 +47,27 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ makeWrapper ]; - buildInputs = + buildInputs = [ + perl + libassuan + libgcrypt + ] + ++ lib.optional doCheck ( [ - perl - libassuan - libgcrypt + gnupg + opensshUnsafe + which + socat + cpio + hexdump + procps + lockfileProgs ] - ++ lib.optional doCheck ( - [ - gnupg - opensshUnsafe - which - socat - cpio - hexdump - procps - lockfileProgs - ] - ++ (with perlPackages; [ - CryptOpenSSLRSA - CryptOpenSSLBignum - ]) - ); + ++ (with perlPackages; [ + CryptOpenSSLRSA + CryptOpenSSLBignum + ]) + ); makeFlags = [ "PREFIX=/" diff --git a/pkgs/by-name/mo/monophony/package.nix b/pkgs/by-name/mo/monophony/package.nix index 986f0cd2ab4d..3d56ed07fd4f 100644 --- a/pkgs/by-name/mo/monophony/package.nix +++ b/pkgs/by-name/mo/monophony/package.nix @@ -41,17 +41,16 @@ python3Packages.buildPythonApplication rec { wrapGAppsHook4 ]; - buildInputs = - [ - libadwaita - # needed for gstreamer https - glib-networking - ] - ++ (with gst_all_1; [ - gst-plugins-base - gst-plugins-good - gstreamer - ]); + buildInputs = [ + libadwaita + # needed for gstreamer https + glib-networking + ] + ++ (with gst_all_1; [ + gst-plugins-base + gst-plugins-good + gstreamer + ]); pythonRelaxDeps = [ "mpris_server" ]; diff --git a/pkgs/by-name/mo/moonlight-qt/package.nix b/pkgs/by-name/mo/moonlight-qt/package.nix index f04b26f5d82e..57f0e7954d27 100644 --- a/pkgs/by-name/mo/moonlight-qt/package.nix +++ b/pkgs/by-name/mo/moonlight-qt/package.nix @@ -49,27 +49,26 @@ stdenv.mkDerivation (finalAttrs: { vulkan-headers ]; - buildInputs = - [ - SDL2 - SDL2_ttf - ffmpeg - libopus - libplacebo - qt6.qtdeclarative - qt6.qtsvg - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libpulseaudio - libva - libvdpau - libxkbcommon - qt6.qtwayland - wayland - libdrm - ]; + buildInputs = [ + SDL2 + SDL2_ttf + ffmpeg + libopus + libplacebo + qt6.qtdeclarative + qt6.qtsvg + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libpulseaudio + libva + libvdpau + libxkbcommon + qt6.qtwayland + wayland + libdrm + ]; qmakeFlags = [ "CONFIG+=disable-prebuilts" ]; diff --git a/pkgs/by-name/mo/mosh/package.nix b/pkgs/by-name/mo/mosh/package.nix index bb5d24c55893..219109119951 100644 --- a/pkgs/by-name/mo/mosh/package.nix +++ b/pkgs/by-name/mo/mosh/package.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation rec { openssl bash-completion perl - ] ++ lib.optional withUtempter libutempter; + ] + ++ lib.optional withUtempter libutempter; strictDeps = true; diff --git a/pkgs/by-name/mo/moshi/package.nix b/pkgs/by-name/mo/moshi/package.nix index 6dcdad7735d2..90adc5a25dbd 100644 --- a/pkgs/by-name/mo/moshi/package.nix +++ b/pkgs/by-name/mo/moshi/package.nix @@ -55,40 +55,38 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-BxV8oZlN+6cVb3GwhY7TKWxHEpY3WVEhN6A6+5NMOyU="; - nativeBuildInputs = - [ - pkg-config - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.dylib'] - rustPlatform.bindgenHook - ] - ++ lib.optionals config.cudaSupport [ - # WARNING: autoAddDriverRunpath must run AFTER autoPatchelfHook - # Otherwise, autoPatchelfHook removes driverLink from RUNPATH - autoPatchelfHook - autoAddDriverRunpath + nativeBuildInputs = [ + pkg-config + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.dylib'] + rustPlatform.bindgenHook + ] + ++ lib.optionals config.cudaSupport [ + # WARNING: autoAddDriverRunpath must run AFTER autoPatchelfHook + # Otherwise, autoPatchelfHook removes driverLink from RUNPATH + autoPatchelfHook + autoAddDriverRunpath - cudaPackages.cuda_nvcc - ]; + cudaPackages.cuda_nvcc + ]; - buildInputs = - [ - libopus - openssl - sentencepiece - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ] - ++ lib.optionals config.cudaSupport [ - cudaPackages.cuda_cccl - cudaPackages.cuda_cudart - cudaPackages.cuda_nvrtc - cudaPackages.libcublas - cudaPackages.libcurand - ]; + buildInputs = [ + libopus + openssl + sentencepiece + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ] + ++ lib.optionals config.cudaSupport [ + cudaPackages.cuda_cccl + cudaPackages.cuda_cudart + cudaPackages.cuda_nvrtc + cudaPackages.libcublas + cudaPackages.libcurand + ]; buildFeatures = lib.optionals stdenv.hostPlatform.isDarwin [ "metal" ] diff --git a/pkgs/by-name/mo/mosquitto/package.nix b/pkgs/by-name/mo/mosquitto/package.nix index e3ec46a0f95a..eedc4d9f005c 100644 --- a/pkgs/by-name/mo/mosquitto/package.nix +++ b/pkgs/by-name/mo/mosquitto/package.nix @@ -68,7 +68,8 @@ stdenv.mkDerivation rec { libwebsockets' openssl uthash - ] ++ lib.optional withSystemd systemd; + ] + ++ lib.optional withSystemd systemd; cmakeFlags = [ (lib.cmakeBool "WITH_BUNDLED_DEPS" false) diff --git a/pkgs/by-name/mo/motif/package.nix b/pkgs/by-name/mo/motif/package.nix index 76ff28777862..c06b6c1e062c 100644 --- a/pkgs/by-name/mo/motif/package.nix +++ b/pkgs/by-name/mo/motif/package.nix @@ -59,33 +59,32 @@ stdenv.mkDerivation rec { strictDeps = true; - postPatch = - '' - # File existence fails when cross-compiling - useless for Nix anyhow - substituteInPlace ./configure --replace-fail \ - 'as_fn_error $? "cannot check for file existence' '#' \ - --replace-fail 'pkg-config' '${stdenv.cc.targetPrefix}pkg-config' - '' - + lib.optionalString (!demoSupport) '' - sed 's/\//' -i Makefile.{am,in} - '' - # for cross builds, we must copy several build tools from a native build - # (and we must ensure they are not removed and recreated by make) - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - cp "${buildPackages.motif}/lib/internals/makestrs" config/util/makestrs - substituteInPlace config/util/Makefile.in \ - --replace-fail '@rm -f makestrs$(EXEEXT)' "" \ - --replace-fail '$(AM_V_CCLD)$(LINK) $(makestrs_OBJECTS) $(makestrs_LDADD) $(LIBS)' "" + postPatch = '' + # File existence fails when cross-compiling - useless for Nix anyhow + substituteInPlace ./configure --replace-fail \ + 'as_fn_error $? "cannot check for file existence' '#' \ + --replace-fail 'pkg-config' '${stdenv.cc.targetPrefix}pkg-config' + '' + + lib.optionalString (!demoSupport) '' + sed 's/\//' -i Makefile.{am,in} + '' + # for cross builds, we must copy several build tools from a native build + # (and we must ensure they are not removed and recreated by make) + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + cp "${buildPackages.motif}/lib/internals/makestrs" config/util/makestrs + substituteInPlace config/util/Makefile.in \ + --replace-fail '@rm -f makestrs$(EXEEXT)' "" \ + --replace-fail '$(AM_V_CCLD)$(LINK) $(makestrs_OBJECTS) $(makestrs_LDADD) $(LIBS)' "" - cp "${buildPackages.motif}"/lib/internals/{wml,wmluiltok,wmldbcreate} tools/wml/ - substituteInPlace tools/wml/Makefile.in \ - --replace-fail '@rm -f wmldbcreate$(EXEEXT)' "" \ - --replace-fail '$(AM_V_CCLD)$(LINK) $(wmldbcreate_OBJECTS) $(wmldbcreate_LDADD) $(LIBS)' "" \ - --replace-fail '@rm -f wmluiltok$(EXEEXT)' "" \ - --replace-fail '$(AM_V_CCLD)$(LINK) $(wmluiltok_OBJECTS) $(wmluiltok_LDADD) $(LIBS)' "" \ - --replace-fail '@rm -f wml$(EXEEXT)' "" \ - --replace-fail '$(AM_V_CCLD)$(LINK) $(wml_OBJECTS) $(wml_LDADD) $(LIBS)' "" - ''; + cp "${buildPackages.motif}"/lib/internals/{wml,wmluiltok,wmldbcreate} tools/wml/ + substituteInPlace tools/wml/Makefile.in \ + --replace-fail '@rm -f wmldbcreate$(EXEEXT)' "" \ + --replace-fail '$(AM_V_CCLD)$(LINK) $(wmldbcreate_OBJECTS) $(wmldbcreate_LDADD) $(LIBS)' "" \ + --replace-fail '@rm -f wmluiltok$(EXEEXT)' "" \ + --replace-fail '$(AM_V_CCLD)$(LINK) $(wmluiltok_OBJECTS) $(wmluiltok_LDADD) $(LIBS)' "" \ + --replace-fail '@rm -f wml$(EXEEXT)' "" \ + --replace-fail '$(AM_V_CCLD)$(LINK) $(wml_OBJECTS) $(wml_LDADD) $(LIBS)' "" + ''; patches = [ ./Remove-unsupported-weak-refs-on-darwin.patch diff --git a/pkgs/by-name/mo/movit/package.nix b/pkgs/by-name/mo/movit/package.nix index 9fcf2a103684..46541f61c5c6 100644 --- a/pkgs/by-name/mo/movit/package.nix +++ b/pkgs/by-name/mo/movit/package.nix @@ -45,13 +45,12 @@ stdenv.mkDerivation rec { libepoxy ]; - env = - { - NIX_CFLAGS_COMPILE = "-std=c++17"; # needed for latest gtest - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - NIX_LDFLAGS = "-framework OpenGL"; - }; + env = { + NIX_CFLAGS_COMPILE = "-std=c++17"; # needed for latest gtest + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-framework OpenGL"; + }; enableParallelBuilding = true; diff --git a/pkgs/by-name/mo/mozc/package.nix b/pkgs/by-name/mo/mozc/package.nix index 02cfa443c83f..3a2b5fdddd7d 100644 --- a/pkgs/by-name/mo/mozc/package.nix +++ b/pkgs/by-name/mo/mozc/package.nix @@ -75,13 +75,12 @@ buildBazelPackage rec { --replace-fail "https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip" "file://${jp-zip-codes}/jigyosyo.zip" ''; - preConfigure = - '' - cd src - '' - + lib.optionalString (dictionaries != [ ]) '' - cat ${ut-dictionary}/mozcdic-ut.txt >> data/dictionary_oss/dictionary00.txt - ''; + preConfigure = '' + cd src + '' + + lib.optionalString (dictionaries != [ ]) '' + cat ${ut-dictionary}/mozcdic-ut.txt >> data/dictionary_oss/dictionary00.txt + ''; buildAttrs.installPhase = '' runHook preInstall diff --git a/pkgs/by-name/mo/mozphab/package.nix b/pkgs/by-name/mo/mozphab/package.nix index ce8fc76cb7dd..6795f2d673af 100644 --- a/pkgs/by-name/mo/mozphab/package.nix +++ b/pkgs/by-name/mo/mozphab/package.nix @@ -38,19 +38,18 @@ python3.pkgs.buildPythonApplication rec { setuptools ]; - nativeCheckInputs = - [ - git - mercurial - patch - ] - ++ (with python3.pkgs; [ - callee - immutabledict - hg-evolve - mock - pytestCheckHook - ]); + nativeCheckInputs = [ + git + mercurial + patch + ] + ++ (with python3.pkgs; [ + callee + immutabledict + hg-evolve + mock + pytestCheckHook + ]); preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/by-name/mp/mp3blaster/package.nix b/pkgs/by-name/mp/mp3blaster/package.nix index 808fa4fa4c11..6c86e6faf4cf 100644 --- a/pkgs/by-name/mp/mp3blaster/package.nix +++ b/pkgs/by-name/mp/mp3blaster/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ ncurses libvorbis - ] ++ lib.optional stdenv.hostPlatform.isDarwin SDL; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin SDL; env.NIX_CFLAGS_COMPILE = toString ( [ diff --git a/pkgs/by-name/mp/mpb/package.nix b/pkgs/by-name/mp/mpb/package.nix index 8f9bd6ee639e..6db951abaa19 100644 --- a/pkgs/by-name/mp/mpb/package.nix +++ b/pkgs/by-name/mp/mpb/package.nix @@ -54,7 +54,8 @@ stdenv.mkDerivation rec { "--with-libctl=${libctl}" "--enable-maintainer-mode" "--disable-dependency-tracking" - ] ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared"; + ] + ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared"; doCheck = true; diff --git a/pkgs/by-name/mp/mpc/package.nix b/pkgs/by-name/mp/mpc/package.nix index d88e9438e1fe..2ebdbaf48841 100644 --- a/pkgs/by-name/mp/mpc/package.nix +++ b/pkgs/by-name/mp/mpc/package.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libmpdclient - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; nativeBuildInputs = [ installShellFiles diff --git a/pkgs/by-name/mp/mpdscribble/package.nix b/pkgs/by-name/mp/mpdscribble/package.nix index a6d74dabc7eb..0d60127161fc 100644 --- a/pkgs/by-name/mp/mpdscribble/package.nix +++ b/pkgs/by-name/mp/mpdscribble/package.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation rec { curl boost libgcrypt - ] ++ lib.optional stdenv.hostPlatform.isLinux systemd; + ] + ++ lib.optional stdenv.hostPlatform.isLinux systemd; meta = with lib; { description = "MPD client which submits info about tracks being played to a scrobbler"; diff --git a/pkgs/by-name/mp/mpop/package.nix b/pkgs/by-name/mp/mpop/package.nix index 1fea4be45eba..31645187b5bb 100644 --- a/pkgs/by-name/mp/mpop/package.nix +++ b/pkgs/by-name/mp/mpop/package.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation rec { (lib.withFeature idnSupport "idn") (lib.withFeature gsaslSupport "gsasl") "--with-tls=${sslLibrary}" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "--with-macosx-keyring"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--with-macosx-keyring"; meta = with lib; { description = "POP3 mail retrieval agent"; diff --git a/pkgs/by-name/mp/mpris-scrobbler/package.nix b/pkgs/by-name/mp/mpris-scrobbler/package.nix index 05190106da85..1e81a7ad8f88 100644 --- a/pkgs/by-name/mp/mpris-scrobbler/package.nix +++ b/pkgs/by-name/mp/mpris-scrobbler/package.nix @@ -26,16 +26,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-Ro2Eop4CGvcT1hiCYxxmECFp5oefmAnBT9twnVfpsvY="; }; - postPatch = - '' - substituteInPlace src/signon.c \ - --replace "/usr/bin/xdg-open" "${xdg-utils}/bin/xdg-open" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace meson.build \ - --replace "-Werror=format-truncation=0" "" \ - --replace "-Wno-stringop-overflow" "" - ''; + postPatch = '' + substituteInPlace src/signon.c \ + --replace "/usr/bin/xdg-open" "${xdg-utils}/bin/xdg-open" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace meson.build \ + --replace "-Werror=format-truncation=0" "" \ + --replace "-Wno-stringop-overflow" "" + ''; nativeBuildInputs = [ m4 diff --git a/pkgs/by-name/mq/mqtt-explorer/package.nix b/pkgs/by-name/mq/mqtt-explorer/package.nix index c83aee844f79..f529f3a7e043 100644 --- a/pkgs/by-name/mq/mqtt-explorer/package.nix +++ b/pkgs/by-name/mq/mqtt-explorer/package.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation rec { typescript fixup-yarn-lock makeWrapper - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ copyDesktopItems ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ copyDesktopItems ]; env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; diff --git a/pkgs/by-name/mr/mrtrix/package.nix b/pkgs/by-name/mr/mrtrix/package.nix index 5d0c7674d8e0..0fe0b96ca8ef 100644 --- a/pkgs/by-name/mr/mrtrix/package.nix +++ b/pkgs/by-name/mr/mrtrix/package.nix @@ -36,26 +36,26 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper less python3 - ] ++ lib.optional withGui qt5.wrapQtAppsHook; + ] + ++ lib.optional withGui qt5.wrapQtAppsHook; - buildInputs = - [ - ants - eigen_3_4_0 - python3 - fftw - libtiff - libpng - zlib - ] - ++ lib.optionals withGui [ - libGL - libGLU - libX11 - libXext - qt5.qtbase - qt5.qtsvg - ]; + buildInputs = [ + ants + eigen_3_4_0 + python3 + fftw + libtiff + libpng + zlib + ] + ++ lib.optionals withGui [ + libGL + libGLU + libX11 + libXext + qt5.qtbase + qt5.qtsvg + ]; nativeInstallCheckInputs = [ bc ]; diff --git a/pkgs/by-name/ms/msbuild-structured-log-viewer/package.nix b/pkgs/by-name/ms/msbuild-structured-log-viewer/package.nix index f1e839088ba7..8365219a02f5 100644 --- a/pkgs/by-name/ms/msbuild-structured-log-viewer/package.nix +++ b/pkgs/by-name/ms/msbuild-structured-log-viewer/package.nix @@ -46,22 +46,21 @@ buildDotnetModule (finalAttrs: { dontDotnetFixup = true; - postFixup = - '' - wrapDotnetProgram $out/lib/msbuild-structured-log-viewer/StructuredLogViewer.Avalonia $out/bin/${finalAttrs.meta.mainProgram} - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm444 $src/src/StructuredLogViewer/icons/msbuild-structured-log-viewer.png $out/share/icons/hicolor/32x32/apps/msbuild-structured-log-viewer.png - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/StructuredLogViewer.Avalonia/Info.plist \ - --replace-fail "0.0.1" "${finalAttrs.version}" + postFixup = '' + wrapDotnetProgram $out/lib/msbuild-structured-log-viewer/StructuredLogViewer.Avalonia $out/bin/${finalAttrs.meta.mainProgram} + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm444 $src/src/StructuredLogViewer/icons/msbuild-structured-log-viewer.png $out/share/icons/hicolor/32x32/apps/msbuild-structured-log-viewer.png + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/StructuredLogViewer.Avalonia/Info.plist \ + --replace-fail "0.0.1" "${finalAttrs.version}" - install -Dm444 src/StructuredLogViewer.Avalonia/Info.plist $out/Applications/StructuredLogViewer.app/Contents/Info.plist - install -Dm444 src/StructuredLogViewer.Avalonia/StructuredLogViewer.icns $out/Applications/StructuredLogViewer.app/Contents/Resources/StructuredLogViewer.icns - mkdir -p $out/Applications/StructuredLogViewer.app/Contents/MacOS - ln -s $out/bin/${finalAttrs.meta.mainProgram} $out/Applications/StructuredLogViewer.app/Contents/MacOS/StructuredLogViewer.Avalonia - ''; + install -Dm444 src/StructuredLogViewer.Avalonia/Info.plist $out/Applications/StructuredLogViewer.app/Contents/Info.plist + install -Dm444 src/StructuredLogViewer.Avalonia/StructuredLogViewer.icns $out/Applications/StructuredLogViewer.app/Contents/Resources/StructuredLogViewer.icns + mkdir -p $out/Applications/StructuredLogViewer.app/Contents/MacOS + ln -s $out/bin/${finalAttrs.meta.mainProgram} $out/Applications/StructuredLogViewer.app/Contents/MacOS/StructuredLogViewer.Avalonia + ''; desktopItems = makeDesktopItem { name = "msbuild-structured-log-viewer"; diff --git a/pkgs/by-name/ms/msgpack-cxx/package.nix b/pkgs/by-name/ms/msgpack-cxx/package.nix index 1eefc89e9ecc..aae71ad83ce1 100644 --- a/pkgs/by-name/ms/msgpack-cxx/package.nix +++ b/pkgs/by-name/ms/msgpack-cxx/package.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DMSGPACK_BUILD_DOCS=OFF" # docs are not installed even if built "-DMSGPACK_CXX20=ON" - ] ++ lib.optional finalAttrs.finalPackage.doCheck "-DMSGPACK_BUILD_TESTS=ON"; + ] + ++ lib.optional finalAttrs.finalPackage.doCheck "-DMSGPACK_BUILD_TESTS=ON"; checkInputs = [ zlib diff --git a/pkgs/by-name/ms/msmtp/package.nix b/pkgs/by-name/ms/msmtp/package.nix index c801fa83ee9b..1a6a3f061f3e 100644 --- a/pkgs/by-name/ms/msmtp/package.nix +++ b/pkgs/by-name/ms/msmtp/package.nix @@ -56,13 +56,15 @@ let configureFlags = [ "--sysconfdir=/etc" "--with-libgsasl" - ] ++ optionals stdenv.hostPlatform.isDarwin [ "--with-macosx-keyring" ]; + ] + ++ optionals stdenv.hostPlatform.isDarwin [ "--with-macosx-keyring" ]; buildInputs = [ gnutls gsasl libidn2 - ] ++ optionals withKeyring [ libsecret ]; + ] + ++ optionals withKeyring [ libsecret ]; nativeBuildInputs = [ autoreconfHook @@ -115,33 +117,32 @@ let msmtpq = { scripts = [ "bin/msmtpq" ]; interpreter = getExe bash; - inputs = - [ - binaries - coreutils - gnugrep - gnused - netcat-gnu - which - ] - ++ optionals withSystemd [ systemd ] - ++ optionals withLibnotify [ libnotify ]; - execer = - [ - "cannot:${getBin binaries}/bin/msmtp" - "cannot:${getBin netcat-gnu}/bin/nc" - ] - ++ optionals withSystemd [ - "cannot:${getBin systemd}/bin/systemd-cat" - ] - ++ optionals withLibnotify [ - "cannot:${getBin libnotify}/bin/notify-send" - ]; + inputs = [ + binaries + coreutils + gnugrep + gnused + netcat-gnu + which + ] + ++ optionals withSystemd [ systemd ] + ++ optionals withLibnotify [ libnotify ]; + execer = [ + "cannot:${getBin binaries}/bin/msmtp" + "cannot:${getBin netcat-gnu}/bin/nc" + ] + ++ optionals withSystemd [ + "cannot:${getBin systemd}/bin/systemd-cat" + ] + ++ optionals withLibnotify [ + "cannot:${getBin libnotify}/bin/notify-send" + ]; fix."$MSMTP" = [ "msmtp" ]; - fake.external = - [ "ping" ] - ++ optionals (!withSystemd) [ "systemd-cat" ] - ++ optionals (!withLibnotify) [ "notify-send" ]; + fake.external = [ + "ping" + ] + ++ optionals (!withSystemd) [ "systemd-cat" ] + ++ optionals (!withLibnotify) [ "notify-send" ]; keep.source = [ "~/.msmtpqrc" ]; }; diff --git a/pkgs/by-name/ms/msolve/package.nix b/pkgs/by-name/ms/msolve/package.nix index 3de755ee2cc0..2894f7fda034 100644 --- a/pkgs/by-name/ms/msolve/package.nix +++ b/pkgs/by-name/ms/msolve/package.nix @@ -28,15 +28,14 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook ]; - buildInputs = - [ - flint3 - gmp - mpfr - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ]; + buildInputs = [ + flint3 + gmp + mpfr + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ]; doCheck = true; diff --git a/pkgs/by-name/ms/mstflint/package.nix b/pkgs/by-name/ms/mstflint/package.nix index fc5b68c2a888..2458926237b4 100644 --- a/pkgs/by-name/ms/mstflint/package.nix +++ b/pkgs/by-name/ms/mstflint/package.nix @@ -53,20 +53,19 @@ stdenv.mkDerivation rec { git ]; - buildInputs = - [ - rdma-core - zlib - libxml2 - openssl - ] - ++ lib.optionals (!onlyFirmwareUpdater) [ - boost - curl - expat - xz - python3 - ]; + buildInputs = [ + rdma-core + zlib + libxml2 + openssl + ] + ++ lib.optionals (!onlyFirmwareUpdater) [ + boost + curl + expat + xz + python3 + ]; preConfigure = '' export CPPFLAGS="-I$(pwd)/tools_layouts -isystem ${libxml2.dev}/include/libxml2" @@ -108,22 +107,21 @@ stdenv.mkDerivation rec { '') ]; - configureFlags = - [ - "--enable-xml2" - "--datarootdir=${placeholder "out"}/share" - ] - ++ lib.optionals (!onlyFirmwareUpdater) [ - "--enable-adb-generic-tools" - "--enable-cs" - "--enable-dc" - "--enable-fw-mgr" - "--enable-inband" - "--enable-rdmem" - ] - ++ lib.optionals enableDPA [ - "--enable-dpa" - ]; + configureFlags = [ + "--enable-xml2" + "--datarootdir=${placeholder "out"}/share" + ] + ++ lib.optionals (!onlyFirmwareUpdater) [ + "--enable-adb-generic-tools" + "--enable-cs" + "--enable-dc" + "--enable-fw-mgr" + "--enable-inband" + "--enable-rdmem" + ] + ++ lib.optionals enableDPA [ + "--enable-dpa" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/mt/mtdutils/package.nix b/pkgs/by-name/mt/mtdutils/package.nix index d845b3ec6956..0ee2651116e6 100644 --- a/pkgs/by-name/mt/mtdutils/package.nix +++ b/pkgs/by-name/mt/mtdutils/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ lib.optional doCheck cmocka; + ] + ++ lib.optional doCheck cmocka; buildInputs = [ acl libuuid diff --git a/pkgs/by-name/mu/mum/package.nix b/pkgs/by-name/mu/mum/package.nix index 0cc9ce86e3ab..1c1188f2f349 100644 --- a/pkgs/by-name/mu/mum/package.nix +++ b/pkgs/by-name/mu/mum/package.nix @@ -43,7 +43,8 @@ rustPlatform.buildRustPackage (finalAttrs: { glib libopus openssl - ] ++ lib.optional withNotifications libnotify; + ] + ++ lib.optional withNotifications libnotify; buildNoDefaultFeatures = true; buildFeatures = lib.optional withNotifications "notifications" ++ lib.optional withOgg "ogg"; diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index 9d613b4b057d..ade9a4611cc6 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -89,25 +89,23 @@ stdenv.mkDerivation (finalAttrs: { "${if static then "all" else "allshared"}" ]; - installPhase = - '' - mkdir $out - cp -r include lib $out - '' - + lib.optionalString (!mpiSupport) '' - # Install mumps_seq headers - install -Dm 444 -t $out/include/mumps_seq libseq/*.h + installPhase = '' + mkdir $out + cp -r include lib $out + '' + + lib.optionalString (!mpiSupport) '' + # Install mumps_seq headers + install -Dm 444 -t $out/include/mumps_seq libseq/*.h - # Add some compatibility with coin-or-mumps - ln -s $out/include/mumps_seq/mpi.h $out/include/mumps_mpi.h - ''; + # Add some compatibility with coin-or-mumps + ln -s $out/include/mumps_seq/mpi.h $out/include/mumps_mpi.h + ''; - nativeBuildInputs = - [ - gfortran - ] - ++ lib.optional mpiSupport mpi - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + nativeBuildInputs = [ + gfortran + ] + ++ lib.optional mpiSupport mpi + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; # Parmetis should be placed before scotch to avoid conflict of header file "parmetis.h" buildInputs = diff --git a/pkgs/by-name/mu/muon/package.nix b/pkgs/by-name/mu/muon/package.nix index afbdceac9b46..0914a795160c 100644 --- a/pkgs/by-name/mu/muon/package.nix +++ b/pkgs/by-name/mu/muon/package.nix @@ -29,15 +29,14 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" ] ++ lib.optionals buildDocs [ "man" ]; - nativeBuildInputs = - [ - pkgconf - ] - ++ lib.optionals (!embedSamurai) [ samurai ] - ++ lib.optionals buildDocs [ - (python3.withPackages (ps: [ ps.pyyaml ])) - scdoc - ]; + nativeBuildInputs = [ + pkgconf + ] + ++ lib.optionals (!embedSamurai) [ samurai ] + ++ lib.optionals buildDocs [ + (python3.withPackages (ps: [ ps.pyyaml ])) + scdoc + ]; buildInputs = [ curl @@ -75,13 +74,12 @@ stdenv.mkDerivation (finalAttrs: { popd ''; - postPatch = - '' - patchShebangs bootstrap.sh - '' - + lib.optionalString buildDocs '' - patchShebangs subprojects/meson-docs/docs/genrefman.py - ''; + postPatch = '' + patchShebangs bootstrap.sh + '' + + lib.optionalString buildDocs '' + patchShebangs subprojects/meson-docs/docs/genrefman.py + ''; # tests try to access "~" postConfigure = '' diff --git a/pkgs/by-name/mu/mupdf/package.nix b/pkgs/by-name/mu/mupdf/package.nix index 8d3ea24b24bc..5ae579c54aaa 100644 --- a/pkgs/by-name/mu/mupdf/package.nix +++ b/pkgs/by-name/mu/mupdf/package.nix @@ -93,67 +93,66 @@ stdenv.mkDerivation rec { done ''; - makeFlags = - [ - "prefix=$(out)" - "shared=yes" - "USE_SYSTEM_LIBS=yes" - "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" - ] - ++ lib.optionals (!enableX11) [ "HAVE_X11=no" ] - ++ lib.optionals (!enableGL) [ "HAVE_GLUT=no" ] - ++ lib.optionals (enableOcr) [ "USE_TESSERACT=yes" ] - ++ lib.optionals (enableBarcode) [ - "barcode=yes" - "USE_SYSTEM_ZXINGCPP=no" - ]; + makeFlags = [ + "prefix=$(out)" + "shared=yes" + "USE_SYSTEM_LIBS=yes" + "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" + ] + ++ lib.optionals (!enableX11) [ "HAVE_X11=no" ] + ++ lib.optionals (!enableGL) [ "HAVE_GLUT=no" ] + ++ lib.optionals (enableOcr) [ "USE_TESSERACT=yes" ] + ++ lib.optionals (enableBarcode) [ + "barcode=yes" + "USE_SYSTEM_ZXINGCPP=no" + ]; - nativeBuildInputs = - [ pkg-config ] - ++ lib.optional (enableGL || enableX11) copyDesktopItems - ++ lib.optional (stdenv.hostPlatform.isDarwin && (enableGL || enableX11)) desktopToDarwinBundle - ++ lib.optionals (enableCxx || enablePython) [ - (python3.pythonOnBuildForHost.withPackages (ps: [ - ps.setuptools - ps.libclang - ])) - ] - ++ lib.optionals (enablePython) [ - which - swig - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - xcbuild - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optional (enableGL || enableX11) copyDesktopItems + ++ lib.optional (stdenv.hostPlatform.isDarwin && (enableGL || enableX11)) desktopToDarwinBundle + ++ lib.optionals (enableCxx || enablePython) [ + (python3.pythonOnBuildForHost.withPackages (ps: [ + ps.setuptools + ps.libclang + ])) + ] + ++ lib.optionals (enablePython) [ + which + swig + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + xcbuild + ]; - buildInputs = - [ - freetype - harfbuzz - openjpeg - jbig2dec - libjpeg - gumbo - ] - ++ lib.optionals enableX11 [ - libX11 - libXext - libXi - libXrandr - ] - ++ lib.optionals enableCurl [ - curl - openssl - ] - ++ lib.optionals (enableGL && !stdenv.hostPlatform.isDarwin) [ - freeglut-mupdf - libGLU - ] - ++ lib.optionals enableOcr [ - leptonica - tesseract - ]; + buildInputs = [ + freetype + harfbuzz + openjpeg + jbig2dec + libjpeg + gumbo + ] + ++ lib.optionals enableX11 [ + libX11 + libXext + libXi + libXrandr + ] + ++ lib.optionals enableCurl [ + curl + openssl + ] + ++ lib.optionals (enableGL && !stdenv.hostPlatform.isDarwin) [ + freeglut-mupdf + libGLU + ] + ++ lib.optionals enableOcr [ + leptonica + tesseract + ]; outputs = [ "bin" @@ -209,56 +208,55 @@ stdenv.mkDerivation rec { }) ]; - postInstall = - '' - mkdir -p "$out/lib/pkgconfig" - cat >"$out/lib/pkgconfig/mupdf.pc" <"$out/lib/pkgconfig/mupdf.pc" <> config.mk + # Disable building static library + echo "STATICLIB_TOO = N" >> config.mk - # Enable cross-compilation - echo 'AR = ${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar' >> config.mk - echo 'CC = ${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc' >> config.mk - echo 'CC_FOR_BUILD = ${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc' >> config.mk - echo 'LD_FOR_BUILD = $(CC_FOR_BUILD)' >> config.mk - echo 'PKG_CONFIG = ${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config' >> config.mk - echo 'RANLIB = ${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib' >> config.mk + # Enable cross-compilation + echo 'AR = ${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar' >> config.mk + echo 'CC = ${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc' >> config.mk + echo 'CC_FOR_BUILD = ${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc' >> config.mk + echo 'LD_FOR_BUILD = $(CC_FOR_BUILD)' >> config.mk + echo 'PKG_CONFIG = ${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config' >> config.mk + echo 'RANLIB = ${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib' >> config.mk - # Use libraries from Nixpkgs - echo "TIFFLIB = libtiff.so" >> config.mk - echo "TIFFLIB_NEEDS_JPEG = N" >> config.mk - echo "TIFFLIB_NEEDS_Z = N" >> config.mk - echo "JPEGLIB = libjpeg.so" >> config.mk - echo "JBIGLIB = libjbig.a" >> config.mk - # Insecure - echo "JASPERLIB = NONE" >> config.mk + # Use libraries from Nixpkgs + echo "TIFFLIB = libtiff.so" >> config.mk + echo "TIFFLIB_NEEDS_JPEG = N" >> config.mk + echo "TIFFLIB_NEEDS_Z = N" >> config.mk + echo "JPEGLIB = libjpeg.so" >> config.mk + echo "JBIGLIB = libjbig.a" >> config.mk + # Insecure + echo "JASPERLIB = NONE" >> config.mk - # Fix path to rgb.txt - echo "RGB_DB_PATH = $out/share/netpbm/misc/rgb.txt" >> config.mk - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - echo "LDSHLIB=-dynamiclib -install_name $out/lib/libnetpbm.\$(MAJ).dylib" >> config.mk - echo "NETPBMLIBTYPE = dylib" >> config.mk - echo "NETPBMLIBSUFFIX = dylib" >> config.mk - '' - + '' - runHook postConfigure - ''; + # Fix path to rgb.txt + echo "RGB_DB_PATH = $out/share/netpbm/misc/rgb.txt" >> config.mk + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + echo "LDSHLIB=-dynamiclib -install_name $out/lib/libnetpbm.\$(MAJ).dylib" >> config.mk + echo "NETPBMLIBTYPE = dylib" >> config.mk + echo "NETPBMLIBSUFFIX = dylib" >> config.mk + '' + + '' + runHook postConfigure + ''; env = lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration"; diff --git a/pkgs/by-name/ne/netrw/package.nix b/pkgs/by-name/ne/netrw/package.nix index 0c2f072f190d..989b549d8541 100644 --- a/pkgs/by-name/ne/netrw/package.nix +++ b/pkgs/by-name/ne/netrw/package.nix @@ -22,8 +22,7 @@ stdenv.mkDerivation rec { ]; buildInputs = - lib.optional (checksumType == "mhash") libmhash - ++ lib.optional (checksumType == "openssl") openssl; + lib.optional (checksumType == "mhash") libmhash ++ lib.optional (checksumType == "openssl") openssl; src = fetchurl { urls = [ diff --git a/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix b/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix index aafa2861b401..dbc2551ad2fe 100644 --- a/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix +++ b/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix @@ -47,20 +47,19 @@ stdenv.mkDerivation rec { glib ]; - buildInputs = - [ - openfortivpn - networkmanager - ppp - glib - ] - ++ lib.optionals withGnome [ - gtk3 - gtk4 - libsecret - libnma - libnma-gtk4 - ]; + buildInputs = [ + openfortivpn + networkmanager + ppp + glib + ] + ++ lib.optionals withGnome [ + gtk3 + gtk4 + libsecret + libnma + libnma-gtk4 + ]; configureFlags = [ "--with-gnome=${if withGnome then "yes" else "no"}" diff --git a/pkgs/by-name/ne/networkmanager-iodine/package.nix b/pkgs/by-name/ne/networkmanager-iodine/package.nix index ad6ff0bad876..53e78038bd98 100644 --- a/pkgs/by-name/ne/networkmanager-iodine/package.nix +++ b/pkgs/by-name/ne/networkmanager-iodine/package.nix @@ -41,17 +41,16 @@ stdenv.mkDerivation { glib ]; - buildInputs = - [ - iodine - networkmanager - glib - ] - ++ lib.optionals withGnome [ - gtk3 - libsecret - libnma - ]; + buildInputs = [ + iodine + networkmanager + glib + ] + ++ lib.optionals withGnome [ + gtk3 + libsecret + libnma + ]; configureFlags = [ "--with-gnome=${if withGnome then "yes" else "no"}" diff --git a/pkgs/by-name/ne/networkmanager-l2tp/package.nix b/pkgs/by-name/ne/networkmanager-l2tp/package.nix index 2f726ee47d65..2e840c03bcf8 100644 --- a/pkgs/by-name/ne/networkmanager-l2tp/package.nix +++ b/pkgs/by-name/ne/networkmanager-l2tp/package.nix @@ -38,30 +38,28 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = - [ - autoreconfHook - glib # for gdbus-codegen - pkg-config - ] - ++ lib.optionals withGnome [ - gtk4 # for gtk4-builder-tool - ]; + nativeBuildInputs = [ + autoreconfHook + glib # for gdbus-codegen + pkg-config + ] + ++ lib.optionals withGnome [ + gtk4 # for gtk4-builder-tool + ]; - buildInputs = - [ - networkmanager - ppp - openssl - nss - ] - ++ lib.optionals withGnome [ - gtk3 - gtk4 - libsecret - libnma - libnma-gtk4 - ]; + buildInputs = [ + networkmanager + ppp + openssl + nss + ] + ++ lib.optionals withGnome [ + gtk3 + gtk4 + libsecret + libnma + libnma-gtk4 + ]; configureFlags = [ "--with-gnome=${if withGnome then "yes" else "no"}" diff --git a/pkgs/by-name/ne/networkmanager-openconnect/package.nix b/pkgs/by-name/ne/networkmanager-openconnect/package.nix index 090fe868482b..2fa483df360e 100644 --- a/pkgs/by-name/ne/networkmanager-openconnect/package.nix +++ b/pkgs/by-name/ne/networkmanager-openconnect/package.nix @@ -37,21 +37,20 @@ stdenv.mkDerivation rec { }) ]; - buildInputs = - [ - libxml2 - openconnect - networkmanager - webkitgtk_4_1 # required, for SSO - ] - ++ lib.optionals withGnome [ - gtk3 - libnma - libnma-gtk4 - gtk4 - gcr - libsecret - ]; + buildInputs = [ + libxml2 + openconnect + networkmanager + webkitgtk_4_1 # required, for SSO + ] + ++ lib.optionals withGnome [ + gtk3 + libnma + libnma-gtk4 + gtk4 + gcr + libsecret + ]; nativeBuildInputs = [ glib diff --git a/pkgs/by-name/ne/networkmanager-openvpn/package.nix b/pkgs/by-name/ne/networkmanager-openvpn/package.nix index f2c5684b5356..56e02c52ea7b 100644 --- a/pkgs/by-name/ne/networkmanager-openvpn/package.nix +++ b/pkgs/by-name/ne/networkmanager-openvpn/package.nix @@ -43,18 +43,17 @@ stdenv.mkDerivation (finalAttrs: { libxml2 ]; - buildInputs = - [ - openvpn - networkmanager - ] - ++ lib.optionals withGnome [ - gtk3 - gtk4 - libsecret - libnma - libnma-gtk4 - ]; + buildInputs = [ + openvpn + networkmanager + ] + ++ lib.optionals withGnome [ + gtk3 + gtk4 + libsecret + libnma + libnma-gtk4 + ]; configureFlags = [ "--with-gnome=${if withGnome then "yes" else "no"}" diff --git a/pkgs/by-name/ne/networkmanager-sstp/package.nix b/pkgs/by-name/ne/networkmanager-sstp/package.nix index e2a6547859ca..fb44c80c5e31 100644 --- a/pkgs/by-name/ne/networkmanager-sstp/package.nix +++ b/pkgs/by-name/ne/networkmanager-sstp/package.nix @@ -29,31 +29,29 @@ stdenv.mkDerivation rec { sha256 = "sha256-zd+g86cZLyibLhYLal6XzUb9wFu7kHROp0KzRM95Qng="; }; - nativeBuildInputs = - [ - autoreconfHook - file - gettext - glib # for gdbus-codegen - pkg-config - ] - ++ lib.optionals withGnome [ - gtk4 # for gtk4-builder-tool - ]; + nativeBuildInputs = [ + autoreconfHook + file + gettext + glib # for gdbus-codegen + pkg-config + ] + ++ lib.optionals withGnome [ + gtk4 # for gtk4-builder-tool + ]; - buildInputs = - [ - sstp - networkmanager - ppp - ] - ++ lib.optionals withGnome [ - gtk3 - gtk4 - libsecret - libnma - libnma-gtk4 - ]; + buildInputs = [ + sstp + networkmanager + ppp + ] + ++ lib.optionals withGnome [ + gtk3 + gtk4 + libsecret + libnma + libnma-gtk4 + ]; postPatch = '' sed -i 's#/sbin/pppd#${ppp}/bin/pppd#' src/nm-sstp-service.c diff --git a/pkgs/by-name/ne/networkmanager-vpnc/package.nix b/pkgs/by-name/ne/networkmanager-vpnc/package.nix index 23fd0bc5b595..e5eab9609e70 100644 --- a/pkgs/by-name/ne/networkmanager-vpnc/package.nix +++ b/pkgs/by-name/ne/networkmanager-vpnc/package.nix @@ -39,18 +39,17 @@ stdenv.mkDerivation rec { glib ]; - buildInputs = - [ - vpnc - networkmanager - ] - ++ lib.optionals withGnome [ - gtk3 - gtk4 - libsecret - libnma - libnma-gtk4 - ]; + buildInputs = [ + vpnc + networkmanager + ] + ++ lib.optionals withGnome [ + gtk3 + gtk4 + libsecret + libnma + libnma-gtk4 + ]; configureFlags = [ "--with-gnome=${if withGnome then "yes" else "no"}" diff --git a/pkgs/by-name/ne/neuron/package.nix b/pkgs/by-name/ne/neuron/package.nix index 5456114455d3..b0c5c4901bcd 100644 --- a/pkgs/by-name/ne/neuron/package.nix +++ b/pkgs/by-name/ne/neuron/package.nix @@ -29,18 +29,17 @@ stdenv.mkDerivation (finalAttrs: { # format is for pythonModule conversion format = "other"; - nativeBuildInputs = - [ - cmake - bison - flex - git - ] - ++ optionals useCore [ - perl - gsl - ] - ++ optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; + nativeBuildInputs = [ + cmake + bison + flex + git + ] + ++ optionals useCore [ + perl + gsl + ] + ++ optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; buildInputs = optionals useIv [ xorg.libX11.dev @@ -48,25 +47,24 @@ stdenv.mkDerivation (finalAttrs: { xorg.libXext.dev ]; - propagatedBuildInputs = - [ - readline - python3 - python3.pkgs.wheel - python3.pkgs.setuptools - python3.pkgs.scikit-build - python3.pkgs.matplotlib - ] - ++ optionals useMpi [ - mpi - ] - ++ optionals useMpi [ - python3.pkgs.mpi4py - ] - ++ optionals useRx3d [ - python3.pkgs.cython_0 # NOTE: cython<3 is required as of 8.2.7 - python3.pkgs.numpy - ]; + propagatedBuildInputs = [ + readline + python3 + python3.pkgs.wheel + python3.pkgs.setuptools + python3.pkgs.scikit-build + python3.pkgs.matplotlib + ] + ++ optionals useMpi [ + mpi + ] + ++ optionals useMpi [ + python3.pkgs.mpi4py + ] + ++ optionals useRx3d [ + python3.pkgs.cython_0 # NOTE: cython<3 is required as of 8.2.7 + python3.pkgs.numpy + ]; # Patch build shells for cmake (bin, src, cmake) and submodules (external) postPatch = '' diff --git a/pkgs/by-name/ne/neverest/package.nix b/pkgs/by-name/ne/neverest/package.nix index df08830242d0..c6ed24f3c9e8 100644 --- a/pkgs/by-name/ne/neverest/package.nix +++ b/pkgs/by-name/ne/neverest/package.nix @@ -33,7 +33,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config - ] ++ lib.optional (installManPages || installShellCompletions) installShellFiles; + ] + ++ lib.optional (installManPages || installShellCompletions) installShellFiles; buildInputs = lib.optional (builtins.elem "notmuch" buildFeatures) notmuch; diff --git a/pkgs/by-name/ne/newsboat/package.nix b/pkgs/by-name/ne/newsboat/package.nix index bee26d9c10c8..6d5096570d4a 100644 --- a/pkgs/by-name/ne/newsboat/package.nix +++ b/pkgs/by-name/ne/newsboat/package.nix @@ -38,30 +38,28 @@ rustPlatform.buildRustPackage (finalAttrs: { --replace "ncurses5.4" "ncurses" ''; - nativeBuildInputs = - [ - pkg-config - asciidoctor - gettext - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeWrapper - ncurses - ]; + nativeBuildInputs = [ + pkg-config + asciidoctor + gettext + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeWrapper + ncurses + ]; - buildInputs = - [ - stfl - sqlite - curl - libxml2 - json_c - ncurses - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - gettext - ]; + buildInputs = [ + stfl + sqlite + curl + libxml2 + json_c + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + gettext + ]; env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=deprecated-declarations" ]; @@ -82,15 +80,14 @@ rustPlatform.buildRustPackage (finalAttrs: { make -j $NIX_BUILD_CORES test ''; - postInstall = - '' - make -j $NIX_BUILD_CORES prefix="$out" install - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for prog in $out/bin/*; do - wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${stfl}/lib" - done - ''; + postInstall = '' + make -j $NIX_BUILD_CORES prefix="$out" install + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + for prog in $out/bin/*; do + wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${stfl}/lib" + done + ''; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/ne/newsflash/package.nix b/pkgs/by-name/ne/newsflash/package.nix index 6cfb80f6a20e..d56a32b69163 100644 --- a/pkgs/by-name/ne/newsflash/package.nix +++ b/pkgs/by-name/ne/newsflash/package.nix @@ -65,29 +65,28 @@ stdenv.mkDerivation (finalAttrs: { ]; - buildInputs = - [ - clapper-unwrapped - gtk4 - libadwaita - libxml2 - openssl - sqlite - webkitgtk_6_0 + buildInputs = [ + clapper-unwrapped + gtk4 + libadwaita + libxml2 + openssl + sqlite + webkitgtk_6_0 - # TLS support for loading external content in webkitgtk WebView - glib-networking + # TLS support for loading external content in webkitgtk WebView + glib-networking - # SVG support for gdk-pixbuf - librsvg - ] - ++ (with gst_all_1; [ - # Audio & video support for webkitgtk WebView - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ]); + # SVG support for gdk-pixbuf + librsvg + ] + ++ (with gst_all_1; [ + # Audio & video support for webkitgtk WebView + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ]); passthru.updateScript = gitUpdater { rev-prefix = "v."; diff --git a/pkgs/by-name/ne/newt/package.nix b/pkgs/by-name/ne/newt/package.nix index 94459d70d674..85e051a82f05 100644 --- a/pkgs/by-name/ne/newt/package.nix +++ b/pkgs/by-name/ne/newt/package.nix @@ -34,14 +34,13 @@ stdenv.mkDerivation rec { strictDeps = true; nativeBuildInputs = [ python3 ]; - buildInputs = - [ - slang - popt - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gettext # for darwin with clang - ]; + buildInputs = [ + slang + popt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gettext # for darwin with clang + ]; NIX_LDFLAGS = "-lncurses" @@ -78,11 +77,9 @@ stdenv.mkDerivation rec { ... which is implemented by `runCommand`, ... which has a custom builder and does not run $preDistPhases */ - postBuild = - postBuild - + '' - runPhase pythonImportsCheckPhase - ''; + postBuild = postBuild + '' + runPhase pythonImportsCheckPhase + ''; } ); diff --git a/pkgs/by-name/ne/nextcloud-talk-desktop/package.nix b/pkgs/by-name/ne/nextcloud-talk-desktop/package.nix index df281f33cd44..9260aa8330da 100644 --- a/pkgs/by-name/ne/nextcloud-talk-desktop/package.nix +++ b/pkgs/by-name/ne/nextcloud-talk-desktop/package.nix @@ -45,29 +45,28 @@ stdenv.mkDerivation (finalAttrs: { copyDesktopItems ]; - buildInputs = - [ - nss - cairo - alsa-lib - at-spi2-core - pango - libdrm - libxkbcommon - gtk3 - vivaldi-ffmpeg-codecs - libgbm - libGL - libglvnd - ] - ++ (with xorg; [ - libX11 - libXcomposite - libXdamage - libXrandr - libXfixes - libXcursor - ]); + buildInputs = [ + nss + cairo + alsa-lib + at-spi2-core + pango + libdrm + libxkbcommon + gtk3 + vivaldi-ffmpeg-codecs + libgbm + libGL + libglvnd + ] + ++ (with xorg; [ + libX11 + libXcomposite + libXdamage + libXrandr + libXfixes + libXcursor + ]); # Required to launch the application and proceed past the zygote_linux fork() process # Fixes `Zygote could not fork` diff --git a/pkgs/by-name/ne/nextpnr/package.nix b/pkgs/by-name/ne/nextpnr/package.nix index 30d0fb69093c..fcfbc48c6f9f 100644 --- a/pkgs/by-name/ne/nextpnr/package.nix +++ b/pkgs/by-name/ne/nextpnr/package.nix @@ -54,15 +54,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3 - ] ++ (lib.optional enableGui wrapQtAppsHook); - buildInputs = - [ - boostPython - eigen - python3Packages.apycula - ] - ++ (lib.optional enableGui qtbase) - ++ (lib.optional stdenv.cc.isClang llvmPackages.openmp); + ] + ++ (lib.optional enableGui wrapQtAppsHook); + buildInputs = [ + boostPython + eigen + python3Packages.apycula + ] + ++ (lib.optional enableGui qtbase) + ++ (lib.optional stdenv.cc.isClang llvmPackages.openmp); cmakeFlags = let diff --git a/pkgs/by-name/ne/nexusmods-app/package.nix b/pkgs/by-name/ne/nexusmods-app/package.nix index ddcb75568aa9..783b313bcd8d 100644 --- a/pkgs/by-name/ne/nexusmods-app/package.nix +++ b/pkgs/by-name/ne/nexusmods-app/package.nix @@ -136,22 +136,21 @@ buildDotnetModule (finalAttrs: { "RequiresNetworking!=True" ]; - disabledTests = - [ - # Fails attempting to download game hashes DB from github: - # HttpRequestException : Resource temporarily unavailable (github.com:443) - "NexusMods.DataModel.SchemaVersions.Tests.LegacyDatabaseSupportTests.TestDatabase" - "NexusMods.DataModel.SchemaVersions.Tests.MigrationSpecificTests.TestsFor_0001_ConvertTimestamps.OldTimestampsAreInRange" - "NexusMods.DataModel.SchemaVersions.Tests.MigrationSpecificTests.TestsFor_0003_FixDuplicates.No_Duplicates" - "NexusMods.DataModel.SchemaVersions.Tests.MigrationSpecificTests.TestsFor_0004_RemoveGameFiles.Test" + disabledTests = [ + # Fails attempting to download game hashes DB from github: + # HttpRequestException : Resource temporarily unavailable (github.com:443) + "NexusMods.DataModel.SchemaVersions.Tests.LegacyDatabaseSupportTests.TestDatabase" + "NexusMods.DataModel.SchemaVersions.Tests.MigrationSpecificTests.TestsFor_0001_ConvertTimestamps.OldTimestampsAreInRange" + "NexusMods.DataModel.SchemaVersions.Tests.MigrationSpecificTests.TestsFor_0003_FixDuplicates.No_Duplicates" + "NexusMods.DataModel.SchemaVersions.Tests.MigrationSpecificTests.TestsFor_0004_RemoveGameFiles.Test" - # Fails attempting to fetch SMAPI version data from github: - # https://github.com/erri120/smapi-versions/raw/main/data/game-smapi-versions.json - "NexusMods.Games.StardewValley.Tests.SMAPIGameVersionDiagnosticEmitterTests.Test_TryGetLastSupportedSMAPIVersion" - ] - ++ lib.optionals (!_7zz.meta.unfree) [ - "NexusMods.Games.FOMOD.Tests.FomodXmlInstallerTests.InstallsFilesSimple_UsingRar" - ]; + # Fails attempting to fetch SMAPI version data from github: + # https://github.com/erri120/smapi-versions/raw/main/data/game-smapi-versions.json + "NexusMods.Games.StardewValley.Tests.SMAPIGameVersionDiagnosticEmitterTests.Test_TryGetLastSupportedSMAPIVersion" + ] + ++ lib.optionals (!_7zz.meta.unfree) [ + "NexusMods.Games.FOMOD.Tests.FomodXmlInstallerTests.InstallsFilesSimple_UsingRar" + ]; doInstallCheck = true; diff --git a/pkgs/by-name/ne/nezha/package.nix b/pkgs/by-name/ne/nezha/package.nix index 6dd38fffd15d..d3917939e31c 100644 --- a/pkgs/by-name/ne/nezha/package.nix +++ b/pkgs/by-name/ne/nezha/package.nix @@ -63,21 +63,20 @@ buildGo124Module { proxyVendor = true; - prePatch = - '' - rm -rf cmd/dashboard/*-dist + prePatch = '' + rm -rf cmd/dashboard/*-dist - cp ${frontend-templates} service/singleton/frontend-templates.yaml - '' - + lib.concatStringsSep "\n" ( - map (theme: "cp -r ${theme} cmd/dashboard/${frontendName theme.pname}-dist") ( - [ - nezha-theme-admin - nezha-theme-user - ] - ++ withThemes - ) - ); + cp ${frontend-templates} service/singleton/frontend-templates.yaml + '' + + lib.concatStringsSep "\n" ( + map (theme: "cp -r ${theme} cmd/dashboard/${frontendName theme.pname}-dist") ( + [ + nezha-theme-admin + nezha-theme-user + ] + ++ withThemes + ) + ); patches = [ # Nezha originally used ipinfo.mmdb to provide geoip query feature. diff --git a/pkgs/by-name/nf/nfd/package.nix b/pkgs/by-name/nf/nfd/package.nix index ebf53f721914..a98ec3fcfeae 100644 --- a/pkgs/by-name/nf/nfd/package.nix +++ b/pkgs/by-name/nf/nfd/package.nix @@ -35,18 +35,18 @@ stdenv.mkDerivation rec { sphinx wafHook ]; - buildInputs = - [ - libpcap - ndn-cxx - openssl - ] - ++ lib.optional withWebSocket websocketpp - ++ lib.optional withSystemd systemd; + buildInputs = [ + libpcap + ndn-cxx + openssl + ] + ++ lib.optional withWebSocket websocketpp + ++ lib.optional withSystemd systemd; wafConfigureFlags = [ "--boost-includes=${boost186.dev}/include" "--boost-libs=${boost186.out}/lib" - ] ++ lib.optional (!withWebSocket) "--without-websocket"; + ] + ++ lib.optional (!withWebSocket) "--without-websocket"; meta = with lib; { homepage = "https://named-data.net/"; diff --git a/pkgs/by-name/nf/nfs-utils/package.nix b/pkgs/by-name/nf/nfs-utils/package.nix index f86b25bc3b6c..725267ce727e 100644 --- a/pkgs/by-name/nf/nfs-utils/package.nix +++ b/pkgs/by-name/nf/nfs-utils/package.nix @@ -62,24 +62,23 @@ stdenv.mkDerivation rec { udevCheckHook ]; - buildInputs = - [ - libtirpc - libcap - libevent - sqlite - lvm2 - libuuid - keyutils - libkrb5 - tcp_wrappers - libxml2 - ] - ++ lib.optional enablePython python3 - ++ lib.optionals enableLdap [ - openldap - cyrus_sasl - ]; + buildInputs = [ + libtirpc + libcap + libevent + sqlite + lvm2 + libuuid + keyutils + libkrb5 + tcp_wrappers + libxml2 + ] + ++ lib.optional enablePython python3 + ++ lib.optionals enableLdap [ + openldap + cyrus_sasl + ]; enableParallelBuilding = true; @@ -100,7 +99,8 @@ stdenv.mkDerivation rec { "--with-pluginpath=${placeholder "lib"}/lib/libnfsidmap" # this installs libnfsidmap "--with-rpcgen=${buildPackages.rpcsvc-proto}/bin/rpcgen" "--with-modprobedir=${placeholder "out"}/etc/modprobe.d" - ] ++ lib.optional enableLdap "--enable-ldap"; + ] + ++ lib.optional enableLdap "--enable-ldap"; patches = lib.optionals stdenv.hostPlatform.isMusl [ # http://openwall.com/lists/musl/2015/08/18/10 @@ -158,18 +158,17 @@ stdenv.mkDerivation rec { "etc/systemd/system-generators" ]; - postInstall = - '' - # Not used on NixOS - sed -i \ - -e "s,/sbin/modprobe,${kmod}/bin/modprobe,g" \ - -e "s,/usr/sbin,$out/bin,g" \ - $out/etc/systemd/system/* - '' - + lib.optionalString (!enablePython) '' - # Remove all scripts that require python (currently mountstats and nfsiostat) - grep -l /usr/bin/python $out/bin/* | xargs -I {} rm -v {} - ''; + postInstall = '' + # Not used on NixOS + sed -i \ + -e "s,/sbin/modprobe,${kmod}/bin/modprobe,g" \ + -e "s,/usr/sbin,$out/bin,g" \ + $out/etc/systemd/system/* + '' + + lib.optionalString (!enablePython) '' + # Remove all scripts that require python (currently mountstats and nfsiostat) + grep -l /usr/bin/python $out/bin/* | xargs -I {} rm -v {} + ''; # One test fails on mips. # doCheck = !stdenv.hostPlatform.isMips; diff --git a/pkgs/by-name/nh/nheko/package.nix b/pkgs/by-name/nh/nheko/package.nix index bd1fe4e56900..da6de4c45f93 100644 --- a/pkgs/by-name/nh/nheko/package.nix +++ b/pkgs/by-name/nh/nheko/package.nix @@ -43,36 +43,35 @@ stdenv.mkDerivation rec { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - boost - cmark - coeurl - curl - kdsingleapplication - libevent - libsecret - lmdb - mtxclient - nlohmann_json - olm - qt6Packages.qtbase - qt6Packages.qtimageformats - qt6Packages.qtkeychain - qt6Packages.qtmultimedia - qt6Packages.qttools - qt6Packages.qtwayland - qt6Packages.qt-jdenticon - re2 - spdlog - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - (gst-plugins-good.override { qt6Support = true; }) - gst-plugins-bad - libnice - ]); + buildInputs = [ + boost + cmark + coeurl + curl + kdsingleapplication + libevent + libsecret + lmdb + mtxclient + nlohmann_json + olm + qt6Packages.qtbase + qt6Packages.qtimageformats + qt6Packages.qtkeychain + qt6Packages.qtmultimedia + qt6Packages.qttools + qt6Packages.qtwayland + qt6Packages.qt-jdenticon + re2 + spdlog + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + (gst-plugins-good.override { qt6Support = true; }) + gst-plugins-bad + libnice + ]); cmakeFlags = [ "-DCOMPILE_QML=ON" # see https://github.com/Nheko-Reborn/nheko/issues/389 diff --git a/pkgs/by-name/ni/nickel/package.nix b/pkgs/by-name/ni/nickel/package.nix index 2b6c51bc0bdb..4490a05942cb 100644 --- a/pkgs/by-name/ni/nickel/package.nix +++ b/pkgs/by-name/ni/nickel/package.nix @@ -31,14 +31,13 @@ rustPlatform.buildRustPackage (finalAttrs: { "-p nickel-lang-lsp" ]; - nativeBuildInputs = - [ - python3 - gitMinimal - ] - ++ lib.optionals enableNixImport [ - pkg-config - ]; + nativeBuildInputs = [ + python3 + gitMinimal + ] + ++ lib.optionals enableNixImport [ + pkg-config + ]; buildInputs = lib.optionals enableNixImport [ nixVersions.nix_2_24 diff --git a/pkgs/by-name/ni/nim-2_2/package.nix b/pkgs/by-name/ni/nim-2_2/package.nix index 61f58db18dae..322d3711f903 100644 --- a/pkgs/by-name/ni/nim-2_2/package.nix +++ b/pkgs/by-name/ni/nim-2_2/package.nix @@ -104,38 +104,37 @@ let # Use the custom configuration ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin $out/etc + mkdir -p $out/bin $out/etc - cp -r config $out/etc/nim - - for binpath in ${nimUnwrapped}/bin/nim?*; do - local binname=`basename $binpath` - makeWrapper \ - $binpath $out/bin/${targetPlatformConfig}-$binname \ - $wrapperArgs - ln -s $out/bin/${targetPlatformConfig}-$binname $out/bin/$binname - done + cp -r config $out/etc/nim + for binpath in ${nimUnwrapped}/bin/nim?*; do + local binname=`basename $binpath` makeWrapper \ - ${nimUnwrapped}/nim/bin/nim $out/bin/${targetPlatformConfig}-nim \ - --set-default CC $(command -v $CC) \ - --set-default CXX $(command -v $CXX) \ + $binpath $out/bin/${targetPlatformConfig}-$binname \ $wrapperArgs - ln -s $out/bin/${targetPlatformConfig}-nim $out/bin/nim + ln -s $out/bin/${targetPlatformConfig}-$binname $out/bin/$binname + done - makeWrapper \ - ${nimUnwrapped}/bin/testament $out/bin/${targetPlatformConfig}-testament \ - $wrapperArgs - ln -s $out/bin/${targetPlatformConfig}-testament $out/bin/testament + makeWrapper \ + ${nimUnwrapped}/nim/bin/nim $out/bin/${targetPlatformConfig}-nim \ + --set-default CC $(command -v $CC) \ + --set-default CXX $(command -v $CXX) \ + $wrapperArgs + ln -s $out/bin/${targetPlatformConfig}-nim $out/bin/nim - '' - + '' - runHook postInstall - ''; + makeWrapper \ + ${nimUnwrapped}/bin/testament $out/bin/${targetPlatformConfig}-testament \ + $wrapperArgs + ln -s $out/bin/${targetPlatformConfig}-testament $out/bin/testament + + '' + + '' + runHook postInstall + ''; passthru = nimUnwrapped.passthru // { inherit wrapNim; diff --git a/pkgs/by-name/ni/nim-unwrapped-2_2/package.nix b/pkgs/by-name/ni/nim-unwrapped-2_2/package.nix index f2a00ece01c0..eeed61094494 100644 --- a/pkgs/by-name/ni/nim-unwrapped-2_2/package.nix +++ b/pkgs/by-name/ni/nim-unwrapped-2_2/package.nix @@ -134,14 +134,13 @@ stdenv.mkDerivation (finalAttrs: { runHook postConfigure ''; - kochArgs = - [ - "--cpu:${nimHost.cpu}" - "--os:${nimHost.os}" - "-d:release" - "-d:useGnuReadline" - ] - ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) "-d:nativeStacktrace"; + kochArgs = [ + "--cpu:${nimHost.cpu}" + "--os:${nimHost.os}" + "-d:release" + "-d:useGnuReadline" + ] + ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) "-d:nativeStacktrace"; preBuild = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' substituteInPlace makefile \ diff --git a/pkgs/by-name/ni/ninja/package.nix b/pkgs/by-name/ni/ninja/package.nix index 25be8510ad35..9ddb6ed58174 100644 --- a/pkgs/by-name/ni/ninja/package.nix +++ b/pkgs/by-name/ni/ninja/package.nix @@ -40,18 +40,17 @@ stdenv.mkDerivation (finalAttrs: { depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - python3 - re2c - installShellFiles - ] - ++ lib.optionals buildDocs [ - asciidoc - docbook_xml_dtd_45 - docbook_xsl - libxslt.bin - ]; + nativeBuildInputs = [ + python3 + re2c + installShellFiles + ] + ++ lib.optionals buildDocs [ + asciidoc + docbook_xml_dtd_45 + docbook_xsl + libxslt.bin + ]; # TODO: remove together with ninja 1.11 patches = lib.optionals (lib.versionOlder finalAttrs.version "1.12") [ @@ -67,48 +66,46 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace configure.py --replace "subprocess.check_call(rebuild_args)" "open('rebuild_args','w').write(rebuild_args[0])" ''; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - # for list of env vars - # see https://github.com/ninja-build/ninja/blob/v1.11.1/configure.py#L264 - CXX="$CXX_FOR_BUILD" \ - AR="$AR_FOR_BUILD" \ - CFLAGS="$CFLAGS_FOR_BUILD" \ - CXXFLAGS="$CXXFLAGS_FOR_BUILD" \ - LDFLAGS="$LDFLAGS_FOR_BUILD" \ - python configure.py --bootstrap - python configure.py + # for list of env vars + # see https://github.com/ninja-build/ninja/blob/v1.11.1/configure.py#L264 + CXX="$CXX_FOR_BUILD" \ + AR="$AR_FOR_BUILD" \ + CFLAGS="$CFLAGS_FOR_BUILD" \ + CXXFLAGS="$CXXFLAGS_FOR_BUILD" \ + LDFLAGS="$LDFLAGS_FOR_BUILD" \ + python configure.py --bootstrap + python configure.py - source rebuild_args - '' - + lib.optionalString buildDocs '' - # "./ninja -vn manual" output copied here to support cross compilation. - asciidoc -b docbook -d book -o build/manual.xml doc/manual.asciidoc - xsltproc --nonet doc/docbook.xsl build/manual.xml > doc/manual.html - '' - + '' + source rebuild_args + '' + + lib.optionalString buildDocs '' + # "./ninja -vn manual" output copied here to support cross compilation. + asciidoc -b docbook -d book -o build/manual.xml doc/manual.asciidoc + xsltproc --nonet doc/docbook.xsl build/manual.xml > doc/manual.html + '' + + '' - runHook postBuild - ''; + runHook postBuild + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - install -Dm555 -t $out/bin ninja - installShellCompletion --name ninja \ - --bash misc/bash-completion \ - --zsh misc/zsh-completion - '' - + lib.optionalString buildDocs '' - install -Dm444 -t $out/share/doc/ninja doc/manual.asciidoc doc/manual.html - '' - + '' + install -Dm555 -t $out/bin ninja + installShellCompletion --name ninja \ + --bash misc/bash-completion \ + --zsh misc/zsh-completion + '' + + lib.optionalString buildDocs '' + install -Dm444 -t $out/share/doc/ninja doc/manual.asciidoc doc/manual.html + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; setupHook = ./setup-hook.sh; diff --git a/pkgs/by-name/ni/niri/package.nix b/pkgs/by-name/ni/niri/package.nix index 5aa083245bc9..3aa293d2802e 100644 --- a/pkgs/by-name/ni/niri/package.nix +++ b/pkgs/by-name/ni/niri/package.nix @@ -58,21 +58,20 @@ rustPlatform.buildRustPackage (finalAttrs: { rustPlatform.bindgenHook ]; - buildInputs = - [ - libdisplay-info - libglvnd # For libEGL - libinput - libxkbcommon - libgbm - pango - seatd - wayland # For libwayland-client - ] - ++ lib.optional (withDbus || withScreencastSupport || withSystemd) dbus - ++ lib.optional withScreencastSupport pipewire - ++ lib.optional withSystemd systemd # Includes libudev - ++ lib.optional (!withSystemd) eudev; # Use an alternative libudev implementation when building w/o systemd + buildInputs = [ + libdisplay-info + libglvnd # For libEGL + libinput + libxkbcommon + libgbm + pango + seatd + wayland # For libwayland-client + ] + ++ lib.optional (withDbus || withScreencastSupport || withSystemd) dbus + ++ lib.optional withScreencastSupport pipewire + ++ lib.optional withSystemd systemd # Includes libudev + ++ lib.optional (!withSystemd) eudev; # Use an alternative libudev implementation when building w/o systemd buildFeatures = lib.optional withDbus "dbus" @@ -81,31 +80,30 @@ rustPlatform.buildRustPackage (finalAttrs: { ++ lib.optional withSystemd "systemd"; buildNoDefaultFeatures = true; - postInstall = - '' - install -Dm0644 README.md resources/default-config.kdl -t $doc/share/doc/niri - mv wiki $doc/share/doc/niri/wiki + postInstall = '' + install -Dm0644 README.md resources/default-config.kdl -t $doc/share/doc/niri + mv wiki $doc/share/doc/niri/wiki - install -Dm0644 resources/niri.desktop -t $out/share/wayland-sessions - '' - + lib.optionalString withDbus '' - install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal - '' - + lib.optionalString (withSystemd || withDinit) '' - install -Dm0755 resources/niri-session -t $out/bin - '' - + lib.optionalString withSystemd '' - install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/lib/systemd/user - '' - + lib.optionalString withDinit '' - install -Dm0644 resources/dinit/niri{-shutdown,} -t $out/lib/dinit.d/user - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd $pname \ - --bash <($out/bin/niri completions bash) \ - --fish <($out/bin/niri completions fish) \ - --zsh <($out/bin/niri completions zsh) - ''; + install -Dm0644 resources/niri.desktop -t $out/share/wayland-sessions + '' + + lib.optionalString withDbus '' + install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal + '' + + lib.optionalString (withSystemd || withDinit) '' + install -Dm0755 resources/niri-session -t $out/bin + '' + + lib.optionalString withSystemd '' + install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/lib/systemd/user + '' + + lib.optionalString withDinit '' + install -Dm0644 resources/dinit/niri{-shutdown,} -t $out/lib/dinit.d/user + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd $pname \ + --bash <($out/bin/niri completions bash) \ + --fish <($out/bin/niri completions fish) \ + --zsh <($out/bin/niri completions zsh) + ''; env = { # Force linking with libEGL and libwayland-client diff --git a/pkgs/by-name/ni/nix-doc/package.nix b/pkgs/by-name/ni/nix-doc/package.nix index 121bef315ea2..dc6684e32e90 100644 --- a/pkgs/by-name/ni/nix-doc/package.nix +++ b/pkgs/by-name/ni/nix-doc/package.nix @@ -11,15 +11,14 @@ }: let - packageFlags = - [ - "-p" - "nix-doc" - ] - ++ lib.optionals withPlugin [ - "-p" - "nix-doc-plugin" - ]; + packageFlags = [ + "-p" + "nix-doc" + ] + ++ lib.optionals withPlugin [ + "-p" + "nix-doc-plugin" + ]; in rustPlatform.buildRustPackage rec { pname = "nix-doc"; diff --git a/pkgs/by-name/ni/nix-template/package.nix b/pkgs/by-name/ni/nix-template/package.nix index 6d09eaac0024..23ba1f520e2c 100644 --- a/pkgs/by-name/ni/nix-template/package.nix +++ b/pkgs/by-name/ni/nix-template/package.nix @@ -34,18 +34,17 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl ]; # needed for nix-prefetch-url - postInstall = - '' - wrapProgram $out/bin/nix-template \ - --prefix PATH : ${lib.makeBinPath [ nix ]} + postInstall = '' + wrapProgram $out/bin/nix-template \ + --prefix PATH : ${lib.makeBinPath [ nix ]} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd nix-template \ - --bash <($out/bin/nix-template completions bash) \ - --fish <($out/bin/nix-template completions fish) \ - --zsh <($out/bin/nix-template completions zsh) - ''; + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd nix-template \ + --bash <($out/bin/nix-template completions bash) \ + --fish <($out/bin/nix-template completions fish) \ + --zsh <($out/bin/nix-template completions zsh) + ''; meta = { description = "Make creating nix expressions easy"; diff --git a/pkgs/by-name/ni/nix-top/package.nix b/pkgs/by-name/ni/nix-top/package.nix index fa69693781e0..1f5717ed7ccb 100644 --- a/pkgs/by-name/ni/nix-top/package.nix +++ b/pkgs/by-name/ni/nix-top/package.nix @@ -36,20 +36,19 @@ stdenv.mkDerivation rec { buildInputs = [ ruby ]; - installPhase = - '' - runHook preInstall - mkdir -p $out/libexec/nix-top - install -D -m755 ./nix-top $out/bin/nix-top - wrapProgram $out/bin/nix-top \ - --prefix PATH : "$out/libexec/nix-top:${additionalPath}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - ln -s /bin/stty $out/libexec/nix-top - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p $out/libexec/nix-top + install -D -m755 ./nix-top $out/bin/nix-top + wrapProgram $out/bin/nix-top \ + --prefix PATH : "$out/libexec/nix-top:${additionalPath}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + ln -s /bin/stty $out/libexec/nix-top + '' + + '' + runHook postInstall + ''; meta = { description = "Tracks what nix is building"; diff --git a/pkgs/by-name/ni/nix-unit/package.nix b/pkgs/by-name/ni/nix-unit/package.nix index 04c10a01c9cc..4b8659e0d75d 100644 --- a/pkgs/by-name/ni/nix-unit/package.nix +++ b/pkgs/by-name/ni/nix-unit/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: { ninja # nlohmann_json can be only discovered via cmake files cmake - ] ++ lib.optional stdenv.cc.isClang [ clang-tools ]; + ] + ++ lib.optional stdenv.cc.isClang [ clang-tools ]; postInstall = '' wrapProgram "$out/bin/nix-unit" --prefix PATH : ${difftastic}/bin diff --git a/pkgs/by-name/ni/nix-weather/package.nix b/pkgs/by-name/ni/nix-weather/package.nix index ad43b5ecfd34..445841aebd67 100644 --- a/pkgs/by-name/ni/nix-weather/package.nix +++ b/pkgs/by-name/ni/nix-weather/package.nix @@ -28,14 +28,13 @@ rustPlatform.buildRustPackage rec { cargoExtraArgs = "-p nix-weather"; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - openssl - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; outputs = [ "out" diff --git a/pkgs/by-name/ni/nixpkgs-review/package.nix b/pkgs/by-name/ni/nixpkgs-review/package.nix index e31e2c4590a9..cf4712af5579 100644 --- a/pkgs/by-name/ni/nixpkgs-review/package.nix +++ b/pkgs/by-name/ni/nixpkgs-review/package.nix @@ -40,13 +40,12 @@ python3Packages.buildPythonApplication rec { python3Packages.argcomplete ]; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals withAutocomplete [ - python3Packages.argcomplete - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals withAutocomplete [ + python3Packages.argcomplete + ]; nativeCheckInputs = [ versionCheckHook @@ -55,15 +54,14 @@ python3Packages.buildPythonApplication rec { makeWrapperArgs = let - binPath = - [ - nix - git - ] - ++ lib.optional withSandboxSupport bubblewrap - ++ lib.optional withNom nix-output-monitor - ++ lib.optional withDelta delta - ++ lib.optional withGlow glow; + binPath = [ + nix + git + ] + ++ lib.optional withSandboxSupport bubblewrap + ++ lib.optional withNom nix-output-monitor + ++ lib.optional withDelta delta + ++ lib.optional withGlow glow; in [ "--prefix PATH : ${lib.makeBinPath binPath}" diff --git a/pkgs/by-name/ni/nixtract/package.nix b/pkgs/by-name/ni/nixtract/package.nix index 71bc900fed88..a3d3388f7f4e 100644 --- a/pkgs/by-name/ni/nixtract/package.nix +++ b/pkgs/by-name/ni/nixtract/package.nix @@ -27,11 +27,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; nativeCheckInputs = [ nix ]; diff --git a/pkgs/by-name/nl/nlohmann_json/package.nix b/pkgs/by-name/nl/nlohmann_json/package.nix index de18f352ab5f..4d07976f3021 100644 --- a/pkgs/by-name/nl/nlohmann_json/package.nix +++ b/pkgs/by-name/nl/nlohmann_json/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation (finalAttrs: { "-DJSON_BuildTests=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" "-DJSON_FastTests=ON" "-DJSON_MultipleHeaders=ON" - ] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}"; + ] + ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}"; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; diff --git a/pkgs/by-name/nl/nlopt/package.nix b/pkgs/by-name/nl/nlopt/package.nix index 51386f659748..5a78662322e8 100644 --- a/pkgs/by-name/nl/nlopt/package.nix +++ b/pkgs/by-name/nl/nlopt/package.nix @@ -86,42 +86,42 @@ clangStdenv.mkDerivation (finalAttrs: { --replace-fail 'libdir=''${exec_prefix}/@NLOPT_INSTALL_LIBDIR@' 'libdir=@NLOPT_INSTALL_LIBDIR@' ''; - nativeBuildInputs = - [ cmake ] - ## Building the python bindings requires SWIG, and numpy in addition to the CXX routines. - ## The tests also make use of the same interpreter to test the bindings. - ++ lib.optionals withPython [ - swig - buildPythonBindingsEnv - ] - ## Building the java bindings requires SWIG, C++, JNI and Java - ++ lib.optionals withJava [ - swig - jdk - ] - ## Building octave bindings requires `mkoctfile` to be installed. - ++ lib.optional withOctave octave; + nativeBuildInputs = [ + cmake + ] + ## Building the python bindings requires SWIG, and numpy in addition to the CXX routines. + ## The tests also make use of the same interpreter to test the bindings. + ++ lib.optionals withPython [ + swig + buildPythonBindingsEnv + ] + ## Building the java bindings requires SWIG, C++, JNI and Java + ++ lib.optionals withJava [ + swig + jdk + ] + ## Building octave bindings requires `mkoctfile` to be installed. + ++ lib.optional withOctave octave; # Python bindings depend on numpy at import time. propagatedBuildInputs = lib.optional withPython python3Packages.numpy; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_SHARED_LIBS" (!withStatic)) - (lib.cmakeBool "NLOPT_CXX" true) - (lib.cmakeBool "NLOPT_PYTHON" withPython) - (lib.cmakeBool "NLOPT_OCTAVE" withOctave) - (lib.cmakeBool "NLOPT_JAVA" withJava) - (lib.cmakeBool "NLOPT_SWIG" (withPython || withJava)) - (lib.cmakeBool "NLOPT_FORTRAN" false) - (lib.cmakeBool "NLOPT_MATLAB" false) - (lib.cmakeBool "NLOPT_GUILE" false) - (lib.cmakeBool "NLOPT_LUKSAN" (!withoutLuksanSolvers)) - (lib.cmakeBool "NLOPT_TESTS" finalAttrs.doCheck) - ] - ++ lib.optional withPython ( - lib.cmakeFeature "Python_EXECUTABLE" "${buildPythonBindingsEnv.interpreter}" - ); + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" (!withStatic)) + (lib.cmakeBool "NLOPT_CXX" true) + (lib.cmakeBool "NLOPT_PYTHON" withPython) + (lib.cmakeBool "NLOPT_OCTAVE" withOctave) + (lib.cmakeBool "NLOPT_JAVA" withJava) + (lib.cmakeBool "NLOPT_SWIG" (withPython || withJava)) + (lib.cmakeBool "NLOPT_FORTRAN" false) + (lib.cmakeBool "NLOPT_MATLAB" false) + (lib.cmakeBool "NLOPT_GUILE" false) + (lib.cmakeBool "NLOPT_LUKSAN" (!withoutLuksanSolvers)) + (lib.cmakeBool "NLOPT_TESTS" finalAttrs.doCheck) + ] + ++ lib.optional withPython ( + lib.cmakeFeature "Python_EXECUTABLE" "${buildPythonBindingsEnv.interpreter}" + ); postBuild = '' ${buildDocsEnv.interpreter} -m mkdocs build \ diff --git a/pkgs/by-name/nn/nng/package.nix b/pkgs/by-name/nn/nng/package.nix index bd70e8f8260f..316712c12b12 100644 --- a/pkgs/by-name/nn/nng/package.nix +++ b/pkgs/by-name/nn/nng/package.nix @@ -22,19 +22,19 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja - ] ++ lib.optionals mbedtlsSupport [ mbedtls ]; + ] + ++ lib.optionals mbedtlsSupport [ mbedtls ]; buildInputs = lib.optionals mbedtlsSupport [ mbedtls ]; - cmakeFlags = - [ - "-G Ninja" - (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) - ] - ++ lib.optionals mbedtlsSupport [ - "-DMBEDTLS_ROOT_DIR=${mbedtls}" - "-DNNG_ENABLE_TLS=ON" - ]; + cmakeFlags = [ + "-G Ninja" + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + ] + ++ lib.optionals mbedtlsSupport [ + "-DMBEDTLS_ROOT_DIR=${mbedtls}" + "-DNNG_ENABLE_TLS=ON" + ]; meta = with lib; { homepage = "https://nng.nanomsg.org/"; diff --git a/pkgs/by-name/nn/nnn/package.nix b/pkgs/by-name/nn/nnn/package.nix index 568eba6e28c8..74e828d06e08 100644 --- a/pkgs/by-name/nn/nnn/package.nix +++ b/pkgs/by-name/nn/nnn/package.nix @@ -52,24 +52,24 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper pkg-config ]; - buildInputs = - [ - readline - ncurses - ] - ++ lib.optional stdenv.hostPlatform.isMusl musl-fts - ++ lib.optional withPcre pcre; + buildInputs = [ + readline + ncurses + ] + ++ lib.optional stdenv.hostPlatform.isMusl musl-fts + ++ lib.optional withPcre pcre; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-I${musl-fts}/include"; NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts"; - makeFlags = - [ "PREFIX=$(out)" ] - ++ lib.optionals withIcons [ "O_ICONS=1" ] - ++ lib.optionals withNerdIcons [ "O_NERD=1" ] - ++ lib.optionals withEmojis [ "O_EMOJI=1" ] - ++ lib.optionals withPcre [ "O_PCRE=1" ] - ++ extraMakeFlags; + makeFlags = [ + "PREFIX=$(out)" + ] + ++ lib.optionals withIcons [ "O_ICONS=1" ] + ++ lib.optionals withNerdIcons [ "O_NERD=1" ] + ++ lib.optionals withEmojis [ "O_EMOJI=1" ] + ++ lib.optionals withPcre [ "O_PCRE=1" ] + ++ extraMakeFlags; binPath = lib.makeBinPath [ file diff --git a/pkgs/by-name/no/node-problem-detector/package.nix b/pkgs/by-name/no/node-problem-detector/package.nix index c0cd62ad3cba..cae72f0452f7 100644 --- a/pkgs/by-name/no/node-problem-detector/package.nix +++ b/pkgs/by-name/no/node-problem-detector/package.nix @@ -27,7 +27,8 @@ buildGoModule rec { # https://github.com/kubernetes/node-problem-detector/blob/master/Makefile subPackages = [ "cmd/nodeproblemdetector" - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "cmd/logcounter" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "cmd/logcounter" ]; preBuild = '' export CGO_ENABLED=${if stdenv.hostPlatform.isLinux then "1" else "0"} diff --git a/pkgs/by-name/no/nodehun/package.nix b/pkgs/by-name/no/nodehun/package.nix index d903cf04e92d..4cfc9cf9dabe 100644 --- a/pkgs/by-name/no/nodehun/package.nix +++ b/pkgs/by-name/no/nodehun/package.nix @@ -32,7 +32,8 @@ buildNpmPackage { nativeBuildInputs = [ node-gyp python3 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ]; postInstall = '' # Only keep the necessary parts of build/Release to reduce closure size diff --git a/pkgs/by-name/no/nomacs/package.nix b/pkgs/by-name/no/nomacs/package.nix index 9de9d0d728ae..ac699f437056 100644 --- a/pkgs/by-name/no/nomacs/package.nix +++ b/pkgs/by-name/no/nomacs/package.nix @@ -36,10 +36,11 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-gcRc4KoWJQ5BirhLuk+c+5HwBeyQtlJ3iyX492DXeVk="; }; - outputs = - [ "out" ] - # man pages are not installed on Darwin, see cmake/{Mac,Unix}BuildTarget.cmake - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "man" ]; + outputs = [ + "out" + ] + # man pages are not installed on Darwin, see cmake/{Mac,Unix}BuildTarget.cmake + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "man" ]; sourceRoot = "${finalAttrs.src.name}/ImageLounge"; @@ -56,24 +57,23 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - exiv2 - libraw - libtiff - # Once python stops relying on `propagatedBuildInputs` (https://github.com/NixOS/nixpkgs/issues/272178), deprecate `cxxdev` and switch to `dev`; - # note `dev` is selected by `mkDerivation` automatically, so one should omit `getOutput "dev"`; - # see: https://github.com/NixOS/nixpkgs/pull/314186#issuecomment-2129974277 - (lib.getOutput "cxxdev" opencv4) - ] - ++ (with myQt; [ - kimageformats - qtbase - qtimageformats - qtsvg - qttools - quazip - ]); + buildInputs = [ + exiv2 + libraw + libtiff + # Once python stops relying on `propagatedBuildInputs` (https://github.com/NixOS/nixpkgs/issues/272178), deprecate `cxxdev` and switch to `dev`; + # note `dev` is selected by `mkDerivation` automatically, so one should omit `getOutput "dev"`; + # see: https://github.com/NixOS/nixpkgs/pull/314186#issuecomment-2129974277 + (lib.getOutput "cxxdev" opencv4) + ] + ++ (with myQt; [ + kimageformats + qtbase + qtimageformats + qtsvg + qttools + quazip + ]); cmakeFlags = [ (lib.cmakeBool "ENABLE_OPENCV" true) diff --git a/pkgs/by-name/no/normcap/package.nix b/pkgs/by-name/no/normcap/package.nix index 9dac2ad18be9..2ea6ac1581f9 100644 --- a/pkgs/by-name/no/normcap/package.nix +++ b/pkgs/by-name/no/normcap/package.nix @@ -16,15 +16,14 @@ let ps = python3.pkgs; - wrapperDeps = - [ - leptonica - tesseract4 - libnotify - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wl-clipboard - ]; + wrapperDeps = [ + leptonica + tesseract4 + libnotify + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wl-clipboard + ]; in @@ -51,14 +50,13 @@ ps.buildPythonApplication rec { "shiboken6" ]; - build-system = - [ - ps.hatchling - ps.babel - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ps.toml - ]; + build-system = [ + ps.hatchling + ps.babel + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ps.toml + ]; nativeBuildInputs = [ copyDesktopItems @@ -70,36 +68,35 @@ ps.buildPythonApplication rec { ps.toml ]; - preFixup = - '' - makeWrapperArgs+=( - "''${qtWrapperArgs[@]}" - --set QT_QPA_PLATFORM xcb - --prefix PATH : ${lib.makeBinPath wrapperDeps} - ) - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # cursed fix on GNOME+wayland - # this works because systemd-run runs the command as an ad-hoc service named run-1234567890.service - # FIXME: make something like `--slice=app-com.github.dynobo.normcap.slice` - # work such that the "screenshot screenshot" permission in - # `flatpak permissions` is associated with the xdg app id - # "com.github.dynobo.normcap" and not "" - makeWrapperArgs+=( - --run ' - if command -v systemd-run >/dev/null; then - exec -a "$0" systemd-run --wait --user \ - --setenv=PATH="$PATH" \ - --setenv=PYTHONNOUSERSITE="$PYTHONNOUSERSITE" \ - --setenv=QT_QPA_PLATFORM="$QT_QPA_PLATFORM" \ - ${placeholder "out"}/bin/.normcap-wrapped "$@" - else - exec -a "$0" ${placeholder "out"}/bin/.normcap-wrapped "$@" - fi - exit $? - ' - ) - ''; + preFixup = '' + makeWrapperArgs+=( + "''${qtWrapperArgs[@]}" + --set QT_QPA_PLATFORM xcb + --prefix PATH : ${lib.makeBinPath wrapperDeps} + ) + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # cursed fix on GNOME+wayland + # this works because systemd-run runs the command as an ad-hoc service named run-1234567890.service + # FIXME: make something like `--slice=app-com.github.dynobo.normcap.slice` + # work such that the "screenshot screenshot" permission in + # `flatpak permissions` is associated with the xdg app id + # "com.github.dynobo.normcap" and not "" + makeWrapperArgs+=( + --run ' + if command -v systemd-run >/dev/null; then + exec -a "$0" systemd-run --wait --user \ + --setenv=PATH="$PATH" \ + --setenv=PYTHONNOUSERSITE="$PYTHONNOUSERSITE" \ + --setenv=QT_QPA_PLATFORM="$QT_QPA_PLATFORM" \ + ${placeholder "out"}/bin/.normcap-wrapped "$@" + else + exec -a "$0" ${placeholder "out"}/bin/.normcap-wrapped "$@" + fi + exit $? + ' + ) + ''; postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' mkdir -p $out/share/pixmaps @@ -119,16 +116,15 @@ ps.buildPythonApplication rec { xorg.xvfb ]; - preCheck = - '' - export HOME=$(mktemp -d) - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # setup a virtual x11 display - export DISPLAY=:$((2000 + $RANDOM % 1000)) - Xvfb $DISPLAY -screen 5 1024x768x8 & - xvfb_pid=$! - ''; + preCheck = '' + export HOME=$(mktemp -d) + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # setup a virtual x11 display + export DISPLAY=:$((2000 + $RANDOM % 1000)) + Xvfb $DISPLAY -screen 5 1024x768x8 & + xvfb_pid=$! + ''; postCheck = lib.optionalString stdenv.hostPlatform.isLinux '' # cleanup the virtual x11 display @@ -136,65 +132,63 @@ ps.buildPythonApplication rec { kill $xvfb_pid ''; - disabledTests = - [ - # requires a wayland session (no xclip support) - "test_wl_copy" - # RuntimeError: Please destroy the QApplication singleton before creating a new QApplication instance - "test_get_application" - # times out, unknown why - "test_update_checker_triggers_checked_signal" - # touches network - "test_urls_reachable" - # requires xdg - "test_synchronized_capture" - # flaky - "test_normcap_ocr_testcases" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # requires display - "test_send_via_qt_tray" - "test_screens" - # requires impure pbcopy - "test_get_copy_func_with_pbcopy" - "test_get_copy_func_without_pbcopy" - "test_perform_pbcopy" - "test_pbcopy" - "test_copy" - # NSXPCSharedListener endpointForReply:withListenerName:replyErrorCode: - # while obtaining endpoint 'ClientCallsAuxiliary': Connection interrupted - # since v5.0.0 - "test_introduction_initialize_checkbox_state" - "test_introduction_checkbox_sets_return_code" - "test_introduction_toggle_checkbox_changes_return_code" - "test_show_introduction" - ]; + disabledTests = [ + # requires a wayland session (no xclip support) + "test_wl_copy" + # RuntimeError: Please destroy the QApplication singleton before creating a new QApplication instance + "test_get_application" + # times out, unknown why + "test_update_checker_triggers_checked_signal" + # touches network + "test_urls_reachable" + # requires xdg + "test_synchronized_capture" + # flaky + "test_normcap_ocr_testcases" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # requires display + "test_send_via_qt_tray" + "test_screens" + # requires impure pbcopy + "test_get_copy_func_with_pbcopy" + "test_get_copy_func_without_pbcopy" + "test_perform_pbcopy" + "test_pbcopy" + "test_copy" + # NSXPCSharedListener endpointForReply:withListenerName:replyErrorCode: + # while obtaining endpoint 'ClientCallsAuxiliary': Connection interrupted + # since v5.0.0 + "test_introduction_initialize_checkbox_state" + "test_introduction_checkbox_sets_return_code" + "test_introduction_toggle_checkbox_changes_return_code" + "test_show_introduction" + ]; - disabledTestPaths = - [ - # touches network - "tests/tests_gui/test_downloader.py" - # fails to import, causes pytest to freeze - "tests/tests_gui/test_language_manager.py" - # RuntimeError("Internal C++ object (PySide6.QtGui.QHideEvent) already deleted.") - # AttributeError("'LoadingIndicator' object has no attribute 'timer'") - "tests/tests_gui/test_loading_indicator.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # requires a display - "tests/integration/test_normcap.py" - "tests/integration/test_tray_menu.py" - "tests/integration/test_settings_menu.py" - "tests/tests_clipboard/test_handlers/test_qtclipboard.py" - "tests/tests_gui/test_tray.py" - "tests/tests_gui/test_window.py" - "tests/tests_screengrab/" - # failure unknown, crashes in first test with `.show()` - "tests/tests_gui/test_loading_indicator.py" - "tests/tests_gui/test_menu_button.py" - "tests/tests_gui/test_resources.py" - "tests/tests_gui/test_update_check.py" - ]; + disabledTestPaths = [ + # touches network + "tests/tests_gui/test_downloader.py" + # fails to import, causes pytest to freeze + "tests/tests_gui/test_language_manager.py" + # RuntimeError("Internal C++ object (PySide6.QtGui.QHideEvent) already deleted.") + # AttributeError("'LoadingIndicator' object has no attribute 'timer'") + "tests/tests_gui/test_loading_indicator.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # requires a display + "tests/integration/test_normcap.py" + "tests/integration/test_tray_menu.py" + "tests/integration/test_settings_menu.py" + "tests/tests_clipboard/test_handlers/test_qtclipboard.py" + "tests/tests_gui/test_tray.py" + "tests/tests_gui/test_window.py" + "tests/tests_screengrab/" + # failure unknown, crashes in first test with `.show()` + "tests/tests_gui/test_loading_indicator.py" + "tests/tests_gui/test_menu_button.py" + "tests/tests_gui/test_resources.py" + "tests/tests_gui/test_update_check.py" + ]; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/no/nostr-rs-relay/package.nix b/pkgs/by-name/no/nostr-rs-relay/package.nix index f4d73ca1ccbe..a4b9d2c7fb54 100644 --- a/pkgs/by-name/no/nostr-rs-relay/package.nix +++ b/pkgs/by-name/no/nostr-rs-relay/package.nix @@ -22,11 +22,12 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-hrq9EEUot9painlXVGjIh+NMlrH4iRQ28U3PLGnvYsw="; - buildInputs = - [ openssl.dev ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl.dev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; nativeBuildInputs = [ pkg-config # for openssl diff --git a/pkgs/by-name/no/notcurses/package.nix b/pkgs/by-name/no/notcurses/package.nix index d6508d2a1142..0c7af4913fe5 100644 --- a/pkgs/by-name/no/notcurses/package.nix +++ b/pkgs/by-name/no/notcurses/package.nix @@ -37,15 +37,14 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - libdeflate - libunistring - ncurses - zlib - ] - ++ lib.optional qrcodegenSupport qrcodegen - ++ lib.optional multimediaSupport ffmpeg; + buildInputs = [ + libdeflate + libunistring + ncurses + zlib + ] + ++ lib.optional qrcodegenSupport qrcodegen + ++ lib.optional multimediaSupport ffmpeg; cmakeFlags = lib.optional (qrcodegenSupport) "-DUSE_QRCODEGEN=ON" diff --git a/pkgs/by-name/no/notifymuch/package.nix b/pkgs/by-name/no/notifymuch/package.nix index dbbe1aacc8f8..2cfbd9cae380 100644 --- a/pkgs/by-name/no/notifymuch/package.nix +++ b/pkgs/by-name/no/notifymuch/package.nix @@ -21,15 +21,14 @@ python3.pkgs.buildPythonApplication { sha256 = "1lssr7iv43mp5v6nzrfbqlfzx8jcc7m636wlfyhhnd8ydd39n6k4"; }; - propagatedBuildInputs = - [ - libnotify - gtk3 - ] - ++ (with python3.pkgs; [ - notmuch - pygobject3 - ]); + propagatedBuildInputs = [ + libnotify + gtk3 + ] + ++ (with python3.pkgs; [ + notmuch + pygobject3 + ]); nativeBuildInputs = [ gobject-introspection diff --git a/pkgs/by-name/no/noto-fonts/package.nix b/pkgs/by-name/no/noto-fonts/package.nix index c7bc38dc574c..8e2e6151c4ca 100644 --- a/pkgs/by-name/no/noto-fonts/package.nix +++ b/pkgs/by-name/no/noto-fonts/package.nix @@ -36,43 +36,42 @@ stdenvNoCC.mkDerivation rec { _variants = map (variant: builtins.replaceStrings [ " " ] [ "" ] variant) variants; - installPhase = - '' - # We check availability in order of variable -> otf -> ttf - # unhinted -- the hinted versions use autohint - # maintaining maximum coverage. - # - # We have a mix of otf and ttf fonts - local out_font=$out/share/fonts/noto + installPhase = '' + # We check availability in order of variable -> otf -> ttf + # unhinted -- the hinted versions use autohint + # maintaining maximum coverage. + # + # We have a mix of otf and ttf fonts + local out_font=$out/share/fonts/noto - install -m444 -Dt $megamerge/share/fonts/truetype/ megamerge/*.ttf - '' - + ( - if _variants == [ ] then - '' - for folder in $(ls -d fonts/*/); do - if [[ -d "$folder"unhinted/variable-ttf ]]; then - install -m444 -Dt $out_font "$folder"unhinted/variable-ttf/*.ttf - elif [[ -d "$folder"unhinted/otf ]]; then - install -m444 -Dt $out_font "$folder"unhinted/otf/*.otf - else - install -m444 -Dt $out_font "$folder"unhinted/ttf/*.ttf - fi - done - '' - else - '' - for variant in $_variants; do - if [[ -d fonts/"$variant"/unhinted/variable-ttf ]]; then - install -m444 -Dt $out_font fonts/"$variant"/unhinted/variable-ttf/*.ttf - elif [[ -d fonts/"$variant"/unhinted/otf ]]; then - install -m444 -Dt $out_font fonts/"$variant"/unhinted/otf/*.otf - else - install -m444 -Dt $out_font fonts/"$variant"/unhinted/ttf/*.ttf - fi - done - '' - ); + install -m444 -Dt $megamerge/share/fonts/truetype/ megamerge/*.ttf + '' + + ( + if _variants == [ ] then + '' + for folder in $(ls -d fonts/*/); do + if [[ -d "$folder"unhinted/variable-ttf ]]; then + install -m444 -Dt $out_font "$folder"unhinted/variable-ttf/*.ttf + elif [[ -d "$folder"unhinted/otf ]]; then + install -m444 -Dt $out_font "$folder"unhinted/otf/*.otf + else + install -m444 -Dt $out_font "$folder"unhinted/ttf/*.ttf + fi + done + '' + else + '' + for variant in $_variants; do + if [[ -d fonts/"$variant"/unhinted/variable-ttf ]]; then + install -m444 -Dt $out_font fonts/"$variant"/unhinted/variable-ttf/*.ttf + elif [[ -d fonts/"$variant"/unhinted/otf ]]; then + install -m444 -Dt $out_font fonts/"$variant"/unhinted/otf/*.otf + else + install -m444 -Dt $out_font fonts/"$variant"/unhinted/ttf/*.ttf + fi + done + '' + ); passthru.updateScript = gitUpdater { rev-prefix = "noto-monthly-release-"; diff --git a/pkgs/by-name/no/novops/package.nix b/pkgs/by-name/no/novops/package.nix index 7c6317b72216..5155c95715b9 100644 --- a/pkgs/by-name/no/novops/package.nix +++ b/pkgs/by-name/no/novops/package.nix @@ -23,13 +23,12 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-F+JIAHk28qpJy97aQQup1Ss5G1p4LQzkj1ptjBhp1CY="; - buildInputs = - [ - openssl # required for openssl-sys - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl # required for openssl-sys + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ + libiconv + ]; nativeBuildInputs = [ installShellFiles diff --git a/pkgs/by-name/np/np2kai/package.nix b/pkgs/by-name/np/np2kai/package.nix index 8ed66b71bdfe..ad771287fc13 100644 --- a/pkgs/by-name/np/np2kai/package.nix +++ b/pkgs/by-name/np/np2kai/package.nix @@ -61,29 +61,27 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals enableX11 [ - pkg-config - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals enableX11 [ + pkg-config + ]; - buildInputs = - [ - libusb1 - openssl - SDL2 - SDL2_ttf - SDL2_mixer - ] - ++ lib.optionals enableX11 [ - fontconfig - freetype - glib - gtk2 - libX11 - ]; + buildInputs = [ + libusb1 + openssl + SDL2 + SDL2_ttf + SDL2_mixer + ] + ++ lib.optionals enableX11 [ + fontconfig + freetype + glib + gtk2 + libX11 + ]; cmakeFlags = [ (lib.cmakeBool "BUILD_SDL" true) diff --git a/pkgs/by-name/ns/ns-3/package.nix b/pkgs/by-name/ns/ns-3/package.nix index a252d24f4bc9..e41e6bc7b6f4 100644 --- a/pkgs/by-name/ns/ns-3/package.nix +++ b/pkgs/by-name/ns/ns-3/package.nix @@ -151,7 +151,8 @@ stdenv.mkDerivation rec { "-DNS3_ASSERT=ON" "-DNS3_GTK3=ON" "-DGTK3_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include" - ] ++ lib.optional doCheck "-DNS3_TESTS=ON"; + ] + ++ lib.optional doCheck "-DNS3_TESTS=ON"; # strictoverflow prevents clang from discovering pyembed when bindings hardeningDisable = [ diff --git a/pkgs/by-name/ns/nsis/package.nix b/pkgs/by-name/ns/nsis/package.nix index 7d93e463090e..6950c3af6909 100644 --- a/pkgs/by-name/ns/nsis/package.nix +++ b/pkgs/by-name/ns/nsis/package.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation rec { "SKIPMISC=all" "NSIS_CONFIG_CONST_DATA=no" "VERSION=${version}" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "APPEND_LINKFLAGS=-liconv"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "APPEND_LINKFLAGS=-liconv"; preBuild = '' sconsFlagsArray+=( diff --git a/pkgs/by-name/ns/nsncd/package.nix b/pkgs/by-name/ns/nsncd/package.nix index 7618db6a9df4..ad31ca0a902a 100644 --- a/pkgs/by-name/ns/nsncd/package.nix +++ b/pkgs/by-name/ns/nsncd/package.nix @@ -25,27 +25,26 @@ rustPlatform.buildRustPackage { useFetchCargoVendor = true; cargoHash = "sha256-9M8Y0WwXFlrpRleSQPYDpnjNnxKGvrtO6Istl9qM30M="; - checkFlags = - [ - # Relies on the test environment to be able to resolve "localhost" - # on IPv4. That's not the case in the Nix sandbox somehow. Works - # when running cargo test impurely on a (NixOS|Debian) machine. - "--skip=ffi::test_gethostbyname2_r" + checkFlags = [ + # Relies on the test environment to be able to resolve "localhost" + # on IPv4. That's not the case in the Nix sandbox somehow. Works + # when running cargo test impurely on a (NixOS|Debian) machine. + "--skip=ffi::test_gethostbyname2_r" - # Relies on /etc/services to be present? - "--skip=handlers::test::test_handle_getservbyname_name" - "--skip=handlers::test::test_handle_getservbyname_name_proto" - "--skip=handlers::test::test_handle_getservbyport_port" - "--skip=handlers::test::test_handle_getservbyport_port_proto" - "--skip=handlers::test::test_handle_getservbyport_port_proto_aliases" - ] - ++ lib.optionals stdenv.hostPlatform.isBigEndian [ - # Expected serialisation output in tests doesn't account for endianness differences - # https://github.com/twosigma/nsncd/issues/160 - "--skip=handlers::test::test_hostent_serialization" - "--skip=handlers::test::test_innetgroup_serialization_in_group" - "--skip=handlers::test::test_netgroup_serialization" - ]; + # Relies on /etc/services to be present? + "--skip=handlers::test::test_handle_getservbyname_name" + "--skip=handlers::test::test_handle_getservbyname_name_proto" + "--skip=handlers::test::test_handle_getservbyport_port" + "--skip=handlers::test::test_handle_getservbyport_port_proto" + "--skip=handlers::test::test_handle_getservbyport_port_proto_aliases" + ] + ++ lib.optionals stdenv.hostPlatform.isBigEndian [ + # Expected serialisation output in tests doesn't account for endianness differences + # https://github.com/twosigma/nsncd/issues/160 + "--skip=handlers::test::test_hostent_serialization" + "--skip=handlers::test::test_innetgroup_serialization_in_group" + "--skip=handlers::test::test_netgroup_serialization" + ]; meta = with lib; { description = "Name service non-caching daemon"; diff --git a/pkgs/by-name/ns/nspr/package.nix b/pkgs/by-name/ns/nspr/package.nix index 236cdff3d954..2a313799da78 100644 --- a/pkgs/by-name/ns/nspr/package.nix +++ b/pkgs/by-name/ns/nspr/package.nix @@ -25,21 +25,21 @@ stdenv.mkDerivation rec { ]; outputBin = "dev"; - preConfigure = - '' - cd nspr - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure --replace '@executable_path/' "$out/lib/" - substituteInPlace configure.in --replace '@executable_path/' "$out/lib/" - ''; + preConfigure = '' + cd nspr + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure --replace '@executable_path/' "$out/lib/" + substituteInPlace configure.in --replace '@executable_path/' "$out/lib/" + ''; HOST_CC = "cc"; depsBuildBuild = [ buildPackages.stdenv.cc ]; configureFlags = [ "--enable-optimize" "--disable-debug" - ] ++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit"; + ] + ++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit"; postInstall = '' find $out -name "*.a" -delete diff --git a/pkgs/by-name/ns/nsxiv/package.nix b/pkgs/by-name/ns/nsxiv/package.nix index f19b9e12a9fc..739b1cdb59d4 100644 --- a/pkgs/by-name/ns/nsxiv/package.nix +++ b/pkgs/by-name/ns/nsxiv/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation (finalAttrs: { libXft libexif libwebp - ] ++ lib.optional stdenv.hostPlatform.isDarwin libinotify-kqueue; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libinotify-kqueue; postPatch = lib.optionalString (conf != null) '' cp ${(builtins.toFile "config.def.h" conf)} config.def.h diff --git a/pkgs/by-name/nt/ntbtls/package.nix b/pkgs/by-name/nt/ntbtls/package.nix index 96e00f37d0b6..effcae04a68e 100644 --- a/pkgs/by-name/nt/ntbtls/package.nix +++ b/pkgs/by-name/nt/ntbtls/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { libgpg-error libksba zlib - ] ++ lib.optional stdenv.hostPlatform.isDarwin gettext; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gettext; postInstall = '' moveToOutput "bin/ntbtls-config" $dev diff --git a/pkgs/by-name/nt/ntfs3g/package.nix b/pkgs/by-name/nt/ntfs3g/package.nix index 0c02ede8667f..43b91dfc0f82 100644 --- a/pkgs/by-name/nt/ntfs3g/package.nix +++ b/pkgs/by-name/nt/ntfs3g/package.nix @@ -32,18 +32,17 @@ stdenv.mkDerivation rec { sha256 = "sha256-nuFTsGkm3zmSzpwmhyY7Ke0VZfZU0jHOzEWaLBbglQk="; }; - buildInputs = - [ - gettext - libuuid - ] - ++ lib.optionals crypto [ - gnutls - libgcrypt - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - macfuse-stubs - ]; + buildInputs = [ + gettext + libuuid + ] + ++ lib.optionals crypto [ + gnutls + libgcrypt + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + macfuse-stubs + ]; # Note: libgcrypt is listed here non-optionally because its m4 macros are # being used in ntfs-3g's configure.ac. @@ -59,21 +58,20 @@ stdenv.mkDerivation rec { ./consistent-sbindir-usage.patch ]; - configureFlags = - [ - "--disable-ldconfig" - "--exec-prefix=\${prefix}" - "--enable-mount-helper" - "--enable-posix-acls" - "--enable-xattr-mappings" - "--${if crypto then "enable" else "disable"}-crypto" - "--enable-extras" - "--with-mount-helper=${mount}/bin/mount" - "--with-umount-helper=${mount}/bin/umount" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--with-modprobe-helper=${kmod}/bin/modprobe" - ]; + configureFlags = [ + "--disable-ldconfig" + "--exec-prefix=\${prefix}" + "--enable-mount-helper" + "--enable-posix-acls" + "--enable-xattr-mappings" + "--${if crypto then "enable" else "disable"}-crypto" + "--enable-extras" + "--with-mount-helper=${mount}/bin/mount" + "--with-umount-helper=${mount}/bin/umount" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--with-modprobe-helper=${kmod}/bin/modprobe" + ]; postInstall = '' # Prefer ntfs-3g over the ntfs driver in the kernel. diff --git a/pkgs/by-name/nt/ntl/package.nix b/pkgs/by-name/nt/ntl/package.nix index 1eff2a017640..41a6191654d9 100644 --- a/pkgs/by-name/nt/ntl/package.nix +++ b/pkgs/by-name/nt/ntl/package.nix @@ -42,25 +42,24 @@ stdenv.mkDerivation rec { configurePlatforms = [ ]; # reference: http://shoup.net/ntl/doc/tour-unix.html - configureFlags = - [ - "DEF_PREFIX=$(out)" - "SHARED=on" # genereate a shared library (as well as static) - "NATIVE=off" # don't target code to current hardware (reproducibility, portability) - "TUNE=${ - if tune then - "auto" - else if stdenv.hostPlatform.isx86 then - "x86" # "chooses options that should be well suited for most x86 platforms" - else - "generic" # "chooses options that should be OK for most platforms" - }" - "CXX=${stdenv.cc.targetPrefix}c++" - ] - ++ lib.optionals withGf2x [ - "NTL_GF2X_LIB=on" - "GF2X_PREFIX=${gf2x}" - ]; + configureFlags = [ + "DEF_PREFIX=$(out)" + "SHARED=on" # genereate a shared library (as well as static) + "NATIVE=off" # don't target code to current hardware (reproducibility, portability) + "TUNE=${ + if tune then + "auto" + else if stdenv.hostPlatform.isx86 then + "x86" # "chooses options that should be well suited for most x86 platforms" + else + "generic" # "chooses options that should be OK for most platforms" + }" + "CXX=${stdenv.cc.targetPrefix}c++" + ] + ++ lib.optionals withGf2x [ + "NTL_GF2X_LIB=on" + "GF2X_PREFIX=${gf2x}" + ]; doCheck = true; # takes some time diff --git a/pkgs/by-name/nt/ntp/package.nix b/pkgs/by-name/nt/ntp/package.nix index 2d97a87c33b7..3f1fb3134c68 100644 --- a/pkgs/by-name/nt/ntp/package.nix +++ b/pkgs/by-name/nt/ntp/package.nix @@ -31,19 +31,19 @@ stdenv.mkDerivation rec { "--with-openssl-incdir=${openssl.dev}/include" "--enable-ignore-dns-errors" "--with-yielding-select=yes" - ] ++ lib.optional stdenv.hostPlatform.isLinux "--enable-linuxcaps"; + ] + ++ lib.optional stdenv.hostPlatform.isLinux "--enable-linuxcaps"; nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ - openssl - perl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pps-tools - libcap - ]; + buildInputs = [ + openssl + perl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pps-tools + libcap + ]; hardeningEnable = [ "pie" ]; diff --git a/pkgs/by-name/nu/nulloy/package.nix b/pkgs/by-name/nu/nulloy/package.nix index 9355fcc1d24d..d534ef78020a 100644 --- a/pkgs/by-name/nu/nulloy/package.nix +++ b/pkgs/by-name/nu/nulloy/package.nix @@ -31,19 +31,18 @@ stdenv.mkDerivation rec { qt5.wrapQtAppsHook ]; - buildInputs = - [ - qt5.qtscript - qt5.qtsvg - taglib - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - ]); + buildInputs = [ + qt5.qtscript + qt5.qtsvg + taglib + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + ]); prefixKey = "--prefix "; diff --git a/pkgs/by-name/nu/nut/package.nix b/pkgs/by-name/nu/nut/package.nix index 0088afa9d34e..a73f4b20ce81 100644 --- a/pkgs/by-name/nu/nut/package.nix +++ b/pkgs/by-name/nu/nut/package.nix @@ -97,20 +97,19 @@ stdenv.mkDerivation rec { ]; doInstallCheck = true; - configureFlags = - [ - "--with-all" - "--with-ssl" - "--without-powerman" # Until we have it ... - "--with-systemdsystempresetdir=$(out)/lib/systemd/system-preset" - "--with-systemdsystemunitdir=$(out)/lib/systemd/system" - "--with-systemdshutdowndir=$(out)/lib/systemd/system-shutdown" - "--with-systemdtmpfilesdir=$(out)/lib/tmpfiles.d" - "--with-udev-dir=$(out)/etc/udev" - ] - ++ (lib.lists.optionals withApcModbus [ - "--with-modbus+usb" - ]); + configureFlags = [ + "--with-all" + "--with-ssl" + "--without-powerman" # Until we have it ... + "--with-systemdsystempresetdir=$(out)/lib/systemd/system-preset" + "--with-systemdsystemunitdir=$(out)/lib/systemd/system" + "--with-systemdshutdowndir=$(out)/lib/systemd/system-shutdown" + "--with-systemdtmpfilesdir=$(out)/lib/tmpfiles.d" + "--with-udev-dir=$(out)/etc/udev" + ] + ++ (lib.lists.optionals withApcModbus [ + "--with-modbus+usb" + ]); enableParallelBuilding = true; diff --git a/pkgs/by-name/nv/nvc/package.nix b/pkgs/by-name/nv/nvc/package.nix index 5ea9205a74fe..fa37dc010a35 100644 --- a/pkgs/by-name/nv/nvc/package.nix +++ b/pkgs/by-name/nv/nvc/package.nix @@ -41,16 +41,15 @@ stdenv.mkDerivation rec { which ]; - buildInputs = - [ - libffi - llvm - zlib - zstd - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ - elfutils - ]; + buildInputs = [ + libffi + llvm + zlib + zstd + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ + elfutils + ]; preConfigure = '' mkdir build diff --git a/pkgs/by-name/nv/nvidia-texture-tools/package.nix b/pkgs/by-name/nv/nvidia-texture-tools/package.nix index 72cd0054518c..5dcdb20088cf 100644 --- a/pkgs/by-name/nv/nvidia-texture-tools/package.nix +++ b/pkgs/by-name/nv/nvidia-texture-tools/package.nix @@ -16,17 +16,16 @@ stdenv.mkDerivation { hash = "sha256-BYNm8CxPQbfmnnzNmOQ2Dc8HSyO8mkqzYsBZ5T80398="; }; - postPatch = - '' - # Make a recently added pure virtual function just virtual, - # to keep compatibility. - sed -i 's/virtual void endImage() = 0;/virtual void endImage() {}/' src/nvtt/nvtt.h - '' - + lib.optionalString stdenv.hostPlatform.isAarch64 '' - # remove x86_64-only libraries - sed -i '/bc1enc/d' src/nvtt/tests/CMakeLists.txt - sed -i '/libsquish/d;/CMP_Core/d' extern/CMakeLists.txt - ''; + postPatch = '' + # Make a recently added pure virtual function just virtual, + # to keep compatibility. + sed -i 's/virtual void endImage() = 0;/virtual void endImage() {}/' src/nvtt/nvtt.h + '' + + lib.optionalString stdenv.hostPlatform.isAarch64 '' + # remove x86_64-only libraries + sed -i '/bc1enc/d' src/nvtt/tests/CMakeLists.txt + sed -i '/libsquish/d;/CMP_Core/d' extern/CMakeLists.txt + ''; outputs = [ "out" diff --git a/pkgs/by-name/nw/nwg-displays/package.nix b/pkgs/by-name/nw/nwg-displays/package.nix index 6d5472762fd9..17551b18c230 100644 --- a/pkgs/by-name/nw/nwg-displays/package.nix +++ b/pkgs/by-name/nw/nwg-displays/package.nix @@ -34,19 +34,18 @@ python3Packages.buildPythonApplication rec { gtk3 ]; - propagatedBuildInputs = - [ - atk - gdk-pixbuf - gtk-layer-shell - pango - python3Packages.gst-python - python3Packages.i3ipc - python3Packages.pygobject3 - ] - ++ lib.optionals hyprlandSupport [ - wlr-randr - ]; + propagatedBuildInputs = [ + atk + gdk-pixbuf + gtk-layer-shell + pango + python3Packages.gst-python + python3Packages.i3ipc + python3Packages.pygobject3 + ] + ++ lib.optionals hyprlandSupport [ + wlr-randr + ]; dontWrapGApps = true; diff --git a/pkgs/by-name/nx/nxengine-evo/package.nix b/pkgs/by-name/nx/nxengine-evo/package.nix index ab0129f0f6b1..7ef2b10a3522 100644 --- a/pkgs/by-name/nx/nxengine-evo/package.nix +++ b/pkgs/by-name/nx/nxengine-evo/package.nix @@ -61,21 +61,20 @@ stdenv.mkDerivation (finalAttrs: { sed -i -e "s,/usr/share/,$out/share/," src/ResourceManager.cpp ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - cd .. - mkdir -p $out/bin/ $out/share/nxengine/ - install bin/* $out/bin/ - '' - + '' - cp -r ${finalAttrs.finalPackage.assets}/share/nxengine/data $out/share/nxengine/data - chmod -R a=r,a+X $out/share/nxengine/data - '' - + '' - runHook postInstall - ''; + cd .. + mkdir -p $out/bin/ $out/share/nxengine/ + install bin/* $out/bin/ + '' + + '' + cp -r ${finalAttrs.finalPackage.assets}/share/nxengine/data $out/share/nxengine/data + chmod -R a=r,a+X $out/share/nxengine/data + '' + + '' + runHook postInstall + ''; passthru = { assets = callPackage ./assets.nix { }; diff --git a/pkgs/by-name/nz/nzportable/fteqw.nix b/pkgs/by-name/nz/nzportable/fteqw.nix index f62497e7d5cd..d81cabef1c42 100644 --- a/pkgs/by-name/nz/nzportable/fteqw.nix +++ b/pkgs/by-name/nz/nzportable/fteqw.nix @@ -59,32 +59,31 @@ stdenv.mkDerivation (finalAttrs: { gettext ]; - buildInputs = - [ - libGL - xorg.libX11 - xorg.libXrandr - xorg.libXcursor - xorg.libXScrnSaver - dbus - fontconfig - libjpeg - libpng - alsa-lib - libogg - libvorbis - libopus - SDL2 - gnutls - zlib - bullet - ] - ++ lib.optional enableEGL libglvnd - ++ lib.optionals enableWayland [ - wayland - libxkbcommon - ] - ++ lib.optional enableVulkan vulkan-headers; + buildInputs = [ + libGL + xorg.libX11 + xorg.libXrandr + xorg.libXcursor + xorg.libXScrnSaver + dbus + fontconfig + libjpeg + libpng + alsa-lib + libogg + libvorbis + libopus + SDL2 + gnutls + zlib + bullet + ] + ++ lib.optional enableEGL libglvnd + ++ lib.optionals enableWayland [ + wayland + libxkbcommon + ] + ++ lib.optional enableVulkan vulkan-headers; cmakeFlags = [ (lib.cmakeFeature "FTE_BUILD_CONFIG" "${finalAttrs.src}/engine/common/config_nzportable.h") @@ -109,31 +108,30 @@ stdenv.mkDerivation (finalAttrs: { # Some of them are also just deprecated by better backend options # (SDL audio is preferred over ALSA, OpenAL and PulseAudio, for example) - libs = - [ - addDriverRunpath.driverLink + libs = [ + addDriverRunpath.driverLink - # gl/gl_vidlinuxglx.c - xorg.libX11 - xorg.libXrandr - xorg.libXxf86vm - xorg.libXxf86dga - xorg.libXi - xorg.libXcursor - libGL + # gl/gl_vidlinuxglx.c + xorg.libX11 + xorg.libXrandr + xorg.libXxf86vm + xorg.libXxf86dga + xorg.libXi + xorg.libXcursor + libGL - libvorbis + libvorbis - sqlite # server/sv_sql.c + sqlite # server/sv_sql.c - SDL2 # a lot of different files - gnutls # common/net_ssl_gnutls.c - openexr # client/image.c + SDL2 # a lot of different files + gnutls # common/net_ssl_gnutls.c + openexr # client/image.c - (placeholder "out") - ] - ++ lib.optional enableWayland wayland - ++ lib.optional enableVulkan vulkan-loader; + (placeholder "out") + ] + ++ lib.optional enableWayland wayland + ++ lib.optional enableVulkan vulkan-loader; in '' wrapProgram $out/bin/fteqw \ diff --git a/pkgs/by-name/oc/ocl-icd/package.nix b/pkgs/by-name/oc/ocl-icd/package.nix index f09d08ed9125..9be8bfc2c38a 100644 --- a/pkgs/by-name/oc/ocl-icd/package.nix +++ b/pkgs/by-name/oc/ocl-icd/package.nix @@ -26,14 +26,13 @@ stdenv.mkDerivation rec { buildInputs = [ opencl-headers ] ++ lib.optionals stdenv.hostPlatform.isWindows [ windows.dlfcn ]; - configureFlags = - [ - "--enable-custom-vendordir=/run/opengl-driver/etc/OpenCL/vendors" - ] - ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ]; + configureFlags = [ + "--enable-custom-vendordir=/run/opengl-driver/etc/OpenCL/vendors" + ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; # fixes: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified makeFlags = lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS=-no-undefined" ]; diff --git a/pkgs/by-name/oc/ocrodjvu/package.nix b/pkgs/by-name/oc/ocrodjvu/package.nix index ecd5bce8a5f6..d06e2710d837 100644 --- a/pkgs/by-name/oc/ocrodjvu/package.nix +++ b/pkgs/by-name/oc/ocrodjvu/package.nix @@ -34,12 +34,11 @@ python3Packages.buildPythonApplication rec { setuptools ]; - propagatedBuildInputs = - [ - ] - ++ lib.optional withCuneiform cuneiform - ++ lib.optional withGocr gocr - ++ lib.optional withOcrad ocrad; + propagatedBuildInputs = [ + ] + ++ lib.optional withCuneiform cuneiform + ++ lib.optional withGocr gocr + ++ lib.optional withOcrad ocrad; dependencies = with python3Packages; [ lxml diff --git a/pkgs/by-name/oc/ocsinventory-agent/package.nix b/pkgs/by-name/oc/ocsinventory-agent/package.nix index d0a30f65e027..1a3ef373e127 100644 --- a/pkgs/by-name/oc/ocsinventory-agent/package.nix +++ b/pkgs/by-name/oc/ocsinventory-agent/package.nix @@ -78,22 +78,21 @@ perlPackages.buildPerlPackage rec { postInstall = let - runtimeDependencies = - [ - coreutils # uname, cut, df, stat, uptime - findutils # find - inetutils # ifconfig - ipmitool # ipmitool - nmap # nmap - pciutils # lspci - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - dmidecode # dmidecode - iproute2 # ip - lvm2 # pvs - usbutils # lsusb - util-linux # last, lsblk, mount - ]; + runtimeDependencies = [ + coreutils # uname, cut, df, stat, uptime + findutils # find + inetutils # ifconfig + ipmitool # ipmitool + nmap # nmap + pciutils # lspci + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + dmidecode # dmidecode + iproute2 # ip + lvm2 # pvs + usbutils # lsusb + util-linux # last, lsblk, mount + ]; in lib.optionalString stdenv.hostPlatform.isDarwin '' shortenPerlShebang $out/bin/ocsinventory-agent diff --git a/pkgs/by-name/oc/octoprint/package.nix b/pkgs/by-name/oc/octoprint/package.nix index bf07003c3765..3d74b0a2e0b8 100644 --- a/pkgs/by-name/oc/octoprint/package.nix +++ b/pkgs/by-name/oc/octoprint/package.nix @@ -210,7 +210,8 @@ let disabledTests = [ "test_check_setup" # Why should it be able to call pip? - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_set_external_modification" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_set_external_modification" ]; disabledTestPaths = [ "tests/test_octoprint_setuptools.py" # fails due to distutils and python3.12 ]; diff --git a/pkgs/by-name/oc/octopus/package.nix b/pkgs/by-name/oc/octopus/package.nix index bf3ed7143ede..60eb732a24a7 100644 --- a/pkgs/by-name/oc/octopus/package.nix +++ b/pkgs/by-name/oc/octopus/package.nix @@ -68,7 +68,8 @@ stdenv.mkDerivation rec { spglib metis (python3.withPackages (ps: [ ps.pyyaml ])) - ] ++ lib.optional enableMpi scalapack; + ] + ++ lib.optional enableMpi scalapack; propagatedBuildInputs = lib.optional enableMpi mpi; propagatedUserEnvPkgs = lib.optional enableMpi mpi; diff --git a/pkgs/by-name/oc/oculante/package.nix b/pkgs/by-name/oc/oculante/package.nix index 3c59d77be355..bdcb157806d7 100644 --- a/pkgs/by-name/oc/oculante/package.nix +++ b/pkgs/by-name/oc/oculante/package.nix @@ -42,21 +42,20 @@ rustPlatform.buildRustPackage rec { wrapGAppsHook3 ]; - buildInputs = - [ - openssl - fontconfig - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGL - libX11 - libXcursor - libXi - libXrandr - gtk3 - libxkbcommon - wayland - ]; + buildInputs = [ + openssl + fontconfig + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGL + libX11 + libXcursor + libXi + libXrandr + gtk3 + libxkbcommon + wayland + ]; checkFlags = [ "--skip=bench" diff --git a/pkgs/by-name/od/odamex/package.nix b/pkgs/by-name/od/odamex/package.nix index 02092d42991a..bdd7e84f33e2 100644 --- a/pkgs/by-name/od/odamex/package.nix +++ b/pkgs/by-name/od/odamex/package.nix @@ -33,25 +33,24 @@ stdenv.mkDerivation rec { wxGTK32 ]; - installPhase = - '' - runHook preInstall - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir -p $out/{Applications,bin} - mv odalaunch/odalaunch.app $out/Applications - makeWrapper $out/{Applications/odalaunch.app/Contents/MacOS,bin}/odalaunch - '' - else - '' - make install - '' - ) - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p $out/{Applications,bin} + mv odalaunch/odalaunch.app $out/Applications + makeWrapper $out/{Applications/odalaunch.app/Contents/MacOS,bin}/odalaunch + '' + else + '' + make install + '' + ) + + '' + runHook postInstall + ''; meta = { homepage = "http://odamex.net/"; diff --git a/pkgs/by-name/of/offpunk/package.nix b/pkgs/by-name/of/offpunk/package.nix index 2359e9a0ff91..c827ff42c7f8 100644 --- a/pkgs/by-name/of/offpunk/package.nix +++ b/pkgs/by-name/of/offpunk/package.nix @@ -30,23 +30,22 @@ python3Packages.buildPythonApplication rec { nativeBuildInputs = [ installShellFiles ]; - dependencies = - [ - file - less - timg - xdg-utils - xsel - ] - ++ (with python3Packages; [ - beautifulsoup4 - chardet - cryptography - feedparser - readability-lxml - requests - setproctitle - ]); + dependencies = [ + file + less + timg + xdg-utils + xsel + ] + ++ (with python3Packages; [ + beautifulsoup4 + chardet + cryptography + feedparser + readability-lxml + requests + setproctitle + ]); postInstall = '' installManPage man/*.1 diff --git a/pkgs/by-name/oi/oils-for-unix/package.nix b/pkgs/by-name/oi/oils-for-unix/package.nix index d80018085d8e..b0e23b3e4ced 100644 --- a/pkgs/by-name/oi/oils-for-unix/package.nix +++ b/pkgs/by-name/oi/oils-for-unix/package.nix @@ -55,14 +55,13 @@ stdenv.mkDerivation rec { # whereas running it outside of Nix with clang version 15.0.0 generates just a warning. The shell seems to # work just fine though, so we disable the error here. env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types"; - configureFlags = - [ - "--datarootdir=${placeholder "out"}" - ] - ++ lib.optionals withReadline [ - "--with-readline" - "--readline=${readline-all}" - ]; + configureFlags = [ + "--datarootdir=${placeholder "out"}" + ] + ++ lib.optionals withReadline [ + "--with-readline" + "--readline=${readline-all}" + ]; meta = { description = "Unix shell with JSON-compatible structured data. It's our upgrade path from bash to a better language and runtime"; diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix index ee48d94116c3..4f6524dca320 100644 --- a/pkgs/by-name/ol/ollama/package.nix +++ b/pkgs/by-name/ol/ollama/package.nix @@ -88,21 +88,20 @@ let cudaPath = lib.removeSuffix "-${cudaMajorVersion}" cudaToolkit; - wrapperOptions = - [ - # ollama embeds llama-cpp binaries which actually run the ai models - # these llama-cpp binaries are unaffected by the ollama binary's DT_RUNPATH - # LD_LIBRARY_PATH is temporarily required to use the gpu - # until these llama-cpp binaries can have their runpath patched - "--suffix LD_LIBRARY_PATH : '${addDriverRunpath.driverLink}/lib'" - ] - ++ lib.optionals enableRocm [ - "--suffix LD_LIBRARY_PATH : '${rocmPath}/lib'" - "--set-default HIP_PATH '${rocmPath}'" - ] - ++ lib.optionals enableCuda [ - "--suffix LD_LIBRARY_PATH : '${lib.makeLibraryPath (map lib.getLib cudaLibs)}'" - ]; + wrapperOptions = [ + # ollama embeds llama-cpp binaries which actually run the ai models + # these llama-cpp binaries are unaffected by the ollama binary's DT_RUNPATH + # LD_LIBRARY_PATH is temporarily required to use the gpu + # until these llama-cpp binaries can have their runpath patched + "--suffix LD_LIBRARY_PATH : '${addDriverRunpath.driverLink}/lib'" + ] + ++ lib.optionals enableRocm [ + "--suffix LD_LIBRARY_PATH : '${rocmPath}/lib'" + "--set-default HIP_PATH '${rocmPath}'" + ] + ++ lib.optionals enableCuda [ + "--suffix LD_LIBRARY_PATH : '${lib.makeLibraryPath (map lib.getLib cudaLibs)}'" + ]; wrapperArgs = builtins.concatStringsSep " " wrapperOptions; goBuild = @@ -139,24 +138,22 @@ goBuild (finalAttrs: { } // lib.optionalAttrs enableCuda { CUDA_PATH = cudaPath; }; - nativeBuildInputs = - [ - cmake - gitMinimal - ] - ++ lib.optionals enableRocm [ - rocmPackages.llvm.bintools - rocmLibs - ] - ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ] - ++ lib.optionals (enableRocm || enableCuda) [ - makeWrapper - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + gitMinimal + ] + ++ lib.optionals enableRocm [ + rocmPackages.llvm.bintools + rocmLibs + ] + ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ] + ++ lib.optionals (enableRocm || enableCuda) [ + makeWrapper + autoAddDriverRunpath + ]; buildInputs = - lib.optionals enableRocm (rocmLibs ++ [ libdrm ]) - ++ lib.optionals enableCuda cudaLibs; + lib.optionals enableRocm (rocmLibs ++ [ libdrm ]) ++ lib.optionals enableCuda cudaLibs; # replace inaccurate version number with actual release version postPatch = '' @@ -230,21 +227,21 @@ goBuild (finalAttrs: { ''; passthru = { - tests = - { - inherit ollama; - version = testers.testVersion { - inherit (finalAttrs) version; - package = ollama; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit ollama-rocm ollama-cuda; - service = nixosTests.ollama; - service-cuda = nixosTests.ollama-cuda; - service-rocm = nixosTests.ollama-rocm; + tests = { + inherit ollama; + version = testers.testVersion { + inherit (finalAttrs) version; + package = ollama; }; - } // lib.optionalAttrs (!enableRocm && !enableCuda) { updateScript = nix-update-script { }; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit ollama-rocm ollama-cuda; + service = nixosTests.ollama; + service-cuda = nixosTests.ollama-cuda; + service-rocm = nixosTests.ollama-rocm; + }; + } + // lib.optionalAttrs (!enableRocm && !enableCuda) { updateScript = nix-update-script { }; }; meta = { description = diff --git a/pkgs/by-name/ol/olm/package.nix b/pkgs/by-name/ol/olm/package.nix index ec0aeb705e6c..c52415b43dc5 100644 --- a/pkgs/by-name/ol/olm/package.nix +++ b/pkgs/by-name/ol/olm/package.nix @@ -21,18 +21,17 @@ stdenv.mkDerivation rec { doCheck = true; - postPatch = - '' - substituteInPlace olm.pc.in \ - --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ - --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ - '' - # Clang 19 has become more strict about assigning to const variables - # Patch from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281497 - + lib.optionalString (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "19") '' - substituteInPlace include/olm/list.hh \ - --replace-fail "T * const other_pos = other._data;" "T const * other_pos = other._data;" - ''; + postPatch = '' + substituteInPlace olm.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + '' + # Clang 19 has become more strict about assigning to const variables + # Patch from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281497 + + lib.optionalString (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "19") '' + substituteInPlace include/olm/list.hh \ + --replace-fail "T * const other_pos = other._data;" "T const * other_pos = other._data;" + ''; meta = with lib; { description = "Implements double cryptographic ratchet and Megolm ratchet"; diff --git a/pkgs/by-name/om/ombi/package.nix b/pkgs/by-name/om/ombi/package.nix index 35097500bf0a..56b5e743092d 100644 --- a/pkgs/by-name/om/ombi/package.nix +++ b/pkgs/by-name/om/ombi/package.nix @@ -49,10 +49,11 @@ stdenv.mkDerivation rec { runHook postUnpack ''; - nativeBuildInputs = - [ makeWrapper ] - ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; propagatedBuildInputs = [ stdenv.cc.cc diff --git a/pkgs/by-name/om/omxplayer/package.nix b/pkgs/by-name/om/omxplayer/package.nix index 0515a9b5f203..ca0cb459af6c 100644 --- a/pkgs/by-name/om/omxplayer/package.nix +++ b/pkgs/by-name/om/omxplayer/package.nix @@ -21,49 +21,48 @@ let }; configurePlatforms = [ ]; - configureFlags = - [ - "--arch=${stdenv.hostPlatform.parsed.cpu.name}" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - # TODO be better with condition - "--cpu=arm1176jzf-s" - ] - ++ [ - "--disable-muxers" - "--enable-muxer=spdif" - "--enable-muxer=adts" - "--disable-encoders" - "--enable-encoder=ac3" - "--enable-encoder=aac" - "--disable-decoder=mpeg_xvmc" - "--disable-devices" - "--disable-ffprobe" - "--disable-ffplay" - "--disable-ffserver" - "--disable-ffmpeg" - "--enable-shared" - "--disable-doc" - "--enable-postproc" - "--enable-gpl" - "--enable-protocol=http" - "--enable-pthreads" - "--disable-runtime-cpudetect" - "--enable-pic" - "--disable-armv5te" - "--disable-neon" - "--enable-armv6t2" - "--enable-armv6" - "--enable-hardcoded-tables" - "--disable-runtime-cpudetect" - "--disable-debug" - "--arch=${stdenv.hostPlatform.parsed.cpu.name}" - "--target_os=${stdenv.hostPlatform.parsed.kernel.name}" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--cross-prefix=${stdenv.cc.targetPrefix}" - "--enable-cross-compile" - ]; + configureFlags = [ + "--arch=${stdenv.hostPlatform.parsed.cpu.name}" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + # TODO be better with condition + "--cpu=arm1176jzf-s" + ] + ++ [ + "--disable-muxers" + "--enable-muxer=spdif" + "--enable-muxer=adts" + "--disable-encoders" + "--enable-encoder=ac3" + "--enable-encoder=aac" + "--disable-decoder=mpeg_xvmc" + "--disable-devices" + "--disable-ffprobe" + "--disable-ffplay" + "--disable-ffserver" + "--disable-ffmpeg" + "--enable-shared" + "--disable-doc" + "--enable-postproc" + "--enable-gpl" + "--enable-protocol=http" + "--enable-pthreads" + "--disable-runtime-cpudetect" + "--enable-pic" + "--disable-armv5te" + "--disable-neon" + "--enable-armv6t2" + "--enable-armv6" + "--enable-hardcoded-tables" + "--disable-runtime-cpudetect" + "--disable-debug" + "--arch=${stdenv.hostPlatform.parsed.cpu.name}" + "--target_os=${stdenv.hostPlatform.parsed.kernel.name}" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--cross-prefix=${stdenv.cc.targetPrefix}" + "--enable-cross-compile" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/on/onboard/package.nix b/pkgs/by-name/on/onboard/package.nix index 381a25bfb870..e2169cde465d 100644 --- a/pkgs/by-name/on/onboard/package.nix +++ b/pkgs/by-name/on/onboard/package.nix @@ -94,7 +94,8 @@ python3.pkgs.buildPythonApplication rec { udev xorg.libXtst xorg.libxkbfile - ] ++ lib.optional atspiSupport at-spi2-core; + ] + ++ lib.optional atspiSupport at-spi2-core; pythonPath = with python3.pkgs; [ dbus-python diff --git a/pkgs/by-name/on/onedrive/package.nix b/pkgs/by-name/on/onedrive/package.nix index afc54bbde022..312f23b3eebe 100644 --- a/pkgs/by-name/on/onedrive/package.nix +++ b/pkgs/by-name/on/onedrive/package.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation (finalAttrs: { dbus libnotify sqlite - ] ++ lib.optionals withSystemd [ systemd ]; + ] + ++ lib.optionals withSystemd [ systemd ]; configureFlags = [ (lib.enableFeature true "notifications") diff --git a/pkgs/by-name/on/onefetch/package.nix b/pkgs/by-name/on/onefetch/package.nix index 4343d54455ac..4d4081a1e17e 100644 --- a/pkgs/by-name/on/onefetch/package.nix +++ b/pkgs/by-name/on/onefetch/package.nix @@ -39,11 +39,12 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ zstd ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libresolv - ]; + buildInputs = [ + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libresolv + ]; nativeCheckInputs = [ gitMinimal diff --git a/pkgs/by-name/on/onionshare/package.nix b/pkgs/by-name/on/onionshare/package.nix index c89b96408b0b..1047a1f760c0 100644 --- a/pkgs/by-name/on/onionshare/package.nix +++ b/pkgs/by-name/on/onionshare/package.nix @@ -83,14 +83,13 @@ python3Packages.buildPythonApplication rec { tor ]; - nativeCheckInputs = - [ - versionCheckHook - writableTmpDirAsHomeHook - ] - ++ (with python3Packages; [ - pytestCheckHook - ]); + nativeCheckInputs = [ + versionCheckHook + writableTmpDirAsHomeHook + ] + ++ (with python3Packages; [ + pytestCheckHook + ]); disabledTests = lib.optionals stdenv.hostPlatform.isLinux [ diff --git a/pkgs/by-name/on/onnxruntime/package.nix b/pkgs/by-name/on/onnxruntime/package.nix index 4dfa54fd52ed..360e39e54d72 100644 --- a/pkgs/by-name/on/onnxruntime/package.nix +++ b/pkgs/by-name/on/onnxruntime/package.nix @@ -110,128 +110,125 @@ effectiveStdenv.mkDerivation rec { ./nvcc-gsl.patch ]; - nativeBuildInputs = + nativeBuildInputs = [ + cmake + pkg-config + python3Packages.python + protobuf_21 + ] + ++ lib.optionals pythonSupport ( + with python3Packages; [ - cmake - pkg-config - python3Packages.python - protobuf_21 + pip + python + pythonOutputDistHook + setuptools + wheel ] - ++ lib.optionals pythonSupport ( - with python3Packages; - [ - pip - python - pythonOutputDistHook - setuptools - wheel - ] - ) - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - cudaPackages.cudnn-frontend - ] - ++ lib.optionals isCudaJetson [ - cudaPackages.autoAddCudaCompatRunpath - ]; + ) + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + cudaPackages.cudnn-frontend + ] + ++ lib.optionals isCudaJetson [ + cudaPackages.autoAddCudaCompatRunpath + ]; - buildInputs = + buildInputs = [ + cpuinfo + eigen + glibcLocales + howard-hinnant-date + libpng + nlohmann_json + microsoft-gsl + pytorch_clog + zlib + ] + ++ lib.optionals pythonSupport ( + with python3Packages; [ - cpuinfo - eigen - glibcLocales - howard-hinnant-date - libpng - nlohmann_json - microsoft-gsl - pytorch_clog - zlib + numpy + pybind11 + packaging ] - ++ lib.optionals pythonSupport ( - with python3Packages; - [ - numpy - pybind11 - packaging - ] - ) - ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ - libiconv + ) + ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.optionals cudaSupport ( + with cudaPackages; + [ + cuda_cccl # cub/cub.cuh + libcublas # cublas_v2.h + libcurand # curand.h + libcusparse # cusparse.h + libcufft # cufft.h + cudnn # cudnn.h + cuda_cudart ] - ++ lib.optionals cudaSupport ( + ++ lib.optionals (cudaSupport && ncclSupport) ( with cudaPackages; [ - cuda_cccl # cub/cub.cuh - libcublas # cublas_v2.h - libcurand # curand.h - libcusparse # cusparse.h - libcufft # cufft.h - cudnn # cudnn.h - cuda_cudart + nccl ] - ++ lib.optionals (cudaSupport && ncclSupport) ( - with cudaPackages; - [ - nccl - ] - ) - ); + ) + ); - nativeCheckInputs = + nativeCheckInputs = [ + gtest + ] + ++ lib.optionals pythonSupport ( + with python3Packages; [ - gtest + pytest + sympy + onnx ] - ++ lib.optionals pythonSupport ( - with python3Packages; - [ - pytest - sympy - onnx - ] - ); + ); # TODO: build server, and move .so's to lib output # Python's wheel is stored in a separate dist output outputs = [ "out" "dev" - ] ++ lib.optionals pythonSupport [ "dist" ]; + ] + ++ lib.optionals pythonSupport [ "dist" ]; enableParallelBuilding = true; cmakeDir = "../cmake"; - cmakeFlags = - [ - (lib.cmakeBool "ABSL_ENABLE_INSTALL" true) - (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) - (lib.cmakeBool "FETCHCONTENT_QUIET" false) - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_ABSEIL_CPP" "${abseil-cpp_202407.src}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_DLPACK" "${dlpack}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_FLATBUFFERS" "${flatbuffers_23.src}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_MP11" "${mp11}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_ONNX" "${onnx}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_RE2" "${re2.src}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_SAFEINT" "${safeint}") - (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS") - # fails to find protoc on darwin, so specify it - (lib.cmakeFeature "ONNX_CUSTOM_PROTOC_EXECUTABLE" "${protobuf_21}/bin/protoc") - (lib.cmakeBool "onnxruntime_BUILD_SHARED_LIB" true) - (lib.cmakeBool "onnxruntime_BUILD_UNIT_TESTS" doCheck) - (lib.cmakeBool "onnxruntime_USE_FULL_PROTOBUF" false) - (lib.cmakeBool "onnxruntime_USE_CUDA" cudaSupport) - (lib.cmakeBool "onnxruntime_USE_NCCL" (cudaSupport && ncclSupport)) - (lib.cmakeBool "onnxruntime_ENABLE_LTO" (!cudaSupport || cudaPackages.cudaOlder "12.8")) - ] - ++ lib.optionals pythonSupport [ - (lib.cmakeBool "onnxruntime_ENABLE_PYTHON" true) - ] - ++ lib.optionals cudaSupport [ - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_CUTLASS" "${cutlass}") - (lib.cmakeFeature "onnxruntime_CUDNN_HOME" "${cudaPackages.cudnn}") - (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaArchitecturesString) - (lib.cmakeFeature "onnxruntime_NVCC_THREADS" "1") - ]; + cmakeFlags = [ + (lib.cmakeBool "ABSL_ENABLE_INSTALL" true) + (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) + (lib.cmakeBool "FETCHCONTENT_QUIET" false) + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_ABSEIL_CPP" "${abseil-cpp_202407.src}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_DLPACK" "${dlpack}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_FLATBUFFERS" "${flatbuffers_23.src}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_MP11" "${mp11}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_ONNX" "${onnx}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_RE2" "${re2.src}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_SAFEINT" "${safeint}") + (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS") + # fails to find protoc on darwin, so specify it + (lib.cmakeFeature "ONNX_CUSTOM_PROTOC_EXECUTABLE" "${protobuf_21}/bin/protoc") + (lib.cmakeBool "onnxruntime_BUILD_SHARED_LIB" true) + (lib.cmakeBool "onnxruntime_BUILD_UNIT_TESTS" doCheck) + (lib.cmakeBool "onnxruntime_USE_FULL_PROTOBUF" false) + (lib.cmakeBool "onnxruntime_USE_CUDA" cudaSupport) + (lib.cmakeBool "onnxruntime_USE_NCCL" (cudaSupport && ncclSupport)) + (lib.cmakeBool "onnxruntime_ENABLE_LTO" (!cudaSupport || cudaPackages.cudaOlder "12.8")) + ] + ++ lib.optionals pythonSupport [ + (lib.cmakeBool "onnxruntime_ENABLE_PYTHON" true) + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_CUTLASS" "${cutlass}") + (lib.cmakeFeature "onnxruntime_CUDNN_HOME" "${cudaPackages.cudnn}") + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaArchitecturesString) + (lib.cmakeFeature "onnxruntime_NVCC_THREADS" "1") + ]; env = lib.optionalAttrs effectiveStdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error"; @@ -242,21 +239,20 @@ effectiveStdenv.mkDerivation rec { requiredSystemFeatures = lib.optionals cudaSupport [ "big-parallel" ]; - postPatch = - '' - substituteInPlace cmake/libonnxruntime.pc.cmake.in \ - --replace-fail '$'{prefix}/@CMAKE_INSTALL_ @CMAKE_INSTALL_ - echo "find_package(cudnn_frontend REQUIRED)" > cmake/external/cudnn_frontend.cmake + postPatch = '' + substituteInPlace cmake/libonnxruntime.pc.cmake.in \ + --replace-fail '$'{prefix}/@CMAKE_INSTALL_ @CMAKE_INSTALL_ + echo "find_package(cudnn_frontend REQUIRED)" > cmake/external/cudnn_frontend.cmake - # https://github.com/microsoft/onnxruntime/blob/c4f3742bb456a33ee9c826ce4e6939f8b84ce5b0/onnxruntime/core/platform/env.h#L249 - substituteInPlace onnxruntime/core/platform/env.h --replace-fail \ - "GetRuntimePath() const { return PathString(); }" \ - "GetRuntimePath() const { return PathString(\"$out/lib/\"); }" - '' - + lib.optionalString (effectiveStdenv.hostPlatform.system == "aarch64-linux") '' - # https://github.com/NixOS/nixpkgs/pull/226734#issuecomment-1663028691 - rm -v onnxruntime/test/optimizer/nhwc_transformer_test.cc - ''; + # https://github.com/microsoft/onnxruntime/blob/c4f3742bb456a33ee9c826ce4e6939f8b84ce5b0/onnxruntime/core/platform/env.h#L249 + substituteInPlace onnxruntime/core/platform/env.h --replace-fail \ + "GetRuntimePath() const { return PathString(); }" \ + "GetRuntimePath() const { return PathString(\"$out/lib/\"); }" + '' + + lib.optionalString (effectiveStdenv.hostPlatform.system == "aarch64-linux") '' + # https://github.com/NixOS/nixpkgs/pull/226734#issuecomment-1663028691 + rm -v onnxruntime/test/optimizer/nhwc_transformer_test.cc + ''; postBuild = lib.optionalString pythonSupport '' ${python3Packages.python.interpreter} ../setup.py bdist_wheel diff --git a/pkgs/by-name/op/open-policy-agent/package.nix b/pkgs/by-name/op/open-policy-agent/package.nix index 85afcd84b7e9..1d637fc6640b 100644 --- a/pkgs/by-name/op/open-policy-agent/package.nix +++ b/pkgs/by-name/op/open-policy-agent/package.nix @@ -44,21 +44,20 @@ buildGoModule (finalAttrs: { checkFlags = let - skippedTests = - [ - # Skip tests that require network, not available in the nix sandbox - "TestInterQueryCache_ClientError" - "TestIntraQueryCache_ClientError" - "TestSSOCredentialService" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Skip tests that require network, not available in the darwin sandbox - "TestHTTPSClient" - "TestHTTPSNoClientCerts" - ] - ++ lib.optionals (!enableWasmEval) [ - "TestRegoTargetWasmAndTargetPluginDisablesIndexingTopdownStages" - ]; + skippedTests = [ + # Skip tests that require network, not available in the nix sandbox + "TestInterQueryCache_ClientError" + "TestIntraQueryCache_ClientError" + "TestSSOCredentialService" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Skip tests that require network, not available in the darwin sandbox + "TestHTTPSClient" + "TestHTTPSNoClientCerts" + ] + ++ lib.optionals (!enableWasmEval) [ + "TestRegoTargetWasmAndTargetPluginDisablesIndexingTopdownStages" + ]; in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; diff --git a/pkgs/by-name/op/open-vm-tools/package.nix b/pkgs/by-name/op/open-vm-tools/package.nix index 7fc04a329ab1..d038aa0f1ced 100644 --- a/pkgs/by-name/op/open-vm-tools/package.nix +++ b/pkgs/by-name/op/open-vm-tools/package.nix @@ -75,37 +75,36 @@ stdenv.mkDerivation (finalAttrs: { udevCheckHook ]; - buildInputs = - [ - fuse3 - glib - icu - libdnet - libdrm - libmspack - libtirpc - libxcrypt - libxml2 - openssl - pam - procps - rpcsvc-proto - udev - xercesc - xmlsec - ] - ++ optionals withX [ - gdk-pixbuf-xlib - gtk3 - gtkmm3 - libX11 - libXext - libXinerama - libXi - libXrender - libXrandr - libXtst - ]; + buildInputs = [ + fuse3 + glib + icu + libdnet + libdrm + libmspack + libtirpc + libxcrypt + libxml2 + openssl + pam + procps + rpcsvc-proto + udev + xercesc + xmlsec + ] + ++ optionals withX [ + gdk-pixbuf-xlib + gtk3 + gtkmm3 + libX11 + libXext + libXinerama + libXi + libXrender + libXrandr + libXtst + ]; postPatch = '' sed -i Makefile.am \ @@ -138,7 +137,8 @@ stdenv.mkDerivation (finalAttrs: { "--without-kernel-modules" "--with-udev-rules-dir=${placeholder "out"}/lib/udev/rules.d" "--with-fuse=fuse3" - ] ++ optional (!withX) "--without-x"; + ] + ++ optional (!withX) "--without-x"; enableParallelBuilding = true; diff --git a/pkgs/by-name/op/open62541/package.nix b/pkgs/by-name/op/open62541/package.nix index c64f9bbd10f6..003af800685a 100644 --- a/pkgs/by-name/op/open62541/package.nix +++ b/pkgs/by-name/op/open62541/package.nix @@ -43,36 +43,34 @@ stdenv.mkDerivation (finalAttrs: { fetchSubmodules = true; }; - cmakeFlags = + cmakeFlags = [ + (lib.cmakeFeature "OPEN62541_VERSION" finalAttrs.src.rev) + (lib.cmakeFeature "UA_NAMESPACE_ZERO" "FULL") + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + + # Note comment near doCheck + (lib.cmakeBool "UA_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "UA_ENABLE_ALLOW_REUSEADDR" finalAttrs.finalPackage.doCheck) + + (lib.cmakeBool "UA_BUILD_EXAMPLES" withExamples) + ] + ++ lib.optionals (withEncryption != false) [ + (lib.cmakeFeature "UA_ENABLE_ENCRYPTION" (lib.toUpper withEncryption)) + ]; + + nativeBuildInputs = [ + cmake + pkg-config + python3Packages.python + ] + ++ lib.optionals withDoc ( + with python3Packages; [ - (lib.cmakeFeature "OPEN62541_VERSION" finalAttrs.src.rev) - (lib.cmakeFeature "UA_NAMESPACE_ZERO" "FULL") - (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) - - # Note comment near doCheck - (lib.cmakeBool "UA_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck) - (lib.cmakeBool "UA_ENABLE_ALLOW_REUSEADDR" finalAttrs.finalPackage.doCheck) - - (lib.cmakeBool "UA_BUILD_EXAMPLES" withExamples) + sphinx + sphinx_rtd_theme + graphviz-nox ] - ++ lib.optionals (withEncryption != false) [ - (lib.cmakeFeature "UA_ENABLE_ENCRYPTION" (lib.toUpper withEncryption)) - ]; - - nativeBuildInputs = - [ - cmake - pkg-config - python3Packages.python - ] - ++ lib.optionals withDoc ( - with python3Packages; - [ - sphinx - sphinx_rtd_theme - graphviz-nox - ] - ); + ); buildInputs = lib.optional (withEncryption != false) encryptionBackend; diff --git a/pkgs/by-name/op/openapi-python-client/package.nix b/pkgs/by-name/op/openapi-python-client/package.nix index 24f36d089dab..e37ceb99d18b 100644 --- a/pkgs/by-name/op/openapi-python-client/package.nix +++ b/pkgs/by-name/op/openapi-python-client/package.nix @@ -22,13 +22,12 @@ python3Packages.buildPythonApplication rec { hash = "sha256-B+GVv1Q/OwbtHDMGNYkPkZgvHqncrAkdvZ6ECwhIbLE="; }; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.ps - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.ps + ]; build-system = with python3Packages; [ hatchling diff --git a/pkgs/by-name/op/opencc/package.nix b/pkgs/by-name/op/opencc/package.nix index 54360185cd8f..b1b075679c1b 100644 --- a/pkgs/by-name/op/opencc/package.nix +++ b/pkgs/by-name/op/opencc/package.nix @@ -20,14 +20,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-JBTegQs9ALp4LdKKYMNp9GYEgqR9O8IkX6LqatvaTic="; }; - nativeBuildInputs = - [ - cmake - python3 - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - opencc # opencc_dict - ]; + nativeBuildInputs = [ + cmake + python3 + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + opencc # opencc_dict + ]; buildInputs = [ rapidjson diff --git a/pkgs/by-name/op/opencl-clang/package.nix b/pkgs/by-name/op/opencl-clang/package.nix index 0d31c8f5b920..5692510a7188 100644 --- a/pkgs/by-name/op/opencl-clang/package.nix +++ b/pkgs/by-name/op/opencl-clang/package.nix @@ -14,13 +14,11 @@ let addPatches = component: pkg: pkg.overrideAttrs (oldAttrs: { - postPatch = - oldAttrs.postPatch or "" - + '' - for p in ${passthru.patchesOut}/${component}/*; do - patch -p1 -i "$p" - done - ''; + postPatch = oldAttrs.postPatch or "" + '' + for p in ${passthru.patchesOut}/${component}/*; do + patch -p1 -i "$p" + done + ''; }); llvmPkgs = llvmPackages_15; @@ -73,18 +71,17 @@ let ./opencl-headers-dir.patch ]; - postPatch = - '' - # fix not be able to find clang from PATH - substituteInPlace cl_headers/CMakeLists.txt \ - --replace-fail " NO_DEFAULT_PATH" "" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Uses linker flags that are not supported on Darwin. - sed -i -e '/SET_LINUX_EXPORTS_FILE/d' CMakeLists.txt - substituteInPlace CMakeLists.txt \ - --replace-fail '-Wl,--no-undefined' "" - ''; + postPatch = '' + # fix not be able to find clang from PATH + substituteInPlace cl_headers/CMakeLists.txt \ + --replace-fail " NO_DEFAULT_PATH" "" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Uses linker flags that are not supported on Darwin. + sed -i -e '/SET_LINUX_EXPORTS_FILE/d' CMakeLists.txt + substituteInPlace CMakeLists.txt \ + --replace-fail '-Wl,--no-undefined' "" + ''; }; in diff --git a/pkgs/by-name/op/openclonk/package.nix b/pkgs/by-name/op/openclonk/package.nix index 267bcc1cfa0d..b6a142260664 100644 --- a/pkgs/by-name/op/openclonk/package.nix +++ b/pkgs/by-name/op/openclonk/package.nix @@ -59,14 +59,13 @@ stdenv.mkDerivation { }) ]; - postInstall = - '' - mv $out/games/openclonk $out/bin - rm -r $out/games - '' - + lib.optionalString enableSoundtrack '' - ln -sv ${soundtrack_src} $out/share/games/openclonk/Music.ocg - ''; + postInstall = '' + mv $out/games/openclonk $out/bin + rm -r $out/games + '' + + lib.optionalString enableSoundtrack '' + ln -sv ${soundtrack_src} $out/share/games/openclonk/Music.ocg + ''; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/op/opencollada/package.nix b/pkgs/by-name/op/opencollada/package.nix index 58d743702fee..85a69f825868 100644 --- a/pkgs/by-name/op/opencollada/package.nix +++ b/pkgs/by-name/op/opencollada/package.nix @@ -30,16 +30,15 @@ stdenv.mkDerivation rec { }) ]; - postPatch = - '' - # Drop blanket -Werror as it tends to fail on newer toolchain for - # minor warnings. In this case it was gcc-13 build failure. - substituteInPlace DAEValidator/CMakeLists.txt --replace-fail ' -Werror"' '"' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp \ - --replace math.h cmath - ''; + postPatch = '' + # Drop blanket -Werror as it tends to fail on newer toolchain for + # minor warnings. In this case it was gcc-13 build failure. + substituteInPlace DAEValidator/CMakeLists.txt --replace-fail ' -Werror"' '"' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp \ + --replace math.h cmath + ''; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/op/opencsg/package.nix b/pkgs/by-name/op/opencsg/package.nix index 6b885033d2e0..e7c97b1efdd6 100644 --- a/pkgs/by-name/op/opencsg/package.nix +++ b/pkgs/by-name/op/opencsg/package.nix @@ -26,16 +26,17 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = - [ glew ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - libGL - libglut - libXmu - libXext - libX11 - ]; + buildInputs = [ + glew + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGLU + libGL + libglut + libXmu + libXext + libX11 + ]; doCheck = false; diff --git a/pkgs/by-name/op/openctm/package.nix b/pkgs/by-name/op/openctm/package.nix index 84c4f11dfdea..25314ca6b981 100644 --- a/pkgs/by-name/op/openctm/package.nix +++ b/pkgs/by-name/op/openctm/package.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libglut libGLU - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk2 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk2 ]; postPatch = lib.optionalString stdenv.hostPlatform.isLinux '' diff --git a/pkgs/by-name/op/opendht/package.nix b/pkgs/by-name/op/opendht/package.nix index 1cdbd0f17f89..dd9da4bf934f 100644 --- a/pkgs/by-name/op/opendht/package.nix +++ b/pkgs/by-name/op/opendht/package.nix @@ -36,22 +36,21 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - asio - fmt - nettle - gnutls - msgpack-cxx - readline - libargon2 - ] - ++ lib.optionals enableProxyServerAndClient [ - jsoncpp - restinio - llhttp - openssl - ]; + buildInputs = [ + asio + fmt + nettle + gnutls + msgpack-cxx + readline + libargon2 + ] + ++ lib.optionals enableProxyServerAndClient [ + jsoncpp + restinio + llhttp + openssl + ]; cmakeFlags = lib.optionals enableProxyServerAndClient [ diff --git a/pkgs/by-name/op/opendkim/package.nix b/pkgs/by-name/op/opendkim/package.nix index d61d03069f02..37ab8aac3ed7 100644 --- a/pkgs/by-name/op/opendkim/package.nix +++ b/pkgs/by-name/op/opendkim/package.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation rec { "--with-milter=${libmilter}" "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "--with-unbound=${unbound}"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--with-unbound=${unbound}"; nativeBuildInputs = [ autoreconfHook @@ -40,7 +41,8 @@ stdenv.mkDerivation rec { openssl libmilter perl - ] ++ lib.optional stdenv.hostPlatform.isDarwin unbound; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin unbound; postInstall = '' wrapProgram $out/sbin/opendkim-genkey \ diff --git a/pkgs/by-name/op/openfortivpn/package.nix b/pkgs/by-name/op/openfortivpn/package.nix index 45ca1758d881..fc57a566c3fd 100644 --- a/pkgs/by-name/op/openfortivpn/package.nix +++ b/pkgs/by-name/op/openfortivpn/package.nix @@ -35,21 +35,19 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - openssl - ] - ++ lib.optional withSystemd systemd - ++ lib.optional withPpp ppp; + buildInputs = [ + openssl + ] + ++ lib.optional withSystemd systemd + ++ lib.optional withPpp ppp; - configureFlags = - [ - "--sysconfdir=/etc" - ] - ++ lib.optional withSystemd "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - ++ lib.optional withPpp "--with-pppd=${ppp}/bin/pppd" - # configure: error: cannot check for file existence when cross compiling - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-proc"; + configureFlags = [ + "--sysconfdir=/etc" + ] + ++ lib.optional withSystemd "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + ++ lib.optional withPpp "--with-pppd=${ppp}/bin/pppd" + # configure: error: cannot check for file existence when cross compiling + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-proc"; enableParallelBuilding = true; diff --git a/pkgs/by-name/op/openfpgaloader/package.nix b/pkgs/by-name/op/openfpgaloader/package.nix index fed0b254f290..90dd9140038a 100644 --- a/pkgs/by-name/op/openfpgaloader/package.nix +++ b/pkgs/by-name/op/openfpgaloader/package.nix @@ -27,16 +27,15 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - hidapi - libftdi1 - libusb1 - zlib - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform udev) [ - udev - ]; + buildInputs = [ + hidapi + libftdi1 + libusb1 + zlib + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform udev) [ + udev + ]; meta = { description = "Universal utility for programming FPGAs"; diff --git a/pkgs/by-name/op/openh264/package.nix b/pkgs/by-name/op/openh264/package.nix index f62ea69a3e21..a703f5c18953 100644 --- a/pkgs/by-name/op/openh264/package.nix +++ b/pkgs/by-name/op/openh264/package.nix @@ -43,13 +43,12 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - gtest - ] - ++ lib.optionals stdenv.hostPlatform.isWindows [ - windows.pthreads - ]; + buildInputs = [ + gtest + ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ + windows.pthreads + ]; strictDeps = true; diff --git a/pkgs/by-name/op/openhmd/package.nix b/pkgs/by-name/op/openhmd/package.nix index f2d8b845d7c2..01fc1d072edf 100644 --- a/pkgs/by-name/op/openhmd/package.nix +++ b/pkgs/by-name/op/openhmd/package.nix @@ -31,15 +31,14 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - hidapi - ] - ++ lib.optionals withExamples [ - SDL2 - glew - libGL - ]; + buildInputs = [ + hidapi + ] + ++ lib.optionals withExamples [ + SDL2 + glew + libGL + ]; cmakeFlags = [ "-DBUILD_BOTH_STATIC_SHARED_LIBS=ON" diff --git a/pkgs/by-name/op/openimagedenoise/package.nix b/pkgs/by-name/op/openimagedenoise/package.nix index 4bb6ff2b2fbf..f666529ede71 100644 --- a/pkgs/by-name/op/openimagedenoise/package.nix +++ b/pkgs/by-name/op/openimagedenoise/package.nix @@ -30,22 +30,22 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "set(CMAKE_CXX_STANDARD 11)" "set(CMAKE_CXX_STANDARD 14)" ''; - nativeBuildInputs = - [ - cmake - python3 - ispc - ] - ++ lib.optional cudaSupport cudaPackages.cuda_nvcc - ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ]; + nativeBuildInputs = [ + cmake + python3 + ispc + ] + ++ lib.optional cudaSupport cudaPackages.cuda_nvcc + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ]; - buildInputs = - [ tbb ] + buildInputs = [ + tbb + ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - cudaPackages.cuda_cccl - ]; + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + cudaPackages.cuda_cccl + ]; cmakeFlags = [ (lib.cmakeBool "OIDN_DEVICE_CUDA" cudaSupport) diff --git a/pkgs/by-name/op/openjpeg/package.nix b/pkgs/by-name/op/openjpeg/package.nix index 37e66bf7cd6c..e747f18bc11d 100644 --- a/pkgs/by-name/op/openjpeg/package.nix +++ b/pkgs/by-name/op/openjpeg/package.nix @@ -78,25 +78,25 @@ stdenv.mkDerivation rec { "-DBUILD_VIEWER=OFF" "-DBUILD_JAVA=OFF" (lib.cmakeBool "BUILD_TESTING" doCheck) - ] ++ lib.optional doCheck "-DOPJ_DATA_ROOT=${test-data}"; + ] + ++ lib.optional doCheck "-DOPJ_DATA_ROOT=${test-data}"; nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = - [ - libpng - libtiff - zlib - lcms2 - ] - ++ lib.optionals jpipServerSupport [ - curl - fcgi - ] - ++ lib.optional (jpipLibSupport) jdk; + buildInputs = [ + libpng + libtiff + zlib + lcms2 + ] + ++ lib.optionals jpipServerSupport [ + curl + fcgi + ] + ++ lib.optional (jpipLibSupport) jdk; # tests did fail on powerpc64 doCheck = !stdenv.hostPlatform.isPower64 && stdenv.buildPlatform.canExecute stdenv.hostPlatform; diff --git a/pkgs/by-name/op/openldap/package.nix b/pkgs/by-name/op/openldap/package.nix index 7a9300bb0fba..e42a6411de3c 100644 --- a/pkgs/by-name/op/openldap/package.nix +++ b/pkgs/by-name/op/openldap/package.nix @@ -53,40 +53,38 @@ stdenv.mkDerivation rec { groff ]; - buildInputs = - [ - (cyrus_sasl.override { - inherit openssl; - }) - libtool - openssl - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - libxcrypt # causes linking issues on *-darwin - ] - ++ lib.optionals withModules [ - libsodium - ] - ++ lib.optionals withSystemd [ - systemdMinimal - ]; + buildInputs = [ + (cyrus_sasl.override { + inherit openssl; + }) + libtool + openssl + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + libxcrypt # causes linking issues on *-darwin + ] + ++ lib.optionals withModules [ + libsodium + ] + ++ lib.optionals withSystemd [ + systemdMinimal + ]; preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") '' MACOSX_DEPLOYMENT_TARGET=10.16 ''; - configureFlags = - [ - "--enable-crypt" - "--enable-overlays" - (lib.enableFeature withModules "argon2") - (lib.enableFeature withModules "modules") - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--with-yielding_select=yes" - "ac_cv_func_memcmp_working=yes" - ] - ++ lib.optional stdenv.hostPlatform.isFreeBSD "--with-pic"; + configureFlags = [ + "--enable-crypt" + "--enable-overlays" + (lib.enableFeature withModules "argon2") + (lib.enableFeature withModules "modules") + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--with-yielding_select=yes" + "ac_cv_func_memcmp_working=yes" + ] + ++ lib.optional stdenv.hostPlatform.isFreeBSD "--with-pic"; env.NIX_CFLAGS_COMPILE = toString [ "-DLDAPI_SOCK=\"/run/openldap/ldapi\"" ]; diff --git a/pkgs/by-name/op/openmm/package.nix b/pkgs/by-name/op/openmm/package.nix index 577df689a3aa..e76046dd84cb 100644 --- a/pkgs/by-name/op/openmm/package.nix +++ b/pkgs/by-name/op/openmm/package.nix @@ -37,28 +37,28 @@ stdenv.mkDerivation (finalAttrs: { serialization/tests/TestSerializeIntegrator.cpp ''; - nativeBuildInputs = - [ - cmake - gfortran - swig - doxygen - python3Packages.python - ] - ++ lib.optionals enablePython [ - python3Packages.build - python3Packages.installer - python3Packages.wheel - ] - ++ lib.optional enableCuda addDriverRunpath; + nativeBuildInputs = [ + cmake + gfortran + swig + doxygen + python3Packages.python + ] + ++ lib.optionals enablePython [ + python3Packages.build + python3Packages.installer + python3Packages.wheel + ] + ++ lib.optional enableCuda addDriverRunpath; - buildInputs = - [ fftwSinglePrec ] - ++ lib.optionals enableOpencl [ - ocl-icd - opencl-headers - ] - ++ lib.optional enableCuda cudaPackages.cudatoolkit; + buildInputs = [ + fftwSinglePrec + ] + ++ lib.optionals enableOpencl [ + ocl-icd + opencl-headers + ] + ++ lib.optional enableCuda cudaPackages.cudatoolkit; propagatedBuildInputs = lib.optionals enablePython ( with python3Packages; @@ -70,34 +70,33 @@ stdenv.mkDerivation (finalAttrs: { ] ); - cmakeFlags = - [ - "-DBUILD_TESTING=ON" - "-DOPENMM_BUILD_AMOEBA_PLUGIN=ON" - "-DOPENMM_BUILD_CPU_LIB=ON" - "-DOPENMM_BUILD_C_AND_FORTRAN_WRAPPERS=ON" - "-DOPENMM_BUILD_DRUDE_PLUGIN=ON" - "-DOPENMM_BUILD_PME_PLUGIN=ON" - "-DOPENMM_BUILD_RPMD_PLUGIN=ON" - "-DOPENMM_BUILD_SHARED_LIB=ON" - ] - ++ lib.optionals enablePython [ - "-DOPENMM_BUILD_PYTHON_WRAPPERS=ON" - ] - ++ lib.optionals enableOpencl [ - "-DOPENMM_BUILD_OPENCL_LIB=ON" - "-DOPENMM_BUILD_AMOEBA_OPENCL_LIB=ON" - "-DOPENMM_BUILD_DRUDE_OPENCL_LIB=ON" - "-DOPENMM_BUILD_RPMD_OPENCL_LIB=ON" - ] - ++ lib.optionals enableCuda [ - "-DCUDA_SDK_ROOT_DIR=${cudaPackages.cudatoolkit}" - "-DOPENMM_BUILD_AMOEBA_CUDA_LIB=ON" - "-DOPENMM_BUILD_CUDA_LIB=ON" - "-DOPENMM_BUILD_DRUDE_CUDA_LIB=ON" - "-DOPENMM_BUILD_RPMD_CUDA_LIB=ON" - "-DCMAKE_LIBRARY_PATH=${cudaPackages.cudatoolkit}/lib64/stubs" - ]; + cmakeFlags = [ + "-DBUILD_TESTING=ON" + "-DOPENMM_BUILD_AMOEBA_PLUGIN=ON" + "-DOPENMM_BUILD_CPU_LIB=ON" + "-DOPENMM_BUILD_C_AND_FORTRAN_WRAPPERS=ON" + "-DOPENMM_BUILD_DRUDE_PLUGIN=ON" + "-DOPENMM_BUILD_PME_PLUGIN=ON" + "-DOPENMM_BUILD_RPMD_PLUGIN=ON" + "-DOPENMM_BUILD_SHARED_LIB=ON" + ] + ++ lib.optionals enablePython [ + "-DOPENMM_BUILD_PYTHON_WRAPPERS=ON" + ] + ++ lib.optionals enableOpencl [ + "-DOPENMM_BUILD_OPENCL_LIB=ON" + "-DOPENMM_BUILD_AMOEBA_OPENCL_LIB=ON" + "-DOPENMM_BUILD_DRUDE_OPENCL_LIB=ON" + "-DOPENMM_BUILD_RPMD_OPENCL_LIB=ON" + ] + ++ lib.optionals enableCuda [ + "-DCUDA_SDK_ROOT_DIR=${cudaPackages.cudatoolkit}" + "-DOPENMM_BUILD_AMOEBA_CUDA_LIB=ON" + "-DOPENMM_BUILD_CUDA_LIB=ON" + "-DOPENMM_BUILD_DRUDE_CUDA_LIB=ON" + "-DOPENMM_BUILD_RPMD_CUDA_LIB=ON" + "-DCMAKE_LIBRARY_PATH=${cudaPackages.cudatoolkit}/lib64/stubs" + ]; postInstall = lib.strings.optionalString enablePython '' export OPENMM_LIB_PATH=$out/lib diff --git a/pkgs/by-name/op/openmolcas/package.nix b/pkgs/by-name/op/openmolcas/package.nix index ae6e3a879f4a..3f597590465c 100644 --- a/pkgs/by-name/op/openmolcas/package.nix +++ b/pkgs/by-name/op/openmolcas/package.nix @@ -105,21 +105,20 @@ stdenv.mkDerivation rec { autoPatchelfHook ]; - buildInputs = - [ - hdf5-cpp - python - armadillo - libxc - gsl.dev - boost - blas-ilp64 - lapack-ilp64 - ] - ++ lib.optionals enableMpi [ - mpi - globalarrays - ]; + buildInputs = [ + hdf5-cpp + python + armadillo + libxc + gsl.dev + boost + blas-ilp64 + lapack-ilp64 + ] + ++ lib.optionals enableMpi [ + mpi + globalarrays + ]; passthru = lib.optionalAttrs enableMpi { inherit mpi; }; @@ -139,13 +138,12 @@ stdenv.mkDerivation rec { (lib.strings.cmakeBool "MPI" enableMpi) ]; - preConfigure = - '' - cmakeFlagsArray+=("-DLINALG_LIBRARIES=-lblas -llapack") - '' - + lib.optionalString enableMpi '' - export GAROOT=${globalarrays}; - ''; + preConfigure = '' + cmakeFlagsArray+=("-DLINALG_LIBRARIES=-lblas -llapack") + '' + + lib.optionalString enableMpi '' + export GAROOT=${globalarrays}; + ''; # The Makefile will install pymolcas during the build grrr. postConfigure = '' diff --git a/pkgs/by-name/op/openmpi/package.nix b/pkgs/by-name/op/openmpi/package.nix index dfb60eebab52..761b0e00c453 100644 --- a/pkgs/by-name/op/openmpi/package.nix +++ b/pkgs/by-name/op/openmpi/package.nix @@ -91,37 +91,35 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - buildInputs = - [ - zlib - libevent - hwloc - prrte - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libnl - numactl - pmix - ucx - ucc - ] - ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] - ++ lib.optionals (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isFreeBSD) [ rdma-core ] - # needed for internal pmix - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ python3 ] - ++ lib.optionals fabricSupport [ - libpsm2 - libfabric - ]; + buildInputs = [ + zlib + libevent + hwloc + prrte + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libnl + numactl + pmix + ucx + ucc + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] + ++ lib.optionals (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isFreeBSD) [ rdma-core ] + # needed for internal pmix + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ python3 ] + ++ lib.optionals fabricSupport [ + libpsm2 + libfabric + ]; - nativeBuildInputs = - [ - perl - removeReferencesTo - makeWrapper - ] - ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ] - ++ lib.optionals fortranSupport [ gfortran ]; + nativeBuildInputs = [ + perl + removeReferencesTo + makeWrapper + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ] + ++ lib.optionals fortranSupport [ gfortran ]; configureFlags = [ (lib.enableFeature cudaSupport "mca-dso") @@ -142,7 +140,8 @@ stdenv.mkDerivation (finalAttrs: { (lib.withFeatureAs fabricSupport "ofi" (lib.getDev libfabric)) # The flag --without-ofi-libdir is not supported from some reason, so we # don't use lib.withFeatureAs - ] ++ lib.optionals fabricSupport [ "--with-ofi-libdir=${lib.getLib libfabric}/lib" ]; + ] + ++ lib.optionals fabricSupport [ "--with-ofi-libdir=${lib.getLib libfabric}/lib" ]; enableParallelBuilding = true; @@ -151,60 +150,58 @@ stdenv.mkDerivation (finalAttrs: { # The file names we need to iterate are a combination of ${p}${s}, and there # are 7x3 such options. We use lib.mapCartesianProduct to iterate them all. fileNamesToIterate = { - p = - [ - "mpi" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "shmem" - "osh" - ]; - s = - [ - "c++" - "cxx" - "cc" - ] - ++ lib.optionals fortranSupport [ - "f77" - "f90" - "fort" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ "CC" ]; + p = [ + "mpi" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "shmem" + "osh" + ]; + s = [ + "c++" + "cxx" + "cc" + ] + ++ lib.optionals fortranSupport [ + "f77" + "f90" + "fort" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "CC" ]; + }; + wrapperDataSubstitutions = { + # The attr key is the filename prefix. The list's 1st value is the + # compiler=_ line that should be replaced by a compiler=#2 string, where + # #2 is the 2nd value in the list. + "cc" = [ + # "$CC" is expanded by the executing shell in the substituteInPlace + # commands to the name of the compiler ("clang" for Darwin and + # "gcc" for Linux) + "$CC" + "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}$CC" + ]; + "c++" = [ + # Same as with $CC + "$CXX" + "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}$CXX" + ]; + } + // lib.optionalAttrs fortranSupport { + "fort" = [ + "gfortran" + "${targetPackages.gfortran or gfortran}/bin/${ + targetPackages.gfortran.targetPrefix or gfortran.targetPrefix + }gfortran" + ]; }; - wrapperDataSubstitutions = - { - # The attr key is the filename prefix. The list's 1st value is the - # compiler=_ line that should be replaced by a compiler=#2 string, where - # #2 is the 2nd value in the list. - "cc" = [ - # "$CC" is expanded by the executing shell in the substituteInPlace - # commands to the name of the compiler ("clang" for Darwin and - # "gcc" for Linux) - "$CC" - "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}$CC" - ]; - "c++" = [ - # Same as with $CC - "$CXX" - "${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}$CXX" - ]; - } - // lib.optionalAttrs fortranSupport { - "fort" = [ - "gfortran" - "${targetPackages.gfortran or gfortran}/bin/${ - targetPackages.gfortran.targetPrefix or gfortran.targetPrefix - }gfortran" - ]; - }; # The -wrapper-data.txt files that are not symlinks, need to be iterated as # well, here they start withw ${part1}${part2}, and we use # lib.mapCartesianProduct as well. wrapperDataFileNames = { part1 = [ "mpi" - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "shmem" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "shmem" ]; part2 = builtins.attrNames wrapperDataSubstitutions; }; in diff --git a/pkgs/by-name/op/openocd/package.nix b/pkgs/by-name/op/openocd/package.nix index 9ce9e0f79f64..b18c935a5041 100644 --- a/pkgs/by-name/op/openocd/package.nix +++ b/pkgs/by-name/op/openocd/package.nix @@ -35,17 +35,18 @@ stdenv.mkDerivation rec { tcl ]; - buildInputs = - [ libusb1 ] - ++ lib.optionals notWindows [ - hidapi - jimtcl - libftdi1 - libjaylink - ] - ++ - # tracking issue for v2 api changes https://sourceforge.net/p/openocd/tickets/306/ - lib.optional stdenv.hostPlatform.isLinux libgpiod_1; + buildInputs = [ + libusb1 + ] + ++ lib.optionals notWindows [ + hidapi + jimtcl + libftdi1 + libjaylink + ] + ++ + # tracking issue for v2 api changes https://sourceforge.net/p/openocd/tickets/306/ + lib.optional stdenv.hostPlatform.isLinux libgpiod_1; configureFlags = [ "--disable-werror" @@ -57,7 +58,8 @@ stdenv.mkDerivation rec { (lib.enableFeature stdenv.hostPlatform.isLinux "sysfsgpio") (lib.enableFeature isWindows "internal-jimtcl") (lib.enableFeature isWindows "internal-libjaylink") - ] ++ map (hardware: "--enable-${hardware}") extraHardwareSupport; + ] + ++ map (hardware: "--enable-${hardware}") extraHardwareSupport; enableParallelBuilding = true; diff --git a/pkgs/by-name/op/openomf/package.nix b/pkgs/by-name/op/openomf/package.nix index 15a3172bbb8a..0feb0f61d3ac 100644 --- a/pkgs/by-name/op/openomf/package.nix +++ b/pkgs/by-name/op/openomf/package.nix @@ -67,20 +67,19 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; - postInstall = - '' - mkdir -p $out/share/icons/hicolor/256x256/apps - unzip -j ${assets} -d $out/share/games/openomf - unzip -p ${icons} omf-logo/omf-256x256.png > $out/share/icons/hicolor/256x256/apps/org.openomf.OpenOMF.png - install -Dm644 $src/resources/flatpak/org.openomf.OpenOMF.desktop $out/share/applications/org.openomf.OpenOMF.desktop - '' - + lib.optionalString withRemix '' - ln -s ${remix} $out/share/games/openomf/ARENA2.ogg - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/resources - ln -s $out/share/games/openomf/* $out/resources - ''; + postInstall = '' + mkdir -p $out/share/icons/hicolor/256x256/apps + unzip -j ${assets} -d $out/share/games/openomf + unzip -p ${icons} omf-logo/omf-256x256.png > $out/share/icons/hicolor/256x256/apps/org.openomf.OpenOMF.png + install -Dm644 $src/resources/flatpak/org.openomf.OpenOMF.desktop $out/share/applications/org.openomf.OpenOMF.desktop + '' + + lib.optionalString withRemix '' + ln -s ${remix} $out/share/games/openomf/ARENA2.ogg + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/resources + ln -s $out/share/games/openomf/* $out/resources + ''; meta = { description = "One Must Fall 2097 Remake"; diff --git a/pkgs/by-name/op/openorienteering-mapper/package.nix b/pkgs/by-name/op/openorienteering-mapper/package.nix index 53d907d0feb8..2b9489a08865 100644 --- a/pkgs/by-name/op/openorienteering-mapper/package.nix +++ b/pkgs/by-name/op/openorienteering-mapper/package.nix @@ -64,25 +64,24 @@ stdenv.mkDerivation rec { zlib ]; - cmakeFlags = - [ - # Building the manual and bundling licenses fails - # See https://github.com/NixOS/nixpkgs/issues/85306 - (lib.cmakeBool "LICENSING_PROVIDER" false) - (lib.cmakeBool "Mapper_MANUAL_QTHELP" false) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # FindGDAL is broken and always finds /Library/Framework unless this is - # specified - (lib.cmakeFeature "GDAL_INCLUDE_DIR" "${gdal}/include") - (lib.cmakeFeature "GDAL_CONFIG" "${gdal}/bin/gdal-config") - (lib.cmakeFeature "GDAL_LIBRARY" "${gdal}/lib/libgdal.dylib") - # Don't bundle libraries - (lib.cmakeBool "Mapper_PACKAGE_PROJ" false) - (lib.cmakeBool "Mapper_PACKAGE_QT" false) - (lib.cmakeBool "Mapper_PACKAGE_ASSISTANT" false) - (lib.cmakeBool "Mapper_PACKAGE_GDAL" false) - ]; + cmakeFlags = [ + # Building the manual and bundling licenses fails + # See https://github.com/NixOS/nixpkgs/issues/85306 + (lib.cmakeBool "LICENSING_PROVIDER" false) + (lib.cmakeBool "Mapper_MANUAL_QTHELP" false) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # FindGDAL is broken and always finds /Library/Framework unless this is + # specified + (lib.cmakeFeature "GDAL_INCLUDE_DIR" "${gdal}/include") + (lib.cmakeFeature "GDAL_CONFIG" "${gdal}/bin/gdal-config") + (lib.cmakeFeature "GDAL_LIBRARY" "${gdal}/lib/libgdal.dylib") + # Don't bundle libraries + (lib.cmakeBool "Mapper_PACKAGE_PROJ" false) + (lib.cmakeBool "Mapper_PACKAGE_QT" false) + (lib.cmakeBool "Mapper_PACKAGE_ASSISTANT" false) + (lib.cmakeBool "Mapper_PACKAGE_GDAL" false) + ]; postInstall = with stdenv; diff --git a/pkgs/by-name/op/openrgb/package.nix b/pkgs/by-name/op/openrgb/package.nix index 06d4cea41ef2..48bacfdf5f7f 100644 --- a/pkgs/by-name/op/openrgb/package.nix +++ b/pkgs/by-name/op/openrgb/package.nix @@ -22,27 +22,25 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-XBLj4EfupyeVHRc0pVI7hrXFoCNJ7ak2yO0QSfhBsGU="; }; - nativeBuildInputs = - [ - pkg-config - ] - ++ (with libsForQt5; [ - qmake - wrapQtAppsHook - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with libsForQt5; [ + qmake + wrapQtAppsHook + ]); - buildInputs = - [ + buildInputs = [ - libusb1 - hidapi - mbedtls_2 - ] - ++ (with libsForQt5; [ - qtbase - qttools - qtwayland - ]); + libusb1 + hidapi + mbedtls_2 + ] + ++ (with libsForQt5; [ + qtbase + qttools + qtwayland + ]); postPatch = '' patchShebangs scripts/build-udev-rules.sh diff --git a/pkgs/by-name/op/openroad/package.nix b/pkgs/by-name/op/openroad/package.nix index 2023f2606825..33f61e9271f3 100644 --- a/pkgs/by-name/op/openroad/package.nix +++ b/pkgs/by-name/op/openroad/package.nix @@ -63,35 +63,34 @@ stdenv.mkDerivation rec { swig ]; - buildInputs = - [ - boost186 - cbc - cimg - clp - cudd - eigen - glpk - lcov - lemon-graph - libjpeg - libsForQt5.qtbase - libsForQt5.qtcharts - libsForQt5.qtdeclarative - libsForQt5.qtsvg - or-tools - pcre - python3 - re2 - readline - spdlog - tcl - tclPackages.tclreadline - yosys - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ xorg.libX11 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; + buildInputs = [ + boost186 + cbc + cimg + clp + cudd + eigen + glpk + lcov + lemon-graph + libjpeg + libsForQt5.qtbase + libsForQt5.qtcharts + libsForQt5.qtdeclarative + libsForQt5.qtsvg + or-tools + pcre + python3 + re2 + readline + spdlog + tcl + tclPackages.tclreadline + yosys + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ xorg.libX11 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; postPatch = '' patchShebangs --build etc/find_messages.py @@ -99,21 +98,20 @@ stdenv.mkDerivation rec { sed 's/^.*partition_gcd/# \0/g' -i src/par/test/CMakeLists.txt ''; - cmakeFlags = - [ - (lib.cmakeBool "ENABLE_TESTS" true) - (lib.cmakeBool "USE_SYSTEM_BOOST" true) - (lib.cmakeBool "USE_SYSTEM_ABC" false) - (lib.cmakeBool "ABC_SKIP_TESTS" true) # it attempts to download gtest - (lib.cmakeBool "USE_SYSTEM_OPENSTA" false) - (lib.cmakeFeature "OPENROAD_VERSION" "${version}_${src.rev}") - (lib.cmakeBool "CMAKE_RULE_MESSAGES" false) - (lib.cmakeFeature "TCL_HEADER" "${tcl}/include/tcl.h") - (lib.cmakeFeature "TCL_LIBRARY" "${tcl}/lib/libtcl${stdenv.hostPlatform.extensions.sharedLibrary}") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED") - ]; + cmakeFlags = [ + (lib.cmakeBool "ENABLE_TESTS" true) + (lib.cmakeBool "USE_SYSTEM_BOOST" true) + (lib.cmakeBool "USE_SYSTEM_ABC" false) + (lib.cmakeBool "ABC_SKIP_TESTS" true) # it attempts to download gtest + (lib.cmakeBool "USE_SYSTEM_OPENSTA" false) + (lib.cmakeFeature "OPENROAD_VERSION" "${version}_${src.rev}") + (lib.cmakeBool "CMAKE_RULE_MESSAGES" false) + (lib.cmakeFeature "TCL_HEADER" "${tcl}/include/tcl.h") + (lib.cmakeFeature "TCL_LIBRARY" "${tcl}/lib/libtcl${stdenv.hostPlatform.extensions.sharedLibrary}") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED") + ]; # Resynthesis needs access to the Yosys binaries. qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ yosys ]}" ]; diff --git a/pkgs/by-name/op/opensbi/package.nix b/pkgs/by-name/op/opensbi/package.nix index de08b61f0892..19d7538e13cb 100644 --- a/pkgs/by-name/op/opensbi/package.nix +++ b/pkgs/by-name/op/opensbi/package.nix @@ -29,16 +29,15 @@ stdenv.mkDerivation (finalAttrs: { "I=$(out)" ]; - makeFlags = - [ - "PLATFORM=${withPlatform}" - ] - ++ lib.optionals (withPayload != null) [ - "FW_PAYLOAD_PATH=${withPayload}" - ] - ++ lib.optionals (withFDT != null) [ - "FW_FDT_PATH=${withFDT}" - ]; + makeFlags = [ + "PLATFORM=${withPlatform}" + ] + ++ lib.optionals (withPayload != null) [ + "FW_PAYLOAD_PATH=${withPayload}" + ] + ++ lib.optionals (withFDT != null) [ + "FW_FDT_PATH=${withFDT}" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/op/opensc/package.nix b/pkgs/by-name/op/opensc/package.nix index 8c642beb23da..059372dd9a8c 100644 --- a/pkgs/by-name/op/opensc/package.nix +++ b/pkgs/by-name/op/opensc/package.nix @@ -41,24 +41,25 @@ stdenv.mkDerivation rec { libXt libiconv docbook_xml_dtd_412 - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) pcsclite; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) pcsclite; env.NIX_CFLAGS_COMPILE = "-Wno-error"; - configureFlags = - [ - "--enable-zlib" - "--enable-readline" - "--enable-openssl" - "--enable-pcsc" - "--enable-sm" - "--enable-man" - "--enable-doc" - "--localstatedir=/var" - "--sysconfdir=/etc" - "--with-xsl-stylesheetsdir=${docbook_xsl}/xml/xsl/docbook" - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) + configureFlags = [ + "--enable-zlib" + "--enable-readline" + "--enable-openssl" + "--enable-pcsc" + "--enable-sm" + "--enable-man" + "--enable-doc" + "--localstatedir=/var" + "--sysconfdir=/etc" + "--with-xsl-stylesheetsdir=${docbook_xsl}/xml/xsl/docbook" + ] + ++ + lib.optional (!stdenv.hostPlatform.isDarwin) "--with-pcsc-provider=${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}"; installFlags = [ diff --git a/pkgs/by-name/op/openscad/package.nix b/pkgs/by-name/op/openscad/package.nix index f4d8d03de2d3..1609c8b42565 100644 --- a/pkgs/by-name/op/openscad/package.nix +++ b/pkgs/by-name/op/openscad/package.nix @@ -94,48 +94,46 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - eigen - boost - glew - opencsg - cgal - mpfr - gmp - glib - harfbuzz - lib3mf - libzip - double-conversion - freetype - fontconfig - libsForQt5.qtbase - libsForQt5.qtmultimedia - libsForQt5.qscintilla - cairo - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - libGL - wayland - wayland-protocols - libsForQt5.qtwayland - ] - ++ lib.optional stdenv.hostPlatform.isDarwin libsForQt5.qtmacextras - ++ lib.optional spacenavSupport libspnav; + buildInputs = [ + eigen + boost + glew + opencsg + cgal + mpfr + gmp + glib + harfbuzz + lib3mf + libzip + double-conversion + freetype + fontconfig + libsForQt5.qtbase + libsForQt5.qtmultimedia + libsForQt5.qscintilla + cairo + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGLU + libGL + wayland + wayland-protocols + libsForQt5.qtwayland + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libsForQt5.qtmacextras + ++ lib.optional spacenavSupport libspnav; - qmakeFlags = - [ - "VERSION=${version}" - "LIB3MF_INCLUDEPATH=${lib3mf.dev}/include/lib3mf/Bindings/Cpp" - "LIB3MF_LIBPATH=${lib3mf}/lib" - ] - ++ lib.optionals spacenavSupport [ - "ENABLE_SPNAV=1" - "SPNAV_INCLUDEPATH=${libspnav}/include" - "SPNAV_LIBPATH=${libspnav}/lib" - ]; + qmakeFlags = [ + "VERSION=${version}" + "LIB3MF_INCLUDEPATH=${lib3mf.dev}/include/lib3mf/Bindings/Cpp" + "LIB3MF_LIBPATH=${lib3mf}/lib" + ] + ++ lib.optionals spacenavSupport [ + "ENABLE_SPNAV=1" + "SPNAV_INCLUDEPATH=${libspnav}/include" + "SPNAV_LIBPATH=${libspnav}/lib" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/op/opensmt/package.nix b/pkgs/by-name/op/opensmt/package.nix index f0cf8e61d24e..ab9b532d06ac 100644 --- a/pkgs/by-name/op/opensmt/package.nix +++ b/pkgs/by-name/op/opensmt/package.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { buildInputs = [ libedit gmpxx - ] ++ lib.optional enableReadline readline; + ] + ++ lib.optional enableReadline readline; preConfigure = '' substituteInPlace test/CMakeLists.txt \ diff --git a/pkgs/by-name/op/opensp/package.nix b/pkgs/by-name/op/opensp/package.nix index bd1e08177a40..630a4d334b7f 100644 --- a/pkgs/by-name/op/opensp/package.nix +++ b/pkgs/by-name/op/opensp/package.nix @@ -49,20 +49,19 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - xmlto - docbook_xml_dtd_412 - docbook_xsl - ] - # Clang 16 fails to build due to inappropriate definitions in the `config.h` generated by the - # existing configure scripts. Regenerate them to make sure they detect its features correctly. - ++ lib.optional stdenv.cc.isClang autoreconfHook - ++ lib.optionals stdenv.hostPlatform.isCygwin [ - autoconf - automake - libtool - ]; + nativeBuildInputs = [ + xmlto + docbook_xml_dtd_412 + docbook_xsl + ] + # Clang 16 fails to build due to inappropriate definitions in the `config.h` generated by the + # existing configure scripts. Regenerate them to make sure they detect its features correctly. + ++ lib.optional stdenv.cc.isClang autoreconfHook + ++ lib.optionals stdenv.hostPlatform.isCygwin [ + autoconf + automake + libtool + ]; env = lib.optionalAttrs stdenv.cc.isGNU { NIX_CFLAGS_COMPILE = "-fpermissive"; diff --git a/pkgs/by-name/op/opensplat/package.nix b/pkgs/by-name/op/opensplat/package.nix index a9372c86b8aa..45791b230c1b 100644 --- a/pkgs/by-name/op/opensplat/package.nix +++ b/pkgs/by-name/op/opensplat/package.nix @@ -43,41 +43,38 @@ stdenv'.mkDerivation { }) ]; - nativeBuildInputs = - [ - cmake - ninja - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + ninja + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; - buildInputs = - [ - nlohmann_json - nanoflann - glm - cxxopts - torch.cxxdev - torch - opencv - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - ]; + buildInputs = [ + nlohmann_json + nanoflann + glm + cxxopts + torch.cxxdev + torch + opencv + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + ]; env.TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" python3.pkgs.torch.cudaCapabilities}"; - cmakeFlags = - [ - (lib.cmakeBool "CMAKE_SKIP_RPATH" true) - (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS") - ] - ++ lib.optionals cudaSupport [ - (lib.cmakeFeature "GPU_RUNTIME" "CUDA") - (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${cudaPackages.cudatoolkit}/") - ]; + cmakeFlags = [ + (lib.cmakeBool "CMAKE_SKIP_RPATH" true) + (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS") + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeFeature "GPU_RUNTIME" "CUDA") + (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${cudaPackages.cudatoolkit}/") + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/op/opensubdiv/package.nix b/pkgs/by-name/op/opensubdiv/package.nix index af8271b27387..5863da6a602e 100644 --- a/pkgs/by-name/op/opensubdiv/package.nix +++ b/pkgs/by-name/op/opensubdiv/package.nix @@ -33,15 +33,14 @@ stdenv.mkDerivation (finalAttrs: { "static" ]; - nativeBuildInputs = - [ - cmake - pkg-config - python3 - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + cmake + pkg-config + python3 + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; buildInputs = lib.optionals stdenv.hostPlatform.isUnix [ @@ -77,24 +76,23 @@ stdenv.mkDerivation (finalAttrs: { ) ''; - cmakeFlags = - [ - (lib.mapAttrsToList lib.cmakeBool { - NO_TUTORIALS = true; - NO_REGRESSION = true; - NO_EXAMPLES = true; - NO_DX = stdenv.hostPlatform.isWindows; - NO_METAL = !stdenv.hostPlatform.isDarwin; - NO_OPENCL = !openclSupport; - NO_CUDA = !cudaSupport; - }) - ] - ++ lib.optionals (stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isDarwin) [ - (lib.mapAttrsToList lib.cmakeFeature { - GLEW_INCLUDE_DIR = "${glew.dev}/include"; - GLEW_LIBRARY = "${glew.dev}/lib"; - }) - ]; + cmakeFlags = [ + (lib.mapAttrsToList lib.cmakeBool { + NO_TUTORIALS = true; + NO_REGRESSION = true; + NO_EXAMPLES = true; + NO_DX = stdenv.hostPlatform.isWindows; + NO_METAL = !stdenv.hostPlatform.isDarwin; + NO_OPENCL = !openclSupport; + NO_CUDA = !cudaSupport; + }) + ] + ++ lib.optionals (stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isDarwin) [ + (lib.mapAttrsToList lib.cmakeFeature { + GLEW_INCLUDE_DIR = "${glew.dev}/include"; + GLEW_LIBRARY = "${glew.dev}/lib"; + }) + ]; preBuild = let diff --git a/pkgs/by-name/op/opentelemetry-cpp/package.nix b/pkgs/by-name/op/opentelemetry-cpp/package.nix index 8d7640cb12b2..000208061581 100644 --- a/pkgs/by-name/op/opentelemetry-cpp/package.nix +++ b/pkgs/by-name/op/opentelemetry-cpp/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./0001-Disable-tests-requiring-network-access.patch - ] ++ lib.optional stdenv.hostPlatform.isDarwin ./0002-Disable-segfaulting-test-on-Darwin.patch; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin ./0002-Disable-segfaulting-test-on-Darwin.patch; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/by-name/op/openturns/package.nix b/pkgs/by-name/op/openturns/package.nix index cef3211f0053..b0a96fd5f650 100644 --- a/pkgs/by-name/op/openturns/package.nix +++ b/pkgs/by-name/op/openturns/package.nix @@ -36,31 +36,31 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake - ] ++ lib.optionals enablePython [ python3Packages.sphinx ]; + ] + ++ lib.optionals enablePython [ python3Packages.sphinx ]; - buildInputs = - [ - (lib.getLib primesieve) - boost - ceres-solver - cminpack - dlib - hdf5 - hmat-oss - ipopt - libxml2 - nlopt - pagmo2 - spectra - swig - tbb - ] - ++ lib.optionals enablePython [ - python3Packages.dill - python3Packages.matplotlib - python3Packages.psutil - python3Packages.python - ]; + buildInputs = [ + (lib.getLib primesieve) + boost + ceres-solver + cminpack + dlib + hdf5 + hmat-oss + ipopt + libxml2 + nlopt + pagmo2 + spectra + swig + tbb + ] + ++ lib.optionals enablePython [ + python3Packages.dill + python3Packages.matplotlib + python3Packages.psutil + python3Packages.python + ]; cmakeFlags = [ (lib.cmakeBool "BUILD_PYTHON" enablePython) diff --git a/pkgs/by-name/op/openvino/package.nix b/pkgs/by-name/op/openvino/package.nix index 041a09c686eb..188ff12895e8 100644 --- a/pkgs/by-name/op/openvino/package.nix +++ b/pkgs/by-name/op/openvino/package.nix @@ -76,22 +76,21 @@ stdenv.mkDerivation rec { "python" ]; - nativeBuildInputs = - [ - addDriverRunpath - autoPatchelfHook - cmake - git - libarchive - patchelf - pkg-config - python - scons' - shellcheck - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + addDriverRunpath + autoPatchelfHook + cmake + git + libarchive + patchelf + pkg-config + python + scons' + shellcheck + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; postPatch = '' mkdir -p temp/tbbbind_${tbbbind_version} @@ -147,22 +146,21 @@ stdenv.mkDerivation rec { # src/graph/src/plugins/intel_gpu/src/graph/include/reorder_inst.h:24:8: error: type 'struct typed_program_node' violates the C++ One Definition Rule [-Werror=odr] env.NIX_CFLAGS_COMPILE = "-Wno-odr"; - buildInputs = - [ - flatbuffers - gflags - level-zero - libusb1 - libxml2 - ocl-icd - opencv - pugixml - snappy - tbb_2022 - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_cudart - ]; + buildInputs = [ + flatbuffers + gflags + level-zero + libusb1 + libxml2 + ocl-icd + opencv + pugixml + snappy + tbb_2022 + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_cudart + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/op/openvpn3/package.nix b/pkgs/by-name/op/openvpn3/package.nix index f1824af06647..0b4598642abc 100644 --- a/pkgs/by-name/op/openvpn3/package.nix +++ b/pkgs/by-name/op/openvpn3/package.nix @@ -87,7 +87,8 @@ stdenv.mkDerivation rec { protobuf tinyxml-2 gdbuspp - ] ++ lib.optionals enableSystemdResolved [ systemd.dev ]; + ] + ++ lib.optionals enableSystemdResolved [ systemd.dev ]; mesonFlags = [ (lib.mesonOption "selinux" "disabled") diff --git a/pkgs/by-name/op/openvscode-server/package.nix b/pkgs/by-name/op/openvscode-server/package.nix index 44c2babca569..3a1b58273e2b 100644 --- a/pkgs/by-name/op/openvscode-server/package.nix +++ b/pkgs/by-name/op/openvscode-server/package.nix @@ -123,25 +123,24 @@ stdenv.mkDerivation (finalAttrs: { # remove all built-in extensions, as these are 3rd party extensions that # get downloaded from vscode marketplace - postPatch = - '' - jq --slurp '.[0] * .[1]' "product.json" <( - cat << EOF - { - "builtInExtensions": [] - } - EOF - ) | sponge product.json - echo "Updated product.json" - '' - ## build/lib/node.ts picks up nodejs version from remote/.npmrc - ## and prefetches it into .build/node/v{version}/{target}/node - ## so we pre-seed it here - + '' - sed -i 's/target=.*/target="${nodejs.version}"/' remote/.npmrc - mkdir -p .build/node/v${nodejs.version}/${vsBuildTarget} - ln -s ${nodejs}/bin/node .build/node/v${nodejs.version}/${vsBuildTarget}/node - ''; + postPatch = '' + jq --slurp '.[0] * .[1]' "product.json" <( + cat << EOF + { + "builtInExtensions": [] + } + EOF + ) | sponge product.json + echo "Updated product.json" + '' + ## build/lib/node.ts picks up nodejs version from remote/.npmrc + ## and prefetches it into .build/node/v{version}/{target}/node + ## so we pre-seed it here + + '' + sed -i 's/target=.*/target="${nodejs.version}"/' remote/.npmrc + mkdir -p .build/node/v${nodejs.version}/${vsBuildTarget} + ln -s ${nodejs}/bin/node .build/node/v${nodejs.version}/${vsBuildTarget}/node + ''; preConfigure = '' export HOME=$TMPDIR/home @@ -154,62 +153,61 @@ stdenv.mkDerivation (finalAttrs: { export npm_config_cache=$TMPDIR/cache ''; - configurePhase = - '' - runHook preConfigure - '' - ## unpack all of the prefetched node_modules folders - + '' - for p in $(find -name package-lock.json -exec dirname {} \;) - do ( - echo "Setting up $p/node_modules" - cd $p - if [ -e node_modules ] - then - echo >&2 "File exists $p/node_modules" - exit 0 - fi - npm ci --ignore-scripts - patchShebangs node_modules - ) - done - '' - ## put ripgrep binary into bin so postinstall does not try to download it - + '' - find -path "*@vscode/ripgrep" -type d \ - -execdir mkdir -p {}/bin \; \ - -execdir ln -s ${ripgrep}/bin/rg {}/bin/rg \; - '' - ## pre-seed node-gyp - + '' - mkdir -p $HOME/.node-gyp/${nodejs.version} - echo 11 > $HOME/.node-gyp/${nodejs.version}/installVersion - ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version} - '' - ## node-pty build fix - + '' - substituteInPlace remote/node_modules/node-pty/scripts/post-install.js \ - --replace-fail "npx node-gyp" "$npm_config_node_gyp" - '' - ## rebuild native binaries - + '' - echo >&2 "Rebuilding from source in ./remote" - npm --offline --prefix ./remote rebuild --build-from-source - '' - ## run postinstall scripts - + '' - find -name package.json -type f -exec sh -c ' - if jq -e ".scripts.postinstall" {} >- - then - echo >&2 "Running postinstall script in $(dirname {})" - npm --offline --prefix=$(dirname {}) run postinstall - fi + configurePhase = '' + runHook preConfigure + '' + ## unpack all of the prefetched node_modules folders + + '' + for p in $(find -name package-lock.json -exec dirname {} \;) + do ( + echo "Setting up $p/node_modules" + cd $p + if [ -e node_modules ] + then + echo >&2 "File exists $p/node_modules" exit 0 - ' \; - '' - + '' - runHook postConfigure - ''; + fi + npm ci --ignore-scripts + patchShebangs node_modules + ) + done + '' + ## put ripgrep binary into bin so postinstall does not try to download it + + '' + find -path "*@vscode/ripgrep" -type d \ + -execdir mkdir -p {}/bin \; \ + -execdir ln -s ${ripgrep}/bin/rg {}/bin/rg \; + '' + ## pre-seed node-gyp + + '' + mkdir -p $HOME/.node-gyp/${nodejs.version} + echo 11 > $HOME/.node-gyp/${nodejs.version}/installVersion + ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version} + '' + ## node-pty build fix + + '' + substituteInPlace remote/node_modules/node-pty/scripts/post-install.js \ + --replace-fail "npx node-gyp" "$npm_config_node_gyp" + '' + ## rebuild native binaries + + '' + echo >&2 "Rebuilding from source in ./remote" + npm --offline --prefix ./remote rebuild --build-from-source + '' + ## run postinstall scripts + + '' + find -name package.json -type f -exec sh -c ' + if jq -e ".scripts.postinstall" {} >- + then + echo >&2 "Running postinstall script in $(dirname {})" + npm --offline --prefix=$(dirname {}) run postinstall + fi + exit 0 + ' \; + '' + + '' + runHook postConfigure + ''; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/op/openvswitch/package.nix b/pkgs/by-name/op/openvswitch/package.nix index ba0493a7b767..7681aaf86f9d 100644 --- a/pkgs/by-name/op/openvswitch/package.nix +++ b/pkgs/by-name/op/openvswitch/package.nix @@ -63,21 +63,20 @@ stdenv.mkDerivation rec { sphinxRoot = "./Documentation"; - buildInputs = - [ - libcap_ng - openssl - perl - procps - python3 - util-linux - which - ] - ++ (lib.optionals withDPDK [ - dpdk - numactl - libpcap - ]); + buildInputs = [ + libcap_ng + openssl + perl + procps + python3 + util-linux + which + ] + ++ (lib.optionals withDPDK [ + dpdk + numactl + libpcap + ]); preConfigure = "./boot.sh"; @@ -85,7 +84,8 @@ stdenv.mkDerivation rec { "--localstatedir=/var" "--sharedstatedir=/var" "--sbindir=$(out)/bin" - ] ++ (lib.optionals withDPDK [ "--with-dpdk=shared" ]); + ] + ++ (lib.optionals withDPDK [ "--with-dpdk=shared" ]); # Leave /var out of this! installFlags = [ @@ -116,14 +116,15 @@ stdenv.mkDerivation rec { patchShebangs tests/ ''; - nativeCheckInputs = - [ iproute2 ] - ++ (with python3.pkgs; [ - netaddr - pyparsing - pytest - setuptools - ]); + nativeCheckInputs = [ + iproute2 + ] + ++ (with python3.pkgs; [ + netaddr + pyparsing + pytest + setuptools + ]); passthru = { tests = { diff --git a/pkgs/by-name/op/ophcrack/package.nix b/pkgs/by-name/op/ophcrack/package.nix index 3379e9818f60..57e079c1e273 100644 --- a/pkgs/by-name/op/ophcrack/package.nix +++ b/pkgs/by-name/op/ophcrack/package.nix @@ -31,22 +31,24 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ pkg-config ] ++ lib.optional enableGui libsForQt5.wrapQtAppsHook; - buildInputs = - [ openssl ] - ++ (if enableGui then [ libsForQt5.qtcharts ] else [ expat ]) - ++ lib.optional stdenv.hostPlatform.isDarwin expat; + buildInputs = [ + openssl + ] + ++ (if enableGui then [ libsForQt5.qtcharts ] else [ expat ]) + ++ lib.optional stdenv.hostPlatform.isDarwin expat; - configureFlags = - [ "--with-libssl" ] - ++ ( - if enableGui then - [ - "--enable-gui" - "--with-qt5charts" - ] - else - [ "--disable-gui" ] - ); + configureFlags = [ + "--with-libssl" + ] + ++ ( + if enableGui then + [ + "--enable-gui" + "--with-qt5charts" + ] + else + [ "--disable-gui" ] + ); installPhase = lib.optional stdenv.hostPlatform.isDarwin '' mkdir -p $out/bin diff --git a/pkgs/by-name/op/optee-client/package.nix b/pkgs/by-name/op/optee-client/package.nix index dbe59890d452..49743c558c04 100644 --- a/pkgs/by-name/op/optee-client/package.nix +++ b/pkgs/by-name/op/optee-client/package.nix @@ -35,15 +35,14 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ libuuid ]; - makeFlags = - [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - "DESTDIR=$(out)" - "SBINDIR=/bin" - "INCLUDEDIR=/include" - "LIBDIR=/lib" - ] - ++ + makeFlags = [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + "DESTDIR=$(out)" + "SBINDIR=/bin" + "INCLUDEDIR=/include" + "LIBDIR=/lib" + ] + ++ # If we are building for NixOS, change default optee config to use paths # that will work well with NixOS. lib.optionals isNixOS [ diff --git a/pkgs/by-name/op/optipng/package.nix b/pkgs/by-name/op/optipng/package.nix index af30a5770c62..dddd5cf53254 100644 --- a/pkgs/by-name/op/optipng/package.nix +++ b/pkgs/by-name/op/optipng/package.nix @@ -30,14 +30,13 @@ stdenv.mkDerivation rec { dontAddStaticConfigureFlags = true; configurePlatforms = [ ]; - configureFlags = - [ - "--with-system-zlib" - "--with-system-libpng" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - #"-prefix=$out" - ]; + configureFlags = [ + "--with-system-zlib" + "--with-system-libpng" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + #"-prefix=$out" + ]; postInstall = if stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isWindows then diff --git a/pkgs/by-name/op/opusfile/package.nix b/pkgs/by-name/op/opusfile/package.nix index d10a43cfa4f8..18960a5c0224 100644 --- a/pkgs/by-name/op/opusfile/package.nix +++ b/pkgs/by-name/op/opusfile/package.nix @@ -27,18 +27,17 @@ stdenv.mkDerivation rec { "out" "dev" ]; - patches = - [ - ./include-multistream.patch - (fetchpatch { - name = "CVE-2022-47021.patch"; - url = "https://github.com/xiph/opusfile/commit/0a4cd796df5b030cb866f3f4a5e41a4b92caddf5.patch"; - sha256 = "sha256-XThI/ys5caB+OncFVfxm5IsvQPy1MbLQKwIlYjPvTJQ="; - }) - ] - # fixes problem with openssl 1.1 dependency - # see https://github.com/xiph/opusfile/issues/13 - ++ lib.optionals stdenv.hostPlatform.isWindows [ ./disable-cert-store.patch ]; + patches = [ + ./include-multistream.patch + (fetchpatch { + name = "CVE-2022-47021.patch"; + url = "https://github.com/xiph/opusfile/commit/0a4cd796df5b030cb866f3f4a5e41a4b92caddf5.patch"; + sha256 = "sha256-XThI/ys5caB+OncFVfxm5IsvQPy1MbLQKwIlYjPvTJQ="; + }) + ] + # fixes problem with openssl 1.1 dependency + # see https://github.com/xiph/opusfile/issues/13 + ++ lib.optionals stdenv.hostPlatform.isWindows [ ./disable-cert-store.patch ]; configureFlags = [ "--disable-examples" ]; meta = with lib; { diff --git a/pkgs/by-name/op/opustags/package.nix b/pkgs/by-name/op/opustags/package.nix index 3f999d9513c8..eb1901819b2a 100644 --- a/pkgs/by-name/op/opustags/package.nix +++ b/pkgs/by-name/op/opustags/package.nix @@ -26,22 +26,22 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; buildInputs = [ libogg ]; doCheck = true; - nativeCheckInputs = - [ - ffmpeg - glibcLocales - perl - ] - ++ (with perlPackages; [ - ListMoreUtils - TestDeep - ]); + nativeCheckInputs = [ + ffmpeg + glibcLocales + perl + ] + ++ (with perlPackages; [ + ListMoreUtils + TestDeep + ]); checkPhase = '' export LANG="en_US.UTF-8" diff --git a/pkgs/by-name/or/or-tools/package.nix b/pkgs/by-name/or/or-tools/package.nix index f391bafc6492..dae04d0b1503 100644 --- a/pkgs/by-name/or/or-tools/package.nix +++ b/pkgs/by-name/or/or-tools/package.nix @@ -59,52 +59,49 @@ stdenv.mkDerivation (finalAttrs: { # or-tools normally attempts to build Protobuf for the build platform when # cross-compiling. Instead, just tell it where to find protoc. - postPatch = - '' - echo "set(PROTOC_PRG $(type -p protoc))" > cmake/host.cmake - '' - # Patches from OpenSUSE: - # https://build.opensuse.org/projects/science/packages/google-or-tools/files/google-or-tools.spec?expand=1 - + '' - sed -i -e '/CMAKE_DEPENDENT_OPTION(INSTALL_DOC/ s/BUILD_CXX AND BUILD_DOC/BUILD_CXX/' CMakeLists.txt - find . -iname \*CMakeLists.txt -exec sed -i -e 's/pybind11_native_proto_caster/pybind11_protobuf::pybind11_native_proto_caster/' '{}' \; - sed -i -e 's/TARGET pybind11_native_proto_caster/TARGET pybind11_protobuf::pybind11_native_proto_caster/' cmake/check_deps.cmake - sed -i -e "/protobuf/ { s/.*,/'protobuf >= 5.26',/ }" ortools/python/setup.py.in - ''; + postPatch = '' + echo "set(PROTOC_PRG $(type -p protoc))" > cmake/host.cmake + '' + # Patches from OpenSUSE: + # https://build.opensuse.org/projects/science/packages/google-or-tools/files/google-or-tools.spec?expand=1 + + '' + sed -i -e '/CMAKE_DEPENDENT_OPTION(INSTALL_DOC/ s/BUILD_CXX AND BUILD_DOC/BUILD_CXX/' CMakeLists.txt + find . -iname \*CMakeLists.txt -exec sed -i -e 's/pybind11_native_proto_caster/pybind11_protobuf::pybind11_native_proto_caster/' '{}' \; + sed -i -e 's/TARGET pybind11_native_proto_caster/TARGET pybind11_protobuf::pybind11_native_proto_caster/' cmake/check_deps.cmake + sed -i -e "/protobuf/ { s/.*,/'protobuf >= 5.26',/ }" ortools/python/setup.py.in + ''; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_DEPS" false) - (lib.cmakeBool "BUILD_PYTHON" true) - (lib.cmakeBool "BUILD_pybind11" false) - (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") - (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include") - (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") - (lib.cmakeBool "FETCH_PYTHON_DEPS" false) - (lib.cmakeBool "USE_GLPK" true) - (lib.cmakeBool "USE_SCIP" false) - (lib.cmakeFeature "Python3_EXECUTABLE" "${python3.pythonOnBuildForHost.interpreter}") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeBool "CMAKE_MACOSX_RPATH" false) - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_DEPS" false) + (lib.cmakeBool "BUILD_PYTHON" true) + (lib.cmakeBool "BUILD_pybind11" false) + (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") + (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "include") + (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") + (lib.cmakeBool "FETCH_PYTHON_DEPS" false) + (lib.cmakeBool "USE_GLPK" true) + (lib.cmakeBool "USE_SCIP" false) + (lib.cmakeFeature "Python3_EXECUTABLE" "${python3.pythonOnBuildForHost.interpreter}") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeBool "CMAKE_MACOSX_RPATH" false) + ]; strictDeps = true; - nativeBuildInputs = - [ - cmake - ensureNewerSourcesForZipFilesHook - pkg-config - python3.pythonOnBuildForHost - swig - unzip - ] - ++ (with python3.pythonOnBuildForHost.pkgs; [ - pip - mypy-protobuf - mypy - ]); + nativeBuildInputs = [ + cmake + ensureNewerSourcesForZipFilesHook + pkg-config + python3.pythonOnBuildForHost + swig + unzip + ] + ++ (with python3.pythonOnBuildForHost.pkgs; [ + pip + mypy-protobuf + mypy + ]); buildInputs = [ abseil-cpp bzip2 diff --git a/pkgs/by-name/or/oracle-instantclient/package.nix b/pkgs/by-name/or/oracle-instantclient/package.nix index 84908f01511c..2274a77b7054 100644 --- a/pkgs/by-name/or/oracle-instantclient/package.nix +++ b/pkgs/by-name/or/oracle-instantclient/package.nix @@ -25,7 +25,8 @@ let "sdk" "sqlplus" "tools" - ] ++ optional odbcSupport "odbc"; + ] + ++ optional odbcSupport "odbc"; # determine the version number, there might be different ones per architecture version = @@ -142,20 +143,18 @@ in stdenv.mkDerivation { inherit pname version srcs; - buildInputs = - [ - (lib.getLib stdenv.cc.cc) - ] - ++ optional stdenv.hostPlatform.isLinux libaio - ++ optional odbcSupport unixODBC; + buildInputs = [ + (lib.getLib stdenv.cc.cc) + ] + ++ optional stdenv.hostPlatform.isLinux libaio + ++ optional odbcSupport unixODBC; - nativeBuildInputs = - [ - makeWrapper - (if isDarwinAarch64 then _7zz else unzip) - ] - ++ optional stdenv.hostPlatform.isLinux autoPatchelfHook - ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + nativeBuildInputs = [ + makeWrapper + (if isDarwinAarch64 then _7zz else unzip) + ] + ++ optional stdenv.hostPlatform.isLinux autoPatchelfHook + ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; outputs = [ "out" diff --git a/pkgs/by-name/or/oranda/package.nix b/pkgs/by-name/or/oranda/package.nix index 482bd1c767f3..5bdc6d8a3145 100644 --- a/pkgs/by-name/or/oranda/package.nix +++ b/pkgs/by-name/or/oranda/package.nix @@ -37,15 +37,14 @@ rustPlatform.buildRustPackage rec { "--skip=integration" ]; - env = - { - RUSTONIG_SYSTEM_LIBONIG = true; - ORANDA_USE_TAILWIND_BINARY = true; - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - # without this, tailwindcss fails with OpenSSL configuration error - OPENSSL_CONF = ""; - }; + env = { + RUSTONIG_SYSTEM_LIBONIG = true; + ORANDA_USE_TAILWIND_BINARY = true; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # without this, tailwindcss fails with OpenSSL configuration error + OPENSSL_CONF = ""; + }; meta = with lib; { description = "Generate beautiful landing pages for your developer tools"; diff --git a/pkgs/by-name/or/orbiton/package.nix b/pkgs/by-name/or/orbiton/package.nix index afefb89ddb9d..df7d926d59bd 100644 --- a/pkgs/by-name/or/orbiton/package.nix +++ b/pkgs/by-name/or/orbiton/package.nix @@ -37,16 +37,15 @@ buildGoModule rec { "-skip=TestPBcopy" # Requires impure pbcopy and pbpaste ]; - postInstall = - '' - cd .. - installManPage o.1 - mv $out/bin/{orbiton,o} - '' - + lib.optionalString withGui '' - make install-gui PREFIX=$out - wrapProgram $out/bin/og --prefix PATH : $out/bin - ''; + postInstall = '' + cd .. + installManPage o.1 + mv $out/bin/{orbiton,o} + '' + + lib.optionalString withGui '' + make install-gui PREFIX=$out + wrapProgram $out/bin/og --prefix PATH : $out/bin + ''; meta = { description = "Config-free text editor and IDE limited to VT100"; diff --git a/pkgs/by-name/or/orc/package.nix b/pkgs/by-name/or/orc/package.nix index d88ff17b0312..f4d6e15bd1b5 100644 --- a/pkgs/by-name/or/orc/package.nix +++ b/pkgs/by-name/or/orc/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optional buildDevDoc "devdoc"; + ] + ++ lib.optional buildDevDoc "devdoc"; outputBin = "dev"; # compilation tools src = fetchurl { @@ -40,16 +41,15 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonEnable "gtk_doc" buildDevDoc) ]; - nativeBuildInputs = - [ - meson - ninja - ] - ++ lib.optionals buildDevDoc [ - gtk-doc - file - docbook-xsl-nons - ]; + nativeBuildInputs = [ + meson + ninja + ] + ++ lib.optionals buildDevDoc [ + gtk-doc + file + docbook-xsl-nons + ]; # https://gitlab.freedesktop.org/gstreamer/orc/-/issues/41 doCheck = diff --git a/pkgs/by-name/or/orca-slicer/package.nix b/pkgs/by-name/or/orca-slicer/package.nix index ca46b28ccdee..7e817859988a 100644 --- a/pkgs/by-name/or/orca-slicer/package.nix +++ b/pkgs/by-name/or/orca-slicer/package.nix @@ -73,54 +73,53 @@ stdenv.mkDerivation (finalAttrs: { wxGTK' ]; - buildInputs = - [ - binutils - (boost186.override { - enableShared = true; - enableStatic = false; - extraFeatures = [ - "log" - "thread" - "filesystem" - ]; - }) - boost186.dev - cereal - cgal - curl - dbus - eigen - expat - ffmpeg - gcc-unwrapped - glew - glfw - glib - glib-networking - gmp - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-good - gtk3 - hicolor-icon-theme - ilmbase - libpng - mpfr - nlopt - opencascade-occt_7_6 - openvdb - pcre - tbb_2021 - webkitgtk_4_0 - wxGTK' - xorg.libX11 - opencv.cxxdev - libnoise - ] - ++ lib.optionals withSystemd [ systemd ] - ++ finalAttrs.checkInputs; + buildInputs = [ + binutils + (boost186.override { + enableShared = true; + enableStatic = false; + extraFeatures = [ + "log" + "thread" + "filesystem" + ]; + }) + boost186.dev + cereal + cgal + curl + dbus + eigen + expat + ffmpeg + gcc-unwrapped + glew + glfw + glib + glib-networking + gmp + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-good + gtk3 + hicolor-icon-theme + ilmbase + libpng + mpfr + nlopt + opencascade-occt_7_6 + openvdb + pcre + tbb_2021 + webkitgtk_4_0 + wxGTK' + xorg.libX11 + opencv.cxxdev + libnoise + ] + ++ lib.optionals withSystemd [ systemd ] + ++ finalAttrs.checkInputs; patches = [ # Fix for webkitgtk linking diff --git a/pkgs/by-name/os/osi/package.nix b/pkgs/by-name/os/osi/package.nix index 98b73755866b..2c1a6f95def0 100644 --- a/pkgs/by-name/os/osi/package.nix +++ b/pkgs/by-name/os/osi/package.nix @@ -25,15 +25,14 @@ stdenv.mkDerivation rec { hash = "sha256-3aTO7JGEOP/RCOZ1X9b68rrtv6T78euf1TYGTjyXSRE="; }; - buildInputs = - [ - blas - zlib - bzip2 - coin-utils - ] - ++ lib.optional withGurobi gurobi - ++ lib.optional withCplex cplex; + buildInputs = [ + blas + zlib + bzip2 + coin-utils + ] + ++ lib.optional withGurobi gurobi + ++ lib.optional withCplex cplex; nativeBuildInputs = [ gfortran pkg-config diff --git a/pkgs/by-name/os/osm2pgsql/package.nix b/pkgs/by-name/os/osm2pgsql/package.nix index 71108ffee7d0..ff28e839e94a 100644 --- a/pkgs/by-name/os/osm2pgsql/package.nix +++ b/pkgs/by-name/os/osm2pgsql/package.nix @@ -41,30 +41,29 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - boost - bzip2 - cli11 - expat - fmt_11 - libosmium - libpq - nlohmann_json - opencv - potrace - proj - protozero - (python3.withPackages ( - p: with p; [ - psycopg2 - pyosmium - ] - )) - zlib - ] - ++ lib.optional withLuaJIT luajit - ++ lib.optional (!withLuaJIT) lua; + buildInputs = [ + boost + bzip2 + cli11 + expat + fmt_11 + libosmium + libpq + nlohmann_json + opencv + potrace + proj + protozero + (python3.withPackages ( + p: with p; [ + psycopg2 + pyosmium + ] + )) + zlib + ] + ++ lib.optional withLuaJIT luajit + ++ lib.optional (!withLuaJIT) lua; cmakeFlags = [ (lib.cmakeBool "EXTERNAL_LIBOSMIUM" true) diff --git a/pkgs/by-name/os/ostree/package.nix b/pkgs/by-name/os/ostree/package.nix index b9cfa532807c..fb9d75d90624 100644 --- a/pkgs/by-name/os/ostree/package.nix +++ b/pkgs/by-name/os/ostree/package.nix @@ -80,67 +80,64 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - autoconf - automake - libtool - pkg-config - glib - gtk-doc - which - makeWrapper - bison - libxslt - docbook-xsl-nons - docbook_xml_dtd_42 - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + autoconf + automake + libtool + pkg-config + glib + gtk-doc + which + makeWrapper + bison + libxslt + docbook-xsl-nons + docbook_xml_dtd_42 + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; - buildInputs = - [ - curl - glib - e2fsprogs - libsoup_3 # for trivial-httpd for tests - gpgme - fuse3 - libselinux - libsodium - libcap - libarchive - bzip2 - xz - util-linuxMinimal # for libmount + buildInputs = [ + curl + glib + e2fsprogs + libsoup_3 # for trivial-httpd for tests + gpgme + fuse3 + libselinux + libsodium + libcap + libarchive + bzip2 + xz + util-linuxMinimal # for libmount - # for installed tests - testPython - ] - ++ lib.optionals withComposefs [ - (lib.getDev composefs) - ] - ++ lib.optionals withGjs [ - gjs - ] - ++ lib.optionals withSystemd [ - systemd - ]; + # for installed tests + testPython + ] + ++ lib.optionals withComposefs [ + (lib.getDev composefs) + ] + ++ lib.optionals withGjs [ + gjs + ] + ++ lib.optionals withSystemd [ + systemd + ]; enableParallelBuilding = true; - configureFlags = - [ - "--with-curl" - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators" - "--enable-installed-tests" - "--with-ed25519-libsodium" - ] - ++ lib.optionals withComposefs [ - "--with-composefs" - ]; + configureFlags = [ + "--with-curl" + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators" + "--enable-installed-tests" + "--with-ed25519-libsodium" + ] + ++ lib.optionals withComposefs [ + "--with-composefs" + ]; makeFlags = [ "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/libostree" diff --git a/pkgs/by-name/ot/otb/package.nix b/pkgs/by-name/ot/otb/package.nix index 67b3bb0e0c78..544a4a46fcec 100644 --- a/pkgs/by-name/ot/otb/package.nix +++ b/pkgs/by-name/ot/otb/package.nix @@ -50,16 +50,15 @@ let # filter out gdcm, libminc from list of ITK deps as it's not needed for OTB itkVersion = "5.3.0"; itkMajorMinorVersion = lib.versions.majorMinor itkVersion; - itkDepsToRemove = - [ - "gdcm" - "libminc" - ] - ++ optionals (!enableFFTW) [ - # remove fftw to avoid GPL contamination - # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2454#note_112821 - "fftw" - ]; + itkDepsToRemove = [ + "gdcm" + "libminc" + ] + ++ optionals (!enableFFTW) [ + # remove fftw to avoid GPL contamination + # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2454#note_112821 + "fftw" + ]; itkIsInDepsToRemove = dep: builtins.any (d: d == dep.name) itkDepsToRemove; # remove after https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2451 @@ -97,11 +96,9 @@ let ]; # fix the CMake config files for ITK which contains double slashes - postInstall = - (oldArgs.postInstall or "") - + '' - sed -i 's|''${ITK_INSTALL_PREFIX}//nix/store|/nix/store|g' $out/lib/cmake/ITK-${itkMajorMinorVersion}/ITKConfig.cmake - ''; + postInstall = (oldArgs.postInstall or "") + '' + sed -i 's|''${ITK_INSTALL_PREFIX}//nix/store|/nix/store|g' $out/lib/cmake/ITK-${itkMajorMinorVersion}/ITKConfig.cmake + ''; cmakeFlags = oldArgs.cmakeFlags or [ ] ++ [ (lib.cmakeBool "ITK_USE_SYSTEM_EIGEN" true) @@ -233,17 +230,16 @@ stdenv.mkDerivation (finalAttrs: { ./1-otb-swig-include-itk.diff ]; - postPatch = - '' - substituteInPlace Modules/Core/Wrappers/SWIG/src/python/CMakeLists.txt \ - --replace-fail ''\'''${ITK_INCLUDE_DIRS}' "${otb-itk}/include/ITK-${itkMajorMinorVersion}" - '' - # Add the header file "vcl_legacy_aliases.h", which defines the legacy vcl_* functions. - # This patch fixes the unreproducible build of OTB. - # See https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2484. - + '' - sed -i '/#include "vcl_compiler.h"/a #include "vcl_legacy_aliases.h"' Modules/Core/Mosaic/include/otbMosaicFunctors.h - ''; + postPatch = '' + substituteInPlace Modules/Core/Wrappers/SWIG/src/python/CMakeLists.txt \ + --replace-fail ''\'''${ITK_INCLUDE_DIRS}' "${otb-itk}/include/ITK-${itkMajorMinorVersion}" + '' + # Add the header file "vcl_legacy_aliases.h", which defines the legacy vcl_* functions. + # This patch fixes the unreproducible build of OTB. + # See https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2484. + + '' + sed -i '/#include "vcl_compiler.h"/a #include "vcl_legacy_aliases.h"' Modules/Core/Mosaic/include/otbMosaicFunctors.h + ''; nativeBuildInputs = [ cmake @@ -271,29 +267,28 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "OTB_USE_FFTW" enableFFTW) ]; - propagatedBuildInputs = + propagatedBuildInputs = [ + boost + curl + gdal + libgeotiff + libsvm + muparser + muparserx + opencv + otb-itk + perl + tinyxml + ] + ++ otb-itk.propagatedBuildInputs + ++ optionals enablePython ( [ - boost - curl - gdal - libgeotiff - libsvm - muparser - muparserx - opencv - otb-itk - perl - tinyxml + python3 + otbSwig ] - ++ otb-itk.propagatedBuildInputs - ++ optionals enablePython ( - [ - python3 - otbSwig - ] - ++ pythonInputs - ) - ++ optionals enableShark [ otb-shark ]; + ++ pythonInputs + ) + ++ optionals enableShark [ otb-shark ]; doInstallCheck = true; diff --git a/pkgs/by-name/ot/otel-cli/package.nix b/pkgs/by-name/ot/otel-cli/package.nix index 274a3b48e395..2ea4677640ac 100644 --- a/pkgs/by-name/ot/otel-cli/package.nix +++ b/pkgs/by-name/ot/otel-cli/package.nix @@ -21,19 +21,18 @@ buildGoModule rec { vendorHash = "sha256-fWQz7ZrU8gulhpOHSN8Prn4EMC0KXy942FZD/PMsLxc="; - preCheck = - '' - ln -s $GOPATH/bin/otel-cli . - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - substituteInPlace main_test.go \ - --replace-fail 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${ - lib.makeBinPath [ - getent - coreutils - ] - }`' - ''; + preCheck = '' + ln -s $GOPATH/bin/otel-cli . + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + substituteInPlace main_test.go \ + --replace-fail 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${ + lib.makeBinPath [ + getent + coreutils + ] + }`' + ''; patches = [ ./patches/bin-echo-patch.patch ]; diff --git a/pkgs/by-name/ot/otf2/package.nix b/pkgs/by-name/ot/otf2/package.nix index 12593de5b110..fafe2b6919d5 100644 --- a/pkgs/by-name/ot/otf2/package.nix +++ b/pkgs/by-name/ot/otf2/package.nix @@ -34,14 +34,13 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; - configureFlags = - [ - (lib.enableFeature finalAttrs.finalPackage.doCheck "backend-test-runs") - (lib.withFeature true "custom-compilers") - ] - ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ - "ac_scorep_cross_compiling=yes" - ]; + configureFlags = [ + (lib.enableFeature finalAttrs.finalPackage.doCheck "backend-test-runs") + (lib.withFeature true "custom-compilers") + ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ + "ac_scorep_cross_compiling=yes" + ]; nativeBuildInputs = [ which # used in configure script diff --git a/pkgs/by-name/ot/ott/package.nix b/pkgs/by-name/ot/ott/package.nix index a67c9fd0874e..620fb352727d 100644 --- a/pkgs/by-name/ot/ott/package.nix +++ b/pkgs/by-name/ot/ott/package.nix @@ -20,27 +20,25 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - pkg-config - opaline - ] - ++ (with ocamlPackages; [ - findlib - ocaml - ]); + nativeBuildInputs = [ + pkg-config + opaline + ] + ++ (with ocamlPackages; [ + findlib + ocaml + ]); buildInputs = with ocamlPackages; [ ocamlgraph ]; installTargets = "ott.install"; - postInstall = - '' - opaline -prefix $out - '' - # There is `emacsPackages.ott-mode` for this now. - + '' - rm -r $out/share/emacs - ''; + postInstall = '' + opaline -prefix $out + '' + # There is `emacsPackages.ott-mode` for this now. + + '' + rm -r $out/share/emacs + ''; meta = { description = "Tool for the working semanticist"; diff --git a/pkgs/by-name/ou/ouch/package.nix b/pkgs/by-name/ou/ouch/package.nix index f3574b3d23a1..71443ec6ed7e 100644 --- a/pkgs/by-name/ou/ouch/package.nix +++ b/pkgs/by-name/ou/ouch/package.nix @@ -49,16 +49,15 @@ rustPlatform.buildRustPackage rec { ]; buildNoDefaultFeatures = true; - buildFeatures = - [ - "use_zlib" - "use_zstd_thin" - # "bzip3" will be optional in the next version - "zstd/pkg-config" - ] - ++ lib.optionals enableUnfree [ - "unrar" - ]; + buildFeatures = [ + "use_zlib" + "use_zstd_thin" + # "bzip3" will be optional in the next version + "zstd/pkg-config" + ] + ++ lib.optionals enableUnfree [ + "unrar" + ]; postInstall = '' installManPage artifacts/*.1 diff --git a/pkgs/by-name/ov/ovftool/package.nix b/pkgs/by-name/ov/ovftool/package.nix index 0e6f07d773e6..20cb2cb206cf 100644 --- a/pkgs/by-name/ov/ovftool/package.nix +++ b/pkgs/by-name/ov/ovftool/package.nix @@ -113,33 +113,31 @@ stdenv.mkDerivation (final: { and would like to use this package. ''; - buildInputs = - [ - c-ares - expat - icu60 - libiconv - libxcrypt-legacy - ovftool-xercesc - zlib - curl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glibc - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libxml2 - ]; + buildInputs = [ + c-ares + expat + icu60 + libiconv + libxcrypt-legacy + ovftool-xercesc + zlib + curl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glibc + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libxml2 + ]; - nativeBuildInputs = - [ - unzip - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + unzip + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ]; postUnpack = '' # The linux package wraps ovftool.bin with ovftool. Wrapping @@ -150,84 +148,83 @@ stdenv.mkDerivation (final: { fi ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - # Based on https://aur.archlinux.org/packages/vmware-ovftool/ - # with the addition of a libexec directory and a Nix-style binary wrapper. + # Based on https://aur.archlinux.org/packages/vmware-ovftool/ + # with the addition of a libexec directory and a Nix-style binary wrapper. - # Almost all libs in the package appear to be VMware proprietary except for - # libgoogleurl and libcurl. - # - # FIXME: Replace libgoogleurl? Possibly from Chromium? - # FIXME: Tell VMware to use a modern version of OpenSSL on macOS. As of ovftool - # v4.6.3 ovftool uses openssl-1.0.2zj which in seems to be the extended - # support LTS release: https://www.openssl.org/support/contracts.html + # Almost all libs in the package appear to be VMware proprietary except for + # libgoogleurl and libcurl. + # + # FIXME: Replace libgoogleurl? Possibly from Chromium? + # FIXME: Tell VMware to use a modern version of OpenSSL on macOS. As of ovftool + # v4.6.3 ovftool uses openssl-1.0.2zj which in seems to be the extended + # support LTS release: https://www.openssl.org/support/contracts.html - # Install all libs that are not patched in preFixup. - # Darwin dylibs are under `lib` in the zip. - install -m 755 -d "$out/lib" - install -m 644 -t "$out/lib" \ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - libgoogleurl.so.59 \ - libssoclient.so \ - libvim-types.so \ - libvmacore.so \ - libvmomi.so - '' - # macOS still relies on OpenSSL 1.0.2 as of v4.6.3, but Linux is in the clear - + lib.optionalString stdenv.hostPlatform.isDarwin '' - lib/libcrypto.1.0.2.dylib \ - lib/libgoogleurl.59.0.30.45.2.dylib \ - lib/libssl.1.0.2.dylib \ - lib/libssoclient.dylib \ - lib/libvim-types.dylib \ - lib/libvmacore.dylib \ - lib/libvmomi.dylib - '' - + '' - # Install libexec binaries - # ovftool expects to be run relative to certain directories, namely `env`. - # Place the binary and those dirs in libexec. - install -m 755 -d "$out/libexec" - install -m 755 -t "$out/libexec" ovftool - [ -f ovftool.bin ] && install -m 755 -t "$out/libexec" ovftool.bin - install -m 644 -t "$out/libexec" icudt44l.dat + # Install all libs that are not patched in preFixup. + # Darwin dylibs are under `lib` in the zip. + install -m 755 -d "$out/lib" + install -m 644 -t "$out/lib" \ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + libgoogleurl.so.59 \ + libssoclient.so \ + libvim-types.so \ + libvmacore.so \ + libvmomi.so + '' + # macOS still relies on OpenSSL 1.0.2 as of v4.6.3, but Linux is in the clear + + lib.optionalString stdenv.hostPlatform.isDarwin '' + lib/libcrypto.1.0.2.dylib \ + lib/libgoogleurl.59.0.30.45.2.dylib \ + lib/libssl.1.0.2.dylib \ + lib/libssoclient.dylib \ + lib/libvim-types.dylib \ + lib/libvmacore.dylib \ + lib/libvmomi.dylib + '' + + '' + # Install libexec binaries + # ovftool expects to be run relative to certain directories, namely `env`. + # Place the binary and those dirs in libexec. + install -m 755 -d "$out/libexec" + install -m 755 -t "$out/libexec" ovftool + [ -f ovftool.bin ] && install -m 755 -t "$out/libexec" ovftool.bin + install -m 644 -t "$out/libexec" icudt44l.dat - # Install other libexec resources that need to be relative to the `ovftool` - # binary. - for subdir in "certs" "env" "env/en" "schemas/DMTF" "schemas/vmware"; do - install -m 755 -d "$out/libexec/$subdir" - install -m 644 -t "$out/libexec/$subdir" "$subdir"/*.* - done + # Install other libexec resources that need to be relative to the `ovftool` + # binary. + for subdir in "certs" "env" "env/en" "schemas/DMTF" "schemas/vmware"; do + install -m 755 -d "$out/libexec/$subdir" + install -m 644 -t "$out/libexec/$subdir" "$subdir"/*.* + done - # Install EULA/OSS files - install -m 755 -d "$out/share/licenses" - install -m 644 -t "$out/share/licenses" \ - "vmware.eula" \ - "vmware-eula.rtf" \ - "README.txt" \ - "open_source_licenses.txt" + # Install EULA/OSS files + install -m 755 -d "$out/share/licenses" + install -m 644 -t "$out/share/licenses" \ + "vmware.eula" \ + "vmware-eula.rtf" \ + "README.txt" \ + "open_source_licenses.txt" - # Install Docs - install -m 755 -d "$out/share/doc" - install -m 644 -t "$out/share/doc" "README.txt" + # Install Docs + install -m 755 -d "$out/share/doc" + install -m 644 -t "$out/share/doc" "README.txt" - # Install final executable - install -m 755 -d "$out/bin" - makeWrapper "$out/libexec/ovftool" "$out/bin/ovftool" \ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - --prefix LD_LIBRARY_PATH : "$out/lib" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - --prefix DYLD_LIBRARY_PATH : "$out/lib" - '' - + '' - runHook postInstall - ''; + # Install final executable + install -m 755 -d "$out/bin" + makeWrapper "$out/libexec/ovftool" "$out/bin/ovftool" \ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + --prefix LD_LIBRARY_PATH : "$out/lib" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + --prefix DYLD_LIBRARY_PATH : "$out/lib" + '' + + '' + runHook postInstall + ''; preFixup = lib.optionalString stdenv.hostPlatform.isLinux '' diff --git a/pkgs/by-name/ow/owl-compositor/package.nix b/pkgs/by-name/ow/owl-compositor/package.nix index 95e664b19889..926a4ea6f1c3 100644 --- a/pkgs/by-name/ow/owl-compositor/package.nix +++ b/pkgs/by-name/ow/owl-compositor/package.nix @@ -36,27 +36,25 @@ stdenv.mkDerivation { strictDeps = true; - nativeBuildInputs = - [ - makeWrapper - wayland-scanner - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.DarwinTools - darwin.bootstrap_cmds - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - wrapGNUstepAppsHook - ]; + nativeBuildInputs = [ + makeWrapper + wayland-scanner + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.DarwinTools + darwin.bootstrap_cmds + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + wrapGNUstepAppsHook + ]; - buildInputs = - [ - libxkbcommon - wayland - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - gnustep-back - ]; + buildInputs = [ + libxkbcommon + wayland + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + gnustep-back + ]; preConfigure = '' mkdir -p build diff --git a/pkgs/by-name/ow/owmods-cli/package.nix b/pkgs/by-name/ow/owmods-cli/package.nix index 7c860ea74c23..db3fd982c889 100644 --- a/pkgs/by-name/ow/owmods-cli/package.nix +++ b/pkgs/by-name/ow/owmods-cli/package.nix @@ -31,16 +31,16 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config installShellFiles - ] ++ lib.optional wrapWithMono makeWrapper; + ] + ++ lib.optional wrapWithMono makeWrapper; - buildInputs = - [ - zstd - libsoup_3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - openssl - ]; + buildInputs = [ + zstd + libsoup_3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + openssl + ]; env = { ZSTD_SYS_USE_PKG_CONFIG = true; @@ -48,16 +48,15 @@ rustPlatform.buildRustPackage rec { buildAndTestSubdir = "owmods_cli"; - postInstall = - '' - cargo xtask dist_cli - installManPage dist/cli/man/* - installShellCompletion --cmd owmods \ - dist/cli/completions/owmods.{bash,fish,zsh} - '' - + lib.optionalString wrapWithMono '' - wrapProgram $out/bin/${meta.mainProgram} --prefix PATH : '${mono}/bin' - ''; + postInstall = '' + cargo xtask dist_cli + installManPage dist/cli/man/* + installShellCompletion --cmd owmods \ + dist/cli/completions/owmods.{bash,fish,zsh} + '' + + lib.optionalString wrapWithMono '' + wrapProgram $out/bin/${meta.mainProgram} --prefix PATH : '${mono}/bin' + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/ow/owncloud-client/package.nix b/pkgs/by-name/ow/owncloud-client/package.nix index 5d380ca54a42..8f7bdfffac4c 100644 --- a/pkgs/by-name/ow/owncloud-client/package.nix +++ b/pkgs/by-name/ow/owncloud-client/package.nix @@ -36,19 +36,18 @@ stdenv.mkDerivation rec { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - sqlite - libsecret - qt6Packages.qtbase - qt6Packages.qtsvg # Needed for the systray icon - qt6Packages.qtkeychain - libre-graph-api-cpp-qt-client - kdsingleapplication - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libinotify-kqueue - ]; + buildInputs = [ + sqlite + libsecret + qt6Packages.qtbase + qt6Packages.qtsvg # Needed for the systray icon + qt6Packages.qtkeychain + libre-graph-api-cpp-qt-client + kdsingleapplication + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libinotify-kqueue + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/ow/owntone/package.nix b/pkgs/by-name/ow/owntone/package.nix index e6460bdcb471..7e755a54a027 100644 --- a/pkgs/by-name/ow/owntone/package.nix +++ b/pkgs/by-name/ow/owntone/package.nix @@ -57,28 +57,27 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - avahi - curl - ffmpeg - gettext - json_c - libconfuse - libevent - libgcrypt - libgpg-error - libplist - libsodium - libunistring - libwebsockets - libxml2 - protobufc - sqlite - zlib - ] - ++ lib.optionals chromecastSupport [ gnutls ] - ++ lib.optionals pulseSupport [ libpulseaudio ]; + buildInputs = [ + avahi + curl + ffmpeg + gettext + json_c + libconfuse + libevent + libgcrypt + libgpg-error + libplist + libsodium + libunistring + libwebsockets + libxml2 + protobufc + sqlite + zlib + ] + ++ lib.optionals chromecastSupport [ gnutls ] + ++ lib.optionals pulseSupport [ libpulseaudio ]; configureFlags = lib.optionals chromecastSupport [ "--enable-chromecast" ] diff --git a/pkgs/by-name/p4/p4/package.nix b/pkgs/by-name/p4/p4/package.nix index 68af1ce3c04c..90aaf12731d0 100644 --- a/pkgs/by-name/p4/p4/package.nix +++ b/pkgs/by-name/p4/p4/package.nix @@ -58,27 +58,26 @@ stdenv.mkDerivation (finalAttrs: { hardeningDisable = lib.optionals stdenv.hostPlatform.isDarwin [ "strictoverflow" ]; - jamFlags = - [ - "-sEXEC=bin.unix" - "-sCROSS_COMPILE=${stdenv.cc.targetPrefix}" - "-sMALLOC_OVERRIDE=no" - "-sSSLINCDIR=${lib.getDev opensslStatic}/include" - "-sSSLLIBDIR=${lib.getLib opensslStatic}/lib" - ] - ++ lib.optionals stdenv.cc.isClang [ - "-sOSCOMP=clang" - "-sCLANGVER=${stdenv.cc.cc.version}" - ] - ++ lib.optionals stdenv.cc.isGNU [ - "-sOSCOMP=gcc" - "-sGCCVER=${stdenv.cc.cc.version}" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ "-sOSVER=26" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-sOSVER=1013" - "-sLIBC++DIR=${lib.getLib stdenv.cc.libcxx}/lib" - ]; + jamFlags = [ + "-sEXEC=bin.unix" + "-sCROSS_COMPILE=${stdenv.cc.targetPrefix}" + "-sMALLOC_OVERRIDE=no" + "-sSSLINCDIR=${lib.getDev opensslStatic}/include" + "-sSSLLIBDIR=${lib.getLib opensslStatic}/lib" + ] + ++ lib.optionals stdenv.cc.isClang [ + "-sOSCOMP=clang" + "-sCLANGVER=${stdenv.cc.cc.version}" + ] + ++ lib.optionals stdenv.cc.isGNU [ + "-sOSCOMP=gcc" + "-sGCCVER=${stdenv.cc.cc.version}" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "-sOSVER=26" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-sOSVER=1013" + "-sLIBC++DIR=${lib.getLib stdenv.cc.libcxx}/lib" + ]; CCFLAGS = # The file contrib/optimizations/slide_hash_neon.h is missing from the diff --git a/pkgs/by-name/p4/p4est-sc/package.nix b/pkgs/by-name/p4/p4est-sc/package.nix index 1cf4510c4071..418da4a7886f 100644 --- a/pkgs/by-name/p4/p4est-sc/package.nix +++ b/pkgs/by-name/p4/p4est-sc/package.nix @@ -35,22 +35,22 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ lib.optional mpiSupport mpi; + ] + ++ lib.optional mpiSupport mpi; propagatedBuildInputs = [ zlib jansson ]; - configureFlags = - [ - "LDFLAGS=-lm" - ] - ++ lib.optionals mpiSupport [ - "--enable-mpi" - "CC=mpicc" - ] - ++ lib.optional debug "--enable-debug"; + configureFlags = [ + "LDFLAGS=-lm" + ] + ++ lib.optionals mpiSupport [ + "--enable-mpi" + "CC=mpicc" + ] + ++ lib.optional debug "--enable-debug"; __darwinAllowLocalNetworking = mpiSupport; diff --git a/pkgs/by-name/p4/p4est/package.nix b/pkgs/by-name/p4/p4est/package.nix index 996422b56194..8733a128f454 100644 --- a/pkgs/by-name/p4/p4est/package.nix +++ b/pkgs/by-name/p4/p4est/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ lib.optional mpiSupport mpi; + ] + ++ lib.optional mpiSupport mpi; buildInputs = [ metis @@ -49,18 +50,17 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ p4est-sc' ]; - configureFlags = - [ - "--with-sc=${p4est-sc'}" - "--with-metis" - "--enable-p6est" - "LDFLAGS=-lm" - ] - ++ lib.optionals mpiSupport [ - "--enable-mpi" - "CC=mpicc" - ] - ++ lib.optional debug "--enable-debug"; + configureFlags = [ + "--with-sc=${p4est-sc'}" + "--with-metis" + "--enable-p6est" + "LDFLAGS=-lm" + ] + ++ lib.optionals mpiSupport [ + "--enable-mpi" + "CC=mpicc" + ] + ++ lib.optional debug "--enable-debug"; doCheck = true; diff --git a/pkgs/by-name/pa/pacemaker/package.nix b/pkgs/by-name/pa/pacemaker/package.nix index 7f8133a537e5..b271be6bcd94 100644 --- a/pkgs/by-name/pa/pacemaker/package.nix +++ b/pkgs/by-name/pa/pacemaker/package.nix @@ -73,7 +73,8 @@ stdenv.mkDerivation rec { "--with-corosync" # allows Type=notify in the systemd service "--enable-systemd" - ] ++ lib.optional (!forOCF) "--with-ocfdir=${ocf-resource-agents}/usr/lib/ocf"; + ] + ++ lib.optional (!forOCF) "--with-ocfdir=${ocf-resource-agents}/usr/lib/ocf"; installFlags = [ "DESTDIR=${placeholder "out"}" ]; diff --git a/pkgs/by-name/pa/packcc/package.nix b/pkgs/by-name/pa/packcc/package.nix index 182413401fb3..3693a9ef57f4 100644 --- a/pkgs/by-name/pa/packcc/package.nix +++ b/pkgs/by-name/pa/packcc/package.nix @@ -44,15 +44,14 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - preCheck = - '' - # Style tests will always fail because upstream uses an older version of - # uncrustify. - rm -rf ../../tests/style.d - '' - + lib.optionalString stdenv.cc.isClang '' - export NIX_CFLAGS_COMPILE+=' -Wno-error=strict-prototypes -Wno-error=int-conversion' - ''; + preCheck = '' + # Style tests will always fail because upstream uses an older version of + # uncrustify. + rm -rf ../../tests/style.d + '' + + lib.optionalString stdenv.cc.isClang '' + export NIX_CFLAGS_COMPILE+=' -Wno-error=strict-prototypes -Wno-error=int-conversion' + ''; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/pa/pacu/package.nix b/pkgs/by-name/pa/pacu/package.nix index a2e389fba97f..4c1d77f00b7e 100644 --- a/pkgs/by-name/pa/pacu/package.nix +++ b/pkgs/by-name/pa/pacu/package.nix @@ -34,26 +34,27 @@ python.pkgs.buildPythonApplication rec { build-system = with python.pkgs; [ poetry-core ]; - dependencies = - [ awscli ] - ++ (with python.pkgs; [ - awscli - boto3 - botocore - chalice - dsnap - jq - policyuniverse - pycognito - pyyaml - qrcode - requests - sqlalchemy - sqlalchemy-utils - toml - typing-extensions - urllib3 - ]); + dependencies = [ + awscli + ] + ++ (with python.pkgs; [ + awscli + boto3 + botocore + chalice + dsnap + jq + policyuniverse + pycognito + pyyaml + qrcode + requests + sqlalchemy + sqlalchemy-utils + toml + typing-extensions + urllib3 + ]); nativeCheckInputs = with python.pkgs; [ moto diff --git a/pkgs/by-name/pa/pagmo2/package.nix b/pkgs/by-name/pa/pagmo2/package.nix index 1948ad97b4df..0d214f558843 100644 --- a/pkgs/by-name/pa/pagmo2/package.nix +++ b/pkgs/by-name/pa/pagmo2/package.nix @@ -29,24 +29,24 @@ stdenv.mkDerivation rec { nlopt boost tbb - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) ipopt; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) ipopt; - cmakeFlags = - [ - "-DPAGMO_BUILD_TESTS=${if runTests then "ON" else "OFF"}" - "-DPAGMO_WITH_EIGEN3=yes" - "-DPAGMO_WITH_NLOPT=yes" - "-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt${stdenv.hostPlatform.extensions.sharedLibrary}" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DPAGMO_WITH_IPOPT=yes" - "-DCMAKE_CXX_FLAGS='-fuse-ld=gold'" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # FIXME: fails ipopt test with Invalid_Option on darwin, so disable. - "-DPAGMO_WITH_IPOPT=no" - "-DLLVM_USE_LINKER=gold" - ]; + cmakeFlags = [ + "-DPAGMO_BUILD_TESTS=${if runTests then "ON" else "OFF"}" + "-DPAGMO_WITH_EIGEN3=yes" + "-DPAGMO_WITH_NLOPT=yes" + "-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt${stdenv.hostPlatform.extensions.sharedLibrary}" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DPAGMO_WITH_IPOPT=yes" + "-DCMAKE_CXX_FLAGS='-fuse-ld=gold'" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # FIXME: fails ipopt test with Invalid_Option on darwin, so disable. + "-DPAGMO_WITH_IPOPT=no" + "-DLLVM_USE_LINKER=gold" + ]; doCheck = runTests; diff --git a/pkgs/by-name/pa/pahole/package.nix b/pkgs/by-name/pa/pahole/package.nix index f1c97c12cdad..b76ae90ed7a5 100644 --- a/pkgs/by-name/pa/pahole/package.nix +++ b/pkgs/by-name/pa/pahole/package.nix @@ -24,16 +24,15 @@ stdenv.mkDerivation rec { cmake pkg-config ]; - buildInputs = - [ - elfutils - zlib - libbpf - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - argp-standalone - musl-obstack - ]; + buildInputs = [ + elfutils + zlib + libbpf + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + argp-standalone + musl-obstack + ]; # Put libraries in "lib" subdirectory, not top level of $out cmakeFlags = [ diff --git a/pkgs/by-name/pa/palp/package.nix b/pkgs/by-name/pa/palp/package.nix index 7e1e3db79760..b50bfacfa477 100644 --- a/pkgs/by-name/pa/palp/package.nix +++ b/pkgs/by-name/pa/palp/package.nix @@ -43,19 +43,18 @@ stdenv.mkDerivation rec { EOF ''; - installPhase = - '' - mkdir -p $out/bin - for file in poly class cws nef mori; do - cp -p $file.x "$out/bin/$file-${dim}d.x" - done - '' - + lib.optionalString doSymlink '' - cd $out/bin - for file in poly class cws nef mori; do - ln -sf $file-6d.x $file.x - done - ''; + installPhase = '' + mkdir -p $out/bin + for file in poly class cws nef mori; do + cp -p $file.x "$out/bin/$file-${dim}d.x" + done + '' + + lib.optionalString doSymlink '' + cd $out/bin + for file in poly class cws nef mori; do + ln -sf $file-6d.x $file.x + done + ''; meta = with lib; { description = "Package for Analyzing Lattice Polytopes"; diff --git a/pkgs/by-name/pa/pam_p11/package.nix b/pkgs/by-name/pa/pam_p11/package.nix index 504b31fe7557..8532cdfec899 100644 --- a/pkgs/by-name/pa/pam_p11/package.nix +++ b/pkgs/by-name/pa/pam_p11/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation rec { pam libp11.passthru.openssl libp11 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ]; meta = with lib; { homepage = "https://github.com/OpenSC/pam_p11"; diff --git a/pkgs/by-name/pa/pan/package.nix b/pkgs/by-name/pa/pan/package.nix index 4457e8b21fa2..509f3430a4db 100644 --- a/pkgs/by-name/pa/pan/package.nix +++ b/pkgs/by-name/pa/pan/package.nix @@ -43,18 +43,17 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - gtk3 - gmime3 - libnotify - gnutls - ] - ++ lib.optionals spellChecking [ gspell ] - ++ lib.optionals gnomeSupport [ - libsecret - gcr - ]; + buildInputs = [ + gtk3 + gmime3 + libnotify + gnutls + ] + ++ lib.optionals spellChecking [ gspell ] + ++ lib.optionals gnomeSupport [ + libsecret + gcr + ]; cmakeFlags = [ (lib.cmakeBool "WANT_GSPELL" spellChecking) diff --git a/pkgs/by-name/pa/pango/package.nix b/pkgs/by-name/pa/pango/package.nix index 6b59332bb3b4..a24383b6d805 100644 --- a/pkgs/by-name/pa/pango/package.nix +++ b/pkgs/by-name/pa/pango/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation (finalAttrs: { "bin" "out" "dev" - ] ++ lib.optional withIntrospection "devdoc"; + ] + ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/pango/${lib.versions.majorMinor finalAttrs.version}/pango-${finalAttrs.version}.tar.xz"; @@ -46,35 +47,33 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - glib # for glib-mkenum - pkg-config - python3 - docutils # for rst2man, rst2html5 - ] - ++ lib.optionals withIntrospection [ - gi-docgen - gobject-introspection - ]; + nativeBuildInputs = [ + meson + ninja + glib # for glib-mkenum + pkg-config + python3 + docutils # for rst2man, rst2html5 + ] + ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection + ]; buildInputs = [ fribidi libthai ]; - propagatedBuildInputs = - [ - cairo - glib - libintl - harfbuzz - ] - ++ lib.optionals x11Support [ - libXft - ]; + propagatedBuildInputs = [ + cairo + glib + libintl + harfbuzz + ] + ++ lib.optionals x11Support [ + libXft + ]; mesonFlags = [ (lib.mesonBool "documentation" withIntrospection) diff --git a/pkgs/by-name/pa/pantheon-tweaks/package.nix b/pkgs/by-name/pa/pantheon-tweaks/package.nix index 6e67a74f74d3..cb14ba5c5451 100644 --- a/pkgs/by-name/pa/pantheon-tweaks/package.nix +++ b/pkgs/by-name/pa/pantheon-tweaks/package.nix @@ -36,20 +36,19 @@ stdenv.mkDerivation rec { wrapGAppsHook4 ]; - buildInputs = - [ - gnome-settings-daemon # org.gnome.settings-daemon.plugins.xsettings - gtk4 - libgee - pango - ] - ++ (with pantheon; [ - elementary-files # io.elementary.files.preferences - elementary-terminal # io.elementary.terminal.settings - granite7 - switchboard - wingpanel-indicator-sound # io.elementary.desktop.wingpanel.sound - ]); + buildInputs = [ + gnome-settings-daemon # org.gnome.settings-daemon.plugins.xsettings + gtk4 + libgee + pango + ] + ++ (with pantheon; [ + elementary-files # io.elementary.files.preferences + elementary-terminal # io.elementary.terminal.settings + granite7 + switchboard + wingpanel-indicator-sound # io.elementary.desktop.wingpanel.sound + ]); mesonFlags = [ "-Dsystheme_rootdir=/run/current-system/sw/share" diff --git a/pkgs/by-name/pa/pantum-driver/package.nix b/pkgs/by-name/pa/pantum-driver/package.nix index 79719279b29d..a2dc7a2d3b8f 100644 --- a/pkgs/by-name/pa/pantum-driver/package.nix +++ b/pkgs/by-name/pa/pantum-driver/package.nix @@ -40,22 +40,21 @@ stdenv.mkDerivation rec { autoPatchelfHook ]; - installPhase = - '' - dpkg-deb -x ./Resources/pantum_${version}-1_${architecture}.deb . + installPhase = '' + dpkg-deb -x ./Resources/pantum_${version}-1_${architecture}.deb . - mkdir -p $out $out/lib - cp -r etc $out/ - cp -r usr/lib/cups $out/lib/ - cp -r usr/local/lib/* $out/lib/ - cp -r usr/share $out/ - cp Resources/locale/en_US.UTF-8/* $out/share/doc/pantum/ - '' - + lib.optionalString enablePtqpdf '' - cp -r opt/pantum/* $out/ - ln -s $out/lib/libqpdf.so* $out/lib/libqpdf.so - ln -s $out/lib/libqpdf.so $out/lib/libqpdf.so.21 - ''; + mkdir -p $out $out/lib + cp -r etc $out/ + cp -r usr/lib/cups $out/lib/ + cp -r usr/local/lib/* $out/lib/ + cp -r usr/share $out/ + cp Resources/locale/en_US.UTF-8/* $out/share/doc/pantum/ + '' + + lib.optionalString enablePtqpdf '' + cp -r opt/pantum/* $out/ + ln -s $out/lib/libqpdf.so* $out/lib/libqpdf.so + ln -s $out/lib/libqpdf.so $out/lib/libqpdf.so.21 + ''; meta = with lib; { description = "Pantum universal driver"; diff --git a/pkgs/by-name/pa/paperjam/package.nix b/pkgs/by-name/pa/paperjam/package.nix index ca9cbffd062d..de735a8f1bc5 100644 --- a/pkgs/by-name/pa/paperjam/package.nix +++ b/pkgs/by-name/pa/paperjam/package.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation (finalAttrs: { qpdf libpaper asciidoc - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; makeFlags = [ "PREFIX=$(out)" diff --git a/pkgs/by-name/pa/paperless-ngx/package.nix b/pkgs/by-name/pa/paperless-ngx/package.nix index dd50cf82562e..6e233aaa3d11 100644 --- a/pkgs/by-name/pa/paperless-ngx/package.nix +++ b/pkgs/by-name/pa/paperless-ngx/package.nix @@ -73,25 +73,23 @@ let hash = "sha256-VtYYwpMXPAC3g1OESnw3dzLTwiGqJBQcicFZskEucok="; }; - nativeBuildInputs = - [ - node-gyp - nodejs_20 - pkg-config - pnpm.configHook - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild - ]; + nativeBuildInputs = [ + node-gyp + nodejs_20 + pkg-config + pnpm.configHook + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild + ]; - buildInputs = - [ - pango - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - giflib - ]; + buildInputs = [ + pango + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + giflib + ]; CYPRESS_INSTALL_BINARY = "0"; NG_CLI_ANALYTICS = "false"; diff --git a/pkgs/by-name/pa/papers/package.nix b/pkgs/by-name/pa/papers/package.nix index c2f0f32b8463..ebe8e21421ad 100644 --- a/pkgs/by-name/pa/papers/package.nix +++ b/pkgs/by-name/pa/papers/package.nix @@ -74,29 +74,28 @@ stdenv.mkDerivation (finalAttrs: { rustPlatform.cargoSetupHook ]; - buildInputs = - [ - dbus # only needed to find the service directory - djvulibre - exempi - gdk-pixbuf - glib - gtk4 - gsettings-desktop-schemas - libadwaita - libarchive - librsvg - libsysprof-capture - libspelling - pango - poppler - ] - ++ lib.optionals withLibsecret [ - libsecret - ] - ++ lib.optionals supportNautilus [ - nautilus - ]; + buildInputs = [ + dbus # only needed to find the service directory + djvulibre + exempi + gdk-pixbuf + glib + gtk4 + gsettings-desktop-schemas + libadwaita + libarchive + librsvg + libsysprof-capture + libspelling + pango + poppler + ] + ++ lib.optionals withLibsecret [ + libsecret + ] + ++ lib.optionals supportNautilus [ + nautilus + ]; mesonFlags = lib.optionals (!withLibsecret) [ @@ -111,15 +110,14 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail '=papers-thumbnailer' "=$out/bin/papers-thumbnailer" ''; - preFixup = - '' - gappsWrapperArgs+=( - --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" - ) - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -add_rpath "$out/lib" "$out/bin/papers" - ''; + preFixup = '' + gappsWrapperArgs+=( + --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" + ) + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -add_rpath "$out/lib" "$out/bin/papers" + ''; postFixup = '' # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. diff --git a/pkgs/by-name/pa/pappl/package.nix b/pkgs/by-name/pa/pappl/package.nix index bd10878aca6f..b38308f9eaac 100644 --- a/pkgs/by-name/pa/pappl/package.nix +++ b/pkgs/by-name/pa/pappl/package.nix @@ -34,23 +34,22 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - cups - libjpeg - libpng - libusb1 - zlib - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # upstream mentions these are not needed for Mac - # see: https://github.com/michaelrsweet/pappl#requirements - avahi - gnutls - ] - ++ lib.optionals withPAMSupport [ - pam - ]; + buildInputs = [ + cups + libjpeg + libpng + libusb1 + zlib + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # upstream mentions these are not needed for Mac + # see: https://github.com/michaelrsweet/pappl#requirements + avahi + gnutls + ] + ++ lib.optionals withPAMSupport [ + pam + ]; # testing requires some networking # doCheck = true; diff --git a/pkgs/by-name/pa/parabolic/package.nix b/pkgs/by-name/pa/parabolic/package.nix index 0442d2aaf860..4185627fbdd9 100644 --- a/pkgs/by-name/pa/parabolic/package.nix +++ b/pkgs/by-name/pa/parabolic/package.nix @@ -54,41 +54,39 @@ stdenv.mkDerivation (finalAttrs: { "@CMAKE_INSTALL_FULL_BINDIR@/@PROJECT_NAME@" ''; - nativeBuildInputs = - [ - cmake - gettext - ninja - pkg-config - itstool - yelp-tools - desktop-file-utils - ] - ++ lib.optionals (uiPlatform == "gnome") [ - wrapGAppsHook4 - blueprint-compiler - glib - shared-mime-info - ] - ++ lib.optional (uiPlatform == "qt") qt6.wrapQtAppsHook; + nativeBuildInputs = [ + cmake + gettext + ninja + pkg-config + itstool + yelp-tools + desktop-file-utils + ] + ++ lib.optionals (uiPlatform == "gnome") [ + wrapGAppsHook4 + blueprint-compiler + glib + shared-mime-info + ] + ++ lib.optional (uiPlatform == "qt") qt6.wrapQtAppsHook; - buildInputs = - [ - libnick - boost - ] - ++ lib.optionals (uiPlatform == "qt") [ - qt6.qtbase - qt6.qtsvg - qlementine - qlementine-icons - ] - ++ lib.optionals (uiPlatform == "gnome") [ - glib - gtk4 - libadwaita - libxmlxx5 - ]; + buildInputs = [ + libnick + boost + ] + ++ lib.optionals (uiPlatform == "qt") [ + qt6.qtbase + qt6.qtsvg + qlementine + qlementine-icons + ] + ++ lib.optionals (uiPlatform == "gnome") [ + glib + gtk4 + libadwaita + libxmlxx5 + ]; cmakeFlags = [ (lib.cmakeFeature "UI_PLATFORM" uiPlatform) diff --git a/pkgs/by-name/pa/parallel-launcher/package.nix b/pkgs/by-name/pa/parallel-launcher/package.nix index 79022ec2c12d..15cfbc3bbab7 100644 --- a/pkgs/by-name/pa/parallel-launcher/package.nix +++ b/pkgs/by-name/pa/parallel-launcher/package.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation ( # Save states with the parallel-n64 core will not work without this. libretro_info_path = "${finalAttrs.src}/data"; assets_directory = retroArchAssetsPath; - } // extraRetroArchSettings; + } + // extraRetroArchSettings; }; in { diff --git a/pkgs/by-name/pa/parted/package.nix b/pkgs/by-name/pa/parted/package.nix index f01ce55da3bd..c1c3c4fbaa80 100644 --- a/pkgs/by-name/pa/parted/package.nix +++ b/pkgs/by-name/pa/parted/package.nix @@ -45,11 +45,12 @@ stdenv.mkDerivation rec { patchShebangs tests ''; - buildInputs = - [ libuuid ] - ++ lib.optional (readline != null) readline - ++ lib.optional (gettext != null) gettext - ++ lib.optional (lvm2 != null) lvm2; + buildInputs = [ + libuuid + ] + ++ lib.optional (readline != null) readline + ++ lib.optional (gettext != null) gettext + ++ lib.optional (lvm2 != null) lvm2; configureFlags = (if (readline != null) then [ "--with-readline" ] else [ "--without-readline" ]) diff --git a/pkgs/by-name/pa/particl-core/package.nix b/pkgs/by-name/pa/particl-core/package.nix index 51204fd92634..a5ba857db4d3 100644 --- a/pkgs/by-name/pa/particl-core/package.nix +++ b/pkgs/by-name/pa/particl-core/package.nix @@ -51,14 +51,13 @@ stdenv.mkDerivation rec { python3 ]; - configureFlags = - [ - "--disable-bench" - "--with-boost-libdir=${boost.out}/lib" - ] - ++ lib.optionals (!doCheck) [ - "--enable-tests=no" - ]; + configureFlags = [ + "--disable-bench" + "--with-boost-libdir=${boost.out}/lib" + ] + ++ lib.optionals (!doCheck) [ + "--enable-tests=no" + ]; # Always check during Hydra builds doCheck = true; diff --git a/pkgs/by-name/pa/partio/package.nix b/pkgs/by-name/pa/partio/package.nix index 9c2cc4c91f7e..8ecc6e40cbe2 100644 --- a/pkgs/by-name/pa/partio/package.nix +++ b/pkgs/by-name/pa/partio/package.nix @@ -38,18 +38,17 @@ stdenv.mkDerivation rec { python3 ]; - buildInputs = - [ - zlib - swig - xorg.libXi - xorg.libXmu - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libglut - libGLU - libGL - ]; + buildInputs = [ + zlib + swig + xorg.libXi + xorg.libXmu + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libglut + libGLU + libGL + ]; # TODO: # Sexpr support diff --git a/pkgs/by-name/pa/pax-britannica/package.nix b/pkgs/by-name/pa/pax-britannica/package.nix index bb99f2a5f510..468d2fb5ed6b 100644 --- a/pkgs/by-name/pa/pax-britannica/package.nix +++ b/pkgs/by-name/pa/pax-britannica/package.nix @@ -27,29 +27,28 @@ stdenv.mkDerivation { hash = "sha256-j69di+3P+vaFzv8Zke1MdABMkLtknTNvlfPk1YVUfmU="; }; - patches = - [ - (fetchpatch { - url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/compile_for_linux.patch"; - hash = "sha256-XncjmJrBakz5/w90O6rDif2rWSoAVKzuPEj9wN2VNvQ="; - }) - (fetchpatch { - url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/add_manpage.patch"; - hash = "sha256-c8O6t0Zv/ln7WiPdbN3sYGsb7SL9Rmeo+94DsjpfgvY="; - }) - (fetchpatch { - url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/load_resources_from_usr_share.patch"; - hash = "sha256-61Yt4Rq1I/Ofu640XsDDo0il275B+ozqH0Z6P18XT6Q="; - }) - (fetchpatch { - url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/add_desktop_entry.patch"; - hash = "sha256-QSQEBoCw7KTOLgy7TaFvQRpR17HoggTOCxhfTG+kIOA="; - }) - ] - ++ lib.optional useGlfw3 (fetchpatch { - url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/glfw3.patch"; - hash = "sha256-hj00vnW/i7lxFc4CGlRz6Havkg45gGgIg6MmCXcMsSg="; - }); + patches = [ + (fetchpatch { + url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/compile_for_linux.patch"; + hash = "sha256-XncjmJrBakz5/w90O6rDif2rWSoAVKzuPEj9wN2VNvQ="; + }) + (fetchpatch { + url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/add_manpage.patch"; + hash = "sha256-c8O6t0Zv/ln7WiPdbN3sYGsb7SL9Rmeo+94DsjpfgvY="; + }) + (fetchpatch { + url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/load_resources_from_usr_share.patch"; + hash = "sha256-61Yt4Rq1I/Ofu640XsDDo0il275B+ozqH0Z6P18XT6Q="; + }) + (fetchpatch { + url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/add_desktop_entry.patch"; + hash = "sha256-QSQEBoCw7KTOLgy7TaFvQRpR17HoggTOCxhfTG+kIOA="; + }) + ] + ++ lib.optional useGlfw3 (fetchpatch { + url = "https://sources.debian.org/data/main/p/pax-britannica/1.0.0-5/debian/patches/glfw3.patch"; + hash = "sha256-hj00vnW/i7lxFc4CGlRz6Havkg45gGgIg6MmCXcMsSg="; + }); postPatch = '' substituteInPlace Makefile \ --replace-fail '-DEXTRA_LOADERS=\"../extra_loaders.h\"' '-DEXTRA_LOADERS=\\\"../extra_loaders.h\\\"' diff --git a/pkgs/by-name/pb/pb_cli/package.nix b/pkgs/by-name/pb/pb_cli/package.nix index bed3937b1d11..b89e33bb5930 100644 --- a/pkgs/by-name/pb/pb_cli/package.nix +++ b/pkgs/by-name/pb/pb_cli/package.nix @@ -30,14 +30,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; - liveDeps = - [ - jq - curl - ] - ++ lib.optional screenshots maim - ++ lib.optional video capture - ++ lib.optional clipboard xclip; + liveDeps = [ + jq + curl + ] + ++ lib.optional screenshots maim + ++ lib.optional video capture + ++ lib.optional clipboard xclip; installPhase = '' install -Dm755 src/pb.sh $out/bin/pb diff --git a/pkgs/by-name/pc/pc-ble-driver/package.nix b/pkgs/by-name/pc/pc-ble-driver/package.nix index c69b3cbdb76a..24b6ae8b58ae 100644 --- a/pkgs/by-name/pc/pc-ble-driver/package.nix +++ b/pkgs/by-name/pc/pc-ble-driver/package.nix @@ -35,13 +35,12 @@ stdenv.mkDerivation rec { }) ]; - cmakeFlags = - [ - "-DNRF_BLE_DRIVER_VERSION=${version}" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - "-DARCH=arm64" - ]; + cmakeFlags = [ + "-DNRF_BLE_DRIVER_VERSION=${version}" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + "-DARCH=arm64" + ]; nativeBuildInputs = [ cmake @@ -53,13 +52,12 @@ stdenv.mkDerivation rec { spdlog ]; - propagatedBuildInputs = - [ + propagatedBuildInputs = [ - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - udev - ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + udev + ]; meta = with lib; { description = "Desktop library for Bluetooth low energy development"; diff --git a/pkgs/by-name/pc/pcaudiolib/package.nix b/pkgs/by-name/pc/pcaudiolib/package.nix index 32f31d8fbfc0..10ea21b2e38d 100644 --- a/pkgs/by-name/pc/pcaudiolib/package.nix +++ b/pkgs/by-name/pc/pcaudiolib/package.nix @@ -33,12 +33,11 @@ stdenv.mkDerivation (finalAttrs: { which ]; - buildInputs = - [ - portaudio - ] - ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib - ++ lib.optional pulseaudioSupport libpulseaudio; + buildInputs = [ + portaudio + ] + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib + ++ lib.optional pulseaudioSupport libpulseaudio; # touch ChangeLog to avoid below error on darwin: # Makefile.am: error: required file './ChangeLog.md' not found diff --git a/pkgs/by-name/pc/pcem/package.nix b/pkgs/by-name/pc/pcem/package.nix index 249c3cdcb947..287e7b31c952 100644 --- a/pkgs/by-name/pc/pcem/package.nix +++ b/pkgs/by-name/pc/pcem/package.nix @@ -36,12 +36,14 @@ stdenv.mkDerivation rec { SDL2 openal gtk3 - ] ++ lib.optional withALSA alsa-lib; + ] + ++ lib.optional withALSA alsa-lib; - configureFlags = - [ "--enable-release-build" ] - ++ lib.optional withNetworking "--enable-networking" - ++ lib.optional withALSA "--enable-alsa"; + configureFlags = [ + "--enable-release-build" + ] + ++ lib.optional withNetworking "--enable-networking" + ++ lib.optional withALSA "--enable-alsa"; # Fix GCC 14 build env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types"; diff --git a/pkgs/by-name/pc/pciutils/package.nix b/pkgs/by-name/pc/pciutils/package.nix index d91fa4c6e8ad..3aa99cd6634a 100644 --- a/pkgs/by-name/pc/pciutils/package.nix +++ b/pkgs/by-name/pc/pciutils/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { buildInputs = [ which zlib - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ kmod ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ kmod ]; preConfigure = lib.optionalString (!stdenv.cc.isGNU) '' substituteInPlace Makefile --replace 'CC=$(CROSS_COMPILE)gcc' "" diff --git a/pkgs/by-name/pc/pcl/package.nix b/pkgs/by-name/pc/pcl/package.nix index f57975508c8e..96513d713882 100644 --- a/pkgs/by-name/pc/pcl/package.nix +++ b/pkgs/by-name/pc/pcl/package.nix @@ -53,7 +53,8 @@ stdenv.mkDerivation (finalAttrs: { cmake libsForQt5.wrapQtAppsHook pkg-config - ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; buildInputs = [ eigen @@ -61,7 +62,8 @@ stdenv.mkDerivation (finalAttrs: { libpcap libsForQt5.qtbase libusb1 - ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; propagatedBuildInputs = [ boost diff --git a/pkgs/by-name/pc/pcmciaUtils/package.nix b/pkgs/by-name/pc/pcmciaUtils/package.nix index fed9e289757d..426520c29f32 100644 --- a/pkgs/by-name/pc/pcmciaUtils/package.nix +++ b/pkgs/by-name/pc/pcmciaUtils/package.nix @@ -37,20 +37,19 @@ stdenv.mkDerivation rec { doInstallCheck = true; - patchPhase = - '' - sed -i " - s,/sbin/modprobe,${kmod}&,; - s,/lib/udev/,$out/sbin/,; - s,__UDEVHELPERDIR__/,$out/lib/udev/,; - " udev/* # fix-color */ - sed -i " - s,/lib/firmware,$out&,; - s,/etc/pcmcia,$out&,; - " src/{startup.c,pcmcia-check-broken-cis.c} # fix-color */ - '' - + (lib.optionalString (firmware == [ ]) ''sed -i "s,STARTUP = true,STARTUP = false," Makefile'') - + (lib.optionalString (configOpts != null) "ln -sf ${configOpts} ./config/config.opts"); + patchPhase = '' + sed -i " + s,/sbin/modprobe,${kmod}&,; + s,/lib/udev/,$out/sbin/,; + s,__UDEVHELPERDIR__/,$out/lib/udev/,; + " udev/* # fix-color */ + sed -i " + s,/lib/firmware,$out&,; + s,/etc/pcmcia,$out&,; + " src/{startup.c,pcmcia-check-broken-cis.c} # fix-color */ + '' + + (lib.optionalString (firmware == [ ]) ''sed -i "s,STARTUP = true,STARTUP = false," Makefile'') + + (lib.optionalString (configOpts != null) "ln -sf ${configOpts} ./config/config.opts"); makeFlags = [ "LEX=flex" ]; installFlags = [ diff --git a/pkgs/by-name/pc/pcsc-tools/package.nix b/pkgs/by-name/pc/pcsc-tools/package.nix index 6b724185b9c4..1dbdcb1df6c3 100644 --- a/pkgs/by-name/pc/pcsc-tools/package.nix +++ b/pkgs/by-name/pc/pcsc-tools/package.nix @@ -50,72 +50,70 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional systemdSupport systemd; - nativeBuildInputs = - [ - autoconf-archive - autoreconfHook - makeWrapper - pkg-config - ] - ++ lib.optionals withGui [ - gobject-introspection - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + autoconf-archive + autoreconfHook + makeWrapper + pkg-config + ] + ++ lib.optionals withGui [ + gobject-introspection + wrapGAppsHook3 + ]; preFixup = '' makeWrapperArgs+=("''${gappsWrapperArgs[@]}") ''; - postInstall = - '' - wrapProgram $out/bin/scriptor \ - --set PERL5LIB "${ - with perlPackages; - makePerlPath [ - ChipcardPCSC - libintl-perl - ] - }" + postInstall = '' + wrapProgram $out/bin/scriptor \ + --set PERL5LIB "${ + with perlPackages; + makePerlPath [ + ChipcardPCSC + libintl-perl + ] + }" - '' - + lib.optionalString withGui '' - wrapProgram $out/bin/gscriptor \ - ''${makeWrapperArgs[@]} \ - --set PERL5LIB "${ - with perlPackages; - makePerlPath [ - ChipcardPCSC - libintl-perl - GlibObjectIntrospection - Glib - Gtk3 - Pango - Cairo - CairoGObject - ] - }" - '' - + '' + '' + + lib.optionalString withGui '' + wrapProgram $out/bin/gscriptor \ + ''${makeWrapperArgs[@]} \ + --set PERL5LIB "${ + with perlPackages; + makePerlPath [ + ChipcardPCSC + libintl-perl + GlibObjectIntrospection + Glib + Gtk3 + Pango + Cairo + CairoGObject + ] + }" + '' + + '' - wrapProgram $out/bin/ATR_analysis \ - --set PERL5LIB "${ - with perlPackages; - makePerlPath [ - ChipcardPCSC - libintl-perl - ] - }" + wrapProgram $out/bin/ATR_analysis \ + --set PERL5LIB "${ + with perlPackages; + makePerlPath [ + ChipcardPCSC + libintl-perl + ] + }" - wrapProgram $out/bin/pcsc_scan \ - --prefix PATH : "$out/bin:${ - lib.makeBinPath [ - coreutils - wget - ] - }" + wrapProgram $out/bin/pcsc_scan \ + --prefix PATH : "$out/bin:${ + lib.makeBinPath [ + coreutils + wget + ] + }" - install -Dm444 -t $out/share/pcsc smartcard_list.txt - ''; + install -Dm444 -t $out/share/pcsc smartcard_list.txt + ''; passthru = { tests.version = testers.testVersion { diff --git a/pkgs/by-name/pc/pcsclite/package.nix b/pkgs/by-name/pc/pcsclite/package.nix index b90cedf109b1..552df8b13486 100644 --- a/pkgs/by-name/pc/pcsclite/package.nix +++ b/pkgs/by-name/pc/pcsclite/package.nix @@ -52,41 +52,39 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - mesonFlags = - [ - (lib.mesonOption "sysconfdir" "/etc") - # The OS should care on preparing the drivers into this location - (lib.mesonOption "usbdropdir" "/var/lib/pcsc/drivers") - (lib.mesonBool "libsystemd" systemdSupport) - (lib.mesonBool "polkit" polkitSupport) - (lib.mesonOption "ipcdir" "/run/pcscd") - ] - ++ lib.optionals systemdSupport [ - (lib.mesonOption "systemdunit" "system") - ] - ++ lib.optionals (!udevSupport) [ - (lib.mesonBool "libudev" false) - ]; + mesonFlags = [ + (lib.mesonOption "sysconfdir" "/etc") + # The OS should care on preparing the drivers into this location + (lib.mesonOption "usbdropdir" "/var/lib/pcsc/drivers") + (lib.mesonBool "libsystemd" systemdSupport) + (lib.mesonBool "polkit" polkitSupport) + (lib.mesonOption "ipcdir" "/run/pcscd") + ] + ++ lib.optionals systemdSupport [ + (lib.mesonOption "systemdunit" "system") + ] + ++ lib.optionals (!udevSupport) [ + (lib.mesonBool "libudev" false) + ]; # disable building pcsc-wirecheck{,-gen} when cross compiling # see also: https://github.com/LudovicRousseau/PCSC/issues/25 - postPatch = - '' - substituteInPlace src/libredirect.c src/spy/libpcscspy.c \ - --replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1" - '' - + lib.optionalString systemdSupport '' - substituteInPlace meson.build \ - --replace-fail \ - "systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemd' + unit + 'unitdir')" \ - "systemdsystemunitdir = '${placeholder "out"}/lib/systemd/system'" - '' - + lib.optionalString polkitSupport '' - substituteInPlace meson.build \ - --replace-fail \ - "install_dir : polkit_dep.get_variable('policydir')" \ - "install_dir : '${placeholder "out"}/share/polkit-1/actions'" - ''; + postPatch = '' + substituteInPlace src/libredirect.c src/spy/libpcscspy.c \ + --replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1" + '' + + lib.optionalString systemdSupport '' + substituteInPlace meson.build \ + --replace-fail \ + "systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemd' + unit + 'unitdir')" \ + "systemdsystemunitdir = '${placeholder "out"}/lib/systemd/system'" + '' + + lib.optionalString polkitSupport '' + substituteInPlace meson.build \ + --replace-fail \ + "install_dir : polkit_dep.get_variable('policydir')" \ + "install_dir : '${placeholder "out"}/share/polkit-1/actions'" + ''; postInstall = '' # pcsc-spy is a debugging utility and it drags python into the closure @@ -101,13 +99,14 @@ stdenv.mkDerivation (finalAttrs: { perl ]; - buildInputs = - [ python3 ] - ++ lib.optionals systemdSupport [ systemdLibs ] - ++ lib.optionals (!systemdSupport && udevSupport) [ udev ] - ++ lib.optionals dbusSupport [ dbus ] - ++ lib.optionals polkitSupport [ polkit ] - ++ lib.optionals (!udevSupport) [ libusb1 ]; + buildInputs = [ + python3 + ] + ++ lib.optionals systemdSupport [ systemdLibs ] + ++ lib.optionals (!systemdSupport && udevSupport) [ udev ] + ++ lib.optionals dbusSupport [ dbus ] + ++ lib.optionals polkitSupport [ polkit ] + ++ lib.optionals (!udevSupport) [ libusb1 ]; passthru = { tests = { diff --git a/pkgs/by-name/pd/pdal/package.nix b/pkgs/by-name/pd/pdal/package.nix index c48bf2584bdd..9251c1c55125 100644 --- a/pkgs/by-name/pd/pdal/package.nix +++ b/pkgs/by-name/pd/pdal/package.nix @@ -44,27 +44,26 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - curl - gdal - hdf5-cpp - laszip - libgeotiff - libtiff - libxml2 - openscenegraph - libpq - proj - sqlite - tiledb - xercesc - zlib - zstd - ] - ++ lib.optionals enableE57 [ - libe57format - ]; + buildInputs = [ + curl + gdal + hdf5-cpp + laszip + libgeotiff + libtiff + libxml2 + openscenegraph + libpq + proj + sqlite + tiledb + xercesc + zlib + zstd + ] + ++ lib.optionals enableE57 [ + libe57format + ]; strictDeps = true; diff --git a/pkgs/by-name/pd/pdisk/package.nix b/pkgs/by-name/pd/pdisk/package.nix index 3be86851b2c4..91dfb61b3b3b 100644 --- a/pkgs/by-name/pd/pdisk/package.nix +++ b/pkgs/by-name/pd/pdisk/package.nix @@ -44,15 +44,14 @@ stdenv.mkDerivation (finalAttrs: { ./cmdline.patch ]; - postPatch = - '' - substituteInPlace makefile \ - --replace-fail 'cc' '${stdenv.cc.targetPrefix}cc' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace makefile \ - --replace-fail '-lbsd' '-framework CoreFoundation -framework IOKit' - ''; + postPatch = '' + substituteInPlace makefile \ + --replace-fail 'cc' '${stdenv.cc.targetPrefix}cc' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace makefile \ + --replace-fail '-lbsd' '-framework CoreFoundation -framework IOKit' + ''; strictDeps = true; diff --git a/pkgs/by-name/pd/pdns-recursor/package.nix b/pkgs/by-name/pd/pdns-recursor/package.nix index ceae53962ea0..125c5110c118 100644 --- a/pkgs/by-name/pd/pdns-recursor/package.nix +++ b/pkgs/by-name/pd/pdns-recursor/package.nix @@ -50,7 +50,8 @@ stdenv.mkDerivation (finalAttrs: { luajit libsodium curl - ] ++ lib.optional enableProtoBuf protobuf; + ] + ++ lib.optional enableProtoBuf protobuf; configureFlags = [ "--enable-reproducible" diff --git a/pkgs/by-name/pe/peakperf/package.nix b/pkgs/by-name/pe/peakperf/package.nix index b9d958f155f0..19a2e76a50da 100644 --- a/pkgs/by-name/pe/peakperf/package.nix +++ b/pkgs/by-name/pe/peakperf/package.nix @@ -23,15 +23,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-CoGWj+zskcv8caFjhy55GKTKqFq2y1/nMjiVc6TzU1c="; }; - nativeBuildInputs = - [ - cmake - installShellFiles - ] - ++ lib.optionals enableCuda [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + installShellFiles + ] + ++ lib.optionals enableCuda [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; buildInputs = lib.optionals enableCuda [ cudaPackages.cuda_cudart diff --git a/pkgs/by-name/pe/peazip/package.nix b/pkgs/by-name/pe/peazip/package.nix index 977d921b2d03..edfbb7c30c42 100644 --- a/pkgs/by-name/pe/peazip/package.nix +++ b/pkgs/by-name/pe/peazip/package.nix @@ -37,14 +37,13 @@ stdenv.mkDerivation rec { fpc ]; - buildInputs = - [ - xorg.libX11 - ] - ++ (with qt6Packages; [ - qtbase - libqtpas - ]); + buildInputs = [ + xorg.libX11 + ] + ++ (with qt6Packages; [ + qtbase + libqtpas + ]); NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; diff --git a/pkgs/by-name/pe/persepolis/package.nix b/pkgs/by-name/pe/persepolis/package.nix index 84227daa3c62..4a9b49b7adb2 100644 --- a/pkgs/by-name/pe/persepolis/package.nix +++ b/pkgs/by-name/pe/persepolis/package.nix @@ -49,19 +49,18 @@ python3.pkgs.buildPythonApplication rec { "\${qtWrapperArgs[@]}" ]; - propagatedBuildInputs = - [ - pulseaudio - sound-theme-freedesktop - ] - ++ (with python3.pkgs; [ - psutil - pyqt5 - requests - setproctitle - setuptools - yt-dlp - ]); + propagatedBuildInputs = [ + pulseaudio + sound-theme-freedesktop + ] + ++ (with python3.pkgs; [ + psutil + pyqt5 + requests + setproctitle + setuptools + yt-dlp + ]); meta = with lib; { description = "Download manager GUI written in Python"; diff --git a/pkgs/by-name/pe/persistent-cache-cpp/package.nix b/pkgs/by-name/pe/persistent-cache-cpp/package.nix index df9e2845c9a7..c33362c85b85 100644 --- a/pkgs/by-name/pe/persistent-cache-cpp/package.nix +++ b/pkgs/by-name/pe/persistent-cache-cpp/package.nix @@ -52,27 +52,26 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = - '' - # GTest needs C++17 - # Remove when https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/merge_requests/19 merged & in release - substituteInPlace CMakeLists.txt \ - --replace-fail 'std=c++14' 'std=c++17' + postPatch = '' + # GTest needs C++17 + # Remove when https://gitlab.com/ubports/development/core/lib-cpp/persistent-cache-cpp/-/merge_requests/19 merged & in release + substituteInPlace CMakeLists.txt \ + --replace-fail 'std=c++14' 'std=c++17' - # Wrong concatenation - substituteInPlace data/libpersistent-cache-cpp.pc.in \ - --replace "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "\''${prefix}/lib" + # Wrong concatenation + substituteInPlace data/libpersistent-cache-cpp.pc.in \ + --replace "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" "\''${prefix}/lib" - # Runs in parallel to other tests, limit to 1 thread - substituteInPlace tests/headers/compile_headers.py \ - --replace 'multiprocessing.cpu_count()' '1' + # Runs in parallel to other tests, limit to 1 thread + substituteInPlace tests/headers/compile_headers.py \ + --replace 'multiprocessing.cpu_count()' '1' - sed '1i#include ' \ - -i tests/core/persistent_string_cache/speed_test.cpp - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - patchShebangs tests/{headers,whitespace}/*.py - ''; + sed '1i#include ' \ + -i tests/core/persistent_string_cache/speed_test.cpp + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + patchShebangs tests/{headers,whitespace}/*.py + ''; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/pe/petsc/package.nix b/pkgs/by-name/pe/petsc/package.nix index 577be492f2ef..8a2d78fc3226 100644 --- a/pkgs/by-name/pe/petsc/package.nix +++ b/pkgs/by-name/pe/petsc/package.nix @@ -120,37 +120,35 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - python3 - gfortran - pkg-config - bison - ] - ++ lib.optional mpiSupport mpi - ++ lib.optionals pythonSupport [ - python3Packages.setuptools - python3Packages.cython - ]; + nativeBuildInputs = [ + python3 + gfortran + pkg-config + bison + ] + ++ lib.optional mpiSupport mpi + ++ lib.optionals pythonSupport [ + python3Packages.setuptools + python3Packages.cython + ]; - buildInputs = - [ - petscPackages.blas - petscPackages.lapack - ] - ++ lib.optional withZlib zlib - ++ lib.optional withHdf5 petscPackages.hdf5 - ++ lib.optional withP4est petscPackages.p4est - ++ lib.optional withMetis petscPackages.metis - ++ lib.optional withParmetis petscPackages.parmetis - ++ lib.optional withPtscotch petscPackages.scotch - ++ lib.optional withScalapack petscPackages.scalapack - ++ lib.optional withMumps petscPackages.mumps - ++ lib.optional withHypre petscPackages.hypre - ++ lib.optional withSuperLu petscPackages.superlu - ++ lib.optional withSuperLuDist petscPackages.superlu_dist - ++ lib.optional withFftw petscPackages.fftw - ++ lib.optional withSuitesparse petscPackages.suitesparse; + buildInputs = [ + petscPackages.blas + petscPackages.lapack + ] + ++ lib.optional withZlib zlib + ++ lib.optional withHdf5 petscPackages.hdf5 + ++ lib.optional withP4est petscPackages.p4est + ++ lib.optional withMetis petscPackages.metis + ++ lib.optional withParmetis petscPackages.parmetis + ++ lib.optional withPtscotch petscPackages.scotch + ++ lib.optional withScalapack petscPackages.scalapack + ++ lib.optional withMumps petscPackages.mumps + ++ lib.optional withHypre petscPackages.hypre + ++ lib.optional withSuperLu petscPackages.superlu + ++ lib.optional withSuperLuDist petscPackages.superlu_dist + ++ lib.optional withFftw petscPackages.fftw + ++ lib.optional withSuitesparse petscPackages.suitesparse; propagatedBuildInputs = lib.optional pythonSupport python3Packages.numpy; @@ -167,46 +165,45 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "/usr/bin/env bash" "${bash}/bin/bash" ''; - configureFlags = - [ - "--with-blaslapack=1" - "--with-scalar-type=${scalarType}" - "--with-precision=${precision}" - "--with-mpi=${if mpiSupport then "1" else "0"}" - ] - ++ lib.optionals (!mpiSupport) [ - "--with-cc=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "gcc" else "clang"}" - "--with-cxx=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "g++" else "clang++"}" - "--with-fc=${gfortran}/bin/gfortran" - ] - ++ lib.optionals mpiSupport [ - "--with-cc=${lib.getDev mpi}/bin/mpicc" - "--with-cxx=${lib.getDev mpi}/bin/mpicxx" - "--with-fc=${lib.getDev mpi}/bin/mpif90" - ] - ++ lib.optionals (!debug) [ - "--with-debugging=0" - "COPTFLAGS=-O3" - "FOPTFLAGS=-O3" - "CXXOPTFLAGS=-O3" - "CXXFLAGS=-O3" - ] - ++ lib.optional (!fortranSupport) "--with-fortran-bindings=0" - ++ lib.optional pythonSupport "--with-petsc4py=1" - ++ lib.optional withMetis "--with-metis=1" - ++ lib.optional withParmetis "--with-parmetis=1" - ++ lib.optional withPtscotch "--with-ptscotch=1" - ++ lib.optional withScalapack "--with-scalapack=1" - ++ lib.optional withMumps "--with-mumps=1" - ++ lib.optional (withMumps && !mpiSupport) "--with-mumps-serial=1" - ++ lib.optional withP4est "--with-p4est=1" - ++ lib.optional withZlib "--with-zlib=1" - ++ lib.optional withHdf5 "--with-hdf5=1" - ++ lib.optional withHypre "--with-hypre=1" - ++ lib.optional withSuperLu "--with-superlu=1" - ++ lib.optional withSuperLuDist "--with-superlu_dist=1" - ++ lib.optional withFftw "--with-fftw=1" - ++ lib.optional withSuitesparse "--with-suitesparse=1"; + configureFlags = [ + "--with-blaslapack=1" + "--with-scalar-type=${scalarType}" + "--with-precision=${precision}" + "--with-mpi=${if mpiSupport then "1" else "0"}" + ] + ++ lib.optionals (!mpiSupport) [ + "--with-cc=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "gcc" else "clang"}" + "--with-cxx=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "g++" else "clang++"}" + "--with-fc=${gfortran}/bin/gfortran" + ] + ++ lib.optionals mpiSupport [ + "--with-cc=${lib.getDev mpi}/bin/mpicc" + "--with-cxx=${lib.getDev mpi}/bin/mpicxx" + "--with-fc=${lib.getDev mpi}/bin/mpif90" + ] + ++ lib.optionals (!debug) [ + "--with-debugging=0" + "COPTFLAGS=-O3" + "FOPTFLAGS=-O3" + "CXXOPTFLAGS=-O3" + "CXXFLAGS=-O3" + ] + ++ lib.optional (!fortranSupport) "--with-fortran-bindings=0" + ++ lib.optional pythonSupport "--with-petsc4py=1" + ++ lib.optional withMetis "--with-metis=1" + ++ lib.optional withParmetis "--with-parmetis=1" + ++ lib.optional withPtscotch "--with-ptscotch=1" + ++ lib.optional withScalapack "--with-scalapack=1" + ++ lib.optional withMumps "--with-mumps=1" + ++ lib.optional (withMumps && !mpiSupport) "--with-mumps-serial=1" + ++ lib.optional withP4est "--with-p4est=1" + ++ lib.optional withZlib "--with-zlib=1" + ++ lib.optional withHdf5 "--with-hdf5=1" + ++ lib.optional withHypre "--with-hypre=1" + ++ lib.optional withSuperLu "--with-superlu=1" + ++ lib.optional withSuperLuDist "--with-superlu_dist=1" + ++ lib.optional withFftw "--with-fftw=1" + ++ lib.optional withSuitesparse "--with-suitesparse=1"; hardeningDisable = lib.optionals debug [ "fortify" @@ -253,14 +250,13 @@ stdenv.mkDerivation (finalAttrs: { # This test fails on the Darwin platform but is rarely a common use case for petsc4py. installCheckFlags = lib.optional stdenv.hostPlatform.isDarwin "PETSC4PY=no"; - nativeInstallCheckInputs = - [ - mpiCheckPhaseHook - ] - ++ lib.optionals pythonSupport [ - python3Packages.pythonImportsCheckHook - python3Packages.unittestCheckHook - ]; + nativeInstallCheckInputs = [ + mpiCheckPhaseHook + ] + ++ lib.optionals pythonSupport [ + python3Packages.pythonImportsCheckHook + python3Packages.unittestCheckHook + ]; unittestFlagsArray = [ "-s" @@ -281,21 +277,20 @@ stdenv.mkDerivation (finalAttrs: { petsc = finalAttrs.finalPackage; } ); - tests = - { - serial = petsc.override { - mpiSupport = false; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - fullDeps = petsc.override { - withFullDeps = true; - withParmetis = false; - }; - mpich = petsc.override { - mpi = mpich; - }; + tests = { + serial = petsc.override { + mpiSupport = false; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + fullDeps = petsc.override { + withFullDeps = true; + withParmetis = false; + }; + mpich = petsc.override { + mpi = mpich; + }; + }; }; setupHook = ./setup-hook.sh; diff --git a/pkgs/by-name/pf/pfft/package.nix b/pkgs/by-name/pf/pfft/package.nix index 356c00ab84c0..36d3043c5615 100644 --- a/pkgs/by-name/pf/pfft/package.nix +++ b/pkgs/by-name/pf/pfft/package.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--enable-portable-binary" - ] ++ lib.optional (precision != "double") "--enable-${precision}"; + ] + ++ lib.optional (precision != "double") "--enable-${precision}"; buildInputs = lib.optional stdenv.cc.isClang llvmPackages.openmp; diff --git a/pkgs/by-name/pg/pgagroal/package.nix b/pkgs/by-name/pg/pgagroal/package.nix index 4ec8d31a2e98..8357d1ebc6da 100644 --- a/pkgs/by-name/pg/pgagroal/package.nix +++ b/pkgs/by-name/pg/pgagroal/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { cjson libev openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]; meta = with lib; { description = "High-performance connection pool for PostgreSQL"; diff --git a/pkgs/by-name/pg/pgbouncer/package.nix b/pkgs/by-name/pg/pgbouncer/package.nix index af6b31cd406d..48bf27eff184 100644 --- a/pkgs/by-name/pg/pgbouncer/package.nix +++ b/pkgs/by-name/pg/pgbouncer/package.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation rec { libevent openssl c-ares - ] ++ lib.optional stdenv.hostPlatform.isLinux systemd; + ] + ++ lib.optional stdenv.hostPlatform.isLinux systemd; enableParallelBuilding = true; configureFlags = lib.optional stdenv.hostPlatform.isLinux "--with-systemd"; diff --git a/pkgs/by-name/pg/pgcopydb/package.nix b/pkgs/by-name/pg/pgcopydb/package.nix index d2c62ea3011a..906bab8156dc 100644 --- a/pkgs/by-name/pg/pgcopydb/package.nix +++ b/pkgs/by-name/pg/pgcopydb/package.nix @@ -31,20 +31,19 @@ clangStdenv.mkDerivation (finalAttrs: { postgresql.pg_config ]; - buildInputs = - [ - boehmgc - libkrb5 - openssl - postgresql - readline - sqlite - zlib - python3Packages.sphinxHook - ] - ++ lib.optionals clangStdenv.hostPlatform.isLinux [ - pam - ]; + buildInputs = [ + boehmgc + libkrb5 + openssl + postgresql + readline + sqlite + zlib + python3Packages.sphinxHook + ] + ++ lib.optionals clangStdenv.hostPlatform.isLinux [ + pam + ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/by-name/pg/pgmodeler/package.nix b/pkgs/by-name/pg/pgmodeler/package.nix index 177b06fee164..acf174617c5a 100644 --- a/pkgs/by-name/pg/pgmodeler/package.nix +++ b/pkgs/by-name/pg/pgmodeler/package.nix @@ -29,30 +29,28 @@ stdenv.mkDerivation rec { copyDesktopItems ]; - qmakeFlags = - [ - "pgmodeler.pro" - "CONFIG+=release" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "PGSQL_INC=${lib.getDev libpq}/include" - "PGSQL_LIB=${lib.getLib libpq}/lib/libpq.dylib" - "XML_INC=${libxml2.dev}/include/libxml2" - "XML_LIB=${libxml2.out}/lib/libxml2.dylib" - "PREFIX=${placeholder "out"}/Applications/pgModeler.app/Contents" - ]; + qmakeFlags = [ + "pgmodeler.pro" + "CONFIG+=release" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "PGSQL_INC=${lib.getDev libpq}/include" + "PGSQL_LIB=${lib.getLib libpq}/lib/libpq.dylib" + "XML_INC=${libxml2.dev}/include/libxml2" + "XML_LIB=${libxml2.out}/lib/libxml2.dylib" + "PREFIX=${placeholder "out"}/Applications/pgModeler.app/Contents" + ]; - buildInputs = - [ - qt6.qtbase - qt6.qtsvg - libpq - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cups - libxml2 - ]; + buildInputs = [ + qt6.qtbase + qt6.qtsvg + libpq + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cups + libxml2 + ]; desktopItems = [ (makeDesktopItem { @@ -67,17 +65,16 @@ stdenv.mkDerivation rec { }) ]; - postInstall = - '' - install -Dm444 apps/pgmodeler/res/windows_ico.ico $out/share/icons/hicolor/256x256/apps/pgmodeler.ico - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/bin - for item in pgmodeler pgmodeler-{cli,se,ch} - do - ln -s $out/Applications/pgModeler.app/Contents/MacOS/$item $out/bin - done - ''; + postInstall = '' + install -Dm444 apps/pgmodeler/res/windows_ico.ico $out/share/icons/hicolor/256x256/apps/pgmodeler.ico + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/bin + for item in pgmodeler pgmodeler-{cli,se,ch} + do + ln -s $out/Applications/pgModeler.app/Contents/MacOS/$item $out/bin + done + ''; dontWrapQtApps = stdenv.hostPlatform.isDarwin; diff --git a/pkgs/by-name/pg/pgpool/package.nix b/pkgs/by-name/pg/pgpool/package.nix index 8ec14e7eed71..8f910bf45797 100644 --- a/pkgs/by-name/pg/pgpool/package.nix +++ b/pkgs/by-name/pg/pgpool/package.nix @@ -23,13 +23,15 @@ stdenv.mkDerivation rec { libpq openssl libxcrypt - ] ++ lib.optional withPam pam; + ] + ++ lib.optional withPam pam; configureFlags = [ "--sysconfdir=/etc" "--localstatedir=/var" "--with-openssl" - ] ++ lib.optional withPam "--with-pam"; + ] + ++ lib.optional withPam "--with-pam"; installFlags = [ "sysconfdir=\${out}/etc" diff --git a/pkgs/by-name/ph/photoqt/package.nix b/pkgs/by-name/ph/photoqt/package.nix index e03e58a4d643..df1176e327a2 100644 --- a/pkgs/by-name/ph/photoqt/package.nix +++ b/pkgs/by-name/ph/photoqt/package.nix @@ -31,28 +31,27 @@ stdenv.mkDerivation rec { qt6.wrapQtAppsHook ]; - buildInputs = - [ - exiv2 - graphicsmagick - libarchive - libraw - pugixml - qt6.qtbase - qt6.qtcharts - qt6.qtdeclarative - qt6.qtimageformats - qt6.qtlocation - qt6.qtmultimedia - qt6.qtpositioning - qt6.qtsvg - qt6Packages.poppler - zxing-cpp - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - mpv - qt6.qtwayland - ]; + buildInputs = [ + exiv2 + graphicsmagick + libarchive + libraw + pugixml + qt6.qtbase + qt6.qtcharts + qt6.qtdeclarative + qt6.qtimageformats + qt6.qtlocation + qt6.qtmultimedia + qt6.qtpositioning + qt6.qtsvg + qt6Packages.poppler + zxing-cpp + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + mpv + qt6.qtwayland + ]; cmakeFlags = [ (lib.cmakeBool "DEVIL" false) diff --git a/pkgs/by-name/pi/picard/package.nix b/pkgs/by-name/pi/picard/package.nix index 7e2c76f8c13b..6935699a4331 100644 --- a/pkgs/by-name/pi/picard/package.nix +++ b/pkgs/by-name/pi/picard/package.nix @@ -28,28 +28,26 @@ pythonPackages.buildPythonApplication rec { hash = "sha256-Q0W5Q1+PbN+yneh98jx0/UNHVfD6okX92hxNzCE+Ibc="; }; - nativeBuildInputs = - [ - gettext - qt5.wrapQtAppsHook - pythonPackages.pytestCheckHook - ] - ++ lib.optionals (pyqt5.multimediaEnabled) [ - gst_all_1.gst-libav - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gst-vaapi - gst_all_1.gstreamer - ]; + nativeBuildInputs = [ + gettext + qt5.wrapQtAppsHook + pythonPackages.pytestCheckHook + ] + ++ lib.optionals (pyqt5.multimediaEnabled) [ + gst_all_1.gst-libav + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gst-vaapi + gst_all_1.gstreamer + ]; - buildInputs = - [ - qt5.qtbase - qt5.qtwayland - ] - ++ lib.optionals (pyqt5.multimediaEnabled) [ - qt5.qtmultimedia.bin - ]; + buildInputs = [ + qt5.qtbase + qt5.qtwayland + ] + ++ lib.optionals (pyqt5.multimediaEnabled) [ + qt5.qtmultimedia.bin + ]; propagatedBuildInputs = with pythonPackages; [ chromaprint @@ -75,13 +73,12 @@ pythonPackages.buildPythonApplication rec { doCheck = true; # In order to spare double wrapping, we use: - preFixup = - '' - makeWrapperArgs+=("''${qtWrapperArgs[@]}") - '' - + lib.optionalString (pyqt5.multimediaEnabled) '' - makeWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") - ''; + preFixup = '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") + '' + + lib.optionalString (pyqt5.multimediaEnabled) '' + makeWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0") + ''; meta = { homepage = "https://picard.musicbrainz.org"; diff --git a/pkgs/by-name/pi/picolibc/package.nix b/pkgs/by-name/pi/picolibc/package.nix index 36a4c1a142b4..40c4c5c84990 100644 --- a/pkgs/by-name/pi/picolibc/package.nix +++ b/pkgs/by-name/pi/picolibc/package.nix @@ -119,78 +119,77 @@ stdenv.mkDerivation (finalAttrs: { # Default values taken from # Build fails without using them. # https://github.com/picolibc/picolibc/blob/e57b766cb5d80f23c20d05ab067001d85910f927/doc/os.md?plain=1#L183 - mesonFlags = - [ - (mesonBool "multilib" multilib) - (mesonBool "sanitize-bounds" sanitize-bounds) - (mesonBool "sanitize-trap-on-error" sanitize-trap-on-error) - (mesonBool "profile" profile) - (mesonBool "analyzer" analyzer) - (mesonBool "assert-verbose" assert-verbose) - (mesonBool "fast-strcmp" fast-strcmp) + mesonFlags = [ + (mesonBool "multilib" multilib) + (mesonBool "sanitize-bounds" sanitize-bounds) + (mesonBool "sanitize-trap-on-error" sanitize-trap-on-error) + (mesonBool "profile" profile) + (mesonBool "analyzer" analyzer) + (mesonBool "assert-verbose" assert-verbose) + (mesonBool "fast-strcmp" fast-strcmp) - # Testing options - (mesonBool "picolib" picolib) - (mesonBool "semihost" semihost) - (mesonBool "use-stdlib" true) + # Testing options + (mesonBool "picolib" picolib) + (mesonBool "semihost" semihost) + (mesonBool "use-stdlib" true) - # Install options - (mesonOption "specsdir" "${placeholder "dev"}/lib") + # Install options + (mesonOption "specsdir" "${placeholder "dev"}/lib") - (mesonBool "tinystdio" tinystdio) - (mesonBool "io-c99-formats" io-c99-formats) - (mesonBool "io-long-long" io-long-long) - (mesonBool "io-pos-args" io-pos-args) - (mesonBool "io-long-double" io-long-double) + (mesonBool "tinystdio" tinystdio) + (mesonBool "io-c99-formats" io-c99-formats) + (mesonBool "io-long-long" io-long-long) + (mesonBool "io-pos-args" io-pos-args) + (mesonBool "io-long-double" io-long-double) - (mesonBool "io-float-exact" io-float-exact) - (mesonBool "atomic-ungetc" atomic-ungetc) - (mesonBool "posix-console" posix-console) - (mesonOption "format-default" format-default) - (mesonBool "printf-aliases" printf-aliases) - (mesonBool "io-percent-b" io-percent-b) - (mesonBool "printf-small-ultoa" printf-small-ultoa) - (mesonBool "printf-percent-n" printf-percent-n) - (mesonBool "minimal-io-long-long" minimal-io-long-long) - (mesonBool "fast-bufio" fast-bufio) - (mesonBool "io-wchar" io-wchar) + (mesonBool "io-float-exact" io-float-exact) + (mesonBool "atomic-ungetc" atomic-ungetc) + (mesonBool "posix-console" posix-console) + (mesonOption "format-default" format-default) + (mesonBool "printf-aliases" printf-aliases) + (mesonBool "io-percent-b" io-percent-b) + (mesonBool "printf-small-ultoa" printf-small-ultoa) + (mesonBool "printf-percent-n" printf-percent-n) + (mesonBool "minimal-io-long-long" minimal-io-long-long) + (mesonBool "fast-bufio" fast-bufio) + (mesonBool "io-wchar" io-wchar) - (mesonBool "mb-capable" mb-capable) - (mesonBool "mb-extended-charsets" mb-extended-charsets) - (mesonOption "mb-ucs-charsets" mb-ucs-charsets) - (mesonOption "mb-iso-charsets" mb-iso-charsets) - (mesonOption "mb-jis-charsets" mb-jis-charsets) - (mesonOption "mb-windows-charsets" mb-windows-charsets) + (mesonBool "mb-capable" mb-capable) + (mesonBool "mb-extended-charsets" mb-extended-charsets) + (mesonOption "mb-ucs-charsets" mb-ucs-charsets) + (mesonOption "mb-iso-charsets" mb-iso-charsets) + (mesonOption "mb-jis-charsets" mb-jis-charsets) + (mesonOption "mb-windows-charsets" mb-windows-charsets) - (mesonBool "picocrt" picocrt) - (mesonBool "picocrt-enable-mmu" picocrt-enable-mmu) - (mesonBool "picocrt-lib" picocrt-lib) - (mesonBool "picoexit" picoexit) - (mesonBool "newlib-initfini-array" initfini-array) - (mesonBool "crt-runtime-size" crt-runtime-size) + (mesonBool "picocrt" picocrt) + (mesonBool "picocrt-enable-mmu" picocrt-enable-mmu) + (mesonBool "picocrt-lib" picocrt-lib) + (mesonBool "picoexit" picoexit) + (mesonBool "newlib-initfini-array" initfini-array) + (mesonBool "crt-runtime-size" crt-runtime-size) - (mesonBool "newlib-atexit-dynamic-alloc" newlib-atexit-dynamic-alloc) - (mesonBool "newlib-global-atexit" newlib-global-atexit) - (mesonBool "newlib-register-fini" newlib-register-fini) + (mesonBool "newlib-atexit-dynamic-alloc" newlib-atexit-dynamic-alloc) + (mesonBool "newlib-global-atexit" newlib-global-atexit) + (mesonBool "newlib-register-fini" newlib-register-fini) - (mesonBool "newlib-nano-malloc" newlib-nano-malloc) - (mesonBool "nano-malloc-clear-freed" nano-malloc-clear-freed) + (mesonBool "newlib-nano-malloc" newlib-nano-malloc) + (mesonBool "nano-malloc-clear-freed" nano-malloc-clear-freed) - (mesonBool "newlib-multithread" (!single-thread)) + (mesonBool "newlib-multithread" (!single-thread)) - (mesonOption "thread-local-storage" thread-local-storage) - (mesonOption "tls-model" tls-model) - (mesonBool "newlib-global-errno" newlib-global-errno) - (mesonOption "errno-function" errno-function) - (mesonBool "tls-rp2040" tls-rp2040) + (mesonOption "thread-local-storage" thread-local-storage) + (mesonOption "tls-model" tls-model) + (mesonBool "newlib-global-errno" newlib-global-errno) + (mesonOption "errno-function" errno-function) + (mesonBool "tls-rp2040" tls-rp2040) - (mesonBool "want-math-errno" want-math-errno) - ] - ++ lib.optionals finalAttrs.doCheck [ - (mesonBool "tests" true) - # Something is broken with this and I'm not sure what. - (mesonOption "tests-cdefs" "false") - ]; + (mesonBool "want-math-errno" want-math-errno) + ] + ++ lib.optionals finalAttrs.doCheck [ + (mesonBool "tests" true) + # Something is broken with this and I'm not sure what. + (mesonOption "tests-cdefs" "false") + ]; doCheck = canExecute; diff --git a/pkgs/by-name/pi/picolisp/package.nix b/pkgs/by-name/pi/picolisp/package.nix index 237649250e24..e9bfca1a2370 100644 --- a/pkgs/by-name/pi/picolisp/package.nix +++ b/pkgs/by-name/pi/picolisp/package.nix @@ -29,16 +29,15 @@ stdenv.mkDerivation { readline ]; sourceRoot = ''pil21''; - preBuild = - '' - cd src - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Flags taken from instructions at: https://picolisp.com/wiki/?alternativeMacOSRepository - makeFlagsArray+=( - SHARED='-dynamiclib -undefined dynamic_lookup' - ) - ''; + preBuild = '' + cd src + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Flags taken from instructions at: https://picolisp.com/wiki/?alternativeMacOSRepository + makeFlagsArray+=( + SHARED='-dynamiclib -undefined dynamic_lookup' + ) + ''; installPhase = '' cd .. diff --git a/pkgs/by-name/pi/picom/package.nix b/pkgs/by-name/pi/picom/package.nix index 1e07ef86231f..ed386a0ebaf7 100644 --- a/pkgs/by-name/pi/picom/package.nix +++ b/pkgs/by-name/pi/picom/package.nix @@ -93,14 +93,13 @@ stdenv.mkDerivation (finalAttrs: { # In debug mode, also copy src directory to store. If you then run `gdb picom` # in the bin directory of picom store path, gdb finds the source files. - postInstall = - '' - wrapProgram $out/bin/picom-trans \ - --prefix PATH : ${lib.makeBinPath [ xwininfo ]} - '' - + lib.optionalString withDebug '' - cp -r ../src $out/ - ''; + postInstall = '' + wrapProgram $out/bin/picom-trans \ + --prefix PATH : ${lib.makeBinPath [ xwininfo ]} + '' + + lib.optionalString withDebug '' + cp -r ../src $out/ + ''; nativeInstallCheckInputs = [ versionCheckHook diff --git a/pkgs/by-name/pi/pihole/package.nix b/pkgs/by-name/pi/pihole/package.nix index c963506d0d01..8037fd3113a9 100644 --- a/pkgs/by-name/pi/pihole/package.nix +++ b/pkgs/by-name/pi/pihole/package.nix @@ -245,13 +245,12 @@ }).overrideAttrs (old: { # Resholve can't fix the hardcoded absolute paths, so substitute them before resholving - preFixup = - '' - scriptsDir=$out/usr/share/pihole + preFixup = '' + scriptsDir=$out/usr/share/pihole - substituteInPlace $out/bin/pihole $scriptsDir/advanced/Scripts/*.sh \ - --replace-quiet /etc/.pihole $scriptsDir \ - --replace-quiet /opt/pihole $scriptsDir/advanced/Scripts - '' - + old.preFixup; + substituteInPlace $out/bin/pihole $scriptsDir/advanced/Scripts/*.sh \ + --replace-quiet /etc/.pihole $scriptsDir \ + --replace-quiet /opt/pihole $scriptsDir/advanced/Scripts + '' + + old.preFixup; }) diff --git a/pkgs/by-name/pi/pijul/package.nix b/pkgs/by-name/pi/pijul/package.nix index 8f7cbd50042d..abc134daaf98 100644 --- a/pkgs/by-name/pi/pijul/package.nix +++ b/pkgs/by-name/pi/pijul/package.nix @@ -33,7 +33,8 @@ rustPlatform.buildRustPackage rec { openssl libsodium xxHash - ] ++ (lib.optionals gitImportSupport [ libgit2 ]); + ] + ++ (lib.optionals gitImportSupport [ libgit2 ]); buildFeatures = lib.optional gitImportSupport "git"; diff --git a/pkgs/by-name/pi/pikchr/package.nix b/pkgs/by-name/pi/pikchr/package.nix index 270f0f0a3b6f..eed0842e47cf 100644 --- a/pkgs/by-name/pi/pikchr/package.nix +++ b/pkgs/by-name/pi/pikchr/package.nix @@ -31,19 +31,18 @@ stdenv.mkDerivation { buildFlags = [ "pikchr" ] ++ lib.optional enableTcl "piktcl"; - installPhase = - '' - runHook preInstall - install -Dm755 pikchr $out/bin/pikchr - install -Dm755 pikchr.out $out/lib/pikchr.o - install -Dm644 pikchr.h $out/include/pikchr.h - '' - + lib.optionalString enableTcl '' - cp -r piktcl $out/lib/piktcl - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + install -Dm755 pikchr $out/bin/pikchr + install -Dm755 pikchr.out $out/lib/pikchr.o + install -Dm644 pikchr.h $out/include/pikchr.h + '' + + lib.optionalString enableTcl '' + cp -r piktcl $out/lib/piktcl + '' + + '' + runHook postInstall + ''; dontWrapTclBinaries = true; diff --git a/pkgs/by-name/pi/pilot-link/package.nix b/pkgs/by-name/pi/pilot-link/package.nix index a7b6f3813b50..ea3f75aad9b9 100644 --- a/pkgs/by-name/pi/pilot-link/package.nix +++ b/pkgs/by-name/pi/pilot-link/package.nix @@ -31,31 +31,33 @@ stdenv.mkDerivation { # Resolve build issues on modern systems. # https://github.com/desrod/pilot-link/issues/16 # https://aur.archlinux.org/packages/pilot-link-git - patches = - [ - ./configure-checks.patch - ./incompatible-pointer-type.patch - ] - ++ lib.optionals enableConduits [ ./format-string-literals.patch ] - ++ lib.optionals enableLibpng [ ./pilot-link-png14.patch ]; + patches = [ + ./configure-checks.patch + ./incompatible-pointer-type.patch + ] + ++ lib.optionals enableConduits [ ./format-string-literals.patch ] + ++ lib.optionals enableLibpng [ ./pilot-link-png14.patch ]; nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ lib.optionals enableConduits [ bison ]; + ] + ++ lib.optionals enableConduits [ bison ]; - buildInputs = - [ popt ] - ++ lib.optionals bluezSupport [ bluez ] - ++ lib.optionals enableLibpng [ libpng ] - ++ lib.optionals enableLibusb [ libusb-compat-0_1 ] - ++ lib.optionals readlineSupport [ readline ]; + buildInputs = [ + popt + ] + ++ lib.optionals bluezSupport [ bluez ] + ++ lib.optionals enableLibpng [ libpng ] + ++ lib.optionals enableLibusb [ libusb-compat-0_1 ] + ++ lib.optionals readlineSupport [ readline ]; - configureFlags = - [ "--with-libiconv" ] - ++ lib.optionals enableConduits [ "--enable-conduits" ] - ++ lib.optionals enableLibpng [ "--enable-libpng" ] - ++ lib.optionals enableLibusb [ "--enable-libusb" ]; + configureFlags = [ + "--with-libiconv" + ] + ++ lib.optionals enableConduits [ "--enable-conduits" ] + ++ lib.optionals enableLibpng [ "--enable-libpng" ] + ++ lib.optionals enableLibusb [ "--enable-libusb" ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/pi/pineflash/package.nix b/pkgs/by-name/pi/pineflash/package.nix index a3571a9319cc..d12004e12d15 100644 --- a/pkgs/by-name/pi/pineflash/package.nix +++ b/pkgs/by-name/pi/pineflash/package.nix @@ -33,7 +33,8 @@ rustPlatform.buildRustPackage (finalAttrs: { nativeBuildInputs = [ pkg-config - ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; buildInputs = [ blisp @@ -51,21 +52,20 @@ rustPlatform.buildRustPackage (finalAttrs: { wayland ]; - postPatch = - '' - substituteInPlace src/submodules/flash.rs \ - --replace-fail 'let command = Command::new("pkexec")' 'let command = Command::new("/run/wrappers/bin/pkexec")' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace src/submodules/flash.rs \ - --replace-fail 'let blisppath = "blisp";' 'let blisppath = "${lib.getExe blisp}";' \ - --replace-fail 'let dfupath = "dfu-util";' 'let dfupath = "${lib.getExe' dfu-util "dfu-util"}";' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/submodules/flash.rs \ - --replace-fail 'Command::new("blisp")' 'Command::new("${lib.getExe blisp}")' \ - --replace-fail 'Command::new("dfu-util")' 'Command::new("${lib.getExe' dfu-util "dfu-util"}")' - ''; + postPatch = '' + substituteInPlace src/submodules/flash.rs \ + --replace-fail 'let command = Command::new("pkexec")' 'let command = Command::new("/run/wrappers/bin/pkexec")' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace src/submodules/flash.rs \ + --replace-fail 'let blisppath = "blisp";' 'let blisppath = "${lib.getExe blisp}";' \ + --replace-fail 'let dfupath = "dfu-util";' 'let dfupath = "${lib.getExe' dfu-util "dfu-util"}";' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/submodules/flash.rs \ + --replace-fail 'Command::new("blisp")' 'Command::new("${lib.getExe blisp}")' \ + --replace-fail 'Command::new("dfu-util")' 'Command::new("${lib.getExe' dfu-util "dfu-util"}")' + ''; postInstall = '' mkdir -p "$out/share/applications" diff --git a/pkgs/by-name/pi/pinocchio/package.nix b/pkgs/by-name/pi/pinocchio/package.nix index be827f530c1c..3d58ce177cd8 100644 --- a/pkgs/by-name/pi/pinocchio/package.nix +++ b/pkgs/by-name/pi/pinocchio/package.nix @@ -56,51 +56,48 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - doxygen - pkg-config - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + cmake + doxygen + pkg-config + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pythonImportsCheckHook + ]; - propagatedBuildInputs = - [ - console-bridge - jrl-cmakemodules - urdfdom - ] - ++ lib.optionals (!pythonSupport) [ - boost - eigen - ] - ++ lib.optionals (!pythonSupport && collisionSupport) [ coal ] - ++ lib.optionals pythonSupport [ - python3Packages.boost - python3Packages.eigenpy - ] - ++ lib.optionals (pythonSupport && collisionSupport) [ python3Packages.coal ] - ++ lib.optionals (!pythonSupport && casadiSupport) [ casadi ] - ++ lib.optionals (pythonSupport && casadiSupport) [ python3Packages.casadi ]; + propagatedBuildInputs = [ + console-bridge + jrl-cmakemodules + urdfdom + ] + ++ lib.optionals (!pythonSupport) [ + boost + eigen + ] + ++ lib.optionals (!pythonSupport && collisionSupport) [ coal ] + ++ lib.optionals pythonSupport [ + python3Packages.boost + python3Packages.eigenpy + ] + ++ lib.optionals (pythonSupport && collisionSupport) [ python3Packages.coal ] + ++ lib.optionals (!pythonSupport && casadiSupport) [ casadi ] + ++ lib.optionals (pythonSupport && casadiSupport) [ python3Packages.casadi ]; checkInputs = lib.optionals (pythonSupport && casadiSupport) [ python3Packages.matplotlib ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) - (lib.cmakeBool "BUILD_WITH_LIBPYTHON" pythonSupport) - (lib.cmakeBool "BUILD_WITH_CASADI_SUPPORT" casadiSupport) - (lib.cmakeBool "BUILD_WITH_COLLISION_SUPPORT" collisionSupport) - (lib.cmakeBool "INSTALL_DOCUMENTATION" true) - # Disable test that fails on darwin - # https://github.com/stack-of-tasks/pinocchio/blob/42306ed023b301aafef91e2e76cb070c5e9c3f7d/flake.nix#L24C1-L27C17 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;pinocchio-example-py-casadi-quadrotor-ocp") - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) + (lib.cmakeBool "BUILD_WITH_LIBPYTHON" pythonSupport) + (lib.cmakeBool "BUILD_WITH_CASADI_SUPPORT" casadiSupport) + (lib.cmakeBool "BUILD_WITH_COLLISION_SUPPORT" collisionSupport) + (lib.cmakeBool "INSTALL_DOCUMENTATION" true) + # Disable test that fails on darwin + # https://github.com/stack-of-tasks/pinocchio/blob/42306ed023b301aafef91e2e76cb070c5e9c3f7d/flake.nix#L24C1-L27C17 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;pinocchio-example-py-casadi-quadrotor-ocp") + ]; doCheck = true; pythonImportsCheck = [ "pinocchio" ]; diff --git a/pkgs/by-name/pi/pitivi/package.nix b/pkgs/by-name/pi/pitivi/package.nix index 6682826cbc6d..1d3e38538eab 100644 --- a/pkgs/by-name/pi/pitivi/package.nix +++ b/pkgs/by-name/pi/pitivi/package.nix @@ -49,25 +49,24 @@ python3.pkgs.buildPythonApplication rec { gobject-introspection ]; - buildInputs = - [ - gtk3 - libpeas - librsvg - gsound - gsettings-desktop-schemas - libnotify - ] - ++ (with gst_all_1; [ - gstreamer - gst-editing-services - gst-plugins-base - (gst-plugins-good.override { gtkSupport = true; }) - gst-plugins-bad - gst-plugins-ugly - gst-libav - gst-devtools - ]); + buildInputs = [ + gtk3 + libpeas + librsvg + gsound + gsettings-desktop-schemas + libnotify + ] + ++ (with gst_all_1; [ + gstreamer + gst-editing-services + gst-plugins-base + (gst-plugins-good.override { gtkSupport = true; }) + gst-plugins-bad + gst-plugins-ugly + gst-libav + gst-devtools + ]); pythonPath = with python3.pkgs; [ pygobject3 diff --git a/pkgs/by-name/pi/pixinsight/package.nix b/pkgs/by-name/pi/pixinsight/package.nix index b2edec42104f..212512ef17b9 100644 --- a/pkgs/by-name/pi/pixinsight/package.nix +++ b/pkgs/by-name/pi/pixinsight/package.nix @@ -61,59 +61,58 @@ stdenv.mkDerivation (finalAttrs: { bubblewrap ]; - buildInputs = - [ - (lib.getLib stdenv.cc.cc) - stdenv.cc - libGL - libpulseaudio - alsa-lib - nss - gd - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - nspr - expat - fontconfig - dbus - glib - zlib - openssl - libdrm - wayland - cups - avahi-compat - libjpeg8 - gdk-pixbuf - gtk3 - pango - # Qt stuff - qt6Packages.qt3d - qt6Packages.mlt - qt6Packages.qtbase - #qtgamepad - qt6Packages.qtserialport - qt6Packages.qtserialbus - qt6Packages.qtvirtualkeyboard - qt6Packages.qtmultimedia - qt6Packages.qtlocation - qt6Packages.qtwebengine - qt6Packages.qtquick3d - qt6Packages.qtwayland - qt6Packages.qtwebview - qt6Packages.qtscxml - ] - ++ (with xorg; [ - libX11 - libXdamage - xrandr - libXtst - libXcomposite - libXext - libXfixes - libXrandr - libxkbfile - ]); + buildInputs = [ + (lib.getLib stdenv.cc.cc) + stdenv.cc + libGL + libpulseaudio + alsa-lib + nss + gd + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + nspr + expat + fontconfig + dbus + glib + zlib + openssl + libdrm + wayland + cups + avahi-compat + libjpeg8 + gdk-pixbuf + gtk3 + pango + # Qt stuff + qt6Packages.qt3d + qt6Packages.mlt + qt6Packages.qtbase + #qtgamepad + qt6Packages.qtserialport + qt6Packages.qtserialbus + qt6Packages.qtvirtualkeyboard + qt6Packages.qtmultimedia + qt6Packages.qtlocation + qt6Packages.qtwebengine + qt6Packages.qtquick3d + qt6Packages.qtwayland + qt6Packages.qtwebview + qt6Packages.qtscxml + ] + ++ (with xorg; [ + libX11 + libXdamage + xrandr + libXtst + libXcomposite + libXext + libXfixes + libXrandr + libxkbfile + ]); postPatch = '' patchelf ./installer \ diff --git a/pkgs/by-name/pj/pjsip/package.nix b/pkgs/by-name/pj/pjsip/package.nix index 6cd8d59e8669..0b4368227654 100644 --- a/pkgs/by-name/pj/pjsip/package.nix +++ b/pkgs/by-name/pj/pjsip/package.nix @@ -43,16 +43,16 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ openssl libsamplerate - ] ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib; + ] + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib; - env = - { - NIX_LDFLAGS = if stdenv.hostPlatform.isDarwin then "-lc++" else "-lstdc++"; - } - // lib.optionalAttrs stdenv.cc.isClang { CXXFLAGS = "-std=c++11"; } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - NIX_CFLAGS_LINK = "-headerpad_max_install_names"; - }; + env = { + NIX_LDFLAGS = if stdenv.hostPlatform.isDarwin then "-lc++" else "-lstdc++"; + } + // lib.optionalAttrs stdenv.cc.isClang { CXXFLAGS = "-std=c++11"; } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_CFLAGS_LINK = "-headerpad_max_install_names"; + }; preConfigure = '' export LD=$CC @@ -66,56 +66,55 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" ] ++ lib.optional pythonSupport "py"; - postInstall = - '' - mkdir -p $out/bin - cp pjsip-apps/bin/pjsua-* $out/bin/pjsua - mkdir -p $out/share/${finalAttrs.pname}-${finalAttrs.version}/samples - cp pjsip-apps/bin/samples/*/* $out/share/${finalAttrs.pname}-${finalAttrs.version}/samples - '' - + lib.optionalString pythonSupport '' - (cd pjsip-apps/src/swig/python && \ - python -m build --no-isolation --outdir dist/ --wheel - python -m installer --prefix $py dist/*.whl - ) - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # On MacOS relative paths are used to refer to libraries. All libraries use - # a relative path like ../lib/*.dylib or ../../lib/*.dylib. We need to - # rewrite these to use absolute ones. + postInstall = '' + mkdir -p $out/bin + cp pjsip-apps/bin/pjsua-* $out/bin/pjsua + mkdir -p $out/share/${finalAttrs.pname}-${finalAttrs.version}/samples + cp pjsip-apps/bin/samples/*/* $out/share/${finalAttrs.pname}-${finalAttrs.version}/samples + '' + + lib.optionalString pythonSupport '' + (cd pjsip-apps/src/swig/python && \ + python -m build --no-isolation --outdir dist/ --wheel + python -m installer --prefix $py dist/*.whl + ) + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # On MacOS relative paths are used to refer to libraries. All libraries use + # a relative path like ../lib/*.dylib or ../../lib/*.dylib. We need to + # rewrite these to use absolute ones. - # First, find all libraries (and their symlinks) in our outputs to define - # the install_name_tool -change arguments we should pass. - readarray -t libraries < <( - for outputName in $(getAllOutputNames); do - find "''${!outputName}" \( -name '*.dylib*' -o -name '*.so*' \) - done - ) - - # Determine the install_name_tool -change arguments that are going to be - # applied to all libraries. - change_args=() - for lib in "''${libraries[@]}"; do - lib_name="$(basename $lib)" - change_args+=(-change ../lib/$lib_name $lib) - change_args+=(-change ../../lib/$lib_name $lib) + # First, find all libraries (and their symlinks) in our outputs to define + # the install_name_tool -change arguments we should pass. + readarray -t libraries < <( + for outputName in $(getAllOutputNames); do + find "''${!outputName}" \( -name '*.dylib*' -o -name '*.so*' \) done + ) - # Rewrite id and library refences for all non-symlinked libraries. - for lib in "''${libraries[@]}"; do - if [ -f "$lib" ]; then - install_name_tool -id $lib "''${change_args[@]}" $lib + # Determine the install_name_tool -change arguments that are going to be + # applied to all libraries. + change_args=() + for lib in "''${libraries[@]}"; do + lib_name="$(basename $lib)" + change_args+=(-change ../lib/$lib_name $lib) + change_args+=(-change ../../lib/$lib_name $lib) + done + + # Rewrite id and library refences for all non-symlinked libraries. + for lib in "''${libraries[@]}"; do + if [ -f "$lib" ]; then + install_name_tool -id $lib "''${change_args[@]}" $lib + fi + done + + # Rewrite library references for all executables. + find "$out" -type f -executable -path "*/bin/*" -o -type f -executable -path "*/share/*/samples/*" \ + | while read executable; do + if isMachO "$executable"; then + install_name_tool "''${change_args[@]}" "$executable" fi done - - # Rewrite library references for all executables. - find "$out" -type f -executable -path "*/bin/*" -o -type f -executable -path "*/share/*/samples/*" \ - | while read executable; do - if isMachO "$executable"; then - install_name_tool "''${change_args[@]}" "$executable" - fi - done - ''; + ''; # We need the libgcc_s.so.1 loadable (for pthread_cancel to work) dontPatchELF = true; diff --git a/pkgs/by-name/pk/pkg-config-unwrapped/package.nix b/pkgs/by-name/pk/pkg-config-unwrapped/package.nix index bcd386b134b4..95731b61f2c1 100644 --- a/pkgs/by-name/pk/pkg-config-unwrapped/package.nix +++ b/pkgs/by-name/pk/pkg-config-unwrapped/package.nix @@ -42,21 +42,22 @@ stdenv.mkDerivation rec { buildInputs = [ libiconv ]; - configureFlags = - [ "--with-internal-glib" ] - ++ lib.optionals (stdenv.hostPlatform.isSunOS) [ - "--with-libiconv=gnu" - "--with-system-library-path" - "--with-system-include-path" - "CFLAGS=-DENABLE_NLS" - ] - # Can't run these tests while cross-compiling - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "glib_cv_stack_grows=no" - "glib_cv_uscore=no" - "ac_cv_func_posix_getpwuid_r=yes" - "ac_cv_func_posix_getgrgid_r=yes" - ]; + configureFlags = [ + "--with-internal-glib" + ] + ++ lib.optionals (stdenv.hostPlatform.isSunOS) [ + "--with-libiconv=gnu" + "--with-system-library-path" + "--with-system-include-path" + "CFLAGS=-DENABLE_NLS" + ] + # Can't run these tests while cross-compiling + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "glib_cv_stack_grows=no" + "glib_cv_uscore=no" + "ac_cv_func_posix_getpwuid_r=yes" + "ac_cv_func_posix_getgrgid_r=yes" + ]; env.NIX_CFLAGS_COMPILE = toString ( # Silence "incompatible integer to pointer conversion passing 'gsize'" when building with Clang. diff --git a/pkgs/by-name/pk/pkg/package.nix b/pkgs/by-name/pk/pkg/package.nix index a6296a956d88..e92d1ba5e208 100644 --- a/pkgs/by-name/pk/pkg/package.nix +++ b/pkgs/by-name/pk/pkg/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { openssl xz zlib - ] ++ lib.optional stdenv.hostPlatform.isLinux libbsd; + ] + ++ lib.optional stdenv.hostPlatform.isLinux libbsd; enableParallelBuilding = true; diff --git a/pkgs/by-name/pk/pktgen/package.nix b/pkgs/by-name/pk/pktgen/package.nix index 095196a6eaa9..116daa69dc1f 100644 --- a/pkgs/by-name/pk/pktgen/package.nix +++ b/pkgs/by-name/pk/pktgen/package.nix @@ -33,18 +33,17 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - dpdk - libbsd - libpcap - lua5_3 - numactl - which - ] - ++ lib.optionals withGtk [ - gtk2 - ]; + buildInputs = [ + dpdk + libbsd + libpcap + lua5_3 + numactl + which + ] + ++ lib.optionals withGtk [ + gtk2 + ]; RTE_SDK = dpdk; GUI = lib.optionalString withGtk "true"; diff --git a/pkgs/by-name/pl/playerctl/package.nix b/pkgs/by-name/pl/playerctl/package.nix index e4a4b10d1e6d..fbeafd0e1c91 100644 --- a/pkgs/by-name/pl/playerctl/package.nix +++ b/pkgs/by-name/pl/playerctl/package.nix @@ -25,18 +25,17 @@ stdenv.mkDerivation rec { sha256 = "sha256-OiGKUnsKX0ihDRceZoNkcZcEAnz17h2j2QUOSVcxQEY="; }; - nativeBuildInputs = - [ - docbook_xsl - gobject-introspection - gtk-doc - meson - ninja - pkg-config - ] - ++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + docbook_xsl + gobject-introspection + gtk-doc + meson + ninja + pkg-config + ] + ++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib ]; mesonFlags = [ diff --git a/pkgs/by-name/pl/plfit/package.nix b/pkgs/by-name/pl/plfit/package.nix index e9b61b9270ef..90f103aea0e3 100644 --- a/pkgs/by-name/pl/plfit/package.nix +++ b/pkgs/by-name/pl/plfit/package.nix @@ -25,22 +25,20 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail ' ''${Python3_SITELIB}' ' ${placeholder "out"}/${python.sitePackages}' ''; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals (python != null) [ - python - swig - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals (python != null) [ + python + swig + ]; - cmakeFlags = - [ - "-DPLFIT_USE_OPENMP=ON" - ] - ++ lib.optionals (python != null) [ - "-DPLFIT_COMPILE_PYTHON_MODULE=ON" - ]; + cmakeFlags = [ + "-DPLFIT_USE_OPENMP=ON" + ] + ++ lib.optionals (python != null) [ + "-DPLFIT_COMPILE_PYTHON_MODULE=ON" + ]; buildInputs = lib.optionals stdenv.cc.isClang [ llvmPackages.openmp diff --git a/pkgs/by-name/pl/plink-ng/package.nix b/pkgs/by-name/pl/plink-ng/package.nix index ea697c070e4e..a61cb007908c 100644 --- a/pkgs/by-name/pl/plink-ng/package.nix +++ b/pkgs/by-name/pl/plink-ng/package.nix @@ -18,14 +18,13 @@ stdenv.mkDerivation rec { sha256 = "1zhffjbwpd50dxywccbnv1rxy9njwz73l4awc5j7i28rgj3davcq"; }; - buildInputs = - [ - zlib - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - blas - lapack - ]; + buildInputs = [ + zlib + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + blas + lapack + ]; preBuild = '' sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h diff --git a/pkgs/by-name/pm/pmacct/package.nix b/pkgs/by-name/pm/pmacct/package.nix index ab19c7cae498..b7124af8a101 100644 --- a/pkgs/by-name/pm/pmacct/package.nix +++ b/pkgs/by-name/pm/pmacct/package.nix @@ -41,34 +41,32 @@ stdenv.mkDerivation (finalAttrs: { pkg-config libtool ]; - buildInputs = - [ - libcdada - libpcap - ] - ++ lib.optional withJansson jansson - ++ lib.optional withNflog libnetfilter_log - ++ lib.optional withSQLite sqlite - ++ lib.optional withPgSQL libpq - ++ lib.optionals withMysql [ - libmysqlclient - zlib - numactl - ] - ++ lib.optional gnutlsSupport gnutls; + buildInputs = [ + libcdada + libpcap + ] + ++ lib.optional withJansson jansson + ++ lib.optional withNflog libnetfilter_log + ++ lib.optional withSQLite sqlite + ++ lib.optional withPgSQL libpq + ++ lib.optionals withMysql [ + libmysqlclient + zlib + numactl + ] + ++ lib.optional gnutlsSupport gnutls; MYSQL_CONFIG = lib.optionalString withMysql "${lib.getDev libmysqlclient}/bin/mysql_config"; - configureFlags = - [ - "--with-pcap-includes=${libpcap}/include" - ] - ++ lib.optional withJansson "--enable-jansson" - ++ lib.optional withNflog "--enable-nflog" - ++ lib.optional withSQLite "--enable-sqlite3" - ++ lib.optional withPgSQL "--enable-pgsql" - ++ lib.optional withMysql "--enable-mysql" - ++ lib.optional gnutlsSupport "--enable-gnutls"; + configureFlags = [ + "--with-pcap-includes=${libpcap}/include" + ] + ++ lib.optional withJansson "--enable-jansson" + ++ lib.optional withNflog "--enable-nflog" + ++ lib.optional withSQLite "--enable-sqlite3" + ++ lib.optional withPgSQL "--enable-pgsql" + ++ lib.optional withMysql "--enable-mysql" + ++ lib.optional gnutlsSupport "--enable-gnutls"; passthru.tests = { version = testers.testVersion { diff --git a/pkgs/by-name/pm/pmars/package.nix b/pkgs/by-name/pm/pmars/package.nix index f5f52eba5fd4..cce56b0b1d89 100644 --- a/pkgs/by-name/pm/pmars/package.nix +++ b/pkgs/by-name/pm/pmars/package.nix @@ -17,8 +17,7 @@ let "RWLIMIT" ]; pkgConfigLibs = - lib.optionals enableXwinGraphics [ "x11" ] - ++ lib.optionals (!enableXwinGraphics) [ "ncurses" ]; + lib.optionals enableXwinGraphics [ "x11" ] ++ lib.optionals (!enableXwinGraphics) [ "ncurses" ]; in stdenv.mkDerivation (finalAttrs: { pname = "pmars"; @@ -61,8 +60,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ installShellFiles ] ++ lib.optionals (pkgConfigLibs != [ ]) [ pkg-config ]; buildInputs = - lib.optionals enableXwinGraphics [ libX11 ] - ++ lib.optionals (!enableXwinGraphics) [ ncurses ]; + lib.optionals enableXwinGraphics [ libX11 ] ++ lib.optionals (!enableXwinGraphics) [ ncurses ]; preConfigure = '' cd src diff --git a/pkgs/by-name/pm/pmbootstrap/package.nix b/pkgs/by-name/pm/pmbootstrap/package.nix index e05c89017f4a..78ff5db4c519 100644 --- a/pkgs/by-name/pm/pmbootstrap/package.nix +++ b/pkgs/by-name/pm/pmbootstrap/package.nix @@ -52,16 +52,15 @@ python3Packages.buildPythonApplication rec { ''; # skip impure tests - disabledTests = - [ - "test_pkgrepo_pmaports" - "test_random_valid_deviceinfos" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # assert chroot.type == ChrootType.BUILDROOT - # AssertionError: assert == - "test_valid_chroots" - ]; + disabledTests = [ + "test_pkgrepo_pmaports" + "test_random_valid_deviceinfos" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # assert chroot.type == ChrootType.BUILDROOT + # AssertionError: assert == + "test_valid_chroots" + ]; versionCheckProgramArg = "--version"; diff --git a/pkgs/by-name/pm/pmix/package.nix b/pkgs/by-name/pm/pmix/package.nix index 10149bcdf43c..9b919a3c14f3 100644 --- a/pkgs/by-name/pm/pmix/package.nix +++ b/pkgs/by-name/pm/pmix/package.nix @@ -68,25 +68,24 @@ stdenv.mkDerivation (finalAttrs: { ./autogen.pl ''; - postInstall = - '' - find $out/lib/ -name "*.la" -exec rm -f \{} \; + postInstall = '' + find $out/lib/ -name "*.la" -exec rm -f \{} \; - moveToOutput "bin/pmix_info" "''${!outputDev}" - moveToOutput "bin/pmixcc" "''${!outputDev}" - moveToOutput "share/pmix/pmixcc-wrapper-data.txt" "''${!outputDev}" + moveToOutput "bin/pmix_info" "''${!outputDev}" + moveToOutput "bin/pmixcc" "''${!outputDev}" + moveToOutput "share/pmix/pmixcc-wrapper-data.txt" "''${!outputDev}" - '' - # From some reason the Darwin build doesn't include this file, so we - # currently disable this substitution for any non-Linux platform, until a - # Darwin user will care enough about this cross platform fix. - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Pin the compiler to the current version in a cross compiler friendly way. - # Same pattern as for openmpi (see https://github.com/NixOS/nixpkgs/pull/58964#discussion_r275059427). - substituteInPlace "''${!outputDev}"/share/pmix/pmixcc-wrapper-data.txt \ - --replace-fail compiler=${stdenv.cc.targetPrefix}gcc \ - compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc - ''; + '' + # From some reason the Darwin build doesn't include this file, so we + # currently disable this substitution for any non-Linux platform, until a + # Darwin user will care enough about this cross platform fix. + + lib.optionalString stdenv.hostPlatform.isLinux '' + # Pin the compiler to the current version in a cross compiler friendly way. + # Same pattern as for openmpi (see https://github.com/NixOS/nixpkgs/pull/58964#discussion_r275059427). + substituteInPlace "''${!outputDev}"/share/pmix/pmixcc-wrapper-data.txt \ + --replace-fail compiler=${stdenv.cc.targetPrefix}gcc \ + compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc + ''; postFixup = lib.optionalString (lib.elem "dev" finalAttrs.outputs) '' # The build info (parameters to ./configure) are hardcoded diff --git a/pkgs/by-name/pn/pnfft/package.nix b/pkgs/by-name/pn/pnfft/package.nix index 484ba9eeba21..47fd5ff97054 100644 --- a/pkgs/by-name/pn/pnfft/package.nix +++ b/pkgs/by-name/pn/pnfft/package.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--enable-threads" "--enable-portable-binary" - ] ++ lib.optional (precision != "double") "--enable-${precision}"; + ] + ++ lib.optional (precision != "double") "--enable-${precision}"; buildInputs = [ gsl ] ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; diff --git a/pkgs/by-name/pn/pngout/package.nix b/pkgs/by-name/pn/pngout/package.nix index ca5d174b968b..608b9bc1ae9f 100644 --- a/pkgs/by-name/pn/pngout/package.nix +++ b/pkgs/by-name/pn/pngout/package.nix @@ -59,14 +59,13 @@ stdenv.mkDerivation { # pngout is code-signed on Darwin, so don’t alter the binary to avoid breaking the signature. dontFixup = stdenv.hostPlatform.isDarwin; - installPhase = - '' - mkdir -p $out/bin - cp ${platform.folder}/pngout $out/bin - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/${platform.ld-linux} $out/bin/pngout - ''; + installPhase = '' + mkdir -p $out/bin + cp ${platform.folder}/pngout $out/bin + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + patchelf --set-interpreter ${stdenv.cc.libc}/lib/${platform.ld-linux} $out/bin/pngout + ''; meta = { description = "Tool that aggressively optimizes the sizes of PNG images"; diff --git a/pkgs/by-name/po/pocl/package.nix b/pkgs/by-name/po/pocl/package.nix index f9d70e39c395..1b4f9f1ad51c 100644 --- a/pkgs/by-name/po/pocl/package.nix +++ b/pkgs/by-name/po/pocl/package.nix @@ -56,25 +56,24 @@ stdenv.mkDerivation (finalAttrs: { "static_cast(Dev.getInfo())" ''; - cmakeFlags = - [ - # avoid the runtime linker pulling in a different llvm e.g. from graphics drivers - (lib.cmakeBool "STATIC_LLVM" true) - (lib.cmakeBool "ENABLE_POCL_BUILDING" false) - (lib.cmakeBool "POCL_ICD_ABSOLUTE_PATH" true) - (lib.cmakeBool "ENABLE_ICD" true) - (lib.cmakeBool "ENABLE_REMOTE_CLIENT" true) - (lib.cmakeBool "ENABLE_REMOTE_SERVER" true) - (lib.cmakeFeature "CLANG" "${clangWrapped}/bin/clang") - (lib.cmakeFeature "CLANGXX" "${clangWrapped}/bin/clang++") - ] - # Only x86_64 supports "distro" which allows runtime detection of SSE/AVX - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - (lib.cmakeFeature "KERNELLIB_HOST_CPU_VARIANTS" "distro") - ] - ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ - (lib.cmakeFeature "LLC_HOST_CPU" "generic") - ]; + cmakeFlags = [ + # avoid the runtime linker pulling in a different llvm e.g. from graphics drivers + (lib.cmakeBool "STATIC_LLVM" true) + (lib.cmakeBool "ENABLE_POCL_BUILDING" false) + (lib.cmakeBool "POCL_ICD_ABSOLUTE_PATH" true) + (lib.cmakeBool "ENABLE_ICD" true) + (lib.cmakeBool "ENABLE_REMOTE_CLIENT" true) + (lib.cmakeBool "ENABLE_REMOTE_SERVER" true) + (lib.cmakeFeature "CLANG" "${clangWrapped}/bin/clang") + (lib.cmakeFeature "CLANGXX" "${clangWrapped}/bin/clang++") + ] + # Only x86_64 supports "distro" which allows runtime detection of SSE/AVX + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + (lib.cmakeFeature "KERNELLIB_HOST_CPU_VARIANTS" "distro") + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ + (lib.cmakeFeature "LLC_HOST_CPU" "generic") + ]; nativeBuildInputs = [ cmake @@ -83,20 +82,19 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - hwloc - libxml2 - llvmPackages.llvm - llvmPackages.libclang - opencl-headers - ocl-icd - spirv-tools - spirv-llvm-translator - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - lttng-ust - ]; + buildInputs = [ + hwloc + libxml2 + llvmPackages.llvm + llvmPackages.libclang + opencl-headers + ocl-icd + spirv-tools + spirv-llvm-translator + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + lttng-ust + ]; nativeInstallCheckInputs = [ writableTmpDirAsHomeHook diff --git a/pkgs/by-name/po/poco/package.nix b/pkgs/by-name/po/poco/package.nix index 9970457c249b..660e2dbe4e42 100644 --- a/pkgs/by-name/po/poco/package.nix +++ b/pkgs/by-name/po/poco/package.nix @@ -76,24 +76,23 @@ stdenv.mkDerivation rec { (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'${excludeTestsRegex}'") ]; - patches = - [ - # Remove on next release - (fetchpatch { - name = "disable-included-pcre-if-pcre-is-linked-staticly"; - # this happens when building pkgsStatic.poco - url = "https://patch-diff.githubusercontent.com/raw/pocoproject/poco/pull/4879.patch"; - hash = "sha256-VFWuRuf0GPYFp43WKI8utl+agP+7a5biLg7m64EMnVo="; - }) - # https://github.com/pocoproject/poco/issues/4977 - ./disable-flaky-tests.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./disable-broken-tests-darwin.patch - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - ./disable-broken-tests-linux.patch - ]; + patches = [ + # Remove on next release + (fetchpatch { + name = "disable-included-pcre-if-pcre-is-linked-staticly"; + # this happens when building pkgsStatic.poco + url = "https://patch-diff.githubusercontent.com/raw/pocoproject/poco/pull/4879.patch"; + hash = "sha256-VFWuRuf0GPYFp43WKI8utl+agP+7a5biLg7m64EMnVo="; + }) + # https://github.com/pocoproject/poco/issues/4977 + ./disable-flaky-tests.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./disable-broken-tests-darwin.patch + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + ./disable-broken-tests-linux.patch + ]; doCheck = true; nativeCheckInputs = [ diff --git a/pkgs/by-name/po/podman-desktop/package.nix b/pkgs/by-name/po/podman-desktop/package.nix index c407b2162384..c372014a9642 100644 --- a/pkgs/by-name/po/podman-desktop/package.nix +++ b/pkgs/by-name/po/podman-desktop/package.nix @@ -71,18 +71,17 @@ stdenv.mkDerivation (finalAttrs: { ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; - nativeBuildInputs = - [ - nodejs - pnpm_10.configHook - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - copyDesktopItems - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + nodejs + pnpm_10.configHook + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + copyDesktopItems + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.autoSignDarwinBinariesHook + ]; buildPhase = '' runHook preBuild @@ -104,30 +103,29 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - mv dist/mac*/Podman\ Desktop.app $out/Applications - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - mkdir -p "$out/share/lib/podman-desktop" - cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/podman-desktop" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + mv dist/mac*/Podman\ Desktop.app $out/Applications + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + mkdir -p "$out/share/lib/podman-desktop" + cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/podman-desktop" - install -Dm644 buildResources/icon.svg "$out/share/icons/hicolor/scalable/apps/podman-desktop.svg" + install -Dm644 buildResources/icon.svg "$out/share/icons/hicolor/scalable/apps/podman-desktop.svg" - makeWrapper '${electron}/bin/electron' "$out/bin/podman-desktop" \ - --add-flags "$out/share/lib/podman-desktop/resources/app.asar" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --inherit-argv0 - '' - + '' + makeWrapper '${electron}/bin/electron' "$out/bin/podman-desktop" \ + --add-flags "$out/share/lib/podman-desktop/resources/app.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --inherit-argv0 + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; # see: https://github.com/containers/podman-desktop/blob/main/.flatpak.desktop desktopItems = [ diff --git a/pkgs/by-name/po/podman-tui/package.nix b/pkgs/by-name/po/podman-tui/package.nix index 5597149b9c86..f1bc004dba45 100644 --- a/pkgs/by-name/po/podman-tui/package.nix +++ b/pkgs/by-name/po/podman-tui/package.nix @@ -24,7 +24,8 @@ buildGoModule (finalAttrs: { tags = [ "containers_image_openpgp" "remote" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "darwin"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "darwin"; ldflags = [ "-s" diff --git a/pkgs/by-name/po/podman/package.nix b/pkgs/by-name/po/podman/package.nix index 810b6e6895e7..164c38ddd01d 100644 --- a/pkgs/by-name/po/podman/package.nix +++ b/pkgs/by-name/po/podman/package.nix @@ -57,19 +57,18 @@ let name = "podman-helper-binary-wrapper"; # this only works for some binaries, others may need to be added to `binPath` or in the modules - paths = - [ - gvproxy - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - aardvark-dns - catatonit # added here for the pause image and also set in `containersConf` for `init_path` - netavark - passt - conmon - crun - ] - ++ extraRuntimes; + paths = [ + gvproxy + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + aardvark-dns + catatonit # added here for the pause image and also set in `containersConf` for `init_path` + netavark + passt + conmon + crun + ] + ++ extraRuntimes; }; in buildGoModule rec { @@ -165,21 +164,20 @@ buildGoModule rec { patchelf --set-rpath "${lib.makeLibraryPath [ systemd ]}":$RPATH $out/bin/.podman-wrapped ''; - passthru.tests = - { - version = testers.testVersion { - package = podman; - command = "HOME=$TMPDIR podman --version"; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit (nixosTests) podman; - # related modules - inherit (nixosTests) - podman-tls-ghostunnel - ; - oci-containers-podman = nixosTests.oci-containers.podman; + passthru.tests = { + version = testers.testVersion { + package = podman; + command = "HOME=$TMPDIR podman --version"; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit (nixosTests) podman; + # related modules + inherit (nixosTests) + podman-tls-ghostunnel + ; + oci-containers-podman = nixosTests.oci-containers.podman; + }; meta = { homepage = "https://podman.io/"; diff --git a/pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix b/pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix index a3eb42a24dc9..19fd5c1647de 100644 --- a/pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix +++ b/pkgs/by-name/po/poetry/plugins/poetry-plugin-shell.nix @@ -36,15 +36,14 @@ buildPythonPackage rec { shellingham ]; - nativeCheckInputs = - [ - pytest-mock - pytest-xdist - pytestCheckHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.ps - ]; + nativeCheckInputs = [ + pytest-mock + pytest-xdist + pytestCheckHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.ps + ]; meta = { changelog = "https://github.com/python-poetry/poetry-plugin-shell/blob/${src.tag}/CHANGELOG.md"; diff --git a/pkgs/by-name/po/poetry/unwrapped.nix b/pkgs/by-name/po/poetry/unwrapped.nix index 7dd662686313..f2f0f1a70e48 100644 --- a/pkgs/by-name/po/poetry/unwrapped.nix +++ b/pkgs/by-name/po/poetry/unwrapped.nix @@ -63,41 +63,40 @@ buildPythonPackage rec { "virtualenv" ]; - dependencies = - [ - build - cachecontrol - cleo - dulwich - fastjsonschema - findpython - installer - keyring - packaging - pbs-installer - pkginfo - platformdirs - poetry-core - pyproject-hooks - requests - requests-toolbelt - shellingham - tomlkit - trove-classifiers - virtualenv - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - xattr - ] - ++ lib.optionals (pythonOlder "3.11") [ - tomli - ] - ++ lib.optionals (pythonOlder "3.10") [ - importlib-metadata - ] - ++ cachecontrol.optional-dependencies.filecache - ++ pbs-installer.optional-dependencies.download - ++ pbs-installer.optional-dependencies.install; + dependencies = [ + build + cachecontrol + cleo + dulwich + fastjsonschema + findpython + installer + keyring + packaging + pbs-installer + pkginfo + platformdirs + poetry-core + pyproject-hooks + requests + requests-toolbelt + shellingham + tomlkit + trove-classifiers + virtualenv + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + xattr + ] + ++ lib.optionals (pythonOlder "3.11") [ + tomli + ] + ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ] + ++ cachecontrol.optional-dependencies.filecache + ++ pbs-installer.optional-dependencies.download + ++ pbs-installer.optional-dependencies.install; postInstall = '' installShellCompletion --cmd poetry \ @@ -128,30 +127,29 @@ buildPythonPackage rec { unset no_proxy ''; - disabledTests = - [ - "test_builder_should_execute_build_scripts" - "test_env_system_packages_are_relative_to_lib" - "test_install_warning_corrupt_root" - "test_no_additional_output_in_verbose_mode" - "test_project_plugins_are_installed_in_project_folder" - "test_application_command_not_found_messages" - # PermissionError: [Errno 13] Permission denied: '/build/pytest-of-nixbld/pytest-0/popen-gw3/test_find_poetry_managed_pytho1/.local/share/pypoetry/python/pypy@3.10.8/bin/python' - "test_list_poetry_managed" - "test_list_poetry_managed" - "test_find_all_with_poetry_managed" - "test_find_poetry_managed_pythons" - # Flaky - "test_threading_property_types" - "test_threading_single_thread_safe" - "test_threading_property_caching" - "test_threading_atomic_cached_property_different_instances" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Sandbox violation: - # PermissionError: [Errno 1] Operation not permitted: '/Library/Frameworks/Python.framework/Versions' - "test_find_all" - ]; + disabledTests = [ + "test_builder_should_execute_build_scripts" + "test_env_system_packages_are_relative_to_lib" + "test_install_warning_corrupt_root" + "test_no_additional_output_in_verbose_mode" + "test_project_plugins_are_installed_in_project_folder" + "test_application_command_not_found_messages" + # PermissionError: [Errno 13] Permission denied: '/build/pytest-of-nixbld/pytest-0/popen-gw3/test_find_poetry_managed_pytho1/.local/share/pypoetry/python/pypy@3.10.8/bin/python' + "test_list_poetry_managed" + "test_list_poetry_managed" + "test_find_all_with_poetry_managed" + "test_find_poetry_managed_pythons" + # Flaky + "test_threading_property_types" + "test_threading_single_thread_safe" + "test_threading_property_caching" + "test_threading_atomic_cached_property_different_instances" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Sandbox violation: + # PermissionError: [Errno 1] Operation not permitted: '/Library/Frameworks/Python.framework/Versions' + "test_find_all" + ]; pytestFlagsArray = [ "-m 'not network'" diff --git a/pkgs/by-name/po/poke/package.nix b/pkgs/by-name/po/poke/package.nix index 18b8fa83446b..8846cb39c12d 100644 --- a/pkgs/by-name/po/poke/package.nix +++ b/pkgs/by-name/po/poke/package.nix @@ -29,16 +29,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-qEy5F11Q1FpBHySB/QZiuDyzLOUXMWuInPtXCBlXk3M="; }; - outputs = - [ - "out" - "dev" - "info" - "lib" - ] - # help2man can't cross compile because it runs `poke --help` to - # generate the man page - ++ lib.optional (!isCross) "man"; + outputs = [ + "out" + "dev" + "info" + "lib" + ] + # help2man can't cross compile because it runs `poke --help` to + # generate the man page + ++ lib.optional (!isCross) "man"; postPatch = '' patchShebangs . @@ -46,23 +45,21 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - pkg-config - texinfo - ] - ++ lib.optionals (!isCross) [ - help2man - ]; + nativeBuildInputs = [ + pkg-config + texinfo + ] + ++ lib.optionals (!isCross) [ + help2man + ]; - buildInputs = - [ - boehmgc - readline - ] - ++ lib.optional nbdSupport libnbd - ++ lib.optional textStylingSupport gettext - ++ lib.optional finalAttrs.finalPackage.doCheck dejagnu; + buildInputs = [ + boehmgc + readline + ] + ++ lib.optional nbdSupport libnbd + ++ lib.optional textStylingSupport gettext + ++ lib.optional finalAttrs.finalPackage.doCheck dejagnu; configureFlags = [ # libpoke depends on $datadir/poke, so we specify the datadir in diff --git a/pkgs/by-name/po/polkadot/package.nix b/pkgs/by-name/po/polkadot/package.nix index 85137d3cdbfc..1cfaa72fcc3c 100644 --- a/pkgs/by-name/po/polkadot/package.nix +++ b/pkgs/by-name/po/polkadot/package.nix @@ -60,7 +60,8 @@ rustPlatform.buildRustPackage rec { # NOTE: jemalloc is used by default on Linux with unprefixed enabled buildInputs = [ openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ rust-jemalloc-sys-unprefixed ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ rust-jemalloc-sys-unprefixed ]; checkInputs = [ cacert diff --git a/pkgs/by-name/po/polkit/package.nix b/pkgs/by-name/po/polkit/package.nix index e3e79ff92b41..4fd41a15d018 100644 --- a/pkgs/by-name/po/polkit/package.nix +++ b/pkgs/by-name/po/polkit/package.nix @@ -74,39 +74,37 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - glib - pkg-config - gettext - meson - ninja - perl + nativeBuildInputs = [ + glib + pkg-config + gettext + meson + ninja + perl - # man pages - libxslt - docbook-xsl-nons - docbook_xml_dtd_412 - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - gtk-doc - ] - ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + # man pages + libxslt + docbook-xsl-nons + docbook_xml_dtd_412 + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + gtk-doc + ] + ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - expat - pam - dbus - duktape - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # On Linux, fall back to elogind when systemd support is off. - (if useSystemd then systemdMinimal else elogind) - ]; + buildInputs = [ + expat + pam + dbus + duktape + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # On Linux, fall back to elogind when systemd support is off. + (if useSystemd then systemdMinimal else elogind) + ]; propagatedBuildInputs = [ glib # in .pc Requires @@ -142,21 +140,20 @@ stdenv.mkDerivation rec { PKG_CONFIG_SYSTEMD_TMPFILES_DIR = "/usr/lib/tmpfiles.d"; }; - mesonFlags = - [ - "--datadir=${system}/share" - "--sysconfdir=/etc" - "-Dpolkitd_user=polkituser" # TODO? config.ids.uids.polkituser - "-Dos_type=redhat" # affects PAM includes and privileged group name (wheel) - "-Dintrospection=${lib.boolToString withIntrospection}" - "-Dtests=${lib.boolToString doCheck}" - "-Dgtk_doc=${lib.boolToString withIntrospection}" - "-Dman=true" - "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-Dsession_tracking=${if useSystemd then "logind" else "elogind"}" - ]; + mesonFlags = [ + "--datadir=${system}/share" + "--sysconfdir=/etc" + "-Dpolkitd_user=polkituser" # TODO? config.ids.uids.polkituser + "-Dos_type=redhat" # affects PAM includes and privileged group name (wheel) + "-Dintrospection=${lib.boolToString withIntrospection}" + "-Dtests=${lib.boolToString doCheck}" + "-Dgtk_doc=${lib.boolToString withIntrospection}" + "-Dman=true" + "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-Dsession_tracking=${if useSystemd then "logind" else "elogind"}" + ]; inherit doCheck; diff --git a/pkgs/by-name/po/polybar/package.nix b/pkgs/by-name/po/polybar/package.nix index 8e90ffa43897..1b70a27916b6 100644 --- a/pkgs/by-name/po/polybar/package.nix +++ b/pkgs/by-name/po/polybar/package.nix @@ -58,35 +58,35 @@ stdenv.mkDerivation (finalAttrs: { pkg-config python3Packages.sphinx removeReferencesTo - ] ++ lib.optional i3Support makeWrapper; + ] + ++ lib.optional i3Support makeWrapper; - buildInputs = - [ - cairo - libuv - libXdmcp - libpthreadstubs - libxcb - pcre - python3 - xcbproto - xcbutil - xcbutilcursor - xcbutilimage - xcbutilrenderutil - xcbutilwm - xcbutilxrm - ] - ++ lib.optional alsaSupport alsa-lib - ++ lib.optional githubSupport curl - ++ lib.optional mpdSupport libmpdclient - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional iwSupport wirelesstools - ++ lib.optional nlSupport libnl - ++ lib.optionals i3Support [ - jsoncpp - i3 - ]; + buildInputs = [ + cairo + libuv + libXdmcp + libpthreadstubs + libxcb + pcre + python3 + xcbproto + xcbutil + xcbutilcursor + xcbutilimage + xcbutilrenderutil + xcbutilwm + xcbutilxrm + ] + ++ lib.optional alsaSupport alsa-lib + ++ lib.optional githubSupport curl + ++ lib.optional mpdSupport libmpdclient + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional iwSupport wirelesstools + ++ lib.optional nlSupport libnl + ++ lib.optionals i3Support [ + jsoncpp + i3 + ]; patches = [ ./remove-hardcoded-etc.diff ]; @@ -96,14 +96,13 @@ stdenv.mkDerivation (finalAttrs: { substituteAllInPlace src/utils/file.cpp ''; - postInstall = - '' - remove-references-to -t ${stdenv.cc} $out/bin/polybar - '' - + (lib.optionalString i3Support '' - wrapProgram $out/bin/polybar \ - --prefix PATH : "${i3}/bin" - ''); + postInstall = '' + remove-references-to -t ${stdenv.cc} $out/bin/polybar + '' + + (lib.optionalString i3Support '' + wrapProgram $out/bin/polybar \ + --prefix PATH : "${i3}/bin" + ''); meta = with lib; { homepage = "https://polybar.github.io/"; diff --git a/pkgs/by-name/po/polymake/package.nix b/pkgs/by-name/po/polymake/package.nix index d60bc12bb1b1..bd92eb900c14 100644 --- a/pkgs/by-name/po/polymake/package.nix +++ b/pkgs/by-name/po/polymake/package.nix @@ -42,27 +42,26 @@ stdenv.mkDerivation rec { perl ]; - buildInputs = - [ - perl - gmp - mpfr - flint - boost - bliss - ppl - singular - cddlib - lrs - nauty - openjdk - ] - ++ (with perlPackages; [ - JSON - TermReadLineGnu - TermReadKey - XMLSAX - ]); + buildInputs = [ + perl + gmp + mpfr + flint + boost + bliss + ppl + singular + cddlib + lrs + nauty + openjdk + ] + ++ (with perlPackages; [ + JSON + TermReadLineGnu + TermReadKey + XMLSAX + ]); ninjaFlags = [ "-C" diff --git a/pkgs/by-name/po/ponyc/package.nix b/pkgs/by-name/po/ponyc/package.nix index 1a3d176c9642..9df6c6acac35 100644 --- a/pkgs/by-name/po/ponyc/package.nix +++ b/pkgs/by-name/po/ponyc/package.nix @@ -50,37 +50,35 @@ stdenv.mkDerivation (rec { hash = "sha256-1OJ2SeSscRBNr7zZ/a8bJGIqAnhkg45re0j3DtPfcXM="; }; - nativeBuildInputs = - [ - cmake - makeWrapper - which - python3 - git - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Keep in sync with `PONY_OSX_PLATFORM`. - apple-sdk_13 - (darwinMinVersionHook "13.0") - cctools.libtool - ]; + nativeBuildInputs = [ + cmake + makeWrapper + which + python3 + git + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Keep in sync with `PONY_OSX_PLATFORM`. + apple-sdk_13 + (darwinMinVersionHook "13.0") + cctools.libtool + ]; buildInputs = [ libxml2 z3 ]; - patches = - [ - # Sandbox disallows network access, so disabling problematic networking tests - ./disable-networking-tests.patch - ./disable-process-tests.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (replaceVars ./fix-darwin-build.patch { - apple-sdk = apple-sdk_13; - }) - ]; + patches = [ + # Sandbox disallows network access, so disabling problematic networking tests + ./disable-networking-tests.patch + ./disable-process-tests.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (replaceVars ./fix-darwin-build.patch { + apple-sdk = apple-sdk_13; + }) + ]; postUnpack = '' mkdir -p $NIX_BUILD_TOP/deps @@ -104,24 +102,24 @@ stdenv.mkDerivation (rec { --replace-fail "https://github.com/google/googletest/archive/refs/tags/v$googletestRev.tar.gz" "$NIX_BUILD_TOP/deps/googletest-$googletestRev.tar" ''; - preBuild = - '' - extraFlags=(build_flags=-j$NIX_BUILD_CORES) - '' - + lib.optionalString stdenv.hostPlatform.isAarch64 '' - # See this relnote about building on Raspbian: - # https://github.com/ponylang/ponyc/blob/0.46.0/.release-notes/0.45.2.md - extraFlags+=(pic_flag=-fPIC) - '' - + '' - make libs "''${extraFlags[@]}" - make configure "''${extraFlags[@]}" - ''; + preBuild = '' + extraFlags=(build_flags=-j$NIX_BUILD_CORES) + '' + + lib.optionalString stdenv.hostPlatform.isAarch64 '' + # See this relnote about building on Raspbian: + # https://github.com/ponylang/ponyc/blob/0.46.0/.release-notes/0.45.2.md + extraFlags+=(pic_flag=-fPIC) + '' + + '' + make libs "''${extraFlags[@]}" + make configure "''${extraFlags[@]}" + ''; makeFlags = [ "PONYC_VERSION=${version}" "prefix=${placeholder "out"}" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin ([ "bits=64" ] ++ lib.optional (!lto) "lto=no"); + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin ([ "bits=64" ] ++ lib.optional (!lto) "lto=no"); env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=redundant-move" @@ -132,29 +130,28 @@ stdenv.mkDerivation (rec { nativeCheckInputs = [ procps ]; - installPhase = - '' - makeArgs=(config=release prefix=$out) - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - makeArgs+=(bits=64) - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && !lto) '' - makeArgs+=(lto=no) - '' - + '' - make "''${makeArgs[@]}" install - wrapProgram $out/bin/ponyc \ - --prefix PATH ":" "${stdenv.cc}/bin" \ - --set-default CC "$CC" \ - --prefix PONYPATH : "${ - lib.makeLibraryPath [ - pcre2 - openssl - (placeholder "out") - ] - }" - ''; + installPhase = '' + makeArgs=(config=release prefix=$out) + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + makeArgs+=(bits=64) + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && !lto) '' + makeArgs+=(lto=no) + '' + + '' + make "''${makeArgs[@]}" install + wrapProgram $out/bin/ponyc \ + --prefix PATH ":" "${stdenv.cc}/bin" \ + --set-default CC "$CC" \ + --prefix PONYPATH : "${ + lib.makeLibraryPath [ + pcre2 + openssl + (placeholder "out") + ] + }" + ''; # Stripping breaks linking for ponyc dontStrip = true; diff --git a/pkgs/by-name/po/portablemc/package.nix b/pkgs/by-name/po/portablemc/package.nix index 326d7949cdf7..d99a3ea4d318 100644 --- a/pkgs/by-name/po/portablemc/package.nix +++ b/pkgs/by-name/po/portablemc/package.nix @@ -23,28 +23,27 @@ let # Copied from the `prismlauncher` package - runtimeLibs = - [ - # lwjgl - libGL - glfw - openal - (lib.getLib stdenv.cc.cc) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXext - libXcursor - libXrandr - libXxf86vm + runtimeLibs = [ + # lwjgl + libGL + glfw + openal + (lib.getLib stdenv.cc.cc) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXext + libXcursor + libXrandr + libXxf86vm - # lwjgl - libpulseaudio + # lwjgl + libpulseaudio - # oshi - udev - ] - ++ lib.optional textToSpeechSupport flite; + # oshi + udev + ] + ++ lib.optional textToSpeechSupport flite; in python3Packages.buildPythonApplication rec { pname = "portablemc"; diff --git a/pkgs/by-name/po/portaudio/package.nix b/pkgs/by-name/po/portaudio/package.nix index 00098602e013..f2134742f8b2 100644 --- a/pkgs/by-name/po/portaudio/package.nix +++ b/pkgs/by-name/po/portaudio/package.nix @@ -22,12 +22,11 @@ stdenv.mkDerivation rec { pkg-config which ]; - buildInputs = - [ - libjack2 - ] - # Enabling alsa causes linux-only sources to be built - ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; + buildInputs = [ + libjack2 + ] + # Enabling alsa causes linux-only sources to be built + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; configureFlags = [ "--disable-mac-universal" @@ -49,17 +48,16 @@ stdenv.mkDerivation rec { ''; # not sure why, but all the headers seem to be installed by the make install - installPhase = - '' - make install - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # fixup .pc file to find alsa library - sed -i "s|-lasound|-L${alsa-lib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - cp include/pa_mac_core.h $out/include/pa_mac_core.h - ''; + installPhase = '' + make install + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # fixup .pc file to find alsa library + sed -i "s|-lasound|-L${alsa-lib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + cp include/pa_mac_core.h $out/include/pa_mac_core.h + ''; meta = with lib; { description = "Portable cross-platform Audio API"; diff --git a/pkgs/by-name/po/positron-bin/package.nix b/pkgs/by-name/po/positron-bin/package.nix index 42fa5e7100e9..4808a9a7ec43 100644 --- a/pkgs/by-name/po/positron-bin/package.nix +++ b/pkgs/by-name/po/positron-bin/package.nix @@ -44,27 +44,28 @@ stdenv.mkDerivation { hash = "sha256-f27LC4+SXnkyePw/fw8r9JYsOQKVoIiFkAet/QtwbNg="; }; - buildInputs = - [ makeShellWrapper ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - gtk3 - libglvnd - libxkbcommon - libgbm - musl - nss - stdenv.cc.cc - openssl - xorg.libX11 - xorg.libXcomposite - xorg.libXdamage - xorg.libxkbfile - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - blas - patchelf - ]; + buildInputs = [ + makeShellWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + gtk3 + libglvnd + libxkbcommon + libgbm + musl + nss + stdenv.cc.cc + openssl + xorg.libX11 + xorg.libXcomposite + xorg.libXdamage + xorg.libxkbfile + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + blas + patchelf + ]; nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ @@ -141,6 +142,7 @@ stdenv.mkDerivation { platforms = [ "x86_64-linux" "aarch64-linux" - ] ++ platforms.darwin; + ] + ++ platforms.darwin; }; } diff --git a/pkgs/by-name/po/postfix/package.nix b/pkgs/by-name/po/postfix/package.nix index 4560cf41dfd4..1bba06a5ba1b 100644 --- a/pkgs/by-name/po/postfix/package.nix +++ b/pkgs/by-name/po/postfix/package.nix @@ -82,20 +82,19 @@ stdenv.mkDerivation rec { makeWrapper m4 ]; - buildInputs = - [ - db - openssl - cyrus_sasl - icu - libnsl - pcre2 - ] - ++ lib.optional withPgSQL libpq - ++ lib.optional withMySQL libmysqlclient - ++ lib.optional withSQLite sqlite - ++ lib.optional withLDAP openldap - ++ lib.optional withTLSRPT libtlsrpt; + buildInputs = [ + db + openssl + cyrus_sasl + icu + libnsl + pcre2 + ] + ++ lib.optional withPgSQL libpq + ++ lib.optional withMySQL libmysqlclient + ++ lib.optional withSQLite sqlite + ++ lib.optional withLDAP openldap + ++ lib.optional withTLSRPT libtlsrpt; hardeningDisable = [ "format" ]; hardeningEnable = [ "pie" ]; diff --git a/pkgs/by-name/po/power-profiles-daemon/package.nix b/pkgs/by-name/po/power-profiles-daemon/package.nix index 8759b2d76b14..5c3a83877db6 100644 --- a/pkgs/by-name/po/power-profiles-daemon/package.nix +++ b/pkgs/by-name/po/power-profiles-daemon/package.nix @@ -44,33 +44,32 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-iQUhA46BEln8pyIBxM/MY7An8BzfiFjxZdR/tUIj4S4="; }; - nativeBuildInputs = - [ - pkg-config - meson - ninja - gettext - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_412 - libxml2 # for xmllint for stripping GResources - libxslt # for xsltproc for building docs - gobject-introspection - wrapGAppsNoGuiHook - # checkInput but checked for during the configuring - (python3.pythonOnBuildForHost.withPackages ( - ps: with ps; [ - pygobject3 - dbus-python - python-dbusmock - argparse-manpage - shtab - ] - )) - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + pkg-config + meson + ninja + gettext + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_412 + libxml2 # for xmllint for stripping GResources + libxslt # for xsltproc for building docs + gobject-introspection + wrapGAppsNoGuiHook + # checkInput but checked for during the configuring + (python3.pythonOnBuildForHost.withPackages ( + ps: with ps; [ + pygobject3 + dbus-python + python-dbusmock + argparse-manpage + shtab + ] + )) + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ bash-completion diff --git a/pkgs/by-name/po/powerdns-admin/package.nix b/pkgs/by-name/po/powerdns-admin/package.nix index 31f7c15777f4..7e18e8cdba14 100644 --- a/pkgs/by-name/po/powerdns-admin/package.nix +++ b/pkgs/by-name/po/powerdns-admin/package.nix @@ -83,7 +83,8 @@ let nativeBuildInputs = [ yarnConfigHook - ] ++ pythonDeps; + ] + ++ pythonDeps; patches = all_patches ++ [ ./0002-Remove-cssrewrite-filter.patch ]; diff --git a/pkgs/by-name/po/powershell/package.nix b/pkgs/by-name/po/powershell/package.nix index 61f77a25b01b..5b332833c594 100644 --- a/pkgs/by-name/po/powershell/package.nix +++ b/pkgs/by-name/po/powershell/package.nix @@ -48,49 +48,46 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - less - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + less + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ]; - buildInputs = - [ - curl - icu - libuuid - libunwind - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - lttng-ust - pam - ]; + buildInputs = [ + curl + icu + libuuid + libunwind + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + lttng-ust + pam + ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/{bin,share/powershell} - cp -R * $out/share/powershell - chmod +x $out/share/powershell/pwsh - makeWrapper $out/share/powershell/pwsh $out/bin/pwsh \ - --prefix ${platformLdLibraryPath} : "${lib.makeLibraryPath buildInputs}" \ - --set TERM xterm \ - --set POWERSHELL_TELEMETRY_OPTOUT 1 \ - --set DOTNET_CLI_TELEMETRY_OPTOUT 1 + mkdir -p $out/{bin,share/powershell} + cp -R * $out/share/powershell + chmod +x $out/share/powershell/pwsh + makeWrapper $out/share/powershell/pwsh $out/bin/pwsh \ + --prefix ${platformLdLibraryPath} : "${lib.makeLibraryPath buildInputs}" \ + --set TERM xterm \ + --set POWERSHELL_TELEMETRY_OPTOUT 1 \ + --set DOTNET_CLI_TELEMETRY_OPTOUT 1 - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - patchelf --replace-needed liblttng-ust${ext}.0 liblttng-ust${ext}.1 $out/share/powershell/libcoreclrtraceptprovider.so + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + patchelf --replace-needed liblttng-ust${ext}.0 liblttng-ust${ext}.1 $out/share/powershell/libcoreclrtraceptprovider.so - '' - + '' - runHook postInstall - ''; + '' + + '' + runHook postInstall + ''; dontStrip = true; diff --git a/pkgs/by-name/pp/ppl/package.nix b/pkgs/by-name/pp/ppl/package.nix index b36ae47ecbf1..d02dd8dd787a 100644 --- a/pkgs/by-name/pp/ppl/package.nix +++ b/pkgs/by-name/pp/ppl/package.nix @@ -42,14 +42,15 @@ stdenv.mkDerivation { ]; propagatedBuildInputs = [ gmpxx ]; - configureFlags = - [ "--disable-watchdog" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "CPPFLAGS=-fexceptions" - "--disable-ppl_lcdd" - "--disable-ppl_lpsol" - "--disable-ppl_pips" - ]; + configureFlags = [ + "--disable-watchdog" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "CPPFLAGS=-fexceptions" + "--disable-ppl_lcdd" + "--disable-ppl_lpsol" + "--disable-ppl_pips" + ]; # Beware! It took ~6 hours to compile PPL and run its tests on a 1.2 GHz # x86_64 box. Nevertheless, being a dependency of GCC, it probably ought diff --git a/pkgs/by-name/pp/ppp/package.nix b/pkgs/by-name/pp/ppp/package.nix index 4a1f18db9982..280fa0522e89 100644 --- a/pkgs/by-name/pp/ppp/package.nix +++ b/pkgs/by-name/pp/ppp/package.nix @@ -37,17 +37,16 @@ stdenv.mkDerivation rec { autoreconfHook ]; - buildInputs = - [ - bash - libpcap - libxcrypt - linux-pam - openssl - ] - ++ lib.optionals withSystemd [ - systemdMinimal - ]; + buildInputs = [ + bash + libpcap + libxcrypt + linux-pam + openssl + ] + ++ lib.optionals withSystemd [ + systemdMinimal + ]; postPatch = '' for file in $(find -name Makefile.linux); do diff --git a/pkgs/by-name/pp/ppsspp/package.nix b/pkgs/by-name/pp/ppsspp/package.nix index 4cd0346e5a4d..05b466d824de 100644 --- a/pkgs/by-name/pp/ppsspp/package.nix +++ b/pkgs/by-name/pp/ppsspp/package.nix @@ -65,31 +65,31 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper pkg-config python3 - ] ++ lib.optionals enableQt [ wrapQtAppsHook ]; + ] + ++ lib.optionals enableQt [ wrapQtAppsHook ]; - buildInputs = - [ - SDL2 - libX11 - glew - libzip - zlib - ] - ++ lib.optionals useSystemFfmpeg [ - ffmpeg_6 - ] - ++ lib.optionals useSystemSnappy [ - snappy - ] - ++ lib.optionals enableQt [ - qtbase - qtmultimedia - ] - ++ lib.optionals enableVulkan [ vulkan-loader ] - ++ lib.optionals vulkanWayland [ - wayland - libffi - ]; + buildInputs = [ + SDL2 + libX11 + glew + libzip + zlib + ] + ++ lib.optionals useSystemFfmpeg [ + ffmpeg_6 + ] + ++ lib.optionals useSystemSnappy [ + snappy + ] + ++ lib.optionals enableQt [ + qtbase + qtmultimedia + ] + ++ lib.optionals enableVulkan [ vulkan-loader ] + ++ lib.optionals vulkanWayland [ + wayland + libffi + ]; dontWrapQtApps = true; diff --git a/pkgs/by-name/pr/pre-commit/package.nix b/pkgs/by-name/pr/pre-commit/package.nix index e520d860173a..6b096cb9ffd7 100644 --- a/pkgs/by-name/pr/pre-commit/package.nix +++ b/pkgs/by-name/pr/pre-commit/package.nix @@ -55,37 +55,36 @@ python3Packages.buildPythonApplication rec { virtualenv ]; - nativeCheckInputs = - [ - cabal-install - cargo - gitMinimal - go - perl - versionCheckHook - writableTmpDirAsHomeHook - ] - ++ (with python3Packages; [ - pytest-env - pytest-forked - pytest-xdist - pytestCheckHook - re-assert - ]) - ++ lib.optionals (!i686Linux) [ - # coursier can be moved back to the main nativeCheckInputs list once we’re able to bootstrap a - # JRE on i686-linux: . When coursier gets - # moved back to the main nativeCheckInputs list, don’t forget to re-enable the - # coursier-related test that is currently disabled on i686-linux. - coursier - # i686-linux: dotnet-sdk not available - dotnet-sdk - # nodejs can be moved back to the main nativeCheckInputs list once this - # issue is fixed: . When nodejs gets - # moved back to the main nativeCheckInputs list, don’t forget to re-enable the - # Node.js-related tests that are currently disabled on i686-linux. - nodejs - ]; + nativeCheckInputs = [ + cabal-install + cargo + gitMinimal + go + perl + versionCheckHook + writableTmpDirAsHomeHook + ] + ++ (with python3Packages; [ + pytest-env + pytest-forked + pytest-xdist + pytestCheckHook + re-assert + ]) + ++ lib.optionals (!i686Linux) [ + # coursier can be moved back to the main nativeCheckInputs list once we’re able to bootstrap a + # JRE on i686-linux: . When coursier gets + # moved back to the main nativeCheckInputs list, don’t forget to re-enable the + # coursier-related test that is currently disabled on i686-linux. + coursier + # i686-linux: dotnet-sdk not available + dotnet-sdk + # nodejs can be moved back to the main nativeCheckInputs list once this + # issue is fixed: . When nodejs gets + # moved back to the main nativeCheckInputs list, don’t forget to re-enable the + # Node.js-related tests that are currently disabled on i686-linux. + nodejs + ]; versionCheckProgramArg = "--version"; postPatch = '' @@ -128,83 +127,82 @@ python3Packages.buildPythonApplication rec { deactivate ''; - disabledTests = - [ - # ERROR: The install method you used for conda--probably either `pip install conda` - # or `easy_install conda`--is not compatible with using conda as an application. - "test_conda_" - "test_local_conda_" + disabledTests = [ + # ERROR: The install method you used for conda--probably either `pip install conda` + # or `easy_install conda`--is not compatible with using conda as an application. + "test_conda_" + "test_local_conda_" - # /build/pytest-of-nixbld/pytest-0/test_install_ruby_with_version0/rbenv-2.7.2/libexec/rbenv-init: - # /usr/bin/env: bad interpreter: No such file or directory - "test_ruby_" + # /build/pytest-of-nixbld/pytest-0/test_install_ruby_with_version0/rbenv-2.7.2/libexec/rbenv-init: + # /usr/bin/env: bad interpreter: No such file or directory + "test_ruby_" - # network - "test_additional_dependencies_roll_forward" - "test_additional_golang_dependencies_installed" - "test_additional_node_dependencies_installed" - "test_additional_rust_cli_dependencies_installed" - "test_additional_rust_lib_dependencies_installed" - "test_automatic_toolchain_switching" - "test_coursier_hook" - "test_coursier_hook_additional_dependencies" - "test_dart" - "test_dart_additional_deps" - "test_dart_additional_deps_versioned" - "test_during_commit_all" - "test_golang_default_version" - "test_golang_hook" - "test_golang_hook_still_works_when_gobin_is_set" - "test_golang_infer_go_version_default" - "test_golang_system" - "test_golang_versioned" - "test_language_version_with_rustup" - "test_installs_rust_missing_rustup" - "test_installs_without_links_outside_env" - "test_julia_hook" - "test_julia_repo_local" - "test_local_golang_additional_deps" - "test_lua" - "test_lua_additional_dependencies" - "test_node_additional_deps" - "test_node_hook_versions" - "test_perl_additional_dependencies" - "test_r_hook" - "test_r_inline" - "test_r_inline_hook" - "test_r_local_with_additional_dependencies_hook" - "test_r_with_additional_dependencies_hook" - "test_run_a_node_hook_default_version" - "test_run_lib_additional_dependencies" - "test_run_versioned_node_hook" - "test_rust_cli_additional_dependencies" - "test_swift_language" - "test_run_example_executable" - "test_run_dep" + # network + "test_additional_dependencies_roll_forward" + "test_additional_golang_dependencies_installed" + "test_additional_node_dependencies_installed" + "test_additional_rust_cli_dependencies_installed" + "test_additional_rust_lib_dependencies_installed" + "test_automatic_toolchain_switching" + "test_coursier_hook" + "test_coursier_hook_additional_dependencies" + "test_dart" + "test_dart_additional_deps" + "test_dart_additional_deps_versioned" + "test_during_commit_all" + "test_golang_default_version" + "test_golang_hook" + "test_golang_hook_still_works_when_gobin_is_set" + "test_golang_infer_go_version_default" + "test_golang_system" + "test_golang_versioned" + "test_language_version_with_rustup" + "test_installs_rust_missing_rustup" + "test_installs_without_links_outside_env" + "test_julia_hook" + "test_julia_repo_local" + "test_local_golang_additional_deps" + "test_lua" + "test_lua_additional_dependencies" + "test_node_additional_deps" + "test_node_hook_versions" + "test_perl_additional_dependencies" + "test_r_hook" + "test_r_inline" + "test_r_inline_hook" + "test_r_local_with_additional_dependencies_hook" + "test_r_with_additional_dependencies_hook" + "test_run_a_node_hook_default_version" + "test_run_lib_additional_dependencies" + "test_run_versioned_node_hook" + "test_rust_cli_additional_dependencies" + "test_swift_language" + "test_run_example_executable" + "test_run_dep" - # i don't know why these fail - "test_install_existing_hooks_no_overwrite" - "test_installed_from_venv" - "test_uninstall_restores_legacy_hooks" - "test_dotnet_" - "test_health_check_" + # i don't know why these fail + "test_install_existing_hooks_no_overwrite" + "test_installed_from_venv" + "test_uninstall_restores_legacy_hooks" + "test_dotnet_" + "test_health_check_" - # Expects `git commit` to fail when `pre-commit` is not in the `$PATH`, - # but we use an absolute path so it's not an issue. - "test_environment_not_sourced" + # Expects `git commit` to fail when `pre-commit` is not in the `$PATH`, + # but we use an absolute path so it's not an issue. + "test_environment_not_sourced" - # Docker required - "test_docker_" - ] - ++ lib.optionals i686Linux [ - # From coursier_test.py: - "test_error_if_no_deps_or_channel" - # From node_test.py: - "test_healthy_system_node" - "test_unhealthy_if_system_node_goes_missing" - "test_node_hook_system" - "test_node_with_user_config_set" - ]; + # Docker required + "test_docker_" + ] + ++ lib.optionals i686Linux [ + # From coursier_test.py: + "test_error_if_no_deps_or_channel" + # From node_test.py: + "test_healthy_system_node" + "test_unhealthy_if_system_node_goes_missing" + "test_node_hook_system" + "test_node_with_user_config_set" + ]; pythonImportsCheck = [ "pre_commit" diff --git a/pkgs/by-name/pr/previewqt/package.nix b/pkgs/by-name/pr/previewqt/package.nix index 7e9daf5eb2a3..48d517c67a7d 100644 --- a/pkgs/by-name/pr/previewqt/package.nix +++ b/pkgs/by-name/pr/previewqt/package.nix @@ -34,25 +34,24 @@ stdenv.mkDerivation (finalAttrs: { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - exiv2 - imagemagick - libarchive - libdevil - libraw - mpv - resvg - vips - ] - ++ [ - qt6Packages.poppler - qt6Packages.qtmultimedia - qt6Packages.qtquick3d - qt6Packages.qtsvg - qt6Packages.qttools - qt6Packages.qtwebengine - ]; + buildInputs = [ + exiv2 + imagemagick + libarchive + libdevil + libraw + mpv + resvg + vips + ] + ++ [ + qt6Packages.poppler + qt6Packages.qtmultimedia + qt6Packages.qtquick3d + qt6Packages.qtsvg + qt6Packages.qttools + qt6Packages.qtwebengine + ]; strictDeps = true; diff --git a/pkgs/by-name/pr/prism-model-checker/package.nix b/pkgs/by-name/pr/prism-model-checker/package.nix index 80575f375bb2..e369bad40f48 100644 --- a/pkgs/by-name/pr/prism-model-checker/package.nix +++ b/pkgs/by-name/pr/prism-model-checker/package.nix @@ -35,7 +35,8 @@ stdenv'.mkDerivation (finalAttrs: { openjdk copyDesktopItems makeWrapper - ] ++ lib.optionals stdenv'.hostPlatform.isDarwin [ cctools ]; + ] + ++ lib.optionals stdenv'.hostPlatform.isDarwin [ cctools ]; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix b/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix index d05ab5abcb56..c08ca124feae 100644 --- a/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix +++ b/pkgs/by-name/pr/prismlauncher-unwrapped/package.nix @@ -71,28 +71,28 @@ stdenv.mkDerivation (finalAttrs: { kdePackages.quazip tomlplusplus zlib - ] ++ lib.optional gamemodeSupport gamemode; + ] + ++ lib.optional gamemodeSupport gamemode; hardeningEnable = lib.optionals stdenv.hostPlatform.isLinux [ "pie" ]; - cmakeFlags = - [ - # downstream branding - (lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs") - ] - ++ lib.optionals (msaClientID != null) [ - (lib.cmakeFeature "Launcher_MSA_CLIENT_ID" (toString msaClientID)) - ] - ++ lib.optionals (lib.versionOlder kdePackages.qtbase.version "6") [ - (lib.cmakeFeature "Launcher_QT_VERSION_MAJOR" "5") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # we wrap our binary manually - (lib.cmakeFeature "INSTALL_BUNDLE" "nodeps") - # disable built-in updater - (lib.cmakeFeature "MACOSX_SPARKLE_UPDATE_FEED_URL" "''") - (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/Applications/") - ]; + cmakeFlags = [ + # downstream branding + (lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs") + ] + ++ lib.optionals (msaClientID != null) [ + (lib.cmakeFeature "Launcher_MSA_CLIENT_ID" (toString msaClientID)) + ] + ++ lib.optionals (lib.versionOlder kdePackages.qtbase.version "6") [ + (lib.cmakeFeature "Launcher_QT_VERSION_MAJOR" "5") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # we wrap our binary manually + (lib.cmakeFeature "INSTALL_BUNDLE" "nodeps") + # disable built-in updater + (lib.cmakeFeature "MACOSX_SPARKLE_UPDATE_FEED_URL" "''") + (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/Applications/") + ]; doCheck = true; diff --git a/pkgs/by-name/pr/prismlauncher/package.nix b/pkgs/by-name/pr/prismlauncher/package.nix index 03c1f0421530..01edd0d9a2bb 100644 --- a/pkgs/by-name/pr/prismlauncher/package.nix +++ b/pkgs/by-name/pr/prismlauncher/package.nix @@ -61,14 +61,13 @@ symlinkJoin { nativeBuildInputs = [ kdePackages.wrapQtAppsHook ]; - buildInputs = - [ - kdePackages.qtbase - kdePackages.qtsvg - ] - ++ lib.optional ( - lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.hostPlatform.isLinux - ) kdePackages.qtwayland; + buildInputs = [ + kdePackages.qtbase + kdePackages.qtsvg + ] + ++ lib.optional ( + lib.versionAtLeast kdePackages.qtbase.version "6" && stdenv.hostPlatform.isLinux + ) kdePackages.qtwayland; postBuild = '' wrapQtAppsHook @@ -76,41 +75,41 @@ symlinkJoin { qtWrapperArgs = let - runtimeLibs = - [ - (lib.getLib stdenv.cc.cc) - ## native versions - glfw3-minecraft - openal + runtimeLibs = [ + (lib.getLib stdenv.cc.cc) + ## native versions + glfw3-minecraft + openal - ## openal - alsa-lib - libjack2 - libpulseaudio - pipewire + ## openal + alsa-lib + libjack2 + libpulseaudio + pipewire - ## glfw - libGL - libX11 - libXcursor - libXext - libXrandr - libXxf86vm + ## glfw + libGL + libX11 + libXcursor + libXext + libXrandr + libXxf86vm - udev # oshi + udev # oshi - vulkan-loader # VulkanMod's lwjgl - ] - ++ lib.optional textToSpeechSupport flite - ++ lib.optional gamemodeSupport gamemode.lib - ++ lib.optional controllerSupport libusb1 - ++ additionalLibs; + vulkan-loader # VulkanMod's lwjgl + ] + ++ lib.optional textToSpeechSupport flite + ++ lib.optional gamemodeSupport gamemode.lib + ++ lib.optional controllerSupport libusb1 + ++ additionalLibs; runtimePrograms = [ mesa-demos pciutils # need lspci xrandr # needed for LWJGL [2.9.2, 3) https://github.com/LWJGL/lwjgl/issues/128 - ] ++ additionalPrograms; + ] + ++ additionalPrograms; in [ "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" ] diff --git a/pkgs/by-name/pr/pritunl-client/package.nix b/pkgs/by-name/pr/pritunl-client/package.nix index 7f414355f9f8..62ef1d7c6624 100644 --- a/pkgs/by-name/pr/pritunl-client/package.nix +++ b/pkgs/by-name/pr/pritunl-client/package.nix @@ -51,43 +51,40 @@ let nativeBuildInputs = [ makeWrapper ]; - postPatch = - '' - sed -Ei service/connection/scripts.go \ - -e 's|#!\s*(/usr)?/bin/(env )?bash\b|#! ${runtimeShell}|g' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - sed -Ei service/connection/scripts.go \ - -e 's|(/usr)?/s?bin/busctl\b|busctl|g' \ - -e 's|(/usr)?/s?bin/resolvectl\b|resolvectl|g' \ - -e 's|(/usr)?/s?bin/ip\b|ip|g' - ''; + postPatch = '' + sed -Ei service/connection/scripts.go \ + -e 's|#!\s*(/usr)?/bin/(env )?bash\b|#! ${runtimeShell}|g' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + sed -Ei service/connection/scripts.go \ + -e 's|(/usr)?/s?bin/busctl\b|busctl|g' \ + -e 's|(/usr)?/s?bin/resolvectl\b|resolvectl|g' \ + -e 's|(/usr)?/s?bin/ip\b|ip|g' + ''; - postInstall = - '' - mv $out/bin/service $out/bin/pritunl-client-service - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/lib/systemd/system/ - cp $src/resources_linux/pritunl-client.service $out/lib/systemd/system/ - substituteInPlace $out/lib/systemd/system/pritunl-client.service \ - --replace-warn "/usr" "$out" - ''; + postInstall = '' + mv $out/bin/service $out/bin/pritunl-client-service + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/lib/systemd/system/ + cp $src/resources_linux/pritunl-client.service $out/lib/systemd/system/ + substituteInPlace $out/lib/systemd/system/pritunl-client.service \ + --replace-warn "/usr" "$out" + ''; postFixup = let - hookScriptsDeps = - [ - coreutils - which - gnused - gnugrep - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - openresolv - systemd - iproute2 - ]; + hookScriptsDeps = [ + coreutils + which + gnused + gnugrep + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + openresolv + systemd + iproute2 + ]; openvpn-wrapped = runCommand "openvpn-wrapped" { @@ -99,15 +96,14 @@ let --prefix PATH : ${lib.makeBinPath hookScriptsDeps} \ --add-flags "--setenv PATH \$PATH" ''; - pritunlDeps = - [ - openvpn-wrapped - ] - ++ lib.optionals withWireguard [ - openresolv - coreutils - wireguard-tools - ]; + pritunlDeps = [ + openvpn-wrapped + ] + ++ lib.optionals withWireguard [ + openresolv + coreutils + wireguard-tools + ]; in lib.optionalString stdenv.hostPlatform.isLinux '' wrapProgram $out/bin/pritunl-client-service \ @@ -128,42 +124,41 @@ stdenv.mkDerivation { installShellFiles ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin/ - ln -s ${cli}/bin/pritunl-client $out/bin/ - ln -s ${service}/bin/pritunl-client-service $out/bin/ + mkdir -p $out/bin/ + ln -s ${cli}/bin/pritunl-client $out/bin/ + ln -s ${service}/bin/pritunl-client-service $out/bin/ - mkdir -p $out/lib/ - cp -r client $out/lib/pritunl_client_electron + mkdir -p $out/lib/ + cp -r client $out/lib/pritunl_client_electron - makeWrapper ${electron}/bin/electron $out/bin/pritunl-client-electron \ - --add-flags $out/lib/pritunl_client_electron + makeWrapper ${electron}/bin/electron $out/bin/pritunl-client-electron \ + --add-flags $out/lib/pritunl_client_electron - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/lib/systemd/system/ - ln -s ${service}/lib/systemd/system/pritunl-client.service $out/lib/systemd/system/ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/lib/systemd/system/ + ln -s ${service}/lib/systemd/system/pritunl-client.service $out/lib/systemd/system/ - mkdir -p $out/share/icons/ - cp -r resources_linux/icons $out/share/icons/hicolor + mkdir -p $out/share/icons/ + cp -r resources_linux/icons $out/share/icons/hicolor - mkdir -p $out/share/applications/ - cp resources_linux/pritunl-client-electron.desktop $out/share/applications/ - substituteInPlace $out/share/applications/pritunl-client-electron.desktop \ - --replace-fail "/usr/lib/pritunl_client_electron/Pritunl" "$out/bin/pritunl-client-electron" - '' - + '' - # install shell completions for pritunl-client - installShellCompletion --cmd pritunl-client \ - --bash <($out/bin/pritunl-client completion bash) \ - --fish <($out/bin/pritunl-client completion fish) \ - --zsh <($out/bin/pritunl-client completion zsh) + mkdir -p $out/share/applications/ + cp resources_linux/pritunl-client-electron.desktop $out/share/applications/ + substituteInPlace $out/share/applications/pritunl-client-electron.desktop \ + --replace-fail "/usr/lib/pritunl_client_electron/Pritunl" "$out/bin/pritunl-client-electron" + '' + + '' + # install shell completions for pritunl-client + installShellCompletion --cmd pritunl-client \ + --bash <($out/bin/pritunl-client completion bash) \ + --fish <($out/bin/pritunl-client completion fish) \ + --zsh <($out/bin/pritunl-client completion zsh) - runHook postInstall - ''; + runHook postInstall + ''; passthru.updateScript = nix-update-script { }; meta = with lib; { diff --git a/pkgs/by-name/pr/procmail/package.nix b/pkgs/by-name/pr/procmail/package.nix index 47f77406421d..86423a3ff491 100644 --- a/pkgs/by-name/pr/procmail/package.nix +++ b/pkgs/by-name/pr/procmail/package.nix @@ -30,25 +30,24 @@ stdenv.mkDerivation rec { # getline is defined differently in glibc now. So rename it. # Without the .PHONY target "make install" won't install anything on Darwin. - postPatch = - '' - sed -i Makefile \ - -e "s%^RM.*$%#%" \ - -e "s%^BASENAME.*%\BASENAME=$out%" \ - -e "s%^LIBS=.*%LIBS=-lm%" - sed -e "s%getline%thisgetline%g" -i src/*.c src/*.h - sed -e "3i\ - .PHONY: install - " -i Makefile - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace src/Makefile.0 \ - --replace-fail '@./_autotst' '@${stdenv.hostPlatform.emulator buildPackages} ./_autotst' - sed -e '3i\ - _autotst() { ${stdenv.hostPlatform.emulator buildPackages} ./_autotst "$@"; } \ - _locktst() { ${stdenv.hostPlatform.emulator buildPackages} ./_locktst "$@"; } \ - ' -i src/autoconf - ''; + postPatch = '' + sed -i Makefile \ + -e "s%^RM.*$%#%" \ + -e "s%^BASENAME.*%\BASENAME=$out%" \ + -e "s%^LIBS=.*%LIBS=-lm%" + sed -e "s%getline%thisgetline%g" -i src/*.c src/*.h + sed -e "3i\ + .PHONY: install + " -i Makefile + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace src/Makefile.0 \ + --replace-fail '@./_autotst' '@${stdenv.hostPlatform.emulator buildPackages} ./_autotst' + sed -e '3i\ + _autotst() { ${stdenv.hostPlatform.emulator buildPackages} ./_autotst "$@"; } \ + _locktst() { ${stdenv.hostPlatform.emulator buildPackages} ./_locktst "$@"; } \ + ' -i src/autoconf + ''; # default target is binaries + manpages; manpages don't cross compile without more work. makeFlags = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ "bins" ]; diff --git a/pkgs/by-name/pr/procs/package.nix b/pkgs/by-name/pr/procs/package.nix index eef9369ee4f7..c15f35a468e9 100644 --- a/pkgs/by-name/pr/procs/package.nix +++ b/pkgs/by-name/pr/procs/package.nix @@ -24,7 +24,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ]; postInstall = '' for shell in bash fish zsh; do diff --git a/pkgs/by-name/pr/professor/package.nix b/pkgs/by-name/pr/professor/package.nix index b207152bddc4..97cfa9044212 100644 --- a/pkgs/by-name/pr/professor/package.nix +++ b/pkgs/by-name/pr/professor/package.nix @@ -22,15 +22,14 @@ stdenv.mkDerivation { ''; }; - postPatch = - '' - substituteInPlace Makefile \ - --replace-fail 'pip install ' 'pip install --prefix $(out) ' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Makefile \ - --replace-fail '-shared -o' '-shared -install_name "$(out)/$@" -o' - ''; + postPatch = '' + substituteInPlace Makefile \ + --replace-fail 'pip install ' 'pip install --prefix $(out) ' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Makefile \ + --replace-fail '-shared -o' '-shared -install_name "$(out)/$@" -o' + ''; nativeBuildInputs = [ python3.pkgs.cython diff --git a/pkgs/by-name/pr/prometheus-borgmatic-exporter/package.nix b/pkgs/by-name/pr/prometheus-borgmatic-exporter/package.nix index b8972bd47b12..fc4b384009dc 100644 --- a/pkgs/by-name/pr/prometheus-borgmatic-exporter/package.nix +++ b/pkgs/by-name/pr/prometheus-borgmatic-exporter/package.nix @@ -21,18 +21,19 @@ python3Packages.buildPythonApplication rec { build-system = with python3Packages; [ poetry-core ]; - propagatedBuildInputs = - [ borgmatic ] - ++ (with python3Packages; [ - arrow - click - flask - loguru - pretty-errors - prometheus-client - timy - waitress - ]); + propagatedBuildInputs = [ + borgmatic + ] + ++ (with python3Packages; [ + arrow + click + flask + loguru + pretty-errors + prometheus-client + timy + waitress + ]); nativeCheckInputs = with python3Packages; [ pytestCheckHook diff --git a/pkgs/by-name/pr/proot/package.nix b/pkgs/by-name/pr/proot/package.nix index b3fb0a36629d..5d0ab0d04402 100644 --- a/pkgs/by-name/pr/proot/package.nix +++ b/pkgs/by-name/pr/proot/package.nix @@ -33,11 +33,13 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses talloc - ] ++ lib.optional enablePython python3; + ] + ++ lib.optional enablePython python3; nativeBuildInputs = [ pkg-config docutils - ] ++ lib.optional enablePython swig; + ] + ++ lib.optional enablePython swig; enableParallelBuilding = true; diff --git a/pkgs/by-name/pr/properties-cpp/package.nix b/pkgs/by-name/pr/properties-cpp/package.nix index 389987a9f776..d5182ee63985 100644 --- a/pkgs/by-name/pr/properties-cpp/package.nix +++ b/pkgs/by-name/pr/properties-cpp/package.nix @@ -23,16 +23,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-C/BDEuKNMQHOjATO5aWBptjIlgfv6ykzjFAsHb6uP3Q="; }; - postPatch = - '' - # GTest needs C++17 - # Remove when https://gitlab.com/ubports/development/core/lib-cpp/properties-cpp/-/merge_requests/3 merged & in release - substituteInPlace CMakeLists.txt \ - --replace-fail 'std=c++14' 'std=c++17' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - sed -i "/add_subdirectory(tests)/d" CMakeLists.txt - ''; + postPatch = '' + # GTest needs C++17 + # Remove when https://gitlab.com/ubports/development/core/lib-cpp/properties-cpp/-/merge_requests/3 merged & in release + substituteInPlace CMakeLists.txt \ + --replace-fail 'std=c++14' 'std=c++17' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + sed -i "/add_subdirectory(tests)/d" CMakeLists.txt + ''; strictDeps = true; diff --git a/pkgs/by-name/pr/prowlarr/package.nix b/pkgs/by-name/pr/prowlarr/package.nix index 0266ae7db6fa..5afe8e16fbfe 100644 --- a/pkgs/by-name/pr/prowlarr/package.nix +++ b/pkgs/by-name/pr/prowlarr/package.nix @@ -128,19 +128,18 @@ buildDotnetModule { ]; # Skip manual, integration, automation and platform-dependent tests. - testFilters = - [ - "TestCategory!=ManualTest" - "TestCategory!=IntegrationTest" - "TestCategory!=AutomationTest" + testFilters = [ + "TestCategory!=ManualTest" + "TestCategory!=IntegrationTest" + "TestCategory!=AutomationTest" - # makes real HTTP requests - "FullyQualifiedName!~NzbDrone.Core.Test.UpdateTests.UpdatePackageProviderFixture" - ] - ++ lib.optionals stdenvNoCC.buildPlatform.isDarwin [ - # fails on macOS - "FullyQualifiedName!~NzbDrone.Core.Test.Http.HttpProxySettingsProviderFixture" - ]; + # makes real HTTP requests + "FullyQualifiedName!~NzbDrone.Core.Test.UpdateTests.UpdatePackageProviderFixture" + ] + ++ lib.optionals stdenvNoCC.buildPlatform.isDarwin [ + # fails on macOS + "FullyQualifiedName!~NzbDrone.Core.Test.Http.HttpProxySettingsProviderFixture" + ]; disabledTests = [ # setgid tests diff --git a/pkgs/by-name/pr/proxsuite-nlp/package.nix b/pkgs/by-name/pr/proxsuite-nlp/package.nix index 02b473ce1b90..8ec4d08628f0 100644 --- a/pkgs/by-name/pr/proxsuite-nlp/package.nix +++ b/pkgs/by-name/pr/proxsuite-nlp/package.nix @@ -37,21 +37,21 @@ stdenv.mkDerivation (finalAttrs: { doxygen graphviz pkg-config - ] ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook; + ] + ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook; checkInputs = [ eigenrand ] ++ lib.optional pythonSupport python3Packages.pytest; - propagatedBuildInputs = - [ - example-robot-data - fmt - ] - ++ lib.optionals pythonSupport [ - python3Packages.pinocchio - python3Packages.proxsuite - ] - ++ lib.optionals (!pythonSupport) [ - pinocchio - proxsuite - ]; + propagatedBuildInputs = [ + example-robot-data + fmt + ] + ++ lib.optionals pythonSupport [ + python3Packages.pinocchio + python3Packages.proxsuite + ] + ++ lib.optionals (!pythonSupport) [ + pinocchio + proxsuite + ]; cmakeFlags = [ (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) diff --git a/pkgs/by-name/pr/proxsuite/package.nix b/pkgs/by-name/pr/proxsuite/package.nix index f2a0b7446427..31b95407709a 100644 --- a/pkgs/by-name/pr/proxsuite/package.nix +++ b/pkgs/by-name/pr/proxsuite/package.nix @@ -49,32 +49,33 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - doxygen - graphviz - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + cmake + doxygen + graphviz + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pythonImportsCheckHook + ]; propagatedBuildInputs = [ cereal_1_3_2 eigen jrl-cmakemodules simde - ] ++ lib.optionals pythonSupport [ python3Packages.nanobind ]; + ] + ++ lib.optionals pythonSupport [ python3Packages.nanobind ]; nativeCheckInputs = [ ctestCheckHook ]; - checkInputs = - [ matio ] - ++ lib.optionals pythonSupport [ - python3Packages.numpy - python3Packages.scipy - ]; + checkInputs = [ + matio + ] + ++ lib.optionals pythonSupport [ + python3Packages.numpy + python3Packages.scipy + ]; ctestFlags = lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ "--exclude-regex" diff --git a/pkgs/by-name/ps/psc-package/package.nix b/pkgs/by-name/ps/psc-package/package.nix index 0b69b4db9bd0..d40b058aed59 100644 --- a/pkgs/by-name/ps/psc-package/package.nix +++ b/pkgs/by-name/ps/psc-package/package.nix @@ -40,31 +40,30 @@ stdenv.mkDerivation rec { dontStrip = true; - installPhase = - '' - mkdir -p $out/bin + installPhase = '' + mkdir -p $out/bin - PSC_PACKAGE=$out/bin/psc-package + PSC_PACKAGE=$out/bin/psc-package - install -D -m555 -T psc-package $PSC_PACKAGE - chmod u+w $PSC_PACKAGE - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool \ - -change /usr/lib/libiconv.2.dylib ${libiconv}/libiconv.2.dylib \ - $PSC_PACKAGE - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PSC_PACKAGE - '' - + '' - chmod u-w $PSC_PACKAGE + install -D -m555 -T psc-package $PSC_PACKAGE + chmod u+w $PSC_PACKAGE + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool \ + -change /usr/lib/libiconv.2.dylib ${libiconv}/libiconv.2.dylib \ + $PSC_PACKAGE + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PSC_PACKAGE + '' + + '' + chmod u-w $PSC_PACKAGE - installShellCompletion --cmd psc-package \ - --bash <($PSC_PACKAGE --bash-completion-script $PSC_PACKAGE) \ - --fish <($PSC_PACKAGE --fish-completion-script $PSC_PACKAGE) \ - --zsh <($PSC_PACKAGE --zsh-completion-script $PSC_PACKAGE) - ''; + installShellCompletion --cmd psc-package \ + --bash <($PSC_PACKAGE --bash-completion-script $PSC_PACKAGE) \ + --fish <($PSC_PACKAGE --fish-completion-script $PSC_PACKAGE) \ + --zsh <($PSC_PACKAGE --zsh-completion-script $PSC_PACKAGE) + ''; meta = with lib; { description = "Package manager for PureScript based on package sets"; diff --git a/pkgs/by-name/ps/psqlodbc/package.nix b/pkgs/by-name/ps/psqlodbc/package.nix index 9f86aabed1d4..40830628f11f 100644 --- a/pkgs/by-name/ps/psqlodbc/package.nix +++ b/pkgs/by-name/ps/psqlodbc/package.nix @@ -25,13 +25,12 @@ stdenv.mkDerivation rec { hash = "sha256-zCjoX+Ew8sS5TWkFSgoqUN5ukEF38kq+MdfgCQQGv9w="; }; - buildInputs = - [ - libpq - openssl - ] - ++ lib.optional withLibiodbc libiodbc - ++ lib.optional withUnixODBC unixODBC; + buildInputs = [ + libpq + openssl + ] + ++ lib.optional withLibiodbc libiodbc + ++ lib.optional withUnixODBC unixODBC; nativeBuildInputs = [ autoreconfHook @@ -39,22 +38,20 @@ stdenv.mkDerivation rec { strictDeps = true; - passthru = - { - updateScript = nix-update-script { }; - } - // lib.optionalAttrs withUnixODBC { - fancyName = "PostgreSQL"; - driver = "lib/psqlodbcw.so"; - }; + passthru = { + updateScript = nix-update-script { }; + } + // lib.optionalAttrs withUnixODBC { + fancyName = "PostgreSQL"; + driver = "lib/psqlodbcw.so"; + }; - configureFlags = - [ - "CPPFLAGS=-DSQLCOLATTRIBUTE_SQLLEN" # needed for cross - "--with-libpq=${lib.getDev libpq}" - ] - ++ lib.optional withLibiodbc "--with-iodbc=${libiodbc}" - ++ lib.optional withUnixODBC "--with-unixodbc=${unixODBC}"; + configureFlags = [ + "CPPFLAGS=-DSQLCOLATTRIBUTE_SQLLEN" # needed for cross + "--with-libpq=${lib.getDev libpq}" + ] + ++ lib.optional withLibiodbc "--with-iodbc=${libiodbc}" + ++ lib.optional withUnixODBC "--with-unixodbc=${unixODBC}"; meta = with lib; { homepage = "https://odbc.postgresql.org/"; diff --git a/pkgs/by-name/ps/psst/package.nix b/pkgs/by-name/ps/psst/package.nix index af702e84d0a5..a1e3cf3ef9b9 100644 --- a/pkgs/by-name/ps/psst/package.nix +++ b/pkgs/by-name/ps/psst/package.nix @@ -54,19 +54,18 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - atk - cairo - gdk-pixbuf - glib - gtk3 - pango - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - dbus - ]; + buildInputs = [ + atk + cairo + gdk-pixbuf + glib + gtk3 + pango + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + dbus + ]; patches = [ # Use a fixed build time, hard-code upstream URL instead of trying to read `.git` diff --git a/pkgs/by-name/ps/pstoedit/package.nix b/pkgs/by-name/ps/pstoedit/package.nix index 6b93fb4ec998..0f269ec8f099 100644 --- a/pkgs/by-name/ps/pstoedit/package.nix +++ b/pkgs/by-name/ps/pstoedit/package.nix @@ -36,19 +36,18 @@ stdenv.mkDerivation rec { makeWrapper pkg-config ]; - buildInputs = - [ - zlib - ghostscript - imagemagick - plotutils - gd - libjpeg - libwebp - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + zlib + ghostscript + imagemagick + plotutils + gd + libjpeg + libwebp + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; postInstall = '' wrapProgram $out/bin/pstoedit \ diff --git a/pkgs/by-name/pt/ptcollab/package.nix b/pkgs/by-name/pt/ptcollab/package.nix index 372da09be9db..474faa94c122 100644 --- a/pkgs/by-name/pt/ptcollab/package.nix +++ b/pkgs/by-name/pt/ptcollab/package.nix @@ -20,25 +20,23 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-1fVhimwBAYtC+HnuxA7ywfEnVlqHnlzwfKT9+H/ZG0k="; }; - nativeBuildInputs = - [ - pkg-config - ] - ++ (with libsForQt5; [ - qmake - qttools - wrapQtAppsHook - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with libsForQt5; [ + qmake + qttools + wrapQtAppsHook + ]); - buildInputs = - [ - libvorbis - rtmidi - ] - ++ (with libsForQt5; [ - qtbase - qtmultimedia - ]); + buildInputs = [ + libvorbis + rtmidi + ] + ++ (with libsForQt5; [ + qtbase + qtmultimedia + ]); postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' # Move appbundles to Applications before wrapping happens diff --git a/pkgs/by-name/pu/pueue/package.nix b/pkgs/by-name/pu/pueue/package.nix index 6b3d4f05bda1..02bcd3354679 100644 --- a/pkgs/by-name/pu/pueue/package.nix +++ b/pkgs/by-name/pu/pueue/package.nix @@ -21,13 +21,12 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-E2mLpRCffFySzBZVtxS4YZPuTRhjU4LrFEfC1dbF6ug="; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - rustPlatform.bindgenHook - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + rustPlatform.bindgenHook + ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv diff --git a/pkgs/by-name/pu/pulsar/package.nix b/pkgs/by-name/pu/pulsar/package.nix index 3b5f7645d154..15b7390560f3 100644 --- a/pkgs/by-name/pu/pulsar/package.nix +++ b/pkgs/by-name/pu/pulsar/package.nix @@ -117,103 +117,101 @@ stdenv.mkDerivation { runHook postInstall ''; - preFixup = - '' - gappsWrapperArgs+=( - # needed for gio executable to be able to delete files - --prefix "PATH" : "${lib.makeBinPath [ glib ]}" - ) - '' - + lib.optionalString useHunspell '' - # On all platforms, we must inject our dictionnaries - ${hunspellCopyCommands} - ''; + preFixup = '' + gappsWrapperArgs+=( + # needed for gio executable to be able to delete files + --prefix "PATH" : "${lib.makeBinPath [ glib ]}" + ) + '' + + lib.optionalString useHunspell '' + # On all platforms, we must inject our dictionnaries + ${hunspellCopyCommands} + ''; - postFixup = - '' - opt=$out/opt/Pulsar - # Patch the prebuilt binaries - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${newLibpath}:$opt" \ - --add-needed libffmpeg.so \ - --add-needed libxshmfence.so.1 \ - --add-needed libxkbcommon.so.0 \ - --add-needed libxkbfile.so.1 \ - --add-needed libsecret-1.so.0 \ - $opt/pulsar - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${newLibpath}" \ - $opt/resources/app/ppm/bin/node - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - $opt/resources/app.asar.unpacked/node_modules/symbol-provider-ctags/vendor/ctags-linux + postFixup = '' + opt=$out/opt/Pulsar + # Patch the prebuilt binaries + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${newLibpath}:$opt" \ + --add-needed libffmpeg.so \ + --add-needed libxshmfence.so.1 \ + --add-needed libxkbcommon.so.0 \ + --add-needed libxkbfile.so.1 \ + --add-needed libsecret-1.so.0 \ + $opt/pulsar + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${newLibpath}" \ + $opt/resources/app/ppm/bin/node + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + $opt/resources/app.asar.unpacked/node_modules/symbol-provider-ctags/vendor/ctags-linux - # Replace the bundled git with the one from nixpkgs - dugite=$opt/resources/app.asar.unpacked/node_modules/dugite - rm -f $dugite/git/bin/git - ln -s ${git}/bin/git $dugite/git/bin/git + # Replace the bundled git with the one from nixpkgs + dugite=$opt/resources/app.asar.unpacked/node_modules/dugite + rm -f $dugite/git/bin/git + ln -s ${git}/bin/git $dugite/git/bin/git - # Not only do we need to replace the git binary itself, we also need to replace - # all the symlinks in dugite/git/libexec/git-core. - for file in "$dugite/git/libexec/git-core"/*; do - if [ -x "$file" ] && file "$file" | grep -q "ELF"; then - # Remove ELF executable - rm "$file" + # Not only do we need to replace the git binary itself, we also need to replace + # all the symlinks in dugite/git/libexec/git-core. + for file in "$dugite/git/libexec/git-core"/*; do + if [ -x "$file" ] && file "$file" | grep -q "ELF"; then + # Remove ELF executable + rm "$file" - # Get the corresponding filename in nixpkgs's git - filename=$(basename "$file") - git_executable="${git}/libexec/git-core/$filename" + # Get the corresponding filename in nixpkgs's git + filename=$(basename "$file") + git_executable="${git}/libexec/git-core/$filename" - # Create symlink to $git_executable - ln -s "$git_executable" "$file" + # Create symlink to $git_executable + ln -s "$git_executable" "$file" - echo "Replaced $file with symlink to $git_executable" - fi - done + echo "Replaced $file with symlink to $git_executable" + fi + done - # Was symlinked in previous loop, but actually, nixpkgs has a separate package for git-lfs - # Unlink to avoid a "File exists" error and relink correctly - unlink $dugite/git/libexec/git-core/git-lfs - ln -s ${git-lfs}/bin/git-lfs $dugite/git/libexec/git-core/git-lfs - '' - + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") '' - # We have to patch a prebuilt binary in the asar archive - # But asar complains because the node_gyp unpacked dependency uses a prebuilt Python3 itself + # Was symlinked in previous loop, but actually, nixpkgs has a separate package for git-lfs + # Unlink to avoid a "File exists" error and relink correctly + unlink $dugite/git/libexec/git-core/git-lfs + ln -s ${git-lfs}/bin/git-lfs $dugite/git/libexec/git-core/git-lfs + '' + + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") '' + # We have to patch a prebuilt binary in the asar archive + # But asar complains because the node_gyp unpacked dependency uses a prebuilt Python3 itself - rm $opt/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins/python3 - ln -s ${python3.interpreter} $opt/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins/python3 - '' - + '' - # Patch the bundled node executables - find $opt -name "*.node" -exec patchelf --set-rpath "${newLibpath}:$opt" {} \; - # Also patch the node executable for apm - patchelf --set-rpath "${newLibpath}:$opt" $opt/resources/app/ppm/bin/node + rm $opt/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins/python3 + ln -s ${python3.interpreter} $opt/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins/python3 + '' + + '' + # Patch the bundled node executables + find $opt -name "*.node" -exec patchelf --set-rpath "${newLibpath}:$opt" {} \; + # Also patch the node executable for apm + patchelf --set-rpath "${newLibpath}:$opt" $opt/resources/app/ppm/bin/node - # The pre-packaged ASAR bundle comes with prebuild binaries, expecting libstdc++.so.6 - asarBundle=$TMPDIR/asarbundle - asar e $opt/resources/app.asar $asarBundle - find $asarBundle -name "*.node" -exec patchelf --set-rpath "${newLibpath}:$opt" --add-needed libstdc++.so.6 {} \; - unlink $asarBundle/node_modules/document-register-element/dre # Self referencing symlink, breaking asar rebundling - asar p $asarBundle $opt/resources/app.asar - rm -rf $asarBundle + # The pre-packaged ASAR bundle comes with prebuild binaries, expecting libstdc++.so.6 + asarBundle=$TMPDIR/asarbundle + asar e $opt/resources/app.asar $asarBundle + find $asarBundle -name "*.node" -exec patchelf --set-rpath "${newLibpath}:$opt" --add-needed libstdc++.so.6 {} \; + unlink $asarBundle/node_modules/document-register-element/dre # Self referencing symlink, breaking asar rebundling + asar p $asarBundle $opt/resources/app.asar + rm -rf $asarBundle - # Pulsar uses `PULSAR_PATH` to know where it is intalled - mkdir -p $out/bin - wrapProgram $opt/resources/pulsar.sh \ - --suffix "PATH" : "${lib.makeBinPath [ coreutils ]}" \ - --set "PULSAR_PATH" "$opt" - ln -s $opt/resources/pulsar.sh $out/bin/pulsar - ln -s $opt/resources/app/ppm/bin/apm $out/bin/ppm + # Pulsar uses `PULSAR_PATH` to know where it is intalled + mkdir -p $out/bin + wrapProgram $opt/resources/pulsar.sh \ + --suffix "PATH" : "${lib.makeBinPath [ coreutils ]}" \ + --set "PULSAR_PATH" "$opt" + ln -s $opt/resources/pulsar.sh $out/bin/pulsar + ln -s $opt/resources/app/ppm/bin/apm $out/bin/ppm - # Copy the icons - mkdir -p $out/share/icons/hicolor/scalable/apps $out/share/icons/hicolor/1024x1024/apps - cp $opt/resources/pulsar.svg $out/share/icons/hicolor/scalable/apps/pulsar.svg - cp $opt/resources/pulsar.png $out/share/icons/hicolor/1024x1024/apps/pulsar.png - '' - + lib.optionalString withNemoAction '' - # Copy the nemo action file - mkdir -p $out/share/nemo/actions - cp ${./pulsar.nemo_action} $out/share/nemo/actions/pulsar.nemo_action - ''; + # Copy the icons + mkdir -p $out/share/icons/hicolor/scalable/apps $out/share/icons/hicolor/1024x1024/apps + cp $opt/resources/pulsar.svg $out/share/icons/hicolor/scalable/apps/pulsar.svg + cp $opt/resources/pulsar.png $out/share/icons/hicolor/1024x1024/apps/pulsar.png + '' + + lib.optionalString withNemoAction '' + # Copy the nemo action file + mkdir -p $out/share/nemo/actions + cp ${./pulsar.nemo_action} $out/share/nemo/actions/pulsar.nemo_action + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/pu/pulseaudio-dlna/zeroconf.nix b/pkgs/by-name/pu/pulseaudio-dlna/zeroconf.nix index 576efba1e250..3b1224546e36 100644 --- a/pkgs/by-name/pu/pulseaudio-dlna/zeroconf.nix +++ b/pkgs/by-name/pu/pulseaudio-dlna/zeroconf.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { six enum-compat ifaddr - ] ++ lib.optionals (pythonOlder "3.5") [ typing ]; + ] + ++ lib.optionals (pythonOlder "3.5") [ typing ]; meta = with lib; { description = "Pure python implementation of multicast DNS service discovery"; diff --git a/pkgs/by-name/pu/pulumi/extra/mk-pulumi-package.nix b/pkgs/by-name/pu/pulumi/extra/mk-pulumi-package.nix index 9981bb8d2251..bdbe5f79f81f 100644 --- a/pkgs/by-name/pu/pulumi/extra/mk-pulumi-package.nix +++ b/pkgs/by-name/pu/pulumi/extra/mk-pulumi-package.nix @@ -34,7 +34,8 @@ let ldflags = [ "-s" "-w" - ] ++ extraLdflags; + ] + ++ extraLdflags; } // args ); diff --git a/pkgs/by-name/pw/pwsafe/package.nix b/pkgs/by-name/pw/pwsafe/package.nix index 9ec64dd13e10..7732ba56b841 100644 --- a/pkgs/by-name/pw/pwsafe/package.nix +++ b/pkgs/by-name/pw/pwsafe/package.nix @@ -45,56 +45,53 @@ stdenv.mkDerivation rec { zip ]; - buildInputs = - [ - wxGTK32 - curl - qrencode - openssl - xercesc - file - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libXext - libXi - libXt - libXtst - libuuid - libyubikey - yubikey-personalization - ]; + buildInputs = [ + wxGTK32 + curl + qrencode + openssl + xercesc + file + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libXext + libXi + libXt + libXtst + libuuid + libyubikey + yubikey-personalization + ]; - cmakeFlags = - [ - "-DNO_GTEST=ON" - "-DCMAKE_CXX_FLAGS=-I${yubikey-personalization}/include/ykpers-1" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DNO_YUBI=ON" - ]; + cmakeFlags = [ + "-DNO_GTEST=ON" + "-DCMAKE_CXX_FLAGS=-I${yubikey-personalization}/include/ykpers-1" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DNO_YUBI=ON" + ]; - postPatch = - '' - # Fix perl scripts used during the build. - for f in $(find . -type f -name '*.pl') ; do - patchShebangs $f - done + postPatch = '' + # Fix perl scripts used during the build. + for f in $(find . -type f -name '*.pl') ; do + patchShebangs $f + done - # Fix hard coded paths. - for f in $(grep -Rl /usr/share/ src install/desktop) ; do - substituteInPlace $f --replace /usr/share/ $out/share/ - done + # Fix hard coded paths. + for f in $(grep -Rl /usr/share/ src install/desktop) ; do + substituteInPlace $f --replace /usr/share/ $out/share/ + done - # Fix hard coded zip path. - substituteInPlace help/Makefile.linux --replace /usr/bin/zip ${zip}/bin/zip + # Fix hard coded zip path. + substituteInPlace help/Makefile.linux --replace /usr/bin/zip ${zip}/bin/zip - for f in $(grep -Rl /usr/bin/ .) ; do - substituteInPlace $f --replace /usr/bin/ "" - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/ui/cli/CMakeLists.txt --replace "uuid" "" - ''; + for f in $(grep -Rl /usr/bin/ .) ; do + substituteInPlace $f --replace /usr/bin/ "" + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/ui/cli/CMakeLists.txt --replace "uuid" "" + ''; installFlags = [ "PREFIX=${placeholder "out"}" ]; diff --git a/pkgs/by-name/py/pylyzer/package.nix b/pkgs/by-name/py/pylyzer/package.nix index cc2380e97850..8c7001a0f23a 100644 --- a/pkgs/by-name/py/pylyzer/package.nix +++ b/pkgs/by-name/py/pylyzer/package.nix @@ -31,7 +31,8 @@ rustPlatform.buildRustPackage rec { python3 makeWrapper writableTmpDirAsHomeHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ (writeScriptBin "diskutil" "") ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ (writeScriptBin "diskutil" "") ]; buildInputs = [ python3 diff --git a/pkgs/by-name/py/pymol/package.nix b/pkgs/by-name/py/pymol/package.nix index df3549541efa..5da3d7ded804 100644 --- a/pkgs/by-name/py/pymol/package.nix +++ b/pkgs/by-name/py/pymol/package.nix @@ -73,22 +73,21 @@ python3Packages.buildPythonApplication rec { qt5.wrapQtAppsHook ]; - buildInputs = - [ - python3Packages.numpy_1 - python3Packages.pyqt5 - qt5.qtbase - glew - glm - libpng - libxml2 - freetype - netcdf - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - mmtf-cpp - msgpack - ]; + buildInputs = [ + python3Packages.numpy_1 + python3Packages.pyqt5 + qt5.qtbase + glew + glm + libpng + libxml2 + freetype + netcdf + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + mmtf-cpp + msgpack + ]; env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"; @@ -126,22 +125,21 @@ python3Packages.buildPythonApplication rec { "tests/api/seqalign.py" ]; - disabledTests = - [ - # the output image does not exactly match - "test_commands" - # touch the network - "testFetch" - # requires collada2gltf which is not included in nixpkgs - "testglTF" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # require mmtf-cpp which does not support darwin - "test_bcif" - "test_bcif_array" - "testMMTF" - "testSave_symmetry__mmtf" - ]; + disabledTests = [ + # the output image does not exactly match + "test_commands" + # touch the network + "testFetch" + # requires collada2gltf which is not included in nixpkgs + "testglTF" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # require mmtf-cpp which does not support darwin + "test_bcif" + "test_bcif_array" + "testMMTF" + "testSave_symmetry__mmtf" + ]; preCheck = '' cd testing diff --git a/pkgs/by-name/py/pympress/package.nix b/pkgs/by-name/py/pympress/package.nix index dcb12b5a0cb5..e93c371b2808 100644 --- a/pkgs/by-name/py/pympress/package.nix +++ b/pkgs/by-name/py/pympress/package.nix @@ -46,21 +46,20 @@ python3Packages.buildPythonApplication rec { gobject-introspection ]; - buildInputs = - [ - gtk3 - poppler_gi - ] - ++ lib.optionals withGstreamer [ - libcanberra-gtk3 - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-ugly - (gst_all_1.gst-plugins-good.override { gtkSupport = true; }) - gst_all_1.gst-libav - gst_all_1.gst-vaapi - ]; + buildInputs = [ + gtk3 + poppler_gi + ] + ++ lib.optionals withGstreamer [ + libcanberra-gtk3 + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-ugly + (gst_all_1.gst-plugins-good.override { gtkSupport = true; }) + gst_all_1.gst-libav + gst_all_1.gst-vaapi + ]; doCheck = false; # there are no tests diff --git a/pkgs/by-name/py/pytrainer/package.nix b/pkgs/by-name/py/pytrainer/package.nix index 5d0d474d717b..6d9df2aae00c 100644 --- a/pkgs/by-name/py/pytrainer/package.nix +++ b/pkgs/by-name/py/pytrainer/package.nix @@ -76,16 +76,15 @@ python.pkgs.buildPythonApplication rec { ]) ]; - nativeCheckInputs = - [ - glibcLocales - perl - xvfb-run - ] - ++ (with python.pkgs; [ - mysqlclient - psycopg2 - ]); + nativeCheckInputs = [ + glibcLocales + perl + xvfb-run + ] + ++ (with python.pkgs; [ + mysqlclient + psycopg2 + ]); postPatch = '' substituteInPlace pytrainer/platform.py \ diff --git a/pkgs/by-name/q2/q2pro/package.nix b/pkgs/by-name/q2/q2pro/package.nix index d46ea13d2d49..4b2a3126ef0e 100644 --- a/pkgs/by-name/q2/q2pro/package.nix +++ b/pkgs/by-name/q2/q2pro/package.nix @@ -45,37 +45,35 @@ stdenv.mkDerivation (finalAttrs: { revCount = "3817"; # git rev-list --count ${src.rev} SOURCE_DATE_EPOCH = "1746223027"; # git show -s --format=%ct ${src.rev} - nativeBuildInputs = - [ - meson - pkg-config - ninja - makeBinaryWrapper - copyDesktopItems - ] - ++ lib.optional waylandSupport wayland-scanner - ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + nativeBuildInputs = [ + meson + pkg-config + ninja + makeBinaryWrapper + copyDesktopItems + ] + ++ lib.optional waylandSupport wayland-scanner + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; - buildInputs = - [ - zlib - libpng - libjpeg - curl - SDL2 - libGL - libogg - libvorbis - libX11 - ffmpeg - openalSoft - ] - ++ lib.optionals waylandSupport [ - wayland - wayland-protocols - libdecor - ] - ++ lib.optional x11Support libXi; + buildInputs = [ + zlib + libpng + libjpeg + curl + SDL2 + libGL + libogg + libvorbis + libX11 + ffmpeg + openalSoft + ] + ++ lib.optionals waylandSupport [ + wayland + wayland-protocols + libdecor + ] + ++ lib.optional x11Support libXi; mesonBuildType = "release"; diff --git a/pkgs/by-name/qa/qadwaitadecorations/package.nix b/pkgs/by-name/qa/qadwaitadecorations/package.nix index dfeb8bde1207..6dad24c390b4 100644 --- a/pkgs/by-name/qa/qadwaitadecorations/package.nix +++ b/pkgs/by-name/qa/qadwaitadecorations/package.nix @@ -43,12 +43,11 @@ stdenv.mkDerivation (finalAttrs: { dontWrapQtApps = true; - cmakeFlags = - [ - "-DQT_PLUGINS_DIR=${placeholder "out"}/${qt.qtbase.qtPluginPrefix}" - ] - ++ lib.optional useQt6 "-DUSE_QT6=true" - ++ lib.optional qt5ShadowsSupport "-DHAS_QT6_SUPPORT=true"; + cmakeFlags = [ + "-DQT_PLUGINS_DIR=${placeholder "out"}/${qt.qtbase.qtPluginPrefix}" + ] + ++ lib.optional useQt6 "-DUSE_QT6=true" + ++ lib.optional qt5ShadowsSupport "-DHAS_QT6_SUPPORT=true"; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/qa/qalculate-gtk/package.nix b/pkgs/by-name/qa/qalculate-gtk/package.nix index bed091475294..4b2cd5715283 100644 --- a/pkgs/by-name/qa/qalculate-gtk/package.nix +++ b/pkgs/by-name/qa/qalculate-gtk/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation (finalAttrs: { pkg-config autoreconfHook wrapGAppsHook3 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ libqalculate gtk3 diff --git a/pkgs/by-name/qa/qastools/package.nix b/pkgs/by-name/qa/qastools/package.nix index e3cb0ebb8bab..5a85c7c7ff04 100644 --- a/pkgs/by-name/qa/qastools/package.nix +++ b/pkgs/by-name/qa/qastools/package.nix @@ -23,16 +23,15 @@ stdenv.mkDerivation rec { cmake qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - alsa-lib - udev - ] - ++ (with qt6Packages; [ - qtbase - qtsvg - qttools - ]); + buildInputs = [ + alsa-lib + udev + ] + ++ (with qt6Packages; [ + qtbase + qtsvg + qttools + ]); meta = with lib; { description = "Collection of desktop applications for ALSA configuration"; diff --git a/pkgs/by-name/qb/qbittorrent/package.nix b/pkgs/by-name/qb/qbittorrent/package.nix index ecd6148a7388..fddae867ba77 100644 --- a/pkgs/by-name/qb/qbittorrent/package.nix +++ b/pkgs/by-name/qb/qbittorrent/package.nix @@ -37,28 +37,28 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook ]; - buildInputs = - [ - boost - libtorrent-rasterbar - openssl - qt6.qtbase - qt6.qtsvg - qt6.qttools - zlib - ] - ++ lib.optionals guiSupport [ dbus ] - ++ lib.optionals (guiSupport && stdenv.hostPlatform.isLinux) [ qt6.qtwayland ] - ++ lib.optionals trackerSearch [ python3 ]; + buildInputs = [ + boost + libtorrent-rasterbar + openssl + qt6.qtbase + qt6.qtsvg + qt6.qttools + zlib + ] + ++ lib.optionals guiSupport [ dbus ] + ++ lib.optionals (guiSupport && stdenv.hostPlatform.isLinux) [ qt6.qtwayland ] + ++ lib.optionals trackerSearch [ python3 ]; - cmakeFlags = - [ "-DVERBOSE_CONFIGURE=ON" ] - ++ lib.optionals (!guiSupport) [ - "-DGUI=OFF" - "-DSYSTEMD=ON" - "-DSYSTEMD_SERVICES_INSTALL_DIR=${placeholder "out"}/lib/systemd/system" - ] - ++ lib.optionals (!webuiSupport) [ "-DWEBUI=OFF" ]; + cmakeFlags = [ + "-DVERBOSE_CONFIGURE=ON" + ] + ++ lib.optionals (!guiSupport) [ + "-DGUI=OFF" + "-DSYSTEMD=ON" + "-DSYSTEMD_SERVICES_INSTALL_DIR=${placeholder "out"}/lib/systemd/system" + ] + ++ lib.optionals (!webuiSupport) [ "-DWEBUI=OFF" ]; qtWrapperArgs = lib.optionals trackerSearch [ "--prefix PATH : ${lib.makeBinPath [ python3 ]}" ]; diff --git a/pkgs/by-name/qd/qdirstat/package.nix b/pkgs/by-name/qd/qdirstat/package.nix index 2cdcb19f6c6d..970d0b71928c 100644 --- a/pkgs/by-name/qd/qdirstat/package.nix +++ b/pkgs/by-name/qd/qdirstat/package.nix @@ -22,12 +22,13 @@ stdenv.mkDerivation rec { hash = "sha256-pwdmltHDNwUMx1FNOoiXl5Pna0zlKqahmicBCN6UVSU="; }; - nativeBuildInputs = - [ makeWrapper ] - ++ (with libsForQt5; [ - qmake - wrapQtAppsHook - ]); + nativeBuildInputs = [ + makeWrapper + ] + ++ (with libsForQt5; [ + qmake + wrapQtAppsHook + ]); buildInputs = [ perlPackages.perl ]; diff --git a/pkgs/by-name/qd/qdiskinfo/package.nix b/pkgs/by-name/qd/qdiskinfo/package.nix index 94873c780011..0646adcaed18 100644 --- a/pkgs/by-name/qd/qdiskinfo/package.nix +++ b/pkgs/by-name/qd/qdiskinfo/package.nix @@ -58,17 +58,16 @@ stdenv.mkDerivation (finalAttrs: { cmakeBuildType = "MinSizeRel"; - cmakeFlags = - [ - "-DQT_VERSION_MAJOR=6" - ] - ++ lib.optionals isThemed [ "-DINCLUDE_OPTIONAL_RESOURCES=ON" ] - ++ ( - if themeBundle'.rightCharacter then - [ "-DCHARACTER_IS_RIGHT=ON" ] - else - [ "-DCHARACTER_IS_RIGHT=OFF" ] - ); + cmakeFlags = [ + "-DQT_VERSION_MAJOR=6" + ] + ++ lib.optionals isThemed [ "-DINCLUDE_OPTIONAL_RESOURCES=ON" ] + ++ ( + if themeBundle'.rightCharacter then + [ "-DCHARACTER_IS_RIGHT=ON" ] + else + [ "-DCHARACTER_IS_RIGHT=OFF" ] + ); postUnpack = '' cp -r $sourceRoot $TMPDIR/src diff --git a/pkgs/by-name/qe/qemacs/package.nix b/pkgs/by-name/qe/qemacs/package.nix index 06f00b4acc6d..dc225bf3087f 100644 --- a/pkgs/by-name/qe/qemacs/package.nix +++ b/pkgs/by-name/qe/qemacs/package.nix @@ -42,13 +42,12 @@ stdenv.mkDerivation { enableParallelBuilding = true; - configureFlags = - [ - "--cross-prefix=${stdenv.cc.targetPrefix}" - ] - ++ lib.optionals (!enableX11) [ - "--disable-x11" - ]; + configureFlags = [ + "--cross-prefix=${stdenv.cc.targetPrefix}" + ] + ++ lib.optionals (!enableX11) [ + "--disable-x11" + ]; makeFlags = [ # is actually used as BUILD_CC diff --git a/pkgs/by-name/qg/qgroundcontrol/package.nix b/pkgs/by-name/qg/qgroundcontrol/package.nix index 8f2dff91913f..16aa73665325 100644 --- a/pkgs/by-name/qg/qgroundcontrol/package.nix +++ b/pkgs/by-name/qg/qgroundcontrol/package.nix @@ -35,13 +35,14 @@ stdenv.mkDerivation rec { ]; buildInputs = [ SDL2 ] ++ gstInputs ++ propagatedBuildInputs; - nativeBuildInputs = - [ pkg-config ] - ++ (with libsForQt5; [ - qmake - qttools - wrapQtAppsHook - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with libsForQt5; [ + qmake + qttools + wrapQtAppsHook + ]); preConfigure = '' mkdir build diff --git a/pkgs/by-name/ql/qlog/package.nix b/pkgs/by-name/ql/qlog/package.nix index 50e5d32e1ece..06f104976ea3 100644 --- a/pkgs/by-name/ql/qlog/package.nix +++ b/pkgs/by-name/ql/qlog/package.nix @@ -23,19 +23,18 @@ stdenv.mkDerivation rec { env.NIX_LDFLAGS = "-lhamlib"; - buildInputs = - [ - hamlib - qt6.qtbase - qt6.qtcharts - qt6.qtserialport - qt6.qtwebchannel - qt6.qtwebengine - qt6Packages.qtkeychain - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cups - ]; + buildInputs = [ + hamlib + qt6.qtbase + qt6.qtcharts + qt6.qtserialport + qt6.qtwebchannel + qt6.qtwebengine + qt6Packages.qtkeychain + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cups + ]; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/qm/qmidiarp/package.nix b/pkgs/by-name/qm/qmidiarp/package.nix index 2b3f4ae16f96..ec9dcc7a7173 100644 --- a/pkgs/by-name/qm/qmidiarp/package.nix +++ b/pkgs/by-name/qm/qmidiarp/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation rec { qt5.wrapQtAppsHook ]; - buildInputs = - [ - alsa-lib - lv2 - libjack2 - ] - ++ (with qt5; [ - qttools - ]); + buildInputs = [ + alsa-lib + lv2 + libjack2 + ] + ++ (with qt5; [ + qttools + ]); meta = with lib; { description = "Advanced MIDI arpeggiator"; diff --git a/pkgs/by-name/qm/qmplay2/package.nix b/pkgs/by-name/qm/qmplay2/package.nix index 2b367367c52c..3f88b90470af 100644 --- a/pkgs/by-name/qm/qmplay2/package.nix +++ b/pkgs/by-name/qm/qmplay2/package.nix @@ -47,44 +47,42 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "getSubmitInfo()" "getSubmitInfo(0)" ''; - nativeBuildInputs = - [ - cmake - ninja - pkg-config - ] - ++ lib.optionals (qtVersion == "6") [ qt6.wrapQtAppsHook ] - ++ lib.optionals (qtVersion == "5") [ qt5.wrapQtAppsHook ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + ] + ++ lib.optionals (qtVersion == "6") [ qt6.wrapQtAppsHook ] + ++ lib.optionals (qtVersion == "5") [ qt5.wrapQtAppsHook ]; - buildInputs = - [ - alsa-lib - ffmpeg - fribidi - game-music-emu - libXdmcp - libXv - libass - libcddb - libcdio - libpulseaudio - libsidplayfp - libva - libxcb - taglib - vulkan-headers - vulkan-tools - ] - ++ lib.optionals (qtVersion == "6") [ - qt6.qt5compat - qt6.qtbase - qt6.qtsvg - qt6.qttools - ] - ++ lib.optionals (qtVersion == "5") [ - qt5.qtbase - qt5.qttools - ]; + buildInputs = [ + alsa-lib + ffmpeg + fribidi + game-music-emu + libXdmcp + libXv + libass + libcddb + libcdio + libpulseaudio + libsidplayfp + libva + libxcb + taglib + vulkan-headers + vulkan-tools + ] + ++ lib.optionals (qtVersion == "6") [ + qt6.qt5compat + qt6.qtbase + qt6.qtsvg + qt6.qttools + ] + ++ lib.optionals (qtVersion == "5") [ + qt5.qtbase + qt5.qttools + ]; strictDeps = true; diff --git a/pkgs/by-name/qo/qodem/package.nix b/pkgs/by-name/qo/qodem/package.nix index f0025b9915c5..5931950ec3bb 100644 --- a/pkgs/by-name/qo/qodem/package.nix +++ b/pkgs/by-name/qo/qodem/package.nix @@ -51,15 +51,14 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook ]; - buildInputs = - [ - ncurses - SDL - miniupnpc - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform gpm) [ - gpm - ]; + buildInputs = [ + ncurses + SDL + miniupnpc + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform gpm) [ + gpm + ]; configureFlags = lib.optionals (!(lib.meta.availableOn stdenv.hostPlatform gpm)) [ "--disable-gpm" diff --git a/pkgs/by-name/qo/qownnotes/package.nix b/pkgs/by-name/qo/qownnotes/package.nix index 1932047a1b0a..12423b21e1d3 100644 --- a/pkgs/by-name/qo/qownnotes/package.nix +++ b/pkgs/by-name/qo/qownnotes/package.nix @@ -25,16 +25,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-9ldUIT3pQlkO2YhQ3cF9H6Soe8IU4AGEGNRWg0LA1MQ="; }; - nativeBuildInputs = - [ - cmake - qt6Packages.qttools - qt6Packages.wrapQtAppsHook - pkg-config - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ xvfb-run ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; + nativeBuildInputs = [ + cmake + qt6Packages.qttools + qt6Packages.wrapQtAppsHook + pkg-config + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ xvfb-run ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper ]; buildInputs = [ qt6Packages.qtbase @@ -43,7 +42,8 @@ stdenv.mkDerivation (finalAttrs: { qt6Packages.qtwebsockets botan3 libgit2 - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6Packages.qtwayland ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6Packages.qtwayland ]; cmakeFlags = [ "-DQON_QT6_BUILD=ON" diff --git a/pkgs/by-name/qr/qrtool/package.nix b/pkgs/by-name/qr/qrtool/package.nix index d7a5e09767ae..0c7730c3cee7 100644 --- a/pkgs/by-name/qr/qrtool/package.nix +++ b/pkgs/by-name/qr/qrtool/package.nix @@ -26,18 +26,17 @@ rustPlatform.buildRustPackage rec { installShellFiles ]; - postInstall = - '' - # Built by ./build.rs using `asciidoctor` - installManPage ./target/*/release/build/qrtool*/out/*.? + postInstall = '' + # Built by ./build.rs using `asciidoctor` + installManPage ./target/*/release/build/qrtool*/out/*.? - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd qrtool \ - --bash <($out/bin/qrtool --generate-completion bash) \ - --fish <($out/bin/qrtool --generate-completion fish) \ - --zsh <($out/bin/qrtool --generate-completion zsh) - ''; + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd qrtool \ + --bash <($out/bin/qrtool --generate-completion bash) \ + --fish <($out/bin/qrtool --generate-completion fish) \ + --zsh <($out/bin/qrtool --generate-completion zsh) + ''; meta = with lib; { maintainers = with maintainers; [ philiptaron ]; diff --git a/pkgs/by-name/qt/qtalarm/package.nix b/pkgs/by-name/qt/qtalarm/package.nix index 67315a676332..f4f078e64dc9 100644 --- a/pkgs/by-name/qt/qtalarm/package.nix +++ b/pkgs/by-name/qt/qtalarm/package.nix @@ -25,27 +25,26 @@ stdenv.mkDerivation (finalAttrs: { libsForQt5.qtmultimedia ]; - installPhase = - '' - runHook preInstall - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir -p $out/Applications - mv qtalarm.app $out/Applications - '' - else - '' - install -Dm755 qtalarm -t $out/bin - install -Dm644 Icons/1349069370_Alarm_Clock.png $out/share/icons/hicolor/48x48/apps/qtalarm.png - install -Dm644 Icons/1349069370_Alarm_Clock24.png $out/share/icons/hicolor/24x24/apps/qtalarm.png - install -Dm644 Icons/1349069370_Alarm_Clock16.png $out/share/icons/hicolor/16x16/apps/qtalarm.png - '' - ) - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p $out/Applications + mv qtalarm.app $out/Applications + '' + else + '' + install -Dm755 qtalarm -t $out/bin + install -Dm644 Icons/1349069370_Alarm_Clock.png $out/share/icons/hicolor/48x48/apps/qtalarm.png + install -Dm644 Icons/1349069370_Alarm_Clock24.png $out/share/icons/hicolor/24x24/apps/qtalarm.png + install -Dm644 Icons/1349069370_Alarm_Clock16.png $out/share/icons/hicolor/16x16/apps/qtalarm.png + '' + ) + + '' + runHook postInstall + ''; nativeBuildInputs = [ qt5.wrapQtAppsHook diff --git a/pkgs/by-name/qt/qtorganizer-mkcal/package.nix b/pkgs/by-name/qt/qtorganizer-mkcal/package.nix index 984e5e0f4a83..d1701d6666d0 100644 --- a/pkgs/by-name/qt/qtorganizer-mkcal/package.nix +++ b/pkgs/by-name/qt/qtorganizer-mkcal/package.nix @@ -35,15 +35,14 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - mkcal - ] - ++ (with libsForQt5; [ - kcalendarcore - qtbase - qtpim - ]); + buildInputs = [ + mkcal + ] + ++ (with libsForQt5; [ + kcalendarcore + qtbase + qtpim + ]); nativeCheckInputs = [ tzdata diff --git a/pkgs/by-name/qt/qtox/package.nix b/pkgs/by-name/qt/qtox/package.nix index a3737ef971d0..68f4663a632a 100644 --- a/pkgs/by-name/qt/qtox/package.nix +++ b/pkgs/by-name/qt/qtox/package.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation rec { pkg-config qt6.qttools qt6.wrapQtAppsHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ perl ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ perl ]; cmakeFlags = [ "-DGIT_DESCRIBE=v${version}" diff --git a/pkgs/by-name/qt/qtscrcpy/package.nix b/pkgs/by-name/qt/qtscrcpy/package.nix index d9365efac7c7..0f54fe287f2d 100644 --- a/pkgs/by-name/qt/qtscrcpy/package.nix +++ b/pkgs/by-name/qt/qtscrcpy/package.nix @@ -63,17 +63,16 @@ stdenv.mkDerivation rec { copyDesktopItems ]; - buildInputs = - [ - scrcpy - # Upstream vendors ffmpeg_4 - ffmpeg - ] - ++ (with libsForQt5; [ - qtbase - qtmultimedia - qtx11extras - ]); + buildInputs = [ + scrcpy + # Upstream vendors ffmpeg_4 + ffmpeg + ] + ++ (with libsForQt5; [ + qtbase + qtmultimedia + qtx11extras + ]); env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=sign-compare" diff --git a/pkgs/by-name/qu/quartus-prime-lite/package.nix b/pkgs/by-name/qu/quartus-prime-lite/package.nix index 94c3b8c74b04..6322fc3a99b4 100644 --- a/pkgs/by-name/qu/quartus-prime-lite/package.nix +++ b/pkgs/by-name/qu/quartus-prime-lite/package.nix @@ -142,38 +142,37 @@ buildFHSEnv rec { ln --symbolic --relative --target-directory ./bin ''${progs_wrapped[@]} ''; - profile = - '' - # LD_PRELOAD fixes issues in the licensing system that cause memory corruption and crashes when - # starting most operations in many containerized environments, including WSL2, Docker, and LXC - # (a similiar fix involving LD_PRELOADing tcmalloc did not solve the issue in my situation) - # https://community.intel.com/t5/Intel-FPGA-Software-Installation/Running-Quartus-Prime-Standard-on-WSL-crashes-in-libudev-so/m-p/1189032 - # - # But, as can be seen in the above resource, LD_PRELOADing libudev breaks - # compiling encrypted device libraries in Questa (with error - # `(vlog-2163) Macro ` is undefined.`), so only use LD_PRELOAD - # for non-Questa wrappers. - if [ "$NIXPKGS_IS_QUESTA_WRAPPER" != 1 ]; then - export LD_PRELOAD=''${LD_PRELOAD:+$LD_PRELOAD:}/usr/lib/libudev.so.0 - fi + profile = '' + # LD_PRELOAD fixes issues in the licensing system that cause memory corruption and crashes when + # starting most operations in many containerized environments, including WSL2, Docker, and LXC + # (a similiar fix involving LD_PRELOADing tcmalloc did not solve the issue in my situation) + # https://community.intel.com/t5/Intel-FPGA-Software-Installation/Running-Quartus-Prime-Standard-on-WSL-crashes-in-libudev-so/m-p/1189032 + # + # But, as can be seen in the above resource, LD_PRELOADing libudev breaks + # compiling encrypted device libraries in Questa (with error + # `(vlog-2163) Macro ` is undefined.`), so only use LD_PRELOAD + # for non-Questa wrappers. + if [ "$NIXPKGS_IS_QUESTA_WRAPPER" != 1 ]; then + export LD_PRELOAD=''${LD_PRELOAD:+$LD_PRELOAD:}/usr/lib/libudev.so.0 + fi - # Implement the SOURCE_DATE_EPOCH specification for reproducible builds - # (https://reproducible-builds.org/specs/source-date-epoch). - # Require opt-in with NIXPKGS_QUARTUS_REPRODUCIBLE_BUILD=1 for now, in case - # the blocklist is incomplete. - if [ -n "$SOURCE_DATE_EPOCH" ] && [ "$NIXPKGS_QUARTUS_REPRODUCIBLE_BUILD" = 1 ] && [ "$NIXPKGS_QUARTUS_THIS_PROG_SUPPORTS_FIXED_CLOCK" = 1 ]; then - export LD_LIBRARY_PATH="${ - lib.makeLibraryPath [ - libfaketime - pkgsi686Linux.libfaketime - ] - }''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - export LD_PRELOAD=libfaketime.so.1''${LD_PRELOAD:+:$LD_PRELOAD} - export FAKETIME_FMT="%s" - export FAKETIME="$SOURCE_DATE_EPOCH" - fi - '' - + extraProfile; + # Implement the SOURCE_DATE_EPOCH specification for reproducible builds + # (https://reproducible-builds.org/specs/source-date-epoch). + # Require opt-in with NIXPKGS_QUARTUS_REPRODUCIBLE_BUILD=1 for now, in case + # the blocklist is incomplete. + if [ -n "$SOURCE_DATE_EPOCH" ] && [ "$NIXPKGS_QUARTUS_REPRODUCIBLE_BUILD" = 1 ] && [ "$NIXPKGS_QUARTUS_THIS_PROG_SUPPORTS_FIXED_CLOCK" = 1 ]; then + export LD_LIBRARY_PATH="${ + lib.makeLibraryPath [ + libfaketime + pkgsi686Linux.libfaketime + ] + }''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + export LD_PRELOAD=libfaketime.so.1''${LD_PRELOAD:+:$LD_PRELOAD} + export FAKETIME_FMT="%s" + export FAKETIME="$SOURCE_DATE_EPOCH" + fi + '' + + extraProfile; # Run the wrappers directly, instead of going via bash. runScript = ""; diff --git a/pkgs/by-name/qu/quartus-prime-lite/quartus.nix b/pkgs/by-name/qu/quartus-prime-lite/quartus.nix index 26b95d70a082..bacef122db89 100644 --- a/pkgs/by-name/qu/quartus-prime-lite/quartus.nix +++ b/pkgs/by-name/qu/quartus-prime-lite/quartus.nix @@ -95,14 +95,13 @@ stdenv.mkDerivation { ''; copyComponent = component: "cp ${component} $TEMP/${component.name}"; # leaves enabled: quartus, devinfo - disabledComponents = - [ - "quartus_help" - "quartus_update" - "questa_fe" - ] - ++ (lib.optional (!withQuesta) "questa_fse") - ++ (lib.attrValues unsupportedDeviceIds); + disabledComponents = [ + "quartus_help" + "quartus_update" + "questa_fe" + ] + ++ (lib.optional (!withQuesta) "questa_fse") + ++ (lib.attrValues unsupportedDeviceIds); in '' echo "setting up installer..." diff --git a/pkgs/by-name/qu/quickemu/package.nix b/pkgs/by-name/qu/quickemu/package.nix index 5b0c4417bfe0..7048dacba1f4 100644 --- a/pkgs/by-name/qu/quickemu/package.nix +++ b/pkgs/by-name/qu/quickemu/package.nix @@ -31,30 +31,29 @@ installShellFiles, }: let - runtimePaths = - [ - cdrtools - curl - gawk - gnugrep - gnused - jq - pciutils - procps - python3 - (qemu.override { smbdSupport = true; }) - socat - swtpm - util-linux - unzip - xrandr - zsync - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - mesa-demos - usbutils - xdg-user-dirs - ]; + runtimePaths = [ + cdrtools + curl + gawk + gnugrep + gnused + jq + pciutils + procps + python3 + (qemu.override { smbdSupport = true; }) + socat + swtpm + util-linux + unzip + xrandr + zsync + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + mesa-demos + usbutils + xdg-user-dirs + ]; in stdenv.mkDerivation (finalAttrs: { diff --git a/pkgs/by-name/qu/quill/package.nix b/pkgs/by-name/qu/quill/package.nix index d1464f0442c3..dd214c8a4789 100644 --- a/pkgs/by-name/qu/quill/package.nix +++ b/pkgs/by-name/qu/quill/package.nix @@ -51,14 +51,13 @@ rustPlatform.buildRustPackage rec { pkg-config protobuf ]; - buildInputs = - [ - openssl - udev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + udev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; meta = { homepage = "https://github.com/dfinity/quill"; diff --git a/pkgs/by-name/qu/quirc/package.nix b/pkgs/by-name/qu/quirc/package.nix index ef7a6d621fb6..e5fb332a2289 100644 --- a/pkgs/by-name/qu/quirc/package.nix +++ b/pkgs/by-name/qu/quirc/package.nix @@ -62,16 +62,15 @@ stdenv.mkDerivation (finalAttrs: { | xargs cp -t "$out"/bin ''; - postInstall = - '' - # don't install static library - rm $out/lib/libquirc.a - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Set absolute install name to avoid the need for DYLD_LIBRARY_PATH - dylib=$out/lib/libquirc.${finalAttrs.version}.dylib - ${stdenv.cc.targetPrefix}install_name_tool -id "$dylib" "$dylib" - ''; + postInstall = '' + # don't install static library + rm $out/lib/libquirc.a + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Set absolute install name to avoid the need for DYLD_LIBRARY_PATH + dylib=$out/lib/libquirc.${finalAttrs.version}.dylib + ${stdenv.cc.targetPrefix}install_name_tool -id "$dylib" "$dylib" + ''; meta = { description = "Small QR code decoding library"; diff --git a/pkgs/by-name/qu/qutebrowser/package.nix b/pkgs/by-name/qu/qutebrowser/package.nix index 399d1fb21b5c..fc2b940d0f98 100644 --- a/pkgs/by-name/qu/qutebrowser/package.nix +++ b/pkgs/by-name/qu/qutebrowser/package.nix @@ -50,14 +50,13 @@ python3.pkgs.buildPythonApplication { # Needs tox doCheck = false; - buildInputs = - [ - qt6Packages.qtbase - glib-networking - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6Packages.qtwayland - ]; + buildInputs = [ + qt6Packages.qtbase + glib-networking + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6Packages.qtwayland + ]; build-system = with python3.pkgs; [ setuptools @@ -70,7 +69,8 @@ python3.pkgs.buildPythonApplication { docbook_xsl libxml2 libxslt - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; dependencies = with python3.pkgs; [ colorama @@ -97,15 +97,14 @@ python3.pkgs.buildPythonApplication { dontWrapQtApps = true; - postPatch = - '' - substituteInPlace qutebrowser/misc/quitter.py --subst-var-by qutebrowser "$out/bin/qutebrowser" + postPatch = '' + substituteInPlace qutebrowser/misc/quitter.py --subst-var-by qutebrowser "$out/bin/qutebrowser" - sed -i "s,/usr,$out,g" qutebrowser/utils/standarddir.py - '' - + lib.optionalString withPdfReader '' - sed -i "s,/usr/share/pdf.js,${pdfjs},g" qutebrowser/browser/pdfjs.py - ''; + sed -i "s,/usr,$out,g" qutebrowser/utils/standarddir.py + '' + + lib.optionalString withPdfReader '' + sed -i "s,/usr/share/pdf.js,${pdfjs},g" qutebrowser/browser/pdfjs.py + ''; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/qv/qview/package.nix b/pkgs/by-name/qv/qview/package.nix index be06cab3cf19..1cbe5b1422d1 100644 --- a/pkgs/by-name/qv/qview/package.nix +++ b/pkgs/by-name/qv/qview/package.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation rec { libsForQt5.qttools libsForQt5.qtimageformats libsForQt5.qtsvg - ] ++ lib.optionals x11Support [ libsForQt5.qtx11extras ]; + ] + ++ lib.optionals x11Support [ libsForQt5.qtx11extras ]; meta = with lib; { description = "Practical and minimal image viewer"; diff --git a/pkgs/by-name/qx/qxmpp/package.nix b/pkgs/by-name/qx/qxmpp/package.nix index de253a65b997..4669d0926df4 100644 --- a/pkgs/by-name/qx/qxmpp/package.nix +++ b/pkgs/by-name/qx/qxmpp/package.nix @@ -23,14 +23,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-iSsQKVfcH5AjX+bURYK7UPdZKWFX6WaFSrpeRC5IE/0="; }; - nativeBuildInputs = - [ - cmake - kdePackages.wrapQtAppsNoGuiHook - ] - ++ lib.optionals (withGstreamer || withOmemo) [ - pkg-config - ]; + nativeBuildInputs = [ + cmake + kdePackages.wrapQtAppsNoGuiHook + ] + ++ lib.optionals (withGstreamer || withOmemo) [ + pkg-config + ]; buildInputs = lib.optionals withGstreamer ( with gst_all_1; @@ -46,17 +45,16 @@ stdenv.mkDerivation (finalAttrs: { kdePackages.qca libomemo-c ]; - cmakeFlags = - [ - "-DBUILD_EXAMPLES=false" - "-DBUILD_TESTS=false" - ] - ++ lib.optionals withGstreamer [ - "-DWITH_GSTREAMER=ON" - ] - ++ lib.optionals withOmemo [ - "-DBUILD_OMEMO=ON" - ]; + cmakeFlags = [ + "-DBUILD_EXAMPLES=false" + "-DBUILD_TESTS=false" + ] + ++ lib.optionals withGstreamer [ + "-DWITH_GSTREAMER=ON" + ] + ++ lib.optionals withOmemo [ + "-DBUILD_OMEMO=ON" + ]; meta = { description = "Cross-platform C++ XMPP client and server library"; diff --git a/pkgs/by-name/ra/racket/minimal.nix b/pkgs/by-name/ra/racket/minimal.nix index 2acd10f83bd7..17c4dcf61c17 100644 --- a/pkgs/by-name/ra/racket/minimal.nix +++ b/pkgs/by-name/ra/racket/minimal.nix @@ -67,26 +67,25 @@ stdenv.mkDerivation (finalAttrs: { configureScript = "../configure"; - configureFlags = - [ - # > docs failure: ftype-ref: ftype mismatch for # - # "--enable-check" - "--enable-csonly" - "--enable-liblz4" - "--enable-libz" - ] - ++ lib.optional disableDocs "--disable-docs" - ++ lib.optionals (!(finalAttrs.dontDisableStatic or false)) [ - # instead of `--disable-static` that `stdenv` assumes - "--disable-libs" - # "not currently supported" in `configure --help-cs` but still emphasized in README - "--enable-shared" - ] - ++ lib.optionals isDarwin [ - "--disable-strip" - # "use Unix style (e.g., use Gtk) for Mac OS", which eliminates many problems - "--enable-xonx" - ]; + configureFlags = [ + # > docs failure: ftype-ref: ftype mismatch for # + # "--enable-check" + "--enable-csonly" + "--enable-liblz4" + "--enable-libz" + ] + ++ lib.optional disableDocs "--disable-docs" + ++ lib.optionals (!(finalAttrs.dontDisableStatic or false)) [ + # instead of `--disable-static` that `stdenv` assumes + "--disable-libs" + # "not currently supported" in `configure --help-cs` but still emphasized in README + "--enable-shared" + ] + ++ lib.optionals isDarwin [ + "--disable-strip" + # "use Unix style (e.g., use Gtk) for Mac OS", which eliminates many problems + "--enable-xonx" + ]; # The upstream script builds static libraries by default. dontAddStaticConfigureFlags = true; diff --git a/pkgs/by-name/ra/radarr/package.nix b/pkgs/by-name/ra/radarr/package.nix index 3c547a315198..aa83432435fd 100644 --- a/pkgs/by-name/ra/radarr/package.nix +++ b/pkgs/by-name/ra/radarr/package.nix @@ -132,43 +132,41 @@ buildDotnetModule { ]; # Skip manual, integration, automation and platform-dependent tests. - testFilters = - [ - "TestCategory!=ManualTest" - "TestCategory!=IntegrationTest" - "TestCategory!=AutomationTest" + testFilters = [ + "TestCategory!=ManualTest" + "TestCategory!=IntegrationTest" + "TestCategory!=AutomationTest" - # makes real HTTP requests - "FullyQualifiedName!~NzbDrone.Core.Test.UpdateTests.UpdatePackageProviderFixture" - ] - ++ lib.optionals stdenvNoCC.buildPlatform.isDarwin [ - # fails on macOS - "FullyQualifiedName!~NzbDrone.Core.Test.Http.HttpProxySettingsProviderFixture" - ]; + # makes real HTTP requests + "FullyQualifiedName!~NzbDrone.Core.Test.UpdateTests.UpdatePackageProviderFixture" + ] + ++ lib.optionals stdenvNoCC.buildPlatform.isDarwin [ + # fails on macOS + "FullyQualifiedName!~NzbDrone.Core.Test.Http.HttpProxySettingsProviderFixture" + ]; - disabledTests = - [ - # setgid tests - "NzbDrone.Mono.Test.DiskProviderTests.DiskProviderFixture.should_preserve_setgid_on_set_folder_permissions" - "NzbDrone.Mono.Test.DiskProviderTests.DiskProviderFixture.should_clear_setgid_on_set_folder_permissions" + disabledTests = [ + # setgid tests + "NzbDrone.Mono.Test.DiskProviderTests.DiskProviderFixture.should_preserve_setgid_on_set_folder_permissions" + "NzbDrone.Mono.Test.DiskProviderTests.DiskProviderFixture.should_clear_setgid_on_set_folder_permissions" - # we do not set application data directory during tests (i.e. XDG data directory) - "NzbDrone.Mono.Test.DiskProviderTests.FreeSpaceFixture.should_return_free_disk_space" - "NzbDrone.Common.Test.ServiceFactoryFixture.event_handlers_should_be_unique" + # we do not set application data directory during tests (i.e. XDG data directory) + "NzbDrone.Mono.Test.DiskProviderTests.FreeSpaceFixture.should_return_free_disk_space" + "NzbDrone.Common.Test.ServiceFactoryFixture.event_handlers_should_be_unique" - # attempts to read /etc/*release and fails since it does not exist - "NzbDrone.Mono.Test.EnvironmentInfo.ReleaseFileVersionAdapterFixture.should_get_version_info" + # attempts to read /etc/*release and fails since it does not exist + "NzbDrone.Mono.Test.EnvironmentInfo.ReleaseFileVersionAdapterFixture.should_get_version_info" - # fails to start test dummy because it cannot locate .NET runtime for some reason - "NzbDrone.Common.Test.ProcessProviderFixture.should_be_able_to_start_process" - "NzbDrone.Common.Test.ProcessProviderFixture.exists_should_find_running_process" - "NzbDrone.Common.Test.ProcessProviderFixture.kill_all_should_kill_all_process_with_name" - ] - ++ lib.optionals stdenvNoCC.buildPlatform.isDarwin [ - # flaky on darwin - "NzbDrone.Core.Test.NotificationTests.TraktServiceFixture.should_add_collection_movie_if_valid_mediainfo" - "NzbDrone.Core.Test.NotificationTests.TraktServiceFixture.should_format_audio_channels_to_one_decimal_when_adding_collection_movie" - ]; + # fails to start test dummy because it cannot locate .NET runtime for some reason + "NzbDrone.Common.Test.ProcessProviderFixture.should_be_able_to_start_process" + "NzbDrone.Common.Test.ProcessProviderFixture.exists_should_find_running_process" + "NzbDrone.Common.Test.ProcessProviderFixture.kill_all_should_kill_all_process_with_name" + ] + ++ lib.optionals stdenvNoCC.buildPlatform.isDarwin [ + # flaky on darwin + "NzbDrone.Core.Test.NotificationTests.TraktServiceFixture.should_add_collection_movie_if_valid_mediainfo" + "NzbDrone.Core.Test.NotificationTests.TraktServiceFixture.should_format_audio_channels_to_one_decimal_when_adding_collection_movie" + ]; passthru = { tests = { diff --git a/pkgs/by-name/ra/raider/package.nix b/pkgs/by-name/ra/raider/package.nix index f1f662b3906a..c5ce3cee95ce 100644 --- a/pkgs/by-name/ra/raider/package.nix +++ b/pkgs/by-name/ra/raider/package.nix @@ -26,19 +26,18 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-X8VIpxOhfvOIf5CYQOBVrC9T6Dhgz/oMIQCaoRch4Oo="; }; - nativeBuildInputs = - [ - appstream - blueprint-compiler - desktop-file-utils - meson - ninja - pkg-config - wrapGAppsHook4 - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + appstream + blueprint-compiler + desktop-file-utils + meson + ninja + pkg-config + wrapGAppsHook4 + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ gtk4 diff --git a/pkgs/by-name/ra/range-v3/package.nix b/pkgs/by-name/ra/range-v3/package.nix index 31f0fb720079..0921b26fec25 100644 --- a/pkgs/by-name/ra/range-v3/package.nix +++ b/pkgs/by-name/ra/range-v3/package.nix @@ -22,7 +22,8 @@ stdenv.mkDerivation rec { # errors (with GCC 9.2): cmakeFlags = [ "-DRANGES_ENABLE_WERROR=OFF" - ] ++ lib.optional stdenv.hostPlatform.isAarch64 "-DRANGE_V3_TESTS=OFF"; + ] + ++ lib.optional stdenv.hostPlatform.isAarch64 "-DRANGE_V3_TESTS=OFF"; doCheck = !stdenv.hostPlatform.isAarch64; checkTarget = "test"; diff --git a/pkgs/by-name/ra/ranger/package.nix b/pkgs/by-name/ra/ranger/package.nix index 7e795f3c5a0d..b472415089c4 100644 --- a/pkgs/by-name/ra/ranger/package.nix +++ b/pkgs/by-name/ra/ranger/package.nix @@ -34,40 +34,38 @@ python3Packages.buildPythonApplication { astroid pylint ]; - propagatedBuildInputs = - [ - less - file - ] - ++ lib.optionals imagePreviewSupport [ python3Packages.pillow ] - ++ lib.optionals sixelPreviewSupport [ imagemagick ] - ++ lib.optionals neoVimSupport [ python3Packages.pynvim ] - ++ lib.optionals improvedEncodingDetection [ python3Packages.chardet ] - ++ lib.optionals rightToLeftTextSupport [ python3Packages.python-bidi ]; + propagatedBuildInputs = [ + less + file + ] + ++ lib.optionals imagePreviewSupport [ python3Packages.pillow ] + ++ lib.optionals sixelPreviewSupport [ imagemagick ] + ++ lib.optionals neoVimSupport [ python3Packages.pynvim ] + ++ lib.optionals improvedEncodingDetection [ python3Packages.chardet ] + ++ lib.optionals rightToLeftTextSupport [ python3Packages.python-bidi ]; - preConfigure = - '' - ${lib.optionalString (highlight != null) '' - sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \ - ranger/data/scope.sh - ''} + preConfigure = '' + ${lib.optionalString (highlight != null) '' + sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \ + ranger/data/scope.sh + ''} - substituteInPlace ranger/__init__.py \ - --replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin less}/bin/less'" + substituteInPlace ranger/__init__.py \ + --replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin less}/bin/less'" - # give file previews out of the box - substituteInPlace ranger/config/rc.conf \ - --replace /usr/share $out/share \ - --replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh" - '' - + lib.optionalString imagePreviewSupport '' - substituteInPlace ranger/ext/img_display.py \ - --replace /usr/lib/w3m ${w3m}/libexec/w3m + # give file previews out of the box + substituteInPlace ranger/config/rc.conf \ + --replace /usr/share $out/share \ + --replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh" + '' + + lib.optionalString imagePreviewSupport '' + substituteInPlace ranger/ext/img_display.py \ + --replace /usr/lib/w3m ${w3m}/libexec/w3m - # give image previews out of the box when building with w3m - substituteInPlace ranger/config/rc.conf \ - --replace "set preview_images false" "set preview_images true" - ''; + # give image previews out of the box when building with w3m + substituteInPlace ranger/config/rc.conf \ + --replace "set preview_images false" "set preview_images true" + ''; passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; }; diff --git a/pkgs/by-name/ra/rasdaemon/package.nix b/pkgs/by-name/ra/rasdaemon/package.nix index 27f80748b727..37a55db266c5 100644 --- a/pkgs/by-name/ra/rasdaemon/package.nix +++ b/pkgs/by-name/ra/rasdaemon/package.nix @@ -34,19 +34,18 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - libtraceevent - (perl.withPackages ( - ps: with ps; [ - DBDSQLite - ] - )) - sqlite - ] - ++ lib.optionals enableDmidecode [ - dmidecode - ]; + buildInputs = [ + libtraceevent + (perl.withPackages ( + ps: with ps; [ + DBDSQLite + ] + )) + sqlite + ] + ++ lib.optionals enableDmidecode [ + dmidecode + ]; configureFlags = [ "--sysconfdir=/etc" diff --git a/pkgs/by-name/ra/rav1e/package.nix b/pkgs/by-name/ra/rav1e/package.nix index 3b0b7c9fc061..c363d68cd83c 100644 --- a/pkgs/by-name/ra/rav1e/package.nix +++ b/pkgs/by-name/ra/rav1e/package.nix @@ -28,19 +28,18 @@ rustPlatform.buildRustPackage rec { nasm ]; - postPatch = - '' - # remove feature that requires libgit2 and is only used to print a version string - substituteInPlace Cargo.toml --replace-fail '"git_version",' "" - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' - # Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library - # and linking it with cctools ld64. - substituteInPlace build.rs --replace-fail '.arg("-x")' '.arg("-S")' + postPatch = '' + # remove feature that requires libgit2 and is only used to print a version string + substituteInPlace Cargo.toml --replace-fail '"git_version",' "" + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' + # Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library + # and linking it with cctools ld64. + substituteInPlace build.rs --replace-fail '.arg("-x")' '.arg("-S")' - # Thin LTO doesn’t appear to work with Rust 1.79. rav1e fail to build when building fern. - substituteInPlace Cargo.toml --replace-fail 'lto = "thin"' 'lto = "fat"' - ''; + # Thin LTO doesn’t appear to work with Rust 1.79. rav1e fail to build when building fern. + substituteInPlace Cargo.toml --replace-fail 'lto = "thin"' 'lto = "fat"' + ''; checkType = "debug"; diff --git a/pkgs/by-name/ra/raylib/package.nix b/pkgs/by-name/ra/raylib/package.nix index d0e9c9f0e4e2..a21c8674ab76 100644 --- a/pkgs/by-name/ra/raylib/package.nix +++ b/pkgs/by-name/ra/raylib/package.nix @@ -49,7 +49,8 @@ lib.checkListOfEnum "${pname}: platform" # autoPatchelfHook is needed for appendRunpaths nativeBuildInputs = [ cmake - ] ++ optional (builtins.length finalAttrs.appendRunpaths > 0) autoPatchelfHook; + ] + ++ optional (builtins.length finalAttrs.appendRunpaths > 0) autoPatchelfHook; buildInputs = optional (platform == "Desktop") glfw ++ optional (platform == "SDL") SDL2; @@ -59,14 +60,13 @@ lib.checkListOfEnum "${pname}: platform" ]; # https://github.com/raysan5/raylib/wiki/CMake-Build-Options - cmakeFlags = - [ - "-DCUSTOMIZE_BUILD=ON" - "-DPLATFORM=${platform}" - ] - ++ optional (platform == "Desktop") "-DUSE_EXTERNAL_GLFW=ON" - ++ optional includeEverything "-DINCLUDE_EVERYTHING=ON" - ++ optional sharedLib "-DBUILD_SHARED_LIBS=ON"; + cmakeFlags = [ + "-DCUSTOMIZE_BUILD=ON" + "-DPLATFORM=${platform}" + ] + ++ optional (platform == "Desktop") "-DUSE_EXTERNAL_GLFW=ON" + ++ optional includeEverything "-DINCLUDE_EVERYTHING=ON" + ++ optional sharedLib "-DBUILD_SHARED_LIBS=ON"; appendRunpaths = optional stdenv.hostPlatform.isLinux ( lib.makeLibraryPath (optional alsaSupport alsa-lib ++ optional pulseSupport libpulseaudio) diff --git a/pkgs/by-name/rb/rbw/package.nix b/pkgs/by-name/rb/rbw/package.nix index 491471bf614e..58d0487e7a00 100644 --- a/pkgs/by-name/rb/rbw/package.nix +++ b/pkgs/by-name/rb/rbw/package.nix @@ -36,7 +36,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; buildInputs = [ bash ]; # for git-credential-rbw @@ -45,33 +46,32 @@ rustPlatform.buildRustPackage rec { export OPENSSL_LIB_DIR="${lib.getLib openssl}/lib" ''; - postInstall = - '' - install -Dm755 -t $out/bin bin/git-credential-rbw - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd rbw \ - --bash <($out/bin/rbw gen-completions bash) \ - --fish <($out/bin/rbw gen-completions fish) \ - --zsh <($out/bin/rbw gen-completions zsh) - '' - + lib.optionalString withFzf '' - install -Dm755 -t $out/bin bin/rbw-fzf - substituteInPlace $out/bin/rbw-fzf \ - --replace fzf ${fzf}/bin/fzf \ - --replace perl ${perl}/bin/perl - '' - + lib.optionalString withRofi '' - install -Dm755 -t $out/bin bin/rbw-rofi - substituteInPlace $out/bin/rbw-rofi \ - --replace rofi ${rofi}/bin/rofi \ - --replace xclip ${xclip}/bin/xclip - '' - + lib.optionalString withPass '' - install -Dm755 -t $out/bin bin/pass-import - substituteInPlace $out/bin/pass-import \ - --replace pass ${pass}/bin/pass - ''; + postInstall = '' + install -Dm755 -t $out/bin bin/git-credential-rbw + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd rbw \ + --bash <($out/bin/rbw gen-completions bash) \ + --fish <($out/bin/rbw gen-completions fish) \ + --zsh <($out/bin/rbw gen-completions zsh) + '' + + lib.optionalString withFzf '' + install -Dm755 -t $out/bin bin/rbw-fzf + substituteInPlace $out/bin/rbw-fzf \ + --replace fzf ${fzf}/bin/fzf \ + --replace perl ${perl}/bin/perl + '' + + lib.optionalString withRofi '' + install -Dm755 -t $out/bin bin/rbw-rofi + substituteInPlace $out/bin/rbw-rofi \ + --replace rofi ${rofi}/bin/rofi \ + --replace xclip ${xclip}/bin/xclip + '' + + lib.optionalString withPass '' + install -Dm755 -t $out/bin bin/pass-import + substituteInPlace $out/bin/pass-import \ + --replace pass ${pass}/bin/pass + ''; meta = { description = "Unofficial command line client for Bitwarden"; diff --git a/pkgs/by-name/rc/rc/package.nix b/pkgs/by-name/rc/rc/package.nix index c4a964fc3699..c0abd60a280a 100644 --- a/pkgs/by-name/rc/rc/package.nix +++ b/pkgs/by-name/rc/rc/package.nix @@ -65,13 +65,12 @@ stdenv.mkDerivation (finalAttrs: { installShellFiles ]; - buildInputs = - [ - ncurses - ] - ++ lib.optionals readlineSupport [ - readline - ]; + buildInputs = [ + ncurses + ] + ++ lib.optionals readlineSupport [ + readline + ]; strictDeps = true; @@ -83,13 +82,12 @@ stdenv.mkDerivation (finalAttrs: { "EDIT=${lineEditingLibrary}" ]; - buildFlags = - [ - "all" - ] - ++ lib.optionals historySupport [ - "history" - ]; + buildFlags = [ + "all" + ] + ++ lib.optionals historySupport [ + "history" + ]; postInstall = lib.optionalString historySupport '' installManPage history.1 diff --git a/pkgs/by-name/rc/rclip/package.nix b/pkgs/by-name/rc/rclip/package.nix index f00054b24a7c..dd51c9af3b17 100644 --- a/pkgs/by-name/rc/rclip/package.nix +++ b/pkgs/by-name/rc/rclip/package.nix @@ -43,7 +43,8 @@ python3Packages.buildPythonApplication rec { nativeCheckInputs = [ versionCheckHook - ] ++ (with python3Packages; [ pytestCheckHook ]); + ] + ++ (with python3Packages; [ pytestCheckHook ]); versionCheckProgramArg = "--version"; disabledTestPaths = [ diff --git a/pkgs/by-name/rc/rcodesign/package.nix b/pkgs/by-name/rc/rcodesign/package.nix index f9c3ce8e7010..8d1bcecfb011 100644 --- a/pkgs/by-name/rc/rcodesign/package.nix +++ b/pkgs/by-name/rc/rcodesign/package.nix @@ -27,22 +27,21 @@ rustPlatform.buildRustPackage rec { "--bin=rcodesign" ]; - checkFlags = - [ - # Does network IO - "--skip=cli_tests" - "--skip=ticket_lookup::test::lookup_ticket" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # These tests require Xcode to be installed - "--skip=parsed_sdk::test::find_all_sdks" - "--skip=simple_sdk::test::find_all_sdks" - "--skip=test::find_all_platform_directories" + checkFlags = [ + # Does network IO + "--skip=cli_tests" + "--skip=ticket_lookup::test::lookup_ticket" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # These tests require Xcode to be installed + "--skip=parsed_sdk::test::find_all_sdks" + "--skip=simple_sdk::test::find_all_sdks" + "--skip=test::find_all_platform_directories" - # Error: Io(Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }) - "--skip=test::find_system_xcode_applications" - "--skip=test::find_system_xcode_developer_directories" - ]; + # Error: Io(Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }) + "--skip=test::find_system_xcode_applications" + "--skip=test::find_system_xcode_developer_directories" + ]; # Set up uutils-coreutils for cli_tests. Without this, it will be installed with `cargo install`, which will fail # due to the lack of network access in the build environment. diff --git a/pkgs/by-name/rc/rcu/package.nix b/pkgs/by-name/rc/rcu/package.nix index 3f8ebd58600f..a4f37c7b3a45 100644 --- a/pkgs/by-name/rc/rcu/package.nix +++ b/pkgs/by-name/rc/rcu/package.nix @@ -61,15 +61,14 @@ python3Packages.buildPythonApplication rec { --replace-fail '/sbin/ifconfig' 'ifconfig' ''; - nativeBuildInputs = - [ - copyDesktopItems - protobuf - libsForQt5.wrapQtAppsHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + copyDesktopItems + protobuf + libsForQt5.wrapQtAppsHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; buildInputs = [ libsForQt5.qtbase @@ -103,67 +102,65 @@ python3Packages.buildPythonApplication rec { # No tests doCheck = false; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/{bin,share} - cp -r src $out/share/rcu + mkdir -p $out/{bin,share} + cp -r src $out/share/rcu - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm644 package_support/gnulinux/50-remarkable.rules $out/etc/udev/rules.d/50-remarkable.rules - '' - + '' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm644 package_support/gnulinux/50-remarkable.rules $out/etc/udev/rules.d/50-remarkable.rules + '' + + '' - # Keep source from being GC'd by linking into it + # Keep source from being GC'd by linking into it - for icondir in $(find icons -type d -name '[0-9]*x[0-9]*'); do - iconsize=$(basename $icondir) - mkdir -p $out/share/icons/hicolor/$iconsize/apps - ln -s ${src}/icons/$iconsize/rcu-icon-$iconsize.png $out/share/icons/hicolor/$iconsize/apps/rcu.png - done + for icondir in $(find icons -type d -name '[0-9]*x[0-9]*'); do + iconsize=$(basename $icondir) + mkdir -p $out/share/icons/hicolor/$iconsize/apps + ln -s ${src}/icons/$iconsize/rcu-icon-$iconsize.png $out/share/icons/hicolor/$iconsize/apps/rcu.png + done - mkdir -p $out/share/icons/hicolor/scalable/apps - ln -s ${src}/icons/64x64/rcu-icon-64x64.svg $out/share/icons/hicolor/scalable/apps/rcu.svg + mkdir -p $out/share/icons/hicolor/scalable/apps + ln -s ${src}/icons/64x64/rcu-icon-64x64.svg $out/share/icons/hicolor/scalable/apps/rcu.svg - mkdir -p $out/share/doc/rcu - for docfile in {COPYING,manual.pdf}; do - ln -s ${src}/manual/$docfile $out/share/doc/rcu/$docfile - done + mkdir -p $out/share/doc/rcu + for docfile in {COPYING,manual.pdf}; do + ln -s ${src}/manual/$docfile $out/share/doc/rcu/$docfile + done - mkdir -p $out/share/licenses/rcu - ln -s ${src}/COPYING $out/share/licenses/rcu/COPYING + mkdir -p $out/share/licenses/rcu + ln -s ${src}/COPYING $out/share/licenses/rcu/COPYING - runHook postInstall - ''; + runHook postInstall + ''; # Manually creating wrapper, hook struggles with lack of shebang & symlink dontWrapPythonPrograms = true; - preFixup = - '' - makeWrapperArgs+=( - "''${qtWrapperArgs[@]}" - --prefix PATH : ${ - lib.makeBinPath [ - coreutils - gnutar - wget - ] - } - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' + preFixup = '' + makeWrapperArgs+=( + "''${qtWrapperArgs[@]}" --prefix PATH : ${ lib.makeBinPath [ - net-tools - system-config-printer + coreutils + gnutar + wget ] } - '' - + '' - ) - ''; + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + --prefix PATH : ${ + lib.makeBinPath [ + net-tools + system-config-printer + ] + } + '' + + '' + ) + ''; postFixup = '' makeWrapper ${lib.getExe python3Packages.python} $out/bin/rcu \ diff --git a/pkgs/by-name/rd/rdesktop/package.nix b/pkgs/by-name/rd/rdesktop/package.nix index dc9f40b9cf50..4580913d5568 100644 --- a/pkgs/by-name/rd/rdesktop/package.nix +++ b/pkgs/by-name/rd/rdesktop/package.nix @@ -31,23 +31,23 @@ stdenv.mkDerivation (finalAttrs: { pkg-config autoreconfHook ]; - buildInputs = - [ - openssl - libX11 - libXcursor - libtasn1 - nettle - gnutls - ] - ++ lib.optional enableCredssp krb5 - ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + buildInputs = [ + openssl + libX11 + libXcursor + libtasn1 + nettle + gnutls + ] + ++ lib.optional enableCredssp krb5 + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; configureFlags = [ "--with-ipv6" "--with-openssl=${openssl.dev}" "--disable-smartcard" - ] ++ lib.optional (!enableCredssp) "--disable-credssp"; + ] + ++ lib.optional (!enableCredssp) "--disable-credssp"; patches = [ ./rdesktop-configure-c99.patch diff --git a/pkgs/by-name/re/re2/package.nix b/pkgs/by-name/re/re2/package.nix index 8781413e48ba..0afcc9c6b974 100644 --- a/pkgs/by-name/re/re2/package.nix +++ b/pkgs/by-name/re/re2/package.nix @@ -43,15 +43,14 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ abseil-cpp ] ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ icu ]; - cmakeFlags = - [ - (lib.cmakeBool "RE2_BUILD_TESTING" true) - (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--timeout;999999") - ] - ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ - (lib.cmakeBool "RE2_USE_ICU" true) - (lib.cmakeBool "BUILD_SHARED_LIBS" true) - ]; + cmakeFlags = [ + (lib.cmakeBool "RE2_BUILD_TESTING" true) + (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--timeout;999999") + ] + ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ + (lib.cmakeBool "RE2_USE_ICU" true) + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + ]; doCheck = true; diff --git a/pkgs/by-name/re/readsb/package.nix b/pkgs/by-name/re/readsb/package.nix index bd48bf6cd134..232bb4f638ee 100644 --- a/pkgs/by-name/re/readsb/package.nix +++ b/pkgs/by-name/re/readsb/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ # set something for version, we removed the original value in postPatch "READSB_VERSION=${finalAttrs.version}" - ] ++ (lib.lists.optional (rtl-sdr != null) "RTLSDR=yes"); + ] + ++ (lib.lists.optional (rtl-sdr != null) "RTLSDR=yes"); doCheck = true; checkTarget = "cprtest"; diff --git a/pkgs/by-name/re/rebels-in-the-sky/package.nix b/pkgs/by-name/re/rebels-in-the-sky/package.nix index 7a8cf044293f..8f8533357d87 100644 --- a/pkgs/by-name/re/rebels-in-the-sky/package.nix +++ b/pkgs/by-name/re/rebels-in-the-sky/package.nix @@ -29,14 +29,13 @@ rustPlatform.buildRustPackage (finalAttrs: { ./disable-radio.patch ]; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - rustPlatform.bindgenHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + rustPlatform.bindgenHook + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; nativeCheckInputs = [ diff --git a/pkgs/by-name/re/recastnavigation/package.nix b/pkgs/by-name/re/recastnavigation/package.nix index a4f6fc59b948..b93d17aecbb9 100644 --- a/pkgs/by-name/re/recastnavigation/package.nix +++ b/pkgs/by-name/re/recastnavigation/package.nix @@ -22,21 +22,20 @@ stdenv.mkDerivation { sha256 = "sha256-WVzDI7+UuAl10Tm1Zjkea/FMk0cIe7pWg0iyFLbwAdI="; }; - postPatch = - '' - cp ${catch}/include/catch/catch.hpp Tests/catch.hpp + postPatch = '' + cp ${catch}/include/catch/catch.hpp Tests/catch.hpp - # https://github.com/recastnavigation/recastnavigation/issues/524 - substituteInPlace CMakeLists.txt \ - --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ - --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Expects SDL2.framework in specific location, which we don't have - # Change where SDL2 headers are searched for to match what we do have - substituteInPlace RecastDemo/CMakeLists.txt \ - --replace 'include_directories(''${SDL2_LIBRARY}/Headers)' 'include_directories(${lib.getInclude SDL2}/include/SDL2)' - ''; + # https://github.com/recastnavigation/recastnavigation/issues/524 + substituteInPlace CMakeLists.txt \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Expects SDL2.framework in specific location, which we don't have + # Change where SDL2 headers are searched for to match what we do have + substituteInPlace RecastDemo/CMakeLists.txt \ + --replace 'include_directories(''${SDL2_LIBRARY}/Headers)' 'include_directories(${lib.getInclude SDL2}/include/SDL2)' + ''; doCheck = true; diff --git a/pkgs/by-name/re/recordbox/package.nix b/pkgs/by-name/re/recordbox/package.nix index d5631143f6da..143098d63c8a 100644 --- a/pkgs/by-name/re/recordbox/package.nix +++ b/pkgs/by-name/re/recordbox/package.nix @@ -65,21 +65,20 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook4 ]; - buildInputs = - [ - gtk4 - hicolor-icon-theme - libadwaita - sqlite - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gst-plugins-rs - gst-plugins-ugly - gstreamer - ]); + buildInputs = [ + gtk4 + hicolor-icon-theme + libadwaita + sqlite + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-rs + gst-plugins-ugly + gstreamer + ]); mesonBuildType = "release"; diff --git a/pkgs/by-name/re/recutils/package.nix b/pkgs/by-name/re/recutils/package.nix index 1487047257a5..91421c9eac0d 100644 --- a/pkgs/by-name/re/recutils/package.nix +++ b/pkgs/by-name/re/recutils/package.nix @@ -41,20 +41,19 @@ stdenv.mkDerivation rec { "--with-bash-headers=${bash.dev}/include/bash" ]; - buildInputs = - [ - curl - ] - ++ lib.optionals withEncryption [ - libgpg-error.dev - libgcrypt.dev - ] - ++ lib.optionals withUuid [ - libuuid - ] - ++ lib.optionals withBashBuiltins [ - bash.dev - ]; + buildInputs = [ + curl + ] + ++ lib.optionals withEncryption [ + libgpg-error.dev + libgcrypt.dev + ] + ++ lib.optionals withUuid [ + libuuid + ] + ++ lib.optionals withBashBuiltins [ + bash.dev + ]; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.cc.isClang [ diff --git a/pkgs/by-name/re/redict/package.nix b/pkgs/by-name/re/redict/package.nix index cbda55fa8b01..eacfc8278357 100644 --- a/pkgs/by-name/re/redict/package.nix +++ b/pkgs/by-name/re/redict/package.nix @@ -44,25 +44,27 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ lua ] - ++ lib.optional useSystemJemalloc jemalloc - ++ lib.optional withSystemd systemd - ++ lib.optionals tlsSupport [ openssl ]; + buildInputs = [ + lua + ] + ++ lib.optional useSystemJemalloc jemalloc + ++ lib.optional withSystemd systemd + ++ lib.optionals tlsSupport [ openssl ]; preBuild = lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace src/Makefile --replace-fail "-flto" "" ''; # More cross-compiling fixes. - makeFlags = - [ "PREFIX=${placeholder "out"}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "AR=${stdenv.cc.targetPrefix}ar" - "RANLIB=${stdenv.cc.targetPrefix}ranlib" - ] - ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] - ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "AR=${stdenv.cc.targetPrefix}ar" + "RANLIB=${stdenv.cc.targetPrefix}ranlib" + ] + ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] + ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; enableParallelBuilding = true; @@ -77,7 +79,8 @@ stdenv.mkDerivation (finalAttrs: { which tcl ps - ] ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ]; + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ]; checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/re/redis-plus-plus/package.nix b/pkgs/by-name/re/redis-plus-plus/package.nix index 40cd5a4224e1..4960b55f701f 100644 --- a/pkgs/by-name/re/redis-plus-plus/package.nix +++ b/pkgs/by-name/re/redis-plus-plus/package.nix @@ -29,16 +29,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; propagatedBuildInputs = [ hiredis ]; - cmakeFlags = - [ - "-DREDIS_PLUS_PLUS_BUILD_TEST=OFF" - ] - ++ lib.optionals (!enableShared) [ - "-DREDIS_PLUS_PLUS_BUILD_SHARED=OFF" - ] - ++ lib.optionals (!enableStatic) [ - "-DREDIS_PLUS_PLUS_BUILD_STATIC=OFF" - ]; + cmakeFlags = [ + "-DREDIS_PLUS_PLUS_BUILD_TEST=OFF" + ] + ++ lib.optionals (!enableShared) [ + "-DREDIS_PLUS_PLUS_BUILD_SHARED=OFF" + ] + ++ lib.optionals (!enableStatic) [ + "-DREDIS_PLUS_PLUS_BUILD_STATIC=OFF" + ]; meta = with lib; { homepage = "https://github.com/sewenew/redis-plus-plus"; diff --git a/pkgs/by-name/re/redis/package.nix b/pkgs/by-name/re/redis/package.nix index fde38883f7f5..8871982a91a5 100644 --- a/pkgs/by-name/re/redis/package.nix +++ b/pkgs/by-name/re/redis/package.nix @@ -46,21 +46,23 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ lua ] - ++ lib.optional useSystemJemalloc jemalloc - ++ lib.optional withSystemd systemd - ++ lib.optional tlsSupport openssl; + buildInputs = [ + lua + ] + ++ lib.optional useSystemJemalloc jemalloc + ++ lib.optional withSystemd systemd + ++ lib.optional tlsSupport openssl; # More cross-compiling fixes. - makeFlags = - [ "PREFIX=${placeholder "out"}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "AR=${stdenv.cc.targetPrefix}ar" - "RANLIB=${stdenv.cc.targetPrefix}ranlib" - ] - ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] - ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "AR=${stdenv.cc.targetPrefix}ar" + "RANLIB=${stdenv.cc.targetPrefix}ranlib" + ] + ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] + ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; enableParallelBuilding = true; @@ -74,7 +76,8 @@ stdenv.mkDerivation (finalAttrs: { which tcl ps - ] ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ]; + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ]; checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/re/redo-apenwarr/package.nix b/pkgs/by-name/re/redo-apenwarr/package.nix index 30a6feafbf13..45ea6d9c2d76 100644 --- a/pkgs/by-name/re/redo-apenwarr/package.nix +++ b/pkgs/by-name/re/redo-apenwarr/package.nix @@ -22,31 +22,30 @@ stdenv.mkDerivation rec { sha256 = "/QIMXpVhVLAIJa3LiOlRKzbUztIWZygkWZUKN4Nrh+M="; }; - postPatch = - '' + postPatch = '' - patchShebangs minimal/do + patchShebangs minimal/do - '' - + lib.optionalString doCheck '' - unset CC CXX + '' + + lib.optionalString doCheck '' + unset CC CXX - substituteInPlace minimal/do.test \ - --replace "/bin/pwd" "${coreutils}/bin/pwd" + substituteInPlace minimal/do.test \ + --replace "/bin/pwd" "${coreutils}/bin/pwd" - substituteInPlace t/105-sympath/all.do \ - --replace "/bin/pwd" "${coreutils}/bin/pwd" + substituteInPlace t/105-sympath/all.do \ + --replace "/bin/pwd" "${coreutils}/bin/pwd" - substituteInPlace t/all.do \ - --replace "/bin/ls" "ls" + substituteInPlace t/all.do \ + --replace "/bin/ls" "ls" - substituteInPlace t/110-compile/hello.o.do \ - --replace "/usr/include" "${lib.getDev stdenv.cc.libc}/include" + substituteInPlace t/110-compile/hello.o.do \ + --replace "/usr/include" "${lib.getDev stdenv.cc.libc}/include" - substituteInPlace t/200-shell/nonshelltest.do \ - --replace "/usr/bin/env perl" "${perl}/bin/perl" + substituteInPlace t/200-shell/nonshelltest.do \ + --replace "/usr/bin/env perl" "${perl}/bin/perl" - ''; + ''; inherit doCheck; diff --git a/pkgs/by-name/re/refind/package.nix b/pkgs/by-name/re/refind/package.nix index 29f684f86ef8..2a1bbada13a2 100644 --- a/pkgs/by-name/re/refind/package.nix +++ b/pkgs/by-name/re/refind/package.nix @@ -58,20 +58,19 @@ stdenv.mkDerivation rec { hardeningDisable = [ "stackprotector" ]; - makeFlags = - [ - "prefix=" - "EFIINC=${gnu-efi_3}/include/efi" - "EFILIB=${gnu-efi_3}/lib" - "GNUEFILIB=${gnu-efi_3}/lib" - "EFICRT0=${gnu-efi_3}/lib" - "HOSTARCH=${hostarch}" - "ARCH=${hostarch}" - ] - ++ lib.optional stdenv.hostPlatform.isAarch64 [ - # aarch64 is special for GNU-EFI, see BUILDING.txt - "GNUEFI_ARM64_TARGET_SUPPORT=y" - ]; + makeFlags = [ + "prefix=" + "EFIINC=${gnu-efi_3}/include/efi" + "EFILIB=${gnu-efi_3}/lib" + "GNUEFILIB=${gnu-efi_3}/lib" + "EFICRT0=${gnu-efi_3}/lib" + "HOSTARCH=${hostarch}" + "ARCH=${hostarch}" + ] + ++ lib.optional stdenv.hostPlatform.isAarch64 [ + # aarch64 is special for GNU-EFI, see BUILDING.txt + "GNUEFI_ARM64_TARGET_SUPPORT=y" + ]; buildFlags = [ "gnuefi" diff --git a/pkgs/by-name/re/refine/package.nix b/pkgs/by-name/re/refine/package.nix index 5d14b4100b56..2a261744fdf5 100644 --- a/pkgs/by-name/re/refine/package.nix +++ b/pkgs/by-name/re/refine/package.nix @@ -50,14 +50,13 @@ python3Packages.buildPythonApplication rec { libadwaita ]; - dependencies = - [ - libportal - libportal-gtk4 - ] - ++ (with python3Packages; [ - pygobject3 - ]); + dependencies = [ + libportal + libportal-gtk4 + ] + ++ (with python3Packages; [ + pygobject3 + ]); strictDeps = true; diff --git a/pkgs/by-name/re/regripper/package.nix b/pkgs/by-name/re/regripper/package.nix index 82f615ea1dd6..982a34d6ee52 100644 --- a/pkgs/by-name/re/regripper/package.nix +++ b/pkgs/by-name/re/regripper/package.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation { propagatedBuildInputs = [ perl - ] ++ perlDeps; + ] + ++ perlDeps; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/re/rehex/package.nix b/pkgs/by-name/re/rehex/package.nix index 231036543d19..2749549d189e 100644 --- a/pkgs/by-name/re/rehex/package.nix +++ b/pkgs/by-name/re/rehex/package.nix @@ -35,31 +35,32 @@ stdenv.mkDerivation rec { which wrapGAppsHook3 zip - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libicns ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libicns ]; - buildInputs = - [ - botan3 - capstone - jansson - libunistring - wxGTK32 - ] - ++ (with lua53Packages; [ - lua - busted - ]) - ++ (with perlPackages; [ - perl - TemplateToolkit - ]) - ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk3 ]; + buildInputs = [ + botan3 + capstone + jansson + libunistring + wxGTK32 + ] + ++ (with lua53Packages; [ + lua + busted + ]) + ++ (with perlPackages; [ + perl + TemplateToolkit + ]) + ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk3 ]; makeFlags = [ "prefix=${placeholder "out"}" "BOTAN_PKG=botan-3" "CXXSTD=-std=c++20" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-f Makefile.osx" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-f Makefile.osx" ]; env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_LDFLAGS = "-liconv"; diff --git a/pkgs/by-name/re/remmina/package.nix b/pkgs/by-name/re/remmina/package.nix index eadf47a271b9..6909a247529f 100644 --- a/pkgs/by-name/re/remmina/package.nix +++ b/pkgs/by-name/re/remmina/package.nix @@ -65,69 +65,68 @@ stdenv.mkDerivation (finalAttrs: { ninja pkg-config wrapGAppsHook3 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; - buildInputs = - [ - curl - gsettings-desktop-schemas - glib - gtk3 - gettext - libxkbfile - libX11 - freerdp - libssh - libgcrypt - gnutls - pcre2 - libvncserver - libpthreadstubs - libXdmcp - libxkbcommon - libsoup_3 - spice-protocol - spice-gtk - libepoxy - at-spi2-core - openssl - adwaita-icon-theme - json-glib - libsodium - harfbuzz - python3 - wayland - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - fuse3 - libappindicator-gtk3 - libdbusmenu-gtk3 - ] - ++ lib.optionals withLibsecret [ libsecret ] - ++ lib.optionals withKf5Wallet [ libsForQt5.kwallet ] - ++ lib.optionals withWebkitGtk [ webkitgtk_4_1 ] - ++ lib.optionals withVte [ vte ]; + buildInputs = [ + curl + gsettings-desktop-schemas + glib + gtk3 + gettext + libxkbfile + libX11 + freerdp + libssh + libgcrypt + gnutls + pcre2 + libvncserver + libpthreadstubs + libXdmcp + libxkbcommon + libsoup_3 + spice-protocol + spice-gtk + libepoxy + at-spi2-core + openssl + adwaita-icon-theme + json-glib + libsodium + harfbuzz + python3 + wayland + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + fuse3 + libappindicator-gtk3 + libdbusmenu-gtk3 + ] + ++ lib.optionals withLibsecret [ libsecret ] + ++ lib.optionals withKf5Wallet [ libsForQt5.kwallet ] + ++ lib.optionals withWebkitGtk [ webkitgtk_4_1 ] + ++ lib.optionals withVte [ vte ]; env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - cmakeFlags = - [ - "-DWITH_FREERDP3=ON" - "-DWITH_VTE=${if withVte then "ON" else "OFF"}" - "-DWITH_TELEPATHY=OFF" - "-DWITH_AVAHI=OFF" - "-DWITH_KF5WALLET=${if withKf5Wallet then "ON" else "OFF"}" - "-DWITH_LIBSECRET=${if withLibsecret then "ON" else "OFF"}" - "-DWITH_WEBKIT2GTK=${if withWebkitGtk then "ON" else "OFF"}" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DHAVE_LIBAPPINDICATOR=OFF" - "-DWITH_CUPS=OFF" - "-DWITH_ICON_CACHE=OFF" - # Don't use system installed Python like on GitHub Actions runners - "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}" - "-DPYTHON_LIBRARY=${python3}/lib/libpython${python3.pythonVersion}${stdenv.hostPlatform.extensions.sharedLibrary}" - ]; + cmakeFlags = [ + "-DWITH_FREERDP3=ON" + "-DWITH_VTE=${if withVte then "ON" else "OFF"}" + "-DWITH_TELEPATHY=OFF" + "-DWITH_AVAHI=OFF" + "-DWITH_KF5WALLET=${if withKf5Wallet then "ON" else "OFF"}" + "-DWITH_LIBSECRET=${if withLibsecret then "ON" else "OFF"}" + "-DWITH_WEBKIT2GTK=${if withWebkitGtk then "ON" else "OFF"}" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DHAVE_LIBAPPINDICATOR=OFF" + "-DWITH_CUPS=OFF" + "-DWITH_ICON_CACHE=OFF" + # Don't use system installed Python like on GitHub Actions runners + "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}" + "-DPYTHON_LIBRARY=${python3}/lib/libpython${python3.pythonVersion}${stdenv.hostPlatform.extensions.sharedLibrary}" + ]; dontWrapQtApps = true; diff --git a/pkgs/by-name/re/renderdoc/package.nix b/pkgs/by-name/re/renderdoc/package.nix index ae571d74e7ec..314d16b76b23 100644 --- a/pkgs/by-name/re/renderdoc/package.nix +++ b/pkgs/by-name/re/renderdoc/package.nix @@ -48,20 +48,19 @@ stdenv.mkDerivation (finalAttrs: { "doc" ]; - buildInputs = - [ - libXdmcp - libpthreadstubs - python312Packages.pyside2 - python312Packages.pyside2-tools - python312Packages.shiboken2 - qt5.qtbase - qt5.qtsvg - vulkan-loader - ] - ++ lib.optionals waylandSupport [ - wayland - ]; + buildInputs = [ + libXdmcp + libpthreadstubs + python312Packages.pyside2 + python312Packages.pyside2-tools + python312Packages.shiboken2 + qt5.qtbase + qt5.qtsvg + vulkan-loader + ] + ++ lib.optionals waylandSupport [ + wayland + ]; nativeBuildInputs = [ addDriverRunpath diff --git a/pkgs/by-name/re/renovate/package.nix b/pkgs/by-name/re/renovate/package.nix index 02cce1cf0d22..7a82cd0555d0 100644 --- a/pkgs/by-name/re/renovate/package.nix +++ b/pkgs/by-name/re/renovate/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation (finalAttrs: { pnpm_10.configHook python3 yq-go - ] ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; pnpmDeps = pnpm_10.fetchDeps { inherit (finalAttrs) pname version src; @@ -45,32 +46,31 @@ stdenv.mkDerivation (finalAttrs: { env.COREPACK_ENABLE_STRICT = 0; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - # relax nodejs version - yq '.engines.node = "${nodejs.version}"' -i package.json + # relax nodejs version + yq '.engines.node = "${nodejs.version}"' -i package.json - pnpm build - find -name 'node_modules' -type d -exec rm -rf {} \; || true - pnpm install --offline --prod --ignore-scripts - '' - # The optional dependency re2 is not built by pnpm and needs to be built manually. - # If re2 is not built, you will get an annoying warning when you run renovate. - + '' - pushd node_modules/.pnpm/re2*/node_modules/re2 + pnpm build + find -name 'node_modules' -type d -exec rm -rf {} \; || true + pnpm install --offline --prod --ignore-scripts + '' + # The optional dependency re2 is not built by pnpm and needs to be built manually. + # If re2 is not built, you will get an annoying warning when you run renovate. + + '' + pushd node_modules/.pnpm/re2*/node_modules/re2 - mkdir -p $HOME/.node-gyp/${nodejs.version} - echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion - ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version} - export npm_config_nodedir=${nodejs} - npm run rebuild + mkdir -p $HOME/.node-gyp/${nodejs.version} + echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion + ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version} + export npm_config_nodedir=${nodejs} + npm run rebuild - popd + popd - runHook postBuild - ''; + runHook postBuild + ''; # TODO: replace with `pnpm deploy` # now it fails to build with ERR_PNPM_NO_OFFLINE_META diff --git a/pkgs/by-name/re/renpy/package.nix b/pkgs/by-name/re/renpy/package.nix index 51ef113f9f03..06159e74d14c 100644 --- a/pkgs/by-name/re/renpy/package.nix +++ b/pkgs/by-name/re/renpy/package.nix @@ -41,29 +41,28 @@ stdenv.mkDerivation (finalAttrs: { python.pkgs.setuptools ]; - buildInputs = - [ - ffmpeg - freetype - fribidi - glew - harfbuzz - libGL - libGLU - libpng - SDL2 - zlib - ] - ++ (with python.pkgs; [ - ecdsa - future - pefile - pygame-sdl2 - python - requests - six - tkinter - ]); + buildInputs = [ + ffmpeg + freetype + fribidi + glew + harfbuzz + libGL + libGLU + libpng + SDL2 + zlib + ] + ++ (with python.pkgs; [ + ecdsa + future + pefile + pygame-sdl2 + python + requests + six + tkinter + ]); RENPY_DEPS_INSTALL = lib.concatStringsSep "::" ( [ @@ -88,7 +87,8 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./shutup-erofs-errors.patch ./5687.patch - ] ++ lib.optional withoutSteam ./noSteam.patch; + ] + ++ lib.optional withoutSteam ./noSteam.patch; postPatch = '' cp tutorial/game/tutorial_director.rpy{m,} diff --git a/pkgs/by-name/re/repgrep/package.nix b/pkgs/by-name/re/repgrep/package.nix index 3f0d0cd8f5f1..d56e5ed54347 100644 --- a/pkgs/by-name/re/repgrep/package.nix +++ b/pkgs/by-name/re/repgrep/package.nix @@ -29,22 +29,21 @@ rustPlatform.buildRustPackage rec { makeWrapper ]; - postInstall = - '' - wrapProgram $out/bin/rgr \ - --prefix PATH : ${lib.makeBinPath [ ripgrep ]} + postInstall = '' + wrapProgram $out/bin/rgr \ + --prefix PATH : ${lib.makeBinPath [ ripgrep ]} - pushd "$(dirname "$(find -path '**/repgrep-stamp' | head -n 1)")" - installManPage rgr.1 - popd - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # As it can be seen here: https://github.com/acheronfail/repgrep/blob/0.16.1/.github/workflows/release.yml#L206, the completions are just the same as ripgrep - installShellCompletion --cmd rgr \ - --bash <(${lib.getExe ripgrep} --generate complete-bash | sed 's/-c rg/-c rgr/') \ - --zsh <(${lib.getExe ripgrep} --generate complete-zsh | sed 's/-c rg/-c rgr/') \ - --fish <(${lib.getExe ripgrep} --generate complete-fish | sed 's/-c rg/-c rgr/') - ''; + pushd "$(dirname "$(find -path '**/repgrep-stamp' | head -n 1)")" + installManPage rgr.1 + popd + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # As it can be seen here: https://github.com/acheronfail/repgrep/blob/0.16.1/.github/workflows/release.yml#L206, the completions are just the same as ripgrep + installShellCompletion --cmd rgr \ + --bash <(${lib.getExe ripgrep} --generate complete-bash | sed 's/-c rg/-c rgr/') \ + --zsh <(${lib.getExe ripgrep} --generate complete-zsh | sed 's/-c rg/-c rgr/') \ + --fish <(${lib.getExe ripgrep} --generate complete-fish | sed 's/-c rg/-c rgr/') + ''; meta = with lib; { description = "Interactive replacer for ripgrep that makes it easy to find and replace across files on the command line"; diff --git a/pkgs/by-name/re/repseek/package.nix b/pkgs/by-name/re/repseek/package.nix index 90c306f66a88..013b4ca2b104 100644 --- a/pkgs/by-name/re/repseek/package.nix +++ b/pkgs/by-name/re/repseek/package.nix @@ -12,16 +12,15 @@ stdenv.mkDerivation rec { sha256 = "1jiknji3ivrv7zmrfbf2mccfpdwhin3lfxfsciaqwf69b3sda8nf"; }; - preConfigure = - '' - mkdir -p $out/bin - substituteInPlace Makefile \ - --replace "INSTALLDIR = \$\$HOME/bin" "INSTALLDIR = $out/bin/" \ - --replace "CC= gcc" "CC = $CC" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace Makefile --replace "MACHINE = MACOSX" "MACHINE = LINUX" - ''; + preConfigure = '' + mkdir -p $out/bin + substituteInPlace Makefile \ + --replace "INSTALLDIR = \$\$HOME/bin" "INSTALLDIR = $out/bin/" \ + --replace "CC= gcc" "CC = $CC" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace Makefile --replace "MACHINE = MACOSX" "MACHINE = LINUX" + ''; meta = { description = "Tool to retrieve approximate repeats from large DNA sequences"; diff --git a/pkgs/by-name/re/rerun/package.nix b/pkgs/by-name/re/rerun/package.nix index 32efff71fbcc..8201ce2b563c 100644 --- a/pkgs/by-name/re/rerun/package.nix +++ b/pkgs/by-name/re/rerun/package.nix @@ -107,7 +107,8 @@ rustPlatform.buildRustPackage (finalAttrs: { (lib.getDev openssl) libxkbcommon vulkan-loader - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib wayland) ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib wayland) ]; addDlopenRunpaths = map (p: "${lib.getLib p}/lib") ( lib.optionals stdenv.hostPlatform.isLinux [ diff --git a/pkgs/by-name/re/resonance/package.nix b/pkgs/by-name/re/resonance/package.nix index e2b89e9027e3..2a9537fef555 100644 --- a/pkgs/by-name/re/resonance/package.nix +++ b/pkgs/by-name/re/resonance/package.nix @@ -50,24 +50,23 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook4 ]; - buildInputs = - [ - dbus - glib - gtk4 - libadwaita - libxml2 - openssl - sqlite - ] - ++ (with gst_all_1; [ - gst-libav - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gstreamer - ]); + buildInputs = [ + dbus + glib + gtk4 + libadwaita + libxml2 + openssl + sqlite + ] + ++ (with gst_all_1; [ + gst-libav + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gstreamer + ]); preFixup = '' gappsWrapperArgs+=(--prefix PYTHONPATH : ${ diff --git a/pkgs/by-name/re/restic-browser/package.nix b/pkgs/by-name/re/restic-browser/package.nix index 415dd5cdc27b..79797928529d 100644 --- a/pkgs/by-name/re/restic-browser/package.nix +++ b/pkgs/by-name/re/restic-browser/package.nix @@ -33,17 +33,16 @@ rustPlatform.buildRustPackage rec { hash = "sha256-U82hVPfVd12vBeDT3PHexwmc9OitkuxTugYRe4Z/3eo="; }; - nativeBuildInputs = - [ - cargo-tauri_1.hook + nativeBuildInputs = [ + cargo-tauri_1.hook - nodejs - npmHooks.npmConfigHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - wrapGAppsHook3 - ]; + nodejs + npmHooks.npmConfigHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + wrapGAppsHook3 + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ webkitgtk_4_0 diff --git a/pkgs/by-name/re/restic/package.nix b/pkgs/by-name/re/restic/package.nix index 1580c2c247fd..795389d734b2 100644 --- a/pkgs/by-name/re/restic/package.nix +++ b/pkgs/by-name/re/restic/package.nix @@ -45,19 +45,18 @@ buildGoModule rec { rm cmd/restic/cmd_mount_integration_test.go ''; - postInstall = - '' - wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin' - '' - + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' - $out/bin/restic generate \ - --bash-completion restic.bash \ - --fish-completion restic.fish \ - --zsh-completion restic.zsh \ - --man . - installShellCompletion restic.{bash,fish,zsh} - installManPage *.1 - ''; + postInstall = '' + wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin' + '' + + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + $out/bin/restic generate \ + --bash-completion restic.bash \ + --fish-completion restic.fish \ + --zsh-completion restic.zsh \ + --man . + installShellCompletion restic.{bash,fish,zsh} + installManPage *.1 + ''; meta = with lib; { homepage = "https://restic.net"; diff --git a/pkgs/by-name/re/restinio/package.nix b/pkgs/by-name/re/restinio/package.nix index d25254c00e52..cff1d36155c4 100644 --- a/pkgs/by-name/re/restinio/package.nix +++ b/pkgs/by-name/re/restinio/package.nix @@ -42,24 +42,23 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; - propagatedBuildInputs = - [ - expected-lite - fmt - openssl - pcre2 - zlib - ] - ++ ( - if with_boost_asio then - [ - boost - ] - else - [ - asio - ] - ); + propagatedBuildInputs = [ + expected-lite + fmt + openssl + pcre2 + zlib + ] + ++ ( + if with_boost_asio then + [ + boost + ] + else + [ + asio + ] + ); buildInputs = [ catch2_3 diff --git a/pkgs/by-name/re/retdec/package.nix b/pkgs/by-name/re/retdec/package.nix index 7fbfb826cbde..9b442ca081ae 100644 --- a/pkgs/by-name/re/retdec/package.nix +++ b/pkgs/by-name/re/retdec/package.nix @@ -64,16 +64,15 @@ let }; retdec-support-version = "2019-03-08"; - retdec-support = - { - rev = retdec-support-version; - } - # for checking the version against the expected version - // fetchzip { - url = "https://github.com/avast-tl/retdec-support/releases/download/${retdec-support-version}/retdec-support_${retdec-support-version}.tar.xz"; - hash = "sha256-t1tx4MfLW/lwtbO5JQ1nrFBIOeMclq+0dENuXW+ahIM="; - stripRoot = false; - }; + retdec-support = { + rev = retdec-support-version; + } + # for checking the version against the expected version + // fetchzip { + url = "https://github.com/avast-tl/retdec-support/releases/download/${retdec-support-version}/retdec-support_${retdec-support-version}.tar.xz"; + hash = "sha256-t1tx4MfLW/lwtbO5JQ1nrFBIOeMclq+0dENuXW+ahIM="; + stripRoot = false; + }; check-dep = name: dep: '' context="$(grep ${name}_URL --after-context 1 cmake/deps.cmake)" @@ -87,19 +86,18 @@ let fi ''; - deps = - { - CAPSTONE = capstone; - LLVM = llvm; - YARA = yaracpp; - YARAMOD = yaramod; - SUPPORT_PKG = retdec-support; - } - // lib.optionalAttrs enableTests { - KEYSTONE = keystone; - # nixpkgs googletest is used - # GOOGLETEST = googletest; - }; + deps = { + CAPSTONE = capstone; + LLVM = llvm; + YARA = yaracpp; + YARAMOD = yaramod; + SUPPORT_PKG = retdec-support; + } + // lib.optionalAttrs enableTests { + KEYSTONE = keystone; + # nixpkgs googletest is used + # GOOGLETEST = googletest; + }; # overwrite install-share.py to copy instead of download. # we use this so the copy happens at the right time in the build, @@ -162,63 +160,63 @@ stdenv.mkDerivation (self: { libffi libxml2 zlib - ] ++ lib.optional self.doInstallCheck gtest; + ] + ++ lib.optional self.doInstallCheck gtest; cmakeFlags = [ (lib.cmakeBool "RETDEC_TESTS" self.doInstallCheck) # build tests (lib.cmakeBool "RETDEC_DEV_TOOLS" buildDevTools) # build tools e.g. capstone2llvmir, retdectool (lib.cmakeBool "RETDEC_COMPILE_YARA" compileYaraPatterns) # build and install compiled patterns - ] ++ lib.mapAttrsToList (k: v: lib.cmakeFeature "${k}_URL" "${v}") deps; + ] + ++ lib.mapAttrsToList (k: v: lib.cmakeFeature "${k}_URL" "${v}") deps; - preConfigure = - lib.concatStringsSep "\n" (lib.mapAttrsToList check-dep deps) - + '' - cp -v ${install-share} ./support/install-share.py + preConfigure = lib.concatStringsSep "\n" (lib.mapAttrsToList check-dep deps) + '' + cp -v ${install-share} ./support/install-share.py - # the CMakeLists assume CMAKE_INSTALL_BINDIR, etc are path components but in Nix, they are absolute. - # therefore, we need to remove the unnecessary CMAKE_INSTALL_PREFIX prepend. - substituteInPlace ./CMakeLists.txt \ - --replace-warn "''$"{CMAKE_INSTALL_PREFIX}/"''$"{RETDEC_INSTALL_BIN_DIR} "''$"{CMAKE_INSTALL_FULL_BINDIR} \ - --replace-warn "''$"{CMAKE_INSTALL_PREFIX}/"''$"{RETDEC_INSTALL_LIB_DIR} "''$"{CMAKE_INSTALL_FULL_LIBDIR} \ + # the CMakeLists assume CMAKE_INSTALL_BINDIR, etc are path components but in Nix, they are absolute. + # therefore, we need to remove the unnecessary CMAKE_INSTALL_PREFIX prepend. + substituteInPlace ./CMakeLists.txt \ + --replace-warn "''$"{CMAKE_INSTALL_PREFIX}/"''$"{RETDEC_INSTALL_BIN_DIR} "''$"{CMAKE_INSTALL_FULL_BINDIR} \ + --replace-warn "''$"{CMAKE_INSTALL_PREFIX}/"''$"{RETDEC_INSTALL_LIB_DIR} "''$"{CMAKE_INSTALL_FULL_LIBDIR} \ - # --replace "''$"{CMAKE_INSTALL_PREFIX}/"''$"{RETDEC_INSTALL_SUPPORT_DIR} "''$"{RETDEC_INSTALL_SUPPORT_DIR} - # note! Nix does not set CMAKE_INSTALL_DATADIR to an absolute path, so this replacement would be incorrect + # --replace "''$"{CMAKE_INSTALL_PREFIX}/"''$"{RETDEC_INSTALL_SUPPORT_DIR} "''$"{RETDEC_INSTALL_SUPPORT_DIR} + # note! Nix does not set CMAKE_INSTALL_DATADIR to an absolute path, so this replacement would be incorrect - # similarly for yaramod. here, we fix the LIBDIR to lib64. for whatever reason, only "lib64" works. - substituteInPlace deps/yaramod/CMakeLists.txt \ - --replace-fail "''$"{YARAMOD_INSTALL_DIR}/"''$"{CMAKE_INSTALL_LIBDIR} "''$"{YARAMOD_INSTALL_DIR}/lib64 \ - --replace-fail CMAKE_ARGS 'CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=lib64' + # similarly for yaramod. here, we fix the LIBDIR to lib64. for whatever reason, only "lib64" works. + substituteInPlace deps/yaramod/CMakeLists.txt \ + --replace-fail "''$"{YARAMOD_INSTALL_DIR}/"''$"{CMAKE_INSTALL_LIBDIR} "''$"{YARAMOD_INSTALL_DIR}/lib64 \ + --replace-fail CMAKE_ARGS 'CMAKE_ARGS -DCMAKE_INSTALL_LIBDIR=lib64' - # yara needs write permissions in the generated source directory. - echo ${lib.escapeShellArg '' - ExternalProject_Add_Step( - yara chmod WORKING_DIRECTORY ''${YARA_DIR} - DEPENDEES download COMMAND chmod -R u+w . - ) - ''} >> deps/yara/CMakeLists.txt + # yara needs write permissions in the generated source directory. + echo ${lib.escapeShellArg '' + ExternalProject_Add_Step( + yara chmod WORKING_DIRECTORY ''${YARA_DIR} + DEPENDEES download COMMAND chmod -R u+w . + ) + ''} >> deps/yara/CMakeLists.txt - # patch gtest to use the system package - gtest=deps/googletest/CMakeLists.txt - old="$(cat $gtest)" - (echo 'find_package(GTest REQUIRED)'; echo "$old") > $gtest - sed -i 's/ExternalProject_[^(]\+[(]/ set(IGNORED /g' $gtest + # patch gtest to use the system package + gtest=deps/googletest/CMakeLists.txt + old="$(cat $gtest)" + (echo 'find_package(GTest REQUIRED)'; echo "$old") > $gtest + sed -i 's/ExternalProject_[^(]\+[(]/ set(IGNORED /g' $gtest - substituteInPlace $gtest \ - --replace-fail '$'{GTEST_LIB} "GTest::gtest"\ - --replace-fail '$'{GMOCK_LIB} "GTest::gmock"\ - --replace-fail '$'{GTEST_MAIN_LIB} "GTest::gtest_main"\ - --replace-fail '$'{GMOCK_MAIN_LIB} "GTest::gmock_main" + substituteInPlace $gtest \ + --replace-fail '$'{GTEST_LIB} "GTest::gtest"\ + --replace-fail '$'{GMOCK_LIB} "GTest::gmock"\ + --replace-fail '$'{GTEST_MAIN_LIB} "GTest::gtest_main"\ + --replace-fail '$'{GMOCK_MAIN_LIB} "GTest::gmock_main" - # without git history, there is no chance these tests will pass. - substituteInPlace tests/utils/version_tests.cpp \ - --replace-quiet VersionTests DISABLED_VersionTests + # without git history, there is no chance these tests will pass. + substituteInPlace tests/utils/version_tests.cpp \ + --replace-quiet VersionTests DISABLED_VersionTests - substituteInPlace scripts/retdec-utils.py \ - --replace-warn /usr/bin/time ${time} \ - --replace-warn /usr/local/bin/gtime ${time} - substituteInPlace scripts/retdec-unpacker.py \ - --replace-warn "'upx'" "'${upx}'" - ''; + substituteInPlace scripts/retdec-utils.py \ + --replace-warn /usr/bin/time ${time} \ + --replace-warn /usr/local/bin/gtime ${time} + substituteInPlace scripts/retdec-unpacker.py \ + --replace-warn "'upx'" "'${upx}'" + ''; doInstallCheck = enableTests; installCheckPhase = '' diff --git a/pkgs/by-name/re/retool/package.nix b/pkgs/by-name/re/retool/package.nix index f3314d93f95f..f3e3fce7505d 100644 --- a/pkgs/by-name/re/retool/package.nix +++ b/pkgs/by-name/re/retool/package.nix @@ -27,13 +27,12 @@ python3.pkgs.buildPythonApplication rec { pythonRelaxDeps = true; - buildInputs = - [ - qt6.qtbase - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - qt6.qtwayland - ]; + buildInputs = [ + qt6.qtbase + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + qt6.qtwayland + ]; propagatedBuildInputs = with python3.pkgs; [ alive-progress diff --git a/pkgs/by-name/re/retroarch-bare/package.nix b/pkgs/by-name/re/retroarch-bare/package.nix index c7c19c69ac23..10f22acba898 100644 --- a/pkgs/by-name/re/retroarch-bare/package.nix +++ b/pkgs/by-name/re/retroarch-bare/package.nix @@ -54,8 +54,7 @@ let runtimeLibs = - lib.optional withVulkan vulkan-loader - ++ lib.optional withGamemode (lib.getLib gamemode); + lib.optional withVulkan vulkan-loader ++ lib.optional withGamemode (lib.getLib gamemode); in stdenv.mkDerivation rec { pname = "retroarch-bare"; @@ -68,68 +67,65 @@ stdenv.mkDerivation rec { rev = "v${version}"; }; - nativeBuildInputs = - [ - pkg-config - qt5.wrapQtAppsHook - ] - ++ lib.optional withWayland wayland - ++ lib.optional (runtimeLibs != [ ]) makeBinaryWrapper; + nativeBuildInputs = [ + pkg-config + qt5.wrapQtAppsHook + ] + ++ lib.optional withWayland wayland + ++ lib.optional (runtimeLibs != [ ]) makeBinaryWrapper; - buildInputs = - [ - ffmpeg - flac - freetype - libGL - libGLU - libxml2 - mbedtls_2 - python3 - qt5.qtbase - SDL2 - spirv-tools - zlib - ] - ++ lib.optional enableNvidiaCgToolkit nvidia_cg_toolkit - ++ lib.optional withVulkan vulkan-loader - ++ lib.optionals withWayland [ - wayland - wayland-scanner - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - dbus - libX11 - libXdmcp - libXext - libXxf86vm - libdrm - libpulseaudio - libv4l - libxkbcommon - libgbm - pipewire - udev - ]; + buildInputs = [ + ffmpeg + flac + freetype + libGL + libGLU + libxml2 + mbedtls_2 + python3 + qt5.qtbase + SDL2 + spirv-tools + zlib + ] + ++ lib.optional enableNvidiaCgToolkit nvidia_cg_toolkit + ++ lib.optional withVulkan vulkan-loader + ++ lib.optionals withWayland [ + wayland + wayland-scanner + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + dbus + libX11 + libXdmcp + libXext + libXxf86vm + libdrm + libpulseaudio + libv4l + libxkbcommon + libgbm + pipewire + udev + ]; enableParallelBuilding = true; - configureFlags = - [ - "--disable-update_cores" - "--disable-builtinmbedtls" - "--enable-systemmbedtls" - "--disable-builtinzlib" - "--disable-builtinflac" - "--disable-update_assets" - "--disable-update_core_info" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-dbus" - "--enable-egl" - "--enable-kms" - ]; + configureFlags = [ + "--disable-update_cores" + "--disable-builtinmbedtls" + "--enable-systemmbedtls" + "--disable-builtinzlib" + "--disable-builtinflac" + "--disable-update_assets" + "--disable-update_core_info" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--enable-dbus" + "--enable-egl" + "--enable-kms" + ]; postInstall = lib.optionalString (runtimeLibs != [ ]) '' @@ -170,7 +166,8 @@ stdenv.mkDerivation rec { assets_directory = "${retroarch-assets}/share/retroarch/assets"; joypad_autoconfig_dir = "${retroarch-joypad-autoconfig}/share/libretro/autoconfig"; libretro_info_path = "${libretro-core-info}/share/retroarch/cores"; - } // settings; + } + // settings; }; }; diff --git a/pkgs/by-name/re/retroarch-bare/wrapper.nix b/pkgs/by-name/re/retroarch-bare/wrapper.nix index 691abe528339..04aacb962e86 100644 --- a/pkgs/by-name/re/retroarch-bare/wrapper.nix +++ b/pkgs/by-name/re/retroarch-bare/wrapper.nix @@ -69,12 +69,11 @@ symlinkJoin { platforms ; - longDescription = - '' - RetroArch is the reference frontend for the libretro API. - '' - + lib.optionalString (cores != [ ]) '' - The following cores are included: ${lib.concatStringsSep ", " (map (c: c.core) cores)}. - ''; + longDescription = '' + RetroArch is the reference frontend for the libretro API. + '' + + lib.optionalString (cores != [ ]) '' + The following cores are included: ${lib.concatStringsSep ", " (map (c: c.core) cores)}. + ''; }; } diff --git a/pkgs/by-name/re/retrofe/package.nix b/pkgs/by-name/re/retrofe/package.nix index adfeed89ed97..ff44ea04755e 100644 --- a/pkgs/by-name/re/retrofe/package.nix +++ b/pkgs/by-name/re/retrofe/package.nix @@ -35,22 +35,21 @@ stdenv.mkDerivation { python3 ]; - buildInputs = - [ - glib - gst_all_1.gstreamer - SDL2 - SDL2_image - SDL2_mixer - SDL2_ttf - sqlite - zlib - ] - ++ (with gst_all_1; [ - gst-libav - gst-plugins-base - gst-plugins-good - ]); + buildInputs = [ + glib + gst_all_1.gstreamer + SDL2 + SDL2_image + SDL2_mixer + SDL2_ttf + sqlite + zlib + ] + ++ (with gst_all_1; [ + gst-libav + gst-plugins-base + gst-plugins-good + ]); configurePhase = '' cmake RetroFE/Source -BRetroFE/Build -DCMAKE_BUILD_TYPE=Release \ diff --git a/pkgs/by-name/rh/rhash/package.nix b/pkgs/by-name/rh/rhash/package.nix index 9daddbfce993..cc6a36edb14d 100644 --- a/pkgs/by-name/rh/rhash/package.nix +++ b/pkgs/by-name/rh/rhash/package.nix @@ -42,14 +42,13 @@ stdenv.mkDerivation rec { checkTarget = "test-full"; - installTargets = - [ - "install" - "install-lib-headers" - ] - ++ lib.optionals (!enableStatic) [ - "install-lib-so-link" - ]; + installTargets = [ + "install" + "install-lib-headers" + ] + ++ lib.optionals (!enableStatic) [ + "install-lib-so-link" + ]; meta = with lib; { homepage = "https://rhash.sourceforge.net/"; diff --git a/pkgs/by-name/rh/rhythmbox/package.nix b/pkgs/by-name/rh/rhythmbox/package.nix index 2490bc1599ee..1bdd2929bb7a 100644 --- a/pkgs/by-name/rh/rhythmbox/package.nix +++ b/pkgs/by-name/rh/rhythmbox/package.nix @@ -88,7 +88,8 @@ stdenv.mkDerivation rec { libdmapsharing # for daap support libsecret libnotify - ] ++ gst_plugins; + ] + ++ gst_plugins; nativeCheckInputs = [ check diff --git a/pkgs/by-name/ri/ride/package.nix b/pkgs/by-name/ri/ride/package.nix index 8035a87ce183..527c81db7d77 100644 --- a/pkgs/by-name/ri/ride/package.nix +++ b/pkgs/by-name/ri/ride/package.nix @@ -70,7 +70,8 @@ buildNpmPackage rec { nativeBuildInputs = [ zip makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; diff --git a/pkgs/by-name/ri/riemann_c_client/package.nix b/pkgs/by-name/ri/riemann_c_client/package.nix index 3933346a85ef..6c11b99326d3 100644 --- a/pkgs/by-name/ri/riemann_c_client/package.nix +++ b/pkgs/by-name/ri/riemann_c_client/package.nix @@ -38,14 +38,13 @@ stdenv.mkDerivation rec { check pkg-config ]; - buildInputs = - [ - file - protobufc - ] - ++ lib.optional withWolfSSL wolfssl - ++ lib.optional withGnuTLS gnutls - ++ lib.optional withJSON json_c; + buildInputs = [ + file + protobufc + ] + ++ lib.optional withWolfSSL wolfssl + ++ lib.optional withGnuTLS gnutls + ++ lib.optional withJSON json_c; configureFlags = [ ] ++ lib.optional withWolfSSL "--with-tls=wolfssl" ++ lib.optional withGnuTLS "--with-tls=gnutls"; diff --git a/pkgs/by-name/ri/rigel-engine/package.nix b/pkgs/by-name/ri/rigel-engine/package.nix index 7dd413cb058a..cd753f95fcd2 100644 --- a/pkgs/by-name/ri/rigel-engine/package.nix +++ b/pkgs/by-name/ri/rigel-engine/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation { cmakeFlags = [ "-Wno-dev" - ] ++ lib.optional buildOpenGLES "-DUSE_GL_ES=ON"; + ] + ++ lib.optional buildOpenGLES "-DUSE_GL_ES=ON"; meta = { description = "Modern re-implementation of the classic DOS game Duke Nukem II"; diff --git a/pkgs/by-name/ri/rink/package.nix b/pkgs/by-name/ri/rink/package.nix index 622030ebfd98..3988e4b500d6 100644 --- a/pkgs/by-name/ri/rink/package.nix +++ b/pkgs/by-name/ri/rink/package.nix @@ -31,17 +31,18 @@ rustPlatform.buildRustPackage rec { installShellFiles asciidoctor ]; - buildInputs = - [ ncurses ] - ++ ( - if stdenv.hostPlatform.isDarwin then - [ - curl - libiconv - ] - else - [ openssl ] - ); + buildInputs = [ + ncurses + ] + ++ ( + if stdenv.hostPlatform.isDarwin then + [ + curl + libiconv + ] + else + [ openssl ] + ); # Some tests fail and/or attempt to use internet servers. doCheck = false; diff --git a/pkgs/by-name/ri/rio/package.nix b/pkgs/by-name/ri/rio/package.nix index d01782eb0363..9a47258937f4 100644 --- a/pkgs/by-name/ri/rio/package.nix +++ b/pkgs/by-name/ri/rio/package.nix @@ -65,15 +65,14 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-T88K2ujB4hskbQW5+urlSdEgN+XSmEEb80eW5gw51Gs="; - nativeBuildInputs = - [ - ncurses - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - cmake - pkg-config - autoPatchelfHook - ]; + nativeBuildInputs = [ + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + cmake + pkg-config + autoPatchelfHook + ]; runtimeDependencies = rlinkLibs; @@ -96,23 +95,22 @@ rustPlatform.buildRustPackage rec { "--skip=sys::unix::eventedfd::EventedFd" ]; - postInstall = - '' - install -D -m 644 misc/rio.desktop -t $out/share/applications - install -D -m 644 misc/logo.svg \ - $out/share/icons/hicolor/scalable/apps/rio.svg + postInstall = '' + install -D -m 644 misc/rio.desktop -t $out/share/applications + install -D -m 644 misc/logo.svg \ + $out/share/icons/hicolor/scalable/apps/rio.svg - install -dm 755 "$terminfo/share/terminfo/r/" - tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo - mkdir -p $out/nix-support - echo "$terminfo" >> $out/nix-support/propagated-user-env-packages - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir $out/Applications/ - mv misc/osx/Rio.app/ $out/Applications/ - mkdir $out/Applications/Rio.app/Contents/MacOS/ - ln -s $out/bin/rio $out/Applications/Rio.app/Contents/MacOS/ - ''; + install -dm 755 "$terminfo/share/terminfo/r/" + tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo + mkdir -p $out/nix-support + echo "$terminfo" >> $out/nix-support/propagated-user-env-packages + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir $out/Applications/ + mv misc/osx/Rio.app/ $out/Applications/ + mkdir $out/Applications/Rio.app/Contents/MacOS/ + ln -s $out/bin/rio $out/Applications/Rio.app/Contents/MacOS/ + ''; passthru = { updateScript = nix-update-script { @@ -122,17 +120,16 @@ rustPlatform.buildRustPackage rec { ]; }; - tests = - { - version = testers.testVersion { package = rio; }; - } - // lib.optionalAttrs stdenv.buildPlatform.isLinux { - # FIXME: Restrict test execution inside nixosTests for Linux devices as ofborg - # 'passthru.tests' nixosTests are failing on Darwin architectures. - # - # Ref: https://github.com/NixOS/nixpkgs/issues/345825 - test = nixosTests.terminal-emulators.rio; - }; + tests = { + version = testers.testVersion { package = rio; }; + } + // lib.optionalAttrs stdenv.buildPlatform.isLinux { + # FIXME: Restrict test execution inside nixosTests for Linux devices as ofborg + # 'passthru.tests' nixosTests are failing on Darwin architectures. + # + # Ref: https://github.com/NixOS/nixpkgs/issues/345825 + test = nixosTests.terminal-emulators.rio; + }; }; meta = { diff --git a/pkgs/by-name/ri/ripes/package.nix b/pkgs/by-name/ri/ripes/package.nix index fba559949bc7..0afec0618a3b 100644 --- a/pkgs/by-name/ri/ripes/package.nix +++ b/pkgs/by-name/ri/ripes/package.nix @@ -43,22 +43,21 @@ stdenv.mkDerivation rec { qt6.qtcharts ]; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r Ripes.app $out/Applications/ - makeBinaryWrapper $out/Applications/Ripes.app/Contents/MacOS/Ripes $out/bin/Ripes - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -D Ripes $out/bin/Ripes - '' - + '' - cp -r ${src}/appdir/usr/share $out/share - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r Ripes.app $out/Applications/ + makeBinaryWrapper $out/Applications/Ripes.app/Contents/MacOS/Ripes $out/bin/Ripes + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -D Ripes $out/bin/Ripes + '' + + '' + cp -r ${src}/appdir/usr/share $out/share + runHook postInstall + ''; passthru.updateScript = unstableGitUpdater { }; diff --git a/pkgs/by-name/ri/ripgrep/package.nix b/pkgs/by-name/ri/ripgrep/package.nix index 12418a4e34fc..9710c2bd3c53 100644 --- a/pkgs/by-name/ri/ripgrep/package.nix +++ b/pkgs/by-name/ri/ripgrep/package.nix @@ -32,7 +32,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ installShellFiles writableTmpDirAsHomeHook # required for wine when cross-compiling to Windows - ] ++ lib.optional withPCRE2 pkg-config; + ] + ++ lib.optional withPCRE2 pkg-config; buildInputs = lib.optional withPCRE2 pcre2; buildFeatures = lib.optional withPCRE2 "pcre2"; @@ -48,16 +49,15 @@ rustPlatform.buildRustPackage rec { ''; doInstallCheck = true; - installCheckPhase = - '' - file="$(mktemp)" - echo "abc\nbcd\ncde" > "$file" - ${rg} -N 'bcd' "$file" - ${rg} -N 'cd' "$file" - '' - + lib.optionalString withPCRE2 '' - echo '(a(aa)aa)' | ${rg} -P '\((a*|(?R))*\)' - ''; + installCheckPhase = '' + file="$(mktemp)" + echo "abc\nbcd\ncde" > "$file" + ${rg} -N 'bcd' "$file" + ${rg} -N 'cd' "$file" + '' + + lib.optionalString withPCRE2 '' + echo '(a(aa)aa)' | ${rg} -P '\((a*|(?R))*\)' + ''; meta = { description = "Utility that combines the usability of The Silver Searcher with the raw speed of grep"; diff --git a/pkgs/by-name/ri/ripmime/package.nix b/pkgs/by-name/ri/ripmime/package.nix index b4e302618ee9..704860cbf903 100644 --- a/pkgs/by-name/ri/ripmime/package.nix +++ b/pkgs/by-name/ri/ripmime/package.nix @@ -17,13 +17,12 @@ stdenv.mkDerivation rec { mkdir -p "$out/bin" "$out/share/man/man1" ''; - env = - { - NIX_CFLAGS_COMPILE = " -Wno-error "; - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - NIX_LDFLAGS = "-liconv"; - }; + env = { + NIX_CFLAGS_COMPILE = " -Wno-error "; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + NIX_LDFLAGS = "-liconv"; + }; meta = with lib; { description = "Attachment extractor for MIME messages"; diff --git a/pkgs/by-name/ri/ripser/package.nix b/pkgs/by-name/ri/ripser/package.nix index 204f8a0f0244..0246723e5882 100644 --- a/pkgs/by-name/ri/ripser/package.nix +++ b/pkgs/by-name/ri/ripser/package.nix @@ -32,18 +32,17 @@ stdenv.mkDerivation { buildInputs = lib.optional useGoogleHashmap sparsehash; - buildFlags = - [ - "-std=c++11" - "-O3" - "-D NDEBUG" - ] - ++ lib.optional useCoefficients "-D USE_COEFFICIENTS" - ++ lib.optional indicateProgress "-D INDICATE_PROGRESS" - ++ lib.optional useGoogleHashmap "-D USE_GOOGLE_HASHMAP" - ++ lib.optional (fileFormat == "lowerTriangularCsv") "-D FILE_FORMAT_LOWER_TRIANGULAR_CSV" - ++ lib.optional (fileFormat == "upperTriangularCsv") "-D FILE_FORMAT_UPPER_TRIANGULAR_CSV" - ++ lib.optional (fileFormat == "dipha") "-D FILE_FORMAT_DIPHA"; + buildFlags = [ + "-std=c++11" + "-O3" + "-D NDEBUG" + ] + ++ lib.optional useCoefficients "-D USE_COEFFICIENTS" + ++ lib.optional indicateProgress "-D INDICATE_PROGRESS" + ++ lib.optional useGoogleHashmap "-D USE_GOOGLE_HASHMAP" + ++ lib.optional (fileFormat == "lowerTriangularCsv") "-D FILE_FORMAT_LOWER_TRIANGULAR_CSV" + ++ lib.optional (fileFormat == "upperTriangularCsv") "-D FILE_FORMAT_UPPER_TRIANGULAR_CSV" + ++ lib.optional (fileFormat == "dipha") "-D FILE_FORMAT_DIPHA"; buildPhase = "c++ ripser.cpp -o ripser $buildFlags"; diff --git a/pkgs/by-name/ri/river/package.nix b/pkgs/by-name/ri/river/package.nix index 8bfaa550c05d..fcb9153fa33a 100644 --- a/pkgs/by-name/ri/river/package.nix +++ b/pkgs/by-name/ri/river/package.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation (finalAttrs: { wayland-scanner xwayland zig_0_14.hook - ] ++ lib.optional withManpages scdoc; + ] + ++ lib.optional withManpages scdoc; buildInputs = [ libGL @@ -55,17 +56,17 @@ stdenv.mkDerivation (finalAttrs: { wayland wayland-protocols wlroots_0_19 - ] ++ lib.optional xwaylandSupport libX11; + ] + ++ lib.optional xwaylandSupport libX11; dontConfigure = true; - zigBuildFlags = - [ - "--system" - "${finalAttrs.deps}" - ] - ++ lib.optional withManpages "-Dman-pages" - ++ lib.optional xwaylandSupport "-Dxwayland"; + zigBuildFlags = [ + "--system" + "${finalAttrs.deps}" + ] + ++ lib.optional withManpages "-Dman-pages" + ++ lib.optional xwaylandSupport "-Dxwayland"; postInstall = '' install contrib/river.desktop -Dt $out/share/wayland-sessions diff --git a/pkgs/by-name/rm/rmg/package.nix b/pkgs/by-name/rm/rmg/package.nix index c8b28111723c..f5def5581181 100644 --- a/pkgs/by-name/rm/rmg/package.nix +++ b/pkgs/by-name/rm/rmg/package.nix @@ -46,32 +46,31 @@ stdenv.mkDerivation (finalAttrs: { which ]; - buildInputs = + buildInputs = [ + boost + discord-rpc + freetype + hidapi + libpng + libsamplerate + minizip + SDL2 + SDL2_net + speexdsp + vulkan-headers + vulkan-loader + xdg-user-dirs + zlib + ] + ++ ( + with qt6Packages; [ - boost - discord-rpc - freetype - hidapi - libpng - libsamplerate - minizip - SDL2 - SDL2_net - speexdsp - vulkan-headers - vulkan-loader - xdg-user-dirs - zlib + qtbase + qtsvg + qtwebsockets ] - ++ ( - with qt6Packages; - [ - qtbase - qtsvg - qtwebsockets - ] - ++ lib.optional withWayland qtwayland - ); + ++ lib.optional withWayland qtwayland + ); cmakeFlags = [ (lib.cmakeBool "PORTABLE_INSTALL" false) diff --git a/pkgs/by-name/rm/rmw/package.nix b/pkgs/by-name/rm/rmw/package.nix index 84f5f602f0d0..b3c5093b84fd 100644 --- a/pkgs/by-name/rm/rmw/package.nix +++ b/pkgs/by-name/rm/rmw/package.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses - ] ++ lib.optional stdenv.hostPlatform.isDarwin gettext; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gettext; # The subproject "canfigger" has asan and ubsan enabled by default, disable it here mesonFlags = [ diff --git a/pkgs/by-name/rn/rng-tools/package.nix b/pkgs/by-name/rn/rng-tools/package.nix index fe28dc029881..cce1b42739c3 100644 --- a/pkgs/by-name/rn/rng-tools/package.nix +++ b/pkgs/by-name/rn/rng-tools/package.nix @@ -50,37 +50,35 @@ stdenv.mkDerivation rec { (lib.withFeature (withQrypt) "qrypt") ]; - buildInputs = - [ - openssl - libcap - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ argp-standalone ] - ++ lib.optionals withJitterEntropy [ jitterentropy ] - ++ lib.optionals withNistBeacon [ - curl - jansson - libxml2 - ] - ++ lib.optionals withPkcs11 [ - libp11 - libp11.passthru.openssl - ] - ++ lib.optionals withRtlsdr [ rtl-sdr ] - ++ lib.optionals withQrypt [ - curl - jansson - ]; + buildInputs = [ + openssl + libcap + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ argp-standalone ] + ++ lib.optionals withJitterEntropy [ jitterentropy ] + ++ lib.optionals withNistBeacon [ + curl + jansson + libxml2 + ] + ++ lib.optionals withPkcs11 [ + libp11 + libp11.passthru.openssl + ] + ++ lib.optionals withRtlsdr [ rtl-sdr ] + ++ lib.optionals withQrypt [ + curl + jansson + ]; enableParallelBuilding = true; - makeFlags = - [ - "AR:=$(AR)" # For cross-compilation - ] - ++ lib.optionals withPkcs11 [ - "PKCS11_ENGINE=${opensc}/lib/opensc-pkcs11.so" # Overrides configure script paths - ]; + makeFlags = [ + "AR:=$(AR)" # For cross-compilation + ] + ++ lib.optionals withPkcs11 [ + "PKCS11_ENGINE=${opensc}/lib/opensc-pkcs11.so" # Overrides configure script paths + ]; doCheck = true; preCheck = '' diff --git a/pkgs/by-name/rn/rnnoise-plugin/package.nix b/pkgs/by-name/rn/rnnoise-plugin/package.nix index 78fb11fca707..5884b50b1f37 100644 --- a/pkgs/by-name/rn/rnnoise-plugin/package.nix +++ b/pkgs/by-name/rn/rnnoise-plugin/package.nix @@ -38,17 +38,16 @@ stdenv.mkDerivation rec { ./disable-ubsan.patch ]; - buildInputs = - [ - freetype - gtk3-x11 - pcre - xorg.libX11 - xorg.libXrandr - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - webkitgtk_4_1 - ]; + buildInputs = [ + freetype + gtk3-x11 + pcre + xorg.libX11 + xorg.libXrandr + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + webkitgtk_4_1 + ]; # Move each plugin into a dedicated output, leaving a symlink in $out for backwards compatibility postInstall = '' diff --git a/pkgs/by-name/rn/rnote/package.nix b/pkgs/by-name/rn/rnote/package.nix index 3ffc58be726a..7d594ebfbad9 100644 --- a/pkgs/by-name/rn/rnote/package.nix +++ b/pkgs/by-name/rn/rnote/package.nix @@ -64,19 +64,18 @@ stdenv.mkDerivation rec { (lib.mesonBool "cli" true) ]; - buildInputs = - [ - appstream - glib - gst_all_1.gstreamer - gtk4 - libadwaita - libxml2 - poppler - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ]; + buildInputs = [ + appstream + glib + gst_all_1.gstreamer + gtk4 + libadwaita + libxml2 + poppler + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ]; postPatch = '' chmod +x build-aux/*.py diff --git a/pkgs/by-name/ro/roc-toolkit/package.nix b/pkgs/by-name/ro/roc-toolkit/package.nix index db097741eaff..0308cea3aa6b 100644 --- a/pkgs/by-name/ro/roc-toolkit/package.nix +++ b/pkgs/by-name/ro/roc-toolkit/package.nix @@ -45,17 +45,16 @@ stdenv.mkDerivation rec { pkg-config ]; - propagatedBuildInputs = - [ - libuv - speexdsp - ] - ++ lib.optional openfecSupport openfec - ++ lib.optional libunwindSupport libunwind - ++ lib.optional pulseaudioSupport libpulseaudio - ++ lib.optional opensslSupport openssl - ++ lib.optional soxSupport sox - ++ lib.optional libsndfileSupport libsndfile; + propagatedBuildInputs = [ + libuv + speexdsp + ] + ++ lib.optional openfecSupport openfec + ++ lib.optional libunwindSupport libunwind + ++ lib.optional pulseaudioSupport libpulseaudio + ++ lib.optional opensslSupport openssl + ++ lib.optional soxSupport sox + ++ lib.optional libsndfileSupport libsndfile; sconsFlags = lib.optionals (!stdenv.hostPlatform.isDarwin) [ diff --git a/pkgs/by-name/ro/roc/package.nix b/pkgs/by-name/ro/roc/package.nix index f65a958d3032..8903b27a1fba 100755 --- a/pkgs/by-name/ro/roc/package.nix +++ b/pkgs/by-name/ro/roc/package.nix @@ -31,27 +31,25 @@ rustPlatform.buildRustPackage rec { hash = "sha256-iM16DlTf+1yXBZVH7QqzhKuSkn1n/ZDosnZj3t+io0E="; }; - nativeBuildInputs = - [ - cmake - zig_0_13 - ] - ++ lib.optionals stdenv.isLinux [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + cmake + zig_0_13 + ] + ++ lib.optionals stdenv.isLinux [ + autoPatchelfHook + ]; - buildInputs = - [ - libffi - libxml2 - llvmPackages.clang - llvmPackages.llvm.dev - makeBinaryWrapper - ] - ++ lib.optionals stdenv.isLinux [ - glibc - stdenv.cc.cc.lib - ]; + buildInputs = [ + libffi + libxml2 + llvmPackages.clang + llvmPackages.llvm.dev + makeBinaryWrapper + ] + ++ lib.optionals stdenv.isLinux [ + glibc + stdenv.cc.cc.lib + ]; useFetchCargoVendor = true; cargoHash = "sha256-9cOJ79GrnrMEIhFikvCfXa2SI4O0fy50cr4Fb6p4Vho="; diff --git a/pkgs/by-name/ro/rockbox-utility/package.nix b/pkgs/by-name/ro/rockbox-utility/package.nix index 644cff5ed85a..bfec85d51546 100644 --- a/pkgs/by-name/ro/rockbox-utility/package.nix +++ b/pkgs/by-name/ro/rockbox-utility/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation rec { qt5.qtbase qt5.qtmultimedia qt5.qttools - ] ++ lib.optional withEspeak espeak; + ] + ++ lib.optional withEspeak espeak; cmakeDir = "../utils"; diff --git a/pkgs/by-name/ro/rocksdb/package.nix b/pkgs/by-name/ro/rocksdb/package.nix index c2df5b1fc69c..a700587105d6 100644 --- a/pkgs/by-name/ro/rocksdb/package.nix +++ b/pkgs/by-name/ro/rocksdb/package.nix @@ -75,7 +75,8 @@ stdenv.mkDerivation (finalAttrs: { "-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere (lib.optional sse42Support "-DFORCE_SSE42=1") "-DFAIL_ON_WARNINGS=NO" - ] ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0"; + ] + ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0"; # otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]" hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format"; @@ -95,17 +96,16 @@ stdenv.mkDerivation (finalAttrs: { sed -e '1i #include ' -i third-party/folly/folly/synchronization/detail/ProxyLockable-inl.h ''; - preInstall = - '' - mkdir -p $tools/bin - cp tools/{ldb,sst_dump}${stdenv.hostPlatform.extensions.executable} $tools/bin/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - ls -1 $tools/bin/* | xargs -I{} install_name_tool -change "@rpath/librocksdb.${lib.versions.major finalAttrs.version}.dylib" $out/lib/librocksdb.dylib {} - '' - + lib.optionalString (stdenv.hostPlatform.isLinux && enableShared) '' - ls -1 $tools/bin/* | xargs -I{} patchelf --set-rpath $out/lib:${lib.getLib stdenv.cc.cc}/lib {} - ''; + preInstall = '' + mkdir -p $tools/bin + cp tools/{ldb,sst_dump}${stdenv.hostPlatform.extensions.executable} $tools/bin/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + ls -1 $tools/bin/* | xargs -I{} install_name_tool -change "@rpath/librocksdb.${lib.versions.major finalAttrs.version}.dylib" $out/lib/librocksdb.dylib {} + '' + + lib.optionalString (stdenv.hostPlatform.isLinux && enableShared) '' + ls -1 $tools/bin/* | xargs -I{} patchelf --set-rpath $out/lib:${lib.getLib stdenv.cc.cc}/lib {} + ''; # Old version doesn't ship the .pc file, new version puts wrong paths in there. postFixup = '' diff --git a/pkgs/by-name/ro/rofimoji/package.nix b/pkgs/by-name/ro/rofimoji/package.nix index ad104c00aebc..6ccdfeee37cf 100644 --- a/pkgs/by-name/ro/rofimoji/package.nix +++ b/pkgs/by-name/ro/rofimoji/package.nix @@ -32,18 +32,17 @@ python3Packages.buildPythonApplication rec { # `rofi` and the `waylandSupport` and `x11Support` dependencies # contain binaries needed at runtime. - propagatedBuildInputs = - [ - python3Packages.configargparse - ] - ++ lib.optionals waylandSupport [ - wl-clipboard - wtype - ] - ++ lib.optionals x11Support [ - xdotool - xsel - ]; + propagatedBuildInputs = [ + python3Packages.configargparse + ] + ++ lib.optionals waylandSupport [ + wl-clipboard + wtype + ] + ++ lib.optionals x11Support [ + xdotool + xsel + ]; # The 'extractors' sub-module is used for development # and has additional dependencies. diff --git a/pkgs/by-name/ro/root/clang-root.nix b/pkgs/by-name/ro/root/clang-root.nix index badd4d493a0a..c31cd055dde5 100644 --- a/pkgs/by-name/ro/root/clang-root.nix +++ b/pkgs/by-name/ro/root/clang-root.nix @@ -38,21 +38,20 @@ stdenv.mkDerivation rec { cd clang ''; - cmakeFlags = - [ - "-DCLANG_BUILD_TOOLS=OFF" - "-DCLANG_ENABLE_ARCMT=OFF" - "-DCLANG_ENABLE_STATIC_ANALYZER=OFF" - "-DCLANG_LINK_CLANG_DYLIB=OFF" - "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include" - "-DLLVM_INCLUDE_TESTS=OFF" - "-DLLVM_LINK_LLVM_DYLIB=OFF" - "-DLLVM_MAIN_SRC_DIR=${llvm_18.src}" - ] - ++ ( - if stdenv.hostPlatform.isDarwin then - [ "-DC_INCLUDE_DIRS=${apple-sdk.sdkroot}/usr/include" ] - else - lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include" - ); + cmakeFlags = [ + "-DCLANG_BUILD_TOOLS=OFF" + "-DCLANG_ENABLE_ARCMT=OFF" + "-DCLANG_ENABLE_STATIC_ANALYZER=OFF" + "-DCLANG_LINK_CLANG_DYLIB=OFF" + "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include" + "-DLLVM_INCLUDE_TESTS=OFF" + "-DLLVM_LINK_LLVM_DYLIB=OFF" + "-DLLVM_MAIN_SRC_DIR=${llvm_18.src}" + ] + ++ ( + if stdenv.hostPlatform.isDarwin then + [ "-DC_INCLUDE_DIRS=${apple-sdk.sdkroot}/usr/include" ] + else + lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include" + ); } diff --git a/pkgs/by-name/ro/root/package.nix b/pkgs/by-name/ro/root/package.nix index fda598866567..b380e4be2258 100644 --- a/pkgs/by-name/ro/root/package.nix +++ b/pkgs/by-name/ro/root/package.nix @@ -84,45 +84,44 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ nlohmann_json # link interface of target "ROOT::ROOTEve" ]; - buildInputs = - [ - clang - davix - fftw - ftgl - giflib - gl2ps - glew - gsl - libjpeg - libpng - libtiff - libxcrypt - libxml2 - llvm_18 - lz4 - openssl - patchRcPathCsh - patchRcPathFish - patchRcPathPosix - pcre2 - python3.pkgs.numpy - tbb - xrootd - xxHash - xz - zlib - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk.privateFrameworksHook ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGLU - libGL - xorg.libX11 - xorg.libXpm - xorg.libXft - xorg.libXext - ]; + buildInputs = [ + clang + davix + fftw + ftgl + giflib + gl2ps + glew + gsl + libjpeg + libpng + libtiff + libxcrypt + libxml2 + llvm_18 + lz4 + openssl + patchRcPathCsh + patchRcPathFish + patchRcPathPosix + pcre2 + python3.pkgs.numpy + tbb + xrootd + xxHash + xz + zlib + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk.privateFrameworksHook ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGLU + libGL + xorg.libX11 + xorg.libXpm + xorg.libXft + xorg.libXext + ]; patches = [ # Backport that can be removed once ROOT is updated to 6.38.00 @@ -138,52 +137,50 @@ stdenv.mkDerivation rec { }) ]; - preConfigure = - '' - for path in builtins/*; do - if [[ "$path" != "builtins/openui5" ]] && [[ "$path" != "builtins/rendercore" ]]; then - rm -rf "$path" - fi - done - substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \ - --replace-fail 'set(lcgpackages ' '#set(lcgpackages ' + preConfigure = '' + for path in builtins/*; do + if [[ "$path" != "builtins/openui5" ]] && [[ "$path" != "builtins/rendercore" ]]; then + rm -rf "$path" + fi + done + substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \ + --replace-fail 'set(lcgpackages ' '#set(lcgpackages ' - patchShebangs cmake/unix/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Eliminate impure reference to /System/Library/PrivateFrameworks - substituteInPlace core/macosx/CMakeLists.txt \ - --replace-fail "-F/System/Library/PrivateFrameworks " "" - '' - + - lib.optionalString - (stdenv.hostPlatform.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") - '' - MACOSX_DEPLOYMENT_TARGET=10.16 - ''; + patchShebangs cmake/unix/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Eliminate impure reference to /System/Library/PrivateFrameworks + substituteInPlace core/macosx/CMakeLists.txt \ + --replace-fail "-F/System/Library/PrivateFrameworks " "" + '' + + + lib.optionalString + (stdenv.hostPlatform.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") + '' + MACOSX_DEPLOYMENT_TARGET=10.16 + ''; - cmakeFlags = - [ - "-DCLAD_SOURCE_DIR=${clad_src}" - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DClang_DIR=${clang}/lib/cmake/clang" - "-Dbuiltin_clang=OFF" - "-Dbuiltin_llvm=OFF" - "-Dfail-on-missing=ON" - "-Dfftw3=ON" - "-Dfitsio=OFF" - "-Dgnuinstall=ON" - "-Dmathmore=ON" - "-Dsqlite=OFF" - "-Dvdt=OFF" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fatal error: module map file '/nix/store/-Libsystem-osx-10.12.6/include/module.modulemap' not found - # fatal error: could not build module '_Builtin_intrinsics' - "-Druntime_cxxmodules=OFF" - ]; + cmakeFlags = [ + "-DCLAD_SOURCE_DIR=${clad_src}" + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DClang_DIR=${clang}/lib/cmake/clang" + "-Dbuiltin_clang=OFF" + "-Dbuiltin_llvm=OFF" + "-Dfail-on-missing=ON" + "-Dfftw3=ON" + "-Dfitsio=OFF" + "-Dgnuinstall=ON" + "-Dmathmore=ON" + "-Dsqlite=OFF" + "-Dvdt=OFF" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fatal error: module map file '/nix/store/-Libsystem-osx-10.12.6/include/module.modulemap' not found + # fatal error: could not build module '_Builtin_intrinsics' + "-Druntime_cxxmodules=OFF" + ]; postInstall = '' for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do diff --git a/pkgs/by-name/ro/rosa/package.nix b/pkgs/by-name/ro/rosa/package.nix index 949d1090d900..056dba0c3b08 100644 --- a/pkgs/by-name/ro/rosa/package.nix +++ b/pkgs/by-name/ro/rosa/package.nix @@ -37,7 +37,8 @@ buildGoModule rec { skippedTests = [ "TestCluster" "TestRhRegionCommand" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestCache" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestCache" ]; in [ "-skip=^${lib.concatStringsSep "$|^" skippedTests}$" ]; diff --git a/pkgs/by-name/ro/rott/package.nix b/pkgs/by-name/ro/rott/package.nix index 0a65dd4ae39e..51395b5e1600 100644 --- a/pkgs/by-name/ro/rott/package.nix +++ b/pkgs/by-name/ro/rott/package.nix @@ -21,18 +21,17 @@ stdenv.mkDerivation (finalAttrs: { version = "1.1.2"; __structuredAttrs = true; - srcs = - [ - (fetchurl { - url = "https://icculus.org/rott/releases/${finalAttrs.pname}-${finalAttrs.version}.tar.gz"; - hash = "sha256-ECUW6MMS9rC79sYj4fAcv7vDFKzorf4fIB1HsVvZJ/8="; - }) - ] - ++ lib.optional withSharewareData (fetchzip { - url = "http://icculus.org/rott/share/1rott13.zip"; - hash = "sha256-l0pP+mNPAabGh7LZrwcB6KOhPRSycrZpAlPVTyDXc6Y="; - stripRoot = false; - }); + srcs = [ + (fetchurl { + url = "https://icculus.org/rott/releases/${finalAttrs.pname}-${finalAttrs.version}.tar.gz"; + hash = "sha256-ECUW6MMS9rC79sYj4fAcv7vDFKzorf4fIB1HsVvZJ/8="; + }) + ] + ++ lib.optional withSharewareData (fetchzip { + url = "http://icculus.org/rott/share/1rott13.zip"; + hash = "sha256-l0pP+mNPAabGh7LZrwcB6KOhPRSycrZpAlPVTyDXc6Y="; + stripRoot = false; + }); sourceRoot = "rott-${finalAttrs.version}/rott"; diff --git a/pkgs/by-name/ro/route-graph/package.nix b/pkgs/by-name/ro/route-graph/package.nix index 2e9df8012f34..354f10578b9b 100644 --- a/pkgs/by-name/ro/route-graph/package.nix +++ b/pkgs/by-name/ro/route-graph/package.nix @@ -26,15 +26,14 @@ python3.pkgs.buildPythonApplication rec { poetry-core ]; - propagatedBuildInputs = - [ - graphviz - ] - ++ (with python3.pkgs; [ - scapy - typer - typing-extensions - ]); + propagatedBuildInputs = [ + graphviz + ] + ++ (with python3.pkgs; [ + scapy + typer + typing-extensions + ]); # Project has no tests doCheck = false; diff --git a/pkgs/by-name/rp/rpPPPoE/package.nix b/pkgs/by-name/rp/rpPPPoE/package.nix index 940ada94fac8..398fd919c80a 100644 --- a/pkgs/by-name/rp/rpPPPoE/package.nix +++ b/pkgs/by-name/rp/rpPPPoE/package.nix @@ -26,7 +26,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-plugin=${ppp}/include" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "rpppoe_cv_pack_bitfields=rev" ]; + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "rpppoe_cv_pack_bitfields=rev" ]; postConfigure = '' sed -i Makefile -e 's@DESTDIR)/etc/ppp@out)/etc/ppp@' diff --git a/pkgs/by-name/rp/rpcbind/package.nix b/pkgs/by-name/rp/rpcbind/package.nix index f1dadd3a7857..71bd239aedf3 100644 --- a/pkgs/by-name/rp/rpcbind/package.nix +++ b/pkgs/by-name/rp/rpcbind/package.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation { buildInputs = [ libnsl libtirpc - ] ++ lib.optional useSystemd systemd; + ] + ++ lib.optional useSystemd systemd; configureFlags = [ "--with-systemdsystemunitdir=${ diff --git a/pkgs/by-name/rp/rpcs3/package.nix b/pkgs/by-name/rp/rpcs3/package.nix index 91cd8081ea54..6f3a4a582b32 100644 --- a/pkgs/by-name/rp/rpcs3/package.nix +++ b/pkgs/by-name/rp/rpcs3/package.nix @@ -107,36 +107,35 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - qtbase - qtmultimedia - openal - glew - vulkan-headers - vulkan-loader - libpng - ffmpeg - libevdev - zlib - libusb1 - curl - wolfssl - python3 - pugixml - SDL2 # Still needed by FAudio's CMake - sdl3 - flatbuffers - llvm_18 - libSM - opencv.cxxdev - cubeb - ] - ++ lib.optional faudioSupport faudio - ++ lib.optionals waylandSupport [ - wayland - qtwayland - ]; + buildInputs = [ + qtbase + qtmultimedia + openal + glew + vulkan-headers + vulkan-loader + libpng + ffmpeg + libevdev + zlib + libusb1 + curl + wolfssl + python3 + pugixml + SDL2 # Still needed by FAudio's CMake + sdl3 + flatbuffers + llvm_18 + libSM + opencv.cxxdev + cubeb + ] + ++ lib.optional faudioSupport faudio + ++ lib.optionals waylandSupport [ + wayland + qtwayland + ]; doInstallCheck = true; diff --git a/pkgs/by-name/rp/rpcsvc-proto/package.nix b/pkgs/by-name/rp/rpcsvc-proto/package.nix index 6a4823bd5df2..f94f31eb3e4a 100644 --- a/pkgs/by-name/rp/rpcsvc-proto/package.nix +++ b/pkgs/by-name/rp/rpcsvc-proto/package.nix @@ -38,17 +38,16 @@ stdenv.mkDerivation rec { RPCGEN_CPP = "${stdenv.cc.targetPrefix}cpp"; - postPatch = - '' - # replace fallback cpp with the target prefixed cpp - substituteInPlace rpcgen/rpc_main.c \ - --replace 'CPP = "cpp"' \ - 'CPP = "${targetPackages.stdenv.cc.targetPrefix}cpp"' - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - substituteInPlace rpcsvc/Makefile.am \ - --replace '$(top_builddir)/rpcgen/rpcgen' '${buildPackages.rpcsvc-proto}/bin/rpcgen' - ''; + postPatch = '' + # replace fallback cpp with the target prefixed cpp + substituteInPlace rpcgen/rpc_main.c \ + --replace 'CPP = "cpp"' \ + 'CPP = "${targetPackages.stdenv.cc.targetPrefix}cpp"' + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace rpcsvc/Makefile.am \ + --replace '$(top_builddir)/rpcgen/rpcgen' '${buildPackages.rpcsvc-proto}/bin/rpcgen' + ''; meta = with lib; { homepage = "https://github.com/thkukuk/rpcsvc-proto"; diff --git a/pkgs/by-name/rp/rpi-imager/package.nix b/pkgs/by-name/rp/rpi-imager/package.nix index 273336b8235f..492ea7f4c47c 100644 --- a/pkgs/by-name/rp/rpi-imager/package.nix +++ b/pkgs/by-name/rp/rpi-imager/package.nix @@ -49,22 +49,21 @@ stdenv.mkDerivation (finalAttrs: { util-linux ]; - buildInputs = - [ - curl - libarchive - qt6.qtbase - qt6.qtdeclarative - qt6.qtsvg - qt6.qttools - xz - gnutls - zstd - libtasn1 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6.qtwayland - ]; + buildInputs = [ + curl + libarchive + qt6.qtbase + qt6.qtdeclarative + qt6.qtsvg + qt6.qttools + xz + gnutls + zstd + libtasn1 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6.qtwayland + ]; cmakeFlags = # Disable vendoring diff --git a/pkgs/by-name/rq/rquickshare/package.nix b/pkgs/by-name/rq/rquickshare/package.nix index 855afe4e3a81..8ae084217223 100644 --- a/pkgs/by-name/rq/rquickshare/package.nix +++ b/pkgs/by-name/rq/rquickshare/package.nix @@ -77,20 +77,19 @@ rustPlatform.buildRustPackage rec { ]; cargoHash = app-type-either "sha256-XfN+/oC3lttDquLfoyJWBaFfdjW/wyODCIiZZksypLM=" "sha256-4vBHxuKg4P9H0FZYYNUT+AVj4Qvz99q7Bhd7x47UC2w="; - nativeBuildInputs = - [ - proper-cargo-tauri.hook + nativeBuildInputs = [ + proper-cargo-tauri.hook - # Setup pnpm - nodejs - pnpm_9.configHook + # Setup pnpm + nodejs + pnpm_9.configHook - protobuf - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - wrapGAppsHook4 - ]; + protobuf + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + wrapGAppsHook4 + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux ( [ diff --git a/pkgs/by-name/rr/rrdtool/package.nix b/pkgs/by-name/rr/rrdtool/package.nix index 1aad60b8ec24..cf4440cc624a 100644 --- a/pkgs/by-name/rr/rrdtool/package.nix +++ b/pkgs/by-name/rr/rrdtool/package.nix @@ -37,18 +37,17 @@ perl.pkgs.toPerlModule ( autoreconfHook ]; - buildInputs = - [ - gettext - perl - libxml2 - pango - cairo - groff - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - tcl - ]; + buildInputs = [ + gettext + perl + libxml2 + pango + cairo + groff + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + tcl + ]; postInstall = '' # for munin and rrdtool support diff --git a/pkgs/by-name/rs/rshim-user-space/package.nix b/pkgs/by-name/rs/rshim-user-space/package.nix index e7ae7f02e0c8..4c4f2f1c7e09 100644 --- a/pkgs/by-name/rs/rshim-user-space/package.nix +++ b/pkgs/by-name/rs/rshim-user-space/package.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation rec { autoconf automake pkg-config - ] ++ lib.optionals withBfbInstall [ makeBinaryWrapper ]; + ] + ++ lib.optionals withBfbInstall [ makeBinaryWrapper ]; buildInputs = [ pciutils @@ -45,14 +46,13 @@ stdenv.mkDerivation rec { preConfigure = "./bootstrap.sh"; - installPhase = - '' - mkdir -p "$out"/bin - cp -a src/rshim "$out"/bin/ - '' - + lib.optionalString withBfbInstall '' - cp -a scripts/bfb-install "$out"/bin/ - ''; + installPhase = '' + mkdir -p "$out"/bin + cp -a src/rshim "$out"/bin/ + '' + + lib.optionalString withBfbInstall '' + cp -a scripts/bfb-install "$out"/bin/ + ''; postFixup = lib.optionalString withBfbInstall '' wrapProgram $out/bin/bfb-install \ diff --git a/pkgs/by-name/rs/rspamd/package.nix b/pkgs/by-name/rs/rspamd/package.nix index 4a773df49f9a..709713a9bbb5 100644 --- a/pkgs/by-name/rs/rspamd/package.nix +++ b/pkgs/by-name/rs/rspamd/package.nix @@ -51,30 +51,29 @@ stdenv.mkDerivation rec { ragel ]; - buildInputs = - [ - doctest - fmt_11 - glib - openssl - pcre - sqlite - ragel - fasttext - icu - jemalloc - libsodium - xxHash - zstd - libarchive - vectorscan - ] - ++ lib.optionals withBlas [ - blas - lapack - ] - ++ lib.optional withLuaJIT luajit - ++ lib.optional (!withLuaJIT) lua; + buildInputs = [ + doctest + fmt_11 + glib + openssl + pcre + sqlite + ragel + fasttext + icu + jemalloc + libsodium + xxHash + zstd + libarchive + vectorscan + ] + ++ lib.optionals withBlas [ + blas + lapack + ] + ++ lib.optional withLuaJIT luajit + ++ lib.optional (!withLuaJIT) lua; cmakeFlags = [ # pcre2 jit seems to cause crashes: https://github.com/NixOS/nixpkgs/pull/181908 @@ -92,7 +91,8 @@ stdenv.mkDerivation rec { "-DSYSTEM_XXHASH=ON" "-DSYSTEM_ZSTD=ON" "-DENABLE_HYPERSCAN=ON" - ] ++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF"; + ] + ++ lib.optional (!withLuaJIT) "-DENABLE_LUAJIT=OFF"; passthru.tests.rspamd = nixosTests.rspamd; diff --git a/pkgs/by-name/rs/rstudio/package.nix b/pkgs/by-name/rs/rstudio/package.nix index f20943963c5a..a235a626ab37 100644 --- a/pkgs/by-name/rs/rstudio/package.nix +++ b/pkgs/by-name/rs/rstudio/package.nix @@ -122,70 +122,67 @@ stdenv.mkDerivation rec { outputHashMode = "recursive"; }; - nativeBuildInputs = - [ - cmake - git + nativeBuildInputs = [ + cmake + git - ant - jdk + ant + jdk - nodejs - yarn - yarnConfigHook - zip - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild - ] - ++ lib.optionals (!server) [ - makeWrapper - (nodejs.python.withPackages (ps: [ ps.setuptools ])) - npmHooks.npmConfigHook - ]; + nodejs + yarn + yarnConfigHook + zip + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild + ] + ++ lib.optionals (!server) [ + makeWrapper + (nodejs.python.withPackages (ps: [ ps.setuptools ])) + npmHooks.npmConfigHook + ]; - buildInputs = - [ - boost187 - libuuid - openssl - R - soci - sqlite.dev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_11 - ] - ++ lib.optionals (!server) [ - fontconfig - ] - ++ lib.optionals server [ - pam - zlib - ]; + buildInputs = [ + boost187 + libuuid + openssl + R + soci + sqlite.dev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_11 + ] + ++ lib.optionals (!server) [ + fontconfig + ] + ++ lib.optionals server [ + pam + zlib + ]; - cmakeFlags = - [ - (lib.cmakeFeature "RSTUDIO_TARGET" (if server then "Server" else "Electron")) + cmakeFlags = [ + (lib.cmakeFeature "RSTUDIO_TARGET" (if server then "Server" else "Electron")) - # don't try fetching the external dependencies already fetched in extSrcs - (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) + # don't try fetching the external dependencies already fetched in extSrcs + (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) - (lib.cmakeBool "RSTUDIO_USE_SYSTEM_BOOST" true) - (lib.cmakeBool "RSTUDIO_USE_SYSTEM_SOCI" true) + (lib.cmakeBool "RSTUDIO_USE_SYSTEM_BOOST" true) + (lib.cmakeBool "RSTUDIO_USE_SYSTEM_SOCI" true) - (lib.cmakeBool "RSTUDIO_DISABLE_CHECK_FOR_UPDATES" true) - (lib.cmakeBool "QUARTO_ENABLED" true) - (lib.cmakeBool "RSTUDIO_ENABLE_COPILOT" false) # copilot-language-server is unfree - (lib.cmakeBool "RSTUDIO_CRASHPAD_ENABLED" false) # This is a NOOP except on x86_64-darwin + (lib.cmakeBool "RSTUDIO_DISABLE_CHECK_FOR_UPDATES" true) + (lib.cmakeBool "QUARTO_ENABLED" true) + (lib.cmakeBool "RSTUDIO_ENABLE_COPILOT" false) # copilot-language-server is unfree + (lib.cmakeBool "RSTUDIO_CRASHPAD_ENABLED" false) # This is a NOOP except on x86_64-darwin - (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" ( - (placeholder "out") + (if stdenv.hostPlatform.isDarwin then "/Applications" else "/lib/rstudio") - )) - ] - ++ lib.optionals (!server) [ - (lib.cmakeBool "RSTUDIO_INSTALL_FREEDESKTOP" stdenv.hostPlatform.isLinux) - ]; + (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" ( + (placeholder "out") + (if stdenv.hostPlatform.isDarwin then "/Applications" else "/lib/rstudio") + )) + ] + ++ lib.optionals (!server) [ + (lib.cmakeBool "RSTUDIO_INSTALL_FREEDESKTOP" stdenv.hostPlatform.isLinux) + ]; env = { ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; @@ -249,108 +246,106 @@ stdenv.mkDerivation rec { hash = "sha256-64PJPUE/xwdQdxVGiKzy8ADnxXH/qGQtFMib0unZpoA="; }; - preConfigure = - '' - # populate the directories used by cmake's FetchContent - mkdir -p build/_deps - cp -r "$extSrcs"/* build/_deps - chmod -R u+w build/_deps + preConfigure = '' + # populate the directories used by cmake's FetchContent + mkdir -p build/_deps + cp -r "$extSrcs"/* build/_deps + chmod -R u+w build/_deps - # set up node_modules directory inside quarto so that panmirror can be built - mkdir src/gwt/lib/quarto - cp -r --no-preserve=all ${quartoSrc}/* src/gwt/lib/quarto - pushd src/gwt/lib/quarto - yarnConfigHook - popd + # set up node_modules directory inside quarto so that panmirror can be built + mkdir src/gwt/lib/quarto + cp -r --no-preserve=all ${quartoSrc}/* src/gwt/lib/quarto + pushd src/gwt/lib/quarto + yarnConfigHook + popd - ### set up dependencies that will be copied into the result - # note: only the directory names have to match upstream, the actual versions don't - # note: symlinks are preserved + ### set up dependencies that will be copied into the result + # note: only the directory names have to match upstream, the actual versions don't + # note: symlinks are preserved - mkdir dependencies/dictionaries - for dict in ${builtins.concatStringsSep " " dictionaries}; do - for i in "$dict/share/hunspell/"*; do - ln -s $i dependencies/dictionaries/ - done + mkdir dependencies/dictionaries + for dict in ${builtins.concatStringsSep " " dictionaries}; do + for i in "$dict/share/hunspell/"*; do + ln -s $i dependencies/dictionaries/ done + done - ln -s ${quartoWrapper} dependencies/quarto + ln -s ${quartoWrapper} dependencies/quarto - # version in dependencies/common/install-mathjax - ln -s ${mathJaxSrc} dependencies/mathjax-27 + # version in dependencies/common/install-mathjax + ln -s ${mathJaxSrc} dependencies/mathjax-27 - mkdir -p dependencies/common/node - # node used by cmake - # version in cmake/globals.cmake (RSTUDIO_NODE_VERSION) - ln -s ${nodejs} dependencies/common/node/22.13.1 + mkdir -p dependencies/common/node + # node used by cmake + # version in cmake/globals.cmake (RSTUDIO_NODE_VERSION) + ln -s ${nodejs} dependencies/common/node/22.13.1 - '' - + lib.optionalString (!server) '' - pushd $npmRoot + '' + + lib.optionalString (!server) '' + pushd $npmRoot - substituteInPlace package.json \ - --replace-fail "npm ci && " "" + substituteInPlace package.json \ + --replace-fail "npm ci && " "" - # use electron's headers to make node-gyp compile against the electron ABI - export npm_config_nodedir="${electron.headers}" + # use electron's headers to make node-gyp compile against the electron ABI + export npm_config_nodedir="${electron.headers}" - ### override the detected electron version - substituteInPlace node_modules/@electron-forge/core-utils/dist/electron-version.js \ - --replace-fail "return version" "return '${electron.version}'" + ### override the detected electron version + substituteInPlace node_modules/@electron-forge/core-utils/dist/electron-version.js \ + --replace-fail "return version" "return '${electron.version}'" - ### create the electron archive to be used by electron-packager - cp -r ${electron.dist} electron-dist - chmod -R u+w electron-dist + ### create the electron archive to be used by electron-packager + cp -r ${electron.dist} electron-dist + chmod -R u+w electron-dist - pushd electron-dist - zip -0Xqr ../electron.zip . - popd + pushd electron-dist + zip -0Xqr ../electron.zip . + popd - rm -r electron-dist + rm -r electron-dist - # force @electron/packager to use our electron instead of downloading it - substituteInPlace node_modules/@electron/packager/dist/packager.js \ - --replace-fail "await this.getElectronZipPath(downloadOpts)" "'$(pwd)/electron.zip'" + # force @electron/packager to use our electron instead of downloading it + substituteInPlace node_modules/@electron/packager/dist/packager.js \ + --replace-fail "await this.getElectronZipPath(downloadOpts)" "'$(pwd)/electron.zip'" - # Work around known nan issue for electron_33 and above - # https://github.com/nodejs/nan/issues/978 - substituteInPlace node_modules/nan/nan.h \ - --replace-fail '#include "nan_scriptorigin.h"' "" + # Work around known nan issue for electron_33 and above + # https://github.com/nodejs/nan/issues/978 + substituteInPlace node_modules/nan/nan.h \ + --replace-fail '#include "nan_scriptorigin.h"' "" - # now that we patched everything, we still have to run the scripts we ignored with --ignore-scripts - npm rebuild + # now that we patched everything, we still have to run the scripts we ignored with --ignore-scripts + npm rebuild - popd - ''; + popd + ''; - postInstall = - '' - mkdir -p $out/bin - '' - + lib.optionalString (server && stdenv.hostPlatform.isLinux) '' - ln -s $out/lib/rstudio/bin/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin - '' - + lib.optionalString (!server && stdenv.hostPlatform.isLinux) '' - # remove unneeded electron files, since we'll wrap the app with our own electron - shopt -s extglob - rm -r $out/lib/rstudio/!(locales|resources|resources.pak) + postInstall = '' + mkdir -p $out/bin + '' + + lib.optionalString (server && stdenv.hostPlatform.isLinux) '' + ln -s $out/lib/rstudio/bin/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin + '' + + lib.optionalString (!server && stdenv.hostPlatform.isLinux) '' + # remove unneeded electron files, since we'll wrap the app with our own electron + shopt -s extglob + rm -r $out/lib/rstudio/!(locales|resources|resources.pak) - makeWrapper ${lib.getExe electron} "$out/bin/rstudio" \ - --add-flags "$out/lib/rstudio/resources/app/" \ - --set-default ELECTRON_FORCE_IS_PACKAGED 1 \ - --suffix PATH : ${lib.makeBinPath [ gnumake ]} + makeWrapper ${lib.getExe electron} "$out/bin/rstudio" \ + --add-flags "$out/lib/rstudio/resources/app/" \ + --set-default ELECTRON_FORCE_IS_PACKAGED 1 \ + --suffix PATH : ${lib.makeBinPath [ gnumake ]} - ln -s $out/lib/rstudio/resources/app/bin/{diagnostics,rpostback} $out/bin - '' - + lib.optionalString (server && stdenv.hostPlatform.isDarwin) '' - ln -s $out/Applications/RStudio.app/Contents/MacOS/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin - '' - + lib.optionalString (!server && stdenv.hostPlatform.isDarwin) '' - # electron can't find its files if we use a symlink here - makeWrapper $out/Applications/RStudio.app/Contents/MacOS/RStudio $out/bin/rstudio + ln -s $out/lib/rstudio/resources/app/bin/{diagnostics,rpostback} $out/bin + '' + + lib.optionalString (server && stdenv.hostPlatform.isDarwin) '' + ln -s $out/Applications/RStudio.app/Contents/MacOS/{crash-handler-proxy,postback,r-ldpath,rpostback,rserver,rserver-pam,rsession,rstudio-server} $out/bin + '' + + lib.optionalString (!server && stdenv.hostPlatform.isDarwin) '' + # electron can't find its files if we use a symlink here + makeWrapper $out/Applications/RStudio.app/Contents/MacOS/RStudio $out/bin/rstudio - ln -s $out/Applications/RStudio.app/Contents/Resources/app/bin/{diagnostics,rpostback} $out/bin - ''; + ln -s $out/Applications/RStudio.app/Contents/Resources/app/bin/{diagnostics,rpostback} $out/bin + ''; passthru = { inherit server; diff --git a/pkgs/by-name/rt/rtags/package.nix b/pkgs/by-name/rt/rtags/package.nix index 026ef45b442b..4810f666f3e9 100644 --- a/pkgs/by-name/rt/rtags/package.nix +++ b/pkgs/by-name/rt/rtags/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { llvmPackages.libclang openssl emacs - ] ++ lib.optionals stdenv.cc.isGNU [ llvmPackages.clang-unwrapped ]; + ] + ++ lib.optionals stdenv.cc.isGNU [ llvmPackages.clang-unwrapped ]; src = fetchFromGitHub { owner = "andersbakken"; diff --git a/pkgs/by-name/rt/rtfm/package.nix b/pkgs/by-name/rt/rtfm/package.nix index 6fd04196ac17..dfde3149aa92 100644 --- a/pkgs/by-name/rt/rtfm/package.nix +++ b/pkgs/by-name/rt/rtfm/package.nix @@ -74,7 +74,8 @@ crystal.buildCrystalPackage { nativeBuildInputs = [ wrapGAppsHook4 gobject-introspection - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ webkitgtk_6_0 diff --git a/pkgs/by-name/rt/rtmpdump/package.nix b/pkgs/by-name/rt/rtmpdump/package.nix index 11beec3b0141..e87b76e8f1c9 100644 --- a/pkgs/by-name/rt/rtmpdump/package.nix +++ b/pkgs/by-name/rt/rtmpdump/package.nix @@ -27,22 +27,22 @@ stdenv.mkDerivation { makeFlagsArray+=(CC="$CC") ''; - makeFlags = - [ - "prefix=$(out)" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ] - ++ lib.optional gnutlsSupport "CRYPTO=GNUTLS" - ++ lib.optional opensslSupport "CRYPTO=OPENSSL" - ++ lib.optional stdenv.hostPlatform.isDarwin "SYS=darwin"; + makeFlags = [ + "prefix=$(out)" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ] + ++ lib.optional gnutlsSupport "CRYPTO=GNUTLS" + ++ lib.optional opensslSupport "CRYPTO=OPENSSL" + ++ lib.optional stdenv.hostPlatform.isDarwin "SYS=darwin"; - propagatedBuildInputs = - [ zlib ] - ++ lib.optionals gnutlsSupport [ - gnutls - nettle - ] - ++ lib.optional opensslSupport openssl; + propagatedBuildInputs = [ + zlib + ] + ++ lib.optionals gnutlsSupport [ + gnutls + nettle + ] + ++ lib.optional opensslSupport openssl; outputs = [ "out" diff --git a/pkgs/by-name/rt/rtorrent/package.nix b/pkgs/by-name/rt/rtorrent/package.nix index 4429667a423b..8cd504e6b4a1 100644 --- a/pkgs/by-name/rt/rtorrent/package.nix +++ b/pkgs/by-name/rt/rtorrent/package.nix @@ -52,12 +52,14 @@ stdenv.mkDerivation (finalAttrs: { ncurses openssl zlib - ] ++ lib.optionals withLua [ lua5_4_compat ]; + ] + ++ lib.optionals withLua [ lua5_4_compat ]; configureFlags = [ "--with-xmlrpc-tinyxml2" "--with-posix-fallocate" - ] ++ lib.optionals withLua [ "--with-lua" ]; + ] + ++ lib.optionals withLua [ "--with-lua" ]; passthru = { updateScript = gitUpdater { rev-prefix = "v"; }; diff --git a/pkgs/by-name/ru/rubyfmt/package.nix b/pkgs/by-name/ru/rubyfmt/package.nix index 3c395a8608bb..6dda34f02844 100644 --- a/pkgs/by-name/ru/rubyfmt/package.nix +++ b/pkgs/by-name/ru/rubyfmt/package.nix @@ -35,18 +35,17 @@ rustPlatform.buildRustPackage rec { ruby ]; - buildInputs = - [ - zlib - libxcrypt - libyaml - rust-jemalloc-sys-unprefixed - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - readline - libiconv - libunwind - ]; + buildInputs = [ + zlib + libxcrypt + libyaml + rust-jemalloc-sys-unprefixed + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + readline + libiconv + libunwind + ]; preConfigure = '' pushd librubyfmt/ruby_checkout diff --git a/pkgs/by-name/ru/ruffle/package.nix b/pkgs/by-name/ru/ruffle/package.nix index 1320914a2e46..d8127e1dca0a 100644 --- a/pkgs/by-name/ru/ruffle/package.nix +++ b/pkgs/by-name/ru/ruffle/package.nix @@ -46,13 +46,14 @@ rustPlatform.buildRustPackage (finalAttrs: { VERGEN_GIT_COMMIT_TIMESTAMP = "${versionDate}T00:00:00Z"; }; - nativeBuildInputs = - [ jre_minimal ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - autoPatchelfHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ]; + nativeBuildInputs = [ + jre_minimal + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + autoPatchelfHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib @@ -87,22 +88,21 @@ rustPlatform.buildRustPackage (finalAttrs: { finalAttrs.openh264-241 ]; - postInstall = - '' - mv $out/bin/ruffle_desktop $out/bin/ruffle - install -Dm644 LICENSE.md -t $out/share/doc/ruffle - install -Dm644 README.md -t $out/share/doc/ruffle - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.desktop \ - -t $out/share/applications/ + postInstall = '' + mv $out/bin/ruffle_desktop $out/bin/ruffle + install -Dm644 LICENSE.md -t $out/share/doc/ruffle + install -Dm644 README.md -t $out/share/doc/ruffle + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.desktop \ + -t $out/share/applications/ - install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.svg \ - -t $out/share/icons/hicolor/scalable/apps/ + install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.svg \ + -t $out/share/icons/hicolor/scalable/apps/ - install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml \ - -t $out/share/metainfo/ - ''; + install -Dm644 desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml \ + -t $out/share/metainfo/ + ''; passthru = { updateScript = lib.getExe (writeShellApplication { diff --git a/pkgs/by-name/ru/runit/package.nix b/pkgs/by-name/ru/runit/package.nix index d3ac271a2a62..1f61b7ee402d 100644 --- a/pkgs/by-name/ru/runit/package.nix +++ b/pkgs/by-name/ru/runit/package.nix @@ -34,16 +34,15 @@ stdenv.mkDerivation rec { stdenv.cc.libc.static ]; - postPatch = - '' - sed -i "s,\(#define RUNIT\) .*,\1 \"$out/bin/runit\"," src/runit.h - # usernamespace sandbox of nix seems to conflict with runit's assumptions - # about unix users. Therefor skip the check - sed -i '/.\/chkshsgr/d' src/Makefile - '' - + lib.optionalString (!static) '' - sed -i 's,-static,,g' src/Makefile - ''; + postPatch = '' + sed -i "s,\(#define RUNIT\) .*,\1 \"$out/bin/runit\"," src/runit.h + # usernamespace sandbox of nix seems to conflict with runit's assumptions + # about unix users. Therefor skip the check + sed -i '/.\/chkshsgr/d' src/Makefile + '' + + lib.optionalString (!static) '' + sed -i 's,-static,,g' src/Makefile + ''; preBuild = '' cd src diff --git a/pkgs/by-name/ru/rust-cbindgen/package.nix b/pkgs/by-name/ru/rust-cbindgen/package.nix index a672d6a2a1ff..87331f17a47c 100644 --- a/pkgs/by-name/ru/rust-cbindgen/package.nix +++ b/pkgs/by-name/ru/rust-cbindgen/package.nix @@ -31,21 +31,20 @@ rustPlatform.buildRustPackage rec { python3Packages.cython ]; - checkFlags = - [ - # Disable tests that require rust unstable features - # https://github.com/eqrion/cbindgen/issues/338 - "--skip test_expand" - "--skip test_bitfield" - "--skip lib_default_uses_debug_build" - "--skip lib_explicit_debug_build" - "--skip lib_explicit_release_build" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # WORKAROUND: test_body fails when using clang - # https://github.com/eqrion/cbindgen/issues/628 - "--skip test_body" - ]; + checkFlags = [ + # Disable tests that require rust unstable features + # https://github.com/eqrion/cbindgen/issues/338 + "--skip test_expand" + "--skip test_bitfield" + "--skip lib_default_uses_debug_build" + "--skip lib_explicit_debug_build" + "--skip lib_explicit_release_build" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # WORKAROUND: test_body fails when using clang + # https://github.com/eqrion/cbindgen/issues/628 + "--skip test_body" + ]; passthru.tests = { inherit diff --git a/pkgs/by-name/ru/rustdesk/package.nix b/pkgs/by-name/ru/rustdesk/package.nix index d7da3b26e7d3..201caebeca8d 100644 --- a/pkgs/by-name/ru/rustdesk/package.nix +++ b/pkgs/by-name/ru/rustdesk/package.nix @@ -118,36 +118,35 @@ rustPlatform.buildRustPackage (finalAttrs: { # Checks require an active X server doCheck = false; - buildInputs = - [ - atk - bzip2 - cairo - dbus - gdk-pixbuf - glib - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - gtk3 - libgit2 - libpulseaudio - libsodium - libXtst - libvpx - libyuv - libopus - libaom - libxkbcommon - pam - pango - zlib - zstd - ] + buildInputs = [ + atk + bzip2 + cairo + dbus + gdk-pixbuf + glib + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + gtk3 + libgit2 + libpulseaudio + libsodium + libXtst + libvpx + libyuv + libopus + libaom + libxkbcommon + pam + pango + zlib + zstd + ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - xdotool - ]; + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + xdotool + ]; # Add static ui resources and libsciter to same folder as binary so that it # can find them. diff --git a/pkgs/by-name/ru/rusty-psn/package.nix b/pkgs/by-name/ru/rusty-psn/package.nix index 1c9c03a91c09..edca07c5e911 100644 --- a/pkgs/by-name/ru/rusty-psn/package.nix +++ b/pkgs/by-name/ru/rusty-psn/package.nix @@ -35,46 +35,43 @@ rustPlatform.buildRustPackage rec { # Tests require network access doCheck = false; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals withGui [ - copyDesktopItems - cmake - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals withGui [ + copyDesktopItems + cmake + ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals withGui [ - fontconfig - glib - gtk3 - freetype - openssl - xorg.libxcb - xorg.libX11 - xorg.libXcursor - xorg.libXrandr - xorg.libXi - xorg.libxcb - libGL - libxkbcommon - wayland - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals withGui [ + fontconfig + glib + gtk3 + freetype + openssl + xorg.libxcb + xorg.libX11 + xorg.libXcursor + xorg.libXrandr + xorg.libXi + xorg.libxcb + libGL + libxkbcommon + wayland + ]; buildNoDefaultFeatures = true; buildFeatures = [ (if withGui then "egui" else "cli") ]; - postFixup = - '' - patchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $out/bin/rusty-psn - '' - + lib.optionalString withGui '' - mv $out/bin/rusty-psn $out/bin/rusty-psn-gui - ''; + postFixup = '' + patchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $out/bin/rusty-psn + '' + + lib.optionalString withGui '' + mv $out/bin/rusty-psn $out/bin/rusty-psn-gui + ''; desktopItem = lib.optionalString withGui (makeDesktopItem { name = "rusty-psn"; diff --git a/pkgs/by-name/ru/rutabaga_gfx/package.nix b/pkgs/by-name/ru/rutabaga_gfx/package.nix index 90c48333c658..2d36973a2bd5 100644 --- a/pkgs/by-name/ru/rutabaga_gfx/package.nix +++ b/pkgs/by-name/ru/rutabaga_gfx/package.nix @@ -34,17 +34,18 @@ stdenv.mkDerivation (finalAttrs: { rustc rustPlatform.cargoSetupHook ]; - buildInputs = - [ libiconv ] - ++ lib.optionals withGfxstream ( - [ - aemu - gfxstream - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [ - libdrm - ] - ); + buildInputs = [ + libiconv + ] + ++ lib.optionals withGfxstream ( + [ + aemu + gfxstream + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [ + libdrm + ] + ); cargoDeps = rustPlatform.fetchCargoVendor { inherit (finalAttrs) src; diff --git a/pkgs/by-name/rv/rvvm/package.nix b/pkgs/by-name/rv/rvvm/package.nix index 2625cd3f5e5a..d57267485766 100644 --- a/pkgs/by-name/rv/rvvm/package.nix +++ b/pkgs/by-name/rv/rvvm/package.nix @@ -50,10 +50,11 @@ stdenv.mkDerivation rec { "lib" ]; - makeFlags = - [ "PREFIX=$(out)" ] - ++ lib.optional enableSDL "USE_SDL=2" # Use SDL2 instead of SDL1 - ++ lib.optional (!enableSDL && !enableX11) "USE_FB=0"; + makeFlags = [ + "PREFIX=$(out)" + ] + ++ lib.optional enableSDL "USE_SDL=2" # Use SDL2 instead of SDL1 + ++ lib.optional (!enableSDL && !enableX11) "USE_FB=0"; meta = with lib; { homepage = "https://github.com/LekKit/RVVM"; diff --git a/pkgs/by-name/ry/rygel/package.nix b/pkgs/by-name/ry/rygel/package.nix index 67a9b43c8305..ee3bb60d9310 100644 --- a/pkgs/by-name/ry/rygel/package.nix +++ b/pkgs/by-name/ry/rygel/package.nix @@ -69,36 +69,35 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - gdk-pixbuf - glib - gssdp_1_6 - gupnp_1_6 - gupnp-av - gupnp-dlna - libgee - libsoup_3 - libmediaart - pipewire - # Move this to withGtk when it's not unconditionally included - # https://gitlab.gnome.org/GNOME/rygel/-/issues/221 - # https://gitlab.gnome.org/GNOME/rygel/-/merge_requests/27 - libX11 - sqlite - systemd - tinysparql - shared-mime-info - ] - ++ lib.optionals withGtk [ gtk3 ] - ++ (with gst_all_1; [ - gstreamer - gst-editing-services - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - ]); + buildInputs = [ + gdk-pixbuf + glib + gssdp_1_6 + gupnp_1_6 + gupnp-av + gupnp-dlna + libgee + libsoup_3 + libmediaart + pipewire + # Move this to withGtk when it's not unconditionally included + # https://gitlab.gnome.org/GNOME/rygel/-/issues/221 + # https://gitlab.gnome.org/GNOME/rygel/-/merge_requests/27 + libX11 + sqlite + systemd + tinysparql + shared-mime-info + ] + ++ lib.optionals withGtk [ gtk3 ] + ++ (with gst_all_1; [ + gstreamer + gst-editing-services + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + ]); mesonFlags = [ "-Dsystemd-user-units-dir=${placeholder "out"}/lib/systemd/user" diff --git a/pkgs/by-name/ry/ryubing/package.nix b/pkgs/by-name/ry/ryubing/package.nix index fc86129a49a7..4399fb5c3d55 100644 --- a/pkgs/by-name/ry/ryubing/package.nix +++ b/pkgs/by-name/ry/ryubing/package.nix @@ -52,35 +52,34 @@ buildDotnetModule rec { nugetDeps = ./deps.json; - runtimeDeps = - [ - libX11 - libgdiplus - SDL2_mixer - openal - libsoundio - sndio - vulkan-loader - ffmpeg + runtimeDeps = [ + libX11 + libgdiplus + SDL2_mixer + openal + libsoundio + sndio + vulkan-loader + ffmpeg - # Avalonia UI - glew - libICE - libSM - libXcursor - libXext - libXi - libXrandr + # Avalonia UI + glew + libICE + libSM + libXcursor + libXext + libXi + libXrandr - # Headless executable - libGL - SDL2 - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) [ - udev - pulseaudio - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ moltenvk ]; + # Headless executable + libGL + SDL2 + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) [ + udev + pulseaudio + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ moltenvk ]; projectFile = "Ryujinx.sln"; testProjectFile = "src/Ryujinx.Tests/Ryujinx.Tests.csproj"; diff --git a/pkgs/by-name/s2/s2n-tls/package.nix b/pkgs/by-name/s2/s2n-tls/package.nix index 4612aacba818..9e22ac018bde 100644 --- a/pkgs/by-name/s2/s2n-tls/package.nix +++ b/pkgs/by-name/s2/s2n-tls/package.nix @@ -27,15 +27,14 @@ stdenv.mkDerivation rec { buildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto). - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=ON" - "-DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF" # disable -Werror - ] - ++ lib.optionals stdenv.hostPlatform.isMips64 [ - # See https://github.com/aws/s2n-tls/issues/1592 and https://github.com/aws/s2n-tls/pull/1609 - "-DS2N_NO_PQ=ON" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF" # disable -Werror + ] + ++ lib.optionals stdenv.hostPlatform.isMips64 [ + # See https://github.com/aws/s2n-tls/issues/1592 and https://github.com/aws/s2n-tls/pull/1609 + "-DS2N_NO_PQ=ON" + ]; propagatedBuildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto). diff --git a/pkgs/by-name/sa/sacrifice/package.nix b/pkgs/by-name/sa/sacrifice/package.nix index cfbc68f40747..62353e481ea7 100644 --- a/pkgs/by-name/sa/sacrifice/package.nix +++ b/pkgs/by-name/sa/sacrifice/package.nix @@ -31,13 +31,12 @@ stdenv.mkDerivation { ./pythia83xx.patch ]; - preConfigure = - '' - substituteInPlace configure --replace HAVE_LCG=yes HAVE_LCG=no - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure --replace LIB_SUFFIX=\"so\" LIB_SUFFIX=\"dylib\" - ''; + preConfigure = '' + substituteInPlace configure --replace HAVE_LCG=yes HAVE_LCG=no + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure --replace LIB_SUFFIX=\"so\" LIB_SUFFIX=\"dylib\" + ''; configureFlags = [ "--with-HepMC=${hepmc2}" diff --git a/pkgs/by-name/sa/saga/package.nix b/pkgs/by-name/sa/saga/package.nix index 1c823d7bbafe..09f39b9a59f3 100644 --- a/pkgs/by-name/sa/saga/package.nix +++ b/pkgs/by-name/sa/saga/package.nix @@ -46,36 +46,36 @@ stdenv.mkDerivation rec { cmake wrapGAppsHook3 pkg-config - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; - buildInputs = - [ - curl - libsForQt5.dxflib - fftw - libsvm - hdf5 - gdal - wxGTK32 - pdal - proj - libharu - opencv - vigra - libpq - libiodbc - xz - qhull - giflib - ] - # See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs - # for why the have additional buildInputs on darwin - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - unixODBC - poppler - netcdf - sqlite - ]; + buildInputs = [ + curl + libsForQt5.dxflib + fftw + libsvm + hdf5 + gdal + wxGTK32 + pdal + proj + libharu + opencv + vigra + libpq + libiodbc + xz + qhull + giflib + ] + # See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs + # for why the have additional buildInputs on darwin + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + unixODBC + poppler + netcdf + sqlite + ]; cmakeFlags = [ (lib.cmakeBool "OpenMP_SUPPORT" (!stdenv.hostPlatform.isDarwin)) diff --git a/pkgs/by-name/sa/sage/sage-env.nix b/pkgs/by-name/sa/sage/sage-env.nix index 525b3a901722..47028995d330 100644 --- a/pkgs/by-name/sa/sage/sage-env.nix +++ b/pkgs/by-name/sa/sage/sage-env.nix @@ -108,106 +108,105 @@ writeTextFile rec { docbuild = sage-docbuild; }; - text = + text = '' + export PKG_CONFIG_PATH='${ + lib.makeSearchPathOutput "dev" "lib/pkgconfig" [ + # This should only be needed during build. However, since the doctests + # also test the cython build (for example in src/sage/misc/cython.py), + # it is also needed for the testsuite to pass. We could fix the + # testsuite instead, but since all the packages are also runtime + # dependencies it doesn't really hurt to include them here. + singular + blas + lapack + fflas-ffpack + givaro + gd + libpng + zlib + gsl + linbox + m4ri + ] + }' + export SAGE_ROOT='${sagelib.src}' + '' + + + # TODO: is using pythonEnv instead of @sage-local@ here a good + # idea? there is a test in src/sage/env.py that checks if the values + # SAGE_ROOT and SAGE_LOCAL set here match the ones set in env.py. + # we fix up env.py's SAGE_ROOT in sage-src.nix (which does not + # have access to sage-with-env), but env.py autodetects + # SAGE_LOCAL to be pythonEnv. + # setting SAGE_LOCAL to pythonEnv also avoids having to create + # python3, ipython, ipython3 and jupyter symlinks in + # sage-with-env.nix. '' - export PKG_CONFIG_PATH='${ - lib.makeSearchPathOutput "dev" "lib/pkgconfig" [ - # This should only be needed during build. However, since the doctests - # also test the cython build (for example in src/sage/misc/cython.py), - # it is also needed for the testsuite to pass. We could fix the - # testsuite instead, but since all the packages are also runtime - # dependencies it doesn't really hurt to include them here. - singular - blas - lapack - fflas-ffpack - givaro - gd - libpng - zlib - gsl - linbox - m4ri - ] - }' - export SAGE_ROOT='${sagelib.src}' - '' - + - # TODO: is using pythonEnv instead of @sage-local@ here a good - # idea? there is a test in src/sage/env.py that checks if the values - # SAGE_ROOT and SAGE_LOCAL set here match the ones set in env.py. - # we fix up env.py's SAGE_ROOT in sage-src.nix (which does not - # have access to sage-with-env), but env.py autodetects - # SAGE_LOCAL to be pythonEnv. - # setting SAGE_LOCAL to pythonEnv also avoids having to create - # python3, ipython, ipython3 and jupyter symlinks in - # sage-with-env.nix. - '' - export SAGE_LOCAL='${pythonEnv}' + export SAGE_LOCAL='${pythonEnv}' - export SAGE_SHARE='${sagelib}/share' - export SAGE_ENV_CONFIG_SOURCED=1 # sage-env complains if sage-env-config is not sourced beforehand - orig_path="$PATH" - export PATH='${runtimepath}' + export SAGE_SHARE='${sagelib}/share' + export SAGE_ENV_CONFIG_SOURCED=1 # sage-env complains if sage-env-config is not sourced beforehand + orig_path="$PATH" + export PATH='${runtimepath}' - # set dependent vars, like JUPYTER_CONFIG_DIR - source "${sagelib.src}/src/bin/sage-env" - export PATH="$RUNTIMEPATH_PREFIX:${runtimepath}:$orig_path" # sage-env messes with PATH + # set dependent vars, like JUPYTER_CONFIG_DIR + source "${sagelib.src}/src/bin/sage-env" + export PATH="$RUNTIMEPATH_PREFIX:${runtimepath}:$orig_path" # sage-env messes with PATH - export SAGE_LOGS="$TMPDIR/sage-logs" - export SAGE_DOC="''${SAGE_DOC_OVERRIDE:-doc-placeholder}" - export SAGE_DOC_SRC="''${SAGE_DOC_SRC_OVERRIDE:-${sagelib.src}/src/doc}" + export SAGE_LOGS="$TMPDIR/sage-logs" + export SAGE_DOC="''${SAGE_DOC_OVERRIDE:-doc-placeholder}" + export SAGE_DOC_SRC="''${SAGE_DOC_SRC_OVERRIDE:-${sagelib.src}/src/doc}" - # set locations of dependencies - . ${env-locations}/sage-env-locations + # set locations of dependencies + . ${env-locations}/sage-env-locations - # needed for cython - export CC='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc' - export CXX='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++' - # cython needs to find these libraries, otherwise will fail with `ld: cannot find -lflint` or similar - export LDFLAGS='${ - lib.concatStringsSep " " ( - map (pkg: "-L${pkg}/lib") [ - flint3 - gap - glpk - gmp - mpfr - pari - zlib - eclib - gsl - ntl - sympow - ] - ) - }' - export CFLAGS='${ - lib.concatStringsSep " " ( - map (pkg: "-isystem ${pkg}/include") [ - singular - gmp.dev - glpk - flint3 - gap - mpfr.dev - ] - ) - }' - export CXXFLAGS=$CFLAGS - - export SAGE_LIB='${sagelib}/${python3.sitePackages}' - - export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data' - - # for find_library - export DYLD_LIBRARY_PATH="${ - lib.makeLibraryPath [ - stdenv.cc.libc - singular - giac + # needed for cython + export CC='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc' + export CXX='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++' + # cython needs to find these libraries, otherwise will fail with `ld: cannot find -lflint` or similar + export LDFLAGS='${ + lib.concatStringsSep " " ( + map (pkg: "-L${pkg}/lib") [ + flint3 gap + glpk + gmp + mpfr + pari + zlib + eclib + gsl + ntl + sympow ] - }''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH" - ''; + ) + }' + export CFLAGS='${ + lib.concatStringsSep " " ( + map (pkg: "-isystem ${pkg}/include") [ + singular + gmp.dev + glpk + flint3 + gap + mpfr.dev + ] + ) + }' + export CXXFLAGS=$CFLAGS + + export SAGE_LIB='${sagelib}/${python3.sitePackages}' + + export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data' + + # for find_library + export DYLD_LIBRARY_PATH="${ + lib.makeLibraryPath [ + stdenv.cc.libc + singular + giac + gap + ] + }''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH" + ''; } diff --git a/pkgs/by-name/sa/sage/sage-src.nix b/pkgs/by-name/sa/sage/sage-src.nix index 26979068fc3a..c5a9092216ca 100644 --- a/pkgs/by-name/sa/sage/sage-src.nix +++ b/pkgs/by-name/sa/sage/sage-src.nix @@ -34,25 +34,24 @@ stdenv.mkDerivation rec { # Patches needed because of particularities of nix or the way this is packaged. # The goal is to upstream all of them and get rid of this list. - nixPatches = - [ - # Parallelize docubuild using subprocesses, fixing an isolation issue. See - # https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE - ./patches/sphinx-docbuild-subprocesses.patch + nixPatches = [ + # Parallelize docubuild using subprocesses, fixing an isolation issue. See + # https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE + ./patches/sphinx-docbuild-subprocesses.patch - # After updating smypow to (https://github.com/sagemath/sage/issues/3360) - # we can now set the cache dir to be within the .sage directory. This is - # not strictly necessary, but keeps us from littering in the user's HOME. - ./patches/sympow-cache.patch - ] - ++ lib.optionals (stdenv.cc.isClang) [ - # https://github.com/NixOS/nixpkgs/pull/264126 - # Dead links in python sysconfig cause LLVM linker warnings, leading to cython doctest failures. - ./patches/silence-linker.patch + # After updating smypow to (https://github.com/sagemath/sage/issues/3360) + # we can now set the cache dir to be within the .sage directory. This is + # not strictly necessary, but keeps us from littering in the user's HOME. + ./patches/sympow-cache.patch + ] + ++ lib.optionals (stdenv.cc.isClang) [ + # https://github.com/NixOS/nixpkgs/pull/264126 + # Dead links in python sysconfig cause LLVM linker warnings, leading to cython doctest failures. + ./patches/silence-linker.patch - # Stack overflows during doctests; this does not change functionality. - ./patches/disable-singular-doctest.patch - ]; + # Stack overflows during doctests; this does not change functionality. + ./patches/disable-singular-doctest.patch + ]; # Since sage unfortunately does not release bugfix releases, packagers must # fix those bugs themselves. This is for critical bugfixes, where "critical" diff --git a/pkgs/by-name/sa/sage/sage.nix b/pkgs/by-name/sa/sage/sage.nix index 3a1b20b9e87d..0f232414ccbc 100644 --- a/pkgs/by-name/sa/sage/sage.nix +++ b/pkgs/by-name/sa/sage/sage.nix @@ -44,20 +44,19 @@ stdenv.mkDerivation rec { "$out/bin/sage" -c 'browse_sage_doc._open("reference", testing=True)' ''; - passthru = - { - tests = sage-tests; - quicktest = sage-tests.override { - longTests = false; - timeLimit = 600; - }; # as many tests as possible in ~10m - lib = sage-with-env.env.lib; - with-env = sage-with-env; - kernelspec = jupyter-kernel-definition; - } - // lib.optionalAttrs withDoc { - doc = sagedoc; - }; + passthru = { + tests = sage-tests; + quicktest = sage-tests.override { + longTests = false; + timeLimit = 600; + }; # as many tests as possible in ~10m + lib = sage-with-env.env.lib; + with-env = sage-with-env; + kernelspec = jupyter-kernel-definition; + } + // lib.optionalAttrs withDoc { + doc = sagedoc; + }; meta = with lib; { description = "Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"; diff --git a/pkgs/by-name/sa/sagittarius-scheme/package.nix b/pkgs/by-name/sa/sagittarius-scheme/package.nix index c586a0f622e8..d464eb494a06 100644 --- a/pkgs/by-name/sa/sagittarius-scheme/package.nix +++ b/pkgs/by-name/sa/sagittarius-scheme/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation rec { boehmgc openssl zlib - ] ++ lib.optional odbcSupport libiodbc; + ] + ++ lib.optional odbcSupport libiodbc; env.NIX_CFLAGS_COMPILE = toString ( lib.optionals stdenv.hostPlatform.isDarwin [ diff --git a/pkgs/by-name/sa/salmon/package.nix b/pkgs/by-name/sa/salmon/package.nix index 4f3a31f5efcd..0d2250c77f07 100644 --- a/pkgs/by-name/sa/salmon/package.nix +++ b/pkgs/by-name/sa/salmon/package.nix @@ -58,7 +58,8 @@ stdenv.mkDerivation (finalAttrs: { tbb_2021 xz zlib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/sa/samtools/package.nix b/pkgs/by-name/sa/samtools/package.nix index 10bb0010a940..072234599cdc 100644 --- a/pkgs/by-name/sa/samtools/package.nix +++ b/pkgs/by-name/sa/samtools/package.nix @@ -33,10 +33,11 @@ stdenv.mkDerivation rec { ''; makeFlags = lib.optional stdenv.hostPlatform.isStatic "AR=${stdenv.cc.targetPrefix}ar"; - configureFlags = - [ "--with-htslib=${htslib}" ] - ++ lib.optional (ncurses == null) "--without-curses" - ++ lib.optionals stdenv.hostPlatform.isStatic [ "--without-curses" ]; + configureFlags = [ + "--with-htslib=${htslib}" + ] + ++ lib.optional (ncurses == null) "--without-curses" + ++ lib.optionals stdenv.hostPlatform.isStatic [ "--without-curses" ]; preCheck = '' patchShebangs test/ diff --git a/pkgs/by-name/sa/sapling/package.nix b/pkgs/by-name/sa/sapling/package.nix index db73519e3530..b47d8078a512 100644 --- a/pkgs/by-name/sa/sapling/package.nix +++ b/pkgs/by-name/sa/sapling/package.nix @@ -114,17 +114,16 @@ python311Packages.buildPythonApplication { "serde_bser-0.4.0" = "sha256-Su1IP3NzQu/87p/+uQaG8JcICL9hit3OV1O9oFiACsQ="; }; }; - postPatch = - '' - cp ${./Cargo.lock} Cargo.lock - '' - + lib.optionalString (!enableMinimal) '' - # If asked, we optionally patch in a hardcoded path to the - # 'nodejs' package, so that 'sl web' always works. Without the - # patch, 'sl web' will still work if 'nodejs' is in $PATH. - substituteInPlace lib/config/loader/src/builtin_static/core.rs \ - --replace '"#);' $'[web]\nnode-path=${nodejs}/bin/node\n"#);' - ''; + postPatch = '' + cp ${./Cargo.lock} Cargo.lock + '' + + lib.optionalString (!enableMinimal) '' + # If asked, we optionally patch in a hardcoded path to the + # 'nodejs' package, so that 'sl web' always works. Without the + # patch, 'sl web' will still work if 'nodejs' is in $PATH. + substituteInPlace lib/config/loader/src/builtin_static/core.rs \ + --replace '"#);' $'[web]\nnode-path=${nodejs}/bin/node\n"#);' + ''; # Since the derivation builder doesn't have network access to remain pure, # fetch the artifacts manually and link them. Then replace the hardcoded URLs @@ -154,14 +153,13 @@ python311Packages.buildPythonApplication { rustc ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + libiconv + ]; HGNAME = "sl"; SAPLING_OSS_BUILD = "true"; diff --git a/pkgs/by-name/sa/satdump/package.nix b/pkgs/by-name/sa/satdump/package.nix index 3d5b7f41a0f0..4ca5fb9d77da 100644 --- a/pkgs/by-name/sa/satdump/package.nix +++ b/pkgs/by-name/sa/satdump/package.nix @@ -62,36 +62,35 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - fftwFloat - libpng - libtiff - jemalloc - volk - nng - curl - ] - ++ lib.optionals withZIQRecordingCompression [ zstd ] - ++ lib.optionals withGUI [ - glfw - zenity - ] - ++ lib.optionals withAudio [ portaudio ] - ++ lib.optionals withOfficialProductSupport [ hdf5 ] - ++ lib.optionals withOpenCL [ - opencl-headers - ocl-icd - ] - ++ lib.optionals withSourceRtlsdr [ rtl-sdr-librtlsdr ] - ++ lib.optionals withSourceHackRF [ hackrf ] - ++ lib.optionals withSourceAirspy [ airspy ] - ++ lib.optionals withSourceAirspyHF [ airspyhf ] - ++ lib.optionals withSourceAD9361 [ - libad9361 - libiio - ] - ++ lib.optionals withSourceBladeRF [ libbladeRF ]; + buildInputs = [ + fftwFloat + libpng + libtiff + jemalloc + volk + nng + curl + ] + ++ lib.optionals withZIQRecordingCompression [ zstd ] + ++ lib.optionals withGUI [ + glfw + zenity + ] + ++ lib.optionals withAudio [ portaudio ] + ++ lib.optionals withOfficialProductSupport [ hdf5 ] + ++ lib.optionals withOpenCL [ + opencl-headers + ocl-icd + ] + ++ lib.optionals withSourceRtlsdr [ rtl-sdr-librtlsdr ] + ++ lib.optionals withSourceHackRF [ hackrf ] + ++ lib.optionals withSourceAirspy [ airspy ] + ++ lib.optionals withSourceAirspyHF [ airspyhf ] + ++ lib.optionals withSourceAD9361 [ + libad9361 + libiio + ] + ++ lib.optionals withSourceBladeRF [ libbladeRF ]; cmakeFlags = [ (lib.cmakeBool "BUILD_GUI" withGUI) ]; diff --git a/pkgs/by-name/sa/satysfi/package.nix b/pkgs/by-name/sa/satysfi/package.nix index b2a393939a60..3d4d042c5e88 100644 --- a/pkgs/by-name/sa/satysfi/package.nix +++ b/pkgs/by-name/sa/satysfi/package.nix @@ -57,22 +57,21 @@ ocamlPackages.buildDunePackage { cppo ]; - buildInputs = - [ - camlpdf - yojson-with-position - ] - ++ (with ocamlPackages; [ - menhirLib - batteries - camlimages - core_kernel - ppx_deriving - uutf - omd - re - otfed - ]); + buildInputs = [ + camlpdf + yojson-with-position + ] + ++ (with ocamlPackages; [ + menhirLib + batteries + camlimages + core_kernel + ppx_deriving + uutf + omd + re + otfed + ]); postInstall = '' mkdir -p $out/share/satysfi/dist/fonts diff --git a/pkgs/by-name/sb/sbctl/package.nix b/pkgs/by-name/sb/sbctl/package.nix index 8f971ca08294..878aba99e4cd 100644 --- a/pkgs/by-name/sb/sbctl/package.nix +++ b/pkgs/by-name/sb/sbctl/package.nix @@ -44,16 +44,15 @@ buildGoModule rec { "github.com/google/go-tpm-tools/.*" ]; - postInstall = - '' - installManPage docs/sbctl.conf.5 docs/sbctl.8 - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd sbctl \ - --bash <($out/bin/sbctl completion bash) \ - --fish <($out/bin/sbctl completion fish) \ - --zsh <($out/bin/sbctl completion zsh) - ''; + postInstall = '' + installManPage docs/sbctl.conf.5 docs/sbctl.8 + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd sbctl \ + --bash <($out/bin/sbctl completion bash) \ + --fish <($out/bin/sbctl completion fish) \ + --zsh <($out/bin/sbctl completion zsh) + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/sc/sc-im/package.nix b/pkgs/by-name/sc/sc-im/package.nix index 984d052b7ed1..203b45737eda 100644 --- a/pkgs/by-name/sc/sc-im/package.nix +++ b/pkgs/by-name/sc/sc-im/package.nix @@ -35,17 +35,16 @@ stdenv.mkDerivation rec { bison ]; - buildInputs = - [ - gnuplot - libxml2 - libzip - ncurses - ] - ++ lib.optionals xlsSupport [ - libxls - libxlsxwriter - ]; + buildInputs = [ + gnuplot + libxml2 + libzip + ncurses + ] + ++ lib.optionals xlsSupport [ + libxls + libxlsxwriter + ]; makeFlags = [ "prefix=${placeholder "out"}" ]; diff --git a/pkgs/by-name/sc/scala-cli/package.nix b/pkgs/by-name/sc/scala-cli/package.nix index e355ae64bf68..406670f00451 100644 --- a/pkgs/by-name/sc/scala-cli/package.nix +++ b/pkgs/by-name/sc/scala-cli/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ installShellFiles makeWrapper - ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; buildInputs = assert lib.assertMsg (lib.versionAtLeast jre.version "17.0.0") '' scala-cli requires Java 17 or newer, but ${jre.name} is ${jre.version} diff --git a/pkgs/by-name/sc/scalp/package.nix b/pkgs/by-name/sc/scalp/package.nix index fcd0ce58c24f..44adf8c0dd87 100644 --- a/pkgs/by-name/sc/scalp/package.nix +++ b/pkgs/by-name/sc/scalp/package.nix @@ -23,18 +23,17 @@ stdenv.mkDerivation rec { hash = "sha256-6OEf3yWFBmTKgeTMojRMRf/t9Ec1i851Lx3mQjCeOuw="; }; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail "\''$ORIGIN" "\''${CMAKE_INSTALL_PREFIX}/lib" \ - --replace-fail "-m64" "" - substituteInPlace src/tests/CMakeLists.txt \ - --replace-fail "src/tests/" "" - '' - + lib.optionalString withGurobi '' - substituteInPlace CMakeExtensions/FindGurobi.cmake \ - --replace-fail "\''${GUROBI_VERSION}" '"${lib.versions.major gurobi.version}${lib.versions.minor gurobi.version}"' - ''; + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail "\''$ORIGIN" "\''${CMAKE_INSTALL_PREFIX}/lib" \ + --replace-fail "-m64" "" + substituteInPlace src/tests/CMakeLists.txt \ + --replace-fail "src/tests/" "" + '' + + lib.optionalString withGurobi '' + substituteInPlace CMakeExtensions/FindGurobi.cmake \ + --replace-fail "\''${GUROBI_VERSION}" '"${lib.versions.major gurobi.version}${lib.versions.minor gurobi.version}"' + ''; nativeBuildInputs = [ cmake @@ -51,19 +50,18 @@ stdenv.mkDerivation rec { lp_solve ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_TESTS" doCheck) - ] - ++ lib.optionals withGurobi [ - (lib.cmakeFeature "GUROBI_ROOT_DIR" "${gurobi}") - ] - ++ lib.optionals withCplex [ - (lib.cmakeFeature "CPLEX_ROOT_DIR" "${cplex}") - ] - ++ lib.optionals withLpsolve [ - (lib.cmakeFeature "LPSOLVE_ROOT_DIR" "${lp_solve}") - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_TESTS" doCheck) + ] + ++ lib.optionals withGurobi [ + (lib.cmakeFeature "GUROBI_ROOT_DIR" "${gurobi}") + ] + ++ lib.optionals withCplex [ + (lib.cmakeFeature "CPLEX_ROOT_DIR" "${cplex}") + ] + ++ lib.optionals withLpsolve [ + (lib.cmakeFeature "LPSOLVE_ROOT_DIR" "${lp_solve}") + ]; doCheck = true; diff --git a/pkgs/by-name/sc/scanbd/package.nix b/pkgs/by-name/sc/scanbd/package.nix index d04226c6b4a8..b80f271d225c 100644 --- a/pkgs/by-name/sc/scanbd/package.nix +++ b/pkgs/by-name/sc/scanbd/package.nix @@ -28,18 +28,17 @@ stdenv.mkDerivation rec { systemd ]; - configureFlags = - [ - "--disable-Werror" - "--enable-udev" - "--with-scanbdconfdir=/etc/scanbd" - "--with-systemdsystemunitdir=$out/lib/systemd/system" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # AC_FUNC_MALLOC is broken on cross builds. - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ]; + configureFlags = [ + "--disable-Werror" + "--enable-udev" + "--with-scanbdconfdir=/etc/scanbd" + "--with-systemdsystemunitdir=$out/lib/systemd/system" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # AC_FUNC_MALLOC is broken on cross builds. + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/sc/scdoc/package.nix b/pkgs/by-name/sc/scdoc/package.nix index 2ad334ecfaab..708178b265d9 100644 --- a/pkgs/by-name/sc/scdoc/package.nix +++ b/pkgs/by-name/sc/scdoc/package.nix @@ -27,13 +27,12 @@ stdenv.mkDerivation (finalAttrs: { --replace "LDFLAGS+=-static" "LDFLAGS+=" ''; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "HOST_SCDOC=${lib.getExe buildPackages.scdoc}" - ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "HOST_SCDOC=${lib.getExe buildPackages.scdoc}" + ]; doCheck = true; diff --git a/pkgs/by-name/sc/schismtracker/package.nix b/pkgs/by-name/sc/schismtracker/package.nix index 0994fea35340..13c3eda19e5e 100644 --- a/pkgs/by-name/sc/schismtracker/package.nix +++ b/pkgs/by-name/sc/schismtracker/package.nix @@ -32,19 +32,18 @@ stdenv.mkDerivation rec { --replace-fail 'git log' 'echo ${version} #' ''; - configureFlags = - [ - (lib.enableFeature true "dependency-tracking") - (lib.withFeature true "sdl2") - (lib.enableFeature true "sdl2-linking") - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - (lib.enableFeature true "alsa") - (lib.enableFeature true "alsa-linking") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.enableFeature false "sdltest") - ]; + configureFlags = [ + (lib.enableFeature true "dependency-tracking") + (lib.withFeature true "sdl2") + (lib.enableFeature true "sdl2-linking") + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + (lib.enableFeature true "alsa") + (lib.enableFeature true "alsa-linking") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.enableFeature false "sdltest") + ]; strictDeps = true; @@ -54,16 +53,15 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - SDL2 - libX11 - utf8proc - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libXext - ]; + buildInputs = [ + SDL2 + libX11 + utf8proc + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libXext + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/sc/scilab-bin/package.nix b/pkgs/by-name/sc/scilab-bin/package.nix index d79508f08316..3c6fd4251f41 100644 --- a/pkgs/by-name/sc/scilab-bin/package.nix +++ b/pkgs/by-name/sc/scilab-bin/package.nix @@ -84,23 +84,22 @@ let autoPatchelfHook ]; - buildInputs = - [ - alsa-lib - ncurses5 - stdenv.cc.cc - ] - ++ (with xorg; [ - libX11 - libXcursor - libXext - libXft - libXi - libXrandr - libXrender - libXtst - libXxf86vm - ]); + buildInputs = [ + alsa-lib + ncurses5 + stdenv.cc.cc + ] + ++ (with xorg; [ + libX11 + libXcursor + libXext + libXft + libXi + libXrandr + libXrender + libXtst + libXxf86vm + ]); installPhase = '' runHook preInstall diff --git a/pkgs/by-name/sc/scopehal-apps/package.nix b/pkgs/by-name/sc/scopehal-apps/package.nix index aa7d247526b2..6f1b7c147bcd 100644 --- a/pkgs/by-name/sc/scopehal-apps/package.nix +++ b/pkgs/by-name/sc/scopehal-apps/package.nix @@ -39,40 +39,38 @@ stdenv.mkDerivation { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - shaderc - spirv-tools - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wrapGAppsHook4 - ]; + nativeBuildInputs = [ + cmake + pkg-config + shaderc + spirv-tools + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wrapGAppsHook4 + ]; - buildInputs = - [ - cairomm - glew - glfw - glslang - liblxi - libsigcxx - vulkan-headers - vulkan-loader - vulkan-tools - yaml-cpp - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - ffts - gtkmm3 - libtirpc - ] - ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - moltenvk - ]; + buildInputs = [ + cairomm + glew + glfw + glslang + liblxi + libsigcxx + vulkan-headers + vulkan-loader + vulkan-tools + yaml-cpp + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + ffts + gtkmm3 + libtirpc + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + moltenvk + ]; # Targets InitializeSearchPaths postPatch = '' diff --git a/pkgs/by-name/sc/scrcpy/package.nix b/pkgs/by-name/sc/scrcpy/package.nix index 48821d48f6ab..488470050b93 100644 --- a/pkgs/by-name/sc/scrcpy/package.nix +++ b/pkgs/by-name/sc/scrcpy/package.nix @@ -63,18 +63,17 @@ stdenv.mkDerivation rec { echo -n > server/meson.build ''; - postInstall = - '' - mkdir -p "$out/share/scrcpy" - ln -s "${prebuilt_server}" "$out/share/scrcpy/scrcpy-server" + postInstall = '' + mkdir -p "$out/share/scrcpy" + ln -s "${prebuilt_server}" "$out/share/scrcpy/scrcpy-server" - # runtime dep on `adb` to push the server - wrapProgram "$out/bin/scrcpy" --prefix PATH : "${android-tools}/bin" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $out/share/applications/scrcpy-console.desktop \ - --replace "/bin/bash" "${runtimeShell}" - ''; + # runtime dep on `adb` to push the server + wrapProgram "$out/bin/scrcpy" --prefix PATH : "${android-tools}/bin" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $out/share/applications/scrcpy-console.desktop \ + --replace "/bin/bash" "${runtimeShell}" + ''; meta = { description = "Display and control Android devices over USB or TCP/IP"; diff --git a/pkgs/by-name/sc/screen-pipe/package.nix b/pkgs/by-name/sc/screen-pipe/package.nix index 36118fc16fdd..a54576c598a1 100644 --- a/pkgs/by-name/sc/screen-pipe/package.nix +++ b/pkgs/by-name/sc/screen-pipe/package.nix @@ -41,21 +41,20 @@ rustPlatform.buildRustPackage rec { rustPlatform.bindgenHook ]; - buildInputs = - [ - dbus - ffmpeg - oniguruma - openssl - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_12 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - xorg.libxcb - ]; + buildInputs = [ + dbus + ffmpeg + oniguruma + openssl + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_12 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + xorg.libxcb + ]; buildFeatures = lib.optional stdenv.hostPlatform.isDarwin "metal"; diff --git a/pkgs/by-name/sd/SDL2_image/package.nix b/pkgs/by-name/sd/SDL2_image/package.nix index 06d6d99209dd..4b60b11eecc4 100644 --- a/pkgs/by-name/sd/SDL2_image/package.nix +++ b/pkgs/by-name/sd/SDL2_image/package.nix @@ -31,34 +31,32 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - SDL2 - libtiff - libwebp - zlib - ] - ++ lib.optionals (!enableSTB) [ - libjpeg - libpng - ]; + buildInputs = [ + SDL2 + libtiff + libwebp + zlib + ] + ++ lib.optionals (!enableSTB) [ + libjpeg + libpng + ]; - configureFlags = - [ - # Disable dynamically loaded dependencies - (lib.enableFeature false "jpg-shared") - (lib.enableFeature false "png-shared") - (lib.enableFeature false "tif-shared") - (lib.enableFeature false "webp-shared") - (lib.enableFeature enableSTB "stb-image") - (lib.enableFeature enableSdltest "sdltest") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Don't use native macOS frameworks - # Caution: do not set this as (!stdenv.hostPlatform.isDarwin) since it would be true - # outside Darwin - and ImageIO does not exist outside Darwin - (lib.enableFeature false "imageio") - ]; + configureFlags = [ + # Disable dynamically loaded dependencies + (lib.enableFeature false "jpg-shared") + (lib.enableFeature false "png-shared") + (lib.enableFeature false "tif-shared") + (lib.enableFeature false "webp-shared") + (lib.enableFeature enableSTB "stb-image") + (lib.enableFeature enableSdltest "sdltest") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Don't use native macOS frameworks + # Caution: do not set this as (!stdenv.hostPlatform.isDarwin) since it would be true + # outside Darwin - and ImageIO does not exist outside Darwin + (lib.enableFeature false "imageio") + ]; strictDeps = true; diff --git a/pkgs/by-name/sd/SDL2_ttf/package.nix b/pkgs/by-name/sd/SDL2_ttf/package.nix index f8968606c561..fe27887ddfbb 100644 --- a/pkgs/by-name/sd/SDL2_ttf/package.nix +++ b/pkgs/by-name/sd/SDL2_ttf/package.nix @@ -26,15 +26,14 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - SDL2 - freetype - harfbuzz - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGL - ]; + buildInputs = [ + SDL2 + freetype + harfbuzz + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGL + ]; configureFlags = [ (lib.enableFeature false "harfbuzz-builtin") diff --git a/pkgs/by-name/sd/SDL_compat/package.nix b/pkgs/by-name/sd/SDL_compat/package.nix index 683d6eb38c98..e61692af5306 100644 --- a/pkgs/by-name/sd/SDL_compat/package.nix +++ b/pkgs/by-name/sd/SDL_compat/package.nix @@ -36,27 +36,25 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-f2dl3L7/qoYNl4sjik1npcW/W09zsEumiV9jHuKnUmM="; }; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ]; # re-export PKG_CHECK_MODULES m4 macro used by sdl.m4 propagatedNativeBuildInputs = [ pkg-config-unwrapped ]; - buildInputs = - [ - libX11 - sdl2-compat - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ lib.optionals openglSupport [ libGLU ]; + buildInputs = [ + libX11 + sdl2-compat + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.optionals openglSupport [ libGLU ]; postPatch = '' substituteInPlace CMakeLists.txt \ diff --git a/pkgs/by-name/sd/sdcc/package.nix b/pkgs/by-name/sd/sdcc/package.nix index 78a452012c9b..47921b2f3283 100644 --- a/pkgs/by-name/sd/sdcc/package.nix +++ b/pkgs/by-name/sd/sdcc/package.nix @@ -45,14 +45,13 @@ stdenv.mkDerivation (finalAttrs: { # # sdcc's tracking issue: # - outputs = - [ - "out" - "doc" - ] - ++ lib.optionals (!stdenv.isDarwin) [ - "man" - ]; + outputs = [ + "out" + "doc" + ] + ++ lib.optionals (!stdenv.isDarwin) [ + "man" + ]; enableParallelBuilding = true; @@ -62,15 +61,14 @@ stdenv.mkDerivation (finalAttrs: { flex ]; - buildInputs = - [ - boost - texinfo - zlib - ] - ++ lib.optionals withGputils [ - gputils - ]; + buildInputs = [ + boost + texinfo + zlib + ] + ++ lib.optionals withGputils [ + gputils + ]; # sdcc 4.5.0 massively rewrote sim/ucsim/Makefile.in, and lost the `.PHONY` # rule in the process. As a result, on macOS (which uses a case-insensitive diff --git a/pkgs/by-name/sd/sdl2-compat/package.nix b/pkgs/by-name/sd/sdl2-compat/package.nix index 20783cab0638..a5d373c12d89 100644 --- a/pkgs/by-name/sd/sdl2-compat/package.nix +++ b/pkgs/by-name/sd/sdl2-compat/package.nix @@ -79,24 +79,23 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru = { - tests = - { - pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + tests = { + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - inherit - SDL_compat - SDL2_ttf - SDL2_net - SDL2_gfx - SDL2_sound - SDL2_mixer - SDL2_image - ffmpeg - ; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit qemu; - }; + inherit + SDL_compat + SDL2_ttf + SDL2_net + SDL2_gfx + SDL2_sound + SDL2_mixer + SDL2_image + ffmpeg + ; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit qemu; + }; updateScript = nix-update-script { extraArgs = [ diff --git a/pkgs/by-name/sd/sdl3-image/package.nix b/pkgs/by-name/sd/sdl3-image/package.nix index f9fd8ac47418..b09a3be81172 100644 --- a/pkgs/by-name/sd/sdl3-image/package.nix +++ b/pkgs/by-name/sd/sdl3-image/package.nix @@ -42,17 +42,16 @@ stdenv.mkDerivation (finalAttrs: { validatePkgConfig ]; - buildInputs = - [ - sdl3 - libtiff - libwebp - libavif - ] - ++ (lib.optionals (!enableSTB) [ - libpng - libjpeg - ]); + buildInputs = [ + sdl3 + libtiff + libwebp + libavif + ] + ++ (lib.optionals (!enableSTB) [ + libpng + libjpeg + ]); cmakeFlags = [ # fail when a dependency could not be found diff --git a/pkgs/by-name/sd/sdl3-ttf/package.nix b/pkgs/by-name/sd/sdl3-ttf/package.nix index b51dbb463c99..ce0706d93654 100644 --- a/pkgs/by-name/sd/sdl3-ttf/package.nix +++ b/pkgs/by-name/sd/sdl3-ttf/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation (finalAttrs: { cmake ninja validatePkgConfig - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; buildInputs = [ sdl3 diff --git a/pkgs/by-name/sd/sdl3/package.nix b/pkgs/by-name/sd/sdl3/package.nix index a1dc97d94c68..21a8780c4479 100644 --- a/pkgs/by-name/sd/sdl3/package.nix +++ b/pkgs/by-name/sd/sdl3/package.nix @@ -101,7 +101,8 @@ stdenv.mkDerivation (finalAttrs: { cmake ninja validatePkgConfig - ] ++ lib.optional waylandSupport wayland-scanner; + ] + ++ lib.optional waylandSupport wayland-scanner; buildInputs = finalAttrs.dlopenBuildInputs diff --git a/pkgs/by-name/sd/sdrangel/package.nix b/pkgs/by-name/sd/sdrangel/package.nix index 5e157e279093..9a808c8e4f47 100644 --- a/pkgs/by-name/sd/sdrangel/package.nix +++ b/pkgs/by-name/sd/sdrangel/package.nix @@ -60,52 +60,51 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook ]; - buildInputs = - [ - airspy - airspyhf - aptdec - boost - cm256cc - codec2 - dab_lib - dsdcc - faad2 - ffmpeg - fftwFloat - flac - glew - hackrf - hidapi - libbladeRF - libiio - libopus - libpulseaudio - libusb1 - limesuite - mbelib - opencv4 - qt6Packages.qt5compat - qt6Packages.qtcharts - qt6Packages.qtdeclarative - qt6Packages.qtlocation - qt6Packages.qtmultimedia - qt6Packages.qtscxml - qt6Packages.qtserialport - qt6Packages.qtspeech - qt6Packages.qttools - qt6Packages.qtwebsockets - qt6Packages.qtwebengine - rtl-sdr - serialdv - sgp4 - soapysdr-with-plugins - uhd - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6Packages.qtwayland ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_12 ] - ++ lib.optionals withSDRplay [ sdrplay ]; + buildInputs = [ + airspy + airspyhf + aptdec + boost + cm256cc + codec2 + dab_lib + dsdcc + faad2 + ffmpeg + fftwFloat + flac + glew + hackrf + hidapi + libbladeRF + libiio + libopus + libpulseaudio + libusb1 + limesuite + mbelib + opencv4 + qt6Packages.qt5compat + qt6Packages.qtcharts + qt6Packages.qtdeclarative + qt6Packages.qtlocation + qt6Packages.qtmultimedia + qt6Packages.qtscxml + qt6Packages.qtserialport + qt6Packages.qtspeech + qt6Packages.qttools + qt6Packages.qtwebsockets + qt6Packages.qtwebengine + rtl-sdr + serialdv + sgp4 + soapysdr-with-plugins + uhd + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6Packages.qtwayland ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_12 ] + ++ lib.optionals withSDRplay [ sdrplay ]; patches = [ # https://github.com/f4exb/sdrangel/pull/2439 diff --git a/pkgs/by-name/sd/sdrpp/package.nix b/pkgs/by-name/sd/sdrpp/package.nix index 8e486eee2594..847fea651aae 100644 --- a/pkgs/by-name/sd/sdrpp/package.nix +++ b/pkgs/by-name/sd/sdrpp/package.nix @@ -98,37 +98,36 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - glfw - glew - fftwFloat - volk - zstd - ] - ++ lib.optional stdenv.hostPlatform.isLinux libX11 - ++ lib.optional airspy_source airspy - ++ lib.optional airspyhf_source airspyhf - ++ lib.optional bladerf_source libbladeRF - ++ lib.optional hackrf_source hackrf - ++ lib.optional limesdr_source limesuite - ++ lib.optionals rtl_sdr_source [ - rtl-sdr-osmocom - libusb1 - ] - ++ lib.optional sdrplay_source sdrplay - ++ lib.optional soapy_source soapysdr-with-plugins - ++ lib.optionals plutosdr_source [ - libiio - libad9361 - ] - ++ lib.optionals usrp_source [ - uhd - boost - ] - ++ lib.optional audio_sink rtaudio - ++ lib.optional portaudio_sink portaudio - ++ lib.optional m17_decoder codec2; + buildInputs = [ + glfw + glew + fftwFloat + volk + zstd + ] + ++ lib.optional stdenv.hostPlatform.isLinux libX11 + ++ lib.optional airspy_source airspy + ++ lib.optional airspyhf_source airspyhf + ++ lib.optional bladerf_source libbladeRF + ++ lib.optional hackrf_source hackrf + ++ lib.optional limesdr_source limesuite + ++ lib.optionals rtl_sdr_source [ + rtl-sdr-osmocom + libusb1 + ] + ++ lib.optional sdrplay_source sdrplay + ++ lib.optional soapy_source soapysdr-with-plugins + ++ lib.optionals plutosdr_source [ + libiio + libad9361 + ] + ++ lib.optionals usrp_source [ + uhd + boost + ] + ++ lib.optional audio_sink rtaudio + ++ lib.optional portaudio_sink portaudio + ++ lib.optional m17_decoder codec2; cmakeFlags = [ # Sources diff --git a/pkgs/by-name/se/segger-jlink/package.nix b/pkgs/by-name/se/segger-jlink/package.nix index ac5ec4c97d8c..e8fd58074cb4 100644 --- a/pkgs/by-name/se/segger-jlink/package.nix +++ b/pkgs/by-name/se/segger-jlink/package.nix @@ -60,13 +60,12 @@ stdenv.mkDerivation { pname = "segger-jlink"; inherit src version; - nativeBuildInputs = - [ - autoPatchelfHook - ] - ++ lib.optionals (!headless) [ - copyDesktopItems - ]; + nativeBuildInputs = [ + autoPatchelfHook + ] + ++ lib.optionals (!headless) [ + copyDesktopItems + ]; buildInputs = lib.optionals (!headless) [ qt4-bundled diff --git a/pkgs/by-name/se/selinux-refpolicy/package.nix b/pkgs/by-name/se/selinux-refpolicy/package.nix index 08c73e68b116..803f0ab75f1f 100644 --- a/pkgs/by-name/se/selinux-refpolicy/package.nix +++ b/pkgs/by-name/se/selinux-refpolicy/package.nix @@ -34,22 +34,21 @@ stdenv.mkDerivation (finalAttrs: { runHook postConfigure ''; - makeFlags = - [ - "CHECKPOLICY=${lib.getExe checkpolicy}" - "CHECKMODULE=${lib.getExe' checkpolicy "checkmodule"}" - "SEMODULE=${lib.getExe' policycoreutils "semodule"}" - "SEMOD_PKG=${lib.getExe' semodule-utils "semodule_package"}" - "SEMOD_LNK=${lib.getExe' semodule-utils "semodule_link"}" - "SEMOD_EXP=${lib.getExe' semodule-utils "semodule_expand"}" - "DESTDIR=${placeholder "out"}" - "prefix=${placeholder "out"}" - "DISTRO=nixos" - "SYSTEMD=y" - "UBAC=y" - ] - ++ lib.optional (policyVersion != null) "OUTPUT_POLICY=${toString policyVersion}" - ++ lib.optional (moduleVersion != null) "OUTPUT_MODULE=${toString moduleVersion}"; + makeFlags = [ + "CHECKPOLICY=${lib.getExe checkpolicy}" + "CHECKMODULE=${lib.getExe' checkpolicy "checkmodule"}" + "SEMODULE=${lib.getExe' policycoreutils "semodule"}" + "SEMOD_PKG=${lib.getExe' semodule-utils "semodule_package"}" + "SEMOD_LNK=${lib.getExe' semodule-utils "semodule_link"}" + "SEMOD_EXP=${lib.getExe' semodule-utils "semodule_expand"}" + "DESTDIR=${placeholder "out"}" + "prefix=${placeholder "out"}" + "DISTRO=nixos" + "SYSTEMD=y" + "UBAC=y" + ] + ++ lib.optional (policyVersion != null) "OUTPUT_POLICY=${toString policyVersion}" + ++ lib.optional (moduleVersion != null) "OUTPUT_MODULE=${toString moduleVersion}"; installTargets = "all install install-headers install-docs"; diff --git a/pkgs/by-name/se/semantic-release/package.nix b/pkgs/by-name/se/semantic-release/package.nix index 270e44b67560..86e3ae849c80 100644 --- a/pkgs/by-name/se/semantic-release/package.nix +++ b/pkgs/by-name/se/semantic-release/package.nix @@ -24,7 +24,8 @@ buildNpmPackage rec { nativeBuildInputs = [ python3 - ] ++ lib.optional stdenv.hostPlatform.isDarwin cctools; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin cctools; # Fixes `semantic-release --version` output postPatch = '' diff --git a/pkgs/by-name/se/sequoia-wot/package.nix b/pkgs/by-name/se/sequoia-wot/package.nix index d949f6743ca0..11329e62b6d1 100644 --- a/pkgs/by-name/se/sequoia-wot/package.nix +++ b/pkgs/by-name/se/sequoia-wot/package.nix @@ -30,14 +30,13 @@ rustPlatform.buildRustPackage rec { installShellFiles ]; - buildInputs = - [ - openssl - sqlite - ] - ++ lib.optionals (!stdenv.targetPlatform.isWindows) [ - nettle - ]; + buildInputs = [ + openssl + sqlite + ] + ++ lib.optionals (!stdenv.targetPlatform.isWindows) [ + nettle + ]; buildFeatures = [ # Upstream uses the sequoia-openpgp crate, which doesn't force you to use a diff --git a/pkgs/by-name/se/serenityos-emoji-font/package.nix b/pkgs/by-name/se/serenityos-emoji-font/package.nix index e51ad304a65a..37e9fb9b450f 100644 --- a/pkgs/by-name/se/serenityos-emoji-font/package.nix +++ b/pkgs/by-name/se/serenityos-emoji-font/package.nix @@ -64,16 +64,15 @@ stdenvNoCC.mkDerivation { strictDeps = true; - nativeBuildInputs = - [ - pixart2svg - parallel - ] - ++ (with python3Packages; [ - imageio - nanoemoji - numpy - ]); + nativeBuildInputs = [ + pixart2svg + parallel + ] + ++ (with python3Packages; [ + imageio + nanoemoji + numpy + ]); buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/se/serf/package.nix b/pkgs/by-name/se/serf/package.nix index 1d194d2c4356..923e1c2a04bf 100644 --- a/pkgs/by-name/se/serf/package.nix +++ b/pkgs/by-name/se/serf/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { aprutil zlib libiconv - ] ++ lib.optional (!stdenv.hostPlatform.isCygwin) libkrb5; + ] + ++ lib.optional (!stdenv.hostPlatform.isCygwin) libkrb5; patches = [ ./scons.patch @@ -45,17 +46,16 @@ stdenv.mkDerivation rec { prefixKey = "PREFIX="; - preConfigure = - '' - appendToVar sconsFlags "APR=$(echo ${apr.dev}/bin/*-config)" - appendToVar sconsFlags "APU=$(echo ${aprutil.dev}/bin/*-config)" - appendToVar sconsFlags "CC=$CC" - appendToVar sconsFlags "OPENSSL=${openssl}" - appendToVar sconsFlags "ZLIB=${zlib}" - '' - + lib.optionalString (!stdenv.hostPlatform.isCygwin) '' - appendToVar sconsFlags "GSSAPI=${libkrb5.dev}" - ''; + preConfigure = '' + appendToVar sconsFlags "APR=$(echo ${apr.dev}/bin/*-config)" + appendToVar sconsFlags "APU=$(echo ${aprutil.dev}/bin/*-config)" + appendToVar sconsFlags "CC=$CC" + appendToVar sconsFlags "OPENSSL=${openssl}" + appendToVar sconsFlags "ZLIB=${zlib}" + '' + + lib.optionalString (!stdenv.hostPlatform.isCygwin) '' + appendToVar sconsFlags "GSSAPI=${libkrb5.dev}" + ''; enableParallelBuilding = true; diff --git a/pkgs/by-name/se/servo/package.nix b/pkgs/by-name/se/servo/package.nix index 0d0a9174fd0e..42b3fe676b80 100644 --- a/pkgs/by-name/se/servo/package.nix +++ b/pkgs/by-name/se/servo/package.nix @@ -114,29 +114,28 @@ rustPlatform.buildRustPackage { env.UV_PYTHON = customPython.interpreter; - buildInputs = - [ - fontconfig - freetype - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-ugly - harfbuzz - libunwind - libGL - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - xorg.libX11 - xorg.libxcb - udev - vulkan-loader - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_14 - ]; + buildInputs = [ + fontconfig + freetype + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-ugly + harfbuzz + libunwind + libGL + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + xorg.libX11 + xorg.libxcb + udev + vulkan-loader + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_14 + ]; # Builds with additional features for aarch64, see https://github.com/servo/servo/issues/36819 buildFeatures = lib.optionals stdenv.hostPlatform.isAarch64 [ diff --git a/pkgs/by-name/se/setroot/package.nix b/pkgs/by-name/se/setroot/package.nix index 7bb722ffdb15..2e6cc2d6f8cd 100644 --- a/pkgs/by-name/se/setroot/package.nix +++ b/pkgs/by-name/se/setroot/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 imlib2 - ] ++ lib.optionals enableXinerama [ libXinerama ]; + ] + ++ lib.optionals enableXinerama [ libXinerama ]; buildFlags = [ (if enableXinerama then "xinerama=1" else "xinerama=0") ]; diff --git a/pkgs/by-name/sf/sfeed/package.nix b/pkgs/by-name/sf/sfeed/package.nix index 5a03727e8561..0cdc16766158 100644 --- a/pkgs/by-name/sf/sfeed/package.nix +++ b/pkgs/by-name/sf/sfeed/package.nix @@ -17,13 +17,12 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ ncurses ]; - makeFlags = - [ - "RANLIB:=$(RANLIB)" - "SFEED_CURSES_LDFLAGS:=-lncurses" - ] - # use macOS's strlcat() and strlcpy() instead of vendored ones - ++ lib.optional stdenv.hostPlatform.isDarwin "COMPATOBJ:="; + makeFlags = [ + "RANLIB:=$(RANLIB)" + "SFEED_CURSES_LDFLAGS:=-lncurses" + ] + # use macOS's strlcat() and strlcpy() instead of vendored ones + ++ lib.optional stdenv.hostPlatform.isDarwin "COMPATOBJ:="; installFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/by-name/sf/sfml/package.nix b/pkgs/by-name/sf/sfml/package.nix index dc0c5b71da2e..235f31e50475 100644 --- a/pkgs/by-name/sf/sfml/package.nix +++ b/pkgs/by-name/sf/sfml/package.nix @@ -48,23 +48,22 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ cmake ]; - buildInputs = - [ - flac - freetype - glew - libjpeg - libvorbis - ] - ++ lib.optional stdenv.hostPlatform.isLinux udev - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libX11 - libXi - libXcursor - libXrandr - libXrender - xcbutilimage - ]; + buildInputs = [ + flac + freetype + glew + libjpeg + libvorbis + ] + ++ lib.optional stdenv.hostPlatform.isLinux udev + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libX11 + libXi + libXcursor + libXrandr + libXrender + xcbutilimage + ]; # We rely on RUNPATH dontPatchELF = true; diff --git a/pkgs/by-name/sf/sfml_2/package.nix b/pkgs/by-name/sf/sfml_2/package.nix index eed96f2bed01..f18d872c830d 100644 --- a/pkgs/by-name/sf/sfml_2/package.nix +++ b/pkgs/by-name/sf/sfml_2/package.nix @@ -32,23 +32,22 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ cmake ]; - buildInputs = - [ - flac - freetype - glew - libjpeg - libvorbis - openal - ] - ++ lib.optional stdenv.hostPlatform.isLinux udev - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libX11 - libXcursor - libXrandr - libXrender - xcbutilimage - ]; + buildInputs = [ + flac + freetype + glew + libjpeg + libvorbis + openal + ] + ++ lib.optional stdenv.hostPlatform.isLinux udev + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libX11 + libXcursor + libXrandr + libXrender + xcbutilimage + ]; cmakeFlags = [ (lib.cmakeBool "SFML_INSTALL_PKGCONFIG_FILES" true) diff --git a/pkgs/by-name/sg/sgx-ssl/package.nix b/pkgs/by-name/sg/sgx-ssl/package.nix index f67a960ace58..18bf86f99435 100644 --- a/pkgs/by-name/sg/sgx-ssl/package.nix +++ b/pkgs/by-name/sg/sgx-ssl/package.nix @@ -50,13 +50,12 @@ stdenv.mkDerivation { which ]; - makeFlags = - [ - "-C Linux" - ] - ++ lib.optionals debug [ - "DEBUG=1" - ]; + makeFlags = [ + "-C Linux" + ] + ++ lib.optionals debug [ + "DEBUG=1" + ]; installFlags = [ "DESTDIR=$(out)" diff --git a/pkgs/by-name/sg/sgx-ssl/tests.nix b/pkgs/by-name/sg/sgx-ssl/tests.nix index a7cf2b0ea8d3..3b360f696525 100644 --- a/pkgs/by-name/sg/sgx-ssl/tests.nix +++ b/pkgs/by-name/sg/sgx-ssl/tests.nix @@ -28,26 +28,24 @@ stdenv.mkDerivation { inherit (sgx-ssl) postPatch src version; pname = sgx-ssl.pname + "-tests-${sgxMode}"; - postUnpack = - sgx-ssl.postUnpack - + '' - sourceRootAbs=$(readlink -e $sourceRoot) - packageDir=$sourceRootAbs/Linux/package + postUnpack = sgx-ssl.postUnpack + '' + sourceRootAbs=$(readlink -e $sourceRoot) + packageDir=$sourceRootAbs/Linux/package - # Do the inverse of 'make install' and symlink built artifacts back into - # '$src/Linux/package/' to avoid work. - mkdir $packageDir/lib $packageDir/lib64 - ln -s ${lib.getLib sgx-ssl}/lib/* $packageDir/lib/ - ln -s ${lib.getLib sgx-ssl}/lib64/* $packageDir/lib64/ - ln -sf ${lib.getDev sgx-ssl}/include/* $packageDir/include/ + # Do the inverse of 'make install' and symlink built artifacts back into + # '$src/Linux/package/' to avoid work. + mkdir $packageDir/lib $packageDir/lib64 + ln -s ${lib.getLib sgx-ssl}/lib/* $packageDir/lib/ + ln -s ${lib.getLib sgx-ssl}/lib64/* $packageDir/lib64/ + ln -sf ${lib.getDev sgx-ssl}/include/* $packageDir/include/ - # test_app needs some internal openssl headers. - # See: tail end of 'Linux/build_openssl.sh' - tar -C $sourceRootAbs/openssl_source -xf $sourceRootAbs/openssl_source/openssl-${opensslVersion}.tar.gz - echo '#define OPENSSL_VERSION_STR "${opensslVersion}"' > $sourceRootAbs/Linux/sgx/osslverstr.h - ln -s $sourceRootAbs/openssl_source/openssl-${opensslVersion}/include/crypto $sourceRootAbs/Linux/sgx/test_app/enclave/ - ln -s $sourceRootAbs/openssl_source/openssl-${opensslVersion}/include/internal $sourceRootAbs/Linux/sgx/test_app/enclave/ - ''; + # test_app needs some internal openssl headers. + # See: tail end of 'Linux/build_openssl.sh' + tar -C $sourceRootAbs/openssl_source -xf $sourceRootAbs/openssl_source/openssl-${opensslVersion}.tar.gz + echo '#define OPENSSL_VERSION_STR "${opensslVersion}"' > $sourceRootAbs/Linux/sgx/osslverstr.h + ln -s $sourceRootAbs/openssl_source/openssl-${opensslVersion}/include/crypto $sourceRootAbs/Linux/sgx/test_app/enclave/ + ln -s $sourceRootAbs/openssl_source/openssl-${opensslVersion}/include/internal $sourceRootAbs/Linux/sgx/test_app/enclave/ + ''; nativeBuildInputs = [ openssl.bin diff --git a/pkgs/by-name/sh/shader-slang/package.nix b/pkgs/by-name/sh/shader-slang/package.nix index 59581259f22a..78edfe7f43ac 100644 --- a/pkgs/by-name/sh/shader-slang/package.nix +++ b/pkgs/by-name/sh/shader-slang/package.nix @@ -37,24 +37,23 @@ stdenv.mkDerivation (finalAttrs: { fetchSubmodules = true; }; - patches = - [ - # Slang's build definitions do not support using system provided cmake packages - # for its dependencies. - # While it does come with "SLANG_USE_SYSTEM_XYZ" flags, these expect Slang to be - # imported into some other CMake build that already provides the necessary target. - # This patch adds the required `find_package` calls and sets up target aliases where needed. - ./1-find-packages.patch - ] - ++ lib.optionals withSharedLLVM [ - # Upstream statically links libllvm and libclang++, resulting in a ~5x increase in binary size. - ./2-shared-llvm.patch - ] - ++ lib.optionals withGlslang [ - # Upstream depends on glslang 13 and there are minor breaking changes in glslang 15, the version - # we ship in nixpkgs. - ./3-glslang-15.patch - ]; + patches = [ + # Slang's build definitions do not support using system provided cmake packages + # for its dependencies. + # While it does come with "SLANG_USE_SYSTEM_XYZ" flags, these expect Slang to be + # imported into some other CMake build that already provides the necessary target. + # This patch adds the required `find_package` calls and sets up target aliases where needed. + ./1-find-packages.patch + ] + ++ lib.optionals withSharedLLVM [ + # Upstream statically links libllvm and libclang++, resulting in a ~5x increase in binary size. + ./2-shared-llvm.patch + ] + ++ lib.optionals withGlslang [ + # Upstream depends on glslang 13 and there are minor breaking changes in glslang 15, the version + # we ship in nixpkgs. + ./3-glslang-15.patch + ]; outputs = [ "out" @@ -70,25 +69,24 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - miniz - lz4 - libxml2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - ] - ++ lib.optionals withLLVM [ - # Slang only supports LLVM 13: - # https://github.com/shader-slang/slang/blob/master/docs/building.md#llvm-support - llvmPackages_13.llvm - llvmPackages_13.libclang - ] - ++ lib.optionals withGlslang [ - # SPIRV-tools is included in glslang. - glslang - ]; + buildInputs = [ + miniz + lz4 + libxml2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + ] + ++ lib.optionals withLLVM [ + # Slang only supports LLVM 13: + # https://github.com/shader-slang/slang/blob/master/docs/building.md#llvm-support + llvmPackages_13.llvm + llvmPackages_13.libclang + ] + ++ lib.optionals withGlslang [ + # SPIRV-tools is included in glslang. + glslang + ]; separateDebugInfo = true; @@ -108,28 +106,27 @@ stdenv.mkDerivation (finalAttrs: { prependToVar cmakeFlags "-DCMAKE_CXX_COMPILER_RANLIB=$(command -v $RANLIB)" ''; - cmakeFlags = - [ - "-GNinja Multi-Config" - # The cmake setup hook only specifies `-DCMAKE_BUILD_TYPE=Release`, - # which does nothing for "Ninja Multi-Config". - "-DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo" - # Handled by separateDebugInfo so we don't need special installation handling - "-DSLANG_ENABLE_SPLIT_DEBUG_INFO=OFF" - "-DSLANG_VERSION_FULL=v${finalAttrs.version}-nixpkgs" - # slang-rhi tries to download WebGPU dawn binaries, and as stated on - # https://github.com/shader-slang/slang-rhi is "under active refactoring - # and development, and is not yet ready for general use." - "-DSLANG_ENABLE_SLANG_RHI=OFF" - "-DSLANG_USE_SYSTEM_MINIZ=ON" - "-DSLANG_USE_SYSTEM_LZ4=ON" - "-DSLANG_SLANG_LLVM_FLAVOR=${if withLLVM then "USE_SYSTEM_LLVM" else "DISABLE"}" - ] - ++ lib.optionals withGlslang [ - "-DSLANG_USE_SYSTEM_SPIRV_TOOLS=ON" - "-DSLANG_USE_SYSTEM_GLSLANG=ON" - ] - ++ lib.optional (!withGlslang) "-DSLANG_ENABLE_SLANG_GLSLANG=OFF"; + cmakeFlags = [ + "-GNinja Multi-Config" + # The cmake setup hook only specifies `-DCMAKE_BUILD_TYPE=Release`, + # which does nothing for "Ninja Multi-Config". + "-DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo" + # Handled by separateDebugInfo so we don't need special installation handling + "-DSLANG_ENABLE_SPLIT_DEBUG_INFO=OFF" + "-DSLANG_VERSION_FULL=v${finalAttrs.version}-nixpkgs" + # slang-rhi tries to download WebGPU dawn binaries, and as stated on + # https://github.com/shader-slang/slang-rhi is "under active refactoring + # and development, and is not yet ready for general use." + "-DSLANG_ENABLE_SLANG_RHI=OFF" + "-DSLANG_USE_SYSTEM_MINIZ=ON" + "-DSLANG_USE_SYSTEM_LZ4=ON" + "-DSLANG_SLANG_LLVM_FLAVOR=${if withLLVM then "USE_SYSTEM_LLVM" else "DISABLE"}" + ] + ++ lib.optionals withGlslang [ + "-DSLANG_USE_SYSTEM_SPIRV_TOOLS=ON" + "-DSLANG_USE_SYSTEM_GLSLANG=ON" + ] + ++ lib.optional (!withGlslang) "-DSLANG_ENABLE_SLANG_GLSLANG=OFF"; postInstall = '' mv "$out/cmake" "$dev/cmake" diff --git a/pkgs/by-name/sh/shadow/package.nix b/pkgs/by-name/sh/shadow/package.nix index 58cc701e9efc..ca4d9db1d233 100644 --- a/pkgs/by-name/sh/shadow/package.nix +++ b/pkgs/by-name/sh/shadow/package.nix @@ -63,11 +63,12 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ libxcrypt ] - ++ lib.optional (pam != null && stdenv.hostPlatform.isLinux) pam - ++ lib.optional withLibbsd libbsd - ++ lib.optional withTcb tcb; + buildInputs = [ + libxcrypt + ] + ++ lib.optional (pam != null && stdenv.hostPlatform.isLinux) pam + ++ lib.optional withLibbsd libbsd + ++ lib.optional withTcb tcb; patches = [ ./keep-path.patch @@ -88,16 +89,15 @@ stdenv.mkDerivation rec { export shadow_cv_logdir=/var/log ''; - configureFlags = - [ - "--enable-man" - "--with-group-name-max-length=32" - "--with-bcrypt" - "--with-yescrypt" - (lib.withFeature withLibbsd "libbsd") - ] - ++ lib.optional (stdenv.hostPlatform.libc != "glibc") "--disable-nscd" - ++ lib.optional withTcb "--with-tcb"; + configureFlags = [ + "--enable-man" + "--with-group-name-max-length=32" + "--with-bcrypt" + "--with-yescrypt" + (lib.withFeature withLibbsd "libbsd") + ] + ++ 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 diff --git a/pkgs/by-name/sh/shairport-sync/package.nix b/pkgs/by-name/sh/shairport-sync/package.nix index 7f2e8349f9b1..bba887da5c71 100644 --- a/pkgs/by-name/sh/shairport-sync/package.nix +++ b/pkgs/by-name/sh/shairport-sync/package.nix @@ -62,48 +62,46 @@ stdenv.mkDerivation rec { hash = "sha256-bfOgUeUCxQeCmKKBlvIXptM5lJxgZiH4lOhLJSNih8g="; }; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - # For glib we want the `dev` output for the same library we are - # also linking against, since pkgsHostTarget.glib.dev exposes - # some extra tools that are built for build->host execution. - # To achieve this, we coerce the output to a string to prevent - # mkDerivation's splicing logic from kicking in. - "${glib.dev}" - ] - ++ optional enableAirplay2 [ - unixtools.xxd - ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + # For glib we want the `dev` output for the same library we are + # also linking against, since pkgsHostTarget.glib.dev exposes + # some extra tools that are built for build->host execution. + # To achieve this, we coerce the output to a string to prevent + # mkDerivation's splicing logic from kicking in. + "${glib.dev}" + ] + ++ optional enableAirplay2 [ + unixtools.xxd + ]; - buildInputs = - [ - openssl - avahi - popt - libconfig - ] - ++ optional enableLibdaemon libdaemon - ++ optional enableAlsa alsa-lib - ++ optional enableSndio sndio - ++ optional enableMqttClient mosquitto - ++ optional enablePulse libpulseaudio - ++ optional enablePipewire pipewire - ++ optional enableAo libao - ++ optional enableJack libjack2 - ++ optional enableSoundio libsoundio - ++ optional enableSoxr soxr - ++ optional enableAlac alac - ++ optional enableConvolution libsndfile - ++ optionals enableAirplay2 [ - libplist - libsodium - libgcrypt - libuuid - ffmpeg - ] - ++ optional stdenv.hostPlatform.isLinux glib; + buildInputs = [ + openssl + avahi + popt + libconfig + ] + ++ optional enableLibdaemon libdaemon + ++ optional enableAlsa alsa-lib + ++ optional enableSndio sndio + ++ optional enableMqttClient mosquitto + ++ optional enablePulse libpulseaudio + ++ optional enablePipewire pipewire + ++ optional enableAo libao + ++ optional enableJack libjack2 + ++ optional enableSoundio libsoundio + ++ optional enableSoxr soxr + ++ optional enableAlac alac + ++ optional enableConvolution libsndfile + ++ optionals enableAirplay2 [ + libplist + libsodium + libgcrypt + libuuid + ffmpeg + ] + ++ optional stdenv.hostPlatform.isLinux glib; postPatch = '' sed -i -e 's/G_BUS_TYPE_SYSTEM/G_BUS_TYPE_SESSION/g' dbus-service.c @@ -112,32 +110,31 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - configureFlags = - [ - "--without-configfiles" - "--sysconfdir=/etc" - "--with-ssl=openssl" - "--with-stdout" - "--with-avahi" - ] - ++ optional enablePulse "--with-pa" - ++ optional enablePipewire "--with-pw" - ++ optional enableAlsa "--with-alsa" - ++ optional enableSndio "--with-sndio" - ++ optional enableAo "--with-ao" - ++ optional enableJack "--with-jack" - ++ optional enableSoundio "--with-soundio" - ++ optional enableStdout "--with-stdout" - ++ optional enablePipe "--with-pipe" - ++ optional enableSoxr "--with-soxr" - ++ optional enableAlac "--with-apple-alac" - ++ optional enableConvolution "--with-convolution" - ++ optional enableDbus "--with-dbus-interface" - ++ optional enableMetadata "--with-metadata" - ++ optional enableMpris "--with-mpris-interface" - ++ optional enableMqttClient "--with-mqtt-client" - ++ optional enableLibdaemon "--with-libdaemon" - ++ optional enableAirplay2 "--with-airplay-2"; + configureFlags = [ + "--without-configfiles" + "--sysconfdir=/etc" + "--with-ssl=openssl" + "--with-stdout" + "--with-avahi" + ] + ++ optional enablePulse "--with-pa" + ++ optional enablePipewire "--with-pw" + ++ optional enableAlsa "--with-alsa" + ++ optional enableSndio "--with-sndio" + ++ optional enableAo "--with-ao" + ++ optional enableJack "--with-jack" + ++ optional enableSoundio "--with-soundio" + ++ optional enableStdout "--with-stdout" + ++ optional enablePipe "--with-pipe" + ++ optional enableSoxr "--with-soxr" + ++ optional enableAlac "--with-apple-alac" + ++ optional enableConvolution "--with-convolution" + ++ optional enableDbus "--with-dbus-interface" + ++ optional enableMetadata "--with-metadata" + ++ optional enableMpris "--with-mpris-interface" + ++ optional enableMqttClient "--with-mqtt-client" + ++ optional enableLibdaemon "--with-libdaemon" + ++ optional enableAirplay2 "--with-airplay-2"; strictDeps = true; diff --git a/pkgs/by-name/sh/shanggu-fonts/package.nix b/pkgs/by-name/sh/shanggu-fonts/package.nix index db5b5ecaa1c1..4f00cea3079d 100644 --- a/pkgs/by-name/sh/shanggu-fonts/package.nix +++ b/pkgs/by-name/sh/shanggu-fonts/package.nix @@ -34,34 +34,32 @@ stdenvNoCC.mkDerivation { nativeBuildInputs = [ p7zip ]; - unpackPhase = - '' - runHook preUnpack - '' - + lib.strings.concatLines ( - lib.attrsets.mapAttrsToList (name: value: '' - 7z x ${value} -o${name} - '') source - ) - + '' - runHook postUnpack - ''; + unpackPhase = '' + runHook preUnpack + '' + + lib.strings.concatLines ( + lib.attrsets.mapAttrsToList (name: value: '' + 7z x ${value} -o${name} + '') source + ) + + '' + runHook postUnpack + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/share/fonts/truetype - '' - + lib.strings.concatLines ( - lib.lists.forEach extraOutputs (name: '' - install -Dm444 ${name}/*.ttc -t ${placeholder name}/share/fonts/truetype - ln -s "${placeholder name}" /share/fonts/truetype/*.ttc $out/share/fonts/truetype - '') - ) - + '' - runHook postInstall - ''; + mkdir -p $out/share/fonts/truetype + '' + + lib.strings.concatLines ( + lib.lists.forEach extraOutputs (name: '' + install -Dm444 ${name}/*.ttc -t ${placeholder name}/share/fonts/truetype + ln -s "${placeholder name}" /share/fonts/truetype/*.ttc $out/share/fonts/truetype + '') + ) + + '' + runHook postInstall + ''; meta = with lib; { homepage = "https://github.com/GuiWonder/Shanggu"; diff --git a/pkgs/by-name/sh/shared-mime-info/package.nix b/pkgs/by-name/sh/shared-mime-info/package.nix index a1d89b02694e..1704f2a7912d 100644 --- a/pkgs/by-name/sh/shared-mime-info/package.nix +++ b/pkgs/by-name/sh/shared-mime-info/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation rec { pkg-config gettext libxml2 - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) shared-mime-info; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) shared-mime-info; buildInputs = [ libxml2 diff --git a/pkgs/by-name/sh/shark/package.nix b/pkgs/by-name/sh/shark/package.nix index 4219153a78ab..f5541bf01a8f 100644 --- a/pkgs/by-name/sh/shark/package.nix +++ b/pkgs/by-name/sh/shark/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation (finalAttrs: { "-DBUILD_DOCS=OFF" "-DBUILD_TESTING=OFF" "-DENABLE_CBLAS=OFF" - ] ++ lib.optionals (!enableOpenMP) [ "-DENABLE_OPENMP=OFF" ]; + ] + ++ lib.optionals (!enableOpenMP) [ "-DENABLE_OPENMP=OFF" ]; buildInputs = [ boost openssl diff --git a/pkgs/by-name/sh/sharkey/package.nix b/pkgs/by-name/sh/sharkey/package.nix index babb5feb38d7..288e295a2f4a 100644 --- a/pkgs/by-name/sh/sharkey/package.nix +++ b/pkgs/by-name/sh/sharkey/package.nix @@ -38,18 +38,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-S8LxawbtguFOEZyYbS1FQWw/TcRm4Z6mG7dUhfXbf1c="; }; - nativeBuildInputs = - [ - makeWrapper - nodejs - pkg-config - pnpm_9.configHook - python3 - ] - ++ (lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - xcbuild - ]); + nativeBuildInputs = [ + makeWrapper + nodejs + pkg-config + pnpm_9.configHook + python3 + ] + ++ (lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + xcbuild + ]); buildInputs = [ cairo diff --git a/pkgs/by-name/sh/sheldon/package.nix b/pkgs/by-name/sh/sheldon/package.nix index c75ad7e7885f..224174b143fe 100644 --- a/pkgs/by-name/sh/sheldon/package.nix +++ b/pkgs/by-name/sh/sheldon/package.nix @@ -23,11 +23,12 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-4TDDNqlcs7LTmL9uHBjE8SHft38juUJUj8sLCimnTyc="; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + ]; nativeBuildInputs = [ installShellFiles pkg-config diff --git a/pkgs/by-name/sh/shipwright/package.nix b/pkgs/by-name/sh/shipwright/package.nix index b47543a96131..72d2e7dbef1c 100644 --- a/pkgs/by-name/sh/shipwright/package.nix +++ b/pkgs/by-name/sh/shipwright/package.nix @@ -134,61 +134,58 @@ stdenv.mkDerivation (finalAttrs: { ./disable-downloading-stb_image.patch ]; - nativeBuildInputs = - [ - cmake - ninja - pkg-config - python3 - imagemagick - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - lsb-release - copyDesktopItems - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libicns - darwin.sigtool - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + python3 + imagemagick + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + lsb-release + copyDesktopItems + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libicns + darwin.sigtool + fixDarwinDylibNames + ]; - buildInputs = - [ - boost - glew - SDL2 - SDL2_net - libpng - libzip - nlohmann_json - tinyxml-2 - spdlog - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libpulseaudio - zenity - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Metal.hpp requires macOS 13.x min. - apple-sdk_13 - ]; + buildInputs = [ + boost + glew + SDL2 + SDL2_net + libpng + libzip + nlohmann_json + tinyxml-2 + spdlog + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libpulseaudio + zenity + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Metal.hpp requires macOS 13.x min. + apple-sdk_13 + ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_REMOTE_CONTROL" true) - (lib.cmakeBool "NON_PORTABLE" true) - (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/lib") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_IMGUI" "${imgui'}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_LIBGFXD" "${libgfxd}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_PRISM" "${prism}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_STORMLIB" "${stormlib'}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_THREADPOOL" "${thread_pool}") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_METALCPP" "${metalcpp}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_SPDLOG" "${spdlog}") - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_REMOTE_CONTROL" true) + (lib.cmakeBool "NON_PORTABLE" true) + (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/lib") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_IMGUI" "${imgui'}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_LIBGFXD" "${libgfxd}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_PRISM" "${prism}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_STORMLIB" "${stormlib'}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_THREADPOOL" "${thread_pool}") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_METALCPP" "${metalcpp}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_SPDLOG" "${spdlog}") + ]; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-int-conversion -Wno-implicit-int -Wno-elaborated-enum-base"; diff --git a/pkgs/by-name/sh/shogihome/package.nix b/pkgs/by-name/sh/shogihome/package.nix index ea31b5e0db4e..8f601a20444e 100644 --- a/pkgs/by-name/sh/shogihome/package.nix +++ b/pkgs/by-name/sh/shogihome/package.nix @@ -60,53 +60,51 @@ buildNpmPackage (finalAttrs: { dontNpmBuild = true; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - cp -r ${electron.dist} electron-dist - chmod -R u+w electron-dist - '' - # Electron builder complains about symlink in electron-dist - + lib.optionalString stdenv.hostPlatform.isLinux '' - rm electron-dist/libvulkan.so.1 - cp '${lib.getLib vulkan-loader}/lib/libvulkan.so.1' electron-dist - '' - + '' - npm run electron:pack + cp -r ${electron.dist} electron-dist + chmod -R u+w electron-dist + '' + # Electron builder complains about symlink in electron-dist + + lib.optionalString stdenv.hostPlatform.isLinux '' + rm electron-dist/libvulkan.so.1 + cp '${lib.getLib vulkan-loader}/lib/libvulkan.so.1' electron-dist + '' + + '' + npm run electron:pack - ./node_modules/.bin/electron-builder \ - --dir \ - --config .electron-builder.config.mjs \ - -c.electronDist=electron-dist \ - -c.electronVersion=${electron.version} + ./node_modules/.bin/electron-builder \ + --dir \ + --config .electron-builder.config.mjs \ + -c.electronDist=electron-dist \ + -c.electronVersion=${electron.version} - runHook postBuild - ''; + runHook postBuild + ''; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p "$out/share/lib/shogihome" - cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/shogihome" + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p "$out/share/lib/shogihome" + cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/shogihome" - install -Dm444 'docs/icon.svg' "$out/share/icons/hicolor/scalable/apps/shogihome.svg" + install -Dm444 'docs/icon.svg' "$out/share/icons/hicolor/scalable/apps/shogihome.svg" - makeWrapper '${lib.getExe electron}' "$out/bin/shogihome" \ - --add-flags "$out/share/lib/shogihome/resources/app.asar" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --add-flags ${lib.escapeShellArgs commandLineArgs} \ - --inherit-argv0 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p "$out/Applications" - mv dist/mac*/ShogiHome.app "$out/Applications" - '' - + '' - runHook postInstall - ''; + makeWrapper '${lib.getExe electron}' "$out/bin/shogihome" \ + --add-flags "$out/share/lib/shogihome/resources/app.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --add-flags ${lib.escapeShellArgs commandLineArgs} \ + --inherit-argv0 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p "$out/Applications" + mv dist/mac*/ShogiHome.app "$out/Applications" + '' + + '' + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/sh/shorewall/package.nix b/pkgs/by-name/sh/shorewall/package.nix index 8535a2dc1705..9e5d30e05b24 100644 --- a/pkgs/by-name/sh/shorewall/package.nix +++ b/pkgs/by-name/sh/shorewall/package.nix @@ -41,19 +41,18 @@ stdenv.mkDerivation rec { ]; sourceRoot = "."; - buildInputs = - [ - coreutils - iproute2 - iptables - util-linux - gnugrep - gnused - perl - ] - ++ (with perlPackages; [ - DigestSHA1 - ]); + buildInputs = [ + coreutils + iproute2 + iptables + util-linux + gnugrep + gnused + perl + ] + ++ (with perlPackages; [ + DigestSHA1 + ]); prePatch = '' # Patch configure and install.sh files patchShebangs . diff --git a/pkgs/by-name/sh/shortwave/package.nix b/pkgs/by-name/sh/shortwave/package.nix index 6801c70c182f..bb04da0af671 100644 --- a/pkgs/by-name/sh/shortwave/package.nix +++ b/pkgs/by-name/sh/shortwave/package.nix @@ -57,25 +57,24 @@ stdenv.mkDerivation rec { wrapGAppsHook4 ]; - buildInputs = - [ - dbus - gdk-pixbuf - glib - gtk4 - libadwaita - openssl - sqlite - libshumate - libseccomp - lcms2 - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ]); + buildInputs = [ + dbus + gdk-pixbuf + glib + gtk4 + libadwaita + openssl + sqlite + libshumate + libseccomp + lcms2 + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ]); passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/sh/shutter/package.nix b/pkgs/by-name/sh/shutter/package.nix index 3ba076eeccea..699b4aac399d 100644 --- a/pkgs/by-name/sh/shutter/package.nix +++ b/pkgs/by-name/sh/shutter/package.nix @@ -82,7 +82,8 @@ stdenv.mkDerivation rec { libwnck libappindicator-gtk3 hicolor-icon-theme - ] ++ perlModules; + ] + ++ perlModules; makeFlags = [ "prefix=${placeholder "out"}" diff --git a/pkgs/by-name/si/sidplayfp/package.nix b/pkgs/by-name/si/sidplayfp/package.nix index 275ae26bc196..ea8847e703f4 100644 --- a/pkgs/by-name/si/sidplayfp/package.nix +++ b/pkgs/by-name/si/sidplayfp/package.nix @@ -34,19 +34,18 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - libsidplayfp - ] - ++ lib.optionals alsaSupport [ - alsa-lib - ] - ++ lib.optionals pulseSupport [ - libpulseaudio - ] - ++ lib.optionals out123Support [ - mpg123 - ]; + buildInputs = [ + libsidplayfp + ] + ++ lib.optionals alsaSupport [ + alsa-lib + ] + ++ lib.optionals pulseSupport [ + libpulseaudio + ] + ++ lib.optionals out123Support [ + mpg123 + ]; configureFlags = [ (lib.strings.withFeature out123Support "out123") diff --git a/pkgs/by-name/si/sigal/package.nix b/pkgs/by-name/si/sigal/package.nix index 1eea93cc1fb9..caecff95ecb1 100644 --- a/pkgs/by-name/si/sigal/package.nix +++ b/pkgs/by-name/si/sigal/package.nix @@ -36,13 +36,12 @@ python3.pkgs.buildPythonApplication rec { cryptography ]; - nativeCheckInputs = - [ - ffmpeg - ] - ++ (with python3.pkgs; [ - pytestCheckHook - ]); + nativeCheckInputs = [ + ffmpeg + ] + ++ (with python3.pkgs; [ + pytestCheckHook + ]); disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ "test_nonmedia_files" diff --git a/pkgs/by-name/si/signal-cli/package.nix b/pkgs/by-name/si/signal-cli/package.nix index 484f8226319d..02823da4744d 100644 --- a/pkgs/by-name/si/signal-cli/package.nix +++ b/pkgs/by-name/si/signal-cli/package.nix @@ -27,32 +27,31 @@ stdenvNoCC.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ makeWrapper ]; - installPhase = - '' - runHook preInstall - mkdir -p $out - cp -r lib $out/ - install -Dm755 bin/signal-cli -t $out/bin - '' - + ( - if stdenvNoCC.hostPlatform.isLinux then - '' - makeWrapper ${openjdk21_headless}/bin/java $out/bin/signal-cli \ - --set JAVA_HOME "${openjdk21_headless}" \ - --add-flags "-classpath '$out/lib/*:${libmatthew_java}/lib/jni'" \ - --add-flags "-Djava.library.path=${libmatthew_java}/lib/jni:${dbus_java}/share/java/dbus:$out/lib" \ - --add-flags "org.asamk.signal.Main" - '' - else - '' - wrapProgram $out/bin/signal-cli \ - --prefix PATH : ${lib.makeBinPath [ openjdk21_headless ]} \ - --set JAVA_HOME ${openjdk21_headless} - '' - ) - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r lib $out/ + install -Dm755 bin/signal-cli -t $out/bin + '' + + ( + if stdenvNoCC.hostPlatform.isLinux then + '' + makeWrapper ${openjdk21_headless}/bin/java $out/bin/signal-cli \ + --set JAVA_HOME "${openjdk21_headless}" \ + --add-flags "-classpath '$out/lib/*:${libmatthew_java}/lib/jni'" \ + --add-flags "-Djava.library.path=${libmatthew_java}/lib/jni:${dbus_java}/share/java/dbus:$out/lib" \ + --add-flags "org.asamk.signal.Main" + '' + else + '' + wrapProgram $out/bin/signal-cli \ + --prefix PATH : ${lib.makeBinPath [ openjdk21_headless ]} \ + --set JAVA_HOME ${openjdk21_headless} + '' + ) + + '' + runHook postInstall + ''; # Execution in the macOS (10.13) sandbox fails with # dyld: Library not loaded: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa diff --git a/pkgs/by-name/si/signal-desktop/ringrtc.nix b/pkgs/by-name/si/signal-desktop/ringrtc.nix index 084bf8c0cee2..2b1699641a21 100644 --- a/pkgs/by-name/si/signal-desktop/ringrtc.nix +++ b/pkgs/by-name/si/signal-desktop/ringrtc.nix @@ -48,13 +48,12 @@ rustPlatform.buildRustPackage (finalAttrs: { cmake pkg-config ]; - buildInputs = - [ - webrtc - cubeb' - ] - # Workaround for https://github.com/NixOS/nixpkgs/pull/394607 - ++ cubeb'.buildInputs; + buildInputs = [ + webrtc + cubeb' + ] + # Workaround for https://github.com/NixOS/nixpkgs/pull/394607 + ++ cubeb'.buildInputs; meta = { homepage = "https://github.com/signalapp/ringrtc"; diff --git a/pkgs/by-name/si/signalbackup-tools/package.nix b/pkgs/by-name/si/signalbackup-tools/package.nix index e8f641c839d5..863535406a9f 100644 --- a/pkgs/by-name/si/signalbackup-tools/package.nix +++ b/pkgs/by-name/si/signalbackup-tools/package.nix @@ -22,22 +22,20 @@ stdenv.mkDerivation rec { hash = "sha256-weUqp77bK8svM5Pj0z6E1agAw1bTfELcaWTeW+XlfY0="; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + ]; - buildInputs = - [ - openssl - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - dbus - ]; + buildInputs = [ + openssl + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + dbus + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/si/sile/package.nix b/pkgs/by-name/si/sile/package.nix index 6ea63089511b..493a14a14fde 100644 --- a/pkgs/by-name/si/sile/package.nix +++ b/pkgs/by-name/si/sile/package.nix @@ -64,26 +64,25 @@ stdenv.mkDerivation (finalAttrs: { libiconv ]; - configureFlags = - [ - # Nix will supply all the Lua dependencies, so stop the build system from - # bundling vendored copies of them. - "--with-system-lua-sources" - "--with-system-luarocks" - # The automake check target uses pdfinfo to confirm the output of a test - # run, and uses autotools to discover it. This flake build eschews that - # test because it is run from the source directory but the binary is - # already built with system paths, so it can't be checked under Nix until - # after install. After install the Makefile isn't available of course, so - # we have our own copy of it with a hard coded path to `pdfinfo`. By - # specifying some binary here we skip the configure time test for - # `pdfinfo`, by using `false` we make sure that if it is expected during - # build time we would fail to build since we only provide it at test time. - "PDFINFO=false" - ] - ++ lib.optionals (!lua.pkgs.isLuaJIT) [ - "--without-luajit" - ]; + configureFlags = [ + # Nix will supply all the Lua dependencies, so stop the build system from + # bundling vendored copies of them. + "--with-system-lua-sources" + "--with-system-luarocks" + # The automake check target uses pdfinfo to confirm the output of a test + # run, and uses autotools to discover it. This flake build eschews that + # test because it is run from the source directory but the binary is + # already built with system paths, so it can't be checked under Nix until + # after install. After install the Makefile isn't available of course, so + # we have our own copy of it with a hard coded path to `pdfinfo`. By + # specifying some binary here we skip the configure time test for + # `pdfinfo`, by using `false` we make sure that if it is expected during + # build time we would fail to build since we only provide it at test time. + "PDFINFO=false" + ] + ++ lib.optionals (!lua.pkgs.isLuaJIT) [ + "--without-luajit" + ]; outputs = [ "out" @@ -118,38 +117,37 @@ stdenv.mkDerivation (finalAttrs: { # "lua-resty-http" # ]) ps # ) - luaPackages = - [ - "cassowary" - "cldr" - "fluent" - "linenoise" - "loadkit" - "lpeg" - "lua-zlib" - "lua_cliargs" - "luaepnf" - "luaexpat" - "luafilesystem" - "luarepl" - "luasec" - "luasocket" - "luautf8" - "penlight" - "vstruct" - # lua packages needed for testing - "busted" - "luacheck" - # packages needed for building api docs - "ldoc" - # NOTE: Add lua packages here, to change the luaEnv also read by `flake.nix` - ] - ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [ - "bit32" - ] - ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [ - "compat53" - ]; + luaPackages = [ + "cassowary" + "cldr" + "fluent" + "linenoise" + "loadkit" + "lpeg" + "lua-zlib" + "lua_cliargs" + "luaepnf" + "luaexpat" + "luafilesystem" + "luarepl" + "luasec" + "luasocket" + "luautf8" + "penlight" + "vstruct" + # lua packages needed for testing + "busted" + "luacheck" + # packages needed for building api docs + "ldoc" + # NOTE: Add lua packages here, to change the luaEnv also read by `flake.nix` + ] + ++ lib.optionals (lib.versionOlder lua.luaversion "5.2") [ + "bit32" + ] + ++ lib.optionals (lib.versionOlder lua.luaversion "5.3") [ + "compat53" + ]; luaEnv = lua.withPackages (ps: lib.attrVals finalAttrs.finalPackage.passthru.luaPackages ps); # Copied from Makefile.am diff --git a/pkgs/by-name/si/silicon/package.nix b/pkgs/by-name/si/silicon/package.nix index 9d3444805172..5dddeaaf1156 100644 --- a/pkgs/by-name/si/silicon/package.nix +++ b/pkgs/by-name/si/silicon/package.nix @@ -29,24 +29,24 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-MpmGLhg00quz4mYkidLofpcZTVwxbgIThg5v2r4HIfs="; - buildInputs = - [ - expat - freetype - fira-code - fontconfig - harfbuzz - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ libxcb ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + expat + freetype + fira-code + fontconfig + harfbuzz + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libxcb ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; nativeBuildInputs = [ cmake pkg-config rustPlatform.bindgenHook - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ python3 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ python3 ]; preCheck = '' export HOME=$TMPDIR diff --git a/pkgs/by-name/si/simdjson/package.nix b/pkgs/by-name/si/simdjson/package.nix index 1a64b60ac280..29c1859ce63e 100644 --- a/pkgs/by-name/si/simdjson/package.nix +++ b/pkgs/by-name/si/simdjson/package.nix @@ -18,18 +18,17 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - cmakeFlags = - [ - "-DSIMDJSON_DEVELOPER_MODE=OFF" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "-DBUILD_SHARED_LIBS=OFF" - ] - ++ lib.optionals (with stdenv.hostPlatform; isPower && isBigEndian) [ - # Assume required CPU features are available, since otherwise we - # just get a failed build. - "-DCMAKE_CXX_FLAGS=-mpower8-vector" - ]; + cmakeFlags = [ + "-DSIMDJSON_DEVELOPER_MODE=OFF" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "-DBUILD_SHARED_LIBS=OFF" + ] + ++ lib.optionals (with stdenv.hostPlatform; isPower && isBigEndian) [ + # Assume required CPU features are available, since otherwise we + # just get a failed build. + "-DCMAKE_CXX_FLAGS=-mpower8-vector" + ]; meta = with lib; { homepage = "https://simdjson.org/"; diff --git a/pkgs/by-name/si/simgrid/package.nix b/pkgs/by-name/si/simgrid/package.nix index 7f11dfd3ad90..a430252abcd3 100644 --- a/pkgs/by-name/si/simgrid/package.nix +++ b/pkgs/by-name/si/simgrid/package.nix @@ -42,26 +42,25 @@ stdenv.mkDerivation rec { }; propagatedBuildInputs = [ boost ]; - nativeBuildInputs = - [ - cmake - perl - python3 - ] - ++ lib.optionals fortranSupport [ gfortran ] - ++ lib.optionals buildJavaBindings [ openjdk ] - ++ lib.optionals buildPythonBindings [ python3Packages.pybind11 ] - ++ lib.optionals buildDocumentation [ - fig2dev - ghostscript - doxygen - ] - ++ lib.optionals bmfSupport [ eigen ] - ++ lib.optionals modelCheckingSupport [ - libunwind - libevent - elfutils - ]; + nativeBuildInputs = [ + cmake + perl + python3 + ] + ++ lib.optionals fortranSupport [ gfortran ] + ++ lib.optionals buildJavaBindings [ openjdk ] + ++ lib.optionals buildPythonBindings [ python3Packages.pybind11 ] + ++ lib.optionals buildDocumentation [ + fig2dev + ghostscript + doxygen + ] + ++ lib.optionals bmfSupport [ eigen ] + ++ lib.optionals modelCheckingSupport [ + libunwind + libevent + elfutils + ]; outputs = [ "out" ] ++ lib.optionals buildPythonBindings [ "python" ]; diff --git a/pkgs/by-name/si/simulide/package.nix b/pkgs/by-name/si/simulide/package.nix index 29d75bbb72ff..3dfb24aafb63 100644 --- a/pkgs/by-name/si/simulide/package.nix +++ b/pkgs/by-name/si/simulide/package.nix @@ -107,15 +107,14 @@ stdenv.mkDerivation { libsForQt5.wrapQtAppsHook ]; - buildInputs = - [ - libsForQt5.qtserialport - libsForQt5.qtmultimedia - libsForQt5.qttools - ] - ++ lib.optionals (lib.versionOlder versionNum "1.1.0") [ - libsForQt5.qtscript - ]; + buildInputs = [ + libsForQt5.qtserialport + libsForQt5.qtmultimedia + libsForQt5.qttools + ] + ++ lib.optionals (lib.versionOlder versionNum "1.1.0") [ + libsForQt5.qtscript + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/si/singular/package.nix b/pkgs/by-name/si/singular/package.nix index d16b427c282a..9135f13c901e 100644 --- a/pkgs/by-name/si/singular/package.nix +++ b/pkgs/by-name/si/singular/package.nix @@ -49,15 +49,14 @@ stdenv.mkDerivation rec { forceFetchGit = true; }; - configureFlags = - [ - "--enable-gfanlib" - "--with-ntl=${ntl}" - "--with-flint=${flint3}" - ] - ++ lib.optionals enableDocs [ - "--enable-doc-build" - ]; + configureFlags = [ + "--enable-gfanlib" + "--with-ntl=${ntl}" + "--with-flint=${flint3}" + ] + ++ lib.optionals enableDocs [ + "--enable-doc-build" + ]; prePatch = '' # don't let the tests depend on `hostname` @@ -101,22 +100,21 @@ stdenv.mkDerivation rec { cddlib ]; - nativeBuildInputs = - [ - bison - perl - pkg-config - autoreconfHook - sharutils # needed for regress.cmd install checks - ] - ++ lib.optionals enableDocs [ - doxygen - graphviz - latex2html - texinfo - texliveSmall - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]; + nativeBuildInputs = [ + bison + perl + pkg-config + autoreconfHook + sharutils # needed for regress.cmd install checks + ] + ++ lib.optionals enableDocs [ + doxygen + graphviz + latex2html + texinfo + texliveSmall + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; preAutoreconf = '' @@ -131,21 +129,20 @@ stdenv.mkDerivation rec { doCheck = true; # very basic checks, does not test any libraries - installPhase = - '' - # clean up any artefacts a previous non-sandboxed docbuild may have left behind - rm /tmp/conic.log /tmp/conic.tex /tmp/tropicalcurve*.tex || true - make install - '' - + lib.optionalString enableDocs '' - # Sage uses singular.info, which is not installed by default - mkdir -p $out/share/info - cp doc/singular.info $out/share/info - '' - + '' - # Make sure patchelf picks up the right libraries - rm -rf libpolys factory resources omalloc Singular - ''; + installPhase = '' + # clean up any artefacts a previous non-sandboxed docbuild may have left behind + rm /tmp/conic.log /tmp/conic.tex /tmp/tropicalcurve*.tex || true + make install + '' + + lib.optionalString enableDocs '' + # Sage uses singular.info, which is not installed by default + mkdir -p $out/share/info + cp doc/singular.info $out/share/info + '' + + '' + # Make sure patchelf picks up the right libraries + rm -rf libpolys factory resources omalloc Singular + ''; # singular tests are a bit complicated, see # https://github.com/Singular/Singular/tree/spielwiese/Tst diff --git a/pkgs/by-name/si/sioyek/package.nix b/pkgs/by-name/si/sioyek/package.nix index 54e8dd02bb77..25c1beff2ef6 100644 --- a/pkgs/by-name/si/sioyek/package.nix +++ b/pkgs/by-name/si/sioyek/package.nix @@ -24,20 +24,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-ANZYsOuTUEp5agbCdBX2uqTh8XKx53bMJn5UPpmKixY="; }; - buildInputs = - [ - gumbo - harfbuzz - jbig2dec - mujs - mupdf - openjpeg - qt6.qt3d - qt6.qtbase - qt6.qtspeech - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ freetype ]; + buildInputs = [ + gumbo + harfbuzz + jbig2dec + mujs + mupdf + openjpeg + qt6.qt3d + qt6.qtbase + qt6.qtspeech + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ freetype ]; nativeBuildInputs = [ installShellFiles diff --git a/pkgs/by-name/si/sipp/package.nix b/pkgs/by-name/si/sipp/package.nix index 3f715baabcee..0e07d4396ac8 100644 --- a/pkgs/by-name/si/sipp/package.nix +++ b/pkgs/by-name/si/sipp/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { ncurses libpcap openssl - ] ++ lib.optional (stdenv.hostPlatform.isLinux) lksctp-tools; + ] + ++ lib.optional (stdenv.hostPlatform.isLinux) lksctp-tools; meta = { homepage = "http://sipp.sf.net"; diff --git a/pkgs/by-name/si/sipvicious/package.nix b/pkgs/by-name/si/sipvicious/package.nix index 369f1634b68c..20144268a2b1 100644 --- a/pkgs/by-name/si/sipvicious/package.nix +++ b/pkgs/by-name/si/sipvicious/package.nix @@ -17,13 +17,12 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-O8/9Vz/u8BoF1dfGceOJdzPPYLfkdBp2DkwA5WQ3dgo="; }; - build-system = - [ - installShellFiles - ] - ++ (with python3.pkgs; [ - setuptools - ]); + build-system = [ + installShellFiles + ] + ++ (with python3.pkgs; [ + setuptools + ]); dependencies = with python3.pkgs; [ scapy diff --git a/pkgs/by-name/si/sirikali/package.nix b/pkgs/by-name/si/sirikali/package.nix index 53bd8d93395c..0028fa166a03 100644 --- a/pkgs/by-name/si/sirikali/package.nix +++ b/pkgs/by-name/si/sirikali/package.nix @@ -31,15 +31,14 @@ stdenv.mkDerivation rec { hash = "sha256-rfmWtbPYtkaGemeStMWwA6JllOkDiHMftSfmirtAOEQ="; }; - buildInputs = - [ - qt6.qtbase - libpwquality - hicolor-icon-theme - libgcrypt - ] - ++ lib.optionals withKWallet [ kdePackages.kwallet ] - ++ lib.optionals withLibsecret [ libsecret ]; + buildInputs = [ + qt6.qtbase + libpwquality + hicolor-icon-theme + libgcrypt + ] + ++ lib.optionals withKWallet [ kdePackages.kwallet ] + ++ lib.optionals withLibsecret [ libsecret ]; nativeBuildInputs = [ qt6.wrapQtAppsHook diff --git a/pkgs/by-name/si/sirius/package.nix b/pkgs/by-name/si/sirius/package.nix index a913e2e9c864..826e1638dfaa 100644 --- a/pkgs/by-name/si/sirius/package.nix +++ b/pkgs/by-name/si/sirius/package.nix @@ -65,88 +65,86 @@ stdenv.mkDerivation rec { cmake gfortran pkg-config - ] ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc; + ] + ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc; - buildInputs = + buildInputs = [ + blas + lapack + gsl + libxc + hdf5 + umpire + mpi + spglib + spfft + spla + costa + scalapack + boost + eigen + libvdwxc + ] + ++ lib.optionals (gpuBackend == "cuda") [ + cudaPackages.cuda_cudart + cudaPackages.cuda_profiler_api + cudaPackages.cudatoolkit + cudaPackages.libcublas + ] + ++ lib.optionals (gpuBackend == "rocm") [ + rocmPackages.clr + rocmPackages.rocblas + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp + ] + ++ lib.optionals enablePython ( + with pythonPackages; [ - blas - lapack - gsl - libxc - hdf5 - umpire - mpi - spglib - spfft - spla - costa - scalapack - boost - eigen - libvdwxc + python + pybind11 ] - ++ lib.optionals (gpuBackend == "cuda") [ - cudaPackages.cuda_cudart - cudaPackages.cuda_profiler_api - cudaPackages.cudatoolkit - cudaPackages.libcublas - ] - ++ lib.optionals (gpuBackend == "rocm") [ - rocmPackages.clr - rocmPackages.rocblas - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages.openmp - ] - ++ lib.optionals enablePython ( - with pythonPackages; - [ - python - pybind11 - ] - ); + ); - propagatedBuildInputs = + propagatedBuildInputs = [ + (lib.getBin mpi) + ] + ++ lib.optionals enablePython ( + with pythonPackages; [ - (lib.getBin mpi) + mpi4py + voluptuous + numpy + h5py + scipy + pyyaml ] - ++ lib.optionals enablePython ( - with pythonPackages; - [ - mpi4py - voluptuous - numpy - h5py - scipy - pyyaml - ] - ); + ); CXXFLAGS = [ # GCC 13: error: 'uintptr_t' in namespace 'std' does not name a type "-include cstdint" ]; - cmakeFlags = - [ - "-DSIRIUS_USE_SCALAPACK=ON" - "-DSIRIUS_USE_VDWXC=ON" - "-DSIRIUS_CREATE_FORTRAN_BINDINGS=ON" - "-DSIRIUS_USE_OPENMP=ON" - "-DBUILD_TESTING=ON" - ] - ++ lib.optionals (gpuBackend == "cuda") [ - "-DSIRIUS_USE_CUDA=ON" - "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}" - (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) - ] - ++ lib.optionals (gpuBackend == "rocm") [ - "-DSIRIUS_USE_ROCM=ON" - "-DHIP_ROOT_DIR=${rocmPackages.clr}" - ] - ++ lib.optionals enablePython [ - "-DSIRIUS_CREATE_PYTHON_MODULE=ON" - ]; + cmakeFlags = [ + "-DSIRIUS_USE_SCALAPACK=ON" + "-DSIRIUS_USE_VDWXC=ON" + "-DSIRIUS_CREATE_FORTRAN_BINDINGS=ON" + "-DSIRIUS_USE_OPENMP=ON" + "-DBUILD_TESTING=ON" + ] + ++ lib.optionals (gpuBackend == "cuda") [ + "-DSIRIUS_USE_CUDA=ON" + "-DCUDA_TOOLKIT_ROOT_DIR=${cudaPackages.cudatoolkit}" + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) + ] + ++ lib.optionals (gpuBackend == "rocm") [ + "-DSIRIUS_USE_ROCM=ON" + "-DHIP_ROOT_DIR=${rocmPackages.clr}" + ] + ++ lib.optionals enablePython [ + "-DSIRIUS_CREATE_PYTHON_MODULE=ON" + ]; doCheck = true; diff --git a/pkgs/by-name/sk/skia/package.nix b/pkgs/by-name/sk/skia/package.nix index 42ed364948a9..09c3c3851a62 100644 --- a/pkgs/by-name/sk/skia/package.nix +++ b/pkgs/by-name/sk/skia/package.nix @@ -46,35 +46,33 @@ stdenv.mkDerivation (finalAttrs: { ''; strictDeps = true; - nativeBuildInputs = - [ - gn - ninja - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - xcbuild - cctools.libtool - zlib - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + gn + ninja + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild + cctools.libtool + zlib + fixDarwinDylibNames + ]; - buildInputs = - [ - expat - fontconfig - freetype - harfbuzzFull - icu - libGL - libjpeg - libwebp - libX11 - ] - ++ lib.optionals enableVulkan [ - vulkan-headers - vulkan-memory-allocator - ]; + buildInputs = [ + expat + fontconfig + freetype + harfbuzzFull + icu + libGL + libjpeg + libwebp + libX11 + ] + ++ lib.optionals enableVulkan [ + vulkan-headers + vulkan-memory-allocator + ]; gnFlags = let diff --git a/pkgs/by-name/sk/skopeo/package.nix b/pkgs/by-name/sk/skopeo/package.nix index 65098121e719..894b61a3f5a7 100644 --- a/pkgs/by-name/sk/skopeo/package.nix +++ b/pkgs/by-name/sk/skopeo/package.nix @@ -44,44 +44,43 @@ buildGoModule rec { makeWrapper ]; - buildInputs = - [ gpgme ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - lvm2 - btrfs-progs - ]; + buildInputs = [ + gpgme + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + lvm2 + btrfs-progs + ]; - buildPhase = - '' - runHook preBuild - patchShebangs . - make bin/skopeo docs - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - make completions - '' - + '' - runHook postBuild - ''; + buildPhase = '' + runHook preBuild + patchShebangs . + make bin/skopeo docs + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + make completions + '' + + '' + runHook postBuild + ''; - installPhase = - '' - runHook preInstall - PREFIX=${placeholder "out"} make install-binary install-docs - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - PREFIX=${placeholder "out"} make install-completions - '' - + '' - install ${passthru.policy}/default-policy.json -Dt $out/etc/containers - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/skopeo \ - --prefix PATH : ${lib.makeBinPath [ fuse-overlayfs ]} - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + PREFIX=${placeholder "out"} make install-binary install-docs + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + PREFIX=${placeholder "out"} make install-completions + '' + + '' + install ${passthru.policy}/default-policy.json -Dt $out/etc/containers + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram $out/bin/skopeo \ + --prefix PATH : ${lib.makeBinPath [ fuse-overlayfs ]} + '' + + '' + runHook postInstall + ''; passthru = { policy = runCommand "policy" { } '' diff --git a/pkgs/by-name/sk/skribilo/package.nix b/pkgs/by-name/sk/skribilo/package.nix index 35e715b3aece..36d47edc80e2 100644 --- a/pkgs/by-name/sk/skribilo/package.nix +++ b/pkgs/by-name/sk/skribilo/package.nix @@ -38,20 +38,19 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - fig2dev - gettext - ghostscript - guile - guile-lib - guile-reader - imagemagick - ] - ++ optional enableEmacs emacs - ++ optional enableLout lout - ++ optional enablePloticus ploticus - ++ optional enableTex texliveSmall; + buildInputs = [ + fig2dev + gettext + ghostscript + guile + guile-lib + guile-reader + imagemagick + ] + ++ optional enableEmacs emacs + ++ optional enableLout lout + ++ optional enablePloticus ploticus + ++ optional enableTex texliveSmall; postInstall = '' wrapProgram $out/bin/skribilo \ diff --git a/pkgs/by-name/sk/skyemu/package.nix b/pkgs/by-name/sk/skyemu/package.nix index ec3243c86d11..697daa6cb5c7 100644 --- a/pkgs/by-name/sk/skyemu/package.nix +++ b/pkgs/by-name/sk/skyemu/package.nix @@ -37,21 +37,20 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - alsa-lib - curl - libGL - libGLU - openssl - SDL2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXi - libXcursor - lua - ]; + buildInputs = [ + alsa-lib + curl + libGL + libGLU + openssl + SDL2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXi + libXcursor + lua + ]; cmakeFlags = [ (lib.cmakeBool "USE_SYSTEM_CURL" true) diff --git a/pkgs/by-name/sl/slack/package.nix b/pkgs/by-name/sl/slack/package.nix index d24ce008ea05..14ef041d6204 100644 --- a/pkgs/by-name/sl/slack/package.nix +++ b/pkgs/by-name/sl/slack/package.nix @@ -173,47 +173,46 @@ let dontBuild = true; dontPatchELF = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - # The deb file contains a setuid binary, so 'dpkg -x' doesn't work here - dpkg --fsys-tarfile $src | tar --extract - rm -rf usr/share/lintian + # The deb file contains a setuid binary, so 'dpkg -x' doesn't work here + dpkg --fsys-tarfile $src | tar --extract + rm -rf usr/share/lintian - mkdir -p $out - mv usr/* $out + mkdir -p $out + mv usr/* $out - # Otherwise it looks "suspicious" - chmod -R g-w $out + # Otherwise it looks "suspicious" + chmod -R g-w $out - for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true - patchelf --set-rpath ${rpath}:$out/lib/slack $file || true - done + for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true + patchelf --set-rpath ${rpath}:$out/lib/slack $file || true + done - # Replace the broken bin/slack symlink with a startup wrapper. - # Make xdg-open overrideable at runtime. - rm $out/bin/slack - makeWrapper $out/lib/slack/slack $out/bin/slack \ - --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \ - --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --enable-wayland-ime=true}}" + # Replace the broken bin/slack symlink with a startup wrapper. + # Make xdg-open overrideable at runtime. + rm $out/bin/slack + makeWrapper $out/lib/slack/slack $out/bin/slack \ + --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \ + --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --enable-wayland-ime=true}}" - # Fix the desktop link - substituteInPlace $out/share/applications/slack.desktop \ - --replace /usr/bin/ $out/bin/ \ - --replace /usr/share/pixmaps/slack.png slack \ - --replace bin/slack "bin/slack -s" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Prevent Un-blacklist pipewire integration to enable screen sharing on wayland. - # https://github.com/flathub/com.slack.Slack/issues/101#issuecomment-1807073763 - sed -i -e 's/,"WebRTCPipeWireCapturer"/,"LebRTCPipeWireCapturer"/' $out/lib/slack/resources/app.asar - '' - + '' - runHook postInstall - ''; + # Fix the desktop link + substituteInPlace $out/share/applications/slack.desktop \ + --replace /usr/bin/ $out/bin/ \ + --replace /usr/share/pixmaps/slack.png slack \ + --replace bin/slack "bin/slack -s" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # Prevent Un-blacklist pipewire integration to enable screen sharing on wayland. + # https://github.com/flathub/com.slack.Slack/issues/101#issuecomment-1807073763 + sed -i -e 's/,"WebRTCPipeWireCapturer"/,"LebRTCPipeWireCapturer"/' $out/lib/slack/resources/app.asar + '' + + '' + runHook postInstall + ''; }; darwin = stdenv.mkDerivation { diff --git a/pkgs/by-name/sl/slang/package.nix b/pkgs/by-name/sl/slang/package.nix index a72855654ceb..d5143b7a6d37 100644 --- a/pkgs/by-name/sl/slang/package.nix +++ b/pkgs/by-name/sl/slang/package.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation rec { libpng readline zlib - ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ libiconv ]; + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ libiconv ]; propagatedBuildInputs = [ ncurses ]; diff --git a/pkgs/by-name/sl/slepc/package.nix b/pkgs/by-name/sl/slepc/package.nix index 6d77fbdbe134..b44717b8b520 100644 --- a/pkgs/by-name/sl/slepc/package.nix +++ b/pkgs/by-name/sl/slepc/package.nix @@ -42,14 +42,13 @@ stdenv.mkDerivation (finalAttrs: { export SLEPC_DIR=$PWD ''; - nativeBuildInputs = - [ - python3 - ] - ++ lib.optionals pythonSupport [ - python3Packages.setuptools - python3Packages.cython - ]; + nativeBuildInputs = [ + python3 + ] + ++ lib.optionals pythonSupport [ + python3Packages.setuptools + python3Packages.cython + ]; configureFlags = lib.optionals withArpack [ @@ -59,13 +58,12 @@ stdenv.mkDerivation (finalAttrs: { "--with-slepc4py=1" ]; - buildInputs = - [ - mpi - ] - ++ lib.optionals withArpack [ - arpack-mpi - ]; + buildInputs = [ + mpi + ] + ++ lib.optionals withArpack [ + arpack-mpi + ]; propagatedBuildInputs = [ petsc @@ -77,14 +75,13 @@ stdenv.mkDerivation (finalAttrs: { __darwinAllowLocalNetworking = true; - nativeInstallCheckInputs = - [ - mpiCheckPhaseHook - ] - ++ lib.optionals pythonSupport [ - python3Packages.pythonImportsCheckHook - python3Packages.unittestCheckHook - ]; + nativeInstallCheckInputs = [ + mpiCheckPhaseHook + ] + ++ lib.optionals pythonSupport [ + python3Packages.pythonImportsCheckHook + python3Packages.unittestCheckHook + ]; doInstallCheck = true; diff --git a/pkgs/by-name/sl/sleqp/package.nix b/pkgs/by-name/sl/sleqp/package.nix index cf00b01448b4..c64026d63675 100644 --- a/pkgs/by-name/sl/sleqp/package.nix +++ b/pkgs/by-name/sl/sleqp/package.nix @@ -36,25 +36,24 @@ stdenv.mkDerivation (finalAttrs: { cmake pkg-config ]; - buildInputs = - [ - blas - check - highs - lapack - suitesparse - trlib - ] - ++ lib.optionals pythonSupport [ - python3Packages.cython - python3Packages.numpy - python3Packages.pip - python3Packages.pytest - python3Packages.setuptools - python3Packages.scipy - python3Packages.tox - python3Packages.wheel - ]; + buildInputs = [ + blas + check + highs + lapack + suitesparse + trlib + ] + ++ lib.optionals pythonSupport [ + python3Packages.cython + python3Packages.numpy + python3Packages.pip + python3Packages.pytest + python3Packages.setuptools + python3Packages.scipy + python3Packages.tox + python3Packages.wheel + ]; cmakeFlags = [ (lib.cmakeBool "SLEQP_ENABLE_PYTHON" pythonSupport) diff --git a/pkgs/by-name/sl/slic3r/package.nix b/pkgs/by-name/sl/slic3r/package.nix index 1790d103d986..6931cc5e7130 100644 --- a/pkgs/by-name/sl/slic3r/package.nix +++ b/pkgs/by-name/sl/slic3r/package.nix @@ -28,35 +28,36 @@ stdenv.mkDerivation rec { which wrapGAppsHook3 ]; - buildInputs = - [ boost ] - ++ (with perlPackages; [ - perl - EncodeLocale - MathClipper - ExtUtilsXSpp - MathConvexHullMonotoneChain - MathGeometryVoronoi - MathPlanePath - Moo - IOStringy - ClassXSAccessor - Wx - GrowlGNTP - NetDBus - ImportInto - XMLSAX - ExtUtilsMakeMaker - OpenGL - WxGLCanvas - ModuleBuild - LWP - ExtUtilsCppGuess - ModuleBuildWithXSpp - ExtUtilsTypemapsDefault - DevelChecklib - locallib - ]); + buildInputs = [ + boost + ] + ++ (with perlPackages; [ + perl + EncodeLocale + MathClipper + ExtUtilsXSpp + MathConvexHullMonotoneChain + MathGeometryVoronoi + MathPlanePath + Moo + IOStringy + ClassXSAccessor + Wx + GrowlGNTP + NetDBus + ImportInto + XMLSAX + ExtUtilsMakeMaker + OpenGL + WxGLCanvas + ModuleBuild + LWP + ExtUtilsCppGuess + ModuleBuildWithXSpp + ExtUtilsTypemapsDefault + DevelChecklib + locallib + ]); desktopItem = makeDesktopItem { name = "slic3r"; diff --git a/pkgs/by-name/sl/slimevr/package.nix b/pkgs/by-name/sl/slimevr/package.nix index 2c6daec2e1ef..039e001de7ac 100644 --- a/pkgs/by-name/sl/slimevr/package.nix +++ b/pkgs/by-name/sl/slimevr/package.nix @@ -52,19 +52,18 @@ rustPlatform.buildRustPackage rec { makeWrapper ]; - buildInputs = - [ - openssl - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gst-plugins-bad - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glib-networking - libayatana-appindicator - webkitgtk_4_1 - ]; + buildInputs = [ + openssl + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gst-plugins-bad + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glib-networking + libayatana-appindicator + webkitgtk_4_1 + ]; patches = [ # Upstream code uses Git to find the program version. @@ -75,30 +74,29 @@ rustPlatform.buildRustPackage rec { ./no-java-tool-options-warning.patch ]; - postPatch = - '' - # Tauri bundler expects slimevr.jar to exist. - mkdir -p server/desktop/build/libs - touch server/desktop/build/libs/slimevr.jar - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Both libappindicator-rs and SlimeVR need to know where Nix's appindicator lib is. - substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \ - --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" - substituteInPlace gui/src-tauri/src/tray.rs \ - --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" + postPatch = '' + # Tauri bundler expects slimevr.jar to exist. + mkdir -p server/desktop/build/libs + touch server/desktop/build/libs/slimevr.jar + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # Both libappindicator-rs and SlimeVR need to know where Nix's appindicator lib is. + substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \ + --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" + substituteInPlace gui/src-tauri/src/tray.rs \ + --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" - # tao < version 0.31 has a GTK crash. Manually apply the fix. - pushd $cargoDepsCopy/tao-0.30.* - patch -p1 < ${ - fetchpatch { - name = "fix-gtk-crash.patch"; - url = "https://github.com/tauri-apps/tao/commit/83e35e961f4893790b913ee2efc15ae33fd16fb2.diff"; - hash = "sha256-FNXWzsg4lO6VbLsqS6NevX8kVj26YtcYdKbbFejq9hM="; - } + # tao < version 0.31 has a GTK crash. Manually apply the fix. + pushd $cargoDepsCopy/tao-0.30.* + patch -p1 < ${ + fetchpatch { + name = "fix-gtk-crash.patch"; + url = "https://github.com/tauri-apps/tao/commit/83e35e961f4893790b913ee2efc15ae33fd16fb2.diff"; + hash = "sha256-FNXWzsg4lO6VbLsqS6NevX8kVj26YtcYdKbbFejq9hM="; } - popd - ''; + } + popd + ''; # solarxr needs to be installed after compiling its Typescript files. This isn't # done the first time, because `pnpm_9.configHook` ignores `package.json` scripts. diff --git a/pkgs/by-name/sl/slint-lsp/package.nix b/pkgs/by-name/sl/slint-lsp/package.nix index 6f746ccfaecf..2f1f84069c92 100644 --- a/pkgs/by-name/sl/slint-lsp/package.nix +++ b/pkgs/by-name/sl/slint-lsp/package.nix @@ -24,19 +24,18 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-Wa07LLcMQ1PxA8CJhaLDu5OllfJYKmJ8uWDfXOu8rus="; - rpathLibs = - [ - fontconfig - libGL - xorg.libxcb - xorg.libX11 - xorg.libXcursor - xorg.libXi - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libxkbcommon - wayland - ]; + rpathLibs = [ + fontconfig + libGL + xorg.libxcb + xorg.libX11 + xorg.libXcursor + xorg.libXi + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libxkbcommon + wayland + ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/sl/slurm/package.nix b/pkgs/by-name/sl/slurm/package.nix index a52644c2413d..42a622a51c30 100644 --- a/pkgs/by-name/sl/slurm/package.nix +++ b/pkgs/by-name/sl/slurm/package.nix @@ -64,22 +64,21 @@ stdenv.mkDerivation rec { ./common-env-echo.patch ]; - prePatch = - '' - substituteInPlace src/common/env.c \ - --replace "/bin/echo" "${coreutils}/bin/echo" + prePatch = '' + substituteInPlace src/common/env.c \ + --replace "/bin/echo" "${coreutils}/bin/echo" - # Autoconf does not support split packages for pmix (libs and headers). - # Fix the path to the pmix libraries, so dlopen can find it. - substituteInPlace src/plugins/mpi/pmix/mpi_pmix.c \ - --replace 'xstrfmtcat(full_path, "%s/", PMIXP_LIBPATH)' \ - 'xstrfmtcat(full_path, "${lib.getLib pmix}/lib/")' + # Autoconf does not support split packages for pmix (libs and headers). + # Fix the path to the pmix libraries, so dlopen can find it. + substituteInPlace src/plugins/mpi/pmix/mpi_pmix.c \ + --replace 'xstrfmtcat(full_path, "%s/", PMIXP_LIBPATH)' \ + 'xstrfmtcat(full_path, "${lib.getLib pmix}/lib/")' - '' - + (lib.optionalString enableX11 '' - substituteInPlace src/common/x11_util.c \ - --replace '"/usr/bin/xauth"' '"${xorg.xauth}/bin/xauth"' - ''); + '' + + (lib.optionalString enableX11 '' + substituteInPlace src/common/x11_util.c \ + --replace '"/usr/bin/xauth"' '"${xorg.xauth}/bin/xauth"' + ''); # nixos test fails to start slurmd with 'undefined symbol: slurm_job_preempt_mode' # https://groups.google.com/forum/#!topic/slurm-devel/QHOajQ84_Es @@ -92,59 +91,57 @@ stdenv.mkDerivation rec { python3 perl ]; - buildInputs = - [ - curl - python3 - munge - pam - libmysqlclient - ncurses - lz4 - rdma-core - lua - hwloc - numactl - readline - freeipmi - shadow.su - pmix - json_c - libjwt - libyaml - dbus - libbpf - http-parser - ] - ++ lib.optionals enableX11 [ xorg.xauth ] - ++ lib.optionals enableGtk2 [ gtk2 ] - ++ lib.optionals enableNVML [ - (runCommand "collect-nvml" { } '' - mkdir $out - ln -s ${nvml.dev}/include $out/include - ln -s ${nvml.lib}/lib/stubs $out/lib - '') - ]; + buildInputs = [ + curl + python3 + munge + pam + libmysqlclient + ncurses + lz4 + rdma-core + lua + hwloc + numactl + readline + freeipmi + shadow.su + pmix + json_c + libjwt + libyaml + dbus + libbpf + http-parser + ] + ++ lib.optionals enableX11 [ xorg.xauth ] + ++ lib.optionals enableGtk2 [ gtk2 ] + ++ lib.optionals enableNVML [ + (runCommand "collect-nvml" { } '' + mkdir $out + ln -s ${nvml.dev}/include $out/include + ln -s ${nvml.lib}/lib/stubs $out/lib + '') + ]; - configureFlags = - [ - "--with-freeipmi=${freeipmi}" - "--with-http-parser=${http-parser}" - "--with-hwloc=${lib.getDev hwloc}" - "--with-json=${lib.getDev json_c}" - "--with-jwt=${libjwt}" - "--with-lz4=${lib.getDev lz4}" - "--with-munge=${munge}" - "--with-yaml=${lib.getDev libyaml}" - "--with-ofed=${lib.getDev rdma-core}" - "--sysconfdir=/etc/slurm" - "--with-pmix=${lib.getDev pmix}" - "--with-bpf=${libbpf}" - "--without-rpath" # Required for configure to pick up the right dlopen path - ] - ++ (lib.optional enableGtk2 "--disable-gtktest") - ++ (lib.optional (!enableX11) "--disable-x11") - ++ (lib.optional (enableNVML) "--with-nvml"); + configureFlags = [ + "--with-freeipmi=${freeipmi}" + "--with-http-parser=${http-parser}" + "--with-hwloc=${lib.getDev hwloc}" + "--with-json=${lib.getDev json_c}" + "--with-jwt=${libjwt}" + "--with-lz4=${lib.getDev lz4}" + "--with-munge=${munge}" + "--with-yaml=${lib.getDev libyaml}" + "--with-ofed=${lib.getDev rdma-core}" + "--sysconfdir=/etc/slurm" + "--with-pmix=${lib.getDev pmix}" + "--with-bpf=${libbpf}" + "--without-rpath" # Required for configure to pick up the right dlopen path + ] + ++ (lib.optional enableGtk2 "--disable-gtktest") + ++ (lib.optional (!enableX11) "--disable-x11") + ++ (lib.optional (enableNVML) "--with-nvml"); preConfigure = '' patchShebangs ./doc/html/shtml2html.py diff --git a/pkgs/by-name/sl/slurp/package.nix b/pkgs/by-name/sl/slurp/package.nix index 103d5e741517..57015677ceb7 100644 --- a/pkgs/by-name/sl/slurp/package.nix +++ b/pkgs/by-name/sl/slurp/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { ninja pkg-config wayland-scanner - ] ++ lib.optional buildDocs scdoc; + ] + ++ lib.optional buildDocs scdoc; buildInputs = [ cairo diff --git a/pkgs/by-name/sm/sm64ex/package.nix b/pkgs/by-name/sm/sm64ex/package.nix index b71395284a21..b4d0dcc610b9 100644 --- a/pkgs/by-name/sm/sm64ex/package.nix +++ b/pkgs/by-name/sm/sm64ex/package.nix @@ -50,13 +50,12 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - makeFlags = - [ - "VERSION=${region}" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "OSX_BUILD=1" - ]; + makeFlags = [ + "VERSION=${region}" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "OSX_BUILD=1" + ]; preBuild = '' patchShebangs extract_assets.py diff --git a/pkgs/by-name/sm/smatch/package.nix b/pkgs/by-name/sm/smatch/package.nix index fe6514e15d92..159f8b285b42 100644 --- a/pkgs/by-name/sm/smatch/package.nix +++ b/pkgs/by-name/sm/smatch/package.nix @@ -31,13 +31,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkg-config ]; patches = [ ./remove_const.patch ]; - buildInputs = - [ - sqlite - openssl - ] - ++ lib.optionals buildllvmsparse [ libllvm ] - ++ lib.optionals buildc2xml [ libxml2.dev ]; + buildInputs = [ + sqlite + openssl + ] + ++ lib.optionals buildllvmsparse [ libllvm ] + ++ lib.optionals buildc2xml [ libxml2.dev ]; makeFlags = [ "PREFIX=${placeholder "out"}" diff --git a/pkgs/by-name/sm/smokeping/package.nix b/pkgs/by-name/sm/smokeping/package.nix index e2aa68d9b739..cc17ecae7ac6 100644 --- a/pkgs/by-name/sm/smokeping/package.nix +++ b/pkgs/by-name/sm/smokeping/package.nix @@ -26,24 +26,25 @@ stdenv.mkDerivation rec { }) ]; - propagatedBuildInputs = - [ rrdtool ] - ++ (with perlPackages; [ - perl - FCGI - CGI - CGIFast - ConfigGrammar - DigestHMAC - NetTelnet - NetOpenSSH - NetSNMP - LWP - IOTty - fping - NetDNS - perlldap - ]); + propagatedBuildInputs = [ + rrdtool + ] + ++ (with perlPackages; [ + perl + FCGI + CGI + CGIFast + ConfigGrammar + DigestHMAC + NetTelnet + NetOpenSSH + NetSNMP + LWP + IOTty + fping + NetDNS + perlldap + ]); nativeBuildInputs = [ autoreconfHook ]; diff --git a/pkgs/by-name/sm/smpeg/package.nix b/pkgs/by-name/sm/smpeg/package.nix index 32dc1cc52de3..10ef5b9574cf 100644 --- a/pkgs/by-name/sm/smpeg/package.nix +++ b/pkgs/by-name/sm/smpeg/package.nix @@ -59,13 +59,14 @@ stdenv.mkDerivation rec { makeWrapper ]; - buildInputs = - [ SDL ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - gtk2 - libGLU - libGL - ]; + buildInputs = [ + SDL + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + gtk2 + libGLU + libGL + ]; outputs = [ "out" diff --git a/pkgs/by-name/sm/smuview/package.nix b/pkgs/by-name/sm/smuview/package.nix index a63444f53815..3338e873b5bd 100644 --- a/pkgs/by-name/sm/smuview/package.nix +++ b/pkgs/by-name/sm/smuview/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation { cmake pkg-config qt5.wrapQtAppsHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; buildInputs = [ glib @@ -49,7 +50,8 @@ stdenv.mkDerivation { python3 pcre libsForQt5.qwt - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ bluez ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ bluez ]; meta = with lib; { description = "Qt based source measure unit GUI for sigrok"; diff --git a/pkgs/by-name/sm/smuxi/package.nix b/pkgs/by-name/sm/smuxi/package.nix index 019811234b3f..0d17f3e8b8a3 100644 --- a/pkgs/by-name/sm/smuxi/package.nix +++ b/pkgs/by-name/sm/smuxi/package.nix @@ -38,22 +38,21 @@ stdenv.mkDerivation rec { pkg-config makeWrapper ]; - buildInputs = - [ - autoconf - automake - itstool - intltool - gettext - mono - stfl - ] - ++ lib.optionals (guiSupport) [ - gtk-sharp-2_0 - # loaded at runtime by GTK# - gdk-pixbuf - pango - ]; + buildInputs = [ + autoconf + automake + itstool + intltool + gettext + mono + stfl + ] + ++ lib.optionals (guiSupport) [ + gtk-sharp-2_0 + # loaded at runtime by GTK# + gdk-pixbuf + pango + ]; preConfigure = '' NOCONFIGURE=1 NOGIT=1 ./autogen.sh @@ -62,7 +61,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-frontend-gnome" "--enable-frontend-stfl" - ] ++ lib.optional guiSupport "--enable-frontend-gnome"; + ] + ++ lib.optional guiSupport "--enable-frontend-gnome"; postInstall = '' makeWrapper "${mono}/bin/mono" "$out/bin/smuxi-message-buffer" \ diff --git a/pkgs/by-name/sn/sn0int/package.nix b/pkgs/by-name/sn/sn0int/package.nix index 52426cc9d075..4f6161b7d497 100644 --- a/pkgs/by-name/sn/sn0int/package.nix +++ b/pkgs/by-name/sn/sn0int/package.nix @@ -30,14 +30,13 @@ rustPlatform.buildRustPackage rec { installShellFiles ]; - buildInputs = - [ - libsodium - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libseccomp - ]; + buildInputs = [ + libsodium + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libseccomp + ]; # One of the dependencies (chrootable-https) tries to read "/etc/resolv.conf" # in "checkPhase", hence fails in sandbox of "nix". diff --git a/pkgs/by-name/sn/snakemake/package.nix b/pkgs/by-name/sn/snakemake/package.nix index 6d131c675c58..f1ae8a21a218 100644 --- a/pkgs/by-name/sn/snakemake/package.nix +++ b/pkgs/by-name/sn/snakemake/package.nix @@ -97,77 +97,76 @@ python3Packages.buildPythonApplication rec { "tests/test_api.py" ]; - disabledTests = - [ - # FAILED tests/tests.py::test_env_modules - AssertionError: expected successful execution - "test_ancient" - "test_conda_create_envs_only" - "test_env_modules" - "test_generate_unit_tests" - "test_modules_prefix" - "test_strict_mode" - # Requires perl - "test_shadow" - # Require peppy and eido - "test_peppy" - "test_modules_peppy" - "test_pep_pathlib" + disabledTests = [ + # FAILED tests/tests.py::test_env_modules - AssertionError: expected successful execution + "test_ancient" + "test_conda_create_envs_only" + "test_env_modules" + "test_generate_unit_tests" + "test_modules_prefix" + "test_strict_mode" + # Requires perl + "test_shadow" + # Require peppy and eido + "test_peppy" + "test_modules_peppy" + "test_pep_pathlib" - # CalledProcessError - "test_filegraph" # requires graphviz - "test_github_issue1384" + # CalledProcessError + "test_filegraph" # requires graphviz + "test_github_issue1384" - # AssertionError: assert 127 == 1 - "test_issue1256" - "test_issue2574" + # AssertionError: assert 127 == 1 + "test_issue1256" + "test_issue2574" - # Require `snakemake-storage-plugin-fs` (circular dependency) - "test_default_storage" - "test_default_storage_local_job" - "test_deploy_sources" - "test_output_file_cache_storage" - "test_storage" + # Require `snakemake-storage-plugin-fs` (circular dependency) + "test_default_storage" + "test_default_storage_local_job" + "test_deploy_sources" + "test_output_file_cache_storage" + "test_storage" - # Tries to access internet - "test_report_after_run" + # Tries to access internet + "test_report_after_run" - # Needs stress-ng - "test_benchmark" - "test_benchmark_jsonl" + # Needs stress-ng + "test_benchmark" + "test_benchmark_jsonl" - # Needs unshare - "test_nodelocal" + # Needs unshare + "test_nodelocal" - # Requires snakemake-storage-plugin-http - "test_keep_local" - "test_retrieve" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Unclear failure: - # AssertionError: expected successful execution - # `__darwinAllowLocalNetworking` doesn't help - "test_excluded_resources_not_submitted_to_cluster" - "test_group_job_resources_with_pipe" - "test_group_jobs_resources" - "test_group_jobs_resources_with_limited_resources" - "test_group_jobs_resources_with_max_threads" - "test_issue850" - "test_issue860" - "test_multicomp_group_jobs" - "test_queue_input" - "test_queue_input_dryrun" - "test_queue_input_forceall" - "test_resources_submitted_to_cluster" - "test_scopes_submitted_to_cluster" + # Requires snakemake-storage-plugin-http + "test_keep_local" + "test_retrieve" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Unclear failure: + # AssertionError: expected successful execution + # `__darwinAllowLocalNetworking` doesn't help + "test_excluded_resources_not_submitted_to_cluster" + "test_group_job_resources_with_pipe" + "test_group_jobs_resources" + "test_group_jobs_resources_with_limited_resources" + "test_group_jobs_resources_with_max_threads" + "test_issue850" + "test_issue860" + "test_multicomp_group_jobs" + "test_queue_input" + "test_queue_input_dryrun" + "test_queue_input_forceall" + "test_resources_submitted_to_cluster" + "test_scopes_submitted_to_cluster" - # Issue with /dev/stderr in sandbox - "test_protected_symlink_output" + # Issue with /dev/stderr in sandbox + "test_protected_symlink_output" - # Unclear issue: - # pulp.apis.core.PulpSolverError: Pulp: cannot execute cbc cwd: - # but pulp solver is not default - "test_access_patterns" - ]; + # Unclear issue: + # pulp.apis.core.PulpSolverError: Pulp: cannot execute cbc cwd: + # but pulp solver is not default + "test_access_patterns" + ]; pythonImportsCheck = [ "snakemake" ]; diff --git a/pkgs/by-name/sn/snapcraft/package.nix b/pkgs/by-name/sn/snapcraft/package.nix index 91053416956d..85f086fb699b 100644 --- a/pkgs/by-name/sn/snapcraft/package.nix +++ b/pkgs/by-name/sn/snapcraft/package.nix @@ -175,7 +175,8 @@ python312Packages.buildPythonApplication rec { "test_snap_command_fallback" "test_validate_architectures_supported" "test_validate_architectures_unsupported" - ] ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_load_project" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_load_project" ]; disabledTestPaths = [ "tests/unit/commands/test_remote.py" diff --git a/pkgs/by-name/sn/snd/package.nix b/pkgs/by-name/sn/snd/package.nix index 01607e8456c2..15c9252cd446 100644 --- a/pkgs/by-name/sn/snd/package.nix +++ b/pkgs/by-name/sn/snd/package.nix @@ -23,21 +23,20 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - fftw - gsl - motif - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ] - ++ (with xorg; [ - libXext - libXft - libXpm - libXt - ]); + buildInputs = [ + fftw + gsl + motif + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ] + ++ (with xorg; [ + libXext + libXft + libXpm + libXt + ]); configureFlags = [ "--with-motif" diff --git a/pkgs/by-name/sn/snes9x/package.nix b/pkgs/by-name/sn/snes9x/package.nix index 9baa9309c3eb..ce94e1acf870 100644 --- a/pkgs/by-name/sn/snes9x/package.nix +++ b/pkgs/by-name/sn/snes9x/package.nix @@ -42,44 +42,42 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-INMVyB3alwmsApO7ToAaUWgh7jlg2MeLxqHCEnUO88U="; }; - nativeBuildInputs = - [ - pkg-config - python3 - ] - ++ lib.optionals withGtk [ - cmake - ninja - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + pkg-config + python3 + ] + ++ lib.optionals withGtk [ + cmake + ninja + wrapGAppsHook3 + ]; - buildInputs = - [ - libX11 - libXv - minizip - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - pulseaudio - libselinux - util-linuxMinimal # provides libmount - ] - ++ lib.optionals (!withGtk) [ - libpng - libXext - libXinerama - ] - ++ lib.optionals withGtk [ - gtkmm3 - libepoxy - libXdmcp - libXrandr - pcre2 - portaudio - SDL2 - ]; + buildInputs = [ + libX11 + libXv + minizip + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + pulseaudio + libselinux + util-linuxMinimal # provides libmount + ] + ++ lib.optionals (!withGtk) [ + libpng + libXext + libXinerama + ] + ++ lib.optionals withGtk [ + gtkmm3 + libepoxy + libXdmcp + libXrandr + pcre2 + portaudio + SDL2 + ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/by-name/sn/sniffglue/package.nix b/pkgs/by-name/sn/sniffglue/package.nix index 459d2fb5f576..87f9b85dd8b7 100644 --- a/pkgs/by-name/sn/sniffglue/package.nix +++ b/pkgs/by-name/sn/sniffglue/package.nix @@ -24,13 +24,12 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libpcap - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libseccomp - ]; + buildInputs = [ + libpcap + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libseccomp + ]; meta = with lib; { description = "Secure multithreaded packet sniffer"; diff --git a/pkgs/by-name/sn/sniffnet/package.nix b/pkgs/by-name/sn/sniffnet/package.nix index 4a39c56cadc7..226f432aeaf4 100644 --- a/pkgs/by-name/sn/sniffnet/package.nix +++ b/pkgs/by-name/sn/sniffnet/package.nix @@ -31,24 +31,23 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libpcap - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - expat - fontconfig - vulkan-loader - xorg.libX11 - xorg.libXcursor - xorg.libXi - xorg.libXrandr - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - rustPlatform.bindgenHook - ]; + buildInputs = [ + libpcap + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + expat + fontconfig + vulkan-loader + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXrandr + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + rustPlatform.bindgenHook + ]; # requires internet access checkFlags = [ diff --git a/pkgs/by-name/sn/snobol4/package.nix b/pkgs/by-name/sn/snobol4/package.nix index f148ee5545c6..9af2ea6112c9 100644 --- a/pkgs/by-name/sn/snobol4/package.nix +++ b/pkgs/by-name/sn/snobol4/package.nix @@ -40,19 +40,18 @@ stdenv.mkDerivation rec { gzip ]; # enable all features (undocumented, based on manual review of configure script) - buildInputs = - [ - bzip2 - libffi - openssl - readline - sqlite - tcl - xz - zlib - ] - # ndbm compat library - ++ lib.optional stdenv.hostPlatform.isLinux gdbm; + buildInputs = [ + bzip2 + libffi + openssl + readline + sqlite + tcl + xz + zlib + ] + # ndbm compat library + ++ lib.optional stdenv.hostPlatform.isLinux gdbm; configureFlags = lib.optional (tcl != null) "--with-tcl=${tcl}/lib/tclConfig.sh"; # INSTALL says "parallel make will fail" diff --git a/pkgs/by-name/so/so/package.nix b/pkgs/by-name/so/so/package.nix index ad1150c4b03e..79cce36bc2b8 100644 --- a/pkgs/by-name/so/so/package.nix +++ b/pkgs/by-name/so/so/package.nix @@ -28,11 +28,12 @@ let nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; strictDeps = true; diff --git a/pkgs/by-name/so/soapyaudio/package.nix b/pkgs/by-name/so/soapyaudio/package.nix index ce2be6ec8a68..3d1951575142 100644 --- a/pkgs/by-name/so/soapyaudio/package.nix +++ b/pkgs/by-name/so/soapyaudio/package.nix @@ -28,18 +28,17 @@ stdenv.mkDerivation rec { cmake pkg-config ]; - buildInputs = - [ - hamlib - rtaudio - libjack2 - libusb1 - soapysdr - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libpulseaudio - ]; + buildInputs = [ + hamlib + rtaudio + libjack2 + libusb1 + soapysdr + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libpulseaudio + ]; cmakeFlags = [ "-DSoapySDR_DIR=${soapysdr}/share/cmake/SoapySDR/" diff --git a/pkgs/by-name/so/sockperf/package.nix b/pkgs/by-name/so/sockperf/package.nix index 7a1415d2e1f3..f9a77af542a3 100644 --- a/pkgs/by-name/so/sockperf/package.nix +++ b/pkgs/by-name/so/sockperf/package.nix @@ -24,10 +24,11 @@ stdenv.mkDerivation rec { doxygen ]; - configureFlags = - [ "--enable-doc" ] - ++ lib.optional enableTest "--enable-test" - ++ lib.optional enableTool "--enable-tool"; + configureFlags = [ + "--enable-doc" + ] + ++ lib.optional enableTest "--enable-test" + ++ lib.optional enableTool "--enable-tool"; doCheck = true; diff --git a/pkgs/by-name/so/sogo/package.nix b/pkgs/by-name/so/sogo/package.nix index 621c504aa56a..3958eb7ba4ff 100644 --- a/pkgs/by-name/so/sogo/package.nix +++ b/pkgs/by-name/so/sogo/package.nix @@ -52,7 +52,8 @@ clangStdenv.mkDerivation rec { openldap oath-toolkit libxcrypt - ] ++ lib.optional enableActiveSync libwbxml; + ] + ++ lib.optional enableActiveSync libwbxml; patches = lib.optional enableActiveSync ./enable-activesync.patch; diff --git a/pkgs/by-name/so/solana-cli/package.nix b/pkgs/by-name/so/solana-cli/package.nix index cf8a4471b41b..6247500776f3 100644 --- a/pkgs/by-name/so/solana-cli/package.nix +++ b/pkgs/by-name/so/solana-cli/package.nix @@ -12,29 +12,28 @@ nix-update-script, versionCheckHook, # Taken from https://github.com/solana-labs/solana/blob/master/scripts/cargo-install-all.sh#L84 - solanaPkgs ? - [ - "cargo-build-bpf" - "cargo-test-bpf" - "cargo-build-sbf" - "cargo-test-sbf" - "solana" - "solana-bench-tps" - "solana-faucet" - "solana-gossip" - "solana-install" - "solana-keygen" - "solana-ledger-tool" - "solana-log-analyzer" - "solana-net-shaper" - "solana-validator" - "solana-test-validator" - ] - ++ [ - # XXX: Ensure `solana-genesis` is built LAST! - # See https://github.com/solana-labs/solana/issues/5826 - "solana-genesis" - ], + solanaPkgs ? [ + "cargo-build-bpf" + "cargo-test-bpf" + "cargo-build-sbf" + "cargo-test-sbf" + "solana" + "solana-bench-tps" + "solana-faucet" + "solana-gossip" + "solana-install" + "solana-keygen" + "solana-ledger-tool" + "solana-log-analyzer" + "solana-net-shaper" + "solana-validator" + "solana-test-validator" + ] + ++ [ + # XXX: Ensure `solana-genesis` is built LAST! + # See https://github.com/solana-labs/solana/issues/5826 + "solana-genesis" + ], }: let version = "1.18.26"; @@ -85,7 +84,8 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl rustPlatform.bindgenHook - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ]; doInstallCheck = true; diff --git a/pkgs/by-name/so/solc/package.nix b/pkgs/by-name/so/solc/package.nix index 1138ebbd1e08..0edaea143d2a 100644 --- a/pkgs/by-name/so/solc/package.nix +++ b/pkgs/by-name/so/solc/package.nix @@ -75,34 +75,34 @@ let "BOOST_TEST(fabs" ''; - cmakeFlags = - [ - "-DBoost_USE_STATIC_LIBS=OFF" + cmakeFlags = [ + "-DBoost_USE_STATIC_LIBS=OFF" - ] - ++ ( - if z3Support then - [ - "-DSTRICT_Z3_VERSION=OFF" - ] - else - [ - "-DUSE_Z3=OFF" - ] - ) - ++ lib.optionals (!cvc4Support) [ - "-DUSE_CVC4=OFF" - ]; + ] + ++ ( + if z3Support then + [ + "-DSTRICT_Z3_VERSION=OFF" + ] + else + [ + "-DUSE_Z3=OFF" + ] + ) + ++ lib.optionals (!cvc4Support) [ + "-DUSE_CVC4=OFF" + ]; nativeBuildInputs = [ cmake ]; - buildInputs = - [ boost ] - ++ lib.optionals z3Support [ z3 ] - ++ lib.optionals cvc4Support [ - cvc4 - cln - gmp - ]; + buildInputs = [ + boost + ] + ++ lib.optionals z3Support [ z3 ] + ++ lib.optionals cvc4Support [ + cvc4 + cln + gmp + ]; nativeCheckInputs = [ jq ncurses diff --git a/pkgs/by-name/so/somo/package.nix b/pkgs/by-name/so/somo/package.nix index 245bec73a534..5cee1579ced7 100644 --- a/pkgs/by-name/so/somo/package.nix +++ b/pkgs/by-name/so/somo/package.nix @@ -21,14 +21,13 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-e3NrEfbWz6h9q4TJnn8jnRmMJbeaEc4Yo3hFlaRLzzQ="; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Avoids "couldn't find any valid shared libraries matching: ['libclang.dylib']" error on darwin in sandbox mode. - rustPlatform.bindgenHook - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Avoids "couldn't find any valid shared libraries matching: ['libclang.dylib']" error on darwin in sandbox mode. + rustPlatform.bindgenHook + ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd somo \ diff --git a/pkgs/by-name/so/sonic/package.nix b/pkgs/by-name/so/sonic/package.nix index 488224eb2724..b40c7b55a9dd 100644 --- a/pkgs/by-name/so/sonic/package.nix +++ b/pkgs/by-name/so/sonic/package.nix @@ -26,13 +26,12 @@ stdenv.mkDerivation { buildInputs = [ fftw ]; - postInstall = - '' - installManPage sonic.1 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -id $out/lib/libsonic.so.0.3.0 $out/lib/libsonic.so.0.3.0 - ''; + postInstall = '' + installManPage sonic.1 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -id $out/lib/libsonic.so.0.3.0 $out/lib/libsonic.so.0.3.0 + ''; meta = with lib; { description = "Simple library to speed up or slow down speech"; diff --git a/pkgs/by-name/so/sope/package.nix b/pkgs/by-name/so/sope/package.nix index daa21622c57d..5c7338976ff1 100644 --- a/pkgs/by-name/so/sope/package.nix +++ b/pkgs/by-name/so/sope/package.nix @@ -23,18 +23,17 @@ clangStdenv.mkDerivation rec { hash = "sha256-GeJ1o8Juw7jm3/pkfuMqVpfMxKewU6hQmBoPmb0HgTc="; }; - buildInputs = - [ - gnustep-base - libxml2 - openssl - ] - ++ lib.optional (openldap != null) openldap - ++ lib.optionals (mariadb != null) [ - libmysqlclient - mariadb - ] - ++ lib.optional (libpq != null) libpq; + buildInputs = [ + gnustep-base + libxml2 + openssl + ] + ++ lib.optional (openldap != null) openldap + ++ lib.optionals (mariadb != null) [ + libmysqlclient + mariadb + ] + ++ lib.optional (libpq != null) libpq; # Configure directories where files are installed to. Everything is automatically # put into $out (thanks GNUstep) apart from the makefiles location which is where @@ -48,16 +47,15 @@ clangStdenv.mkDerivation rec { EOF ''; - configureFlags = - [ - "--prefix=" - "--disable-debug" - "--enable-xml" - "--with-ssl=ssl" - ] - ++ lib.optional (openldap != null) "--enable-openldap" - ++ lib.optional (mariadb != null) "--enable-mysql" - ++ lib.optional (libpq != null) "--enable-postgresql"; + configureFlags = [ + "--prefix=" + "--disable-debug" + "--enable-xml" + "--with-ssl=ssl" + ] + ++ lib.optional (openldap != null) "--enable-openldap" + ++ lib.optional (mariadb != null) "--enable-mysql" + ++ lib.optional (libpq != null) "--enable-postgresql"; env = { GNUSTEP_CONFIG_FILE = "/build/GNUstep.conf"; diff --git a/pkgs/by-name/so/soundtracker/package.nix b/pkgs/by-name/so/soundtracker/package.nix index 4fb702a11eb2..373dd28ddd9a 100644 --- a/pkgs/by-name/so/soundtracker/package.nix +++ b/pkgs/by-name/so/soundtracker/package.nix @@ -40,13 +40,12 @@ stdenv.mkDerivation (finalAttrs: { sed -i -e '/seteuid/d' -e '/setegid/d' app/main.c ''; - configureFlags = - [ - "--with-graphics-backend=gdk" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--disable-alsa" - ]; + configureFlags = [ + "--with-graphics-backend=gdk" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--disable-alsa" + ]; enableParallelBuilding = true; @@ -63,7 +62,8 @@ stdenv.mkDerivation (finalAttrs: { goocanvas libxml2 libsndfile - ] ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib; + ] + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib; meta = with lib; { description = "Music tracking tool similar in design to the DOS program FastTracker and the Amiga legend ProTracker"; diff --git a/pkgs/by-name/so/soupault/package.nix b/pkgs/by-name/so/soupault/package.nix index 4038e0c79397..565138201335 100644 --- a/pkgs/by-name/so/soupault/package.nix +++ b/pkgs/by-name/so/soupault/package.nix @@ -24,11 +24,12 @@ ocamlPackages.buildDunePackage rec { hash = "sha256-yAkJgNwF763b2DFGA+4Ve+jafFxZbFDm3QxisDD6gYo="; }; - nativeBuildInputs = - [ removeReferencesTo ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - darwin.sigtool - ]; + nativeBuildInputs = [ + removeReferencesTo + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + darwin.sigtool + ]; buildInputs = with ocamlPackages; [ base64 diff --git a/pkgs/by-name/so/sourceHighlight/package.nix b/pkgs/by-name/so/sourceHighlight/package.nix index 16eaa9e42e6a..df0c538610f2 100644 --- a/pkgs/by-name/so/sourceHighlight/package.nix +++ b/pkgs/by-name/so/sourceHighlight/package.nix @@ -23,31 +23,30 @@ stdenv.mkDerivation rec { sha256 = "148w47k3zswbxvhg83z38ifi85f9dqcpg7icvvw1cm6bg21x4zrs"; }; - patches = - [ - # gcc-11 compat upstream patch - (fetchpatch { - url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4"; - hash = "sha256-h9DyD+pmlQT5dmKjWI9t0gCIYHe7pYkP55LnOqsE0vI="; - excludes = [ "ChangeLog" ]; - }) + patches = [ + # gcc-11 compat upstream patch + (fetchpatch { + url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4"; + hash = "sha256-h9DyD+pmlQT5dmKjWI9t0gCIYHe7pYkP55LnOqsE0vI="; + excludes = [ "ChangeLog" ]; + }) - # Upstream fix for clang-13 and gcc-12 test support - (fetchpatch { - name = "gcc-12.patch"; - url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9"; - hash = "sha256-wmSLgLnLuFE+IC6AjxzZp/HEnaOCS1VfY2cac0T7Y+w="; - }) - ] - ++ lib.optionals stdenv.cc.isClang [ - # Adds compatibility with C++17 by removing the `register` storage class specifier. - (fetchpatch { - name = "remove-register-keyword"; - url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=416b39758dba2c74515584514a959ad1b0ad50d1"; - hash = "sha256-R5A7IGHhU82EqceMCsuNBanhRz4dFVqiaH8637dr7jw="; - includes = [ "lib/*" ]; - }) - ]; + # Upstream fix for clang-13 and gcc-12 test support + (fetchpatch { + name = "gcc-12.patch"; + url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9"; + hash = "sha256-wmSLgLnLuFE+IC6AjxzZp/HEnaOCS1VfY2cac0T7Y+w="; + }) + ] + ++ lib.optionals stdenv.cc.isClang [ + # Adds compatibility with C++17 by removing the `register` storage class specifier. + (fetchpatch { + name = "remove-register-keyword"; + url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=416b39758dba2c74515584514a959ad1b0ad50d1"; + hash = "sha256-R5A7IGHhU82EqceMCsuNBanhRz4dFVqiaH8637dr7jw="; + includes = [ "lib/*" ]; + }) + ]; # source-highlight uses it's own binary to generate documentation. # During cross-compilation, that binary was built for the target @@ -60,13 +59,14 @@ stdenv.mkDerivation rec { # necessary to build on FreeBSD native pending inclusion of # https://git.savannah.gnu.org/cgit/config.git/commit/?id=e4786449e1c26716e3f9ea182caf472e4dbc96e0 nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; - buildInputs = - [ boost ] - ++ lib.optional (stdenv.targetPlatform.useLLVM or false) ( - llvmPackages.compiler-rt.override { - doFakeLibgcc = true; - } - ); + buildInputs = [ + boost + ] + ++ lib.optional (stdenv.targetPlatform.useLLVM or false) ( + llvmPackages.compiler-rt.override { + doFakeLibgcc = true; + } + ); configureFlags = [ "--with-boost=${boost.out}" diff --git a/pkgs/by-name/sp/spaceFM/package.nix b/pkgs/by-name/sp/spaceFM/package.nix index da44ad45380c..e7180c74a156 100644 --- a/pkgs/by-name/sp/spaceFM/package.nix +++ b/pkgs/by-name/sp/spaceFM/package.nix @@ -81,7 +81,8 @@ stdenv.mkDerivation rec { jmtpfs lsof udisks2 - ] ++ (lib.optionals ifuseSupport [ ifuse ]); + ] + ++ (lib.optionals ifuseSupport [ ifuse ]); # Introduced because ifuse doesn't build due to CVEs in libplist # Revert when libplist builds again… diff --git a/pkgs/by-name/sp/spade/package.nix b/pkgs/by-name/sp/spade/package.nix index 657976b3d2cb..2417db5f7606 100644 --- a/pkgs/by-name/sp/spade/package.nix +++ b/pkgs/by-name/sp/spade/package.nix @@ -55,7 +55,8 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ python312 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ python312 ]; env.NIX_CFLAGS_LINK = lib.optionalString stdenv.hostPlatform.isDarwin "-L${python312}/lib/python3.12/config-3.12-darwin -lpython3.12"; passthru.tests = { diff --git a/pkgs/by-name/sp/spatialite-gui/package.nix b/pkgs/by-name/sp/spatialite-gui/package.nix index b9c2bb58678f..88193e2cbe8f 100644 --- a/pkgs/by-name/sp/spatialite-gui/package.nix +++ b/pkgs/by-name/sp/spatialite-gui/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ libpq.pg_config pkg-config - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; buildInputs = [ curl diff --git a/pkgs/by-name/sp/speech-tools/package.nix b/pkgs/by-name/sp/speech-tools/package.nix index dfdfa5ee4985..262c2b406e3e 100644 --- a/pkgs/by-name/sp/speech-tools/package.nix +++ b/pkgs/by-name/sp/speech-tools/package.nix @@ -24,13 +24,12 @@ stdenv.mkDerivation rec { }) ]; - buildInputs = - [ - ncurses - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ]; + buildInputs = [ + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ]; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" diff --git a/pkgs/by-name/sp/speechd/package.nix b/pkgs/by-name/sp/speechd/package.nix index b4725c27ba3a..6155290c6ceb 100644 --- a/pkgs/by-name/sp/speechd/package.nix +++ b/pkgs/by-name/sp/speechd/package.nix @@ -46,20 +46,19 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-sUpSONKH0tzOTdQrvWbKZfoijn5oNwgmf3s0A297pLQ="; }; - patches = - [ - (replaceVars ./fix-paths.patch { - utillinux = util-linux; - # patch context - bindir = null; - }) - ] - ++ lib.optionals (withEspeak && espeak.mbrolaSupport) [ - # Replace FHS paths. - (replaceVars ./fix-mbrola-paths.patch { - inherit mbrola; - }) - ]; + patches = [ + (replaceVars ./fix-paths.patch { + utillinux = util-linux; + # patch context + bindir = null; + }) + ] + ++ lib.optionals (withEspeak && espeak.mbrolaSupport) [ + # Replace FHS paths. + (replaceVars ./fix-mbrola-paths.patch { + inherit mbrola; + }) + ]; nativeBuildInputs = [ pkg-config @@ -71,62 +70,60 @@ stdenv.mkDerivation (finalAttrs: { wrapPython ]; - buildInputs = - [ - glib - dotconf - libsndfile - libao - libpulseaudio - python - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - systemdMinimal # libsystemd - ] - ++ lib.optionals withAlsa [ - alsa-lib - ] - ++ lib.optionals withEspeak [ - espeak - sonic - pcaudiolib - ] - ++ lib.optionals withFlite [ - flite - ] - ++ lib.optionals withPico [ - svox - ]; + buildInputs = [ + glib + dotconf + libsndfile + libao + libpulseaudio + python + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + systemdMinimal # libsystemd + ] + ++ lib.optionals withAlsa [ + alsa-lib + ] + ++ lib.optionals withEspeak [ + espeak + sonic + pcaudiolib + ] + ++ lib.optionals withFlite [ + flite + ] + ++ lib.optionals withPico [ + svox + ]; pythonPath = [ pyxdg ]; - configureFlags = - [ - # Audio method falls back from left to right. - "--with-default-audio-method=\"libao,pulse,alsa,oss\"" - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" - ] - ++ lib.optionals withPulse [ - "--with-pulse" - ] - ++ lib.optionals withAlsa [ - "--with-alsa" - ] - ++ lib.optionals withLibao [ - "--with-libao" - ] - ++ lib.optionals withOss [ - "--with-oss" - ] - ++ lib.optionals withEspeak [ - "--with-espeak-ng" - ] - ++ lib.optionals withPico [ - "--with-pico" - ]; + configureFlags = [ + # Audio method falls back from left to right. + "--with-default-audio-method=\"libao,pulse,alsa,oss\"" + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user" + ] + ++ lib.optionals withPulse [ + "--with-pulse" + ] + ++ lib.optionals withAlsa [ + "--with-alsa" + ] + ++ lib.optionals withLibao [ + "--with-libao" + ] + ++ lib.optionals withOss [ + "--with-oss" + ] + ++ lib.optionals withEspeak [ + "--with-espeak-ng" + ] + ++ lib.optionals withPico [ + "--with-pico" + ]; postPatch = lib.optionalString withPico '' substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang" diff --git a/pkgs/by-name/sp/spfft/package.nix b/pkgs/by-name/sp/spfft/package.nix index a1b0279b080b..bc0618b78aa8 100644 --- a/pkgs/by-name/sp/spfft/package.nix +++ b/pkgs/by-name/sp/spfft/package.nix @@ -40,39 +40,38 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake gfortran - ] ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc; + ] + ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc; - buildInputs = - [ - fftw - mpi - ] - ++ lib.optionals (gpuBackend == "cuda") [ - cudaPackages.libcufft - cudaPackages.cuda_cudart - ] - ++ lib.optionals (gpuBackend == "rocm") [ - rocmPackages.clr - rocmPackages.rocfft - rocmPackages.hipfft - ] - ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; + buildInputs = [ + fftw + mpi + ] + ++ lib.optionals (gpuBackend == "cuda") [ + cudaPackages.libcufft + cudaPackages.cuda_cudart + ] + ++ lib.optionals (gpuBackend == "rocm") [ + rocmPackages.clr + rocmPackages.rocfft + rocmPackages.hipfft + ] + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; - cmakeFlags = - [ - "-DSPFFT_OMP=ON" - "-DSPFFT_MPI=ON" - "-DSPFFT_SINGLE_PRECISION=OFF" - "-DSPFFT_FORTRAN=ON" - # Required due to broken CMake files - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - ] - ++ lib.optional (gpuBackend == "cuda") "-DSPFFT_GPU_BACKEND=CUDA" - ++ lib.optionals (gpuBackend == "rocm") [ - "-DSPFFT_GPU_BACKEND=ROCM" - "-DHIP_ROOT_DIR=${rocmPackages.clr}" - ]; + cmakeFlags = [ + "-DSPFFT_OMP=ON" + "-DSPFFT_MPI=ON" + "-DSPFFT_SINGLE_PRECISION=OFF" + "-DSPFFT_FORTRAN=ON" + # Required due to broken CMake files + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ] + ++ lib.optional (gpuBackend == "cuda") "-DSPFFT_GPU_BACKEND=CUDA" + ++ lib.optionals (gpuBackend == "rocm") [ + "-DSPFFT_GPU_BACKEND=ROCM" + "-DHIP_ROOT_DIR=${rocmPackages.clr}" + ]; meta = with lib; { description = "Sparse 3D FFT library with MPI, OpenMP, CUDA and ROCm support"; diff --git a/pkgs/by-name/sp/sphinxsearch/package.nix b/pkgs/by-name/sp/sphinxsearch/package.nix index 6b60200ec4a1..395b07b76a32 100644 --- a/pkgs/by-name/sp/sphinxsearch/package.nix +++ b/pkgs/by-name/sp/sphinxsearch/package.nix @@ -20,14 +20,13 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - configureFlags = - [ - "--program-prefix=sphinxsearch-" - "--enable-id64" - ] - ++ lib.optionals (!enableMysql) [ - "--without-mysql" - ]; + configureFlags = [ + "--program-prefix=sphinxsearch-" + "--enable-id64" + ] + ++ lib.optionals (!enableMysql) [ + "--without-mysql" + ]; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/sp/spice-gtk/package.nix b/pkgs/by-name/sp/spice-gtk/package.nix index 5dc9fa557a6b..c1b17dc0ee05 100644 --- a/pkgs/by-name/sp/spice-gtk/package.nix +++ b/pkgs/by-name/sp/spice-gtk/package.nix @@ -82,97 +82,93 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - docbook_xsl - gettext - gobject-introspection - gtk-doc - meson - ninja - perl - pkg-config - python3 - python3.pkgs.pyparsing - python3.pkgs.six - vala - wrapGAppsHook3 - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - mesonEmulatorHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland-scanner - ]; + nativeBuildInputs = [ + docbook_xsl + gettext + gobject-introspection + gtk-doc + meson + ninja + perl + pkg-config + python3 + python3.pkgs.pyparsing + python3.pkgs.six + vala + wrapGAppsHook3 + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + mesonEmulatorHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland-scanner + ]; - buildInputs = - [ - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - cyrus_sasl - libepoxy - gtk3 - json-glib - libcacard - libjpeg_turbo - libopus - libsoup_3 - libusb1 - lz4 - openssl - phodav - pixman - spice-protocol - usbredir - vala - zlib - ] - ++ lib.optionals withPolkit [ - polkit - acl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap_ng - libdrm - wayland-protocols - ]; + buildInputs = [ + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + cyrus_sasl + libepoxy + gtk3 + json-glib + libcacard + libjpeg_turbo + libopus + libsoup_3 + libusb1 + lz4 + openssl + phodav + pixman + spice-protocol + usbredir + vala + zlib + ] + ++ lib.optionals withPolkit [ + polkit + acl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap_ng + libdrm + wayland-protocols + ]; PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions"; - mesonFlags = - [ - "-Dusb-acl-helper-dir=${placeholder "out"}/bin" - "-Dusb-ids-path=${hwdata}/share/hwdata/usb.ids" - ] - ++ lib.optionals (!withPolkit) [ - "-Dpolkit=disabled" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "-Dlibcap-ng=disabled" - "-Degl=disabled" - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - "-Dcoroutine=gthread" # Fixes "Function missing:makecontext" - ]; + mesonFlags = [ + "-Dusb-acl-helper-dir=${placeholder "out"}/bin" + "-Dusb-ids-path=${hwdata}/share/hwdata/usb.ids" + ] + ++ lib.optionals (!withPolkit) [ + "-Dpolkit=disabled" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "-Dlibcap-ng=disabled" + "-Degl=disabled" + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + "-Dcoroutine=gthread" # Fixes "Function missing:makecontext" + ]; - postPatch = - '' - # get rid of absolute path to helper in store so we can use a setuid wrapper - substituteInPlace src/usb-acl-helper.c \ - --replace-fail 'ACL_HELPER_PATH"/' '"' - # don't try to setcap/suid in a nix builder - substituteInPlace src/meson.build \ - --replace-fail "meson.add_install_script('../build-aux/setcap-or-suid'," \ - "# meson.add_install_script('../build-aux/setcap-or-suid'," + postPatch = '' + # get rid of absolute path to helper in store so we can use a setuid wrapper + substituteInPlace src/usb-acl-helper.c \ + --replace-fail 'ACL_HELPER_PATH"/' '"' + # don't try to setcap/suid in a nix builder + substituteInPlace src/meson.build \ + --replace-fail "meson.add_install_script('../build-aux/setcap-or-suid'," \ + "# meson.add_install_script('../build-aux/setcap-or-suid'," - patchShebangs subprojects/keycodemapdb/tools/keymap-gen - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # don't use version script and don't export symbols - substituteInPlace src/meson.build \ - --replace-fail "spice_gtk_version_script = [" "# spice_gtk_version_script = [" \ - --replace-fail ",--version-script=@0@'.format(spice_client_glib_syms_path)" "'" - ''; + patchShebangs subprojects/keycodemapdb/tools/keymap-gen + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # don't use version script and don't export symbols + substituteInPlace src/meson.build \ + --replace-fail "spice_gtk_version_script = [" "# spice_gtk_version_script = [" \ + --replace-fail ",--version-script=@0@'.format(spice_client_glib_syms_path)" "'" + ''; meta = with lib; { description = "GTK 3 SPICE widget"; diff --git a/pkgs/by-name/sp/spice/package.nix b/pkgs/by-name/sp/spice/package.nix index f70b1c85b0c3..0d9c3f1b8450 100644 --- a/pkgs/by-name/sp/spice/package.nix +++ b/pkgs/by-name/sp/spice/package.nix @@ -50,33 +50,32 @@ stdenv.mkDerivation rec { python3.pkgs.pyparsing ]; - buildInputs = - [ - cyrus_sasl - glib - gst_all_1.gst-plugins-base - libXext - libXfixes - libXinerama - libXrandr - libXrender - libcacard - libjpeg - libopus - lz4 - openssl - orc - pixman - python3.pkgs.pyparsing - spice-protocol - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gdk-pixbuf - ]; + buildInputs = [ + cyrus_sasl + glib + gst_all_1.gst-plugins-base + libXext + libXfixes + libXinerama + libXrandr + libXrender + libcacard + libjpeg + libopus + lz4 + openssl + orc + pixman + python3.pkgs.pyparsing + spice-protocol + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gdk-pixbuf + ]; env.NIX_CFLAGS_COMPILE = "-fno-stack-protector"; diff --git a/pkgs/by-name/sp/spider/package.nix b/pkgs/by-name/sp/spider/package.nix index b6761587d514..ac0c694b7c69 100644 --- a/pkgs/by-name/sp/spider/package.nix +++ b/pkgs/by-name/sp/spider/package.nix @@ -43,28 +43,27 @@ rustPlatform.buildRustPackage (finalAttrs: { ZSTD_SYS_USE_PKG_CONFIG = true; }; - checkFlags = - [ - # Sandbox limitation: no network or io_uring - "--skip=website::crawl" - "--skip=website::scrape" - "--skip=website::test_crawl_subdomains" - "--skip=website::test_crawl_tld" - "--skip=website::test_respect_robots_txt" - "--skip=page::parse_links" - "--skip=page::test_status_code" - "--skip=pdl_is_fresh" - "--skip=verify_revision_available" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Sandbox limitation: attempted to create a NULL object - "--skip=website::test_link_duplicates" - "--skip=website::not_crawl_blacklist" - "--skip=website::test_crawl_budget" - "--skip=website::test_crawl_subscription" - "--skip=website::Website::subscribe_guard" - "--skip=website::Website::subscribe" - ]; + checkFlags = [ + # Sandbox limitation: no network or io_uring + "--skip=website::crawl" + "--skip=website::scrape" + "--skip=website::test_crawl_subdomains" + "--skip=website::test_crawl_tld" + "--skip=website::test_respect_robots_txt" + "--skip=page::parse_links" + "--skip=page::test_status_code" + "--skip=pdl_is_fresh" + "--skip=verify_revision_available" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Sandbox limitation: attempted to create a NULL object + "--skip=website::test_link_duplicates" + "--skip=website::not_crawl_blacklist" + "--skip=website::test_crawl_budget" + "--skip=website::test_crawl_subscription" + "--skip=website::Website::subscribe_guard" + "--skip=website::Website::subscribe" + ]; doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; diff --git a/pkgs/by-name/sp/spirv-llvm-translator/package.nix b/pkgs/by-name/sp/spirv-llvm-translator/package.nix index 61da8d363a79..e90a2fa4bcf0 100644 --- a/pkgs/by-name/sp/spirv-llvm-translator/package.nix +++ b/pkgs/by-name/sp/spirv-llvm-translator/package.nix @@ -76,26 +76,27 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkg-config cmake - ] ++ (if isROCm then [ llvm ] else [ llvm.dev ]); + ] + ++ (if isROCm then [ llvm ] else [ llvm.dev ]); buildInputs = [ spirv-headers spirv-tools - ] ++ lib.optionals (!isROCm) [ llvm ]; + ] + ++ lib.optionals (!isROCm) [ llvm ]; nativeCheckInputs = [ lit ]; - cmakeFlags = - [ - "-DLLVM_INCLUDE_TESTS=ON" - "-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/ - "-DCMAKE_SKIP_BUILD_RPATH=ON" - "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${spirv-headers.src}" - ] - ++ lib.optional (llvmMajor == "19") "-DBASE_LLVM_VERSION=${lib.versions.majorMinor llvm.version}.0"; + cmakeFlags = [ + "-DLLVM_INCLUDE_TESTS=ON" + "-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/ + "-DCMAKE_SKIP_BUILD_RPATH=ON" + "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${spirv-headers.src}" + ] + ++ lib.optional (llvmMajor == "19") "-DBASE_LLVM_VERSION=${lib.versions.majorMinor llvm.version}.0"; # FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist doCheck = false; @@ -105,14 +106,13 @@ stdenv.mkDerivation { "llvm-spirv" ]; - postInstall = - '' - install -D tools/llvm-spirv/llvm-spirv $out/bin/llvm-spirv - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool $out/bin/llvm-spirv \ - -change @rpath/libLLVMSPIRVLib.dylib $out/lib/libLLVMSPIRVLib.dylib - ''; + postInstall = '' + install -D tools/llvm-spirv/llvm-spirv $out/bin/llvm-spirv + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool $out/bin/llvm-spirv \ + -change @rpath/libLLVMSPIRVLib.dylib $out/lib/libLLVMSPIRVLib.dylib + ''; passthru.tests = lib.genAttrs (lib.attrNames versions) ( version: pkgs.spirv-llvm-translator.override { llvm = pkgs."llvm_${version}"; } diff --git a/pkgs/by-name/sp/spla/package.nix b/pkgs/by-name/sp/spla/package.nix index ee203b200913..936ba7aff806 100644 --- a/pkgs/by-name/sp/spla/package.nix +++ b/pkgs/by-name/sp/spla/package.nix @@ -52,29 +52,27 @@ stdenv.mkDerivation rec { gfortran ]; - buildInputs = - [ - blas - mpi - ] - ++ lib.optional (gpuBackend == "cuda") cudaPackages.cudatoolkit - ++ lib.optionals (gpuBackend == "rocm") [ - rocmPackages.clr - rocmPackages.rocblas - ] - ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; + buildInputs = [ + blas + mpi + ] + ++ lib.optional (gpuBackend == "cuda") cudaPackages.cudatoolkit + ++ lib.optionals (gpuBackend == "rocm") [ + rocmPackages.clr + rocmPackages.rocblas + ] + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; - cmakeFlags = - [ - "-DSPLA_OMP=ON" - "-DSPLA_FORTRAN=ON" - "-DSPLA_INSTALL=ON" - # Required due to broken CMake files - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - ] - ++ lib.optional (gpuBackend == "cuda") "-DSPLA_GPU_BACKEND=CUDA" - ++ lib.optional (gpuBackend == "rocm") [ "-DSPLA_GPU_BACKEND=ROCM" ]; + cmakeFlags = [ + "-DSPLA_OMP=ON" + "-DSPLA_FORTRAN=ON" + "-DSPLA_INSTALL=ON" + # Required due to broken CMake files + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ] + ++ lib.optional (gpuBackend == "cuda") "-DSPLA_GPU_BACKEND=CUDA" + ++ lib.optional (gpuBackend == "rocm") [ "-DSPLA_GPU_BACKEND=ROCM" ]; preFixup = '' substituteInPlace $out/lib/cmake/SPLA/SPLASharedTargets-release.cmake \ diff --git a/pkgs/by-name/sp/spotify-player/package.nix b/pkgs/by-name/sp/spotify-player/package.nix index 6e35fd218e8d..007957353a20 100644 --- a/pkgs/by-name/sp/spotify-player/package.nix +++ b/pkgs/by-name/sp/spotify-player/package.nix @@ -61,42 +61,40 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-ec4rIYZsIvYIezDm956aYSM75e/GEoNilVjm40691Ys="; - nativeBuildInputs = - [ - pkg-config - cmake - rustPlatform.bindgenHook - installShellFiles - # Tries to access $HOME when installing shell files, and on Darwin - writableTmpDirAsHomeHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeBinaryWrapper - ]; + nativeBuildInputs = [ + pkg-config + cmake + rustPlatform.bindgenHook + installShellFiles + # Tries to access $HOME when installing shell files, and on Darwin + writableTmpDirAsHomeHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeBinaryWrapper + ]; - buildInputs = - [ - openssl - dbus - fontconfig - ] - ++ lib.optionals withSixel [ libsixel ] - ++ lib.optionals (withAudioBackend == "alsa") [ alsa-lib ] - ++ lib.optionals (withAudioBackend == "pulseaudio") [ libpulseaudio ] - ++ lib.optionals (withAudioBackend == "rodio" && stdenv.hostPlatform.isLinux) [ alsa-lib ] - ++ lib.optionals (withAudioBackend == "portaudio") [ portaudio ] - ++ lib.optionals (withAudioBackend == "jackaudio") [ libjack2 ] - ++ lib.optionals (withAudioBackend == "rodiojack") [ - alsa-lib - libjack2 - ] - ++ lib.optionals (withAudioBackend == "sdl") [ SDL2 ] - ++ lib.optionals (withAudioBackend == "gstreamer") [ - gst_all_1.gstreamer - gst_all_1.gst-devtools - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - ]; + buildInputs = [ + openssl + dbus + fontconfig + ] + ++ lib.optionals withSixel [ libsixel ] + ++ lib.optionals (withAudioBackend == "alsa") [ alsa-lib ] + ++ lib.optionals (withAudioBackend == "pulseaudio") [ libpulseaudio ] + ++ lib.optionals (withAudioBackend == "rodio" && stdenv.hostPlatform.isLinux) [ alsa-lib ] + ++ lib.optionals (withAudioBackend == "portaudio") [ portaudio ] + ++ lib.optionals (withAudioBackend == "jackaudio") [ libjack2 ] + ++ lib.optionals (withAudioBackend == "rodiojack") [ + alsa-lib + libjack2 + ] + ++ lib.optionals (withAudioBackend == "sdl") [ SDL2 ] + ++ lib.optionals (withAudioBackend == "gstreamer") [ + gst_all_1.gstreamer + gst_all_1.gst-devtools + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + ]; buildNoDefaultFeatures = true; diff --git a/pkgs/by-name/sp/spral/package.nix b/pkgs/by-name/sp/spral/package.nix index 885fe73d12d0..e549eda0e881 100644 --- a/pkgs/by-name/sp/spral/package.nix +++ b/pkgs/by-name/sp/spral/package.nix @@ -42,16 +42,15 @@ stdenv.mkDerivation (finalAttrs: { "spral_tests += [['ssids', 'ssidst', files('ssids.f90')]]" "" ''; - nativeBuildInputs = - [ - gfortran - meson - ninja - pkg-config - ] - ++ lib.optionals enableCuda [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + gfortran + meson + ninja + pkg-config + ] + ++ lib.optionals enableCuda [ + cudaPackages.cuda_nvcc + ]; propagatedBuildInputs = lib.optionals enableCuda [ cudaPackages.cuda_cudart @@ -63,7 +62,8 @@ stdenv.mkDerivation (finalAttrs: { (hwloc.override { inherit enableCuda; }) lapack metis - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]; mesonFlags = [ (lib.mesonBool "tests" true) ]; diff --git a/pkgs/by-name/sq/sqlite-vss/package.nix b/pkgs/by-name/sq/sqlite-vss/package.nix index c9b71996aceb..7c466c1af7d9 100644 --- a/pkgs/by-name/sq/sqlite-vss/package.nix +++ b/pkgs/by-name/sq/sqlite-vss/package.nix @@ -25,14 +25,13 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - nlohmann_json - faiss - sqlite - ] - ++ lib.optional stdenv.hostPlatform.isLinux gomp - ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; + buildInputs = [ + nlohmann_json + faiss + sqlite + ] + ++ lib.optional stdenv.hostPlatform.isLinux gomp + ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp; SQLITE_VSS_CMAKE_VERSION = finalAttrs.version; diff --git a/pkgs/by-name/sq/sqlitestudio/package.nix b/pkgs/by-name/sq/sqlitestudio/package.nix index 7131d99b8fd4..e8e7e6bf81a7 100644 --- a/pkgs/by-name/sq/sqlitestudio/package.nix +++ b/pkgs/by-name/sq/sqlitestudio/package.nix @@ -23,35 +23,34 @@ stdenv.mkDerivation rec { hash = "sha256-nGu1MYI3uaQ/3rc5LlixF6YEUU+pUsB6rn/yjFDGYf0="; }; - nativeBuildInputs = - [ copyDesktopItems ] - ++ (with libsForQt5.qt5; [ - qmake - qttools - wrapQtAppsHook - ]); + nativeBuildInputs = [ + copyDesktopItems + ] + ++ (with libsForQt5.qt5; [ + qmake + qttools + wrapQtAppsHook + ]); - buildInputs = - [ - readline - tcl - python3 - ] - ++ (with libsForQt5.qt5; [ - qtbase - qtsvg - qtdeclarative - qtscript - ]); + buildInputs = [ + readline + tcl + python3 + ] + ++ (with libsForQt5.qt5; [ + qtbase + qtsvg + qtdeclarative + qtscript + ]); - qmakeFlags = - [ - "./SQLiteStudio3" - "DEFINES+=NO_AUTO_UPDATES" - ] - ++ lib.optionals includeOfficialPlugins [ - "DEFINES+=PLUGINS_DIR=${sqlitestudio-plugins}/lib/sqlitestudio" - ]; + qmakeFlags = [ + "./SQLiteStudio3" + "DEFINES+=NO_AUTO_UPDATES" + ] + ++ lib.optionals includeOfficialPlugins [ + "DEFINES+=PLUGINS_DIR=${sqlitestudio-plugins}/lib/sqlitestudio" + ]; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/sq/sqsh/package.nix b/pkgs/by-name/sq/sqsh/package.nix index 42c2cf884ee5..564d554cbed5 100644 --- a/pkgs/by-name/sq/sqsh/package.nix +++ b/pkgs/by-name/sq/sqsh/package.nix @@ -21,13 +21,12 @@ stdenv.mkDerivation rec { sha256 = "1wi0hdmhk7l8nrz4j3kaa177mmxyklmzhj7sq1gj4q6fb8v1yr6n"; }; - preConfigure = - '' - export SYBASE=${freetds} - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure --replace "libct.so" "libct.dylib" - ''; + preConfigure = '' + export SYBASE=${freetds} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure --replace "libct.so" "libct.dylib" + ''; enableParallelBuilding = true; diff --git a/pkgs/by-name/sq/squashfsTools/package.nix b/pkgs/by-name/sq/squashfsTools/package.nix index 8629b8f53943..870d0ad79d29 100644 --- a/pkgs/by-name/sq/squashfsTools/package.nix +++ b/pkgs/by-name/sq/squashfsTools/package.nix @@ -30,10 +30,11 @@ stdenv.mkDerivation rec { ]; strictDeps = true; - nativeBuildInputs = - [ which ] - # when cross-compiling help2man cannot run the cross-compiled binary - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ help2man ]; + nativeBuildInputs = [ + which + ] + # when cross-compiling help2man cannot run the cross-compiled binary + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ help2man ]; buildInputs = [ zlib xz diff --git a/pkgs/by-name/sq/squeezelite/package.nix b/pkgs/by-name/sq/squeezelite/package.nix index c2a6f68ac004..08d036e30081 100644 --- a/pkgs/by-name/sq/squeezelite/package.nix +++ b/pkgs/by-name/sq/squeezelite/package.nix @@ -48,23 +48,22 @@ stdenv.mkDerivation { hash = "sha256-1uzkf7vkzfHdsWvWcXnUv279kgtzrHLU0hAPaTKRWI8="; }; - buildInputs = - [ - flac - libmad - libvorbis - mpg123 - ] - ++ optional pulseSupport libpulseaudio - ++ optional alsaSupport alsa-lib - ++ optional portaudioSupport portaudio + buildInputs = [ + flac + libmad + libvorbis + mpg123 + ] + ++ optional pulseSupport libpulseaudio + ++ optional alsaSupport alsa-lib + ++ optional portaudioSupport portaudio - ++ optional faad2Support faad2 - ++ optional ffmpegSupport ffmpeg - ++ optional opusSupport opusfile - ++ optional resampleSupport soxr - ++ optional sslSupport openssl - ++ optional (stdenv.hostPlatform.isAarch32 or stdenv.hostPlatform.isAarch64) libgpiod; + ++ optional faad2Support faad2 + ++ optional ffmpegSupport ffmpeg + ++ optional opusSupport opusfile + ++ optional resampleSupport soxr + ++ optional sslSupport openssl + ++ optional (stdenv.hostPlatform.isAarch32 or stdenv.hostPlatform.isAarch64) libgpiod; enableParallelBuilding = true; @@ -75,20 +74,19 @@ stdenv.mkDerivation { EXECUTABLE = binName; - OPTS = - [ - "-DLINKALL" - "-DGPIO" - ] - ++ optional dsdSupport "-DDSD" - ++ optional (!faad2Support) "-DNO_FAAD" - ++ optional ffmpegSupport "-DFFMPEG" - ++ optional opusSupport "-DOPUS" - ++ optional portaudioSupport "-DPORTAUDIO" - ++ optional pulseSupport "-DPULSEAUDIO" - ++ optional resampleSupport "-DRESAMPLE" - ++ optional sslSupport "-DUSE_SSL" - ++ optional (stdenv.hostPlatform.isAarch32 or stdenv.hostPlatform.isAarch64) "-DRPI"; + OPTS = [ + "-DLINKALL" + "-DGPIO" + ] + ++ optional dsdSupport "-DDSD" + ++ optional (!faad2Support) "-DNO_FAAD" + ++ optional ffmpegSupport "-DFFMPEG" + ++ optional opusSupport "-DOPUS" + ++ optional portaudioSupport "-DPORTAUDIO" + ++ optional pulseSupport "-DPULSEAUDIO" + ++ optional resampleSupport "-DRESAMPLE" + ++ optional sslSupport "-DUSE_SSL" + ++ optional (stdenv.hostPlatform.isAarch32 or stdenv.hostPlatform.isAarch64) "-DRPI"; env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { LDADD = "-lportaudio -lpthread"; }; diff --git a/pkgs/by-name/sq/squid/package.nix b/pkgs/by-name/sq/squid/package.nix index 2ceb16f34194..e7d3c325e1ac 100644 --- a/pkgs/by-name/sq/squid/package.nix +++ b/pkgs/by-name/sq/squid/package.nix @@ -30,40 +30,38 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - perl - openldap - db - cyrus_sasl - expat - libxml2 - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - pam - systemd - ]; + buildInputs = [ + perl + openldap + db + cyrus_sasl + expat + libxml2 + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + pam + systemd + ]; enableParallelBuilding = true; - configureFlags = - [ - "--disable-strict-error-checking" - "--disable-arch-native" - "--with-openssl" - "--enable-ssl-crtd" - "--enable-storeio=ufs,aufs,diskd,rock" - "--enable-removal-policies=lru,heap" - "--enable-delay-pools" - "--enable-x-accelerator-vary" - "--enable-htcp" - ] - ++ (if ipv6 then [ "--enable-ipv6" ] else [ "--disable-ipv6" ]) - ++ lib.optional ( - stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl - ) "--enable-linux-netfilter"; + configureFlags = [ + "--disable-strict-error-checking" + "--disable-arch-native" + "--with-openssl" + "--enable-ssl-crtd" + "--enable-storeio=ufs,aufs,diskd,rock" + "--enable-removal-policies=lru,heap" + "--enable-delay-pools" + "--enable-x-accelerator-vary" + "--enable-htcp" + ] + ++ (if ipv6 then [ "--enable-ipv6" ] else [ "--disable-ipv6" ]) + ++ lib.optional ( + stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl + ) "--enable-linux-netfilter"; doCheck = true; nativeCheckInputs = [ cppunit ]; diff --git a/pkgs/by-name/sq/squirreldisk/package.nix b/pkgs/by-name/sq/squirreldisk/package.nix index 0add3e328ff3..fd7dcf37cbbc 100644 --- a/pkgs/by-name/sq/squirreldisk/package.nix +++ b/pkgs/by-name/sq/squirreldisk/package.nix @@ -64,19 +64,18 @@ rustPlatform.buildRustPackage rec { cp ${parallel-disk-usage}/bin/pdu src-tauri/bin/pdu-${stdenv.hostPlatform.rust.rustcTarget} ''; - nativeBuildInputs = - [ - cargo-tauri_1.hook - npmHooks.npmConfigHook - nodejs - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeBinaryWrapper - ]; + nativeBuildInputs = [ + cargo-tauri_1.hook + npmHooks.npmConfigHook + nodejs + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeBinaryWrapper + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ dbus diff --git a/pkgs/by-name/sr/srt/package.nix b/pkgs/by-name/sr/srt/package.nix index 6dfb61849ad6..d703a325da27 100644 --- a/pkgs/by-name/sr/srt/package.nix +++ b/pkgs/by-name/sr/srt/package.nix @@ -20,13 +20,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isMinGW [ - windows.mingw_w64_pthreads - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isMinGW [ + windows.mingw_w64_pthreads + ]; patches = lib.optionals stdenv.hostPlatform.isMinGW [ ./no-msvc-compat-headers.patch diff --git a/pkgs/by-name/ss/sshfs-fuse/common.nix b/pkgs/by-name/ss/sshfs-fuse/common.nix index e5a89b6eda86..2c27ab48e5f6 100644 --- a/pkgs/by-name/ss/sshfs-fuse/common.nix +++ b/pkgs/by-name/ss/sshfs-fuse/common.nix @@ -58,14 +58,13 @@ stdenv.mkDerivation rec { stdenv.hostPlatform.system == "i686-linux" ) "-D_FILE_OFFSET_BITS=64"; - postInstall = - '' - mkdir -p $out/sbin - ln -sf $out/bin/sshfs $out/sbin/mount.sshfs - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - wrapProgram $out/bin/sshfs --prefix PATH : "${openssh}/bin" - ''; + postInstall = '' + mkdir -p $out/sbin + ln -sf $out/bin/sshfs $out/sbin/mount.sshfs + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + wrapProgram $out/bin/sshfs --prefix PATH : "${openssh}/bin" + ''; # doCheck = true; checkPhase = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' diff --git a/pkgs/by-name/ss/sslh/package.nix b/pkgs/by-name/ss/sslh/package.nix index 9ec5ecf2b212..451749ae8745 100644 --- a/pkgs/by-name/ss/sslh/package.nix +++ b/pkgs/by-name/ss/sslh/package.nix @@ -24,17 +24,16 @@ stdenv.mkDerivation rec { postPatch = "patchShebangs *.sh"; - buildInputs = - [ - libev - libconfig - perl - pcre2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - tcp_wrappers - ]; + buildInputs = [ + libev + libconfig + perl + pcre2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + tcp_wrappers + ]; makeFlags = lib.optionals stdenv.hostPlatform.isLinux [ "USELIBCAP=1" diff --git a/pkgs/by-name/st/st/package.nix b/pkgs/by-name/st/st/package.nix index c9ce15bbca56..5102bbc5a884 100644 --- a/pkgs/by-name/st/st/package.nix +++ b/pkgs/by-name/st/st/package.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libX11 libXft - ] ++ extraLibs; + ] + ++ extraLibs; preInstall = '' export TERMINFO=$terminfo/share/terminfo diff --git a/pkgs/by-name/st/stalwart-mail/package.nix b/pkgs/by-name/st/stalwart-mail/package.nix index 8af1fadd963a..e62c70ae2e2c 100644 --- a/pkgs/by-name/st/stalwart-mail/package.nix +++ b/pkgs/by-name/st/stalwart-mail/package.nix @@ -43,22 +43,22 @@ rustPlatform.buildRustPackage (finalAttrs: { openssl sqlite zstd - ] ++ lib.optionals (stdenv.hostPlatform.isLinux && withFoundationdb) [ foundationdb ]; + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && withFoundationdb) [ foundationdb ]; # Issue: https://github.com/stalwartlabs/stalwart/issues/1104 buildNoDefaultFeatures = true; - buildFeatures = - [ - "sqlite" - "postgres" - "mysql" - "rocks" - "elastic" - "s3" - "redis" - ] - ++ lib.optionals withFoundationdb [ "foundationdb" ] - ++ lib.optionals stalwartEnterprise [ "enterprise" ]; + buildFeatures = [ + "sqlite" + "postgres" + "mysql" + "rocks" + "elastic" + "s3" + "redis" + ] + ++ lib.optionals withFoundationdb [ "foundationdb" ] + ++ lib.optionals stalwartEnterprise [ "enterprise" ]; env = { OPENSSL_NO_VENDOR = true; @@ -171,16 +171,17 @@ rustPlatform.buildRustPackage (finalAttrs: { description = "Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP)"; homepage = "https://github.com/stalwartlabs/mail-server"; changelog = "https://github.com/stalwartlabs/mail-server/blob/main/CHANGELOG.md"; - license = - [ lib.licenses.agpl3Only ] - ++ lib.optionals stalwartEnterprise [ - { - fullName = "Stalwart Enterprise License 1.0 (SELv1) Agreement"; - url = "https://github.com/stalwartlabs/mail-server/blob/main/LICENSES/LicenseRef-SEL.txt"; - free = false; - redistributable = false; - } - ]; + license = [ + lib.licenses.agpl3Only + ] + ++ lib.optionals stalwartEnterprise [ + { + fullName = "Stalwart Enterprise License 1.0 (SELv1) Agreement"; + url = "https://github.com/stalwartlabs/mail-server/blob/main/LICENSES/LicenseRef-SEL.txt"; + free = false; + redistributable = false; + } + ]; mainProgram = "stalwart"; maintainers = with lib.maintainers; [ diff --git a/pkgs/by-name/st/starfetch/package.nix b/pkgs/by-name/st/starfetch/package.nix index 34694aa95136..3abcb42bc0d2 100644 --- a/pkgs/by-name/st/starfetch/package.nix +++ b/pkgs/by-name/st/starfetch/package.nix @@ -15,13 +15,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-I2M/FlLRkGtD2+GcK1l5+vFsb5tCb4T3UJTPxRx68Ww="; }; - postPatch = - '' - substituteInPlace src/starfetch.cpp --replace /usr/local/ $out/ - '' - + lib.optionalString stdenv.cc.isClang '' - substituteInPlace makefile --replace g++ clang++ - ''; + postPatch = '' + substituteInPlace src/starfetch.cpp --replace /usr/local/ $out/ + '' + + lib.optionalString stdenv.cc.isClang '' + substituteInPlace makefile --replace g++ clang++ + ''; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/st/starship/package.nix b/pkgs/by-name/st/starship/package.nix index 404816b79a83..350cebac6810 100644 --- a/pkgs/by-name/st/starship/package.nix +++ b/pkgs/by-name/st/starship/package.nix @@ -27,23 +27,22 @@ rustPlatform.buildRustPackage (finalAttrs: { writableTmpDirAsHomeHook ]; - postInstall = + postInstall = '' + presetdir=$out/share/starship/presets/ + mkdir -p $presetdir + cp docs/public/presets/toml/*.toml $presetdir + '' + + lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( + let + emulator = stdenv.hostPlatform.emulator buildPackages; + in '' - presetdir=$out/share/starship/presets/ - mkdir -p $presetdir - cp docs/public/presets/toml/*.toml $presetdir + installShellCompletion --cmd starship \ + --bash <(${emulator} $out/bin/starship completions bash) \ + --fish <(${emulator} $out/bin/starship completions fish) \ + --zsh <(${emulator} $out/bin/starship completions zsh) '' - + lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( - let - emulator = stdenv.hostPlatform.emulator buildPackages; - in - '' - installShellCompletion --cmd starship \ - --bash <(${emulator} $out/bin/starship completions bash) \ - --fish <(${emulator} $out/bin/starship completions fish) \ - --zsh <(${emulator} $out/bin/starship completions zsh) - '' - ); + ); useFetchCargoVendor = true; cargoHash = "sha256-cxDWaPlNK7POJ3GhA21NlJ6q62bqHdA/4sru5pLkvOA="; diff --git a/pkgs/by-name/st/steam/package.nix b/pkgs/by-name/st/steam/package.nix index 7d7a18405606..57af5f00af64 100644 --- a/pkgs/by-name/st/steam/package.nix +++ b/pkgs/by-name/st/steam/package.nix @@ -133,7 +133,8 @@ let extraBwrapArgs = [ # Steam will dump crash reports here, make those more accessible "--bind-try /tmp/dumps /tmp/dumps" - ] ++ extraBwrapArgs; + ] + ++ extraBwrapArgs; }; in steamEnv { diff --git a/pkgs/by-name/st/steel/package.nix b/pkgs/by-name/st/steel/package.nix index b6c4f1f7c257..3056954979db 100644 --- a/pkgs/by-name/st/steel/package.nix +++ b/pkgs/by-name/st/steel/package.nix @@ -52,45 +52,43 @@ rustPlatform.buildRustPackage { rm .cargo/config.toml ''; - cargoBuildFlags = - [ - "--package" - "steel-interpreter" - "--package" - "cargo-steel-lib" - ] - ++ lib.optionals includeLSP [ - "--package" - "steel-language-server" - ] - ++ lib.optionals includeForge [ - "--package" - "forge" - ]; + cargoBuildFlags = [ + "--package" + "steel-interpreter" + "--package" + "cargo-steel-lib" + ] + ++ lib.optionals includeLSP [ + "--package" + "steel-language-server" + ] + ++ lib.optionals includeForge [ + "--package" + "forge" + ]; # Tests are disabled since they always fail when building with Nix doCheck = false; - postInstall = - '' - mkdir -p $out/lib/steel + postInstall = '' + mkdir -p $out/lib/steel - substituteInPlace cogs/installer/download.scm \ - --replace-fail '"cargo-steel-lib"' '"$out/bin/cargo-steel-lib"' + substituteInPlace cogs/installer/download.scm \ + --replace-fail '"cargo-steel-lib"' '"$out/bin/cargo-steel-lib"' - pushd cogs - $out/bin/steel install.scm - popd + pushd cogs + $out/bin/steel install.scm + popd - mv $out/lib/steel/bin/repl-connect $out/bin - rm -rf $out/lib/steel/bin - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd steel \ - --bash <($out/bin/steel completions bash) \ - --fish <($out/bin/steel completions fish) \ - --zsh <($out/bin/steel completions zsh) - ''; + mv $out/lib/steel/bin/repl-connect $out/bin + rm -rf $out/lib/steel/bin + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd steel \ + --bash <($out/bin/steel completions bash) \ + --fish <($out/bin/steel completions fish) \ + --zsh <($out/bin/steel completions zsh) + ''; postFixup = '' wrapProgram $out/bin/steel --set-default STEEL_HOME "$out/lib/steel" diff --git a/pkgs/by-name/st/stfl/package.nix b/pkgs/by-name/st/stfl/package.nix index 44d6b12884a6..ef8e8b5b191a 100644 --- a/pkgs/by-name/st/stfl/package.nix +++ b/pkgs/by-name/st/stfl/package.nix @@ -33,32 +33,30 @@ stdenv.mkDerivation { NIX_LDFLAGS = "-liconv"; }; - preBuild = - '' - sed -i s/gcc/cc/g Makefile - sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - sed -i s/-soname/-install_name/ Makefile - '' - # upstream builds shared library unconditionally. Also, it has no - # support for cross-compilation. - + lib.optionalString stdenv.hostPlatform.isStatic '' - sed -i 's/all:.*/all: libstfl.a stfl.pc/' Makefile - sed -i 's/\tar /\t${stdenv.cc.targetPrefix}ar /' Makefile - sed -i 's/\tranlib /\t${stdenv.cc.targetPrefix}ranlib /' Makefile - sed -i '/install -m 644 libstfl.so./d' Makefile - sed -i '/ln -fs libstfl.so./d' Makefile - ''; + preBuild = '' + sed -i s/gcc/cc/g Makefile + sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + sed -i s/-soname/-install_name/ Makefile + '' + # upstream builds shared library unconditionally. Also, it has no + # support for cross-compilation. + + lib.optionalString stdenv.hostPlatform.isStatic '' + sed -i 's/all:.*/all: libstfl.a stfl.pc/' Makefile + sed -i 's/\tar /\t${stdenv.cc.targetPrefix}ar /' Makefile + sed -i 's/\tranlib /\t${stdenv.cc.targetPrefix}ranlib /' Makefile + sed -i '/install -m 644 libstfl.so./d' Makefile + sed -i '/ln -fs libstfl.so./d' Makefile + ''; - installPhase = - '' - DESTDIR=$out prefix=\"\" make install - '' - # some programs rely on libstfl.so.0 to be present, so link it - + lib.optionalString (!stdenv.hostPlatform.isStatic) '' - ln -s $out/lib/libstfl.so.0.24 $out/lib/libstfl.so.0 - ''; + installPhase = '' + DESTDIR=$out prefix=\"\" make install + '' + # some programs rely on libstfl.so.0 to be present, so link it + + lib.optionalString (!stdenv.hostPlatform.isStatic) '' + ln -s $out/lib/libstfl.so.0.24 $out/lib/libstfl.so.0 + ''; meta = { homepage = "https://web.archive.org/web/20211113222004/http://www.clifford.at/stfl/"; diff --git a/pkgs/by-name/st/stgit/package.nix b/pkgs/by-name/st/stgit/package.nix index 39046668c0c8..52ba75b05351 100644 --- a/pkgs/by-name/st/stgit/package.nix +++ b/pkgs/by-name/st/stgit/package.nix @@ -42,15 +42,14 @@ rustPlatform.buildRustPackage rec { ]; buildInputs = [ curl ]; - nativeCheckInputs = - [ - git - perl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.system_cmds - libiconv - ]; + nativeCheckInputs = [ + git + perl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.system_cmds + libiconv + ]; postPatch = '' for f in Documentation/*.xsl; do diff --git a/pkgs/by-name/st/stlink/package.nix b/pkgs/by-name/st/stlink/package.nix index c9ae3cee563d..a02ae13a68f0 100644 --- a/pkgs/by-name/st/stlink/package.nix +++ b/pkgs/by-name/st/stlink/package.nix @@ -40,21 +40,19 @@ stdenv.mkDerivation rec { }) ]; - buildInputs = - [ - libusb1' - ] - ++ lib.optionals withGUI [ - gtk3 - ]; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals withGUI [ - pkg-config - wrapGAppsHook3 - ]; + buildInputs = [ + libusb1' + ] + ++ lib.optionals withGUI [ + gtk3 + ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals withGUI [ + pkg-config + wrapGAppsHook3 + ]; doInstallCheck = true; diff --git a/pkgs/by-name/st/stp/package.nix b/pkgs/by-name/st/stp/package.nix index 65d8b52fb271..f6b63167cbd8 100644 --- a/pkgs/by-name/st/stp/package.nix +++ b/pkgs/by-name/st/stp/package.nix @@ -40,28 +40,27 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-guFgeWOrxRrxkU7kMvd5+nmML0rwLYW196m1usE2qiA="; }) ]; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail GIT-hash-notfound "$version" + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail GIT-hash-notfound "$version" - # We want to use the Nix wrapper for the output check tool instead of running it through Python. - substituteInPlace tests/query-files/lit.cfg \ - --replace-fail "pythonExec + ' ' +OutputCheckTool" "OutputCheckTool" + # We want to use the Nix wrapper for the output check tool instead of running it through Python. + substituteInPlace tests/query-files/lit.cfg \ + --replace-fail "pythonExec + ' ' +OutputCheckTool" "OutputCheckTool" - # Results in duplication of Nix store paths and trouble finding the Python library at runtime - substituteInPlace bindings/python/stp/library_path.py.in_install \ - --replace-fail "@CMAKE_INSTALL_PREFIX@/" "" - '' - + lib.optionalString useCadical '' - # Fix up Cadical paths. - substituteInPlace include/stp/Sat/Cadical.h \ - --replace-fail "src/cadical.hpp" "cadical.hpp" + # Results in duplication of Nix store paths and trouble finding the Python library at runtime + substituteInPlace bindings/python/stp/library_path.py.in_install \ + --replace-fail "@CMAKE_INSTALL_PREFIX@/" "" + '' + + lib.optionalString useCadical '' + # Fix up Cadical paths. + substituteInPlace include/stp/Sat/Cadical.h \ + --replace-fail "src/cadical.hpp" "cadical.hpp" - substituteInPlace CMakeLists.txt \ - --replace-fail "build/libcadical.a" "lib/libcadical.a" \ - --replace-fail 'include_directories(''${CADICAL_DIR}/)' 'include_directories(''${CADICAL_DIR}/include)' - ''; + substituteInPlace CMakeLists.txt \ + --replace-fail "build/libcadical.a" "lib/libcadical.a" \ + --replace-fail 'include_directories(''${CADICAL_DIR}/)' 'include_directories(''${CADICAL_DIR}/include)' + ''; buildInputs = [ boost @@ -69,7 +68,8 @@ stdenv.mkDerivation (finalAttrs: { python3 gmp minisat - ] ++ lib.optional (!useCadical) cryptominisat; + ] + ++ lib.optional (!useCadical) cryptominisat; nativeBuildInputs = [ cmake @@ -116,20 +116,19 @@ stdenv.mkDerivation (finalAttrs: { "out" ]; - preConfigure = - '' - python_install_dir=$out/${python3.sitePackages} - mkdir -p $python_install_dir - cmakeFlagsArray+=( - "-DPYTHON_LIB_INSTALL_DIR=$python_install_dir" - ) - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - # Link in gtest and the output check utility. - mkdir -p deps - ln -s ${gtest.src} deps/gtest - ln -s ${outputcheck} deps/OutputCheck - ''; + preConfigure = '' + python_install_dir=$out/${python3.sitePackages} + mkdir -p $python_install_dir + cmakeFlagsArray+=( + "-DPYTHON_LIB_INSTALL_DIR=$python_install_dir" + ) + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + # Link in gtest and the output check utility. + mkdir -p deps + ln -s ${gtest.src} deps/gtest + ln -s ${outputcheck} deps/OutputCheck + ''; nativeCheckInputs = [ gtest diff --git a/pkgs/by-name/st/strace/package.nix b/pkgs/by-name/st/strace/package.nix index f8b521af0d57..42ce3aecae21 100644 --- a/pkgs/by-name/st/strace/package.nix +++ b/pkgs/by-name/st/strace/package.nix @@ -33,14 +33,16 @@ stdenv.mkDerivation rec { # libunwind for -k. # On RISC-V platforms, LLVM's libunwind implementation is unsupported by strace. # The build will silently fall back and -k will not work on RISC-V. - buildInputs = - [ libunwind ] - # -kk - ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform elfutils) elfutils; + buildInputs = [ + libunwind + ] + # -kk + ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform elfutils) elfutils; configureFlags = [ "--enable-mpers=check" - ] ++ lib.optional stdenv.cc.isClang "CFLAGS=-Wno-unused-function"; + ] + ++ lib.optional stdenv.cc.isClang "CFLAGS=-Wno-unused-function"; passthru.updateScript = gitUpdater { # No nicer place to find latest release. diff --git a/pkgs/by-name/st/strawberry/package.nix b/pkgs/by-name/st/strawberry/package.nix index 36add206b79c..e6dc0d4ff71a 100644 --- a/pkgs/by-name/st/strawberry/package.nix +++ b/pkgs/by-name/st/strawberry/package.nix @@ -50,54 +50,52 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail pictures/strawberry.png pictures/strawberry-grey.png ''; - buildInputs = - [ - alsa-lib - boost - chromaprint - fftw - gnutls - kdsingleapplication - libXdmcp - libcdio - libebur128 - libidn2 - libmtp - libpthreadstubs - libtasn1 - qt6.qtbase - sqlite - taglib - sparsehash - rapidjson - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libpulseaudio - libselinux - libsepol - p11-kit - ] - ++ (with gst_all_1; [ - glib-networking - gst-libav - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gstreamer - ]); + buildInputs = [ + alsa-lib + boost + chromaprint + fftw + gnutls + kdsingleapplication + libXdmcp + libcdio + libebur128 + libidn2 + libmtp + libpthreadstubs + libtasn1 + qt6.qtbase + sqlite + taglib + sparsehash + rapidjson + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libpulseaudio + libselinux + libsepol + p11-kit + ] + ++ (with gst_all_1; [ + glib-networking + gst-libav + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gstreamer + ]); - nativeBuildInputs = - [ - cmake - ninja - pkg-config - qt6.qttools - qt6.wrapQtAppsHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linux - ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + qt6.qttools + qt6.wrapQtAppsHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linux + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_GPOD" false) ]; diff --git a/pkgs/by-name/st/streamcontroller/package.nix b/pkgs/by-name/st/streamcontroller/package.nix index 435a9398fa6e..d8eee3b7cfdf 100644 --- a/pkgs/by-name/st/streamcontroller/package.nix +++ b/pkgs/by-name/st/streamcontroller/package.nix @@ -42,12 +42,11 @@ stdenv.mkDerivation { installPhase = # Some plugins needs to load things dynamically and in that case we won't find python3 without this let - binPath = - [ - python3Packages.python.interpreter - ] - # Allows automatic detection of windows to switch pages on KDE - ++ lib.optional isKde kdotool; + binPath = [ + python3Packages.python.interpreter + ] + # Allows automatic detection of windows to switch pages on KDE + ++ lib.optional isKde kdotool; in '' runHook preInstall @@ -93,109 +92,108 @@ stdenv.mkDerivation { gobject-introspection ]; - buildInputs = - [ - libadwaita - libportal - libportal-gtk4 - xdg-desktop-portal - xdg-desktop-portal-gtk - ] - ++ (with python3Packages; [ - annotated-types - async-lru - cairocffi - cairosvg - certifi - cffi - charset-normalizer - click - colorama - contourpy - cssselect2 - cycler - dbus-python - decorator - defusedxml - distlib - dnspython - evdev - filelock - fonttools - fuzzywuzzy - gcodepy - get-video-properties - gitdb - idna - imageio - imageio-ffmpeg - indexed-bzip2 - jinja2 - joblib - kiwisolver - levenshtein - linkify-it-py - loguru - markdown-it-py - markupsafe - matplotlib - mdit-py-plugins - mdurl - meson - meson-python - natsort - nltk - numpy - opencv4 - packaging - pillow - platformdirs - plumbum - proglog - psutil - pulsectl - pycairo - pyclip - pycparser - pydantic - pydantic-core - pyenchant - pygments - pygobject3 - pymongo - pyparsing - pyperclip - pyproject-metadata - pyro5 - pyspellchecker - python-dateutil - pyudev - pyusb - pyyaml - rapidfuzz - regex - requests - requirements-parser - rich - rpyc - serpent - setproctitle - six - smmap - speedtest-cli - streamcontroller-plugin-tools - streamdeck - textual - tinycss2 - tqdm - types-setuptools - typing-extensions - uc-micro-py - urllib3 - usb-monitor - webencodings - websocket-client - ]); + buildInputs = [ + libadwaita + libportal + libportal-gtk4 + xdg-desktop-portal + xdg-desktop-portal-gtk + ] + ++ (with python3Packages; [ + annotated-types + async-lru + cairocffi + cairosvg + certifi + cffi + charset-normalizer + click + colorama + contourpy + cssselect2 + cycler + dbus-python + decorator + defusedxml + distlib + dnspython + evdev + filelock + fonttools + fuzzywuzzy + gcodepy + get-video-properties + gitdb + idna + imageio + imageio-ffmpeg + indexed-bzip2 + jinja2 + joblib + kiwisolver + levenshtein + linkify-it-py + loguru + markdown-it-py + markupsafe + matplotlib + mdit-py-plugins + mdurl + meson + meson-python + natsort + nltk + numpy + opencv4 + packaging + pillow + platformdirs + plumbum + proglog + psutil + pulsectl + pycairo + pyclip + pycparser + pydantic + pydantic-core + pyenchant + pygments + pygobject3 + pymongo + pyparsing + pyperclip + pyproject-metadata + pyro5 + pyspellchecker + python-dateutil + pyudev + pyusb + pyyaml + rapidfuzz + regex + requests + requirements-parser + rich + rpyc + serpent + setproctitle + six + smmap + speedtest-cli + streamcontroller-plugin-tools + streamdeck + textual + tinycss2 + tqdm + types-setuptools + typing-extensions + uc-micro-py + urllib3 + usb-monitor + webencodings + websocket-client + ]); doInstallCheck = true; diff --git a/pkgs/by-name/st/streamdeck-ui/package.nix b/pkgs/by-name/st/streamdeck-ui/package.nix index 97c74918d168..daea5cb273c4 100644 --- a/pkgs/by-name/st/streamdeck-ui/package.nix +++ b/pkgs/by-name/st/streamdeck-ui/package.nix @@ -55,13 +55,14 @@ python3Packages.buildPythonApplication rec { ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ]; - nativeCheckInputs = - [ xvfb-run ] - ++ (with python3Packages; [ - pytest - pytest-qt - pytest-mock - ]); + nativeCheckInputs = [ + xvfb-run + ] + ++ (with python3Packages; [ + pytest + pytest-qt + pytest-mock + ]); checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/st/stress-ng/package.nix b/pkgs/by-name/st/stress-ng/package.nix index 84f4ef4a3d2e..3487ff859de5 100644 --- a/pkgs/by-name/st/stress-ng/package.nix +++ b/pkgs/by-name/st/stress-ng/package.nix @@ -32,23 +32,22 @@ stdenv.mkDerivation rec { ''; # needed because of Darwin patch on libbsd # All platforms inputs then Linux-only ones - buildInputs = - [ - judy - libbsd - libgcrypt - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - attr - keyutils - libaio - libapparmor - libcap - lksctp-tools - libglvnd - libgbm - ]; + buildInputs = [ + judy + libbsd + libgcrypt + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + attr + keyutils + libaio + libapparmor + libcap + lksctp-tools + libglvnd + libgbm + ]; makeFlags = [ "BINDIR=${placeholder "out"}/bin" diff --git a/pkgs/by-name/st/stripe-cli/package.nix b/pkgs/by-name/st/stripe-cli/package.nix index a7f0ae984a38..ecf3b83991bb 100644 --- a/pkgs/by-name/st/stripe-cli/package.nix +++ b/pkgs/by-name/st/stripe-cli/package.nix @@ -26,34 +26,33 @@ buildGoModule rec { "-X github.com/stripe/stripe-cli/pkg/version.Version=${version}" ]; - preCheck = - '' - # the tests expect the Version ldflag not to be set - unset ldflags + preCheck = '' + # the tests expect the Version ldflag not to be set + unset ldflags - # requires internet access - rm pkg/cmd/plugin_cmds_test.go - rm pkg/cmd/resources_test.go - rm pkg/cmd/root_test.go + # requires internet access + rm pkg/cmd/plugin_cmds_test.go + rm pkg/cmd/resources_test.go + rm pkg/cmd/root_test.go - # TODO: no clue why it's broken (1.17.1), remove for now. - rm pkg/login/client_login_test.go - rm pkg/git/editor_test.go - rm pkg/rpcservice/sample_create_test.go - '' - + - lib.optionalString - ( - # delete plugin tests on all platforms but exact matches - # https://github.com/stripe/stripe-cli/issues/850 - !lib.lists.any (platform: lib.meta.platformMatch stdenv.hostPlatform platform) [ - "x86_64-linux" - "x86_64-darwin" - ] - ) - '' - rm pkg/plugins/plugin_test.go - ''; + # TODO: no clue why it's broken (1.17.1), remove for now. + rm pkg/login/client_login_test.go + rm pkg/git/editor_test.go + rm pkg/rpcservice/sample_create_test.go + '' + + + lib.optionalString + ( + # delete plugin tests on all platforms but exact matches + # https://github.com/stripe/stripe-cli/issues/850 + !lib.lists.any (platform: lib.meta.platformMatch stdenv.hostPlatform platform) [ + "x86_64-linux" + "x86_64-darwin" + ] + ) + '' + rm pkg/plugins/plugin_test.go + ''; postInstall = '' installShellCompletion --cmd stripe \ diff --git a/pkgs/by-name/st/strongswan/package.nix b/pkgs/by-name/st/strongswan/package.nix index d4ecb9d68689..12a07f974d19 100644 --- a/pkgs/by-name/st/strongswan/package.nix +++ b/pkgs/by-name/st/strongswan/package.nix @@ -57,31 +57,30 @@ stdenv.mkDerivation rec { bison flex ]; - buildInputs = - [ - curl - gmp - python3 - ldns - unbound - openssl - pcsclite - ] - ++ lib.optionals enableTNC [ - trousers - sqlite - libxml2 - ] - ++ lib.optional enableTPM2 tpm2-tss - ++ lib.optionals stdenv.hostPlatform.isLinux [ - systemd.dev - pam - iptables - ] - ++ lib.optionals enableNetworkManager [ - networkmanager - glib - ]; + buildInputs = [ + curl + gmp + python3 + ldns + unbound + openssl + pcsclite + ] + ++ lib.optionals enableTNC [ + trousers + sqlite + libxml2 + ] + ++ lib.optional enableTPM2 tpm2-tss + ++ lib.optionals stdenv.hostPlatform.isLinux [ + systemd.dev + pam + iptables + ] + ++ lib.optionals enableNetworkManager [ + networkmanager + glib + ]; patches = [ ./ext_auth-path.patch @@ -110,90 +109,89 @@ stdenv.mkDerivation rec { substituteInPlace src/libcharon/plugins/resolve/resolve_handler.c --replace "/sbin/resolvconf" "${openresolv}/sbin/resolvconf" ''; - configureFlags = - [ - "--sysconfdir=/etc" - "--enable-swanctl" - "--enable-cmd" - "--enable-openssl" - "--enable-eap-sim" - "--enable-eap-sim-file" - "--enable-eap-simaka-pseudonym" - "--enable-eap-simaka-reauth" - "--enable-eap-identity" - "--enable-eap-md5" - "--enable-eap-gtc" - "--enable-eap-aka" - "--enable-eap-aka-3gpp2" - "--enable-eap-mschapv2" - "--enable-eap-radius" - "--enable-xauth-eap" - "--enable-ext-auth" - "--enable-acert" - "--enable-pkcs11" - "--enable-eap-sim-pcsc" - "--enable-dnscert" - "--enable-unbound" - "--enable-chapoly" - "--enable-curl" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-farp" - "--enable-dhcp" - "--enable-systemd" - "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" - "--enable-xauth-pam" - "--enable-forecast" - "--enable-connmark" - "--enable-af-alg" - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - "--enable-aesni" - "--enable-rdrand" - ] - ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") "--enable-padlock" - ++ lib.optionals enableTNC [ - "--disable-gmp" - "--disable-aes" - "--disable-md5" - "--disable-sha1" - "--disable-sha2" - "--disable-fips-prf" - "--enable-eap-tnc" - "--enable-eap-ttls" - "--enable-eap-dynamic" - "--enable-tnccs-20" - "--enable-tnc-imc" - "--enable-imc-os" - "--enable-imc-attestation" - "--enable-tnc-imv" - "--enable-imv-attestation" - "--enable-tnc-ifmap" - "--enable-tnc-imc" - "--enable-tnc-imv" - "--with-tss=trousers" - "--enable-aikgen" - "--enable-sqlite" - ] - ++ lib.optionals enableTPM2 [ - "--enable-tpm" - "--enable-tss-tss2" - ] - ++ lib.optionals enableNetworkManager [ - "--enable-nm" - "--with-nm-ca-dir=/etc/ssl/certs" - ] - # Taken from: https://wiki.strongswan.org/projects/strongswan/wiki/MacOSX - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--disable-systemd" - "--disable-xauth-pam" - "--disable-kernel-netlink" - "--enable-kernel-pfkey" - "--enable-kernel-pfroute" - "--enable-kernel-libipsec" - "--enable-osx-attr" - "--disable-scripts" - ]; + configureFlags = [ + "--sysconfdir=/etc" + "--enable-swanctl" + "--enable-cmd" + "--enable-openssl" + "--enable-eap-sim" + "--enable-eap-sim-file" + "--enable-eap-simaka-pseudonym" + "--enable-eap-simaka-reauth" + "--enable-eap-identity" + "--enable-eap-md5" + "--enable-eap-gtc" + "--enable-eap-aka" + "--enable-eap-aka-3gpp2" + "--enable-eap-mschapv2" + "--enable-eap-radius" + "--enable-xauth-eap" + "--enable-ext-auth" + "--enable-acert" + "--enable-pkcs11" + "--enable-eap-sim-pcsc" + "--enable-dnscert" + "--enable-unbound" + "--enable-chapoly" + "--enable-curl" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--enable-farp" + "--enable-dhcp" + "--enable-systemd" + "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" + "--enable-xauth-pam" + "--enable-forecast" + "--enable-connmark" + "--enable-af-alg" + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + "--enable-aesni" + "--enable-rdrand" + ] + ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") "--enable-padlock" + ++ lib.optionals enableTNC [ + "--disable-gmp" + "--disable-aes" + "--disable-md5" + "--disable-sha1" + "--disable-sha2" + "--disable-fips-prf" + "--enable-eap-tnc" + "--enable-eap-ttls" + "--enable-eap-dynamic" + "--enable-tnccs-20" + "--enable-tnc-imc" + "--enable-imc-os" + "--enable-imc-attestation" + "--enable-tnc-imv" + "--enable-imv-attestation" + "--enable-tnc-ifmap" + "--enable-tnc-imc" + "--enable-tnc-imv" + "--with-tss=trousers" + "--enable-aikgen" + "--enable-sqlite" + ] + ++ lib.optionals enableTPM2 [ + "--enable-tpm" + "--enable-tss-tss2" + ] + ++ lib.optionals enableNetworkManager [ + "--enable-nm" + "--with-nm-ca-dir=/etc/ssl/certs" + ] + # Taken from: https://wiki.strongswan.org/projects/strongswan/wiki/MacOSX + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--disable-systemd" + "--disable-xauth-pam" + "--disable-kernel-netlink" + "--enable-kernel-pfkey" + "--enable-kernel-pfroute" + "--enable-kernel-libipsec" + "--enable-osx-attr" + "--disable-scripts" + ]; installFlags = [ "sysconfdir=${placeholder "out"}/etc" diff --git a/pkgs/by-name/st/stubby/package.nix b/pkgs/by-name/st/stubby/package.nix index 585edede4df9..31da0c65b96f 100644 --- a/pkgs/by-name/st/stubby/package.nix +++ b/pkgs/by-name/st/stubby/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation (finalAttrs: { getdns libyaml openssl - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ]; postInstall = '' rm -r $out/share/doc diff --git a/pkgs/by-name/st/stunnel/package.nix b/pkgs/by-name/st/stunnel/package.nix index 8246b4cd08e5..2a5c7722534e 100644 --- a/pkgs/by-name/st/stunnel/package.nix +++ b/pkgs/by-name/st/stunnel/package.nix @@ -29,16 +29,15 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - buildInputs = - [ - openssl - ] - ++ lib.optionals systemdSupport [ - systemd - ] - ++ lib.optionals mimallocSupport [ - mimalloc - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals systemdSupport [ + systemd + ] + ++ lib.optionals mimallocSupport [ + mimalloc + ]; configureFlags = [ "--with-ssl=${openssl.dev}" diff --git a/pkgs/by-name/su/sublime-music/package.nix b/pkgs/by-name/su/sublime-music/package.nix index cd29662aba6d..9084a747b94e 100644 --- a/pkgs/by-name/su/sublime-music/package.nix +++ b/pkgs/by-name/su/sublime-music/package.nix @@ -45,13 +45,12 @@ python3.pkgs.buildPythonApplication rec { wrapGAppsHook3 ]; - buildInputs = - [ - gtk3 - pango - ] - ++ lib.optional notifySupport libnotify - ++ lib.optional networkSupport networkmanager; + buildInputs = [ + gtk3 + pango + ] + ++ lib.optional notifySupport libnotify + ++ lib.optional networkSupport networkmanager; propagatedBuildInputs = with python3.pkgs; diff --git a/pkgs/by-name/su/subtitlecomposer/package.nix b/pkgs/by-name/su/subtitlecomposer/package.nix index 09a9ff32d277..122169aaaa6e 100644 --- a/pkgs/by-name/su/subtitlecomposer/package.nix +++ b/pkgs/by-name/su/subtitlecomposer/package.nix @@ -26,23 +26,22 @@ stdenv.mkDerivation rec { extra-cmake-modules libsForQt5.wrapQtAppsHook ]; - buildInputs = - [ - ffmpeg_6 - openal - ] - ++ (with libsForQt5; [ - kcodecs - kconfig - kconfigwidgets - kcoreaddons - ki18n - kio - ktextwidgets - kwidgetsaddons - kxmlgui - sonnet - ]); + buildInputs = [ + ffmpeg_6 + openal + ] + ++ (with libsForQt5; [ + kcodecs + kconfig + kconfigwidgets + kcoreaddons + ki18n + kio + ktextwidgets + kwidgetsaddons + kxmlgui + sonnet + ]); meta = with lib; { homepage = "https://apps.kde.org/subtitlecomposer"; diff --git a/pkgs/by-name/su/sudo/package.nix b/pkgs/by-name/su/sudo/package.nix index d7394649a5f0..283f1bd17459 100644 --- a/pkgs/by-name/su/sudo/package.nix +++ b/pkgs/by-name/su/sudo/package.nix @@ -31,26 +31,25 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace src/Makefile.in --replace 04755 0755 ''; - configureFlags = - [ - "--with-env-editor" - "--with-editor=/run/current-system/sw/bin/nano" - "--with-rundir=/run/sudo" - "--with-vardir=/var/db/sudo" - "--with-logpath=/var/log/sudo.log" - "--with-iologdir=/var/log/sudo-io" - "--with-sendmail=${sendmailPath}" - "--enable-tmpfiles.d=no" - "--with-passprompt=[sudo] password for %p: " # intentional trailing space - ] - ++ lib.optionals withInsults [ - "--with-insults" - "--with-all-insults" - ] - ++ lib.optionals withSssd [ - "--with-sssd" - "--with-sssd-lib=${sssd}/lib" - ]; + configureFlags = [ + "--with-env-editor" + "--with-editor=/run/current-system/sw/bin/nano" + "--with-rundir=/run/sudo" + "--with-vardir=/var/db/sudo" + "--with-logpath=/var/log/sudo.log" + "--with-iologdir=/var/log/sudo-io" + "--with-sendmail=${sendmailPath}" + "--enable-tmpfiles.d=no" + "--with-passprompt=[sudo] password for %p: " # intentional trailing space + ] + ++ lib.optionals withInsults [ + "--with-insults" + "--with-all-insults" + ] + ++ lib.optionals withSssd [ + "--with-sssd" + "--with-sssd-lib=${sssd}/lib" + ]; postConfigure = '' cat >> pathnames.h <<'EOF' diff --git a/pkgs/by-name/su/suil/package.nix b/pkgs/by-name/su/suil/package.nix index a3bf187dd9c2..0ab5468346c3 100644 --- a/pkgs/by-name/su/suil/package.nix +++ b/pkgs/by-name/su/suil/package.nix @@ -57,18 +57,19 @@ stdenv.mkDerivation rec { (mesonEnable "x11" withX11) ]; - buildInputs = - [ lv2 ] - ++ lib.optionals withGtk2 [ gtk2 ] - ++ lib.optionals withGtk3 [ gtk3 ] - ++ lib.optionals withQt5 ( - with qt5; - [ - qtbase - qttools - ] - ++ lib.optionals withX11 [ qtx11extras ] - ); + buildInputs = [ + lv2 + ] + ++ lib.optionals withGtk2 [ gtk2 ] + ++ lib.optionals withGtk3 [ gtk3 ] + ++ lib.optionals withQt5 ( + with qt5; + [ + qtbase + qttools + ] + ++ lib.optionals withX11 [ qtx11extras ] + ); dontWrapQtApps = true; diff --git a/pkgs/by-name/su/sumo/package.nix b/pkgs/by-name/su/sumo/package.nix index 5f17603bd5a5..fd861826278a 100644 --- a/pkgs/by-name/su/sumo/package.nix +++ b/pkgs/by-name/su/sumo/package.nix @@ -48,39 +48,38 @@ stdenv.mkDerivation rec { swig ]; - buildInputs = - [ - bzip2 - eigen - ffmpeg - fox_1_6 - gdal - gl2ps - gpp - gtest - jdk - libGL - libGLU - libjpeg - libpng - libtiff - libxcrypt - openscenegraph - proj - python3Packages.setuptools - xercesc - zlib - python3 - ] - ++ (with xorg; [ - libX11 - libXcursor - libXext - libXfixes - libXft - libXrandr - libXrender - ]); + buildInputs = [ + bzip2 + eigen + ffmpeg + fox_1_6 + gdal + gl2ps + gpp + gtest + jdk + libGL + libGLU + libjpeg + libpng + libtiff + libxcrypt + openscenegraph + proj + python3Packages.setuptools + xercesc + zlib + python3 + ] + ++ (with xorg; [ + libX11 + libXcursor + libXext + libXfixes + libXft + libXrandr + libXrender + ]); meta = with lib; { description = "SUMO traffic simulator"; diff --git a/pkgs/by-name/su/sundials/package.nix b/pkgs/by-name/su/sundials/package.nix index b9d4d7d9dc8e..e1a2a8c0fc85 100644 --- a/pkgs/by-name/su/sundials/package.nix +++ b/pkgs/by-name/su/sundials/package.nix @@ -31,47 +31,45 @@ stdenv.mkDerivation rec { gfortran ]; - buildInputs = - [ - python3 - ] - ++ - lib.optionals (lapackSupport) - # Check that the same index size is used for both libraries - ( - assert (blas.isILP64 == lapack.isILP64); - [ - blas - lapack - ] - ) - # KLU support is based on Suitesparse. It is tested upstream according to the - # section 1.1.4.2 of INSTALL_GUIDE.pdf found in the source tarball. - ++ lib.optionals (kluSupport) [ - suitesparse - ]; - - cmakeFlags = - [ - "-DEXAMPLES_INSTALL_PATH=${placeholder "examples"}/share/examples" - ] - ++ lib.optionals (lapackSupport) [ - "-DENABLE_LAPACK=ON" - "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}" - ] - ++ lib.optionals (kluSupport) [ - "-DENABLE_KLU=ON" - "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include" - "-DKLU_LIBRARY_DIR=${suitesparse}/lib" - ] - ++ [ + buildInputs = [ + python3 + ] + ++ + lib.optionals (lapackSupport) + # Check that the same index size is used for both libraries ( - # Use the correct index type according to lapack and blas used. They are - # already supposed to be compatible but we check both for extra safety. 64 - # should be the default but we prefer to be explicit, for extra safety. - if blas.isILP64 then "-DSUNDIALS_INDEX_SIZE=64" else "-DSUNDIALS_INDEX_SIZE=32" + assert (blas.isILP64 == lapack.isILP64); + [ + blas + lapack + ] ) - ]; + # KLU support is based on Suitesparse. It is tested upstream according to the + # section 1.1.4.2 of INSTALL_GUIDE.pdf found in the source tarball. + ++ lib.optionals (kluSupport) [ + suitesparse + ]; + + cmakeFlags = [ + "-DEXAMPLES_INSTALL_PATH=${placeholder "examples"}/share/examples" + ] + ++ lib.optionals (lapackSupport) [ + "-DENABLE_LAPACK=ON" + "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}" + ] + ++ lib.optionals (kluSupport) [ + "-DENABLE_KLU=ON" + "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include" + "-DKLU_LIBRARY_DIR=${suitesparse}/lib" + ] + ++ [ + ( + # Use the correct index type according to lapack and blas used. They are + # already supposed to be compatible but we check both for extra safety. 64 + # should be the default but we prefer to be explicit, for extra safety. + if blas.isILP64 then "-DSUNDIALS_INDEX_SIZE=64" else "-DSUNDIALS_INDEX_SIZE=32" + ) + ]; doCheck = true; checkTarget = "test"; diff --git a/pkgs/by-name/su/sunshine/package.nix b/pkgs/by-name/su/sunshine/package.nix index d7b727133f33..cd907f3df4a3 100644 --- a/pkgs/by-name/su/sunshine/package.nix +++ b/pkgs/by-name/su/sunshine/package.nix @@ -83,69 +83,67 @@ stdenv'.mkDerivation rec { ''; }; - nativeBuildInputs = - [ - cmake - pkg-config - python3 - makeWrapper - wayland-scanner - # Avoid fighting upstream's usage of vendored ffmpeg libraries - autoPatchelfHook - udevCheckHook - ] - ++ lib.optionals cudaSupport [ - autoAddDriverRunpath - cudaPackages.cuda_nvcc - (lib.getDev cudaPackages.cuda_cudart) - ]; + nativeBuildInputs = [ + cmake + pkg-config + python3 + makeWrapper + wayland-scanner + # Avoid fighting upstream's usage of vendored ffmpeg libraries + autoPatchelfHook + udevCheckHook + ] + ++ lib.optionals cudaSupport [ + autoAddDriverRunpath + cudaPackages.cuda_nvcc + (lib.getDev cudaPackages.cuda_cudart) + ]; - buildInputs = - [ - avahi - libevdev - libpulseaudio - xorg.libX11 - libxcb - xorg.libXfixes - xorg.libXrandr - xorg.libXtst - xorg.libXi - openssl - libopus - boost - libdrm - wayland - libffi - libevdev - libcap - libdrm - curl - pcre - pcre2 - libuuid - libselinux - libsepol - libthai - libdatrie - xorg.libXdmcp - libxkbcommon - libepoxy - libva - libvdpau - numactl - libgbm - amf-headers - svt-av1 - libappindicator - libnotify - miniupnpc - nlohmann_json - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cudatoolkit - cudaPackages.cuda_cudart - ]; + buildInputs = [ + avahi + libevdev + libpulseaudio + xorg.libX11 + libxcb + xorg.libXfixes + xorg.libXrandr + xorg.libXtst + xorg.libXi + openssl + libopus + boost + libdrm + wayland + libffi + libevdev + libcap + libdrm + curl + pcre + pcre2 + libuuid + libselinux + libsepol + libthai + libdatrie + xorg.libXdmcp + libxkbcommon + libepoxy + libva + libvdpau + numactl + libgbm + amf-headers + svt-av1 + libappindicator + libnotify + miniupnpc + nlohmann_json + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cudatoolkit + cudaPackages.cuda_cudart + ]; runtimeDependencies = [ avahi @@ -155,23 +153,22 @@ stdenv'.mkDerivation rec { libglvnd ]; - cmakeFlags = - [ - "-Wno-dev" - # upstream tries to use systemd and udev packages to find these directories in FHS; set the paths explicitly instead - (lib.cmakeBool "UDEV_FOUND" true) - (lib.cmakeBool "SYSTEMD_FOUND" true) - (lib.cmakeFeature "UDEV_RULES_INSTALL_DIR" "lib/udev/rules.d") - (lib.cmakeFeature "SYSTEMD_USER_UNIT_INSTALL_DIR" "lib/systemd/user") - (lib.cmakeBool "BOOST_USE_STATIC" false) - (lib.cmakeBool "BUILD_DOCS" false) - (lib.cmakeFeature "SUNSHINE_PUBLISHER_NAME" "nixpkgs") - (lib.cmakeFeature "SUNSHINE_PUBLISHER_WEBSITE" "https://nixos.org") - (lib.cmakeFeature "SUNSHINE_PUBLISHER_ISSUE_URL" "https://github.com/NixOS/nixpkgs/issues") - ] - ++ lib.optionals (!cudaSupport) [ - (lib.cmakeBool "SUNSHINE_ENABLE_CUDA" false) - ]; + cmakeFlags = [ + "-Wno-dev" + # upstream tries to use systemd and udev packages to find these directories in FHS; set the paths explicitly instead + (lib.cmakeBool "UDEV_FOUND" true) + (lib.cmakeBool "SYSTEMD_FOUND" true) + (lib.cmakeFeature "UDEV_RULES_INSTALL_DIR" "lib/udev/rules.d") + (lib.cmakeFeature "SYSTEMD_USER_UNIT_INSTALL_DIR" "lib/systemd/user") + (lib.cmakeBool "BOOST_USE_STATIC" false) + (lib.cmakeBool "BUILD_DOCS" false) + (lib.cmakeFeature "SUNSHINE_PUBLISHER_NAME" "nixpkgs") + (lib.cmakeFeature "SUNSHINE_PUBLISHER_WEBSITE" "https://nixos.org") + (lib.cmakeFeature "SUNSHINE_PUBLISHER_ISSUE_URL" "https://github.com/NixOS/nixpkgs/issues") + ] + ++ lib.optionals (!cudaSupport) [ + (lib.cmakeBool "SUNSHINE_ENABLE_CUDA" false) + ]; env = { # needed to trigger CMake version configuration diff --git a/pkgs/by-name/su/sunvox/package.nix b/pkgs/by-name/su/sunvox/package.nix index 6b274e489b49..59d6d14c7710 100644 --- a/pkgs/by-name/su/sunvox/package.nix +++ b/pkgs/by-name/su/sunvox/package.nix @@ -61,38 +61,37 @@ stdenv.mkDerivation (finalAttrs: { dontConfigure = true; dontBuild = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - # Delete platform-specific data for all the platforms we're not building for - find sunvox -mindepth 1 -maxdepth 1 -type d -not -name "${bindir}" -exec rm -r {} \; + # Delete platform-specific data for all the platforms we're not building for + find sunvox -mindepth 1 -maxdepth 1 -type d -not -name "${bindir}" -exec rm -r {} \; - mkdir -p $out/{bin,share/sunvox} - mv * $out/share/sunvox/ + mkdir -p $out/{bin,share/sunvox} + mv * $out/share/sunvox/ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - for binary in $(find $out/share/sunvox/sunvox/${bindir}/ -type f -executable); do - mv $binary $out/bin/$(basename $binary) - done + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + for binary in $(find $out/share/sunvox/sunvox/${bindir}/ -type f -executable); do + mv $binary $out/bin/$(basename $binary) + done - # Cleanup, make sure we didn't miss anything - find $out/share/sunvox/sunvox -type f -name readme.txt -delete - rmdir $out/share/sunvox/sunvox/${bindir} $out/share/sunvox/sunvox - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir $out/Applications - ln -s $out/share/sunvox/sunvox/${bindir}/SunVox.app $out/Applications/ - ln -s $out/share/sunvox/sunvox/${bindir}/reset_sunvox $out/bin/ + # Cleanup, make sure we didn't miss anything + find $out/share/sunvox/sunvox -type f -name readme.txt -delete + rmdir $out/share/sunvox/sunvox/${bindir} $out/share/sunvox/sunvox + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir $out/Applications + ln -s $out/share/sunvox/sunvox/${bindir}/SunVox.app $out/Applications/ + ln -s $out/share/sunvox/sunvox/${bindir}/reset_sunvox $out/bin/ - # Need to use a wrapper, binary checks for files relative to the path it was called via - makeWrapper $out/Applications/SunVox.app/Contents/MacOS/SunVox $out/bin/sunvox - '' - + '' + # Need to use a wrapper, binary checks for files relative to the path it was called via + makeWrapper $out/Applications/SunVox.app/Contents/MacOS/SunVox $out/bin/sunvox + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; meta = with lib; { description = "Small, fast and powerful modular synthesizer with pattern-based sequencer"; diff --git a/pkgs/by-name/su/superTuxKart/package.nix b/pkgs/by-name/su/superTuxKart/package.nix index 63f92ca38650..7d6763bde477 100644 --- a/pkgs/by-name/su/superTuxKart/package.nix +++ b/pkgs/by-name/su/superTuxKart/package.nix @@ -92,29 +92,28 @@ stdenv.mkDerivation rec { makeWrapper ]; - buildInputs = - [ - shaderc - SDL2 - glew - libvorbis - libogg - freetype - curl - libjpeg - libpng - libX11 - harfbuzz - mcpp - wiiuse - angelscript - sqlite - ] - ++ lib.optional (stdenv.hostPlatform.isWindows || stdenv.hostPlatform.isLinux) libopenglrecorder - ++ lib.optional stdenv.hostPlatform.isLinux openal - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libsamplerate - ]; + buildInputs = [ + shaderc + SDL2 + glew + libvorbis + libogg + freetype + curl + libjpeg + libpng + libX11 + harfbuzz + mcpp + wiiuse + angelscript + sqlite + ] + ++ lib.optional (stdenv.hostPlatform.isWindows || stdenv.hostPlatform.isLinux) libopenglrecorder + ++ lib.optional stdenv.hostPlatform.isLinux openal + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libsamplerate + ]; cmakeFlags = [ "-DBUILD_RECORDER=${ diff --git a/pkgs/by-name/su/superlu/package.nix b/pkgs/by-name/su/superlu/package.nix index 9492db86891a..6288232a8cd4 100644 --- a/pkgs/by-name/su/superlu/package.nix +++ b/pkgs/by-name/su/superlu/package.nix @@ -45,16 +45,15 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ blas ]; - cmakeFlags = - [ - (lib.cmakeBool "BUILD_SHARED_LIBS" true) - (lib.cmakeBool "enable_fortran" true) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # prevent cmake from using Accelerate, which causes tests to segfault - # https://github.com/xiaoyeli/superlu/issues/155 - "-DBLA_VENDOR=Generic" - ]; + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + (lib.cmakeBool "enable_fortran" true) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # prevent cmake from using Accelerate, which causes tests to segfault + # https://github.com/xiaoyeli/superlu/issues/155 + "-DBLA_VENDOR=Generic" + ]; doCheck = true; diff --git a/pkgs/by-name/su/superlu_dist/package.nix b/pkgs/by-name/su/superlu_dist/package.nix index 2a92911d417f..d85b9745cd46 100644 --- a/pkgs/by-name/su/superlu_dist/package.nix +++ b/pkgs/by-name/su/superlu_dist/package.nix @@ -50,14 +50,13 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail "LargeDiag_MC64" "NOROWPERM" ''; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals fortranSupport [ - gfortran - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals fortranSupport [ + gfortran + ]; buildInputs = lib.optionals (enableOpenMP && stdenv.cc.isClang) [ @@ -78,22 +77,21 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ blas ]; - cmakeFlags = - [ - (lib.cmakeBool "enable_examples" withExamples) - (lib.cmakeBool "enable_openmp" enableOpenMP) - (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) - (lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic) - (lib.cmakeBool "XSDK_ENABLE_Fortran" fortranSupport) - (lib.cmakeBool "BLA_PREFER_PKGCONFIG" true) - (lib.cmakeBool "TPL_ENABLE_INTERNAL_BLASLIB" false) - (lib.cmakeBool "TPL_ENABLE_LAPACKLIB" true) - (lib.cmakeBool "TPL_ENABLE_PARMETISLIB" withParmetis) - ] - ++ lib.optionals withParmetis [ - (lib.cmakeFeature "TPL_PARMETIS_LIBRARIES" "-lmetis -lparmetis") - (lib.cmakeFeature "TPL_PARMETIS_INCLUDE_DIRS" "${lib.getDev parmetis}/include") - ]; + cmakeFlags = [ + (lib.cmakeBool "enable_examples" withExamples) + (lib.cmakeBool "enable_openmp" enableOpenMP) + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) + (lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic) + (lib.cmakeBool "XSDK_ENABLE_Fortran" fortranSupport) + (lib.cmakeBool "BLA_PREFER_PKGCONFIG" true) + (lib.cmakeBool "TPL_ENABLE_INTERNAL_BLASLIB" false) + (lib.cmakeBool "TPL_ENABLE_LAPACKLIB" true) + (lib.cmakeBool "TPL_ENABLE_PARMETISLIB" withParmetis) + ] + ++ lib.optionals withParmetis [ + (lib.cmakeFeature "TPL_PARMETIS_LIBRARIES" "-lmetis -lparmetis") + (lib.cmakeFeature "TPL_PARMETIS_INCLUDE_DIRS" "${lib.getDev parmetis}/include") + ]; doCheck = true; diff --git a/pkgs/by-name/su/supersonic/package.nix b/pkgs/by-name/su/supersonic/package.nix index 7212e2e7277b..0d6b048c028e 100644 --- a/pkgs/by-name/su/supersonic/package.nix +++ b/pkgs/by-name/su/supersonic/package.nix @@ -29,51 +29,48 @@ buildGoModule rec { vendorHash = "sha256-v6tPGjeJhRdSJpVPQAERRM7cpXO7Ut7kLF3EdNcDFgM="; - nativeBuildInputs = - [ - copyDesktopItems - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + copyDesktopItems + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; # go-glfw doesn't support both X11 and Wayland in single build tags = lib.optionals waylandSupport [ "wayland" ]; - buildInputs = - [ - libglvnd - mpv-unwrapped - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - xorg.libXxf86vm - xorg.libX11 - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && !waylandSupport) [ - xorg.libXrandr - xorg.libXinerama - xorg.libXcursor - xorg.libXi - xorg.libXext - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && waylandSupport) [ - wayland - wayland-protocols - libxkbcommon - ]; + buildInputs = [ + libglvnd + mpv-unwrapped + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + xorg.libXxf86vm + xorg.libX11 + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && !waylandSupport) [ + xorg.libXrandr + xorg.libXinerama + xorg.libXcursor + xorg.libXi + xorg.libXext + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && waylandSupport) [ + wayland + wayland-protocols + libxkbcommon + ]; - postInstall = - '' - for dimension in 128 256 512;do - dimensions=''${dimension}x''${dimension} - mkdir -p $out/share/icons/hicolor/$dimensions/apps - cp res/appicon-$dimension.png $out/share/icons/hicolor/$dimensions/apps/${meta.mainProgram}.png - done - '' - + lib.optionalString waylandSupport '' - mv $out/bin/supersonic $out/bin/${meta.mainProgram} - ''; + postInstall = '' + for dimension in 128 256 512;do + dimensions=''${dimension}x''${dimension} + mkdir -p $out/share/icons/hicolor/$dimensions/apps + cp res/appicon-$dimension.png $out/share/icons/hicolor/$dimensions/apps/${meta.mainProgram}.png + done + '' + + lib.optionalString waylandSupport '' + mv $out/bin/supersonic $out/bin/${meta.mainProgram} + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/su/surf/package.nix b/pkgs/by-name/su/surf/package.nix index 8a38ab27a506..1e902f4ad50f 100644 --- a/pkgs/by-name/su/surf/package.nix +++ b/pkgs/by-name/su/surf/package.nix @@ -35,23 +35,22 @@ stdenv.mkDerivation rec { pkg-config wrapGAppsHook3 ]; - buildInputs = - [ - glib - gcr - glib-networking - gsettings-desktop-schemas - gtk2 - libsoup_2_4 - webkitgtk_4_0 - ] - ++ (with gst_all_1; [ - # Audio & video support for webkitgtk WebView - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ]); + buildInputs = [ + glib + gcr + glib-networking + gsettings-desktop-schemas + gtk2 + libsoup_2_4 + webkitgtk_4_0 + ] + ++ (with gst_all_1; [ + # Audio & video support for webkitgtk WebView + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ]); inherit patches; diff --git a/pkgs/by-name/su/suricata/package.nix b/pkgs/by-name/su/suricata/package.nix index a1862b5c3d78..ddd22c90bcfd 100644 --- a/pkgs/by-name/su/suricata/package.nix +++ b/pkgs/by-name/su/suricata/package.nix @@ -46,49 +46,47 @@ stdenv.mkDerivation rec { hash = "sha256-GX+SXqcBvctKFaygJLBlRrACZ0zZWLWJWPKaW7IU11k="; }; - nativeBuildInputs = - [ - clang - llvm - makeWrapper - pkg-config - ] - ++ lib.optionals rustSupport [ - rustc - cargo - ]; + nativeBuildInputs = [ + clang + llvm + makeWrapper + pkg-config + ] + ++ lib.optionals rustSupport [ + rustc + cargo + ]; propagatedBuildInputs = with python3.pkgs; [ pyyaml ]; - buildInputs = - [ - elfutils - jansson - libbpf_0 - libcap_ng - libevent - libmagic - libmaxminddb - libnet - libnetfilter_log - libnetfilter_queue - libnfnetlink - libpcap - libyaml - luajit - lz4 - nspr - pcre2 - python3 - vectorscan - zlib - ] - ++ lib.optionals redisSupport [ - valkey - hiredis - ]; + buildInputs = [ + elfutils + jansson + libbpf_0 + libcap_ng + libevent + libmagic + libmaxminddb + libnet + libnetfilter_log + libnetfilter_queue + libnfnetlink + libpcap + libyaml + luajit + lz4 + nspr + pcre2 + python3 + vectorscan + zlib + ] + ++ lib.optionals redisSupport [ + valkey + hiredis + ]; enableParallelBuilding = true; @@ -104,32 +102,31 @@ stdenv.mkDerivation rec { touch bpf_stubs_workaround/gnu/stubs-32.h ''; - configureFlags = - [ - "--disable-gccmarch-native" - "--enable-af-packet" - "--enable-ebpf" - "--enable-ebpf-build" - "--enable-gccprotect" - "--enable-geoip" - "--enable-luajit" - "--enable-nflog" - "--enable-nfqueue" - "--enable-pie" - "--enable-python" - "--enable-unix-socket" - "--localstatedir=/var" - "--sysconfdir=/etc" - "--with-libhs-includes=${lib.getDev vectorscan}/include/hs" - "--with-libhs-libraries=${lib.getLib vectorscan}/lib" - "--with-libnet-includes=${libnet}/include" - "--with-libnet-libraries=${libnet}/lib" - ] - ++ lib.optional redisSupport "--enable-hiredis" - ++ lib.optionals rustSupport [ - "--enable-rust" - "--enable-rust-experimental" - ]; + configureFlags = [ + "--disable-gccmarch-native" + "--enable-af-packet" + "--enable-ebpf" + "--enable-ebpf-build" + "--enable-gccprotect" + "--enable-geoip" + "--enable-luajit" + "--enable-nflog" + "--enable-nfqueue" + "--enable-pie" + "--enable-python" + "--enable-unix-socket" + "--localstatedir=/var" + "--sysconfdir=/etc" + "--with-libhs-includes=${lib.getDev vectorscan}/include/hs" + "--with-libhs-libraries=${lib.getLib vectorscan}/lib" + "--with-libnet-includes=${libnet}/include" + "--with-libnet-libraries=${libnet}/lib" + ] + ++ lib.optional redisSupport "--enable-hiredis" + ++ lib.optionals rustSupport [ + "--enable-rust" + "--enable-rust-experimental" + ]; postConfigure = '' # Avoid unintended clousure growth. diff --git a/pkgs/by-name/su/survex/package.nix b/pkgs/by-name/su/survex/package.nix index a7c1186009f9..241c6db38ae7 100644 --- a/pkgs/by-name/su/survex/package.nix +++ b/pkgs/by-name/su/survex/package.nix @@ -33,22 +33,21 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - ffmpeg - glib - proj - gdal - wxGTK32 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # TODO: libGLU doesn't build for macOS because of Mesa issues - # (#233265); is it required for anything? - libGLU - libgbm - libICE - libX11 - ]; + buildInputs = [ + ffmpeg + glib + proj + gdal + wxGTK32 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # TODO: libGLU doesn't build for macOS because of Mesa issues + # (#233265); is it required for anything? + libGLU + libgbm + libICE + libX11 + ]; strictDeps = true; diff --git a/pkgs/by-name/sv/svt-av1-psy/package.nix b/pkgs/by-name/sv/svt-av1-psy/package.nix index 25663c9bcfdc..c722b55ecd78 100644 --- a/pkgs/by-name/sv/svt-av1-psy/package.nix +++ b/pkgs/by-name/sv/svt-av1-psy/package.nix @@ -36,22 +36,20 @@ stdenv.mkDerivation (finalAttrs: { LIBHDR10PLUS_RS_FOUND = true; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - nasm - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + nasm + ]; - buildInputs = - [ - libdovi - hdr10plus - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - cpuinfo - ]; + buildInputs = [ + libdovi + hdr10plus + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + cpuinfo + ]; passthru.updateScript = unstableGitUpdater { branch = "master"; diff --git a/pkgs/by-name/sv/svt-av1/package.nix b/pkgs/by-name/sv/svt-av1/package.nix index 6103a94c1c7b..71d65c1d9311 100644 --- a/pkgs/by-name/sv/svt-av1/package.nix +++ b/pkgs/by-name/sv/svt-av1/package.nix @@ -30,13 +30,12 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - nasm - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + nasm + ]; buildInputs = lib.optionals stdenv.hostPlatform.isx86_64 [ cpuinfo diff --git a/pkgs/by-name/sw/sway-unwrapped/package.nix b/pkgs/by-name/sw/sway-unwrapped/package.nix index e54aba0a2a9c..e829c7b6b92f 100644 --- a/pkgs/by-name/sw/sway-unwrapped/package.nix +++ b/pkgs/by-name/sw/sway-unwrapped/package.nix @@ -50,24 +50,23 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-xMrexVDpgkGnvAAglshsh7HjvcbU2/Q6JLUd5J487qg="; }; - patches = - [ - ./load-configuration-from-etc.patch + patches = [ + ./load-configuration-from-etc.patch - (replaceVars ./fix-paths.patch { - inherit swaybg; - }) - ] - ++ lib.optionals (!finalAttrs.isNixOS) [ - # References to /nix/store/... will get GC'ed which causes problems when - # copying the default configuration: - ./sway-config-no-nix-store-references.patch - ] - ++ lib.optionals finalAttrs.isNixOS [ - # Use /run/current-system/sw/share and /etc instead of /nix/store - # references: - ./sway-config-nixos-paths.patch - ]; + (replaceVars ./fix-paths.patch { + inherit swaybg; + }) + ] + ++ lib.optionals (!finalAttrs.isNixOS) [ + # References to /nix/store/... will get GC'ed which causes problems when + # copying the default configuration: + ./sway-config-no-nix-store-references.patch + ] + ++ lib.optionals finalAttrs.isNixOS [ + # Use /run/current-system/sw/share and /etc instead of /nix/store + # references: + ./sway-config-nixos-paths.patch + ]; strictDeps = true; depsBuildBuild = [ @@ -82,26 +81,25 @@ stdenv.mkDerivation (finalAttrs: { scdoc ]; - buildInputs = - [ - libGL - wayland - libxkbcommon - pcre2 - json_c - libevdev - pango - cairo - libinput - gdk-pixbuf - librsvg - wayland-protocols - libdrm - (wlroots.override { inherit (finalAttrs) enableXWayland; }) - ] - ++ lib.optionals finalAttrs.enableXWayland [ - xorg.xcbutilwm - ]; + buildInputs = [ + libGL + wayland + libxkbcommon + pcre2 + json_c + libevdev + pango + cairo + libinput + gdk-pixbuf + librsvg + wayland-protocols + libdrm + (wlroots.override { inherit (finalAttrs) enableXWayland; }) + ] + ++ lib.optionals finalAttrs.enableXWayland [ + xorg.xcbutilwm + ]; mesonFlags = let diff --git a/pkgs/by-name/sw/swayfx-unwrapped/package.nix b/pkgs/by-name/sw/swayfx-unwrapped/package.nix index e804b4a674d6..4f324d6988da 100644 --- a/pkgs/by-name/sw/swayfx-unwrapped/package.nix +++ b/pkgs/by-name/sw/swayfx-unwrapped/package.nix @@ -53,24 +53,23 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-TZNN5pQhH/10DfntCfGHL1kuAceLMYbxwa4RFq7OmrQ="; }; - patches = - [ - ./load-configuration-from-etc.patch + patches = [ + ./load-configuration-from-etc.patch - (replaceVars ./fix-paths.patch { - inherit swaybg; - }) - ] - ++ lib.optionals (!finalAttrs.isNixOS) [ - # References to /nix/store/... will get GC'ed which causes problems when - # copying the default configuration: - ./sway-config-no-nix-store-references.patch - ] - ++ lib.optionals finalAttrs.isNixOS [ - # Use /run/current-system/sw/share and /etc instead of /nix/store - # references: - ./sway-config-nixos-paths.patch - ]; + (replaceVars ./fix-paths.patch { + inherit swaybg; + }) + ] + ++ lib.optionals (!finalAttrs.isNixOS) [ + # References to /nix/store/... will get GC'ed which causes problems when + # copying the default configuration: + ./sway-config-no-nix-store-references.patch + ] + ++ lib.optionals finalAttrs.isNixOS [ + # Use /run/current-system/sw/share and /etc instead of /nix/store + # references: + ./sway-config-nixos-paths.patch + ]; strictDeps = true; depsBuildBuild = [ pkg-config ]; @@ -99,7 +98,8 @@ stdenv.mkDerivation (finalAttrs: { wayland wayland-protocols (wlroots_0_19.override { inherit (finalAttrs) enableXWayland; }) - ] ++ lib.optionals finalAttrs.enableXWayland [ xcbutilwm ]; + ] + ++ lib.optionals finalAttrs.enableXWayland [ xcbutilwm ]; mesonFlags = let diff --git a/pkgs/by-name/sw/swayidle/package.nix b/pkgs/by-name/sw/swayidle/package.nix index 163f0283cd3f..ea4ae160b1c1 100644 --- a/pkgs/by-name/sw/swayidle/package.nix +++ b/pkgs/by-name/sw/swayidle/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { buildInputs = [ wayland wayland-protocols - ] ++ lib.optionals systemdSupport [ systemd ]; + ] + ++ lib.optionals systemdSupport [ systemd ]; mesonFlags = [ "-Dman-pages=enabled" diff --git a/pkgs/by-name/sw/swi-prolog/package.nix b/pkgs/by-name/sw/swi-prolog/package.nix index 36ef2245c5ba..70dbac88c78e 100644 --- a/pkgs/by-name/sw/swi-prolog/package.nix +++ b/pkgs/by-name/sw/swi-prolog/package.nix @@ -148,17 +148,19 @@ stdenv.mkDerivation { gmp readline libedit - ] ++ optionalDependencies; + ] + ++ optionalDependencies; hardeningDisable = [ "format" ]; - cmakeFlags = - [ "-DSWIPL_INSTALL_IN_LIB=ON" ] - ++ lib.optionals (!withNativeCompiler) [ - # without these options, the build will embed full compiler paths - "-DSWIPL_CC=${if stdenv.hostPlatform.isDarwin then "clang" else "gcc"}" - "-DSWIPL_CXX=${if stdenv.hostPlatform.isDarwin then "clang++" else "g++"}" - ]; + cmakeFlags = [ + "-DSWIPL_INSTALL_IN_LIB=ON" + ] + ++ lib.optionals (!withNativeCompiler) [ + # without these options, the build will embed full compiler paths + "-DSWIPL_CC=${if stdenv.hostPlatform.isDarwin then "clang" else "gcc"}" + "-DSWIPL_CXX=${if stdenv.hostPlatform.isDarwin then "clang++" else "g++"}" + ]; preInstall = '' mkdir -p $out/lib/swipl/extra-pack diff --git a/pkgs/by-name/sw/sword/package.nix b/pkgs/by-name/sw/sword/package.nix index 7ee1646ad227..3e9f942466d0 100644 --- a/pkgs/by-name/sw/sword/package.nix +++ b/pkgs/by-name/sw/sword/package.nix @@ -27,27 +27,25 @@ stdenv.mkDerivation ( hash = "sha256-QkCc894vrxEIUj4sWsB0XSH57SpceO2HjuncwwNCa4o="; }; - nativeBuildInputs = - [ - pkg-config - ] - ++ (lib.optionals stdenv.hostPlatform.isWindows [ - autoreconfHook # The Windows patch modifies autotools files - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (lib.optionals stdenv.hostPlatform.isWindows [ + autoreconfHook # The Windows patch modifies autotools files + ]); - buildInputs = - [ - icu - ] - ++ (lib.optionals stdenv.hostPlatform.isUnix [ - clucene_core - curl - ]) - ++ (lib.optionals stdenv.hostPlatform.isWindows [ - bzip2 - curlDep - xz - ]); + buildInputs = [ + icu + ] + ++ (lib.optionals stdenv.hostPlatform.isUnix [ + clucene_core + curl + ]) + ++ (lib.optionals stdenv.hostPlatform.isWindows [ + bzip2 + curlDep + xz + ]); outputs = [ "out" @@ -64,16 +62,15 @@ stdenv.mkDerivation ( patches = lib.optional stdenv.hostPlatform.isWindows ./sword-1.9.0-diatheke-includes.patch; - configureFlags = - [ - "--without-conf" - "--enable-tests=no" - ] - ++ (lib.optionals stdenv.hostPlatform.isWindows [ - "--with-xz" - "--with-bzip2" - "--with-icuregex" - ]); + configureFlags = [ + "--without-conf" + "--enable-tests=no" + ] + ++ (lib.optionals stdenv.hostPlatform.isWindows [ + "--with-xz" + "--with-bzip2" + "--with-icuregex" + ]); makeFlags = lib.optionals stdenv.hostPlatform.isWindows [ "LDFLAGS=-no-undefined" diff --git a/pkgs/by-name/sw/swtpm/package.nix b/pkgs/by-name/sw/swtpm/package.nix index ffb469c8dc52..cf431cc7971c 100644 --- a/pkgs/by-name/sw/swtpm/package.nix +++ b/pkgs/by-name/sw/swtpm/package.nix @@ -59,27 +59,25 @@ stdenv.mkDerivation (finalAttrs: { which ]; - buildInputs = - [ - libtpms - openssl - libtasn1 - glib - json-glib - gnutls - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - fuse - libseccomp - ]; + buildInputs = [ + libtpms + openssl + libtasn1 + glib + json-glib + gnutls + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + fuse + libseccomp + ]; - configureFlags = - [ - "--localstatedir=/var" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--with-cuse" - ]; + configureFlags = [ + "--localstatedir=/var" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--with-cuse" + ]; postPatch = '' patchShebangs tests/* diff --git a/pkgs/by-name/sy/sylpheed/package.nix b/pkgs/by-name/sy/sylpheed/package.nix index 9ead50540ca4..846ad5369a71 100644 --- a/pkgs/by-name/sy/sylpheed/package.nix +++ b/pkgs/by-name/sy/sylpheed/package.nix @@ -45,8 +45,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ gtk2 ] ++ lib.optionals gpgSupport [ gpgme ] ++ lib.optionals sslSupport [ openssl ]; + buildInputs = [ + gtk2 + ] + ++ lib.optionals gpgSupport [ gpgme ] + ++ lib.optionals sslSupport [ openssl ]; configureFlags = lib.optional gpgSupport "--enable-gpgme" ++ lib.optional sslSupport "--enable-ssl"; diff --git a/pkgs/by-name/sy/symengine/package.nix b/pkgs/by-name/sy/symengine/package.nix index 4764d76e69ae..9aaf8cde4269 100644 --- a/pkgs/by-name/sy/symengine/package.nix +++ b/pkgs/by-name/sy/symengine/package.nix @@ -30,21 +30,20 @@ stdenv.mkDerivation rec { libmpc ]; - cmakeFlags = - [ - "-DWITH_FLINT=ON" - "-DINTEGER_CLASS=flint" - "-DWITH_SYMENGINE_THREAD_SAFE=yes" - "-DWITH_MPC=yes" - "-DBUILD_FOR_DISTRIBUTION=yes" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not? - "-DBUILD_TESTS=OFF" - ] - ++ lib.optionals withShared [ - "-DBUILD_SHARED_LIBS=ON" - ]; + cmakeFlags = [ + "-DWITH_FLINT=ON" + "-DINTEGER_CLASS=flint" + "-DWITH_SYMENGINE_THREAD_SAFE=yes" + "-DWITH_MPC=yes" + "-DBUILD_FOR_DISTRIBUTION=yes" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # error: unrecognized instruction mnemonic, did you mean: bit, cnt, hint, ins, not? + "-DBUILD_TESTS=OFF" + ] + ++ lib.optionals withShared [ + "-DBUILD_SHARED_LIBS=ON" + ]; doCheck = true; diff --git a/pkgs/by-name/sy/sympow/package.nix b/pkgs/by-name/sy/sympow/package.nix index fdad80dfed73..f12c557566f8 100644 --- a/pkgs/by-name/sy/sympow/package.nix +++ b/pkgs/by-name/sy/sympow/package.nix @@ -59,17 +59,16 @@ stdenv.mkDerivation rec { # Example from the README as a sanity check. doInstallCheck = true; - installCheckPhase = - '' - export HOME=$TMPDIR - "$out/bin/sympow" -curve "[1,2,3,4,5]" -moddeg | grep 'Modular Degree is 464' - echo "[1,-1,0,-79,289]" | "$out/bin/sympow" -analrank | grep ^"Analytic Rank is 4" - "$out/bin/sympow" -curve "[1,-1,0,-79,289]" -analrank | grep ^"Analytic Rank is 4" - "$out/bin/sympow" -curve "[0,1,1,-2,0]" -analrank | grep ^"Analytic Rank is 2" - '' - + lib.optionalString (!stdenv.hostPlatform.isAarch64) '' - "$out/bin/sympow" -sp 2p16 -curve "[1,2,3,4,5]" | grep '8.3705' - ''; + installCheckPhase = '' + export HOME=$TMPDIR + "$out/bin/sympow" -curve "[1,2,3,4,5]" -moddeg | grep 'Modular Degree is 464' + echo "[1,-1,0,-79,289]" | "$out/bin/sympow" -analrank | grep ^"Analytic Rank is 4" + "$out/bin/sympow" -curve "[1,-1,0,-79,289]" -analrank | grep ^"Analytic Rank is 4" + "$out/bin/sympow" -curve "[0,1,1,-2,0]" -analrank | grep ^"Analytic Rank is 2" + '' + + lib.optionalString (!stdenv.hostPlatform.isAarch64) '' + "$out/bin/sympow" -sp 2p16 -curve "[1,2,3,4,5]" | grep '8.3705' + ''; meta = { description = "Compute special values of symmetric power elliptic curve L-functions"; diff --git a/pkgs/by-name/sy/syncterm/package.nix b/pkgs/by-name/sy/syncterm/package.nix index 42673516194a..5699d00bd206 100644 --- a/pkgs/by-name/sy/syncterm/package.nix +++ b/pkgs/by-name/sy/syncterm/package.nix @@ -24,17 +24,16 @@ stdenv.mkDerivation rec { # We can't use sourceRoot, as the cherry-picked patches apply to files outside of it. postPatch = ''cd src/syncterm''; - CFLAGS = - [ - "-DHAS_INTTYPES_H" - "-DXPDEV_DONT_DEFINE_INTTYPES" + CFLAGS = [ + "-DHAS_INTTYPES_H" + "-DXPDEV_DONT_DEFINE_INTTYPES" - "-Wno-unused-result" - "-Wformat-overflow=0" - ] - ++ (lib.optionals stdenv.hostPlatform.isLinux [ - "-DUSE_ALSA_SOUND" # Don't use OSS for beeps. - ]); + "-Wno-unused-result" + "-Wformat-overflow=0" + ] + ++ (lib.optionals stdenv.hostPlatform.isLinux [ + "-DUSE_ALSA_SOUND" # Don't use OSS for beeps. + ]); makeFlags = [ "PREFIX=$(out)" @@ -53,7 +52,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses SDL2 - ] ++ (lib.optional stdenv.hostPlatform.isLinux alsa-lib); + ] + ++ (lib.optional stdenv.hostPlatform.isLinux alsa-lib); runtimeDependencies = [ ncurses SDL2 diff --git a/pkgs/by-name/sy/syndication-domination/package.nix b/pkgs/by-name/sy/syndication-domination/package.nix index 6bb68402dc95..623fece22618 100644 --- a/pkgs/by-name/sy/syndication-domination/package.nix +++ b/pkgs/by-name/sy/syndication-domination/package.nix @@ -30,16 +30,15 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - pugixml - fmt - html-tidy - ] - ++ lib.optionals enablePython [ - python3Packages.python - python3Packages.pybind11 - ]; + buildInputs = [ + pugixml + fmt + html-tidy + ] + ++ lib.optionals enablePython [ + python3Packages.python + python3Packages.pybind11 + ]; mesonFlags = [ (lib.mesonBool "TO_JSON_BINARY" true) diff --git a/pkgs/by-name/sy/synfigstudio/package.nix b/pkgs/by-name/sy/synfigstudio/package.nix index 1305449b2c69..ca1b26f38029 100644 --- a/pkgs/by-name/sy/synfigstudio/package.nix +++ b/pkgs/by-name/sy/synfigstudio/package.nix @@ -57,16 +57,15 @@ let sourceRoot = "${src.name}/synfig-core"; - configureFlags = - [ - "--with-boost=${boost.dev}" - "--with-boost-libdir=${boost.out}/lib" - ] - ++ lib.optionals stdenv.cc.isClang [ - # Newer versions of clang default to C++17, but synfig and some of its dependencies use deprecated APIs that - # are removed in C++17. Setting the language version to C++14 allows it to build. - "CXXFLAGS=-std=c++14" - ]; + configureFlags = [ + "--with-boost=${boost.dev}" + "--with-boost-libdir=${boost.out}/lib" + ] + ++ lib.optionals stdenv.cc.isClang [ + # Newer versions of clang default to C++17, but synfig and some of its dependencies use deprecated APIs that + # are removed in C++17. Setting the language version to C++14 allows it to build. + "CXXFLAGS=-std=c++14" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/sy/sysbench/package.nix b/pkgs/by-name/sy/sysbench/package.nix index 972d9a6337d8..5a247d3bc4c9 100644 --- a/pkgs/by-name/sy/sysbench/package.nix +++ b/pkgs/by-name/sy/sysbench/package.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { buildInputs = [ libmysqlclient luajit - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libaio ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libaio ]; depsBuildBuild = [ pkg-config ]; src = fetchFromGitHub { diff --git a/pkgs/by-name/sy/syslinux/package.nix b/pkgs/by-name/sy/syslinux/package.nix index 62a013f41394..a77d8f66a2c0 100644 --- a/pkgs/by-name/sy/syslinux/package.nix +++ b/pkgs/by-name/sy/syslinux/package.nix @@ -100,29 +100,28 @@ stdenv.mkDerivation { # `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here env.NIX_CFLAGS_COMPILE = "-fcommon"; - makeFlags = - [ - "BINDIR=$(out)/bin" - "SBINDIR=$(out)/sbin" - "DATADIR=$(out)/share" - "MANDIR=$(out)/share/man" - "PERL=perl" - "HEXDATE=0x00000000" - # Works around confusing (unrelated) error messages when upx is not made available - "UPX=false" + makeFlags = [ + "BINDIR=$(out)/bin" + "SBINDIR=$(out)/sbin" + "DATADIR=$(out)/share" + "MANDIR=$(out)/share/man" + "PERL=perl" + "HEXDATE=0x00000000" + # Works around confusing (unrelated) error messages when upx is not made available + "UPX=false" - # Configurations needed to make use of external gnu-efi - "LIBEFI=${gnu-efi}/lib/libefi.a" - "LIBDIR=${gnu-efi}/lib/" - "EFIINC=${gnu-efi}/include/efi" + # Configurations needed to make use of external gnu-efi + "LIBEFI=${gnu-efi}/lib/libefi.a" + "LIBDIR=${gnu-efi}/lib/" + "EFIINC=${gnu-efi}/include/efi" - # Legacy bios boot target is always built - "bios" - ] - # Build "ia32" EFI for i686 - ++ lib.optional stdenv.hostPlatform.isi686 "efi32" - # Build "x86_64" EFI for x86_64 - ++ lib.optional stdenv.hostPlatform.isx86_64 "efi64"; + # Legacy bios boot target is always built + "bios" + ] + # Build "ia32" EFI for i686 + ++ lib.optional stdenv.hostPlatform.isi686 "efi32" + # Build "x86_64" EFI for x86_64 + ++ lib.optional stdenv.hostPlatform.isx86_64 "efi64"; # Some tests require qemu, some others fail in a sandboxed environment doCheck = false; diff --git a/pkgs/by-name/sy/syslogng/package.nix b/pkgs/by-name/sy/syslogng/package.nix index f16d1f3bbef0..42ce49b68309 100644 --- a/pkgs/by-name/sy/syslogng/package.nix +++ b/pkgs/by-name/sy/syslogng/package.nix @@ -88,33 +88,32 @@ stdenv.mkDerivation (finalAttrs: { python3Packages.setuptools ]; - buildInputs = - [ - libcap - curl - openssl - eventlog - glib - py - systemd - riemann_c_client - protobufc - libnet - json_c - libuuid - libivykis - mongoc - rabbitmq-c - libesmtp - pcre2 - paho-mqtt-c - hiredis - rdkafka - ] - ++ (lib.optionals withGrpc [ - protobuf_29 - grpc - ]); + buildInputs = [ + libcap + curl + openssl + eventlog + glib + py + systemd + riemann_c_client + protobufc + libnet + json_c + libuuid + libivykis + mongoc + rabbitmq-c + libesmtp + pcre2 + paho-mqtt-c + hiredis + rdkafka + ] + ++ (lib.optionals withGrpc [ + protobuf_29 + grpc + ]); configureFlags = [ "--enable-manpages" @@ -131,7 +130,8 @@ stdenv.mkDerivation (finalAttrs: { "--with-systemd-journal=system" "--with-systemdsystemunitdir=$(out)/etc/systemd/system" "--without-compile-date" - ] ++ (lib.optionals withGrpc [ "--enable-grpc" ]); + ] + ++ (lib.optionals withGrpc [ "--enable-grpc" ]); outputs = [ "out" diff --git a/pkgs/by-name/sy/systemd-netlogd/package.nix b/pkgs/by-name/sy/systemd-netlogd/package.nix index 6c5a67893114..8c2ae7f72433 100644 --- a/pkgs/by-name/sy/systemd-netlogd/package.nix +++ b/pkgs/by-name/sy/systemd-netlogd/package.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libcap systemdLibs - ] ++ lib.optional opensslSupport openssl; + ] + ++ lib.optional opensslSupport openssl; mesonFlags = [ "--sysconfdir=${placeholder "out"}/etc/systemd" @@ -70,13 +71,12 @@ stdenv.mkDerivation (finalAttrs: { passthru = { # Make sure x86_64-linux -> aarch64-linux cross compilation works - tests = - { - version = testers.testVersion { package = finalAttrs.finalPackage; }; - } - // lib.optionalAttrs (stdenv.buildPlatform.system == "x86_64-linux") { - aarch64-cross = pkgsCross.aarch64-multiplatform.systemd-netlogd; - }; + tests = { + version = testers.testVersion { package = finalAttrs.finalPackage; }; + } + // lib.optionalAttrs (stdenv.buildPlatform.system == "x86_64-linux") { + aarch64-cross = pkgsCross.aarch64-multiplatform.systemd-netlogd; + }; updateScript = nix-update-script { }; }; diff --git a/pkgs/by-name/sy/sysvinit/package.nix b/pkgs/by-name/sy/sysvinit/package.nix index 546187c7a314..6eff2d095a32 100644 --- a/pkgs/by-name/sy/sysvinit/package.nix +++ b/pkgs/by-name/sy/sysvinit/package.nix @@ -32,19 +32,18 @@ stdenv.mkDerivation rec { substituteInPlace src/Makefile --replace /usr / ''; - postInstall = - '' - mv $out/sbin/killall5 $out/bin - ln -sf killall5 $out/bin/pidof - '' - + lib.optionalString withoutInitTools '' - shopt -s extglob - rm -rf $out/sbin/!(sulogin) - rm -rf $out/include - rm -rf $out/share/man/man5 - rm $(for i in $out/share/man/man8/*; do echo $i; done | grep -v 'pidof\|killall5') - rm $out/bin/wall $out/share/man/man1/wall.1 - ''; + postInstall = '' + mv $out/sbin/killall5 $out/bin + ln -sf killall5 $out/bin/pidof + '' + + lib.optionalString withoutInitTools '' + shopt -s extglob + rm -rf $out/sbin/!(sulogin) + rm -rf $out/include + rm -rf $out/share/man/man5 + rm $(for i in $out/share/man/man8/*; do echo $i; done | grep -v 'pidof\|killall5') + rm $out/bin/wall $out/share/man/man1/wall.1 + ''; meta = { homepage = "https://www.nongnu.org/sysvinit/"; diff --git a/pkgs/by-name/t-/t-rec/package.nix b/pkgs/by-name/t-/t-rec/package.nix index b9b13483c7f5..2991767287b5 100644 --- a/pkgs/by-name/t-/t-rec/package.nix +++ b/pkgs/by-name/t-/t-rec/package.nix @@ -24,11 +24,12 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-AgSYM2a9XGH2X4dcp5CSMnt0Bq/5XT8C3g1R2UX4mLY="; nativeBuildInputs = [ makeWrapper ]; - buildInputs = - [ imagemagick ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + imagemagick + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; postInstall = '' wrapProgram "$out/bin/t-rec" --prefix PATH : "${ diff --git a/pkgs/by-name/ta/tabby/package.nix b/pkgs/by-name/ta/tabby/package.nix index 81e976ca3898..013580e5d9e1 100644 --- a/pkgs/by-name/ta/tabby/package.nix +++ b/pkgs/by-name/ta/tabby/package.nix @@ -103,11 +103,12 @@ let }; # TODO(ghthor): some of this can be removed - darwinBuildInputs = - [ llamaccpPackage ] - ++ optionals stdenv.hostPlatform.isDarwin ([ - apple-sdk_15 - ]); + darwinBuildInputs = [ + llamaccpPackage + ] + ++ optionals stdenv.hostPlatform.isDarwin ([ + apple-sdk_15 + ]); cudaBuildInputs = [ llamaccpPackage ]; rocmBuildInputs = [ llamaccpPackage ]; @@ -144,22 +145,22 @@ rustPlatform.buildRustPackage { versionCheckProgramArg = "--version"; doInstallCheck = true; - nativeBuildInputs = - [ - git - pkg-config - protobuf - cmake - ] - ++ optionals enableCuda [ - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + git + pkg-config + protobuf + cmake + ] + ++ optionals enableCuda [ + autoAddDriverRunpath + ]; - buildInputs = - [ openssl ] - ++ optionals stdenv.hostPlatform.isDarwin darwinBuildInputs - ++ optionals enableCuda cudaBuildInputs - ++ optionals enableRocm rocmBuildInputs; + buildInputs = [ + openssl + ] + ++ optionals stdenv.hostPlatform.isDarwin darwinBuildInputs + ++ optionals enableCuda cudaBuildInputs + ++ optionals enableRocm rocmBuildInputs; postInstall = '' # NOTE: Project contains a subproject for building llama-server diff --git a/pkgs/by-name/ta/tacacsplus/package.nix b/pkgs/by-name/ta/tacacsplus/package.nix index 9ab2eeeca8b6..64fdee724675 100644 --- a/pkgs/by-name/ta/tacacsplus/package.nix +++ b/pkgs/by-name/ta/tacacsplus/package.nix @@ -24,14 +24,13 @@ stdenv.mkDerivation rec { flex bison ]; - buildInputs = - [ - perl - libnsl - ] - ++ lib.optionals withLibWrap [ - tcp_wrappers - ]; + buildInputs = [ + perl + libnsl + ] + ++ lib.optionals withLibWrap [ + tcp_wrappers + ]; configureFlags = lib.optionals (!withLibWrap) [ "--with-libwrap=no" diff --git a/pkgs/by-name/ta/tachyon/package.nix b/pkgs/by-name/ta/tachyon/package.nix index 0cf61be8d384..d07433e3014e 100644 --- a/pkgs/by-name/ta/tachyon/package.nix +++ b/pkgs/by-name/ta/tachyon/package.nix @@ -22,18 +22,17 @@ stdenv.mkDerivation rec { ++ lib.optionals withPngSupport [ libpng ]; - preBuild = - '' - cd unix - '' - + lib.optionalString withJpegSupport '' - export USEJPEG=" -DUSEJPEG" - export JPEGLIB=" -ljpeg" - '' - + lib.optionalString withPngSupport '' - export USEPNG=" -DUSEPNG" - export PNGLIB=" -lpng -lz" - ''; + preBuild = '' + cd unix + '' + + lib.optionalString withJpegSupport '' + export USEJPEG=" -DUSEJPEG" + export JPEGLIB=" -ljpeg" + '' + + lib.optionalString withPngSupport '' + export USEPNG=" -DUSEPNG" + export PNGLIB=" -lpng -lz" + ''; arch = if stdenv.hostPlatform.system == "x86_64-linux" then "linux-64-thr" diff --git a/pkgs/by-name/ta/taco/package.nix b/pkgs/by-name/ta/taco/package.nix index e80d2b7e3b1b..5cf747348056 100644 --- a/pkgs/by-name/ta/taco/package.nix +++ b/pkgs/by-name/ta/taco/package.nix @@ -50,7 +50,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DOPENMP=ON" - ] ++ lib.optional enablePython "-DPYTHON=ON"; + ] + ++ lib.optional enablePython "-DPYTHON=ON"; postInstall = lib.strings.optionalString enablePython '' mkdir -p $out/${python.sitePackages} diff --git a/pkgs/by-name/ta/tailscale/package.nix b/pkgs/by-name/ta/tailscale/package.nix index 7b82086cd586..58f7e7d0b6e8 100644 --- a/pkgs/by-name/ta/tailscale/package.nix +++ b/pkgs/by-name/ta/tailscale/package.nix @@ -103,110 +103,108 @@ buildGoModule { checkFlags = let - skippedTests = - [ - # dislikes vendoring - "TestPackageDocs" # . - # tries to start tailscaled - "TestContainerBoot" # cmd/containerboot + skippedTests = [ + # dislikes vendoring + "TestPackageDocs" # . + # tries to start tailscaled + "TestContainerBoot" # cmd/containerboot - # just part of a tool which generates yaml for k8s CRDs - # requires helm - "Test_generate" # cmd/k8s-operator/generate - # self reported potentially flakey test - "TestConnMemoryOverhead" # control/controlbase + # just part of a tool which generates yaml for k8s CRDs + # requires helm + "Test_generate" # cmd/k8s-operator/generate + # self reported potentially flakey test + "TestConnMemoryOverhead" # control/controlbase - # interacts with `/proc/net/route` and need a default route - "TestDefaultRouteInterface" # net/netmon - "TestRouteLinuxNetlink" # net/netmon - "TestGetRouteTable" # net/routetable + # interacts with `/proc/net/route` and need a default route + "TestDefaultRouteInterface" # net/netmon + "TestRouteLinuxNetlink" # net/netmon + "TestGetRouteTable" # net/routetable - # remote udp call to 8.8.8.8 - "TestDefaultInterfacePortable" # net/netutil + # remote udp call to 8.8.8.8 + "TestDefaultInterfacePortable" # net/netutil - # launches an ssh server which works when provided openssh - # also requires executing commands but nixbld user has /noshell - "TestSSH" # ssh/tailssh - # wants users alice & ubuntu - "TestMultipleRecorders" # ssh/tailssh - "TestSSHAuthFlow" # ssh/tailssh - "TestSSHRecordingCancelsSessionsOnUploadFailure" # ssh/tailssh - "TestSSHRecordingNonInteractive" # ssh/tailssh + # launches an ssh server which works when provided openssh + # also requires executing commands but nixbld user has /noshell + "TestSSH" # ssh/tailssh + # wants users alice & ubuntu + "TestMultipleRecorders" # ssh/tailssh + "TestSSHAuthFlow" # ssh/tailssh + "TestSSHRecordingCancelsSessionsOnUploadFailure" # ssh/tailssh + "TestSSHRecordingNonInteractive" # ssh/tailssh - # test for a dev util which helps to fork golang.org/x/crypto/acme - # not necessary and fails to match - "TestSyncedToUpstream" # tempfork/acme + # test for a dev util which helps to fork golang.org/x/crypto/acme + # not necessary and fails to match + "TestSyncedToUpstream" # tempfork/acme - # flaky: https://github.com/tailscale/tailscale/issues/7030 - "TestConcurrent" + # flaky: https://github.com/tailscale/tailscale/issues/7030 + "TestConcurrent" - # flaky: https://github.com/tailscale/tailscale/issues/11762 - "TestTwoDevicePing" + # flaky: https://github.com/tailscale/tailscale/issues/11762 + "TestTwoDevicePing" - # timeout 10m - "TestTaildropIntegration" - "TestTaildropIntegration_Fresh" + # timeout 10m + "TestTaildropIntegration" + "TestTaildropIntegration_Fresh" - # context deadline exceeded - "TestPacketFilterFromNetmap" + # context deadline exceeded + "TestPacketFilterFromNetmap" - # flaky: https://github.com/tailscale/tailscale/issues/15348 - "TestSafeFuncHappyPath" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # syscall default route interface en0 differs from netstat - "TestLikelyHomeRouterIPSyscallExec" # net/netmon + # flaky: https://github.com/tailscale/tailscale/issues/15348 + "TestSafeFuncHappyPath" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # syscall default route interface en0 differs from netstat + "TestLikelyHomeRouterIPSyscallExec" # net/netmon - # Even with __darwinAllowLocalNetworking this doesn't work. - # panic: write udp [::]:59507->127.0.0.1:50830: sendto: operation not permitted - "TestUDP" # net/socks5 + # Even with __darwinAllowLocalNetworking this doesn't work. + # panic: write udp [::]:59507->127.0.0.1:50830: sendto: operation not permitted + "TestUDP" # net/socks5 - # portlist_test.go:81: didn't find ephemeral port in p2 53643 - "TestPoller" # portlist + # portlist_test.go:81: didn't find ephemeral port in p2 53643 + "TestPoller" # portlist - # Fails only on Darwin, succeeds on other tested platforms. - "TestOnTailnetDefaultAutoUpdate" - ]; + # Fails only on Darwin, succeeds on other tested platforms. + "TestOnTailnetDefaultAutoUpdate" + ]; in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; - postInstall = - '' - ln -s $out/bin/tailscaled $out/bin/tailscale - moveToOutput "bin/derper" "$derper" - moveToOutput "bin/derpprobe" "$derper" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - wrapProgram $out/bin/tailscaled \ - --prefix PATH : ${ - lib.makeBinPath [ - # Uses lsof only on macOS to detect socket location - # See tailscale safesocket_darwin.go - lsof - ] - } - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/tailscaled \ - --prefix PATH : ${ - lib.makeBinPath [ - getent - iproute2 - iptables - shadow - ] - } \ - --suffix PATH : ${lib.makeBinPath [ procps ]} - sed -i -e "s#/usr/sbin#$out/bin#" -e "/^EnvironmentFile/d" ./cmd/tailscaled/tailscaled.service - install -D -m0444 -t $out/lib/systemd/system ./cmd/tailscaled/tailscaled.service - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - local INSTALL="$out/bin/tailscale" - installShellCompletion --cmd tailscale \ - --bash <($out/bin/tailscale completion bash) \ - --fish <($out/bin/tailscale completion fish) \ - --zsh <($out/bin/tailscale completion zsh) - ''; + postInstall = '' + ln -s $out/bin/tailscaled $out/bin/tailscale + moveToOutput "bin/derper" "$derper" + moveToOutput "bin/derpprobe" "$derper" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + wrapProgram $out/bin/tailscaled \ + --prefix PATH : ${ + lib.makeBinPath [ + # Uses lsof only on macOS to detect socket location + # See tailscale safesocket_darwin.go + lsof + ] + } + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram $out/bin/tailscaled \ + --prefix PATH : ${ + lib.makeBinPath [ + getent + iproute2 + iptables + shadow + ] + } \ + --suffix PATH : ${lib.makeBinPath [ procps ]} + sed -i -e "s#/usr/sbin#$out/bin#" -e "/^EnvironmentFile/d" ./cmd/tailscaled/tailscaled.service + install -D -m0444 -t $out/lib/systemd/system ./cmd/tailscaled/tailscaled.service + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + local INSTALL="$out/bin/tailscale" + installShellCompletion --cmd tailscale \ + --bash <($out/bin/tailscale completion bash) \ + --fish <($out/bin/tailscale completion fish) \ + --zsh <($out/bin/tailscale completion zsh) + ''; passthru.tests = { inherit (nixosTests) headscale; diff --git a/pkgs/by-name/ta/taisei/package.nix b/pkgs/by-name/ta/taisei/package.nix index 452fbf04d0db..ffbfce310b4e 100644 --- a/pkgs/by-name/ta/taisei/package.nix +++ b/pkgs/by-name/ta/taisei/package.nix @@ -66,7 +66,8 @@ stdenv.mkDerivation (finalAttrs: { opusfile openssl spirv-cross - ] ++ lib.optional gamemodeSupport gamemode; + ] + ++ lib.optional gamemodeSupport gamemode; mesonFlags = [ (lib.mesonBool "b_lto" false) diff --git a/pkgs/by-name/ta/talloc/package.nix b/pkgs/by-name/ta/talloc/package.nix index 6dc4fe54aef8..f76588c4d1b1 100644 --- a/pkgs/by-name/ta/talloc/package.nix +++ b/pkgs/by-name/ta/talloc/package.nix @@ -23,17 +23,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-3EbEC59GuzTdl/5B9Uiw6LJHt3qRhXZzPFKOg6vYVN0="; }; - nativeBuildInputs = - [ - pkg-config - python3 - wafHook - docbook-xsl-nons - docbook_xml_dtd_42 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + pkg-config + python3 + wafHook + docbook-xsl-nons + docbook_xml_dtd_42 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; buildInputs = [ python3 @@ -51,16 +50,15 @@ stdenv.mkDerivation rec { wafPath = "buildtools/bin/waf"; - wafConfigureFlags = - [ - "--enable-talloc-compat1" - "--bundled-libraries=NONE" - "--builtin-libraries=replace" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--cross-compile" - "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" - ]; + wafConfigureFlags = [ + "--enable-talloc-compat1" + "--bundled-libraries=NONE" + "--builtin-libraries=replace" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--cross-compile" + "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" + ]; # python-config from build Python gives incorrect values when cross-compiling. # If python-config is not found, the build falls back to using the sysconfig diff --git a/pkgs/by-name/ta/tangram/package.nix b/pkgs/by-name/ta/tangram/package.nix index 07d98d5887d9..0239dd78c72b 100644 --- a/pkgs/by-name/ta/tangram/package.nix +++ b/pkgs/by-name/ta/tangram/package.nix @@ -51,24 +51,23 @@ stdenv.mkDerivation rec { wrapGAppsHook4 ]; - buildInputs = - [ - gdk-pixbuf - gjs - glib - glib-networking - gsettings-desktop-schemas - gtk4 - libadwaita - webkitgtk_6_0 - ] - ++ (with gst_all_1; [ - gstreamer - gst-libav - gst-plugins-base - (gst-plugins-good.override { gtkSupport = true; }) - gst-plugins-bad - ]); + buildInputs = [ + gdk-pixbuf + gjs + glib + glib-networking + gsettings-desktop-schemas + gtk4 + libadwaita + webkitgtk_6_0 + ] + ++ (with gst_all_1; [ + gstreamer + gst-libav + gst-plugins-base + (gst-plugins-good.override { gtkSupport = true; }) + gst-plugins-bad + ]); dontPatchShebangs = true; diff --git a/pkgs/by-name/ta/tarsnap/package.nix b/pkgs/by-name/ta/tarsnap/package.nix index 0fbf2f95fe46..10a64fa7a591 100644 --- a/pkgs/by-name/ta/tarsnap/package.nix +++ b/pkgs/by-name/ta/tarsnap/package.nix @@ -51,13 +51,12 @@ stdenv.mkDerivation rec { installShellFiles ]; - buildInputs = - [ - openssl - zlib - ] - ++ lib.optional stdenv.hostPlatform.isLinux e2fsprogs - ++ lib.optional stdenv.hostPlatform.isDarwin bzip2; + buildInputs = [ + openssl + zlib + ] + ++ lib.optional stdenv.hostPlatform.isLinux e2fsprogs + ++ lib.optional stdenv.hostPlatform.isDarwin bzip2; meta = { description = "Online backups for the truly paranoid"; diff --git a/pkgs/by-name/ta/taskopen/package.nix b/pkgs/by-name/ta/taskopen/package.nix index 8507256139e9..a44e9b46942f 100644 --- a/pkgs/by-name/ta/taskopen/package.nix +++ b/pkgs/by-name/ta/taskopen/package.nix @@ -26,12 +26,13 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ makeWrapper ]; - buildInputs = - [ which ] - ++ (with perlPackages; [ - JSON - perl - ]); + buildInputs = [ + which + ] + ++ (with perlPackages; [ + JSON + perl + ]); installPhase = '' make PREFIX=$out diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix index b9265b199a65..0224cbe2d8aa 100644 --- a/pkgs/by-name/ta/taskwarrior3/package.nix +++ b/pkgs/by-name/ta/taskwarrior3/package.nix @@ -54,14 +54,13 @@ stdenv.mkDerivation (finalAttrs: { "bash_completion.test.py" ]; # Contains Bash and Python scripts used while testing. - preConfigure = - '' - patchShebangs test - '' - + lib.optionalString (builtins.length finalAttrs.failingTests > 0) '' - substituteInPlace test/CMakeLists.txt \ - ${lib.concatMapStringsSep "\\\n " (t: "--replace-fail ${t} '' ") finalAttrs.failingTests} - ''; + preConfigure = '' + patchShebangs test + '' + + lib.optionalString (builtins.length finalAttrs.failingTests > 0) '' + substituteInPlace test/CMakeLists.txt \ + ${lib.concatMapStringsSep "\\\n " (t: "--replace-fail ${t} '' ") finalAttrs.failingTests} + ''; strictDeps = true; nativeBuildInputs = [ diff --git a/pkgs/by-name/ta/taterclient-ddnet/package.nix b/pkgs/by-name/ta/taterclient-ddnet/package.nix index 10ef97b24d46..0a7e6e89a81a 100644 --- a/pkgs/by-name/ta/taterclient-ddnet/package.nix +++ b/pkgs/by-name/ta/taterclient-ddnet/package.nix @@ -76,7 +76,8 @@ stdenv.mkDerivation (finalAttrs: { glslang spirv-tools glew - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 ]; strictDeps = true; diff --git a/pkgs/by-name/tc/tcpcrypt/package.nix b/pkgs/by-name/tc/tcpcrypt/package.nix index bf9552a1ee45..242522e17640 100644 --- a/pkgs/by-name/tc/tcpcrypt/package.nix +++ b/pkgs/by-name/tc/tcpcrypt/package.nix @@ -30,17 +30,16 @@ stdenv.mkDerivation rec { "out" ]; nativeBuildInputs = [ autoreconfHook ]; - buildInputs = - [ - openssl - libpcap - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - libnfnetlink - libnetfilter_conntrack - libnetfilter_queue - ]; + buildInputs = [ + openssl + libpcap + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + libnfnetlink + libnetfilter_conntrack + libnetfilter_queue + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/tc/tcpflow/package.nix b/pkgs/by-name/tc/tcpflow/package.nix index 23f26c6ef783..4328b56d9d7c 100644 --- a/pkgs/by-name/tc/tcpflow/package.nix +++ b/pkgs/by-name/tc/tcpflow/package.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { zlib libpcap boost - ] ++ lib.optional useCairo cairo; + ] + ++ lib.optional useCairo cairo; prePatch = '' substituteInPlace bootstrap.sh \ diff --git a/pkgs/by-name/td/tdb/package.nix b/pkgs/by-name/td/tdb/package.nix index 564f9775ab2a..7d45195b42e9 100644 --- a/pkgs/by-name/td/tdb/package.nix +++ b/pkgs/by-name/td/tdb/package.nix @@ -52,32 +52,30 @@ stdenv.mkDerivation rec { # otherwise the configure script fails with # PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make! - preConfigure = - '' - export PKGCONFIG="$PKG_CONFIG" - export PYTHONHASHSEED=1 - '' - + lib.optionalString needsAnswers '' - cp ${answers} answers - chmod +w answers - ''; + preConfigure = '' + export PKGCONFIG="$PKG_CONFIG" + export PYTHONHASHSEED=1 + '' + + lib.optionalString needsAnswers '' + cp ${answers} answers + chmod +w answers + ''; wafPath = "buildtools/bin/waf"; - wafConfigureFlags = - [ - "--bundled-libraries=NONE" - "--builtin-libraries=replace" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--cross-compile" - ( - if (stdenv.hostPlatform.emulatorAvailable buildPackages) then - "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" - else - "--cross-answers=answers" - ) - ]; + wafConfigureFlags = [ + "--bundled-libraries=NONE" + "--builtin-libraries=replace" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--cross-compile" + ( + if (stdenv.hostPlatform.emulatorAvailable buildPackages) then + "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" + else + "--cross-answers=answers" + ) + ]; postFixup = if stdenv.hostPlatform.isDarwin then diff --git a/pkgs/by-name/td/tdlib/package.nix b/pkgs/by-name/td/tdlib/package.nix index 4232c9d7eb7c..6e2261a4bc45 100644 --- a/pkgs/by-name/td/tdlib/package.nix +++ b/pkgs/by-name/td/tdlib/package.nix @@ -80,18 +80,17 @@ stdenv.mkDerivation { ]; # https://github.com/tdlib/td/issues/1974 - postPatch = - '' - substituteInPlace CMake/GeneratePkgConfig.cmake \ - --replace 'function(generate_pkgconfig' \ - 'include(GNUInstallDirs) - function(generate_pkgconfig' \ - --replace '\$'{prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ - --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' - sed -i "/vptr/d" test/CMakeLists.txt - ''; + postPatch = '' + substituteInPlace CMake/GeneratePkgConfig.cmake \ + --replace 'function(generate_pkgconfig' \ + 'include(GNUInstallDirs) + function(generate_pkgconfig' \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + sed -i "/vptr/d" test/CMakeLists.txt + ''; passthru.updateScript = lib.getExe updateScript; diff --git a/pkgs/by-name/te/teams-for-linux/package.nix b/pkgs/by-name/te/teams-for-linux/package.nix index e085cfb1220a..bc259cf2a778 100644 --- a/pkgs/by-name/te/teams-for-linux/package.nix +++ b/pkgs/by-name/te/teams-for-linux/package.nix @@ -30,7 +30,8 @@ buildNpmPackage rec { nativeBuildInputs = [ makeWrapper versionCheckHook - ] ++ lib.optionals (stdenv.hostPlatform.isLinux) [ copyDesktopItems ]; + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ copyDesktopItems ]; doInstallCheck = stdenv.hostPlatform.isLinux; @@ -42,66 +43,64 @@ buildNpmPackage rec { makeCacheWritable = true; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - cp -r ${electron_37.dist} electron-dist - chmod -R u+w electron-dist - '' - # Electron builder complains about symlink in electron-dist - + lib.optionalString stdenv.hostPlatform.isLinux '' - rm electron-dist/libvulkan.so.1 - cp ${lib.getLib vulkan-loader}/lib/libvulkan.so.1 electron-dist - '' - + '' + cp -r ${electron_37.dist} electron-dist + chmod -R u+w electron-dist + '' + # Electron builder complains about symlink in electron-dist + + lib.optionalString stdenv.hostPlatform.isLinux '' + rm electron-dist/libvulkan.so.1 + cp ${lib.getLib vulkan-loader}/lib/libvulkan.so.1 electron-dist + '' + + '' - npm exec electron-builder -- \ - --dir \ - -c.npmRebuild=true \ - -c.asarUnpack="**/*.node" \ - -c.electronDist=electron-dist \ - -c.electronVersion=${electron_37.version} + npm exec electron-builder -- \ + --dir \ + -c.npmRebuild=true \ + -c.asarUnpack="**/*.node" \ + -c.electronDist=electron-dist \ + -c.electronVersion=${electron_37.version} - runHook postBuild - ''; + runHook postBuild + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/share/{applications,teams-for-linux} - cp dist/*-unpacked/resources/app.asar $out/share/teams-for-linux/ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/share/{applications,teams-for-linux} + cp dist/*-unpacked/resources/app.asar $out/share/teams-for-linux/ - pushd build/icons - for image in *png; do - mkdir -p $out/share/icons/hicolor/''${image%.png}/apps - cp -r $image $out/share/icons/hicolor/''${image%.png}/apps/teams-for-linux.png - done - popd + pushd build/icons + for image in *png; do + mkdir -p $out/share/icons/hicolor/''${image%.png}/apps + cp -r $image $out/share/icons/hicolor/''${image%.png}/apps/teams-for-linux.png + done + popd - # Linux needs 'aplay' for notification sounds - makeWrapper '${lib.getExe electron_37}' "$out/bin/teams-for-linux" \ - --prefix PATH : ${ - lib.makeBinPath [ - alsa-utils - which - ] - } \ - --add-flags "$out/share/teams-for-linux/app.asar" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r dist/mac*/teams-for-linux.app $out/Applications - makeWrapper $out/Applications/teams-for-linux.app/Contents/MacOS/teams-for-linux $out/bin/teams-for-linux - '' - + '' + # Linux needs 'aplay' for notification sounds + makeWrapper '${lib.getExe electron_37}' "$out/bin/teams-for-linux" \ + --prefix PATH : ${ + lib.makeBinPath [ + alsa-utils + which + ] + } \ + --add-flags "$out/share/teams-for-linux/app.asar" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r dist/mac*/teams-for-linux.app $out/Applications + makeWrapper $out/Applications/teams-for-linux.app/Contents/MacOS/teams-for-linux $out/bin/teams-for-linux + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/te/teamspeak3/package.nix b/pkgs/by-name/te/teamspeak3/package.nix index 42c4c2c24f03..f717bc297e86 100644 --- a/pkgs/by-name/te/teamspeak3/package.nix +++ b/pkgs/by-name/te/teamspeak3/package.nix @@ -37,19 +37,18 @@ stdenv.mkDerivation rec { copyDesktopItems ]; - buildInputs = - [ - libsForQt5.quazip - glib - libcxx - ] - ++ (with qt5; [ - qtbase - qtwebengine - qtwebchannel - qtwebsockets - qtsvg - ]); + buildInputs = [ + libsForQt5.quazip + glib + libcxx + ] + ++ (with qt5; [ + qtbase + qtwebengine + qtwebchannel + qtwebsockets + qtsvg + ]); # This runs the installer script. If it gets stuck, run it with -x. # If it then gets stuck at something like: diff --git a/pkgs/by-name/te/tectonic-unwrapped/package.nix b/pkgs/by-name/te/tectonic-unwrapped/package.nix index cbbe465e781c..af1434de91e2 100644 --- a/pkgs/by-name/te/tectonic-unwrapped/package.nix +++ b/pkgs/by-name/te/tectonic-unwrapped/package.nix @@ -72,17 +72,16 @@ buildRustPackage rec { openssl ]; - postInstall = - '' - # Makes it possible to automatically use the V2 CLI API - ln -s $out/bin/tectonic $out/bin/nextonic - '' - + lib.optionalString clangStdenv.hostPlatform.isLinux '' - substituteInPlace dist/appimage/tectonic.desktop \ - --replace Exec=tectonic Exec=$out/bin/tectonic - install -D dist/appimage/tectonic.desktop -t $out/share/applications/ - install -D dist/appimage/tectonic.svg -t $out/share/icons/hicolor/scalable/apps/ - ''; + postInstall = '' + # Makes it possible to automatically use the V2 CLI API + ln -s $out/bin/tectonic $out/bin/nextonic + '' + + lib.optionalString clangStdenv.hostPlatform.isLinux '' + substituteInPlace dist/appimage/tectonic.desktop \ + --replace Exec=tectonic Exec=$out/bin/tectonic + install -D dist/appimage/tectonic.desktop -t $out/share/applications/ + install -D dist/appimage/tectonic.svg -t $out/share/icons/hicolor/scalable/apps/ + ''; doCheck = true; diff --git a/pkgs/by-name/te/tectonic/package.nix b/pkgs/by-name/te/tectonic/package.nix index 90080d277e43..0546bdc07dfe 100644 --- a/pkgs/by-name/te/tectonic/package.nix +++ b/pkgs/by-name/te/tectonic/package.nix @@ -28,30 +28,29 @@ symlinkJoin { }; # Replace the unwrapped tectonic with the one wrapping it with biber - postBuild = - '' - rm $out/bin/{tectonic,nextonic} - '' - # Pin the version of the online TeX bundle that Tectonic's developer - # distribute, so that the `biber` version and the `biblatex` version - # distributed from there are compatible. - # - # Upstream is updating it's online TeX bundle slower then - # https://github.com/plk/biber. That's why we match here the `bundleURL` - # version with that of `biber-for-tectonic`. See also upstream discussion: - # - # https://github.com/tectonic-typesetting/tectonic/discussions/1122 - # - # Hence, we can be rather confident that for the near future, the online - # TeX bundle won't be updated and hence the biblatex distributed there - # won't require a higher version of biber. - + '' - makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \ - --prefix PATH : "${lib.getBin biber-for-tectonic}/bin" \ - --add-flags "--web-bundle ${tectonic.passthru.bundleUrl}" \ - --inherit-argv0 ## make sure binary name e.g. `nextonic` is passed along - ln -s $out/bin/tectonic $out/bin/nextonic - ''; + postBuild = '' + rm $out/bin/{tectonic,nextonic} + '' + # Pin the version of the online TeX bundle that Tectonic's developer + # distribute, so that the `biber` version and the `biblatex` version + # distributed from there are compatible. + # + # Upstream is updating it's online TeX bundle slower then + # https://github.com/plk/biber. That's why we match here the `bundleURL` + # version with that of `biber-for-tectonic`. See also upstream discussion: + # + # https://github.com/tectonic-typesetting/tectonic/discussions/1122 + # + # Hence, we can be rather confident that for the near future, the online + # TeX bundle won't be updated and hence the biblatex distributed there + # won't require a higher version of biber. + + '' + makeWrapper ${lib.getBin tectonic-unwrapped}/bin/tectonic $out/bin/tectonic \ + --prefix PATH : "${lib.getBin biber-for-tectonic}/bin" \ + --add-flags "--web-bundle ${tectonic.passthru.bundleUrl}" \ + --inherit-argv0 ## make sure binary name e.g. `nextonic` is passed along + ln -s $out/bin/tectonic $out/bin/nextonic + ''; meta = tectonic-unwrapped.meta // { description = "Tectonic TeX/LaTeX engine, wrapped with a compatible biber"; diff --git a/pkgs/by-name/te/teeworlds/package.nix b/pkgs/by-name/te/teeworlds/package.nix index 6147fff6b7b0..2ed6cf0fb744 100644 --- a/pkgs/by-name/te/teeworlds/package.nix +++ b/pkgs/by-name/te/teeworlds/package.nix @@ -62,33 +62,31 @@ stdenv.mkDerivation rec { # don't seem to be packaged in Nixpkgs, so don't unbundle them. ''; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals (buildClient && stdenv.hostPlatform.isLinux) [ - icoutils - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals (buildClient && stdenv.hostPlatform.isLinux) [ + icoutils + ]; - buildInputs = + buildInputs = [ + python3 + lua5_3 + zlib + wavpack + ] + ++ lib.optionals buildClient ( [ - python3 - lua5_3 - zlib - wavpack + SDL2 + freetype ] - ++ lib.optionals buildClient ( - [ - SDL2 - freetype - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - alsa-lib - libX11 - ] - ); + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGLU + alsa-lib + libX11 + ] + ); cmakeFlags = [ "-DCLIENT=${if buildClient then "ON" else "OFF"}" diff --git a/pkgs/by-name/te/telegraf/package.nix b/pkgs/by-name/te/telegraf/package.nix index bc4d5f9039a1..6dcdf7a3e66d 100644 --- a/pkgs/by-name/te/telegraf/package.nix +++ b/pkgs/by-name/te/telegraf/package.nix @@ -31,15 +31,14 @@ buildGoModule rec { "-X=github.com/influxdata/telegraf/internal.Version=${version}" ]; - passthru.tests = - { - version = testers.testVersion { - package = telegraf; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit (nixosTests) telegraf; + passthru.tests = { + version = testers.testVersion { + package = telegraf; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit (nixosTests) telegraf; + }; meta = with lib; { description = "Plugin-driven server agent for collecting & reporting metrics"; diff --git a/pkgs/by-name/te/telepathy-mission-control/package.nix b/pkgs/by-name/te/telepathy-mission-control/package.nix index 616b138ffde8..e09780096df0 100644 --- a/pkgs/by-name/te/telepathy-mission-control/package.nix +++ b/pkgs/by-name/te/telepathy-mission-control/package.nix @@ -29,18 +29,17 @@ stdenv.mkDerivation rec { # TODO: optional build inputs missing - nativeBuildInputs = - [ - telepathy-glib # glib-genmarshal - pkg-config - python3 - libxslt - makeWrapper - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoreconfHook - gtk-doc - ]; + nativeBuildInputs = [ + telepathy-glib # glib-genmarshal + pkg-config + python3 + libxslt + makeWrapper + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoreconfHook + gtk-doc + ]; propagatedBuildInputs = [ telepathy-glib diff --git a/pkgs/by-name/te/teleport/package.nix b/pkgs/by-name/te/teleport/package.nix index 0058ebc0b571..dbfc47752571 100644 --- a/pkgs/by-name/te/teleport/package.nix +++ b/pkgs/by-name/te/teleport/package.nix @@ -135,7 +135,8 @@ buildGo123Module (finalAttrs: { tags = [ "libfido2" "webassets_embed" - ] ++ lib.optional withRdpClient "desktop_access_rdp"; + ] + ++ lib.optional withRdpClient "desktop_access_rdp"; buildInputs = [ openssl @@ -158,14 +159,13 @@ buildGo123Module (finalAttrs: { "client" ]; - preBuild = - '' - cp -r ${webassets} webassets - '' - + lib.optionalString withRdpClient '' - ln -s ${rdpClient}/lib/* lib/ - ln -s ${rdpClient}/include/* lib/srv/desktop/rdp/rdpclient/ - ''; + preBuild = '' + cp -r ${webassets} webassets + '' + + lib.optionalString withRdpClient '' + ln -s ${rdpClient}/lib/* lib/ + ln -s ${rdpClient}/include/* lib/srv/desktop/rdp/rdpclient/ + ''; # Multiple tests fail in the build sandbox # due to trying to spawn nixbld's shell (/noshell), etc. diff --git a/pkgs/by-name/te/tenacity/package.nix b/pkgs/by-name/te/tenacity/package.nix index b00c4655146f..f98250ed65f5 100644 --- a/pkgs/by-name/te/tenacity/package.nix +++ b/pkgs/by-name/te/tenacity/package.nix @@ -61,24 +61,23 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-2gndOwgEJK2zDSbjcZigbhEpGv301/ygrf+EQhKp8PI="; }; - postPatch = - '' - # GIT_DESCRIBE is used for the version string and can't be passed in - # as an option, so we substitute it instead. - substituteInPlace CMakeLists.txt \ - --replace-fail 'set( GIT_DESCRIBE "unknown" )' 'set( GIT_DESCRIBE "${finalAttrs.version}" )' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace libraries/lib-files/FileNames.cpp \ - --replace-fail /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Tenacity has special handling for ffmpeg library search on darwin, - # looking only in a few specific directories. - # Make sure it searches for our version of ffmpeg in the nix store. - substituteInPlace libraries/lib-ffmpeg-support/FFmpegFunctions.cpp \ - --replace-fail /usr/local/lib/tenacity ${lib.getLib ffmpeg}/lib - ''; + postPatch = '' + # GIT_DESCRIBE is used for the version string and can't be passed in + # as an option, so we substitute it instead. + substituteInPlace CMakeLists.txt \ + --replace-fail 'set( GIT_DESCRIBE "unknown" )' 'set( GIT_DESCRIBE "${finalAttrs.version}" )' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace libraries/lib-files/FileNames.cpp \ + --replace-fail /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Tenacity has special handling for ffmpeg library search on darwin, + # looking only in a few specific directories. + # Make sure it searches for our version of ffmpeg in the nix store. + substituteInPlace libraries/lib-ffmpeg-support/FFmpegFunctions.cpp \ + --replace-fail /usr/local/lib/tenacity ${lib.getLib ffmpeg}/lib + ''; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir $out/{bin,Applications} @@ -117,61 +116,59 @@ stdenv.mkDerivation (finalAttrs: { "-lswscale" ]); - nativeBuildInputs = - [ - cmake - ninja - gettext - pkg-config - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - makeWrapper - linuxHeaders - ]; + nativeBuildInputs = [ + cmake + ninja + gettext + pkg-config + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + makeWrapper + linuxHeaders + ]; - buildInputs = - [ - expat - ffmpeg - file - flac - glib - lame - libid3tag - libjack2 - libmad - libopus - libsndfile - libvorbis - lilv - lv2 - pcre - portaudio - serd - sord - soundtouch - soxr - sqlite - sratom - suil - twolame - wxGTK32 - gtk3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - at-spi2-core - dbus - libepoxy - libXdmcp - libXtst - libpthreadstubs - libxkbcommon - libselinux - libsepol - util-linux - ]; + buildInputs = [ + expat + ffmpeg + file + flac + glib + lame + libid3tag + libjack2 + libmad + libopus + libsndfile + libvorbis + lilv + lv2 + pcre + portaudio + serd + sord + soundtouch + soxr + sqlite + sratom + suil + twolame + wxGTK32 + gtk3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + at-spi2-core + dbus + libepoxy + libXdmcp + libXtst + libpthreadstubs + libxkbcommon + libselinux + libsepol + util-linux + ]; cmakeFlags = [ # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/ diff --git a/pkgs/by-name/te/tensorflow-lite/package.nix b/pkgs/by-name/te/tensorflow-lite/package.nix index 2c2556f7d4eb..26554df0709c 100644 --- a/pkgs/by-name/te/tensorflow-lite/package.nix +++ b/pkgs/by-name/te/tensorflow-lite/package.nix @@ -56,13 +56,12 @@ buildBazelPackage rec { "//tensorflow/lite/tools/benchmark:benchmark_model_performance_options" ]; - bazelFlags = - [ - "--config=opt" - ] - ++ lib.optionals (hostPlatform.system != buildPlatform.system) [ - "--config=${bazelHostConfigName.${hostPlatform.system}}" - ]; + bazelFlags = [ + "--config=opt" + ] + ++ lib.optionals (hostPlatform.system != buildPlatform.system) [ + "--config=${bazelHostConfigName.${hostPlatform.system}}" + ]; bazelBuildFlags = [ "--cxxopt=--std=c++17" ]; diff --git a/pkgs/by-name/te/terminal-typeracer/package.nix b/pkgs/by-name/te/terminal-typeracer/package.nix index 7e28bbda2b9d..abd461ef3e95 100644 --- a/pkgs/by-name/te/terminal-typeracer/package.nix +++ b/pkgs/by-name/te/terminal-typeracer/package.nix @@ -26,15 +26,14 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libgit2 - openssl - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + libgit2 + openssl + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; OPENSSL_NO_VENDOR = 1; LIBGIT2_NO_VENDOR = 1; diff --git a/pkgs/by-name/te/termscp/package.nix b/pkgs/by-name/te/termscp/package.nix index 0cc5c2c8159c..d44741b57e4b 100644 --- a/pkgs/by-name/te/termscp/package.nix +++ b/pkgs/by-name/te/termscp/package.nix @@ -44,18 +44,17 @@ rustPlatform.buildRustPackage rec { doInstallCheck = true; checkFeatures = [ "isolated-tests" ]; - checkFlags = - [ - # requires networking - "--skip=cli::remote::test::test_should_make_remote_args_from_one_bookmark_and_one_remote_with_local_dir" - "--skip=cli::remote::test::test_should_make_remote_args_from_two_bookmarks_and_local_dir" - "--skip=cli::remote::test::test_should_make_remote_args_from_two_remotes_and_local_dir" - ] - ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ - "--skip=system::watcher::test::should_poll_file_removed" - "--skip=system::watcher::test::should_poll_file_update" - "--skip=system::watcher::test::should_poll_nothing" - ]; + checkFlags = [ + # requires networking + "--skip=cli::remote::test::test_should_make_remote_args_from_one_bookmark_and_one_remote_with_local_dir" + "--skip=cli::remote::test::test_should_make_remote_args_from_two_bookmarks_and_local_dir" + "--skip=cli::remote::test::test_should_make_remote_args_from_two_remotes_and_local_dir" + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ + "--skip=system::watcher::test::should_poll_file_removed" + "--skip=system::watcher::test::should_poll_file_update" + "--skip=system::watcher::test::should_poll_nothing" + ]; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/te/termusic/package.nix b/pkgs/by-name/te/termusic/package.nix index e122fa72d67d..cbac6ff7ff17 100644 --- a/pkgs/by-name/te/termusic/package.nix +++ b/pkgs/by-name/te/termusic/package.nix @@ -36,18 +36,17 @@ rustPlatform.buildRustPackage rec { rustPlatform.bindgenHook ]; - buildInputs = - [ - dbus - glib - gst_all_1.gstreamer - mpv-unwrapped - openssl - sqlite - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ]; + buildInputs = [ + dbus + glib + gst_all_1.gstreamer + mpv-unwrapped + openssl + sqlite + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ]; meta = { description = "Terminal Music Player TUI written in Rust"; diff --git a/pkgs/by-name/te/terra/package.nix b/pkgs/by-name/te/terra/package.nix index 2d12834f7ce2..a34a0ea1421c 100644 --- a/pkgs/by-name/te/terra/package.nix +++ b/pkgs/by-name/te/terra/package.nix @@ -54,15 +54,14 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake ]; - buildInputs = - [ - llvmMerged - ncurses - libffi - libxml2 - ] - ++ lib.optionals enableCUDA [ cuda ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) libpfm; + buildInputs = [ + llvmMerged + ncurses + libffi + libxml2 + ] + ++ lib.optionals enableCUDA [ cuda ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) libpfm; cmakeFlags = let diff --git a/pkgs/by-name/te/test-drive/package.nix b/pkgs/by-name/te/test-drive/package.nix index 0d38269587a4..71c7634c8808 100644 --- a/pkgs/by-name/te/test-drive/package.nix +++ b/pkgs/by-name/te/test-drive/package.nix @@ -19,15 +19,14 @@ stdenv.mkDerivation rec { hash = "sha256-xRx8ErIN9xjxZt/nEsdIQkIGFRltuELdlI8lXA+M030="; }; - nativeBuildInputs = - [ - gfortran - meson - ninja - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + gfortran + meson + ninja + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; mesonAutoFeatures = "auto"; diff --git a/pkgs/by-name/te/tev/package.nix b/pkgs/by-name/te/tev/package.nix index 0be38b5c188b..0ee38b5cbafc 100644 --- a/pkgs/by-name/te/tev/package.nix +++ b/pkgs/by-name/te/tev/package.nix @@ -28,21 +28,20 @@ stdenv.mkDerivation rec { cmake wrapGAppsHook3 ]; - buildInputs = - [ - libX11 - libzip - glfw - libpng - ] - ++ (with xorg; [ - libXrandr - libXinerama - libXcursor - libXi - libXxf86vm - libXext - ]); + buildInputs = [ + libX11 + libzip + glfw + libpng + ] + ++ (with xorg; [ + libXrandr + libXinerama + libXcursor + libXi + libXxf86vm + libXext + ]); dontWrapGApps = true; # We also need zenity (see below) diff --git a/pkgs/by-name/te/tevent/package.nix b/pkgs/by-name/te/tevent/package.nix index 4800365b0c80..fae56a7545e7 100644 --- a/pkgs/by-name/te/tevent/package.nix +++ b/pkgs/by-name/te/tevent/package.nix @@ -52,15 +52,14 @@ stdenv.mkDerivation rec { wafPath = "buildtools/bin/waf"; - wafConfigureFlags = - [ - "--bundled-libraries=NONE" - "--builtin-libraries=replace" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--cross-compile" - "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" - ]; + wafConfigureFlags = [ + "--bundled-libraries=NONE" + "--builtin-libraries=replace" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--cross-compile" + "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" + ]; # python-config from build Python gives incorrect values when cross-compiling. # If python-config is not found, the build falls back to using the sysconfig diff --git a/pkgs/by-name/te/texstudio/package.nix b/pkgs/by-name/te/texstudio/package.nix index ba6b7be53876..8a4e6b39d86f 100644 --- a/pkgs/by-name/te/texstudio/package.nix +++ b/pkgs/by-name/te/texstudio/package.nix @@ -26,20 +26,19 @@ stdenv.mkDerivation (finalAttrs: { qt6.wrapQtAppsHook pkg-config ]; - buildInputs = - [ - hunspell - qt6.qt5compat - qt6.qtbase - qt6.qtsvg - qt6.qttools - qt6Packages.poppler - qt6Packages.quazip - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6.qtwayland - ]; + buildInputs = [ + hunspell + qt6.qt5compat + qt6.qtbase + qt6.qtsvg + qt6.qttools + qt6Packages.poppler + qt6Packages.quazip + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6.qtwayland + ]; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p "$out/Applications" diff --git a/pkgs/by-name/te/textadept/package.nix b/pkgs/by-name/te/textadept/package.nix index 44632c5797dd..c9e63785dae5 100644 --- a/pkgs/by-name/te/textadept/package.nix +++ b/pkgs/by-name/te/textadept/package.nix @@ -32,16 +32,15 @@ stdenv.mkDerivation (finalAttrs: { "-DQT=OFF" ]; - preConfigure = - '' - mkdir -p $PWD/build/_deps + preConfigure = '' + mkdir -p $PWD/build/_deps - '' - + lib.concatStringsSep "\n" ( - lib.mapAttrsToList ( - name: params: "ln -s ${fetchurl params} $PWD/build/_deps/${name}" - ) (import ./deps.nix) - ); + '' + + lib.concatStringsSep "\n" ( + lib.mapAttrsToList ( + name: params: "ln -s ${fetchurl params} $PWD/build/_deps/${name}" + ) (import ./deps.nix) + ); meta = { description = "Extensible text editor based on Scintilla with Lua scripting"; diff --git a/pkgs/by-name/te/textlint/package.nix b/pkgs/by-name/te/textlint/package.nix index 64602e0ad462..d6ae834c533b 100644 --- a/pkgs/by-name/te/textlint/package.nix +++ b/pkgs/by-name/te/textlint/package.nix @@ -46,16 +46,15 @@ buildNpmPackage rec { npmDepsHash = "sha256-l+1JntqIPttuYXKsVEdJOB1qQfsoheZk+7Z7OJ67z5E="; - nativeBuildInputs = - [ - autoconf - automake - ] - ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ - # File "/build/source/node_modules/node-gyp/gyp/gyp_main.py", line 42, in - # npm error ModuleNotFoundError: No module named 'distutils' - python311 - ]; + nativeBuildInputs = [ + autoconf + automake + ] + ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ + # File "/build/source/node_modules/node-gyp/gyp/gyp_main.py", line 42, in + # npm error ModuleNotFoundError: No module named 'distutils' + python311 + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/th/thc-hydra/package.nix b/pkgs/by-name/th/thc-hydra/package.nix index b0ce1072c6af..d5172fd87507 100644 --- a/pkgs/by-name/th/thc-hydra/package.nix +++ b/pkgs/by-name/th/thc-hydra/package.nix @@ -58,7 +58,8 @@ stdenv.mkDerivation rec { libmysqlclient libpq samba - ] ++ lib.optional withGUI gtk2; + ] + ++ lib.optional withGUI gtk2; enableParallelBuilding = true; diff --git a/pkgs/by-name/th/the-powder-toy/package.nix b/pkgs/by-name/th/the-powder-toy/package.nix index 4f05c970dfcb..34bb72c9f55e 100644 --- a/pkgs/by-name/th/the-powder-toy/package.nix +++ b/pkgs/by-name/th/the-powder-toy/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation rec { ninja pkg-config python3 - ] ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; + ] + ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; buildInputs = [ bzip2 diff --git a/pkgs/by-name/th/thelounge/package.nix b/pkgs/by-name/th/thelounge/package.nix index 3e54f1d3c27e..d50efac6aedf 100644 --- a/pkgs/by-name/th/thelounge/package.nix +++ b/pkgs/by-name/th/thelounge/package.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation (finalAttrs: { python3 python3.pkgs.distutils npmHooks.npmInstallHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools ]; buildInputs = [ sqlite ]; configurePhase = '' diff --git a/pkgs/by-name/th/thinkfan/package.nix b/pkgs/by-name/th/thinkfan/package.nix index 39e62d816acd..d6fcdf56541c 100644 --- a/pkgs/by-name/th/thinkfan/package.nix +++ b/pkgs/by-name/th/thinkfan/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation rec { "-DUSE_NVML=OFF" # force install unit files "-DSYSTEMD_FOUND=ON" - ] ++ lib.optional smartSupport "-DUSE_ATASMART=ON"; + ] + ++ lib.optional smartSupport "-DUSE_ATASMART=ON"; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/th/thonny/package.nix b/pkgs/by-name/th/thonny/package.nix index 0a8b0cc8b0d9..b5d9c0e7b0df 100644 --- a/pkgs/by-name/th/thonny/package.nix +++ b/pkgs/by-name/th/thonny/package.nix @@ -22,7 +22,8 @@ python3.pkgs.buildPythonApplication rec { nativeBuildInputs = [ copyDesktopItems - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/th/thrift/package.nix b/pkgs/by-name/th/thrift/package.nix index bfa5fef27ec1..574c028e463d 100644 --- a/pkgs/by-name/th/thrift/package.nix +++ b/pkgs/by-name/th/thrift/package.nix @@ -28,18 +28,17 @@ stdenv.mkDerivation rec { # pythonFull.buildEnv.override { extraLibs = [ thrift ]; } pythonPath = [ ]; - nativeBuildInputs = - [ - bison - cmake - flex - pkg-config - python3 - python3.pkgs.setuptools - ] - ++ lib.optionals (!static) [ - python3.pkgs.twisted - ]; + nativeBuildInputs = [ + bison + cmake + flex + pkg-config + python3 + python3.pkgs.setuptools + ] + ++ lib.optionals (!static) [ + python3.pkgs.twisted + ]; buildInputs = [ boost @@ -93,45 +92,43 @@ stdenv.mkDerivation rec { }) ]; - cmakeFlags = - [ - "-DBUILD_JAVASCRIPT:BOOL=OFF" - "-DBUILD_NODEJS:BOOL=OFF" + cmakeFlags = [ + "-DBUILD_JAVASCRIPT:BOOL=OFF" + "-DBUILD_NODEJS:BOOL=OFF" - # FIXME: Fails to link in static mode with undefined reference to - # `boost::unit_test::unit_test_main(bool (*)(), int, char**)' - "-DBUILD_TESTING:BOOL=${if static then "OFF" else "ON"}" - ] - ++ lib.optionals static [ - "-DWITH_STATIC_LIB:BOOL=ON" - "-DOPENSSL_USE_STATIC_LIBS=ON" - ]; + # FIXME: Fails to link in static mode with undefined reference to + # `boost::unit_test::unit_test_main(bool (*)(), int, char**)' + "-DBUILD_TESTING:BOOL=${if static then "OFF" else "ON"}" + ] + ++ lib.optionals static [ + "-DWITH_STATIC_LIB:BOOL=ON" + "-DOPENSSL_USE_STATIC_LIBS=ON" + ]; - disabledTests = - [ - "PythonTestSSLSocket" - "PythonThriftTNonblockingServer" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Tests that hang up in the Darwin sandbox - "SecurityTest" - "SecurityFromBufferTest" - "python_test" + disabledTests = [ + "PythonTestSSLSocket" + "PythonThriftTNonblockingServer" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Tests that hang up in the Darwin sandbox + "SecurityTest" + "SecurityFromBufferTest" + "python_test" - # fails on hydra, passes locally - "concurrency_test" + # fails on hydra, passes locally + "concurrency_test" - # Tests that fail in the Darwin sandbox when trying to use network - "UnitTests" - "TInterruptTest" - "TServerIntegrationTest" - "processor" - "TNonblockingServerTest" - "TNonblockingSSLServerTest" - "StressTest" - "StressTestConcurrent" - "StressTestNonBlocking" - ]; + # Tests that fail in the Darwin sandbox when trying to use network + "UnitTests" + "TInterruptTest" + "TServerIntegrationTest" + "processor" + "TNonblockingServerTest" + "TNonblockingSSLServerTest" + "StressTest" + "StressTestConcurrent" + "StressTestNonBlocking" + ]; doCheck = !static; diff --git a/pkgs/by-name/ti/tig/package.nix b/pkgs/by-name/ti/tig/package.nix index 184040d7ef9f..c3a65a14cb8a 100644 --- a/pkgs/by-name/ti/tig/package.nix +++ b/pkgs/by-name/ti/tig/package.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation rec { ncurses readline git - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; # those files are inherently impure, we'll handle the corresponding dependencies. postPatch = '' diff --git a/pkgs/by-name/ti/tigerbeetle/package.nix b/pkgs/by-name/ti/tigerbeetle/package.nix index c71f0720853a..f7e45c23af18 100644 --- a/pkgs/by-name/ti/tigerbeetle/package.nix +++ b/pkgs/by-name/ti/tigerbeetle/package.nix @@ -56,7 +56,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { platforms = [ "x86_64-linux" "aarch64-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; mainProgram = "tigerbeetle"; }; diff --git a/pkgs/by-name/ti/tigervnc/package.nix b/pkgs/by-name/ti/tigervnc/package.nix index 55dc8b138a77..a48108d4460a 100644 --- a/pkgs/by-name/ti/tigervnc/package.nix +++ b/pkgs/by-name/ti/tigervnc/package.nix @@ -123,57 +123,55 @@ stdenv.mkDerivation (finalAttrs: { chmod +x $out/bin/vncviewer ''; - buildInputs = + buildInputs = [ + fltk + gnutls + libjpeg_turbo + pixman + gawk + ffmpeg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux ( + with xorg; [ - fltk - gnutls - libjpeg_turbo - pixman - gawk - ffmpeg + nettle + pam + perl + xorgproto + utilmacros + libXtst + libXext + libX11 + libXext + libICE + libXi + libSM + libXft + libxkbfile + libXfont2 + libpciaccess + libGLU + libXrandr + libXdamage ] - ++ lib.optionals stdenv.hostPlatform.isLinux ( - with xorg; - [ - nettle - pam - perl - xorgproto - utilmacros - libXtst - libXext - libX11 - libXext - libICE - libXi - libSM - libXft - libxkbfile - libXfont2 - libpciaccess - libGLU - libXrandr - libXdamage - ] - ++ xorg.xorgserver.buildInputs - ); + ++ xorg.xorgserver.buildInputs + ); - nativeBuildInputs = + nativeBuildInputs = [ + cmake + gettext + ] + ++ lib.optionals stdenv.hostPlatform.isLinux ( + with xorg; [ - cmake - gettext + fontutil + libtool + makeWrapper + utilmacros + zlib ] - ++ lib.optionals stdenv.hostPlatform.isLinux ( - with xorg; - [ - fontutil - libtool - makeWrapper - utilmacros - zlib - ] - ++ xorg.xorgserver.nativeBuildInputs - ); + ++ xorg.xorgserver.nativeBuildInputs + ); propagatedBuildInputs = lib.optional stdenv.hostPlatform.isLinux xorg.xorgserver.propagatedBuildInputs; diff --git a/pkgs/by-name/ti/tiledb/package.nix b/pkgs/by-name/ti/tiledb/package.nix index 8b68590dfb6f..da1082a2a73c 100644 --- a/pkgs/by-name/ti/tiledb/package.nix +++ b/pkgs/by-name/ti/tiledb/package.nix @@ -65,7 +65,8 @@ stdenv.mkDerivation rec { # https://github.com/NixOS/nixpkgs/issues/144170 "-DCMAKE_INSTALL_INCLUDEDIR=include" "-DCMAKE_INSTALL_LIBDIR=lib" - ] ++ lib.optional (!useAVX2) "-DCOMPILER_SUPPORTS_AVX2=FALSE"; + ] + ++ lib.optional (!useAVX2) "-DCOMPILER_SUPPORTS_AVX2=FALSE"; nativeBuildInputs = [ catch2 @@ -73,7 +74,8 @@ stdenv.mkDerivation rec { cmake python3 doxygen - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = [ zlib diff --git a/pkgs/by-name/ti/timeloop/package.nix b/pkgs/by-name/ti/timeloop/package.nix index 627773ef7b9a..a8c83a5f1283 100644 --- a/pkgs/by-name/ti/timeloop/package.nix +++ b/pkgs/by-name/ti/timeloop/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation rec { yaml-cpp ncurses accelergy - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ gpm ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ gpm ]; preConfigure = '' cp -r ./pat-public/src/pat ./src/pat @@ -42,39 +43,38 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - postPatch = - '' - # Fix gcc-13 build failure due to missing includes: - sed -e '1i #include ' -i \ - include/compound-config/compound-config.hpp + postPatch = '' + # Fix gcc-13 build failure due to missing includes: + sed -e '1i #include ' -i \ + include/compound-config/compound-config.hpp - # use nix ar/ranlib - substituteInPlace ./SConstruct \ - --replace-fail "env.Replace(AR = \"gcc-ar\")" "pass" \ - --replace-fail "env.Replace(RANLIB = \"gcc-ranlib\")" "pass" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # prevent clang from dying on errors that gcc is fine with - substituteInPlace ./src/SConscript --replace "-Werror" "-Wno-inconsistent-missing-override" + # use nix ar/ranlib + substituteInPlace ./SConstruct \ + --replace-fail "env.Replace(AR = \"gcc-ar\")" "pass" \ + --replace-fail "env.Replace(RANLIB = \"gcc-ranlib\")" "pass" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # prevent clang from dying on errors that gcc is fine with + substituteInPlace ./src/SConscript --replace "-Werror" "-Wno-inconsistent-missing-override" - # disable LTO on macos - substituteInPlace ./src/SConscript --replace ", '-flto'" "" + # disable LTO on macos + substituteInPlace ./src/SConscript --replace ", '-flto'" "" - # static builds on mac fail as no static libcrt is provided by apple - # see https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag - substituteInPlace ./src/SConscript \ - --replace "'-static-libgcc', " "" \ - --replace "'-static-libstdc++', " "" \ - --replace "'-Wl,--whole-archive', '-static', " "" \ - --replace ", '-Wl,--no-whole-archive'" "" + # static builds on mac fail as no static libcrt is provided by apple + # see https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag + substituteInPlace ./src/SConscript \ + --replace "'-static-libgcc', " "" \ + --replace "'-static-libstdc++', " "" \ + --replace "'-Wl,--whole-archive', '-static', " "" \ + --replace ", '-Wl,--no-whole-archive'" "" - #remove hardcoding of gcc - sed -i '40i env.Replace(CC = "${stdenv.cc.targetPrefix}cc")' ./SConstruct - sed -i '40i env.Replace(CXX = "${stdenv.cc.targetPrefix}c++")' ./SConstruct + #remove hardcoding of gcc + sed -i '40i env.Replace(CC = "${stdenv.cc.targetPrefix}cc")' ./SConstruct + sed -i '40i env.Replace(CXX = "${stdenv.cc.targetPrefix}c++")' ./SConstruct - #gpm doesn't exist on darwin - substituteInPlace ./src/SConscript --replace ", 'gpm'" "" - ''; + #gpm doesn't exist on darwin + substituteInPlace ./src/SConscript --replace ", 'gpm'" "" + ''; sconsFlags = # will fail on clang/darwin on link without --static due to undefined extern diff --git a/pkgs/by-name/ti/timidity/package.nix b/pkgs/by-name/ti/timidity/package.nix index 68d5a23b3474..00e00b5558ce 100644 --- a/pkgs/by-name/ti/timidity/package.nix +++ b/pkgs/by-name/ti/timidity/package.nix @@ -36,55 +36,52 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libjack2 - ncurses - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ] - ++ lib.optionals enableVorbis [ - libvorbis - ]; + buildInputs = [ + libjack2 + ncurses + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ] + ++ lib.optionals enableVorbis [ + libvorbis + ]; - enabledOutputModes = - [ - "jack" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "oss" - "alsa" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "darwin" - ] - ++ lib.optionals enableVorbis [ - "vorbis" - ]; + enabledOutputModes = [ + "jack" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "oss" + "alsa" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "darwin" + ] + ++ lib.optionals enableVorbis [ + "vorbis" + ]; - configureFlags = - [ - "--enable-ncurses" - ("--enable-audio=" + builtins.concatStringsSep "," enabledOutputModes) - "lib_cv_va_copy=yes" - "lib_cv___va_copy=yes" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-alsaseq" - "--with-default-output=alsa" - "lib_cv_va_val_copy=yes" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "lib_cv_va_val_copy=no" - "timidity_cv_ccoption_rdynamic=yes" - # These configure tests fail because of incompatible function pointer conversions. - "ac_cv_func_vprintf=yes" - "ac_cv_func_popen=yes" - "ac_cv_func_vsnprintf=yes" - "ac_cv_func_snprintf=yes" - "ac_cv_func_open_memstream=yes" - ]; + configureFlags = [ + "--enable-ncurses" + ("--enable-audio=" + builtins.concatStringsSep "," enabledOutputModes) + "lib_cv_va_copy=yes" + "lib_cv___va_copy=yes" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--enable-alsaseq" + "--with-default-output=alsa" + "lib_cv_va_val_copy=yes" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "lib_cv_va_val_copy=no" + "timidity_cv_ccoption_rdynamic=yes" + # These configure tests fail because of incompatible function pointer conversions. + "ac_cv_func_vprintf=yes" + "ac_cv_func_popen=yes" + "ac_cv_func_vsnprintf=yes" + "ac_cv_func_snprintf=yes" + "ac_cv_func_open_memstream=yes" + ]; makeFlags = [ "AR=${stdenv.cc.targetPrefix}ar" diff --git a/pkgs/by-name/ti/tiny-cuda-nn/package.nix b/pkgs/by-name/ti/tiny-cuda-nn/package.nix index e2c2f75d13da..d5cf4d2d7285 100644 --- a/pkgs/by-name/ti/tiny-cuda-nn/package.nix +++ b/pkgs/by-name/ti/tiny-cuda-nn/package.nix @@ -67,33 +67,31 @@ stdenv.mkDerivation (finalAttrs: { "-std=c++14" "-std=c++17" ''; - nativeBuildInputs = + nativeBuildInputs = [ + cmake + cuda-native-redist + ninja + which + ] + ++ lists.optionals pythonSupport ( + with python3Packages; [ - cmake - cuda-native-redist - ninja - which + pip + setuptools + wheel ] - ++ lists.optionals pythonSupport ( - with python3Packages; - [ - pip - setuptools - wheel - ] - ); + ); - buildInputs = + buildInputs = [ + cuda-redist + ] + ++ lib.optionals pythonSupport ( + with python3Packages; [ - cuda-redist + pybind11 + python ] - ++ lib.optionals pythonSupport ( - with python3Packages; - [ - pybind11 - python - ] - ); + ); propagatedBuildInputs = lib.optionals pythonSupport ( with python3Packages; @@ -142,30 +140,29 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; - installPhase = - '' - runHook preInstall - mkdir -p "$out/lib" - '' - # Installing the C++ library just requires copying the static library to the output directory - + strings.optionalString (!pythonSupport) '' - cp libtiny-cuda-nn.a "$out/lib/" - '' - # Installing the python bindings requires building the wheel and installing it - + strings.optionalString pythonSupport '' - python -m pip install \ - --no-build-isolation \ - --no-cache-dir \ - --no-deps \ - --no-index \ - --no-warn-script-location \ - --prefix="$out" \ - --verbose \ - ./*.whl - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p "$out/lib" + '' + # Installing the C++ library just requires copying the static library to the output directory + + strings.optionalString (!pythonSupport) '' + cp libtiny-cuda-nn.a "$out/lib/" + '' + # Installing the python bindings requires building the wheel and installing it + + strings.optionalString pythonSupport '' + python -m pip install \ + --no-build-isolation \ + --no-cache-dir \ + --no-deps \ + --no-index \ + --no-warn-script-location \ + --prefix="$out" \ + --verbose \ + ./*.whl + '' + + '' + runHook postInstall + ''; passthru = { inherit cudaPackages; diff --git a/pkgs/by-name/ti/tinycc/package.nix b/pkgs/by-name/ti/tinycc/package.nix index 0632b01e3ef9..fe3ec0801920 100644 --- a/pkgs/by-name/ti/tinycc/package.nix +++ b/pkgs/by-name/ti/tinycc/package.nix @@ -59,21 +59,20 @@ stdenv.mkDerivation (finalAttrs: { (makePkgconfigItem libtcc-pcitem) ]; - configureFlags = - [ - "--cc=$CC" - "--ar=$AR" - "--crtprefix=${lib.getLib stdenv.cc.libc}/lib" - "--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include" - # The first libpath will be the one in which tcc will look for libtcc1.a, - # which is need for its tests. - "--libpaths=$lib/lib/tcc:$lib/lib:${lib.getLib stdenv.cc.libc}/lib" - # build cross compilers - "--enable-cross" - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - "--config-musl" - ]; + configureFlags = [ + "--cc=$CC" + "--ar=$AR" + "--crtprefix=${lib.getLib stdenv.cc.libc}/lib" + "--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include" + # The first libpath will be the one in which tcc will look for libtcc1.a, + # which is need for its tests. + "--libpaths=$lib/lib/tcc:$lib/lib:${lib.getLib stdenv.cc.libc}/lib" + # build cross compilers + "--enable-cross" + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + "--config-musl" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ti/tinycdb/package.nix b/pkgs/by-name/ti/tinycdb/package.nix index 69c6ade37992..c3e2caa2b9d9 100644 --- a/pkgs/by-name/ti/tinycdb/package.nix +++ b/pkgs/by-name/ti/tinycdb/package.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation rec { "out" "dev" "man" - ] ++ lib.optional (!static) "lib"; + ] + ++ lib.optional (!static) "lib"; separateDebugInfo = true; makeFlags = [ "prefix=$(out)" @@ -33,25 +34,25 @@ stdenv.mkDerivation rec { "AR=${ar}" "RANLIB=${ranlib}" "static" - ] ++ lib.optional (!static) "shared"; - postInstall = - '' - mkdir -p $dev/lib $out/bin - mv $out/lib/libcdb.a $dev/lib - rmdir $out/lib - '' - + ( - if static then - '' - cp cdb $out/bin/cdb - '' - else - '' - mkdir -p $lib/lib - cp libcdb.so* $lib/lib - cp cdb-shared $out/bin/cdb - '' - ); + ] + ++ lib.optional (!static) "shared"; + postInstall = '' + mkdir -p $dev/lib $out/bin + mv $out/lib/libcdb.a $dev/lib + rmdir $out/lib + '' + + ( + if static then + '' + cp cdb $out/bin/cdb + '' + else + '' + mkdir -p $lib/lib + cp libcdb.so* $lib/lib + cp cdb-shared $out/bin/cdb + '' + ); src = fetchurl { url = "http://www.corpit.ru/mjt/tinycdb/${pname}-${version}.tar.gz"; diff --git a/pkgs/by-name/ti/tinyfugue/package.nix b/pkgs/by-name/ti/tinyfugue/package.nix index f2bfe84940d9..6942bcb05a2e 100644 --- a/pkgs/by-name/ti/tinyfugue/package.nix +++ b/pkgs/by-name/ti/tinyfugue/package.nix @@ -38,7 +38,8 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses zlib - ] ++ optional sslSupport openssl; + ] + ++ optional sslSupport openssl; # Workaround build failure on -fno-common toolchains like upstream # gcc-10. Otherwise build fails as: diff --git a/pkgs/by-name/ti/tinygo/package.nix b/pkgs/by-name/ti/tinygo/package.nix index e32871b6a40d..4746b1b04799 100644 --- a/pkgs/by-name/ti/tinygo/package.nix +++ b/pkgs/by-name/ti/tinygo/package.nix @@ -65,7 +65,8 @@ buildGoModule rec { buildInputs = [ llvm clang.cc - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xar ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xar ]; doCheck = (stdenv.buildPlatform.canExecute stdenv.hostPlatform); inherit tinygoTests; @@ -129,7 +130,8 @@ buildGoModule rec { avrdude openocd binaryen - ] ++ lib.optionals (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) [ gdb ]; + ] + ++ lib.optionals (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) [ gdb ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/ti/tinyscheme/package.nix b/pkgs/by-name/ti/tinyscheme/package.nix index 4d6f5dca769b..fede5fde791c 100644 --- a/pkgs/by-name/ti/tinyscheme/package.nix +++ b/pkgs/by-name/ti/tinyscheme/package.nix @@ -19,23 +19,22 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ dos2unix ]; prePatch = "dos2unix makefile"; - patches = - [ - # The alternate macOS main makes use of `ccommand` which seems to be - # `MetroWerks CodeWarrier` specific: - # https://ptgmedia.pearsoncmg.com/imprint_downloads/informit/downloads/9780201703535/macfix.html - # - # In any case, this is not needed to build on macOS. - ./01-remove-macOS-main.patch + patches = [ + # The alternate macOS main makes use of `ccommand` which seems to be + # `MetroWerks CodeWarrier` specific: + # https://ptgmedia.pearsoncmg.com/imprint_downloads/informit/downloads/9780201703535/macfix.html + # + # In any case, this is not needed to build on macOS. + ./01-remove-macOS-main.patch - # We want to have the makefile pick up $CC, etc. so that we don't have - # to unnecessarily tie this package to the GCC stdenv. - ./02-use-toolchain-env-vars.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # On macOS the library suffix is .dylib: - ./03-macOS-SOsuf.patch - ]; + # We want to have the makefile pick up $CC, etc. so that we don't have + # to unnecessarily tie this package to the GCC stdenv. + ./02-use-toolchain-env-vars.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # On macOS the library suffix is .dylib: + ./03-macOS-SOsuf.patch + ]; postPatch = '' substituteInPlace scheme.c --replace "init.scm" "$out/lib/init.scm" ''; diff --git a/pkgs/by-name/ti/tinysparql/package.nix b/pkgs/by-name/ti/tinysparql/package.nix index 62c0fd789133..73bd538544a1 100644 --- a/pkgs/by-name/ti/tinysparql/package.nix +++ b/pkgs/by-name/ti/tinysparql/package.nix @@ -55,24 +55,23 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - asciidoc - gettext - glib - wrapGAppsNoGuiHook - (python3.pythonOnBuildForHost.withPackages (p: [ p.pygobject3 ])) - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + asciidoc + gettext + glib + wrapGAppsNoGuiHook + (python3.pythonOnBuildForHost.withPackages (p: [ p.pygobject3 ])) + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib @@ -91,25 +90,24 @@ stdenv.mkDerivation (finalAttrs: { man-db ]; - mesonFlags = + mesonFlags = [ + "-Ddocs=true" + "-Dsystemd_user_services_dir=${placeholder "out"}/lib/systemd/user" + (lib.mesonEnable "introspection" withIntrospection) + (lib.mesonEnable "vapi" withIntrospection) + ] + ++ ( + let + # https://gitlab.gnome.org/GNOME/tinysparql/-/blob/3.7.3/meson.build#L170 + crossFile = writeText "cross-file.conf" '' + [properties] + sqlite3_has_fts5 = '${lib.boolToString (lib.hasInfix "-DSQLITE_ENABLE_FTS3" sqlite.NIX_CFLAGS_COMPILE)}' + ''; + in [ - "-Ddocs=true" - "-Dsystemd_user_services_dir=${placeholder "out"}/lib/systemd/user" - (lib.mesonEnable "introspection" withIntrospection) - (lib.mesonEnable "vapi" withIntrospection) + "--cross-file=${crossFile}" ] - ++ ( - let - # https://gitlab.gnome.org/GNOME/tinysparql/-/blob/3.7.3/meson.build#L170 - crossFile = writeText "cross-file.conf" '' - [properties] - sqlite3_has_fts5 = '${lib.boolToString (lib.hasInfix "-DSQLITE_ENABLE_FTS3" sqlite.NIX_CFLAGS_COMPILE)}' - ''; - in - [ - "--cross-file=${crossFile}" - ] - ); + ); doCheck = true; diff --git a/pkgs/by-name/ti/tiscamera/package.nix b/pkgs/by-name/ti/tiscamera/package.nix index 94f27080d7e9..07f3d5cc9e5d 100644 --- a/pkgs/by-name/ti/tiscamera/package.nix +++ b/pkgs/by-name/ti/tiscamera/package.nix @@ -52,49 +52,47 @@ stdenv.mkDerivation rec { --replace "typically /usr/share/theimagingsource/tiscamera/uvc-extension/" "" ''; - nativeBuildInputs = - [ - cmake - pkg-config - wrapGAppsHook3 - gobject-introspection - ] - ++ lib.optionals withDoc [ - sphinx - graphviz - ] - ++ lib.optionals withAravis [ - meson - ] - ++ lib.optionals withGui [ - qt5.wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + wrapGAppsHook3 + gobject-introspection + ] + ++ lib.optionals withDoc [ + sphinx + graphviz + ] + ++ lib.optionals withAravis [ + meson + ] + ++ lib.optionals withGui [ + qt5.wrapQtAppsHook + ]; - buildInputs = - [ - elfutils - libselinux - libsepol - libunwind - libusb1 - libuuid - libzip - orc - pcre - zstd - glib - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-ugly - ] - ++ lib.optionals withAravis [ - aravis - ] - ++ lib.optionals withGui [ - qt5.qtbase - ]; + buildInputs = [ + elfutils + libselinux + libsepol + libunwind + libusb1 + libuuid + libzip + orc + pcre + zstd + glib + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gst-plugins-bad + gst_all_1.gst-plugins-ugly + ] + ++ lib.optionals withAravis [ + aravis + ] + ++ lib.optionals withGui [ + qt5.qtbase + ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/by-name/tm/tmux/package.nix b/pkgs/by-name/tm/tmux/package.nix index 983a27538ad6..347ee235c203 100644 --- a/pkgs/by-name/tm/tmux/package.nix +++ b/pkgs/by-name/tm/tmux/package.nix @@ -50,36 +50,33 @@ stdenv.mkDerivation (finalAttrs: { bison ]; - buildInputs = - [ - ncurses - libevent - ] - ++ lib.optionals withSystemd [ systemd ] - ++ lib.optionals withUtf8proc [ utf8proc ] - ++ lib.optionals withUtempter [ libutempter ]; + buildInputs = [ + ncurses + libevent + ] + ++ lib.optionals withSystemd [ systemd ] + ++ lib.optionals withUtf8proc [ utf8proc ] + ++ lib.optionals withUtempter [ libutempter ]; - configureFlags = - [ - "--sysconfdir=/etc" - "--localstatedir=/var" - ] - ++ lib.optionals withSystemd [ "--enable-systemd" ] - ++ lib.optionals withSixel [ "--enable-sixel" ] - ++ lib.optionals withUtempter [ "--enable-utempter" ] - ++ lib.optionals withUtf8proc [ "--enable-utf8proc" ]; + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + ] + ++ lib.optionals withSystemd [ "--enable-systemd" ] + ++ lib.optionals withSixel [ "--enable-sixel" ] + ++ lib.optionals withUtempter [ "--enable-utempter" ] + ++ lib.optionals withUtf8proc [ "--enable-utf8proc" ]; enableParallelBuilding = true; - postInstall = - '' - mkdir -p $out/share/bash-completion/completions - cp -v ${bashCompletion}/completions/tmux $out/share/bash-completion/completions/tmux - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir $out/nix-support - echo "${finalAttrs.passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages - ''; + postInstall = '' + mkdir -p $out/share/bash-completion/completions + cp -v ${bashCompletion}/completions/tmux $out/share/bash-completion/completions/tmux + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir $out/nix-support + echo "${finalAttrs.passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages + ''; passthru = { terminfo = runCommand "tmux-terminfo" { nativeBuildInputs = [ ncurses ]; } ( diff --git a/pkgs/by-name/to/tonelib-gfx/package.nix b/pkgs/by-name/to/tonelib-gfx/package.nix index 57fea20af10e..086dff96b162 100644 --- a/pkgs/by-name/to/tonelib-gfx/package.nix +++ b/pkgs/by-name/to/tonelib-gfx/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation rec { alsa-lib freetype libglvnd - ] ++ runtimeDependencies; + ] + ++ runtimeDependencies; runtimeDependencies = map lib.getLib [ curl diff --git a/pkgs/by-name/to/tonelib-jam/package.nix b/pkgs/by-name/to/tonelib-jam/package.nix index 09dd095d4c3d..4bfee1934bdf 100644 --- a/pkgs/by-name/to/tonelib-jam/package.nix +++ b/pkgs/by-name/to/tonelib-jam/package.nix @@ -34,7 +34,8 @@ stdenv.mkDerivation rec { alsa-lib freetype libglvnd - ] ++ runtimeDependencies; + ] + ++ runtimeDependencies; runtimeDependencies = map lib.getLib [ curl diff --git a/pkgs/by-name/to/tonelib-metal/package.nix b/pkgs/by-name/to/tonelib-metal/package.nix index 7f5678963150..c25a4f1d10a9 100644 --- a/pkgs/by-name/to/tonelib-metal/package.nix +++ b/pkgs/by-name/to/tonelib-metal/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation rec { freetype libglvnd libgbm - ] ++ runtimeDependencies; + ] + ++ runtimeDependencies; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/to/tonelib-noisereducer/package.nix b/pkgs/by-name/to/tonelib-noisereducer/package.nix index 548812bb7a62..33a0ec630f96 100644 --- a/pkgs/by-name/to/tonelib-noisereducer/package.nix +++ b/pkgs/by-name/to/tonelib-noisereducer/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation rec { freetype libglvnd libgbm - ] ++ runtimeDependencies; + ] + ++ runtimeDependencies; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/to/tonelib-zoom/package.nix b/pkgs/by-name/to/tonelib-zoom/package.nix index 223b338a8063..24e248b5e060 100644 --- a/pkgs/by-name/to/tonelib-zoom/package.nix +++ b/pkgs/by-name/to/tonelib-zoom/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation rec { freetype libglvnd webkitgtk_4_0 - ] ++ runtimeDependencies; + ] + ++ runtimeDependencies; runtimeDependencies = map lib.getLib [ curl diff --git a/pkgs/by-name/to/topiary/package.nix b/pkgs/by-name/to/topiary/package.nix index d5052e580659..aec44e36ed7f 100644 --- a/pkgs/by-name/to/topiary/package.nix +++ b/pkgs/by-name/to/topiary/package.nix @@ -58,16 +58,15 @@ rustPlatform.buildRustPackage rec { env.TOPIARY_LANGUAGE_DIR = "${placeholder "out"}/share/queries"; - postInstall = - '' - install -Dm444 topiary-queries/queries/* -t $out/share/queries - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd topiary \ - --bash <($out/bin/topiary completion bash) \ - --fish <($out/bin/topiary completion fish) \ - --zsh <($out/bin/topiary completion zsh) - ''; + postInstall = '' + install -Dm444 topiary-queries/queries/* -t $out/share/queries + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd topiary \ + --bash <($out/bin/topiary completion bash) \ + --fish <($out/bin/topiary completion fish) \ + --zsh <($out/bin/topiary completion zsh) + ''; doInstallCheck = true; versionCheckProgramArg = "--version"; diff --git a/pkgs/by-name/to/tor/package.nix b/pkgs/by-name/to/tor/package.nix index 7c78a5bee9fd..2d9f0b5b0169 100644 --- a/pkgs/by-name/to/tor/package.nix +++ b/pkgs/by-name/to/tor/package.nix @@ -59,20 +59,19 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libevent - openssl - zlib - xz - zstd - scrypt - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libseccomp - systemd - libcap - ]; + buildInputs = [ + libevent + openssl + zlib + xz + zstd + scrypt + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libseccomp + systemd + libcap + ]; patches = [ ./disable-monotonic-timer-tests.patch ]; @@ -82,8 +81,8 @@ stdenv.mkDerivation (finalAttrs: { # https://gitlab.torproject.org/tpo/onion-services/onion-support/-/wikis/Documentation/PoW-FAQ#compiling-c-tor-with-the-pow-defense [ "--enable-gpl" ] ++ - # cross compiles correctly but needs the following - lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--disable-tool-name-check" ]; + # cross compiles correctly but needs the following + lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--disable-tool-name-check" ]; NIX_CFLAGS_LINK = lib.optionalString stdenv.cc.isGNU "-lgcc_s"; diff --git a/pkgs/by-name/to/touchegg/package.nix b/pkgs/by-name/to/touchegg/package.nix index 5bc94928283b..ec656497f6f5 100644 --- a/pkgs/by-name/to/touchegg/package.nix +++ b/pkgs/by-name/to/touchegg/package.nix @@ -47,23 +47,22 @@ stdenv.mkDerivation (finalAttrs: { cmake ]; - buildInputs = - [ - systemd - libinput - pugixml - cairo - gtk3-x11 - ] - ++ (with xorg; [ - libX11 - libXtst - libXrandr - libXi - libXdmcp - libpthreadstubs - libxcb - ]); + buildInputs = [ + systemd + libinput + pugixml + cairo + gtk3-x11 + ] + ++ (with xorg; [ + libX11 + libXtst + libXrandr + libXi + libXdmcp + libpthreadstubs + libxcb + ]); PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system"; diff --git a/pkgs/by-name/to/toxic/package.nix b/pkgs/by-name/to/toxic/package.nix index 8c2c228b53c4..1c419ec45538 100644 --- a/pkgs/by-name/to/toxic/package.nix +++ b/pkgs/by-name/to/toxic/package.nix @@ -31,22 +31,21 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" ]; installFlags = [ "PREFIX=$(out)" ]; - buildInputs = - [ - libtoxcore - libsodium - ncurses - curl - gdk-pixbuf - libnotify - ] - ++ lib.optionals (!stdenv.hostPlatform.isAarch32) [ - openal - libopus - libvpx - freealut - qrencode - ]; + buildInputs = [ + libtoxcore + libsodium + ncurses + curl + gdk-pixbuf + libnotify + ] + ++ lib.optionals (!stdenv.hostPlatform.isAarch32) [ + openal + libopus + libvpx + freealut + qrencode + ]; nativeBuildInputs = [ pkg-config libconfig diff --git a/pkgs/by-name/to/toxvpn/package.nix b/pkgs/by-name/to/toxvpn/package.nix index 48063d333cea..6c274e74fff7 100644 --- a/pkgs/by-name/to/toxvpn/package.nix +++ b/pkgs/by-name/to/toxvpn/package.nix @@ -22,17 +22,16 @@ stdenv.mkDerivation { sha256 = "sha256-UncU0cpoyy9Z0TCChGmaHpyhW9ctz32gU7n3hgpOEwU="; }; - buildInputs = - [ - libtoxcore - nlohmann_json - libsodium - zeromq - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - systemd - ]; + buildInputs = [ + libtoxcore + nlohmann_json + libsodium + zeromq + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + systemd + ]; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/by-name/to/toybox/package.nix b/pkgs/by-name/to/toybox/package.nix index 84dde2316d7c..416ccc2d5ada 100644 --- a/pkgs/by-name/to/toybox/package.nix +++ b/pkgs/by-name/to/toybox/package.nix @@ -29,17 +29,16 @@ stdenv.mkDerivation rec { depsBuildBuild = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; - buildInputs = - [ - libxcrypt - ] - ++ optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ optionals (enableStatic && stdenv.cc.libc ? static) [ - stdenv.cc.libc - stdenv.cc.libc.static - ]; + buildInputs = [ + libxcrypt + ] + ++ optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ optionals (enableStatic && stdenv.cc.libc ? static) [ + stdenv.cc.libc + stdenv.cc.libc.static + ]; postPatch = "patchShebangs ."; @@ -69,14 +68,13 @@ stdenv.mkDerivation rec { "fortify" ]; - makeFlags = - [ - "PREFIX=$(out)/bin" - "CC=${stdenv.cc.targetPrefix}cc" - ] - ++ optionals (enableStatic && !stdenv.hostPlatform.isDarwin) [ - "LDFLAGS=--static" - ]; + makeFlags = [ + "PREFIX=$(out)/bin" + "CC=${stdenv.cc.targetPrefix}cc" + ] + ++ optionals (enableStatic && !stdenv.hostPlatform.isDarwin) [ + "LDFLAGS=--static" + ]; installTargets = [ "install_flat" ]; diff --git a/pkgs/by-name/tp/tpm2-pkcs11/package.nix b/pkgs/by-name/tp/tpm2-pkcs11/package.nix index 17d53d293bbf..60d1458e3d39 100644 --- a/pkgs/by-name/tp/tpm2-pkcs11/package.nix +++ b/pkgs/by-name/tp/tpm2-pkcs11/package.nix @@ -82,18 +82,17 @@ chosenStdenv.mkDerivation (finalAttrs: { ./bootstrap ''; - configureFlags = - [ - (lib.enableFeature finalAttrs.doCheck "unit") - (lib.enableFeature finalAttrs.doCheck "integration") + configureFlags = [ + (lib.enableFeature finalAttrs.doCheck "unit") + (lib.enableFeature finalAttrs.doCheck "integration") - # Strangely, it uses --with-fapi=yes|no instead of a normal configure flag. - "--with-fapi=${if fapiSupport then "yes" else "no"}" - ] - ++ lib.optionals enableFuzzing [ - "--enable-fuzzing" - "--disable-hardening" - ]; + # Strangely, it uses --with-fapi=yes|no instead of a normal configure flag. + "--with-fapi=${if fapiSupport then "yes" else "no"}" + ] + ++ lib.optionals enableFuzzing [ + "--enable-fuzzing" + "--disable-hardening" + ]; strictDeps = true; diff --git a/pkgs/by-name/tr/tracee/integration-tests.nix b/pkgs/by-name/tr/tracee/integration-tests.nix index 99c38857d1e8..06dc566b10d8 100644 --- a/pkgs/by-name/tr/tracee/integration-tests.nix +++ b/pkgs/by-name/tr/tracee/integration-tests.nix @@ -5,25 +5,23 @@ }: tracee.overrideAttrs (oa: { pname = oa.pname + "-integration"; - postPatch = - oa.postPatch or "" - + '' - # fix the test to look at nixos paths for running programs - # --replace-fail '"integration.tes"' '"tracee-integrat"' \ - substituteInPlace tests/integration/event_filters_test.go \ - --replace-fail "exec=/usr/bin/dockerd" "comm=dockerd" \ - --replace-fail "exec=/usr/bin" "exec=/tmp/testdir" \ - --replace-fail "/usr/bin/tee" "tee" \ - --replace-fail "/usr/bin" "/run/current-system/sw/bin" \ - --replace-fail 'syscallerAbsPath := filepath.Join("..", "..", "dist", "syscaller")' "syscallerAbsPath := filepath.Join(\"$out/bin/syscaller\")" - substituteInPlace tests/integration/exec_test.go \ - --replace-fail "/usr/bin" "/run/current-system/sw/bin" - substituteInPlace tests/integration/dependencies_test.go \ - --replace-fail "/bin" "/run/current-system/sw/bin" \ - --replace-fail "/tmp/test" "/tmp/ls" - substituteInPlace tests/testutils/tracee.go \ - --replace-fail "../../dist/tracee" "${lib.getExe tracee}" - ''; + postPatch = oa.postPatch or "" + '' + # fix the test to look at nixos paths for running programs + # --replace-fail '"integration.tes"' '"tracee-integrat"' \ + substituteInPlace tests/integration/event_filters_test.go \ + --replace-fail "exec=/usr/bin/dockerd" "comm=dockerd" \ + --replace-fail "exec=/usr/bin" "exec=/tmp/testdir" \ + --replace-fail "/usr/bin/tee" "tee" \ + --replace-fail "/usr/bin" "/run/current-system/sw/bin" \ + --replace-fail 'syscallerAbsPath := filepath.Join("..", "..", "dist", "syscaller")' "syscallerAbsPath := filepath.Join(\"$out/bin/syscaller\")" + substituteInPlace tests/integration/exec_test.go \ + --replace-fail "/usr/bin" "/run/current-system/sw/bin" + substituteInPlace tests/integration/dependencies_test.go \ + --replace-fail "/bin" "/run/current-system/sw/bin" \ + --replace-fail "/tmp/test" "/tmp/ls" + substituteInPlace tests/testutils/tracee.go \ + --replace-fail "../../dist/tracee" "${lib.getExe tracee}" + ''; nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [ makeWrapper ]; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/tr/tracexec/package.nix b/pkgs/by-name/tr/tracexec/package.nix index 77f12a8e20bc..326e9681c57b 100644 --- a/pkgs/by-name/tr/tracexec/package.nix +++ b/pkgs/by-name/tr/tracexec/package.nix @@ -52,15 +52,14 @@ rustPlatform.buildRustPackage rec { zlib ]; - cargoBuildFlags = - [ - "--no-default-features" - "--features=recommended" - ] - # Remove RiscV64 specialisation when this is fixed: - # * https://github.com/NixOS/nixpkgs/pull/310158#pullrequestreview-2046944158 - # * https://github.com/rust-vmm/seccompiler/pull/72 - ++ lib.optional stdenv.hostPlatform.isRiscV64 "--no-default-features"; + cargoBuildFlags = [ + "--no-default-features" + "--features=recommended" + ] + # Remove RiscV64 specialisation when this is fixed: + # * https://github.com/NixOS/nixpkgs/pull/310158#pullrequestreview-2046944158 + # * https://github.com/rust-vmm/seccompiler/pull/72 + ++ lib.optional stdenv.hostPlatform.isRiscV64 "--no-default-features"; preBuild = '' sed -i '1ino-clearly-defined = true' about.toml # disable network requests diff --git a/pkgs/by-name/tr/trackma/package.nix b/pkgs/by-name/tr/trackma/package.nix index 0b9f8973f0f3..304199faf9e4 100644 --- a/pkgs/by-name/tr/trackma/package.nix +++ b/pkgs/by-name/tr/trackma/package.nix @@ -43,16 +43,15 @@ python3.pkgs.buildPythonApplication rec { fetchSubmodules = true; # for anime-relations submodule }; - nativeBuildInputs = - [ - copyDesktopItems - python3.pkgs.poetry-core - ] - ++ lib.optionals withGTK [ - wrapGAppsHook3 - gobject-introspection - ] - ++ lib.optionals withQT [ qt5.wrapQtAppsHook ]; + nativeBuildInputs = [ + copyDesktopItems + python3.pkgs.poetry-core + ] + ++ lib.optionals withGTK [ + wrapGAppsHook3 + gobject-introspection + ] + ++ lib.optionals withQT [ qt5.wrapQtAppsHook ]; buildInputs = lib.optionals withGTK [ glib diff --git a/pkgs/by-name/tr/tractor/package.nix b/pkgs/by-name/tr/tractor/package.nix index 71f0c8bfb47b..f25021b58ffe 100644 --- a/pkgs/by-name/tr/tractor/package.nix +++ b/pkgs/by-name/tr/tractor/package.nix @@ -42,13 +42,12 @@ python3Packages.buildPythonApplication { wrapGAppsHook4 ]; - propagatedBuildInputs = - [ - tor - ] - ++ lib.optional withObfs4 obfs4 - ++ lib.optional withSnowflake snowflake - ++ lib.optional withConjure conjure-tor; + propagatedBuildInputs = [ + tor + ] + ++ lib.optional withObfs4 obfs4 + ++ lib.optional withSnowflake snowflake + ++ lib.optional withConjure conjure-tor; dependencies = [ python3Packages.setuptools @@ -58,23 +57,22 @@ python3Packages.buildPythonApplication { python3Packages.stem ]; - postInstall = - '' - mkdir -p "$out/share/glib-2.0/schemas" - cp "$src/src/tractor/tractor.gschema.xml" "$out/share/glib-2.0/schemas" - '' - + lib.optionalString withObfs4 '' - substituteInPlace "$out/share/glib-2.0/schemas/tractor.gschema.xml" --replace-fail '/usr/bin/obfs4proxy' '${obfs4}/bin/lyrebird' - '' - + lib.optionalString withSnowflake '' - substituteInPlace "$out/share/glib-2.0/schemas/tractor.gschema.xml" --replace-fail '/usr/bin/snowflake-client' '${snowflake}/bin/client' - '' - + lib.optionalString withConjure '' - substituteInPlace "$out/share/glib-2.0/schemas/tractor.gschema.xml" --replace-fail '/usr/bin/conjure-client' '${conjure-tor}/bin/client' - '' - + '' - glib-compile-schemas "$out/share/glib-2.0/schemas" - ''; + postInstall = '' + mkdir -p "$out/share/glib-2.0/schemas" + cp "$src/src/tractor/tractor.gschema.xml" "$out/share/glib-2.0/schemas" + '' + + lib.optionalString withObfs4 '' + substituteInPlace "$out/share/glib-2.0/schemas/tractor.gschema.xml" --replace-fail '/usr/bin/obfs4proxy' '${obfs4}/bin/lyrebird' + '' + + lib.optionalString withSnowflake '' + substituteInPlace "$out/share/glib-2.0/schemas/tractor.gschema.xml" --replace-fail '/usr/bin/snowflake-client' '${snowflake}/bin/client' + '' + + lib.optionalString withConjure '' + substituteInPlace "$out/share/glib-2.0/schemas/tractor.gschema.xml" --replace-fail '/usr/bin/conjure-client' '${conjure-tor}/bin/client' + '' + + '' + glib-compile-schemas "$out/share/glib-2.0/schemas" + ''; dontWrapGApps = true; diff --git a/pkgs/by-name/tr/tracy/package.nix b/pkgs/by-name/tr/tracy/package.nix index 53fa8b8ae269..93c962e8fad0 100644 --- a/pkgs/by-name/tr/tracy/package.nix +++ b/pkgs/by-name/tr/tracy/package.nix @@ -41,40 +41,37 @@ stdenv.mkDerivation rec { stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11" ) ./dont-use-the-uniformtypeidentifiers-framework.patch; - nativeBuildInputs = - [ - cmake - ninja - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ wayland-scanner ] - ++ lib.optionals stdenv.cc.isClang [ stdenv.cc.cc.libllvm ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ wayland-scanner ] + ++ lib.optionals stdenv.cc.isClang [ stdenv.cc.cc.libllvm ]; - buildInputs = - [ - capstone - freetype - tbb - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && withGtkFileSelector) [ gtk3 ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && !withGtkFileSelector) [ dbus ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && withWayland) [ - libglvnd - libxkbcommon - wayland - wayland-protocols - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin || (stdenv.hostPlatform.isLinux && !withWayland)) [ - glfw - ]; + buildInputs = [ + capstone + freetype + tbb + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && withGtkFileSelector) [ gtk3 ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && !withGtkFileSelector) [ dbus ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && withWayland) [ + libglvnd + libxkbcommon + wayland + wayland-protocols + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin || (stdenv.hostPlatform.isLinux && !withWayland)) [ + glfw + ]; - cmakeFlags = - [ - "-DDOWNLOAD_CAPSTONE=off" - "-DTRACY_STATIC=off" - ] - ++ lib.optional (stdenv.hostPlatform.isLinux && withGtkFileSelector) "-DGTK_FILESELECTOR=ON" - ++ lib.optional (stdenv.hostPlatform.isLinux && !withWayland) "-DLEGACY=on"; + cmakeFlags = [ + "-DDOWNLOAD_CAPSTONE=off" + "-DTRACY_STATIC=off" + ] + ++ lib.optional (stdenv.hostPlatform.isLinux && withGtkFileSelector) "-DGTK_FILESELECTOR=ON" + ++ lib.optional (stdenv.hostPlatform.isLinux && !withWayland) "-DLEGACY=on"; env.NIX_CFLAGS_COMPILE = toString ( [ ] @@ -101,24 +98,23 @@ stdenv.mkDerivation rec { ninja -C update/build ''; - postInstall = - '' - install -D -m 0555 capture/build/tracy-capture -t $out/bin - install -D -m 0555 csvexport/build/tracy-csvexport $out/bin - install -D -m 0555 import/build/{tracy-import-chrome,tracy-import-fuchsia} -t $out/bin - install -D -m 0555 profiler/build/tracy-profiler $out/bin/tracy - install -D -m 0555 update/build/tracy-update -t $out/bin - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace extra/desktop/tracy.desktop \ - --replace-fail Exec=/usr/bin/tracy Exec=tracy + postInstall = '' + install -D -m 0555 capture/build/tracy-capture -t $out/bin + install -D -m 0555 csvexport/build/tracy-csvexport $out/bin + install -D -m 0555 import/build/{tracy-import-chrome,tracy-import-fuchsia} -t $out/bin + install -D -m 0555 profiler/build/tracy-profiler $out/bin/tracy + install -D -m 0555 update/build/tracy-update -t $out/bin + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace extra/desktop/tracy.desktop \ + --replace-fail Exec=/usr/bin/tracy Exec=tracy - install -D -m 0444 extra/desktop/application-tracy.xml $out/share/mime/packages/application-tracy.xml - install -D -m 0444 extra/desktop/tracy.desktop $out/share/applications/tracy.desktop - install -D -m 0444 icon/application-tracy.svg $out/share/icons/hicolor/scalable/apps/application-tracy.svg - install -D -m 0444 icon/icon.png $out/share/icons/hicolor/256x256/apps/tracy.png - install -D -m 0444 icon/icon.svg $out/share/icons/hicolor/scalable/apps/tracy.svg - ''; + install -D -m 0444 extra/desktop/application-tracy.xml $out/share/mime/packages/application-tracy.xml + install -D -m 0444 extra/desktop/tracy.desktop $out/share/applications/tracy.desktop + install -D -m 0444 icon/application-tracy.svg $out/share/icons/hicolor/scalable/apps/application-tracy.svg + install -D -m 0444 icon/icon.png $out/share/icons/hicolor/256x256/apps/tracy.png + install -D -m 0444 icon/icon.svg $out/share/icons/hicolor/scalable/apps/tracy.svg + ''; meta = with lib; { description = "Real time, nanosecond resolution, remote telemetry frame profiler for games and other applications"; diff --git a/pkgs/by-name/tr/trafficserver/package.nix b/pkgs/by-name/tr/trafficserver/package.nix index a8bce43c9c6f..83b8d313d9ea 100644 --- a/pkgs/by-name/tr/trafficserver/package.nix +++ b/pkgs/by-name/tr/trafficserver/package.nix @@ -63,63 +63,60 @@ stdenv.mkDerivation rec { # # [1]: https://github.com/apache/trafficserver/pull/5617 # [2]: https://github.com/apache/trafficserver/blob/3fd2c60/configure.ac#L742-L788 - nativeBuildInputs = - [ - autoreconfHook - makeWrapper - pkg-config - file - python3 - ] - ++ (with perlPackages; [ - perl - ExtUtilsMakeMaker - ]) - ++ lib.optionals stdenv.hostPlatform.isLinux [ linuxHeaders ]; + nativeBuildInputs = [ + autoreconfHook + makeWrapper + pkg-config + file + python3 + ] + ++ (with perlPackages; [ + perl + ExtUtilsMakeMaker + ]) + ++ lib.optionals stdenv.hostPlatform.isLinux [ linuxHeaders ]; - buildInputs = - [ - openssl - pcre - perlPackages.perl - ] - ++ lib.optional withBrotli brotli - ++ lib.optional withCap libcap - ++ lib.optional withCjose cjose - ++ lib.optional withCurl curl - ++ lib.optional withGeoIP geoip - ++ lib.optional withHiredis hiredis - ++ lib.optional withHwloc hwloc - ++ lib.optional withImageMagick imagemagick - ++ lib.optional withJansson jansson - ++ lib.optional withKyotoCabinet kyotocabinet - ++ lib.optional withCurses ncurses - ++ lib.optional withLuaJIT luajit - ++ lib.optional withUnwind libunwind - ++ lib.optional withMaxmindDB libmaxminddb; + buildInputs = [ + openssl + pcre + perlPackages.perl + ] + ++ lib.optional withBrotli brotli + ++ lib.optional withCap libcap + ++ lib.optional withCjose cjose + ++ lib.optional withCurl curl + ++ lib.optional withGeoIP geoip + ++ lib.optional withHiredis hiredis + ++ lib.optional withHwloc hwloc + ++ lib.optional withImageMagick imagemagick + ++ lib.optional withJansson jansson + ++ lib.optional withKyotoCabinet kyotocabinet + ++ lib.optional withCurses ncurses + ++ lib.optional withLuaJIT luajit + ++ lib.optional withUnwind libunwind + ++ lib.optional withMaxmindDB libmaxminddb; outputs = [ "out" "man" ]; - postPatch = - '' - patchShebangs \ - iocore/aio/test_AIO.sample \ - src/traffic_via/test_traffic_via \ - src/traffic_logstats/tests \ - tools/check-unused-dependencies - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace configure.ac \ - --replace-fail '/usr/include/linux' '${linuxHeaders}/include/linux' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # 'xcrun leaks' probably requires non-free XCode - substituteInPlace iocore/net/test_certlookup.cc \ - --replace-fail 'xcrun leaks' 'true' - ''; + postPatch = '' + patchShebangs \ + iocore/aio/test_AIO.sample \ + src/traffic_via/test_traffic_via \ + src/traffic_logstats/tests \ + tools/check-unused-dependencies + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace configure.ac \ + --replace-fail '/usr/include/linux' '${linuxHeaders}/include/linux' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # 'xcrun leaks' probably requires non-free XCode + substituteInPlace iocore/net/test_certlookup.cc \ + --replace-fail 'xcrun leaks' 'true' + ''; configureFlags = [ "--enable-layout=NixOS" diff --git a/pkgs/by-name/tr/transmission_3/package.nix b/pkgs/by-name/tr/transmission_3/package.nix index 99f4928a8c1c..2201ac294241 100644 --- a/pkgs/by-name/tr/transmission_3/package.nix +++ b/pkgs/by-name/tr/transmission_3/package.nix @@ -69,38 +69,36 @@ stdenv.mkDerivation (finalAttrs: { "-DINSTALL_LIB=${mkFlag installLib}" ]; - nativeBuildInputs = - [ - pkg-config - cmake - ] - ++ lib.optionals enableGTK3 [ wrapGAppsHook3 ] - ++ lib.optionals enableQt [ qt5.wrapQtAppsHook ]; + nativeBuildInputs = [ + pkg-config + cmake + ] + ++ lib.optionals enableGTK3 [ wrapGAppsHook3 ] + ++ lib.optionals enableQt [ qt5.wrapQtAppsHook ]; - buildInputs = - [ - openssl - curl - libevent - zlib - pcre - libb64 - libutp - miniupnpc - dht - libnatpmp - ] - ++ lib.optionals enableQt [ - qt5.qttools - qt5.qtbase - ] - ++ lib.optionals enableGTK3 [ - gtk3 - xorg.libpthreadstubs - ] - ++ lib.optionals enableSystemd [ systemd ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + buildInputs = [ + openssl + curl + libevent + zlib + pcre + libb64 + libutp + miniupnpc + dht + libnatpmp + ] + ++ lib.optionals enableQt [ + qt5.qttools + qt5.qtbase + ] + ++ lib.optionals enableGTK3 [ + gtk3 + xorg.libpthreadstubs + ] + ++ lib.optionals enableSystemd [ systemd ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify-tools ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; postInstall = '' mkdir $apparmor diff --git a/pkgs/by-name/tr/trealla/package.nix b/pkgs/by-name/tr/trealla/package.nix index a7cb1b88a7cb..08d5cc01c4bc 100644 --- a/pkgs/by-name/tr/trealla/package.nix +++ b/pkgs/by-name/tr/trealla/package.nix @@ -50,12 +50,13 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - makeFlags = - [ "GIT_VERSION=\"v${finalAttrs.version}\"" ] - ++ lib.optionals (lineEditingLibrary == "isocline") [ "ISOCLINE=1" ] - ++ lib.optionals (!enableFFI) [ "NOFFI=1" ] - ++ lib.optionals (!enableSSL) [ "NOSSL=1" ] - ++ lib.optionals enableThreads [ "THREADS=1" ]; + makeFlags = [ + "GIT_VERSION=\"v${finalAttrs.version}\"" + ] + ++ lib.optionals (lineEditingLibrary == "isocline") [ "ISOCLINE=1" ] + ++ lib.optionals (!enableFFI) [ "NOFFI=1" ] + ++ lib.optionals (!enableSSL) [ "NOSSL=1" ] + ++ lib.optionals enableThreads [ "THREADS=1" ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/tr/trgui-ng/package.nix b/pkgs/by-name/tr/trgui-ng/package.nix index 8c36115b2c44..e972e35b4cd4 100644 --- a/pkgs/by-name/tr/trgui-ng/package.nix +++ b/pkgs/by-name/tr/trgui-ng/package.nix @@ -60,35 +60,33 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-TflzT1BNAciMcxcejrlmIOIjXc1tpm/zX0kjk+dpGiM="; - postPatch = - '' - cp ${dbip-country-lite}/share/dbip/dbip-country-lite.mmdb src-tauri/dbip.mmdb + postPatch = '' + cp ${dbip-country-lite}/share/dbip/dbip-country-lite.mmdb src-tauri/dbip.mmdb - # Copy pre-built frontend and remove `beforeBuildCommand` to build it - cp -r ${finalAttrs.passthru.frontend} dist/ - substituteInPlace src-tauri/tauri.conf.json \ - --replace-fail '"npm run webpack-prod"' '""' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \ - --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" - ''; + # Copy pre-built frontend and remove `beforeBuildCommand` to build it + cp -r ${finalAttrs.passthru.frontend} dist/ + substituteInPlace src-tauri/tauri.conf.json \ + --replace-fail '"npm run webpack-prod"' '""' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \ + --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" + ''; nativeBuildInputs = [ cargo-tauri.hook pkg-config ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - glib - libayatana-appindicator - webkitgtk_4_1 - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + glib + libayatana-appindicator + webkitgtk_4_1 + ]; cargoRoot = "src-tauri"; buildAndTestSubdir = "src-tauri"; diff --git a/pkgs/by-name/tr/tribler/package.nix b/pkgs/by-name/tr/tribler/package.nix index 1747d011fd8a..a503f1e4cb05 100644 --- a/pkgs/by-name/tr/tribler/package.nix +++ b/pkgs/by-name/tr/tribler/package.nix @@ -43,53 +43,54 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ python3.pkgs.python ]; - pythonPath = - [ libtorrent ] - ++ (with python3.pkgs; [ - # requirements-core.txt - aiohttp - aiohttp-apispec - anyio - chardet - configobj - cryptography - decorator - faker - libnacl - lz4 - marshmallow - netifaces - networkx - pony - psutil - pyasn1 - pydantic_1 - pyopenssl - pyyaml - sentry-sdk - service-identity - yappi - yarl - bitarray - filelock - (pyipv8.overrideAttrs (p: rec { - version = "2.10.0"; - src = fetchPypi { - inherit (p) pname; - inherit version; - hash = "sha256-yxiXBxBiPokequm+vjsHIoG9kQnRnbsOx3mYOd8nmiU="; - }; - })) - file-read-backwards - brotli - human-readable - # requirements.txt - pillow - pyqt5 - pyqt5-sip - pyqtgraph - pyqtwebengine - ]); + pythonPath = [ + libtorrent + ] + ++ (with python3.pkgs; [ + # requirements-core.txt + aiohttp + aiohttp-apispec + anyio + chardet + configobj + cryptography + decorator + faker + libnacl + lz4 + marshmallow + netifaces + networkx + pony + psutil + pyasn1 + pydantic_1 + pyopenssl + pyyaml + sentry-sdk + service-identity + yappi + yarl + bitarray + filelock + (pyipv8.overrideAttrs (p: rec { + version = "2.10.0"; + src = fetchPypi { + inherit (p) pname; + inherit version; + hash = "sha256-yxiXBxBiPokequm+vjsHIoG9kQnRnbsOx3mYOd8nmiU="; + }; + })) + file-read-backwards + brotli + human-readable + # requirements.txt + pillow + pyqt5 + pyqt5-sip + pyqtgraph + pyqtwebengine + ]); installPhase = '' mkdir -pv $out diff --git a/pkgs/by-name/tr/trickster/package.nix b/pkgs/by-name/tr/trickster/package.nix index bcdfb989bee8..cc41ad0c49cb 100644 --- a/pkgs/by-name/tr/trickster/package.nix +++ b/pkgs/by-name/tr/trickster/package.nix @@ -22,18 +22,17 @@ buildGoModule rec { subPackages = [ "cmd/trickster" ]; - ldflags = - [ - "-extldflags '-static'" - "-s" - "-w" - ] - ++ (lib.mapAttrsToList (n: v: "-X main.application${n}=${v}") { - BuildTime = "1970-01-01T00:00:00+0000"; - GitCommitID = rev; - GoVersion = "go${go.version}}"; - GoArch = "${go.GOARCH}"; - }); + ldflags = [ + "-extldflags '-static'" + "-s" + "-w" + ] + ++ (lib.mapAttrsToList (n: v: "-X main.application${n}=${v}") { + BuildTime = "1970-01-01T00:00:00+0000"; + GitCommitID = rev; + GoVersion = "go${go.version}}"; + GoArch = "${go.GOARCH}"; + }); # Tests are broken. doCheck = false; diff --git a/pkgs/by-name/tr/trigger-control/package.nix b/pkgs/by-name/tr/trigger-control/package.nix index 88e0c39351b1..cecb1bc6271d 100644 --- a/pkgs/by-name/tr/trigger-control/package.nix +++ b/pkgs/by-name/tr/trigger-control/package.nix @@ -34,16 +34,15 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - SDL2 - libX11 - dbus - libnotify - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libdecor - ]; + buildInputs = [ + SDL2 + libX11 + dbus + libnotify + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libdecor + ]; patches = [ # Fix build on clang https://github.com/Etaash-mathamsetty/trigger-control/pull/23 diff --git a/pkgs/by-name/tr/triton-llvm/package.nix b/pkgs/by-name/tr/triton-llvm/package.nix index 6b2b99aa0264..f04d00f6dcd8 100644 --- a/pkgs/by-name/tr/triton-llvm/package.nix +++ b/pkgs/by-name/tr/triton-llvm/package.nix @@ -44,7 +44,8 @@ let llvmTargetsToBuild' = [ "AMDGPU" "NVPTX" - ] ++ builtins.map inferNativeTarget llvmTargetsToBuild; + ] + ++ builtins.map inferNativeTarget llvmTargetsToBuild; # This LLVM version can't seem to find pygments/pyyaml, # but a later update will likely fix this (triton-2.1.0) @@ -66,16 +67,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "triton-llvm"; version = "21.0.0-git"; # See https://github.com/llvm/llvm-project/blob/main/cmake/Modules/LLVMVersion.cmake - outputs = - [ - "out" - ] - ++ lib.optionals buildDocs [ - "doc" - ] - ++ lib.optionals buildMan [ - "man" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ] + ++ lib.optionals buildMan [ + "man" + ]; # See https://github.com/triton-lang/triton/blob/main/cmake/llvm-hash.txt src = fetchFromGitHub { @@ -85,20 +85,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-7xUPozRerxt38UeJxA8kYYxOQ4+WzDREndD2+K0BYkU="; }; - nativeBuildInputs = - [ - pkg-config - cmake - ninja - git - python - ] - ++ lib.optionals (buildDocs || buildMan) [ - doxygen - sphinx - python3Packages.recommonmark - python3Packages.myst-parser - ]; + nativeBuildInputs = [ + pkg-config + cmake + ninja + git + python + ] + ++ lib.optionals (buildDocs || buildMan) [ + doxygen + sphinx + python3Packages.recommonmark + python3Packages.myst-parser + ]; buildInputs = [ libxml2 @@ -118,64 +117,63 @@ stdenv.mkDerivation (finalAttrs: { cd llvm ''; - cmakeFlags = - [ - (lib.cmakeFeature "LLVM_TARGETS_TO_BUILD" (lib.concatStringsSep ";" llvmTargetsToBuild')) - (lib.cmakeFeature "LLVM_ENABLE_PROJECTS" (lib.concatStringsSep ";" llvmProjectsToBuild)) - (lib.cmakeFeature "LLVM_HOST_TRIPLE" stdenv.hostPlatform.config) - (lib.cmakeFeature "LLVM_DEFAULT_TARGET_TRIPLE" stdenv.hostPlatform.config) - (lib.cmakeBool "LLVM_INSTALL_UTILS" true) - (lib.cmakeBool "LLVM_INCLUDE_DOCS" (buildDocs || buildMan)) - (lib.cmakeBool "MLIR_INCLUDE_DOCS" (buildDocs || buildMan)) - (lib.cmakeBool "LLVM_BUILD_DOCS" (buildDocs || buildMan)) - # Way too slow, only uses one core - # (lib.cmakeBool "LLVM_ENABLE_DOXYGEN" (buildDocs || buildMan)) - (lib.cmakeBool "LLVM_ENABLE_SPHINX" (buildDocs || buildMan)) - (lib.cmakeBool "SPHINX_OUTPUT_HTML" buildDocs) - (lib.cmakeBool "SPHINX_OUTPUT_MAN" buildMan) - (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) - (lib.cmakeBool "LLVM_INCLUDE_TESTS" buildTests) - (lib.cmakeBool "MLIR_INCLUDE_TESTS" buildTests) - (lib.cmakeBool "LLVM_BUILD_TESTS" buildTests) - # Cross compilation code taken/modified from LLVM 16 derivation - ] - ++ lib.optionals (!isNative) ( - let - nativeToolchainFlags = - let - nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; - nativeBintools = nativeCC.bintools.bintools; - in - [ - (lib.cmakeFeature "CMAKE_C_COMPILER" "${nativeCC}/bin/${nativeCC.targetPrefix}cc") - (lib.cmakeFeature "CMAKE_CXX_COMPILER" "${nativeCC}/bin/${nativeCC.targetPrefix}c++") - (lib.cmakeFeature "CMAKE_AR" "${nativeBintools}/bin/${nativeBintools.targetPrefix}ar") - (lib.cmakeFeature "CMAKE_STRIP" "${nativeBintools}/bin/${nativeBintools.targetPrefix}strip") - (lib.cmakeFeature "CMAKE_RANLIB" "${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib") - ]; - - # We need to repass the custom GNUInstallDirs values, otherwise CMake - # will choose them for us, leading to wrong results in llvm-config-native - nativeInstallFlags = [ - (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "out")) - (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "${placeholder "out"}/bin") - (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "${placeholder "out"}/include") - (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "${placeholder "out"}/lib") - (lib.cmakeFeature "CMAKE_INSTALL_LIBEXECDIR" "${placeholder "out"}/libexec") + cmakeFlags = [ + (lib.cmakeFeature "LLVM_TARGETS_TO_BUILD" (lib.concatStringsSep ";" llvmTargetsToBuild')) + (lib.cmakeFeature "LLVM_ENABLE_PROJECTS" (lib.concatStringsSep ";" llvmProjectsToBuild)) + (lib.cmakeFeature "LLVM_HOST_TRIPLE" stdenv.hostPlatform.config) + (lib.cmakeFeature "LLVM_DEFAULT_TARGET_TRIPLE" stdenv.hostPlatform.config) + (lib.cmakeBool "LLVM_INSTALL_UTILS" true) + (lib.cmakeBool "LLVM_INCLUDE_DOCS" (buildDocs || buildMan)) + (lib.cmakeBool "MLIR_INCLUDE_DOCS" (buildDocs || buildMan)) + (lib.cmakeBool "LLVM_BUILD_DOCS" (buildDocs || buildMan)) + # Way too slow, only uses one core + # (lib.cmakeBool "LLVM_ENABLE_DOXYGEN" (buildDocs || buildMan)) + (lib.cmakeBool "LLVM_ENABLE_SPHINX" (buildDocs || buildMan)) + (lib.cmakeBool "SPHINX_OUTPUT_HTML" buildDocs) + (lib.cmakeBool "SPHINX_OUTPUT_MAN" buildMan) + (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) + (lib.cmakeBool "LLVM_INCLUDE_TESTS" buildTests) + (lib.cmakeBool "MLIR_INCLUDE_TESTS" buildTests) + (lib.cmakeBool "LLVM_BUILD_TESTS" buildTests) + # Cross compilation code taken/modified from LLVM 16 derivation + ] + ++ lib.optionals (!isNative) ( + let + nativeToolchainFlags = + let + nativeCC = pkgsBuildBuild.targetPackages.stdenv.cc; + nativeBintools = nativeCC.bintools.bintools; + in + [ + (lib.cmakeFeature "CMAKE_C_COMPILER" "${nativeCC}/bin/${nativeCC.targetPrefix}cc") + (lib.cmakeFeature "CMAKE_CXX_COMPILER" "${nativeCC}/bin/${nativeCC.targetPrefix}c++") + (lib.cmakeFeature "CMAKE_AR" "${nativeBintools}/bin/${nativeBintools.targetPrefix}ar") + (lib.cmakeFeature "CMAKE_STRIP" "${nativeBintools}/bin/${nativeBintools.targetPrefix}strip") + (lib.cmakeFeature "CMAKE_RANLIB" "${nativeBintools}/bin/${nativeBintools.targetPrefix}ranlib") ]; - in - [ - (lib.cmakeBool "CMAKE_CROSSCOMPILING" true) - (lib.cmakeFeature "CROSS_TOOLCHAIN_FLAGS_NATIVE" ( - lib.concatStringsSep ";" ( - lib.concatLists [ - nativeToolchainFlags - nativeInstallFlags - ] - ) - )) - ] - ); + + # We need to repass the custom GNUInstallDirs values, otherwise CMake + # will choose them for us, leading to wrong results in llvm-config-native + nativeInstallFlags = [ + (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "out")) + (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "${placeholder "out"}/bin") + (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "${placeholder "out"}/include") + (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "${placeholder "out"}/lib") + (lib.cmakeFeature "CMAKE_INSTALL_LIBEXECDIR" "${placeholder "out"}/libexec") + ]; + in + [ + (lib.cmakeBool "CMAKE_CROSSCOMPILING" true) + (lib.cmakeFeature "CROSS_TOOLCHAIN_FLAGS_NATIVE" ( + lib.concatStringsSep ";" ( + lib.concatLists [ + nativeToolchainFlags + nativeInstallFlags + ] + ) + )) + ] + ); postPatch = # `CMake Error: cannot write to file "/build/source/llvm/build/lib/cmake/mlir/MLIRTargets.cmake": Permission denied` @@ -201,13 +199,12 @@ stdenv.mkDerivation (finalAttrs: { rm llvm/test/tools/llvm-exegesis/AArch64/latency-by-opcode-name.s ''; - postInstall = - '' - cp ${lib.getExe lit} $out/bin/llvm-lit - '' - + (lib.optionalString (!isNative) '' - cp -a NATIVE/bin/llvm-config $out/bin/llvm-config-native - ''); + postInstall = '' + cp ${lib.getExe lit} $out/bin/llvm-lit + '' + + (lib.optionalString (!isNative) '' + cp -a NATIVE/bin/llvm-config $out/bin/llvm-config-native + ''); doCheck = buildTests; diff --git a/pkgs/by-name/tr/trlib/package.nix b/pkgs/by-name/tr/trlib/package.nix index a3770293dd02..aec21ad636bf 100644 --- a/pkgs/by-name/tr/trlib/package.nix +++ b/pkgs/by-name/tr/trlib/package.nix @@ -31,12 +31,13 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ cmake ]; - buildInputs = - [ blas ] - ++ lib.optionals pythonSupport [ - python3Packages.cython - python3Packages.numpy - ]; + buildInputs = [ + blas + ] + ++ lib.optionals pythonSupport [ + python3Packages.cython + python3Packages.numpy + ]; cmakeFlags = [ (lib.cmakeBool "TRLIB_BUILD_PYTHON3" pythonSupport) ]; diff --git a/pkgs/by-name/tr/trunk-recorder/package.nix b/pkgs/by-name/tr/trunk-recorder/package.nix index c79b8c590a5f..0ee5832d990b 100644 --- a/pkgs/by-name/tr/trunk-recorder/package.nix +++ b/pkgs/by-name/tr/trunk-recorder/package.nix @@ -40,20 +40,19 @@ stdenv.mkDerivation rec { pkg-config makeWrapper ]; - buildInputs = - [ - boost - curl - gmp - gnuradio - gnuradioPackages.osmosdr - openssl - spdlog - uhd - volk - ] - ++ lib.optionals hackrfSupport [ hackrf ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ mpir ]; + buildInputs = [ + boost + curl + gmp + gnuradio + gnuradioPackages.osmosdr + openssl + spdlog + uhd + volk + ] + ++ lib.optionals hackrfSupport [ hackrf ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ mpir ]; postPatch = '' # fix broken symlink diff --git a/pkgs/by-name/ts/tsid/package.nix b/pkgs/by-name/ts/tsid/package.nix index 73746434696f..bdc1bae1acd9 100644 --- a/pkgs/by-name/ts/tsid/package.nix +++ b/pkgs/by-name/ts/tsid/package.nix @@ -36,25 +36,23 @@ stdenv.mkDerivation (finalAttrs: { "doc" ]; - nativeBuildInputs = - [ - doxygen - cmake - pkg-config - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pythonImportsCheckHook - ]; + nativeBuildInputs = [ + doxygen + cmake + pkg-config + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pythonImportsCheckHook + ]; - propagatedBuildInputs = - [ - eiquadprog - osqp-eigen - proxsuite - ] - ++ lib.optional (!pythonSupport) pinocchio - ++ lib.optional pythonSupport python3Packages.pinocchio; + propagatedBuildInputs = [ + eiquadprog + osqp-eigen + proxsuite + ] + ++ lib.optional (!pythonSupport) pinocchio + ++ lib.optional pythonSupport python3Packages.pinocchio; doCheck = true; pythonImportsCheck = [ "tsid" ]; diff --git a/pkgs/by-name/ts/tsukimi/package.nix b/pkgs/by-name/ts/tsukimi/package.nix index d55847f6bab5..5e0b84586d11 100644 --- a/pkgs/by-name/ts/tsukimi/package.nix +++ b/pkgs/by-name/ts/tsukimi/package.nix @@ -47,23 +47,22 @@ stdenv.mkDerivation rec { desktop-file-utils ]; - buildInputs = - [ - mpv-unwrapped - ffmpeg - libadwaita - openssl - libepoxy - dbus - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - gst-libav - ]); + buildInputs = [ + mpv-unwrapped + ffmpeg + libadwaita + openssl + libepoxy + dbus + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + gst-libav + ]); nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgramArg = "--version"; diff --git a/pkgs/by-name/tu/tuba/package.nix b/pkgs/by-name/tu/tuba/package.nix index 84604716659e..9a778d5de0b5 100644 --- a/pkgs/by-name/tu/tuba/package.nix +++ b/pkgs/by-name/tu/tuba/package.nix @@ -56,32 +56,31 @@ stdenv.mkDerivation rec { gobject-introspection ]; - buildInputs = - [ - glib - glib-networking - gtksourceview5 - json-glib - libxml2 - libgee - libsoup_3 - gtk4 - libadwaita - libsecret - libwebp - libspelling - icu - ] - ++ (with gst_all_1; [ - gstreamer - gst-libav - gst-plugins-base - (gst-plugins-good.override { gtkSupport = true; }) - gst-plugins-bad - ]) - ++ lib.optionals clapperSupport [ - clapper-unwrapped - ]; + buildInputs = [ + glib + glib-networking + gtksourceview5 + json-glib + libxml2 + libgee + libsoup_3 + gtk4 + libadwaita + libsecret + libwebp + libspelling + icu + ] + ++ (with gst_all_1; [ + gstreamer + gst-libav + gst-plugins-base + (gst-plugins-good.override { gtkSupport = true; }) + gst-plugins-bad + ]) + ++ lib.optionals clapperSupport [ + clapper-unwrapped + ]; mesonFlags = [ (lib.mesonBool "clapper" clapperSupport) diff --git a/pkgs/by-name/tu/tuifimanager/package.nix b/pkgs/by-name/tu/tuifimanager/package.nix index 797bafd0a162..bac360575323 100644 --- a/pkgs/by-name/tu/tuifimanager/package.nix +++ b/pkgs/by-name/tu/tuifimanager/package.nix @@ -44,19 +44,18 @@ lib.throwIf (enableDragAndDrop && !hasDndSupport) makeWrapper ]); - propagatedBuildInputs = - [ - python3.pkgs.send2trash - python3.pkgs.unicurses - ] - ++ (lib.optionals enableDragAndDrop [ - python3.pkgs.pynput - python3.pkgs.pyside6 - python3.pkgs.requests - python3.pkgs.xlib - kdePackages.qtbase - kdePackages.qt6gtk2 - ]); + propagatedBuildInputs = [ + python3.pkgs.send2trash + python3.pkgs.unicurses + ] + ++ (lib.optionals enableDragAndDrop [ + python3.pkgs.pynput + python3.pkgs.pyside6 + python3.pkgs.requests + python3.pkgs.xlib + kdePackages.qtbase + kdePackages.qt6gtk2 + ]); postFixup = let diff --git a/pkgs/by-name/tu/tuntox/package.nix b/pkgs/by-name/tu/tuntox/package.nix index 374e4a30b703..dc3c0fbc1a13 100644 --- a/pkgs/by-name/tu/tuntox/package.nix +++ b/pkgs/by-name/tu/tuntox/package.nix @@ -56,20 +56,19 @@ stdenv.mkDerivation rec { }) ]; - postPatch = - '' - substituteInPlace gitversion.h --replace '7d45afdf7d00a95a8c3687175e2b1669fa1f7745' '365d2e5cbc0e3655fb64c204db0515f5f4cdf5a4' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace Makefile --replace ' -static ' ' ' - substituteInPlace Makefile --replace 'CC=gcc' ' ' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Makefile.mac --replace '.git/HEAD .git/index' ' ' - substituteInPlace Makefile.mac --replace '/usr/local/lib/libtoxcore.a' '${libtoxcore}/lib/libtoxcore.a' - substituteInPlace Makefile.mac --replace '/usr/local/lib/libsodium.a' '${libsodium}/lib/libsodium.dylib' - substituteInPlace Makefile.mac --replace 'CC=gcc' ' ' - ''; + postPatch = '' + substituteInPlace gitversion.h --replace '7d45afdf7d00a95a8c3687175e2b1669fa1f7745' '365d2e5cbc0e3655fb64c204db0515f5f4cdf5a4' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace Makefile --replace ' -static ' ' ' + substituteInPlace Makefile --replace 'CC=gcc' ' ' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Makefile.mac --replace '.git/HEAD .git/index' ' ' + substituteInPlace Makefile.mac --replace '/usr/local/lib/libtoxcore.a' '${libtoxcore}/lib/libtoxcore.a' + substituteInPlace Makefile.mac --replace '/usr/local/lib/libsodium.a' '${libsodium}/lib/libsodium.dylib' + substituteInPlace Makefile.mac --replace 'CC=gcc' ' ' + ''; buildPhase = '''' diff --git a/pkgs/by-name/tu/turbo-unwrapped/package.nix b/pkgs/by-name/tu/turbo-unwrapped/package.nix index 0a4d774116f8..e568735772b3 100644 --- a/pkgs/by-name/tu/turbo-unwrapped/package.nix +++ b/pkgs/by-name/tu/turbo-unwrapped/package.nix @@ -30,16 +30,15 @@ rustPlatform.buildRustPackage (finalAttrs: { useFetchCargoVendor = true; cargoHash = "sha256-PQOUWcUlxATzfgf9QbZT+vLs20/tR4Xmv0lPadzQoZQ="; - nativeBuildInputs = - [ - capnproto - extra-cmake-modules - installShellFiles - pkg-config - protobuf - ] - # https://github.com/vercel/turbo/blob/ea740706e0592b3906ab34c7cfa1768daafc2a84/CONTRIBUTING.md#linux-dependencies - ++ lib.optional stdenv.hostPlatform.isLinux llvmPackages.bintools; + nativeBuildInputs = [ + capnproto + extra-cmake-modules + installShellFiles + pkg-config + protobuf + ] + # https://github.com/vercel/turbo/blob/ea740706e0592b3906ab34c7cfa1768daafc2a84/CONTRIBUTING.md#linux-dependencies + ++ lib.optional stdenv.hostPlatform.isLinux llvmPackages.bintools; buildInputs = [ fontconfig diff --git a/pkgs/by-name/tu/turtle/package.nix b/pkgs/by-name/tu/turtle/package.nix index dbaa77dad881..c2a9188894d9 100644 --- a/pkgs/by-name/tu/turtle/package.nix +++ b/pkgs/by-name/tu/turtle/package.nix @@ -57,23 +57,22 @@ python3Packages.buildPythonApplication rec { # to get $program_PYTHONPATH dontWrapPythonPrograms = true; - postFixup = - '' - makeWrapperArgs+=(''${gappsWrapperArgs[@]}) - wrapPythonPrograms - '' - # Dialogs are not imported, but executed. The same does - # nautilus-python plugins. So we need to patch them as well. - + '' - for dialog_scripts in $out/lib/python*/site-packages/turtlevcs/dialogs/*.py; do - patchPythonScript $dialog_scripts - done - for nautilus_extensions in $out/share/nautilus-python/extensions/*.py; do - patchPythonScript $nautilus_extensions - done - substituteInPlace $out/share/nautilus-python/extensions/turtle_nautilus_compare.py \ - --replace-fail 'Popen(["meld"' 'Popen(["${lib.getExe meld}"' - ''; + postFixup = '' + makeWrapperArgs+=(''${gappsWrapperArgs[@]}) + wrapPythonPrograms + '' + # Dialogs are not imported, but executed. The same does + # nautilus-python plugins. So we need to patch them as well. + + '' + for dialog_scripts in $out/lib/python*/site-packages/turtlevcs/dialogs/*.py; do + patchPythonScript $dialog_scripts + done + for nautilus_extensions in $out/share/nautilus-python/extensions/*.py; do + patchPythonScript $nautilus_extensions + done + substituteInPlace $out/share/nautilus-python/extensions/turtle_nautilus_compare.py \ + --replace-fail 'Popen(["meld"' 'Popen(["${lib.getExe meld}"' + ''; meta = { description = "Graphical interface for version control intended to run on gnome and nautilus"; diff --git a/pkgs/by-name/ty/typst/typst-packages.nix b/pkgs/by-name/ty/typst/typst-packages.nix index 5d5cb8cafbdf..6a460aafb80f 100644 --- a/pkgs/by-name/ty/typst/typst-packages.nix +++ b/pkgs/by-name/ty/typst/typst-packages.nix @@ -39,7 +39,8 @@ lib.makeExtensible ( inherit (packageSpec) description; maintainers = with lib.maintainers; [ cherrypiejam ]; license = lib.map (lib.flip lib.getAttr lib.licensesSpdx) packageSpec.license; - } // (if packageSpec ? "homepage" then { inherit (packageSpec) homepage; } else { }); + } + // (if packageSpec ? "homepage" then { inherit (packageSpec) homepage; } else { }); }) ) { }; } diff --git a/pkgs/by-name/tz/tzdata/package.nix b/pkgs/by-name/tz/tzdata/package.nix index 8b50de33d89a..d88381cd0ab7 100644 --- a/pkgs/by-name/tz/tzdata/package.nix +++ b/pkgs/by-name/tz/tzdata/package.nix @@ -35,36 +35,35 @@ stdenv.mkDerivation (finalAttrs: { ]; propagatedBuildOutputs = [ ]; - makeFlags = - [ - "TOPDIR=${placeholder "out"}" - "TZDIR=${placeholder "out"}/share/zoneinfo" - "BINDIR=${placeholder "bin"}/bin" - "ZICDIR=${placeholder "bin"}/bin" - "ETCDIR=$(TMPDIR)/etc" - "TZDEFAULT=tzdefault-to-remove" - "LIBDIR=${placeholder "dev"}/lib" - "MANDIR=${placeholder "man"}/share/man" - "AWK=awk" - "CURL=:" # disable network access - "CFLAGS=-DHAVE_LINK=0" - "CFLAGS+=-DZIC_BLOAT_DEFAULT=\\\"fat\\\"" - "cc=${stdenv.cc.targetPrefix}cc" - "AR=${stdenv.cc.targetPrefix}ar" - ] - ++ lib.optionals stdenv.hostPlatform.isWindows [ - "CFLAGS+=-DHAVE_DIRECT_H" - "CFLAGS+=-DHAVE_SETENV=0" - "CFLAGS+=-DHAVE_SYMLINK=0" - "CFLAGS+=-DRESERVE_STD_EXT_IDS" - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - "CFLAGS+=-DNETBSD_INSPIRED=0" - "CFLAGS+=-DSTD_INSPIRED=0" - "CFLAGS+=-DUSE_TIMEX_T=1" - "CFLAGS+=-DMKTIME_FITS_IN\\(min,max\\)=0" - "CFLAGS+=-DEXTERN_TIMEOFF=1" - ]; + makeFlags = [ + "TOPDIR=${placeholder "out"}" + "TZDIR=${placeholder "out"}/share/zoneinfo" + "BINDIR=${placeholder "bin"}/bin" + "ZICDIR=${placeholder "bin"}/bin" + "ETCDIR=$(TMPDIR)/etc" + "TZDEFAULT=tzdefault-to-remove" + "LIBDIR=${placeholder "dev"}/lib" + "MANDIR=${placeholder "man"}/share/man" + "AWK=awk" + "CURL=:" # disable network access + "CFLAGS=-DHAVE_LINK=0" + "CFLAGS+=-DZIC_BLOAT_DEFAULT=\\\"fat\\\"" + "cc=${stdenv.cc.targetPrefix}cc" + "AR=${stdenv.cc.targetPrefix}ar" + ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ + "CFLAGS+=-DHAVE_DIRECT_H" + "CFLAGS+=-DHAVE_SETENV=0" + "CFLAGS+=-DHAVE_SYMLINK=0" + "CFLAGS+=-DRESERVE_STD_EXT_IDS" + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + "CFLAGS+=-DNETBSD_INSPIRED=0" + "CFLAGS+=-DSTD_INSPIRED=0" + "CFLAGS+=-DUSE_TIMEX_T=1" + "CFLAGS+=-DMKTIME_FITS_IN\\(min,max\\)=0" + "CFLAGS+=-DEXTERN_TIMEOFF=1" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/uc/ucc/package.nix b/pkgs/by-name/uc/ucc/package.nix index 52037b5c7267..7131f2edf5fa 100644 --- a/pkgs/by-name/uc/ucc/package.nix +++ b/pkgs/by-name/uc/ucc/package.nix @@ -70,16 +70,18 @@ effectiveStdenv.mkDerivation (finalAttrs: { autoconf automake libtool - ] ++ optionals enableCuda [ cuda_nvcc ]; + ] + ++ optionals enableCuda [ cuda_nvcc ]; - buildInputs = - [ ucx ] - ++ optionals enableCuda [ - cuda_cccl - cuda_cudart - cuda_nvml_dev - nccl - ]; + buildInputs = [ + ucx + ] + ++ optionals enableCuda [ + cuda_cccl + cuda_cudart + cuda_nvml_dev + nccl + ]; # NOTE: With `__structuredAttrs` enabled, `LDFLAGS` must be set under `env` so it is assured to be a string; # otherwise, we might have forgotten to convert it to a string and Nix would make LDFLAGS a shell variable diff --git a/pkgs/by-name/uc/uclibc-ng/package.nix b/pkgs/by-name/uc/uclibc-ng/package.nix index e733701f5e62..40bfcf94a53c 100644 --- a/pkgs/by-name/uc/uclibc-ng/package.nix +++ b/pkgs/by-name/uc/uclibc-ng/package.nix @@ -36,31 +36,30 @@ let ''; # UCLIBC_SUSV4_LEGACY defines 'tmpnam', needed for gcc libstdc++ builds. - nixConfig = - '' - RUNTIME_PREFIX "/" - DEVEL_PREFIX "/" - UCLIBC_HAS_WCHAR y - UCLIBC_HAS_FTW y - UCLIBC_HAS_RPC y - DO_C99_MATH y - UCLIBC_HAS_PROGRAM_INVOCATION_NAME y - UCLIBC_HAS_RESOLVER_SUPPORT y - UCLIBC_SUSV4_LEGACY y - UCLIBC_HAS_THREADS_NATIVE y - KERNEL_HEADERS "${linuxHeaders}/include" - '' - + lib.optionalString (stdenv.hostPlatform.gcc.float or "" == "soft") '' - UCLIBC_HAS_FPU n - '' - + lib.optionalString (stdenv.hostPlatform.isAarch32 && isCross) '' - CONFIG_ARM_EABI y - ARCH_WANTS_BIG_ENDIAN n - ARCH_BIG_ENDIAN n - ARCH_WANTS_LITTLE_ENDIAN y - ARCH_LITTLE_ENDIAN y - UCLIBC_HAS_FPU n - ''; + nixConfig = '' + RUNTIME_PREFIX "/" + DEVEL_PREFIX "/" + UCLIBC_HAS_WCHAR y + UCLIBC_HAS_FTW y + UCLIBC_HAS_RPC y + DO_C99_MATH y + UCLIBC_HAS_PROGRAM_INVOCATION_NAME y + UCLIBC_HAS_RESOLVER_SUPPORT y + UCLIBC_SUSV4_LEGACY y + UCLIBC_HAS_THREADS_NATIVE y + KERNEL_HEADERS "${linuxHeaders}/include" + '' + + lib.optionalString (stdenv.hostPlatform.gcc.float or "" == "soft") '' + UCLIBC_HAS_FPU n + '' + + lib.optionalString (stdenv.hostPlatform.isAarch32 && isCross) '' + CONFIG_ARM_EABI y + ARCH_WANTS_BIG_ENDIAN n + ARCH_BIG_ENDIAN n + ARCH_WANTS_LITTLE_ENDIAN y + ARCH_LITTLE_ENDIAN y + UCLIBC_HAS_FPU n + ''; in stdenv.mkDerivation (finalAttrs: { pname = "uclibc-ng"; @@ -90,15 +89,14 @@ stdenv.mkDerivation (finalAttrs: { depsBuildBuild = [ buildPackages.stdenv.cc ]; - makeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - "TARGET_ARCH=${stdenv.hostPlatform.linuxArch}" - "VERBOSE=1" - ] - ++ lib.optionals (isCross) [ - "CROSS=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + "TARGET_ARCH=${stdenv.hostPlatform.linuxArch}" + "VERBOSE=1" + ] + ++ lib.optionals (isCross) [ + "CROSS=${stdenv.cc.targetPrefix}" + ]; # `make libpthread/nptl/sysdeps/unix/sysv/linux/lowlevelrwlock.h`: # error: bits/sysnum.h: No such file or directory diff --git a/pkgs/by-name/uc/ucx/package.nix b/pkgs/by-name/uc/ucx/package.nix index 120bdea332eb..a2df302dd232 100644 --- a/pkgs/by-name/uc/ucx/package.nix +++ b/pkgs/by-name/uc/ucx/package.nix @@ -53,48 +53,45 @@ stdenv'.mkDerivation rec { "dev" ]; - nativeBuildInputs = - [ - autoreconfHook - doxygen - pkg-config - ] - ++ lib.optionals enableCuda [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + autoreconfHook + doxygen + pkg-config + ] + ++ lib.optionals enableCuda [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; - buildInputs = - [ - libbfd - libiberty - numactl - perl - rdma-core - zlib - ] - ++ lib.optionals enableCuda [ - cudaPackages.cuda_cudart - cudaPackages.cuda_nvml_dev + buildInputs = [ + libbfd + libiberty + numactl + perl + rdma-core + zlib + ] + ++ lib.optionals enableCuda [ + cudaPackages.cuda_cudart + cudaPackages.cuda_nvml_dev - ] - ++ lib.optionals enableRocm rocmList; + ] + ++ lib.optionals enableRocm rocmList; LDFLAGS = lib.optionals enableCuda [ # Fake libnvidia-ml.so (the real one is deployed impurely) "-L${lib.getLib cudaPackages.cuda_nvml_dev}/lib/stubs" ]; - configureFlags = - [ - "--with-rdmacm=${lib.getDev rdma-core}" - "--with-dc" - "--with-rc" - "--with-dm" - "--with-verbs=${lib.getDev rdma-core}" - ] - ++ lib.optionals enableCuda [ "--with-cuda=${cudaPackages.cuda_cudart}" ] - ++ lib.optional enableRocm "--with-rocm=${rocm}"; + configureFlags = [ + "--with-rdmacm=${lib.getDev rdma-core}" + "--with-dc" + "--with-rc" + "--with-dm" + "--with-verbs=${lib.getDev rdma-core}" + ] + ++ lib.optionals enableCuda [ "--with-cuda=${cudaPackages.cuda_cudart}" ] + ++ lib.optional enableRocm "--with-rocm=${rocm}"; postInstall = '' find $out/lib/ -name "*.la" -exec rm -f \{} \; diff --git a/pkgs/by-name/ue/ueberzugpp/package.nix b/pkgs/by-name/ue/ueberzugpp/package.nix index 3dc7bdc20630..8cf7a044fbf6 100644 --- a/pkgs/by-name/ue/ueberzugpp/package.nix +++ b/pkgs/by-name/ue/ueberzugpp/package.nix @@ -43,45 +43,43 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals enableWayland [ - wayland-scanner - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals enableWayland [ + wayland-scanner + ]; - buildInputs = - [ - openssl - zeromq - cppzmq - tbb_2021 - spdlog - libsodium - fmt - vips - nlohmann_json - libsixel - microsoft-gsl - chafa - cli11 - libexif - range-v3 - ] - ++ lib.optionals enableOpencv [ - opencv - ] - ++ lib.optionals enableWayland [ - extra-cmake-modules - wayland - wayland-protocols - ] - ++ lib.optionals enableX11 [ - xorg.libX11 - xorg.xcbutilimage - ]; + buildInputs = [ + openssl + zeromq + cppzmq + tbb_2021 + spdlog + libsodium + fmt + vips + nlohmann_json + libsixel + microsoft-gsl + chafa + cli11 + libexif + range-v3 + ] + ++ lib.optionals enableOpencv [ + opencv + ] + ++ lib.optionals enableWayland [ + extra-cmake-modules + wayland + wayland-protocols + ] + ++ lib.optionals enableX11 [ + xorg.libX11 + xorg.xcbutilimage + ]; cmakeFlags = lib.optionals (!enableOpencv) [ diff --git a/pkgs/by-name/ue/ueviewer/package.nix b/pkgs/by-name/ue/ueviewer/package.nix index 510184096cab..629a7cd64b62 100644 --- a/pkgs/by-name/ue/ueviewer/package.nix +++ b/pkgs/by-name/ue/ueviewer/package.nix @@ -58,16 +58,15 @@ gccStdenv.mkDerivation (finalAttrs: { perl ]; - buildInputs = - [ - libpng - zlib - ] - ++ lib.optionals (!gccStdenv.hostPlatform.isDarwin) [ - libGL - libX11 - SDL2 - ]; + buildInputs = [ + libpng + zlib + ] + ++ lib.optionals (!gccStdenv.hostPlatform.isDarwin) [ + libGL + libX11 + SDL2 + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/uf/ufoai/package.nix b/pkgs/by-name/uf/ufoai/package.nix index 54097f40af11..6335501d0fb9 100644 --- a/pkgs/by-name/uf/ufoai/package.nix +++ b/pkgs/by-name/uf/ufoai/package.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-release" "--enable-sse" - ] ++ lib.optional enableEditor "--enable-uforadiant"; + ] + ++ lib.optional enableEditor "--enable-uforadiant"; buildInputs = [ libtheora diff --git a/pkgs/by-name/uf/uftrace/package.nix b/pkgs/by-name/uf/uftrace/package.nix index 3a052d100d91..3f13f6481481 100644 --- a/pkgs/by-name/uf/uftrace/package.nix +++ b/pkgs/by-name/uf/uftrace/package.nix @@ -29,15 +29,14 @@ stdenv.mkDerivation rec { pkg-config pandoc ]; - buildInputs = - [ - capstone - elfutils - libtraceevent - ncurses - ] - ++ lib.optional withLuaJIT luajit - ++ lib.optional withPython python3; + buildInputs = [ + capstone + elfutils + libtraceevent + ncurses + ] + ++ lib.optional withLuaJIT luajit + ++ lib.optional withPython python3; # libmcount.so dlopens python and luajit, make sure they're in the RUNPATH preBuild = diff --git a/pkgs/by-name/ug/uget/package.nix b/pkgs/by-name/ug/uget/package.nix index 3c46d5741cef..addbf6e1278e 100644 --- a/pkgs/by-name/ug/uget/package.nix +++ b/pkgs/by-name/ug/uget/package.nix @@ -39,21 +39,20 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - openssl - curl - libnotify - libappindicator-gtk3 - gtk3 - (lib.getLib dconf) - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - ]) - ++ (lib.optional aria2Support aria2); + buildInputs = [ + openssl + curl + libnotify + libappindicator-gtk3 + gtk3 + (lib.getLib dconf) + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + ]) + ++ (lib.optional aria2Support aria2); enableParallelBuilding = true; diff --git a/pkgs/by-name/uh/uhd/package.nix b/pkgs/by-name/uh/uhd/package.nix index 64aa72d39883..07e1e9bb5c73 100644 --- a/pkgs/by-name/uh/uhd/package.nix +++ b/pkgs/by-name/uh/uhd/package.nix @@ -98,58 +98,57 @@ stdenv.mkDerivation (finalAttrs: { ]; }; - cmakeFlags = - [ - "-DENABLE_LIBUHD=ON" - "-DENABLE_USB=ON" - # Regardless of doCheck, we want to build the tests to help us gain - # confident that the package is OK. - "-DENABLE_TESTS=ON" - (cmakeBool "ENABLE_EXAMPLES" enableExamples) - (cmakeBool "ENABLE_UTILS" enableUtils) - (cmakeBool "ENABLE_C_API" enableCApi) - (cmakeBool "ENABLE_PYTHON_API" enablePythonApi) - /* - Otherwise python tests fail. Using a dedicated pythonEnv for either or both - nativeBuildInputs and buildInputs makes upstream's cmake scripts fail to - install the Python API as reported on our end at [1] (we don't want - upstream to think we are in a virtual environment because we use - python3.withPackages...). + cmakeFlags = [ + "-DENABLE_LIBUHD=ON" + "-DENABLE_USB=ON" + # Regardless of doCheck, we want to build the tests to help us gain + # confident that the package is OK. + "-DENABLE_TESTS=ON" + (cmakeBool "ENABLE_EXAMPLES" enableExamples) + (cmakeBool "ENABLE_UTILS" enableUtils) + (cmakeBool "ENABLE_C_API" enableCApi) + (cmakeBool "ENABLE_PYTHON_API" enablePythonApi) + /* + Otherwise python tests fail. Using a dedicated pythonEnv for either or both + nativeBuildInputs and buildInputs makes upstream's cmake scripts fail to + install the Python API as reported on our end at [1] (we don't want + upstream to think we are in a virtual environment because we use + python3.withPackages...). - Putting simply the python dependencies in the nativeBuildInputs and - buildInputs as they are now from some reason makes the `python` in the - checkPhase fail to find the python dependencies, as reported at [2]. Even - using nativeCheckInputs with the python dependencies, or using a - `python3.withPackages` wrapper in nativeCheckInputs, doesn't help, as the - `python` found in $PATH first is the one from nativeBuildInputs. + Putting simply the python dependencies in the nativeBuildInputs and + buildInputs as they are now from some reason makes the `python` in the + checkPhase fail to find the python dependencies, as reported at [2]. Even + using nativeCheckInputs with the python dependencies, or using a + `python3.withPackages` wrapper in nativeCheckInputs, doesn't help, as the + `python` found in $PATH first is the one from nativeBuildInputs. - [1]: https://github.com/NixOS/nixpkgs/pull/307435 - [2]: https://discourse.nixos.org/t/missing-python-package-in-checkphase/9168/ + [1]: https://github.com/NixOS/nixpkgs/pull/307435 + [2]: https://discourse.nixos.org/t/missing-python-package-in-checkphase/9168/ - Hence we use upstream's provided cmake flag to control which python - interpreter they will use to run the the python tests. - */ - "-DRUNTIME_PYTHON_EXECUTABLE=${lib.getExe finalAttrs.passthru.runtimePython}" - (cmakeBool "ENABLE_DPDK" enableDpdk) - # Devices - (cmakeBool "ENABLE_OCTOCLOCK" enableOctoClock) - (cmakeBool "ENABLE_MPMD" enableMpmd) - (cmakeBool "ENABLE_B100" enableB100) - (cmakeBool "ENABLE_B200" enableB200) - (cmakeBool "ENABLE_USRP1" enableUsrp1) - (cmakeBool "ENABLE_USRP2" enableUsrp2) - (cmakeBool "ENABLE_X300" enableX300) - (cmakeBool "ENABLE_N300" enableN300) - (cmakeBool "ENABLE_N320" enableN320) - (cmakeBool "ENABLE_E300" enableE300) - (cmakeBool "ENABLE_E320" enableE320) - # TODO: Check if this still needed - # ABI differences GCC 7.1 - # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector::iterator {aka __gnu_cxx::__normal_iterator >}' changed in GCC 7.1 - ] - ++ optionals stdenv.hostPlatform.isAarch32 [ - "-DCMAKE_CXX_FLAGS=-Wno-psabi" - ]; + Hence we use upstream's provided cmake flag to control which python + interpreter they will use to run the the python tests. + */ + "-DRUNTIME_PYTHON_EXECUTABLE=${lib.getExe finalAttrs.passthru.runtimePython}" + (cmakeBool "ENABLE_DPDK" enableDpdk) + # Devices + (cmakeBool "ENABLE_OCTOCLOCK" enableOctoClock) + (cmakeBool "ENABLE_MPMD" enableMpmd) + (cmakeBool "ENABLE_B100" enableB100) + (cmakeBool "ENABLE_B200" enableB200) + (cmakeBool "ENABLE_USRP1" enableUsrp1) + (cmakeBool "ENABLE_USRP2" enableUsrp2) + (cmakeBool "ENABLE_X300" enableX300) + (cmakeBool "ENABLE_N300" enableN300) + (cmakeBool "ENABLE_N320" enableN320) + (cmakeBool "ENABLE_E300" enableE300) + (cmakeBool "ENABLE_E320" enableE320) + # TODO: Check if this still needed + # ABI differences GCC 7.1 + # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector::iterator {aka __gnu_cxx::__normal_iterator >}' changed in GCC 7.1 + ] + ++ optionals stdenv.hostPlatform.isAarch32 [ + "-DCMAKE_CXX_FLAGS=-Wno-psabi" + ]; nativeBuildInputs = [ cmake @@ -183,14 +182,13 @@ stdenv.mkDerivation (finalAttrs: { # Build only the host software preConfigure = "cd host"; - postPhases = - [ - "installFirmware" - "removeInstalledTests" - ] - ++ optionals (enableUtils && stdenv.hostPlatform.isLinux) [ - "moveUdevRules" - ]; + postPhases = [ + "installFirmware" + "removeInstalledTests" + ] + ++ optionals (enableUtils && stdenv.hostPlatform.isLinux) [ + "moveUdevRules" + ]; # UHD expects images in `$CMAKE_INSTALL_PREFIX/share/uhd/images` installFirmware = '' diff --git a/pkgs/by-name/uh/uhttpmock/package.nix b/pkgs/by-name/uh/uhttpmock/package.nix index 191347e72259..92d4fa62a5ac 100644 --- a/pkgs/by-name/uh/uhttpmock/package.nix +++ b/pkgs/by-name/uh/uhttpmock/package.nix @@ -33,19 +33,18 @@ stdenv.mkDerivation rec { }; strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - vala - gtk-doc - docbook-xsl-nons - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + vala + gtk-doc + docbook-xsl-nons + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/uh/uhttpmock_1_0/package.nix b/pkgs/by-name/uh/uhttpmock_1_0/package.nix index 154d9db47da8..48ccc86d5690 100644 --- a/pkgs/by-name/uh/uhttpmock_1_0/package.nix +++ b/pkgs/by-name/uh/uhttpmock_1_0/package.nix @@ -34,19 +34,18 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - vala - gtk-doc - docbook-xsl-nons - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + vala + gtk-doc + docbook-xsl-nons + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/by-name/uh/uhub/package.nix b/pkgs/by-name/uh/uhub/package.nix index 5880c7bd0651..1818b724c140 100644 --- a/pkgs/by-name/uh/uhub/package.nix +++ b/pkgs/by-name/uh/uhub/package.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation { buildInputs = [ sqlite systemd - ] ++ lib.optional tlsSupport openssl; + ] + ++ lib.optional tlsSupport openssl; postPatch = '' substituteInPlace CMakeLists.txt \ diff --git a/pkgs/by-name/ui/uiua/package.nix b/pkgs/by-name/ui/uiua/package.nix index c3de58883051..6123b2bd100c 100644 --- a/pkgs/by-name/ui/uiua/package.nix +++ b/pkgs/by-name/ui/uiua/package.nix @@ -45,15 +45,17 @@ rustPlatform.buildRustPackage (finalAttrs: { lib.optionals (webcamSupport || stdenv.hostPlatform.isDarwin) [ rustPlatform.bindgenHook ] ++ lib.optionals audioSupport [ pkg-config ]; - buildInputs = - [ libffi ] # we force dynamic linking our own libffi below - ++ lib.optionals (audioSupport && stdenv.hostPlatform.isLinux) [ alsa-lib ]; + buildInputs = [ + libffi + ] # we force dynamic linking our own libffi below + ++ lib.optionals (audioSupport && stdenv.hostPlatform.isLinux) [ alsa-lib ]; - buildFeatures = - [ "libffi/system" ] # force libffi to be linked dynamically instead of rebuilding it - ++ lib.optional audioSupport "audio" - ++ lib.optional webcamSupport "webcam" - ++ lib.optional windowSupport "window"; + buildFeatures = [ + "libffi/system" + ] # force libffi to be linked dynamically instead of rebuilding it + ++ lib.optional audioSupport "audio" + ++ lib.optional webcamSupport "webcam" + ++ lib.optional windowSupport "window"; postFixup = let diff --git a/pkgs/by-name/ul/ultrastardx/package.nix b/pkgs/by-name/ul/ultrastardx/package.nix index d481ed43eedb..f70e5cfd7e67 100644 --- a/pkgs/by-name/ul/ultrastardx/package.nix +++ b/pkgs/by-name/ul/ultrastardx/package.nix @@ -61,7 +61,8 @@ stdenv.mkDerivation rec { buildInputs = [ fpc libpng - ] ++ sharedLibs; + ] + ++ sharedLibs; preBuild = let diff --git a/pkgs/by-name/um/umockdev/package.nix b/pkgs/by-name/um/umockdev/package.nix index 2c56857f401c..ae00af50d2eb 100644 --- a/pkgs/by-name/um/umockdev/package.nix +++ b/pkgs/by-name/um/umockdev/package.nix @@ -49,19 +49,18 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - docbook-xsl-nons - gobject-introspection - gtk-doc - meson - ninja - pkg-config - vala - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + docbook-xsl-nons + gobject-introspection + gtk-doc + meson + ninja + pkg-config + vala + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ glib diff --git a/pkgs/by-name/um/umpire/package.nix b/pkgs/by-name/um/umpire/package.nix index ff95f9047dc2..ca79dc4de4a1 100644 --- a/pkgs/by-name/um/umpire/package.nix +++ b/pkgs/by-name/um/umpire/package.nix @@ -22,13 +22,12 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; buildInputs = lib.optionals cudaSupport ( with cudaPackages; diff --git a/pkgs/by-name/un/unblob/package.nix b/pkgs/by-name/un/unblob/package.nix index c5393e37f379..b518c395d3dc 100644 --- a/pkgs/by-name/un/unblob/package.nix +++ b/pkgs/by-name/un/unblob/package.nix @@ -42,7 +42,8 @@ let upx zstd lz4 - ] ++ lib.optional stdenvNoCC.isLinux partclone; + ] + ++ lib.optional stdenvNoCC.isLinux partclone; in python3.pkgs.buildPythonApplication rec { pname = "unblob"; diff --git a/pkgs/by-name/un/unbound/package.nix b/pkgs/by-name/un/unbound/package.nix index 2a4fca39cae1..41948b705f0d 100644 --- a/pkgs/by-name/un/unbound/package.nix +++ b/pkgs/by-name/un/unbound/package.nix @@ -81,72 +81,70 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals withPythonModule [ swig ]; - buildInputs = - [ - openssl - nettle - expat - libevent - ] - ++ lib.optionals withSystemd [ systemd ] - ++ lib.optionals withDoH [ libnghttp2 ] - ++ lib.optionals withPythonModule [ python ]; + buildInputs = [ + openssl + nettle + expat + libevent + ] + ++ lib.optionals withSystemd [ systemd ] + ++ lib.optionals withDoH [ libnghttp2 ] + ++ lib.optionals withPythonModule [ python ]; enableParallelBuilding = true; - configureFlags = - [ - "--with-ssl=${openssl.dev}" - "--with-libexpat=${expat.dev}" - "--with-libevent=${libevent.dev}" - "--localstatedir=/var" - "--sysconfdir=/etc" - "--sbindir=\${out}/bin" - "--with-rootkey-file=${dns-root-data}/root.key" - "--enable-pie" - "--enable-relro-now" - ] - ++ lib.optionals (!withLto) [ - "--disable-flto" - ] - ++ lib.optionals withSystemd [ - "--enable-systemd" - ] - ++ lib.optionals withPythonModule [ - "--with-pythonmodule" - ] - ++ lib.optionals withDynlibModule [ - "--with-dynlibmodule" - ] - ++ lib.optionals withDoH [ - "--with-libnghttp2=${libnghttp2.dev}" - ] - ++ lib.optionals withECS [ - "--enable-subnet" - ] - ++ lib.optionals withDNSCrypt [ - "--enable-dnscrypt" - "--with-libsodium=${ - symlinkJoin { - name = "libsodium-full"; - paths = [ - libsodium.dev - libsodium.out - ]; - } - }" - ] - ++ lib.optionals withDNSTAP [ - "--enable-dnstap" - ] - ++ lib.optionals withTFO [ - "--enable-tfo-client" - "--enable-tfo-server" - ] - ++ lib.optionals withRedis [ - "--enable-cachedb" - "--with-libhiredis=${hiredis}" - ]; + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--with-libexpat=${expat.dev}" + "--with-libevent=${libevent.dev}" + "--localstatedir=/var" + "--sysconfdir=/etc" + "--sbindir=\${out}/bin" + "--with-rootkey-file=${dns-root-data}/root.key" + "--enable-pie" + "--enable-relro-now" + ] + ++ lib.optionals (!withLto) [ + "--disable-flto" + ] + ++ lib.optionals withSystemd [ + "--enable-systemd" + ] + ++ lib.optionals withPythonModule [ + "--with-pythonmodule" + ] + ++ lib.optionals withDynlibModule [ + "--with-dynlibmodule" + ] + ++ lib.optionals withDoH [ + "--with-libnghttp2=${libnghttp2.dev}" + ] + ++ lib.optionals withECS [ + "--enable-subnet" + ] + ++ lib.optionals withDNSCrypt [ + "--enable-dnscrypt" + "--with-libsodium=${ + symlinkJoin { + name = "libsodium-full"; + paths = [ + libsodium.dev + libsodium.out + ]; + } + }" + ] + ++ lib.optionals withDNSTAP [ + "--enable-dnstap" + ] + ++ lib.optionals withTFO [ + "--enable-tfo-client" + "--enable-tfo-server" + ] + ++ lib.optionals withRedis [ + "--enable-cachedb" + "--with-libhiredis=${hiredis}" + ]; PROTOC_C = lib.optionalString withDNSTAP "${protobufc}/bin/protoc-c"; @@ -168,19 +166,18 @@ stdenv.mkDerivation (finalAttrs: { installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf" ]; - postInstall = - '' - make unbound-event-install - '' - + lib.optionalString withMakeWrapper '' - wrapProgram $out/bin/unbound-control-setup \ - --prefix PATH : ${lib.makeBinPath [ openssl ]} - '' - + lib.optionalString (withMakeWrapper && withPythonModule) '' - wrapProgram $out/bin/unbound \ - --prefix PYTHONPATH : "$out/${python.sitePackages}" \ - --argv0 $out/bin/unbound - ''; + postInstall = '' + make unbound-event-install + '' + + lib.optionalString withMakeWrapper '' + wrapProgram $out/bin/unbound-control-setup \ + --prefix PATH : ${lib.makeBinPath [ openssl ]} + '' + + lib.optionalString (withMakeWrapper && withPythonModule) '' + wrapProgram $out/bin/unbound \ + --prefix PYTHONPATH : "$out/${python.sitePackages}" \ + --argv0 $out/bin/unbound + ''; preFixup = lib.optionalString withSlimLib diff --git a/pkgs/by-name/un/uni-vga/package.nix b/pkgs/by-name/un/uni-vga/package.nix index 7c3aa2a186bd..ee7a3d7a55e6 100644 --- a/pkgs/by-name/un/uni-vga/package.nix +++ b/pkgs/by-name/un/uni-vga/package.nix @@ -17,51 +17,48 @@ stdenv.mkDerivation { sha256 = "05sns8h5yspa7xkl81ri7y1yxf5icgsnl497f3xnaryhx11s2rv6"; }; - nativeBuildInputs = - [ - bdftopcf - libfaketime - xorg.fonttosfnt - xorg.mkfontscale - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - perl - kbd - ]; + nativeBuildInputs = [ + bdftopcf + libfaketime + xorg.fonttosfnt + xorg.mkfontscale + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + perl + kbd + ]; postPatch = "patchShebangs ."; - buildPhase = - '' - # convert font to compressed pcf - bdftopcf u_vga16.bdf | gzip -c -9 -n > u_vga16.pcf.gz + buildPhase = '' + # convert font to compressed pcf + bdftopcf u_vga16.bdf | gzip -c -9 -n > u_vga16.pcf.gz - # convert bdf font to otb - faketime -f "1970-01-01 00:00:01" \ - fonttosfnt -v -o u_vga16.otb u_vga16.bdf - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # convert font to compressed psf - ./bdf2psf.pl -s UniCyrX.sfm u_vga16.bdf \ - | psfaddtable - UniCyrX.sfm - \ - | gzip -c -9 -n > u_vga16.psf.gz - ''; + # convert bdf font to otb + faketime -f "1970-01-01 00:00:01" \ + fonttosfnt -v -o u_vga16.otb u_vga16.bdf + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # convert font to compressed psf + ./bdf2psf.pl -s UniCyrX.sfm u_vga16.bdf \ + | psfaddtable - UniCyrX.sfm - \ + | gzip -c -9 -n > u_vga16.psf.gz + ''; - installPhase = - '' - # install pcf and otb (for X11 and GTK applications) - install -m 644 -D *.otb *.pcf.gz -t "$out/share/fonts" - mkfontdir "$out/share/fonts" + installPhase = '' + # install pcf and otb (for X11 and GTK applications) + install -m 644 -D *.otb *.pcf.gz -t "$out/share/fonts" + mkfontdir "$out/share/fonts" - # install bdf font - install -m 644 -D *.bdf -t "$bdf/share/fonts" - mkfontdir "$bdf/share/fonts" + # install bdf font + install -m 644 -D *.bdf -t "$bdf/share/fonts" + mkfontdir "$bdf/share/fonts" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # install psf (for linux virtual terminal) - install -m 644 -D *.psf.gz -t "$out/share/consolefonts" - ''; + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # install psf (for linux virtual terminal) + install -m 644 -D *.psf.gz -t "$out/share/consolefonts" + ''; outputs = [ "out" diff --git a/pkgs/by-name/un/unicorn/package.nix b/pkgs/by-name/un/unicorn/package.nix index 39edf55b76e9..3cb3e80b8c1e 100644 --- a/pkgs/by-name/un/unicorn/package.nix +++ b/pkgs/by-name/un/unicorn/package.nix @@ -18,14 +18,13 @@ stdenv.mkDerivation rec { hash = "sha256-vBggblml+lQFhyNrfIp5GKVQ09fd+ccblKHEzWteMbI="; }; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ]; # Ensure the linker is using atomic when compiling for RISC-V, otherwise fails NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic"; diff --git a/pkgs/by-name/un/unimap/package.nix b/pkgs/by-name/un/unimap/package.nix index 04a4d50f8cbb..7c56633a4d76 100644 --- a/pkgs/by-name/un/unimap/package.nix +++ b/pkgs/by-name/un/unimap/package.nix @@ -24,14 +24,13 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-ShwFHLfDPc3P8J5gV5CFz/2vrQ5xR01C3sYIejyt860="; - nativeBuildInputs = - [ - installShellFiles - makeBinaryWrapper - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch && stdenv.hostPlatform.isLinux) [ - pkg-config - ]; + nativeBuildInputs = [ + installShellFiles + makeBinaryWrapper + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch && stdenv.hostPlatform.isLinux) [ + pkg-config + ]; # only depends on openssl on aarch/arm linux buildInputs = lib.optionals (stdenv.hostPlatform.isAarch && stdenv.hostPlatform.isLinux) [ diff --git a/pkgs/by-name/un/unison-ucm/package.nix b/pkgs/by-name/un/unison-ucm/package.nix index f5a1bd1d2582..4e0d901f623d 100644 --- a/pkgs/by-name/un/unison-ucm/package.nix +++ b/pkgs/by-name/un/unison-ucm/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ makeWrapper - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmp ncurses6 diff --git a/pkgs/by-name/un/unison/package.nix b/pkgs/by-name/un/unison/package.nix index 75ff3c4e2f51..0f6dbf3a698f 100644 --- a/pkgs/by-name/un/unison/package.nix +++ b/pkgs/by-name/un/unison/package.nix @@ -23,15 +23,14 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - ocamlPackages.ocaml - ocamlPackages.findlib - ] - ++ lib.optionals enableX11 [ - copyDesktopItems - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + ocamlPackages.ocaml + ocamlPackages.findlib + ] + ++ lib.optionals enableX11 [ + copyDesktopItems + wrapGAppsHook3 + ]; buildInputs = lib.optionals enableX11 [ gsettings-desktop-schemas ocamlPackages.lablgtk3 @@ -39,7 +38,8 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "PREFIX=$(out)" - ] ++ lib.optionals (!ocamlPackages.ocaml.nativeCompilers) [ "NATIVE=false" ]; + ] + ++ lib.optionals (!ocamlPackages.ocaml.nativeCompilers) [ "NATIVE=false" ]; postInstall = lib.optionalString enableX11 '' install -D $src/icons/U.svg $out/share/icons/hicolor/scalable/apps/unison.svg diff --git a/pkgs/by-name/un/unit/package.nix b/pkgs/by-name/un/unit/package.nix index 7c9ddfee455c..304652f63f2e 100644 --- a/pkgs/by-name/un/unit/package.nix +++ b/pkgs/by-name/un/unit/package.nix @@ -52,29 +52,29 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ which ]; - buildInputs = - [ pcre2.dev ] - ++ optionals withPython3 [ - python3 - ncurses - ] - ++ optional withPHP81 php81-unit - ++ optional withPHP82 php82-unit - ++ optional withPerl perl - ++ optional withRuby_3_1 ruby_3_1 - ++ optional withRuby_3_2 ruby_3_2 - ++ optional withSSL openssl; + buildInputs = [ + pcre2.dev + ] + ++ optionals withPython3 [ + python3 + ncurses + ] + ++ optional withPHP81 php81-unit + ++ optional withPHP82 php82-unit + ++ optional withPerl perl + ++ optional withRuby_3_1 ruby_3_1 + ++ optional withRuby_3_2 ruby_3_2 + ++ optional withSSL openssl; - configureFlags = - [ - "--control=unix:/run/unit/control.unit.sock" - "--pid=/run/unit/unit.pid" - "--user=unit" - "--group=unit" - ] - ++ optional withSSL "--openssl" - ++ optional (!withIPv6) "--no-ipv6" - ++ optional withDebug "--debug"; + configureFlags = [ + "--control=unix:/run/unit/control.unit.sock" + "--pid=/run/unit/unit.pid" + "--user=unit" + "--group=unit" + ] + ++ optional withSSL "--openssl" + ++ optional (!withIPv6) "--no-ipv6" + ++ optional withDebug "--debug"; # Optionally add the PHP derivations used so they can be addressed in the configs usedPhp81 = optionals withPHP81 php81-unit; diff --git a/pkgs/by-name/un/units/package.nix b/pkgs/by-name/un/units/package.nix index e672c87df5fe..9ae7afa4b433 100644 --- a/pkgs/by-name/un/units/package.nix +++ b/pkgs/by-name/un/units/package.nix @@ -27,13 +27,12 @@ stdenv.mkDerivation (finalAttrs: { "man" ]; - buildInputs = - [ - readline - ] - ++ lib.optionals enableCurrenciesUpdater [ - pythonEnv - ]; + buildInputs = [ + readline + ] + ++ lib.optionals enableCurrenciesUpdater [ + pythonEnv + ]; prePatch = lib.optionalString enableCurrenciesUpdater '' substituteInPlace units_cur \ diff --git a/pkgs/by-name/un/universal-ctags/package.nix b/pkgs/by-name/un/universal-ctags/package.nix index abdcd7ffdc61..87fb6ab8bdd1 100644 --- a/pkgs/by-name/un/universal-ctags/package.nix +++ b/pkgs/by-name/un/universal-ctags/package.nix @@ -38,15 +38,14 @@ stdenv.mkDerivation (finalAttrs: { (python3.withPackages (p: [ p.docutils ])) ]; - buildInputs = - [ - libyaml - pcre2 - libxml2 - jansson - ] - ++ lib.optional stdenv.hostPlatform.isDarwin libiconv - ++ lib.optional stdenv.hostPlatform.isLinux libseccomp; + buildInputs = [ + libyaml + pcre2 + libxml2 + jansson + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv + ++ lib.optional stdenv.hostPlatform.isLinux libseccomp; configureFlags = [ "--enable-tmpdir=/tmp" ]; diff --git a/pkgs/by-name/un/unixbench/package.nix b/pkgs/by-name/un/unixbench/package.nix index 2179124818cc..851aab3eb7bc 100644 --- a/pkgs/by-name/un/unixbench/package.nix +++ b/pkgs/by-name/un/unixbench/package.nix @@ -48,34 +48,33 @@ stdenv.mkDerivation rec { installShellFiles ]; - buildInputs = - [ perl ] - ++ lib.optionals withGL [ - xorg.libX11 - xorg.libXext - libGLX - ]; + buildInputs = [ + perl + ] + ++ lib.optionals withGL [ + xorg.libX11 + xorg.libXext + libGLX + ]; - runtimeDependencies = - [ - coreutils - unixtools.net-tools - unixtools.locale - targetPackages.stdenv.cc - gnugrep - gawk - ] - ++ lib.optionals withX11perf [ - xorg.x11perf - ]; + runtimeDependencies = [ + coreutils + unixtools.net-tools + unixtools.locale + targetPackages.stdenv.cc + gnugrep + gawk + ] + ++ lib.optionals withX11perf [ + xorg.x11perf + ]; - makeFlags = - [ - "CC=${stdenv.cc.targetPrefix}cc" - ] - ++ lib.optionals withGL [ - "GRAPHIC_TESTS=defined" - ]; + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + ] + ++ lib.optionals withGL [ + "GRAPHIC_TESTS=defined" + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/un/unoconv/package.nix b/pkgs/by-name/un/unoconv/package.nix index 0291fc19c1dd..e77a62c7f741 100644 --- a/pkgs/by-name/un/unoconv/package.nix +++ b/pkgs/by-name/un/unoconv/package.nix @@ -29,15 +29,14 @@ stdenv.mkDerivation rec { makeFlags=prefix="$out" ''; - postInstall = - '' - sed -i "s|/usr/bin/env python.*|${libreoffice-unwrapped.python.interpreter}|" "$out/bin/unoconv" - wrapProgram "$out/bin/unoconv" \ - --set-default UNO_PATH "${libreoffice-unwrapped}/lib/libreoffice/program/" - '' - + lib.optionalString installSymlinks '' - make install-links prefix="$out" - ''; + postInstall = '' + sed -i "s|/usr/bin/env python.*|${libreoffice-unwrapped.python.interpreter}|" "$out/bin/unoconv" + wrapProgram "$out/bin/unoconv" \ + --set-default UNO_PATH "${libreoffice-unwrapped}/lib/libreoffice/program/" + '' + + lib.optionalString installSymlinks '' + make install-links prefix="$out" + ''; meta = with lib; { description = "Convert between any document format supported by LibreOffice/OpenOffice"; diff --git a/pkgs/by-name/un/unp/package.nix b/pkgs/by-name/un/unp/package.nix index 8c5f1e48c2a4..66c6fefea165 100644 --- a/pkgs/by-name/un/unp/package.nix +++ b/pkgs/by-name/un/unp/package.nix @@ -16,7 +16,8 @@ let file unzip gzip - ] ++ extraBackends; + ] + ++ extraBackends; in stdenv.mkDerivation { diff --git a/pkgs/by-name/un/unzip/package.nix b/pkgs/by-name/un/unzip/package.nix index 7a2f8fc8bd33..a9716e71eafb 100644 --- a/pkgs/by-name/un/unzip/package.nix +++ b/pkgs/by-name/un/unzip/package.nix @@ -26,65 +26,64 @@ stdenv.mkDerivation rec { "-F3" ]; - patches = - [ - ./CVE-2014-8139.diff - ./CVE-2014-8140.diff - ./CVE-2014-8141.diff - ./CVE-2014-9636.diff - ./CVE-2015-7696.diff - ./CVE-2015-7697.diff - ./CVE-2014-9913.patch - ./CVE-2016-9844.patch - ./CVE-2018-18384.patch - ./dont-hardcode-cc.patch - (fetchurl { - url = "https://github.com/madler/unzip/commit/41beb477c5744bc396fa1162ee0c14218ec12213.patch"; - name = "CVE-2019-13232-1.patch"; - sha256 = "04jzd6chg9fw4l5zadkfsrfm5llrd7vhd1dgdjjd29nrvkrjyn14"; - }) - (fetchurl { - url = "https://github.com/madler/unzip/commit/47b3ceae397d21bf822bc2ac73052a4b1daf8e1c.patch"; - name = "CVE-2019-13232-2.patch"; - sha256 = "0iy2wcjyvzwrjk02iszwcpg85fkjxs1bvb9isvdiywszav4yjs32"; - }) - (fetchurl { - url = "https://github.com/madler/unzip/commit/6d351831be705cc26d897db44f878a978f4138fc.patch"; - name = "CVE-2019-13232-3.patch"; - sha256 = "1jvs7dkdqs97qnsqc6hk088alhv8j4c638k65dbib9chh40jd7pf"; - }) - (fetchurl { - urls = [ - # original link (will be dead eventually): - "https://sources.debian.org/data/main/u/unzip/6.0-26%2Bdeb11u1/debian/patches/06-initialize-the-symlink-flag.patch" + patches = [ + ./CVE-2014-8139.diff + ./CVE-2014-8140.diff + ./CVE-2014-8141.diff + ./CVE-2014-9636.diff + ./CVE-2015-7696.diff + ./CVE-2015-7697.diff + ./CVE-2014-9913.patch + ./CVE-2016-9844.patch + ./CVE-2018-18384.patch + ./dont-hardcode-cc.patch + (fetchurl { + url = "https://github.com/madler/unzip/commit/41beb477c5744bc396fa1162ee0c14218ec12213.patch"; + name = "CVE-2019-13232-1.patch"; + sha256 = "04jzd6chg9fw4l5zadkfsrfm5llrd7vhd1dgdjjd29nrvkrjyn14"; + }) + (fetchurl { + url = "https://github.com/madler/unzip/commit/47b3ceae397d21bf822bc2ac73052a4b1daf8e1c.patch"; + name = "CVE-2019-13232-2.patch"; + sha256 = "0iy2wcjyvzwrjk02iszwcpg85fkjxs1bvb9isvdiywszav4yjs32"; + }) + (fetchurl { + url = "https://github.com/madler/unzip/commit/6d351831be705cc26d897db44f878a978f4138fc.patch"; + name = "CVE-2019-13232-3.patch"; + sha256 = "1jvs7dkdqs97qnsqc6hk088alhv8j4c638k65dbib9chh40jd7pf"; + }) + (fetchurl { + urls = [ + # original link (will be dead eventually): + "https://sources.debian.org/data/main/u/unzip/6.0-26%2Bdeb11u1/debian/patches/06-initialize-the-symlink-flag.patch" - "https://gist.github.com/veprbl/41261bb781571e2246ea42d3f37795f5/raw/d8533d8c6223150f76b0f31aec03e185fcde3579/06-initialize-the-symlink-flag.patch" - ]; - sha256 = "1h00djdvgjhwfb60wl4qrxbyfsbbnn1qw6l2hkldnif4m8f8r1zj"; - }) - (fetchurl { - urls = [ - # original link (will be dead eventually): - "https://sources.debian.org/data/main/u/unzip/6.0-27/debian/patches/28-cve-2022-0529-and-cve-2022-0530.patch" + "https://gist.github.com/veprbl/41261bb781571e2246ea42d3f37795f5/raw/d8533d8c6223150f76b0f31aec03e185fcde3579/06-initialize-the-symlink-flag.patch" + ]; + sha256 = "1h00djdvgjhwfb60wl4qrxbyfsbbnn1qw6l2hkldnif4m8f8r1zj"; + }) + (fetchurl { + urls = [ + # original link (will be dead eventually): + "https://sources.debian.org/data/main/u/unzip/6.0-27/debian/patches/28-cve-2022-0529-and-cve-2022-0530.patch" - "https://web.archive.org/web/20230106200319/https://sources.debian.org/data/main/u/unzip/6.0-27/debian/patches/28-cve-2022-0529-and-cve-2022-0530.patch" - ]; - sha256 = "sha256-on79jElQ+z2ULWAq14RpluAqr9d6itHiZwDkKubBzTc="; - }) - # Clang 16 makes implicit declarations an error by default for C99 and newer, causing the - # configure script to fail to detect errno and the directory libraries on Darwin. - ./implicit-declarations-fix.patch - (fetchurl { - name = "CVE-2021-4217.patch"; - url = "https://git.launchpad.net/ubuntu/+source/unzip/plain/debian/patches/CVE-2021-4217.patch?id=94a790fcbb5d6c53cdf5d786bcaa0b8dc10309b6"; - hash = "sha256-YKE4jVNSlrHLbszXNYYRtAQs0ly4AsodEz6tadMIVqE="; - }) - ] - ++ lib.optional enableNLS (fetchurl { - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/unzip/files/unzip-6.0-natspec.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; - name = "unzip-6.0-natspec.patch"; - sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1"; - }); + "https://web.archive.org/web/20230106200319/https://sources.debian.org/data/main/u/unzip/6.0-27/debian/patches/28-cve-2022-0529-and-cve-2022-0530.patch" + ]; + sha256 = "sha256-on79jElQ+z2ULWAq14RpluAqr9d6itHiZwDkKubBzTc="; + }) + # Clang 16 makes implicit declarations an error by default for C99 and newer, causing the + # configure script to fail to detect errno and the directory libraries on Darwin. + ./implicit-declarations-fix.patch + (fetchurl { + name = "CVE-2021-4217.patch"; + url = "https://git.launchpad.net/ubuntu/+source/unzip/plain/debian/patches/CVE-2021-4217.patch?id=94a790fcbb5d6c53cdf5d786bcaa0b8dc10309b6"; + hash = "sha256-YKE4jVNSlrHLbszXNYYRtAQs0ly4AsodEz6tadMIVqE="; + }) + ] + ++ lib.optional enableNLS (fetchurl { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/unzip/files/unzip-6.0-natspec.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; + name = "unzip-6.0-natspec.patch"; + sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1"; + }); nativeBuildInputs = [ bzip2 ]; buildInputs = [ bzip2 ] ++ lib.optional enableNLS libnatspec; @@ -93,15 +92,14 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = "-lbz2" + lib.optionalString enableNLS " -lnatspec"; - buildFlags = - [ - "generic" - "D_USE_BZ2=-DUSE_BZIP2" - "L_BZ2=-lbz2" - ] - # `lchmod` is not available on Linux, so we remove it to fix "not supported" errors (when the zip file contains symlinks). - # Alpine (musl) and Debian (glibc) also add this flag. - ++ lib.optionals stdenv.hostPlatform.isLinux [ "LOCAL_UNZIP=-DNO_LCHMOD" ]; + buildFlags = [ + "generic" + "D_USE_BZ2=-DUSE_BZIP2" + "L_BZ2=-lbz2" + ] + # `lchmod` is not available on Linux, so we remove it to fix "not supported" errors (when the zip file contains symlinks). + # Alpine (musl) and Debian (glibc) also add this flag. + ++ lib.optionals stdenv.hostPlatform.isLinux [ "LOCAL_UNZIP=-DNO_LCHMOD" ]; preConfigure = '' sed -i -e 's@CF="-O3 -Wall -I. -DASM_CRC $(LOC)"@CF="-O3 -Wall -I. -DASM_CRC -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LOC)"@' unix/Makefile diff --git a/pkgs/by-name/up/upower/package.nix b/pkgs/by-name/up/upower/package.nix index 52d3d5795a1a..6d85d57bc05e 100644 --- a/pkgs/by-name/up/upower/package.nix +++ b/pkgs/by-name/up/upower/package.nix @@ -40,13 +40,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "upower"; version = "1.90.6"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withDocs [ "devdoc" ] - ++ lib.optionals withIntrospection [ "installedTests" ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withDocs [ "devdoc" ] + ++ lib.optionals withIntrospection [ "installedTests" ]; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; @@ -84,65 +83,62 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - python3 - docbook-xsl-nons - gettext - libxslt - makeWrapper - pkg-config - glib - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ] - ++ lib.optionals withDocs [ - gtk-doc - ] - ++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + python3 + docbook-xsl-nons + gettext + libxslt + makeWrapper + pkg-config + glib + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ] + ++ lib.optionals withDocs [ + gtk-doc + ] + ++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; - buildInputs = - [ - libgudev - libusb1 - udev - ] - ++ lib.optionals withIntrospection [ - # Duplicate from nativeCheckInputs until https://github.com/NixOS/nixpkgs/issues/161570 is solved - umockdev + buildInputs = [ + libgudev + libusb1 + udev + ] + ++ lib.optionals withIntrospection [ + # Duplicate from nativeCheckInputs until https://github.com/NixOS/nixpkgs/issues/161570 is solved + umockdev - # For installed tests. - (python3.withPackages (pp: [ - pp.dbus-python - pp.python-dbusmock - pp.pygobject3 - pp.packaging - ])) - ] - ++ lib.optionals withSystemd [ - systemd - ] - ++ lib.optionals useIMobileDevice [ - libimobiledevice - ]; + # For installed tests. + (python3.withPackages (pp: [ + pp.dbus-python + pp.python-dbusmock + pp.pygobject3 + pp.packaging + ])) + ] + ++ lib.optionals withSystemd [ + systemd + ] + ++ lib.optionals useIMobileDevice [ + libimobiledevice + ]; - nativeCheckInputs = - [ - libeatmydata - ] - ++ lib.optionals withIntrospection [ - python3.pkgs.dbus-python - python3.pkgs.python-dbusmock - python3.pkgs.pygobject3 - dbus - umockdev - python3.pkgs.packaging - ]; + nativeCheckInputs = [ + libeatmydata + ] + ++ lib.optionals withIntrospection [ + python3.pkgs.dbus-python + python3.pkgs.python-dbusmock + python3.pkgs.pygobject3 + dbus + umockdev + python3.pkgs.packaging + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/by-name/uq/uqm/package.nix b/pkgs/by-name/uq/uqm/package.nix index 03ac250257f7..c9e47cd2bb99 100644 --- a/pkgs/by-name/uq/uqm/package.nix +++ b/pkgs/by-name/uq/uqm/package.nix @@ -87,22 +87,21 @@ stdenv.mkDerivation rec { libGL ]; - postUnpack = - '' - mkdir -p uqm-${version}/content/packages - mkdir -p uqm-${version}/content/addons - ln -s "$content" "uqm-${version}/content/packages/uqm-${version}-content.uqm" - ln -s "$music" "uqm-${version}/content/addons/uqm-${version}-3domusic.uqm" - ln -s "$voice" "uqm-${version}/content/addons/uqm-${version}-voice.uqm" - '' - + lib.optionalString useRemixPacks ( - lib.concatMapStrings (disc: '' - ln -s "${disc}" "uqm-$version/content/addons/${disc.name}" - '') remixPacks - ) - + lib.optionalString use3DOVideos '' - ln -s "${videos}" "uqm-${version}/content/addons/3dovideo" - ''; + postUnpack = '' + mkdir -p uqm-${version}/content/packages + mkdir -p uqm-${version}/content/addons + ln -s "$content" "uqm-${version}/content/packages/uqm-${version}-content.uqm" + ln -s "$music" "uqm-${version}/content/addons/uqm-${version}-3domusic.uqm" + ln -s "$voice" "uqm-${version}/content/addons/uqm-${version}-voice.uqm" + '' + + lib.optionalString useRemixPacks ( + lib.concatMapStrings (disc: '' + ln -s "${disc}" "uqm-$version/content/addons/${disc.name}" + '') remixPacks + ) + + lib.optionalString use3DOVideos '' + ln -s "${videos}" "uqm-${version}/content/addons/3dovideo" + ''; postPatch = '' # Using _STRINGS_H as include guard conflicts with glibc. diff --git a/pkgs/by-name/ur/urh/package.nix b/pkgs/by-name/ur/urh/package.nix index d38d294d11bf..e580ce2f5aff 100644 --- a/pkgs/by-name/ur/urh/package.nix +++ b/pkgs/by-name/ur/urh/package.nix @@ -36,17 +36,16 @@ python3Packages.buildPythonApplication rec { wrapGAppsHook3 copyDesktopItems ]; - buildInputs = - [ - hackrf - rtl-sdr - airspy - limesuite - libiio - libbladeRF - ] - ++ lib.optional USRPSupport uhd - ++ lib.optional stdenv.hostPlatform.isLinux qt5.qtwayland; + buildInputs = [ + hackrf + rtl-sdr + airspy + limesuite + libiio + libbladeRF + ] + ++ lib.optional USRPSupport uhd + ++ lib.optional stdenv.hostPlatform.isLinux qt5.qtwayland; dependencies = with python3Packages; [ pyqt5 diff --git a/pkgs/by-name/us/usbimager/package.nix b/pkgs/by-name/us/usbimager/package.nix index 1095cdcaf3d2..04eb470bcefd 100644 --- a/pkgs/by-name/us/usbimager/package.nix +++ b/pkgs/by-name/us/usbimager/package.nix @@ -52,10 +52,11 @@ stdenv.mkDerivation rec { dontConfigure = true; - makeFlags = - [ "PREFIX=$(out)" ] - ++ lib.optional withLibui "USE_LIBUI=yes" - ++ lib.optional withUdisks "USE_UDISKS2=yes"; + makeFlags = [ + "PREFIX=$(out)" + ] + ++ lib.optional withLibui "USE_LIBUI=yes" + ++ lib.optional withUdisks "USE_UDISKS2=yes"; meta = with lib; { description = "Very minimal GUI app that can write compressed disk images to USB drives"; diff --git a/pkgs/by-name/us/usbutils/package.nix b/pkgs/by-name/us/usbutils/package.nix index 49a7d88925ea..41d14132a730 100644 --- a/pkgs/by-name/us/usbutils/package.nix +++ b/pkgs/by-name/us/usbutils/package.nix @@ -21,18 +21,17 @@ stdenv.mkDerivation rec { hash = "sha256-g/aLWbWFR1icACZugmcYZGJ1k6tDYtjIB/UO6pI8rZM="; }; - patches = - [ - (replaceVars ./fix-paths.patch { - inherit hwdata; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (fetchpatch { - url = "https://raw.githubusercontent.com/Homebrew/formula-patches/24a6945778381a62ecdcc1d78bcc16b9f86778c1/usbutils/portable.patch"; - hash = "sha256-spTkWURij4sPLoWtDaWVMIk81AS5W+qUUOQL1pAZEvs="; - }) - ]; + patches = [ + (replaceVars ./fix-paths.patch { + inherit hwdata; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (fetchpatch { + url = "https://raw.githubusercontent.com/Homebrew/formula-patches/24a6945778381a62ecdcc1d78bcc16b9f86778c1/usbutils/portable.patch"; + hash = "sha256-spTkWURij4sPLoWtDaWVMIk81AS5W+qUUOQL1pAZEvs="; + }) + ]; nativeBuildInputs = [ meson @@ -44,14 +43,13 @@ stdenv.mkDerivation rec { python3 ]; - outputs = - [ - "out" - "man" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "python" # uses sysfs - ]; + outputs = [ + "out" + "man" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "python" # uses sysfs + ]; postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' moveToOutput "bin/lsusb.py" "$python" diff --git a/pkgs/by-name/us/ustreamer/package.nix b/pkgs/by-name/us/ustreamer/package.nix index d6a3c866dfdf..7fd8bba30a71 100644 --- a/pkgs/by-name/us/ustreamer/package.nix +++ b/pkgs/by-name/us/ustreamer/package.nix @@ -30,44 +30,42 @@ stdenv.mkDerivation rec { hash = "sha256-SvvIY52FMO6Y4B6TOfk7dLtci4OayPX6+d8voKenKbQ="; }; - buildInputs = - [ - libbsd - libevent - libjpeg - libdrm - ] - ++ lib.optionals withSystemd [ - systemdLibs - ] - ++ lib.optionals withJanus [ - janus-gateway - glib - alsa-lib - jansson - speex - libopus - ]; + buildInputs = [ + libbsd + libevent + libjpeg + libdrm + ] + ++ lib.optionals withSystemd [ + systemdLibs + ] + ++ lib.optionals withJanus [ + janus-gateway + glib + alsa-lib + jansson + speex + libopus + ]; nativeBuildInputs = [ pkg-config which ]; - makeFlags = - [ - "PREFIX=${placeholder "out"}" - "WITH_V4P=1" - ] - ++ lib.optionals withSystemd [ - "WITH_SYSTEMD=1" - ] - ++ lib.optionals withJanus [ - "WITH_JANUS=1" - # Workaround issues with Janus C Headers - # https://github.com/pikvm/ustreamer/blob/793f24c4/docs/h264.md#fixing-janus-c-headers - "CFLAGS=-I${lib.getDev janus-gateway}/include/janus" - ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + "WITH_V4P=1" + ] + ++ lib.optionals withSystemd [ + "WITH_SYSTEMD=1" + ] + ++ lib.optionals withJanus [ + "WITH_JANUS=1" + # Workaround issues with Janus C Headers + # https://github.com/pikvm/ustreamer/blob/793f24c4/docs/h264.md#fixing-janus-c-headers + "CFLAGS=-I${lib.getDev janus-gateway}/include/janus" + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/ut/util-linux/package.nix b/pkgs/by-name/ut/util-linux/package.nix index d93f0deb29a2..fb957238eaad 100644 --- a/pkgs/by-name/ut/util-linux/package.nix +++ b/pkgs/by-name/ut/util-linux/package.nix @@ -43,104 +43,100 @@ stdenv.mkDerivation (finalPackage: rec { hash = "sha256-ge6Ts8/f6318QJDO3rode7zpFB/QtQG2hrP+R13cpMY="; }; - patches = - [ - ./rtcwake-search-PATH-for-shutdown.patch - # https://github.com/util-linux/util-linux/pull/3013 - ./fix-darwin-build.patch - # https://github.com/util-linux/util-linux/pull/3479 (fixes https://github.com/util-linux/util-linux/issues/3474) - ./fix-mount-regression.patch - # https://github.com/util-linux/util-linux/pull/3530 - ./libmount-subdir-remove-unused-code.patch - ./libmount-subdir-restrict-for-real-mounts-only.patch - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - (fetchurl { - name = "bits-only-build-when-cpu_set_t-is-available.patch"; - url = "https://lore.kernel.org/util-linux/20250501075806.88759-1-hi@alyssa.is/raw"; - hash = "sha256-G7Cdv8636wJEjgt9am7PaDI8bpSF8sO9bFWEIiAL25A="; - }) - ]; + patches = [ + ./rtcwake-search-PATH-for-shutdown.patch + # https://github.com/util-linux/util-linux/pull/3013 + ./fix-darwin-build.patch + # https://github.com/util-linux/util-linux/pull/3479 (fixes https://github.com/util-linux/util-linux/issues/3474) + ./fix-mount-regression.patch + # https://github.com/util-linux/util-linux/pull/3530 + ./libmount-subdir-remove-unused-code.patch + ./libmount-subdir-restrict-for-real-mounts-only.patch + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + (fetchurl { + name = "bits-only-build-when-cpu_set_t-is-available.patch"; + url = "https://lore.kernel.org/util-linux/20250501075806.88759-1-hi@alyssa.is/raw"; + hash = "sha256-G7Cdv8636wJEjgt9am7PaDI8bpSF8sO9bFWEIiAL25A="; + }) + ]; # We separate some of the utilities into their own outputs. This # allows putting together smaller systems depending on only part of # the greater util-linux toolset. # Compatibility is maintained by symlinking the binaries from the # smaller outputs in the bin output. - outputs = - [ - "bin" - "dev" - "out" - "lib" - "man" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ "mount" ] - ++ [ "login" ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ "swap" ]; + outputs = [ + "bin" + "dev" + "out" + "lib" + "man" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "mount" ] + ++ [ "login" ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "swap" ]; separateDebugInfo = true; - postPatch = - '' - patchShebangs tests/run.sh tools/all_syscalls tools/all_errnos + postPatch = '' + patchShebangs tests/run.sh tools/all_syscalls tools/all_errnos - substituteInPlace sys-utils/eject.c \ - --replace "/bin/umount" "$bin/bin/umount" - '' - + lib.optionalString shadowSupport '' - substituteInPlace include/pathnames.h \ - --replace "/bin/login" "${shadow}/bin/login" - '' - + lib.optionalString stdenv.hostPlatform.isFreeBSD '' - substituteInPlace lib/c_strtod.c --replace-fail __APPLE__ __FreeBSD__ - sed -E -i -e '/_POSIX_C_SOURCE/d' -e '/_XOPEN_SOURCE/d' misc-utils/hardlink.c - ''; + substituteInPlace sys-utils/eject.c \ + --replace "/bin/umount" "$bin/bin/umount" + '' + + lib.optionalString shadowSupport '' + substituteInPlace include/pathnames.h \ + --replace "/bin/login" "${shadow}/bin/login" + '' + + lib.optionalString stdenv.hostPlatform.isFreeBSD '' + substituteInPlace lib/c_strtod.c --replace-fail __APPLE__ __FreeBSD__ + sed -E -i -e '/_POSIX_C_SOURCE/d' -e '/_XOPEN_SOURCE/d' misc-utils/hardlink.c + ''; # !!! It would be better to obtain the path to the mount helpers # (/sbin/mount.*) through an environment variable, but that's # somewhat risky because we have to consider that mount can setuid # root... - configureFlags = - [ - "--localstatedir=/var" - "--disable-use-tty-group" - "--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin" - "--disable-makeinstall-setuid" - "--disable-makeinstall-chown" - "--disable-su" # provided by shadow - (lib.enableFeature writeSupport "write") - (lib.enableFeature nlsSupport "nls") - (lib.withFeatureAs (cryptsetupSupport != false) "cryptsetup" ( - if cryptsetupSupport == true then - "yes" - else if cryptsetupSupport == "dlopen" then - "dlopen" - else - throw "invalid cryptsetupSupport value: ${toString cryptsetupSupport}" - )) - (lib.withFeature ncursesSupport "ncursesw") - (lib.withFeature systemdSupport "systemd") - (lib.withFeatureAs systemdSupport "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/") - (lib.withFeatureAs systemdSupport "tmpfilesdir" "${placeholder "out"}/lib/tmpfiles.d") - (lib.withFeatureAs systemdSupport "sysusersdir" "${placeholder "out"}/lib/sysusers.d") - (lib.enableFeature translateManpages "poman") - "SYSCONFSTATICDIR=${placeholder "lib"}/lib" - ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "scanf_cv_type_modifier=ms" - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - # These features are all disabled in the freebsd-ports distribution - "--disable-nls" - "--disable-ipcrm" - "--disable-ipcs" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Doesn't build on Darwin, also doesn't really make sense on Darwin - "--disable-liblastlog2" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - # Mandatory shared library. - "--disable-pam-lastlog2" - ]; + configureFlags = [ + "--localstatedir=/var" + "--disable-use-tty-group" + "--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin" + "--disable-makeinstall-setuid" + "--disable-makeinstall-chown" + "--disable-su" # provided by shadow + (lib.enableFeature writeSupport "write") + (lib.enableFeature nlsSupport "nls") + (lib.withFeatureAs (cryptsetupSupport != false) "cryptsetup" ( + if cryptsetupSupport == true then + "yes" + else if cryptsetupSupport == "dlopen" then + "dlopen" + else + throw "invalid cryptsetupSupport value: ${toString cryptsetupSupport}" + )) + (lib.withFeature ncursesSupport "ncursesw") + (lib.withFeature systemdSupport "systemd") + (lib.withFeatureAs systemdSupport "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/") + (lib.withFeatureAs systemdSupport "tmpfilesdir" "${placeholder "out"}/lib/tmpfiles.d") + (lib.withFeatureAs systemdSupport "sysusersdir" "${placeholder "out"}/lib/sysusers.d") + (lib.enableFeature translateManpages "poman") + "SYSCONFSTATICDIR=${placeholder "lib"}/lib" + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "scanf_cv_type_modifier=ms" + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + # These features are all disabled in the freebsd-ports distribution + "--disable-nls" + "--disable-ipcrm" + "--disable-ipcs" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Doesn't build on Darwin, also doesn't really make sense on Darwin + "--disable-liblastlog2" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + # Mandatory shared library. + "--disable-pam-lastlog2" + ]; makeFlags = [ "usrbin_execdir=${placeholder "bin"}/bin" @@ -148,29 +144,27 @@ stdenv.mkDerivation (finalPackage: rec { "usrsbin_execdir=${placeholder "bin"}/sbin" ]; - nativeBuildInputs = - [ - pkg-config - installShellFiles - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - autoconf - automake116x - ] - ++ lib.optionals translateManpages [ po4a ] - ++ lib.optionals (cryptsetupSupport == "dlopen") [ cryptsetup ]; + nativeBuildInputs = [ + pkg-config + installShellFiles + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + autoconf + automake116x + ] + ++ lib.optionals translateManpages [ po4a ] + ++ lib.optionals (cryptsetupSupport == "dlopen") [ cryptsetup ]; - buildInputs = - [ - zlib - libxcrypt - sqlite - ] - ++ lib.optionals (cryptsetupSupport == true) [ cryptsetup ] - ++ lib.optionals pamSupport [ pam ] - ++ lib.optionals capabilitiesSupport [ libcap_ng ] - ++ lib.optionals ncursesSupport [ ncurses ] - ++ lib.optionals systemdSupport [ systemd ]; + buildInputs = [ + zlib + libxcrypt + sqlite + ] + ++ lib.optionals (cryptsetupSupport == true) [ cryptsetup ] + ++ lib.optionals pamSupport [ pam ] + ++ lib.optionals capabilitiesSupport [ libcap_ng ] + ++ lib.optionals ncursesSupport [ ncurses ] + ++ lib.optionals systemdSupport [ systemd ]; doCheck = false; # "For development purpose only. Don't execute on production system!" diff --git a/pkgs/by-name/uu/uutils-coreutils/package.nix b/pkgs/by-name/uu/uutils-coreutils/package.nix index f02730ad88d1..fc4ba2a25c2b 100644 --- a/pkgs/by-name/uu/uutils-coreutils/package.nix +++ b/pkgs/by-name/uu/uutils-coreutils/package.nix @@ -54,31 +54,30 @@ stdenv.mkDerivation (finalAttrs: { python3Packages.sphinx ]; - makeFlags = - [ - "CARGO=${lib.getExe cargo}" - "PREFIX=${placeholder "out"}" - "PROFILE=release" - "SELINUX_ENABLED=${if selinuxSupport then "1" else "0"}" - "INSTALLDIR_MAN=${placeholder "out"}/share/man/man1" - # Explicitly enable acl, and if requested selinux. - # We cannot rely on SELINUX_ENABLED here since our explicit assignment - # overrides its effect in the makefile. - "BUILD_SPEC_FEATURE=${ - lib.concatStringsSep "," ( - # We can always enable acl, on non-Linux, libc provides the headers, - # only in Linux we need to add the acl lib to buildInputs. - [ - "feat_acl" - ] - ++ (lib.optionals selinuxSupport [ - "feat_selinux" - ]) - ) - }" - ] - ++ lib.optionals (prefix != null) [ "PROG_PREFIX=${prefix}" ] - ++ lib.optionals buildMulticallBinary [ "MULTICALL=y" ]; + makeFlags = [ + "CARGO=${lib.getExe cargo}" + "PREFIX=${placeholder "out"}" + "PROFILE=release" + "SELINUX_ENABLED=${if selinuxSupport then "1" else "0"}" + "INSTALLDIR_MAN=${placeholder "out"}/share/man/man1" + # Explicitly enable acl, and if requested selinux. + # We cannot rely on SELINUX_ENABLED here since our explicit assignment + # overrides its effect in the makefile. + "BUILD_SPEC_FEATURE=${ + lib.concatStringsSep "," ( + # We can always enable acl, on non-Linux, libc provides the headers, + # only in Linux we need to add the acl lib to buildInputs. + [ + "feat_acl" + ] + ++ (lib.optionals selinuxSupport [ + "feat_selinux" + ]) + ) + }" + ] + ++ lib.optionals (prefix != null) [ "PROG_PREFIX=${prefix}" ] + ++ lib.optionals buildMulticallBinary [ "MULTICALL=y" ]; env = lib.optionalAttrs selinuxSupport { SELINUX_INCLUDE_DIR = ''${libselinux.dev}/include''; diff --git a/pkgs/by-name/uw/uwimap/package.nix b/pkgs/by-name/uw/uwimap/package.nix index 7c2095f25959..71a8ce555bd1 100644 --- a/pkgs/by-name/uw/uwimap/package.nix +++ b/pkgs/by-name/uw/uwimap/package.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation rec { "CC=${stdenv.cc.targetPrefix}cc" "RANLIB=${stdenv.cc.targetPrefix}ranlib" (if stdenv.hostPlatform.isDarwin then "osx" else "lnp") # Linux with PAM modules; - ] ++ lib.optional stdenv.hostPlatform.isx86_64 "EXTRACFLAGS=-fPIC"; # -fPIC is required to compile php with imap on x86_64 systems + ] + ++ lib.optional stdenv.hostPlatform.isx86_64 "EXTRACFLAGS=-fPIC"; # -fPIC is required to compile php with imap on x86_64 systems hardeningDisable = [ "format" ]; @@ -41,24 +42,23 @@ stdenv.mkDerivation rec { ./gcc-14-fix.diff ]; - postPatch = - '' - sed -i src/osdep/unix/Makefile -e 's,/usr/local/ssl,${openssl.dev},' - sed -i src/osdep/unix/Makefile -e 's,^SSLCERTS=.*,SSLCERTS=/etc/ssl/certs,' - sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${lib.getLib openssl}/lib,' - '' - # utime takes a struct utimbuf rather than an array of time_t[2] - # convert time_t tp[2] to a struct utimbuf where - # tp[0] -> tp.actime and tp[1] -> tp.modtime, where actime and modtime are - # type time_t. - + '' - sed -i \ - -e 's/time_t tp\[2]/struct utimbuf tp/' \ - -e 's/\]*\),tp)/\1,\&tp)/' \ - src/osdep/unix/{mbx.c,mh.c,mmdf.c,mtx.c,mx.c,tenex.c,unix.c} - ''; + postPatch = '' + sed -i src/osdep/unix/Makefile -e 's,/usr/local/ssl,${openssl.dev},' + sed -i src/osdep/unix/Makefile -e 's,^SSLCERTS=.*,SSLCERTS=/etc/ssl/certs,' + sed -i src/osdep/unix/Makefile -e 's,^SSLLIB=.*,SSLLIB=${lib.getLib openssl}/lib,' + '' + # utime takes a struct utimbuf rather than an array of time_t[2] + # convert time_t tp[2] to a struct utimbuf where + # tp[0] -> tp.actime and tp[1] -> tp.modtime, where actime and modtime are + # type time_t. + + '' + sed -i \ + -e 's/time_t tp\[2]/struct utimbuf tp/' \ + -e 's/\]*\),tp)/\1,\&tp)/' \ + src/osdep/unix/{mbx.c,mh.c,mmdf.c,mtx.c,mx.c,tenex.c,unix.c} + ''; preConfigure = '' makeFlagsArray+=("ARRC=${stdenv.cc.targetPrefix}ar rc") diff --git a/pkgs/by-name/uw/uwsgi/package.nix b/pkgs/by-name/uw/uwsgi/package.nix index a28e6db45180..9426057e6b50 100644 --- a/pkgs/by-name/uw/uwsgi/package.nix +++ b/pkgs/by-name/uw/uwsgi/package.nix @@ -61,7 +61,8 @@ let php-embed.extensions.session php-embed.extensions.session.dev php-embed.unwrapped.dev - ] ++ php-embed.unwrapped.buildInputs; + ] + ++ php-embed.unwrapped.buildInputs; }) ]; @@ -100,20 +101,19 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - jansson - pcre2 - libxcrypt - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - expat - zlib - ] - ++ lib.optional withPAM pam - ++ lib.optional withSystemd systemd - ++ lib.optional withCap libcap - ++ lib.concatMap (x: x.inputs) needed; + buildInputs = [ + jansson + pcre2 + libxcrypt + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + expat + zlib + ] + ++ lib.optional withPAM pam + ++ lib.optional withSystemd systemd + ++ lib.optional withCap libcap + ++ lib.concatMap (x: x.inputs) needed; basePlugins = lib.concatStringsSep "," ( lib.optional withPAM "pam" ++ lib.optional withSystemd "systemd_logger" diff --git a/pkgs/by-name/uw/uwsm/package.nix b/pkgs/by-name/uw/uwsm/package.nix index adbe424514c0..eea2bc537ca9 100644 --- a/pkgs/by-name/uw/uwsm/package.nix +++ b/pkgs/by-name/uw/uwsm/package.nix @@ -52,7 +52,8 @@ stdenv.mkDerivation (finalAttrs: { bash # sh systemd python - ] ++ lib.optionals uuctlSupport [ dmenu ]; + ] + ++ lib.optionals uuctlSupport [ dmenu ]; mesonFlags = [ "--prefix=${placeholder "out"}" diff --git a/pkgs/by-name/uw/uwufetch/package.nix b/pkgs/by-name/uw/uwufetch/package.nix index 811c2378013f..efabc63e005a 100644 --- a/pkgs/by-name/uw/uwufetch/package.nix +++ b/pkgs/by-name/uw/uwufetch/package.nix @@ -17,23 +17,22 @@ stdenv.mkDerivation rec { hash = "sha256-cA8sajh+puswyKikr0Jp9ei+EpVkH+vhEp+pTerkUqA="; }; - postPatch = - '' - substituteInPlace uwufetch.c \ - --replace "/usr/lib/uwufetch" "$out/lib/uwufetch" \ - --replace "/usr/local/lib/uwufetch" "$out/lib/uwufetch" \ - --replace "/etc/uwufetch/config" "$out/etc/uwufetch/config" - # fix command_path for package manager (nix-store) - substituteInPlace fetch.c \ - --replace "/usr/bin" "/run/current-system/sw/bin" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Makefile \ - --replace "local/bin" "bin" \ - --replace "local/lib" "lib" \ - --replace "local/include" "include" \ - --replace "local/share" "share" - ''; + postPatch = '' + substituteInPlace uwufetch.c \ + --replace "/usr/lib/uwufetch" "$out/lib/uwufetch" \ + --replace "/usr/local/lib/uwufetch" "$out/lib/uwufetch" \ + --replace "/etc/uwufetch/config" "$out/etc/uwufetch/config" + # fix command_path for package manager (nix-store) + substituteInPlace fetch.c \ + --replace "/usr/bin" "/run/current-system/sw/bin" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Makefile \ + --replace "local/bin" "bin" \ + --replace "local/lib" "lib" \ + --replace "local/include" "include" \ + --replace "local/share" "share" + ''; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/by-name/va/vala-language-server/package.nix b/pkgs/by-name/va/vala-language-server/package.nix index 507e1d7fbc62..2912f7db2146 100644 --- a/pkgs/by-name/va/vala-language-server/package.nix +++ b/pkgs/by-name/va/vala-language-server/package.nix @@ -30,17 +30,16 @@ stdenv.mkDerivation rec { updateScript = nix-update-script { }; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - scdoc - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # GNOME Builder Plugin - gnome-builder - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + scdoc + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # GNOME Builder Plugin + gnome-builder + ]; buildInputs = [ glib diff --git a/pkgs/by-name/va/vale-ls/package.nix b/pkgs/by-name/va/vale-ls/package.nix index 1643a90ce1b5..666a413d7a22 100644 --- a/pkgs/by-name/va/vale-ls/package.nix +++ b/pkgs/by-name/va/vale-ls/package.nix @@ -30,16 +30,15 @@ rustPlatform.buildRustPackage rec { openssl ]; - checkFlags = - [ - # The following tests are reaching to the network. - "--skip=vale::tests" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # This test does not account for the existence of aarch64-linux machines, - # despite upstream shipping artifacts for that architecture - "--skip=utils::tests::arch" - ]; + checkFlags = [ + # The following tests are reaching to the network. + "--skip=vale::tests" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # This test does not account for the existence of aarch64-linux machines, + # despite upstream shipping artifacts for that architecture + "--skip=utils::tests::arch" + ]; env.OPENSSL_NO_VENDOR = true; diff --git a/pkgs/by-name/va/vale/styles.nix b/pkgs/by-name/va/vale/styles.nix index 72c9306f1bc1..5c2264809fdf 100644 --- a/pkgs/by-name/va/vale/styles.nix +++ b/pkgs/by-name/va/vale/styles.nix @@ -33,7 +33,8 @@ let meta = { platforms = lib.platforms.all; maintainers = with lib.maintainers; [ katexochen ]; - } // (args.meta or { }); + } + // (args.meta or { }); } // removeAttrs args [ "meta" diff --git a/pkgs/by-name/va/valeronoi/package.nix b/pkgs/by-name/va/valeronoi/package.nix index 675b32eff088..1e6295b08e30 100644 --- a/pkgs/by-name/va/valeronoi/package.nix +++ b/pkgs/by-name/va/valeronoi/package.nix @@ -21,18 +21,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-5KXVSIqWDkXnpO+qgBzFtbJb444RW8dIVXp8Y/aAOrk="; }; - buildInputs = - [ - boost - cgal - gpp - mpfr - ] - ++ (with qt6Packages; [ - qtbase - qtimageformats - qtsvg - ]); + buildInputs = [ + boost + cgal + gpp + mpfr + ] + ++ (with qt6Packages; [ + qtbase + qtimageformats + qtsvg + ]); nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/va/valkey/package.nix b/pkgs/by-name/va/valkey/package.nix index faeb28220760..70bec726c90a 100644 --- a/pkgs/by-name/va/valkey/package.nix +++ b/pkgs/by-name/va/valkey/package.nix @@ -36,11 +36,12 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ lua ] - ++ lib.optional useSystemJemalloc jemalloc - ++ lib.optional withSystemd systemd - ++ lib.optional tlsSupport openssl; + buildInputs = [ + lua + ] + ++ lib.optional useSystemJemalloc jemalloc + ++ lib.optional withSystemd systemd + ++ lib.optional tlsSupport openssl; strictDeps = true; @@ -49,14 +50,15 @@ stdenv.mkDerivation (finalAttrs: { ''; # More cross-compiling fixes. - makeFlags = - [ "PREFIX=${placeholder "out"}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "AR=${stdenv.cc.targetPrefix}ar" - "RANLIB=${stdenv.cc.targetPrefix}ranlib" - ] - ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] - ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "AR=${stdenv.cc.targetPrefix}ar" + "RANLIB=${stdenv.cc.targetPrefix}ranlib" + ] + ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] + ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; enableParallelBuilding = true; @@ -70,7 +72,8 @@ stdenv.mkDerivation (finalAttrs: { which tcl ps - ] ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ]; + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ getconf ]; checkPhase = '' runHook preCheck diff --git a/pkgs/by-name/va/vamp-plugin-sdk/package.nix b/pkgs/by-name/va/vamp-plugin-sdk/package.nix index 4b2646693a02..8ac7959d4669 100644 --- a/pkgs/by-name/va/vamp-plugin-sdk/package.nix +++ b/pkgs/by-name/va/vamp-plugin-sdk/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { makeFlags = [ "AR:=$(AR)" "RANLIB:=$(RANLIB)" - ] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-o test"; + ] + ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-o test"; meta = with lib; { description = "Audio processing plugin system for plugins that extract descriptive information from audio data"; diff --git a/pkgs/by-name/va/vanillatd/package.nix b/pkgs/by-name/va/vanillatd/package.nix index 4b17a2527e1a..abc618638afb 100644 --- a/pkgs/by-name/va/vanillatd/package.nix +++ b/pkgs/by-name/va/vanillatd/package.nix @@ -51,19 +51,18 @@ stdenv.mkDerivation (finalAttrs: { openal ]; - nativeBuildInputs = - [ - cmake - git - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - imagemagick - libicns - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - copyDesktopItems - ]; + nativeBuildInputs = [ + cmake + git + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + imagemagick + libicns + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + copyDesktopItems + ]; cmakeFlags = [ (lib.cmakeBool "BUILD_VANILLATD" (appName == "vanillatd")) diff --git a/pkgs/by-name/va/vapoursynth-eedi3/package.nix b/pkgs/by-name/va/vapoursynth-eedi3/package.nix index 3a5f8b5de6a4..bb1fc9c53bae 100644 --- a/pkgs/by-name/va/vapoursynth-eedi3/package.nix +++ b/pkgs/by-name/va/vapoursynth-eedi3/package.nix @@ -29,15 +29,14 @@ stdenv.mkDerivation { pkg-config ]; - buildInputs = - [ - boost - vapoursynth - ] - ++ lib.optionals openclSupport [ - ocl-icd - opencl-headers - ]; + buildInputs = [ + boost + vapoursynth + ] + ++ lib.optionals openclSupport [ + ocl-icd + opencl-headers + ]; postPatch = '' substituteInPlace meson.build \ diff --git a/pkgs/by-name/va/vapoursynth-znedi3/package.nix b/pkgs/by-name/va/vapoursynth-znedi3/package.nix index fbde9b6d26ef..5e3181e5823c 100644 --- a/pkgs/by-name/va/vapoursynth-znedi3/package.nix +++ b/pkgs/by-name/va/vapoursynth-znedi3/package.nix @@ -24,12 +24,13 @@ stdenv.mkDerivation { ln -s ${vapoursynth}/include/vapoursynth vsxx/vapoursynth ''; - makeFlags = - [ "CPPFLAGS=-DNNEDI3_WEIGHTS_PATH='\"$(out)/share/nnedi3/nnedi3_weights.bin\"'" ] - ++ lib.optionals stdenv.hostPlatform.isx86 [ - "X86=1" - "X86_AVX512=1" - ]; + makeFlags = [ + "CPPFLAGS=-DNNEDI3_WEIGHTS_PATH='\"$(out)/share/nnedi3/nnedi3_weights.bin\"'" + ] + ++ lib.optionals stdenv.hostPlatform.isx86 [ + "X86=1" + "X86_AVX512=1" + ]; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/va/vapoursynth/editor.nix b/pkgs/by-name/va/vapoursynth/editor.nix index 03ed78e47d82..816250d63826 100644 --- a/pkgs/by-name/va/vapoursynth/editor.nix +++ b/pkgs/by-name/va/vapoursynth/editor.nix @@ -40,25 +40,24 @@ let preConfigure = "cd pro"; - preFixup = - '' - cd ../build/release* - mkdir -p $out/bin - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - for bin in vsedit{,-job-server{,-watcher}}; do - mv $bin.app $out/Applications - makeQtWrapper $out/Applications/$bin.app/Contents/MacOS/$bin $out/bin/$bin - wrapQtApp $out/Applications/$bin.app/Contents/MacOS/$bin - done - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - for bin in vsedit{,-job-server{,-watcher}}; do - mv $bin $out/bin - wrapQtApp $out/bin/$bin - done - ''; + preFixup = '' + cd ../build/release* + mkdir -p $out/bin + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + for bin in vsedit{,-job-server{,-watcher}}; do + mv $bin.app $out/Applications + makeQtWrapper $out/Applications/$bin.app/Contents/MacOS/$bin $out/bin/$bin + wrapQtApp $out/Applications/$bin.app/Contents/MacOS/$bin + done + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + for bin in vsedit{,-job-server{,-watcher}}; do + mv $bin $out/bin + wrapQtApp $out/bin/$bin + done + ''; passthru = { inherit withPlugins; diff --git a/pkgs/by-name/va/variety/package.nix b/pkgs/by-name/va/variety/package.nix index 3ab710244956..d90041e44381 100644 --- a/pkgs/by-name/va/variety/package.nix +++ b/pkgs/by-name/va/variety/package.nix @@ -44,7 +44,8 @@ python3Packages.buildPythonApplication rec { hicolor-icon-theme libnotify librsvg - ] ++ lib.optional appindicatorSupport libayatana-appindicator; + ] + ++ lib.optional appindicatorSupport libayatana-appindicator; build-system = with python3Packages; [ setuptools ]; diff --git a/pkgs/by-name/va/vault-tasks/package.nix b/pkgs/by-name/va/vault-tasks/package.nix index cba058736e65..24b89f77671e 100644 --- a/pkgs/by-name/va/vault-tasks/package.nix +++ b/pkgs/by-name/va/vault-tasks/package.nix @@ -26,28 +26,27 @@ rustPlatform.buildRustPackage { installShellFiles ]; - postInstall = + postInstall = '' + install -Dm444 desktop/vault-tasks.desktop -t $out/share/applications + '' + + ( + let + vault-tasks = + if stdenv.buildPlatform.canExecute stdenv.hostPlatform then + placeholder "out" + else + buildPackages.vault-tasks; + in '' - install -Dm444 desktop/vault-tasks.desktop -t $out/share/applications - '' - + ( - let - vault-tasks = - if stdenv.buildPlatform.canExecute stdenv.hostPlatform then - placeholder "out" - else - buildPackages.vault-tasks; - in - '' - # vault-tasks tries to load a config file from ~/.config/ before generating completions - export HOME="$(mktemp -d)" + # vault-tasks tries to load a config file from ~/.config/ before generating completions + export HOME="$(mktemp -d)" - installShellCompletion --cmd vault-tasks \ - --bash <(${vault-tasks}/bin/vault-tasks generate-completions bash) \ - --fish <(${vault-tasks}/bin/vault-tasks generate-completions fish) \ - --zsh <(${vault-tasks}/bin/vault-tasks generate-completions zsh) - '' - ); + installShellCompletion --cmd vault-tasks \ + --bash <(${vault-tasks}/bin/vault-tasks generate-completions bash) \ + --fish <(${vault-tasks}/bin/vault-tasks generate-completions fish) \ + --zsh <(${vault-tasks}/bin/vault-tasks generate-completions zsh) + '' + ); passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/va/vault/package.nix b/pkgs/by-name/va/vault/package.nix index ad3f4ff81bd3..e2f9ce649615 100644 --- a/pkgs/by-name/va/vault/package.nix +++ b/pkgs/by-name/va/vault/package.nix @@ -42,20 +42,19 @@ buildGoModule rec { "-X github.com/hashicorp/vault/sdk/version.VersionPrerelease=" ]; - postInstall = - '' - echo "complete -C $out/bin/vault vault" > vault.bash - installShellCompletion vault.bash - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/vault \ - --prefix PATH ${ - lib.makeBinPath [ - gawk - glibc - ] - } - ''; + postInstall = '' + echo "complete -C $out/bin/vault vault" > vault.bash + installShellCompletion vault.bash + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram $out/bin/vault \ + --prefix PATH ${ + lib.makeBinPath [ + gawk + glibc + ] + } + ''; passthru.tests = { inherit (nixosTests) diff --git a/pkgs/by-name/va/vaultwarden/package.nix b/pkgs/by-name/va/vaultwarden/package.nix index b754b72c0ff1..65668d8c3f94 100644 --- a/pkgs/by-name/va/vaultwarden/package.nix +++ b/pkgs/by-name/va/vaultwarden/package.nix @@ -35,13 +35,14 @@ rustPlatform.buildRustPackage rec { env.VW_VERSION = version; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ lib.optional (dbBackend == "mysql") libmysqlclient - ++ lib.optional (dbBackend == "postgresql") libpq; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.optional (dbBackend == "mysql") libmysqlclient + ++ lib.optional (dbBackend == "postgresql") libpq; buildFeatures = dbBackend; diff --git a/pkgs/by-name/vc/vcpkg-tool/package.nix b/pkgs/by-name/vc/vcpkg-tool/package.nix index 5817c9b49f86..b3767c50f9ff 100644 --- a/pkgs/by-name/vc/vcpkg-tool/package.nix +++ b/pkgs/by-name/vc/vcpkg-tool/package.nix @@ -71,7 +71,8 @@ stdenv.mkDerivation (finalAttrs: { unzip zip zstd - ] ++ extraRuntimeDeps; + ] + ++ extraRuntimeDeps; # Apart from adding the runtime dependencies to $PATH, # the wrapper will also override these arguments by default. diff --git a/pkgs/by-name/vc/vcsi/package.nix b/pkgs/by-name/vc/vcsi/package.nix index 3717bc3d5c7c..24ad702e6607 100644 --- a/pkgs/by-name/vc/vcsi/package.nix +++ b/pkgs/by-name/vc/vcsi/package.nix @@ -39,13 +39,12 @@ python3Packages.buildPythonApplication rec { makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}" ]; - nativeCheckInputs = - [ - versionCheckHook - ] - ++ (with python3Packages; [ - pytestCheckHook - ]); + nativeCheckInputs = [ + versionCheckHook + ] + ++ (with python3Packages; [ + pytestCheckHook + ]); versionCheckProgramArg = "--version"; meta = { diff --git a/pkgs/by-name/ve/vector/package.nix b/pkgs/by-name/ve/vector/package.nix index d5009adb3ae2..c708b93a05e1 100644 --- a/pkgs/by-name/ve/vector/package.nix +++ b/pkgs/by-name/ve/vector/package.nix @@ -39,31 +39,29 @@ rustPlatform.buildRustPackage { cargoHash = "sha256-t8mfZpLrzrxj1WUpJPqZWyfBf9XobcqZY/hAeVGzhcM="; - nativeBuildInputs = - [ - pkg-config - cmake - perl - git - rustPlatform.bindgenHook - ] - # Provides the mig command used by the build scripts - ++ lib.optional stdenv.hostPlatform.isDarwin darwin.bootstrap_cmds; - buildInputs = - [ - oniguruma - openssl - protobuf - rdkafka - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ rust-jemalloc-sys-unprefixed ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - rust-jemalloc-sys - libiconv - coreutils - zlib - ]; + nativeBuildInputs = [ + pkg-config + cmake + perl + git + rustPlatform.bindgenHook + ] + # Provides the mig command used by the build scripts + ++ lib.optional stdenv.hostPlatform.isDarwin darwin.bootstrap_cmds; + buildInputs = [ + oniguruma + openssl + protobuf + rdkafka + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ rust-jemalloc-sys-unprefixed ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + rust-jemalloc-sys + libiconv + coreutils + zlib + ]; # Rust 1.80.0 introduced the unexepcted_cfgs lint, which requires crates to allowlist custom cfg options that they inspect. # Upstream is working on fixing this in https://github.com/vectordotdev/vector/pull/20949, but silencing the lint lets us build again until then. diff --git a/pkgs/by-name/ve/vectorcode/package.nix b/pkgs/by-name/ve/vectorcode/package.nix index 319c25eabba8..dd25882cbf16 100644 --- a/pkgs/by-name/ve/vectorcode/package.nix +++ b/pkgs/by-name/ve/vectorcode/package.nix @@ -172,15 +172,14 @@ python.pkgs.buildPythonApplication rec { pythonImportsCheck = [ "vectorcode" ]; - nativeCheckInputs = - [ - versionCheckHook - ] - ++ (with python.pkgs; [ - mcp - pygls - pytestCheckHook - ]); + nativeCheckInputs = [ + versionCheckHook + ] + ++ (with python.pkgs; [ + mcp + pygls + pytestCheckHook + ]); versionCheckProgramArg = "version"; disabledTests = [ diff --git a/pkgs/by-name/ve/vectorscan/package.nix b/pkgs/by-name/ve/vectorscan/package.nix index 206fb21b02eb..07fdb5ec0ee5 100644 --- a/pkgs/by-name/ve/vectorscan/package.nix +++ b/pkgs/by-name/ve/vectorscan/package.nix @@ -39,7 +39,8 @@ stdenv.mkDerivation rec { pkg-config ragel python3 - ] ++ lib.optional stdenv.hostPlatform.isLinux util-linux; + ] + ++ lib.optional stdenv.hostPlatform.isLinux util-linux; buildInputs = [ boost @@ -56,36 +57,37 @@ stdenv.mkDerivation rec { # # For generic builds (e.g. x86_64) this can mean using an implementation not optimized for the # potentially available more modern hardware extensions (e.g. x86_64 with AVX512). - cmakeFlags = - [ (if enableShared then "-DBUILD_SHARED_LIBS=ON" else "BUILD_STATIC_LIBS=ON") ] - ++ ( - if - lib.elem stdenv.hostPlatform.system [ - "x86_64-linux" - "i686-linux" - ] - then - [ - "-DBUILD_AVX2=ON" - "-DBUILD_AVX512=ON" - "-DBUILD_AVX512VBMI=ON" - "-DFAT_RUNTIME=ON" - ] - else - ( - if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) then - [ - "-DBUILD_SVE=ON" - "-DBUILD_SVE2=ON" - "-DBUILD_SVE2_BITPERM=ON" - "-DFAT_RUNTIME=ON" - ] - else - [ "-DFAT_RUNTIME=OFF" ] - ++ lib.optional stdenv.hostPlatform.avx2Support "-DBUILD_AVX2=ON" - ++ lib.optional stdenv.hostPlatform.avx512Support "-DBUILD_AVX512=ON" - ) - ); + cmakeFlags = [ + (if enableShared then "-DBUILD_SHARED_LIBS=ON" else "BUILD_STATIC_LIBS=ON") + ] + ++ ( + if + lib.elem stdenv.hostPlatform.system [ + "x86_64-linux" + "i686-linux" + ] + then + [ + "-DBUILD_AVX2=ON" + "-DBUILD_AVX512=ON" + "-DBUILD_AVX512VBMI=ON" + "-DFAT_RUNTIME=ON" + ] + else + ( + if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) then + [ + "-DBUILD_SVE=ON" + "-DBUILD_SVE2=ON" + "-DBUILD_SVE2_BITPERM=ON" + "-DFAT_RUNTIME=ON" + ] + else + [ "-DFAT_RUNTIME=OFF" ] + ++ lib.optional stdenv.hostPlatform.avx2Support "-DBUILD_AVX2=ON" + ++ lib.optional stdenv.hostPlatform.avx512Support "-DBUILD_AVX512=ON" + ) + ); doCheck = true; checkPhase = '' diff --git a/pkgs/by-name/ve/vengi-tools/package.nix b/pkgs/by-name/ve/vengi-tools/package.nix index 9b70f9dd6a5f..c005a2e1d375 100644 --- a/pkgs/by-name/ve/vengi-tools/package.nix +++ b/pkgs/by-name/ve/vengi-tools/package.nix @@ -60,26 +60,25 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - libbfd - libdwarf - backward-cpp - curl - enet - freetype - glm - libjpeg - libuuid - libuv - lua5_4 - lzfse - SDL2 - libX11 - SDL2_mixer - ] - ++ lib.optional stdenv.hostPlatform.isLinux wayland-protocols - ++ lib.optional (!stdenv.hostPlatform.isDarwin) opencl-headers; + buildInputs = [ + libbfd + libdwarf + backward-cpp + curl + enet + freetype + glm + libjpeg + libuuid + libuv + lua5_4 + lzfse + SDL2 + libX11 + SDL2_mixer + ] + ++ lib.optional stdenv.hostPlatform.isLinux wayland-protocols + ++ lib.optional (!stdenv.hostPlatform.isDarwin) opencl-headers; # error: "The plain signature for target_link_libraries has already been used" doCheck = false; diff --git a/pkgs/by-name/ve/ventoy/package.nix b/pkgs/by-name/ve/ventoy/package.nix index e6e97b1cddde..78c325ca66ed 100644 --- a/pkgs/by-name/ve/ventoy/package.nix +++ b/pkgs/by-name/ve/ventoy/package.nix @@ -79,36 +79,34 @@ stdenv.mkDerivation (finalAttrs: { WebUI/static/js/languages.js tool/languages.json ''; - nativeBuildInputs = - [ - autoPatchelfHook - makeWrapper - ] - ++ optionals (withQt5 || withGtk3) [ copyDesktopItems ] - ++ optionals withQt5 [ wrapQtAppsHook ]; + nativeBuildInputs = [ + autoPatchelfHook + makeWrapper + ] + ++ optionals (withQt5 || withGtk3) [ copyDesktopItems ] + ++ optionals withQt5 [ wrapQtAppsHook ]; - buildInputs = - [ - bash - coreutils - dosfstools - exfat - gawk - gnugrep - gnused - hexdump - parted - procps - util-linux - which - xz - ] - ++ optionals withCryptsetup [ cryptsetup ] - ++ optionals withExt4 [ e2fsprogs ] - ++ optionals withGtk3 [ gtk3 ] - ++ optionals withNtfs [ ntfs3g ] - ++ optionals withXfs [ xfsprogs ] - ++ optionals withQt5 [ qtbase ]; + buildInputs = [ + bash + coreutils + dosfstools + exfat + gawk + gnugrep + gnused + hexdump + parted + procps + util-linux + which + xz + ] + ++ optionals withCryptsetup [ cryptsetup ] + ++ optionals withExt4 [ e2fsprogs ] + ++ optionals withGtk3 [ gtk3 ] + ++ optionals withNtfs [ ntfs3g ] + ++ optionals withXfs [ xfsprogs ] + ++ optionals withQt5 [ qtbase ]; strictDeps = true; @@ -128,72 +126,71 @@ stdenv.mkDerivation (finalAttrs: { dontConfigure = true; dontBuild = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - # Setup variables - local VENTOY_PATH="$out"/share/ventoy - local ARCH='${arch}' + # Setup variables + local VENTOY_PATH="$out"/share/ventoy + local ARCH='${arch}' - # Prepare - cd tool/"$ARCH" - rm ash* hexdump* mkexfatfs* mount.exfat-fuse* xzcat* - for archive in *.xz; do - xzcat "$archive" > "''${archive%.xz}" - rm "$archive" - done - chmod a+x * - cd - + # Prepare + cd tool/"$ARCH" + rm ash* hexdump* mkexfatfs* mount.exfat-fuse* xzcat* + for archive in *.xz; do + xzcat "$archive" > "''${archive%.xz}" + rm "$archive" + done + chmod a+x * + cd - - # Cleanup. - case "$ARCH" in - x86_64) rm -r {tool/,VentoyGUI.}{i386,aarch64,mips64el};; - i386) rm -r {tool/,VentoyGUI.}{x86_64,aarch64,mips64el};; - aarch64) rm -r {tool/,VentoyGUI.}{x86_64,i386,mips64el};; - mips64el) rm -r {tool/,VentoyGUI.}{x86_64,i386,aarch64};; - esac - rm README - rm tool/"$ARCH"/Ventoy2Disk.gtk2 || true # For aarch64 and mips64el. + # Cleanup. + case "$ARCH" in + x86_64) rm -r {tool/,VentoyGUI.}{i386,aarch64,mips64el};; + i386) rm -r {tool/,VentoyGUI.}{x86_64,aarch64,mips64el};; + aarch64) rm -r {tool/,VentoyGUI.}{x86_64,i386,mips64el};; + mips64el) rm -r {tool/,VentoyGUI.}{x86_64,i386,aarch64};; + esac + rm README + rm tool/"$ARCH"/Ventoy2Disk.gtk2 || true # For aarch64 and mips64el. - # Copy from "$src" to "$out" - mkdir -p "$out"/bin "$VENTOY_PATH" - cp -r . "$VENTOY_PATH" + # Copy from "$src" to "$out" + mkdir -p "$out"/bin "$VENTOY_PATH" + cp -r . "$VENTOY_PATH" - # Fill bin dir - for f in Ventoy2Disk.sh_ventoy VentoyWeb.sh_ventoy-web \ - CreatePersistentImg.sh_ventoy-persistent \ - ExtendPersistentImg.sh_ventoy-extend-persistent \ - VentoyPlugson.sh_ventoy-plugson; do - local bin="''${f%_*}" wrapper="''${f#*_}" - makeWrapper "$VENTOY_PATH/$bin" "$out/bin/$wrapper" \ - --prefix PATH : "${lib.makeBinPath finalAttrs.buildInputs}" \ - --chdir "$VENTOY_PATH" - done - '' - # VentoGUI uses the `ventoy_gui_type` file to determine the type of GUI. - # See: https://github.com/ventoy/Ventoy/blob/v1.0.78/LinuxGUI/Ventoy2Disk/ventoy_gui.c#L1096 - + optionalString (withGtk3 || withQt5) '' - echo "${defaultGuiType}" > "$VENTOY_PATH/ventoy_gui_type" - makeWrapper "$VENTOY_PATH/VentoyGUI.$ARCH" "$out/bin/ventoy-gui" \ - --prefix PATH : "${lib.makeBinPath finalAttrs.buildInputs}" \ - --chdir "$VENTOY_PATH" - mkdir "$out"/share/{applications,pixmaps} - ln -s "$VENTOY_PATH"/WebUI/static/img/VentoyLogo.png "$out"/share/pixmaps/ - '' - + optionalString (!withGtk3) '' - rm "$VENTOY_PATH"/tool/{"$ARCH"/Ventoy2Disk.gtk3,VentoyGTK.glade} - '' - + optionalString (!withQt5) '' - rm "$VENTOY_PATH/tool/$ARCH/Ventoy2Disk.qt5" - '' - + optionalString (!withGtk3 && !withQt5) '' - rm "$VENTOY_PATH"/VentoyGUI.* - '' - + '' + # Fill bin dir + for f in Ventoy2Disk.sh_ventoy VentoyWeb.sh_ventoy-web \ + CreatePersistentImg.sh_ventoy-persistent \ + ExtendPersistentImg.sh_ventoy-extend-persistent \ + VentoyPlugson.sh_ventoy-plugson; do + local bin="''${f%_*}" wrapper="''${f#*_}" + makeWrapper "$VENTOY_PATH/$bin" "$out/bin/$wrapper" \ + --prefix PATH : "${lib.makeBinPath finalAttrs.buildInputs}" \ + --chdir "$VENTOY_PATH" + done + '' + # VentoGUI uses the `ventoy_gui_type` file to determine the type of GUI. + # See: https://github.com/ventoy/Ventoy/blob/v1.0.78/LinuxGUI/Ventoy2Disk/ventoy_gui.c#L1096 + + optionalString (withGtk3 || withQt5) '' + echo "${defaultGuiType}" > "$VENTOY_PATH/ventoy_gui_type" + makeWrapper "$VENTOY_PATH/VentoyGUI.$ARCH" "$out/bin/ventoy-gui" \ + --prefix PATH : "${lib.makeBinPath finalAttrs.buildInputs}" \ + --chdir "$VENTOY_PATH" + mkdir "$out"/share/{applications,pixmaps} + ln -s "$VENTOY_PATH"/WebUI/static/img/VentoyLogo.png "$out"/share/pixmaps/ + '' + + optionalString (!withGtk3) '' + rm "$VENTOY_PATH"/tool/{"$ARCH"/Ventoy2Disk.gtk3,VentoyGTK.glade} + '' + + optionalString (!withQt5) '' + rm "$VENTOY_PATH/tool/$ARCH/Ventoy2Disk.qt5" + '' + + optionalString (!withGtk3 && !withQt5) '' + rm "$VENTOY_PATH"/VentoyGUI.* + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; meta = { homepage = "https://www.ventoy.net"; diff --git a/pkgs/by-name/ve/verilator/package.nix b/pkgs/by-name/ve/verilator/package.nix index fde5e2828a81..4bce9ec70a69 100644 --- a/pkgs/by-name/ve/verilator/package.nix +++ b/pkgs/by-name/ve/verilator/package.nix @@ -39,29 +39,27 @@ stdenv.mkDerivation rec { systemc # ccache ]; - nativeBuildInputs = - [ - makeWrapper - flex - bison - autoconf - help2man - git - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gdb - ]; + nativeBuildInputs = [ + makeWrapper + flex + bison + autoconf + help2man + git + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gdb + ]; - nativeCheckInputs = - [ - which - coreutils - # cmake - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - numactl - ]; + nativeCheckInputs = [ + which + coreutils + # cmake + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + numactl + ]; doCheck = true; checkTarget = "test"; diff --git a/pkgs/by-name/ve/vesktop/package.nix b/pkgs/by-name/ve/vesktop/package.nix index ec4a84039dff..2555add4a42f 100644 --- a/pkgs/by-name/ve/vesktop/package.nix +++ b/pkgs/by-name/ve/vesktop/package.nix @@ -44,24 +44,23 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-rJzXbIQUxCImTqeH8EsGiyGNGoHYUqoekoa+VXpob5Y="; }; - nativeBuildInputs = - [ - nodejs - pnpm_10.configHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # vesktop uses venmic, which is a shipped as a prebuilt node module - # and needs to be patched - autoPatchelfHook - copyDesktopItems - # we use a script wrapper here for environment variable expansion at runtime - # https://github.com/NixOS/nixpkgs/issues/172583 - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # on macos we don't need to expand variables, so we can use the faster binary wrapper - makeBinaryWrapper - ]; + nativeBuildInputs = [ + nodejs + pnpm_10.configHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # vesktop uses venmic, which is a shipped as a prebuilt node module + # and needs to be patched + autoPatchelfHook + copyDesktopItems + # we use a script wrapper here for environment variable expansion at runtime + # https://github.com/NixOS/nixpkgs/issues/172583 + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # on macos we don't need to expand variables, so we can use the faster binary wrapper + makeBinaryWrapper + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libpulseaudio @@ -69,16 +68,15 @@ stdenv.mkDerivation (finalAttrs: { (lib.getLib stdenv.cc.cc) ]; - patches = - [ - ./disable_update_checking.patch - ./fix_read_only_settings.patch - ] - ++ lib.optional withSystemVencord ( - replaceVars ./use_system_vencord.patch { - inherit vencord; - } - ); + patches = [ + ./disable_update_checking.patch + ./fix_read_only_settings.patch + ] + ++ lib.optional withSystemVencord ( + replaceVars ./use_system_vencord.patch { + inherit vencord; + } + ); env = { ELECTRON_SKIP_BINARY_DOWNLOAD = 1; @@ -115,26 +113,25 @@ stdenv.mkDerivation (finalAttrs: { popd ''; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/opt/Vesktop - cp -r dist/*unpacked/resources $out/opt/Vesktop/ + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/opt/Vesktop + cp -r dist/*unpacked/resources $out/opt/Vesktop/ - for file in build/icon_*x32.png; do - file_suffix=''${file//build\/icon_} - install -Dm0644 $file $out/share/icons/hicolor/''${file_suffix//x32.png}/apps/vesktop.png - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/{Applications,bin} - mv dist/mac*/Vesktop.app $out/Applications/Vesktop.app - '' - + '' - runHook postInstall - ''; + for file in build/icon_*x32.png; do + file_suffix=''${file//build\/icon_} + install -Dm0644 $file $out/share/icons/hicolor/''${file_suffix//x32.png}/apps/vesktop.png + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/{Applications,bin} + mv dist/mac*/Vesktop.app $out/Applications/Vesktop.app + '' + + '' + runHook postInstall + ''; postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' diff --git a/pkgs/by-name/vg/vgmstream/package.nix b/pkgs/by-name/vg/vgmstream/package.nix index fdcfcdfe91db..7e1c541c4e1f 100644 --- a/pkgs/by-name/vg/vgmstream/package.nix +++ b/pkgs/by-name/vg/vgmstream/package.nix @@ -74,30 +74,28 @@ stdenv.mkDerivation rec { audacious-bare ]; - preConfigure = - '' - substituteInPlace cmake/dependencies/audacious.cmake \ - --replace-fail "pkg_get_variable(AUDACIOUS_PLUGIN_DIR audacious plugin_dir)" "set(AUDACIOUS_PLUGIN_DIR \"$audacious/lib/audacious\")" - '' - + - # cmake/dependencies/celt.cmake uses configure_file to modify ${CELT_0110_PATH}/libcelt/ecintrin.h. - # Therefore, CELT_0110_PATH needs to point to a mutable directory. - lib.optionalString (stdenv.system == "x86_64-linux") '' - mkdir -p dependencies/celt-0.11.0/ - cp -r ${celt-0_11_0-src}/* dependencies/celt-0.11.0/ - chmod -R +w dependencies/celt-0.11.0/ - ''; + preConfigure = '' + substituteInPlace cmake/dependencies/audacious.cmake \ + --replace-fail "pkg_get_variable(AUDACIOUS_PLUGIN_DIR audacious plugin_dir)" "set(AUDACIOUS_PLUGIN_DIR \"$audacious/lib/audacious\")" + '' + + + # cmake/dependencies/celt.cmake uses configure_file to modify ${CELT_0110_PATH}/libcelt/ecintrin.h. + # Therefore, CELT_0110_PATH needs to point to a mutable directory. + lib.optionalString (stdenv.system == "x86_64-linux") '' + mkdir -p dependencies/celt-0.11.0/ + cp -r ${celt-0_11_0-src}/* dependencies/celt-0.11.0/ + chmod -R +w dependencies/celt-0.11.0/ + ''; - cmakeFlags = - [ - "-DATRAC9_PATH=${atrac9-src}" - ] - # Only supported on x86_64-linux - ++ lib.optionals (stdenv.system == "x86_64-linux") [ - "-DCELT_0061_PATH=${celt-0_6_1-src}" - "-DCELT_0110_PATH=../dependencies/celt-0.11.0" - # libg719_decode omitted because it doesn't have a free software license - ]; + cmakeFlags = [ + "-DATRAC9_PATH=${atrac9-src}" + ] + # Only supported on x86_64-linux + ++ lib.optionals (stdenv.system == "x86_64-linux") [ + "-DCELT_0061_PATH=${celt-0_6_1-src}" + "-DCELT_0110_PATH=../dependencies/celt-0.11.0" + # libg719_decode omitted because it doesn't have a free software license + ]; meta = with lib; { description = "Library for playback of various streamed audio formats used in video games"; diff --git a/pkgs/by-name/vi/video2x/package.nix b/pkgs/by-name/vi/video2x/package.nix index 6cbbe53ca5b0..9a2edb4387fc 100644 --- a/pkgs/by-name/vi/video2x/package.nix +++ b/pkgs/by-name/vi/video2x/package.nix @@ -55,18 +55,17 @@ stdenv.mkDerivation (finalAttrs: { glslang ]; - buildInputs = - [ - boost - ffmpeg - ncnn - spdlog - vulkan-headers - vulkan-loader - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ]; + buildInputs = [ + boost + ffmpeg + ncnn + spdlog + vulkan-headers + vulkan-loader + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ]; cmakeFlags = [ # Don't build the libvideo2x shared library, we only need the CLI tool diff --git a/pkgs/by-name/vi/viking/package.nix b/pkgs/by-name/vi/viking/package.nix index 6b40ded8b652..19ea89fef086 100644 --- a/pkgs/by-name/vi/viking/package.nix +++ b/pkgs/by-name/vi/viking/package.nix @@ -62,24 +62,24 @@ stdenv.mkDerivation rec { pkg-config wrapGAppsHook3 yelp-tools - ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; - buildInputs = - [ - curl - gdk-pixbuf - gtk3 - json-glib - libxml2 - ] - ++ lib.optional withGeoClue geoclue2 - ++ lib.optional withGeoTag gexiv2 - ++ lib.optional withMagic file - ++ lib.optional withMapnik mapnik - ++ lib.optional withMBTiles sqlite - ++ lib.optional withMd5Hash nettle - ++ lib.optional withOAuth liboauth - ++ lib.optional withRealtimeGPSTracking gpsd; + buildInputs = [ + curl + gdk-pixbuf + gtk3 + json-glib + libxml2 + ] + ++ lib.optional withGeoClue geoclue2 + ++ lib.optional withGeoTag gexiv2 + ++ lib.optional withMagic file + ++ lib.optional withMapnik mapnik + ++ lib.optional withMBTiles sqlite + ++ lib.optional withMd5Hash nettle + ++ lib.optional withOAuth liboauth + ++ lib.optional withRealtimeGPSTracking gpsd; configureFlags = [ (lib.enableFeature withGeoClue "geoclue") diff --git a/pkgs/by-name/vi/vips/package.nix b/pkgs/by-name/vi/vips/package.nix index a79b96df2ce6..71fdca158aa0 100644 --- a/pkgs/by-name/vi/vips/package.nix +++ b/pkgs/by-name/vi/vips/package.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation (finalAttrs: { "out" "man" "dev" - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) [ "devdoc" ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) [ "devdoc" ]; src = fetchFromGitHub { owner = "libvips"; @@ -73,17 +74,16 @@ stdenv.mkDerivation (finalAttrs: { ''; }; - nativeBuildInputs = - [ - docbook-xsl-nons - gobject-introspection - meson - ninja - pkg-config - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) [ - gtk-doc - ]; + nativeBuildInputs = [ + docbook-xsl-nons + gobject-introspection + meson + ninja + pkg-config + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) [ + gtk-doc + ]; buildInputs = [ glib @@ -121,17 +121,16 @@ stdenv.mkDerivation (finalAttrs: { glib ]; - mesonFlags = - [ - (lib.mesonEnable "pdfium" false) - (lib.mesonEnable "nifti" false) - (lib.mesonEnable "spng" false) # we want to use libpng - (lib.mesonEnable "introspection" withIntrospection) - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) ( - lib.mesonBool "gtk_doc" true - ) - ++ lib.optional (imagemagick == null) (lib.mesonEnable "magick" false); + mesonFlags = [ + (lib.mesonEnable "pdfium" false) + (lib.mesonEnable "nifti" false) + (lib.mesonEnable "spng" false) # we want to use libpng + (lib.mesonEnable "introspection" withIntrospection) + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) ( + lib.mesonBool "gtk_doc" true + ) + ++ lib.optional (imagemagick == null) (lib.mesonEnable "magick" false); passthru = { tests = { diff --git a/pkgs/by-name/vi/virglrenderer/package.nix b/pkgs/by-name/vi/virglrenderer/package.nix index 69e81b43b03d..b7f7f9fd69c4 100644 --- a/pkgs/by-name/vi/virglrenderer/package.nix +++ b/pkgs/by-name/vi/virglrenderer/package.nix @@ -31,21 +31,20 @@ stdenv.mkDerivation rec { separateDebugInfo = true; - buildInputs = - [ - libepoxy - ] - ++ lib.optionals vaapiSupport [ libva ] - ++ lib.optionals vulkanSupport [ - vulkan-headers - vulkan-loader - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGLU - libX11 - libdrm - libgbm - ]; + buildInputs = [ + libepoxy + ] + ++ lib.optionals vaapiSupport [ libva ] + ++ lib.optionals vulkanSupport [ + vulkan-headers + vulkan-loader + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGLU + libX11 + libdrm + libgbm + ]; nativeBuildInputs = [ meson @@ -56,14 +55,13 @@ stdenv.mkDerivation rec { ])) ]; - mesonFlags = - [ - (lib.mesonBool "video" vaapiSupport) - (lib.mesonBool "venus" vulkanSupport) - ] - ++ lib.optionals nativeContextSupport [ - (lib.mesonOption "drm-renderers" "amdgpu-experimental,msm") - ]; + mesonFlags = [ + (lib.mesonBool "video" vaapiSupport) + (lib.mesonBool "venus" vulkanSupport) + ] + ++ lib.optionals nativeContextSupport [ + (lib.mesonOption "drm-renderers" "amdgpu-experimental,msm") + ]; passthru = { updateScript = gitUpdater { diff --git a/pkgs/by-name/vi/virt-v2v/package.nix b/pkgs/by-name/vi/virt-v2v/package.nix index 3129e5561b4b..d32f1f818e70 100644 --- a/pkgs/by-name/vi/virt-v2v/package.nix +++ b/pkgs/by-name/vi/virt-v2v/package.nix @@ -43,54 +43,51 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs . ''; - nativeBuildInputs = - [ - pkg-config - autoreconfHook - makeWrapper - bash-completion - perl - libguestfs-with-appliance - qemu - cpio - cdrkit - getopt - ] - ++ (with ocamlPackages; [ - ocaml - findlib - ]); + nativeBuildInputs = [ + pkg-config + autoreconfHook + makeWrapper + bash-completion + perl + libguestfs-with-appliance + qemu + cpio + cdrkit + getopt + ] + ++ (with ocamlPackages; [ + ocaml + findlib + ]); - buildInputs = - [ - libosinfo - pcre2 - libxml2 - jansson - glib - ] - ++ (with ocamlPackages; [ - ocaml_libvirt - nbd - ]); + buildInputs = [ + libosinfo + pcre2 + libxml2 + jansson + glib + ] + ++ (with ocamlPackages; [ + ocaml_libvirt + nbd + ]); - postInstall = - '' - for bin in $out/bin/*; do - wrapProgram "$bin" \ - --prefix PATH : "$out/bin:${ - lib.makeBinPath [ - nbdkit - ocamlPackages.nbd - qemu - ] - }" - done - '' - + lib.optionalString withWindowsGuestSupport '' - ln -s "${virtio-win}" $out/share/virtio-win - ln -s "${pkgsCross.mingwW64.rhsrvany}/bin/" $out/share/virt-tools - ''; + postInstall = '' + for bin in $out/bin/*; do + wrapProgram "$bin" \ + --prefix PATH : "$out/bin:${ + lib.makeBinPath [ + nbdkit + ocamlPackages.nbd + qemu + ] + }" + done + '' + + lib.optionalString withWindowsGuestSupport '' + ln -s "${virtio-win}" $out/share/virtio-win + ln -s "${pkgsCross.mingwW64.rhsrvany}/bin/" $out/share/virt-tools + ''; PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR = "${placeholder "out"}/share/bash-completion/completions"; diff --git a/pkgs/by-name/vi/virt-viewer/package.nix b/pkgs/by-name/vi/virt-viewer/package.nix index 69f9b6fc34f1..999489c0f61f 100644 --- a/pkgs/by-name/vi/virt-viewer/package.nix +++ b/pkgs/by-name/vi/virt-viewer/package.nix @@ -62,33 +62,32 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = + buildInputs = [ + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + bash-completion + glib + gsettings-desktop-schemas + gtk-vnc + gtk3 + libvirt + libvirt-glib + libxml2 + vte + ] + ++ lib.optionals ovirtSupport [ + libgovirt + ] + ++ lib.optionals spiceSupport ( [ - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - bash-completion - glib - gsettings-desktop-schemas - gtk-vnc - gtk3 - libvirt - libvirt-glib - libxml2 - vte + gdbm + spice-gtk + spice-protocol ] - ++ lib.optionals ovirtSupport [ - libgovirt + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap ] - ++ lib.optionals spiceSupport ( - [ - gdbm - spice-gtk - spice-protocol - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - ] - ); + ); # Required for USB redirection PolicyKit rules file propagatedUserEnvPkgs = lib.optional spiceSupport spice-gtk; diff --git a/pkgs/by-name/vi/vis/package.nix b/pkgs/by-name/vi/vis/package.nix index f2c64626a78c..a647e882e961 100644 --- a/pkgs/by-name/vi/vis/package.nix +++ b/pkgs/by-name/vi/vis/package.nix @@ -34,17 +34,16 @@ stdenv.mkDerivation rec { copyDesktopItems ]; - buildInputs = - [ - ncurses - libtermkey - luaEnv - tre - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - acl - libselinux - ]; + buildInputs = [ + ncurses + libtermkey + luaEnv + tre + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + acl + libselinux + ]; postInstall = '' wrapProgram $out/bin/vis \ diff --git a/pkgs/by-name/vi/viskores/package.nix b/pkgs/by-name/vi/viskores/package.nix index 9eef56ce5b04..5f6e601e27bc 100644 --- a/pkgs/by-name/vi/viskores/package.nix +++ b/pkgs/by-name/vi/viskores/package.nix @@ -35,12 +35,11 @@ stdenv.mkDerivation (finalAttrs: { ninja ]; - propagatedBuildInputs = - [ - tbb - ] - ++ lib.optional mpiSupport mpi - ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; + propagatedBuildInputs = [ + tbb + ] + ++ lib.optional mpiSupport mpi + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp; cmakeFlags = [ (lib.cmakeBool "Viskores_ENABLE_OPENMP" true) diff --git a/pkgs/by-name/vi/visp/package.nix b/pkgs/by-name/vi/visp/package.nix index 099aedfb91a1..5dbf50e4e4a1 100644 --- a/pkgs/by-name/vi/visp/package.nix +++ b/pkgs/by-name/vi/visp/package.nix @@ -70,31 +70,30 @@ stdenv.mkDerivation (finalAttrs: { texliveSmall ]; - buildInputs = - [ - eigen - lapack - libdc1394 - libdmtx - libglvnd - libjpeg - libpng - librealsense - libX11 - libxml2 - nlohmann_json - #ogre - openblas - opencv - python3Packages.numpy - xorg.libpthreadstubs - zbar - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - coin3d - v4l-utils - ]; + buildInputs = [ + eigen + lapack + libdc1394 + libdmtx + libglvnd + libjpeg + libpng + librealsense + libX11 + libxml2 + nlohmann_json + #ogre + openblas + opencv + python3Packages.numpy + xorg.libpthreadstubs + zbar + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + coin3d + v4l-utils + ]; doCheck = true; diff --git a/pkgs/by-name/vi/visual-hexdiff/package.nix b/pkgs/by-name/vi/visual-hexdiff/package.nix index d4665c986fac..e9f92df7adb9 100644 --- a/pkgs/by-name/vi/visual-hexdiff/package.nix +++ b/pkgs/by-name/vi/visual-hexdiff/package.nix @@ -26,17 +26,16 @@ stdenv.mkDerivation { }) ]; - postPatch = - '' - # Fix compiler error that wants a string literal as format string for `wprintw` - substituteInPlace sel_file.c \ - --replace-fail 'wprintw(win, txt_aide_fs[foo]);' 'wprintw(win, "%s", txt_aide_fs[foo]);' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Fix compiler error on Darwin: conflicting types for 'strdup' - substituteInPlace sel_file.c \ - --replace-fail 'char *strdup(char *);' ' ' - ''; + postPatch = '' + # Fix compiler error that wants a string literal as format string for `wprintw` + substituteInPlace sel_file.c \ + --replace-fail 'wprintw(win, txt_aide_fs[foo]);' 'wprintw(win, "%s", txt_aide_fs[foo]);' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Fix compiler error on Darwin: conflicting types for 'strdup' + substituteInPlace sel_file.c \ + --replace-fail 'char *strdup(char *);' ' ' + ''; buildInputs = [ ncurses ]; diff --git a/pkgs/by-name/vi/vivaldi/package.nix b/pkgs/by-name/vi/vivaldi/package.nix index 6a85d9a42758..5c0b04eba27d 100644 --- a/pkgs/by-name/vi/vivaldi/package.nix +++ b/pkgs/by-name/vi/vivaldi/package.nix @@ -100,63 +100,62 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; - buildInputs = - [ - stdenv.cc.cc - stdenv.cc.libc - zlib - libX11 - libXt - libXext - libSM - libICE - libxcb - libxkbcommon - libxshmfence - libXi - libXft - libXcursor - libXfixes - libXScrnSaver - libXcomposite - libXdamage - libXtst - libXrandr - atk - at-spi2-atk - at-spi2-core - alsa-lib - dbus - cups - gtk3 - gdk-pixbuf - libexif - ffmpeg - systemd - libva - qt6.qtbase - qt6.qtwayland - freetype - fontconfig - libXrender - libuuid - expat - glib - nss - nspr - libGL - libxml2 - pango - cairo - libdrm - libgbm - vulkan-loader - wayland - pipewire - ] - ++ lib.optional proprietaryCodecs vivaldi-ffmpeg-codecs - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional kerberosSupport libkrb5; + buildInputs = [ + stdenv.cc.cc + stdenv.cc.libc + zlib + libX11 + libXt + libXext + libSM + libICE + libxcb + libxkbcommon + libxshmfence + libXi + libXft + libXcursor + libXfixes + libXScrnSaver + libXcomposite + libXdamage + libXtst + libXrandr + atk + at-spi2-atk + at-spi2-core + alsa-lib + dbus + cups + gtk3 + gdk-pixbuf + libexif + ffmpeg + systemd + libva + qt6.qtbase + qt6.qtwayland + freetype + fontconfig + libXrender + libuuid + expat + glib + nss + nspr + libGL + libxml2 + pango + cairo + libdrm + libgbm + vulkan-loader + wayland + pipewire + ] + ++ lib.optional proprietaryCodecs vivaldi-ffmpeg-codecs + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional kerberosSupport libkrb5; libPath = lib.makeLibraryPath buildInputs @@ -165,65 +164,63 @@ stdenv.mkDerivation rec { ) + ":$out/opt/vivaldi/lib"; - buildPhase = - '' - runHook preBuild - echo "Patching Vivaldi binaries" - for f in chrome_crashpad_handler vivaldi-bin vivaldi-sandbox ; do - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${libPath}" \ - opt/vivaldi/$f - done + buildPhase = '' + runHook preBuild + echo "Patching Vivaldi binaries" + for f in chrome_crashpad_handler vivaldi-bin vivaldi-sandbox ; do + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${libPath}" \ + opt/vivaldi/$f + done - for f in libGLESv2.so libqt5_shim.so libqt6_shim.so; do - patchelf --set-rpath "${libPath}" opt/vivaldi/$f - done - '' - + lib.optionalString proprietaryCodecs '' - ln -s ${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so opt/vivaldi/libffmpeg.so.''${version%\.*\.*} - '' - + '' - echo "Finished patching Vivaldi binaries" - runHook postBuild - ''; + for f in libGLESv2.so libqt5_shim.so libqt6_shim.so; do + patchelf --set-rpath "${libPath}" opt/vivaldi/$f + done + '' + + lib.optionalString proprietaryCodecs '' + ln -s ${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so opt/vivaldi/libffmpeg.so.''${version%\.*\.*} + '' + + '' + echo "Finished patching Vivaldi binaries" + runHook postBuild + ''; dontPatchELF = true; dontStrip = true; - installPhase = - '' - runHook preInstall - mkdir -p "$out" - cp -r opt "$out" - mkdir "$out/bin" - ln -s "$out/opt/vivaldi/vivaldi" "$out/bin/vivaldi" - mkdir -p "$out/share" - cp -r usr/share/{applications,xfce4} "$out"/share - substituteInPlace "$out"/share/applications/*.desktop \ - --replace-fail /usr/bin/vivaldi "$out"/bin/vivaldi - substituteInPlace "$out"/share/applications/*.desktop \ - --replace-fail vivaldi-stable vivaldi - local d - for d in 16 22 24 32 48 64 128 256; do - mkdir -p "$out"/share/icons/hicolor/''${d}x''${d}/apps - ln -s \ - "$out"/opt/vivaldi/product_logo_''${d}.png \ - "$out"/share/icons/hicolor/''${d}x''${d}/apps/vivaldi.png - done - wrapProgram "$out/bin/vivaldi" \ - --add-flags ${lib.escapeShellArg commandLineArgs} \ - --prefix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/ \ - --prefix LD_LIBRARY_PATH : ${libPath} \ - --prefix PATH : ${coreutils}/bin \ - ''${qtWrapperArgs[@]} - '' - + lib.optionalString enableWidevine '' - ln -sf ${widevine-cdm}/share/google/chrome/WidevineCdm $out/opt/vivaldi/WidevineCdm - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p "$out" + cp -r opt "$out" + mkdir "$out/bin" + ln -s "$out/opt/vivaldi/vivaldi" "$out/bin/vivaldi" + mkdir -p "$out/share" + cp -r usr/share/{applications,xfce4} "$out"/share + substituteInPlace "$out"/share/applications/*.desktop \ + --replace-fail /usr/bin/vivaldi "$out"/bin/vivaldi + substituteInPlace "$out"/share/applications/*.desktop \ + --replace-fail vivaldi-stable vivaldi + local d + for d in 16 22 24 32 48 64 128 256; do + mkdir -p "$out"/share/icons/hicolor/''${d}x''${d}/apps + ln -s \ + "$out"/opt/vivaldi/product_logo_''${d}.png \ + "$out"/share/icons/hicolor/''${d}x''${d}/apps/vivaldi.png + done + wrapProgram "$out/bin/vivaldi" \ + --add-flags ${lib.escapeShellArg commandLineArgs} \ + --prefix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/ \ + --prefix LD_LIBRARY_PATH : ${libPath} \ + --prefix PATH : ${coreutils}/bin \ + ''${qtWrapperArgs[@]} + '' + + lib.optionalString enableWidevine '' + ln -sf ${widevine-cdm}/share/google/chrome/WidevineCdm $out/opt/vivaldi/WidevineCdm + '' + + '' + runHook postInstall + ''; passthru.updateScript = ./update-vivaldi.sh; diff --git a/pkgs/by-name/vl/vlang/package.nix b/pkgs/by-name/vl/vlang/package.nix index 465fe327a9d5..dcf860d20446 100644 --- a/pkgs/by-name/vl/vlang/package.nix +++ b/pkgs/by-name/vl/vlang/package.nix @@ -67,20 +67,20 @@ stdenv.mkDerivation { glfw freetype openssl - ] ++ lib.optional stdenv.hostPlatform.isUnix upx; + ] + ++ lib.optional stdenv.hostPlatform.isUnix upx; nativeBuildInputs = [ makeWrapper ]; - buildInputs = - [ - binaryen - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - xorg.libX11 - xorg.libXau - xorg.libXdmcp - xorg.xorgproto - ]; + buildInputs = [ + binaryen + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + xorg.libX11 + xorg.libXau + xorg.libXdmcp + xorg.xorgproto + ]; makeFlags = [ "local=1" diff --git a/pkgs/by-name/vl/vlc/package.nix b/pkgs/by-name/vl/vlc/package.nix index 97e688c1f2e7..750b99136e61 100644 --- a/pkgs/by-name/vl/vlc/package.nix +++ b/pkgs/by-name/vl/vlc/package.nix @@ -113,124 +113,121 @@ stdenv.mkDerivation (finalAttrs: { depsBuildBuild = optionals waylandSupport [ pkg-config ]; - nativeBuildInputs = - [ - autoreconfHook - lua5 - perl - pkg-config - removeReferencesTo - unzip - wrapGAppsHook3 - ] - ++ optionals chromecastSupport [ protobuf ] - ++ optionals withQt5 [ libsForQt5.wrapQtAppsHook ] - ++ optionals waylandSupport [ - wayland-scanner - ]; + nativeBuildInputs = [ + autoreconfHook + lua5 + perl + pkg-config + removeReferencesTo + unzip + wrapGAppsHook3 + ] + ++ optionals chromecastSupport [ protobuf ] + ++ optionals withQt5 [ libsForQt5.wrapQtAppsHook ] + ++ optionals waylandSupport [ + wayland-scanner + ]; # VLC uses a *ton* of libraries for various pieces of functionality, many of # which are not included here for no other reason that nobody has mentioned # needing them - buildInputs = + buildInputs = [ + a52dec + alsa-lib + avahi + cairo + dbus + faad2 + ffmpeg_6 + flac + fluidsynth + fontconfig + freetype + fribidi + gnutls + harfbuzz + libGL + libSM + libarchive + libass + libbluray + libcaca + libcddb + libdc1394 + libdvbpsi + libdvdnav + libdvdnav.libdvdread + libebml + libgcrypt + libgpg-error + libjpeg + libkate + libmad + libmatroska + libmodplug + libmpeg2 + libmtp + libogg + libopus + libplacebo_5 + libpng + libpulseaudio + librsvg + libsamplerate + libspatialaudio + libssh2 + libtheora + libtiger + libupnp + libv4l + libva + libvorbis + libxml2 + lua5 + ncurses + samba + schroedinger + speex + srt + systemdLibs + taglib_1 + xcbutilkeysyms + zlib + ] + ++ optionals (!onlyLibVLC) [ live555 ] + ++ optionals jackSupport [ libjack2 ] + ++ optionals chromecastSupport [ + libmicrodns + protobuf + ] + ++ optionals skins2Support [ + libXext + libXinerama + libXpm + ] + ++ optionals waylandSupport [ + wayland + wayland-protocols + ] + ++ optionals withQt5 ( + with libsForQt5; [ - a52dec - alsa-lib - avahi - cairo - dbus - faad2 - ffmpeg_6 - flac - fluidsynth - fontconfig - freetype - fribidi - gnutls - harfbuzz - libGL - libSM - libarchive - libass - libbluray - libcaca - libcddb - libdc1394 - libdvbpsi - libdvdnav - libdvdnav.libdvdread - libebml - libgcrypt - libgpg-error - libjpeg - libkate - libmad - libmatroska - libmodplug - libmpeg2 - libmtp - libogg - libopus - libplacebo_5 - libpng - libpulseaudio - librsvg - libsamplerate - libspatialaudio - libssh2 - libtheora - libtiger - libupnp - libv4l - libva - libvorbis - libxml2 - lua5 - ncurses - samba - schroedinger - speex - srt - systemdLibs - taglib_1 - xcbutilkeysyms - zlib + qtbase + qtsvg + qtx11extras ] - ++ optionals (!onlyLibVLC) [ live555 ] - ++ optionals jackSupport [ libjack2 ] - ++ optionals chromecastSupport [ - libmicrodns - protobuf - ] - ++ optionals skins2Support [ - libXext - libXinerama - libXpm - ] - ++ optionals waylandSupport [ - wayland - wayland-protocols - ] - ++ optionals withQt5 ( - with libsForQt5; - [ - qtbase - qtsvg - qtx11extras - ] - ) - ++ optionals (waylandSupport && withQt5) [ libsForQt5.qtwayland ]; + ) + ++ optionals (waylandSupport && withQt5) [ libsForQt5.qtwayland ]; strictDeps = true; - env = - { - # vlc searches for c11-gcc, c11, c99-gcc, c99, which don't exist and would be wrong for cross compilation anyway. - BUILDCC = "${pkgsBuildBuild.stdenv.cc}/bin/gcc"; - LIVE555_PREFIX = live555; - } - // lib.optionalAttrs stdenv.cc.isGNU { - NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - }; + env = { + # vlc searches for c11-gcc, c11, c99-gcc, c99, which don't exist and would be wrong for cross compilation anyway. + BUILDCC = "${pkgsBuildBuild.stdenv.cc}/bin/gcc"; + LIVE555_PREFIX = live555; + } + // lib.optionalAttrs stdenv.cc.isGNU { + NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; + }; patches = [ # patch to build with recent live555 @@ -250,20 +247,19 @@ stdenv.mkDerivation (finalAttrs: { ./deterministic-plugin-cache.diff ]; - postPatch = - '' - substituteInPlace modules/text_renderer/freetype/platform_fonts.h \ - --replace \ - /usr/share/fonts/truetype/freefont \ - ${freefont_ttf}/share/fonts/truetype - '' - # Upstream luac can't cross compile, so we have to install the lua sources - # instead of bytecode, which was built for buildPlatform: - # https://www.lua.org/wshop13/Jericke.pdf#page=39 - + lib.optionalString (!stdenv.hostPlatform.canExecute stdenv.buildPlatform) '' - substituteInPlace share/Makefile.am \ - --replace $'.luac \\\n' $'.lua \\\n' - ''; + postPatch = '' + substituteInPlace modules/text_renderer/freetype/platform_fonts.h \ + --replace \ + /usr/share/fonts/truetype/freefont \ + ${freefont_ttf}/share/fonts/truetype + '' + # Upstream luac can't cross compile, so we have to install the lua sources + # instead of bytecode, which was built for buildPlatform: + # https://www.lua.org/wshop13/Jericke.pdf#page=39 + + lib.optionalString (!stdenv.hostPlatform.canExecute stdenv.buildPlatform) '' + substituteInPlace share/Makefile.am \ + --replace $'.luac \\\n' $'.lua \\\n' + ''; enableParallelBuilding = true; @@ -271,16 +267,17 @@ stdenv.mkDerivation (finalAttrs: { # Most of the libraries are auto-detected so we don't need to set a bunch of # "--enable-foo" flags here - configureFlags = - [ "--with-kde-solid=$out/share/apps/solid/actions" ] - ++ optionals onlyLibVLC [ "--disable-vlc" ] - ++ optionals skins2Support [ "--enable-skins2" ] - ++ optionals waylandSupport [ "--enable-wayland" ] - ++ optionals chromecastSupport [ - "--enable-sout" - "--enable-chromecast" - "--enable-microdns" - ]; + configureFlags = [ + "--with-kde-solid=$out/share/apps/solid/actions" + ] + ++ optionals onlyLibVLC [ "--disable-vlc" ] + ++ optionals skins2Support [ "--enable-skins2" ] + ++ optionals waylandSupport [ "--enable-wayland" ] + ++ optionals chromecastSupport [ + "--enable-sout" + "--enable-chromecast" + "--enable-microdns" + ]; # Remove runtime dependencies on libraries postConfigure = '' @@ -304,17 +301,16 @@ stdenv.mkDerivation (finalAttrs: { # pkgsBuildBuild is used here because buildPackages.libvlc somehow # depends on a qt5.qttranslations that doesn't build, even though it # should be the same as pkgsBuildBuild.qt5.qttranslations. - postFixup = - '' - patchelf --add-rpath ${libv4l}/lib "$out/lib/vlc/plugins/access/libv4l2_plugin.so" - find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';' - ${ - if stdenv.buildPlatform.canExecute stdenv.hostPlatform then "$out" else pkgsBuildBuild.libvlc - }/lib/vlc/vlc-cache-gen $out/vlc/plugins - '' - + optionalString withQt5 '' - remove-references-to -t "${libsForQt5.qtbase.dev}" $out/lib/vlc/plugins/gui/libqt_plugin.so - ''; + postFixup = '' + patchelf --add-rpath ${libv4l}/lib "$out/lib/vlc/plugins/access/libv4l2_plugin.so" + find $out/lib/vlc/plugins -exec touch -d @1 '{}' ';' + ${ + if stdenv.buildPlatform.canExecute stdenv.hostPlatform then "$out" else pkgsBuildBuild.libvlc + }/lib/vlc/vlc-cache-gen $out/vlc/plugins + '' + + optionalString withQt5 '' + remove-references-to -t "${libsForQt5.qtbase.dev}" $out/lib/vlc/plugins/gui/libqt_plugin.so + ''; passthru.updateScript = genericUpdater { versionLister = writeShellScript "vlc-versionLister" '' diff --git a/pkgs/by-name/vm/vmware-workstation/package.nix b/pkgs/by-name/vm/vmware-workstation/package.nix index 7150351ba562..702c060e115e 100644 --- a/pkgs/by-name/vm/vmware-workstation/package.nix +++ b/pkgs/by-name/vm/vmware-workstation/package.nix @@ -79,19 +79,18 @@ stdenv.mkDerivation (finalAttrs: { ''; }; - nativeBuildInputs = - [ - python3 - finalAttrs.vmware-unpack-env - autoPatchelfHook - makeWrapper - ] - ++ lib.optionals enableInstaller [ - bzip2 - sqlite - finalAttrs.readline70_compat63 - ] - ++ lib.optionals enableMacOSGuests [ unzip ]; + nativeBuildInputs = [ + python3 + finalAttrs.vmware-unpack-env + autoPatchelfHook + makeWrapper + ] + ++ lib.optionals enableInstaller [ + bzip2 + sqlite + finalAttrs.readline70_compat63 + ] + ++ lib.optionals enableMacOSGuests [ unzip ]; buildInputs = [ libxslt diff --git a/pkgs/by-name/vo/voicevox-engine/package.nix b/pkgs/by-name/vo/voicevox-engine/package.nix index b999573501de..9bf523418e67 100644 --- a/pkgs/by-name/vo/voicevox-engine/package.nix +++ b/pkgs/by-name/vo/voicevox-engine/package.nix @@ -26,27 +26,26 @@ python3Packages.buildPythonApplication rec { hatchling ]; - dependencies = - [ - passthru.pyopenjtalk - ] - ++ (with python3Packages; [ - fastapi - jinja2 - kanalizer - numpy - platformdirs - pydantic - python-multipart - pyworld - pyyaml - semver - setuptools - soundfile - soxr - starlette - uvicorn - ]); + dependencies = [ + passthru.pyopenjtalk + ] + ++ (with python3Packages; [ + fastapi + jinja2 + kanalizer + numpy + platformdirs + pydantic + python-multipart + pyworld + pyyaml + semver + setuptools + soundfile + soxr + starlette + uvicorn + ]); pythonRemoveDeps = [ # upstream wants fastapi-slim, but we provide fastapi instead diff --git a/pkgs/by-name/vo/voicevox/package.nix b/pkgs/by-name/vo/voicevox/package.nix index dde014b43e85..3b6b99dd7137 100644 --- a/pkgs/by-name/vo/voicevox/package.nix +++ b/pkgs/by-name/vo/voicevox/package.nix @@ -68,18 +68,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-RKgqFmHQnjHS7yeUIbH9awpNozDOCCHplc/bmfxmMyg="; }; - nativeBuildInputs = - [ - dart-sass - jq - makeWrapper - moreutils - nodejs - pnpm.configHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - copyDesktopItems - ]; + nativeBuildInputs = [ + dart-sass + jq + makeWrapper + moreutils + nodejs + pnpm.configHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + copyDesktopItems + ]; env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; diff --git a/pkgs/by-name/vo/volctl/package.nix b/pkgs/by-name/vo/volctl/package.nix index e1f9438ff115..57c79d878676 100644 --- a/pkgs/by-name/vo/volctl/package.nix +++ b/pkgs/by-name/vo/volctl/package.nix @@ -38,18 +38,17 @@ python3Packages.buildPythonApplication rec { wrapGAppsHook3 ]; - propagatedBuildInputs = - [ - pango - gtk3 - ] - ++ (with python3Packages; [ - pulsectl - click - pycairo - pygobject3 - pyyaml - ]); + propagatedBuildInputs = [ + pango + gtk3 + ] + ++ (with python3Packages; [ + pulsectl + click + pycairo + pygobject3 + pyyaml + ]); # with strictDeps importing "gi.repository.Gtk" fails with "gi.RepositoryError: Typelib file for namespace 'Pango', version '1.0' not found" strictDeps = false; diff --git a/pkgs/by-name/vo/volk_2/package.nix b/pkgs/by-name/vo/volk_2/package.nix index fa32bf920a60..dd6cd7ec1855 100644 --- a/pkgs/by-name/vo/volk_2/package.nix +++ b/pkgs/by-name/vo/volk_2/package.nix @@ -35,13 +35,14 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - cmakeFlags = - [ (lib.cmakeBool "ENABLE_MODTOOL" enableModTool) ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # offset 14335 in1: -1.03372 in2: -1.03371 tolerance was: 1e-05 - # volk_32f_log2_32f: fail on arch neon - "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;qa_volk_32f_log2_32f" - ]; + cmakeFlags = [ + (lib.cmakeBool "ENABLE_MODTOOL" enableModTool) + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # offset 14335 in1: -1.03372 in2: -1.03371 tolerance was: 1e-05 + # volk_32f_log2_32f: fail on arch neon + "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;qa_volk_32f_log2_32f" + ]; postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so) diff --git a/pkgs/by-name/vo/voms/package.nix b/pkgs/by-name/vo/voms/package.nix index 2ecf704387a2..8bbcea533031 100644 --- a/pkgs/by-name/vo/voms/package.nix +++ b/pkgs/by-name/vo/voms/package.nix @@ -48,16 +48,15 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; - outputs = - [ - "bin" - "out" - "dev" - "man" - ] - # `etc` output for default configurations that can optionally be - # installed to /etc (system-wide) or profile-path>/etc. - ++ lib.optional (externalEtc != null) "etc"; + outputs = [ + "bin" + "out" + "dev" + "man" + ] + # `etc` output for default configurations that can optionally be + # installed to /etc (system-wide) or profile-path>/etc. + ++ lib.optional (externalEtc != null) "etc"; preAutoreconf = '' mkdir -p aux src/autogen diff --git a/pkgs/by-name/vo/vorta/package.nix b/pkgs/by-name/vo/vorta/package.nix index 05e277e07e34..ac1911cbe607 100644 --- a/pkgs/by-name/vo/vorta/package.nix +++ b/pkgs/by-name/vo/vorta/package.nix @@ -25,11 +25,12 @@ python3Packages.buildPythonApplication rec { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ qt6Packages.qtsvg ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qt6Packages.qtwayland - ]; + buildInputs = [ + qt6Packages.qtsvg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6Packages.qtwayland + ]; build-system = with python3Packages; [ setuptools @@ -84,16 +85,15 @@ python3Packages.buildPythonApplication rec { export QT_QPA_PLATFORM=offscreen ''; - disabledTestPaths = - [ - # QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*) "tests/test_excludes.py" - "tests/integration" - "tests/unit" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Darwin-only test - "tests/network_manager/test_darwin.py" - ]; + disabledTestPaths = [ + # QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*) "tests/test_excludes.py" + "tests/integration" + "tests/unit" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # Darwin-only test + "tests/network_manager/test_darwin.py" + ]; meta = { changelog = "https://github.com/borgbase/vorta/releases/tag/v${version}"; diff --git a/pkgs/by-name/vo/voxinput/package.nix b/pkgs/by-name/vo/voxinput/package.nix index cf5ae4a60219..d822d6a0f122 100644 --- a/pkgs/by-name/vo/voxinput/package.nix +++ b/pkgs/by-name/vo/voxinput/package.nix @@ -34,16 +34,15 @@ buildGoModule (finalAttrs: { # To take advantage of the udev rule something like `services.udev.packages = [ nixpkgs.voxinput ]` # needs to be added to your configuration.nix - postInstall = - '' - mv $out/bin/VoxInput $out/bin/voxinput_tmp ; mv $out/bin/voxinput_tmp $out/bin/voxinput - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/voxinput \ - --prefix PATH : ${lib.makeBinPath [ dotool ]} - mkdir -p $out/lib/udev/rules.d - echo 'KERNEL=="uinput", GROUP="input", MODE="0620", OPTIONS+="static_node=uinput"' > $out/lib/udev/rules.d/99-voxinput.rules - ''; + postInstall = '' + mv $out/bin/VoxInput $out/bin/voxinput_tmp ; mv $out/bin/voxinput_tmp $out/bin/voxinput + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram $out/bin/voxinput \ + --prefix PATH : ${lib.makeBinPath [ dotool ]} + mkdir -p $out/lib/udev/rules.d + echo 'KERNEL=="uinput", GROUP="input", MODE="0620", OPTIONS+="static_node=uinput"' > $out/lib/udev/rules.d/99-voxinput.rules + ''; postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' patchelf $out/bin/.voxinput-wrapped \ diff --git a/pkgs/by-name/vp/vpnc-scripts/package.nix b/pkgs/by-name/vp/vpnc-scripts/package.nix index eaa27cc2d290..01f8f8ef2850 100644 --- a/pkgs/by-name/vp/vpnc-scripts/package.nix +++ b/pkgs/by-name/vp/vpnc-scripts/package.nix @@ -30,36 +30,35 @@ stdenv.mkDerivation { cp vpnc-script $out/bin ''; - preFixup = - '' - substituteInPlace $out/bin/vpnc-script \ - --replace "which" "type -P" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $out/bin/vpnc-script \ - --replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" - '' - + lib.optionalString withSystemd '' - substituteInPlace $out/bin/vpnc-script \ - --replace "/usr/bin/resolvectl" "${systemd}/bin/resolvectl" - '' - + '' - wrapProgram $out/bin/vpnc-script \ - --prefix PATH : "${ - lib.makeBinPath ( - [ - net-tools - gawk - coreutils - gnugrep - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - openresolv - iproute2 - ] - ) - }" - ''; + preFixup = '' + substituteInPlace $out/bin/vpnc-script \ + --replace "which" "type -P" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $out/bin/vpnc-script \ + --replace "/sbin/resolvconf" "${openresolv}/bin/resolvconf" + '' + + lib.optionalString withSystemd '' + substituteInPlace $out/bin/vpnc-script \ + --replace "/usr/bin/resolvectl" "${systemd}/bin/resolvectl" + '' + + '' + wrapProgram $out/bin/vpnc-script \ + --prefix PATH : "${ + lib.makeBinPath ( + [ + net-tools + gawk + coreutils + gnugrep + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + openresolv + iproute2 + ] + ) + }" + ''; meta = with lib; { homepage = "https://www.infradead.org/openconnect/"; diff --git a/pkgs/by-name/vp/vpnc/package.nix b/pkgs/by-name/vp/vpnc/package.nix index e38018db7aeb..e37a9898f029 100644 --- a/pkgs/by-name/vp/vpnc/package.nix +++ b/pkgs/by-name/vp/vpnc/package.nix @@ -29,35 +29,37 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper perl - ] ++ lib.optional (!opensslSupport) pkg-config; + ] + ++ lib.optional (!opensslSupport) pkg-config; buildInputs = [ libgcrypt perl - ] ++ (if opensslSupport then [ openssl ] else [ gnutls ]); + ] + ++ (if opensslSupport then [ openssl ] else [ gnutls ]); makeFlags = [ "PREFIX=$(out)" "ETCDIR=$(out)/etc/vpnc" "SCRIPT_PATH=${vpnc-scripts}/bin/vpnc-script" - ] ++ lib.optional opensslSupport "OPENSSL_GPL_VIOLATION=yes"; + ] + ++ lib.optional opensslSupport "OPENSSL_GPL_VIOLATION=yes"; env = lib.optionalAttrs stdenv.cc.isGNU { NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; }; - postPatch = - '' - substituteInPlace src/vpnc-disconnect \ - --replace-fail /bin/sh ${lib.getExe' bash "sh"} - patchShebangs src/makeman.pl - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # manpage generation invokes the build vpnc, which must be emulating when cross compiling - substituteInPlace src/makeman.pl --replace-fail \ - '$vpnc --long-help' \ - '${stdenv.hostPlatform.emulator buildPackages} $vpnc --long-help' - ''; + postPatch = '' + substituteInPlace src/vpnc-disconnect \ + --replace-fail /bin/sh ${lib.getExe' bash "sh"} + patchShebangs src/makeman.pl + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # manpage generation invokes the build vpnc, which must be emulating when cross compiling + substituteInPlace src/makeman.pl --replace-fail \ + '$vpnc --long-help' \ + '${stdenv.hostPlatform.emulator buildPackages} $vpnc --long-help' + ''; enableParallelBuilding = true; # Missing install depends: diff --git a/pkgs/by-name/vp/vpp/package.nix b/pkgs/by-name/vp/vpp/package.nix index f1d64c855c72..08756a76a320 100644 --- a/pkgs/by-name/vp/vpp/package.nix +++ b/pkgs/by-name/vp/vpp/package.nix @@ -83,42 +83,41 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DVPP_PLATFORM=default" "-DVPP_LIBRARY_DIR=lib" - ] ++ lib.optional enableDpdk "-DVPP_USE_SYSTEM_DPDK=ON"; + ] + ++ lib.optional enableDpdk "-DVPP_USE_SYSTEM_DPDK=ON"; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optional enableDpdk dpdk' - ++ lib.optional enableRdma rdma-core'.dev; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optional enableDpdk dpdk' + ++ lib.optional enableRdma rdma-core'.dev; - buildInputs = - [ - check - openssl - (python3.withPackages (ps: [ ps.ply ])) + buildInputs = [ + check + openssl + (python3.withPackages (ps: [ ps.ply ])) - subunit # vapi tests - mbedtls_2 # tlsmbed plugin - libpcap # bpf_trace_filter plugin + subunit # vapi tests + mbedtls_2 # tlsmbed plugin + libpcap # bpf_trace_filter plugin - # linux-cp plugin - libnl - libmnl - ] - ++ lib.optionals enableDpdk [ - # dpdk plugin - libelf - jansson - zlib - ] - ++ lib.optionals enableAfXdp [ - # af_xdp plugin - libelf - libbpf - xdp-tools' - ]; + # linux-cp plugin + libnl + libmnl + ] + ++ lib.optionals enableDpdk [ + # dpdk plugin + libelf + jansson + zlib + ] + ++ lib.optionals enableAfXdp [ + # af_xdp plugin + libelf + libbpf + xdp-tools' + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/vs/vscode-js-debug/package.nix b/pkgs/by-name/vs/vscode-js-debug/package.nix index e65901b34471..ef1b9673c580 100644 --- a/pkgs/by-name/vs/vscode-js-debug/package.nix +++ b/pkgs/by-name/vs/vscode-js-debug/package.nix @@ -29,7 +29,8 @@ buildNpmPackage rec { nativeBuildInputs = [ pkg-config node-gyp - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ libsecret ]; diff --git a/pkgs/by-name/vt/vte/package.nix b/pkgs/by-name/vt/vte/package.nix index 153230409156..476b3748ae34 100644 --- a/pkgs/by-name/vt/vte/package.nix +++ b/pkgs/by-name/vt/vte/package.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optional (gtkVersion != null) "devdoc"; + ] + ++ lib.optional (gtkVersion != null) "devdoc"; src = fetchurl { url = "mirror://gnome/sources/vte/${lib.versions.majorMinor finalAttrs.version}/vte-${finalAttrs.version}.tar.xz"; @@ -72,20 +73,19 @@ stdenv.mkDerivation (finalAttrs: { gi-docgen ]; - buildInputs = - [ - cairo - fribidi - gnutls - pango # duplicated with propagatedBuildInputs to support gtkVersion == null - pcre2 - lz4 - icu - fast-float - ] - ++ lib.optionals systemdSupport [ - systemd - ]; + buildInputs = [ + cairo + fribidi + gnutls + pango # duplicated with propagatedBuildInputs to support gtkVersion == null + pcre2 + lz4 + icu + fast-float + ] + ++ lib.optionals systemdSupport [ + systemd + ]; # Required by vte-2.91.pc. propagatedBuildInputs = lib.optionals (gtkVersion != null) [ @@ -97,19 +97,18 @@ stdenv.mkDerivation (finalAttrs: { pango ]; - mesonFlags = - [ - "-Ddocs=true" - (lib.mesonBool "gtk3" (gtkVersion == "3")) - (lib.mesonBool "gtk4" (gtkVersion == "4")) - ] - ++ lib.optionals (!systemdSupport) [ - "-D_systemd=false" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # -Bsymbolic-functions is not supported on darwin - "-D_b_symbolic_functions=false" - ]; + mesonFlags = [ + "-Ddocs=true" + (lib.mesonBool "gtk3" (gtkVersion == "3")) + (lib.mesonBool "gtk4" (gtkVersion == "4")) + ] + ++ lib.optionals (!systemdSupport) [ + "-D_systemd=false" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # -Bsymbolic-functions is not supported on darwin + "-D_b_symbolic_functions=false" + ]; # error: argument unused during compilation: '-pie' [-Werror,-Wunused-command-line-argument] env.NIX_CFLAGS_COMPILE = toString ( diff --git a/pkgs/by-name/vu/vulkan-loader/package.nix b/pkgs/by-name/vu/vulkan-loader/package.nix index 712d91733b52..c2e61f455bf5 100644 --- a/pkgs/by-name/vu/vulkan-loader/package.nix +++ b/pkgs/by-name/vu/vulkan-loader/package.nix @@ -32,26 +32,26 @@ stdenv.mkDerivation (finalAttrs: { cmake pkg-config ]; - buildInputs = - [ vulkan-headers ] - ++ lib.optionals enableX11 [ - libX11 - libxcb - libXrandr - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - ]; + buildInputs = [ + vulkan-headers + ] + ++ lib.optionals enableX11 [ + libX11 + libxcb + libXrandr + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + ]; - cmakeFlags = - [ - "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" - (lib.cmakeBool "BUILD_WSI_XCB_SUPPORT" enableX11) - (lib.cmakeBool "BUILD_WSI_XLIB_SUPPORT" enableX11) - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "-DSYSCONFDIR=${moltenvk}/share" - ++ lib.optional stdenv.hostPlatform.isLinux "-DSYSCONFDIR=${addDriverRunpath.driverLink}/share" - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DUSE_GAS=OFF"; + cmakeFlags = [ + "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" + (lib.cmakeBool "BUILD_WSI_XCB_SUPPORT" enableX11) + (lib.cmakeBool "BUILD_WSI_XLIB_SUPPORT" enableX11) + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "-DSYSCONFDIR=${moltenvk}/share" + ++ lib.optional stdenv.hostPlatform.isLinux "-DSYSCONFDIR=${addDriverRunpath.driverLink}/share" + ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DUSE_GAS=OFF"; outputs = [ "out" diff --git a/pkgs/by-name/vu/vulkan-tools/package.nix b/pkgs/by-name/vu/vulkan-tools/package.nix index b95c207125ac..215b4f05f61b 100644 --- a/pkgs/by-name/vu/vulkan-tools/package.nix +++ b/pkgs/by-name/vu/vulkan-tools/package.nix @@ -42,27 +42,26 @@ stdenv.mkDerivation rec { wayland-scanner ]; - buildInputs = - [ - glslang - vulkan-headers - vulkan-loader - vulkan-volk - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libffi - libX11 - libXau - libxcb - libXdmcp - libXrandr - wayland - wayland-protocols - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - moltenvk - moltenvk.dev - ]; + buildInputs = [ + glslang + vulkan-headers + vulkan-loader + vulkan-volk + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libffi + libX11 + libXau + libxcb + libXdmcp + libXrandr + wayland + wayland-protocols + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + moltenvk + moltenvk.dev + ]; libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ]; @@ -70,21 +69,20 @@ stdenv.mkDerivation rec { env.PKG_CONFIG_WAYLAND_SCANNER_WAYLAND_SCANNER = lib.getExe buildPackages.wayland-scanner; - cmakeFlags = - [ - # Don't build the mock ICD as it may get used instead of other drivers, if installed - "-DBUILD_ICD=OFF" - # vulkaninfo loads libvulkan using dlopen, so we have to add it manually to RPATH - "-DCMAKE_INSTALL_RPATH=${libraryPath}" - "-DGLSLANG_INSTALL_DIR=${glslang}" - # Hide dev warnings that are useless for packaging - "-Wno-dev" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DMOLTENVK_REPO_ROOT=${moltenvk}/share/vulkan/icd.d" - # Don’t build the cube demo because it requires `ibtool`, which is not available in nixpkgs. - "-DBUILD_CUBE=OFF" - ]; + cmakeFlags = [ + # Don't build the mock ICD as it may get used instead of other drivers, if installed + "-DBUILD_ICD=OFF" + # vulkaninfo loads libvulkan using dlopen, so we have to add it manually to RPATH + "-DCMAKE_INSTALL_RPATH=${libraryPath}" + "-DGLSLANG_INSTALL_DIR=${glslang}" + # Hide dev warnings that are useless for packaging + "-Wno-dev" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DMOLTENVK_REPO_ROOT=${moltenvk}/share/vulkan/icd.d" + # Don’t build the cube demo because it requires `ibtool`, which is not available in nixpkgs. + "-DBUILD_CUBE=OFF" + ]; meta = with lib; { description = "Khronos official Vulkan Tools and Utilities"; diff --git a/pkgs/by-name/vu/vulkan-validation-layers/package.nix b/pkgs/by-name/vu/vulkan-validation-layers/package.nix index 422250e5e9ca..901a1fdd960e 100644 --- a/pkgs/by-name/vu/vulkan-validation-layers/package.nix +++ b/pkgs/by-name/vu/vulkan-validation-layers/package.nix @@ -42,24 +42,23 @@ stdenv.mkDerivation rec { jq ]; - buildInputs = - [ - glslang - robin-hood-hashing - spirv-headers - spirv-tools - vulkan-headers - vulkan-utility-libraries - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXau - libXdmcp - libXrandr - libffi - libxcb - wayland - ]; + buildInputs = [ + glslang + robin-hood-hashing + spirv-headers + spirv-tools + vulkan-headers + vulkan-utility-libraries + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXau + libXdmcp + libXrandr + libffi + libxcb + wayland + ]; cmakeFlags = [ "-DBUILD_LAYER_SUPPORT_FILES=ON" diff --git a/pkgs/by-name/vu/vulnix/package.nix b/pkgs/by-name/vu/vulnix/package.nix index 0f79378429e0..f959da21ca94 100644 --- a/pkgs/by-name/vu/vulnix/package.nix +++ b/pkgs/by-name/vu/vulnix/package.nix @@ -33,19 +33,18 @@ python3Packages.buildPythonApplication rec { pytest-cov-stub ]; - propagatedBuildInputs = - [ - nix - ] - ++ (with python3Packages; [ - click - colorama - pyyaml - requests - setuptools - toml - zodb - ]); + propagatedBuildInputs = [ + nix + ] + ++ (with python3Packages; [ + click + colorama + pyyaml + requests + setuptools + toml + zodb + ]); postBuild = "make -C doc"; diff --git a/pkgs/by-name/vu/vunnel/package.nix b/pkgs/by-name/vu/vunnel/package.nix index fb7d3c1388ed..659356640eb8 100644 --- a/pkgs/by-name/vu/vunnel/package.nix +++ b/pkgs/by-name/vu/vunnel/package.nix @@ -60,14 +60,15 @@ python3.pkgs.buildPythonApplication rec { ++ xsdata.optional-dependencies.lxml ++ xsdata.optional-dependencies.soap; - nativeCheckInputs = - [ git ] - ++ (with python3.pkgs; [ - jsonschema - pytest-mock - pytest-unordered - pytestCheckHook - ]); + nativeCheckInputs = [ + git + ] + ++ (with python3.pkgs; [ + jsonschema + pytest-mock + pytest-unordered + pytestCheckHook + ]); pythonImportsCheck = [ "vunnel" ]; diff --git a/pkgs/by-name/vv/vvvvvv/package.nix b/pkgs/by-name/vv/vvvvvv/package.nix index e2519a1e5845..cfc62c6b25ff 100644 --- a/pkgs/by-name/vv/vvvvvv/package.nix +++ b/pkgs/by-name/vv/vvvvvv/package.nix @@ -50,7 +50,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUNDLE_DEPENDENCIES=OFF" - ] ++ lib.optional makeAndPlay "-DMAKEANDPLAY=ON"; + ] + ++ lib.optional makeAndPlay "-DMAKEANDPLAY=ON"; desktopItems = [ (makeDesktopItem { @@ -85,14 +86,13 @@ stdenv.mkDerivation rec { description = "A retro-styled platform game" + lib.optionalString makeAndPlay " (redistributable, without original levels)"; - longDescription = - '' - VVVVVV is a platform game all about exploring one simple mechanical - idea - what if you reversed gravity instead of jumping? - '' - + lib.optionalString makeAndPlay '' - (Redistributable version, doesn't include the original levels.) - ''; + longDescription = '' + VVVVVV is a platform game all about exploring one simple mechanical + idea - what if you reversed gravity instead of jumping? + '' + + lib.optionalString makeAndPlay '' + (Redistributable version, doesn't include the original levels.) + ''; homepage = "https://thelettervsixtim.es"; changelog = "https://github.com/TerryCavanagh/VVVVVV/releases/tag/${src.rev}"; license = licenses.unfree; diff --git a/pkgs/by-name/w3/w3m/package.nix b/pkgs/by-name/w3/w3m/package.nix index c589db734015..404e4c06de09 100644 --- a/pkgs/by-name/w3/w3m/package.nix +++ b/pkgs/by-name/w3/w3m/package.nix @@ -80,16 +80,15 @@ stdenv.mkDerivation rec { gettext updateAutotoolsGnuConfigScriptsHook ]; - buildInputs = - [ - ncurses - boehmgc - zlib - ] - ++ lib.optional sslSupport openssl - ++ lib.optional mouseSupport gpm-ncurses - ++ lib.optional graphicsSupport imlib2 - ++ lib.optional x11Support libX11; + buildInputs = [ + ncurses + boehmgc + zlib + ] + ++ lib.optional sslSupport openssl + ++ lib.optional mouseSupport gpm-ncurses + ++ lib.optional graphicsSupport imlib2 + ++ lib.optional x11Support libX11; postInstall = lib.optionalString graphicsSupport '' ln -s $out/libexec/w3m/w3mimgdisplay $out/bin @@ -97,16 +96,15 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - configureFlags = - [ - "--with-ssl=${openssl.dev}" - "--with-gc=${boehmgc.dev}" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "ac_cv_func_setpgrp_void=${if stdenv.hostPlatform.isBSD then "no" else "yes"}" - ] - ++ lib.optional graphicsSupport "--enable-image=${lib.optionalString x11Support "x11,"}fb" - ++ lib.optional (graphicsSupport && !x11Support) "--without-x"; + configureFlags = [ + "--with-ssl=${openssl.dev}" + "--with-gc=${boehmgc.dev}" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "ac_cv_func_setpgrp_void=${if stdenv.hostPlatform.isBSD then "no" else "yes"}" + ] + ++ lib.optional graphicsSupport "--enable-image=${lib.optionalString x11Support "x11,"}fb" + ++ lib.optional (graphicsSupport && !x11Support) "--without-x"; preConfigure = '' substituteInPlace ./configure --replace "/lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /lib64 /usr/lib64" /no-such-path diff --git a/pkgs/by-name/wa/waffle/package.nix b/pkgs/by-name/wa/waffle/package.nix index 544e9f90e976..d16f2412583f 100644 --- a/pkgs/by-name/wa/waffle/package.nix +++ b/pkgs/by-name/wa/waffle/package.nix @@ -35,43 +35,41 @@ stdenv.mkDerivation rec { sha256 = "sha256-Y7GRYLqSO572qA1eZ3jS8QlZ1X9xKpDtScaySTuPK/U="; }; - buildInputs = - [ - bash-completion - libGL - ] - ++ lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [ - libglvnd - ] - ++ lib.optionals x11Support [ - libX11 - libxcb - ] - ++ lib.optionals waylandSupport [ - wayland - wayland-protocols - ] - ++ lib.optionals useGbm [ - udev - libgbm - ]; + buildInputs = [ + bash-completion + libGL + ] + ++ lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [ + libglvnd + ] + ++ lib.optionals x11Support [ + libX11 + libxcb + ] + ++ lib.optionals waylandSupport [ + wayland + wayland-protocols + ] + ++ lib.optionals useGbm [ + udev + libgbm + ]; depsBuildBuild = [ pkg-config ]; dontUseCmakeConfigure = true; - nativeBuildInputs = - [ - cmake - makeWrapper - meson - ninja - pkg-config - python3 - ] - ++ lib.optionals waylandSupport [ - wayland-scanner - ]; + nativeBuildInputs = [ + cmake + makeWrapper + meson + ninja + pkg-config + python3 + ] + ++ lib.optionals waylandSupport [ + wayland-scanner + ]; PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR = "${placeholder "out"}/share/bash-completion/completions"; diff --git a/pkgs/by-name/wa/waifu2x-converter-cpp/package.nix b/pkgs/by-name/wa/waifu2x-converter-cpp/package.nix index ecfa7899d65a..be40726bc26a 100644 --- a/pkgs/by-name/wa/waifu2x-converter-cpp/package.nix +++ b/pkgs/by-name/wa/waifu2x-converter-cpp/package.nix @@ -28,15 +28,14 @@ stdenv.mkDerivation rec { ./waifu2x_darwin_build.diff ]; - buildInputs = - [ - opencv4 - ] - ++ lib.optional cudaSupport cudatoolkit - ++ lib.optionals stdenv.hostPlatform.isLinux [ - ocl-icd - opencl-headers - ]; + buildInputs = [ + opencv4 + ] + ++ lib.optional cudaSupport cudatoolkit + ++ lib.optionals stdenv.hostPlatform.isLinux [ + ocl-icd + opencl-headers + ]; nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/wa/wakeonlan/package.nix b/pkgs/by-name/wa/wakeonlan/package.nix index 28efca282e44..4bc1b65674fd 100644 --- a/pkgs/by-name/wa/wakeonlan/package.nix +++ b/pkgs/by-name/wa/wakeonlan/package.nix @@ -22,7 +22,8 @@ perlPackages.buildPerlPackage rec { nativeBuildInputs = [ installShellFiles - ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; nativeCheckInputs = [ perlPackages.TestPerlCritic @@ -34,14 +35,13 @@ perlPackages.buildPerlPackage rec { rm -f t/93_pod_spell.t ''; - installPhase = - '' - install -Dt $out/bin wakeonlan - installManPage blib/man1/wakeonlan.1 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/wakeonlan - ''; + installPhase = '' + install -Dt $out/bin wakeonlan + installManPage blib/man1/wakeonlan.1 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + shortenPerlShebang $out/bin/wakeonlan + ''; meta = with lib; { description = "Perl script for waking up computers via Wake-On-LAN magic packets"; diff --git a/pkgs/by-name/wa/wapiti/package.nix b/pkgs/by-name/wa/wapiti/package.nix index c17e22420581..086df21bd12a 100644 --- a/pkgs/by-name/wa/wapiti/package.nix +++ b/pkgs/by-name/wa/wapiti/package.nix @@ -149,15 +149,14 @@ python3Packages.buildPythonApplication rec { "test_attack_unifi" ]; - disabledTestPaths = - [ - # Requires sslyze which is obsolete and was removed - "tests/attack/test_mod_ssl.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # PermissionError: [Errno 13] Permission denied: '/tmp/crawl.db' - "tests/web/test_persister.py" - ]; + disabledTestPaths = [ + # Requires sslyze which is obsolete and was removed + "tests/attack/test_mod_ssl.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # PermissionError: [Errno 13] Permission denied: '/tmp/crawl.db' + "tests/web/test_persister.py" + ]; pythonImportsCheck = [ "wapitiCore" ]; diff --git a/pkgs/by-name/wa/warp-terminal/package.nix b/pkgs/by-name/wa/warp-terminal/package.nix index 7aebef84c432..4af5fe0bfdd9 100644 --- a/pkgs/by-name/wa/warp-terminal/package.nix +++ b/pkgs/by-name/wa/warp-terminal/package.nix @@ -66,22 +66,22 @@ let xorg.libxcb xorg.libXcursor xorg.libXi - ] ++ lib.optionals waylandSupport [ wayland ]; + ] + ++ lib.optionals waylandSupport [ wayland ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir $out - cp -r opt usr/* $out + mkdir $out + cp -r opt usr/* $out - '' - + lib.optionalString waylandSupport '' - wrapProgram $out/bin/warp-terminal --set WARP_ENABLE_WAYLAND 1 - '' - + '' - runHook postInstall - ''; + '' + + lib.optionalString waylandSupport '' + wrapProgram $out/bin/warp-terminal --set WARP_ENABLE_WAYLAND 1 + '' + + '' + runHook postInstall + ''; }); darwin = stdenvNoCC.mkDerivation (finalAttrs: { diff --git a/pkgs/by-name/wa/warp/package.nix b/pkgs/by-name/wa/warp/package.nix index 9f2bb741c436..8767d510ddce 100644 --- a/pkgs/by-name/wa/warp/package.nix +++ b/pkgs/by-name/wa/warp/package.nix @@ -56,18 +56,17 @@ stdenv.mkDerivation rec { rustc ]; - buildInputs = - [ - glib - gtk4 - libadwaita - zbar - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-bad - ]); + buildInputs = [ + glib + gtk4 + libadwaita + zbar + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-bad + ]); passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/by-name/wa/warpd/package.nix b/pkgs/by-name/wa/warpd/package.nix index 3c1fb984c2d4..ca201891b71b 100644 --- a/pkgs/by-name/wa/warpd/package.nix +++ b/pkgs/by-name/wa/warpd/package.nix @@ -47,10 +47,11 @@ stdenv.mkDerivation rec { libXext ]; - makeFlags = - [ "PREFIX=$(out)" ] - ++ lib.optional (!withWayland) "DISABLE_WAYLAND=y" - ++ lib.optional (!withX) "DISABLE_X=y"; + makeFlags = [ + "PREFIX=$(out)" + ] + ++ lib.optional (!withWayland) "DISABLE_WAYLAND=y" + ++ lib.optional (!withX) "DISABLE_X=y"; postPatch = '' substituteInPlace mk/linux.mk \ diff --git a/pkgs/by-name/wa/warzone2100/package.nix b/pkgs/by-name/wa/warzone2100/package.nix index fc97e6d884da..3dd785a1f9aa 100644 --- a/pkgs/by-name/wa/warzone2100/package.nix +++ b/pkgs/by-name/wa/warzone2100/package.nix @@ -54,27 +54,26 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-B/YbrnIWh+3rYtpId+hQMKA6BTpZPWRRlPxld44EgP8="; }; - buildInputs = - [ - SDL2 - libtheora - libvorbis - libopus - openal - openalSoft - physfs - miniupnpc - libsodium - curl - libpng - freetype - harfbuzz - sqlite - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - vulkan-headers - vulkan-loader - ]; + buildInputs = [ + SDL2 + libtheora + libvorbis + libopus + openal + openalSoft + physfs + miniupnpc + libsodium + curl + libpng + freetype + harfbuzz + sqlite + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + vulkan-headers + vulkan-loader + ]; nativeBuildInputs = [ pkg-config @@ -105,7 +104,8 @@ stdenv.mkDerivation (finalAttrs: { # # Alternatively, we could have set CMAKE_INSTALL_BINDIR to "bin". "-DCMAKE_INSTALL_DATAROOTDIR=${placeholder "out"}/share" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "-P../configure_mac.cmake"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "-P../configure_mac.cmake"; postInstall = lib.optionalString withVideos '' cp ${sequences_src} $out/share/warzone2100/sequences.wz diff --git a/pkgs/by-name/wa/wasm-tools/package.nix b/pkgs/by-name/wa/wasm-tools/package.nix index 06bf8236ca17..953ae9e08602 100644 --- a/pkgs/by-name/wa/wasm-tools/package.nix +++ b/pkgs/by-name/wa/wasm-tools/package.nix @@ -24,9 +24,10 @@ rustPlatform.buildRustPackage rec { "--package" "wasm-tools" ]; - cargoTestFlags = - [ "--all" ] - ++ + cargoTestFlags = [ + "--all" + ] + ++ # Due to https://github.com/bytecodealliance/wasm-tools/issues/1820 [ "--" diff --git a/pkgs/by-name/wa/waybar/package.nix b/pkgs/by-name/wa/waybar/package.nix index 1528eb3f2653..75ffbcb03bc0 100644 --- a/pkgs/by-name/wa/waybar/package.nix +++ b/pkgs/by-name/wa/waybar/package.nix @@ -97,16 +97,15 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - wayland-scanner - wrapGAppsHook3 - ] - ++ lib.optional withMediaPlayer gobject-introspection - ++ lib.optional enableManpages scdoc; + nativeBuildInputs = [ + meson + ninja + pkg-config + wayland-scanner + wrapGAppsHook3 + ] + ++ lib.optional withMediaPlayer gobject-introspection + ++ lib.optional enableManpages scdoc; propagatedBuildInputs = lib.optionals withMediaPlayer [ glib @@ -114,40 +113,39 @@ stdenv.mkDerivation (finalAttrs: { python3.pkgs.pygobject3 ]; - buildInputs = - [ - gtk-layer-shell - gtkmm3 - jsoncpp - libsigcxx - libxkbcommon - spdlog - wayland - ] - ++ lib.optionals cavaSupport [ - SDL2 - alsa-lib - fftw - iniparser - ncurses - portaudio - ] - ++ lib.optional evdevSupport libevdev - ++ lib.optional gpsSupport gpsd - ++ lib.optional inputSupport libinput - ++ lib.optional jackSupport libjack2 - ++ lib.optional mpdSupport libmpdclient - ++ lib.optional mprisSupport playerctl - ++ lib.optional nlSupport libnl - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional sndioSupport sndio - ++ lib.optional systemdSupport systemdMinimal - ++ lib.optional traySupport libdbusmenu-gtk3 - ++ lib.optional udevSupport udev - ++ lib.optional upowerSupport upower - ++ lib.optional wireplumberSupport wireplumber - ++ lib.optional (cavaSupport || pipewireSupport) pipewire - ++ lib.optional (!stdenv.hostPlatform.isLinux) libinotify-kqueue; + buildInputs = [ + gtk-layer-shell + gtkmm3 + jsoncpp + libsigcxx + libxkbcommon + spdlog + wayland + ] + ++ lib.optionals cavaSupport [ + SDL2 + alsa-lib + fftw + iniparser + ncurses + portaudio + ] + ++ lib.optional evdevSupport libevdev + ++ lib.optional gpsSupport gpsd + ++ lib.optional inputSupport libinput + ++ lib.optional jackSupport libjack2 + ++ lib.optional mpdSupport libmpdclient + ++ lib.optional mprisSupport playerctl + ++ lib.optional nlSupport libnl + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional sndioSupport sndio + ++ lib.optional systemdSupport systemdMinimal + ++ lib.optional traySupport libdbusmenu-gtk3 + ++ lib.optional udevSupport udev + ++ lib.optional upowerSupport upower + ++ lib.optional wireplumberSupport wireplumber + ++ lib.optional (cavaSupport || pipewireSupport) pipewire + ++ lib.optional (!stdenv.hostPlatform.isLinux) libinotify-kqueue; nativeCheckInputs = [ catch2_3 ]; doCheck = runTests; diff --git a/pkgs/by-name/wa/wayland-proxy-virtwl/package.nix b/pkgs/by-name/wa/wayland-proxy-virtwl/package.nix index 278641994b8d..38a76c83f627 100644 --- a/pkgs/by-name/wa/wayland-proxy-virtwl/package.nix +++ b/pkgs/by-name/wa/wayland-proxy-virtwl/package.nix @@ -24,17 +24,18 @@ ocamlPackages.buildDunePackage { pkg-config ]; - buildInputs = - [ libdrm ] - ++ (with ocamlPackages; [ - dune-configurator - eio_main - ppx_cstruct - wayland - cmdliner - logs - ppx_cstruct - ]); + buildInputs = [ + libdrm + ] + ++ (with ocamlPackages; [ + dune-configurator + eio_main + ppx_cstruct + wayland + cmdliner + logs + ppx_cstruct + ]); doCheck = true; diff --git a/pkgs/by-name/wb/wbg/package.nix b/pkgs/by-name/wb/wbg/package.nix index c20f6ecbc9ac..1d304d498033 100644 --- a/pkgs/by-name/wb/wbg/package.nix +++ b/pkgs/by-name/wb/wbg/package.nix @@ -38,16 +38,15 @@ stdenv.mkDerivation rec { wayland-scanner ]; - buildInputs = - [ - pixman - tllist - wayland - wayland-protocols - ] - ++ lib.optional enablePNG libpng - ++ lib.optional enableJPEG libjpeg - ++ lib.optional enableWebp libwebp; + buildInputs = [ + pixman + tllist + wayland + wayland-protocols + ] + ++ lib.optional enablePNG libpng + ++ lib.optional enableJPEG libjpeg + ++ lib.optional enableWebp libwebp; mesonBuildType = "release"; diff --git a/pkgs/by-name/we/webp-pixbuf-loader/package.nix b/pkgs/by-name/we/webp-pixbuf-loader/package.nix index 514e4341fa14..188fa813d5a2 100644 --- a/pkgs/by-name/we/webp-pixbuf-loader/package.nix +++ b/pkgs/by-name/we/webp-pixbuf-loader/package.nix @@ -48,22 +48,21 @@ stdenv.mkDerivation rec { --replace "@bindir@/gdk-pixbuf-thumbnailer" "$out/libexec/gdk-pixbuf-thumbnailer-webp" ''; - postInstall = - '' - GDK_PIXBUF_MODULE_FILE="$out/${loadersPath}" \ - GDK_PIXBUF_MODULEDIR="$out/${moduleDir}" \ - gdk-pixbuf-query-loaders --update-cache + postInstall = '' + GDK_PIXBUF_MODULE_FILE="$out/${loadersPath}" \ + GDK_PIXBUF_MODULEDIR="$out/${moduleDir}" \ + gdk-pixbuf-query-loaders --update-cache - # gdk-pixbuf disables the thumbnailer in cross-builds (https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/fc37708313a5fc52083cf10c9326f3509d67701f) - # and therefore makeWrapper will fail because 'gdk-pixbuf-thumbnailer' the executable does not exist. - '' - + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' - # It assumes gdk-pixbuf-thumbnailer can find the webp loader in the loaders.cache referenced by environment variable, breaking containment. - # So we replace it with a wrapped executable. - mkdir -p "$out/bin" - makeWrapper "${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer" "$out/libexec/gdk-pixbuf-thumbnailer-webp" \ - --set GDK_PIXBUF_MODULE_FILE "$out/${loadersPath}" - ''; + # gdk-pixbuf disables the thumbnailer in cross-builds (https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/fc37708313a5fc52083cf10c9326f3509d67701f) + # and therefore makeWrapper will fail because 'gdk-pixbuf-thumbnailer' the executable does not exist. + '' + + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + # It assumes gdk-pixbuf-thumbnailer can find the webp loader in the loaders.cache referenced by environment variable, breaking containment. + # So we replace it with a wrapped executable. + mkdir -p "$out/bin" + makeWrapper "${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer" "$out/libexec/gdk-pixbuf-thumbnailer-webp" \ + --set GDK_PIXBUF_MODULE_FILE "$out/${loadersPath}" + ''; meta = with lib; { description = "WebP GDK Pixbuf Loader library"; diff --git a/pkgs/by-name/we/websocat/package.nix b/pkgs/by-name/we/websocat/package.nix index 8a513a9e0ec8..d980a053eb4a 100644 --- a/pkgs/by-name/we/websocat/package.nix +++ b/pkgs/by-name/we/websocat/package.nix @@ -39,11 +39,12 @@ rustPlatform.buildRustPackage rec { makeWrapper ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; nativeInstallCheckInputs = [ versionCheckHook ]; diff --git a/pkgs/by-name/we/werf/package.nix b/pkgs/by-name/we/werf/package.nix index f5cd23e71ff5..9ae11959a662 100644 --- a/pkgs/by-name/we/werf/package.nix +++ b/pkgs/by-name/we/werf/package.nix @@ -35,52 +35,49 @@ buildGoModule (finalAttrs: { env.CGO_ENABLED = if stdenv.hostPlatform.isLinux then 1 else 0; - ldflags = - [ - "-s" - "-w" - "-X github.com/werf/werf/v2/pkg/werf.Version=v${finalAttrs.version}" - ] - ++ lib.optionals (finalAttrs.env.CGO_ENABLED == 1) [ - "-extldflags=-static" - "-linkmode external" - ]; + ldflags = [ + "-s" + "-w" + "-X github.com/werf/werf/v2/pkg/werf.Version=v${finalAttrs.version}" + ] + ++ lib.optionals (finalAttrs.env.CGO_ENABLED == 1) [ + "-extldflags=-static" + "-linkmode external" + ]; - tags = - [ - "containers_image_openpgp" - "dfrunmount" - "dfrunnetwork" - "dfrunsecurity" - "dfssh" - ] - ++ lib.optionals (finalAttrs.env.CGO_ENABLED == 1) [ - "cni" - "exclude_graphdriver_devicemapper" - "netgo" - "no_devmapper" - "osusergo" - "static_build" - ]; + tags = [ + "containers_image_openpgp" + "dfrunmount" + "dfrunnetwork" + "dfrunsecurity" + "dfssh" + ] + ++ lib.optionals (finalAttrs.env.CGO_ENABLED == 1) [ + "cni" + "exclude_graphdriver_devicemapper" + "netgo" + "no_devmapper" + "osusergo" + "static_build" + ]; nativeCheckInputs = [ writableTmpDirAsHomeHook ]; - preCheck = - '' - # Test all packages. - unset subPackages + preCheck = '' + # Test all packages. + unset subPackages - # Remove tests that fail or require external services. - rm -rf \ - integration/suites \ - pkg/true_git/*_test.go \ - pkg/werf/exec/*_test.go \ - test/e2e - '' - + lib.optionalString (finalAttrs.env.CGO_ENABLED == 0) '' - # A workaround for osusergo. - export USER=nixbld - ''; + # Remove tests that fail or require external services. + rm -rf \ + integration/suites \ + pkg/true_git/*_test.go \ + pkg/werf/exec/*_test.go \ + test/e2e + '' + + lib.optionalString (finalAttrs.env.CGO_ENABLED == 0) '' + # A workaround for osusergo. + export USER=nixbld + ''; doInstallCheck = true; diff --git a/pkgs/by-name/we/weston/package.nix b/pkgs/by-name/we/weston/package.nix index 77e86efce8be..4a07300af6b4 100644 --- a/pkgs/by-name/we/weston/package.nix +++ b/pkgs/by-name/we/weston/package.nix @@ -73,61 +73,59 @@ stdenv.mkDerivation rec { python3 wayland-scanner ]; - buildInputs = - [ - cairo - libGL - libdisplay-info - libdrm - libevdev - libinput - libxkbcommon - libgbm - seatd - wayland - wayland-protocols - ] - ++ lib.optional jpegSupport libjpeg - ++ lib.optional lcmsSupport lcms2 - ++ lib.optional pangoSupport pango - ++ lib.optional pipewireSupport pipewire - ++ lib.optional rdpSupport freerdp - ++ lib.optionals remotingSupport [ - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - ] - ++ lib.optional vaapiSupport libva - ++ lib.optionals vncSupport [ - aml - neatvnc - pam - ] - ++ lib.optional webpSupport libwebp - ++ lib.optionals xwaylandSupport [ - libXcursor - xcbutilcursor - xwayland - ]; + buildInputs = [ + cairo + libGL + libdisplay-info + libdrm + libevdev + libinput + libxkbcommon + libgbm + seatd + wayland + wayland-protocols + ] + ++ lib.optional jpegSupport libjpeg + ++ lib.optional lcmsSupport lcms2 + ++ lib.optional pangoSupport pango + ++ lib.optional pipewireSupport pipewire + ++ lib.optional rdpSupport freerdp + ++ lib.optionals remotingSupport [ + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + ] + ++ lib.optional vaapiSupport libva + ++ lib.optionals vncSupport [ + aml + neatvnc + pam + ] + ++ lib.optional webpSupport libwebp + ++ lib.optionals xwaylandSupport [ + libXcursor + xcbutilcursor + xwayland + ]; - mesonFlags = - [ - (lib.mesonBool "backend-drm-screencast-vaapi" vaapiSupport) - (lib.mesonBool "backend-pipewire" pipewireSupport) - (lib.mesonBool "backend-rdp" rdpSupport) - (lib.mesonBool "backend-vnc" vncSupport) - (lib.mesonBool "color-management-lcms" lcmsSupport) - (lib.mesonBool "demo-clients" demoSupport) - (lib.mesonBool "image-jpeg" jpegSupport) - (lib.mesonBool "image-webp" webpSupport) - (lib.mesonBool "pipewire" pipewireSupport) - (lib.mesonBool "remoting" remotingSupport) - (lib.mesonOption "simple-clients" "") - (lib.mesonBool "test-junit-xml" false) - (lib.mesonBool "xwayland" xwaylandSupport) - ] - ++ lib.optionals xwaylandSupport [ - (lib.mesonOption "xwayland-path" (lib.getExe xwayland)) - ]; + mesonFlags = [ + (lib.mesonBool "backend-drm-screencast-vaapi" vaapiSupport) + (lib.mesonBool "backend-pipewire" pipewireSupport) + (lib.mesonBool "backend-rdp" rdpSupport) + (lib.mesonBool "backend-vnc" vncSupport) + (lib.mesonBool "color-management-lcms" lcmsSupport) + (lib.mesonBool "demo-clients" demoSupport) + (lib.mesonBool "image-jpeg" jpegSupport) + (lib.mesonBool "image-webp" webpSupport) + (lib.mesonBool "pipewire" pipewireSupport) + (lib.mesonBool "remoting" remotingSupport) + (lib.mesonOption "simple-clients" "") + (lib.mesonBool "test-junit-xml" false) + (lib.mesonBool "xwayland" xwaylandSupport) + ] + ++ lib.optionals xwaylandSupport [ + (lib.mesonOption "xwayland-path" (lib.getExe xwayland)) + ]; passthru.providedSessions = [ "weston" ]; diff --git a/pkgs/by-name/we/weylus/package.nix b/pkgs/by-name/we/weylus/package.nix index e922598d716b..76c3f3b3888d 100644 --- a/pkgs/by-name/we/weylus/package.nix +++ b/pkgs/by-name/we/weylus/package.nix @@ -34,44 +34,42 @@ rustPlatform.buildRustPackage { sha256 = "sha256-lx1ZVp5DkQiL9/vw6PAZ34Lge+K8dfEVh6vLnCUNf7M="; }; - buildInputs = - [ - ffmpeg - x264 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - dbus - libva - gst_all_1.gst-plugins-base - xorg.libXext - xorg.libXft - xorg.libXinerama - xorg.libXcursor - xorg.libXrender - xorg.libXfixes - xorg.libXtst - xorg.libXrandr - xorg.libXcomposite - xorg.libXi - xorg.libXv - pango - libdrm - wayland - libxkbcommon - ]; + buildInputs = [ + ffmpeg + x264 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + dbus + libva + gst_all_1.gst-plugins-base + xorg.libXext + xorg.libXft + xorg.libXinerama + xorg.libXcursor + xorg.libXrender + xorg.libXfixes + xorg.libXtst + xorg.libXrandr + xorg.libXcomposite + xorg.libXi + xorg.libXv + pango + libdrm + wayland + libxkbcommon + ]; - nativeBuildInputs = - [ - cmake - git - typescript - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - autoconf - libtool - ]; + nativeBuildInputs = [ + cmake + git + typescript + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pkg-config + autoconf + libtool + ]; useFetchCargoVendor = true; cargoHash = "sha256-dLhlYOrLjoBSRGDJB0qTEIb+oGnp9X+ADHddpYITdl8="; diff --git a/pkgs/by-name/we/wezterm/package.nix b/pkgs/by-name/we/wezterm/package.nix index 7c878ce24e3f..8208d2546140 100644 --- a/pkgs/by-name/we/wezterm/package.nix +++ b/pkgs/by-name/we/wezterm/package.nix @@ -39,21 +39,20 @@ rustPlatform.buildRustPackage rec { hash = "sha256-danJcaG4ZyMbqR+4xaVOVM7a+4Sehq5cum40iRt/HQ8="; }; - postPatch = - '' - echo ${version} > .tag + postPatch = '' + echo ${version} > .tag - # hash does not work well with NixOS - substituteInPlace assets/shell-integration/wezterm.sh \ - --replace-fail 'hash wezterm 2>/dev/null' 'command type -P wezterm &>/dev/null' \ - --replace-fail 'hash base64 2>/dev/null' 'command type -P base64 &>/dev/null' \ - --replace-fail 'hash hostname 2>/dev/null' 'command type -P hostname &>/dev/null' \ - --replace-fail 'hash hostnamectl 2>/dev/null' 'command type -P hostnamectl &>/dev/null' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # many tests fail with: No such file or directory - rm -r wezterm-ssh/tests - ''; + # hash does not work well with NixOS + substituteInPlace assets/shell-integration/wezterm.sh \ + --replace-fail 'hash wezterm 2>/dev/null' 'command type -P wezterm &>/dev/null' \ + --replace-fail 'hash base64 2>/dev/null' 'command type -P base64 &>/dev/null' \ + --replace-fail 'hash hostname 2>/dev/null' 'command type -P hostname &>/dev/null' \ + --replace-fail 'hash hostnamectl 2>/dev/null' 'command type -P hostnamectl &>/dev/null' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # many tests fail with: No such file or directory + rm -r wezterm-ssh/tests + ''; # dep: syntax causes build failures in rare cases # https://github.com/rust-secure-code/cargo-auditable/issues/124 @@ -68,24 +67,24 @@ rustPlatform.buildRustPackage rec { ncurses # tic for terminfo pkg-config python3 - ] ++ lib.optional stdenv.hostPlatform.isDarwin perl; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin perl; - buildInputs = - [ - fontconfig - openssl - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libxcb - libxkbcommon - wayland - xcbutil - xcbutilimage - xcbutilkeysyms - xcbutilwm # contains xcb-ewmh among others - ]; + buildInputs = [ + fontconfig + openssl + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libxcb + libxkbcommon + wayland + xcbutil + xcbutilimage + xcbutilkeysyms + xcbutilwm # contains xcb-ewmh among others + ]; buildFeatures = [ "distro-defaults" ]; diff --git a/pkgs/by-name/wf/wfview/package.nix b/pkgs/by-name/wf/wfview/package.nix index d5e18535a27a..80913e12940d 100644 --- a/pkgs/by-name/wf/wfview/package.nix +++ b/pkgs/by-name/wf/wfview/package.nix @@ -29,22 +29,21 @@ stdenv.mkDerivation (finalAttrs: { ./remove-hard-encodings.patch ]; - buildInputs = - [ - eigen - hidapi - libopus - portaudio - rtaudio - qt6.qtbase - qt6.qtserialport - qt6.qtmultimedia - qt6.qtwebsockets - qt6Packages.qcustomplot - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libpulseaudio - ]; + buildInputs = [ + eigen + hidapi + libopus + portaudio + rtaudio + qt6.qtbase + qt6.qtserialport + qt6.qtmultimedia + qt6.qtwebsockets + qt6Packages.qcustomplot + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libpulseaudio + ]; nativeBuildInputs = with qt6; [ wrapQtAppsHook diff --git a/pkgs/by-name/wg/wget/package.nix b/pkgs/by-name/wg/wget/package.nix index 69eebc4f1d41..44166739a2c8 100644 --- a/pkgs/by-name/wg/wget/package.nix +++ b/pkgs/by-name/wg/wget/package.nix @@ -43,31 +43,29 @@ stdenv.mkDerivation rec { lzip nukeReferences ]; - buildInputs = - [ - libidn2 - zlib - pcre2 - libuuid - libiconv - libintl - ] - ++ lib.optional withOpenssl openssl - ++ lib.optional withLibpsl libpsl - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - perlPackages.perl - ]; + buildInputs = [ + libidn2 + zlib + pcre2 + libuuid + libiconv + libintl + ] + ++ lib.optional withOpenssl openssl + ++ lib.optional withLibpsl libpsl + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + perlPackages.perl + ]; strictDeps = true; - configureFlags = - [ - (lib.withFeatureAs withOpenssl "ssl" "openssl") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # https://lists.gnu.org/archive/html/bug-wget/2021-01/msg00076.html - "--without-included-regex" - ]; + configureFlags = [ + (lib.withFeatureAs withOpenssl "ssl" "openssl") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # https://lists.gnu.org/archive/html/bug-wget/2021-01/msg00076.html + "--without-included-regex" + ]; preBuild = '' # avoid runtime references to build-only depends @@ -79,39 +77,37 @@ stdenv.mkDerivation rec { __darwinAllowLocalNetworking = true; doCheck = true; - preCheck = - '' - patchShebangs tests fuzz + preCheck = '' + patchShebangs tests fuzz - # Work around lack of DNS resolution in chroots. - for i in "tests/"*.pm "tests/"*.px - do - sed -i "$i" -e's/localhost/127.0.0.1/g' - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # depending on the underlying filesystem, some tests - # creating exotic file names fail - for f in tests/Test-ftp-iri.px \ - tests/Test-ftp-iri-fallback.px \ - tests/Test-ftp-iri-recursive.px \ - tests/Test-ftp-iri-disabled.px \ - tests/Test-iri-disabled.px \ - tests/Test-iri-list.px ; - do - # just return magic "skip" exit code 77 - sed -i 's/^exit/exit 77 #/' $f - done - ''; + # Work around lack of DNS resolution in chroots. + for i in "tests/"*.pm "tests/"*.px + do + sed -i "$i" -e's/localhost/127.0.0.1/g' + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # depending on the underlying filesystem, some tests + # creating exotic file names fail + for f in tests/Test-ftp-iri.px \ + tests/Test-ftp-iri-fallback.px \ + tests/Test-ftp-iri-recursive.px \ + tests/Test-ftp-iri-disabled.px \ + tests/Test-iri-disabled.px \ + tests/Test-iri-list.px ; + do + # just return magic "skip" exit code 77 + sed -i 's/^exit/exit 77 #/' $f + done + ''; - nativeCheckInputs = - [ - perlPackages.HTTPDaemon - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - perlPackages.IOSocketSSL - ]; + nativeCheckInputs = [ + perlPackages.HTTPDaemon + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + perlPackages.IOSocketSSL + ]; meta = { description = "Tool for retrieving files using HTTP, HTTPS, and FTP"; diff --git a/pkgs/by-name/wg/wget2/package.nix b/pkgs/by-name/wg/wget2/package.nix index aacd147c1332..09d71cef462b 100644 --- a/pkgs/by-name/wg/wget2/package.nix +++ b/pkgs/by-name/wg/wget2/package.nix @@ -59,23 +59,22 @@ stdenv.mkDerivation rec { texinfo ]; - buildInputs = - [ - brotli - bzip2 - gpgme - libhsts - libidn2 - libpsl - nghttp2 - pcre2 - xz - zlib - zstd - ] - ++ lib.optionals sslSupport [ - openssl - ]; + buildInputs = [ + brotli + bzip2 + gpgme + libhsts + libidn2 + libpsl + nghttp2 + pcre2 + xz + zlib + zstd + ] + ++ lib.optionals sslSupport [ + openssl + ]; # TODO: include translation files autoreconfPhase = '' diff --git a/pkgs/by-name/wg/wgpu-native/examples.nix b/pkgs/by-name/wg/wgpu-native/examples.nix index 81d361dc4f35..d51db484124b 100644 --- a/pkgs/by-name/wg/wgpu-native/examples.nix +++ b/pkgs/by-name/wg/wgpu-native/examples.nix @@ -35,16 +35,15 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper ]; - buildInputs = - [ - wgpu-native - glfw - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland - xorg.libX11 - xorg.libXrandr - ]; + buildInputs = [ + wgpu-native + glfw + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland + xorg.libX11 + xorg.libXrandr + ]; runtimeInputs = lib.optionals stdenv.hostPlatform.isLinux [ # Without wayland in library path, this warning is raised: diff --git a/pkgs/by-name/wg/wgpu-native/package.nix b/pkgs/by-name/wg/wgpu-native/package.nix index 9af1f9616686..76d7fe676316 100644 --- a/pkgs/by-name/wg/wgpu-native/package.nix +++ b/pkgs/by-name/wg/wgpu-native/package.nix @@ -31,7 +31,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ rustPlatform.bindgenHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ vulkan-loader diff --git a/pkgs/by-name/wh/where-is-my-sddm-theme/package.nix b/pkgs/by-name/wh/where-is-my-sddm-theme/package.nix index 10887e1e6cb2..eb0fee939bc5 100644 --- a/pkgs/by-name/wh/where-is-my-sddm-theme/package.nix +++ b/pkgs/by-name/wh/where-is-my-sddm-theme/package.nix @@ -51,26 +51,25 @@ lib.checkListOfEnum "where-is-my-sddm-theme: variant" validVariants variants qt6.qtsvg ]; - installPhase = + installPhase = '' + mkdir -p $out/share/sddm/themes/ + '' + + lib.optionalString (lib.elem "qt6" variants) ( '' - mkdir -p $out/share/sddm/themes/ + cp -r where_is_my_sddm_theme/ $out/share/sddm/themes/ '' - + lib.optionalString (lib.elem "qt6" variants) ( - '' - cp -r where_is_my_sddm_theme/ $out/share/sddm/themes/ - '' - + lib.optionalString (lib.isAttrs themeConfig) '' - ln -sf ${user-cfg} $out/share/sddm/themes/where_is_my_sddm_theme/theme.conf.user - '' - ) - + lib.optionalString (lib.elem "qt5" variants) ( - '' - cp -r where_is_my_sddm_theme_qt5/ $out/share/sddm/themes/ - '' - + lib.optionalString (lib.isAttrs themeConfig) '' - ln -sf ${user-cfg} $out/share/sddm/themes/where_is_my_sddm_theme_qt5/theme.conf.user - '' - ); + + lib.optionalString (lib.isAttrs themeConfig) '' + ln -sf ${user-cfg} $out/share/sddm/themes/where_is_my_sddm_theme/theme.conf.user + '' + ) + + lib.optionalString (lib.elem "qt5" variants) ( + '' + cp -r where_is_my_sddm_theme_qt5/ $out/share/sddm/themes/ + '' + + lib.optionalString (lib.isAttrs themeConfig) '' + ln -sf ${user-cfg} $out/share/sddm/themes/where_is_my_sddm_theme_qt5/theme.conf.user + '' + ); meta = { description = "Most minimalistic SDDM theme among all themes"; diff --git a/pkgs/by-name/wh/whisper-cpp/package.nix b/pkgs/by-name/wh/whisper-cpp/package.nix index 55c0d357e5d8..9cd415a8bfaf 100644 --- a/pkgs/by-name/wh/whisper-cpp/package.nix +++ b/pkgs/by-name/wh/whisper-cpp/package.nix @@ -95,18 +95,17 @@ effectiveStdenv.mkDerivation (finalAttrs: { done ''; - nativeBuildInputs = - [ - cmake - git - ninja - which - makeWrapper - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + git + ninja + which + makeWrapper + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ]; buildInputs = optional withSDL SDL2 @@ -115,42 +114,41 @@ effectiveStdenv.mkDerivation (finalAttrs: { ++ optionals rocmSupport rocmBuildInputs ++ optionals vulkanSupport vulkanBuildInputs; - cmakeFlags = - [ - (cmakeBool "WHISPER_BUILD_EXAMPLES" true) - (cmakeBool "GGML_CUDA" cudaSupport) - (cmakeBool "GGML_HIPBLAS" rocmSupport) - (cmakeBool "GGML_VULKAN" vulkanSupport) - (cmakeBool "WHISPER_SDL2" withSDL) - (cmakeBool "GGML_LTO" true) - (cmakeBool "GGML_NATIVE" false) - (cmakeBool "BUILD_SHARED_LIBS" (!effectiveStdenv.hostPlatform.isStatic)) - ] - ++ optionals (effectiveStdenv.hostPlatform.isx86 && !effectiveStdenv.hostPlatform.isStatic) [ - (cmakeBool "GGML_BACKEND_DL" true) - (cmakeBool "GGML_CPU_ALL_VARIANTS" true) - ] - ++ optionals cudaSupport [ - (cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) - ] - ++ optionals rocmSupport [ - (cmakeFeature "CMAKE_C_COMPILER" "hipcc") - (cmakeFeature "CMAKE_CXX_COMPILER" "hipcc") + cmakeFlags = [ + (cmakeBool "WHISPER_BUILD_EXAMPLES" true) + (cmakeBool "GGML_CUDA" cudaSupport) + (cmakeBool "GGML_HIPBLAS" rocmSupport) + (cmakeBool "GGML_VULKAN" vulkanSupport) + (cmakeBool "WHISPER_SDL2" withSDL) + (cmakeBool "GGML_LTO" true) + (cmakeBool "GGML_NATIVE" false) + (cmakeBool "BUILD_SHARED_LIBS" (!effectiveStdenv.hostPlatform.isStatic)) + ] + ++ optionals (effectiveStdenv.hostPlatform.isx86 && !effectiveStdenv.hostPlatform.isStatic) [ + (cmakeBool "GGML_BACKEND_DL" true) + (cmakeBool "GGML_CPU_ALL_VARIANTS" true) + ] + ++ optionals cudaSupport [ + (cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaPackages.flags.cmakeCudaArchitecturesString) + ] + ++ optionals rocmSupport [ + (cmakeFeature "CMAKE_C_COMPILER" "hipcc") + (cmakeFeature "CMAKE_CXX_COMPILER" "hipcc") - # Build all targets supported by rocBLAS. When updating search for TARGET_LIST_ROCM - # in https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/develop/CMakeLists.txt - # and select the line that matches the current nixpkgs version of rocBLAS. - "-DAMDGPU_TARGETS=${rocmGpuTargets}" - ] - ++ optionals coreMLSupport [ - (cmakeBool "WHISPER_COREML" true) - (cmakeBool "WHISPER_COREML_ALLOW_FALLBACK" true) - ] - ++ optionals metalSupport [ - (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1") - (cmakeBool "GGML_METAL" true) - (cmakeBool "GGML_METAL_EMBED_LIBRARY" true) - ]; + # Build all targets supported by rocBLAS. When updating search for TARGET_LIST_ROCM + # in https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/develop/CMakeLists.txt + # and select the line that matches the current nixpkgs version of rocBLAS. + "-DAMDGPU_TARGETS=${rocmGpuTargets}" + ] + ++ optionals coreMLSupport [ + (cmakeBool "WHISPER_COREML" true) + (cmakeBool "WHISPER_COREML_ALLOW_FALLBACK" true) + ] + ++ optionals metalSupport [ + (cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1") + (cmakeBool "GGML_METAL" true) + (cmakeBool "GGML_METAL_EMBED_LIBRARY" true) + ]; postInstall = '' # Add "whisper-cpp" prefix before every command diff --git a/pkgs/by-name/wi/widelands/package.nix b/pkgs/by-name/wi/widelands/package.nix index 8a7bb56adeb9..d28dd5136660 100644 --- a/pkgs/by-name/wi/widelands/package.nix +++ b/pkgs/by-name/wi/widelands/package.nix @@ -78,7 +78,8 @@ stdenv.mkDerivation rec { asio libSM # XXX: these should be propagated by SDL2? libICE - ] ++ lib.optional stdenv.hostPlatform.isLinux libXext; + ] + ++ lib.optional stdenv.hostPlatform.isLinux libXext; postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' diff --git a/pkgs/by-name/wi/wifite2/package.nix b/pkgs/by-name/wi/wifite2/package.nix index 502201ff98ce..39daf04ce907 100644 --- a/pkgs/by-name/wi/wifite2/package.nix +++ b/pkgs/by-name/wi/wifite2/package.nix @@ -68,7 +68,8 @@ python3.pkgs.buildPythonApplication rec { john iw macchanger - ] ++ pythonDependencies; + ] + ++ pythonDependencies; nativeCheckInputs = propagatedBuildInputs ++ [ python3.pkgs.unittestCheckHook ]; diff --git a/pkgs/by-name/wi/wiiuse/package.nix b/pkgs/by-name/wi/wiiuse/package.nix index bdc91158d28e..e99de04a2964 100644 --- a/pkgs/by-name/wi/wiiuse/package.nix +++ b/pkgs/by-name/wi/wiiuse/package.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_EXAMPLE_SDL=OFF" - ] ++ [ (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) ]; + ] + ++ [ (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) ]; meta = with lib; { description = "Feature complete cross-platform Wii Remote access library"; diff --git a/pkgs/by-name/wi/wiliwili/package.nix b/pkgs/by-name/wi/wiliwili/package.nix index 755c36547282..cdb354bc1e2a 100644 --- a/pkgs/by-name/wi/wiliwili/package.nix +++ b/pkgs/by-name/wi/wiliwili/package.nix @@ -28,33 +28,31 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-37DQafP+PFjrfNXJt88oK0ghqQEVQjDdVbYsf1tHAN4="; }; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - wayland-scanner - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + wayland-scanner + ]; - buildInputs = - [ - mpv-unwrapped - openssl - curl - libxkbcommon - dbus - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libffi # needed for wayland - wayland - egl-wayland - xorg.libX11 - xorg.libXrandr - xorg.libXinerama - xorg.libXcursor - xorg.libXi - ]; + buildInputs = [ + mpv-unwrapped + openssl + curl + libxkbcommon + dbus + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libffi # needed for wayland + wayland + egl-wayland + xorg.libX11 + xorg.libXrandr + xorg.libXinerama + xorg.libXcursor + xorg.libXi + ]; cmakeFlags = [ (lib.cmakeBool "PLATFORM_DESKTOP" true) diff --git a/pkgs/by-name/wi/windmill/package.nix b/pkgs/by-name/wi/windmill/package.nix index 3f0a39efe5d1..e75a953523d2 100644 --- a/pkgs/by-name/wi/windmill/package.nix +++ b/pkgs/by-name/wi/windmill/package.nix @@ -66,39 +66,38 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-6htM6p09mPUQmS+QVBDO7Y/tuwweHgA+W/E3XTNunB8="; useFetchCargoVendor = true; - buildFeatures = - [ - "embedding" - "parquet" - "prometheus" - "openidconnect" - "cloud" - "jemalloc" - "deno_core" - "license" - "http_trigger" - "zip" - "oauth2" - "kafka" - "otel" - "dind" - "php" - "mysql" - "mssql" - "bigquery" - "websocket" - "python" - "smtp" - "csharp" - "static_frontend" - # "rust" # compiler environment is incomplete - ] - ++ (lib.optionals withEnterpriseFeatures [ - "enterprise" - "enterprise_saml" - "tantivy" - "stripe" - ]); + buildFeatures = [ + "embedding" + "parquet" + "prometheus" + "openidconnect" + "cloud" + "jemalloc" + "deno_core" + "license" + "http_trigger" + "zip" + "oauth2" + "kafka" + "otel" + "dind" + "php" + "mysql" + "mssql" + "bigquery" + "websocket" + "python" + "smtp" + "csharp" + "static_frontend" + # "rust" # compiler environment is incomplete + ] + ++ (lib.optionals withEnterpriseFeatures [ + "enterprise" + "enterprise_saml" + "tantivy" + "stripe" + ]); patches = [ ./download.py.config.proto.patch diff --git a/pkgs/by-name/wi/wireguard-tools/package.nix b/pkgs/by-name/wi/wireguard-tools/package.nix index 4d47b0efd43f..a2e7631d2019 100644 --- a/pkgs/by-name/wi/wireguard-tools/package.nix +++ b/pkgs/by-name/wi/wireguard-tools/package.nix @@ -40,36 +40,35 @@ stdenv.mkDerivation rec { "WITH_WGQUICK=yes" ]; - postFixup = - '' - substituteInPlace $out/lib/systemd/system/wg-quick@.service \ - --replace /usr/bin $out/bin - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - for f in $out/bin/*; do - # Which firewall and resolvconf implementations to use should be determined by the - # environment, we provide the "default" ones as fallback. - wrapProgram $f \ - --prefix PATH : ${ - lib.makeBinPath [ - procps - iproute2 - ] - } \ - --suffix PATH : ${ - lib.makeBinPath [ - iptables - openresolv - ] - } - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for f in $out/bin/*; do - wrapProgram $f \ - --prefix PATH : ${lib.makeBinPath [ wireguard-go ]} - done - ''; + postFixup = '' + substituteInPlace $out/lib/systemd/system/wg-quick@.service \ + --replace /usr/bin $out/bin + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + for f in $out/bin/*; do + # Which firewall and resolvconf implementations to use should be determined by the + # environment, we provide the "default" ones as fallback. + wrapProgram $f \ + --prefix PATH : ${ + lib.makeBinPath [ + procps + iproute2 + ] + } \ + --suffix PATH : ${ + lib.makeBinPath [ + iptables + openresolv + ] + } + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + for f in $out/bin/*; do + wrapProgram $f \ + --prefix PATH : ${lib.makeBinPath [ wireguard-go ]} + done + ''; passthru = { updateScript = ./update.sh; diff --git a/pkgs/by-name/wi/wivrn/package.nix b/pkgs/by-name/wi/wivrn/package.nix index d7b66282e8e2..ecb6c93686e0 100644 --- a/pkgs/by-name/wi/wivrn/package.nix +++ b/pkgs/by-name/wi/wivrn/package.nix @@ -88,84 +88,81 @@ stdenv.mkDerivation (finalAttrs: { fi ''; - nativeBuildInputs = - [ - cmake - git - glib - glslang - librsvg - pkg-config - python3 - qt6.wrapQtAppsHook - ] - ++ lib.optionals cudaSupport [ - autoAddDriverRunpath - ]; + nativeBuildInputs = [ + cmake + git + glib + glslang + librsvg + pkg-config + python3 + qt6.wrapQtAppsHook + ] + ++ lib.optionals cudaSupport [ + autoAddDriverRunpath + ]; - buildInputs = - [ - avahi - boost - cli11 - eigen - ffmpeg - freetype - glm - harfbuzz - kdePackages.kcoreaddons - kdePackages.ki18n - kdePackages.kiconthemes - kdePackages.kirigami - kdePackages.qcoro - kdePackages.qqc2-desktop-style - libdrm - libGL - libnotify - libpulseaudio - libva - libX11 - libXrandr - nlohmann_json - openxr-loader - onnxruntime - pipewire - qt6.qtbase - qt6.qtsvg - qt6.qttools - shaderc - spdlog - systemd - udev - vulkan-headers - vulkan-loader - x264 - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cudatoolkit - ]; + buildInputs = [ + avahi + boost + cli11 + eigen + ffmpeg + freetype + glm + harfbuzz + kdePackages.kcoreaddons + kdePackages.ki18n + kdePackages.kiconthemes + kdePackages.kirigami + kdePackages.qcoro + kdePackages.qqc2-desktop-style + libdrm + libGL + libnotify + libpulseaudio + libva + libX11 + libXrandr + nlohmann_json + openxr-loader + onnxruntime + pipewire + qt6.qtbase + qt6.qtsvg + qt6.qttools + shaderc + spdlog + systemd + udev + vulkan-headers + vulkan-loader + x264 + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cudatoolkit + ]; - cmakeFlags = - [ - (lib.cmakeBool "WIVRN_USE_NVENC" cudaSupport) - (lib.cmakeBool "WIVRN_USE_VAAPI" true) - (lib.cmakeBool "WIVRN_USE_VULKAN_ENCODE" true) - (lib.cmakeBool "WIVRN_USE_X264" true) - (lib.cmakeBool "WIVRN_USE_PIPEWIRE" true) - (lib.cmakeBool "WIVRN_USE_PULSEAUDIO" true) - (lib.cmakeBool "WIVRN_FEATURE_STEAMVR_LIGHTHOUSE" true) - (lib.cmakeBool "WIVRN_BUILD_CLIENT" false) - (lib.cmakeBool "WIVRN_BUILD_DASHBOARD" true) - (lib.cmakeBool "WIVRN_CHECK_CAPSYSNICE" false) - (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) - (lib.cmakeFeature "WIVRN_OPENXR_MANIFEST_TYPE" "absolute") - (lib.cmakeFeature "OVR_COMPAT_SEARCH_PATH" ovrCompatSearchPaths) - (lib.cmakeFeature "GIT_DESC" "v${finalAttrs.version}") - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_MONADO" "${finalAttrs.monado}") - ] - ++ lib.optionals cudaSupport [ - (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${cudaPackages.cudatoolkit}") - ]; + cmakeFlags = [ + (lib.cmakeBool "WIVRN_USE_NVENC" cudaSupport) + (lib.cmakeBool "WIVRN_USE_VAAPI" true) + (lib.cmakeBool "WIVRN_USE_VULKAN_ENCODE" true) + (lib.cmakeBool "WIVRN_USE_X264" true) + (lib.cmakeBool "WIVRN_USE_PIPEWIRE" true) + (lib.cmakeBool "WIVRN_USE_PULSEAUDIO" true) + (lib.cmakeBool "WIVRN_FEATURE_STEAMVR_LIGHTHOUSE" true) + (lib.cmakeBool "WIVRN_BUILD_CLIENT" false) + (lib.cmakeBool "WIVRN_BUILD_DASHBOARD" true) + (lib.cmakeBool "WIVRN_CHECK_CAPSYSNICE" false) + (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) + (lib.cmakeFeature "WIVRN_OPENXR_MANIFEST_TYPE" "absolute") + (lib.cmakeFeature "OVR_COMPAT_SEARCH_PATH" ovrCompatSearchPaths) + (lib.cmakeFeature "GIT_DESC" "v${finalAttrs.version}") + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_MONADO" "${finalAttrs.monado}") + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${cudaPackages.cudatoolkit}") + ]; dontWrapQtApps = true; diff --git a/pkgs/by-name/wk/wkhtmltopdf/package.nix b/pkgs/by-name/wk/wkhtmltopdf/package.nix index 24ecddd3dc9a..6f13592bc748 100644 --- a/pkgs/by-name/wk/wkhtmltopdf/package.nix +++ b/pkgs/by-name/wk/wkhtmltopdf/package.nix @@ -78,7 +78,8 @@ let url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox_${version}.bookworm_arm64.deb"; hash = "sha256-tmBhV7J8E+BE0Ku+ZwMB+I3k4Xgq/KT5wGpYF/PgOpw="; }; - } // _linuxAttrs; + } + // _linuxAttrs; linuxAttrs.x86_64-linux = rec { version = "0.12.6.1-3"; @@ -86,7 +87,8 @@ let url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox_${version}.bookworm_amd64.deb"; hash = "sha256-mLoNFXtQ028jvQ3t9MCqKMewxQ/NzcVKpba7uoGjlB0="; }; - } // _linuxAttrs; + } + // _linuxAttrs; in stdenv.mkDerivation ( { diff --git a/pkgs/by-name/wl/wl-clipboard-rs/package.nix b/pkgs/by-name/wl/wl-clipboard-rs/package.nix index d5befac5b319..626620422f23 100644 --- a/pkgs/by-name/wl/wl-clipboard-rs/package.nix +++ b/pkgs/by-name/wl/wl-clipboard-rs/package.nix @@ -22,30 +22,27 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = "sha256-bkCrAyYxYkgeS0BSUzKipN21ZZL+RJzNyg7Mx+7V8Pg="; - cargoBuildFlags = - [ - "--package=wl-clipboard-rs" - "--package=wl-clipboard-rs-tools" - ] - ++ lib.optionals withNativeLibs [ - "--features=native_lib" - ]; + cargoBuildFlags = [ + "--package=wl-clipboard-rs" + "--package=wl-clipboard-rs-tools" + ] + ++ lib.optionals withNativeLibs [ + "--features=native_lib" + ]; - nativeBuildInputs = - [ - installShellFiles - ] - ++ lib.optionals withNativeLibs [ - pkg-config - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals withNativeLibs [ + pkg-config + ]; - buildInputs = - [ - installShellFiles - ] - ++ lib.optionals withNativeLibs [ - wayland - ]; + buildInputs = [ + installShellFiles + ] + ++ lib.optionals withNativeLibs [ + wayland + ]; preCheck = '' export XDG_RUNTIME_DIR=$(mktemp -d) diff --git a/pkgs/by-name/wl/wl-mirror/package.nix b/pkgs/by-name/wl/wl-mirror/package.nix index 24dc422ec12f..fe12b34711e3 100644 --- a/pkgs/by-name/wl/wl-mirror/package.nix +++ b/pkgs/by-name/wl/wl-mirror/package.nix @@ -72,19 +72,18 @@ stdenv.mkDerivation rec { "-DWITH_GBM=ON" ]; - postInstall = - '' - installShellCompletion --cmd wl-mirror \ - --bash ../scripts/completions/bash-completions/_wl-mirror \ - --zsh ../scripts/completions/zsh-completions/_wl-mirror + postInstall = '' + installShellCompletion --cmd wl-mirror \ + --bash ../scripts/completions/bash-completions/_wl-mirror \ + --zsh ../scripts/completions/zsh-completions/_wl-mirror - installShellCompletion --cmd wl-present \ - --bash ../scripts/completions/bash-completions/_wl-present \ - --zsh ../scripts/completions/zsh-completions/_wl-present - '' - + lib.optionalString installExampleScripts '' - wrapProgram $out/bin/wl-present --prefix PATH ":" ${wl-present-binpath} - ''; + installShellCompletion --cmd wl-present \ + --bash ../scripts/completions/bash-completions/_wl-present \ + --zsh ../scripts/completions/zsh-completions/_wl-present + '' + + lib.optionalString installExampleScripts '' + wrapProgram $out/bin/wl-present --prefix PATH ":" ${wl-present-binpath} + ''; meta = with lib; { homepage = "https://github.com/Ferdi265/wl-mirror"; diff --git a/pkgs/by-name/wl/wldash/package.nix b/pkgs/by-name/wl/wldash/package.nix index 1f1df74fa30b..4da8b1b8c6c3 100644 --- a/pkgs/by-name/wl/wldash/package.nix +++ b/pkgs/by-name/wl/wldash/package.nix @@ -25,13 +25,12 @@ rustPlatform.buildRustPackage { inherit pname version; buildNoDefaultFeatures = true; - buildFeatures = - [ - "yaml-cfg" - "json-cfg" - ] - ++ lib.optionals enableAlsaWidget [ "alsa-widget" ] - ++ lib.optionals enablePulseaudioWidget [ "pulseaudio-widget" ]; + buildFeatures = [ + "yaml-cfg" + "json-cfg" + ] + ++ lib.optionals enableAlsaWidget [ "alsa-widget" ] + ++ lib.optionals enablePulseaudioWidget [ "pulseaudio-widget" ]; src = fetchFromGitHub { owner = "kennylevinsen"; @@ -43,13 +42,12 @@ rustPlatform.buildRustPackage { strictDeps = true; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - dbus - fontconfig - ] - ++ lib.optionals enableAlsaWidget [ alsa-lib ] - ++ lib.optionals enablePulseaudioWidget [ libpulseaudio ]; + buildInputs = [ + dbus + fontconfig + ] + ++ lib.optionals enableAlsaWidget [ alsa-lib ] + ++ lib.optionals enablePulseaudioWidget [ libpulseaudio ]; cargoPatches = [ ./0001-Update-Cargo.lock.patch diff --git a/pkgs/by-name/wl/wlogout/package.nix b/pkgs/by-name/wl/wlogout/package.nix index 6a50af56cd81..2aeff3f10714 100644 --- a/pkgs/by-name/wl/wlogout/package.nix +++ b/pkgs/by-name/wl/wlogout/package.nix @@ -46,16 +46,15 @@ stdenv.mkDerivation (finalAttrs: { scdoc ]; - buildInputs = - [ - gtk3 - libxkbcommon - wayland - wayland-protocols - ] - ++ lib.optionals withGtkLayerShell [ - gtk-layer-shell - ]; + buildInputs = [ + gtk3 + libxkbcommon + wayland + wayland-protocols + ] + ++ lib.optionals withGtkLayerShell [ + gtk-layer-shell + ]; strictDeps = true; diff --git a/pkgs/by-name/wo/wob/package.nix b/pkgs/by-name/wo/wob/package.nix index e34fb58ad77e..55565a80a6a2 100644 --- a/pkgs/by-name/wo/wob/package.nix +++ b/pkgs/by-name/wo/wob/package.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation rec { inih wayland wayland-protocols - ] ++ lib.optional stdenv.hostPlatform.isLinux libseccomp; + ] + ++ lib.optional stdenv.hostPlatform.isLinux libseccomp; mesonFlags = lib.optional stdenv.hostPlatform.isLinux "-Dseccomp=enabled"; diff --git a/pkgs/by-name/wo/woff2/package.nix b/pkgs/by-name/wo/woff2/package.nix index ef5a9a5e006c..22d3ce49e41a 100644 --- a/pkgs/by-name/wo/woff2/package.nix +++ b/pkgs/by-name/wo/woff2/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCANONICAL_PREFIXES=ON" "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" - ] ++ lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE"; + ] + ++ lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE"; propagatedBuildInputs = [ brotli ]; diff --git a/pkgs/by-name/wo/wolfssl/package.nix b/pkgs/by-name/wo/wolfssl/package.nix index b7c1bca77bf5..417e804d0776 100644 --- a/pkgs/by-name/wo/wolfssl/package.nix +++ b/pkgs/by-name/wo/wolfssl/package.nix @@ -33,40 +33,39 @@ stdenv.mkDerivation (finalAttrs: { --replace '"linux-gnu"' '"linux-"' ''; - configureFlags = - [ - "--enable-${variant}" - "--enable-reproducible-build" - ] - ++ lib.optionals (variant == "all") [ - # Extra feature flags to add while building the 'all' variant. - # Since they conflict while building other variants, only specify them for this one. - "--enable-pkcs11" - "--enable-writedup" - "--enable-base64encode" - ] - ++ [ - # We're not on tiny embedded machines. - # Increase TLS session cache from 33 sessions to 20k. - "--enable-bigcache" + configureFlags = [ + "--enable-${variant}" + "--enable-reproducible-build" + ] + ++ lib.optionals (variant == "all") [ + # Extra feature flags to add while building the 'all' variant. + # Since they conflict while building other variants, only specify them for this one. + "--enable-pkcs11" + "--enable-writedup" + "--enable-base64encode" + ] + ++ [ + # We're not on tiny embedded machines. + # Increase TLS session cache from 33 sessions to 20k. + "--enable-bigcache" - # Use WolfSSL's Single Precision Math with timing-resistant cryptography. - "--enable-sp=yes${ - lib.optionalString (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isAarch) ",asm" - }" - "--enable-sp-math-all" - "--enable-harden" - ] - ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ - # Enable AVX/AVX2/AES-NI instructions, gated by runtime detection via CPUID. - "--enable-intelasm" - "--enable-aesni" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64) [ - # No runtime detection under ARM and no platform function checks like for X86. - (if enableARMCryptoExtensions then "--enable-armasm=inline" else "--disable-armasm") - ] - ++ extraConfigureFlags; + # Use WolfSSL's Single Precision Math with timing-resistant cryptography. + "--enable-sp=yes${ + lib.optionalString (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isAarch) ",asm" + }" + "--enable-sp-math-all" + "--enable-harden" + ] + ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ + # Enable AVX/AVX2/AES-NI instructions, gated by runtime detection via CPUID. + "--enable-intelasm" + "--enable-aesni" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64) [ + # No runtime detection under ARM and no platform function checks like for X86. + (if enableARMCryptoExtensions then "--enable-armasm=inline" else "--disable-armasm") + ] + ++ extraConfigureFlags; # Breaks tls13 tests on aarch64-darwin. hardeningDisable = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ diff --git a/pkgs/by-name/wo/wordgrinder/package.nix b/pkgs/by-name/wo/wordgrinder/package.nix index 9f7d84c9bb37..12ceef70460d 100644 --- a/pkgs/by-name/wo/wordgrinder/package.nix +++ b/pkgs/by-name/wo/wordgrinder/package.nix @@ -44,28 +44,26 @@ stdenv.mkDerivation rec { ninja ]; - buildInputs = - [ - lua52Packages.lua - ncurses - readline - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libXft - ]; + buildInputs = [ + lua52Packages.lua + ncurses + readline + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libXft + ]; # To be able to find env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isLinux "-I${libXft.dev}/include/X11"; # Binaries look for LuaFileSystem library (lfs.so) at runtime - postInstall = - '' - wrapProgram $out/bin/wordgrinder --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so"; - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/xwordgrinder --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so"; - ''; + postInstall = '' + wrapProgram $out/bin/wordgrinder --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so"; + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram $out/bin/xwordgrinder --set LUA_CPATH "${lua52Packages.luafilesystem}/lib/lua/5.2/lfs.so"; + ''; meta = with lib; { description = "Text-based word processor"; diff --git a/pkgs/by-name/wr/wrangler/package.nix b/pkgs/by-name/wr/wrangler/package.nix index 01cc0714480b..e24252360729 100644 --- a/pkgs/by-name/wr/wrangler/package.nix +++ b/pkgs/by-name/wr/wrangler/package.nix @@ -43,27 +43,25 @@ stdenv.mkDerivation (finalAttrs: { passthru.updateScript = gitUpdater { rev-prefix = "wrangler@"; }; - buildInputs = - [ - llvmPackages.libcxx - llvmPackages.libunwind - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - musl # not used, but requires extra work to remove - xorg.libX11 # for the clipboardy package - ]; + buildInputs = [ + llvmPackages.libcxx + llvmPackages.libunwind + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + musl # not used, but requires extra work to remove + xorg.libX11 # for the clipboardy package + ]; - nativeBuildInputs = - [ - makeWrapper - nodejs - pnpm_9.configHook - jq - moreutils - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + makeWrapper + nodejs + pnpm_9.configHook + jq + moreutils + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + autoPatchelfHook + ]; # @cloudflare/vitest-pool-workers wanted to run a server as part of the build process # so I simply removed it diff --git a/pkgs/by-name/wr/wrangler_1/package.nix b/pkgs/by-name/wr/wrangler_1/package.nix index 042832ea99ef..203f6af3c13a 100644 --- a/pkgs/by-name/wr/wrangler_1/package.nix +++ b/pkgs/by-name/wr/wrangler_1/package.nix @@ -25,12 +25,13 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - curl - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + curl + libiconv + ]; OPENSSL_NO_VENDOR = 1; diff --git a/pkgs/by-name/wx/wxGTK31/package.nix b/pkgs/by-name/wx/wxGTK31/package.nix index 5b40cd47a5c9..55d7860a78d1 100644 --- a/pkgs/by-name/wx/wxGTK31/package.nix +++ b/pkgs/by-name/wx/wxGTK31/package.nix @@ -44,48 +44,46 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - gtk3 - libSM - libXinerama - libXtst - libXxf86vm - xorgproto - ] - ++ lib.optional withCurl curl - ++ lib.optional withMesa libGLU - ++ lib.optional (withWebKit && !stdenv.hostPlatform.isDarwin) webkitgtk_4_0 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libpng - ]; + buildInputs = [ + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + gtk3 + libSM + libXinerama + libXtst + libXxf86vm + xorgproto + ] + ++ lib.optional withCurl curl + ++ lib.optional withMesa libGLU + ++ lib.optional (withWebKit && !stdenv.hostPlatform.isDarwin) webkitgtk_4_0 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libpng + ]; - configureFlags = - [ - "--disable-precomp-headers" - # This is the default option, but be explicit - "--disable-monolithic" - "--enable-mediactrl" - (if compat28 then "--enable-compat28" else "--disable-compat28") - (if compat30 then "--enable-compat30" else "--disable-compat30") - ] - ++ lib.optional (!withEGL) "--disable-glcanvasegl" - ++ lib.optional unicode "--enable-unicode" - ++ lib.optional withCurl "--enable-webrequest" - ++ lib.optional withPrivateFonts "--enable-privatefonts" - ++ lib.optional withMesa "--with-opengl" - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--with-osx_cocoa" - "--with-libiconv" - ] - ++ lib.optionals withWebKit [ - "--enable-webview" - "--enable-webviewwebkit" - ]; + configureFlags = [ + "--disable-precomp-headers" + # This is the default option, but be explicit + "--disable-monolithic" + "--enable-mediactrl" + (if compat28 then "--enable-compat28" else "--disable-compat28") + (if compat30 then "--enable-compat30" else "--disable-compat30") + ] + ++ lib.optional (!withEGL) "--disable-glcanvasegl" + ++ lib.optional unicode "--enable-unicode" + ++ lib.optional withCurl "--enable-webrequest" + ++ lib.optional withPrivateFonts "--enable-privatefonts" + ++ lib.optional withMesa "--with-opengl" + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--with-osx_cocoa" + "--with-libiconv" + ] + ++ lib.optionals withWebKit [ + "--enable-webview" + "--enable-webviewwebkit" + ]; SEARCH_LIB = lib.optionalString ( !stdenv.hostPlatform.isDarwin diff --git a/pkgs/by-name/wx/wxGTK32/package.nix b/pkgs/by-name/wx/wxGTK32/package.nix index f3cc7693a4b8..b3021bcf15bb 100644 --- a/pkgs/by-name/wx/wxGTK32/package.nix +++ b/pkgs/by-name/wx/wxGTK32/package.nix @@ -58,62 +58,60 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - libpng - libtiff - libjpeg_turbo - zlib - pcre2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - curl - gspell # wxTextCtrl spell checking - gtk3 - libSM - libXinerama - libXtst - libXxf86vm - libnotify # wxNotificationMessage backend - libsecret # wxSecretStore backend - libxkbcommon # proper key codes in key events - xorgproto - ] - ++ lib.optional withMesa libGLU - ++ lib.optional (withWebKit && stdenv.hostPlatform.isLinux) webkitgtk_4_1 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - expat - ]; + buildInputs = [ + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + libpng + libtiff + libjpeg_turbo + zlib + pcre2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + curl + gspell # wxTextCtrl spell checking + gtk3 + libSM + libXinerama + libXtst + libXxf86vm + libnotify # wxNotificationMessage backend + libsecret # wxSecretStore backend + libxkbcommon # proper key codes in key events + xorgproto + ] + ++ lib.optional withMesa libGLU + ++ lib.optional (withWebKit && stdenv.hostPlatform.isLinux) webkitgtk_4_1 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + expat + ]; - configureFlags = - [ - "--disable-precomp-headers" - # This is the default option, but be explicit - "--disable-monolithic" - "--enable-mediactrl" - "--with-nanosvg" - "--disable-rpath" - "--enable-repro-build" - "--enable-webrequest" - (if compat28 then "--enable-compat28" else "--disable-compat28") - (if compat30 then "--enable-compat30" else "--disable-compat30") - ] - ++ lib.optional unicode "--enable-unicode" - ++ lib.optional withMesa "--with-opengl" - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--with-osx_cocoa" - "--with-libiconv" - "--with-urlsession" # for wxWebRequest - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "--with-libcurl" # for wxWebRequest - ] - ++ lib.optionals withWebKit [ - "--enable-webview" - "--enable-webviewwebkit" - ]; + configureFlags = [ + "--disable-precomp-headers" + # This is the default option, but be explicit + "--disable-monolithic" + "--enable-mediactrl" + "--with-nanosvg" + "--disable-rpath" + "--enable-repro-build" + "--enable-webrequest" + (if compat28 then "--enable-compat28" else "--disable-compat28") + (if compat30 then "--enable-compat30" else "--disable-compat30") + ] + ++ lib.optional unicode "--enable-unicode" + ++ lib.optional withMesa "--with-opengl" + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--with-osx_cocoa" + "--with-libiconv" + "--with-urlsession" # for wxWebRequest + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "--with-libcurl" # for wxWebRequest + ] + ++ lib.optionals withWebKit [ + "--enable-webview" + "--enable-webviewwebkit" + ]; SEARCH_LIB = lib.optionalString ( !stdenv.hostPlatform.isDarwin diff --git a/pkgs/by-name/wx/wxformbuilder/package.nix b/pkgs/by-name/wx/wxformbuilder/package.nix index b04d229c6667..c87eec9291c7 100644 --- a/pkgs/by-name/wx/wxformbuilder/package.nix +++ b/pkgs/by-name/wx/wxformbuilder/package.nix @@ -36,17 +36,16 @@ stdenv.mkDerivation (finalAttrs: { sed -i '/fixup_bundle/d' cmake/macros.cmake ''; - nativeBuildInputs = - [ - cmake - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.sigtool - makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - shared-mime-info - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.sigtool + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + shared-mime-info + ]; buildInputs = [ boost diff --git a/pkgs/by-name/wx/wxhexeditor/package.nix b/pkgs/by-name/wx/wxhexeditor/package.nix index 22a01f1d7bef..ed4d3b588b04 100644 --- a/pkgs/by-name/wx/wxhexeditor/package.nix +++ b/pkgs/by-name/wx/wxhexeditor/package.nix @@ -33,16 +33,15 @@ stdenv.mkDerivation rec { ./missing-semicolon.patch ]; - postPatch = - '' - substituteInPlace Makefile \ - --replace-fail "/usr" "$out" \ - --replace-fail "mhash; ./configure" "mhash; ./configure --prefix=$out" - '' - + lib.optionalString stdenv.cc.isClang '' - substituteInPlace Makefile \ - --replace-fail "-lgomp" "-lomp" - ''; + postPatch = '' + substituteInPlace Makefile \ + --replace-fail "/usr" "$out" \ + --replace-fail "mhash; ./configure" "mhash; ./configure --prefix=$out" + '' + + lib.optionalString stdenv.cc.isClang '' + substituteInPlace Makefile \ + --replace-fail "-lgomp" "-lomp" + ''; strictDeps = true; diff --git a/pkgs/by-name/x2/x265/package.nix b/pkgs/by-name/x2/x265/package.nix index 1f7f8cdff97c..54c93e9d7b69 100644 --- a/pkgs/by-name/x2/x265/package.nix +++ b/pkgs/by-name/x2/x265/package.nix @@ -53,76 +53,73 @@ stdenv.mkDerivation rec { hash = "sha256-oxaZxqiYBrdLAVHl5qffZd5LSQUEgv5ev4pDedevjyk="; }; - patches = - [ - ./darwin-__rdtsc.patch - ] - # TODO: remove after update to version 4.2 - ++ lib.optionals (stdenv.hostPlatform.isAarch32 && stdenv.hostPlatform.isLinux) [ - (fetchpatch2 { - url = "https://bitbucket.org/multicoreware/x265_git/commits/ddb1933598736394b646cb0f78da4a4201ffc656/raw"; - hash = "sha256-ZH+jbVtfNJ+CwRUEgsnzyPVzajR/+4nDnUDz5RONO6c="; - stripLen = 1; - }) - ]; + patches = [ + ./darwin-__rdtsc.patch + ] + # TODO: remove after update to version 4.2 + ++ lib.optionals (stdenv.hostPlatform.isAarch32 && stdenv.hostPlatform.isLinux) [ + (fetchpatch2 { + url = "https://bitbucket.org/multicoreware/x265_git/commits/ddb1933598736394b646cb0f78da4a4201ffc656/raw"; + hash = "sha256-ZH+jbVtfNJ+CwRUEgsnzyPVzajR/+4nDnUDz5RONO6c="; + stripLen = 1; + }) + ]; sourceRoot = "x265_${version}/source"; - postPatch = - '' - substituteInPlace cmake/Version.cmake \ - --replace-fail "unknown" "${version}" \ - --replace-fail "0.0" "${version}" - '' - # There is broken and complicated logic when setting X265_LATEST_TAG for - # mingwW64 builds. This bypasses the logic by setting it at the end of the - # file - + lib.optionalString stdenv.hostPlatform.isMinGW '' - echo 'set(X265_LATEST_TAG "${version}")' >> ./cmake/Version.cmake - ''; + postPatch = '' + substituteInPlace cmake/Version.cmake \ + --replace-fail "unknown" "${version}" \ + --replace-fail "0.0" "${version}" + '' + # There is broken and complicated logic when setting X265_LATEST_TAG for + # mingwW64 builds. This bypasses the logic by setting it at the end of the + # file + + lib.optionalString stdenv.hostPlatform.isMinGW '' + echo 'set(X265_LATEST_TAG "${version}")' >> ./cmake/Version.cmake + ''; nativeBuildInputs = [ cmake nasm - ] ++ lib.optionals (numaSupport) [ numactl ]; + ] + ++ lib.optionals (numaSupport) [ numactl ]; - cmakeFlags = - [ - "-DENABLE_ALPHA=ON" - "-DENABLE_MULTIVIEW=ON" - "-DENABLE_SCC_EXT=ON" - "-Wno-dev" - (mkFlag custatsSupport "DETAILED_CU_STATS") - (mkFlag debugSupport "CHECKED_BUILD") - (mkFlag ppaSupport "ENABLE_PPA") - (mkFlag vtuneSupport "ENABLE_VTUNE") - (mkFlag werrorSupport "WARNINGS_AS_ERRORS") - ] - # Clang does not support the endfunc directive so use GCC. - ++ lib.optional ( - stdenv.cc.isClang && !stdenv.targetPlatform.isDarwin && !stdenv.targetPlatform.isFreeBSD - ) "-DCMAKE_ASM_COMPILER=${gccStdenv.cc}/bin/${gccStdenv.cc.targetPrefix}gcc" - # Neon support - ++ lib.optionals (neonSupport && stdenv.hostPlatform.isAarch32) [ - "-DENABLE_NEON=ON" - "-DCPU_HAS_NEON=ON" - "-DENABLE_ASSEMBLY=ON" - ]; + cmakeFlags = [ + "-DENABLE_ALPHA=ON" + "-DENABLE_MULTIVIEW=ON" + "-DENABLE_SCC_EXT=ON" + "-Wno-dev" + (mkFlag custatsSupport "DETAILED_CU_STATS") + (mkFlag debugSupport "CHECKED_BUILD") + (mkFlag ppaSupport "ENABLE_PPA") + (mkFlag vtuneSupport "ENABLE_VTUNE") + (mkFlag werrorSupport "WARNINGS_AS_ERRORS") + ] + # Clang does not support the endfunc directive so use GCC. + ++ lib.optional ( + stdenv.cc.isClang && !stdenv.targetPlatform.isDarwin && !stdenv.targetPlatform.isFreeBSD + ) "-DCMAKE_ASM_COMPILER=${gccStdenv.cc}/bin/${gccStdenv.cc.targetPrefix}gcc" + # Neon support + ++ lib.optionals (neonSupport && stdenv.hostPlatform.isAarch32) [ + "-DENABLE_NEON=ON" + "-DCPU_HAS_NEON=ON" + "-DENABLE_ASSEMBLY=ON" + ]; - cmakeStaticLibFlags = - [ - "-DHIGH_BIT_DEPTH=ON" - "-DENABLE_CLI=OFF" - "-DENABLE_SHARED=OFF" - "-DEXPORT_C_API=OFF" - ] - ++ lib.optionals stdenv.hostPlatform.isPower [ - "-DENABLE_ALTIVEC=OFF" # https://bitbucket.org/multicoreware/x265_git/issues/320/fail-to-build-on-power8-le - ] - ++ lib.optionals isCross [ - (mkFlag stdenv.hostPlatform.isAarch32 "CROSS_COMPILE_ARM") - (mkFlag stdenv.hostPlatform.isAarch64 "CROSS_COMPILE_ARM64") - ]; + cmakeStaticLibFlags = [ + "-DHIGH_BIT_DEPTH=ON" + "-DENABLE_CLI=OFF" + "-DENABLE_SHARED=OFF" + "-DEXPORT_C_API=OFF" + ] + ++ lib.optionals stdenv.hostPlatform.isPower [ + "-DENABLE_ALTIVEC=OFF" # https://bitbucket.org/multicoreware/x265_git/issues/320/fail-to-build-on-power8-le + ] + ++ lib.optionals isCross [ + (mkFlag stdenv.hostPlatform.isAarch32 "CROSS_COMPILE_ARM") + (mkFlag stdenv.hostPlatform.isAarch64 "CROSS_COMPILE_ARM64") + ]; preConfigure = lib.optionalString multibitdepthSupport '' @@ -165,14 +162,13 @@ stdenv.mkDerivation rec { runHook postCheck ''; - postInstall = - '' - rm -f ${placeholder "out"}/lib/*.a - '' - # For mingw, libs are located in $out/bin not $out/lib - + lib.optionalString stdenv.hostPlatform.isMinGW '' - ln -s $out/bin/*.dll $out/lib - ''; + postInstall = '' + rm -f ${placeholder "out"}/lib/*.a + '' + # For mingw, libs are located in $out/bin not $out/lib + + lib.optionalString stdenv.hostPlatform.isMinGW '' + ln -s $out/bin/*.dll $out/lib + ''; meta = { description = "Library for encoding H.265/HEVC video streams"; diff --git a/pkgs/by-name/x3/x3270/package.nix b/pkgs/by-name/x3/x3270/package.nix index da3519ae0fd4..896bd6420c62 100644 --- a/pkgs/by-name/x3/x3270/package.nix +++ b/pkgs/by-name/x3/x3270/package.nix @@ -51,29 +51,28 @@ stdenv.mkDerivation rec { pathsToLink = [ "/share/man" ]; nativeBuildInputs = [ m4 ]; - buildInputs = - [ - expat - libX11 - libXt - libXaw - libXmu - bdftopcf - mkfontdir - fontadobe100dpi - fontadobeutopia100dpi - fontbh100dpi - fontbhlucidatypewriter100dpi - fontbitstream100dpi - tcl - ncurses - expat - openssl - readline - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + expat + libX11 + libXt + libXaw + libXmu + bdftopcf + mkfontdir + fontadobe100dpi + fontadobeutopia100dpi + fontbh100dpi + fontbhlucidatypewriter100dpi + fontbitstream100dpi + tcl + ncurses + expat + openssl + readline + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; meta = with lib; { description = "IBM 3270 terminal emulator for the X Window System"; diff --git a/pkgs/by-name/xa/xar/package.nix b/pkgs/by-name/xa/xar/package.nix index 61b25b6c15f2..53583b24caf3 100644 --- a/pkgs/by-name/xa/xar/package.nix +++ b/pkgs/by-name/xa/xar/package.nix @@ -83,18 +83,17 @@ stdenv.mkDerivation (finalAttrs: { ] ); - buildInputs = - [ - # NB we use OpenSSL instead of CommonCrypto on Darwin. - openssl - zlib - libxml2 - bzip2 - xz - e2fsprogs - ] - ++ lib.optional stdenv.hostPlatform.isLinux acl - ++ lib.optional stdenv.hostPlatform.isMusl musl-fts; + buildInputs = [ + # NB we use OpenSSL instead of CommonCrypto on Darwin. + openssl + zlib + libxml2 + bzip2 + xz + e2fsprogs + ] + ++ lib.optional stdenv.hostPlatform.isLinux acl + ++ lib.optional stdenv.hostPlatform.isMusl musl-fts; passthru = let diff --git a/pkgs/by-name/xa/xarchiver/package.nix b/pkgs/by-name/xa/xarchiver/package.nix index 01e335f72aa0..9f3cec690967 100644 --- a/pkgs/by-name/xa/xarchiver/package.nix +++ b/pkgs/by-name/xa/xarchiver/package.nix @@ -38,7 +38,8 @@ stdenv.mkDerivation rec { makeWrapper pkg-config wrapGAppsHook3 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ gtk3 diff --git a/pkgs/by-name/xa/xautoclick/package.nix b/pkgs/by-name/xa/xautoclick/package.nix index fb1861842d17..be79532cef07 100644 --- a/pkgs/by-name/xa/xautoclick/package.nix +++ b/pkgs/by-name/xa/xautoclick/package.nix @@ -32,22 +32,21 @@ stdenv.mkDerivation rec { cmake pkg-config ]; - buildInputs = - [ - libevdev - xorg.libXtst - ] - ++ lib.optionals gtkSupport [ - gtk3 - pcre - glib - wrapGAppsHook3 - ] - ++ lib.optionals fltkSupport [ fltk ] - ++ lib.optionals qtSupport [ - qt5.qtbase - qt5.wrapQtAppsHook - ]; + buildInputs = [ + libevdev + xorg.libXtst + ] + ++ lib.optionals gtkSupport [ + gtk3 + pcre + glib + wrapGAppsHook3 + ] + ++ lib.optionals fltkSupport [ fltk ] + ++ lib.optionals qtSupport [ + qt5.qtbase + qt5.wrapQtAppsHook + ]; meta = with lib; { description = "Autoclicker application, which enables you to automatically click the left mousebutton"; diff --git a/pkgs/by-name/xa/xavs/package.nix b/pkgs/by-name/xa/xavs/package.nix index e136438e09c7..a79e5a5a234c 100644 --- a/pkgs/by-name/xa/xavs/package.nix +++ b/pkgs/by-name/xa/xavs/package.nix @@ -16,26 +16,25 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - patchPhase = - '' - patchShebangs configure - patchShebangs config.sub - patchShebangs version.sh - patchShebangs tools/countquant_xavs.pl - patchShebangs tools/patcheck - patchShebangs tools/regression-test.pl - patchShebangs tools/xavs-format - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace config.guess --replace 'uname -p' 'uname -m' - substituteInPlace configure \ - --replace '-O4' '-O3' \ - --replace ' -s ' ' ' \ - --replace 'LDFLAGS -s' 'LDFLAGS' \ - --replace '-dynamiclib' ' ' \ - --replace '-falign-loops=16' ' ' - substituteInPlace Makefile --replace '-Wl,-soname,' ' ' - ''; + patchPhase = '' + patchShebangs configure + patchShebangs config.sub + patchShebangs version.sh + patchShebangs tools/countquant_xavs.pl + patchShebangs tools/patcheck + patchShebangs tools/regression-test.pl + patchShebangs tools/xavs-format + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace config.guess --replace 'uname -p' 'uname -m' + substituteInPlace configure \ + --replace '-O4' '-O3' \ + --replace ' -s ' ' ' \ + --replace 'LDFLAGS -s' 'LDFLAGS' \ + --replace '-dynamiclib' ' ' \ + --replace '-falign-loops=16' ' ' + substituteInPlace Makefile --replace '-Wl,-soname,' ' ' + ''; configureFlags = [ "--enable-pic" diff --git a/pkgs/by-name/xc/xcbuild/package.nix b/pkgs/by-name/xc/xcbuild/package.nix index b488c3ffbf78..cec703c5a6be 100644 --- a/pkgs/by-name/xc/xcbuild/package.nix +++ b/pkgs/by-name/xc/xcbuild/package.nix @@ -89,28 +89,27 @@ stdenv.mkDerivation (finalAttrs: { cp -r --no-preserve=all ${linenoise} ThirdParty/linenoise ''; - postPatch = - '' - substituteInPlace Libraries/pbxbuild/Sources/Tool/TouchResolver.cpp \ - --replace-fail "/usr/bin/touch" "touch" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - # Fix build on gcc-13 due to missing includes - sed -e '1i #include ' -i \ - Libraries/libutil/Headers/libutil/Permissions.h \ - Libraries/pbxbuild/Headers/pbxbuild/Tool/AuxiliaryFile.h \ - Libraries/pbxbuild/Headers/pbxbuild/Tool/Invocation.h + postPatch = '' + substituteInPlace Libraries/pbxbuild/Sources/Tool/TouchResolver.cpp \ + --replace-fail "/usr/bin/touch" "touch" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + # Fix build on gcc-13 due to missing includes + sed -e '1i #include ' -i \ + Libraries/libutil/Headers/libutil/Permissions.h \ + Libraries/pbxbuild/Headers/pbxbuild/Tool/AuxiliaryFile.h \ + Libraries/pbxbuild/Headers/pbxbuild/Tool/Invocation.h - # Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror. - sed 1i'#include ' \ - -i Libraries/xcassets/Headers/xcassets/Slot/SystemVersion.h - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Apple Open Sourced LZFSE, but not libcompression, and it isn't - # part of an impure framework we can add - substituteInPlace Libraries/libcar/Sources/Rendition.cpp \ - --replace "#if HAVE_LIBCOMPRESSION" "#if 0" - ''; + # Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror. + sed 1i'#include ' \ + -i Libraries/xcassets/Headers/xcassets/Slot/SystemVersion.h + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Apple Open Sourced LZFSE, but not libcompression, and it isn't + # part of an impure framework we can add + substituteInPlace Libraries/libcar/Sources/Rendition.cpp \ + --replace "#if HAVE_LIBCOMPRESSION" "#if 0" + ''; strictDeps = true; diff --git a/pkgs/by-name/xc/xchm/package.nix b/pkgs/by-name/xc/xchm/package.nix index cc53ca5f208d..0bafbde2f830 100644 --- a/pkgs/by-name/xc/xchm/package.nix +++ b/pkgs/by-name/xc/xchm/package.nix @@ -19,13 +19,12 @@ stdenv.mkDerivation rec { sha256 = "sha256-UMn8ds4nheuYSu0PesxdGoyxyn5AcKq9WByeRUxxx3k="; }; - nativeBuildInputs = - [ - autoreconfHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - desktopToDarwinBundle - ]; + nativeBuildInputs = [ + autoreconfHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; buildInputs = [ wxGTK32 diff --git a/pkgs/by-name/xc/xcodegen/package.nix b/pkgs/by-name/xc/xcodegen/package.nix index f97bd7ce704f..85a39c3baa0d 100644 --- a/pkgs/by-name/xc/xcodegen/package.nix +++ b/pkgs/by-name/xc/xcodegen/package.nix @@ -40,14 +40,12 @@ swiftPackages.stdenv.mkDerivation (finalAttrs: { # The helper provides a configure snippet that will prepare all dependencies # in the correct place, where SwiftPM expects them. - configurePhase = - generated.configure - + '' - # Replace the dependency symlink with a writable copy - swiftpmMakeMutable Spectre - # Now apply a patch - patch -p1 -d .build/checkouts/Spectre -i ${./0001-spectre-xct-record.patch} - ''; + configurePhase = generated.configure + '' + # Replace the dependency symlink with a writable copy + swiftpmMakeMutable Spectre + # Now apply a patch + patch -p1 -d .build/checkouts/Spectre -i ${./0001-spectre-xct-record.patch} + ''; installPhase = '' mkdir -p $out/bin $out/share/xcodegen diff --git a/pkgs/by-name/xd/xdg-user-dirs/package.nix b/pkgs/by-name/xd/xdg-user-dirs/package.nix index e8797598ad88..4429253f1495 100644 --- a/pkgs/by-name/xd/xdg-user-dirs/package.nix +++ b/pkgs/by-name/xd/xdg-user-dirs/package.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation (finalAttrs: { libxslt docbook_xsl docbook_xml_dtd_43 - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ gettext ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ gettext ]; NIX_LDFLAGS = if stdenv.isDarwin then "-liconv" else null; diff --git a/pkgs/by-name/xe/xed/package.nix b/pkgs/by-name/xe/xed/package.nix index 505b337a86f2..33c20973596e 100644 --- a/pkgs/by-name/xe/xed/package.nix +++ b/pkgs/by-name/xe/xed/package.nix @@ -50,7 +50,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ mbuild installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.bintools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.bintools ]; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/xe/xemu/package.nix b/pkgs/by-name/xe/xemu/package.nix index d11583b1b588..b89fb23ea126 100644 --- a/pkgs/by-name/xe/xemu/package.nix +++ b/pkgs/by-name/xe/xemu/package.nix @@ -37,20 +37,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-lTZ5j5ULh4GFW4zlQy4l7e4zr8TEIvenGNC59O6G0Wg="; }; - nativeBuildInputs = - [ - SDL2 - meson - ninja - perl - pkg-config - which - wrapGAppsHook3 - ] - ++ (with python3Packages; [ - python - pyyaml - ]); + nativeBuildInputs = [ + SDL2 + meson + ninja + perl + pkg-config + which + wrapGAppsHook3 + ] + ++ (with python3Packages; [ + python + pyyaml + ]); buildInputs = [ SDL2 @@ -92,16 +91,15 @@ stdenv.mkDerivation (finalAttrs: { --replace 'date -u' "date -d @$SOURCE_DATE_EPOCH '+%Y-%m-%d %H:%M:%S'" ''; - preConfigure = + preConfigure = '' + configureFlagsArray+=("--extra-cflags=-DXBOX=1 -Wno-error=redundant-decls") + '' + + + # When the data below can't be obtained through git, the build process tries + # to run `XEMU_COMMIT=$(cat XEMU_COMMIT)` (and similar) '' - configureFlagsArray+=("--extra-cflags=-DXBOX=1 -Wno-error=redundant-decls") - '' - + - # When the data below can't be obtained through git, the build process tries - # to run `XEMU_COMMIT=$(cat XEMU_COMMIT)` (and similar) - '' - echo '${finalAttrs.version}' > XEMU_VERSION - ''; + echo '${finalAttrs.version}' > XEMU_VERSION + ''; preBuild = '' cd build diff --git a/pkgs/by-name/xe/xen/package.nix b/pkgs/by-name/xe/xen/package.nix index b20f5ac95710..baf02b924b10 100644 --- a/pkgs/by-name/xe/xen/package.nix +++ b/pkgs/by-name/xe/xen/package.nix @@ -201,43 +201,41 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - acpica-tools - autoPatchelfHook - bison - cmake - dev86 - flex - pandoc - perl - pkg-config + nativeBuildInputs = [ + acpica-tools + autoPatchelfHook + bison + cmake + dev86 + flex + pandoc + perl + pkg-config - # oxenstored - ocamlPackages.findlib - ocamlPackages.ocaml - ] - ++ (with python3Packages; [ - python - setuptools - wrapPython - ]); + # oxenstored + ocamlPackages.findlib + ocamlPackages.ocaml + ] + ++ (with python3Packages; [ + python + setuptools + wrapPython + ]); - buildInputs = - [ - bzip2 - e2fsprogs.dev - libnl - libuuid - lzo - ncurses - xz - yajl - zlib - zstd - ] - ++ optionals withFlask [ checkpolicy ] - ++ optionals (versionOlder finalAttrs.version "4.19") [ systemd ]; + buildInputs = [ + bzip2 + e2fsprogs.dev + libnl + libuuid + lzo + ncurses + xz + yajl + zlib + zstd + ] + ++ optionals withFlask [ checkpolicy ] + ++ optionals (versionOlder finalAttrs.version "4.19") [ systemd ]; configureFlags = [ "--enable-systemd" @@ -249,29 +247,28 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withFlask "xsmpolicy") ]; - makeFlags = - [ - "SUBSYSTEMS=${toString finalAttrs.buildFlags}" + makeFlags = [ + "SUBSYSTEMS=${toString finalAttrs.buildFlags}" - "PREFIX=$(out)" - "BASH_COMPLETION_DIR=$(PREFIX)/share/bash-completion/completions" + "PREFIX=$(out)" + "BASH_COMPLETION_DIR=$(PREFIX)/share/bash-completion/completions" - "XEN_WHOAMI=${finalAttrs.pname}" - "XEN_DOMAIN=${finalAttrs.vendor}" + "XEN_WHOAMI=${finalAttrs.pname}" + "XEN_DOMAIN=${finalAttrs.vendor}" - "GIT=${getExe' coreutils "false"}" - "WGET=${getExe' coreutils "false"}" - "EFI_VENDOR=${finalAttrs.vendor}" - "INSTALL_EFI_STRIP=1" - "LD=${getExe' binutils-unwrapped-all-targets "ld"}" - ] - # These flags set the CONFIG_* options in /boot/xen.config - # and define if the default policy file is built. However, - # the Flask binaries always get compiled by default. - ++ optionals withFlask [ - "XSM_ENABLE=y" - "FLASK_ENABLE=y" - ]; + "GIT=${getExe' coreutils "false"}" + "WGET=${getExe' coreutils "false"}" + "EFI_VENDOR=${finalAttrs.vendor}" + "INSTALL_EFI_STRIP=1" + "LD=${getExe' binutils-unwrapped-all-targets "ld"}" + ] + # These flags set the CONFIG_* options in /boot/xen.config + # and define if the default policy file is built. However, + # the Flask binaries always get compiled by default. + ++ optionals withFlask [ + "XSM_ENABLE=y" + "FLASK_ENABLE=y" + ]; buildFlags = [ "xen" @@ -310,17 +307,16 @@ stdenv.mkDerivation (finalAttrs: { wrapPythonProgramsIn "$out/libexec/xen/bin" "$out $pythonPath" ''; - postFixup = - '' - addAutoPatchelfSearchPath $out/lib - autoPatchelf $out/libexec/xen/bin - '' - # Flask is particularly hard to disable. Even after - # setting the make flags to `n`, it still gets compiled. - # If withFlask is disabled, delete the extra binaries. - + optionalString (!withFlask) '' - rm -f $out/bin/flask-* - ''; + postFixup = '' + addAutoPatchelfSearchPath $out/lib + autoPatchelf $out/libexec/xen/bin + '' + # Flask is particularly hard to disable. Even after + # setting the make flags to `n`, it still gets compiled. + # If withFlask is disabled, delete the extra binaries. + + optionalString (!withFlask) '' + rm -f $out/bin/flask-* + ''; passthru = { efi = "boot/xen-${finalAttrs.upstreamVersion}.efi"; @@ -359,22 +355,21 @@ stdenv.mkDerivation (finalAttrs: { branch = versions.majorMinor finalAttrs.version; description = "Type-1 hypervisor intended for embedded and hyperscale use cases"; - longDescription = - '' - The Xen Project Hypervisor is a virtualisation technology defined as a *type-1 - hypervisor*, which allows multiple virtual machines, known as domains, to run - concurrently with the host on the physical machine. On a typical *type-2 - hypervisor*, the virtual machines run as applications on top of the - host. NixOS runs as the privileged **Domain 0**, and can paravirtualise or fully - virtualise **Unprivileged Domains**. + longDescription = '' + The Xen Project Hypervisor is a virtualisation technology defined as a *type-1 + hypervisor*, which allows multiple virtual machines, known as domains, to run + concurrently with the host on the physical machine. On a typical *type-2 + hypervisor*, the virtual machines run as applications on top of the + host. NixOS runs as the privileged **Domain 0**, and can paravirtualise or fully + virtualise **Unprivileged Domains**. - Use with the `qemu_xen` package. - '' - + "\nIncludes:\n* `xen.efi`: The Xen Project's [EFI binary](https://xenbits.xenproject.org/docs/${finalAttrs.meta.branch}-testing/misc/efi.html), available on the `boot` output of this package." - + optionalString withFlask "\n* `xsm-flask`: The [FLASK Xen Security Module](https://wiki.xenproject.org/wiki/Xen_Security_Modules_:_XSM-FLASK). The `xenpolicy` file is available on the `boot` output of this package." - + optionalString withSeaBIOS "\n* `seabios`: Support for the SeaBIOS boot firmware on HVM domains." - + optionalString withOVMF "\n* `ovmf`: Support for the OVMF UEFI boot firmware on HVM domains." - + optionalString withIPXE "\n* `ipxe`: Support for the iPXE boot firmware on HVM domains."; + Use with the `qemu_xen` package. + '' + + "\nIncludes:\n* `xen.efi`: The Xen Project's [EFI binary](https://xenbits.xenproject.org/docs/${finalAttrs.meta.branch}-testing/misc/efi.html), available on the `boot` output of this package." + + optionalString withFlask "\n* `xsm-flask`: The [FLASK Xen Security Module](https://wiki.xenproject.org/wiki/Xen_Security_Modules_:_XSM-FLASK). The `xenpolicy` file is available on the `boot` output of this package." + + optionalString withSeaBIOS "\n* `seabios`: Support for the SeaBIOS boot firmware on HVM domains." + + optionalString withOVMF "\n* `ovmf`: Support for the OVMF UEFI boot firmware on HVM domains." + + optionalString withIPXE "\n* `ipxe`: Support for the iPXE boot firmware on HVM domains."; homepage = "https://xenproject.org/"; downloadPage = "https://downloads.xenproject.org/release/xen/${finalAttrs.version}/"; diff --git a/pkgs/by-name/xf/xfitter/package.nix b/pkgs/by-name/xf/xfitter/package.nix index 6aa1e893a05e..5e4cbc52a1cf 100644 --- a/pkgs/by-name/xf/xfitter/package.nix +++ b/pkgs/by-name/xf/xfitter/package.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation { gsl yaml-cpp zlib - ] ++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc; + ] + ++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc; env.NIX_CFLAGS_COMPILE = lib.optionalString ( stdenv.hostPlatform.libc == "glibc" diff --git a/pkgs/by-name/xg/xgboost/package.nix b/pkgs/by-name/xg/xgboost/package.nix index b250f41a85c4..ab3ccbb3772b 100644 --- a/pkgs/by-name/xg/xgboost/package.nix +++ b/pkgs/by-name/xg/xgboost/package.nix @@ -58,17 +58,19 @@ effectiveStdenv.mkDerivation rec { hash = "sha256-8mj8uw7bbwhRaL0JZf9L9//a+Re2AwbL0e7Oiw/BqIA="; }; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ llvmPackages.openmp ] - ++ lib.optionals cudaSupport [ autoAddDriverRunpath ] - ++ lib.optionals rLibrary [ R ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ llvmPackages.openmp ] + ++ lib.optionals cudaSupport [ autoAddDriverRunpath ] + ++ lib.optionals rLibrary [ R ]; - buildInputs = - [ gtest ] - ++ lib.optional cudaSupport cudaPackages.cudatoolkit - ++ lib.optional cudaSupport cudaPackages.cuda_cudart - ++ lib.optional ncclSupport cudaPackages.nccl; + buildInputs = [ + gtest + ] + ++ lib.optional cudaSupport cudaPackages.cudatoolkit + ++ lib.optional cudaSupport cudaPackages.cuda_cudart + ++ lib.optional ncclSupport cudaPackages.nccl; propagatedBuildInputs = lib.optionals rLibrary [ rPackages.data_table @@ -169,20 +171,19 @@ effectiveStdenv.mkDerivation rec { in "-${builtins.concatStringsSep ":" excludedTests}"; - installPhase = - '' - runHook preInstall - '' - # the R library option builds a completely different binary xgboost.so instead of - # libxgboost.so, which isn't full featured for python and CLI - + lib.optionalString rLibrary '' - mkdir -p $out/library - export R_LIBS_SITE="$out/library:$R_LIBS_SITE''${R_LIBS_SITE:+:}" - '' - + '' - cmake --install . - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + # the R library option builds a completely different binary xgboost.so instead of + # libxgboost.so, which isn't full featured for python and CLI + + lib.optionalString rLibrary '' + mkdir -p $out/library + export R_LIBS_SITE="$out/library:$R_LIBS_SITE''${R_LIBS_SITE:+:}" + '' + + '' + cmake --install . + runHook postInstall + ''; postFixup = lib.optionalString rLibrary '' if test -e $out/nix-support/propagated-build-inputs; then diff --git a/pkgs/by-name/xi/xiu/package.nix b/pkgs/by-name/xi/xiu/package.nix index f4eb72204ff7..3495dab851b3 100644 --- a/pkgs/by-name/xi/xiu/package.nix +++ b/pkgs/by-name/xi/xiu/package.nix @@ -28,13 +28,12 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = - [ - libopus - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - openssl - ]; + buildInputs = [ + libopus + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + openssl + ]; OPENSSL_NO_VENDOR = 1; diff --git a/pkgs/by-name/xl/xloadimage/package.nix b/pkgs/by-name/xl/xloadimage/package.nix index 1f29e514dec3..f80017007a1c 100644 --- a/pkgs/by-name/xl/xloadimage/package.nix +++ b/pkgs/by-name/xl/xloadimage/package.nix @@ -47,20 +47,19 @@ stdenv.mkDerivation rec { quilt ]; - buildInputs = - [ - libX11 - libXt - ] - ++ lib.optionals withJpegSupport [ - libjpeg - ] - ++ lib.optionals withPngSupport [ - libpng - ] - ++ lib.optionals withTiffSupport [ - libtiff - ]; + buildInputs = [ + libX11 + libXt + ] + ++ lib.optionals withJpegSupport [ + libjpeg + ] + ++ lib.optionals withPngSupport [ + libpng + ] + ++ lib.optionals withTiffSupport [ + libtiff + ]; # NOTE: we patch the build-info script so that it never detects the utilities # it's trying to find; one of the Debian patches adds support for diff --git a/pkgs/by-name/xl/xlockmore/package.nix b/pkgs/by-name/xl/xlockmore/package.nix index 861292b3f423..6ea8723c5832 100644 --- a/pkgs/by-name/xl/xlockmore/package.nix +++ b/pkgs/by-name/xl/xlockmore/package.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-setuid" "--enable-appdefaultdir=${placeholder "out"}/share/X11/app-defaults" - ] ++ (lib.optional (pam != null) "--enable-pam"); + ] + ++ (lib.optional (pam != null) "--enable-pam"); postPatch = let diff --git a/pkgs/by-name/xm/xmlcopyeditor/package.nix b/pkgs/by-name/xm/xmlcopyeditor/package.nix index 345fcd776e9a..156b444867e7 100644 --- a/pkgs/by-name/xm/xmlcopyeditor/package.nix +++ b/pkgs/by-name/xm/xmlcopyeditor/package.nix @@ -27,16 +27,15 @@ stdenv.mkDerivation (finalAttrs: { # error: cannot initialize a variable of type 'xmlErrorPtr' (aka '_xmlError *') # with an rvalue of type 'const xmlError *' (aka 'const _xmlError *') - postPatch = - '' - substituteInPlace src/wraplibxml.cpp \ - --replace-fail "xmlErrorPtr err" "const xmlError *err" - '' - # error: invalid type argument of unary '*' (have 'long int') - + '' - substituteInPlace src/wraplibxml.cpp \ - --replace-fail "initGenericErrorDefaultFunc ( NULL )" "xmlSetGenericErrorFunc( nullptr , nullptr )" - ''; + postPatch = '' + substituteInPlace src/wraplibxml.cpp \ + --replace-fail "xmlErrorPtr err" "const xmlError *err" + '' + # error: invalid type argument of unary '*' (have 'long int') + + '' + substituteInPlace src/wraplibxml.cpp \ + --replace-fail "initGenericErrorDefaultFunc ( NULL )" "xmlSetGenericErrorFunc( nullptr , nullptr )" + ''; nativeBuildInputs = [ intltool diff --git a/pkgs/by-name/xn/xnee/package.nix b/pkgs/by-name/xn/xnee/package.nix index adccf198f2ac..fbd35d936fb1 100644 --- a/pkgs/by-name/xn/xnee/package.nix +++ b/pkgs/by-name/xn/xnee/package.nix @@ -40,19 +40,18 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = - '' - for i in `find cnee/test -name \*.sh`; do - sed -i "$i" -e's|/bin/bash|${stdenv.shell}|g ; s|/usr/bin/env bash|${stdenv.shell}|g' - done - '' - # Fix for glibc-2.34. For some reason, `LIBSEMA="CCC"` is added - # if `sem_init` is part of libc which causes errors like - # `gcc: error: CCC: No such file or directory` during the build. - + '' - substituteInPlace configure* \ - --replace 'LIBSEMA="CCC"' 'LIBSEMA=""' - ''; + postPatch = '' + for i in `find cnee/test -name \*.sh`; do + sed -i "$i" -e's|/bin/bash|${stdenv.shell}|g ; s|/usr/bin/env bash|${stdenv.shell}|g' + done + '' + # Fix for glibc-2.34. For some reason, `LIBSEMA="CCC"` is added + # if `sem_init` is part of libc which causes errors like + # `gcc: error: CCC: No such file or directory` during the build. + + '' + substituteInPlace configure* \ + --replace 'LIBSEMA="CCC"' 'LIBSEMA=""' + ''; strictDeps = true; diff --git a/pkgs/by-name/xp/xpar/package.nix b/pkgs/by-name/xp/xpar/package.nix index 0409a1351b70..f99af41df992 100644 --- a/pkgs/by-name/xp/xpar/package.nix +++ b/pkgs/by-name/xp/xpar/package.nix @@ -19,15 +19,15 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ autoreconfHook - ] ++ lib.optionals stdenv.hostPlatform.isx86_64 [ nasm ]; + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ nasm ]; - configureFlags = - [ - "--disable-arch-native" - "--enable-lto" - ] - ++ lib.optional stdenv.hostPlatform.isx86_64 "--enable-x86-64" - ++ lib.optional stdenv.hostPlatform.isAarch64 "--enable-aarch64"; + configureFlags = [ + "--disable-arch-native" + "--enable-lto" + ] + ++ lib.optional stdenv.hostPlatform.isx86_64 "--enable-x86-64" + ++ lib.optional stdenv.hostPlatform.isAarch64 "--enable-aarch64"; meta = { description = "Error/erasure code system guarding data integrity"; diff --git a/pkgs/by-name/xp/xpra/package.nix b/pkgs/by-name/xp/xpra/package.nix index 486287a0386b..7e16230708c9 100644 --- a/pkgs/by-name/xp/xpra/package.nix +++ b/pkgs/by-name/xp/xpra/package.nix @@ -122,7 +122,8 @@ buildPythonApplication rec { wrapGAppsHook3 pandoc udevCheckHook - ] ++ lib.optional withNvenc cudatoolkit; + ] + ++ lib.optional withNvenc cudatoolkit; buildInputs = with xorg; @@ -215,64 +216,61 @@ buildPythonApplication rec { # error: 'import_cairo' defined but not used env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function"; - setupPyBuildFlags = - [ - "--with-Xdummy" - "--without-Xdummy_wrapper" - "--without-strict" - "--with-gtk3" - # Override these, setup.py checks for headers in /usr/* paths - "--with-pam" - "--with-vsock" - ] - ++ lib.optional withNvenc [ - "--with-nvenc" - "--with-nvjpeg_encoder" - ]; + setupPyBuildFlags = [ + "--with-Xdummy" + "--without-Xdummy_wrapper" + "--without-strict" + "--with-gtk3" + # Override these, setup.py checks for headers in /usr/* paths + "--with-pam" + "--with-vsock" + ] + ++ lib.optional withNvenc [ + "--with-nvenc" + "--with-nvjpeg_encoder" + ]; dontWrapGApps = true; - preFixup = - '' - makeWrapperArgs+=( - "''${gappsWrapperArgs[@]}" - --set XPRA_INSTALL_PREFIX "$out" - --set XPRA_COMMAND "$out/bin/xpra" - --set XPRA_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" - --set XORG_CONFIG_PREFIX "" - --prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib - --prefix PATH : ${ - lib.makeBinPath [ - getopt - xorgserver - xauth - which - util-linux - pulseaudioFull - ] - } - '' - + lib.optionalString withNvenc '' - --prefix LD_LIBRARY_PATH : ${nvidia_x11}/lib - '' - + '' - ) - ''; + preFixup = '' + makeWrapperArgs+=( + "''${gappsWrapperArgs[@]}" + --set XPRA_INSTALL_PREFIX "$out" + --set XPRA_COMMAND "$out/bin/xpra" + --set XPRA_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" + --set XORG_CONFIG_PREFIX "" + --prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib + --prefix PATH : ${ + lib.makeBinPath [ + getopt + xorgserver + xauth + which + util-linux + pulseaudioFull + ] + } + '' + + lib.optionalString withNvenc '' + --prefix LD_LIBRARY_PATH : ${nvidia_x11}/lib + '' + + '' + ) + ''; - postInstall = - '' - # append module paths to xorg.conf - cat ${xorgModulePaths} >> $out/etc/xpra/xorg.conf - cat ${xorgModulePaths} >> $out/etc/xpra/xorg-uinput.conf + postInstall = '' + # append module paths to xorg.conf + cat ${xorgModulePaths} >> $out/etc/xpra/xorg.conf + cat ${xorgModulePaths} >> $out/etc/xpra/xorg-uinput.conf - # make application icon visible to desktop environemnts - icon_dir="$out/share/icons/hicolor/64x64/apps" - mkdir -p "$icon_dir" - ln -sr "$out/share/icons/xpra.png" "$icon_dir" - '' - + lib.optionalString withHtml '' - ln -s ${xpra-html5}/share/xpra/www $out/share/xpra/www; - ''; + # make application icon visible to desktop environemnts + icon_dir="$out/share/icons/hicolor/64x64/apps" + mkdir -p "$icon_dir" + ln -sr "$out/share/icons/xpra.png" "$icon_dir" + '' + + lib.optionalString withHtml '' + ln -s ${xpra-html5}/share/xpra/www $out/share/xpra/www; + ''; # doCheck = false; diff --git a/pkgs/by-name/xp/xprompt/package.nix b/pkgs/by-name/xp/xprompt/package.nix index bc10c7b44b66..bf3dab6b1b7e 100644 --- a/pkgs/by-name/xp/xprompt/package.nix +++ b/pkgs/by-name/xp/xprompt/package.nix @@ -29,17 +29,16 @@ stdenv.mkDerivation rec { libXinerama ]; - postPatch = - '' - sed -i "8i #include " xprompt.c - '' - + ( - let - configFile = - if lib.isDerivation conf || builtins.isPath conf then conf else writeText "config.h" conf; - in - lib.optionalString (conf != null) "cp ${configFile} config.h" - ); + postPatch = '' + sed -i "8i #include " xprompt.c + '' + + ( + let + configFile = + if lib.isDerivation conf || builtins.isPath conf then conf else writeText "config.h" conf; + in + lib.optionalString (conf != null) "cp ${configFile} config.h" + ); makeFlags = [ "CC:=$(CC)" diff --git a/pkgs/by-name/xq/xquartz/package.nix b/pkgs/by-name/xq/xquartz/package.nix index 7f9b368d1dc0..8b60533add34 100644 --- a/pkgs/by-name/xq/xquartz/package.nix +++ b/pkgs/by-name/xq/xquartz/package.nix @@ -77,20 +77,19 @@ let sudo launchctl load -w /Library/LaunchAgents/$agentName sudo launchctl load -w /Library/LaunchDaemons/$daemonName ''; - fontDirs = - [ - ttf_bitstream_vera - freefont_ttf - liberation_ttf - xorg.fontmiscmisc - xorg.fontcursormisc - ] - ++ lib.optionals unfreeFonts [ - xorg.fontbhlucidatypewriter100dpi - xorg.fontbhlucidatypewriter75dpi - xorg.fontbh100dpi - ] - ++ extraFontDirs; + fontDirs = [ + ttf_bitstream_vera + freefont_ttf + liberation_ttf + xorg.fontmiscmisc + xorg.fontcursormisc + ] + ++ lib.optionals unfreeFonts [ + xorg.fontbhlucidatypewriter100dpi + xorg.fontbhlucidatypewriter75dpi + xorg.fontbh100dpi + ] + ++ extraFontDirs; fontsConf = makeFontsConf { fontDirectories = fontDirs ++ [ "/Library/Fonts" diff --git a/pkgs/by-name/xr/xreader/package.nix b/pkgs/by-name/xr/xreader/package.nix index e41c7789af8a..81ee70af9020 100644 --- a/pkgs/by-name/xr/xreader/package.nix +++ b/pkgs/by-name/xr/xreader/package.nix @@ -58,7 +58,8 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dmathjax-directory=${nodePackages.mathjax}" "-Dintrospection=true" - ] ++ (map (x: "-D${x}=true") backends); + ] + ++ (map (x: "-D${x}=true") backends); buildInputs = [ glib diff --git a/pkgs/by-name/xr/xrootd/package.nix b/pkgs/by-name/xr/xrootd/package.nix index 8773875099d4..1abd4af15106 100644 --- a/pkgs/by-name/xr/xrootd/package.nix +++ b/pkgs/by-name/xr/xrootd/package.nix @@ -40,22 +40,22 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-zeyg/VdzcWbMXuCE1RELiyGg9mytfpNfIa911BwqqIA="; }; - postPatch = - '' - patchShebangs genversion.sh - substituteInPlace cmake/XRootDConfig.cmake.in \ - --replace-fail "@PACKAGE_CMAKE_INSTALL_" "@CMAKE_INSTALL_FULL_" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - sed -i cmake/XRootDOSDefs.cmake -e '/set( MacOSX TRUE )/ainclude( GNUInstallDirs )' - ''; + postPatch = '' + patchShebangs genversion.sh + substituteInPlace cmake/XRootDConfig.cmake.in \ + --replace-fail "@PACKAGE_CMAKE_INSTALL_" "@CMAKE_INSTALL_FULL_" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + sed -i cmake/XRootDOSDefs.cmake -e '/set( MacOSX TRUE )/ainclude( GNUInstallDirs )' + ''; outputs = [ "bin" "out" "dev" "man" - ] ++ lib.optional (externalEtc != null) "etc"; + ] + ++ lib.optional (externalEtc != null) "etc"; nativeBuildInputs = [ cmake @@ -64,53 +64,51 @@ stdenv.mkDerivation (finalAttrs: { removeReferencesTo ]; - buildInputs = - [ - davix - curl - libkrb5 - libuuid - libxcrypt - libxml2 - openssl - readline - scitokens-cpp - zlib - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # https://github.com/xrootd/xrootd/blob/5b5a1f6957def2816b77ec773c7e1bfb3f1cfc5b/cmake/XRootDFindLibs.cmake#L58 - fuse - ] - ++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) [ - isa-l # not available on Apple silicon - systemd # only available on specific non-static Linux platforms - voms # only available on Linux due to gsoap failing to build on Darwin - ]; + buildInputs = [ + davix + curl + libkrb5 + libuuid + libxcrypt + libxml2 + openssl + readline + scitokens-cpp + zlib + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # https://github.com/xrootd/xrootd/blob/5b5a1f6957def2816b77ec773c7e1bfb3f1cfc5b/cmake/XRootDFindLibs.cmake#L58 + fuse + ] + ++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) [ + isa-l # not available on Apple silicon + systemd # only available on specific non-static Linux platforms + voms # only available on Linux due to gsoap failing to build on Darwin + ]; # https://github.com/xrootd/xrootd/blob/master/packaging/rhel/xrootd.spec.in#L665-L675= - postInstall = - '' - mkdir -p "$out/lib/tmpfiles.d" - install -m 644 -T ../packaging/rhel/xrootd.tmpfiles "$out/lib/tmpfiles.d/xrootd.conf" - mkdir -p "$out/etc/xrootd" - install -m 644 -t "$out/etc/xrootd" ../packaging/common/*.cfg - install -m 644 -t "$out/etc/xrootd" ../packaging/common/client.conf - mkdir -p "$out/etc/xrootd/client.plugins.d" - install -m 644 -t "$out/etc/xrootd/client.plugins.d" ../packaging/common/client-plugin.conf.example - mkdir -p "$out/etc/logrotate.d" - install -m 644 -T ../packaging/common/xrootd.logrotate "$out/etc/logrotate.d/xrootd" - '' - # Leaving those in bin/ leads to a cyclic reference between $dev and $bin - # This happens since https://github.com/xrootd/xrootd/commit/fe268eb622e2192d54a4230cea54c41660bd5788 - # So far, this xrootd-config script does not seem necessary in $bin - + '' - moveToOutput "bin/xrootd-config" "$dev" - moveToOutput "bin/.xrootd-config-wrapped" "$dev" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p "$out/lib/systemd/system" - install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket - ''; + postInstall = '' + mkdir -p "$out/lib/tmpfiles.d" + install -m 644 -T ../packaging/rhel/xrootd.tmpfiles "$out/lib/tmpfiles.d/xrootd.conf" + mkdir -p "$out/etc/xrootd" + install -m 644 -t "$out/etc/xrootd" ../packaging/common/*.cfg + install -m 644 -t "$out/etc/xrootd" ../packaging/common/client.conf + mkdir -p "$out/etc/xrootd/client.plugins.d" + install -m 644 -t "$out/etc/xrootd/client.plugins.d" ../packaging/common/client-plugin.conf.example + mkdir -p "$out/etc/logrotate.d" + install -m 644 -T ../packaging/common/xrootd.logrotate "$out/etc/logrotate.d/xrootd" + '' + # Leaving those in bin/ leads to a cyclic reference between $dev and $bin + # This happens since https://github.com/xrootd/xrootd/commit/fe268eb622e2192d54a4230cea54c41660bd5788 + # So far, this xrootd-config script does not seem necessary in $bin + + '' + moveToOutput "bin/xrootd-config" "$dev" + moveToOutput "bin/.xrootd-config-wrapped" "$dev" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p "$out/lib/systemd/system" + install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket + ''; cmakeFlags = [ (lib.cmakeFeature "XRootD_VERSION_STRING" finalAttrs.version) diff --git a/pkgs/by-name/xs/xscreensaver/package.nix b/pkgs/by-name/xs/xscreensaver/package.nix index 62ec22428439..c1b65e7b7006 100644 --- a/pkgs/by-name/xs/xscreensaver/package.nix +++ b/pkgs/by-name/xs/xscreensaver/package.nix @@ -74,7 +74,8 @@ stdenv.mkDerivation (finalAttrs: { perlPackages.LWPProtocolHttps perlPackages.MozillaCA perlPackages.perl - ] ++ lib.optionals withSystemd [ systemd ]; + ] + ++ lib.optionals withSystemd [ systemd ]; postPatch = '' pushd hacks @@ -101,29 +102,28 @@ stdenv.mkDerivation (finalAttrs: { # "marbling" has NEON code that mixes signed and unsigned vector types env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch "-flax-vector-conversions"; - postInstall = - '' - for bin in $out/bin/*; do - wrapProgram "$bin" \ - --prefix PATH : "$out/libexec/xscreensaver" \ - --prefix PATH : "${ - lib.makeBinPath [ - coreutils - perlPackages.perl - xorg.appres - ] - }" \ - --prefix PERL5LIB ':' $PERL5LIB - done - '' - + lib.optionalString forceInstallAllHacks '' - make -j$NIX_BUILD_CORES -C hacks/glx dnalogo - cat hacks/Makefile.in \ - | grep -E '([a-z0-9]+):[[:space:]]*\1[.]o' | cut -d : -f 1 | xargs make -j$NIX_BUILD_CORES -C hacks - cat hacks/glx/Makefile.in \ - | grep -E '([a-z0-9]+):[[:space:]]*\1[.]o' | cut -d : -f 1 | xargs make -j$NIX_BUILD_CORES -C hacks/glx - cp -f $(find hacks -type f -perm -111 "!" -name "*.*" ) "$out/libexec/xscreensaver" - ''; + postInstall = '' + for bin in $out/bin/*; do + wrapProgram "$bin" \ + --prefix PATH : "$out/libexec/xscreensaver" \ + --prefix PATH : "${ + lib.makeBinPath [ + coreutils + perlPackages.perl + xorg.appres + ] + }" \ + --prefix PERL5LIB ':' $PERL5LIB + done + '' + + lib.optionalString forceInstallAllHacks '' + make -j$NIX_BUILD_CORES -C hacks/glx dnalogo + cat hacks/Makefile.in \ + | grep -E '([a-z0-9]+):[[:space:]]*\1[.]o' | cut -d : -f 1 | xargs make -j$NIX_BUILD_CORES -C hacks + cat hacks/glx/Makefile.in \ + | grep -E '([a-z0-9]+):[[:space:]]*\1[.]o' | cut -d : -f 1 | xargs make -j$NIX_BUILD_CORES -C hacks/glx + cp -f $(find hacks -type f -perm -111 "!" -name "*.*" ) "$out/libexec/xscreensaver" + ''; passthru.tests = { xscreensaver = nixosTests.xscreensaver; diff --git a/pkgs/by-name/xs/xsnow/package.nix b/pkgs/by-name/xs/xsnow/package.nix index 067bf1a0a100..00cfea9b55da 100644 --- a/pkgs/by-name/xs/xsnow/package.nix +++ b/pkgs/by-name/xs/xsnow/package.nix @@ -23,19 +23,18 @@ stdenv.mkDerivation rec { pkg-config wrapGAppsHook3 ]; - buildInputs = - [ - gtk3-x11 - libxkbcommon - libxml2 - gsl - ] - ++ (with xorg; [ - libX11 - libXpm - libXt - libXtst - ]); + buildInputs = [ + gtk3-x11 + libxkbcommon + libxml2 + gsl + ] + ++ (with xorg; [ + libX11 + libXpm + libXt + libXtst + ]); makeFlags = [ "gamesdir=$(out)/bin" ]; diff --git a/pkgs/by-name/xt/xterm/package.nix b/pkgs/by-name/xt/xterm/package.nix index 92f0964117f4..1c0e045b9706 100644 --- a/pkgs/by-name/xt/xterm/package.nix +++ b/pkgs/by-name/xt/xterm/package.nix @@ -62,17 +62,17 @@ stdenv.mkDerivation rec { "--enable-mini-luit" "--with-tty-group=tty" "--with-app-defaults=$(out)/lib/X11/app-defaults" - ] ++ lib.optional enableDecLocator "--enable-dec-locator"; + ] + ++ lib.optional enableDecLocator "--enable-dec-locator"; - env = - { - # Work around broken "plink.sh". - NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; - } - // lib.optionalAttrs stdenv.hostPlatform.isMusl { - # Various symbols missing without this define: TAB3, NLDLY, CRDLY, BSDLY, FFDLY, CBAUD - NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; - }; + env = { + # Work around broken "plink.sh". + NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig"; + } + // lib.optionalAttrs stdenv.hostPlatform.isMusl { + # Various symbols missing without this define: TAB3, NLDLY, CRDLY, BSDLY, FFDLY, CBAUD + NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; + }; # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp', # decided by the sysadmin to allow the xterm reporting to /var/run/utmp diff --git a/pkgs/by-name/xv/xvidcore/package.nix b/pkgs/by-name/xv/xvidcore/package.nix index 6b5e3e212040..6d73196e83ab 100644 --- a/pkgs/by-name/xv/xvidcore/package.nix +++ b/pkgs/by-name/xv/xvidcore/package.nix @@ -17,15 +17,14 @@ stdenv.mkDerivation rec { sha256 = "1xyg3amgg27zf7188kss7y248s0xhh1vv8rrk0j9bcsd5nasxsmf"; }; - preConfigure = - '' - # Configure script is not in the root of the source directory - cd build/generic - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Undocumented darwin hack - substituteInPlace configure --replace "-no-cpp-precomp" "" - ''; + preConfigure = '' + # Configure script is not in the root of the source directory + cd build/generic + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Undocumented darwin hack + substituteInPlace configure --replace "-no-cpp-precomp" "" + ''; configureFlags = [ ] diff --git a/pkgs/by-name/xw/xwayland-run/package.nix b/pkgs/by-name/xw/xwayland-run/package.nix index 909df171fc13..7b3d1e4d3f12 100644 --- a/pkgs/by-name/xw/xwayland-run/package.nix +++ b/pkgs/by-name/xw/xwayland-run/package.nix @@ -17,12 +17,13 @@ dbus, # Since 0.0.3, mutter compositors run with their own DBUS sessions }: let - compositors = - [ weston ] - ++ lib.optional withCage cage - ++ lib.optional withKwin kdePackages.kwin - ++ lib.optional withMutter gnome.mutter - ++ lib.optional withDbus dbus; + compositors = [ + weston + ] + ++ lib.optional withCage cage + ++ lib.optional withKwin kdePackages.kwin + ++ lib.optional withMutter gnome.mutter + ++ lib.optional withDbus dbus; in python3.pkgs.buildPythonApplication rec { pname = "xwayland-run"; diff --git a/pkgs/by-name/xx/xxkb/package.nix b/pkgs/by-name/xx/xxkb/package.nix index a0c7d4752508..9bdf44b85b4d 100644 --- a/pkgs/by-name/xx/xxkb/package.nix +++ b/pkgs/by-name/xx/xxkb/package.nix @@ -30,18 +30,17 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - libX11 - libXt - libXext - libXpm - ] - ++ lib.optionals svgSupport [ - librsvg - glib - gdk-pixbuf - ]; + buildInputs = [ + libX11 + libXt + libXext + libXpm + ] + ++ lib.optionals svgSupport [ + librsvg + glib + gdk-pixbuf + ]; outputs = [ "out" diff --git a/pkgs/by-name/xy/xyce/package.nix b/pkgs/by-name/xy/xyce/package.nix index 137ea22ce0ec..56fa6243fdeb 100644 --- a/pkgs/by-name/xy/xyce/package.nix +++ b/pkgs/by-name/xy/xyce/package.nix @@ -62,44 +62,42 @@ stdenv.mkDerivation rec { preConfigure = "./bootstrap"; - configureFlags = - [ - "CXXFLAGS=-O3" - "--enable-xyce-shareable" - "--enable-shared" - "--enable-stokhos" - "--enable-amesos2" - ] - ++ lib.optionals withMPI [ - "--enable-mpi" - "CXX=mpicxx" - "CC=mpicc" - "F77=mpif77" - ]; + configureFlags = [ + "CXXFLAGS=-O3" + "--enable-xyce-shareable" + "--enable-shared" + "--enable-stokhos" + "--enable-amesos2" + ] + ++ lib.optionals withMPI [ + "--enable-mpi" + "CXX=mpicxx" + "CC=mpicc" + "F77=mpif77" + ]; enableParallelBuilding = true; - nativeBuildInputs = - [ - autoconf - automake - gfortran - libtool_2 - ] - ++ lib.optionals enableDocs [ - (texliveMedium.withPackages ( - ps: with ps; [ - enumitem - koma-script - optional - framed - enumitem - multirow - newtx - preprint - ] - )) - ]; + nativeBuildInputs = [ + autoconf + automake + gfortran + libtool_2 + ] + ++ lib.optionals enableDocs [ + (texliveMedium.withPackages ( + ps: with ps; [ + enumitem + koma-script + optional + framed + enumitem + multirow + newtx + preprint + ] + )) + ]; buildInputs = [ bison @@ -109,7 +107,8 @@ stdenv.mkDerivation rec { lapack suitesparse trilinos - ] ++ lib.optionals withMPI [ mpi ]; + ] + ++ lib.optionals withMPI [ mpi ]; doCheck = enableTests; @@ -128,21 +127,20 @@ stdenv.mkDerivation rec { popd ''; - nativeCheckInputs = - [ - bc - perl - (python3.withPackages ( - ps: with ps; [ - numpy - scipy - ] - )) - ] - ++ lib.optionals withMPI [ - mpi - openssh - ]; + nativeCheckInputs = [ + bc + perl + (python3.withPackages ( + ps: with ps; [ + numpy + scipy + ] + )) + ] + ++ lib.optionals withMPI [ + mpi + openssh + ]; checkPhase = '' XYCE_BINARY="$(pwd)/src/Xyce" diff --git a/pkgs/by-name/ya/yaak/package.nix b/pkgs/by-name/ya/yaak/package.nix index d5fb84a8348d..6cb12c65ac91 100644 --- a/pkgs/by-name/ya/yaak/package.nix +++ b/pkgs/by-name/ya/yaak/package.nix @@ -55,18 +55,17 @@ rustPlatform.buildRustPackage (finalAttrs: { makeWrapper ]; - buildInputs = - [ - glib - gtk3 - openssl - pango - cairo - pixman - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - webkitgtk_4_1 - ]; + buildInputs = [ + glib + gtk3 + openssl + pango + cairo + pixman + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + webkitgtk_4_1 + ]; env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; diff --git a/pkgs/by-name/ya/yabai/package.nix b/pkgs/by-name/ya/yabai/package.nix index 15d7c787e713..492f8f0beb60 100644 --- a/pkgs/by-name/ya/yabai/package.nix +++ b/pkgs/by-name/ya/yabai/package.nix @@ -20,11 +20,12 @@ stdenv.mkDerivation (finalAttrs: { finalAttrs.passthru.sources.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); - nativeBuildInputs = - [ installShellFiles ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - xxd - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + xxd + ]; buildInputs = lib.optionals stdenv.hostPlatform.isx86_64 [ apple-sdk_15 diff --git a/pkgs/by-name/ya/yacreader/package.nix b/pkgs/by-name/ya/yacreader/package.nix index d66f9957aeb1..b020317313a4 100644 --- a/pkgs/by-name/ya/yacreader/package.nix +++ b/pkgs/by-name/ya/yacreader/package.nix @@ -36,18 +36,17 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - libGLU - libsForQt5.poppler - libsForQt5.qtgraphicaleffects # imported, but not declared as a dependency - libsForQt5.qtmultimedia - libsForQt5.qtquickcontrols2 - libunarr - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libsForQt5.qtmacextras # can be removed when using qt6 - ]; + buildInputs = [ + libGLU + libsForQt5.poppler + libsForQt5.qtgraphicaleffects # imported, but not declared as a dependency + libsForQt5.qtmultimedia + libsForQt5.qtquickcontrols2 + libunarr + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libsForQt5.qtmacextras # can be removed when using qt6 + ]; # custom Darwin install instructions taken from the upstream compileOSX.sh script installPhase = lib.optionalString stdenv.hostPlatform.isDarwin '' diff --git a/pkgs/by-name/ya/yambar/package.nix b/pkgs/by-name/ya/yambar/package.nix index c331e20a8d64..dff96effdbf1 100644 --- a/pkgs/by-name/ya/yambar/package.nix +++ b/pkgs/by-name/ya/yambar/package.nix @@ -59,29 +59,28 @@ stdenv.mkDerivation (finalAttrs: { wayland-scanner ]; - buildInputs = - [ - alsa-lib - fcft - json_c - libmpdclient - libyaml - pipewire - pixman - pulseaudio - tllist - udev - ] - ++ lib.optionals (waylandSupport) [ - wayland - wayland-protocols - ] - ++ lib.optionals (x11Support) [ - xcbutil - xcbutilcursor - xcbutilerrors - xcbutilwm - ]; + buildInputs = [ + alsa-lib + fcft + json_c + libmpdclient + libyaml + pipewire + pixman + pulseaudio + tllist + udev + ] + ++ lib.optionals (waylandSupport) [ + wayland + wayland-protocols + ] + ++ lib.optionals (x11Support) [ + xcbutil + xcbutilcursor + xcbutilerrors + xcbutilwm + ]; strictDeps = true; diff --git a/pkgs/by-name/ya/yandex-cloud/package.nix b/pkgs/by-name/ya/yandex-cloud/package.nix index e45cf8ab738a..9a6f8919996c 100644 --- a/pkgs/by-name/ya/yandex-cloud/package.nix +++ b/pkgs/by-name/ya/yandex-cloud/package.nix @@ -36,26 +36,25 @@ stdenv.mkDerivation (finalAttrs: { withShellCompletions && !stdenv.buildPlatform.canExecute stdenv.hostPlatform ) (stdenv.hostPlatform.emulator buildPackages); - installPhase = - '' - runHook preInstall - mkdir -p -- "$out/bin" - cp -- "$src" "$out/bin/yc" - chmod +x -- "$out/bin/yc" - '' - + lib.optionalString withShellCompletions '' - for shell in bash zsh; do - ''${emulator:+"$emulator"} "$out/bin/yc" completion $shell >yc.$shell - installShellCompletion yc.$shell - done - '' - + '' - makeWrapper "$out/bin/yc" "$out/bin/docker-credential-yc" \ - --add-flags --no-user-output \ - --add-flags container \ - --add-flags docker-credential - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p -- "$out/bin" + cp -- "$src" "$out/bin/yc" + chmod +x -- "$out/bin/yc" + '' + + lib.optionalString withShellCompletions '' + for shell in bash zsh; do + ''${emulator:+"$emulator"} "$out/bin/yc" completion $shell >yc.$shell + installShellCompletion yc.$shell + done + '' + + '' + makeWrapper "$out/bin/yc" "$out/bin/docker-credential-yc" \ + --add-flags --no-user-output \ + --add-flags container \ + --add-flags docker-credential + runHook postInstall + ''; passthru = { updateScript = writers.writePython3 "${pname}-updater" { diff --git a/pkgs/by-name/ya/yara-x/package.nix b/pkgs/by-name/ya/yara-x/package.nix index ec042170ae7a..b3431177f4ef 100644 --- a/pkgs/by-name/ya/yara-x/package.nix +++ b/pkgs/by-name/ya/yara-x/package.nix @@ -33,16 +33,15 @@ rustPlatform.buildRustPackage (finalAttrs: { ${rust.envVars.setEnv} cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget} ''; - postInstall = - '' - ${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd yr \ - --bash <($out/bin/yr completion bash) \ - --fish <($out/bin/yr completion fish) \ - --zsh <($out/bin/yr completion zsh) - ''; + postInstall = '' + ${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd yr \ + --bash <($out/bin/yr completion bash) \ + --fish <($out/bin/yr completion fish) \ + --zsh <($out/bin/yr completion zsh) + ''; passthru.tests.version = testers.testVersion { package = yara-x; diff --git a/pkgs/by-name/ya/yara/package.nix b/pkgs/by-name/ya/yara/package.nix index 2e9417d235b5..03ec0d350452 100644 --- a/pkgs/by-name/ya/yara/package.nix +++ b/pkgs/by-name/ya/yara/package.nix @@ -33,13 +33,12 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - protobufc - ] - ++ lib.optionals withCrypto [ openssl ] - ++ lib.optionals enableMagic [ file ] - ++ lib.optionals enableCuckoo [ jansson ]; + buildInputs = [ + protobufc + ] + ++ lib.optionals withCrypto [ openssl ] + ++ lib.optionals enableMagic [ file ] + ++ lib.optionals enableCuckoo [ jansson ]; preConfigure = "./bootstrap.sh"; diff --git a/pkgs/by-name/ya/yarn-berry/package.nix b/pkgs/by-name/ya/yarn-berry/package.nix index 12512d988b2d..ba489fdcf89a 100644 --- a/pkgs/by-name/ya/yarn-berry/package.nix +++ b/pkgs/by-name/ya/yarn-berry/package.nix @@ -60,7 +60,8 @@ stdenv.mkDerivation (finalAttrs: { package = finalAttrs.finalPackage; }; }; - } // (callPackage ./fetcher { yarn-berry = finalAttrs; }); + } + // (callPackage ./fetcher { yarn-berry = finalAttrs; }); meta = with lib; { homepage = "https://yarnpkg.com/"; diff --git a/pkgs/by-name/ya/yay/package.nix b/pkgs/by-name/ya/yay/package.nix index 743e5027f20c..05d4d4f44865 100644 --- a/pkgs/by-name/ya/yay/package.nix +++ b/pkgs/by-name/ya/yay/package.nix @@ -52,15 +52,14 @@ buildGoModule (finalAttrs: { in [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; - postInstall = - '' - installManPage doc/yay.8 - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --name yay.bash --bash completions/bash - installShellCompletion --name yay.fish --fish completions/fish - installShellCompletion --name _yay --zsh completions/zsh - ''; + postInstall = '' + installManPage doc/yay.8 + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --name yay.bash --bash completions/bash + installShellCompletion --name yay.fish --fish completions/fish + installShellCompletion --name _yay --zsh completions/zsh + ''; meta = { description = "AUR Helper written in Go"; diff --git a/pkgs/by-name/yc/ycmd/package.nix b/pkgs/by-name/yc/ycmd/package.nix index 0626f3d2d196..f495114972bb 100644 --- a/pkgs/by-name/yc/ycmd/package.nix +++ b/pkgs/by-name/yc/ycmd/package.nix @@ -36,7 +36,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ninja - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = with python3.pkgs; with llvmPackages; @@ -69,47 +70,46 @@ stdenv.mkDerivation { # to be available # # symlink completion backends where ycmd expects them - installPhase = - '' - rm -rf ycmd/tests - find third_party -type d -name "test" -exec rm -rf {} + + installPhase = '' + rm -rf ycmd/tests + find third_party -type d -name "test" -exec rm -rf {} + - chmod +x ycmd/__main__.py - sed -i "1i #!${python3.interpreter}\ - " ycmd/__main__.py + chmod +x ycmd/__main__.py + sed -i "1i #!${python3.interpreter}\ + " ycmd/__main__.py - mkdir -p $out/lib/ycmd - cp -r ycmd/ CORE_VERSION *.so* *.dylib* $out/lib/ycmd/ + mkdir -p $out/lib/ycmd + cp -r ycmd/ CORE_VERSION *.so* *.dylib* $out/lib/ycmd/ - mkdir -p $out/bin - ln -s $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd + mkdir -p $out/bin + ln -s $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd - # Copy everything: the structure of third_party has been known to change. - # When linking our own libraries below, do so with '-f' - # to clobber anything we may have copied here. - mkdir -p $out/lib/ycmd/third_party - cp -r third_party/* $out/lib/ycmd/third_party/ + # Copy everything: the structure of third_party has been known to change. + # When linking our own libraries below, do so with '-f' + # to clobber anything we may have copied here. + mkdir -p $out/lib/ycmd/third_party + cp -r third_party/* $out/lib/ycmd/third_party/ - '' - + lib.optionalString withGodef '' - TARGET=$out/lib/ycmd/third_party/godef - mkdir -p $TARGET - ln -sf ${godef}/bin/godef $TARGET - '' - + lib.optionalString withGopls '' - TARGET=$out/lib/ycmd/third_party/go/bin - mkdir -p $TARGET - ln -sf ${gopls}/bin/gopls $TARGET - '' - + lib.optionalString withRustAnalyzer '' - TARGET=$out/lib/ycmd/third_party/rust-analyzer - mkdir -p $TARGET - ln -sf ${rust-analyzer} $TARGET - '' - + lib.optionalString withTypescript '' - TARGET=$out/lib/ycmd/third_party/tsserver - ln -sf ${typescript} $TARGET - ''; + '' + + lib.optionalString withGodef '' + TARGET=$out/lib/ycmd/third_party/godef + mkdir -p $TARGET + ln -sf ${godef}/bin/godef $TARGET + '' + + lib.optionalString withGopls '' + TARGET=$out/lib/ycmd/third_party/go/bin + mkdir -p $TARGET + ln -sf ${gopls}/bin/gopls $TARGET + '' + + lib.optionalString withRustAnalyzer '' + TARGET=$out/lib/ycmd/third_party/rust-analyzer + mkdir -p $TARGET + ln -sf ${rust-analyzer} $TARGET + '' + + lib.optionalString withTypescript '' + TARGET=$out/lib/ycmd/third_party/tsserver + ln -sf ${typescript} $TARGET + ''; # fixup the argv[0] and replace __file__ with the corresponding path so # python won't be thrown off by argv[0] diff --git a/pkgs/by-name/yd/yder/package.nix b/pkgs/by-name/yd/yder/package.nix index 3afa7ef07ae8..4edadd07fbac 100644 --- a/pkgs/by-name/yd/yder/package.nix +++ b/pkgs/by-name/yd/yder/package.nix @@ -38,7 +38,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_YDER_TESTING=on" - ] ++ lib.optional (!withSystemd) "-DWITH_JOURNALD=off"; + ] + ++ lib.optional (!withSystemd) "-DWITH_JOURNALD=off"; doCheck = true; diff --git a/pkgs/by-name/ye/yersinia/package.nix b/pkgs/by-name/ye/yersinia/package.nix index c0c809ace1f2..e2717c3c6fcc 100644 --- a/pkgs/by-name/ye/yersinia/package.nix +++ b/pkgs/by-name/ye/yersinia/package.nix @@ -33,17 +33,17 @@ stdenv.mkDerivation { libpcap libnet ncurses - ] ++ lib.optional withGtk gtk2; + ] + ++ lib.optional withGtk gtk2; autoreconfPhase = "./autogen.sh"; - configureFlags = - [ - "--with-pcap-includes=${libpcap}/include" - "--with-libnet-includes=${libnet}/include" - ] - ++ lib.optional (!enableAdmin) "--disable-admin" - ++ lib.optional (!withGtk) "--disable-gtk"; + configureFlags = [ + "--with-pcap-includes=${libpcap}/include" + "--with-libnet-includes=${libnet}/include" + ] + ++ lib.optional (!enableAdmin) "--disable-admin" + ++ lib.optional (!withGtk) "--disable-gtk"; makeFlags = [ "LDFLAGS=-lncurses" ]; diff --git a/pkgs/by-name/yg/ygot/package.nix b/pkgs/by-name/yg/ygot/package.nix index 583ce843ee1c..ec6c82c4dc94 100644 --- a/pkgs/by-name/yg/ygot/package.nix +++ b/pkgs/by-name/yg/ygot/package.nix @@ -29,23 +29,22 @@ buildGoModule (finalAttrs: { nativeBuildInputs = [ installShellFiles ]; - postInstall = + postInstall = '' + # The normal binary names are far too generic + mv $out/bin/generator $out/bin/ygot_generator + mv $out/bin/proto_generator $out/bin/ygot_proto_generator + '' + + lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( + let + emulator = stdenv.hostPlatform.emulator buildPackages; + in '' - # The normal binary names are far too generic - mv $out/bin/generator $out/bin/ygot_generator - mv $out/bin/proto_generator $out/bin/ygot_proto_generator + installShellCompletion --cmd gnmidiff \ + --bash <(${emulator} $out/bin/gnmidiff completion bash) \ + --zsh <(${emulator} $out/bin/gnmidiff completion zsh) \ + --fish <(${emulator} $out/bin/gnmidiff completion fish) '' - + lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( - let - emulator = stdenv.hostPlatform.emulator buildPackages; - in - '' - installShellCompletion --cmd gnmidiff \ - --bash <(${emulator} $out/bin/gnmidiff completion bash) \ - --zsh <(${emulator} $out/bin/gnmidiff completion zsh) \ - --fish <(${emulator} $out/bin/gnmidiff completion fish) - '' - ); + ); passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/yo/yoda/package.nix b/pkgs/by-name/yo/yoda/package.nix index 07f87fa461d2..79ee27477386 100644 --- a/pkgs/by-name/yo/yoda/package.nix +++ b/pkgs/by-name/yo/yoda/package.nix @@ -29,13 +29,14 @@ stdenv.mkDerivation rec { makeWrapper ]; - buildInputs = - [ python3 ] - ++ (with python3.pkgs; [ - numpy - matplotlib - ]) - ++ lib.optionals withRootSupport [ root ]; + buildInputs = [ + python3 + ] + ++ (with python3.pkgs; [ + numpy + matplotlib + ]) + ++ lib.optionals withRootSupport [ root ]; propagatedBuildInputs = [ zlib ]; diff --git a/pkgs/by-name/yo/yosys/package.nix b/pkgs/by-name/yo/yosys/package.nix index 4a765d71b81c..66107035aec5 100644 --- a/pkgs/by-name/yo/yosys/package.nix +++ b/pkgs/by-name/yo/yosys/package.nix @@ -80,7 +80,8 @@ let allPlugins = { bluespec = yosys-bluespec; ghdl = yosys-ghdl; - } // (yosys-symbiflow); + } + // (yosys-symbiflow); in stdenv.mkDerivation (finalAttrs: { @@ -115,21 +116,20 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - propagatedBuildInputs = - [ - libffi - readline - tcl - zlib - (python3.withPackages ( - pp: with pp; [ - click - ] - )) - ] - ++ lib.optionals enablePython [ - python3.pkgs.boost - ]; + propagatedBuildInputs = [ + libffi + readline + tcl + zlib + (python3.withPackages ( + pp: with pp; [ + click + ] + )) + ] + ++ lib.optionals enablePython [ + python3.pkgs.boost + ]; makeFlags = [ "PREFIX=${placeholder "out"}" ]; @@ -145,21 +145,20 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs tests ./misc/yosys-config.in ''; - preBuild = - '' - chmod -R u+w . - make config-${if stdenv.cc.isClang or false then "clang" else "gcc"} + preBuild = '' + chmod -R u+w . + make config-${if stdenv.cc.isClang or false then "clang" else "gcc"} - if ! grep -q "YOSYS_VER := $version" Makefile; then - echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package (allegedly ${finalAttrs.version}), failing." - exit 1 - fi - '' - + lib.optionalString enablePython '' - echo "ENABLE_PYOSYS := 1" >> Makefile.conf - echo "PYTHON_DESTDIR := $out/${python3.sitePackages}" >> Makefile.conf - echo "BOOST_PYTHON_LIB := -lboost_python${lib.versions.major python3.version}${lib.versions.minor python3.version}" >> Makefile.conf - ''; + if ! grep -q "YOSYS_VER := $version" Makefile; then + echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package (allegedly ${finalAttrs.version}), failing." + exit 1 + fi + '' + + lib.optionalString enablePython '' + echo "ENABLE_PYOSYS := 1" >> Makefile.conf + echo "PYTHON_DESTDIR := $out/${python3.sitePackages}" >> Makefile.conf + echo "BOOST_PYTHON_LIB := -lboost_python${lib.versions.major python3.version}${lib.versions.minor python3.version}" >> Makefile.conf + ''; preCheck = '' # autotest.sh automatically compiles a utility during startup if it's out of date. diff --git a/pkgs/by-name/yt/yt-dlp/package.nix b/pkgs/by-name/yt/yt-dlp/package.nix index f1264b22cf1f..fac030114823 100644 --- a/pkgs/by-name/yt/yt-dlp/package.nix +++ b/pkgs/by-name/yt/yt-dlp/package.nix @@ -92,20 +92,19 @@ python3Packages.buildPythonApplication rec { # Requires network doCheck = false; - postInstall = - '' - installManPage yt-dlp.1 + postInstall = '' + installManPage yt-dlp.1 - installShellCompletion \ - --bash completions/bash/yt-dlp \ - --fish completions/fish/yt-dlp.fish \ - --zsh completions/zsh/_yt-dlp + installShellCompletion \ + --bash completions/bash/yt-dlp \ + --fish completions/fish/yt-dlp.fish \ + --zsh completions/zsh/_yt-dlp - install -Dm644 Changelog.md README.md -t "$out/share/doc/yt_dlp" - '' - + lib.optionalString withAlias '' - ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl" - ''; + install -Dm644 Changelog.md README.md -t "$out/share/doc/yt_dlp" + '' + + lib.optionalString withAlias '' + ln -s "$out/bin/yt-dlp" "$out/bin/youtube-dl" + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/yt/ytmdesktop/package.nix b/pkgs/by-name/yt/ytmdesktop/package.nix index cf09525f72f6..557cf06cf2e1 100644 --- a/pkgs/by-name/yt/ytmdesktop/package.nix +++ b/pkgs/by-name/yt/ytmdesktop/package.nix @@ -92,34 +92,33 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' + installPhase = '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p "$out"/share/ytmdesktop - cp -r out/*/{locales,resources{,.pak}} "$out"/share/ytmdesktop + mkdir -p "$out"/share/ytmdesktop + cp -r out/*/{locales,resources{,.pak}} "$out"/share/ytmdesktop - install -Dm644 src/assets/icons/ytmd.png "$out"/share/pixmaps/ytmdesktop.png + install -Dm644 src/assets/icons/ytmd.png "$out"/share/pixmaps/ytmdesktop.png - makeWrapper ${lib.getExe electron} "$out"/bin/ytmdesktop \ - --add-flags "$out"/share/ytmdesktop/resources/app.asar \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --add-flags ${lib.escapeShellArg commandLineArgs} - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r out/*/"YouTube Music Desktop App".app "$out"/Applications + makeWrapper ${lib.getExe electron} "$out"/bin/ytmdesktop \ + --add-flags "$out"/share/ytmdesktop/resources/app.asar \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --add-flags ${lib.escapeShellArg commandLineArgs} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r out/*/"YouTube Music Desktop App".app "$out"/Applications - wrapProgram "$out"/Applications/"YouTube Music Desktop App".app/Contents/MacOS/youtube-music-desktop-app \ - --add-flags ${lib.escapeShellArg commandLineArgs} + wrapProgram "$out"/Applications/"YouTube Music Desktop App".app/Contents/MacOS/youtube-music-desktop-app \ + --add-flags ${lib.escapeShellArg commandLineArgs} - makeWrapper "$out"/Applications/"YouTube Music Desktop App".app/Contents/MacOS/youtube-music-desktop-app "$out"/bin/ytmdesktop - '' - + '' - runHook postInstall - ''; + makeWrapper "$out"/Applications/"YouTube Music Desktop App".app/Contents/MacOS/youtube-music-desktop-app "$out"/bin/ytmdesktop + '' + + '' + runHook postInstall + ''; desktopItems = [ (makeDesktopItem { diff --git a/pkgs/by-name/yu/yubico-piv-tool/package.nix b/pkgs/by-name/yu/yubico-piv-tool/package.nix index 984b869c7503..0f16312e0bb9 100644 --- a/pkgs/by-name/yu/yubico-piv-tool/package.nix +++ b/pkgs/by-name/yu/yubico-piv-tool/package.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ openssl zlib - ] ++ lib.optionals (!withApplePCSC) [ pcsclite ]; + ] + ++ lib.optionals (!withApplePCSC) [ pcsclite ]; cmakeFlags = [ (lib.cmakeBool "GENERATE_MAN_PAGES" true) diff --git a/pkgs/by-name/yu/yubihsm-shell/package.nix b/pkgs/by-name/yu/yubihsm-shell/package.nix index 026c069f7978..3a7bf5564bfc 100644 --- a/pkgs/by-name/yu/yubihsm-shell/package.nix +++ b/pkgs/by-name/yu/yubihsm-shell/package.nix @@ -42,19 +42,18 @@ stdenv.mkDerivation rec { gengetopt ]; - buildInputs = - [ - libusb1 - libedit - curl - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - pcsclite.dev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + libusb1 + libedit + curl + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + pcsclite.dev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; preBuild = lib.optionalString stdenv.hostPlatform.isLinux '' NIX_CFLAGS_COMPILE="$(pkg-config --cflags libpcsclite) $NIX_CFLAGS_COMPILE" diff --git a/pkgs/by-name/z3/z3/package.nix b/pkgs/by-name/z3/z3/package.nix index dba0c810ca1a..d50683753038 100644 --- a/pkgs/by-name/z3/z3/package.nix +++ b/pkgs/by-name/z3/z3/package.nix @@ -44,19 +44,20 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ python3Packages.python ] - ++ lib.optionals pythonBindings [ python3Packages.setuptools ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ] - ++ lib.optionals javaBindings [ jdk ] - ++ lib.optionals ocamlBindings [ - ocaml - findlib - ] - ++ lib.optionals useCmakeBuild [ - cmake - ninja - ]; + nativeBuildInputs = [ + python3Packages.python + ] + ++ lib.optionals pythonBindings [ python3Packages.setuptools ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ] + ++ lib.optionals javaBindings [ jdk ] + ++ lib.optionals ocamlBindings [ + ocaml + findlib + ] + ++ lib.optionals useCmakeBuild [ + cmake + ninja + ]; propagatedBuildInputs = lib.optionals ocamlBindings [ zarith ]; enableParallelBuilding = true; @@ -81,27 +82,26 @@ stdenv.mkDerivation (finalAttrs: { runHook postConfigure ''; - cmakeFlags = - [ - (lib.cmakeBool "Z3_BUILD_PYTHON_BINDINGS" pythonBindings) - (lib.cmakeBool "Z3_INSTALL_PYTHON_BINDINGS" pythonBindings) - (lib.cmakeBool "Z3_BUILD_JAVA_BINDINGS" javaBindings) - (lib.cmakeBool "Z3_INSTALL_JAVA_BINDINGS" javaBindings) - (lib.cmakeBool "Z3_BUILD_OCAML_BINDINGS" ocamlBindings) # FIXME: ocaml does not properly install build output on cmake - (lib.cmakeBool "Z3_SINGLE_THREADED" (!finalAttrs.enableParallelBuilding)) - (lib.cmakeBool "Z3_BUILD_LIBZ3_SHARED" (!stdenv.hostPlatform.isStatic)) - (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "out")) - (lib.cmakeBool "Z3_BUILD_TEST_EXECUTABLES" finalAttrs.doCheck) - (lib.cmakeBool "Z3_ENABLE_EXAMPLE_TARGETS" false) - ] - ++ lib.optionals pythonBindings [ - (lib.cmakeFeature "CMAKE_INSTALL_PYTHON_PKG_DIR" "${placeholder "python"}/${python3Packages.python.sitePackages}") - (lib.cmakeFeature "Python3_EXECUTABLE" "${lib.getExe python3Packages.python}") - ] - ++ lib.optionals javaBindings [ - (lib.cmakeFeature "Z3_JAVA_JNI_LIB_INSTALLDIR" "${placeholder "java"}/lib") - (lib.cmakeFeature "Z3_JAVA_JAR_INSTALLDIR" "${placeholder "java"}/share/java") - ]; + cmakeFlags = [ + (lib.cmakeBool "Z3_BUILD_PYTHON_BINDINGS" pythonBindings) + (lib.cmakeBool "Z3_INSTALL_PYTHON_BINDINGS" pythonBindings) + (lib.cmakeBool "Z3_BUILD_JAVA_BINDINGS" javaBindings) + (lib.cmakeBool "Z3_INSTALL_JAVA_BINDINGS" javaBindings) + (lib.cmakeBool "Z3_BUILD_OCAML_BINDINGS" ocamlBindings) # FIXME: ocaml does not properly install build output on cmake + (lib.cmakeBool "Z3_SINGLE_THREADED" (!finalAttrs.enableParallelBuilding)) + (lib.cmakeBool "Z3_BUILD_LIBZ3_SHARED" (!stdenv.hostPlatform.isStatic)) + (lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "out")) + (lib.cmakeBool "Z3_BUILD_TEST_EXECUTABLES" finalAttrs.doCheck) + (lib.cmakeBool "Z3_ENABLE_EXAMPLE_TARGETS" false) + ] + ++ lib.optionals pythonBindings [ + (lib.cmakeFeature "CMAKE_INSTALL_PYTHON_PKG_DIR" "${placeholder "python"}/${python3Packages.python.sitePackages}") + (lib.cmakeFeature "Python3_EXECUTABLE" "${lib.getExe python3Packages.python}") + ] + ++ lib.optionals javaBindings [ + (lib.cmakeFeature "Z3_JAVA_JNI_LIB_INSTALLDIR" "${placeholder "java"}/lib") + (lib.cmakeFeature "Z3_JAVA_JAR_INSTALLDIR" "${placeholder "java"}/share/java") + ]; doCheck = true; checkPhase = '' @@ -141,21 +141,21 @@ stdenv.mkDerivation (finalAttrs: { nativeInstallCheckInputs = [ versionCheckHook - ] ++ lib.optionals pythonBindings [ python3Packages.pythonImportsCheckHook ]; + ] + ++ lib.optionals pythonBindings [ python3Packages.pythonImportsCheckHook ]; pythonImportsCheck = [ "z3" ]; - outputs = - [ - "out" - "lib" - "dev" - ] - ++ lib.optionals pythonBindings [ "python" ] - ++ lib.optionals javaBindings [ "java" ] - ++ lib.optionals ocamlBindings [ "ocaml" ]; + outputs = [ + "out" + "lib" + "dev" + ] + ++ lib.optionals pythonBindings [ "python" ] + ++ lib.optionals javaBindings [ "java" ] + ++ lib.optionals ocamlBindings [ "ocaml" ]; passthru = { updateScript = nix-update-script { diff --git a/pkgs/by-name/z8/z88dk/package.nix b/pkgs/by-name/z8/z88dk/package.nix index 80dab21136ee..286d102d24a7 100644 --- a/pkgs/by-name/z8/z88dk/package.nix +++ b/pkgs/by-name/z8/z88dk/package.nix @@ -60,16 +60,15 @@ let url = "mirror://cpan/authors/id/P/PS/PSCUST/Asm-Preproc-1.03.tar.gz"; hash = "sha256-pVTpIqGxZpBxZlAbXuGDapuOxsp3uM/AM5dKUxlej1M="; }; - propagatedBuildInputs = - [ - IteratorSimpleLookahead - ] - ++ (with perlPackages; [ - IteratorSimple - TextTemplate - DataDump - FileSlurp - ]); + propagatedBuildInputs = [ + IteratorSimpleLookahead + ] + ++ (with perlPackages; [ + IteratorSimple + TextTemplate + DataDump + FileSlurp + ]); meta = { description = "Preprocessor to be called from an assembler"; license = with lib.licenses; [ @@ -86,14 +85,15 @@ let url = "mirror://cpan/authors/id/P/PS/PSCUST/CPU-Z80-Assembler-2.25.tar.gz"; hash = "sha256-cJ8Fl2KZw9/bnBDUzFuwwdw9x23OUvcftk78kw7abdU="; }; - buildInputs = - [ AsmPreproc ] - ++ (with perlPackages; [ - CaptureTiny - RegexpTrie - PathTiny - ClassAccessor - ]); + buildInputs = [ + AsmPreproc + ] + ++ (with perlPackages; [ + CaptureTiny + RegexpTrie + PathTiny + ClassAccessor + ]); meta = { description = "Functions to assemble a set of Z80 assembly instructions"; license = with lib.licenses; [ @@ -156,29 +156,28 @@ stdenv.mkDerivation (finalAttrs: { "git_count=0" ]; - nativeBuildInputs = - [ - which - unzip - m4 - perl - pkg-config + nativeBuildInputs = [ + which + unzip + m4 + perl + pkg-config - # Local perl packages - AsmPreproc - CPUZ80Assembler - ObjectTinyRW - ] - ++ (with perlPackages; [ - CaptureTiny - DataHexDump - ModernPerl - PathTiny - RegexpCommon - TestHexDifferences - TextDiff - RegexpTrie - ]); + # Local perl packages + AsmPreproc + CPUZ80Assembler + ObjectTinyRW + ] + ++ (with perlPackages; [ + CaptureTiny + DataHexDump + ModernPerl + PathTiny + RegexpCommon + TestHexDifferences + TextDiff + RegexpTrie + ]); buildInputs = [ libxml2 diff --git a/pkgs/by-name/za/zap-chip/package.nix b/pkgs/by-name/za/zap-chip/package.nix index b3e400b0a544..c3f480105e65 100644 --- a/pkgs/by-name/za/zap-chip/package.nix +++ b/pkgs/by-name/za/zap-chip/package.nix @@ -59,28 +59,27 @@ buildNpmPackage rec { nativeBuildInputs = [ makeWrapper ]; - postInstall = - '' - # this file is also used at runtime - install -m644 .version.json $out/lib/node_modules/zap/ - '' - + lib.optionalString (!withGui) '' - # home-assistant chip-* python packages need the executable under the name zap-cli - mv $out/bin/zap $out/bin/zap-cli - '' - + lib.optionalString withGui '' - pushd dist/linux-*unpacked - mkdir -p $out/opt/zap-chip - cp -r locales resources{,.pak} $out/opt/zap-chip - popd + postInstall = '' + # this file is also used at runtime + install -m644 .version.json $out/lib/node_modules/zap/ + '' + + lib.optionalString (!withGui) '' + # home-assistant chip-* python packages need the executable under the name zap-cli + mv $out/bin/zap $out/bin/zap-cli + '' + + lib.optionalString withGui '' + pushd dist/linux-*unpacked + mkdir -p $out/opt/zap-chip + cp -r locales resources{,.pak} $out/opt/zap-chip + popd - rm $out/bin/zap - makeWrapper '${lib.getExe electron}' "$out/bin/zap" \ - --add-flags $out/opt/zap-chip/resources/app.asar \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ - --set-default ELECTRON_IS_DEV 0 \ - --inherit-argv0 - ''; + rm $out/bin/zap + makeWrapper '${lib.getExe electron}' "$out/bin/zap" \ + --add-flags $out/opt/zap-chip/resources/app.asar \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ + --set-default ELECTRON_IS_DEV 0 \ + --inherit-argv0 + ''; meta = { description = "Generic generation engine and user interface for applications and libraries based on Zigbee Cluster Library (ZCL)"; diff --git a/pkgs/by-name/zc/zchunk/package.nix b/pkgs/by-name/zc/zchunk/package.nix index 6f1c049e29be..3499eaf5a10c 100644 --- a/pkgs/by-name/zc/zchunk/package.nix +++ b/pkgs/by-name/zc/zchunk/package.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ curl zstd - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ argp-standalone ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ argp-standalone ]; outputs = [ "out" diff --git a/pkgs/by-name/ze/zed-editor/package.nix b/pkgs/by-name/ze/zed-editor/package.nix index 8e067a82ce85..0056b3b8a506 100644 --- a/pkgs/by-name/ze/zed-editor/package.nix +++ b/pkgs/by-name/ze/zed-editor/package.nix @@ -101,11 +101,12 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "zed-editor"; version = "0.195.5"; - outputs = - [ "out" ] - ++ lib.optionals buildRemoteServer [ - "remote_server" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildRemoteServer [ + "remote_server" + ]; src = fetchFromGitHub { owner = "zed-industries"; @@ -140,54 +141,53 @@ rustPlatform.buildRustPackage (finalAttrs: { useFetchCargoVendor = true; cargoHash = "sha256-A/oBHbt8prQyR15n77b/VHlz/wO2lxFp7M/OOZt3jHU="; - nativeBuildInputs = - [ - cmake - copyDesktopItems - curl - perl - pkg-config - protobuf - rustPlatform.bindgenHook - cargo-about - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ makeBinaryWrapper ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ cargo-bundle ]; + nativeBuildInputs = [ + cmake + copyDesktopItems + curl + perl + pkg-config + protobuf + rustPlatform.bindgenHook + cargo-about + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ makeBinaryWrapper ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cargo-bundle ]; dontUseCmakeConfigure = true; - buildInputs = - [ - curl - fontconfig - freetype - libgit2 - openssl - sqlite - zlib - zstd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libxkbcommon - wayland - xorg.libxcb - # required by livekit: - libGL - libX11 - libXext - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_15 - # ScreenCaptureKit, required by livekit, is only available on 12.3 and up: - # https://developer.apple.com/documentation/screencapturekit - (darwinMinVersionHook "12.3") - ]; + buildInputs = [ + curl + fontconfig + freetype + libgit2 + openssl + sqlite + zlib + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + libxkbcommon + wayland + xorg.libxcb + # required by livekit: + libGL + libX11 + libXext + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_15 + # ScreenCaptureKit, required by livekit, is only available on 12.3 and up: + # https://developer.apple.com/documentation/screencapturekit + (darwinMinVersionHook "12.3") + ]; cargoBuildFlags = [ "--package=zed" "--package=cli" - ] ++ lib.optionals buildRemoteServer [ "--package=remote_server" ]; + ] + ++ lib.optionals buildRemoteServer [ "--package=remote_server" ]; # Required on darwin because we don't have access to the # proprietary Metal shader compiler. @@ -226,83 +226,81 @@ rustPlatform.buildRustPackage (finalAttrs: { writableTmpDirAsHomeHook ]; - checkFlags = - [ - # Flaky: unreliably fails on certain hosts (including Hydra) - "--skip=zed::tests::test_window_edit_state_restoring_enabled" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Flaky: unreliably fails on certain hosts (including Hydra) - "--skip=zed::open_listener::tests::test_open_workspace_with_directory" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Fails on certain hosts (including Hydra) for unclear reason - "--skip=test_open_paths_action" - ]; + checkFlags = [ + # Flaky: unreliably fails on certain hosts (including Hydra) + "--skip=zed::tests::test_window_edit_state_restoring_enabled" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Flaky: unreliably fails on certain hosts (including Hydra) + "--skip=zed::open_listener::tests::test_open_workspace_with_directory" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # Fails on certain hosts (including Hydra) for unclear reason + "--skip=test_open_paths_action" + ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - release_target="target/${stdenv.hostPlatform.rust.cargoShortTarget}/release" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # cargo-bundle expects the binary in target/release - mv $release_target/zed target/release/zed + release_target="target/${stdenv.hostPlatform.rust.cargoShortTarget}/release" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # cargo-bundle expects the binary in target/release + mv $release_target/zed target/release/zed - pushd crates/zed + pushd crates/zed - # Note that this is GNU sed, while Zed's bundle-mac uses BSD sed - sed -i "s/package.metadata.bundle-stable/package.metadata.bundle/" Cargo.toml - export CARGO_BUNDLE_SKIP_BUILD=true - app_path=$(cargo bundle --release | xargs) + # Note that this is GNU sed, while Zed's bundle-mac uses BSD sed + sed -i "s/package.metadata.bundle-stable/package.metadata.bundle/" Cargo.toml + export CARGO_BUNDLE_SKIP_BUILD=true + app_path=$(cargo bundle --release | xargs) - # We're not using Zed's fork of cargo-bundle, so we must manually append their plist extensions - # Remove closing tags from Info.plist (last two lines) - head -n -2 $app_path/Contents/Info.plist > Info.plist - # Append extensions - cat resources/info/*.plist >> Info.plist - # Add closing tags - printf "\n\n" >> Info.plist - mv Info.plist $app_path/Contents/Info.plist + # We're not using Zed's fork of cargo-bundle, so we must manually append their plist extensions + # Remove closing tags from Info.plist (last two lines) + head -n -2 $app_path/Contents/Info.plist > Info.plist + # Append extensions + cat resources/info/*.plist >> Info.plist + # Add closing tags + printf "\n\n" >> Info.plist + mv Info.plist $app_path/Contents/Info.plist - popd + popd - mkdir -p $out/Applications $out/bin - # Zed expects git next to its own binary - ln -s ${lib.getExe git} $app_path/Contents/MacOS/git - mv $release_target/cli $app_path/Contents/MacOS/cli - mv $app_path $out/Applications/ + mkdir -p $out/Applications $out/bin + # Zed expects git next to its own binary + ln -s ${lib.getExe git} $app_path/Contents/MacOS/git + mv $release_target/cli $app_path/Contents/MacOS/cli + mv $app_path $out/Applications/ - # Physical location of the CLI must be inside the app bundle as this is used - # to determine which app to start - ln -s $out/Applications/Zed.app/Contents/MacOS/cli $out/bin/zeditor - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -Dm755 $release_target/zed $out/libexec/zed-editor - install -Dm755 $release_target/cli $out/bin/zeditor + # Physical location of the CLI must be inside the app bundle as this is used + # to determine which app to start + ln -s $out/Applications/Zed.app/Contents/MacOS/cli $out/bin/zeditor + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -Dm755 $release_target/zed $out/libexec/zed-editor + install -Dm755 $release_target/cli $out/bin/zeditor - install -Dm644 $src/crates/zed/resources/app-icon@2x.png $out/share/icons/hicolor/1024x1024@2x/apps/zed.png - install -Dm644 $src/crates/zed/resources/app-icon.png $out/share/icons/hicolor/512x512/apps/zed.png + install -Dm644 $src/crates/zed/resources/app-icon@2x.png $out/share/icons/hicolor/1024x1024@2x/apps/zed.png + install -Dm644 $src/crates/zed/resources/app-icon.png $out/share/icons/hicolor/512x512/apps/zed.png - # extracted from https://github.com/zed-industries/zed/blob/v0.141.2/script/bundle-linux (envsubst) - # and https://github.com/zed-industries/zed/blob/v0.141.2/script/install.sh (final desktop file name) - ( - export DO_STARTUP_NOTIFY="true" - export APP_CLI="zeditor" - export APP_ICON="zed" - export APP_NAME="Zed" - export APP_ARGS="%U" - mkdir -p "$out/share/applications" - ${lib.getExe envsubst} < "crates/zed/resources/zed.desktop.in" > "$out/share/applications/dev.zed.Zed.desktop" - ) - '' - + lib.optionalString buildRemoteServer '' - install -Dm755 $release_target/remote_server $remote_server/bin/zed-remote-server-stable-$version - '' - + '' - runHook postInstall - ''; + # extracted from https://github.com/zed-industries/zed/blob/v0.141.2/script/bundle-linux (envsubst) + # and https://github.com/zed-industries/zed/blob/v0.141.2/script/install.sh (final desktop file name) + ( + export DO_STARTUP_NOTIFY="true" + export APP_CLI="zeditor" + export APP_ICON="zed" + export APP_NAME="Zed" + export APP_ARGS="%U" + mkdir -p "$out/share/applications" + ${lib.getExe envsubst} < "crates/zed/resources/zed.desktop.in" > "$out/share/applications/dev.zed.Zed.desktop" + ) + '' + + lib.optionalString buildRemoteServer '' + install -Dm755 $release_target/remote_server $remote_server/bin/zed-remote-server-stable-$version + '' + + '' + runHook postInstall + ''; nativeInstallCheckInputs = [ versionCheckHook @@ -325,16 +323,15 @@ rustPlatform.buildRustPackage (finalAttrs: { zed-editor = finalAttrs.finalPackage; additionalPkgs = f; }; - tests = - { - remoteServerVersion = testers.testVersion { - package = finalAttrs.finalPackage.remote_server; - command = "zed-remote-server-stable-${finalAttrs.version} version"; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - withGles = zed-editor.override { withGLES = true; }; + tests = { + remoteServerVersion = testers.testVersion { + package = finalAttrs.finalPackage.remote_server; + command = "zed-remote-server-stable-${finalAttrs.version} version"; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + withGles = zed-editor.override { withGLES = true; }; + }; }; meta = { diff --git a/pkgs/by-name/ze/zeek/package.nix b/pkgs/by-name/ze/zeek/package.nix index f2040d9ba2da..249a2e9000a0 100644 --- a/pkgs/by-name/ze/zeek/package.nix +++ b/pkgs/by-name/ze/zeek/package.nix @@ -52,44 +52,42 @@ stdenv.mkDerivation (finalAttrs: { swig ]; - buildInputs = - [ - broker - curl - gperftools - libmaxminddb - libpcap - ncurses - openssl - zlib - python - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libkqueue - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gettext - ]; + buildInputs = [ + broker + curl + gperftools + libmaxminddb + libpcap + ncurses + openssl + zlib + python + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libkqueue + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gettext + ]; postPatch = '' patchShebangs ./ci/collect-repo-info.py patchShebangs ./auxil/spicy/scripts ''; - cmakeFlags = - [ - "-DBroker_ROOT=${broker}" - "-DENABLE_PERFTOOLS=true" - "-DINSTALL_AUX_TOOLS=true" - "-DZEEK_ETC_INSTALL_DIR=/etc/zeek" - "-DZEEK_LOG_DIR=/var/log/zeek" - "-DZEEK_STATE_DIR=/var/lib/zeek" - "-DZEEK_SPOOL_DIR=/var/spool/zeek" - "-DDISABLE_JAVASCRIPT=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DLIBKQUEUE_ROOT_DIR=${libkqueue}" - ]; + cmakeFlags = [ + "-DBroker_ROOT=${broker}" + "-DENABLE_PERFTOOLS=true" + "-DINSTALL_AUX_TOOLS=true" + "-DZEEK_ETC_INSTALL_DIR=/etc/zeek" + "-DZEEK_LOG_DIR=/var/log/zeek" + "-DZEEK_STATE_DIR=/var/lib/zeek" + "-DZEEK_SPOOL_DIR=/var/spool/zeek" + "-DDISABLE_JAVASCRIPT=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DLIBKQUEUE_ROOT_DIR=${libkqueue}" + ]; postInstall = '' for file in $out/share/zeek/base/frameworks/notice/actions/pp-alarms.zeek $out/share/zeek/base/frameworks/notice/main.zeek; do diff --git a/pkgs/by-name/ze/zeitgeist/package.nix b/pkgs/by-name/ze/zeitgeist/package.nix index 6ae5a7341be9..186d555761f2 100644 --- a/pkgs/by-name/ze/zeitgeist/package.nix +++ b/pkgs/by-name/ze/zeitgeist/package.nix @@ -28,7 +28,8 @@ stdenv.mkDerivation rec { "lib" "dev" "man" - ] ++ lib.optional pythonSupport "py"; + ] + ++ lib.optional pythonSupport "py"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; diff --git a/pkgs/by-name/ze/zellij/package.nix b/pkgs/by-name/ze/zellij/package.nix index f699b9a18441..8ff5788648ef 100644 --- a/pkgs/by-name/ze/zellij/package.nix +++ b/pkgs/by-name/ze/zellij/package.nix @@ -67,17 +67,16 @@ rustPlatform.buildRustPackage (finalAttrs: { runHook postInstallCheck ''; - postInstall = - '' - mandown docs/MANPAGE.md > zellij.1 - installManPage zellij.1 - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd $pname \ - --bash <($out/bin/zellij setup --generate-completion bash) \ - --fish <($out/bin/zellij setup --generate-completion fish) \ - --zsh <($out/bin/zellij setup --generate-completion zsh) - ''; + postInstall = '' + mandown docs/MANPAGE.md > zellij.1 + installManPage zellij.1 + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd $pname \ + --bash <($out/bin/zellij setup --generate-completion bash) \ + --fish <($out/bin/zellij setup --generate-completion fish) \ + --zsh <($out/bin/zellij setup --generate-completion zsh) + ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/by-name/ze/zenn-cli/package.nix b/pkgs/by-name/ze/zenn-cli/package.nix index 63c9737b5509..ae11b2769124 100644 --- a/pkgs/by-name/ze/zenn-cli/package.nix +++ b/pkgs/by-name/ze/zenn-cli/package.nix @@ -60,14 +60,13 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-AjdXclrNl1AHJ4LXq9I5Rk6KGyDaWXW187o2uLwRy/o="; }; - preBuild = - '' - echo VITE_EMBED_SERVER_ORIGIN="https://embed.zenn.studio" > packages/zenn-cli/.env - '' - # replace go-turbo since the existing one can't be executed - + lib.optionalString stdenv.hostPlatform.isLinux '' - cp ${go-turbo}/bin/go-turbo node_modules/.pnpm/turbo-linux-*/node_modules/turbo-linux*/bin/go-turbo - ''; + preBuild = '' + echo VITE_EMBED_SERVER_ORIGIN="https://embed.zenn.studio" > packages/zenn-cli/.env + '' + # replace go-turbo since the existing one can't be executed + + lib.optionalString stdenv.hostPlatform.isLinux '' + cp ${go-turbo}/bin/go-turbo node_modules/.pnpm/turbo-linux-*/node_modules/turbo-linux*/bin/go-turbo + ''; buildPhase = '' runHook preBuild diff --git a/pkgs/by-name/ze/zepp-simulator/package.nix b/pkgs/by-name/ze/zepp-simulator/package.nix index ff256529e23b..3c814ba95562 100644 --- a/pkgs/by-name/ze/zepp-simulator/package.nix +++ b/pkgs/by-name/ze/zepp-simulator/package.nix @@ -77,34 +77,33 @@ stdenv.mkDerivation { asar ]; - buildInputs = - [ - # QEMU deps (runtime): - glib - libgcc - libcxx - zlib - libepoxy - libpng - libaio - xorg.libX11 - libvterm - vte - gsasl - numactl - cyrus_sasl - gtk3 - cairo - gdk-pixbuf - SDL2 - ] - ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ - libjpeg8 - dtc - capstone_4 - libgbm - curlWithGnuTls - ]; + buildInputs = [ + # QEMU deps (runtime): + glib + libgcc + libcxx + zlib + libepoxy + libpng + libaio + xorg.libX11 + libvterm + vte + gsasl + numactl + cyrus_sasl + gtk3 + cairo + gdk-pixbuf + SDL2 + ] + ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ + libjpeg8 + dtc + capstone_4 + libgbm + curlWithGnuTls + ]; dontBuild = true; diff --git a/pkgs/by-name/ze/zeroad-unwrapped/package.nix b/pkgs/by-name/ze/zeroad-unwrapped/package.nix index 58298f94c1ea..f58ffb457b77 100644 --- a/pkgs/by-name/ze/zeroad-unwrapped/package.nix +++ b/pkgs/by-name/ze/zeroad-unwrapped/package.nix @@ -84,7 +84,8 @@ stdenv.mkDerivation rec { freetype premake5 cxxtest - ] ++ lib.optional withEditor wxGTK; + ] + ++ lib.optional withEditor wxGTK; env.NIX_CFLAGS_COMPILE = toString [ "-I${xorgproto}/include" diff --git a/pkgs/by-name/ze/zerotierone/package.nix b/pkgs/by-name/ze/zerotierone/package.nix index e6c74f488de1..c14f4213aa0c 100644 --- a/pkgs/by-name/ze/zerotierone/package.nix +++ b/pkgs/by-name/ze/zerotierone/package.nix @@ -74,15 +74,14 @@ stdenv.mkDerivation { rustc ]; - buildInputs = - [ - lzo - openssl - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + lzo + openssl + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; enableParallelBuilding = true; diff --git a/pkgs/by-name/zf/zfp/package.nix b/pkgs/by-name/zf/zfp/package.nix index 01919156fc80..91bfc3f1b64c 100644 --- a/pkgs/by-name/zf/zfp/package.nix +++ b/pkgs/by-name/zf/zfp/package.nix @@ -58,15 +58,14 @@ stdenv.mkDerivation (finalAttrs: { ) ''; - cmakeFlags = - [ - ] - ++ lib.optional enableCfp "-DBUILD_CFP=ON" - ++ lib.optional enableCuda "-DZFP_WITH_CUDA=ON" - ++ lib.optional enableFortran "-DBUILD_ZFORP=ON" - ++ lib.optional enableOpenMP "-DZFP_WITH_OPENMP=ON" - ++ lib.optional enablePython "-DBUILD_ZFPY=ON" - ++ ([ "-DBUILD_UTILITIES=${if enableUtilities then "ON" else "OFF"}" ]); + cmakeFlags = [ + ] + ++ lib.optional enableCfp "-DBUILD_CFP=ON" + ++ lib.optional enableCuda "-DZFP_WITH_CUDA=ON" + ++ lib.optional enableFortran "-DBUILD_ZFORP=ON" + ++ lib.optional enableOpenMP "-DZFP_WITH_OPENMP=ON" + ++ lib.optional enablePython "-DBUILD_ZFPY=ON" + ++ ([ "-DBUILD_UTILITIES=${if enableUtilities then "ON" else "OFF"}" ]); doCheck = true; diff --git a/pkgs/by-name/zi/zile/package.nix b/pkgs/by-name/zi/zile/package.nix index 9cf7036183ab..d1fbe8623e25 100644 --- a/pkgs/by-name/zi/zile/package.nix +++ b/pkgs/by-name/zi/zile/package.nix @@ -27,15 +27,14 @@ stdenv.mkDerivation rec { libgee ncurses ]; - nativeBuildInputs = - [ - perl - pkg-config - vala - ] - # `help2man' wants to run Zile, which won't work when the - # newly-produced binary can't be run at build-time. - ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) help2man; + nativeBuildInputs = [ + perl + pkg-config + vala + ] + # `help2man' wants to run Zile, which won't work when the + # newly-produced binary can't be run at build-time. + ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) help2man; # Tests can't be run because most of them rely on the ability to # fiddle with the terminal. diff --git a/pkgs/by-name/zi/zint-qt/package.nix b/pkgs/by-name/zi/zint-qt/package.nix index 624a0e9fb4b7..de6cc069c06e 100644 --- a/pkgs/by-name/zi/zint-qt/package.nix +++ b/pkgs/by-name/zi/zint-qt/package.nix @@ -33,14 +33,13 @@ stdenv.mkDerivation (finalAttrs: { ./fix-installation-of-cmake-files.patch ]; - nativeBuildInputs = - [ - cmake - ninja - ] - ++ lib.optionals withGUI [ - qt6.wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + ninja + ] + ++ lib.optionals withGUI [ + qt6.wrapQtAppsHook + ]; buildInputs = lib.optionals withGUI [ qt6.qtbase @@ -53,13 +52,12 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; - cmakeFlags = - [ - (lib.cmakeBool "ZINT_USE_QT" withGUI) - ] - ++ lib.optionals withGUI [ - (lib.cmakeBool "ZINT_QT6" true) # do not use Qt 5 - ]; + cmakeFlags = [ + (lib.cmakeBool "ZINT_USE_QT" withGUI) + ] + ++ lib.optionals withGUI [ + (lib.cmakeBool "ZINT_QT6" true) # do not use Qt 5 + ]; doInstallCheck = true; nativeCheckInputs = [ versionCheckHook ]; diff --git a/pkgs/by-name/zi/zip/package.nix b/pkgs/by-name/zi/zip/package.nix index 764219b4c880..61b07f74c4ae 100644 --- a/pkgs/by-name/zi/zip/package.nix +++ b/pkgs/by-name/zi/zip/package.nix @@ -74,11 +74,11 @@ stdenv.mkDerivation rec { url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/zip/files/zip-3.0-zipnote-freeze.patch?id=d37d095fc7a2a9e4a8e904a7bf0f597fe99df85a"; hash = "sha256-EVr7YS3IytnCRjAYUlkg05GA/kaAY9NRFG7uDt0QLAY="; }) - ] ++ lib.optionals (enableNLS && !stdenv.hostPlatform.isCygwin) [ ./natspec-gentoo.patch.bz2 ]; + ] + ++ lib.optionals (enableNLS && !stdenv.hostPlatform.isCygwin) [ ./natspec-gentoo.patch.bz2 ]; buildInputs = - lib.optional enableNLS libnatspec - ++ lib.optional stdenv.hostPlatform.isCygwin libiconv; + lib.optional enableNLS libnatspec ++ lib.optional stdenv.hostPlatform.isCygwin libiconv; meta = with lib; { description = "Compressor/archiver for creating and modifying zipfiles"; diff --git a/pkgs/by-name/zi/zita-resampler/package.nix b/pkgs/by-name/zi/zita-resampler/package.nix index 274080edc871..0779ee3f4428 100644 --- a/pkgs/by-name/zi/zita-resampler/package.nix +++ b/pkgs/by-name/zi/zita-resampler/package.nix @@ -18,14 +18,13 @@ stdenv.mkDerivation (finalAttrs: { "SUFFIX=" ]; - postPatch = - '' - cd source - '' - + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' - substituteInPlace Makefile \ - --replace-fail '-DENABLE_SSE2' "" - ''; + postPatch = '' + cd source + '' + + lib.optionalString (!stdenv.hostPlatform.isx86_64) '' + substituteInPlace Makefile \ + --replace-fail '-DENABLE_SSE2' "" + ''; meta = { description = "Resample library by Fons Adriaensen"; diff --git a/pkgs/by-name/zl/zlib-ng/package.nix b/pkgs/by-name/zl/zlib-ng/package.nix index 86c6ccd48e8a..f80401542969 100644 --- a/pkgs/by-name/zl/zlib-ng/package.nix +++ b/pkgs/by-name/zl/zlib-ng/package.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation rec { "-DCMAKE_INSTALL_PREFIX=/" "-DBUILD_SHARED_LIBS=ON" "-DINSTALL_UTILS=ON" - ] ++ lib.optionals withZlibCompat [ "-DZLIB_COMPAT=ON" ]; + ] + ++ lib.optionals withZlibCompat [ "-DZLIB_COMPAT=ON" ]; meta = with lib; { description = "zlib data compression library for the next generation systems"; diff --git a/pkgs/by-name/zm/zmusic/package.nix b/pkgs/by-name/zm/zmusic/package.nix index e68cb3db7368..b81fa32190d7 100644 --- a/pkgs/by-name/zm/zmusic/package.nix +++ b/pkgs/by-name/zm/zmusic/package.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation rec { libsndfile mpg123 zlib - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; meta = { description = "GZDoom's music system as a standalone library"; diff --git a/pkgs/by-name/zo/zoneminder/package.nix b/pkgs/by-name/zo/zoneminder/package.nix index 345984657772..fa472003edda 100644 --- a/pkgs/by-name/zo/zoneminder/package.nix +++ b/pkgs/by-name/zo/zoneminder/package.nix @@ -161,44 +161,43 @@ stdenv.mkDerivation rec { --subst-var-by srcHash "`basename $out`" ''; - buildInputs = - [ - curl - ffmpeg - glib - libjpeg - libselinux - libsepol - mp4v2 - libmysqlclient - mariadb - pcre - perl - polkit - x264 - zlib - util-linuxMinimal # for libmount - ] - ++ (with perlPackages; [ - # build-time dependencies - DateManip - DBI - DBDmysql - LWP - SysMmap - # run-time dependencies not checked at build-time - ClassStdFast - DataDump - DeviceSerialPort - JSONMaybeXS - LWPProtocolHttps - NumberBytesHuman - SysCPU - SysMemInfo - TimeDate - CryptEksblowfish - DataEntropy # zmupdate.pl - ]); + buildInputs = [ + curl + ffmpeg + glib + libjpeg + libselinux + libsepol + mp4v2 + libmysqlclient + mariadb + pcre + perl + polkit + x264 + zlib + util-linuxMinimal # for libmount + ] + ++ (with perlPackages; [ + # build-time dependencies + DateManip + DBI + DBDmysql + LWP + SysMmap + # run-time dependencies not checked at build-time + ClassStdFast + DataDump + DeviceSerialPort + JSONMaybeXS + LWPProtocolHttps + NumberBytesHuman + SysCPU + SysMemInfo + TimeDate + CryptEksblowfish + DataEntropy # zmupdate.pl + ]); nativeBuildInputs = [ cmake diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 888531b32e53..198cecd269b0 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -112,26 +112,25 @@ let cpio ]; - installPhase = - '' - runHook preInstall - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir -p $out/Applications - cp -R zoom.us.app $out/Applications/ - '' - else - '' - mkdir $out - tar -C $out -xf $src - mv $out/usr/* $out/ - '' - ) - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p $out/Applications + cp -R zoom.us.app $out/Applications/ + '' + else + '' + mkdir $out + tar -C $out -xf $src + mv $out/usr/* $out/ + '' + ) + + '' + runHook postInstall + ''; postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' makeWrapper $out/Applications/zoom.us.app/Contents/MacOS/zoom.us $out/bin/zoom diff --git a/pkgs/by-name/zs/zsh/package.nix b/pkgs/by-name/zs/zsh/package.nix index f08b7bb61bb1..29ed6e6c78f5 100644 --- a/pkgs/by-name/zs/zsh/package.nix +++ b/pkgs/by-name/zs/zsh/package.nix @@ -35,62 +35,60 @@ stdenv.mkDerivation { sha256 = "sha256-m40ezt1bXoH78ZGOh2dSp92UjgXBoNuhCrhjhC1FrNU="; }; - patches = - [ - # fix location of timezone data for TZ= completion - ./tz_completion.patch - # Fixes configure misdetection when using clang 16, resulting in broken subshells on Darwin. - # This patch can be dropped with the next release of zsh. - (fetchpatch { - url = "https://github.com/zsh-users/zsh/commit/ab4d62eb975a4c4c51dd35822665050e2ddc6918.patch"; - hash = "sha256-nXB4w7qqjZJC7/+CDxnNy6wu9qNwmS3ezjj/xK7JfeU="; - excludes = [ "ChangeLog" ]; - }) - # Fixes compatibility with texinfo 7.1. This patch can be dropped with the next release of zsh. - (fetchpatch { - url = "https://github.com/zsh-users/zsh/commit/ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4.patch"; - hash = "sha256-oA8GC8LmuqNKGuPqGfiQVhL5nWb7ArLWGUI6wjpsIW8="; - excludes = [ "ChangeLog" ]; - }) - # PCRE 2.x support - (fetchpatch { - url = "https://github.com/zsh-users/zsh/commit/1b421e4978440234fb73117c8505dad1ccc68d46.patch"; - hash = "sha256-jqTXnz56L3X21e3kXtzrT1jKEq+K7ittFjL7GdHVq94="; - excludes = [ "ChangeLog" ]; - }) - (fetchpatch { - url = "https://github.com/zsh-users/zsh/commit/b62e911341c8ec7446378b477c47da4256053dc0.patch"; - hash = "sha256-MfyiLucaSNNfdCLutgv/kL/oi/EVoxZVUd1KjGzN9XI="; - excludes = [ "ChangeLog" ]; - }) - (fetchpatch { - url = "https://github.com/zsh-users/zsh/commit/10bdbd8b5b0b43445aff23dcd412f25cf6aa328a.patch"; - hash = "sha256-bl1PG9Zk1wK+2mfbCBhD3OEpP8HQboqEO8sLFqX8DmA="; - excludes = [ "ChangeLog" ]; - }) - ] - ++ lib.optionals stdenv.cc.isGNU [ - # Fixes compilation with gcc >= 14. - (fetchpatch { - url = "https://github.com/zsh-users/zsh/commit/4c89849c98172c951a9def3690e8647dae76308f.patch"; - hash = "sha256-l5IHQuIXo0N6ynLlZoQA7wJd/C7KrW3G7nMzfjQINkw="; - excludes = [ "ChangeLog" ]; - }) - ]; + patches = [ + # fix location of timezone data for TZ= completion + ./tz_completion.patch + # Fixes configure misdetection when using clang 16, resulting in broken subshells on Darwin. + # This patch can be dropped with the next release of zsh. + (fetchpatch { + url = "https://github.com/zsh-users/zsh/commit/ab4d62eb975a4c4c51dd35822665050e2ddc6918.patch"; + hash = "sha256-nXB4w7qqjZJC7/+CDxnNy6wu9qNwmS3ezjj/xK7JfeU="; + excludes = [ "ChangeLog" ]; + }) + # Fixes compatibility with texinfo 7.1. This patch can be dropped with the next release of zsh. + (fetchpatch { + url = "https://github.com/zsh-users/zsh/commit/ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4.patch"; + hash = "sha256-oA8GC8LmuqNKGuPqGfiQVhL5nWb7ArLWGUI6wjpsIW8="; + excludes = [ "ChangeLog" ]; + }) + # PCRE 2.x support + (fetchpatch { + url = "https://github.com/zsh-users/zsh/commit/1b421e4978440234fb73117c8505dad1ccc68d46.patch"; + hash = "sha256-jqTXnz56L3X21e3kXtzrT1jKEq+K7ittFjL7GdHVq94="; + excludes = [ "ChangeLog" ]; + }) + (fetchpatch { + url = "https://github.com/zsh-users/zsh/commit/b62e911341c8ec7446378b477c47da4256053dc0.patch"; + hash = "sha256-MfyiLucaSNNfdCLutgv/kL/oi/EVoxZVUd1KjGzN9XI="; + excludes = [ "ChangeLog" ]; + }) + (fetchpatch { + url = "https://github.com/zsh-users/zsh/commit/10bdbd8b5b0b43445aff23dcd412f25cf6aa328a.patch"; + hash = "sha256-bl1PG9Zk1wK+2mfbCBhD3OEpP8HQboqEO8sLFqX8DmA="; + excludes = [ "ChangeLog" ]; + }) + ] + ++ lib.optionals stdenv.cc.isGNU [ + # Fixes compilation with gcc >= 14. + (fetchpatch { + url = "https://github.com/zsh-users/zsh/commit/4c89849c98172c951a9def3690e8647dae76308f.patch"; + hash = "sha256-l5IHQuIXo0N6ynLlZoQA7wJd/C7KrW3G7nMzfjQINkw="; + excludes = [ "ChangeLog" ]; + }) + ]; strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - perl - groff - texinfo - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linux - yodl - ]; + nativeBuildInputs = [ + autoreconfHook + perl + groff + texinfo + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linux + yodl + ]; buildInputs = [ ncurses @@ -99,27 +97,26 @@ stdenv.mkDerivation { env.PCRE_CONFIG = lib.getExe' (lib.getDev pcre2) "pcre2-config"; - configureFlags = - [ - "--enable-maildir-support" - "--enable-multibyte" - "--with-tcsetpgrp" - "--enable-pcre" - "--enable-zshenv=${placeholder "out"}/etc/zshenv" - "--disable-site-fndir" - # --enable-function-subdirs is not enabled due to it being slow at runtime in some cases - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform && !stdenv.hostPlatform.isStatic) [ - # Also see: https://github.com/buildroot/buildroot/commit/2f32e668aa880c2d4a2cce6c789b7ca7ed6221ba - "zsh_cv_shared_environ=yes" - "zsh_cv_shared_tgetent=yes" - "zsh_cv_shared_tigetstr=yes" - "zsh_cv_sys_dynamic_clash_ok=yes" - "zsh_cv_sys_dynamic_rtld_global=yes" - "zsh_cv_sys_dynamic_execsyms=yes" - "zsh_cv_sys_dynamic_strip_exe=yes" - "zsh_cv_sys_dynamic_strip_lib=yes" - ]; + configureFlags = [ + "--enable-maildir-support" + "--enable-multibyte" + "--with-tcsetpgrp" + "--enable-pcre" + "--enable-zshenv=${placeholder "out"}/etc/zshenv" + "--disable-site-fndir" + # --enable-function-subdirs is not enabled due to it being slow at runtime in some cases + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform && !stdenv.hostPlatform.isStatic) [ + # Also see: https://github.com/buildroot/buildroot/commit/2f32e668aa880c2d4a2cce6c789b7ca7ed6221ba + "zsh_cv_shared_environ=yes" + "zsh_cv_shared_tgetent=yes" + "zsh_cv_shared_tigetstr=yes" + "zsh_cv_sys_dynamic_clash_ok=yes" + "zsh_cv_sys_dynamic_rtld_global=yes" + "zsh_cv_sys_dynamic_execsyms=yes" + "zsh_cv_sys_dynamic_strip_exe=yes" + "zsh_cv_sys_dynamic_strip_lib=yes" + ]; # the zsh/zpty module is not available on hydra # so skip groups Y Z diff --git a/pkgs/by-name/zu/zulip-term/package.nix b/pkgs/by-name/zu/zulip-term/package.nix index 3ce923be7dba..ee4103805ed4 100644 --- a/pkgs/by-name/zu/zulip-term/package.nix +++ b/pkgs/by-name/zu/zulip-term/package.nix @@ -61,15 +61,14 @@ buildPythonApplication rec { zulip ]; - nativeCheckInputs = - [ - glibcLocales - ] - ++ (with python3.pkgs; [ - pytestCheckHook - pytest-cov-stub - pytest-mock - ]); + nativeCheckInputs = [ + glibcLocales + ] + ++ (with python3.pkgs; [ + pytestCheckHook + pytest-cov-stub + pytest-mock + ]); makeWrapperArgs = [ "--prefix" diff --git a/pkgs/by-name/zx/zxtune/package.nix b/pkgs/by-name/zx/zxtune/package.nix index af2cc20449e9..6b43bd5ae54f 100644 --- a/pkgs/by-name/zx/zxtune/package.nix +++ b/pkgs/by-name/zx/zxtune/package.nix @@ -44,7 +44,8 @@ let staticBuildInputs = [ boost zlib - ] ++ lib.optional withQt (if (supportWayland) then qt5.qtwayland else qt5.qtbase); + ] + ++ lib.optional withQt (if (supportWayland) then qt5.qtwayland else qt5.qtbase); in stdenv.mkDerivation rec { pname = "zxtune"; @@ -129,19 +130,18 @@ stdenv.mkDerivation rec { # load ("Status: Available" or "Status: Failed to load dynamic library..."). dontPatchELF = true; - installPhase = - '' - runHook preInstall - install -Dm755 bin/linux/release/xtractor -t $out/bin - install -Dm755 bin/linux/release/zxtune123 -t $out/bin - '' - + lib.optionalString withQt '' - install -Dm755 bin/linux/release/zxtune-qt -t $out/bin - install -Dm755 apps/zxtune-qt/res/theme_default/zxtune.png -t $out/share/icons/hicolor/48x48/apps - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + install -Dm755 bin/linux/release/xtractor -t $out/bin + install -Dm755 bin/linux/release/zxtune123 -t $out/bin + '' + + lib.optionalString withQt '' + install -Dm755 bin/linux/release/zxtune-qt -t $out/bin + install -Dm755 apps/zxtune-qt/res/theme_default/zxtune.png -t $out/share/icons/hicolor/48x48/apps + '' + + '' + runHook postInstall + ''; # Only wrap the gui dontWrapQtApps = true; diff --git a/pkgs/data/documentation/zeal/default.nix b/pkgs/data/documentation/zeal/default.nix index dcca5ffbc67e..dde6f06a4182 100644 --- a/pkgs/data/documentation/zeal/default.nix +++ b/pkgs/data/documentation/zeal/default.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation (finalAttrs: { qtimageformats qtwebengine xcbutilkeysyms - ] ++ lib.optionals isQt5 [ qtx11extras ]; + ] + ++ lib.optionals isQt5 [ qtx11extras ]; cmakeFlags = [ (lib.cmakeBool "ZEAL_RELEASE_BUILD" true) diff --git a/pkgs/data/fonts/open-relay/default.nix b/pkgs/data/fonts/open-relay/default.nix index 2b3b943761bc..a8562be40859 100644 --- a/pkgs/data/fonts/open-relay/default.nix +++ b/pkgs/data/fonts/open-relay/default.nix @@ -38,7 +38,8 @@ let linus toastal ]; - } // meta; + } + // meta; }); in lib.mapAttrs mkOpenRelayTypeface { diff --git a/pkgs/data/fonts/openmoji/default.nix b/pkgs/data/fonts/openmoji/default.nix index 5c9e54611545..5f4c07e8a25e 100644 --- a/pkgs/data/fonts/openmoji/default.nix +++ b/pkgs/data/fonts/openmoji/default.nix @@ -66,8 +66,7 @@ stdenvNoCC.mkDerivation rec { methods_black = builtins.filter (m: builtins.elem m fontFormats) methods.black; methods_color = builtins.filter (m: builtins.elem m fontFormats) methods.color; saturations = - lib.optional (methods_black != [ ]) "black" - ++ lib.optional (methods_color != [ ]) "color"; + lib.optional (methods_black != [ ]) "black" ++ lib.optional (methods_color != [ ]) "color"; maximumColorVersions = lib.optionals (buildMaximumColorFonts != "none") ( lib.optional (builtins.elem "glyf_colr_0" fontFormats) "0" ++ lib.optional (builtins.elem "glyf_colr_1" fontFormats) "1" diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix index 49beba0de955..a8598e304410 100644 --- a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix +++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix @@ -30,35 +30,34 @@ let inherit sha256; }; - patches = - [ - # Prevent a potential stack overflow - # https://github.com/docbook/xslt10-stylesheets/pull/37 - (fetchpatch { - url = "https://src.fedoraproject.org/rpms/docbook-style-xsl/raw/e3ae7a97ed1d185594dd35954e1a02196afb205a/f/docbook-style-xsl-non-recursive-string-subst.patch"; - sha256 = "0lrjjg5kpwwmbhkxzz6i5zmimb6lsvrrdhzc2qgjmb3r6jnsmii3"; - stripLen = "1"; - }) + patches = [ + # Prevent a potential stack overflow + # https://github.com/docbook/xslt10-stylesheets/pull/37 + (fetchpatch { + url = "https://src.fedoraproject.org/rpms/docbook-style-xsl/raw/e3ae7a97ed1d185594dd35954e1a02196afb205a/f/docbook-style-xsl-non-recursive-string-subst.patch"; + sha256 = "0lrjjg5kpwwmbhkxzz6i5zmimb6lsvrrdhzc2qgjmb3r6jnsmii3"; + stripLen = "1"; + }) - # Fix reproducibility by respecting generate.consistent.ids in indexes - # https://github.com/docbook/xslt10-stylesheets/pull/88 - # https://sourceforge.net/p/docbook/bugs/1385/ - (fetchpatch { - url = "https://github.com/docbook/xslt10-stylesheets/commit/07631601e6602bc49b8eac3aab9d2b35968d3e7a.patch"; - sha256 = "0igfhcr6hzcydqsnjsd181h5yl3drjnrwdmxcybr236m8255vkq3"; - stripLen = "1"; - }) + # Fix reproducibility by respecting generate.consistent.ids in indexes + # https://github.com/docbook/xslt10-stylesheets/pull/88 + # https://sourceforge.net/p/docbook/bugs/1385/ + (fetchpatch { + url = "https://github.com/docbook/xslt10-stylesheets/commit/07631601e6602bc49b8eac3aab9d2b35968d3e7a.patch"; + sha256 = "0igfhcr6hzcydqsnjsd181h5yl3drjnrwdmxcybr236m8255vkq3"; + stripLen = "1"; + }) - # Add legacy sourceforge.net URIs to the catalog - (replaceVars ./catalog-legacy-uris.patch { - inherit legacySuffix suffix version; - }) - ] - ++ lib.optionals withManOptDedupPatch [ - # Fixes https://github.com/NixOS/nixpkgs/issues/166304 - # https://github.com/docbook/xslt10-stylesheets/pull/241 - ./fix-man-options-duplication.patch - ]; + # Add legacy sourceforge.net URIs to the catalog + (replaceVars ./catalog-legacy-uris.patch { + inherit legacySuffix suffix version; + }) + ] + ++ lib.optionals withManOptDedupPatch [ + # Fixes https://github.com/NixOS/nixpkgs/issues/166304 + # https://github.com/docbook/xslt10-stylesheets/pull/241 + ./fix-man-options-duplication.patch + ]; propagatedBuildInputs = [ findXMLCatalogs ]; diff --git a/pkgs/data/themes/adwaita-qt/default.nix b/pkgs/data/themes/adwaita-qt/default.nix index 704d49af1cb0..3de7647405e6 100644 --- a/pkgs/data/themes/adwaita-qt/default.nix +++ b/pkgs/data/themes/adwaita-qt/default.nix @@ -33,19 +33,18 @@ stdenv.mkDerivation rec { ninja ]; - buildInputs = - [ - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - xorg.libxcb - ] - ++ lib.optionals (!useQt6) [ - qt5.qtx11extras - ] - ++ lib.optionals useQt6 [ - qtwayland - ]; + buildInputs = [ + qtbase + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + xorg.libxcb + ] + ++ lib.optionals (!useQt6) [ + qt5.qtx11extras + ] + ++ lib.optionals useQt6 [ + qtwayland + ]; # Qt setup hook complains about missing `wrapQtAppsHook` otherwise. dontWrapQtApps = true; diff --git a/pkgs/data/themes/elegant-sddm/default.nix b/pkgs/data/themes/elegant-sddm/default.nix index c4d297884194..56545c77c843 100644 --- a/pkgs/data/themes/elegant-sddm/default.nix +++ b/pkgs/data/themes/elegant-sddm/default.nix @@ -39,19 +39,18 @@ stdenvNoCC.mkDerivation { dontWrapQtApps = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p "$out/share/sddm/themes" - cp -r Elegant/ "$out/share/sddm/themes/Elegant" - '' - + (lib.optionalString (lib.isAttrs themeConfig) '' - ln -sf ${user-cfg} $out/share/sddm/themes/Elegant/theme.conf.user - '') - + '' - runHook postInstall - ''; + mkdir -p "$out/share/sddm/themes" + cp -r Elegant/ "$out/share/sddm/themes/Elegant" + '' + + (lib.optionalString (lib.isAttrs themeConfig) '' + ln -sf ${user-cfg} $out/share/sddm/themes/Elegant/theme.conf.user + '') + + '' + runHook postInstall + ''; postFixup = '' mkdir -p $out/nix-support diff --git a/pkgs/data/themes/plata/default.nix b/pkgs/data/themes/plata/default.nix index cdcd080e1657..405c818d7ff9 100644 --- a/pkgs/data/themes/plata/default.nix +++ b/pkgs/data/themes/plata/default.nix @@ -42,21 +42,20 @@ stdenv.mkDerivation rec { sha256 = "1iwvlv9qcrjyfbzab00vjqafmp3vdybz1hi02r6lwbgvwyfyrifk"; }; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - parallel - sassc - inkscape - libxml2 - glib - ] - ++ lib.optionals mateSupport [ - gtk3 - marco - ] - ++ lib.optional telegramSupport zip; + nativeBuildInputs = [ + autoreconfHook + pkg-config + parallel + sassc + inkscape + libxml2 + glib + ] + ++ lib.optionals mateSupport [ + gtk3 + marco + ] + ++ lib.optional telegramSupport zip; buildInputs = [ gtk_engines ]; diff --git a/pkgs/data/themes/qtcurve/default.nix b/pkgs/data/themes/qtcurve/default.nix index dd2aaeed7d35..9339cdbf3380 100644 --- a/pkgs/data/themes/qtcurve/default.nix +++ b/pkgs/data/themes/qtcurve/default.nix @@ -76,7 +76,8 @@ mkDerivation rec { libXdmcp libX11 libXau - ] ++ lib.optional gtk2Support gtk2; + ] + ++ lib.optional gtk2Support gtk2; preConfigure = '' for i in qt5/CMakeLists.txt qt5/config/CMakeLists.txt diff --git a/pkgs/desktops/deepin/apps/deepin-music/default.nix b/pkgs/desktops/deepin/apps/deepin-music/default.nix index a6d59650882f..1eeb0eb03bed 100644 --- a/pkgs/desktops/deepin/apps/deepin-music/default.nix +++ b/pkgs/desktops/deepin/apps/deepin-music/default.nix @@ -37,26 +37,25 @@ stdenv.mkDerivation rec { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - dtk6widget - dtk6declarative - qt6integration - qt6platform-plugins - qt6mpris - qt6Packages.qtbase - qt6Packages.qt5compat - qt6Packages.qtmultimedia - ffmpeg_6 - libvlc - taglib_1 - SDL2 - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - ]); + buildInputs = [ + dtk6widget + dtk6declarative + qt6integration + qt6platform-plugins + qt6mpris + qt6Packages.qtbase + qt6Packages.qt5compat + qt6Packages.qtmultimedia + ffmpeg_6 + libvlc + taglib_1 + SDL2 + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + ]); cmakeFlags = [ "-DVERSION=${version}" ]; diff --git a/pkgs/desktops/deepin/core/dde-gsettings-schemas/default.nix b/pkgs/desktops/deepin/core/dde-gsettings-schemas/default.nix index 799714d98ec2..6b8f892ed39b 100644 --- a/pkgs/desktops/deepin/core/dde-gsettings-schemas/default.nix +++ b/pkgs/desktops/deepin/core/dde-gsettings-schemas/default.nix @@ -24,7 +24,8 @@ let deepin-desktop-schemas deepin-system-monitor gsettings-desktop-schemas # dde-appearance need org.gnome.desktop.background - ] ++ extraGSettingsOverridePackages; + ] + ++ extraGSettingsOverridePackages; in # TODO: Having https://github.com/NixOS/nixpkgs/issues/54150 would supersede this diff --git a/pkgs/desktops/deepin/core/dde-launchpad/default.nix b/pkgs/desktops/deepin/core/dde-launchpad/default.nix index a6beb5d3347b..a8d8cbbd5042 100644 --- a/pkgs/desktops/deepin/core/dde-launchpad/default.nix +++ b/pkgs/desktops/deepin/core/dde-launchpad/default.nix @@ -29,19 +29,18 @@ stdenv.mkDerivation rec { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - qt6integration - qt6platform-plugins - dtk6declarative - dde-shell - ] - ++ (with qt6Packages; [ - qtbase - qtsvg - qtwayland - appstream-qt - ]); + buildInputs = [ + qt6integration + qt6platform-plugins + dtk6declarative + dde-shell + ] + ++ (with qt6Packages; [ + qtbase + qtsvg + qtwayland + appstream-qt + ]); cmakeFlags = [ "-DSYSTEMD_USER_UNIT_DIR=${placeholder "out"}/lib/systemd/user" ]; diff --git a/pkgs/desktops/deepin/core/deepin-kwin/default.nix b/pkgs/desktops/deepin/core/deepin-kwin/default.nix index 2a56a883449d..8cf6180f3652 100644 --- a/pkgs/desktops/deepin/core/deepin-kwin/default.nix +++ b/pkgs/desktops/deepin/core/deepin-kwin/default.nix @@ -43,44 +43,43 @@ stdenv.mkDerivation rec { libsForQt5.qttools ]; - buildInputs = - [ - wayland - dwayland - libepoxy - gsettings-qt + buildInputs = [ + wayland + dwayland + libepoxy + gsettings-qt - libinput - libgbm - lcms2 + libinput + libgbm + lcms2 - xorg.libxcb - xorg.libXdmcp - xorg.libXcursor - xorg.xcbutilcursor - xorg.libXtst - xorg.libXScrnSaver - ] - ++ (with libsForQt5; [ - qtbase - qtx11extras - kconfig - kconfigwidgets - kcoreaddons - kcrash - kdbusaddons - kiconthemes - kglobalaccel - kidletime - knotifications - kpackage - plasma-framework - kcmutils - knewstuff - kdecoration - kscreenlocker - breeze-qt5 - ]); + xorg.libxcb + xorg.libXdmcp + xorg.libXcursor + xorg.xcbutilcursor + xorg.libXtst + xorg.libXScrnSaver + ] + ++ (with libsForQt5; [ + qtbase + qtx11extras + kconfig + kconfigwidgets + kcoreaddons + kcrash + kdbusaddons + kiconthemes + kglobalaccel + kidletime + knotifications + kpackage + plasma-framework + kcmutils + knewstuff + kdecoration + kscreenlocker + breeze-qt5 + ]); cmakeFlags = [ "-DKWIN_BUILD_RUNNERS=OFF" ]; diff --git a/pkgs/desktops/deepin/library/dtk6declarative/default.nix b/pkgs/desktops/deepin/library/dtk6declarative/default.nix index 90f208ed036b..57c58dceccb4 100644 --- a/pkgs/desktops/deepin/library/dtk6declarative/default.nix +++ b/pkgs/desktops/deepin/library/dtk6declarative/default.nix @@ -33,14 +33,15 @@ stdenv.mkDerivation (finalAttrs: { qt6Packages.wrapQtAppsHook ]; - propagatedBuildInputs = - [ dtk6gui ] - ++ (with qt6Packages; [ - qtbase - qtdeclarative - qtshadertools - qt5compat - ]); + propagatedBuildInputs = [ + dtk6gui + ] + ++ (with qt6Packages; [ + qtbase + qtdeclarative + qtshadertools + qt5compat + ]); cmakeFlags = [ "-DDTK_VERSION=${finalAttrs.version}" diff --git a/pkgs/desktops/deepin/library/dtk6log/default.nix b/pkgs/desktops/deepin/library/dtk6log/default.nix index 755738b40b70..6e89449f7d0d 100644 --- a/pkgs/desktops/deepin/library/dtk6log/default.nix +++ b/pkgs/desktops/deepin/library/dtk6log/default.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ qt6Packages.qtbase spdlog - ] ++ lib.optional withSystemd systemd; + ] + ++ lib.optional withSystemd systemd; cmakeFlags = [ (lib.cmakeBool "BUILD_WITH_QT6" true) diff --git a/pkgs/desktops/deepin/library/dtk6widget/default.nix b/pkgs/desktops/deepin/library/dtk6widget/default.nix index 549b05e32de7..d44097fe6050 100644 --- a/pkgs/desktops/deepin/library/dtk6widget/default.nix +++ b/pkgs/desktops/deepin/library/dtk6widget/default.nix @@ -47,16 +47,15 @@ stdenv.mkDerivation (finalAttrs: { qt6Packages.wrapQtAppsHook ]; - buildInputs = - [ - cups - libstartup_notification - ] - ++ (with qt6Packages; [ - qtbase - qtmultimedia - qtsvg - ]); + buildInputs = [ + cups + libstartup_notification + ] + ++ (with qt6Packages; [ + qtbase + qtmultimedia + qtsvg + ]); propagatedBuildInputs = [ dtk6gui ]; diff --git a/pkgs/desktops/deepin/library/dtklog/default.nix b/pkgs/desktops/deepin/library/dtklog/default.nix index 6722f9be0048..7c448ee8e8a8 100644 --- a/pkgs/desktops/deepin/library/dtklog/default.nix +++ b/pkgs/desktops/deepin/library/dtklog/default.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ libsForQt5.qtbase spdlog - ] ++ lib.optional withSystemd systemd; + ] + ++ lib.optional withSystemd systemd; cmakeFlags = [ (lib.cmakeBool "BUILD_WITH_SYSTEMD" withSystemd) diff --git a/pkgs/desktops/deepin/library/gio-qt/default.nix b/pkgs/desktops/deepin/library/gio-qt/default.nix index 8b420e1f492b..2865174cd041 100644 --- a/pkgs/desktops/deepin/library/gio-qt/default.nix +++ b/pkgs/desktops/deepin/library/gio-qt/default.nix @@ -28,21 +28,21 @@ stdenv.mkDerivation rec { --replace "include(qt6.cmake)" " " ''; - nativeBuildInputs = - [ - cmake - pkg-config - libsForQt5.wrapQtAppsHook - ] - ++ lib.optionals buildDocs [ - doxygen - libsForQt5.qttools - ]; + nativeBuildInputs = [ + cmake + pkg-config + libsForQt5.wrapQtAppsHook + ] + ++ lib.optionals buildDocs [ + doxygen + libsForQt5.qttools + ]; cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" "-DPROJECT_VERSION=${version}" - ] ++ lib.optionals (!buildDocs) [ "-DBUILD_DOCS=OFF" ]; + ] + ++ lib.optionals (!buildDocs) [ "-DBUILD_DOCS=OFF" ]; propagatedBuildInputs = [ glibmm ]; diff --git a/pkgs/desktops/enlightenment/enlightenment/default.nix b/pkgs/desktops/enlightenment/enlightenment/default.nix index 7e171dcb1e57..8521e6ff85cd 100644 --- a/pkgs/desktops/enlightenment/enlightenment/default.nix +++ b/pkgs/desktops/enlightenment/enlightenment/default.nix @@ -41,24 +41,23 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - alsa-lib - acpid # for systems with ACPI for lid events, AC/Battery plug in/out etc - bc # for the Everything module calculator mode - ddcutil # specifically libddcutil.so.2 for backlight control - efl - libexif - pam - xkeyboard_config - udisks2 # for removable storage mounting/unmounting - ] - ++ lib.optional bluetoothSupport bluez5 # for bluetooth configuration and control - ++ lib.optional pulseSupport libpulseaudio # for proper audio device control and redirection - ++ lib.optionals waylandSupport [ - wayland-protocols - xwayland - ]; + buildInputs = [ + alsa-lib + acpid # for systems with ACPI for lid events, AC/Battery plug in/out etc + bc # for the Everything module calculator mode + ddcutil # specifically libddcutil.so.2 for backlight control + efl + libexif + pam + xkeyboard_config + udisks2 # for removable storage mounting/unmounting + ] + ++ lib.optional bluetoothSupport bluez5 # for bluetooth configuration and control + ++ lib.optional pulseSupport libpulseaudio # for proper audio device control and redirection + ++ lib.optionals waylandSupport [ + wayland-protocols + xwayland + ]; patches = [ # Executables cannot be made setuid in nix store. They should be @@ -75,7 +74,8 @@ stdenv.mkDerivation rec { mesonFlags = [ "-D systemdunitdir=lib/systemd/user" - ] ++ lib.optional waylandSupport "-Dwl=true"; + ] + ++ lib.optional waylandSupport "-Dwl=true"; passthru.providedSessions = [ "enlightenment" ]; diff --git a/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix b/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix index 77ced255f1da..f7035701133f 100644 --- a/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix +++ b/pkgs/desktops/gnome-2/desktop/gtksourceview/default.nix @@ -49,31 +49,29 @@ stdenv.mkDerivation (finalAttrs: { # Fix build with gcc 14 env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - nativeBuildInputs = - [ - pkg-config - intltool - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - autoreconfHook - gtk-doc - ]; + nativeBuildInputs = [ + pkg-config + intltool + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + autoreconfHook + gtk-doc + ]; - buildInputs = - [ - atk - cairo - glib - gtk2 - pango - libxml2Python - perl - gettext - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gnome-common - gtk-mac-integration-gtk2 - ]; + buildInputs = [ + atk + cairo + glib + gtk2 + pango + libxml2Python + perl + gettext + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gnome-common + gtk-mac-integration-gtk2 + ]; doCheck = false; # requires X11 daemon diff --git a/pkgs/desktops/gnome-2/platform/GConf/default.nix b/pkgs/desktops/gnome-2/platform/GConf/default.nix index e4c82953310f..7eb70d3fb485 100644 --- a/pkgs/desktops/gnome-2/platform/GConf/default.nix +++ b/pkgs/desktops/gnome-2/platform/GConf/default.nix @@ -29,14 +29,13 @@ stdenv.mkDerivation rec { strictDeps = true; - buildInputs = - [ - ORBit2 - libxml2 - ] - # polkit requires pam, which requires shadow.h, which is not available on - # darwin - ++ lib.optional (!stdenv.hostPlatform.isDarwin) polkit; + buildInputs = [ + ORBit2 + libxml2 + ] + # polkit requires pam, which requires shadow.h, which is not available on + # darwin + ++ lib.optional (!stdenv.hostPlatform.isDarwin) polkit; propagatedBuildInputs = [ glib diff --git a/pkgs/desktops/gnome/extensions/systemd-manager/default.nix b/pkgs/desktops/gnome/extensions/systemd-manager/default.nix index c6d983de6e40..d5d559ab131d 100644 --- a/pkgs/desktops/gnome/extensions/systemd-manager/default.nix +++ b/pkgs/desktops/gnome/extensions/systemd-manager/default.nix @@ -31,25 +31,24 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ glib ]; - postInstall = - '' - rm systemd-manager@hardpixel.eu/schemas/gschemas.compiled - glib-compile-schemas systemd-manager@hardpixel.eu/schemas + postInstall = '' + rm systemd-manager@hardpixel.eu/schemas/gschemas.compiled + glib-compile-schemas systemd-manager@hardpixel.eu/schemas - mkdir -p $out/share/gnome-shell/extensions - mv systemd-manager@hardpixel.eu $out/share/gnome-shell/extensions - '' - + lib.optionalString (allowPolkitPolicy == "pkexec") '' - local bn=org.freedesktop.policykit.pkexec.systemctl.policy - mkdir -p $out/share/polkit-1/actions - substitute systemd-policies/$bn $out/share/polkit-1/actions/$bn \ - --replace-fail /usr/bin/systemctl ${lib.getBin systemd}/bin/systemctl - '' - + lib.optionalString (allowPolkitPolicy == "systemctl") '' - install -Dm0644 \ - systemd-policies/10-service_status.rules \ - $out/share/polkit-1/rules.d/10-gnome-extension-systemd-manager.rules - ''; + mkdir -p $out/share/gnome-shell/extensions + mv systemd-manager@hardpixel.eu $out/share/gnome-shell/extensions + '' + + lib.optionalString (allowPolkitPolicy == "pkexec") '' + local bn=org.freedesktop.policykit.pkexec.systemctl.policy + mkdir -p $out/share/polkit-1/actions + substitute systemd-policies/$bn $out/share/polkit-1/actions/$bn \ + --replace-fail /usr/bin/systemctl ${lib.getBin systemd}/bin/systemctl + '' + + lib.optionalString (allowPolkitPolicy == "systemctl") '' + install -Dm0644 \ + systemd-policies/10-service_status.rules \ + $out/share/polkit-1/rules.d/10-gnome-extension-systemd-manager.rules + ''; passthru = { extensionUuid = "systemd-manager@hardpixel.eu"; diff --git a/pkgs/desktops/gnome/gdk-pixbuf-cache-builder.nix b/pkgs/desktops/gnome/gdk-pixbuf-cache-builder.nix index 8f4313e92d2f..6ad349d664dc 100644 --- a/pkgs/desktops/gnome/gdk-pixbuf-cache-builder.nix +++ b/pkgs/desktops/gnome/gdk-pixbuf-cache-builder.nix @@ -14,7 +14,8 @@ let # Get packages to generate the cache for. We always include gdk-pixbuf. loaderPackages = [ gdk-pixbuf - ] ++ extraLoaders; + ] + ++ extraLoaders; in # Generate the cache file by running gdk-pixbuf-query-loaders for each diff --git a/pkgs/desktops/gnome/installer.nix b/pkgs/desktops/gnome/installer.nix index 015f13b03bf2..3076a9a872cd 100644 --- a/pkgs/desktops/gnome/installer.nix +++ b/pkgs/desktops/gnome/installer.nix @@ -14,7 +14,8 @@ let modules = [ module { image.baseName = isoBaseName; } - ] ++ extraModules; + ] + ++ extraModules; }).config; in diff --git a/pkgs/desktops/gnome/nixos/gsettings-overrides/default.nix b/pkgs/desktops/gnome/nixos/gsettings-overrides/default.nix index dd1bca40366a..3b64fc498ab1 100644 --- a/pkgs/desktops/gnome/nixos/gsettings-overrides/default.nix +++ b/pkgs/desktops/gnome/nixos/gsettings-overrides/default.nix @@ -18,15 +18,14 @@ let inherit (lib) concatMapStringsSep; - gsettingsOverridePackages = - [ - gsettings-desktop-schemas - gnome-shell - ] - ++ lib.optionals flashbackEnabled [ - gnome-flashback - ] - ++ extraGSettingsOverridePackages; + gsettingsOverridePackages = [ + gsettings-desktop-schemas + gnome-shell + ] + ++ lib.optionals flashbackEnabled [ + gnome-flashback + ] + ++ extraGSettingsOverridePackages; gsettingsOverrides = '' [org.gnome.desktop.background] diff --git a/pkgs/desktops/gnome/update.nix b/pkgs/desktops/gnome/update.nix index 2500739a22db..481aeb831542 100644 --- a/pkgs/desktops/gnome/update.nix +++ b/pkgs/desktops/gnome/update.nix @@ -104,7 +104,8 @@ in packageName packageVersion versionPolicy - ] ++ upperBound; + ] + ++ upperBound; supportedFeatures = [ "commit" ]; diff --git a/pkgs/desktops/lomiri/applications/lomiri-calendar-app/default.nix b/pkgs/desktops/lomiri/applications/lomiri-calendar-app/default.nix index 10673b1a3253..856f1fe00f7a 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-calendar-app/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-calendar-app/default.nix @@ -72,19 +72,18 @@ stdenv.mkDerivation (finalAttrs: { ./1114-lomiri-calendar-app-Adjust-SyncManager-filters.patch ]; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'QT_IMPORTS_DIR "lib/''${ARCH_TRIPLET}"' 'QT_IMPORTS_DIR "${qtbase.qtQmlPrefix}"' + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'QT_IMPORTS_DIR "lib/''${ARCH_TRIPLET}"' 'QT_IMPORTS_DIR "${qtbase.qtQmlPrefix}"' - # Outdated paths - substituteInPlace tests/unittests/tst_{calendar_canvas,date,event_bubble,event_list_model}.qml \ - --replace-fail '../../qml' '../../src/qml' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'add_subdirectory(tests)' '# add_subdirectory(tests)' - ''; + # Outdated paths + substituteInPlace tests/unittests/tst_{calendar_canvas,date,event_bubble,event_list_model}.qml \ + --replace-fail '../../qml' '../../src/qml' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(tests)' '# add_subdirectory(tests)' + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/applications/lomiri-camera-app/default.nix b/pkgs/desktops/lomiri/applications/lomiri-camera-app/default.nix index 6f48c161d62e..920efc2eebd8 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-camera-app/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-camera-app/default.nix @@ -59,32 +59,31 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - exiv2 - qtbase - qtdeclarative - qtmultimedia - qtquickcontrols2 - qzxing + buildInputs = [ + exiv2 + qtbase + qtdeclarative + qtmultimedia + qtquickcontrols2 + qzxing - # QML - libusermetrics - lomiri-action-api - lomiri-content-hub - lomiri-ui-toolkit - lomiri-thumbnailer - qtpositioning - qtsensors - ] - ++ (with gst_all_1; [ - # cannot create camera service, the 'camerabin' plugin is missing for GStreamer - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - gst-plugins-ugly - ]); + # QML + libusermetrics + lomiri-action-api + lomiri-content-hub + lomiri-ui-toolkit + lomiri-thumbnailer + qtpositioning + qtsensors + ] + ++ (with gst_all_1; [ + # cannot create camera service, the 'camerabin' plugin is missing for GStreamer + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + gst-plugins-ugly + ]); nativeCheckInputs = [ xvfb-run ]; diff --git a/pkgs/desktops/lomiri/applications/lomiri-mediaplayer-app/default.nix b/pkgs/desktops/lomiri/applications/lomiri-mediaplayer-app/default.nix index bbb9050e6bec..ed9a987e4ae3 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-mediaplayer-app/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-mediaplayer-app/default.nix @@ -49,24 +49,23 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - qtbase - qtmultimedia + buildInputs = [ + qtbase + qtmultimedia - # QML - lomiri-action-api - lomiri-content-hub - lomiri-ui-toolkit - qtxmlpatterns - ] - # QtMultimedia playback support - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ]); + # QML + lomiri-action-api + lomiri-content-hub + lomiri-ui-toolkit + qtxmlpatterns + ] + # QtMultimedia playback support + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ]); nativeCheckInputs = [ qtdeclarative # qmltestrunner diff --git a/pkgs/desktops/lomiri/applications/lomiri-music-app/default.nix b/pkgs/desktops/lomiri/applications/lomiri-music-app/default.nix index 34654e838795..49fc854d2fff 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-music-app/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-music-app/default.nix @@ -47,27 +47,26 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - qtbase - qtdeclarative + buildInputs = [ + qtbase + qtdeclarative - # QML - libusermetrics - lomiri-content-hub - lomiri-thumbnailer - lomiri-ui-toolkit - mediascanner2 - qtmultimedia - qtsystems - ] - # QtMultimedia playback support - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ]); + # QML + libusermetrics + lomiri-content-hub + lomiri-thumbnailer + lomiri-ui-toolkit + mediascanner2 + qtmultimedia + qtsystems + ] + # QtMultimedia playback support + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + ]); dontWrapGApps = true; diff --git a/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix b/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix index 7a550370ef54..2a2112f5de3b 100644 --- a/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix +++ b/pkgs/desktops/lomiri/applications/lomiri-system-settings/wrapper.nix @@ -29,7 +29,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { buildInputs = [ glib # schema hook lomiri-system-settings-unwrapped - ] ++ plugins; + ] + ++ plugins; installPhase = '' runHook preInstall diff --git a/pkgs/desktops/lomiri/applications/lomiri/default.nix b/pkgs/desktops/lomiri/applications/lomiri/default.nix index 162a6b6973fa..8446ece91183 100644 --- a/pkgs/desktops/lomiri/applications/lomiri/default.nix +++ b/pkgs/desktops/lomiri/applications/lomiri/default.nix @@ -117,38 +117,37 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = - '' - # Written with a different qtmir branch in mind, but different branch breaks compat with some patches - substituteInPlace CMakeLists.txt \ - --replace-fail 'qt5mir2server' 'qtmirserver' + postPatch = '' + # Written with a different qtmir branch in mind, but different branch breaks compat with some patches + substituteInPlace CMakeLists.txt \ + --replace-fail 'qt5mir2server' 'qtmirserver' - # Need to replace prefix - substituteInPlace data/systemd-user/CMakeLists.txt \ - --replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir)' 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' + # Need to replace prefix + substituteInPlace data/systemd-user/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir)' 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemd_user_unit_dir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' - # Don't embed full paths into regular desktop files (but do embed them into lightdm greeter one) - substituteInPlace data/{indicators-client,lomiri}.desktop.in.in \ - --replace-fail '@CMAKE_INSTALL_FULL_BINDIR@/' "" + # Don't embed full paths into regular desktop files (but do embed them into lightdm greeter one) + substituteInPlace data/{indicators-client,lomiri}.desktop.in.in \ + --replace-fail '@CMAKE_INSTALL_FULL_BINDIR@/' "" - # Exclude tests that don't compile (Mir headers these relied on were removed in mir 2.9) - # fatal error: mirtest/mir/test/doubles/stub_surface.h: No such file or directory - substituteInPlace tests/mocks/CMakeLists.txt \ - --replace-fail 'add_subdirectory(QtMir/Application)' "" + # Exclude tests that don't compile (Mir headers these relied on were removed in mir 2.9) + # fatal error: mirtest/mir/test/doubles/stub_surface.h: No such file or directory + substituteInPlace tests/mocks/CMakeLists.txt \ + --replace-fail 'add_subdirectory(QtMir/Application)' "" - # Seems like the Debian patch that added this didn't read the lightdm greeter entry properly, so everything gets passed twice - substituteInPlace data/lomiri-greeter.desktop.in.in \ - --replace-fail 'lomiri-greeter-wrapper @CMAKE_INSTALL_FULL_BINDIR@/lomiri --mode=greeter' 'lomiri-greeter-wrapper' - substituteInPlace data/lomiri-greeter-wrapper \ - --replace-fail 'LOMIRI_BINARY:-lomiri' "LOMIRI_BINARY:-$out/bin/lomiri" + # Seems like the Debian patch that added this didn't read the lightdm greeter entry properly, so everything gets passed twice + substituteInPlace data/lomiri-greeter.desktop.in.in \ + --replace-fail 'lomiri-greeter-wrapper @CMAKE_INSTALL_FULL_BINDIR@/lomiri --mode=greeter' 'lomiri-greeter-wrapper' + substituteInPlace data/lomiri-greeter-wrapper \ + --replace-fail 'LOMIRI_BINARY:-lomiri' "LOMIRI_BINARY:-$out/bin/lomiri" - # Look up default wallpaper in current system - substituteInPlace plugins/Utils/constants.cpp \ - --replace-fail '/usr/share/backgrounds' '/run/current-system/sw/share/wallpapers' - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - patchShebangs tests/whitespace/check_whitespace.py - ''; + # Look up default wallpaper in current system + substituteInPlace plugins/Utils/constants.cpp \ + --replace-fail '/usr/share/backgrounds' '/run/current-system/sw/share/wallpapers' + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + patchShebangs tests/whitespace/check_whitespace.py + ''; nativeBuildInputs = [ cmake diff --git a/pkgs/desktops/lomiri/applications/morph-browser/default.nix b/pkgs/desktops/lomiri/applications/morph-browser/default.nix index ad6a33346b27..cce21652138f 100644 --- a/pkgs/desktops/lomiri/applications/morph-browser/default.nix +++ b/pkgs/desktops/lomiri/applications/morph-browser/default.nix @@ -43,22 +43,21 @@ stdenv.mkDerivation (finalAttrs: { "doc" ]; - postPatch = - '' - substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \ - --replace-fail '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + postPatch = '' + substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \ + --replace-fail '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" - substituteInPlace src/app/webbrowser/morph-browser.desktop.in.in \ - --replace-fail 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=morph-browser' \ - --replace-fail 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg' + substituteInPlace src/app/webbrowser/morph-browser.desktop.in.in \ + --replace-fail 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=morph-browser' \ + --replace-fail 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg' - substituteInPlace doc/CMakeLists.txt \ - --replace-fail 'COMMAND ''${QDOC_EXECUTABLE} -qt5' 'COMMAND ''${QDOC_EXECUTABLE}' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'add_subdirectory(tests)' "" - ''; + substituteInPlace doc/CMakeLists.txt \ + --replace-fail 'COMMAND ''${QDOC_EXECUTABLE} -qt5' 'COMMAND ''${QDOC_EXECUTABLE}' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(tests)' "" + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/data/lomiri-gsettings-overrides/default.nix b/pkgs/desktops/lomiri/data/lomiri-gsettings-overrides/default.nix index 672c7adbeb8b..8f02f1531eb7 100644 --- a/pkgs/desktops/lomiri/data/lomiri-gsettings-overrides/default.nix +++ b/pkgs/desktops/lomiri/data/lomiri-gsettings-overrides/default.nix @@ -28,7 +28,8 @@ let gsettingsOverridePackages = [ lomiri-schemas - ] ++ extraGSettingsOverridePackages; + ] + ++ extraGSettingsOverridePackages; in runCommand "lomiri-gsettings-overrides" { preferLocalBuild = true; } '' dataDir="$out/share/gsettings-schemas/nixos-gsettings-overrides" diff --git a/pkgs/desktops/lomiri/development/geonames/default.nix b/pkgs/desktops/lomiri/development/geonames/default.nix index 03c18d2067c6..dd6c19d142cb 100644 --- a/pkgs/desktops/lomiri/development/geonames/default.nix +++ b/pkgs/desktops/lomiri/development/geonames/default.nix @@ -31,17 +31,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-AhRnUoku17kVY0UciHQXFDa6eCH6HQ4ZGIOobCaGTKQ="; }; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withExamples [ - "bin" - ] - ++ lib.optionals withDocumentation [ - "devdoc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withExamples [ + "bin" + ] + ++ lib.optionals withDocumentation [ + "devdoc" + ]; postPatch = '' patchShebangs src/generate-locales.sh tests/setup-test-env.sh @@ -49,27 +48,25 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - gettext - glib # glib-compile-resources - pkg-config - validatePkgConfig - ] - ++ lib.optionals withDocumentation [ - docbook-xsl-nons - docbook_xml_dtd_45 - gtk-doc - ]; + nativeBuildInputs = [ + cmake + gettext + glib # glib-compile-resources + pkg-config + validatePkgConfig + ] + ++ lib.optionals withDocumentation [ + docbook-xsl-nons + docbook_xml_dtd_45 + gtk-doc + ]; - buildInputs = - [ - glib - ] - ++ lib.optionals withExamples [ - gtk3 - ]; + buildInputs = [ + glib + ] + ++ lib.optionals withExamples [ + gtk3 + ]; # Tests need to be able to check locale LC_ALL = lib.optionalString finalAttrs.finalPackage.doCheck "en_US.UTF-8"; @@ -82,18 +79,17 @@ stdenv.mkDerivation (finalAttrs: { "LD=${stdenv.cc.targetPrefix}cc" ]; - cmakeFlags = - [ - (lib.cmakeBool "WANT_DOC" withDocumentation) - (lib.cmakeBool "WANT_DEMO" withExamples) - (lib.cmakeBool "WANT_TESTS" finalAttrs.finalPackage.doCheck) - # Keeps finding & using glib-compile-resources from buildInputs otherwise - (lib.cmakeFeature "CMAKE_PROGRAM_PATH" (lib.makeBinPath [ buildPackages.glib.dev ])) - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - # only for cross without native execute support because the canExecute "emulator" call has a format that I can't get CMake to accept - (lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages)) - ]; + cmakeFlags = [ + (lib.cmakeBool "WANT_DOC" withDocumentation) + (lib.cmakeBool "WANT_DEMO" withExamples) + (lib.cmakeBool "WANT_TESTS" finalAttrs.finalPackage.doCheck) + # Keeps finding & using glib-compile-resources from buildInputs otherwise + (lib.cmakeFeature "CMAKE_PROGRAM_PATH" (lib.makeBinPath [ buildPackages.glib.dev ])) + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # only for cross without native execute support because the canExecute "emulator" call has a format that I can't get CMake to accept + (lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages)) + ]; preInstall = lib.optionalString withDocumentation '' # gtkdoc-mkhtml generates images without write permissions, errors out during install diff --git a/pkgs/desktops/lomiri/development/lomiri-app-launch/default.nix b/pkgs/desktops/lomiri/development/lomiri-app-launch/default.nix index 5abab7f6e764..f597587a834c 100644 --- a/pkgs/desktops/lomiri/development/lomiri-app-launch/default.nix +++ b/pkgs/desktops/lomiri/development/lomiri-app-launch/default.nix @@ -33,14 +33,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "lomiri-app-launch"; version = "0.1.12"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withDocumentation [ - "doc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withDocumentation [ + "doc" + ]; src = fetchFromGitLab { owner = "ubports"; @@ -67,20 +66,19 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - dpkg # for setting LOMIRI_APP_LAUNCH_ARCH - gobject-introspection - lttng-ust - pkg-config - validatePkgConfig - ] - ++ lib.optionals withDocumentation [ - doxygen - python3Packages.breathe - sphinx - ]; + nativeBuildInputs = [ + cmake + dpkg # for setting LOMIRI_APP_LAUNCH_ARCH + gobject-introspection + lttng-ust + pkg-config + validatePkgConfig + ] + ++ lib.optionals withDocumentation [ + doxygen + python3Packages.breathe + sphinx + ]; buildInputs = [ cmake-extras diff --git a/pkgs/desktops/lomiri/development/trust-store/default.nix b/pkgs/desktops/lomiri/development/trust-store/default.nix index 489c94e7272e..f3526e8f4102 100644 --- a/pkgs/desktops/lomiri/development/trust-store/default.nix +++ b/pkgs/desktops/lomiri/development/trust-store/default.nix @@ -58,20 +58,19 @@ stdenv.mkDerivation (finalAttrs: { ./1001-treewide-Switch-to-glog-CMake-module.patch ]; - postPatch = - '' - # pkg-config patching hook expects prefix variable - substituteInPlace data/trust-store.pc.in \ - --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \ - --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' + postPatch = '' + # pkg-config patching hook expects prefix variable + substituteInPlace data/trust-store.pc.in \ + --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \ + --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' - substituteInPlace src/core/trust/terminal_agent.h \ - --replace-fail '/bin/whiptail' '${lib.getExe' newt "whiptail"}' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'add_subdirectory(tests)' "" - ''; + substituteInPlace src/core/trust/terminal_agent.h \ + --replace-fail '/bin/whiptail' '${lib.getExe' newt "whiptail"}' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(tests)' "" + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/qml/lomiri-notifications/default.nix b/pkgs/desktops/lomiri/qml/lomiri-notifications/default.nix index 18f9386a63e1..a01c8e80d988 100644 --- a/pkgs/desktops/lomiri/qml/lomiri-notifications/default.nix +++ b/pkgs/desktops/lomiri/qml/lomiri-notifications/default.nix @@ -23,19 +23,18 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-d3fJiYGAYF5e6XPuZ26Lrjj8tUiquunMLDLs9PdAYcA="; }; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" - # Need to replace prefix to not try to install into lomiri-api prefix - substituteInPlace src/CMakeLists.txt \ - --replace-fail '--variable=plugindir' '--define-variable=prefix=''${CMAKE_INSTALL_PREFIX} --variable=plugindir' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'add_subdirectory(test)' "" - ''; + # Need to replace prefix to not try to install into lomiri-api prefix + substituteInPlace src/CMakeLists.txt \ + --replace-fail '--variable=plugindir' '--define-variable=prefix=''${CMAKE_INSTALL_PREFIX} --variable=plugindir' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'add_subdirectory(test)' "" + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/qml/lomiri-settings-components/default.nix b/pkgs/desktops/lomiri/qml/lomiri-settings-components/default.nix index 9575da6de572..f07fe1731d68 100644 --- a/pkgs/desktops/lomiri/qml/lomiri-settings-components/default.nix +++ b/pkgs/desktops/lomiri/qml/lomiri-settings-components/default.nix @@ -22,17 +22,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-H7G3dzzitdyahB/MwgtfRBpo+qMOhmQSzN4EGYculks="; }; - postPatch = - '' - patchShebangs tests/imports/check_imports.py + postPatch = '' + patchShebangs tests/imports/check_imports.py - substituteInPlace CMakeLists.txt \ - --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" '${placeholder "out"}/${qtbase.qtQmlPrefix}' - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - sed -i CMakeLists.txt \ - -e '/add_subdirectory(tests)/d' - ''; + substituteInPlace CMakeLists.txt \ + --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" '${placeholder "out"}/${qtbase.qtQmlPrefix}' + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + sed -i CMakeLists.txt \ + -e '/add_subdirectory(tests)/d' + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/services/biometryd/default.nix b/pkgs/desktops/lomiri/services/biometryd/default.nix index a03b6fb5e7d9..bb55e3ac1142 100644 --- a/pkgs/desktops/lomiri/services/biometryd/default.nix +++ b/pkgs/desktops/lomiri/services/biometryd/default.nix @@ -38,28 +38,27 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - postPatch = - '' - # GTest needs C++17 - # Remove when https://gitlab.com/ubports/development/core/biometryd/-/merge_requests/39 merged & in release - substituteInPlace CMakeLists.txt \ - --replace-fail 'std=c++14' 'std=c++17' + postPatch = '' + # GTest needs C++17 + # Remove when https://gitlab.com/ubports/development/core/biometryd/-/merge_requests/39 merged & in release + substituteInPlace CMakeLists.txt \ + --replace-fail 'std=c++14' 'std=c++17' - # Substitute systemd's prefix in pkg-config call - substituteInPlace data/CMakeLists.txt \ - --replace-fail 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)' 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' + # Substitute systemd's prefix in pkg-config call + substituteInPlace data/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)' 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' - substituteInPlace src/biometry/qml/Biometryd/CMakeLists.txt \ - --replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + substituteInPlace src/biometry/qml/Biometryd/CMakeLists.txt \ + --replace-fail "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" - # For our automatic pkg-config output patcher to work, prefix must be used here - substituteInPlace data/biometryd.pc.in \ - --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \ - --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' \ - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt - ''; + # For our automatic pkg-config output patcher to work, prefix must be used here + substituteInPlace data/biometryd.pc.in \ + --replace-fail 'libdir=''${exec_prefix}' 'libdir=''${prefix}' \ + --replace-fail 'includedir=''${exec_prefix}' 'includedir=''${prefix}' \ + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix b/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix index 81dcef5d8914..cfc8b18cbc09 100644 --- a/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-download-manager/default.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optionals withDocumentation [ "doc" ]; + ] + ++ lib.optionals withDocumentation [ "doc" ]; patches = [ # Remove when version > 0.2.1 @@ -65,18 +66,17 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - validatePkgConfig - wrapQtAppsHook - ] - ++ lib.optionals withDocumentation [ - doxygen - graphviz - qttools # qdoc - ]; + nativeBuildInputs = [ + cmake + pkg-config + validatePkgConfig + wrapQtAppsHook + ] + ++ lib.optionals withDocumentation [ + doxygen + graphviz + qttools # qdoc + ]; buildInputs = [ boost diff --git a/pkgs/desktops/lomiri/services/lomiri-history-service/default.nix b/pkgs/desktops/lomiri/services/lomiri-history-service/default.nix index 14ee2c3e63a0..7ae4e5037d4d 100644 --- a/pkgs/desktops/lomiri/services/lomiri-history-service/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-history-service/default.nix @@ -45,48 +45,47 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - postPatch = - '' - # Upstream's way of generating their schema doesn't work for us, don't quite understand why. - # (gdb) bt - # #0 QSQLiteResult::prepare (this=0x4a4650, query=...) at qsql_sqlite.cpp:406 - # #1 0x00007ffff344bcf4 in QSQLiteResult::reset (this=0x4a4650, query=...) at qsql_sqlite.cpp:378 - # #2 0x00007ffff7f95f39 in QSqlQuery::exec (this=this@entry=0x7fffffffaad8, query=...) at kernel/qsqlquery.cpp:406 - # #3 0x00000000004084cb in SQLiteDatabase::dumpSchema (this=) at /build/source/plugins/sqlite/sqlitedatabase.cpp:148 - # #4 0x0000000000406d70 in main (argc=, argv=) - # at /build/source/plugins/sqlite/schema/generate_schema.cpp:56 - # (gdb) p lastError().driverText().toStdString() - # $17 = {_M_dataplus = {> = {> = {}, }, - # _M_p = 0x4880d0 "Unable to execute statement"}, _M_string_length = 27, { - # _M_local_buf = "\033\000\000\000\000\000\000\000+\344\371\367\377\177\000", _M_allocated_capacity = 27}} - # (gdb) p lastError().databaseText().toStdString() - # $18 = {_M_dataplus = {> = {> = {}, }, - # _M_p = 0x48c480 "no such column: rowid"}, _M_string_length = 21, { - # _M_local_buf = "\025\000\000\000\000\000\000\000A\344\371\367\377\177\000", _M_allocated_capacity = 21}} - # - # This makes the tests stall indefinitely and breaks history-service usage. - # This replacement script should hopefully achieve the same / a similar-enough result with just sqlite - cp ${./update_schema.sh.in} plugins/sqlite/schema/update_schema.sh.in + postPatch = '' + # Upstream's way of generating their schema doesn't work for us, don't quite understand why. + # (gdb) bt + # #0 QSQLiteResult::prepare (this=0x4a4650, query=...) at qsql_sqlite.cpp:406 + # #1 0x00007ffff344bcf4 in QSQLiteResult::reset (this=0x4a4650, query=...) at qsql_sqlite.cpp:378 + # #2 0x00007ffff7f95f39 in QSqlQuery::exec (this=this@entry=0x7fffffffaad8, query=...) at kernel/qsqlquery.cpp:406 + # #3 0x00000000004084cb in SQLiteDatabase::dumpSchema (this=) at /build/source/plugins/sqlite/sqlitedatabase.cpp:148 + # #4 0x0000000000406d70 in main (argc=, argv=) + # at /build/source/plugins/sqlite/schema/generate_schema.cpp:56 + # (gdb) p lastError().driverText().toStdString() + # $17 = {_M_dataplus = {> = {> = {}, }, + # _M_p = 0x4880d0 "Unable to execute statement"}, _M_string_length = 27, { + # _M_local_buf = "\033\000\000\000\000\000\000\000+\344\371\367\377\177\000", _M_allocated_capacity = 27}} + # (gdb) p lastError().databaseText().toStdString() + # $18 = {_M_dataplus = {> = {> = {}, }, + # _M_p = 0x48c480 "no such column: rowid"}, _M_string_length = 21, { + # _M_local_buf = "\025\000\000\000\000\000\000\000A\344\371\367\377\177\000", _M_allocated_capacity = 21}} + # + # This makes the tests stall indefinitely and breaks history-service usage. + # This replacement script should hopefully achieve the same / a similar-enough result with just sqlite + cp ${./update_schema.sh.in} plugins/sqlite/schema/update_schema.sh.in - # Uses pkg_get_variable, cannot substitute prefix with that - substituteInPlace daemon/CMakeLists.txt \ - --replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)' 'set(SYSTEMD_USER_UNIT_DIR "''${CMAKE_INSTALL_PREFIX}/lib/systemd/user")' + # Uses pkg_get_variable, cannot substitute prefix with that + substituteInPlace daemon/CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)' 'set(SYSTEMD_USER_UNIT_DIR "''${CMAKE_INSTALL_PREFIX}/lib/systemd/user")' - # Queries qmake for the QML installation path, which returns a reference to Qt5's build directory - substituteInPlace CMakeLists.txt \ - --replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}" - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - # Tests launch these DBus services, fix paths related to them - substituteInPlace tests/common/dbus-services/CMakeLists.txt \ - ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \ - ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \ - ${replaceDbusService dconf "ca.desrt.dconf.service"} + # Queries qmake for the QML installation path, which returns a reference to Qt5's build directory + substituteInPlace CMakeLists.txt \ + --replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}" + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + # Tests launch these DBus services, fix paths related to them + substituteInPlace tests/common/dbus-services/CMakeLists.txt \ + ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \ + ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \ + ${replaceDbusService dconf "ca.desrt.dconf.service"} - substituteInPlace cmake/modules/GenerateTest.cmake \ - --replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \ - --replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec' - ''; + substituteInPlace cmake/modules/GenerateTest.cmake \ + --replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \ + --replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec' + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix b/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix index 464833d7dfda..1bd4834fccd8 100644 --- a/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-telephony-service/default.nix @@ -52,25 +52,24 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-7WKKRUEEF3NL8S1xg8E1WcD3dGasrw49pydeC4CyL+c="; }; - postPatch = - '' - # Queries qmake for the QML installation path, which returns a reference to Qt5's build directory - # Patch out failure if QMake is not found, since we don't use it - substituteInPlace CMakeLists.txt \ - --replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}" \ - --replace-fail 'QMAKE_EXECUTABLE STREQUAL "QMAKE_EXECUTABLE-NOTFOUND"' 'FALSE' + postPatch = '' + # Queries qmake for the QML installation path, which returns a reference to Qt5's build directory + # Patch out failure if QMake is not found, since we don't use it + substituteInPlace CMakeLists.txt \ + --replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}" \ + --replace-fail 'QMAKE_EXECUTABLE STREQUAL "QMAKE_EXECUTABLE-NOTFOUND"' 'FALSE' - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - substituteInPlace tests/common/dbus-services/CMakeLists.txt \ - ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \ - ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \ - ${replaceDbusService dconf "ca.desrt.dconf.service"} + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + substituteInPlace tests/common/dbus-services/CMakeLists.txt \ + ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \ + ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \ + ${replaceDbusService dconf "ca.desrt.dconf.service"} - substituteInPlace cmake/modules/GenerateTest.cmake \ - --replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \ - --replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec' - ''; + substituteInPlace cmake/modules/GenerateTest.cmake \ + --replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \ + --replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec' + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix b/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix index 0ccb26ab7bad..51e08f5d25cf 100644 --- a/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-thumbnailer/default.nix @@ -111,31 +111,30 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - boost - cmake-extras - gdk-pixbuf - libapparmor - libexif - librsvg - lomiri-api - persistent-cache-cpp - qtbase - qtdeclarative - shared-mime-info - taglib - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - # Something seems borked with bad's h264 decoder, add libav as a workaround - # https://github.com/NixOS/nixpkgs/issues/399599#issuecomment-2816268226 - gst-libav - # maybe add ugly to cover all kinds of formats? - ]); + buildInputs = [ + boost + cmake-extras + gdk-pixbuf + libapparmor + libexif + librsvg + lomiri-api + persistent-cache-cpp + qtbase + qtdeclarative + shared-mime-info + taglib + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad + # Something seems borked with bad's h264 decoder, add libav as a workaround + # https://github.com/NixOS/nixpkgs/issues/399599#issuecomment-2816268226 + gst-libav + # maybe add ugly to cover all kinds of formats? + ]); nativeCheckInputs = [ shared-mime-info diff --git a/pkgs/desktops/lomiri/services/lomiri-url-dispatcher/default.nix b/pkgs/desktops/lomiri/services/lomiri-url-dispatcher/default.nix index c46beb634630..d7a1e7003c98 100644 --- a/pkgs/desktops/lomiri/services/lomiri-url-dispatcher/default.nix +++ b/pkgs/desktops/lomiri/services/lomiri-url-dispatcher/default.nix @@ -45,24 +45,23 @@ stdenv.mkDerivation (finalAttrs: { "lib" ]; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \ + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})' \ - substituteInPlace gui/lomiri-url-dispatcher-gui.desktop.in.in \ - --replace-fail '@CMAKE_INSTALL_FULL_DATADIR@/lomiri-url-dispatcher/gui/lomiri-url-dispatcher-gui.svg' 'lomiri-url-dispatcher-gui' + substituteInPlace gui/lomiri-url-dispatcher-gui.desktop.in.in \ + --replace-fail '@CMAKE_INSTALL_FULL_DATADIR@/lomiri-url-dispatcher/gui/lomiri-url-dispatcher-gui.svg' 'lomiri-url-dispatcher-gui' - substituteInPlace tests/url_dispatcher_testability/CMakeLists.txt \ - --replace-fail "\''${PYTHON_PACKAGE_DIR}" "$out/${python3.sitePackages}" + substituteInPlace tests/url_dispatcher_testability/CMakeLists.txt \ + --replace-fail "\''${PYTHON_PACKAGE_DIR}" "$out/${python3.sitePackages}" - # Update URI handler database whenever new url-handler is installed system-wide - substituteInPlace data/lomiri-url-dispatcher-update-system-dir.*.in \ - --replace-fail '@CMAKE_INSTALL_FULL_DATAROOTDIR@' '/run/current-system/sw/share' - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - patchShebangs tests/test-sql.sh - ''; + # Update URI handler database whenever new url-handler is installed system-wide + substituteInPlace data/lomiri-url-dispatcher-update-system-dir.*.in \ + --replace-fail '@CMAKE_INSTALL_FULL_DATAROOTDIR@' '/run/current-system/sw/share' + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + patchShebangs tests/test-sql.sh + ''; strictDeps = true; diff --git a/pkgs/desktops/lomiri/services/mediascanner2/default.nix b/pkgs/desktops/lomiri/services/mediascanner2/default.nix index 511cf9b42094..b8391e001a17 100644 --- a/pkgs/desktops/lomiri/services/mediascanner2/default.nix +++ b/pkgs/desktops/lomiri/services/mediascanner2/default.nix @@ -59,29 +59,28 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - boost186 - cmake-extras - dbus - dbus-cpp - gdk-pixbuf - glib - libapparmor - libexif - properties-cpp - qtbase - qtdeclarative - shared-mime-info - sqlite - taglib - udisks - ] - ++ (with gst_all_1; [ - gstreamer - gst-plugins-base - gst-plugins-good - ]); + buildInputs = [ + boost186 + cmake-extras + dbus + dbus-cpp + gdk-pixbuf + glib + libapparmor + libexif + properties-cpp + qtbase + qtdeclarative + shared-mime-info + sqlite + taglib + udisks + ] + ++ (with gst_all_1; [ + gstreamer + gst-plugins-base + gst-plugins-good + ]); checkInputs = [ gtest ]; diff --git a/pkgs/desktops/lxde/core/lxpanel/default.nix b/pkgs/desktops/lxde/core/lxpanel/default.nix index 3c68690302e9..fa3f77840c45 100644 --- a/pkgs/desktops/lxde/core/lxpanel/default.nix +++ b/pkgs/desktops/lxde/core/lxpanel/default.nix @@ -71,7 +71,8 @@ stdenv.mkDerivation (finalAttrs: { m4 wirelesstools curl - ] ++ lib.optional supportAlsa alsa-lib; + ] + ++ lib.optional supportAlsa alsa-lib; postPatch = '' substituteInPlace src/Makefile.in \ diff --git a/pkgs/desktops/lxqt/libfm-qt/default.nix b/pkgs/desktops/lxqt/libfm-qt/default.nix index 9e632a68b8a0..74a5afc95c60 100644 --- a/pkgs/desktops/lxqt/libfm-qt/default.nix +++ b/pkgs/desktops/lxqt/libfm-qt/default.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation rec { libxcb lxqt-menu-data menu-cache - ] ++ (lib.optionals (lib.versionAtLeast "2.0.0" version) [ qtx11extras ]); + ] + ++ (lib.optionals (lib.versionAtLeast "2.0.0" version) [ qtx11extras ]); passthru.updateScript = gitUpdater { }; diff --git a/pkgs/desktops/lxqt/xdg-desktop-portal-lxqt/default.nix b/pkgs/desktops/lxqt/xdg-desktop-portal-lxqt/default.nix index a09180cd17c5..5ae0131022af 100644 --- a/pkgs/desktops/lxqt/xdg-desktop-portal-lxqt/default.nix +++ b/pkgs/desktops/lxqt/xdg-desktop-portal-lxqt/default.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { lxqt-qtplugin menu-cache qtbase - ] ++ extraQtStyles; + ] + ++ extraQtStyles; passthru.updateScript = gitUpdater { }; diff --git a/pkgs/desktops/mate/atril/default.nix b/pkgs/desktops/mate/atril/default.nix index b868ab49865f..bf72606031ed 100644 --- a/pkgs/desktops/mate/atril/default.nix +++ b/pkgs/desktops/mate/atril/default.nix @@ -53,23 +53,22 @@ stdenv.mkDerivation rec { yelp-tools ]; - buildInputs = - [ - caja - gtk3 - glib - libarchive - libsecret - libxml2 - poppler - mate-desktop - hicolor-icon-theme - texlive.bin.core # for synctex, used by the pdf back-end - ] - ++ lib.optionals enableDjvu [ djvulibre ] - ++ lib.optionals enableEpub [ webkitgtk_4_1 ] - ++ lib.optionals enablePostScript [ libspectre ] - ++ lib.optionals enableXps [ libgxps ]; + buildInputs = [ + caja + gtk3 + glib + libarchive + libsecret + libxml2 + poppler + mate-desktop + hicolor-icon-theme + texlive.bin.core # for synctex, used by the pdf back-end + ] + ++ lib.optionals enableDjvu [ djvulibre ] + ++ lib.optionals enableEpub [ webkitgtk_4_1 ] + ++ lib.optionals enablePostScript [ libspectre ] + ++ lib.optionals enableXps [ libgxps ]; configureFlags = [ ] diff --git a/pkgs/desktops/mate/engrampa/default.nix b/pkgs/desktops/mate/engrampa/default.nix index 9a27f29bb551..443bcd3a237a 100644 --- a/pkgs/desktops/mate/engrampa/default.nix +++ b/pkgs/desktops/mate/engrampa/default.nix @@ -35,25 +35,23 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - caja - gtk3 - hicolor-icon-theme - json-glib - mate-desktop - ] - ++ lib.optionals withMagic [ - file - ]; + buildInputs = [ + caja + gtk3 + hicolor-icon-theme + json-glib + mate-desktop + ] + ++ lib.optionals withMagic [ + file + ]; - configureFlags = - [ - "--with-cajadir=$$out/lib/caja/extensions-2.0" - ] - ++ lib.optionals withMagic [ - "--enable-magic" - ]; + configureFlags = [ + "--with-cajadir=$$out/lib/caja/extensions-2.0" + ] + ++ lib.optionals withMagic [ + "--enable-magic" + ]; enableParallelBuilding = true; diff --git a/pkgs/desktops/mate/libmatemixer/default.nix b/pkgs/desktops/mate/libmatemixer/default.nix index 22d8d32d0031..27dafe0d630c 100644 --- a/pkgs/desktops/mate/libmatemixer/default.nix +++ b/pkgs/desktops/mate/libmatemixer/default.nix @@ -29,17 +29,16 @@ stdenv.mkDerivation rec { gettext ]; - buildInputs = - [ - glib - ] - ++ lib.optionals alsaSupport [ - alsa-lib - udev - ] - ++ lib.optionals pulseaudioSupport [ - libpulseaudio - ]; + buildInputs = [ + glib + ] + ++ lib.optionals alsaSupport [ + alsa-lib + udev + ] + ++ lib.optionals pulseaudioSupport [ + libpulseaudio + ]; configureFlags = lib.optional ossSupport "--enable-oss"; diff --git a/pkgs/desktops/mate/mate-settings-daemon/default.nix b/pkgs/desktops/mate/mate-settings-daemon/default.nix index 59f3ec38c5b5..5faecb26a132 100644 --- a/pkgs/desktops/mate/mate-settings-daemon/default.nix +++ b/pkgs/desktops/mate/mate-settings-daemon/default.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation rec { gtk3 dconf mate-desktop - ] ++ lib.optional pulseaudioSupport libpulseaudio; + ] + ++ lib.optional pulseaudioSupport libpulseaudio; configureFlags = lib.optional pulseaudioSupport "--enable-pulse"; diff --git a/pkgs/desktops/pantheon/apps/elementary-music/default.nix b/pkgs/desktops/pantheon/apps/elementary-music/default.nix index 12ebf8b41f9c..071c2dd9737c 100644 --- a/pkgs/desktops/pantheon/apps/elementary-music/default.nix +++ b/pkgs/desktops/pantheon/apps/elementary-music/default.nix @@ -36,21 +36,20 @@ stdenv.mkDerivation rec { wrapGAppsHook4 ]; - buildInputs = - [ - elementary-icon-theme - glib - granite7 - gtk4 - libadwaita - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gstreamer - ]); + buildInputs = [ + elementary-icon-theme + glib + granite7 + gtk4 + libadwaita + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gstreamer + ]); preFixup = '' gappsWrapperArgs+=( diff --git a/pkgs/desktops/pantheon/apps/elementary-photos/default.nix b/pkgs/desktops/pantheon/apps/elementary-photos/default.nix index 479d6fb51baa..7d5ddce5b8c8 100644 --- a/pkgs/desktops/pantheon/apps/elementary-photos/default.nix +++ b/pkgs/desktops/pantheon/apps/elementary-photos/default.nix @@ -43,29 +43,28 @@ stdenv.mkDerivation rec { wrapGAppsHook3 ]; - buildInputs = - [ - geocode-glib_2 - gexiv2 - granite - gtk3 - libexif - libgee - libgphoto2 - libgudev - libhandy - libportal-gtk3 - libraw - libwebp - sqlite - ] - ++ (with gst_all_1; [ - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - gstreamer - ]); + buildInputs = [ + geocode-glib_2 + gexiv2 + granite + gtk3 + libexif + libgee + libgphoto2 + libgudev + libhandy + libportal-gtk3 + libraw + libwebp + sqlite + ] + ++ (with gst_all_1; [ + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gstreamer + ]); passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix index d4aa9fcb83e6..9befb909ebba 100644 --- a/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix +++ b/pkgs/desktops/pantheon/apps/switchboard/wrapper.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation { paths = [ switchboard - ] ++ selectedPlugs; + ] + ++ selectedPlugs; passAsFile = [ "paths" ]; diff --git a/pkgs/desktops/pantheon/desktop/elementary-gsettings-schemas/default.nix b/pkgs/desktops/pantheon/desktop/elementary-gsettings-schemas/default.nix index bef2025b19be..345ebfa20fb3 100644 --- a/pkgs/desktops/pantheon/desktop/elementary-gsettings-schemas/default.nix +++ b/pkgs/desktops/pantheon/desktop/elementary-gsettings-schemas/default.nix @@ -24,7 +24,8 @@ let gsettings-desktop-schemas gtk3 mutter - ] ++ extraGSettingsOverridePackages; + ] + ++ extraGSettingsOverridePackages; in diff --git a/pkgs/desktops/pantheon/desktop/wingpanel-indicators/applications-menu/default.nix b/pkgs/desktops/pantheon/desktop/wingpanel-indicators/applications-menu/default.nix index 8c04ca7a6205..3820708ad4b5 100644 --- a/pkgs/desktops/pantheon/desktop/wingpanel-indicators/applications-menu/default.nix +++ b/pkgs/desktops/pantheon/desktop/wingpanel-indicators/applications-menu/default.nix @@ -45,18 +45,17 @@ stdenv.mkDerivation rec { vala ]; - buildInputs = - [ - granite - gtk3 - json-glib - libgee - libhandy - switchboard-with-plugs - wingpanel - zeitgeist - ] - ++ + buildInputs = [ + granite + gtk3 + json-glib + libgee + libhandy + switchboard-with-plugs + wingpanel + zeitgeist + ] + ++ # applications-menu has a plugin to search switchboard plugins # see https://github.com/NixOS/nixpkgs/issues/100209 # wingpanel's wrapper will need to pick up the fact that diff --git a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix index c94b42894dc1..73f21f000920 100644 --- a/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix +++ b/pkgs/desktops/pantheon/desktop/wingpanel/wrapper.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation { paths = [ wingpanel - ] ++ selectedIndicators; + ] + ++ selectedIndicators; passAsFile = [ "paths" ]; diff --git a/pkgs/desktops/plasma-5/breeze-plymouth/default.nix b/pkgs/desktops/plasma-5/breeze-plymouth/default.nix index a4b3b8b42991..164394cfa3a4 100644 --- a/pkgs/desktops/plasma-5/breeze-plymouth/default.nix +++ b/pkgs/desktops/plasma-5/breeze-plymouth/default.nix @@ -36,13 +36,14 @@ assert lib.asserts.assertOneOf "bottomColor" bottomColor validColors; mkDerivation { pname = "breeze-plymouth"; - nativeBuildInputs = - [ extra-cmake-modules ] - ++ lib.optionals (logoFile != null) [ - imagemagick - netpbm - perl - ]; + nativeBuildInputs = [ + extra-cmake-modules + ] + ++ lib.optionals (logoFile != null) [ + imagemagick + netpbm + perl + ]; buildInputs = [ plymouth ]; patches = [ ./install-paths.patch @@ -55,15 +56,14 @@ mkDerivation { ++ lib.optional (topColor != null) "-DBACKGROUND_TOP_COLOR=${topColor}" ++ lib.optional (bottomColor != null) "-DBACKGROUND_BOTTOM_COLOR=${bottomColor}"; - postPatch = - '' - substituteInPlace cmake/FindPlymouth.cmake --subst-var out - '' - + lib.optionalString (logoFile != null) '' - cp ${logoFile} breeze/images/${resolvedLogoName}.logo.png + postPatch = '' + substituteInPlace cmake/FindPlymouth.cmake --subst-var out + '' + + lib.optionalString (logoFile != null) '' + cp ${logoFile} breeze/images/${resolvedLogoName}.logo.png - # conversion for 16bit taken from the breeze-plymouth readme - convert ${logoFile} -alpha Background -background "#000000" -fill "#000000" -flatten tmp.png - pngtopnm tmp.png | pnmquant 16 | pnmtopng > breeze/images/16bit/${resolvedLogoName}.logo.png - ''; + # conversion for 16bit taken from the breeze-plymouth readme + convert ${logoFile} -alpha Background -background "#000000" -fill "#000000" -flatten tmp.png + pngtopnm tmp.png | pnmquant 16 | pnmtopng > breeze/images/16bit/${resolvedLogoName}.logo.png + ''; } diff --git a/pkgs/desktops/xfce/applications/mousepad/default.nix b/pkgs/desktops/xfce/applications/mousepad/default.nix index bbd9e2089b14..f9e7c5f6edb9 100644 --- a/pkgs/desktops/xfce/applications/mousepad/default.nix +++ b/pkgs/desktops/xfce/applications/mousepad/default.nix @@ -39,18 +39,17 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - glib - gspell - gtk3 - gtksourceview4 - libxfce4ui # for shortcut plugin - xfconf # required by libxfce4kbd-private-3 - ] - ++ lib.optionals enablePolkit [ - polkit - ]; + buildInputs = [ + glib + gspell + gtk3 + gtksourceview4 + libxfce4ui # for shortcut plugin + xfconf # required by libxfce4kbd-private-3 + ] + ++ lib.optionals enablePolkit [ + polkit + ]; # Use the GSettings keyfile backend rather than the default mesonFlags = [ "-Dkeyfile-settings=true" ]; diff --git a/pkgs/desktops/xfce/core/libxfce4ui/default.nix b/pkgs/desktops/xfce/core/libxfce4ui/default.nix index 3b4f1a2458b7..66ce6baf9687 100644 --- a/pkgs/desktops/xfce/core/libxfce4ui/default.nix +++ b/pkgs/desktops/xfce/core/libxfce4ui/default.nix @@ -27,14 +27,13 @@ mkXfceDerivation { sha256 = "sha256-CY9KCCbKBAuoYAJtPHlQj04dUuCZAovnyJsBgjzzQkI="; - nativeBuildInputs = - [ - perl - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala # vala bindings require GObject introspection - ]; + nativeBuildInputs = [ + perl + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala # vala bindings require GObject introspection + ]; buildInputs = [ libICE diff --git a/pkgs/desktops/xfce/core/libxfce4util/default.nix b/pkgs/desktops/xfce/core/libxfce4util/default.nix index 4b464eae17a9..2a18289706b9 100644 --- a/pkgs/desktops/xfce/core/libxfce4util/default.nix +++ b/pkgs/desktops/xfce/core/libxfce4util/default.nix @@ -19,14 +19,13 @@ mkXfceDerivation { sha256 = "sha256-QlT5ev4NhjR/apbgYQsjrweJ2IqLySozLYLzCAnmkfM="; - nativeBuildInputs = - [ - python3 - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala # vala bindings require GObject introspection - ]; + nativeBuildInputs = [ + python3 + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala # vala bindings require GObject introspection + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/desktops/xfce/core/libxfce4windowing/default.nix b/pkgs/desktops/xfce/core/libxfce4windowing/default.nix index 0112316d4c83..f29ab999f17c 100644 --- a/pkgs/desktops/xfce/core/libxfce4windowing/default.nix +++ b/pkgs/desktops/xfce/core/libxfce4windowing/default.nix @@ -27,14 +27,13 @@ mkXfceDerivation { sha256 = "sha256-l58cTz28UPSVfoIpjBCoSwcqdUJfG9e4UlhVYPyEeAs="; - nativeBuildInputs = - [ - python3 - wayland-scanner - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + python3 + wayland-scanner + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; buildInputs = [ glib diff --git a/pkgs/desktops/xfce/core/thunar/default.nix b/pkgs/desktops/xfce/core/thunar/default.nix index c8ef61f5c265..8781a53f31f4 100644 --- a/pkgs/desktops/xfce/core/thunar/default.nix +++ b/pkgs/desktops/xfce/core/thunar/default.nix @@ -27,14 +27,13 @@ mkXfceDerivation { sha256 = "sha256-0yDZI82ePjZSSd0aKlfjr2IVPyNkvSWqa4l6Dse98w8="; - nativeBuildInputs = - [ - docbook_xsl - libxslt - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ]; + nativeBuildInputs = [ + docbook_xsl + libxslt + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ]; buildInputs = [ exo diff --git a/pkgs/desktops/xfce/core/xfce4-panel/default.nix b/pkgs/desktops/xfce/core/xfce4-panel/default.nix index 07a1f6ef08d5..4bbd3cde2dfe 100644 --- a/pkgs/desktops/xfce/core/xfce4-panel/default.nix +++ b/pkgs/desktops/xfce/core/xfce4-panel/default.nix @@ -41,14 +41,13 @@ mkXfceDerivation { }) ]; - nativeBuildInputs = - [ - python3 - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala # vala bindings require GObject introspection - ]; + nativeBuildInputs = [ + python3 + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala # vala bindings require GObject introspection + ]; buildInputs = [ cairo diff --git a/pkgs/desktops/xfce/core/xfce4-settings/default.nix b/pkgs/desktops/xfce/core/xfce4-settings/default.nix index d1665d3aa667..397f76744717 100644 --- a/pkgs/desktops/xfce/core/xfce4-settings/default.nix +++ b/pkgs/desktops/xfce/core/xfce4-settings/default.nix @@ -35,33 +35,31 @@ mkXfceDerivation { wayland-scanner ]; - buildInputs = - [ - exo - garcon - glib - gtk3 - gtk-layer-shell - libnotify - libX11 - libXext - libxfce4ui - libxfce4util - libxklavier - wlr-protocols - xf86inputlibinput - xfconf - ] - ++ lib.optionals withUpower [ upower ] - ++ lib.optionals withColord [ colord ]; + buildInputs = [ + exo + garcon + glib + gtk3 + gtk-layer-shell + libnotify + libX11 + libXext + libxfce4ui + libxfce4util + libxklavier + wlr-protocols + xf86inputlibinput + xfconf + ] + ++ lib.optionals withUpower [ upower ] + ++ lib.optionals withColord [ colord ]; - configureFlags = - [ - "--enable-pluggable-dialogs" - "--enable-sound-settings" - ] - ++ lib.optionals withUpower [ "--enable-upower-glib" ] - ++ lib.optionals withColord [ "--enable-colord" ]; + configureFlags = [ + "--enable-pluggable-dialogs" + "--enable-sound-settings" + ] + ++ lib.optionals withUpower [ "--enable-upower-glib" ] + ++ lib.optionals withColord [ "--enable-colord" ]; meta = with lib; { description = "Settings manager for Xfce"; diff --git a/pkgs/desktops/xfce/core/xfconf/default.nix b/pkgs/desktops/xfce/core/xfconf/default.nix index 5b2b83dcccb8..7de2216a9b27 100644 --- a/pkgs/desktops/xfce/core/xfconf/default.nix +++ b/pkgs/desktops/xfce/core/xfconf/default.nix @@ -20,14 +20,13 @@ mkXfceDerivation { sha256 = "sha256-U+Sk7ubBr1ZD1GLQXlxrx0NQdhV/WpVBbnLcc94Tjcw="; - nativeBuildInputs = - [ - perl - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala # vala bindings require GObject introspection - ]; + nativeBuildInputs = [ + perl + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala # vala bindings require GObject introspection + ]; buildInputs = [ libxfce4util ]; diff --git a/pkgs/desktops/xfce/mkXfceDerivation.nix b/pkgs/desktops/xfce/mkXfceDerivation.nix index 05c7812f5d00..4b38d62d5934 100644 --- a/pkgs/desktops/xfce/mkXfceDerivation.nix +++ b/pkgs/desktops/xfce/mkXfceDerivation.nix @@ -72,7 +72,8 @@ let updateScript = gitUpdater { inherit rev-prefix odd-unstable patchlevel-unstable; }; - } // passthru; + } + // passthru; meta = with lib; diff --git a/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix b/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix index 6e7035c53720..04c9ca7dc66c 100644 --- a/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix +++ b/pkgs/desktops/xfce/panel-plugins/xfce4-dockbarx-plugin/default.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation rec { python3Packages.python xfce.xfce4-panel xfce.xfconf - ] ++ pythonPath; + ] + ++ pythonPath; postPatch = '' # We execute the wrapped xfce4-panel-plug directly. diff --git a/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix b/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix index 34d58203d0c2..a0d57d814510 100644 --- a/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix +++ b/pkgs/desktops/xfce/panel-plugins/xfce4-sensors-plugin/default.nix @@ -50,7 +50,8 @@ stdenv.mkDerivation (finalAttrs: { xfce4-panel libnotify lm_sensors - ] ++ lib.optionals nvidiaSupport [ libXNVCtrl ]; + ] + ++ lib.optionals nvidiaSupport [ libXNVCtrl ]; mesonFlags = [ (lib.mesonEnable "xnvctrl" nvidiaSupport) diff --git a/pkgs/desktops/xfce/thunar-plugins/vcs/default.nix b/pkgs/desktops/xfce/thunar-plugins/vcs/default.nix index defbd834841b..086c259c6d85 100644 --- a/pkgs/desktops/xfce/thunar-plugins/vcs/default.nix +++ b/pkgs/desktops/xfce/thunar-plugins/vcs/default.nix @@ -42,20 +42,19 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsHook3 ]; - buildInputs = - [ - thunar - exo - libxfce4ui - libxfce4util - gtk3 - glib - ] - ++ lib.optionals withSubversion [ - apr - aprutil - subversion - ]; + buildInputs = [ + thunar + exo + libxfce4ui + libxfce4util + gtk3 + glib + ] + ++ lib.optionals withSubversion [ + apr + aprutil + subversion + ]; mesonFlags = [ (lib.mesonEnable "svn" withSubversion) diff --git a/pkgs/development/ada-modules/gnatcoll/bindings.nix b/pkgs/development/ada-modules/gnatcoll/bindings.nix index e1d9900a8b7f..5ce297ca684e 100644 --- a/pkgs/development/ada-modules/gnatcoll/bindings.nix +++ b/pkgs/development/ada-modules/gnatcoll/bindings.nix @@ -56,7 +56,8 @@ stdenv.mkDerivation rec { # downstream executable. propagatedBuildInputs = [ gnatcoll-core - ] ++ libsFor."${component}" or [ ]; + ] + ++ libsFor."${component}" or [ ]; # explicit flag for GPL acceptance because upstream # allows a gcc runtime exception for all bindings diff --git a/pkgs/development/ada-modules/gnatcoll/db.nix b/pkgs/development/ada-modules/gnatcoll/db.nix index ad2c90c44438..e124d1159666 100644 --- a/pkgs/development/ada-modules/gnatcoll/db.nix +++ b/pkgs/development/ada-modules/gnatcoll/db.nix @@ -85,21 +85,21 @@ stdenv.mkDerivation rec { # the closure size dramatically ${if onlyExecutable then "buildInputs" else "propagatedBuildInputs"} = [ gnatcoll-core - ] ++ libsFor."${component}" or [ ]; + ] + ++ libsFor."${component}" or [ ]; - makeFlags = - [ - "-C" - component - "PROCESSORS=$(NIX_BUILD_CORES)" - # confusingly, for gprbuild --target is autoconf --host - "TARGET=${stdenv.hostPlatform.config}" - "prefix=${placeholder "out"}" - ] - ++ lib.optionals (component == "sqlite") [ - # link against packaged, not vendored libsqlite3 - "GNATCOLL_SQLITE=external" - ]; + makeFlags = [ + "-C" + component + "PROCESSORS=$(NIX_BUILD_CORES)" + # confusingly, for gprbuild --target is autoconf --host + "TARGET=${stdenv.hostPlatform.config}" + "prefix=${placeholder "out"}" + ] + ++ lib.optionals (component == "sqlite") [ + # link against packaged, not vendored libsqlite3 + "GNATCOLL_SQLITE=external" + ]; meta = with lib; { description = "GNAT Components Collection - Database packages"; diff --git a/pkgs/development/ada-modules/gnatprove/default.nix b/pkgs/development/ada-modules/gnatprove/default.nix index c59c77c3a4cb..ae4ef6fa930d 100644 --- a/pkgs/development/ada-modules/gnatprove/default.nix +++ b/pkgs/development/ada-modules/gnatprove/default.nix @@ -85,38 +85,36 @@ stdenv.mkDerivation { patches = thisSpark.patches or [ ]; - nativeBuildInputs = - [ - gnat - gprbuild - python3 - makeWrapper - ] - ++ (with ocamlPackages; [ - ocaml - findlib - menhir - ]); + nativeBuildInputs = [ + gnat + gprbuild + python3 + makeWrapper + ] + ++ (with ocamlPackages; [ + ocaml + findlib + menhir + ]); - buildInputs = - [ - gnatcoll-core - ] - ++ (with ocamlPackages; [ - ocamlgraph - zarith - ppx_deriving - ppx_sexp_conv - camlzip - menhirLib - num - re - sexplib - yojson - ]) - ++ (lib.optionals (gnat_version == "14") [ - gpr2_24_2_next - ]); + buildInputs = [ + gnatcoll-core + ] + ++ (with ocamlPackages; [ + ocamlgraph + zarith + ppx_deriving + ppx_sexp_conv + camlzip + menhirLib + num + re + sexplib + yojson + ]) + ++ (lib.optionals (gnat_version == "14") [ + gpr2_24_2_next + ]); propagatedBuildInputs = [ gprbuild diff --git a/pkgs/development/ada-modules/gpr2/default.nix b/pkgs/development/ada-modules/gpr2/default.nix index db7fd76264cb..491f21b2869c 100644 --- a/pkgs/development/ada-modules/gpr2/default.nix +++ b/pkgs/development/ada-modules/gpr2/default.nix @@ -29,16 +29,15 @@ stdenv.mkDerivation rec { gprbuild ]; - makeFlags = - [ - "prefix=$(out)" - "PROCESSORS=$(NIX_BUILD_CORES)" - "ENABLE_SHARED=${if enableShared then "yes" else "no"}" - "GPR2_BUILD=release" - ] - ++ lib.optionals (gpr2kbdir != null) [ - "GPR2KBDIR=${gpr2kbdir}" - ]; + makeFlags = [ + "prefix=$(out)" + "PROCESSORS=$(NIX_BUILD_CORES)" + "ENABLE_SHARED=${if enableShared then "yes" else "no"}" + "GPR2_BUILD=release" + ] + ++ lib.optionals (gpr2kbdir != null) [ + "GPR2KBDIR=${gpr2kbdir}" + ]; configurePhase = '' runHook preConfigure diff --git a/pkgs/development/ada-modules/gprbuild/boot.nix b/pkgs/development/ada-modules/gprbuild/boot.nix index 8b7ad156d8a2..99eec758a156 100644 --- a/pkgs/development/ada-modules/gprbuild/boot.nix +++ b/pkgs/development/ada-modules/gprbuild/boot.nix @@ -54,16 +54,15 @@ stdenv.mkDerivation { # introducing a wrapper for it in the future remains TODO. # For the moment this doesn't matter since we have no situation # were gprbuild is used to build something used at build time. - setupHooks = - [ - ./gpr-project-path-hook.sh - ] - ++ lib.optionals stdenv.targetPlatform.isDarwin [ - # This setupHook replaces the paths of shared libraries starting - # with @rpath with the absolute paths on Darwin, so that the - # binaries can be run without additional setup. - ./gpr-project-darwin-rpath-hook.sh - ]; + setupHooks = [ + ./gpr-project-path-hook.sh + ] + ++ lib.optionals stdenv.targetPlatform.isDarwin [ + # This setupHook replaces the paths of shared libraries starting + # with @rpath with the absolute paths on Darwin, so that the + # binaries can be run without additional setup. + ./gpr-project-darwin-rpath-hook.sh + ]; installPhase = '' runHook preInstall diff --git a/pkgs/development/ada-modules/gprbuild/default.nix b/pkgs/development/ada-modules/gprbuild/default.nix index 2d661abd4325..b6f4a32fb441 100644 --- a/pkgs/development/ada-modules/gprbuild/default.nix +++ b/pkgs/development/ada-modules/gprbuild/default.nix @@ -30,17 +30,16 @@ stdenv.mkDerivation { xmlada ]; - makeFlags = - [ - "ENABLE_SHARED=${if stdenv.hostPlatform.isStatic then "no" else "yes"}" - "PROCESSORS=$(NIX_BUILD_CORES)" - # confusingly, for gprbuild --target is autoconf --host - "TARGET=${stdenv.hostPlatform.config}" - "prefix=${placeholder "out"}" - ] - ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ - "LIBRARY_TYPE=relocatable" - ]; + makeFlags = [ + "ENABLE_SHARED=${if stdenv.hostPlatform.isStatic then "no" else "yes"}" + "PROCESSORS=$(NIX_BUILD_CORES)" + # confusingly, for gprbuild --target is autoconf --host + "TARGET=${stdenv.hostPlatform.config}" + "prefix=${placeholder "out"}" + ] + ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ + "LIBRARY_TYPE=relocatable" + ]; env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { # Ensure that there is enough space for the `fixDarwinDylibNames` hook to diff --git a/pkgs/development/beam-modules/build-erlang-mk.nix b/pkgs/development/beam-modules/build-erlang-mk.nix index c5e8e6b5ad18..bf89298c512d 100644 --- a/pkgs/development/beam-modules/build-erlang-mk.nix +++ b/pkgs/development/beam-modules/build-erlang-mk.nix @@ -67,10 +67,11 @@ let ]; propagatedBuildInputs = beamDeps; - buildFlags = - [ "SKIP_DEPS=1" ] - ++ lib.optional (enableDebugInfo || erlang.debugInfo) ''ERL_OPTS="$ERL_OPTS +debug_info"'' - ++ buildFlags; + buildFlags = [ + "SKIP_DEPS=1" + ] + ++ lib.optional (enableDebugInfo || erlang.debugInfo) ''ERL_OPTS="$ERL_OPTS +debug_info"'' + ++ buildFlags; configurePhase = if configurePhase == null then diff --git a/pkgs/development/beam-modules/build-rebar3.nix b/pkgs/development/beam-modules/build-rebar3.nix index 781b6a7a78fe..f8a3d668da48 100644 --- a/pkgs/development/beam-modules/build-rebar3.nix +++ b/pkgs/development/beam-modules/build-rebar3.nix @@ -76,11 +76,10 @@ let addToSearchPath ERL_LIBS "$1/lib/erlang/lib/" ''; - postPatch = - '' - rm -f rebar rebar3 - '' - + postPatch; + postPatch = '' + rm -f rebar rebar3 + '' + + postPatch; buildPhase = '' runHook preBuild @@ -101,7 +100,8 @@ let meta = { inherit (erlang.meta) platforms; - } // meta; + } + // meta; passthru = { packageName = name; diff --git a/pkgs/development/beam-modules/mix-release.nix b/pkgs/development/beam-modules/mix-release.nix index 2ab7f9eaa98a..6c36a83d0514 100644 --- a/pkgs/development/beam-modules/mix-release.nix +++ b/pkgs/development/beam-modules/mix-release.nix @@ -141,24 +141,23 @@ stdenv.mkDerivation ( LANG = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "C"; LC_CTYPE = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "UTF-8"; - postUnpack = - '' - # Mix and Hex - export MIX_HOME="$TEMPDIR/mix" - export HEX_HOME="$TEMPDIR/hex" + postUnpack = '' + # Mix and Hex + export MIX_HOME="$TEMPDIR/mix" + export HEX_HOME="$TEMPDIR/hex" - # Rebar - export REBAR_GLOBAL_CONFIG_DIR="$TEMPDIR/rebar3" - export REBAR_CACHE_DIR="$TEMPDIR/rebar3.cache" + # Rebar + export REBAR_GLOBAL_CONFIG_DIR="$TEMPDIR/rebar3" + export REBAR_CACHE_DIR="$TEMPDIR/rebar3.cache" - ${lib.optionalString (mixFodDeps != null) '' - # Compilation of the dependencies will require that the dependency path is - # writable, thus a copy to the $TEMPDIR is inevitable here. - export MIX_DEPS_PATH="$TEMPDIR/deps" - cp --no-preserve=mode -R "${mixFodDeps}" "$MIX_DEPS_PATH" - ''} - '' - + (attrs.postUnpack or ""); + ${lib.optionalString (mixFodDeps != null) '' + # Compilation of the dependencies will require that the dependency path is + # writable, thus a copy to the $TEMPDIR is inevitable here. + export MIX_DEPS_PATH="$TEMPDIR/deps" + cp --no-preserve=mode -R "${mixFodDeps}" "$MIX_DEPS_PATH" + ''} + '' + + (attrs.postUnpack or ""); configurePhase = attrs.configurePhase or '' @@ -229,64 +228,63 @@ stdenv.mkDerivation ( runHook postInstall ''; - postFixup = - '' - echo "removing files for Microsoft Windows" - rm -f "$out"/bin/*.bat + postFixup = '' + echo "removing files for Microsoft Windows" + rm -f "$out"/bin/*.bat - echo "wrapping programs in $out/bin with their runtime deps" - for f in $(find $out/bin/ -type f -executable); do - wrapProgram "$f" \ - --prefix PATH : ${ - lib.makeBinPath [ - coreutils - gnused - gnugrep - gawk - ] - } + echo "wrapping programs in $out/bin with their runtime deps" + for f in $(find $out/bin/ -type f -executable); do + wrapProgram "$f" \ + --prefix PATH : ${ + lib.makeBinPath [ + coreutils + gnused + gnugrep + gawk + ] + } + done + '' + + lib.optionalString removeCookie '' + if [ -e $out/releases/COOKIE ]; then + echo "removing $out/releases/COOKIE" + rm $out/releases/COOKIE + fi + '' + + '' + if [ -e $out/erts-* ]; then + # ERTS is included in the release, then erlang is not required as a runtime dependency. + # But, erlang is still referenced in some places. To removed references to erlang, + # following steps are required. + + # 1. remove references to erlang from plain text files + for file in $(rg "${erlang}/lib/erlang" "$out" --files-with-matches); do + echo "removing references to erlang in $file" + substituteInPlace "$file" --replace "${erlang}/lib/erlang" "$out" done - '' - + lib.optionalString removeCookie '' - if [ -e $out/releases/COOKIE ]; then - echo "removing $out/releases/COOKIE" - rm $out/releases/COOKIE - fi - '' - + '' - if [ -e $out/erts-* ]; then - # ERTS is included in the release, then erlang is not required as a runtime dependency. - # But, erlang is still referenced in some places. To removed references to erlang, - # following steps are required. - # 1. remove references to erlang from plain text files - for file in $(rg "${erlang}/lib/erlang" "$out" --files-with-matches); do - echo "removing references to erlang in $file" - substituteInPlace "$file" --replace "${erlang}/lib/erlang" "$out" - done + # 2. remove references to erlang from .beam files + # + # No need to do anything, because it has been handled by "deterministic" option specified + # by ERL_COMPILER_OPTIONS. - # 2. remove references to erlang from .beam files - # - # No need to do anything, because it has been handled by "deterministic" option specified - # by ERL_COMPILER_OPTIONS. + # 3. remove references to erlang from normal binary files + for file in $(rg "${erlang}/lib/erlang" "$out" --files-with-matches --binary --iglob '!*.beam'); do + echo "removing references to erlang in $file" + # use bbe to substitute strings in binary files, because using substituteInPlace + # on binaries will raise errors + bbe -e "s|${erlang}/lib/erlang|$out|" -o "$file".tmp "$file" + rm -f "$file" + mv "$file".tmp "$file" + done - # 3. remove references to erlang from normal binary files - for file in $(rg "${erlang}/lib/erlang" "$out" --files-with-matches --binary --iglob '!*.beam'); do - echo "removing references to erlang in $file" - # use bbe to substitute strings in binary files, because using substituteInPlace - # on binaries will raise errors - bbe -e "s|${erlang}/lib/erlang|$out|" -o "$file".tmp "$file" - rm -f "$file" - mv "$file".tmp "$file" - done - - # References to erlang should be removed from output after above processing. - fi - '' - + lib.optionalString stripDebug '' - # Strip debug symbols to avoid hardreferences to "foreign" closures actually - # not needed at runtime, while at the same time reduce size of BEAM files. - erl -noinput -eval 'lists:foreach(fun(F) -> io:format("Stripping ~p.~n", [F]), beam_lib:strip(F) end, filelib:wildcard("'"$out"'/**/*.beam"))' -s init stop - ''; + # References to erlang should be removed from output after above processing. + fi + '' + + lib.optionalString stripDebug '' + # Strip debug symbols to avoid hardreferences to "foreign" closures actually + # not needed at runtime, while at the same time reduce size of BEAM files. + erl -noinput -eval 'lists:foreach(fun(F) -> io:format("Stripping ~p.~n", [F]), beam_lib:strip(F) end, filelib:wildcard("'"$out"'/**/*.beam"))' -s init stop + ''; } ) diff --git a/pkgs/development/beam-modules/rebar3-release.nix b/pkgs/development/beam-modules/rebar3-release.nix index 17f8bac62e48..472e64978d52 100644 --- a/pkgs/development/beam-modules/rebar3-release.nix +++ b/pkgs/development/beam-modules/rebar3-release.nix @@ -111,7 +111,8 @@ let meta = { inherit (erlang.meta) platforms; - } // meta; + } + // meta; passthru = ( { diff --git a/pkgs/development/compilers/binaryen/default.nix b/pkgs/development/compilers/binaryen/default.nix index f6debb04ad82..1943ce9e6b17 100644 --- a/pkgs/development/compilers/binaryen/default.nix +++ b/pkgs/development/compilers/binaryen/default.nix @@ -56,28 +56,27 @@ stdenv.mkDerivation rec { LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib python3 ../check.py $tests ''; - tests = - [ - "version" - "wasm-opt" - "wasm-dis" - "crash" - "dylink" - "ctor-eval" - "wasm-metadce" - "wasm-reduce" - "spec" - "lld" - "wasm2js" - # "unit" # fails on test.unit.test_cluster_fuzz.ClusterFuzz - # "binaryenjs" "binaryenjs_wasm" # not building this - # "lit" # fails on d8/fuzz_shell* - "gtest" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "example" - "validator" - ]; + tests = [ + "version" + "wasm-opt" + "wasm-dis" + "crash" + "dylink" + "ctor-eval" + "wasm-metadce" + "wasm-reduce" + "spec" + "lld" + "wasm2js" + # "unit" # fails on test.unit.test_cluster_fuzz.ClusterFuzz + # "binaryenjs" "binaryenjs_wasm" # not building this + # "lit" # fails on d8/fuzz_shell* + "gtest" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "example" + "validator" + ]; doCheck = (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin); diff --git a/pkgs/development/compilers/c0/default.nix b/pkgs/development/compilers/c0/default.nix index 4f82e9cf2ed2..52acec98cef8 100644 --- a/pkgs/development/compilers/c0/default.nix +++ b/pkgs/development/compilers/c0/default.nix @@ -29,20 +29,19 @@ stdenv.mkDerivation rec { ./use-system-libraries.patch ]; - postPatch = - '' - substituteInPlace cc0/Makefile \ - --replace '$(shell ./get_version.sh)' '${version}' - substituteInPlace cc0/compiler/bin/buildid \ - --replace '`../get_version.sh`' '${version}' \ - --replace '`date`' '1970-01-01T00:00:00Z' \ - --replace '`hostname`' 'nixpkgs' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for f in cc0/compiler/bin/coin-o0-support cc0/compiler/bin/cc0-o0-support; do - substituteInPlace $f --replace '$(brew --prefix gnu-getopt)' '${getopt}' - done - ''; + postPatch = '' + substituteInPlace cc0/Makefile \ + --replace '$(shell ./get_version.sh)' '${version}' + substituteInPlace cc0/compiler/bin/buildid \ + --replace '`../get_version.sh`' '${version}' \ + --replace '`date`' '1970-01-01T00:00:00Z' \ + --replace '`hostname`' 'nixpkgs' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + for f in cc0/compiler/bin/coin-o0-support cc0/compiler/bin/cc0-o0-support; do + substituteInPlace $f --replace '$(brew --prefix gnu-getopt)' '${getopt}' + done + ''; preConfigure = '' cd cc0/ @@ -52,7 +51,8 @@ stdenv.mkDerivation rec { getopt mlton pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ]; buildInputs = [ boehmgc diff --git a/pkgs/development/compilers/chicken/4/chicken.nix b/pkgs/development/compilers/chicken/4/chicken.nix index 3ac84e1fdbe0..21999870e3b2 100644 --- a/pkgs/development/compilers/chicken/4/chicken.nix +++ b/pkgs/development/compilers/chicken/4/chicken.nix @@ -45,17 +45,16 @@ stdenv.mkDerivation { # -fno-strict-overflow is not a supported argument in clang on darwin hardeningDisable = lib.optionals stdenv.hostPlatform.isDarwin [ "strictoverflow" ]; - makeFlags = - [ - "PLATFORM=${platform}" - "PREFIX=$(out)" - "VARDIR=$(out)/var/lib" - ] - ++ (lib.optionals stdenv.hostPlatform.isDarwin [ - "XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin" - "C_COMPILER=$(CC)" - "POSTINSTALL_PROGRAM=${stdenv.cc.targetPrefix}install_name_tool" - ]); + makeFlags = [ + "PLATFORM=${platform}" + "PREFIX=$(out)" + "VARDIR=$(out)/var/lib" + ] + ++ (lib.optionals stdenv.hostPlatform.isDarwin [ + "XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin" + "C_COMPILER=$(CC)" + "POSTINSTALL_PROGRAM=${stdenv.cc.targetPrefix}install_name_tool" + ]); # We need a bootstrap-chicken to regenerate the c-files after # applying a patch to add support for CHICKEN_REPOSITORY_EXTRA @@ -63,13 +62,12 @@ stdenv.mkDerivation { ./0001-Introduce-CHICKEN_REPOSITORY_EXTRA.patch ]; - nativeBuildInputs = - [ - makeWrapper - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + darwin.autoSignDarwinBinariesHook + ]; buildInputs = lib.optionals (bootstrap-chicken != null) [ bootstrap-chicken diff --git a/pkgs/development/compilers/chicken/4/eggDerivation.nix b/pkgs/development/compilers/chicken/4/eggDerivation.nix index b36cfce94d84..cf361be35b90 100644 --- a/pkgs/development/compilers/chicken/4/eggDerivation.nix +++ b/pkgs/development/compilers/chicken/4/eggDerivation.nix @@ -50,7 +50,8 @@ stdenv.mkDerivation ( meta = { inherit (chicken.meta) platforms; - } // args.meta or { }; + } + // args.meta or { }; } // (builtins.removeAttrs args [ "name" diff --git a/pkgs/development/compilers/chicken/5/chicken.nix b/pkgs/development/compilers/chicken/5/chicken.nix index 8ef82e0e7d5e..06b9dd6c1485 100644 --- a/pkgs/development/compilers/chicken/5/chicken.nix +++ b/pkgs/development/compilers/chicken/5/chicken.nix @@ -41,31 +41,29 @@ stdenv.mkDerivation (finalAttrs: { setupHook = lib.optional (bootstrap-chicken != null) ./setup-hook.sh; - makeFlags = - [ - "PLATFORM=${platform}" - "PREFIX=$(out)" - "C_COMPILER=$(CC)" - "CXX_COMPILER=$(CXX)" - ] - ++ (lib.optionals stdenv.hostPlatform.isDarwin [ - "XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin" - "LINKER_OPTIONS=-headerpad_max_install_names" - "POSTINSTALL_PROGRAM=install_name_tool" - ]) - ++ (lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "HOSTSYSTEM=${stdenv.hostPlatform.config}" - "TARGET_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" - "TARGET_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" - ]); + makeFlags = [ + "PLATFORM=${platform}" + "PREFIX=$(out)" + "C_COMPILER=$(CC)" + "CXX_COMPILER=$(CXX)" + ] + ++ (lib.optionals stdenv.hostPlatform.isDarwin [ + "XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin" + "LINKER_OPTIONS=-headerpad_max_install_names" + "POSTINSTALL_PROGRAM=install_name_tool" + ]) + ++ (lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "HOSTSYSTEM=${stdenv.hostPlatform.config}" + "TARGET_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + "TARGET_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" + ]); - nativeBuildInputs = - [ - makeWrapper - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - darwin.autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + darwin.autoSignDarwinBinariesHook + ]; buildInputs = lib.optionals (bootstrap-chicken != null) [ bootstrap-chicken diff --git a/pkgs/development/compilers/chicken/5/eggDerivation.nix b/pkgs/development/compilers/chicken/5/eggDerivation.nix index 623e1ab5560f..8ac4c0aa0890 100644 --- a/pkgs/development/compilers/chicken/5/eggDerivation.nix +++ b/pkgs/development/compilers/chicken/5/eggDerivation.nix @@ -62,7 +62,8 @@ in meta = { inherit (chicken.meta) platforms; - } // args.meta or { }; + } + // args.meta or { }; } // builtins.removeAttrs args [ "name" diff --git a/pkgs/development/compilers/corretto/mk-corretto.nix b/pkgs/development/compilers/corretto/mk-corretto.nix index 5395edf5c3c2..b40c34167537 100644 --- a/pkgs/development/compilers/corretto/mk-corretto.nix +++ b/pkgs/development/compilers/corretto/mk-corretto.nix @@ -67,27 +67,24 @@ jdk.overrideAttrs ( else ":installers:linux:universal:tar:packageBuildResults"; - postBuild = - '' - # Prepare for the installPhase so that it looks like if a normal - # OpenJDK had been built. - dir=build/jdkImageName/images - mkdir -p $dir - file=$(find ./installers -name 'amazon-corretto-${version}*.tar.gz') - tar -xzf $file -C $dir - mv $dir/amazon-corretto-* $dir/jdk - '' - + oldAttrs.postBuild or ""; + postBuild = '' + # Prepare for the installPhase so that it looks like if a normal + # OpenJDK had been built. + dir=build/jdkImageName/images + mkdir -p $dir + file=$(find ./installers -name 'amazon-corretto-${version}*.tar.gz') + tar -xzf $file -C $dir + mv $dir/amazon-corretto-* $dir/jdk + '' + + oldAttrs.postBuild or ""; - installPhase = - oldAttrs.installPhase - + '' - # The installPhase will place everything in $out/lib/openjdk and - # reference through symlinks. We don't rewrite the installPhase but at - # least move the folder to convey that this is not OpenJDK anymore. - mv $out/lib/openjdk $out/lib/corretto - ln -s $out/lib/corretto $out/lib/openjdk - ''; + installPhase = oldAttrs.installPhase + '' + # The installPhase will place everything in $out/lib/openjdk and + # reference through symlinks. We don't rewrite the installPhase but at + # least move the folder to convey that this is not OpenJDK anymore. + mv $out/lib/openjdk $out/lib/corretto + ln -s $out/lib/corretto $out/lib/openjdk + ''; passthru = let diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 5aaf4914c2a5..dfe1b2a8de67 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -120,48 +120,47 @@ let "bin" ]; - postPatch = - '' - export TMP=$(mktemp -d) - export HOME=$TMP - export TMPDIR=$TMP - mkdir -p $HOME/test + postPatch = '' + export TMP=$(mktemp -d) + export HOME=$TMP + export TMPDIR=$TMP + mkdir -p $HOME/test - # Add dependency of crystal to docs to avoid issue on flag changes between releases - # https://github.com/crystal-lang/crystal/pull/8792#issuecomment-614004782 - substituteInPlace Makefile \ - --replace 'docs: ## Generate standard library documentation' 'docs: crystal ## Generate standard library documentation' + # Add dependency of crystal to docs to avoid issue on flag changes between releases + # https://github.com/crystal-lang/crystal/pull/8792#issuecomment-614004782 + substituteInPlace Makefile \ + --replace 'docs: ## Generate standard library documentation' 'docs: crystal ## Generate standard library documentation' - mkdir -p $TMP/crystal + mkdir -p $TMP/crystal - substituteInPlace spec/std/file_spec.cr \ - --replace '/bin/ls' '${coreutils}/bin/ls' \ - --replace '/usr/share' "$TMP/crystal" \ - --replace '/usr' "$TMP" \ - --replace '/tmp' "$TMP" + substituteInPlace spec/std/file_spec.cr \ + --replace '/bin/ls' '${coreutils}/bin/ls' \ + --replace '/usr/share' "$TMP/crystal" \ + --replace '/usr' "$TMP" \ + --replace '/tmp' "$TMP" - substituteInPlace spec/std/process_spec.cr \ - --replace '/bin/cat' '${coreutils}/bin/cat' \ - --replace '/bin/ls' '${coreutils}/bin/ls' \ - --replace '/usr/bin/env' '${coreutils}/bin/env' \ - --replace '"env"' '"${coreutils}/bin/env"' \ - --replace '/usr' "$TMP" \ - --replace '/tmp' "$TMP" + substituteInPlace spec/std/process_spec.cr \ + --replace '/bin/cat' '${coreutils}/bin/cat' \ + --replace '/bin/ls' '${coreutils}/bin/ls' \ + --replace '/usr/bin/env' '${coreutils}/bin/env' \ + --replace '"env"' '"${coreutils}/bin/env"' \ + --replace '/usr' "$TMP" \ + --replace '/tmp' "$TMP" - substituteInPlace spec/std/system_spec.cr \ - --replace '`hostname`' '`${hostname}/bin/hostname`' + substituteInPlace spec/std/system_spec.cr \ + --replace '`hostname`' '`${hostname}/bin/hostname`' - # See https://github.com/crystal-lang/crystal/issues/8629 - substituteInPlace spec/std/socket/udp_socket_spec.cr \ - --replace 'it "joins and transmits to multicast groups"' 'pending "joins and transmits to multicast groups"' + # See https://github.com/crystal-lang/crystal/issues/8629 + substituteInPlace spec/std/socket/udp_socket_spec.cr \ + --replace 'it "joins and transmits to multicast groups"' 'pending "joins and transmits to multicast groups"' - '' - + lib.optionalString (stdenv.cc.isClang && (stdenv.cc.libcxx != null)) '' - # Darwin links against libc++ not libstdc++. Newer versions of clang (12+) require - # libc++abi to be linked explicitly (see https://github.com/NixOS/nixpkgs/issues/166205). - substituteInPlace src/llvm/lib_llvm.cr \ - --replace '@[Link("stdc++")]' '@[Link("c++")]' - ''; + '' + + lib.optionalString (stdenv.cc.isClang && (stdenv.cc.libcxx != null)) '' + # Darwin links against libc++ not libstdc++. Newer versions of clang (12+) require + # libc++abi to be linked explicitly (see https://github.com/NixOS/nixpkgs/issues/166205). + substituteInPlace src/llvm/lib_llvm.cr \ + --replace '@[Link("stdc++")]' '@[Link("c++")]' + ''; # Defaults are 4 preBuild = '' @@ -185,18 +184,17 @@ let llvmPackages.llvm installShellFiles ]; - buildInputs = - [ - boehmgc - pcre2 - libevent - libyaml - zlib - libxml2 - openssl - ] - ++ extraBuildInputs - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; + buildInputs = [ + boehmgc + pcre2 + libevent + libyaml + zlib + libxml2 + openssl + ] + ++ extraBuildInputs + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; makeFlags = [ "CRYSTAL_CONFIG_VERSION=${version}" diff --git a/pkgs/development/compilers/dart/default.nix b/pkgs/development/compilers/dart/default.nix index d5c0862b857c..217bbeab0c46 100644 --- a/pkgs/development/compilers/dart/default.nix +++ b/pkgs/development/compilers/dart/default.nix @@ -23,18 +23,17 @@ stdenv.mkDerivation (finalAttrs: { sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}"); - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - cp -R . $out - '' - + lib.optionalString (stdenv.hostPlatform.isLinux) '' - find $out/bin -executable -type f -exec patchelf --set-interpreter ${bintools.dynamicLinker} {} \; - '' - + '' - runHook postInstall - ''; + cp -R . $out + '' + + lib.optionalString (stdenv.hostPlatform.isLinux) '' + find $out/bin -executable -type f -exec patchelf --set-interpreter ${bintools.dynamicLinker} {} \; + '' + + '' + runHook postInstall + ''; dontStrip = true; @@ -59,12 +58,13 @@ stdenv.mkDerivation (finalAttrs: { testCompile = runCommand "dart-test-compile" { - nativeBuildInputs = - [ finalAttrs.finalPackage ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - darwin.sigtool - ]; + nativeBuildInputs = [ + finalAttrs.finalPackage + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + darwin.sigtool + ]; } '' HELLO_MESSAGE="Hello, world!" diff --git a/pkgs/development/compilers/djgpp/default.nix b/pkgs/development/compilers/djgpp/default.nix index 9b901b9beeca..20ab73d1e08c 100644 --- a/pkgs/development/compilers/djgpp/default.nix +++ b/pkgs/development/compilers/djgpp/default.nix @@ -28,24 +28,23 @@ stdenv.mkDerivation rec { version = s.gccVersion; src = s.src; - patchPhase = - '' - runHook prePatch - for f in "build-djgpp.sh" "script/${version}" "setenv/copyfile.sh"; do - substituteInPlace "$f" --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env' - done - '' - # i686 patches from https://github.com/andrewwutw/build-djgpp/issues/45#issuecomment-1484010755 - # The build script unpacks some files so we can't patch ahead of time, instead patch the script - # to patch after it extracts + patchPhase = '' + runHook prePatch + for f in "build-djgpp.sh" "script/${version}" "setenv/copyfile.sh"; do + substituteInPlace "$f" --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env' + done + '' + # i686 patches from https://github.com/andrewwutw/build-djgpp/issues/45#issuecomment-1484010755 + # The build script unpacks some files so we can't patch ahead of time, instead patch the script + # to patch after it extracts - + lib.optionalString (targetArchitecture == "i686") '' - sed -i 's/i586/i686/g' setenv/setenv script/${version} - sed -i '/Building DXE tools./a sed -i "s/i586/i686/g" src/makefile.def src/dxe/makefile.dxe' script/${version} - '' - + '' - runHook postPatch - ''; + + lib.optionalString (targetArchitecture == "i686") '' + sed -i 's/i586/i686/g' setenv/setenv script/${version} + sed -i '/Building DXE tools./a sed -i "s/i586/i686/g" src/makefile.def src/dxe/makefile.dxe' script/${version} + '' + + '' + runHook postPatch + ''; nativeBuildInputs = [ makeWrapper diff --git a/pkgs/development/compilers/dotnet/build-dotnet.nix b/pkgs/development/compilers/dotnet/build-dotnet.nix index 224d849e18a4..4d0568228c4e 100644 --- a/pkgs/development/compilers/dotnet/build-dotnet.nix +++ b/pkgs/development/compilers/dotnet/build-dotnet.nix @@ -102,15 +102,14 @@ mkWrapper type ( inherit pname version; # Some of these dependencies are `dlopen()`ed. - nativeBuildInputs = - [ - makeWrapper - ] - ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook - ++ lib.optionals (type == "sdk" && stdenv.hostPlatform.isDarwin) [ - xmlstarlet - sigtool - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook + ++ lib.optionals (type == "sdk" && stdenv.hostPlatform.isDarwin) [ + xmlstarlet + sigtool + ]; buildInputs = [ stdenv.cc.cc @@ -119,7 +118,8 @@ mkWrapper type ( libkrb5 curl xmlstarlet - ] ++ lib.optional stdenv.hostPlatform.isLinux lttng-ust_2_12; + ] + ++ lib.optional stdenv.hostPlatform.isLinux lttng-ust_2_12; src = fetchurl ( srcs.${hostRid} or (throw "Missing source (url and hash) for host RID: ${hostRid}") @@ -190,33 +190,32 @@ mkWrapper type ( (global-name "com.apple.system.opendirectoryd.membership")) ''; - passthru = + passthru = { + inherit icu hasILCompiler; + } + // lib.optionalAttrs (type == "sdk") ( + let + # force evaluation of the SDK package to ensure evaluation failures + # (e.g. due to vulnerabilities) propagate to the nuget packages + forceSDKEval = builtins.seq finalAttrs.finalPackage.drvPath; + in { - inherit icu hasILCompiler; - } - // lib.optionalAttrs (type == "sdk") ( - let - # force evaluation of the SDK package to ensure evaluation failures - # (e.g. due to vulnerabilities) propagate to the nuget packages - forceSDKEval = builtins.seq finalAttrs.finalPackage.drvPath; - in - { - packages = map forceSDKEval ( - commonPackages ++ hostPackages.${hostRid} ++ targetPackages.${targetRid} - ); - targetPackages = lib.mapAttrs (_: map forceSDKEval) targetPackages; - inherit runtime aspnetcore; + packages = map forceSDKEval ( + commonPackages ++ hostPackages.${hostRid} ++ targetPackages.${targetRid} + ); + targetPackages = lib.mapAttrs (_: map forceSDKEval) targetPackages; + inherit runtime aspnetcore; - updateScript = - let - majorVersion = lib.concatStringsSep "." (lib.take 2 (lib.splitVersion version)); - in - [ - ./update.sh - majorVersion - ]; - } - ); + updateScript = + let + majorVersion = lib.concatStringsSep "." (lib.take 2 (lib.splitVersion version)); + in + [ + ./update.sh + majorVersion + ]; + } + ); meta = with lib; { description = builtins.getAttr type descriptions; diff --git a/pkgs/development/compilers/dotnet/combine-packages.nix b/pkgs/development/compilers/dotnet/combine-packages.nix index f755c1065410..1b08615b56e8 100644 --- a/pkgs/development/compilers/dotnet/combine-packages.nix +++ b/pkgs/development/compilers/dotnet/combine-packages.nix @@ -35,17 +35,16 @@ mkWrapper "sdk" ( ]; ignoreCollisions = true; nativeBuildInputs = [ makeWrapper ]; - postBuild = - '' - mkdir -p "$out"/share/dotnet - cp "${cli}"/share/dotnet/dotnet $out/share/dotnet - cp -R "${cli}"/nix-support "$out"/ - mkdir "$out"/bin - ln -s "$out"/share/dotnet/dotnet "$out"/bin/dotnet - '' - + lib.optionalString (cli ? man) '' - ln -s ${cli.man} $man - ''; + postBuild = '' + mkdir -p "$out"/share/dotnet + cp "${cli}"/share/dotnet/dotnet $out/share/dotnet + cp -R "${cli}"/nix-support "$out"/ + mkdir "$out"/bin + ln -s "$out"/share/dotnet/dotnet "$out"/bin/dotnet + '' + + lib.optionalString (cli ? man) '' + ln -s ${cli.man} $man + ''; passthru = { pname = "dotnet"; version = "combined"; diff --git a/pkgs/development/compilers/dotnet/default.nix b/pkgs/development/compilers/dotnet/default.nix index 6f4863015504..72d5cde2e1c3 100644 --- a/pkgs/development/compilers/dotnet/default.nix +++ b/pkgs/development/compilers/dotnet/default.nix @@ -121,13 +121,12 @@ let (old: { name = overlay.unwrapped.name; # resolve symlinks so DOTNET_ROOT is self-contained - postBuild = - '' - mv "$out"/share/dotnet{,~} - cp -Lr "$out"/share/dotnet{~,} - rm -r "$out"/share/dotnet~ - '' - + old.postBuild; + postBuild = '' + mv "$out"/share/dotnet{,~} + cp -Lr "$out"/share/dotnet{~,} + rm -r "$out"/share/dotnet~ + '' + + old.postBuild; passthru = old.passthru // ( diff --git a/pkgs/development/compilers/dotnet/packages.nix b/pkgs/development/compilers/dotnet/packages.nix index b75116914e8c..1c57d1a78640 100644 --- a/pkgs/development/compilers/dotnet/packages.nix +++ b/pkgs/development/compilers/dotnet/packages.nix @@ -20,11 +20,9 @@ let args // { outputs = args.outputs or [ "out" ] ++ [ "man" ]; - postFixup = - args.postFixup or "" - + '' - ln -s ${vmr.man} $man - ''; + postFixup = args.postFixup or "" + '' + ln -s ${vmr.man} $man + ''; propagatedSandboxProfile = lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' (allow file-read* (subpath "/private/var/db/mds/system")) (allow mach-lookup (global-name "com.apple.SecurityServer") @@ -86,36 +84,34 @@ let ''; }; - packages = - [ - (mkPackage "Microsoft.AspNetCore.App.Ref" aspnetcore.version) - (mkPackage "Microsoft.NETCore.DotNetAppHost" runtime.version) - (mkPackage "Microsoft.NETCore.App.Ref" runtime.version) - (mkPackage "Microsoft.DotNet.ILCompiler" runtime.version) - (mkPackage "Microsoft.NET.ILLink.Tasks" runtime.version) - (mkPackage "Microsoft.NETCore.App.Crossgen2.${hostRid}" runtime.version) - (mkPackage "runtime.${hostRid}.Microsoft.DotNet.ILCompiler" runtime.version) - ] - ++ lib.optionals (lib.versionOlder runtime.version "9") [ - (mkPackage "Microsoft.NETCore.DotNetHost" runtime.version) - (mkPackage "Microsoft.NETCore.DotNetHostPolicy" runtime.version) - (mkPackage "Microsoft.NETCore.DotNetHostResolver" runtime.version) - ] - ++ targetPackages.${targetRid}; + packages = [ + (mkPackage "Microsoft.AspNetCore.App.Ref" aspnetcore.version) + (mkPackage "Microsoft.NETCore.DotNetAppHost" runtime.version) + (mkPackage "Microsoft.NETCore.App.Ref" runtime.version) + (mkPackage "Microsoft.DotNet.ILCompiler" runtime.version) + (mkPackage "Microsoft.NET.ILLink.Tasks" runtime.version) + (mkPackage "Microsoft.NETCore.App.Crossgen2.${hostRid}" runtime.version) + (mkPackage "runtime.${hostRid}.Microsoft.DotNet.ILCompiler" runtime.version) + ] + ++ lib.optionals (lib.versionOlder runtime.version "9") [ + (mkPackage "Microsoft.NETCore.DotNetHost" runtime.version) + (mkPackage "Microsoft.NETCore.DotNetHostPolicy" runtime.version) + (mkPackage "Microsoft.NETCore.DotNetHostResolver" runtime.version) + ] + ++ targetPackages.${targetRid}; targetPackages = fallbackTargetPackages // { - ${targetRid} = - [ - (mkPackage "Microsoft.AspNetCore.App.Runtime.${targetRid}" aspnetcore.version) - (mkPackage "Microsoft.NETCore.App.Host.${targetRid}" runtime.version) - (mkPackage "Microsoft.NETCore.App.Runtime.${targetRid}" runtime.version) - (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetAppHost" runtime.version) - ] - ++ lib.optionals (lib.versionOlder runtime.version "9") [ - (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetHost" runtime.version) - (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetHostPolicy" runtime.version) - (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetHostResolver" runtime.version) - ]; + ${targetRid} = [ + (mkPackage "Microsoft.AspNetCore.App.Runtime.${targetRid}" aspnetcore.version) + (mkPackage "Microsoft.NETCore.App.Host.${targetRid}" runtime.version) + (mkPackage "Microsoft.NETCore.App.Runtime.${targetRid}" runtime.version) + (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetAppHost" runtime.version) + ] + ++ lib.optionals (lib.versionOlder runtime.version "9") [ + (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetHost" runtime.version) + (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetHostPolicy" runtime.version) + (mkPackage "runtime.${targetRid}.Microsoft.NETCore.DotNetHostResolver" runtime.version) + ]; }; sdk = mkCommon "sdk" rec { diff --git a/pkgs/development/compilers/dotnet/sigtool.nix b/pkgs/development/compilers/dotnet/sigtool.nix index 04e0d5215098..6d45a76c1699 100644 --- a/pkgs/development/compilers/dotnet/sigtool.nix +++ b/pkgs/development/compilers/dotnet/sigtool.nix @@ -19,11 +19,9 @@ darwin.sigtool.overrideAttrs (old: { makeWrapper ]; - postInstall = - old.postInstall or "" - + '' - wrapProgram $out/bin/codesign \ - --set-default CODESIGN_ALLOCATE \ - "${cctools}/bin/${cctools.targetPrefix}codesign_allocate" - ''; + postInstall = old.postInstall or "" + '' + wrapProgram $out/bin/codesign \ + --set-default CODESIGN_ALLOCATE \ + "${cctools}/bin/${cctools.targetPrefix}codesign_allocate" + ''; }) diff --git a/pkgs/development/compilers/dotnet/stage0.nix b/pkgs/development/compilers/dotnet/stage0.nix index efac815de716..e4eca4180c39 100644 --- a/pkgs/development/compilers/dotnet/stage0.nix +++ b/pkgs/development/compilers/dotnet/stage0.nix @@ -57,23 +57,19 @@ let patchNupkgs ]; - postPatch = - old.postPatch or "" - + '' - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n Import \ - -i \$prev -t attr -n Project -v "${./patch-restored-packages.proj}" \ - src/*/Directory.Build.targets - ''; + postPatch = old.postPatch or "" + '' + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n Import \ + -i \$prev -t attr -n Project -v "${./patch-restored-packages.proj}" \ + src/*/Directory.Build.targets + ''; - postConfigure = - old.postConfigure or "" - + '' - [[ ! -v prebuiltPackages ]] || \ - ln -sf "$prebuiltPackages"/share/nuget/source/*/*/*.nupkg prereqs/packages/prebuilt/ - ln -sf "${sdkPackages}"/share/nuget/source/*/*/*.nupkg prereqs/packages/prebuilt/ - ''; + postConfigure = old.postConfigure or "" + '' + [[ ! -v prebuiltPackages ]] || \ + ln -sf "$prebuiltPackages"/share/nuget/source/*/*/*.nupkg prereqs/packages/prebuilt/ + ln -sf "${sdkPackages}"/share/nuget/source/*/*/*.nupkg prereqs/packages/prebuilt/ + ''; buildFlags = old.buildFlags @@ -118,33 +114,31 @@ let nuget-to-json jq ]; - postPatch = - old.postPatch or "" - + '' + postPatch = old.postPatch or "" + '' + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n Import \ + -i \$prev -t attr -n Project -v "${./record-downloaded-packages.proj}" \ + repo-projects/Directory.Build.targets + + # make nuget-client use the standard arcade package-cache dir, which + # is where we scan for dependencies + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n ItemGroup \ + -s \$prev -t elem -n EnvironmentVariables \ + -i \$prev -t attr -n Include -v 'NUGET_PACKAGES=$(ProjectDirectory)artifacts/sb/package-cache/' \ + repo-projects/nuget-client.proj + + # https://github.com/dotnet/dotnet/pull/546 + for proj in arcade nuget-client; do xmlstarlet ed \ --inplace \ - -s //Project -t elem -n Import \ - -i \$prev -t attr -n Project -v "${./record-downloaded-packages.proj}" \ - repo-projects/Directory.Build.targets - - # make nuget-client use the standard arcade package-cache dir, which - # is where we scan for dependencies - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n ItemGroup \ - -s \$prev -t elem -n EnvironmentVariables \ - -i \$prev -t attr -n Include -v 'NUGET_PACKAGES=$(ProjectDirectory)artifacts/sb/package-cache/' \ - repo-projects/nuget-client.proj - - # https://github.com/dotnet/dotnet/pull/546 - for proj in arcade nuget-client; do - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n NoWarn -v '$(NoWarn);NU1901' \ - src/$proj/Directory.Build.props - done - ''; + -s //Project -t elem -n PropertyGroup \ + -s \$prev -t elem -n NoWarn -v '$(NoWarn);NU1901' \ + src/$proj/Directory.Build.props + done + ''; buildFlags = [ "--online" ] ++ old.buildFlags; prebuiltPackages = null; }); diff --git a/pkgs/development/compilers/dotnet/vmr.nix b/pkgs/development/compilers/dotnet/vmr.nix index b4c6e6d6cb34..d86dfd42f8fd 100644 --- a/pkgs/development/compilers/dotnet/vmr.nix +++ b/pkgs/development/compilers/dotnet/vmr.nix @@ -73,50 +73,48 @@ stdenv.mkDerivation rec { hash = tarballHash; }; - nativeBuildInputs = - [ - ensureNewerSourcesForZipFilesHook - jq - curl.bin - git - cmake - pkg-config - python3 - xmlstarlet - unzip - yq - installShellFiles - ] - ++ lib.optionals (lib.versionAtLeast version "9") [ - nodejs - ] - ++ lib.optionals (lib.versionAtLeast version "10") [ - cpio - ] - ++ lib.optionals isDarwin [ - getconf - ]; + nativeBuildInputs = [ + ensureNewerSourcesForZipFilesHook + jq + curl.bin + git + cmake + pkg-config + python3 + xmlstarlet + unzip + yq + installShellFiles + ] + ++ lib.optionals (lib.versionAtLeast version "9") [ + nodejs + ] + ++ lib.optionals (lib.versionAtLeast version "10") [ + cpio + ] + ++ lib.optionals isDarwin [ + getconf + ]; - buildInputs = - [ - # this gets copied into the tree, but we still need the sandbox profile - bootstrapSdk - # the propagated build inputs in llvm.dev break swift compilation - llvm.out - zlib - _icu - openssl - ] - ++ lib.optionals isLinux [ - krb5 - lttng-ust_2_12 - ] - ++ lib.optionals isDarwin [ - xcbuild - swift - krb5 - sigtool - ]; + buildInputs = [ + # this gets copied into the tree, but we still need the sandbox profile + bootstrapSdk + # the propagated build inputs in llvm.dev break swift compilation + llvm.out + zlib + _icu + openssl + ] + ++ lib.optionals isLinux [ + krb5 + lttng-ust_2_12 + ] + ++ lib.optionals isDarwin [ + xcbuild + swift + krb5 + sigtool + ]; # This is required to fix the error: # > CSSM_ModuleLoad(): One or more parameters passed to a function were not valid. @@ -148,218 +146,216 @@ stdenv.mkDerivation rec { ./source-build-externals-overwrite-rather-than-append-.patch ]; - postPatch = + postPatch = '' + # set the sdk version in global.json to match the bootstrap sdk + sdk_version=$(HOME=$(mktemp -d) ${bootstrapSdk}/bin/dotnet --version) + jq '(.tools.dotnet=$dotnet)' global.json --arg dotnet "$sdk_version" > global.json~ + mv global.json{~,} + + patchShebangs $(find -name \*.sh -type f -executable) + + # I'm not sure why this is required, but these files seem to use the wrong + # property name. + # TODO: not needed in 9.0? + [[ ! -f src/xliff-tasks/eng/Versions.props ]] || \ + sed -i 's:\bVersionBase\b:VersionPrefix:g' \ + src/xliff-tasks/eng/Versions.props + + # at least in 9.0 preview 1, this package depends on a specific beta build + # of System.CommandLine + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n PropertyGroup \ + -s \$prev -t elem -n NoWarn -v '$(NoWarn);NU1603' \ + src/nuget-client/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj + + # AD0001 crashes intermittently in source-build-reference-packages with + # CSC : error AD0001: Analyzer 'Microsoft.NetCore.CSharp.Analyzers.Runtime.CSharpDetectPreviewFeatureAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. + # possibly related to https://github.com/dotnet/runtime/issues/90356 + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n PropertyGroup \ + -s \$prev -t elem -n NoWarn -v '$(NoWarn);AD0001' \ + src/source-build-reference-packages/src/referencePackages/Directory.Build.props + + # https://github.com/microsoft/ApplicationInsights-dotnet/issues/2848 + xmlstarlet ed \ + --inplace \ + -u //_:Project/_:PropertyGroup/_:BuildNumber -v 0 \ + src/source-build-externals/src/${lib.optionalString (lib.versionAtLeast version "10") "repos/src/"}application-insights/.props/_GlobalStaticVersion.props + + # this fixes compile errors with clang 15 (e.g. darwin) + substituteInPlace \ + src/runtime/src/native/libs/CMakeLists.txt \ + --replace-fail 'add_compile_options(-Weverything)' 'add_compile_options(-Wall)' + + # strip native symbols in runtime + # see: https://github.com/dotnet/source-build/issues/2543 + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n PropertyGroup \ + -s \$prev -t elem -n KeepNativeSymbols -v false \ + src/runtime/Directory.Build.props + '' + + lib.optionalString (lib.versionAtLeast version "9") ( '' - # set the sdk version in global.json to match the bootstrap sdk - sdk_version=$(HOME=$(mktemp -d) ${bootstrapSdk}/bin/dotnet --version) - jq '(.tools.dotnet=$dotnet)' global.json --arg dotnet "$sdk_version" > global.json~ - mv global.json{~,} - - patchShebangs $(find -name \*.sh -type f -executable) - - # I'm not sure why this is required, but these files seem to use the wrong - # property name. - # TODO: not needed in 9.0? - [[ ! -f src/xliff-tasks/eng/Versions.props ]] || \ - sed -i 's:\bVersionBase\b:VersionPrefix:g' \ - src/xliff-tasks/eng/Versions.props - - # at least in 9.0 preview 1, this package depends on a specific beta build - # of System.CommandLine + # repro.csproj fails to restore due to missing freebsd packages xmlstarlet ed \ --inplace \ -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n NoWarn -v '$(NoWarn);NU1603' \ - src/nuget-client/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj + -s \$prev -t elem -n RuntimeIdentifiers -v ${targetRid} \ + src/runtime/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj - # AD0001 crashes intermittently in source-build-reference-packages with - # CSC : error AD0001: Analyzer 'Microsoft.NetCore.CSharp.Analyzers.Runtime.CSharpDetectPreviewFeatureAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. - # possibly related to https://github.com/dotnet/runtime/issues/90356 + # https://github.com/dotnet/runtime/pull/98559#issuecomment-1965338627 xmlstarlet ed \ --inplace \ -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n NoWarn -v '$(NoWarn);AD0001' \ - src/source-build-reference-packages/src/referencePackages/Directory.Build.props + -s \$prev -t elem -n NoWarn -v '$(NoWarn);CS9216' \ + src/runtime/Directory.Build.props - # https://github.com/microsoft/ApplicationInsights-dotnet/issues/2848 - xmlstarlet ed \ - --inplace \ - -u //_:Project/_:PropertyGroup/_:BuildNumber -v 0 \ - src/source-build-externals/src/${lib.optionalString (lib.versionAtLeast version "10") "repos/src/"}application-insights/.props/_GlobalStaticVersion.props - - # this fixes compile errors with clang 15 (e.g. darwin) + # https://github.com/dotnet/source-build/issues/3131#issuecomment-2030215805 substituteInPlace \ - src/runtime/src/native/libs/CMakeLists.txt \ - --replace-fail 'add_compile_options(-Weverything)' 'add_compile_options(-Wall)' + src/aspnetcore/eng/Dependencies.props \ + --replace-fail \ + "'\$(DotNetBuildSourceOnly)' == 'true'" \ + "'\$(DotNetBuildSourceOnly)' == 'true' and \$(PortableBuild) == 'false'" - # strip native symbols in runtime - # see: https://github.com/dotnet/source-build/issues/2543 + # https://github.com/dotnet/source-build/issues/4325 + xmlstarlet ed \ + --inplace \ + -r '//Target[@Name="UnpackTarballs"]/Move' -v Copy \ + eng/init-source-only.proj + + # error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings] + substituteInPlace \ + src/runtime/src/coreclr/ilasm/CMakeLists.txt \ + --replace-fail 'set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" )' "" + + # https://github.com/dotnet/source-build/issues/4444 + xmlstarlet ed \ + --inplace \ + -s '//Project/Target/MSBuild[@Targets="Restore"]' \ + -t attr -n Properties -v "NUGET_PACKAGES='\$(CurrentRepoSourceBuildPackageCache)'" \ + src/aspnetcore/eng/Tools.props + '' + + lib.optionalString (lib.versionOlder version "10") '' + # patch packages installed from npm cache + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n Import \ + -i \$prev -t attr -n Project -v "${./patch-npm-packages.proj}" \ + src/aspnetcore/eng/DotNetBuild.props + '' + ) + + lib.optionalString isLinux ( + '' + substituteInPlace \ + src/runtime/src/native/libs/System.Security.Cryptography.Native/opensslshim.c \ + --replace-fail '"libssl.so"' '"${openssl.out}/lib/libssl.so"' + + substituteInPlace \ + src/runtime/src/native/libs/System.Net.Security.Native/pal_gssapi.c \ + --replace-fail '"libgssapi_krb5.so.2"' '"${lib.getLib krb5}/lib/libgssapi_krb5.so.2"' + + substituteInPlace \ + src/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c \ + --replace-fail '"libicui18n.so"' '"${icu}/lib/libicui18n.so"' \ + --replace-fail '"libicuuc.so"' '"${icu}/lib/libicuuc.so"' + '' + + lib.optionalString (lib.versionAtLeast version "9") '' + substituteInPlace \ + src/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c \ + --replace-fail '#define VERSIONED_LIB_NAME_LEN 64' '#define VERSIONED_LIB_NAME_LEN 256' + '' + + lib.optionalString (lib.versionOlder version "9") '' + substituteInPlace \ + src/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c \ + --replace-warn 'libicuucName[64]' 'libicuucName[256]' \ + --replace-warn 'libicui18nName[64]' 'libicui18nName[256]' + '' + ) + + lib.optionalString isDarwin ( + '' + substituteInPlace \ + src/runtime/src/native/libs/System.Globalization.Native/CMakeLists.txt \ + --replace-fail '/usr/lib/libicucore.dylib' '${darwin.ICU}/lib/libicucore.dylib' + + substituteInPlace \ + src/runtime/src/installer/managed/Microsoft.NET.HostModel/HostModelUtils.cs \ + '' + + lib.optionalString (lib.versionOlder version "10") " src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets \\\n" + + '' + --replace-fail '/usr/bin/codesign' '${sigtool}/bin/codesign' + + # fix: strip: error: unknown argument '-n' + substituteInPlace \ + src/runtime/eng/native/functions.cmake \ + --replace-fail ' -no_code_signature_warning' "" + + # [...]/installer.singlerid.targets(434,5): error MSB3073: The command "pkgbuild [...]" exited with code 127 xmlstarlet ed \ --inplace \ -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n KeepNativeSymbols -v false \ + -s \$prev -t elem -n SkipInstallerBuild -v true \ src/runtime/Directory.Build.props '' - + lib.optionalString (lib.versionAtLeast version "9") ( - '' - # repro.csproj fails to restore due to missing freebsd packages - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n RuntimeIdentifiers -v ${targetRid} \ - src/runtime/src/coreclr/tools/aot/ILCompiler/repro/repro.csproj + + lib.optionalString (lib.versionAtLeast version "10") '' + xmlstarlet ed \ + --inplace \ + -s //Project -t elem -n PropertyGroup \ + -s \$prev -t elem -n SkipInstallerBuild -v true \ + src/aspnetcore/Directory.Build.props + '' + + '' + # stop passing -sdk without a path + # stop using xcrun + # add -module-cache-path to fix swift errors, see sandboxProfile + # :0: error: unable to open output file '/var/folders/[...]/C/clang/ModuleCache/[...]/SwiftShims-[...].pcm': 'Operation not permitted' + # :0: error: could not build Objective-C module 'SwiftShims' + substituteInPlace \ + src/runtime/src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt \ + --replace-fail ' -sdk ''${CMAKE_OSX_SYSROOT}' "" \ + --replace-fail 'xcrun swiftc' 'swiftc -module-cache-path "$ENV{HOME}/.cache/module-cache"' - # https://github.com/dotnet/runtime/pull/98559#issuecomment-1965338627 - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n NoWarn -v '$(NoWarn);CS9216' \ - src/runtime/Directory.Build.props + # fix: strip: error: unknown argument '-n' + substituteInPlace \ + src/runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets \ + '' + + lib.optionalString (lib.versionAtLeast version "9") " src/runtime/src/native/managed/native-library.targets \\\n" + + '' + --replace-fail ' -no_code_signature_warning' "" - # https://github.com/dotnet/source-build/issues/3131#issuecomment-2030215805 - substituteInPlace \ - src/aspnetcore/eng/Dependencies.props \ - --replace-fail \ - "'\$(DotNetBuildSourceOnly)' == 'true'" \ - "'\$(DotNetBuildSourceOnly)' == 'true' and \$(PortableBuild) == 'false'" + # ld: library not found for -ld_classic + substituteInPlace \ + src/runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets \ + '' + + lib.optionalString (lib.versionOlder version "10") " src/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj \\\n" + + " --replace-fail 'Include=\"-ld_classic\"' \"\"\n" + + lib.optionalString (lib.versionOlder version "9") '' + # [...]/build.proj(123,5): error : Did not find PDBs for the following SDK files: + # [...]/build.proj(123,5): error : sdk/8.0.102/System.Resources.Extensions.dll + # [...]/build.proj(123,5): error : sdk/8.0.102/System.CodeDom.dll + # [...]/build.proj(123,5): error : sdk/8.0.102/FSharp/System.Resources.Extensions.dll + # [...]/build.proj(123,5): error : sdk/8.0.102/FSharp/System.CodeDom.dll + substituteInPlace \ + build.proj \ + --replace-fail 'FailOnMissingPDBs="true"' 'FailOnMissingPDBs="false"' - # https://github.com/dotnet/source-build/issues/4325 - xmlstarlet ed \ - --inplace \ - -r '//Target[@Name="UnpackTarballs"]/Move' -v Copy \ - eng/init-source-only.proj + substituteInPlace \ + src/runtime/src/mono/CMakeLists.txt \ + --replace-fail '/usr/lib/libicucore.dylib' '${darwin.ICU}/lib/libicucore.dylib' + '' + ); - # error: _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror,-W#warnings] - substituteInPlace \ - src/runtime/src/coreclr/ilasm/CMakeLists.txt \ - --replace-fail 'set_source_files_properties( prebuilt/asmparse.cpp PROPERTIES COMPILE_FLAGS "-O0" )' "" + prepFlags = [ + "--no-artifacts" + "--no-prebuilts" + "--with-packages" + bootstrapSdk.artifacts - # https://github.com/dotnet/source-build/issues/4444 - xmlstarlet ed \ - --inplace \ - -s '//Project/Target/MSBuild[@Targets="Restore"]' \ - -t attr -n Properties -v "NUGET_PACKAGES='\$(CurrentRepoSourceBuildPackageCache)'" \ - src/aspnetcore/eng/Tools.props - '' - + lib.optionalString (lib.versionOlder version "10") '' - # patch packages installed from npm cache - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n Import \ - -i \$prev -t attr -n Project -v "${./patch-npm-packages.proj}" \ - src/aspnetcore/eng/DotNetBuild.props - '' - ) - + lib.optionalString isLinux ( - '' - substituteInPlace \ - src/runtime/src/native/libs/System.Security.Cryptography.Native/opensslshim.c \ - --replace-fail '"libssl.so"' '"${openssl.out}/lib/libssl.so"' - - substituteInPlace \ - src/runtime/src/native/libs/System.Net.Security.Native/pal_gssapi.c \ - --replace-fail '"libgssapi_krb5.so.2"' '"${lib.getLib krb5}/lib/libgssapi_krb5.so.2"' - - substituteInPlace \ - src/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c \ - --replace-fail '"libicui18n.so"' '"${icu}/lib/libicui18n.so"' \ - --replace-fail '"libicuuc.so"' '"${icu}/lib/libicuuc.so"' - '' - + lib.optionalString (lib.versionAtLeast version "9") '' - substituteInPlace \ - src/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c \ - --replace-fail '#define VERSIONED_LIB_NAME_LEN 64' '#define VERSIONED_LIB_NAME_LEN 256' - '' - + lib.optionalString (lib.versionOlder version "9") '' - substituteInPlace \ - src/runtime/src/native/libs/System.Globalization.Native/pal_icushim.c \ - --replace-warn 'libicuucName[64]' 'libicuucName[256]' \ - --replace-warn 'libicui18nName[64]' 'libicui18nName[256]' - '' - ) - + lib.optionalString isDarwin ( - '' - substituteInPlace \ - src/runtime/src/native/libs/System.Globalization.Native/CMakeLists.txt \ - --replace-fail '/usr/lib/libicucore.dylib' '${darwin.ICU}/lib/libicucore.dylib' - - substituteInPlace \ - src/runtime/src/installer/managed/Microsoft.NET.HostModel/HostModelUtils.cs \ - '' - + lib.optionalString (lib.versionOlder version "10") " src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets \\\n" - + '' - --replace-fail '/usr/bin/codesign' '${sigtool}/bin/codesign' - - # fix: strip: error: unknown argument '-n' - substituteInPlace \ - src/runtime/eng/native/functions.cmake \ - --replace-fail ' -no_code_signature_warning' "" - - # [...]/installer.singlerid.targets(434,5): error MSB3073: The command "pkgbuild [...]" exited with code 127 - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n SkipInstallerBuild -v true \ - src/runtime/Directory.Build.props - '' - + lib.optionalString (lib.versionAtLeast version "10") '' - xmlstarlet ed \ - --inplace \ - -s //Project -t elem -n PropertyGroup \ - -s \$prev -t elem -n SkipInstallerBuild -v true \ - src/aspnetcore/Directory.Build.props - '' - + '' - # stop passing -sdk without a path - # stop using xcrun - # add -module-cache-path to fix swift errors, see sandboxProfile - # :0: error: unable to open output file '/var/folders/[...]/C/clang/ModuleCache/[...]/SwiftShims-[...].pcm': 'Operation not permitted' - # :0: error: could not build Objective-C module 'SwiftShims' - substituteInPlace \ - src/runtime/src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt \ - --replace-fail ' -sdk ''${CMAKE_OSX_SYSROOT}' "" \ - --replace-fail 'xcrun swiftc' 'swiftc -module-cache-path "$ENV{HOME}/.cache/module-cache"' - - # fix: strip: error: unknown argument '-n' - substituteInPlace \ - src/runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets \ - '' - + lib.optionalString (lib.versionAtLeast version "9") " src/runtime/src/native/managed/native-library.targets \\\n" - + '' - --replace-fail ' -no_code_signature_warning' "" - - # ld: library not found for -ld_classic - substituteInPlace \ - src/runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets \ - '' - + lib.optionalString (lib.versionOlder version "10") " src/runtime/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj \\\n" - + " --replace-fail 'Include=\"-ld_classic\"' \"\"\n" - + lib.optionalString (lib.versionOlder version "9") '' - # [...]/build.proj(123,5): error : Did not find PDBs for the following SDK files: - # [...]/build.proj(123,5): error : sdk/8.0.102/System.Resources.Extensions.dll - # [...]/build.proj(123,5): error : sdk/8.0.102/System.CodeDom.dll - # [...]/build.proj(123,5): error : sdk/8.0.102/FSharp/System.Resources.Extensions.dll - # [...]/build.proj(123,5): error : sdk/8.0.102/FSharp/System.CodeDom.dll - substituteInPlace \ - build.proj \ - --replace-fail 'FailOnMissingPDBs="true"' 'FailOnMissingPDBs="false"' - - substituteInPlace \ - src/runtime/src/mono/CMakeLists.txt \ - --replace-fail '/usr/lib/libicucore.dylib' '${darwin.ICU}/lib/libicucore.dylib' - '' - ); - - prepFlags = - [ - "--no-artifacts" - "--no-prebuilts" - "--with-packages" - bootstrapSdk.artifacts - - ] - # https://github.com/dotnet/source-build/issues/5286#issuecomment-3097872768 - ++ lib.optional (lib.versionAtLeast version "10") "-p:SkipArcadeSdkImport=true"; + ] + # https://github.com/dotnet/source-build/issues/5286#issuecomment-3097872768 + ++ lib.optional (lib.versionAtLeast version "10") "-p:SkipArcadeSdkImport=true"; configurePhase = let @@ -397,22 +393,21 @@ stdenv.mkDerivation rec { # bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) LOCALE_ARCHIVE = lib.optionalString isLinux "${glibcLocales}/lib/locale/locale-archive"; - buildFlags = - [ - "--with-packages" - bootstrapSdk.artifacts - "--clean-while-building" - "--release-manifest" - releaseManifestFile - ] - ++ lib.optionals (lib.versionAtLeast version "9") [ - "--source-build" - ] - ++ [ - "--" - "-p:PortableBuild=true" - ] - ++ lib.optional (targetRid != buildRid) "-p:TargetRid=${targetRid}"; + buildFlags = [ + "--with-packages" + bootstrapSdk.artifacts + "--clean-while-building" + "--release-manifest" + releaseManifestFile + ] + ++ lib.optionals (lib.versionAtLeast version "9") [ + "--source-build" + ] + ++ [ + "--" + "-p:PortableBuild=true" + ] + ++ lib.optional (targetRid != buildRid) "-p:TargetRid=${targetRid}"; buildPhase = '' runHook preBuild diff --git a/pkgs/development/compilers/dotnet/wrapper.nix b/pkgs/development/compilers/dotnet/wrapper.nix index a674d63e1218..2fcaa17f3c6a 100644 --- a/pkgs/development/compilers/dotnet/wrapper.nix +++ b/pkgs/development/compilers/dotnet/wrapper.nix @@ -38,15 +38,14 @@ stdenvNoCC.mkDerivation (finalAttrs: { src = unwrapped; dontUnpack = true; - setupHooks = - [ - ./dotnet-setup-hook.sh - ] - ++ lib.optional (type == "sdk") ( - replaceVars ./dotnet-sdk-setup-hook.sh { - inherit lndir xmlstarlet; - } - ); + setupHooks = [ + ./dotnet-setup-hook.sh + ] + ++ lib.optional (type == "sdk") ( + replaceVars ./dotnet-sdk-setup-hook.sh { + inherit lndir xmlstarlet; + } + ); propagatedSandboxProfile = toString unwrapped.__propagatedSandboxProfile; @@ -111,12 +110,13 @@ stdenvNoCC.mkDerivation (finalAttrs: { propagatedSandboxProfile = toString sdk.__propagatedSandboxProfile; unpackPhase = let - unpackArgs = - [ template ] - ++ lib.optionals (lang != null) [ - "-lang" - lang - ]; + unpackArgs = [ + template + ] + ++ lib.optionals (lang != null) [ + "-lang" + lang + ]; in '' mkdir test @@ -218,14 +218,13 @@ stdenvNoCC.mkDerivation (finalAttrs: { name = "aot"; stdenv = if stdenv.hostPlatform.isDarwin then swiftPackages.stdenv else stdenv; usePackageSource = true; - buildInputs = - [ - zlib - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ - swiftPackages.swift - darwin.ICU - ]; + buildInputs = [ + zlib + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ + swiftPackages.swift + darwin.ICU + ]; build = '' dotnet restore -p:PublishAot=true dotnet publish -p:PublishAot=true -o $out/bin diff --git a/pkgs/development/compilers/ecl/16.1.2.nix b/pkgs/development/compilers/ecl/16.1.2.nix index 8e5082a9defe..cceb45cce1e9 100644 --- a/pkgs/development/compilers/ecl/16.1.2.nix +++ b/pkgs/development/compilers/ecl/16.1.2.nix @@ -32,17 +32,16 @@ stdenv.mkDerivation rec { makeWrapper libtool ]; - propagatedBuildInputs = - [ - libffi - gmp - mpfr - gcc - ] - ++ lib.optionals useBoehmgc [ - # replaces ecl's own gc which other packages can depend on, thus propagated - boehmgc - ]; + propagatedBuildInputs = [ + libffi + gmp + mpfr + gcc + ] + ++ lib.optionals useBoehmgc [ + # replaces ecl's own gc which other packages can depend on, thus propagated + boehmgc + ]; configureFlags = [ (if threadSupport then "--enable-threads" else "--disable-threads") @@ -50,7 +49,8 @@ stdenv.mkDerivation rec { "--with-gmp-libdir=${lib.getLib gmp}/lib" # -incdir, -libdir doesn't seem to be supported for libffi "--with-libffi-prefix=${lib.getDev libffi}" - ] ++ lib.optional (!noUnicode) "--enable-unicode"; + ] + ++ lib.optional (!noUnicode) "--enable-unicode"; patches = [ (fetchpatch { @@ -72,30 +72,29 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; - postInstall = - '' - sed -e 's/@[-a-zA-Z_]*@//g' -i $out/bin/ecl-config - wrapProgram "$out/bin/ecl" \ - --prefix PATH ':' "${ - lib.makeBinPath [ - gcc # for the C compiler - gcc.bintools.bintools # for ar - ] - }" \ - '' - # ecl 16.1.2 is too old to have -libdir for libffi and boehmgc, so we need to - # use NIX_LDFLAGS_BEFORE to make gcc find these particular libraries. - # Since it is missing even the prefix flag for boehmgc we also need to inject - # the correct -I flag via NIX_CFLAGS_COMPILE. Since we have access to it, we - # create the variables with suffixSalt (which seems to be necessary for - # NIX_CFLAGS_COMPILE even). - + lib.optionalString useBoehmgc '' - --prefix NIX_CFLAGS_COMPILE_${gcc.suffixSalt} ' ' "-I${lib.getDev boehmgc}/include" \ - --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib boehmgc}/lib" \ - '' - + '' - --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib libffi}/lib" - ''; + postInstall = '' + sed -e 's/@[-a-zA-Z_]*@//g' -i $out/bin/ecl-config + wrapProgram "$out/bin/ecl" \ + --prefix PATH ':' "${ + lib.makeBinPath [ + gcc # for the C compiler + gcc.bintools.bintools # for ar + ] + }" \ + '' + # ecl 16.1.2 is too old to have -libdir for libffi and boehmgc, so we need to + # use NIX_LDFLAGS_BEFORE to make gcc find these particular libraries. + # Since it is missing even the prefix flag for boehmgc we also need to inject + # the correct -I flag via NIX_CFLAGS_COMPILE. Since we have access to it, we + # create the variables with suffixSalt (which seems to be necessary for + # NIX_CFLAGS_COMPILE even). + + lib.optionalString useBoehmgc '' + --prefix NIX_CFLAGS_COMPILE_${gcc.suffixSalt} ' ' "-I${lib.getDev boehmgc}/include" \ + --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib boehmgc}/lib" \ + '' + + '' + --prefix NIX_LDFLAGS_BEFORE_${gcc.bintools.suffixSalt} ' ' "-L${lib.getLib libffi}/lib" + ''; meta = with lib; { description = "Lisp implementation aiming to be small, fast and easy to embed"; diff --git a/pkgs/development/compilers/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix index f7abbf0df474..c937ad95afa4 100644 --- a/pkgs/development/compilers/ecl/default.nix +++ b/pkgs/development/compilers/ecl/default.nix @@ -38,18 +38,17 @@ stdenv.mkDerivation rec { texinfo makeWrapper ]; - propagatedBuildInputs = - [ - libffi - gmp - mpfr - cc - # replaces ecl's own gc which other packages can depend on, thus propagated - ] - ++ lib.optionals useBoehmgc [ - # replaces ecl's own gc which other packages can depend on, thus propagated - boehmgc - ]; + propagatedBuildInputs = [ + libffi + gmp + mpfr + cc + # replaces ecl's own gc which other packages can depend on, thus propagated + ] + ++ lib.optionals useBoehmgc [ + # replaces ecl's own gc which other packages can depend on, thus propagated + boehmgc + ]; patches = [ # https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/1 @@ -59,19 +58,18 @@ stdenv.mkDerivation rec { }) ]; - configureFlags = - [ - (if threadSupport then "--enable-threads" else "--disable-threads") - "--with-gmp-incdir=${lib.getDev gmp}/include" - "--with-gmp-libdir=${lib.getLib gmp}/lib" - "--with-libffi-incdir=${lib.getDev libffi}/include" - "--with-libffi-libdir=${lib.getLib libffi}/lib" - ] - ++ lib.optionals useBoehmgc [ - "--with-libgc-incdir=${lib.getDev boehmgc}/include" - "--with-libgc-libdir=${lib.getLib boehmgc}/lib" - ] - ++ lib.optional (!noUnicode) "--enable-unicode"; + configureFlags = [ + (if threadSupport then "--enable-threads" else "--disable-threads") + "--with-gmp-incdir=${lib.getDev gmp}/include" + "--with-gmp-libdir=${lib.getLib gmp}/lib" + "--with-libffi-incdir=${lib.getDev libffi}/include" + "--with-libffi-libdir=${lib.getLib libffi}/lib" + ] + ++ lib.optionals useBoehmgc [ + "--with-libgc-incdir=${lib.getDev boehmgc}/include" + "--with-libgc-libdir=${lib.getLib boehmgc}/lib" + ] + ++ lib.optional (!noUnicode) "--enable-unicode"; hardeningDisable = [ "format" ]; diff --git a/pkgs/development/compilers/elm/lib/default.nix b/pkgs/development/compilers/elm/lib/default.nix index 5f6fa9f724b3..cab55981084d 100644 --- a/pkgs/development/compilers/elm/lib/default.nix +++ b/pkgs/development/compilers/elm/lib/default.nix @@ -8,17 +8,13 @@ let patchNpmElm = pkg: pkg.override (old: { - preRebuild = - (old.preRebuild or "") - + '' - rm node_modules/elm/install.js - echo "console.log('Nixpkgs\' version of Elm will be used');" > node_modules/elm/install.js - ''; - postInstall = - (old.postInstall or "") - + '' - ln -sf ${elm}/bin/elm node_modules/elm/bin/elm - ''; + preRebuild = (old.preRebuild or "") + '' + rm node_modules/elm/install.js + echo "console.log('Nixpkgs\' version of Elm will be used');" > node_modules/elm/install.js + ''; + postInstall = (old.postInstall or "") + '' + ln -sf ${elm}/bin/elm node_modules/elm/bin/elm + ''; }); in { diff --git a/pkgs/development/compilers/factor-lang/mk-factor-application.nix b/pkgs/development/compilers/factor-lang/mk-factor-application.nix index 0aaa075d006b..eb2fad57c70a 100644 --- a/pkgs/development/compilers/factor-lang/mk-factor-application.nix +++ b/pkgs/development/compilers/factor-lang/mk-factor-application.nix @@ -85,7 +85,8 @@ in nativeBuildInputs = [ makeWrapper (lib.hiPrio finalAttrs.wrapped-factor) - ] ++ attrs.nativeBuildInputs or [ ]; + ] + ++ attrs.nativeBuildInputs or [ ]; buildInputs = (lib.optional enableUI gdk-pixbuf) ++ attrs.buildInputs or [ ]; @@ -131,11 +132,13 @@ in passthru = { vocab = finalAttrs.src; - } // attrs.passthru or { }; + } + // attrs.passthru or { }; meta = { platforms = wrapped-factor.meta.platforms; mainProgram = finalAttrs.binName; - } // attrs.meta or { }; + } + // attrs.meta or { }; } ) diff --git a/pkgs/development/compilers/factor-lang/wrapper.nix b/pkgs/development/compilers/factor-lang/wrapper.nix index 354eac944923..f0cb45c454ad 100644 --- a/pkgs/development/compilers/factor-lang/wrapper.nix +++ b/pkgs/development/compilers/factor-lang/wrapper.nix @@ -87,61 +87,60 @@ stdenv.mkDerivation (finalAttrs: { dontUnpack = true; - installPhase = - '' - runHook preInstall - '' - + optionalString guiSupport '' - # Set Gdk pixbuf loaders file to the one from the build dependencies here - unset GDK_PIXBUF_MODULE_FILE - # Defined in gdk-pixbuf setup hook - findGdkPixbufLoaders "${librsvg}" - makeWrapperArgs+=(--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE") - '' - + '' - makeWrapperArgs+=( - --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:${lib.makeLibraryPath runtimeLibs} - --prefix PATH : ${lib.makeBinPath bins}) - mkdir -p "$out/bin" "$out/share" - cp -r "${factor-unwrapped}/lib" "$out/" - cp -r "${factor-unwrapped}/share/emacs" "$out/share/" - chmod -R u+w "$out/lib" "$out/share" - ( - cd ${vocabTree} - for f in "lib/factor/"* ; do - rm -r "$out/$f" - ln -s "${vocabTree}/$f" "$out/$f" - done - ) + installPhase = '' + runHook preInstall + '' + + optionalString guiSupport '' + # Set Gdk pixbuf loaders file to the one from the build dependencies here + unset GDK_PIXBUF_MODULE_FILE + # Defined in gdk-pixbuf setup hook + findGdkPixbufLoaders "${librsvg}" + makeWrapperArgs+=(--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE") + '' + + '' + makeWrapperArgs+=( + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:${lib.makeLibraryPath runtimeLibs} + --prefix PATH : ${lib.makeBinPath bins}) + mkdir -p "$out/bin" "$out/share" + cp -r "${factor-unwrapped}/lib" "$out/" + cp -r "${factor-unwrapped}/share/emacs" "$out/share/" + chmod -R u+w "$out/lib" "$out/share" + ( + cd ${vocabTree} + for f in "lib/factor/"* ; do + rm -r "$out/$f" + ln -s "${vocabTree}/$f" "$out/$f" + done + ) - # There is no ld.so.cache in NixOS so we construct one - # out of known libraries. The side effect is that find-lib - # will work only on the known libraries. There does not seem - # to be a generic solution here. - find $(echo ${ - lib.makeLibraryPath ([ stdenv.cc.libc ] ++ runtimeLibs) - } | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst - (echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'"; - for l in $(<$TMPDIR/so.lst); do - echo " $(basename $l) (libc6,x86-64) => $l"; - done)> $out/lib/factor/ld.so.cache + # There is no ld.so.cache in NixOS so we construct one + # out of known libraries. The side effect is that find-lib + # will work only on the known libraries. There does not seem + # to be a generic solution here. + find $(echo ${ + lib.makeLibraryPath ([ stdenv.cc.libc ] ++ runtimeLibs) + } | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst + (echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'"; + for l in $(<$TMPDIR/so.lst); do + echo " $(basename $l) (libc6,x86-64) => $l"; + done)> $out/lib/factor/ld.so.cache - # Create a wrapper in bin/ and lib/factor/ - wrapProgram "$out/lib/factor/factor" \ - --argv0 factor \ - --set FACTOR_LD_SO_CACHE "$out/lib/factor/ld.so.cache" \ - "''${makeWrapperArgs[@]}" - mv $out/lib/factor/factor.image $out/lib/factor/.factor-wrapped.image - cp $out/lib/factor/factor $out/bin/ + # Create a wrapper in bin/ and lib/factor/ + wrapProgram "$out/lib/factor/factor" \ + --argv0 factor \ + --set FACTOR_LD_SO_CACHE "$out/lib/factor/ld.so.cache" \ + "''${makeWrapperArgs[@]}" + mv $out/lib/factor/factor.image $out/lib/factor/.factor-wrapped.image + cp $out/lib/factor/factor $out/bin/ - # Emacs fuel expects the image being named `factor.image` in the factor base dir - ln -rs $out/lib/factor/.factor-wrapped.image $out/lib/factor/factor.image + # Emacs fuel expects the image being named `factor.image` in the factor base dir + ln -rs $out/lib/factor/.factor-wrapped.image $out/lib/factor/factor.image - # Update default paths in fuel-listener.el to new output - sed -E -i -e 's#(\(defcustom fuel-factor-root-dir ").*(")#'"\1$out/lib/factor\2#" \ - "$out/share/emacs/site-lisp/fuel-listener.el" - runHook postInstall - ''; + # Update default paths in fuel-listener.el to new output + sed -E -i -e 's#(\(defcustom fuel-factor-root-dir ").*(")#'"\1$out/lib/factor\2#" \ + "$out/share/emacs/site-lisp/fuel-listener.el" + runHook postInstall + ''; inherit doInstallCheck; disabledTests = toFactorArgs [ diff --git a/pkgs/development/compilers/fbc/default.nix b/pkgs/development/compilers/fbc/default.nix index 0b8677854a50..3b92dfa9ff5d 100644 --- a/pkgs/development/compilers/fbc/default.nix +++ b/pkgs/development/compilers/fbc/default.nix @@ -35,19 +35,18 @@ stdenv.mkDerivation rec { buildPackages.libffi ]; - buildInputs = - [ - ncurses - libffi - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gpm - libGL - libX11 - libXext - libXpm - libXrandr - ]; + buildInputs = [ + ncurses + libffi + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gpm + libGL + libX11 + libXext + libXpm + libXrandr + ]; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix b/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix index e241afb20809..69c776102d7d 100644 --- a/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix +++ b/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix @@ -32,12 +32,11 @@ let lib.optionalString (!flutter.engine.isOptimized) "_unopt" }"; - flutterBuildFlags = - [ - "--${flutterMode}" - ] - ++ (args.flutterBuildFlags or [ ]) - ++ flutterFlags; + flutterBuildFlags = [ + "--${flutterMode}" + ] + ++ (args.flutterBuildFlags or [ ]) + ++ flutterFlags; builderArgs = rec { diff --git a/pkgs/development/compilers/flutter/engine/default.nix b/pkgs/development/compilers/flutter/engine/default.nix index 77572096b360..6e90cc916ec7 100644 --- a/pkgs/development/compilers/flutter/engine/default.nix +++ b/pkgs/development/compilers/flutter/engine/default.nix @@ -58,20 +58,19 @@ stdenv.mkDerivation ( dontUnpack = true; dontBuild = true; - installPhase = + installPhase = '' + mkdir -p $out/out + '' + + lib.concatMapStrings ( + runtimeMode: + let + runtimeModeBuild = runtimeModesBuilds.${runtimeMode}; + runtimeModeOut = runtimeModeBuild.outName; + in '' - mkdir -p $out/out + ln -sf ${runtimeModeBuild}/out/${runtimeModeOut} $out/out/${runtimeModeOut} '' - + lib.concatMapStrings ( - runtimeMode: - let - runtimeModeBuild = runtimeModesBuilds.${runtimeMode}; - runtimeModeOut = runtimeModeBuild.outName; - in - '' - ln -sf ${runtimeModeBuild}/out/${runtimeModeOut} $out/out/${runtimeModeOut} - '' - ) runtimeModes; + ) runtimeModes; } // runtimeModesBuilds ) diff --git a/pkgs/development/compilers/flutter/engine/package.nix b/pkgs/development/compilers/flutter/engine/package.nix index f960a9d99f28..c998490525fc 100644 --- a/pkgs/development/compilers/flutter/engine/package.nix +++ b/pkgs/development/compilers/flutter/engine/package.nix @@ -164,33 +164,33 @@ stdenv.mkDerivation (finalAttrs: { NIX_CFLAGS_COMPILE = [ "-I${finalAttrs.toolchain}/include" - ] ++ lib.optional (!isOptimized) "-U_FORTIFY_SOURCE"; + ] + ++ lib.optional (!isOptimized) "-U_FORTIFY_SOURCE"; nativeCheckInputs = lib.optionals stdenv.hostPlatform.isLinux [ xorg.xorgserver openbox ]; - nativeBuildInputs = - [ - (python3.withPackages ( - ps: with ps; [ - pyyaml - ] - )) - (tools.vpython python3) - gitMinimal - pkg-config - ninja - dart - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ patchelf ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - darwin.system_cmds - darwin.xcode - tools.xcode-select - ] - ++ lib.optionals (stdenv.cc.libc ? bin) [ stdenv.cc.libc.bin ]; + nativeBuildInputs = [ + (python3.withPackages ( + ps: with ps; [ + pyyaml + ] + )) + (tools.vpython python3) + gitMinimal + pkg-config + ninja + dart + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ patchelf ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + darwin.system_cmds + darwin.xcode + tools.xcode-select + ] + ++ lib.optionals (stdenv.cc.libc ? bin) [ stdenv.cc.libc.bin ]; buildInputs = [ gtk3 ]; @@ -202,7 +202,8 @@ stdenv.mkDerivation (finalAttrs: { dartPath "flutter" "." - ] ++ lib.optional (lib.versionAtLeast flutterVersion "3.21") "flutter/third_party/skia"; + ] + ++ lib.optional (lib.versionAtLeast flutterVersion "3.21") "flutter/third_party/skia"; postUnpack = '' pushd ${src.name} @@ -256,42 +257,40 @@ stdenv.mkDerivation (finalAttrs: { popd ''; - configureFlags = - [ - "--no-prebuilt-dart-sdk" - "--embedder-for-target" - "--no-goma" - ] - ++ lib.optionals (stdenv.targetPlatform.isx86_64 == false) [ - "--linux" - "--linux-cpu ${constants.alt-arch}" - ] - ++ lib.optional (!isOptimized) "--unoptimized" - ++ lib.optional (runtimeMode == "debug") "--no-stripped" - ++ lib.optional finalAttrs.finalPackage.doCheck "--enable-unittests" - ++ lib.optional (!finalAttrs.finalPackage.doCheck) "--no-enable-unittests"; + configureFlags = [ + "--no-prebuilt-dart-sdk" + "--embedder-for-target" + "--no-goma" + ] + ++ lib.optionals (stdenv.targetPlatform.isx86_64 == false) [ + "--linux" + "--linux-cpu ${constants.alt-arch}" + ] + ++ lib.optional (!isOptimized) "--unoptimized" + ++ lib.optional (runtimeMode == "debug") "--no-stripped" + ++ lib.optional finalAttrs.finalPackage.doCheck "--enable-unittests" + ++ lib.optional (!finalAttrs.finalPackage.doCheck) "--no-enable-unittests"; # NOTE: Once https://github.com/flutter/flutter/issues/127606 is fixed, use "--no-prebuilt-dart-sdk" - configurePhase = - '' - runHook preConfigure + configurePhase = '' + runHook preConfigure - export PYTHONPATH=$src/src/build - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export PATH=${darwin.xcode}/Contents/Developer/usr/bin/:$PATH - '' - + '' - python3 ./src/flutter/tools/gn $configureFlags \ - --runtime-mode $runtimeMode \ - --out-dir $out \ - --target-sysroot $toolchain \ - --target-dir $outName \ - --target-triple ${stdenv.targetPlatform.config} \ - --enable-fontconfig + export PYTHONPATH=$src/src/build + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export PATH=${darwin.xcode}/Contents/Developer/usr/bin/:$PATH + '' + + '' + python3 ./src/flutter/tools/gn $configureFlags \ + --runtime-mode $runtimeMode \ + --out-dir $out \ + --target-sysroot $toolchain \ + --target-dir $outName \ + --target-triple ${stdenv.targetPlatform.config} \ + --enable-fontconfig - runHook postConfigure - ''; + runHook postConfigure + ''; buildPhase = '' runHook preBuild @@ -318,21 +317,20 @@ stdenv.mkDerivation (finalAttrs: { rm src/out/run_tests.log ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - rm -rf $out/out/$outName/{obj,exe.unstripped,lib.unstripped,zip_archives} - rm $out/out/$outName/{args.gn,build.ninja,build.ninja.d,compile_commands.json,toolchain.ninja} - find $out/out/$outName -name '*_unittests' -delete - find $out/out/$outName -name '*_benchmarks' -delete - '' - + lib.optionalString (finalAttrs.finalPackage.doCheck) '' - rm $out/out/$outName/{display_list_rendertests,flutter_tester} - '' - + '' - runHook postInstall - ''; + rm -rf $out/out/$outName/{obj,exe.unstripped,lib.unstripped,zip_archives} + rm $out/out/$outName/{args.gn,build.ninja,build.ninja.d,compile_commands.json,toolchain.ninja} + find $out/out/$outName -name '*_unittests' -delete + find $out/out/$outName -name '*_benchmarks' -delete + '' + + lib.optionalString (finalAttrs.finalPackage.doCheck) '' + rm $out/out/$outName/{display_list_rendertests,flutter_tester} + '' + + '' + runHook postInstall + ''; passthru = { dart = callPackage ./dart.nix { engine = finalAttrs.finalPackage; }; diff --git a/pkgs/development/compilers/flutter/flutter-tools.nix b/pkgs/development/compilers/flutter/flutter-tools.nix index be00380ad91b..299d4a93c500 100644 --- a/pkgs/development/compilers/flutter/flutter-tools.nix +++ b/pkgs/development/compilers/flutter/flutter-tools.nix @@ -25,15 +25,14 @@ buildDartApplication.override { inherit dart; } rec { inherit patches; # The given patches are made for the entire SDK source tree. prePatch = ''pushd "$NIX_BUILD_TOP/source"''; - postPatch = - '' - popd - '' - # Use arm64 instead of arm64e. - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace lib/src/ios/xcodeproj.dart \ - --replace-fail arm64e arm64 - ''; + postPatch = '' + popd + '' + # Use arm64 instead of arm64e. + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace lib/src/ios/xcodeproj.dart \ + --replace-fail arm64e arm64 + ''; # When the JIT snapshot is being built, the application needs to run. # It attempts to generate configuration files, and relies on a few external diff --git a/pkgs/development/compilers/flutter/flutter.nix b/pkgs/development/compilers/flutter/flutter.nix index 143f2179495a..f5a9f42a3c61 100644 --- a/pkgs/development/compilers/flutter/flutter.nix +++ b/pkgs/development/compilers/flutter/flutter.nix @@ -69,7 +69,8 @@ let makeWrapper jq gitMinimal - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; strictDeps = true; preConfigure = '' @@ -153,7 +154,8 @@ let doInstallCheck = true; nativeInstallCheckInputs = [ which - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; installCheckPhase = '' runHook preInstallCheck @@ -165,24 +167,23 @@ let runHook postInstallCheck ''; - passthru = - { - # TODO: rely on engine.version instead of engineVersion - inherit - dart - engineVersion - artifactHashes - channel - ; - tools = flutterTools; - # The derivation containing the original Flutter SDK files. - # When other derivations wrap this one, any unmodified files - # found here should be included as-is, for tooling compatibility. - sdk = unwrapped; - } - // lib.optionalAttrs (engine != null) { - inherit engine; - }; + passthru = { + # TODO: rely on engine.version instead of engineVersion + inherit + dart + engineVersion + artifactHashes + channel + ; + tools = flutterTools; + # The derivation containing the original Flutter SDK files. + # When other derivations wrap this one, any unmodified files + # found here should be included as-is, for tooling compatibility. + sdk = unwrapped; + } + // lib.optionalAttrs (engine != null) { + inherit engine; + }; meta = with lib; { description = "Flutter is Google's SDK for building mobile, web and desktop with Dart"; diff --git a/pkgs/development/compilers/flutter/wrapper.nix b/pkgs/development/compilers/flutter/wrapper.nix index 8b5d38393b47..703e280dc14b 100644 --- a/pkgs/development/compilers/flutter/wrapper.nix +++ b/pkgs/development/compilers/flutter/wrapper.nix @@ -4,17 +4,16 @@ darwin, callPackage, flutter, - supportedTargetFlutterPlatforms ? - [ - "universal" - "web" - ] - ++ lib.optional (stdenv.hostPlatform.isLinux && !(flutter ? engine)) "linux" - ++ lib.optional (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isDarwin) "android" - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "macos" - "ios" - ], + supportedTargetFlutterPlatforms ? [ + "universal" + "web" + ] + ++ lib.optional (stdenv.hostPlatform.isLinux && !(flutter ? engine)) "linux" + ++ lib.optional (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isDarwin) "android" + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "macos" + "ios" + ], artifactHashes ? flutter.artifactHashes, extraPkgConfigPackages ? [ ], extraLibraries ? [ ], @@ -148,13 +147,14 @@ in pname = "flutter-wrapped"; inherit (flutter) version; - nativeBuildInputs = - [ makeWrapper ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ] - ++ lib.optionals supportsLinuxDesktopTarget [ - glib - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ] + ++ lib.optionals supportsLinuxDesktopTarget [ + glib + wrapGAppsHook3 + ]; passthru = flutter.passthru // { inherit (flutter) version; @@ -166,46 +166,45 @@ in dontUnpack = true; dontWrapGApps = true; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - for path in ${ - builtins.concatStringsSep " " ( - builtins.foldl' ( - paths: pkg: - paths - ++ (map (directory: "'${pkg}/${directory}/pkgconfig'") [ - "lib" - "share" - ]) - ) [ ] pkgConfigPackages - ) - }; do - addToSearchPath FLUTTER_PKG_CONFIG_PATH "$path" - done + for path in ${ + builtins.concatStringsSep " " ( + builtins.foldl' ( + paths: pkg: + paths + ++ (map (directory: "'${pkg}/${directory}/pkgconfig'") [ + "lib" + "share" + ]) + ) [ ] pkgConfigPackages + ) + }; do + addToSearchPath FLUTTER_PKG_CONFIG_PATH "$path" + done - mkdir -p $out/bin - makeWrapper '${immutableFlutter}' $out/bin/flutter \ - --set-default ANDROID_EMULATOR_USE_SYSTEM_LIBS 1 \ - '' - + lib.optionalString (flutter ? engine && flutter.engine.meta.available) '' - --set-default FLUTTER_ENGINE "${flutter.engine}" \ - --add-flags "--local-engine-host ${flutter.engine.outName}" \ - '' - + '' - --suffix PATH : '${lib.makeBinPath (tools ++ buildTools)}' \ - --suffix PKG_CONFIG_PATH : "$FLUTTER_PKG_CONFIG_PATH" \ - --suffix LIBRARY_PATH : '${lib.makeLibraryPath appStaticBuildDeps}' \ - --prefix CXXFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCxxFlags)}' \ - --prefix CFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCFlags)}' \ - --prefix LDFLAGS "''\t" '${ - builtins.concatStringsSep " " (map (flag: "-Wl,${flag}") linkerFlags) - }' \ - ''${gappsWrapperArgs[@]} + mkdir -p $out/bin + makeWrapper '${immutableFlutter}' $out/bin/flutter \ + --set-default ANDROID_EMULATOR_USE_SYSTEM_LIBS 1 \ + '' + + lib.optionalString (flutter ? engine && flutter.engine.meta.available) '' + --set-default FLUTTER_ENGINE "${flutter.engine}" \ + --add-flags "--local-engine-host ${flutter.engine.outName}" \ + '' + + '' + --suffix PATH : '${lib.makeBinPath (tools ++ buildTools)}' \ + --suffix PKG_CONFIG_PATH : "$FLUTTER_PKG_CONFIG_PATH" \ + --suffix LIBRARY_PATH : '${lib.makeLibraryPath appStaticBuildDeps}' \ + --prefix CXXFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCxxFlags)}' \ + --prefix CFLAGS "''\t" '${builtins.concatStringsSep " " (includeFlags ++ extraCFlags)}' \ + --prefix LDFLAGS "''\t" '${ + builtins.concatStringsSep " " (map (flag: "-Wl,${flag}") linkerFlags) + }' \ + ''${gappsWrapperArgs[@]} - runHook postInstall - ''; + runHook postInstall + ''; inherit (flutter) meta; } diff --git a/pkgs/development/compilers/fpc/default.nix b/pkgs/development/compilers/fpc/default.nix index 63a6102a0ece..c9df54eaf1f3 100644 --- a/pkgs/development/compilers/fpc/default.nix +++ b/pkgs/development/compilers/fpc/default.nix @@ -40,17 +40,16 @@ stdenv.mkDerivation rec { glibc = stdenv.cc.libc.out; # Patch paths for linux systems. Other platforms will need their own patches. - patches = - [ - ./mark-paths.patch # mark paths for later substitution in postPatch - ] - ++ lib.optional stdenv.hostPlatform.isAarch64 (fetchpatch { - # backport upstream patch for aarch64 glibc 2.34 - url = "https://gitlab.com/freepascal.org/fpc/source/-/commit/a20a7e3497bccf3415bf47ccc55f133eb9d6d6a0.patch"; - hash = "sha256-xKTBwuOxOwX9KCazQbBNLhMXCqkuJgIFvlXewHY63GM="; - stripLen = 1; - extraPrefix = "fpcsrc/"; - }); + patches = [ + ./mark-paths.patch # mark paths for later substitution in postPatch + ] + ++ lib.optional stdenv.hostPlatform.isAarch64 (fetchpatch { + # backport upstream patch for aarch64 glibc 2.34 + url = "https://gitlab.com/freepascal.org/fpc/source/-/commit/a20a7e3497bccf3415bf47ccc55f133eb9d6d6a0.patch"; + hash = "sha256-xKTBwuOxOwX9KCazQbBNLhMXCqkuJgIFvlXewHY63GM="; + stripLen = 1; + extraPrefix = "fpcsrc/"; + }); postPatch = '' # substitute the markers set by the mark-paths patch diff --git a/pkgs/development/compilers/fpc/lazarus.nix b/pkgs/development/compilers/fpc/lazarus.nix index 236748501791..aa14ec3336a7 100644 --- a/pkgs/development/compilers/fpc/lazarus.nix +++ b/pkgs/development/compilers/fpc/lazarus.nix @@ -58,25 +58,24 @@ stdenv.mkDerivation rec { cp ${overrides} ide/${overrides.name} ''; - buildInputs = - [ - # we need gtk2 unconditionally as that is the default target when building applications with lazarus - fpc - gtk2 - glib - libXi - xorgproto - libX11 - libXext - pango - atk - stdenv.cc - gdk-pixbuf - ] - ++ lib.optionals withQt [ - libqtpas - qtbase - ]; + buildInputs = [ + # we need gtk2 unconditionally as that is the default target when building applications with lazarus + fpc + gtk2 + glib + libXi + xorgproto + libX11 + libXext + pango + atk + stdenv.cc + gdk-pixbuf + ] + ++ lib.optionals withQt [ + libqtpas + qtbase + ]; # Disable parallel build, errors: # Fatal: (1018) Compilation aborted @@ -84,7 +83,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper - ] ++ lib.optional withQt wrapQtAppsHook; + ] + ++ lib.optional withQt wrapQtAppsHook; makeFlags = [ "FPC=fpc" diff --git a/pkgs/development/compilers/fpc/libqtpas.nix b/pkgs/development/compilers/fpc/libqtpas.nix index 5cce2ae6de4f..10169f14eb9d 100644 --- a/pkgs/development/compilers/fpc/libqtpas.nix +++ b/pkgs/development/compilers/fpc/libqtpas.nix @@ -24,13 +24,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ qmake ]; - buildInputs = - [ - qtbase - ] - ++ lib.optionals (qtVersion == "5") [ - qtx11extras - ]; + buildInputs = [ + qtbase + ] + ++ lib.optionals (qtVersion == "5") [ + qtx11extras + ]; dontWrapQtApps = true; diff --git a/pkgs/development/compilers/gambit/build.nix b/pkgs/development/compilers/gambit/build.nix index 2c9cdd2a66a9..3bd9307d2abc 100644 --- a/pkgs/development/compilers/gambit/build.nix +++ b/pkgs/development/compilers/gambit/build.nix @@ -67,43 +67,42 @@ gccStdenv.mkDerivation rec { # Or wrap relevant programs to add a suitable PATH ? #runtimeDeps = [ gnused gnugrep ]; - configureFlags = - [ - "--enable-targets=${gambit-params.targets}" - "--enable-single-host" - "--enable-c-opt=${optimizationSetting}" - "--enable-c-opt-rts=-O2" - "--enable-gcc-opts" - "--enable-trust-c-tco" - "--enable-shared" - "--enable-absolute-shared-libs" # Yes, NixOS will want an absolute path, and fix it. - "--enable-openssl" - "--enable-dynamic-clib" - #"--enable-default-compile-options='(compactness 9)'" # Make life easier on the JS backend - "--enable-default-runtime-options=${gambit-params.defaultRuntimeOptions}" - # "--enable-rtlib-debug" # used by Geiser, but only on recent-enough gambit, and messes js runtime - # "--enable-debug" # Nope: enables plenty of good stuff, but also the costly console.log - # "--enable-multiple-versions" # Nope, NixOS already does version multiplexing - # "--enable-guide" - # "--enable-track-scheme" - # "--enable-high-res-timing" - # "--enable-max-processors=4" - # "--enable-multiple-vms" - # "--enable-dynamic-tls" - # "--enable-multiple-threaded-vms" # when SMP branch is merged in - # "--enable-thread-system=posix" # default when --enable-multiple-vms is on. - # "--enable-profile" - # "--enable-coverage" - # "--enable-inline-jumps" - # "--enable-char-size=1" # default is 4 - # "--enable-march=native" # Nope, makes it not work on machines older than the builder - ] - ++ gambit-params.extraOptions - # TODO: pick an appropriate architecture to optimize on on x86-64? - # https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/i386-and-x86-64-Options.html#i386-and-x86-64-Options - # ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 "--enable-march=core-avx2" - # Do not enable poll on darwin due to https://github.com/gambit/gambit/issues/498 - ++ lib.optional (!gccStdenv.hostPlatform.isDarwin) "--enable-poll"; + configureFlags = [ + "--enable-targets=${gambit-params.targets}" + "--enable-single-host" + "--enable-c-opt=${optimizationSetting}" + "--enable-c-opt-rts=-O2" + "--enable-gcc-opts" + "--enable-trust-c-tco" + "--enable-shared" + "--enable-absolute-shared-libs" # Yes, NixOS will want an absolute path, and fix it. + "--enable-openssl" + "--enable-dynamic-clib" + #"--enable-default-compile-options='(compactness 9)'" # Make life easier on the JS backend + "--enable-default-runtime-options=${gambit-params.defaultRuntimeOptions}" + # "--enable-rtlib-debug" # used by Geiser, but only on recent-enough gambit, and messes js runtime + # "--enable-debug" # Nope: enables plenty of good stuff, but also the costly console.log + # "--enable-multiple-versions" # Nope, NixOS already does version multiplexing + # "--enable-guide" + # "--enable-track-scheme" + # "--enable-high-res-timing" + # "--enable-max-processors=4" + # "--enable-multiple-vms" + # "--enable-dynamic-tls" + # "--enable-multiple-threaded-vms" # when SMP branch is merged in + # "--enable-thread-system=posix" # default when --enable-multiple-vms is on. + # "--enable-profile" + # "--enable-coverage" + # "--enable-inline-jumps" + # "--enable-char-size=1" # default is 4 + # "--enable-march=native" # Nope, makes it not work on machines older than the builder + ] + ++ gambit-params.extraOptions + # TODO: pick an appropriate architecture to optimize on on x86-64? + # https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/i386-and-x86-64-Options.html#i386-and-x86-64-Options + # ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 "--enable-march=core-avx2" + # Do not enable poll on darwin due to https://github.com/gambit/gambit/issues/498 + ++ lib.optional (!gccStdenv.hostPlatform.isDarwin) "--enable-poll"; configurePhase = '' export CC=${gccStdenv.cc}/bin/${gccStdenv.cc.targetPrefix}gcc \ diff --git a/pkgs/development/compilers/gcc/common/builder.nix b/pkgs/development/compilers/gcc/common/builder.nix index 31ee6215eb85..7080666572d6 100644 --- a/pkgs/development/compilers/gcc/common/builder.nix +++ b/pkgs/development/compilers/gcc/common/builder.nix @@ -175,36 +175,34 @@ originalAttrs: eval "$oldOpts" ''; - preConfigure = - (originalAttrs.preConfigure or "") - + '' - if test -n "$newlibSrc"; then - tar xvf "$newlibSrc" -C .. - ln -s ../newlib-*/newlib newlib - # Patch to get armvt5el working: - sed -i -e 's/ arm)/ arm*)/' newlib/configure.host - fi + preConfigure = (originalAttrs.preConfigure or "") + '' + if test -n "$newlibSrc"; then + tar xvf "$newlibSrc" -C .. + ln -s ../newlib-*/newlib newlib + # Patch to get armvt5el working: + sed -i -e 's/ arm)/ arm*)/' newlib/configure.host + fi - # Bug - they packaged zlib - if test -d "zlib"; then - # This breaks the build without-headers, which should build only - # the target libgcc as target libraries. - # See 'configure:5370' - rm -Rf zlib - fi + # Bug - they packaged zlib + if test -d "zlib"; then + # This breaks the build without-headers, which should build only + # the target libgcc as target libraries. + # See 'configure:5370' + rm -Rf zlib + fi - if test -n "$crossMingw" -a -n "$withoutTargetLibc"; then - mkdir -p ../mingw - # --with-build-sysroot expects that: - cp -R $libcCross/include ../mingw - appendToVar configureFlags "--with-build-sysroot=`pwd`/.." - fi + if test -n "$crossMingw" -a -n "$withoutTargetLibc"; then + mkdir -p ../mingw + # --with-build-sysroot expects that: + cp -R $libcCross/include ../mingw + appendToVar configureFlags "--with-build-sysroot=`pwd`/.." + fi - # Perform the build in a different directory. - mkdir ../build - cd ../build - configureScript=../$sourceRoot/configure - ''; + # Perform the build in a different directory. + mkdir ../build + cd ../build + configureScript=../$sourceRoot/configure + ''; postConfigure = '' # Avoid store paths when embedding ./configure flags into gcc. @@ -266,100 +264,99 @@ originalAttrs: makeCompatibilitySymlink lib $targetConfig/lib64 ''; - postInstall = - '' - # Clean up our compatibility symlinks (see above) - for link in "''${compatibilitySymlinks[@]}"; do - echo "Removing compatibility symlink: $link" - rm -f "$link" - done + postInstall = '' + # Clean up our compatibility symlinks (see above) + for link in "''${compatibilitySymlinks[@]}"; do + echo "Removing compatibility symlink: $link" + rm -f "$link" + done - # Move target runtime libraries to lib output. - # For non-cross, they're in $out/lib; for cross, they're in $out/$targetConfig/lib. - targetLibDir="''${targetConfig+$targetConfig/}lib" + # Move target runtime libraries to lib output. + # For non-cross, they're in $out/lib; for cross, they're in $out/$targetConfig/lib. + targetLibDir="''${targetConfig+$targetConfig/}lib" - moveToOutput "$targetLibDir/lib*.so*" "''${!outputLib}" - moveToOutput "$targetLibDir/lib*.dylib" "''${!outputLib}" - moveToOutput "$targetLibDir/lib*.dll.a" "''${!outputLib}" - moveToOutput "$targetLibDir/lib*.dll" "''${!outputLib}" - moveToOutput "share/gcc-*/python" "''${!outputLib}" + moveToOutput "$targetLibDir/lib*.so*" "''${!outputLib}" + moveToOutput "$targetLibDir/lib*.dylib" "''${!outputLib}" + moveToOutput "$targetLibDir/lib*.dll.a" "''${!outputLib}" + moveToOutput "$targetLibDir/lib*.dll" "''${!outputLib}" + moveToOutput "share/gcc-*/python" "''${!outputLib}" - if [ -z "$enableShared" ]; then - moveToOutput "$targetLibDir/lib*.a" "''${!outputLib}" - fi + if [ -z "$enableShared" ]; then + moveToOutput "$targetLibDir/lib*.a" "''${!outputLib}" + fi - for i in "''${!outputLib}"/$targetLibDir/*.py; do - substituteInPlace "$i" --replace "$out" "''${!outputLib}" - done + for i in "''${!outputLib}"/$targetLibDir/*.py; do + substituteInPlace "$i" --replace "$out" "''${!outputLib}" + done - # Multilib and cross can't exist at the same time, so just use lib64 here - if [ -n "$enableMultilib" ]; then - moveToOutput "lib64/lib*.so*" "''${!outputLib}" - moveToOutput "lib64/lib*.dylib" "''${!outputLib}" - moveToOutput "lib64/lib*.dll.a" "''${!outputLib}" - moveToOutput "lib64/lib*.dll" "''${!outputLib}" + # Multilib and cross can't exist at the same time, so just use lib64 here + if [ -n "$enableMultilib" ]; then + moveToOutput "lib64/lib*.so*" "''${!outputLib}" + moveToOutput "lib64/lib*.dylib" "''${!outputLib}" + moveToOutput "lib64/lib*.dll.a" "''${!outputLib}" + moveToOutput "lib64/lib*.dll" "''${!outputLib}" - for i in "''${!outputLib}"/lib64/*.py; do - substituteInPlace "$i" --replace "$out" "''${!outputLib}" - done - fi + for i in "''${!outputLib}"/lib64/*.py; do + substituteInPlace "$i" --replace "$out" "''${!outputLib}" + done + fi - # Remove `fixincl' to prevent a retained dependency on the - # previous gcc. - rm -rf $out/libexec/gcc/*/*/install-tools - rm -rf $out/lib/gcc/*/*/install-tools + # Remove `fixincl' to prevent a retained dependency on the + # previous gcc. + rm -rf $out/libexec/gcc/*/*/install-tools + rm -rf $out/lib/gcc/*/*/install-tools - # More dependencies with the previous gcc or some libs (gccbug stores the build command line) - rm -rf $out/bin/gccbug + # More dependencies with the previous gcc or some libs (gccbug stores the build command line) + rm -rf $out/bin/gccbug - # Remove .la files, they're not adjusted for the makeCompatibilitySymlink magic, - # which confuses libtool and leads to weird linking errors. - # Removing the files just makes libtool link .so files directly, which is usually - # what we want anyway. - find $out -name '*.la' -delete + # Remove .la files, they're not adjusted for the makeCompatibilitySymlink magic, + # which confuses libtool and leads to weird linking errors. + # Removing the files just makes libtool link .so files directly, which is usually + # what we want anyway. + find $out -name '*.la' -delete - if type "install_name_tool"; then - for i in "''${!outputLib}"/lib/*.*.dylib "''${!outputLib}"/lib/*.so.[0-9]; do - install_name_tool -id "$i" "$i" || true - for old_path in $(otool -L "$i" | grep "$out" | awk '{print $1}'); do - new_path=`echo "$old_path" | sed "s,$out,''${!outputLib},"` - install_name_tool -change "$old_path" "$new_path" "$i" || true - done - done - fi + if type "install_name_tool"; then + for i in "''${!outputLib}"/lib/*.*.dylib "''${!outputLib}"/lib/*.so.[0-9]; do + install_name_tool -id "$i" "$i" || true + for old_path in $(otool -L "$i" | grep "$out" | awk '{print $1}'); do + new_path=`echo "$old_path" | sed "s,$out,''${!outputLib},"` + install_name_tool -change "$old_path" "$new_path" "$i" || true + done + done + fi - # Get rid of some "fixed" header files - rm -rfv $out/lib/gcc/*/*/include-fixed/{root,linux,sys/mount.h,bits/statx.h,pthread.h} + # Get rid of some "fixed" header files + rm -rfv $out/lib/gcc/*/*/include-fixed/{root,linux,sys/mount.h,bits/statx.h,pthread.h} - # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks. - for i in $out/bin/*-gcc*; do - if cmp -s $out/bin/gcc $i; then - ln -sfn gcc $i - fi - done + # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks. + for i in $out/bin/*-gcc*; do + if cmp -s $out/bin/gcc $i; then + ln -sfn gcc $i + fi + done - for i in $out/bin/c++ $out/bin/*-c++* $out/bin/*-g++*; do - if cmp -s $out/bin/g++ $i; then - ln -sfn g++ $i - fi - done + for i in $out/bin/c++ $out/bin/*-c++* $out/bin/*-g++*; do + if cmp -s $out/bin/g++ $i; then + ln -sfn g++ $i + fi + done - # Two identical man pages are shipped (moving and compressing is done later) - for i in "$out"/share/man/man1/*g++.1; do - if test -e "$i"; then - man_prefix=`echo "$i" | sed "s,.*/\(.*\)g++.1,\1,"` - ln -sf "$man_prefix"gcc.1 "$i" - fi - done - '' - # if cross-compiling, link from $lib/lib to $lib/${targetConfig}. - # since native-compiles have $lib/lib as a directory (not a - # symlink), this ensures that in every case we can assume that - # $lib/lib contains the .so files - + lib.optionalString isCross '' - if [ -e "$lib/$targetConfig/lib" ]; then - ln -s "$lib/$targetConfig/lib" "$lib/lib" - fi - ''; + # Two identical man pages are shipped (moving and compressing is done later) + for i in "$out"/share/man/man1/*g++.1; do + if test -e "$i"; then + man_prefix=`echo "$i" | sed "s,.*/\(.*\)g++.1,\1,"` + ln -sf "$man_prefix"gcc.1 "$i" + fi + done + '' + # if cross-compiling, link from $lib/lib to $lib/${targetConfig}. + # since native-compiles have $lib/lib as a directory (not a + # symlink), this ensures that in every case we can assume that + # $lib/lib contains the .so files + + lib.optionalString isCross '' + if [ -e "$lib/$targetConfig/lib" ]; then + ln -s "$lib/$targetConfig/lib" "$lib/lib" + fi + ''; } )) diff --git a/pkgs/development/compilers/gcc/common/dependencies.nix b/pkgs/development/compilers/gcc/common/dependencies.nix index 38cbcc2682b1..b27b59f2f2b9 100644 --- a/pkgs/development/compilers/gcc/common/dependencies.nix +++ b/pkgs/development/compilers/gcc/common/dependencies.nix @@ -38,23 +38,22 @@ in # same for all gcc's depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - texinfo - which - gettext + nativeBuildInputs = [ + texinfo + which + gettext - # Prevent GCC leaking into the runtime closure of C++ packages - # through headers using `__FILE__`. - sanitiseHeaderPathsHook - ] - ++ optionals (perl != null) [ perl ] - ++ optionals (with stdenv.targetPlatform; isVc4 || isRedox || isSnapshot && flex != null) [ flex ] - ++ optionals langAda [ gnat-bootstrap ] - ++ optionals langRust [ cargo ] - # The builder relies on GNU sed (for instance, Darwin's `sed' fails with - # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. - ++ optionals buildPlatform.isDarwin [ gnused ]; + # Prevent GCC leaking into the runtime closure of C++ packages + # through headers using `__FILE__`. + sanitiseHeaderPathsHook + ] + ++ optionals (perl != null) [ perl ] + ++ optionals (with stdenv.targetPlatform; isVc4 || isRedox || isSnapshot && flex != null) [ flex ] + ++ optionals langAda [ gnat-bootstrap ] + ++ optionals langRust [ cargo ] + # The builder relies on GNU sed (for instance, Darwin's `sed' fails with + # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. + ++ optionals buildPlatform.isDarwin [ gnused ]; # For building runtime libs # same for all gcc's @@ -73,19 +72,18 @@ in ) ++ optionals targetPlatform.isLinux [ patchelf ]; - buildInputs = - [ - gmp - mpfr - libmpc - ] - ++ optionals (lib.versionAtLeast version "10") [ libxcrypt ] - ++ [ - targetPackages.stdenv.cc.bintools # For linking code at run-time - ] - ++ optionals (isl != null) [ isl ] - ++ optionals (zlib != null) [ zlib ] - ++ optionals (langGo && stdenv.hostPlatform.isMusl) [ libucontext ]; + buildInputs = [ + gmp + mpfr + libmpc + ] + ++ optionals (lib.versionAtLeast version "10") [ libxcrypt ] + ++ [ + targetPackages.stdenv.cc.bintools # For linking code at run-time + ] + ++ optionals (isl != null) [ isl ] + ++ optionals (zlib != null) [ zlib ] + ++ optionals (langGo && stdenv.hostPlatform.isMusl) [ libucontext ]; depsTargetTarget = optionals ( !withoutTargetLibc && threadsCross != { } && threadsCross.package != null diff --git a/pkgs/development/compilers/gcc/common/strip-attributes.nix b/pkgs/development/compilers/gcc/common/strip-attributes.nix index 3871d8466495..d6f3cc1475c8 100644 --- a/pkgs/development/compilers/gcc/common/strip-attributes.nix +++ b/pkgs/development/compilers/gcc/common/strip-attributes.nix @@ -39,45 +39,44 @@ ]; stripDebugListTarget = [ stdenv.targetPlatform.config ]; - preFixup = - '' - # Populate most delicated lib/ part of stripDebugList{,Target} - updateDebugListPaths() { - local oldOpts - oldOpts="$(shopt -p nullglob)" || true - shopt -s nullglob + preFixup = '' + # Populate most delicated lib/ part of stripDebugList{,Target} + updateDebugListPaths() { + local oldOpts + oldOpts="$(shopt -p nullglob)" || true + shopt -s nullglob - pushd $out - local -ar outHostFiles=( - lib{,32,64}/*.{a,o,so*} - lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/plugin - ) - local -ar outTargetFiles=( - lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/*.{a,o,so*} - ) - popd - '' - + lib.optionalString (!langJit) '' - ${ - # keep indentation - "" - } - pushd $lib - local -ar libHostFiles=( - lib{,32,64}/*.{a,o,so*} - ) - local -ar libTargetFiles=( - lib{,32,64}/${stdenv.targetPlatform.config}/*.{a,o,so*} - ) - popd + pushd $out + local -ar outHostFiles=( + lib{,32,64}/*.{a,o,so*} + lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/plugin + ) + local -ar outTargetFiles=( + lib{,32,64}/gcc/${stdenv.targetPlatform.config}/*/*.{a,o,so*} + ) + popd + '' + + lib.optionalString (!langJit) '' + ${ + # keep indentation + "" + } + pushd $lib + local -ar libHostFiles=( + lib{,32,64}/*.{a,o,so*} + ) + local -ar libTargetFiles=( + lib{,32,64}/${stdenv.targetPlatform.config}/*.{a,o,so*} + ) + popd - '' - + '' - eval "$oldOpts" + '' + + '' + eval "$oldOpts" - stripDebugList="$stripDebugList ''${outHostFiles[*]} ''${libHostFiles[*]}" - stripDebugListTarget="$stripDebugListTarget ''${outTargetFiles[*]} ''${libTargetFiles[*]}" - } - updateDebugListPaths - ''; + stripDebugList="$stripDebugList ''${outHostFiles[*]} ''${libHostFiles[*]}" + stripDebugListTarget="$stripDebugListTarget ''${outTargetFiles[*]} ''${libTargetFiles[*]}" + } + updateDebugListPaths + ''; } diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc/default.nix index 79f65b08a542..0e4a70f870d5 100644 --- a/pkgs/development/compilers/gcc/default.nix +++ b/pkgs/development/compilers/gcc/default.nix @@ -236,7 +236,8 @@ pipe "out" "man" "info" - ] ++ optional (!langJit) "lib"; + ] + ++ optional (!langJit) "lib"; setOutputFlags = false; @@ -246,68 +247,68 @@ pipe "format" "pie" "stackclashprotection" - ] ++ optionals (is11 && langAda) [ "fortify3" ]; + ] + ++ optionals (is11 && langAda) [ "fortify3" ]; - postPatch = - '' - configureScripts=$(find . -name configure) - for configureScript in $configureScripts; do - patchShebangs $configureScript - done + postPatch = '' + configureScripts=$(find . -name configure) + for configureScript in $configureScripts; do + patchShebangs $configureScript + done - # Make sure nixpkgs versioning match upstream one - # to ease version-based comparisons. - gcc_base_version=$(< gcc/BASE-VER) - if [[ ${baseVersion} != $gcc_base_version ]]; then - echo "Please update 'version' variable:" - echo " Expected: '$gcc_base_version'" - echo " Actual: '${version}'" - exit 1 - fi - '' - # This should kill all the stdinc frameworks that gcc and friends like to - # insert into default search paths. - + optionalString hostPlatform.isDarwin '' - substituteInPlace gcc/config/darwin-c.c${optionalString atLeast12 "c"} \ - --replace 'if (stdinc)' 'if (0)' + # Make sure nixpkgs versioning match upstream one + # to ease version-based comparisons. + gcc_base_version=$(< gcc/BASE-VER) + if [[ ${baseVersion} != $gcc_base_version ]]; then + echo "Please update 'version' variable:" + echo " Expected: '$gcc_base_version'" + echo " Actual: '${version}'" + exit 1 + fi + '' + # This should kill all the stdinc frameworks that gcc and friends like to + # insert into default search paths. + + optionalString hostPlatform.isDarwin '' + substituteInPlace gcc/config/darwin-c.c${optionalString atLeast12 "c"} \ + --replace 'if (stdinc)' 'if (0)' - substituteInPlace libgcc/config/t-slibgcc-darwin \ - --replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name ''${!outputLib}/lib/\$(SHLIB_INSTALL_NAME)" + substituteInPlace libgcc/config/t-slibgcc-darwin \ + --replace "-install_name @shlib_slibdir@/\$(SHLIB_INSTALL_NAME)" "-install_name ''${!outputLib}/lib/\$(SHLIB_INSTALL_NAME)" - substituteInPlace libgfortran/configure \ - --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" - '' - + (optionalString ((!lib.systems.equals targetPlatform hostPlatform) || stdenv.cc.libc != null) - # On NixOS, use the right path to the dynamic linker instead of - # `/lib/ld*.so'. + substituteInPlace libgfortran/configure \ + --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" + '' + + (optionalString ((!lib.systems.equals targetPlatform hostPlatform) || stdenv.cc.libc != null) + # On NixOS, use the right path to the dynamic linker instead of + # `/lib/ld*.so'. + ( + let + libc = if libcCross != null then libcCross else stdenv.cc.libc; + in ( - let - libc = if libcCross != null then libcCross else stdenv.cc.libc; - in - ( - '' - echo "fixing the {GLIBC,UCLIBC,MUSL}_DYNAMIC_LINKER macros..." - for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h - do - grep -q _DYNAMIC_LINKER "$header" || continue - echo " fixing $header..." - sed -i "$header" \ - -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \ - -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g' - done - '' - + optionalString (targetPlatform.libc == "musl") '' - sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' - '' - ) + '' + echo "fixing the {GLIBC,UCLIBC,MUSL}_DYNAMIC_LINKER macros..." + for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h + do + grep -q _DYNAMIC_LINKER "$header" || continue + echo " fixing $header..." + sed -i "$header" \ + -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' \ + -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g' + done + '' + + optionalString (targetPlatform.libc == "musl") '' + sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' + '' ) ) - + optionalString targetPlatform.isAvr ('' - makeFlagsArray+=( - '-s' # workaround for hitting hydra log limit - 'LIMITS_H_TEST=false' - ) - ''); + ) + + optionalString targetPlatform.isAvr ('' + makeFlagsArray+=( + '-s' # workaround for hitting hydra log limit + 'LIMITS_H_TEST=false' + ) + ''); inherit noSysDirs @@ -447,24 +448,23 @@ pipe enableParallelBuilding = true; inherit enableShared enableMultilib; - meta = - { - inherit (callFile ./common/meta.nix { }) - homepage - license - description - longDescription - platforms - teams - ; - } - // optionalAttrs (!atLeast11) { - badPlatforms = [ "aarch64-darwin" ]; - } - // optionalAttrs is10 { - badPlatforms = - if (!lib.systems.equals targetPlatform hostPlatform) then [ "aarch64-darwin" ] else [ ]; - }; + meta = { + inherit (callFile ./common/meta.nix { }) + homepage + license + description + longDescription + platforms + teams + ; + } + // optionalAttrs (!atLeast11) { + badPlatforms = [ "aarch64-darwin" ]; + } + // optionalAttrs is10 { + badPlatforms = + if (!lib.systems.equals targetPlatform hostPlatform) then [ "aarch64-darwin" ] else [ ]; + }; } // optionalAttrs (!atLeast10 && stdenv.targetPlatform.isDarwin) { # GCC <10 requires default cctools `strip` instead of `llvm-strip` used by Darwin bintools. diff --git a/pkgs/development/compilers/gcc/ng/common/gcc/default.nix b/pkgs/development/compilers/gcc/ng/common/gcc/default.nix index 36cc0da952f3..0b6ae8110375 100644 --- a/pkgs/development/compilers/gcc/ng/common/gcc/default.nix +++ b/pkgs/development/compilers/gcc/ng/common/gcc/default.nix @@ -70,38 +70,37 @@ stdenv.mkDerivation (finalAttrs: { texinfo which gettext - ] ++ lib.optional (perl != null) perl; + ] + ++ lib.optional (perl != null) perl; - buildInputs = - [ - gmp - libmpc - mpfr - ] - ++ lib.optional (isl != null) isl - ++ lib.optional (zlib != null) zlib; + buildInputs = [ + gmp + libmpc + mpfr + ] + ++ lib.optional (isl != null) isl + ++ lib.optional (zlib != null) zlib; postUnpack = '' mkdir -p ./build buildRoot=$(readlink -e "./build") ''; - postPatch = - '' - configureScripts=$(find . -name configure) - for configureScript in $configureScripts; do - patchShebangs $configureScript - done + postPatch = '' + configureScripts=$(find . -name configure) + for configureScript in $configureScripts; do + patchShebangs $configureScript + done - patchShebangs libbacktrace/install-debuginfo-for-buildid.sh - patchShebangs runtest - '' - # This should kill all the stdinc frameworks that gcc and friends like to - # insert into default search paths. - + lib.optionalString hostPlatform.isDarwin '' - substituteInPlace gcc/config/darwin-c.c \ - --replace 'if (stdinc)' 'if (0)' - ''; + patchShebangs libbacktrace/install-debuginfo-for-buildid.sh + patchShebangs runtest + '' + # This should kill all the stdinc frameworks that gcc and friends like to + # insert into default search paths. + + lib.optionalString hostPlatform.isDarwin '' + substituteInPlace gcc/config/darwin-c.c \ + --replace 'if (stdinc)' 'if (0)' + ''; preConfigure = # Don't built target libraries, because we want to build separately @@ -152,64 +151,63 @@ stdenv.mkDerivation (finalAttrs: { "target" ]; - configureFlags = - [ - # Force target prefix. The behavior if `--target` and `--host` are - # specified is inconsistent: Sometimes specifying `--target` always causes - # a prefix to be generated, sometimes it's only added if the `--host` and - # `--target` differ. This means that sometimes there may be a prefix even - # though nixpkgs doesn't expect one and sometimes there may be none even - # though nixpkgs expects one (since not all information is serialized into - # the config attribute). The easiest way out of these problems is to always - # set the program prefix, so gcc will conform to our expectations. - "--program-prefix=${targetPrefix}" + configureFlags = [ + # Force target prefix. The behavior if `--target` and `--host` are + # specified is inconsistent: Sometimes specifying `--target` always causes + # a prefix to be generated, sometimes it's only added if the `--host` and + # `--target` differ. This means that sometimes there may be a prefix even + # though nixpkgs doesn't expect one and sometimes there may be none even + # though nixpkgs expects one (since not all information is serialized into + # the config attribute). The easiest way out of these problems is to always + # set the program prefix, so gcc will conform to our expectations. + "--program-prefix=${targetPrefix}" - "--disable-dependency-tracking" - "--enable-fast-install" - "--disable-serial-configure" - "--disable-bootstrap" - "--disable-decimal-float" - "--disable-install-libiberty" - "--disable-multilib" - "--disable-nls" - "--disable-shared" - "--enable-languages=${ - lib.concatStrings ( - lib.intersperse "," ( - lib.optional langC "c" - ++ lib.optional langCC "c++" - ++ lib.optional langD "d" - ++ lib.optional langFortran "fortran" - ++ lib.optional langJava "java" - ++ lib.optional langAda "ada" - ++ lib.optional langGo "go" - ++ lib.optional langObjC "objc" - ++ lib.optional langObjCpp "obj-c++" - ++ lib.optional langJit "jit" - ) + "--disable-dependency-tracking" + "--enable-fast-install" + "--disable-serial-configure" + "--disable-bootstrap" + "--disable-decimal-float" + "--disable-install-libiberty" + "--disable-multilib" + "--disable-nls" + "--disable-shared" + "--enable-languages=${ + lib.concatStrings ( + lib.intersperse "," ( + lib.optional langC "c" + ++ lib.optional langCC "c++" + ++ lib.optional langD "d" + ++ lib.optional langFortran "fortran" + ++ lib.optional langJava "java" + ++ lib.optional langAda "ada" + ++ lib.optional langGo "go" + ++ lib.optional langObjC "objc" + ++ lib.optional langObjCpp "obj-c++" + ++ lib.optional langJit "jit" ) - }" - (lib.withFeature (isl != null) "isl") - "--without-headers" - "--with-gnu-as" - "--with-gnu-ld" - "--with-as=${lib.getExe' bintools "${bintools.targetPrefix}as"}" - "--with-system-zlib" - "--without-included-gettext" - "--enable-linker-build-id" - "--with-sysroot=${lib.getDev (targetPackages.libc or libc)}" - "--with-native-system-header-dir=/include" - ] - ++ lib.optionals enablePlugin [ - "--enable-plugin" - "--enable-plugins" - ] - ++ - # Only pass when the arch supports it. - # Exclude RISC-V because GCC likes to fail when the string is empty on RISC-V. - lib.optionals (targetPlatform.isAarch || targetPlatform.isAvr || targetPlatform.isx86_64) [ - "--with-multilib-list=" - ]; + ) + }" + (lib.withFeature (isl != null) "isl") + "--without-headers" + "--with-gnu-as" + "--with-gnu-ld" + "--with-as=${lib.getExe' bintools "${bintools.targetPrefix}as"}" + "--with-system-zlib" + "--without-included-gettext" + "--enable-linker-build-id" + "--with-sysroot=${lib.getDev (targetPackages.libc or libc)}" + "--with-native-system-header-dir=/include" + ] + ++ lib.optionals enablePlugin [ + "--enable-plugin" + "--enable-plugins" + ] + ++ + # Only pass when the arch supports it. + # Exclude RISC-V because GCC likes to fail when the string is empty on RISC-V. + lib.optionals (targetPlatform.isAarch || targetPlatform.isAvr || targetPlatform.isx86_64) [ + "--with-multilib-list=" + ]; doCheck = false; diff --git a/pkgs/development/compilers/gcc/ng/common/libgcc/default.nix b/pkgs/development/compilers/gcc/ng/common/libgcc/default.nix index a1372a69e123..01170595ea54 100644 --- a/pkgs/development/compilers/gcc/ng/common/libgcc/default.nix +++ b/pkgs/development/compilers/gcc/ng/common/libgcc/default.nix @@ -79,113 +79,111 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - preConfigure = - '' - cd "$buildRoot" + preConfigure = '' + cd "$buildRoot" - mkdir -p build-${stdenv.buildPlatform.config}/libiberty/ - cd build-${stdenv.buildPlatform.config}/libiberty/ - ln -s ${buildGccPackages.libiberty}/lib/libiberty.a ./ + mkdir -p build-${stdenv.buildPlatform.config}/libiberty/ + cd build-${stdenv.buildPlatform.config}/libiberty/ + ln -s ${buildGccPackages.libiberty}/lib/libiberty.a ./ - mkdir -p "$buildRoot/gcc" - cd "$buildRoot/gcc" + mkdir -p "$buildRoot/gcc" + cd "$buildRoot/gcc" - ( - export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $AS_FOR_BUILD)"} - export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CC_FOR_BUILD)"} - export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CPP_FOR_BUILD)"} - export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CXX_FOR_BUILD)"} - export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$(basename $LD_FOR_BUILD)"} + ( + export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $AS_FOR_BUILD)"} + export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CC_FOR_BUILD)"} + export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CPP_FOR_BUILD)"} + export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CXX_FOR_BUILD)"} + export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$(basename $LD_FOR_BUILD)"} - export AS=$AS_FOR_BUILD - export CC=$CC_FOR_BUILD - export CPP=$CPP_FOR_BUILD - export CXX=$CXX_FOR_BUILD - export LD=$LD_FOR_BUILD + export AS=$AS_FOR_BUILD + export CC=$CC_FOR_BUILD + export CPP=$CPP_FOR_BUILD + export CXX=$CXX_FOR_BUILD + export LD=$LD_FOR_BUILD - export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $AS)"} - export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CC)"} - export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CPP)"} - export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$(basename $LD)"} + export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $AS)"} + export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CC)"} + export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CPP)"} + export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$(basename $LD)"} - export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1' + export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1' - "$sourceRoot/../gcc/configure" $topLevelConfigureFlags + "$sourceRoot/../gcc/configure" $topLevelConfigureFlags - sed -e 's,libgcc.mvars:.*$,libgcc.mvars:,' -i Makefile + sed -e 's,libgcc.mvars:.*$,libgcc.mvars:,' -i Makefile - make \ - config.h \ - libgcc.mvars \ - tconfig.h \ - tm.h \ - options.h \ - insn-constants.h \ - version.h - ) - mkdir -p "$buildRoot/gcc/include" + make \ + config.h \ + libgcc.mvars \ + tconfig.h \ + tm.h \ + options.h \ + insn-constants.h \ + version.h + ) + mkdir -p "$buildRoot/gcc/include" - mkdir -p "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" - cd "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" - configureScript=$sourceRoot/configure - chmod +x "$configureScript" + mkdir -p "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" + cd "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" + configureScript=$sourceRoot/configure + chmod +x "$configureScript" - export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $AS_FOR_BUILD)"} - export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CC_FOR_BUILD)"} - export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CPP_FOR_BUILD)"} - export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CXX_FOR_BUILD)"} - export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$(basename $LD_FOR_BUILD)"} + export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $AS_FOR_BUILD)"} + export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CC_FOR_BUILD)"} + export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CPP_FOR_BUILD)"} + export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$(basename $CXX_FOR_BUILD)"} + export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$(basename $LD_FOR_BUILD)"} - export AS=${lib.getExe' stdenv.cc "$(basename $AS)"} - export CC=${lib.getExe' stdenv.cc "$(basename $CC)"} - export CPP=${lib.getExe' stdenv.cc "$(basename $CPP)"} - export CXX=${lib.getExe' stdenv.cc "$(basename $CXX)"} - export LD=${lib.getExe' stdenv.cc.bintools "$(basename $LD)"} + export AS=${lib.getExe' stdenv.cc "$(basename $AS)"} + export CC=${lib.getExe' stdenv.cc "$(basename $CC)"} + export CPP=${lib.getExe' stdenv.cc "$(basename $CPP)"} + export CXX=${lib.getExe' stdenv.cc "$(basename $CXX)"} + export LD=${lib.getExe' stdenv.cc.bintools "$(basename $LD)"} - export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $AS_FOR_TARGET)"} - export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CC_FOR_TARGET)"} - export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CPP_FOR_TARGET)"} - export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$(basename $LD_FOR_TARGET)"} - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - NIX_CFLAGS_COMPILE_OLD=$NIX_CFLAGS_COMPILE - NIX_CFLAGS_COMPILE+=' -isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${version}/include-fixed' - ''; + export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $AS_FOR_TARGET)"} + export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CC_FOR_TARGET)"} + export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$(basename $CPP_FOR_TARGET)"} + export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$(basename $LD_FOR_TARGET)"} + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + NIX_CFLAGS_COMPILE_OLD=$NIX_CFLAGS_COMPILE + NIX_CFLAGS_COMPILE+=' -isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${version}/include-fixed' + ''; - topLevelConfigureFlags = - [ - "--build=${stdenv.buildPlatform.config}" - "--host=${stdenv.buildPlatform.config}" - "--target=${stdenv.hostPlatform.config}" + topLevelConfigureFlags = [ + "--build=${stdenv.buildPlatform.config}" + "--host=${stdenv.buildPlatform.config}" + "--target=${stdenv.hostPlatform.config}" - "--disable-bootstrap" - "--disable-multilib" - "--enable-languages=c" + "--disable-bootstrap" + "--disable-multilib" + "--enable-languages=c" - "--disable-fixincludes" - "--disable-intl" - "--disable-lto" - "--disable-libatomic" - "--disable-libbacktrace" - "--disable-libcpp" - "--disable-libssp" - "--disable-libquadmath" - "--disable-libgomp" - "--disable-libvtv" - "--disable-vtable-verify" + "--disable-fixincludes" + "--disable-intl" + "--disable-lto" + "--disable-libatomic" + "--disable-libbacktrace" + "--disable-libcpp" + "--disable-libssp" + "--disable-libquadmath" + "--disable-libgomp" + "--disable-libvtv" + "--disable-vtable-verify" - "--with-system-zlib" - ] - ++ - lib.optional (!stdenv.hostPlatform.isRiscV) - # RISC-V does not like it being empty - "--with-multilib-list=" - ++ - lib.optional (stdenv.hostPlatform.libc == "glibc") - # Cheat and use previous stage's glibc to avoid infinite recursion. As - # of GCC 11, libgcc only cares if the version is greater than 2.19, - # which is quite ancient, so this little lie should be fine. - "--with-glibc-version=${buildPackages.glibc.version}"; + "--with-system-zlib" + ] + ++ + lib.optional (!stdenv.hostPlatform.isRiscV) + # RISC-V does not like it being empty + "--with-multilib-list=" + ++ + lib.optional (stdenv.hostPlatform.libc == "glibc") + # Cheat and use previous stage's glibc to avoid infinite recursion. As + # of GCC 11, libgcc only cares if the version is greater than 2.19, + # which is quite ancient, so this little lie should be fine. + "--with-glibc-version=${buildPackages.glibc.version}"; configurePlatforms = [ "build" diff --git a/pkgs/development/compilers/gcc/ng/common/libgfortran/default.nix b/pkgs/development/compilers/gcc/ng/common/libgfortran/default.nix index 5b77efbb4ce2..284792e16830 100644 --- a/pkgs/development/compilers/gcc/ng/common/libgfortran/default.nix +++ b/pkgs/development/compilers/gcc/ng/common/libgfortran/default.nix @@ -50,107 +50,106 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - preConfigure = - '' - cd "$buildRoot" + preConfigure = '' + cd "$buildRoot" - mkdir -p build-${stdenv.buildPlatform.config}/libiberty/ - cd build-${stdenv.buildPlatform.config}/libiberty/ - ln -s ${libiberty}/lib/libiberty.a ./ + mkdir -p build-${stdenv.buildPlatform.config}/libiberty/ + cd build-${stdenv.buildPlatform.config}/libiberty/ + ln -s ${libiberty}/lib/libiberty.a ./ - mkdir -p "$buildRoot/gcc" - cd "$buildRoot/gcc" + mkdir -p "$buildRoot/gcc" + cd "$buildRoot/gcc" - ( - export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$AS_FOR_BUILD"} - export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CC_FOR_BUILD"} - export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CPP_FOR_BUILD"} - export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CXX_FOR_BUILD"} - export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$LD_FOR_BUILD"} + ( + export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$AS_FOR_BUILD"} + export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CC_FOR_BUILD"} + export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CPP_FOR_BUILD"} + export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CXX_FOR_BUILD"} + export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$LD_FOR_BUILD"} - export AS=$AS_FOR_BUILD - export CC=$CC_FOR_BUILD - export CPP=$CPP_FOR_BUILD - export CXX=$CXX_FOR_BUILD - export LD=$LD_FOR_BUILD + export AS=$AS_FOR_BUILD + export CC=$CC_FOR_BUILD + export CPP=$CPP_FOR_BUILD + export CXX=$CXX_FOR_BUILD + export LD=$LD_FOR_BUILD - export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$AS"} - export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$CC"} - export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$CPP"} - export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$LD"} + export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$AS"} + export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$CC"} + export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$CPP"} + export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$LD"} - export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1' + export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1' - "$sourceRoot/../gcc/configure" $topLevelConfigureFlags + "$sourceRoot/../gcc/configure" $topLevelConfigureFlags - make \ - config.h - ) - mkdir -p "$buildRoot/gcc/include" + make \ + config.h + ) + mkdir -p "$buildRoot/gcc/include" - mkdir -p "$buildRoot/gcc/libbacktrace/.libs" - cp ${libbacktrace}/lib/libbacktrace.a "$buildRoot/gcc/libbacktrace/.libs/libbacktrace.a" - cp -r ${libbacktrace}/lib/*.la "$buildRoot/gcc/libbacktrace" - cp -r ${libbacktrace.dev}/include/*.h "$buildRoot/gcc/libbacktrace" + mkdir -p "$buildRoot/gcc/libbacktrace/.libs" + cp ${libbacktrace}/lib/libbacktrace.a "$buildRoot/gcc/libbacktrace/.libs/libbacktrace.a" + cp -r ${libbacktrace}/lib/*.la "$buildRoot/gcc/libbacktrace" + cp -r ${libbacktrace.dev}/include/*.h "$buildRoot/gcc/libbacktrace" - mkdir -p "$buildRoot/gcc/libgcc" - ln -s "${libgcc.dev}/include/gthr-default.h" "$buildRoot/gcc/libgcc" + mkdir -p "$buildRoot/gcc/libgcc" + ln -s "${libgcc.dev}/include/gthr-default.h" "$buildRoot/gcc/libgcc" - mkdir -p "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgfortran" - ln -s "$buildRoot/gcc/libbacktrace" "$buildRoot/gcc/${stdenv.buildPlatform.config}/libbacktrace" - ln -s "$buildRoot/gcc/libgcc" "$buildRoot/gcc/${stdenv.buildPlatform.config}/libgcc" - cd "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgfortran" - configureScript=$sourceRoot/configure - chmod +x "$configureScript" + mkdir -p "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgfortran" + ln -s "$buildRoot/gcc/libbacktrace" "$buildRoot/gcc/${stdenv.buildPlatform.config}/libbacktrace" + ln -s "$buildRoot/gcc/libgcc" "$buildRoot/gcc/${stdenv.buildPlatform.config}/libgcc" + cd "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgfortran" + configureScript=$sourceRoot/configure + chmod +x "$configureScript" - export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$AS_FOR_BUILD"} - export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CC_FOR_BUILD"} - export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CPP_FOR_BUILD"} - export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CXX_FOR_BUILD"} - export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$LD_FOR_BUILD"} + export AS_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$AS_FOR_BUILD"} + export CC_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CC_FOR_BUILD"} + export CPP_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CPP_FOR_BUILD"} + export CXX_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc "$CXX_FOR_BUILD"} + export LD_FOR_BUILD=${lib.getExe' buildPackages.stdenv.cc.bintools "$LD_FOR_BUILD"} - export AS=${lib.getExe' stdenv.cc "$AS"} - export CC=${lib.getExe' stdenv.cc "$CC"} - export CPP=${lib.getExe' stdenv.cc "$CPP"} - export CXX=${lib.getExe' stdenv.cc "$CXX"} - export LD=${lib.getExe' stdenv.cc.bintools "$LD"} + export AS=${lib.getExe' stdenv.cc "$AS"} + export CC=${lib.getExe' stdenv.cc "$CC"} + export CPP=${lib.getExe' stdenv.cc "$CPP"} + export CXX=${lib.getExe' stdenv.cc "$CXX"} + export LD=${lib.getExe' stdenv.cc.bintools "$LD"} - export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$AS_FOR_TARGET"} - export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$CC_FOR_TARGET"} - export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$CPP_FOR_TARGET"} - export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$LD_FOR_TARGET"} - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - NIX_CFLAGS_COMPILE_OLD=$NIX_CFLAGS_COMPILE - NIX_CFLAGS_COMPILE+=' -isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${version}/include-fixed' - ''; + export AS_FOR_TARGET=${lib.getExe' stdenv.cc "$AS_FOR_TARGET"} + export CC_FOR_TARGET=${lib.getExe' stdenv.cc "$CC_FOR_TARGET"} + export CPP_FOR_TARGET=${lib.getExe' stdenv.cc "$CPP_FOR_TARGET"} + export LD_FOR_TARGET=${lib.getExe' stdenv.cc.bintools "$LD_FOR_TARGET"} + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + NIX_CFLAGS_COMPILE_OLD=$NIX_CFLAGS_COMPILE + NIX_CFLAGS_COMPILE+=' -isystem ${stdenv.cc.cc}/lib/gcc/${stdenv.hostPlatform.config}/${version}/include-fixed' + ''; - topLevelConfigureFlags = - [ - "--build=${stdenv.buildPlatform.config}" - "--host=${stdenv.buildPlatform.config}" - "--target=${stdenv.hostPlatform.config}" + topLevelConfigureFlags = [ + "--build=${stdenv.buildPlatform.config}" + "--host=${stdenv.buildPlatform.config}" + "--target=${stdenv.hostPlatform.config}" - "--disable-bootstrap" - "--disable-multilib" - "--with-multilib-list=" - "--enable-languages=fortran" + "--disable-bootstrap" + "--disable-multilib" + "--with-multilib-list=" + "--enable-languages=fortran" - "--disable-fixincludes" - "--disable-intl" - "--disable-lto" - "--disable-libatomic" - "--disable-libbacktrace" - "--disable-libcpp" - "--disable-libssp" - "--disable-libquadmath" - "--disable-libgomp" - "--disable-libvtv" - "--disable-vtable-verify" + "--disable-fixincludes" + "--disable-intl" + "--disable-lto" + "--disable-libatomic" + "--disable-libbacktrace" + "--disable-libcpp" + "--disable-libssp" + "--disable-libquadmath" + "--disable-libgomp" + "--disable-libvtv" + "--disable-vtable-verify" - "--with-system-zlib" - ] - ++ lib.optional (stdenv.hostPlatform.libc == "glibc") + "--with-system-zlib" + ] + ++ + lib.optional (stdenv.hostPlatform.libc == "glibc") # Cheat and use previous stage's glibc to avoid infinite recursion. As # of GCC 11, libgcc only cares if the version is greater than 2.19, # which is quite ancient, so this little lie should be fine. diff --git a/pkgs/development/compilers/gcc/ng/common/libiberty/default.nix b/pkgs/development/compilers/gcc/ng/common/libiberty/default.nix index 9ffad2a69ea8..a83d9580dabc 100644 --- a/pkgs/development/compilers/gcc/ng/common/libiberty/default.nix +++ b/pkgs/development/compilers/gcc/ng/common/libiberty/default.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--enable-install-libiberty" - ] ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared"; + ] + ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared"; postInstall = '' cp pic/libiberty.a $out/lib/libiberty_pic.a diff --git a/pkgs/development/compilers/gcc/ng/default.nix b/pkgs/development/compilers/gcc/ng/default.nix index 3fb74d722d06..dd70df537853 100644 --- a/pkgs/development/compilers/gcc/ng/default.nix +++ b/pkgs/development/compilers/gcc/ng/default.nix @@ -16,7 +16,8 @@ let versions = { "15.1.0".officialRelease.sha256 = "sha256-4rCewhZg8B/s/7cV4BICZSFpQ/A40OSKmGhxPlTwbOo="; - } // gccVersions; + } + // gccVersions; mkPackage = { diff --git a/pkgs/development/compilers/gerbil/build.nix b/pkgs/development/compilers/gerbil/build.nix index 26808377b1ac..da91532cc12f 100644 --- a/pkgs/development/compilers/gerbil/build.nix +++ b/pkgs/development/compilers/gerbil/build.nix @@ -114,18 +114,17 @@ stdenv.mkDerivation rec { runHook postBuild ''; - installPhase = - '' - runHook preInstall - mkdir -p $out/gerbil $out/bin - ./install.sh - (cd $out/bin ; ln -s ../gerbil/bin/* .) - runHook postInstall - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - libgerbil="$(realpath "$out/gerbil/lib/libgerbil.so")" - install_name_tool -id "$libgerbil" "$libgerbil" - ''; + installPhase = '' + runHook preInstall + mkdir -p $out/gerbil $out/bin + ./install.sh + (cd $out/bin ; ln -s ../gerbil/bin/* .) + runHook postInstall + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + libgerbil="$(realpath "$out/gerbil/lib/libgerbil.so")" + install_name_tool -id "$libgerbil" "$libgerbil" + ''; dontStrip = true; diff --git a/pkgs/development/compilers/ghc/8.10.7-binary.nix b/pkgs/development/compilers/ghc/8.10.7-binary.nix index b1e36495a0a8..f863573b2d5a 100644 --- a/pkgs/development/compilers/ghc/8.10.7-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.7-binary.nix @@ -213,19 +213,18 @@ let libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY" + "LD_LIBRARY_PATH"; - runtimeDeps = - [ - targetPackages.stdenv.cc - targetPackages.stdenv.cc.bintools - coreutils # for cat - ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] - # On darwin, we need unwrapped bintools as well (for otool) - ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ - targetPackages.stdenv.cc.bintools.bintools - ]; + runtimeDeps = [ + targetPackages.stdenv.cc + targetPackages.stdenv.cc.bintools + coreutils # for cat + ] + ++ lib.optionals useLLVM [ + (lib.getBin llvmPackages.llvm) + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; in @@ -246,16 +245,17 @@ stdenv.mkDerivation { # https://gitlab.haskell.org/ghc/ghc/-/issues/20059 # and update this comment accordingly. - nativeBuildInputs = - [ perl ] - # Upstream binaries may not be linker-signed, which invalidates their signatures - # because `install_name_tool` will only replace a signature if it is both - # an ad hoc signature and the signature is flagged as linker-signed. - # - # rcodesign is used to replace the signature instead of sigtool because it - # supports setting the linker-signed flag, which will ensure future processing - # of the binaries does not invalidate their signatures. - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ rcodesign ]; + nativeBuildInputs = [ + perl + ] + # Upstream binaries may not be linker-signed, which invalidates their signatures + # because `install_name_tool` will only replace a signature if it is both + # an ad hoc signature and the signature is flagged as linker-signed. + # + # rcodesign is used to replace the signature instead of sigtool because it + # supports setting the linker-signed flag, which will ensure future processing + # of the binaries does not invalidate their signatures. + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ rcodesign ]; # Set LD_LIBRARY_PATH or equivalent so that the programs running as part # of the bindist installer can find the libraries they expect. @@ -379,15 +379,14 @@ stdenv.mkDerivation { preConfigure = lib.optionalString stdenv.targetPlatform.isAarch32 "LD=ld.gold"; configurePlatforms = [ ]; - configureFlags = - [ - "--with-gmp-includes=${lib.getDev gmp}/include" - # Note `--with-gmp-libraries` does nothing for GHC bindists: - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" - # From: https://github.com/NixOS/nixpkgs/pull/43369/commits - ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; + configureFlags = [ + "--with-gmp-includes=${lib.getDev gmp}/include" + # Note `--with-gmp-libraries` does nothing for GHC bindists: + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" + # From: https://github.com/NixOS/nixpkgs/pull/43369/commits + ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; # No building is necessary, but calling make without flags ironically # calls install-strip ... @@ -507,26 +506,25 @@ stdenv.mkDerivation { [ $(./main) == "yes" ] ''; - passthru = - { - targetPrefix = ""; - enableShared = true; + passthru = { + targetPrefix = ""; + enableShared = true; - inherit llvmPackages; + inherit llvmPackages; - # Our Cabal compiler name - haskellCompilerName = "ghc-${version}"; - } - # We duplicate binDistUsed here since we have a sensible default even if no bindist is available, - # this makes sure that getting the `meta` attribute doesn't throw even on unsupported platforms. - // lib.optionalAttrs (ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}.isHadrian or false) { - # Normal GHC derivations expose the hadrian derivation used to build them - # here. In the case of bindists we just make sure that the attribute exists, - # as it is used for checking if a GHC derivation has been built with hadrian. - # The isHadrian mechanism will become obsolete with GHCs that use hadrian - # exclusively, i.e. 9.6 (and 9.4?). - hadrian = null; - }; + # Our Cabal compiler name + haskellCompilerName = "ghc-${version}"; + } + # We duplicate binDistUsed here since we have a sensible default even if no bindist is available, + # this makes sure that getting the `meta` attribute doesn't throw even on unsupported platforms. + // lib.optionalAttrs (ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}.isHadrian or false) { + # Normal GHC derivations expose the hadrian derivation used to build them + # here. In the case of bindists we just make sure that the attribute exists, + # as it is used for checking if a GHC derivation has been built with hadrian. + # The isHadrian mechanism will become obsolete with GHCs that use hadrian + # exclusively, i.e. 9.6 (and 9.4?). + hadrian = null; + }; meta = rec { homepage = "http://haskell.org/ghc"; diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix index c972f29289d3..7dc6c0a62688 100644 --- a/pkgs/development/compilers/ghc/8.10.7.nix +++ b/pkgs/development/compilers/ghc/8.10.7.nix @@ -114,56 +114,55 @@ let # TODO(@Ericson2314) Make unconditional targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; - buildMK = - '' - BuildFlavour = ${ghcFlavour} - ifneq \"\$(BuildFlavour)\" \"\" - include mk/flavours/\$(BuildFlavour).mk - endif - BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"} - BUILD_SPHINX_PDF = NO + buildMK = '' + BuildFlavour = ${ghcFlavour} + ifneq \"\$(BuildFlavour)\" \"\" + include mk/flavours/\$(BuildFlavour).mk + endif + BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"} + BUILD_SPHINX_PDF = NO - WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"} + WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"} + '' + + + # Note [HADDOCK_DOCS]: + # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock` + # program is built (which we generally always want to have a complete GHC install) + # and whether it is run on the GHC sources to generate hyperlinked source code + # (which is impossible for cross-compilation); see: + # https://gitlab.haskell.org/ghc/ghc/-/issues/20077 + # This implies that currently a cross-compiled GHC will never have a `haddock` + # program, so it can never generate haddocks for any packages. + # If this is solved in the future, we'd like to unconditionally + # build the haddock program (removing the `enableHaddockProgram` option). '' - + - # Note [HADDOCK_DOCS]: - # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock` - # program is built (which we generally always want to have a complete GHC install) - # and whether it is run on the GHC sources to generate hyperlinked source code - # (which is impossible for cross-compilation); see: - # https://gitlab.haskell.org/ghc/ghc/-/issues/20077 - # This implies that currently a cross-compiled GHC will never have a `haddock` - # program, so it can never generate haddocks for any packages. - # If this is solved in the future, we'd like to unconditionally - # build the haddock program (removing the `enableHaddockProgram` option). - '' - HADDOCK_DOCS = ${if enableHaddockProgram then "YES" else "NO"} - # Build haddocks for boot packages with hyperlinking - EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump + HADDOCK_DOCS = ${if enableHaddockProgram then "YES" else "NO"} + # Build haddocks for boot packages with hyperlinking + EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump - DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} - INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' - + lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} - CrossCompilePrefix = ${targetPrefix} + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} + INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' - + lib.optionalString (!enableProfiledLibs) '' - BUILD_PROF_LIBS = NO - '' - + lib.optionalString enableRelocatedStaticLibs '' - GhcLibHcOpts += -fPIC - GhcRtsHcOpts += -fPIC - '' - + lib.optionalString targetPlatform.useAndroidPrebuilt '' - EXTRA_CC_OPTS += -std=gnu99 - '' - # While split sections are now enabled by default in ghc 8.8 for windows, - # they seem to lead to `too many sections` errors when building base for - # profiling. - + lib.optionalString targetPlatform.isWindows '' - SplitSections = NO - ''; + + lib.optionalString (targetPlatform != hostPlatform) '' + Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + CrossCompilePrefix = ${targetPrefix} + '' + + lib.optionalString (!enableProfiledLibs) '' + BUILD_PROF_LIBS = NO + '' + + lib.optionalString enableRelocatedStaticLibs '' + GhcLibHcOpts += -fPIC + GhcRtsHcOpts += -fPIC + '' + + lib.optionalString targetPlatform.useAndroidPrebuilt '' + EXTRA_CC_OPTS += -std=gnu99 + '' + # While split sections are now enabled by default in ghc 8.8 for windows, + # they seem to lead to `too many sections` errors when building base for + # profiling. + + lib.optionalString targetPlatform.isWindows '' + SplitSections = NO + ''; # Splicer will pull out correct variations libDeps = @@ -177,7 +176,8 @@ let # GHC doesn't seem to have {LLC,OPT}_HOST toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc - ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm; + ] + ++ lib.optional useLLVM buildTargetLlvmPackages.llvm; buildCC = buildPackages.stdenv.cc; targetCC = builtins.head toolsForTarget; @@ -289,185 +289,183 @@ stdenv.mkDerivation ( "doc" ]; - patches = - [ - # Fix docs build with sphinx >= 6.0 - # https://gitlab.haskell.org/ghc/ghc/-/issues/22766 - (fetchpatch { - name = "ghc-docs-sphinx-6.0.patch"; - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/10e94a556b4f90769b7fd718b9790d58ae566600.patch"; - sha256 = "0kmhfamr16w8gch0lgln2912r8aryjky1hfcda3jkcwa5cdzgjdv"; - }) + patches = [ + # Fix docs build with sphinx >= 6.0 + # https://gitlab.haskell.org/ghc/ghc/-/issues/22766 + (fetchpatch { + name = "ghc-docs-sphinx-6.0.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/10e94a556b4f90769b7fd718b9790d58ae566600.patch"; + sha256 = "0kmhfamr16w8gch0lgln2912r8aryjky1hfcda3jkcwa5cdzgjdv"; + }) - # Determine size of time related types using hsc2hs instead of assuming CLong. - # Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc. - # https://github.com/haskell/ghcup-hs/issues/1107 - # https://gitlab.haskell.org/ghc/ghc/-/issues/25095 - # Note that in normal situations this shouldn't be the case since nixpkgs - # doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet). - (fetchpatch { - name = "unix-fix-ctimeval-size-32-bit.patch"; - url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch"; - sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv"; - stripLen = 1; - extraPrefix = "libraries/unix/"; - }) + # Determine size of time related types using hsc2hs instead of assuming CLong. + # Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc. + # https://github.com/haskell/ghcup-hs/issues/1107 + # https://gitlab.haskell.org/ghc/ghc/-/issues/25095 + # Note that in normal situations this shouldn't be the case since nixpkgs + # doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet). + (fetchpatch { + name = "unix-fix-ctimeval-size-32-bit.patch"; + url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch"; + sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv"; + stripLen = 1; + extraPrefix = "libraries/unix/"; + }) - # See upstream patch at - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4885. Since we build - # from source distributions, the auto-generated configure script needs to be - # patched as well, therefore we use an in-tree patch instead of pulling the - # upstream patch. Don't forget to check backport status of the upstream patch - # when adding new GHC releases in nixpkgs. - ./respect-ar-path.patch + # See upstream patch at + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4885. Since we build + # from source distributions, the auto-generated configure script needs to be + # patched as well, therefore we use an in-tree patch instead of pulling the + # upstream patch. Don't forget to check backport status of the upstream patch + # when adding new GHC releases in nixpkgs. + ./respect-ar-path.patch - # fix hyperlinked haddock sources: https://github.com/haskell/haddock/pull/1482 - (fetchpatch { - url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/1482.patch"; - sha256 = "sha256-8w8QUCsODaTvknCDGgTfFNZa8ZmvIKaKS+2ZJZ9foYk="; - extraPrefix = "utils/haddock/"; - stripLen = 1; - }) + # fix hyperlinked haddock sources: https://github.com/haskell/haddock/pull/1482 + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/1482.patch"; + sha256 = "sha256-8w8QUCsODaTvknCDGgTfFNZa8ZmvIKaKS+2ZJZ9foYk="; + extraPrefix = "utils/haddock/"; + stripLen = 1; + }) - # cabal passes incorrect --host= when cross-compiling - # https://github.com/haskell/cabal/issues/5887 - (fetchpatch { - url = "https://raw.githubusercontent.com/input-output-hk/haskell.nix/122bd81150386867da07fdc9ad5096db6719545a/overlays/patches/ghc/cabal-host.patch"; - sha256 = "sha256:0yd0sajgi24sc1w5m55lkg2lp6kfkgpp3lgija2c8y3cmkwfpdc1"; - }) + # cabal passes incorrect --host= when cross-compiling + # https://github.com/haskell/cabal/issues/5887 + (fetchpatch { + url = "https://raw.githubusercontent.com/input-output-hk/haskell.nix/122bd81150386867da07fdc9ad5096db6719545a/overlays/patches/ghc/cabal-host.patch"; + sha256 = "sha256:0yd0sajgi24sc1w5m55lkg2lp6kfkgpp3lgija2c8y3cmkwfpdc1"; + }) - # In order to build ghcjs packages, the Cabal of the ghc used for the ghcjs - # needs to be patched. Ref https://github.com/haskell/cabal/pull/7575 - (fetchpatch { - url = "https://github.com/haskell/cabal/commit/369c4a0a54ad08a9e6b0d3bd303fedd7b5e5a336.patch"; - sha256 = "120f11hwyaqa0pq9g5l1300crqij49jg0rh83hnp9sa49zfdwx1n"; - stripLen = 3; - extraPrefix = "libraries/Cabal/Cabal/"; - }) + # In order to build ghcjs packages, the Cabal of the ghc used for the ghcjs + # needs to be patched. Ref https://github.com/haskell/cabal/pull/7575 + (fetchpatch { + url = "https://github.com/haskell/cabal/commit/369c4a0a54ad08a9e6b0d3bd303fedd7b5e5a336.patch"; + sha256 = "120f11hwyaqa0pq9g5l1300crqij49jg0rh83hnp9sa49zfdwx1n"; + stripLen = 3; + extraPrefix = "libraries/Cabal/Cabal/"; + }) - # We need to be able to set AR_STAGE0 and LD_STAGE0 when cross-compiling - (fetchpatch { - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/8f7dd5710b80906ea7a3e15b7bb56a883a49fed8.patch"; - hash = "sha256-C636Nq2U8YOG/av7XQmG3L1rU0bmC9/7m7Hty5pm5+s="; - }) + # We need to be able to set AR_STAGE0 and LD_STAGE0 when cross-compiling + (fetchpatch { + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/8f7dd5710b80906ea7a3e15b7bb56a883a49fed8.patch"; + hash = "sha256-C636Nq2U8YOG/av7XQmG3L1rU0bmC9/7m7Hty5pm5+s="; + }) - # Backport part of to 8.10.7 - # The change we are interested in is that Cabal no longer sets include-dirs - # for the GHCi library delegating to the system search path or (in our case) - # cc-wrapper. Without this patch, the target libffi ends up in there (which - # we provide via --with-ffi-includes) which breaks bootstrapping e.g. when - # cross compiling GHC. Without include-dirs, cc-wrapper and splicing will - # correctly pick the suitable libffi out of the build environment. - (fetchpatch { - name = "ghci-no-libffi-include.patch"; - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/b2721819f391ab49871271283f32df54810c4387.patch"; - sha256 = "1rmv3132xhxbka97v0rx7r6larx5f5nnvs4mgm9q3rmgpjyd1vf9"; - includes = [ "libraries/ghci/ghci.cabal.in" ]; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Make Block.h compile with c++ compilers. Remove with the next release - (fetchpatch { - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch"; - sha256 = "0r4zjj0bv1x1m2dgxp3adsf2xkr94fjnyj1igsivd9ilbs5ja0b5"; - }) - ] - ++ lib.optionals (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) [ - # Prevent the paths module from emitting symbols that we don't use - # when building with separate outputs. - # - # These cause problems as they're not eliminated by GHC's dead code - # elimination on aarch64-darwin. (see - # https://github.com/NixOS/nixpkgs/issues/140774 for details). - ./Cabal-3.2-3.4-paths-fix-cycle-aarch64-darwin.patch - ]; + # Backport part of to 8.10.7 + # The change we are interested in is that Cabal no longer sets include-dirs + # for the GHCi library delegating to the system search path or (in our case) + # cc-wrapper. Without this patch, the target libffi ends up in there (which + # we provide via --with-ffi-includes) which breaks bootstrapping e.g. when + # cross compiling GHC. Without include-dirs, cc-wrapper and splicing will + # correctly pick the suitable libffi out of the build environment. + (fetchpatch { + name = "ghci-no-libffi-include.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/b2721819f391ab49871271283f32df54810c4387.patch"; + sha256 = "1rmv3132xhxbka97v0rx7r6larx5f5nnvs4mgm9q3rmgpjyd1vf9"; + includes = [ "libraries/ghci/ghci.cabal.in" ]; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Make Block.h compile with c++ compilers. Remove with the next release + (fetchpatch { + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch"; + sha256 = "0r4zjj0bv1x1m2dgxp3adsf2xkr94fjnyj1igsivd9ilbs5ja0b5"; + }) + ] + ++ lib.optionals (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) [ + # Prevent the paths module from emitting symbols that we don't use + # when building with separate outputs. + # + # These cause problems as they're not eliminated by GHC's dead code + # elimination on aarch64-darwin. (see + # https://github.com/NixOS/nixpkgs/issues/140774 for details). + ./Cabal-3.2-3.4-paths-fix-cycle-aarch64-darwin.patch + ]; postPatch = "patchShebangs ."; # GHC is a bit confused on its cross terminology. # TODO(@sternenseemann): investigate coreutils dependencies and pass absolute paths - preConfigure = - '' - for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do - export "''${env#TARGET_}=''${!env}" - done - # Stage0 (build->build) which builds stage 1 - export GHC="${bootPkgs.ghc}/bin/ghc" - # GHC is a bit confused on its cross terminology, as these would normally be - # the *host* tools. - export CC="${toolPath "cc" targetCC}" - export CXX="${toolPath "c++" targetCC}" - # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 - export LD="${toolPath "ld${lib.optionalString useLdGold ".gold"}" targetCC}" - export AS="${toolPath "as" targetCC}" - export AR="${toolPath "ar" targetCC}" - export NM="${toolPath "nm" targetCC}" - export RANLIB="${toolPath "ranlib" targetCC}" - export READELF="${toolPath "readelf" targetCC}" - export STRIP="${toolPath "strip" targetCC}" - export OBJDUMP="${toolPath "objdump" targetCC}" - '' - + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' - export OTOOL="${toolPath "otool" targetCC}" - export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}" - '' - + lib.optionalString useLLVM '' - export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc" - export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt" - '' - + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' - # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm - # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't - # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC - # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand - # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible. - # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use - # for llc and opt which would require using a custom darwin stdenv for targetCC. - export CLANG="${ - if targetCC.isClang then - toolPath "clang" targetCC - else - "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang" - }" - '' - + '' - # No need for absolute paths since these tools only need to work during the build - export CC_STAGE0="$CC_FOR_BUILD" - export LD_STAGE0="$LD_FOR_BUILD" - export AR_STAGE0="$AR_FOR_BUILD" + preConfigure = '' + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do + export "''${env#TARGET_}=''${!env}" + done + # Stage0 (build->build) which builds stage 1 + export GHC="${bootPkgs.ghc}/bin/ghc" + # GHC is a bit confused on its cross terminology, as these would normally be + # the *host* tools. + export CC="${toolPath "cc" targetCC}" + export CXX="${toolPath "c++" targetCC}" + # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 + export LD="${toolPath "ld${lib.optionalString useLdGold ".gold"}" targetCC}" + export AS="${toolPath "as" targetCC}" + export AR="${toolPath "ar" targetCC}" + export NM="${toolPath "nm" targetCC}" + export RANLIB="${toolPath "ranlib" targetCC}" + export READELF="${toolPath "readelf" targetCC}" + export STRIP="${toolPath "strip" targetCC}" + export OBJDUMP="${toolPath "objdump" targetCC}" + '' + + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' + export OTOOL="${toolPath "otool" targetCC}" + export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}" + '' + + lib.optionalString useLLVM '' + export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc" + export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt" + '' + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm + # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't + # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC + # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand + # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible. + # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use + # for llc and opt which would require using a custom darwin stdenv for targetCC. + export CLANG="${ + if targetCC.isClang then + toolPath "clang" targetCC + else + "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang" + }" + '' + + '' + # No need for absolute paths since these tools only need to work during the build + export CC_STAGE0="$CC_FOR_BUILD" + export LD_STAGE0="$LD_FOR_BUILD" + export AR_STAGE0="$AR_FOR_BUILD" - echo -n "${buildMK}" > mk/build.mk - sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export NIX_LDFLAGS+=" -no_dtrace_dof" + echo -n "${buildMK}" > mk/build.mk + sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export NIX_LDFLAGS+=" -no_dtrace_dof" - # GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7 - export XATTR=${lib.getBin xattr}/bin/xattr - '' - + lib.optionalString targetPlatform.useAndroidPrebuilt '' - sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets - '' - + lib.optionalString targetPlatform.isMusl '' - echo "patching llvm-targets for musl targets..." - echo "Cloning these existing '*-linux-gnu*' targets:" - grep linux-gnu llvm-targets | sed 's/^/ /' - echo "(go go gadget sed)" - sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets - echo "llvm-targets now contains these '*-linux-musl*' targets:" - grep linux-musl llvm-targets | sed 's/^/ /' + # GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7 + export XATTR=${lib.getBin xattr}/bin/xattr + '' + + lib.optionalString targetPlatform.useAndroidPrebuilt '' + sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets + '' + + lib.optionalString targetPlatform.isMusl '' + echo "patching llvm-targets for musl targets..." + echo "Cloning these existing '*-linux-gnu*' targets:" + grep linux-gnu llvm-targets | sed 's/^/ /' + echo "(go go gadget sed)" + sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets + echo "llvm-targets now contains these '*-linux-musl*' targets:" + grep linux-musl llvm-targets | sed 's/^/ /' - echo "And now patching to preserve '-musleabi' as done with '-gnueabi'" - # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen) - for x in configure aclocal.m4; do - substituteInPlace $x \ - --replace '*-android*|*-gnueabi*)' \ - '*-android*|*-gnueabi*|*-musleabi*)' - done - ''; + echo "And now patching to preserve '-musleabi' as done with '-gnueabi'" + # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen) + for x in configure aclocal.m4; do + substituteInPlace $x \ + --replace '*-android*|*-gnueabi*)' \ + '*-android*|*-gnueabi*|*-musleabi*)' + done + ''; # Although it is usually correct to pass --host, we don't do that here because # GHC's usage of build, host, and target is non-standard. @@ -475,47 +473,47 @@ stdenv.mkDerivation ( # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = [ "build" - ] ++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target"; + ] + ++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target"; # `--with` flags for libraries needed for RTS linker - configureFlags = - [ - "--datadir=$doc/share/doc/ghc" - ] - ++ lib.optionals enableTerminfo [ - "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include" - "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib" - ] - ++ lib.optionals (args.${libffi_name} != null) [ - "--with-system-libffi" - "--with-ffi-includes=${targetLibs.libffi.dev}/include" - "--with-ffi-libraries=${targetLibs.libffi.out}/lib" - ] - ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ - "--with-gmp-includes=${targetLibs.gmp.dev}/include" - "--with-gmp-libraries=${targetLibs.gmp.out}/lib" - ] - ++ - lib.optionals - (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) - [ - "--with-iconv-includes=${libiconv}/include" - "--with-iconv-libraries=${libiconv}/lib" - ] - ++ lib.optionals (targetPlatform != hostPlatform) [ - "--enable-bootstrap-with-devel-snapshot" - ] - ++ lib.optionals useLdGold [ - "CFLAGS=-fuse-ld=gold" - "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" - "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" - ] - ++ lib.optionals (disableLargeAddressSpace) [ - "--disable-large-address-space" - ] - ++ lib.optionals enableUnregisterised [ - "--enable-unregisterised" - ]; + configureFlags = [ + "--datadir=$doc/share/doc/ghc" + ] + ++ lib.optionals enableTerminfo [ + "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include" + "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib" + ] + ++ lib.optionals (args.${libffi_name} != null) [ + "--with-system-libffi" + "--with-ffi-includes=${targetLibs.libffi.dev}/include" + "--with-ffi-libraries=${targetLibs.libffi.out}/lib" + ] + ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [ + "--with-gmp-includes=${targetLibs.gmp.dev}/include" + "--with-gmp-libraries=${targetLibs.gmp.out}/lib" + ] + ++ + lib.optionals + (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) + [ + "--with-iconv-includes=${libiconv}/include" + "--with-iconv-libraries=${libiconv}/lib" + ] + ++ lib.optionals (targetPlatform != hostPlatform) [ + "--enable-bootstrap-with-devel-snapshot" + ] + ++ lib.optionals useLdGold [ + "CFLAGS=-fuse-ld=gold" + "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" + "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" + ] + ++ lib.optionals (disableLargeAddressSpace) [ + "--disable-large-address-space" + ] + ++ lib.optionals enableUnregisterised [ + "--enable-unregisterised" + ]; # Make sure we never relax`$PATH` and hooks support for compatibility. strictDeps = true; @@ -523,25 +521,24 @@ stdenv.mkDerivation ( # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. dontAddExtraLibs = true; - nativeBuildInputs = - [ - perl - autoreconfHook - autoconf - automake - m4 - python3 - bootPkgs.alex - bootPkgs.happy - bootPkgs.hscolour - bootPkgs.ghc-settings-edit - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ] - ++ lib.optionals enableDocs [ - sphinx - ]; + nativeBuildInputs = [ + perl + autoreconfHook + autoconf + automake + m4 + python3 + bootPkgs.alex + bootPkgs.happy + bootPkgs.hscolour + bootPkgs.ghc-settings-edit + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ] + ++ lib.optionals enableDocs [ + sphinx + ]; # Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs. # See also GHC, {CC,LD,AR}_STAGE0 in preConfigure. @@ -588,45 +585,44 @@ stdenv.mkDerivation ( # Hydra which already warrants a significant speedup requiredSystemFeatures = [ "big-parallel" ]; - postInstall = - '' - settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings" + postInstall = '' + settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings" - # Make the installed GHC use the host->target tools. - ghc-settings-edit "$settingsFile" \ - "C compiler command" "${toolPath "cc" installCC}" \ - "Haskell CPP command" "${toolPath "cc" installCC}" \ - "C++ compiler command" "${toolPath "c++" installCC}" \ - "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ - "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ - "ar command" "${toolPath "ar" installCC}" \ - "ranlib command" "${toolPath "ranlib" installCC}" - '' - + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' - ghc-settings-edit "$settingsFile" \ - "otool command" "${toolPath "otool" installCC}" \ - "install_name_tool command" "${toolPath "install_name_tool" installCC}" - '' - + lib.optionalString useLLVM '' - ghc-settings-edit "$settingsFile" \ - "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ - "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" - '' - + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' - ghc-settings-edit "$settingsFile" \ - "LLVM clang command" "${ - # See comment for CLANG in preConfigure - if installCC.isClang then - toolPath "clang" installCC - else - "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" - }" - '' - + '' + # Make the installed GHC use the host->target tools. + ghc-settings-edit "$settingsFile" \ + "C compiler command" "${toolPath "cc" installCC}" \ + "Haskell CPP command" "${toolPath "cc" installCC}" \ + "C++ compiler command" "${toolPath "c++" installCC}" \ + "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ + "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ + "ar command" "${toolPath "ar" installCC}" \ + "ranlib command" "${toolPath "ranlib" installCC}" + '' + + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' + ghc-settings-edit "$settingsFile" \ + "otool command" "${toolPath "otool" installCC}" \ + "install_name_tool command" "${toolPath "install_name_tool" installCC}" + '' + + lib.optionalString useLLVM '' + ghc-settings-edit "$settingsFile" \ + "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ + "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" + '' + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + ghc-settings-edit "$settingsFile" \ + "LLVM clang command" "${ + # See comment for CLANG in preConfigure + if installCC.isClang then + toolPath "clang" installCC + else + "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" + }" + '' + + '' - # Install the bash completion file. - install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc - ''; + # Install the bash completion file. + install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc + ''; passthru = { inherit bootPkgs targetPrefix; diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index 82d7a11c7183..7837142b9a54 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -47,25 +47,24 @@ let downloadsUrl = "https://downloads.haskell.org/ghc"; - runtimeDeps = - [ - targetPackages.stdenv.cc - targetPackages.stdenv.cc.bintools - coreutils # for cat - ] - ++ - lib.optionals - ( - assert useLLVM -> !(llvmPackages == null); - useLLVM - ) - [ - (lib.getBin llvmPackages.llvm) - ] - # On darwin, we need unwrapped bintools as well (for otool) - ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ - targetPackages.stdenv.cc.bintools.bintools - ]; + runtimeDeps = [ + targetPackages.stdenv.cc + targetPackages.stdenv.cc.bintools + coreutils # for cat + ] + ++ + lib.optionals + ( + assert useLLVM -> !(llvmPackages == null); + useLLVM + ) + [ + (lib.getBin llvmPackages.llvm) + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; in @@ -165,14 +164,13 @@ stdenv.mkDerivation rec { ''; configurePlatforms = [ ]; - configureFlags = - [ - "--with-gmp-includes=${lib.getDev gmp}/include" - # Note `--with-gmp-libraries` does nothing for GHC bindists: - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" - ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; + configureFlags = [ + "--with-gmp-includes=${lib.getDev gmp}/include" + # Note `--with-gmp-libraries` does nothing for GHC bindists: + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" + ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; # No building is necessary, but calling make without flags ironically # calls install-strip ... diff --git a/pkgs/development/compilers/ghc/9.0.2-binary.nix b/pkgs/development/compilers/ghc/9.0.2-binary.nix index ff70b4587eb3..0e6a0b4bb628 100644 --- a/pkgs/development/compilers/ghc/9.0.2-binary.nix +++ b/pkgs/development/compilers/ghc/9.0.2-binary.nix @@ -208,19 +208,18 @@ let libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY" + "LD_LIBRARY_PATH"; - runtimeDeps = - [ - targetPackages.stdenv.cc - targetPackages.stdenv.cc.bintools - coreutils # for cat - ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] - # On darwin, we need unwrapped bintools as well (for otool) - ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ - targetPackages.stdenv.cc.bintools.bintools - ]; + runtimeDeps = [ + targetPackages.stdenv.cc + targetPackages.stdenv.cc.bintools + coreutils # for cat + ] + ++ lib.optionals useLLVM [ + (lib.getBin llvmPackages.llvm) + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; in @@ -339,15 +338,14 @@ stdenv.mkDerivation { preConfigure = lib.optionalString stdenv.targetPlatform.isAarch32 "LD=ld.gold"; configurePlatforms = [ ]; - configureFlags = - [ - "--with-gmp-includes=${lib.getDev gmpUsed}/include" - # Note `--with-gmp-libraries` does nothing for GHC bindists: - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" - # From: https://github.com/NixOS/nixpkgs/pull/43369/commits - ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; + configureFlags = [ + "--with-gmp-includes=${lib.getDev gmpUsed}/include" + # Note `--with-gmp-libraries` does nothing for GHC bindists: + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" + # From: https://github.com/NixOS/nixpkgs/pull/43369/commits + ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; # No building is necessary, but calling make without flags ironically # calls install-strip ... @@ -363,23 +361,22 @@ stdenv.mkDerivation { makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ]; # Patch scripts to include runtime dependencies in $PATH. - postInstall = - '' - for i in "$out/bin/"*; do - test ! -h "$i" || continue - isScript "$i" || continue - sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i" - done - '' - # On Darwin, GHC doesn't install a bundled libffi.so, but instead uses the - # system one (see postUnpack). Due to a bug in Hadrian, the (bundled) libffi - # headers are installed anyways. This problem has been fixed in GHC 9.2: - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8189. While the system - # header should shadow the GHC installed ones, remove them to be safe. - + lib.optionalString (stdenv.hostPlatform.isDarwin && binDistUsed.isHadrian or false) '' - echo Deleting redundant libffi headers: - find "$out" '(' -name ffi.h -or -name ffitarget.h ')' -print -delete - ''; + postInstall = '' + for i in "$out/bin/"*; do + test ! -h "$i" || continue + isScript "$i" || continue + sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i" + done + '' + # On Darwin, GHC doesn't install a bundled libffi.so, but instead uses the + # system one (see postUnpack). Due to a bug in Hadrian, the (bundled) libffi + # headers are installed anyways. This problem has been fixed in GHC 9.2: + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8189. While the system + # header should shadow the GHC installed ones, remove them to be safe. + + lib.optionalString (stdenv.hostPlatform.isDarwin && binDistUsed.isHadrian or false) '' + echo Deleting redundant libffi headers: + find "$out" '(' -name ffi.h -or -name ffitarget.h ')' -print -delete + ''; # Apparently necessary for the ghc Alpine (musl) bindist: # When we strip, and then run the @@ -484,26 +481,25 @@ stdenv.mkDerivation { [ $(./main) == "yes" ] ''; - passthru = - { - targetPrefix = ""; - enableShared = true; + passthru = { + targetPrefix = ""; + enableShared = true; - inherit llvmPackages; + inherit llvmPackages; - # Our Cabal compiler name - haskellCompilerName = "ghc-${version}"; - } - # We duplicate binDistUsed here since we have a sensible default even if no bindist is available, - # this makes sure that getting the `meta` attribute doesn't throw even on unsupported platforms. - // lib.optionalAttrs (ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}.isHadrian or false) { - # Normal GHC derivations expose the hadrian derivation used to build them - # here. In the case of bindists we just make sure that the attribute exists, - # as it is used for checking if a GHC derivation has been built with hadrian. - # The isHadrian mechanism will become obsolete with GHCs that use hadrian - # exclusively, i.e. 9.6 (and 9.4?). - hadrian = null; - }; + # Our Cabal compiler name + haskellCompilerName = "ghc-${version}"; + } + # We duplicate binDistUsed here since we have a sensible default even if no bindist is available, + # this makes sure that getting the `meta` attribute doesn't throw even on unsupported platforms. + // lib.optionalAttrs (ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}.isHadrian or false) { + # Normal GHC derivations expose the hadrian derivation used to build them + # here. In the case of bindists we just make sure that the attribute exists, + # as it is used for checking if a GHC derivation has been built with hadrian. + # The isHadrian mechanism will become obsolete with GHCs that use hadrian + # exclusively, i.e. 9.6 (and 9.4?). + hadrian = null; + }; meta = rec { homepage = "http://haskell.org/ghc"; diff --git a/pkgs/development/compilers/ghc/9.2.4-binary.nix b/pkgs/development/compilers/ghc/9.2.4-binary.nix index 9a48cd397628..e9354461fdad 100644 --- a/pkgs/development/compilers/ghc/9.2.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.2.4-binary.nix @@ -202,19 +202,18 @@ let libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY" + "LD_LIBRARY_PATH"; - runtimeDeps = - [ - targetPackages.stdenv.cc - targetPackages.stdenv.cc.bintools - coreutils # for cat - ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] - # On darwin, we need unwrapped bintools as well (for otool) - ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ - targetPackages.stdenv.cc.bintools.bintools - ]; + runtimeDeps = [ + targetPackages.stdenv.cc + targetPackages.stdenv.cc.bintools + coreutils # for cat + ] + ++ lib.optionals useLLVM [ + (lib.getBin llvmPackages.llvm) + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; in @@ -333,15 +332,14 @@ stdenv.mkDerivation { preConfigure = lib.optionalString stdenv.targetPlatform.isAarch32 "LD=ld.gold"; configurePlatforms = [ ]; - configureFlags = - [ - "--with-gmp-includes=${lib.getDev gmpUsed}/include" - # Note `--with-gmp-libraries` does nothing for GHC bindists: - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" - # From: https://github.com/NixOS/nixpkgs/pull/43369/commits - ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; + configureFlags = [ + "--with-gmp-includes=${lib.getDev gmpUsed}/include" + # Note `--with-gmp-libraries` does nothing for GHC bindists: + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6124 + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}" + # From: https://github.com/NixOS/nixpkgs/pull/43369/commits + ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override"; # No building is necessary, but calling make without flags ironically # calls install-strip ... @@ -468,26 +466,25 @@ stdenv.mkDerivation { [ $(./main) == "yes" ] ''; - passthru = - { - targetPrefix = ""; - enableShared = true; + passthru = { + targetPrefix = ""; + enableShared = true; - inherit llvmPackages; + inherit llvmPackages; - # Our Cabal compiler name - haskellCompilerName = "ghc-${version}"; - } - # We duplicate binDistUsed here since we have a sensible default even if no bindist is available, - # this makes sure that getting the `meta` attribute doesn't throw even on unsupported platforms. - // lib.optionalAttrs (ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}.isHadrian or false) { - # Normal GHC derivations expose the hadrian derivation used to build them - # here. In the case of bindists we just make sure that the attribute exists, - # as it is used for checking if a GHC derivation has been built with hadrian. - # The isHadrian mechanism will become obsolete with GHCs that use hadrian - # exclusively, i.e. 9.6 (and 9.4?). - hadrian = null; - }; + # Our Cabal compiler name + haskellCompilerName = "ghc-${version}"; + } + # We duplicate binDistUsed here since we have a sensible default even if no bindist is available, + # this makes sure that getting the `meta` attribute doesn't throw even on unsupported platforms. + // lib.optionalAttrs (ghcBinDists.${distSetName}.${stdenv.hostPlatform.system}.isHadrian or false) { + # Normal GHC derivations expose the hadrian derivation used to build them + # here. In the case of bindists we just make sure that the attribute exists, + # as it is used for checking if a GHC derivation has been built with hadrian. + # The isHadrian mechanism will become obsolete with GHCs that use hadrian + # exclusively, i.e. 9.6 (and 9.4?). + hadrian = null; + }; meta = rec { homepage = "http://haskell.org/ghc"; diff --git a/pkgs/development/compilers/ghc/9.6.3-binary.nix b/pkgs/development/compilers/ghc/9.6.3-binary.nix index b84ff516c3ff..9128c3717e76 100644 --- a/pkgs/development/compilers/ghc/9.6.3-binary.nix +++ b/pkgs/development/compilers/ghc/9.6.3-binary.nix @@ -201,19 +201,18 @@ let libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY" + "LD_LIBRARY_PATH"; - runtimeDeps = - [ - targetPackages.stdenv.cc - targetPackages.stdenv.cc.bintools - coreutils # for cat - ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] - # On darwin, we need unwrapped bintools as well (for otool) - ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ - targetPackages.stdenv.cc.bintools.bintools - ]; + runtimeDeps = [ + targetPackages.stdenv.cc + targetPackages.stdenv.cc.bintools + coreutils # for cat + ] + ++ lib.optionals useLLVM [ + (lib.getBin llvmPackages.llvm) + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; in @@ -341,21 +340,20 @@ stdenv.mkDerivation { makeFlags = lib.optionals stdenv.buildPlatform.isDarwin [ "XATTR=/does-not-exist" ]; # Patch scripts to include runtime dependencies in $PATH. - postInstall = - '' - for i in "$out/bin/"*; do - test ! -h "$i" || continue - isScript "$i" || continue - sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i" - done - '' - + lib.optionalString stdenv.targetPlatform.isDarwin '' - # Work around building with binary GHC on Darwin due to GHC’s use of `ar -L` when it - # detects `llvm-ar` even though the resulting archives are not supported by ld64. - # https://gitlab.haskell.org/ghc/ghc/-/issues/23188 - # https://github.com/haskell/cabal/issues/8882 - sed -i -e 's/,("ar supports -L", "YES")/,("ar supports -L", "NO")/' "$out/lib/ghc-${version}/lib/settings" - ''; + postInstall = '' + for i in "$out/bin/"*; do + test ! -h "$i" || continue + isScript "$i" || continue + sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i" + done + '' + + lib.optionalString stdenv.targetPlatform.isDarwin '' + # Work around building with binary GHC on Darwin due to GHC’s use of `ar -L` when it + # detects `llvm-ar` even though the resulting archives are not supported by ld64. + # https://gitlab.haskell.org/ghc/ghc/-/issues/23188 + # https://github.com/haskell/cabal/issues/8882 + sed -i -e 's/,("ar supports -L", "YES")/,("ar supports -L", "NO")/' "$out/lib/ghc-${version}/lib/settings" + ''; # Apparently necessary for the ghc Alpine (musl) bindist: # When we strip, and then run the diff --git a/pkgs/development/compilers/ghc/9.8.4-binary.nix b/pkgs/development/compilers/ghc/9.8.4-binary.nix index 2064b87fc8d0..35e26baba956 100644 --- a/pkgs/development/compilers/ghc/9.8.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.8.4-binary.nix @@ -215,19 +215,18 @@ let libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY" + "LD_LIBRARY_PATH"; - runtimeDeps = - [ - targetPackages.stdenv.cc - targetPackages.stdenv.cc.bintools - coreutils # for cat - ] - ++ lib.optionals useLLVM [ - (lib.getBin llvmPackages.llvm) - ] - # On darwin, we need unwrapped bintools as well (for otool) - ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ - targetPackages.stdenv.cc.bintools.bintools - ]; + runtimeDeps = [ + targetPackages.stdenv.cc + targetPackages.stdenv.cc.bintools + coreutils # for cat + ] + ++ lib.optionals useLLVM [ + (lib.getBin llvmPackages.llvm) + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; in @@ -346,21 +345,20 @@ stdenv.mkDerivation { dontBuild = true; # Patch scripts to include runtime dependencies in $PATH. - postInstall = - '' - for i in "$out/bin/"*; do - test ! -h "$i" || continue - isScript "$i" || continue - sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i" - done - '' - + lib.optionalString stdenv.targetPlatform.isDarwin '' - # Work around building with binary GHC on Darwin due to GHC’s use of `ar -L` when it - # detects `llvm-ar` even though the resulting archives are not supported by ld64. - # https://gitlab.haskell.org/ghc/ghc/-/issues/23188 - # https://github.com/haskell/cabal/issues/8882 - sed -i -e 's/,("ar supports -L", "YES")/,("ar supports -L", "NO")/' "$out/lib/ghc-${version}/lib/settings" - ''; + postInstall = '' + for i in "$out/bin/"*; do + test ! -h "$i" || continue + isScript "$i" || continue + sed -i -e '2i export PATH="${lib.makeBinPath runtimeDeps}:$PATH"' "$i" + done + '' + + lib.optionalString stdenv.targetPlatform.isDarwin '' + # Work around building with binary GHC on Darwin due to GHC’s use of `ar -L` when it + # detects `llvm-ar` even though the resulting archives are not supported by ld64. + # https://gitlab.haskell.org/ghc/ghc/-/issues/23188 + # https://github.com/haskell/cabal/issues/8882 + sed -i -e 's/,("ar supports -L", "YES")/,("ar supports -L", "NO")/' "$out/lib/ghc-${version}/lib/settings" + ''; # Apparently necessary for the ghc Alpine (musl) bindist: # When we strip, and then run the diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index f4f40bec3f22..f7fa6925774c 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -374,7 +374,8 @@ let else pkgsBuildTarget.targetPackages.stdenv.cc ) - ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm; + ] + ++ lib.optional useLLVM buildTargetLlvmPackages.llvm; buildCC = buildPackages.stdenv.cc; targetCC = builtins.head toolsForTarget; @@ -490,113 +491,112 @@ stdenv.mkDerivation ( # GHC is a bit confused on its cross terminology. # TODO(@sternenseemann): investigate coreutils dependencies and pass absolute paths - preConfigure = - '' - for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do - export "''${env#TARGET_}=''${!env}" - done - # No need for absolute paths since these tools only need to work during the build - export CC_STAGE0="$CC_FOR_BUILD" - export LD_STAGE0="$LD_FOR_BUILD" - export AR_STAGE0="$AR_FOR_BUILD" + preConfigure = '' + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do + export "''${env#TARGET_}=''${!env}" + done + # No need for absolute paths since these tools only need to work during the build + export CC_STAGE0="$CC_FOR_BUILD" + export LD_STAGE0="$LD_FOR_BUILD" + export AR_STAGE0="$AR_FOR_BUILD" - # Stage0 (build->build) which builds stage 1 - export GHC="${bootPkgs.ghc}/bin/ghc" - # GHC is a bit confused on its cross terminology, as these would normally be - # the *host* tools. - export CC="${toolPath "cc" targetCC}" - export CXX="${toolPath "c++" targetCC}" - # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 - export LD="${toolPath "ld${lib.optionalString useLdGold ".gold"}" targetCC}" - export AS="${toolPath "as" targetCC}" - export AR="${toolPath "ar" targetCC}" - export NM="${toolPath "nm" targetCC}" - export RANLIB="${toolPath "ranlib" targetCC}" - export READELF="${toolPath "readelf" targetCC}" - export STRIP="${toolPath "strip" targetCC}" - export OBJDUMP="${toolPath "objdump" targetCC}" - '' - + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' - export OTOOL="${toolPath "otool" targetCC}" - export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}" - '' - + lib.optionalString useLLVM '' - export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc" - export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt" - '' - + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' - # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm - # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't - # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC - # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand - # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible. - # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use - # for llc and opt which would require using a custom darwin stdenv for targetCC. - export CLANG="${ - if targetCC.isClang then - toolPath "clang" targetCC - else - "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang" - }" - '' - + lib.optionalString (stdenv.hostPlatform.isLinux && hostPlatform.libc == "glibc") '' - export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export NIX_LDFLAGS+=" -no_dtrace_dof" + # Stage0 (build->build) which builds stage 1 + export GHC="${bootPkgs.ghc}/bin/ghc" + # GHC is a bit confused on its cross terminology, as these would normally be + # the *host* tools. + export CC="${toolPath "cc" targetCC}" + export CXX="${toolPath "c++" targetCC}" + # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 + export LD="${toolPath "ld${lib.optionalString useLdGold ".gold"}" targetCC}" + export AS="${toolPath "as" targetCC}" + export AR="${toolPath "ar" targetCC}" + export NM="${toolPath "nm" targetCC}" + export RANLIB="${toolPath "ranlib" targetCC}" + export READELF="${toolPath "readelf" targetCC}" + export STRIP="${toolPath "strip" targetCC}" + export OBJDUMP="${toolPath "objdump" targetCC}" + '' + + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' + export OTOOL="${toolPath "otool" targetCC}" + export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}" + '' + + lib.optionalString useLLVM '' + export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc" + export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt" + '' + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm + # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't + # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC + # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand + # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible. + # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use + # for llc and opt which would require using a custom darwin stdenv for targetCC. + export CLANG="${ + if targetCC.isClang then + toolPath "clang" targetCC + else + "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang" + }" + '' + + lib.optionalString (stdenv.hostPlatform.isLinux && hostPlatform.libc == "glibc") '' + export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export NIX_LDFLAGS+=" -no_dtrace_dof" - # GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7 - export XATTR=${lib.getBin xattr}/bin/xattr - '' - # If we are not using release tarballs, some files need to be generated using - # the boot script. - + lib.optionalString (rev != null) '' - echo ${version} > VERSION - echo ${rev} > GIT_COMMIT_ID - ./boot - '' - + lib.optionalString targetPlatform.useAndroidPrebuilt '' - sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets - '' - + lib.optionalString targetPlatform.isMusl '' - echo "patching llvm-targets for musl targets..." - echo "Cloning these existing '*-linux-gnu*' targets:" - grep linux-gnu llvm-targets | sed 's/^/ /' - echo "(go go gadget sed)" - sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets - echo "llvm-targets now contains these '*-linux-musl*' targets:" - grep linux-musl llvm-targets | sed 's/^/ /' + # GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7 + export XATTR=${lib.getBin xattr}/bin/xattr + '' + # If we are not using release tarballs, some files need to be generated using + # the boot script. + + lib.optionalString (rev != null) '' + echo ${version} > VERSION + echo ${rev} > GIT_COMMIT_ID + ./boot + '' + + lib.optionalString targetPlatform.useAndroidPrebuilt '' + sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets + '' + + lib.optionalString targetPlatform.isMusl '' + echo "patching llvm-targets for musl targets..." + echo "Cloning these existing '*-linux-gnu*' targets:" + grep linux-gnu llvm-targets | sed 's/^/ /' + echo "(go go gadget sed)" + sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets + echo "llvm-targets now contains these '*-linux-musl*' targets:" + grep linux-musl llvm-targets | sed 's/^/ /' - echo "And now patching to preserve '-musleabi' as done with '-gnueabi'" - # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen) - for x in configure aclocal.m4; do - substituteInPlace $x \ - --replace '*-android*|*-gnueabi*)' \ - '*-android*|*-gnueabi*|*-musleabi*)' - done - '' - # Need to make writable EM_CACHE for emscripten. The path in EM_CACHE must be absolute. - # https://gitlab.haskell.org/ghc/ghc/-/wikis/javascript-backend#configure-fails-with-sub-word-sized-atomic-operations-not-available - + lib.optionalString targetPlatform.isGhcjs '' - export EM_CACHE="$(realpath $(mktemp -d emcache.XXXXXXXXXX))" - cp -Lr ${ - targetCC # == emscripten - }/share/emscripten/cache/* "$EM_CACHE/" - chmod u+rwX -R "$EM_CACHE" - '' - # Create bash array hadrianFlagsArray for use in buildPhase. Do it in - # preConfigure, so overrideAttrs can be used to modify it effectively. - # hadrianSettings are passed via the command line so they are more visible - # in the build log. - + '' - hadrianFlagsArray=( - "-j$NIX_BUILD_CORES" - ${lib.escapeShellArgs hadrianSettings} - ) - ''; + echo "And now patching to preserve '-musleabi' as done with '-gnueabi'" + # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen) + for x in configure aclocal.m4; do + substituteInPlace $x \ + --replace '*-android*|*-gnueabi*)' \ + '*-android*|*-gnueabi*|*-musleabi*)' + done + '' + # Need to make writable EM_CACHE for emscripten. The path in EM_CACHE must be absolute. + # https://gitlab.haskell.org/ghc/ghc/-/wikis/javascript-backend#configure-fails-with-sub-word-sized-atomic-operations-not-available + + lib.optionalString targetPlatform.isGhcjs '' + export EM_CACHE="$(realpath $(mktemp -d emcache.XXXXXXXXXX))" + cp -Lr ${ + targetCC # == emscripten + }/share/emscripten/cache/* "$EM_CACHE/" + chmod u+rwX -R "$EM_CACHE" + '' + # Create bash array hadrianFlagsArray for use in buildPhase. Do it in + # preConfigure, so overrideAttrs can be used to modify it effectively. + # hadrianSettings are passed via the command line so they are more visible + # in the build log. + + '' + hadrianFlagsArray=( + "-j$NIX_BUILD_CORES" + ${lib.escapeShellArgs hadrianSettings} + ) + ''; ${if targetPlatform.isGhcjs then "configureScript" else null} = "emconfigure ./configure"; # GHC currently ships an edited config.sub so ghcjs is accepted which we can not rollback @@ -606,67 +606,67 @@ stdenv.mkDerivation ( configurePlatforms = [ "build" "host" - ] ++ lib.optional (targetPlatform != hostPlatform) "target"; + ] + ++ lib.optional (targetPlatform != hostPlatform) "target"; # `--with` flags for libraries needed for RTS linker - configureFlags = - [ - "--datadir=$doc/share/doc/ghc" - ] - ++ lib.optionals enableTerminfo [ - "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include" - "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib" - ] - ++ lib.optionals (libffi != null && !targetPlatform.isGhcjs) [ - "--with-system-libffi" - "--with-ffi-includes=${targetLibs.libffi.dev}/include" - "--with-ffi-libraries=${targetLibs.libffi.out}/lib" - ] - ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [ - "--with-gmp-includes=${targetLibs.gmp.dev}/include" - "--with-gmp-libraries=${targetLibs.gmp.out}/lib" - ] - ++ - lib.optionals - (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) - [ - "--with-iconv-includes=${libiconv}/include" - "--with-iconv-libraries=${libiconv}/lib" - ] - ++ lib.optionals (targetPlatform != hostPlatform) [ - "--enable-bootstrap-with-devel-snapshot" - ] - ++ lib.optionals useLdGold [ - "CFLAGS=-fuse-ld=gold" - "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" - "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" - ] - ++ lib.optionals (disableLargeAddressSpace) [ - "--disable-large-address-space" - ] - ++ lib.optionals enableDwarf [ - "--enable-dwarf-unwind" - "--with-libdw-includes=${lib.getDev targetLibs.elfutils}/include" - "--with-libdw-libraries=${lib.getLib targetLibs.elfutils}/lib" - ] - ++ lib.optionals targetPlatform.isDarwin [ - # Darwin uses llvm-ar. GHC will try to use `-L` with `ar` when it is `llvm-ar` - # but it doesn’t currently work because Cabal never uses `-L` on Darwin. See: - # https://gitlab.haskell.org/ghc/ghc/-/issues/23188 - # https://github.com/haskell/cabal/issues/8882 - "fp_cv_prog_ar_supports_dash_l=no" - ] - ++ lib.optionals enableUnregisterised [ - "--enable-unregisterised" - ] - ++ - lib.optionals - (stdenv.buildPlatform.isAarch64 && stdenv.buildPlatform.isMusl && lib.versionOlder version "9.12") - [ - # The bootstrap binaries for aarch64 musl were built for the wrong triple. - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13182 - "--enable-ignore-build-platform-mismatch" - ]; + configureFlags = [ + "--datadir=$doc/share/doc/ghc" + ] + ++ lib.optionals enableTerminfo [ + "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include" + "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib" + ] + ++ lib.optionals (libffi != null && !targetPlatform.isGhcjs) [ + "--with-system-libffi" + "--with-ffi-includes=${targetLibs.libffi.dev}/include" + "--with-ffi-libraries=${targetLibs.libffi.out}/lib" + ] + ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [ + "--with-gmp-includes=${targetLibs.gmp.dev}/include" + "--with-gmp-libraries=${targetLibs.gmp.out}/lib" + ] + ++ + lib.optionals + (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) + [ + "--with-iconv-includes=${libiconv}/include" + "--with-iconv-libraries=${libiconv}/lib" + ] + ++ lib.optionals (targetPlatform != hostPlatform) [ + "--enable-bootstrap-with-devel-snapshot" + ] + ++ lib.optionals useLdGold [ + "CFLAGS=-fuse-ld=gold" + "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" + "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" + ] + ++ lib.optionals (disableLargeAddressSpace) [ + "--disable-large-address-space" + ] + ++ lib.optionals enableDwarf [ + "--enable-dwarf-unwind" + "--with-libdw-includes=${lib.getDev targetLibs.elfutils}/include" + "--with-libdw-libraries=${lib.getLib targetLibs.elfutils}/lib" + ] + ++ lib.optionals targetPlatform.isDarwin [ + # Darwin uses llvm-ar. GHC will try to use `-L` with `ar` when it is `llvm-ar` + # but it doesn’t currently work because Cabal never uses `-L` on Darwin. See: + # https://gitlab.haskell.org/ghc/ghc/-/issues/23188 + # https://github.com/haskell/cabal/issues/8882 + "fp_cv_prog_ar_supports_dash_l=no" + ] + ++ lib.optionals enableUnregisterised [ + "--enable-unregisterised" + ] + ++ + lib.optionals + (stdenv.buildPlatform.isAarch64 && stdenv.buildPlatform.isMusl && lib.versionOlder version "9.12") + [ + # The bootstrap binaries for aarch64 musl were built for the wrong triple. + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13182 + "--enable-ignore-build-platform-mismatch" + ]; # Make sure we never relax`$PATH` and hooks support for compatibility. strictDeps = true; @@ -674,25 +674,24 @@ stdenv.mkDerivation ( # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. dontAddExtraLibs = true; - nativeBuildInputs = - [ - autoreconfHook - perl - hadrian - bootPkgs.alex - bootPkgs.happy - bootPkgs.hscolour - # Python is used in a few scripts invoked by hadrian to generate e.g. rts headers. - python3 - # Tool used to update GHC's settings file in postInstall - bootPkgs.ghc-settings-edit - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ] - ++ lib.optionals enableDocs [ - sphinx - ]; + nativeBuildInputs = [ + autoreconfHook + perl + hadrian + bootPkgs.alex + bootPkgs.happy + bootPkgs.hscolour + # Python is used in a few scripts invoked by hadrian to generate e.g. rts headers. + python3 + # Tool used to update GHC's settings file in postInstall + bootPkgs.ghc-settings-edit + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ] + ++ lib.optionals enableDocs [ + sphinx + ]; # For building runtime libs depsBuildTarget = toolsForTarget; @@ -719,17 +718,16 @@ stdenv.mkDerivation ( depsTargetTarget = map lib.getDev (libDeps targetPlatform); depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform); - hadrianFlags = - [ - "--flavour=${ghcFlavour}" - "--bignum=${if enableNativeBignum then "native" else "gmp"}" - "--docs=${if enableDocs then "no-sphinx-pdfs" else "no-sphinx"}" - ] - ++ lib.optionals (lib.versionAtLeast version "9.8") [ - # In 9.14 this will be default with release flavour. - # See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13444 - "--hash-unit-ids" - ]; + hadrianFlags = [ + "--flavour=${ghcFlavour}" + "--bignum=${if enableNativeBignum then "native" else "gmp"}" + "--docs=${if enableDocs then "no-sphinx-pdfs" else "no-sphinx"}" + ] + ++ lib.optionals (lib.versionAtLeast version "9.8") [ + # In 9.14 this will be default with release flavour. + # See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13444 + "--hash-unit-ids" + ]; buildPhase = '' runHook preBuild @@ -772,63 +770,61 @@ stdenv.mkDerivation ( # https://gitlab.haskell.org/ghc/ghc/-/issues/22058 # TODO(@sternenseemann): it would be nice if the bindist could be an intermediate # derivation, but since it is > 2GB even on x86_64-linux, not a good idea? - preInstall = - '' - pushd _build/bindist/* + preInstall = '' + pushd _build/bindist/* - '' - # the bindist configure script uses different env variables than the GHC configure script - # see https://github.com/NixOS/nixpkgs/issues/267250 and https://gitlab.haskell.org/ghc/ghc/-/issues/24211 - + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' - export InstallNameToolCmd=$INSTALL_NAME_TOOL - export OtoolCmd=$OTOOL - '' - + '' - $configureScript $configureFlags "''${configureFlagsArray[@]}" - ''; + '' + # the bindist configure script uses different env variables than the GHC configure script + # see https://github.com/NixOS/nixpkgs/issues/267250 and https://gitlab.haskell.org/ghc/ghc/-/issues/24211 + + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' + export InstallNameToolCmd=$INSTALL_NAME_TOOL + export OtoolCmd=$OTOOL + '' + + '' + $configureScript $configureFlags "''${configureFlagsArray[@]}" + ''; - postInstall = - '' - # leave bindist directory - popd + postInstall = '' + # leave bindist directory + popd - settingsFile="$out/lib/${targetPrefix}${haskellCompilerName}/lib/settings" + settingsFile="$out/lib/${targetPrefix}${haskellCompilerName}/lib/settings" - # Make the installed GHC use the host->target tools. - ghc-settings-edit "$settingsFile" \ - "C compiler command" "${toolPath "cc" installCC}" \ - "Haskell CPP command" "${toolPath "cc" installCC}" \ - "C++ compiler command" "${toolPath "c++" installCC}" \ - "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ - "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ - "ar command" "${toolPath "ar" installCC}" \ - "ranlib command" "${toolPath "ranlib" installCC}" - '' - + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' - ghc-settings-edit "$settingsFile" \ - "otool command" "${toolPath "otool" installCC}" \ - "install_name_tool command" "${toolPath "install_name_tool" installCC}" - '' - + lib.optionalString useLLVM '' - ghc-settings-edit "$settingsFile" \ - "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ - "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" - '' - + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' - ghc-settings-edit "$settingsFile" \ - "LLVM clang command" "${ - # See comment for CLANG in preConfigure - if installCC.isClang then - toolPath "clang" installCC - else - "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" - }" - '' - + '' + # Make the installed GHC use the host->target tools. + ghc-settings-edit "$settingsFile" \ + "C compiler command" "${toolPath "cc" installCC}" \ + "Haskell CPP command" "${toolPath "cc" installCC}" \ + "C++ compiler command" "${toolPath "c++" installCC}" \ + "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ + "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ + "ar command" "${toolPath "ar" installCC}" \ + "ranlib command" "${toolPath "ranlib" installCC}" + '' + + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' + ghc-settings-edit "$settingsFile" \ + "otool command" "${toolPath "otool" installCC}" \ + "install_name_tool command" "${toolPath "install_name_tool" installCC}" + '' + + lib.optionalString useLLVM '' + ghc-settings-edit "$settingsFile" \ + "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ + "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" + '' + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + ghc-settings-edit "$settingsFile" \ + "LLVM clang command" "${ + # See comment for CLANG in preConfigure + if installCC.isClang then + toolPath "clang" installCC + else + "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" + }" + '' + + '' - # Install the bash completion file. - install -Dm 644 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc - ''; + # Install the bash completion file. + install -Dm 644 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc + ''; passthru = { inherit bootPkgs targetPrefix haskellCompilerName; diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index 9c42c41cd1da..0bd5b9b506ef 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -115,54 +115,53 @@ let # TODO(@Ericson2314) Make unconditional targetPrefix = lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; - buildMK = - '' - BuildFlavour = ${ghcFlavour} - ifneq \"\$(BuildFlavour)\" \"\" - include mk/flavours/\$(BuildFlavour).mk - endif - BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"} - BUILD_SPHINX_PDF = NO + buildMK = '' + BuildFlavour = ${ghcFlavour} + ifneq \"\$(BuildFlavour)\" \"\" + include mk/flavours/\$(BuildFlavour).mk + endif + BUILD_SPHINX_HTML = ${if enableDocs then "YES" else "NO"} + BUILD_SPHINX_PDF = NO - WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"} + WITH_TERMINFO = ${if enableTerminfo then "YES" else "NO"} + '' + + + # Note [HADDOCK_DOCS]: + # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock` + # program is built (which we generally always want to have a complete GHC install) + # and whether it is run on the GHC sources to generate hyperlinked source code + # (which is impossible for cross-compilation); see: + # https://gitlab.haskell.org/ghc/ghc/-/issues/20077 + # This implies that currently a cross-compiled GHC will never have a `haddock` + # program, so it can never generate haddocks for any packages. + # If this is solved in the future, we'd like to unconditionally + # build the haddock program (removing the `enableHaddockProgram` option). '' - + - # Note [HADDOCK_DOCS]: - # Unfortunately currently `HADDOCK_DOCS` controls both whether the `haddock` - # program is built (which we generally always want to have a complete GHC install) - # and whether it is run on the GHC sources to generate hyperlinked source code - # (which is impossible for cross-compilation); see: - # https://gitlab.haskell.org/ghc/ghc/-/issues/20077 - # This implies that currently a cross-compiled GHC will never have a `haddock` - # program, so it can never generate haddocks for any packages. - # If this is solved in the future, we'd like to unconditionally - # build the haddock program (removing the `enableHaddockProgram` option). - '' - HADDOCK_DOCS = ${if enableHaddockProgram then "YES" else "NO"} - # Build haddocks for boot packages with hyperlinking - EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump + HADDOCK_DOCS = ${if enableHaddockProgram then "YES" else "NO"} + # Build haddocks for boot packages with hyperlinking + EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump - DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} - BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"} - '' - + lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} - CrossCompilePrefix = ${targetPrefix} + DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} + BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"} '' - + lib.optionalString (!enableProfiledLibs) '' - BUILD_PROF_LIBS = NO + + lib.optionalString (targetPlatform != hostPlatform) '' + Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + CrossCompilePrefix = ${targetPrefix} + '' + + lib.optionalString (!enableProfiledLibs) '' + BUILD_PROF_LIBS = NO + '' + + + # -fexternal-dynamic-refs apparently (because it's not clear from the documentation) + # makes the GHC RTS able to load static libraries, which may be needed for TemplateHaskell. + # This solution was described in https://www.tweag.io/blog/2020-09-30-bazel-static-haskell + lib.optionalString enableRelocatedStaticLibs '' + GhcLibHcOpts += -fPIC -fexternal-dynamic-refs + GhcRtsHcOpts += -fPIC -fexternal-dynamic-refs '' - + - # -fexternal-dynamic-refs apparently (because it's not clear from the documentation) - # makes the GHC RTS able to load static libraries, which may be needed for TemplateHaskell. - # This solution was described in https://www.tweag.io/blog/2020-09-30-bazel-static-haskell - lib.optionalString enableRelocatedStaticLibs '' - GhcLibHcOpts += -fPIC -fexternal-dynamic-refs - GhcRtsHcOpts += -fPIC -fexternal-dynamic-refs - '' - + lib.optionalString targetPlatform.useAndroidPrebuilt '' - EXTRA_CC_OPTS += -std=gnu99 - ''; + + lib.optionalString targetPlatform.useAndroidPrebuilt '' + EXTRA_CC_OPTS += -std=gnu99 + ''; # Splicer will pull out correct variations libDeps = @@ -176,7 +175,8 @@ let # GHC doesn't seem to have {LLC,OPT}_HOST toolsForTarget = [ pkgsBuildTarget.targetPackages.stdenv.cc - ] ++ lib.optional useLLVM buildTargetLlvmPackages.llvm; + ] + ++ lib.optional useLLVM buildTargetLlvmPackages.llvm; buildCC = buildPackages.stdenv.cc; targetCC = builtins.head toolsForTarget; @@ -282,140 +282,139 @@ stdenv.mkDerivation ( "doc" ]; - patches = - [ - # Determine size of time related types using hsc2hs instead of assuming CLong. - # Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc. - # https://github.com/haskell/ghcup-hs/issues/1107 - # https://gitlab.haskell.org/ghc/ghc/-/issues/25095 - # Note that in normal situations this shouldn't be the case since nixpkgs - # doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet). - (fetchpatch { - name = "unix-fix-ctimeval-size-32-bit.patch"; - url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch"; - sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv"; - stripLen = 1; - extraPrefix = "libraries/unix/"; - }) - ] - ++ lib.optionals (lib.versionOlder version "9.4") [ - # fix hyperlinked haddock sources: https://github.com/haskell/haddock/pull/1482 - (fetchpatch { - url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/1482.patch"; - sha256 = "sha256-8w8QUCsODaTvknCDGgTfFNZa8ZmvIKaKS+2ZJZ9foYk="; - extraPrefix = "utils/haddock/"; - stripLen = 1; - }) - ] + patches = [ + # Determine size of time related types using hsc2hs instead of assuming CLong. + # Prevents failures when e.g. stat(2)ing on 32bit systems with 64bit time_t etc. + # https://github.com/haskell/ghcup-hs/issues/1107 + # https://gitlab.haskell.org/ghc/ghc/-/issues/25095 + # Note that in normal situations this shouldn't be the case since nixpkgs + # doesn't set -D_FILE_OFFSET_BITS=64 and friends (yet). + (fetchpatch { + name = "unix-fix-ctimeval-size-32-bit.patch"; + url = "https://github.com/haskell/unix/commit/8183e05b97ce870dd6582a3677cc82459ae566ec.patch"; + sha256 = "17q5yyigqr5kxlwwzb95sx567ysfxlw6bp3j4ji20lz0947aw6gv"; + stripLen = 1; + extraPrefix = "libraries/unix/"; + }) + ] + ++ lib.optionals (lib.versionOlder version "9.4") [ + # fix hyperlinked haddock sources: https://github.com/haskell/haddock/pull/1482 + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/1482.patch"; + sha256 = "sha256-8w8QUCsODaTvknCDGgTfFNZa8ZmvIKaKS+2ZJZ9foYk="; + extraPrefix = "utils/haddock/"; + stripLen = 1; + }) + ] - ++ lib.optionals (lib.versionOlder version "9.4.6") [ - # Fix docs build with sphinx >= 6.0 - # https://gitlab.haskell.org/ghc/ghc/-/issues/22766 - (fetchpatch { - name = "ghc-docs-sphinx-6.0.patch"; - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/10e94a556b4f90769b7fd718b9790d58ae566600.patch"; - sha256 = "0kmhfamr16w8gch0lgln2912r8aryjky1hfcda3jkcwa5cdzgjdv"; - }) - ] + ++ lib.optionals (lib.versionOlder version "9.4.6") [ + # Fix docs build with sphinx >= 6.0 + # https://gitlab.haskell.org/ghc/ghc/-/issues/22766 + (fetchpatch { + name = "ghc-docs-sphinx-6.0.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/10e94a556b4f90769b7fd718b9790d58ae566600.patch"; + sha256 = "0kmhfamr16w8gch0lgln2912r8aryjky1hfcda3jkcwa5cdzgjdv"; + }) + ] - ++ [ - # Fix docs build with Sphinx >= 7 https://gitlab.haskell.org/ghc/ghc/-/issues/24129 - ./docs-sphinx-7.patch - ] + ++ [ + # Fix docs build with Sphinx >= 7 https://gitlab.haskell.org/ghc/ghc/-/issues/24129 + ./docs-sphinx-7.patch + ] - ++ lib.optionals (lib.versionOlder version "9.2.2") [ - # Add flag that fixes C++ exception handling; opt-in. Merged in 9.4 and 9.2.2. - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7423 - (fetchpatch { - name = "ghc-9.0.2-fcompact-unwind.patch"; - # Note that the test suite is not packaged. - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/c6132c782d974a7701e7f6447bdcd2bf6db4299a.patch?merge_request_iid=7423"; - sha256 = "sha256-b4feGZIaKDj/UKjWTNY6/jH4s2iate0wAgMxG3rAbZI="; - }) - ] + ++ lib.optionals (lib.versionOlder version "9.2.2") [ + # Add flag that fixes C++ exception handling; opt-in. Merged in 9.4 and 9.2.2. + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7423 + (fetchpatch { + name = "ghc-9.0.2-fcompact-unwind.patch"; + # Note that the test suite is not packaged. + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/c6132c782d974a7701e7f6447bdcd2bf6db4299a.patch?merge_request_iid=7423"; + sha256 = "sha256-b4feGZIaKDj/UKjWTNY6/jH4s2iate0wAgMxG3rAbZI="; + }) + ] - ++ lib.optionals (lib.versionAtLeast version "9.2") [ - # Don't generate code that doesn't compile when --enable-relocatable is passed to Setup.hs - # Can be removed if the Cabal library included with ghc backports the linked fix - (fetchpatch { - url = "https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98.patch"; - stripLen = 1; - extraPrefix = "libraries/Cabal/"; - sha256 = "sha256-yRQ6YmMiwBwiYseC5BsrEtDgFbWvst+maGgDtdD0vAY="; - }) - ] + ++ lib.optionals (lib.versionAtLeast version "9.2") [ + # Don't generate code that doesn't compile when --enable-relocatable is passed to Setup.hs + # Can be removed if the Cabal library included with ghc backports the linked fix + (fetchpatch { + url = "https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98.patch"; + stripLen = 1; + extraPrefix = "libraries/Cabal/"; + sha256 = "sha256-yRQ6YmMiwBwiYseC5BsrEtDgFbWvst+maGgDtdD0vAY="; + }) + ] - ++ lib.optionals (version == "9.4.6") [ - # Work around a type not being defined when including Rts.h in bytestring's cbits - # due to missing feature macros. See https://gitlab.haskell.org/ghc/ghc/-/issues/23810. - ./9.4.6-bytestring-posix-source.patch - ] + ++ lib.optionals (version == "9.4.6") [ + # Work around a type not being defined when including Rts.h in bytestring's cbits + # due to missing feature macros. See https://gitlab.haskell.org/ghc/ghc/-/issues/23810. + ./9.4.6-bytestring-posix-source.patch + ] - ++ lib.optionals (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) [ - # Prevent the paths module from emitting symbols that we don't use - # when building with separate outputs. - # - # These cause problems as they're not eliminated by GHC's dead code - # elimination on aarch64-darwin. (see - # https://github.com/NixOS/nixpkgs/issues/140774 for details). - ( - if lib.versionAtLeast version "9.2" then - ./Cabal-at-least-3.6-paths-fix-cycle-aarch64-darwin.patch - else - ./Cabal-3.2-3.4-paths-fix-cycle-aarch64-darwin.patch - ) - ] - - # Fixes stack overrun in rts which crashes an process whenever - # freeHaskellFunPtr is called with nixpkgs' hardening flags. - # https://gitlab.haskell.org/ghc/ghc/-/issues/25485 - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13599 - # TODO: patch doesn't apply for < 9.4, but may still be necessary? - ++ lib.optionals (lib.versionAtLeast version "9.4") [ - (fetchpatch { - name = "ghc-rts-adjustor-fix-i386-stack-overrun.patch"; - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/39bb6e583d64738db51441a556d499aa93a4fc4a.patch"; - sha256 = "0w5fx413z924bi2irsy1l4xapxxhrq158b5gn6jzrbsmhvmpirs0"; - }) - ] - - # Before GHC 9.6, GHC, when used to compile C sources (i.e. to drive the CC), would first - # invoke the C compiler to generate assembly and later call the assembler on the result of - # that operation. Unfortunately, that is brittle in a lot of cases, e.g. when using mismatched - # CC / assembler (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12005). This issue - # does not affect us. However, LLVM 18 introduced a check in clang that makes sure no - # non private labels occur between .cfi_startproc and .cfi_endproc which causes the - # assembly that the same version (!) of clang generates from rts/StgCRun.c to be rejected. - # This causes GHC to fail compilation on mach-o platforms ever since we upgraded to - # LLVM 19. + ++ lib.optionals (stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64) [ + # Prevent the paths module from emitting symbols that we don't use + # when building with separate outputs. # - # clang compiles the same file without issues whithout the roundtrip via assembly. Thus, - # the solution is to backport those changes from GHC 9.6 that skip the intermediate - # assembly step. - # - # https://gitlab.haskell.org/ghc/ghc/-/issues/25608#note_622589 - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6877 - ++ ( - if lib.versionAtLeast version "9.4" then - [ - # Need to use this patch so the next one applies, passes file location info to the cc phase - (fetchpatch { - name = "ghc-add-location-to-cc-phase.patch"; - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/4a7256a75af2fc0318bef771a06949ffb3939d5a.patch"; - hash = "sha256-DnTI+i1zMebeWvw75D59vMaEEBb2Nr9HusxTyhmdy2M="; - }) - # Makes Cc phase directly generate object files instead of assembly - (fetchpatch { - name = "ghc-cc-directly-emit-object.patch"; - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/96811ba491495b601ec7d6a32bef8563b0292109.patch"; - hash = "sha256-G8u7/MK/tGOEN8Wxccxj/YIOP7mL2G9Co1WKdHXOo6I="; - }) - ] + # These cause problems as they're not eliminated by GHC's dead code + # elimination on aarch64-darwin. (see + # https://github.com/NixOS/nixpkgs/issues/140774 for details). + ( + if lib.versionAtLeast version "9.2" then + ./Cabal-at-least-3.6-paths-fix-cycle-aarch64-darwin.patch else - [ - # TODO(@sternenseemann): backport changes to GHC < 9.4 if possible - ] - ); + ./Cabal-3.2-3.4-paths-fix-cycle-aarch64-darwin.patch + ) + ] + + # Fixes stack overrun in rts which crashes an process whenever + # freeHaskellFunPtr is called with nixpkgs' hardening flags. + # https://gitlab.haskell.org/ghc/ghc/-/issues/25485 + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13599 + # TODO: patch doesn't apply for < 9.4, but may still be necessary? + ++ lib.optionals (lib.versionAtLeast version "9.4") [ + (fetchpatch { + name = "ghc-rts-adjustor-fix-i386-stack-overrun.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/39bb6e583d64738db51441a556d499aa93a4fc4a.patch"; + sha256 = "0w5fx413z924bi2irsy1l4xapxxhrq158b5gn6jzrbsmhvmpirs0"; + }) + ] + + # Before GHC 9.6, GHC, when used to compile C sources (i.e. to drive the CC), would first + # invoke the C compiler to generate assembly and later call the assembler on the result of + # that operation. Unfortunately, that is brittle in a lot of cases, e.g. when using mismatched + # CC / assembler (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12005). This issue + # does not affect us. However, LLVM 18 introduced a check in clang that makes sure no + # non private labels occur between .cfi_startproc and .cfi_endproc which causes the + # assembly that the same version (!) of clang generates from rts/StgCRun.c to be rejected. + # This causes GHC to fail compilation on mach-o platforms ever since we upgraded to + # LLVM 19. + # + # clang compiles the same file without issues whithout the roundtrip via assembly. Thus, + # the solution is to backport those changes from GHC 9.6 that skip the intermediate + # assembly step. + # + # https://gitlab.haskell.org/ghc/ghc/-/issues/25608#note_622589 + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6877 + ++ ( + if lib.versionAtLeast version "9.4" then + [ + # Need to use this patch so the next one applies, passes file location info to the cc phase + (fetchpatch { + name = "ghc-add-location-to-cc-phase.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/4a7256a75af2fc0318bef771a06949ffb3939d5a.patch"; + hash = "sha256-DnTI+i1zMebeWvw75D59vMaEEBb2Nr9HusxTyhmdy2M="; + }) + # Makes Cc phase directly generate object files instead of assembly + (fetchpatch { + name = "ghc-cc-directly-emit-object.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/96811ba491495b601ec7d6a32bef8563b0292109.patch"; + hash = "sha256-G8u7/MK/tGOEN8Wxccxj/YIOP7mL2G9Co1WKdHXOo6I="; + }) + ] + else + [ + # TODO(@sternenseemann): backport changes to GHC < 9.4 if possible + ] + ); postPatch = "patchShebangs ."; @@ -424,102 +423,101 @@ stdenv.mkDerivation ( # GHC is a bit confused on its cross terminology. # TODO(@sternenseemann): investigate coreutils dependencies and pass absolute paths - preConfigure = - '' - for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do - export "''${env#TARGET_}=''${!env}" - done - # Stage0 (build->build) which builds stage 1 - export GHC="${bootPkgs.ghc}/bin/ghc" - # GHC is a bit confused on its cross terminology, as these would normally be - # the *host* tools. - export CC="${toolPath "cc" targetCC}" - export CXX="${toolPath "c++" targetCC}" - # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 - export LD="${toolPath "ld${lib.optionalString useLdGold ".gold"}" targetCC}" - export AS="${toolPath "as" targetCC}" - export AR="${toolPath "ar" targetCC}" - export NM="${toolPath "nm" targetCC}" - export RANLIB="${toolPath "ranlib" targetCC}" - export READELF="${toolPath "readelf" targetCC}" - export STRIP="${toolPath "strip" targetCC}" - export OBJDUMP="${toolPath "objdump" targetCC}" - '' - + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' - export OTOOL="${toolPath "otool" targetCC}" - export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}" - '' - + lib.optionalString useLLVM '' - export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc" - export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt" - '' - + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' - # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm - # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't - # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC - # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand - # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible. - # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use - # for llc and opt which would require using a custom darwin stdenv for targetCC. - export CLANG="${ - if targetCC.isClang then - toolPath "clang" targetCC - else - "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang" - }" - '' - + '' - # No need for absolute paths since these tools only need to work during the build - export CC_STAGE0="$CC_FOR_BUILD" - export LD_STAGE0="$LD_FOR_BUILD" - export AR_STAGE0="$AR_FOR_BUILD" + preConfigure = '' + for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do + export "''${env#TARGET_}=''${!env}" + done + # Stage0 (build->build) which builds stage 1 + export GHC="${bootPkgs.ghc}/bin/ghc" + # GHC is a bit confused on its cross terminology, as these would normally be + # the *host* tools. + export CC="${toolPath "cc" targetCC}" + export CXX="${toolPath "c++" targetCC}" + # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177 + export LD="${toolPath "ld${lib.optionalString useLdGold ".gold"}" targetCC}" + export AS="${toolPath "as" targetCC}" + export AR="${toolPath "ar" targetCC}" + export NM="${toolPath "nm" targetCC}" + export RANLIB="${toolPath "ranlib" targetCC}" + export READELF="${toolPath "readelf" targetCC}" + export STRIP="${toolPath "strip" targetCC}" + export OBJDUMP="${toolPath "objdump" targetCC}" + '' + + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' + export OTOOL="${toolPath "otool" targetCC}" + export INSTALL_NAME_TOOL="${toolPath "install_name_tool" targetCC}" + '' + + lib.optionalString useLLVM '' + export LLC="${lib.getBin buildTargetLlvmPackages.llvm}/bin/llc" + export OPT="${lib.getBin buildTargetLlvmPackages.llvm}/bin/opt" + '' + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + # LLVM backend on Darwin needs clang: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/codegens.html#llvm-code-generator-fllvm + # The executable we specify via $CLANG is used as an assembler (exclusively, it seems, but this isn't + # clarified in any user facing documentation). As such, it'll be called on assembly produced by $CC + # which usually comes from the darwin stdenv. To prevent a situation where $CLANG doesn't understand + # the assembly it is given, we need to make sure that it matches the LLVM version of $CC if possible. + # It is unclear (at the time of writing 2024-09-01) whether $CC should match the LLVM version we use + # for llc and opt which would require using a custom darwin stdenv for targetCC. + export CLANG="${ + if targetCC.isClang then + toolPath "clang" targetCC + else + "${buildTargetLlvmPackages.clang}/bin/${buildTargetLlvmPackages.clang.targetPrefix}clang" + }" + '' + + '' + # No need for absolute paths since these tools only need to work during the build + export CC_STAGE0="$CC_FOR_BUILD" + export LD_STAGE0="$LD_FOR_BUILD" + export AR_STAGE0="$AR_FOR_BUILD" - echo -n "${buildMK}" > mk/build.mk - '' - + lib.optionalString (lib.versionOlder version "9.2" || lib.versionAtLeast version "9.4") '' - sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure - '' - + lib.optionalString (stdenv.hostPlatform.isLinux && hostPlatform.libc == "glibc") '' - export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export NIX_LDFLAGS+=" -no_dtrace_dof" - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionAtLeast version "9.2") '' + echo -n "${buildMK}" > mk/build.mk + '' + + lib.optionalString (lib.versionOlder version "9.2" || lib.versionAtLeast version "9.4") '' + sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure + '' + + lib.optionalString (stdenv.hostPlatform.isLinux && hostPlatform.libc == "glibc") '' + export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export NIX_LDFLAGS+=" -no_dtrace_dof" + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionAtLeast version "9.2") '' - # GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7 - export XATTR=${lib.getBin xattr}/bin/xattr - '' - + lib.optionalString targetPlatform.useAndroidPrebuilt '' - sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets - '' - + lib.optionalString targetPlatform.isMusl '' - echo "patching llvm-targets for musl targets..." - echo "Cloning these existing '*-linux-gnu*' targets:" - grep linux-gnu llvm-targets | sed 's/^/ /' - echo "(go go gadget sed)" - sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets - echo "llvm-targets now contains these '*-linux-musl*' targets:" - grep linux-musl llvm-targets | sed 's/^/ /' + # GHC tries the host xattr /usr/bin/xattr by default which fails since it expects python to be 2.7 + export XATTR=${lib.getBin xattr}/bin/xattr + '' + + lib.optionalString targetPlatform.useAndroidPrebuilt '' + sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets + '' + + lib.optionalString targetPlatform.isMusl '' + echo "patching llvm-targets for musl targets..." + echo "Cloning these existing '*-linux-gnu*' targets:" + grep linux-gnu llvm-targets | sed 's/^/ /' + echo "(go go gadget sed)" + sed -i 's,\(^.*linux-\)gnu\(.*\)$,\0\n\1musl\2,' llvm-targets + echo "llvm-targets now contains these '*-linux-musl*' targets:" + grep linux-musl llvm-targets | sed 's/^/ /' - echo "And now patching to preserve '-musleabi' as done with '-gnueabi'" - # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen) - for x in configure aclocal.m4; do - substituteInPlace $x \ - --replace '*-android*|*-gnueabi*)' \ - '*-android*|*-gnueabi*|*-musleabi*)' - done - '' - # HACK: allow bootstrapping with GHC 8.10 which works fine, as we don't have - # binary 9.0 packaged. Bootstrapping with 9.2 is broken without hadrian. - + lib.optionalString (lib.versions.majorMinor version == "9.4") '' - substituteInPlace configure --replace \ - 'MinBootGhcVersion="9.0"' \ - 'MinBootGhcVersion="8.10"' - ''; + echo "And now patching to preserve '-musleabi' as done with '-gnueabi'" + # (aclocal.m4 is actual source, but patch configure as well since we don't re-gen) + for x in configure aclocal.m4; do + substituteInPlace $x \ + --replace '*-android*|*-gnueabi*)' \ + '*-android*|*-gnueabi*|*-musleabi*)' + done + '' + # HACK: allow bootstrapping with GHC 8.10 which works fine, as we don't have + # binary 9.0 packaged. Bootstrapping with 9.2 is broken without hadrian. + + lib.optionalString (lib.versions.majorMinor version == "9.4") '' + substituteInPlace configure --replace \ + 'MinBootGhcVersion="9.0"' \ + 'MinBootGhcVersion="8.10"' + ''; # Although it is usually correct to pass --host, we don't do that here because # GHC's usage of build, host, and target is non-standard. @@ -527,47 +525,47 @@ stdenv.mkDerivation ( # TODO(@Ericson2314): Always pass "--target" and always prefix. configurePlatforms = [ "build" - ] ++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target"; + ] + ++ lib.optional (buildPlatform != hostPlatform || targetPlatform != hostPlatform) "target"; # `--with` flags for libraries needed for RTS linker - configureFlags = - [ - "--datadir=$doc/share/doc/ghc" - ] - ++ lib.optionals enableTerminfo [ - "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include" - "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib" - ] - ++ lib.optionals (libffi != null) [ - "--with-system-libffi" - "--with-ffi-includes=${targetLibs.libffi.dev}/include" - "--with-ffi-libraries=${targetLibs.libffi.out}/lib" - ] - ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [ - "--with-gmp-includes=${targetLibs.gmp.dev}/include" - "--with-gmp-libraries=${targetLibs.gmp.out}/lib" - ] - ++ - lib.optionals - (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) - [ - "--with-iconv-includes=${libiconv}/include" - "--with-iconv-libraries=${libiconv}/lib" - ] - ++ lib.optionals (targetPlatform != hostPlatform) [ - "--enable-bootstrap-with-devel-snapshot" - ] - ++ lib.optionals useLdGold [ - "CFLAGS=-fuse-ld=gold" - "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" - "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" - ] - ++ lib.optionals (disableLargeAddressSpace) [ - "--disable-large-address-space" - ] - ++ lib.optionals enableUnregisterised [ - "--enable-unregisterised" - ]; + configureFlags = [ + "--datadir=$doc/share/doc/ghc" + ] + ++ lib.optionals enableTerminfo [ + "--with-curses-includes=${lib.getDev targetLibs.ncurses}/include" + "--with-curses-libraries=${lib.getLib targetLibs.ncurses}/lib" + ] + ++ lib.optionals (libffi != null) [ + "--with-system-libffi" + "--with-ffi-includes=${targetLibs.libffi.dev}/include" + "--with-ffi-libraries=${targetLibs.libffi.out}/lib" + ] + ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [ + "--with-gmp-includes=${targetLibs.gmp.dev}/include" + "--with-gmp-libraries=${targetLibs.gmp.out}/lib" + ] + ++ + lib.optionals + (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) + [ + "--with-iconv-includes=${libiconv}/include" + "--with-iconv-libraries=${libiconv}/lib" + ] + ++ lib.optionals (targetPlatform != hostPlatform) [ + "--enable-bootstrap-with-devel-snapshot" + ] + ++ lib.optionals useLdGold [ + "CFLAGS=-fuse-ld=gold" + "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" + "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" + ] + ++ lib.optionals (disableLargeAddressSpace) [ + "--disable-large-address-space" + ] + ++ lib.optionals enableUnregisterised [ + "--enable-unregisterised" + ]; # Make sure we never relax`$PATH` and hooks support for compatibility. strictDeps = true; @@ -575,29 +573,28 @@ stdenv.mkDerivation ( # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. dontAddExtraLibs = true; - nativeBuildInputs = - [ - perl - autoconf - automake - m4 - python3 - bootPkgs.alex - bootPkgs.happy - bootPkgs.hscolour - bootPkgs.ghc-settings-edit - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ] - ++ lib.optionals enableDocs [ - sphinx - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && lib.versions.majorMinor version == "9.0") [ - # TODO(@sternenseemann): backport addition of XATTR env var like - # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6447 - xattr - ]; + nativeBuildInputs = [ + perl + autoconf + automake + m4 + python3 + bootPkgs.alex + bootPkgs.happy + bootPkgs.hscolour + bootPkgs.ghc-settings-edit + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ] + ++ lib.optionals enableDocs [ + sphinx + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && lib.versions.majorMinor version == "9.0") [ + # TODO(@sternenseemann): backport addition of XATTR env var like + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6447 + xattr + ]; # Everything the stage0 compiler needs to build stage1: CC, bintools, extra libs. # See also GHC, {CC,LD,AR}_STAGE0 in preConfigure. @@ -651,45 +648,44 @@ stdenv.mkDerivation ( mkdir -p "$out/lib/${passthru.haskellCompilerName}" ''; - postInstall = - '' - settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings" + postInstall = '' + settingsFile="$out/lib/${targetPrefix}${passthru.haskellCompilerName}/settings" - # Make the installed GHC use the host->target tools. - ghc-settings-edit "$settingsFile" \ - "C compiler command" "${toolPath "cc" installCC}" \ - "Haskell CPP command" "${toolPath "cc" installCC}" \ - "C++ compiler command" "${toolPath "c++" installCC}" \ - "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ - "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ - "ar command" "${toolPath "ar" installCC}" \ - "ranlib command" "${toolPath "ranlib" installCC}" - '' - + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' - ghc-settings-edit "$settingsFile" \ - "otool command" "${toolPath "otool" installCC}" \ - "install_name_tool command" "${toolPath "install_name_tool" installCC}" - '' - + lib.optionalString useLLVM '' - ghc-settings-edit "$settingsFile" \ - "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ - "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" - '' - + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' - ghc-settings-edit "$settingsFile" \ - "LLVM clang command" "${ - # See comment for CLANG in preConfigure - if installCC.isClang then - toolPath "clang" installCC - else - "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" - }" - '' - + '' + # Make the installed GHC use the host->target tools. + ghc-settings-edit "$settingsFile" \ + "C compiler command" "${toolPath "cc" installCC}" \ + "Haskell CPP command" "${toolPath "cc" installCC}" \ + "C++ compiler command" "${toolPath "c++" installCC}" \ + "ld command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ + "Merge objects command" "${toolPath "ld${lib.optionalString useLdGold ".gold"}" installCC}" \ + "ar command" "${toolPath "ar" installCC}" \ + "ranlib command" "${toolPath "ranlib" installCC}" + '' + + lib.optionalString (stdenv.targetPlatform.linker == "cctools") '' + ghc-settings-edit "$settingsFile" \ + "otool command" "${toolPath "otool" installCC}" \ + "install_name_tool command" "${toolPath "install_name_tool" installCC}" + '' + + lib.optionalString useLLVM '' + ghc-settings-edit "$settingsFile" \ + "LLVM llc command" "${lib.getBin llvmPackages.llvm}/bin/llc" \ + "LLVM opt command" "${lib.getBin llvmPackages.llvm}/bin/opt" + '' + + lib.optionalString (useLLVM && stdenv.targetPlatform.isDarwin) '' + ghc-settings-edit "$settingsFile" \ + "LLVM clang command" "${ + # See comment for CLANG in preConfigure + if installCC.isClang then + toolPath "clang" installCC + else + "${llvmPackages.clang}/bin/${llvmPackages.clang.targetPrefix}clang" + }" + '' + + '' - # Install the bash completion file. - install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc - ''; + # Install the bash completion file. + install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc + ''; passthru = { inherit bootPkgs targetPrefix; diff --git a/pkgs/development/compilers/ghcjs/8.10/default.nix b/pkgs/development/compilers/ghcjs/8.10/default.nix index c46a84e87791..a060e8e9d5c6 100644 --- a/pkgs/development/compilers/ghcjs/8.10/default.nix +++ b/pkgs/development/compilers/ghcjs/8.10/default.nix @@ -78,20 +78,19 @@ in stdenv.mkDerivation { name = bootGhcjs.name; src = passthru.configuredSrc; - nativeBuildInputs = - [ - bootGhcjs - passthru.bootPkgs.ghc - cabal-install - nodejs - makeWrapper - xorg.lndir - gmp - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gcc # https://github.com/ghcjs/ghcjs/issues/663 - ]; + nativeBuildInputs = [ + bootGhcjs + passthru.bootPkgs.ghc + cabal-install + nodejs + makeWrapper + xorg.lndir + gmp + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gcc # https://github.com/ghcjs/ghcjs/issues/663 + ]; dontConfigure = true; dontInstall = true; diff --git a/pkgs/development/compilers/gnat-bootstrap/default.nix b/pkgs/development/compilers/gnat-bootstrap/default.nix index 09e0b82dd398..7de8a33bc5cb 100644 --- a/pkgs/development/compilers/gnat-bootstrap/default.nix +++ b/pkgs/development/compilers/gnat-bootstrap/default.nix @@ -33,83 +33,79 @@ stdenv.mkDerivation ( url = "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-${finalAttrs.version}/gnat-${stdenv.hostPlatform.system}-${finalAttrs.version}.tar.gz"; in { - "11" = - { - gccVersion = "11.2.0"; - alireRevision = "4"; - } - // { - x86_64-darwin = { - inherit url; - hash = "sha256-FmBgD20PPQlX/ddhJliCTb/PRmKxe9z7TFPa2/SK4GY="; - upstreamTriplet = "x86_64-apple-darwin19.6.0"; - }; - x86_64-linux = { - inherit url; - hash = "sha256-8fMBJp6igH+Md5jE4LMubDmC4GLt4A+bZG/Xcz2LAJQ="; - upstreamTriplet = "x86_64-pc-linux-gnu"; - }; - } - .${stdenv.hostPlatform.system} or throwUnsupportedSystem; - "12" = - { - gccVersion = "12.1.0"; - alireRevision = "2"; - } - // { - x86_64-darwin = { - inherit url; - hash = "sha256-zrcVFvFZMlGUtkG0p1wST6kGInRI64Icdsvkcf25yVs="; - upstreamTriplet = "x86_64-apple-darwin19.6.0"; - }; - x86_64-linux = { - inherit url; - hash = "sha256-EPDPOOjWJnJsUM7GGxj20/PXumjfLoMIEFX1EDtvWVY="; - upstreamTriplet = "x86_64-pc-linux-gnu"; - }; - } - .${stdenv.hostPlatform.system} or throwUnsupportedSystem; - "13" = - { - gccVersion = "13.2.0"; - alireRevision = "2"; - } - // { - x86_64-darwin = { - inherit url; - hash = "sha256-DNHcHTIi7pw0rsVtpyGTyLVElq3IoO2YX/OkDbdeQyo="; - upstreamTriplet = "x86_64-apple-darwin21.6.0"; - }; - x86_64-linux = { - inherit url; - hash = "sha256-DC95udGSzRDE22ON4UpekxTYWOSBeUdJvILbSFj6MFQ="; - upstreamTriplet = "x86_64-pc-linux-gnu"; - }; - } - .${stdenv.hostPlatform.system} or throwUnsupportedSystem; - "14" = - { - gccVersion = "14.2.0"; - alireRevision = "1"; - } - // { - x86_64-darwin = { - inherit url; - hash = "sha256-3YOnvuI6Qq7huQcqgFSz/o+ZgY2wNkKDqHIuzNz1MVY="; - upstreamTriplet = "x86_64-apple-darwin21.6.0"; - }; - x86_64-linux = { - inherit url; - hash = "sha256-pH3IuOpCM9sY/ppTYcxBmgpsUiMrisIjmAa/rmmZXb4="; - upstreamTriplet = "x86_64-pc-linux-gnu"; - }; - aarch64-linux = { - inherit url; - hash = "sha256-SVW/0yyj6ZH1GAjvD+unII+zSLGd3KGFt1bjjQ3SEFU="; - upstreamTriplet = "aarch64-linux-gnu"; - }; - } - .${stdenv.hostPlatform.system} or throwUnsupportedSystem; + "11" = { + gccVersion = "11.2.0"; + alireRevision = "4"; + } + // { + x86_64-darwin = { + inherit url; + hash = "sha256-FmBgD20PPQlX/ddhJliCTb/PRmKxe9z7TFPa2/SK4GY="; + upstreamTriplet = "x86_64-apple-darwin19.6.0"; + }; + x86_64-linux = { + inherit url; + hash = "sha256-8fMBJp6igH+Md5jE4LMubDmC4GLt4A+bZG/Xcz2LAJQ="; + upstreamTriplet = "x86_64-pc-linux-gnu"; + }; + } + .${stdenv.hostPlatform.system} or throwUnsupportedSystem; + "12" = { + gccVersion = "12.1.0"; + alireRevision = "2"; + } + // { + x86_64-darwin = { + inherit url; + hash = "sha256-zrcVFvFZMlGUtkG0p1wST6kGInRI64Icdsvkcf25yVs="; + upstreamTriplet = "x86_64-apple-darwin19.6.0"; + }; + x86_64-linux = { + inherit url; + hash = "sha256-EPDPOOjWJnJsUM7GGxj20/PXumjfLoMIEFX1EDtvWVY="; + upstreamTriplet = "x86_64-pc-linux-gnu"; + }; + } + .${stdenv.hostPlatform.system} or throwUnsupportedSystem; + "13" = { + gccVersion = "13.2.0"; + alireRevision = "2"; + } + // { + x86_64-darwin = { + inherit url; + hash = "sha256-DNHcHTIi7pw0rsVtpyGTyLVElq3IoO2YX/OkDbdeQyo="; + upstreamTriplet = "x86_64-apple-darwin21.6.0"; + }; + x86_64-linux = { + inherit url; + hash = "sha256-DC95udGSzRDE22ON4UpekxTYWOSBeUdJvILbSFj6MFQ="; + upstreamTriplet = "x86_64-pc-linux-gnu"; + }; + } + .${stdenv.hostPlatform.system} or throwUnsupportedSystem; + "14" = { + gccVersion = "14.2.0"; + alireRevision = "1"; + } + // { + x86_64-darwin = { + inherit url; + hash = "sha256-3YOnvuI6Qq7huQcqgFSz/o+ZgY2wNkKDqHIuzNz1MVY="; + upstreamTriplet = "x86_64-apple-darwin21.6.0"; + }; + x86_64-linux = { + inherit url; + hash = "sha256-pH3IuOpCM9sY/ppTYcxBmgpsUiMrisIjmAa/rmmZXb4="; + upstreamTriplet = "x86_64-pc-linux-gnu"; + }; + aarch64-linux = { + inherit url; + hash = "sha256-SVW/0yyj6ZH1GAjvD+unII+zSLGd3KGFt1bjjQ3SEFU="; + upstreamTriplet = "aarch64-linux-gnu"; + }; + } + .${stdenv.hostPlatform.system} or throwUnsupportedSystem; }; inherit (versionMap.${majorVersion}) gccVersion alireRevision upstreamTriplet; in @@ -123,48 +119,46 @@ stdenv.mkDerivation ( inherit (versionMap.${majorVersion}) url hash; }; - nativeBuildInputs = - [ - dejagnu - gmp - guile - libipt - mpfr - python3 - readline - sourceHighlight - zlib - ] - ++ lib.optionals stdenv.buildPlatform.isLinux [ - autoPatchelfHook - glibc - ] - ++ lib.optionals (lib.meta.availableOn stdenv.buildPlatform elfutils) [ - elfutils - ]; + nativeBuildInputs = [ + dejagnu + gmp + guile + libipt + mpfr + python3 + readline + sourceHighlight + zlib + ] + ++ lib.optionals stdenv.buildPlatform.isLinux [ + autoPatchelfHook + glibc + ] + ++ lib.optionals (lib.meta.availableOn stdenv.buildPlatform elfutils) [ + elfutils + ]; - buildInputs = - [ - expat - ] - ++ lib.optionals (lib.versionAtLeast majorVersion "13") [ - ncurses - ] - ++ lib.optionals (lib.versionOlder majorVersion "13") [ - ncurses5 - ] - ++ [ - xz - ] - ++ - lib.optionals - ( - lib.versionAtLeast majorVersion "14" && stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux - ) - [ - # not sure why the bootstrap binaries link to zstd only on this architecture but they do - zstd - ]; + buildInputs = [ + expat + ] + ++ lib.optionals (lib.versionAtLeast majorVersion "13") [ + ncurses + ] + ++ lib.optionals (lib.versionOlder majorVersion "13") [ + ncurses5 + ] + ++ [ + xz + ] + ++ + lib.optionals + ( + lib.versionAtLeast majorVersion "14" && stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux + ) + [ + # not sure why the bootstrap binaries link to zstd only on this architecture but they do + zstd + ]; strictDeps = true; @@ -191,51 +185,50 @@ stdenv.mkDerivation ( rm -f bin/ld ${upstreamTriplet}/bin/ld ''; - installPhase = - '' - mkdir -p $out - cp -ar * $out/ - '' + installPhase = '' + mkdir -p $out + cp -ar * $out/ + '' - # So far with the Darwin gnat-bootstrap binary packages, there have been two - # types of dylib path references to other dylibs that need fixups: - # - # 1. Dylibs in $out/lib with paths starting with - # /Users/runner/.../gcc/install that refer to other dylibs in $out/lib - # 2. Dylibs in $out/lib/gcc/*/*/adalib with paths starting with - # @rpath that refer to other dylibs in $out/lib/gcc/*/*/adalib - # - # Additionally, per Section 14.4 Fixed Headers in the GCC 12.2.0 manual [2], - # we have to update the fixed header files in current Alire GCC package, since it - # was built against macOS 10.15 (Darwin 19.6.0), but Nix currently - # builds against macOS 10.12, and the two header file structures differ. - # For example, the current Alire GCC package has a fixed - # from macOS 10.15 that contains a #include <_stdio.h>, but neither the Alire - # GCC package nor macOS 10.12 have such a header ( and - # in 10.12 are not equivalent; indeed, 10.15 <_stdio.h> - # says it contains code shared by and ). - # - # [2]: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Fixed-Headers.html + # So far with the Darwin gnat-bootstrap binary packages, there have been two + # types of dylib path references to other dylibs that need fixups: + # + # 1. Dylibs in $out/lib with paths starting with + # /Users/runner/.../gcc/install that refer to other dylibs in $out/lib + # 2. Dylibs in $out/lib/gcc/*/*/adalib with paths starting with + # @rpath that refer to other dylibs in $out/lib/gcc/*/*/adalib + # + # Additionally, per Section 14.4 Fixed Headers in the GCC 12.2.0 manual [2], + # we have to update the fixed header files in current Alire GCC package, since it + # was built against macOS 10.15 (Darwin 19.6.0), but Nix currently + # builds against macOS 10.12, and the two header file structures differ. + # For example, the current Alire GCC package has a fixed + # from macOS 10.15 that contains a #include <_stdio.h>, but neither the Alire + # GCC package nor macOS 10.12 have such a header ( and + # in 10.12 are not equivalent; indeed, 10.15 <_stdio.h> + # says it contains code shared by and ). + # + # [2]: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Fixed-Headers.html - + lib.optionalString (stdenv.hostPlatform.isDarwin) '' - upstreamBuildPrefix="/Users/runner/work/GNAT-FSF-builds/GNAT-FSF-builds/sbx/x86_64-darwin/gcc/install" - for i in "$out"/lib/*.dylib "$out"/lib/gcc/*/*/adalib/*.dylib; do - if [[ -f "$i" && ! -h "$i" ]]; then - install_name_tool -id "$i" "$i" || true - for old_path in $(otool -L "$i" | grep "$upstreamBuildPrefix" | awk '{print $1}'); do - new_path=`echo "$old_path" | sed "s,$upstreamBuildPrefix,$out,"` - install_name_tool -change "$old_path" "$new_path" "$i" || true - done - for old_path in $(otool -L "$i" | grep "@rpath" | awk '{print $1}'); do - new_path=$(echo "$old_path" | sed "s,@rpath,$(dirname "$i"),") - install_name_tool -change "$old_path" "$new_path" "$i" || true - done - fi - done + + lib.optionalString (stdenv.hostPlatform.isDarwin) '' + upstreamBuildPrefix="/Users/runner/work/GNAT-FSF-builds/GNAT-FSF-builds/sbx/x86_64-darwin/gcc/install" + for i in "$out"/lib/*.dylib "$out"/lib/gcc/*/*/adalib/*.dylib; do + if [[ -f "$i" && ! -h "$i" ]]; then + install_name_tool -id "$i" "$i" || true + for old_path in $(otool -L "$i" | grep "$upstreamBuildPrefix" | awk '{print $1}'); do + new_path=`echo "$old_path" | sed "s,$upstreamBuildPrefix,$out,"` + install_name_tool -change "$old_path" "$new_path" "$i" || true + done + for old_path in $(otool -L "$i" | grep "@rpath" | awk '{print $1}'); do + new_path=$(echo "$old_path" | sed "s,@rpath,$(dirname "$i"),") + install_name_tool -change "$old_path" "$new_path" "$i" || true + done + fi + done - "$out"/libexec/gcc/${upstreamTriplet}/${gccVersion}/install-tools/mkheaders -v -v \ - "$out" "${stdenv.cc.libc}" - ''; + "$out"/libexec/gcc/${upstreamTriplet}/${gccVersion}/install-tools/mkheaders -v -v \ + "$out" "${stdenv.cc.libc}" + ''; passthru = { langC = true; # TRICK for gcc-wrapper to wrap it @@ -253,7 +246,8 @@ stdenv.mkDerivation ( platforms = [ "x86_64-linux" "x86_64-darwin" - ] ++ lib.optionals (lib.versionAtLeast majorVersion "14") [ "aarch64-linux" ]; + ] + ++ lib.optionals (lib.versionAtLeast majorVersion "14") [ "aarch64-linux" ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; }; } diff --git a/pkgs/development/compilers/go/1.23.nix b/pkgs/development/compilers/go/1.23.nix index 4a8bb063a979..904b2c29a54c 100644 --- a/pkgs/development/compilers/go/1.23.nix +++ b/pkgs/development/compilers/go/1.23.nix @@ -103,35 +103,34 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; - preInstall = - '' - # Contains the wrong perl shebang when cross compiling, - # since it is not used for anything we can deleted as well. - rm src/regexp/syntax/make_perl_groups.pl - '' - + ( - if (stdenv.buildPlatform.system != stdenv.hostPlatform.system) then - '' - mv bin/*_*/* bin - rmdir bin/*_* - ${lib.optionalString - (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) - '' - rm -rf pkg/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} pkg/tool/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} - '' - } - '' - else - lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system) '' - rm -rf bin/*_* - ${lib.optionalString - (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) - '' - rm -rf pkg/${finalAttrs.GOOS}_${finalAttrs.GOARCH} pkg/tool/${finalAttrs.GOOS}_${finalAttrs.GOARCH} - '' - } - '' - ); + preInstall = '' + # Contains the wrong perl shebang when cross compiling, + # since it is not used for anything we can deleted as well. + rm src/regexp/syntax/make_perl_groups.pl + '' + + ( + if (stdenv.buildPlatform.system != stdenv.hostPlatform.system) then + '' + mv bin/*_*/* bin + rmdir bin/*_* + ${lib.optionalString + (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) + '' + rm -rf pkg/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} pkg/tool/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} + '' + } + '' + else + lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system) '' + rm -rf bin/*_* + ${lib.optionalString + (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) + '' + rm -rf pkg/${finalAttrs.GOOS}_${finalAttrs.GOARCH} pkg/tool/${finalAttrs.GOOS}_${finalAttrs.GOARCH} + '' + } + '' + ); installPhase = '' runHook preInstall diff --git a/pkgs/development/compilers/go/1.24.nix b/pkgs/development/compilers/go/1.24.nix index 14787746ac19..b89d2459eac3 100644 --- a/pkgs/development/compilers/go/1.24.nix +++ b/pkgs/development/compilers/go/1.24.nix @@ -103,35 +103,34 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; - preInstall = - '' - # Contains the wrong perl shebang when cross compiling, - # since it is not used for anything we can deleted as well. - rm src/regexp/syntax/make_perl_groups.pl - '' - + ( - if (stdenv.buildPlatform.system != stdenv.hostPlatform.system) then - '' - mv bin/*_*/* bin - rmdir bin/*_* - ${lib.optionalString - (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) - '' - rm -rf pkg/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} pkg/tool/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} - '' - } - '' - else - lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system) '' - rm -rf bin/*_* - ${lib.optionalString - (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) - '' - rm -rf pkg/${finalAttrs.GOOS}_${finalAttrs.GOARCH} pkg/tool/${finalAttrs.GOOS}_${finalAttrs.GOARCH} - '' - } - '' - ); + preInstall = '' + # Contains the wrong perl shebang when cross compiling, + # since it is not used for anything we can deleted as well. + rm src/regexp/syntax/make_perl_groups.pl + '' + + ( + if (stdenv.buildPlatform.system != stdenv.hostPlatform.system) then + '' + mv bin/*_*/* bin + rmdir bin/*_* + ${lib.optionalString + (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) + '' + rm -rf pkg/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} pkg/tool/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} + '' + } + '' + else + lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system) '' + rm -rf bin/*_* + ${lib.optionalString + (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) + '' + rm -rf pkg/${finalAttrs.GOOS}_${finalAttrs.GOARCH} pkg/tool/${finalAttrs.GOOS}_${finalAttrs.GOARCH} + '' + } + '' + ); installPhase = '' runHook preInstall diff --git a/pkgs/development/compilers/go/1.25.nix b/pkgs/development/compilers/go/1.25.nix index 99b684cca449..bd118bf135f1 100644 --- a/pkgs/development/compilers/go/1.25.nix +++ b/pkgs/development/compilers/go/1.25.nix @@ -108,35 +108,34 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; - preInstall = - '' - # Contains the wrong perl shebang when cross compiling, - # since it is not used for anything we can deleted as well. - rm src/regexp/syntax/make_perl_groups.pl - '' - + ( - if (stdenv.buildPlatform.system != stdenv.hostPlatform.system) then - '' - mv bin/*_*/* bin - rmdir bin/*_* - ${lib.optionalString - (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) - '' - rm -rf pkg/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} pkg/tool/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} - '' - } - '' - else - lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system) '' - rm -rf bin/*_* - ${lib.optionalString - (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) - '' - rm -rf pkg/${finalAttrs.GOOS}_${finalAttrs.GOARCH} pkg/tool/${finalAttrs.GOOS}_${finalAttrs.GOARCH} - '' - } - '' - ); + preInstall = '' + # Contains the wrong perl shebang when cross compiling, + # since it is not used for anything we can deleted as well. + rm src/regexp/syntax/make_perl_groups.pl + '' + + ( + if (stdenv.buildPlatform.system != stdenv.hostPlatform.system) then + '' + mv bin/*_*/* bin + rmdir bin/*_* + ${lib.optionalString + (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) + '' + rm -rf pkg/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} pkg/tool/${finalAttrs.GOHOSTOS}_${finalAttrs.GOHOSTARCH} + '' + } + '' + else + lib.optionalString (stdenv.hostPlatform.system != stdenv.targetPlatform.system) '' + rm -rf bin/*_* + ${lib.optionalString + (!(finalAttrs.GOHOSTARCH == finalAttrs.GOARCH && finalAttrs.GOOS == finalAttrs.GOHOSTOS)) + '' + rm -rf pkg/${finalAttrs.GOOS}_${finalAttrs.GOARCH} pkg/tool/${finalAttrs.GOOS}_${finalAttrs.GOARCH} + '' + } + '' + ); installPhase = '' runHook preInstall diff --git a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix index 004dfc4ef37a..c3a5f7aded18 100644 --- a/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix +++ b/pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix @@ -116,7 +116,8 @@ let nativeBuildInputs = [ unzip makeWrapper - ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; propagatedBuildInputs = [ setJavaClassPath @@ -137,30 +138,29 @@ let postInstall = let cLibsAsFlags = (map (l: "--add-flags '-H:CLibraryPath=${l}/lib'") cLibs); - preservedNixVariables = - [ - "-ENIX_BINTOOLS" - "-ENIX_BINTOOLS_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}" - "-ENIX_BUILD_CORES" - "-ENIX_BUILD_TOP" - "-ENIX_CC" - "-ENIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}" - "-ENIX_CFLAGS_COMPILE" - "-ENIX_HARDENING_ENABLE" - "-ENIX_LDFLAGS" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-ELOCALE_ARCHIVE" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-EDEVELOPER_DIR" - "-EDEVELOPER_DIR_FOR_BUILD" - "-EDEVELOPER_DIR_FOR_TARGET" - "-EMACOSX_DEPLOYMENT_TARGET" - "-EMACOSX_DEPLOYMENT_TARGET_FOR_BUILD" - "-EMACOSX_DEPLOYMENT_TARGET_FOR_TARGET" - "-ENIX_APPLE_SDK_VERSION" - ]; + preservedNixVariables = [ + "-ENIX_BINTOOLS" + "-ENIX_BINTOOLS_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}" + "-ENIX_BUILD_CORES" + "-ENIX_BUILD_TOP" + "-ENIX_CC" + "-ENIX_CC_WRAPPER_TARGET_HOST_${stdenv.cc.suffixSalt}" + "-ENIX_CFLAGS_COMPILE" + "-ENIX_HARDENING_ENABLE" + "-ENIX_LDFLAGS" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-ELOCALE_ARCHIVE" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-EDEVELOPER_DIR" + "-EDEVELOPER_DIR_FOR_BUILD" + "-EDEVELOPER_DIR_FOR_TARGET" + "-EMACOSX_DEPLOYMENT_TARGET" + "-EMACOSX_DEPLOYMENT_TARGET_FOR_BUILD" + "-EMACOSX_DEPLOYMENT_TARGET_FOR_TARGET" + "-ENIX_APPLE_SDK_VERSION" + ]; preservedNixVariablesAsFlags = (map (f: "--add-flags '${f}'") preservedNixVariables); in '' @@ -247,7 +247,8 @@ let ./update.sh "graalvm-ce" ]; - } // (args.passhtru or { }); + } + // (args.passhtru or { }); meta = with lib; diff --git a/pkgs/development/compilers/graalvm/community-edition/buildGraalvmProduct.nix b/pkgs/development/compilers/graalvm/community-edition/buildGraalvmProduct.nix index 7934baca3a6a..5276c5719dbd 100644 --- a/pkgs/development/compilers/graalvm/community-edition/buildGraalvmProduct.nix +++ b/pkgs/development/compilers/graalvm/community-edition/buildGraalvmProduct.nix @@ -33,16 +33,18 @@ stdenv.mkDerivation ( { pname = product; - nativeBuildInputs = - [ makeWrapper ] - ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook - ++ extraNativeBuildInputs; + nativeBuildInputs = [ + makeWrapper + ] + ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook + ++ extraNativeBuildInputs; buildInputs = [ (lib.getLib stdenv.cc.cc) # libstdc++.so.6 zlib libxcrypt-legacy # libcrypt.so.1 (default is .2 now) - ] ++ extraBuildInputs; + ] + ++ extraBuildInputs; unpackPhase = '' runHook preUnpack @@ -70,7 +72,8 @@ stdenv.mkDerivation ( ./update.sh product ]; - } // (args.passhtru or { }); + } + // (args.passhtru or { }); meta = ( { diff --git a/pkgs/development/compilers/halide/default.nix b/pkgs/development/compilers/halide/default.nix index 821459bacdae..3e1fd28964a7 100644 --- a/pkgs/development/compilers/halide/default.nix +++ b/pkgs/development/compilers/halide/default.nix @@ -52,22 +52,21 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - postPatch = - '' - substituteInPlace src/runtime/CMakeLists.txt --replace-fail \ - '-isystem "''${VulkanHeaders_INCLUDE_DIR}"' \ - '-isystem "''${VulkanHeaders_INCLUDE_DIR}" - -isystem "${llvmPackages.clang}/resource-root/include"' - '' - # Upstream Halide include a check in their CMake files that forces Halide to - # link LLVM dynamically because of WebAssembly. It unnecessarily increases - # the closure size in cases when the WebAssembly target is not used. Hence, - # the following hack - + lib.optionalString (!wasmSupport) '' - substituteInPlace cmake/FindHalide_LLVM.cmake --replace-fail \ - 'if (comp STREQUAL "WebAssembly")' \ - 'if (FALSE)' - ''; + postPatch = '' + substituteInPlace src/runtime/CMakeLists.txt --replace-fail \ + '-isystem "''${VulkanHeaders_INCLUDE_DIR}"' \ + '-isystem "''${VulkanHeaders_INCLUDE_DIR}" + -isystem "${llvmPackages.clang}/resource-root/include"' + '' + # Upstream Halide include a check in their CMake files that forces Halide to + # link LLVM dynamically because of WebAssembly. It unnecessarily increases + # the closure size in cases when the WebAssembly target is not used. Hence, + # the following hack + + lib.optionalString (!wasmSupport) '' + substituteInPlace cmake/FindHalide_LLVM.cmake --replace-fail \ + 'if (comp STREQUAL "WebAssembly")' \ + 'if (FALSE)' + ''; cmakeFlags = [ "-DWITH_PYTHON_BINDINGS=${if pythonSupport then "ON" else "OFF"}" @@ -123,35 +122,33 @@ stdenv.mkDerivation (finalAttrs: { # Note: only openblas and not atlas part of this Nix expression # see pkgs/development/libraries/science/math/liblapack/3.5.0.nix # to get a hint howto setup atlas instead of openblas - buildInputs = - [ - llvmPackages.llvm - llvmPackages.lld - llvmPackages.openmp - llvmPackages.libclang - libffi - libpng - libjpeg - eigen - openblas - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libgbm - libGL - ] - ++ lib.optionals wasmSupport [ wabt ]; + buildInputs = [ + llvmPackages.llvm + llvmPackages.lld + llvmPackages.openmp + llvmPackages.libclang + libffi + libpng + libjpeg + eigen + openblas + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libgbm + libGL + ] + ++ lib.optionals wasmSupport [ wabt ]; - nativeBuildInputs = - [ - cmake - flatbuffers - removeReferencesTo - ninja - ] - ++ lib.optionals pythonSupport [ - python3Packages.python - python3Packages.pybind11 - ]; + nativeBuildInputs = [ + cmake + flatbuffers + removeReferencesTo + ninja + ] + ++ lib.optionals pythonSupport [ + python3Packages.python + python3Packages.pybind11 + ]; propagatedBuildInputs = lib.optionals pythonSupport [ python3Packages.numpy diff --git a/pkgs/development/compilers/haxe/default.nix b/pkgs/development/compilers/haxe/default.nix index 0207f345bf26..24e633373f57 100644 --- a/pkgs/development/compilers/haxe/default.nix +++ b/pkgs/development/compilers/haxe/default.nix @@ -58,14 +58,13 @@ let pname = "haxe"; inherit version; - buildInputs = - [ - zlib - neko - ] - ++ (if lib.versionAtLeast version "4.3" then [ pcre2 ] else [ pcre ]) - ++ lib.optional (lib.versionAtLeast version "4.1") mbedtls_2 - ++ ocamlDependencies version; + buildInputs = [ + zlib + neko + ] + ++ (if lib.versionAtLeast version "4.3" then [ pcre2 ] else [ pcre ]) + ++ lib.optional (lib.versionAtLeast version "4.1") mbedtls_2 + ++ ocamlDependencies version; src = fetchFromGitHub { owner = "HaxeFoundation"; diff --git a/pkgs/development/compilers/idris2/build-idris.nix b/pkgs/development/compilers/idris2/build-idris.nix index 6f829451d2b2..40a7d275b7df 100644 --- a/pkgs/development/compilers/idris2/build-idris.nix +++ b/pkgs/development/compilers/idris2/build-idris.nix @@ -70,7 +70,8 @@ let nativeBuildInputs = [ idris2 makeBinaryWrapper - ] ++ attrs.nativeBuildInputs or [ ]; + ] + ++ attrs.nativeBuildInputs or [ ]; buildInputs = propagatedIdrisLibraries ++ attrs.buildInputs or [ ]; env.IDRIS2_PACKAGE_PATH = libDirs propagatedIdrisLibraries; @@ -83,7 +84,8 @@ let passthru = { inherit propagatedIdrisLibraries; - } // (attrs.passthru or { }); + } + // (attrs.passthru or { }); shellHook = '' export IDRIS2_PACKAGE_PATH="${finalAttrs.env.IDRIS2_PACKAGE_PATH}" diff --git a/pkgs/development/compilers/idris2/idris2.nix b/pkgs/development/compilers/idris2/idris2.nix index 6f39eea61868..b34cda66e497 100644 --- a/pkgs/development/compilers/idris2/idris2.nix +++ b/pkgs/development/compilers/idris2/idris2.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation rec { makeWrapper clang platformChez - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ zsh ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ zsh ]; buildInputs = [ platformChez gmp diff --git a/pkgs/development/compilers/idris2/pack.nix b/pkgs/development/compilers/idris2/pack.nix index f041e3bce857..414d959f0135 100644 --- a/pkgs/development/compilers/idris2/pack.nix +++ b/pkgs/development/compilers/idris2/pack.nix @@ -54,7 +54,8 @@ let gmp clang chez - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ zsh ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ zsh ]; postInstall = '' wrapProgram $out/bin/pack \ diff --git a/pkgs/development/compilers/jetbrains-jdk/17.nix b/pkgs/development/compilers/jetbrains-jdk/17.nix index 27ffec21f81f..0a5fd0d215dd 100644 --- a/pkgs/development/compilers/jetbrains-jdk/17.nix +++ b/pkgs/development/compilers/jetbrains-jdk/17.nix @@ -156,7 +156,8 @@ openjdk17.overrideAttrs (oldAttrs: rec { autoconf unzip rsync - ] ++ oldAttrs.nativeBuildInputs; + ] + ++ oldAttrs.nativeBuildInputs; meta = with lib; { description = "OpenJDK fork which better supports Jetbrains's products"; diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix index 6fe8da738991..8b56d4d11f88 100644 --- a/pkgs/development/compilers/jetbrains-jdk/default.nix +++ b/pkgs/development/compilers/jetbrains-jdk/default.nix @@ -156,7 +156,8 @@ jdk.overrideAttrs (oldAttrs: rec { autoconf unzip rsync - ] ++ oldAttrs.nativeBuildInputs; + ] + ++ oldAttrs.nativeBuildInputs; meta = with lib; { description = "OpenJDK fork to better support Jetbrains's products"; diff --git a/pkgs/development/compilers/jetbrains-jdk/jcef.nix b/pkgs/development/compilers/jetbrains-jdk/jcef.nix index 34571287f6be..ed517361a166 100644 --- a/pkgs/development/compilers/jetbrains-jdk/jcef.nix +++ b/pkgs/development/compilers/jetbrains-jdk/jcef.nix @@ -207,82 +207,81 @@ stdenv.mkDerivation rec { # N.B. For new versions, manually synchronize the following # definitions with jb/tools/common/create_modules.sh to include # newly added modules - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - export JCEF_ROOT_DIR=$(realpath ..) - export OUT_NATIVE_DIR=$JCEF_ROOT_DIR/jcef_build/native/${buildType} - export JB_TOOLS_DIR=$(realpath ../jb/tools) - export JB_TOOLS_OS_DIR=$JB_TOOLS_DIR/linux - export OUT_CLS_DIR=$(realpath ../out/${platform}) - export TARGET_ARCH=${targetArch} DEPS_ARCH=${depsArch} - export OS=linux - export JOGAMP_DIR="$JCEF_ROOT_DIR"/third_party/jogamp/jar + export JCEF_ROOT_DIR=$(realpath ..) + export OUT_NATIVE_DIR=$JCEF_ROOT_DIR/jcef_build/native/${buildType} + export JB_TOOLS_DIR=$(realpath ../jb/tools) + export JB_TOOLS_OS_DIR=$JB_TOOLS_DIR/linux + export OUT_CLS_DIR=$(realpath ../out/${platform}) + export TARGET_ARCH=${targetArch} DEPS_ARCH=${depsArch} + export OS=linux + export JOGAMP_DIR="$JCEF_ROOT_DIR"/third_party/jogamp/jar - mkdir -p $unpacked/{jogl,gluegen,jcef} + mkdir -p $unpacked/{jogl,gluegen,jcef} - function extract_jar { - __jar=$1 - __dst_dir=$2 - __content_dir="''${3:-.}" - __tmp=.tmp_extract_jar - rm -rf "$__tmp" && mkdir "$__tmp" - ( - cd "$__tmp" || exit 1 - jar -xf "$__jar" - ) - rm -rf "$__tmp/META-INF" - rm -rf "$__dst_dir" && mkdir "$__dst_dir" - if [ -z "$__content_dir" ] - then - cp -R "$__tmp"/* "$__dst_dir" - else - cp -R "$__tmp"/"$__content_dir"/* "$__dst_dir" - fi - rm -rf $__tmp - } + function extract_jar { + __jar=$1 + __dst_dir=$2 + __content_dir="''${3:-.}" + __tmp=.tmp_extract_jar + rm -rf "$__tmp" && mkdir "$__tmp" + ( + cd "$__tmp" || exit 1 + jar -xf "$__jar" + ) + rm -rf "$__tmp/META-INF" + rm -rf "$__dst_dir" && mkdir "$__dst_dir" + if [ -z "$__content_dir" ] + then + cp -R "$__tmp"/* "$__dst_dir" + else + cp -R "$__tmp"/"$__content_dir"/* "$__dst_dir" + fi + rm -rf $__tmp + } - cd $unpacked/gluegen - cp "$JOGAMP_DIR"/gluegen-rt.jar . - cp "$JB_TOOLS_DIR"/common/gluegen-module-info.java module-info.java - javac --patch-module gluegen.rt=gluegen-rt.jar module-info.java - jar uf gluegen-rt.jar module-info.class - rm module-info.class module-info.java - mkdir lib - '' - # see https://github.com/JetBrains/jcef/commit/f3b787e3326c1915d663abded7f055c0866f32ec - + lib.optionalString (platform != "linuxarm64") '' - extract_jar "$JOGAMP_DIR"/gluegen-rt-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" - '' - + '' + cd $unpacked/gluegen + cp "$JOGAMP_DIR"/gluegen-rt.jar . + cp "$JB_TOOLS_DIR"/common/gluegen-module-info.java module-info.java + javac --patch-module gluegen.rt=gluegen-rt.jar module-info.java + jar uf gluegen-rt.jar module-info.class + rm module-info.class module-info.java + mkdir lib + '' + # see https://github.com/JetBrains/jcef/commit/f3b787e3326c1915d663abded7f055c0866f32ec + + lib.optionalString (platform != "linuxarm64") '' + extract_jar "$JOGAMP_DIR"/gluegen-rt-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" + '' + + '' - cd ../jogl - cp "$JOGAMP_DIR"/gluegen-rt.jar . - cp "$JOGAMP_DIR"/jogl-all.jar . - cp "$JB_TOOLS_OS_DIR"/jogl-module-info.java module-info.java - javac --module-path . --patch-module jogl.all=jogl-all.jar module-info.java - jar uf jogl-all.jar module-info.class - rm module-info.class module-info.java - mkdir lib - '' - # see https://github.com/JetBrains/jcef/commit/f3b787e3326c1915d663abded7f055c0866f32ec - + lib.optionalString (platform != "linuxarm64") '' - extract_jar "$JOGAMP_DIR"/jogl-all-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" - '' - + '' + cd ../jogl + cp "$JOGAMP_DIR"/gluegen-rt.jar . + cp "$JOGAMP_DIR"/jogl-all.jar . + cp "$JB_TOOLS_OS_DIR"/jogl-module-info.java module-info.java + javac --module-path . --patch-module jogl.all=jogl-all.jar module-info.java + jar uf jogl-all.jar module-info.class + rm module-info.class module-info.java + mkdir lib + '' + # see https://github.com/JetBrains/jcef/commit/f3b787e3326c1915d663abded7f055c0866f32ec + + lib.optionalString (platform != "linuxarm64") '' + extract_jar "$JOGAMP_DIR"/jogl-all-natives-"$OS"-"$DEPS_ARCH".jar lib natives/"$OS"-"$DEPS_ARCH" + '' + + '' - cd ../jcef - cp "$OUT_CLS_DIR"/jcef.jar . - mkdir lib - cp -R "$OUT_NATIVE_DIR"/* lib + cd ../jcef + cp "$OUT_CLS_DIR"/jcef.jar . + mkdir lib + cp -R "$OUT_NATIVE_DIR"/* lib - mkdir -p $out/jmods + mkdir -p $out/jmods - bash "$JB_TOOLS_DIR"/common/create_version_file.sh $out + bash "$JB_TOOLS_DIR"/common/create_version_file.sh $out - runHook postInstall - ''; + runHook postInstall + ''; dontStrip = debugBuild; diff --git a/pkgs/development/compilers/julia/generic-bin.nix b/pkgs/development/compilers/julia/generic-bin.nix index a7c9d323b7a8..b6622dfc4b3d 100644 --- a/pkgs/development/compilers/julia/generic-bin.nix +++ b/pkgs/development/compilers/julia/generic-bin.nix @@ -12,43 +12,42 @@ }: let - skip_tests = - [ - # Test flaky on ofborg - "channels" - # Test flaky because of our RPATH patching - # https://github.com/NixOS/nixpkgs/pull/230965#issuecomment-1545336489 - "compiler/codegen" - # Test flaky - "read" - ] - ++ lib.optionals (lib.versionAtLeast version "1.10") [ - # Test flaky - # https://github.com/JuliaLang/julia/issues/52739 - "REPL" - # Test flaky - "ccall" - ] - ++ lib.optionals (lib.versionAtLeast version "1.11") [ - # Test flaky - # https://github.com/JuliaLang/julia/issues/54280 - "loading" - "cmdlineargs" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Test flaky on ofborg - "FileWatching" - # Test requires pbcopy - "InteractiveUtils" - # Test requires network access - "Sockets" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # Test Failed at $out/share/julia/stdlib/v1.8/LinearAlgebra/test/blas.jl:702 - "LinearAlgebra/blas" - # Test Failed at $out/share/julia/test/misc.jl:724 - "misc" - ]; + skip_tests = [ + # Test flaky on ofborg + "channels" + # Test flaky because of our RPATH patching + # https://github.com/NixOS/nixpkgs/pull/230965#issuecomment-1545336489 + "compiler/codegen" + # Test flaky + "read" + ] + ++ lib.optionals (lib.versionAtLeast version "1.10") [ + # Test flaky + # https://github.com/JuliaLang/julia/issues/52739 + "REPL" + # Test flaky + "ccall" + ] + ++ lib.optionals (lib.versionAtLeast version "1.11") [ + # Test flaky + # https://github.com/JuliaLang/julia/issues/54280 + "loading" + "cmdlineargs" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Test flaky on ofborg + "FileWatching" + # Test requires pbcopy + "InteractiveUtils" + # Test requires network access + "Sockets" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # Test Failed at $out/share/julia/stdlib/v1.8/LinearAlgebra/test/blas.jl:702 + "LinearAlgebra/blas" + # Test Failed at $out/share/julia/test/misc.jl:724 + "misc" + ]; in stdenv.mkDerivation { pname = "julia-bin"; @@ -91,19 +90,18 @@ stdenv.mkDerivation { stdenv.cc.cc ]; - installPhase = - '' - runHook preInstall - cp -r . $out - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # "$out/share" is intentionally omitted since it contains - # julia package images and patchelf would break them - autoPatchelf "$out/bin" "$out/lib" "$out/libexec" - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + cp -r . $out + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # "$out/share" is intentionally omitted since it contains + # julia package images and patchelf would break them + autoPatchelf "$out/bin" "$out/lib" "$out/libexec" + '' + + '' + runHook postInstall + ''; # Breaks backtraces, etc. dontStrip = true; diff --git a/pkgs/development/compilers/julia/generic.nix b/pkgs/development/compilers/julia/generic.nix index 7b2bad8156c4..469e0206514d 100644 --- a/pkgs/development/compilers/julia/generic.nix +++ b/pkgs/development/compilers/julia/generic.nix @@ -43,39 +43,36 @@ stdenv.mkDerivation rec { openssl ]; - buildInputs = - [ - libxml2 - zlib - ] - ++ lib.optionals (lib.versionAtLeast version "1.11") [ - cacert - ]; + buildInputs = [ + libxml2 + zlib + ] + ++ lib.optionals (lib.versionAtLeast version "1.11") [ + cacert + ]; dontUseCmakeConfigure = true; - postPatch = - '' - patchShebangs . - '' - + lib.optionalString (lib.versionAtLeast version "1.11") '' - substituteInPlace deps/curl.mk \ - --replace-fail 'cd $(dir $<) && $(TAR) jxf $(notdir $<)' \ - 'cd $(dir $<) && $(TAR) jxf $(notdir $<) && sed -i "s|/usr/bin/env perl|${lib.getExe buildPackages.perl}|" curl-$(CURL_VER)/scripts/cd2nroff' - ''; + postPatch = '' + patchShebangs . + '' + + lib.optionalString (lib.versionAtLeast version "1.11") '' + substituteInPlace deps/curl.mk \ + --replace-fail 'cd $(dir $<) && $(TAR) jxf $(notdir $<)' \ + 'cd $(dir $<) && $(TAR) jxf $(notdir $<) && sed -i "s|/usr/bin/env perl|${lib.getExe buildPackages.perl}|" curl-$(CURL_VER)/scripts/cd2nroff' + ''; - makeFlags = - [ - "prefix=$(out)" - "USE_BINARYBUILDER=0" - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - # https://github.com/JuliaCI/julia-buildkite/blob/main/utilities/build_envs.sh - "JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);x86-64-v4,-rdrnd,base(1)" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - "JULIA_CPU_TARGET=generic;cortex-a57;thunderx2t99;carmel,clone_all;apple-m1,base(3);neoverse-512tvb,base(3)" - ]; + makeFlags = [ + "prefix=$(out)" + "USE_BINARYBUILDER=0" + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + # https://github.com/JuliaCI/julia-buildkite/blob/main/utilities/build_envs.sh + "JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);x86-64-v4,-rdrnd,base(1)" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + "JULIA_CPU_TARGET=generic;cortex-a57;thunderx2t99;carmel,clone_all;apple-m1,base(3);neoverse-512tvb,base(3)" + ]; # remove forbidden reference to $TMPDIR preFixup = '' diff --git a/pkgs/development/compilers/llvm/common/bolt/default.nix b/pkgs/development/compilers/llvm/common/bolt/default.nix index d18d24552819..9501b79493a7 100644 --- a/pkgs/development/compilers/llvm/common/bolt/default.nix +++ b/pkgs/development/compilers/llvm/common/bolt/default.nix @@ -66,7 +66,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") - ] ++ devExtraCmakeFlags; + ] + ++ devExtraCmakeFlags; postUnpack = '' chmod -R u+w -- $sourceRoot/.. diff --git a/pkgs/development/compilers/llvm/common/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix index f671bf370aa5..90fc14a97712 100644 --- a/pkgs/development/compilers/llvm/common/clang/default.nix +++ b/pkgs/development/compilers/llvm/common/clang/default.nix @@ -45,103 +45,101 @@ stdenv.mkDerivation ( sourceRoot = "${finalAttrs.src.name}/clang"; - patches = - [ - (getVersionFile "clang/purity.patch") - # Remove extraneous ".a" suffix from baremetal clang_rt.builtins when compiling for baremetal. - # https://reviews.llvm.org/D51899 - (getVersionFile "clang/gnu-install-dirs.patch") - ] - ++ lib.optionals (lib.versionOlder release_version "20") [ - # https://github.com/llvm/llvm-project/pull/116476 - # prevent clang ignoring warnings / errors for unsuppored - # options when building & linking a source file with trailing - # libraries. eg: `clang -munsupported hello.c -lc` - ./clang-unsupported-option.patch - ] - ++ - lib.optional (lib.versions.major release_version == "13") - # Revert of https://reviews.llvm.org/D100879 - # The malloc alignment assumption is incorrect for jemalloc and causes - # mis-compilation in firefox. - # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454 - (getVersionFile "clang/revert-malloc-alignment-assumption.patch") - ++ lib.optional (lib.versionOlder release_version "17") ( - if lib.versionAtLeast release_version "14" then - fetchpatch { - name = "ignore-nostd-link.patch"; - url = "https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615.patch"; - relative = "clang"; - hash = "sha256-qzSAmoGY+7POkDhcGgQRPaNQ3+7PIcIc9cZuiE/eLkc="; - } - else - ./ignore-nostd-link-13.diff - ) - # Pass the correct path to libllvm - ++ [ - (replaceVars - ( - if (lib.versionOlder release_version "16") then - ./clang-11-15-LLVMgold-path.patch - else - ./clang-at-least-16-LLVMgold-path.patch - ) - { - libllvmLibdir = "${libllvm.lib}/lib"; - } + patches = [ + (getVersionFile "clang/purity.patch") + # Remove extraneous ".a" suffix from baremetal clang_rt.builtins when compiling for baremetal. + # https://reviews.llvm.org/D51899 + (getVersionFile "clang/gnu-install-dirs.patch") + ] + ++ lib.optionals (lib.versionOlder release_version "20") [ + # https://github.com/llvm/llvm-project/pull/116476 + # prevent clang ignoring warnings / errors for unsuppored + # options when building & linking a source file with trailing + # libraries. eg: `clang -munsupported hello.c -lc` + ./clang-unsupported-option.patch + ] + ++ + lib.optional (lib.versions.major release_version == "13") + # Revert of https://reviews.llvm.org/D100879 + # The malloc alignment assumption is incorrect for jemalloc and causes + # mis-compilation in firefox. + # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454 + (getVersionFile "clang/revert-malloc-alignment-assumption.patch") + ++ lib.optional (lib.versionOlder release_version "17") ( + if lib.versionAtLeast release_version "14" then + fetchpatch { + name = "ignore-nostd-link.patch"; + url = "https://github.com/llvm/llvm-project/commit/5b77e752dcd073846b89559d6c0e1a7699e58615.patch"; + relative = "clang"; + hash = "sha256-qzSAmoGY+7POkDhcGgQRPaNQ3+7PIcIc9cZuiE/eLkc="; + } + else + ./ignore-nostd-link-13.diff + ) + # Pass the correct path to libllvm + ++ [ + (replaceVars + ( + if (lib.versionOlder release_version "16") then + ./clang-11-15-LLVMgold-path.patch + else + ./clang-at-least-16-LLVMgold-path.patch ) - ] - # Backport version logic from Clang 16. This is needed by the following patch. - ++ lib.optional (lib.versions.major release_version == "15") (fetchpatch { - name = "clang-darwin-Use-consistent-version-define-stringifying-logic.patch"; - url = "https://github.com/llvm/llvm-project/commit/60a33ded751c86fff9ac1c4bdd2b341fbe4b0649.patch?full_index=1"; - includes = [ "lib/Basic/Targets/OSTargets.cpp" ]; - stripLen = 1; - hash = "sha256-YVTSg5eZLz3po2AUczPNXCK26JA3CuTh6Iqp7hAAKIs="; - }) - # Backport `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__` support from Clang 17. - # This is needed by newer SDKs (14+). - ++ - lib.optional - ( - lib.versionAtLeast (lib.versions.major release_version) "15" - && lib.versionOlder (lib.versions.major release_version) "17" - ) - (fetchpatch { - name = "clang-darwin-An-OS-version-preprocessor-define.patch"; - url = "https://github.com/llvm/llvm-project/commit/c8e2dd8c6f490b68e41fe663b44535a8a21dfeab.patch?full_index=1"; - includes = [ "lib/Basic/Targets/OSTargets.cpp" ]; - stripLen = 1; - hash = "sha256-Vs32kql7N6qtLqc12FtZHURcbenA7+N3E/nRRX3jdig="; - }) - # Fixes a bunch of lambda-related crashes - # https://github.com/llvm/llvm-project/pull/93206 - ++ lib.optional (lib.versions.major release_version == "18") (fetchpatch { - name = "tweak-tryCaptureVariable-for-unevaluated-lambdas.patch"; - url = "https://github.com/llvm/llvm-project/commit/3d361b225fe89ce1d8c93639f27d689082bd8dad.patch"; - # TreeTransform.h is not affected in LLVM 18. - excludes = [ - "docs/ReleaseNotes.rst" - "lib/Sema/TreeTransform.h" - ]; - stripLen = 1; - hash = "sha256-1NKej08R9SPlbDY/5b0OKUsHjX07i9brR84yXiPwi7E="; - }) - ++ - lib.optional (stdenv.isAarch64 && lib.versions.major release_version == "17") - # Fixes llvm17 tblgen builds on aarch64. - # https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680 - (getVersionFile "clang/aarch64-tblgen.patch"); + { + libllvmLibdir = "${libllvm.lib}/lib"; + } + ) + ] + # Backport version logic from Clang 16. This is needed by the following patch. + ++ lib.optional (lib.versions.major release_version == "15") (fetchpatch { + name = "clang-darwin-Use-consistent-version-define-stringifying-logic.patch"; + url = "https://github.com/llvm/llvm-project/commit/60a33ded751c86fff9ac1c4bdd2b341fbe4b0649.patch?full_index=1"; + includes = [ "lib/Basic/Targets/OSTargets.cpp" ]; + stripLen = 1; + hash = "sha256-YVTSg5eZLz3po2AUczPNXCK26JA3CuTh6Iqp7hAAKIs="; + }) + # Backport `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__` support from Clang 17. + # This is needed by newer SDKs (14+). + ++ + lib.optional + ( + lib.versionAtLeast (lib.versions.major release_version) "15" + && lib.versionOlder (lib.versions.major release_version) "17" + ) + (fetchpatch { + name = "clang-darwin-An-OS-version-preprocessor-define.patch"; + url = "https://github.com/llvm/llvm-project/commit/c8e2dd8c6f490b68e41fe663b44535a8a21dfeab.patch?full_index=1"; + includes = [ "lib/Basic/Targets/OSTargets.cpp" ]; + stripLen = 1; + hash = "sha256-Vs32kql7N6qtLqc12FtZHURcbenA7+N3E/nRRX3jdig="; + }) + # Fixes a bunch of lambda-related crashes + # https://github.com/llvm/llvm-project/pull/93206 + ++ lib.optional (lib.versions.major release_version == "18") (fetchpatch { + name = "tweak-tryCaptureVariable-for-unevaluated-lambdas.patch"; + url = "https://github.com/llvm/llvm-project/commit/3d361b225fe89ce1d8c93639f27d689082bd8dad.patch"; + # TreeTransform.h is not affected in LLVM 18. + excludes = [ + "docs/ReleaseNotes.rst" + "lib/Sema/TreeTransform.h" + ]; + stripLen = 1; + hash = "sha256-1NKej08R9SPlbDY/5b0OKUsHjX07i9brR84yXiPwi7E="; + }) + ++ + lib.optional (stdenv.isAarch64 && lib.versions.major release_version == "17") + # Fixes llvm17 tblgen builds on aarch64. + # https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680 + (getVersionFile "clang/aarch64-tblgen.patch"); - nativeBuildInputs = - [ - cmake - python3 - ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) - ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + nativeBuildInputs = [ + cmake + python3 + ] + ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) + ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser + ++ lib.optional enableManpages python3.pkgs.sphinx + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = [ libxml2 @@ -186,16 +184,15 @@ stdenv.mkDerivation ( ) ++ devExtraCmakeFlags; - postPatch = - '' - # Make sure clang passes the correct location of libLTO to ld64 - substituteInPlace lib/Driver/ToolChains/Darwin.cpp \ - --replace-fail 'StringRef P = llvm::sys::path::parent_path(D.Dir);' 'StringRef P = "${lib.getLib libllvm}";' - (cd tools && ln -s ../../clang-tools-extra extra) - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; + postPatch = '' + # Make sure clang passes the correct location of libLTO to ld64 + substituteInPlace lib/Driver/ToolChains/Darwin.cpp \ + --replace-fail 'StringRef P = llvm::sys::path::parent_path(D.Dir);' 'StringRef P = "${lib.getLib libllvm}";' + (cd tools && ln -s ../../clang-tools-extra extra) + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp + ''; outputs = [ "out" @@ -206,66 +203,65 @@ stdenv.mkDerivation ( separateDebugInfo = stdenv.buildPlatform.is64bit; # OOMs on 32 bit - postInstall = + postInstall = '' + ln -sv $out/bin/clang $out/bin/cpp + '' + + (lib.optionalString (lib.versions.major release_version == "17") '' + mkdir -p $lib/lib/clang + mv $lib/lib/17 $lib/lib/clang/17 + '') + + (lib.optionalString + ((lib.versionAtLeast release_version "19") && !(lib.versionAtLeast release_version "21")) '' - ln -sv $out/bin/clang $out/bin/cpp + mv $out/lib/clang $lib/lib/clang '' - + (lib.optionalString (lib.versions.major release_version == "17") '' - mkdir -p $lib/lib/clang - mv $lib/lib/17 $lib/lib/clang/17 - '') - + (lib.optionalString - ((lib.versionAtLeast release_version "19") && !(lib.versionAtLeast release_version "21")) - '' - mv $out/lib/clang $lib/lib/clang - '' - ) - + '' + ) + + '' - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - '' - + ( - if lib.versionOlder release_version "15" then - '' - mkdir -p $python/bin $python/share/{clang,scan-view} - '' - else - '' - mkdir -p $python/bin $python/share/clang/ - '' - ) - + '' - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - '' - + (lib.optionalString (lib.versionOlder release_version "15") '' - mv $out/share/scan-view/*.py $python/share/scan-view - '') - + '' - rm $out/bin/c-index-test - patchShebangs $python/bin + # Move libclang to 'lib' output + moveToOutput "lib/libclang.*" "$lib" + moveToOutput "lib/libclang-cpp.*" "$lib" + '' + + ( + if lib.versionOlder release_version "15" then + '' + mkdir -p $python/bin $python/share/{clang,scan-view} + '' + else + '' + mkdir -p $python/bin $python/share/clang/ + '' + ) + + '' + mv $out/bin/{git-clang-format,scan-view} $python/bin + if [ -e $out/bin/set-xcode-analyzer ]; then + mv $out/bin/set-xcode-analyzer $python/bin + fi + mv $out/share/clang/*.py $python/share/clang + '' + + (lib.optionalString (lib.versionOlder release_version "15") '' + mv $out/share/scan-view/*.py $python/share/scan-view + '') + + '' + rm $out/bin/c-index-test + patchShebangs $python/bin - mkdir -p $dev/bin - '' - + ( - if lib.versionOlder release_version "15" then - '' - cp bin/clang-tblgen $dev/bin - '' - else if lib.versionOlder release_version "20" then - '' - cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin - '' - else - '' - cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen} $dev/bin - '' - ); + mkdir -p $dev/bin + '' + + ( + if lib.versionOlder release_version "15" then + '' + cp bin/clang-tblgen $dev/bin + '' + else if lib.versionOlder release_version "20" then + '' + cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin + '' + else + '' + cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen} $dev/bin + '' + ); env = lib.optionalAttrs diff --git a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix index 206b92b7432d..40ff633527ae 100644 --- a/pkgs/development/compilers/llvm/common/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/common/compiler-rt/default.nix @@ -138,14 +138,13 @@ stdenv.mkDerivation (finalAttrs: { relative = "compiler-rt"; }); - nativeBuildInputs = - [ - cmake - python3 - libllvm.dev - ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) - ++ lib.optionals stdenv.hostPlatform.isDarwin [ jq ]; + nativeBuildInputs = [ + cmake + python3 + libllvm.dev + ] + ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) + ++ lib.optionals stdenv.hostPlatform.isDarwin [ jq ]; buildInputs = lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isRiscV) linuxHeaders ++ lib.optional (stdenv.hostPlatform.isFreeBSD) freebsd.include; @@ -169,84 +168,83 @@ stdenv.mkDerivation (finalAttrs: { NIX_CFLAGS_LINK = lib.optionalString (stdenv.hostPlatform.isDarwin) "--ld-path=${stdenv.cc.bintools}/bin/${stdenv.cc.targetPrefix}ld"; }; - cmakeFlags = - [ - (lib.cmakeBool "COMPILER_RT_DEFAULT_TARGET_ONLY" true) - (lib.cmakeFeature "CMAKE_C_COMPILER_TARGET" stdenv.hostPlatform.config) - (lib.cmakeFeature "CMAKE_ASM_COMPILER_TARGET" stdenv.hostPlatform.config) - ] - ++ lib.optionals (haveLibc && stdenv.hostPlatform.libc == "glibc") [ - (lib.cmakeFeature "SANITIZER_COMMON_CFLAGS" "-I${libxcrypt}/include") - ] - ++ lib.optionals (useLLVM && haveLibc && stdenv.cc.libcxx == libcxx) [ - (lib.cmakeFeature "SANITIZER_CXX_ABI" "libcxxabi") - (lib.cmakeFeature "SANITIZER_CXX_ABI_LIBNAME" "libcxxabi") - (lib.cmakeBool "COMPILER_RT_USE_BUILTINS_LIBRARY" true) - ] - ++ - lib.optionals - ((!haveLibc || bareMetal || isMusl || isAarch64) && (lib.versions.major release_version == "13")) - [ - (lib.cmakeBool "COMPILER_RT_BUILD_LIBFUZZER" false) - ] - ++ lib.optionals (useLLVM && haveLibc) [ - (lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" true) - (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" true) - ] - ++ lib.optionals (noSanitizers) [ - (lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" false) - ] - ++ lib.optionals ((useLLVM && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [ - (lib.cmakeBool "COMPILER_RT_BUILD_XRAY" false) - (lib.cmakeBool "COMPILER_RT_BUILD_LIBFUZZER" false) - (lib.cmakeBool "COMPILER_RT_BUILD_MEMPROF" false) - (lib.cmakeBool "COMPILER_RT_BUILD_ORC" false) # may be possible to build with musl if necessary - ] - ++ lib.optionals (!haveLibc || bareMetal) [ - (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" false) - (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) - (lib.cmakeBool "COMPILER_RT_BAREMETAL_BUILD" true) - (lib.cmakeFeature "CMAKE_SIZEOF_VOID_P" (toString (stdenv.hostPlatform.parsed.cpu.bits / 8))) - ] - ++ lib.optionals (!haveLibc || bareMetal || isDarwinStatic) [ - (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) - ] - ++ lib.optionals (!haveLibc) [ - (lib.cmakeFeature "CMAKE_C_FLAGS" "-nodefaultlibs") - ] - ++ lib.optionals (useLLVM) [ - (lib.cmakeBool "COMPILER_RT_BUILD_BUILTINS" true) - #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program - (lib.cmakeFeature "CMAKE_TRY_COMPILE_TARGET_TYPE" "STATIC_LIBRARY") - ] - ++ lib.optionals (bareMetal) [ - (lib.cmakeFeature "COMPILER_RT_OS_DIR" "baremetal") - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) ( - lib.optionals (lib.versionAtLeast release_version "16") [ - (lib.cmakeFeature "CMAKE_LIPO" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}lipo") + cmakeFlags = [ + (lib.cmakeBool "COMPILER_RT_DEFAULT_TARGET_ONLY" true) + (lib.cmakeFeature "CMAKE_C_COMPILER_TARGET" stdenv.hostPlatform.config) + (lib.cmakeFeature "CMAKE_ASM_COMPILER_TARGET" stdenv.hostPlatform.config) + ] + ++ lib.optionals (haveLibc && stdenv.hostPlatform.libc == "glibc") [ + (lib.cmakeFeature "SANITIZER_COMMON_CFLAGS" "-I${libxcrypt}/include") + ] + ++ lib.optionals (useLLVM && haveLibc && stdenv.cc.libcxx == libcxx) [ + (lib.cmakeFeature "SANITIZER_CXX_ABI" "libcxxabi") + (lib.cmakeFeature "SANITIZER_CXX_ABI_LIBNAME" "libcxxabi") + (lib.cmakeBool "COMPILER_RT_USE_BUILTINS_LIBRARY" true) + ] + ++ + lib.optionals + ((!haveLibc || bareMetal || isMusl || isAarch64) && (lib.versions.major release_version == "13")) + [ + (lib.cmakeBool "COMPILER_RT_BUILD_LIBFUZZER" false) ] - ++ lib.optionals (!haveLibcxx) [ - # Darwin fails to detect that the compiler supports the `-g` flag when there is no libc++ during the - # compiler-rt bootstrap, which prevents compiler-rt from building. The `-g` flag is required by the - # Darwin support, so force it to be enabled during the first stage of the compiler-rt bootstrap. - (lib.cmakeBool "COMPILER_RT_HAS_G_FLAG" true) - ] - ++ [ - (lib.cmakeFeature "DARWIN_osx_ARCHS" stdenv.hostPlatform.darwinArch) - (lib.cmakeFeature "DARWIN_osx_BUILTIN_ARCHS" stdenv.hostPlatform.darwinArch) - (lib.cmakeFeature "SANITIZER_MIN_OSX_VERSION" stdenv.hostPlatform.darwinMinVersion) - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - # `COMPILER_RT_DEFAULT_TARGET_ONLY` does not apply to Darwin: - # https://github.com/llvm/llvm-project/blob/27ef42bec80b6c010b7b3729ed0528619521a690/compiler-rt/cmake/base-config-ix.cmake#L153 - (lib.cmakeBool "COMPILER_RT_ENABLE_IOS" false) - ] - ) - ++ lib.optionals (noSanitizers && lib.versionAtLeast release_version "19") [ - (lib.cmakeBool "COMPILER_RT_BUILD_CTX_PROFILE" false) + ++ lib.optionals (useLLVM && haveLibc) [ + (lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" true) + (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" true) + ] + ++ lib.optionals (noSanitizers) [ + (lib.cmakeBool "COMPILER_RT_BUILD_SANITIZERS" false) + ] + ++ lib.optionals ((useLLVM && !haveLibcxx) || !haveLibc || bareMetal || isMusl || isDarwinStatic) [ + (lib.cmakeBool "COMPILER_RT_BUILD_XRAY" false) + (lib.cmakeBool "COMPILER_RT_BUILD_LIBFUZZER" false) + (lib.cmakeBool "COMPILER_RT_BUILD_MEMPROF" false) + (lib.cmakeBool "COMPILER_RT_BUILD_ORC" false) # may be possible to build with musl if necessary + ] + ++ lib.optionals (!haveLibc || bareMetal) [ + (lib.cmakeBool "COMPILER_RT_BUILD_PROFILE" false) + (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) + (lib.cmakeBool "COMPILER_RT_BAREMETAL_BUILD" true) + (lib.cmakeFeature "CMAKE_SIZEOF_VOID_P" (toString (stdenv.hostPlatform.parsed.cpu.bits / 8))) + ] + ++ lib.optionals (!haveLibc || bareMetal || isDarwinStatic) [ + (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) + ] + ++ lib.optionals (!haveLibc) [ + (lib.cmakeFeature "CMAKE_C_FLAGS" "-nodefaultlibs") + ] + ++ lib.optionals (useLLVM) [ + (lib.cmakeBool "COMPILER_RT_BUILD_BUILTINS" true) + #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program + (lib.cmakeFeature "CMAKE_TRY_COMPILE_TARGET_TYPE" "STATIC_LIBRARY") + ] + ++ lib.optionals (bareMetal) [ + (lib.cmakeFeature "COMPILER_RT_OS_DIR" "baremetal") + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) ( + lib.optionals (lib.versionAtLeast release_version "16") [ + (lib.cmakeFeature "CMAKE_LIPO" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}lipo") ] - ++ devExtraCmakeFlags; + ++ lib.optionals (!haveLibcxx) [ + # Darwin fails to detect that the compiler supports the `-g` flag when there is no libc++ during the + # compiler-rt bootstrap, which prevents compiler-rt from building. The `-g` flag is required by the + # Darwin support, so force it to be enabled during the first stage of the compiler-rt bootstrap. + (lib.cmakeBool "COMPILER_RT_HAS_G_FLAG" true) + ] + ++ [ + (lib.cmakeFeature "DARWIN_osx_ARCHS" stdenv.hostPlatform.darwinArch) + (lib.cmakeFeature "DARWIN_osx_BUILTIN_ARCHS" stdenv.hostPlatform.darwinArch) + (lib.cmakeFeature "SANITIZER_MIN_OSX_VERSION" stdenv.hostPlatform.darwinMinVersion) + ] + ++ lib.optionals (lib.versionAtLeast release_version "15") [ + # `COMPILER_RT_DEFAULT_TARGET_ONLY` does not apply to Darwin: + # https://github.com/llvm/llvm-project/blob/27ef42bec80b6c010b7b3729ed0528619521a690/compiler-rt/cmake/base-config-ix.cmake#L153 + (lib.cmakeBool "COMPILER_RT_ENABLE_IOS" false) + ] + ) + ++ lib.optionals (noSanitizers && lib.versionAtLeast release_version "19") [ + (lib.cmakeBool "COMPILER_RT_BUILD_CTX_PROFILE" false) + ] + ++ devExtraCmakeFlags; outputs = [ "out" diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index 685020f40d0b..aa53be5b06b3 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -170,14 +170,14 @@ let # Crude method to drop polly patches if present, they're not needed for tblgen. (p: (!lib.hasInfix "-polly" p)) tools.libllvm.patches; - clangPatches = - [ - # Would take tools.libclang.patches, but this introduces a cycle due - # to replacements depending on the llvm outpath (e.g. the LLVMgold patch). - # So take the only patch known to be necessary. - (metadata.getVersionFile "clang/gnu-install-dirs.patch") - ] - ++ lib.optional (stdenv.isAarch64 && lib.versions.major metadata.release_version == "17") + clangPatches = [ + # Would take tools.libclang.patches, but this introduces a cycle due + # to replacements depending on the llvm outpath (e.g. the LLVMgold patch). + # So take the only patch known to be necessary. + (metadata.getVersionFile "clang/gnu-install-dirs.patch") + ] + ++ + lib.optional (stdenv.isAarch64 && lib.versions.major metadata.release_version == "17") # Fixes llvm17 tblgen builds on aarch64. # https://github.com/llvm/llvm-project/issues/106521#issuecomment-2337175680 (metadata.getVersionFile "clang/aarch64-tblgen.patch"); @@ -278,11 +278,12 @@ let cc = tools.clang-unwrapped; libcxx = targetLlvmLibraries.libcxx; bintools = bintools'; - extraPackages = - [ targetLlvmLibraries.compiler-rt ] - ++ lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD) [ - targetLlvmLibraries.libunwind - ]; + extraPackages = [ + targetLlvmLibraries.compiler-rt + ] + ++ lib.optionals (!stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD) [ + targetLlvmLibraries.libunwind + ]; extraBuildCommands = lib.optionalString (lib.versions.major metadata.release_version == "13") ( '' @@ -303,21 +304,20 @@ let + mkExtraBuildCommands cc; } // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = - [ - "-rtlib=compiler-rt" - "-Wno-unused-command-line-argument" - "-B${targetLlvmLibraries.compiler-rt}/lib" - ] - ++ lib.optional ( - !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD - ) "--unwindlib=libunwind" - ++ lib.optional ( - !stdenv.targetPlatform.isWasm - && !stdenv.targetPlatform.isFreeBSD - && stdenv.targetPlatform.useLLVM or false - ) "-lunwind" - ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-Wno-unused-command-line-argument" + "-B${targetLlvmLibraries.compiler-rt}/lib" + ] + ++ lib.optional ( + !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD + ) "--unwindlib=libunwind" + ++ lib.optional ( + !stdenv.targetPlatform.isWasm + && !stdenv.targetPlatform.isFreeBSD + && stdenv.targetPlatform.useLLVM or false + ) "-lunwind" + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; nixSupport.cc-ldflags = lib.optionals ( !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD ) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; @@ -329,9 +329,11 @@ let cc = tools.clang-unwrapped; libcxx = targetLlvmLibraries.libcxx; bintools = bintools'; - extraPackages = - [ targetLlvmLibraries.compiler-rt-no-libc ] - ++ lib.optionals + extraPackages = [ + targetLlvmLibraries.compiler-rt-no-libc + ] + ++ + lib.optionals ( !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin ) @@ -358,21 +360,20 @@ let + mkExtraBuildCommandsBasicRt cc; } // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = - [ - "-rtlib=compiler-rt" - "-Wno-unused-command-line-argument" - "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" - ] - ++ lib.optional ( - !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin - ) "--unwindlib=libunwind" - ++ lib.optional ( - !stdenv.targetPlatform.isWasm - && !stdenv.targetPlatform.isFreeBSD - && stdenv.targetPlatform.useLLVM or false - ) "-lunwind" - ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-Wno-unused-command-line-argument" + "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" + ] + ++ lib.optional ( + !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin + ) "--unwindlib=libunwind" + ++ lib.optional ( + !stdenv.targetPlatform.isWasm + && !stdenv.targetPlatform.isFreeBSD + && stdenv.targetPlatform.useLLVM or false + ) "-lunwind" + ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; nixSupport.cc-ldflags = lib.optionals ( !stdenv.targetPlatform.isWasm && !stdenv.targetPlatform.isFreeBSD && !stdenv.targetPlatform.isDarwin ) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; @@ -394,15 +395,14 @@ let + mkExtraBuildCommandsBasicRt cc; } // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = - [ - "-rtlib=compiler-rt" - "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" - "-nostdlib++" - ] - ++ lib.optional ( - lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm - ) "-fno-exceptions"; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" + "-nostdlib++" + ] + ++ lib.optional ( + lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm + ) "-fno-exceptions"; } ); @@ -420,14 +420,13 @@ let + mkExtraBuildCommandsBasicRt cc; } // lib.optionalAttrs (lib.versionAtLeast metadata.release_version "14") { - nixSupport.cc-cflags = - [ - "-rtlib=compiler-rt" - "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" - ] - ++ lib.optional ( - lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm - ) "-fno-exceptions"; + nixSupport.cc-cflags = [ + "-rtlib=compiler-rt" + "-B${targetLlvmLibraries.compiler-rt-no-libc}/lib" + ] + ++ lib.optional ( + lib.versionAtLeast metadata.release_version "15" && stdenv.targetPlatform.isWasm + ) "-fno-exceptions"; } ); diff --git a/pkgs/development/compilers/llvm/common/libc/default.nix b/pkgs/development/compilers/llvm/common/libc/default.nix index 69d830a19d71..de68e6698cfb 100644 --- a/pkgs/development/compilers/llvm/common/libc/default.nix +++ b/pkgs/development/compilers/llvm/common/libc/default.nix @@ -34,13 +34,12 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot = "${finalAttrs.src.name}/runtimes"; - nativeBuildInputs = - [ - cmake - python3 - ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) - ++ (lib.optional isFullBuild python3Packages.pyyaml); + nativeBuildInputs = [ + cmake + python3 + ] + ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) + ++ (lib.optional isFullBuild python3Packages.pyyaml); buildInputs = lib.optional isFullBuild linuxHeaders; @@ -73,20 +72,19 @@ stdenv.mkDerivation (finalAttrs: { libc = if (!isFullBuild) then stdenv.cc.libc else null; - cmakeFlags = - [ - (lib.cmakeBool "LLVM_LIBC_FULL_BUILD" isFullBuild) - (lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libc;compiler-rt") - # Tests requires the host to have a libc. - (lib.cmakeBool "LLVM_INCLUDE_TESTS" (stdenv.cc.libc != null)) - ] - ++ lib.optionals (isFullBuild && stdenv.cc.libc == null) [ - # CMake runs a check to see if the compiler works. - # This includes including headers which requires a libc. - # Skip these checks because a libc cannot be used when one doesn't exist. - (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) - (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) - ]; + cmakeFlags = [ + (lib.cmakeBool "LLVM_LIBC_FULL_BUILD" isFullBuild) + (lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libc;compiler-rt") + # Tests requires the host to have a libc. + (lib.cmakeBool "LLVM_INCLUDE_TESTS" (stdenv.cc.libc != null)) + ] + ++ lib.optionals (isFullBuild && stdenv.cc.libc == null) [ + # CMake runs a check to see if the compiler works. + # This includes including headers which requires a libc. + # Skip these checks because a libc cannot be used when one doesn't exist. + (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) + (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) + ]; # For the update script: passthru = { diff --git a/pkgs/development/compilers/llvm/common/libclc/default.nix b/pkgs/development/compilers/llvm/common/libclc/default.nix index 290f7487c797..5a3f7d4eba67 100644 --- a/pkgs/development/compilers/llvm/common/libclc/default.nix +++ b/pkgs/development/compilers/llvm/common/libclc/default.nix @@ -49,15 +49,16 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - patches = - [ ./libclc-gnu-install-dirs.patch ] - # LLVM 19 changes how host tools are looked up. - # Need to remove NO_DEFAULT_PATH and the PATHS arguments for find_program - # so CMake can actually find the tools in nativeBuildInputs. - # https://github.com/llvm/llvm-project/pull/105969 - ++ lib.optional (lib.versionAtLeast release_version "19") ( - getVersionFile "libclc/use-default-paths.patch" - ); + patches = [ + ./libclc-gnu-install-dirs.patch + ] + # LLVM 19 changes how host tools are looked up. + # Need to remove NO_DEFAULT_PATH and the PATHS arguments for find_program + # so CMake can actually find the tools in nativeBuildInputs. + # https://github.com/llvm/llvm-project/pull/105969 + ++ lib.optional (lib.versionAtLeast release_version "19") ( + getVersionFile "libclc/use-default-paths.patch" + ); # cmake expects all required binaries to be in the same place, so it will not be able to find clang without the patch postPatch = @@ -89,17 +90,16 @@ stdenv.mkDerivation (finalAttrs: { '' ); - nativeBuildInputs = - [ - cmake - ninja - python3 - ] - ++ lib.optional (lib.versionAtLeast release_version "19") [ - clang-only - buildLlvmTools.llvm - spirv-llvm-translator - ]; + nativeBuildInputs = [ + cmake + ninja + python3 + ] + ++ lib.optional (lib.versionAtLeast release_version "19") [ + clang-only + buildLlvmTools.llvm + spirv-llvm-translator + ]; buildInputs = [ llvm ]; strictDeps = true; diff --git a/pkgs/development/compilers/llvm/common/libcxx/default.nix b/pkgs/development/compilers/llvm/common/libcxx/default.nix index d8969b3b028e..520692c30d6e 100644 --- a/pkgs/development/compilers/llvm/common/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/common/libcxx/default.nix @@ -58,79 +58,77 @@ let (lib.cmakeBool "LIBCXXABI_ENABLE_SHARED" false) ]; - cxxCMakeFlags = - [ - (lib.cmakeFeature "LIBCXX_CXX_ABI" cxxabiName) - (lib.cmakeBool "LIBCXX_ENABLE_SHARED" enableShared) - # https://github.com/llvm/llvm-project/issues/55245 - (lib.cmakeBool "LIBCXX_ENABLE_STATIC_ABI_LIBRARY" stdenv.hostPlatform.isWindows) - ] - ++ lib.optionals (cxxabi == null && lib.versionAtLeast release_version "16") [ - # Note: llvm < 16 doesn't support this flag (or it's broken); handled in postInstall instead. - # Include libc++abi symbols within libc++.a for static linking libc++; - # dynamic linking includes them through libc++.so being a linker script - # which includes both shared objects. - (lib.cmakeBool "LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY" true) - ] - ++ lib.optionals (cxxabi != null) [ - (lib.cmakeFeature "LIBCXX_CXX_ABI_INCLUDE_PATHS" "${lib.getDev cxxabi}/include") - ] - ++ lib.optionals (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) [ - (lib.cmakeFeature "LIBCXX_HAS_MUSL_LIBC" "1") - ] - ++ - lib.optionals - ( - lib.versionAtLeast release_version "18" - && !useLLVM - && stdenv.hostPlatform.libc == "glibc" - && !stdenv.hostPlatform.isStatic - ) - [ - (lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "gcc_s") - ] - ++ lib.optionals (lib.versionAtLeast release_version "18" && stdenv.hostPlatform.isFreeBSD) [ - # Name and documentation claim this is for libc++abi, but its man effect is adding `-lunwind` - # to the libc++.so linker script. We want FreeBSD's so-called libgcc instead of libunwind. - (lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false) - ] - ++ lib.optionals useLLVM [ - (lib.cmakeBool "LIBCXX_USE_COMPILER_RT" true) - ] - ++ - lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD && lib.versionAtLeast release_version "16") - [ - (lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind") - ] - ++ lib.optionals stdenv.hostPlatform.isWasm [ - (lib.cmakeBool "LIBCXX_ENABLE_THREADS" false) - (lib.cmakeBool "LIBCXX_ENABLE_FILESYSTEM" false) - (lib.cmakeBool "LIBCXX_ENABLE_EXCEPTIONS" false) - ] - ++ lib.optionals (cxxabi != null && cxxabi.libName == "cxxrt") [ - (lib.cmakeBool "LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS" true) - ]; + cxxCMakeFlags = [ + (lib.cmakeFeature "LIBCXX_CXX_ABI" cxxabiName) + (lib.cmakeBool "LIBCXX_ENABLE_SHARED" enableShared) + # https://github.com/llvm/llvm-project/issues/55245 + (lib.cmakeBool "LIBCXX_ENABLE_STATIC_ABI_LIBRARY" stdenv.hostPlatform.isWindows) + ] + ++ lib.optionals (cxxabi == null && lib.versionAtLeast release_version "16") [ + # Note: llvm < 16 doesn't support this flag (or it's broken); handled in postInstall instead. + # Include libc++abi symbols within libc++.a for static linking libc++; + # dynamic linking includes them through libc++.so being a linker script + # which includes both shared objects. + (lib.cmakeBool "LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY" true) + ] + ++ lib.optionals (cxxabi != null) [ + (lib.cmakeFeature "LIBCXX_CXX_ABI_INCLUDE_PATHS" "${lib.getDev cxxabi}/include") + ] + ++ lib.optionals (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) [ + (lib.cmakeFeature "LIBCXX_HAS_MUSL_LIBC" "1") + ] + ++ + lib.optionals + ( + lib.versionAtLeast release_version "18" + && !useLLVM + && stdenv.hostPlatform.libc == "glibc" + && !stdenv.hostPlatform.isStatic + ) + [ + (lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "gcc_s") + ] + ++ lib.optionals (lib.versionAtLeast release_version "18" && stdenv.hostPlatform.isFreeBSD) [ + # Name and documentation claim this is for libc++abi, but its man effect is adding `-lunwind` + # to the libc++.so linker script. We want FreeBSD's so-called libgcc instead of libunwind. + (lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false) + ] + ++ lib.optionals useLLVM [ + (lib.cmakeBool "LIBCXX_USE_COMPILER_RT" true) + ] + ++ + lib.optionals (useLLVM && !stdenv.hostPlatform.isFreeBSD && lib.versionAtLeast release_version "16") + [ + (lib.cmakeFeature "LIBCXX_ADDITIONAL_LIBRARIES" "unwind") + ] + ++ lib.optionals stdenv.hostPlatform.isWasm [ + (lib.cmakeBool "LIBCXX_ENABLE_THREADS" false) + (lib.cmakeBool "LIBCXX_ENABLE_FILESYSTEM" false) + (lib.cmakeBool "LIBCXX_ENABLE_EXCEPTIONS" false) + ] + ++ lib.optionals (cxxabi != null && cxxabi.libName == "cxxrt") [ + (lib.cmakeBool "LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS" true) + ]; - cmakeFlags = - [ - (lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" (lib.concatStringsSep ";" runtimes)) - ] - ++ - lib.optionals - ( - stdenv.hostPlatform.isWasm - || (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin) - ) - [ - (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) - ] - ++ lib.optionals stdenv.hostPlatform.isWasm [ - (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) - (lib.cmakeBool "UNIX" true) # Required otherwise libc++ fails to detect the correct linker - ] - ++ cxxCMakeFlags - ++ lib.optionals (cxxabi == null) cxxabiCMakeFlags - ++ devExtraCmakeFlags; + cmakeFlags = [ + (lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" (lib.concatStringsSep ";" runtimes)) + ] + ++ + lib.optionals + ( + stdenv.hostPlatform.isWasm + || (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin) + ) + [ + (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) + ] + ++ lib.optionals stdenv.hostPlatform.isWasm [ + (lib.cmakeBool "CMAKE_C_COMPILER_WORKS" true) + (lib.cmakeBool "UNIX" true) # Required otherwise libc++ fails to detect the correct linker + ] + ++ cxxCMakeFlags + ++ lib.optionals (cxxabi == null) cxxabiCMakeFlags + ++ devExtraCmakeFlags; in @@ -211,20 +209,20 @@ stdenv.mkDerivation ( }) ); - nativeBuildInputs = - [ - cmake - ninja - python3 - ] - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames - ++ lib.optional (cxxabi != null) lndir; + nativeBuildInputs = [ + cmake + ninja + python3 + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames + ++ lib.optional (cxxabi != null) lndir; - buildInputs = - [ cxxabi ] - ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isFreeBSD) [ - libunwind - ]; + buildInputs = [ + cxxabi + ] + ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm && !stdenv.hostPlatform.isFreeBSD) [ + libunwind + ]; # libc++.so is a linker script which expands to multiple libraries, # libc++.so.1 and libc++abi.so or the external cxxabi. ld-wrapper doesn't diff --git a/pkgs/development/compilers/llvm/common/libunwind/default.nix b/pkgs/development/compilers/llvm/common/libunwind/default.nix index 20c0287a08e2..188ba578c994 100644 --- a/pkgs/development/compilers/llvm/common/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/common/libunwind/default.nix @@ -66,22 +66,24 @@ stdenv.mkDerivation ( "dev" ]; - nativeBuildInputs = - [ cmake ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - ninja - python3 - ]; + nativeBuildInputs = [ + cmake + ] + ++ lib.optionals (lib.versionAtLeast release_version "15") [ + ninja + python3 + ]; - cmakeFlags = - [ (lib.cmakeBool "LIBUNWIND_ENABLE_SHARED" enableShared) ] - ++ lib.optional (lib.versionAtLeast release_version "15") ( - lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind" - ) - ++ lib.optionals (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin) [ - (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) - ] - ++ devExtraCmakeFlags; + cmakeFlags = [ + (lib.cmakeBool "LIBUNWIND_ENABLE_SHARED" enableShared) + ] + ++ lib.optional (lib.versionAtLeast release_version "15") ( + lib.cmakeFeature "LLVM_ENABLE_RUNTIMES" "libunwind" + ) + ++ lib.optionals (lib.versions.major release_version == "12" && stdenv.hostPlatform.isDarwin) [ + (lib.cmakeBool "CMAKE_CXX_COMPILER_WORKS" true) + ] + ++ devExtraCmakeFlags; prePatch = lib.optionalString diff --git a/pkgs/development/compilers/llvm/common/lld/default.nix b/pkgs/development/compilers/llvm/common/lld/default.nix index ea5fe0e4e9cf..4681f8ce5705 100644 --- a/pkgs/development/compilers/llvm/common/lld/default.nix +++ b/pkgs/development/compilers/llvm/common/lld/default.nix @@ -41,23 +41,24 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot = "${finalAttrs.src.name}/lld"; - patches = - [ (getVersionFile "lld/gnu-install-dirs.patch") ] - ++ lib.optional (lib.versions.major release_version == "14") ( - getVersionFile "lld/fix-root-src-dir.patch" - ) - ++ lib.optional (lib.versionAtLeast release_version "16" && lib.versionOlder release_version "18") ( - getVersionFile "lld/add-table-base.patch" - ) - ++ lib.optional (lib.versions.major release_version == "18") ( - # https://github.com/llvm/llvm-project/pull/97122 - fetchpatch { - name = "more-openbsd-program-headers.patch"; - url = "https://github.com/llvm/llvm-project/commit/d7fd8b19e560fbb613159625acd8046d0df75115.patch"; - stripLen = 1; - hash = "sha256-7wTy7XDTx0+fhWQpW1KEuz7xJvpl42qMTUfd20KGOfA="; - } - ); + patches = [ + (getVersionFile "lld/gnu-install-dirs.patch") + ] + ++ lib.optional (lib.versions.major release_version == "14") ( + getVersionFile "lld/fix-root-src-dir.patch" + ) + ++ lib.optional (lib.versionAtLeast release_version "16" && lib.versionOlder release_version "18") ( + getVersionFile "lld/add-table-base.patch" + ) + ++ lib.optional (lib.versions.major release_version == "18") ( + # https://github.com/llvm/llvm-project/pull/97122 + fetchpatch { + name = "more-openbsd-program-headers.patch"; + url = "https://github.com/llvm/llvm-project/commit/d7fd8b19e560fbb613159625acd8046d0df75115.patch"; + stripLen = 1; + hash = "sha256-7wTy7XDTx0+fhWQpW1KEuz7xJvpl42qMTUfd20KGOfA="; + } + ); nativeBuildInputs = [ cmake ] ++ lib.optional (lib.versionAtLeast release_version "15") ninja; buildInputs = [ diff --git a/pkgs/development/compilers/llvm/common/lldb/default.nix b/pkgs/development/compilers/llvm/common/lldb/default.nix index 7dc2906cda0d..06ff51064060 100644 --- a/pkgs/development/compilers/llvm/common/lldb/default.nix +++ b/pkgs/development/compilers/llvm/common/lldb/default.nix @@ -132,103 +132,99 @@ stdenv.mkDerivation ( ) ++ lib.optional (lib.versionAtLeast release_version "14") ./gnu-install-dirs.patch; - nativeBuildInputs = - [ - cmake - python3 - which - swig - lit - makeWrapper - lua5_3 - ] - ++ lib.optionals enableManpages [ - python3.pkgs.sphinx - ] - ++ lib.optionals (lib.versionOlder release_version "18" && enableManpages) [ - python3.pkgs.recommonmark - ] - ++ lib.optionals (lib.versionAtLeast release_version "18" && enableManpages) [ - python3.pkgs.myst-parser - ] - ++ lib.optionals (lib.versionAtLeast release_version "14") [ - ninja - ]; + nativeBuildInputs = [ + cmake + python3 + which + swig + lit + makeWrapper + lua5_3 + ] + ++ lib.optionals enableManpages [ + python3.pkgs.sphinx + ] + ++ lib.optionals (lib.versionOlder release_version "18" && enableManpages) [ + python3.pkgs.recommonmark + ] + ++ lib.optionals (lib.versionAtLeast release_version "18" && enableManpages) [ + python3.pkgs.myst-parser + ] + ++ lib.optionals (lib.versionAtLeast release_version "14") [ + ninja + ]; - buildInputs = - [ - ncurses - zlib - libedit - libxml2 - libllvm - ] - ++ lib.optionals (lib.versionAtLeast release_version "16") [ - # Starting with LLVM 16, the resource dir patch is no longer enough to get - # libclang into the rpath of the lldb executables. By putting it into - # buildInputs cc-wrapper will set up rpath correctly for us. - (lib.getLib libclang) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.bootstrap_cmds - ]; + buildInputs = [ + ncurses + zlib + libedit + libxml2 + libllvm + ] + ++ lib.optionals (lib.versionAtLeast release_version "16") [ + # Starting with LLVM 16, the resource dir patch is no longer enough to get + # libclang into the rpath of the lldb executables. By putting it into + # buildInputs cc-wrapper will set up rpath correctly for us. + (lib.getLib libclang) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.bootstrap_cmds + ]; hardeningDisable = [ "format" ]; - cmakeFlags = + cmakeFlags = [ + (lib.cmakeBool "LLDB_INCLUDE_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "LLVM_ENABLE_RTTI" false) + (lib.cmakeFeature "Clang_DIR" "${lib.getDev libclang}/lib/cmake") + (lib.cmakeFeature "LLVM_EXTERNAL_LIT" "${lit}/bin/lit") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeBool "LLDB_USE_SYSTEM_DEBUGSERVER" true) + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + (lib.cmakeFeature "LLDB_CODESIGN_IDENTITY" "") # codesigning makes nondeterministic + ] + ++ lib.optionals (lib.versionAtLeast release_version "17") [ + (lib.cmakeFeature "CLANG_RESOURCE_DIR" "../../../../${lib.getLib libclang}") + ] + ++ lib.optionals enableManpages ( [ - (lib.cmakeBool "LLDB_INCLUDE_TESTS" finalAttrs.finalPackage.doCheck) - (lib.cmakeBool "LLVM_ENABLE_RTTI" false) - (lib.cmakeFeature "Clang_DIR" "${lib.getDev libclang}/lib/cmake") - (lib.cmakeFeature "LLVM_EXTERNAL_LIT" "${lit}/bin/lit") + (lib.cmakeBool "LLVM_ENABLE_SPHINX" true) + (lib.cmakeBool "SPHINX_OUTPUT_MAN" true) + (lib.cmakeBool "SPHINX_OUTPUT_HTML" false) ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeBool "LLDB_USE_SYSTEM_DEBUGSERVER" true) + ++ lib.optionals (lib.versionAtLeast release_version "15") [ + # docs reference `automodapi` but it's not added to the extensions list when + # only building the manpages: + # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 + # + # so, we just ignore the resulting errors + (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - (lib.cmakeFeature "LLDB_CODESIGN_IDENTITY" "") # codesigning makes nondeterministic - ] - ++ lib.optionals (lib.versionAtLeast release_version "17") [ - (lib.cmakeFeature "CLANG_RESOURCE_DIR" "../../../../${lib.getLib libclang}") - ] - ++ lib.optionals enableManpages ( - [ - (lib.cmakeBool "LLVM_ENABLE_SPHINX" true) - (lib.cmakeBool "SPHINX_OUTPUT_MAN" true) - (lib.cmakeBool "SPHINX_OUTPUT_HTML" false) - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - # docs reference `automodapi` but it's not added to the extensions list when - # only building the manpages: - # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 - # - # so, we just ignore the resulting errors - (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) - ] - ) - ++ lib.optionals finalAttrs.finalPackage.doCheck [ - (lib.cmakeFeature "LLDB_TEST_C_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc") - (lib.cmakeFeature "-DLLDB_TEST_CXX_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++") - ] - ++ devExtraCmakeFlags; + ) + ++ lib.optionals finalAttrs.finalPackage.doCheck [ + (lib.cmakeFeature "LLDB_TEST_C_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc") + (lib.cmakeFeature "-DLLDB_TEST_CXX_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++") + ] + ++ devExtraCmakeFlags; doCheck = false; doInstallCheck = lib.versionOlder release_version "15"; # TODO: cleanup with mass-rebuild - installCheckPhase = - '' - if [ ! -e ''${!outputLib}/${python3.sitePackages}/lldb/_lldb*.so ] ; then - echo "ERROR: python files not installed where expected!"; - return 1; - fi - '' # Something lua is built on older versions but this file doesn't exist. - + lib.optionalString (lib.versionAtLeast release_version "14") '' - if [ ! -e "''${!outputLib}/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then - echo "ERROR: lua files not installed where expected!"; - return 1; - fi - ''; + installCheckPhase = '' + if [ ! -e ''${!outputLib}/${python3.sitePackages}/lldb/_lldb*.so ] ; then + echo "ERROR: python files not installed where expected!"; + return 1; + fi + '' # Something lua is built on older versions but this file doesn't exist. + + lib.optionalString (lib.versionAtLeast release_version "14") '' + if [ ! -e "''${!outputLib}/lib/lua/${lua5_3.luaversion}/lldb.so" ] ; then + echo "ERROR: lua files not installed where expected!"; + return 1; + fi + ''; postInstall = '' wrapProgram $out/bin/lldb --prefix PYTHONPATH : ''${!outputLib}/${python3.sitePackages}/ diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index 519de80c8f8e..b25272ba5aad 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -296,31 +296,31 @@ stdenv.mkDerivation ( # Just like the `llvm-lit-cfg` patch, but for `polly`. (getVersionFile "llvm/polly-lit-cfg-add-libs-to-dylib-path.patch"); - nativeBuildInputs = - [ - cmake - # while this is not an autotools build, it still includes a config.guess - # this is needed until scripts are updated to not use /usr/bin/uname on FreeBSD native - updateAutotoolsGnuConfigScriptsHook - python - ] - ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) - ++ optionals enableManpages [ - # Note: we intentionally use `python3Packages` instead of `python3.pkgs`; - # splicing does *not* work with the latter. (TODO: fix) - python3Packages.sphinx - ] - ++ optionals (lib.versionOlder version "18" && enableManpages) [ - python3Packages.recommonmark - ] - ++ optionals (lib.versionAtLeast version "18" && enableManpages) [ - python3Packages.myst-parser - ]; + nativeBuildInputs = [ + cmake + # while this is not an autotools build, it still includes a config.guess + # this is needed until scripts are updated to not use /usr/bin/uname on FreeBSD native + updateAutotoolsGnuConfigScriptsHook + python + ] + ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) + ++ optionals enableManpages [ + # Note: we intentionally use `python3Packages` instead of `python3.pkgs`; + # splicing does *not* work with the latter. (TODO: fix) + python3Packages.sphinx + ] + ++ optionals (lib.versionOlder version "18" && enableManpages) [ + python3Packages.recommonmark + ] + ++ optionals (lib.versionAtLeast version "18" && enableManpages) [ + python3Packages.myst-parser + ]; buildInputs = [ libxml2 libffi - ] ++ optional enablePFM libpfm; # exegesis + ] + ++ optional enablePFM libpfm; # exegesis propagatedBuildInputs = (lib.optional ( @@ -682,41 +682,40 @@ stdenv.mkDerivation ( ] ++ devExtraCmakeFlags; - postInstall = - '' - mkdir -p $python/share - mv $out/share/opt-viewer $python/share/opt-viewer - moveToOutput "bin/llvm-config*" "$dev" - substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${lib.toLower finalAttrs.finalPackage.cmakeBuildType}.cmake" \ - --replace-fail "$out/bin/llvm-config" "$dev/bin/llvm-config" - '' - + ( - if lib.versionOlder release_version "15" then - '' - substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ - --replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' - '' - else - '' - substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ - --replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")' - '' - ) - + optionalString (stdenv.hostPlatform.isDarwin && enableSharedLibraries) '' - ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${ - if lib.versionOlder release_version "18" then "$shortVersion" else release_version - }.dylib - '' - + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ( - if stdenv.buildPlatform.canExecute stdenv.hostPlatform then - '' - ln -s $dev/bin/llvm-config $dev/bin/llvm-config-native - '' - else - '' - cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native - '' - ); + postInstall = '' + mkdir -p $python/share + mv $out/share/opt-viewer $python/share/opt-viewer + moveToOutput "bin/llvm-config*" "$dev" + substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${lib.toLower finalAttrs.finalPackage.cmakeBuildType}.cmake" \ + --replace-fail "$out/bin/llvm-config" "$dev/bin/llvm-config" + '' + + ( + if lib.versionOlder release_version "15" then + '' + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}'"$lib"'")' + '' + else + '' + substituteInPlace "$dev/lib/cmake/llvm/LLVMConfig.cmake" \ + --replace-fail 'set(LLVM_BINARY_DIR "''${LLVM_INSTALL_PREFIX}")' 'set(LLVM_BINARY_DIR "'"$lib"'")' + '' + ) + + optionalString (stdenv.hostPlatform.isDarwin && enableSharedLibraries) '' + ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${ + if lib.versionOlder release_version "18" then "$shortVersion" else release_version + }.dylib + '' + + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ( + if stdenv.buildPlatform.canExecute stdenv.hostPlatform then + '' + ln -s $dev/bin/llvm-config $dev/bin/llvm-config-native + '' + else + '' + cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native + '' + ); doCheck = !isDarwinBootstrap @@ -795,7 +794,8 @@ stdenv.mkDerivation ( // lib.optionalAttrs (lib.versionAtLeast release_version "13") { nativeCheckInputs = [ which - ] ++ lib.optional (stdenv.hostPlatform.isDarwin && lib.versionAtLeast release_version "15") sysctl; + ] + ++ lib.optional (stdenv.hostPlatform.isDarwin && lib.versionAtLeast release_version "15") sysctl; } // lib.optionalAttrs (lib.versionOlder release_version "15") { # hacky fix: created binaries need to be run before installation diff --git a/pkgs/development/compilers/llvm/common/mlir/default.nix b/pkgs/development/compilers/llvm/common/mlir/default.nix index 66441232d968..d0ebf9bde2c5 100644 --- a/pkgs/development/compilers/llvm/common/mlir/default.nix +++ b/pkgs/development/compilers/llvm/common/mlir/default.nix @@ -56,31 +56,30 @@ stdenv.mkDerivation (finalAttrs: { libxml2 ]; - cmakeFlags = - [ - (lib.cmakeBool "LLVM_BUILD_TOOLS" true) - # Install headers as well - (lib.cmakeBool "LLVM_INSTALL_TOOLCHAIN_ONLY" false) - (lib.cmakeFeature "MLIR_TOOLS_INSTALL_DIR" "${placeholder "out"}/bin/") - (lib.cmakeBool "LLVM_ENABLE_IDE" false) - (lib.cmakeFeature "MLIR_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/mlir") - (lib.cmakeFeature "MLIR_INSTALL_CMAKE_DIR" "${placeholder "dev"}/lib/cmake/mlir") - (lib.cmakeBool "LLVM_BUILD_TESTS" finalAttrs.finalPackage.doCheck) - (lib.cmakeBool "LLVM_ENABLE_FFI" true) - (lib.cmakeFeature "LLVM_HOST_TRIPLE" stdenv.hostPlatform.config) - (lib.cmakeFeature "LLVM_DEFAULT_TARGET_TRIPLE" stdenv.hostPlatform.config) - (lib.cmakeBool "LLVM_ENABLE_DUMP" true) - (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") - (lib.cmakeFeature "MLIR_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/mlir-tblgen") - (lib.cmakeBool "LLVM_BUILD_LLVM_DYLIB" (!stdenv.hostPlatform.isStatic)) - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - # Disables building of shared libs, -fPIC is still injected by cc-wrapper - (lib.cmakeBool "LLVM_ENABLE_PIC" false) - (lib.cmakeBool "LLVM_BUILD_STATIC" true) - (lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" false) - ] - ++ devExtraCmakeFlags; + cmakeFlags = [ + (lib.cmakeBool "LLVM_BUILD_TOOLS" true) + # Install headers as well + (lib.cmakeBool "LLVM_INSTALL_TOOLCHAIN_ONLY" false) + (lib.cmakeFeature "MLIR_TOOLS_INSTALL_DIR" "${placeholder "out"}/bin/") + (lib.cmakeBool "LLVM_ENABLE_IDE" false) + (lib.cmakeFeature "MLIR_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/mlir") + (lib.cmakeFeature "MLIR_INSTALL_CMAKE_DIR" "${placeholder "dev"}/lib/cmake/mlir") + (lib.cmakeBool "LLVM_BUILD_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "LLVM_ENABLE_FFI" true) + (lib.cmakeFeature "LLVM_HOST_TRIPLE" stdenv.hostPlatform.config) + (lib.cmakeFeature "LLVM_DEFAULT_TARGET_TRIPLE" stdenv.hostPlatform.config) + (lib.cmakeBool "LLVM_ENABLE_DUMP" true) + (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") + (lib.cmakeFeature "MLIR_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/mlir-tblgen") + (lib.cmakeBool "LLVM_BUILD_LLVM_DYLIB" (!stdenv.hostPlatform.isStatic)) + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + # Disables building of shared libs, -fPIC is still injected by cc-wrapper + (lib.cmakeBool "LLVM_ENABLE_PIC" false) + (lib.cmakeBool "LLVM_BUILD_STATIC" true) + (lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" false) + ] + ++ devExtraCmakeFlags; outputs = [ "out" diff --git a/pkgs/development/compilers/llvm/common/openmp/default.nix b/pkgs/development/compilers/llvm/common/openmp/default.nix index d1ff3ea5879c..d480b33a6025 100644 --- a/pkgs/development/compilers/llvm/common/openmp/default.nix +++ b/pkgs/development/compilers/llvm/common/openmp/default.nix @@ -73,45 +73,42 @@ stdenv.mkDerivation ( } ); - nativeBuildInputs = - [ - cmake - python3.pythonOnBuildForHost - perl - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - ninja - ] - ++ lib.optionals (lib.versionAtLeast release_version "14") [ - pkg-config - lit - ]; + nativeBuildInputs = [ + cmake + python3.pythonOnBuildForHost + perl + ] + ++ lib.optionals (lib.versionAtLeast release_version "15") [ + ninja + ] + ++ lib.optionals (lib.versionAtLeast release_version "14") [ + pkg-config + lit + ]; - buildInputs = - [ - (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) - ] - ++ lib.optionals (ompdSupport && ompdGdbSupport) [ - python3 - ]; + buildInputs = [ + (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) + ] + ++ lib.optionals (ompdSupport && ompdGdbSupport) [ + python3 + ]; - cmakeFlags = - [ - (lib.cmakeBool "LIBOMP_ENABLE_SHARED" ( - !stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries - )) - (lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport) - (lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport) - ] - ++ lib.optionals (lib.versions.major release_version == "13") [ - (lib.cmakeBool "LIBOMPTARGET_BUILD_AMDGCN_BCLIB" false) # Building the AMDGCN device RTL fails - ] - ++ lib.optionals (lib.versionAtLeast release_version "14") [ - (lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang") - (lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt") - (lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link") - ] - ++ devExtraCmakeFlags; + cmakeFlags = [ + (lib.cmakeBool "LIBOMP_ENABLE_SHARED" ( + !stdenv.hostPlatform.isStatic && stdenv.hostPlatform.hasSharedLibraries + )) + (lib.cmakeBool "LIBOMP_OMPD_SUPPORT" ompdSupport) + (lib.cmakeBool "LIBOMP_OMPD_GDB_SUPPORT" ompdGdbSupport) + ] + ++ lib.optionals (lib.versions.major release_version == "13") [ + (lib.cmakeBool "LIBOMPTARGET_BUILD_AMDGCN_BCLIB" false) # Building the AMDGCN device RTL fails + ] + ++ lib.optionals (lib.versionAtLeast release_version "14") [ + (lib.cmakeFeature "CLANG_TOOL" "${clang-unwrapped}/bin/clang") + (lib.cmakeFeature "OPT_TOOL" "${llvm}/bin/opt") + (lib.cmakeFeature "LINK_TOOL" "${llvm}/bin/llvm-link") + ] + ++ devExtraCmakeFlags; meta = llvm_meta // { homepage = "https://openmp.llvm.org/"; diff --git a/pkgs/development/compilers/llvm/common/tblgen.nix b/pkgs/development/compilers/llvm/common/tblgen.nix index f6445df64747..beebce95d021 100644 --- a/pkgs/development/compilers/llvm/common/tblgen.nix +++ b/pkgs/development/compilers/llvm/common/tblgen.nix @@ -97,25 +97,25 @@ let ] ) }" - ] ++ devExtraCmakeFlags; + ] + ++ devExtraCmakeFlags; # List of tablegen targets. - ninjaFlags = - [ - "clang-tblgen" - "llvm-tblgen" - ] - ++ lib.optionals (lib.versionAtLeast release_version "15") [ - "clang-tidy-confusable-chars-gen" - ] - ++ lib.optionals (lib.versionAtLeast release_version "16") [ - "mlir-tblgen" - ] - ++ - lib.optionals ((lib.versionAtLeast release_version "15") && (lib.versionOlder release_version "20")) - [ - "clang-pseudo-gen" # Removed in LLVM 20 @ ed8f78827895050442f544edef2933a60d4a7935. - ]; + ninjaFlags = [ + "clang-tblgen" + "llvm-tblgen" + ] + ++ lib.optionals (lib.versionAtLeast release_version "15") [ + "clang-tidy-confusable-chars-gen" + ] + ++ lib.optionals (lib.versionAtLeast release_version "16") [ + "mlir-tblgen" + ] + ++ + lib.optionals ((lib.versionAtLeast release_version "15") && (lib.versionOlder release_version "20")) + [ + "clang-pseudo-gen" # Removed in LLVM 20 @ ed8f78827895050442f544edef2933a60d4a7935. + ]; installPhase = '' mkdir -p $out diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index 9d9bcaa9d1b8..2721bf24f56f 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -38,7 +38,8 @@ let rev-version = "22.0.0-unstable-2025-07-20"; sha256 = "sha256-rMiPa8T2n0IWtOv0SYb+eWWHRfPTBGEb4yCp11gVzRE="; }; - } // llvmVersions; + } + // llvmVersions; mkPackage = { diff --git a/pkgs/development/compilers/mlton/20130715.nix b/pkgs/development/compilers/mlton/20130715.nix index 6cf88e34b57d..3dccdf218905 100644 --- a/pkgs/development/compilers/mlton/20130715.nix +++ b/pkgs/development/compilers/mlton/20130715.nix @@ -54,61 +54,59 @@ stdenv.mkDerivation rec { makeFlags = [ "all-no-docs" ]; - configurePhase = - '' - # Fix paths in the source. - find . -type f | grep -v -e '\.tgz''$' | xargs sed -i "s@/usr/bin/env bash@$(type -p bash)@" + configurePhase = '' + # Fix paths in the source. + find . -type f | grep -v -e '\.tgz''$' | xargs sed -i "s@/usr/bin/env bash@$(type -p bash)@" - substituteInPlace $(pwd)/Makefile --replace '/bin/cp' $(type -p cp) - substituteInPlace bin/mlton-script --replace gcc cc - substituteInPlace bin/regression --replace gcc cc - substituteInPlace lib/mlnlffi-lib/Makefile --replace gcc cc - substituteInPlace mlnlffigen/gen-cppcmd --replace gcc cc - substituteInPlace runtime/Makefile --replace gcc cc - substituteInPlace ../${usr_prefix}/bin/mlton --replace gcc cc + substituteInPlace $(pwd)/Makefile --replace '/bin/cp' $(type -p cp) + substituteInPlace bin/mlton-script --replace gcc cc + substituteInPlace bin/regression --replace gcc cc + substituteInPlace lib/mlnlffi-lib/Makefile --replace gcc cc + substituteInPlace mlnlffigen/gen-cppcmd --replace gcc cc + substituteInPlace runtime/Makefile --replace gcc cc + substituteInPlace ../${usr_prefix}/bin/mlton --replace gcc cc - # Fix paths in the binary distribution. - BIN_DIST_DIR="$(pwd)/../${usr_prefix}" - for f in "bin/mlton" "lib/mlton/platform" "lib/mlton/static-library" ; do - substituteInPlace "$BIN_DIST_DIR/$f" --replace '/${usr_prefix}/bin/env bash' $(type -p bash) - done + # Fix paths in the binary distribution. + BIN_DIST_DIR="$(pwd)/../${usr_prefix}" + for f in "bin/mlton" "lib/mlton/platform" "lib/mlton/static-library" ; do + substituteInPlace "$BIN_DIST_DIR/$f" --replace '/${usr_prefix}/bin/env bash' $(type -p bash) + done - substituteInPlace $(pwd)/../${usr_prefix}/bin/mlton --replace '/${usr_prefix}/lib/mlton' $(pwd)/../${usr_prefix}/lib/mlton - '' - + lib.optionalString stdenv.cc.isClang '' - sed -i "s_ patch -s -p0 Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. - postInstall = - '' - echo "Updating Mono key store" - $out/bin/cert-sync ${cacert}/etc/ssl/certs/ca-bundle.crt - '' - # According to [1], gmcs is just mcs - # [1] https://github.com/mono/mono/blob/master/scripts/gmcs.in - + '' - ln -s $out/bin/mcs $out/bin/gmcs - ''; + postInstall = '' + echo "Updating Mono key store" + $out/bin/cert-sync ${cacert}/etc/ssl/certs/ca-bundle.crt + '' + # According to [1], gmcs is just mcs + # [1] https://github.com/mono/mono/blob/master/scripts/gmcs.in + + '' + ln -s $out/bin/mcs $out/bin/gmcs + ''; inherit enableParallelBuilding; diff --git a/pkgs/development/compilers/obliv-c/default.nix b/pkgs/development/compilers/obliv-c/default.nix index 00d38215ff1e..2f6777a0b556 100644 --- a/pkgs/development/compilers/obliv-c/default.nix +++ b/pkgs/development/compilers/obliv-c/default.nix @@ -12,13 +12,14 @@ stdenv.mkDerivation { version = "0.0pre20210621"; strictDeps = true; - nativeBuildInputs = - [ perl ] - ++ (with ocamlPackages; [ - ocaml - findlib - ocamlbuild - ]); + nativeBuildInputs = [ + perl + ] + ++ (with ocamlPackages; [ + ocaml + findlib + ocamlbuild + ]); buildInputs = [ ocamlPackages.num ]; propagatedBuildInputs = [ libgcrypt ]; src = fetchFromGitHub { diff --git a/pkgs/development/compilers/ocaml/4.00.1.nix b/pkgs/development/compilers/ocaml/4.00.1.nix index 337bf3c4dafd..e6b80294592f 100644 --- a/pkgs/development/compilers/ocaml/4.00.1.nix +++ b/pkgs/development/compilers/ocaml/4.00.1.nix @@ -37,18 +37,20 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = "-fcommon"; prefixKey = "-prefix "; - configureFlags = - [ "-no-tk" ] - ++ optionals useX11 [ - "-x11lib" - libX11 - ]; - buildFlags = - [ "world" ] - ++ optionals useNativeCompilers [ - "bootstrap" - "world.opt" - ]; + configureFlags = [ + "-no-tk" + ] + ++ optionals useX11 [ + "-x11lib" + libX11 + ]; + buildFlags = [ + "world" + ] + ++ optionals useNativeCompilers [ + "bootstrap" + "world.opt" + ]; buildInputs = [ ncurses ] ++ optionals useX11 [ libX11 ]; installTargets = "install" + optionalString useNativeCompilers " installopt"; preConfigure = '' diff --git a/pkgs/development/compilers/open-watcom/v2.nix b/pkgs/development/compilers/open-watcom/v2.nix index 2d4761b382f2..8850afddbd29 100644 --- a/pkgs/development/compilers/open-watcom/v2.nix +++ b/pkgs/development/compilers/open-watcom/v2.nix @@ -23,34 +23,32 @@ stdenv.mkDerivation rec { hash = "sha256-9NNJcDHxOo+NKZraGqsHqK5whO3nL0QTeh+imzhThTg="; }; - postPatch = - '' - patchShebangs *.sh + postPatch = '' + patchShebangs *.sh - for dateSource in bld/wipfc/configure; do - substituteInPlace $dateSource \ - --replace-fail '`date ' '`date -ud "@$SOURCE_DATE_EPOCH" ' - done + for dateSource in bld/wipfc/configure; do + substituteInPlace $dateSource \ + --replace-fail '`date ' '`date -ud "@$SOURCE_DATE_EPOCH" ' + done - substituteInPlace bld/watcom/h/banner.h \ - --replace-fail '__DATE__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%b %d %Y')\"" \ - --replace-fail '__TIME__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%T')\"" + substituteInPlace bld/watcom/h/banner.h \ + --replace-fail '__DATE__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%b %d %Y')\"" \ + --replace-fail '__TIME__' "\"$(date -ud "@$SOURCE_DATE_EPOCH" +'%T')\"" - substituteInPlace build/makeinit \ - --replace-fail '$+$(%__CYEAR__)$-' "$(date -ud "@$SOURCE_DATE_EPOCH" +'%Y')" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - substituteInPlace build/mif/local.mif \ - --replace-fail '-static' "" - ''; + substituteInPlace build/makeinit \ + --replace-fail '$+$(%__CYEAR__)$-' "$(date -ud "@$SOURCE_DATE_EPOCH" +'%Y')" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + substituteInPlace build/mif/local.mif \ + --replace-fail '-static' "" + ''; - nativeBuildInputs = - [ - dosbox - ] - ++ lib.optionals withDocs [ - ghostscript - ]; + nativeBuildInputs = [ + dosbox + ] + ++ lib.optionals withDocs [ + ghostscript + ]; configurePhase = '' runHook preConfigure @@ -101,35 +99,34 @@ stdenv.mkDerivation rec { meta = with lib; { description = "V2 fork of the Open Watcom suite of compilers and tools"; - longDescription = - '' - A fork of Open Watcom: A C/C++/Fortran compiler and assembler suite - targeting a multitude of architectures (x86, IA-32, Alpha AXP, MIPS, - PowerPC) and operating systems (DOS, OS/2, Windows, Linux). + longDescription = '' + A fork of Open Watcom: A C/C++/Fortran compiler and assembler suite + targeting a multitude of architectures (x86, IA-32, Alpha AXP, MIPS, + PowerPC) and operating systems (DOS, OS/2, Windows, Linux). - Main differences from Open Watcom 1.9: + Main differences from Open Watcom 1.9: - - New two-phase build system - Open Watcom can be built by the host's - native C/C++ compiler or by itself - - Code generator properly initializes pointers by DLL symbol addresses - - DOS tools now support long file names (LFN) if appropriate LFN driver - is loaded by DOS - - Open Watcom is ported to 64-bit hosts (Win64, Linux x64) - - Librarian supports x64 CPU object modules and libraries - - RDOS 32-bit C run-time compact memory model libraries are fixed - - Resource compiler and Resource editors support Win64 executables - - Open Watcom text editor is now self-contained, it can be used as - standalone tool without any requirements for any additional files or - configuration - - Broken C++ compiler pre-compiled header template support is fixed - - Many C++ compiler crashes are fixed - - Debugger has no length limit for any used environment variable - '' - + lib.optionalString (!withDocs) '' + - New two-phase build system - Open Watcom can be built by the host's + native C/C++ compiler or by itself + - Code generator properly initializes pointers by DLL symbol addresses + - DOS tools now support long file names (LFN) if appropriate LFN driver + is loaded by DOS + - Open Watcom is ported to 64-bit hosts (Win64, Linux x64) + - Librarian supports x64 CPU object modules and libraries + - RDOS 32-bit C run-time compact memory model libraries are fixed + - Resource compiler and Resource editors support Win64 executables + - Open Watcom text editor is now self-contained, it can be used as + standalone tool without any requirements for any additional files or + configuration + - Broken C++ compiler pre-compiled header template support is fixed + - Many C++ compiler crashes are fixed + - Debugger has no length limit for any used environment variable + '' + + lib.optionalString (!withDocs) '' - The documentation has been excluded from this build for build time reasons. It can be found here: - https://github.com/open-watcom/open-watcom-v2/wiki/Open-Watcom-Documentation - ''; + The documentation has been excluded from this build for build time reasons. It can be found here: + https://github.com/open-watcom/open-watcom-v2/wiki/Open-Watcom-Documentation + ''; homepage = "https://open-watcom.github.io"; license = licenses.watcom; platforms = with platforms; windows ++ unix; diff --git a/pkgs/development/compilers/openjdk/generic.nix b/pkgs/development/compilers/openjdk/generic.nix index 3daca22c905d..ef3a32eff46f 100644 --- a/pkgs/development/compilers/openjdk/generic.nix +++ b/pkgs/development/compilers/openjdk/generic.nix @@ -136,192 +136,188 @@ stdenv.mkDerivation (finalAttrs: { pname = "openjdk" + lib.optionalString headless "-headless"; inherit version; - outputs = - [ - "out" - ] - ++ lib.optionals (!atLeast11) [ - "jre" - ]; + outputs = [ + "out" + ] + ++ lib.optionals (!atLeast11) [ + "jre" + ]; inherit (source) src; - patches = - [ - ( - if atLeast24 then - ./24/patches/fix-java-home-jdk24.patch - else if atLeast21 then - ./21/patches/fix-java-home-jdk21.patch - else if atLeast11 then - ./11/patches/fix-java-home-jdk10.patch - else - ./8/patches/fix-java-home-jdk8.patch - ) - ( - if atLeast24 then - ./24/patches/read-truststore-from-env-jdk24.patch - else if atLeast11 then - ./11/patches/read-truststore-from-env-jdk10.patch - else - ./8/patches/read-truststore-from-env-jdk8.patch - ) - ] - ++ lib.optionals (!atLeast23) [ - ( - if atLeast11 then - ./11/patches/currency-date-range-jdk10.patch - else - ./8/patches/currency-date-range-jdk8.patch - ) - ] - ++ lib.optionals atLeast11 [ - ( - if atLeast17 then - ./17/patches/increase-javadoc-heap-jdk13.patch - else - ./11/patches/increase-javadoc-heap.patch - ) - ] - ++ lib.optionals atLeast17 [ - ( - if atLeast21 then - ./21/patches/ignore-LegalNoticeFilePlugin-jdk18.patch - else - ./17/patches/ignore-LegalNoticeFilePlugin-jdk17.patch - ) - ] - ++ lib.optionals (!atLeast21) [ - ( - if atLeast17 then - ./17/patches/fix-library-path-jdk17.patch - else if atLeast11 then - ./11/patches/fix-library-path-jdk11.patch - else - ./8/patches/fix-library-path-jdk8.patch - ) - ] - ++ lib.optionals (atLeast17 && !atLeast23) [ - # -Wformat etc. are stricter in newer gccs, per - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79677 - # so grab the work-around from - # https://src.fedoraproject.org/rpms/java-openjdk/pull-request/24 - (fetchurl { - url = "https://src.fedoraproject.org/rpms/java-openjdk/raw/06c001c7d87f2e9fe4fedeef2d993bcd5d7afa2a/f/rh1673833-remove_removal_of_wformat_during_test_compilation.patch"; - sha256 = "082lmc30x64x583vqq00c8y0wqih3y4r0mp1c4bqq36l22qv6b6r"; - }) - ] - ++ lib.optionals (featureVersion == "17") [ - # Patch borrowed from Alpine to fix build errors with musl libc and recent gcc. - # This is applied anywhere to prevent patchrot. - (fetchurl { - url = "https://git.alpinelinux.org/aports/plain/community/openjdk17/FixNullPtrCast.patch?id=41e78a067953e0b13d062d632bae6c4f8028d91c"; - sha256 = "sha256-LzmSew51+DyqqGyyMw2fbXeBluCiCYsS1nCjt9hX6zo="; - }) - ] - ++ lib.optionals atLeast11 [ - # Fix build for gnumake-4.4.1: - # https://github.com/openjdk/jdk/pull/12992 - (fetchpatch { - name = "gnumake-4.4.1"; - url = "https://github.com/openjdk/jdk/commit/9341d135b855cc208d48e47d30cd90aafa354c36.patch"; - hash = "sha256-Qcm3ZmGCOYLZcskNjj7DYR85R4v07vYvvavrVOYL8vg="; - }) - ] - ++ lib.optionals (!headless && enableGtk) [ - ( - if atLeast17 then - ./17/patches/swing-use-gtk-jdk13.patch - else if atLeast11 then - ./11/patches/swing-use-gtk-jdk10.patch - else - ./8/patches/swing-use-gtk-jdk8.patch - ) - ]; + patches = [ + ( + if atLeast24 then + ./24/patches/fix-java-home-jdk24.patch + else if atLeast21 then + ./21/patches/fix-java-home-jdk21.patch + else if atLeast11 then + ./11/patches/fix-java-home-jdk10.patch + else + ./8/patches/fix-java-home-jdk8.patch + ) + ( + if atLeast24 then + ./24/patches/read-truststore-from-env-jdk24.patch + else if atLeast11 then + ./11/patches/read-truststore-from-env-jdk10.patch + else + ./8/patches/read-truststore-from-env-jdk8.patch + ) + ] + ++ lib.optionals (!atLeast23) [ + ( + if atLeast11 then + ./11/patches/currency-date-range-jdk10.patch + else + ./8/patches/currency-date-range-jdk8.patch + ) + ] + ++ lib.optionals atLeast11 [ + ( + if atLeast17 then + ./17/patches/increase-javadoc-heap-jdk13.patch + else + ./11/patches/increase-javadoc-heap.patch + ) + ] + ++ lib.optionals atLeast17 [ + ( + if atLeast21 then + ./21/patches/ignore-LegalNoticeFilePlugin-jdk18.patch + else + ./17/patches/ignore-LegalNoticeFilePlugin-jdk17.patch + ) + ] + ++ lib.optionals (!atLeast21) [ + ( + if atLeast17 then + ./17/patches/fix-library-path-jdk17.patch + else if atLeast11 then + ./11/patches/fix-library-path-jdk11.patch + else + ./8/patches/fix-library-path-jdk8.patch + ) + ] + ++ lib.optionals (atLeast17 && !atLeast23) [ + # -Wformat etc. are stricter in newer gccs, per + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79677 + # so grab the work-around from + # https://src.fedoraproject.org/rpms/java-openjdk/pull-request/24 + (fetchurl { + url = "https://src.fedoraproject.org/rpms/java-openjdk/raw/06c001c7d87f2e9fe4fedeef2d993bcd5d7afa2a/f/rh1673833-remove_removal_of_wformat_during_test_compilation.patch"; + sha256 = "082lmc30x64x583vqq00c8y0wqih3y4r0mp1c4bqq36l22qv6b6r"; + }) + ] + ++ lib.optionals (featureVersion == "17") [ + # Patch borrowed from Alpine to fix build errors with musl libc and recent gcc. + # This is applied anywhere to prevent patchrot. + (fetchurl { + url = "https://git.alpinelinux.org/aports/plain/community/openjdk17/FixNullPtrCast.patch?id=41e78a067953e0b13d062d632bae6c4f8028d91c"; + sha256 = "sha256-LzmSew51+DyqqGyyMw2fbXeBluCiCYsS1nCjt9hX6zo="; + }) + ] + ++ lib.optionals atLeast11 [ + # Fix build for gnumake-4.4.1: + # https://github.com/openjdk/jdk/pull/12992 + (fetchpatch { + name = "gnumake-4.4.1"; + url = "https://github.com/openjdk/jdk/commit/9341d135b855cc208d48e47d30cd90aafa354c36.patch"; + hash = "sha256-Qcm3ZmGCOYLZcskNjj7DYR85R4v07vYvvavrVOYL8vg="; + }) + ] + ++ lib.optionals (!headless && enableGtk) [ + ( + if atLeast17 then + ./17/patches/swing-use-gtk-jdk13.patch + else if atLeast11 then + ./11/patches/swing-use-gtk-jdk10.patch + else + ./8/patches/swing-use-gtk-jdk8.patch + ) + ]; strictDeps = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals atLeast11 [ - autoconf - ] - ++ lib.optionals (!atLeast11) [ - lndir - # Certificates generated using perl in `installPhase` - perl - ] - ++ lib.optionals (!atLeast11 && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - # Certificates generated using keytool in `installPhase` - buildPackages.jdk8 - ] - ++ [ - unzip - zip - which - # Probably for BUILD_CC but not sure, not in closure. - zlib - ] - ++ lib.optionals atLeast21 [ - ensureNewerSourcesForZipFilesHook - ] - ++ lib.optionals atLeast24 [ - pandoc - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals atLeast11 [ + autoconf + ] + ++ lib.optionals (!atLeast11) [ + lndir + # Certificates generated using perl in `installPhase` + perl + ] + ++ lib.optionals (!atLeast11 && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # Certificates generated using keytool in `installPhase` + buildPackages.jdk8 + ] + ++ [ + unzip + zip + which + # Probably for BUILD_CC but not sure, not in closure. + zlib + ] + ++ lib.optionals atLeast21 [ + ensureNewerSourcesForZipFilesHook + ] + ++ lib.optionals atLeast24 [ + pandoc + ]; - buildInputs = - [ - # TODO: Many of these should likely be in `nativeBuildInputs`. - cpio - # `-lmagic` in NIX_LDFLAGS - file - cups - freetype - ] - ++ lib.optionals (atLeast11 && !atLeast21) [ - harfbuzz - ] - ++ [ - alsa-lib - libjpeg - giflib - ] - ++ lib.optionals atLeast11 [ - libpng - zlib # duplicate - lcms2 - ] - ++ [ - libX11 - libICE - ] - ++ lib.optionals (!atLeast11) [ - libXext - ] - ++ [ - libXrender - ] - ++ lib.optionals atLeast11 [ - libXext - ] - ++ [ - libXtst - libXt - libXtst # duplicate - libXi - libXinerama - libXcursor - libXrandr - fontconfig - ] - ++ lib.optionals (!headless && enableGtk) [ - (if atLeast11 then gtk3 else gtk2) - glib - ]; + buildInputs = [ + # TODO: Many of these should likely be in `nativeBuildInputs`. + cpio + # `-lmagic` in NIX_LDFLAGS + file + cups + freetype + ] + ++ lib.optionals (atLeast11 && !atLeast21) [ + harfbuzz + ] + ++ [ + alsa-lib + libjpeg + giflib + ] + ++ lib.optionals atLeast11 [ + libpng + zlib # duplicate + lcms2 + ] + ++ [ + libX11 + libICE + ] + ++ lib.optionals (!atLeast11) [ + libXext + ] + ++ [ + libXrender + ] + ++ lib.optionals atLeast11 [ + libXext + ] + ++ [ + libXtst + libXt + libXtst # duplicate + libXi + libXinerama + libXcursor + libXrandr + fontconfig + ] + ++ lib.optionals (!headless && enableGtk) [ + (if atLeast11 then gtk3 else gtk2) + glib + ]; propagatedBuildInputs = lib.optionals (!atLeast11) [ setJavaClassPath ]; @@ -338,92 +334,91 @@ stdenv.mkDerivation (finalAttrs: { ]; # https://openjdk.org/groups/build/doc/building.html - configureFlags = - [ - "--with-boot-jdk=${jdk-bootstrap'.home}" - # https://github.com/openjdk/jdk/blob/471f112bca715d04304cbe35c6ed63df8c7b7fee/make/autoconf/util_paths.m4#L315 - # Ignoring value of READELF from the environment. Use command line variables instead. - "READELF=${stdenv.cc.targetPrefix}readelf" - "AR=${stdenv.cc.targetPrefix}ar" - "STRIP=${stdenv.cc.targetPrefix}strip" - "NM=${stdenv.cc.targetPrefix}nm" - "OBJDUMP=${stdenv.cc.targetPrefix}objdump" - "OBJCOPY=${stdenv.cc.targetPrefix}objcopy" - ] - ++ ( - if atLeast23 then - [ - "--with-version-string=${version}" - "--with-vendor-version-string=(nix)" - ] - else if atLeast11 then - lib.optionals atLeast17 [ - "--with-version-build=${versionBuild}" - "--with-version-opt=nixos" - ] - ++ [ - "--with-version-pre=" - ] - else - [ - "--with-update-version=${lib.removePrefix "${featureVersion}u" (lib.elemAt versionSplit 0)}" - "--with-build-number=${versionBuild}" - "--with-milestone=fcs" - ] - ) - ++ [ - "--enable-unlimited-crypto" - "--with-native-debug-symbols=internal" - ] - ++ lib.optionals (!atLeast21) ( - if atLeast11 then - [ - "--with-freetype=system" - "--with-harfbuzz=system" - ] - else - [ - "--disable-freetype-bundling" - ] - ) - ++ ( - if atLeast11 then - [ - "--with-libjpeg=system" - "--with-giflib=system" - "--with-libpng=system" - "--with-zlib=system" - "--with-lcms=system" - ] - else - [ - "--with-zlib=system" - "--with-giflib=system" - ] - ) - ++ [ - "--with-stdc++lib=dynamic" - ] - ++ lib.optionals (featureVersion == "11") [ - "--disable-warnings-as-errors" - ] - # OpenJDK 11 cannot be built by recent versions of Clang, as far as I can tell (see - # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260319). Known to - # compile with LLVM 12. - ++ lib.optionals (atLeast11 && stdenv.cc.isClang) [ - "--with-toolchain-type=clang" - # Explicitly tell Clang to compile C++ files as C++, see - # https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859 - "--with-extra-cxxflags=-xc++" - ] - # This probably shouldn’t apply to OpenJDK 21; see - # b7e68243306833845cbf92e2ea1e0cf782481a51 which removed it for - # versions 15 through 20. - ++ lib.optional ( - (featureVersion == "11" || featureVersion == "21") && stdenv.hostPlatform.isx86_64 - ) "--with-jvm-features=zgc" - ++ lib.optional headless (if atLeast11 then "--enable-headless-only" else "--disable-headful") - ++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx_jdk}"; + configureFlags = [ + "--with-boot-jdk=${jdk-bootstrap'.home}" + # https://github.com/openjdk/jdk/blob/471f112bca715d04304cbe35c6ed63df8c7b7fee/make/autoconf/util_paths.m4#L315 + # Ignoring value of READELF from the environment. Use command line variables instead. + "READELF=${stdenv.cc.targetPrefix}readelf" + "AR=${stdenv.cc.targetPrefix}ar" + "STRIP=${stdenv.cc.targetPrefix}strip" + "NM=${stdenv.cc.targetPrefix}nm" + "OBJDUMP=${stdenv.cc.targetPrefix}objdump" + "OBJCOPY=${stdenv.cc.targetPrefix}objcopy" + ] + ++ ( + if atLeast23 then + [ + "--with-version-string=${version}" + "--with-vendor-version-string=(nix)" + ] + else if atLeast11 then + lib.optionals atLeast17 [ + "--with-version-build=${versionBuild}" + "--with-version-opt=nixos" + ] + ++ [ + "--with-version-pre=" + ] + else + [ + "--with-update-version=${lib.removePrefix "${featureVersion}u" (lib.elemAt versionSplit 0)}" + "--with-build-number=${versionBuild}" + "--with-milestone=fcs" + ] + ) + ++ [ + "--enable-unlimited-crypto" + "--with-native-debug-symbols=internal" + ] + ++ lib.optionals (!atLeast21) ( + if atLeast11 then + [ + "--with-freetype=system" + "--with-harfbuzz=system" + ] + else + [ + "--disable-freetype-bundling" + ] + ) + ++ ( + if atLeast11 then + [ + "--with-libjpeg=system" + "--with-giflib=system" + "--with-libpng=system" + "--with-zlib=system" + "--with-lcms=system" + ] + else + [ + "--with-zlib=system" + "--with-giflib=system" + ] + ) + ++ [ + "--with-stdc++lib=dynamic" + ] + ++ lib.optionals (featureVersion == "11") [ + "--disable-warnings-as-errors" + ] + # OpenJDK 11 cannot be built by recent versions of Clang, as far as I can tell (see + # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260319). Known to + # compile with LLVM 12. + ++ lib.optionals (atLeast11 && stdenv.cc.isClang) [ + "--with-toolchain-type=clang" + # Explicitly tell Clang to compile C++ files as C++, see + # https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859 + "--with-extra-cxxflags=-xc++" + ] + # This probably shouldn’t apply to OpenJDK 21; see + # b7e68243306833845cbf92e2ea1e0cf782481a51 which removed it for + # versions 15 through 20. + ++ lib.optional ( + (featureVersion == "11" || featureVersion == "21") && stdenv.hostPlatform.isx86_64 + ) "--with-jvm-features=zgc" + ++ lib.optional headless (if atLeast11 then "--enable-headless-only" else "--disable-headful") + ++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx_jdk}"; buildFlags = if atLeast17 then [ "images" ] else [ "all" ]; @@ -436,56 +431,55 @@ stdenv.mkDerivation (finalAttrs: { # still runs in parallel. enableParallelBuilding = false; - env = - { - NIX_CFLAGS_COMPILE = - if atLeast17 then - "-Wno-error" - else if atLeast11 then - # Workaround for - # `cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]` - # when building jtreg - "-Wformat" - else - lib.concatStringsSep " " ( - [ - # glibc 2.24 deprecated readdir_r so we need this - # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html - "-Wno-error=deprecated-declarations" - ] - ++ lib.optionals stdenv.cc.isGNU [ - # https://bugzilla.redhat.com/show_bug.cgi?id=1306558 - # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716 - "-fno-lifetime-dse" - "-fno-delete-null-pointer-checks" - "-std=gnu++98" - "-Wno-error" - ] - ++ [ - # error by default in GCC 14 - "-Wno-error=int-conversion" - "-Wno-error=incompatible-pointer-types" - ] - ); + env = { + NIX_CFLAGS_COMPILE = + if atLeast17 then + "-Wno-error" + else if atLeast11 then + # Workaround for + # `cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]` + # when building jtreg + "-Wformat" + else + lib.concatStringsSep " " ( + [ + # glibc 2.24 deprecated readdir_r so we need this + # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html + "-Wno-error=deprecated-declarations" + ] + ++ lib.optionals stdenv.cc.isGNU [ + # https://bugzilla.redhat.com/show_bug.cgi?id=1306558 + # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716 + "-fno-lifetime-dse" + "-fno-delete-null-pointer-checks" + "-std=gnu++98" + "-Wno-error" + ] + ++ [ + # error by default in GCC 14 + "-Wno-error=int-conversion" + "-Wno-error=incompatible-pointer-types" + ] + ); - NIX_LDFLAGS = lib.concatStringsSep " " ( - lib.optionals (!headless) [ - "-lfontconfig" - "-lcups" - "-lXinerama" - "-lXrandr" - "-lmagic" - ] - ++ lib.optionals (!headless && enableGtk) [ - (if atLeast11 then "-lgtk-3" else "-lgtk-x11-2.0") - "-lgio-2.0" - ] - ); - } - // lib.optionalAttrs (!atLeast11) { - # OpenJDK 8 Hotspot cares about the host(!) version otherwise - DISABLE_HOTSPOT_OS_VERSION_CHECK = "ok"; - }; + NIX_LDFLAGS = lib.concatStringsSep " " ( + lib.optionals (!headless) [ + "-lfontconfig" + "-lcups" + "-lXinerama" + "-lXrandr" + "-lmagic" + ] + ++ lib.optionals (!headless && enableGtk) [ + (if atLeast11 then "-lgtk-3" else "-lgtk-x11-2.0") + "-lgio-2.0" + ] + ); + } + // lib.optionalAttrs (!atLeast11) { + # OpenJDK 8 Hotspot cares about the host(!) version otherwise + DISABLE_HOTSPOT_OS_VERSION_CHECK = "ok"; + }; ${if atLeast23 then "versionCheckProgram" else null} = "${placeholder "out"}/bin/java"; @@ -493,114 +487,111 @@ stdenv.mkDerivation (finalAttrs: { doInstallCheck = atLeast23; - ${if atLeast17 then "postPatch" else null} = - '' - chmod +x configure - patchShebangs --build configure - '' - + lib.optionalString atLeast24 '' - chmod +x make/scripts/*.{template,sh,pl} - patchShebangs --build make/scripts - ''; + ${if atLeast17 then "postPatch" else null} = '' + chmod +x configure + patchShebangs --build configure + '' + + lib.optionalString atLeast24 '' + chmod +x make/scripts/*.{template,sh,pl} + patchShebangs --build make/scripts + ''; - ${if !atLeast17 then "preConfigure" else null} = - '' - chmod +x configure - substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" - '' - + lib.optionalString (!atLeast11) '' - substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "${stdenv.shell}" - substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path" - ''; + ${if !atLeast17 then "preConfigure" else null} = '' + chmod +x configure + substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" + '' + + lib.optionalString (!atLeast11) '' + substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "${stdenv.shell}" + substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path" + ''; - installPhase = - '' - mkdir -p $out/lib + installPhase = '' + mkdir -p $out/lib - mv build/*/images/${if atLeast11 then "jdk" else "j2sdk-image"} $out/lib/openjdk + mv build/*/images/${if atLeast11 then "jdk" else "j2sdk-image"} $out/lib/openjdk - # Remove some broken manpages. - rm -rf $out/lib/openjdk/man/ja* + # Remove some broken manpages. + rm -rf $out/lib/openjdk/man/ja* - # Mirror some stuff in top-level. - mkdir -p $out/share - ln -s $out/lib/openjdk/include $out/include - ln -s $out/lib/openjdk/man $out/share/man - '' - + lib.optionalString atLeast17 '' + # Mirror some stuff in top-level. + mkdir -p $out/share + ln -s $out/lib/openjdk/include $out/include + ln -s $out/lib/openjdk/man $out/share/man + '' + + lib.optionalString atLeast17 '' - # IDEs use the provided src.zip to navigate the Java codebase (https://github.com/NixOS/nixpkgs/pull/95081) - '' - + lib.optionalString atLeast11 '' - ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip - '' - + '' + # IDEs use the provided src.zip to navigate the Java codebase (https://github.com/NixOS/nixpkgs/pull/95081) + '' + + lib.optionalString atLeast11 '' + ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip + '' + + '' - # jni.h expects jni_md.h to be in the header search path. - ln -s $out/include/linux/*_md.h $out/include/ + # jni.h expects jni_md.h to be in the header search path. + ln -s $out/include/linux/*_md.h $out/include/ - # Remove crap from the installation. - rm -rf $out/lib/openjdk/demo${lib.optionalString (!atLeast11) " $out/lib/openjdk/sample"} - ${lib.optionalString headless ( - if atLeast11 then - '' - rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so - '' + # Remove crap from the installation. + rm -rf $out/lib/openjdk/demo${lib.optionalString (!atLeast11) " $out/lib/openjdk/sample"} + ${lib.optionalString headless ( + if atLeast11 then + '' + rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so + '' + else + '' + rm $out/lib/openjdk/jre/lib/${architecture}/{libjsound,libjsoundalsa,libsplashscreen,libawt*,libfontmanager}.so + rm $out/lib/openjdk/jre/bin/policytool + rm $out/lib/openjdk/bin/{policytool,appletviewer} + '' + )} + '' + + lib.optionalString (!atLeast11) '' + + # Move the JRE to a separate output + mkdir -p $jre/lib/openjdk + mv $out/lib/openjdk/jre $jre/lib/openjdk/jre + mkdir $out/lib/openjdk/jre + lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre + + # Make sure cmm/*.pf are not symlinks: + # https://youtrack.jetbrains.com/issue/IDEA-147272 + rm -rf $out/lib/openjdk/jre/lib/cmm + ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm + + # Setup fallback fonts + ${lib.optionalString (!headless) '' + mkdir -p $jre/lib/openjdk/jre/lib/fonts + ln -s ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback + ''} + + # Remove duplicate binaries. + for i in $(cd $out/lib/openjdk/bin && echo *); do + if [ "$i" = java ]; then continue; fi + if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then + ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i + fi + done + + # Generate certificates. + ( + cd $jre/lib/openjdk/jre/lib/security + rm cacerts + perl ${./8/generate-cacerts.pl} ${ + if stdenv.buildPlatform.canExecute stdenv.hostPlatform then + "$jre/lib/openjdk/jre/bin/keytool" else - '' - rm $out/lib/openjdk/jre/lib/${architecture}/{libjsound,libjsoundalsa,libsplashscreen,libawt*,libfontmanager}.so - rm $out/lib/openjdk/jre/bin/policytool - rm $out/lib/openjdk/bin/{policytool,appletviewer} - '' - )} - '' - + lib.optionalString (!atLeast11) '' + "keytool" + } ${cacert}/etc/ssl/certs/ca-bundle.crt + ) + '' + + '' - # Move the JRE to a separate output - mkdir -p $jre/lib/openjdk - mv $out/lib/openjdk/jre $jre/lib/openjdk/jre - mkdir $out/lib/openjdk/jre - lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre - - # Make sure cmm/*.pf are not symlinks: - # https://youtrack.jetbrains.com/issue/IDEA-147272 - rm -rf $out/lib/openjdk/jre/lib/cmm - ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm - - # Setup fallback fonts - ${lib.optionalString (!headless) '' - mkdir -p $jre/lib/openjdk/jre/lib/fonts - ln -s ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback - ''} - - # Remove duplicate binaries. - for i in $(cd $out/lib/openjdk/bin && echo *); do - if [ "$i" = java ]; then continue; fi - if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then - ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i - fi - done - - # Generate certificates. - ( - cd $jre/lib/openjdk/jre/lib/security - rm cacerts - perl ${./8/generate-cacerts.pl} ${ - if stdenv.buildPlatform.canExecute stdenv.hostPlatform then - "$jre/lib/openjdk/jre/bin/keytool" - else - "keytool" - } ${cacert}/etc/ssl/certs/ca-bundle.crt - ) - '' - + '' - - ln -s $out/lib/openjdk/bin $out/bin - '' - + lib.optionalString (!atLeast11) '' - ln -s $jre/lib/openjdk/jre/bin $jre/bin - ln -s $jre/lib/openjdk/jre $out/jre - ''; + ln -s $out/lib/openjdk/bin $out/bin + '' + + lib.optionalString (!atLeast11) '' + ln -s $jre/lib/openjdk/jre/bin $jre/bin + ln -s $jre/lib/openjdk/jre $out/jre + ''; preFixup = ( @@ -656,16 +647,15 @@ stdenv.mkDerivation (finalAttrs: { (if atLeast11 then jdk-bootstrap' else jdk-bootstrap) ]; - passthru = - { - home = "${finalAttrs.finalPackage}/lib/openjdk"; - inherit jdk-bootstrap; - inherit (source) updateScript; - } - // (if atLeast11 then { inherit gtk3; } else { inherit gtk2; }) - // lib.optionalAttrs (!atLeast23) { - inherit architecture; - }; + passthru = { + home = "${finalAttrs.finalPackage}/lib/openjdk"; + inherit jdk-bootstrap; + inherit (source) updateScript; + } + // (if atLeast11 then { inherit gtk3; } else { inherit gtk2; }) + // lib.optionalAttrs (!atLeast23) { + inherit architecture; + }; meta = { description = "Open-source Java Development Kit"; @@ -677,20 +667,19 @@ stdenv.mkDerivation (finalAttrs: { ]; teams = [ lib.teams.java ]; mainProgram = "java"; - platforms = - [ - "i686-linux" - "x86_64-linux" - "aarch64-linux" - ] - ++ lib.optionals atLeast11 [ - "armv7l-linux" - "armv6l-linux" - "powerpc64le-linux" - ] - ++ lib.optionals atLeast17 [ - "riscv64-linux" - ]; + platforms = [ + "i686-linux" + "x86_64-linux" + "aarch64-linux" + ] + ++ lib.optionals atLeast11 [ + "armv7l-linux" + "armv6l-linux" + "powerpc64le-linux" + ] + ++ lib.optionals atLeast17 [ + "riscv64-linux" + ]; # OpenJDK 8 was broken for musl at 2024-01-17. Tracking issue: # https://github.com/NixOS/nixpkgs/issues/281618 # error: ‘isnanf’ was not declared in this scope diff --git a/pkgs/development/compilers/osl/default.nix b/pkgs/development/compilers/osl/default.nix index 92b12ea37605..11b14e3bebf4 100644 --- a/pkgs/development/compilers/osl/default.nix +++ b/pkgs/development/compilers/osl/default.nix @@ -62,23 +62,22 @@ stdenv.mkDerivation (finalAttrs: { flex ]; - buildInputs = - [ - boost_static - libclang - llvm - openexr - openimageio - partio - pugixml - python3.pkgs.pybind11 - robin-map - util-linux # needed just for hexdump - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libxml2 - ]; + buildInputs = [ + boost_static + libclang + llvm + openexr + openimageio + partio + pugixml + python3.pkgs.pybind11 + robin-map + util-linux # needed just for hexdump + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libxml2 + ]; postFixup = '' substituteInPlace "$out"/lib/pkgconfig/*.pc \ diff --git a/pkgs/development/compilers/p4c/default.nix b/pkgs/development/compilers/p4c/default.nix index 3fd3aa022c07..2bb196df1263 100644 --- a/pkgs/development/compilers/p4c/default.nix +++ b/pkgs/development/compilers/p4c/default.nix @@ -73,22 +73,21 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - bison - flex - cmake - protobuf - python3 - ] - ++ lib.optionals enableDocumentation [ - doxygen - graphviz - ] - ++ lib.optionals enableBPF [ - libllvm - libbpf - ]; + nativeBuildInputs = [ + bison + flex + cmake + protobuf + python3 + ] + ++ lib.optionals enableDocumentation [ + doxygen + graphviz + ] + ++ lib.optionals enableBPF [ + libllvm + libbpf + ]; buildInputs = [ protobuf diff --git a/pkgs/development/compilers/polyml/5.6.nix b/pkgs/development/compilers/polyml/5.6.nix index d739f7666935..02c8d79a2468 100644 --- a/pkgs/development/compilers/polyml/5.6.nix +++ b/pkgs/development/compilers/polyml/5.6.nix @@ -14,17 +14,16 @@ stdenv.mkDerivation { pname = "polyml"; inherit version; - postPatch = - '' - substituteInPlace configure.ac \ - --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA - AH_TEMPLATE([_Static_assert]) - AC_DEFINE([_Static_assert], [static_assert]) - " - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace-fail stdc++ c++ - ''; + postPatch = '' + substituteInPlace configure.ac \ + --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA + AH_TEMPLATE([_Static_assert]) + AC_DEFINE([_Static_assert], [static_assert]) + " + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure.ac --replace-fail stdc++ c++ + ''; patches = [ # glibc 2.34 compat diff --git a/pkgs/development/compilers/polyml/5.7.nix b/pkgs/development/compilers/polyml/5.7.nix index c35a325ba01a..40ef97ebd871 100644 --- a/pkgs/development/compilers/polyml/5.7.nix +++ b/pkgs/development/compilers/polyml/5.7.nix @@ -12,17 +12,16 @@ stdenv.mkDerivation rec { pname = "polyml"; version = "5.7.1"; - postPatch = - '' - substituteInPlace configure.ac \ - --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA - AH_TEMPLATE([_Static_assert]) - AC_DEFINE([_Static_assert], [static_assert]) - " - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace-fail stdc++ c++ - ''; + postPatch = '' + substituteInPlace configure.ac \ + --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA + AH_TEMPLATE([_Static_assert]) + AC_DEFINE([_Static_assert], [static_assert]) + " + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure.ac --replace-fail stdc++ c++ + ''; patches = [ ./5.7-new-libffi-FFI_SYSV.patch diff --git a/pkgs/development/compilers/polyml/default.nix b/pkgs/development/compilers/polyml/default.nix index 99b6889eb4d6..b93840c44d1e 100644 --- a/pkgs/development/compilers/polyml/default.nix +++ b/pkgs/development/compilers/polyml/default.nix @@ -18,17 +18,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-72wm8dt+Id59A5058mVE5P9TkXW5/LZRthZoxUustVA="; }; - postPatch = - '' - substituteInPlace configure.ac \ - --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA - AH_TEMPLATE([_Static_assert]) - AC_DEFINE([_Static_assert], [static_assert]) - " - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace-fail stdc++ c++ - ''; + postPatch = '' + substituteInPlace configure.ac \ + --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA + AH_TEMPLATE([_Static_assert]) + AC_DEFINE([_Static_assert], [static_assert]) + " + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure.ac --replace-fail stdc++ c++ + ''; buildInputs = [ libffi diff --git a/pkgs/development/compilers/purescript/purescript/default.nix b/pkgs/development/compilers/purescript/purescript/default.nix index 97000e8220ca..17cbb170a157 100644 --- a/pkgs/development/compilers/purescript/purescript/default.nix +++ b/pkgs/development/compilers/purescript/purescript/default.nix @@ -59,18 +59,17 @@ stdenv.mkDerivation rec { libPath = lib.makeLibraryPath buildInputs; dontStrip = true; - installPhase = - '' - mkdir -p $out/bin - PURS="$out/bin/purs" + installPhase = '' + mkdir -p $out/bin + PURS="$out/bin/purs" - install -D -m555 -T purs $PURS - ${patchelf libPath} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - mkdir -p $out/share/bash-completion/completions - $PURS --bash-completion-script $PURS > $out/share/bash-completion/completions/purs-completion.bash - ''; + install -D -m555 -T purs $PURS + ${patchelf libPath} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + mkdir -p $out/share/bash-completion/completions + $PURS --bash-completion-script $PURS > $out/share/bash-completion/completions/purs-completion.bash + ''; passthru = { updateScript = ./update.sh; diff --git a/pkgs/development/compilers/rust/binary.nix b/pkgs/development/compilers/rust/binary.nix index 94d2418872d9..c504e4400612 100644 --- a/pkgs/development/compilers/rust/binary.nix +++ b/pkgs/development/compilers/rust/binary.nix @@ -42,30 +42,30 @@ rec { }; nativeBuildInputs = lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; - buildInputs = - [ bash ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) gcc.cc.lib - ++ lib.optional (!stdenv.hostPlatform.isDarwin) zlib; + buildInputs = [ + bash + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) gcc.cc.lib + ++ lib.optional (!stdenv.hostPlatform.isDarwin) zlib; postPatch = '' patchShebangs . ''; - installPhase = - '' - ./install.sh --prefix=$out \ - --components=${installComponents} + installPhase = '' + ./install.sh --prefix=$out \ + --components=${installComponents} - # Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc - # (or similar) here. It causes strange effects where rustc loads - # the wrong libraries in a bootstrap-build causing failures that - # are very hard to track down. For details, see - # https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -change "/usr/lib/libcurl.4.dylib" \ - "${lib.getLib curl}/lib/libcurl.4.dylib" "$out/bin/cargo" - ''; + # Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc + # (or similar) here. It causes strange effects where rustc loads + # the wrong libraries in a bootstrap-build causing failures that + # are very hard to track down. For details, see + # https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -change "/usr/lib/libcurl.4.dylib" \ + "${lib.getLib curl}/lib/libcurl.4.dylib" "$out/bin/cargo" + ''; # The strip tool in cctools 973.0.1 and up appears to break rlibs in the # binaries. The lib.rmeta object inside the ar archive should contain an @@ -149,28 +149,29 @@ rec { nativeBuildInputs = [ makeWrapper - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; buildInputs = [ bash - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) gcc.cc.lib; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isFreeBSD) gcc.cc.lib; postPatch = '' patchShebangs . ''; - installPhase = - '' - patchShebangs ./install.sh - ./install.sh --prefix=$out \ - --components=cargo - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -change "/usr/lib/libcurl.4.dylib" \ - "${lib.getLib curl}/lib/libcurl.4.dylib" "$out/bin/cargo" - '' - + '' - wrapProgram "$out/bin/cargo" \ - --suffix PATH : "${rustc}/bin" - ''; + installPhase = '' + patchShebangs ./install.sh + ./install.sh --prefix=$out \ + --components=cargo + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -change "/usr/lib/libcurl.4.dylib" \ + "${lib.getLib curl}/lib/libcurl.4.dylib" "$out/bin/cargo" + '' + + '' + wrapProgram "$out/bin/cargo" \ + --suffix PATH : "${rustc}/bin" + ''; }; } diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 18a889fe9349..9b09dddad71b 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -317,47 +317,46 @@ stdenv.mkDerivation (finalAttrs: { inherit patches; - postPatch = - '' - patchShebangs src/etc + postPatch = '' + patchShebangs src/etc - # rust-lld is the name rustup uses for its bundled lld, so that it - # doesn't conflict with any system lld. This is not an - # appropriate default for Nixpkgs, where there is no rust-lld. - substituteInPlace compiler/rustc_target/src/spec/*/*.rs \ - --replace-quiet '"rust-lld"' '"lld"' + # rust-lld is the name rustup uses for its bundled lld, so that it + # doesn't conflict with any system lld. This is not an + # appropriate default for Nixpkgs, where there is no rust-lld. + substituteInPlace compiler/rustc_target/src/spec/*/*.rs \ + --replace-quiet '"rust-lld"' '"lld"' - ${optionalString (!withBundledLLVM) "rm -rf src/llvm"} + ${optionalString (!withBundledLLVM) "rm -rf src/llvm"} - # Useful debugging parameter - # export VERBOSE=1 - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.targetPlatform.isDarwin) '' - # Replace hardcoded path to strip with llvm-strip - # https://github.com/NixOS/nixpkgs/issues/299606 - substituteInPlace compiler/rustc_codegen_ssa/src/back/link.rs \ - --replace-fail "/usr/bin/strip" "${lib.getExe' llvmShared "llvm-strip"}" - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' - # See https://github.com/jemalloc/jemalloc/issues/1997 - # Using a value of 48 should work on both emulated and native x86_64-darwin. - export JEMALLOC_SYS_WITH_LG_VADDR=48 - '' - + lib.optionalString (!(finalAttrs.src.passthru.isReleaseTarball or false)) '' - mkdir .cargo - cat > .cargo/config.toml <<\EOF - [source.crates-io] - replace-with = "vendored-sources" - [source.vendored-sources] - directory = "vendor" - EOF - '' - + lib.optionalString (stdenv.hostPlatform.isFreeBSD) '' - # lzma-sys bundles an old version of xz that doesn't build - # on modern FreeBSD, use the system one instead - substituteInPlace src/bootstrap/src/core/build_steps/tool.rs \ - --replace 'cargo.env("LZMA_API_STATIC", "1");' ' ' - ''; + # Useful debugging parameter + # export VERBOSE=1 + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.targetPlatform.isDarwin) '' + # Replace hardcoded path to strip with llvm-strip + # https://github.com/NixOS/nixpkgs/issues/299606 + substituteInPlace compiler/rustc_codegen_ssa/src/back/link.rs \ + --replace-fail "/usr/bin/strip" "${lib.getExe' llvmShared "llvm-strip"}" + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' + # See https://github.com/jemalloc/jemalloc/issues/1997 + # Using a value of 48 should work on both emulated and native x86_64-darwin. + export JEMALLOC_SYS_WITH_LG_VADDR=48 + '' + + lib.optionalString (!(finalAttrs.src.passthru.isReleaseTarball or false)) '' + mkdir .cargo + cat > .cargo/config.toml <<\EOF + [source.crates-io] + replace-with = "vendored-sources" + [source.vendored-sources] + directory = "vendor" + EOF + '' + + lib.optionalString (stdenv.hostPlatform.isFreeBSD) '' + # lzma-sys bundles an old version of xz that doesn't build + # on modern FreeBSD, use the system one instead + substituteInPlace src/bootstrap/src/core/build_steps/tool.rs \ + --replace 'cargo.env("LZMA_API_STATIC", "1");' ' ' + ''; # rustc unfortunately needs cmake to compile llvm-rt but doesn't # use it for the normal build. This disables cmake in Nix. @@ -369,38 +368,38 @@ stdenv.mkDerivation (finalAttrs: { ]; depsBuildTarget = lib.optionals stdenv.targetPlatform.isMinGW [ bintools ]; - nativeBuildInputs = - [ - file - python3 - rustc - cmake - which - libffi - removeReferencesTo - pkg-config - xz - ] - ++ optionals fastCross [ - lndir - makeWrapper - ]; + nativeBuildInputs = [ + file + python3 + rustc + cmake + which + libffi + removeReferencesTo + pkg-config + xz + ] + ++ optionals fastCross [ + lndir + makeWrapper + ]; - buildInputs = - [ openssl ] - ++ optionals stdenv.hostPlatform.isDarwin [ - zlib - ] - ++ optional (!withBundledLLVM) llvmShared.lib - ++ optional (useLLVM && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD) [ - llvmPackages.libunwind - # Hack which is used upstream https://github.com/gentoo/gentoo/blob/master/dev-lang/rust/rust-1.78.0.ebuild#L284 - (runCommandLocal "libunwind-libgcc" { } '' - mkdir -p $out/lib - ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so - ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so.1 - '') - ]; + buildInputs = [ + openssl + ] + ++ optionals stdenv.hostPlatform.isDarwin [ + zlib + ] + ++ optional (!withBundledLLVM) llvmShared.lib + ++ optional (useLLVM && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD) [ + llvmPackages.libunwind + # Hack which is used upstream https://github.com/gentoo/gentoo/blob/master/dev-lang/rust/rust-1.78.0.ebuild#L284 + (runCommandLocal "libunwind-libgcc" { } '' + mkdir -p $out/lib + ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so + ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so.1 + '') + ]; outputs = [ "out" @@ -445,7 +444,8 @@ stdenv.mkDerivation (finalAttrs: { inherit (rustc) tier1TargetPlatforms targetPlatforms badTargetPlatforms; tests = { inherit fd ripgrep wezterm; - } // lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit firefox thunderbird; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit firefox thunderbird; }; }; meta = with lib; { diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix index d1a5e9bd3928..1991e52f63cf 100644 --- a/pkgs/development/compilers/sbcl/default.nix +++ b/pkgs/development/compilers/sbcl/default.nix @@ -83,22 +83,21 @@ stdenv.mkDerivation (self: { inherit (versionMap.${version}) sha256; }; - nativeBuildInputs = + nativeBuildInputs = [ + texinfo + ] + ++ lib.optionals self.doCheck ( [ - texinfo + which + writableTmpDirAsHomeHook ] - ++ lib.optionals self.doCheck ( - [ - which - writableTmpDirAsHomeHook - ] - ++ lib.optionals (builtins.elem stdenv.system strace.meta.platforms) [ - strace - ] - ++ lib.optionals (lib.versionOlder "2.4.10" self.version) [ - ps - ] - ); + ++ lib.optionals (builtins.elem stdenv.system strace.meta.platforms) [ + strace + ] + ++ lib.optionals (lib.versionOlder "2.4.10" self.version) [ + ps + ] + ); buildInputs = lib.optionals self.coreCompression ( # Declare at the point of actual use in case the caller wants to override # buildInputs to sidestep this. @@ -215,16 +214,15 @@ stdenv.mkDerivation (self: { "compact-instance-header" ]; - buildArgs = - [ - "--prefix=$out" - "--xc-host=${lib.escapeShellArg bootstrapLisp'}" - ] - ++ builtins.map (x: "--with-${x}") self.enableFeatures - ++ builtins.map (x: "--without-${x}") self.disableFeatures - ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [ - "--arch=arm64" - ]; + buildArgs = [ + "--prefix=$out" + "--xc-host=${lib.escapeShellArg bootstrapLisp'}" + ] + ++ builtins.map (x: "--with-${x}") self.enableFeatures + ++ builtins.map (x: "--without-${x}") self.disableFeatures + ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [ + "--arch=arm64" + ]; # Fails to find `O_LARGEFILE` otherwise. env.NIX_CFLAGS_COMPILE = "-D_GNU_SOURCE"; @@ -254,25 +252,24 @@ stdenv.mkDerivation (self: { runHook postCheck ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - sh install.sh + sh install.sh - '' - + lib.optionalString (!self.purgeNixReferences) '' - cp -r src $out/lib/sbcl - cp -r contrib $out/lib/sbcl - cat >$out/lib/sbcl/sbclrc <$out/lib/sbcl/sbclrc < $out/nix-support/propagated-build-inputs + + # Set JAVA_HOME automatically. + cat <> $out/nix-support/setup-hook + if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi + EOF + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # We cannot use -exec since wrapProgram is a function but not a command. + # + # jspawnhelper is executed from JVM, so it doesn't need to wrap it, and it + # breaks building OpenJDK (#114495). + for bin in $( find "$out" -executable -type f -not -name jspawnhelper ); do + if patchelf --print-interpreter "$bin" &> /dev/null; then + wrapProgram "$bin" --prefix LD_LIBRARY_PATH : "${runtimeLibraryPath}" fi - ''; - - preFixup = - '' - # Propagate the setJavaClassPath setup hook from the ${if isJdk8 then "JRE" else "JDK"} so that - # any package that depends on the ${if isJdk8 then "JRE" else "JDK"} has $CLASSPATH set up - # properly. - mkdir -p $out/nix-support - printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs - - # Set JAVA_HOME automatically. - cat <> $out/nix-support/setup-hook - if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi - EOF - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # We cannot use -exec since wrapProgram is a function but not a command. - # - # jspawnhelper is executed from JVM, so it doesn't need to wrap it, and it - # breaks building OpenJDK (#114495). - for bin in $( find "$out" -executable -type f -not -name jspawnhelper ); do - if patchelf --print-interpreter "$bin" &> /dev/null; then - wrapProgram "$bin" --prefix LD_LIBRARY_PATH : "${runtimeLibraryPath}" - fi - done - '' - # FIXME: move all of the above to installPhase. - + lib.optionalString stdenv.hostPlatform.isLinux '' - find "$out" -name libfontmanager.so -exec \ - patchelf --add-needed libfontconfig.so {} \; - ''; + done + '' + # FIXME: move all of the above to installPhase. + + lib.optionalString stdenv.hostPlatform.isLinux '' + find "$out" -name libfontmanager.so -exec \ + patchelf --add-needed libfontconfig.so {} \; + ''; # fixupPhase is moving the man to share/man which breaks it because it's a # relative symlink. diff --git a/pkgs/development/coq-modules/QuickChick/default.nix b/pkgs/development/coq-modules/QuickChick/default.nix index 8df53c6bb914..370d9ee0f836 100644 --- a/pkgs/development/coq-modules/QuickChick/default.nix +++ b/pkgs/development/coq-modules/QuickChick/default.nix @@ -68,12 +68,13 @@ in mlPlugin = true; nativeBuildInputs = lib.optional recent coq.ocamlPackages.ocamlbuild; - propagatedBuildInputs = - [ mathcomp-boot ] - ++ lib.optionals recent [ - ExtLib - simple-io - ]; + propagatedBuildInputs = [ + mathcomp-boot + ] + ++ lib.optionals recent [ + ExtLib + simple-io + ]; extraInstallFlags = [ "-f Makefile.coq" ]; enableParallelBuilding = false; diff --git a/pkgs/development/coq-modules/VST/default.nix b/pkgs/development/coq-modules/VST/default.nix index 17aaf9d55636..dbfab7fc838e 100644 --- a/pkgs/development/coq-modules/VST/default.nix +++ b/pkgs/development/coq-modules/VST/default.nix @@ -11,17 +11,16 @@ # but that may be useful to some users. # They depend on ITree. let - extra_floyd_files = - [ - "ASTsize.v" - "io_events.v" - "powerlater.v" - ] - # floyd/printf.v is broken in VST 2.9 - ++ lib.optional (!lib.versions.isGe "8.13" coq.coq-version) "printf.v" - ++ [ - "quickprogram.v" - ]; + extra_floyd_files = [ + "ASTsize.v" + "io_events.v" + "powerlater.v" + ] + # floyd/printf.v is broken in VST 2.9 + ++ lib.optional (!lib.versions.isGe "8.13" coq.coq-version) "printf.v" + ++ [ + "quickprogram.v" + ]; in mkCoqDerivation { @@ -58,28 +57,26 @@ mkCoqDerivation { buildInputs = [ ITree ]; propagatedBuildInputs = [ compcert ]; - preConfigure = - '' - patchShebangs util - '' - + - lib.optionalString - (coq.coq-version != null && coq.coq-version != "dev" && lib.versions.isLe "8.20" coq.coq-version) - '' - substituteInPlace Makefile \ - --replace-fail 'COQVERSION= ' 'COQVERSION= 8.20.1 or-else 8.19.2 or-else 8.17.1 or-else 8.16.1 or-else 8.16.0 or-else 8.15.2 or-else 8.15.1 or-else '\ - --replace-fail 'FLOYD_FILES=' 'FLOYD_FILES= ${toString extra_floyd_files}' - ''; + preConfigure = '' + patchShebangs util + '' + + + lib.optionalString + (coq.coq-version != null && coq.coq-version != "dev" && lib.versions.isLe "8.20" coq.coq-version) + '' + substituteInPlace Makefile \ + --replace-fail 'COQVERSION= ' 'COQVERSION= 8.20.1 or-else 8.19.2 or-else 8.17.1 or-else 8.16.1 or-else 8.16.0 or-else 8.15.2 or-else 8.15.1 or-else '\ + --replace-fail 'FLOYD_FILES=' 'FLOYD_FILES= ${toString extra_floyd_files}' + ''; - makeFlags = - [ - "BITSIZE=64" - "COMPCERT=inst_dir" - "COMPCERT_INST_DIR=${compcert.lib}/lib/coq/${coq.coq-version}/user-contrib/compcert" - "INSTALLDIR=$(out)/lib/coq/${coq.coq-version}/user-contrib/VST" - ] - ++ lib.optional (coq.coq-version == "dev") "IGNORECOQVERSION=true" - ++ lib.optional (coq.coq-version == "dev") "IGNORECOMPCERTVERSION=true"; + makeFlags = [ + "BITSIZE=64" + "COMPCERT=inst_dir" + "COMPCERT_INST_DIR=${compcert.lib}/lib/coq/${coq.coq-version}/user-contrib/compcert" + "INSTALLDIR=$(out)/lib/coq/${coq.coq-version}/user-contrib/VST" + ] + ++ lib.optional (coq.coq-version == "dev") "IGNORECOQVERSION=true" + ++ lib.optional (coq.coq-version == "dev") "IGNORECOMPCERTVERSION=true"; postInstall = '' for d in msl veric floyd sepcomp progs64 diff --git a/pkgs/development/coq-modules/hydra-battles/default.nix b/pkgs/development/coq-modules/hydra-battles/default.nix index 985cfd2853bf..4c7fd1908b67 100644 --- a/pkgs/development/coq-modules/hydra-battles/default.nix +++ b/pkgs/development/coq-modules/hydra-battles/default.nix @@ -55,6 +55,7 @@ { propagatedBuildInputs = [ equations - ] ++ lib.optional (lib.versions.isGe "0.6" version || version == "dev") LibHyps; + ] + ++ lib.optional (lib.versions.isGe "0.6" version || version == "dev") LibHyps; } ) diff --git a/pkgs/development/coq-modules/mathcomp/default.nix b/pkgs/development/coq-modules/mathcomp/default.nix index ddef4adc8b06..48cecdce4b30 100644 --- a/pkgs/development/coq-modules/mathcomp/default.nix +++ b/pkgs/development/coq-modules/mathcomp/default.nix @@ -131,21 +131,20 @@ let buildFlags = lib.optional withDoc "doc"; - preBuild = - '' - if [[ -f etc/utils/ssrcoqdep ]] - then patchShebangs etc/utils/ssrcoqdep - fi - if [[ -f etc/buildlibgraph ]] - then patchShebangs etc/buildlibgraph - fi - '' - + '' - # handle mathcomp < 2.4.0 which had an extra base mathcomp directory - test -d mathcomp && cd mathcomp - cd ${pkgpath} || cd ssreflect # before 2.5, boot didn't exist, make it behave as ssreflect - '' - + lib.optionalString (package == "all") pkgallMake; + preBuild = '' + if [[ -f etc/utils/ssrcoqdep ]] + then patchShebangs etc/utils/ssrcoqdep + fi + if [[ -f etc/buildlibgraph ]] + then patchShebangs etc/buildlibgraph + fi + '' + + '' + # handle mathcomp < 2.4.0 which had an extra base mathcomp directory + test -d mathcomp && cd mathcomp + cd ${pkgpath} || cd ssreflect # before 2.5, boot didn't exist, make it behave as ssreflect + '' + + lib.optionalString (package == "all") pkgallMake; meta = { homepage = "https://math-comp.github.io/"; diff --git a/pkgs/development/coq-modules/metacoq/default.nix b/pkgs/development/coq-modules/metacoq/default.nix index bb78843c736f..c62587e9d964 100644 --- a/pkgs/development/coq-modules/metacoq/default.nix +++ b/pkgs/development/coq-modules/metacoq/default.nix @@ -122,7 +122,8 @@ let propagatedBuildInputs = [ equations coq.ocamlPackages.zarith - ] ++ metacoq-deps; + ] + ++ metacoq-deps; patchPhase = if lib.versionAtLeast coq.coq-version "8.17" || coq.coq-version == "dev" then @@ -192,8 +193,7 @@ let in { propagatedBuildInputs = - o.propagatedBuildInputs - ++ lib.optional requiresOcamlStdlibShims coq.ocamlPackages.stdlib-shims; + o.propagatedBuildInputs ++ lib.optional requiresOcamlStdlibShims coq.ocamlPackages.stdlib-shims; } ); # utils, common, template-pcuic, quotation, safechecker-plugin, and erasure-plugin diff --git a/pkgs/development/coq-modules/metarocq/default.nix b/pkgs/development/coq-modules/metarocq/default.nix index aa7b39918427..d565c312ae33 100644 --- a/pkgs/development/coq-modules/metarocq/default.nix +++ b/pkgs/development/coq-modules/metarocq/default.nix @@ -89,7 +89,8 @@ let equations coq.ocamlPackages.zarith coq.ocamlPackages.stdlib-shims - ] ++ metarocq-deps; + ] + ++ metarocq-deps; patchPhase = '' patchShebangs ./configure.sh diff --git a/pkgs/development/coq-modules/simple-io/default.nix b/pkgs/development/coq-modules/simple-io/default.nix index fe20ceffd2d6..87b4116aafdc 100644 --- a/pkgs/development/coq-modules/simple-io/default.nix +++ b/pkgs/development/coq-modules/simple-io/default.nix @@ -28,13 +28,14 @@ release."1.3.0".sha256 = "1yp7ca36jyl9kz35ghxig45x6cd0bny2bpmy058359p94wc617ax"; mlPlugin = true; nativeBuildInputs = [ coq.ocamlPackages.cppo ]; - propagatedBuildInputs = - [ ExtLib ] - ++ (with coq.ocamlPackages; [ - ocaml - findlib - ocamlbuild - ]); + propagatedBuildInputs = [ + ExtLib + ] + ++ (with coq.ocamlPackages; [ + ocaml + findlib + ocamlbuild + ]); doCheck = true; checkTarget = "test"; diff --git a/pkgs/development/coq-modules/smtcoq/default.nix b/pkgs/development/coq-modules/smtcoq/default.nix index e91368462e79..313c14300361 100644 --- a/pkgs/development/coq-modules/smtcoq/default.nix +++ b/pkgs/development/coq-modules/smtcoq/default.nix @@ -75,18 +75,17 @@ mkCoqDerivation { } ] null; - propagatedBuildInputs = - [ - cvc5 - # veriT' # c.f. comment above - zchaff - stdlib - ] - ++ (with coq.ocamlPackages; [ - findlib - num - zarith - ]); + propagatedBuildInputs = [ + cvc5 + # veriT' # c.f. comment above + zchaff + stdlib + ] + ++ (with coq.ocamlPackages; [ + findlib + num + zarith + ]); mlPlugin = true; nativeBuildInputs = (with pkgs; [ gnumake42 ]) ++ (with coq.ocamlPackages; [ ocamlbuild ]); diff --git a/pkgs/development/coq-modules/vscoq-language-server/default.nix b/pkgs/development/coq-modules/vscoq-language-server/default.nix index a17ecfe91d36..e5d71da4b0dc 100644 --- a/pkgs/development/coq-modules/vscoq-language-server/default.nix +++ b/pkgs/development/coq-modules/vscoq-language-server/default.nix @@ -50,29 +50,28 @@ ocamlPackages.buildDunePackage { inherit (fetched) version; src = "${fetched.src}/language-server"; nativeBuildInputs = [ coq ]; - buildInputs = - [ - coq - glib - adwaita-icon-theme - wrapGAppsHook3 - ] - ++ (with ocamlPackages; [ - findlib - lablgtk3-sourceview3 - yojson - zarith - ppx_inline_test - ppx_assert - ppx_sexp_conv - ppx_deriving - ppx_import - sexplib - ppx_yojson_conv - lsp - sel - ppx_optcomp - ]); + buildInputs = [ + coq + glib + adwaita-icon-theme + wrapGAppsHook3 + ] + ++ (with ocamlPackages; [ + findlib + lablgtk3-sourceview3 + yojson + zarith + ppx_inline_test + ppx_assert + ppx_sexp_conv + ppx_deriving + ppx_import + sexplib + ppx_yojson_conv + lsp + sel + ppx_optcomp + ]); meta = with lib; diff --git a/pkgs/development/cuda-modules/_cuda/fixups/cuda_cudart.nix b/pkgs/development/cuda-modules/_cuda/fixups/cuda_cudart.nix index 67b45ece2026..18d51bd2774d 100644 --- a/pkgs/development/cuda-modules/_cuda/fixups/cuda_cudart.nix +++ b/pkgs/development/cuda-modules/_cuda/fixups/cuda_cudart.nix @@ -28,11 +28,9 @@ prevAttrs: { fi ''; - postFixup = - prevAttrs.postFixup or "" - + '' - moveToOutput lib/stubs "$stubs" - ln -s "$stubs"/lib/stubs/* "$stubs"/lib/ - ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs" - ''; + postFixup = prevAttrs.postFixup or "" + '' + moveToOutput lib/stubs "$stubs" + ln -s "$stubs"/lib/stubs/* "$stubs"/lib/ + ln -s "$stubs"/lib/stubs "''${!outputLib}/lib/stubs" + ''; } diff --git a/pkgs/development/cuda-modules/_cuda/fixups/cuda_nvcc.nix b/pkgs/development/cuda-modules/_cuda/fixups/cuda_nvcc.nix index 9ffa5880e140..a4c7c6b55d1a 100644 --- a/pkgs/development/cuda-modules/_cuda/fixups/cuda_nvcc.nix +++ b/pkgs/development/cuda-modules/_cuda/fixups/cuda_nvcc.nix @@ -57,11 +57,9 @@ prevAttrs: { # Entries here will be in nativeBuildInputs when cuda_nvcc is in nativeBuildInputs. propagatedBuildInputs = prevAttrs.propagatedBuildInputs or [ ] ++ [ setupCudaHook ]; - postInstall = - prevAttrs.postInstall or "" - + '' - moveToOutput "nvvm" "''${!outputBin}" - ''; + postInstall = prevAttrs.postInstall or "" + '' + moveToOutput "nvvm" "''${!outputBin}" + ''; # The nvcc and cicc binaries contain hard-coded references to /usr allowFHSReferences = true; diff --git a/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix b/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix index babb54fdd0c7..584893f54c24 100644 --- a/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix +++ b/pkgs/development/cuda-modules/_cuda/fixups/nsight_compute.nix @@ -32,26 +32,20 @@ in rdma-core ]; dontWrapQtApps = true; - preInstall = - prevAttrs.preInstall or "" - + '' - rm -rf host/${archDir}/Mesa/ - ''; - postInstall = - prevAttrs.postInstall or "" - + '' - moveToOutput 'ncu' "''${!outputBin}/bin" - moveToOutput 'ncu-ui' "''${!outputBin}/bin" - moveToOutput 'host/${archDir}' "''${!outputBin}/bin" - moveToOutput 'target/${archDir}' "''${!outputBin}/bin" - wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin" - ''; - preFixup = - prevAttrs.preFixup or "" - + '' - # lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6 - patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/bin/host/${archDir}/Plugins/imageformats/libqtiff.so" - ''; + preInstall = prevAttrs.preInstall or "" + '' + rm -rf host/${archDir}/Mesa/ + ''; + postInstall = prevAttrs.postInstall or "" + '' + moveToOutput 'ncu' "''${!outputBin}/bin" + moveToOutput 'ncu-ui' "''${!outputBin}/bin" + moveToOutput 'host/${archDir}' "''${!outputBin}/bin" + moveToOutput 'target/${archDir}' "''${!outputBin}/bin" + wrapQtApp "''${!outputBin}/bin/host/${archDir}/ncu-ui.bin" + ''; + preFixup = prevAttrs.preFixup or "" + '' + # lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6 + patchelf --replace-needed libtiff.so.5 libtiff.so "''${!outputBin}/bin/host/${archDir}/Plugins/imageformats/libqtiff.so" + ''; autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [ "libnvidia-ml.so.1" ]; diff --git a/pkgs/development/cuda-modules/_cuda/fixups/nsight_systems.nix b/pkgs/development/cuda-modules/_cuda/fixups/nsight_systems.nix index 823559dfae72..9040dc36a21d 100644 --- a/pkgs/development/cuda-modules/_cuda/fixups/nsight_systems.nix +++ b/pkgs/development/cuda-modules/_cuda/fixups/nsight_systems.nix @@ -57,14 +57,12 @@ in "nsight-systems/${versionString}/${hostDir}/Mesa" ]; }; - postPatch = - prevAttrs.postPatch or "" - + '' - for path in $rmPatterns; do - rm -r "$path" - done - patchShebangs nsight-systems - ''; + postPatch = prevAttrs.postPatch or "" + '' + for path in $rmPatterns; do + rm -r "$path" + done + patchShebangs nsight-systems + ''; nativeBuildInputs = prevAttrs.nativeBuildInputs or [ ] ++ [ qt.wrapQtAppsHook ]; dontWrapQtApps = true; buildInputs = prevAttrs.buildInputs or [ ] ++ [ @@ -108,12 +106,10 @@ in wrapQtApp "$bin/nsight-systems/${versionString}/${hostDir}/nsys-ui.bin" ''; - preFixup = - prevAttrs.preFixup or "" - + '' - # lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6 - patchelf --replace-needed libtiff.so.5 libtiff.so $bin/nsight-systems/${versionString}/${hostDir}/Plugins/imageformats/libqtiff.so - ''; + preFixup = prevAttrs.preFixup or "" + '' + # lib needs libtiff.so.5, but nixpkgs provides libtiff.so.6 + patchelf --replace-needed libtiff.so.5 libtiff.so $bin/nsight-systems/${versionString}/${hostDir}/Plugins/imageformats/libqtiff.so + ''; autoPatchelfIgnoreMissingDeps = prevAttrs.autoPatchelfIgnoreMissingDeps or [ ] ++ [ "libnvidia-ml.so.1" diff --git a/pkgs/development/cuda-modules/cuda-library-samples/generic.nix b/pkgs/development/cuda-modules/cuda-library-samples/generic.nix index dfd48ce7c5ed..a3a5558f389f 100644 --- a/pkgs/development/cuda-modules/cuda-library-samples/generic.nix +++ b/pkgs/development/cuda-modules/cuda-library-samples/generic.nix @@ -81,12 +81,10 @@ in ]; # CUTENSOR_ROOT is double escaped - postPatch = - prevAttrs.postPatch or "" - + '' - substituteInPlace CMakeLists.txt \ - --replace-fail "\''${CUTENSOR_ROOT}/include" "${lib.getDev cutensor}/include" - ''; + postPatch = prevAttrs.postPatch or "" + '' + substituteInPlace CMakeLists.txt \ + --replace-fail "\''${CUTENSOR_ROOT}/include" "${lib.getDev cutensor}/include" + ''; CUTENSOR_ROOT = cutensor; @@ -121,21 +119,17 @@ in cuda_cccl # ]; - postPatch = - prevAttrs.postPatch or "" - + '' - substituteInPlace CMakeLists.txt \ - --replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt.so" "${lib.getLib cusparselt}/lib/libcusparseLt.so" \ - --replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt_static.a" "${lib.getStatic cusparselt}/lib/libcusparseLt_static.a" - ''; + postPatch = prevAttrs.postPatch or "" + '' + substituteInPlace CMakeLists.txt \ + --replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt.so" "${lib.getLib cusparselt}/lib/libcusparseLt.so" \ + --replace-fail "''${CUSPARSELT_ROOT}/lib64/libcusparseLt_static.a" "${lib.getStatic cusparselt}/lib/libcusparseLt_static.a" + ''; - postInstall = - prevAttrs.postInstall or "" - + '' - mkdir -p $out/bin - cp matmul_example $out/bin/ - cp matmul_example_static $out/bin/ - ''; + postInstall = prevAttrs.postInstall or "" + '' + mkdir -p $out/bin + cp matmul_example $out/bin/ + cp matmul_example_static $out/bin/ + ''; CUDA_TOOLKIT_PATH = lib.getLib cudatoolkit; CUSPARSELT_PATH = lib.getLib cusparselt; diff --git a/pkgs/development/cuda-modules/cuda-samples/generic.nix b/pkgs/development/cuda-modules/cuda-samples/generic.nix index 295fd55164b4..623e02645638 100644 --- a/pkgs/development/cuda-modules/cuda-samples/generic.nix +++ b/pkgs/development/cuda-modules/cuda-samples/generic.nix @@ -29,15 +29,14 @@ backendStdenv.mkDerivation (finalAttrs: { inherit hash; }; - nativeBuildInputs = - [ - autoAddDriverRunpath - pkg-config - ] - # CMake has to run as a native, build-time dependency for libNVVM samples. - # However, it's not the primary build tool -- that's still make. - # As such, we disable CMake's build system. - ++ lists.optionals (strings.versionAtLeast finalAttrs.version "12.2") [ cmake ]; + nativeBuildInputs = [ + autoAddDriverRunpath + pkg-config + ] + # CMake has to run as a native, build-time dependency for libNVVM samples. + # However, it's not the primary build tool -- that's still make. + # As such, we disable CMake's build system. + ++ lists.optionals (strings.versionAtLeast finalAttrs.version "12.2") [ cmake ]; dontUseCmakeConfigure = true; diff --git a/pkgs/development/cuda-modules/cudatoolkit/default.nix b/pkgs/development/cuda-modules/cudatoolkit/default.nix index 11bb4db09cb1..478418bcfc94 100644 --- a/pkgs/development/cuda-modules/cudatoolkit/default.nix +++ b/pkgs/development/cuda-modules/cudatoolkit/default.nix @@ -83,93 +83,93 @@ backendStdenv.mkDerivation rec { autoPatchelfHook autoAddDriverRunpath markForCudatoolkitRootHook - ] ++ lib.optionals (lib.versionAtLeast version "11.8") [ qt6Packages.wrapQtAppsHook ]; + ] + ++ lib.optionals (lib.versionAtLeast version "11.8") [ qt6Packages.wrapQtAppsHook ]; propagatedBuildInputs = [ setupCudaHook ]; - buildInputs = - [ - # To get $GDK_PIXBUF_MODULE_FILE via setup-hook - gdk-pixbuf + buildInputs = [ + # To get $GDK_PIXBUF_MODULE_FILE via setup-hook + gdk-pixbuf - # For autoPatchelf - ncurses5 - expat - python3 - zlib - glibc - xorg.libX11 - xorg.libXext - xorg.libXrender - xorg.libXt - xorg.libXtst - xorg.libXi - xorg.libXext - xorg.libXdamage - xorg.libxcb - xorg.xcbutilimage - xorg.xcbutilrenderutil - xorg.xcbutilwm - xorg.xcbutilkeysyms - pulseaudio - libxkbcommon - libkrb5 - krb5 - gtk2 - glib - fontconfig - freetype - numactl - nss - unixODBC - alsa-lib - wayland - libglvnd - ] - ++ lib.optionals (lib.versionAtLeast version "11.8") [ - (lib.getLib libtiff) - qt6Packages.qtwayland - rdma-core - (ucx.override { enableCuda = false; }) # Avoid infinite recursion - xorg.libxshmfence - xorg.libxkbfile - ] - ++ (lib.optionals (lib.versionAtLeast version "12") ( - map lib.getLib ([ - # Used by `/target-linux-x64/CollectX/clx` and `/target-linux-x64/CollectX/libclx_api.so` for: - # - `libcurl.so.4` - curlMinimal + # For autoPatchelf + ncurses5 + expat + python3 + zlib + glibc + xorg.libX11 + xorg.libXext + xorg.libXrender + xorg.libXt + xorg.libXtst + xorg.libXi + xorg.libXext + xorg.libXdamage + xorg.libxcb + xorg.xcbutilimage + xorg.xcbutilrenderutil + xorg.xcbutilwm + xorg.xcbutilkeysyms + pulseaudio + libxkbcommon + libkrb5 + krb5 + gtk2 + glib + fontconfig + freetype + numactl + nss + unixODBC + alsa-lib + wayland + libglvnd + ] + ++ lib.optionals (lib.versionAtLeast version "11.8") [ + (lib.getLib libtiff) + qt6Packages.qtwayland + rdma-core + (ucx.override { enableCuda = false; }) # Avoid infinite recursion + xorg.libxshmfence + xorg.libxkbfile + ] + ++ (lib.optionals (lib.versionAtLeast version "12") ( + map lib.getLib ([ + # Used by `/target-linux-x64/CollectX/clx` and `/target-linux-x64/CollectX/libclx_api.so` for: + # - `libcurl.so.4` + curlMinimal - # Used by `/host-linux-x64/Scripts/WebRTCContainer/setup/neko/server/bin/neko` - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - ]) - ++ (with qt6; [ - qtmultimedia - qttools - qtpositioning - qtscxml - qtsvg - qtwebchannel - qtwebengine - ]) - )) - ++ lib.optionals (lib.versionAtLeast version "12.6") [ - # libcrypt.so.1 - libxcrypt-legacy - ncurses6 - python310 - python311 - ] - ++ lib.optionals (lib.versionAtLeast version "12.9") [ - # Replace once https://github.com/NixOS/nixpkgs/pull/421740 is merged. - (libxml2.overrideAttrs rec { - version = "2.13.8"; - src = fetchurl { - url = "mirror://gnome/sources/libxml2/${lib.versions.majorMinor version}/libxml2-${version}.tar.xz"; - hash = "sha256-J3KUyzMRmrcbK8gfL0Rem8lDW4k60VuyzSsOhZoO6Eo="; - }; - }) - python312 - ]; + # Used by `/host-linux-x64/Scripts/WebRTCContainer/setup/neko/server/bin/neko` + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + ]) + ++ (with qt6; [ + qtmultimedia + qttools + qtpositioning + qtscxml + qtsvg + qtwebchannel + qtwebengine + ]) + )) + ++ lib.optionals (lib.versionAtLeast version "12.6") [ + # libcrypt.so.1 + libxcrypt-legacy + ncurses6 + python310 + python311 + ] + ++ lib.optionals (lib.versionAtLeast version "12.9") [ + # Replace once https://github.com/NixOS/nixpkgs/pull/421740 is merged. + (libxml2.overrideAttrs rec { + version = "2.13.8"; + src = fetchurl { + url = "mirror://gnome/sources/libxml2/${lib.versions.majorMinor version}/libxml2-${version}.tar.xz"; + hash = "sha256-J3KUyzMRmrcbK8gfL0Rem8lDW4k60VuyzSsOhZoO6Eo="; + }; + }) + python312 + ]; # Prepended to runpaths by autoPatchelf. # The order inherited from older rpath preFixup code @@ -209,125 +209,124 @@ backendStdenv.mkDerivation rec { sh $src --keep --noexec ''; - installPhase = - '' - runHook preInstall - mkdir $out - mkdir -p $out/bin $out/lib64 $out/include $doc - for dir in pkg/builds/* pkg/builds/cuda_nvcc/nvvm pkg/builds/cuda_cupti/extras/CUPTI; do - if [ -d $dir/bin ]; then - mv $dir/bin/* $out/bin - fi - if [ -d $dir/doc ]; then - (cd $dir/doc && find . -type d -exec mkdir -p $doc/\{} \;) - (cd $dir/doc && find . \( -type f -o -type l \) -exec mv \{} $doc/\{} \;) - fi - if [ -L $dir/include ] || [ -d $dir/include ]; then - (cd $dir/include && find . -type d -exec mkdir -p $out/include/\{} \;) - (cd $dir/include && find . \( -type f -o -type l \) -exec mv \{} $out/include/\{} \;) - fi - if [ -L $dir/lib64 ] || [ -d $dir/lib64 ]; then - (cd $dir/lib64 && find . -type d -exec mkdir -p $out/lib64/\{} \;) - (cd $dir/lib64 && find . \( -type f -o -type l \) -exec mv \{} $out/lib64/\{} \;) - fi - done - mv pkg/builds/cuda_nvcc/nvvm $out/nvvm - - mv pkg/builds/cuda_sanitizer_api $out/cuda_sanitizer_api - ln -s $out/cuda_sanitizer_api/compute-sanitizer/compute-sanitizer $out/bin/compute-sanitizer - - mv pkg/builds/nsight_systems/target-linux-x64 $out/target-linux-x64 - mv pkg/builds/nsight_systems/host-linux-x64 $out/host-linux-x64 - rm $out/host-linux-x64/libstdc++.so* - ${lib.optionalString (lib.versionAtLeast version "11.8" && lib.versionOlder version "12") - # error: auto-patchelf could not satisfy dependency libtiff.so.5 wanted by /nix/store/.......-cudatoolkit-12.0.1/host-linux-x64/Plugins/imageformats/libqtiff.so - # we only ship libtiff.so.6, so let's use qt plugins built by Nix. - # TODO: don't copy, come up with a symlink-based "merge" - '' - rsync ${lib.getLib qt6Packages.qtimageformats}/lib/qt-6/plugins/ $out/host-linux-x64/Plugins/ -aP - '' - } - ${lib.optionalString (lib.versionAtLeast version "12") - # Use Qt plugins built by Nix. - '' - for qtlib in $out/host-linux-x64/Plugins/*/libq*.so; do - qtdir=$(basename $(dirname $qtlib)) - filename=$(basename $qtlib) - for qtpkgdir in ${ - lib.concatMapStringsSep " " (x: qt6Packages.${x}) [ - "qtbase" - "qtimageformats" - "qtsvg" - "qtwayland" - ] - }; do - if [ -e $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename ]; then - ln -snf $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename $qtlib - fi - done - done - '' - } - - rm -f $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why? - - ${lib.optionalString (lib.versionAtLeast version "12.0") '' - rm $out/host-linux-x64/libQt6* - ''} - - # Fixup path to samples (needed for cuda 6.5 or else nsight will not find them) - if [ -d "$out"/cuda-samples ]; then - mv "$out"/cuda-samples "$out"/samples + installPhase = '' + runHook preInstall + mkdir $out + mkdir -p $out/bin $out/lib64 $out/include $doc + for dir in pkg/builds/* pkg/builds/cuda_nvcc/nvvm pkg/builds/cuda_cupti/extras/CUPTI; do + if [ -d $dir/bin ]; then + mv $dir/bin/* $out/bin fi + if [ -d $dir/doc ]; then + (cd $dir/doc && find . -type d -exec mkdir -p $doc/\{} \;) + (cd $dir/doc && find . \( -type f -o -type l \) -exec mv \{} $doc/\{} \;) + fi + if [ -L $dir/include ] || [ -d $dir/include ]; then + (cd $dir/include && find . -type d -exec mkdir -p $out/include/\{} \;) + (cd $dir/include && find . \( -type f -o -type l \) -exec mv \{} $out/include/\{} \;) + fi + if [ -L $dir/lib64 ] || [ -d $dir/lib64 ]; then + (cd $dir/lib64 && find . -type d -exec mkdir -p $out/lib64/\{} \;) + (cd $dir/lib64 && find . \( -type f -o -type l \) -exec mv \{} $out/lib64/\{} \;) + fi + done + mv pkg/builds/cuda_nvcc/nvvm $out/nvvm - # Change the #error on GCC > 4.9 to a #warning. - sed -i $out/include/host_config.h -e 's/#error\(.*unsupported GNU version\)/#warning\1/' + mv pkg/builds/cuda_sanitizer_api $out/cuda_sanitizer_api + ln -s $out/cuda_sanitizer_api/compute-sanitizer/compute-sanitizer $out/bin/compute-sanitizer - # Fix builds with newer glibc version - sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h" - '' - + - # Point NVCC at a compatible compiler - # CUDA_TOOLKIT_ROOT_DIR is legacy, - # Cf. https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables - '' - mkdir -p $out/nix-support - cat <> $out/nix-support/setup-hook - cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out' - EOF - - # Move some libraries to the lib output so that programs that - # depend on them don't pull in this entire monstrosity. - mkdir -p $lib/lib - mv -v $out/lib64/libcudart* $lib/lib/ - - # Remove OpenCL libraries as they are provided by ocl-icd and driver. - rm -f $out/lib64/libOpenCL* - - # nvprof do not find any program to profile if LD_LIBRARY_PATH is not set - wrapProgram $out/bin/nvprof \ - --prefix LD_LIBRARY_PATH : $out/lib - '' - # 11.8 and 12.9 include a broken symlink, include/include, pointing to targets/x86_64-linux/include - + - lib.optionalString - (lib.versions.majorMinor version == "11.8" || lib.versions.majorMinor version == "12.9") + mv pkg/builds/nsight_systems/target-linux-x64 $out/target-linux-x64 + mv pkg/builds/nsight_systems/host-linux-x64 $out/host-linux-x64 + rm $out/host-linux-x64/libstdc++.so* + ${lib.optionalString (lib.versionAtLeast version "11.8" && lib.versionOlder version "12") + # error: auto-patchelf could not satisfy dependency libtiff.so.5 wanted by /nix/store/.......-cudatoolkit-12.0.1/host-linux-x64/Plugins/imageformats/libqtiff.so + # we only ship libtiff.so.6, so let's use qt plugins built by Nix. + # TODO: don't copy, come up with a symlink-based "merge" '' - rm $out/include/include + rsync ${lib.getLib qt6Packages.qtimageformats}/lib/qt-6/plugins/ $out/host-linux-x64/Plugins/ -aP '' - # 12.9 has another broken symlink, lib64/lib64, pointing to lib/targets/x86_64-linux/lib - + lib.optionalString (lib.versions.majorMinor version == "12.9") '' - rm $out/lib64/lib64 + } + ${lib.optionalString (lib.versionAtLeast version "12") + # Use Qt plugins built by Nix. + '' + for qtlib in $out/host-linux-x64/Plugins/*/libq*.so; do + qtdir=$(basename $(dirname $qtlib)) + filename=$(basename $qtlib) + for qtpkgdir in ${ + lib.concatMapStringsSep " " (x: qt6Packages.${x}) [ + "qtbase" + "qtimageformats" + "qtsvg" + "qtwayland" + ] + }; do + if [ -e $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename ]; then + ln -snf $qtpkgdir/lib/qt-6/plugins/$qtdir/$filename $qtlib + fi + done + done + '' + } + + rm -f $out/tools/CUDA_Occupancy_Calculator.xls # FIXME: why? + + ${lib.optionalString (lib.versionAtLeast version "12.0") '' + rm $out/host-linux-x64/libQt6* + ''} + + # Fixup path to samples (needed for cuda 6.5 or else nsight will not find them) + if [ -d "$out"/cuda-samples ]; then + mv "$out"/cuda-samples "$out"/samples + fi + + # Change the #error on GCC > 4.9 to a #warning. + sed -i $out/include/host_config.h -e 's/#error\(.*unsupported GNU version\)/#warning\1/' + + # Fix builds with newer glibc version + sed -i "1 i#define _BITS_FLOATN_H" "$out/include/host_defines.h" + '' + + + # Point NVCC at a compatible compiler + # CUDA_TOOLKIT_ROOT_DIR is legacy, + # Cf. https://cmake.org/cmake/help/latest/module/FindCUDA.html#input-variables '' - # Python 3.8 and 3.9 are not in nixpkgs anymore, delete Python 3.{8,9} cuda-gdb support - # to avoid autopatchelf failing to find libpython3.{8,9}.so. - + lib.optionalString (lib.versionAtLeast version "12.6") '' - find $out -name '*python3.8*' -delete - find $out -name '*python3.9*' -delete + mkdir -p $out/nix-support + cat <> $out/nix-support/setup-hook + cmakeFlags+=' -DCUDA_TOOLKIT_ROOT_DIR=$out' + EOF + + # Move some libraries to the lib output so that programs that + # depend on them don't pull in this entire monstrosity. + mkdir -p $lib/lib + mv -v $out/lib64/libcudart* $lib/lib/ + + # Remove OpenCL libraries as they are provided by ocl-icd and driver. + rm -f $out/lib64/libOpenCL* + + # nvprof do not find any program to profile if LD_LIBRARY_PATH is not set + wrapProgram $out/bin/nvprof \ + --prefix LD_LIBRARY_PATH : $out/lib '' - + '' - runHook postInstall - ''; + # 11.8 and 12.9 include a broken symlink, include/include, pointing to targets/x86_64-linux/include + + + lib.optionalString + (lib.versions.majorMinor version == "11.8" || lib.versions.majorMinor version == "12.9") + '' + rm $out/include/include + '' + # 12.9 has another broken symlink, lib64/lib64, pointing to lib/targets/x86_64-linux/lib + + lib.optionalString (lib.versions.majorMinor version == "12.9") '' + rm $out/lib64/lib64 + '' + # Python 3.8 and 3.9 are not in nixpkgs anymore, delete Python 3.{8,9} cuda-gdb support + # to avoid autopatchelf failing to find libpython3.{8,9}.so. + + lib.optionalString (lib.versionAtLeast version "12.6") '' + find $out -name '*python3.8*' -delete + find $out -name '*python3.9*' -delete + '' + + '' + runHook postInstall + ''; postInstall = '' for b in nvvp; do diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix index 36872cf9682f..7f346df79809 100644 --- a/pkgs/development/cuda-modules/generic-builders/manifest.nix +++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix @@ -201,24 +201,23 @@ in # We do need some other phases, like configurePhase, so the multiple-output setup hook works. dontBuild = true; - nativeBuildInputs = - [ - autoPatchelfHook - # This hook will make sure libcuda can be found - # in typically /lib/opengl-driver by adding that - # directory to the rpath of all ELF binaries. - # Check e.g. with `patchelf --print-rpath path/to/my/binary - autoAddDriverRunpath - markForCudatoolkitRootHook - ] - # autoAddCudaCompatRunpath depends on cuda_compat and would cause - # infinite recursion if applied to `cuda_compat` itself (beside the fact - # that it doesn't make sense in the first place) - ++ lib.optionals (pname != "cuda_compat" && flags.isJetsonBuild) [ - # autoAddCudaCompatRunpath must appear AFTER autoAddDriverRunpath. - # See its documentation in ./setup-hooks/extension.nix. - autoAddCudaCompatRunpath - ]; + nativeBuildInputs = [ + autoPatchelfHook + # This hook will make sure libcuda can be found + # in typically /lib/opengl-driver by adding that + # directory to the rpath of all ELF binaries. + # Check e.g. with `patchelf --print-rpath path/to/my/binary + autoAddDriverRunpath + markForCudatoolkitRootHook + ] + # autoAddCudaCompatRunpath depends on cuda_compat and would cause + # infinite recursion if applied to `cuda_compat` itself (beside the fact + # that it doesn't make sense in the first place) + ++ lib.optionals (pname != "cuda_compat" && flags.isJetsonBuild) [ + # autoAddCudaCompatRunpath must appear AFTER autoAddDriverRunpath. + # See its documentation in ./setup-hooks/extension.nix. + autoAddCudaCompatRunpath + ]; buildInputs = [ # autoPatchelfHook will search for a libstdc++ and we're giving it diff --git a/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix b/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix index 22b895f7658e..b9e622b9f31e 100644 --- a/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix +++ b/pkgs/development/cuda-modules/packages/cudnn-frontend/package.nix @@ -57,15 +57,14 @@ stdenv.mkDerivation (finalAttrs: { # TODO: As a header-only library, we should make sure we have an `include` directory or similar which is not a # superset of the `out` (`bin`) or `dev` outputs (which is what the multiple-outputs setup hook does by default). - outputs = - [ - "out" - ] - ++ optionals finalAttrs.doCheck [ - "legacy_samples" - "samples" - "tests" - ]; + outputs = [ + "out" + ] + ++ optionals finalAttrs.doCheck [ + "legacy_samples" + "samples" + "tests" + ]; nativeBuildInputs = [ autoAddDriverRunpath # Needed for samples because it links against CUDA::cuda_driver diff --git a/pkgs/development/cuda-modules/packages/nccl-tests.nix b/pkgs/development/cuda-modules/packages/nccl-tests.nix index 84f048a706ef..fb800bd4dae5 100644 --- a/pkgs/development/cuda-modules/packages/nccl-tests.nix +++ b/pkgs/development/cuda-modules/packages/nccl-tests.nix @@ -42,28 +42,31 @@ backendStdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ which ] - ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] - ++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ]; + nativeBuildInputs = [ + which + ] + ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] + ++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ]; - buildInputs = - [ nccl ] - ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] - ++ lib.optionals (cudaAtLeast "11.4") [ - cuda_nvcc # crt/host_config.h - cuda_cudart - ] - ++ lib.optionals (cudaAtLeast "12.0") [ - cuda_cccl # - ] - ++ lib.optionals mpiSupport [ mpi ]; + buildInputs = [ + nccl + ] + ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] + ++ lib.optionals (cudaAtLeast "11.4") [ + cuda_nvcc # crt/host_config.h + cuda_cudart + ] + ++ lib.optionals (cudaAtLeast "12.0") [ + cuda_cccl # + ] + ++ lib.optionals mpiSupport [ mpi ]; - makeFlags = - [ "NCCL_HOME=${nccl}" ] - ++ lib.optionals (cudaOlder "11.4") [ "CUDA_HOME=${cudatoolkit}" ] - ++ lib.optionals (cudaAtLeast "11.4") [ "CUDA_HOME=${cuda_nvcc}" ] - ++ lib.optionals mpiSupport [ "MPI=1" ]; + makeFlags = [ + "NCCL_HOME=${nccl}" + ] + ++ lib.optionals (cudaOlder "11.4") [ "CUDA_HOME=${cudatoolkit}" ] + ++ lib.optionals (cudaAtLeast "11.4") [ "CUDA_HOME=${cuda_nvcc}" ] + ++ lib.optionals mpiSupport [ "MPI=1" ]; enableParallelBuilding = true; diff --git a/pkgs/development/cuda-modules/packages/nccl.nix b/pkgs/development/cuda-modules/packages/nccl.nix index a469f9602742..871e06a90b09 100644 --- a/pkgs/development/cuda-modules/packages/nccl.nix +++ b/pkgs/development/cuda-modules/packages/nccl.nix @@ -50,14 +50,13 @@ backendStdenv.mkDerivation (finalAttrs: { "dev" ]; - nativeBuildInputs = - [ - which - autoAddDriverRunpath - python3 - ] - ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] - ++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ]; + nativeBuildInputs = [ + which + autoAddDriverRunpath + python3 + ] + ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] + ++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ]; buildInputs = lib.optionals (cudaOlder "11.4") [ cudatoolkit ] @@ -73,32 +72,30 @@ backendStdenv.mkDerivation (finalAttrs: { env.NIX_CFLAGS_COMPILE = toString [ "-Wno-unused-function" ]; - postPatch = - '' - patchShebangs ./src/device/generate.py - '' - # CUDA 12.8 uses GCC 14 and we need to bump C++ standard to C++14 - # in order to work with new constexpr handling - + lib.optionalString (cudaAtLeast "12.8") '' - substituteInPlace ./makefiles/common.mk \ - --replace-fail "-std=c++11" "-std=c++14" - ''; + postPatch = '' + patchShebangs ./src/device/generate.py + '' + # CUDA 12.8 uses GCC 14 and we need to bump C++ standard to C++14 + # in order to work with new constexpr handling + + lib.optionalString (cudaAtLeast "12.8") '' + substituteInPlace ./makefiles/common.mk \ + --replace-fail "-std=c++11" "-std=c++14" + ''; - makeFlags = - [ - "PREFIX=$(out)" - "NVCC_GENCODE=${flags.gencodeString}" - ] - ++ lib.optionals (cudaOlder "11.4") [ - "CUDA_HOME=${cudatoolkit}" - "CUDA_LIB=${lib.getLib cudatoolkit}/lib" - "CUDA_INC=${lib.getDev cudatoolkit}/include" - ] - ++ lib.optionals (cudaAtLeast "11.4") [ - "CUDA_HOME=${cuda_nvcc}" - "CUDA_LIB=${lib.getLib cuda_cudart}/lib" - "CUDA_INC=${lib.getDev cuda_cudart}/include" - ]; + makeFlags = [ + "PREFIX=$(out)" + "NVCC_GENCODE=${flags.gencodeString}" + ] + ++ lib.optionals (cudaOlder "11.4") [ + "CUDA_HOME=${cudatoolkit}" + "CUDA_LIB=${lib.getLib cudatoolkit}/lib" + "CUDA_INC=${lib.getDev cudatoolkit}/include" + ] + ++ lib.optionals (cudaAtLeast "11.4") [ + "CUDA_HOME=${cuda_nvcc}" + "CUDA_LIB=${lib.getLib cuda_cudart}/lib" + "CUDA_INC=${lib.getDev cuda_cudart}/include" + ]; enableParallelBuilding = true; diff --git a/pkgs/development/cuda-modules/packages/saxpy/package.nix b/pkgs/development/cuda-modules/packages/saxpy/package.nix index b214df4a9e87..adb48090497e 100644 --- a/pkgs/development/cuda-modules/packages/saxpy/package.nix +++ b/pkgs/development/cuda-modules/packages/saxpy/package.nix @@ -28,13 +28,12 @@ backendStdenv.mkDerivation { __structuredAttrs = true; strictDeps = true; - nativeBuildInputs = - [ - cmake - autoAddDriverRunpath - ] - ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] - ++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ]; + nativeBuildInputs = [ + cmake + autoAddDriverRunpath + ] + ++ lib.optionals (cudaOlder "11.4") [ cudatoolkit ] + ++ lib.optionals (cudaAtLeast "11.4") [ cuda_nvcc ]; buildInputs = lib.optionals (cudaOlder "11.4") [ cudatoolkit ] diff --git a/pkgs/development/em-modules/generic/default.nix b/pkgs/development/em-modules/generic/default.nix index c34fdaf82a59..394defdb631d 100644 --- a/pkgs/development/em-modules/generic/default.nix +++ b/pkgs/development/em-modules/generic/default.nix @@ -29,11 +29,13 @@ wrapDerivation ( buildInputs = [ emscripten python3 - ] ++ buildInputs; + ] + ++ buildInputs; nativeBuildInputs = [ emscripten python3 - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; # fake conftest results with emscripten's python magic EMCONFIGURE_JS = 2; @@ -84,17 +86,16 @@ wrapDerivation ( enableParallelBuilding = args.enableParallelBuilding or true; - meta = - { - # Add default meta information - platforms = lib.platforms.all; - # Do not build this automatically - hydraPlatforms = [ ]; - } - // meta - // { - # add an extra maintainer to every package - maintainers = (meta.maintainers or [ ]) ++ [ lib.maintainers.qknight ]; - }; + meta = { + # Add default meta information + platforms = lib.platforms.all; + # Do not build this automatically + hydraPlatforms = [ ]; + } + // meta + // { + # add an extra maintainer to every package + maintainers = (meta.maintainers or [ ]) ++ [ lib.maintainers.qknight ]; + }; } ) diff --git a/pkgs/development/embedded/arduino/arduino-core/default.nix b/pkgs/development/embedded/arduino/arduino-core/default.nix index 133e5b02fda6..7f62463ceba9 100644 --- a/pkgs/development/embedded/arduino/arduino-core/default.nix +++ b/pkgs/development/embedded/arduino/arduino-core/default.nix @@ -149,7 +149,8 @@ stdenv.mkDerivation rec { zlib ncurses5 readline - ] ++ lib.optionals withTeensyduino [ upx ]; + ] + ++ lib.optionals withTeensyduino [ upx ]; downloadSrcList = builtins.attrValues externalDownloads; downloadDstList = builtins.attrNames externalDownloads; diff --git a/pkgs/development/embedded/platformio/core.nix b/pkgs/development/embedded/platformio/core.nix index 7ad77d944485..3c5e23eeed41 100644 --- a/pkgs/development/embedded/platformio/core.nix +++ b/pkgs/development/embedded/platformio/core.nix @@ -63,32 +63,31 @@ buildPythonApplication rec { pythonRelaxDeps = true; - propagatedBuildInputs = - [ - aiofiles - ajsonrpc - bottle - click - click-completion - colorama - git - lockfile - marshmallow - pyelftools - pyserial - requests - semantic-version - setuptools - spdx-license-list-data.json - starlette - tabulate - uvicorn - wsproto - zeroconf - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - chardet - ]; + propagatedBuildInputs = [ + aiofiles + ajsonrpc + bottle + click + click-completion + colorama + git + lockfile + marshmallow + pyelftools + pyserial + requests + semantic-version + setuptools + spdx-license-list-data.json + starlette + tabulate + uvicorn + wsproto + zeroconf + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + chardet + ]; preCheck = '' export PATH=$PATH:$out/bin @@ -142,68 +141,67 @@ buildPythonApplication rec { "test_metadata_dump" ]; - pytestFlagsArray = - [ - "tests" - ] - ++ (map (e: "--deselect tests/${e}") [ - "commands/pkg/test_exec.py::test_pkg_specified" - "commands/pkg/test_exec.py::test_unrecognized_options" - "commands/test_ci.py::test_ci_boards" - "commands/test_ci.py::test_ci_build_dir" - "commands/test_ci.py::test_ci_keep_build_dir" - "commands/test_ci.py::test_ci_lib_and_board" - "commands/test_ci.py::test_ci_project_conf" - "commands/test_init.py::test_init_custom_framework" - "commands/test_init.py::test_init_duplicated_boards" - "commands/test_init.py::test_init_enable_auto_uploading" - "commands/test_init.py::test_init_ide_atom" - "commands/test_init.py::test_init_ide_clion" - "commands/test_init.py::test_init_ide_eclipse" - "commands/test_init.py::test_init_ide_vscode" - "commands/test_init.py::test_init_incorrect_board" - "commands/test_init.py::test_init_special_board" - "commands/test_lib.py::test_global_install_archive" - "commands/test_lib.py::test_global_install_registry" - "commands/test_lib.py::test_global_install_repository" - "commands/test_lib.py::test_global_lib_list" - "commands/test_lib.py::test_global_lib_uninstall" - "commands/test_lib.py::test_global_lib_update" - "commands/test_lib.py::test_global_lib_update_check" - "commands/test_lib.py::test_install_duplicates" - "commands/test_lib.py::test_lib_show" - "commands/test_lib.py::test_lib_stats" - "commands/test_lib.py::test_saving_deps" - "commands/test_lib.py::test_search" - "commands/test_lib.py::test_update" - "commands/test_lib_complex.py::test_global_install_archive" - "commands/test_lib_complex.py::test_global_install_registry" - "commands/test_lib_complex.py::test_global_install_repository" - "commands/test_lib_complex.py::test_global_lib_list" - "commands/test_lib_complex.py::test_global_lib_uninstall" - "commands/test_lib_complex.py::test_global_lib_update" - "commands/test_lib_complex.py::test_global_lib_update_check" - "commands/test_lib_complex.py::test_install_duplicates" - "commands/test_lib_complex.py::test_lib_show" - "commands/test_lib_complex.py::test_lib_stats" - "commands/test_lib_complex.py::test_search" - "package/test_manager.py::test_download" - "package/test_manager.py::test_install_force" - "package/test_manager.py::test_install_from_registry" - "package/test_manager.py::test_install_lib_depndencies" - "package/test_manager.py::test_registry" - "package/test_manager.py::test_uninstall" - "package/test_manager.py::test_update_with_metadata" - "package/test_manager.py::test_update_without_metadata" - "test_builder.py::test_build_flags" - "test_builder.py::test_build_unflags" - "test_builder.py::test_debug_custom_build_flags" - "test_builder.py::test_debug_default_build_flags" - "test_misc.py::test_api_cache" - "test_misc.py::test_ping_internet_ips" - "test_misc.py::test_platformio_cli" - "test_pkgmanifest.py::test_packages" - ]); + pytestFlagsArray = [ + "tests" + ] + ++ (map (e: "--deselect tests/${e}") [ + "commands/pkg/test_exec.py::test_pkg_specified" + "commands/pkg/test_exec.py::test_unrecognized_options" + "commands/test_ci.py::test_ci_boards" + "commands/test_ci.py::test_ci_build_dir" + "commands/test_ci.py::test_ci_keep_build_dir" + "commands/test_ci.py::test_ci_lib_and_board" + "commands/test_ci.py::test_ci_project_conf" + "commands/test_init.py::test_init_custom_framework" + "commands/test_init.py::test_init_duplicated_boards" + "commands/test_init.py::test_init_enable_auto_uploading" + "commands/test_init.py::test_init_ide_atom" + "commands/test_init.py::test_init_ide_clion" + "commands/test_init.py::test_init_ide_eclipse" + "commands/test_init.py::test_init_ide_vscode" + "commands/test_init.py::test_init_incorrect_board" + "commands/test_init.py::test_init_special_board" + "commands/test_lib.py::test_global_install_archive" + "commands/test_lib.py::test_global_install_registry" + "commands/test_lib.py::test_global_install_repository" + "commands/test_lib.py::test_global_lib_list" + "commands/test_lib.py::test_global_lib_uninstall" + "commands/test_lib.py::test_global_lib_update" + "commands/test_lib.py::test_global_lib_update_check" + "commands/test_lib.py::test_install_duplicates" + "commands/test_lib.py::test_lib_show" + "commands/test_lib.py::test_lib_stats" + "commands/test_lib.py::test_saving_deps" + "commands/test_lib.py::test_search" + "commands/test_lib.py::test_update" + "commands/test_lib_complex.py::test_global_install_archive" + "commands/test_lib_complex.py::test_global_install_registry" + "commands/test_lib_complex.py::test_global_install_repository" + "commands/test_lib_complex.py::test_global_lib_list" + "commands/test_lib_complex.py::test_global_lib_uninstall" + "commands/test_lib_complex.py::test_global_lib_update" + "commands/test_lib_complex.py::test_global_lib_update_check" + "commands/test_lib_complex.py::test_install_duplicates" + "commands/test_lib_complex.py::test_lib_show" + "commands/test_lib_complex.py::test_lib_stats" + "commands/test_lib_complex.py::test_search" + "package/test_manager.py::test_download" + "package/test_manager.py::test_install_force" + "package/test_manager.py::test_install_from_registry" + "package/test_manager.py::test_install_lib_depndencies" + "package/test_manager.py::test_registry" + "package/test_manager.py::test_uninstall" + "package/test_manager.py::test_update_with_metadata" + "package/test_manager.py::test_update_without_metadata" + "test_builder.py::test_build_flags" + "test_builder.py::test_build_unflags" + "test_builder.py::test_debug_custom_build_flags" + "test_builder.py::test_debug_default_build_flags" + "test_misc.py::test_api_cache" + "test_misc.py::test_ping_internet_ips" + "test_misc.py::test_platformio_cli" + "test_pkgmanifest.py::test_packages" + ]); passthru = { python = python3Packages.python; diff --git a/pkgs/development/gnuradio-modules/bladeRF/default.nix b/pkgs/development/gnuradio-modules/bladeRF/default.nix index 6251784b3a4c..406fee83202e 100644 --- a/pkgs/development/gnuradio-modules/bladeRF/default.nix +++ b/pkgs/development/gnuradio-modules/bladeRF/default.nix @@ -26,33 +26,31 @@ mkDerivation { hash = "sha256-josovHEp2VxgZqItkTAISdY1LARMIvQKD604fh4iZWc="; }; - buildInputs = - [ - boost - doxygen - gmp - gnuradio - libbladeRF - mpir - osmosdr - spdlog - ] - ++ lib.optionals (gnuradio.hasFeature "python-support") [ - python.pkgs.numpy - python.pkgs.pybind11 - ]; + buildInputs = [ + boost + doxygen + gmp + gnuradio + libbladeRF + mpir + osmosdr + spdlog + ] + ++ lib.optionals (gnuradio.hasFeature "python-support") [ + python.pkgs.numpy + python.pkgs.pybind11 + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_PYTHON" (gnuradio.hasFeature "python-support")) ]; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals (gnuradio.hasFeature "python-support") [ - python.pkgs.mako - python.pkgs.pygccxml - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals (gnuradio.hasFeature "python-support") [ + python.pkgs.mako + python.pkgs.pygccxml + ]; meta = { description = "GNU Radio source and sink blocks for bladeRF devices"; diff --git a/pkgs/development/gnuradio-modules/fosphor/default.nix b/pkgs/development/gnuradio-modules/fosphor/default.nix index d6334cf9d116..eafe57d57583 100644 --- a/pkgs/development/gnuradio-modules/fosphor/default.nix +++ b/pkgs/development/gnuradio-modules/fosphor/default.nix @@ -37,40 +37,38 @@ mkDerivation { }; disabled = gnuradioOlder "3.9" || gnuradioAtLeast "3.11"; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals (gnuradio.hasFeature "gr-qtgui") [ - qt5.wrapQtAppsHook - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals (gnuradio.hasFeature "gr-qtgui") [ + qt5.wrapQtAppsHook + ]; - buildInputs = - [ - logLib - mpir - gmp - boost - libGL - opencl-headers - ocl-icd - freetype - fftwFloat - ] - ++ lib.optionals (gnuradio.hasFeature "gr-qtgui") [ - qt5.qtbase - ] - ++ lib.optionals (gnuradio.hasFeature "python-support") [ - python.pkgs.pybind11 - python.pkgs.numpy - ] - ++ lib.optionals enableGLFW [ - glfw3 - ] - ++ lib.optionals enablePNG [ - libpng - ]; + buildInputs = [ + logLib + mpir + gmp + boost + libGL + opencl-headers + ocl-icd + freetype + fftwFloat + ] + ++ lib.optionals (gnuradio.hasFeature "gr-qtgui") [ + qt5.qtbase + ] + ++ lib.optionals (gnuradio.hasFeature "python-support") [ + python.pkgs.pybind11 + python.pkgs.numpy + ] + ++ lib.optionals enableGLFW [ + glfw3 + ] + ++ lib.optionals enablePNG [ + libpng + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_QT" (gnuradio.hasFeature "gr-qtgui")) diff --git a/pkgs/development/gnuradio-modules/lora_sdr/default.nix b/pkgs/development/gnuradio-modules/lora_sdr/default.nix index b980ad665800..18ac1fc65e2a 100644 --- a/pkgs/development/gnuradio-modules/lora_sdr/default.nix +++ b/pkgs/development/gnuradio-modules/lora_sdr/default.nix @@ -35,17 +35,16 @@ mkDerivation { pkg-config ]; - buildInputs = - [ - logLib - mpir - gmp - boost - ] - ++ lib.optionals (gnuradio.hasFeature "python-support") [ - python.pkgs.pybind11 - python.pkgs.numpy - ]; + buildInputs = [ + logLib + mpir + gmp + boost + ] + ++ lib.optionals (gnuradio.hasFeature "python-support") [ + python.pkgs.pybind11 + python.pkgs.numpy + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_PYTHON" (gnuradio.hasFeature "python-support")) diff --git a/pkgs/development/gnuradio-modules/osmosdr/default.nix b/pkgs/development/gnuradio-modules/osmosdr/default.nix index d2fa4fd1866a..a1fbe4e7cc46 100644 --- a/pkgs/development/gnuradio-modules/osmosdr/default.nix +++ b/pkgs/development/gnuradio-modules/osmosdr/default.nix @@ -41,46 +41,44 @@ mkDerivation rec { "dev" ]; - buildInputs = - [ - logLib - mpir - boost - fftwFloat - gmp - icu - airspy - hackrf - libbladeRF - rtl-sdr - soapysdr-with-plugins - ] - ++ lib.optionals (gnuradio.hasFeature "gr-blocks") [ - libsndfile - ] - ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [ - uhd - ] - ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ - thrift - python.pkgs.thrift - ] - ++ lib.optionals (gnuradio.hasFeature "python-support") [ - python.pkgs.numpy - python.pkgs.pybind11 - ]; + buildInputs = [ + logLib + mpir + boost + fftwFloat + gmp + icu + airspy + hackrf + libbladeRF + rtl-sdr + soapysdr-with-plugins + ] + ++ lib.optionals (gnuradio.hasFeature "gr-blocks") [ + libsndfile + ] + ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [ + uhd + ] + ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ + thrift + python.pkgs.thrift + ] + ++ lib.optionals (gnuradio.hasFeature "python-support") [ + python.pkgs.numpy + python.pkgs.pybind11 + ]; cmakeFlags = [ (if (gnuradio.hasFeature "python-support") then "-DENABLE_PYTHON=ON" else "-DENABLE_PYTHON=OFF") ]; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals (gnuradio.hasFeature "python-support") [ - python.pkgs.mako - python - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals (gnuradio.hasFeature "python-support") [ + python.pkgs.mako + python + ]; meta = { description = "Gnuradio block for OsmoSDR and rtl-sdr"; diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 9cf00c318a16..2de8190498fe 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -71,11 +71,9 @@ with haskellLib; (drv: { # Revert increased lower bound on unix since we have backported # the required patch to all GHC bundled versions of unix. - postPatch = - drv.postPatch or "" - + '' - substituteInPlace Cabal.cabal --replace-fail "unix >= 2.8.6.0" "unix >= 2.6.0.0" - ''; + postPatch = drv.postPatch or "" + '' + substituteInPlace Cabal.cabal --replace-fail "unix >= 2.8.6.0" "unix >= 2.6.0.0" + ''; }) ( doDistribute ( @@ -118,35 +116,34 @@ with haskellLib; old: { # Prevent DOS line endings from Hackage from breaking a patch - prePatch = - old.prePatch or "" - + '' - ${pkgs.buildPackages.dos2unix}/bin/dos2unix *.cabal - ''; + prePatch = old.prePatch or "" + '' + ${pkgs.buildPackages.dos2unix}/bin/dos2unix *.cabal + ''; # Ignore unix bound intended to prevent an unix bug on 32bit systems. # We apply a patch for this issue to the GHC core packages directly. # See unix-fix-ctimeval-size-32-bit.patch in ../compilers/ghc/common-*.nix patches = old.patches or [ ] - ++ lib.optionals - ( - scope.unix == null - && lib.elem self.ghc.version [ - "9.6.1" - "9.6.2" - "9.6.3" - "9.6.4" - "9.6.5" - "9.6.6" - "9.8.1" - "9.8.2" - "9.8.3" - "9.10.1" - ] - ) - [ - ./patches/cabal-install-3.14.1.1-lift-unix-bound.patch - ]; + ++ + lib.optionals + ( + scope.unix == null + && lib.elem self.ghc.version [ + "9.6.1" + "9.6.2" + "9.6.3" + "9.6.4" + "9.6.5" + "9.6.6" + "9.8.1" + "9.8.2" + "9.8.3" + "9.10.1" + ] + ) + [ + ./patches/cabal-install-3.14.1.1-lift-unix-bound.patch + ]; } // lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) { postInstall = '' @@ -714,11 +711,9 @@ with haskellLib; ABList = dontCheck super.ABList; inline-c-cpp = overrideCabal (drv: { - postPatch = - (drv.postPatch or "") - + '' - substituteInPlace inline-c-cpp.cabal --replace "-optc-std=c++11" "" - ''; + postPatch = (drv.postPatch or "") + '' + substituteInPlace inline-c-cpp.cabal --replace "-optc-std=c++11" "" + ''; }) super.inline-c-cpp; inline-java = addBuildDepend pkgs.jdk super.inline-java; @@ -1240,11 +1235,9 @@ with haskellLib; # https://github.com/Philonous/hs-stun/pull/1 # Remove if a version > 0.1.0.1 ever gets released. stunclient = overrideCabal (drv: { - postPatch = - (drv.postPatch or "") - + '' - substituteInPlace source/Network/Stun/MappedAddress.hs --replace "import Network.Endian" "" - ''; + postPatch = (drv.postPatch or "") + '' + substituteInPlace source/Network/Stun/MappedAddress.hs --replace "import Network.Endian" "" + ''; }) super.stunclient; d-bus = @@ -1323,13 +1316,11 @@ with haskellLib; # in LTS-13.x. cryptol = overrideCabal (drv: { buildTools = drv.buildTools or [ ] ++ [ pkgs.buildPackages.makeWrapper ]; - postInstall = - drv.postInstall or "" - + '' - for b in $out/bin/cryptol $out/bin/cryptol-html; do - wrapProgram $b --prefix 'PATH' ':' "${lib.getBin pkgs.z3}/bin" - done - ''; + postInstall = drv.postInstall or "" + '' + for b in $out/bin/cryptol $out/bin/cryptol-html; do + wrapProgram $b --prefix 'PATH' ':' "${lib.getBin pkgs.z3}/bin" + done + ''; }) super.cryptol; # Z3 removed aliases for boolean types in 4.12 @@ -1362,11 +1353,10 @@ with haskellLib; # Flaky tests: https://github.com/jfischoff/tmp-postgres/issues/274 doCheck = false; - preCheck = - '' - export HOME="$TMPDIR" - '' - + (drv.preCheck or ""); + preCheck = '' + export HOME="$TMPDIR" + '' + + (drv.preCheck or ""); libraryToolDepends = drv.libraryToolDepends or [ ] ++ [ pkgs.buildPackages.postgresql ]; testToolDepends = drv.testToolDepends or [ ] ++ [ pkgs.procps ]; }) super.tmp-postgres; @@ -1430,11 +1420,9 @@ with haskellLib; # Workaround for https://github.com/sol/hpack/issues/528 # The hpack test suite can't deal with the CRLF line endings hackage revisions insert hpack = overrideCabal (drv: { - postPatch = - drv.postPatch or "" - + '' - "${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix" *.cabal - ''; + postPatch = drv.postPatch or "" + '' + "${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix" *.cabal + ''; }) super.hpack; # hslua has tests that break when using musl. @@ -1511,12 +1499,10 @@ with haskellLib; # https://github.com/NixOS/nixpkgs/issues/6860 PortMidi = overrideCabal (drv: { patches = (drv.patches or [ ]) ++ [ ./patches/portmidi-alsa-plugins.patch ]; - postPatch = - (drv.postPatch or "") - + '' - substituteInPlace portmidi/pm_linux/pmlinuxalsa.c \ - --replace @alsa_plugin_dir@ "${pkgs.alsa-plugins}/lib/alsa-lib" - ''; + postPatch = (drv.postPatch or "") + '' + substituteInPlace portmidi/pm_linux/pmlinuxalsa.c \ + --replace @alsa_plugin_dir@ "${pkgs.alsa-plugins}/lib/alsa-lib" + ''; }) super.PortMidi; scat = overrideCabal (drv: { @@ -1540,20 +1526,16 @@ with haskellLib; esqueleto = overrideCabal (drv: { - postPatch = - drv.postPatch or "" - + '' - # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp - sed -i test/PostgreSQL/Test.hs \ - -e s^host=localhost^^ - ''; + postPatch = drv.postPatch or "" + '' + # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp + sed -i test/PostgreSQL/Test.hs \ + -e s^host=localhost^^ + ''; # Match the test suite defaults (or hardcoded values?) - preCheck = - drv.preCheck or "" - + '' - PGUSER=esqutest - PGDATABASE=esqutest - ''; + preCheck = drv.preCheck or "" + '' + PGUSER=esqutest + PGDATABASE=esqutest + ''; testFlags = drv.testFlags or [ ] ++ [ # We don't have a MySQL test hook yet "--skip=/Esqueleto/MySQL" @@ -1621,34 +1603,28 @@ with haskellLib; ] ( overrideCabal (drv: { - postPatch = - super.postPatch or "" - + '' - # Restore the symlink (to the file we patch) which becomes a regular file - # in the hackage tarball - ln -sf README.md README.lhs - ''; + postPatch = super.postPatch or "" + '' + # Restore the symlink (to the file we patch) which becomes a regular file + # in the hackage tarball + ln -sf README.md README.lhs + ''; }) super.servant-client ); # it wants to build a statically linked binary by default hledger-flow = overrideCabal (drv: { - postPatch = - (drv.postPatch or "") - + '' - substituteInPlace hledger-flow.cabal --replace "-static" "" - ''; + postPatch = (drv.postPatch or "") + '' + substituteInPlace hledger-flow.cabal --replace "-static" "" + ''; }) super.hledger-flow; # Chart-tests needs and compiles some modules from Chart itself Chart-tests = overrideCabal (old: { # 2025-02-13: Too strict bounds on lens < 5.3 and vector < 0.13 jailbreak = true; - preCheck = - old.preCheck or "" - + '' - tar --one-top-level=../chart --strip-components=1 -xf ${self.Chart.src} - ''; + preCheck = old.preCheck or "" + '' + tar --one-top-level=../chart --strip-components=1 -xf ${self.Chart.src} + ''; }) (addExtraLibrary self.QuickCheck super.Chart-tests); # This breaks because of version bounds, but compiles and runs fine. @@ -1667,20 +1643,16 @@ with haskellLib; # TODO: move this override to configuration-nix.nix overrideCabal (drv: { - postPatch = - drv.postPath or "" - + '' - # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp - # NOTE: upstream host variable takes only two values... - sed -i test/PgInit.hs \ - -e s^'host=" <> host <> "'^^ - ''; - preCheck = - drv.preCheck or "" - + '' - PGDATABASE=test - PGUSER=test - ''; + postPatch = drv.postPath or "" + '' + # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp + # NOTE: upstream host variable takes only two values... + sed -i test/PgInit.hs \ + -e s^'host=" <> host <> "'^^ + ''; + preCheck = drv.preCheck or "" + '' + PGDATABASE=test + PGUSER=test + ''; testToolDepends = drv.testToolDepends or [ ] ++ [ pkgs.postgresql pkgs.postgresqlTestHook @@ -1737,12 +1709,10 @@ with haskellLib; jsaddle-webkit2gtk = overrideCabal (drv: { - postPatch = - drv.postPatch or "" - + '' - substituteInPlace jsaddle-webkit2gtk.cabal --replace-fail gi-gtk gi-gtk3 - substituteInPlace jsaddle-webkit2gtk.cabal --replace-fail gi-javascriptcore gi-javascriptcore4 - ''; + postPatch = drv.postPatch or "" + '' + substituteInPlace jsaddle-webkit2gtk.cabal --replace-fail gi-gtk gi-gtk3 + substituteInPlace jsaddle-webkit2gtk.cabal --replace-fail gi-javascriptcore gi-javascriptcore4 + ''; }) ( super.jsaddle-webkit2gtk.override { @@ -1870,11 +1840,9 @@ with haskellLib; (self.generateOptparseApplicativeCompletions [ "update-nix-fetchgit" ]) (overrideCabal (drv: { buildTools = drv.buildTools or [ ] ++ [ pkgs.buildPackages.makeWrapper ]; - postInstall = - drv.postInstall or "" - + '' - wrapProgram "$out/bin/update-nix-fetchgit" --prefix 'PATH' ':' "${lib.makeBinPath deps}" - ''; + postInstall = drv.postInstall or "" + '' + wrapProgram "$out/bin/update-nix-fetchgit" --prefix 'PATH' ':' "${lib.makeBinPath deps}" + ''; })) (addTestToolDepends deps) # Patch for hnix compat. @@ -2019,17 +1987,15 @@ with haskellLib; spacecookie = overrideCabal (old: { buildTools = (old.buildTools or [ ]) ++ [ pkgs.buildPackages.installShellFiles ]; # let testsuite discover the resulting binary - preCheck = - '' - export SPACECOOKIE_TEST_BIN=./dist/build/spacecookie/spacecookie - '' - + (old.preCheck or ""); + preCheck = '' + export SPACECOOKIE_TEST_BIN=./dist/build/spacecookie/spacecookie + '' + + (old.preCheck or ""); # install man pages shipped in the sdist - postInstall = - '' - installManPage docs/man/* - '' - + (old.postInstall or ""); + postInstall = '' + installManPage docs/man/* + '' + + (old.postInstall or ""); }) super.spacecookie; # Patch and jailbreak can be removed at next release, chatter > 0.9.1.0 @@ -2321,7 +2287,8 @@ with haskellLib; "/Data.List.UniqueUnsorted.repeatedBy,repeated,unique/unique: simple test/" "--skip" "/Data.List.UniqueUnsorted.repeatedBy,repeated,unique/repeatedBy: simple test/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) super.Unique ); @@ -2331,7 +2298,8 @@ with haskellLib; testFlags = [ "-p" "! /encode train/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) super.aeson-casing ); @@ -2342,14 +2310,16 @@ with haskellLib; testFlags = [ "--skip" "/Geo/Hexable/Encodes a linestring/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) super.haskell-postgis; # https://github.com/ChrisPenner/json-to-haskell/issues/5 json-to-haskell = overrideCabal (drv: { testFlags = [ "--match" "/should sanitize weird field and record names/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) super.json-to-haskell; # https://github.com/fieldstrength/aeson-deriving/issues/5 aeson-deriving = dontCheck super.aeson-deriving; @@ -2368,14 +2338,16 @@ with haskellLib; testFlags = [ "--skip" "/Dropbox/Dropbox aeson aeson/encodes list folder correctly/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) super.dropbox; # https://github.com/alonsodomin/haskell-schema/issues/11 hschema-aeson = overrideCabal (drv: { testFlags = [ "--skip" "/toJsonSerializer/should generate valid JSON/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) super.hschema-aeson; # https://github.com/minio/minio-hs/issues/165 # https://github.com/minio/minio-hs/pull/191 Use crypton-connection instead of unmaintained connection @@ -2383,7 +2355,8 @@ with haskellLib; testFlags = [ "-p" "!/Test mkSelectRequest/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; patches = drv.patches or [ ] ++ [ (pkgs.fetchpatch { name = "use-crypton-connection.patch"; @@ -2609,22 +2582,18 @@ with haskellLib; ]; }) ]; - postPatch = - drv.postPatch or "" - + '' - ln -fs ${pkgs.simdjson.src} simdjson - ''; + postPatch = drv.postPatch or "" + '' + ln -fs ${pkgs.simdjson.src} simdjson + ''; }) super.hermes-json; # hexstring is not compatible with newer versions of base16-bytestring # See https://github.com/solatis/haskell-hexstring/issues/3 hexstring = overrideCabal (old: { # Prevent DOS line endings from Hackage from breaking a patch - prePatch = - old.prePatch or "" - + '' - ${pkgs.buildPackages.dos2unix}/bin/dos2unix src/Data/HexString.hs - ''; + prePatch = old.prePatch or "" + '' + ${pkgs.buildPackages.dos2unix}/bin/dos2unix src/Data/HexString.hs + ''; patches = old.patches or [ ] ++ [ (pkgs.fetchpatch { name = "fix-base16-bytestring-compat"; @@ -3012,18 +2981,17 @@ with haskellLib; zinza = dontCheck super.zinza; pdftotext = overrideCabal (drv: { - postPatch = - '' - # Fixes https://todo.sr.ht/~geyaeb/haskell-pdftotext/6 - substituteInPlace pdftotext.cabal --replace-quiet c-sources cxx-sources + postPatch = '' + # Fixes https://todo.sr.ht/~geyaeb/haskell-pdftotext/6 + substituteInPlace pdftotext.cabal --replace-quiet c-sources cxx-sources - # Fix cabal ignoring cxx because the cabal format version is too old - substituteInPlace pdftotext.cabal --replace-quiet ">=1.10" 2.2 + # Fix cabal ignoring cxx because the cabal format version is too old + substituteInPlace pdftotext.cabal --replace-quiet ">=1.10" 2.2 - # Fix wrong license name that breaks recent cabal version - substituteInPlace pdftotext.cabal --replace-quiet BSD3 BSD-3-Clause - '' - + (drv.postPatch or ""); + # Fix wrong license name that breaks recent cabal version + substituteInPlace pdftotext.cabal --replace-quiet BSD3 BSD-3-Clause + '' + + (drv.postPatch or ""); }) (doJailbreak (addExtraLibrary pkgs.pkg-config (addExtraLibrary pkgs.poppler super.pdftotext))); proto3-wire = appendPatch (fetchpatch { diff --git a/pkgs/development/haskell-modules/configuration-darwin.nix b/pkgs/development/haskell-modules/configuration-darwin.nix index 56a86a5c74bf..775742748ab5 100644 --- a/pkgs/development/haskell-modules/configuration-darwin.nix +++ b/pkgs/development/haskell-modules/configuration-darwin.nix @@ -43,11 +43,10 @@ self: super: # darwin doesn't have sub-second resolution # https://github.com/hspec/mockery/issues/11 mockery = overrideCabal (drv: { - preCheck = - '' - export TRAVIS=true - '' - + (drv.preCheck or ""); + preCheck = '' + export TRAVIS=true + '' + + (drv.preCheck or ""); }) super.mockery; # https://github.com/ndmitchell/shake/issues/206 @@ -65,15 +64,13 @@ self: super: git-annex = overrideCabal (drv: { # We can't use testFlags since git-annex side steps the Cabal test mechanism - preCheck = - drv.preCheck or "" - + '' - checkFlagsArray+=( - # The addurl test cases require security(1) to be in PATH which we can't - # provide from nixpkgs to my (@sternenseemann) knowledge. - "-p" "!/addurl/" - ) - ''; + preCheck = drv.preCheck or "" + '' + checkFlagsArray+=( + # The addurl test cases require security(1) to be in PATH which we can't + # provide from nixpkgs to my (@sternenseemann) knowledge. + "-p" "!/addurl/" + ) + ''; }) super.git-annex; # on*Finish tests rely on a threadDelay timing differential of 0.1s. @@ -96,21 +93,19 @@ self: super: x509-system = overrideCabal ( drv: lib.optionalAttrs (!pkgs.stdenv.cc.nativeLibc) { - postPatch = - '' - substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security - '' - + (drv.postPatch or ""); + postPatch = '' + substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security + '' + + (drv.postPatch or ""); } ) super.x509-system; crypton-x509-system = overrideCabal ( drv: lib.optionalAttrs (!pkgs.stdenv.cc.nativeLibc) { - postPatch = - '' - substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security - '' - + (drv.postPatch or ""); + postPatch = '' + substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security + '' + + (drv.postPatch or ""); } ) super.crypton-x509-system; @@ -128,11 +123,10 @@ self: super: # the DYLD_LIBRARY_PATH environment variable. This messes up clang # when called from GHC, probably because clang is version 7, but we are # using LLVM8. - preCompileBuildDriver = - '' - substituteInPlace Setup.hs --replace "addToLdLibraryPath libDir" "pure ()" - '' - + (oldAttrs.preCompileBuildDriver or ""); + preCompileBuildDriver = '' + substituteInPlace Setup.hs --replace "addToLdLibraryPath libDir" "pure ()" + '' + + (oldAttrs.preCompileBuildDriver or ""); }) super.llvm-hs; sym = markBroken super.sym; @@ -149,13 +143,12 @@ self: super: OpenGLRaw = overrideCabal (drv: { librarySystemDepends = [ ]; libraryHaskellDepends = drv.libraryHaskellDepends; - preConfigure = - '' - frameworkPaths=($(for i in $nativeBuildInputs; do if [ -d "$i"/Library/Frameworks ]; then echo "-F$i/Library/Frameworks"; fi done)) - frameworkPaths=$(IFS=, ; echo "''${frameworkPaths[@]}") - configureFlags+=$(if [ -n "$frameworkPaths" ]; then echo -n "--ghc-options=-optl=$frameworkPaths"; fi) - '' - + (drv.preConfigure or ""); + preConfigure = '' + frameworkPaths=($(for i in $nativeBuildInputs; do if [ -d "$i"/Library/Frameworks ]; then echo "-F$i/Library/Frameworks"; fi done)) + frameworkPaths=$(IFS=, ; echo "''${frameworkPaths[@]}") + configureFlags+=$(if [ -n "$frameworkPaths" ]; then echo -n "--ghc-options=-optl=$frameworkPaths"; fi) + '' + + (drv.preConfigure or ""); }) super.OpenGLRaw; bindings-GLFW = overrideCabal (drv: { librarySystemDepends = [ ]; @@ -171,18 +164,18 @@ self: super: HTF = overrideCabal (drv: { # GNU find is not prefixed in stdenv - postPatch = - '' - substituteInPlace scripts/local-htfpp --replace "find=gfind" "find=find" - '' - + (drv.postPatch or ""); + postPatch = '' + substituteInPlace scripts/local-htfpp --replace "find=gfind" "find=find" + '' + + (drv.postPatch or ""); }) super.HTF; # conditional dependency via a cabal flag cas-store = overrideCabal (drv: { libraryHaskellDepends = [ self.kqueue - ] ++ (drv.libraryHaskellDepends or [ ]); + ] + ++ (drv.libraryHaskellDepends or [ ]); }) super.cas-store; # We are lacking pure pgrep at the moment for tests to work @@ -191,21 +184,19 @@ self: super: # On darwin librt doesn't exist and will fail to link against, # however linking against it is also not necessary there GLHUI = overrideCabal (drv: { - postPatch = - '' - substituteInPlace GLHUI.cabal --replace " rt" "" - '' - + (drv.postPatch or ""); + postPatch = '' + substituteInPlace GLHUI.cabal --replace " rt" "" + '' + + (drv.postPatch or ""); }) super.GLHUI; SDL-image = overrideCabal (drv: { # Prevent darwin-specific configuration code path being taken # which doesn't work with nixpkgs' SDL libraries - postPatch = - '' - substituteInPlace configure --replace xDarwin noDarwinSpecialCasing - '' - + (drv.postPatch or ""); + postPatch = '' + substituteInPlace configure --replace xDarwin noDarwinSpecialCasing + '' + + (drv.postPatch or ""); patches = [ # Work around SDL_main.h redefining main to SDL_main ./patches/SDL-image-darwin-hsc.patch @@ -215,11 +206,10 @@ self: super: # Prevent darwin-specific configuration code path being taken which # doesn't work with nixpkgs' SDL libraries SDL-mixer = overrideCabal (drv: { - postPatch = - '' - substituteInPlace configure --replace xDarwin noDarwinSpecialCasing - '' - + (drv.postPatch or ""); + postPatch = '' + substituteInPlace configure --replace xDarwin noDarwinSpecialCasing + '' + + (drv.postPatch or ""); }) super.SDL-mixer; # Work around SDL_main.h redefining main to SDL_main diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix index 705b4261058f..7209f46293d0 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix @@ -137,11 +137,9 @@ with haskellLib; # Cabal 3.14 regression (incorrect datadir in tests): https://github.com/haskell/cabal/issues/10717 alex = overrideCabal (drv: { - preCheck = - drv.preCheck or "" - + '' - export alex_datadir="$(pwd)/data" - ''; + preCheck = drv.preCheck or "" + '' + export alex_datadir="$(pwd)/data" + ''; }) super.alex; # https://github.com/sjakobi/newtype-generics/pull/28/files diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix index 35e610333d82..4a1afd49fcb1 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix @@ -82,7 +82,8 @@ self: super: { # 2021-10-10: 9.2.1 is not yet supported (also no issue) testFlags = [ "--skip=/Hpack/renderCabalFile/is inverse to readCabalFile/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) (doJailbreak super.hpack); # 2022-08-01: Tests are broken on ghc 9.2.4: https://github.com/wz1000/HieDb/issues/46 diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 75d88b4cca92..115f247a1c4f 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -117,11 +117,10 @@ builtins.intersectAttrs super { # Test suite needs executable agda2lagda = overrideCabal (drv: { - preCheck = - '' - export PATH="$PWD/dist/build/agda2lagda:$PATH" - '' - + drv.preCheck or ""; + preCheck = '' + export PATH="$PWD/dist/build/agda2lagda:$PATH" + '' + + drv.preCheck or ""; }) super.agda2lagda; # scrypt requires SSE2 @@ -331,12 +330,10 @@ builtins.intersectAttrs super { shelly = overrideCabal (drv: { # /usr/bin/env is unavailable in the sandbox - preCheck = - drv.preCheck or "" - + '' - chmod +x ./test/data/*.sh - patchShebangs --build test/data - ''; + preCheck = drv.preCheck or "" + '' + chmod +x ./test/data/*.sh + patchShebangs --build test/data + ''; }) super.shelly; # Add necessary reference to gtk3 package @@ -524,14 +521,12 @@ builtins.intersectAttrs super { wrapGAppsHook3 # Fix error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system gtk3 # Fix error: GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed ]); - postPatch = - (drv.postPatch or "") - + '' - for f in src/IDE/Leksah.hs src/IDE/Utils/ServerConnection.hs - do - substituteInPlace "$f" --replace "\"leksah-server\"" "\"${self.leksah-server}/bin/leksah-server\"" - done - ''; + postPatch = (drv.postPatch or "") + '' + for f in src/IDE/Leksah.hs src/IDE/Utils/ServerConnection.hs + do + substituteInPlace "$f" --replace "\"leksah-server\"" "\"${self.leksah-server}/bin/leksah-server\"" + done + ''; }) super.leksah ); @@ -615,11 +610,9 @@ builtins.intersectAttrs super { # Tests execute goldplate goldplate = overrideCabal (drv: { - preCheck = - drv.preCheck or "" - + '' - export PATH="$PWD/dist/build/goldplate:$PATH" - ''; + preCheck = drv.preCheck or "" + '' + export PATH="$PWD/dist/build/goldplate:$PATH" + ''; }) super.goldplate; # At least on 1.3.4 version on 32-bit architectures tasty requires @@ -627,23 +620,23 @@ builtins.intersectAttrs super { tasty = overrideCabal (drv: { libraryHaskellDepends = (drv.libraryHaskellDepends or [ ]) - ++ lib.optionals - ( - !(pkgs.stdenv.hostPlatform.isAarch64 || pkgs.stdenv.hostPlatform.isx86_64) - || (self.ghc.isGhcjs or false) - ) - [ - self.unbounded-delays - ]; + ++ + lib.optionals + ( + !(pkgs.stdenv.hostPlatform.isAarch64 || pkgs.stdenv.hostPlatform.isx86_64) + || (self.ghc.isGhcjs or false) + ) + [ + self.unbounded-delays + ]; }) super.tasty; tasty-discover = overrideCabal (drv: { # Depends on itself for testing - preBuild = - '' - export PATH="$PWD/dist/build/tasty-discover:$PATH" - '' - + (drv.preBuild or ""); + preBuild = '' + export PATH="$PWD/dist/build/tasty-discover:$PATH" + '' + + (drv.preBuild or ""); }) super.tasty-discover; # GLUT uses `dlopen` to link to freeglut, so we need to set the RUNPATH correctly for @@ -663,11 +656,9 @@ builtins.intersectAttrs super { patches = drv.patches or [ ] ++ [ ./patches/GLUT.patch ]; - prePatch = - drv.prePatch or "" - + '' - ${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix *.cabal - ''; + prePatch = drv.prePatch or "" + '' + ${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix *.cabal + ''; }) super.GLUT; libsystemd-journal = addExtraLibrary pkgs.systemd super.libsystemd-journal; @@ -798,11 +789,10 @@ builtins.intersectAttrs super { }) super.copilot-libraries; # tests need to execute the built executable ogma-cli = overrideCabal (drv: { - preCheck = - '' - export PATH=dist/build/ogma:$PATH - '' - + (drv.preCheck or ""); + preCheck = '' + export PATH=dist/build/ogma:$PATH + '' + + (drv.preCheck or ""); }) super.ogma-cli; # Expects z3 to be on path so we replace it with a hard @@ -846,18 +836,14 @@ builtins.intersectAttrs super { futhark = overrideCabal (_drv: { - postBuild = - (_drv.postBuild or "") - + '' - make -C docs man - ''; + postBuild = (_drv.postBuild or "") + '' + make -C docs man + ''; - postInstall = - (_drv.postInstall or "") - + '' - mkdir -p $out/share/man/man1 - mv docs/_build/man/*.1 $out/share/man/man1/ - ''; + postInstall = (_drv.postInstall or "") + '' + mkdir -p $out/share/man/man1 + mv docs/_build/man/*.1 $out/share/man/man1/ + ''; }) ( addBuildTools (with pkgs.buildPackages; [ @@ -899,12 +885,10 @@ builtins.intersectAttrs super { self.buildHaskellPackages.data-default ]; - preConfigure = - drv.preConfigure or "" - + '' - export HOME=$TEMPDIR - patchShebangs . - ''; + preConfigure = drv.preConfigure or "" + '' + export HOME=$TEMPDIR + patchShebangs . + ''; # git-annex ships its test suite as part of the final executable instead of # using a Cabal test suite. @@ -929,41 +913,39 @@ builtins.intersectAttrs super { # Use default installPhase of pkgs/stdenv/generic/setup.sh. We need to set # the environment variables it uses via the preInstall hook since the Haskell # generic builder doesn't accept them as arguments. - preInstall = - drv.preInstall or "" - + '' - installTargets="install" - installFlagsArray+=( - "PREFIX=" - "DESTDIR=$out" - # Prevent Makefile from calling cabal/Setup again - "BUILDER=:" - # Make Haskell build dependencies available - "GHC=${self.buildHaskellPackages.ghc.targetPrefix}ghc -global-package-db -package-db $setupPackageConfDir" - ) - ''; + preInstall = drv.preInstall or "" + '' + installTargets="install" + installFlagsArray+=( + "PREFIX=" + "DESTDIR=$out" + # Prevent Makefile from calling cabal/Setup again + "BUILDER=:" + # Make Haskell build dependencies available + "GHC=${self.buildHaskellPackages.ghc.targetPrefix}ghc -global-package-db -package-db $setupPackageConfDir" + ) + ''; installPhase = null; # Ensure git-annex uses the exact same coreutils it saw at build-time. # This is especially important on Darwin but also in Linux environments # where non-GNU coreutils are used by default. - postFixup = - '' - wrapProgram $out/bin/git-annex \ - --prefix PATH : "${ - pkgs.lib.makeBinPath ( - with pkgs; - [ - coreutils - lsof - ] - ) - }" - '' - + (drv.postFixup or ""); + postFixup = '' + wrapProgram $out/bin/git-annex \ + --prefix PATH : "${ + pkgs.lib.makeBinPath ( + with pkgs; + [ + coreutils + lsof + ] + ) + }" + '' + + (drv.postFixup or ""); buildTools = [ pkgs.buildPackages.makeWrapper - ] ++ (drv.buildTools or [ ]); + ] + ++ (drv.buildTools or [ ]); # Git annex provides a restricted login shell. Setting # passthru.shellPath here allows a user's login shell to be set to @@ -1038,32 +1020,30 @@ builtins.intersectAttrs super { }) [ (overrideCabal (drv: { - postUnpack = - (drv.postUnpack or "") - + '' - # Spago includes the following two files directly into the binary - # with Template Haskell. They are fetched at build-time from the - # `purescript-docs-search` repo above. If they cannot be fetched at - # build-time, they are pulled in from the `templates/` directory in - # the spago source. - # - # However, they are not actually available in the spago source, so they - # need to fetched with nix and put in the correct place. - # https://github.com/spacchetti/spago/issues/510 - cp ${docsSearchApp_0_0_10} "$sourceRoot/templates/docs-search-app-0.0.10.js" - cp ${docsSearchApp_0_0_11} "$sourceRoot/templates/docs-search-app-0.0.11.js" - cp ${purescriptDocsSearch_0_0_10} "$sourceRoot/templates/purescript-docs-search-0.0.10" - cp ${purescriptDocsSearch_0_0_11} "$sourceRoot/templates/purescript-docs-search-0.0.11" + postUnpack = (drv.postUnpack or "") + '' + # Spago includes the following two files directly into the binary + # with Template Haskell. They are fetched at build-time from the + # `purescript-docs-search` repo above. If they cannot be fetched at + # build-time, they are pulled in from the `templates/` directory in + # the spago source. + # + # However, they are not actually available in the spago source, so they + # need to fetched with nix and put in the correct place. + # https://github.com/spacchetti/spago/issues/510 + cp ${docsSearchApp_0_0_10} "$sourceRoot/templates/docs-search-app-0.0.10.js" + cp ${docsSearchApp_0_0_11} "$sourceRoot/templates/docs-search-app-0.0.11.js" + cp ${purescriptDocsSearch_0_0_10} "$sourceRoot/templates/purescript-docs-search-0.0.10" + cp ${purescriptDocsSearch_0_0_11} "$sourceRoot/templates/purescript-docs-search-0.0.11" - # For some weird reason, on Darwin, the open(2) call to embed these files - # requires write permissions. The easiest resolution is just to permit that - # (doesn't cause any harm on other systems). - chmod u+w \ - "$sourceRoot/templates/docs-search-app-0.0.10.js" \ - "$sourceRoot/templates/purescript-docs-search-0.0.10" \ - "$sourceRoot/templates/docs-search-app-0.0.11.js" \ - "$sourceRoot/templates/purescript-docs-search-0.0.11" - ''; + # For some weird reason, on Darwin, the open(2) call to embed these files + # requires write permissions. The easiest resolution is just to permit that + # (doesn't cause any harm on other systems). + chmod u+w \ + "$sourceRoot/templates/docs-search-app-0.0.10.js" \ + "$sourceRoot/templates/purescript-docs-search-0.0.10" \ + "$sourceRoot/templates/docs-search-app-0.0.11.js" \ + "$sourceRoot/templates/purescript-docs-search-0.0.11" + ''; })) # Tests require network access. @@ -1184,37 +1164,35 @@ builtins.intersectAttrs super { # tests need to execute the built executable stutter = overrideCabal (drv: { - preCheck = - '' - export PATH=dist/build/stutter:$PATH - '' - + (drv.preCheck or ""); + preCheck = '' + export PATH=dist/build/stutter:$PATH + '' + + (drv.preCheck or ""); }) super.stutter; # Install man page and generate shell completions pinboard-notes-backup = overrideCabal (drv: { - postInstall = - '' - install -D man/pnbackup.1 $out/share/man/man1/pnbackup.1 - '' - + (drv.postInstall or ""); + postInstall = '' + install -D man/pnbackup.1 $out/share/man/man1/pnbackup.1 + '' + + (drv.postInstall or ""); }) (self.generateOptparseApplicativeCompletions [ "pnbackup" ] super.pinboard-notes-backup); # Pass the correct libarchive into the package. streamly-archive = super.streamly-archive.override { archive = pkgs.libarchive; }; hlint = overrideCabal (drv: { - postInstall = - '' - install -Dm644 data/hlint.1 -t "$out/share/man/man1" - '' - + drv.postInstall or ""; + postInstall = '' + install -Dm644 data/hlint.1 -t "$out/share/man/man1" + '' + + drv.postInstall or ""; }) super.hlint; taglib = overrideCabal (drv: { librarySystemDepends = [ pkgs.zlib - ] ++ (drv.librarySystemDepends or [ ]); + ] + ++ (drv.librarySystemDepends or [ ]); }) super.taglib; # random 1.2.0 has tests that indirectly depend on @@ -1260,11 +1238,10 @@ builtins.intersectAttrs super { # Make tophat find itself for _compiling_ its test suite tophat = overrideCabal (drv: { - postPatch = - '' - sed -i 's|"tophat"|"./dist/build/tophat/tophat"|' app-test-bin/*.hs - '' - + (drv.postPatch or ""); + postPatch = '' + sed -i 's|"tophat"|"./dist/build/tophat/tophat"|' app-test-bin/*.hs + '' + + (drv.postPatch or ""); }) super.tophat; # Runtime dependencies and CLI completion @@ -1307,11 +1284,10 @@ builtins.intersectAttrs super { # the HOME directory, so that must be set in order to generate completions. # https://github.com/cdepillabout/cloudy/issues/10 (overrideCabal (oldAttrs: { - postInstall = - '' - export HOME=$TMPDIR - '' - + (oldAttrs.postInstall or ""); + postInstall = '' + export HOME=$TMPDIR + '' + + (oldAttrs.postInstall or ""); })) (self.generateOptparseApplicativeCompletions [ "cloudy" ]) ]; @@ -1376,24 +1352,23 @@ builtins.intersectAttrs super { justStaticExecutables ( overrideCabal (drv: { # use vanilla Setup.hs - preCompileBuildDriver = - '' - cat > Setup.hs << EOF - module Main where - import Distribution.Simple - main = defaultMain - EOF - '' - + (drv.preCompileBuildDriver or ""); + preCompileBuildDriver = '' + cat > Setup.hs << EOF + module Main where + import Distribution.Simple + main = defaultMain + EOF + '' + + (drv.preCompileBuildDriver or ""); # install man page buildTools = [ pkgs.buildPackages.installShellFiles - ] ++ (drv.buildTools or [ ]); - postInstall = - '' - installManPage man/atsfmt.1 - '' - + (drv.postInstall or ""); + ] + ++ (drv.buildTools or [ ]); + postInstall = '' + installManPage man/atsfmt.1 + '' + + (drv.postInstall or ""); }) super.ats-format ) ); @@ -1415,16 +1390,15 @@ builtins.intersectAttrs super { # version and sort -V to compare against our minimum version. If the # Kernel turns out to be older, we disable the test suite. procex = overrideCabal (drv: { - postConfigure = - '' - minimumKernel=5.9 - higherVersion=`printf "%s\n%s\n" "$minimumKernel" "$(uname -r)" | sort -rV | head -n1` - if [[ "$higherVersion" = "$minimumKernel" ]]; then - echo "Used Kernel doesn't support close_range, disabling tests" - unset doCheck - fi - '' - + (drv.postConfigure or ""); + postConfigure = '' + minimumKernel=5.9 + higherVersion=`printf "%s\n%s\n" "$minimumKernel" "$(uname -r)" | sort -rV | head -n1` + if [[ "$higherVersion" = "$minimumKernel" ]]; then + echo "Used Kernel doesn't support close_range, disabling tests" + unset doCheck + fi + '' + + (drv.postConfigure or ""); }) super.procex; # Test suite wants to run main executable @@ -1433,11 +1407,9 @@ builtins.intersectAttrs super { ( let fourmoluTestFix = overrideCabal (drv: { - preCheck = - drv.preCheck or "" - + '' - export PATH="$PWD/dist/build/fourmolu:$PATH" - ''; + preCheck = drv.preCheck or "" + '' + export PATH="$PWD/dist/build/fourmolu:$PATH" + ''; }); in builtins.mapAttrs (_: fourmoluTestFix) super @@ -1450,11 +1422,9 @@ builtins.intersectAttrs super { # Test suite needs to execute 'disco' binary disco = overrideCabal (drv: { - preCheck = - drv.preCheck or "" - + '' - export PATH="$PWD/dist/build/disco:$PATH" - ''; + preCheck = drv.preCheck or "" + '' + export PATH="$PWD/dist/build/disco:$PATH" + ''; testFlags = drv.testFlags or [ ] ++ [ # Needs network access "-p" @@ -1474,7 +1444,8 @@ builtins.intersectAttrs super { dot = null; PATH = null; }) - ] ++ (drv.patches or [ ]); + ] + ++ (drv.patches or [ ]); }) super.graphviz; # Test suite requires AWS access which requires both a network @@ -1486,7 +1457,8 @@ builtins.intersectAttrs super { testFlags = [ "-p" "!/Can be used with http-client/" - ] ++ drv.testFlags or [ ]; + ] + ++ drv.testFlags or [ ]; }) super.http-api-data-qq; # Test have become more fussy in >= 2.0. We need to have which available for @@ -1497,11 +1469,9 @@ builtins.intersectAttrs super { _: overrideCabal (drv: { buildTools = drv.buildTools or [ ] ++ [ pkgs.buildPackages.which ]; - preCheck = - drv.preCheck or "" - + '' - export PATH="$PWD/dist/build/happy:$PATH" - ''; + preCheck = drv.preCheck or "" + '' + export PATH="$PWD/dist/build/happy:$PATH" + ''; }) ) { @@ -1578,16 +1548,15 @@ builtins.intersectAttrs super { cabal-install = overrideCabal (old: { buildTools = [ pkgs.buildPackages.makeWrapper - ] ++ old.buildTools or [ ]; - postInstall = - old.postInstall - + '' - mkdir -p "$out/share/man/man1" - "$out/bin/cabal" man --raw > "$out/share/man/man1/cabal.1" + ] + ++ old.buildTools or [ ]; + postInstall = old.postInstall + '' + mkdir -p "$out/share/man/man1" + "$out/bin/cabal" man --raw > "$out/share/man/man1/cabal.1" - wrapProgram "$out/bin/cabal" \ - --prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.groff ]}" - ''; + wrapProgram "$out/bin/cabal" \ + --prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.groff ]}" + ''; hydraPlatforms = pkgs.lib.platforms.all; broken = false; }) super.cabal-install; @@ -1605,16 +1574,14 @@ builtins.intersectAttrs super { ]; # Added a shim for the `tailwindcss` CLI entry point nativeBuildInputs = (oa.nativeBuildInputs or [ ]) ++ [ pkgs.buildPackages.makeBinaryWrapper ]; - postInstall = - (oa.postInstall or "") - + '' - nodePath="" - for p in "$out" "${pkgs.nodePackages.postcss}" $plugins; do - nodePath="$nodePath''${nodePath:+:}$p/lib/node_modules" - done - makeWrapper "$out/bin/tailwindcss" "$out/bin/tailwind" --prefix NODE_PATH : "$nodePath" - unset nodePath - ''; + postInstall = (oa.postInstall or "") + '' + nodePath="" + for p in "$out" "${pkgs.nodePackages.postcss}" $plugins; do + nodePath="$nodePath''${nodePath:+:}$p/lib/node_modules" + done + makeWrapper "$out/bin/tailwindcss" "$out/bin/tailwind" --prefix NODE_PATH : "$nodePath" + unset nodePath + ''; })) super.tailwind; diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 084a0e60d415..acfead1a5125 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -285,96 +285,94 @@ let END { print "" } ''; - crossCabalFlags = - [ - "--with-ghc=${ghcCommand}" - "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg" - "--with-gcc=${cc}" - ] - ++ optionals stdenv.hasCC [ - "--with-ld=${stdenv.cc.bintools.targetPrefix}ld" - "--with-ar=${stdenv.cc.bintools.targetPrefix}ar" - # use the one that comes with the cross compiler. - "--with-hsc2hs=${ghc.targetPrefix}hsc2hs" - "--with-strip=${stdenv.cc.bintools.targetPrefix}strip" - ] - ++ optionals (!isHaLVM) [ - "--hsc2hs-option=--cross-compile" - (optionalString enableHsc2hsViaAsm "--hsc2hs-option=--via-asm") - ] - ++ optional (allPkgconfigDepends != [ ]) "--with-pkg-config=${pkg-config.targetPrefix}pkg-config"; + crossCabalFlags = [ + "--with-ghc=${ghcCommand}" + "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg" + "--with-gcc=${cc}" + ] + ++ optionals stdenv.hasCC [ + "--with-ld=${stdenv.cc.bintools.targetPrefix}ld" + "--with-ar=${stdenv.cc.bintools.targetPrefix}ar" + # use the one that comes with the cross compiler. + "--with-hsc2hs=${ghc.targetPrefix}hsc2hs" + "--with-strip=${stdenv.cc.bintools.targetPrefix}strip" + ] + ++ optionals (!isHaLVM) [ + "--hsc2hs-option=--cross-compile" + (optionalString enableHsc2hsViaAsm "--hsc2hs-option=--via-asm") + ] + ++ optional (allPkgconfigDepends != [ ]) "--with-pkg-config=${pkg-config.targetPrefix}pkg-config"; makeGhcOptions = opts: lib.concatStringsSep " " (map (opt: "--ghc-option=${opt}") opts); buildFlagsString = optionalString (buildFlags != [ ]) (" " + concatStringsSep " " buildFlags); - defaultConfigureFlags = + defaultConfigureFlags = [ + "--verbose" + "--prefix=$out" + # Note: This must be kept in sync manually with mkGhcLibdir + ("--libdir=\\$prefix/lib/\\$compiler" + lib.optionalString (ghc ? hadrian) "/lib") + "--libsubdir=\\$abi/\\$libname" + (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghcNameWithPrefix}") + (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}") + ] + ++ optionals stdenv.hasCC [ + "--with-gcc=$CC" # Clang won't work without that extra information. + ] + ++ [ + "--package-db=$packageConfDir" + (optionalString ( + enableSharedExecutables && stdenv.hostPlatform.isLinux + ) "--ghc-option=-optl=-Wl,-rpath=$out/${ghcLibdir}/${pname}-${version}") + (optionalString ( + enableSharedExecutables && stdenv.hostPlatform.isDarwin + ) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") + (optionalString enableParallelBuilding (makeGhcOptions [ + "-j$NIX_BUILD_CORES" + "+RTS" + "-A64M" + "-RTS" + ])) + (optionalString useCpphs ( + "--with-cpphs=${cpphs}/bin/cpphs " + + (makeGhcOptions [ + "-cpp" + "-pgmP${cpphs}/bin/cpphs" + "-optP--cpp" + ]) + )) + (enableFeature enableLibraryProfiling "library-profiling") + (optionalString ( + enableExecutableProfiling || enableLibraryProfiling + ) "--profiling-detail=${profilingDetail}") + (enableFeature enableExecutableProfiling "profiling") + (enableFeature enableSharedLibraries "shared") + (enableFeature doCoverage "coverage") + (enableFeature enableStaticLibraries "static") + (enableFeature enableSharedExecutables "executable-dynamic") + (enableFeature doCheck "tests") + (enableFeature doBenchmark "benchmarks") + "--enable-library-vanilla" # TODO: Should this be configurable? + (enableFeature enableLibraryForGhci "library-for-ghci") + (enableFeature enableDeadCodeElimination "split-sections") + (enableFeature (!dontStrip) "library-stripping") + (enableFeature (!dontStrip) "executable-stripping") + ] + ++ optionals isGhcjs [ + "--ghcjs" + ] + ++ optionals isCross ( [ - "--verbose" - "--prefix=$out" - # Note: This must be kept in sync manually with mkGhcLibdir - ("--libdir=\\$prefix/lib/\\$compiler" + lib.optionalString (ghc ? hadrian) "/lib") - "--libsubdir=\\$abi/\\$libname" - (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghcNameWithPrefix}") - (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}") + "--configure-option=--host=${stdenv.hostPlatform.config}" ] - ++ optionals stdenv.hasCC [ - "--with-gcc=$CC" # Clang won't work without that extra information. - ] - ++ [ - "--package-db=$packageConfDir" - (optionalString ( - enableSharedExecutables && stdenv.hostPlatform.isLinux - ) "--ghc-option=-optl=-Wl,-rpath=$out/${ghcLibdir}/${pname}-${version}") - (optionalString ( - enableSharedExecutables && stdenv.hostPlatform.isDarwin - ) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") - (optionalString enableParallelBuilding (makeGhcOptions [ - "-j$NIX_BUILD_CORES" - "+RTS" - "-A64M" - "-RTS" - ])) - (optionalString useCpphs ( - "--with-cpphs=${cpphs}/bin/cpphs " - + (makeGhcOptions [ - "-cpp" - "-pgmP${cpphs}/bin/cpphs" - "-optP--cpp" - ]) - )) - (enableFeature enableLibraryProfiling "library-profiling") - (optionalString ( - enableExecutableProfiling || enableLibraryProfiling - ) "--profiling-detail=${profilingDetail}") - (enableFeature enableExecutableProfiling "profiling") - (enableFeature enableSharedLibraries "shared") - (enableFeature doCoverage "coverage") - (enableFeature enableStaticLibraries "static") - (enableFeature enableSharedExecutables "executable-dynamic") - (enableFeature doCheck "tests") - (enableFeature doBenchmark "benchmarks") - "--enable-library-vanilla" # TODO: Should this be configurable? - (enableFeature enableLibraryForGhci "library-for-ghci") - (enableFeature enableDeadCodeElimination "split-sections") - (enableFeature (!dontStrip) "library-stripping") - (enableFeature (!dontStrip) "executable-stripping") - ] - ++ optionals isGhcjs [ - "--ghcjs" - ] - ++ optionals isCross ( - [ - "--configure-option=--host=${stdenv.hostPlatform.config}" - ] - ++ crossCabalFlags - ) - ++ optionals enableSeparateBinOutput [ - "--bindir=${binDir}" - ] - ++ optionals (doHaddockInterfaces && isLibrary) [ - "--ghc-option=-haddock" - ]; + ++ crossCabalFlags + ) + ++ optionals enableSeparateBinOutput [ + "--bindir=${binDir}" + ] + ++ optionals (doHaddockInterfaces && isLibrary) [ + "--ghc-option=-haddock" + ]; postPhases = optional doInstallIntermediates "installIntermediatesPhase"; @@ -440,29 +438,29 @@ let ++ optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends; - depsBuildBuild = - [ nativeGhc ] - # CC_FOR_BUILD may be necessary if we have no C preprocessor for the host - # platform. See crossCabalFlags above for more details. - ++ lib.optionals (!stdenv.hasCC) [ buildPackages.stdenv.cc ]; + depsBuildBuild = [ + nativeGhc + ] + # CC_FOR_BUILD may be necessary if we have no C preprocessor for the host + # platform. See crossCabalFlags above for more details. + ++ lib.optionals (!stdenv.hasCC) [ buildPackages.stdenv.cc ]; collectedToolDepends = buildTools ++ libraryToolDepends ++ executableToolDepends ++ optionals doCheck testToolDepends ++ optionals doBenchmark benchmarkToolDepends; - nativeBuildInputs = - [ - ghc - removeReferencesTo - ] - ++ optional (allPkgconfigDepends != [ ]) ( - assert pkg-config != null; - pkg-config - ) - ++ setupHaskellDepends - ++ collectedToolDepends - ++ optional stdenv.hostPlatform.isGhcjs nodejs; + nativeBuildInputs = [ + ghc + removeReferencesTo + ] + ++ optional (allPkgconfigDepends != [ ]) ( + assert pkg-config != null; + pkg-config + ) + ++ setupHaskellDepends + ++ collectedToolDepends + ++ optional stdenv.hostPlatform.isGhcjs nodejs; propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends ++ libraryFrameworkDepends; otherBuildInputsHaskell = @@ -559,18 +557,17 @@ let "haskellPackages.mkDerivation: testTarget is deprecated. Use testTargets instead" (lib.concatStringsSep " " testTargets); - env' = - { - LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase. - } - // env - # Implicit pointer to integer conversions are errors by default since clang 15. - # Works around https://gitlab.haskell.org/ghc/ghc/-/issues/23456. - // optionalAttrs (stdenv.hasCC && stdenv.cc.isClang) { - NIX_CFLAGS_COMPILE = - "-Wno-error=int-conversion" - + lib.optionalString (env ? NIX_CFLAGS_COMPILE) (" " + env.NIX_CFLAGS_COMPILE); - }; + env' = { + LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase. + } + // env + # Implicit pointer to integer conversions are errors by default since clang 15. + # Works around https://gitlab.haskell.org/ghc/ghc/-/issues/23456. + // optionalAttrs (stdenv.hasCC && stdenv.cc.isClang) { + NIX_CFLAGS_COMPILE = + "-Wno-error=int-conversion" + + lib.optionalString (env ? NIX_CFLAGS_COMPILE) (" " + env.NIX_CFLAGS_COMPILE); + }; in lib.fix ( @@ -580,12 +577,13 @@ lib.fix ( { inherit pname version; - outputs = - [ "out" ] - ++ (optional enableSeparateDataOutput "data") - ++ (optional enableSeparateDocOutput "doc") - ++ (optional enableSeparateBinOutput "bin") - ++ (optional enableSeparateIntermediatesOutput "intermediates"); + outputs = [ + "out" + ] + ++ (optional enableSeparateDataOutput "data") + ++ (optional enableSeparateDocOutput "doc") + ++ (optional enableSeparateBinOutput "bin") + ++ (optional enableSeparateIntermediatesOutput "intermediates"); setOutputFlags = false; @@ -625,103 +623,102 @@ lib.fix ( '' + postPatch; - setupCompilerEnvironmentPhase = - '' - NIX_BUILD_CORES=$(( NIX_BUILD_CORES < ${toString maxBuildCores} ? NIX_BUILD_CORES : ${toString maxBuildCores} )) - runHook preSetupCompilerEnvironment + setupCompilerEnvironmentPhase = '' + NIX_BUILD_CORES=$(( NIX_BUILD_CORES < ${toString maxBuildCores} ? NIX_BUILD_CORES : ${toString maxBuildCores} )) + runHook preSetupCompilerEnvironment - echo "Build with ${ghc}." - ${optionalString (isLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"} + echo "Build with ${ghc}." + ${optionalString (isLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"} - builddir="$(mktemp -d)" - setupPackageConfDir="$builddir/setup-package.conf.d" - mkdir -p $setupPackageConfDir - packageConfDir="$builddir/package.conf.d" - mkdir -p $packageConfDir + builddir="$(mktemp -d)" + setupPackageConfDir="$builddir/setup-package.conf.d" + mkdir -p $setupPackageConfDir + packageConfDir="$builddir/package.conf.d" + mkdir -p $packageConfDir - setupCompileFlags="${concatStringsSep " " setupCompileFlags}" - configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags" - '' - # We build the Setup.hs on the *build* machine, and as such should only add - # dependencies for the build machine. - # - # pkgs* arrays defined in stdenv/setup.hs - + '' - for p in "''${pkgsBuildBuild[@]}" "''${pkgsBuildHost[@]}" "''${pkgsBuildTarget[@]}"; do - ${buildPkgDb nativeGhc "$setupPackageConfDir"} - done - ${nativeGhcCommand}-pkg --package-db="$setupPackageConfDir" recache - '' - # For normal components - + '' - for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do - ${buildPkgDb ghc "$packageConfDir"} - if [ -d "$p/include" ]; then - appendToVar configureFlags "--extra-include-dirs=$p/include" - fi - if [ -d "$p/lib" ]; then - appendToVar configureFlags "--extra-lib-dirs=$p/lib" - fi - if [[ -d "$p/Library/Frameworks" ]]; then - appendToVar configureFlags "--extra-framework-dirs=$p/Library/Frameworks" - fi - '' - + '' - done - '' - + (optionalString stdenv.hostPlatform.isGhcjs '' - export EM_CACHE="$(realpath "$(mktemp -d emcache.XXXXXXXXXX)")" - cp -Lr ${emscripten}/share/emscripten/cache/* "$EM_CACHE/" - chmod u+rwX -R "$EM_CACHE" - '') - # only use the links hack if we're actually building dylibs. otherwise, the - # "dynamic-library-dirs" point to nonexistent paths, and the ln command becomes - # "ln -s $out/lib/links", which tries to recreate the links dir and fails - # - # Note: We need to disable this work-around when using intermediate build - # products from a prior build because otherwise Nix will change permissions on - # the `$out/lib/links` directory to read-only when the build is done after the - # dist directory has already been exported, which triggers an unnecessary - # rebuild of modules included in the exported dist directory. - + (optionalString - ( - stdenv.hostPlatform.isDarwin - && (enableSharedLibraries || enableSharedExecutables) - && !enableSeparateIntermediatesOutput - ) - '' - # Work around a limit in the macOS Sierra linker on the number of paths - # referenced by any one dynamic library: - # - # Create a local directory with symlinks of the *.dylib (macOS shared - # libraries) from all the dependencies. - local dynamicLinksDir="$out/lib/links" - mkdir -p $dynamicLinksDir - - # Unprettify all package conf files before reading/writing them - for d in "$packageConfDir/"*; do - # gawk -i inplace seems to strip the last newline - gawk -f ${unprettyConf} "$d" > tmp - mv tmp "$d" - done - - for d in $(grep '^dynamic-library-dirs:' "$packageConfDir"/* | cut -d' ' -f2- | tr ' ' '\n' | sort -u); do - for lib in "$d/"*.{dylib,so}; do - # Allow overwriting because C libs can be pulled in multiple times. - ln -sf "$lib" "$dynamicLinksDir" - done - done - # Edit the local package DB to reference the links directory. - for f in "$packageConfDir/"*.conf; do - sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," "$f" - done - '' + setupCompileFlags="${concatStringsSep " " setupCompileFlags}" + configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags" + '' + # We build the Setup.hs on the *build* machine, and as such should only add + # dependencies for the build machine. + # + # pkgs* arrays defined in stdenv/setup.hs + + '' + for p in "''${pkgsBuildBuild[@]}" "''${pkgsBuildHost[@]}" "''${pkgsBuildTarget[@]}"; do + ${buildPkgDb nativeGhc "$setupPackageConfDir"} + done + ${nativeGhcCommand}-pkg --package-db="$setupPackageConfDir" recache + '' + # For normal components + + '' + for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do + ${buildPkgDb ghc "$packageConfDir"} + if [ -d "$p/include" ]; then + appendToVar configureFlags "--extra-include-dirs=$p/include" + fi + if [ -d "$p/lib" ]; then + appendToVar configureFlags "--extra-lib-dirs=$p/lib" + fi + if [[ -d "$p/Library/Frameworks" ]]; then + appendToVar configureFlags "--extra-framework-dirs=$p/Library/Frameworks" + fi + '' + + '' + done + '' + + (optionalString stdenv.hostPlatform.isGhcjs '' + export EM_CACHE="$(realpath "$(mktemp -d emcache.XXXXXXXXXX)")" + cp -Lr ${emscripten}/share/emscripten/cache/* "$EM_CACHE/" + chmod u+rwX -R "$EM_CACHE" + '') + # only use the links hack if we're actually building dylibs. otherwise, the + # "dynamic-library-dirs" point to nonexistent paths, and the ln command becomes + # "ln -s $out/lib/links", which tries to recreate the links dir and fails + # + # Note: We need to disable this work-around when using intermediate build + # products from a prior build because otherwise Nix will change permissions on + # the `$out/lib/links` directory to read-only when the build is done after the + # dist directory has already been exported, which triggers an unnecessary + # rebuild of modules included in the exported dist directory. + + (optionalString + ( + stdenv.hostPlatform.isDarwin + && (enableSharedLibraries || enableSharedExecutables) + && !enableSeparateIntermediatesOutput ) - + '' - ${ghcCommand}-pkg --package-db="$packageConfDir" recache + '' + # Work around a limit in the macOS Sierra linker on the number of paths + # referenced by any one dynamic library: + # + # Create a local directory with symlinks of the *.dylib (macOS shared + # libraries) from all the dependencies. + local dynamicLinksDir="$out/lib/links" + mkdir -p $dynamicLinksDir - runHook postSetupCompilerEnvironment - ''; + # Unprettify all package conf files before reading/writing them + for d in "$packageConfDir/"*; do + # gawk -i inplace seems to strip the last newline + gawk -f ${unprettyConf} "$d" > tmp + mv tmp "$d" + done + + for d in $(grep '^dynamic-library-dirs:' "$packageConfDir"/* | cut -d' ' -f2- | tr ' ' '\n' | sort -u); do + for lib in "$d/"*.{dylib,so}; do + # Allow overwriting because C libs can be pulled in multiple times. + ln -sf "$lib" "$dynamicLinksDir" + done + done + # Edit the local package DB to reference the links directory. + for f in "$packageConfDir/"*.conf; do + sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," "$f" + done + '' + ) + + '' + ${ghcCommand}-pkg --package-db="$packageConfDir" recache + + runHook postSetupCompilerEnvironment + ''; compileBuildDriverPhase = '' runHook preCompileBuildDriver @@ -767,21 +764,20 @@ lib.fix ( runHook postConfigure ''; - buildPhase = - '' - runHook preBuild - '' - + lib.optionalString (previousIntermediates != null) '' - mkdir -p dist; - rm -r dist/build - cp -r ${previousIntermediates}/${intermediatesDir}/build dist/build - find dist/build -exec chmod u+w {} + - find dist/build -exec touch -d '1970-01-01T00:00:00Z' {} + - '' - + '' - ${setupCommand} build ${buildTarget}${buildFlagsString} - runHook postBuild - ''; + buildPhase = '' + runHook preBuild + '' + + lib.optionalString (previousIntermediates != null) '' + mkdir -p dist; + rm -r dist/build + cp -r ${previousIntermediates}/${intermediatesDir}/build dist/build + find dist/build -exec chmod u+w {} + + find dist/build -exec touch -d '1970-01-01T00:00:00Z' {} + + '' + + '' + ${setupCommand} build ${buildTarget}${buildFlagsString} + runHook postBuild + ''; inherit doCheck; @@ -908,46 +904,45 @@ lib.fix ( # All this information is intended just for `shellFor`. It should be # considered unstable and indeed we knew how to keep it private we would. - getCabalDeps = - { - inherit - buildDepends - buildTools - executableFrameworkDepends - executableHaskellDepends - executablePkgconfigDepends - executableSystemDepends - executableToolDepends - extraLibraries - libraryFrameworkDepends - libraryHaskellDepends - libraryPkgconfigDepends - librarySystemDepends - libraryToolDepends - pkg-configDepends - setupHaskellDepends - ; - } - // lib.optionalAttrs doCheck { - inherit - testDepends - testFrameworkDepends - testHaskellDepends - testPkgconfigDepends - testSystemDepends - testToolDepends - ; - } - // lib.optionalAttrs doBenchmark { - inherit - benchmarkDepends - benchmarkFrameworkDepends - benchmarkHaskellDepends - benchmarkPkgconfigDepends - benchmarkSystemDepends - benchmarkToolDepends - ; - }; + getCabalDeps = { + inherit + buildDepends + buildTools + executableFrameworkDepends + executableHaskellDepends + executablePkgconfigDepends + executableSystemDepends + executableToolDepends + extraLibraries + libraryFrameworkDepends + libraryHaskellDepends + libraryPkgconfigDepends + librarySystemDepends + libraryToolDepends + pkg-configDepends + setupHaskellDepends + ; + } + // lib.optionalAttrs doCheck { + inherit + testDepends + testFrameworkDepends + testHaskellDepends + testPkgconfigDepends + testSystemDepends + testToolDepends + ; + } + // lib.optionalAttrs doBenchmark { + inherit + benchmarkDepends + benchmarkFrameworkDepends + benchmarkHaskellDepends + benchmarkPkgconfigDepends + benchmarkSystemDepends + benchmarkToolDepends + ; + }; # Attributes for the old definition of `shellFor`. Should be removed but # this predates the warning at the top of `getCabalDeps`. @@ -1012,58 +1007,59 @@ lib.fix ( inherit shellHook; depsBuildBuild = lib.optional isCross ghcEnvForBuild; - nativeBuildInputs = - [ ghcEnv ] ++ optional (allPkgconfigDepends != [ ]) pkg-config ++ collectedToolDepends; + nativeBuildInputs = [ + ghcEnv + ] + ++ optional (allPkgconfigDepends != [ ]) pkg-config + ++ collectedToolDepends; buildInputs = otherBuildInputsSystem; - env = - { - "NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}"; - "NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg"; - # TODO: is this still valid? - "NIX_${ghcCommandCaps}_DOCDIR" = "${ghcEnv}/share/doc/ghc/html"; - "NIX_${ghcCommandCaps}_LIBDIR" = - if ghc.isHaLVM or false then "${ghcEnv}/lib/HaLVM-${ghc.version}" else "${ghcEnv}/${ghcLibdir}"; - } - // optionalAttrs (stdenv.buildPlatform.libc == "glibc") { - # TODO: Why is this written in terms of `buildPackages`, unlike - # the outer `env`? - # - # According to @sternenseemann [1]: - # - # > The condition is based on `buildPlatform`, so it needs to - # > match. `LOCALE_ARCHIVE` is set to accompany `LANG` which - # > concerns things we execute on the build platform like - # > `haddock`. - # > - # > Arguably the outer non `buildPackages` one is incorrect and - # > probably works by accident in most cases since the locale - # > archive is not platform specific (the trouble is that it - # > may sometimes be impossible to cross-compile). At least - # > that would be my assumption. - # - # [1]: https://github.com/NixOS/nixpkgs/pull/424368#discussion_r2202683378 - LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive"; - } - // env'; + env = { + "NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}"; + "NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg"; + # TODO: is this still valid? + "NIX_${ghcCommandCaps}_DOCDIR" = "${ghcEnv}/share/doc/ghc/html"; + "NIX_${ghcCommandCaps}_LIBDIR" = + if ghc.isHaLVM or false then "${ghcEnv}/lib/HaLVM-${ghc.version}" else "${ghcEnv}/${ghcLibdir}"; + } + // optionalAttrs (stdenv.buildPlatform.libc == "glibc") { + # TODO: Why is this written in terms of `buildPackages`, unlike + # the outer `env`? + # + # According to @sternenseemann [1]: + # + # > The condition is based on `buildPlatform`, so it needs to + # > match. `LOCALE_ARCHIVE` is set to accompany `LANG` which + # > concerns things we execute on the build platform like + # > `haddock`. + # > + # > Arguably the outer non `buildPackages` one is incorrect and + # > probably works by accident in most cases since the locale + # > archive is not platform specific (the trouble is that it + # > may sometimes be impossible to cross-compile). At least + # > that would be my assumption. + # + # [1]: https://github.com/NixOS/nixpkgs/pull/424368#discussion_r2202683378 + LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive"; + } + // env'; } "echo $nativeBuildInputs $buildInputs > $out"; env = envFunc { }; }; - meta = - { - inherit homepage license platforms; - } - // optionalAttrs (args ? broken) { inherit broken; } - // optionalAttrs (args ? description) { inherit description; } - // optionalAttrs (args ? maintainers) { inherit maintainers; } - // optionalAttrs (args ? teams) { inherit teams; } - // optionalAttrs (args ? hydraPlatforms) { inherit hydraPlatforms; } - // optionalAttrs (args ? badPlatforms) { inherit badPlatforms; } - // optionalAttrs (args ? changelog) { inherit changelog; } - // optionalAttrs (args ? mainProgram) { inherit mainProgram; }; + meta = { + inherit homepage license platforms; + } + // optionalAttrs (args ? broken) { inherit broken; } + // optionalAttrs (args ? description) { inherit description; } + // optionalAttrs (args ? maintainers) { inherit maintainers; } + // optionalAttrs (args ? teams) { inherit teams; } + // optionalAttrs (args ? hydraPlatforms) { inherit hydraPlatforms; } + // optionalAttrs (args ? badPlatforms) { inherit badPlatforms; } + // optionalAttrs (args ? changelog) { inherit changelog; } + // optionalAttrs (args ? mainProgram) { inherit mainProgram; }; } // optionalAttrs (args ? sourceRoot) { inherit sourceRoot; } diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index 61d87665d8ef..833c327d6007 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -45933,7 +45933,8 @@ self: { badPlatforms = [ "i686-linux" "armv7l-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; } ) { }; @@ -707467,7 +707468,8 @@ self: { badPlatforms = [ "i686-linux" "armv7l-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; } ) { inherit (pkgs) vulkan-loader; }; @@ -726659,7 +726661,8 @@ self: { badPlatforms = [ "aarch64-linux" "armv7l-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; hydraPlatforms = lib.platforms.none; mainProgram = "xgb-agaricus"; broken = true; diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index 12b728e9d245..d3b0a215fa90 100644 --- a/pkgs/development/haskell-modules/lib/compose.nix +++ b/pkgs/development/haskell-modules/lib/compose.nix @@ -459,13 +459,11 @@ rec { enableLibraryProfiling = drv.enableExecutableProfiling or false; isLibrary = false; doHaddock = false; - postFixup = - drv.postFixup or "" - + '' + postFixup = drv.postFixup or "" + '' - # Remove every directory which could have links to other store paths. - rm -rf $out/lib $out/nix-support $out/share/doc - ''; + # Remove every directory which could have links to other store paths. + rm -rf $out/lib $out/nix-support $out/share/doc + ''; disallowGhcReference = true; }); @@ -540,12 +538,10 @@ rec { triggerRebuild = i: overrideCabal (drv: { - postUnpack = - drv.postUnpack or "" - + '' + postUnpack = drv.postUnpack or "" + '' - # trigger rebuild ${toString i} - ''; + # trigger rebuild ${toString i} + ''; }); /* @@ -633,23 +629,21 @@ rec { __generateOptparseApplicativeCompletion = exeName: overrideCabal (drv: { - postInstall = - (drv.postInstall or "") - + '' - bashCompDir="''${!outputBin}/share/bash-completion/completions" - zshCompDir="''${!outputBin}/share/zsh/vendor-completions" - fishCompDir="''${!outputBin}/share/fish/vendor_completions.d" - mkdir -p "$bashCompDir" "$zshCompDir" "$fishCompDir" - "''${!outputBin}/bin/${exeName}" --bash-completion-script "''${!outputBin}/bin/${exeName}" >"$bashCompDir/${exeName}" - "''${!outputBin}/bin/${exeName}" --zsh-completion-script "''${!outputBin}/bin/${exeName}" >"$zshCompDir/_${exeName}" - "''${!outputBin}/bin/${exeName}" --fish-completion-script "''${!outputBin}/bin/${exeName}" >"$fishCompDir/${exeName}.fish" + postInstall = (drv.postInstall or "") + '' + bashCompDir="''${!outputBin}/share/bash-completion/completions" + zshCompDir="''${!outputBin}/share/zsh/vendor-completions" + fishCompDir="''${!outputBin}/share/fish/vendor_completions.d" + mkdir -p "$bashCompDir" "$zshCompDir" "$fishCompDir" + "''${!outputBin}/bin/${exeName}" --bash-completion-script "''${!outputBin}/bin/${exeName}" >"$bashCompDir/${exeName}" + "''${!outputBin}/bin/${exeName}" --zsh-completion-script "''${!outputBin}/bin/${exeName}" >"$zshCompDir/_${exeName}" + "''${!outputBin}/bin/${exeName}" --fish-completion-script "''${!outputBin}/bin/${exeName}" >"$fishCompDir/${exeName}.fish" - # Sanity check - grep -F ${exeName} <$bashCompDir/${exeName} >/dev/null || { - echo 'Could not find ${exeName} in completion script.' - exit 1 - } - ''; + # Sanity check + grep -F ${exeName} <$bashCompDir/${exeName} >/dev/null || { + echo 'Could not find ${exeName} in completion script.' + exit 1 + } + ''; }); /* diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix index 50320b4a949b..44dc23278963 100644 --- a/pkgs/development/haskell-modules/make-package-set.nix +++ b/pkgs/development/haskell-modules/make-package-set.nix @@ -592,17 +592,16 @@ package-set { inherit pkgs lib callPackage; } self # # The important thing to note here is that all the fields from # packageInputs are set correctly. - genericBuilderArgs = - { - pname = if pkgs.lib.length selected == 1 then (pkgs.lib.head selected).name else "packages"; - version = "0"; - license = null; - } - // packageInputs - // pkgs.lib.optionalAttrs doBenchmark { - # `doBenchmark` needs to explicitly be set here because haskellPackages.mkDerivation defaults it to `false`. If the user wants benchmark dependencies included in their development shell, it has to be explicitly enabled here. - doBenchmark = true; - }; + genericBuilderArgs = { + pname = if pkgs.lib.length selected == 1 then (pkgs.lib.head selected).name else "packages"; + version = "0"; + license = null; + } + // packageInputs + // pkgs.lib.optionalAttrs doBenchmark { + # `doBenchmark` needs to explicitly be set here because haskellPackages.mkDerivation defaults it to `false`. If the user wants benchmark dependencies included in their development shell, it has to be explicitly enabled here. + doBenchmark = true; + }; # This is a pseudo Haskell package derivation that contains all the # dependencies for the packages in `selected`. diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 528c87fef4b9..53aa70266194 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -89,111 +89,110 @@ else name = ghc.name + "-with-packages"; paths = paths ++ [ ghc ] ++ lib.optionals installDocumentation [ (lib.getOutput "doc" ghc) ]; nativeBuildInputs = [ makeWrapper ]; - postBuild = - '' - # wrap compiler executables with correct env variables + postBuild = '' + # wrap compiler executables with correct env variables - for prg in ${ghcCommand} ${ghcCommand}i ${ghcCommand}-${ghc.version} ${ghcCommand}i-${ghc.version}; do - if [[ -x "${ghc}/bin/$prg" ]]; then - rm -f $out/bin/$prg - makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ - --add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \ - --set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \ - --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \ - --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \ - --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" \ - ${ - lib.optionalString (ghc.isGhcjs or false) ''--set NODE_PATH "${ghc.socket-io}/lib/node_modules"'' - } \ - ${lib.optionalString useLLVM ''--prefix "PATH" ":" "${llvm}"''} - fi - done + for prg in ${ghcCommand} ${ghcCommand}i ${ghcCommand}-${ghc.version} ${ghcCommand}i-${ghc.version}; do + if [[ -x "${ghc}/bin/$prg" ]]; then + rm -f $out/bin/$prg + makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ + --add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \ + --set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \ + --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \ + --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \ + --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" \ + ${ + lib.optionalString (ghc.isGhcjs or false) ''--set NODE_PATH "${ghc.socket-io}/lib/node_modules"'' + } \ + ${lib.optionalString useLLVM ''--prefix "PATH" ":" "${llvm}"''} + fi + done - for prg in runghc runhaskell; do - if [[ -x "${ghc}/bin/$prg" ]]; then - rm -f $out/bin/$prg - makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ - --add-flags "-f $out/bin/${ghcCommand}" \ - --set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \ - --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \ - --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \ - --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" - fi - done - - for prg in ${ghcCommand}-pkg ${ghcCommand}-pkg-${ghc.version}; do - if [[ -x "${ghc}/bin/$prg" ]]; then - rm -f $out/bin/$prg - makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "--global-package-db=${packageCfgDir}" - fi - done - - # haddock was referring to the base ghc, https://github.com/NixOS/nixpkgs/issues/36976 - if [[ -x "${ghc}/bin/haddock" ]]; then - rm -f $out/bin/haddock - makeWrapper ${ghc}/bin/haddock $out/bin/haddock \ - --add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \ + for prg in runghc runhaskell; do + if [[ -x "${ghc}/bin/$prg" ]]; then + rm -f $out/bin/$prg + makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ + --add-flags "-f $out/bin/${ghcCommand}" \ + --set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \ + --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \ + --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \ --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" fi + done + for prg in ${ghcCommand}-pkg ${ghcCommand}-pkg-${ghc.version}; do + if [[ -x "${ghc}/bin/$prg" ]]; then + rm -f $out/bin/$prg + makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "--global-package-db=${packageCfgDir}" + fi + done + + # haddock was referring to the base ghc, https://github.com/NixOS/nixpkgs/issues/36976 + if [[ -x "${ghc}/bin/haddock" ]]; then + rm -f $out/bin/haddock + makeWrapper ${ghc}/bin/haddock $out/bin/haddock \ + --add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \ + --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" + fi + + '' + + (lib.optionalString (stdenv.targetPlatform.isDarwin && !isGhcjs && !stdenv.targetPlatform.isiOS) '' - + (lib.optionalString (stdenv.targetPlatform.isDarwin && !isGhcjs && !stdenv.targetPlatform.isiOS) - '' - # Work around a linker limit in macOS Sierra (see generic-builder.nix): - local packageConfDir="${packageCfgDir}"; - local dynamicLinksDir="$out/lib/links"; - mkdir -p $dynamicLinksDir - # Clean up the old links that may have been (transitively) included by - # symlinkJoin: - rm -f $dynamicLinksDir/* + # Work around a linker limit in macOS Sierra (see generic-builder.nix): + local packageConfDir="${packageCfgDir}"; + local dynamicLinksDir="$out/lib/links"; + mkdir -p $dynamicLinksDir + # Clean up the old links that may have been (transitively) included by + # symlinkJoin: + rm -f $dynamicLinksDir/* - dynamicLibraryDirs=() + dynamicLibraryDirs=() - for pkg in $($out/bin/ghc-pkg list --simple-output); do - dynamicLibraryDirs+=($($out/bin/ghc-pkg --simple-output field "$pkg" dynamic-library-dirs)) - done + for pkg in $($out/bin/ghc-pkg list --simple-output); do + dynamicLibraryDirs+=($($out/bin/ghc-pkg --simple-output field "$pkg" dynamic-library-dirs)) + done - for dynamicLibraryDir in $(echo "''${dynamicLibraryDirs[@]}" | tr ' ' '\n' | sort -u); do - echo "Linking $dynamicLibraryDir/*.dylib from $dynamicLinksDir" - find "$dynamicLibraryDir" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \; - done + for dynamicLibraryDir in $(echo "''${dynamicLibraryDirs[@]}" | tr ' ' '\n' | sort -u); do + echo "Linking $dynamicLibraryDir/*.dylib from $dynamicLinksDir" + find "$dynamicLibraryDir" -name '*.dylib' -exec ln -s {} "$dynamicLinksDir" \; + done - for f in $packageConfDir/*.conf; do - # Initially, $f is a symlink to a read-only file in one of the inputs - # (as a result of this symlinkJoin derivation). - # Replace it with a copy whose dynamic-library-dirs points to - # $dynamicLinksDir - cp $f $f-tmp - rm $f - sed "N;s,dynamic-library-dirs:\s*.*\n,dynamic-library-dirs: $dynamicLinksDir\n," $f-tmp > $f - rm $f-tmp - done - '' - ) - + '' - ${lib.optionalString hasLibraries '' - # GHC 8.10 changes. - # Instead of replacing package.cache[.lock] with the new file, - # ghc-pkg is now trying to open the file. These file are symlink - # to another nix derivation, so they are not writable. Removing - # them allow the correct behavior of ghc-pkg recache - # See: https://github.com/NixOS/nixpkgs/issues/79441 - rm ${packageCfgDir}/package.cache.lock - rm ${packageCfgDir}/package.cache - - $out/bin/${ghcCommand}-pkg recache - ''} - ${ - # ghcjs will read the ghc_libdir file when resolving plugins. - lib.optionalString (isGhcjs && ghcLibdir != null) '' - mkdir -p "${libDir}" - rm -f "${libDir}/ghc_libdir" - printf '%s' '${ghcLibdir}' > "${libDir}/ghc_libdir" - '' - } - $out/bin/${ghcCommand}-pkg check + for f in $packageConfDir/*.conf; do + # Initially, $f is a symlink to a read-only file in one of the inputs + # (as a result of this symlinkJoin derivation). + # Replace it with a copy whose dynamic-library-dirs points to + # $dynamicLinksDir + cp $f $f-tmp + rm $f + sed "N;s,dynamic-library-dirs:\s*.*\n,dynamic-library-dirs: $dynamicLinksDir\n," $f-tmp > $f + rm $f-tmp + done '' - + postBuild; + ) + + '' + ${lib.optionalString hasLibraries '' + # GHC 8.10 changes. + # Instead of replacing package.cache[.lock] with the new file, + # ghc-pkg is now trying to open the file. These file are symlink + # to another nix derivation, so they are not writable. Removing + # them allow the correct behavior of ghc-pkg recache + # See: https://github.com/NixOS/nixpkgs/issues/79441 + rm ${packageCfgDir}/package.cache.lock + rm ${packageCfgDir}/package.cache + + $out/bin/${ghcCommand}-pkg recache + ''} + ${ + # ghcjs will read the ghc_libdir file when resolving plugins. + lib.optionalString (isGhcjs && ghcLibdir != null) '' + mkdir -p "${libDir}" + rm -f "${libDir}/ghc_libdir" + printf '%s' '${ghcLibdir}' > "${libDir}/ghc_libdir" + '' + } + $out/bin/${ghcCommand}-pkg check + '' + + postBuild; preferLocalBuild = true; passthru = { inherit (ghc) version meta; diff --git a/pkgs/development/idris-modules/build-idris-package.nix b/pkgs/development/idris-modules/build-idris-package.nix index 30a88b810fa4..01e567769575 100644 --- a/pkgs/development/idris-modules/build-idris-package.nix +++ b/pkgs/development/idris-modules/build-idris-package.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation ( buildInputs = [ idris-with-packages gmp - ] ++ extraBuildInputs; + ] + ++ extraBuildInputs; propagatedBuildInputs = allIdrisDeps; # Some packages use the style diff --git a/pkgs/development/interpreters/acl2/default.nix b/pkgs/development/interpreters/acl2/default.nix index 3f6fbe627898..ef29b52348ca 100644 --- a/pkgs/development/interpreters/acl2/default.nix +++ b/pkgs/development/interpreters/acl2/default.nix @@ -72,39 +72,37 @@ stdenv.mkDerivation rec { nativeBuildInputs = lib.optional certifyBooks makeWrapper; - buildInputs = - [ - # ACL2 itself only needs a Common Lisp compiler/interpreter: - sbcl - ] - ++ lib.optionals certifyBooks [ - # To build community books, we need Perl and a couple of utilities: - which - perl - hostname - # Some of the books require one or more of these external tools: - glucose - minisat - abc-verifier - libipasir - z3 - (python3.withPackages (ps: [ ps.z3-solver ])) - ]; + buildInputs = [ + # ACL2 itself only needs a Common Lisp compiler/interpreter: + sbcl + ] + ++ lib.optionals certifyBooks [ + # To build community books, we need Perl and a couple of utilities: + which + perl + hostname + # Some of the books require one or more of these external tools: + glucose + minisat + abc-verifier + libipasir + z3 + (python3.withPackages (ps: [ ps.z3-solver ])) + ]; # NOTE: Parallel building can be memory-intensive depending on the number of # concurrent jobs. For example, this build has been seen to use >120GB of # RAM on an 85 core machine. enableParallelBuilding = true; - preConfigure = - '' - # When certifying books, ACL2 doesn't like $HOME not existing. - export HOME=$(pwd)/fake-home - '' - + lib.optionalString certifyBooks '' - # Some books also care about $USER being nonempty. - export USER=nobody - ''; + preConfigure = '' + # When certifying books, ACL2 doesn't like $HOME not existing. + export HOME=$(pwd)/fake-home + '' + + lib.optionalString certifyBooks '' + # Some books also care about $USER being nonempty. + export USER=nobody + ''; postConfigure = '' # ACL2 and its books need to be built in place in the out directory because @@ -125,15 +123,14 @@ stdenv.mkDerivation rec { doCheck = true; checkTarget = "mini-proveall"; - installPhase = - '' - mkdir -p $out/bin - ln -s $out/share/${pname}/saved_acl2 $out/bin/${pname} - '' - + lib.optionalString certifyBooks '' - ln -s $out/share/${pname}/books/build/cert.pl $out/bin/${pname}-cert - ln -s $out/share/${pname}/books/build/clean.pl $out/bin/${pname}-clean - ''; + installPhase = '' + mkdir -p $out/bin + ln -s $out/share/${pname}/saved_acl2 $out/bin/${pname} + '' + + lib.optionalString certifyBooks '' + ln -s $out/share/${pname}/books/build/cert.pl $out/bin/${pname}-cert + ln -s $out/share/${pname}/books/build/clean.pl $out/bin/${pname}-clean + ''; preDistPhases = [ (if certifyBooks then "certifyBooksPhase" else "removeBooksPhase") ]; @@ -159,32 +156,31 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Interpreter and prover for a Lisp dialect"; mainProgram = "acl2"; - longDescription = - '' - ACL2 is a logic and programming language in which you can model computer - systems, together with a tool to help you prove properties of those - models. "ACL2" denotes "A Computational Logic for Applicative Common - Lisp". + longDescription = '' + ACL2 is a logic and programming language in which you can model computer + systems, together with a tool to help you prove properties of those + models. "ACL2" denotes "A Computational Logic for Applicative Common + Lisp". - ACL2 is part of the Boyer-Moore family of provers, for which its authors - have received the 2005 ACM Software System Award. + ACL2 is part of the Boyer-Moore family of provers, for which its authors + have received the 2005 ACM Software System Award. - This package installs the main ACL2 executable ${pname}, as well as the - build tools cert.pl and clean.pl, renamed to ${pname}-cert and - ${pname}-clean. + This package installs the main ACL2 executable ${pname}, as well as the + build tools cert.pl and clean.pl, renamed to ${pname}-cert and + ${pname}-clean. - '' - + ( - if certifyBooks then - '' - The community books are also included and certified with the `make - everything` target. - '' - else - '' - The community books are not included in this package. - '' - ); + '' + + ( + if certifyBooks then + '' + The community books are also included and certified with the `make + everything` target. + '' + else + '' + The community books are not included in this package. + '' + ); homepage = "https://www.cs.utexas.edu/users/moore/acl2/"; downloadPage = "https://github.com/acl2-devel/acl2-devel/releases"; license = diff --git a/pkgs/development/interpreters/bqn/cbqn/default.nix b/pkgs/development/interpreters/bqn/cbqn/default.nix index 4f450938f9a0..d830e60dba2d 100644 --- a/pkgs/development/interpreters/bqn/cbqn/default.nix +++ b/pkgs/development/interpreters/bqn/cbqn/default.nix @@ -21,13 +21,12 @@ stdenv.mkDerivation { pname = "cbqn" + lib.optionalString (!generateBytecode) "-standalone"; inherit (sources.cbqn) version src; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; buildInputs = [ libffi @@ -37,29 +36,27 @@ stdenv.mkDerivation { "CC=${stdenv.cc.targetPrefix}cc" ]; - buildFlags = - [ - # interpreter binary - "o3" - "notui=1" # display build progress in a plain-text format - "REPLXX=${if enableReplxx then "1" else "0"}" - ] - ++ lib.optionals stdenv.hostPlatform.avx2Support [ - "has=avx2" - ] - ++ lib.optionals enableLibcbqn [ - # embeddable interpreter as a shared lib - "shared-o3" - ]; + buildFlags = [ + # interpreter binary + "o3" + "notui=1" # display build progress in a plain-text format + "REPLXX=${if enableReplxx then "1" else "0"}" + ] + ++ lib.optionals stdenv.hostPlatform.avx2Support [ + "has=avx2" + ] + ++ lib.optionals enableLibcbqn [ + # embeddable interpreter as a shared lib + "shared-o3" + ]; - outputs = - [ - "out" - ] - ++ lib.optionals enableLibcbqn [ - "lib" - "dev" - ]; + outputs = [ + "out" + ] + ++ lib.optionals enableLibcbqn [ + "lib" + "dev" + ]; dontConfigure = true; @@ -72,45 +69,43 @@ stdenv.mkDerivation { patchShebangs build/build ''; - preBuild = - '' - mkdir -p build/singeliLocal/ - cp -r ${sources.singeli.src}/* build/singeliLocal/ - '' - + ( - if generateBytecode then - '' - mkdir -p build/bytecodeLocal/gen - ${bqn-interpreter} ./build/genRuntime ${mbqn-source} build/bytecodeLocal/ - '' - else - '' - mkdir -p build/bytecodeLocal/gen - cp -r ${sources.cbqn-bytecode.src}/* build/bytecodeLocal/ - '' - ) - + lib.optionalString enableReplxx '' - mkdir -p build/replxxLocal/ - cp -r ${sources.replxx.src}/* build/replxxLocal/ - ''; + preBuild = '' + mkdir -p build/singeliLocal/ + cp -r ${sources.singeli.src}/* build/singeliLocal/ + '' + + ( + if generateBytecode then + '' + mkdir -p build/bytecodeLocal/gen + ${bqn-interpreter} ./build/genRuntime ${mbqn-source} build/bytecodeLocal/ + '' + else + '' + mkdir -p build/bytecodeLocal/gen + cp -r ${sources.cbqn-bytecode.src}/* build/bytecodeLocal/ + '' + ) + + lib.optionalString enableReplxx '' + mkdir -p build/replxxLocal/ + cp -r ${sources.replxx.src}/* build/replxxLocal/ + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin/ - cp BQN -t $out/bin/ - # note guard condition for case-insensitive filesystems - [ -e $out/bin/bqn ] || ln -s $out/bin/BQN $out/bin/bqn - [ -e $out/bin/cbqn ] || ln -s $out/bin/BQN $out/bin/cbqn - '' - + lib.optionalString enableLibcbqn '' - install -Dm644 include/bqnffi.h -t "$dev/include" - install -Dm755 libcbqn${stdenv.hostPlatform.extensions.sharedLibrary} -t "$lib/lib" - '' - + '' - runHook postInstall - ''; + mkdir -p $out/bin/ + cp BQN -t $out/bin/ + # note guard condition for case-insensitive filesystems + [ -e $out/bin/bqn ] || ln -s $out/bin/BQN $out/bin/bqn + [ -e $out/bin/cbqn ] || ln -s $out/bin/BQN $out/bin/cbqn + '' + + lib.optionalString enableLibcbqn '' + install -Dm644 include/bqnffi.h -t "$dev/include" + install -Dm755 libcbqn${stdenv.hostPlatform.extensions.sharedLibrary} -t "$lib/lib" + '' + + '' + runHook postInstall + ''; installCheckPhase = '' runHook preInstallCheck diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix index 601aa9db8868..b3e8b339c47c 100644 --- a/pkgs/development/interpreters/clisp/default.nix +++ b/pkgs/development/interpreters/clisp/default.nix @@ -30,17 +30,16 @@ threadSupport ? (stdenv.hostPlatform.isx86 && !stdenv.hostPlatform.isDarwin), x11Support ? (stdenv.hostPlatform.isx86 && !stdenv.hostPlatform.isDarwin), dllSupport ? true, - withModules ? - [ - "asdf" - "pcre" - "rawsock" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "bindings/glibc" - "zlib" - ] - ++ lib.optional x11Support "clx/new-clx", + withModules ? [ + "asdf" + "pcre" + "rawsock" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "bindings/glibc" + "zlib" + ] + ++ lib.optional x11Support "clx/new-clx", }: assert @@ -75,26 +74,25 @@ stdenv.mkDerivation { automake libtool ]; - buildInputs = - [ - bash - libsigsegv - ] - ++ lib.optional (gettext != null) gettext - ++ lib.optional (ncurses != null) ncurses - ++ lib.optional (pcre != null) pcre - ++ lib.optional (zlib != null) zlib - ++ lib.optional (readline != null) readline - ++ lib.optional (ffcallAvailable && (libffi != null)) libffi - ++ lib.optional ffcallAvailable libffcall - ++ lib.optionals x11Support [ - libX11 - libXau - libXt - libXpm - xorgproto - libXext - ]; + buildInputs = [ + bash + libsigsegv + ] + ++ lib.optional (gettext != null) gettext + ++ lib.optional (ncurses != null) ncurses + ++ lib.optional (pcre != null) pcre + ++ lib.optional (zlib != null) zlib + ++ lib.optional (readline != null) readline + ++ lib.optional (ffcallAvailable && (libffi != null)) libffi + ++ lib.optional ffcallAvailable libffcall + ++ lib.optionals x11Support [ + libX11 + libXau + libXt + libXpm + xorgproto + libXext + ]; # First, replace port 9090 (rather low, can be used) # with 64237 (much higher, IANA private area, not @@ -106,16 +104,17 @@ stdenv.mkDerivation { find . -type f | xargs sed -e 's/-lICE/-lXau &/' -i ''; - configureFlags = - [ "builddir" ] - ++ lib.optional (!dllSupport) "--without-dynamic-modules" - ++ lib.optional (readline != null) "--with-readline" - # --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise - ++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi" - ++ lib.optional ffcallAvailable "--with-ffcall" - ++ lib.optional (!ffcallAvailable) "--without-ffcall" - ++ builtins.map (x: " --with-module=" + x) withModules - ++ lib.optional threadSupport "--with-threads=POSIX_THREADS"; + configureFlags = [ + "builddir" + ] + ++ lib.optional (!dllSupport) "--without-dynamic-modules" + ++ lib.optional (readline != null) "--with-readline" + # --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise + ++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi" + ++ lib.optional ffcallAvailable "--with-ffcall" + ++ lib.optional (!ffcallAvailable) "--without-ffcall" + ++ builtins.map (x: " --with-module=" + x) withModules + ++ lib.optional threadSupport "--with-threads=POSIX_THREADS"; preBuild = '' sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d diff --git a/pkgs/development/interpreters/dzaima-apl/default.nix b/pkgs/development/interpreters/dzaima-apl/default.nix index 0b28a6f44c02..a9d796d3054f 100644 --- a/pkgs/development/interpreters/dzaima-apl/default.nix +++ b/pkgs/development/interpreters/dzaima-apl/default.nix @@ -29,46 +29,44 @@ stdenv.mkDerivation rec { patchShebangs --build ./build ''; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - ./build - '' - + lib.optionalString buildNativeImage '' - native-image --report-unsupported-elements-at-runtime \ - -H:CLibraryPath=${lib.getLib jdk}/lib -J-Dfile.encoding=UTF-8 \ - -jar APL.jar dapl - '' - + '' - runHook postBuild - ''; + ./build + '' + + lib.optionalString buildNativeImage '' + native-image --report-unsupported-elements-at-runtime \ + -H:CLibraryPath=${lib.getLib jdk}/lib -J-Dfile.encoding=UTF-8 \ + -jar APL.jar dapl + '' + + '' + runHook postBuild + ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p $out/bin - '' - + ( - if buildNativeImage then - '' - mv dapl $out/bin - '' - else - '' - mkdir -p $out/share/${pname} - mv APL.jar $out/share/${pname}/ + mkdir -p $out/bin + '' + + ( + if buildNativeImage then + '' + mv dapl $out/bin + '' + else + '' + mkdir -p $out/share/${pname} + mv APL.jar $out/share/${pname}/ - makeWrapper "${lib.getBin jdk}/bin/java" "$out/bin/dapl" \ - --add-flags "-jar $out/share/${pname}/APL.jar" - '' - ) - + '' - ln -s $out/bin/dapl $out/bin/apl + makeWrapper "${lib.getBin jdk}/bin/java" "$out/bin/dapl" \ + --add-flags "-jar $out/share/${pname}/APL.jar" + '' + ) + + '' + ln -s $out/bin/dapl $out/bin/apl - runHook postInstall - ''; + runHook postInstall + ''; meta = with lib; { homepage = "https://github.com/dzaima/APL"; diff --git a/pkgs/development/interpreters/erlang/generic-builder.nix b/pkgs/development/interpreters/erlang/generic-builder.nix index 4ca3312609a1..0ba459dd3178 100644 --- a/pkgs/development/interpreters/erlang/generic-builder.nix +++ b/pkgs/development/interpreters/erlang/generic-builder.nix @@ -130,48 +130,47 @@ stdenv.mkDerivation ( DOC_TARGETS = "man chunks"; }; - buildInputs = - [ - ncurses - opensslPackage - zlib - ] - ++ optionals wxSupport wxPackages2 - ++ optionals odbcSupport odbcPackages - ++ optionals javacSupport javacPackages - ++ optional systemdSupport systemd; + buildInputs = [ + ncurses + opensslPackage + zlib + ] + ++ optionals wxSupport wxPackages2 + ++ optionals odbcSupport odbcPackages + ++ optionals javacSupport javacPackages + ++ optional systemdSupport systemd; debugInfo = enableDebugInfo; # On some machines, parallel build reliably crashes on `GEN asn1ct_eval_ext.erl` step enableParallelBuilding = parallelBuild; - postPatch = - '' - patchShebangs make + postPatch = '' + patchShebangs make - ${postPatch} - '' - + optionalString (lib.versionOlder "25" version) '' - substituteInPlace lib/os_mon/src/disksup.erl \ - --replace-fail '"sh ' '"${runtimeShell} ' - ''; + ${postPatch} + '' + + optionalString (lib.versionOlder "25" version) '' + substituteInPlace lib/os_mon/src/disksup.erl \ + --replace-fail '"sh ' '"${runtimeShell} ' + ''; - configureFlags = - [ "--with-ssl=${lib.getOutput "out" opensslPackage}" ] - ++ [ "--with-ssl-incl=${lib.getDev opensslPackage}" ] # This flag was introduced in R24 - ++ optional enableThreads "--enable-threads" - ++ optional enableSmpSupport "--enable-smp-support" - ++ optional enableKernelPoll "--enable-kernel-poll" - ++ optional enableHipe "--enable-hipe" - ++ optional javacSupport "--with-javac" - ++ optional odbcSupport "--with-odbc=${unixODBC}" - ++ optional wxSupport "--enable-wx" - ++ optional systemdSupport "--enable-systemd" - ++ optional stdenv.hostPlatform.isDarwin "--enable-darwin-64bit" - # make[3]: *** [yecc.beam] Segmentation fault: 11 - ++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) "--disable-jit" - ++ configureFlags; + configureFlags = [ + "--with-ssl=${lib.getOutput "out" opensslPackage}" + ] + ++ [ "--with-ssl-incl=${lib.getDev opensslPackage}" ] # This flag was introduced in R24 + ++ optional enableThreads "--enable-threads" + ++ optional enableSmpSupport "--enable-smp-support" + ++ optional enableKernelPoll "--enable-kernel-poll" + ++ optional enableHipe "--enable-hipe" + ++ optional javacSupport "--with-javac" + ++ optional odbcSupport "--with-odbc=${unixODBC}" + ++ optional wxSupport "--enable-wx" + ++ optional systemdSupport "--enable-systemd" + ++ optional stdenv.hostPlatform.isDarwin "--enable-darwin-64bit" + # make[3]: *** [yecc.beam] Segmentation fault: 11 + ++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) "--disable-jit" + ++ configureFlags; # install-docs will generate and install manpages and html docs # (PDFs are generated only when fop is available). diff --git a/pkgs/development/interpreters/gnudatalanguage/default.nix b/pkgs/development/interpreters/gnudatalanguage/default.nix index 761695d96920..154c23aa18ac 100644 --- a/pkgs/development/interpreters/gnudatalanguage/default.nix +++ b/pkgs/development/interpreters/gnudatalanguage/default.nix @@ -131,41 +131,40 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ] ++ lib.optional enableWX wrapGAppsHook3; - buildInputs = - [ - qhull - readline - ncurses - zlib - gsl - openmp - graphicsmagick - fftw - fftwFloat - fftwLongDouble - proj - shapelib - expat - mpi - udunits - eigen - pslib - libpng - libtiff - libgeotiff - libjpeg - hdf4-custom - hdf5-custom - netcdf-custom - plplot-with-drivers - ] - ++ lib.optional enableXWin plplot-with-drivers.libX11 - ++ lib.optional enableGRIB eccodes - ++ lib.optional enableGLPK glpk - ++ lib.optional enableWX wxGTK32 - ++ lib.optional enableMPI mpi - ++ lib.optional enableLibtirpc hdf4-custom.libtirpc - ++ lib.optional enableSzip szip; + buildInputs = [ + qhull + readline + ncurses + zlib + gsl + openmp + graphicsmagick + fftw + fftwFloat + fftwLongDouble + proj + shapelib + expat + mpi + udunits + eigen + pslib + libpng + libtiff + libgeotiff + libjpeg + hdf4-custom + hdf5-custom + netcdf-custom + plplot-with-drivers + ] + ++ lib.optional enableXWin plplot-with-drivers.libX11 + ++ lib.optional enableGRIB eccodes + ++ lib.optional enableGLPK glpk + ++ lib.optional enableWX wxGTK32 + ++ lib.optional enableMPI mpi + ++ lib.optional enableLibtirpc hdf4-custom.libtirpc + ++ lib.optional enableSzip szip; propagatedBuildInputs = [ (python3.withPackages (ps: with ps; [ numpy ])) diff --git a/pkgs/development/interpreters/guile/1.8.nix b/pkgs/development/interpreters/guile/1.8.nix index d5f0fe3f6800..a77a794661cf 100644 --- a/pkgs/development/interpreters/guile/1.8.nix +++ b/pkgs/development/interpreters/guile/1.8.nix @@ -29,17 +29,17 @@ stdenv.mkDerivation rec { setOutputFlags = false; # $dev gets into the library otherwise # GCC 4.6 raises a number of set-but-unused warnings. - configureFlags = - [ - "--disable-error-on-warning" - ] - # Guile needs patching to preset results for the configure tests about - # pthreads, which work only in native builds. - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--with-threads=no"; + configureFlags = [ + "--disable-error-on-warning" + ] + # Guile needs patching to preset results for the configure tests about + # pthreads, which work only in native builds. + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--with-threads=no"; depsBuildBuild = [ buildPackages.stdenv.cc - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) pkgsBuildBuild.guile_1_8; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) pkgsBuildBuild.guile_1_8; nativeBuildInputs = [ makeWrapper pkg-config @@ -69,17 +69,16 @@ stdenv.mkDerivation rec { sed -e '/lt_dlinit/a lt_dladdsearchdir("'$out/lib'");' -i libguile/dynl.c ''; - postInstall = - '' - wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" - '' - # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for - # why `--with-libunistring-prefix' and similar options coming from - # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. - + '' - sed -i "$out/lib/pkgconfig/guile"-*.pc \ - -e "s|-lltdl|-L${libtool.lib}/lib -lltdl|g" - ''; + postInstall = '' + wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" + '' + # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for + # why `--with-libunistring-prefix' and similar options coming from + # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. + + '' + sed -i "$out/lib/pkgconfig/guile"-*.pc \ + -e "s|-lltdl|-L${libtool.lib}/lib -lltdl|g" + ''; # One test fails. # ERROR: file: "libtest-asmobs", message: "file not found" diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix index ad542da64325..4a00c4a277c6 100644 --- a/pkgs/development/interpreters/guile/2.0.nix +++ b/pkgs/development/interpreters/guile/2.0.nix @@ -39,7 +39,8 @@ builder rec { depsBuildBuild = [ buildPackages.stdenv.cc - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) pkgsBuildBuild.guile_2_0; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) pkgsBuildBuild.guile_2_0; nativeBuildInputs = [ makeWrapper @@ -65,30 +66,29 @@ builder rec { enableParallelBuilding = true; - patches = - [ - # Small fixes to Clang compiler - ./clang.patch - # Self-explanatory - ./disable-gc-sensitive-tests.patch - # Read the header of the patch to more info - ./eai_system.patch - # RISC-V endianness - ./riscv.patch - # Fixes stability issues with 00-repl-server.test - (fetchpatch { - url = "https://git.savannah.gnu.org/cgit/guile.git/patch/?id=2fbde7f02adb8c6585e9baf6e293ee49cd23d4c4"; - sha256 = "0p6c1lmw1iniq03z7x5m65kg3lq543kgvdb4nrxsaxjqf3zhl77v"; - }) - ] - ++ (lib.optional (coverageAnalysis != null) ./gcov-file-name.patch) - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./filter-mkostemp-darwin.patch - (fetchpatch { - url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; - sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; - }) - ]; + patches = [ + # Small fixes to Clang compiler + ./clang.patch + # Self-explanatory + ./disable-gc-sensitive-tests.patch + # Read the header of the patch to more info + ./eai_system.patch + # RISC-V endianness + ./riscv.patch + # Fixes stability issues with 00-repl-server.test + (fetchpatch { + url = "https://git.savannah.gnu.org/cgit/guile.git/patch/?id=2fbde7f02adb8c6585e9baf6e293ee49cd23d4c4"; + sha256 = "0p6c1lmw1iniq03z7x5m65kg3lq543kgvdb4nrxsaxjqf3zhl77v"; + }) + ] + ++ (lib.optional (coverageAnalysis != null) ./gcov-file-name.patch) + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./filter-mkostemp-darwin.patch + (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; + }) + ]; # Explicitly link against libgcc_s, to work around the infamous # "libgcc_s.so.1 must be installed for pthread_cancel to work". @@ -98,40 +98,38 @@ builder rec { !stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isMusl ) "-lgcc_s"; - configureFlags = - [ - "--with-libreadline-prefix" - ] - ++ lib.optionals stdenv.hostPlatform.isSunOS [ - # Make sure the right is found, and not the incompatible - # /usr/include/mp.h from OpenSolaris. See - # - # for details. - "--with-libgmp-prefix=${lib.getDev gmp}" + configureFlags = [ + "--with-libreadline-prefix" + ] + ++ lib.optionals stdenv.hostPlatform.isSunOS [ + # Make sure the right is found, and not the incompatible + # /usr/include/mp.h from OpenSolaris. See + # + # for details. + "--with-libgmp-prefix=${lib.getDev gmp}" - # Same for these (?). - "--with-libreadline-prefix=${lib.getDev readline}" - "--with-libunistring-prefix=${libunistring}" + # Same for these (?). + "--with-libreadline-prefix=${lib.getDev readline}" + "--with-libunistring-prefix=${libunistring}" - # See below. - "--without-threads" - ]; + # See below. + "--without-threads" + ]; - postInstall = - '' - wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" - '' - # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for - # why `--with-libunistring-prefix' and similar options coming from - # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. - + '' - sed -i "$out/lib/pkgconfig/guile"-*.pc \ - -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; - s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ; - s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; - s|includedir=$out|includedir=$dev|g - " - ''; + postInstall = '' + wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" + '' + # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for + # why `--with-libunistring-prefix' and similar options coming from + # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. + + '' + sed -i "$out/lib/pkgconfig/guile"-*.pc \ + -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; + s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ; + s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; + s|includedir=$out|includedir=$dev|g + " + ''; # make check doesn't work on darwin # On Linuxes+Hydra the tests are flaky; feel free to investigate deeper. diff --git a/pkgs/development/interpreters/guile/2.2.nix b/pkgs/development/interpreters/guile/2.2.nix index deb74210bdb7..2d83596f0746 100644 --- a/pkgs/development/interpreters/guile/2.2.nix +++ b/pkgs/development/interpreters/guile/2.2.nix @@ -39,7 +39,8 @@ builder rec { depsBuildBuild = [ buildPackages.stdenv.cc - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) pkgsBuildBuild.guile_2_2; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) pkgsBuildBuild.guile_2_2; nativeBuildInputs = [ makeWrapper pkg-config @@ -70,16 +71,15 @@ builder rec { # re: https://build.opensuse.org/request/show/732638 enableParallelBuilding = false; - patches = - [ - # Read the header of the patch to more info - ./eai_system.patch - ] - ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch - ++ lib.optional stdenv.hostPlatform.isDarwin (fetchpatch { - url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; - sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; - }); + patches = [ + # Read the header of the patch to more info + ./eai_system.patch + ] + ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch + ++ lib.optional stdenv.hostPlatform.isDarwin (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; + }); # Explicitly link against libgcc_s, to work around the infamous # "libgcc_s.so.1 must be installed for pthread_cancel to work". @@ -87,39 +87,37 @@ builder rec { # don't have "libgcc_s.so.1" on clang LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s"; - configureFlags = - [ - "--with-libreadline-prefix=${lib.getDev readline}" - ] - ++ lib.optionals stdenv.hostPlatform.isSunOS [ - # Make sure the right is found, and not the incompatible - # /usr/include/mp.h from OpenSolaris. See - # - # for details. - "--with-libgmp-prefix=${lib.getDev gmp}" + configureFlags = [ + "--with-libreadline-prefix=${lib.getDev readline}" + ] + ++ lib.optionals stdenv.hostPlatform.isSunOS [ + # Make sure the right is found, and not the incompatible + # /usr/include/mp.h from OpenSolaris. See + # + # for details. + "--with-libgmp-prefix=${lib.getDev gmp}" - # Same for these (?). - "--with-libunistring-prefix=${libunistring}" + # Same for these (?). + "--with-libunistring-prefix=${libunistring}" - # See below. - "--without-threads" - ]; + # See below. + "--without-threads" + ]; - postInstall = - '' - wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" - '' - # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for - # why `--with-libunistring-prefix' and similar options coming from - # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. - + '' - sed -i "$out/lib/pkgconfig/guile"-*.pc \ - -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; - s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ; - s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; - s|includedir=$out|includedir=$dev|g - " - ''; + postInstall = '' + wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" + '' + # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for + # why `--with-libunistring-prefix' and similar options coming from + # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. + + '' + sed -i "$out/lib/pkgconfig/guile"-*.pc \ + -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; + s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ; + s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; + s|includedir=$out|includedir=$dev|g + " + ''; # make check doesn't work on darwin # On Linuxes+Hydra the tests are flaky; feel free to investigate deeper. diff --git a/pkgs/development/interpreters/guile/3.0.nix b/pkgs/development/interpreters/guile/3.0.nix index ed0acd26e532..3ead981877d1 100644 --- a/pkgs/development/interpreters/guile/3.0.nix +++ b/pkgs/development/interpreters/guile/3.0.nix @@ -40,44 +40,42 @@ builder rec { ]; setOutputFlags = false; # $dev gets into the library otherwise - depsBuildBuild = - [ - buildPackages.stdenv.cc - ] - ++ lib.optional ( - !lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform - ) pkgsBuildBuild.guile_3_0; + depsBuildBuild = [ + buildPackages.stdenv.cc + ] + ++ lib.optional ( + !lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform + ) pkgsBuildBuild.guile_3_0; nativeBuildInputs = [ makeWrapper pkg-config - ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) autoreconfHook; + ] + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) autoreconfHook; - buildInputs = - [ - libffi - libtool - libunistring - readline - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libxcrypt - ]; - propagatedBuildInputs = - [ - boehmgc - gmp + buildInputs = [ + libffi + libtool + libunistring + readline + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libxcrypt + ]; + propagatedBuildInputs = [ + boehmgc + gmp - # These ones aren't normally needed here, but `libguile*.la' has '-l' - # flags for them without corresponding '-L' flags. Adding them here will - # add the needed `-L' flags. As for why the `.la' file lacks the `-L' - # flags, see below. - libtool - libunistring - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libxcrypt - ]; + # These ones aren't normally needed here, but `libguile*.la' has '-l' + # flags for them without corresponding '-L' flags. Adding them here will + # add the needed `-L' flags. As for why the `.la' file lacks the `-L' + # flags, see below. + libtool + libunistring + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libxcrypt + ]; strictDeps = true; @@ -87,21 +85,20 @@ builder rec { # bit-reproducibly as long as we're not cross-compiling enableParallelBuilding = lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform; - patches = - [ - ./eai_system.patch - ] - # Fix cross-compilation, can be removed at next release (as well as the autoreconfHook) - # Include this only conditionally so we don't have to run the autoreconfHook for the native build. - ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) (fetchpatch { - url = "https://cgit.git.savannah.gnu.org/cgit/guile.git/patch/?id=c117f8edc471d3362043d88959d73c6a37e7e1e9"; - hash = "sha256-GFwJiwuU8lT1fNueMOcvHh8yvA4HYHcmPml2fY/HSjw="; - }) - ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch - ++ lib.optional stdenv.hostPlatform.isDarwin (fetchpatch { - url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; - sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; - }); + patches = [ + ./eai_system.patch + ] + # Fix cross-compilation, can be removed at next release (as well as the autoreconfHook) + # Include this only conditionally so we don't have to run the autoreconfHook for the native build. + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) (fetchpatch { + url = "https://cgit.git.savannah.gnu.org/cgit/guile.git/patch/?id=c117f8edc471d3362043d88959d73c6a37e7e1e9"; + hash = "sha256-GFwJiwuU8lT1fNueMOcvHh8yvA4HYHcmPml2fY/HSjw="; + }) + ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch + ++ lib.optional stdenv.hostPlatform.isDarwin (fetchpatch { + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; + }); # Explicitly link against libgcc_s, to work around the infamous # "libgcc_s.so.1 must be installed for pthread_cancel to work". @@ -109,43 +106,41 @@ builder rec { # don't have "libgcc_s.so.1" on clang LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s"; - configureFlags = - [ - "--with-libreadline-prefix=${lib.getDev readline}" - ] - ++ lib.optionals stdenv.hostPlatform.isSunOS [ - # Make sure the right is found, and not the incompatible - # /usr/include/mp.h from OpenSolaris. See - # - # for details. - "--with-libgmp-prefix=${lib.getDev gmp}" + configureFlags = [ + "--with-libreadline-prefix=${lib.getDev readline}" + ] + ++ lib.optionals stdenv.hostPlatform.isSunOS [ + # Make sure the right is found, and not the incompatible + # /usr/include/mp.h from OpenSolaris. See + # + # for details. + "--with-libgmp-prefix=${lib.getDev gmp}" - # Same for these (?). - "--with-libunistring-prefix=${libunistring}" + # Same for these (?). + "--with-libunistring-prefix=${libunistring}" - # See below. - "--without-threads" - ] - # At least on x86_64-darwin '-flto' autodetection is not correct: - # https://github.com/NixOS/nixpkgs/pull/160051#issuecomment-1046193028 - ++ lib.optional (stdenv.hostPlatform.isDarwin) "--disable-lto"; + # See below. + "--without-threads" + ] + # At least on x86_64-darwin '-flto' autodetection is not correct: + # https://github.com/NixOS/nixpkgs/pull/160051#issuecomment-1046193028 + ++ lib.optional (stdenv.hostPlatform.isDarwin) "--disable-lto"; - postInstall = - '' - wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" - '' - # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for - # why `--with-libunistring-prefix' and similar options coming from - # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. - + '' - sed -i "$out/lib/pkgconfig/guile"-*.pc \ - -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; - s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; - s|-lcrypt|-L${libxcrypt}/lib -lcrypt|g ; - s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ; - s|includedir=$out|includedir=$dev|g - " - ''; + postInstall = '' + wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" + '' + # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for + # why `--with-libunistring-prefix' and similar options coming from + # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. + + '' + sed -i "$out/lib/pkgconfig/guile"-*.pc \ + -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; + s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; + s|-lcrypt|-L${libxcrypt}/lib -lcrypt|g ; + s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ; + s|includedir=$out|includedir=$dev|g + " + ''; # make check doesn't work on darwin # On Linuxes+Hydra the tests are flaky; feel free to investigate deeper. diff --git a/pkgs/development/interpreters/janet/default.nix b/pkgs/development/interpreters/janet/default.nix index 3c193dbe7d03..ffb01c59f78e 100644 --- a/pkgs/development/interpreters/janet/default.nix +++ b/pkgs/development/interpreters/janet/default.nix @@ -19,16 +19,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-PLfBFsZqwSpE+3cduDXyRZZDpiL8+zHyIjVopK0oqPo="; }; - postPatch = - '' - substituteInPlace janet.1 \ - --replace /usr/local/ $out/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # error: Socket is not connected - substituteInPlace meson.build \ - --replace "'test/suite-ev.janet'," "" - ''; + postPatch = '' + substituteInPlace janet.1 \ + --replace /usr/local/ $out/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # error: Socket is not connected + substituteInPlace meson.build \ + --replace "'test/suite-ev.janet'," "" + ''; nativeBuildInputs = [ meson diff --git a/pkgs/development/interpreters/lfe/generic-builder.nix b/pkgs/development/interpreters/lfe/generic-builder.nix index 226df345cf1c..46ce5daa801c 100644 --- a/pkgs/development/interpreters/lfe/generic-builder.nix +++ b/pkgs/development/interpreters/lfe/generic-builder.nix @@ -68,7 +68,8 @@ else patches = [ ./fix-rebar-config.patch ./dedup-ebins.patch - ] ++ patches; + ] + ++ patches; doCheck = true; checkTarget = "travis"; diff --git a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix index 71ad7bbb0989..736c9463521f 100644 --- a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix +++ b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix @@ -90,7 +90,8 @@ let __structuredAttrs = true; env = { LUAROCKS_CONFIG = self.configFile; - } // attrs.env or { }; + } + // attrs.env or { }; generatedRockspecFilename = "./${self.pname}-${self.rockspecVersion}.rockspec"; @@ -132,12 +133,10 @@ let text = self.luarocks_content; }; - luarocks_content = - (lib.generators.toLua { asBindings = true; } self.luarocksConfig) - + '' + luarocks_content = (lib.generators.toLua { asBindings = true; } self.luarocksConfig) + '' - ${self.extraConfig} - ''; + ${self.extraConfig} + ''; # TODO make it the default variable luarocksConfig = @@ -172,22 +171,21 @@ let in lib.recursiveUpdate generatedConfig luarocksConfig'; - configurePhase = - '' - runHook preConfigure - '' - + lib.optionalString (self.rockspecFilename == null) '' - rockspecFilename="${self.generatedRockspecFilename}" - '' - + lib.optionalString (self.knownRockspec != null) '' - # prevents the following type of error: - # Inconsistency between rockspec filename (42fm1b3d7iv6fcbhgm9674as3jh6y2sh-luv-1.22.0-1.rockspec) and its contents (luv-1.22.0-1.rockspec) - rockspecFilename="$TMP/$(stripHash ${self.knownRockspec})" - cp ${self.knownRockspec} "$rockspecFilename" - '' - + '' - runHook postConfigure - ''; + configurePhase = '' + runHook preConfigure + '' + + lib.optionalString (self.rockspecFilename == null) '' + rockspecFilename="${self.generatedRockspecFilename}" + '' + + lib.optionalString (self.knownRockspec != null) '' + # prevents the following type of error: + # Inconsistency between rockspec filename (42fm1b3d7iv6fcbhgm9674as3jh6y2sh-luv-1.22.0-1.rockspec) and its contents (luv-1.22.0-1.rockspec) + rockspecFilename="$TMP/$(stripHash ${self.knownRockspec})" + cp ${self.knownRockspec} "$rockspecFilename" + '' + + '' + runHook postConfigure + ''; buildPhase = '' runHook preBuild @@ -243,14 +241,16 @@ let passthru = { inherit lua; - } // attrs.passthru or { }; + } + // attrs.passthru or { }; meta = { platforms = lua.meta.platforms; # add extra maintainer(s) to every package maintainers = (attrs.meta.maintainers or [ ]) ++ [ ]; broken = disabled; - } // attrs.meta or { }; + } + // attrs.meta or { }; } ) ); diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix index 8e6b68f27a60..b6562f4137b2 100644 --- a/pkgs/development/interpreters/lua-5/default.nix +++ b/pkgs/development/interpreters/lua-5/default.nix @@ -156,7 +156,8 @@ rec { inherit passthruFun; patches = [ ./CVE-2022-28805.patch - ] ++ lib.optional stdenv.hostPlatform.isDarwin ./5.2.darwin.patch; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin ./5.2.darwin.patch; }; lua5_2_compat = lua5_2.override ({ diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index c6db643eb79b..7142370b89f6 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -84,20 +84,19 @@ stdenv.mkDerivation ( inherit patches; - postPatch = - '' - sed -i "s@#define LUA_ROOT[[:space:]]*\"/usr/local/\"@#define LUA_ROOT \"$out/\"@g" src/luaconf.h + postPatch = '' + sed -i "s@#define LUA_ROOT[[:space:]]*\"/usr/local/\"@#define LUA_ROOT \"$out/\"@g" src/luaconf.h - # abort if patching didn't work - grep $out src/luaconf.h - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin && !staticOnly) '' - # Add a target for a shared library to the Makefile. - sed -e '1s/^/LUA_SO = liblua.so/' \ - -e 's/ALL_T *= */&$(LUA_SO) /' \ - -i src/Makefile - cat ${./lua-dso.make} >> src/Makefile - ''; + # abort if patching didn't work + grep $out src/luaconf.h + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin && !staticOnly) '' + # Add a target for a shared library to the Makefile. + sed -e '1s/^/LUA_SO = liblua.so/' \ + -e 's/ALL_T *= */&$(LUA_SO) /' \ + -i src/Makefile + cat ${./lua-dso.make} >> src/Makefile + ''; env = { inherit luaversion; diff --git a/pkgs/development/interpreters/lua-5/wrapper.nix b/pkgs/development/interpreters/lua-5/wrapper.nix index 02e4a4e64055..09399efc95ca 100644 --- a/pkgs/development/interpreters/lua-5/wrapper.nix +++ b/pkgs/development/interpreters/lua-5/wrapper.nix @@ -30,39 +30,38 @@ let ]; # we create wrapper for the binaries in the different packages - postBuild = - '' - source ${lua}/nix-support/utils.sh - if [ -L "$out/bin" ]; then - unlink "$out/bin" - fi - mkdir -p "$out/bin" + postBuild = '' + source ${lua}/nix-support/utils.sh + if [ -L "$out/bin" ]; then + unlink "$out/bin" + fi + mkdir -p "$out/bin" - buildLuaPath "$out" + buildLuaPath "$out" - # take every binary from lua packages and put them into the env - for path in ${lib.concatStringsSep " " paths}; do - nix_debug "looking for binaries in path = $path" - if [ -d "$path/bin" ]; then - cd "$path/bin" - for prg in *; do - if [ -f "$prg" ]; then - rm -f "$out/bin/$prg" - if [ -x "$prg" ]; then - nix_debug "Making wrapper $prg" - makeWrapper "$path/bin/$prg" "$out/bin/$prg" \ - --set-default LUA_PATH ";;" \ - --suffix LUA_PATH ';' "$LUA_PATH" \ - --set-default LUA_CPATH ";;" \ - --suffix LUA_CPATH ';' "$LUA_CPATH" \ - ${lib.concatStringsSep " " makeWrapperArgs} - fi + # take every binary from lua packages and put them into the env + for path in ${lib.concatStringsSep " " paths}; do + nix_debug "looking for binaries in path = $path" + if [ -d "$path/bin" ]; then + cd "$path/bin" + for prg in *; do + if [ -f "$prg" ]; then + rm -f "$out/bin/$prg" + if [ -x "$prg" ]; then + nix_debug "Making wrapper $prg" + makeWrapper "$path/bin/$prg" "$out/bin/$prg" \ + --set-default LUA_PATH ";;" \ + --suffix LUA_PATH ';' "$LUA_PATH" \ + --set-default LUA_CPATH ";;" \ + --suffix LUA_CPATH ';' "$LUA_CPATH" \ + ${lib.concatStringsSep " " makeWrapperArgs} fi - done - fi - done - '' - + postBuild; + fi + done + fi + done + '' + + postBuild; inherit (lua) meta; diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index f7ab39cfbcad..a4f7754ed05b 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -87,15 +87,14 @@ stdenv.mkDerivation (finalAttrs: { buildFlags = [ "amalg" # Build highly optimized version ]; - makeFlags = - [ - "PREFIX=$(out)" - "DEFAULT_CC=cc" - "CROSS=${stdenv.cc.targetPrefix}" - "HOST_CC=${buildStdenv.cc}/bin/cc" - ] - ++ lib.optional enableJITDebugModule "INSTALL_LJLIBD=$(INSTALL_LMOD)" - ++ lib.optional stdenv.hostPlatform.isStatic "BUILDMODE=static"; + makeFlags = [ + "PREFIX=$(out)" + "DEFAULT_CC=cc" + "CROSS=${stdenv.cc.targetPrefix}" + "HOST_CC=${buildStdenv.cc}/bin/cc" + ] + ++ lib.optional enableJITDebugModule "INSTALL_LJLIBD=$(INSTALL_LMOD)" + ++ lib.optional stdenv.hostPlatform.isStatic "BUILDMODE=static"; enableParallelBuilding = true; env.NIX_CFLAGS_COMPILE = toString XCFLAGS; diff --git a/pkgs/development/interpreters/octave/build-env.nix b/pkgs/development/interpreters/octave/build-env.nix index 8a1bebccf670..d83003aa8a8a 100644 --- a/pkgs/development/interpreters/octave/build-env.nix +++ b/pkgs/development/interpreters/octave/build-env.nix @@ -38,55 +38,54 @@ buildEnv { # Then, we can re-symlink the all of octave/share, except for /share/octave # in env/share/octave, re-symlink everything from octave/share/octave and then # perform the pkg install. - postBuild = - '' - if [ -L "$out/bin" ]; then - unlink $out/bin - mkdir -p "$out/bin" - cd "${octave}/bin" - for prg in *; do - if [ -x $prg ]; then - makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" \ - --set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc" \ - --set LOCALE_ARCHIVE "${glibcLocalesUtf8}/lib/locale/locale-archive" - fi - done - cd $out - fi + postBuild = '' + if [ -L "$out/bin" ]; then + unlink $out/bin + mkdir -p "$out/bin" + cd "${octave}/bin" + for prg in *; do + if [ -x $prg ]; then + makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" \ + --set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc" \ + --set LOCALE_ARCHIVE "${glibcLocalesUtf8}/lib/locale/locale-archive" + fi + done + cd $out + fi - # Remove symlinks to the input tarballs, they aren't needed, use -f so it - # will not fail if no .tar.gz symlinks are there - for example if - # sommething which is not a tarball used as a package - rm -f $out/*.tar.gz + # Remove symlinks to the input tarballs, they aren't needed, use -f so it + # will not fail if no .tar.gz symlinks are there - for example if + # sommething which is not a tarball used as a package + rm -f $out/*.tar.gz - createOctavePackagesPath $out ${octave} + createOctavePackagesPath $out ${octave} - # Create the file even if the loop afterwards has no packages to run over - touch $out/.octave_packages - for path in ${lib.concatStringsSep " " packages}; do - if [ -e $path/*.tar.gz ]; then - $out/bin/octave-cli --eval "pkg local_list $out/.octave_packages; \ - pkg prefix $out/${octave.octPkgsPath} $out/${octave.octPkgsPath}; \ - pfx = pkg (\"prefix\"); \ - pkg install -nodeps -local $path/*.tar.gz" - fi - done + # Create the file even if the loop afterwards has no packages to run over + touch $out/.octave_packages + for path in ${lib.concatStringsSep " " packages}; do + if [ -e $path/*.tar.gz ]; then + $out/bin/octave-cli --eval "pkg local_list $out/.octave_packages; \ + pkg prefix $out/${octave.octPkgsPath} $out/${octave.octPkgsPath}; \ + pfx = pkg (\"prefix\"); \ + pkg install -nodeps -local $path/*.tar.gz" + fi + done - # Re-write the octave-wide startup file (share/octave/site/m/startup/octaverc) - # To point to the new local_list in $out - addPkgLocalList $out ${octave} + # Re-write the octave-wide startup file (share/octave/site/m/startup/octaverc) + # To point to the new local_list in $out + addPkgLocalList $out ${octave} - wrapOctavePrograms "${lib.concatStringsSep " " packages}" - # We also need to modify the Exec= line of the desktop file, so it will point - # to the wrapper we generated above. - rm $out/share/applications # should be a symlink to ${octave}/share/applications - mkdir $out/share/applications - substitute \ - ${octave}/share/applications/org.octave.Octave.desktop \ - $out/share/applications/org.octave.Octave.desktop \ - --replace-fail ${octave}/bin/octave $out/bin/octave - '' - + postBuild; + wrapOctavePrograms "${lib.concatStringsSep " " packages}" + # We also need to modify the Exec= line of the desktop file, so it will point + # to the wrapper we generated above. + rm $out/share/applications # should be a symlink to ${octave}/share/applications + mkdir $out/share/applications + substitute \ + ${octave}/share/applications/org.octave.Octave.desktop \ + $out/share/applications/org.octave.Octave.desktop \ + --replace-fail ${octave}/bin/octave $out/bin/octave + '' + + postBuild; inherit (octave) meta; diff --git a/pkgs/development/interpreters/octave/build-octave-package.nix b/pkgs/development/interpreters/octave/build-octave-package.nix index 8fc219d00d74..507b26931473 100644 --- a/pkgs/development/interpreters/octave/build-octave-package.nix +++ b/pkgs/development/interpreters/octave/build-octave-package.nix @@ -63,7 +63,8 @@ let nativeBuildInputs' = [ octave writeRequiredOctavePackagesHook - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; # This step is required because when # a = { test = [ "a" "b" ]; }; b = { test = [ "c" "d" ]; }; @@ -130,22 +131,22 @@ stdenv.mkDerivation ( # together with Octave. dontInstall = true; - passthru = - { - updateScript = [ - ../../../../maintainers/scripts/update-octave-packages - (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file - ]; + passthru = { + updateScript = [ + ../../../../maintainers/scripts/update-octave-packages + (builtins.unsafeGetAttrPos "pname" octave.pkgs.${attrs.pname}).file + ]; + } + // passthru + // { + tests = { + testOctaveBuildEnv = (octave.withPackages (os: [ finalAttrs.finalPackage ])).overrideAttrs (old: { + name = "${finalAttrs.name}-pkg-install"; + }); + testOctavePkgTests = callPackage ./run-pkg-test.nix { } finalAttrs.finalPackage; } - // passthru - // { - tests = { - testOctaveBuildEnv = (octave.withPackages (os: [ finalAttrs.finalPackage ])).overrideAttrs (old: { - name = "${finalAttrs.name}-pkg-install"; - }); - testOctavePkgTests = callPackage ./run-pkg-test.nix { } finalAttrs.finalPackage; - } // passthru.tests or { }; - }; + // passthru.tests or { }; + }; inherit meta; } diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index 39e4b213e3b8..9eacfd0b8566 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -109,64 +109,62 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs --build build-aux/*.pl ''; - buildInputs = - [ - readline - ncurses - flex - qhull - graphicsmagick - pcre2 - fltk - zlib - curl - rapidjson - blas' - lapack' - libsndfile - fftw - fftwSinglePrec - portaudio - qrupdate' - arpack' - libwebp - gl2ps - ghostscript - hdf5 - glpk - suitesparse' - sundials - gnuplot - python3 - ] - ++ lib.optionals enableQt [ - libsForQt5.qtbase - libsForQt5.qtsvg - libsForQt5.qscintilla - ] - ++ lib.optionals (enableJava) [ - jdk - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGL - libGLU - libX11 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; - nativeBuildInputs = - [ - perl - pkg-config - gfortran - texinfo - ] - ++ lib.optionals enableQt [ - libsForQt5.wrapQtAppsHook - libsForQt5.qtscript - libsForQt5.qttools - ]; + buildInputs = [ + readline + ncurses + flex + qhull + graphicsmagick + pcre2 + fltk + zlib + curl + rapidjson + blas' + lapack' + libsndfile + fftw + fftwSinglePrec + portaudio + qrupdate' + arpack' + libwebp + gl2ps + ghostscript + hdf5 + glpk + suitesparse' + sundials + gnuplot + python3 + ] + ++ lib.optionals enableQt [ + libsForQt5.qtbase + libsForQt5.qtsvg + libsForQt5.qscintilla + ] + ++ lib.optionals (enableJava) [ + jdk + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGL + libGLU + libX11 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; + nativeBuildInputs = [ + perl + pkg-config + gfortran + texinfo + ] + ++ lib.optionals enableQt [ + libsForQt5.wrapQtAppsHook + libsForQt5.qtscript + libsForQt5.qttools + ]; doCheck = !stdenv.hostPlatform.isDarwin; @@ -178,15 +176,14 @@ stdenv.mkDerivation (finalAttrs: { # See https://savannah.gnu.org/bugs/?50339 F77_INTEGER_8_FLAG = lib.optionalString use64BitIdx "-fdefault-integer-8"; - configureFlags = - [ - "--with-blas=blas" - "--with-lapack=lapack" - (if use64BitIdx then "--enable-64" else "--disable-64") - ] - ++ lib.optionals enableReadline [ "--enable-readline" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--with-x=no" ] - ++ lib.optionals enableQt [ "--with-qt=5" ]; + configureFlags = [ + "--with-blas=blas" + "--with-lapack=lapack" + (if use64BitIdx then "--enable-64" else "--disable-64") + ] + ++ lib.optionals enableReadline [ "--enable-readline" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--with-x=no" ] + ++ lib.optionals enableQt [ "--with-qt=5" ]; # Keep a copy of the octave tests detailed results in the output # derivation, because someone may care diff --git a/pkgs/development/interpreters/perl/interpreter.nix b/pkgs/development/interpreters/perl/interpreter.nix index 57306ce6d551..58f66bc811dd 100644 --- a/pkgs/development/interpreters/perl/interpreter.nix +++ b/pkgs/development/interpreters/perl/interpreter.nix @@ -54,7 +54,8 @@ stdenv.mkDerivation ( "out" "man" "devdoc" - ] ++ lib.optional crossCompiling "mini"; + ] + ++ lib.optional crossCompiling "mini"; setOutputFlags = false; # On FreeBSD, if Perl is built with threads support, having @@ -70,25 +71,24 @@ stdenv.mkDerivation ( disallowedReferences = [ stdenv.cc ]; - patches = - [ - ./CVE-2024-56406.patch - ./CVE-2025-40909.patch - ] - # Do not look in /usr etc. for dependencies. - ++ lib.optional ((lib.versions.majorMinor version) == "5.38") ./no-sys-dirs-5.38.0.patch - ++ lib.optional ((lib.versions.majorMinor version) == "5.40") ./no-sys-dirs-5.40.0.patch + patches = [ + ./CVE-2024-56406.patch + ./CVE-2025-40909.patch + ] + # Do not look in /usr etc. for dependencies. + ++ lib.optional ((lib.versions.majorMinor version) == "5.38") ./no-sys-dirs-5.38.0.patch + ++ lib.optional ((lib.versions.majorMinor version) == "5.40") ./no-sys-dirs-5.40.0.patch - # Fix compilation on platforms with only a C locale: https://github.com/Perl/perl5/pull/22569 - ++ lib.optional (version == "5.40.0") ./fix-build-with-only-C-locale-5.40.0.patch + # Fix compilation on platforms with only a C locale: https://github.com/Perl/perl5/pull/22569 + ++ lib.optional (version == "5.40.0") ./fix-build-with-only-C-locale-5.40.0.patch - ++ lib.optional stdenv.hostPlatform.isSunOS ./ld-shared.patch - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./cpp-precomp.patch - ./sw_vers.patch - ] - ++ lib.optional (crossCompiling && (lib.versionAtLeast version "5.40.0")) ./cross540.patch - ++ lib.optional (crossCompiling && (lib.versionOlder version "5.40.0")) ./cross.patch; + ++ lib.optional stdenv.hostPlatform.isSunOS ./ld-shared.patch + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./cpp-precomp.patch + ./sw_vers.patch + ] + ++ lib.optional (crossCompiling && (lib.versionAtLeast version "5.40.0")) ./cross540.patch + ++ lib.optional (crossCompiling && (lib.versionOlder version "5.40.0")) ./cross.patch; # This is not done for native builds because pwd may need to come from # bootstrap tools when building bootstrap perl. @@ -107,11 +107,11 @@ stdenv.mkDerivation ( '' ) + - # Perl's build system uses the src variable, and its value may end up in - # the output in some cases (when cross-compiling) - '' - unset src - ''; + # Perl's build system uses the src variable, and its value may end up in + # the output in some cases (when cross-compiling) + '' + unset src + ''; # Build a thread-safe Perl with a dynamic libperl.so. We need the # "installstyle" option to ensure that modules are put under @@ -191,42 +191,41 @@ stdenv.mkDerivation ( # https://github.com/archlinux/svntogit-packages/blob/packages/perl/trunk/config.over # https://salsa.debian.org/perl-team/interpreter/perl/blob/debian-5.26/debian/config.over # A ticket has been opened upstream to possibly clean some of this up: https://rt.perl.org/Public/Bug/Display.html?id=133452 - preConfigure = - '' - cat > config.over < config.over < ./cpan/Compress-Raw-Zlib/config.in < ./cpan/Compress-Raw-Zlib/config.in </c libpth => ' '," \ - -i "$out"/lib/perl5/*/*/Config.pm - # TODO: removing those paths would be cleaner than overwriting with nonsense. - substituteInPlace "$out"/lib/perl5/*/*/Config_heavy.pl \ - --replace "${libcInc}" /no-such-path \ - --replace "${if stdenv.hasCC then stdenv.cc else "/no-such-path"}" /no-such-path \ - --replace "${ - if stdenv.hasCC && stdenv.cc.cc != null then stdenv.cc.cc else "/no-such-path" - }" /no-such-path \ - --replace "${ - if stdenv.hasCC && stdenv.cc.fallback_sdk or null != null then - stdenv.cc.fallback_sdk - else - "/no-such-path" - }" /no-such-path \ - --replace "$man" /no-such-path - '' - + lib.optionalString crossCompiling '' - mkdir -p $mini/lib/perl5/cross_perl/${version} - for dir in cnf/{stub,cpan}; do - cp -r $dir/* $mini/lib/perl5/cross_perl/${version} - done + # Remove dependencies on glibc and gcc + sed "/ *libpth =>/c libpth => ' '," \ + -i "$out"/lib/perl5/*/*/Config.pm + # TODO: removing those paths would be cleaner than overwriting with nonsense. + substituteInPlace "$out"/lib/perl5/*/*/Config_heavy.pl \ + --replace "${libcInc}" /no-such-path \ + --replace "${if stdenv.hasCC then stdenv.cc else "/no-such-path"}" /no-such-path \ + --replace "${ + if stdenv.hasCC && stdenv.cc.cc != null then stdenv.cc.cc else "/no-such-path" + }" /no-such-path \ + --replace "${ + if stdenv.hasCC && stdenv.cc.fallback_sdk or null != null then + stdenv.cc.fallback_sdk + else + "/no-such-path" + }" /no-such-path \ + --replace "$man" /no-such-path + '' + + lib.optionalString crossCompiling '' + mkdir -p $mini/lib/perl5/cross_perl/${version} + for dir in cnf/{stub,cpan}; do + cp -r $dir/* $mini/lib/perl5/cross_perl/${version} + done - mkdir -p $mini/bin - install -m755 miniperl $mini/bin/perl + mkdir -p $mini/bin + install -m755 miniperl $mini/bin/perl - export runtimeArch="$(ls $out/lib/perl5/site_perl/${version})" - # wrapProgram should use a runtime-native SHELL by default, but - # it actually uses a buildtime-native one. If we ever fix that, - # we'll need to fix this to use a buildtime-native one. - # - # Adding the arch-specific directory is morally incorrect, as - # miniperl can't load the native modules there. However, it can - # (and sometimes needs to) load and run some of the pure perl - # code there, so we add it anyway. When needed, stubs can be put - # into $mini/lib/perl5/cross_perl/${version}. - wrapProgram $mini/bin/perl --prefix PERL5LIB : \ - "$mini/lib/perl5/cross_perl/${version}:$out/lib/perl5/${version}:$out/lib/perl5/${version}/$runtimeArch" - ''; # */ + export runtimeArch="$(ls $out/lib/perl5/site_perl/${version})" + # wrapProgram should use a runtime-native SHELL by default, but + # it actually uses a buildtime-native one. If we ever fix that, + # we'll need to fix this to use a buildtime-native one. + # + # Adding the arch-specific directory is morally incorrect, as + # miniperl can't load the native modules there. However, it can + # (and sometimes needs to) load and run some of the pure perl + # code there, so we add it anyway. When needed, stubs can be put + # into $mini/lib/perl5/cross_perl/${version}. + wrapProgram $mini/bin/perl --prefix PERL5LIB : \ + "$mini/lib/perl5/cross_perl/${version}:$out/lib/perl5/${version}:$out/lib/perl5/${version}/$runtimeArch" + ''; # */ meta = { homepage = "https://www.perl.org/"; diff --git a/pkgs/development/interpreters/perl/wrapper.nix b/pkgs/development/interpreters/perl/wrapper.nix index 8321f85ef39b..06144c8cc5ea 100644 --- a/pkgs/development/interpreters/perl/wrapper.nix +++ b/pkgs/development/interpreters/perl/wrapper.nix @@ -31,29 +31,28 @@ let ]; # we create wrapper for the binaries in the different packages - postBuild = - '' - if [ -L "$out/bin" ]; then - unlink "$out/bin" - fi - mkdir -p "$out/bin" + postBuild = '' + if [ -L "$out/bin" ]; then + unlink "$out/bin" + fi + mkdir -p "$out/bin" - # take every binary from perl packages and put them into the env - for path in ${lib.concatStringsSep " " paths}; do - if [ -d "$path/bin" ]; then - cd "$path/bin" - for prg in *; do - if [ -f "$prg" ]; then - rm -f "$out/bin/$prg" - if [ -x "$prg" ]; then - makeWrapper "$path/bin/$prg" "$out/bin/$prg" --suffix PERL5LIB ':' "$out/${perl.libPrefix}" - fi + # take every binary from perl packages and put them into the env + for path in ${lib.concatStringsSep " " paths}; do + if [ -d "$path/bin" ]; then + cd "$path/bin" + for prg in *; do + if [ -f "$prg" ]; then + rm -f "$out/bin/$prg" + if [ -x "$prg" ]; then + makeWrapper "$path/bin/$prg" "$out/bin/$prg" --suffix PERL5LIB ':' "$out/${perl.libPrefix}" fi - done - fi - done - '' - + postBuild; + fi + done + fi + done + '' + + postBuild; meta = perl.meta // { outputsToInstall = [ "out" ]; diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix index 3362771b77b1..0a6230e3e2ab 100644 --- a/pkgs/development/interpreters/php/generic.nix +++ b/pkgs/development/interpreters/php/generic.nix @@ -236,7 +236,8 @@ let libtool pkg-config re2c - ] ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin xcbuild; buildInputs = # PCRE extension diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 1a9c554dc5a8..94ff0c97dfa8 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -104,113 +104,111 @@ let }; hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false); - patches = - [ - # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. - ./search-path.patch + patches = [ + # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. + ./search-path.patch - # Python recompiles a Python if the mtime stored *in* the - # pyc/pyo file differs from the mtime of the source file. This - # doesn't work in Nix because Nix changes the mtime of files in - # the Nix store to 1. So treat that as a special case. - ./nix-store-mtime.patch + # Python recompiles a Python if the mtime stored *in* the + # pyc/pyo file differs from the mtime of the source file. This + # doesn't work in Nix because Nix changes the mtime of files in + # the Nix store to 1. So treat that as a special case. + ./nix-store-mtime.patch - # patch python to put zero timestamp into pyc - # if DETERMINISTIC_BUILD env var is set - ./deterministic-build.patch + # patch python to put zero timestamp into pyc + # if DETERMINISTIC_BUILD env var is set + ./deterministic-build.patch - # Fix python bug #27177 (https://bugs.python.org/issue27177) - # The issue is that `match.group` only recognizes python integers - # instead of everything that has `__index__`. - # This bug was fixed upstream, but not backported to 2.7 - (fetchpatch { - name = "re_match_index.patch"; - url = "https://bugs.python.org/file43084/re_match_index.patch"; - sha256 = "0l9rw6r5r90iybdkp3hhl2pf0h0s1izc68h5d3ywrm92pq32wz57"; - }) + # Fix python bug #27177 (https://bugs.python.org/issue27177) + # The issue is that `match.group` only recognizes python integers + # instead of everything that has `__index__`. + # This bug was fixed upstream, but not backported to 2.7 + (fetchpatch { + name = "re_match_index.patch"; + url = "https://bugs.python.org/file43084/re_match_index.patch"; + sha256 = "0l9rw6r5r90iybdkp3hhl2pf0h0s1izc68h5d3ywrm92pq32wz57"; + }) - # Fix race-condition during pyc creation. Has a slight backwards - # incompatible effect: pyc symlinks will now be overridden - # (https://bugs.python.org/issue17222). Included in python >= 3.4, - # backported in debian since 2013. - # https://bugs.python.org/issue13146 - ./atomic_pyc.patch + # Fix race-condition during pyc creation. Has a slight backwards + # incompatible effect: pyc symlinks will now be overridden + # (https://bugs.python.org/issue17222). Included in python >= 3.4, + # backported in debian since 2013. + # https://bugs.python.org/issue13146 + ./atomic_pyc.patch - # Backport from CPython 3.8 of a good list of tests to run for PGO. - ./profile-task.patch + # Backport from CPython 3.8 of a good list of tests to run for PGO. + ./profile-task.patch - # The workaround is for unittests on Win64, which we don't support. - # It does break aarch64-darwin, which we do support. See: - # * https://bugs.python.org/issue35523 - # * https://github.com/python/cpython/commit/e6b247c8e524 - ../3.7/no-win64-workaround.patch + # The workaround is for unittests on Win64, which we don't support. + # It does break aarch64-darwin, which we do support. See: + # * https://bugs.python.org/issue35523 + # * https://github.com/python/cpython/commit/e6b247c8e524 + ../3.7/no-win64-workaround.patch - # fix openssl detection by reverting irrelevant change for us, to enable hashlib which is required by pip - (fetchpatch { - url = "https://github.com/ActiveState/cpython/pull/35/commits/20ea5b46aaf1e7bdf9d6905ba8bece2cc73b05b0.patch"; - revert = true; - hash = "sha256-Lp5fGlcfJJ6p6vKmcLckJiAA2AZz4prjFE0aMEJxotw="; - }) - ] - ++ lib.optionals (x11Support && stdenv.hostPlatform.isDarwin) [ - ./use-correct-tcl-tk-on-darwin.patch + # fix openssl detection by reverting irrelevant change for us, to enable hashlib which is required by pip + (fetchpatch { + url = "https://github.com/ActiveState/cpython/pull/35/commits/20ea5b46aaf1e7bdf9d6905ba8bece2cc73b05b0.patch"; + revert = true; + hash = "sha256-Lp5fGlcfJJ6p6vKmcLckJiAA2AZz4prjFE0aMEJxotw="; + }) + ] + ++ lib.optionals (x11Support && stdenv.hostPlatform.isDarwin) [ + ./use-correct-tcl-tk-on-darwin.patch - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Disable the use of ldconfig in ctypes.util.find_library (since - # ldconfig doesn't work on NixOS), and don't use - # ctypes.util.find_library during the loading of the uuid module - # (since it will do a futile invocation of gcc (!) to find - # libuuid, slowing down program startup a lot). - ./no-ldconfig.patch + # Disable the use of ldconfig in ctypes.util.find_library (since + # ldconfig doesn't work on NixOS), and don't use + # ctypes.util.find_library during the loading of the uuid module + # (since it will do a futile invocation of gcc (!) to find + # libuuid, slowing down program startup a lot). + ./no-ldconfig.patch - # Fix ctypes.util.find_library with gcc10. - ./find_library-gcc10.patch + # Fix ctypes.util.find_library with gcc10. + ./find_library-gcc10.patch - ] - ++ lib.optionals stdenv.hostPlatform.isCygwin [ - ./2.5.2-ctypes-util-find_library.patch - ./2.5.2-tkinter-x11.patch - ./2.6.2-ssl-threads.patch - ./2.6.5-export-PySignal_SetWakeupFd.patch - ./2.6.5-FD_SETSIZE.patch - ./2.6.5-ncurses-abi6.patch - ./2.7.3-dbm.patch - ./2.7.3-dylib.patch - ./2.7.3-getpath-exe-extension.patch - ./2.7.3-no-libm.patch - ] - ++ lib.optionals hasDistutilsCxxPatch [ + ] + ++ lib.optionals stdenv.hostPlatform.isCygwin [ + ./2.5.2-ctypes-util-find_library.patch + ./2.5.2-tkinter-x11.patch + ./2.6.2-ssl-threads.patch + ./2.6.5-export-PySignal_SetWakeupFd.patch + ./2.6.5-FD_SETSIZE.patch + ./2.6.5-ncurses-abi6.patch + ./2.7.3-dbm.patch + ./2.7.3-dylib.patch + ./2.7.3-getpath-exe-extension.patch + ./2.7.3-no-libm.patch + ] + ++ lib.optionals hasDistutilsCxxPatch [ - # Patch from http://bugs.python.org/issue1222585 adapted to work with - # `patch -p1' and with a last hunk removed - # Upstream distutils is calling C compiler to compile C++ code, which - # only works for GCC and Apple Clang. This makes distutils to call C++ - # compiler when needed. - ./python-2.7-distutils-C++.patch - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - ./cross-compile.patch - ]; + # Patch from http://bugs.python.org/issue1222585 adapted to work with + # `patch -p1' and with a last hunk removed + # Upstream distutils is calling C compiler to compile C++ code, which + # only works for GCC and Apple Clang. This makes distutils to call C++ + # compiler when needed. + ./python-2.7-distutils-C++.patch + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ./cross-compile.patch + ]; - preConfigure = - '' - # Purity. - for i in /usr /sw /opt /pkg; do - substituteInPlace ./setup.py --replace $i /no-such-path - done - '' - + lib.optionalString (stdenv ? cc && stdenv.cc.libc != null) '' - for i in Lib/plat-*/regen; do - substituteInPlace $i --replace /usr/include/ ${stdenv.cc.libc}/include/ - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure --replace '`/usr/bin/arch`' '"i386"' - substituteInPlace Lib/multiprocessing/__init__.py \ - --replace 'os.popen(comm)' 'os.popen("${coreutils}/bin/nproc")' - ''; + preConfigure = '' + # Purity. + for i in /usr /sw /opt /pkg; do + substituteInPlace ./setup.py --replace $i /no-such-path + done + '' + + lib.optionalString (stdenv ? cc && stdenv.cc.libc != null) '' + for i in Lib/plat-*/regen; do + substituteInPlace $i --replace /usr/include/ ${stdenv.cc.libc}/include/ + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure --replace '`/usr/bin/arch`' '"i386"' + substituteInPlace Lib/multiprocessing/__init__.py \ + --replace 'os.popen(comm)' 'os.popen("${coreutils}/bin/nproc")' + ''; configureFlags = lib.optionals enableOptimizations [ @@ -279,12 +277,13 @@ let tk libX11 ]; - nativeBuildInputs = - [ autoreconfHook ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - buildPackages.stdenv.cc - buildPackages.python27 - ]; + nativeBuildInputs = [ + autoreconfHook + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + buildPackages.stdenv.cc + buildPackages.python27 + ]; mkPaths = paths: { C_INCLUDE_PATH = lib.makeSearchPathOutput "dev" "include" paths; @@ -329,68 +328,66 @@ stdenv.mkDerivation ( substituteInPlace "Lib/lib-tk/Tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tclPackages.tix}/lib'" ''; - postInstall = - '' - # needed for some packages, especially packages that backport - # functionality to 2.x from 3.x - for item in $out/lib/${libPrefix}/test/*; do - if [[ "$item" != */test_support.py* - && "$item" != */test/support - && "$item" != */test/regrtest.py* ]]; then - rm -rf "$item" - else - echo $item - fi - done - touch $out/lib/${libPrefix}/test/__init__.py - ln -s $out/lib/${libPrefix}/pdb.py $out/bin/pdb - ln -s $out/lib/${libPrefix}/pdb.py $out/bin/pdb${sourceVersion.major}.${sourceVersion.minor} - ln -s $out/share/man/man1/{python2.7.1.gz,python.1.gz} + postInstall = '' + # needed for some packages, especially packages that backport + # functionality to 2.x from 3.x + for item in $out/lib/${libPrefix}/test/*; do + if [[ "$item" != */test_support.py* + && "$item" != */test/support + && "$item" != */test/regrtest.py* ]]; then + rm -rf "$item" + else + echo $item + fi + done + touch $out/lib/${libPrefix}/test/__init__.py + ln -s $out/lib/${libPrefix}/pdb.py $out/bin/pdb + ln -s $out/lib/${libPrefix}/pdb.py $out/bin/pdb${sourceVersion.major}.${sourceVersion.minor} + ln -s $out/share/man/man1/{python2.7.1.gz,python.1.gz} - rm "$out"/lib/python*/plat-*/regen # refers to glibc.dev + rm "$out"/lib/python*/plat-*/regen # refers to glibc.dev - # Determinism: Windows installers were not deterministic. - # We're also not interested in building Windows installers. - find "$out" -name 'wininst*.exe' | xargs -r rm -f - '' - + lib.optionalString stripBytecode '' - # Determinism: deterministic bytecode - # First we delete all old bytecode. - find $out -name "*.pyc" -delete - '' - + lib.optionalString rebuildBytecode '' - # We build 3 levels of optimized bytecode. Note the default level, without optimizations, - # is not reproducible yet. https://bugs.python.org/issue29708 - # Not creating bytecode will result in a large performance loss however, so we do build it. - find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -m compileall -q -f -x "lib2to3" -i - - find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -O -m compileall -q -f -x "lib2to3" -i - - find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -OO -m compileall -q -f -x "lib2to3" -i - - '' - + lib.optionalString stdenv.hostPlatform.isCygwin '' - cp libpython2.7.dll.a $out/lib - ''; + # Determinism: Windows installers were not deterministic. + # We're also not interested in building Windows installers. + find "$out" -name 'wininst*.exe' | xargs -r rm -f + '' + + lib.optionalString stripBytecode '' + # Determinism: deterministic bytecode + # First we delete all old bytecode. + find $out -name "*.pyc" -delete + '' + + lib.optionalString rebuildBytecode '' + # We build 3 levels of optimized bytecode. Note the default level, without optimizations, + # is not reproducible yet. https://bugs.python.org/issue29708 + # Not creating bytecode will result in a large performance loss however, so we do build it. + find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -O -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -OO -m compileall -q -f -x "lib2to3" -i - + '' + + lib.optionalString stdenv.hostPlatform.isCygwin '' + cp libpython2.7.dll.a $out/lib + ''; inherit passthru; - postFixup = - '' - # Include a sitecustomize.py file. Note it causes an error when it's in postInstall with 2.7. - cp ${../../sitecustomize.py} $out/${sitePackages}/sitecustomize.py - '' - + lib.optionalString strip2to3 '' - rm -R $out/bin/2to3 $out/lib/python*/lib2to3 - '' - + lib.optionalString stripConfig '' - rm -R $out/bin/python*-config $out/lib/python*/config* - '' - + lib.optionalString stripIdlelib '' - # Strip IDLE - rm -R $out/bin/idle* $out/lib/python*/idlelib - '' - + lib.optionalString stripTests '' - # Strip tests - rm -R $out/lib/python*/test $out/lib/python*/**/test{,s} - ''; + postFixup = '' + # Include a sitecustomize.py file. Note it causes an error when it's in postInstall with 2.7. + cp ${../../sitecustomize.py} $out/${sitePackages}/sitecustomize.py + '' + + lib.optionalString strip2to3 '' + rm -R $out/bin/2to3 $out/lib/python*/lib2to3 + '' + + lib.optionalString stripConfig '' + rm -R $out/bin/python*-config $out/lib/python*/config* + '' + + lib.optionalString stripIdlelib '' + # Strip IDLE + rm -R $out/bin/idle* $out/lib/python*/idlelib + '' + + lib.optionalString stripTests '' + # Strip tests + rm -R $out/lib/python*/test $out/lib/python*/**/test{,s} + ''; enableParallelBuilding = true; diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index a33bcec040e9..661f7b642ae2 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -163,7 +163,8 @@ let pythonOnTargetForTarget = lib.optionalAttrs (lib.hasAttr pythonAttr pkgsTargetTarget) ( override pkgsTargetTarget.${pythonAttr} ); - } // __splices; + } + // __splices; override = attr: let @@ -196,31 +197,30 @@ let version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; - nativeBuildInputs = - [ - nukeReferences - ] - ++ optionals (!stdenv.hostPlatform.isDarwin) [ - autoconf-archive # needed for AX_CHECK_COMPILE_FLAG - autoreconfHook - ] - ++ optionals (!stdenv.hostPlatform.isDarwin || passthru.pythonAtLeast "3.14") [ - pkg-config - ] - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - buildPackages.stdenv.cc - pythonOnBuildForHost - ] - ++ - optionals - ( - stdenv.cc.isClang - && (!stdenv.hostPlatform.useAndroidPrebuilt or false) - && (enableLTO || enableOptimizations) - ) - [ - stdenv.cc.cc.libllvm.out - ]; + nativeBuildInputs = [ + nukeReferences + ] + ++ optionals (!stdenv.hostPlatform.isDarwin) [ + autoconf-archive # needed for AX_CHECK_COMPILE_FLAG + autoreconfHook + ] + ++ optionals (!stdenv.hostPlatform.isDarwin || passthru.pythonAtLeast "3.14") [ + pkg-config + ] + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + buildPackages.stdenv.cc + pythonOnBuildForHost + ] + ++ + optionals + ( + stdenv.cc.isClang + && (!stdenv.hostPlatform.useAndroidPrebuilt or false) + && (enableLTO || enableOptimizations) + ) + [ + stdenv.cc.cc.libllvm.out + ]; buildInputs = lib.filter (p: p != null) ( [ @@ -325,98 +325,97 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace configure --replace-fail '`/usr/bin/arch`' '"i386"' ''; - patches = - [ - # Disable the use of ldconfig in ctypes.util.find_library (since - # ldconfig doesn't work on NixOS), and don't use - # ctypes.util.find_library during the loading of the uuid module - # (since it will do a futile invocation of gcc (!) to find - # libuuid, slowing down program startup a lot). - noldconfigPatch - ] - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isFreeBSD) [ - # Cross compilation only supports a limited number of "known good" - # configurations. If you're reading this and it's been a long time - # since this diff, consider submitting this patch upstream! - ./freebsd-cross.patch - ] - ++ optionals (pythonOlder "3.13") [ - # Make sure that the virtualenv activation scripts are - # owner-writable, so venvs can be recreated without permission - # errors. - ./virtualenv-permissions.patch - ] - ++ optionals (pythonAtLeast "3.13") [ - ./3.13/virtualenv-permissions.patch - ] - ++ optionals mimetypesSupport [ - # Make the mimetypes module refer to the right file - ./mimetypes.patch - ] - ++ optionals (pythonAtLeast "3.9" && pythonOlder "3.11" && stdenv.hostPlatform.isDarwin) [ - # Stop checking for TCL/TK in global macOS locations - ./3.9/darwin-tcl-tk.patch - ] - ++ optionals (hasDistutilsCxxPatch && pythonOlder "3.12") [ - # Fix for http://bugs.python.org/issue1222585 - # Upstream distutils is calling C compiler to compile C++ code, which - # only works for GCC and Apple Clang. This makes distutils to call C++ - # compiler when needed. - ( - if pythonAtLeast "3.7" && pythonOlder "3.11" then - ./3.7/python-3.x-distutils-C++.patch - else if pythonAtLeast "3.11" then - ./3.11/python-3.x-distutils-C++.patch - else - fetchpatch { - url = "https://bugs.python.org/file48016/python-3.x-distutils-C++.patch"; - sha256 = "1h18lnpx539h5lfxyk379dxwr8m2raigcjixkf133l4xy3f4bzi2"; - } - ) - ] - ++ optionals (pythonAtLeast "3.7" && pythonOlder "3.12") [ - # LDSHARED now uses $CC instead of gcc. Fixes cross-compilation of extension modules. - ./3.8/0001-On-all-posix-systems-not-just-Darwin-set-LDSHARED-if.patch - # Use sysconfigdata to find headers. Fixes cross-compilation of extension modules. - ./3.7/fix-finding-headers-when-cross-compiling.patch - ] - ++ optionals (pythonOlder "3.12") [ - # https://github.com/python/cpython/issues/90656 - ./loongarch-support.patch - # fix failing tests with openssl >= 3.4 - # https://github.com/python/cpython/pull/127361 - ] - ++ optionals (pythonAtLeast "3.11" && pythonOlder "3.13") [ - # backport fix for https://github.com/python/cpython/issues/95855 - ./platform-triplet-detection.patch - ] - ++ optionals (stdenv.hostPlatform.isMinGW) ( - let - # https://src.fedoraproject.org/rpms/mingw-python3 - mingw-patch = fetchgit { - name = "mingw-python-patches"; - url = "https://src.fedoraproject.org/rpms/mingw-python3.git"; - rev = "3edecdbfb4bbf1276d09cd5e80e9fb3dd88c9511"; # for python 3.11.9 at the time of writing. - hash = "sha256-kpXoIHlz53+0FAm/fK99ZBdNUg0u13erOr1XP2FSkQY="; - }; - in - (builtins.map (f: "${mingw-patch}/${f}") [ - # The other patches in that repo are already applied to 3.11.10 - "mingw-python3_distutils.patch" - "mingw-python3_frozenmain.patch" - "mingw-python3_make-sysconfigdata.py-relocatable.patch" - "mingw-python3_mods-failed.patch" - "mingw-python3_module-select.patch" - "mingw-python3_module-socket.patch" - "mingw-python3_modules.patch" - "mingw-python3_platform-mingw.patch" - "mingw-python3_posix-layout.patch" - "mingw-python3_pthread_threadid.patch" - "mingw-python3_pythonw.patch" - "mingw-python3_setenv.patch" - "mingw-python3_win-modules.patch" - ]) - ); + patches = [ + # Disable the use of ldconfig in ctypes.util.find_library (since + # ldconfig doesn't work on NixOS), and don't use + # ctypes.util.find_library during the loading of the uuid module + # (since it will do a futile invocation of gcc (!) to find + # libuuid, slowing down program startup a lot). + noldconfigPatch + ] + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isFreeBSD) [ + # Cross compilation only supports a limited number of "known good" + # configurations. If you're reading this and it's been a long time + # since this diff, consider submitting this patch upstream! + ./freebsd-cross.patch + ] + ++ optionals (pythonOlder "3.13") [ + # Make sure that the virtualenv activation scripts are + # owner-writable, so venvs can be recreated without permission + # errors. + ./virtualenv-permissions.patch + ] + ++ optionals (pythonAtLeast "3.13") [ + ./3.13/virtualenv-permissions.patch + ] + ++ optionals mimetypesSupport [ + # Make the mimetypes module refer to the right file + ./mimetypes.patch + ] + ++ optionals (pythonAtLeast "3.9" && pythonOlder "3.11" && stdenv.hostPlatform.isDarwin) [ + # Stop checking for TCL/TK in global macOS locations + ./3.9/darwin-tcl-tk.patch + ] + ++ optionals (hasDistutilsCxxPatch && pythonOlder "3.12") [ + # Fix for http://bugs.python.org/issue1222585 + # Upstream distutils is calling C compiler to compile C++ code, which + # only works for GCC and Apple Clang. This makes distutils to call C++ + # compiler when needed. + ( + if pythonAtLeast "3.7" && pythonOlder "3.11" then + ./3.7/python-3.x-distutils-C++.patch + else if pythonAtLeast "3.11" then + ./3.11/python-3.x-distutils-C++.patch + else + fetchpatch { + url = "https://bugs.python.org/file48016/python-3.x-distutils-C++.patch"; + sha256 = "1h18lnpx539h5lfxyk379dxwr8m2raigcjixkf133l4xy3f4bzi2"; + } + ) + ] + ++ optionals (pythonAtLeast "3.7" && pythonOlder "3.12") [ + # LDSHARED now uses $CC instead of gcc. Fixes cross-compilation of extension modules. + ./3.8/0001-On-all-posix-systems-not-just-Darwin-set-LDSHARED-if.patch + # Use sysconfigdata to find headers. Fixes cross-compilation of extension modules. + ./3.7/fix-finding-headers-when-cross-compiling.patch + ] + ++ optionals (pythonOlder "3.12") [ + # https://github.com/python/cpython/issues/90656 + ./loongarch-support.patch + # fix failing tests with openssl >= 3.4 + # https://github.com/python/cpython/pull/127361 + ] + ++ optionals (pythonAtLeast "3.11" && pythonOlder "3.13") [ + # backport fix for https://github.com/python/cpython/issues/95855 + ./platform-triplet-detection.patch + ] + ++ optionals (stdenv.hostPlatform.isMinGW) ( + let + # https://src.fedoraproject.org/rpms/mingw-python3 + mingw-patch = fetchgit { + name = "mingw-python-patches"; + url = "https://src.fedoraproject.org/rpms/mingw-python3.git"; + rev = "3edecdbfb4bbf1276d09cd5e80e9fb3dd88c9511"; # for python 3.11.9 at the time of writing. + hash = "sha256-kpXoIHlz53+0FAm/fK99ZBdNUg0u13erOr1XP2FSkQY="; + }; + in + (builtins.map (f: "${mingw-patch}/${f}") [ + # The other patches in that repo are already applied to 3.11.10 + "mingw-python3_distutils.patch" + "mingw-python3_frozenmain.patch" + "mingw-python3_make-sysconfigdata.py-relocatable.patch" + "mingw-python3_mods-failed.patch" + "mingw-python3_module-select.patch" + "mingw-python3_module-socket.patch" + "mingw-python3_modules.patch" + "mingw-python3_platform-mingw.patch" + "mingw-python3_posix-layout.patch" + "mingw-python3_pthread_threadid.patch" + "mingw-python3_pythonw.patch" + "mingw-python3_setenv.patch" + "mingw-python3_win-modules.patch" + ]) + ); postPatch = optionalString (!stdenv.hostPlatform.isWindows) '' @@ -449,142 +448,140 @@ stdenv.mkDerivation (finalAttrs: { }; # https://docs.python.org/3/using/configure.html - configureFlags = - [ - "--without-ensurepip" - ] - ++ optionals withExpat [ - "--with-system-expat" - ] - ++ optionals withMpdecimal [ - "--with-system-libmpdec" - ] - ++ optionals (openssl != null) [ - "--with-openssl=${openssl.dev}" - ] - ++ optionals tzdataSupport [ - "--with-tzpath=${tzdata}/share/zoneinfo" - ] - ++ optionals (execSuffix != "") [ - "--with-suffix=${execSuffix}" - ] - ++ optionals enableLTO [ - "--with-lto" - ] - ++ optionals (!static && !enableFramework) [ - "--enable-shared" - ] - ++ optionals enableFramework [ - "--enable-framework=${placeholder "out"}/Library/Frameworks" - ] - ++ optionals (pythonAtLeast "3.13") [ - (enableFeature enableGIL "gil") - ] - ++ optionals enableOptimizations [ - "--enable-optimizations" - ] - ++ optionals enableDebug [ - "--with-pydebug" - ] - ++ optionals (sqlite != null) [ - "--enable-loadable-sqlite-extensions" - ] - ++ optionals (libxcrypt != null) [ - "CFLAGS=-I${libxcrypt}/include" - "LIBS=-L${libxcrypt}/lib" - ] - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "ac_cv_buggy_getaddrinfo=no" - # Assume little-endian IEEE 754 floating point when cross compiling - "ac_cv_little_endian_double=yes" - "ac_cv_big_endian_double=no" - "ac_cv_mixed_endian_double=no" - "ac_cv_x87_double_rounding=yes" - "ac_cv_tanh_preserves_zero_sign=yes" - # Generally assume that things are present and work - "ac_cv_posix_semaphores_enabled=yes" - "ac_cv_broken_sem_getvalue=no" - "ac_cv_wchar_t_signed=yes" - "ac_cv_rshift_extends_sign=yes" - "ac_cv_broken_nice=no" - "ac_cv_broken_poll=no" - "ac_cv_working_tzset=yes" - "ac_cv_have_long_long_format=yes" - "ac_cv_have_size_t_format=yes" - "ac_cv_computed_gotos=yes" - # Both fail when building for windows, normally configure checks this by itself but on other platforms this is set to yes always. - "ac_cv_file__dev_ptmx=${if stdenv.hostPlatform.isWindows then "no" else "yes"}" - "ac_cv_file__dev_ptc=${if stdenv.hostPlatform.isWindows then "no" else "yes"}" - ] - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && pythonAtLeast "3.11") [ - "--with-build-python=${pythonOnBuildForHostInterpreter}" - ] - ++ optionals stdenv.hostPlatform.isLinux [ - # Never even try to use lchmod on linux, - # don't rely on detecting glibc-isms. - "ac_cv_func_lchmod=no" - ] - ++ optionals static [ - "--disable-test-modules" - "LDFLAGS=-static" - "MODULE_BUILDTYPE=static" - ] - ++ optionals (stdenv.hostPlatform.isStatic && stdenv.hostPlatform.isMusl) [ - # dlopen is a no-op in static musl builds, and since we build everything without -fPIC it's better not to pretend. - "ac_cv_func_dlopen=no" - ]; + configureFlags = [ + "--without-ensurepip" + ] + ++ optionals withExpat [ + "--with-system-expat" + ] + ++ optionals withMpdecimal [ + "--with-system-libmpdec" + ] + ++ optionals (openssl != null) [ + "--with-openssl=${openssl.dev}" + ] + ++ optionals tzdataSupport [ + "--with-tzpath=${tzdata}/share/zoneinfo" + ] + ++ optionals (execSuffix != "") [ + "--with-suffix=${execSuffix}" + ] + ++ optionals enableLTO [ + "--with-lto" + ] + ++ optionals (!static && !enableFramework) [ + "--enable-shared" + ] + ++ optionals enableFramework [ + "--enable-framework=${placeholder "out"}/Library/Frameworks" + ] + ++ optionals (pythonAtLeast "3.13") [ + (enableFeature enableGIL "gil") + ] + ++ optionals enableOptimizations [ + "--enable-optimizations" + ] + ++ optionals enableDebug [ + "--with-pydebug" + ] + ++ optionals (sqlite != null) [ + "--enable-loadable-sqlite-extensions" + ] + ++ optionals (libxcrypt != null) [ + "CFLAGS=-I${libxcrypt}/include" + "LIBS=-L${libxcrypt}/lib" + ] + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "ac_cv_buggy_getaddrinfo=no" + # Assume little-endian IEEE 754 floating point when cross compiling + "ac_cv_little_endian_double=yes" + "ac_cv_big_endian_double=no" + "ac_cv_mixed_endian_double=no" + "ac_cv_x87_double_rounding=yes" + "ac_cv_tanh_preserves_zero_sign=yes" + # Generally assume that things are present and work + "ac_cv_posix_semaphores_enabled=yes" + "ac_cv_broken_sem_getvalue=no" + "ac_cv_wchar_t_signed=yes" + "ac_cv_rshift_extends_sign=yes" + "ac_cv_broken_nice=no" + "ac_cv_broken_poll=no" + "ac_cv_working_tzset=yes" + "ac_cv_have_long_long_format=yes" + "ac_cv_have_size_t_format=yes" + "ac_cv_computed_gotos=yes" + # Both fail when building for windows, normally configure checks this by itself but on other platforms this is set to yes always. + "ac_cv_file__dev_ptmx=${if stdenv.hostPlatform.isWindows then "no" else "yes"}" + "ac_cv_file__dev_ptc=${if stdenv.hostPlatform.isWindows then "no" else "yes"}" + ] + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && pythonAtLeast "3.11") [ + "--with-build-python=${pythonOnBuildForHostInterpreter}" + ] + ++ optionals stdenv.hostPlatform.isLinux [ + # Never even try to use lchmod on linux, + # don't rely on detecting glibc-isms. + "ac_cv_func_lchmod=no" + ] + ++ optionals static [ + "--disable-test-modules" + "LDFLAGS=-static" + "MODULE_BUILDTYPE=static" + ] + ++ optionals (stdenv.hostPlatform.isStatic && stdenv.hostPlatform.isMusl) [ + # dlopen is a no-op in static musl builds, and since we build everything without -fPIC it's better not to pretend. + "ac_cv_func_dlopen=no" + ]; - preConfigure = - '' - # Attempt to purify some of the host info collection - sed -E -i -e 's/uname -r/echo/g' -e 's/uname -n/echo nixpkgs/g' config.guess - sed -E -i -e 's/uname -r/echo/g' -e 's/uname -n/echo nixpkgs/g' configure - '' - + optionalString (pythonOlder "3.12") '' - # Improve purity - for path in /usr /sw /opt /pkg; do - substituteInPlace ./setup.py --replace-warn $path /no-such-path - done - '' - + optionalString (stdenv.hostPlatform.isDarwin && pythonOlder "3.12") '' - # Fix _ctypes module compilation - export NIX_CFLAGS_COMPILE+=" -DUSING_APPLE_OS_LIBFFI=1" - '' - + optionalString stdenv.hostPlatform.isDarwin '' - # Override the auto-detection in setup.py, which assumes a universal build - export PYTHON_DECIMAL_WITH_MACHINE=${if stdenv.hostPlatform.isAarch64 then "uint128" else "x64"} - # Ensure that modern platform features are enabled on Darwin in spite of having no version suffix. - sed -E -i -e 's|Darwin/\[12\]\[0-9\]\.\*|Darwin/*|' configure - '' - + optionalString (pythonAtLeast "3.11") '' - # Also override the auto-detection in `configure`. - substituteInPlace configure \ - --replace-fail 'libmpdec_machine=universal' 'libmpdec_machine=${ - if stdenv.hostPlatform.isAarch64 then "uint128" else "x64" - }' - '' - + optionalString (stdenv.hostPlatform.isDarwin && x11Support && pythonAtLeast "3.11") '' - export TCLTK_LIBS="-L${tcl}/lib -L${tk}/lib -l${tcl.libPrefix} -l${tk.libPrefix}" - export TCLTK_CFLAGS="-I${tcl}/include -I${tk}/include" - '' - + optionalString stdenv.hostPlatform.isWindows '' - export NIX_CFLAGS_COMPILE+=" -Wno-error=incompatible-pointer-types" - '' - + optionalString stdenv.hostPlatform.isMusl '' - export NIX_CFLAGS_COMPILE+=" -DTHREAD_STACK_SIZE=0x100000" - '' - + + preConfigure = '' + # Attempt to purify some of the host info collection + sed -E -i -e 's/uname -r/echo/g' -e 's/uname -n/echo nixpkgs/g' config.guess + sed -E -i -e 's/uname -r/echo/g' -e 's/uname -n/echo nixpkgs/g' configure + '' + + optionalString (pythonOlder "3.12") '' + # Improve purity + for path in /usr /sw /opt /pkg; do + substituteInPlace ./setup.py --replace-warn $path /no-such-path + done + '' + + optionalString (stdenv.hostPlatform.isDarwin && pythonOlder "3.12") '' + # Fix _ctypes module compilation + export NIX_CFLAGS_COMPILE+=" -DUSING_APPLE_OS_LIBFFI=1" + '' + + optionalString stdenv.hostPlatform.isDarwin '' + # Override the auto-detection in setup.py, which assumes a universal build + export PYTHON_DECIMAL_WITH_MACHINE=${if stdenv.hostPlatform.isAarch64 then "uint128" else "x64"} + # Ensure that modern platform features are enabled on Darwin in spite of having no version suffix. + sed -E -i -e 's|Darwin/\[12\]\[0-9\]\.\*|Darwin/*|' configure + '' + + optionalString (pythonAtLeast "3.11") '' + # Also override the auto-detection in `configure`. + substituteInPlace configure \ + --replace-fail 'libmpdec_machine=universal' 'libmpdec_machine=${ + if stdenv.hostPlatform.isAarch64 then "uint128" else "x64" + }' + '' + + optionalString (stdenv.hostPlatform.isDarwin && x11Support && pythonAtLeast "3.11") '' + export TCLTK_LIBS="-L${tcl}/lib -L${tk}/lib -l${tcl.libPrefix} -l${tk.libPrefix}" + export TCLTK_CFLAGS="-I${tcl}/include -I${tk}/include" + '' + + optionalString stdenv.hostPlatform.isWindows '' + export NIX_CFLAGS_COMPILE+=" -Wno-error=incompatible-pointer-types" + '' + + optionalString stdenv.hostPlatform.isMusl '' + export NIX_CFLAGS_COMPILE+=" -DTHREAD_STACK_SIZE=0x100000" + '' + + - # enableNoSemanticInterposition essentially sets that CFLAG -fno-semantic-interposition - # which changes how symbols are looked up. This essentially means we can't override - # libpython symbols via LD_PRELOAD anymore. This is common enough as every build - # that uses --enable-optimizations has the same "issue". - # - # The Fedora wiki has a good article about their journey towards enabling this flag: - # https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup - optionalString enableNoSemanticInterposition '' - export CFLAGS_NODIST="-fno-semantic-interposition" - ''; + # enableNoSemanticInterposition essentially sets that CFLAG -fno-semantic-interposition + # which changes how symbols are looked up. This essentially means we can't override + # libpython symbols via LD_PRELOAD anymore. This is common enough as every build + # that uses --enable-optimizations has the same "issue". + # + # The Fedora wiki has a good article about their journey towards enabling this flag: + # https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup + optionalString enableNoSemanticInterposition '' + export CFLAGS_NODIST="-fno-semantic-interposition" + ''; setupHook = python-setup-hook sitePackages; diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index 0a211850b2f4..b3c97de30317 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -168,7 +168,8 @@ in pname = "test-pytestCheckHook-disabledTests-${previousPythonAttrs.pname}"; disabledTests = [ "test_print" - ] ++ previousPythonAttrs.disabledTests or [ ]; + ] + ++ previousPythonAttrs.disabledTests or [ ]; }); disabledTests-expression = objprint.overridePythonAttrs (previousPythonAttrs: { __structuredAttrs = true; @@ -176,47 +177,54 @@ in disabledTests = [ "TestBasic and test_print" "test_str" - ] ++ previousPythonAttrs.disabledTests or [ ]; + ] + ++ previousPythonAttrs.disabledTests or [ ]; }); disabledTestPaths = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-disabledTestPaths-${previousPythonAttrs.pname}"; disabledTestPaths = [ "tests/test_basic.py" - ] ++ previousPythonAttrs.disabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.disabledTestPaths or [ ]; }); disabledTestPaths-nonexistent = testers.testBuildFailure ( objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-disabledTestPaths-nonexistent-${previousPythonAttrs.pname}"; disabledTestPaths = [ "tests/test_foo.py" - ] ++ previousPythonAttrs.disabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.disabledTestPaths or [ ]; }) ); disabledTestPaths-item = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-disabledTestPaths-item-${previousPythonAttrs.pname}"; disabledTestPaths = [ "tests/test_basic.py::TestBasic" - ] ++ previousPythonAttrs.disabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.disabledTestPaths or [ ]; }); disabledTestPaths-glob = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-disabledTestPaths-glob-${previousPythonAttrs.pname}"; disabledTestPaths = [ "tests/test_obj*.py" - ] ++ previousPythonAttrs.disabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.disabledTestPaths or [ ]; }); disabledTestPaths-glob-nonexistent = testers.testBuildFailure ( objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-disabledTestPaths-glob-nonexistent-${previousPythonAttrs.pname}"; disabledTestPaths = [ "tests/test_foo*.py" - ] ++ previousPythonAttrs.disabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.disabledTestPaths or [ ]; }) ); enabledTests = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTests-${previousPythonAttrs.pname}"; enabledTests = [ "TestBasic" - ] ++ previousPythonAttrs.disabledTests or [ ]; + ] + ++ previousPythonAttrs.disabledTests or [ ]; }); enabledTests-expression = objprint.overridePythonAttrs (previousPythonAttrs: { __structuredAttrs = true; @@ -224,65 +232,76 @@ in enabledTests = [ "TestBasic and test_print" "test_str" - ] ++ previousPythonAttrs.disabledTests or [ ]; + ] + ++ previousPythonAttrs.disabledTests or [ ]; }); enabledTests-disabledTests = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTests-disabledTests-${previousPythonAttrs.pname}"; enabledTests = [ "TestBasic" - ] ++ previousPythonAttrs.disabledTests or [ ]; + ] + ++ previousPythonAttrs.disabledTests or [ ]; disabledTests = [ "test_print" - ] ++ previousPythonAttrs.disabledTests or [ ]; + ] + ++ previousPythonAttrs.disabledTests or [ ]; }); enabledTestPaths = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTestPaths-${previousPythonAttrs.pname}"; enabledTestPaths = [ "tests/test_basic.py" - ] ++ previousPythonAttrs.enabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.enabledTestPaths or [ ]; }); enabledTestPaths-nonexistent = testers.testBuildFailure ( objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTestPaths-nonexistent-${previousPythonAttrs.pname}"; enabledTestPaths = [ "tests/test_foo.py" - ] ++ previousPythonAttrs.enabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.enabledTestPaths or [ ]; }) ); enabledTestPaths-dir = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTestPaths-dir-${previousPythonAttrs.pname}"; enabledTestPaths = [ "tests" - ] ++ previousPythonAttrs.enabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.enabledTestPaths or [ ]; }); enabledTestPaths-dir-disabledTestPaths = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTestPaths-dir-disabledTestPaths-${previousPythonAttrs.pname}"; enabledTestPaths = [ "tests" - ] ++ previousPythonAttrs.enabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.enabledTestPaths or [ ]; disabledTestPaths = [ "tests/test_basic.py" - ] ++ previousPythonAttrs.disabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.disabledTestPaths or [ ]; }); enabledTestPaths-glob = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTestPaths-glob-${previousPythonAttrs.pname}"; enabledTestPaths = [ "tests/test_obj*.py" - ] ++ previousPythonAttrs.enabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.enabledTestPaths or [ ]; }); enabledTestPaths-glob-nonexistent = testers.testBuildFailure ( objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTestPaths-glob-nonexistent-${previousPythonAttrs.pname}"; enabledTestPaths = [ "tests/test_foo*.py" - ] ++ previousPythonAttrs.enabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.enabledTestPaths or [ ]; }) ); enabledTestPaths-item = objprint.overridePythonAttrs (previousPythonAttrs: { pname = "test-pytestCheckHook-enabledTestPaths-item-${previousPythonAttrs.pname}"; enabledTestPaths = [ "tests/test_basic.py::TestBasic" - ] ++ previousPythonAttrs.enabledTestPaths or [ ]; + ] + ++ previousPythonAttrs.enabledTestPaths or [ ]; }); }; }; diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 4c1ac3664af4..9d392bfcb95a 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -277,86 +277,85 @@ let inherit catchConflicts; - nativeBuildInputs = - [ - python - wrapPython - ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? - pythonRemoveTestsDirHook - ] - ++ optionals (finalAttrs.catchConflicts && !isBootstrapPackage && !isSetuptoolsDependency) [ - # - # 1. When building a package that is also part of the bootstrap chain, we - # must ignore conflicts after installation, because there will be one with - # the package in the bootstrap. - # - # 2. When a package is a dependency of setuptools, we must ignore conflicts - # because the hook that checks for conflicts uses setuptools. - # - pythonCatchConflictsHook - ] - ++ optionals (attrs ? pythonRelaxDeps || attrs ? pythonRemoveDeps) [ - pythonRelaxDepsHook - ] - ++ optionals removeBinBytecode [ - pythonRemoveBinBytecodeHook - ] - ++ optionals (hasSuffix "zip" (attrs.src.name or "")) [ - unzip - ] - ++ optionals (format' == "setuptools") [ - setuptoolsBuildHook - ] - ++ optionals (format' == "pyproject") [ - ( - if isBootstrapPackage then - pypaBuildHook.override { - inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build; - wheel = null; - } - else - pypaBuildHook - ) - ( - if isBootstrapPackage then - pythonRuntimeDepsCheckHook.override { - inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging; - } - else - pythonRuntimeDepsCheckHook - ) - ] - ++ optionals (format' == "wheel") [ - wheelUnpackHook - ] - ++ optionals (format' == "egg") [ - eggUnpackHook - eggBuildHook - eggInstallHook - ] - ++ optionals (format' != "other") [ - ( - if isBootstrapInstallPackage then - pypaInstallHook.override { - inherit (python.pythonOnBuildForHost.pkgs.bootstrap) installer; - } - else - pypaInstallHook - ) - ] - ++ optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ - # This is a test, however, it should be ran independent of the checkPhase and checkInputs - pythonImportsCheckHook - ] - ++ optionals (python.pythonAtLeast "3.3") [ - # Optionally enforce PEP420 for python3 - pythonNamespacesHook - ] - ++ optionals withDistOutput [ - pythonOutputDistHook - ] - ++ nativeBuildInputs - ++ build-system; + nativeBuildInputs = [ + python + wrapPython + ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? + pythonRemoveTestsDirHook + ] + ++ optionals (finalAttrs.catchConflicts && !isBootstrapPackage && !isSetuptoolsDependency) [ + # + # 1. When building a package that is also part of the bootstrap chain, we + # must ignore conflicts after installation, because there will be one with + # the package in the bootstrap. + # + # 2. When a package is a dependency of setuptools, we must ignore conflicts + # because the hook that checks for conflicts uses setuptools. + # + pythonCatchConflictsHook + ] + ++ optionals (attrs ? pythonRelaxDeps || attrs ? pythonRemoveDeps) [ + pythonRelaxDepsHook + ] + ++ optionals removeBinBytecode [ + pythonRemoveBinBytecodeHook + ] + ++ optionals (hasSuffix "zip" (attrs.src.name or "")) [ + unzip + ] + ++ optionals (format' == "setuptools") [ + setuptoolsBuildHook + ] + ++ optionals (format' == "pyproject") [ + ( + if isBootstrapPackage then + pypaBuildHook.override { + inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build; + wheel = null; + } + else + pypaBuildHook + ) + ( + if isBootstrapPackage then + pythonRuntimeDepsCheckHook.override { + inherit (python.pythonOnBuildForHost.pkgs.bootstrap) packaging; + } + else + pythonRuntimeDepsCheckHook + ) + ] + ++ optionals (format' == "wheel") [ + wheelUnpackHook + ] + ++ optionals (format' == "egg") [ + eggUnpackHook + eggBuildHook + eggInstallHook + ] + ++ optionals (format' != "other") [ + ( + if isBootstrapInstallPackage then + pypaInstallHook.override { + inherit (python.pythonOnBuildForHost.pkgs.bootstrap) installer; + } + else + pypaInstallHook + ) + ] + ++ optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + # This is a test, however, it should be ran independent of the checkPhase and checkInputs + pythonImportsCheckHook + ] + ++ optionals (python.pythonAtLeast "3.3") [ + # Optionally enforce PEP420 for python3 + pythonNamespacesHook + ] + ++ optionals withDistOutput [ + pythonOutputDistHook + ] + ++ nativeBuildInputs + ++ build-system; buildInputs = validatePythonMatches "buildInputs" (buildInputs ++ pythonPath); @@ -396,36 +395,36 @@ let outputs = outputs ++ optional withDistOutput "dist"; - passthru = - { - inherit disabled; - } - // { - updateScript = - let - filename = head (splitString ":" finalAttrs.finalPackage.meta.position); - in - [ - update-python-libraries - filename - ]; - } - // optionalAttrs (dependencies != [ ]) { - inherit dependencies; - } - // optionalAttrs (optional-dependencies != { }) { - inherit optional-dependencies; - } - // optionalAttrs (build-system != [ ]) { - inherit build-system; - } - // attrs.passthru or { }; + passthru = { + inherit disabled; + } + // { + updateScript = + let + filename = head (splitString ":" finalAttrs.finalPackage.meta.position); + in + [ + update-python-libraries + filename + ]; + } + // optionalAttrs (dependencies != [ ]) { + inherit dependencies; + } + // optionalAttrs (optional-dependencies != { }) { + inherit optional-dependencies; + } + // optionalAttrs (build-system != [ ]) { + inherit build-system; + } + // attrs.passthru or { }; meta = { # default to python's platforms platforms = python.meta.platforms; isBuildPythonPackage = python.meta.platforms; - } // meta; + } + // meta; } // optionalAttrs (attrs ? checkPhase) { # If given use the specified checkPhase, otherwise use the setup hook. diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index a5fe47f7921e..93dadcfce437 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -81,41 +81,40 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - bzip2 - openssl - pythonForPypy - libffi - ncurses - expat - sqlite - tk - tcl - libX11 - gdbm - db - ] - ++ lib.optionals isPy3k [ - xz - ] - ++ lib.optionals (stdenv ? cc && stdenv.cc.libc != null) [ - stdenv.cc.libc - ] - ++ lib.optionals zlibSupport [ - zlib - ] - ++ - lib.optionals - (lib.any (l: l == optimizationLevel) [ - "0" - "1" - "2" - "3" - ]) - [ - boehmgc - ]; + buildInputs = [ + bzip2 + openssl + pythonForPypy + libffi + ncurses + expat + sqlite + tk + tcl + libX11 + gdbm + db + ] + ++ lib.optionals isPy3k [ + xz + ] + ++ lib.optionals (stdenv ? cc && stdenv.cc.libc != null) [ + stdenv.cc.libc + ] + ++ lib.optionals zlibSupport [ + zlib + ] + ++ + lib.optionals + (lib.any (l: l == optimizationLevel) [ + "0" + "1" + "2" + "3" + ]) + [ + boehmgc + ]; # Remove bootstrap python from closure dontPatchShebangs = true; @@ -209,117 +208,116 @@ stdenv.mkDerivation rec { # TODO: Investigate why so many tests are failing. checkPhase = let - disabledTests = - [ - # disable shutils because it assumes gid 0 exists - "test_shutil" - # disable socket because it has two actual network tests that fail - "test_socket" - ] - ++ lib.optionals (!isPy3k) [ - # disable test_urllib2net, test_urllib2_localnet, and test_urllibnet because they require networking (example.com) - "test_urllib2net" - "test_urllibnet" - "test_urllib2_localnet" - # test_subclass fails with "internal error" - # test_load_default_certs_env fails for unknown reason - "test_ssl" - ] - ++ lib.optionals isPy3k [ - # disable asyncio due to https://github.com/NixOS/nix/issues/1238 - "test_asyncio" - # disable os due to https://github.com/NixOS/nixpkgs/issues/10496 - "test_os" - # disable pathlib due to https://bitbucket.org/pypy/pypy/pull-requests/594 - "test_pathlib" - # disable tarfile because it assumes gid 0 exists - "test_tarfile" - # disable __all__ because of spurious imp/importlib warning and - # warning-to-error test policy - "test___all__" - # fail for multiple reasons, TODO: investigate - "test__opcode" - "test_ast" - "test_audit" - "test_builtin" - "test_c_locale_coercion" - "test_call" - "test_class" - "test_cmd_line" - "test_cmd_line_script" - "test_code" - "test_code_module" - "test_codeop" - "test_compile" - "test_coroutines" - "test_cprofile" - "test_ctypes" - "test_embed" - "test_exceptions" - "test_extcall" - "test_frame" - "test_generators" - "test_grammar" - "test_idle" - "test_iter" - "test_itertools" - "test_list" - "test_marshal" - "test_memoryio" - "test_memoryview" - "test_metaclass" - "test_mmap" - "test_multibytecodec" - "test_opcache" - "test_pdb" - "test_peepholer" - "test_positional_only_arg" - "test_print" - "test_property" - "test_pyclbr" - "test_range" - "test_re" - "test_readline" - "test_regrtest" - "test_repl" - "test_rlcompleter" - "test_signal" - "test_sort" - "test_source_encoding" - "test_ssl" - "test_string_literals" - "test_structseq" - "test_subprocess" - "test_super" - "test_support" - "test_syntax" - "test_sys" - "test_sys_settrace" - "test_tcl" - "test_termios" - "test_threading" - "test_trace" - "test_tty" - "test_unpack_ex" - "test_utf8_mode" - "test_weakref" - "test_capi" - "test_concurrent_futures" - "test_dataclasses" - "test_doctest" - "test_future_stmt" - "test_importlib" - "test_inspect" - "test_pydoc" - "test_warnings" - ] - ++ lib.optionals isPy310 [ - "test_contextlib_async" - "test_future" - "test_lzma" - "test_module" - "test_typing" - ]; + disabledTests = [ + # disable shutils because it assumes gid 0 exists + "test_shutil" + # disable socket because it has two actual network tests that fail + "test_socket" + ] + ++ lib.optionals (!isPy3k) [ + # disable test_urllib2net, test_urllib2_localnet, and test_urllibnet because they require networking (example.com) + "test_urllib2net" + "test_urllibnet" + "test_urllib2_localnet" + # test_subclass fails with "internal error" + # test_load_default_certs_env fails for unknown reason + "test_ssl" + ] + ++ lib.optionals isPy3k [ + # disable asyncio due to https://github.com/NixOS/nix/issues/1238 + "test_asyncio" + # disable os due to https://github.com/NixOS/nixpkgs/issues/10496 + "test_os" + # disable pathlib due to https://bitbucket.org/pypy/pypy/pull-requests/594 + "test_pathlib" + # disable tarfile because it assumes gid 0 exists + "test_tarfile" + # disable __all__ because of spurious imp/importlib warning and + # warning-to-error test policy + "test___all__" + # fail for multiple reasons, TODO: investigate + "test__opcode" + "test_ast" + "test_audit" + "test_builtin" + "test_c_locale_coercion" + "test_call" + "test_class" + "test_cmd_line" + "test_cmd_line_script" + "test_code" + "test_code_module" + "test_codeop" + "test_compile" + "test_coroutines" + "test_cprofile" + "test_ctypes" + "test_embed" + "test_exceptions" + "test_extcall" + "test_frame" + "test_generators" + "test_grammar" + "test_idle" + "test_iter" + "test_itertools" + "test_list" + "test_marshal" + "test_memoryio" + "test_memoryview" + "test_metaclass" + "test_mmap" + "test_multibytecodec" + "test_opcache" + "test_pdb" + "test_peepholer" + "test_positional_only_arg" + "test_print" + "test_property" + "test_pyclbr" + "test_range" + "test_re" + "test_readline" + "test_regrtest" + "test_repl" + "test_rlcompleter" + "test_signal" + "test_sort" + "test_source_encoding" + "test_ssl" + "test_string_literals" + "test_structseq" + "test_subprocess" + "test_super" + "test_support" + "test_syntax" + "test_sys" + "test_sys_settrace" + "test_tcl" + "test_termios" + "test_threading" + "test_trace" + "test_tty" + "test_unpack_ex" + "test_utf8_mode" + "test_weakref" + "test_capi" + "test_concurrent_futures" + "test_dataclasses" + "test_doctest" + "test_future_stmt" + "test_importlib" + "test_inspect" + "test_pydoc" + "test_warnings" + ] + ++ lib.optionals isPy310 [ + "test_contextlib_async" + "test_future" + "test_lzma" + "test_module" + "test_typing" + ]; in '' export TERMINFO="${ncurses.out}/share/terminfo/"; @@ -333,18 +331,17 @@ stdenv.mkDerivation rec { doInstallCheck = true; installCheckPhase = let - modules = - [ - "curses" - "sqlite3" - ] - ++ lib.optionals (!isPy3k) [ - "Tkinter" - ] - ++ lib.optionals isPy3k [ - "tkinter" - "lzma" - ]; + modules = [ + "curses" + "sqlite3" + ] + ++ lib.optionals (!isPy3k) [ + "Tkinter" + ] + ++ lib.optionals isPy3k [ + "tkinter" + "lzma" + ]; imports = lib.concatMapStringsSep "; " (x: "import ${x}") modules; in '' diff --git a/pkgs/development/interpreters/python/pypy/prebuilt.nix b/pkgs/development/interpreters/python/pypy/prebuilt.nix index ec920405067e..02c7b39ad754 100644 --- a/pkgs/development/interpreters/python/pypy/prebuilt.nix +++ b/pkgs/development/interpreters/python/pypy/prebuilt.nix @@ -71,24 +71,23 @@ stdenv.mkDerivation { inherit hash; }; - buildInputs = - [ - bzip2 - expat - gdbm - ncurses6 - sqlite - zlib - stdenv.cc.cc.libgcc or null - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - tcl-8_5 - tk-8_5 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - tcl-8_6 - tk-8_6 - ]; + buildInputs = [ + bzip2 + expat + gdbm + ncurses6 + sqlite + zlib + stdenv.cc.cc.libgcc or null + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + tcl-8_5 + tk-8_5 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + tcl-8_6 + tk-8_6 + ]; nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; @@ -147,18 +146,17 @@ stdenv.mkDerivation { # Check whether importing of (extension) modules functions installCheckPhase = let - modules = - [ - "ssl" - "sys" - "curses" - ] - ++ lib.optionals (!isPy3k) [ - "Tkinter" - ] - ++ lib.optionals isPy3k [ - "tkinter" - ]; + modules = [ + "ssl" + "sys" + "curses" + ] + ++ lib.optionals (!isPy3k) [ + "Tkinter" + ] + ++ lib.optionals isPy3k [ + "tkinter" + ]; imports = lib.concatMapStringsSep "; " (x: "import ${x}") modules; in '' diff --git a/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix b/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix index 95e89c54b68f..4419485b3db6 100644 --- a/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix +++ b/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix @@ -71,24 +71,23 @@ stdenv.mkDerivation { inherit hash; }; - buildInputs = - [ - bzip2 - expat - gdbm - ncurses6 - sqlite - zlib - stdenv.cc.cc.libgcc or null - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - tcl-8_5 - tk-8_5 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - tcl-8_6 - tk-8_6 - ]; + buildInputs = [ + bzip2 + expat + gdbm + ncurses6 + sqlite + zlib + stdenv.cc.cc.libgcc or null + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + tcl-8_5 + tk-8_5 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + tcl-8_6 + tk-8_6 + ]; nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; @@ -142,18 +141,17 @@ stdenv.mkDerivation { # Check whether importing of (extension) modules functions installCheckPhase = let - modules = - [ - "ssl" - "sys" - "curses" - ] - ++ lib.optionals (!isPy3k) [ - "Tkinter" - ] - ++ lib.optionals isPy3k [ - "tkinter" - ]; + modules = [ + "ssl" + "sys" + "curses" + ] + ++ lib.optionals (!isPy3k) [ + "Tkinter" + ] + ++ lib.optionals isPy3k [ + "tkinter" + ]; imports = lib.concatMapStringsSep "; " (x: "import ${x}") modules; in '' diff --git a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix index 5bdfa4cd2992..5fd2c6e91dad 100644 --- a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix @@ -193,47 +193,46 @@ let name = namePrefix + name_; - nativeBuildInputs = - [ - python - wrapPython - ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, ...)? - pythonRemoveTestsDirHook - ] - ++ lib.optionals catchConflicts [ - pythonCatchConflictsHook - ] - ++ lib.optionals removeBinBytecode [ - pythonRemoveBinBytecodeHook - ] - ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [ - unzip - ] - ++ lib.optionals (format == "setuptools") [ - setuptoolsBuildHook - ] - ++ lib.optionals (format == "pyproject") [ - (pipBuildHook) - ] - ++ lib.optionals (format == "wheel") [ - wheelUnpackHook - ] - ++ lib.optionals (format == "egg") [ - eggUnpackHook - eggBuildHook - eggInstallHook - ] - ++ lib.optionals (format != "other") [ - (pipInstallHook) - ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ - # This is a test, however, it should be ran independent of the checkPhase and checkInputs - pythonImportsCheckHook - ] - ++ lib.optionals withDistOutput [ - pythonOutputDistHook - ] - ++ nativeBuildInputs; + nativeBuildInputs = [ + python + wrapPython + ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, ...)? + pythonRemoveTestsDirHook + ] + ++ lib.optionals catchConflicts [ + pythonCatchConflictsHook + ] + ++ lib.optionals removeBinBytecode [ + pythonRemoveBinBytecodeHook + ] + ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [ + unzip + ] + ++ lib.optionals (format == "setuptools") [ + setuptoolsBuildHook + ] + ++ lib.optionals (format == "pyproject") [ + (pipBuildHook) + ] + ++ lib.optionals (format == "wheel") [ + wheelUnpackHook + ] + ++ lib.optionals (format == "egg") [ + eggUnpackHook + eggBuildHook + eggInstallHook + ] + ++ lib.optionals (format != "other") [ + (pipInstallHook) + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + # This is a test, however, it should be ran independent of the checkPhase and checkInputs + pythonImportsCheckHook + ] + ++ lib.optionals withDistOutput [ + pythonOutputDistHook + ] + ++ nativeBuildInputs; buildInputs = validatePythonMatches "buildInputs" (buildInputs ++ pythonPath); @@ -274,7 +273,8 @@ let # default to python's platforms platforms = python.meta.platforms; isBuildPythonPackage = python.meta.platforms; - } // meta; + } + // meta; } // lib.optionalAttrs (attrs ? checkPhase) { # If given use the specified checkPhase, otherwise use the setup hook. diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index 8978b58c2bd2..03e1031f1b77 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -254,12 +254,13 @@ let url = "https://repo.anaconda.com/pkgs/main/noarch/requests-2.24.0-py_0.tar.bz2"; sha256 = "02qzaf6gwsqbcs69pix1fnjxzgnngwzvrsy65h1d521g750mjvvp"; }; - nativeBuildInputs = - [ autoPatchelfHook ] - ++ (with python.pkgs; [ - condaUnpackHook - condaInstallHook - ]); + nativeBuildInputs = [ + autoPatchelfHook + ] + ++ (with python.pkgs; [ + condaUnpackHook + condaInstallHook + ]); buildInputs = [ pythonCondaPackages.condaPatchelfLibs ]; diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix index ec6fb716202a..6b6f97b74f3d 100644 --- a/pkgs/development/interpreters/python/wrapper.nix +++ b/pkgs/development/interpreters/python/wrapper.nix @@ -35,30 +35,29 @@ let nativeBuildInputs = [ makeBinaryWrapper ]; - postBuild = - '' - if [ -L "$out/bin" ]; then - unlink "$out/bin" - fi - mkdir -p "$out/bin" + postBuild = '' + if [ -L "$out/bin" ]; then + unlink "$out/bin" + fi + mkdir -p "$out/bin" - for path in ${lib.concatStringsSep " " paths}; do - if [ -d "$path/bin" ]; then - cd "$path/bin" - for prg in *; do - if [ -f "$prg" ]; then - rm -f "$out/bin/$prg" - if [ -x "$prg" ]; then - makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPREFIX "$out" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${ - lib.optionalString (!permitUserSite) ''--set PYTHONNOUSERSITE "true"'' - } ${lib.concatStringsSep " " makeWrapperArgs} - fi + for path in ${lib.concatStringsSep " " paths}; do + if [ -d "$path/bin" ]; then + cd "$path/bin" + for prg in *; do + if [ -f "$prg" ]; then + rm -f "$out/bin/$prg" + if [ -x "$prg" ]; then + makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPREFIX "$out" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${ + lib.optionalString (!permitUserSite) ''--set PYTHONNOUSERSITE "true"'' + } ${lib.concatStringsSep " " makeWrapperArgs} fi - done - fi - done - '' - + postBuild; + fi + done + fi + done + '' + + postBuild; inherit (python) meta; diff --git a/pkgs/development/interpreters/rakudo/moarvm.nix b/pkgs/development/interpreters/rakudo/moarvm.nix index 8a5e630b2ceb..5311402c8b09 100644 --- a/pkgs/development/interpreters/rakudo/moarvm.nix +++ b/pkgs/development/interpreters/rakudo/moarvm.nix @@ -18,18 +18,17 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - postPatch = - '' - patchShebangs . - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace Configure.pl \ - --replace '`/usr/bin/arch`' '"${stdenv.hostPlatform.darwinArch}"' \ - --replace '/usr/bin/arch' "$(type -P true)" \ - --replace '/usr/' '/nope/' - substituteInPlace 3rdparty/dyncall/configure \ - --replace '`sw_vers -productVersion`' '"11.0"' - ''; + postPatch = '' + patchShebangs . + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace Configure.pl \ + --replace '`/usr/bin/arch`' '"${stdenv.hostPlatform.darwinArch}"' \ + --replace '/usr/bin/arch' "$(type -P true)" \ + --replace '/usr/' '/nope/' + substituteInPlace 3rdparty/dyncall/configure \ + --replace '`sw_vers -productVersion`' '"11.0"' + ''; buildInputs = [ perl ]; doCheck = false; # MoarVM does not come with its own test suite diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index 3167b2e7c0a4..22d04a3499bc 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -146,43 +146,43 @@ let strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - bison - removeReferencesTo - ] - ++ (op docSupport groff) - ++ (ops (dtraceSupport && stdenv.hostPlatform.isLinux) [ - systemtap - libsystemtap - ]) - ++ ops yjitSupport [ - rustPlatform.cargoSetupHook - cargo - rustc - ] - ++ op useBaseRuby baseRuby; - buildInputs = - [ autoconf ] - ++ (op fiddleSupport libffi) - ++ (ops cursesSupport [ - ncurses - readline - ]) - ++ (op zlibSupport zlib) - ++ (op opensslSupport openssl) - ++ (op gdbmSupport gdbm) - ++ (op yamlSupport libyaml) - # Looks like ruby fails to build on darwin without readline even if curses - # support is not enabled, so add readline to the build inputs if curses - # support is disabled (if it's enabled, we already have it) and we're - # running on darwin - ++ op (!cursesSupport && stdenv.hostPlatform.isDarwin) readline - ++ ops stdenv.hostPlatform.isDarwin [ - libiconv - libunwind - ]; + nativeBuildInputs = [ + autoreconfHook + bison + removeReferencesTo + ] + ++ (op docSupport groff) + ++ (ops (dtraceSupport && stdenv.hostPlatform.isLinux) [ + systemtap + libsystemtap + ]) + ++ ops yjitSupport [ + rustPlatform.cargoSetupHook + cargo + rustc + ] + ++ op useBaseRuby baseRuby; + buildInputs = [ + autoconf + ] + ++ (op fiddleSupport libffi) + ++ (ops cursesSupport [ + ncurses + readline + ]) + ++ (op zlibSupport zlib) + ++ (op opensslSupport openssl) + ++ (op gdbmSupport gdbm) + ++ (op yamlSupport libyaml) + # Looks like ruby fails to build on darwin without readline even if curses + # support is not enabled, so add readline to the build inputs if curses + # support is disabled (if it's enabled, we already have it) and we're + # running on darwin + ++ op (!cursesSupport && stdenv.hostPlatform.isDarwin) readline + ++ ops stdenv.hostPlatform.isDarwin [ + libiconv + libunwind + ]; propagatedBuildInputs = op jemallocSupport jemalloc; enableParallelBuilding = true; @@ -235,36 +235,35 @@ let cp --remove-destination ${config}/config.sub tool/ ''; - configureFlags = - [ - (lib.enableFeature (!stdenv.hostPlatform.isStatic) "shared") - (lib.enableFeature true "pthread") - (lib.withFeatureAs true "soname" "ruby-${version}") - (lib.withFeatureAs useBaseRuby "baseruby" "${baseRuby}/bin/ruby") - (lib.enableFeature dtraceSupport "dtrace") - (lib.enableFeature jitSupport "jit-support") - (lib.enableFeature yjitSupport "yjit") - (lib.enableFeature docSupport "install-doc") - (lib.withFeature jemallocSupport "jemalloc") - (lib.withFeatureAs docSupport "ridir" "${placeholder "devdoc"}/share/ri") - # ruby enables -O3 for gcc, however our compiler hardening wrapper - # overrides that by enabling `-O2` which is the minimum optimization - # needed for `_FORTIFY_SOURCE`. - ] - ++ lib.optional stdenv.cc.isGNU "CFLAGS=-O3" - ++ [ - ] - ++ ops stdenv.hostPlatform.isDarwin [ - # on darwin, we have /usr/include/tk.h -- so the configure script detects - # that tk is installed - "--with-out-ext=tk" - # on yosemite, "generating encdb.h" will hang for a very long time without this flag - "--with-setjmp-type=setjmp" - ] - ++ ops stdenv.hostPlatform.isFreeBSD [ - "rb_cv_gnu_qsort_r=no" - "rb_cv_bsd_qsort_r=yes" - ]; + configureFlags = [ + (lib.enableFeature (!stdenv.hostPlatform.isStatic) "shared") + (lib.enableFeature true "pthread") + (lib.withFeatureAs true "soname" "ruby-${version}") + (lib.withFeatureAs useBaseRuby "baseruby" "${baseRuby}/bin/ruby") + (lib.enableFeature dtraceSupport "dtrace") + (lib.enableFeature jitSupport "jit-support") + (lib.enableFeature yjitSupport "yjit") + (lib.enableFeature docSupport "install-doc") + (lib.withFeature jemallocSupport "jemalloc") + (lib.withFeatureAs docSupport "ridir" "${placeholder "devdoc"}/share/ri") + # ruby enables -O3 for gcc, however our compiler hardening wrapper + # overrides that by enabling `-O2` which is the minimum optimization + # needed for `_FORTIFY_SOURCE`. + ] + ++ lib.optional stdenv.cc.isGNU "CFLAGS=-O3" + ++ [ + ] + ++ ops stdenv.hostPlatform.isDarwin [ + # on darwin, we have /usr/include/tk.h -- so the configure script detects + # that tk is installed + "--with-out-ext=tk" + # on yosemite, "generating encdb.h" will hang for a very long time without this flag + "--with-setjmp-type=setjmp" + ] + ++ ops stdenv.hostPlatform.isFreeBSD [ + "rb_cv_gnu_qsort_r=no" + "rb_cv_bsd_qsort_r=yes" + ]; preConfigure = opString docSupport '' # rdoc creates XDG_DATA_DIR (defaulting to $HOME/.local/share) even if @@ -285,67 +284,66 @@ let installFlags = lib.optional docSupport "install-doc"; # Bundler tries to create this directory - postInstall = - '' - rbConfig=$(find $out/lib/ruby -name rbconfig.rb) - # Remove references to the build environment from the closure - sed -i '/^ CONFIG\["\(BASERUBY\|SHELL\|GREP\|EGREP\|MKDIR_P\|MAKEDIRS\|INSTALL\)"\]/d' $rbConfig - # Remove unnecessary groff reference from runtime closure, since it's big - sed -i '/NROFF/d' $rbConfig - ${lib.optionalString (!jitSupport) '' - # Get rid of the CC runtime dependency - remove-references-to \ - -t ${stdenv.cc} \ - $out/lib/libruby* - remove-references-to \ - -t ${stdenv.cc} \ - $rbConfig - 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. - sed -i "$rbConfig" \ - -e 's/CONFIG\["CC"\] = "\(.*\)"/CONFIG["CC"] = if ENV["CC"].nil? || ENV["CC"].empty? then "\1" else ENV["CC"] end/' \ - -e 's/CONFIG\["CXX"\] = "\(.*\)"/CONFIG["CXX"] = if ENV["CXX"].nil? || ENV["CXX"].empty? then "\1" else ENV["CXX"] end/' - - # Remove unnecessary external intermediate files created by gems - extMakefiles=$(find $out/${finalAttrs.passthru.gemPath} -name Makefile) - for makefile in $extMakefiles; do - make -C "$(dirname "$makefile")" distclean - done - find "$out/${finalAttrs.passthru.gemPath}" \( -name gem_make.out -o -name mkmf.log -o -name exts.mk \) -delete - # Bundler tries to create this directory - mkdir -p $out/nix-support - cat > $out/nix-support/setup-hook < $out/nix-support/setup-hook < 4 doesn't know about the flag anymore - (enableFeature buildAvresample "avresample") - ] - ++ [ - (enableFeature buildAvutil "avutil") - (enableFeature (buildPostproc && withGPL) "postproc") - (enableFeature buildSwresample "swresample") - (enableFeature buildSwscale "swscale") - ] - ++ optionals withLib [ - "--libdir=${placeholder "lib"}/lib" - "--incdir=${placeholder "dev"}/include" - ] - ++ [ - # Documentation flags - (enableFeature withDocumentation "doc") - (enableFeature withHtmlDoc "htmlpages") - (enableFeature withManPages "manpages") - ] - ++ optionals withManPages [ - "--mandir=${placeholder "man"}/share/man" - ] - ++ [ - (enableFeature withPodDoc "podpages") - (enableFeature withTxtDoc "txtpages") - ] - ++ optionals withDoc [ - "--docdir=${placeholder "doc"}/share/doc/ffmpeg" - ] - ++ [ - # External libraries - (enableFeature withAlsa "alsa") - (enableFeature withAmf "amf") - (enableFeature withAom "libaom") - (enableFeature withAribb24 "libaribb24") - ] - ++ optionals (versionAtLeast version "6.1") [ - (enableFeature withAribcaption "libaribcaption") - ] - ++ [ - (enableFeature withAss "libass") - (enableFeature withAvisynth "avisynth") - (enableFeature withBluray "libbluray") - (enableFeature withBs2b "libbs2b") - (enableFeature withBzlib "bzlib") - (enableFeature withCaca "libcaca") - (enableFeature withCdio "libcdio") - (enableFeature withCelt "libcelt") - (enableFeature withChromaprint "chromaprint") - (enableFeature withCodec2 "libcodec2") - (enableFeature withCuda "cuda") - (enableFeature withCudaLLVM "cuda-llvm") - (enableFeature withCudaNVCC "cuda-nvcc") - (enableFeature withCuvid "cuvid") - (enableFeature withDav1d "libdav1d") - (enableFeature withDc1394 "libdc1394") - (enableFeature withDrm "libdrm") - ] - ++ optionals (versionAtLeast version "7") [ - (enableFeature withDvdnav "libdvdnav") - (enableFeature withDvdread "libdvdread") - ] - ++ [ - (enableFeature withFdkAac "libfdk-aac") - (enableFeature withNvcodec "ffnvcodec") - (enableFeature withFlite "libflite") - (enableFeature withFontconfig "fontconfig") - (enableFeature withFontconfig "libfontconfig") - (enableFeature withFreetype "libfreetype") - (enableFeature withFrei0r "frei0r") - (enableFeature withFribidi "libfribidi") - (enableFeature withGme "libgme") - (enableFeature withGnutls "gnutls") - (enableFeature withGsm "libgsm") - ] - ++ optionals (versionAtLeast version "6.1") [ - (enableFeature withHarfbuzz "libharfbuzz") - ] - ++ [ - (enableFeature withIconv "iconv") - (enableFeature withIlbc "libilbc") - (enableFeature withJack "libjack") - ] - ++ optionals (versionAtLeast finalAttrs.version "5.0") [ - (enableFeature withJxl "libjxl") - ] - ++ [ - (enableFeature withKvazaar "libkvazaar") - (enableFeature withLadspa "ladspa") - ] - ++ optionals (versionAtLeast version "7.1") [ - (enableFeature withLc3 "liblc3") - (enableFeature withLcevcdec "liblcevc-dec") - ] - ++ optionals (versionAtLeast version "5.1") [ - (enableFeature withLcms2 "lcms2") - ] - ++ [ - (enableFeature withLzma "lzma") - ] - ++ optionals (versionAtLeast version "5.0") [ - (enableFeature withMetal "metal") - ] - ++ [ - (enableFeature withMfx "libmfx") - (enableFeature withModplug "libmodplug") - (enableFeature withMp3lame "libmp3lame") - (enableFeature withMysofa "libmysofa") - (enableFeature withNpp "libnpp") - (enableFeature withNvdec "nvdec") - (enableFeature withNvenc "nvenc") - (enableFeature withOpenal "openal") - (enableFeature withOpencl "opencl") - (enableFeature withOpencoreAmrnb "libopencore-amrnb") - (enableFeature withOpencoreAmrwb "libopencore-amrwb") - (enableFeature withOpengl "opengl") - (enableFeature withOpenh264 "libopenh264") - (enableFeature withOpenjpeg "libopenjpeg") - (enableFeature withOpenmpt "libopenmpt") - (enableFeature withOpus "libopus") - ] - ++ optionals (versionAtLeast version "5.0") [ - (enableFeature withPlacebo "libplacebo") - ] - ++ [ - (enableFeature withPulse "libpulse") - ] - ++ optionals (versionAtLeast version "7") [ - (enableFeature withQrencode "libqrencode") - (enableFeature withQuirc "libquirc") - ] - ++ [ - (enableFeature withRav1e "librav1e") - (enableFeature withRist "librist") - (enableFeature withRtmp "librtmp") - (enableFeature withRubberband "librubberband") - (enableFeature withSamba "libsmbclient") - (enableFeature withSdl2 "sdl2") - ] - ++ optionals (versionAtLeast version "5.0") [ - (enableFeature withShaderc "libshaderc") - ] - ++ [ - (enableFeature withShine "libshine") - (enableFeature withSnappy "libsnappy") - (enableFeature withSoxr "libsoxr") - (enableFeature withSpeex "libspeex") - (enableFeature withSrt "libsrt") - (enableFeature withSsh "libssh") - (enableFeature withSvg "librsvg") - (enableFeature withSvtav1 "libsvtav1") - (enableFeature withTensorflow "libtensorflow") - (enableFeature withTheora "libtheora") - (enableFeature withTwolame "libtwolame") - (enableFeature withV4l2 "libv4l2") - (enableFeature withV4l2M2m "v4l2-m2m") - (enableFeature withVaapi "vaapi") - (enableFeature withVdpau "vdpau") - ] - ++ optionals (versionAtLeast version "6.0") [ - (enableFeature withVpl "libvpl") - ] - ++ [ - (enableFeature withVidStab "libvidstab") # Actual min. version 2.0 - (enableFeature withVmaf "libvmaf") - (enableFeature withVoAmrwbenc "libvo-amrwbenc") - (enableFeature withVorbis "libvorbis") - (enableFeature withVpx "libvpx") - (enableFeature withVulkan "vulkan") - ] - ++ optionals (versionAtLeast version "7.1") [ - (enableFeature withVvenc "libvvenc") - ] - ++ [ - (enableFeature withWebp "libwebp") - (enableFeature withX264 "libx264") - (enableFeature withX265 "libx265") - (enableFeature withXavs "libxavs") - (enableFeature withXcb "libxcb") - (enableFeature withXcbShape "libxcb-shape") - (enableFeature withXcbShm "libxcb-shm") - (enableFeature withXcbxfixes "libxcb-xfixes") - ] - ++ optionals (versionAtLeast version "7") [ - (enableFeature withXevd "libxevd") - (enableFeature withXeve "libxeve") - ] - ++ [ - (enableFeature withXlib "xlib") - (enableFeature withXml2 "libxml2") - (enableFeature withXvid "libxvid") - (enableFeature withZimg "libzimg") - (enableFeature withZlib "zlib") - (enableFeature withZmq "libzmq") - (enableFeature withZvbi "libzvbi") - # Developer flags - (enableFeature withDebug "debug") - (enableFeature withOptimisations "optimizations") - (enableFeature withExtraWarnings "extra-warnings") - (enableFeature withStripping "stripping") - ] - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--cross-prefix=${stdenv.cc.targetPrefix}" - "--enable-cross-compile" - "--host-cc=${buildPackages.stdenv.cc}/bin/cc" - ] - ++ optionals stdenv.cc.isClang [ - "--cc=${stdenv.cc.targetPrefix}clang" - "--cxx=${stdenv.cc.targetPrefix}clang++" - ] - ++ optionals withMetal [ - "--metalcc=${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal" - "--metallib=${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metallib" - ]; + # Program flags + (enableFeature buildFfmpeg "ffmpeg") + (enableFeature buildFfplay "ffplay") + (enableFeature buildFfprobe "ffprobe") + ] + ++ optionals withBin [ + "--bindir=${placeholder "bin"}/bin" + ] + ++ [ + # Library flags + (enableFeature buildAvcodec "avcodec") + (enableFeature buildAvdevice "avdevice") + (enableFeature buildAvfilter "avfilter") + (enableFeature buildAvformat "avformat") + ] + ++ optionals (lib.versionOlder version "5") [ + # Ffmpeg > 4 doesn't know about the flag anymore + (enableFeature buildAvresample "avresample") + ] + ++ [ + (enableFeature buildAvutil "avutil") + (enableFeature (buildPostproc && withGPL) "postproc") + (enableFeature buildSwresample "swresample") + (enableFeature buildSwscale "swscale") + ] + ++ optionals withLib [ + "--libdir=${placeholder "lib"}/lib" + "--incdir=${placeholder "dev"}/include" + ] + ++ [ + # Documentation flags + (enableFeature withDocumentation "doc") + (enableFeature withHtmlDoc "htmlpages") + (enableFeature withManPages "manpages") + ] + ++ optionals withManPages [ + "--mandir=${placeholder "man"}/share/man" + ] + ++ [ + (enableFeature withPodDoc "podpages") + (enableFeature withTxtDoc "txtpages") + ] + ++ optionals withDoc [ + "--docdir=${placeholder "doc"}/share/doc/ffmpeg" + ] + ++ [ + # External libraries + (enableFeature withAlsa "alsa") + (enableFeature withAmf "amf") + (enableFeature withAom "libaom") + (enableFeature withAribb24 "libaribb24") + ] + ++ optionals (versionAtLeast version "6.1") [ + (enableFeature withAribcaption "libaribcaption") + ] + ++ [ + (enableFeature withAss "libass") + (enableFeature withAvisynth "avisynth") + (enableFeature withBluray "libbluray") + (enableFeature withBs2b "libbs2b") + (enableFeature withBzlib "bzlib") + (enableFeature withCaca "libcaca") + (enableFeature withCdio "libcdio") + (enableFeature withCelt "libcelt") + (enableFeature withChromaprint "chromaprint") + (enableFeature withCodec2 "libcodec2") + (enableFeature withCuda "cuda") + (enableFeature withCudaLLVM "cuda-llvm") + (enableFeature withCudaNVCC "cuda-nvcc") + (enableFeature withCuvid "cuvid") + (enableFeature withDav1d "libdav1d") + (enableFeature withDc1394 "libdc1394") + (enableFeature withDrm "libdrm") + ] + ++ optionals (versionAtLeast version "7") [ + (enableFeature withDvdnav "libdvdnav") + (enableFeature withDvdread "libdvdread") + ] + ++ [ + (enableFeature withFdkAac "libfdk-aac") + (enableFeature withNvcodec "ffnvcodec") + (enableFeature withFlite "libflite") + (enableFeature withFontconfig "fontconfig") + (enableFeature withFontconfig "libfontconfig") + (enableFeature withFreetype "libfreetype") + (enableFeature withFrei0r "frei0r") + (enableFeature withFribidi "libfribidi") + (enableFeature withGme "libgme") + (enableFeature withGnutls "gnutls") + (enableFeature withGsm "libgsm") + ] + ++ optionals (versionAtLeast version "6.1") [ + (enableFeature withHarfbuzz "libharfbuzz") + ] + ++ [ + (enableFeature withIconv "iconv") + (enableFeature withIlbc "libilbc") + (enableFeature withJack "libjack") + ] + ++ optionals (versionAtLeast finalAttrs.version "5.0") [ + (enableFeature withJxl "libjxl") + ] + ++ [ + (enableFeature withKvazaar "libkvazaar") + (enableFeature withLadspa "ladspa") + ] + ++ optionals (versionAtLeast version "7.1") [ + (enableFeature withLc3 "liblc3") + (enableFeature withLcevcdec "liblcevc-dec") + ] + ++ optionals (versionAtLeast version "5.1") [ + (enableFeature withLcms2 "lcms2") + ] + ++ [ + (enableFeature withLzma "lzma") + ] + ++ optionals (versionAtLeast version "5.0") [ + (enableFeature withMetal "metal") + ] + ++ [ + (enableFeature withMfx "libmfx") + (enableFeature withModplug "libmodplug") + (enableFeature withMp3lame "libmp3lame") + (enableFeature withMysofa "libmysofa") + (enableFeature withNpp "libnpp") + (enableFeature withNvdec "nvdec") + (enableFeature withNvenc "nvenc") + (enableFeature withOpenal "openal") + (enableFeature withOpencl "opencl") + (enableFeature withOpencoreAmrnb "libopencore-amrnb") + (enableFeature withOpencoreAmrwb "libopencore-amrwb") + (enableFeature withOpengl "opengl") + (enableFeature withOpenh264 "libopenh264") + (enableFeature withOpenjpeg "libopenjpeg") + (enableFeature withOpenmpt "libopenmpt") + (enableFeature withOpus "libopus") + ] + ++ optionals (versionAtLeast version "5.0") [ + (enableFeature withPlacebo "libplacebo") + ] + ++ [ + (enableFeature withPulse "libpulse") + ] + ++ optionals (versionAtLeast version "7") [ + (enableFeature withQrencode "libqrencode") + (enableFeature withQuirc "libquirc") + ] + ++ [ + (enableFeature withRav1e "librav1e") + (enableFeature withRist "librist") + (enableFeature withRtmp "librtmp") + (enableFeature withRubberband "librubberband") + (enableFeature withSamba "libsmbclient") + (enableFeature withSdl2 "sdl2") + ] + ++ optionals (versionAtLeast version "5.0") [ + (enableFeature withShaderc "libshaderc") + ] + ++ [ + (enableFeature withShine "libshine") + (enableFeature withSnappy "libsnappy") + (enableFeature withSoxr "libsoxr") + (enableFeature withSpeex "libspeex") + (enableFeature withSrt "libsrt") + (enableFeature withSsh "libssh") + (enableFeature withSvg "librsvg") + (enableFeature withSvtav1 "libsvtav1") + (enableFeature withTensorflow "libtensorflow") + (enableFeature withTheora "libtheora") + (enableFeature withTwolame "libtwolame") + (enableFeature withV4l2 "libv4l2") + (enableFeature withV4l2M2m "v4l2-m2m") + (enableFeature withVaapi "vaapi") + (enableFeature withVdpau "vdpau") + ] + ++ optionals (versionAtLeast version "6.0") [ + (enableFeature withVpl "libvpl") + ] + ++ [ + (enableFeature withVidStab "libvidstab") # Actual min. version 2.0 + (enableFeature withVmaf "libvmaf") + (enableFeature withVoAmrwbenc "libvo-amrwbenc") + (enableFeature withVorbis "libvorbis") + (enableFeature withVpx "libvpx") + (enableFeature withVulkan "vulkan") + ] + ++ optionals (versionAtLeast version "7.1") [ + (enableFeature withVvenc "libvvenc") + ] + ++ [ + (enableFeature withWebp "libwebp") + (enableFeature withX264 "libx264") + (enableFeature withX265 "libx265") + (enableFeature withXavs "libxavs") + (enableFeature withXcb "libxcb") + (enableFeature withXcbShape "libxcb-shape") + (enableFeature withXcbShm "libxcb-shm") + (enableFeature withXcbxfixes "libxcb-xfixes") + ] + ++ optionals (versionAtLeast version "7") [ + (enableFeature withXevd "libxevd") + (enableFeature withXeve "libxeve") + ] + ++ [ + (enableFeature withXlib "xlib") + (enableFeature withXml2 "libxml2") + (enableFeature withXvid "libxvid") + (enableFeature withZimg "libzimg") + (enableFeature withZlib "zlib") + (enableFeature withZmq "libzmq") + (enableFeature withZvbi "libzvbi") + # Developer flags + (enableFeature withDebug "debug") + (enableFeature withOptimisations "optimizations") + (enableFeature withExtraWarnings "extra-warnings") + (enableFeature withStripping "stripping") + ] + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--cross-prefix=${stdenv.cc.targetPrefix}" + "--enable-cross-compile" + "--host-cc=${buildPackages.stdenv.cc}/bin/cc" + ] + ++ optionals stdenv.cc.isClang [ + "--cc=${stdenv.cc.targetPrefix}clang" + "--cxx=${stdenv.cc.targetPrefix}clang++" + ] + ++ optionals withMetal [ + "--metalcc=${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal" + "--metallib=${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metallib" + ]; # ffmpeg embeds the configureFlags verbatim in its binaries and because we # configure binary, include, library dir etc., this causes references in @@ -791,18 +789,17 @@ stdenv.mkDerivation ( strictDeps = true; - nativeBuildInputs = - [ - removeReferencesTo - addDriverRunpath - perl - pkg-config - yasm - ] - # Texinfo version 7.1 introduced breaking changes, which older versions of ffmpeg do not handle. - ++ (if versionOlder version "5" then [ texinfo6 ] else [ texinfo ]) - ++ optionals withCudaLLVM [ clang ] - ++ optionals withCudaNVCC [ cuda_nvcc ]; + nativeBuildInputs = [ + removeReferencesTo + addDriverRunpath + perl + pkg-config + yasm + ] + # Texinfo version 7.1 introduced breaking changes, which older versions of ffmpeg do not handle. + ++ (if versionOlder version "5" then [ texinfo6 ] else [ texinfo ]) + ++ optionals withCudaLLVM [ clang ] + ++ optionals withCudaNVCC [ cuda_nvcc ]; buildInputs = [ ] diff --git a/pkgs/development/libraries/flint/3.nix b/pkgs/development/libraries/flint/3.nix index 971598950740..23553d45cb8c 100644 --- a/pkgs/development/libraries/flint/3.nix +++ b/pkgs/development/libraries/flint/3.nix @@ -41,19 +41,18 @@ stdenv.mkDerivation rec { mpfr ]; - buildInputs = - [ - gmp - ] - ++ lib.optionals withBlas [ - openblas - ] - ++ lib.optionals withNtl [ - ntl - ] - ++ lib.optionals stdenv.hostPlatform.isMinGW [ - windows.mingw_w64_pthreads - ]; + buildInputs = [ + gmp + ] + ++ lib.optionals withBlas [ + openblas + ] + ++ lib.optionals withNtl [ + ntl + ] + ++ lib.optionals stdenv.hostPlatform.isMinGW [ + windows.mingw_w64_pthreads + ]; # We're not using autoreconfHook because flint's bootstrap # script calls autoreconf, among other things. @@ -62,17 +61,16 @@ stdenv.mkDerivation rec { ./bootstrap.sh ''; - configureFlags = - [ - "--with-gmp=${gmp}" - "--with-mpfr=${mpfr}" - ] - ++ lib.optionals withBlas [ - "--with-blas=${openblas}" - ] - ++ lib.optionals withNtl [ - "--with-ntl=${ntl}" - ]; + configureFlags = [ + "--with-gmp=${gmp}" + "--with-mpfr=${mpfr}" + ] + ++ lib.optionals withBlas [ + "--with-blas=${openblas}" + ] + ++ lib.optionals withNtl [ + "--with-ntl=${ntl}" + ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/fltk/common.nix b/pkgs/development/libraries/fltk/common.nix index 6df8c0821963..4ec78559ca0c 100644 --- a/pkgs/development/libraries/fltk/common.nix +++ b/pkgs/development/libraries/fltk/common.nix @@ -68,15 +68,14 @@ stdenv.mkDerivation { patchShebangs documentation/make_* ''; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals withDocs [ - doxygen - graphviz - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals withDocs [ + doxygen + graphviz + ]; buildInputs = lib.optionals (withGL && !stdenv.hostPlatform.isDarwin) [ @@ -90,28 +89,27 @@ stdenv.mkDerivation { fontconfig ]; - propagatedBuildInputs = - [ - zlib - libjpeg - libpng - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - freetype - libX11 - libXext - libXinerama - libXfixes - libXcursor - libXft - libXrender - ] - ++ lib.optionals withCairo [ - cairo - ] - ++ lib.optionals withPango [ - pango - ]; + propagatedBuildInputs = [ + zlib + libjpeg + libpng + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + freetype + libX11 + libXext + libXinerama + libXfixes + libXcursor + libXft + libXrender + ] + ++ lib.optionals withCairo [ + cairo + ] + ++ lib.optionals withPango [ + pango + ]; cmakeFlags = [ # Common diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 4d132edb76a3..5660f553f289 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -57,17 +57,16 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs doc/check-whitespace-in-args.py ''; - configureFlags = - [ - "--sysconfdir=/etc" - "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" - "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/ - # just <1MB; this is what you get when loading config fails for some reason - "--with-default-fonts=${dejavu_fonts.minimal}" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" - ]; + configureFlags = [ + "--sysconfdir=/etc" + "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" + "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/ + # just <1MB; this is what you get when loading config fails for some reason + "--with-default-fonts=${dejavu_fonts.minimal}" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" + ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/fontconfig/make-fonts-conf.nix b/pkgs/development/libraries/fontconfig/make-fonts-conf.nix index d88b07ef8af1..6717f0513924 100644 --- a/pkgs/development/libraries/fontconfig/make-fonts-conf.nix +++ b/pkgs/development/libraries/fontconfig/make-fonts-conf.nix @@ -14,28 +14,27 @@ in fontconfig ? fontconfig_, # an array of fonts, e.g. `[ pkgs.dejavu_fonts.minimal ]` fontDirectories, - impureFontDirectories ? - [ - # nix user profile - "~/.nix-profile/lib/X11/fonts" - "~/.nix-profile/share/fonts" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "~/Library/Fonts" - ++ [ - # FHS paths for non-NixOS platforms - "/usr/share/fonts" - "/usr/local/share/fonts" - ] - # darwin paths - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "/Library/Fonts" - "/System/Library/Fonts" - ] - # nix default profile - ++ [ - "/nix/var/nix/profiles/default/lib/X11/fonts" - "/nix/var/nix/profiles/default/share/fonts" - ], + impureFontDirectories ? [ + # nix user profile + "~/.nix-profile/lib/X11/fonts" + "~/.nix-profile/share/fonts" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "~/Library/Fonts" + ++ [ + # FHS paths for non-NixOS platforms + "/usr/share/fonts" + "/usr/local/share/fonts" + ] + # darwin paths + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "/Library/Fonts" + "/System/Library/Fonts" + ] + # nix default profile + ++ [ + "/nix/var/nix/profiles/default/lib/X11/fonts" + "/nix/var/nix/profiles/default/share/fonts" + ], # to include custom config includes ? [ "/etc/fonts/conf.d" ], diff --git a/pkgs/development/libraries/fox/default.nix b/pkgs/development/libraries/fox/default.nix index 26ecbc9ed7fd..775144c0bd6b 100644 --- a/pkgs/development/libraries/fox/default.nix +++ b/pkgs/development/libraries/fox/default.nix @@ -24,22 +24,21 @@ stdenv.mkDerivation rec { sha256 = "sha256-bu+IEqNkv9OAf96dPYre3CP759pjalVIbYyc3QSQW2w="; }; - buildInputs = - [ - libpng - libjpeg - libtiff - zlib - bzip2 - mesa_glu - libXcursor - libXext - libXrandr - libXft - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cups - ]; + buildInputs = [ + libpng + libjpeg + libtiff + zlib + bzip2 + mesa_glu + libXcursor + libXext + libXrandr + libXft + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cups + ]; doCheck = true; diff --git a/pkgs/development/libraries/g2o/default.nix b/pkgs/development/libraries/g2o/default.nix index 866e93051804..9f8b5da27f15 100644 --- a/pkgs/development/libraries/g2o/default.nix +++ b/pkgs/development/libraries/g2o/default.nix @@ -48,19 +48,18 @@ mkDerivation rec { dontWrapQtApps = true; - cmakeFlags = - [ - # Detection script is broken - "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer" - "-DG2O_BUILD_EXAMPLES=OFF" - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - "-DDO_SSE_AUTODETECT=OFF" - "-DDISABLE_SSE3=${if stdenv.hostPlatform.sse3Support then "OFF" else "ON"}" - "-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}" - "-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}" - "-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}" - ]; + cmakeFlags = [ + # Detection script is broken + "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer" + "-DG2O_BUILD_EXAMPLES=OFF" + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + "-DDO_SSE_AUTODETECT=OFF" + "-DDISABLE_SSE3=${if stdenv.hostPlatform.sse3Support then "OFF" else "ON"}" + "-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}" + "-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}" + "-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}" + ]; meta = with lib; { description = "General Framework for Graph Optimization"; diff --git a/pkgs/development/libraries/gcc/libgcc/default.nix b/pkgs/development/libraries/gcc/libgcc/default.nix index cf51e9b4846d..78ecc8f45523 100644 --- a/pkgs/development/libraries/gcc/libgcc/default.nix +++ b/pkgs/development/libraries/gcc/libgcc/default.nix @@ -44,98 +44,95 @@ stdenv.mkDerivation (finalAttrs: { buildRoot=$(readlink -e "./build") ''; - postPatch = - gcc.cc.passthru.forceLibgccToBuildCrtStuff - + '' - sourceRoot=$(readlink -e "./libgcc") - ''; + postPatch = gcc.cc.passthru.forceLibgccToBuildCrtStuff + '' + sourceRoot=$(readlink -e "./libgcc") + ''; hardeningDisable = [ "pie" ]; - preConfigure = - '' - # Drop in libiberty, as external builds are not expected - cd "$buildRoot" - ( - mkdir -p build-${stdenv.buildPlatform.config}/libiberty/ - cd build-${stdenv.buildPlatform.config}/libiberty/ - ln -s ${buildPackages.libiberty}/lib/libiberty.a ./ - ) - mkdir -p "$buildRoot/gcc" - cd "$buildRoot/gcc" - ( - # We "shift" the tools over to fake platforms perspective from the previous stage. - export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD - export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD - export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD - export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD - export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD - - export AS=$AS_FOR_BUILD - export CC=$CC_FOR_BUILD - export CPP=$CPP_FOR_BUILD - export CXX=$CXX_FOR_BUILD - export LD=$LD_FOR_BUILD - - export AS_FOR_TARGET=${stdenv.cc}/bin/$AS - export CC_FOR_TARGET=${stdenv.cc}/bin/$CC - export CPP_FOR_TARGET=${stdenv.cc}/bin/$CPP - export LD_FOR_TARGET=${stdenv.cc.bintools}/bin/$LD - - # We define GENERATOR_FILE so nothing bothers looking for GNU GMP. - export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1' - - "$sourceRoot/../gcc/configure" ${lib.concatStringsSep " " gccConfigureFlags} - - # We remove the `libgcc.mvar` deps so that the bootstrap xgcc isn't built. - sed -e 's,libgcc.mvars:.*$,libgcc.mvars:,' -i Makefile - - make \ - config.h \ - libgcc.mvars \ - tconfig.h \ - tm.h \ - options.h \ - insn-constants.h \ - '' - + lib.optionalString stdenv.targetPlatform.isM68k '' - sysroot-suffix.h \ - '' - + lib.optionalString stdenv.targetPlatform.isAarch32 '' - arm-isa.h \ - arm-cpu.h \ - '' - + lib.optionalString stdenv.targetPlatform.isLoongArch64 '' - loongarch-multilib.h \ - '' - + '' - insn-modes.h - ) - mkdir -p "$buildRoot/gcc/include" - - # Preparing to configure + build libgcc itself - mkdir -p "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" - cd "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" - configureScript=$sourceRoot/configure - chmod +x "$configureScript" - + preConfigure = '' + # Drop in libiberty, as external builds are not expected + cd "$buildRoot" + ( + mkdir -p build-${stdenv.buildPlatform.config}/libiberty/ + cd build-${stdenv.buildPlatform.config}/libiberty/ + ln -s ${buildPackages.libiberty}/lib/libiberty.a ./ + ) + mkdir -p "$buildRoot/gcc" + cd "$buildRoot/gcc" + ( + # We "shift" the tools over to fake platforms perspective from the previous stage. export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD - export AS=${stdenv.cc}/bin/$AS - export CC=${stdenv.cc}/bin/$CC - export CPP=${stdenv.cc}/bin/$CPP - export CXX=${stdenv.cc}/bin/$CXX - export LD=${stdenv.cc.bintools}/bin/$LD + export AS=$AS_FOR_BUILD + export CC=$CC_FOR_BUILD + export CPP=$CPP_FOR_BUILD + export CXX=$CXX_FOR_BUILD + export LD=$LD_FOR_BUILD - export AS_FOR_TARGET=${stdenv.cc}/bin/$AS_FOR_TARGET - export CC_FOR_TARGET=${stdenv.cc}/bin/$CC_FOR_TARGET - export CPP_FOR_TARGET=${stdenv.cc}/bin/$CPP_FOR_TARGET - export LD_FOR_TARGET=${stdenv.cc.bintools}/bin/$LD_FOR_TARGET - ''; + export AS_FOR_TARGET=${stdenv.cc}/bin/$AS + export CC_FOR_TARGET=${stdenv.cc}/bin/$CC + export CPP_FOR_TARGET=${stdenv.cc}/bin/$CPP + export LD_FOR_TARGET=${stdenv.cc.bintools}/bin/$LD + + # We define GENERATOR_FILE so nothing bothers looking for GNU GMP. + export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1' + + "$sourceRoot/../gcc/configure" ${lib.concatStringsSep " " gccConfigureFlags} + + # We remove the `libgcc.mvar` deps so that the bootstrap xgcc isn't built. + sed -e 's,libgcc.mvars:.*$,libgcc.mvars:,' -i Makefile + + make \ + config.h \ + libgcc.mvars \ + tconfig.h \ + tm.h \ + options.h \ + insn-constants.h \ + '' + + lib.optionalString stdenv.targetPlatform.isM68k '' + sysroot-suffix.h \ + '' + + lib.optionalString stdenv.targetPlatform.isAarch32 '' + arm-isa.h \ + arm-cpu.h \ + '' + + lib.optionalString stdenv.targetPlatform.isLoongArch64 '' + loongarch-multilib.h \ + '' + + '' + insn-modes.h + ) + mkdir -p "$buildRoot/gcc/include" + + # Preparing to configure + build libgcc itself + mkdir -p "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" + cd "$buildRoot/gcc/${stdenv.hostPlatform.config}/libgcc" + configureScript=$sourceRoot/configure + chmod +x "$configureScript" + + export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD + export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD + export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD + export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD + export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD + + export AS=${stdenv.cc}/bin/$AS + export CC=${stdenv.cc}/bin/$CC + export CPP=${stdenv.cc}/bin/$CPP + export CXX=${stdenv.cc}/bin/$CXX + export LD=${stdenv.cc.bintools}/bin/$LD + + export AS_FOR_TARGET=${stdenv.cc}/bin/$AS_FOR_TARGET + export CC_FOR_TARGET=${stdenv.cc}/bin/$CC_FOR_TARGET + export CPP_FOR_TARGET=${stdenv.cc}/bin/$CPP_FOR_TARGET + export LD_FOR_TARGET=${stdenv.cc.bintools}/bin/$LD_FOR_TARGET + ''; configurePlatforms = [ "build" diff --git a/pkgs/development/libraries/gcr/4.nix b/pkgs/development/libraries/gcr/4.nix index 34a0e67a3e3a..d3b1c1d9990d 100644 --- a/pkgs/development/libraries/gcr/4.nix +++ b/pkgs/development/libraries/gcr/4.nix @@ -60,18 +60,17 @@ stdenv.mkDerivation (finalAttrs: { shared-mime-info ]; - buildInputs = - [ - libgcrypt - libtasn1 - pango - libsecret - openssh - gtk4 - ] - ++ lib.optionals systemdSupport [ - systemd - ]; + buildInputs = [ + libgcrypt + libtasn1 + pango + libsecret + openssh + gtk4 + ] + ++ lib.optionals systemdSupport [ + systemd + ]; propagatedBuildInputs = [ glib @@ -87,14 +86,13 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonEnable "systemd" systemdSupport) "--cross-file=${ ini.generate "cross-file.conf" { - binaries = - { - ssh-add = "'${lib.getExe' openssh "ssh-add"}'"; - ssh-agent = "'${lib.getExe' openssh "ssh-agent"}'"; - } - // lib.optionalAttrs systemdSupport { - systemctl = "'${lib.getExe' systemd "systemctl"}'"; - }; + binaries = { + ssh-add = "'${lib.getExe' openssh "ssh-add"}'"; + ssh-agent = "'${lib.getExe' openssh "ssh-agent"}'"; + } + // lib.optionalAttrs systemdSupport { + systemctl = "'${lib.getExe' systemd "systemctl"}'"; + }; } }" ]; diff --git a/pkgs/development/libraries/gcr/default.nix b/pkgs/development/libraries/gcr/default.nix index 469db0714e66..220ffdd62d51 100644 --- a/pkgs/development/libraries/gcr/default.nix +++ b/pkgs/development/libraries/gcr/default.nix @@ -57,17 +57,16 @@ stdenv.mkDerivation rec { openssh ]; - buildInputs = - [ - libgcrypt - libtasn1 - pango - libsecret - openssh - ] - ++ lib.optionals (systemdSupport) [ - systemd - ]; + buildInputs = [ + libgcrypt + libtasn1 + pango + libsecret + openssh + ] + ++ lib.optionals (systemdSupport) [ + systemd + ]; propagatedBuildInputs = [ glib @@ -79,16 +78,15 @@ stdenv.mkDerivation rec { python3 ]; - mesonFlags = - [ - # We are still using ssh-agent from gnome-keyring. - # https://github.com/NixOS/nixpkgs/issues/140824 - "-Dssh_agent=false" - "-Dgpg_path=${lib.getBin gnupg}/bin/gpg" - ] - ++ lib.optionals (!systemdSupport) [ - "-Dsystemd=disabled" - ]; + mesonFlags = [ + # We are still using ssh-agent from gnome-keyring. + # https://github.com/NixOS/nixpkgs/issues/140824 + "-Dssh_agent=false" + "-Dgpg_path=${lib.getBin gnupg}/bin/gpg" + ] + ++ lib.optionals (!systemdSupport) [ + "-Dsystemd=disabled" + ]; doCheck = false; # fails 21 out of 603 tests, needs dbus daemon diff --git a/pkgs/development/libraries/gdcm/default.nix b/pkgs/development/libraries/gdcm/default.nix index cccc22ad439c..561bf5d697e7 100644 --- a/pkgs/development/libraries/gdcm/default.nix +++ b/pkgs/development/libraries/gdcm/default.nix @@ -29,62 +29,60 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-GuTxFgK5nfP4l36uqSOMrOkiwTi/T2ywcLh4LDNkKsI="; }; - patches = - [ - ./add-missing-losslylosslessarray-in-TestTransferSyntax.patch - # Fix vtk deprecated api, See https://docs.vtk.org/en/latest/release_details/9.3.html#id13. - # Upstream mailing list: https://sourceforge.net/p/gdcm/mailman/message/59197515. - ./fix-vtk-deprecated-api.patch - ] - ++ lib.optionals (lib.versionOlder vtk.version "9.3") [ - (fetchpatch2 { - url = "https://github.com/malaterre/GDCM/commit/3be6c2fa0945c91889bcf06e8c20e88f69692dd5.patch?full_index=1"; - hash = "sha256-Yt5f4mxhP5n+L0A/CRq3CxKCqUT7LZ8uKdbCf9P71Zc="; - revert = true; - }) - ]; + patches = [ + ./add-missing-losslylosslessarray-in-TestTransferSyntax.patch + # Fix vtk deprecated api, See https://docs.vtk.org/en/latest/release_details/9.3.html#id13. + # Upstream mailing list: https://sourceforge.net/p/gdcm/mailman/message/59197515. + ./fix-vtk-deprecated-api.patch + ] + ++ lib.optionals (lib.versionOlder vtk.version "9.3") [ + (fetchpatch2 { + url = "https://github.com/malaterre/GDCM/commit/3be6c2fa0945c91889bcf06e8c20e88f69692dd5.patch?full_index=1"; + hash = "sha256-Yt5f4mxhP5n+L0A/CRq3CxKCqUT7LZ8uKdbCf9P71Zc="; + revert = true; + }) + ]; - cmakeFlags = - [ - "-DGDCM_BUILD_APPLICATIONS=ON" - "-DGDCM_BUILD_SHARED_LIBS=ON" - "-DGDCM_BUILD_TESTING=ON" - "-DGDCM_USE_SYSTEM_EXPAT=ON" - "-DGDCM_USE_SYSTEM_ZLIB=ON" - "-DGDCM_USE_SYSTEM_UUID=ON" - "-DGDCM_USE_SYSTEM_OPENJPEG=ON" - # hack around usual "`RUNTIME_DESTINATION` must not be an absolute path" issue: - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - ] - ++ lib.optionals enableVTK [ - "-DGDCM_USE_VTK=ON" - ] - ++ lib.optionals enablePython [ - "-DGDCM_WRAP_PYTHON:BOOL=ON" - "-DGDCM_INSTALL_PYTHONMODULE_DIR=${placeholder "out"}/${python.sitePackages}/python_gdcm" - ]; + cmakeFlags = [ + "-DGDCM_BUILD_APPLICATIONS=ON" + "-DGDCM_BUILD_SHARED_LIBS=ON" + "-DGDCM_BUILD_TESTING=ON" + "-DGDCM_USE_SYSTEM_EXPAT=ON" + "-DGDCM_USE_SYSTEM_ZLIB=ON" + "-DGDCM_USE_SYSTEM_UUID=ON" + "-DGDCM_USE_SYSTEM_OPENJPEG=ON" + # hack around usual "`RUNTIME_DESTINATION` must not be an absolute path" issue: + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + ] + ++ lib.optionals enableVTK [ + "-DGDCM_USE_VTK=ON" + ] + ++ lib.optionals enablePython [ + "-DGDCM_WRAP_PYTHON:BOOL=ON" + "-DGDCM_INSTALL_PYTHONMODULE_DIR=${placeholder "out"}/${python.sitePackages}/python_gdcm" + ]; nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optional stdenv.hostPlatform.isDarwin DarwinTools; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin DarwinTools; - buildInputs = - [ - expat - libuuid - openjpeg - zlib - ] - ++ lib.optionals enableVTK [ - vtk - ] - ++ lib.optionals enablePython [ - swig - python - ]; + buildInputs = [ + expat + libuuid + openjpeg + zlib + ] + ++ lib.optionals enableVTK [ + vtk + ] + ++ lib.optionals enablePython [ + swig + python + ]; postInstall = lib.optionalString enablePython '' substitute \ @@ -93,24 +91,23 @@ stdenv.mkDerivation (finalAttrs: { --subst-var-by GDCM_VER "${finalAttrs.version}" ''; - disabledTests = - [ - # require networking: - "TestEcho" - "TestFind" - "gdcmscu-echo-dicomserver" - "gdcmscu-find-dicomserver" - # seemingly ought to be disabled when the test data submodule is not present: - "TestvtkGDCMImageReader2_3" - "TestSCUValidation" - # errors because 3 classes not wrapped: - "TestWrapPython" - # AttributeError: module 'gdcm' has no attribute 'UIDGenerator_SetRoot'; maybe a wrapping regression: - "TestUIDGeneratorPython" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ - "TestRescaler2" - ]; + disabledTests = [ + # require networking: + "TestEcho" + "TestFind" + "gdcmscu-echo-dicomserver" + "gdcmscu-find-dicomserver" + # seemingly ought to be disabled when the test data submodule is not present: + "TestvtkGDCMImageReader2_3" + "TestSCUValidation" + # errors because 3 classes not wrapped: + "TestWrapPython" + # AttributeError: module 'gdcm' has no attribute 'UIDGenerator_SetRoot'; maybe a wrapping regression: + "TestUIDGeneratorPython" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ + "TestRescaler2" + ]; nativeCheckInputs = [ ctestCheckHook diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index 741ba4644d82..d1bebbdbbb3c 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -30,14 +30,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "gdk-pixbuf"; version = "2.42.12"; - outputs = - [ - "out" - "dev" - "man" - ] - ++ lib.optional withIntrospection "devdoc" - ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests"; + outputs = [ + "out" + "dev" + "man" + ] + ++ lib.optional withIntrospection "devdoc" + ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests"; src = let @@ -62,26 +61,25 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - python3 - makeWrapper - glib + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + python3 + makeWrapper + glib - # for man pages - docutils - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ] - ++ lib.optionals withIntrospection [ - gi-docgen - gobject-introspection - ]; + # for man pages + docutils + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ] + ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection + ]; propagatedBuildInputs = [ glib @@ -90,16 +88,15 @@ stdenv.mkDerivation (finalAttrs: { libpng ]; - mesonFlags = - [ - "-Dgio_sniffing=false" - (lib.mesonBool "gtk_doc" withIntrospection) - (lib.mesonEnable "introspection" withIntrospection) - (lib.mesonEnable "others" true) - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "-Dbuiltin_loaders=all" - ]; + mesonFlags = [ + "-Dgio_sniffing=false" + (lib.mesonBool "gtk_doc" withIntrospection) + (lib.mesonEnable "introspection" withIntrospection) + (lib.mesonEnable "others" true) + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "-Dbuiltin_loaders=all" + ]; postPatch = '' chmod +x build-aux/* # patchShebangs only applies to executables @@ -118,25 +115,24 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace meson.build --replace-fail "'ani'," "" ''; - postInstall = - '' - # All except one utility seem to be only useful during building. - moveToOutput "bin" "$dev" - moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out" + postInstall = '' + # All except one utility seem to be only useful during building. + moveToOutput "bin" "$dev" + moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # meson erroneously installs loaders with .dylib extension on Darwin. - # Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them. - for f in $out/${finalAttrs.passthru.moduleDir}/*.dylib; do - install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f - mv $f ''${f%.dylib}.so - done - '' - + lib.optionalString withIntrospection '' - # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/ - ${stdenv.hostPlatform.emulator buildPackages} $dev/bin/gdk-pixbuf-query-loaders --update-cache - ''; + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # meson erroneously installs loaders with .dylib extension on Darwin. + # Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them. + for f in $out/${finalAttrs.passthru.moduleDir}/*.dylib; do + install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f + mv $f ''${f%.dylib}.so + done + '' + + lib.optionalString withIntrospection '' + # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/ + ${stdenv.hostPlatform.emulator buildPackages} $dev/bin/gdk-pixbuf-query-loaders --update-cache + ''; # The fixDarwinDylibNames hook doesn't patch binaries. preFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' diff --git a/pkgs/development/libraries/gecode/default.nix b/pkgs/development/libraries/gecode/default.nix index 078d21d87c6a..37ae45e5de68 100644 --- a/pkgs/development/libraries/gecode/default.nix +++ b/pkgs/development/libraries/gecode/default.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation rec { perl gmp mpfr - ] ++ lib.optional enableGist qtbase; + ] + ++ lib.optional enableGist qtbase; meta = with lib; { license = licenses.mit; diff --git a/pkgs/development/libraries/gegl/default.nix b/pkgs/development/libraries/gegl/default.nix index 044a8de95888..b010281d4891 100644 --- a/pkgs/development/libraries/gegl/default.nix +++ b/pkgs/development/libraries/gegl/default.nix @@ -61,32 +61,31 @@ stdenv.mkDerivation (finalAttrs: { gi-docgen ]; - buildInputs = - [ - libpng - cairo - libjpeg - librsvg - lensfun - libspiro - maxflow - netsurf.libnsgif - pango - poly2tri-c - poppler - bzip2 - libraw - libwebp - gexiv2 - openexr - suitesparse - ] - ++ lib.optionals stdenv.cc.isClang [ - llvmPackages.openmp - ] - ++ lib.optionals withLuaJIT [ - luajit - ]; + buildInputs = [ + libpng + cairo + libjpeg + librsvg + lensfun + libspiro + maxflow + netsurf.libnsgif + pango + poly2tri-c + poppler + bzip2 + libraw + libwebp + gexiv2 + openexr + suitesparse + ] + ++ lib.optionals stdenv.cc.isClang [ + llvmPackages.openmp + ] + ++ lib.optionals withLuaJIT [ + luajit + ]; # for gegl-4.0.pc propagatedBuildInputs = [ @@ -95,21 +94,20 @@ stdenv.mkDerivation (finalAttrs: { babl ]; - mesonFlags = - [ - "-Dmrg=disabled" # not sure what that is - "-Dsdl2=disabled" - "-Dpygobject=disabled" - "-Dlibav=disabled" - "-Dlibv4l=disabled" - "-Dlibv4l2=disabled" - # Disabled due to multiple vulnerabilities, see - # https://github.com/NixOS/nixpkgs/pull/73586 - "-Djasper=disabled" - ] - ++ lib.optionals (!withLuaJIT) [ - "-Dlua=disabled" - ]; + mesonFlags = [ + "-Dmrg=disabled" # not sure what that is + "-Dsdl2=disabled" + "-Dpygobject=disabled" + "-Dlibav=disabled" + "-Dlibv4l=disabled" + "-Dlibv4l2=disabled" + # Disabled due to multiple vulnerabilities, see + # https://github.com/NixOS/nixpkgs/pull/73586 + "-Djasper=disabled" + ] + ++ lib.optionals (!withLuaJIT) [ + "-Dlua=disabled" + ]; postPatch = '' chmod +x tests/opencl/opencl_test.sh diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index e43e44c5ff35..4aee6ac9d3bf 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -36,47 +36,45 @@ stdenv.mkDerivation rec { LDFLAGS = lib.optionalString stdenv.hostPlatform.isSunOS "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec"; - configureFlags = - [ - "--disable-csharp" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # On cross building, gettext supposes that the wchar.h from libc - # does not fulfill gettext needs, so it tries to work with its - # own wchar.h file, which does not cope well with the system's - # wchar.h and stddef.h (gcc-4.3 - glibc-2.9) - "gl_cv_func_wcwidth_works=yes" - ]; + configureFlags = [ + "--disable-csharp" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # On cross building, gettext supposes that the wchar.h from libc + # does not fulfill gettext needs, so it tries to work with its + # own wchar.h file, which does not cope well with the system's + # wchar.h and stddef.h (gcc-4.3 - glibc-2.9) + "gl_cv_func_wcwidth_works=yes" + ]; - postPatch = - '' - # Older versions of gettext come with a copy of `extern-inline.m4` that is not compatible with clang 18. - # When a project uses gettext + autoreconfPhase, autoreconfPhase will invoke `autopoint -f`, which will - # replace whatever (probably compatible) version of `extern-inline.m4` with one that probalby won’t work - # because `autopoint` will copy the autoconf macros from the project’s required version of gettext. - # Fixing this requires replacing all the older copies of the problematic file with a new one. - # - # This is ugly, but it avoids requiring workarounds in every package using gettext and autoreconfPhase. - declare -a oldFiles=($(tar tf gettext-tools/misc/archive.dir.tar | grep '^gettext-0\.[19].*/extern-inline.m4')) - oldFilesDir=$(mktemp -d) - for oldFile in "''${oldFiles[@]}"; do - mkdir -p "$oldFilesDir/$(dirname "$oldFile")" - cp -a gettext-tools/gnulib-m4/extern-inline.m4 "$oldFilesDir/$oldFile" - done - tar uf gettext-tools/misc/archive.dir.tar --owner=0 --group=0 --numeric-owner -C "$oldFilesDir" "''${oldFiles[@]}" + postPatch = '' + # Older versions of gettext come with a copy of `extern-inline.m4` that is not compatible with clang 18. + # When a project uses gettext + autoreconfPhase, autoreconfPhase will invoke `autopoint -f`, which will + # replace whatever (probably compatible) version of `extern-inline.m4` with one that probalby won’t work + # because `autopoint` will copy the autoconf macros from the project’s required version of gettext. + # Fixing this requires replacing all the older copies of the problematic file with a new one. + # + # This is ugly, but it avoids requiring workarounds in every package using gettext and autoreconfPhase. + declare -a oldFiles=($(tar tf gettext-tools/misc/archive.dir.tar | grep '^gettext-0\.[19].*/extern-inline.m4')) + oldFilesDir=$(mktemp -d) + for oldFile in "''${oldFiles[@]}"; do + mkdir -p "$oldFilesDir/$(dirname "$oldFile")" + cp -a gettext-tools/gnulib-m4/extern-inline.m4 "$oldFilesDir/$oldFile" + done + tar uf gettext-tools/misc/archive.dir.tar --owner=0 --group=0 --numeric-owner -C "$oldFilesDir" "''${oldFiles[@]}" - substituteAllInPlace gettext-runtime/src/gettext.sh.in - substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd - substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd - substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd - '' - + lib.optionalString stdenv.hostPlatform.isCygwin '' - sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in - sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in - '' - + lib.optionalString stdenv.hostPlatform.isMinGW '' - sed -i "s/@GNULIB_CLOSE@/1/" */*/unistd.in.h - ''; + substituteAllInPlace gettext-runtime/src/gettext.sh.in + substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd + substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd + substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd + '' + + lib.optionalString stdenv.hostPlatform.isCygwin '' + sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in + sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in + '' + + lib.optionalString stdenv.hostPlatform.isMinGW '' + sed -i "s/@GNULIB_CLOSE@/1/" */*/unistd.in.h + ''; strictDeps = true; nativeBuildInputs = [ @@ -95,16 +93,15 @@ stdenv.mkDerivation rec { ../../../build-support/setup-hooks/role.bash ./gettext-setup-hook.sh ]; - env = - { - gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl; - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - # macOS iconv implementation is slightly broken since Sonoma - # https://github.com/Homebrew/homebrew-core/pull/199639 - # https://savannah.gnu.org/bugs/index.php?66541 - am_cv_func_iconv_works = "yes"; - }; + env = { + gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # macOS iconv implementation is slightly broken since Sonoma + # https://github.com/Homebrew/homebrew-core/pull/199639 + # https://savannah.gnu.org/bugs/index.php?66541 + am_cv_func_iconv_works = "yes"; + }; enableParallelBuilding = true; enableParallelChecking = false; # fails sometimes diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix index 64b79757ccf5..364f51b4b2e8 100644 --- a/pkgs/development/libraries/glew/default.nix +++ b/pkgs/development/libraries/glew/default.nix @@ -54,7 +54,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeDir = "cmake"; cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" - ] ++ lib.optional enableEGL "-DGLEW_EGL=ON"; + ] + ++ lib.optional enableEGL "-DGLEW_EGL=ON"; postInstall = '' moveToOutput lib/cmake "''${!outputDev}" diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index e4b9d66f7dd0..13dc59fd2a7a 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -64,146 +64,143 @@ stdenv.mkDerivation ( enableParallelBuilding = true; - patches = - [ - /* - No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping. - $ git fetch --all -p && git checkout origin/release/2.40/master && git describe - glibc-2.40-66-g7d4b6bcae9 - $ git show --minimal --reverse glibc-2.40.. ':!ADVISORIES' > 2.40-master.patch - - To compare the archive contents zdiff can be used. - $ diff -u 2.40-master.patch ../nixpkgs/pkgs/development/libraries/glibc/2.40-master.patch - - Please note that each commit has changes to the file ADVISORIES excluded since - that conflicts with the directory advisories/ making cross-builds from - hosts with case-insensitive file-systems impossible. - */ - ./2.40-master.patch - - # Allow NixOS and Nix to handle the locale-archive. - ./nix-locale-archive.patch - - # Don't use /etc/ld.so.cache, for non-NixOS systems. - ./dont-use-system-ld-so-cache.patch - - # Don't use /etc/ld.so.preload, but /etc/ld-nix.so.preload. - ./dont-use-system-ld-so-preload.patch - - /* - The command "getconf CS_PATH" returns the default search path - "/bin:/usr/bin", which is inappropriate on NixOS machines. This - patch extends the search path by "/run/current-system/sw/bin". - */ - ./fix_path_attribute_in_getconf.patch - - ./fix-x64-abi.patch - - # https://github.com/NixOS/nixpkgs/pull/137601 - ./nix-nss-open-files.patch - - ./0001-Revert-Remove-all-usage-of-BASH-or-BASH-in-installed.patch - - /* - Patch derived from archlinux, - https://gitlab.archlinux.org/archlinux/packaging/packages/glibc/-/blob/e54d98e2d1aae4930ecad9404ef12234922d9dfd/reenable_DT_HASH.patch - - See also https://github.com/ValveSoftware/Proton/issues/6051 - & https://github.com/NixOS/nixpkgs/pull/188492#issuecomment-1233802991 - */ - ./reenable_DT_HASH.patch - ] + patches = [ /* - NVCC does not support ARM intrinsics. Since is pulled in by almost - every HPC piece of software, without this patch CUDA compilation on ARM - is effectively broken. See - https://forums.developer.nvidia.com/t/nvcc-fails-to-build-with-arm-neon-instructions-cpp-vs-cu/248355/2. + No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping. + $ git fetch --all -p && git checkout origin/release/2.40/master && git describe + glibc-2.40-66-g7d4b6bcae9 + $ git show --minimal --reverse glibc-2.40.. ':!ADVISORIES' > 2.40-master.patch + + To compare the archive contents zdiff can be used. + $ diff -u 2.40-master.patch ../nixpkgs/pkgs/development/libraries/glibc/2.40-master.patch + + Please note that each commit has changes to the file ADVISORIES excluded since + that conflicts with the directory advisories/ making cross-builds from + hosts with case-insensitive file-systems impossible. */ - ++ ( - let - isAarch64 = stdenv.buildPlatform.isAarch64 || stdenv.hostPlatform.isAarch64; - isLinux = stdenv.buildPlatform.isLinux || stdenv.hostPlatform.isLinux; - in - # Remove certain defines when __CUDACC__ is defined (i.e. we're building with a CUDA compiler) - lib.optional (isAarch64 && isLinux) ./0001-aarch64-math-vector.h-add-NVCC-include-guard.patch - ) - # Modify certain defines to be compatible with musl - ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch - # Enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) - ++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch - # Reverts this patch: https://sourceware.org/git/?p=glibc.git;a=commit;h=55d63e731253de82e96ed4ddca2e294076cd0bc5 - # This revert enables [CET] (Control-flow Enforcement Technology) by default - # [CET]: https://en.wikipedia.org/wiki/Control-flow_integrity#Intel_Control-flow_Enforcement_Technology - ++ lib.optional enableCETRuntimeDefault ./2.39-revert-cet-default-disable.patch; + ./2.40-master.patch - postPatch = - '' - # Needed for glibc to build with the gnumake 3.82 - # http://comments.gmane.org/gmane.linux.lfs.support/31227 - sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile + # Allow NixOS and Nix to handle the locale-archive. + ./nix-locale-archive.patch - # nscd needs libgcc, and we don't want it dynamically linked - # because we don't want it to depend on bootstrap-tools libs. - echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile + # Don't use /etc/ld.so.cache, for non-NixOS systems. + ./dont-use-system-ld-so-cache.patch - # Ensure that `__nss_files_fopen` can still be wrapped by `libredirect`. - sed -i -e '/libc_hidden_def (__nss_files_fopen)/d' nss/nss_files_fopen.c - sed -i -e '/libc_hidden_proto (__nss_files_fopen)/d' include/nss_files.h - '' - # FIXME: find a solution for infinite recursion in cross builds. - # For now it's hopefully acceptable that IDN from libc doesn't reliably work. - + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + # Don't use /etc/ld.so.preload, but /etc/ld-nix.so.preload. + ./dont-use-system-ld-so-preload.patch - # Ensure that libidn2 is found. - patch -p 1 < is pulled in by almost + every HPC piece of software, without this patch CUDA compilation on ARM + is effectively broken. See + https://forums.developer.nvidia.com/t/nvcc-fails-to-build-with-arm-neon-instructions-cpp-vs-cu/248355/2. + */ + ++ ( + let + isAarch64 = stdenv.buildPlatform.isAarch64 || stdenv.hostPlatform.isAarch64; + isLinux = stdenv.buildPlatform.isLinux || stdenv.hostPlatform.isLinux; + in + # Remove certain defines when __CUDACC__ is defined (i.e. we're building with a CUDA compiler) + lib.optional (isAarch64 && isLinux) ./0001-aarch64-math-vector.h-add-NVCC-include-guard.patch + ) + # Modify certain defines to be compatible with musl + ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch + # Enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) + ++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch + # Reverts this patch: https://sourceware.org/git/?p=glibc.git;a=commit;h=55d63e731253de82e96ed4ddca2e294076cd0bc5 + # This revert enables [CET] (Control-flow Enforcement Technology) by default + # [CET]: https://en.wikipedia.org/wiki/Control-flow_integrity#Intel_Control-flow_Enforcement_Technology + ++ lib.optional enableCETRuntimeDefault ./2.39-revert-cet-default-disable.patch; + + postPatch = '' + # Needed for glibc to build with the gnumake 3.82 + # http://comments.gmane.org/gmane.linux.lfs.support/31227 + sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile + + # nscd needs libgcc, and we don't want it dynamically linked + # because we don't want it to depend on bootstrap-tools libs. + echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile + + # Ensure that `__nss_files_fopen` can still be wrapped by `libredirect`. + sed -i -e '/libc_hidden_def (__nss_files_fopen)/d' nss/nss_files_fopen.c + sed -i -e '/libc_hidden_proto (__nss_files_fopen)/d' include/nss_files.h + '' + # FIXME: find a solution for infinite recursion in cross builds. + # For now it's hopefully acceptable that IDN from libc doesn't reliably work. + + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + + # Ensure that libidn2 is found. + patch -p 1 < config.cache << "EOF" - libc_cv_forced_unwind=yes - libc_cv_c_cleanup=yes - libc_cv_gnu89_inline=yes - EOF + cat > config.cache << "EOF" + libc_cv_forced_unwind=yes + libc_cv_c_cleanup=yes + libc_cv_gnu89_inline=yes + EOF - # ./configure has logic like - # - # AR=`$CC -print-prog-name=ar` - # - # This searches various directories in the gcc and its wrapper. In nixpkgs, - # this returns the bare string "ar", which is build ar. This can result as - # a build failure with the following message: - # - # libc_pic.a: error adding symbols: archive has no index; run ranlib to add one - # - # (Observed cross compiling from aarch64-linux -> armv7l-linux). - # - # Nixpkgs passes a correct value for AR and friends, so to use the correct - # set of tools, we only need to delete this special handling. - sed -i \ - -e '/^AR=/d' \ - -e '/^AS=/d' \ - -e '/^LD=/d' \ - -e '/^OBJCOPY=/d' \ - -e '/^OBJDUMP=/d' \ - $configureScript - ''; + # ./configure has logic like + # + # AR=`$CC -print-prog-name=ar` + # + # This searches various directories in the gcc and its wrapper. In nixpkgs, + # this returns the bare string "ar", which is build ar. This can result as + # a build failure with the following message: + # + # libc_pic.a: error adding symbols: archive has no index; run ranlib to add one + # + # (Observed cross compiling from aarch64-linux -> armv7l-linux). + # + # Nixpkgs passes a correct value for AR and friends, so to use the correct + # set of tools, we only need to delete this special handling. + sed -i \ + -e '/^AR=/d' \ + -e '/^AS=/d' \ + -e '/^LD=/d' \ + -e '/^OBJCOPY=/d' \ + -e '/^OBJDUMP=/d' \ + $configureScript + ''; preBuild = lib.optionalString withGd "unset NIX_DONT_SET_RPATH"; diff --git a/pkgs/development/libraries/gmime/2.nix b/pkgs/development/libraries/gmime/2.nix index 313a2a8f1c51..34bd141d06ec 100644 --- a/pkgs/development/libraries/gmime/2.nix +++ b/pkgs/development/libraries/gmime/2.nix @@ -33,11 +33,10 @@ stdenv.mkDerivation rec { zlib libgpg-error ]; - configureFlags = - [ - "--enable-introspection=yes" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; + configureFlags = [ + "--enable-introspection=yes" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; postPatch = '' substituteInPlace tests/testsuite.c \ diff --git a/pkgs/development/libraries/gmime/3.nix b/pkgs/development/libraries/gmime/3.nix index f21dd724c95e..cc3fde7bfb99 100644 --- a/pkgs/development/libraries/gmime/3.nix +++ b/pkgs/development/libraries/gmime/3.nix @@ -41,34 +41,31 @@ stdenv.mkDerivation rec { vala # for share/vala/Makefile.vapigen ]; propagatedBuildInputs = [ glib ]; - configureFlags = - [ - "--enable-introspection=yes" - "--enable-vala=yes" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; + configureFlags = [ + "--enable-introspection=yes" + "--enable-vala=yes" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; - postPatch = - '' - substituteInPlace tests/testsuite.c \ - --replace /bin/rm rm - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # This specific test fails on darwin for some unknown reason - substituteInPlace tests/test-filters.c \ - --replace-fail 'test_charset_conversion (datadir, "japanese", "utf-8", "iso-2022-jp");' "" - ''; + postPatch = '' + substituteInPlace tests/testsuite.c \ + --replace /bin/rm rm + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # This specific test fails on darwin for some unknown reason + substituteInPlace tests/test-filters.c \ + --replace-fail 'test_charset_conversion (datadir, "japanese", "utf-8", "iso-2022-jp");' "" + ''; - preConfigure = - '' - PKG_CONFIG_VAPIGEN_VAPIGEN="$(type -p vapigen)" - export PKG_CONFIG_VAPIGEN_VAPIGEN - '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - cp ${ - if stdenv.hostPlatform.isMusl then ./musl-iconv-detect.h else ./iconv-detect.h - } ./iconv-detect.h - ''; + preConfigure = '' + PKG_CONFIG_VAPIGEN_VAPIGEN="$(type -p vapigen)" + export PKG_CONFIG_VAPIGEN_VAPIGEN + '' + + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + cp ${ + if stdenv.hostPlatform.isMusl then ./musl-iconv-detect.h else ./iconv-detect.h + } ./iconv-detect.h + ''; nativeCheckInputs = [ gnupg ]; diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix index 2e3fdc532059..ee787dc45ef0 100644 --- a/pkgs/development/libraries/gmp/6.x.nix +++ b/pkgs/development/libraries/gmp/6.x.nix @@ -45,27 +45,26 @@ let depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ m4 ]; - configureFlags = - [ - "--with-pic" - (lib.enableFeature cxx "cxx") - # Build a "fat binary", with routines for several sub-architectures - # (x86), except on Solaris where some tests crash with "Memory fault". - # See , for instance. - # - # no darwin because gmp uses ASM that clang doesn't like - (lib.enableFeature (!stdenv.hostPlatform.isSunOS && stdenv.hostPlatform.isx86) "fat") - # The config.guess in GMP tries to runtime-detect various - # ARM optimization flags via /proc/cpuinfo (and is also - # broken on multicore CPUs). Avoid this impurity. - "--build=${stdenv.buildPlatform.config}" - ] - ++ optional (cxx && stdenv.hostPlatform.isDarwin) "CPPFLAGS=-fexceptions" - ++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.is64bit) "ABI=64" - # to build a .dll on windows, we need --disable-static + --enable-shared - # see https://gmplib.org/manual/Notes-for-Particular-Systems.html - ++ optional (!withStatic && stdenv.hostPlatform.isWindows) "--disable-static --enable-shared" - ++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "--disable-assembly"; + configureFlags = [ + "--with-pic" + (lib.enableFeature cxx "cxx") + # Build a "fat binary", with routines for several sub-architectures + # (x86), except on Solaris where some tests crash with "Memory fault". + # See , for instance. + # + # no darwin because gmp uses ASM that clang doesn't like + (lib.enableFeature (!stdenv.hostPlatform.isSunOS && stdenv.hostPlatform.isx86) "fat") + # The config.guess in GMP tries to runtime-detect various + # ARM optimization flags via /proc/cpuinfo (and is also + # broken on multicore CPUs). Avoid this impurity. + "--build=${stdenv.buildPlatform.config}" + ] + ++ optional (cxx && stdenv.hostPlatform.isDarwin) "CPPFLAGS=-fexceptions" + ++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.is64bit) "ABI=64" + # to build a .dll on windows, we need --disable-static + --enable-shared + # see https://gmplib.org/manual/Notes-for-Particular-Systems.html + ++ optional (!withStatic && stdenv.hostPlatform.isWindows) "--disable-static --enable-shared" + ++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "--disable-assembly"; doCheck = true; # not cross; diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix index 5d3ff4170d5d..0d1ee2adcb02 100644 --- a/pkgs/development/libraries/gnutls/default.nix +++ b/pkgs/development/libraries/gnutls/default.nix @@ -66,16 +66,15 @@ stdenv.mkDerivation rec { hash = "sha256-aeET2ALRZwxNWsG5kECx8tXHwF2uxQA4E8BJtRhIIO0="; }; - outputs = - [ - "bin" - "dev" - "out" - ] - ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ - "man" - "devdoc" - ]; + outputs = [ + "bin" + "dev" + "out" + ] + ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ + "man" + "devdoc" + ]; # Not normally useful docs. outputInfo = "devdoc"; @@ -92,19 +91,18 @@ stdenv.mkDerivation rec { # - psk-file: no idea; it broke between 3.6.3 and 3.6.4 # - ktls: requires tls module loaded into kernel # Change p11-kit test to use pkg-config to find p11-kit - postPatch = - '' - sed '2iexit 77' -i tests/{pkgconfig,fastopen}.sh - sed '/^void doit(void)/,/^{/ s/{/{ exit(77);/' -i tests/{trust-store,psk-file}.c - sed 's:/usr/lib64/pkcs11/ /usr/lib/pkcs11/ /usr/lib/x86_64-linux-gnu/pkcs11/:`pkg-config --variable=p11_module_path p11-kit-1`:' -i tests/p11-kit-trust.sh - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - # See https://gitlab.com/gnutls/gnutls/-/issues/945 - sed '2iecho "certtool tests skipped in musl build"\nexit 0' -i tests/cert-tests/certtool.sh - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - sed '2iexit 77' -i tests/{ktls,ktls_keyupdate}.sh - ''; + postPatch = '' + sed '2iexit 77' -i tests/{pkgconfig,fastopen}.sh + sed '/^void doit(void)/,/^{/ s/{/{ exit(77);/' -i tests/{trust-store,psk-file}.c + sed 's:/usr/lib64/pkcs11/ /usr/lib/pkcs11/ /usr/lib/x86_64-linux-gnu/pkcs11/:`pkg-config --variable=p11_module_path p11-kit-1`:' -i tests/p11-kit-trust.sh + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + # See https://gitlab.com/gnutls/gnutls/-/issues/945 + sed '2iecho "certtool tests skipped in musl build"\nexit 0' -i tests/cert-tests/certtool.sh + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + sed '2iexit 77' -i tests/{ktls,ktls_keyupdate}.sh + ''; preConfigure = "patchShebangs ."; configureFlags = @@ -137,35 +135,33 @@ stdenv.mkDerivation rec { hardeningDisable = [ "trivialautovarinit" ]; - buildInputs = - [ - libtasn1 - libidn2 - zlib - gmp - libunistring - unbound - gettext - libiconv - ] - ++ lib.optional withP11-kit p11-kit - ++ lib.optional (tpmSupport && stdenv.hostPlatform.isLinux) trousers; + buildInputs = [ + libtasn1 + libidn2 + zlib + gmp + libunistring + unbound + gettext + libiconv + ] + ++ lib.optional withP11-kit p11-kit + ++ lib.optional (tpmSupport && stdenv.hostPlatform.isLinux) trousers; - nativeBuildInputs = - [ - perl - pkg-config - texinfo - ] - ++ [ - autoconf - automake - ] - ++ lib.optionals doCheck [ - which - net-tools - util-linux - ]; + nativeBuildInputs = [ + perl + pkg-config + texinfo + ] + ++ [ + autoconf + automake + ] + ++ lib.optionals doCheck [ + which + net-tools + util-linux + ]; propagatedBuildInputs = [ nettle ]; diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix index 379560c263ea..47ebfb1e3e0e 100644 --- a/pkgs/development/libraries/gobject-introspection/default.nix +++ b/pkgs/development/libraries/gobject-introspection/default.nix @@ -60,48 +60,46 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-lFtX2n7CYuXCZrieCR0UvoAMxCQnfYKgKHK315SoR3k="; }; - patches = - [ - # Make g-ir-scanner put absolute path to GIR files it generates - # so that programs can just dlopen them without having to muck - # with LD_LIBRARY_PATH environment variable. - (replaceVars ./absolute_shlib_path.patch { - inherit nixStoreDir; - }) + patches = [ + # Make g-ir-scanner put absolute path to GIR files it generates + # so that programs can just dlopen them without having to muck + # with LD_LIBRARY_PATH environment variable. + (replaceVars ./absolute_shlib_path.patch { + inherit nixStoreDir; + }) - # Fix getter heuristics regression - # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/529 - ./0001-scanner-Prefer-some-getters-over-others.patch - ] - ++ lib.optionals x11Support [ - # Hardcode the cairo shared library path in the Cairo gir shipped with this package. - # https://github.com/NixOS/nixpkgs/issues/34080 - (replaceVars ./absolute_gir_path.patch { - cairoLib = "${lib.getLib cairo}/lib"; - # original source code in patch's context - CAIRO_GIR_PACKAGE = null; - CAIRO_SHARED_LIBRARY = null; - }) - ]; + # Fix getter heuristics regression + # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/529 + ./0001-scanner-Prefer-some-getters-over-others.patch + ] + ++ lib.optionals x11Support [ + # Hardcode the cairo shared library path in the Cairo gir shipped with this package. + # https://github.com/NixOS/nixpkgs/issues/34080 + (replaceVars ./absolute_gir_path.patch { + cairoLib = "${lib.getLib cairo}/lib"; + # original source code in patch's context + CAIRO_GIR_PACKAGE = null; + CAIRO_SHARED_LIBRARY = null; + }) + ]; strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - flex - bison - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_45 - # Build definition checks for the Python modules needed at runtime by importing them. - (buildPackages.python3.withPackages pythonModules) - finalAttrs.setupHook # move .gir files - # can't use canExecute, we need prebuilt when cross - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ gobject-introspection-unwrapped ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + flex + bison + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_45 + # Build definition checks for the Python modules needed at runtime by importing them. + (buildPackages.python3.withPackages pythonModules) + finalAttrs.setupHook # move .gir files + # can't use canExecute, we need prebuilt when cross + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ gobject-introspection-unwrapped ]; buildInputs = [ (python3.withPackages pythonModules) @@ -116,30 +114,29 @@ stdenv.mkDerivation (finalAttrs: { (if propagateFullGlib then glib else glib') ]; - mesonFlags = - [ - "--datadir=${placeholder "dev"}/share" - "-Dcairo=disabled" - "-Dgtk_doc=${lib.boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}" - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "-Dgi_cross_ldd_wrapper=${ - replaceVarsWith { - name = "g-ir-scanner-lddwrapper"; - isExecutable = true; - src = ./wrappers/g-ir-scanner-lddwrapper.sh; - replacements = { - inherit (buildPackages) bash; - buildlddtree = "${buildPackages.pax-utils}/bin/lddtree"; - }; - } - }" - "-Dgi_cross_binary_wrapper=${stdenv.hostPlatform.emulator buildPackages}" - # can't use canExecute, we need prebuilt when cross - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Dgi_cross_use_prebuilt_gi=true" - ]; + mesonFlags = [ + "--datadir=${placeholder "dev"}/share" + "-Dcairo=disabled" + "-Dgtk_doc=${lib.boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}" + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "-Dgi_cross_ldd_wrapper=${ + replaceVarsWith { + name = "g-ir-scanner-lddwrapper"; + isExecutable = true; + src = ./wrappers/g-ir-scanner-lddwrapper.sh; + replacements = { + inherit (buildPackages) bash; + buildlddtree = "${buildPackages.pax-utils}/bin/lddtree"; + }; + } + }" + "-Dgi_cross_binary_wrapper=${stdenv.hostPlatform.emulator buildPackages}" + # can't use canExecute, we need prebuilt when cross + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Dgi_cross_use_prebuilt_gi=true" + ]; doCheck = !stdenv.hostPlatform.isAarch64; diff --git a/pkgs/development/libraries/gobject-introspection/wrapper.nix b/pkgs/development/libraries/gobject-introspection/wrapper.nix index a89963ea2f43..3e83fd7eba50 100644 --- a/pkgs/development/libraries/gobject-introspection/wrapper.nix +++ b/pkgs/development/libraries/gobject-introspection/wrapper.nix @@ -46,52 +46,51 @@ then }; dontStrip = true; depsTargetTargetPropagated = [ overridenTargetUnwrappedGir ]; - buildCommand = - '' - eval fixupPhase - ${lib.concatMapStrings (output: '' - mkdir -p ${"$" + "${output}"} - ${lib.getExe buildPackages.xorg.lndir} ${overriddenUnwrappedGir.${output}} ${"$" + "${output}"} - '') overriddenUnwrappedGir.outputs} + buildCommand = '' + eval fixupPhase + ${lib.concatMapStrings (output: '' + mkdir -p ${"$" + "${output}"} + ${lib.getExe buildPackages.xorg.lndir} ${overriddenUnwrappedGir.${output}} ${"$" + "${output}"} + '') overriddenUnwrappedGir.outputs} - cp $dev/bin/g-ir-compiler $dev/bin/.g-ir-compiler-wrapped - cp $dev/bin/g-ir-scanner $dev/bin/.g-ir-scanner-wrapped + cp $dev/bin/g-ir-compiler $dev/bin/.g-ir-compiler-wrapped + cp $dev/bin/g-ir-scanner $dev/bin/.g-ir-scanner-wrapped - ( - rm "$dev/bin/g-ir-compiler" - rm "$dev/bin/g-ir-scanner" - export bash="${buildPackages.bash}" - export emulator=${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)} - export emulatorwrapper="$dev/bin/g-ir-scanner-qemuwrapper" - export buildlddtree="${buildPackages.pax-utils}/bin/lddtree" + ( + rm "$dev/bin/g-ir-compiler" + rm "$dev/bin/g-ir-scanner" + export bash="${buildPackages.bash}" + export emulator=${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)} + export emulatorwrapper="$dev/bin/g-ir-scanner-qemuwrapper" + export buildlddtree="${buildPackages.pax-utils}/bin/lddtree" - export targetgir="${lib.getDev overridenTargetUnwrappedGir}" + export targetgir="${lib.getDev overridenTargetUnwrappedGir}" - substituteAll "${./wrappers/g-ir-compiler.sh}" "$dev/bin/g-ir-compiler" - substituteAll "${./wrappers/g-ir-scanner.sh}" "$dev/bin/g-ir-scanner" - substituteAll "${./wrappers/g-ir-scanner-lddwrapper.sh}" "$dev/bin/g-ir-scanner-lddwrapper" - substituteAll "${./wrappers/g-ir-scanner-qemuwrapper.sh}" "$dev/bin/g-ir-scanner-qemuwrapper" - chmod +x $dev/bin/g-ir-compiler - chmod +x $dev/bin/g-ir-scanner* - ) - '' - # when cross-compiling and using the wrapper then when a package looks up the g_ir_X - # variable with pkg-config they'll get the host version which can't be run - # override the variable to use the absolute path to g_ir_X in PATH which can be run - + '' - cat >> $dev/nix-support/setup-hook <<-'EOF' - override-pkg-config-gir-variables() { - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_SCANNER="$(type -p g-ir-scanner)" - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_COMPILER="$(type -p g-ir-compiler)" - PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_GENERATE="$(type -p g-ir-generate)" - export PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_SCANNER - export PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_COMPILER - export PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_GENERATE - } + substituteAll "${./wrappers/g-ir-compiler.sh}" "$dev/bin/g-ir-compiler" + substituteAll "${./wrappers/g-ir-scanner.sh}" "$dev/bin/g-ir-scanner" + substituteAll "${./wrappers/g-ir-scanner-lddwrapper.sh}" "$dev/bin/g-ir-scanner-lddwrapper" + substituteAll "${./wrappers/g-ir-scanner-qemuwrapper.sh}" "$dev/bin/g-ir-scanner-qemuwrapper" + chmod +x $dev/bin/g-ir-compiler + chmod +x $dev/bin/g-ir-scanner* + ) + '' + # when cross-compiling and using the wrapper then when a package looks up the g_ir_X + # variable with pkg-config they'll get the host version which can't be run + # override the variable to use the absolute path to g_ir_X in PATH which can be run + + '' + cat >> $dev/nix-support/setup-hook <<-'EOF' + override-pkg-config-gir-variables() { + PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_SCANNER="$(type -p g-ir-scanner)" + PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_COMPILER="$(type -p g-ir-compiler)" + PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_GENERATE="$(type -p g-ir-generate)" + export PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_SCANNER + export PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_COMPILER + export PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_G_IR_GENERATE + } - preConfigureHooks+=(override-pkg-config-gir-variables) - EOF - ''; + preConfigureHooks+=(override-pkg-config-gir-variables) + EOF + ''; }) else overriddenUnwrappedGir.overrideAttrs (previousAttrs: { diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index 5de186e4217f..383e6e2184c4 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -56,7 +56,8 @@ stdenv.mkDerivation rec { libassuan libgpg-error pth - ] ++ lib.optionals (qtbase != null) [ qtbase ]; + ] + ++ lib.optionals (qtbase != null) [ qtbase ]; nativeCheckInputs = [ which ]; @@ -64,17 +65,16 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; - configureFlags = - [ - "--enable-fixed-path=${gnupg}/bin" - "--with-libgpg-error-prefix=${libgpg-error.dev}" - "--with-libassuan-prefix=${libassuan.dev}" - ] - # Tests will try to communicate with gpg-agent instance via a UNIX socket - # which has a path length limit. Nix on darwin is using a build directory - # that already has quite a long path and the resulting socket path doesn't - # fit in the limit. https://github.com/NixOS/nix/pull/1085 - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-gpg-test" ]; + configureFlags = [ + "--enable-fixed-path=${gnupg}/bin" + "--with-libgpg-error-prefix=${libgpg-error.dev}" + "--with-libassuan-prefix=${libassuan.dev}" + ] + # Tests will try to communicate with gpg-agent instance via a UNIX socket + # which has a path length limit. Nix on darwin is using a build directory + # that already has quite a long path and the resulting socket path doesn't + # fit in the limit. https://github.com/NixOS/nix/pull/1085 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-gpg-test" ]; env.NIX_CFLAGS_COMPILE = toString ( # qgpgme uses Q_ASSERT which retains build inputs at runtime unless diff --git a/pkgs/development/libraries/gssdp/1.6.nix b/pkgs/development/libraries/gssdp/1.6.nix index 6d59e165a3e6..aef4e6ff3666 100644 --- a/pkgs/development/libraries/gssdp/1.6.nix +++ b/pkgs/development/libraries/gssdp/1.6.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation (finalAttrs: { vala gi-docgen python3 - ] ++ lib.optionals enableManpages [ buildPackages.pandoc ]; + ] + ++ lib.optionals enableManpages [ buildPackages.pandoc ]; buildInputs = [ libsoup_3 diff --git a/pkgs/development/libraries/gssdp/default.nix b/pkgs/development/libraries/gssdp/default.nix index 829b973e9097..1df6fa14c39d 100644 --- a/pkgs/development/libraries/gssdp/default.nix +++ b/pkgs/development/libraries/gssdp/default.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optionals withIntrospection [ "devdoc" ]; + ] + ++ lib.optionals withIntrospection [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/gssdp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -48,19 +49,18 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - glib - python3 - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala - gi-docgen - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + glib + python3 + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala + gi-docgen + ]; buildInputs = [ libsoup_2_4 diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index efb261a613e6..52d949c2d2b8 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -140,252 +140,249 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - orc # for orcc - python3 - gettext - gstreamer # for gst-tester-1.0 - gobject-introspection - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ] - ++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.hostPlatform.isLinux) [ - wayland-scanner - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + orc # for orcc + python3 + gettext + gstreamer # for gst-tester-1.0 + gobject-introspection + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ] + ++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.hostPlatform.isLinux) [ + wayland-scanner + ]; - buildInputs = - [ - gst-plugins-base - orc - json-glib - lcms2 - ldacbt - liblc3 - libass - webrtc-audio-processing_1 - libbs2b - libmodplug - openjpeg - libopenmpt - libopus - librsvg - curl.dev - fdk_aac - gsm - libaom - libdc1394 - libde265 - libdvdnav - libdvdread - libnice - qrencode - libsndfile - libusb1 - neon - openal - openexr - rtmpdump - pango - soundtouch - srtp - fluidsynth - libwebp - gnutls - game-music-emu - openssl - libxml2 - libintl - srt - vo-aacenc - libfreeaptx - zxing-cpp - usrsctp - wildmidi - svt-av1 - ] - ++ lib.optionals opencvSupport [ - opencv4 - ] - ++ lib.optionals enableZbar [ - zbar - ] - ++ lib.optionals faacSupport [ - faac - ] - ++ lib.optionals enableGplPlugins [ - libmpeg2 - mjpegtools - faad2 - x265 - ] - ++ lib.optionals bluezSupport [ - bluez - ] - ++ lib.optionals microdnsSupport [ - libmicrodns - ] - ++ lib.optionals openh264Support [ - openh264 - ] - ++ lib.optionals ajaSupport [ - libajantv2 - ] - ++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.hostPlatform.isLinux) [ - libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs - wayland - wayland-protocols - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin - mjpegtools + buildInputs = [ + gst-plugins-base + orc + json-glib + lcms2 + ldacbt + liblc3 + libass + webrtc-audio-processing_1 + libbs2b + libmodplug + openjpeg + libopenmpt + libopus + librsvg + curl.dev + fdk_aac + gsm + libaom + libdc1394 + libde265 + libdvdnav + libdvdread + libnice + qrencode + libsndfile + libusb1 + neon + openal + openexr + rtmpdump + pango + soundtouch + srtp + fluidsynth + libwebp + gnutls + game-music-emu + openssl + libxml2 + libintl + srt + vo-aacenc + libfreeaptx + zxing-cpp + usrsctp + wildmidi + svt-av1 + ] + ++ lib.optionals opencvSupport [ + opencv4 + ] + ++ lib.optionals enableZbar [ + zbar + ] + ++ lib.optionals faacSupport [ + faac + ] + ++ lib.optionals enableGplPlugins [ + libmpeg2 + mjpegtools + faad2 + x265 + ] + ++ lib.optionals bluezSupport [ + bluez + ] + ++ lib.optionals microdnsSupport [ + libmicrodns + ] + ++ lib.optionals openh264Support [ + openh264 + ] + ++ lib.optionals ajaSupport [ + libajantv2 + ] + ++ lib.optionals (gst-plugins-base.waylandEnabled && stdenv.hostPlatform.isLinux) [ + libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs + wayland + wayland-protocols + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin + mjpegtools - chromaprint - flite - libdrm - libgudev - sbc - spandsp + chromaprint + flite + libdrm + libgudev + sbc + spandsp - # ladspa plug-in - ladspaH - lrdf # TODO: make build on Darwin + # ladspa plug-in + ladspaH + lrdf # TODO: make build on Darwin - # lv2 plug-in - lilv - lv2 - serd - sord - sratom + # lv2 plug-in + lilv + lv2 + serd + sord + sratom - libGL - ] - ++ lib.optionals guiSupport [ - gtk3 - ] - ++ lib.optionals lcevcdecSupport [ - lcevcdec - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + libGL + ] + ++ lib.optionals guiSupport [ + gtk3 + ] + ++ lib.optionals lcevcdecSupport [ + lcevcdec + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; - mesonFlags = - [ - "-Dexamples=disabled" # requires many dependencies and probably not useful for our users - "-Dglib_debug=disabled" # cast checks should be disabled on stable releases + mesonFlags = [ + "-Dexamples=disabled" # requires many dependencies and probably not useful for our users + "-Dglib_debug=disabled" # cast checks should be disabled on stable releases - "-Damfcodec=disabled" # Windows-only - "-Dandroidmedia=disabled" # Requires Android system. - "-Davtp=disabled" - "-Dcuda-nvmm=disabled" - "-Ddirectshow=disabled" # Windows-only - "-Dqt6d3d11=disabled" # Windows-only - "-Ddts=disabled" # required `libdca` library not packaged in nixpkgs as of writing, and marked as "BIG FAT WARNING: libdca is still in early development" - "-Dzbar=${if enableZbar then "enabled" else "disabled"}" - "-Dfaac=${if faacSupport then "enabled" else "disabled"}" - "-Diqa=disabled" # required `dssim` library not packaging in nixpkgs as of writing, also this is AGPL so update license when adding support - "-Dlcevcencoder=disabled" # not packaged in nixpkgs as of writing - "-Dmagicleap=disabled" # required `ml_audio` library not packaged in nixpkgs as of writing - "-Dmsdk=disabled" # not packaged in nixpkgs as of writing / no Windows support - # As of writing, with `libmpcdec` in `buildInputs` we get - # "Could not find libmpcdec header files, but Musepack was enabled via options" - # This is likely because nixpkgs has the header in libmpc/mpcdec.h - # instead of mpc/mpcdec.h, like Arch does. The situation is not trivial. - # There are apparently 2 things called `libmpcdec` from the same author: - # * http://svn.musepack.net/libmpcdec/trunk/src/ - # * http://svn.musepack.net/libmpc/trunk/include/mpc/ - # Fixing it likely requires to first figure out with upstream which one - # is needed, and then patching upstream to find it (though it probably - # already works on Arch?). - "-Dmusepack=disabled" - "-Dnvcomp=disabled" - "-Dnvdswrapper=disabled" - "-Dopenni2=disabled" # not packaged in nixpkgs as of writing - "-Dopensles=disabled" # not packaged in nixpkgs as of writing - "-Dsvthevcenc=disabled" # required `SvtHevcEnc` library not packaged in nixpkgs as of writing - "-Dsvtjpegxs=disabled" # not packaged in nixpkgs as of writing - "-Dteletext=disabled" # required `zvbi` library not packaged in nixpkgs as of writing - "-Dtinyalsa=disabled" # not packaged in nixpkgs as of writing - "-Dvoamrwbenc=disabled" # required `vo-amrwbenc` library not packaged in nixpkgs as of writing - "-Dvulkan=disabled" # Linux-only, and we haven't figured out yet which of the vulkan nixpkgs it needs - "-Dwasapi=disabled" # not packaged in nixpkgs as of writing / no Windows support - "-Dwasapi2=disabled" # not packaged in nixpkgs as of writing / no Windows support - "-Dwpe=disabled" # required `wpe-webkit` library not packaged in nixpkgs as of writing - "-Dgs=disabled" # depends on `google-cloud-cpp` - "-Donnx=disabled" # depends on `libonnxruntime` not packaged in nixpkgs as of writing - "-Dopenaptx=enabled" # since gstreamer-1.20.1 `libfreeaptx` is supported for circumventing the dubious license conflict with `libopenaptx` - "-Dopencv=${if opencvSupport then "enabled" else "disabled"}" # Reduces rebuild size when `config.cudaSupport = true` - "-Daja=${if ajaSupport then "enabled" else "disabled"}" - "-Dmicrodns=${if microdnsSupport then "enabled" else "disabled"}" - "-Dbluez=${if bluezSupport then "enabled" else "disabled"}" - (lib.mesonEnable "openh264" openh264Support) - (lib.mesonEnable "doc" enableDocumentation) - (lib.mesonEnable "directfb" false) - (lib.mesonEnable "lcevcdecoder" lcevcdecSupport) - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "-Ddoc=disabled" # needs gstcuda to be enabled which is Linux-only - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux || !stdenv.hostPlatform.isx86) [ - "-Dnvcodec=disabled" # Linux-only, broken on non-x86 - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux || !gst-plugins-base.waylandEnabled) [ - "-Dva=disabled" # see comment on `libva` in `buildInputs` - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-Daja=disabled" - "-Dchromaprint=disabled" - "-Dflite=disabled" - "-Dkms=disabled" # renders to libdrm output - "-Dlv2=disabled" - "-Dsbc=disabled" - "-Dspandsp=disabled" - "-Ddvb=disabled" - "-Dfbdev=disabled" - "-Duvcgadget=disabled" # requires gudev - "-Duvch264=disabled" # requires gudev - "-Dv4l2codecs=disabled" # requires gudev - "-Dladspa=disabled" # requires lrdf - ] - ++ - lib.optionals - (!stdenv.hostPlatform.isLinux || !stdenv.hostPlatform.isx86_64 || !gst-plugins-base.waylandEnabled) - [ - "-Dqsv=disabled" # Linux (and Windows) x86 only, makes va required - ] - ++ lib.optionals (!gst-plugins-base.glEnabled) [ - "-Dgl=disabled" - ] - ++ lib.optionals (!gst-plugins-base.waylandEnabled || !guiSupport) [ - "-Dgtk3=disabled" # Wayland-based GTK sink - "-Dwayland=disabled" - ] - ++ lib.optionals (!gst-plugins-base.glEnabled) [ - # `applemedia/videotexturecache.h` requires `gst/gl/gl.h`, - # but its meson build system does not declare the dependency. - "-Dapplemedia=disabled" - ] - ++ ( - if enableGplPlugins then - [ - "-Dgpl=enabled" - ] - else - [ - "-Ddts=disabled" - "-Dfaad=disabled" - "-Diqa=disabled" - "-Dmpeg2enc=disabled" - "-Dmplex=disabled" - "-Dresindvd=disabled" - "-Dx265=disabled" - ] - ); + "-Damfcodec=disabled" # Windows-only + "-Dandroidmedia=disabled" # Requires Android system. + "-Davtp=disabled" + "-Dcuda-nvmm=disabled" + "-Ddirectshow=disabled" # Windows-only + "-Dqt6d3d11=disabled" # Windows-only + "-Ddts=disabled" # required `libdca` library not packaged in nixpkgs as of writing, and marked as "BIG FAT WARNING: libdca is still in early development" + "-Dzbar=${if enableZbar then "enabled" else "disabled"}" + "-Dfaac=${if faacSupport then "enabled" else "disabled"}" + "-Diqa=disabled" # required `dssim` library not packaging in nixpkgs as of writing, also this is AGPL so update license when adding support + "-Dlcevcencoder=disabled" # not packaged in nixpkgs as of writing + "-Dmagicleap=disabled" # required `ml_audio` library not packaged in nixpkgs as of writing + "-Dmsdk=disabled" # not packaged in nixpkgs as of writing / no Windows support + # As of writing, with `libmpcdec` in `buildInputs` we get + # "Could not find libmpcdec header files, but Musepack was enabled via options" + # This is likely because nixpkgs has the header in libmpc/mpcdec.h + # instead of mpc/mpcdec.h, like Arch does. The situation is not trivial. + # There are apparently 2 things called `libmpcdec` from the same author: + # * http://svn.musepack.net/libmpcdec/trunk/src/ + # * http://svn.musepack.net/libmpc/trunk/include/mpc/ + # Fixing it likely requires to first figure out with upstream which one + # is needed, and then patching upstream to find it (though it probably + # already works on Arch?). + "-Dmusepack=disabled" + "-Dnvcomp=disabled" + "-Dnvdswrapper=disabled" + "-Dopenni2=disabled" # not packaged in nixpkgs as of writing + "-Dopensles=disabled" # not packaged in nixpkgs as of writing + "-Dsvthevcenc=disabled" # required `SvtHevcEnc` library not packaged in nixpkgs as of writing + "-Dsvtjpegxs=disabled" # not packaged in nixpkgs as of writing + "-Dteletext=disabled" # required `zvbi` library not packaged in nixpkgs as of writing + "-Dtinyalsa=disabled" # not packaged in nixpkgs as of writing + "-Dvoamrwbenc=disabled" # required `vo-amrwbenc` library not packaged in nixpkgs as of writing + "-Dvulkan=disabled" # Linux-only, and we haven't figured out yet which of the vulkan nixpkgs it needs + "-Dwasapi=disabled" # not packaged in nixpkgs as of writing / no Windows support + "-Dwasapi2=disabled" # not packaged in nixpkgs as of writing / no Windows support + "-Dwpe=disabled" # required `wpe-webkit` library not packaged in nixpkgs as of writing + "-Dgs=disabled" # depends on `google-cloud-cpp` + "-Donnx=disabled" # depends on `libonnxruntime` not packaged in nixpkgs as of writing + "-Dopenaptx=enabled" # since gstreamer-1.20.1 `libfreeaptx` is supported for circumventing the dubious license conflict with `libopenaptx` + "-Dopencv=${if opencvSupport then "enabled" else "disabled"}" # Reduces rebuild size when `config.cudaSupport = true` + "-Daja=${if ajaSupport then "enabled" else "disabled"}" + "-Dmicrodns=${if microdnsSupport then "enabled" else "disabled"}" + "-Dbluez=${if bluezSupport then "enabled" else "disabled"}" + (lib.mesonEnable "openh264" openh264Support) + (lib.mesonEnable "doc" enableDocumentation) + (lib.mesonEnable "directfb" false) + (lib.mesonEnable "lcevcdecoder" lcevcdecSupport) + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "-Ddoc=disabled" # needs gstcuda to be enabled which is Linux-only + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux || !stdenv.hostPlatform.isx86) [ + "-Dnvcodec=disabled" # Linux-only, broken on non-x86 + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux || !gst-plugins-base.waylandEnabled) [ + "-Dva=disabled" # see comment on `libva` in `buildInputs` + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-Daja=disabled" + "-Dchromaprint=disabled" + "-Dflite=disabled" + "-Dkms=disabled" # renders to libdrm output + "-Dlv2=disabled" + "-Dsbc=disabled" + "-Dspandsp=disabled" + "-Ddvb=disabled" + "-Dfbdev=disabled" + "-Duvcgadget=disabled" # requires gudev + "-Duvch264=disabled" # requires gudev + "-Dv4l2codecs=disabled" # requires gudev + "-Dladspa=disabled" # requires lrdf + ] + ++ + lib.optionals + (!stdenv.hostPlatform.isLinux || !stdenv.hostPlatform.isx86_64 || !gst-plugins-base.waylandEnabled) + [ + "-Dqsv=disabled" # Linux (and Windows) x86 only, makes va required + ] + ++ lib.optionals (!gst-plugins-base.glEnabled) [ + "-Dgl=disabled" + ] + ++ lib.optionals (!gst-plugins-base.waylandEnabled || !guiSupport) [ + "-Dgtk3=disabled" # Wayland-based GTK sink + "-Dwayland=disabled" + ] + ++ lib.optionals (!gst-plugins-base.glEnabled) [ + # `applemedia/videotexturecache.h` requires `gst/gl/gl.h`, + # but its meson build system does not declare the dependency. + "-Dapplemedia=disabled" + ] + ++ ( + if enableGplPlugins then + [ + "-Dgpl=enabled" + ] + else + [ + "-Ddts=disabled" + "-Dfaad=disabled" + "-Diqa=disabled" + "-Dmpeg2enc=disabled" + "-Dmplex=disabled" + "-Dresindvd=disabled" + "-Dx265=disabled" + ] + ); # Argument list too long strictDeps = true; diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index e497f0c4ffc4..86e772e239b4 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -68,99 +68,95 @@ stdenv.mkDerivation (finalAttrs: { depsBuildBuild = [ pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - gettext - orc - glib - gstreamer - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ] - ++ lib.optionals enableWayland [ - wayland-scanner - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + gettext + orc + glib + gstreamer + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ] + ++ lib.optionals enableWayland [ + wayland-scanner + ]; - buildInputs = - [ - graphene - orc - libtheora - libintl - libopus - isocodes - libpng - libjpeg - tremor - pango - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libdrm - libGL - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ] - ++ lib.optionals enableAlsa [ - alsa-lib - ] - ++ lib.optionals enableX11 [ - libXext - libXi - libXv - ] - ++ lib.optionals enableWayland [ - wayland - wayland-protocols - ] - ++ lib.optional enableCdparanoia cdparanoia; + buildInputs = [ + graphene + orc + libtheora + libintl + libopus + isocodes + libpng + libjpeg + tremor + pango + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libdrm + libGL + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ] + ++ lib.optionals enableAlsa [ + alsa-lib + ] + ++ lib.optionals enableX11 [ + libXext + libXi + libXv + ] + ++ lib.optionals enableWayland [ + wayland + wayland-protocols + ] + ++ lib.optional enableCdparanoia cdparanoia; - propagatedBuildInputs = - [ - gstreamer - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libdrm - ]; + propagatedBuildInputs = [ + gstreamer + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libdrm + ]; - mesonFlags = - [ - "-Dglib_debug=disabled" # cast checks should be disabled on stable releases - "-Dexamples=disabled" # requires many dependencies and probably not useful for our users - # See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices - "-Dgl_winsys=${ - lib.concatStringsSep "," ( - lib.optional enableX11 "x11" - ++ lib.optional enableWayland "wayland" - ++ lib.optional enableCocoa "cocoa" - ) - }" - (lib.mesonEnable "introspection" withIntrospection) - (lib.mesonEnable "doc" enableDocumentation) - (lib.mesonEnable "libvisual" false) - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Dtests=disabled" - ] - ++ lib.optionals (!enableX11) [ - "-Dx11=disabled" - "-Dxi=disabled" - "-Dxshm=disabled" - "-Dxvideo=disabled" - ] - # TODO How to disable Wayland? - ++ lib.optional (!enableGl) "-Dgl=disabled" - ++ lib.optional (!enableAlsa) "-Dalsa=disabled" - ++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled" - ++ lib.optional stdenv.hostPlatform.isDarwin "-Ddrm=disabled"; + mesonFlags = [ + "-Dglib_debug=disabled" # cast checks should be disabled on stable releases + "-Dexamples=disabled" # requires many dependencies and probably not useful for our users + # See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices + "-Dgl_winsys=${ + lib.concatStringsSep "," ( + lib.optional enableX11 "x11" + ++ lib.optional enableWayland "wayland" + ++ lib.optional enableCocoa "cocoa" + ) + }" + (lib.mesonEnable "introspection" withIntrospection) + (lib.mesonEnable "doc" enableDocumentation) + (lib.mesonEnable "libvisual" false) + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-Dtests=disabled" + ] + ++ lib.optionals (!enableX11) [ + "-Dx11=disabled" + "-Dxi=disabled" + "-Dxshm=disabled" + "-Dxvideo=disabled" + ] + # TODO How to disable Wayland? + ++ lib.optional (!enableGl) "-Dgl=disabled" + ++ lib.optional (!enableAlsa) "-Dalsa=disabled" + ++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled" + ++ lib.optional stdenv.hostPlatform.isDarwin "-Ddrm=disabled"; postPatch = '' patchShebangs \ diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index 8b8900058d28..3f3778fd7cc0 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -60,48 +60,46 @@ stdenv.mkDerivation (finalAttrs: { ]; strictDeps = true; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - bison - flex - python3 - makeWrapper - glib - bash-completion - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap # for setcap binary - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - ] - ++ lib.optionals withRust [ - rustc - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + bison + flex + python3 + makeWrapper + glib + bash-completion + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap # for setcap binary + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + ] + ++ lib.optionals withRust [ + rustc + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; - buildInputs = - [ - bash-completion - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - ] - ++ lib.optionals hasElfutils [ - elfutils - ] - ++ lib.optionals withLibunwind [ - libunwind - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + buildInputs = [ + bash-completion + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + ] + ++ lib.optionals hasElfutils [ + elfutils + ] + ++ lib.optionals withLibunwind [ + libunwind + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/development/libraries/gstreamer/devtools/default.nix b/pkgs/development/libraries/gstreamer/devtools/default.nix index aaa3770b6257..b298491bb1ef 100644 --- a/pkgs/development/libraries/gstreamer/devtools/default.nix +++ b/pkgs/development/libraries/gstreamer/devtools/default.nix @@ -71,29 +71,27 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gobject-introspection - rustPlatform.cargoSetupHook - rustc - cargo - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gobject-introspection + rustPlatform.cargoSetupHook + rustc + cargo + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; - buildInputs = - [ - cairo - python3 - json-glib - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - apple-sdk_gstreamer - ]; + buildInputs = [ + cairo + python3 + json-glib + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + apple-sdk_gstreamer + ]; propagatedBuildInputs = [ gstreamer diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix index 92baa4bd66f2..2e2a9fdae3fa 100644 --- a/pkgs/development/libraries/gstreamer/ges/default.nix +++ b/pkgs/development/libraries/gstreamer/ges/default.nix @@ -35,30 +35,28 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-r1sn9ck2MCc3IQDKwLrxkFUoBynfHMWN1ORU72mOsf8="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - gobject-introspection - python3 - flex - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + gobject-introspection + python3 + flex + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; - buildInputs = - [ - bash-completion - libxml2 - gst-devtools - python3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + buildInputs = [ + bash-completion + libxml2 + gst-devtools + python3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; propagatedBuildInputs = [ gst-plugins-base diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix index 7fa065408604..29c3bc5e71b0 100644 --- a/pkgs/development/libraries/gstreamer/good/default.nix +++ b/pkgs/development/libraries/gstreamer/good/default.nix @@ -104,154 +104,151 @@ stdenv.mkDerivation (finalAttrs: { depsBuildBuild = [ pkg-config ]; - nativeBuildInputs = + nativeBuildInputs = [ + pkg-config + python3 + meson + ninja + gettext + nasm + orc + libshout + glib + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ] + ++ lib.optionals qt5Support ( + with qt5; [ - pkg-config - python3 - meson - ninja - gettext - nasm - orc - libshout - glib + qtbase + qttools ] - ++ lib.optionals enableDocumentation [ - hotdoc + ) + ++ lib.optionals qt6Support ( + with qt6; + [ + qtbase + qttools ] - ++ lib.optionals qt5Support ( - with qt5; - [ - qtbase - qttools - ] - ) - ++ lib.optionals qt6Support ( - with qt6; - [ - qtbase - qttools - ] - ) - ++ lib.optionals enableWayland [ - wayland-protocols - ]; + ) + ++ lib.optionals enableWayland [ + wayland-protocols + ]; - buildInputs = + buildInputs = [ + gst-plugins-base + orc + bzip2 + libdv + libvpx + speex + opencore-amr + flac + taglib + cairo + gdk-pixbuf + aalib + libcaca + libsoup_3 + libshout + libxml2 + lame + mpg123 + twolame + libintl + ncurses + wavpack + openssl + ] + ++ lib.optionals raspiCameraSupport [ + libraspberrypi + ] + ++ lib.optionals enableX11 [ + xorg.libXext + xorg.libXfixes + xorg.libXdamage + xorg.libXtst + xorg.libXi + ] + ++ lib.optionals gtkSupport [ + # for gtksink + gtk3 + ] + ++ lib.optionals qt5Support ( + with qt5; [ - gst-plugins-base - orc - bzip2 - libdv - libvpx - speex - opencore-amr - flac - taglib - cairo - gdk-pixbuf - aalib - libcaca - libsoup_3 - libshout - libxml2 - lame - mpg123 - twolame - libintl - ncurses - wavpack - openssl + qtbase + qtdeclarative + qtwayland + qtx11extras ] - ++ lib.optionals raspiCameraSupport [ - libraspberrypi + ) + ++ lib.optionals qt6Support ( + with qt6; + [ + qtbase + qtdeclarative + qtwayland ] - ++ lib.optionals enableX11 [ - xorg.libXext - xorg.libXfixes - xorg.libXdamage - xorg.libXtst - xorg.libXi - ] - ++ lib.optionals gtkSupport [ - # for gtksink - gtk3 - ] - ++ lib.optionals qt5Support ( - with qt5; - [ - qtbase - qtdeclarative - qtwayland - qtx11extras - ] - ) - ++ lib.optionals qt6Support ( - with qt6; - [ - qtbase - qtdeclarative - qtwayland - ] - ) - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libdrm - libGL - libv4l - libpulseaudio - libavc1394 - libiec61883 - libgudev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ] - ++ lib.optionals enableWayland [ - wayland - ] - ++ lib.optionals enableJack [ - libjack2 - ]; + ) + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libdrm + libGL + libv4l + libpulseaudio + libavc1394 + libiec61883 + libgudev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ] + ++ lib.optionals enableWayland [ + wayland + ] + ++ lib.optionals enableJack [ + libjack2 + ]; - mesonFlags = - [ - "-Dexamples=disabled" # requires many dependencies and probably not useful for our users - "-Dglib_debug=disabled" # cast checks should be disabled on stable releases - (lib.mesonEnable "doc" enableDocumentation) - ] - ++ lib.optionals (!qt5Support) [ - "-Dqt5=disabled" - ] - ++ lib.optionals (!qt6Support) [ - "-Dqt6=disabled" - ] - ++ lib.optionals (!gtkSupport) [ - "-Dgtk3=disabled" - ] - ++ lib.optionals (!enableX11) [ - "-Dximagesrc=disabled" # Linux-only - ] - ++ lib.optionals (!enableJack) [ - "-Djack=disabled" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "-Ddv1394=disabled" # Linux only - "-Doss4=disabled" # Linux only - "-Doss=disabled" # Linux only - "-Dpulse=disabled" # TODO check if we can keep this enabled - "-Dv4l2-gudev=disabled" # Linux-only - "-Dv4l2=disabled" # Linux-only - ] - ++ ( - if raspiCameraSupport then - [ - "-Drpi-lib-dir=${libraspberrypi}/lib" - ] - else - [ - "-Drpicamsrc=disabled" - ] - ); + mesonFlags = [ + "-Dexamples=disabled" # requires many dependencies and probably not useful for our users + "-Dglib_debug=disabled" # cast checks should be disabled on stable releases + (lib.mesonEnable "doc" enableDocumentation) + ] + ++ lib.optionals (!qt5Support) [ + "-Dqt5=disabled" + ] + ++ lib.optionals (!qt6Support) [ + "-Dqt6=disabled" + ] + ++ lib.optionals (!gtkSupport) [ + "-Dgtk3=disabled" + ] + ++ lib.optionals (!enableX11) [ + "-Dximagesrc=disabled" # Linux-only + ] + ++ lib.optionals (!enableJack) [ + "-Djack=disabled" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "-Ddv1394=disabled" # Linux only + "-Doss4=disabled" # Linux only + "-Doss=disabled" # Linux only + "-Dpulse=disabled" # TODO check if we can keep this enabled + "-Dv4l2-gudev=disabled" # Linux-only + "-Dv4l2=disabled" # Linux-only + ] + ++ ( + if raspiCameraSupport then + [ + "-Drpi-lib-dir=${libraspberrypi}/lib" + ] + else + [ + "-Drpicamsrc=disabled" + ] + ); postPatch = '' patchShebangs \ @@ -273,23 +270,22 @@ stdenv.mkDerivation (finalAttrs: { dontWrapQtApps = true; passthru = { - tests = - { - gtk = gst-plugins-good.override { - gtkSupport = true; - }; - qt5 = gst-plugins-good.override { - qt5Support = true; - }; - qt6 = gst-plugins-good.override { - qt6Support = true; - }; - } - // lib.optionalAttrs hostSupportsRaspiCamera { - raspiCamera = gst-plugins-good.override { - raspiCameraSupport = true; - }; + tests = { + gtk = gst-plugins-good.override { + gtkSupport = true; }; + qt5 = gst-plugins-good.override { + qt5Support = true; + }; + qt6 = gst-plugins-good.override { + qt6Support = true; + }; + } + // lib.optionalAttrs hostSupportsRaspiCamera { + raspiCamera = gst-plugins-good.override { + raspiCameraSupport = true; + }; + }; updateScript = directoryListingUpdater { }; }; diff --git a/pkgs/development/libraries/gstreamer/icamerasrc/default.nix b/pkgs/development/libraries/gstreamer/icamerasrc/default.nix index 5f6842e7e4ee..f4803998ae8d 100644 --- a/pkgs/development/libraries/gstreamer/icamerasrc/default.nix +++ b/pkgs/development/libraries/gstreamer/icamerasrc/default.nix @@ -34,18 +34,17 @@ stdenv.mkDerivation { export STRIP_VIRTUAL_CHANNEL_CAMHAL=ON ''; - buildInputs = - [ - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-bad - ipu6-camera-hal - libdrm - libva - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + buildInputs = [ + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-bad + ipu6-camera-hal + libdrm + libva + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; NIX_CFLAGS_COMPILE = [ "-Wno-error" diff --git a/pkgs/development/libraries/gstreamer/libav/default.nix b/pkgs/development/libraries/gstreamer/libav/default.nix index 72dc282f70cc..c1bb742b616d 100644 --- a/pkgs/development/libraries/gstreamer/libav/default.nix +++ b/pkgs/development/libraries/gstreamer/libav/default.nix @@ -31,27 +31,25 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-cHqLaH/1/dzuWwJBXi7JtxtKxE0Leuw7R3Nkzuy/Hs8="; }; - nativeBuildInputs = - [ - meson - ninja - gettext - pkg-config - python3 - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + python3 + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; - buildInputs = - [ - gstreamer - gst-plugins-base - ffmpeg-headless - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + buildInputs = [ + gstreamer + gst-plugins-base + ffmpeg-headless + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; mesonFlags = [ (lib.mesonEnable "doc" enableDocumentation) diff --git a/pkgs/development/libraries/gstreamer/rs/default.nix b/pkgs/development/libraries/gstreamer/rs/default.nix index 1722fc795837..11903735d124 100644 --- a/pkgs/development/libraries/gstreamer/rs/default.nix +++ b/pkgs/development/libraries/gstreamer/rs/default.nix @@ -203,37 +203,35 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - rustPlatform.cargoSetupHook - meson - ninja - python3 - python3.pkgs.tomli - pkg-config - rustc - cargo - cargo-c' - nasm - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - lld - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + rustPlatform.cargoSetupHook + meson + ninja + python3 + python3.pkgs.tomli + pkg-config + rustc + cargo + cargo-c' + nasm + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + lld + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_CFLAGS_LINK = "-fuse-ld=lld"; }; - buildInputs = - [ - gstreamer - gst-plugins-base - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ] - ++ lib.concatMap (plugin: lib.getAttr plugin validPlugins) selectedPlugins; + buildInputs = [ + gstreamer + gst-plugins-base + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ] + ++ lib.concatMap (plugin: lib.getAttr plugin validPlugins) selectedPlugins; checkInputs = [ gst-plugins-good @@ -252,15 +250,14 @@ stdenv.mkDerivation (finalAttrs: { doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; # csound lib dir must be manually specified for it to build - preConfigure = - '' - export CARGO_BUILD_JOBS=$NIX_BUILD_CORES + preConfigure = '' + export CARGO_BUILD_JOBS=$NIX_BUILD_CORES - patchShebangs dependencies.py - '' - + lib.optionalString (lib.elem "csound" selectedPlugins) '' - export CSOUND_LIB_DIR=${lib.getLib csound}/lib - ''; + patchShebangs dependencies.py + '' + + lib.optionalString (lib.elem "csound" selectedPlugins) '' + export CSOUND_LIB_DIR=${lib.getLib csound}/lib + ''; mesonCheckFlags = [ "--verbose" ]; diff --git a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix index dade9cd11663..befafdb2329c 100644 --- a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix +++ b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix @@ -31,27 +31,25 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-6YPAOUluP3XjlpZVTOdNtBIOJGXeF6ocw3FgVo6bQLw="; }; - nativeBuildInputs = - [ - meson - ninja - gettext - gobject-introspection - pkg-config - python3 - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + meson + ninja + gettext + gobject-introspection + pkg-config + python3 + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; - buildInputs = - [ - gst-plugins-base - gst-plugins-bad - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + buildInputs = [ + gst-plugins-base + gst-plugins-bad + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; mesonFlags = [ "-Dglib_debug=disabled" # cast checks should be disabled on stable releases diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix index 0329460a6e8d..2e86309a51c5 100644 --- a/pkgs/development/libraries/gstreamer/ugly/default.nix +++ b/pkgs/development/libraries/gstreamer/ugly/default.nix @@ -39,57 +39,54 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-qGtRyEVKgTEghIyANCHzJ9jAeqvK5GHgWXzEk5jA/N4="; }; - nativeBuildInputs = - [ - meson - ninja - gettext - pkg-config - python3 - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + python3 + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; - buildInputs = - [ - gst-plugins-base - orc - libintl - ] - ++ lib.optionals enableGplPlugins [ - a52dec - libcdio - libdvdread - libmad - libmpeg2 - x264 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + buildInputs = [ + gst-plugins-base + orc + libintl + ] + ++ lib.optionals enableGplPlugins [ + a52dec + libcdio + libdvdread + libmad + libmpeg2 + x264 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; - mesonFlags = - [ - "-Dglib_debug=disabled" # cast checks should be disabled on stable releases - "-Dsidplay=disabled" # sidplay / sidplay/player.h isn't packaged in nixpkgs as of writing - (lib.mesonEnable "doc" enableDocumentation) - ] - ++ ( - if enableGplPlugins then - [ - "-Dgpl=enabled" - ] - else - [ - "-Da52dec=disabled" - "-Dcdio=disabled" - "-Ddvdread=disabled" - "-Dmpeg2dec=disabled" - "-Dsidplay=disabled" - "-Dx264=disabled" - ] - ); + mesonFlags = [ + "-Dglib_debug=disabled" # cast checks should be disabled on stable releases + "-Dsidplay=disabled" # sidplay / sidplay/player.h isn't packaged in nixpkgs as of writing + (lib.mesonEnable "doc" enableDocumentation) + ] + ++ ( + if enableGplPlugins then + [ + "-Dgpl=enabled" + ] + else + [ + "-Da52dec=disabled" + "-Dcdio=disabled" + "-Ddvdread=disabled" + "-Dmpeg2dec=disabled" + "-Dsidplay=disabled" + "-Dx264=disabled" + ] + ); postPatch = '' patchShebangs \ diff --git a/pkgs/development/libraries/gstreamer/vaapi/default.nix b/pkgs/development/libraries/gstreamer/vaapi/default.nix index c717fa21e725..0fd9fb113c29 100644 --- a/pkgs/development/libraries/gstreamer/vaapi/default.nix +++ b/pkgs/development/libraries/gstreamer/vaapi/default.nix @@ -42,45 +42,43 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-Vzkx1FX1qW9j23yNNdUTIrjSh4FujGp32Ez7ufoTUfE="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - python3 - bzip2 - wayland-scanner - ] - ++ lib.optionals enableDocumentation [ - hotdoc - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + python3 + bzip2 + wayland-scanner + ] + ++ lib.optionals enableDocumentation [ + hotdoc + ]; - buildInputs = - [ - gstreamer - gst-plugins-base - gst-plugins-bad - libva - wayland - wayland-protocols - libdrm - udev - xorg.libX11 - xorg.libXext - xorg.libXv - xorg.libXrandr - xorg.libSM - xorg.libICE - nasm - libvpx - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGL - libGLU - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_gstreamer - ]; + buildInputs = [ + gstreamer + gst-plugins-base + gst-plugins-bad + libva + wayland + wayland-protocols + libdrm + udev + xorg.libX11 + xorg.libXext + xorg.libXv + xorg.libXrandr + xorg.libSM + xorg.libICE + nasm + libvpx + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGL + libGLU + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_gstreamer + ]; strictDeps = true; diff --git a/pkgs/development/libraries/gtk/2.x.nix b/pkgs/development/libraries/gtk/2.x.nix index 0fd2d15f83f7..c8c62632c9ef 100644 --- a/pkgs/development/libraries/gtk/2.x.nix +++ b/pkgs/development/libraries/gtk/2.x.nix @@ -64,64 +64,61 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - patches = - [ - ./patches/2.0-immodules.cache.patch - ./patches/gtk2-theme-paths.patch - (fetchpatch { - # https://gitlab.gnome.org/GNOME/gtk/-/issues/6786 - name = "CVE-2024-6655.patch"; - url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/3bbf0b6176d42836d23c36a6ac410e807ec0a7a7.patch"; - hash = "sha256-mstOPk9NNpUwScrdEbvGhmAv8jlds3SBdj53T0q33vM="; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch - ./patches/2.0-darwin-x11.patch - # Fixes an incompatible function pointer conversion and implicit int errors with clang 16. - ./patches/2.0-clang.patch - ]; + patches = [ + ./patches/2.0-immodules.cache.patch + ./patches/gtk2-theme-paths.patch + (fetchpatch { + # https://gitlab.gnome.org/GNOME/gtk/-/issues/6786 + name = "CVE-2024-6655.patch"; + url = "https://gitlab.gnome.org/GNOME/gtk/-/commit/3bbf0b6176d42836d23c36a6ac410e807ec0a7a7.patch"; + hash = "sha256-mstOPk9NNpUwScrdEbvGhmAv8jlds3SBdj53T0q33vM="; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./patches/2.0-gnome_bugzilla_557780_306776_freeciv_darwin.patch + ./patches/2.0-darwin-x11.patch + # Fixes an incompatible function pointer conversion and implicit int errors with clang 16. + ./patches/2.0-clang.patch + ]; - propagatedBuildInputs = - [ - atk - cairo - gdk-pixbuf - glib - pango - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin) [ - libXcomposite - libXcursor - libXi - libXrandr - libXrender - ] - ++ lib.optional xineramaSupport libXinerama - ++ lib.optional cupsSupport cups - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libXdamage - ]; + propagatedBuildInputs = [ + atk + cairo + gdk-pixbuf + glib + pango + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin) [ + libXcomposite + libXcursor + libXi + libXrandr + libXrender + ] + ++ lib.optional xineramaSupport libXinerama + ++ lib.optional cupsSupport cups + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libXdamage + ]; preConfigure = lib.optionalString ( stdenv.hostPlatform.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" ) "MACOSX_DEPLOYMENT_TARGET=10.16"; - configureFlags = - [ - "--sysconfdir=/etc" - "--with-gdktarget=${gdktarget}" - "--with-xinput=yes" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--disable-glibtest" - "--disable-introspection" - "--disable-visibility" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "ac_cv_path_GTK_UPDATE_ICON_CACHE=${buildPackages.gtk2}/bin/gtk-update-icon-cache" - "ac_cv_path_GDK_PIXBUF_CSOURCE=${buildPackages.gdk-pixbuf.dev}/bin/gdk-pixbuf-csource" - ]; + configureFlags = [ + "--sysconfdir=/etc" + "--with-gdktarget=${gdktarget}" + "--with-xinput=yes" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--disable-glibtest" + "--disable-introspection" + "--disable-visibility" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "ac_cv_path_GTK_UPDATE_ICON_CACHE=${buildPackages.gtk2}/bin/gtk-update-icon-cache" + "ac_cv_path_GDK_PIXBUF_CSOURCE=${buildPackages.gdk-pixbuf.dev}/bin/gdk-pixbuf-csource" + ]; env = lib.optionalAttrs stdenv.cc.isGNU { NIX_CFLAGS_COMPILE = toString [ @@ -171,14 +168,13 @@ stdenv.mkDerivation (finalAttrs: { raskin ]; platforms = lib.platforms.all; - pkgConfigModules = - [ - "gdk-2.0" - "gtk+-2.0" - ] - ++ lib.optionals (gdktarget == "x11") [ - "gdk-x11-2.0" - "gtk+-x11-2.0" - ]; + pkgConfigModules = [ + "gdk-2.0" + "gtk+-2.0" + ] + ++ lib.optionals (gdktarget == "x11") [ + "gdk-x11-2.0" + "gtk+-x11-2.0" + ]; }; }) diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index fe2efb167ccf..f8fdf154b7dc 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -67,7 +67,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optional withIntrospection "devdoc"; + ] + ++ lib.optional withIntrospection "devdoc"; outputBin = "dev"; setupHooks = [ @@ -84,61 +85,58 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-XqUsaijw5ezy6aPC+suzDQQLc4cfzV8zzRMX6QGKFG4="; }; - patches = - [ - ./patches/3.0-immodules.cache.patch - ./patches/3.0-Xft-setting-fallback-compute-DPI-properly.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # X11 module requires which is not installed on Darwin - # let’s drop that dependency in similar way to how other parts of the library do it - # e.g. https://gitlab.gnome.org/GNOME/gtk/blob/3.24.4/gtk/gtk-launch.c#L31-33 - # https://gitlab.gnome.org/GNOME/gtk/merge_requests/536 - ./patches/3.0-darwin-x11.patch - ]; + patches = [ + ./patches/3.0-immodules.cache.patch + ./patches/3.0-Xft-setting-fallback-compute-DPI-properly.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # X11 module requires which is not installed on Darwin + # let’s drop that dependency in similar way to how other parts of the library do it + # e.g. https://gitlab.gnome.org/GNOME/gtk/blob/3.24.4/gtk/gtk-launch.c#L31-33 + # https://gitlab.gnome.org/GNOME/gtk/merge_requests/536 + ./patches/3.0-darwin-x11.patch + ]; depsBuildBuild = [ pkg-config ]; - nativeBuildInputs = - [ - gettext - makeWrapper - meson - ninja - pkg-config - python3 - sassc - gdk-pixbuf - ] - ++ finalAttrs.setupHooks - ++ lib.optionals withIntrospection [ - gobject-introspection - docbook_xml_dtd_43 - docbook-xsl-nons - gtk-doc - # For xmllint - libxml2 - ] - ++ - lib.optionals - ((withIntrospection || compileSchemas) && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) - [ - mesonEmulatorHook - ] - ++ lib.optionals waylandSupport [ - wayland-scanner - ]; + nativeBuildInputs = [ + gettext + makeWrapper + meson + ninja + pkg-config + python3 + sassc + gdk-pixbuf + ] + ++ finalAttrs.setupHooks + ++ lib.optionals withIntrospection [ + gobject-introspection + docbook_xml_dtd_43 + docbook-xsl-nons + gtk-doc + # For xmllint + libxml2 + ] + ++ + lib.optionals + ((withIntrospection || compileSchemas) && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) + [ + mesonEmulatorHook + ] + ++ lib.optionals waylandSupport [ + wayland-scanner + ]; - buildInputs = - [ - libxkbcommon - (libepoxy.override { inherit x11Support; }) - isocodes - ] - ++ lib.optionals trackerSupport [ - tinysparql - ]; + buildInputs = [ + libxkbcommon + (libepoxy.override { inherit x11Support; }) + isocodes + ] + ++ lib.optionals trackerSupport [ + tinysparql + ]; #TODO: colord? propagatedBuildInputs = @@ -275,15 +273,14 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.lgpl2Plus; maintainers = with maintainers; [ raskin ]; teams = [ teams.gnome ]; - pkgConfigModules = - [ - "gdk-3.0" - "gtk+-3.0" - ] - ++ lib.optionals x11Support [ - "gdk-x11-3.0" - "gtk+-x11-3.0" - ]; + pkgConfigModules = [ + "gdk-3.0" + "gtk+-3.0" + ] + ++ lib.optionals x11Support [ + "gdk-x11-3.0" + "gtk+-x11-3.0" + ]; platforms = platforms.all; changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${finalAttrs.version}/NEWS"; }; diff --git a/pkgs/development/libraries/gtk/4.x.nix b/pkgs/development/libraries/gtk/4.x.nix index 3bb415a23c8d..a9217ba92d14 100644 --- a/pkgs/development/libraries/gtk/4.x.nix +++ b/pkgs/development/libraries/gtk/4.x.nix @@ -73,7 +73,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optionals x11Support [ "devdoc" ]; + ] + ++ lib.optionals x11Support [ "devdoc" ]; outputBin = "dev"; setupHooks = [ @@ -90,113 +91,109 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - docutils # for rst2man, rst2html5 - gettext - gobject-introspection - makeWrapper - meson - ninja - pkg-config - python3 - sassc - gi-docgen - libxml2 # for xmllint - ] - ++ lib.optionals (compileSchemas && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ] - ++ lib.optionals waylandSupport [ - wayland-scanner - ] - ++ lib.optionals vulkanSupport [ - shaderc # for glslc - ] - ++ finalAttrs.setupHooks; + nativeBuildInputs = [ + docutils # for rst2man, rst2html5 + gettext + gobject-introspection + makeWrapper + meson + ninja + pkg-config + python3 + sassc + gi-docgen + libxml2 # for xmllint + ] + ++ lib.optionals (compileSchemas && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ] + ++ lib.optionals waylandSupport [ + wayland-scanner + ] + ++ lib.optionals vulkanSupport [ + shaderc # for glslc + ] + ++ finalAttrs.setupHooks; - buildInputs = - [ - libxkbcommon - libpng - libtiff - libjpeg - (libepoxy.override { inherit x11Support; }) - isocodes - ] - ++ lib.optionals vulkanSupport [ - vulkan-headers - libdrm - ] - ++ [ - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-bad - fribidi - harfbuzz - ] - ++ (with xorg; [ - libICE - libSM - libXcursor - libXdamage - libXi - libXrandr - libXrender - ]) - ++ lib.optionals trackerSupport [ - tinysparql - ] - ++ lib.optionals waylandSupport [ - libGL - wayland - wayland-protocols - ] - ++ lib.optionals xineramaSupport [ - xorg.libXinerama - ] - ++ lib.optionals cupsSupport [ - cups - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - libexecinfo - ]; + buildInputs = [ + libxkbcommon + libpng + libtiff + libjpeg + (libepoxy.override { inherit x11Support; }) + isocodes + ] + ++ lib.optionals vulkanSupport [ + vulkan-headers + libdrm + ] + ++ [ + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-bad + fribidi + harfbuzz + ] + ++ (with xorg; [ + libICE + libSM + libXcursor + libXdamage + libXi + libXrandr + libXrender + ]) + ++ lib.optionals trackerSupport [ + tinysparql + ] + ++ lib.optionals waylandSupport [ + libGL + wayland + wayland-protocols + ] + ++ lib.optionals xineramaSupport [ + xorg.libXinerama + ] + ++ lib.optionals cupsSupport [ + cups + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + libexecinfo + ]; #TODO: colord? - propagatedBuildInputs = - [ - # Required by pkg-config files. - cairo - gdk-pixbuf - glib - graphene - pango - ] - ++ lib.optionals waylandSupport [ - wayland - ] - ++ lib.optionals vulkanSupport [ - vulkan-loader - ] - ++ [ - # Required for GSettings schemas at runtime. - # Will be picked up by wrapGAppsHook4. - gsettings-desktop-schemas - ]; + propagatedBuildInputs = [ + # Required by pkg-config files. + cairo + gdk-pixbuf + glib + graphene + pango + ] + ++ lib.optionals waylandSupport [ + wayland + ] + ++ lib.optionals vulkanSupport [ + vulkan-loader + ] + ++ [ + # Required for GSettings schemas at runtime. + # Will be picked up by wrapGAppsHook4. + gsettings-desktop-schemas + ]; - mesonFlags = - [ - # ../docs/tools/shooter.c:4:10: fatal error: 'cairo-xlib.h' file not found - (lib.mesonBool "documentation" x11Support) - "-Dbuild-tests=false" - (lib.mesonEnable "tracker" trackerSupport) - (lib.mesonBool "broadway-backend" broadwaySupport) - (lib.mesonEnable "vulkan" vulkanSupport) - (lib.mesonEnable "print-cups" cupsSupport) - (lib.mesonBool "x11-backend" x11Support) - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isAarch64) [ - "-Dmedia-gstreamer=disabled" # requires gstreamer-gl - ]; + mesonFlags = [ + # ../docs/tools/shooter.c:4:10: fatal error: 'cairo-xlib.h' file not found + (lib.mesonBool "documentation" x11Support) + "-Dbuild-tests=false" + (lib.mesonEnable "tracker" trackerSupport) + (lib.mesonBool "broadway-backend" broadwaySupport) + (lib.mesonEnable "vulkan" vulkanSupport) + (lib.mesonEnable "print-cups" cupsSupport) + (lib.mesonBool "x11-backend" x11Support) + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isAarch64) [ + "-Dmedia-gstreamer=disabled" # requires gstreamer-gl + ]; doCheck = false; # needs X11 @@ -204,13 +201,12 @@ stdenv.mkDerivation (finalAttrs: { # These are the defines that'd you'd get with --enable-debug=minimum (default). # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options - env = - { - NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; - } - // lib.optionalAttrs stdenv.hostPlatform.isMusl { - NIX_LDFLAGS = "-lexecinfo"; - }; + env = { + NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"; + } + // lib.optionalAttrs stdenv.hostPlatform.isMusl { + NIX_LDFLAGS = "-lexecinfo"; + }; postPatch = '' # this conditional gates the installation of share/gsettings-schemas/.../glib-2.0/schemas/gschemas.compiled. @@ -237,25 +233,24 @@ stdenv.mkDerivation (finalAttrs: { PATH="$PATH:$dev/bin" # so the install script finds gtk4-update-icon-cache ''; - postInstall = - '' - PATH="$OLD_PATH" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - # The updater is needed for nixos env and it's tiny. - moveToOutput bin/gtk4-update-icon-cache "$out" - # Launcher - moveToOutput bin/gtk-launch "$out" + postInstall = '' + PATH="$OLD_PATH" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + # The updater is needed for nixos env and it's tiny. + moveToOutput bin/gtk4-update-icon-cache "$out" + # Launcher + moveToOutput bin/gtk-launch "$out" - # TODO: patch glib directly - for f in $dev/bin/gtk4-encode-symbolic-svg; do - wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" - done - '' - + lib.optionalString broadwaySupport '' - # Broadway daemon - moveToOutput bin/gtk4-broadwayd "$out" - ''; + # TODO: patch glib directly + for f in $dev/bin/gtk4-encode-symbolic-svg; do + wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" + done + '' + + lib.optionalString broadwaySupport '' + # Broadway daemon + moveToOutput bin/gtk4-broadwayd "$out" + ''; # Wrap demos postFixup = @@ -303,21 +298,20 @@ stdenv.mkDerivation (finalAttrs: { teams = [ teams.gnome ]; platforms = platforms.all; changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${finalAttrs.version}/NEWS"; - pkgConfigModules = - [ - "gtk4" - ] - ++ lib.optionals broadwaySupport [ - "gtk4-broadway" - ] - ++ lib.optionals stdenv.hostPlatform.isUnix [ - "gtk4-unix-print" - ] - ++ lib.optionals waylandSupport [ - "gtk4-wayland" - ] - ++ lib.optionals x11Support [ - "gtk4-x11" - ]; + pkgConfigModules = [ + "gtk4" + ] + ++ lib.optionals broadwaySupport [ + "gtk4-broadway" + ] + ++ lib.optionals stdenv.hostPlatform.isUnix [ + "gtk4-unix-print" + ] + ++ lib.optionals waylandSupport [ + "gtk4-wayland" + ] + ++ lib.optionals x11Support [ + "gtk4-x11" + ]; }; }) diff --git a/pkgs/development/libraries/gupnp/default.nix b/pkgs/development/libraries/gupnp/default.nix index 52e09d2c916e..b4ecc401586e 100644 --- a/pkgs/development/libraries/gupnp/default.nix +++ b/pkgs/development/libraries/gupnp/default.nix @@ -27,7 +27,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/gupnp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; diff --git a/pkgs/development/libraries/hamlib/4.nix b/pkgs/development/libraries/hamlib/4.nix index 385e29666764..36aaee94df1c 100644 --- a/pkgs/development/libraries/hamlib/4.nix +++ b/pkgs/development/libraries/hamlib/4.nix @@ -32,39 +32,36 @@ stdenv.mkDerivation rec { strictDeps = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - swig - pkg-config - libtool - ] - ++ lib.optionals pythonBindings [ python3 ] - ++ lib.optionals tclBindings [ tcl ] - ++ lib.optionals perlBindings [ perl ]; + nativeBuildInputs = [ + swig + pkg-config + libtool + ] + ++ lib.optionals pythonBindings [ python3 ] + ++ lib.optionals tclBindings [ tcl ] + ++ lib.optionals perlBindings [ perl ]; - buildInputs = - [ - gd - libxml2 - libusb-compat-0_1 - boost - ] - ++ lib.optionals pythonBindings [ - python3 - ncurses - ] - ++ lib.optionals tclBindings [ tcl ]; + buildInputs = [ + gd + libxml2 + libusb-compat-0_1 + boost + ] + ++ lib.optionals pythonBindings [ + python3 + ncurses + ] + ++ lib.optionals tclBindings [ tcl ]; - configureFlags = - [ - "CC_FOR_BUILD=${stdenv.cc.targetPrefix}cc" - ] - ++ lib.optionals perlBindings [ "--with-perl-binding" ] - ++ lib.optionals tclBindings [ - "--with-tcl-binding" - "--with-tcl=${tcl}/lib/" - ] - ++ lib.optionals pythonBindings [ "--with-python-binding" ]; + configureFlags = [ + "CC_FOR_BUILD=${stdenv.cc.targetPrefix}cc" + ] + ++ lib.optionals perlBindings [ "--with-perl-binding" ] + ++ lib.optionals tclBindings [ + "--with-tcl-binding" + "--with-tcl=${tcl}/lib/" + ] + ++ lib.optionals pythonBindings [ "--with-python-binding" ]; meta = with lib; { description = "Runtime library to control radio transceivers and receivers"; diff --git a/pkgs/development/libraries/hamlib/default.nix b/pkgs/development/libraries/hamlib/default.nix index 94292e5fb647..8c0d90182904 100644 --- a/pkgs/development/libraries/hamlib/default.nix +++ b/pkgs/development/libraries/hamlib/default.nix @@ -32,39 +32,36 @@ stdenv.mkDerivation rec { strictDeps = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - swig - pkg-config - libtool - ] - ++ lib.optionals pythonBindings [ python3 ] - ++ lib.optionals tclBindings [ tcl ] - ++ lib.optionals perlBindings [ perl ]; + nativeBuildInputs = [ + swig + pkg-config + libtool + ] + ++ lib.optionals pythonBindings [ python3 ] + ++ lib.optionals tclBindings [ tcl ] + ++ lib.optionals perlBindings [ perl ]; - buildInputs = - [ - gd - libxml2 - libusb-compat-0_1 - boost - ] - ++ lib.optionals pythonBindings [ - python3 - ncurses - ] - ++ lib.optionals tclBindings [ tcl ]; + buildInputs = [ + gd + libxml2 + libusb-compat-0_1 + boost + ] + ++ lib.optionals pythonBindings [ + python3 + ncurses + ] + ++ lib.optionals tclBindings [ tcl ]; - configureFlags = - [ - "CC_FOR_BUILD=${stdenv.cc.targetPrefix}cc" - ] - ++ lib.optionals perlBindings [ "--with-perl-binding" ] - ++ lib.optionals tclBindings [ - "--with-tcl-binding" - "--with-tcl=${tcl}/lib/" - ] - ++ lib.optionals pythonBindings [ "--with-python-binding" ]; + configureFlags = [ + "CC_FOR_BUILD=${stdenv.cc.targetPrefix}cc" + ] + ++ lib.optionals perlBindings [ "--with-perl-binding" ] + ++ lib.optionals tclBindings [ + "--with-tcl-binding" + "--with-tcl=${tcl}/lib/" + ] + ++ lib.optionals pythonBindings [ "--with-python-binding" ]; meta = with lib; { description = "Runtime library to control radio transceivers and receivers"; diff --git a/pkgs/development/libraries/hivex/default.nix b/pkgs/development/libraries/hivex/default.nix index 79315f182689..0441ed81d4ae 100644 --- a/pkgs/development/libraries/hivex/default.nix +++ b/pkgs/development/libraries/hivex/default.nix @@ -28,26 +28,24 @@ stdenv.mkDerivation rec { ''; strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - makeWrapper - perlPackages.perl - pkg-config - ] - ++ (with ocamlPackages; [ - ocaml - findlib - ]); - buildInputs = - [ - libxml2 - ] - ++ (with perlPackages; [ - perl - IOStringy - ]) - ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ]; + nativeBuildInputs = [ + autoreconfHook + makeWrapper + perlPackages.perl + pkg-config + ] + ++ (with ocamlPackages; [ + ocaml + findlib + ]); + buildInputs = [ + libxml2 + ] + ++ (with perlPackages; [ + perl + IOStringy + ]) + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/icu/make-icu.nix b/pkgs/development/libraries/icu/make-icu.nix index c90a2959644c..0ba9681e26df 100644 --- a/pkgs/development/libraries/icu/make-icu.nix +++ b/pkgs/development/libraries/icu/make-icu.nix @@ -53,27 +53,27 @@ let inherit patchFlags patches; - preConfigure = - '' - sed -i -e "s|/bin/sh|${stdenv.shell}|" configure + preConfigure = '' + sed -i -e "s|/bin/sh|${stdenv.shell}|" configure - # $(includedir) is different from $(prefix)/include due to multiple outputs - sed -i -e 's|^\(CPPFLAGS = .*\) -I\$(prefix)/include|\1 -I$(includedir)|' config/Makefile.inc.in - '' - + lib.optionalString stdenv.hostPlatform.isAarch32 '' - # From https://archlinuxarm.org/packages/armv7h/icu/files/icudata-stdlibs.patch - sed -e 's/LDFLAGSICUDT=-nodefaultlibs -nostdlib/LDFLAGSICUDT=/' -i config/mh-linux - ''; + # $(includedir) is different from $(prefix)/include due to multiple outputs + sed -i -e 's|^\(CPPFLAGS = .*\) -I\$(prefix)/include|\1 -I$(includedir)|' config/Makefile.inc.in + '' + + lib.optionalString stdenv.hostPlatform.isAarch32 '' + # From https://archlinuxarm.org/packages/armv7h/icu/files/icudata-stdlibs.patch + sed -e 's/LDFLAGSICUDT=-nodefaultlibs -nostdlib/LDFLAGSICUDT=/' -i config/mh-linux + ''; dontDisableStatic = withStatic; - configureFlags = - [ "--disable-debug" ] - ++ lib.optional (stdenv.hostPlatform.isFreeBSD || stdenv.hostPlatform.isDarwin) "--enable-rpath" - ++ lib.optional ( - stdenv.buildPlatform != stdenv.hostPlatform - ) "--with-cross-build=${nativeBuildRoot}" - ++ lib.optional withStatic "--enable-static"; + configureFlags = [ + "--disable-debug" + ] + ++ lib.optional (stdenv.hostPlatform.isFreeBSD || stdenv.hostPlatform.isDarwin) "--enable-rpath" + ++ lib.optional ( + stdenv.buildPlatform != stdenv.hostPlatform + ) "--with-cross-build=${nativeBuildRoot}" + ++ lib.optional withStatic "--enable-static"; enableParallelBuilding = true; @@ -96,12 +96,14 @@ let outputs = [ "out" "dev" - ] ++ lib.optional withStatic "static"; + ] + ++ lib.optional withStatic "static"; outputBin = "dev"; - nativeBuildInputs = - [ updateAutotoolsGnuConfigScriptsHook ] - ++ + nativeBuildInputs = [ + updateAutotoolsGnuConfigScriptsHook + ] + ++ # FIXME: This fixes dylib references in the dylibs themselves, but # not in the programs in $out/bin. lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; @@ -147,13 +149,11 @@ let pname = pname + "-build-root"; inherit version; - preConfigure = - baseAttrs.preConfigure - + '' - mkdir build - cd build - configureScript=../configure - ''; + preConfigure = baseAttrs.preConfigure + '' + mkdir build + cd build + configureScript=../configure + ''; postBuild = '' cd .. diff --git a/pkgs/development/libraries/irrlicht/default.nix b/pkgs/development/libraries/irrlicht/default.nix index c2b9ddb7e076..0995fb7563a0 100644 --- a/pkgs/development/libraries/irrlicht/default.nix +++ b/pkgs/development/libraries/irrlicht/default.nix @@ -20,14 +20,13 @@ stdenv.mkDerivation { src = common.src; - postPatch = - '' - sed -i -e '/sys\/sysctl.h/d' source/Irrlicht/COSOperator.cpp - '' - + lib.optionalString stdenv.hostPlatform.isAarch64 '' - substituteInPlace source/Irrlicht/Makefile \ - --replace "-DIRRLICHT_EXPORTS=1" "-DIRRLICHT_EXPORTS=1 -DPNG_ARM_NEON_OPT=0" - ''; + postPatch = '' + sed -i -e '/sys\/sysctl.h/d' source/Irrlicht/COSOperator.cpp + '' + + lib.optionalString stdenv.hostPlatform.isAarch64 '' + substituteInPlace source/Irrlicht/Makefile \ + --replace "-DIRRLICHT_EXPORTS=1" "-DIRRLICHT_EXPORTS=1 -DPNG_ARM_NEON_OPT=0" + ''; preConfigure = '' cd source/Irrlicht @@ -50,7 +49,8 @@ stdenv.mkDerivation { libXrandr libX11 libXxf86vm - ] ++ lib.optional stdenv.hostPlatform.isAarch64 zlib; + ] + ++ lib.optional stdenv.hostPlatform.isAarch64 zlib; meta = { homepage = "https://irrlicht.sourceforge.io/"; diff --git a/pkgs/development/libraries/itk/generic.nix b/pkgs/development/libraries/itk/generic.nix index 9e0cedcedece..ede33338a811 100644 --- a/pkgs/development/libraries/itk/generic.nix +++ b/pkgs/development/libraries/itk/generic.nix @@ -96,56 +96,53 @@ stdenv.mkDerivation { ln -sr ${rtkSrc} Modules/Remote/RTK ''; - cmakeFlags = - [ - "-DBUILD_EXAMPLES=OFF" - "-DBUILD_SHARED_LIBS=ON" - "-DITK_FORBID_DOWNLOADS=ON" - "-DITK_USE_SYSTEM_LIBRARIES=ON" # finds common libraries e.g. hdf5, libpng, libtiff, zlib, but not GDCM, NIFTI, MINC, etc. - (lib.cmakeBool "ITK_USE_SYSTEM_EIGEN" (lib.versionAtLeast version "5.4")) - "-DITK_USE_SYSTEM_GOOGLETEST=OFF" # ANTs build failure due to https://github.com/ANTsX/ANTs/issues/1489 - "-DITK_USE_SYSTEM_GDCM=ON" - "-DITK_USE_SYSTEM_MINC=ON" - "-DLIBMINC_DIR=${libminc}/lib/cmake" - "-DModule_ITKMINC=ON" - "-DModule_ITKIOMINC=ON" - "-DModule_ITKIOTransformMINC=ON" - "-DModule_SimpleITKFilters=ON" - "-DModule_ITKReview=ON" - "-DModule_MGHIO=ON" - "-DModule_AdaptiveDenoising=ON" - "-DModule_GenericLabelInterpolator=ON" - ] - ++ lib.optionals enableRtk [ - "-DModule_RTK=ON" - ] - ++ lib.optionals enablePython [ - "-DITK_WRAP_PYTHON=ON" - "-DITK_USE_SYSTEM_CASTXML=ON" - "-DITK_USE_SYSTEM_SWIG=ON" - "-DPY_SITE_PACKAGES_PATH=${placeholder "out"}/${python.sitePackages}" - ] - ++ lib.optionals withVtk [ "-DModule_ITKVtkGlue=ON" ]; + cmakeFlags = [ + "-DBUILD_EXAMPLES=OFF" + "-DBUILD_SHARED_LIBS=ON" + "-DITK_FORBID_DOWNLOADS=ON" + "-DITK_USE_SYSTEM_LIBRARIES=ON" # finds common libraries e.g. hdf5, libpng, libtiff, zlib, but not GDCM, NIFTI, MINC, etc. + (lib.cmakeBool "ITK_USE_SYSTEM_EIGEN" (lib.versionAtLeast version "5.4")) + "-DITK_USE_SYSTEM_GOOGLETEST=OFF" # ANTs build failure due to https://github.com/ANTsX/ANTs/issues/1489 + "-DITK_USE_SYSTEM_GDCM=ON" + "-DITK_USE_SYSTEM_MINC=ON" + "-DLIBMINC_DIR=${libminc}/lib/cmake" + "-DModule_ITKMINC=ON" + "-DModule_ITKIOMINC=ON" + "-DModule_ITKIOTransformMINC=ON" + "-DModule_SimpleITKFilters=ON" + "-DModule_ITKReview=ON" + "-DModule_MGHIO=ON" + "-DModule_AdaptiveDenoising=ON" + "-DModule_GenericLabelInterpolator=ON" + ] + ++ lib.optionals enableRtk [ + "-DModule_RTK=ON" + ] + ++ lib.optionals enablePython [ + "-DITK_WRAP_PYTHON=ON" + "-DITK_USE_SYSTEM_CASTXML=ON" + "-DITK_USE_SYSTEM_SWIG=ON" + "-DPY_SITE_PACKAGES_PATH=${placeholder "out"}/${python.sitePackages}" + ] + ++ lib.optionals withVtk [ "-DModule_ITKVtkGlue=ON" ]; - nativeBuildInputs = - [ - cmake - xz - ] - ++ lib.optionals enablePython [ - castxml - swig - which - ]; + nativeBuildInputs = [ + cmake + xz + ] + ++ lib.optionals enablePython [ + castxml + swig + which + ]; - buildInputs = - [ - libX11 - libuuid - ] - ++ lib.optionals (lib.versionAtLeast version "5.4") [ eigen ] - ++ lib.optionals enablePython [ python ] - ++ lib.optionals withVtk [ vtk ]; + buildInputs = [ + libX11 + libuuid + ] + ++ lib.optionals (lib.versionAtLeast version "5.4") [ eigen ] + ++ lib.optionals enablePython [ python ] + ++ lib.optionals withVtk [ vtk ]; # Due to ITKVtkGlue=ON and the additional dependencies needed to configure VTK 9 # (specifically libGL and libX11 on Linux), # it's now seemingly necessary for packages that configure ITK to @@ -153,23 +150,22 @@ stdenv.mkDerivation { # These deps were propagated from VTK 9 in https://github.com/NixOS/nixpkgs/pull/206935, # so we simply propagate them again from ITK. # This admittedly is a hack and seems like an issue with VTK 9's CMake configuration. - propagatedBuildInputs = - [ - # The dependencies we've un-vendored from ITK, such as GDCM, must be propagated, - # otherwise other software built against ITK fails to configure since ITK headers - # refer to these previously vendored libraries: - expat - fftw - gdcm - hdf5-cpp - libjpeg - libminc - libpng - libtiff - zlib - ] - ++ lib.optionals withVtk vtk.propagatedBuildInputs - ++ lib.optionals enablePython [ numpy ]; + propagatedBuildInputs = [ + # The dependencies we've un-vendored from ITK, such as GDCM, must be propagated, + # otherwise other software built against ITK fails to configure since ITK headers + # refer to these previously vendored libraries: + expat + fftw + gdcm + hdf5-cpp + libjpeg + libminc + libpng + libtiff + zlib + ] + ++ lib.optionals withVtk vtk.propagatedBuildInputs + ++ lib.optionals enablePython [ numpy ]; postInstall = lib.optionalString enablePython '' substitute \ diff --git a/pkgs/development/libraries/jabcode/default.nix b/pkgs/development/libraries/jabcode/default.nix index a7b6404b6a86..0d98953db4ec 100644 --- a/pkgs/development/libraries/jabcode/default.nix +++ b/pkgs/development/libraries/jabcode/default.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation { zlib libpng libtiff - ] ++ lib.optionals (subproject != "library") [ jabcode ]; + ] + ++ lib.optionals (subproject != "library") [ jabcode ]; preConfigure = "cd src/${subdir}"; diff --git a/pkgs/development/libraries/java/saxon/default.nix b/pkgs/development/libraries/java/saxon/default.nix index a5673a24a377..60f8d574eed4 100644 --- a/pkgs/development/libraries/java/saxon/default.nix +++ b/pkgs/development/libraries/java/saxon/default.nix @@ -44,28 +44,27 @@ let sourceRoot = "."; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - install -Dm444 -t $out/share/java/ *.jar - mv doc $out/share + install -Dm444 -t $out/share/java/ *.jar + mv doc $out/share - mkdir -p $out/bin - makeWrapper ${lib.getExe jre} $out/bin/${mainProgram} \ - --add-flags "-jar $out/share/java/${jar'}.jar" - '' - + lib.optionalString (versionAtLeast finalAttrs.version "11") '' - mv lib $out/share/java - '' - + lib.optionalString (versionAtLeast finalAttrs.version "8") '' - makeWrapper ${lib.getExe jre} $out/bin/transform \ - --add-flags "-cp $out/share/java/${jar'}.jar net.sf.saxon.Transform" + mkdir -p $out/bin + makeWrapper ${lib.getExe jre} $out/bin/${mainProgram} \ + --add-flags "-jar $out/share/java/${jar'}.jar" + '' + + lib.optionalString (versionAtLeast finalAttrs.version "11") '' + mv lib $out/share/java + '' + + lib.optionalString (versionAtLeast finalAttrs.version "8") '' + makeWrapper ${lib.getExe jre} $out/bin/transform \ + --add-flags "-cp $out/share/java/${jar'}.jar net.sf.saxon.Transform" - makeWrapper ${lib.getExe jre} $out/bin/query \ - --add-flags "-cp $out/share/java/${jar'}.jar net.sf.saxon.Query" - '' - + "runHook postInstall"; + makeWrapper ${lib.getExe jre} $out/bin/query \ + --add-flags "-cp $out/share/java/${jar'}.jar net.sf.saxon.Query" + '' + + "runHook postInstall"; passthru = lib.optionalAttrs (updateScript != null) { inherit updateScript; diff --git a/pkgs/development/libraries/jemalloc/default.nix b/pkgs/development/libraries/jemalloc/default.nix index 7c70a5c69c68..f5d817be852f 100644 --- a/pkgs/development/libraries/jemalloc/default.nix +++ b/pkgs/development/libraries/jemalloc/default.nix @@ -54,35 +54,34 @@ stdenv.mkDerivation rec { # https://github.com/jemalloc/jemalloc/issues/2346 configureScript = "./autogen.sh"; - configureFlags = - [ - "--with-version=${version}-0-g0000000000000000000000000000000000000000" - "--with-lg-vaddr=${with stdenv.hostPlatform; toString (if isILP32 then 32 else parsed.cpu.bits)}" - ] - # see the comment on stripPrefix - ++ lib.optional stripPrefix "--with-jemalloc-prefix=" - ++ lib.optional disableInitExecTls "--disable-initial-exec-tls" - # jemalloc is unable to correctly detect transparent hugepage support on - # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default - # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support - ++ lib.optionals (stdenv.hostPlatform.isAarch32 && lib.versionOlder version "5") [ - "--disable-thp" - "je_cv_thp=no" - ] - # The upstream default is dependent on the builders' page size - # https://github.com/jemalloc/jemalloc/issues/467 - # https://sources.debian.org/src/jemalloc/5.3.0-3/debian/rules/ - ++ [ - ( - if (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isLoongArch64) then - "--with-lg-page=16" - else - "--with-lg-page=12" - ) - ] - # See https://github.com/jemalloc/jemalloc/issues/1997 - # Using a value of 48 should work on both emulated and native x86_64-darwin. - ++ lib.optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) "--with-lg-vaddr=48"; + configureFlags = [ + "--with-version=${version}-0-g0000000000000000000000000000000000000000" + "--with-lg-vaddr=${with stdenv.hostPlatform; toString (if isILP32 then 32 else parsed.cpu.bits)}" + ] + # see the comment on stripPrefix + ++ lib.optional stripPrefix "--with-jemalloc-prefix=" + ++ lib.optional disableInitExecTls "--disable-initial-exec-tls" + # jemalloc is unable to correctly detect transparent hugepage support on + # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default + # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support + ++ lib.optionals (stdenv.hostPlatform.isAarch32 && lib.versionOlder version "5") [ + "--disable-thp" + "je_cv_thp=no" + ] + # The upstream default is dependent on the builders' page size + # https://github.com/jemalloc/jemalloc/issues/467 + # https://sources.debian.org/src/jemalloc/5.3.0-3/debian/rules/ + ++ [ + ( + if (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isLoongArch64) then + "--with-lg-page=16" + else + "--with-lg-page=12" + ) + ] + # See https://github.com/jemalloc/jemalloc/issues/1997 + # Using a value of 48 should work on both emulated and native x86_64-darwin. + ++ lib.optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) "--with-lg-vaddr=48"; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-error=array-bounds"; diff --git a/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix b/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix index 2347920c863d..377a102c8a57 100644 --- a/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix +++ b/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix @@ -36,16 +36,17 @@ mkDerivation { "out" "dev" ]; - patches = - [ ./kdoctools-no-find-docbook-xml.patch ] - # kf.doctools.core: Error: Could not find kdoctools catalogs - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (fetchpatch { - name = "kdoctools-relocate-datapath.patch"; - url = "https://github.com/msys2/MINGW-packages/raw/0900785a1f4e4146ab9561fb92a1c70fa70fcfc4/mingw-w64-kdoctools-qt5/0001-kdoctools-relocate-datapath.patch"; - hash = "sha256-MlokdrabXavWHGXYmdz9zZDJQIwAdNxebJBSAH2Z3vI="; - }) - ]; + patches = [ + ./kdoctools-no-find-docbook-xml.patch + ] + # kf.doctools.core: Error: Could not find kdoctools catalogs + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (fetchpatch { + name = "kdoctools-relocate-datapath.patch"; + url = "https://github.com/msys2/MINGW-packages/raw/0900785a1f4e4146ab9561fb92a1c70fa70fcfc4/mingw-w64-kdoctools-qt5/0001-kdoctools-relocate-datapath.patch"; + hash = "sha256-MlokdrabXavWHGXYmdz9zZDJQIwAdNxebJBSAH2Z3vI="; + }) + ]; cmakeFlags = [ "-DDocBookXML4_DTD_DIR=${docbook_xml_dtd_45}/xml/dtd/docbook" "-DDocBookXSL_DIR=${docbook_xsl_ns}/xml/xsl/docbook" diff --git a/pkgs/development/libraries/kde-frameworks/kinit/default.nix b/pkgs/development/libraries/kde-frameworks/kinit/default.nix index 9394d5d0edc8..b8b0d74acad0 100644 --- a/pkgs/development/libraries/kde-frameworks/kinit/default.nix +++ b/pkgs/development/libraries/kde-frameworks/kinit/default.nix @@ -42,14 +42,13 @@ mkDerivation { ./0003-kdeinit-extra-libs.patch ./0004-start_kdeinit-environ-hard-limit.patch ]; - CXXFLAGS = - [ - ''-DNIXPKGS_KF5_KIOCORE=\"${getLib kio}/lib/libKF5KIOCore.so.5\"'' - ''-DNIXPKGS_KF5_PARTS=\"${getLib kparts}/lib/libKF5Parts.so.5\"'' - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - ''-DNIXPKGS_KF5_PLASMA=\"${getLib plasma-framework}/lib/libKF5Plasma.so.5\"'' - ]; + CXXFLAGS = [ + ''-DNIXPKGS_KF5_KIOCORE=\"${getLib kio}/lib/libKF5KIOCore.so.5\"'' + ''-DNIXPKGS_KF5_PARTS=\"${getLib kparts}/lib/libKF5Parts.so.5\"'' + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + ''-DNIXPKGS_KF5_PLASMA=\"${getLib plasma-framework}/lib/libKF5Plasma.so.5\"'' + ]; setupHook = writeScript "setup-hook.sh" '' kinitFixupOutputHook() { if [ $prefix != ''${!outputBin} ] && [ -d $prefix/lib ]; then diff --git a/pkgs/development/libraries/kde-frameworks/kio/default.nix b/pkgs/development/libraries/kde-frameworks/kio/default.nix index d13792563fcd..2728ac681f35 100644 --- a/pkgs/development/libraries/kde-frameworks/kio/default.nix +++ b/pkgs/development/libraries/kde-frameworks/kio/default.nix @@ -41,45 +41,43 @@ mkDerivation { extra-cmake-modules kdoctools ]; - buildInputs = - [ - karchive - kconfigwidgets - kdbusaddons - ki18n - kiconthemes - knotifications - ktextwidgets - kwallet - kwidgetsaddons - kwindowsystem - qtscript - qtx11extras - kcrash - libkrb5 - ] - ++ lib.lists.optionals stdenv.hostPlatform.isLinux [ - acl - attr # both are needed for ACL support - util-linux # provides libmount - ]; - propagatedBuildInputs = - [ - kbookmarks - kcompletion - kconfig - kcoreaddons - kitemviews - kjobwidgets - kservice - kxmlgui - qtbase - qttools - solid - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - kded - ]; + buildInputs = [ + karchive + kconfigwidgets + kdbusaddons + ki18n + kiconthemes + knotifications + ktextwidgets + kwallet + kwidgetsaddons + kwindowsystem + qtscript + qtx11extras + kcrash + libkrb5 + ] + ++ lib.lists.optionals stdenv.hostPlatform.isLinux [ + acl + attr # both are needed for ACL support + util-linux # provides libmount + ]; + propagatedBuildInputs = [ + kbookmarks + kcompletion + kconfig + kcoreaddons + kitemviews + kjobwidgets + kservice + kxmlgui + qtbase + qttools + solid + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + kded + ]; outputs = [ "out" "dev" diff --git a/pkgs/development/libraries/kde-frameworks/knotifications.nix b/pkgs/development/libraries/kde-frameworks/knotifications.nix index 390fe48a563b..7374a8f9d501 100644 --- a/pkgs/development/libraries/kde-frameworks/knotifications.nix +++ b/pkgs/development/libraries/kde-frameworks/knotifications.nix @@ -20,17 +20,16 @@ mkDerivation { extra-cmake-modules qttools ]; - buildInputs = - [ - kcodecs - kconfig - kcoreaddons - kwindowsystem - libdbusmenu - phonon - qtx11extras - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - qtmacextras - ]; + buildInputs = [ + kcodecs + kconfig + kcoreaddons + kwindowsystem + libdbusmenu + phonon + qtx11extras + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + qtmacextras + ]; } diff --git a/pkgs/development/libraries/kde-frameworks/solid/default.nix b/pkgs/development/libraries/kde-frameworks/solid/default.nix index ae37195abd27..ddb45ae6aa3f 100644 --- a/pkgs/development/libraries/kde-frameworks/solid/default.nix +++ b/pkgs/development/libraries/kde-frameworks/solid/default.nix @@ -18,7 +18,8 @@ mkDerivation { bison extra-cmake-modules flex - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ media-player-info ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ media-player-info ]; buildInputs = [ qtdeclarative qttools diff --git a/pkgs/development/libraries/kerberos/heimdal.nix b/pkgs/development/libraries/kerberos/heimdal.nix index b2b52e650295..0f5380d93177 100644 --- a/pkgs/development/libraries/kerberos/heimdal.nix +++ b/pkgs/development/libraries/kerberos/heimdal.nix @@ -72,18 +72,17 @@ stdenv.mkDerivation { texinfo ]; - buildInputs = - [ - db - libedit - pam - ] - ++ lib.optionals (withCJSON) [ cjson ] - ++ lib.optionals (withCapNG) [ libcap_ng ] - ++ lib.optionals (withMicroHTTPD) [ libmicrohttpd ] - ++ lib.optionals (withOpenLDAP) [ openldap ] - ++ lib.optionals (withOpenSSL) [ openssl ] - ++ lib.optionals (withSQLite3) [ sqlite ]; + buildInputs = [ + db + libedit + pam + ] + ++ lib.optionals (withCJSON) [ cjson ] + ++ lib.optionals (withCapNG) [ libcap_ng ] + ++ lib.optionals (withMicroHTTPD) [ libmicrohttpd ] + ++ lib.optionals (withOpenLDAP) [ openldap ] + ++ lib.optionals (withOpenSSL) [ openssl ] + ++ lib.optionals (withSQLite3) [ sqlite ]; doCheck = true; nativeCheckInputs = [ @@ -93,33 +92,32 @@ stdenv.mkDerivation { which ]; - configureFlags = - [ - "--with-hdbdir=/var/lib/heimdal" + configureFlags = [ + "--with-hdbdir=/var/lib/heimdal" - "--with-libedit-include=${libedit.dev}/include" - "--with-libedit-lib=${libedit}/lib" - "--with-berkeley-db-include=${db.dev}/include" - "--with-berkeley-db" + "--with-libedit-include=${libedit.dev}/include" + "--with-libedit-lib=${libedit}/lib" + "--with-berkeley-db-include=${db.dev}/include" + "--with-berkeley-db" - "--without-x" - "--disable-afs-string-to-key" - ] - ++ lib.optionals (withCapNG) [ - "--with-capng" - ] - ++ lib.optionals (withCJSON) [ - "--with-cjson=${cjson}" - ] - ++ lib.optionals (withOpenLDAP) [ - "--with-openldap=${openldap.dev}" - ] - ++ lib.optionals (withOpenLDAPAsHDBModule) [ - "--enable-hdb-openldap-module" - ] - ++ lib.optionals (withSQLite3) [ - "--with-sqlite3=${sqlite.dev}" - ]; + "--without-x" + "--disable-afs-string-to-key" + ] + ++ lib.optionals (withCapNG) [ + "--with-capng" + ] + ++ lib.optionals (withCJSON) [ + "--with-cjson=${cjson}" + ] + ++ lib.optionals (withOpenLDAP) [ + "--with-openldap=${openldap.dev}" + ] + ++ lib.optionals (withOpenLDAPAsHDBModule) [ + "--enable-hdb-openldap-module" + ] + ++ lib.optionals (withSQLite3) [ + "--with-sqlite3=${sqlite.dev}" + ]; patches = [ # Proposed @ https://github.com/heimdal/heimdal/pull/1262 diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index 90798e2af98c..c150100eba21 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -54,58 +54,56 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = "-fcommon"; }; - configureFlags = - [ - "--localstatedir=/var/lib" - (lib.withFeature withLdap "ldap") - (lib.withFeature withLibedit "libedit") - (lib.withFeature withVerto "system-verto") - ] - # krb5's ./configure does not allow passing --enable-shared and --enable-static at the same time. - # See https://bbs.archlinux.org/viewtopic.php?pid=1576737#p1576737 - ++ lib.optionals staticOnly [ - "--enable-static" - "--disable-shared" - ] - ++ lib.optional stdenv.hostPlatform.isFreeBSD ''WARN_CFLAGS='' - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "krb5_cv_attr_constructor_destructor=yes,yes" - "ac_cv_func_regcomp=yes" - "ac_cv_printf_positional=yes" - ]; + configureFlags = [ + "--localstatedir=/var/lib" + (lib.withFeature withLdap "ldap") + (lib.withFeature withLibedit "libedit") + (lib.withFeature withVerto "system-verto") + ] + # krb5's ./configure does not allow passing --enable-shared and --enable-static at the same time. + # See https://bbs.archlinux.org/viewtopic.php?pid=1576737#p1576737 + ++ lib.optionals staticOnly [ + "--enable-static" + "--disable-shared" + ] + ++ lib.optional stdenv.hostPlatform.isFreeBSD ''WARN_CFLAGS='' + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "krb5_cv_attr_constructor_destructor=yes,yes" + "ac_cv_func_regcomp=yes" + "ac_cv_printf_positional=yes" + ]; - nativeBuildInputs = - [ - byacc - perl - pkg-config - ] - # Provides the mig command used by the build scripts - ++ lib.optional stdenv.hostPlatform.isDarwin bootstrap_cmds; + nativeBuildInputs = [ + byacc + perl + pkg-config + ] + # Provides the mig command used by the build scripts + ++ lib.optional stdenv.hostPlatform.isDarwin bootstrap_cmds; - buildInputs = - [ openssl ] - ++ lib.optionals ( - stdenv.hostPlatform.isLinux - && stdenv.hostPlatform.libc != "bionic" - && !(stdenv.hostPlatform.useLLVM or false) - ) [ keyutils ] - ++ lib.optionals withLdap [ openldap ] - ++ lib.optionals withLibedit [ libedit ] - ++ lib.optionals withVerto [ libverto ]; + buildInputs = [ + openssl + ] + ++ lib.optionals ( + stdenv.hostPlatform.isLinux + && stdenv.hostPlatform.libc != "bionic" + && !(stdenv.hostPlatform.useLLVM or false) + ) [ keyutils ] + ++ lib.optionals withLdap [ openldap ] + ++ lib.optionals withLibedit [ libedit ] + ++ lib.optionals withVerto [ libverto ]; sourceRoot = "krb5-${version}/src"; - postPatch = - '' - substituteInPlace config/shlib.conf \ - --replace "'ld " "'${stdenv.cc.targetPrefix}ld " - '' - # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion - # necessary for FreeBSD code path in configure - + '' - substituteInPlace ./config/config.guess --replace-fail /usr/bin/uname uname - ''; + postPatch = '' + substituteInPlace config/shlib.conf \ + --replace "'ld " "'${stdenv.cc.targetPrefix}ld " + '' + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion + # necessary for FreeBSD code path in configure + + '' + substituteInPlace ./config/config.guess --replace-fail /usr/bin/uname uname + ''; libFolders = [ "util" diff --git a/pkgs/development/libraries/libbutl/default.nix b/pkgs/development/libraries/libbutl/default.nix index e8e7a6997daa..dc13fb6dee4f 100644 --- a/pkgs/development/libraries/libbutl/default.nix +++ b/pkgs/development/libraries/libbutl/default.nix @@ -24,13 +24,12 @@ stdenv.mkDerivation rec { hash = "sha256-sFqaEf6s2rF1YcZjw5J6oY5ol5PbO9vy6NseKjrvTvs="; }; - nativeBuildInputs = - [ - build2 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - DarwinTools - ]; + nativeBuildInputs = [ + build2 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + DarwinTools + ]; patches = [ # Install missing .h files needed by dependers diff --git a/pkgs/development/libraries/libcec/default.nix b/pkgs/development/libraries/libcec/default.nix index f2be99a6d600..35644296a1d5 100644 --- a/pkgs/development/libraries/libcec/default.nix +++ b/pkgs/development/libraries/libcec/default.nix @@ -33,15 +33,15 @@ stdenv.mkDerivation rec { buildInputs = [ udev libcec_platform - ] ++ lib.optional withLibraspberrypi libraspberrypi; + ] + ++ lib.optional withLibraspberrypi libraspberrypi; - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=1" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DHAVE_LINUX_API=1" - ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=1" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DHAVE_LINUX_API=1" + ]; meta = with lib; { description = "Allows you (with the right hardware) to control your device with your TV remote control using existing HDMI cabling"; diff --git a/pkgs/development/libraries/libcommuni/default.nix b/pkgs/development/libraries/libcommuni/default.nix index 54b362b4ed34..f85f66027f0d 100644 --- a/pkgs/development/libraries/libcommuni/default.nix +++ b/pkgs/development/libraries/libcommuni/default.nix @@ -31,16 +31,15 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; dontUseQmakeConfigure = true; - configureFlags = - [ - "-config" - "release" - ] - # Build mixes up dylibs/frameworks if one is not explicitly specified. - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-config" - "qt_framework" - ]; + configureFlags = [ + "-config" + "release" + ] + # Build mixes up dylibs/frameworks if one is not explicitly specified. + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-config" + "qt_framework" + ]; dontWrapQtApps = true; diff --git a/pkgs/development/libraries/libdevil/default.nix b/pkgs/development/libraries/libdevil/default.nix index 58545dd08127..94e1b9555932 100644 --- a/pkgs/development/libraries/libdevil/default.nix +++ b/pkgs/development/libraries/libdevil/default.nix @@ -39,19 +39,18 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - libjpeg - libpng - libmng - lcms1 - libtiff - openexr - ] - ++ lib.optionals withXorg [ - libX11 - libGL - ]; + buildInputs = [ + libjpeg + libpng + libmng + lcms1 + libtiff + openexr + ] + ++ lib.optionals withXorg [ + libX11 + libGL + ]; configureFlags = [ "--enable-ILU" diff --git a/pkgs/development/libraries/libextractor/default.nix b/pkgs/development/libraries/libextractor/default.nix index c8a545239846..bb8888d130dd 100644 --- a/pkgs/development/libraries/libextractor/default.nix +++ b/pkgs/development/libraries/libextractor/default.nix @@ -48,24 +48,23 @@ stdenv.mkDerivation rec { hash = "sha256-u48xLFHSAlciQ/ETxrYtghAwGrMMuu5gT5g32HjN91U="; }; - patches = - [ - # 0008513: test_exiv2 fails with Exiv2 0.28 - # https://bugs.gnunet.org/view.php?id=8513 - (fetchpatch2 { - url = "https://sources.debian.org/data/main/libe/libextractor/1%3A1.13-4/debian/patches/exiv2-0.28.diff"; - hash = "sha256-Re5iwlSyEpWu3PcHibaRKSfmdyHSZGMOdMZ6svTofvs="; - }) - ] - ++ lib.optionals gstreamerSupport [ + patches = [ + # 0008513: test_exiv2 fails with Exiv2 0.28 + # https://bugs.gnunet.org/view.php?id=8513 + (fetchpatch2 { + url = "https://sources.debian.org/data/main/libe/libextractor/1%3A1.13-4/debian/patches/exiv2-0.28.diff"; + hash = "sha256-Re5iwlSyEpWu3PcHibaRKSfmdyHSZGMOdMZ6svTofvs="; + }) + ] + ++ lib.optionals gstreamerSupport [ - # Libraries cannot be wrapped so we need to hardcode the plug-in paths. - (replaceVars ./gst-hardcode-plugins.patch { - load_gst_plugins = lib.concatMapStrings ( - plugin: ''gst_registry_scan_path(gst_registry_get(), "${lib.getLib plugin}/lib/gstreamer-1.0");'' - ) (gstPlugins gst_all_1); - }) - ]; + # Libraries cannot be wrapped so we need to hardcode the plug-in paths. + (replaceVars ./gst-hardcode-plugins.patch { + load_gst_plugins = lib.concatMapStrings ( + plugin: ''gst_registry_scan_path(gst_registry_get(), "${lib.getLib plugin}/lib/gstreamer-1.0");'' + ) (gstPlugins gst_all_1); + }) + ]; preConfigure = '' echo "patching installation directory in \`extractor.c'..." @@ -75,24 +74,23 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - libtool - gettext - zlib - bzip2 - flac - libvorbis - exiv2 - libgsf - ] - ++ lib.optionals rpmSupport [ rpm ] - ++ lib.optionals gstreamerSupport ([ gst_all_1.gstreamer ] ++ gstPlugins gst_all_1) - ++ lib.optionals gtkSupport [ - glib - gtk3 - ] - ++ lib.optionals videoSupport [ libmpeg2 ]; + buildInputs = [ + libtool + gettext + zlib + bzip2 + flac + libvorbis + exiv2 + libgsf + ] + ++ lib.optionals rpmSupport [ rpm ] + ++ lib.optionals gstreamerSupport ([ gst_all_1.gstreamer ] ++ gstPlugins gst_all_1) + ++ lib.optionals gtkSupport [ + glib + gtk3 + ] + ++ lib.optionals videoSupport [ libmpeg2 ]; # Checks need to be run after "make install", otherwise plug-ins are not in # the search path, etc. diff --git a/pkgs/development/libraries/libgda/5.x.nix b/pkgs/development/libraries/libgda/5.x.nix index d2afa53c52eb..0761542379d3 100644 --- a/pkgs/development/libraries/libgda/5.x.nix +++ b/pkgs/development/libraries/libgda/5.x.nix @@ -61,18 +61,17 @@ stdenv.mkDerivation rec { libpq.pg_config ]; - buildInputs = - [ - gtk3 - openssl - libgee - ] - ++ lib.optionals mysqlSupport [ - libmysqlclient - ] - ++ lib.optionals postgresSupport [ - libpq - ]; + buildInputs = [ + gtk3 + openssl + libgee + ] + ++ lib.optionals mysqlSupport [ + libmysqlclient + ] + ++ lib.optionals postgresSupport [ + libpq + ]; propagatedBuildInputs = [ libxml2 diff --git a/pkgs/development/libraries/libgda/6.x.nix b/pkgs/development/libraries/libgda/6.x.nix index 06f9c064b9da..f9f75b0312b9 100644 --- a/pkgs/development/libraries/libgda/6.x.nix +++ b/pkgs/development/libraries/libgda/6.x.nix @@ -73,21 +73,20 @@ stdenv.mkDerivation rec { yelp-tools ]; - buildInputs = - [ - gtk3 - json-glib - isocodes - openssl - libgee - sqlite - ] - ++ lib.optionals mysqlSupport [ - libmysqlclient - ] - ++ lib.optionals postgresSupport [ - libpq - ]; + buildInputs = [ + gtk3 + json-glib + isocodes + openssl + libgee + sqlite + ] + ++ lib.optionals mysqlSupport [ + libmysqlclient + ] + ++ lib.optionals postgresSupport [ + libpq + ]; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types"; diff --git a/pkgs/development/libraries/libhandy/default.nix b/pkgs/development/libraries/libhandy/default.nix index f6fdf43b56b0..e69d28ee632a 100644 --- a/pkgs/development/libraries/libhandy/default.nix +++ b/pkgs/development/libraries/libhandy/default.nix @@ -29,15 +29,14 @@ stdenv.mkDerivation rec { pname = "libhandy"; version = "1.8.3"; - outputs = - [ - "out" - "dev" - "devdoc" - ] - ++ lib.optionals enableGlade [ - "glade" - ]; + outputs = [ + "out" + "dev" + "devdoc" + ] + ++ lib.optionals enableGlade [ + "glade" + ]; outputBin = "dev"; src = fetchurl { @@ -49,27 +48,25 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - gobject-introspection - gi-docgen - meson - ninja - pkg-config - vala - ] - ++ lib.optionals enableGlade [ - libxml2 # for xmllint - ]; + nativeBuildInputs = [ + gobject-introspection + gi-docgen + meson + ninja + pkg-config + vala + ] + ++ lib.optionals enableGlade [ + libxml2 # for xmllint + ]; - buildInputs = - [ - gdk-pixbuf - gtk3 - ] - ++ lib.optionals enableGlade [ - glade - ]; + buildInputs = [ + gdk-pixbuf + gtk3 + ] + ++ lib.optionals enableGlade [ + glade + ]; nativeCheckInputs = [ xvfb-run @@ -120,26 +117,25 @@ stdenv.mkDerivation rec { moveToOutput "share/doc" "$devdoc" ''; - passthru = - { - updateScript = gnome.updateScript { - packageName = pname; - versionPolicy = "odd-unstable"; - }; - } - // lib.optionalAttrs (!enableGlade) { - glade = - let - libhandyWithGlade = libhandy.override { - enableGlade = true; - }; - in - runCommand "${libhandy.name}-glade" { } '' - cp -r "${libhandyWithGlade.glade}" "$out" - chmod -R +w "$out" - sed -e "s#${libhandyWithGlade.out}#${libhandy.out}#g" -e "s#${libhandyWithGlade.glade}#$out#g" -i $(find "$out" -type f) - ''; + passthru = { + updateScript = gnome.updateScript { + packageName = pname; + versionPolicy = "odd-unstable"; }; + } + // lib.optionalAttrs (!enableGlade) { + glade = + let + libhandyWithGlade = libhandy.override { + enableGlade = true; + }; + in + runCommand "${libhandy.name}-glade" { } '' + cp -r "${libhandyWithGlade.glade}" "$out" + chmod -R +w "$out" + sed -e "s#${libhandyWithGlade.out}#${libhandy.out}#g" -e "s#${libhandyWithGlade.glade}#$out#g" -i $(find "$out" -type f) + ''; + }; meta = with lib; { changelog = "https://gitlab.gnome.org/GNOME/libhandy/-/tags/${version}"; diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix index e3a0d34d6703..c466646c9358 100644 --- a/pkgs/development/libraries/libiconv/default.nix +++ b/pkgs/development/libraries/libiconv/default.nix @@ -75,7 +75,8 @@ stdenv.mkDerivation rec { configureFlags = [ (lib.enableFeature enableStatic "static") (lib.enableFeature enableShared "shared") - ] ++ lib.optional stdenv.hostPlatform.isFreeBSD "--with-pic"; + ] + ++ lib.optional stdenv.hostPlatform.isFreeBSD "--with-pic"; passthru = { inherit setupHooks; }; diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index a5fba6c8d91f..54076c6063a4 100644 --- a/pkgs/development/libraries/libinput/default.nix +++ b/pkgs/development/libraries/libinput/default.nix @@ -70,40 +70,38 @@ stdenv.mkDerivation rec { ./udev-absolute-path.patch ]; - nativeBuildInputs = - [ - pkg-config - meson - ninja - udevCheckHook - ] - ++ lib.optionals documentationSupport [ - doxygen - graphviz - sphinx-build - ]; + nativeBuildInputs = [ + pkg-config + meson + ninja + udevCheckHook + ] + ++ lib.optionals documentationSupport [ + doxygen + graphviz + sphinx-build + ]; - buildInputs = - [ - libevdev - mtdev - libwacom - (python3.withPackages ( - pp: with pp; [ - pp.libevdev # already in scope - pyudev - pyyaml - setuptools - ] - )) - ] - ++ lib.optionals eventGUISupport [ - # GUI event viewer - cairo - glib - gtk3 - wayland-scanner - ]; + buildInputs = [ + libevdev + mtdev + libwacom + (python3.withPackages ( + pp: with pp; [ + pp.libevdev # already in scope + pyudev + pyyaml + setuptools + ] + )) + ] + ++ lib.optionals eventGUISupport [ + # GUI event viewer + cairo + glib + gtk3 + wayland-scanner + ]; propagatedBuildInputs = [ udev diff --git a/pkgs/development/libraries/libint/default.nix b/pkgs/development/libraries/libint/default.nix index f4db760b7fbd..667dcd34b915 100644 --- a/pkgs/development/libraries/libint/default.nix +++ b/pkgs/development/libraries/libint/default.nix @@ -176,39 +176,39 @@ let python3 perl gmpxx - ] ++ lib.optional enableFortran gfortran; + ] + ++ lib.optional enableFortran gfortran; buildInputs = [ boost eigen ]; - configureFlags = - [ - "--with-max-am=${builtins.toString maxAm}" - "--with-eri-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eriAm)}" - "--with-eri3-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri3Am)}" - "--with-eri2-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri2Am)}" - "--with-eri-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eriOptAm)}" - "--with-eri3-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri3OptAm)}" - "--with-eri2-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri2OptAm)}" - "--with-cartgauss-ordering=${cartGaussOrd}" - "--with-shgauss-ordering=${shGaussOrd}" - "--with-shell-set=${shellSet}" - ] - ++ lib.optional enableFMA "--enable-fma" - ++ lib.optional (eriDeriv > 0) "--enable-eri=${builtins.toString eriDeriv}" - ++ lib.optional (eri2Deriv > 0) "--enable-eri2=${builtins.toString eri2Deriv}" - ++ lib.optional (eri3Deriv > 0) "--enable-eri3=${builtins.toString eri3Deriv}" - ++ lib.optionals enableOneBody [ - "--enable-1body=${builtins.toString oneBodyDerivOrd}" - "--enable-1body-property-derivs" - ] - ++ lib.optional (multipoleOrd > 0) "--with-multipole-max-order=${builtins.toString multipoleOrd}" - ++ lib.optional enableGeneric "--enable-generic" - ++ lib.optional enableContracted "--enable-contracted-ints" - ++ lib.optional eri3PureSh "--enable-eri3-pure-sh" - ++ lib.optional eri2PureSh "--enable-eri2-pure-sh"; + configureFlags = [ + "--with-max-am=${builtins.toString maxAm}" + "--with-eri-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eriAm)}" + "--with-eri3-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri3Am)}" + "--with-eri2-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri2Am)}" + "--with-eri-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eriOptAm)}" + "--with-eri3-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri3OptAm)}" + "--with-eri2-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri2OptAm)}" + "--with-cartgauss-ordering=${cartGaussOrd}" + "--with-shgauss-ordering=${shGaussOrd}" + "--with-shell-set=${shellSet}" + ] + ++ lib.optional enableFMA "--enable-fma" + ++ lib.optional (eriDeriv > 0) "--enable-eri=${builtins.toString eriDeriv}" + ++ lib.optional (eri2Deriv > 0) "--enable-eri2=${builtins.toString eri2Deriv}" + ++ lib.optional (eri3Deriv > 0) "--enable-eri3=${builtins.toString eri3Deriv}" + ++ lib.optionals enableOneBody [ + "--enable-1body=${builtins.toString oneBodyDerivOrd}" + "--enable-1body-property-derivs" + ] + ++ lib.optional (multipoleOrd > 0) "--with-multipole-max-order=${builtins.toString multipoleOrd}" + ++ lib.optional enableGeneric "--enable-generic" + ++ lib.optional enableContracted "--enable-contracted-ints" + ++ lib.optional eri3PureSh "--enable-eri3-pure-sh" + ++ lib.optional eri2PureSh "--enable-eri2-pure-sh"; preConfigure = '' ./autogen.sh @@ -234,7 +234,8 @@ let nativeBuildInputs = [ python3 cmake - ] ++ lib.optional enableFortran gfortran; + ] + ++ lib.optional enableFortran gfortran; buildInputs = [ boost @@ -244,12 +245,11 @@ let # Default is just "double", but SSE2 is available on all x86_64 CPUs. # AVX support is advertised, but does not work. # Fortran interface is incompatible with changing the LIBINT2_REALTYPE. - cmakeFlags = - [ - "-DLIBINT2_SHGAUSS_ORDERING=${shGaussOrd}" - ] - ++ lib.optional enableFortran "-DENABLE_FORTRAN=ON" - ++ lib.optional enableSSE "-DLIBINT2_REALTYPE=libint2::simd::VectorSSEDouble"; + cmakeFlags = [ + "-DLIBINT2_SHGAUSS_ORDERING=${shGaussOrd}" + ] + ++ lib.optional enableFortran "-DENABLE_FORTRAN=ON" + ++ lib.optional enableSSE "-DLIBINT2_REALTYPE=libint2::simd::VectorSSEDouble"; # Can only build in the source-tree. A lot of preprocessing magic fails otherwise. dontUseCmakeBuildDir = true; diff --git a/pkgs/development/libraries/libopenshot/default.nix b/pkgs/development/libraries/libopenshot/default.nix index 2d8798acff10..fe35ff540322 100644 --- a/pkgs/development/libraries/libopenshot/default.nix +++ b/pkgs/development/libraries/libopenshot/default.nix @@ -42,24 +42,23 @@ stdenv.mkDerivation (finalAttrs: { swig ]; - buildInputs = - [ - cppzmq - ffmpeg - imagemagick - jsoncpp - libopenshot-audio - python3 - qtbase - qtmultimedia - zeromq - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - llvmPackages.openmp - ]; + buildInputs = [ + cppzmq + ffmpeg + imagemagick + jsoncpp + libopenshot-audio + python3 + qtbase + qtmultimedia + zeromq + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + llvmPackages.openmp + ]; strictDeps = true; diff --git a/pkgs/development/libraries/libpulsar/default.nix b/pkgs/development/libraries/libpulsar/default.nix index 3e8c5059def7..a6c7f0ec37a4 100644 --- a/pkgs/development/libraries/libpulsar/default.nix +++ b/pkgs/development/libraries/libpulsar/default.nix @@ -36,14 +36,15 @@ let */ enableCmakeFeature = p: if (p == null || p == false) then "OFF" else "ON"; - defaultOptionals = - [ protobuf ] - ++ lib.optional snappySupport snappy.dev - ++ lib.optional zlibSupport zlib - ++ lib.optional zstdSupport zstd - ++ lib.optional log4cxxSupport log4cxx - ++ lib.optional asioSupport asio - ++ lib.optional (!asioSupport) boost; + defaultOptionals = [ + protobuf + ] + ++ lib.optional snappySupport snappy.dev + ++ lib.optional zlibSupport zlib + ++ lib.optional zstdSupport zstd + ++ lib.optional log4cxxSupport log4cxx + ++ lib.optional asioSupport asio + ++ lib.optional (!asioSupport) boost; in stdenv.mkDerivation (finalAttrs: { @@ -57,19 +58,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-3kUyimyv0Si3zUFaIsIVdulzH8l2fxe6BO9a5L6n8I8="; }; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ defaultOptionals - ++ lib.optional gtestSupport gtest.dev; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ defaultOptionals + ++ lib.optional gtestSupport gtest.dev; buildInputs = [ jsoncpp openssl curl - ] ++ defaultOptionals; + ] + ++ defaultOptionals; cmakeFlags = [ "-DBUILD_TESTS=${enableCmakeFeature gtestSupport}" diff --git a/pkgs/development/libraries/libqtdbusmock/default.nix b/pkgs/development/libraries/libqtdbusmock/default.nix index e56ad38ddb1a..6d91ae4ace51 100644 --- a/pkgs/development/libraries/libqtdbusmock/default.nix +++ b/pkgs/development/libraries/libqtdbusmock/default.nix @@ -27,15 +27,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-hVw2HnIHlA7vvt0Sr6F2qVhvBZ33aCeqb9vgbu3rgBo="; }; - postPatch = - '' - # Workaround for "error: expected unqualified-id before 'public'" on "**signals" - sed -i -e '/add_definitions/a -DQT_NO_KEYWORDS' CMakeLists.txt - '' - + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' - # Don't build tests when we're not running them - sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt - ''; + postPatch = '' + # Workaround for "error: expected unqualified-id before 'public'" on "**signals" + sed -i -e '/add_definitions/a -DQT_NO_KEYWORDS' CMakeLists.txt + '' + + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' + # Don't build tests when we're not running them + sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt + ''; strictDeps = true; diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix index 2640330fb188..674621b422b2 100644 --- a/pkgs/development/libraries/librdf/redland.nix +++ b/pkgs/development/libraries/librdf/redland.nix @@ -32,31 +32,32 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl pkg-config - ] ++ lib.optional withPostgresql libpq.pg_config; + ] + ++ lib.optional withPostgresql libpq.pg_config; - buildInputs = - [ - openssl - libxslt - curl - libxml2 - gmp - ] - ++ lib.optional withMysql libmysqlclient - ++ lib.optional withSqlite sqlite - ++ lib.optional withPostgresql libpq - ++ lib.optional withBdb db; + buildInputs = [ + openssl + libxslt + curl + libxml2 + gmp + ] + ++ lib.optional withMysql libmysqlclient + ++ lib.optional withSqlite sqlite + ++ lib.optional withPostgresql libpq + ++ lib.optional withBdb db; propagatedBuildInputs = [ librdf_rasqal ]; postInstall = "rm -rvf $out/share/gtk-doc"; - configureFlags = - [ "--with-threads" ] - ++ lib.optionals withBdb [ - "--with-bdb-include=${db.dev}/include" - "--with-bdb-lib=${db.out}/lib" - ]; + configureFlags = [ + "--with-threads" + ] + ++ lib.optionals withBdb [ + "--with-bdb-include=${db.dev}/include" + "--with-bdb-lib=${db.out}/lib" + ]; # Fix broken DT_NEEDED in lib/redland/librdf_storage_sqlite.so. NIX_CFLAGS_LINK = "-lraptor2"; diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix index 9639193ffb58..de33e8d0c968 100644 --- a/pkgs/development/libraries/librealsense/default.nix +++ b/pkgs/development/libraries/librealsense/default.nix @@ -40,27 +40,26 @@ stdenv.mkDerivation rec { sha256 = "sha256-Stx337mGcpMCg9DlZmvX4LPQmCSzLRFcUQPxaD/Y0Ds="; }; - buildInputs = + buildInputs = [ + libusb1 + gcc.cc.lib + nlohmann_json + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] + ++ lib.optionals enablePython ( + with pythonPackages; [ - libusb1 - gcc.cc.lib - nlohmann_json + python + pybind11 ] - ++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] - ++ lib.optionals enablePython ( - with pythonPackages; - [ - python - pybind11 - ] - ) - ++ lib.optionals enableGUI [ - libgbm - gtk3 - glfw - libGLU - curl - ]; + ) + ++ lib.optionals enableGUI [ + libgbm + gtk3 + glfw + libGLU + curl + ]; patches = [ ./py_pybind11_no_external_download.patch @@ -75,41 +74,38 @@ stdenv.mkDerivation rec { 'find_package(nlohmann_json 3.11.3 REQUIRED)' ''; - nativeBuildInputs = - [ - cmake - ninja - pkg-config - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; - cmakeFlags = - [ - "-DBUILD_EXAMPLES=ON" - "-DBUILD_GRAPHICAL_EXAMPLES=${lib.boolToString enableGUI}" - "-DBUILD_GLSL_EXTENSIONS=${lib.boolToString enableGUI}" - "-DCHECK_FOR_UPDATES=OFF" # activated by BUILD_GRAPHICAL_EXAMPLES, will make it download and compile libcurl - ] - ++ lib.optionals enablePython [ - "-DBUILD_PYTHON_BINDINGS:bool=true" - "-DXXNIX_PYTHON_SITEPACKAGES=${placeholder "out"}/${pythonPackages.python.sitePackages}" - ] - ++ lib.optional cudaSupport "-DBUILD_WITH_CUDA:bool=true"; + cmakeFlags = [ + "-DBUILD_EXAMPLES=ON" + "-DBUILD_GRAPHICAL_EXAMPLES=${lib.boolToString enableGUI}" + "-DBUILD_GLSL_EXTENSIONS=${lib.boolToString enableGUI}" + "-DCHECK_FOR_UPDATES=OFF" # activated by BUILD_GRAPHICAL_EXAMPLES, will make it download and compile libcurl + ] + ++ lib.optionals enablePython [ + "-DBUILD_PYTHON_BINDINGS:bool=true" + "-DXXNIX_PYTHON_SITEPACKAGES=${placeholder "out"}/${pythonPackages.python.sitePackages}" + ] + ++ lib.optional cudaSupport "-DBUILD_WITH_CUDA:bool=true"; # ensure python package contains its __init__.py. for some reason the install # script does not do this, and it's questionable if intel knows it should be # done # ( https://github.com/IntelRealSense/meta-intel-realsense/issues/20 ) - postInstall = - '' - substituteInPlace $out/lib/cmake/realsense2/realsense2Targets.cmake \ - --replace-fail "\''${_IMPORT_PREFIX}/include" "$dev/include" - '' - + lib.optionalString enablePython '' - cp ../wrappers/python/pyrealsense2/__init__.py $out/${pythonPackages.python.sitePackages}/pyrealsense2 - ''; + postInstall = '' + substituteInPlace $out/lib/cmake/realsense2/realsense2Targets.cmake \ + --replace-fail "\''${_IMPORT_PREFIX}/include" "$dev/include" + '' + + lib.optionalString enablePython '' + cp ../wrappers/python/pyrealsense2/__init__.py $out/${pythonPackages.python.sitePackages}/pyrealsense2 + ''; meta = with lib; { description = "Cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300)"; diff --git a/pkgs/development/libraries/libressl/default.nix b/pkgs/development/libraries/libressl/default.nix index 471cdca203a4..fe8731c0a38f 100644 --- a/pkgs/development/libraries/libressl/default.nix +++ b/pkgs/development/libraries/libressl/default.nix @@ -41,7 +41,8 @@ let "-DCMAKE_INSTALL_LIBDIR=lib" "-DTLS_DEFAULT_CA_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt" - ] ++ lib.optional buildShared "-DBUILD_SHARED_LIBS=ON"; + ] + ++ lib.optional buildShared "-DBUILD_SHARED_LIBS=ON"; # The autoconf build is broken as of 2.9.1, resulting in the following error: # libressl-2.9.1/tls/.libs/libtls.a', needed by 'handshake_table'. @@ -56,11 +57,10 @@ let inherit patches; - postPatch = - '' - patchShebangs tests/ - '' - + postPatch; + postPatch = '' + patchShebangs tests/ + '' + + postPatch; doCheck = !(stdenv.hostPlatform.isPower64 || stdenv.hostPlatform.isRiscV); preCheck = '' diff --git a/pkgs/development/libraries/librest/default.nix b/pkgs/development/libraries/librest/default.nix index 11652f14c589..bbec9328260b 100644 --- a/pkgs/development/libraries/librest/default.nix +++ b/pkgs/development/libraries/librest/default.nix @@ -28,16 +28,15 @@ stdenv.mkDerivation rec { sha256 = "0513aad38e5d3cedd4ae3c551634e3be1b9baaa79775e53b2dba9456f15b01c9"; }; - nativeBuildInputs = - [ - pkg-config - gobject-introspection - ] - ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - gtk-doc - docbook-xsl-nons - docbook_xml_dtd_412 - ]; + nativeBuildInputs = [ + pkg-config + gobject-introspection + ] + ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + gtk-doc + docbook-xsl-nons + docbook_xml_dtd_412 + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/development/libraries/libsoup/3.x.nix b/pkgs/development/libraries/libsoup/3.x.nix index 461b2388b44c..5b55009207de 100644 --- a/pkgs/development/libraries/libsoup/3.x.nix +++ b/pkgs/development/libraries/libsoup/3.x.nix @@ -29,7 +29,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional withIntrospection "devdoc"; + ] + ++ lib.optional withIntrospection "devdoc"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -40,31 +41,29 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - glib - python3 - ] - ++ lib.optionals withIntrospection [ - gi-docgen - gobject-introspection - vala - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + glib + python3 + ] + ++ lib.optionals withIntrospection [ + gi-docgen + gobject-introspection + vala + ]; - buildInputs = - [ - sqlite - libpsl - glib.out - brotli - libnghttp2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libsysprof-capture - ]; + buildInputs = [ + sqlite + libpsl + glib.out + brotli + libnghttp2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libsysprof-capture + ]; propagatedBuildInputs = [ glib diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix index f15210109e44..ba3cb41169ab 100644 --- a/pkgs/development/libraries/libsoup/default.nix +++ b/pkgs/development/libraries/libsoup/default.nix @@ -68,46 +68,43 @@ stdenv.mkDerivation rec { pkg-config ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - glib - ] - ++ lib.optionals withIntrospection [ - gobject-introspection - vala - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + glib + ] + ++ lib.optionals withIntrospection [ + gobject-introspection + vala + ]; - buildInputs = - [ - sqlite - libpsl - glib.out - brotli - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libsysprof-capture - ]; + buildInputs = [ + sqlite + libpsl + glib.out + brotli + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libsysprof-capture + ]; propagatedBuildInputs = [ glib libxml2 ]; - mesonFlags = - [ - "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency - "-Dgssapi=disabled" - "-Dvapi=${if withIntrospection then "enabled" else "disabled"}" - "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" - "-Dgnome=${lib.boolToString gnomeSupport}" - "-Dntlm=disabled" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - "-Dsysprof=disabled" - ]; + mesonFlags = [ + "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency + "-Dgssapi=disabled" + "-Dvapi=${if withIntrospection then "enabled" else "disabled"}" + "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}" + "-Dgnome=${lib.boolToString gnomeSupport}" + "-Dntlm=disabled" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + "-Dsysprof=disabled" + ]; env.NIX_CFLAGS_COMPILE = "-lpthread"; diff --git a/pkgs/development/libraries/libubox/default.nix b/pkgs/development/libraries/libubox/default.nix index 55f1cb1a2c4a..f186fbc82412 100644 --- a/pkgs/development/libraries/libubox/default.nix +++ b/pkgs/development/libraries/libubox/default.nix @@ -30,8 +30,11 @@ stdenv.mkDerivation { cmake pkg-config ]; - buildInputs = - [ json_c ] ++ lib.optional with_lua lua5_1 ++ lib.optional with_ustream_ssl ustream-ssl; + buildInputs = [ + json_c + ] + ++ lib.optional with_lua lua5_1 + ++ lib.optional with_ustream_ssl ustream-ssl; postInstall = lib.optionalString with_ustream_ssl '' for fin in $(find ${ustream-ssl} -type f); do diff --git a/pkgs/development/libraries/libunique/default.nix b/pkgs/development/libraries/libunique/default.nix index a8fa987f673a..0a5d464b5169 100644 --- a/pkgs/development/libraries/libunique/default.nix +++ b/pkgs/development/libraries/libunique/default.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation rec { ./1.1.6-fix-test.patch ./1.1.6-G_CONST_RETURN.patch ./1.1.6-include-terminator.patch - ] ++ [ ./gcc7-bug.patch ]; + ] + ++ [ ./gcc7-bug.patch ]; nativeBuildInputs = [ pkg-config ]; buildInputs = [ diff --git a/pkgs/development/libraries/libunwind/default.nix b/pkgs/development/libraries/libunwind/default.nix index b6b8ab73142f..0f7b5de4f94d 100644 --- a/pkgs/development/libraries/libunwind/default.nix +++ b/pkgs/development/libraries/libunwind/default.nix @@ -43,20 +43,19 @@ stdenv.mkDerivation (finalAttrs: { "devman" ]; - configureFlags = - [ - # Starting from 1.8.1 libunwind installs testsuite by default. - # As we don't run the tests we disable it (this also fixes circular - # reference install failure). - "--disable-tests" - # Without latex2man, no man pages are installed despite being - # prebuilt in the source tarball. - "LATEX2MAN=${buildPackages.coreutils}/bin/true" - ] - # See https://github.com/libunwind/libunwind/issues/693 - ++ lib.optionals (with stdenv.hostPlatform; isAarch64 && isMusl && !isStatic) [ - "CFLAGS=-mno-outline-atomics" - ]; + configureFlags = [ + # Starting from 1.8.1 libunwind installs testsuite by default. + # As we don't run the tests we disable it (this also fixes circular + # reference install failure). + "--disable-tests" + # Without latex2man, no man pages are installed despite being + # prebuilt in the source tarball. + "LATEX2MAN=${buildPackages.coreutils}/bin/true" + ] + # See https://github.com/libunwind/libunwind/issues/693 + ++ lib.optionals (with stdenv.hostPlatform; isAarch64 && isMusl && !isStatic) [ + "CFLAGS=-mno-outline-atomics" + ]; propagatedBuildInputs = [ xz ]; diff --git a/pkgs/development/libraries/libva/1.nix b/pkgs/development/libraries/libva/1.nix index 05680090878a..ae0ac2d3e2ea 100644 --- a/pkgs/development/libraries/libva/1.nix +++ b/pkgs/development/libraries/libva/1.nix @@ -40,17 +40,18 @@ stdenv.mkDerivation rec { wayland-scanner ]; - buildInputs = - [ libdrm ] - ++ lib.optionals (!minimal) [ - libva1-minimal - libX11 - libXext - libXfixes - wayland - libffi - libGL - ]; + buildInputs = [ + libdrm + ] + ++ lib.optionals (!minimal) [ + libva1-minimal + libX11 + libXext + libXfixes + wayland + libffi + libGL + ]; # TODO: share libs between minimal and !minimal - perhaps just symlink them # Add FHS paths for non-NixOS applications. diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix index 9fd523a70610..a52191590f3f 100644 --- a/pkgs/development/libraries/libva/default.nix +++ b/pkgs/development/libraries/libva/default.nix @@ -46,18 +46,20 @@ stdenv.mkDerivation (finalAttrs: { meson pkg-config ninja - ] ++ lib.optional (!minimal) wayland-scanner; + ] + ++ lib.optional (!minimal) wayland-scanner; - buildInputs = - [ libdrm ] - ++ lib.optionals (!minimal) [ - libX11 - libXext - libXfixes - wayland - libffi - libGL - ]; + buildInputs = [ + libdrm + ] + ++ lib.optionals (!minimal) [ + libX11 + libXext + libXfixes + wayland + libffi + libGL + ]; mesonFlags = lib.optionals stdenv.hostPlatform.isLinux [ # Add FHS and Debian paths for non-NixOS applications @@ -98,16 +100,15 @@ stdenv.mkDerivation (finalAttrs: { changelog = "https://raw.githubusercontent.com/intel/libva/${finalAttrs.version}/NEWS"; license = licenses.mit; maintainers = with maintainers; [ SuperSandro2000 ]; - pkgConfigModules = - [ - "libva" - "libva-drm" - ] - ++ lib.optionals (!minimal) [ - "libva-glx" - "libva-wayland" - "libva-x11" - ]; + pkgConfigModules = [ + "libva" + "libva-drm" + ] + ++ lib.optionals (!minimal) [ + "libva-glx" + "libva-wayland" + "libva-x11" + ]; platforms = platforms.unix; badPlatforms = [ # Mandatory libva shared library. diff --git a/pkgs/development/libraries/libwnck/default.nix b/pkgs/development/libraries/libwnck/default.nix index 5383aa71f863..d0a9c4867549 100644 --- a/pkgs/development/libraries/libwnck/default.nix +++ b/pkgs/development/libraries/libwnck/default.nix @@ -38,20 +38,19 @@ stdenv.mkDerivation rec { sha256 = "VadETsH7uVwIbUCWc4jyMbXAu8jP+qCGv5KQrkSeUdU="; }; - nativeBuildInputs = - [ - meson - ninja - pkg-config - gettext - gobject-introspection - gtk-doc - docbook_xsl - docbook_xml_dtd_412 - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + gettext + gobject-introspection + gtk-doc + docbook_xsl + docbook_xml_dtd_412 + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; buildInputs = [ libX11 diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index 35111e8c7516..f85c37e1b940 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -35,15 +35,14 @@ stdenv.mkDerivation (finalAttrs: { pname = "libxml2"; version = "2.14.4-unstable-2025-06-20"; - outputs = - [ - "bin" - "dev" - "out" - "devdoc" - ] - ++ lib.optional pythonSupport "py" - ++ lib.optional (enableStatic && enableShared) "static"; + outputs = [ + "bin" + "dev" + "out" + "devdoc" + ] + ++ lib.optional pythonSupport "py" + ++ lib.optional (enableStatic && enableShared) "static"; outputMan = "bin"; src = fetchFromGitLab { @@ -87,29 +86,27 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; - propagatedBuildInputs = - [ - findXMLCatalogs - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isMinGW) [ - libiconv - ] - ++ lib.optionals icuSupport [ - icu - ]; + propagatedBuildInputs = [ + findXMLCatalogs + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isMinGW) [ + libiconv + ] + ++ lib.optionals icuSupport [ + icu + ]; - configureFlags = - [ - "--exec-prefix=${placeholder "dev"}" - (lib.enableFeature enableStatic "static") - (lib.enableFeature enableShared "shared") - (lib.withFeature icuSupport "icu") - (lib.withFeature pythonSupport "python") - (lib.optionalString pythonSupport "PYTHON=${python.pythonOnBuildForHost.interpreter}") - ] - # avoid rebuilds, can be merged into list in version bumps - ++ lib.optional enableHttp "--with-http" - ++ lib.optional zlibSupport "--with-zlib"; + configureFlags = [ + "--exec-prefix=${placeholder "dev"}" + (lib.enableFeature enableStatic "static") + (lib.enableFeature enableShared "shared") + (lib.withFeature icuSupport "icu") + (lib.withFeature pythonSupport "python") + (lib.optionalString pythonSupport "PYTHON=${python.pythonOnBuildForHost.interpreter}") + ] + # avoid rebuilds, can be merged into list in version bumps + ++ lib.optional enableHttp "--with-http" + ++ lib.optional zlibSupport "--with-zlib"; installFlags = lib.optionals pythonSupport [ "pythondir=\"${placeholder "py"}/${python.sitePackages}\"" @@ -131,14 +128,13 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace python/libxml2mod.la --replace-fail "$dev/${python.sitePackages}" "$py/${python.sitePackages}" ''; - postFixup = - '' - moveToOutput bin/xml2-config "$dev" - moveToOutput lib/xml2Conf.sh "$dev" - '' - + lib.optionalString (enableStatic && enableShared) '' - moveToOutput lib/libxml2.a "$static" - ''; + postFixup = '' + moveToOutput bin/xml2-config "$dev" + moveToOutput lib/xml2Conf.sh "$dev" + '' + + lib.optionalString (enableStatic && enableShared) '' + moveToOutput lib/libxml2.a "$static" + ''; passthru = { inherit pythonSupport; diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix index 429fcbdf798d..8427fe49597d 100644 --- a/pkgs/development/libraries/libxslt/default.nix +++ b/pkgs/development/libraries/libxslt/default.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation (finalAttrs: { "out" "doc" "devdoc" - ] ++ lib.optional pythonSupport "py"; + ] + ++ lib.optional pythonSupport "py"; outputMan = "bin"; src = fetchurl { @@ -57,21 +58,20 @@ stdenv.mkDerivation (finalAttrs: { autoreconfHook ]; - buildInputs = - [ - libxml2.dev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - gettext - ] - ++ lib.optionals pythonSupport [ - libxml2.py - python3 - ncurses - ] - ++ lib.optionals cryptoSupport [ - libgcrypt - ]; + buildInputs = [ + libxml2.dev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + gettext + ] + ++ lib.optionals pythonSupport [ + libxml2.py + python3 + ncurses + ] + ++ lib.optionals cryptoSupport [ + libgcrypt + ]; propagatedBuildInputs = [ findXMLCatalogs @@ -85,16 +85,15 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - postFixup = - '' - moveToOutput bin/xslt-config "$dev" - moveToOutput lib/xsltConf.sh "$dev" - '' - + lib.optionalString pythonSupport '' - mkdir -p $py/nix-support - echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs - moveToOutput ${python3.sitePackages} "$py" - ''; + postFixup = '' + moveToOutput bin/xslt-config "$dev" + moveToOutput lib/xsltConf.sh "$dev" + '' + + lib.optionalString pythonSupport '' + mkdir -p $py/nix-support + echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs + moveToOutput ${python3.sitePackages} "$py" + ''; passthru = { inherit pythonSupport; diff --git a/pkgs/development/libraries/liquid-dsp/default.nix b/pkgs/development/libraries/liquid-dsp/default.nix index 019749eac91a..583d44001d91 100644 --- a/pkgs/development/libraries/liquid-dsp/default.nix +++ b/pkgs/development/libraries/liquid-dsp/default.nix @@ -30,13 +30,14 @@ stdenv.mkDerivation rec { (lib.enableFeature true "simdoverride") ]; - nativeBuildInputs = - [ autoreconfHook ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - autoSignDarwinBinariesHook - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + autoreconfHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + autoSignDarwinBinariesHook + fixDarwinDylibNames + ]; meta = { homepage = "https://liquidsdr.org/"; diff --git a/pkgs/development/libraries/medfile/default.nix b/pkgs/development/libraries/medfile/default.nix index 91a935bb99d9..94fb4bcfada2 100644 --- a/pkgs/development/libraries/medfile/default.nix +++ b/pkgs/development/libraries/medfile/default.nix @@ -21,28 +21,27 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - postPatch = - '' - # Patch cmake and source files to work with hdf5 - substituteInPlace config/cmake_files/medMacros.cmake --replace-fail \ - "IF (NOT HDF_VERSION_MAJOR_REF EQUAL 1 OR NOT HDF_VERSION_MINOR_REF EQUAL 12 OR NOT HDF_VERSION_RELEASE_REF GREATER 0)" \ - "IF (HDF5_VERSION VERSION_LESS 1.12.0)" - substituteInPlace src/*/*.c --replace-warn \ - "#if H5_VERS_MINOR > 12" \ - "#if H5_VERS_MINOR > 14" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Some medfile test files #define _a, which - # breaks system header files that use _a as a function parameter - substituteInPlace tests/c/*.c \ - --replace-warn "_a" "_A" \ - --replace-warn "_b" "_B" - # Fix compiler errors in test files - substituteInPlace tests/c/*.c \ - --replace-warn "med_Bool" "med_bool" \ - --replace-warn "med_Axis_type" "med_axis_type" \ - --replace-warn "med_Access_mode" "med_access_mode" - ''; + postPatch = '' + # Patch cmake and source files to work with hdf5 + substituteInPlace config/cmake_files/medMacros.cmake --replace-fail \ + "IF (NOT HDF_VERSION_MAJOR_REF EQUAL 1 OR NOT HDF_VERSION_MINOR_REF EQUAL 12 OR NOT HDF_VERSION_RELEASE_REF GREATER 0)" \ + "IF (HDF5_VERSION VERSION_LESS 1.12.0)" + substituteInPlace src/*/*.c --replace-warn \ + "#if H5_VERS_MINOR > 12" \ + "#if H5_VERS_MINOR > 14" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Some medfile test files #define _a, which + # breaks system header files that use _a as a function parameter + substituteInPlace tests/c/*.c \ + --replace-warn "_a" "_A" \ + --replace-warn "_b" "_B" + # Fix compiler errors in test files + substituteInPlace tests/c/*.c \ + --replace-warn "med_Bool" "med_bool" \ + --replace-warn "med_Axis_type" "med_axis_type" \ + --replace-warn "med_Access_mode" "med_access_mode" + ''; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index db9ec5273585..3554b3ccf15f 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -44,62 +44,60 @@ enablePatentEncumberedCodecs ? true, withValgrind ? lib.meta.availableOn stdenv.hostPlatform valgrind-light, - galliumDrivers ? - [ - "asahi" # Apple AGX, built on non-aarch64 for cross tools - "d3d12" # WSL emulated GPU (aka Dozen) - "iris" # new Intel (Broadwell+) - "llvmpipe" # software renderer - "nouveau" # Nvidia - "panfrost" # ARM Mali Midgard and up (T/G series), built on non-ARM for cross tools - "r300" # very old AMD - "r600" # less old AMD - "radeonsi" # new AMD (GCN+) - "softpipe" # older software renderer - "svga" # VMWare virtualized GPU - "virgl" # QEMU virtualized GPU (aka VirGL) - "zink" # generic OpenGL over Vulkan, experimental - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) [ - "etnaviv" # Vivante GPU designs (mostly NXP/Marvell SoCs) - "freedreno" # Qualcomm Adreno (all Qualcomm SoCs) - "lima" # ARM Mali 4xx - "vc4" # Broadcom VC4 (Raspberry Pi 0-3) - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - "tegra" # Nvidia Tegra SoCs - "v3d" # Broadcom VC5 (Raspberry Pi 4) - ] - ++ lib.optionals stdenv.hostPlatform.isx86 [ - "crocus" # Intel legacy, x86 only - "i915" # Intel extra legacy, x86 only - ], - vulkanDrivers ? - [ - "amd" # AMD (aka RADV) - "asahi" # Apple AGX, built on non-aarch64 for cross tools - "intel" # new Intel (aka ANV) - "microsoft-experimental" # WSL virtualized GPU (aka DZN/Dozen) - "nouveau" # Nouveau (aka NVK) - "swrast" # software renderer (aka Lavapipe) - ] - ++ - lib.optionals - (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6") - [ - # QEMU virtualized GPU (aka VirGL) - # Requires ATOMIC_INT_LOCK_FREE == 2. - "virtio" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - "broadcom" # Broadcom VC5 (Raspberry Pi 4, aka V3D) - "freedreno" # Qualcomm Adreno (all Qualcomm SoCs) - "imagination-experimental" # PowerVR Rogue (currently N/A) - "panfrost" # ARM Mali Midgard and up (T/G series) - ] - ++ lib.optionals stdenv.hostPlatform.isx86 [ - "intel_hasvk" # Intel Haswell/Broadwell, "legacy" Vulkan driver (https://www.phoronix.com/news/Intel-HasVK-Drop-Dead-Code) - ], + galliumDrivers ? [ + "asahi" # Apple AGX, built on non-aarch64 for cross tools + "d3d12" # WSL emulated GPU (aka Dozen) + "iris" # new Intel (Broadwell+) + "llvmpipe" # software renderer + "nouveau" # Nvidia + "panfrost" # ARM Mali Midgard and up (T/G series), built on non-ARM for cross tools + "r300" # very old AMD + "r600" # less old AMD + "radeonsi" # new AMD (GCN+) + "softpipe" # older software renderer + "svga" # VMWare virtualized GPU + "virgl" # QEMU virtualized GPU (aka VirGL) + "zink" # generic OpenGL over Vulkan, experimental + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) [ + "etnaviv" # Vivante GPU designs (mostly NXP/Marvell SoCs) + "freedreno" # Qualcomm Adreno (all Qualcomm SoCs) + "lima" # ARM Mali 4xx + "vc4" # Broadcom VC4 (Raspberry Pi 0-3) + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + "tegra" # Nvidia Tegra SoCs + "v3d" # Broadcom VC5 (Raspberry Pi 4) + ] + ++ lib.optionals stdenv.hostPlatform.isx86 [ + "crocus" # Intel legacy, x86 only + "i915" # Intel extra legacy, x86 only + ], + vulkanDrivers ? [ + "amd" # AMD (aka RADV) + "asahi" # Apple AGX, built on non-aarch64 for cross tools + "intel" # new Intel (aka ANV) + "microsoft-experimental" # WSL virtualized GPU (aka DZN/Dozen) + "nouveau" # Nouveau (aka NVK) + "swrast" # software renderer (aka Lavapipe) + ] + ++ + lib.optionals + (stdenv.hostPlatform.isAarch -> lib.versionAtLeast stdenv.hostPlatform.parsed.cpu.version "6") + [ + # QEMU virtualized GPU (aka VirGL) + # Requires ATOMIC_INT_LOCK_FREE == 2. + "virtio" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + "broadcom" # Broadcom VC5 (Raspberry Pi 4, aka V3D) + "freedreno" # Qualcomm Adreno (all Qualcomm SoCs) + "imagination-experimental" # PowerVR Rogue (currently N/A) + "panfrost" # ARM Mali Midgard and up (T/G series) + ] + ++ lib.optionals stdenv.hostPlatform.isx86 [ + "intel_hasvk" # Intel Haswell/Broadwell, "legacy" Vulkan driver (https://www.phoronix.com/news/Intel-HasVK-Drop-Dead-Code) + ], eglPlatforms ? [ "x11" "wayland" @@ -181,26 +179,25 @@ stdenv.mkDerivation { ${copyRustDeps} ''; - outputs = - [ - "out" - # OpenCL drivers pull in ~1G of extra LLVM stuff, so don't install them - # if the user didn't explicitly ask for it - "opencl" - # the Dozen drivers depend on libspirv2dxil, but link it statically, and - # libspirv2dxil itself is pretty chonky, so relocate it to its own output in - # case anything wants to use it at some point - "spirv2dxil" - ] - ++ lib.optionals (!needNativeCLC) [ - # tools for the host platform to be used when cross-compiling. - # mesa builds these only when not already built. hence: - # - for a non-cross build (needNativeCLC = false), we do not provide mesa - # with any `*-clc` binaries, so it builds them and installs them. - # - for a cross build (needNativeCLC = true), we provide mesa with `*-clc` - # binaries, so it skips building & installing any new CLC files. - "cross_tools" - ]; + outputs = [ + "out" + # OpenCL drivers pull in ~1G of extra LLVM stuff, so don't install them + # if the user didn't explicitly ask for it + "opencl" + # the Dozen drivers depend on libspirv2dxil, but link it statically, and + # libspirv2dxil itself is pretty chonky, so relocate it to its own output in + # case anything wants to use it at some point + "spirv2dxil" + ] + ++ lib.optionals (!needNativeCLC) [ + # tools for the host platform to be used when cross-compiling. + # mesa builds these only when not already built. hence: + # - for a non-cross build (needNativeCLC = false), we do not provide mesa + # with any `*-clc` binaries, so it builds them and installs them. + # - for a cross build (needNativeCLC = true), we provide mesa with `*-clc` + # binaries, so it skips building & installing any new CLC files. + "cross_tools" + ]; # Keep build-ids so drivers can use them for caching, etc. # Also some drivers segfault without this. @@ -212,68 +209,67 @@ stdenv.mkDerivation { PATH=${lib.getDev llvmPackages.libllvm}/bin:$PATH ''; - mesonFlags = - [ - "--sysconfdir=/etc" + mesonFlags = [ + "--sysconfdir=/etc" - # What to build - (lib.mesonOption "platforms" (lib.concatStringsSep "," eglPlatforms)) - (lib.mesonOption "gallium-drivers" (lib.concatStringsSep "," galliumDrivers)) - (lib.mesonOption "vulkan-drivers" (lib.concatStringsSep "," vulkanDrivers)) - (lib.mesonOption "vulkan-layers" (lib.concatStringsSep "," vulkanLayers)) + # What to build + (lib.mesonOption "platforms" (lib.concatStringsSep "," eglPlatforms)) + (lib.mesonOption "gallium-drivers" (lib.concatStringsSep "," galliumDrivers)) + (lib.mesonOption "vulkan-drivers" (lib.concatStringsSep "," vulkanDrivers)) + (lib.mesonOption "vulkan-layers" (lib.concatStringsSep "," vulkanLayers)) - # Enable glvnd for dynamic libGL dispatch - (lib.mesonEnable "glvnd" true) - (lib.mesonEnable "gbm" true) - (lib.mesonBool "libgbm-external" true) + # Enable glvnd for dynamic libGL dispatch + (lib.mesonEnable "glvnd" true) + (lib.mesonEnable "gbm" true) + (lib.mesonBool "libgbm-external" true) - (lib.mesonBool "gallium-nine" false) # Direct3D9 in Wine, largely supplanted by DXVK + (lib.mesonBool "gallium-nine" false) # Direct3D9 in Wine, largely supplanted by DXVK - # Only used by xf86-video-vmware, which has more features than VMWare's KMS driver, - # so we're keeping it for now. Should be removed when that's no longer the case. - # See: https://github.com/NixOS/nixpkgs/pull/392492 - (lib.mesonEnable "gallium-xa" true) + # Only used by xf86-video-vmware, which has more features than VMWare's KMS driver, + # so we're keeping it for now. Should be removed when that's no longer the case. + # See: https://github.com/NixOS/nixpkgs/pull/392492 + (lib.mesonEnable "gallium-xa" true) - (lib.mesonBool "teflon" true) # TensorFlow frontend + (lib.mesonBool "teflon" true) # TensorFlow frontend - # Enable all freedreno kernel mode drivers. (For example, virtio can be - # used with a virtio-gpu device supporting drm native context.) This option - # is ignored when freedreno is not being built. - (lib.mesonOption "freedreno-kmds" "msm,kgsl,virtio,wsl") + # Enable all freedreno kernel mode drivers. (For example, virtio can be + # used with a virtio-gpu device supporting drm native context.) This option + # is ignored when freedreno is not being built. + (lib.mesonOption "freedreno-kmds" "msm,kgsl,virtio,wsl") - # Enable Intel RT stuff when available - (lib.mesonEnable "intel-rt" stdenv.hostPlatform.isx86_64) + # Enable Intel RT stuff when available + (lib.mesonEnable "intel-rt" stdenv.hostPlatform.isx86_64) - # Required for OpenCL - (lib.mesonOption "clang-libdir" "${lib.getLib llvmPackages.clang-unwrapped}/lib") + # Required for OpenCL + (lib.mesonOption "clang-libdir" "${lib.getLib llvmPackages.clang-unwrapped}/lib") - # Rusticl, new OpenCL frontend - (lib.mesonBool "gallium-rusticl" true) - (lib.mesonOption "gallium-rusticl-enable-drivers" "auto") + # Rusticl, new OpenCL frontend + (lib.mesonBool "gallium-rusticl" true) + (lib.mesonOption "gallium-rusticl-enable-drivers" "auto") - # meson auto_features enables this, but we do not want it - (lib.mesonEnable "android-libbacktrace" false) - (lib.mesonEnable "microsoft-clc" false) # Only relevant on Windows (OpenCL 1.2 API on top of D3D12) + # meson auto_features enables this, but we do not want it + (lib.mesonEnable "android-libbacktrace" false) + (lib.mesonEnable "microsoft-clc" false) # Only relevant on Windows (OpenCL 1.2 API on top of D3D12) - # Enable more sensors in gallium-hud - (lib.mesonBool "gallium-extra-hud" true) + # Enable more sensors in gallium-hud + (lib.mesonBool "gallium-extra-hud" true) - # Disable valgrind on targets where it's not available - (lib.mesonEnable "valgrind" withValgrind) - ] - ++ lib.optionals enablePatentEncumberedCodecs [ - (lib.mesonOption "video-codecs" "all") - ] - ++ lib.optionals (!needNativeCLC) [ - # Build and install extra tools for cross - (lib.mesonOption "tools" "asahi,panfrost") - (lib.mesonBool "install-mesa-clc" true) - (lib.mesonBool "install-precomp-compiler" true) - ] - ++ lib.optionals needNativeCLC [ - (lib.mesonOption "mesa-clc" "system") - (lib.mesonOption "precomp-compiler" "system") - ]; + # Disable valgrind on targets where it's not available + (lib.mesonEnable "valgrind" withValgrind) + ] + ++ lib.optionals enablePatentEncumberedCodecs [ + (lib.mesonOption "video-codecs" "all") + ] + ++ lib.optionals (!needNativeCLC) [ + # Build and install extra tools for cross + (lib.mesonOption "tools" "asahi,panfrost") + (lib.mesonBool "install-mesa-clc" true) + (lib.mesonBool "install-precomp-compiler" true) + ] + ++ lib.optionals needNativeCLC [ + (lib.mesonOption "mesa-clc" "system") + (lib.mesonOption "precomp-compiler" "system") + ]; strictDeps = true; @@ -322,35 +318,34 @@ stdenv.mkDerivation { buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - meson - pkg-config - ninja - intltool - bison - flex - file - python3Packages.python - python3Packages.packaging - python3Packages.pycparser - python3Packages.mako - python3Packages.ply - python3Packages.pyyaml - jdupes - # Use bin output from glslang to not propagate the dev output at - # the build time with the host glslang. - (lib.getBin glslang) - rustc - rust-bindgen - rust-cbindgen - rustPlatform.bindgenHook - wayland-scanner - ] - ++ lib.optionals needNativeCLC [ - # `or null` to not break eval with `attribute missing` on darwin to linux cross - (buildPackages.mesa.cross_tools or null) - ]; + nativeBuildInputs = [ + meson + pkg-config + ninja + intltool + bison + flex + file + python3Packages.python + python3Packages.packaging + python3Packages.pycparser + python3Packages.mako + python3Packages.ply + python3Packages.pyyaml + jdupes + # Use bin output from glslang to not propagate the dev output at + # the build time with the host glslang. + (lib.getBin glslang) + rustc + rust-bindgen + rust-cbindgen + rustPlatform.bindgenHook + wayland-scanner + ] + ++ lib.optionals needNativeCLC [ + # `or null` to not break eval with `attribute missing` on darwin to linux cross + (buildPackages.mesa.cross_tools or null) + ]; disallowedRequisites = lib.optionals needNativeCLC [ (buildPackages.mesa.cross_tools or null) diff --git a/pkgs/development/libraries/mpich/default.nix b/pkgs/development/libraries/mpich/default.nix index 7c837e67a39f..016a03a52724 100644 --- a/pkgs/development/libraries/mpich/default.nix +++ b/pkgs/development/libraries/mpich/default.nix @@ -53,18 +53,17 @@ stdenv.mkDerivation rec { "man" ]; - configureFlags = - [ - "--enable-shared" - "--with-pm=${withPmStr}" - ] - ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [ - "FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300 - "FCFLAGS=-fallow-argument-mismatch" - ] - ++ lib.optionals pmixSupport [ - "--with-pmix" - ]; + configureFlags = [ + "--enable-shared" + "--with-pm=${withPmStr}" + ] + ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [ + "FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300 + "FCFLAGS=-fallow-argument-mismatch" + ] + ++ lib.optionals pmixSupport [ + "--with-pmix" + ]; enableParallelBuilding = true; @@ -74,14 +73,13 @@ stdenv.mkDerivation rec { autoconf automake ]; - buildInputs = - [ - perl - openssh - hwloc - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) ch4backend - ++ lib.optional pmixSupport pmix; + buildInputs = [ + perl + openssh + hwloc + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) ch4backend + ++ lib.optional pmixSupport pmix; # test_double_serializer.test fails on darwin doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index df558034c7e0..8769ef6c0985 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -43,95 +43,92 @@ stdenv.mkDerivation (finalAttrs: { "host" ]; - configureFlags = - [ - (lib.withFeature (!enableStatic) "shared") - "--without-debug" - "--enable-pc-files" - "--enable-symlinks" - "--with-manpage-format=normal" - "--disable-stripping" - "--with-versioned-syms" - ] - ++ lib.optional unicodeSupport "--enable-widec" - ++ lib.optional (!withCxx) "--without-cxx" - ++ lib.optional (abiVersion == "5") "--with-abi-version=5" - ++ lib.optional stdenv.hostPlatform.isNetBSD "--enable-rpath" - ++ lib.optional withTermlib "--with-termlib" - ++ lib.optionals stdenv.hostPlatform.isWindows [ - "--enable-sp-funcs" - "--enable-term-driver" - ] - ++ lib.optionals (stdenv.hostPlatform.isUnix && enableStatic) [ - # For static binaries, the point is to have a standalone binary with - # minimum dependencies. So here we make sure that binaries using this - # package won't depend on a terminfo database located in the Nix store. - "--with-terminfo-dirs=${ - lib.concatStringsSep ":" [ - "/etc/terminfo" # Debian, Fedora, Gentoo - "/lib/terminfo" # Debian - "/usr/share/terminfo" # upstream default, probably all FHS-based distros - "/run/current-system/sw/share/terminfo" # NixOS - ] - }" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "--with-build-cc=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" - ] - ++ (lib.optionals (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") - [ - # lld17+ passes `--no-undefined-version` by default and makes this a hard - # error; ncurses' `resulting.map` version script references symbols that - # aren't present. - # - # See: https://lists.gnu.org/archive/html/bug-ncurses/2024-05/msg00086.html - # - # For now we allow this with `--undefined-version`: - "LDFLAGS=-Wl,--undefined-version" + configureFlags = [ + (lib.withFeature (!enableStatic) "shared") + "--without-debug" + "--enable-pc-files" + "--enable-symlinks" + "--with-manpage-format=normal" + "--disable-stripping" + "--with-versioned-syms" + ] + ++ lib.optional unicodeSupport "--enable-widec" + ++ lib.optional (!withCxx) "--without-cxx" + ++ lib.optional (abiVersion == "5") "--with-abi-version=5" + ++ lib.optional stdenv.hostPlatform.isNetBSD "--enable-rpath" + ++ lib.optional withTermlib "--with-termlib" + ++ lib.optionals stdenv.hostPlatform.isWindows [ + "--enable-sp-funcs" + "--enable-term-driver" + ] + ++ lib.optionals (stdenv.hostPlatform.isUnix && enableStatic) [ + # For static binaries, the point is to have a standalone binary with + # minimum dependencies. So here we make sure that binaries using this + # package won't depend on a terminfo database located in the Nix store. + "--with-terminfo-dirs=${ + lib.concatStringsSep ":" [ + "/etc/terminfo" # Debian, Fedora, Gentoo + "/lib/terminfo" # Debian + "/usr/share/terminfo" # upstream default, probably all FHS-based distros + "/run/current-system/sw/share/terminfo" # NixOS ] - ) - ++ lib.optionals stdenv.hostPlatform.isOpenBSD [ - # If you don't specify the version number in the host specification, a branch gets taken in configure - # which assumes that your openbsd is from the 90s, leading to a truly awful compiler/linker configuration. - # No, autoreconfHook doesn't work. - "--host=${stdenv.hostPlatform.config}${stdenv.cc.libc.version}" - ]; + }" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "--with-build-cc=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" + ] + ++ (lib.optionals (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") + [ + # lld17+ passes `--no-undefined-version` by default and makes this a hard + # error; ncurses' `resulting.map` version script references symbols that + # aren't present. + # + # See: https://lists.gnu.org/archive/html/bug-ncurses/2024-05/msg00086.html + # + # For now we allow this with `--undefined-version`: + "LDFLAGS=-Wl,--undefined-version" + ] + ) + ++ lib.optionals stdenv.hostPlatform.isOpenBSD [ + # If you don't specify the version number in the host specification, a branch gets taken in configure + # which assumes that your openbsd is from the 90s, leading to a truly awful compiler/linker configuration. + # No, autoreconfHook doesn't work. + "--host=${stdenv.hostPlatform.config}${stdenv.cc.libc.version}" + ]; # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris: CFLAGS = lib.optionalString stdenv.hostPlatform.isSunOS "-D_XOPEN_SOURCE_EXTENDED"; strictDeps = true; - nativeBuildInputs = - [ - updateAutotoolsGnuConfigScriptsHook - pkg-config - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - # for `tic`, build already depends on for build `cc` so it's weird the build doesn't just build `tic`. - ncurses - ]; + nativeBuildInputs = [ + updateAutotoolsGnuConfigScriptsHook + pkg-config + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + # for `tic`, build already depends on for build `cc` so it's weird the build doesn't just build `tic`. + ncurses + ]; buildInputs = lib.optional (mouseSupport && stdenv.hostPlatform.isLinux) gpm; - preConfigure = - '' - export PKG_CONFIG_LIBDIR="$dev/lib/pkgconfig" - mkdir -p "$PKG_CONFIG_LIBDIR" - configureFlagsArray+=( - "--libdir=$out/lib" - "--includedir=$dev/include" - "--bindir=$dev/bin" - "--mandir=$man/share/man" - "--with-pkg-config-libdir=$PKG_CONFIG_LIBDIR" - ) - '' - + lib.optionalString stdenv.hostPlatform.isSunOS '' - sed -i -e '/-D__EXTENSIONS__/ s/-D_XOPEN_SOURCE=\$cf_XOPEN_SOURCE//' \ - -e '/CPPFLAGS="$CPPFLAGS/s/ -D_XOPEN_SOURCE_EXTENDED//' \ - configure - CFLAGS=-D_XOPEN_SOURCE_EXTENDED - ''; + preConfigure = '' + export PKG_CONFIG_LIBDIR="$dev/lib/pkgconfig" + mkdir -p "$PKG_CONFIG_LIBDIR" + configureFlagsArray+=( + "--libdir=$out/lib" + "--includedir=$dev/include" + "--bindir=$dev/bin" + "--mandir=$man/share/man" + "--with-pkg-config-libdir=$PKG_CONFIG_LIBDIR" + ) + '' + + lib.optionalString stdenv.hostPlatform.isSunOS '' + sed -i -e '/-D__EXTENSIONS__/ s/-D_XOPEN_SOURCE=\$cf_XOPEN_SOURCE//' \ + -e '/CPPFLAGS="$CPPFLAGS/s/ -D_XOPEN_SOURCE_EXTENDED//' \ + configure + CFLAGS=-D_XOPEN_SOURCE_EXTENDED + ''; enableParallelBuilding = true; @@ -253,7 +250,8 @@ stdenv.mkDerivation (finalAttrs: { "menu" "ncurses" "panel" - ] ++ lib.optional withCxx "ncurses++"; + ] + ++ lib.optional withCxx "ncurses++"; in base ++ lib.optionals unicodeSupport (map (p: p + "w") base); platforms = platforms.all; diff --git a/pkgs/development/libraries/ngtcp2/default.nix b/pkgs/development/libraries/ngtcp2/default.nix index eac87721861a..48ae55dede1a 100644 --- a/pkgs/development/libraries/ngtcp2/default.nix +++ b/pkgs/development/libraries/ngtcp2/default.nix @@ -37,7 +37,8 @@ stdenv.mkDerivation (finalAttrs: { libev nghttp3 quictls - ] ++ lib.optional withJemalloc jemalloc; + ] + ++ lib.optional withJemalloc jemalloc; cmakeFlags = [ (lib.cmakeBool "ENABLE_STATIC_LIB" false) diff --git a/pkgs/development/libraries/nss/generic.nix b/pkgs/development/libraries/nss/generic.nix index 22393aa606be..77d838a25ab0 100644 --- a/pkgs/development/libraries/nss/generic.nix +++ b/pkgs/development/libraries/nss/generic.nix @@ -37,17 +37,16 @@ stdenv.mkDerivation rec { depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - perl - ninja - (buildPackages.python3.withPackages (ps: with ps; [ gyp ])) - installShellFiles - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + perl + ninja + (buildPackages.python3.withPackages (ps: with ps; [ gyp ])) + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + fixDarwinDylibNames + ]; buildInputs = [ zlib @@ -62,20 +61,19 @@ stdenv.mkDerivation rec { ./fix-cross-compilation.patch ]; - postPatch = - '' - patchShebangs . + postPatch = '' + patchShebangs . - for f in coreconf/config.gypi build.sh; do - substituteInPlace "$f" --replace "/usr/bin/env" "${buildPackages.coreutils}/bin/env" - done + for f in coreconf/config.gypi build.sh; do + substituteInPlace "$f" --replace "/usr/bin/env" "${buildPackages.coreutils}/bin/env" + done - substituteInPlace coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)" - substituteInPlace coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'" - ''; + substituteInPlace coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)" + substituteInPlace coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'" + ''; outputs = [ "out" @@ -105,28 +103,27 @@ stdenv.mkDerivation rec { target_system = stdenv.hostPlatform.uname.system; host = getArch stdenv.buildPlatform; - buildFlags = - [ - "-v" - "--opt" - "--with-nspr=${nspr.dev}/include:${nspr.out}/lib" - "--system-sqlite" - "--enable-legacy-db" - "--target ${target}" - "-Dhost_arch=${host}" - "-Duse_system_zlib=1" - "--enable-libpkix" - "-j" - "$NIX_BUILD_CORES" - ] - ++ lib.optional enableFIPS "--enable-fips" - ++ lib.optional stdenv.hostPlatform.isDarwin "--clang" - ++ lib.optionals (target_system != stdenv.buildPlatform.uname.system) [ - "-DOS=${target_system}" - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "--disable-tests" - ]; + buildFlags = [ + "-v" + "--opt" + "--with-nspr=${nspr.dev}/include:${nspr.out}/lib" + "--system-sqlite" + "--enable-legacy-db" + "--target ${target}" + "-Dhost_arch=${host}" + "-Duse_system_zlib=1" + "--enable-libpkix" + "-j" + "$NIX_BUILD_CORES" + ] + ++ lib.optional enableFIPS "--enable-fips" + ++ lib.optional stdenv.hostPlatform.isDarwin "--clang" + ++ lib.optionals (target_system != stdenv.buildPlatform.uname.system) [ + "-DOS=${target_system}" + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "--disable-tests" + ]; in '' runHook preBuild diff --git a/pkgs/development/libraries/nuspell/default.nix b/pkgs/development/libraries/nuspell/default.nix index 92a9a6b0e399..c8c676c27d04 100644 --- a/pkgs/development/libraries/nuspell/default.nix +++ b/pkgs/development/libraries/nuspell/default.nix @@ -21,26 +21,24 @@ stdenv.mkDerivation rec { hash = "sha256-U/lHSxpKsBnamf4ikE2aIjEPSU5fxjtuSmhZR0jxMAI="; }; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals enableManpages [ - buildPackages.pandoc - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals enableManpages [ + buildPackages.pandoc + ]; buildInputs = [ catch2_3 ]; propagatedBuildInputs = [ icu ]; - cmakeFlags = - [ - "-DBUILD_TESTING=YES" - ] - ++ lib.optionals (!enableManpages) [ - "-DBUILD_DOCS=OFF" - ]; + cmakeFlags = [ + "-DBUILD_TESTING=YES" + ] + ++ lib.optionals (!enableManpages) [ + "-DBUILD_DOCS=OFF" + ]; doCheck = true; diff --git a/pkgs/development/libraries/ogre/default.nix b/pkgs/development/libraries/ogre/default.nix index 6b473fcf1b85..b73a6fe19b0a 100644 --- a/pkgs/development/libraries/ogre/default.nix +++ b/pkgs/development/libraries/ogre/default.nix @@ -71,43 +71,41 @@ let unzip ]; - buildInputs = - [ - SDL2 - boost - freetype - libpng - ois - pugixml - zziplib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libglut - libGL - libGLU - libICE - libSM - libX11 - libXaw - libXmu - libXrandr - libXrender - libXt - libXxf86vm - xorgproto - ] - ++ lib.optionals withNvidiaCg [ - nvidia_cg_toolkit - ]; + buildInputs = [ + SDL2 + boost + freetype + libpng + ois + pugixml + zziplib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libglut + libGL + libGLU + libICE + libSM + libX11 + libXaw + libXmu + libXrandr + libXrender + libXt + libXxf86vm + xorgproto + ] + ++ lib.optionals withNvidiaCg [ + nvidia_cg_toolkit + ]; - cmakeFlags = - [ - (lib.cmakeBool "OGRE_BUILD_DEPENDENCIES" false) - (lib.cmakeBool "OGRE_BUILD_SAMPLES" withSamples) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.cmakeBool "OGRE_BUILD_LIBS_AS_FRAMEWORKS" false) - ]; + cmakeFlags = [ + (lib.cmakeBool "OGRE_BUILD_DEPENDENCIES" false) + (lib.cmakeBool "OGRE_BUILD_SAMPLES" withSamples) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.cmakeBool "OGRE_BUILD_LIBS_AS_FRAMEWORKS" false) + ]; meta = { description = "3D Object-Oriented Graphics Rendering Engine"; diff --git a/pkgs/development/libraries/opencolorio/1.x.nix b/pkgs/development/libraries/opencolorio/1.x.nix index c91fee14ed23..4dc42994f6b7 100644 --- a/pkgs/development/libraries/opencolorio/1.x.nix +++ b/pkgs/development/libraries/opencolorio/1.x.nix @@ -37,25 +37,25 @@ stdenv.mkDerivation (finalAtts: { buildInputs = [ lcms2 tinyxml - ] ++ lib.optional stdenv.hostPlatform.isDarwin boost; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin boost; postPatch = '' substituteInPlace src/core/CMakeLists.txt --replace "-Werror" "" substituteInPlace src/pyglue/CMakeLists.txt --replace "-Werror" "" ''; - cmakeFlags = - [ - "-DUSE_EXTERNAL_LCMS=ON" - "-DUSE_EXTERNAL_TINYXML=ON" - # External yaml-cpp 0.6.* not compatible: https://github.com/imageworks/OpenColorIO/issues/517 - "-DUSE_EXTERNAL_YAML=OFF" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "-DOCIO_USE_BOOST_PTR=ON" - ++ lib.optional (!stdenv.hostPlatform.isx86) "-DOCIO_USE_SSE=OFF" - ++ lib.optional ( - stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 - ) "-DCMAKE_OSX_ARCHITECTURES=arm64"; + cmakeFlags = [ + "-DUSE_EXTERNAL_LCMS=ON" + "-DUSE_EXTERNAL_TINYXML=ON" + # External yaml-cpp 0.6.* not compatible: https://github.com/imageworks/OpenColorIO/issues/517 + "-DUSE_EXTERNAL_YAML=OFF" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "-DOCIO_USE_BOOST_PTR=ON" + ++ lib.optional (!stdenv.hostPlatform.isx86) "-DOCIO_USE_SSE=OFF" + ++ lib.optional ( + stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 + ) "-DCMAKE_OSX_ARCHITECTURES=arm64"; env = lib.optionalAttrs stdenv.cc.isClang { # yaml-cpp uses std::auto_ptr and std::binary_function which has diff --git a/pkgs/development/libraries/opencolorio/default.nix b/pkgs/development/libraries/opencolorio/default.nix index 61e1d24ab3dc..5c8c5362198c 100644 --- a/pkgs/development/libraries/opencolorio/default.nix +++ b/pkgs/development/libraries/opencolorio/default.nix @@ -46,38 +46,36 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ cmake ] ++ lib.optionals pythonBindings [ python3Packages.python ]; - buildInputs = - [ - expat - yaml-cpp - pystring - imath - minizip-ng - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glew - libglut - ] - ++ lib.optionals pythonBindings [ - python3Packages.python - python3Packages.pybind11 - ] - ++ lib.optionals buildApps [ - lcms2 - openexr - ]; + buildInputs = [ + expat + yaml-cpp + pystring + imath + minizip-ng + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + glew + libglut + ] + ++ lib.optionals pythonBindings [ + python3Packages.python + python3Packages.pybind11 + ] + ++ lib.optionals buildApps [ + lcms2 + openexr + ]; - cmakeFlags = - [ - "-DOCIO_INSTALL_EXT_PACKAGES=NONE" - "-DOCIO_USE_SSE2NEON=OFF" - # GPU test fails with: libglut (GPU tests): failed to open display '' - "-DOCIO_BUILD_GPU_TESTS=OFF" - "-Dminizip-ng_INCLUDE_DIR=${minizip-ng}/include/minizip-ng" - ] - ++ lib.optional (!pythonBindings) "-DOCIO_BUILD_PYTHON=OFF" - ++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF"; + cmakeFlags = [ + "-DOCIO_INSTALL_EXT_PACKAGES=NONE" + "-DOCIO_USE_SSE2NEON=OFF" + # GPU test fails with: libglut (GPU tests): failed to open display '' + "-DOCIO_BUILD_GPU_TESTS=OFF" + "-Dminizip-ng_INCLUDE_DIR=${minizip-ng}/include/minizip-ng" + ] + ++ lib.optional (!pythonBindings) "-DOCIO_BUILD_PYTHON=OFF" + ++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF"; # precision issues on non-x86 doCheck = stdenv.hostPlatform.isx86_64; diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index df0633b615a0..148c7350b931 100644 --- a/pkgs/development/libraries/opencv/4.x.nix +++ b/pkgs/development/libraries/opencv/4.x.nix @@ -282,14 +282,13 @@ effectiveStdenv.mkDerivation { pname = "opencv"; inherit version src; - outputs = - [ - "out" - "cxxdev" - ] - ++ optionals (runAccuracyTests || runPerformanceTests) [ - "package_tests" - ]; + outputs = [ + "out" + "cxxdev" + ] + ++ optionals (runAccuracyTests || runPerformanceTests) [ + "package_tests" + ]; cudaPropagateToOutput = "cxxdev"; postUnpack = optionalString buildContrib '' @@ -297,13 +296,12 @@ effectiveStdenv.mkDerivation { ''; # Ensures that we use the system OpenEXR rather than the vendored copy of the source included with OpenCV. - patches = - [ - ./cmake-don-t-use-OpenCVFindOpenEXR.patch - ] - ++ optionals enableCuda [ - ./cuda_opt_flow.patch - ]; + patches = [ + ./cmake-don-t-use-OpenCVFindOpenEXR.patch + ] + ++ optionals enableCuda [ + ./cuda_opt_flow.patch + ]; # This prevents cmake from using libraries in impure paths (which # causes build failure on non NixOS) @@ -328,222 +326,219 @@ effectiveStdenv.mkDerivation { echo '"(build info elided)"' > modules/core/version_string.inc ''; - buildInputs = - [ - boost - gflags - glib - glog - pcre2 - protobuf_21 - zlib - ] - ++ optionals enablePython [ - pythonPackages.python - ] - ++ optionals (effectiveStdenv.buildPlatform == effectiveStdenv.hostPlatform) [ - hdf5 - ] - ++ optionals enableGtk2 [ - gtk2 - ] - ++ optionals enableGtk3 [ - gtk3 - ] - ++ optionals enableVtk [ - vtk - ] - ++ optionals enableJPEG [ - libjpeg - ] - ++ optionals enablePNG [ - libpng - ] - ++ optionals enableTIFF [ - libtiff - ] - ++ optionals enableWebP [ - libwebp - ] - ++ optionals enableEXR [ - openexr - ] - ++ optionals enableJPEG2000 [ - openjpeg - ] - ++ optionals enableFfmpeg [ - ffmpeg - ] - ++ optionals (enableGStreamer && effectiveStdenv.hostPlatform.isLinux) [ - elfutils - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gstreamer - libunwind - orc - zstd - ] - ++ optionals enableOvis [ - ogre - ] - ++ optionals enableGPhoto2 [ - libgphoto2 - ] - ++ optionals enableDC1394 [ - libdc1394 - ] - ++ optionals enableEigen [ - eigen - ] - ++ optionals enableVA [ - libva - ] - ++ optionals enableBlas [ - blas.provider - ] - ++ optionals enableTesseract [ - # There is seemingly no compile-time flag for Tesseract. It's - # simply enabled automatically if contrib is built, and it detects - # tesseract & leptonica. - tesseract - leptonica - ] - ++ optionals enableTbb [ - tbb - ] - ++ optionals effectiveStdenv.hostPlatform.isDarwin [ - bzip2 - ] - ++ optionals enableDocs [ - doxygen - graphviz-nox - ] - ++ optionals enableCuda [ - cudaPackages.cuda_cudart - cudaPackages.cuda_cccl # - cudaPackages.libnpp # npp.h - nvidia-optical-flow-sdk - ] - ++ optionals enableCublas [ - # May start using the default $out instead once - # https://github.com/NixOS/nixpkgs/issues/271792 - # has been addressed - cudaPackages.libcublas # cublas_v2.h - ] - ++ optionals enableCudnn [ - cudaPackages.cudnn # cudnn.h - ] - ++ optionals enableCufft [ - cudaPackages.libcufft # cufft.h - ]; + buildInputs = [ + boost + gflags + glib + glog + pcre2 + protobuf_21 + zlib + ] + ++ optionals enablePython [ + pythonPackages.python + ] + ++ optionals (effectiveStdenv.buildPlatform == effectiveStdenv.hostPlatform) [ + hdf5 + ] + ++ optionals enableGtk2 [ + gtk2 + ] + ++ optionals enableGtk3 [ + gtk3 + ] + ++ optionals enableVtk [ + vtk + ] + ++ optionals enableJPEG [ + libjpeg + ] + ++ optionals enablePNG [ + libpng + ] + ++ optionals enableTIFF [ + libtiff + ] + ++ optionals enableWebP [ + libwebp + ] + ++ optionals enableEXR [ + openexr + ] + ++ optionals enableJPEG2000 [ + openjpeg + ] + ++ optionals enableFfmpeg [ + ffmpeg + ] + ++ optionals (enableGStreamer && effectiveStdenv.hostPlatform.isLinux) [ + elfutils + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gstreamer + libunwind + orc + zstd + ] + ++ optionals enableOvis [ + ogre + ] + ++ optionals enableGPhoto2 [ + libgphoto2 + ] + ++ optionals enableDC1394 [ + libdc1394 + ] + ++ optionals enableEigen [ + eigen + ] + ++ optionals enableVA [ + libva + ] + ++ optionals enableBlas [ + blas.provider + ] + ++ optionals enableTesseract [ + # There is seemingly no compile-time flag for Tesseract. It's + # simply enabled automatically if contrib is built, and it detects + # tesseract & leptonica. + tesseract + leptonica + ] + ++ optionals enableTbb [ + tbb + ] + ++ optionals effectiveStdenv.hostPlatform.isDarwin [ + bzip2 + ] + ++ optionals enableDocs [ + doxygen + graphviz-nox + ] + ++ optionals enableCuda [ + cudaPackages.cuda_cudart + cudaPackages.cuda_cccl # + cudaPackages.libnpp # npp.h + nvidia-optical-flow-sdk + ] + ++ optionals enableCublas [ + # May start using the default $out instead once + # https://github.com/NixOS/nixpkgs/issues/271792 + # has been addressed + cudaPackages.libcublas # cublas_v2.h + ] + ++ optionals enableCudnn [ + cudaPackages.cudnn # cudnn.h + ] + ++ optionals enableCufft [ + cudaPackages.libcufft # cufft.h + ]; propagatedBuildInputs = optionals enablePython [ pythonPackages.numpy ]; - nativeBuildInputs = + nativeBuildInputs = [ + cmake + pkg-config + unzip + ] + ++ optionals enablePython ( [ - cmake - pkg-config - unzip + pythonPackages.pip + pythonPackages.wheel + pythonPackages.setuptools ] - ++ optionals enablePython ( - [ - pythonPackages.pip - pythonPackages.wheel - pythonPackages.setuptools - ] - ++ optionals (effectiveStdenv.hostPlatform == effectiveStdenv.buildPlatform) [ - pythonPackages.pythonImportsCheckHook - ] - ) - ++ optionals enableCuda [ - cudaPackages.cuda_nvcc - ]; + ++ optionals (effectiveStdenv.hostPlatform == effectiveStdenv.buildPlatform) [ + pythonPackages.pythonImportsCheckHook + ] + ) + ++ optionals enableCuda [ + cudaPackages.cuda_nvcc + ]; # Configure can't find the library without this. OpenBLAS_HOME = optionalString withOpenblas openblas_.dev; OpenBLAS = optionalString withOpenblas openblas_; - cmakeFlags = - [ - (cmakeBool "OPENCV_GENERATE_PKGCONFIG" true) - (cmakeBool "WITH_OPENMP" true) - (cmakeBool "BUILD_PROTOBUF" false) - (cmakeBool "WITH_PROTOBUF" true) - (cmakeBool "PROTOBUF_UPDATE_FILES" true) - (cmakeBool "OPENCV_ENABLE_NONFREE" enableUnfree) - (cmakeBool "BUILD_TESTS" runAccuracyTests) - (cmakeBool "BUILD_PERF_TESTS" runPerformanceTests) - (cmakeBool "CMAKE_SKIP_BUILD_RPATH" true) - (cmakeBool "BUILD_DOCS" enableDocs) - # "OpenCV disables pkg-config to avoid using of host libraries. Consider using PKG_CONFIG_LIBDIR to specify target SYSROOT" - # but we have proper separation of build and host libs :), fixes cross - (cmakeBool "OPENCV_ENABLE_PKG_CONFIG" true) - (cmakeBool "WITH_IPP" enableIpp) - (cmakeBool "WITH_TIFF" enableTIFF) - (cmakeBool "WITH_WEBP" enableWebP) - (cmakeBool "WITH_JPEG" enableJPEG) - (cmakeBool "WITH_PNG" enablePNG) - (cmakeBool "WITH_OPENEXR" enableEXR) - (cmakeBool "WITH_OPENJPEG" enableJPEG2000) - (cmakeBool "WITH_JASPER" false) # OpenCV falls back to a vendored copy of Jasper when OpenJPEG is disabled - (cmakeBool "WITH_TBB" enableTbb) + cmakeFlags = [ + (cmakeBool "OPENCV_GENERATE_PKGCONFIG" true) + (cmakeBool "WITH_OPENMP" true) + (cmakeBool "BUILD_PROTOBUF" false) + (cmakeBool "WITH_PROTOBUF" true) + (cmakeBool "PROTOBUF_UPDATE_FILES" true) + (cmakeBool "OPENCV_ENABLE_NONFREE" enableUnfree) + (cmakeBool "BUILD_TESTS" runAccuracyTests) + (cmakeBool "BUILD_PERF_TESTS" runPerformanceTests) + (cmakeBool "CMAKE_SKIP_BUILD_RPATH" true) + (cmakeBool "BUILD_DOCS" enableDocs) + # "OpenCV disables pkg-config to avoid using of host libraries. Consider using PKG_CONFIG_LIBDIR to specify target SYSROOT" + # but we have proper separation of build and host libs :), fixes cross + (cmakeBool "OPENCV_ENABLE_PKG_CONFIG" true) + (cmakeBool "WITH_IPP" enableIpp) + (cmakeBool "WITH_TIFF" enableTIFF) + (cmakeBool "WITH_WEBP" enableWebP) + (cmakeBool "WITH_JPEG" enableJPEG) + (cmakeBool "WITH_PNG" enablePNG) + (cmakeBool "WITH_OPENEXR" enableEXR) + (cmakeBool "WITH_OPENJPEG" enableJPEG2000) + (cmakeBool "WITH_JASPER" false) # OpenCV falls back to a vendored copy of Jasper when OpenJPEG is disabled + (cmakeBool "WITH_TBB" enableTbb) - # CUDA options - (cmakeBool "WITH_CUDA" enableCuda) - (cmakeBool "WITH_CUBLAS" enableCublas) - (cmakeBool "WITH_CUDNN" enableCudnn) - (cmakeBool "WITH_CUFFT" enableCufft) + # CUDA options + (cmakeBool "WITH_CUDA" enableCuda) + (cmakeBool "WITH_CUBLAS" enableCublas) + (cmakeBool "WITH_CUDNN" enableCudnn) + (cmakeBool "WITH_CUFFT" enableCufft) - # LTO options - (cmakeBool "ENABLE_LTO" enableLto) - (cmakeBool "ENABLE_THIN_LTO" ( - enableLto - && ( - # Only clang supports thin LTO, so we must either be using clang through the effectiveStdenv, - effectiveStdenv.cc.isClang - || - # or through the backend effectiveStdenv. - (enableCuda && effectiveStdenv.cc.isClang) - ) - )) - ] - ++ optionals enableCuda [ - (cmakeBool "CUDA_FAST_MATH" true) - (cmakeFeature "CUDA_NVCC_FLAGS" "--expt-relaxed-constexpr") + # LTO options + (cmakeBool "ENABLE_LTO" enableLto) + (cmakeBool "ENABLE_THIN_LTO" ( + enableLto + && ( + # Only clang supports thin LTO, so we must either be using clang through the effectiveStdenv, + effectiveStdenv.cc.isClang + || + # or through the backend effectiveStdenv. + (enableCuda && effectiveStdenv.cc.isClang) + ) + )) + ] + ++ optionals enableCuda [ + (cmakeBool "CUDA_FAST_MATH" true) + (cmakeFeature "CUDA_NVCC_FLAGS" "--expt-relaxed-constexpr") - # OpenCV respects at least three variables: - # -DCUDA_GENERATION takes a single arch name, e.g. Volta - # -DCUDA_ARCH_BIN takes a semi-colon separated list of real arches, e.g. "8.0;8.6" - # -DCUDA_ARCH_PTX takes the virtual arch, e.g. "8.6" - (cmakeFeature "CUDA_ARCH_BIN" cmakeCudaArchitecturesString) - (cmakeFeature "CUDA_ARCH_PTX" (last cudaCapabilities)) + # OpenCV respects at least three variables: + # -DCUDA_GENERATION takes a single arch name, e.g. Volta + # -DCUDA_ARCH_BIN takes a semi-colon separated list of real arches, e.g. "8.0;8.6" + # -DCUDA_ARCH_PTX takes the virtual arch, e.g. "8.6" + (cmakeFeature "CUDA_ARCH_BIN" cmakeCudaArchitecturesString) + (cmakeFeature "CUDA_ARCH_PTX" (last cudaCapabilities)) - (cmakeOptionType "path" "NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH" nvidia-optical-flow-sdk.outPath) - ] - ++ optionals effectiveStdenv.hostPlatform.isDarwin [ - (cmakeBool "WITH_OPENCL" false) - (cmakeBool "WITH_LAPACK" false) + (cmakeOptionType "path" "NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH" nvidia-optical-flow-sdk.outPath) + ] + ++ optionals effectiveStdenv.hostPlatform.isDarwin [ + (cmakeBool "WITH_OPENCL" false) + (cmakeBool "WITH_LAPACK" false) - # Disable unnecessary vendoring that's enabled by default only for Darwin. - # Note that the opencvFlag feature flags listed above still take - # precedence, so we can safely list everything here. - (cmakeBool "BUILD_ZLIB" false) - (cmakeBool "BUILD_TIFF" false) - (cmakeBool "BUILD_OPENJPEG" false) - (cmakeBool "BUILD_JASPER" false) - (cmakeBool "BUILD_JPEG" false) - (cmakeBool "BUILD_PNG" false) - (cmakeBool "BUILD_WEBP" false) - ] - ++ optionals (!effectiveStdenv.hostPlatform.isDarwin) [ - (cmakeOptionType "path" "OPENCL_LIBRARY" "${ocl-icd}/lib/libOpenCL.so") - ] - ++ optionals enablePython [ - (cmakeOptionType "path" "OPENCV_PYTHON_INSTALL_PATH" pythonPackages.python.sitePackages) - ] - ++ optionals (enabledModules != [ ]) [ - (cmakeFeature "BUILD_LIST" (concatStringsSep "," enabledModules)) - ]; + # Disable unnecessary vendoring that's enabled by default only for Darwin. + # Note that the opencvFlag feature flags listed above still take + # precedence, so we can safely list everything here. + (cmakeBool "BUILD_ZLIB" false) + (cmakeBool "BUILD_TIFF" false) + (cmakeBool "BUILD_OPENJPEG" false) + (cmakeBool "BUILD_JASPER" false) + (cmakeBool "BUILD_JPEG" false) + (cmakeBool "BUILD_PNG" false) + (cmakeBool "BUILD_WEBP" false) + ] + ++ optionals (!effectiveStdenv.hostPlatform.isDarwin) [ + (cmakeOptionType "path" "OPENCL_LIBRARY" "${ocl-icd}/lib/libOpenCL.so") + ] + ++ optionals enablePython [ + (cmakeOptionType "path" "OPENCV_PYTHON_INSTALL_PATH" pythonPackages.python.sitePackages) + ] + ++ optionals (enabledModules != [ ]) [ + (cmakeFeature "BUILD_LIST" (concatStringsSep "," enabledModules)) + ]; postBuild = optionalString enableDocs '' make doxygen @@ -573,40 +568,39 @@ effectiveStdenv.mkDerivation { # Note that ${exec_prefix} is set to $out but that $out is also appended to # ${exec_prefix}. This causes linker errors in downstream packages so we strip # of $out after the ${exec_prefix} and ${prefix} prefixes: - postInstall = - '' - sed -i "s|{exec_prefix}/$out|{exec_prefix}|;s|{prefix}/$out|{prefix}|" \ - "$out/lib/pkgconfig/opencv4.pc" - mkdir "$cxxdev" - '' - # fix deps not propagating from opencv4.cxxdev if cuda is disabled - # see https://github.com/NixOS/nixpkgs/issues/276691 - + optionalString (!enableCuda) '' - mkdir -p "$cxxdev/nix-support" - echo "''${!outputDev}" >> "$cxxdev/nix-support/propagated-build-inputs" - '' - # remove the requirement that the exact same version of CUDA is used in packages - # consuming OpenCV's CMakes files - + optionalString enableCuda '' - substituteInPlace "$out/lib/cmake/opencv4/OpenCVConfig.cmake" \ - --replace-fail \ - 'find_host_package(CUDA ''${OpenCV_CUDA_VERSION} EXACT REQUIRED)' \ - 'find_host_package(CUDAToolkit REQUIRED)' \ - --replace-fail \ - 'message(FATAL_ERROR "OpenCV static library was compiled with CUDA' \ - 'message("OpenCV static library was compiled with CUDA' - '' - # install python distribution information, so other packages can `import opencv` - + optionalString enablePython '' - pushd $NIX_BUILD_TOP/$sourceRoot/modules/python/package - python -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist . + postInstall = '' + sed -i "s|{exec_prefix}/$out|{exec_prefix}|;s|{prefix}/$out|{prefix}|" \ + "$out/lib/pkgconfig/opencv4.pc" + mkdir "$cxxdev" + '' + # fix deps not propagating from opencv4.cxxdev if cuda is disabled + # see https://github.com/NixOS/nixpkgs/issues/276691 + + optionalString (!enableCuda) '' + mkdir -p "$cxxdev/nix-support" + echo "''${!outputDev}" >> "$cxxdev/nix-support/propagated-build-inputs" + '' + # remove the requirement that the exact same version of CUDA is used in packages + # consuming OpenCV's CMakes files + + optionalString enableCuda '' + substituteInPlace "$out/lib/cmake/opencv4/OpenCVConfig.cmake" \ + --replace-fail \ + 'find_host_package(CUDA ''${OpenCV_CUDA_VERSION} EXACT REQUIRED)' \ + 'find_host_package(CUDAToolkit REQUIRED)' \ + --replace-fail \ + 'message(FATAL_ERROR "OpenCV static library was compiled with CUDA' \ + 'message("OpenCV static library was compiled with CUDA' + '' + # install python distribution information, so other packages can `import opencv` + + optionalString enablePython '' + pushd $NIX_BUILD_TOP/$sourceRoot/modules/python/package + python -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist . - pushd dist - python -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache + pushd dist + python -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache - popd - popd - ''; + popd + popd + ''; pythonImportsCheck = [ "cv2" @@ -616,32 +610,32 @@ effectiveStdenv.mkDerivation { passthru = { cudaSupport = enableCuda; - tests = - { - inherit (gst_all_1) gst-plugins-bad; - } - // optionalAttrs (!effectiveStdenv.hostPlatform.isDarwin) { - inherit qimgv; - withIpp = opencv4.override { enableIpp = true; }; - } - // optionalAttrs (!enablePython) { pythonEnabled = pythonPackages.opencv4; } - // optionalAttrs (effectiveStdenv.buildPlatform != "x86_64-darwin") { - opencv4-tests = callPackage ./tests.nix { - inherit - enableGStreamer - enableGtk2 - enableGtk3 - runAccuracyTests - runPerformanceTests - testDataSrc - ; - inherit opencv4; - }; - } - // optionalAttrs (enableCuda) { - no-libstdcxx-errors = callPackage ./libstdcxx-test.nix { attrName = "opencv4"; }; + tests = { + inherit (gst_all_1) gst-plugins-bad; + } + // optionalAttrs (!effectiveStdenv.hostPlatform.isDarwin) { + inherit qimgv; + withIpp = opencv4.override { enableIpp = true; }; + } + // optionalAttrs (!enablePython) { pythonEnabled = pythonPackages.opencv4; } + // optionalAttrs (effectiveStdenv.buildPlatform != "x86_64-darwin") { + opencv4-tests = callPackage ./tests.nix { + inherit + enableGStreamer + enableGtk2 + enableGtk3 + runAccuracyTests + runPerformanceTests + testDataSrc + ; + inherit opencv4; }; - } // optionalAttrs enablePython { pythonPath = [ ]; }; + } + // optionalAttrs (enableCuda) { + no-libstdcxx-errors = callPackage ./libstdcxx-test.nix { attrName = "opencv4"; }; + }; + } + // optionalAttrs enablePython { pythonPath = [ ]; }; meta = { description = "Open Computer Vision Library with more than 500 algorithms"; diff --git a/pkgs/development/libraries/opencv/tests.nix b/pkgs/development/libraries/opencv/tests.nix index 040554a6683b..2d0fb46c2861 100644 --- a/pkgs/development/libraries/opencv/tests.nix +++ b/pkgs/development/libraries/opencv/tests.nix @@ -23,49 +23,48 @@ runCommand "opencv4-tests" __structuredAttrs = true; strictDeps = true; - nativeBuildInputs = - [ writableTmpDirAsHomeHook ] - ++ optionals enableGStreamer ( - with gst_all_1; - [ - gstreamer - gst-plugins-base - gst-plugins-good - ] - ); - - ignoredTests = + nativeBuildInputs = [ + writableTmpDirAsHomeHook + ] + ++ optionals enableGStreamer ( + with gst_all_1; [ - "AsyncAPICancelation/cancel*" - "Photo_CalibrateDebevec.regression" + gstreamer + gst-plugins-base + gst-plugins-good ] - ++ optionals cudaSupport [ - # opencv4-tests> /build/source/modules/photo/test/test_denoising.cuda.cpp:115: Failure - # opencv4-tests> The max difference between matrices "bgr_gold" and "dbgr" is 2 at (339, 486), which exceeds "1", where "bgr_gold" at (339, 486) evaluates to (182, 239, 239), "dbgr" at (339, 486) evaluates to (184, 239, 239), "1" evaluates to 1 - # opencv4-tests> [ FAILED ] CUDA_FastNonLocalMeans.Regression (48 ms) - "CUDA_FastNonLocalMeans.Regression" - ]; + ); + + ignoredTests = [ + "AsyncAPICancelation/cancel*" + "Photo_CalibrateDebevec.regression" + ] + ++ optionals cudaSupport [ + # opencv4-tests> /build/source/modules/photo/test/test_denoising.cuda.cpp:115: Failure + # opencv4-tests> The max difference between matrices "bgr_gold" and "dbgr" is 2 at (339, 486), which exceeds "1", where "bgr_gold" at (339, 486) evaluates to (182, 239, 239), "dbgr" at (339, 486) evaluates to (184, 239, 239), "1" evaluates to 1 + # opencv4-tests> [ FAILED ] CUDA_FastNonLocalMeans.Regression (48 ms) + "CUDA_FastNonLocalMeans.Regression" + ]; inherit runAccuracyTests; - accuracyTestNames = - [ - "calib3d" - "core" - "features2d" - "flann" - "imgcodecs" - "imgproc" - "ml" - "objdetect" - "photo" - "stitching" - "video" - #"videoio" # - a lot of GStreamer warnings and failed tests - #"dnn" #- some caffe tests failed, probably because github workflow also downloads additional models - ] - ++ optionals (!isAarch64 && enableGStreamer) [ "gapi" ] - ++ optionals (enableGtk2 || enableGtk3) [ "highgui" ]; + accuracyTestNames = [ + "calib3d" + "core" + "features2d" + "flann" + "imgcodecs" + "imgproc" + "ml" + "objdetect" + "photo" + "stitching" + "video" + #"videoio" # - a lot of GStreamer warnings and failed tests + #"dnn" #- some caffe tests failed, probably because github workflow also downloads additional models + ] + ++ optionals (!isAarch64 && enableGStreamer) [ "gapi" ] + ++ optionals (enableGtk2 || enableGtk3) [ "highgui" ]; inherit runPerformanceTests; @@ -79,7 +78,8 @@ runCommand "opencv4-tests" "photo" "stitching" "video" - ] ++ optionals (!isAarch64 && enableGStreamer) [ "gapi" ]; + ] + ++ optionals (!isAarch64 && enableGStreamer) [ "gapi" ]; testRunner = optionalString (!isDarwin) "${getExe xvfb-run} -a "; diff --git a/pkgs/development/libraries/openexr/2.nix b/pkgs/development/libraries/openexr/2.nix index 7a71776aba89..7a1bddcb30c2 100644 --- a/pkgs/development/libraries/openexr/2.nix +++ b/pkgs/development/libraries/openexr/2.nix @@ -57,7 +57,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCMAKE_CTEST_ARGUMENTS=--timeout;3600" - ] ++ lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON"; + ] + ++ lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON"; nativeBuildInputs = [ cmake ]; propagatedBuildInputs = [ diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 9a6b55ac6af6..8b3454bf3f6b 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -62,48 +62,46 @@ let inherit patches; - postPatch = - '' - patchShebangs Configure - '' - + lib.optionalString (lib.versionOlder version "1.1.1") '' - patchShebangs test/* - for a in test/t* ; do - substituteInPlace "$a" \ - --replace /bin/rm rm - done - '' - # config is a configure script which is not installed. - + lib.optionalString (lib.versionAtLeast version "1.1.1") '' - substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env' - '' - + lib.optionalString (lib.versionAtLeast version "1.1.1" && stdenv.hostPlatform.isMusl) '' - substituteInPlace crypto/async/arch/async_posix.h \ - --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \ - '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0' - '' - # Move ENGINESDIR into OPENSSLDIR for static builds, in order to move - # it to the separate etc output. - + lib.optionalString static '' - substituteInPlace Configurations/unix-Makefile.tmpl \ - --replace 'ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}' \ - 'ENGINESDIR=$(OPENSSLDIR)/engines-{- $sover_dirname -}' - ''; + postPatch = '' + patchShebangs Configure + '' + + lib.optionalString (lib.versionOlder version "1.1.1") '' + patchShebangs test/* + for a in test/t* ; do + substituteInPlace "$a" \ + --replace /bin/rm rm + done + '' + # config is a configure script which is not installed. + + lib.optionalString (lib.versionAtLeast version "1.1.1") '' + substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env' + '' + + lib.optionalString (lib.versionAtLeast version "1.1.1" && stdenv.hostPlatform.isMusl) '' + substituteInPlace crypto/async/arch/async_posix.h \ + --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \ + '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0' + '' + # Move ENGINESDIR into OPENSSLDIR for static builds, in order to move + # it to the separate etc output. + + lib.optionalString static '' + substituteInPlace Configurations/unix-Makefile.tmpl \ + --replace 'ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}' \ + 'ENGINESDIR=$(OPENSSLDIR)/engines-{- $sover_dirname -}' + ''; - outputs = - [ - "bin" - "dev" - "out" - "man" - ] - ++ lib.optional withDocs "doc" - # Separate output for the runtime dependencies of the static build. - # Specifically, move OPENSSLDIR into this output, as its path will be - # compiled into 'libcrypto.a'. This makes it a runtime dependency of - # any package that statically links openssl, so we want to keep that - # output minimal. - ++ lib.optional static "etc"; + outputs = [ + "bin" + "dev" + "out" + "man" + ] + ++ lib.optional withDocs "doc" + # Separate output for the runtime dependencies of the static build. + # Specifically, move OPENSSLDIR into this output, as its path will be + # compiled into 'libcrypto.a'. This makes it a runtime dependency of + # any package that statically links openssl, so we want to keep that + # output minimal. + ++ lib.optional static "etc"; setOutputFlags = false; separateDebugInfo = !stdenv.hostPlatform.isDarwin @@ -171,71 +169,70 @@ let # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags. dontAddStaticConfigureFlags = true; - configureFlags = - [ - "shared" # "shared" builds both shared and static libraries - "--libdir=lib" - ( - if !static then - "--openssldir=etc/ssl" - else - # Move OPENSSLDIR to the 'etc' output for static builds. Prepend '/.' - # to the path to make it appear absolute before variable expansion, - # else the 'prefix' would be prepended to it. - "--openssldir=/.$(etc)/etc/ssl" - ) - ] - ++ lib.optionals withCryptodev [ - "-DHAVE_CRYPTODEV" - "-DUSE_CRYPTODEV_DIGESTS" - ] - # enable optimized EC curve primitives on x86_64, - # can provide a 2x up to 4x speedup at best - # with combined PQC and conventional crypto handshakes - # starting with 3.5 its nice to speed things up for free - ++ lib.optional stdenv.hostPlatform.isx86_64 "enable-ec_nistp_64_gcc_128" - # useful to set e.g. 256 bit security level with setting this to 5 - ++ lib.optional ( - securityLevel != null - ) "-DOPENSSL_TLS_SECURITY_LEVEL=${builtins.toString securityLevel}" - ++ lib.optional enableMD2 "enable-md2" - ++ lib.optional enableSSL2 "enable-ssl2" - ++ lib.optional enableSSL3 "enable-ssl3" - # We select KTLS here instead of the configure-time detection (which we patch out). - # KTLS should work on FreeBSD 13+ as well, so we could enable it if someone tests it. - ++ lib.optional (lib.versionAtLeast version "3.0.0" && enableKTLS) "enable-ktls" - ++ lib.optional (lib.versionAtLeast version "1.1.1" && stdenv.hostPlatform.isAarch64) "no-afalgeng" - # OpenSSL needs a specific `no-shared` configure flag. - # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options - # for a comprehensive list of configuration options. - ++ lib.optional (lib.versionAtLeast version "1.1.1" && static) "no-shared" - ++ lib.optional (lib.versionAtLeast version "3.0.0" && static) "no-module" - # This introduces a reference to the CTLOG_FILE which is undesired when - # trying to build binaries statically. - ++ lib.optional static "no-ct" - ++ lib.optional withZlib "zlib" - # /dev/crypto support has been dropped in OpenBSD 5.7. + configureFlags = [ + "shared" # "shared" builds both shared and static libraries + "--libdir=lib" + ( + if !static then + "--openssldir=etc/ssl" + else + # Move OPENSSLDIR to the 'etc' output for static builds. Prepend '/.' + # to the path to make it appear absolute before variable expansion, + # else the 'prefix' would be prepended to it. + "--openssldir=/.$(etc)/etc/ssl" + ) + ] + ++ lib.optionals withCryptodev [ + "-DHAVE_CRYPTODEV" + "-DUSE_CRYPTODEV_DIGESTS" + ] + # enable optimized EC curve primitives on x86_64, + # can provide a 2x up to 4x speedup at best + # with combined PQC and conventional crypto handshakes + # starting with 3.5 its nice to speed things up for free + ++ lib.optional stdenv.hostPlatform.isx86_64 "enable-ec_nistp_64_gcc_128" + # useful to set e.g. 256 bit security level with setting this to 5 + ++ lib.optional ( + securityLevel != null + ) "-DOPENSSL_TLS_SECURITY_LEVEL=${builtins.toString securityLevel}" + ++ lib.optional enableMD2 "enable-md2" + ++ lib.optional enableSSL2 "enable-ssl2" + ++ lib.optional enableSSL3 "enable-ssl3" + # We select KTLS here instead of the configure-time detection (which we patch out). + # KTLS should work on FreeBSD 13+ as well, so we could enable it if someone tests it. + ++ lib.optional (lib.versionAtLeast version "3.0.0" && enableKTLS) "enable-ktls" + ++ lib.optional (lib.versionAtLeast version "1.1.1" && stdenv.hostPlatform.isAarch64) "no-afalgeng" + # OpenSSL needs a specific `no-shared` configure flag. + # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options + # for a comprehensive list of configuration options. + ++ lib.optional (lib.versionAtLeast version "1.1.1" && static) "no-shared" + ++ lib.optional (lib.versionAtLeast version "3.0.0" && static) "no-module" + # This introduces a reference to the CTLOG_FILE which is undesired when + # trying to build binaries statically. + ++ lib.optional static "no-ct" + ++ lib.optional withZlib "zlib" + # /dev/crypto support has been dropped in OpenBSD 5.7. + # + # OpenBSD's ports does this too, + # https://github.com/openbsd/ports/blob/a1147500c76970fea22947648fb92a093a529d7c/security/openssl/3.3/Makefile#L25. + # + # https://github.com/openssl/openssl/pull/10565 indicated the + # intent was that this would be configured properly automatically, + # but that doesn't appear to be the case. + ++ lib.optional stdenv.hostPlatform.isOpenBSD "no-devcryptoeng" + ++ lib.optionals (stdenv.hostPlatform.isMips && stdenv.hostPlatform ? gcc.arch) [ + # This is necessary in order to avoid openssl adding -march + # flags which ultimately conflict with those added by + # cc-wrapper. Openssl assumes that it can scan CFLAGS to + # detect any -march flags, using this perl code: # - # OpenBSD's ports does this too, - # https://github.com/openbsd/ports/blob/a1147500c76970fea22947648fb92a093a529d7c/security/openssl/3.3/Makefile#L25. + # && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}}) # - # https://github.com/openssl/openssl/pull/10565 indicated the - # intent was that this would be configured properly automatically, - # but that doesn't appear to be the case. - ++ lib.optional stdenv.hostPlatform.isOpenBSD "no-devcryptoeng" - ++ lib.optionals (stdenv.hostPlatform.isMips && stdenv.hostPlatform ? gcc.arch) [ - # This is necessary in order to avoid openssl adding -march - # flags which ultimately conflict with those added by - # cc-wrapper. Openssl assumes that it can scan CFLAGS to - # detect any -march flags, using this perl code: - # - # && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}}) - # - # The following bogus CFLAGS environment variable triggers the - # the code above, inhibiting `./Configure` from adding the - # conflicting flags. - "CFLAGS=-march=${stdenv.hostPlatform.gcc.arch}" - ]; + # The following bogus CFLAGS environment variable triggers the + # the code above, inhibiting `./Configure` from adding the + # conflicting flags. + "CFLAGS=-march=${stdenv.hostPlatform.gcc.arch}" + ]; makeFlags = [ "MANDIR=$(man)/share/man" @@ -328,7 +325,8 @@ let "openssl" ]; platforms = lib.platforms.all; - } // extraMeta; + } + // extraMeta; }); in diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index e335a0d3068e..a341256205eb 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -39,13 +39,12 @@ stdenv.mkDerivation rec { hardeningDisable = lib.optional enableJit "shadowstack"; - configureFlags = - [ - "--enable-unicode-properties" - "--disable-cpp" - ] - ++ lib.optional enableJit "--enable-jit=auto" - ++ lib.optional (variant != null) "--enable-${variant}"; + configureFlags = [ + "--enable-unicode-properties" + "--disable-cpp" + ] + ++ lib.optional enableJit "--enable-jit=auto" + ++ lib.optional (variant != null) "--enable-${variant}"; patches = [ # https://bugs.exim.org/show_bug.cgi?id=2173 @@ -72,13 +71,12 @@ stdenv.mkDerivation rec { # XXX: test failure on Cygwin # we are running out of stack on both freeBSDs on Hydra - postFixup = - '' - moveToOutput bin/pcre-config "$dev" - '' - + lib.optionalString (variant != null) '' - ln -sf -t "$out/lib/" '${pcre.out}'/lib/libpcre{,posix}.{so.*.*.*,*dylib,*a} - ''; + postFixup = '' + moveToOutput bin/pcre-config "$dev" + '' + + lib.optionalString (variant != null) '' + ln -sf -t "$out/lib/" '${pcre.out}'/lib/libpcre{,posix}.{so.*.*.*,*dylib,*a} + ''; meta = { homepage = "https://www.pcre.org/"; diff --git a/pkgs/development/libraries/pcre2/default.nix b/pkgs/development/libraries/pcre2/default.nix index 3667510d9a10..fb054defc168 100644 --- a/pkgs/development/libraries/pcre2/default.nix +++ b/pkgs/development/libraries/pcre2/default.nix @@ -17,15 +17,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; - configureFlags = - [ - "--enable-pcre2-16" - "--enable-pcre2-32" - # only enable jit on supported platforms which excludes Apple Silicon, see https://github.com/zherczeg/sljit/issues/51 - "--enable-jit=${if stdenv.hostPlatform.isS390x then "no" else "auto"}" - ] - # fix pcre jit in systemd units that set MemoryDenyWriteExecute=true like gitea - ++ lib.optional withJitSealloc "--enable-jit-sealloc"; + configureFlags = [ + "--enable-pcre2-16" + "--enable-pcre2-32" + # only enable jit on supported platforms which excludes Apple Silicon, see https://github.com/zherczeg/sljit/issues/51 + "--enable-jit=${if stdenv.hostPlatform.isS390x then "no" else "auto"}" + ] + # fix pcre jit in systemd units that set MemoryDenyWriteExecute=true like gitea + ++ lib.optional withJitSealloc "--enable-jit-sealloc"; outputs = [ "bin" diff --git a/pkgs/development/libraries/physics/hepmc3/default.nix b/pkgs/development/libraries/physics/hepmc3/default.nix index 2e770ce59fd8..003f60680d04 100644 --- a/pkgs/development/libraries/physics/hepmc3/default.nix +++ b/pkgs/development/libraries/physics/hepmc3/default.nix @@ -26,11 +26,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake - ] ++ lib.optional withPython python.pkgs.pythonImportsCheckHook; + ] + ++ lib.optional withPython python.pkgs.pythonImportsCheckHook; buildInputs = [ root_py - ] ++ lib.optional withPython python; + ] + ++ lib.optional withPython python; # error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=11.0' preConfigure = @@ -40,15 +42,14 @@ stdenv.mkDerivation rec { MACOSX_DEPLOYMENT_TARGET=10.16 ''; - cmakeFlags = - [ - "-DHEPMC3_CXX_STANDARD=17" - "-DHEPMC3_ENABLE_PYTHON=${if withPython then "ON" else "OFF"}" - ] - ++ lib.optionals withPython [ - "-DHEPMC3_PYTHON_VERSIONS=${if python.isPy3k then "3.X" else "2.X"}" - "-DHEPMC3_Python_SITEARCH${pythonVersion}=${placeholder "out"}/${python.sitePackages}" - ]; + cmakeFlags = [ + "-DHEPMC3_CXX_STANDARD=17" + "-DHEPMC3_ENABLE_PYTHON=${if withPython then "ON" else "OFF"}" + ] + ++ lib.optionals withPython [ + "-DHEPMC3_PYTHON_VERSIONS=${if python.isPy3k then "3.X" else "2.X"}" + "-DHEPMC3_Python_SITEARCH${pythonVersion}=${placeholder "out"}/${python.sitePackages}" + ]; postInstall = '' substituteInPlace "$out"/bin/HepMC3-config \ diff --git a/pkgs/development/libraries/physics/pythia/default.nix b/pkgs/development/libraries/physics/pythia/default.nix index 921b1f6e5f63..7b200199aac5 100644 --- a/pkgs/development/libraries/physics/pythia/default.nix +++ b/pkgs/development/libraries/physics/pythia/default.nix @@ -31,21 +31,20 @@ stdenv.mkDerivation rec { lhapdf ]; - configureFlags = - [ - "--enable-shared" - "--with-lhapdf6=${lhapdf}" - ] - ++ ( - if lib.versions.major hepmc.version == "3" then - [ - "--with-hepmc3=${hepmc}" - ] - else - [ - "--with-hepmc2=${hepmc}" - ] - ); + configureFlags = [ + "--enable-shared" + "--with-lhapdf6=${lhapdf}" + ] + ++ ( + if lib.versions.major hepmc.version == "3" then + [ + "--with-hepmc3=${hepmc}" + ] + else + [ + "--with-hepmc2=${hepmc}" + ] + ); enableParallelBuilding = true; diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index 04f7ea09e50d..86ec0c68f9a5 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -116,68 +116,67 @@ stdenv.mkDerivation (finalAttrs: { glib ]; - buildInputs = - [ - dbus - ffmpeg - fftwFloat - glib - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - libebur128 - libjack2 - libmysofa - libopus - libpulseaudio - libusb1 - libsndfile - lilv - ncurses - readline - ] - ++ ( - if enableSystemd then - [ systemd ] - else if stdenv.hostPlatform.isLinux then - [ - elogind - udev - ] - else - [ ] - ) - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - libinotify-kqueue - epoll-shim - freebsd.libstdthreads - ] - ++ lib.optional webrtcAudioProcessingSupport webrtc-audio-processing - ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib - ++ lib.optional ldacbtSupport ldacbt - ++ lib.optional libcameraSupport libcamera - ++ lib.optional zeroconfSupport avahi - ++ lib.optional raopSupport openssl - ++ lib.optional rocSupport roc-toolkit - ++ lib.optionals vulkanSupport [ - libdrm - vulkan-headers - vulkan-loader - ] - ++ lib.optionals x11Support [ - libcanberra - xorg.libX11 - xorg.libXfixes - ] - ++ lib.optionals bluezSupport [ - bluez - libfreeaptx - liblc3 - sbc - fdk_aac - ] - ++ lib.optional ffadoSupport ffado - ++ lib.optional stdenv.hostPlatform.isLinux libselinux - ++ lib.optional modemmanagerSupport modemmanager; + buildInputs = [ + dbus + ffmpeg + fftwFloat + glib + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + libebur128 + libjack2 + libmysofa + libopus + libpulseaudio + libusb1 + libsndfile + lilv + ncurses + readline + ] + ++ ( + if enableSystemd then + [ systemd ] + else if stdenv.hostPlatform.isLinux then + [ + elogind + udev + ] + else + [ ] + ) + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + libinotify-kqueue + epoll-shim + freebsd.libstdthreads + ] + ++ lib.optional webrtcAudioProcessingSupport webrtc-audio-processing + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib + ++ lib.optional ldacbtSupport ldacbt + ++ lib.optional libcameraSupport libcamera + ++ lib.optional zeroconfSupport avahi + ++ lib.optional raopSupport openssl + ++ lib.optional rocSupport roc-toolkit + ++ lib.optionals vulkanSupport [ + libdrm + vulkan-headers + vulkan-loader + ] + ++ lib.optionals x11Support [ + libcanberra + xorg.libX11 + xorg.libXfixes + ] + ++ lib.optionals bluezSupport [ + bluez + libfreeaptx + liblc3 + sbc + fdk_aac + ] + ++ lib.optional ffadoSupport ffado + ++ lib.optional stdenv.hostPlatform.isLinux libselinux + ++ lib.optional modemmanagerSupport modemmanager; # Valgrind binary is required for running one optional test. nativeCheckInputs = lib.optional (lib.meta.availableOn stdenv.hostPlatform valgrind) valgrind; diff --git a/pkgs/development/libraries/pipewire/wireplumber.nix b/pkgs/development/libraries/pipewire/wireplumber.nix index c2779fa06991..02d11112fc83 100644 --- a/pkgs/development/libraries/pipewire/wireplumber.nix +++ b/pkgs/development/libraries/pipewire/wireplumber.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" - ] ++ lib.optional enableDocs "doc"; + ] + ++ lib.optional enableDocs "doc"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; @@ -40,31 +41,30 @@ stdenv.mkDerivation rec { hash = "sha256-CZjVCy9FKTBO7C5f+vOejJyVjo2a5YoOKgqzH+w2k3w="; }; - nativeBuildInputs = - [ - meson - pkg-config - ninja - ] - ++ lib.optionals enableDocs [ - graphviz - ] - ++ lib.optionals enableGI [ - gobject-introspection - ] - ++ lib.optionals (enableDocs || enableGI) [ - doxygen - (python3.pythonOnBuildForHost.withPackages ( - ps: - with ps; - lib.optionals enableDocs [ - sphinx - sphinx-rtd-theme - breathe - ] - ++ lib.optionals enableGI [ lxml ] - )) - ]; + nativeBuildInputs = [ + meson + pkg-config + ninja + ] + ++ lib.optionals enableDocs [ + graphviz + ] + ++ lib.optionals enableGI [ + gobject-introspection + ] + ++ lib.optionals (enableDocs || enableGI) [ + doxygen + (python3.pythonOnBuildForHost.withPackages ( + ps: + with ps; + lib.optionals enableDocs [ + sphinx + sphinx-rtd-theme + breathe + ] + ++ lib.optionals enableGI [ lxml ] + )) + ]; buildInputs = [ glib diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index e2dfaa031fe6..bf003e8e665a 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -73,70 +73,66 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-mxYnxbdoFqxeQFKgP1tgW6QLRc8GsCyt0EeWILSZqzg="; }; - nativeBuildInputs = - [ - cmake - ninja - pkg-config - python3 - ] - ++ lib.optionals (!minimal) [ - glib # for glib-mkenums - ]; + nativeBuildInputs = [ + cmake + ninja + pkg-config + python3 + ] + ++ lib.optionals (!minimal) [ + glib # for glib-mkenums + ]; - buildInputs = - [ - boost - libiconv - libintl - ] - ++ lib.optionals withData [ - poppler_data - ]; + buildInputs = [ + boost + libiconv + libintl + ] + ++ lib.optionals withData [ + poppler_data + ]; # TODO: reduce propagation to necessary libs - propagatedBuildInputs = - [ - zlib - freetype - fontconfig - libjpeg - openjpeg - ] - ++ lib.optionals (!minimal) [ - cairo - lcms - libtiff - curl - nss - ] - ++ lib.optionals (qt5Support || qt6Support) [ - qtbase - ] - ++ lib.optionals introspectionSupport [ - gobject-introspection - ] - ++ lib.optionals gpgmeSupport [ - gpgme - ]; + propagatedBuildInputs = [ + zlib + freetype + fontconfig + libjpeg + openjpeg + ] + ++ lib.optionals (!minimal) [ + cairo + lcms + libtiff + curl + nss + ] + ++ lib.optionals (qt5Support || qt6Support) [ + qtbase + ] + ++ lib.optionals introspectionSupport [ + gobject-introspection + ] + ++ lib.optionals gpgmeSupport [ + gpgme + ]; - cmakeFlags = - [ - (mkFlag true "UNSTABLE_API_ABI_HEADERS") # previously "XPDF_HEADERS" - (mkFlag (!minimal) "GLIB") - (mkFlag (!minimal) "CPP") - (mkFlag (!minimal) "LIBCURL") - (mkFlag (!minimal) "LCMS") - (mkFlag (!minimal) "LIBTIFF") - (mkFlag (!minimal) "NSS3") - (mkFlag utils "UTILS") - (mkFlag qt5Support "QT5") - (mkFlag qt6Support "QT6") - (mkFlag gpgmeSupport "GPGME") - ] - ++ lib.optionals finalAttrs.finalPackage.doCheck [ - "-DTESTDATADIR=${testData}" - ]; + cmakeFlags = [ + (mkFlag true "UNSTABLE_API_ABI_HEADERS") # previously "XPDF_HEADERS" + (mkFlag (!minimal) "GLIB") + (mkFlag (!minimal) "CPP") + (mkFlag (!minimal) "LIBCURL") + (mkFlag (!minimal) "LCMS") + (mkFlag (!minimal) "LIBTIFF") + (mkFlag (!minimal) "NSS3") + (mkFlag utils "UTILS") + (mkFlag qt5Support "QT5") + (mkFlag qt6Support "QT6") + (mkFlag gpgmeSupport "GPGME") + ] + ++ lib.optionals finalAttrs.finalPackage.doCheck [ + "-DTESTDATADIR=${testData}" + ]; disallowedReferences = lib.optional finalAttrs.finalPackage.doCheck testData; dontWrapQtApps = true; diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index e0094c852165..0165766f3fa4 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -75,17 +75,16 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; cmakeDir = if lib.versionOlder version "22" then "../cmake" else null; - cmakeFlags = - [ - "-Dprotobuf_USE_EXTERNAL_GTEST=ON" - "-Dprotobuf_ABSL_PROVIDER=package" - ] - ++ lib.optionals enableShared [ - "-Dprotobuf_BUILD_SHARED_LIBS=ON" - ] - ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [ - "-Dprotobuf_BUILD_TESTS=OFF" - ]; + cmakeFlags = [ + "-Dprotobuf_USE_EXTERNAL_GTEST=ON" + "-Dprotobuf_ABSL_PROVIDER=package" + ] + ++ lib.optionals enableShared [ + "-Dprotobuf_BUILD_SHARED_LIBS=ON" + ] + ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [ + "-Dprotobuf_BUILD_TESTS=OFF" + ]; doCheck = # Tests fail to build on 32-bit platforms; fixed in 22.x diff --git a/pkgs/development/libraries/qcustomplot/default.nix b/pkgs/development/libraries/qcustomplot/default.nix index 6ecaacfe6bfc..89f490b70f6f 100644 --- a/pkgs/development/libraries/qcustomplot/default.nix +++ b/pkgs/development/libraries/qcustomplot/default.nix @@ -29,13 +29,12 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ qtbase ]; - nativeBuildInputs = - [ - qmake - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + qmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; env.LANG = "C.UTF-8"; diff --git a/pkgs/development/libraries/qdjango/default.nix b/pkgs/development/libraries/qdjango/default.nix index 128b4fbb08a9..8968cb5e0be1 100644 --- a/pkgs/development/libraries/qdjango/default.nix +++ b/pkgs/development/libraries/qdjango/default.nix @@ -24,18 +24,17 @@ stdenv.mkDerivation (finalAttrs: { "doc" ]; - postPatch = - '' - # HTML docs depend on regular docs - substituteInPlace qdjango.pro \ - --replace 'dist.depends = docs' 'htmldocs.depends = docs' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # tst_Auth:constIterator (tests/db/auth/tst_auth.cpp:624) fails on Darwin? - # QVERIFY(&*(it += 2) == 0) evals to false - substituteInPlace tests/db/db.pro \ - --replace 'auth' "" - ''; + postPatch = '' + # HTML docs depend on regular docs + substituteInPlace qdjango.pro \ + --replace 'dist.depends = docs' 'htmldocs.depends = docs' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # tst_Auth:constIterator (tests/db/auth/tst_auth.cpp:624) fails on Darwin? + # QVERIFY(&*(it += 2) == 0) evals to false + substituteInPlace tests/db/db.pro \ + --replace 'auth' "" + ''; qmakeFlags = [ # Uses Qt testing infrastructure via QMake CONFIG testcase, diff --git a/pkgs/development/libraries/qgnomeplatform/default.nix b/pkgs/development/libraries/qgnomeplatform/default.nix index 98bea95922e4..120621df9e62 100644 --- a/pkgs/development/libraries/qgnomeplatform/default.nix +++ b/pkgs/development/libraries/qgnomeplatform/default.nix @@ -43,31 +43,29 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - glib - gtk3 - qtbase - qtwayland - ] - ++ lib.optionals (!useQt6) [ - adwaita-qt - ] - ++ lib.optionals useQt6 [ - adwaita-qt6 - ]; + buildInputs = [ + glib + gtk3 + qtbase + qtwayland + ] + ++ lib.optionals (!useQt6) [ + adwaita-qt + ] + ++ lib.optionals useQt6 [ + adwaita-qt6 + ]; # Qt setup hook complains about missing `wrapQtAppsHook` otherwise. dontWrapQtApps = true; - cmakeFlags = - [ - "-DGLIB_SCHEMAS_DIR=${glib.getSchemaPath gsettings-desktop-schemas}" - "-DQT_PLUGINS_DIR=${placeholder "out"}/${qtbase.qtPluginPrefix}" - ] - ++ lib.optionals useQt6 [ - "-DUSE_QT6=true" - ]; + cmakeFlags = [ + "-DGLIB_SCHEMAS_DIR=${glib.getSchemaPath gsettings-desktop-schemas}" + "-DQT_PLUGINS_DIR=${placeholder "out"}/${qtbase.qtPluginPrefix}" + ] + ++ lib.optionals useQt6 [ + "-DUSE_QT6=true" + ]; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/development/libraries/qmenumodel/default.nix b/pkgs/development/libraries/qmenumodel/default.nix index 5fe61d9418a5..a33c77591ee3 100644 --- a/pkgs/development/libraries/qmenumodel/default.nix +++ b/pkgs/development/libraries/qmenumodel/default.nix @@ -32,18 +32,17 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - postPatch = - '' - substituteInPlace libqmenumodel/src/qmenumodel.pc.in \ - --replace "\''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" "\''${prefix}/lib" \ - --replace "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" "\''${prefix}/include" + postPatch = '' + substituteInPlace libqmenumodel/src/qmenumodel.pc.in \ + --replace "\''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" "\''${prefix}/lib" \ + --replace "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" "\''${prefix}/include" - substituteInPlace libqmenumodel/QMenuModel/CMakeLists.txt \ - --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" - '' - + lib.optionalString finalAttrs.finalPackage.doCheck '' - patchShebangs tests/{client,script}/*.py - ''; + substituteInPlace libqmenumodel/QMenuModel/CMakeLists.txt \ + --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + '' + + lib.optionalString finalAttrs.finalPackage.doCheck '' + patchShebangs tests/{client,script}/*.py + ''; strictDeps = true; diff --git a/pkgs/development/libraries/qscintilla/default.nix b/pkgs/development/libraries/qscintilla/default.nix index 83df3a1fcddd..7abca8393cec 100644 --- a/pkgs/development/libraries/qscintilla/default.nix +++ b/pkgs/development/libraries/qscintilla/default.nix @@ -31,7 +31,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ unzip qmake - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; # Make sure that libqscintilla2.so is available in $out/lib since it is expected # by some packages such as sqlitebrowser diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index 8bce1413ff31..47aa2b0e4172 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -195,54 +195,52 @@ let hash = "sha256-B/z/+tai01RU/bAJSCp5a0/dGI8g36nwso8MiJv27YM="; }) ]; - qtwebengine = - [ - ./qtwebengine-link-pulseaudio.patch - # Fixes Chromium build failure with Ninja 1.12. - # See: https://bugreports.qt.io/browse/QTBUG-124375 - # Backport of: https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?id=a766045f65f934df3b5f1aa63bc86fbb3e003a09 - ./qtwebengine-ninja-1.12.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./qtwebengine-darwin-no-platform-check.patch - ./qtwebengine-mac-dont-set-dsymutil-path.patch - ./qtwebengine-darwin-checks.patch - ]; - qtwebkit = - [ - (fetchpatch { - name = "qtwebkit-python39-json.patch"; - url = "https://github.com/qtwebkit/qtwebkit/commit/78360c01c796b6260bf828bc9c8a0ef73c5132fd.patch"; - sha256 = "yCX/UL666BPxjnxT6rIsUrJsPcSWHhZwMFJfuHhbkhk="; - }) - (fetchpatch { - name = "qtwebkit-bison-3.7-build.patch"; - url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch"; - sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n"; - }) - (fetchpatch { - name = "qtwebkit-glib-2.68.patch"; - url = "https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b.patch"; - sha256 = "0a3xv0h4lv8wggckgy8cg8xnpkg7n9h45312pdjdnnwy87xvzss0"; - }) - (fetchpatch { - name = "qtwebkit-darwin-handle.patch"; - url = "https://github.com/qtwebkit/qtwebkit/commit/5c272a21e621a66862821d3ae680f27edcc64c19.patch"; - sha256 = "9hjqLyABz372QDgoq7nXXXQ/3OXBGcYN1/92ekcC3WE="; - }) - (fetchpatch { - name = "qtwebkit-libxml2-api-change.patch"; - url = "https://github.com/WebKit/WebKit/commit/1bad176b2496579d760852c80cff3ad9fb7c3a4b.patch"; - sha256 = "WZEj+UuKhgJBM7auhND3uddk1wWdTY728jtiWVe7CSI="; - }) - ./qtwebkit.patch - ./qtwebkit-icu68.patch - ./qtwebkit-cstdint.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./qtwebkit-darwin-no-readline.patch - ./qtwebkit-darwin-no-qos-classes.patch - ]; + qtwebengine = [ + ./qtwebengine-link-pulseaudio.patch + # Fixes Chromium build failure with Ninja 1.12. + # See: https://bugreports.qt.io/browse/QTBUG-124375 + # Backport of: https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?id=a766045f65f934df3b5f1aa63bc86fbb3e003a09 + ./qtwebengine-ninja-1.12.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./qtwebengine-darwin-no-platform-check.patch + ./qtwebengine-mac-dont-set-dsymutil-path.patch + ./qtwebengine-darwin-checks.patch + ]; + qtwebkit = [ + (fetchpatch { + name = "qtwebkit-python39-json.patch"; + url = "https://github.com/qtwebkit/qtwebkit/commit/78360c01c796b6260bf828bc9c8a0ef73c5132fd.patch"; + sha256 = "yCX/UL666BPxjnxT6rIsUrJsPcSWHhZwMFJfuHhbkhk="; + }) + (fetchpatch { + name = "qtwebkit-bison-3.7-build.patch"; + url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch"; + sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n"; + }) + (fetchpatch { + name = "qtwebkit-glib-2.68.patch"; + url = "https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b.patch"; + sha256 = "0a3xv0h4lv8wggckgy8cg8xnpkg7n9h45312pdjdnnwy87xvzss0"; + }) + (fetchpatch { + name = "qtwebkit-darwin-handle.patch"; + url = "https://github.com/qtwebkit/qtwebkit/commit/5c272a21e621a66862821d3ae680f27edcc64c19.patch"; + sha256 = "9hjqLyABz372QDgoq7nXXXQ/3OXBGcYN1/92ekcC3WE="; + }) + (fetchpatch { + name = "qtwebkit-libxml2-api-change.patch"; + url = "https://github.com/WebKit/WebKit/commit/1bad176b2496579d760852c80cff3ad9fb7c3a4b.patch"; + sha256 = "WZEj+UuKhgJBM7auhND3uddk1wWdTY728jtiWVe7CSI="; + }) + ./qtwebkit.patch + ./qtwebkit-icu68.patch + ./qtwebkit-cstdint.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./qtwebkit-darwin-no-readline.patch + ./qtwebkit-darwin-no-qos-classes.patch + ]; qttools = [ ./qttools.patch ]; }; @@ -418,7 +416,8 @@ let propagatedBuildInputs = [ qtbase.dev makeBinaryWrapper - ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland.dev; + ] + ++ lib.optional stdenv.hostPlatform.isLinux qtwayland.dev; } ../hooks/wrap-qt-apps-hook.sh ) { }; }; diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index e9be662ab6d4..189562011d78 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -101,78 +101,75 @@ stdenv.mkDerivation ( inherit qtCompatVersion src version; debug = debugSymbols; - propagatedBuildInputs = + propagatedBuildInputs = [ + libxml2 + libxslt + openssl + sqlite + zlib + + # Text rendering + freetype + harfbuzz + icu + + # Image formats + libjpeg + libpng + pcre2 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) ( [ - libxml2 - libxslt - openssl - sqlite - zlib + dbus + glib + udev # Text rendering - freetype - harfbuzz - icu + fontconfig - # Image formats - libjpeg - libpng - pcre2 + libdrm + + # X11 libs + libX11 + libXcomposite + libXext + libXi + libXrender + libxcb + libxkbcommon + xcbutil + xcbutilimage + xcbutilkeysyms + xcbutilrenderutil + xcbutilwm ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) ( - [ - dbus - glib - udev + ++ lib.optional libGLSupported libGL + ); - # Text rendering - fontconfig + buildInputs = [ + python3 + at-spi2-core + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) ( + lib.optional withLibinput libinput ++ lib.optional withGtk3 gtk3 + ) + ++ lib.optional stdenv.hostPlatform.isDarwin darwinVersionInputs + ++ lib.optional developerBuild gdb + ++ lib.optional (cups != null) cups + ++ lib.optional (mysqlSupport) libmysqlclient + ++ lib.optional (libpq != null) libpq; - libdrm - - # X11 libs - libX11 - libXcomposite - libXext - libXi - libXrender - libxcb - libxkbcommon - xcbutil - xcbutilimage - xcbutilkeysyms - xcbutilrenderutil - xcbutilwm - ] - ++ lib.optional libGLSupported libGL - ); - - buildInputs = - [ - python3 - at-spi2-core - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) ( - lib.optional withLibinput libinput ++ lib.optional withGtk3 gtk3 - ) - ++ lib.optional stdenv.hostPlatform.isDarwin darwinVersionInputs - ++ lib.optional developerBuild gdb - ++ lib.optional (cups != null) cups - ++ lib.optional (mysqlSupport) libmysqlclient - ++ lib.optional (libpq != null) libpq; - - nativeBuildInputs = - [ - bison - flex - gperf - lndir - perl - pkg-config - which - ] - ++ lib.optionals (mysqlSupport) [ libmysqlclient ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; + nativeBuildInputs = [ + bison + flex + gperf + lndir + perl + pkg-config + which + ] + ++ lib.optionals (mysqlSupport) [ libmysqlclient ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { @@ -212,90 +209,88 @@ stdenv.mkDerivation ( . ${../hooks/fix-qmake-libtool.sh} ''; - postPatch = - '' - for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do - substituteInPlace "mkspecs/features/$prf" \ - --subst-var qtPluginPrefix \ - --subst-var qtQmlPrefix \ - --subst-var qtDocPrefix - done + postPatch = '' + for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do + substituteInPlace "mkspecs/features/$prf" \ + --subst-var qtPluginPrefix \ + --subst-var qtQmlPrefix \ + --subst-var qtDocPrefix + done - substituteInPlace configure --replace /bin/pwd pwd - substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls - sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf + substituteInPlace configure --replace /bin/pwd pwd + substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls + sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf - sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in - sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake - sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in - sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake + sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in - # https://bugs.gentoo.org/803470 - sed -i 's/-lpthread/-pthread/' mkspecs/common/linux.conf src/corelib/configure.json + # https://bugs.gentoo.org/803470 + sed -i 's/-lpthread/-pthread/' mkspecs/common/linux.conf src/corelib/configure.json - patchShebangs ./bin - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - for file in \ - configure \ - mkspecs/features/mac/asset_catalogs.prf \ - mkspecs/features/mac/default_pre.prf \ - mkspecs/features/mac/sdk.mk \ - mkspecs/features/mac/sdk.prf - do - substituteInPlace "$file" \ - --replace-quiet /usr/bin/xcode-select '${lib.getExe' xcbuild "xcode-select"}' \ - --replace-quiet /usr/bin/xcrun '${lib.getExe' xcbuild "xcrun"}' \ - --replace-quiet /usr/libexec/PlistBuddy '${lib.getExe' xcbuild "PlistBuddy"}' - done + patchShebangs ./bin + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + for file in \ + configure \ + mkspecs/features/mac/asset_catalogs.prf \ + mkspecs/features/mac/default_pre.prf \ + mkspecs/features/mac/sdk.mk \ + mkspecs/features/mac/sdk.prf + do + substituteInPlace "$file" \ + --replace-quiet /usr/bin/xcode-select '${lib.getExe' xcbuild "xcode-select"}' \ + --replace-quiet /usr/bin/xcrun '${lib.getExe' xcbuild "xcrun"}' \ + --replace-quiet /usr/libexec/PlistBuddy '${lib.getExe' xcbuild "PlistBuddy"}' + done - substituteInPlace configure \ - --replace-fail /System/Library/Frameworks/Cocoa.framework "$SDKROOT/System/Library/Frameworks/Cocoa.framework" + substituteInPlace configure \ + --replace-fail /System/Library/Frameworks/Cocoa.framework "$SDKROOT/System/Library/Frameworks/Cocoa.framework" - substituteInPlace mkspecs/common/macx.conf \ - --replace-fail 'CONFIG += ' 'CONFIG += no_default_rpath ' \ - --replace-fail \ - 'QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13' \ - "QMAKE_MACOSX_DEPLOYMENT_TARGET = $MACOSX_DEPLOYMENT_TARGET" - '' - else - lib.optionalString libGLSupported '' - sed -i mkspecs/common/linux.conf \ - -e "/^QMAKE_INCDIR_OPENGL/ s|$|${lib.getDev libGL}/include|" \ - -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${lib.getLib libGL}/lib|" - '' - + lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) '' - sed -i mkspecs/common/gcc-base-unix.conf \ - -e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/" - '' - ); + substituteInPlace mkspecs/common/macx.conf \ + --replace-fail 'CONFIG += ' 'CONFIG += no_default_rpath ' \ + --replace-fail \ + 'QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13' \ + "QMAKE_MACOSX_DEPLOYMENT_TARGET = $MACOSX_DEPLOYMENT_TARGET" + '' + else + lib.optionalString libGLSupported '' + sed -i mkspecs/common/linux.conf \ + -e "/^QMAKE_INCDIR_OPENGL/ s|$|${lib.getDev libGL}/include|" \ + -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${lib.getLib libGL}/lib|" + '' + + lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) '' + sed -i mkspecs/common/gcc-base-unix.conf \ + -e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/" + '' + ); qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins"; qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml"; qtDocPrefix = "share/doc/qt-${qtCompatVersion}"; setOutputFlags = false; - preConfigure = - '' - export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" + preConfigure = '' + export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" - NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\"" + NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\"" - # paralellize compilation of qtmake, which happens within ./configure - export MAKEFLAGS+=" -j$NIX_BUILD_CORES" + # paralellize compilation of qtmake, which happens within ./configure + export MAKEFLAGS+=" -j$NIX_BUILD_CORES" - ./bin/syncqt.pl -version $version - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # QT's configure script will refuse to use pkg-config unless these two environment variables are set - export PKG_CONFIG_SYSROOT_DIR=/ - export PKG_CONFIG_LIBDIR=${lib.getLib pkg-config}/lib - echo "QMAKE_LFLAGS=''${LDFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf - echo "QMAKE_CFLAGS=''${CFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf - echo "QMAKE_CXXFLAGS=''${CXXFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf - ''; + ./bin/syncqt.pl -version $version + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # QT's configure script will refuse to use pkg-config unless these two environment variables are set + export PKG_CONFIG_SYSROOT_DIR=/ + export PKG_CONFIG_LIBDIR=${lib.getLib pkg-config}/lib + echo "QMAKE_LFLAGS=''${LDFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf + echo "QMAKE_CFLAGS=''${CFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf + echo "QMAKE_CXXFLAGS=''${CXXFLAGS}" >> mkspecs/devices/${qtPlatformCross stdenv.hostPlatform}/qmake.conf + ''; postConfigure = '' qmakeCacheInjectNixOutputs() { @@ -319,38 +314,37 @@ stdenv.mkDerivation ( done ''; - env = - { - NIX_CFLAGS_COMPILE = toString ( - [ - "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-Wno-warn=free-nonheap-object" - "-Wno-free-nonheap-object" - "-w" - ] - ++ [ - ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' - ''-DLIBRESOLV_SO="${stdenv.cc.libc.out}/lib/libresolv"'' - ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' - ] - ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"'' - ++ lib.optional stdenv.hostPlatform.isLinux "-DUSE_X11" - ++ lib.optionals withGtk3 [ - ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"'' - ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"'' - ] - ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC" - ); - } - // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { - NIX_CFLAGS_COMPILE_FOR_BUILD = toString ([ + env = { + NIX_CFLAGS_COMPILE = toString ( + [ + "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-Wno-warn=free-nonheap-object" "-Wno-free-nonheap-object" "-w" - ]); - }; + ] + ++ [ + ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"'' + ''-DLIBRESOLV_SO="${stdenv.cc.libc.out}/lib/libresolv"'' + ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"'' + ] + ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"'' + ++ lib.optional stdenv.hostPlatform.isLinux "-DUSE_X11" + ++ lib.optionals withGtk3 [ + ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"'' + ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"'' + ] + ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC" + ); + } + // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + NIX_CFLAGS_COMPILE_FOR_BUILD = toString ([ + "-Wno-warn=free-nonheap-object" + "-Wno-free-nonheap-object" + "-w" + ]); + }; prefixKey = "-prefix "; @@ -365,153 +359,152 @@ stdenv.mkDerivation ( } // { # TODO Remove obsolete and useless flags once the build will be totally mastered - configureFlags = - [ - "-plugindir $(out)/$(qtPluginPrefix)" - "-qmldir $(out)/$(qtQmlPrefix)" - "-docdir $(out)/$(qtDocPrefix)" + configureFlags = [ + "-plugindir $(out)/$(qtPluginPrefix)" + "-qmldir $(out)/$(qtQmlPrefix)" + "-docdir $(out)/$(qtDocPrefix)" - "-verbose" - "-confirm-license" - "-opensource" + "-verbose" + "-confirm-license" + "-opensource" - "-release" - "-shared" - "-accessibility" - "-optimized-qmake" - # for separateDebugInfo - "-no-strip" - "-system-proxies" - "-pkg-config" + "-release" + "-shared" + "-accessibility" + "-optimized-qmake" + # for separateDebugInfo + "-no-strip" + "-system-proxies" + "-pkg-config" - "-gui" - "-widgets" - "-opengl desktop" - "-icu" - "-L" - "${icu.out}/lib" - "-I" - "${icu.dev}/include" - "-pch" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-device ${qtPlatformCross stdenv.hostPlatform}" - "-device-option CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ] - ++ lib.optional debugSymbols "-debug" - ++ lib.optionals developerBuild [ - "-developer-build" - "-no-warnings-are-errors" - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-no-warnings-are-errors" - ] - ++ ( - if (!stdenv.hostPlatform.isx86_64) then - [ - "-no-sse2" - ] - else - [ - "-sse2" - "${lib.optionalString (!stdenv.hostPlatform.sse3Support) "-no"}-sse3" - "${lib.optionalString (!stdenv.hostPlatform.ssse3Support) "-no"}-ssse3" - "${lib.optionalString (!stdenv.hostPlatform.sse4_1Support) "-no"}-sse4.1" - "${lib.optionalString (!stdenv.hostPlatform.sse4_2Support) "-no"}-sse4.2" - "${lib.optionalString (!stdenv.hostPlatform.avxSupport) "-no"}-avx" - "${lib.optionalString (!stdenv.hostPlatform.avx2Support) "-no"}-avx2" - ] - ) - ++ [ - "-no-mips_dsp" - "-no-mips_dspr2" - ] - ++ [ - "-system-zlib" - "-L" - "${zlib.out}/lib" - "-I" - "${zlib.dev}/include" - "-system-libjpeg" - "-L" - "${libjpeg.out}/lib" - "-I" - "${libjpeg.dev}/include" - "-system-harfbuzz" - "-L" - "${harfbuzz.out}/lib" - "-I" - "${harfbuzz.dev}/include" - "-system-pcre" - "-openssl-linked" - "-L" - "${lib.getLib openssl}/lib" - "-I" - "${openssl.dev}/include" - "-system-sqlite" - ''-${if mysqlSupport then "plugin" else "no"}-sql-mysql'' - ''-${if libpq != null then "plugin" else "no"}-sql-psql'' - "-system-libpng" + "-gui" + "-widgets" + "-opengl desktop" + "-icu" + "-L" + "${icu.out}/lib" + "-I" + "${icu.dev}/include" + "-pch" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-device ${qtPlatformCross stdenv.hostPlatform}" + "-device-option CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ] + ++ lib.optional debugSymbols "-debug" + ++ lib.optionals developerBuild [ + "-developer-build" + "-no-warnings-are-errors" + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-no-warnings-are-errors" + ] + ++ ( + if (!stdenv.hostPlatform.isx86_64) then + [ + "-no-sse2" + ] + else + [ + "-sse2" + "${lib.optionalString (!stdenv.hostPlatform.sse3Support) "-no"}-sse3" + "${lib.optionalString (!stdenv.hostPlatform.ssse3Support) "-no"}-ssse3" + "${lib.optionalString (!stdenv.hostPlatform.sse4_1Support) "-no"}-sse4.1" + "${lib.optionalString (!stdenv.hostPlatform.sse4_2Support) "-no"}-sse4.2" + "${lib.optionalString (!stdenv.hostPlatform.avxSupport) "-no"}-avx" + "${lib.optionalString (!stdenv.hostPlatform.avx2Support) "-no"}-avx2" + ] + ) + ++ [ + "-no-mips_dsp" + "-no-mips_dspr2" + ] + ++ [ + "-system-zlib" + "-L" + "${zlib.out}/lib" + "-I" + "${zlib.dev}/include" + "-system-libjpeg" + "-L" + "${libjpeg.out}/lib" + "-I" + "${libjpeg.dev}/include" + "-system-harfbuzz" + "-L" + "${harfbuzz.out}/lib" + "-I" + "${harfbuzz.dev}/include" + "-system-pcre" + "-openssl-linked" + "-L" + "${lib.getLib openssl}/lib" + "-I" + "${openssl.dev}/include" + "-system-sqlite" + ''-${if mysqlSupport then "plugin" else "no"}-sql-mysql'' + ''-${if libpq != null then "plugin" else "no"}-sql-psql'' + "-system-libpng" - "-make libs" - "-make tools" - ''-${lib.optionalString (!buildExamples) "no"}make examples'' - ''-${lib.optionalString (!buildTests) "no"}make tests'' - ] - ++ ( - if stdenv.hostPlatform.isDarwin then - [ - "-no-fontconfig" - "-no-framework" - "-no-rpath" - ] - else - [ - "-rpath" - ] - ++ [ - "-xcb" - "-qpa xcb" - "-L" - "${libX11.out}/lib" - "-I" - "${libX11.out}/include" - "-L" - "${libXext.out}/lib" - "-I" - "${libXext.out}/include" - "-L" - "${libXrender.out}/lib" - "-I" - "${libXrender.out}/include" + "-make libs" + "-make tools" + ''-${lib.optionalString (!buildExamples) "no"}make examples'' + ''-${lib.optionalString (!buildTests) "no"}make tests'' + ] + ++ ( + if stdenv.hostPlatform.isDarwin then + [ + "-no-fontconfig" + "-no-framework" + "-no-rpath" + ] + else + [ + "-rpath" + ] + ++ [ + "-xcb" + "-qpa xcb" + "-L" + "${libX11.out}/lib" + "-I" + "${libX11.out}/include" + "-L" + "${libXext.out}/lib" + "-I" + "${libXext.out}/include" + "-L" + "${libXrender.out}/lib" + "-I" + "${libXrender.out}/include" - ''-${lib.optionalString (cups == null) "no-"}cups'' - "-dbus-linked" - "-glib" - ] - ++ lib.optional withGtk3 "-gtk" - ++ lib.optional withLibinput "-libinput" - ++ [ - "-inotify" - ] - ++ lib.optionals (cups != null) [ - "-L" - "${cups.lib}/lib" - "-I" - "${cups.dev}/include" - ] - ++ lib.optionals (mysqlSupport) [ - "-L" - "${libmysqlclient}/lib" - "-I" - "${libmysqlclient}/include" - ] - ++ lib.optional (withQttranslation && (qttranslations != null)) [ - # depends on x11 - "-translationdir" - "${qttranslations}/translations" - ] - ); + ''-${lib.optionalString (cups == null) "no-"}cups'' + "-dbus-linked" + "-glib" + ] + ++ lib.optional withGtk3 "-gtk" + ++ lib.optional withLibinput "-libinput" + ++ [ + "-inotify" + ] + ++ lib.optionals (cups != null) [ + "-L" + "${cups.lib}/lib" + "-I" + "${cups.dev}/include" + ] + ++ lib.optionals (mysqlSupport) [ + "-L" + "${libmysqlclient}/lib" + "-I" + "${libmysqlclient}/include" + ] + ++ lib.optional (withQttranslation && (qttranslations != null)) [ + # depends on x11 + "-translationdir" + "${qttranslations}/translations" + ] + ); # Move selected outputs. postInstall = '' diff --git a/pkgs/development/libraries/qt-5/modules/qtimageformats.nix b/pkgs/development/libraries/qt-5/modules/qtimageformats.nix index 063a7207d215..09c8d5c2c2ff 100644 --- a/pkgs/development/libraries/qt-5/modules/qtimageformats.nix +++ b/pkgs/development/libraries/qt-5/modules/qtimageformats.nix @@ -10,16 +10,15 @@ qtModule { pname = "qtimageformats"; - propagatedBuildInputs = - [ - qtbase - libwebp - ] - ++ lib.optionals (!jasper.meta.broken) [ - jasper - ] - ++ [ - libmng - libtiff - ]; + propagatedBuildInputs = [ + qtbase + libwebp + ] + ++ lib.optionals (!jasper.meta.broken) [ + jasper + ] + ++ [ + libmng + libtiff + ]; } diff --git a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix index df4a06091471..d54bbd0a9284 100644 --- a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix @@ -19,17 +19,16 @@ qtModule { qtdeclarative ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - gstreamer - gst-plugins-base - ] - # https://github.com/NixOS/nixpkgs/pull/169336 regarding libpulseaudio - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libpulseaudio - alsa-lib - wayland - ]; + buildInputs = [ + gstreamer + gst-plugins-base + ] + # https://github.com/NixOS/nixpkgs/pull/169336 regarding libpulseaudio + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libpulseaudio + alsa-lib + wayland + ]; outputs = [ "bin" "dev" diff --git a/pkgs/development/libraries/qt-5/modules/qtsystems.nix b/pkgs/development/libraries/qt-5/modules/qtsystems.nix index c87d258eff15..0c9557606156 100644 --- a/pkgs/development/libraries/qt-5/modules/qtsystems.nix +++ b/pkgs/development/libraries/qt-5/modules/qtsystems.nix @@ -14,14 +14,13 @@ qtModule { pname = "qtsystems"; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "bin" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "bin" + ]; propagatedBuildInputs = [ qtbase @@ -39,15 +38,14 @@ qtModule { udev ]; - qmakeFlags = - [ - "CONFIG+=git_build" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "CONFIG+=ofono" - "CONFIG+=udisks" - "CONFIG+=upower" - ]; + qmakeFlags = [ + "CONFIG+=git_build" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "CONFIG+=ofono" + "CONFIG+=udisks" + "CONFIG+=upower" + ]; postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' wrapQtApp $bin/bin/servicefw diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix index e4b95207fe92..438300124964 100644 --- a/pkgs/development/libraries/qt-5/modules/qttools.nix +++ b/pkgs/development/libraries/qt-5/modules/qttools.nix @@ -57,7 +57,8 @@ qtModule { "bin/qthelpconverter" "bin/lprodump" "bin/qdistancefieldgenerator" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "bin/macdeployqt" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "bin/macdeployqt" ]; env.NIX_CFLAGS_COMPILE = lib.optionalString ( stdenv.hostPlatform.isDarwin && qtdeclarative != null diff --git a/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix b/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix index 36b3000f7294..c92f6d56e13b 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix @@ -15,5 +15,6 @@ qtModule { outputs = [ "out" "dev" - ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "bin" ]; + ] + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "bin" ]; } diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 6fb7d833470b..93fd45a65d14 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -92,31 +92,30 @@ in qtModule ( { pname = "qtwebengine"; - nativeBuildInputs = - [ - bison - flex - git - gperf - ninja - pkg-config - (python.withPackages (ps: [ ps.html5lib ])) - which - gn - nodejs - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - perl - lndir - (lib.getDev pkgsBuildTarget.targetPackages.qt5.qtbase) - pkgsBuildBuild.pkg-config - (lib.getDev pkgsBuildTarget.targetPackages.qt5.qtquickcontrols) - pkg-config-wrapped-without-prefix - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ - bootstrap_cmds - xcbuild - ]; + nativeBuildInputs = [ + bison + flex + git + gperf + ninja + pkg-config + (python.withPackages (ps: [ ps.html5lib ])) + which + gn + nodejs + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + perl + lndir + (lib.getDev pkgsBuildTarget.targetPackages.qt5.qtbase) + pkgsBuildBuild.pkg-config + (lib.getDev pkgsBuildTarget.targetPackages.qt5.qtquickcontrols) + pkg-config-wrapped-without-prefix + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ + bootstrap_cmds + xcbuild + ]; doCheck = true; outputs = [ "bin" @@ -222,186 +221,181 @@ qtModule ( }) ]; - postPatch = - '' - # Patch Chromium build tools - ( - cd src/3rdparty/chromium; + postPatch = '' + # Patch Chromium build tools + ( + cd src/3rdparty/chromium; - patch -p1 < ${ - (fetchpatch { - # support for building with python 3.12 - name = "python312-six.patch"; - url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/6b0c0e76e0934db2f84be40cb5978cee47266e78/python3.12-six.patch"; - hash = "sha256-YgP9Sq5+zTC+U7+0hQjZokwb+fytk0UEIJztUXFhTkI="; - }) - } + patch -p1 < ${ + (fetchpatch { + # support for building with python 3.12 + name = "python312-six.patch"; + url = "https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/6b0c0e76e0934db2f84be40cb5978cee47266e78/python3.12-six.patch"; + hash = "sha256-YgP9Sq5+zTC+U7+0hQjZokwb+fytk0UEIJztUXFhTkI="; + }) + } - # Manually fix unsupported shebangs - substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \ - --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true + # Manually fix unsupported shebangs + substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \ + --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true - # TODO: be more precise - patchShebangs . - ) - '' - # Prevent Chromium build script from making the path to `clang` relative to - # the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR` - # from `src/core/config/mac_osx.pri`. - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \ - --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"' - '' - # Patch library paths in Qt sources - + '' - sed -i \ - -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \ - -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \ - -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \ - src/core/web_engine_library_info.cpp - '' - # Patch library paths in Chromium sources - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \ - src/3rdparty/chromium/device/udev_linux/udev?_loader.cc + # TODO: be more precise + patchShebangs . + ) + '' + # Prevent Chromium build script from making the path to `clang` relative to + # the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR` + # from `src/core/config/mac_osx.pri`. + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \ + --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"' + '' + # Patch library paths in Qt sources + + '' + sed -i \ + -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \ + -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \ + -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \ + src/core/web_engine_library_info.cpp + '' + # Patch library paths in Chromium sources + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \ + src/3rdparty/chromium/device/udev_linux/udev?_loader.cc - sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ - src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc - '' - + lib.optionalString stdenv.hostPlatform.isDarwin ('' - substituteInPlace src/buildtools/config/mac_osx.pri \ - --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' + sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ + src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc + '' + + lib.optionalString stdenv.hostPlatform.isDarwin ('' + substituteInPlace src/buildtools/config/mac_osx.pri \ + --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' - # Use system ffmpeg - echo "gn_args += use_system_ffmpeg=true" >> src/core/config/mac_osx.pri - echo "LIBS += -lavformat -lavcodec -lavutil" >> src/core/core_common.pri - '') - + postPatch; + # Use system ffmpeg + echo "gn_args += use_system_ffmpeg=true" >> src/core/config/mac_osx.pri + echo "LIBS += -lavformat -lavcodec -lavutil" >> src/core/core_common.pri + '') + + postPatch; - env = - { - NIX_CFLAGS_COMPILE = toString ( - lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - "-w " - ] - ++ lib.optionals stdenv.cc.isGNU [ - # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit - "-Wno-class-memaccess" - ] - ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [ - # it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940 - # TODO: investigate and fix properly - "-march=westmere" - ] - ++ lib.optionals stdenv.cc.isClang [ - "-Wno-elaborated-enum-base" - # 5.15.17: need to silence these two warnings - # https://trac.macports.org/ticket/70850 - "-Wno-enum-constexpr-conversion" - "-Wno-unused-but-set-variable" - # Clang 19 - "-Wno-error=missing-template-arg-list-after-template-kw" - ] - ); - } - // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { - NIX_CFLAGS_LINK = "-Wl,--no-warn-search-mismatch"; - "NIX_CFLAGS_LINK_${buildPackages.stdenv.cc.suffixSalt}" = "-Wl,--no-warn-search-mismatch"; - }; + env = { + NIX_CFLAGS_COMPILE = toString ( + lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "-w " + ] + ++ lib.optionals stdenv.cc.isGNU [ + # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit + "-Wno-class-memaccess" + ] + ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [ + # it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940 + # TODO: investigate and fix properly + "-march=westmere" + ] + ++ lib.optionals stdenv.cc.isClang [ + "-Wno-elaborated-enum-base" + # 5.15.17: need to silence these two warnings + # https://trac.macports.org/ticket/70850 + "-Wno-enum-constexpr-conversion" + "-Wno-unused-but-set-variable" + # Clang 19 + "-Wno-error=missing-template-arg-list-after-template-kw" + ] + ); + } + // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + NIX_CFLAGS_LINK = "-Wl,--no-warn-search-mismatch"; + "NIX_CFLAGS_LINK_${buildPackages.stdenv.cc.suffixSalt}" = "-Wl,--no-warn-search-mismatch"; + }; - preConfigure = - '' - export NINJAFLAGS=-j$NIX_BUILD_CORES + preConfigure = '' + export NINJAFLAGS=-j$NIX_BUILD_CORES - if [ -d "$PWD/tools/qmake" ]; then - QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH" - fi - '' - + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' - export QMAKE_CC=$CC - export QMAKE_CXX=$CXX - export QMAKE_LINK=$CXX - export QMAKE_AR=$AR - ''; + if [ -d "$PWD/tools/qmake" ]; then + QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH" + fi + '' + + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + export QMAKE_CC=$CC + export QMAKE_CXX=$CXX + export QMAKE_LINK=$CXX + export QMAKE_AR=$AR + ''; - qmakeFlags = - [ - "--" - "-system-ffmpeg" - ] - ++ lib.optional ( - pipewireSupport && stdenv.buildPlatform == stdenv.hostPlatform - ) "-webengine-webrtc-pipewire" - ++ lib.optional enableProprietaryCodecs "-proprietary-codecs"; + qmakeFlags = [ + "--" + "-system-ffmpeg" + ] + ++ lib.optional ( + pipewireSupport && stdenv.buildPlatform == stdenv.hostPlatform + ) "-webengine-webrtc-pipewire" + ++ lib.optional enableProprietaryCodecs "-proprietary-codecs"; - propagatedBuildInputs = - [ - qtdeclarative - qtquickcontrols - qtlocation - qtwebchannel + propagatedBuildInputs = [ + qtdeclarative + qtquickcontrols + qtlocation + qtwebchannel - # Image formats - libjpeg - libpng - libtiff - libwebp + # Image formats + libjpeg + libpng + libtiff + libwebp - # Video formats - srtp - libvpx + # Video formats + srtp + libvpx - # Audio formats - libopus + # Audio formats + libopus - # Text rendering - harfbuzz - icu + # Text rendering + harfbuzz + icu - libevent - ffmpeg - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - dbus - zlib - minizip - snappy - nss - protobuf - jsoncpp + libevent + ffmpeg + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + dbus + zlib + minizip + snappy + nss + protobuf + jsoncpp - # Audio formats - alsa-lib - pulseaudio + # Audio formats + alsa-lib + pulseaudio - # Text rendering - fontconfig - freetype + # Text rendering + fontconfig + freetype - libcap - pciutils + libcap + pciutils - # X11 libs - xorg.xrandr - libXScrnSaver - libXcursor - libXrandr - xorg.libpciaccess - libXtst - xorg.libXcomposite - xorg.libXdamage - libdrm - xorg.libxkbfile + # X11 libs + xorg.xrandr + libXScrnSaver + libXcursor + libXrandr + xorg.libpciaccess + libXtst + xorg.libXcomposite + xorg.libXdamage + libdrm + xorg.libxkbfile - ] - ++ lib.optionals pipewireSupport [ - # Pipewire - pipewire - ] + ] + ++ lib.optionals pipewireSupport [ + # Pipewire + pipewire + ] - # FIXME These dependencies shouldn't be needed but can't find a way - # around it. Chromium pulls this in while bootstrapping GN. - ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools.libtool ]; + # FIXME These dependencies shouldn't be needed but can't find a way + # around it. Chromium pulls this in while bootstrapping GN. + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cctools.libtool ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ cups diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 5ef6d4530912..e3eef5f1d22e 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -50,7 +50,8 @@ qtModule { qtlocation qtsensors qtwebchannel - ] ++ lib.optional stdenv.hostPlatform.isDarwin qtmultimedia; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin qtmultimedia; buildInputs = [ fontconfig libwebp @@ -74,13 +75,14 @@ qtModule { cmake ]; - cmakeFlags = - [ "-DPORT=Qt" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia" - "-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets" - "-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF" - ]; + cmakeFlags = [ + "-DPORT=Qt" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia" + "-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets" + "-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF" + ]; env.NIX_CFLAGS_COMPILE = toString ( [ diff --git a/pkgs/development/libraries/qt-5/qtModule.nix b/pkgs/development/libraries/qt-5/qtModule.nix index b7a83d12c099..165b4271c077 100644 --- a/pkgs/development/libraries/qt-5/qtModule.nix +++ b/pkgs/development/libraries/qt-5/qtModule.nix @@ -66,31 +66,30 @@ mkDerivation ( . ${./hooks/fix-qt-builtin-paths.sh} ''; - preConfigure = - '' - ${args.preConfigure or ""} + preConfigure = '' + ${args.preConfigure or ""} - fixQtBuiltinPaths . '*.pr?' - '' - + - lib.optionalString (builtins.compareVersions "5.15.0" version <= 0) - # Note: We use ${version%%-*} to remove any tag from the end of the version - # string. Version tags are added by Nixpkgs maintainers and not reflected in - # the source version. - '' - if [[ -z "$dontCheckQtModuleVersion" ]] \ - && grep -q '^MODULE_VERSION' .qmake.conf 2>/dev/null \ - && ! grep -q -F "''${version%%-*}" .qmake.conf 2>/dev/null - then - echo >&2 "error: could not find version ''${version%%-*} in .qmake.conf" - echo >&2 "hint: check .qmake.conf and update the package version in Nixpkgs" - exit 1 - fi + fixQtBuiltinPaths . '*.pr?' + '' + + + lib.optionalString (builtins.compareVersions "5.15.0" version <= 0) + # Note: We use ${version%%-*} to remove any tag from the end of the version + # string. Version tags are added by Nixpkgs maintainers and not reflected in + # the source version. + '' + if [[ -z "$dontCheckQtModuleVersion" ]] \ + && grep -q '^MODULE_VERSION' .qmake.conf 2>/dev/null \ + && ! grep -q -F "''${version%%-*}" .qmake.conf 2>/dev/null + then + echo >&2 "error: could not find version ''${version%%-*} in .qmake.conf" + echo >&2 "hint: check .qmake.conf and update the package version in Nixpkgs" + exit 1 + fi - if [[ -z "$dontSyncQt" && -f sync.profile ]]; then - syncqt.pl -version "''${version%%-*}" - fi - ''; + if [[ -z "$dontSyncQt" && -f sync.profile ]]; then + syncqt.pl -version "''${version%%-*}" + fi + ''; dontWrapQtApps = args.dontWrapQtApps or true; @@ -125,6 +124,7 @@ mkDerivation ( bkchr ]; platforms = platforms.unix; - } // (args.meta or { }); + } + // (args.meta or { }); } ) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index c3f084efbced..bfab871bc314 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -183,13 +183,12 @@ let makeSetupHook { name = "wrap-qt6-apps-hook"; propagatedBuildInputs = [ makeBinaryWrapper ]; - depsTargetTargetPropagated = - [ - (onlyPluginsAndQml qtbase) - ] - ++ lib.optionals (lib.meta.availableOn stdenv.targetPlatform qtwayland) [ - (onlyPluginsAndQml qtwayland) - ]; + depsTargetTargetPropagated = [ + (onlyPluginsAndQml qtbase) + ] + ++ lib.optionals (lib.meta.availableOn stdenv.targetPlatform qtwayland) [ + (onlyPluginsAndQml qtwayland) + ]; } ./hooks/wrap-qt-apps-hook.sh ) { }; diff --git a/pkgs/development/libraries/qt-6/modules/qtbase/default.nix b/pkgs/development/libraries/qt-6/modules/qtbase/default.nix index 4ba12af1d102..df8286ee8f46 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase/default.nix @@ -90,74 +90,73 @@ stdenv.mkDerivation rec { inherit src version; - propagatedBuildInputs = - [ - libxml2 - libxslt - openssl - sqlite - zlib - libGL - vulkan-headers - vulkan-loader - # Text rendering - harfbuzz - icu - # Image formats - libjpeg - libpng - pcre2 - zstd - libb2 - md4c - double-conversion - ] - ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ - libproxy - dbus - glib - # unixODBC drivers - unixODBC - unixODBCDrivers.psql - unixODBCDrivers.sqlite - unixODBCDrivers.mariadb - ] - ++ lib.optionals systemdSupport [ - systemd - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linux - mtdev - lksctp-tools - libselinux - libsepol - lttng-ust - libthai - libdrm - libdatrie - udev - # Text rendering - fontconfig - freetype - # X11 libs - libX11 - libXcomposite - libXext - libXi - libXrender - libxcb - libxkbcommon - xcbutil - xcbutilimage - xcbutilkeysyms - xcbutilrenderutil - xcbutilwm - xorg.libXdmcp - xorg.libXtst - xorg.xcbutilcursor - libepoxy - ] - ++ lib.optional (cups != null && lib.meta.availableOn stdenv.hostPlatform cups) cups; + propagatedBuildInputs = [ + libxml2 + libxslt + openssl + sqlite + zlib + libGL + vulkan-headers + vulkan-loader + # Text rendering + harfbuzz + icu + # Image formats + libjpeg + libpng + pcre2 + zstd + libb2 + md4c + double-conversion + ] + ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ + libproxy + dbus + glib + # unixODBC drivers + unixODBC + unixODBCDrivers.psql + unixODBCDrivers.sqlite + unixODBCDrivers.mariadb + ] + ++ lib.optionals systemdSupport [ + systemd + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linux + mtdev + lksctp-tools + libselinux + libsepol + lttng-ust + libthai + libdrm + libdatrie + udev + # Text rendering + fontconfig + freetype + # X11 libs + libX11 + libXcomposite + libXext + libXi + libXrender + libxcb + libxkbcommon + xcbutil + xcbutilimage + xcbutilkeysyms + xcbutilrenderutil + xcbutilwm + xorg.libXdmcp + xorg.libXtst + xorg.xcbutilcursor + libepoxy + ] + ++ lib.optional (cups != null && lib.meta.availableOn stdenv.hostPlatform cups) cups; buildInputs = lib.optionals (lib.meta.availableOn stdenv.hostPlatform at-spi2-core) [ @@ -179,13 +178,15 @@ stdenv.mkDerivation rec { which cmake ninja - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; - propagatedNativeBuildInputs = - [ lndir ] - # I’m not sure if this is necessary, but the macOS mkspecs stuff - # tries to call `xcrun xcodebuild`, so better safe than sorry. - ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; + propagatedNativeBuildInputs = [ + lndir + ] + # I’m not sure if this is necessary, but the macOS mkspecs stuff + # tries to call `xcrun xcodebuild`, so better safe than sorry. + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ]; strictDeps = true; @@ -249,38 +250,37 @@ stdenv.mkDerivation rec { qtPluginPrefix = "lib/qt-6/plugins"; qtQmlPrefix = "lib/qt-6/qml"; - cmakeFlags = - [ - "-DQT_EMBED_TOOLCHAIN_COMPILER=OFF" - "-DINSTALL_PLUGINSDIR=${qtPluginPrefix}" - "-DINSTALL_QMLDIR=${qtQmlPrefix}" - "-DQT_FEATURE_libproxy=ON" - "-DQT_FEATURE_system_sqlite=ON" - "-DQT_FEATURE_openssl_linked=ON" - "-DQT_FEATURE_vulkan=ON" - # don't leak OS version into the final output - # https://bugreports.qt.io/browse/QTBUG-136060 - "-DCMAKE_SYSTEM_VERSION=" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "-DQT_FEATURE_sctp=ON" - "-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DQT_FEATURE_rpath=OFF" - "-DQT_NO_XCODE_MIN_VERSION_CHECK=ON" - # This is only used for the min version check, which we disabled above. - # When this variable is not set, cmake tries to execute xcodebuild - # to query the version. - "-DQT_INTERNAL_XCODE_VERSION=0.1" - ] - ++ lib.optionals isCrossBuild [ - "-DQT_HOST_PATH=${pkgsBuildBuild.qt6.qtbase}" - "-DQt6HostInfo_DIR=${pkgsBuildBuild.qt6.qtbase}/lib/cmake/Qt6HostInfo" - ] - ++ lib.optional ( - qttranslations != null && !isCrossBuild - ) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations"; + cmakeFlags = [ + "-DQT_EMBED_TOOLCHAIN_COMPILER=OFF" + "-DINSTALL_PLUGINSDIR=${qtPluginPrefix}" + "-DINSTALL_QMLDIR=${qtQmlPrefix}" + "-DQT_FEATURE_libproxy=ON" + "-DQT_FEATURE_system_sqlite=ON" + "-DQT_FEATURE_openssl_linked=ON" + "-DQT_FEATURE_vulkan=ON" + # don't leak OS version into the final output + # https://bugreports.qt.io/browse/QTBUG-136060 + "-DCMAKE_SYSTEM_VERSION=" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "-DQT_FEATURE_sctp=ON" + "-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DQT_FEATURE_rpath=OFF" + "-DQT_NO_XCODE_MIN_VERSION_CHECK=ON" + # This is only used for the min version check, which we disabled above. + # When this variable is not set, cmake tries to execute xcodebuild + # to query the version. + "-DQT_INTERNAL_XCODE_VERSION=0.1" + ] + ++ lib.optionals isCrossBuild [ + "-DQT_HOST_PATH=${pkgsBuildBuild.qt6.qtbase}" + "-DQt6HostInfo_DIR=${pkgsBuildBuild.qt6.qtbase}/lib/cmake/Qt6HostInfo" + ] + ++ lib.optional ( + qttranslations != null && !isCrossBuild + ) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations"; env.NIX_CFLAGS_COMPILE = "-DNIXPKGS_QT_PLUGIN_PREFIX=\"${qtPluginPrefix}\""; @@ -292,17 +292,16 @@ stdenv.mkDerivation rec { moveToDev = false; - postFixup = - '' - moveToOutput "mkspecs/modules" "$dev" - fixQtModulePaths "$dev/mkspecs/modules" - fixQtBuiltinPaths "$out" '*.pr?' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # FIXME: not sure why this isn't added automatically? - patchelf --add-rpath "${libmysqlclient}/lib/mariadb" $out/${qtPluginPrefix}/sqldrivers/libqsqlmysql.so - patchelf --add-rpath "${vulkan-loader}/lib" --add-needed "libvulkan.so" $out/lib/libQt6Gui.so - ''; + postFixup = '' + moveToOutput "mkspecs/modules" "$dev" + fixQtModulePaths "$dev/mkspecs/modules" + fixQtBuiltinPaths "$out" '*.pr?' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # FIXME: not sure why this isn't added automatically? + patchelf --add-rpath "${libmysqlclient}/lib/mariadb" $out/${qtPluginPrefix}/sqldrivers/libqsqlmysql.so + patchelf --add-rpath "${vulkan-loader}/lib" --add-needed "libvulkan.so" $out/lib/libQt6Gui.so + ''; dontWrapQtApps = true; diff --git a/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix b/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix index 4e1b5e76bab1..cd69aade8314 100644 --- a/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix @@ -56,16 +56,15 @@ qtModule { echo "QTDHASH:''${out:${storePrefixLen}:32}" > .tag ''; - cmakeFlags = - [ - "-DQt6ShaderToolsTools_DIR=${pkgsBuildBuild.qt6.qtshadertools}/lib/cmake/Qt6ShaderTools" - # for some reason doesn't get found automatically on Darwin - "-DPython_EXECUTABLE=${lib.getExe pkgsBuildBuild.python3}" - ] - # Conditional is required to prevent infinite recursion during a cross build - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "-DQt6QmlTools_DIR=${pkgsBuildBuild.qt6.qtdeclarative}/lib/cmake/Qt6QmlTools" - ]; + cmakeFlags = [ + "-DQt6ShaderToolsTools_DIR=${pkgsBuildBuild.qt6.qtshadertools}/lib/cmake/Qt6ShaderTools" + # for some reason doesn't get found automatically on Darwin + "-DPython_EXECUTABLE=${lib.getExe pkgsBuildBuild.python3}" + ] + # Conditional is required to prevent infinite recursion during a cross build + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "-DQt6QmlTools_DIR=${pkgsBuildBuild.qt6.qtdeclarative}/lib/cmake/Qt6QmlTools" + ]; meta.maintainers = with lib.maintainers; [ nickcao diff --git a/pkgs/development/libraries/qt-6/modules/qtmultimedia/default.nix b/pkgs/development/libraries/qt-6/modules/qtmultimedia/default.nix index e053ca90336c..16c9f4d501a6 100644 --- a/pkgs/development/libraries/qt-6/modules/qtmultimedia/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qtmultimedia/default.nix @@ -30,37 +30,37 @@ qtModule { pname = "qtmultimedia"; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ ffmpeg ] - ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ - libunwind - orc - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libpulseaudio - pipewire - alsa-lib - wayland - libXrandr - libva - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ elfutils ]; - propagatedBuildInputs = - [ - qtbase - qtdeclarative - qtsvg - qtshadertools - ] - ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ qtquick3d ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gstreamer - gst-plugins-bad - gst-plugins-base - gst-plugins-good - gst-libav - gst-vaapi - ]; + buildInputs = [ + ffmpeg + ] + ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ + libunwind + orc + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libpulseaudio + pipewire + alsa-lib + wayland + libXrandr + libva + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ elfutils ]; + propagatedBuildInputs = [ + qtbase + qtdeclarative + qtsvg + qtshadertools + ] + ++ lib.optionals (!stdenv.hostPlatform.isMinGW) [ qtquick3d ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gstreamer + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-libav + gst-vaapi + ]; patches = lib.optionals stdenv.hostPlatform.isMinGW [ ./windows-no-uppercase-libs.patch diff --git a/pkgs/development/libraries/qt-6/modules/qtsvg.nix b/pkgs/development/libraries/qt-6/modules/qtsvg.nix index 068a2ddc3469..5937c0c741d0 100644 --- a/pkgs/development/libraries/qt-6/modules/qtsvg.nix +++ b/pkgs/development/libraries/qt-6/modules/qtsvg.nix @@ -13,16 +13,15 @@ qtModule { pname = "qtsvg"; propagatedBuildInputs = [ qtbase ]; - buildInputs = - [ - libwebp - ] - ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - jasper - ] - ++ [ - libmng - zlib - ]; + buildInputs = [ + libwebp + ] + ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + jasper + ] + ++ [ + libmng + zlib + ]; nativeBuildInputs = [ pkg-config ]; } diff --git a/pkgs/development/libraries/qt-6/modules/qttools/default.nix b/pkgs/development/libraries/qt-6/modules/qttools/default.nix index a2b9a36da4ee..fd68b6fd087e 100644 --- a/pkgs/development/libraries/qt-6/modules/qttools/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qttools/default.nix @@ -20,7 +20,8 @@ qtModule { propagatedBuildInputs = [ qtbase qtdeclarative - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ cups ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cups ]; cmakeFlags = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ "-DQt6LinguistTools_DIR=${pkgsBuildBuild.qt6.qttools}/lib/cmake/Qt6LinguistTools" "-DQt6ToolsTools_DIR=${pkgsBuildBuild.qt6.qttools}/lib/cmake/Qt6ToolsTools" diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine/default.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine/default.nix index 748456adfb60..ccbdb4a7e6aa 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebengine/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine/default.nix @@ -70,25 +70,24 @@ qtModule { pname = "qtwebengine"; - nativeBuildInputs = - [ - bison - coreutils - flex - git - gperf - ninja - pkg-config - (python3.withPackages (ps: with ps; [ html5lib ])) - which - gn - nodejs - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - bootstrap_cmds - cctools - xcbuild - ]; + nativeBuildInputs = [ + bison + coreutils + flex + git + gperf + ninja + pkg-config + (python3.withPackages (ps: with ps; [ html5lib ])) + which + gn + nodejs + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + bootstrap_cmds + cctools + xcbuild + ]; doCheck = true; outputs = [ "out" @@ -101,181 +100,177 @@ qtModule { # which cannot be set at the same time as -Wformat-security hardeningDisable = [ "format" ]; - patches = - [ - # Don't assume /usr/share/X11, and also respect the XKB_CONFIG_ROOT - # environment variable, since NixOS relies on it working. - # See https://github.com/NixOS/nixpkgs/issues/226484 for more context. - ./xkb-includes.patch + patches = [ + # Don't assume /usr/share/X11, and also respect the XKB_CONFIG_ROOT + # environment variable, since NixOS relies on it working. + # See https://github.com/NixOS/nixpkgs/issues/226484 for more context. + ./xkb-includes.patch - ./link-pulseaudio.patch + ./link-pulseaudio.patch - # Override locales install path so they go to QtWebEngine's $out - ./locales-path.patch + # Override locales install path so they go to QtWebEngine's $out + ./locales-path.patch - # Reproducibility QTBUG-136068 - ./gn-object-sorted.patch - ] - ++ lib.optionals stdenv.cc.isClang [ - # https://chromium-review.googlesource.com/c/chromium/src/+/6445471 - (fetchpatch2 { - url = "https://github.com/chromium/chromium/commit/f8f21fb4aa01f75acbb12abf5ea8c263c6817141.patch?full_index=1"; - stripLen = 1; - extraPrefix = "src/3rdparty/chromium/"; - hash = "sha256-wcby9uD8xb4re9+s+rdl1hcpxDcHxuI68vUNAC7Baas="; - }) - ]; + # Reproducibility QTBUG-136068 + ./gn-object-sorted.patch + ] + ++ lib.optionals stdenv.cc.isClang [ + # https://chromium-review.googlesource.com/c/chromium/src/+/6445471 + (fetchpatch2 { + url = "https://github.com/chromium/chromium/commit/f8f21fb4aa01f75acbb12abf5ea8c263c6817141.patch?full_index=1"; + stripLen = 1; + extraPrefix = "src/3rdparty/chromium/"; + hash = "sha256-wcby9uD8xb4re9+s+rdl1hcpxDcHxuI68vUNAC7Baas="; + }) + ]; - postPatch = - '' - # Patch Chromium build tools - ( - cd src/3rdparty/chromium; + postPatch = '' + # Patch Chromium build tools + ( + cd src/3rdparty/chromium; - # Manually fix unsupported shebangs - substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \ - --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true - substituteInPlace third_party/webgpu-cts/src/tools/run_deno \ - --replace "/usr/bin/env -S deno" "/usr/bin/deno" || true - patchShebangs . - ) + # Manually fix unsupported shebangs + substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \ + --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true + substituteInPlace third_party/webgpu-cts/src/tools/run_deno \ + --replace "/usr/bin/env -S deno" "/usr/bin/deno" || true + patchShebangs . + ) - substituteInPlace cmake/Functions.cmake \ - --replace "/bin/bash" "${buildPackages.bash}/bin/bash" + substituteInPlace cmake/Functions.cmake \ + --replace "/bin/bash" "${buildPackages.bash}/bin/bash" - # Patch library paths in sources - substituteInPlace src/core/web_engine_library_info.cpp \ - --replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \ - --replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \ - --replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\"" + # Patch library paths in sources + substituteInPlace src/core/web_engine_library_info.cpp \ + --replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \ + --replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \ + --replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\"" - substituteInPlace configure.cmake src/gn/CMakeLists.txt \ - --replace "AppleClang" "Clang" + substituteInPlace configure.cmake src/gn/CMakeLists.txt \ + --replace "AppleClang" "Clang" - # Disable metal shader compilation, Xcode only - substituteInPlace src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/metal/metal_backend.gni \ - --replace-fail 'angle_has_build && !is_ios && target_os == host_os' "false" - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \ - src/3rdparty/chromium/device/udev_linux/udev?_loader.cc + # Disable metal shader compilation, Xcode only + substituteInPlace src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/metal/metal_backend.gni \ + --replace-fail 'angle_has_build && !is_ios && target_os == host_os' "false" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \ + src/3rdparty/chromium/device/udev_linux/udev?_loader.cc - sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ - src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace cmake/QtToolchainHelpers.cmake \ - --replace-fail "/usr/bin/xcrun" "${xcbuild}/bin/xcrun" - ''; + sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ + src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace cmake/QtToolchainHelpers.cmake \ + --replace-fail "/usr/bin/xcrun" "${xcbuild}/bin/xcrun" + ''; - cmakeFlags = - [ - "-DQT_FEATURE_qtpdf_build=ON" - "-DQT_FEATURE_qtpdf_widgets_build=ON" - "-DQT_FEATURE_qtpdf_quick_build=ON" - "-DQT_FEATURE_pdf_v8=ON" - "-DQT_FEATURE_pdf_xfa=ON" - "-DQT_FEATURE_pdf_xfa_bmp=ON" - "-DQT_FEATURE_pdf_xfa_gif=ON" - "-DQT_FEATURE_pdf_xfa_png=ON" - "-DQT_FEATURE_pdf_xfa_tiff=ON" - "-DQT_FEATURE_webengine_system_libevent=ON" - "-DQT_FEATURE_webengine_system_ffmpeg=ON" - # android only. https://bugreports.qt.io/browse/QTBUG-100293 - # "-DQT_FEATURE_webengine_native_spellchecker=ON" - "-DQT_FEATURE_webengine_sanitizer=ON" - "-DQT_FEATURE_webengine_kerberos=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DQT_FEATURE_webengine_system_libxml=ON" - "-DQT_FEATURE_webengine_webrtc_pipewire=ON" + cmakeFlags = [ + "-DQT_FEATURE_qtpdf_build=ON" + "-DQT_FEATURE_qtpdf_widgets_build=ON" + "-DQT_FEATURE_qtpdf_quick_build=ON" + "-DQT_FEATURE_pdf_v8=ON" + "-DQT_FEATURE_pdf_xfa=ON" + "-DQT_FEATURE_pdf_xfa_bmp=ON" + "-DQT_FEATURE_pdf_xfa_gif=ON" + "-DQT_FEATURE_pdf_xfa_png=ON" + "-DQT_FEATURE_pdf_xfa_tiff=ON" + "-DQT_FEATURE_webengine_system_libevent=ON" + "-DQT_FEATURE_webengine_system_ffmpeg=ON" + # android only. https://bugreports.qt.io/browse/QTBUG-100293 + # "-DQT_FEATURE_webengine_native_spellchecker=ON" + "-DQT_FEATURE_webengine_sanitizer=ON" + "-DQT_FEATURE_webengine_kerberos=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DQT_FEATURE_webengine_system_libxml=ON" + "-DQT_FEATURE_webengine_webrtc_pipewire=ON" - # Appears not to work on some platforms - # https://github.com/Homebrew/homebrew-core/issues/104008 - "-DQT_FEATURE_webengine_system_icu=ON" - ] - ++ lib.optionals enableProprietaryCodecs [ - "-DQT_FEATURE_webengine_proprietary_codecs=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0" # Per Qt 6’s deployment target (why doesn’t the hook work?) - ]; + # Appears not to work on some platforms + # https://github.com/Homebrew/homebrew-core/issues/104008 + "-DQT_FEATURE_webengine_system_icu=ON" + ] + ++ lib.optionals enableProprietaryCodecs [ + "-DQT_FEATURE_webengine_proprietary_codecs=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0" # Per Qt 6’s deployment target (why doesn’t the hook work?) + ]; - propagatedBuildInputs = - [ - qtdeclarative - qtwebchannel - qtwebsockets - qtpositioning + propagatedBuildInputs = [ + qtdeclarative + qtwebchannel + qtwebsockets + qtpositioning - # Image formats - libjpeg - libpng - libtiff - libwebp + # Image formats + libjpeg + libpng + libtiff + libwebp - # Video formats - srtp - libvpx + # Video formats + srtp + libvpx - # Audio formats - libopus + # Audio formats + libopus - # Text rendering - harfbuzz + # Text rendering + harfbuzz - openssl - glib - libxslt - lcms2 + openssl + glib + libxslt + lcms2 - libevent - ffmpeg - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - dbus - zlib - minizip - snappy - nss - protobuf - jsoncpp + libevent + ffmpeg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + dbus + zlib + minizip + snappy + nss + protobuf + jsoncpp - icu - libxml2 + icu + libxml2 - # Audio formats - alsa-lib - pulseaudio + # Audio formats + alsa-lib + pulseaudio - # Text rendering - fontconfig - freetype + # Text rendering + fontconfig + freetype - libcap - pciutils + libcap + pciutils - # X11 libs - xorg.xrandr - libXScrnSaver - libXcursor - libXrandr - xorg.libpciaccess - libXtst - xorg.libXcomposite - xorg.libXdamage - libdrm - xorg.libxkbfile - libxshmfence - libXi - xorg.libXext + # X11 libs + xorg.xrandr + libXScrnSaver + libXcursor + libXrandr + xorg.libpciaccess + libXtst + xorg.libXcomposite + xorg.libXdamage + libdrm + xorg.libxkbfile + libxshmfence + libXi + xorg.libXext - # Pipewire - pipewire + # Pipewire + pipewire - libkrb5 - libgbm - ]; + libkrb5 + libgbm + ]; buildInputs = [ cups diff --git a/pkgs/development/libraries/qt-6/modules/qtwebview.nix b/pkgs/development/libraries/qt-6/modules/qtwebview.nix index 56f5aa6a7072..87ea9b8287a1 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebview.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebview.nix @@ -10,5 +10,6 @@ qtModule { pname = "qtwebview"; propagatedBuildInputs = [ qtdeclarative - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ qtwebengine ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ qtwebengine ]; } diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index a7f8144212b2..ac37bfd4f96e 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -24,8 +24,7 @@ stdenv.mkDerivation ( patches = args.patches or patches.${pname} or [ ]; buildInputs = - args.buildInputs or [ ] - ++ lib.optionals stdenv.hostPlatform.isDarwin darwinVersionInputs; + args.buildInputs or [ ] ++ lib.optionals stdenv.hostPlatform.isDarwin darwinVersionInputs; nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ diff --git a/pkgs/development/libraries/qtspell/default.nix b/pkgs/development/libraries/qtspell/default.nix index f9275379e29a..1691b777692c 100644 --- a/pkgs/development/libraries/qtspell/default.nix +++ b/pkgs/development/libraries/qtspell/default.nix @@ -30,15 +30,14 @@ stdenv.mkDerivation rec { qttools ]; - buildInputs = - [ - enchant - qtbase - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - glib - llvmPackages.clang - ]; + buildInputs = [ + enchant + qtbase + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + glib + llvmPackages.clang + ]; cmakeFlags = [ "-DQT_VER=6" ]; diff --git a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix index 729e8b6e918b..54ab47e2db21 100644 --- a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix +++ b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix @@ -39,18 +39,17 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = - [ - qtbase - qtsvg - libX11 - libXext - ] - ++ lib.optionals isQt5 [ qtx11extras ] - ++ lib.optionals (!isQt5) [ - kwindowsystem - qtwayland - ]; + buildInputs = [ + qtbase + qtsvg + libX11 + libXext + ] + ++ lib.optionals isQt5 [ qtx11extras ] + ++ lib.optionals (!isQt5) [ + kwindowsystem + qtwayland + ]; sourceRoot = "${finalAttrs.src.name}/Kvantum"; diff --git a/pkgs/development/libraries/quarto/default.nix b/pkgs/development/libraries/quarto/default.nix index bf141afd4391..19a2d4206bb9 100644 --- a/pkgs/development/libraries/quarto/default.nix +++ b/pkgs/development/libraries/quarto/default.nix @@ -23,7 +23,8 @@ let rWithPackages = rWrapper.override { packages = [ rPackages.rmarkdown - ] ++ extraRPackages; + ] + ++ extraRPackages; }; pythonWithPackages = python3.withPackages ( diff --git a/pkgs/development/libraries/quictls/default.nix b/pkgs/development/libraries/quictls/default.nix index aa4baa49b866..7ee882f89445 100644 --- a/pkgs/development/libraries/quictls/default.nix +++ b/pkgs/development/libraries/quictls/default.nix @@ -39,19 +39,18 @@ stdenv.mkDerivation rec { ) ]; - postPatch = - '' - patchShebangs Configure - '' - # config is a configure script which is not installed. - + '' - substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env' - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - substituteInPlace crypto/async/arch/async_posix.h \ - --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \ - '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0' - ''; + postPatch = '' + patchShebangs Configure + '' + # config is a configure script which is not installed. + + '' + substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env' + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + substituteInPlace crypto/async/arch/async_posix.h \ + --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \ + '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0' + ''; nativeBuildInputs = [ makeWrapper @@ -122,29 +121,28 @@ stdenv.mkDerivation rec { # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags. dontAddStaticConfigureFlags = true; - configureFlags = - [ - "shared" # "shared" builds both shared and static libraries - "--libdir=lib" - "--openssldir=etc/ssl" - ] - ++ lib.optionals withCryptodev [ - "-DHAVE_CRYPTODEV" - "-DUSE_CRYPTODEV_DIGESTS" - ] - ++ lib.optional enableSSL2 "enable-ssl2" - ++ lib.optional enableSSL3 "enable-ssl3" - # We select KTLS here instead of the configure-time detection (which we patch out). - # KTLS should work on FreeBSD 13+ as well, so we could enable it if someone tests it. - ++ lib.optional (stdenv.hostPlatform.isLinux && lib.versionAtLeast version "3.0.0") "enable-ktls" - ++ lib.optional stdenv.hostPlatform.isAarch64 "no-afalgeng" - # OpenSSL needs a specific `no-shared` configure flag. - # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options - # for a comprehensive list of configuration options. - ++ lib.optional static "no-shared" - # This introduces a reference to the CTLOG_FILE which is undesired when - # trying to build binaries statically. - ++ lib.optional static "no-ct"; + configureFlags = [ + "shared" # "shared" builds both shared and static libraries + "--libdir=lib" + "--openssldir=etc/ssl" + ] + ++ lib.optionals withCryptodev [ + "-DHAVE_CRYPTODEV" + "-DUSE_CRYPTODEV_DIGESTS" + ] + ++ lib.optional enableSSL2 "enable-ssl2" + ++ lib.optional enableSSL3 "enable-ssl3" + # We select KTLS here instead of the configure-time detection (which we patch out). + # KTLS should work on FreeBSD 13+ as well, so we could enable it if someone tests it. + ++ lib.optional (stdenv.hostPlatform.isLinux && lib.versionAtLeast version "3.0.0") "enable-ktls" + ++ lib.optional stdenv.hostPlatform.isAarch64 "no-afalgeng" + # OpenSSL needs a specific `no-shared` configure flag. + # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options + # for a comprehensive list of configuration options. + ++ lib.optional static "no-shared" + # This introduces a reference to the CTLOG_FILE which is undesired when + # trying to build binaries statically. + ++ lib.optional static "no-ct"; makeFlags = [ "MANDIR=$(man)/share/man" diff --git a/pkgs/development/libraries/readline/7.0.nix b/pkgs/development/libraries/readline/7.0.nix index 273f8fdd7543..8973f6087783 100644 --- a/pkgs/development/libraries/readline/7.0.nix +++ b/pkgs/development/libraries/readline/7.0.nix @@ -42,7 +42,8 @@ stdenv.mkDerivation rec { patches = [ ./link-against-ncurses.patch ./no-arch_only-6.3.patch - ] ++ upstreamPatches; + ] + ++ upstreamPatches; meta = with lib; { description = "Library for interactive line editing"; diff --git a/pkgs/development/libraries/science/astronomy/indilib/default.nix b/pkgs/development/libraries/science/astronomy/indilib/default.nix index 0c82b12f83b5..f69b2931fe73 100644 --- a/pkgs/development/libraries/science/astronomy/indilib/default.nix +++ b/pkgs/development/libraries/science/astronomy/indilib/default.nix @@ -49,15 +49,14 @@ stdenv.mkDerivation (finalAttrs: { fftw ]; - cmakeFlags = - [ - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d" - ] - ++ lib.optional finalAttrs.finalPackage.doCheck [ - "-DINDI_BUILD_UNITTESTS=ON" - "-DINDI_BUILD_INTEGTESTS=ON" - ]; + cmakeFlags = [ + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d" + ] + ++ lib.optional finalAttrs.finalPackage.doCheck [ + "-DINDI_BUILD_UNITTESTS=ON" + "-DINDI_BUILD_INTEGTESTS=ON" + ]; checkInputs = [ gtest ]; diff --git a/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix b/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix index 0be919c6f202..e7f5a5d6ba48 100644 --- a/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix +++ b/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix @@ -71,25 +71,25 @@ let sourceRoot = "${src.name}/${pname}"; - cmakeFlags = - [ - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d" - "-DRULES_INSTALL_DIR=lib/udev/rules.d" - "-DINDI_DATA_DIR=share/indi/" - ] - ++ lib.optional doCheck [ - "-DINDI_BUILD_UNITTESTS=ON" - "-DINDI_BUILD_INTEGTESTS=ON" - ] - ++ cmakeFlags; + cmakeFlags = [ + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d" + "-DRULES_INSTALL_DIR=lib/udev/rules.d" + "-DINDI_DATA_DIR=share/indi/" + ] + ++ lib.optional doCheck [ + "-DINDI_BUILD_UNITTESTS=ON" + "-DINDI_BUILD_INTEGTESTS=ON" + ] + ++ cmakeFlags; nativeBuildInputs = [ cmake ninja pkg-config udevCheckHook - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; checkInputs = [ gtest ]; diff --git a/pkgs/development/libraries/science/math/magma/generic.nix b/pkgs/development/libraries/science/math/magma/generic.nix index 3ce4d9a7bf66..0ef5e1abed08 100644 --- a/pkgs/development/libraries/science/math/magma/generic.nix +++ b/pkgs/development/libraries/science/math/magma/generic.nix @@ -117,76 +117,73 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs ./testing/run_{tests,summarize}.py ''; - nativeBuildInputs = - [ - autoPatchelfHook - cmake - ninja - gfortran - ] - ++ lists.optionals cudaSupport [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + autoPatchelfHook + cmake + ninja + gfortran + ] + ++ lists.optionals cudaSupport [ + cudaPackages.cuda_nvcc + ]; - buildInputs = + buildInputs = [ + libpthreadstubs + lapack + blas + python3 + (getLib gfortran.cc) # libgfortran.so + ] + ++ lists.optionals cudaSupport ( + with cudaPackages; [ - libpthreadstubs - lapack - blas - python3 - (getLib gfortran.cc) # libgfortran.so + cuda_cccl # and + cuda_cudart # cuda_runtime.h + libcublas # cublas_v2.h + libcusparse # cusparse.h ] - ++ lists.optionals cudaSupport ( - with cudaPackages; - [ - cuda_cccl # and - cuda_cudart # cuda_runtime.h - libcublas # cublas_v2.h - libcusparse # cusparse.h - ] - ++ lists.optionals (cudaOlder "11.8") [ - cuda_nvprof # - ] - ++ lists.optionals (cudaAtLeast "11.8") [ - cuda_profiler_api # - ] - ) - ++ lists.optionals rocmSupport ( - with rocmPackages; - [ - clr - hipblas - hipsparse - llvm.openmp - ] - ); + ++ lists.optionals (cudaOlder "11.8") [ + cuda_nvprof # + ] + ++ lists.optionals (cudaAtLeast "11.8") [ + cuda_profiler_api # + ] + ) + ++ lists.optionals rocmSupport ( + with rocmPackages; + [ + clr + hipblas + hipsparse + llvm.openmp + ] + ); - cmakeFlags = - [ - (strings.cmakeFeature "GPU_TARGET" gpuTargetString) - (strings.cmakeBool "MAGMA_ENABLE_CUDA" cudaSupport) - (strings.cmakeBool "MAGMA_ENABLE_HIP" rocmSupport) - (strings.cmakeBool "BUILD_SHARED_LIBS" (!static)) - # Set the Fortran name mangling scheme explicitly. We must set FORTRAN_CONVENTION manually because it will - # otherwise not be set in NVCC_FLAGS or DEVCCFLAGS (which we cannot modify). - # See https://github.com/NixOS/nixpkgs/issues/281656#issuecomment-1902931289 - (strings.cmakeBool "USE_FORTRAN" true) - (strings.cmakeFeature "CMAKE_C_FLAGS" "-DADD_") - (strings.cmakeFeature "CMAKE_CXX_FLAGS" "-DADD_") - (strings.cmakeFeature "FORTRAN_CONVENTION" "-DADD_") - ] - ++ lists.optionals cudaSupport [ - (strings.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaArchitecturesString) - (strings.cmakeFeature "MIN_ARCH" minArch) # Disarms magma's asserts - ] - ++ lists.optionals rocmSupport [ - # Can be removed once https://github.com/icl-utk-edu/magma/pull/27 is merged - # Can't easily apply the PR as a patch because we rely on the tarball with pregenerated - # hipified files ∴ fetchpatch of the PR will apply cleanly but fail to build - (strings.cmakeFeature "ROCM_CORE" "${rocmPackages.clr}") - (strings.cmakeFeature "CMAKE_C_COMPILER" "${rocmPackages.clr}/bin/hipcc") - (strings.cmakeFeature "CMAKE_CXX_COMPILER" "${rocmPackages.clr}/bin/hipcc") - ]; + cmakeFlags = [ + (strings.cmakeFeature "GPU_TARGET" gpuTargetString) + (strings.cmakeBool "MAGMA_ENABLE_CUDA" cudaSupport) + (strings.cmakeBool "MAGMA_ENABLE_HIP" rocmSupport) + (strings.cmakeBool "BUILD_SHARED_LIBS" (!static)) + # Set the Fortran name mangling scheme explicitly. We must set FORTRAN_CONVENTION manually because it will + # otherwise not be set in NVCC_FLAGS or DEVCCFLAGS (which we cannot modify). + # See https://github.com/NixOS/nixpkgs/issues/281656#issuecomment-1902931289 + (strings.cmakeBool "USE_FORTRAN" true) + (strings.cmakeFeature "CMAKE_C_FLAGS" "-DADD_") + (strings.cmakeFeature "CMAKE_CXX_FLAGS" "-DADD_") + (strings.cmakeFeature "FORTRAN_CONVENTION" "-DADD_") + ] + ++ lists.optionals cudaSupport [ + (strings.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cudaArchitecturesString) + (strings.cmakeFeature "MIN_ARCH" minArch) # Disarms magma's asserts + ] + ++ lists.optionals rocmSupport [ + # Can be removed once https://github.com/icl-utk-edu/magma/pull/27 is merged + # Can't easily apply the PR as a patch because we rely on the tarball with pregenerated + # hipified files ∴ fetchpatch of the PR will apply cleanly but fail to build + (strings.cmakeFeature "ROCM_CORE" "${rocmPackages.clr}") + (strings.cmakeFeature "CMAKE_C_COMPILER" "${rocmPackages.clr}/bin/hipcc") + (strings.cmakeFeature "CMAKE_CXX_COMPILER" "${rocmPackages.clr}/bin/hipcc") + ]; # Magma doesn't have a test suite we can easily run, just loose executables, all of which require a GPU. doCheck = false; diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index 3f69c382ff77..69b51422100b 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -207,22 +207,21 @@ stdenv.mkDerivation rec { # In either case, OpenBLAS must only be used by trusted code--it is # inherently unsuitable for security-conscious applications--so there should # be no objection to disabling these hardening measures. - hardeningDisable = - [ - # don't modify or move the stack - "stackprotector" - "pic" - # don't alter index arithmetic - "strictoverflow" - # don't interfere with dynamic target detection - "relro" - "bindnow" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # "__builtin_clear_padding not supported for variable length aggregates" - # in aarch64-specific code - "trivialautovarinit" - ]; + hardeningDisable = [ + # don't modify or move the stack + "stackprotector" + "pic" + # don't alter index arithmetic + "strictoverflow" + # don't interfere with dynamic target detection + "relro" + "bindnow" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # "__builtin_clear_padding not supported for variable length aggregates" + # in aarch64-specific code + "trivialautovarinit" + ]; nativeBuildInputs = [ perl @@ -279,43 +278,42 @@ stdenv.mkDerivation rec { doCheck = true; checkTarget = "tests"; - postInstall = - '' - # Write pkgconfig aliases. Upstream report: - # https://github.com/OpenMathLib/OpenBLAS/issues/1740 - for alias in blas cblas lapack; do - cat < $out/lib/pkgconfig/$alias.pc - Name: $alias - Version: ${version} - Description: $alias provided by the OpenBLAS package. - Cflags: -I$dev/include - Libs: -L$out/lib -lopenblas - EOF - done + postInstall = '' + # Write pkgconfig aliases. Upstream report: + # https://github.com/OpenMathLib/OpenBLAS/issues/1740 + for alias in blas cblas lapack; do + cat < $out/lib/pkgconfig/$alias.pc + Name: $alias + Version: ${version} + Description: $alias provided by the OpenBLAS package. + Cflags: -I$dev/include + Libs: -L$out/lib -lopenblas + EOF + done - # Setup symlinks for blas / lapack - '' - + lib.optionalString stdenv.hostPlatform.isMinGW '' - ln -s $out/bin/*.dll $out/lib - '' - + lib.optionalString enableShared '' - ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt} - ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt} - ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt} - ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt} - '' - + lib.optionalString (stdenv.hostPlatform.isLinux && enableShared) '' - ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}.3 - ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}.3 - ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}.3 - ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}.3 - '' - + lib.optionalString enableStatic '' - ln -s $out/lib/libopenblas.a $out/lib/libblas.a - ln -s $out/lib/libopenblas.a $out/lib/libcblas.a - ln -s $out/lib/libopenblas.a $out/lib/liblapack.a - ln -s $out/lib/libopenblas.a $out/lib/liblapacke.a - ''; + # Setup symlinks for blas / lapack + '' + + lib.optionalString stdenv.hostPlatform.isMinGW '' + ln -s $out/bin/*.dll $out/lib + '' + + lib.optionalString enableShared '' + ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt} + ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt} + ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt} + ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt} + '' + + lib.optionalString (stdenv.hostPlatform.isLinux && enableShared) '' + ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}.3 + ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}.3 + ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}.3 + ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}.3 + '' + + lib.optionalString enableStatic '' + ln -s $out/lib/libopenblas.a $out/lib/libblas.a + ln -s $out/lib/libopenblas.a $out/lib/libcblas.a + ln -s $out/lib/libopenblas.a $out/lib/liblapack.a + ln -s $out/lib/libopenblas.a $out/lib/liblapacke.a + ''; passthru.tests = { inherit (python3.pkgs) numpy scipy scikit-learn; diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index adb5b196a34b..df867ee42121 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -36,15 +36,14 @@ effectiveStdenv.mkDerivation rec { sha256 = "sha256-Anen1YtXsSPhk8DpA4JtADIz9m8oXFl9umlkb4iImf8="; }; - nativeBuildInputs = - [ - ] - ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ] - ++ lib.optionals enableCuda [ - cudaPackages.cuda_nvcc - ]; + nativeBuildInputs = [ + ] + ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ] + ++ lib.optionals enableCuda [ + cudaPackages.cuda_nvcc + ]; # Use compatible indexing for lapack and blas used buildInputs = @@ -71,39 +70,37 @@ effectiveStdenv.mkDerivation rec { sed -i "Makefile" -e '/GraphBLAS\|Mongoose/d' ''; - makeFlags = - [ - "INSTALL=${placeholder "out"}" - "INSTALL_INCLUDE=${placeholder "dev"}/include" - "JOBS=$(NIX_BUILD_CORES)" - "MY_METIS_LIB=-lmetis" - ] - ++ lib.optionals blas.isILP64 [ - "CFLAGS=-DBLAS64" - ] - ++ lib.optionals enableCuda [ - "CUDA_PATH=${cudaPackages.cuda_nvcc}" - "CUDART_LIB=${lib.getLib cudaPackages.cuda_cudart}/lib/libcudart.so" - "CUBLAS_LIB=${lib.getLib cudaPackages.libcublas}/lib/libcublas.so" - ] - ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ - # Unless these are set, the build will attempt to use `Accelerate` on darwin, see: - # https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/v5.13.0/SuiteSparse_config/SuiteSparse_config.mk#L368 - "BLAS=-lblas" - "LAPACK=-llapack" - ]; + makeFlags = [ + "INSTALL=${placeholder "out"}" + "INSTALL_INCLUDE=${placeholder "dev"}/include" + "JOBS=$(NIX_BUILD_CORES)" + "MY_METIS_LIB=-lmetis" + ] + ++ lib.optionals blas.isILP64 [ + "CFLAGS=-DBLAS64" + ] + ++ lib.optionals enableCuda [ + "CUDA_PATH=${cudaPackages.cuda_nvcc}" + "CUDART_LIB=${lib.getLib cudaPackages.cuda_cudart}/lib/libcudart.so" + "CUBLAS_LIB=${lib.getLib cudaPackages.libcublas}/lib/libcublas.so" + ] + ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ + # Unless these are set, the build will attempt to use `Accelerate` on darwin, see: + # https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/v5.13.0/SuiteSparse_config/SuiteSparse_config.mk#L368 + "BLAS=-lblas" + "LAPACK=-llapack" + ]; - env = - { - # in GCC14 these two warnings were promoted to error - # let's make them warnings again to fix the build failure - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types"; - } - // lib.optionalAttrs effectiveStdenv.hostPlatform.isDarwin { - # Ensure that there is enough space for the `fixDarwinDylibNames` hook to - # update the install names of the output dylibs. - NIX_LDFLAGS = "-headerpad_max_install_names"; - }; + env = { + # in GCC14 these two warnings were promoted to error + # let's make them warnings again to fix the build failure + NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types"; + } + // lib.optionalAttrs effectiveStdenv.hostPlatform.isDarwin { + # Ensure that there is enough space for the `fixDarwinDylibNames` hook to + # update the install names of the output dylibs. + NIX_LDFLAGS = "-headerpad_max_install_names"; + }; buildFlags = [ # Build individual shared libraries, not demos diff --git a/pkgs/development/libraries/science/math/trilinos/default.nix b/pkgs/development/libraries/science/math/trilinos/default.nix index 25de281cffb4..45331a18cc98 100644 --- a/pkgs/development/libraries/science/math/trilinos/default.nix +++ b/pkgs/development/libraries/science/math/trilinos/default.nix @@ -82,7 +82,8 @@ stdenv.mkDerivation rec { boost lapack suitesparse - ] ++ lib.optionals withMPI [ mpi ]; + ] + ++ lib.optionals withMPI [ mpi ]; preConfigure = if withMPI then diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix index cef47a396da7..8e56d3b70dd4 100644 --- a/pkgs/development/libraries/silgraphite/graphite2.nix +++ b/pkgs/development/libraries/silgraphite/graphite2.nix @@ -30,13 +30,14 @@ stdenv.mkDerivation (finalAttrs: { pkg-config cmake ]; - buildInputs = - [ freetype ] - ++ lib.optional (stdenv.targetPlatform.useLLVM or false) ( - llvmPackages.compiler-rt.override { - doFakeLibgcc = true; - } - ); + buildInputs = [ + freetype + ] + ++ lib.optional (stdenv.targetPlatform.useLLVM or false) ( + llvmPackages.compiler-rt.override { + doFakeLibgcc = true; + } + ); patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./macosx.patch ]; postPatch = '' diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 4fae7f1b1a01..24e5cf2843eb 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -56,12 +56,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ unzip ]; - buildInputs = - [ zlib ] - ++ lib.optionals interactive [ - readline - ncurses - ]; + buildInputs = [ + zlib + ] + ++ lib.optionals interactive [ + readline + ncurses + ]; # required for aarch64 but applied for all arches for simplicity preConfigure = '' @@ -73,16 +74,15 @@ stdenv.mkDerivation rec { # on a per-output basis. setOutputFlags = false; - configureFlags = - [ - "--bindir=${placeholder "bin"}/bin" - "--includedir=${placeholder "dev"}/include" - "--libdir=${placeholder "out"}/lib" - ] - ++ lib.optional (!interactive) "--disable-readline" - # autosetup only looks up readline.h in predefined set of directories. - ++ lib.optional interactive "--with-readline-header=${lib.getDev readline}/include/readline/readline.h" - ++ lib.optional (stdenv.hostPlatform.isStatic) "--disable-shared"; + configureFlags = [ + "--bindir=${placeholder "bin"}/bin" + "--includedir=${placeholder "dev"}/include" + "--libdir=${placeholder "out"}/lib" + ] + ++ lib.optional (!interactive) "--disable-readline" + # autosetup only looks up readline.h in predefined set of directories. + ++ lib.optional interactive "--with-readline-header=${lib.getDev readline}/include/readline/readline.h" + ++ lib.optional (stdenv.hostPlatform.isStatic) "--disable-shared"; env.NIX_CFLAGS_COMPILE = toString [ "-DSQLITE_ENABLE_COLUMN_METADATA" diff --git a/pkgs/development/libraries/sqlite/sqlar.nix b/pkgs/development/libraries/sqlite/sqlar.nix index 7b6b41c7900d..943b8d44527b 100644 --- a/pkgs/development/libraries/sqlite/sqlar.nix +++ b/pkgs/development/libraries/sqlite/sqlar.nix @@ -26,15 +26,15 @@ stdenv.mkDerivation { buildFlags = [ "CFLAGS=-Wno-error" "sqlar" - ] ++ lib.optional withFuse "sqlarfs"; + ] + ++ lib.optional withFuse "sqlarfs"; - installPhase = - '' - install -D -t $out/bin sqlar - '' - + lib.optionalString withFuse '' - install -D -t $out/bin sqlarfs - ''; + installPhase = '' + install -D -t $out/bin sqlar + '' + + lib.optionalString withFuse '' + install -D -t $out/bin sqlarfs + ''; meta = with lib; { homepage = "https://sqlite.org/sqlar"; diff --git a/pkgs/development/libraries/tinyxml/2.6.2.nix b/pkgs/development/libraries/tinyxml/2.6.2.nix index f70142b6b2d4..1d91b57e262c 100644 --- a/pkgs/development/libraries/tinyxml/2.6.2.nix +++ b/pkgs/development/libraries/tinyxml/2.6.2.nix @@ -71,24 +71,23 @@ stdenv.mkDerivation { fi ''; - installPhase = - '' - mkdir -pv $out/include/ - mkdir -pv $out/lib/pkgconfig/ - mkdir -pv $out/share/doc/tinyxml/ + installPhase = '' + mkdir -pv $out/include/ + mkdir -pv $out/lib/pkgconfig/ + mkdir -pv $out/share/doc/tinyxml/ - cp -v libtinyxml${SHLIB_EXT} $out/lib/ - cp -v *.h $out/include/ + cp -v libtinyxml${SHLIB_EXT} $out/lib/ + cp -v *.h $out/include/ - substituteInPlace tinyxml.pc --replace "@out@" "$out" - substituteInPlace tinyxml.pc --replace "@version@" "${version}" - cp -v tinyxml.pc $out/lib/pkgconfig/ + substituteInPlace tinyxml.pc --replace "@out@" "$out" + substituteInPlace tinyxml.pc --replace "@version@" "${version}" + cp -v tinyxml.pc $out/lib/pkgconfig/ - cp -v docs/* $out/share/doc/tinyxml/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -id $out/lib/libtinyxml.dylib $out/lib/libtinyxml.dylib - ''; + cp -v docs/* $out/share/doc/tinyxml/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -id $out/lib/libtinyxml.dylib $out/lib/libtinyxml.dylib + ''; meta = { description = "Simple, small, C++ XML parser that can be easily integrating into other programs"; diff --git a/pkgs/development/libraries/tk/generic.nix b/pkgs/development/libraries/tk/generic.nix index 5a010c7b12bd..3fa3bf1285e8 100644 --- a/pkgs/development/libraries/tk/generic.nix +++ b/pkgs/development/libraries/tk/generic.nix @@ -52,31 +52,29 @@ tcl.mkTclDerivation { cp ../macosx/*.h $out/include ''; - configureFlags = - [ - "--enable-threads" - ] - ++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit" - ++ lib.optional enableAqua "--enable-aqua" - ++ - lib.optional (lib.versionAtLeast tcl.version "9.0") - # By default, tk libraries get zipped and embedded into libtcl9tk*.so, - # which gets `zipfs mount`ed at runtime. This is fragile (for example - # stripping the .so removes the zip trailer), so we install them as - # traditional files. - # This might make tcl slower to start from slower storage on cold cache, - # however according to my benchmarks on fast storage and warm cache - # tcl built with --disable-zipfs actually starts in half the time. - "--disable-zipfs"; + configureFlags = [ + "--enable-threads" + ] + ++ lib.optional stdenv.hostPlatform.is64bit "--enable-64bit" + ++ lib.optional enableAqua "--enable-aqua" + ++ + lib.optional (lib.versionAtLeast tcl.version "9.0") + # By default, tk libraries get zipped and embedded into libtcl9tk*.so, + # which gets `zipfs mount`ed at runtime. This is fragile (for example + # stripping the .so removes the zip trailer), so we install them as + # traditional files. + # This might make tcl slower to start from slower storage on cold cache, + # however according to my benchmarks on fast storage and warm cache + # tcl built with --disable-zipfs actually starts in half the time. + "--disable-zipfs"; - nativeBuildInputs = - [ - pkg-config - ] - ++ lib.optionals (lib.versionAtLeast tcl.version "9.0") [ - # Only used to detect the presence of zlib. Could be replaced with a stub. - zip - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (lib.versionAtLeast tcl.version "9.0") [ + # Only used to detect the presence of zlib. Could be replaced with a stub. + zip + ]; buildInputs = lib.optionals (lib.versionAtLeast tcl.version "9.0") [ zlib ]; diff --git a/pkgs/development/libraries/tpm2-tss/default.nix b/pkgs/development/libraries/tpm2-tss/default.nix index 1aa8f6344f59..9b65060e25af 100644 --- a/pkgs/development/libraries/tpm2-tss/default.nix +++ b/pkgs/development/libraries/tpm2-tss/default.nix @@ -54,21 +54,20 @@ stdenv.mkDerivation rec { perl ]; - buildInputs = - [ - openssl - json_c - curl - libgcrypt - uthash - libuuid - libtpms - ] - # cmocka is checked in the configure script - # when unit and/or integration testing is enabled - # cmocka doesn't build with pkgsStatic, and we don't need it anyway - # when tests are not run - ++ lib.optional doInstallCheck cmocka; + buildInputs = [ + openssl + json_c + curl + libgcrypt + uthash + libuuid + libtpms + ] + # cmocka is checked in the configure script + # when unit and/or integration testing is enabled + # cmocka doesn't build with pkgsStatic, and we don't need it anyway + # when tests are not run + ++ lib.optional doInstallCheck cmocka; nativeInstallCheckInputs = lib.optionals doInstallCheck [ cmocka @@ -101,30 +100,29 @@ stdenv.mkDerivation rec { ./no-shadow.patch ]; - postPatch = - '' - patchShebangs script - substituteInPlace src/tss2-tcti/tctildr-dl.c \ - --replace-fail '@PREFIX@' $out/lib/ - substituteInPlace ./test/unit/tctildr-dl.c \ - --replace-fail '@PREFIX@' $out/lib/ - substituteInPlace ./bootstrap \ - --replace-fail 'git describe --tags --always --dirty' 'echo "${version}"' - for src in src/tss2-tcti/tcti-libtpms.c test/unit/tcti-libtpms.c; do - substituteInPlace "$src" \ - --replace-fail '"libtpms.so"' '"${libtpms.out}/lib/libtpms.so"' \ - --replace-fail '"libtpms.so.0"' '"${libtpms.out}/lib/libtpms.so.0"' - done - '' - # tcti tests rely on mocking function calls, which appears not to be supported - # on clang - + lib.optionalString stdenv.cc.isClang '' - sed -i '/TESTS_UNIT / { - /test\/unit\/tcti-swtpm/d; - /test\/unit\/tcti-mssim/d; - /test\/unit\/tcti-device/d - }' Makefile-test.am - ''; + postPatch = '' + patchShebangs script + substituteInPlace src/tss2-tcti/tctildr-dl.c \ + --replace-fail '@PREFIX@' $out/lib/ + substituteInPlace ./test/unit/tctildr-dl.c \ + --replace-fail '@PREFIX@' $out/lib/ + substituteInPlace ./bootstrap \ + --replace-fail 'git describe --tags --always --dirty' 'echo "${version}"' + for src in src/tss2-tcti/tcti-libtpms.c test/unit/tcti-libtpms.c; do + substituteInPlace "$src" \ + --replace-fail '"libtpms.so"' '"${libtpms.out}/lib/libtpms.so"' \ + --replace-fail '"libtpms.so.0"' '"${libtpms.out}/lib/libtpms.so.0"' + done + '' + # tcti tests rely on mocking function calls, which appears not to be supported + # on clang + + lib.optionalString stdenv.cc.isClang '' + sed -i '/TESTS_UNIT / { + /test\/unit\/tcti-swtpm/d; + /test\/unit\/tcti-mssim/d; + /test\/unit\/tcti-device/d + }' Makefile-test.am + ''; configureFlags = lib.optionals doInstallCheck [ diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix index 38d0d8ff4f7f..69edb001df39 100644 --- a/pkgs/development/libraries/unixODBCDrivers/default.nix +++ b/pkgs/development/libraries/unixODBCDrivers/default.nix @@ -65,7 +65,8 @@ openssl libiconv zlib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libkrb5 ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libkrb5 ]; cmakeFlags = [ "-DWITH_EXTERNAL_ZLIB=ON" diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix index 91f39eb62472..7f73bf4eee89 100644 --- a/pkgs/development/libraries/vigra/default.nix +++ b/pkgs/development/libraries/vigra/default.nix @@ -52,15 +52,14 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs --build config/run_test.sh.in ''; - cmakeFlags = - [ - "-DWITH_OPENEXR=1" - "-DVIGRANUMPY_INSTALL_DIR=${placeholder "out"}/${python.sitePackages}" - ] - ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ - "-DCMAKE_CXX_FLAGS=-fPIC" - "-DCMAKE_C_FLAGS=-fPIC" - ]; + cmakeFlags = [ + "-DWITH_OPENEXR=1" + "-DVIGRANUMPY_INSTALL_DIR=${placeholder "out"}/${python.sitePackages}" + ] + ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ + "-DCMAKE_CXX_FLAGS=-fPIC" + "-DCMAKE_C_FLAGS=-fPIC" + ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/vtk/generic.nix b/pkgs/development/libraries/vtk/generic.nix index 60b7ae238b83..02f3606f63cd 100644 --- a/pkgs/development/libraries/vtk/generic.nix +++ b/pkgs/development/libraries/vtk/generic.nix @@ -45,26 +45,25 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; - buildInputs = - [ - libpng - libtiff - ] - ++ optionals enableQt [ - (qtEnv "qvtk-qt-env" [ - qtx11extras - qttools - qtdeclarative - ]) - ] - ++ optionals stdenv.hostPlatform.isLinux [ - libGLU - xorgproto - libXt - ] - ++ optionals enablePython [ - python - ]; + buildInputs = [ + libpng + libtiff + ] + ++ optionals enableQt [ + (qtEnv "qvtk-qt-env" [ + qtx11extras + qttools + qtdeclarative + ]) + ] + ++ optionals stdenv.hostPlatform.isLinux [ + libGLU + xorgproto + libXt + ] + ++ optionals enablePython [ + python + ]; propagatedBuildInputs = optionals stdenv.hostPlatform.isLinux [ libX11 libGL @@ -74,17 +73,16 @@ stdenv.mkDerivation { patches = map fetchpatch patchesToFetch; # GCC 13: error: 'int64_t' in namespace 'std' does not name a type - postPatch = - '' - sed '1i#include ' \ - -i ThirdParty/libproj/vtklibproj/src/proj_json_streaming_writer.hpp \ - -i IO/Image/vtkSEPReader.h - '' - + optionalString stdenv.hostPlatform.isDarwin '' - sed -i 's|COMMAND vtkHashSource|COMMAND "DYLD_LIBRARY_PATH=''${VTK_BINARY_DIR}/lib" ''${VTK_BINARY_DIR}/bin/vtkHashSource-${majorVersion}|' ./Parallel/Core/CMakeLists.txt - sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/' ./ThirdParty/libxml2/vtklibxml2/xmlschemas.c - sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c - ''; + postPatch = '' + sed '1i#include ' \ + -i ThirdParty/libproj/vtklibproj/src/proj_json_streaming_writer.hpp \ + -i IO/Image/vtkSEPReader.h + '' + + optionalString stdenv.hostPlatform.isDarwin '' + sed -i 's|COMMAND vtkHashSource|COMMAND "DYLD_LIBRARY_PATH=''${VTK_BINARY_DIR}/lib" ''${VTK_BINARY_DIR}/bin/vtkHashSource-${majorVersion}|' ./Parallel/Core/CMakeLists.txt + sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/' ./ThirdParty/libxml2/vtklibxml2/xmlschemas.c + sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c + ''; dontWrapQtApps = true; @@ -93,31 +91,30 @@ stdenv.mkDerivation { # built and requiring one of the shared objects. # At least, we use -fPIC for other packages to be able to use this in shared # objects. - cmakeFlags = - [ - "-DCMAKE_C_FLAGS=-fPIC" - "-DCMAKE_CXX_FLAGS=-fPIC" - "-DVTK_MODULE_USE_EXTERNAL_vtkpng=ON" - "-DVTK_MODULE_USE_EXTERNAL_vtktiff=1" - "-DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "-DOPENGL_INCLUDE_DIR=${lib.getInclude libGL}/include" - (lib.cmakeBool "VTK_OPENGL_HAS_EGL" enableEgl) - ] - ++ [ - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_BINDIR=bin" - "-DVTK_VERSIONED_INSTALL=OFF" - ] - ++ optionals enableQt [ - "-DVTK_GROUP_ENABLE_Qt:STRING=YES" - ] - ++ optionals enablePython [ - "-DVTK_WRAP_PYTHON:BOOL=ON" - "-DVTK_PYTHON_VERSION:STRING=${pythonMajor}" - ]; + cmakeFlags = [ + "-DCMAKE_C_FLAGS=-fPIC" + "-DCMAKE_CXX_FLAGS=-fPIC" + "-DVTK_MODULE_USE_EXTERNAL_vtkpng=ON" + "-DVTK_MODULE_USE_EXTERNAL_vtktiff=1" + "-DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "-DOPENGL_INCLUDE_DIR=${lib.getInclude libGL}/include" + (lib.cmakeBool "VTK_OPENGL_HAS_EGL" enableEgl) + ] + ++ [ + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_BINDIR=bin" + "-DVTK_VERSIONED_INSTALL=OFF" + ] + ++ optionals enableQt [ + "-DVTK_GROUP_ENABLE_Qt:STRING=YES" + ] + ++ optionals enablePython [ + "-DVTK_WRAP_PYTHON:BOOL=ON" + "-DVTK_PYTHON_VERSION:STRING=${pythonMajor}" + ]; env = { # Lots of warnings in vendored code… diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix index 7581f1e13c1b..dec83f98c701 100644 --- a/pkgs/development/libraries/wayland/default.nix +++ b/pkgs/development/libraries/wayland/default.nix @@ -46,15 +46,14 @@ stdenv.mkDerivation (finalAttrs: { sed -i '/os-wrappers-test/d' tests/meson.build ''; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals withDocumentation [ - "doc" - "man" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals withDocumentation [ + "doc" + "man" + ]; separateDebugInfo = true; mesonFlags = [ @@ -67,35 +66,33 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - meson - pkg-config - ninja - wayland-scanner - ] - ++ lib.optionals withDocumentation [ - (graphviz-nox.override { pango = null; }) # To avoid an infinite recursion - doxygen - libxslt - xmlto - python3 - docbook_xml_dtd_45 - docbook_xsl - ]; + nativeBuildInputs = [ + meson + pkg-config + ninja + wayland-scanner + ] + ++ lib.optionals withDocumentation [ + (graphviz-nox.override { pango = null; }) # To avoid an infinite recursion + doxygen + libxslt + xmlto + python3 + docbook_xml_dtd_45 + docbook_xsl + ]; - buildInputs = - [ - libffi - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - epoll-shim - ] - ++ lib.optionals withDocumentation [ - docbook_xsl - docbook_xml_dtd_45 - docbook_xml_dtd_42 - ]; + buildInputs = [ + libffi + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + epoll-shim + ] + ++ lib.optionals withDocumentation [ + docbook_xsl + docbook_xml_dtd_45 + docbook_xml_dtd_42 + ]; passthru = { tests.pkg-config = testers.hasPkgConfigModules { diff --git a/pkgs/development/libraries/wayland/scanner.nix b/pkgs/development/libraries/wayland/scanner.nix index d826901d01e6..55366ac5c16c 100644 --- a/pkgs/development/libraries/wayland/scanner.nix +++ b/pkgs/development/libraries/wayland/scanner.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation { meson pkg-config ninja - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) wayland-scanner; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) wayland-scanner; buildInputs = [ expat diff --git a/pkgs/development/libraries/waylandpp/default.nix b/pkgs/development/libraries/waylandpp/default.nix index fbb0d0dad266..002ae979eccf 100644 --- a/pkgs/development/libraries/waylandpp/default.nix +++ b/pkgs/development/libraries/waylandpp/default.nix @@ -39,28 +39,26 @@ stdenv.mkDerivation rec { }) ]; - cmakeFlags = - [ - "-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++" - ]; + cmakeFlags = [ + "-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++" + ]; # Complains about not being able to find the fontconfig config file otherwise FONTCONFIG_FILE = lib.optional docSupport (makeFontsConf { fontDirectories = [ ]; }); - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optionals docSupport [ - doxygen - graphviz - ]; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optionals docSupport [ + doxygen + graphviz + ]; buildInputs = [ pugixml wayland @@ -68,17 +66,16 @@ stdenv.mkDerivation rec { libffi ]; - outputs = - [ - "bin" - "dev" - "lib" - "out" - ] - ++ lib.optionals docSupport [ - "doc" - "devman" - ]; + outputs = [ + "bin" + "dev" + "lib" + "out" + ] + ++ lib.optionals docSupport [ + "doc" + "devman" + ]; # Resolves the warning "Fontconfig error: No writable cache directories" preBuild = '' diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix index cdba05f195ad..5638e03f187c 100644 --- a/pkgs/development/libraries/webkitgtk/default.nix +++ b/pkgs/development/libraries/webkitgtk/default.nix @@ -110,94 +110,92 @@ clangStdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - bison - cmake - gettext - gobject-introspection - gperf - ninja - perl - perl.pkgs.FileCopyRecursive # used by copy-user-interface-resources.pl - pkg-config - python3 - ruby - gi-docgen - glib # for gdbus-codegen - unifdef - ] - ++ lib.optionals clangStdenv.hostPlatform.isLinux [ - wayland-scanner - ]; + nativeBuildInputs = [ + bison + cmake + gettext + gobject-introspection + gperf + ninja + perl + perl.pkgs.FileCopyRecursive # used by copy-user-interface-resources.pl + pkg-config + python3 + ruby + gi-docgen + glib # for gdbus-codegen + unifdef + ] + ++ lib.optionals clangStdenv.hostPlatform.isLinux [ + wayland-scanner + ]; - buildInputs = - [ - at-spi2-core - cairo # required even when using skia - enchant2 - flite - libavif - libepoxy - libjxl - gnutls - gst-plugins-bad - gst-plugins-base - harfbuzz - hyphen - icu - libGL - libGLU - libgbm - libgcrypt - libgpg-error - libidn - libintl - lcms2 - libpthreadstubs - libsysprof-capture - libtasn1 - libwebp - libxkbcommon - libxml2 - libxslt - libbacktrace - nettle - p11-kit - sqlite - woff2 - ] - ++ lib.optionals clangStdenv.hostPlatform.isBigEndian [ - # https://bugs.webkit.org/show_bug.cgi?id=274032 - fontconfig - freetype - ] - ++ lib.optionals clangStdenv.hostPlatform.isDarwin [ - libedit - readline - ] - ++ lib.optionals clangStdenv.hostPlatform.isLinux [ - libseccomp - libmanette - wayland - xorg.libX11 - ] - ++ lib.optionals systemdSupport [ - systemd - ] - ++ lib.optionals enableGeoLocation [ - geoclue2 - ] - ++ lib.optionals enableExperimental [ - # For ENABLE_WEB_RTC - openssl - ] - ++ lib.optionals withLibsecret [ - libsecret - ] - ++ lib.optionals (lib.versionAtLeast gtk3.version "4.0") [ - wayland-protocols - ]; + buildInputs = [ + at-spi2-core + cairo # required even when using skia + enchant2 + flite + libavif + libepoxy + libjxl + gnutls + gst-plugins-bad + gst-plugins-base + harfbuzz + hyphen + icu + libGL + libGLU + libgbm + libgcrypt + libgpg-error + libidn + libintl + lcms2 + libpthreadstubs + libsysprof-capture + libtasn1 + libwebp + libxkbcommon + libxml2 + libxslt + libbacktrace + nettle + p11-kit + sqlite + woff2 + ] + ++ lib.optionals clangStdenv.hostPlatform.isBigEndian [ + # https://bugs.webkit.org/show_bug.cgi?id=274032 + fontconfig + freetype + ] + ++ lib.optionals clangStdenv.hostPlatform.isDarwin [ + libedit + readline + ] + ++ lib.optionals clangStdenv.hostPlatform.isLinux [ + libseccomp + libmanette + wayland + xorg.libX11 + ] + ++ lib.optionals systemdSupport [ + systemd + ] + ++ lib.optionals enableGeoLocation [ + geoclue2 + ] + ++ lib.optionals enableExperimental [ + # For ENABLE_WEB_RTC + openssl + ] + ++ lib.optionals withLibsecret [ + libsecret + ] + ++ lib.optionals (lib.versionAtLeast gtk3.version "4.0") [ + wayland-protocols + ]; propagatedBuildInputs = [ gtk3 diff --git a/pkgs/development/libraries/wlroots/default.nix b/pkgs/development/libraries/wlroots/default.nix index 639d0c9b9666..279daed5bc19 100644 --- a/pkgs/development/libraries/wlroots/default.nix +++ b/pkgs/development/libraries/wlroots/default.nix @@ -72,30 +72,30 @@ let wayland-scanner glslang hwdata - ] ++ extraNativeBuildInputs; + ] + ++ extraNativeBuildInputs; - buildInputs = - [ - libliftoff - libdisplay-info - libGL - libcap - libinput - libxkbcommon - libgbm - pixman - seatd - vulkan-loader - wayland - wayland-protocols - xorg.libX11 - xorg.xcbutilerrors - xorg.xcbutilimage - xorg.xcbutilrenderutil - xorg.xcbutilwm - ] - ++ lib.optional finalAttrs.enableXWayland xwayland - ++ extraBuildInputs; + buildInputs = [ + libliftoff + libdisplay-info + libGL + libcap + libinput + libxkbcommon + libgbm + pixman + seatd + vulkan-loader + wayland + wayland-protocols + xorg.libX11 + xorg.xcbutilerrors + xorg.xcbutilimage + xorg.xcbutilrenderutil + xorg.xcbutilwm + ] + ++ lib.optional finalAttrs.enableXWayland xwayland + ++ extraBuildInputs; mesonFlags = lib.optional (!finalAttrs.enableXWayland) "-Dxwayland=disabled"; diff --git a/pkgs/development/libraries/wt/default.nix b/pkgs/development/libraries/wt/default.nix index 58fa61e9dd20..e88e45afdbf3 100644 --- a/pkgs/development/libraries/wt/default.nix +++ b/pkgs/development/libraries/wt/default.nix @@ -58,16 +58,15 @@ let ]; dontWrapQtApps = true; - cmakeFlags = - [ - "-DWT_CPP_11_MODE=-std=c++11" - "--no-warn-unused-cli" - ] - ++ lib.optionals (graphicsmagick != null) [ - "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick" - "-DGM_PREFIX=${graphicsmagick}" - ] - ++ lib.optional (libmysqlclient != null) "-DMYSQL_PREFIX=${libmysqlclient}"; + cmakeFlags = [ + "-DWT_CPP_11_MODE=-std=c++11" + "--no-warn-unused-cli" + ] + ++ lib.optionals (graphicsmagick != null) [ + "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick" + "-DGM_PREFIX=${graphicsmagick}" + ] + ++ lib.optional (libmysqlclient != null) "-DMYSQL_PREFIX=${libmysqlclient}"; meta = with lib; { homepage = "https://www.webtoolkit.eu/wt"; diff --git a/pkgs/development/libraries/xapian/default.nix b/pkgs/development/libraries/xapian/default.nix index cc6d0f9b21d4..a806db202fa3 100644 --- a/pkgs/development/libraries/xapian/default.nix +++ b/pkgs/development/libraries/xapian/default.nix @@ -42,13 +42,12 @@ let doCheck = true; - env = - { - AUTOMATED_TESTING = true; # https://trac.xapian.org/changeset/8be35f5e1/git - } - // lib.optionalAttrs stdenv.hostPlatform.is32bit { - NIX_CFLAGS_COMPILE = "-fpermissive"; - }; + env = { + AUTOMATED_TESTING = true; # https://trac.xapian.org/changeset/8be35f5e1/git + } + // lib.optionalAttrs stdenv.hostPlatform.is32bit { + NIX_CFLAGS_COMPILE = "-fpermissive"; + }; # the configure script thinks that Darwin has ___exp10 # but it’s not available on my systems (or hydra apparently) diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix index 4313ac5e84fc..e10756567ff0 100644 --- a/pkgs/development/libraries/xdg-desktop-portal/default.nix +++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix @@ -81,29 +81,28 @@ stdenv.mkDerivation (finalAttrs: { wrapGAppsNoGuiHook ]; - buildInputs = - [ - flatpak - fuse3 - bubblewrap - glib - gsettings-desktop-schemas - json-glib - pipewire - gst_all_1.gst-plugins-base - libgudev + buildInputs = [ + flatpak + fuse3 + bubblewrap + glib + gsettings-desktop-schemas + json-glib + pipewire + gst_all_1.gst-plugins-base + libgudev - # For icon validator - gdk-pixbuf - librsvg - bash - ] - ++ lib.optionals enableGeoLocation [ - geoclue2 - ] - ++ lib.optionals enableSystemd [ - systemdMinimal # libsystemd - ]; + # For icon validator + gdk-pixbuf + librsvg + bash + ] + ++ lib.optionals enableGeoLocation [ + geoclue2 + ] + ++ lib.optionals enableSystemd [ + systemdMinimal # libsystemd + ]; nativeCheckInputs = [ dbus @@ -126,20 +125,19 @@ stdenv.mkDerivation (finalAttrs: { checkInputs = [ umockdev ]; - mesonFlags = - [ - "--sysconfdir=/etc" - "-Dinstalled-tests=true" - "-Dinstalled_test_prefix=${placeholder "installedTests"}" - "-Ddocumentation=disabled" # pulls in a whole lot of extra stuff - (lib.mesonEnable "systemd" enableSystemd) - ] - ++ lib.optionals (!enableGeoLocation) [ - "-Dgeoclue=disabled" - ] - ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [ - "-Dtests=disabled" - ]; + mesonFlags = [ + "--sysconfdir=/etc" + "-Dinstalled-tests=true" + "-Dinstalled_test_prefix=${placeholder "installedTests"}" + "-Ddocumentation=disabled" # pulls in a whole lot of extra stuff + (lib.mesonEnable "systemd" enableSystemd) + ] + ++ lib.optionals (!enableGeoLocation) [ + "-Dgeoclue=disabled" + ] + ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [ + "-Dtests=disabled" + ]; strictDeps = true; diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index e67d91224678..c0aafbb9fbc1 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -54,7 +54,8 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" - ] ++ lib.optional splitStaticOutput "static"; + ] + ++ lib.optional splitStaticOutput "static"; setOutputFlags = false; outputDoc = "dev"; # single tiny man3 page @@ -134,19 +135,18 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; doCheck = true; - makeFlags = - [ - "PREFIX=${stdenv.cc.targetPrefix}" - ] - ++ lib.optionals stdenv.hostPlatform.isMinGW [ - "-f" - "win32/Makefile.gcc" - ] - ++ lib.optionals shared [ - # Note that as of writing (zlib 1.2.11), this flag only has an effect - # for Windows as it is specific to `win32/Makefile.gcc`. - "SHARED_MODE=1" - ]; + makeFlags = [ + "PREFIX=${stdenv.cc.targetPrefix}" + ] + ++ lib.optionals stdenv.hostPlatform.isMinGW [ + "-f" + "win32/Makefile.gcc" + ] + ++ lib.optionals shared [ + # Note that as of writing (zlib 1.2.11), this flag only has an effect + # for Windows as it is specific to `win32/Makefile.gcc`. + "SHARED_MODE=1" + ]; passthru.tests = { pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; diff --git a/pkgs/development/lisp-modules/packages.nix b/pkgs/development/lisp-modules/packages.nix index 9acb067effaf..841da5006a4f 100644 --- a/pkgs/development/lisp-modules/packages.nix +++ b/pkgs/development/lisp-modules/packages.nix @@ -266,12 +266,10 @@ let #+sb-core-compression t :toplevel #'clfswm:main) ''; - installPhase = - o.installPhase - + '' - mkdir -p $out/bin - mv $out/clfswm $out/bin - ''; + installPhase = o.installPhase + '' + mkdir -p $out/bin + mv $out/clfswm $out/bin + ''; }); magicl = build-with-compile-into-pwd { diff --git a/pkgs/development/lua-modules/generic/default.nix b/pkgs/development/lua-modules/generic/default.nix index 0a3275e49bdc..2d49ffe32083 100644 --- a/pkgs/development/lua-modules/generic/default.nix +++ b/pkgs/development/lua-modules/generic/default.nix @@ -21,7 +21,8 @@ toLuaModule ( "LUA_INC=-I${lua}/include" "LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}" "LUA_VERSION=${lua.luaversion}" - ] ++ makeFlags; + ] + ++ makeFlags; propagatedBuildInputs = propagatedBuildInputs ++ [ lua # propagate it for its setup-hook diff --git a/pkgs/development/lua-modules/luv/default.nix b/pkgs/development/lua-modules/luv/default.nix index c4512bc039cf..85e027d40374 100644 --- a/pkgs/development/lua-modules/luv/default.nix +++ b/pkgs/development/lua-modules/luv/default.nix @@ -29,17 +29,16 @@ buildLuarocksPackage rec { rm -rf deps/lua deps/luajit deps/libuv ''; - patches = - [ - # Fails with "Uncaught Error: ./tests/test-dns.lua:164: assertion failed!" - # and "./tests/test-tty.lua:19: bad argument #1 to 'is_readable' (Expected - # uv_stream userdata)" - ./disable-failing-tests.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fails with "Uncaught Error: ./tests/test-udp.lua:261: EHOSTUNREACH" - ./disable-failing-darwin-tests.patch - ]; + patches = [ + # Fails with "Uncaught Error: ./tests/test-dns.lua:164: assertion failed!" + # and "./tests/test-tty.lua:19: bad argument #1 to 'is_readable' (Expected + # uv_stream userdata)" + ./disable-failing-tests.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fails with "Uncaught Error: ./tests/test-udp.lua:261: EHOSTUNREACH" + ./disable-failing-darwin-tests.patch + ]; buildInputs = [ libuv ]; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/lua-modules/luv/lib.nix b/pkgs/development/lua-modules/luv/lib.nix index f1be88c0d6d4..e1d0791ffe7c 100644 --- a/pkgs/development/lua-modules/luv/lib.nix +++ b/pkgs/development/lua-modules/luv/lib.nix @@ -32,5 +32,6 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; } diff --git a/pkgs/development/misc/msp430/mspdebug.nix b/pkgs/development/misc/msp430/mspdebug.nix index 94df290fec08..c9ac04f9e7a5 100644 --- a/pkgs/development/misc/msp430/mspdebug.nix +++ b/pkgs/development/misc/msp430/mspdebug.nix @@ -30,10 +30,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin pkg-config ++ lib.optional (enableMspds && stdenv.hostPlatform.isLinux) autoPatchelfHook; - buildInputs = - [ libusb-compat-0_1 ] - ++ lib.optional stdenv.hostPlatform.isDarwin hidapi - ++ lib.optional enableReadline readline; + buildInputs = [ + libusb-compat-0_1 + ] + ++ lib.optional stdenv.hostPlatform.isDarwin hidapi + ++ lib.optional enableReadline readline; postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' # TODO: remove once a new 0.26+ release is made diff --git a/pkgs/development/misc/msp430/mspds/default.nix b/pkgs/development/misc/msp430/mspds/default.nix index d1fb0339ce33..fef2e5a64dec 100644 --- a/pkgs/development/misc/msp430/mspds/default.nix +++ b/pkgs/development/misc/msp430/mspds/default.nix @@ -39,14 +39,13 @@ stdenv.mkDerivation { patches = [ ./bsl430.patch ]; - preBuild = - '' - rm ThirdParty/src/pugixml.cpp - rm ThirdParty/include/pugi{config,xml}.hpp - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - makeFlagsArray+=(OUTNAME="-install_name ") - ''; + preBuild = '' + rm ThirdParty/src/pugixml.cpp + rm ThirdParty/include/pugi{config,xml}.hpp + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + makeFlagsArray+=(OUTNAME="-install_name ") + ''; installPhase = '' install -Dm0755 -t $out/lib $libName @@ -58,7 +57,8 @@ stdenv.mkDerivation { boost hidapi pugixml - ] ++ lib.optional stdenv.hostPlatform.isLinux libusb1; + ] + ++ lib.optional stdenv.hostPlatform.isLinux libusb1; meta = with lib; { description = "TI MSP430 FET debug driver"; diff --git a/pkgs/development/misc/newlib/default.nix b/pkgs/development/misc/newlib/default.nix index 50d41e21e31c..b09ffb076886 100644 --- a/pkgs/development/misc/newlib/default.nix +++ b/pkgs/development/misc/newlib/default.nix @@ -20,22 +20,21 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-M/EmBeAFSWWZbCXBOCs+RjsK+ReZAB9buMBjDy7IyFI="; }; - patches = - [ - (fetchpatch { - name = "0001-newlib-Fix-mips-libgloss-support.patch"; - url = "https://sourceware.org/git/?p=newlib-cygwin.git;a=patch;h=8a8fb570d7c5310a03a34b3dd6f9f8bb35ee9f40"; - hash = "sha256-hWS/X0jf/ZFXIR39NvNDVhkR8F81k9UWpsqDhZFxO5o="; - }) - ] - ++ lib.optionals nanoizeNewlib [ - # https://bugs.gentoo.org/723756 - (fetchpatch { - name = "newlib-3.3.0-no-nano-cxx.patch"; - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-libs/newlib/files/newlib-3.3.0-no-nano-cxx.patch?id=9ee5a1cd6f8da6d084b93b3dbd2e8022a147cfbf"; - sha256 = "sha256-S3mf7vwrzSMWZIGE+d61UDH+/SK/ao1hTPee1sElgco="; - }) - ]; + patches = [ + (fetchpatch { + name = "0001-newlib-Fix-mips-libgloss-support.patch"; + url = "https://sourceware.org/git/?p=newlib-cygwin.git;a=patch;h=8a8fb570d7c5310a03a34b3dd6f9f8bb35ee9f40"; + hash = "sha256-hWS/X0jf/ZFXIR39NvNDVhkR8F81k9UWpsqDhZFxO5o="; + }) + ] + ++ lib.optionals nanoizeNewlib [ + # https://bugs.gentoo.org/723756 + (fetchpatch { + name = "newlib-3.3.0-no-nano-cxx.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-libs/newlib/files/newlib-3.3.0-no-nano-cxx.patch?id=9ee5a1cd6f8da6d084b93b3dbd2e8022a147cfbf"; + sha256 = "sha256-S3mf7vwrzSMWZIGE+d61UDH+/SK/ao1hTPee1sElgco="; + }) + ]; depsBuildBuild = [ buildPackages.stdenv.cc @@ -43,22 +42,21 @@ stdenv.mkDerivation (finalAttrs: { ]; # newlib expects CC to build for build platform, not host platform - preConfigure = + preConfigure = '' + export CC=cc + '' + + + # newlib tries to disable itself when building for Linux *except* + # when native-compiling. Unfortunately the check for "is cross + # compiling" was written when newlib was part of GCC and newlib + # was built along with GCC (therefore newlib was built to execute + # on the targetPlatform, not the hostPlatform). Unfortunately + # when newlib was extracted from GCC, this "is cross compiling" + # logic was not fixed. So we must disable it. '' - export CC=cc - '' - + - # newlib tries to disable itself when building for Linux *except* - # when native-compiling. Unfortunately the check for "is cross - # compiling" was written when newlib was part of GCC and newlib - # was built along with GCC (therefore newlib was built to execute - # on the targetPlatform, not the hostPlatform). Unfortunately - # when newlib was extracted from GCC, this "is cross compiling" - # logic was not fixed. So we must disable it. - '' - substituteInPlace configure --replace 'noconfigdirs target-newlib target-libgloss' 'noconfigdirs' - substituteInPlace configure --replace 'cross_only="target-libgloss target-newlib' 'cross_only="' - ''; + substituteInPlace configure --replace 'noconfigdirs target-newlib target-libgloss' 'noconfigdirs' + substituteInPlace configure --replace 'cross_only="target-libgloss target-newlib' 'cross_only="' + ''; configurePlatforms = [ "build" @@ -66,50 +64,49 @@ stdenv.mkDerivation (finalAttrs: { ]; # flags copied from https://community.arm.com/support-forums/f/compilers-and-libraries-forum/53310/gcc-arm-none-eabi-what-were-the-newlib-compilation-options # sort alphabetically - configureFlags = - [ - "--with-newlib" + configureFlags = [ + "--with-newlib" - # The newlib configury uses `host` to refer to the platform - # which is being used to compile newlib. Ugh. It does this - # because of its history: newlib used to be distributed with and - # built as part of gcc. - # - # To prevent nixpkgs from going insane, this package presents the - # "normal" view to the outside world: the binaries in $out will - # execute on `stdenv.hostPlatform`. We then fool newlib's build - # process into doing the right thing. - "--host=${stdenv.targetPlatform.config}" + # The newlib configury uses `host` to refer to the platform + # which is being used to compile newlib. Ugh. It does this + # because of its history: newlib used to be distributed with and + # built as part of gcc. + # + # To prevent nixpkgs from going insane, this package presents the + # "normal" view to the outside world: the binaries in $out will + # execute on `stdenv.hostPlatform`. We then fool newlib's build + # process into doing the right thing. + "--host=${stdenv.targetPlatform.config}" - ] - ++ ( - if !nanoizeNewlib then - [ - "--disable-newlib-supplied-syscalls" - "--disable-nls" - "--enable-newlib-io-c99-formats" - "--enable-newlib-io-long-long" - "--enable-newlib-reent-check-verify" - "--enable-newlib-register-fini" - "--enable-newlib-retargetable-locking" - ] - else - [ - "--disable-newlib-fseek-optimization" - "--disable-newlib-fvwrite-in-streamio" - "--disable-newlib-supplied-syscalls" - "--disable-newlib-unbuf-stream-opt" - "--disable-newlib-wide-orient" - "--disable-nls" - "--enable-lite-exit" - "--enable-newlib-global-atexit" - "--enable-newlib-nano-formatted-io" - "--enable-newlib-nano-malloc" - "--enable-newlib-reent-check-verify" - "--enable-newlib-reent-small" - "--enable-newlib-retargetable-locking" - ] - ); + ] + ++ ( + if !nanoizeNewlib then + [ + "--disable-newlib-supplied-syscalls" + "--disable-nls" + "--enable-newlib-io-c99-formats" + "--enable-newlib-io-long-long" + "--enable-newlib-reent-check-verify" + "--enable-newlib-register-fini" + "--enable-newlib-retargetable-locking" + ] + else + [ + "--disable-newlib-fseek-optimization" + "--disable-newlib-fvwrite-in-streamio" + "--disable-newlib-supplied-syscalls" + "--disable-newlib-unbuf-stream-opt" + "--disable-newlib-wide-orient" + "--disable-nls" + "--enable-lite-exit" + "--enable-newlib-global-atexit" + "--enable-newlib-nano-formatted-io" + "--enable-newlib-nano-malloc" + "--enable-newlib-reent-check-verify" + "--enable-newlib-reent-small" + "--enable-newlib-retargetable-locking" + ] + ); enableParallelBuilding = true; dontDisableStatic = true; diff --git a/pkgs/development/misc/resholve/resholve-utils.nix b/pkgs/development/misc/resholve/resholve-utils.nix index 761e231babd6..141d6bb79b47 100644 --- a/pkgs/development/misc/resholve/resholve-utils.nix +++ b/pkgs/development/misc/resholve/resholve-utils.nix @@ -189,22 +189,21 @@ rec { writeTextFile { inherit name text; executable = true; - checkPhase = - '' - ${ - (phraseContextForPWD ( - phraseInvocation name ( - partialSolution - // { - scripts = [ "${placeholder "out"}" ]; - } - ) - )) - } - '' - + lib.optionalString (partialSolution.interpreter != "none") '' - ${partialSolution.interpreter} -n $out - ''; + checkPhase = '' + ${ + (phraseContextForPWD ( + phraseInvocation name ( + partialSolution + // { + scripts = [ "${placeholder "out"}" ]; + } + ) + )) + } + '' + + lib.optionalString (partialSolution.interpreter != "none") '' + ${partialSolution.interpreter} -n $out + ''; }; writeScriptBin = name: partialSolution: text: @@ -212,20 +211,19 @@ rec { inherit name text; executable = true; destination = "/bin/${name}"; - checkPhase = - '' - ${phraseContextForOut ( - phraseInvocation name ( - partialSolution - // { - scripts = [ "bin/${name}" ]; - } - ) - )} - '' - + lib.optionalString (partialSolution.interpreter != "none") '' - ${partialSolution.interpreter} -n $out/bin/${name} - ''; + checkPhase = '' + ${phraseContextForOut ( + phraseInvocation name ( + partialSolution + // { + scripts = [ "bin/${name}" ]; + } + ) + )} + '' + + lib.optionalString (partialSolution.interpreter != "none") '' + ${partialSolution.interpreter} -n $out/bin/${name} + ''; }; mkDerivation = { diff --git a/pkgs/development/misc/resholve/test.nix b/pkgs/development/misc/resholve/test.nix index 73c2042415d7..f97ab53efb12 100644 --- a/pkgs/development/misc/resholve/test.nix +++ b/pkgs/development/misc/resholve/test.nix @@ -218,27 +218,26 @@ rec { # explicit interpreter for demo suite; maybe some better way... INTERP = "${bash}/bin/bash"; - checkPhase = - '' - patchShebangs . - mkdir empty_lore - touch empty_lore/{execers,wrappers} - export EMPTY_LORE=$PWD/empty_lore - printf "\033[33m============================= resholve test suite ===================================\033[0m\n" > test.ansi - if ./test.sh &>> test.ansi; then - cat test.ansi - else - cat test.ansi && exit 1 - fi - '' - + lib.optionalString runDemo '' - printf "\033[33m============================= resholve demo ===================================\033[0m\n" > demo.ansi - if ./demo &>> demo.ansi; then - cat demo.ansi - else - cat demo.ansi && exit 1 - fi - ''; + checkPhase = '' + patchShebangs . + mkdir empty_lore + touch empty_lore/{execers,wrappers} + export EMPTY_LORE=$PWD/empty_lore + printf "\033[33m============================= resholve test suite ===================================\033[0m\n" > test.ansi + if ./test.sh &>> test.ansi; then + cat test.ansi + else + cat test.ansi && exit 1 + fi + '' + + lib.optionalString runDemo '' + printf "\033[33m============================= resholve demo ===================================\033[0m\n" > demo.ansi + if ./demo &>> demo.ansi; then + cat demo.ansi + else + cat demo.ansi && exit 1 + fi + ''; }; # Caution: ci.nix asserts the equality of both of these w/ diff @@ -276,22 +275,21 @@ rec { loreOverrides = resholve.writeScriptBin "verify-overrides" { - inputs = - [ - coreutils - esh - getconf - libarchive - locale - mount - ncurses - procps - ps - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - nixos-install-tools - nixos-rebuild - ]; + inputs = [ + coreutils + esh + getconf + libarchive + locale + mount + ncurses + procps + ps + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + nixos-install-tools + nixos-rebuild + ]; interpreter = "none"; execer = [ "cannot:${esh}/bin/esh" diff --git a/pkgs/development/mobile/androidenv/build-tools.nix b/pkgs/development/mobile/androidenv/build-tools.nix index ccbf6b855137..85fcefa1299a 100644 --- a/pkgs/development/mobile/androidenv/build-tools.nix +++ b/pkgs/development/mobile/androidenv/build-tools.nix @@ -31,25 +31,24 @@ deployAndroidPackage { ncurses5 ] ); - patchInstructions = - '' - ${lib.optionalString (os == "linux") '' - addAutoPatchelfSearchPath $packageBaseDir/lib - if [[ -d $packageBaseDir/lib64 ]]; then - addAutoPatchelfSearchPath $packageBaseDir/lib64 - autoPatchelf --no-recurse $packageBaseDir/lib64 - fi - autoPatchelf --no-recurse $packageBaseDir - ''} + patchInstructions = '' + ${lib.optionalString (os == "linux") '' + addAutoPatchelfSearchPath $packageBaseDir/lib + if [[ -d $packageBaseDir/lib64 ]]; then + addAutoPatchelfSearchPath $packageBaseDir/lib64 + autoPatchelf --no-recurse $packageBaseDir/lib64 + fi + autoPatchelf --no-recurse $packageBaseDir + ''} - ${lib.optionalString (lib.toInt (lib.versions.major package.revision) < 33) '' - wrapProgram $PWD/mainDexClasses \ - --prefix PATH : ${pkgs.jdk8}/bin - ''} + ${lib.optionalString (lib.toInt (lib.versions.major package.revision) < 33) '' + wrapProgram $PWD/mainDexClasses \ + --prefix PATH : ${pkgs.jdk8}/bin + ''} - cd $out/libexec/android-sdk - '' - + postInstall; + cd $out/libexec/android-sdk + '' + + postInstall; noAuditTmpdir = true; # The checker script gets confused by the build-tools path that is incorrectly identified as a reference to /build inherit meta; diff --git a/pkgs/development/mobile/androidenv/cmdline-tools.nix b/pkgs/development/mobile/androidenv/cmdline-tools.nix index adb1dcba94bd..3b561c64452b 100644 --- a/pkgs/development/mobile/androidenv/cmdline-tools.nix +++ b/pkgs/development/mobile/androidenv/cmdline-tools.nix @@ -17,7 +17,8 @@ deployAndroidPackage { inherit package os arch; nativeBuildInputs = [ makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; patchInstructions = '' ${lib.optionalString (os == "linux") '' diff --git a/pkgs/development/mobile/androidenv/deploy-androidpackages.nix b/pkgs/development/mobile/androidenv/deploy-androidpackages.nix index 1a4e8b9fb780..21d30bc45e84 100644 --- a/pkgs/development/mobile/androidenv/deploy-androidpackages.nix +++ b/pkgs/development/mobile/androidenv/deploy-androidpackages.nix @@ -116,38 +116,37 @@ stdenv.mkDerivation ( runHook postUnpack ''; - installPhase = - '' - runHook preInstall - '' - + lib.concatStrings ( - lib.imap0 (i: package: '' - cd $buildDir/extractedzip-${toString i} + installPhase = '' + runHook preInstall + '' + + lib.concatStrings ( + lib.imap0 (i: package: '' + cd $buildDir/extractedzip-${toString i} - # Most Android Zip packages have a root folder, but some don't. We unpack - # the zip file in a folder and we try to discover whether it has a single root - # folder. If this is the case, we adjust the current working folder. - if [ "$(find . -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq 1 ]; then - cd "$(find . -mindepth 1 -maxdepth 1 -type d)" - fi - extractedZip="$PWD" + # Most Android Zip packages have a root folder, but some don't. We unpack + # the zip file in a folder and we try to discover whether it has a single root + # folder. If this is the case, we adjust the current working folder. + if [ "$(find . -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq 1 ]; then + cd "$(find . -mindepth 1 -maxdepth 1 -type d)" + fi + extractedZip="$PWD" - packageBaseDir=$out/libexec/android-sdk/${package.path} - mkdir -p $packageBaseDir - cd $packageBaseDir - cp -a $extractedZip/* . - ${patchesInstructions.${package.name}} + packageBaseDir=$out/libexec/android-sdk/${package.path} + mkdir -p $packageBaseDir + cd $packageBaseDir + cp -a $extractedZip/* . + ${patchesInstructions.${package.name}} - if [ ! -f $packageBaseDir/package.xml ]; then - cat << EOF > $packageBaseDir/package.xml - ${mkXmlPackage package} - EOF - fi - '') packages - ) - + '' - runHook postInstall - ''; + if [ ! -f $packageBaseDir/package.xml ]; then + cat << EOF > $packageBaseDir/package.xml + ${mkXmlPackage package} + EOF + fi + '') packages + ) + + '' + runHook postInstall + ''; # Some executables that have been patched with patchelf may not work any longer after they have been stripped. dontStrip = true; diff --git a/pkgs/development/mobile/androidenv/emulate-app.nix b/pkgs/development/mobile/androidenv/emulate-app.nix index 2e9b83854a8a..9b52a3ff0940 100644 --- a/pkgs/development/mobile/androidenv/emulate-app.nix +++ b/pkgs/development/mobile/androidenv/emulate-app.nix @@ -33,18 +33,17 @@ }: let - sdkArgs = - { - includeEmulator = true; - includeSystemImages = true; - } - // sdkExtraArgs - // { - cmdLineToolsVersion = "8.0"; - platformVersions = [ platformVersion ]; - systemImageTypes = [ systemImageType ]; - abiVersions = [ abiVersion ]; - }; + sdkArgs = { + includeEmulator = true; + includeSystemImages = true; + } + // sdkExtraArgs + // { + cmdLineToolsVersion = "8.0"; + platformVersions = [ platformVersion ]; + systemImageTypes = [ systemImageType ]; + abiVersions = [ abiVersion ]; + }; sdk = (composeAndroidPackages sdkArgs).androidsdk; in diff --git a/pkgs/development/mobile/androidenv/examples/shell.nix b/pkgs/development/mobile/androidenv/examples/shell.nix index 423753cae366..ff745ec1d20d 100644 --- a/pkgs/development/mobile/androidenv/examples/shell.nix +++ b/pkgs/development/mobile/androidenv/examples/shell.nix @@ -83,13 +83,12 @@ let }; */ - includeExtras = - [ - "extras;google;gcm" - ] - ++ pkgs.lib.optionals includeAuto [ - "extras;google;auto" - ]; + includeExtras = [ + "extras;google;gcm" + ] + ++ pkgs.lib.optionals includeAuto [ + "extras;google;auto" + ]; # Accepting more licenses declaratively: extraLicenses = [ diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix index ba1d9ea3e81b..e9cd377af2d8 100644 --- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix +++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix @@ -35,7 +35,8 @@ deployAndroidPackage rec { inherit package os arch; nativeBuildInputs = [ makeWrapper - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; autoPatchelfIgnoreMissingDeps = [ "*" ]; buildInputs = lib.optionals (os == "linux") [ pkgs.zlib diff --git a/pkgs/development/node-packages/node-env.nix b/pkgs/development/node-packages/node-env.nix index 4154ce72634c..de1a02ab7f70 100644 --- a/pkgs/development/node-packages/node-env.nix +++ b/pkgs/development/node-packages/node-env.nix @@ -541,15 +541,14 @@ let stdenv.mkDerivation ( { name = "${name}${if version == null then "" else "-${version}"}"; - buildInputs = - [ - tarWrapper - python - nodejs - ] - ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux - ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool - ++ buildInputs; + buildInputs = [ + tarWrapper + python + nodejs + ] + ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux + ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool + ++ buildInputs; inherit nodejs; @@ -627,7 +626,8 @@ let meta = { # default to Node.js' platforms platforms = nodejs.meta.platforms; - } // meta; + } + // meta; } // extraArgs ); @@ -663,15 +663,14 @@ let { name = "node-dependencies-${name}${if version == null then "" else "-${version}"}"; - buildInputs = - [ - tarWrapper - python - nodejs - ] - ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux - ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool - ++ buildInputs; + buildInputs = [ + tarWrapper + python + nodejs + ] + ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux + ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool + ++ buildInputs; inherit dontStrip; # Stripping may fail a build for some package deployments inherit dontNpmInstall unpackPhase buildPhase; @@ -764,13 +763,12 @@ let { name = "node-shell-${name}${if version == null then "" else "-${version}"}"; - buildInputs = - [ - python - nodejs - ] - ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux - ++ buildInputs; + buildInputs = [ + python + nodejs + ] + ++ lib.optional (stdenv.hostPlatform.isLinux) pkgs.util-linux + ++ buildInputs; buildCommand = '' mkdir -p $out/bin cat > $out/bin/shell <) exited unexpectedly - "CheckpointTest" - # TypeError: unsupported operand type(s) for /: 'NoneType' and 'int' (it seems cpuinfo doesn't work here) - "test_mpi_multicpu_config_cmd" - ] - ++ lib.optionals (!config.cudaSupport) [ - # requires ptxas from cudatoolkit, which is unfree - "test_dynamo_extract_model" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: 'accelerate-launch /nix/store/a7vhm7b74a7bmxc35j26s9iy1zfaqjs... - "test_accelerate_test" - "test_init_trackers" - "test_init_trackers" - "test_log" - "test_log_with_tensor" + # set the environment variable, CC, which conflicts with standard environment + "test_patch_environment_key_exists" + ] + ++ lib.optionals ((pythonAtLeast "3.13") || (torch.rocmSupport or false)) [ + # RuntimeError: Dynamo is not supported on Python 3.13+ + # OR torch.compile tests broken on torch 2.5 + rocm + "test_can_unwrap_distributed_compiled_model_keep_torch_compile" + "test_can_unwrap_distributed_compiled_model_remove_torch_compile" + "test_convert_to_fp32" + "test_send_to_device_compiles" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # usual aarch64-linux RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly + "CheckpointTest" + # TypeError: unsupported operand type(s) for /: 'NoneType' and 'int' (it seems cpuinfo doesn't work here) + "test_mpi_multicpu_config_cmd" + ] + ++ lib.optionals (!config.cudaSupport) [ + # requires ptxas from cudatoolkit, which is unfree + "test_dynamo_extract_model" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: 'accelerate-launch /nix/store/a7vhm7b74a7bmxc35j26s9iy1zfaqjs... + "test_accelerate_test" + "test_init_trackers" + "test_init_trackers" + "test_log" + "test_log_with_tensor" - # After enabling MPS in pytorch, these tests started failing - "test_accelerated_optimizer_step_was_skipped" - "test_auto_wrap_policy" - "test_autocast_kwargs" - "test_automatic_loading" - "test_backward_prefetch" - "test_can_resume_training" - "test_can_resume_training_checkpoints_relative_path" - "test_can_resume_training_with_folder" - "test_can_unwrap_model_fp16" - "test_checkpoint_deletion" - "test_cpu_offload" - "test_cpu_ram_efficient_loading" - "test_grad_scaler_kwargs" - "test_invalid_registration" - "test_map_location" - "test_mixed_precision" - "test_mixed_precision_buffer_autocast_override" - "test_project_dir" - "test_project_dir_with_config" - "test_sharding_strategy" - "test_state_dict_type" - "test_with_save_limit" - "test_with_scheduler" + # After enabling MPS in pytorch, these tests started failing + "test_accelerated_optimizer_step_was_skipped" + "test_auto_wrap_policy" + "test_autocast_kwargs" + "test_automatic_loading" + "test_backward_prefetch" + "test_can_resume_training" + "test_can_resume_training_checkpoints_relative_path" + "test_can_resume_training_with_folder" + "test_can_unwrap_model_fp16" + "test_checkpoint_deletion" + "test_cpu_offload" + "test_cpu_ram_efficient_loading" + "test_grad_scaler_kwargs" + "test_invalid_registration" + "test_map_location" + "test_mixed_precision" + "test_mixed_precision_buffer_autocast_override" + "test_project_dir" + "test_project_dir_with_config" + "test_sharding_strategy" + "test_state_dict_type" + "test_with_save_limit" + "test_with_scheduler" - # torch._inductor.exc.InductorError: TypeError: cannot determine truth value of Relational - "test_regional_compilation_cold_start" - "test_regional_compilation_inference_speedup" + # torch._inductor.exc.InductorError: TypeError: cannot determine truth value of Relational + "test_regional_compilation_cold_start" + "test_regional_compilation_inference_speedup" - # Fails in nixpkgs-review due to a port conflict with simultaneous python builds - "test_config_compatibility" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # RuntimeError: torch_shm_manager: execl failed: Permission denied - "CheckpointTest" - ]; + # Fails in nixpkgs-review due to a port conflict with simultaneous python builds + "test_config_compatibility" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # RuntimeError: torch_shm_manager: execl failed: Permission denied + "CheckpointTest" + ]; disabledTestPaths = lib.optionals (!(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64)) [ # numerous instances of torch.multiprocessing.spawn.ProcessRaisedException: diff --git a/pkgs/development/python-modules/accupy/default.nix b/pkgs/development/python-modules/accupy/default.nix index 35d39fed9a6f..abe10fb8b09f 100644 --- a/pkgs/development/python-modules/accupy/default.nix +++ b/pkgs/development/python-modules/accupy/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { mpmath numpy pyfma - ] ++ lib.optional (pythonOlder "3.8") importlib-metadata; + ] + ++ lib.optional (pythonOlder "3.8") importlib-metadata; nativeCheckInputs = [ perfplot diff --git a/pkgs/development/python-modules/acquire/default.nix b/pkgs/development/python-modules/acquire/default.nix index 9bc47aa4a518..e27075b7e133 100644 --- a/pkgs/development/python-modules/acquire/default.nix +++ b/pkgs/development/python-modules/acquire/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { requests requests-toolbelt rich - ] ++ dissect-target.optional-dependencies.full; + ] + ++ dissect-target.optional-dependencies.full; }; nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.full; diff --git a/pkgs/development/python-modules/adb-shell/default.nix b/pkgs/development/python-modules/adb-shell/default.nix index 3aaf814b608c..c62ff7228b50 100644 --- a/pkgs/development/python-modules/adb-shell/default.nix +++ b/pkgs/development/python-modules/adb-shell/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { mock pycryptodome pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "adb_shell" ]; diff --git a/pkgs/development/python-modules/adblock/default.nix b/pkgs/development/python-modules/adblock/default.nix index f98f0cf100e2..b8dfc78e73d4 100644 --- a/pkgs/development/python-modules/adblock/default.nix +++ b/pkgs/development/python-modules/adblock/default.nix @@ -48,18 +48,20 @@ buildPythonPackage rec { hash = "sha256-fetJX6HQxRZ/Az7rJeU9S+s8ttgNPnJEvTLfzGt4xjk="; }; - nativeBuildInputs = - [ pkg-config ] - ++ (with rustPlatform; [ - cargoSetupHook - maturinBuildHook - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with rustPlatform; [ + cargoSetupHook + maturinBuildHook + ]); - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; PSL_PATH = "${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"; diff --git a/pkgs/development/python-modules/aenum/default.nix b/pkgs/development/python-modules/aenum/default.nix index 7639b8ac9fdc..5c81bff1e9a7 100644 --- a/pkgs/development/python-modules/aenum/default.nix +++ b/pkgs/development/python-modules/aenum/default.nix @@ -30,21 +30,20 @@ buildPythonPackage rec { pythonImportsCheck = [ "aenum" ]; - disabledTests = - [ - # https://github.com/ethanfurman/aenum/issues/27 - "test_class_nested_enum_and_pickle_protocol_four" - "test_pickle_enum_function_with_qualname" - "test_stdlib_inheritence" - "test_subclasses_with_getnewargs_ex" - "test_arduino_headers" - "test_c_header_scanner" - "test_extend_flag_backwards_stdlib" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # AttributeError: has no attribute 'value'. Did you mean: 'blue'? - "test_extend_enum_shadow_property_stdlib" - ]; + disabledTests = [ + # https://github.com/ethanfurman/aenum/issues/27 + "test_class_nested_enum_and_pickle_protocol_four" + "test_pickle_enum_function_with_qualname" + "test_stdlib_inheritence" + "test_subclasses_with_getnewargs_ex" + "test_arduino_headers" + "test_c_header_scanner" + "test_extend_flag_backwards_stdlib" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # AttributeError: has no attribute 'value'. Did you mean: 'blue'? + "test_extend_enum_shadow_property_stdlib" + ]; meta = with lib; { description = "Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants"; diff --git a/pkgs/development/python-modules/afdko/default.nix b/pkgs/development/python-modules/afdko/default.nix index 10a8e90fa235..6a856942f227 100644 --- a/pkgs/development/python-modules/afdko/default.nix +++ b/pkgs/development/python-modules/afdko/default.nix @@ -80,23 +80,22 @@ buildPythonPackage rec { # setup.py will always (re-)execute cmake in buildPhase dontConfigure = true; - dependencies = - [ - booleanoperations - defcon - fontmath - fontpens - fonttools - mutatormath - tqdm - ufonormalizer - ufoprocessor - ] - ++ defcon.optional-dependencies.lxml - ++ fonttools.optional-dependencies.lxml - ++ fonttools.optional-dependencies.ufo - ++ fonttools.optional-dependencies.unicode - ++ fonttools.optional-dependencies.woff; + dependencies = [ + booleanoperations + defcon + fontmath + fontpens + fonttools + mutatormath + tqdm + ufonormalizer + ufoprocessor + ] + ++ defcon.optional-dependencies.lxml + ++ fonttools.optional-dependencies.lxml + ++ fonttools.optional-dependencies.ufo + ++ fonttools.optional-dependencies.unicode + ++ fonttools.optional-dependencies.woff; # Use system libxml2 FORCE_SYSTEM_LIBXML2 = true; @@ -110,40 +109,39 @@ buildPythonPackage rec { rm -rf _skbuild ''; - disabledTests = - [ - # broke in the fontforge 4.51 -> 4.53 update - "test_glyphs_2_7" - "test_hinting_data" - "test_waterfallplot" - # broke at some point - "test_type1_supported_hint" - ] - ++ lib.optionals (stdenv.cc.isGNU) [ - # broke in the gcc 13 -> 14 update - "test_dump" - "test_input_formats" - "test_other_input_formats" - ] - ++ lib.optionals (!runAllTests) [ - # Disable slow tests, reduces test time ~25 % - "test_report" - "test_post_overflow" - "test_cjk" - "test_extrapolate" - "test_filename_without_dir" - "test_overwrite" - "test_options" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isRiscV) [ - # unknown reason so far - # https://github.com/adobe-type-tools/afdko/issues/1425 - "test_spec" - ] - ++ lib.optionals (stdenv.hostPlatform.isi686) [ - "test_dump_option" - "test_type1mm_inputs" - ]; + disabledTests = [ + # broke in the fontforge 4.51 -> 4.53 update + "test_glyphs_2_7" + "test_hinting_data" + "test_waterfallplot" + # broke at some point + "test_type1_supported_hint" + ] + ++ lib.optionals (stdenv.cc.isGNU) [ + # broke in the gcc 13 -> 14 update + "test_dump" + "test_input_formats" + "test_other_input_formats" + ] + ++ lib.optionals (!runAllTests) [ + # Disable slow tests, reduces test time ~25 % + "test_report" + "test_post_overflow" + "test_cjk" + "test_extrapolate" + "test_filename_without_dir" + "test_overwrite" + "test_options" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isRiscV) [ + # unknown reason so far + # https://github.com/adobe-type-tools/afdko/issues/1425 + "test_spec" + ] + ++ lib.optionals (stdenv.hostPlatform.isi686) [ + "test_dump_option" + "test_type1mm_inputs" + ]; passthru.tests = { fullTestsuite = afdko.override { runAllTests = true; }; diff --git a/pkgs/development/python-modules/aioboto3/default.nix b/pkgs/development/python-modules/aioboto3/default.nix index e0474f8f4226..c36746e5cc71 100644 --- a/pkgs/development/python-modules/aioboto3/default.nix +++ b/pkgs/development/python-modules/aioboto3/default.nix @@ -38,22 +38,22 @@ buildPythonPackage rec { dependencies = [ aiobotocore aiofiles - ] ++ aiobotocore.optional-dependencies.boto3; + ] + ++ aiobotocore.optional-dependencies.boto3; optional-dependencies = { chalice = [ chalice ]; s3cse = [ cryptography ]; }; - nativeCheckInputs = - [ - dill - moto - pytest-asyncio - pytestCheckHook - ] - ++ moto.optional-dependencies.server - ++ lib.flatten (builtins.attrValues optional-dependencies); + nativeCheckInputs = [ + dill + moto + pytest-asyncio + pytestCheckHook + ] + ++ moto.optional-dependencies.server + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = [ "test_patches" diff --git a/pkgs/development/python-modules/aiobotocore/default.nix b/pkgs/development/python-modules/aiobotocore/default.nix index b0d435e2efa0..a1dbe65c0123 100644 --- a/pkgs/development/python-modules/aiobotocore/default.nix +++ b/pkgs/development/python-modules/aiobotocore/default.nix @@ -64,7 +64,8 @@ buildPythonPackage rec { time-machine werkzeug pytestCheckHook - ] ++ moto.optional-dependencies.server; + ] + ++ moto.optional-dependencies.server; pythonImportsCheck = [ "aiobotocore" ]; diff --git a/pkgs/development/python-modules/aiobtclientrpc/default.nix b/pkgs/development/python-modules/aiobtclientrpc/default.nix index cdc4e76c5315..57e61e150991 100644 --- a/pkgs/development/python-modules/aiobtclientrpc/default.nix +++ b/pkgs/development/python-modules/aiobtclientrpc/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { httpx-socks python-socks rencode - ] ++ python-socks.optional-dependencies.asyncio; + ] + ++ python-socks.optional-dependencies.asyncio; nativeCheckInputs = [ proxy-py diff --git a/pkgs/development/python-modules/aiocache/default.nix b/pkgs/development/python-modules/aiocache/default.nix index 1d837754cb93..7ade263fb543 100644 --- a/pkgs/development/python-modules/aiocache/default.nix +++ b/pkgs/development/python-modules/aiocache/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { pytest-mock pytestCheckHook redisTestHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlagsArray = [ "-W" @@ -57,20 +58,19 @@ buildPythonPackage rec { "-x" ]; - disabledTests = - [ - # Test calls apache benchmark and fails, no usable output - "test_concurrency_error_rates" - # susceptible to timing out / short ttl - "test_cached_stampede" - "test_locking_dogpile_lease_expiration" - "test_set_ttl_handle" - "test_set_cancel_previous_ttl_handle" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/aio-libs/aiocache/issues/863 - "test_cache_write_doesnt_wait_for_future" - ]; + disabledTests = [ + # Test calls apache benchmark and fails, no usable output + "test_concurrency_error_rates" + # susceptible to timing out / short ttl + "test_cached_stampede" + "test_locking_dogpile_lease_expiration" + "test_set_ttl_handle" + "test_set_cancel_previous_ttl_handle" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/aio-libs/aiocache/issues/863 + "test_cache_write_doesnt_wait_for_future" + ]; disabledTestPaths = [ # Benchmark and performance tests are not relevant for Nixpkgs diff --git a/pkgs/development/python-modules/aioesphomeapi/default.nix b/pkgs/development/python-modules/aioesphomeapi/default.nix index 9aca8a3b8be2..6925b95bad85 100644 --- a/pkgs/development/python-modules/aioesphomeapi/default.nix +++ b/pkgs/development/python-modules/aioesphomeapi/default.nix @@ -53,7 +53,8 @@ buildPythonPackage rec { noiseprotocol protobuf zeroconf - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/aioftp/default.nix b/pkgs/development/python-modules/aioftp/default.nix index 3fbf99a9eeb9..e53a2b472a88 100644 --- a/pkgs/development/python-modules/aioftp/default.nix +++ b/pkgs/development/python-modules/aioftp/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { pytest-mock pytestCheckHook trustme - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ # uses 127.0.0.2, which macos doesn't like diff --git a/pkgs/development/python-modules/aiogram/default.nix b/pkgs/development/python-modules/aiogram/default.nix index 6ebbe2a87c8d..403b6d93c82f 100644 --- a/pkgs/development/python-modules/aiogram/default.nix +++ b/pkgs/development/python-modules/aiogram/default.nix @@ -74,7 +74,8 @@ buildPythonPackage rec { pytest-lazy-fixture pytestCheckHook pytz - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "aiogram" ]; diff --git a/pkgs/development/python-modules/aiohomeconnect/default.nix b/pkgs/development/python-modules/aiohomeconnect/default.nix index f09302f83b0f..866eb3dea651 100644 --- a/pkgs/development/python-modules/aiohomeconnect/default.nix +++ b/pkgs/development/python-modules/aiohomeconnect/default.nix @@ -53,7 +53,8 @@ buildPythonPackage rec { pytest-cov-stub pytest-httpx pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "aiohomeconnect" ]; diff --git a/pkgs/development/python-modules/aiohttp-client-cache/default.nix b/pkgs/development/python-modules/aiohttp-client-cache/default.nix index 23e833ac89ed..b4f4bfdfd8b8 100644 --- a/pkgs/development/python-modules/aiohttp-client-cache/default.nix +++ b/pkgs/development/python-modules/aiohttp-client-cache/default.nix @@ -64,7 +64,8 @@ buildPythonPackage rec { faker pytest-aiohttp pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "aiohttp_client_cache" ]; diff --git a/pkgs/development/python-modules/aiohttp-socks/default.nix b/pkgs/development/python-modules/aiohttp-socks/default.nix index 0b2539fa9b28..2200c9260e96 100644 --- a/pkgs/development/python-modules/aiohttp-socks/default.nix +++ b/pkgs/development/python-modules/aiohttp-socks/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { dependencies = [ aiohttp python-socks - ] ++ python-socks.optional-dependencies.asyncio; + ] + ++ python-socks.optional-dependencies.asyncio; # Checks needs internet access doCheck = false; diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix index 4bff55257c2b..c3e262f21077 100644 --- a/pkgs/development/python-modules/aiohttp/default.nix +++ b/pkgs/development/python-modules/aiohttp/default.nix @@ -99,7 +99,8 @@ buildPythonPackage rec { multidict propcache yarl - ] ++ optional-dependencies.speedups; + ] + ++ optional-dependencies.speedups; optional-dependencies.speedups = [ aiodns @@ -124,46 +125,44 @@ buildPythonPackage rec { zlib-ng ]; - disabledTests = - [ - # Disable tests that require network access - "test_client_session_timeout_zero" - "test_mark_formdata_as_processed" - "test_requote_redirect_url_default" - "test_tcp_connector_ssl_shutdown_timeout_nonzero_passed" - "test_tcp_connector_ssl_shutdown_timeout_zero_not_passed" - # don't run benchmarks - "test_import_time" - # racy - "test_uvloop_secure_https_proxy" - # Cannot connect to host example.com:443 ssl:default [Could not contact DNS servers] - "test_tcp_connector_ssl_shutdown_timeout_passed_to_create_connection" - ] - # these tests fail with python310 but succeeds with 11+ - ++ lib.optionals isPy310 [ - "test_https_proxy_unsupported_tls_in_tls" - "test_tcp_connector_raise_connector_ssl_error" - ] - ++ lib.optionals stdenv.hostPlatform.is32bit [ "test_cookiejar" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0 - "test_close" - ]; + disabledTests = [ + # Disable tests that require network access + "test_client_session_timeout_zero" + "test_mark_formdata_as_processed" + "test_requote_redirect_url_default" + "test_tcp_connector_ssl_shutdown_timeout_nonzero_passed" + "test_tcp_connector_ssl_shutdown_timeout_zero_not_passed" + # don't run benchmarks + "test_import_time" + # racy + "test_uvloop_secure_https_proxy" + # Cannot connect to host example.com:443 ssl:default [Could not contact DNS servers] + "test_tcp_connector_ssl_shutdown_timeout_passed_to_create_connection" + ] + # these tests fail with python310 but succeeds with 11+ + ++ lib.optionals isPy310 [ + "test_https_proxy_unsupported_tls_in_tls" + "test_tcp_connector_raise_connector_ssl_error" + ] + ++ lib.optionals stdenv.hostPlatform.is32bit [ "test_cookiejar" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_addresses" # https://github.com/aio-libs/aiohttp/issues/3572, remove >= v4.0.0 + "test_close" + ]; __darwinAllowLocalNetworking = true; - preCheck = - '' - # aiohttp in current folder shadows installed version - rm -r aiohttp - touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990 + preCheck = '' + # aiohttp in current folder shadows installed version + rm -r aiohttp + touch tests/data.unknown_mime_type # has to be modified after 1 Jan 1990 - export HOME=$(mktemp -d) - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Work around "OSError: AF_UNIX path too long" - export TMPDIR="/tmp" - ''; + export HOME=$(mktemp -d) + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Work around "OSError: AF_UNIX path too long" + export TMPDIR="/tmp" + ''; meta = with lib; { changelog = "https://docs.aiohttp.org/en/${src.tag}/changes.html"; diff --git a/pkgs/development/python-modules/aioimaplib/default.nix b/pkgs/development/python-modules/aioimaplib/default.nix index 6f7ba2b3806c..2c9502ff289a 100644 --- a/pkgs/development/python-modules/aioimaplib/default.nix +++ b/pkgs/development/python-modules/aioimaplib/default.nix @@ -35,15 +35,14 @@ buildPythonPackage rec { pytz ]; - disabledTests = - [ - # TimeoutError - "test_idle_start__exits_queue_get_without_timeout_error" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Comparison to magic strings - "test_idle_loop" - ]; + disabledTests = [ + # TimeoutError + "test_idle_start__exits_queue_get_without_timeout_error" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Comparison to magic strings + "test_idle_loop" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/aiojobs/default.nix b/pkgs/development/python-modules/aiojobs/default.nix index 181e98b63fff..bdfdf0c16571 100644 --- a/pkgs/development/python-modules/aiojobs/default.nix +++ b/pkgs/development/python-modules/aiojobs/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { pytestCheckHook pytest-aiohttp pytest-cov-stub - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "aiojobs" ]; diff --git a/pkgs/development/python-modules/aiomisc/default.nix b/pkgs/development/python-modules/aiomisc/default.nix index b515243e8d09..f92816215373 100644 --- a/pkgs/development/python-modules/aiomisc/default.nix +++ b/pkgs/development/python-modules/aiomisc/default.nix @@ -34,10 +34,11 @@ buildPythonPackage rec { build-system = [ poetry-core ]; - dependencies = - [ colorlog ] - ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ logging-journald ]; + dependencies = [ + colorlog + ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ logging-journald ]; nativeCheckInputs = [ aiocontextvars @@ -45,7 +46,8 @@ buildPythonPackage rec { fastapi pytestCheckHook setproctitle - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); optional-dependencies = { aiohttp = [ aiohttp ]; diff --git a/pkgs/development/python-modules/aioprometheus/default.nix b/pkgs/development/python-modules/aioprometheus/default.nix index 2dc49ae5b1f8..d1d429e484eb 100644 --- a/pkgs/development/python-modules/aioprometheus/default.nix +++ b/pkgs/development/python-modules/aioprometheus/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { httpx fastapi uvicorn - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "aioprometheus" ]; diff --git a/pkgs/development/python-modules/aioredis/default.nix b/pkgs/development/python-modules/aioredis/default.nix index aef2e406036e..e941d557ca43 100644 --- a/pkgs/development/python-modules/aioredis/default.nix +++ b/pkgs/development/python-modules/aioredis/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ async-timeout typing-extensions - ] ++ lib.optional (!isPyPy) hiredis; + ] + ++ lib.optional (!isPyPy) hiredis; # Wants to run redis-server, hardcoded FHS paths, too much trouble. doCheck = false; diff --git a/pkgs/development/python-modules/aiorpcx/default.nix b/pkgs/development/python-modules/aiorpcx/default.nix index db3f3f209416..9ed371bb9d86 100644 --- a/pkgs/development/python-modules/aiorpcx/default.nix +++ b/pkgs/development/python-modules/aiorpcx/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # network access diff --git a/pkgs/development/python-modules/aiortm/default.nix b/pkgs/development/python-modules/aiortm/default.nix index 15d9bee935be..4bc009caa27c 100644 --- a/pkgs/development/python-modules/aiortm/default.nix +++ b/pkgs/development/python-modules/aiortm/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { pytest-asyncio pytest-cov-stub pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "aiortm" ]; diff --git a/pkgs/development/python-modules/aiosmtpd/default.nix b/pkgs/development/python-modules/aiosmtpd/default.nix index 28d13a1f6dcb..72760643dffe 100644 --- a/pkgs/development/python-modules/aiosmtpd/default.nix +++ b/pkgs/development/python-modules/aiosmtpd/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ atpublic attrs - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; nativeCheckInputs = [ pytest-mock diff --git a/pkgs/development/python-modules/aioswitcher/default.nix b/pkgs/development/python-modules/aioswitcher/default.nix index 72d1c8dd8ac7..c21b891d8299 100644 --- a/pkgs/development/python-modules/aioswitcher/default.nix +++ b/pkgs/development/python-modules/aioswitcher/default.nix @@ -57,19 +57,18 @@ buildPythonPackage rec { time-machine ]; - disabledTests = - [ - # AssertionError: Expected <14:00> to be equal to <17:00>, but was not. - "test_schedule_parser_with_a_weekly_recurring_enabled_schedule_data" - "test_schedule_parser_with_a_daily_recurring_enabled_schedule_data" - "test_schedule_parser_with_a_partial_daily_recurring_enabled_schedule_data" - "test_schedule_parser_with_a_non_recurring_enabled_schedule_data" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # ssertionError: Expected <'I' format requires 0 <= number <= 4294967295> to be equal to , but was not. - "test_minutes_to_hexadecimal_seconds_with_a_negative_value_should_throw_an_error" - "test_current_timestamp_to_hexadecimal_with_errornous_value_should_throw_an_error" - ]; + disabledTests = [ + # AssertionError: Expected <14:00> to be equal to <17:00>, but was not. + "test_schedule_parser_with_a_weekly_recurring_enabled_schedule_data" + "test_schedule_parser_with_a_daily_recurring_enabled_schedule_data" + "test_schedule_parser_with_a_partial_daily_recurring_enabled_schedule_data" + "test_schedule_parser_with_a_non_recurring_enabled_schedule_data" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # ssertionError: Expected <'I' format requires 0 <= number <= 4294967295> to be equal to , but was not. + "test_minutes_to_hexadecimal_seconds_with_a_negative_value_should_throw_an_error" + "test_current_timestamp_to_hexadecimal_with_errornous_value_should_throw_an_error" + ]; pythonImportsCheck = [ "aioswitcher" ]; diff --git a/pkgs/development/python-modules/aiovlc/default.nix b/pkgs/development/python-modules/aiovlc/default.nix index c284c4f07993..5f91b6c75d26 100644 --- a/pkgs/development/python-modules/aiovlc/default.nix +++ b/pkgs/development/python-modules/aiovlc/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { pytest-cov-stub pytest-timeout pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "aiovlc" ]; diff --git a/pkgs/development/python-modules/aioxmpp/default.nix b/pkgs/development/python-modules/aioxmpp/default.nix index d535db4cd727..d5a59dd367b0 100644 --- a/pkgs/development/python-modules/aioxmpp/default.nix +++ b/pkgs/development/python-modules/aioxmpp/default.nix @@ -75,23 +75,22 @@ buildPythonPackage rec { disabledTestPaths = [ "benchmarks" ]; - disabledTests = - [ - # AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'normalize' - "test_convert_field_datetime_default_locale" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # asyncio issues - "test_is_abstract" - "Testbackground" - "TestCapturingXSO" - "Testcheck_x509" - "TestClient" - "TestIntegerType" - "TestStanzaStream" - "TestStanzaToken" - "TestXMLStream" - ]; + disabledTests = [ + # AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'normalize' + "test_convert_field_datetime_default_locale" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # asyncio issues + "test_is_abstract" + "Testbackground" + "TestCapturingXSO" + "Testcheck_x509" + "TestClient" + "TestIntegerType" + "TestStanzaStream" + "TestStanzaToken" + "TestXMLStream" + ]; meta = { description = "Pure-python XMPP library for asyncio"; diff --git a/pkgs/development/python-modules/ale-py/default.nix b/pkgs/development/python-modules/ale-py/default.nix index 6977ece2f648..3cbf53d33cdf 100644 --- a/pkgs/development/python-modules/ale-py/default.nix +++ b/pkgs/development/python-modules/ale-py/default.nix @@ -51,25 +51,23 @@ buildPythonPackage rec { setuptools ]; - buildInputs = - [ - SDL2 - zlib - ] - ++ lib.optionals withVectorEnv [ - opencv - ]; + buildInputs = [ + SDL2 + zlib + ] + ++ lib.optionals withVectorEnv [ + opencv + ]; - dependencies = - [ - gymnasium - importlib-resources - numpy - typing-extensions - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - jax - ]; + dependencies = [ + gymnasium + importlib-resources + numpy + typing-extensions + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + jax + ]; postPatch = # Relax the pybind11 version @@ -92,14 +90,13 @@ buildPythonPackage rec { doCheck = false; - nativeCheckInputs = - [ - gymnasium - pytestCheckHook - ] - + lib.optionals withVectorEnv [ - opencv-python - ]; + nativeCheckInputs = [ + gymnasium + pytestCheckHook + ] + + lib.optionals withVectorEnv [ + opencv-python + ]; disabledTests = [ # Fatal Python error: Aborted diff --git a/pkgs/development/python-modules/alembic/default.nix b/pkgs/development/python-modules/alembic/default.nix index f2bf73ea5021..3ea57cab5cea 100644 --- a/pkgs/development/python-modules/alembic/default.nix +++ b/pkgs/development/python-modules/alembic/default.nix @@ -34,16 +34,15 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - mako - sqlalchemy - typing-extensions - ] - ++ lib.optionals (pythonOlder "3.9") [ - importlib-resources - importlib-metadata - ]; + dependencies = [ + mako + sqlalchemy + typing-extensions + ] + ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources + importlib-metadata + ]; pythonImportsCheck = [ "alembic" ]; diff --git a/pkgs/development/python-modules/alpha-vantage/default.nix b/pkgs/development/python-modules/alpha-vantage/default.nix index 72f1085a5007..8225ce7ca654 100644 --- a/pkgs/development/python-modules/alpha-vantage/default.nix +++ b/pkgs/development/python-modules/alpha-vantage/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { aioresponses requests-mock pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # Starting with 3.0.0 most tests require an API key doCheck = false; diff --git a/pkgs/development/python-modules/altair/default.nix b/pkgs/development/python-modules/altair/default.nix index ae2750caf8cd..23332d850960 100644 --- a/pkgs/development/python-modules/altair/default.nix +++ b/pkgs/development/python-modules/altair/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { packaging pandas toolz - ] ++ lib.optional (pythonOlder "3.14") typing-extensions; + ] + ++ lib.optional (pythonOlder "3.14") typing-extensions; nativeCheckInputs = [ ipython diff --git a/pkgs/development/python-modules/amaranth/default.nix b/pkgs/development/python-modules/amaranth/default.nix index 25d210083ec6..e10b9c306d17 100644 --- a/pkgs/development/python-modules/amaranth/default.nix +++ b/pkgs/development/python-modules/amaranth/default.nix @@ -41,14 +41,13 @@ buildPythonPackage rec { build-system = [ pdm-backend ]; - dependencies = - [ - jschon - jinja2 - pyvcd - ] - ++ lib.optional (pythonOlder "3.9") importlib-resources - ++ lib.optional (pythonOlder "3.8") importlib-metadata; + dependencies = [ + jschon + jinja2 + pyvcd + ] + ++ lib.optional (pythonOlder "3.9") importlib-resources + ++ lib.optional (pythonOlder "3.8") importlib-metadata; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/amqp/default.nix b/pkgs/development/python-modules/amqp/default.nix index 2c9b4200c946..9b334e043f37 100644 --- a/pkgs/development/python-modules/amqp/default.nix +++ b/pkgs/development/python-modules/amqp/default.nix @@ -30,15 +30,14 @@ buildPythonPackage rec { pytest-rerunfailures ]; - disabledTests = - [ - # Requires network access - "test_rmq.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Requires network access but fails on macos only - "test_connection.py" - ]; + disabledTests = [ + # Requires network access + "test_rmq.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Requires network access but fails on macos only + "test_connection.py" + ]; pythonImportsCheck = [ "amqp" ]; diff --git a/pkgs/development/python-modules/androguard/default.nix b/pkgs/development/python-modules/androguard/default.nix index 26a930fbda84..72e71b9247b8 100644 --- a/pkgs/development/python-modules/androguard/default.nix +++ b/pkgs/development/python-modules/androguard/default.nix @@ -51,31 +51,30 @@ buildPythonPackage rec { nativeBuildInputs = lib.optionals withGui [ qt5.wrapQtAppsHook ]; - dependencies = - [ - apkinspector - asn1crypto - click - colorama - cryptography - dataset - frida-python - ipython - loguru - lxml - matplotlib - mutf8 - networkx - oscrypto - pydot - pygments - pyyaml - ] - ++ networkx.optional-dependencies.default - ++ networkx.optional-dependencies.extra - ++ lib.optionals withGui [ - pyqt5 - ]; + dependencies = [ + apkinspector + asn1crypto + click + colorama + cryptography + dataset + frida-python + ipython + loguru + lxml + matplotlib + mutf8 + networkx + oscrypto + pydot + pygments + pyyaml + ] + ++ networkx.optional-dependencies.default + ++ networkx.optional-dependencies.extra + ++ lib.optionals withGui [ + pyqt5 + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/androidtv/default.nix b/pkgs/development/python-modules/androidtv/default.nix index e9801d973ccf..374602ae64dc 100644 --- a/pkgs/development/python-modules/androidtv/default.nix +++ b/pkgs/development/python-modules/androidtv/default.nix @@ -39,13 +39,12 @@ buildPythonPackage rec { inherit (adb-shell.optional-dependencies) usb; }; - nativeCheckInputs = - [ - mock - pytestCheckHook - ] - ++ optional-dependencies.async - ++ optional-dependencies.usb; + nativeCheckInputs = [ + mock + pytestCheckHook + ] + ++ optional-dependencies.async + ++ optional-dependencies.usb; disabledTests = [ # Requires git but fails anyway diff --git a/pkgs/development/python-modules/anndata/default.nix b/pkgs/development/python-modules/anndata/default.nix index 4e79d8b013d8..bad8ddf0dc23 100644 --- a/pkgs/development/python-modules/anndata/default.nix +++ b/pkgs/development/python-modules/anndata/default.nix @@ -91,60 +91,59 @@ buildPythonPackage rec { "src/anndata/utils.py" ]; - disabledTests = - [ - # doctests that require scanpy, creating a circular dependency chain. These - # do not work in disabledTestPaths for some reason. - "anndata._core.anndata.AnnData.concatenate" - "anndata._core.anndata.AnnData.obs_names_make_unique" - "anndata._core.anndata.AnnData.var_names_make_unique" - "anndata._core.merge.concat" - "anndata._core.merge.gen_reindexer" - "anndata._core.sparse_dataset.sparse_dataset" - "anndata._io.specs.registry.read_elem_as_dask" - "anndata._io.utils.report_read_key_on_error" - "anndata._io.utils.report_write_key_on_error" - "anndata._warnings.ImplicitModificationWarning" - "anndata.experimental.merge.concat_on_disk" - "anndata.experimental.multi_files._anncollection.AnnCollection" - "anndata.utils.make_index_unique" - "ci.scripts.min-deps.min_dep" - "concatenation.rst" + disabledTests = [ + # doctests that require scanpy, creating a circular dependency chain. These + # do not work in disabledTestPaths for some reason. + "anndata._core.anndata.AnnData.concatenate" + "anndata._core.anndata.AnnData.obs_names_make_unique" + "anndata._core.anndata.AnnData.var_names_make_unique" + "anndata._core.merge.concat" + "anndata._core.merge.gen_reindexer" + "anndata._core.sparse_dataset.sparse_dataset" + "anndata._io.specs.registry.read_elem_as_dask" + "anndata._io.utils.report_read_key_on_error" + "anndata._io.utils.report_write_key_on_error" + "anndata._warnings.ImplicitModificationWarning" + "anndata.experimental.merge.concat_on_disk" + "anndata.experimental.multi_files._anncollection.AnnCollection" + "anndata.utils.make_index_unique" + "ci.scripts.min-deps.min_dep" + "concatenation.rst" - # Tests that require cupy and GPU access. Introducing cupy as a dependency - # would make this package unfree and GPU access is not possible within the - # nix build environment anyhow. - "test_adata_raw_gpu" - "test_as_cupy_dask" - "test_as_dask_functions" - "test_concat_different_types_dask" - "test_concat_on_var_outer_join" - "test_concatenate_layers_misaligned" - "test_concatenate_layers_outer" - "test_concatenate_layers" - "test_concatenate_roundtrip" - "test_dask_to_memory_unbacked" - "test_ellipsis_index" - "test_error_on_mixed_device" - "test_gpu" - "test_io_spec_cupy" - "test_modify_view_component" - "test_nan_merge" - "test_pairwise_concat" - "test_raw_gpu" - "test_set_scalar_subset_X" - "test_transposed_concat" - "test_view_different_type_indices" - "test_view_of_view" + # Tests that require cupy and GPU access. Introducing cupy as a dependency + # would make this package unfree and GPU access is not possible within the + # nix build environment anyhow. + "test_adata_raw_gpu" + "test_as_cupy_dask" + "test_as_dask_functions" + "test_concat_different_types_dask" + "test_concat_on_var_outer_join" + "test_concatenate_layers_misaligned" + "test_concatenate_layers_outer" + "test_concatenate_layers" + "test_concatenate_roundtrip" + "test_dask_to_memory_unbacked" + "test_ellipsis_index" + "test_error_on_mixed_device" + "test_gpu" + "test_io_spec_cupy" + "test_modify_view_component" + "test_nan_merge" + "test_pairwise_concat" + "test_raw_gpu" + "test_set_scalar_subset_X" + "test_transposed_concat" + "test_view_different_type_indices" + "test_view_of_view" - # Tests that are seemingly broken. See https://github.com/scverse/anndata/issues/2017. - "test_concat_dask_sparse_matches_memory" - ] - ++ lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ - # RuntimeError: Cluster failed to start: [Errno 1] Operation not permitted - "test_dask_distributed_write" - "test_read_lazy_h5_cluster" - ]; + # Tests that are seemingly broken. See https://github.com/scverse/anndata/issues/2017. + "test_concat_dask_sparse_matches_memory" + ] + ++ lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ + # RuntimeError: Cluster failed to start: [Errno 1] Operation not permitted + "test_dask_distributed_write" + "test_read_lazy_h5_cluster" + ]; pythonImportsCheck = [ "anndata" ]; diff --git a/pkgs/development/python-modules/ansible-runner/default.nix b/pkgs/development/python-modules/ansible-runner/default.nix index a185fea3aa04..b094970f2bdd 100644 --- a/pkgs/development/python-modules/ansible-runner/default.nix +++ b/pkgs/development/python-modules/ansible-runner/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pexpect python-daemon pyyaml - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; nativeCheckInputs = [ ansible-core # required to place ansible CLI onto the PATH in tests @@ -94,18 +95,17 @@ buildPythonPackage rec { "test_resolved_actions" ]; - disabledTestPaths = - [ - # These tests unset PATH and then run executables like `bash` (see https://github.com/ansible/ansible-runner/pull/918) - "test/integration/test_runner.py" - "test/unit/test_runner.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Integration tests on Darwin are not regularly passing in ansible-runner's own CI - "test/integration" - # These tests write to `/tmp` which is not writable on Darwin - "test/unit/config/test__base.py" - ]; + disabledTestPaths = [ + # These tests unset PATH and then run executables like `bash` (see https://github.com/ansible/ansible-runner/pull/918) + "test/integration/test_runner.py" + "test/unit/test_runner.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Integration tests on Darwin are not regularly passing in ansible-runner's own CI + "test/integration" + # These tests write to `/tmp` which is not writable on Darwin + "test/unit/config/test__base.py" + ]; pythonImportsCheck = [ "ansible_runner" ]; diff --git a/pkgs/development/python-modules/ansible/core.nix b/pkgs/development/python-modules/ansible/core.nix index fca626e1c7f4..3edaca820b27 100644 --- a/pkgs/development/python-modules/ansible/core.nix +++ b/pkgs/development/python-modules/ansible/core.nix @@ -87,7 +87,8 @@ buildPythonPackage rec { requests scp xmltodict - ] ++ lib.optionals windowsSupport [ pywinrm ]; + ] + ++ lib.optionals windowsSupport [ pywinrm ]; pythonRelaxDeps = [ "resolvelib" ]; diff --git a/pkgs/development/python-modules/anyio/default.nix b/pkgs/development/python-modules/anyio/default.nix index 9a6fac31c3e8..389734d22497 100644 --- a/pkgs/development/python-modules/anyio/default.nix +++ b/pkgs/development/python-modules/anyio/default.nix @@ -47,17 +47,16 @@ buildPythonPackage rec { build-system = [ setuptools-scm ]; - dependencies = - [ - idna - sniffio - ] - ++ lib.optionals (pythonOlder "3.13") [ - typing-extensions - ] - ++ lib.optionals (pythonOlder "3.11") [ - exceptiongroup - ]; + dependencies = [ + idna + sniffio + ] + ++ lib.optionals (pythonOlder "3.13") [ + typing-extensions + ] + ++ lib.optionals (pythonOlder "3.11") [ + exceptiongroup + ]; optional-dependencies = { trio = [ trio ]; @@ -73,7 +72,8 @@ buildPythonPackage rec { pytestCheckHook trustme uvloop - ] ++ optional-dependencies.trio; + ] + ++ optional-dependencies.trio; pytestFlagsArray = [ "-W" @@ -87,29 +87,28 @@ buildPythonPackage rec { export TMPDIR="/tmp" ''; - disabledTests = - [ - # TypeError: __subprocess_run() got an unexpected keyword argument 'umask' - "test_py39_arguments" - # AttributeError: 'module' object at __main__ has no attribute '__file__' - "test_nonexistent_main_module" - # 3 second timeout expired - "test_keyboardinterrupt_during_test" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # PermissionError: [Errno 1] Operation not permitted: '/dev/console' - "test_is_block_device" + disabledTests = [ + # TypeError: __subprocess_run() got an unexpected keyword argument 'umask' + "test_py39_arguments" + # AttributeError: 'module' object at __main__ has no attribute '__file__' + "test_nonexistent_main_module" + # 3 second timeout expired + "test_keyboardinterrupt_during_test" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # PermissionError: [Errno 1] Operation not permitted: '/dev/console' + "test_is_block_device" - # These tests become flaky under heavy load - "test_asyncio_run_sync_called" - "test_handshake_fail" - "test_run_in_custom_limiter" - "test_cancel_from_shielded_scope" - "test_start_task_soon_cancel_later" + # These tests become flaky under heavy load + "test_asyncio_run_sync_called" + "test_handshake_fail" + "test_run_in_custom_limiter" + "test_cancel_from_shielded_scope" + "test_start_task_soon_cancel_later" - # AssertionError: assert 'wheel' == 'nixbld' - "test_group" - ]; + # AssertionError: assert 'wheel' == 'nixbld' + "test_group" + ]; disabledTestPaths = [ # lots of DNS lookups diff --git a/pkgs/development/python-modules/anywidget/default.nix b/pkgs/development/python-modules/anywidget/default.nix index a41edf056e92..e79ac1a6e939 100644 --- a/pkgs/development/python-modules/anywidget/default.nix +++ b/pkgs/development/python-modules/anywidget/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { ipywidgets psygnal typing-extensions - ] ++ lib.optional (pythonOlder "3.8") importlib-metadata; + ] + ++ lib.optional (pythonOlder "3.8") importlib-metadata; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/apache-beam/default.nix b/pkgs/development/python-modules/apache-beam/default.nix index 007814559cf5..73c85297671d 100644 --- a/pkgs/development/python-modules/apache-beam/default.nix +++ b/pkgs/development/python-modules/apache-beam/default.nix @@ -177,199 +177,197 @@ buildPythonPackage rec { cd $out/${python.sitePackages} ''; - disabledTestPaths = - [ - # Fails with - # _______ ERROR collecting apache_beam/io/external/xlang_jdbcio_it_test.py _______ - # apache_beam/io/external/xlang_jdbcio_it_test.py:80: in - # class CrossLanguageJdbcIOTest(unittest.TestCase): - # apache_beam/io/external/xlang_jdbcio_it_test.py:99: in CrossLanguageJdbcIOTest - # container_init: Callable[[], Union[PostgresContainer, MySqlContainer]], - # E NameError: name 'MySqlContainer' is not defined - # - "apache_beam/io/external/xlang_jdbcio_it_test.py" + disabledTestPaths = [ + # Fails with + # _______ ERROR collecting apache_beam/io/external/xlang_jdbcio_it_test.py _______ + # apache_beam/io/external/xlang_jdbcio_it_test.py:80: in + # class CrossLanguageJdbcIOTest(unittest.TestCase): + # apache_beam/io/external/xlang_jdbcio_it_test.py:99: in CrossLanguageJdbcIOTest + # container_init: Callable[[], Union[PostgresContainer, MySqlContainer]], + # E NameError: name 'MySqlContainer' is not defined + # + "apache_beam/io/external/xlang_jdbcio_it_test.py" - # These tests depend on the availability of specific servers backends. - "apache_beam/runners/portability/flink_runner_test.py" - "apache_beam/runners/portability/samza_runner_test.py" - "apache_beam/runners/portability/spark_runner_test.py" + # These tests depend on the availability of specific servers backends. + "apache_beam/runners/portability/flink_runner_test.py" + "apache_beam/runners/portability/samza_runner_test.py" + "apache_beam/runners/portability/spark_runner_test.py" - # Fails starting from dill 0.3.6 because it tries to pickle pytest globals: - # https://github.com/uqfoundation/dill/issues/482#issuecomment-1139017499. - "apache_beam/transforms/window_test.py" + # Fails starting from dill 0.3.6 because it tries to pickle pytest globals: + # https://github.com/uqfoundation/dill/issues/482#issuecomment-1139017499. + "apache_beam/transforms/window_test.py" - # See https://github.com/apache/beam/issues/25390. - "apache_beam/coders/slow_coders_test.py" - "apache_beam/dataframe/pandas_doctests_test.py" - "apache_beam/typehints/typed_pipeline_test.py" - "apache_beam/coders/fast_coders_test.py" - "apache_beam/dataframe/schemas_test.py" + # See https://github.com/apache/beam/issues/25390. + "apache_beam/coders/slow_coders_test.py" + "apache_beam/dataframe/pandas_doctests_test.py" + "apache_beam/typehints/typed_pipeline_test.py" + "apache_beam/coders/fast_coders_test.py" + "apache_beam/dataframe/schemas_test.py" - # Fails with TypeError: cannot pickle 'EncodedFile' instances - # Upstream issue https://github.com/apache/beam/issues/33889 - "apache_beam/options/pipeline_options_validator_test.py" - "apache_beam/yaml/main_test.py" - "apache_beam/yaml/programming_guide_test.py" - "apache_beam/yaml/readme_test.py" - "apache_beam/yaml/yaml_combine_test.py" - "apache_beam/yaml/yaml_enrichment_test.py" - "apache_beam/yaml/yaml_io_test.py" - "apache_beam/yaml/yaml_join_test.py" - "apache_beam/yaml/yaml_mapping_test.py" - "apache_beam/yaml/yaml_ml_test.py" - "apache_beam/yaml/yaml_provider_unit_test.py" + # Fails with TypeError: cannot pickle 'EncodedFile' instances + # Upstream issue https://github.com/apache/beam/issues/33889 + "apache_beam/options/pipeline_options_validator_test.py" + "apache_beam/yaml/main_test.py" + "apache_beam/yaml/programming_guide_test.py" + "apache_beam/yaml/readme_test.py" + "apache_beam/yaml/yaml_combine_test.py" + "apache_beam/yaml/yaml_enrichment_test.py" + "apache_beam/yaml/yaml_io_test.py" + "apache_beam/yaml/yaml_join_test.py" + "apache_beam/yaml/yaml_mapping_test.py" + "apache_beam/yaml/yaml_ml_test.py" + "apache_beam/yaml/yaml_provider_unit_test.py" - # FIXME All those fails due to a single- AttributeError: 'MaybeReshuffle' object has no attribute 'side_inputs' - # Upstream issue https://github.com/apache/beam/issues/33854 - "apache_beam/coders/row_coder_test.py" - "apache_beam/examples/avro_nyc_trips_test.py" - "apache_beam/examples/complete/autocomplete_test.py" - "apache_beam/examples/complete/estimate_pi_test.py" - "apache_beam/examples/complete/game/game_stats_test.py" - "apache_beam/examples/complete/game/hourly_team_score_test.py" - "apache_beam/examples/complete/game/leader_board_test.py" - "apache_beam/examples/complete/game/user_score_test.py" - "apache_beam/examples/complete/tfidf_test.py" - "apache_beam/examples/complete/top_wikipedia_sessions_test.py" - "apache_beam/examples/cookbook/bigquery_side_input_test.py" - "apache_beam/examples/cookbook/bigquery_tornadoes_test.py" - "apache_beam/examples/cookbook/coders_test.py" - "apache_beam/examples/cookbook/combiners_test.py" - "apache_beam/examples/cookbook/custom_ptransform_test.py" - "apache_beam/examples/cookbook/filters_test.py" - "apache_beam/examples/matrix_power_test.py" - "apache_beam/examples/snippets/snippets_test.py" - "apache_beam/examples/snippets/transforms/aggregation/approximatequantiles_test.py" - "apache_beam/examples/snippets/transforms/aggregation/approximateunique_test.py" - "apache_beam/examples/snippets/transforms/aggregation/batchelements_test.py" - "apache_beam/examples/snippets/transforms/aggregation/cogroupbykey_test.py" - "apache_beam/examples/snippets/transforms/aggregation/combineglobally_test.py" - "apache_beam/examples/snippets/transforms/aggregation/combineperkey_test.py" - "apache_beam/examples/snippets/transforms/aggregation/combinevalues_test.py" - "apache_beam/examples/snippets/transforms/aggregation/count_test.py" - "apache_beam/examples/snippets/transforms/aggregation/distinct_test.py" - "apache_beam/examples/snippets/transforms/aggregation/groupbykey_test.py" - "apache_beam/examples/snippets/transforms/aggregation/groupintobatches_test.py" - "apache_beam/examples/snippets/transforms/aggregation/latest_test.py" - "apache_beam/examples/snippets/transforms/aggregation/max_test.py" - "apache_beam/examples/snippets/transforms/aggregation/mean_test.py" - "apache_beam/examples/snippets/transforms/aggregation/min_test.py" - "apache_beam/examples/snippets/transforms/aggregation/sample_test.py" - "apache_beam/examples/snippets/transforms/aggregation/sum_test.py" - "apache_beam/examples/snippets/transforms/aggregation/tolist_test.py" - "apache_beam/examples/snippets/transforms/aggregation/top_test.py" - "apache_beam/examples/snippets/transforms/elementwise/filter_test.py" - "apache_beam/examples/snippets/transforms/elementwise/flatmap_test.py" - "apache_beam/examples/snippets/transforms/elementwise/keys_test.py" - "apache_beam/examples/snippets/transforms/elementwise/kvswap_test.py" - "apache_beam/examples/snippets/transforms/elementwise/map_test.py" - "apache_beam/examples/snippets/transforms/elementwise/pardo_test.py" - "apache_beam/examples/snippets/transforms/elementwise/partition_test.py" - "apache_beam/examples/snippets/transforms/elementwise/regex_test.py" - "apache_beam/examples/snippets/transforms/elementwise/tostring_test.py" - "apache_beam/examples/snippets/transforms/elementwise/values_test.py" - "apache_beam/examples/snippets/transforms/elementwise/withtimestamps_test.py" - "apache_beam/examples/snippets/transforms/other/create_test.py" - "apache_beam/examples/snippets/transforms/other/flatten_test.py" - "apache_beam/examples/snippets/transforms/other/window_test.py" - "apache_beam/examples/snippets/util_test.py" - "apache_beam/io/avroio_test.py" - "apache_beam/io/concat_source_test.py" - "apache_beam/io/filebasedsink_test.py" - "apache_beam/io/filebasedsource_test.py" - "apache_beam/io/fileio_test.py" - "apache_beam/io/mongodbio_test.py" - "apache_beam/io/parquetio_test.py" - "apache_beam/io/sources_test.py" - "apache_beam/io/textio_test.py" - "apache_beam/io/tfrecordio_test.py" - "apache_beam/metrics/metric_test.py" - "apache_beam/ml/inference/base_test.py" - "apache_beam/ml/inference/sklearn_inference_test.py" - "apache_beam/ml/inference/utils_test.py" - "apache_beam/ml/rag/chunking/base_test.py" - "apache_beam/ml/rag/ingestion/base_test.py" - "apache_beam/pipeline_test.py" - "apache_beam/runners/direct/direct_runner_test.py" - "apache_beam/runners/direct/sdf_direct_runner_test.py" - "apache_beam/runners/interactive/interactive_beam_test.py" - "apache_beam/runners/interactive/interactive_runner_test.py" - "apache_beam/runners/interactive/non_interactive_runner_test.py" - "apache_beam/runners/interactive/recording_manager_test.py" - "apache_beam/runners/portability/fn_api_runner/translations_test.py" - "apache_beam/runners/portability/fn_api_runner/trigger_manager_test.py" - "apache_beam/runners/portability/stager_test.py" - "apache_beam/testing/synthetic_pipeline_test.py" - "apache_beam/testing/test_stream_test.py" - "apache_beam/testing/util_test.py" - "apache_beam/transforms/combiners_test.py" - "apache_beam/transforms/core_test.py" - "apache_beam/transforms/create_test.py" - "apache_beam/transforms/deduplicate_test.py" - "apache_beam/transforms/periodicsequence_test.py" - "apache_beam/transforms/ptransform_test.py" - "apache_beam/transforms/sideinputs_test.py" - "apache_beam/transforms/stats_test.py" - "apache_beam/transforms/transforms_keyword_only_args_test.py" - "apache_beam/transforms/trigger_test.py" - "apache_beam/transforms/userstate_test.py" - "apache_beam/transforms/util_test.py" - "apache_beam/transforms/write_ptransform_test.py" + # FIXME All those fails due to a single- AttributeError: 'MaybeReshuffle' object has no attribute 'side_inputs' + # Upstream issue https://github.com/apache/beam/issues/33854 + "apache_beam/coders/row_coder_test.py" + "apache_beam/examples/avro_nyc_trips_test.py" + "apache_beam/examples/complete/autocomplete_test.py" + "apache_beam/examples/complete/estimate_pi_test.py" + "apache_beam/examples/complete/game/game_stats_test.py" + "apache_beam/examples/complete/game/hourly_team_score_test.py" + "apache_beam/examples/complete/game/leader_board_test.py" + "apache_beam/examples/complete/game/user_score_test.py" + "apache_beam/examples/complete/tfidf_test.py" + "apache_beam/examples/complete/top_wikipedia_sessions_test.py" + "apache_beam/examples/cookbook/bigquery_side_input_test.py" + "apache_beam/examples/cookbook/bigquery_tornadoes_test.py" + "apache_beam/examples/cookbook/coders_test.py" + "apache_beam/examples/cookbook/combiners_test.py" + "apache_beam/examples/cookbook/custom_ptransform_test.py" + "apache_beam/examples/cookbook/filters_test.py" + "apache_beam/examples/matrix_power_test.py" + "apache_beam/examples/snippets/snippets_test.py" + "apache_beam/examples/snippets/transforms/aggregation/approximatequantiles_test.py" + "apache_beam/examples/snippets/transforms/aggregation/approximateunique_test.py" + "apache_beam/examples/snippets/transforms/aggregation/batchelements_test.py" + "apache_beam/examples/snippets/transforms/aggregation/cogroupbykey_test.py" + "apache_beam/examples/snippets/transforms/aggregation/combineglobally_test.py" + "apache_beam/examples/snippets/transforms/aggregation/combineperkey_test.py" + "apache_beam/examples/snippets/transforms/aggregation/combinevalues_test.py" + "apache_beam/examples/snippets/transforms/aggregation/count_test.py" + "apache_beam/examples/snippets/transforms/aggregation/distinct_test.py" + "apache_beam/examples/snippets/transforms/aggregation/groupbykey_test.py" + "apache_beam/examples/snippets/transforms/aggregation/groupintobatches_test.py" + "apache_beam/examples/snippets/transforms/aggregation/latest_test.py" + "apache_beam/examples/snippets/transforms/aggregation/max_test.py" + "apache_beam/examples/snippets/transforms/aggregation/mean_test.py" + "apache_beam/examples/snippets/transforms/aggregation/min_test.py" + "apache_beam/examples/snippets/transforms/aggregation/sample_test.py" + "apache_beam/examples/snippets/transforms/aggregation/sum_test.py" + "apache_beam/examples/snippets/transforms/aggregation/tolist_test.py" + "apache_beam/examples/snippets/transforms/aggregation/top_test.py" + "apache_beam/examples/snippets/transforms/elementwise/filter_test.py" + "apache_beam/examples/snippets/transforms/elementwise/flatmap_test.py" + "apache_beam/examples/snippets/transforms/elementwise/keys_test.py" + "apache_beam/examples/snippets/transforms/elementwise/kvswap_test.py" + "apache_beam/examples/snippets/transforms/elementwise/map_test.py" + "apache_beam/examples/snippets/transforms/elementwise/pardo_test.py" + "apache_beam/examples/snippets/transforms/elementwise/partition_test.py" + "apache_beam/examples/snippets/transforms/elementwise/regex_test.py" + "apache_beam/examples/snippets/transforms/elementwise/tostring_test.py" + "apache_beam/examples/snippets/transforms/elementwise/values_test.py" + "apache_beam/examples/snippets/transforms/elementwise/withtimestamps_test.py" + "apache_beam/examples/snippets/transforms/other/create_test.py" + "apache_beam/examples/snippets/transforms/other/flatten_test.py" + "apache_beam/examples/snippets/transforms/other/window_test.py" + "apache_beam/examples/snippets/util_test.py" + "apache_beam/io/avroio_test.py" + "apache_beam/io/concat_source_test.py" + "apache_beam/io/filebasedsink_test.py" + "apache_beam/io/filebasedsource_test.py" + "apache_beam/io/fileio_test.py" + "apache_beam/io/mongodbio_test.py" + "apache_beam/io/parquetio_test.py" + "apache_beam/io/sources_test.py" + "apache_beam/io/textio_test.py" + "apache_beam/io/tfrecordio_test.py" + "apache_beam/metrics/metric_test.py" + "apache_beam/ml/inference/base_test.py" + "apache_beam/ml/inference/sklearn_inference_test.py" + "apache_beam/ml/inference/utils_test.py" + "apache_beam/ml/rag/chunking/base_test.py" + "apache_beam/ml/rag/ingestion/base_test.py" + "apache_beam/pipeline_test.py" + "apache_beam/runners/direct/direct_runner_test.py" + "apache_beam/runners/direct/sdf_direct_runner_test.py" + "apache_beam/runners/interactive/interactive_beam_test.py" + "apache_beam/runners/interactive/interactive_runner_test.py" + "apache_beam/runners/interactive/non_interactive_runner_test.py" + "apache_beam/runners/interactive/recording_manager_test.py" + "apache_beam/runners/portability/fn_api_runner/translations_test.py" + "apache_beam/runners/portability/fn_api_runner/trigger_manager_test.py" + "apache_beam/runners/portability/stager_test.py" + "apache_beam/testing/synthetic_pipeline_test.py" + "apache_beam/testing/test_stream_test.py" + "apache_beam/testing/util_test.py" + "apache_beam/transforms/combiners_test.py" + "apache_beam/transforms/core_test.py" + "apache_beam/transforms/create_test.py" + "apache_beam/transforms/deduplicate_test.py" + "apache_beam/transforms/periodicsequence_test.py" + "apache_beam/transforms/ptransform_test.py" + "apache_beam/transforms/sideinputs_test.py" + "apache_beam/transforms/stats_test.py" + "apache_beam/transforms/transforms_keyword_only_args_test.py" + "apache_beam/transforms/trigger_test.py" + "apache_beam/transforms/userstate_test.py" + "apache_beam/transforms/util_test.py" + "apache_beam/transforms/write_ptransform_test.py" - # FIXME AttributeError: 'Namespace' object has no attribute 'test_pipeline_options' - # Upstream issue https://github.com/apache/beam/issues/33853 - "apache_beam/runners/portability/prism_runner_test.py" + # FIXME AttributeError: 'Namespace' object has no attribute 'test_pipeline_options' + # Upstream issue https://github.com/apache/beam/issues/33853 + "apache_beam/runners/portability/prism_runner_test.py" - # FIXME ValueError: Unable to run pipeline with requirement: unsupported_requirement - # Upstream issuehttps://github.com/apache/beam/issues/33853 - "apache_beam/yaml/yaml_transform_scope_test.py" - "apache_beam/yaml/yaml_transform_test.py" - "apache_beam/yaml/yaml_transform_unit_test.py" - "apache_beam/yaml/yaml_udf_test.py" - "apache_beam/dataframe/frames_test.py" + # FIXME ValueError: Unable to run pipeline with requirement: unsupported_requirement + # Upstream issuehttps://github.com/apache/beam/issues/33853 + "apache_beam/yaml/yaml_transform_scope_test.py" + "apache_beam/yaml/yaml_transform_test.py" + "apache_beam/yaml/yaml_transform_unit_test.py" + "apache_beam/yaml/yaml_udf_test.py" + "apache_beam/dataframe/frames_test.py" - # FIXME Those tests do not terminate due to a grpc error (threading issue) - # grpc_status:14, grpc_message:"Cancelling all calls"}" - # Upstream issue https://github.com/apache/beam/issues/33851 - "apache_beam/runners/portability/portable_runner_test.py" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # > instruction = ofs_table[pc] - # E KeyError: 18 - "apache_beam/typehints/trivial_inference_test.py" - ]; + # FIXME Those tests do not terminate due to a grpc error (threading issue) + # grpc_status:14, grpc_message:"Cancelling all calls"}" + # Upstream issue https://github.com/apache/beam/issues/33851 + "apache_beam/runners/portability/portable_runner_test.py" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # > instruction = ofs_table[pc] + # E KeyError: 18 + "apache_beam/typehints/trivial_inference_test.py" + ]; - disabledTests = - [ - # IndexError: list index out of range - "test_only_sample_exceptions" + disabledTests = [ + # IndexError: list index out of range + "test_only_sample_exceptions" - # AssertionError: False is not true - "test_samples_all_with_both_experiments" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # PermissionError: [Errno 13] Permission denied: '/tmp/...' - "test_cache_manager_uses_local_ib_cache_root" - "test_describe_all_recordings" - "test_find_out_correct_user_pipeline" - "test_get_cache_manager_creates_cache_manager_if_absent" - "test_streaming_cache_uses_local_ib_cache_root" - "test_track_user_pipeline_cleanup_non_inspectable_pipeline" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # TypeError: Could not determine schema for type hint Any. - "test_batching_beam_row_input" - "test_auto_convert" - "test_unbatching_series" - "test_batching_beam_row_to_dataframe" + # AssertionError: False is not true + "test_samples_all_with_both_experiments" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # PermissionError: [Errno 13] Permission denied: '/tmp/...' + "test_cache_manager_uses_local_ib_cache_root" + "test_describe_all_recordings" + "test_find_out_correct_user_pipeline" + "test_get_cache_manager_creates_cache_manager_if_absent" + "test_streaming_cache_uses_local_ib_cache_root" + "test_track_user_pipeline_cleanup_non_inspectable_pipeline" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # TypeError: Could not determine schema for type hint Any. + "test_batching_beam_row_input" + "test_auto_convert" + "test_unbatching_series" + "test_batching_beam_row_to_dataframe" - # AssertionError: Any != - "test_pycallable_map" - "testAlwaysReturnsEarly" + # AssertionError: Any != + "test_pycallable_map" + "testAlwaysReturnsEarly" - # TypeError: Expected Iterator in return type annotatio - "test_get_output_batch_type" - ]; + # TypeError: Expected Iterator in return type annotatio + "test_get_output_batch_type" + ]; meta = { description = "Unified model for defining both batch and streaming data-parallel processing pipelines"; diff --git a/pkgs/development/python-modules/apischema/default.nix b/pkgs/development/python-modules/apischema/default.nix index 7ae1dcacd131..e30e9de5c916 100644 --- a/pkgs/development/python-modules/apischema/default.nix +++ b/pkgs/development/python-modules/apischema/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "apischema" ]; diff --git a/pkgs/development/python-modules/apispec/default.nix b/pkgs/development/python-modules/apispec/default.nix index ceaa36ddf330..94cd70020be0 100644 --- a/pkgs/development/python-modules/apispec/default.nix +++ b/pkgs/development/python-modules/apispec/default.nix @@ -35,13 +35,15 @@ buildPythonPackage rec { validation = [ openapi-spec-validator prance - ] ++ prance.optional-dependencies.osv; + ] + ++ prance.optional-dependencies.osv; }; nativeCheckInputs = [ mock pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "apispec" ]; diff --git a/pkgs/development/python-modules/apple-weatherkit/default.nix b/pkgs/development/python-modules/apple-weatherkit/default.nix index b934c5bb7b9a..a905a17654d7 100644 --- a/pkgs/development/python-modules/apple-weatherkit/default.nix +++ b/pkgs/development/python-modules/apple-weatherkit/default.nix @@ -29,7 +29,8 @@ buildPythonPackage rec { aiohttp aiohttp-retry pyjwt - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/appthreat-vulnerability-db/default.nix b/pkgs/development/python-modules/appthreat-vulnerability-db/default.nix index 4e04ffa40024..d2a54be37417 100644 --- a/pkgs/development/python-modules/appthreat-vulnerability-db/default.nix +++ b/pkgs/development/python-modules/appthreat-vulnerability-db/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { rich semver tabulate - ] ++ httpx.optional-dependencies.http2; + ] + ++ httpx.optional-dependencies.http2; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/apscheduler/default.nix b/pkgs/development/python-modules/apscheduler/default.nix index e221cf1ff7a9..ade71286799d 100644 --- a/pkgs/development/python-modules/apscheduler/default.nix +++ b/pkgs/development/python-modules/apscheduler/default.nix @@ -51,18 +51,17 @@ buildPythonPackage rec { twisted ]; - disabledTests = - [ - "test_broken_pool" - # gevent tests have issue on newer Python releases - "test_add_live_job" - "test_add_pending_job" - "test_shutdown" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_submit_job" - "test_max_instances" - ]; + disabledTests = [ + "test_broken_pool" + # gevent tests have issue on newer Python releases + "test_add_live_job" + "test_add_pending_job" + "test_shutdown" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_submit_job" + "test_max_instances" + ]; pythonImportsCheck = [ "apscheduler" ]; diff --git a/pkgs/development/python-modules/arelle/default.nix b/pkgs/development/python-modules/arelle/default.nix index 6348b5aa9d72..36429cc7fd47 100644 --- a/pkgs/development/python-modules/arelle/default.nix +++ b/pkgs/development/python-modules/arelle/default.nix @@ -83,7 +83,8 @@ buildPythonPackage rec { pyparsing python-dateutil regex - ] ++ lib.optionals gui [ tkinter ]; + ] + ++ lib.optionals gui [ tkinter ]; optional-dependencies = { crypto = [ pycryptodome ]; @@ -123,21 +124,21 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook boto3 - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' export HOME=$(mktemp -d) ''; - disabledTestPaths = - [ - "tests/integration_tests" - ] - ++ lib.optionals (!gui) [ - # these tests import tkinter - "tests/unit_tests/arelle/test_updater.py" - "tests/unit_tests/arelle/test_import.py" - ]; + disabledTestPaths = [ + "tests/integration_tests" + ] + ++ lib.optionals (!gui) [ + # these tests import tkinter + "tests/unit_tests/arelle/test_updater.py" + "tests/unit_tests/arelle/test_import.py" + ]; meta = { description = "Open source XBRL platform"; diff --git a/pkgs/development/python-modules/argilla/default.nix b/pkgs/development/python-modules/argilla/default.nix index 69ba771631ce..cc036c8c036c 100644 --- a/pkgs/development/python-modules/argilla/default.nix +++ b/pkgs/development/python-modules/argilla/default.nix @@ -110,32 +110,31 @@ buildPythonPackage rec { ]; optional-dependencies = { - server = - [ - aiofiles - aiosqlite - alembic - backoff - brotli-asgi - elasticsearch8 - fastapi - greenlet - luqum - opensearch-py - passlib - psutil - python-jose - python-multipart - pyyaml - scikit-learn - smart-open - sqlalchemy - uvicorn - ] - ++ elasticsearch8.optional-dependencies.async - ++ uvicorn.optional-dependencies.standard - ++ python-jose.optional-dependencies.cryptography - ++ passlib.optional-dependencies.bcrypt; + server = [ + aiofiles + aiosqlite + alembic + backoff + brotli-asgi + elasticsearch8 + fastapi + greenlet + luqum + opensearch-py + passlib + psutil + python-jose + python-multipart + pyyaml + scikit-learn + smart-open + sqlalchemy + uvicorn + ] + ++ elasticsearch8.optional-dependencies.async + ++ uvicorn.optional-dependencies.standard + ++ python-jose.optional-dependencies.cryptography + ++ passlib.optional-dependencies.bcrypt; postgresql = [ asyncpg psycopg2 @@ -165,7 +164,8 @@ buildPythonPackage rec { # span_marker # trl # spacy-huggingface-hub - ] ++ transformers.optional-dependencies.torch; + ] + ++ transformers.optional-dependencies.torch; }; # Still quite a bit of optional dependencies missing @@ -180,7 +180,8 @@ buildPythonPackage rec { pytest-mock pytest-asyncio factory-boy - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTestPaths = [ "tests/server/datasets/test_dao.py" ]; diff --git a/pkgs/development/python-modules/argparse-manpage/default.nix b/pkgs/development/python-modules/argparse-manpage/default.nix index 8900800c1bbc..73281ff48f95 100644 --- a/pkgs/development/python-modules/argparse-manpage/default.nix +++ b/pkgs/development/python-modules/argparse-manpage/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools packaging - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ tomli ]; diff --git a/pkgs/development/python-modules/aria2p/default.nix b/pkgs/development/python-modules/aria2p/default.nix index fe5977108255..9e74566eed8d 100644 --- a/pkgs/development/python-modules/aria2p/default.nix +++ b/pkgs/development/python-modules/aria2p/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { setuptools # for pkg_resources toml websocket-client - ] ++ lib.optionals withTui optional-dependencies.tui; + ] + ++ lib.optionals withTui optional-dependencies.tui; optional-dependencies = { tui = [ @@ -68,7 +69,8 @@ buildPythonPackage rec { responses psutil uvicorn - ] ++ optional-dependencies.tui; + ] + ++ optional-dependencies.tui; disabledTests = [ # require a running display server diff --git a/pkgs/development/python-modules/array-api-compat/default.nix b/pkgs/development/python-modules/array-api-compat/default.nix index 49ba3d13eb73..ad55ece79402 100644 --- a/pkgs/development/python-modules/array-api-compat/default.nix +++ b/pkgs/development/python-modules/array-api-compat/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { dask sparse array-api-strict - ] ++ lib.optionals cudaSupport [ cupy ]; + ] + ++ lib.optionals cudaSupport [ cupy ]; pythonImportsCheck = [ "array_api_compat" ]; diff --git a/pkgs/development/python-modules/array-record/default.nix b/pkgs/development/python-modules/array-record/default.nix index f5ada31de500..6cde9151bb55 100644 --- a/pkgs/development/python-modules/array-record/default.nix +++ b/pkgs/development/python-modules/array-record/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { dependencies = [ absl-py etils - ] ++ etils.optional-dependencies.epath; + ] + ++ etils.optional-dependencies.epath; pythonImportsCheck = [ "array_record" ]; diff --git a/pkgs/development/python-modules/ase/default.nix b/pkgs/development/python-modules/ase/default.nix index 09d2b92ffe7f..979cebb0d666 100644 --- a/pkgs/development/python-modules/ase/default.nix +++ b/pkgs/development/python-modules/ase/default.nix @@ -41,18 +41,17 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - flask - matplotlib - numpy - pillow - psycopg2 - scipy - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - tkinter - ]; + dependencies = [ + flask + matplotlib + numpy + pillow + psycopg2 + scipy + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + tkinter + ]; nativeCheckInputs = [ addBinToPathHook @@ -73,7 +72,8 @@ buildPythonPackage rec { "test_pw_input_write_nested_flat" # Did not raise DeprecationWarning "test_fix_scaled" # Did not raise UserWarning "test_ipi_protocol" # flaky - ] ++ lib.optionals (pythonAtLeast "3.12") [ "test_info_calculators" ]; + ] + ++ lib.optionals (pythonAtLeast "3.12") [ "test_info_calculators" ]; pythonImportsCheck = [ "ase" ]; diff --git a/pkgs/development/python-modules/asn1tools/default.nix b/pkgs/development/python-modules/asn1tools/default.nix index 627f899128d7..f03d39d05379 100644 --- a/pkgs/development/python-modules/asn1tools/default.nix +++ b/pkgs/development/python-modules/asn1tools/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { pytest-xdist pytestCheckHook versionCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); versionCheckProgramArg = "--version"; pythonImportsCheck = [ "asn1tools" ]; diff --git a/pkgs/development/python-modules/asteroid-filterbanks/default.nix b/pkgs/development/python-modules/asteroid-filterbanks/default.nix index 43c72c146c3c..bb956ea8e7c4 100644 --- a/pkgs/development/python-modules/asteroid-filterbanks/default.nix +++ b/pkgs/development/python-modules/asteroid-filterbanks/default.nix @@ -54,28 +54,27 @@ buildPythonPackage { scipy ]; - disabledTests = - [ - # RuntimeError: cannot cache function '__o_fold': no locator available for file - # '/nix/store/d1znhn1n48z2raj0j9zbz80hhg4k2shw-python3.12-librosa-0.10.2.post1/lib/python3.12/site-packages/librosa/core/notation.py' - "test_melgram_encoder" - "test_melscale" + disabledTests = [ + # RuntimeError: cannot cache function '__o_fold': no locator available for file + # '/nix/store/d1znhn1n48z2raj0j9zbz80hhg4k2shw-python3.12-librosa-0.10.2.post1/lib/python3.12/site-packages/librosa/core/notation.py' + "test_melgram_encoder" + "test_melscale" - # AssertionError: The values for attribute 'shape' do not match - "test_torch_stft" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Issue with JIT on darwin: - # RuntimeError: required keyword attribute 'value' has the wrong type - "test_jit_filterbanks" - "test_jit_filterbanks_enc" - "test_pcen_jit" - "test_stateful_pcen_jit" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Flaky: AssertionError: Tensor-likes are not close! - "test_fb_def_and_forward_lowdim" - ]; + # AssertionError: The values for attribute 'shape' do not match + "test_torch_stft" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Issue with JIT on darwin: + # RuntimeError: required keyword attribute 'value' has the wrong type + "test_jit_filterbanks" + "test_jit_filterbanks_enc" + "test_pcen_jit" + "test_stateful_pcen_jit" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Flaky: AssertionError: Tensor-likes are not close! + "test_fb_def_and_forward_lowdim" + ]; meta = { description = "PyTorch-based audio source separation toolkit for researchers"; diff --git a/pkgs/development/python-modules/astropy/default.nix b/pkgs/development/python-modules/astropy/default.nix index f7d90bbedd97..bb643c6742ea 100644 --- a/pkgs/development/python-modules/astropy/default.nix +++ b/pkgs/development/python-modules/astropy/default.nix @@ -98,30 +98,30 @@ buildPythonPackage rec { ipykernel # ipydatagrid pandas - ] ++ self.ipython; - all = - [ - certifi - dask - h5py - pyarrow - beautifulsoup4 - html5lib - sortedcontainers - pytz - jplephem - mpmath - asdf - asdf-astropy - bottleneck - fsspec - s3fs - ] - ++ self.recommended - ++ self.ipython - ++ self.jupyter - ++ dask.optional-dependencies.array - ++ fsspec.optional-dependencies.http; + ] + ++ self.ipython; + all = [ + certifi + dask + h5py + pyarrow + beautifulsoup4 + html5lib + sortedcontainers + pytz + jplephem + mpmath + asdf + asdf-astropy + bottleneck + fsspec + s3fs + ] + ++ self.recommended + ++ self.ipython + ++ self.jupyter + ++ dask.optional-dependencies.array + ++ fsspec.optional-dependencies.http; }); nativeCheckInputs = [ @@ -130,7 +130,8 @@ buildPythonPackage rec { pytest-astropy-header pytest-astropy threadpoolctl - ] ++ optional-dependencies.recommended; + ] + ++ optional-dependencies.recommended; pythonImportsCheck = [ "astropy" ]; diff --git a/pkgs/development/python-modules/async-upnp-client/default.nix b/pkgs/development/python-modules/async-upnp-client/default.nix index eeb46da90ca7..bd40593000fa 100644 --- a/pkgs/development/python-modules/async-upnp-client/default.nix +++ b/pkgs/development/python-modules/async-upnp-client/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { # socket.gaierror: [Errno -2] Name or service not known "test_async_get_local_ip" "test_get_local_ip" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_deferred_callback_url" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_deferred_callback_url" ]; disabledTestPaths = [ # Tries to bind to multicast socket and fails to find proper interface diff --git a/pkgs/development/python-modules/asyncssh/default.nix b/pkgs/development/python-modules/asyncssh/default.nix index 91c863124bed..adc123e7e013 100644 --- a/pkgs/development/python-modules/asyncssh/default.nix +++ b/pkgs/development/python-modules/asyncssh/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { openssh openssl pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); patches = [ # Reverts https://github.com/ronf/asyncssh/commit/4b3dec994b3aa821dba4db507030b569c3a32730 diff --git a/pkgs/development/python-modules/asyncua/default.nix b/pkgs/development/python-modules/asyncua/default.nix index 078be97adfb7..4102aa6bd30f 100644 --- a/pkgs/development/python-modules/asyncua/default.nix +++ b/pkgs/development/python-modules/asyncua/default.nix @@ -62,24 +62,23 @@ buildPythonPackage rec { pythonImportsCheck = [ "asyncua" ]; - disabledTests = - [ - # Failed: DID NOT RAISE - "test_publish" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # dbm.sqlite3.error: SQLite objects created in a thread can only be used in that same thread. - # The object was created in thread id 140737220687552 and this is thread id 140737343690560. - "test_runTest" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # OSError: [Errno 48] error while attempting to bind on address ('127.0.0.1',... - "test_anonymous_rejection" - "test_certificate_handling_success" - "test_encrypted_private_key_handling_success" - "test_encrypted_private_key_handling_success_with_cert_props" - "test_encrypted_private_key_handling_failure" - ]; + disabledTests = [ + # Failed: DID NOT RAISE + "test_publish" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # dbm.sqlite3.error: SQLite objects created in a thread can only be used in that same thread. + # The object was created in thread id 140737220687552 and this is thread id 140737343690560. + "test_runTest" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # OSError: [Errno 48] error while attempting to bind on address ('127.0.0.1',... + "test_anonymous_rejection" + "test_certificate_handling_success" + "test_encrypted_private_key_handling_success" + "test_encrypted_private_key_handling_success_with_cert_props" + "test_encrypted_private_key_handling_failure" + ]; meta = with lib; { description = "OPC UA / IEC 62541 Client and Server for Python"; diff --git a/pkgs/development/python-modules/asyncwhois/default.nix b/pkgs/development/python-modules/asyncwhois/default.nix index 70549885168b..c74ba0d38046 100644 --- a/pkgs/development/python-modules/asyncwhois/default.nix +++ b/pkgs/development/python-modules/asyncwhois/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { python-socks tldextract whodap - ] ++ python-socks.optional-dependencies.asyncio; + ] + ++ python-socks.optional-dependencies.asyncio; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/auth0-python/default.nix b/pkgs/development/python-modules/auth0-python/default.nix index 03ae0b1247c4..e2bf65ab02d8 100644 --- a/pkgs/development/python-modules/auth0-python/default.nix +++ b/pkgs/development/python-modules/auth0-python/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { pyopenssl requests urllib3 - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; nativeCheckInputs = [ aiohttp diff --git a/pkgs/development/python-modules/autobahn/default.nix b/pkgs/development/python-modules/autobahn/default.nix index 5b71a43facc0..9bb1ac4f3545 100644 --- a/pkgs/development/python-modules/autobahn/default.nix +++ b/pkgs/development/python-modules/autobahn/default.nix @@ -61,14 +61,13 @@ buildPythonPackage rec { txaio ]; - nativeCheckInputs = - [ - mock - pytest-asyncio - pytestCheckHook - ] - ++ optional-dependencies.scram - ++ optional-dependencies.serialization; + nativeCheckInputs = [ + mock + pytest-asyncio + pytestCheckHook + ] + ++ optional-dependencies.scram + ++ optional-dependencies.serialization; preCheck = '' # Run asyncio tests (requires twisted) diff --git a/pkgs/development/python-modules/avwx-engine/default.nix b/pkgs/development/python-modules/avwx-engine/default.nix index 2fadafe4fc22..f05c71a97493 100644 --- a/pkgs/development/python-modules/avwx-engine/default.nix +++ b/pkgs/development/python-modules/avwx-engine/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { pytest-cov-stub pytestCheckHook time-machine - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "avwx" ]; diff --git a/pkgs/development/python-modules/aws-xray-sdk/default.nix b/pkgs/development/python-modules/aws-xray-sdk/default.nix index afac3f4429ec..4b509361fb92 100644 --- a/pkgs/development/python-modules/aws-xray-sdk/default.nix +++ b/pkgs/development/python-modules/aws-xray-sdk/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { jsonpickle requests wrapt - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; nativeCheckInputs = [ aiohttp diff --git a/pkgs/development/python-modules/ax-platform/default.nix b/pkgs/development/python-modules/ax-platform/default.nix index c99f7ae07f99..96e9efae793e 100644 --- a/pkgs/development/python-modules/ax-platform/default.nix +++ b/pkgs/development/python-modules/ax-platform/default.nix @@ -82,30 +82,29 @@ buildPythonPackage rec { "ax/service/tests/test_with_db_settings_base.py" ]; - disabledTests = - [ - # sqlalchemy.exc.ArgumentError: Strings are not accepted for attribute names in loader options; please use class-bound attributes directly. - "SQAStoreUtilsTest" - "SQAStoreTest" + disabledTests = [ + # sqlalchemy.exc.ArgumentError: Strings are not accepted for attribute names in loader options; please use class-bound attributes directly. + "SQAStoreUtilsTest" + "SQAStoreTest" - # ValueError: `db_settings` argument should be of type ax.storage.sqa_store - "test_get_next_trials_with_db" + # ValueError: `db_settings` argument should be of type ax.storage.sqa_store + "test_get_next_trials_with_db" - # exact comparison of floating points - "test_optimize_l0_homotopy" - # AssertionError: 5 != 2 - "test_get_standard_plots_moo" - # AssertionError: Expected 'warning' to be called once. Called 3 times - "test_validate_kwarg_typing" - # uses torch.equal - "test_convert_observations" - # broken with sqlalchemy 2 - "test_sql_storage" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # flaky on x86 - "test_gen_with_expanded_parameter_space" - ]; + # exact comparison of floating points + "test_optimize_l0_homotopy" + # AssertionError: 5 != 2 + "test_get_standard_plots_moo" + # AssertionError: Expected 'warning' to be called once. Called 3 times + "test_validate_kwarg_typing" + # uses torch.equal + "test_convert_observations" + # broken with sqlalchemy 2 + "test_sql_storage" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # flaky on x86 + "test_gen_with_expanded_parameter_space" + ]; pythonImportsCheck = [ "ax" ]; diff --git a/pkgs/development/python-modules/azure-core/default.nix b/pkgs/development/python-modules/azure-core/default.nix index 273c58f0e720..6bcdd65876ef 100644 --- a/pkgs/development/python-modules/azure-core/default.nix +++ b/pkgs/development/python-modules/azure-core/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { pytest-asyncio pytestCheckHook trio - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # test server needs to be available preCheck = '' @@ -76,7 +77,8 @@ buildPythonPackage rec { # disable 8 tests failing on some darwin machines with errors: # azure.core.polling.base_polling.BadStatus: Invalid return status 403 for 'GET' operation # azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Forbidden' - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "location_polling_fail" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "location_polling_fail" ]; disabledTestPaths = [ # requires testing modules which aren't published, and likely to create cyclic dependencies diff --git a/pkgs/development/python-modules/azure-cosmosdb-table/default.nix b/pkgs/development/python-modules/azure-cosmosdb-table/default.nix index 3f68e661f6c0..4acf29beda33 100644 --- a/pkgs/development/python-modules/azure-cosmosdb-table/default.nix +++ b/pkgs/development/python-modules/azure-cosmosdb-table/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { azure-common azure-storage-common azure-cosmosdb-nspkg - ] ++ lib.optionals (!isPy3k) [ futures ]; + ] + ++ lib.optionals (!isPy3k) [ futures ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-kusto-data/default.nix b/pkgs/development/python-modules/azure-kusto-data/default.nix index d504b01fc559..9ef5b0b7d97c 100644 --- a/pkgs/development/python-modules/azure-kusto-data/default.nix +++ b/pkgs/development/python-modules/azure-kusto-data/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "azure.kusto.data" ]; diff --git a/pkgs/development/python-modules/azure-kusto-ingest/default.nix b/pkgs/development/python-modules/azure-kusto-ingest/default.nix index 13a9e05f60dd..b9aa9fac7f94 100644 --- a/pkgs/development/python-modules/azure-kusto-ingest/default.nix +++ b/pkgs/development/python-modules/azure-kusto-ingest/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { pytest-asyncio pytestCheckHook responses - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "azure.kusto.ingest" ]; diff --git a/pkgs/development/python-modules/azure-mgmt-advisor/default.nix b/pkgs/development/python-modules/azure-mgmt-advisor/default.nix index e73f36518d56..9ea2d0267b64 100644 --- a/pkgs/development/python-modules/azure-mgmt-advisor/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-advisor/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-appcontainers/default.nix b/pkgs/development/python-modules/azure-mgmt-appcontainers/default.nix index 7ca15411aa33..9ea903c3c21d 100644 --- a/pkgs/development/python-modules/azure-mgmt-appcontainers/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-appcontainers/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { azure-common azure-mgmt-core isodate - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; # no tests included doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-applicationinsights/default.nix b/pkgs/development/python-modules/azure-mgmt-applicationinsights/default.nix index fb20a442461c..5d0c79348065 100644 --- a/pkgs/development/python-modules/azure-mgmt-applicationinsights/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-applicationinsights/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { azure-mgmt-core msrest msrestazure - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; pythonNamespaces = [ "azure.mgmt" ]; diff --git a/pkgs/development/python-modules/azure-mgmt-authorization/default.nix b/pkgs/development/python-modules/azure-mgmt-authorization/default.nix index 52c94964f570..7ba940147623 100644 --- a/pkgs/development/python-modules/azure-mgmt-authorization/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-authorization/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-batchai/default.nix b/pkgs/development/python-modules/azure-mgmt-batchai/default.nix index cd28585ae7d6..8eeed30924e5 100644 --- a/pkgs/development/python-modules/azure-mgmt-batchai/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-batchai/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { isodate azure-common azure-mgmt-core - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; pythonNamespaces = [ "azure.mgmt" ]; diff --git a/pkgs/development/python-modules/azure-mgmt-datamigration/default.nix b/pkgs/development/python-modules/azure-mgmt-datamigration/default.nix index 40f0d07e00de..05be9316577f 100644 --- a/pkgs/development/python-modules/azure-mgmt-datamigration/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-datamigration/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; pythonNamespaces = [ "azure.mgmt" ]; diff --git a/pkgs/development/python-modules/azure-mgmt-devtestlabs/default.nix b/pkgs/development/python-modules/azure-mgmt-devtestlabs/default.nix index dab22d1e065c..1c1dd7a62634 100644 --- a/pkgs/development/python-modules/azure-mgmt-devtestlabs/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-devtestlabs/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; pythonNamespaces = [ "azure.mgmt" ]; diff --git a/pkgs/development/python-modules/azure-mgmt-hanaonazure/default.nix b/pkgs/development/python-modules/azure-mgmt-hanaonazure/default.nix index 02457ba264ef..f487f25cae62 100644 --- a/pkgs/development/python-modules/azure-mgmt-hanaonazure/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-hanaonazure/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-iotcentral/default.nix b/pkgs/development/python-modules/azure-mgmt-iotcentral/default.nix index 4d7ffa9c36f4..bce692fb53c0 100644 --- a/pkgs/development/python-modules/azure-mgmt-iotcentral/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-iotcentral/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { azure-mgmt-core msrest msrestazure - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-iothub/default.nix b/pkgs/development/python-modules/azure-mgmt-iothub/default.nix index fbf2da2f1c13..fee59741d9d1 100644 --- a/pkgs/development/python-modules/azure-mgmt-iothub/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-iothub/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { azure-common azure-mgmt-core isodate - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-managementgroups/default.nix b/pkgs/development/python-modules/azure-mgmt-managementgroups/default.nix index 52c5f380740a..45132e178448 100644 --- a/pkgs/development/python-modules/azure-mgmt-managementgroups/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-managementgroups/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-maps/default.nix b/pkgs/development/python-modules/azure-mgmt-maps/default.nix index 2f7dbd1209a2..d4eb41d58de5 100644 --- a/pkgs/development/python-modules/azure-mgmt-maps/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-maps/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { azure-common azure-mgmt-core msrest - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; pythonNamespaces = [ "azure.mgmt" ]; diff --git a/pkgs/development/python-modules/azure-mgmt-marketplaceordering/default.nix b/pkgs/development/python-modules/azure-mgmt-marketplaceordering/default.nix index 4f2dd1ff04a1..eac997e7c718 100644 --- a/pkgs/development/python-modules/azure-mgmt-marketplaceordering/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-marketplaceordering/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-monitor/default.nix b/pkgs/development/python-modules/azure-mgmt-monitor/default.nix index 1a75b23ccc85..6ce2643655de 100644 --- a/pkgs/development/python-modules/azure-mgmt-monitor/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-monitor/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { isodate azure-common azure-mgmt-core - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; pythonNamespaces = [ "azure.mgmt" ]; diff --git a/pkgs/development/python-modules/azure-mgmt-policyinsights/default.nix b/pkgs/development/python-modules/azure-mgmt-policyinsights/default.nix index a7365e27bd8e..cb9642f45f87 100644 --- a/pkgs/development/python-modules/azure-mgmt-policyinsights/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-policyinsights/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { azure-mgmt-core msrest msrestazure - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-rdbms/default.nix b/pkgs/development/python-modules/azure-mgmt-rdbms/default.nix index dc10601bb662..cd82f140007a 100644 --- a/pkgs/development/python-modules/azure-mgmt-rdbms/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-rdbms/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { azure-mgmt-core msrest msrestazure - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-recoveryservices/default.nix b/pkgs/development/python-modules/azure-mgmt-recoveryservices/default.nix index 414fcce92ab1..314938116ddc 100644 --- a/pkgs/development/python-modules/azure-mgmt-recoveryservices/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-recoveryservices/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { azure-common azure-mgmt-core isodate - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-redis/default.nix b/pkgs/development/python-modules/azure-mgmt-redis/default.nix index 4fe7c67670a4..cb8567f4183f 100644 --- a/pkgs/development/python-modules/azure-mgmt-redis/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-redis/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { isodate azure-common azure-mgmt-core - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-reservations/default.nix b/pkgs/development/python-modules/azure-mgmt-reservations/default.nix index d88fccddc20c..b37871080857 100644 --- a/pkgs/development/python-modules/azure-mgmt-reservations/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-reservations/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { msrest azure-common azure-mgmt-core - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-search/default.nix b/pkgs/development/python-modules/azure-mgmt-search/default.nix index ebdfda97592a..7a8b87c32bb6 100644 --- a/pkgs/development/python-modules/azure-mgmt-search/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-search/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { azure-common azure-mgmt-core isodate - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-sql/default.nix b/pkgs/development/python-modules/azure-mgmt-sql/default.nix index 83e45b54a9bb..ddf8cec9fcc0 100644 --- a/pkgs/development/python-modules/azure-mgmt-sql/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-sql/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-subscription/default.nix b/pkgs/development/python-modules/azure-mgmt-subscription/default.nix index ad45a8015587..8c3836cf89f5 100644 --- a/pkgs/development/python-modules/azure-mgmt-subscription/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-subscription/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { azure-mgmt-core msrest msrestazure - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-mgmt-trafficmanager/default.nix b/pkgs/development/python-modules/azure-mgmt-trafficmanager/default.nix index acccaba91bff..de63f5430b2b 100644 --- a/pkgs/development/python-modules/azure-mgmt-trafficmanager/default.nix +++ b/pkgs/development/python-modules/azure-mgmt-trafficmanager/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { msrestazure azure-common azure-mgmt-core - ] ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; + ] + ++ lib.optionals (!isPy3k) [ azure-mgmt-nspkg ]; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-storage-common/default.nix b/pkgs/development/python-modules/azure-storage-common/default.nix index 7f5b602dad16..d426fb577a72 100644 --- a/pkgs/development/python-modules/azure-storage-common/default.nix +++ b/pkgs/development/python-modules/azure-storage-common/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { cryptography python-dateutil requests - ] ++ lib.optional (!isPy3k) azure-storage-nspkg; + ] + ++ lib.optional (!isPy3k) azure-storage-nspkg; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/azure-storage-file/default.nix b/pkgs/development/python-modules/azure-storage-file/default.nix index 97ad54fda704..b7f810b6f107 100644 --- a/pkgs/development/python-modules/azure-storage-file/default.nix +++ b/pkgs/development/python-modules/azure-storage-file/default.nix @@ -21,7 +21,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ azure-common azure-storage-common - ] ++ lib.optional (!isPy3k) futures; + ] + ++ lib.optional (!isPy3k) futures; # has no tests doCheck = false; diff --git a/pkgs/development/python-modules/b2sdk/default.nix b/pkgs/development/python-modules/b2sdk/default.nix index 33208a016953..6495d9755f82 100644 --- a/pkgs/development/python-modules/b2sdk/default.nix +++ b/pkgs/development/python-modules/b2sdk/default.nix @@ -35,22 +35,22 @@ buildPythonPackage rec { build-system = [ pdm-backend ]; - dependencies = - [ - annotated-types - packaging - logfury - requests - ] - ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ] - ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; + dependencies = [ + annotated-types + packaging + logfury + requests + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ] + ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; nativeCheckInputs = [ pytest-lazy-fixtures pytest-mock pytestCheckHook tqdm - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ glibcLocales ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ glibcLocales ]; disabledTestPaths = [ # requires aws s3 auth diff --git a/pkgs/development/python-modules/babel/default.nix b/pkgs/development/python-modules/babel/default.nix index e8ee122cde0c..7d6bb52b5b63 100644 --- a/pkgs/development/python-modules/babel/default.nix +++ b/pkgs/development/python-modules/babel/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { pytestCheckHook # https://github.com/python-babel/babel/issues/988#issuecomment-1521765563 pytz - ] ++ lib.optionals isPyPy [ tzdata ]; + ] + ++ lib.optionals isPyPy [ tzdata ]; disabledTests = [ # fails on days switching from and to daylight saving time in EST diff --git a/pkgs/development/python-modules/bambi/default.nix b/pkgs/development/python-modules/bambi/default.nix index a93b495bd481..8c80e22a62ef 100644 --- a/pkgs/development/python-modules/bambi/default.nix +++ b/pkgs/development/python-modules/bambi/default.nix @@ -62,56 +62,55 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; - disabledTests = - [ - # ValueError: dtype attribute is not a valid dtype instance - "test_vonmises_regression" + disabledTests = [ + # ValueError: dtype attribute is not a valid dtype instance + "test_vonmises_regression" - # AssertionError: assert ( Size: 1B\narray(False) & Size: 1B\narray(False)) - # https://github.com/bambinos/bambi/issues/888 - "test_beta_regression" + # AssertionError: assert ( Size: 1B\narray(False) & Size: 1B\narray(False)) + # https://github.com/bambinos/bambi/issues/888 + "test_beta_regression" - # Tests require network access - "test_alias_equal_to_name" - "test_average_by" - "test_ax" - "test_basic" - "test_censored_response" - "test_custom_prior" - "test_data_is_copied" - "test_distributional_model" - "test_elasticity" - "test_extra_namespace" - "test_fig_kwargs" - "test_gamma_with_splines" - "test_group_effects" - "test_hdi_prob" - "test_legend" - "test_model_with_group_specific_effects" - "test_model_with_intercept" - "test_model_without_intercept" - "test_non_distributional_model" - "test_normal_with_splines" - "test_predict_new_groups_fail" - "test_predict_new_groups" - "test_predict_offset" - "test_set_alias_warnings" - "test_subplot_kwargs" - "test_transforms" - "test_use_hdi" - "test_with_group_and_panel" - "test_with_groups" - "test_with_user_values" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # Python crash (in matplotlib) - # Fatal Python error: Aborted - "test_categorical_response" - "test_multiple_hsgp_and_by" - "test_multiple_outputs_with_alias" - "test_plot_priors" - "test_term_transformations" - ]; + # Tests require network access + "test_alias_equal_to_name" + "test_average_by" + "test_ax" + "test_basic" + "test_censored_response" + "test_custom_prior" + "test_data_is_copied" + "test_distributional_model" + "test_elasticity" + "test_extra_namespace" + "test_fig_kwargs" + "test_gamma_with_splines" + "test_group_effects" + "test_hdi_prob" + "test_legend" + "test_model_with_group_specific_effects" + "test_model_with_intercept" + "test_model_without_intercept" + "test_non_distributional_model" + "test_normal_with_splines" + "test_predict_new_groups_fail" + "test_predict_new_groups" + "test_predict_offset" + "test_set_alias_warnings" + "test_subplot_kwargs" + "test_transforms" + "test_use_hdi" + "test_with_group_and_panel" + "test_with_groups" + "test_with_user_values" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # Python crash (in matplotlib) + # Fatal Python error: Aborted + "test_categorical_response" + "test_multiple_hsgp_and_by" + "test_multiple_outputs_with_alias" + "test_plot_priors" + "test_term_transformations" + ]; disabledTestPaths = [ # bayeux-ml is not available diff --git a/pkgs/development/python-modules/banks/default.nix b/pkgs/development/python-modules/banks/default.nix index 9df5c7b12761..59417bda2e50 100644 --- a/pkgs/development/python-modules/banks/default.nix +++ b/pkgs/development/python-modules/banks/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "banks" ]; diff --git a/pkgs/development/python-modules/basedmypy/default.nix b/pkgs/development/python-modules/basedmypy/default.nix index 16bde590a3f7..47d305414edd 100644 --- a/pkgs/development/python-modules/basedmypy/default.nix +++ b/pkgs/development/python-modules/basedmypy/default.nix @@ -55,13 +55,15 @@ buildPythonPackage rec { types-psutil types-setuptools typing-extensions - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; dependencies = [ basedtyping mypy-extensions typing-extensions - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; optional-dependencies = { dmypy = [ psutil ]; @@ -76,19 +78,18 @@ buildPythonPackage rec { # when testing reduce optimisation level to reduce build time by 20% env.MYPYC_OPT_LEVEL = 1; - pythonImportsCheck = - [ - "mypy" - "mypy.api" - "mypy.fastparse" - "mypy.types" - "mypyc" - "mypyc.analysis" - ] - ++ lib.optionals (!stdenv.hostPlatform.isi686) [ - # ImportError: cannot import name 'map_instance_to_supertype' from partially initialized module 'mypy.maptype' (most likely due to a circular import) - "mypy.report" - ]; + pythonImportsCheck = [ + "mypy" + "mypy.api" + "mypy.fastparse" + "mypy.types" + "mypyc" + "mypyc.analysis" + ] + ++ lib.optionals (!stdenv.hostPlatform.isi686) [ + # ImportError: cannot import name 'map_instance_to_supertype' from partially initialized module 'mypy.maptype' (most likely due to a circular import) + "mypy.report" + ]; nativeCheckInputs = [ attrs @@ -97,7 +98,8 @@ buildPythonPackage rec { pytestCheckHook setuptools tomli - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = lib.optionals (pythonAtLeast "3.12") [ # cannot find distutils, and distutils cannot find types @@ -105,20 +107,19 @@ buildPythonPackage rec { "test_c_unit_test" ]; - disabledTestPaths = - [ - # fails to find typing_extensions - "mypy/test/testcmdline.py" - "mypy/test/testdaemon.py" - # fails to find setuptools - "mypyc/test/test_commandline.py" - # fails to find hatchling - "mypy/test/testpep561.py" - ] - ++ lib.optionals stdenv.hostPlatform.isi686 [ - # https://github.com/python/mypy/issues/15221 - "mypyc/test/test_run.py" - ]; + disabledTestPaths = [ + # fails to find typing_extensions + "mypy/test/testcmdline.py" + "mypy/test/testdaemon.py" + # fails to find setuptools + "mypyc/test/test_commandline.py" + # fails to find hatchling + "mypy/test/testpep561.py" + ] + ++ lib.optionals stdenv.hostPlatform.isi686 [ + # https://github.com/python/mypy/issues/15221 + "mypyc/test/test_run.py" + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/development/python-modules/bc-detect-secrets/default.nix b/pkgs/development/python-modules/bc-detect-secrets/default.nix index 121b8aa206f1..7b2ac902c50e 100644 --- a/pkgs/development/python-modules/bc-detect-secrets/default.nix +++ b/pkgs/development/python-modules/bc-detect-secrets/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { pkgs.gitMinimal pytestCheckHook responses - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export HOME=$(mktemp -d); diff --git a/pkgs/development/python-modules/beaker/default.nix b/pkgs/development/python-modules/beaker/default.nix index 1b37178ff23a..1549b07e73bf 100644 --- a/pkgs/development/python-modules/beaker/default.nix +++ b/pkgs/development/python-modules/beaker/default.nix @@ -34,16 +34,15 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - sqlalchemy - pycrypto - cryptography - ] - ++ lib.optionals (isPy27) [ - funcsigs - pycryptopp - ]; + dependencies = [ + sqlalchemy + pycrypto + cryptography + ] + ++ lib.optionals (isPy27) [ + funcsigs + pycryptopp + ]; nativeCheckInputs = [ glibcLocales diff --git a/pkgs/development/python-modules/beanhub-cli/default.nix b/pkgs/development/python-modules/beanhub-cli/default.nix index a5f907098e8e..c9a1f7abe3c8 100644 --- a/pkgs/development/python-modules/beanhub-cli/default.nix +++ b/pkgs/development/python-modules/beanhub-cli/default.nix @@ -71,7 +71,8 @@ buildPythonPackage rec { rich starlette-wtf uvicorn - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); optional-dependencies = { login = [ @@ -97,7 +98,8 @@ buildPythonPackage rec { pytest-httpx pytest-mock pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "beanhub_cli" ]; diff --git a/pkgs/development/python-modules/beartype/default.nix b/pkgs/development/python-modules/beartype/default.nix index 553166812192..2873b74ba566 100644 --- a/pkgs/development/python-modules/beartype/default.nix +++ b/pkgs/development/python-modules/beartype/default.nix @@ -29,15 +29,14 @@ buildPythonPackage rec { pythonImportsCheck = [ "beartype" ]; - disabledTests = - [ - # No warnings of type (,) were emitted. - "test_is_hint_pep593_beartype" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # this test is not run upstream, and broke in 3.13 (_nparams removed) - "test_door_is_subhint" - ]; + disabledTests = [ + # No warnings of type (,) were emitted. + "test_is_hint_pep593_beartype" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # this test is not run upstream, and broke in 3.13 (_nparams removed) + "test_door_is_subhint" + ]; meta = { description = "Fast runtime type checking for Python"; diff --git a/pkgs/development/python-modules/beautifulsoup4/default.nix b/pkgs/development/python-modules/beautifulsoup4/default.nix index 0a082bd424d7..9ca243d6f6f1 100644 --- a/pkgs/development/python-modules/beautifulsoup4/default.nix +++ b/pkgs/development/python-modules/beautifulsoup4/default.nix @@ -76,7 +76,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # fail with latest libxml, by not actually rejecting diff --git a/pkgs/development/python-modules/bellows/default.nix b/pkgs/development/python-modules/bellows/default.nix index 7cd27ab5055b..1add761ff739 100644 --- a/pkgs/development/python-modules/bellows/default.nix +++ b/pkgs/development/python-modules/bellows/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { click-log voluptuous zigpy - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/bentoml/default.nix b/pkgs/development/python-modules/bentoml/default.nix index 5e5f868b6bf6..57bbfbf1e6c1 100644 --- a/pkgs/development/python-modules/bentoml/default.nix +++ b/pkgs/development/python-modules/bentoml/default.nix @@ -112,11 +112,12 @@ let tracing-otlp tracing ; - triton = - [ tritonclient ] - ++ lib.optionals stdenv.hostPlatform.isLinux ( - tritonclient.optional-dependencies.http ++ tritonclient.optional-dependencies.grpc - ); + triton = [ + tritonclient + ] + ++ lib.optionals stdenv.hostPlatform.isLinux ( + tritonclient.optional-dependencies.http ++ tritonclient.optional-dependencies.grpc + ); }; src = fetchFromGitHub { @@ -191,7 +192,8 @@ buildPythonPackage { uv uvicorn watchfiles - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; inherit optional-dependencies; @@ -224,7 +226,8 @@ buildPythonPackage { pytest-xdist pytestCheckHook scikit-learn - ] ++ optional-dependencies.grpc; + ] + ++ optional-dependencies.grpc; meta = with lib; { description = "Build Production-Grade AI Applications"; diff --git a/pkgs/development/python-modules/betterproto/default.nix b/pkgs/development/python-modules/betterproto/default.nix index 5dc412400f05..bf759e8f1f58 100644 --- a/pkgs/development/python-modules/betterproto/default.nix +++ b/pkgs/development/python-modules/betterproto/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { pytest-mock pytest7CheckHook tomlkit - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "betterproto" ]; diff --git a/pkgs/development/python-modules/bimmer-connected/default.nix b/pkgs/development/python-modules/bimmer-connected/default.nix index c9dde5e3ede0..8f099b273ac7 100644 --- a/pkgs/development/python-modules/bimmer-connected/default.nix +++ b/pkgs/development/python-modules/bimmer-connected/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { pytestCheckHook respx time-machine - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # presumably regressed in pytest-asyncio 0.23.0 diff --git a/pkgs/development/python-modules/biosppy/default.nix b/pkgs/development/python-modules/biosppy/default.nix index 0e739754692c..b47e9efba4b2 100644 --- a/pkgs/development/python-modules/biosppy/default.nix +++ b/pkgs/development/python-modules/biosppy/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { joblib pywavelets mock - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ tkinter ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ tkinter ]; doCheck = false; # no tests diff --git a/pkgs/development/python-modules/black/default.nix b/pkgs/development/python-modules/black/default.nix index 3bc806517864..2dbdeb9906af 100644 --- a/pkgs/development/python-modules/black/default.nix +++ b/pkgs/development/python-modules/black/default.nix @@ -41,18 +41,17 @@ buildPythonPackage rec { hatchling ]; - propagatedBuildInputs = - [ - click - mypy-extensions - packaging - pathspec - platformdirs - ] - ++ lib.optionals (pythonOlder "3.11") [ - tomli - typing-extensions - ]; + propagatedBuildInputs = [ + click + mypy-extensions + packaging + pathspec + platformdirs + ] + ++ lib.optionals (pythonOlder "3.11") [ + tomli + typing-extensions + ]; optional-dependencies = { colorama = [ colorama ]; @@ -71,40 +70,39 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook parameterized - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlags = [ "-Wignore::DeprecationWarning" ]; - preCheck = - '' - export PATH="$PATH:$out/bin" + preCheck = '' + export PATH="$PATH:$out/bin" - # The top directory /build matches black's DEFAULT_EXCLUDE regex. - # Make /build the project root for black tests to avoid excluding files. - touch ../.git - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Work around https://github.com/psf/black/issues/2105 - export TMPDIR="/tmp" - ''; + # The top directory /build matches black's DEFAULT_EXCLUDE regex. + # Make /build the project root for black tests to avoid excluding files. + touch ../.git + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Work around https://github.com/psf/black/issues/2105 + export TMPDIR="/tmp" + ''; - disabledTests = - [ - # requires network access - "test_gen_check_output" - # broken on Python 3.13.4 - # FIXME: remove this when fixed upstream - "test_simple_format[pep_701]" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fails on darwin - "test_expression_diff" - # Fail on Hydra, see https://github.com/NixOS/nixpkgs/pull/130785 - "test_bpo_2142_workaround" - "test_skip_magic_trailing_comma" - ]; + disabledTests = [ + # requires network access + "test_gen_check_output" + # broken on Python 3.13.4 + # FIXME: remove this when fixed upstream + "test_simple_format[pep_701]" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fails on darwin + "test_expression_diff" + # Fail on Hydra, see https://github.com/NixOS/nixpkgs/pull/130785 + "test_bpo_2142_workaround" + "test_skip_magic_trailing_comma" + ]; # multiple tests exceed max open files on hydra builders doCheck = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64); diff --git a/pkgs/development/python-modules/blackjax/default.nix b/pkgs/development/python-modules/blackjax/default.nix index e982cfcd9c23..1a0b0da52e03 100644 --- a/pkgs/development/python-modules/blackjax/default.nix +++ b/pkgs/development/python-modules/blackjax/default.nix @@ -61,27 +61,26 @@ buildPythonPackage rec { "tests/mcmc/test_integrators.py" ]; - disabledTests = - [ - # too slow - "test_adaptive_tempered_smc" + disabledTests = [ + # too slow + "test_adaptive_tempered_smc" - # AssertionError on numerical values - "test_barker" - "test_mclmc" - "test_mcse4" - "test_normal_univariate" - "test_nuts__with_device" - "test_nuts__with_jit" - "test_nuts__without_device" - "test_nuts__without_jit" - "test_smc_waste_free__with_jit" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Numerical test (AssertionError) - # https://github.com/blackjax-devs/blackjax/issues/668 - "test_chees_adaptation" - ]; + # AssertionError on numerical values + "test_barker" + "test_mclmc" + "test_mcse4" + "test_normal_univariate" + "test_nuts__with_device" + "test_nuts__with_jit" + "test_nuts__without_device" + "test_nuts__without_jit" + "test_smc_waste_free__with_jit" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Numerical test (AssertionError) + # https://github.com/blackjax-devs/blackjax/issues/668 + "test_chees_adaptation" + ]; pythonImportsCheck = [ "blackjax" ]; diff --git a/pkgs/development/python-modules/blocksat-cli/default.nix b/pkgs/development/python-modules/blocksat-cli/default.nix index 3646a9d7124a..ef15124e548a 100644 --- a/pkgs/development/python-modules/blocksat-cli/default.nix +++ b/pkgs/development/python-modules/blocksat-cli/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { python-gnupg qrcode requests - ] ++ lib.optionals (pythonAtLeast "3.12") [ pyasyncore ]; + ] + ++ lib.optionals (pythonAtLeast "3.12") [ pyasyncore ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/blosc2/default.nix b/pkgs/development/python-modules/blosc2/default.nix index 922e0729ed8d..638ee54f12e7 100644 --- a/pkgs/development/python-modules/blosc2/default.nix +++ b/pkgs/development/python-modules/blosc2/default.nix @@ -72,7 +72,8 @@ buildPythonPackage rec { nativeCheckInputs = [ psutil pytestCheckHook - ] ++ lib.optionals runTorchTests [ torch ]; + ] + ++ lib.optionals runTorchTests [ torch ]; passthru.c-blosc2 = c-blosc2; diff --git a/pkgs/development/python-modules/bork/default.nix b/pkgs/development/python-modules/bork/default.nix index cd6220610bab..ca8aa97d37c8 100644 --- a/pkgs/development/python-modules/bork/default.nix +++ b/pkgs/development/python-modules/bork/default.nix @@ -38,16 +38,15 @@ buildPythonPackage rec { "urllib3" ]; - dependencies = - [ - build - coloredlogs - packaging - pip - urllib3 - ] - ++ lib.optionals (pythonOlder "3.11") [ toml ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + dependencies = [ + build + coloredlogs + packaging + pip + urllib3 + ] + ++ lib.optionals (pythonOlder "3.11") [ toml ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; pythonImportsCheck = [ "bork" diff --git a/pkgs/development/python-modules/botorch/default.nix b/pkgs/development/python-modules/botorch/default.nix index d1ba33b5664d..6bc5764d2fe9 100644 --- a/pkgs/development/python-modules/botorch/default.nix +++ b/pkgs/development/python-modules/botorch/default.nix @@ -47,31 +47,30 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - "test_all_cases_covered" + disabledTests = [ + "test_all_cases_covered" - # Skip tests that take too much time - "TestQMultiObjectivePredictiveEntropySearch" - "TestQPredictiveEntropySearch" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # RuntimeError: Boolean value of Tensor with more than one value is ambiguous - "test_optimize_acqf_mixed_binary_only" - ] - ++ lib.optionals (stdenv.buildPlatform.system == "x86_64-linux") [ - # stuck tests on hydra - "test_moo_predictive_entropy_search" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # RuntimeError: required keyword attribute 'value' has the wrong type - "test_posterior_in_trace_mode" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # Numerical error slightly above threshold - # AssertionError: Tensor-likes are not close! - "test_model_list_gpytorch_model" - ]; + # Skip tests that take too much time + "TestQMultiObjectivePredictiveEntropySearch" + "TestQPredictiveEntropySearch" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # RuntimeError: Boolean value of Tensor with more than one value is ambiguous + "test_optimize_acqf_mixed_binary_only" + ] + ++ lib.optionals (stdenv.buildPlatform.system == "x86_64-linux") [ + # stuck tests on hydra + "test_moo_predictive_entropy_search" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # RuntimeError: required keyword attribute 'value' has the wrong type + "test_posterior_in_trace_mode" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # Numerical error slightly above threshold + # AssertionError: Tensor-likes are not close! + "test_model_list_gpytorch_model" + ]; pythonImportsCheck = [ "botorch" ]; diff --git a/pkgs/development/python-modules/bottle/default.nix b/pkgs/development/python-modules/bottle/default.nix index 207e2059903e..5d7a8d100f24 100644 --- a/pkgs/development/python-modules/bottle/default.nix +++ b/pkgs/development/python-modules/bottle/default.nix @@ -25,21 +25,20 @@ buildPythonPackage rec { cd test ''; - disabledTests = - [ - "test_delete_cookie" - "test_error" - "test_error_in_generator_callback" - # timing sensitive - "test_ims" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # https://github.com/bottlepy/bottle/issues/1422 - # ModuleNotFoundError: No module named 'bottle.ext' - "test_data_import" - "test_direkt_import" - "test_from_import" - ]; + disabledTests = [ + "test_delete_cookie" + "test_error" + "test_error_in_generator_callback" + # timing sensitive + "test_ims" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # https://github.com/bottlepy/bottle/issues/1422 + # ModuleNotFoundError: No module named 'bottle.ext' + "test_data_import" + "test_direkt_import" + "test_from_import" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/bpython/default.nix b/pkgs/development/python-modules/bpython/default.nix index 51656522a36b..4635e357d368 100644 --- a/pkgs/development/python-modules/bpython/default.nix +++ b/pkgs/development/python-modules/bpython/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "bpython" ]; diff --git a/pkgs/development/python-modules/bravado-core/default.nix b/pkgs/development/python-modules/bravado-core/default.nix index d58dfebd9c4f..59c8d3342852 100644 --- a/pkgs/development/python-modules/bravado-core/default.nix +++ b/pkgs/development/python-modules/bravado-core/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { swagger-spec-validator pytz msgpack - ] ++ jsonschema.optional-dependencies.format-nongpl; + ] + ++ jsonschema.optional-dependencies.format-nongpl; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/breezy/default.nix b/pkgs/development/python-modules/breezy/default.nix index 67a8ff0b944c..a46d611f18ea 100644 --- a/pkgs/development/python-modules/breezy/default.nix +++ b/pkgs/development/python-modules/breezy/default.nix @@ -60,20 +60,19 @@ buildPythonPackage rec { buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; - propagatedBuildInputs = - [ - configobj - dulwich - fastbencode - merge3 - patiencediff - pyyaml - tzlocal - urllib3 - ] - ++ optional-dependencies.launchpad - ++ optional-dependencies.fastimport - ++ optional-dependencies.github; + propagatedBuildInputs = [ + configobj + dulwich + fastbencode + merge3 + patiencediff + pyyaml + tzlocal + urllib3 + ] + ++ optional-dependencies.launchpad + ++ optional-dependencies.fastimport + ++ optional-dependencies.github; optional-dependencies = { launchpad = [ launchpadlib ]; diff --git a/pkgs/development/python-modules/build/default.nix b/pkgs/development/python-modules/build/default.nix index 15b3a5965482..ae2fe86d38f6 100644 --- a/pkgs/development/python-modules/build/default.nix +++ b/pkgs/development/python-modules/build/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ packaging pyproject-hooks - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; # We need to disable tests because this package is part of the bootstrap chain # and its test dependencies cannot be built yet when this is being built. @@ -76,24 +77,23 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - disabledTests = - [ - # Tests often fail with StopIteration - "test_isolat" - "test_default_pip_is_never_too_old" - "test_build" - "test_with_get_requires" - "test_init" - "test_output" - "test_wheel_metadata" - # Tests require network access to run pip install - "test_verbose_output" - "test_requirement_installation" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Expects Apple's Python and its quirks - "test_can_get_venv_paths_with_conflicting_default_scheme" - ]; + disabledTests = [ + # Tests often fail with StopIteration + "test_isolat" + "test_default_pip_is_never_too_old" + "test_build" + "test_with_get_requires" + "test_init" + "test_output" + "test_wheel_metadata" + # Tests require network access to run pip install + "test_verbose_output" + "test_requirement_installation" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Expects Apple's Python and its quirks + "test_can_get_venv_paths_with_conflicting_default_scheme" + ]; }; }; diff --git a/pkgs/development/python-modules/bundlewrap/default.nix b/pkgs/development/python-modules/bundlewrap/default.nix index 7d9063449cd0..9d571b5ec183 100644 --- a/pkgs/development/python-modules/bundlewrap/default.nix +++ b/pkgs/development/python-modules/bundlewrap/default.nix @@ -44,7 +44,8 @@ buildPythonPackage { requests tomlkit librouteros - ] ++ lib.optionals (pythonOlder "3.11") [ rtoml ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ rtoml ]; pythonImportsCheck = [ "bundlewrap" ]; diff --git a/pkgs/development/python-modules/bytewax/default.nix b/pkgs/development/python-modules/bytewax/default.nix index 204f1af73b14..97f471f7fa09 100644 --- a/pkgs/development/python-modules/bytewax/default.nix +++ b/pkgs/development/python-modules/bytewax/default.nix @@ -82,7 +82,8 @@ buildPythonPackage rec { myst-docutils pytestCheckHook pytest-benchmark - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlagsArray = [ "--benchmark-disable" diff --git a/pkgs/development/python-modules/cachecontrol/default.nix b/pkgs/development/python-modules/cachecontrol/default.nix index f3b82354538c..fdcfbe5c24f4 100644 --- a/pkgs/development/python-modules/cachecontrol/default.nix +++ b/pkgs/development/python-modules/cachecontrol/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { mock pytestCheckHook requests - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "cachecontrol" ]; diff --git a/pkgs/development/python-modules/cairocffi/default.nix b/pkgs/development/python-modules/cairocffi/default.nix index bbcdbfb5fff8..3ea6b438e158 100644 --- a/pkgs/development/python-modules/cairocffi/default.nix +++ b/pkgs/development/python-modules/cairocffi/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ cairo cffi - ] ++ lib.optional withXcffib xcffib; + ] + ++ lib.optional withXcffib xcffib; nativeCheckInputs = [ numpy diff --git a/pkgs/development/python-modules/camel-converter/default.nix b/pkgs/development/python-modules/camel-converter/default.nix index 424e6a6046be..258786d90811 100644 --- a/pkgs/development/python-modules/camel-converter/default.nix +++ b/pkgs/development/python-modules/camel-converter/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-cov-stub - ] ++ optional-dependencies.pydantic; + ] + ++ optional-dependencies.pydantic; pythonImportsCheck = [ "camel_converter" ]; diff --git a/pkgs/development/python-modules/canals/default.nix b/pkgs/development/python-modules/canals/default.nix index cc86fa4637a3..2864939e54ec 100644 --- a/pkgs/development/python-modules/canals/default.nix +++ b/pkgs/development/python-modules/canals/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTestPaths = [ # Test requires internet connection to mermaid.ink diff --git a/pkgs/development/python-modules/canmatrix/default.nix b/pkgs/development/python-modules/canmatrix/default.nix index 511afe5f353a..5cb9396b9d0f 100644 --- a/pkgs/development/python-modules/canmatrix/default.nix +++ b/pkgs/development/python-modules/canmatrix/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pytest-cov-stub pytest-timeout pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pytestFlagsArray = [ # long_envvar_name_imports requires stable key value pair ordering diff --git a/pkgs/development/python-modules/cantools/default.nix b/pkgs/development/python-modules/cantools/default.nix index c1a7c71a829e..2710187e569d 100644 --- a/pkgs/development/python-modules/cantools/default.nix +++ b/pkgs/development/python-modules/cantools/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { nativeCheckInputs = [ parameterized pytestCheckHook - ] ++ optional-dependencies.plot; + ] + ++ optional-dependencies.plot; pythonImportsCheck = [ "cantools" ]; diff --git a/pkgs/development/python-modules/cartopy/default.nix b/pkgs/development/python-modules/cartopy/default.nix index 9b40977a9213..42cc8eeeb169 100644 --- a/pkgs/development/python-modules/cartopy/default.nix +++ b/pkgs/development/python-modules/cartopy/default.nix @@ -69,7 +69,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-mpl pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf diff --git a/pkgs/development/python-modules/cassandra-driver/default.nix b/pkgs/development/python-modules/cassandra-driver/default.nix index 05e62f21254f..4d325e8d2431 100644 --- a/pkgs/development/python-modules/cassandra-driver/default.nix +++ b/pkgs/development/python-modules/cassandra-driver/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pytz pyyaml sure - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # This is used to determine the version of cython that can be used CASS_DRIVER_ALLOWED_CYTHON_VERSION = cython.version; diff --git a/pkgs/development/python-modules/cattrs/default.nix b/pkgs/development/python-modules/cattrs/default.nix index 0eb5d3148be5..ee3d8559806f 100644 --- a/pkgs/development/python-modules/cattrs/default.nix +++ b/pkgs/development/python-modules/cattrs/default.nix @@ -59,12 +59,13 @@ buildPythonPackage rec { hatch-vcs ]; - dependencies = - [ attrs ] - ++ lib.optionals (pythonOlder "3.11") [ - exceptiongroup - typing-extensions - ]; + dependencies = [ + attrs + ] + ++ lib.optionals (pythonOlder "3.11") [ + exceptiongroup + typing-extensions + ]; nativeCheckInputs = [ cbor2 @@ -99,18 +100,17 @@ buildPythonPackage rec { "bench" ]; - disabledTests = - [ - # orjson is not available as it requires Rust nightly features to compile its requirements - "test_orjson" - # msgspec causes a segmentation fault for some reason - "test_simple_classes" - "test_msgspec_json_converter" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/python-attrs/cattrs/pull/543 - "test_unstructure_deeply_nested_generics_list" - ]; + disabledTests = [ + # orjson is not available as it requires Rust nightly features to compile its requirements + "test_orjson" + # msgspec causes a segmentation fault for some reason + "test_simple_classes" + "test_msgspec_json_converter" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/python-attrs/cattrs/pull/543 + "test_unstructure_deeply_nested_generics_list" + ]; pythonImportsCheck = [ "cattr" ]; diff --git a/pkgs/development/python-modules/causal-conv1d/default.nix b/pkgs/development/python-modules/causal-conv1d/default.nix index bf7d8c176f5f..924cc8b07df3 100644 --- a/pkgs/development/python-modules/causal-conv1d/default.nix +++ b/pkgs/development/python-modules/causal-conv1d/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { env = { CAUSAL_CONV1D_FORCE_BUILD = "TRUE"; - } // lib.optionalAttrs cudaSupport { CUDA_HOME = "${lib.getDev cudaPackages.cuda_nvcc}"; }; + } + // lib.optionalAttrs cudaSupport { CUDA_HOME = "${lib.getDev cudaPackages.cuda_nvcc}"; }; meta = with lib; { description = "Causal depthwise conv1d in CUDA with a PyTorch interface"; diff --git a/pkgs/development/python-modules/celery/default.nix b/pkgs/development/python-modules/celery/default.nix index 3b3a3f584b05..88cd2cc05ed6 100644 --- a/pkgs/development/python-modules/celery/default.nix +++ b/pkgs/development/python-modules/celery/default.nix @@ -83,7 +83,8 @@ buildPythonPackage rec { pytest-timeout pytest-xdist pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTestPaths = [ # test_eventlet touches network @@ -95,26 +96,25 @@ buildPythonPackage rec { "t/unit/backends/test_s3.py" ]; - disabledTests = - [ - "msgpack" - "test_check_privileges_no_fchown" - # seems to only fail on higher core counts - # AssertionError: assert 3 == 0 - "test_setup_security_disabled_serializers" - # Test is flaky, especially on hydra - "test_ready" - # Tests fail with pytest-xdist - "test_itercapture_limit" - "test_stamping_headers_in_options" - "test_stamping_with_replace" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Too many open files on hydra - "test_cleanup" - "test_with_autoscaler_file_descriptor_safety" - "test_with_file_descriptor_safety" - ]; + disabledTests = [ + "msgpack" + "test_check_privileges_no_fchown" + # seems to only fail on higher core counts + # AssertionError: assert 3 == 0 + "test_setup_security_disabled_serializers" + # Test is flaky, especially on hydra + "test_ready" + # Tests fail with pytest-xdist + "test_itercapture_limit" + "test_stamping_headers_in_options" + "test_stamping_with_replace" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Too many open files on hydra + "test_cleanup" + "test_with_autoscaler_file_descriptor_safety" + "test_with_file_descriptor_safety" + ]; pythonImportsCheck = [ "celery" ]; diff --git a/pkgs/development/python-modules/cement/default.nix b/pkgs/development/python-modules/cement/default.nix index ea70f7895ab0..864fc2df9c8d 100644 --- a/pkgs/development/python-modules/cement/default.nix +++ b/pkgs/development/python-modules/cement/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pytest-cov-stub pytestCheckHook requests - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "cement" ]; diff --git a/pkgs/development/python-modules/certomancer/default.nix b/pkgs/development/python-modules/certomancer/default.nix index afda68490e95..1fae518cb3e4 100644 --- a/pkgs/development/python-modules/certomancer/default.nix +++ b/pkgs/development/python-modules/certomancer/default.nix @@ -71,7 +71,8 @@ buildPythonPackage rec { pytestCheckHook pytz requests - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "certomancer" ]; diff --git a/pkgs/development/python-modules/cf-xarray/default.nix b/pkgs/development/python-modules/cf-xarray/default.nix index 1b802a6c72dc..f6192a9e68fc 100644 --- a/pkgs/development/python-modules/cf-xarray/default.nix +++ b/pkgs/development/python-modules/cf-xarray/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { dask pytestCheckHook scipy - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "cf_xarray" ]; diff --git a/pkgs/development/python-modules/cfn-lint/default.nix b/pkgs/development/python-modules/cfn-lint/default.nix index 1b56111cb8ef..b13885318ae2 100644 --- a/pkgs/development/python-modules/cfn-lint/default.nix +++ b/pkgs/development/python-modules/cfn-lint/default.nix @@ -69,7 +69,8 @@ buildPythonPackage rec { defusedxml mock pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export PATH=$out/bin:$PATH diff --git a/pkgs/development/python-modules/cgal/default.nix b/pkgs/development/python-modules/cgal/default.nix index fe91cb60505c..46251662a624 100644 --- a/pkgs/development/python-modules/cgal/default.nix +++ b/pkgs/development/python-modules/cgal/default.nix @@ -39,19 +39,18 @@ buildPythonPackage rec { swig ]; - buildInputs = - [ - cgal - gmp - mpfr - boost - zlib - tbb - eigen - ] - ++ lib.optionals withLAS [ - LAStools - ]; + buildInputs = [ + cgal + gmp + mpfr + boost + zlib + tbb + eigen + ] + ++ lib.optionals withLAS [ + LAStools + ]; dependencies = [ numpy diff --git a/pkgs/development/python-modules/channels/default.nix b/pkgs/development/python-modules/channels/default.nix index ba785d7cc3bc..b7b66ffc7dea 100644 --- a/pkgs/development/python-modules/channels/default.nix +++ b/pkgs/development/python-modules/channels/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { pytest-asyncio pytest-django pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "channels" ]; diff --git a/pkgs/development/python-modules/check-manifest/default.nix b/pkgs/development/python-modules/check-manifest/default.nix index d3ec667342fa..53b4f7476401 100644 --- a/pkgs/development/python-modules/check-manifest/default.nix +++ b/pkgs/development/python-modules/check-manifest/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { build pep517 setuptools - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ git diff --git a/pkgs/development/python-modules/cheroot/default.nix b/pkgs/development/python-modules/cheroot/default.nix index 2b4c9f427acb..85f2c8e89627 100644 --- a/pkgs/development/python-modules/cheroot/default.nix +++ b/pkgs/development/python-modules/cheroot/default.nix @@ -71,16 +71,15 @@ buildPythonPackage rec { rm pytest.ini ''; - disabledTests = - [ - "tls" # touches network - "peercreds_unix_sock" # test urls no longer allowed - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "http_over_https_error" - "bind_addr_unix" - "test_ssl_env" - ]; + disabledTests = [ + "tls" # touches network + "peercreds_unix_sock" # test urls no longer allowed + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "http_over_https_error" + "bind_addr_unix" + "test_ssl_env" + ]; disabledTestPaths = [ # avoid attempting to use 3 packages not available on nixpkgs diff --git a/pkgs/development/python-modules/cherrypy/default.nix b/pkgs/development/python-modules/cherrypy/default.nix index 240cbc60a50f..ee502767a117 100644 --- a/pkgs/development/python-modules/cherrypy/default.nix +++ b/pkgs/development/python-modules/cherrypy/default.nix @@ -70,36 +70,35 @@ buildPythonPackage rec { "-Wignore::DeprecationWarning" ]; - disabledTests = - [ - # Keyboard interrupt ends test suite run - "KeyboardInterrupt" - # daemonize and autoreload tests have issue with sockets within sandbox - "daemonize" - "Autoreload" + disabledTests = [ + # Keyboard interrupt ends test suite run + "KeyboardInterrupt" + # daemonize and autoreload tests have issue with sockets within sandbox + "daemonize" + "Autoreload" - "test_antistampede" - "test_file_stream" - "test_basic_request" - "test_3_Redirect" - "test_4_File_deletion" - ] - ++ lib.optionals (pythonAtLeast "3.11") [ - "testErrorHandling" - "testHookErrors" - "test_HTTP10_KeepAlive" - "test_No_Message_Body" - "test_HTTP11_Timeout" - "testGzip" - "test_malformed_header" - "test_no_content_length" - "test_post_filename_with_special_characters" - "test_post_multipart" - "test_iterator" - "test_1_Ram_Concurrency" - "test_2_File_Concurrency" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_block" ]; + "test_antistampede" + "test_file_stream" + "test_basic_request" + "test_3_Redirect" + "test_4_File_deletion" + ] + ++ lib.optionals (pythonAtLeast "3.11") [ + "testErrorHandling" + "testHookErrors" + "test_HTTP10_KeepAlive" + "test_No_Message_Body" + "test_HTTP11_Timeout" + "testGzip" + "test_malformed_header" + "test_no_content_length" + "test_post_filename_with_special_characters" + "test_post_multipart" + "test_iterator" + "test_1_Ram_Concurrency" + "test_2_File_Concurrency" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_block" ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "cherrypy/test/test_config_server.py" diff --git a/pkgs/development/python-modules/cirq-core/default.nix b/pkgs/development/python-modules/cirq-core/default.nix index 7dbf44955694..7391d4563145 100644 --- a/pkgs/development/python-modules/cirq-core/default.nix +++ b/pkgs/development/python-modules/cirq-core/default.nix @@ -53,29 +53,28 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - attrs - duet - matplotlib - networkx - numpy - pandas - requests - scipy - sortedcontainers - sympy - tqdm - typing-extensions - ] - ++ lib.optionals withContribRequires [ - autoray - opt-einsum - ply - pylatex - pyquil - quimb - ]; + dependencies = [ + attrs + duet + matplotlib + networkx + numpy + pandas + requests + scipy + sortedcontainers + sympy + tqdm + typing-extensions + ] + ++ lib.optionals withContribRequires [ + autoray + opt-einsum + ply + pylatex + pyquil + quimb + ]; nativeCheckInputs = [ freezegun @@ -90,19 +89,18 @@ buildPythonPackage rec { "cirq/_version_test.py" ]; - disabledTests = - [ - # Assertion error - "test_parameterized_cphase" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # https://github.com/quantumlib/Cirq/issues/5924 - "test_prepare_two_qubit_state_using_sqrt_iswap" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # test_scalar_division[scalar9-terms9-terms_expected9] result differs in the final digit - "test_scalar_division" - ]; + disabledTests = [ + # Assertion error + "test_parameterized_cphase" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # https://github.com/quantumlib/Cirq/issues/5924 + "test_prepare_two_qubit_state_using_sqrt_iswap" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # test_scalar_division[scalar9-terms9-terms_expected9] result differs in the final digit + "test_scalar_division" + ]; meta = { description = "Framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits"; diff --git a/pkgs/development/python-modules/cirq-google/default.nix b/pkgs/development/python-modules/cirq-google/default.nix index 91da79a13348..6737ce491da3 100644 --- a/pkgs/development/python-modules/cirq-google/default.nix +++ b/pkgs/development/python-modules/cirq-google/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { google-api-core protobuf typedunits - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ freezegun diff --git a/pkgs/development/python-modules/claripy/default.nix b/pkgs/development/python-modules/claripy/default.nix index e68e7d869d60..6ab586ac6db8 100644 --- a/pkgs/development/python-modules/claripy/default.nix +++ b/pkgs/development/python-modules/claripy/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { pysmt typing-extensions z3-solver - ] ++ z3-solver.requiredPythonModules; + ] + ++ z3-solver.requiredPythonModules; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/cleanlab/default.nix b/pkgs/development/python-modules/cleanlab/default.nix index 9cd1d44d90da..b2cb9fe03e30 100644 --- a/pkgs/development/python-modules/cleanlab/default.nix +++ b/pkgs/development/python-modules/cleanlab/default.nix @@ -79,26 +79,25 @@ buildPythonPackage rec { wget ]; - disabledTests = - [ - # Incorrect snapshots (AssertionError) - "test_color_sentence" + disabledTests = [ + # Incorrect snapshots (AssertionError) + "test_color_sentence" - # Requires the datasets we prevent from downloading - "test_create_imagelab" + # Requires the datasets we prevent from downloading + "test_create_imagelab" - # Non-trivial numpy2 incompatibilities - # assert np.float64(0.492) == 0.491 - "test_duplicate_points_have_similar_scores" - # AssertionError: assert 'Annotators [1] did not label any examples.' - "test_label_quality_scores_multiannotator" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # AttributeError: 'called_once_with' is not a valid assertion. - # Use a spec for the mock if 'called_once_with' is meant to be an attribute.. - # Did you mean: 'assert_called_once_with'? - "test_custom_issue_manager_not_registered" - ]; + # Non-trivial numpy2 incompatibilities + # assert np.float64(0.492) == 0.491 + "test_duplicate_points_have_similar_scores" + # AssertionError: assert 'Annotators [1] did not label any examples.' + "test_label_quality_scores_multiannotator" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # AttributeError: 'called_once_with' is not a valid assertion. + # Use a spec for the mock if 'called_once_with' is meant to be an attribute.. + # Did you mean: 'assert_called_once_with'? + "test_custom_issue_manager_not_registered" + ]; disabledTestPaths = [ # Requires internet diff --git a/pkgs/development/python-modules/cli-helpers/default.nix b/pkgs/development/python-modules/cli-helpers/default.nix index 9dba2d39ff07..9655cd190758 100644 --- a/pkgs/development/python-modules/cli-helpers/default.nix +++ b/pkgs/development/python-modules/cli-helpers/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ configobj tabulate - ] ++ tabulate.optional-dependencies.widechars; + ] + ++ tabulate.optional-dependencies.widechars; optional-dependencies = { styles = [ pygments ]; @@ -35,7 +36,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook mock - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); meta = with lib; { description = "Python helpers for common CLI tasks"; diff --git a/pkgs/development/python-modules/click-odoo-contrib/default.nix b/pkgs/development/python-modules/click-odoo-contrib/default.nix index 0e1cc65445bb..757493c6b4a2 100644 --- a/pkgs/development/python-modules/click-odoo-contrib/default.nix +++ b/pkgs/development/python-modules/click-odoo-contrib/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ click-odoo manifestoo-core - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/development/python-modules/clickhouse-connect/default.nix b/pkgs/development/python-modules/clickhouse-connect/default.nix index 5c13eeb4f348..3600ddedd7fe 100644 --- a/pkgs/development/python-modules/clickhouse-connect/default.nix +++ b/pkgs/development/python-modules/clickhouse-connect/default.nix @@ -50,13 +50,12 @@ buildPythonPackage rec { lz4 ]; - nativeCheckInputs = - [ - pytestCheckHook - pytest-dotenv - ] - ++ optional-dependencies.sqlalchemy - ++ optional-dependencies.numpy; + nativeCheckInputs = [ + pytestCheckHook + pytest-dotenv + ] + ++ optional-dependencies.sqlalchemy + ++ optional-dependencies.numpy; # these tests require a running clickhouse instance disabledTestPaths = [ diff --git a/pkgs/development/python-modules/cloudpathlib/default.nix b/pkgs/development/python-modules/cloudpathlib/default.nix index 00ec94cf771a..f5c0a8ecd4d4 100644 --- a/pkgs/development/python-modules/cloudpathlib/default.nix +++ b/pkgs/development/python-modules/cloudpathlib/default.nix @@ -68,7 +68,8 @@ buildPythonPackage rec { python-dotenv shortuuid tenacity - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; meta = with lib; { description = "Python pathlib-style classes for cloud storage services such as Amazon S3, Azure Blob Storage, and Google Cloud Storage"; diff --git a/pkgs/development/python-modules/cmd2/default.nix b/pkgs/development/python-modules/cmd2/default.nix index 8079242826ff..2a49262b1662 100644 --- a/pkgs/development/python-modules/cmd2/default.nix +++ b/pkgs/development/python-modules/cmd2/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { colorama pyperclip wcwidth - ] ++ lib.optional stdenv.hostPlatform.isDarwin gnureadline; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gnureadline; doCheck = true; diff --git a/pkgs/development/python-modules/cmdstanpy/default.nix b/pkgs/development/python-modules/cmdstanpy/default.nix index 439b1c255307..6a9a2df2a11b 100644 --- a/pkgs/development/python-modules/cmdstanpy/default.nix +++ b/pkgs/development/python-modules/cmdstanpy/default.nix @@ -66,19 +66,18 @@ buildPythonPackage rec { "test/test_cxx_installation.py" ]; - disabledTests = - [ - "test_serialization" # Pickle class mismatch errors - # These tests use the flag -DSTAN_THREADS which doesn't work in cmdstan (missing file) - "test_multi_proc_threads" - "test_compile_force" - # These tests require a writeable cmdstan source directory - "test_pathfinder_threads" - "test_save_profile" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_init_types" # CmdStan error: error during processing Operation not permitted - ]; + disabledTests = [ + "test_serialization" # Pickle class mismatch errors + # These tests use the flag -DSTAN_THREADS which doesn't work in cmdstan (missing file) + "test_multi_proc_threads" + "test_compile_force" + # These tests require a writeable cmdstan source directory + "test_pathfinder_threads" + "test_save_profile" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_init_types" # CmdStan error: error during processing Operation not permitted + ]; pythonImportsCheck = [ "cmdstanpy" ]; diff --git a/pkgs/development/python-modules/coffea/default.nix b/pkgs/development/python-modules/coffea/default.nix index 3179f47b6eaf..5dfe3823ea07 100644 --- a/pkgs/development/python-modules/coffea/default.nix +++ b/pkgs/development/python-modules/coffea/default.nix @@ -86,7 +86,8 @@ buildPythonPackage rec { tqdm uproot vector - ] ++ dask.optional-dependencies.array; + ] + ++ dask.optional-dependencies.array; nativeCheckInputs = [ distributed diff --git a/pkgs/development/python-modules/coinmetrics-api-client/default.nix b/pkgs/development/python-modules/coinmetrics-api-client/default.nix index 23e912ca6577..877954e266b9 100644 --- a/pkgs/development/python-modules/coinmetrics-api-client/default.nix +++ b/pkgs/development/python-modules/coinmetrics-api-client/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-mock - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "coinmetrics.api_client" ]; diff --git a/pkgs/development/python-modules/comicapi/default.nix b/pkgs/development/python-modules/comicapi/default.nix index 4a6721359728..c7eebd06542a 100644 --- a/pkgs/development/python-modules/comicapi/default.nix +++ b/pkgs/development/python-modules/comicapi/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { all = [ py7zr rarfile - ] ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) pyicu; + ] + ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) pyicu; cbr = [ rarfile ]; diff --git a/pkgs/development/python-modules/commoncode/default.nix b/pkgs/development/python-modules/commoncode/default.nix index d231e2d7a9b2..5a90c3bd3a4a 100644 --- a/pkgs/development/python-modules/commoncode/default.nix +++ b/pkgs/development/python-modules/commoncode/default.nix @@ -49,21 +49,20 @@ buildPythonPackage rec { pytest-xdist ]; - disabledTests = - [ - # chinese character translates different into latin - "test_safe_path_posix_style_chinese_char" - # OSError: [Errno 84] Invalid or incomplete multibyte or wide character - "test_os_walk_can_walk_non_utf8_path_from_unicode_path" - "test_resource_iter_can_walk_non_utf8_path_from_unicode_path" - "test_walk_can_walk_non_utf8_path_from_unicode_path" - "test_resource_iter_can_walk_non_utf8_path_from_unicode_path_with_dirs" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # expected result is tailored towards the quirks of upstream's - # CI environment on darwin - "test_searchable_paths" - ]; + disabledTests = [ + # chinese character translates different into latin + "test_safe_path_posix_style_chinese_char" + # OSError: [Errno 84] Invalid or incomplete multibyte or wide character + "test_os_walk_can_walk_non_utf8_path_from_unicode_path" + "test_resource_iter_can_walk_non_utf8_path_from_unicode_path" + "test_walk_can_walk_non_utf8_path_from_unicode_path" + "test_resource_iter_can_walk_non_utf8_path_from_unicode_path_with_dirs" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # expected result is tailored towards the quirks of upstream's + # CI environment on darwin + "test_searchable_paths" + ]; pythonImportsCheck = [ "commoncode" ]; diff --git a/pkgs/development/python-modules/configargparse/default.nix b/pkgs/development/python-modules/configargparse/default.nix index 8d9dd3c00cfb..df563510d24f 100644 --- a/pkgs/development/python-modules/configargparse/default.nix +++ b/pkgs/development/python-modules/configargparse/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook mock - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = lib.optionals (pythonAtLeast "3.13") [ # regex mismatch diff --git a/pkgs/development/python-modules/confluent-kafka/default.nix b/pkgs/development/python-modules/confluent-kafka/default.nix index 8bd682ae2454..e4f6805921f5 100644 --- a/pkgs/development/python-modules/confluent-kafka/default.nix +++ b/pkgs/development/python-modules/confluent-kafka/default.nix @@ -92,7 +92,8 @@ buildPythonPackage rec { pytestCheckHook requests-mock respx - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "confluent_kafka" ]; diff --git a/pkgs/development/python-modules/connected-components-3d/default.nix b/pkgs/development/python-modules/connected-components-3d/default.nix index 07097becde00..cd5e230deea6 100644 --- a/pkgs/development/python-modules/connected-components-3d/default.nix +++ b/pkgs/development/python-modules/connected-components-3d/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook scipy - ] ++ optional-dependencies.stack; + ] + ++ optional-dependencies.stack; disabledTests = [ # requires optional dependency crackle-codec (not in nixpkgs) diff --git a/pkgs/development/python-modules/connexion/default.nix b/pkgs/development/python-modules/connexion/default.nix index bd98705e3c8d..21a529d5fd83 100644 --- a/pkgs/development/python-modules/connexion/default.nix +++ b/pkgs/development/python-modules/connexion/default.nix @@ -76,23 +76,23 @@ buildPythonPackage rec { pytest-aiohttp pytestCheckHook testfixtures - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "connexion" ]; - disabledTests = - [ - "test_build_example" - "test_mock_resolver_no_example" - "test_sort_apis_by_basepath" - "test_sort_routes" - # Tests require network access - "test_remote_api" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # ImportError: Error while finding loader for '/private/tmp/nix-build-python3.12-connexion-3.1.0.drv-0/source' (: No module named '/private/tmp/nix-build-python3') - "test_lifespan" - ]; + disabledTests = [ + "test_build_example" + "test_mock_resolver_no_example" + "test_sort_apis_by_basepath" + "test_sort_routes" + # Tests require network access + "test_remote_api" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # ImportError: Error while finding loader for '/private/tmp/nix-build-python3.12-connexion-3.1.0.drv-0/source' (: No module named '/private/tmp/nix-build-python3') + "test_lifespan" + ]; meta = { description = "Swagger/OpenAPI First framework on top of Flask"; diff --git a/pkgs/development/python-modules/constantly/default.nix b/pkgs/development/python-modules/constantly/default.nix index 42d8e96b3889..ac1474bc1a87 100644 --- a/pkgs/development/python-modules/constantly/default.nix +++ b/pkgs/development/python-modules/constantly/default.nix @@ -30,7 +30,8 @@ let nativeBuildInputs = [ setuptools versioneer - ] ++ versioneer.optional-dependencies.toml; + ] + ++ versioneer.optional-dependencies.toml; # would create dependency loop with twisted doCheck = false; diff --git a/pkgs/development/python-modules/construct-typing/default.nix b/pkgs/development/python-modules/construct-typing/default.nix index 7253c51d6978..d56525e538fa 100644 --- a/pkgs/development/python-modules/construct-typing/default.nix +++ b/pkgs/development/python-modules/construct-typing/default.nix @@ -47,17 +47,16 @@ buildPythonPackage rec { ruamel-yaml ]; - disabledTests = - [ - # tests fail with construct>=2.10.70 - "test_bitsinteger" - "test_bytesinteger" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/timrid/construct-typing/issues/31 - "test_tenum_docstring" - "test_tenum_flags_docstring" - ]; + disabledTests = [ + # tests fail with construct>=2.10.70 + "test_bitsinteger" + "test_bytesinteger" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/timrid/construct-typing/issues/31 + "test_tenum_docstring" + "test_tenum_flags_docstring" + ]; meta = { changelog = "https://github.com/timrid/construct-typing/releases/tag/v${version}"; diff --git a/pkgs/development/python-modules/construct/default.nix b/pkgs/development/python-modules/construct/default.nix index 780f973e8a8c..98bc1d47d66e 100644 --- a/pkgs/development/python-modules/construct/default.nix +++ b/pkgs/development/python-modules/construct/default.nix @@ -47,13 +47,15 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "construct" ]; disabledTests = [ "test_benchmarks" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_multiprocessing" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_multiprocessing" ]; meta = with lib; { description = "Powerful declarative parser (and builder) for binary data"; diff --git a/pkgs/development/python-modules/controku/default.nix b/pkgs/development/python-modules/controku/default.nix index 9aff50bfc087..83aaf6a8118d 100644 --- a/pkgs/development/python-modules/controku/default.nix +++ b/pkgs/development/python-modules/controku/default.nix @@ -25,23 +25,23 @@ buildPythonPackage rec { hash = "sha256-sye2GtL3a77pygllZc6ylaIP7faPb+NFbyKKyqJzIXw="; }; - nativeBuildInputs = - [ setuptools ] - ++ lib.optionals buildApplication [ - gobject-introspection - wrapGAppsHook3 - ]; + nativeBuildInputs = [ + setuptools + ] + ++ lib.optionals buildApplication [ + gobject-introspection + wrapGAppsHook3 + ]; - propagatedBuildInputs = - [ - requests - ssdpy - ] - ++ lib.optionals buildApplication [ - gtk3 - appdirs - pygobject3 - ]; + propagatedBuildInputs = [ + requests + ssdpy + ] + ++ lib.optionals buildApplication [ + gtk3 + appdirs + pygobject3 + ]; pythonImportsCheck = [ "controku" ]; diff --git a/pkgs/development/python-modules/corallium/default.nix b/pkgs/development/python-modules/corallium/default.nix index 42681e446060..9781cd9a6e20 100644 --- a/pkgs/development/python-modules/corallium/default.nix +++ b/pkgs/development/python-modules/corallium/default.nix @@ -25,15 +25,14 @@ buildPythonPackage rec { poetry-core ]; - dependencies = - [ - beartype - pydantic - rich - ] - ++ lib.optionals (python.pythonOlder "3.11") [ - tomli - ]; + dependencies = [ + beartype + pydantic + rich + ] + ++ lib.optionals (python.pythonOlder "3.11") [ + tomli + ]; meta = with lib; { description = "Shared functionality for calcipy-ecosystem"; diff --git a/pkgs/development/python-modules/cot/default.nix b/pkgs/development/python-modules/cot/default.nix index 5f28ef159c4d..a7c9a75dbfe2 100644 --- a/pkgs/development/python-modules/cot/default.nix +++ b/pkgs/development/python-modules/cot/default.nix @@ -77,7 +77,8 @@ buildPythonPackage rec { "test_serial_fixup_stubbed" "test_serial_fixup_stubbed_create" "test_serial_fixup_stubbed_vm_not_found" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_serial_fixup_invalid_host" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_serial_fixup_invalid_host" ]; pythonImportsCheck = [ "COT" ]; diff --git a/pkgs/development/python-modules/coverage/default.nix b/pkgs/development/python-modules/coverage/default.nix index 500fca210a17..f9b863a8cc0b 100644 --- a/pkgs/development/python-modules/coverage/default.nix +++ b/pkgs/development/python-modules/coverage/default.nix @@ -52,26 +52,25 @@ buildPythonPackage rec { rm -r coverage ''; - disabledTests = - [ - "test_all_our_source_files" - "test_doctest" - "test_files_up_one_level" - "test_get_encoded_zip_files" - "test_metadata" - "test_more_metadata" - "test_multi" - "test_no_duplicate_packages" - "test_xdist_sys_path_nuttiness_is_fixed" - "test_zipfile" - ] - ++ lib.optionals (isPy312 && stdenv.hostPlatform.system == "x86_64-darwin") [ - # substring that may not be in string is part of the pytest output hash, which appears in the string - "test_nothing_specified" - "test_omit" - "test_omit_2" - "test_omit_as_string" - ]; + disabledTests = [ + "test_all_our_source_files" + "test_doctest" + "test_files_up_one_level" + "test_get_encoded_zip_files" + "test_metadata" + "test_more_metadata" + "test_multi" + "test_no_duplicate_packages" + "test_xdist_sys_path_nuttiness_is_fixed" + "test_zipfile" + ] + ++ lib.optionals (isPy312 && stdenv.hostPlatform.system == "x86_64-darwin") [ + # substring that may not be in string is part of the pytest output hash, which appears in the string + "test_nothing_specified" + "test_omit" + "test_omit_2" + "test_omit_as_string" + ]; disabledTestPaths = [ "tests/test_debug.py" diff --git a/pkgs/development/python-modules/craft-application/default.nix b/pkgs/development/python-modules/craft-application/default.nix index d290894e3b0c..6f2a8db2a4b6 100644 --- a/pkgs/development/python-modules/craft-application/default.nix +++ b/pkgs/development/python-modules/craft-application/default.nix @@ -110,44 +110,42 @@ buildPythonPackage rec { enabledTestPaths = [ "tests/unit" ]; - disabledTests = - [ - "test_to_yaml_file" - # Tests expecting pytest-time - "test_monitor_builds_success" - # Temporary fix until new release to support Python 3.13 - "test_grammar_aware_part_error" - "test_grammar_aware_part_error[part2]" - "test_grammar_aware_project_error[project0]" - # Temp fix - asserts fail against error messages which have changed - # slightly in a later revision of craft-platforms. No functional error. - "test_platform_invalid_arch" - "test_platform_invalid_build_arch" - # Asserts against string output which fails when not on Ubuntu. - "test_run_error_with_docs_url" - # Asserts a fallback path for SSL certs that we override in a patch. - "test_import_fallback_wrong_metadata" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # These tests have hardcoded "amd64" strings which fail on aarch64 - "test_process_grammar_build_for" - "test_process_grammar_platform" - "test_process_grammar_default" - "test_create_craft_manifest" - "test_create_project_manifest" - "test_from_packed_artifact" - "test_teardown_session_create_manifest" - ]; + disabledTests = [ + "test_to_yaml_file" + # Tests expecting pytest-time + "test_monitor_builds_success" + # Temporary fix until new release to support Python 3.13 + "test_grammar_aware_part_error" + "test_grammar_aware_part_error[part2]" + "test_grammar_aware_project_error[project0]" + # Temp fix - asserts fail against error messages which have changed + # slightly in a later revision of craft-platforms. No functional error. + "test_platform_invalid_arch" + "test_platform_invalid_build_arch" + # Asserts against string output which fails when not on Ubuntu. + "test_run_error_with_docs_url" + # Asserts a fallback path for SSL certs that we override in a patch. + "test_import_fallback_wrong_metadata" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # These tests have hardcoded "amd64" strings which fail on aarch64 + "test_process_grammar_build_for" + "test_process_grammar_platform" + "test_process_grammar_default" + "test_create_craft_manifest" + "test_create_project_manifest" + "test_from_packed_artifact" + "test_teardown_session_create_manifest" + ]; - disabledTestPaths = - [ - # These tests assert outputs of commands that assume Ubuntu-related output. - "tests/unit/services/test_lifecycle.py" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # Hard-coded assumptions around use of "amd64" arch strings. - "tests/unit/services/test_project.py" - ]; + disabledTestPaths = [ + # These tests assert outputs of commands that assume Ubuntu-related output. + "tests/unit/services/test_lifecycle.py" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # Hard-coded assumptions around use of "amd64" arch strings. + "tests/unit/services/test_project.py" + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/development/python-modules/craft-parts/default.nix b/pkgs/development/python-modules/craft-parts/default.nix index 09a82797fd20..e46d7f55855f 100644 --- a/pkgs/development/python-modules/craft-parts/default.nix +++ b/pkgs/development/python-modules/craft-parts/default.nix @@ -92,26 +92,25 @@ buildPythonPackage rec { "test_java_plugin_jre_not_17" ]; - disabledTestPaths = - [ - # Relies upon filesystem extended attributes, and suid/guid bits - "tests/unit/sources/test_base.py" - "tests/unit/packages/test_base.py" - "tests/unit/state_manager" - "tests/unit/test_xattrs.py" - "tests/unit/packages/test_normalize.py" - # Relies upon presence of apt/dpkg. - "tests/unit/packages/test_apt_cache.py" - "tests/unit/packages/test_deb.py" - "tests/unit/packages/test_chisel.py" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # These tests have hardcoded "amd64" strings which fail on aarch64 - "tests/unit/executor/test_environment.py" - "tests/unit/features/overlay/test_executor_environment.py" - # Hard-coded assumptions about arguments relating to 'x86_64' - "tests/unit/plugins/test_dotnet_v2_plugin.py" - ]; + disabledTestPaths = [ + # Relies upon filesystem extended attributes, and suid/guid bits + "tests/unit/sources/test_base.py" + "tests/unit/packages/test_base.py" + "tests/unit/state_manager" + "tests/unit/test_xattrs.py" + "tests/unit/packages/test_normalize.py" + # Relies upon presence of apt/dpkg. + "tests/unit/packages/test_apt_cache.py" + "tests/unit/packages/test_deb.py" + "tests/unit/packages/test_chisel.py" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # These tests have hardcoded "amd64" strings which fail on aarch64 + "tests/unit/executor/test_environment.py" + "tests/unit/features/overlay/test_executor_environment.py" + # Hard-coded assumptions about arguments relating to 'x86_64' + "tests/unit/plugins/test_dotnet_v2_plugin.py" + ]; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index d6e5eeb96195..074a18526902 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -49,13 +49,15 @@ buildPythonPackage rec { rustPlatform.maturinBuildHook pkg-config setuptools - ] ++ lib.optionals (!isPyPy) [ cffi ]; + ] + ++ lib.optionals (!isPyPy) [ cffi ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; dependencies = lib.optionals (!isPyPy) [ cffi ]; @@ -67,7 +69,8 @@ buildPythonPackage rec { pretend pytestCheckHook pytest-xdist - ] ++ optional-dependencies.ssh; + ] + ++ optional-dependencies.ssh; pytestFlags = [ "--disable-pytest-warnings" ]; diff --git a/pkgs/development/python-modules/css-inline/default.nix b/pkgs/development/python-modules/css-inline/default.nix index 3087e9b97dab..13c0b52aafd3 100644 --- a/pkgs/development/python-modules/css-inline/default.nix +++ b/pkgs/development/python-modules/css-inline/default.nix @@ -62,16 +62,15 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # fails to connect to local server - "test_cache" - "test_remote_stylesheet" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # pyo3_runtime.PanicException: event loop thread panicked - "test_invalid_href" - ]; + disabledTests = [ + # fails to connect to local server + "test_cache" + "test_remote_stylesheet" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # pyo3_runtime.PanicException: event loop thread panicked + "test_invalid_href" + ]; meta = with lib; { description = "Inline CSS into style attributes"; diff --git a/pkgs/development/python-modules/cssutils/default.nix b/pkgs/development/python-modules/cssutils/default.nix index d20dafc4cff2..54dcad2456dd 100644 --- a/pkgs/development/python-modules/cssutils/default.nix +++ b/pkgs/development/python-modules/cssutils/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { lxml mock pytestCheckHook - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; disabledTests = [ # access network diff --git a/pkgs/development/python-modules/csvw/default.nix b/pkgs/development/python-modules/csvw/default.nix index a85c9d4f0fd4..161a6769da79 100644 --- a/pkgs/development/python-modules/csvw/default.nix +++ b/pkgs/development/python-modules/csvw/default.nix @@ -42,18 +42,17 @@ buildPythonPackage rec { pytest-mock ]; - disabledTests = - [ - # this test is flaky on darwin because it depends on the resolution of filesystem mtimes - # https://github.com/cldf/csvw/blob/45584ad63ff3002a9b3a8073607c1847c5cbac58/tests/test_db.py#L257 - "test_write_file_exists" - ] - ++ lib.optionals (pythonAtLeast "3.10") [ - # https://github.com/cldf/csvw/issues/58 - "test_roundtrip_escapechar" - "test_escapequote_escapecharquotechar_final" - "test_doubleQuote" - ]; + disabledTests = [ + # this test is flaky on darwin because it depends on the resolution of filesystem mtimes + # https://github.com/cldf/csvw/blob/45584ad63ff3002a9b3a8073607c1847c5cbac58/tests/test_db.py#L257 + "test_write_file_exists" + ] + ++ lib.optionals (pythonAtLeast "3.10") [ + # https://github.com/cldf/csvw/issues/58 + "test_roundtrip_escapechar" + "test_escapequote_escapecharquotechar_final" + "test_doubleQuote" + ]; pythonImportsCheck = [ "csvw" ]; diff --git a/pkgs/development/python-modules/cu2qu/default.nix b/pkgs/development/python-modules/cu2qu/default.nix index 27faeab92bd4..2d13183725d3 100644 --- a/pkgs/development/python-modules/cu2qu/default.nix +++ b/pkgs/development/python-modules/cu2qu/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ defcon fonttools - ] ++ fonttools.optional-dependencies.ufo; + ] + ++ fonttools.optional-dependencies.ufo; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/curio/default.nix b/pkgs/development/python-modules/curio/default.nix index dbdc54f01b5d..1806677f2483 100644 --- a/pkgs/development/python-modules/curio/default.nix +++ b/pkgs/development/python-modules/curio/default.nix @@ -30,20 +30,19 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - disabledTests = - [ - "test_cpu" # timing sensitive - "test_aside_basic" # times out - "test_write_timeout" # flaky, does not always time out - "test_aside_cancel" # fails because modifies PYTHONPATH and cant find pytest - "test_ssl_outgoing" # touches network - "test_unix_echo" # socket bind error on hydra when built with other packages - "test_unix_ssl_server" # socket bind error on hydra when built with other packages - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # connects to python.org:1, expects an OsError, hangs in the darwin sandbox - "test_create_bad_connection" - ]; + disabledTests = [ + "test_cpu" # timing sensitive + "test_aside_basic" # times out + "test_write_timeout" # flaky, does not always time out + "test_aside_cancel" # fails because modifies PYTHONPATH and cant find pytest + "test_ssl_outgoing" # touches network + "test_unix_echo" # socket bind error on hydra when built with other packages + "test_unix_ssl_server" # socket bind error on hydra when built with other packages + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # connects to python.org:1, expects an OsError, hangs in the darwin sandbox + "test_create_bad_connection" + ]; pythonImportsCheck = [ "curio" ]; diff --git a/pkgs/development/python-modules/cvxopt/default.nix b/pkgs/development/python-modules/cvxopt/default.nix index 1e79a8eebb1f..a5a5f32c6584 100644 --- a/pkgs/development/python-modules/cvxopt/default.nix +++ b/pkgs/development/python-modules/cvxopt/default.nix @@ -39,30 +39,29 @@ buildPythonPackage rec { # similar to Gsl, glpk, fftw there is also a dsdp interface # but dsdp is not yet packaged in nixpkgs - env = - { - CVXOPT_BLAS_LIB = "blas"; - CVXOPT_LAPACK_LIB = "lapack"; - CVXOPT_BUILD_DSDP = "0"; - CVXOPT_SUITESPARSE_LIB_DIR = "${lib.getLib suitesparse}/lib"; - CVXOPT_SUITESPARSE_INC_DIR = "${lib.getDev suitesparse}/include"; - SETUPTOOLS_SCM_PRETEND_VERSION = version; - } - // lib.optionalAttrs withGsl { - CVXOPT_BUILD_GSL = "1"; - CVXOPT_GSL_LIB_DIR = "${lib.getLib gsl}/lib"; - CVXOPT_GSL_INC_DIR = "${lib.getDev gsl}/include"; - } - // lib.optionalAttrs withGlpk { - CVXOPT_BUILD_GLPK = "1"; - CVXOPT_GLPK_LIB_DIR = "${lib.getLib glpk}/lib"; - CVXOPT_GLPK_INC_DIR = "${lib.getDev glpk}/include"; - } - // lib.optionalAttrs withFftw { - CVXOPT_BUILD_FFTW = "1"; - CVXOPT_FFTW_LIB_DIR = "${lib.getLib fftw}/lib"; - CVXOPT_FFTW_INC_DIR = "${lib.getDev fftw}/include"; - }; + env = { + CVXOPT_BLAS_LIB = "blas"; + CVXOPT_LAPACK_LIB = "lapack"; + CVXOPT_BUILD_DSDP = "0"; + CVXOPT_SUITESPARSE_LIB_DIR = "${lib.getLib suitesparse}/lib"; + CVXOPT_SUITESPARSE_INC_DIR = "${lib.getDev suitesparse}/include"; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + } + // lib.optionalAttrs withGsl { + CVXOPT_BUILD_GSL = "1"; + CVXOPT_GSL_LIB_DIR = "${lib.getLib gsl}/lib"; + CVXOPT_GSL_INC_DIR = "${lib.getDev gsl}/include"; + } + // lib.optionalAttrs withGlpk { + CVXOPT_BUILD_GLPK = "1"; + CVXOPT_GLPK_LIB_DIR = "${lib.getLib glpk}/lib"; + CVXOPT_GLPK_INC_DIR = "${lib.getDev glpk}/include"; + } + // lib.optionalAttrs withFftw { + CVXOPT_BUILD_FFTW = "1"; + CVXOPT_FFTW_LIB_DIR = "${lib.getLib fftw}/lib"; + CVXOPT_FFTW_INC_DIR = "${lib.getDev fftw}/include"; + }; nativeCheckInputs = [ unittestCheckHook ]; diff --git a/pkgs/development/python-modules/cx-freeze/default.nix b/pkgs/development/python-modules/cx-freeze/default.nix index 8cf70c8e532c..48dacf09a566 100644 --- a/pkgs/development/python-modules/cx-freeze/default.nix +++ b/pkgs/development/python-modules/cx-freeze/default.nix @@ -59,19 +59,18 @@ buildPythonPackage rec { pythonRemoveDeps = [ "patchelf" ]; - dependencies = - [ - distutils - filelock - packaging - setuptools - ] - ++ lib.optionals (pythonOlder "3.11") [ - tomli - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - dmgbuild - ]; + dependencies = [ + distutils + filelock + packaging + setuptools + ] + ++ lib.optionals (pythonOlder "3.11") [ + tomli + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + dmgbuild + ]; makeWrapperArgs = [ "--prefix" @@ -97,59 +96,58 @@ buildPythonPackage rec { rm -rf cx_Freeze ''; - disabledTests = - [ - # Require internet access - "test_bdist_appimage_download_appimagetool" - "test_bdist_appimage_target_name" - "test_bdist_appimage_target_name_and_version" - "test_bdist_appimage_target_name_and_version_none" + disabledTests = [ + # Require internet access + "test_bdist_appimage_download_appimagetool" + "test_bdist_appimage_target_name" + "test_bdist_appimage_target_name_and_version" + "test_bdist_appimage_target_name_and_version_none" - # Try to install a module: ValueError: ZIP does not support timestamps before 1980 - "test___main__" - "test_bdist_appimage_simple" - "test_bdist_appimage_skip_build" - "test_bdist_deb_simple_pyproject" - "test_bdist_rpm_simple_pyproject" - "test_build" - "test_build_constants" - "test_build_exe_advanced" - "test_build_exe_asmodule" - "test_ctypes" - "test_cxfreeze" - "test_cxfreeze_debug_verbose" - "test_cxfreeze_deprecated_behavior" - "test_cxfreeze_deprecated_option" - "test_cxfreeze_include_path" - "test_cxfreeze_target_name_not_isidentifier" - "test_excludes" - "test_executable_namespace" - "test_executable_rename" - "test_executables" - "test_freezer_zip_filename" - "test_install" - "test_install_pyproject" - "test_multiprocessing" - "test_not_found_icon" - "test_parser" - "test_sqlite" - "test_ssl" - "test_tz" - "test_valid_icon" - "test_zip_exclude_packages" - "test_zip_include_packages" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # error: Path /nix/store/xzjghvsg4fhr2vv6h4scihsdrgk4i76w-python3-3.12.9/lib/libpython3.12.dylib - # is not a path referenced from DarwinFile - "test_bdist_dmg" - "test_bdist_dmg_custom_layout" - "test_bdist_mac" - "test_plist_items" + # Try to install a module: ValueError: ZIP does not support timestamps before 1980 + "test___main__" + "test_bdist_appimage_simple" + "test_bdist_appimage_skip_build" + "test_bdist_deb_simple_pyproject" + "test_bdist_rpm_simple_pyproject" + "test_build" + "test_build_constants" + "test_build_exe_advanced" + "test_build_exe_asmodule" + "test_ctypes" + "test_cxfreeze" + "test_cxfreeze_debug_verbose" + "test_cxfreeze_deprecated_behavior" + "test_cxfreeze_deprecated_option" + "test_cxfreeze_include_path" + "test_cxfreeze_target_name_not_isidentifier" + "test_excludes" + "test_executable_namespace" + "test_executable_rename" + "test_executables" + "test_freezer_zip_filename" + "test_install" + "test_install_pyproject" + "test_multiprocessing" + "test_not_found_icon" + "test_parser" + "test_sqlite" + "test_ssl" + "test_tz" + "test_valid_icon" + "test_zip_exclude_packages" + "test_zip_include_packages" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # error: Path /nix/store/xzjghvsg4fhr2vv6h4scihsdrgk4i76w-python3-3.12.9/lib/libpython3.12.dylib + # is not a path referenced from DarwinFile + "test_bdist_dmg" + "test_bdist_dmg_custom_layout" + "test_bdist_mac" + "test_plist_items" - # AssertionError: assert names != [] - "test_freezer_default_bin_includes" - ]; + # AssertionError: assert names != [] + "test_freezer_default_bin_includes" + ]; meta = { description = "Set of scripts and modules for freezing Python scripts into executables"; diff --git a/pkgs/development/python-modules/cyclonedx-python-lib/default.nix b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix index d66f6c981571..140adeda4e8d 100644 --- a/pkgs/development/python-modules/cyclonedx-python-lib/default.nix +++ b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix @@ -69,7 +69,8 @@ buildPythonPackage rec { ddt pytestCheckHook xmldiff - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "cyclonedx" ]; diff --git a/pkgs/development/python-modules/cyclopts/default.nix b/pkgs/development/python-modules/cyclopts/default.nix index 8be86fdf9f85..44541cc1c90a 100644 --- a/pkgs/development/python-modules/cyclopts/default.nix +++ b/pkgs/development/python-modules/cyclopts/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { pytest-mock pytestCheckHook pyyaml - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "cyclopts" ]; diff --git a/pkgs/development/python-modules/cython/0.nix b/pkgs/development/python-modules/cython/0.nix index 78496380abc1..f30b0b4f7452 100644 --- a/pkgs/development/python-modules/cython/0.nix +++ b/pkgs/development/python-modules/cython/0.nix @@ -14,22 +14,23 @@ }: let - excludedTests = - [ "reimport_from_subinterpreter" ] - # cython's testsuite is not working very well with libc++ - # We are however optimistic about things outside of testsuite still working - ++ lib.optionals (stdenv.cc.isClang or false) [ - "cpdef_extern_func" - "libcpp_algo" - ] - # Some tests in the test suite isn't working on aarch64. Disable them for - # now until upstream finds a workaround. - # Upstream issue here: https://github.com/cython/cython/issues/2308 - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "numpy_memoryview" ] - ++ lib.optionals stdenv.hostPlatform.isi686 [ - "future_division" - "overflow_check_longlong" - ]; + excludedTests = [ + "reimport_from_subinterpreter" + ] + # cython's testsuite is not working very well with libc++ + # We are however optimistic about things outside of testsuite still working + ++ lib.optionals (stdenv.cc.isClang or false) [ + "cpdef_extern_func" + "libcpp_algo" + ] + # Some tests in the test suite isn't working on aarch64. Disable them for + # now until upstream finds a workaround. + # Upstream issue here: https://github.com/cython/cython/issues/2308 + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "numpy_memoryview" ] + ++ lib.optionals stdenv.hostPlatform.isi686 [ + "future_division" + "overflow_check_longlong" + ]; in buildPythonPackage rec { pname = "cython"; diff --git a/pkgs/development/python-modules/cython/default.nix b/pkgs/development/python-modules/cython/default.nix index 9e3cb88b4924..45fc174577ae 100644 --- a/pkgs/development/python-modules/cython/default.nix +++ b/pkgs/development/python-modules/cython/default.nix @@ -49,22 +49,23 @@ buildPythonPackage rec { checkPhase = let - excludedTests = - [ "reimport_from_subinterpreter" ] - # cython's testsuite is not working very well with libc++ - # We are however optimistic about things outside of testsuite still working - ++ lib.optionals (stdenv.cc.isClang or false) [ - "cpdef_extern_func" - "libcpp_algo" - ] - # Some tests in the test suite aren't working on aarch64. - # Disable them for now until upstream finds a workaround. - # Upstream issue: https://github.com/cython/cython/issues/2308 - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "numpy_memoryview" ] - ++ lib.optionals stdenv.hostPlatform.isi686 [ - "future_division" - "overflow_check_longlong" - ]; + excludedTests = [ + "reimport_from_subinterpreter" + ] + # cython's testsuite is not working very well with libc++ + # We are however optimistic about things outside of testsuite still working + ++ lib.optionals (stdenv.cc.isClang or false) [ + "cpdef_extern_func" + "libcpp_algo" + ] + # Some tests in the test suite aren't working on aarch64. + # Disable them for now until upstream finds a workaround. + # Upstream issue: https://github.com/cython/cython/issues/2308 + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "numpy_memoryview" ] + ++ lib.optionals stdenv.hostPlatform.isi686 [ + "future_division" + "overflow_check_longlong" + ]; commandline = builtins.concatStringsSep " " ( [ "-j$NIX_BUILD_CORES" diff --git a/pkgs/development/python-modules/daphne/default.nix b/pkgs/development/python-modules/daphne/default.nix index 45f910271159..39a42efdd439 100644 --- a/pkgs/development/python-modules/daphne/default.nix +++ b/pkgs/development/python-modules/daphne/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { asgiref autobahn twisted - ] ++ twisted.optional-dependencies.tls; + ] + ++ twisted.optional-dependencies.tls; nativeCheckInputs = [ django diff --git a/pkgs/development/python-modules/dask-awkward/default.nix b/pkgs/development/python-modules/dask-awkward/default.nix index b5c1a486f8d8..929ce2972247 100644 --- a/pkgs/development/python-modules/dask-awkward/default.nix +++ b/pkgs/development/python-modules/dask-awkward/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { pandas pytestCheckHook uproot - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "dask_awkward" ]; diff --git a/pkgs/development/python-modules/dask-glm/default.nix b/pkgs/development/python-modules/dask-glm/default.nix index ff4eb30f6339..3801ae817917 100644 --- a/pkgs/development/python-modules/dask-glm/default.nix +++ b/pkgs/development/python-modules/dask-glm/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { scikit-learn scipy sparse - ] ++ dask.optional-dependencies.array; + ] + ++ dask.optional-dependencies.array; nativeCheckInputs = [ pytest-xdist diff --git a/pkgs/development/python-modules/dask-jobqueue/default.nix b/pkgs/development/python-modules/dask-jobqueue/default.nix index db3e8a4876b3..cb1749072e99 100644 --- a/pkgs/development/python-modules/dask-jobqueue/default.nix +++ b/pkgs/development/python-modules/dask-jobqueue/default.nix @@ -42,54 +42,53 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # Require some unavailable pytest fixtures - "test_adapt" - "test_adaptive" - "test_adaptive_cores_mem" - "test_adaptive_grouped" - "test_adapt_parameters" - "test_basic" - "test_basic_scale_edge_cases" - "test_cluster" - "test_cluster_error_scheduler_arguments_should_use_scheduler_options" - "test_cluster_has_cores_and_memory" - "test_command_template" - "test_complex_cancel_command" - "test_config" - "test_dashboard_link" - "test_default_number_of_worker_processes" - "test_deprecation_env_extra" - "test_deprecation_extra" - "test_deprecation_job_extra" - "test_different_interfaces_on_scheduler_and_workers" - "test_docstring_cluster" - "test_extra_args_broken_cancel" - "test_forward_ip" - "test_import_scheduler_options_from_config" - "test_job" - "test_jobqueue_job_call" - "test_log_directory" - "test_scale_cores_memory" - "test_scale_grouped" - "test_scheduler_options" - "test_scheduler_options_interface" - "test_security" - "test_security_temporary" - "test_security_temporary_defaults" - "test_shebang_settings" - "test_use_stdin" - "test_worker_name_uses_cluster_name" - "test_wrong_parameter_error" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # ValueError: invalid operation on non-started TCPListener - "test_header" - "test_lsf_unit_detection" - "test_lsf_unit_detection_without_file" - "test_runner" - ]; + disabledTests = [ + # Require some unavailable pytest fixtures + "test_adapt" + "test_adaptive" + "test_adaptive_cores_mem" + "test_adaptive_grouped" + "test_adapt_parameters" + "test_basic" + "test_basic_scale_edge_cases" + "test_cluster" + "test_cluster_error_scheduler_arguments_should_use_scheduler_options" + "test_cluster_has_cores_and_memory" + "test_command_template" + "test_complex_cancel_command" + "test_config" + "test_dashboard_link" + "test_default_number_of_worker_processes" + "test_deprecation_env_extra" + "test_deprecation_extra" + "test_deprecation_job_extra" + "test_different_interfaces_on_scheduler_and_workers" + "test_docstring_cluster" + "test_extra_args_broken_cancel" + "test_forward_ip" + "test_import_scheduler_options_from_config" + "test_job" + "test_jobqueue_job_call" + "test_log_directory" + "test_scale_cores_memory" + "test_scale_grouped" + "test_scheduler_options" + "test_scheduler_options_interface" + "test_security" + "test_security_temporary" + "test_security_temporary_defaults" + "test_shebang_settings" + "test_use_stdin" + "test_worker_name_uses_cluster_name" + "test_wrong_parameter_error" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # ValueError: invalid operation on non-started TCPListener + "test_header" + "test_lsf_unit_detection" + "test_lsf_unit_detection_without_file" + "test_runner" + ]; pythonImportsCheck = [ "dask_jobqueue" ]; diff --git a/pkgs/development/python-modules/dask-ml/default.nix b/pkgs/development/python-modules/dask-ml/default.nix index 0a3d34493f9f..d78a16803c21 100644 --- a/pkgs/development/python-modules/dask-ml/default.nix +++ b/pkgs/development/python-modules/dask-ml/default.nix @@ -41,20 +41,19 @@ buildPythonPackage rec { hatchling ]; - dependencies = - [ - dask-glm - distributed - multipledispatch - numba - numpy - packaging - pandas - scikit-learn - scipy - ] - ++ dask.optional-dependencies.array - ++ dask.optional-dependencies.dataframe; + dependencies = [ + dask-glm + distributed + multipledispatch + numba + numpy + packaging + pandas + scikit-learn + scipy + ] + ++ dask.optional-dependencies.array + ++ dask.optional-dependencies.dataframe; pythonImportsCheck = [ "dask_ml" diff --git a/pkgs/development/python-modules/dask/default.nix b/pkgs/development/python-modules/dask/default.nix index 724477ee7ffd..66aba313253c 100644 --- a/pkgs/development/python-modules/dask/default.nix +++ b/pkgs/development/python-modules/dask/default.nix @@ -76,19 +76,19 @@ buildPythonPackage rec { optional-dependencies = lib.fix (self: { array = [ numpy ]; - complete = - [ - pyarrow - lz4 - ] - ++ self.array - ++ self.dataframe - ++ self.distributed - ++ self.diagnostics; + complete = [ + pyarrow + lz4 + ] + ++ self.array + ++ self.dataframe + ++ self.distributed + ++ self.diagnostics; dataframe = [ pandas pyarrow - ] ++ self.array; + ] + ++ self.array; distributed = [ distributed ]; diagnostics = [ bokeh @@ -96,20 +96,19 @@ buildPythonPackage rec { ]; }); - nativeCheckInputs = - [ - hypothesis - pyarrow - pytest-asyncio - pytest-cov-stub - pytest-mock - pytest-rerunfailures - pytest-xdist - pytestCheckHook - versionCheckHook - ] - ++ optional-dependencies.array - ++ optional-dependencies.dataframe; + nativeCheckInputs = [ + hypothesis + pyarrow + pytest-asyncio + pytest-cov-stub + pytest-mock + pytest-rerunfailures + pytest-xdist + pytestCheckHook + versionCheckHook + ] + ++ optional-dependencies.array + ++ optional-dependencies.dataframe; versionCheckProgramArg = "--version"; pytestFlagsArray = [ diff --git a/pkgs/development/python-modules/dataclass-wizard/default.nix b/pkgs/development/python-modules/dataclass-wizard/default.nix index b4fdfdc24194..399c25a08fe9 100644 --- a/pkgs/development/python-modules/dataclass-wizard/default.nix +++ b/pkgs/development/python-modules/dataclass-wizard/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-mock - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = [ ] diff --git a/pkgs/development/python-modules/datadog/default.nix b/pkgs/development/python-modules/datadog/default.nix index b2a6b3d967fd..bbb6bd33a26b 100644 --- a/pkgs/development/python-modules/datadog/default.nix +++ b/pkgs/development/python-modules/datadog/default.nix @@ -55,29 +55,28 @@ buildPythonPackage rec { "tests/integration/api/test_*.py" ]; - disabledTests = - [ - "test_default_settings_set" - # https://github.com/DataDog/datadogpy/issues/746 - "TestDogshell" + disabledTests = [ + "test_default_settings_set" + # https://github.com/DataDog/datadogpy/issues/746 + "TestDogshell" - # Flaky: test execution time against magic values - "test_distributed" - "test_timed" - "test_timed_in_ms" - "test_timed_start_stop_calls" + # Flaky: test execution time against magic values + "test_distributed" + "test_timed" + "test_timed_in_ms" + "test_timed_start_stop_calls" - # OSError: AF_UNIX path too long - "test_socket_connection" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/DataDog/datadogpy/issues/880 - "test_timed_coroutine" - ] - ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ - # PermissionError: [Errno 1] Operation not permitted - "test_dedicated_uds_telemetry_dest" - ]; + # OSError: AF_UNIX path too long + "test_socket_connection" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/DataDog/datadogpy/issues/880 + "test_timed_coroutine" + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isDarwin [ + # PermissionError: [Errno 1] Operation not permitted + "test_dedicated_uds_telemetry_dest" + ]; pythonImportsCheck = [ "datadog" ]; diff --git a/pkgs/development/python-modules/datafusion/default.nix b/pkgs/development/python-modules/datafusion/default.nix index 56c44a1e5e27..9ea5b128e10d 100644 --- a/pkgs/development/python-modules/datafusion/default.nix +++ b/pkgs/development/python-modules/datafusion/default.nix @@ -57,11 +57,12 @@ buildPythonPackage rec { protoc ]; - buildInputs = - [ protobuf ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + protobuf + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; dependencies = [ pyarrow diff --git a/pkgs/development/python-modules/datalad-next/default.nix b/pkgs/development/python-modules/datalad-next/default.nix index c15a1451b544..f1a1d09d5a26 100644 --- a/pkgs/development/python-modules/datalad-next/default.nix +++ b/pkgs/development/python-modules/datalad-next/default.nix @@ -65,44 +65,43 @@ buildPythonPackage rec { unzip ]; - disabledTests = - [ - # remotes available after datalad-next install (through `console_scripts`), but not yet in $PATH during test - "test_uncurl_addurl_unredirected" - "test_uncurl" - "test_uncurl_ria_access" - "test_uncurl_store" - "test_uncurl_remove" - "test_uncurl_testremote" - "test_replace_add_archive_content" - "test_annex_remote" - "test_export_remote" - "test_annex_remote_autorepush" - "test_export_remote_autorepush" - "test_typeweb_annex" - "test_typeweb_annex_uncompressed" - "test_typeweb_export" - "test_submodule_url" - "test_uncurl_progress_reporting_to_annex" - "test_archivist_retrieval" - "test_archivist_retrieval_legacy" + disabledTests = [ + # remotes available after datalad-next install (through `console_scripts`), but not yet in $PATH during test + "test_uncurl_addurl_unredirected" + "test_uncurl" + "test_uncurl_ria_access" + "test_uncurl_store" + "test_uncurl_remove" + "test_uncurl_testremote" + "test_replace_add_archive_content" + "test_annex_remote" + "test_export_remote" + "test_annex_remote_autorepush" + "test_export_remote_autorepush" + "test_typeweb_annex" + "test_typeweb_annex_uncompressed" + "test_typeweb_export" + "test_submodule_url" + "test_uncurl_progress_reporting_to_annex" + "test_archivist_retrieval" + "test_archivist_retrieval_legacy" - # hardcoded /bin path - "test_auto_if_wanted_data_transfer_path_restriction" + # hardcoded /bin path + "test_auto_if_wanted_data_transfer_path_restriction" - # requires internet access - "test_push_wanted" - "test_auto_data_transfer" - "test_http_url_operations" - "test_transparent_decompression" - "test_compressed_file_stay_compressed" - "test_ls_file_collection_tarfile" - "test_iter_tar" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # RuntimeError - "test_tree_with_broken_symlinks" - ]; + # requires internet access + "test_push_wanted" + "test_auto_data_transfer" + "test_http_url_operations" + "test_transparent_decompression" + "test_compressed_file_stay_compressed" + "test_ls_file_collection_tarfile" + "test_iter_tar" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # RuntimeError + "test_tree_with_broken_symlinks" + ]; disabledTestPaths = [ # requires internet access diff --git a/pkgs/development/python-modules/datalad/default.nix b/pkgs/development/python-modules/datalad/default.nix index a5ff31b2ea62..7b722425f6b5 100644 --- a/pkgs/development/python-modules/datalad/default.nix +++ b/pkgs/development/python-modules/datalad/default.nix @@ -82,23 +82,22 @@ buildPythonPackage rec { optional-dependencies.core ++ optional-dependencies.downloaders ++ optional-dependencies.publish; optional-dependencies = { - core = - [ - platformdirs - chardet - distro - iso8601 - humanize - fasteners - packaging - patool - tqdm - annexremote - looseversion - ] - ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] - ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; + core = [ + platformdirs + chardet + distro + iso8601 + humanize + fasteners + packaging + patool + tqdm + annexremote + looseversion + ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; downloaders = [ boto3 keyrings-alt diff --git a/pkgs/development/python-modules/dataproperty/default.nix b/pkgs/development/python-modules/dataproperty/default.nix index 050d0351fff3..172f5799b551 100644 --- a/pkgs/development/python-modules/dataproperty/default.nix +++ b/pkgs/development/python-modules/dataproperty/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { mbstrdecoder typepy tcolorpy - ] ++ typepy.optional-dependencies.datetime; + ] + ++ typepy.optional-dependencies.datetime; optional-dependencies = { logging = [ loguru ]; diff --git a/pkgs/development/python-modules/dateparser/default.nix b/pkgs/development/python-modules/dateparser/default.nix index 35e82d613d7d..3e3090a56a5f 100644 --- a/pkgs/development/python-modules/dateparser/default.nix +++ b/pkgs/development/python-modules/dateparser/default.nix @@ -60,7 +60,8 @@ buildPythonPackage rec { parsel requests ruamel-yaml - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' export HOME="$TEMPDIR" diff --git a/pkgs/development/python-modules/dbt-adapters/default.nix b/pkgs/development/python-modules/dbt-adapters/default.nix index bf46fba5008d..a142a26f0026 100644 --- a/pkgs/development/python-modules/dbt-adapters/default.nix +++ b/pkgs/development/python-modules/dbt-adapters/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { protobuf pytz typing-extensions - ] ++ mashumaro.optional-dependencies.msgpack; + ] + ++ mashumaro.optional-dependencies.msgpack; pythonImportsCheck = [ "dbt.adapters" ]; diff --git a/pkgs/development/python-modules/dbt-common/default.nix b/pkgs/development/python-modules/dbt-common/default.nix index e914ece39546..2bcc80d74e12 100644 --- a/pkgs/development/python-modules/dbt-common/default.nix +++ b/pkgs/development/python-modules/dbt-common/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { python-dateutil requests typing-extensions - ] ++ mashumaro.optional-dependencies.msgpack; + ] + ++ mashumaro.optional-dependencies.msgpack; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/dbt-core/default.nix b/pkgs/development/python-modules/dbt-core/default.nix index fb57ff19af1c..2f6937cda7f2 100644 --- a/pkgs/development/python-modules/dbt-core/default.nix +++ b/pkgs/development/python-modules/dbt-core/default.nix @@ -96,7 +96,8 @@ buildPythonPackage rec { snowplow-tracker sqlparse typing-extensions - ] ++ mashumaro.optional-dependencies.msgpack; + ] + ++ mashumaro.optional-dependencies.msgpack; # tests exist for the dbt tool but not for this package specifically doCheck = false; diff --git a/pkgs/development/python-modules/dbt-snowflake/default.nix b/pkgs/development/python-modules/dbt-snowflake/default.nix index 170f85e94f2c..9bd0f8552020 100644 --- a/pkgs/development/python-modules/dbt-snowflake/default.nix +++ b/pkgs/development/python-modules/dbt-snowflake/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { dependencies = [ dbt-core snowflake-connector-python - ] ++ snowflake-connector-python.optional-dependencies.secure-local-storage; + ] + ++ snowflake-connector-python.optional-dependencies.secure-local-storage; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/deal-solver/default.nix b/pkgs/development/python-modules/deal-solver/default.nix index 9aff8a2c598c..14d5074a0500 100644 --- a/pkgs/development/python-modules/deal-solver/default.nix +++ b/pkgs/development/python-modules/deal-solver/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { dependencies = [ z3-solver astroid - ] ++ z3-solver.requiredPythonModules; + ] + ++ z3-solver.requiredPythonModules; nativeCheckInputs = [ hypothesis diff --git a/pkgs/development/python-modules/deal/default.nix b/pkgs/development/python-modules/deal/default.nix index adb9759e92d6..dc8a622f4772 100644 --- a/pkgs/development/python-modules/deal/default.nix +++ b/pkgs/development/python-modules/deal/default.nix @@ -53,34 +53,33 @@ buildPythonPackage rec { vaa ]; - disabledTests = - [ - # Tests need internet access - "test_smoke_has" - "test_pure_offline" - "test_raises_doesnt_override_another_contract" - "test_raises_doesnt_override_another_contract_async" - "test_raises_generator" - # AttributeError: module 'vaa' has no attribute 'Error' - "test_source_vaa_scheme" - "test_vaa_scheme_and_custom_exception" - "test_scheme_string_validation_args_correct" - "test_method_chain_decorator_with_scheme_is_fulfilled" - "test_scheme_contract_is_satisfied_when_setting_arg" - "test_scheme_contract_is_satisfied_within_chain" - "test_scheme_errors_rewrite_message" - # assert errors - "test_doctest" - "test_no_violations" - "test_source_get_lambda_multiline_splitted_dec" - # assert basically correct but fails in string match due to '' removed - "test_unknown_command" - ] - ++ lib.optional (pythonAtLeast "3.13") [ - # assert basically correct but string match fails in due to - # ('pathlib._local', 'Path.write_text') != ('pathlib', 'Path.write_text') - "test_infer" - ]; + disabledTests = [ + # Tests need internet access + "test_smoke_has" + "test_pure_offline" + "test_raises_doesnt_override_another_contract" + "test_raises_doesnt_override_another_contract_async" + "test_raises_generator" + # AttributeError: module 'vaa' has no attribute 'Error' + "test_source_vaa_scheme" + "test_vaa_scheme_and_custom_exception" + "test_scheme_string_validation_args_correct" + "test_method_chain_decorator_with_scheme_is_fulfilled" + "test_scheme_contract_is_satisfied_when_setting_arg" + "test_scheme_contract_is_satisfied_within_chain" + "test_scheme_errors_rewrite_message" + # assert errors + "test_doctest" + "test_no_violations" + "test_source_get_lambda_multiline_splitted_dec" + # assert basically correct but fails in string match due to '' removed + "test_unknown_command" + ] + ++ lib.optional (pythonAtLeast "3.13") [ + # assert basically correct but string match fails in due to + # ('pathlib._local', 'Path.write_text') != ('pathlib', 'Path.write_text') + "test_infer" + ]; disabledTestPaths = [ # Test needs internet access diff --git a/pkgs/development/python-modules/debuglater/default.nix b/pkgs/development/python-modules/debuglater/default.nix index f5867b3a60db..eba80a50b26e 100644 --- a/pkgs/development/python-modules/debuglater/default.nix +++ b/pkgs/development/python-modules/debuglater/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { numpy pandas pytestCheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; pythonImportsCheck = [ "debuglater" ]; diff --git a/pkgs/development/python-modules/debugpy/default.nix b/pkgs/development/python-modules/debugpy/default.nix index 31c93c4642f0..82f85aaecfc8 100644 --- a/pkgs/development/python-modules/debugpy/default.nix +++ b/pkgs/development/python-modules/debugpy/default.nix @@ -37,41 +37,40 @@ buildPythonPackage rec { hash = "sha256-neo7A+bjAhuvqYY4YA3O0v5aWUKV91mqajI8gpY0QYs="; }; - patches = - [ - # Use nixpkgs version instead of versioneer - (replaceVars ./hardcode-version.patch { - inherit version; - }) + patches = [ + # Use nixpkgs version instead of versioneer + (replaceVars ./hardcode-version.patch { + inherit version; + }) - # Fix importing debugpy in: - # - test_nodebug[module-launch(externalTerminal)] - # - test_nodebug[module-launch(integratedTerminal)] - # - # NOTE: The import failures seen in these tests without the patch - # will be seen if a user "installs" debugpy by adding it to PYTHONPATH. - # To avoid this issue, debugpy should be installed using python.withPackages: - # python.withPackages (ps: with ps; [ debugpy ]) - ./fix-test-pythonpath.patch + # Fix importing debugpy in: + # - test_nodebug[module-launch(externalTerminal)] + # - test_nodebug[module-launch(integratedTerminal)] + # + # NOTE: The import failures seen in these tests without the patch + # will be seen if a user "installs" debugpy by adding it to PYTHONPATH. + # To avoid this issue, debugpy should be installed using python.withPackages: + # python.withPackages (ps: with ps; [ debugpy ]) + ./fix-test-pythonpath.patch - # Attach pid tests are disabled by default on windows & macos, - # but are also flaky on linux: - # - https://github.com/NixOS/nixpkgs/issues/262000 - # - https://github.com/NixOS/nixpkgs/issues/251045 - ./skip-attach-pid-tests.patch - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Hard code GDB path (used to attach to process) - (replaceVars ./hardcode-gdb.patch { - inherit gdb; - }) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Hard code LLDB path (used to attach to process) - (replaceVars ./hardcode-lldb.patch { - inherit lldb; - }) - ]; + # Attach pid tests are disabled by default on windows & macos, + # but are also flaky on linux: + # - https://github.com/NixOS/nixpkgs/issues/262000 + # - https://github.com/NixOS/nixpkgs/issues/251045 + ./skip-attach-pid-tests.patch + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # Hard code GDB path (used to attach to process) + (replaceVars ./hardcode-gdb.patch { + inherit gdb; + }) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Hard code LLDB path (used to attach to process) + (replaceVars ./hardcode-lldb.patch { + inherit lldb; + }) + ]; # Compile attach library for host platform # Derived from linux_and_mac/compile_linux.sh & linux_and_mac/compile_mac.sh @@ -116,15 +115,14 @@ buildPythonPackage rec { typing-extensions ]; - preCheck = - '' - export DEBUGPY_PROCESS_SPAWN_TIMEOUT=0 - export DEBUGPY_PROCESS_EXIT_TIMEOUT=0 - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' - # https://github.com/python/cpython/issues/74570#issuecomment-1093748531 - export no_proxy='*'; - ''; + preCheck = '' + export DEBUGPY_PROCESS_SPAWN_TIMEOUT=0 + export DEBUGPY_PROCESS_EXIT_TIMEOUT=0 + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + # https://github.com/python/cpython/issues/74570#issuecomment-1093748531 + export no_proxy='*'; + ''; postCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' unset no_proxy diff --git a/pkgs/development/python-modules/deepdiff/default.nix b/pkgs/development/python-modules/deepdiff/default.nix index 68dc5da1d7db..7a38d9f02ce0 100644 --- a/pkgs/development/python-modules/deepdiff/default.nix +++ b/pkgs/development/python-modules/deepdiff/default.nix @@ -63,21 +63,21 @@ buildPythonPackage rec { tomli-w polars pandas - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); - disabledTests = - [ - # not compatible with pydantic 2.x - "test_pydantic1" - "test_pydantic2" - # Require pytest-benchmark - "test_cache_deeply_nested_a1" - "test_lfu" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Times out on darwin in Hydra - "test_repeated_timer" - ]; + disabledTests = [ + # not compatible with pydantic 2.x + "test_pydantic1" + "test_pydantic2" + # Require pytest-benchmark + "test_cache_deeply_nested_a1" + "test_lfu" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Times out on darwin in Hydra + "test_repeated_timer" + ]; pythonImportsCheck = [ "deepdiff" ]; diff --git a/pkgs/development/python-modules/defcon/default.nix b/pkgs/development/python-modules/defcon/default.nix index 75ecaf7a4a6a..06efc8018d32 100644 --- a/pkgs/development/python-modules/defcon/default.nix +++ b/pkgs/development/python-modules/defcon/default.nix @@ -24,12 +24,11 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = - [ - fonttools - ] - ++ fonttools.optional-dependencies.ufo - ++ fonttools.optional-dependencies.unicode; + propagatedBuildInputs = [ + fonttools + ] + ++ fonttools.optional-dependencies.ufo + ++ fonttools.optional-dependencies.unicode; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/deltalake/default.nix b/pkgs/development/python-modules/deltalake/default.nix index 8732a1b2aa1a..f1b529a35f63 100644 --- a/pkgs/development/python-modules/deltalake/default.nix +++ b/pkgs/development/python-modules/deltalake/default.nix @@ -40,22 +40,20 @@ buildPythonPackage rec { pyarrow-hotfix ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; - nativeBuildInputs = - [ - pkg-config # openssl-sys needs this - ] - ++ (with rustPlatform; [ - cargoSetupHook - maturinBuildHook - ]); + nativeBuildInputs = [ + pkg-config # openssl-sys needs this + ] + ++ (with rustPlatform; [ + cargoSetupHook + maturinBuildHook + ]); pythonImportsCheck = [ "deltalake" ]; diff --git a/pkgs/development/python-modules/denonavr/default.nix b/pkgs/development/python-modules/denonavr/default.nix index 4e24a4f1419e..55ea60f0fd90 100644 --- a/pkgs/development/python-modules/denonavr/default.nix +++ b/pkgs/development/python-modules/denonavr/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { ftfy httpx netifaces - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/dependency-injector/default.nix b/pkgs/development/python-modules/dependency-injector/default.nix index 8c75b9e5b916..cd48ac472e5e 100644 --- a/pkgs/development/python-modules/dependency-injector/default.nix +++ b/pkgs/development/python-modules/dependency-injector/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { pytest-asyncio pytestCheckHook scipy - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "dependency_injector" ]; diff --git a/pkgs/development/python-modules/depyf/default.nix b/pkgs/development/python-modules/depyf/default.nix index 3408fee712ec..a59dec3ac9ff 100644 --- a/pkgs/development/python-modules/depyf/default.nix +++ b/pkgs/development/python-modules/depyf/default.nix @@ -51,25 +51,24 @@ buildPythonPackage rec { torch ]; - disabledTestPaths = - [ - # if self.quitting: raise BdbQuit - # E bdb.BdbQuit - "tests/test_pytorch/test_pytorch.py" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ + disabledTestPaths = [ + # if self.quitting: raise BdbQuit + # E bdb.BdbQuit + "tests/test_pytorch/test_pytorch.py" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ - # depyf.decompiler.DecompilationError: DecompilationError: Failed to decompile instruction ... - # NotImplementedError: Unsupported instruction: LOAD_FAST_LOAD_FAST - "tests/test_code_owner.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # E torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised: - # E CppCompileError: C++ compile error - "tests/test_pytorch/test_export.py" - "tests/test_pytorch/test_logging.py" - "tests/test_pytorch/test_simple_graph.py" - ]; + # depyf.decompiler.DecompilationError: DecompilationError: Failed to decompile instruction ... + # NotImplementedError: Unsupported instruction: LOAD_FAST_LOAD_FAST + "tests/test_code_owner.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # E torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised: + # E CppCompileError: C++ compile error + "tests/test_pytorch/test_export.py" + "tests/test_pytorch/test_logging.py" + "tests/test_pytorch/test_simple_graph.py" + ]; # All remaining tests fail with: # ValueError: invalid literal for int() with base 10: 'L1' diff --git a/pkgs/development/python-modules/desktop-notifier/default.nix b/pkgs/development/python-modules/desktop-notifier/default.nix index a2b514901be5..565f2a369278 100644 --- a/pkgs/development/python-modules/desktop-notifier/default.nix +++ b/pkgs/development/python-modules/desktop-notifier/default.nix @@ -28,14 +28,13 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - bidict - packaging - typing-extensions - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ dbus-fast ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ rubicon-objc ]; + dependencies = [ + bidict + packaging + typing-extensions + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ dbus-fast ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ rubicon-objc ]; # no tests available, do the imports check instead doCheck = false; diff --git a/pkgs/development/python-modules/detectron2/default.nix b/pkgs/development/python-modules/detectron2/default.nix index e49545abbc4f..2a7fb8b7d9aa 100644 --- a/pkgs/development/python-modules/detectron2/default.nix +++ b/pkgs/development/python-modules/detectron2/default.nix @@ -148,48 +148,47 @@ buildPythonPackage { "tests/data/test_coco_evaluation.py" ]; - disabledTests = - [ - # fails for some reason - "test_checkpoint_resume" - "test_map_style" - # requires shapely - "test_resize_and_crop" - # require caffe2 - "test_predict_boxes_tracing" - "test_predict_probs_tracing" - "testMaskRCNN" - "testRetinaNet" - # require coco dataset - "test_default_trainer" - "test_unknown_category" - "test_build_dataloader_train" - "test_build_iterable_dataloader_train" - # require network access - "test_opencv_exif_orientation" - "test_read_exif_orientation" - # use deprecated api, numpy.bool - "test_BWmode_nomask" - "test_draw_binary_mask" - "test_draw_empty_mask_predictions" - "test_draw_instance_predictions" - "test_draw_no_metadata" - "test_overlay_instances" - "test_overlay_instances_no_boxes" - "test_get_bounding_box" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - "test_build_batch_dataloader_inference" - "test_build_dataloader_inference" - "test_build_iterable_dataloader_inference" - "test_to_iterable" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: required keyword attribute 'value' has the wrong type - "test_apply_deltas_tracing" - "test_imagelist_padding_tracing" - "test_roi_pooler_tracing" - ]; + disabledTests = [ + # fails for some reason + "test_checkpoint_resume" + "test_map_style" + # requires shapely + "test_resize_and_crop" + # require caffe2 + "test_predict_boxes_tracing" + "test_predict_probs_tracing" + "testMaskRCNN" + "testRetinaNet" + # require coco dataset + "test_default_trainer" + "test_unknown_category" + "test_build_dataloader_train" + "test_build_iterable_dataloader_train" + # require network access + "test_opencv_exif_orientation" + "test_read_exif_orientation" + # use deprecated api, numpy.bool + "test_BWmode_nomask" + "test_draw_binary_mask" + "test_draw_empty_mask_predictions" + "test_draw_instance_predictions" + "test_draw_no_metadata" + "test_overlay_instances" + "test_overlay_instances_no_boxes" + "test_get_bounding_box" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + "test_build_batch_dataloader_inference" + "test_build_dataloader_inference" + "test_build_iterable_dataloader_inference" + "test_to_iterable" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: required keyword attribute 'value' has the wrong type + "test_apply_deltas_tracing" + "test_imagelist_padding_tracing" + "test_roi_pooler_tracing" + ]; pythonImportsCheck = [ "detectron2" ]; diff --git a/pkgs/development/python-modules/devito/default.nix b/pkgs/development/python-modules/devito/default.nix index d4bcd7e0e9e6..e45af5102e64 100644 --- a/pkgs/development/python-modules/devito/default.nix +++ b/pkgs/development/python-modules/devito/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { psutil py-cpuinfo sympy - ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; nativeCheckInputs = [ click @@ -73,69 +74,67 @@ buildPythonPackage rec { scipy ]; - pytestFlagsArray = - [ - "-x" - # Tests marked as 'parallel' require mpi and fail in the sandbox: - # FileNotFoundError: [Errno 2] No such file or directory: 'mpiexec' - "-m 'not parallel'" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # assert np.all(f.data == check) - # assert Data(False) - "--deselect tests/test_data.py::TestDataReference::test_w_data" + pytestFlagsArray = [ + "-x" + # Tests marked as 'parallel' require mpi and fail in the sandbox: + # FileNotFoundError: [Errno 2] No such file or directory: 'mpiexec' + "-m 'not parallel'" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # assert np.all(f.data == check) + # assert Data(False) + "--deselect tests/test_data.py::TestDataReference::test_w_data" - # AssertionError: assert 'omp for schedule(dynamic,1)' == 'omp for coll...le(dynamic,1)' - "--deselect tests/test_dle.py::TestNestedParallelism::test_nested_cache_blocking_structure_subdims" + # AssertionError: assert 'omp for schedule(dynamic,1)' == 'omp for coll...le(dynamic,1)' + "--deselect tests/test_dle.py::TestNestedParallelism::test_nested_cache_blocking_structure_subdims" - # codepy.CompileError: module compilation failed - # FAILED compiler invocation - "--deselect tests/test_dle.py::TestNodeParallelism::test_dynamic_nthreads" + # codepy.CompileError: module compilation failed + # FAILED compiler invocation + "--deselect tests/test_dle.py::TestNodeParallelism::test_dynamic_nthreads" - # AssertionError: assert all(not i.pragmas for i in iters[2:]) - "--deselect tests/test_dle.py::TestNodeParallelism::test_incr_perfect_sparse_outer" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # IndexError: tuple index out of range - "--deselect tests/test_dle.py::TestNestedParallelism" + # AssertionError: assert all(not i.pragmas for i in iters[2:]) + "--deselect tests/test_dle.py::TestNodeParallelism::test_incr_perfect_sparse_outer" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # IndexError: tuple index out of range + "--deselect tests/test_dle.py::TestNestedParallelism" - # codepy.CompileError: module compilation failed - "--deselect tests/test_autotuner.py::test_nested_nthreads" + # codepy.CompileError: module compilation failed + "--deselect tests/test_autotuner.py::test_nested_nthreads" - # assert np.all(np.isclose(f0.data, check0)) - # assert Data(false) - "--deselect tests/test_interpolation.py::TestSubDomainInterpolation::test_inject_subdomain" - ]; + # assert np.all(np.isclose(f0.data, check0)) + # assert Data(false) + "--deselect tests/test_interpolation.py::TestSubDomainInterpolation::test_inject_subdomain" + ]; - disabledTests = - [ - # Download dataset from the internet - "test_gs_2d_float" - "test_gs_2d_int" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # FAILED tests/test_unexpansion.py::Test2Pass::test_v0 - assert False - "test_v0" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # FAILED tests/test_caching.py::TestCaching::test_special_symbols - ValueError: not enough values to unpack (expected 3, got 2) - "test_special_symbols" + disabledTests = [ + # Download dataset from the internet + "test_gs_2d_float" + "test_gs_2d_int" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # FAILED tests/test_unexpansion.py::Test2Pass::test_v0 - assert False + "test_v0" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # FAILED tests/test_caching.py::TestCaching::test_special_symbols - ValueError: not enough values to unpack (expected 3, got 2) + "test_special_symbols" - # FAILED tests/test_unexpansion.py::Test2Pass::test_v0 - codepy.CompileError: module compilation failed - "test_v0" + # FAILED tests/test_unexpansion.py::Test2Pass::test_v0 - codepy.CompileError: module compilation failed + "test_v0" - # AssertionError: assert(np.allclose(grad_u.data, grad_v.data, rtol=tolerance, atol=tolerance)) - "test_gradient_equivalence" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # Numerical tests - "test_lm_fb" - "test_lm_ds" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # Numerical error - "test_pow_precision" - ]; + # AssertionError: assert(np.allclose(grad_u.data, grad_v.data, rtol=tolerance, atol=tolerance)) + "test_gradient_equivalence" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # Numerical tests + "test_lm_fb" + "test_lm_ds" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # Numerical error + "test_pow_precision" + ]; disabledTestPaths = lib.optionals diff --git a/pkgs/development/python-modules/diffimg/default.nix b/pkgs/development/python-modules/diffimg/default.nix index f263bdf48fad..a6a412a82fca 100644 --- a/pkgs/development/python-modules/diffimg/default.nix +++ b/pkgs/development/python-modules/diffimg/default.nix @@ -21,15 +21,14 @@ buildPythonPackage { # it imports the wrong diff, # fix offered to upstream https://github.com/nicolashahn/diffimg/pull/6 - postPatch = - '' - substituteInPlace diffimg/test.py \ - --replace-warn "from diff import diff" "from diffimg.diff import diff" - '' - + lib.optionalString (pythonAtLeast "3.12") '' - substituteInPlace diffimg/test.py \ - --replace-warn "3503192421617232" "3503192421617233" - ''; + postPatch = '' + substituteInPlace diffimg/test.py \ + --replace-warn "from diff import diff" "from diffimg.diff import diff" + '' + + lib.optionalString (pythonAtLeast "3.12") '' + substituteInPlace diffimg/test.py \ + --replace-warn "3503192421617232" "3503192421617233" + ''; propagatedBuildInputs = [ pillow ]; diff --git a/pkgs/development/python-modules/diffusers/default.nix b/pkgs/development/python-modules/diffusers/default.nix index d430a0311301..acca06015abd 100644 --- a/pkgs/development/python-modules/diffusers/default.nix +++ b/pkgs/development/python-modules/diffusers/default.nix @@ -103,7 +103,8 @@ buildPythonPackage rec { sentencepiece torchsde transformers - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = let @@ -135,28 +136,27 @@ buildPythonPackage rec { enabledTestPaths = [ "tests/" ]; - disabledTests = - [ - # depends on current working directory - "test_deprecate_stacklevel" - # fails due to precision of floating point numbers - "test_full_loop_no_noise" - "test_model_cpu_offload_forward_pass" - # tries to run ruff which we have intentionally removed from nativeCheckInputs - "test_is_copy_consistent" + disabledTests = [ + # depends on current working directory + "test_deprecate_stacklevel" + # fails due to precision of floating point numbers + "test_full_loop_no_noise" + "test_model_cpu_offload_forward_pass" + # tries to run ruff which we have intentionally removed from nativeCheckInputs + "test_is_copy_consistent" - # Require unpackaged torchao: - # importlib.metadata.PackageNotFoundError: No package metadata was found for torchao - "test_load_attn_procs_raise_warning" - "test_save_attn_procs_raise_warning" - "test_save_load_lora_adapter_0" - "test_save_load_lora_adapter_1" - "test_wrong_adapter_name_raises_error" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # RuntimeError: Dynamo is not supported on Python 3.12+ - "test_from_save_pretrained_dynamo" - ]; + # Require unpackaged torchao: + # importlib.metadata.PackageNotFoundError: No package metadata was found for torchao + "test_load_attn_procs_raise_warning" + "test_save_attn_procs_raise_warning" + "test_save_load_lora_adapter_0" + "test_save_load_lora_adapter_1" + "test_wrong_adapter_name_raises_error" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # RuntimeError: Dynamo is not supported on Python 3.12+ + "test_from_save_pretrained_dynamo" + ]; passthru.tests.pytest = diffusers.overridePythonAttrs { doCheck = true; }; diff --git a/pkgs/development/python-modules/discordpy/default.nix b/pkgs/development/python-modules/discordpy/default.nix index 922d2535013d..592bb9495422 100644 --- a/pkgs/development/python-modules/discordpy/default.nix +++ b/pkgs/development/python-modules/discordpy/default.nix @@ -32,7 +32,8 @@ buildPythonPackage { dependencies = [ aiohttp audioop-lts - ] ++ lib.optionals withVoice [ pynacl ]; + ] + ++ lib.optionals withVoice [ pynacl ]; patchPhase = lib.optionalString withVoice '' substituteInPlace "discord/opus.py" \ diff --git a/pkgs/development/python-modules/disnake/default.nix b/pkgs/development/python-modules/disnake/default.nix index 6aa8bfc4d851..5c70ba2277f8 100644 --- a/pkgs/development/python-modules/disnake/default.nix +++ b/pkgs/development/python-modules/disnake/default.nix @@ -27,15 +27,14 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - aiohttp - ] - ++ lib.optionals withVoice [ - libopus - pynacl - ffmpeg - ]; + dependencies = [ + aiohttp + ] + ++ lib.optionals withVoice [ + libopus + pynacl + ffmpeg + ]; postPatch = lib.optionalString withVoice '' substituteInPlace "disnake/opus.py" \ diff --git a/pkgs/development/python-modules/dissect-cobaltstrike/default.nix b/pkgs/development/python-modules/dissect-cobaltstrike/default.nix index 8cd3e3f982f6..4c8bdc38dfae 100644 --- a/pkgs/development/python-modules/dissect-cobaltstrike/default.nix +++ b/pkgs/development/python-modules/dissect-cobaltstrike/default.nix @@ -68,7 +68,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-httpserver pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "dissect.cobaltstrike" ]; diff --git a/pkgs/development/python-modules/dissect-target/default.nix b/pkgs/development/python-modules/dissect-target/default.nix index 962c5f8c2f9f..63244068e674 100644 --- a/pkgs/development/python-modules/dissect-target/default.nix +++ b/pkgs/development/python-modules/dissect-target/default.nix @@ -103,7 +103,8 @@ buildPythonPackage rec { ruamel-yaml yara-python zstandard - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; yara = [ yara-python ] ++ optional-dependencies.full; smb = [ impacket ] ++ optional-dependencies.full; mqtt = [ paho-mqtt ] ++ optional-dependencies.full; @@ -112,47 +113,47 @@ buildPythonPackage rec { nativeCheckInputs = [ docutils pytestCheckHook - ] ++ optional-dependencies.full; + ] + ++ optional-dependencies.full; pythonImportsCheck = [ "dissect.target" ]; - disabledTests = - [ - "test_cp_directory" - "test_cp_subdirectories" - "test_cpio" - "test_env_parser" - "test_list_json" - "test_list" - "test_shell_cli" - "test_shell_cmd" - "test_shell_prompt_tab_autocomplete" - # Test requires rdump - "test_exec_target_command" - # Issue with tar file - "test_dpapi_decrypt_blob" - "test_md" - "test_nested_md_lvm" - "test_notifications_appdb" - "test_notifications_wpndatabase" - "test_tar_anonymous_filesystems" - "test_tar_sensitive_drive_letter" - # Tests compare dates and times - "yum" - # Filesystem access, windows defender tests - "test_config_tree_plugin" - "test_defender_quarantine_recovery" - "test_execute_pipeline" - "test_keychain_register_keychain_file" - "test_plugins_child_docker" - "test_plugins_child_wsl" - "test_reg_output" - "test_regflex" - "test_systemd_basic_syntax" - "test_target" - "test_yara" - ] - ++ + disabledTests = [ + "test_cp_directory" + "test_cp_subdirectories" + "test_cpio" + "test_env_parser" + "test_list_json" + "test_list" + "test_shell_cli" + "test_shell_cmd" + "test_shell_prompt_tab_autocomplete" + # Test requires rdump + "test_exec_target_command" + # Issue with tar file + "test_dpapi_decrypt_blob" + "test_md" + "test_nested_md_lvm" + "test_notifications_appdb" + "test_notifications_wpndatabase" + "test_tar_anonymous_filesystems" + "test_tar_sensitive_drive_letter" + # Tests compare dates and times + "yum" + # Filesystem access, windows defender tests + "test_config_tree_plugin" + "test_defender_quarantine_recovery" + "test_execute_pipeline" + "test_keychain_register_keychain_file" + "test_plugins_child_docker" + "test_plugins_child_wsl" + "test_reg_output" + "test_regflex" + "test_systemd_basic_syntax" + "test_target" + "test_yara" + ] + ++ # test is broken on Darwin lib.optional stdenv.hostPlatform.isDarwin "test_fs_attrs_no_os_listxattr"; diff --git a/pkgs/development/python-modules/dissect/default.nix b/pkgs/development/python-modules/dissect/default.nix index 3f02b6906971..22d017e2bb1c 100644 --- a/pkgs/development/python-modules/dissect/default.nix +++ b/pkgs/development/python-modules/dissect/default.nix @@ -85,7 +85,8 @@ buildPythonPackage rec { dissect-vmfs dissect-volume dissect-xfs - ] ++ dissect-target.optional-dependencies.full; + ] + ++ dissect-target.optional-dependencies.full; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/distributed/default.nix b/pkgs/development/python-modules/distributed/default.nix index 522add7a8098..6f2bb78a106f 100644 --- a/pkgs/development/python-modules/distributed/default.nix +++ b/pkgs/development/python-modules/distributed/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { setuptools setuptools-scm versioneer - ] ++ versioneer.optional-dependencies.toml; + ] + ++ versioneer.optional-dependencies.toml; pythonRelaxDeps = [ "dask" ]; diff --git a/pkgs/development/python-modules/dj-rest-auth/default.nix b/pkgs/development/python-modules/dj-rest-auth/default.nix index dffa779db8b7..a00c31ab7aed 100644 --- a/pkgs/development/python-modules/dj-rest-auth/default.nix +++ b/pkgs/development/python-modules/dj-rest-auth/default.nix @@ -56,13 +56,15 @@ buildPythonPackage rec { optional-dependencies.with_social = [ django-allauth - ] ++ django-allauth.optional-dependencies.socialaccount; + ] + ++ django-allauth.optional-dependencies.socialaccount; nativeCheckInputs = [ djangorestframework-simplejwt responses unittest-xml-reporting - ] ++ optional-dependencies.with_social; + ] + ++ optional-dependencies.with_social; checkInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/django-allauth/default.nix b/pkgs/development/python-modules/django-allauth/default.nix index 1fb4dd342d5d..3e1b6e31a42c 100644 --- a/pkgs/development/python-modules/django-allauth/default.nix +++ b/pkgs/development/python-modules/django-allauth/default.nix @@ -71,7 +71,8 @@ buildPythonPackage rec { idp-oidc = [ oauthlib pyjwt - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; mfa = [ fido2 qrcode @@ -82,7 +83,8 @@ buildPythonPackage rec { requests requests-oauthlib pyjwt - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; steam = [ python3-openid ]; }; @@ -97,7 +99,8 @@ buildPythonPackage rec { pytest-django pytestCheckHook pyyaml - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = [ # Tests require network access diff --git a/pkgs/development/python-modules/django-anymail/default.nix b/pkgs/development/python-modules/django-anymail/default.nix index a01df2135750..3ffbd7d39494 100644 --- a/pkgs/development/python-modules/django-anymail/default.nix +++ b/pkgs/development/python-modules/django-anymail/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock responses - ] ++ optional-dependencies.amazon-ses; + ] + ++ optional-dependencies.amazon-ses; optional-dependencies = { amazon-ses = [ boto3 ]; diff --git a/pkgs/development/python-modules/django-bootstrap5/default.nix b/pkgs/development/python-modules/django-bootstrap5/default.nix index 7b7f2bba0620..4f90dc026c23 100644 --- a/pkgs/development/python-modules/django-bootstrap5/default.nix +++ b/pkgs/development/python-modules/django-bootstrap5/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { pillow pytest-django pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' export DJANGO_SETTINGS_MODULE=tests.app.settings diff --git a/pkgs/development/python-modules/django-filingcabinet/default.nix b/pkgs/development/python-modules/django-filingcabinet/default.nix index 8e9e8b46d6e0..78fc0f5d76ae 100644 --- a/pkgs/development/python-modules/django-filingcabinet/default.nix +++ b/pkgs/development/python-modules/django-filingcabinet/default.nix @@ -125,13 +125,12 @@ buildPythonPackage rec { "test_document_viewer" ]; - preCheck = - '' - export DJANGO_SETTINGS_MODULE="test_project.settings" - '' - + lib.optionalString (!stdenv.hostPlatform.isRiscV) '' - export PLAYWRIGHT_BROWSERS_PATH="${playwright-driver.browsers}" - ''; + preCheck = '' + export DJANGO_SETTINGS_MODULE="test_project.settings" + '' + + lib.optionalString (!stdenv.hostPlatform.isRiscV) '' + export PLAYWRIGHT_BROWSERS_PATH="${playwright-driver.browsers}" + ''; pythonImportsCheck = [ "filingcabinet" ]; diff --git a/pkgs/development/python-modules/django-haystack/default.nix b/pkgs/development/python-modules/django-haystack/default.nix index 1ee1380b48f4..3074361bcc6e 100644 --- a/pkgs/development/python-modules/django-haystack/default.nix +++ b/pkgs/development/python-modules/django-haystack/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { python-dateutil requests whoosh - ] ++ optional-dependencies.elasticsearch; + ] + ++ optional-dependencies.elasticsearch; checkPhase = '' runHook preCheck diff --git a/pkgs/development/python-modules/django-import-export/default.nix b/pkgs/development/python-modules/django-import-export/default.nix index 7ce8cc7bda7c..938566af2586 100644 --- a/pkgs/development/python-modules/django-import-export/default.nix +++ b/pkgs/development/python-modules/django-import-export/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { chardet psycopg2 pytz - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); checkPhase = '' runHook preCheck diff --git a/pkgs/development/python-modules/django-mailman3/default.nix b/pkgs/development/python-modules/django-mailman3/default.nix index ac40a0b9ca9e..b2836f93bc56 100644 --- a/pkgs/development/python-modules/django-mailman3/default.nix +++ b/pkgs/development/python-modules/django-mailman3/default.nix @@ -34,15 +34,14 @@ buildPythonPackage rec { build-system = [ pdm-backend ]; - dependencies = - [ - django-allauth - django-gravatar2 - mailmanclient - pytz - ] - ++ django-allauth.optional-dependencies.openid - ++ django-allauth.optional-dependencies.socialaccount; + dependencies = [ + django-allauth + django-gravatar2 + mailmanclient + pytz + ] + ++ django-allauth.optional-dependencies.openid + ++ django-allauth.optional-dependencies.socialaccount; nativeCheckInputs = [ django diff --git a/pkgs/development/python-modules/django-markup/default.nix b/pkgs/development/python-modules/django-markup/default.nix index f5d5eeaaa93c..af4ba2fec816 100644 --- a/pkgs/development/python-modules/django-markup/default.nix +++ b/pkgs/development/python-modules/django-markup/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { pytest-cov-stub pytest-django pytestCheckHook - ] ++ optional-dependencies.all_filter_dependencies; + ] + ++ optional-dependencies.all_filter_dependencies; disabledTests = [ # pygments compat issue diff --git a/pkgs/development/python-modules/django-modelcluster/default.nix b/pkgs/development/python-modules/django-modelcluster/default.nix index a2dd8f0f62c5..ada5591773f9 100644 --- a/pkgs/development/python-modules/django-modelcluster/default.nix +++ b/pkgs/development/python-modules/django-modelcluster/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-django pytestCheckHook - ] ++ optional-dependencies.taggit; + ] + ++ optional-dependencies.taggit; pythonImportsCheck = [ "modelcluster" ]; diff --git a/pkgs/development/python-modules/django-payments/default.nix b/pkgs/development/python-modules/django-payments/default.nix index 83ba9f7709e5..6fd877610e6f 100644 --- a/pkgs/development/python-modules/django-payments/default.nix +++ b/pkgs/development/python-modules/django-payments/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { django django-phonenumber-field requests - ] ++ django-phonenumber-field.optional-dependencies.phonenumberslite; + ] + ++ django-phonenumber-field.optional-dependencies.phonenumberslite; # require internet connection doCheck = false; diff --git a/pkgs/development/python-modules/django-q2/default.nix b/pkgs/development/python-modules/django-q2/default.nix index 3b388ab34cf5..09370355b3f5 100644 --- a/pkgs/development/python-modules/django-q2/default.nix +++ b/pkgs/development/python-modules/django-q2/default.nix @@ -79,21 +79,20 @@ buildPythonPackage rec { REDIS_HOST = "127.0.0.1"; }; - disabledTests = - [ - # requires a running mongodb - "test_mongo" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fails with an assertion - "test_max_rss" - "test_recycle" - # cannot connect to redis - "test_broker" - "test_custom" - "test_redis" - "test_redis_connection" - ]; + disabledTests = [ + # requires a running mongodb + "test_mongo" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fails with an assertion + "test_max_rss" + "test_recycle" + # cannot connect to redis + "test_broker" + "test_custom" + "test_redis" + "test_redis_connection" + ]; disabledTestPaths = [ "django_q/tests/test_commands.py" diff --git a/pkgs/development/python-modules/django-redis/default.nix b/pkgs/development/python-modules/django-redis/default.nix index 5ef1907e22f1..e6e3356b600f 100644 --- a/pkgs/development/python-modules/django-redis/default.nix +++ b/pkgs/development/python-modules/django-redis/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { pytest-xdist pytestCheckHook redisTestHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # https://github.com/jazzband/django-redis/issues/777 dontUsePytestXdist = true; diff --git a/pkgs/development/python-modules/django-storages/default.nix b/pkgs/development/python-modules/django-storages/default.nix index fa241f9a7048..7bfe64c0ea6d 100644 --- a/pkgs/development/python-modules/django-storages/default.nix +++ b/pkgs/development/python-modules/django-storages/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { moto pytestCheckHook rsa - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); checkInputs = [ pynacl ]; diff --git a/pkgs/development/python-modules/django-stubs/default.nix b/pkgs/development/python-modules/django-stubs/default.nix index fe7267097073..bc7897dd6ba9 100644 --- a/pkgs/development/python-modules/django-stubs/default.nix +++ b/pkgs/development/python-modules/django-stubs/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { types-pytz types-pyyaml typing-extensions - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; optional-dependencies = { compatible-mypy = [ mypy ]; @@ -48,7 +49,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "django-stubs" ]; diff --git a/pkgs/development/python-modules/django-tables2/default.nix b/pkgs/development/python-modules/django-tables2/default.nix index ba0d88373064..3ede021e0e82 100644 --- a/pkgs/development/python-modules/django-tables2/default.nix +++ b/pkgs/development/python-modules/django-tables2/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { pyyaml pytest-django pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); meta = with lib; { changelog = "https://github.com/jieter/django-tables2/blob/v${version}/CHANGELOG.md"; diff --git a/pkgs/development/python-modules/django/3.nix b/pkgs/development/python-modules/django/3.nix index 29f8c4715de4..d05e8bc7a565 100644 --- a/pkgs/development/python-modules/django/3.nix +++ b/pkgs/development/python-modules/django/3.nix @@ -27,19 +27,18 @@ buildPythonPackage rec { hash = "sha256-fKOKeGVK7nI3hZTWPlFjbAS44oV09VBd/2MIlbVHJ3c="; }; - patches = - [ - (replaceVars ./django_3_set_zoneinfo_dir.patch { - zoneinfo = tzdata + "/share/zoneinfo"; - }) - ] - ++ lib.optional withGdal ( - replaceVars ./django_3_set_geos_gdal_lib.patch { - inherit geos_3_9; - inherit gdal; - extension = stdenv.hostPlatform.extensions.sharedLibrary; - } - ); + patches = [ + (replaceVars ./django_3_set_zoneinfo_dir.patch { + zoneinfo = tzdata + "/share/zoneinfo"; + }) + ] + ++ lib.optional withGdal ( + replaceVars ./django_3_set_geos_gdal_lib.patch { + inherit geos_3_9; + inherit gdal; + extension = stdenv.hostPlatform.extensions.sharedLibrary; + } + ); propagatedBuildInputs = [ asgiref diff --git a/pkgs/development/python-modules/django/4.nix b/pkgs/development/python-modules/django/4.nix index a387637f8605..2bd5b6ae34ce 100644 --- a/pkgs/development/python-modules/django/4.nix +++ b/pkgs/development/python-modules/django/4.nix @@ -57,56 +57,54 @@ buildPythonPackage rec { hash = "sha256-h6VkMLg2XAVC0p+ItTs/2EqpYdZn9uNvv6ZwQHXP0bI="; }; - patches = - [ - (replaceVars ./django_4_set_zoneinfo_dir.patch { - zoneinfo = tzdata + "/share/zoneinfo"; - }) - # make sure the tests don't remove packages from our pythonpath - # and disable failing tests - ./django_4_tests.patch + patches = [ + (replaceVars ./django_4_set_zoneinfo_dir.patch { + zoneinfo = tzdata + "/share/zoneinfo"; + }) + # make sure the tests don't remove packages from our pythonpath + # and disable failing tests + ./django_4_tests.patch - # fix filename length limit tests on bcachefs - # FIXME: remove if ever backported - (fetchpatch { - url = "https://github.com/django/django/commit/12f4f95405c7857cbf2f4bf4d0261154aac31676.patch"; - hash = "sha256-+K20/V8sh036Ox9U7CSPgfxue7f28Sdhr3MsB7erVOk="; - }) + # fix filename length limit tests on bcachefs + # FIXME: remove if ever backported + (fetchpatch { + url = "https://github.com/django/django/commit/12f4f95405c7857cbf2f4bf4d0261154aac31676.patch"; + hash = "sha256-+K20/V8sh036Ox9U7CSPgfxue7f28Sdhr3MsB7erVOk="; + }) - # backport fix for https://code.djangoproject.com/ticket/36056 - # FIXME: remove if ever backported upstream - (fetchpatch { - url = "https://github.com/django/django/commit/ec0e784f91b551c654f0962431cc31091926792d.patch"; - includes = [ "django/*" ]; # tests don't apply - hash = "sha256-8YwdOBNJq6+GNoxzdLyN9HEEIWRXGQk9YbyfPwYVkwU="; - }) - ] - ++ lib.optionals withGdal [ - (replaceVars ./django_4_set_geos_gdal_lib.patch { - geos = geos; - gdal = gdal; - extension = stdenv.hostPlatform.extensions.sharedLibrary; - }) - ]; + # backport fix for https://code.djangoproject.com/ticket/36056 + # FIXME: remove if ever backported upstream + (fetchpatch { + url = "https://github.com/django/django/commit/ec0e784f91b551c654f0962431cc31091926792d.patch"; + includes = [ "django/*" ]; # tests don't apply + hash = "sha256-8YwdOBNJq6+GNoxzdLyN9HEEIWRXGQk9YbyfPwYVkwU="; + }) + ] + ++ lib.optionals withGdal [ + (replaceVars ./django_4_set_geos_gdal_lib.patch { + geos = geos; + gdal = gdal; + extension = stdenv.hostPlatform.extensions.sharedLibrary; + }) + ]; - postPatch = - '' - substituteInPlace tests/utils_tests/test_autoreload.py \ - --replace "/usr/bin/python" "${python.interpreter}" - '' - + lib.optionalString (pythonAtLeast "3.12" && stdenv.hostPlatform.system == "aarch64-linux") '' - # Test regression after xz was reverted from 5.6.0 to 5.4.6 - # https://hydra.nixos.org/build/254630990 - substituteInPlace tests/view_tests/tests/test_debug.py \ - --replace-fail "test_files" "dont_test_files" - '' - + lib.optionalString (pythonAtLeast "3.13") '' - # Fixed CommandTypes.test_help_default_options_with_custom_arguments test on Python 3.13+. - # https://github.com/django/django/commit/3426a5c33c36266af42128ee9eca4921e68ea876 - substituteInPlace tests/admin_scripts/tests.py --replace-fail \ - "test_help_default_options_with_custom_arguments" \ - "dont_test_help_default_options_with_custom_arguments" - ''; + postPatch = '' + substituteInPlace tests/utils_tests/test_autoreload.py \ + --replace "/usr/bin/python" "${python.interpreter}" + '' + + lib.optionalString (pythonAtLeast "3.12" && stdenv.hostPlatform.system == "aarch64-linux") '' + # Test regression after xz was reverted from 5.6.0 to 5.4.6 + # https://hydra.nixos.org/build/254630990 + substituteInPlace tests/view_tests/tests/test_debug.py \ + --replace-fail "test_files" "dont_test_files" + '' + + lib.optionalString (pythonAtLeast "3.13") '' + # Fixed CommandTypes.test_help_default_options_with_custom_arguments test on Python 3.13+. + # https://github.com/django/django/commit/3426a5c33c36266af42128ee9eca4921e68ea876 + substituteInPlace tests/admin_scripts/tests.py --replace-fail \ + "test_help_default_options_with_custom_arguments" \ + "dont_test_help_default_options_with_custom_arguments" + ''; nativeBuildInputs = [ setuptools ]; @@ -137,7 +135,8 @@ buildPythonPackage rec { selenium tblib tzdata - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); doCheck = !stdenv.hostPlatform.isDarwin diff --git a/pkgs/development/python-modules/django/5_1.nix b/pkgs/development/python-modules/django/5_1.nix index 741d75c86cd3..4b2b815d9d11 100644 --- a/pkgs/development/python-modules/django/5_1.nix +++ b/pkgs/development/python-modules/django/5_1.nix @@ -55,30 +55,29 @@ buildPythonPackage rec { hash = "sha256-yHoK7NGa91QEVFLeHqJo126qNg1pTE7W6LEtbCLy4sw="; }; - patches = - [ - (replaceVars ./django_5_set_zoneinfo_dir.patch { - zoneinfo = tzdata + "/share/zoneinfo"; - }) - # prevent tests from messing with our pythonpath - ./django_5_tests_pythonpath.patch - # disable test that expects timezone issues - ./django_5_disable_failing_tests.patch + patches = [ + (replaceVars ./django_5_set_zoneinfo_dir.patch { + zoneinfo = tzdata + "/share/zoneinfo"; + }) + # prevent tests from messing with our pythonpath + ./django_5_tests_pythonpath.patch + # disable test that expects timezone issues + ./django_5_disable_failing_tests.patch - # fix filename length limit tests on bcachefs - # FIXME: remove in 5.2 - (fetchpatch { - url = "https://github.com/django/django/commit/12f4f95405c7857cbf2f4bf4d0261154aac31676.patch"; - hash = "sha256-+K20/V8sh036Ox9U7CSPgfxue7f28Sdhr3MsB7erVOk="; - }) - ] - ++ lib.optionals withGdal [ - (replaceVars ./django_5_set_geos_gdal_lib.patch { - geos = geos; - gdal = gdal; - extension = stdenv.hostPlatform.extensions.sharedLibrary; - }) - ]; + # fix filename length limit tests on bcachefs + # FIXME: remove in 5.2 + (fetchpatch { + url = "https://github.com/django/django/commit/12f4f95405c7857cbf2f4bf4d0261154aac31676.patch"; + hash = "sha256-+K20/V8sh036Ox9U7CSPgfxue7f28Sdhr3MsB7erVOk="; + }) + ] + ++ lib.optionals withGdal [ + (replaceVars ./django_5_set_geos_gdal_lib.patch { + geos = geos; + gdal = gdal; + extension = stdenv.hostPlatform.extensions.sharedLibrary; + }) + ]; postPatch = '' substituteInPlace tests/utils_tests/test_autoreload.py \ @@ -113,7 +112,8 @@ buildPythonPackage rec { selenium tblib tzdata - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' # make sure the installed library gets imported diff --git a/pkgs/development/python-modules/django/5_2.nix b/pkgs/development/python-modules/django/5_2.nix index d65c2b855a1b..7d28672ec604 100644 --- a/pkgs/development/python-modules/django/5_2.nix +++ b/pkgs/development/python-modules/django/5_2.nix @@ -55,23 +55,22 @@ buildPythonPackage rec { hash = "sha256-0AtH3vyEeQUKep17j5koiUi/ACgLc9JLMxkwWovCkvE="; }; - patches = - [ - (replaceVars ./django_5_set_zoneinfo_dir.patch { - zoneinfo = tzdata + "/share/zoneinfo"; - }) - # prevent tests from messing with our pythonpath - ./django_5_tests_pythonpath.patch - # disable test that expects timezone issues - ./django_5_disable_failing_tests.patch - ] - ++ lib.optionals withGdal [ - (replaceVars ./django_5_set_geos_gdal_lib.patch { - geos = geos; - gdal = gdal; - extension = stdenv.hostPlatform.extensions.sharedLibrary; - }) - ]; + patches = [ + (replaceVars ./django_5_set_zoneinfo_dir.patch { + zoneinfo = tzdata + "/share/zoneinfo"; + }) + # prevent tests from messing with our pythonpath + ./django_5_tests_pythonpath.patch + # disable test that expects timezone issues + ./django_5_disable_failing_tests.patch + ] + ++ lib.optionals withGdal [ + (replaceVars ./django_5_set_geos_gdal_lib.patch { + geos = geos; + gdal = gdal; + extension = stdenv.hostPlatform.extensions.sharedLibrary; + }) + ]; postPatch = '' substituteInPlace tests/utils_tests/test_autoreload.py \ @@ -106,7 +105,8 @@ buildPythonPackage rec { selenium tblib tzdata - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' # make sure the installed library gets imported diff --git a/pkgs/development/python-modules/djangorestframework-stubs/default.nix b/pkgs/development/python-modules/djangorestframework-stubs/default.nix index ea67da1c9209..b0434f169f43 100644 --- a/pkgs/development/python-modules/djangorestframework-stubs/default.nix +++ b/pkgs/development/python-modules/djangorestframework-stubs/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { py pytest-mypy-plugins pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # Upstream recommends mypy > 1.7 which we don't have yet, thus all testsare failing with 3.14.5 and below doCheck = false; diff --git a/pkgs/development/python-modules/djangorestframework/default.nix b/pkgs/development/python-modules/djangorestframework/default.nix index e1cdd727e8d3..f9f30317a35d 100644 --- a/pkgs/development/python-modules/djangorestframework/default.nix +++ b/pkgs/development/python-modules/djangorestframework/default.nix @@ -43,28 +43,29 @@ buildPythonPackage rec { dependencies = [ django pygments - ] ++ (lib.optional (lib.versionOlder django.version "5.0.0") pytz); + ] + ++ (lib.optional (lib.versionOlder django.version "5.0.0") pytz); optional-dependencies = { - complete = - [ - coreschema - django-guardian - inflection - psycopg2 - pygments - pyyaml - ] - ++ lib.optionals (pythonOlder "3.13") [ - # broken on 3.13 - coreapi - ]; + complete = [ + coreschema + django-guardian + inflection + psycopg2 + pygments + pyyaml + ] + ++ lib.optionals (pythonOlder "3.13") [ + # broken on 3.13 + coreapi + ]; }; nativeCheckInputs = [ pytest-django pytestCheckHook - ] ++ optional-dependencies.complete; + ] + ++ optional-dependencies.complete; disabledTests = [ # https://github.com/encode/django-rest-framework/issues/9422 diff --git a/pkgs/development/python-modules/dm-control/default.nix b/pkgs/development/python-modules/dm-control/default.nix index f6e274f1b66c..fdc933f1bca7 100644 --- a/pkgs/development/python-modules/dm-control/default.nix +++ b/pkgs/development/python-modules/dm-control/default.nix @@ -70,7 +70,8 @@ buildPythonPackage rec { scipy setuptools tqdm - ] ++ etils.optional-dependencies.epath; + ] + ++ etils.optional-dependencies.epath; pythonImportsCheck = [ "dm_control" ]; diff --git a/pkgs/development/python-modules/dm-sonnet/default.nix b/pkgs/development/python-modules/dm-sonnet/default.nix index 62cae899b80e..7b201bffdb70 100644 --- a/pkgs/development/python-modules/dm-sonnet/default.nix +++ b/pkgs/development/python-modules/dm-sonnet/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { numpy tabulate wrapt - ] ++ etils.optional-dependencies.epath; + ] + ++ etils.optional-dependencies.epath; optional-dependencies = { tensorflow = [ tensorflow ]; diff --git a/pkgs/development/python-modules/dns-lexicon/default.nix b/pkgs/development/python-modules/dns-lexicon/default.nix index 506e88f4e5aa..6f5e749472b0 100644 --- a/pkgs/development/python-modules/dns-lexicon/default.nix +++ b/pkgs/development/python-modules/dns-lexicon/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { pyyaml requests tldextract - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; optional-dependencies = { route53 = [ boto3 ]; @@ -74,7 +75,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-vcr - ] ++ optional-dependencies.full; + ] + ++ optional-dependencies.full; enabledTestPaths = [ "tests/" ]; diff --git a/pkgs/development/python-modules/docker-pycreds/default.nix b/pkgs/development/python-modules/docker-pycreds/default.nix index ad7d63c84bb9..d33d6e7f6201 100644 --- a/pkgs/development/python-modules/docker-pycreds/default.nix +++ b/pkgs/development/python-modules/docker-pycreds/default.nix @@ -24,11 +24,12 @@ buildPythonPackage rec { setuptools ]; - dependencies = - [ six ] - ++ lib.optionals (pythonAtLeast "3.12") [ - distutils - ]; + dependencies = [ + six + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + distutils + ]; pythonImportsCheck = [ "dockerpycreds" ]; diff --git a/pkgs/development/python-modules/docker/default.nix b/pkgs/development/python-modules/docker/default.nix index 7cde853819bd..3f37e8a6b102 100644 --- a/pkgs/development/python-modules/docker/default.nix +++ b/pkgs/development/python-modules/docker/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); enabledTestPaths = [ "tests/unit" ]; diff --git a/pkgs/development/python-modules/dockerflow/default.nix b/pkgs/development/python-modules/dockerflow/default.nix index bad4dede4eb7..754c5b590e15 100644 --- a/pkgs/development/python-modules/dockerflow/default.nix +++ b/pkgs/development/python-modules/dockerflow/default.nix @@ -73,7 +73,8 @@ buildPythonPackage rec { # fastapi httpx - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # AssertionError: assert 'c7a05e2b-8a21-4255-a3ed-92cea1e74a62' is None diff --git a/pkgs/development/python-modules/docling-jobkit/default.nix b/pkgs/development/python-modules/docling-jobkit/default.nix index cefa23cfa7f3..348b073ee35f 100644 --- a/pkgs/development/python-modules/docling-jobkit/default.nix +++ b/pkgs/development/python-modules/docling-jobkit/default.nix @@ -51,20 +51,19 @@ buildPythonPackage rec { poetry-core ]; - dependencies = - [ - docling - pydantic-settings - typer - boto3 - pandas - fastparquet - pyarrow - httpx - ] - ++ lib.optionals withTesserocr optional-dependencies.tesserocr - ++ lib.optionals withRapidocr optional-dependencies.rapidocr - ++ lib.optionals withRay optional-dependencies.ray; + dependencies = [ + docling + pydantic-settings + typer + boto3 + pandas + fastparquet + pyarrow + httpx + ] + ++ lib.optionals withTesserocr optional-dependencies.tesserocr + ++ lib.optionals withRapidocr optional-dependencies.rapidocr + ++ lib.optionals withRay optional-dependencies.ray; optional-dependencies = { tesserocr = [ tesserocr ]; diff --git a/pkgs/development/python-modules/docling-serve/default.nix b/pkgs/development/python-modules/docling-serve/default.nix index 32c44ad7b478..af20571493ae 100644 --- a/pkgs/development/python-modules/docling-serve/default.nix +++ b/pkgs/development/python-modules/docling-serve/default.nix @@ -54,23 +54,22 @@ buildPythonPackage rec { "mlx-vlm" # not yet available on nixpkgs ]; - dependencies = - [ - docling - (docling-jobkit.override { inherit withTesserocr withRapidocr; }) - fastapi - httpx - pydantic-settings - python-multipart - scalar-fastapi - typer - uvicorn - websockets - ] - ++ lib.optionals withUI optional-dependencies.ui - ++ lib.optionals withTesserocr optional-dependencies.tesserocr - ++ lib.optionals withRapidocr optional-dependencies.rapidocr - ++ lib.optionals withCPU optional-dependencies.cpu; + dependencies = [ + docling + (docling-jobkit.override { inherit withTesserocr withRapidocr; }) + fastapi + httpx + pydantic-settings + python-multipart + scalar-fastapi + typer + uvicorn + websockets + ] + ++ lib.optionals withUI optional-dependencies.ui + ++ lib.optionals withTesserocr optional-dependencies.tesserocr + ++ lib.optionals withRapidocr optional-dependencies.rapidocr + ++ lib.optionals withCPU optional-dependencies.cpu; optional-dependencies = { ui = [ diff --git a/pkgs/development/python-modules/docplex/default.nix b/pkgs/development/python-modules/docplex/default.nix index 2d9391d92b19..2095590adb2c 100644 --- a/pkgs/development/python-modules/docplex/default.nix +++ b/pkgs/development/python-modules/docplex/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ docloud requests - ] ++ lib.optional isPy27 futures; + ] + ++ lib.optional isPy27 futures; doCheck = false; pythonImportsCheck = [ "docplex" ]; diff --git a/pkgs/development/python-modules/doit/default.nix b/pkgs/development/python-modules/doit/default.nix index 188fb1ddbb3b..756e980e091c 100644 --- a/pkgs/development/python-modules/doit/default.nix +++ b/pkgs/development/python-modules/doit/default.nix @@ -30,14 +30,13 @@ let hash = "sha256-cdB8zJUUyyL+WdmJmVd2ZeqrV+FvZE0EM2rgtLriNLw="; }; - propagatedBuildInputs = - [ - cloudpickle - importlib-metadata - toml - ] - ++ lib.optional stdenv.hostPlatform.isLinux pyinotify - ++ lib.optional stdenv.hostPlatform.isDarwin macfsevents; + propagatedBuildInputs = [ + cloudpickle + importlib-metadata + toml + ] + ++ lib.optional stdenv.hostPlatform.isLinux pyinotify + ++ lib.optional stdenv.hostPlatform.isDarwin macfsevents; nativeCheckInputs = [ configclass diff --git a/pkgs/development/python-modules/dparse/default.nix b/pkgs/development/python-modules/dparse/default.nix index 2229a094ec2a..6c4ebf37ac13 100644 --- a/pkgs/development/python-modules/dparse/default.nix +++ b/pkgs/development/python-modules/dparse/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "dparse" ]; diff --git a/pkgs/development/python-modules/dramatiq/default.nix b/pkgs/development/python-modules/dramatiq/default.nix index 7bcceb5e1595..e16d7d4d2a85 100644 --- a/pkgs/development/python-modules/dramatiq/default.nix +++ b/pkgs/development/python-modules/dramatiq/default.nix @@ -67,34 +67,33 @@ buildPythonPackage rec { -e 's:--benchmark-compare::' \ ''; - disabledTests = - [ - # Requires a running redis - "test_after_process_boot_call_has_no_blocked_signals" - "test_cli_can_be_reloaded_on_sighup" - "test_cli_can_watch_for_source_code_changes" - "test_cli_fork_functions_have_no_blocked_signals" - "test_consumer_threads_have_no_blocked_signals" - "test_middleware_fork_functions_have_no_blocked_signals" - "test_redis_broker_can_connect_via_client" - "test_redis_broker_can_connect_via_url" - "test_redis_process_100k_messages_with_cli" - "test_redis_process_10k_fib_with_cli" - "test_redis_process_1k_latency_with_cli" - "test_worker_threads_have_no_blocked_signals" - # Requires a running rabbitmq - "test_rabbitmq_broker_can_be_passed_a_list_of_parameters_for_failover" - "test_rabbitmq_broker_can_be_passed_a_list_of_uri_for_failover" - "test_rabbitmq_broker_can_be_passed_a_semicolon_separated_list_of_uris" - "test_rabbitmq_broker_connections_are_lazy" - "test_rabbitmq_process_100k_messages_with_cli" - "test_rabbitmq_process_10k_fib_with_cli" - "test_rabbitmq_process_1k_latency_with_cli" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Takes too long for darwin ofborg - "test_retry_exceptions_can_specify_a_delay" - ]; + disabledTests = [ + # Requires a running redis + "test_after_process_boot_call_has_no_blocked_signals" + "test_cli_can_be_reloaded_on_sighup" + "test_cli_can_watch_for_source_code_changes" + "test_cli_fork_functions_have_no_blocked_signals" + "test_consumer_threads_have_no_blocked_signals" + "test_middleware_fork_functions_have_no_blocked_signals" + "test_redis_broker_can_connect_via_client" + "test_redis_broker_can_connect_via_url" + "test_redis_process_100k_messages_with_cli" + "test_redis_process_10k_fib_with_cli" + "test_redis_process_1k_latency_with_cli" + "test_worker_threads_have_no_blocked_signals" + # Requires a running rabbitmq + "test_rabbitmq_broker_can_be_passed_a_list_of_parameters_for_failover" + "test_rabbitmq_broker_can_be_passed_a_list_of_uri_for_failover" + "test_rabbitmq_broker_can_be_passed_a_semicolon_separated_list_of_uris" + "test_rabbitmq_broker_connections_are_lazy" + "test_rabbitmq_process_100k_messages_with_cli" + "test_rabbitmq_process_10k_fib_with_cli" + "test_rabbitmq_process_1k_latency_with_cli" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Takes too long for darwin ofborg + "test_retry_exceptions_can_specify_a_delay" + ]; pythonImportsCheck = [ "dramatiq" ]; diff --git a/pkgs/development/python-modules/drf-extra-fields/default.nix b/pkgs/development/python-modules/drf-extra-fields/default.nix index 9ffeddfab9bb..5ca6b0facc55 100644 --- a/pkgs/development/python-modules/drf-extra-fields/default.nix +++ b/pkgs/development/python-modules/drf-extra-fields/default.nix @@ -44,22 +44,22 @@ buildPythonPackage rec { pytestCheckHook pytest-django pytz - ] ++ optional-dependencies.Base64ImageField; + ] + ++ optional-dependencies.Base64ImageField; pythonImportsCheck = [ "drf_extra_fields" ]; - disabledTests = - [ - # pytz causes the following tests to fail - "test_create" - "test_create_with_base64_prefix" - "test_create_with_webp_image" - "test_remove_with_empty_string" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/Hipo/drf-extra-fields/issues/210 - "test_read_source_with_context" - ]; + disabledTests = [ + # pytz causes the following tests to fail + "test_create" + "test_create_with_base64_prefix" + "test_create_with_webp_image" + "test_remove_with_empty_string" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/Hipo/drf-extra-fields/issues/210 + "test_read_source_with_context" + ]; meta = { description = "Extra Fields for Django Rest Framework"; diff --git a/pkgs/development/python-modules/drf-jwt/default.nix b/pkgs/development/python-modules/drf-jwt/default.nix index 5e4960385803..9f062a9c5288 100644 --- a/pkgs/development/python-modules/drf-jwt/default.nix +++ b/pkgs/development/python-modules/drf-jwt/default.nix @@ -21,7 +21,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ pyjwt djangorestframework - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; # requires setting up a django instance doCheck = false; diff --git a/pkgs/development/python-modules/drf-spectacular/default.nix b/pkgs/development/python-modules/drf-spectacular/default.nix index 9dc2e73c7c33..21161cfa603b 100644 --- a/pkgs/development/python-modules/drf-spectacular/default.nix +++ b/pkgs/development/python-modules/drf-spectacular/default.nix @@ -86,7 +86,8 @@ buildPythonPackage rec { psycopg2 pytest-django pytestCheckHook - ] ++ django-allauth.optional-dependencies.socialaccount; + ] + ++ django-allauth.optional-dependencies.socialaccount; disabledTests = [ # Test requires django with gdal diff --git a/pkgs/development/python-modules/dscribe/default.nix b/pkgs/development/python-modules/dscribe/default.nix index 22fe43bed74f..658b5dd45044 100644 --- a/pkgs/development/python-modules/dscribe/default.nix +++ b/pkgs/development/python-modules/dscribe/default.nix @@ -62,23 +62,22 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # AttributeError: module 'numpy' has no attribute 'product' - "test_extended_system" - ] - ++ - lib.optionals - ((stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) || stdenv.hostPlatform.isDarwin) - [ - # AssertionError on a numerical test - "test_cell_list" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fatal Python error: Aborted - # matplotlib/backend_bases.py", line 2654 in create_with_canvas - "test_examples" - ]; + disabledTests = [ + # AttributeError: module 'numpy' has no attribute 'product' + "test_extended_system" + ] + ++ + lib.optionals + ((stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) || stdenv.hostPlatform.isDarwin) + [ + # AssertionError on a numerical test + "test_cell_list" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fatal Python error: Aborted + # matplotlib/backend_bases.py", line 2654 in create_with_canvas + "test_examples" + ]; meta = { description = "Machine learning descriptors for atomistic systems"; diff --git a/pkgs/development/python-modules/dsnap/default.nix b/pkgs/development/python-modules/dsnap/default.nix index 53f1d4319ca6..1b8a2bcf27a0 100644 --- a/pkgs/development/python-modules/dsnap/default.nix +++ b/pkgs/development/python-modules/dsnap/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { moto mypy-boto3-ebs pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # https://github.com/RhinoSecurityLabs/dsnap/issues/26 # ImportError: cannot import name 'mock_iam' from 'moto' diff --git a/pkgs/development/python-modules/duckdb-engine/default.nix b/pkgs/development/python-modules/duckdb-engine/default.nix index 61ffd36874a8..346fba1a7739 100644 --- a/pkgs/development/python-modules/duckdb-engine/default.nix +++ b/pkgs/development/python-modules/duckdb-engine/default.nix @@ -48,20 +48,19 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - checkInputs = - [ - fsspec - hypothesis - pandas - pyarrow - pytest-remotedata - typing-extensions - ] - ++ lib.optionals (pythonOlder "3.12") [ - # requires wasmer which is broken for python 3.12 - # https://github.com/wasmerio/wasmer-python/issues/778 - snapshottest - ]; + checkInputs = [ + fsspec + hypothesis + pandas + pyarrow + pytest-remotedata + typing-extensions + ] + ++ lib.optionals (pythonOlder "3.12") [ + # requires wasmer which is broken for python 3.12 + # https://github.com/wasmerio/wasmer-python/issues/778 + snapshottest + ]; pytestFlagsArray = [ "-m" diff --git a/pkgs/development/python-modules/duckdb/default.nix b/pkgs/development/python-modules/duckdb/default.nix index 536f08ccbe00..e88141bd894f 100644 --- a/pkgs/development/python-modules/duckdb/default.nix +++ b/pkgs/development/python-modules/duckdb/default.nix @@ -25,21 +25,19 @@ buildPythonPackage rec { ; pyproject = true; - postPatch = - (duckdb.postPatch or "") - + '' - # we can't use sourceRoot otherwise patches don't apply, because the patches apply to the C++ library - cd tools/pythonpkg + postPatch = (duckdb.postPatch or "") + '' + # we can't use sourceRoot otherwise patches don't apply, because the patches apply to the C++ library + cd tools/pythonpkg - # 1. let nix control build cores - # 2. default to extension autoload & autoinstall disabled - substituteInPlace setup.py \ - --replace-fail "ParallelCompile()" 'ParallelCompile("NIX_BUILD_CORES")' \ - --replace-fail "define_macros.extend([('DUCKDB_EXTENSION_AUTOLOAD_DEFAULT', '1'), ('DUCKDB_EXTENSION_AUTOINSTALL_DEFAULT', '1')])" "pass" + # 1. let nix control build cores + # 2. default to extension autoload & autoinstall disabled + substituteInPlace setup.py \ + --replace-fail "ParallelCompile()" 'ParallelCompile("NIX_BUILD_CORES")' \ + --replace-fail "define_macros.extend([('DUCKDB_EXTENSION_AUTOLOAD_DEFAULT', '1'), ('DUCKDB_EXTENSION_AUTOINSTALL_DEFAULT', '1')])" "pass" - substituteInPlace pyproject.toml \ - --replace-fail 'setuptools_scm>=6.4,<8.0' 'setuptools_scm' - ''; + substituteInPlace pyproject.toml \ + --replace-fail 'setuptools_scm>=6.4,<8.0' 'setuptools_scm' + ''; env = { DUCKDB_BUILD_UNITY = 1; diff --git a/pkgs/development/python-modules/dufte/default.nix b/pkgs/development/python-modules/dufte/default.nix index 92a7d861a404..28ea2f8c420c 100644 --- a/pkgs/development/python-modules/dufte/default.nix +++ b/pkgs/development/python-modules/dufte/default.nix @@ -28,7 +28,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ matplotlib numpy - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/development/python-modules/dukpy/default.nix b/pkgs/development/python-modules/dukpy/default.nix index 56855361d5f0..b3be6438855e 100644 --- a/pkgs/development/python-modules/dukpy/default.nix +++ b/pkgs/development/python-modules/dukpy/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook mock - ] ++ optional-dependencies.webassets; + ] + ++ optional-dependencies.webassets; disabledTests = [ "test_installer" ]; diff --git a/pkgs/development/python-modules/dulwich/default.nix b/pkgs/development/python-modules/dulwich/default.nix index 9611ee1efd26..00f06e0a8c4b 100644 --- a/pkgs/development/python-modules/dulwich/default.nix +++ b/pkgs/development/python-modules/dulwich/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { git glibcLocales pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); enabledTestPaths = [ "tests" ]; diff --git a/pkgs/development/python-modules/dvc-hdfs/default.nix b/pkgs/development/python-modules/dvc-hdfs/default.nix index 54b26e1b3cc7..6430b72a0e2d 100644 --- a/pkgs/development/python-modules/dvc-hdfs/default.nix +++ b/pkgs/development/python-modules/dvc-hdfs/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ dvc fsspec - ] ++ fsspec.optional-dependencies.arrow; + ] + ++ fsspec.optional-dependencies.arrow; # Circular dependency with dvc doCheck = false; diff --git a/pkgs/development/python-modules/dvc-render/default.nix b/pkgs/development/python-modules/dvc-render/default.nix index ffb271eab575..09c434dc4e35 100644 --- a/pkgs/development/python-modules/dvc-render/default.nix +++ b/pkgs/development/python-modules/dvc-render/default.nix @@ -41,15 +41,14 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = - [ - funcy - pytestCheckHook - pytest-mock - pytest-test-utils - ] - ++ optional-dependencies.table - ++ optional-dependencies.markdown; + nativeCheckInputs = [ + funcy + pytestCheckHook + pytest-mock + pytest-test-utils + ] + ++ optional-dependencies.table + ++ optional-dependencies.markdown; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test_vega.py" ]; diff --git a/pkgs/development/python-modules/dvc/default.nix b/pkgs/development/python-modules/dvc/default.nix index 564efefd6e00..55b18cc81f9e 100644 --- a/pkgs/development/python-modules/dvc/default.nix +++ b/pkgs/development/python-modules/dvc/default.nix @@ -91,55 +91,54 @@ buildPythonPackage rec { build-system = [ setuptools-scm ]; - dependencies = - [ - attrs - celery - colorama - configobj - distro - dpath - dulwich - dvc-data - dvc-http - dvc-render - dvc-studio-client - dvc-task - flatten-dict - flufl-lock - fsspec - funcy - grandalf - gto - hydra-core - iterative-telemetry - kombu - networkx - omegaconf - packaging - pathspec - platformdirs - psutil - pydot - pygtrie - pyparsing - requests - rich - ruamel-yaml - scmrepo - shortuuid - shtab - tabulate - tomlkit - tqdm - typing-extensions - voluptuous - zc-lockfile - ] - ++ lib.optionals enableGoogle optional-dependencies.gs - ++ lib.optionals enableAWS optional-dependencies.s3 - ++ lib.optionals enableAzure optional-dependencies.azure - ++ lib.optionals enableSSH optional-dependencies.ssh; + dependencies = [ + attrs + celery + colorama + configobj + distro + dpath + dulwich + dvc-data + dvc-http + dvc-render + dvc-studio-client + dvc-task + flatten-dict + flufl-lock + fsspec + funcy + grandalf + gto + hydra-core + iterative-telemetry + kombu + networkx + omegaconf + packaging + pathspec + platformdirs + psutil + pydot + pygtrie + pyparsing + requests + rich + ruamel-yaml + scmrepo + shortuuid + shtab + tabulate + tomlkit + tqdm + typing-extensions + voluptuous + zc-lockfile + ] + ++ lib.optionals enableGoogle optional-dependencies.gs + ++ lib.optionals enableAWS optional-dependencies.s3 + ++ lib.optionals enableAzure optional-dependencies.azure + ++ lib.optionals enableSSH optional-dependencies.ssh; optional-dependencies = { azure = [ dvc-azure ]; diff --git a/pkgs/development/python-modules/dvclive/default.nix b/pkgs/development/python-modules/dvclive/default.nix index def78905451a..0e0a75c5c4e1 100644 --- a/pkgs/development/python-modules/dvclive/default.nix +++ b/pkgs/development/python-modules/dvclive/default.nix @@ -75,7 +75,8 @@ buildPythonPackage rec { torch transformers xgboost - ] ++ jsonargparse.optional-dependencies.signatures; + ] + ++ jsonargparse.optional-dependencies.signatures; image = [ numpy pillow @@ -103,7 +104,8 @@ buildPythonPackage rec { lightning torch jsonargparse - ] ++ jsonargparse.optional-dependencies.signatures; + ] + ++ jsonargparse.optional-dependencies.signatures; optuna = [ optuna ]; }; diff --git a/pkgs/development/python-modules/e3-core/default.nix b/pkgs/development/python-modules/e3-core/default.nix index d7375001a062..a391fe073081 100644 --- a/pkgs/development/python-modules/e3-core/default.nix +++ b/pkgs/development/python-modules/e3-core/default.nix @@ -37,24 +37,23 @@ buildPythonPackage rec { nativeBuildInputs = [ autoPatchelfHook ]; - dependencies = - [ - colorama - packaging - python-dateutil - pyyaml - requests - requests-cache - requests-toolbelt - stevedore - tqdm - ] - ++ lib.optional stdenv.hostPlatform.isLinux [ - # See https://github.com/AdaCore/e3-core/blob/v22.6.0/pyproject.toml#L37-L42 - # These are required only on Linux. Darwin has its own set of requirements - psutil - distro - ]; + dependencies = [ + colorama + packaging + python-dateutil + pyyaml + requests + requests-cache + requests-toolbelt + stevedore + tqdm + ] + ++ lib.optional stdenv.hostPlatform.isLinux [ + # See https://github.com/AdaCore/e3-core/blob/v22.6.0/pyproject.toml#L37-L42 + # These are required only on Linux. Darwin has its own set of requirements + psutil + distro + ]; pythonImportsCheck = [ "e3" ]; diff --git a/pkgs/development/python-modules/edalize/default.nix b/pkgs/development/python-modules/edalize/default.nix index b2ee35c71ebe..05c8375351d6 100644 --- a/pkgs/development/python-modules/edalize/default.nix +++ b/pkgs/development/python-modules/edalize/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { pytestCheckHook which yosys - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "edalize" ]; diff --git a/pkgs/development/python-modules/elastic-apm/default.nix b/pkgs/development/python-modules/elastic-apm/default.nix index d94312c9b11a..e8ec4ac3dbf6 100644 --- a/pkgs/development/python-modules/elastic-apm/default.nix +++ b/pkgs/development/python-modules/elastic-apm/default.nix @@ -91,15 +91,14 @@ buildPythonPackage rec { "test_get_name_from_func_partialmethod_unbound" ]; - disabledTestPaths = - [ - # Exclude tornado tests - "tests/contrib/asyncio/tornado/tornado_tests.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Flaky tests on Darwin - "tests/utils/threading_tests.py" - ]; + disabledTestPaths = [ + # Exclude tornado tests + "tests/contrib/asyncio/tornado/tornado_tests.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Flaky tests on Darwin + "tests/utils/threading_tests.py" + ]; pythonImportsCheck = [ "elasticapm" ]; diff --git a/pkgs/development/python-modules/eliot/default.nix b/pkgs/development/python-modules/eliot/default.nix index 258b16713228..7ac0377af170 100644 --- a/pkgs/development/python-modules/eliot/default.nix +++ b/pkgs/development/python-modules/eliot/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { pytestCheckHook testtools twisted - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ daemontools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ daemontools ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/energyflow/default.nix b/pkgs/development/python-modules/energyflow/default.nix index fffc8b1998ed..2fe0be0ad329 100644 --- a/pkgs/development/python-modules/energyflow/default.nix +++ b/pkgs/development/python-modules/energyflow/default.nix @@ -64,22 +64,22 @@ buildPythonPackage rec { pot pytestCheckHook tf-keras - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); - disabledTests = - [ - # Issues with array - "test_emd_equivalence" - "test_gdim" - "test_n_jobs" - "test_periodic_phi" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: EMDStatus - Infeasible - "test_emd_byhand_1_1" - "test_emd_return_flow" - "test_emde" - ]; + disabledTests = [ + # Issues with array + "test_emd_equivalence" + "test_gdim" + "test_n_jobs" + "test_periodic_phi" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: EMDStatus - Infeasible + "test_emd_byhand_1_1" + "test_emd_return_flow" + "test_emde" + ]; pythonImportsCheck = [ "energyflow" ]; diff --git a/pkgs/development/python-modules/entrance/default.nix b/pkgs/development/python-modules/entrance/default.nix index 960e629d1474..2ce586482682 100644 --- a/pkgs/development/python-modules/entrance/default.nix +++ b/pkgs/development/python-modules/entrance/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { dependencies = [ pyyaml sanic - ] ++ opts.extraBuildInputs; + ] + ++ opts.extraBuildInputs; prePatch = opts.prePatch; diff --git a/pkgs/development/python-modules/envisage/default.nix b/pkgs/development/python-modules/envisage/default.nix index f0525da2d47b..ed8cfe2a9c3c 100644 --- a/pkgs/development/python-modules/envisage/default.nix +++ b/pkgs/development/python-modules/envisage/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { setuptools traits traitsui - ] ++ apptools.optional-dependencies.preferences; + ] + ++ apptools.optional-dependencies.preferences; preCheck = '' export HOME=$PWD/HOME diff --git a/pkgs/development/python-modules/ete3/default.nix b/pkgs/development/python-modules/ete3/default.nix index b16679376a53..afa2185519ef 100644 --- a/pkgs/development/python-modules/ete3/default.nix +++ b/pkgs/development/python-modules/ete3/default.nix @@ -30,14 +30,13 @@ buildPythonPackage rec { pythonImportsCheck = [ "ete3" ]; - dependencies = - [ - six - numpy - legacy-cgi - ] - ++ lib.optional withTreeVisualization pyqt5 - ++ lib.optional withXmlSupport lxml; + dependencies = [ + six + numpy + legacy-cgi + ] + ++ lib.optional withTreeVisualization pyqt5 + ++ lib.optional withXmlSupport lxml; meta = { description = "Python framework for the analysis and visualization of trees"; diff --git a/pkgs/development/python-modules/eth-abi/default.nix b/pkgs/development/python-modules/eth-abi/default.nix index 0aa81ae68668..4d5027687310 100644 --- a/pkgs/development/python-modules/eth-abi/default.nix +++ b/pkgs/development/python-modules/eth-abi/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { hypothesis pytestCheckHook pytest-xdist - ] ++ eth-hash.optional-dependencies.pycryptodome; + ] + ++ eth-hash.optional-dependencies.pycryptodome; disabledTests = [ # boolean list representation changed diff --git a/pkgs/development/python-modules/eth-bloom/default.nix b/pkgs/development/python-modules/eth-bloom/default.nix index 8c2a84e35908..c1283a0a2540 100644 --- a/pkgs/development/python-modules/eth-bloom/default.nix +++ b/pkgs/development/python-modules/eth-bloom/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { hypothesis pytestCheckHook pytest-xdist - ] ++ eth-hash.optional-dependencies.pycryptodome; + ] + ++ eth-hash.optional-dependencies.pycryptodome; pythonImportsCheck = [ "eth_bloom" ]; diff --git a/pkgs/development/python-modules/eth-hash/default.nix b/pkgs/development/python-modules/eth-hash/default.nix index 86ba11f3c019..cea7774011cf 100644 --- a/pkgs/development/python-modules/eth-hash/default.nix +++ b/pkgs/development/python-modules/eth-hash/default.nix @@ -26,27 +26,25 @@ buildPythonPackage rec { build-system = [ setuptools ]; - nativeCheckInputs = - [ - pytest - pytest-xdist - ] - ++ optional-dependencies.pycryptodome - # safe-pysha3 is not available on pypy - ++ lib.optional (!isPyPy) optional-dependencies.pysha3; + nativeCheckInputs = [ + pytest + pytest-xdist + ] + ++ optional-dependencies.pycryptodome + # safe-pysha3 is not available on pypy + ++ lib.optional (!isPyPy) optional-dependencies.pysha3; # Backends need to be tested separately and can not use hook - checkPhase = - '' - runHook preCheck - pytest tests/core tests/backends/pycryptodome - '' - + lib.optionalString (!isPyPy) '' - pytest tests/backends/pysha3 - '' - + '' - runHook postCheck - ''; + checkPhase = '' + runHook preCheck + pytest tests/core tests/backends/pycryptodome + '' + + lib.optionalString (!isPyPy) '' + pytest tests/backends/pysha3 + '' + + '' + runHook postCheck + ''; optional-dependencies = { pycryptodome = [ pycryptodome ]; diff --git a/pkgs/development/python-modules/eth-keys/default.nix b/pkgs/development/python-modules/eth-keys/default.nix index 95965af550f0..e09926107189 100644 --- a/pkgs/development/python-modules/eth-keys/default.nix +++ b/pkgs/development/python-modules/eth-keys/default.nix @@ -36,17 +36,16 @@ buildPythonPackage rec { eth-utils ]; - nativeCheckInputs = - [ - asn1tools - factory-boy - hypothesis - pyasn1 - pytestCheckHook - ] - ++ optional-dependencies.coincurve - ++ lib.optional (!isPyPy) eth-hash.optional-dependencies.pysha3 - ++ lib.optional isPyPy eth-hash.optional-dependencies.pycryptodome; + nativeCheckInputs = [ + asn1tools + factory-boy + hypothesis + pyasn1 + pytestCheckHook + ] + ++ optional-dependencies.coincurve + ++ lib.optional (!isPyPy) eth-hash.optional-dependencies.pysha3 + ++ lib.optional isPyPy eth-hash.optional-dependencies.pycryptodome; pythonImportsCheck = [ "eth_keys" ]; diff --git a/pkgs/development/python-modules/eth-utils/default.nix b/pkgs/development/python-modules/eth-utils/default.nix index b170e2443b30..3e4f1f7aa114 100644 --- a/pkgs/development/python-modules/eth-utils/default.nix +++ b/pkgs/development/python-modules/eth-utils/default.nix @@ -29,19 +29,19 @@ buildPythonPackage rec { build-system = [ setuptools ]; - propagatedBuildInputs = - [ - eth-hash - eth-typing - ] - ++ lib.optional (!isPyPy) cytoolz - ++ lib.optional isPyPy toolz; + propagatedBuildInputs = [ + eth-hash + eth-typing + ] + ++ lib.optional (!isPyPy) cytoolz + ++ lib.optional isPyPy toolz; nativeCheckInputs = [ hypothesis mypy pytestCheckHook - ] ++ eth-hash.optional-dependencies.pycryptodome; + ] + ++ eth-hash.optional-dependencies.pycryptodome; pythonImportsCheck = [ "eth_utils" ]; diff --git a/pkgs/development/python-modules/etils/default.nix b/pkgs/development/python-modules/etils/default.nix index 0718b0abb60d..05921930e7e3 100644 --- a/pkgs/development/python-modules/etils/default.nix +++ b/pkgs/development/python-modules/etils/default.nix @@ -53,36 +53,39 @@ buildPythonPackage rec { eapp = [ absl-py simple-parsing - ] ++ epy; - ecolab = - [ - jupyter - numpy - mediapy - packaging - protobuf - ] - ++ enp - ++ epy - ++ etree; + ] + ++ epy; + ecolab = [ + jupyter + numpy + mediapy + packaging + protobuf + ] + ++ enp + ++ epy + ++ etree; edc = epy; enp = [ numpy einops - ] ++ epy; + ] + ++ epy; epath = [ fsspec importlib-resources typing-extensions zipp - ] ++ epy; + ] + ++ epy; epath-gcs = [ gcsfs ] ++ epath; epath-s3 = [ s3fs ] ++ epath; epy = [ typing-extensions ]; etqdm = [ absl-py tqdm - ] ++ epy; + ] + ++ epy; etree = array-types ++ epy ++ enp ++ etqdm; etree-dm = [ dm-tree ] ++ etree; etree-jax = [ jax ] ++ etree; @@ -114,7 +117,8 @@ buildPythonPackage rec { pytest-xdist pytestCheckHook yapf - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; disabledTests = [ "test_public_access" # requires network access diff --git a/pkgs/development/python-modules/evaluate/default.nix b/pkgs/development/python-modules/evaluate/default.nix index b0ecf70ed8ae..56aea256ecf3 100644 --- a/pkgs/development/python-modules/evaluate/default.nix +++ b/pkgs/development/python-modules/evaluate/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { fsspec huggingface-hub packaging - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; # most tests require internet access. doCheck = false; diff --git a/pkgs/development/python-modules/evohome-async/default.nix b/pkgs/development/python-modules/evohome-async/default.nix index e5ba6551f508..f94d44a2dac5 100644 --- a/pkgs/development/python-modules/evohome-async/default.nix +++ b/pkgs/development/python-modules/evohome-async/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { pytestCheckHook pyyaml syrupy - ] ++ optional-dependencies.cli; + ] + ++ optional-dependencies.cli; pythonImportsCheck = [ "evohomeasync2" ]; diff --git a/pkgs/development/python-modules/execnet/default.nix b/pkgs/development/python-modules/execnet/default.nix index 550bf4399df4..b83fbd7a7530 100644 --- a/pkgs/development/python-modules/execnet/default.nix +++ b/pkgs/development/python-modules/execnet/default.nix @@ -19,17 +19,16 @@ buildPythonPackage rec { hash = "sha256-UYm1LGEhwk/q4ogWarQbMlScfiNIZSc2VAuebn1OcuM="; }; - postPatch = - '' - # remove vbox tests - rm testing/test_termination.py - rm testing/test_channel.py - rm testing/test_xspec.py - rm testing/test_gateway.py - '' - + lib.optionalString isPyPy '' - rm testing/test_multi.py - ''; + postPatch = '' + # remove vbox tests + rm testing/test_termination.py + rm testing/test_channel.py + rm testing/test_xspec.py + rm testing/test_gateway.py + '' + + lib.optionalString isPyPy '' + rm testing/test_multi.py + ''; build-system = [ hatchling diff --git a/pkgs/development/python-modules/executing/default.nix b/pkgs/development/python-modules/executing/default.nix index b43c3b0c25af..cee6db453e43 100644 --- a/pkgs/development/python-modules/executing/default.nix +++ b/pkgs/development/python-modules/executing/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { asttokens littleutils pytestCheckHook - ] ++ lib.optionals (pythonAtLeast "3.11") [ rich ]; + ] + ++ lib.optionals (pythonAtLeast "3.11") [ rich ]; disabledTests = [ # requires ipython, which causes a circular dependency diff --git a/pkgs/development/python-modules/falcon/default.nix b/pkgs/development/python-modules/falcon/default.nix index 4315534241dd..2e6e367fb1a3 100644 --- a/pkgs/development/python-modules/falcon/default.nix +++ b/pkgs/development/python-modules/falcon/default.nix @@ -74,19 +74,19 @@ buildPythonPackage rec { msgpack mujson ujson - ] ++ lib.optionals (pythonOlder "3.10") [ testtools ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ testtools ]; enabledTestPaths = [ "tests" ]; - disabledTestPaths = - [ - # needs a running server - "tests/asgi/test_asgi_servers.py" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # ModuleNotFoundError: No module named 'distutils' - "tests/asgi/test_cythonized_asgi.py" - ]; + disabledTestPaths = [ + # needs a running server + "tests/asgi/test_asgi_servers.py" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # ModuleNotFoundError: No module named 'distutils' + "tests/asgi/test_cythonized_asgi.py" + ]; meta = with lib; { changelog = "https://falcon.readthedocs.io/en/stable/changes/${version}.html"; diff --git a/pkgs/development/python-modules/fastapi-cli/default.nix b/pkgs/development/python-modules/fastapi-cli/default.nix index 714a27899a26..89384a31070b 100644 --- a/pkgs/development/python-modules/fastapi-cli/default.nix +++ b/pkgs/development/python-modules/fastapi-cli/default.nix @@ -31,12 +31,14 @@ let rich-toolkit typer uvicorn - ] ++ uvicorn.optional-dependencies.standard; + ] + ++ uvicorn.optional-dependencies.standard; optional-dependencies = { standard = [ uvicorn - ] ++ uvicorn.optional-dependencies.standard; + ] + ++ uvicorn.optional-dependencies.standard; }; doCheck = false; @@ -46,7 +48,8 @@ let nativeCheckInputs = [ pytestCheckHook rich - ] ++ optional-dependencies.standard; + ] + ++ optional-dependencies.standard; # coverage disabledTests = [ "test_script" ]; diff --git a/pkgs/development/python-modules/fastapi-sso/default.nix b/pkgs/development/python-modules/fastapi-sso/default.nix index 1039e258f515..46e0788ff2bf 100644 --- a/pkgs/development/python-modules/fastapi-sso/default.nix +++ b/pkgs/development/python-modules/fastapi-sso/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { oauthlib pydantic pyjwt - ] ++ pydantic.optional-dependencies.email; + ] + ++ pydantic.optional-dependencies.email; nativeCheckInputs = [ email-validator diff --git a/pkgs/development/python-modules/fastapi/default.nix b/pkgs/development/python-modules/fastapi/default.nix index 93f3d9823fc3..a18094d8defa 100644 --- a/pkgs/development/python-modules/fastapi/default.nix +++ b/pkgs/development/python-modules/fastapi/default.nix @@ -67,54 +67,51 @@ buildPythonPackage rec { ]; optional-dependencies = { - all = - [ - fastapi-cli - httpx - jinja2 - python-multipart - itsdangerous - pyyaml - ujson - orjson - email-validator - uvicorn - ] - ++ lib.optionals (lib.versionAtLeast pydantic.version "2") [ - pydantic-settings - pydantic-extra-types - ] - ++ fastapi-cli.optional-dependencies.standard - ++ uvicorn.optional-dependencies.standard; - standard = - [ - fastapi-cli - httpx - jinja2 - python-multipart - email-validator - uvicorn - ] - ++ fastapi-cli.optional-dependencies.standard - ++ uvicorn.optional-dependencies.standard; + all = [ + fastapi-cli + httpx + jinja2 + python-multipart + itsdangerous + pyyaml + ujson + orjson + email-validator + uvicorn + ] + ++ lib.optionals (lib.versionAtLeast pydantic.version "2") [ + pydantic-settings + pydantic-extra-types + ] + ++ fastapi-cli.optional-dependencies.standard + ++ uvicorn.optional-dependencies.standard; + standard = [ + fastapi-cli + httpx + jinja2 + python-multipart + email-validator + uvicorn + ] + ++ fastapi-cli.optional-dependencies.standard + ++ uvicorn.optional-dependencies.standard; }; - nativeCheckInputs = - [ - anyio - dirty-equals - flask - inline-snapshot - passlib - pyjwt - pytestCheckHook - pytest-asyncio - trio - sqlalchemy - ] - ++ anyio.optional-dependencies.trio - ++ passlib.optional-dependencies.bcrypt - ++ optional-dependencies.all; + nativeCheckInputs = [ + anyio + dirty-equals + flask + inline-snapshot + passlib + pyjwt + pytestCheckHook + pytest-asyncio + trio + sqlalchemy + ] + ++ anyio.optional-dependencies.trio + ++ passlib.optional-dependencies.bcrypt + ++ optional-dependencies.all; pytestFlags = [ # ignoring deprecation warnings to avoid test failure from diff --git a/pkgs/development/python-modules/fastavro/default.nix b/pkgs/development/python-modules/fastavro/default.nix index 922fe1f69797..9fbbaccbc289 100644 --- a/pkgs/development/python-modules/fastavro/default.nix +++ b/pkgs/development/python-modules/fastavro/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pytestCheckHook python-dateutil zlib-ng - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # Fails with "AttributeError: module 'fastavro._read_py' has no attribute # 'CYTHON_MODULE'." Doesn't appear to be serious. See https://github.com/fastavro/fastavro/issues/112#issuecomment-387638676. diff --git a/pkgs/development/python-modules/fastjet/default.nix b/pkgs/development/python-modules/fastjet/default.nix index 73830c7d5339..f1708d02cf81 100644 --- a/pkgs/development/python-modules/fastjet/default.nix +++ b/pkgs/development/python-modules/fastjet/default.nix @@ -20,11 +20,9 @@ let withPython = true; }).overrideAttrs (prev: { - postInstall = - (prev.postInstall or "") - + '' - mv "$out/${python.sitePackages}/"{fastjet.py,_fastjet_swig.py} - ''; + postInstall = (prev.postInstall or "") + '' + mv "$out/${python.sitePackages}/"{fastjet.py,_fastjet_swig.py} + ''; }); fastjet-contrib = pkgs.fastjet-contrib.override { inherit fastjet; diff --git a/pkgs/development/python-modules/fastjsonschema/default.nix b/pkgs/development/python-modules/fastjsonschema/default.nix index ad250ee1715c..e37eb286bb3f 100644 --- a/pkgs/development/python-modules/fastjsonschema/default.nix +++ b/pkgs/development/python-modules/fastjsonschema/default.nix @@ -27,16 +27,15 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = - [ - "benchmark" - # these tests require network access - "remote ref" - "definitions" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_compile_to_code_custom_format" # cannot import temporary module created during test - ]; + disabledTests = [ + "benchmark" + # these tests require network access + "remote ref" + "definitions" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_compile_to_code_custom_format" # cannot import temporary module created during test + ]; pytestFlagsArray = [ # fastjsonschema.exceptions.JsonSchemaDefinitionException: Unknown format uuid/duration diff --git a/pkgs/development/python-modules/fenics-dolfinx/default.nix b/pkgs/development/python-modules/fenics-dolfinx/default.nix index 7aa04a253fe5..34f1bcd37087 100644 --- a/pkgs/development/python-modules/fenics-dolfinx/default.nix +++ b/pkgs/development/python-modules/fenics-dolfinx/default.nix @@ -129,17 +129,16 @@ buildPythonPackage rec { ]; passthru = { - tests = - { - complex = fenics-dolfinx.override { - petsc4py = petsc4py.override { scalarType = "complex"; }; - }; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - mpich = fenics-dolfinx.override { - petsc4py = petsc4py.override { mpi = mpich; }; - }; + tests = { + complex = fenics-dolfinx.override { + petsc4py = petsc4py.override { scalarType = "complex"; }; }; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + mpich = fenics-dolfinx.override { + petsc4py = petsc4py.override { mpi = mpich; }; + }; + }; }; meta = { diff --git a/pkgs/development/python-modules/filedepot/default.nix b/pkgs/development/python-modules/filedepot/default.nix index e733f308646e..072e6ea60ef1 100644 --- a/pkgs/development/python-modules/filedepot/default.nix +++ b/pkgs/development/python-modules/filedepot/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { dependencies = [ anyascii google-cloud-storage - ] ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; + ] + ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; nativeCheckInputs = [ flaky diff --git a/pkgs/development/python-modules/fiona/default.nix b/pkgs/development/python-modules/fiona/default.nix index c6dbee62dd7e..9e671f9ced9a 100644 --- a/pkgs/development/python-modules/fiona/default.nix +++ b/pkgs/development/python-modules/fiona/default.nix @@ -69,7 +69,8 @@ buildPythonPackage rec { pytz shapely snuggs - ] ++ optional-dependencies.s3; + ] + ++ optional-dependencies.s3; preCheck = '' rm -r fiona # prevent importing local fiona diff --git a/pkgs/development/python-modules/fipy/default.nix b/pkgs/development/python-modules/fipy/default.nix index 2be37738ebb1..24b4264a2c62 100644 --- a/pkgs/development/python-modules/fipy/default.nix +++ b/pkgs/development/python-modules/fipy/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { future scikit-fmm openssh - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmsh ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmsh ]; nativeCheckInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmsh ]; diff --git a/pkgs/development/python-modules/firebase-messaging/default.nix b/pkgs/development/python-modules/firebase-messaging/default.nix index 9e476450e8b4..0acfce6d1e93 100644 --- a/pkgs/development/python-modules/firebase-messaging/default.nix +++ b/pkgs/development/python-modules/firebase-messaging/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { nativeBuildInputs = [ sphinxHook - ] ++ optional-dependencies.docs; + ] + ++ optional-dependencies.docs; pythonRelaxDeps = [ "http-ece" diff --git a/pkgs/development/python-modules/firedrake/default.nix b/pkgs/development/python-modules/firedrake/default.nix index 93dba808c5ca..b223e632552c 100644 --- a/pkgs/development/python-modules/firedrake/default.nix +++ b/pkgs/development/python-modules/firedrake/default.nix @@ -105,34 +105,33 @@ buildPythonPackage rec { firedrakePackages.mpi ]; - dependencies = - [ - decorator - cachetools - firedrakePackages.mpi4py - fenics-ufl - firedrake-fiat - firedrakePackages.h5py - libsupermesh - loopy - petsc4py - numpy - packaging - pkgconfig - progress - pyadjoint-ad - pycparser - pytools - requests - rtree - scipy - sympy - # required by script spydump - matplotlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - islpy - ]; + dependencies = [ + decorator + cachetools + firedrakePackages.mpi4py + fenics-ufl + firedrake-fiat + firedrakePackages.h5py + libsupermesh + loopy + petsc4py + numpy + packaging + pkgconfig + progress + pyadjoint-ad + pycparser + pytools + requests + rtree + scipy + sympy + # required by script spydump + matplotlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + islpy + ]; postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' install_name_tool -add_rpath ${libsupermesh}/${python.sitePackages}/libsupermesh/lib \ diff --git a/pkgs/development/python-modules/fixtures/default.nix b/pkgs/development/python-modules/fixtures/default.nix index 3ce27e83f233..8989e474942f 100644 --- a/pkgs/development/python-modules/fixtures/default.nix +++ b/pkgs/development/python-modules/fixtures/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ optional-dependencies.streams; + ] + ++ optional-dependencies.streams; meta = { description = "Reusable state for writing clean tests and more"; diff --git a/pkgs/development/python-modules/flask-appbuilder/default.nix b/pkgs/development/python-modules/flask-appbuilder/default.nix index ce4986c98904..a4d08de5452b 100644 --- a/pkgs/development/python-modules/flask-appbuilder/default.nix +++ b/pkgs/development/python-modules/flask-appbuilder/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { pyjwt pyyaml sqlalchemy-utils - ] ++ apispec.optional-dependencies.yaml; + ] + ++ apispec.optional-dependencies.yaml; postPatch = '' substituteInPlace setup.py \ diff --git a/pkgs/development/python-modules/flask-caching/default.nix b/pkgs/development/python-modules/flask-caching/default.nix index 4e336922221b..4d6b6f426972 100644 --- a/pkgs/development/python-modules/flask-caching/default.nix +++ b/pkgs/development/python-modules/flask-caching/default.nix @@ -41,19 +41,18 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # backend_cache relies on pytest-cache, which is a stale package from 2013 - "backend_cache" - # optional backends - "Redis" - "Memcache" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # ignore flaky test - "test_cache_timeout_dynamic" - "test_cached_view_class" - ]; + disabledTests = [ + # backend_cache relies on pytest-cache, which is a stale package from 2013 + "backend_cache" + # optional backends + "Redis" + "Memcache" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # ignore flaky test + "test_cache_timeout_dynamic" + "test_cached_view_class" + ]; meta = with lib; { description = "Caching extension for Flask"; diff --git a/pkgs/development/python-modules/flask-compress/default.nix b/pkgs/development/python-modules/flask-compress/default.nix index 6fe9d67015a6..f0de16eb7d49 100644 --- a/pkgs/development/python-modules/flask-compress/default.nix +++ b/pkgs/development/python-modules/flask-compress/default.nix @@ -30,13 +30,12 @@ buildPythonPackage rec { setuptools-scm ]; - dependencies = - [ - flask - zstandard - ] - ++ lib.optionals (!isPyPy) [ brotli ] - ++ lib.optionals isPyPy [ brotlicffi ]; + dependencies = [ + flask + zstandard + ] + ++ lib.optionals (!isPyPy) [ brotli ] + ++ lib.optionals isPyPy [ brotlicffi ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/flask-dramatiq/default.nix b/pkgs/development/python-modules/flask-dramatiq/default.nix index 4aa30f39808a..ddec3bb3994c 100644 --- a/pkgs/development/python-modules/flask-dramatiq/default.nix +++ b/pkgs/development/python-modules/flask-dramatiq/default.nix @@ -52,7 +52,8 @@ buildPythonPackage { postgresql postgresqlTestHook psycopg2 - ] ++ dramatiq.optional-dependencies.rabbitmq; + ] + ++ dramatiq.optional-dependencies.rabbitmq; postgresqlTestSetupPost = '' substituteInPlace config.py \ diff --git a/pkgs/development/python-modules/flask-expects-json/default.nix b/pkgs/development/python-modules/flask-expects-json/default.nix index bb51592428d9..d161d67b352c 100644 --- a/pkgs/development/python-modules/flask-expects-json/default.nix +++ b/pkgs/development/python-modules/flask-expects-json/default.nix @@ -22,7 +22,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ flask jsonschema - ] ++ flask.optional-dependencies.async; + ] + ++ flask.optional-dependencies.async; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/flask-jwt-extended/default.nix b/pkgs/development/python-modules/flask-jwt-extended/default.nix index 56e6c52ccc6f..5d0274321f88 100644 --- a/pkgs/development/python-modules/flask-jwt-extended/default.nix +++ b/pkgs/development/python-modules/flask-jwt-extended/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "flask_jwt_extended" ]; diff --git a/pkgs/development/python-modules/flask-mongoengine/default.nix b/pkgs/development/python-modules/flask-mongoengine/default.nix index ef9574a22581..81946417266b 100644 --- a/pkgs/development/python-modules/flask-mongoengine/default.nix +++ b/pkgs/development/python-modules/flask-mongoengine/default.nix @@ -40,13 +40,15 @@ buildPythonPackage rec { flask flask-wtf mongoengine - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; optional-dependencies = { wtf = [ flask-wtf wtforms - ] ++ wtforms.optional-dependencies.email; + ] + ++ wtforms.optional-dependencies.email; # toolbar = [ # flask-debugtoolbar # ]; diff --git a/pkgs/development/python-modules/flask-restx/default.nix b/pkgs/development/python-modules/flask-restx/default.nix index c9c63350d335..cc8471342438 100644 --- a/pkgs/development/python-modules/flask-restx/default.nix +++ b/pkgs/development/python-modules/flask-restx/default.nix @@ -60,16 +60,15 @@ buildPythonPackage rec { pytestCheckHook ]; - pytestFlagsArray = - [ - "--benchmark-disable" - "--deselect=tests/test_inputs.py::URLTest::test_check" - "--deselect=tests/test_inputs.py::EmailTest::test_valid_value_check" - "--deselect=tests/test_logging.py::LoggingTest::test_override_app_level" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--deselect=tests/test_inputs.py::EmailTest::test_invalid_values_check" - ]; + pytestFlagsArray = [ + "--benchmark-disable" + "--deselect=tests/test_inputs.py::URLTest::test_check" + "--deselect=tests/test_inputs.py::EmailTest::test_valid_value_check" + "--deselect=tests/test_logging.py::LoggingTest::test_override_app_level" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--deselect=tests/test_inputs.py::EmailTest::test_invalid_values_check" + ]; disabledTests = [ "test_specs_endpoint_host_and_subdomain" diff --git a/pkgs/development/python-modules/flask-security/default.nix b/pkgs/development/python-modules/flask-security/default.nix index 0297d67f6a03..6d25642db6d1 100644 --- a/pkgs/development/python-modules/flask-security/default.nix +++ b/pkgs/development/python-modules/flask-security/default.nix @@ -102,22 +102,21 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = - [ - authlib - flask-sqlalchemy-lite - freezegun - mongoengine - mongomock - peewee - pytestCheckHook - requests - zxcvbn - ] - ++ optional-dependencies.babel - ++ optional-dependencies.common - ++ optional-dependencies.fsqla - ++ optional-dependencies.mfa; + nativeCheckInputs = [ + authlib + flask-sqlalchemy-lite + freezegun + mongoengine + mongomock + peewee + pytestCheckHook + requests + zxcvbn + ] + ++ optional-dependencies.babel + ++ optional-dependencies.common + ++ optional-dependencies.fsqla + ++ optional-dependencies.mfa; preCheck = '' pybabel compile --domain flask_security -d flask_security/translations diff --git a/pkgs/development/python-modules/flask-sqlalchemy-lite/default.nix b/pkgs/development/python-modules/flask-sqlalchemy-lite/default.nix index 61b0f178260b..7e0f0ba603cb 100644 --- a/pkgs/development/python-modules/flask-sqlalchemy-lite/default.nix +++ b/pkgs/development/python-modules/flask-sqlalchemy-lite/default.nix @@ -32,13 +32,12 @@ buildPythonPackage rec { build-system = [ flit-core ]; - dependencies = - [ - flask - sqlalchemy - ] - ++ flask.optional-dependencies.async - ++ sqlalchemy.optional-dependencies.asyncio; + dependencies = [ + flask + sqlalchemy + ] + ++ flask.optional-dependencies.async + ++ sqlalchemy.optional-dependencies.asyncio; pythonImportsCheck = [ "flask_sqlalchemy_lite" ]; diff --git a/pkgs/development/python-modules/flask/default.nix b/pkgs/development/python-modules/flask/default.nix index e5b7372f0974..0a6be08d1dce 100644 --- a/pkgs/development/python-modules/flask/default.nix +++ b/pkgs/development/python-modules/flask/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { itsdangerous jinja2 werkzeug - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; optional-dependencies = { async = [ asgiref ]; diff --git a/pkgs/development/python-modules/flit-gettext/default.nix b/pkgs/development/python-modules/flit-gettext/default.nix index 48d073c59bfc..4dcd1971d79c 100644 --- a/pkgs/development/python-modules/flit-gettext/default.nix +++ b/pkgs/development/python-modules/flit-gettext/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { pytestCheckHook pytest-cov-stub wheel - ] ++ optional-dependencies.scm; + ] + ++ optional-dependencies.scm; disabledTests = [ # tests for missing msgfmt, but we always provide it diff --git a/pkgs/development/python-modules/flit-scm/default.nix b/pkgs/development/python-modules/flit-scm/default.nix index 0592be831f6d..ee55abc0ff49 100644 --- a/pkgs/development/python-modules/flit-scm/default.nix +++ b/pkgs/development/python-modules/flit-scm/default.nix @@ -23,12 +23,14 @@ buildPythonPackage rec { nativeBuildInputs = [ flit-core setuptools-scm - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; propagatedBuildInputs = [ flit-core setuptools-scm - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; pythonImportsCheck = [ "flit_scm" ]; diff --git a/pkgs/development/python-modules/flow-record/default.nix b/pkgs/development/python-modules/flow-record/default.nix index 3b43b3e343f3..9900ba47f2ae 100644 --- a/pkgs/development/python-modules/flow-record/default.nix +++ b/pkgs/development/python-modules/flow-record/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { nativeCheckInputs = [ elastic-transport pytest7CheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "flow.record" ]; diff --git a/pkgs/development/python-modules/fmpy/default.nix b/pkgs/development/python-modules/fmpy/default.nix index f6913ff42909..9401238f13c6 100644 --- a/pkgs/development/python-modules/fmpy/default.nix +++ b/pkgs/development/python-modules/fmpy/default.nix @@ -113,27 +113,26 @@ buildPythonPackage rec { # cvode is already built, so we only need to build native binaries. # We run these cmake builds and then run the standard # buildPythonPackage phases. - preBuild = - '' - cmakeFlags="-S native/src -B native/src/build -D CVODE_INSTALL_DIR=${passthru.cvode}" - cmakeConfigurePhase - cmake --build native/src/build --config Release - '' - + lib.optionalString (enableRemoting && stdenv.hostPlatform.isLinux) '' - # reimplementation of native/build_remoting.py - cmakeFlags="-S native/remoting -B remoting/linux64 -D RPCLIB=${rpclib}" - cmakeConfigurePhase - cmake --build remoting/linux64 --config Release - '' - # C.f. upstream build-wheel CI job - + '' - python native/copy_sources.py + preBuild = '' + cmakeFlags="-S native/src -B native/src/build -D CVODE_INSTALL_DIR=${passthru.cvode}" + cmakeConfigurePhase + cmake --build native/src/build --config Release + '' + + lib.optionalString (enableRemoting && stdenv.hostPlatform.isLinux) '' + # reimplementation of native/build_remoting.py + cmakeFlags="-S native/remoting -B remoting/linux64 -D RPCLIB=${rpclib}" + cmakeConfigurePhase + cmake --build remoting/linux64 --config Release + '' + # C.f. upstream build-wheel CI job + + '' + python native/copy_sources.py - # reimplementation of native/compile_resources.py - pushd src/ - python -c "from fmpy.gui import compile_resources; compile_resources()" - popd - ''; + # reimplementation of native/compile_resources.py + pushd src/ + python -c "from fmpy.gui import compile_resources; compile_resources()" + popd + ''; pythonImportsCheck = [ "fmpy" diff --git a/pkgs/development/python-modules/fnllm/default.nix b/pkgs/development/python-modules/fnllm/default.nix index 365876edd3c2..8d881840a62c 100644 --- a/pkgs/development/python-modules/fnllm/default.nix +++ b/pkgs/development/python-modules/fnllm/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { pytest-asyncio pytest-cov-stub pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "fnllm" ]; diff --git a/pkgs/development/python-modules/fontmake/default.nix b/pkgs/development/python-modules/fontmake/default.nix index 049aa3c53c74..770b40718ba1 100644 --- a/pkgs/development/python-modules/fontmake/default.nix +++ b/pkgs/development/python-modules/fontmake/default.nix @@ -42,17 +42,16 @@ buildPythonPackage rec { setuptools-scm ]; - dependencies = - [ - fontmath - fonttools - glyphslib - ufo2ft - ufolib2 - ] - ++ fonttools.optional-dependencies.ufo - ++ fonttools.optional-dependencies.lxml - ++ fonttools.optional-dependencies.unicode; + dependencies = [ + fontmath + fonttools + glyphslib + ufo2ft + ufolib2 + ] + ++ fonttools.optional-dependencies.ufo + ++ fonttools.optional-dependencies.lxml + ++ fonttools.optional-dependencies.unicode; optional-dependencies = { pathops = [ skia-pathops ]; diff --git a/pkgs/development/python-modules/fontparts/default.nix b/pkgs/development/python-modules/fontparts/default.nix index e08bf189d472..9d63916abf11 100644 --- a/pkgs/development/python-modules/fontparts/default.nix +++ b/pkgs/development/python-modules/fontparts/default.nix @@ -36,17 +36,16 @@ buildPythonPackage rec { setuptools-scm ]; - dependencies = - [ - booleanoperations - defcon - fontmath - fonttools - ] - ++ defcon.optional-dependencies.pens - ++ fonttools.optional-dependencies.ufo - ++ fonttools.optional-dependencies.lxml - ++ fonttools.optional-dependencies.unicode; + dependencies = [ + booleanoperations + defcon + fontmath + fonttools + ] + ++ defcon.optional-dependencies.pens + ++ fonttools.optional-dependencies.ufo + ++ fonttools.optional-dependencies.lxml + ++ fonttools.optional-dependencies.unicode; checkPhase = '' runHook preCheck diff --git a/pkgs/development/python-modules/fontpens/default.nix b/pkgs/development/python-modules/fontpens/default.nix index 8ea3cfdb7aa2..f9e293d4a6ba 100644 --- a/pkgs/development/python-modules/fontpens/default.nix +++ b/pkgs/development/python-modules/fontpens/default.nix @@ -24,22 +24,23 @@ buildPythonPackage rec { # can't run normal tests due to circular dependency with fontParts doCheck = false; - pythonImportsCheck = - [ "fontPens" ] - ++ (builtins.map (s: "fontPens." + s) [ - "angledMarginPen" - "digestPointPen" - "flattenPen" - "guessSmoothPointPen" - "marginPen" - "penTools" - "printPen" - "printPointPen" - "recordingPointPen" - "thresholdPen" - "thresholdPointPen" - "transformPointPen" - ]); + pythonImportsCheck = [ + "fontPens" + ] + ++ (builtins.map (s: "fontPens." + s) [ + "angledMarginPen" + "digestPointPen" + "flattenPen" + "guessSmoothPointPen" + "marginPen" + "penTools" + "printPen" + "printPointPen" + "recordingPointPen" + "thresholdPen" + "thresholdPointPen" + "transformPointPen" + ]); meta = with lib; { description = "Collection of classes implementing the pen protocol for manipulating glyphs"; diff --git a/pkgs/development/python-modules/fonttools/default.nix b/pkgs/development/python-modules/fonttools/default.nix index 7fc9a62294a4..42c64e016bf9 100644 --- a/pkgs/development/python-modules/fonttools/default.nix +++ b/pkgs/development/python-modules/fonttools/default.nix @@ -74,25 +74,24 @@ buildPythonPackage rec { in extras // { all = lib.concatLists (lib.attrValues extras); }; - nativeCheckInputs = - [ - # test suite fails with pytest>=8.0.1 - # https://github.com/fonttools/fonttools/issues/3458 - pytest7CheckHook - ] - ++ lib.concatLists ( - lib.attrVals ( - [ - "woff" - # "interpolatable" is not included because it only contains 2 tests at the time of writing but adds 270 extra dependencies - "ufo" - ] - ++ lib.optionals (!skia-pathops.meta.broken) [ - "pathops" # broken - ] - ++ [ "repacker" ] - ) optional-dependencies - ); + nativeCheckInputs = [ + # test suite fails with pytest>=8.0.1 + # https://github.com/fonttools/fonttools/issues/3458 + pytest7CheckHook + ] + ++ lib.concatLists ( + lib.attrVals ( + [ + "woff" + # "interpolatable" is not included because it only contains 2 tests at the time of writing but adds 270 extra dependencies + "ufo" + ] + ++ lib.optionals (!skia-pathops.meta.broken) [ + "pathops" # broken + ] + ++ [ "repacker" ] + ) optional-dependencies + ); pythonImportsCheck = [ "fontTools" ]; diff --git a/pkgs/development/python-modules/foolscap/default.nix b/pkgs/development/python-modules/foolscap/default.nix index 3cf3b2beb1b8..2f4ed006b849 100644 --- a/pkgs/development/python-modules/foolscap/default.nix +++ b/pkgs/development/python-modules/foolscap/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { six twisted pyopenssl - ] ++ twisted.optional-dependencies.tls; + ] + ++ twisted.optional-dependencies.tls; optional-dependencies = { i2p = [ txi2p-tahoe ]; @@ -50,7 +51,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "foolscap" ]; diff --git a/pkgs/development/python-modules/formulaic/default.nix b/pkgs/development/python-modules/formulaic/default.nix index c8a60523aa9f..44870bba4566 100644 --- a/pkgs/development/python-modules/formulaic/default.nix +++ b/pkgs/development/python-modules/formulaic/default.nix @@ -55,12 +55,11 @@ buildPythonPackage rec { calculus = [ sympy ]; }; - nativeCheckInputs = - [ - pytestCheckHook - ] - ++ optional-dependencies.arrow - ++ optional-dependencies.calculus; + nativeCheckInputs = [ + pytestCheckHook + ] + ++ optional-dependencies.arrow + ++ optional-dependencies.calculus; pythonImportsCheck = [ "formulaic" ]; diff --git a/pkgs/development/python-modules/foxdot/default.nix b/pkgs/development/python-modules/foxdot/default.nix index bbf14af3cb77..c9bdda75abb6 100644 --- a/pkgs/development/python-modules/foxdot/default.nix +++ b/pkgs/development/python-modules/foxdot/default.nix @@ -18,11 +18,12 @@ buildPythonPackage rec { sha256 = "528999da55ad630e540a39c0eaeacd19c58c36f49d65d24ea9704d0781e18c90"; }; - propagatedBuildInputs = - [ tkinter ] - # we currently build SuperCollider only on Linux - # but FoxDot is totally usable on macOS with the official SuperCollider binary - ++ lib.optionals stdenv.hostPlatform.isLinux [ supercollider ]; + propagatedBuildInputs = [ + tkinter + ] + # we currently build SuperCollider only on Linux + # but FoxDot is totally usable on macOS with the official SuperCollider binary + ++ lib.optionals stdenv.hostPlatform.isLinux [ supercollider ]; # Requires a running SuperCollider instance doCheck = false; diff --git a/pkgs/development/python-modules/frictionless/default.nix b/pkgs/development/python-modules/frictionless/default.nix index 2609a1a9d299..95847eab78a1 100644 --- a/pkgs/development/python-modules/frictionless/default.nix +++ b/pkgs/development/python-modules/frictionless/default.nix @@ -192,7 +192,8 @@ buildPythonPackage rec { # but it's required for some of the tests. openpyxl xlrd - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTestPaths = [ # Requires optional dependencies that have not been packaged (commented out above) diff --git a/pkgs/development/python-modules/fs/default.nix b/pkgs/development/python-modules/fs/default.nix index 1d9031fabc6b..70284bcf8f6a 100644 --- a/pkgs/development/python-modules/fs/default.nix +++ b/pkgs/development/python-modules/fs/default.nix @@ -61,18 +61,17 @@ buildPythonPackage rec { "tests/test_copy.py" ]; - disabledTests = - [ - "user_data_repr" - # https://github.com/PyFilesystem/pyfilesystem2/issues/568 - "test_remove" - # Tests require network access - "TestFTPFS" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # remove if https://github.com/PyFilesystem/pyfilesystem2/issues/430#issue-707878112 resolved - "test_ftpfs" - ]; + disabledTests = [ + "user_data_repr" + # https://github.com/PyFilesystem/pyfilesystem2/issues/568 + "test_remove" + # Tests require network access + "TestFTPFS" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # remove if https://github.com/PyFilesystem/pyfilesystem2/issues/430#issue-707878112 resolved + "test_ftpfs" + ]; pythonImportsCheck = [ "fs" ]; diff --git a/pkgs/development/python-modules/fslpy/default.nix b/pkgs/development/python-modules/fslpy/default.nix index 0633b9b5133c..48d828abea24 100644 --- a/pkgs/development/python-modules/fslpy/default.nix +++ b/pkgs/development/python-modules/fslpy/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { pytestCheckHook pytest-cov-stub tomli - ] ++ optional-dependencies.extra; + ] + ++ optional-dependencies.extra; disabledTestPaths = [ # tries to download data: diff --git a/pkgs/development/python-modules/fsspec/default.nix b/pkgs/development/python-modules/fsspec/default.nix index 807832730090..9143470c44b0 100644 --- a/pkgs/development/python-modules/fsspec/default.nix +++ b/pkgs/development/python-modules/fsspec/default.nix @@ -117,20 +117,19 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - disabledTests = - [ - # network access to aws s3 - "test_async_cat_file_ranges" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # works locally on APFS, fails on hydra with AssertionError comparing timestamps - # darwin hydra builder uses HFS+ and has only one second timestamp resolution - # this two tests however, assume nanosecond resolution - "test_modified" - "test_touch" - # tries to access /home, ignores $HOME - "test_directories" - ]; + disabledTests = [ + # network access to aws s3 + "test_async_cat_file_ranges" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # works locally on APFS, fails on hydra with AssertionError comparing timestamps + # darwin hydra builder uses HFS+ and has only one second timestamp resolution + # this two tests however, assume nanosecond resolution + "test_modified" + "test_touch" + # tries to access /home, ignores $HOME + "test_directories" + ]; disabledTestPaths = [ # network access to github.com diff --git a/pkgs/development/python-modules/fugashi/default.nix b/pkgs/development/python-modules/fugashi/default.nix index 25fedaf96d94..d2d60b3e8143 100644 --- a/pkgs/development/python-modules/fugashi/default.nix +++ b/pkgs/development/python-modules/fugashi/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { nativeCheckInputs = [ ipadic pytestCheckHook - ] ++ optional-dependencies.unidic-lite; + ] + ++ optional-dependencies.unidic-lite; optional-dependencies = { unidic-lite = [ unidic-lite ]; diff --git a/pkgs/development/python-modules/funsor/default.nix b/pkgs/development/python-modules/funsor/default.nix index c24e3c16f85e..5cd1266db7cd 100644 --- a/pkgs/development/python-modules/funsor/default.nix +++ b/pkgs/development/python-modules/funsor/default.nix @@ -74,19 +74,18 @@ buildPythonPackage rec { pythonImportsCheck = [ "funsor" ]; - disabledTests = - [ - # `test_torch_save` got broken by the update of torch (2.3.1 -> 2.4.0): - # FutureWarning: You are using `torch.load` with `weights_only=False`... - # TODO: Try to re-enable this test at next release - "test_torch_save" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Failures related to JIT - # RuntimeError: required keyword attribute 'Subgraph' has the wrong type - "test_local_param_ok" - "test_plate_ok" - ]; + disabledTests = [ + # `test_torch_save` got broken by the update of torch (2.3.1 -> 2.4.0): + # FutureWarning: You are using `torch.load` with `weights_only=False`... + # TODO: Try to re-enable this test at next release + "test_torch_save" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Failures related to JIT + # RuntimeError: required keyword attribute 'Subgraph' has the wrong type + "test_local_param_ok" + "test_plate_ok" + ]; meta = { description = "Functional tensors for probabilistic programming"; diff --git a/pkgs/development/python-modules/gdown/default.nix b/pkgs/development/python-modules/gdown/default.nix index 610a99aeaf89..6077411fdeb3 100644 --- a/pkgs/development/python-modules/gdown/default.nix +++ b/pkgs/development/python-modules/gdown/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { tqdm setuptools six - ] ++ requests.optional-dependencies.socks; + ] + ++ requests.optional-dependencies.socks; checkPhase = '' $out/bin/gdown --help > /dev/null diff --git a/pkgs/development/python-modules/geoalchemy2/default.nix b/pkgs/development/python-modules/geoalchemy2/default.nix index df1ed39d0dff..ac3b0e6e2057 100644 --- a/pkgs/development/python-modules/geoalchemy2/default.nix +++ b/pkgs/development/python-modules/geoalchemy2/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { nativeCheckInputs = [ alembic pytestCheckHook - ] ++ optional-dependencies.shapely; + ] + ++ optional-dependencies.shapely; disabledTestPaths = [ # tests require live databases diff --git a/pkgs/development/python-modules/geopandas/default.nix b/pkgs/development/python-modules/geopandas/default.nix index 8733bb2c8df6..9d7d1e1d9bf4 100644 --- a/pkgs/development/python-modules/geopandas/default.nix +++ b/pkgs/development/python-modules/geopandas/default.nix @@ -83,7 +83,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook rtree - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; preCheck = '' export HOME=$(mktemp -d); diff --git a/pkgs/development/python-modules/gevent/default.nix b/pkgs/development/python-modules/gevent/default.nix index 7dd7b178fb43..bc996a338ab3 100644 --- a/pkgs/development/python-modules/gevent/default.nix +++ b/pkgs/development/python-modules/gevent/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { cython setuptools wheel - ] ++ lib.optionals (!isPyPy) [ cffi ]; + ] + ++ lib.optionals (!isPyPy) [ cffi ]; buildInputs = [ libev @@ -52,7 +53,8 @@ buildPythonPackage rec { importlib-metadata zope-event zope-interface - ] ++ lib.optionals (!isPyPy) [ greenlet ]; + ] + ++ lib.optionals (!isPyPy) [ greenlet ]; env = lib.optionalAttrs stdenv.cc.isGNU { NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; @@ -72,7 +74,8 @@ buildPythonPackage rec { gunicorn pika ; - } // lib.filterAttrs (k: v: lib.hasInfix "gevent" k) python.pkgs; + } + // lib.filterAttrs (k: v: lib.hasInfix "gevent" k) python.pkgs; GEVENTSETUP_EMBED = "0"; diff --git a/pkgs/development/python-modules/gfal2-python/default.nix b/pkgs/development/python-modules/gfal2-python/default.nix index 6f4e9bad548c..4cd4cf2e151e 100644 --- a/pkgs/development/python-modules/gfal2-python/default.nix +++ b/pkgs/development/python-modules/gfal2-python/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { inherit gfal2; tests = { inherit gfal2-util; - } // lib.optionalAttrs (gfal2-util != null) gfal2-util.tests or { }; + } + // lib.optionalAttrs (gfal2-util != null) gfal2-util.tests or { }; }; meta = with lib; { description = "Python binding for gfal2"; diff --git a/pkgs/development/python-modules/gftools/default.nix b/pkgs/development/python-modules/gftools/default.nix index 42424aeb4a0c..61278db9d9f5 100644 --- a/pkgs/development/python-modules/gftools/default.nix +++ b/pkgs/development/python-modules/gftools/default.nix @@ -127,51 +127,50 @@ buildPythonPackage rec { setuptools-scm ]; - dependencies = - [ - absl-py - afdko - axisregistry - babelfont - beautifulsoup4 - brotli - bumpfontversion - ffmpeg-python - font-v - fontfeatures - fontmake - fonttools - gflanguages - gfsubsets - glyphsets - glyphslib - jinja2 - nanoemoji - networkx - ninja - ots-python - packaging - pillow - protobuf - pygit2 - pygithub - pyyaml - requests - rich - ruamel-yaml - setuptools - skia-pathops - statmake - strictyaml - tabulate - ttfautohint-py - ufomerge - unidecode - vharfbuzz - vttlib - ] - ++ fonttools.optional-dependencies.ufo - ++ fontmake.optional-dependencies.json; + dependencies = [ + absl-py + afdko + axisregistry + babelfont + beautifulsoup4 + brotli + bumpfontversion + ffmpeg-python + font-v + fontfeatures + fontmake + fonttools + gflanguages + gfsubsets + glyphsets + glyphslib + jinja2 + nanoemoji + networkx + ninja + ots-python + packaging + pillow + protobuf + pygit2 + pygithub + pyyaml + requests + rich + ruamel-yaml + setuptools + skia-pathops + statmake + strictyaml + tabulate + ttfautohint-py + ufomerge + unidecode + vharfbuzz + vttlib + ] + ++ fonttools.optional-dependencies.ufo + ++ fontmake.optional-dependencies.json; optional-dependencies = { qa = [ diff --git a/pkgs/development/python-modules/gidgethub/default.nix b/pkgs/development/python-modules/gidgethub/default.nix index d2a96289020a..d8ee3d1a1d40 100644 --- a/pkgs/development/python-modules/gidgethub/default.nix +++ b/pkgs/development/python-modules/gidgethub/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { dependencies = [ uritemplate pyjwt - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/git-revise/default.nix b/pkgs/development/python-modules/git-revise/default.nix index 47422563b928..d7ea652184bd 100644 --- a/pkgs/development/python-modules/git-revise/default.nix +++ b/pkgs/development/python-modules/git-revise/default.nix @@ -24,14 +24,13 @@ buildPythonPackage rec { disabled = pythonOlder "3.8"; - nativeCheckInputs = - [ - git - pytestCheckHook - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - gnupg - ]; + nativeCheckInputs = [ + git + pytestCheckHook + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + gnupg + ]; disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ # `gpg: agent_genkey failed: No agent running` diff --git a/pkgs/development/python-modules/github3-py/default.nix b/pkgs/development/python-modules/github3-py/default.nix index 893508c56043..80fda5cc7ee1 100644 --- a/pkgs/development/python-modules/github3-py/default.nix +++ b/pkgs/development/python-modules/github3-py/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { python-dateutil requests uritemplate - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; pythonImportsCheck = [ "github3" ]; diff --git a/pkgs/development/python-modules/githubkit/default.nix b/pkgs/development/python-modules/githubkit/default.nix index fa4e341d32e4..4b8b24fdf04b 100644 --- a/pkgs/development/python-modules/githubkit/default.nix +++ b/pkgs/development/python-modules/githubkit/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { pytestCheckHook pytest-cov-stub pytest-xdist - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "githubkit" ]; diff --git a/pkgs/development/python-modules/gitpython/default.nix b/pkgs/development/python-modules/gitpython/default.nix index b74989151567..e3e9d05ae8d8 100644 --- a/pkgs/development/python-modules/gitpython/default.nix +++ b/pkgs/development/python-modules/gitpython/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { ddt gitdb pkgs.gitMinimal - ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; postPatch = '' substituteInPlace git/cmd.py \ diff --git a/pkgs/development/python-modules/globus-sdk/default.nix b/pkgs/development/python-modules/globus-sdk/default.nix index 5b781e656d1d..420e00660a52 100644 --- a/pkgs/development/python-modules/globus-sdk/default.nix +++ b/pkgs/development/python-modules/globus-sdk/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { cryptography requests pyjwt - ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/glom/default.nix b/pkgs/development/python-modules/glom/default.nix index acd0da2f0b59..bd49c09f12c8 100644 --- a/pkgs/development/python-modules/glom/default.nix +++ b/pkgs/development/python-modules/glom/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' # test_cli.py checks the output of running "glom" diff --git a/pkgs/development/python-modules/gluonts/default.nix b/pkgs/development/python-modules/gluonts/default.nix index a72b4d992dc2..8ec0ec353c85 100644 --- a/pkgs/development/python-modules/gluonts/default.nix +++ b/pkgs/development/python-modules/gluonts/default.nix @@ -84,7 +84,8 @@ buildPythonPackage rec { pyarrow statsmodels which - ] ++ optional-dependencies.torch; + ] + ++ optional-dependencies.torch; preCheck = ''export HOME=$(mktemp -d)''; @@ -93,15 +94,14 @@ buildPythonPackage rec { "test/torch/model" ]; - disabledTests = - [ - # tries to access network - "test_against_former_evaluator" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1] - "test_forecast" - ]; + disabledTests = [ + # tries to access network + "test_against_former_evaluator" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1] + "test_forecast" + ]; meta = { description = "Probabilistic time series modeling in Python"; diff --git a/pkgs/development/python-modules/google-auth-oauthlib/default.nix b/pkgs/development/python-modules/google-auth-oauthlib/default.nix index 9149f83e14cb..b66e813e9dce 100644 --- a/pkgs/development/python-modules/google-auth-oauthlib/default.nix +++ b/pkgs/development/python-modules/google-auth-oauthlib/default.nix @@ -37,17 +37,17 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ optional-dependencies.tool; + ] + ++ optional-dependencies.tool; - disabledTests = - [ - # Flaky test. See https://github.com/NixOS/nixpkgs/issues/288424#issuecomment-1941609973. - "test_run_local_server_occupied_port" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # This test fails if the hostname is not associated with an IP (e.g., in `/etc/hosts`). - "test_run_local_server_bind_addr" - ]; + disabledTests = [ + # Flaky test. See https://github.com/NixOS/nixpkgs/issues/288424#issuecomment-1941609973. + "test_run_local_server_occupied_port" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # This test fails if the hostname is not associated with an IP (e.g., in `/etc/hosts`). + "test_run_local_server_bind_addr" + ]; pythonImportsCheck = [ "google_auth_oauthlib" ]; diff --git a/pkgs/development/python-modules/google-auth/default.nix b/pkgs/development/python-modules/google-auth/default.nix index f2e481d82714..d54e740fbdce 100644 --- a/pkgs/development/python-modules/google-auth/default.nix +++ b/pkgs/development/python-modules/google-auth/default.nix @@ -74,7 +74,8 @@ buildPythonPackage rec { pytest-localserver pytestCheckHook responses - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTestPaths = [ "samples/" diff --git a/pkgs/development/python-modules/google-cloud-access-context-manager/default.nix b/pkgs/development/python-modules/google-cloud-access-context-manager/default.nix index 2ac9bc3914ea..e2577e1c8b67 100644 --- a/pkgs/development/python-modules/google-cloud-access-context-manager/default.nix +++ b/pkgs/development/python-modules/google-cloud-access-context-manager/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { dependencies = [ google-api-core protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; # No tests in repo doCheck = false; diff --git a/pkgs/development/python-modules/google-cloud-appengine-logging/default.nix b/pkgs/development/python-modules/google-cloud-appengine-logging/default.nix index 855d7f872c87..7d77619f889c 100644 --- a/pkgs/development/python-modules/google-cloud-appengine-logging/default.nix +++ b/pkgs/development/python-modules/google-cloud-appengine-logging/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-artifact-registry/default.nix b/pkgs/development/python-modules/google-cloud-artifact-registry/default.nix index bb24a56b763f..b5016ef74760 100644 --- a/pkgs/development/python-modules/google-cloud-artifact-registry/default.nix +++ b/pkgs/development/python-modules/google-cloud-artifact-registry/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/google-cloud-asset/default.nix b/pkgs/development/python-modules/google-cloud-asset/default.nix index da6ee031ae12..6c8f06f8d6f3 100644 --- a/pkgs/development/python-modules/google-cloud-asset/default.nix +++ b/pkgs/development/python-modules/google-cloud-asset/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { libcst proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { libcst = [ libcst ]; diff --git a/pkgs/development/python-modules/google-cloud-automl/default.nix b/pkgs/development/python-modules/google-cloud-automl/default.nix index dd9590c06708..a03eae3cca77 100644 --- a/pkgs/development/python-modules/google-cloud-automl/default.nix +++ b/pkgs/development/python-modules/google-cloud-automl/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { libcst = [ libcst ]; diff --git a/pkgs/development/python-modules/google-cloud-bigquery-datatransfer/default.nix b/pkgs/development/python-modules/google-cloud-bigquery-datatransfer/default.nix index f0ce8de62179..65c961c9a8b8 100644 --- a/pkgs/development/python-modules/google-cloud-bigquery-datatransfer/default.nix +++ b/pkgs/development/python-modules/google-cloud-bigquery-datatransfer/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { proto-plus protobuf pytz - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-bigquery-logging/default.nix b/pkgs/development/python-modules/google-cloud-bigquery-logging/default.nix index ab590420e688..4efc4823f76d 100644 --- a/pkgs/development/python-modules/google-cloud-bigquery-logging/default.nix +++ b/pkgs/development/python-modules/google-cloud-bigquery-logging/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-bigquery-storage/default.nix b/pkgs/development/python-modules/google-cloud-bigquery-storage/default.nix index e662d1a88ce1..2d63743221f3 100644 --- a/pkgs/development/python-modules/google-cloud-bigquery-storage/default.nix +++ b/pkgs/development/python-modules/google-cloud-bigquery-storage/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { dependencies = [ google-api-core protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { fastavro = [ fastavro ]; diff --git a/pkgs/development/python-modules/google-cloud-bigquery/default.nix b/pkgs/development/python-modules/google-cloud-bigquery/default.nix index 7dc93f48590b..b98ab101924b 100644 --- a/pkgs/development/python-modules/google-cloud-bigquery/default.nix +++ b/pkgs/development/python-modules/google-cloud-bigquery/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { protobuf python-dateutil requests - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { bqstorage = [ @@ -75,19 +76,18 @@ buildPythonPackage rec { ipython = [ ipython ]; }; - nativeCheckInputs = - [ - freezegun - google-cloud-datacatalog - google-cloud-storage - google-cloud-testutils - mock - psutil - pytest-xdist - pytestCheckHook - ] - ++ optional-dependencies.pandas - ++ optional-dependencies.ipython; + nativeCheckInputs = [ + freezegun + google-cloud-datacatalog + google-cloud-storage + google-cloud-testutils + mock + psutil + pytest-xdist + pytestCheckHook + ] + ++ optional-dependencies.pandas + ++ optional-dependencies.ipython; # prevent google directory from shadowing google imports preCheck = '' diff --git a/pkgs/development/python-modules/google-cloud-bigtable/default.nix b/pkgs/development/python-modules/google-cloud-bigtable/default.nix index 926bd22406db..95672aedc5ae 100644 --- a/pkgs/development/python-modules/google-cloud-bigtable/default.nix +++ b/pkgs/development/python-modules/google-cloud-bigtable/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { libcst = [ libcst ]; diff --git a/pkgs/development/python-modules/google-cloud-compute/default.nix b/pkgs/development/python-modules/google-cloud-compute/default.nix index aaaf512a6f04..fcf363247e34 100644 --- a/pkgs/development/python-modules/google-cloud-compute/default.nix +++ b/pkgs/development/python-modules/google-cloud-compute/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-container/default.nix b/pkgs/development/python-modules/google-cloud-container/default.nix index 4c29575443c1..46434bc8abab 100644 --- a/pkgs/development/python-modules/google-cloud-container/default.nix +++ b/pkgs/development/python-modules/google-cloud-container/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { libcst proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-core/default.nix b/pkgs/development/python-modules/google-cloud-core/default.nix index ed4200d8d654..4ca56061c17d 100644 --- a/pkgs/development/python-modules/google-cloud-core/default.nix +++ b/pkgs/development/python-modules/google-cloud-core/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ optional-dependencies.grpc; + ] + ++ optional-dependencies.grpc; # prevent google directory from shadowing google imports preCheck = '' diff --git a/pkgs/development/python-modules/google-cloud-datacatalog/default.nix b/pkgs/development/python-modules/google-cloud-datacatalog/default.nix index c38fb7cbff7f..de60cd24d2a3 100644 --- a/pkgs/development/python-modules/google-cloud-datacatalog/default.nix +++ b/pkgs/development/python-modules/google-cloud-datacatalog/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { libcst proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-dataproc/default.nix b/pkgs/development/python-modules/google-cloud-dataproc/default.nix index 4189b37354e5..2457054d95cf 100644 --- a/pkgs/development/python-modules/google-cloud-dataproc/default.nix +++ b/pkgs/development/python-modules/google-cloud-dataproc/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { libcst proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-datastore/default.nix b/pkgs/development/python-modules/google-cloud-datastore/default.nix index efd207015fe9..080e126e52e5 100644 --- a/pkgs/development/python-modules/google-cloud-datastore/default.nix +++ b/pkgs/development/python-modules/google-cloud-datastore/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { google-cloud-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { libcst = [ libcst ]; diff --git a/pkgs/development/python-modules/google-cloud-dlp/default.nix b/pkgs/development/python-modules/google-cloud-dlp/default.nix index 56e170020fb0..ed1e7f0c647b 100644 --- a/pkgs/development/python-modules/google-cloud-dlp/default.nix +++ b/pkgs/development/python-modules/google-cloud-dlp/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ google-cloud-testutils diff --git a/pkgs/development/python-modules/google-cloud-error-reporting/default.nix b/pkgs/development/python-modules/google-cloud-error-reporting/default.nix index 68aab2e774e8..c059104f30e2 100644 --- a/pkgs/development/python-modules/google-cloud-error-reporting/default.nix +++ b/pkgs/development/python-modules/google-cloud-error-reporting/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { google-cloud-logging proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ google-cloud-testutils diff --git a/pkgs/development/python-modules/google-cloud-firestore/default.nix b/pkgs/development/python-modules/google-cloud-firestore/default.nix index 65d3db560bd4..a74a680e240a 100644 --- a/pkgs/development/python-modules/google-cloud-firestore/default.nix +++ b/pkgs/development/python-modules/google-cloud-firestore/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { google-cloud-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ aiounittest diff --git a/pkgs/development/python-modules/google-cloud-iam-logging/default.nix b/pkgs/development/python-modules/google-cloud-iam-logging/default.nix index 16d0079d75fc..c6d817c55e2f 100644 --- a/pkgs/development/python-modules/google-cloud-iam-logging/default.nix +++ b/pkgs/development/python-modules/google-cloud-iam-logging/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-iam/default.nix b/pkgs/development/python-modules/google-cloud-iam/default.nix index 803aede8a80b..a9f77a1c8582 100644 --- a/pkgs/development/python-modules/google-cloud-iam/default.nix +++ b/pkgs/development/python-modules/google-cloud-iam/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { libcst proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-iot/default.nix b/pkgs/development/python-modules/google-cloud-iot/default.nix index 73ece34efc16..3ba1152f0f26 100644 --- a/pkgs/development/python-modules/google-cloud-iot/default.nix +++ b/pkgs/development/python-modules/google-cloud-iot/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { libcst proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-kms/default.nix b/pkgs/development/python-modules/google-cloud-kms/default.nix index e54bac921456..b671e36c0c90 100644 --- a/pkgs/development/python-modules/google-cloud-kms/default.nix +++ b/pkgs/development/python-modules/google-cloud-kms/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-language/default.nix b/pkgs/development/python-modules/google-cloud-language/default.nix index 3ca9a758b62a..856475f9bc45 100644 --- a/pkgs/development/python-modules/google-cloud-language/default.nix +++ b/pkgs/development/python-modules/google-cloud-language/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/google-cloud-logging/default.nix b/pkgs/development/python-modules/google-cloud-logging/default.nix index 9c9cca8a1517..11a57fbafe3e 100644 --- a/pkgs/development/python-modules/google-cloud-logging/default.nix +++ b/pkgs/development/python-modules/google-cloud-logging/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { opentelemetry-api proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ django diff --git a/pkgs/development/python-modules/google-cloud-monitoring/default.nix b/pkgs/development/python-modules/google-cloud-monitoring/default.nix index b8991f3b924e..3aa9766cfc77 100644 --- a/pkgs/development/python-modules/google-cloud-monitoring/default.nix +++ b/pkgs/development/python-modules/google-cloud-monitoring/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { pandas = [ pandas ]; @@ -44,7 +45,8 @@ buildPythonPackage rec { mock pytestCheckHook pytest-asyncio - ] ++ optional-dependencies.pandas; + ] + ++ optional-dependencies.pandas; disabledTests = [ # Test requires credentials diff --git a/pkgs/development/python-modules/google-cloud-netapp/default.nix b/pkgs/development/python-modules/google-cloud-netapp/default.nix index cadc1ea2bccb..8cb21256a174 100644 --- a/pkgs/development/python-modules/google-cloud-netapp/default.nix +++ b/pkgs/development/python-modules/google-cloud-netapp/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { google-auth proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-network-connectivity/default.nix b/pkgs/development/python-modules/google-cloud-network-connectivity/default.nix index 74c9bc3524ac..aa9de735fa29 100644 --- a/pkgs/development/python-modules/google-cloud-network-connectivity/default.nix +++ b/pkgs/development/python-modules/google-cloud-network-connectivity/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-org-policy/default.nix b/pkgs/development/python-modules/google-cloud-org-policy/default.nix index c51774dbc921..237dfb9715b6 100644 --- a/pkgs/development/python-modules/google-cloud-org-policy/default.nix +++ b/pkgs/development/python-modules/google-cloud-org-policy/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/google-cloud-os-config/default.nix b/pkgs/development/python-modules/google-cloud-os-config/default.nix index 445b367a177c..d741fde2296f 100644 --- a/pkgs/development/python-modules/google-cloud-os-config/default.nix +++ b/pkgs/development/python-modules/google-cloud-os-config/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/google-cloud-pubsub/default.nix b/pkgs/development/python-modules/google-cloud-pubsub/default.nix index 3f57119cad3e..dd3ba4b6fa18 100644 --- a/pkgs/development/python-modules/google-cloud-pubsub/default.nix +++ b/pkgs/development/python-modules/google-cloud-pubsub/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { opentelemetry-sdk proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; optional-dependencies = { libcst = [ libcst ]; diff --git a/pkgs/development/python-modules/google-cloud-redis/default.nix b/pkgs/development/python-modules/google-cloud-redis/default.nix index 63d8477ec656..4d79906112e5 100644 --- a/pkgs/development/python-modules/google-cloud-redis/default.nix +++ b/pkgs/development/python-modules/google-cloud-redis/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/google-cloud-resource-manager/default.nix b/pkgs/development/python-modules/google-cloud-resource-manager/default.nix index 5c1f2dacc50e..8bc1b805b8f8 100644 --- a/pkgs/development/python-modules/google-cloud-resource-manager/default.nix +++ b/pkgs/development/python-modules/google-cloud-resource-manager/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/google-cloud-secret-manager/default.nix b/pkgs/development/python-modules/google-cloud-secret-manager/default.nix index fc48572f9b1d..f382dcf45649 100644 --- a/pkgs/development/python-modules/google-cloud-secret-manager/default.nix +++ b/pkgs/development/python-modules/google-cloud-secret-manager/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/google-cloud-securitycenter/default.nix b/pkgs/development/python-modules/google-cloud-securitycenter/default.nix index 211ab711d227..6e16c2775a7f 100644 --- a/pkgs/development/python-modules/google-cloud-securitycenter/default.nix +++ b/pkgs/development/python-modules/google-cloud-securitycenter/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/google-cloud-shell/default.nix b/pkgs/development/python-modules/google-cloud-shell/default.nix index d5928afbaaa8..8fd3e422f84b 100644 --- a/pkgs/development/python-modules/google-cloud-shell/default.nix +++ b/pkgs/development/python-modules/google-cloud-shell/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { google-auth proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-spanner/default.nix b/pkgs/development/python-modules/google-cloud-spanner/default.nix index 4cd1785cbc7b..e0292cffafa2 100644 --- a/pkgs/development/python-modules/google-cloud-spanner/default.nix +++ b/pkgs/development/python-modules/google-cloud-spanner/default.nix @@ -78,7 +78,8 @@ buildPythonPackage rec { opentelemetry-semantic-conventions pytest-asyncio pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' # prevent google directory from shadowing google imports diff --git a/pkgs/development/python-modules/google-cloud-speech/default.nix b/pkgs/development/python-modules/google-cloud-speech/default.nix index afba3e88cdd3..c2f1ce1628b6 100644 --- a/pkgs/development/python-modules/google-cloud-speech/default.nix +++ b/pkgs/development/python-modules/google-cloud-speech/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { google-auth proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-tasks/default.nix b/pkgs/development/python-modules/google-cloud-tasks/default.nix index d941565b034b..63e3be6783e3 100644 --- a/pkgs/development/python-modules/google-cloud-tasks/default.nix +++ b/pkgs/development/python-modules/google-cloud-tasks/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-texttospeech/default.nix b/pkgs/development/python-modules/google-cloud-texttospeech/default.nix index 0eaa025c84d0..14250d29f124 100644 --- a/pkgs/development/python-modules/google-cloud-texttospeech/default.nix +++ b/pkgs/development/python-modules/google-cloud-texttospeech/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-trace/default.nix b/pkgs/development/python-modules/google-cloud-trace/default.nix index cadefb250167..3f2b2173ea35 100644 --- a/pkgs/development/python-modules/google-cloud-trace/default.nix +++ b/pkgs/development/python-modules/google-cloud-trace/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ google-cloud-testutils diff --git a/pkgs/development/python-modules/google-cloud-translate/default.nix b/pkgs/development/python-modules/google-cloud-translate/default.nix index b3dc48398ac4..fcab6d14a0fc 100644 --- a/pkgs/development/python-modules/google-cloud-translate/default.nix +++ b/pkgs/development/python-modules/google-cloud-translate/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ google-cloud-testutils diff --git a/pkgs/development/python-modules/google-cloud-videointelligence/default.nix b/pkgs/development/python-modules/google-cloud-videointelligence/default.nix index 905cc7391254..f7f2a5bd3221 100644 --- a/pkgs/development/python-modules/google-cloud-videointelligence/default.nix +++ b/pkgs/development/python-modules/google-cloud-videointelligence/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ google-cloud-testutils diff --git a/pkgs/development/python-modules/google-cloud-vision/default.nix b/pkgs/development/python-modules/google-cloud-vision/default.nix index b6db6d0345eb..f6aa2a3fae52 100644 --- a/pkgs/development/python-modules/google-cloud-vision/default.nix +++ b/pkgs/development/python-modules/google-cloud-vision/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-vpc-access/default.nix b/pkgs/development/python-modules/google-cloud-vpc-access/default.nix index 4700f7b3f748..30e901e3cbc7 100644 --- a/pkgs/development/python-modules/google-cloud-vpc-access/default.nix +++ b/pkgs/development/python-modules/google-cloud-vpc-access/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { google-auth proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-webrisk/default.nix b/pkgs/development/python-modules/google-cloud-webrisk/default.nix index 587a862f7508..ad6b545c1306 100644 --- a/pkgs/development/python-modules/google-cloud-webrisk/default.nix +++ b/pkgs/development/python-modules/google-cloud-webrisk/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { google-auth proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-websecurityscanner/default.nix b/pkgs/development/python-modules/google-cloud-websecurityscanner/default.nix index 128e4c4110a9..14ba809b0cad 100644 --- a/pkgs/development/python-modules/google-cloud-websecurityscanner/default.nix +++ b/pkgs/development/python-modules/google-cloud-websecurityscanner/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-workflows/default.nix b/pkgs/development/python-modules/google-cloud-workflows/default.nix index 93db2fa7abb0..09c61243b19c 100644 --- a/pkgs/development/python-modules/google-cloud-workflows/default.nix +++ b/pkgs/development/python-modules/google-cloud-workflows/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { google-api-core proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-cloud-workstations/default.nix b/pkgs/development/python-modules/google-cloud-workstations/default.nix index 9f0e6e0f73c1..8ebd364bb461 100644 --- a/pkgs/development/python-modules/google-cloud-workstations/default.nix +++ b/pkgs/development/python-modules/google-cloud-workstations/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { grpc-google-iam-v1 proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; nativeCheckInputs = [ mock diff --git a/pkgs/development/python-modules/google-geo-type/default.nix b/pkgs/development/python-modules/google-geo-type/default.nix index eacfc022a157..5bacb21694c7 100644 --- a/pkgs/development/python-modules/google-geo-type/default.nix +++ b/pkgs/development/python-modules/google-geo-type/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { google-auth proto-plus protobuf - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; pythonImportsCheck = [ "google.geo.type" ]; diff --git a/pkgs/development/python-modules/google-maps-routing/default.nix b/pkgs/development/python-modules/google-maps-routing/default.nix index aedf5d723e17..a6b7031eb30b 100644 --- a/pkgs/development/python-modules/google-maps-routing/default.nix +++ b/pkgs/development/python-modules/google-maps-routing/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { proto-plus protobuf google-geo-type - ] ++ google-api-core.optional-dependencies.grpc; + ] + ++ google-api-core.optional-dependencies.grpc; pythonImportsCheck = [ "google.maps.routing_v2" ]; diff --git a/pkgs/development/python-modules/google-resumable-media/default.nix b/pkgs/development/python-modules/google-resumable-media/default.nix index 7323ae9bc69d..c18ed1e89a01 100644 --- a/pkgs/development/python-modules/google-resumable-media/default.nix +++ b/pkgs/development/python-modules/google-resumable-media/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { mock pytest-asyncio pytestCheckHook - ] ++ optional-dependencies.requests; + ] + ++ optional-dependencies.requests; preCheck = '' # prevent shadowing imports diff --git a/pkgs/development/python-modules/gotenberg-client/default.nix b/pkgs/development/python-modules/gotenberg-client/default.nix index b350b87780f2..08f6bba80209 100644 --- a/pkgs/development/python-modules/gotenberg-client/default.nix +++ b/pkgs/development/python-modules/gotenberg-client/default.nix @@ -23,12 +23,11 @@ buildPythonPackage rec { nativeBuildInputs = [ hatchling ]; - propagatedBuildInputs = - [ - httpx - ] - ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ] - ++ httpx.optional-dependencies.http2; + propagatedBuildInputs = [ + httpx + ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ] + ++ httpx.optional-dependencies.http2; pythonImportsCheck = [ "gotenberg_client" ]; diff --git a/pkgs/development/python-modules/gpuctypes/default.nix b/pkgs/development/python-modules/gpuctypes/default.nix index 9b3bb75434f9..0b7cd65334a8 100644 --- a/pkgs/development/python-modules/gpuctypes/default.nix +++ b/pkgs/development/python-modules/gpuctypes/default.nix @@ -45,22 +45,21 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools ]; - postPatch = - '' - substituteInPlace gpuctypes/opencl.py \ - --replace "ctypes.util.find_library('OpenCL')" "'${ocl-icd}/lib/libOpenCL.so'" - '' - # hipGetDevicePropertiesR0600 is a symbol from rocm-6. We are currently at rocm-5. - # We are not sure that this works. Remove when rocm gets updated to version 6. - + lib.optionalString rocmSupport '' - substituteInPlace gpuctypes/hip.py \ - --replace "/opt/rocm/lib/libamdhip64.so" "${rocmPackages.clr}/lib/libamdhip64.so" \ - --replace "/opt/rocm/lib/libhiprtc.so" "${rocmPackages.clr}/lib/libhiprtc.so" \ - --replace "hipGetDevicePropertiesR0600" "hipGetDeviceProperties" + postPatch = '' + substituteInPlace gpuctypes/opencl.py \ + --replace "ctypes.util.find_library('OpenCL')" "'${ocl-icd}/lib/libOpenCL.so'" + '' + # hipGetDevicePropertiesR0600 is a symbol from rocm-6. We are currently at rocm-5. + # We are not sure that this works. Remove when rocm gets updated to version 6. + + lib.optionalString rocmSupport '' + substituteInPlace gpuctypes/hip.py \ + --replace "/opt/rocm/lib/libamdhip64.so" "${rocmPackages.clr}/lib/libamdhip64.so" \ + --replace "/opt/rocm/lib/libhiprtc.so" "${rocmPackages.clr}/lib/libhiprtc.so" \ + --replace "hipGetDevicePropertiesR0600" "hipGetDeviceProperties" - substituteInPlace gpuctypes/comgr.py \ - --replace "/opt/rocm/lib/libamd_comgr.so" "${rocmPackages.rocm-comgr}/lib/libamd_comgr.so" - ''; + substituteInPlace gpuctypes/comgr.py \ + --replace "/opt/rocm/lib/libamd_comgr.so" "${rocmPackages.rocm-comgr}/lib/libamd_comgr.so" + ''; pythonImportsCheck = [ "gpuctypes" ]; diff --git a/pkgs/development/python-modules/gql/default.nix b/pkgs/development/python-modules/gql/default.nix index 818d16cfd922..31b82be1521b 100644 --- a/pkgs/development/python-modules/gql/default.nix +++ b/pkgs/development/python-modules/gql/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { pytest-console-scripts pytestCheckHook vcrpy - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; optional-dependencies = { all = [ diff --git a/pkgs/development/python-modules/gradio/default.nix b/pkgs/development/python-modules/gradio/default.nix index 216992bd94af..2dc0150bb019 100644 --- a/pkgs/development/python-modules/gradio/default.nix +++ b/pkgs/development/python-modules/gradio/default.nix @@ -152,33 +152,32 @@ buildPythonPackage rec { itsdangerous ]; - nativeCheckInputs = - [ - altair - boto3 - brotli - docker - ffmpeg - gradio-pdf - hypothesis - ipython - mcp - pytest-asyncio - pytestCheckHook - respx - # shap is needed as well, but breaks too often - scikit-image - torch - tqdm - transformers - vega-datasets + nativeCheckInputs = [ + altair + boto3 + brotli + docker + ffmpeg + gradio-pdf + hypothesis + ipython + mcp + pytest-asyncio + pytestCheckHook + respx + # shap is needed as well, but breaks too often + scikit-image + torch + tqdm + transformers + vega-datasets - # mock calls to `shutil.which(...)` - (writeShellScriptBin "npm" "false") - writableTmpDirAsHomeHook - ] - ++ optional-dependencies.oauth - ++ pydantic.optional-dependencies.email; + # mock calls to `shutil.which(...)` + (writeShellScriptBin "npm" "false") + writableTmpDirAsHomeHook + ] + ++ optional-dependencies.oauth + ++ pydantic.optional-dependencies.email; preBuild = '' pnpm build @@ -192,129 +191,127 @@ buildPythonPackage rec { # Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail). # We additionally xfail FileNotFoundError, since the gradio devs often fail to upload test assets to pypi. - preCheck = - '' - cat ${./conftest-skip-network-errors.py} >> test/conftest.py - '' - # OSError: [Errno 24] Too many open files - + lib.optionalString stdenv.hostPlatform.isDarwin '' - ulimit -n 4096 - ''; + preCheck = '' + cat ${./conftest-skip-network-errors.py} >> test/conftest.py + '' + # OSError: [Errno 24] Too many open files + + lib.optionalString stdenv.hostPlatform.isDarwin '' + ulimit -n 4096 + ''; - disabledTests = - [ - # Actually broken - "test_mount_gradio_app" - "test_processing_utils_backwards_compatibility" # type error + disabledTests = [ + # Actually broken + "test_mount_gradio_app" + "test_processing_utils_backwards_compatibility" # type error - # requires network, it caught our xfail exception - "test_error_analytics_successful" + # requires network, it caught our xfail exception + "test_error_analytics_successful" - # Flaky, tries to pin dependency behaviour. Sensitive to dep versions - # These error only affect downstream use of the check dependencies. - "test_no_color" - "test_in_interface_as_output" - "test_should_warn_url_not_having_version" + # Flaky, tries to pin dependency behaviour. Sensitive to dep versions + # These error only affect downstream use of the check dependencies. + "test_no_color" + "test_in_interface_as_output" + "test_should_warn_url_not_having_version" - # Flaky, unknown reason - "test_in_interface" + # Flaky, unknown reason + "test_in_interface" - # shap is too often broken in nixpkgs - "test_shapley_text" + # shap is too often broken in nixpkgs + "test_shapley_text" - # fails without network - "test_download_if_url_correct_parse" - "test_encode_url_to_base64_doesnt_encode_errors" + # fails without network + "test_download_if_url_correct_parse" + "test_encode_url_to_base64_doesnt_encode_errors" - # flaky: OSError: Cannot find empty port in range: 7860-7959 - "test_docs_url" - "test_orjson_serialization" - "test_dataset_is_updated" - "test_multimodal_api" - "test_examples_keep_all_suffixes" - "test_progress_bar" - "test_progress_bar_track_tqdm" - "test_info_and_warning_alerts" - "test_info_isolation[True]" - "test_info_isolation[False]" - "test_examples_no_cache_optional_inputs" - "test_start_server[127.0.0.1]" - "test_start_server[[::1]]" - "test_single_request" - "test_all_status_messages" - "test_default_concurrency_limits[not_set-statuses0]" - "test_default_concurrency_limits[None-statuses1]" - "test_default_concurrency_limits[1-statuses2]" - "test_default_concurrency_limits[2-statuses3]" - "test_concurrency_limits" + # flaky: OSError: Cannot find empty port in range: 7860-7959 + "test_docs_url" + "test_orjson_serialization" + "test_dataset_is_updated" + "test_multimodal_api" + "test_examples_keep_all_suffixes" + "test_progress_bar" + "test_progress_bar_track_tqdm" + "test_info_and_warning_alerts" + "test_info_isolation[True]" + "test_info_isolation[False]" + "test_examples_no_cache_optional_inputs" + "test_start_server[127.0.0.1]" + "test_start_server[[::1]]" + "test_single_request" + "test_all_status_messages" + "test_default_concurrency_limits[not_set-statuses0]" + "test_default_concurrency_limits[None-statuses1]" + "test_default_concurrency_limits[1-statuses2]" + "test_default_concurrency_limits[2-statuses3]" + "test_concurrency_limits" - # tests if pip and other tools are installed - "test_get_executable_path" + # tests if pip and other tools are installed + "test_get_executable_path" - # Flaky test (AssertionError when comparing to a fixed array) - # https://github.com/gradio-app/gradio/issues/11620 - "test_auto_datatype" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType' - "test_component_example_values" - "test_component_functions" - "test_public_request_pass" + # Flaky test (AssertionError when comparing to a fixed array) + # https://github.com/gradio-app/gradio/issues/11620 + "test_auto_datatype" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType' + "test_component_example_values" + "test_component_functions" + "test_public_request_pass" - # Failed: DID NOT RAISE - # test.conftest.NixNetworkAccessDeniedError - "test_private_request_fail" - "test_theme_builder_launches" + # Failed: DID NOT RAISE + # test.conftest.NixNetworkAccessDeniedError + "test_private_request_fail" + "test_theme_builder_launches" - # flaky on darwin (depend on port availability) - "test_all_status_messages" - "test_async_generators" - "test_async_generators_interface" - "test_async_iterator_update_with_new_component" - "test_concurrency_limits" - "test_default_concurrency_limits" - "test_default_flagging_callback" - "test_end_to_end" - "test_end_to_end_cache_examples" - "test_event_data" - "test_every_does_not_block_queue" - "test_example_caching_relaunch" - "test_example_caching_relaunch" - "test_exit_called_at_launch" - "test_file_component_uploads" - "test_files_saved_as_file_paths" - "test_flagging_does_not_create_unnecessary_directories" - "test_flagging_no_permission_error_with_flagging_disabled" - "test_info_and_warning_alerts" - "test_info_isolation" - "test_launch_analytics_does_not_error_with_invalid_blocks" - "test_no_empty_audio_files" - "test_no_empty_image_files" - "test_no_empty_video_files" - "test_non_streaming_api" - "test_non_streaming_api_async" - "test_pil_images_hashed" - "test_progress_bar" - "test_progress_bar_track_tqdm" - "test_queue_when_using_auth" - "test_restart_after_close" - "test_set_share_in_colab" - "test_show_error" - "test_simple_csv_flagging_callback" - "test_single_request" - "test_socket_reuse" - "test_start_server" - "test_state_holder_is_used_in_postprocess" - "test_state_stored_up_to_capacity" - "test_static_files_single_app" - "test_streaming_api" - "test_streaming_api_async" - "test_streaming_api_with_additional_inputs" - "test_sync_generators" - "test_time_to_live_and_delete_callback_for_state" - "test_updates_stored_up_to_capacity" - "test_varying_output_forms_with_generators" - ]; + # flaky on darwin (depend on port availability) + "test_all_status_messages" + "test_async_generators" + "test_async_generators_interface" + "test_async_iterator_update_with_new_component" + "test_concurrency_limits" + "test_default_concurrency_limits" + "test_default_flagging_callback" + "test_end_to_end" + "test_end_to_end_cache_examples" + "test_event_data" + "test_every_does_not_block_queue" + "test_example_caching_relaunch" + "test_example_caching_relaunch" + "test_exit_called_at_launch" + "test_file_component_uploads" + "test_files_saved_as_file_paths" + "test_flagging_does_not_create_unnecessary_directories" + "test_flagging_no_permission_error_with_flagging_disabled" + "test_info_and_warning_alerts" + "test_info_isolation" + "test_launch_analytics_does_not_error_with_invalid_blocks" + "test_no_empty_audio_files" + "test_no_empty_image_files" + "test_no_empty_video_files" + "test_non_streaming_api" + "test_non_streaming_api_async" + "test_pil_images_hashed" + "test_progress_bar" + "test_progress_bar_track_tqdm" + "test_queue_when_using_auth" + "test_restart_after_close" + "test_set_share_in_colab" + "test_show_error" + "test_simple_csv_flagging_callback" + "test_single_request" + "test_socket_reuse" + "test_start_server" + "test_state_holder_is_used_in_postprocess" + "test_state_stored_up_to_capacity" + "test_static_files_single_app" + "test_streaming_api" + "test_streaming_api_async" + "test_streaming_api_with_additional_inputs" + "test_sync_generators" + "test_time_to_live_and_delete_callback_for_state" + "test_updates_stored_up_to_capacity" + "test_varying_output_forms_with_generators" + ]; disabledTestPaths = [ # 100% touches network diff --git a/pkgs/development/python-modules/graph-tool/default.nix b/pkgs/development/python-modules/graph-tool/default.nix index 3cc2c2394f64..cd96ac773252 100644 --- a/pkgs/development/python-modules/graph-tool/default.nix +++ b/pkgs/development/python-modules/graph-tool/default.nix @@ -73,7 +73,8 @@ buildPythonPackage rec { pygobject3 scipy sparsehash - ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; pythonImportsCheck = [ "graph_tool" ]; diff --git a/pkgs/development/python-modules/graphene-django/default.nix b/pkgs/development/python-modules/graphene-django/default.nix index bc5c4bc06614..87c81a0c54c9 100644 --- a/pkgs/development/python-modules/graphene-django/default.nix +++ b/pkgs/development/python-modules/graphene-django/default.nix @@ -61,18 +61,17 @@ buildPythonPackage rec { pytest7CheckHook ]; - disabledTests = - [ - # https://github.com/graphql-python/graphene-django/issues/1510 - "test_should_filepath_convert_string" - "test_should_choice_convert_enum" - "test_should_multiplechoicefield_convert_to_list_of_enum" - "test_perform_mutate_success_with_enum_choice_field" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # this test touches files in the "/" directory and fails in darwin sandbox - "test_should_filepath_convert_string" - ]; + disabledTests = [ + # https://github.com/graphql-python/graphene-django/issues/1510 + "test_should_filepath_convert_string" + "test_should_choice_convert_enum" + "test_should_multiplechoicefield_convert_to_list_of_enum" + "test_perform_mutate_success_with_enum_choice_field" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # this test touches files in the "/" directory and fails in darwin sandbox + "test_should_filepath_convert_string" + ]; meta = with lib; { description = "Integrate GraphQL into your Django project"; diff --git a/pkgs/development/python-modules/graphite-web/default.nix b/pkgs/development/python-modules/graphite-web/default.nix index 61fd0f7ba22b..19bf7f0fb368 100644 --- a/pkgs/development/python-modules/graphite-web/default.nix +++ b/pkgs/development/python-modules/graphite-web/default.nix @@ -41,19 +41,18 @@ buildPythonPackage { hash = "sha256-TxsQPhnI5WhQvKKkDEYZ8xnyg/qf+N9Icej6d6A0jC0="; }; - postPatch = - '' - substituteInPlace webapp/graphite/settings.py \ - --replace-fail \ - "join(WEBAPP_DIR, 'content')" \ - "join('$out/webapp', 'content')" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace webapp/tests/test_dashboard.py \ - --replace-fail "test_dashboard_email" "_dont_test_dashboard_email" - substituteInPlace webapp/tests/test_render.py \ - --replace-fail "test_render_view" "_dont_test_render_view" - ''; + postPatch = '' + substituteInPlace webapp/graphite/settings.py \ + --replace-fail \ + "join(WEBAPP_DIR, 'content')" \ + "join('$out/webapp', 'content')" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace webapp/tests/test_dashboard.py \ + --replace-fail "test_dashboard_email" "_dont_test_dashboard_email" + substituteInPlace webapp/tests/test_render.py \ + --replace-fail "test_render_view" "_dont_test_render_view" + ''; dependencies = [ cairocffi diff --git a/pkgs/development/python-modules/great-expectations/default.nix b/pkgs/development/python-modules/great-expectations/default.nix index fe2f4f5274c5..d01714eb2187 100644 --- a/pkgs/development/python-modules/great-expectations/default.nix +++ b/pkgs/development/python-modules/great-expectations/default.nix @@ -85,24 +85,23 @@ buildPythonPackage rec { "posthog" ]; - nativeCheckInputs = - [ - pytestCheckHook - pytest-mock - pytest-order - pytest-random-order - click - flaky - freezegun - invoke - moto - psycopg2 - requirements-parser - responses - sqlalchemy - ] - ++ moto.optional-dependencies.s3 - ++ moto.optional-dependencies.sns; + nativeCheckInputs = [ + pytestCheckHook + pytest-mock + pytest-order + pytest-random-order + click + flaky + freezegun + invoke + moto + psycopg2 + requirements-parser + responses + sqlalchemy + ] + ++ moto.optional-dependencies.s3 + ++ moto.optional-dependencies.sns; disabledTestPaths = [ # try to access external URLs: diff --git a/pkgs/development/python-modules/groq/default.nix b/pkgs/development/python-modules/groq/default.nix index 8e77c427b65f..180df1e23be5 100644 --- a/pkgs/development/python-modules/groq/default.nix +++ b/pkgs/development/python-modules/groq/default.nix @@ -66,7 +66,8 @@ buildPythonPackage rec { pytest-xdist pytestCheckHook respx - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "groq" ]; diff --git a/pkgs/development/python-modules/grpcio/default.nix b/pkgs/development/python-modules/grpcio/default.nix index 4fab1bb0b8cc..eb90a2b0e4f8 100644 --- a/pkgs/development/python-modules/grpcio/default.nix +++ b/pkgs/development/python-modules/grpcio/default.nix @@ -48,16 +48,15 @@ buildPythonPackage rec { dependencies = [ protobuf ]; - preBuild = - '' - export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS="$NIX_BUILD_CORES" - if [ -z "$enableParallelBuilding" ]; then - GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=1 - fi - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - unset AR - ''; + preBuild = '' + export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS="$NIX_BUILD_CORES" + if [ -z "$enableParallelBuilding" ]; then + GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=1 + fi + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + unset AR + ''; GRPC_BUILD_WITH_BORING_SSL_ASM = ""; GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1; diff --git a/pkgs/development/python-modules/gruut/default.nix b/pkgs/development/python-modules/gruut/default.nix index fa6d81c9b1cb..723a15efea81 100644 --- a/pkgs/development/python-modules/gruut/default.nix +++ b/pkgs/development/python-modules/gruut/default.nix @@ -69,29 +69,30 @@ buildPythonPackage rec { num2words numpy python-crfsuite - ] ++ optional-dependencies.en; + ] + ++ optional-dependencies.en; - optional-dependencies = - { - train = [ - pydub - rapidfuzz - ]; - } - // lib.genAttrs langPkgs (lang: [ - (callPackage ./language-pack.nix { - inherit - lang - version - src - build-system - ; - }) - ]); + optional-dependencies = { + train = [ + pydub + rapidfuzz + ]; + } + // lib.genAttrs langPkgs (lang: [ + (callPackage ./language-pack.nix { + inherit + lang + version + src + build-system + ; + }) + ]); nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # https://github.com/rhasspy/gruut/issues/25 diff --git a/pkgs/development/python-modules/gstools/default.nix b/pkgs/development/python-modules/gstools/default.nix index d1084e8425e8..3e4a42c032b1 100644 --- a/pkgs/development/python-modules/gstools/default.nix +++ b/pkgs/development/python-modules/gstools/default.nix @@ -64,7 +64,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-cov-stub - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); meta = { description = "Geostatistical toolbox"; diff --git a/pkgs/development/python-modules/gudhi/default.nix b/pkgs/development/python-modules/gudhi/default.nix index 145c9158b6a8..124b2660c5b9 100644 --- a/pkgs/development/python-modules/gudhi/default.nix +++ b/pkgs/development/python-modules/gudhi/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { gmp cgal mpfr - ] ++ lib.optionals enableTBB [ tbb ]; + ] + ++ lib.optionals enableTBB [ tbb ]; propagatedBuildInputs = [ numpy scipy diff --git a/pkgs/development/python-modules/guessit/default.nix b/pkgs/development/python-modules/guessit/default.nix index 6efbb7693c81..adaefe1da1a2 100644 --- a/pkgs/development/python-modules/guessit/default.nix +++ b/pkgs/development/python-modules/guessit/default.nix @@ -28,7 +28,8 @@ buildPythonPackage rec { rebulk babelfish python-dateutil - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; nativeCheckInputs = [ py diff --git a/pkgs/development/python-modules/guidance/default.nix b/pkgs/development/python-modules/guidance/default.nix index 833edd12343a..2f9c1bfe8ffd 100644 --- a/pkgs/development/python-modules/guidance/default.nix +++ b/pkgs/development/python-modules/guidance/default.nix @@ -85,7 +85,8 @@ buildPythonPackage rec { tokenizers torch writableTmpDirAsHomeHook - ] ++ optional-dependencies.schemas; + ] + ++ optional-dependencies.schemas; enabledTestPaths = [ "tests/unit" ]; diff --git a/pkgs/development/python-modules/gunicorn/default.nix b/pkgs/development/python-modules/gunicorn/default.nix index eaa37aafa6bf..f3c8b075c0af 100644 --- a/pkgs/development/python-modules/gunicorn/default.nix +++ b/pkgs/development/python-modules/gunicorn/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-cov-stub - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); meta = { description = "gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications"; diff --git a/pkgs/development/python-modules/gvm-tools/default.nix b/pkgs/development/python-modules/gvm-tools/default.nix index 8e07125734ed..a325a7eb8563 100644 --- a/pkgs/development/python-modules/gvm-tools/default.nix +++ b/pkgs/development/python-modules/gvm-tools/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { disabledTests = [ # Don't test sending "SendTargetTestCase" - ] ++ lib.optionals (pythonAtLeast "3.10") [ "HelpFormattingParserTestCase" ]; + ] + ++ lib.optionals (pythonAtLeast "3.10") [ "HelpFormattingParserTestCase" ]; pythonImportsCheck = [ "gvmtools" ]; diff --git a/pkgs/development/python-modules/gym/default.nix b/pkgs/development/python-modules/gym/default.nix index 8e9f227bb6ee..764a9cda9e28 100644 --- a/pkgs/development/python-modules/gym/default.nix +++ b/pkgs/development/python-modules/gym/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { cloudpickle numpy gym-notices - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; pythonImportsCheck = [ "gym" ]; @@ -78,45 +79,44 @@ buildPythonPackage rec { export SDL_VIDEODRIVER=dummy ''; - disabledTests = - [ - # TypeError: Converting from sequence to b2Vec2, expected int/float arguments index 0 - "test_box_actions_out_of_bound" - "test_env_determinism_rollout" - "test_envs_pass_env_checker" - "test_frame_stack" - "test_make_autoreset_true" - "test_passive_checker_wrapper_warnings" - "test_pickle_env" - "test_render_modes" + disabledTests = [ + # TypeError: Converting from sequence to b2Vec2, expected int/float arguments index 0 + "test_box_actions_out_of_bound" + "test_env_determinism_rollout" + "test_envs_pass_env_checker" + "test_frame_stack" + "test_make_autoreset_true" + "test_passive_checker_wrapper_warnings" + "test_pickle_env" + "test_render_modes" - # TypeError: in method 'b2RevoluteJoint___SetMotorSpeed', argument 2 of type 'float32' - "test_box_actions_out_of_bound" + # TypeError: in method 'b2RevoluteJoint___SetMotorSpeed', argument 2 of type 'float32' + "test_box_actions_out_of_bound" - # TypeError: exceptions must be derived from Warning, not - "test_dict_init" + # TypeError: exceptions must be derived from Warning, not + "test_dict_init" - # ValueError: setting an array element with a sequence. - # The requested array has an inhomogeneous shape after 1 dimensions. - # The detected shape was (2,) + inhomogeneous part - "test_sample_contains" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fatal Python error: Aborted - # gym/envs/classic_control/cartpole.py", line 227 in render - "test_autoclose" - "test_call_async_vector_env" - "test_call_sync_vector_env" - "test_human_rendering" - "test_make_render_mode" - "test_order_enforcing" - "test_record_simple" - "test_record_video_reset" - "test_record_video_step_trigger" - "test_record_video_using_default_trigger" - "test_record_video_within_vecto" - "test_text_envs" - ]; + # ValueError: setting an array element with a sequence. + # The requested array has an inhomogeneous shape after 1 dimensions. + # The detected shape was (2,) + inhomogeneous part + "test_sample_contains" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fatal Python error: Aborted + # gym/envs/classic_control/cartpole.py", line 227 in render + "test_autoclose" + "test_call_async_vector_env" + "test_call_sync_vector_env" + "test_human_rendering" + "test_make_render_mode" + "test_order_enforcing" + "test_record_simple" + "test_record_video_reset" + "test_record_video_step_trigger" + "test_record_video_using_default_trigger" + "test_record_video_within_vecto" + "test_text_envs" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # Fatal Python error: Aborted diff --git a/pkgs/development/python-modules/gymnasium/default.nix b/pkgs/development/python-modules/gymnasium/default.nix index f81312e97e58..86e3fe22186e 100644 --- a/pkgs/development/python-modules/gymnasium/default.nix +++ b/pkgs/development/python-modules/gymnasium/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { farama-notifications numpy typing-extensions - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; optional-dependencies = { atari = [ diff --git a/pkgs/development/python-modules/h3/default.nix b/pkgs/development/python-modules/h3/default.nix index b9208fdd8ed3..f1379544ba21 100644 --- a/pkgs/development/python-modules/h3/default.nix +++ b/pkgs/development/python-modules/h3/default.nix @@ -34,19 +34,18 @@ buildPythonPackage rec { pytest-cov-stub ]; - build-system = - [ - scikit-build-core - cmake - cython - ninja - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # On Linux the .so files ends up referring to libh3.so instead of the full - # Nix store path. I'm not sure why this is happening! On Darwin it works - # fine. - autoPatchelfHook - ]; + build-system = [ + scikit-build-core + cmake + cython + ninja + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # On Linux the .so files ends up referring to libh3.so instead of the full + # Nix store path. I'm not sure why this is happening! On Darwin it works + # fine. + autoPatchelfHook + ]; # This is not needed per-se, it's only added for autoPatchelfHook to work # correctly. See the note above ^^ diff --git a/pkgs/development/python-modules/h5py/default.nix b/pkgs/development/python-modules/h5py/default.nix index 26b2a38984ed..cd43c0e05798 100644 --- a/pkgs/development/python-modules/h5py/default.nix +++ b/pkgs/development/python-modules/h5py/default.nix @@ -67,13 +67,14 @@ buildPythonPackage rec { buildInputs = [ hdf5 ] ++ lib.optional mpiSupport mpi; - dependencies = - [ numpy ] - ++ lib.optionals mpiSupport [ - mpi4py - openssh - ] - ++ lib.optionals (pythonOlder "3.8") [ cached-property ]; + dependencies = [ + numpy + ] + ++ lib.optionals mpiSupport [ + mpi4py + openssh + ] + ++ lib.optionals (pythonOlder "3.8") [ cached-property ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/hap-python/default.nix b/pkgs/development/python-modules/hap-python/default.nix index dec814e0d632..00e7776fb290 100644 --- a/pkgs/development/python-modules/hap-python/default.nix +++ b/pkgs/development/python-modules/hap-python/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { pytest-asyncio pytest-timeout pytestCheckHook - ] ++ optional-dependencies.QRCode; + ] + ++ optional-dependencies.QRCode; disabledTestPaths = [ # Disable tests requiring network access diff --git a/pkgs/development/python-modules/hatch-fancy-pypi-readme/default.nix b/pkgs/development/python-modules/hatch-fancy-pypi-readme/default.nix index 2c96dd85be1e..c8efd2065cc4 100644 --- a/pkgs/development/python-modules/hatch-fancy-pypi-readme/default.nix +++ b/pkgs/development/python-modules/hatch-fancy-pypi-readme/default.nix @@ -25,10 +25,11 @@ buildPythonPackage rec { nativeBuildInputs = [ hatchling ]; - propagatedBuildInputs = - [ hatchling ] - ++ lib.optionals (pythonOlder "3.11") [ tomli ] - ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + propagatedBuildInputs = [ + hatchling + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; nativeCheckInputs = [ build diff --git a/pkgs/development/python-modules/hatch-jupyter-builder/default.nix b/pkgs/development/python-modules/hatch-jupyter-builder/default.nix index 1dd0336158fa..849d3b85ed88 100644 --- a/pkgs/development/python-modules/hatch-jupyter-builder/default.nix +++ b/pkgs/development/python-modules/hatch-jupyter-builder/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { pytest-mock pytestCheckHook twine - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; disabledTests = [ # tests pip install, which unsurprisingly fails diff --git a/pkgs/development/python-modules/hatch-odoo/default.nix b/pkgs/development/python-modules/hatch-odoo/default.nix index 86822cc28388..415959caebc9 100644 --- a/pkgs/development/python-modules/hatch-odoo/default.nix +++ b/pkgs/development/python-modules/hatch-odoo/default.nix @@ -22,14 +22,13 @@ buildPythonPackage rec { buildInputs = [ hatch-vcs ]; - propagatedBuildInputs = - [ - hatchling - manifestoo-core - ] - ++ lib.optionals (pythonOlder "3.11") [ - tomli - ]; + propagatedBuildInputs = [ + hatchling + manifestoo-core + ] + ++ lib.optionals (pythonOlder "3.11") [ + tomli + ]; meta = with lib; { description = "A hatch plugin to develop and package Odoo projects"; diff --git a/pkgs/development/python-modules/hatch-vcs/default.nix b/pkgs/development/python-modules/hatch-vcs/default.nix index 3592cbf86d80..0eeded66ee6a 100644 --- a/pkgs/development/python-modules/hatch-vcs/default.nix +++ b/pkgs/development/python-modules/hatch-vcs/default.nix @@ -34,18 +34,17 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # incompatible with setuptools-scm>=7 - # https://github.com/ofek/hatch-vcs/issues/8 - "test_write" - ] - ++ lib.optionals (pythonOlder "3.11") [ - # https://github.com/pypa/setuptools_scm/issues/1038, fixed in setuptools_scm@8.1.0 - "test_basic" - "test_root" - "test_metadata" - ]; + disabledTests = [ + # incompatible with setuptools-scm>=7 + # https://github.com/ofek/hatch-vcs/issues/8 + "test_write" + ] + ++ lib.optionals (pythonOlder "3.11") [ + # https://github.com/pypa/setuptools_scm/issues/1038, fixed in setuptools_scm@8.1.0 + "test_basic" + "test_root" + "test_metadata" + ]; pythonImportsCheck = [ "hatch_vcs" ]; diff --git a/pkgs/development/python-modules/hatchling/default.nix b/pkgs/development/python-modules/hatchling/default.nix index 00b147ab0e19..e5826164a6a1 100644 --- a/pkgs/development/python-modules/hatchling/default.nix +++ b/pkgs/development/python-modules/hatchling/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { pathspec pluggy trove-classifiers - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; pythonImportsCheck = [ "hatchling" diff --git a/pkgs/development/python-modules/hf-transfer/default.nix b/pkgs/development/python-modules/hf-transfer/default.nix index 31bad5ac800d..7376ba902023 100644 --- a/pkgs/development/python-modules/hf-transfer/default.nix +++ b/pkgs/development/python-modules/hf-transfer/default.nix @@ -40,13 +40,12 @@ buildPythonPackage rec { rustc ]; - buildInputs = - [ - openssl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; pythonImportsCheck = [ "hf_transfer" ]; diff --git a/pkgs/development/python-modules/hishel/default.nix b/pkgs/development/python-modules/hishel/default.nix index 8c5ac62601ad..eaf719c49358 100644 --- a/pkgs/development/python-modules/hishel/default.nix +++ b/pkgs/development/python-modules/hishel/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { pytest-asyncio pytestCheckHook trio - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "hishel" ]; diff --git a/pkgs/development/python-modules/home-assistant-chip-core/default.nix b/pkgs/development/python-modules/home-assistant-chip-core/default.nix index 1f681207882e..ce3dd7cba288 100644 --- a/pkgs/development/python-modules/home-assistant-chip-core/default.nix +++ b/pkgs/development/python-modules/home-assistant-chip-core/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { deprecation mobly pygobject3 - ] ++ home-assistant-chip-wheels.propagatedBuildInputs; + ] + ++ home-assistant-chip-wheels.propagatedBuildInputs; pythonNamespaces = [ "chip" diff --git a/pkgs/development/python-modules/htmldate/default.nix b/pkgs/development/python-modules/htmldate/default.nix index 22be4bbe16f5..9fa529db9c2d 100644 --- a/pkgs/development/python-modules/htmldate/default.nix +++ b/pkgs/development/python-modules/htmldate/default.nix @@ -39,20 +39,18 @@ buildPythonPackage rec { ]; optional-dependencies = { - speed = - [ - faust-cchardet - urllib3 - ] - ++ lib.optionals (pythonOlder "3.11") [ backports-datetime-fromisoformat ] - ++ urllib3.optional-dependencies.brotli; - all = - [ - faust-cchardet - urllib3 - ] - ++ lib.optionals (pythonOlder "3.11") [ backports-datetime-fromisoformat ] - ++ urllib3.optional-dependencies.brotli; + speed = [ + faust-cchardet + urllib3 + ] + ++ lib.optionals (pythonOlder "3.11") [ backports-datetime-fromisoformat ] + ++ urllib3.optional-dependencies.brotli; + all = [ + faust-cchardet + urllib3 + ] + ++ lib.optionals (pythonOlder "3.11") [ backports-datetime-fromisoformat ] + ++ urllib3.optional-dependencies.brotli; }; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/htseq/default.nix b/pkgs/development/python-modules/htseq/default.nix index fc965bbae573..014b2121b2ef 100644 --- a/pkgs/development/python-modules/htseq/default.nix +++ b/pkgs/development/python-modules/htseq/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pandas pytestCheckHook - ] ++ optional-dependencies.htseq-qa; + ] + ++ optional-dependencies.htseq-qa; preCheck = '' rm -r src HTSeq diff --git a/pkgs/development/python-modules/httpcore/default.nix b/pkgs/development/python-modules/httpcore/default.nix index 8e6a4980d142..100a3d25e772 100644 --- a/pkgs/development/python-modules/httpcore/default.nix +++ b/pkgs/development/python-modules/httpcore/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { pytest-httpbin pytest-trio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "httpcore" ]; diff --git a/pkgs/development/python-modules/httpie/default.nix b/pkgs/development/python-modules/httpie/default.nix index 90c142c1aaeb..5e9aa84435df 100644 --- a/pkgs/development/python-modules/httpie/default.nix +++ b/pkgs/development/python-modules/httpie/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { requests-toolbelt setuptools rich - ] ++ requests.optional-dependencies.socks; + ] + ++ requests.optional-dependencies.socks; __darwinAllowLocalNetworking = true; @@ -92,25 +93,24 @@ buildPythonPackage rec { "tests/test_plugins_cli.py" ]; - disabledTests = - [ - # argparse output changed - "test_naked_invocation" - # Test is flaky - "test_stdin_read_warning" - # httpbin compatibility issues - "test_binary_suppresses_when_terminal" - "test_binary_suppresses_when_not_terminal_but_pretty" - "test_binary_included_and_correct_when_suitable" - # charset-normalizer compat issue - # https://github.com/httpie/cli/issues/1628 - "test_terminal_output_response_charset_detection" - "test_terminal_output_request_charset_detection" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Test is flaky - "test_daemon_runner" - ]; + disabledTests = [ + # argparse output changed + "test_naked_invocation" + # Test is flaky + "test_stdin_read_warning" + # httpbin compatibility issues + "test_binary_suppresses_when_terminal" + "test_binary_suppresses_when_not_terminal_but_pretty" + "test_binary_included_and_correct_when_suitable" + # charset-normalizer compat issue + # https://github.com/httpie/cli/issues/1628 + "test_terminal_output_response_charset_detection" + "test_terminal_output_request_charset_detection" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Test is flaky + "test_daemon_runner" + ]; meta = with lib; { description = "Command line HTTP client whose goal is to make CLI human-friendly"; diff --git a/pkgs/development/python-modules/httplib2/default.nix b/pkgs/development/python-modules/httplib2/default.nix index 9a2201ae6969..ca440c7058fe 100644 --- a/pkgs/development/python-modules/httplib2/default.nix +++ b/pkgs/development/python-modules/httplib2/default.nix @@ -45,23 +45,22 @@ buildPythonPackage rec { # Don't run tests for older Pythons doCheck = pythonAtLeast "3.9"; - disabledTests = - [ - # ValueError: Unable to load PEM file. - # https://github.com/httplib2/httplib2/issues/192#issuecomment-993165140 - "test_client_cert_password_verified" + disabledTests = [ + # ValueError: Unable to load PEM file. + # https://github.com/httplib2/httplib2/issues/192#issuecomment-993165140 + "test_client_cert_password_verified" - # improper pytest marking - "test_head_301" - "test_303" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fails with "ConnectionResetError: [Errno 54] Connection reset by peer" - "test_connection_close" - # fails with HTTP 408 Request Timeout, instead of expected 200 OK - "test_timeout_subsequent" - "test_connection_close" - ]; + # improper pytest marking + "test_head_301" + "test_303" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fails with "ConnectionResetError: [Errno 54] Connection reset by peer" + "test_connection_close" + # fails with HTTP 408 Request Timeout, instead of expected 200 OK + "test_timeout_subsequent" + "test_connection_close" + ]; pytestFlagsArray = [ "--ignore python2" ]; diff --git a/pkgs/development/python-modules/httpx-socks/default.nix b/pkgs/development/python-modules/httpx-socks/default.nix index 5ae39830f90c..a72fa89f79ab 100644 --- a/pkgs/development/python-modules/httpx-socks/default.nix +++ b/pkgs/development/python-modules/httpx-socks/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { httpx httpcore python-socks - ] ++ python-socks.optional-dependencies.asyncio; + ] + ++ python-socks.optional-dependencies.asyncio; optional-dependencies = { asyncio = [ async-timeout ]; diff --git a/pkgs/development/python-modules/httpx/default.nix b/pkgs/development/python-modules/httpx/default.nix index 6602f1be45e7..74eeaedd9281 100644 --- a/pkgs/development/python-modules/httpx/default.nix +++ b/pkgs/development/python-modules/httpx/default.nix @@ -78,7 +78,8 @@ buildPythonPackage rec { pytest-trio trustme uvicorn - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # testsuite wants to find installed packages for testing entrypoint preCheck = '' diff --git a/pkgs/development/python-modules/huggingface-hub/default.nix b/pkgs/development/python-modules/huggingface-hub/default.nix index 30b8c60a4102..bcc3dfb3dacb 100644 --- a/pkgs/development/python-modules/huggingface-hub/default.nix +++ b/pkgs/development/python-modules/huggingface-hub/default.nix @@ -76,7 +76,8 @@ buildPythonPackage rec { torch = [ torch safetensors - ] ++ safetensors.optional-dependencies.torch; + ] + ++ safetensors.optional-dependencies.torch; hf_transfer = [ hf-transfer ]; diff --git a/pkgs/development/python-modules/hupper/default.nix b/pkgs/development/python-modules/hupper/default.nix index 0c69762ec8f1..592c4487d872 100644 --- a/pkgs/development/python-modules/hupper/default.nix +++ b/pkgs/development/python-modules/hupper/default.nix @@ -21,7 +21,8 @@ buildPythonPackage rec { # segfaults in the testsuite that end up failing the tests in a background thread (in myapp) nativeCheckInputs = [ pytestCheckHook - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ watchdog ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ watchdog ]; disabledTestPaths = [ # Doesn't work with an exported home, RuntimeError: timeout waiting for change to file=/build/tmpgfn145cx diff --git a/pkgs/development/python-modules/hydra-core/default.nix b/pkgs/development/python-modules/hydra-core/default.nix index 5a7b10b2b841..132c8faba6a7 100644 --- a/pkgs/development/python-modules/hydra-core/default.nix +++ b/pkgs/development/python-modules/hydra-core/default.nix @@ -77,18 +77,17 @@ buildPythonPackage rec { ]; # Test environment setup broken under Nix for a few tests: - disabledTests = - [ - "test_bash_completion_with_dot_in_path" - "test_install_uninstall" - "test_config_search_path" - # does not raise UserWarning - "test_initialize_compat_version_base" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # AssertionError: Regex pattern did not match - "test_failure" - ]; + disabledTests = [ + "test_bash_completion_with_dot_in_path" + "test_install_uninstall" + "test_config_search_path" + # does not raise UserWarning + "test_initialize_compat_version_base" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # AssertionError: Regex pattern did not match + "test_failure" + ]; disabledTestPaths = [ "tests/test_hydra.py" ]; diff --git a/pkgs/development/python-modules/hypercorn/default.nix b/pkgs/development/python-modules/hypercorn/default.nix index a91d4704c192..2d468bd64d74 100644 --- a/pkgs/development/python-modules/hypercorn/default.nix +++ b/pkgs/development/python-modules/hypercorn/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pytest-asyncio pytest-trio pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/hypothesis/default.nix b/pkgs/development/python-modules/hypothesis/default.nix index 7f1cfa076720..a46583e063b5 100644 --- a/pkgs/development/python-modules/hypothesis/default.nix +++ b/pkgs/development/python-modules/hypothesis/default.nix @@ -56,13 +56,15 @@ buildPythonPackage rec { dependencies = [ attrs sortedcontainers - ] ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; nativeCheckInputs = [ pexpect pytest-xdist pytestCheckHook - ] ++ lib.optionals isPyPy [ tzdata ]; + ] + ++ lib.optionals isPyPy [ tzdata ]; inherit doCheck; @@ -90,31 +92,30 @@ buildPythonPackage rec { # [3]: https://github.com/NixOS/nixpkgs/issues/393637 setupHook = ./setup-hook.sh; - disabledTests = - [ - # racy, fails to find a file sometimes - "test_recreate_charmap" - "test_uses_cached_charmap" - # fail when using CI profile - "test_given_does_not_pollute_state" - "test_find_does_not_pollute_state" - "test_does_print_on_reuse_from_database" - "test_prints_seed_only_on_healthcheck" - # calls script with the naked interpreter - "test_constants_from_running_file" - ] - ++ lib.optionals (pythonOlder "3.10") [ - # not sure why these tests fail with only 3.9 - # FileNotFoundError: [Errno 2] No such file or directory: 'git' - "test_observability" - "test_assume_has_status_reason" - "test_observability_captures_stateful_reprs" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # AssertionError: assert [b'def \... f(): pass'] == [b'def\\', b' f(): pass'] - # https://github.com/HypothesisWorks/hypothesis/issues/4355 - "test_clean_source" - ]; + disabledTests = [ + # racy, fails to find a file sometimes + "test_recreate_charmap" + "test_uses_cached_charmap" + # fail when using CI profile + "test_given_does_not_pollute_state" + "test_find_does_not_pollute_state" + "test_does_print_on_reuse_from_database" + "test_prints_seed_only_on_healthcheck" + # calls script with the naked interpreter + "test_constants_from_running_file" + ] + ++ lib.optionals (pythonOlder "3.10") [ + # not sure why these tests fail with only 3.9 + # FileNotFoundError: [Errno 2] No such file or directory: 'git' + "test_observability" + "test_assume_has_status_reason" + "test_observability_captures_stateful_reprs" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # AssertionError: assert [b'def \... f(): pass'] == [b'def\\', b' f(): pass'] + # https://github.com/HypothesisWorks/hypothesis/issues/4355 + "test_clean_source" + ]; pythonImportsCheck = [ "hypothesis" ]; diff --git a/pkgs/development/python-modules/i-pi/default.nix b/pkgs/development/python-modules/i-pi/default.nix index e9e54f58a347..ae0ab1134682 100644 --- a/pkgs/development/python-modules/i-pi/default.nix +++ b/pkgs/development/python-modules/i-pi/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { pytestCheckHook mock pytest-mock - ] ++ lib.optional (pythonAtLeast "3.12") distutils; + ] + ++ lib.optional (pythonAtLeast "3.12") distutils; enabledTestPaths = [ "ipi_tests/unit_tests" ]; disabledTests = [ diff --git a/pkgs/development/python-modules/ibis-framework/default.nix b/pkgs/development/python-modules/ibis-framework/default.nix index 340b308d500c..57602d914f0e 100644 --- a/pkgs/development/python-modules/ibis-framework/default.nix +++ b/pkgs/development/python-modules/ibis-framework/default.nix @@ -137,7 +137,8 @@ buildPythonPackage rec { # `pytest.mark.xdist_group` in the ibis codebase pytest-xdist writableTmpDirAsHomeHook - ] ++ lib.concatMap (name: optional-dependencies.${name}) testBackends; + ] + ++ lib.concatMap (name: optional-dependencies.${name}) testBackends; pytestFlagsArray = [ "--benchmark-disable" diff --git a/pkgs/development/python-modules/igraph/default.nix b/pkgs/development/python-modules/igraph/default.nix index 328cbbd1e33b..1ca2dc1cc08c 100644 --- a/pkgs/development/python-modules/igraph/default.nix +++ b/pkgs/development/python-modules/igraph/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ "testAuthorityScore" diff --git a/pkgs/development/python-modules/imageio/default.nix b/pkgs/development/python-modules/imageio/default.nix index b0ec295e10a7..d697cb76f6f6 100644 --- a/pkgs/development/python-modules/imageio/default.nix +++ b/pkgs/development/python-modules/imageio/default.nix @@ -75,14 +75,13 @@ buildPythonPackage rec { heif = [ pillow-heif ]; }; - nativeCheckInputs = - [ - fsspec - psutil - pytestCheckHook - ] - ++ fsspec.optional-dependencies.github - ++ lib.flatten (builtins.attrValues optional-dependencies); + nativeCheckInputs = [ + fsspec + psutil + pytestCheckHook + ] + ++ fsspec.optional-dependencies.github + ++ lib.flatten (builtins.attrValues optional-dependencies); pytestFlagsArray = [ "-m 'not needs_internet'" ]; diff --git a/pkgs/development/python-modules/importlib-metadata/default.nix b/pkgs/development/python-modules/importlib-metadata/default.nix index 2a783ab995e7..2200c0477410 100644 --- a/pkgs/development/python-modules/importlib-metadata/default.nix +++ b/pkgs/development/python-modules/importlib-metadata/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { dependencies = [ toml zipp - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; # Cyclic dependencies due to pyflakefs doCheck = false; diff --git a/pkgs/development/python-modules/inform/default.nix b/pkgs/development/python-modules/inform/default.nix index 4c00022796cf..466efab6c4ea 100644 --- a/pkgs/development/python-modules/inform/default.nix +++ b/pkgs/development/python-modules/inform/default.nix @@ -39,12 +39,13 @@ buildPythonPackage rec { hypothesis ]; - disabledTests = - [ "test_prostrate" ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # doctest runs one more test than expected - "test_inform" - ]; + disabledTests = [ + "test_prostrate" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # doctest runs one more test than expected + "test_inform" + ]; meta = with lib; { description = "Print and logging utilities"; diff --git a/pkgs/development/python-modules/inkex/default.nix b/pkgs/development/python-modules/inkex/default.nix index 1b3b5f236f96..3195032e03e9 100644 --- a/pkgs/development/python-modules/inkex/default.nix +++ b/pkgs/development/python-modules/inkex/default.nix @@ -52,16 +52,15 @@ buildPythonPackage { gtk3 ]; - disabledTests = - [ - "test_extract_multiple" - "test_lookup_and" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ - "test_image_extract" - "test_path_number_nodes" - "test_plotter" # Hangs - ]; + disabledTests = [ + "test_extract_multiple" + "test_lookup_and" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ + "test_image_extract" + "test_path_number_nodes" + "test_plotter" # Hangs + ]; disabledTestPaths = [ # Fatal Python error: Segmentation fault diff --git a/pkgs/development/python-modules/inline-snapshot/default.nix b/pkgs/development/python-modules/inline-snapshot/default.nix index 70919efda6b9..635bdf36c530 100644 --- a/pkgs/development/python-modules/inline-snapshot/default.nix +++ b/pkgs/development/python-modules/inline-snapshot/default.nix @@ -36,16 +36,15 @@ buildPythonPackage rec { build-system = [ hatchling ]; - dependencies = - [ - asttokens - executing - rich - toml - ] - ++ lib.optionals (pythonOlder "3.11") [ - toml - ]; + dependencies = [ + asttokens + executing + rich + toml + ] + ++ lib.optionals (pythonOlder "3.11") [ + toml + ]; nativeCheckInputs = [ freezegun @@ -58,7 +57,8 @@ buildPythonPackage rec { pytest-xdist pytestCheckHook time-machine - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); optional-dependencies = { black = [ black ]; diff --git a/pkgs/development/python-modules/intake/default.nix b/pkgs/development/python-modules/intake/default.nix index 577322a8bc77..fc46c24eb25b 100644 --- a/pkgs/development/python-modules/intake/default.nix +++ b/pkgs/development/python-modules/intake/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { nativeCheckInputs = [ intake-parquet pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); optional-dependencies = { server = [ @@ -103,35 +104,34 @@ buildPythonPackage rec { "intake/tests/test_top_level.py" ]; - disabledTests = - [ - # Disable tests which touch network - "http" - "test_address_flag" - "test_dir" - "test_discover" - "test_filtered_compressed_cache" - "test_flatten_flag" - "test_get_dir" - "test_pagination" - "test_port_flag" - "test_read_part_compressed" - "test_read_partition" - "test_read_pattern" - "test_remote_arr" - "test_remote_cat" - "test_remote_env" - # ValueError - "test_datasource_python_to_dask" - "test_catalog_passthrough" - # Timing-based, flaky on darwin and possibly others - "test_idle_timer" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # Require deprecated distutils - "test_which" - "test_load" - ]; + disabledTests = [ + # Disable tests which touch network + "http" + "test_address_flag" + "test_dir" + "test_discover" + "test_filtered_compressed_cache" + "test_flatten_flag" + "test_get_dir" + "test_pagination" + "test_port_flag" + "test_read_part_compressed" + "test_read_partition" + "test_read_pattern" + "test_remote_arr" + "test_remote_cat" + "test_remote_env" + # ValueError + "test_datasource_python_to_dask" + "test_catalog_passthrough" + # Timing-based, flaky on darwin and possibly others + "test_idle_timer" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # Require deprecated distutils + "test_which" + "test_load" + ]; pythonImportsCheck = [ "intake" ]; diff --git a/pkgs/development/python-modules/internetarchive/default.nix b/pkgs/development/python-modules/internetarchive/default.nix index 205c583381b7..7eb9b38878db 100644 --- a/pkgs/development/python-modules/internetarchive/default.nix +++ b/pkgs/development/python-modules/internetarchive/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { jsonpatch schema urllib3 - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; nativeCheckInputs = [ responses diff --git a/pkgs/development/python-modules/invisible-watermark/default.nix b/pkgs/development/python-modules/invisible-watermark/default.nix index d7ad922cf538..00ca42d94b22 100644 --- a/pkgs/development/python-modules/invisible-watermark/default.nix +++ b/pkgs/development/python-modules/invisible-watermark/default.nix @@ -28,18 +28,17 @@ buildPythonPackage rec { hash = "sha256-6SjVpKFtiiLLU7tZ3hBQr0KT/YEQyywJj0e21/dJRzk="; }; - propagatedBuildInputs = - [ - opencv-python - torch - pillow - pywavelets - numpy - ] - ++ lib.optionals withOnnx [ - onnx - onnxruntime - ]; + propagatedBuildInputs = [ + opencv-python + torch + pillow + pywavelets + numpy + ] + ++ lib.optionals withOnnx [ + onnx + onnxruntime + ]; postPatch = '' substituteInPlace imwatermark/rivaGan.py --replace \ diff --git a/pkgs/development/python-modules/iocsearcher/default.nix b/pkgs/development/python-modules/iocsearcher/default.nix index 9ac6430c5b0e..b6cffd906c58 100644 --- a/pkgs/development/python-modules/iocsearcher/default.nix +++ b/pkgs/development/python-modules/iocsearcher/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { phonenumbers python-magic readabilipy - ] ++ eth-hash.optional-dependencies.pycryptodome; + ] + ++ eth-hash.optional-dependencies.pycryptodome; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/ipdb/default.nix b/pkgs/development/python-modules/ipdb/default.nix index 9d140f2bebfa..66f08d1fd04f 100644 --- a/pkgs/development/python-modules/ipdb/default.nix +++ b/pkgs/development/python-modules/ipdb/default.nix @@ -28,15 +28,14 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools ]; - propagatedBuildInputs = - [ - ipython - decorator - ] - ++ lib.optionals (pythonOlder "3.11") [ - exceptiongroup - tomli - ]; + propagatedBuildInputs = [ + ipython + decorator + ] + ++ lib.optionals (pythonOlder "3.11") [ + exceptiongroup + tomli + ]; nativeCheckInputs = [ pytestCheckHook ]; @@ -44,15 +43,14 @@ buildPythonPackage rec { export HOME=$(mktemp -d) ''; - disabledTestPaths = - [ - # OSError: pytest: reading from stdin while output is captured! Consider using `-s`. - "manual_test.py" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # tests get stuck - "tests/test_opts.py" - ]; + disabledTestPaths = [ + # OSError: pytest: reading from stdin while output is captured! Consider using `-s`. + "manual_test.py" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # tests get stuck + "tests/test_opts.py" + ]; meta = with lib; { homepage = "https://github.com/gotcha/ipdb"; diff --git a/pkgs/development/python-modules/ipykernel/default.nix b/pkgs/development/python-modules/ipykernel/default.nix index f860af1dc776..2ccb4cd94ee3 100644 --- a/pkgs/development/python-modules/ipykernel/default.nix +++ b/pkgs/development/python-modules/ipykernel/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { pyzmq tornado traitlets - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ appnope ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ appnope ]; # check in passthru.tests.pytest to escape infinite recursion with ipyparallel doCheck = false; diff --git a/pkgs/development/python-modules/ipykernel/tests.nix b/pkgs/development/python-modules/ipykernel/tests.nix index 57d8b0a5f492..2d8726f1418b 100644 --- a/pkgs/development/python-modules/ipykernel/tests.nix +++ b/pkgs/development/python-modules/ipykernel/tests.nix @@ -34,41 +34,40 @@ buildPythonPackage { export HOME=$(mktemp -d) ''; - disabledTests = + disabledTests = [ + # The following three tests fail for unclear reasons. + # pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8 + "test_asyncio_interrupt" + + # DeprecationWarning: Passing unrecognized arguments to super(IPythonKernel) + "test_embed_kernel_func" + + # traitlets.config.configurable.MultipleInstanceError: An incompatible siblin... + "test_install_kernelspec" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin ( [ - # The following three tests fail for unclear reasons. - # pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8 - "test_asyncio_interrupt" + # see https://github.com/NixOS/nixpkgs/issues/76197 + "test_subprocess_print" + "test_subprocess_error" + "test_ipython_start_kernel_no_userns" - # DeprecationWarning: Passing unrecognized arguments to super(IPythonKernel) - "test_embed_kernel_func" - - # traitlets.config.configurable.MultipleInstanceError: An incompatible siblin... - "test_install_kernelspec" + # https://github.com/ipython/ipykernel/issues/506 + "test_unc_paths" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin ( - [ - # see https://github.com/NixOS/nixpkgs/issues/76197 - "test_subprocess_print" - "test_subprocess_error" - "test_ipython_start_kernel_no_userns" + ++ lib.optionals (pythonOlder "3.8") [ + # flaky test https://github.com/ipython/ipykernel/issues/485 + "test_shutdown" - # https://github.com/ipython/ipykernel/issues/506 - "test_unc_paths" - ] - ++ lib.optionals (pythonOlder "3.8") [ - # flaky test https://github.com/ipython/ipykernel/issues/485 - "test_shutdown" - - # test regression https://github.com/ipython/ipykernel/issues/486 - "test_sys_path_profile_dir" - "test_save_history" - "test_help_output" - "test_write_kernel_spec" - "test_ipython_start_kernel_userns" - "ZMQDisplayPublisherTests" - ] - ); + # test regression https://github.com/ipython/ipykernel/issues/486 + "test_sys_path_profile_dir" + "test_save_history" + "test_help_output" + "test_write_kernel_spec" + "test_ipython_start_kernel_userns" + "ZMQDisplayPublisherTests" + ] + ); # Some of the tests use localhost networking. __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/ipyparallel/default.nix b/pkgs/development/python-modules/ipyparallel/default.nix index f8fca7e4ac93..e182a70b1118 100644 --- a/pkgs/development/python-modules/ipyparallel/default.nix +++ b/pkgs/development/python-modules/ipyparallel/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { tornado tqdm traitlets - ] ++ lib.optional (pythonOlder "3.10") importlib-metadata; + ] + ++ lib.optional (pythonOlder "3.10") importlib-metadata; # Requires access to cluster doCheck = false; diff --git a/pkgs/development/python-modules/ipython/default.nix b/pkgs/development/python-modules/ipython/default.nix index 40196daa8aab..66680b336217 100644 --- a/pkgs/development/python-modules/ipython/default.nix +++ b/pkgs/development/python-modules/ipython/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pygments stack-data traitlets - ] ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; optional-dependencies = { matplotlib = [ matplotlib ]; @@ -79,20 +80,19 @@ buildPythonPackage rec { testpath ]; - disabledTests = - [ - # UnboundLocalError: local variable 'child' referenced before assignment - "test_system_interrupt" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # AttributeError: 'Pdb' object has no attribute 'curframe'. Did you mean: 'botframe'? - "test_run_debug_twice" - "test_run_debug_twice_with_breakpoint" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # FileNotFoundError: [Errno 2] No such file or directory: 'pbpaste' - "test_clipboard_get" - ]; + disabledTests = [ + # UnboundLocalError: local variable 'child' referenced before assignment + "test_system_interrupt" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # AttributeError: 'Pdb' object has no attribute 'curframe'. Did you mean: 'botframe'? + "test_run_debug_twice" + "test_run_debug_twice_with_breakpoint" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # FileNotFoundError: [Errno 2] No such file or directory: 'pbpaste' + "test_clipboard_get" + ]; passthru.tests = { inherit sage; diff --git a/pkgs/development/python-modules/irc/default.nix b/pkgs/development/python-modules/irc/default.nix index d81577d40bbf..5e6fb96ecb5e 100644 --- a/pkgs/development/python-modules/irc/default.nix +++ b/pkgs/development/python-modules/irc/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { jaraco-stream jaraco-text pytz - ] ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/jaraco-net/default.nix b/pkgs/development/python-modules/jaraco-net/default.nix index 2e2983c8f6e6..fb194cae82b6 100644 --- a/pkgs/development/python-modules/jaraco-net/default.nix +++ b/pkgs/development/python-modules/jaraco-net/default.nix @@ -66,7 +66,8 @@ buildPythonPackage rec { python-dateutil pathvalidate jsonpickle - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ ifconfig-parser ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ ifconfig-parser ]; pythonImportsCheck = [ "jaraco.net" ]; @@ -76,7 +77,8 @@ buildPythonPackage rec { importlib-resources pyparsing pytest-responses - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ net-tools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ net-tools ]; disabledTestPaths = [ # require networking diff --git a/pkgs/development/python-modules/jaraco-text/default.nix b/pkgs/development/python-modules/jaraco-text/default.nix index f82c57175bf8..f58b76d1f35c 100644 --- a/pkgs/development/python-modules/jaraco-text/default.nix +++ b/pkgs/development/python-modules/jaraco-text/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { jaraco-context jaraco-functools inflect - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; nativeCheckInputs = [ pytestCheckHook ] ++ lib.optionals (pythonOlder "3.10") [ pathlib2 ]; diff --git a/pkgs/development/python-modules/jax/default.nix b/pkgs/development/python-modules/jax/default.nix index c48a8b175464..cd7f1e38f53f 100644 --- a/pkgs/development/python-modules/jax/default.nix +++ b/pkgs/development/python-modules/jax/default.nix @@ -63,7 +63,8 @@ buildPythonPackage rec { numpy opt-einsum scipy - ] ++ lib.optionals cudaSupport optional-dependencies.cuda; + ] + ++ lib.optionals cudaSupport optional-dependencies.cuda; optional-dependencies = rec { cuda = [ jax-cuda12-plugin ]; @@ -87,19 +88,18 @@ buildPythonPackage rec { # which creates a circular dependency. See https://discourse.nixos.org/t/how-to-nix-ify-python-packages-with-circular-dependencies/14648/2. # Not a big deal, this is how the JAX docs suggest running the test suite # anyhow. - pytestFlagsArray = - [ - "--numprocesses=4" - "-W ignore::DeprecationWarning" - "tests/" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # SystemError: nanobind::detail::nb_func_error_except(): exception could not be translated! - # reported at: https://github.com/jax-ml/jax/issues/26106 - "--deselect tests/pjit_test.py::PJitErrorTest::testAxisResourcesMismatch" - "--deselect tests/shape_poly_test.py::ShapePolyTest" - "--deselect tests/tree_util_test.py::TreeTest" - ]; + pytestFlagsArray = [ + "--numprocesses=4" + "-W ignore::DeprecationWarning" + "tests/" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # SystemError: nanobind::detail::nb_func_error_except(): exception could not be translated! + # reported at: https://github.com/jax-ml/jax/issues/26106 + "--deselect tests/pjit_test.py::PJitErrorTest::testAxisResourcesMismatch" + "--deselect tests/shape_poly_test.py::ShapePolyTest" + "--deselect tests/tree_util_test.py::TreeTest" + ]; # Prevents `tests/export_back_compat_test.py::CompatTest::test_*` tests from failing on darwin with # PermissionError: [Errno 13] Permission denied: '/tmp/back_compat_testdata/test_*.py' @@ -109,37 +109,36 @@ buildPythonPackage rec { export TEST_UNDECLARED_OUTPUTS_DIR=$(mktemp -d) ''; - disabledTests = - [ - # Exceeds tolerance when the machine is busy - "test_custom_linear_solve_aux" - ] - ++ lib.optionals usingMKL [ - # See - # * https://github.com/google/jax/issues/9705 - # * https://discourse.nixos.org/t/getting-different-results-for-the-same-build-on-two-equally-configured-machines/17921 - # * https://github.com/NixOS/nixpkgs/issues/161960 - "test_custom_linear_solve_cholesky" - "test_custom_root_with_aux" - "testEigvalsGrad_shape" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # Fails on some hardware due to some numerical error - # See https://github.com/google/jax/issues/18535 - "testQdwhWithOnRankDeficientInput5" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # SystemError: nanobind::detail::nb_func_error_except(): exception could not be translated! - # reported at: https://github.com/jax-ml/jax/issues/26106 - "testInAxesPyTreePrefixMismatchError" - "testInAxesPyTreePrefixMismatchErrorKwargs" - "testOutAxesPyTreePrefixMismatchError" - "test_tree_map" - "test_tree_prefix_error" - "test_vjp_rule_inconsistent_pytree_structures_error" - "test_vmap_in_axes_tree_prefix_error" - "test_vmap_mismatched_axis_sizes_error_message_issue_705" - ]; + disabledTests = [ + # Exceeds tolerance when the machine is busy + "test_custom_linear_solve_aux" + ] + ++ lib.optionals usingMKL [ + # See + # * https://github.com/google/jax/issues/9705 + # * https://discourse.nixos.org/t/getting-different-results-for-the-same-build-on-two-equally-configured-machines/17921 + # * https://github.com/NixOS/nixpkgs/issues/161960 + "test_custom_linear_solve_cholesky" + "test_custom_root_with_aux" + "testEigvalsGrad_shape" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # Fails on some hardware due to some numerical error + # See https://github.com/google/jax/issues/18535 + "testQdwhWithOnRankDeficientInput5" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # SystemError: nanobind::detail::nb_func_error_except(): exception could not be translated! + # reported at: https://github.com/jax-ml/jax/issues/26106 + "testInAxesPyTreePrefixMismatchError" + "testInAxesPyTreePrefixMismatchErrorKwargs" + "testOutAxesPyTreePrefixMismatchError" + "test_tree_map" + "test_tree_prefix_error" + "test_vjp_rule_inconsistent_pytree_structures_error" + "test_vmap_in_axes_tree_prefix_error" + "test_vmap_mismatched_axis_sizes_error_message_issue_705" + ]; pythonImportsCheck = [ "jax" ]; diff --git a/pkgs/development/python-modules/jax/test-cuda.nix b/pkgs/development/python-modules/jax/test-cuda.nix index fefde55687d3..cd56cd518d95 100644 --- a/pkgs/development/python-modules/jax/test-cuda.nix +++ b/pkgs/development/python-modules/jax/test-cuda.nix @@ -7,7 +7,8 @@ pkgs.writers.writePython3Bin "jax-test-cuda" { libraries = [ jax - ] ++ jax.optional-dependencies.cuda; + ] + ++ jax.optional-dependencies.cuda; } '' import jax diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 6f869268aa52..bb675972525a 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -239,7 +239,8 @@ let wheel build which - ] ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ cctools ]; + ] + ++ lib.optionals effectiveStdenv.hostPlatform.isDarwin [ cctools ]; buildInputs = [ curl @@ -256,7 +257,8 @@ let six snappy-cpp zlib - ] ++ lib.optionals (!effectiveStdenv.hostPlatform.isDarwin) [ nsync ]; + ] + ++ lib.optionals (!effectiveStdenv.hostPlatform.isDarwin) [ nsync ]; # We don't want to be quite so picky regarding bazel version postPatch = '' @@ -339,22 +341,21 @@ let # Make sure Bazel knows about our configuration flags during fetching so that the # relevant dependencies can be downloaded. - bazelFlags = - [ - "-c opt" - # See https://bazel.build/external/advanced#overriding-repositories for - # information on --override_repository flag. - "--override_repository=xla=${xla}" - ] - ++ lib.optionals effectiveStdenv.cc.isClang [ - # bazel depends on the compiler frontend automatically selecting these flags based on file - # extension but our clang doesn't. - # https://github.com/NixOS/nixpkgs/issues/150655 - "--cxxopt=-x" - "--cxxopt=c++" - "--host_cxxopt=-x" - "--host_cxxopt=c++" - ]; + bazelFlags = [ + "-c opt" + # See https://bazel.build/external/advanced#overriding-repositories for + # information on --override_repository flag. + "--override_repository=xla=${xla}" + ] + ++ lib.optionals effectiveStdenv.cc.isClang [ + # bazel depends on the compiler frontend automatically selecting these flags based on file + # extension but our clang doesn't. + # https://github.com/NixOS/nixpkgs/issues/150655 + "--cxxopt=-x" + "--cxxopt=c++" + "--host_cxxopt=-x" + "--host_cxxopt=c++" + ]; # We intentionally overfetch so we can share the fetch derivation across all the different configurations fetchAttrs = { diff --git a/pkgs/development/python-modules/jedi/default.nix b/pkgs/development/python-modules/jedi/default.nix index 8e31fe41c780..0c51b535ea88 100644 --- a/pkgs/development/python-modules/jedi/default.nix +++ b/pkgs/development/python-modules/jedi/default.nix @@ -44,19 +44,18 @@ buildPythonPackage rec { export HOME=$TMPDIR ''; - disabledTests = - [ - # sensitive to platform, causes false negatives on darwin - "test_import" - ] - ++ lib.optionals (stdenv.targetPlatform.useLLVM or false) [ - # InvalidPythonEnvironment: The python binary is potentially unsafe. - "test_create_environment_executable" - # AssertionError: assert ['', '.1000000000000001'] == ['', '.1'] - "test_dict_keys_completions" - # AssertionError: assert ['', '.1000000000000001'] == ['', '.1'] - "test_dict_completion" - ]; + disabledTests = [ + # sensitive to platform, causes false negatives on darwin + "test_import" + ] + ++ lib.optionals (stdenv.targetPlatform.useLLVM or false) [ + # InvalidPythonEnvironment: The python binary is potentially unsafe. + "test_create_environment_executable" + # AssertionError: assert ['', '.1000000000000001'] == ['', '.1'] + "test_dict_keys_completions" + # AssertionError: assert ['', '.1000000000000001'] == ['', '.1'] + "test_dict_completion" + ]; meta = with lib; { description = "Autocompletion tool for Python that can be used for text editors"; diff --git a/pkgs/development/python-modules/jeepney/default.nix b/pkgs/development/python-modules/jeepney/default.nix index 2c03136b3372..28ebd4e5c8cc 100644 --- a/pkgs/development/python-modules/jeepney/default.nix +++ b/pkgs/development/python-modules/jeepney/default.nix @@ -28,18 +28,17 @@ buildPythonPackage rec { build-system = [ flit-core ]; - nativeCheckInputs = - [ - dbus - pytest - pytest-trio - pytest-asyncio - testpath - trio - ] - ++ lib.optionals (pythonOlder "3.11") [ - async-timeout - ]; + nativeCheckInputs = [ + dbus + pytest + pytest-trio + pytest-asyncio + testpath + trio + ] + ++ lib.optionals (pythonOlder "3.11") [ + async-timeout + ]; checkPhase = '' runHook preCheck diff --git a/pkgs/development/python-modules/joblib/default.nix b/pkgs/development/python-modules/joblib/default.nix index f8fb980cef64..ac35a717420d 100644 --- a/pkgs/development/python-modules/joblib/default.nix +++ b/pkgs/development/python-modules/joblib/default.nix @@ -45,21 +45,20 @@ buildPythonPackage rec { enabledTestPaths = [ "joblib/test" ]; - disabledTests = - [ - "test_disk_used" # test_disk_used is broken: https://github.com/joblib/joblib/issues/57 - "test_parallel_call_cached_function_defined_in_jupyter" # jupyter not available during tests - "test_nested_parallel_warnings" # tests is flaky under load - "test_memory" # tests - and the module itself - assume strictatime mount for build directory - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_dispatch_multiprocessing" # test_dispatch_multiprocessing is broken only on Darwin. - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # deprecation warnings with python3.12 https://github.com/joblib/joblib/issues/1478 - "test_main_thread_renamed_no_warning" - "test_background_thread_parallelism" - ]; + disabledTests = [ + "test_disk_used" # test_disk_used is broken: https://github.com/joblib/joblib/issues/57 + "test_parallel_call_cached_function_defined_in_jupyter" # jupyter not available during tests + "test_nested_parallel_warnings" # tests is flaky under load + "test_memory" # tests - and the module itself - assume strictatime mount for build directory + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_dispatch_multiprocessing" # test_dispatch_multiprocessing is broken only on Darwin. + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # deprecation warnings with python3.12 https://github.com/joblib/joblib/issues/1478 + "test_main_thread_renamed_no_warning" + "test_background_thread_parallelism" + ]; meta = with lib; { changelog = "https://github.com/joblib/joblib/releases/tag/${version}"; diff --git a/pkgs/development/python-modules/johnnycanencrypt/default.nix b/pkgs/development/python-modules/johnnycanencrypt/default.nix index 21f5b58143ea..2d2533c566de 100644 --- a/pkgs/development/python-modules/johnnycanencrypt/default.nix +++ b/pkgs/development/python-modules/johnnycanencrypt/default.nix @@ -39,20 +39,22 @@ buildPythonPackage rec { maturinBuildHook ]; - nativeBuildInputs = - [ pkg-config ] - ++ (with rustPlatform; [ - bindgenHook - cargoSetupHook - maturinBuildHook - ]); + nativeBuildInputs = [ + pkg-config + ] + ++ (with rustPlatform; [ + bindgenHook + cargoSetupHook + maturinBuildHook + ]); - buildInputs = - [ nettle ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ pcsclite ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + nettle + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pcsclite ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; dependencies = [ httpx ]; diff --git a/pkgs/development/python-modules/jsonschema-specifications/default.nix b/pkgs/development/python-modules/jsonschema-specifications/default.nix index 3922e63dd8dc..76d21eaacfe2 100644 --- a/pkgs/development/python-modules/jsonschema-specifications/default.nix +++ b/pkgs/development/python-modules/jsonschema-specifications/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ referencing - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/jsonschema/default.nix b/pkgs/development/python-modules/jsonschema/default.nix index 80cda616d935..0407a46ba198 100644 --- a/pkgs/development/python-modules/jsonschema/default.nix +++ b/pkgs/development/python-modules/jsonschema/default.nix @@ -49,17 +49,16 @@ buildPythonPackage rec { hatchling ]; - dependencies = - [ - attrs - jsonschema-specifications - referencing - rpds-py - ] - ++ lib.optionals (pythonOlder "3.9") [ - importlib-resources - pkgutil-resolve-name - ]; + dependencies = [ + attrs + jsonschema-specifications + referencing + rpds-py + ] + ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources + pkgutil-resolve-name + ]; optional-dependencies = { format = [ diff --git a/pkgs/development/python-modules/jupysql/default.nix b/pkgs/development/python-modules/jupysql/default.nix index 09e10afcea2e..e7b742bde38c 100644 --- a/pkgs/development/python-modules/jupysql/default.nix +++ b/pkgs/development/python-modules/jupysql/default.nix @@ -82,34 +82,34 @@ buildPythonPackage rec { pytestCheckHook psutil writableTmpDirAsHomeHook - ] ++ optional-dependencies.dev; + ] + ++ optional-dependencies.dev; - disabledTests = - [ - # AttributeError: 'DataFrame' object has no attribute 'frame_equal' - "test_resultset_polars_dataframe" + disabledTests = [ + # AttributeError: 'DataFrame' object has no attribute 'frame_equal' + "test_resultset_polars_dataframe" - # all of these are broken with later versions of duckdb; see - # https://github.com/ploomber/jupysql/issues/1030 - "test_resultset_getitem" - "test_resultset_dict" - "test_resultset_len" - "test_resultset_dicts" - "test_resultset_dataframe" - "test_resultset_csv" - "test_resultset_str" - "test_resultset_repr_html_when_feedback_is_2" - "test_resultset_repr_html_with_reduced_feedback" - "test_invalid_operation_error" - "test_resultset_config_autolimit_dict" + # all of these are broken with later versions of duckdb; see + # https://github.com/ploomber/jupysql/issues/1030 + "test_resultset_getitem" + "test_resultset_dict" + "test_resultset_len" + "test_resultset_dicts" + "test_resultset_dataframe" + "test_resultset_csv" + "test_resultset_str" + "test_resultset_repr_html_when_feedback_is_2" + "test_resultset_repr_html_with_reduced_feedback" + "test_invalid_operation_error" + "test_resultset_config_autolimit_dict" - # fails due to strict warnings - "test_calling_legacy_plotting_functions_displays_warning" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1] - "test_no_errors_with_stored_query" - ]; + # fails due to strict warnings + "test_calling_legacy_plotting_functions_displays_warning" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1] + "test_no_errors_with_stored_query" + ]; disabledTestPaths = [ # require docker diff --git a/pkgs/development/python-modules/jupyter-client/default.nix b/pkgs/development/python-modules/jupyter-client/default.nix index 2aec8e08ed1a..83d941cbdba6 100644 --- a/pkgs/development/python-modules/jupyter-client/default.nix +++ b/pkgs/development/python-modules/jupyter-client/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { pyzmq tornado traitlets - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; pythonImportsCheck = [ "jupyter_client" ]; diff --git a/pkgs/development/python-modules/jupyter-events/default.nix b/pkgs/development/python-modules/jupyter-events/default.nix index 35cf04742b57..895ceafa250e 100644 --- a/pkgs/development/python-modules/jupyter-events/default.nix +++ b/pkgs/development/python-modules/jupyter-events/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { rfc3339-validator rfc3986-validator traitlets - ] ++ jsonschema.optional-dependencies.format-nongpl; + ] + ++ jsonschema.optional-dependencies.format-nongpl; optional-dependencies = { cli = [ @@ -62,7 +63,8 @@ buildPythonPackage rec { pytest-asyncio pytest-console-scripts pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export PATH="$out/bin:$PATH" diff --git a/pkgs/development/python-modules/jupyter-server-terminals/default.nix b/pkgs/development/python-modules/jupyter-server-terminals/default.nix index 30c3e0e2bea5..b7921afffb7d 100644 --- a/pkgs/development/python-modules/jupyter-server-terminals/default.nix +++ b/pkgs/development/python-modules/jupyter-server-terminals/default.nix @@ -38,7 +38,8 @@ let pytest-jupyter pytest-timeout pytestCheckHook - ] ++ pytest-jupyter.optional-dependencies.server; + ] + ++ pytest-jupyter.optional-dependencies.server; passthru.tests = { check = self.overridePythonAttrs (_: { diff --git a/pkgs/development/python-modules/jupyter-server/default.nix b/pkgs/development/python-modules/jupyter-server/default.nix index 67554ad45f3c..292c3fa2744e 100644 --- a/pkgs/development/python-modules/jupyter-server/default.nix +++ b/pkgs/development/python-modules/jupyter-server/default.nix @@ -99,28 +99,27 @@ buildPythonPackage rec { export PATH=$out/bin:$PATH ''; - disabledTests = - [ - "test_cull_idle" - "test_server_extension_list" - "test_subscribe_websocket" - # test is presumable broken in sandbox - "test_authorized_requests" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # attempts to use trashcan, build env doesn't allow this - "test_delete" - # Insufficient access privileges for operation - "test_regression_is_hidden" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Failed: DID NOT RAISE - "test_copy_big_dir" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # TypeError: the JSON object must be str, bytes or bytearray, not NoneType - "test_terminal_create_with_cwd" - ]; + disabledTests = [ + "test_cull_idle" + "test_server_extension_list" + "test_subscribe_websocket" + # test is presumable broken in sandbox + "test_authorized_requests" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # attempts to use trashcan, build env doesn't allow this + "test_delete" + # Insufficient access privileges for operation + "test_regression_is_hidden" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # Failed: DID NOT RAISE + "test_copy_big_dir" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # TypeError: the JSON object must be str, bytes or bytearray, not NoneType + "test_terminal_create_with_cwd" + ]; disabledTestPaths = [ "tests/services/kernels/test_api.py" diff --git a/pkgs/development/python-modules/jupyterhub/default.nix b/pkgs/development/python-modules/jupyterhub/default.nix index 2b2e302ae490..7f4ab6baaa41 100644 --- a/pkgs/development/python-modules/jupyterhub/default.nix +++ b/pkgs/development/python-modules/jupyterhub/default.nix @@ -88,28 +88,27 @@ buildPythonPackage rec { setuptools-scm ]; - dependencies = - [ - alembic - certipy - idna - jinja2 - jupyter-events - oauthlib - packaging - pamela - prometheus-client - pydantic - python-dateutil - requests - sqlalchemy - tornado - traitlets - ] - ++ lib.optionals (pythonOlder "3.10") [ - async-generator - importlib-metadata - ]; + dependencies = [ + alembic + certipy + idna + jinja2 + jupyter-events + oauthlib + packaging + pamela + prometheus-client + pydantic + python-dateutil + requests + sqlalchemy + tornado + traitlets + ] + ++ lib.optionals (pythonOlder "3.10") [ + async-generator + importlib-metadata + ]; pythonImportsCheck = [ "jupyterhub" ]; diff --git a/pkgs/development/python-modules/jupyterlab-server/default.nix b/pkgs/development/python-modules/jupyterlab-server/default.nix index 0bd3fb162a24..f21a7add8327 100644 --- a/pkgs/development/python-modules/jupyterlab-server/default.nix +++ b/pkgs/development/python-modules/jupyterlab-server/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { jupyter-server packaging requests - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; optional-dependencies = { openapi = [ @@ -61,7 +62,8 @@ buildPythonPackage rec { pytestCheckHook requests-mock strict-rfc3339 - ] ++ optional-dependencies.openapi; + ] + ++ optional-dependencies.openapi; preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/development/python-modules/jupyterlab/default.nix b/pkgs/development/python-modules/jupyterlab/default.nix index d643e1b58d04..1be0da1b95ea 100644 --- a/pkgs/development/python-modules/jupyterlab/default.nix +++ b/pkgs/development/python-modules/jupyterlab/default.nix @@ -60,24 +60,23 @@ buildPythonPackage rec { hatchling ]; - dependencies = - [ - async-lru - httpx - ipykernel - jinja2 - jupyter-core - jupyter-lsp - jupyter-server - jupyterlab-server - notebook-shim - packaging - setuptools - tornado - traitlets - ] - ++ lib.optionals (pythonOlder "3.11") [ tomli ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + dependencies = [ + async-lru + httpx + ipykernel + jinja2 + jupyter-core + jupyter-lsp + jupyter-server + jupyterlab-server + notebook-shim + packaging + setuptools + tornado + traitlets + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; makeWrapperArgs = [ "--set" diff --git a/pkgs/development/python-modules/jupytext/default.nix b/pkgs/development/python-modules/jupytext/default.nix index e7abcd5c6105..ccefc9fe2f70 100644 --- a/pkgs/development/python-modules/jupytext/default.nix +++ b/pkgs/development/python-modules/jupytext/default.nix @@ -76,7 +76,8 @@ buildPythonPackage rec { nbformat packaging pyyaml - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ jupyter-client diff --git a/pkgs/development/python-modules/kafka-python-ng/default.nix b/pkgs/development/python-modules/kafka-python-ng/default.nix index aec5ffe216f7..81036644f108 100644 --- a/pkgs/development/python-modules/kafka-python-ng/default.nix +++ b/pkgs/development/python-modules/kafka-python-ng/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { pytest-mock pytestCheckHook xxhash - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); meta = { changelog = "https://github.com/wbarnha/kafka-python-ng/releases/tag/v${version}"; diff --git a/pkgs/development/python-modules/kaleido/default.nix b/pkgs/development/python-modules/kaleido/default.nix index 54e523c12454..a155dd55bf2b 100644 --- a/pkgs/development/python-modules/kaleido/default.nix +++ b/pkgs/development/python-modules/kaleido/default.nix @@ -65,39 +65,38 @@ buildPythonPackage rec { pythonImportsCheck = [ "kaleido" ]; - postInstall = - '' - # Expose kaleido binary - mkdir -p $out/bin - ln -s $out/${python.sitePackages}/kaleido/executable/bin/kaleido $out/bin/kaleido + postInstall = '' + # Expose kaleido binary + mkdir -p $out/bin + ln -s $out/${python.sitePackages}/kaleido/executable/bin/kaleido $out/bin/kaleido - # Relace bundled libraries with nixpkgs-packaged libraries - rm -rf $out/${python.sitePackages}/kaleido/executable/lib - mkdir -p $out/${python.sitePackages}/kaleido/executable/lib - ln -s ${expat}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ - ln -s ${nspr}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ - ln -s ${nss}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ - ln -s ${sqlite}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ + # Relace bundled libraries with nixpkgs-packaged libraries + rm -rf $out/${python.sitePackages}/kaleido/executable/lib + mkdir -p $out/${python.sitePackages}/kaleido/executable/lib + ln -s ${expat}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ + ln -s ${nspr}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ + ln -s ${nss}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ + ln -s ${sqlite}/lib/* $out/${python.sitePackages}/kaleido/executable/lib/ - # Replace bundled font configuration with nixpkgs-packaged font configuration - rm -rf $out/${python.sitePackages}/kaleido/executable/etc/fonts - mkdir -p $out/${python.sitePackages}/kaleido/executable/etc/fonts/conf.d - ln -s ${fontconfig.out}/etc/fonts/fonts.conf $out/${python.sitePackages}/kaleido/executable/etc/fonts/ - ls -s ${fontconfig.out}/etc/fonts/conf.d/* $out/${python.sitePackages}/kaleido/executable/etc/fonts/conf.d/ - ln -s ${sbclPackages.cl-dejavu}/dejavu-fonts-ttf-2.37/fontconfig/* $out/${python.sitePackages}/kaleido/executable/etc/fonts/conf.d/ + # Replace bundled font configuration with nixpkgs-packaged font configuration + rm -rf $out/${python.sitePackages}/kaleido/executable/etc/fonts + mkdir -p $out/${python.sitePackages}/kaleido/executable/etc/fonts/conf.d + ln -s ${fontconfig.out}/etc/fonts/fonts.conf $out/${python.sitePackages}/kaleido/executable/etc/fonts/ + ls -s ${fontconfig.out}/etc/fonts/conf.d/* $out/${python.sitePackages}/kaleido/executable/etc/fonts/conf.d/ + ln -s ${sbclPackages.cl-dejavu}/dejavu-fonts-ttf-2.37/fontconfig/* $out/${python.sitePackages}/kaleido/executable/etc/fonts/conf.d/ - # Replace bundled fonts with nixpkgs-packaged fonts - # Currently this causes an issue where the fonts aren't found. I'm not sure why, so I'm leaving this commented out for now. - #rm -rf $out/${python.sitePackages}/kaleido/executable/xdg/fonts - #mkdir -p $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/dejavu $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/lato - #ln -s ${dejavu_fonts}/share/fonts/truetype/* $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/dejavu/ - #ln -s ${lato}/share/fonts/lato/* $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/lato/ - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - # Replace bundled swiftshader with libGL - rm -rf $out/${python.sitePackages}/kaleido/executable/bin/swiftshader - ln -s ${libGL}/lib $out/${python.sitePackages}/kaleido/executable/bin/swiftshader - ''; + # Replace bundled fonts with nixpkgs-packaged fonts + # Currently this causes an issue where the fonts aren't found. I'm not sure why, so I'm leaving this commented out for now. + #rm -rf $out/${python.sitePackages}/kaleido/executable/xdg/fonts + #mkdir -p $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/dejavu $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/lato + #ln -s ${dejavu_fonts}/share/fonts/truetype/* $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/dejavu/ + #ln -s ${lato}/share/fonts/lato/* $out/${python.sitePackages}/kaleido/executable/xdg/fonts/truetype/lato/ + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + # Replace bundled swiftshader with libGL + rm -rf $out/${python.sitePackages}/kaleido/executable/bin/swiftshader + ln -s ${libGL}/lib $out/${python.sitePackages}/kaleido/executable/bin/swiftshader + ''; passthru.tests = lib.optionalAttrs (!stdenv.hostPlatform.isDarwin) { kaleido = callPackage ./tests.nix { }; diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix index f3201639a45c..568aaa06ce9c 100644 --- a/pkgs/development/python-modules/keras/default.nix +++ b/pkgs/development/python-modules/keras/default.nix @@ -63,7 +63,8 @@ buildPythonPackage rec { rich scikit-learn tensorflow - ] ++ lib.optionals (pythonAtLeast "3.12") [ distutils ]; + ] + ++ lib.optionals (pythonAtLeast "3.12") [ distutils ]; pythonImportsCheck = [ "keras" @@ -81,22 +82,21 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; - disabledTests = - [ - # NameError: name 'MockRemat' is not defined - # https://github.com/keras-team/keras/issues/21126 - "test_functional_model_with_remat" + disabledTests = [ + # NameError: name 'MockRemat' is not defined + # https://github.com/keras-team/keras/issues/21126 + "test_functional_model_with_remat" - # Tries to install the package in the sandbox - "test_keras_imports" + # Tries to install the package in the sandbox + "test_keras_imports" - # TypeError: this __dict__ descriptor does not support '_DictWrapper' objects - "test_reloading_default_saved_model" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Hangs forever - "test_fit_with_data_adapter" - ]; + # TypeError: this __dict__ descriptor does not support '_DictWrapper' objects + "test_reloading_default_saved_model" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Hangs forever + "test_fit_with_data_adapter" + ]; disabledTestPaths = [ # These tests succeed when run individually, but crash within the full test suite: diff --git a/pkgs/development/python-modules/keyring/default.nix b/pkgs/development/python-modules/keyring/default.nix index 422115799e0f..ff52b0cfd36f 100644 --- a/pkgs/development/python-modules/keyring/default.nix +++ b/pkgs/development/python-modules/keyring/default.nix @@ -37,17 +37,16 @@ buildPythonPackage rec { shtab ]; - dependencies = - [ - jaraco-classes - jaraco-context - jaraco-functools - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - jeepney - secretstorage - ] - ++ lib.optionals (pythonOlder "3.12") [ importlib-metadata ]; + dependencies = [ + jaraco-classes + jaraco-context + jaraco-functools + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + jeepney + secretstorage + ] + ++ lib.optionals (pythonOlder "3.12") [ importlib-metadata ]; postInstall = '' installShellCompletion --cmd keyring \ @@ -65,10 +64,11 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTestPaths = - [ "tests/backends/test_macOS.py" ] - # These tests fail when sandboxing is enabled because they are unable to get a password from keychain. - ++ lib.optional stdenv.hostPlatform.isDarwin "tests/test_multiprocess.py"; + disabledTestPaths = [ + "tests/backends/test_macOS.py" + ] + # These tests fail when sandboxing is enabled because they are unable to get a password from keychain. + ++ lib.optional stdenv.hostPlatform.isDarwin "tests/test_multiprocess.py"; meta = with lib; { description = "Store and access your passwords safely"; diff --git a/pkgs/development/python-modules/keystoneauth1/default.nix b/pkgs/development/python-modules/keystoneauth1/default.nix index a8de92e36a02..f726932bc7a9 100644 --- a/pkgs/development/python-modules/keystoneauth1/default.nix +++ b/pkgs/development/python-modules/keystoneauth1/default.nix @@ -37,17 +37,16 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - iso8601 - os-service-types - pbr - requests - stevedore - typing-extensions - ] - # TODO: remove this workaround and fix breakages - ++ lib.flatten (builtins.attrValues optional-dependencies); + dependencies = [ + iso8601 + os-service-types + pbr + requests + stevedore + typing-extensions + ] + # TODO: remove this workaround and fix breakages + ++ lib.flatten (builtins.attrValues optional-dependencies); optional-dependencies = { betamax = [ @@ -69,7 +68,8 @@ buildPythonPackage rec { stestr testresources testtools - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # test_keystoneauth_betamax_fixture is incompatible with urllib3 2.0.0 # https://bugs.launchpad.net/keystoneauth/+bug/2020112 diff --git a/pkgs/development/python-modules/kivy/default.nix b/pkgs/development/python-modules/kivy/default.nix index 6383a0488f6a..a0a9bbcd36be 100644 --- a/pkgs/development/python-modules/kivy/default.nix +++ b/pkgs/development/python-modules/kivy/default.nix @@ -34,18 +34,17 @@ buildPythonPackage rec { hash = "sha256-q8BoF/pUTW2GMKBhNsqWDBto5+nASanWifS9AcNRc8Q="; }; - postPatch = - '' - substituteInPlace pyproject.toml \ - --replace-fail "setuptools~=69.2.0" "setuptools" \ - --replace-fail "wheel~=0.44.0" "wheel" \ - --replace-fail "cython>=0.29.1,<=3.0.11" "cython" \ - --replace-fail "packaging~=24.0" packaging - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace kivy/lib/mtdev.py \ - --replace-fail "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')" - ''; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "setuptools~=69.2.0" "setuptools" \ + --replace-fail "wheel~=0.44.0" "wheel" \ + --replace-fail "cython>=0.29.1,<=3.0.11" "cython" \ + --replace-fail "packaging~=24.0" packaging + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace kivy/lib/mtdev.py \ + --replace-fail "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')" + ''; build-system = [ setuptools @@ -56,28 +55,27 @@ buildPythonPackage rec { pkg-config ]; - buildInputs = + buildInputs = [ + SDL2 + SDL2_image + SDL2_ttf + SDL2_mixer + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGL + libX11 + mtdev + ] + ++ lib.optionals withGstreamer ( + with gst_all_1; [ - SDL2 - SDL2_image - SDL2_ttf - SDL2_mixer + # NOTE: The degree to which gstreamer actually works is unclear + gstreamer + gst-plugins-base + gst-plugins-good + gst-plugins-bad ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGL - libX11 - mtdev - ] - ++ lib.optionals withGstreamer ( - with gst_all_1; - [ - # NOTE: The degree to which gstreamer actually works is unclear - gstreamer - gst-plugins-base - gst-plugins-good - gst-plugins-bad - ] - ); + ); dependencies = [ kivy-garden diff --git a/pkgs/development/python-modules/klaus/default.nix b/pkgs/development/python-modules/klaus/default.nix index 640ea71d1f77..4d0ffdefcde3 100644 --- a/pkgs/development/python-modules/klaus/default.nix +++ b/pkgs/development/python-modules/klaus/default.nix @@ -53,7 +53,8 @@ buildPythonPackage rec { pytest requests python-ctags3 - ] ++ lib.optional (!isPy3k) mock; + ] + ++ lib.optional (!isPy3k) mock; checkPhase = '' ./runtests.sh diff --git a/pkgs/development/python-modules/kokoro/default.nix b/pkgs/development/python-modules/kokoro/default.nix index eb9b658152c7..11081dae7a5d 100644 --- a/pkgs/development/python-modules/kokoro/default.nix +++ b/pkgs/development/python-modules/kokoro/default.nix @@ -36,7 +36,8 @@ buildPythonPackage { numpy torch transformers - ] ++ misaki.optional-dependencies.en; # kokoro depends on misaki[en] + ] + ++ misaki.optional-dependencies.en; # kokoro depends on misaki[en] nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/kombu/default.nix b/pkgs/development/python-modules/kombu/default.nix index 4b690d59e0f8..e40453eeee4c 100644 --- a/pkgs/development/python-modules/kombu/default.nix +++ b/pkgs/development/python-modules/kombu/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { packaging tzdata vine - ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; optional-dependencies = { msgpack = [ msgpack ]; @@ -81,7 +82,8 @@ buildPythonPackage rec { nativeCheckInputs = [ hypothesis pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "kombu" ]; diff --git a/pkgs/development/python-modules/kserve/default.nix b/pkgs/development/python-modules/kserve/default.nix index 4307c502f8b3..df18a9b63d68 100644 --- a/pkgs/development/python-modules/kserve/default.nix +++ b/pkgs/development/python-modules/kserve/default.nix @@ -112,7 +112,8 @@ buildPythonPackage rec { huggingface-hub google-cloud-storage requests - ] ++ huggingface-hub.optional-dependencies.hf_transfer; + ] + ++ huggingface-hub.optional-dependencies.hf_transfer; logging = [ asgi-logger ]; ray = [ ray ]; llm = [ @@ -128,48 +129,47 @@ buildPythonPackage rec { pytest-xdist pytestCheckHook tomlkit - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "kserve" ]; - pytestFlagsArray = - [ - # AssertionError - "--deselect=test/test_server.py::TestTFHttpServerLoadAndUnLoad::test_unload" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: Failed to start GCS - "--deselect=test/test_dataplane.py::TestDataPlane::test_explain" - "--deselect=test/test_dataplane.py::TestDataPlane::test_infer" - "--deselect=test/test_dataplane.py::TestDataPlane::test_model_metadata" - "--deselect=test/test_dataplane.py::TestDataPlane::test_server_readiness" - "--deselect=test/test_server.py::TestRayServer::test_explain" - "--deselect=test/test_server.py::TestRayServer::test_health_handler" - "--deselect=test/test_server.py::TestRayServer::test_infer" - "--deselect=test/test_server.py::TestRayServer::test_list_handler" - "--deselect=test/test_server.py::TestRayServer::test_liveness_handler" - "--deselect=test/test_server.py::TestRayServer::test_predict" - # Permission Error - "--deselect=test/test_server.py::TestMutiProcessServer::test_rest_server_multiprocess" - ]; + pytestFlagsArray = [ + # AssertionError + "--deselect=test/test_server.py::TestTFHttpServerLoadAndUnLoad::test_unload" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: Failed to start GCS + "--deselect=test/test_dataplane.py::TestDataPlane::test_explain" + "--deselect=test/test_dataplane.py::TestDataPlane::test_infer" + "--deselect=test/test_dataplane.py::TestDataPlane::test_model_metadata" + "--deselect=test/test_dataplane.py::TestDataPlane::test_server_readiness" + "--deselect=test/test_server.py::TestRayServer::test_explain" + "--deselect=test/test_server.py::TestRayServer::test_health_handler" + "--deselect=test/test_server.py::TestRayServer::test_infer" + "--deselect=test/test_server.py::TestRayServer::test_list_handler" + "--deselect=test/test_server.py::TestRayServer::test_liveness_handler" + "--deselect=test/test_server.py::TestRayServer::test_predict" + # Permission Error + "--deselect=test/test_server.py::TestMutiProcessServer::test_rest_server_multiprocess" + ]; disabledTestPaths = [ # Looks for a config file at the root of the repository "test/test_inference_service_client.py" ]; - disabledTests = - [ - # Require network access - "test_infer_graph_endpoint" - "test_infer_path_based_routing" + disabledTests = [ + # Require network access + "test_infer_graph_endpoint" + "test_infer_path_based_routing" - # Tries to access `/tmp` (hardcoded) - "test_local_path_with_out_dir_exist" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_local_path_with_out_dir_not_exist" - ]; + # Tries to access `/tmp` (hardcoded) + "test_local_path_with_out_dir_exist" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_local_path_with_out_dir_not_exist" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/kubernetes/default.nix b/pkgs/development/python-modules/kubernetes/default.nix index f033ca20a40a..de99487b2503 100644 --- a/pkgs/development/python-modules/kubernetes/default.nix +++ b/pkgs/development/python-modules/kubernetes/default.nix @@ -60,7 +60,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ # AssertionError: != diff --git a/pkgs/development/python-modules/labelbox/default.nix b/pkgs/development/python-modules/labelbox/default.nix index 6565180a4b0d..50ba167f6f47 100644 --- a/pkgs/development/python-modules/labelbox/default.nix +++ b/pkgs/development/python-modules/labelbox/default.nix @@ -111,7 +111,8 @@ buildPythonPackage rec { pytest-rerunfailures pytest-xdist pytestCheckHook - ] ++ optional-dependencies.data; + ] + ++ optional-dependencies.data; disabledTestPaths = [ # Requires network access diff --git a/pkgs/development/python-modules/lacuscore/default.nix b/pkgs/development/python-modules/lacuscore/default.nix index ec1b40768c8c..573090fad011 100644 --- a/pkgs/development/python-modules/lacuscore/default.nix +++ b/pkgs/development/python-modules/lacuscore/default.nix @@ -37,21 +37,20 @@ buildPythonPackage rec { build-system = [ poetry-core ]; - dependencies = - [ - defang - dnspython - playwrightcapture - pydantic - redis - requests - ua-parser - ] - ++ playwrightcapture.optional-dependencies.recaptcha - ++ redis.optional-dependencies.hiredis - ++ ua-parser.optional-dependencies.regex - ++ lib.optionals (pythonOlder "3.11") [ async-timeout ] - ++ lib.optionals (pythonOlder "3.10") [ eval-type-backport ]; + dependencies = [ + defang + dnspython + playwrightcapture + pydantic + redis + requests + ua-parser + ] + ++ playwrightcapture.optional-dependencies.recaptcha + ++ redis.optional-dependencies.hiredis + ++ ua-parser.optional-dependencies.regex + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ] + ++ lib.optionals (pythonOlder "3.10") [ eval-type-backport ]; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/lancedb/default.nix b/pkgs/development/python-modules/lancedb/default.nix index 1f946f440893..42b86aa1a9e7 100644 --- a/pkgs/development/python-modules/lancedb/default.nix +++ b/pkgs/development/python-modules/lancedb/default.nix @@ -104,15 +104,14 @@ buildPythonPackage rec { "test_polars" ]; - disabledTestPaths = - [ - # touch the network - "test_s3.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # socket.gaierror: [Errno 8] nodename nor servname provided, or not known - "test_remote_db.py" - ]; + disabledTestPaths = [ + # touch the network + "test_s3.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # socket.gaierror: [Errno 8] nodename nor servname provided, or not known + "test_remote_db.py" + ]; passthru.updateScript = nix-update-script { extraArgs = [ diff --git a/pkgs/development/python-modules/langchain-core/default.nix b/pkgs/development/python-modules/langchain-core/default.nix index 0a1269377418..370169580ec4 100644 --- a/pkgs/development/python-modules/langchain-core/default.nix +++ b/pkgs/development/python-modules/langchain-core/default.nix @@ -96,44 +96,43 @@ buildPythonPackage rec { }; }; - disabledTests = - [ - # flaky, sometimes fail to strip uuid from AIMessageChunk before comparing to test value - "test_map_stream" - # Compares with machine-specific timings - "test_rate_limit" - # flaky: assert (1726352133.7419367 - 1726352132.2697523) < 1 - "test_benchmark_model" + disabledTests = [ + # flaky, sometimes fail to strip uuid from AIMessageChunk before comparing to test value + "test_map_stream" + # Compares with machine-specific timings + "test_rate_limit" + # flaky: assert (1726352133.7419367 - 1726352132.2697523) < 1 + "test_benchmark_model" - # TypeError: exceptions must be derived from Warning, not - "test_chat_prompt_template_variable_names" - "test_create_model_v2" + # TypeError: exceptions must be derived from Warning, not + "test_chat_prompt_template_variable_names" + "test_create_model_v2" - # Comparison with magic strings - "test_prompt_with_chat_model" - "test_prompt_with_chat_model_async" - "test_prompt_with_llm" - "test_prompt_with_llm_parser" - "test_prompt_with_llm_and_async_lambda" - "test_prompt_with_chat_model_and_parser" - "test_combining_sequences" + # Comparison with magic strings + "test_prompt_with_chat_model" + "test_prompt_with_chat_model_async" + "test_prompt_with_llm" + "test_prompt_with_llm_parser" + "test_prompt_with_llm_and_async_lambda" + "test_prompt_with_chat_model_and_parser" + "test_combining_sequences" - # AssertionError: assert [+ received] == [- snapshot] - "test_chat_input_schema" - # AssertionError: assert {'$defs': {'D...ype': 'array'} == {'$defs': {'D...ype': 'array'} - "test_schemas" - # AssertionError: assert [+ received] == [- snapshot] - "test_graph_sequence_map" - "test_representation_of_runnables" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Langchain-core the following tests due to the test comparing execution time with magic values. - "test_queue_for_streaming_via_sync_call" - "test_same_event_loop" - # Comparisons with magic numbers - "test_rate_limit_ainvoke" - "test_rate_limit_astream" - ]; + # AssertionError: assert [+ received] == [- snapshot] + "test_chat_input_schema" + # AssertionError: assert {'$defs': {'D...ype': 'array'} == {'$defs': {'D...ype': 'array'} + "test_schemas" + # AssertionError: assert [+ received] == [- snapshot] + "test_graph_sequence_map" + "test_representation_of_runnables" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Langchain-core the following tests due to the test comparing execution time with magic values. + "test_queue_for_streaming_via_sync_call" + "test_same_event_loop" + # Comparisons with magic numbers + "test_rate_limit_ainvoke" + "test_rate_limit_astream" + ]; disabledTestPaths = [ "tests/unit_tests/runnables/test_runnable_events_v2.py" ]; diff --git a/pkgs/development/python-modules/langchain/default.nix b/pkgs/development/python-modules/langchain/default.nix index 164414e35f56..2b81682ede40 100644 --- a/pkgs/development/python-modules/langchain/default.nix +++ b/pkgs/development/python-modules/langchain/default.nix @@ -79,7 +79,8 @@ buildPythonPackage rec { requests sqlalchemy tenacity - ] ++ lib.optional (pythonOlder "3.11") async-timeout; + ] + ++ lib.optional (pythonOlder "3.11") async-timeout; optional-dependencies = { numpy = [ numpy ]; diff --git a/pkgs/development/python-modules/langsmith/default.nix b/pkgs/development/python-modules/langsmith/default.nix index 96bc3f1b861c..4615e850cfdf 100644 --- a/pkgs/development/python-modules/langsmith/default.nix +++ b/pkgs/development/python-modules/langsmith/default.nix @@ -65,7 +65,8 @@ buildPythonPackage rec { pytest-vcr pytestCheckHook uvicorn - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ attr ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ attr ]; disabledTests = [ # These tests require network access diff --git a/pkgs/development/python-modules/lastversion/default.nix b/pkgs/development/python-modules/lastversion/default.nix index 48d3b15ff000..cab270a7c0f2 100644 --- a/pkgs/development/python-modules/lastversion/default.nix +++ b/pkgs/development/python-modules/lastversion/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { requests tqdm urllib3 - ] ++ cachecontrol.optional-dependencies.filecache; + ] + ++ cachecontrol.optional-dependencies.filecache; pythonRelaxDeps = [ "cachecontrol" # Use newer cachecontrol that uses filelock instead of lockfile diff --git a/pkgs/development/python-modules/ldaptor/default.nix b/pkgs/development/python-modules/ldaptor/default.nix index ead49289a35f..c996f7700332 100644 --- a/pkgs/development/python-modules/ldaptor/default.nix +++ b/pkgs/development/python-modules/ldaptor/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { six twisted zope-interface - ] ++ twisted.optional-dependencies.tls; + ] + ++ twisted.optional-dependencies.tls; nativeCheckInputs = [ twisted ]; diff --git a/pkgs/development/python-modules/ledgerblue/default.nix b/pkgs/development/python-modules/ledgerblue/default.nix index 4885fa14524e..a53dfbce8b96 100644 --- a/pkgs/development/python-modules/ledgerblue/default.nix +++ b/pkgs/development/python-modules/ledgerblue/default.nix @@ -53,7 +53,8 @@ buildPythonPackage rec { python-gnupg python-u2flib-host websocket-client - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ bleak ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ bleak ]; # No tests doCheck = false; diff --git a/pkgs/development/python-modules/libpass/default.nix b/pkgs/development/python-modules/libpass/default.nix index 3b3ad366d7c6..cfa17149b350 100644 --- a/pkgs/development/python-modules/libpass/default.nix +++ b/pkgs/development/python-modules/libpass/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { pytest-archon pytest-xdist pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "passlib" ]; diff --git a/pkgs/development/python-modules/librosa/default.nix b/pkgs/development/python-modules/librosa/default.nix index d025a2dcd562..db1e9f5fdae6 100644 --- a/pkgs/development/python-modules/librosa/default.nix +++ b/pkgs/development/python-modules/librosa/default.nix @@ -83,36 +83,36 @@ buildPythonPackage rec { resampy samplerate writableTmpDirAsHomeHook - ] ++ optional-dependencies.matplotlib; + ] + ++ optional-dependencies.matplotlib; - disabledTests = - [ - # requires network access - "test_example" - "test_example_info" - "test_load_resample" - "test_cite_released" - "test_cite_badversion" - "test_cite_unreleased" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # crashing the python interpreter - "test_unknown_time_unit" - "test_unknown_wavaxis" - "test_waveshow_unknown_wavaxis" - "test_waveshow_bad_maxpoints" - "test_waveshow_deladaptor" - "test_waveshow_disconnect" - "test_unknown_axis" - "test_axis_bound_warning" - "test_auto_aspect" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Flaky (numerical comparison fails) - "test_istft_multi" - "test_pitch_shift_multi" - "test_time_stretch_multi" - ]; + disabledTests = [ + # requires network access + "test_example" + "test_example_info" + "test_load_resample" + "test_cite_released" + "test_cite_badversion" + "test_cite_unreleased" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # crashing the python interpreter + "test_unknown_time_unit" + "test_unknown_wavaxis" + "test_waveshow_unknown_wavaxis" + "test_waveshow_bad_maxpoints" + "test_waveshow_deladaptor" + "test_waveshow_disconnect" + "test_unknown_axis" + "test_axis_bound_warning" + "test_auto_aspect" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Flaky (numerical comparison fails) + "test_istft_multi" + "test_pitch_shift_multi" + "test_time_stretch_multi" + ]; meta = { description = "Python library for audio and music analysis"; diff --git a/pkgs/development/python-modules/libtmux/default.nix b/pkgs/development/python-modules/libtmux/default.nix index 1bdf0d907883..588e6af5127d 100644 --- a/pkgs/development/python-modules/libtmux/default.nix +++ b/pkgs/development/python-modules/libtmux/default.nix @@ -40,22 +40,21 @@ buildPythonPackage rec { enabledTestPaths = [ "tests" ]; - disabledTests = - [ - # Fail with: 'no server running on /tmp/tmux-1000/libtmux_test8sorutj1'. - "test_new_session_width_height" - # Assertion error - "test_capture_pane_start" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # tests/test_pane.py:113: AssertionError - "test_capture_pane_start" - # assert (1740973920.500444 - 1740973919.015309) <= 1.1 - "test_retry_three_times" - "test_function_times_out_no_raise" - # assert False - "test_retry_three_times_no_raise_assert" - ]; + disabledTests = [ + # Fail with: 'no server running on /tmp/tmux-1000/libtmux_test8sorutj1'. + "test_new_session_width_height" + # Assertion error + "test_capture_pane_start" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # tests/test_pane.py:113: AssertionError + "test_capture_pane_start" + # assert (1740973920.500444 - 1740973919.015309) <= 1.1 + "test_retry_three_times" + "test_function_times_out_no_raise" + # assert False + "test_retry_three_times_no_raise_assert" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test/test_retry.py" ]; diff --git a/pkgs/development/python-modules/lightgbm/default.nix b/pkgs/development/python-modules/lightgbm/default.nix index 09808cafb11b..f30739159a8a 100644 --- a/pkgs/development/python-modules/lightgbm/default.nix +++ b/pkgs/development/python-modules/lightgbm/default.nix @@ -65,7 +65,8 @@ buildPythonPackage rec { pathspec pyproject-metadata writableTmpDirAsHomeHook - ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; dontUseCmakeConfigure = true; @@ -95,14 +96,13 @@ buildPythonPackage rec { cffi pyarrow ]; - dask = - [ - dask - pandas - ] - ++ dask.optional-dependencies.array - ++ dask.optional-dependencies.dataframe - ++ dask.optional-dependencies.distributed; + dask = [ + dask + pandas + ] + ++ dask.optional-dependencies.array + ++ dask.optional-dependencies.dataframe + ++ dask.optional-dependencies.distributed; pandas = [ pandas ]; scikit-learn = [ scikit-learn ]; }; diff --git a/pkgs/development/python-modules/limits/default.nix b/pkgs/development/python-modules/limits/default.nix index f2e76f1cf317..6091789ba947 100644 --- a/pkgs/development/python-modules/limits/default.nix +++ b/pkgs/development/python-modules/limits/default.nix @@ -96,7 +96,8 @@ buildPythonPackage rec { pytest-cov-stub pytest-lazy-fixtures pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlagsArray = [ "--benchmark-disable" ]; diff --git a/pkgs/development/python-modules/limnoria/default.nix b/pkgs/development/python-modules/limnoria/default.nix index c61df1df5171..bef6495dd28f 100644 --- a/pkgs/development/python-modules/limnoria/default.nix +++ b/pkgs/development/python-modules/limnoria/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { pysocks python-dateutil python-gnupg - ] ++ lib.optionals (pythonOlder "3.9") [ pytz ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ pytz ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/line-profiler/default.nix b/pkgs/development/python-modules/line-profiler/default.nix index 91e77789b4b1..7d1642440914 100644 --- a/pkgs/development/python-modules/line-profiler/default.nix +++ b/pkgs/development/python-modules/line-profiler/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ubelt - ] ++ optional-dependencies.ipython; + ] + ++ optional-dependencies.ipython; dontUseCmakeConfigure = true; diff --git a/pkgs/development/python-modules/llguidance/default.nix b/pkgs/development/python-modules/llguidance/default.nix index 578f9ddeb45f..a9aa721066ed 100644 --- a/pkgs/development/python-modules/llguidance/default.nix +++ b/pkgs/development/python-modules/llguidance/default.nix @@ -71,21 +71,20 @@ buildPythonPackage rec { rm -r python/llguidance ''; - disabledTests = - [ - # Require internet access (https://huggingface.co) - "test_grammar" - "test_incomplete_tokenizer" - "test_par_errors" - "test_par_grammar" - "test_tokenize_partial_basic" - "test_tokenize_partial_docs" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # torch._inductor.exc.CppCompileError: C++ compile error - # OpenMP support not found. - "test_mask_data_torch" - ]; + disabledTests = [ + # Require internet access (https://huggingface.co) + "test_grammar" + "test_incomplete_tokenizer" + "test_par_errors" + "test_par_grammar" + "test_tokenize_partial_basic" + "test_tokenize_partial_docs" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # torch._inductor.exc.CppCompileError: C++ compile error + # OpenMP support not found. + "test_mask_data_torch" + ]; disabledTestPaths = [ # Require internet access (https://huggingface.co) diff --git a/pkgs/development/python-modules/llmx/default.nix b/pkgs/development/python-modules/llmx/default.nix index aa1b526782da..7e122e793618 100644 --- a/pkgs/development/python-modules/llmx/default.nix +++ b/pkgs/development/python-modules/llmx/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { transformers = [ accelerate transformers - ] ++ transformers.optional-dependencies.torch; + ] + ++ transformers.optional-dependencies.torch; }; # Tests of llmx try to access openai, google, etc. diff --git a/pkgs/development/python-modules/lm-eval/default.nix b/pkgs/development/python-modules/lm-eval/default.nix index 4fbd9dc93ef7..fc59f1dbad93 100644 --- a/pkgs/development/python-modules/lm-eval/default.nix +++ b/pkgs/development/python-modules/lm-eval/default.nix @@ -122,7 +122,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ optional-dependencies.api; + ] + ++ optional-dependencies.api; preCheck = '' export HOME=$TMP diff --git a/pkgs/development/python-modules/localstack-ext/default.nix b/pkgs/development/python-modules/localstack-ext/default.nix index 0d3cfe57dcfd..f1fa5ba5278f 100644 --- a/pkgs/development/python-modules/localstack-ext/default.nix +++ b/pkgs/development/python-modules/localstack-ext/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { requests tabulate python-dateutil - ] ++ python-jose.optional-dependencies.cryptography; + ] + ++ python-jose.optional-dependencies.cryptography; pythonImportsCheck = [ "localstack" ]; diff --git a/pkgs/development/python-modules/logbook/default.nix b/pkgs/development/python-modules/logbook/default.nix index a6785df8c5ab..bc286c00dc00 100644 --- a/pkgs/development/python-modules/logbook/default.nix +++ b/pkgs/development/python-modules/logbook/default.nix @@ -54,7 +54,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-rerunfailures - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # Some of the tests use localhost networking. __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/logilab/common.nix b/pkgs/development/python-modules/logilab/common.nix index cac45f9dd007..cdfa19c1acc2 100644 --- a/pkgs/development/python-modules/logilab/common.nix +++ b/pkgs/development/python-modules/logilab/common.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { setuptools mypy-extensions typing-extensions - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/loguru/default.nix b/pkgs/development/python-modules/loguru/default.nix index 062e33372d36..84ee57279249 100644 --- a/pkgs/development/python-modules/loguru/default.nix +++ b/pkgs/development/python-modules/loguru/default.nix @@ -36,24 +36,24 @@ buildPythonPackage rec { colorama freezegun pytest-mypy-plugins - ] ++ lib.optional (pythonOlder "3.10") exceptiongroup; + ] + ++ lib.optional (pythonOlder "3.10") exceptiongroup; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test_multiprocessing.py" ]; - disabledTests = - [ - # fails on some machine configurations - # AssertionError: assert '' != '' - "test_file_buffering" - # Slow test - "test_time_rotation" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_rotation_and_retention" - "test_rotation_and_retention_timed_file" - "test_renaming" - "test_await_complete_inheritance" - ]; + disabledTests = [ + # fails on some machine configurations + # AssertionError: assert '' != '' + "test_file_buffering" + # Slow test + "test_time_rotation" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_rotation_and_retention" + "test_rotation_and_retention_timed_file" + "test_renaming" + "test_await_complete_inheritance" + ]; pythonImportsCheck = [ "loguru" ]; diff --git a/pkgs/development/python-modules/lomond/default.nix b/pkgs/development/python-modules/lomond/default.nix index 7df0b38d54fe..027e068fa544 100644 --- a/pkgs/development/python-modules/lomond/default.nix +++ b/pkgs/development/python-modules/lomond/default.nix @@ -39,16 +39,15 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # Makes HTTP requests - "test_proxy" - "test_live" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # https://github.com/wildfoundry/dataplicity-lomond/issues/91 - "test_that_on_ping_responds_with_pong" - ]; + disabledTests = [ + # Makes HTTP requests + "test_proxy" + "test_live" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # https://github.com/wildfoundry/dataplicity-lomond/issues/91 + "test_that_on_ping_responds_with_pong" + ]; disabledTestPaths = [ # requires tornado_4, which is not compatible with python3.10 diff --git a/pkgs/development/python-modules/lxml/default.nix b/pkgs/development/python-modules/lxml/default.nix index cda7c1c2dc11..ec8c3e0c7a90 100644 --- a/pkgs/development/python-modules/lxml/default.nix +++ b/pkgs/development/python-modules/lxml/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { build-system = [ cython setuptools - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ]; # required for build time dependency check nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/m2crypto/default.nix b/pkgs/development/python-modules/m2crypto/default.nix index 5de2f6cd1996..ae7672fd205e 100644 --- a/pkgs/development/python-modules/m2crypto/default.nix +++ b/pkgs/development/python-modules/m2crypto/default.nix @@ -35,16 +35,15 @@ buildPythonPackage rec { buildInputs = [ openssl ]; - env = - { - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [ - "-Wno-error=implicit-function-declaration" - "-Wno-error=incompatible-pointer-types" - ]); - } - // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { - CPP = "${stdenv.cc.targetPrefix}cpp"; - }; + env = { + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [ + "-Wno-error=implicit-function-declaration" + "-Wno-error=incompatible-pointer-types" + ]); + } + // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { + CPP = "${stdenv.cc.targetPrefix}cpp"; + }; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/macholib/default.nix b/pkgs/development/python-modules/macholib/default.nix index 0fc3a3794f96..aa32dfe02740 100644 --- a/pkgs/development/python-modules/macholib/default.nix +++ b/pkgs/development/python-modules/macholib/default.nix @@ -25,13 +25,12 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - altgraph - ] - ++ lib.optionals (pythonOlder "3.11") [ - typing-extensions - ]; + dependencies = [ + altgraph + ] + ++ lib.optionals (pythonOlder "3.11") [ + typing-extensions + ]; # Checks assume to find darwin specific libraries doCheck = stdenv.buildPlatform.isDarwin; diff --git a/pkgs/development/python-modules/maestral/default.nix b/pkgs/development/python-modules/maestral/default.nix index 97b67651e19b..78ddcc7d8d51 100644 --- a/pkgs/development/python-modules/maestral/default.nix +++ b/pkgs/development/python-modules/maestral/default.nix @@ -64,7 +64,8 @@ buildPythonPackage rec { typing-extensions watchdog xattr - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ rubicon-objc ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ rubicon-objc ]; makeWrapperArgs = [ # Add the installed directories to the python path so the daemon can find them @@ -81,37 +82,36 @@ buildPythonPackage rec { export HOME=$(mktemp -d) ''; - disabledTests = - [ - # We don't want to benchmark - "test_performance" - # Requires systemd - "test_autostart" - # Requires network access - "test_check_for_updates" - # Tries to look at /usr - "test_filestatus" - "test_path_exists_case_insensitive" - "test_cased_path_candidates" - # AssertionError - "test_locking_multiprocess" - # OSError: [Errno 95] Operation not supported - "test_move_preserves_xattrs" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # maetral daemon does not start but worked in real environment - "test_catching_non_ignored_events" - "test_connection" - "test_event_handler" - "test_fs_ignore_tree_creation" - "test_lifecycle" - "test_notify_level" - "test_notify_snooze" - "test_receiving_events" - "test_remote_exceptions" - "test_start_already_running" - "test_stop" - ]; + disabledTests = [ + # We don't want to benchmark + "test_performance" + # Requires systemd + "test_autostart" + # Requires network access + "test_check_for_updates" + # Tries to look at /usr + "test_filestatus" + "test_path_exists_case_insensitive" + "test_cased_path_candidates" + # AssertionError + "test_locking_multiprocess" + # OSError: [Errno 95] Operation not supported + "test_move_preserves_xattrs" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # maetral daemon does not start but worked in real environment + "test_catching_non_ignored_events" + "test_connection" + "test_event_handler" + "test_fs_ignore_tree_creation" + "test_lifecycle" + "test_notify_level" + "test_notify_snooze" + "test_receiving_events" + "test_remote_exceptions" + "test_start_already_running" + "test_stop" + ]; pythonImportsCheck = [ "maestral" ]; diff --git a/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix b/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix index 0459564e2a63..189a94dbf726 100644 --- a/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix +++ b/pkgs/development/python-modules/magic-wormhole-mailbox-server/default.nix @@ -24,15 +24,14 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - attrs - autobahn - setuptools # pkg_resources is referenced at runtime - twisted - ] - ++ autobahn.optional-dependencies.twisted - ++ twisted.optional-dependencies.tls; + dependencies = [ + attrs + autobahn + setuptools # pkg_resources is referenced at runtime + twisted + ] + ++ autobahn.optional-dependencies.twisted + ++ twisted.optional-dependencies.tls; pythonImportsCheck = [ "wormhole_mailbox_server" ]; diff --git a/pkgs/development/python-modules/magic-wormhole/default.nix b/pkgs/development/python-modules/magic-wormhole/default.nix index bc7d2684cf2d..7b8eb535a285 100644 --- a/pkgs/development/python-modules/magic-wormhole/default.nix +++ b/pkgs/development/python-modules/magic-wormhole/default.nix @@ -68,25 +68,24 @@ buildPythonPackage rec { versioneer ]; - dependencies = - [ - attrs - autobahn - automat - click - cryptography - humanize - iterable-io - pynacl - qrcode - spake2 - tqdm - twisted - txtorcon - zipstream-ng - ] - ++ autobahn.optional-dependencies.twisted - ++ twisted.optional-dependencies.tls; + dependencies = [ + attrs + autobahn + automat + click + cryptography + humanize + iterable-io + pynacl + qrcode + spake2 + tqdm + twisted + txtorcon + zipstream-ng + ] + ++ autobahn.optional-dependencies.twisted + ++ twisted.optional-dependencies.tls; optional-dependencies = { dilation = [ noiseprotocol ]; @@ -96,15 +95,14 @@ buildPythonPackage rec { installShellFiles ]; - nativeCheckInputs = - [ - magic-wormhole-mailbox-server - magic-wormhole-transit-relay - pytestCheckHook - pytest-twisted - ] - ++ optional-dependencies.dilation - ++ lib.optionals stdenv.hostPlatform.isDarwin [ unixtools.locale ]; + nativeCheckInputs = [ + magic-wormhole-mailbox-server + magic-wormhole-transit-relay + pytestCheckHook + pytest-twisted + ] + ++ optional-dependencies.dilation + ++ lib.optionals stdenv.hostPlatform.isDarwin [ unixtools.locale ]; pytestFlagsArray = [ "src/wormhole/test" ]; diff --git a/pkgs/development/python-modules/mako/default.nix b/pkgs/development/python-modules/mako/default.nix index f8753b98e9cc..921bdefcae42 100644 --- a/pkgs/development/python-modules/mako/default.nix +++ b/pkgs/development/python-modules/mako/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { chameleon mock pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = lib.optionals isPyPy [ # https://github.com/sqlalchemy/mako/issues/315 diff --git a/pkgs/development/python-modules/mamba-ssm/default.nix b/pkgs/development/python-modules/mamba-ssm/default.nix index 759947cea2b9..54c45d18d90a 100644 --- a/pkgs/development/python-modules/mamba-ssm/default.nix +++ b/pkgs/development/python-modules/mamba-ssm/default.nix @@ -60,7 +60,8 @@ buildPythonPackage rec { env = { MAMBA_FORCE_BUILD = "TRUE"; - } // lib.optionalAttrs cudaSupport { CUDA_HOME = "${lib.getDev cudaPackages.cuda_nvcc}"; }; + } + // lib.optionalAttrs cudaSupport { CUDA_HOME = "${lib.getDev cudaPackages.cuda_nvcc}"; }; # pytest tests not enabled due to nvidia GPU dependency pythonImportsCheck = [ "mamba_ssm" ]; diff --git a/pkgs/development/python-modules/manifest-ml/default.nix b/pkgs/development/python-modules/manifest-ml/default.nix index 3772b33f2a29..a364d0b366d2 100644 --- a/pkgs/development/python-modules/manifest-ml/default.nix +++ b/pkgs/development/python-modules/manifest-ml/default.nix @@ -84,7 +84,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' export HOME=$TMPDIR diff --git a/pkgs/development/python-modules/manim-slides/default.nix b/pkgs/development/python-modules/manim-slides/default.nix index b5ad137f26b9..9ff812373508 100644 --- a/pkgs/development/python-modules/manim-slides/default.nix +++ b/pkgs/development/python-modules/manim-slides/default.nix @@ -56,34 +56,33 @@ buildPythonPackage rec { "qtpy" ]; - dependencies = - [ - beautifulsoup4 - click - click-default-group - jinja2 - lxml - numpy - pillow - pydantic - pydantic-extra-types - python-pptx - qtpy - requests - rich - rtoml - tqdm + dependencies = [ + beautifulsoup4 + click + click-default-group + jinja2 + lxml + numpy + pillow + pydantic + pydantic-extra-types + python-pptx + qtpy + requests + rich + rtoml + tqdm - # avconv is a potential alternative - ffmpeg - # This could also be manimgl, but that is not (yet) packaged - manim - ] - ++ lib.lists.optional (!withGui) ipython - ++ - lib.lists.optional withGui - # dependency of qtpy (could also be pyqt5) - pyqt6; + # avconv is a potential alternative + ffmpeg + # This could also be manimgl, but that is not (yet) packaged + manim + ] + ++ lib.lists.optional (!withGui) ipython + ++ + lib.lists.optional withGui + # dependency of qtpy (could also be pyqt5) + pyqt6; pythonImportsCheck = [ "manim_slides" ]; diff --git a/pkgs/development/python-modules/marimo/default.nix b/pkgs/development/python-modules/marimo/default.nix index 631388c4f32b..69ba558d227d 100644 --- a/pkgs/development/python-modules/marimo/default.nix +++ b/pkgs/development/python-modules/marimo/default.nix @@ -67,7 +67,8 @@ buildPythonPackage rec { tomlkit uvicorn websockets - ] ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; pythonImportsCheck = [ "marimo" ]; diff --git a/pkgs/development/python-modules/markdown-it-py/default.nix b/pkgs/development/python-modules/markdown-it-py/default.nix index 4ccd9e7b5bcd..828da8ce056e 100644 --- a/pkgs/development/python-modules/markdown-it-py/default.nix +++ b/pkgs/development/python-modules/markdown-it-py/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-regressions pytestCheckHook - ] ++ optional-dependencies.linkify; + ] + ++ optional-dependencies.linkify; # disable and remove benchmark tests preCheck = '' diff --git a/pkgs/development/python-modules/marko/default.nix b/pkgs/development/python-modules/marko/default.nix index 48173786ccf5..304bf4180821 100644 --- a/pkgs/development/python-modules/marko/default.nix +++ b/pkgs/development/python-modules/marko/default.nix @@ -41,12 +41,11 @@ buildPythonPackage rec { "marko" ]; - nativeCheckInputs = - [ - pytestCheckHook - ] - ++ optional-dependencies.toc - ++ optional-dependencies.codehilite; + nativeCheckInputs = [ + pytestCheckHook + ] + ++ optional-dependencies.toc + ++ optional-dependencies.codehilite; meta = { changelog = "https://github.com/frostming/marko/blob/${src.tag}/CHANGELOG.md"; diff --git a/pkgs/development/python-modules/markups/default.nix b/pkgs/development/python-modules/markups/default.nix index a42e4cfb9239..bac7b1332995 100644 --- a/pkgs/development/python-modules/markups/default.nix +++ b/pkgs/development/python-modules/markups/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { python-markdown-math pyyaml textile - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/marshmallow-dataclass/default.nix b/pkgs/development/python-modules/marshmallow-dataclass/default.nix index dd4d851bc5ff..04d5d53ebc75 100644 --- a/pkgs/development/python-modules/marshmallow-dataclass/default.nix +++ b/pkgs/development/python-modules/marshmallow-dataclass/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { dependencies = [ marshmallow typing-inspect - ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/mashumaro/default.nix b/pkgs/development/python-modules/mashumaro/default.nix index ab3050a643e7..5ce6c493181a 100644 --- a/pkgs/development/python-modules/mashumaro/default.nix +++ b/pkgs/development/python-modules/mashumaro/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { pendulum pytest-mock pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "mashumaro" ]; diff --git a/pkgs/development/python-modules/mastodon-py/default.nix b/pkgs/development/python-modules/mastodon-py/default.nix index fc46268ecc6a..5d4a9cb16761 100644 --- a/pkgs/development/python-modules/mastodon-py/default.nix +++ b/pkgs/development/python-modules/mastodon-py/default.nix @@ -53,7 +53,8 @@ buildPythonPackage rec { pytest-mock pytest-vcr requests-mock - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = [ "test_notifications_dismiss_pre_2_9_2" diff --git a/pkgs/development/python-modules/mat2/default.nix b/pkgs/development/python-modules/mat2/default.nix index f998632610d5..164faca0fe6d 100644 --- a/pkgs/development/python-modules/mat2/default.nix +++ b/pkgs/development/python-modules/mat2/default.nix @@ -35,32 +35,31 @@ buildPythonPackage rec { hash = "sha256-ivFgH/88DBucZRaO/OMsLlwJCjv/VQXb6AiKWhZ8XH0="; }; - patches = - [ - (fetchpatch { - name = "exiftool-13.25-compat.patch"; - url = "https://0xacab.org/jvoisin/mat2/-/commit/473903b70e1b269a6110242a9c098a10c18554e2.patch"; - hash = "sha256-vxxjAFwiTDlcTT3ZlfhOG4rlzBJS+LhLoA++8y2hEok="; - }) - # hardcode paths to some binaries - (replaceVars ./paths.patch { - exiftool = lib.getExe exiftool; - ffmpeg = lib.getExe ffmpeg; - kdialog = if dolphinIntegration then lib.getExe kdePackages.kdialog else null; - # replaced in postPatch - mat2 = null; - mat2svg = null; - }) - # the executable shouldn't be called .mat2-wrapped - ./executable-name.patch - # hardcode path to mat2 executable - ./tests.patch - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - (replaceVars ./bubblewrap-path.patch { - bwrap = lib.getExe bubblewrap; - }) - ]; + patches = [ + (fetchpatch { + name = "exiftool-13.25-compat.patch"; + url = "https://0xacab.org/jvoisin/mat2/-/commit/473903b70e1b269a6110242a9c098a10c18554e2.patch"; + hash = "sha256-vxxjAFwiTDlcTT3ZlfhOG4rlzBJS+LhLoA++8y2hEok="; + }) + # hardcode paths to some binaries + (replaceVars ./paths.patch { + exiftool = lib.getExe exiftool; + ffmpeg = lib.getExe ffmpeg; + kdialog = if dolphinIntegration then lib.getExe kdePackages.kdialog else null; + # replaced in postPatch + mat2 = null; + mat2svg = null; + }) + # the executable shouldn't be called .mat2-wrapped + ./executable-name.patch + # hardcode path to mat2 executable + ./tests.patch + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + (replaceVars ./bubblewrap-path.patch { + bwrap = lib.getExe bubblewrap; + }) + ]; postPatch = '' substituteInPlace dolphin/mat2.desktop \ @@ -87,14 +86,13 @@ buildPythonPackage rec { pycairo ]; - postInstall = - '' - install -Dm 444 data/mat2.svg -t "$out/share/icons/hicolor/scalable/apps" - install -Dm 444 doc/mat2.1 -t "$out/share/man/man1" - '' - + lib.optionalString dolphinIntegration '' - install -Dm 444 dolphin/mat2.desktop -t "$out/share/kservices5/ServiceMenus" - ''; + postInstall = '' + install -Dm 444 data/mat2.svg -t "$out/share/icons/hicolor/scalable/apps" + install -Dm 444 doc/mat2.1 -t "$out/share/man/man1" + '' + + lib.optionalString dolphinIntegration '' + install -Dm 444 dolphin/mat2.desktop -t "$out/share/kservices5/ServiceMenus" + ''; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/materialx/default.nix b/pkgs/development/python-modules/materialx/default.nix index d15207ee0a70..ac858b468fdd 100644 --- a/pkgs/development/python-modules/materialx/default.nix +++ b/pkgs/development/python-modules/materialx/default.nix @@ -35,19 +35,18 @@ buildPythonPackage rec { setuptools ]; - buildInputs = - [ - openimageio_2 - imath - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_14 - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libX11 - libXt - libGL - ]; + buildInputs = [ + openimageio_2 + imath + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_14 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libX11 + libXt + libGL + ]; cmakeFlags = [ (lib.cmakeBool "MATERIALX_BUILD_OIIO" true) diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index a9cc605ee2b8..7f151fe2d364 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -99,32 +99,30 @@ buildPythonPackage rec { # installed under the same path which is not true in Nix. # With the following patch we just hard-code these paths into the install # script. - postPatch = - '' - substituteInPlace pyproject.toml \ - --replace-fail "meson-python>=0.13.1,<0.17.0" meson-python + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "meson-python>=0.13.1,<0.17.0" meson-python - patchShebangs tools - '' - + lib.optionalString (stdenv.hostPlatform.isLinux && interactive) '' - # fix paths to libraries in dlopen calls (headless detection) - substituteInPlace src/_c_internal_utils.cpp \ - --replace-fail libX11.so.6 ${libX11}/lib/libX11.so.6 \ - --replace-fail libwayland-client.so.0 ${wayland}/lib/libwayland-client.so.0 - ''; + patchShebangs tools + '' + + lib.optionalString (stdenv.hostPlatform.isLinux && interactive) '' + # fix paths to libraries in dlopen calls (headless detection) + substituteInPlace src/_c_internal_utils.cpp \ + --replace-fail libX11.so.6 ${libX11}/lib/libX11.so.6 \ + --replace-fail libwayland-client.so.0 ${wayland}/lib/libwayland-client.so.0 + ''; nativeBuildInputs = [ pkg-config ] ++ lib.optionals enableGtk3 [ gobject-introspection ]; - buildInputs = - [ - ffmpeg-headless - freetype - qhull - ] - ++ lib.optionals enableGtk3 [ - cairo - gtk3 - ]; + buildInputs = [ + ffmpeg-headless + freetype + qhull + ] + ++ lib.optionals enableGtk3 [ + cairo + gtk3 + ]; # clang-11: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument] hardeningDisable = lib.optionals stdenv.hostPlatform.isDarwin [ "strictoverflow" ]; @@ -137,28 +135,27 @@ buildPythonPackage rec { setuptools-scm ]; - dependencies = - [ - # explicit - contourpy - cycler - fonttools - kiwisolver - numpy - packaging - pillow - pyparsing - python-dateutil - ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-resources ] - ++ lib.optionals enableGtk3 [ - pycairo - pygobject3 - ] - ++ lib.optionals enableQt [ pyqt5 ] - ++ lib.optionals enableWebagg [ tornado ] - ++ lib.optionals enableNbagg [ ipykernel ] - ++ lib.optionals enableTk [ tkinter ]; + dependencies = [ + # explicit + contourpy + cycler + fonttools + kiwisolver + numpy + packaging + pillow + pyparsing + python-dateutil + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-resources ] + ++ lib.optionals enableGtk3 [ + pycairo + pygobject3 + ] + ++ lib.optionals enableQt [ pyqt5 ] + ++ lib.optionals enableWebagg [ tornado ] + ++ lib.optionals enableNbagg [ ipykernel ] + ++ lib.optionals enableTk [ tkinter ]; mesonFlags = lib.mapAttrsToList lib.mesonBool { system-freetype = true; diff --git a/pkgs/development/python-modules/matrix-nio/default.nix b/pkgs/development/python-modules/matrix-nio/default.nix index 3bbf04b5d3f6..8c8e0b3828b5 100644 --- a/pkgs/development/python-modules/matrix-nio/default.nix +++ b/pkgs/development/python-modules/matrix-nio/default.nix @@ -70,7 +70,8 @@ buildPythonPackage rec { jsonschema pycryptodome unpaddedbase64 - ] ++ lib.optionals withOlm optional-dependencies.e2e; + ] + ++ lib.optionals withOlm optional-dependencies.e2e; optional-dependencies = { e2e = [ @@ -108,46 +109,45 @@ buildPythonPackage rec { "tests/store_test.py" ]; - disabledTests = - [ - # touches network - "test_connect_wrapper" - # time dependent and flaky - "test_transfer_monitor_callbacks" - ] - ++ lib.optionals (!withOlm) [ - "test_client_account_sharing" - "test_client_key_query" - "test_client_login" - "test_client_protocol_error" - "test_client_restore_login" - "test_client_room_creation" - "test_device_store" - "test_e2e_sending" - "test_early_store_loading" - "test_encrypted_data_generator" - "test_http_client_keys_query" - "test_key_claiming" - "test_key_exports" - "test_key_invalidation" - "test_key_sharing" - "test_key_sharing_callbacks" - "test_key_sharing_cancellation" - "test_keys_query" - "test_keys_upload" - "test_marking_sessions_as_shared" - "test_message_sending" - "test_query_rule" - "test_room_devices" - "test_sas_verification" - "test_sas_verification_cancel" - "test_session_sharing" - "test_session_sharing_2" - "test_session_unwedging" - "test_storing_room_encryption_state" - "test_sync_forever" - "test_sync_token_restoring" - ]; + disabledTests = [ + # touches network + "test_connect_wrapper" + # time dependent and flaky + "test_transfer_monitor_callbacks" + ] + ++ lib.optionals (!withOlm) [ + "test_client_account_sharing" + "test_client_key_query" + "test_client_login" + "test_client_protocol_error" + "test_client_restore_login" + "test_client_room_creation" + "test_device_store" + "test_e2e_sending" + "test_early_store_loading" + "test_encrypted_data_generator" + "test_http_client_keys_query" + "test_key_claiming" + "test_key_exports" + "test_key_invalidation" + "test_key_sharing" + "test_key_sharing_callbacks" + "test_key_sharing_cancellation" + "test_keys_query" + "test_keys_upload" + "test_marking_sessions_as_shared" + "test_message_sending" + "test_query_rule" + "test_room_devices" + "test_sas_verification" + "test_sas_verification_cancel" + "test_session_sharing" + "test_session_sharing_2" + "test_session_unwedging" + "test_storing_room_encryption_state" + "test_sync_forever" + "test_sync_token_restoring" + ]; passthru.tests = { inherit (nixosTests) diff --git a/pkgs/development/python-modules/mautrix/default.nix b/pkgs/development/python-modules/mautrix/default.nix index 1a38f699a0fb..4f1e65cd8465 100644 --- a/pkgs/development/python-modules/mautrix/default.nix +++ b/pkgs/development/python-modules/mautrix/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { aiohttp attrs yarl - ] ++ lib.optionals withOlm optional-dependencies.encryption; + ] + ++ lib.optionals withOlm optional-dependencies.encryption; optional-dependencies = { detect_mimetype = [ python-magic ]; diff --git a/pkgs/development/python-modules/mayim/default.nix b/pkgs/development/python-modules/mayim/default.nix index 91ef5b7b6d3c..8c4cbd41fb51 100644 --- a/pkgs/development/python-modules/mayim/default.nix +++ b/pkgs/development/python-modules/mayim/default.nix @@ -39,17 +39,16 @@ buildPythonPackage rec { sqlite = [ aiosqlite ]; }; - nativeCheckInputs = - [ - pytestCheckHook - pytest-asyncio - pytest-cov-stub - ] - ++ (with optional-dependencies; [ - postgres - mysql - sqlite - ]); + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + pytest-cov-stub + ] + ++ (with optional-dependencies; [ + postgres + mysql + sqlite + ]); pythonImportsCheck = [ "mayim" ]; diff --git a/pkgs/development/python-modules/mcp/default.nix b/pkgs/development/python-modules/mcp/default.nix index b3564681af90..5ad4d0b7b956 100644 --- a/pkgs/development/python-modules/mcp/default.nix +++ b/pkgs/development/python-modules/mcp/default.nix @@ -94,33 +94,33 @@ buildPythonPackage rec { pytest-xdist pytestCheckHook requests - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlags = [ "-Wignore::pydantic.warnings.PydanticDeprecatedSince211" ]; - disabledTests = - [ - # attempts to run the package manager uv - "test_command_execution" + disabledTests = [ + # attempts to run the package manager uv + "test_command_execution" - # performance-dependent test - "test_messages_are_executed_concurrently" + # performance-dependent test + "test_messages_are_executed_concurrently" - # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) - "test_client_session_version_negotiation_failure" + # ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + "test_client_session_version_negotiation_failure" - # AttributeError: 'coroutine' object has no attribute 'client_metadata' - "TestOAuthClientProvider" + # AttributeError: 'coroutine' object has no attribute 'client_metadata' + "TestOAuthClientProvider" - # inline_snapshot._exceptions.UsageError: snapshot value should not change. Use Is(...) for dynamic snapshot parts - "test_build_metadata" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Flaky: ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) - "test_notification_validation_error" - ]; + # inline_snapshot._exceptions.UsageError: snapshot value should not change. Use Is(...) for dynamic snapshot parts + "test_build_metadata" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Flaky: ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + "test_notification_validation_error" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/meep/default.nix b/pkgs/development/python-modules/meep/default.nix index d091ff198862..93294b6f3e39 100644 --- a/pkgs/development/python-modules/meep/default.nix +++ b/pkgs/development/python-modules/meep/default.nix @@ -73,20 +73,19 @@ buildPythonPackage rec { propagatedBuildInputs = [ mpi ]; - dependencies = - [ - numpy - scipy - matplotlib - h5py-mpi - cython - autograd - mpi4py - ] - ++ lib.optionals (!pythonOlder "3.12") [ - setuptools # used in python/visualization.py - distutils - ]; + dependencies = [ + numpy + scipy + matplotlib + h5py-mpi + cython + autograd + mpi4py + ] + ++ lib.optionals (!pythonOlder "3.12") [ + setuptools # used in python/visualization.py + distutils + ]; propagatedUserEnvPkgs = [ mpi ]; diff --git a/pkgs/development/python-modules/meilisearch/default.nix b/pkgs/development/python-modules/meilisearch/default.nix index 52261a1ca483..68816037d814 100644 --- a/pkgs/development/python-modules/meilisearch/default.nix +++ b/pkgs/development/python-modules/meilisearch/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { dependencies = [ camel-converter requests - ] ++ camel-converter.optional-dependencies.pydantic; + ] + ++ camel-converter.optional-dependencies.pydantic; pythonImportsCheck = [ "meilisearch" ]; diff --git a/pkgs/development/python-modules/meross-iot/default.nix b/pkgs/development/python-modules/meross-iot/default.nix index 37d088234c92..fa1c7b10dbf0 100644 --- a/pkgs/development/python-modules/meross-iot/default.nix +++ b/pkgs/development/python-modules/meross-iot/default.nix @@ -28,7 +28,8 @@ buildPythonPackage rec { paho-mqtt pycryptodomex requests - ] ++ aiohttp.optional-dependencies.speedups; + ] + ++ aiohttp.optional-dependencies.speedups; # Test require network access doCheck = false; diff --git a/pkgs/development/python-modules/meshtastic/default.nix b/pkgs/development/python-modules/meshtastic/default.nix index adf286cc9fe7..e280c925b23d 100644 --- a/pkgs/development/python-modules/meshtastic/default.nix +++ b/pkgs/development/python-modules/meshtastic/default.nix @@ -93,7 +93,8 @@ buildPythonPackage rec { nativeCheckInputs = [ hypothesis pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export PATH="$PATH:$out/bin"; diff --git a/pkgs/development/python-modules/meson-python/default.nix b/pkgs/development/python-modules/meson-python/default.nix index b4099605e0e0..f4658c97c8c3 100644 --- a/pkgs/development/python-modules/meson-python/default.nix +++ b/pkgs/development/python-modules/meson-python/default.nix @@ -42,13 +42,15 @@ buildPythonPackage rec { meson ninja pyproject-metadata - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; dependencies = [ meson ninja pyproject-metadata - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ cython diff --git a/pkgs/development/python-modules/mezzanine/default.nix b/pkgs/development/python-modules/mezzanine/default.nix index 9dbbfe4c6d7d..d7f21ee8e2a6 100644 --- a/pkgs/development/python-modules/mezzanine/default.nix +++ b/pkgs/development/python-modules/mezzanine/default.nix @@ -53,7 +53,8 @@ buildPythonPackage rec { requests requests-oauthlib tzlocal - ] ++ bleach.optional-dependencies.css; + ] + ++ bleach.optional-dependencies.css; # Tests Fail Due to Syntax Warning, Fixed for v3.1.11+ doCheck = false; diff --git a/pkgs/development/python-modules/microsoft-kiota-http/default.nix b/pkgs/development/python-modules/microsoft-kiota-http/default.nix index 310ad5d1a9e9..b0633edf960e 100644 --- a/pkgs/development/python-modules/microsoft-kiota-http/default.nix +++ b/pkgs/development/python-modules/microsoft-kiota-http/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { microsoft-kiota-abstractions opentelemetry-api opentelemetry-sdk - ] ++ httpx.optional-dependencies.http2; + ] + ++ httpx.optional-dependencies.http2; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/mike/default.nix b/pkgs/development/python-modules/mike/default.nix index 0d23235e09ad..c334aef04cd8 100644 --- a/pkgs/development/python-modules/mike/default.nix +++ b/pkgs/development/python-modules/mike/default.nix @@ -58,15 +58,14 @@ buildPythonPackage rec { shtab ]; - preCheck = - '' - export PATH=$out/bin:$PATH - '' - # "stat" on darwin results in "not permitted" instead of "does not exists" - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace test/unit/test_git_utils.py \ - --replace-fail "/home/nonexist" "$(mktemp -d)" - ''; + preCheck = '' + export PATH=$out/bin:$PATH + '' + # "stat" on darwin results in "not permitted" instead of "does not exists" + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace test/unit/test_git_utils.py \ + --replace-fail "/home/nonexist" "$(mktemp -d)" + ''; pythonImportsCheck = [ "mike" ]; diff --git a/pkgs/development/python-modules/minari/default.nix b/pkgs/development/python-modules/minari/default.nix index a3236605d711..bfbac43d3340 100644 --- a/pkgs/development/python-modules/minari/default.nix +++ b/pkgs/development/python-modules/minari/default.nix @@ -79,7 +79,8 @@ buildPythonPackage rec { nativeCheckInputs = [ jaxlib pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # Require internet access diff --git a/pkgs/development/python-modules/mip/default.nix b/pkgs/development/python-modules/mip/default.nix index a2c6e80e3f16..18e8360ed063 100644 --- a/pkgs/development/python-modules/mip/default.nix +++ b/pkgs/development/python-modules/mip/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ cffi - ] ++ lib.optionals gurobiSupport ([ gurobipy ] ++ lib.optional (gurobiHome == null) gurobi); + ] + ++ lib.optionals gurobiSupport ([ gurobipy ] ++ lib.optional (gurobiHome == null) gurobi); # Source files have CRLF terminators, which make patch error out when supplied # with diffs made on *nix machines diff --git a/pkgs/development/python-modules/mir-eval/default.nix b/pkgs/development/python-modules/mir-eval/default.nix index 1102adfb43d2..ef580ec384ee 100644 --- a/pkgs/development/python-modules/mir-eval/default.nix +++ b/pkgs/development/python-modules/mir-eval/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { pytestCheckHook pytest-cov-stub pytest-mpl - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' pushd tests diff --git a/pkgs/development/python-modules/mirakuru/default.nix b/pkgs/development/python-modules/mirakuru/default.nix index 85085c1e6ebc..168a3175a703 100644 --- a/pkgs/development/python-modules/mirakuru/default.nix +++ b/pkgs/development/python-modules/mirakuru/default.nix @@ -49,14 +49,13 @@ buildPythonPackage rec { # > ps: vsz: requires entitlement # > ps: rss: requires entitlement # > ps: time: requires entitlement - disabledTests = - [ - "test_forgotten_stop" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_mirakuru_cleanup" - "test_daemons_killing" - ]; + disabledTests = [ + "test_forgotten_stop" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_mirakuru_cleanup" + "test_daemons_killing" + ]; meta = with lib; { homepage = "https://github.com/dbfixtures/mirakuru"; diff --git a/pkgs/development/python-modules/mitmproxy-linux/default.nix b/pkgs/development/python-modules/mitmproxy-linux/default.nix index 8504fa751399..41467db01625 100644 --- a/pkgs/development/python-modules/mitmproxy-linux/default.nix +++ b/pkgs/development/python-modules/mitmproxy-linux/default.nix @@ -41,13 +41,12 @@ buildPythonPackage { pythonImportsCheck = [ "mitmproxy_linux" ]; - meta = - { - inherit (mitmproxy-rs.meta) changelog license maintainers; - } - // { - description = "Linux Rust bits in mitmproxy"; - homepage = "https://github.com/mitmproxy/mitmproxy_rs/tree/main/mitmproxy-linux"; - platforms = lib.platforms.linux; - }; + meta = { + inherit (mitmproxy-rs.meta) changelog license maintainers; + } + // { + description = "Linux Rust bits in mitmproxy"; + homepage = "https://github.com/mitmproxy/mitmproxy_rs/tree/main/mitmproxy-linux"; + platforms = lib.platforms.linux; + }; } diff --git a/pkgs/development/python-modules/mkdocs-rss-plugin/default.nix b/pkgs/development/python-modules/mkdocs-rss-plugin/default.nix index e5b34b7b70f1..ea29801b0383 100644 --- a/pkgs/development/python-modules/mkdocs-rss-plugin/default.nix +++ b/pkgs/development/python-modules/mkdocs-rss-plugin/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { cachecontrol gitpython mkdocs - ] ++ cachecontrol.optional-dependencies.filecache; + ] + ++ cachecontrol.optional-dependencies.filecache; nativeCheckInputs = [ feedparser diff --git a/pkgs/development/python-modules/mkdocs/default.nix b/pkgs/development/python-modules/mkdocs/default.nix index 8151b8728526..469780d1eaa5 100644 --- a/pkgs/development/python-modules/mkdocs/default.nix +++ b/pkgs/development/python-modules/mkdocs/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { hatchling # babel, setuptools required as "build hooks" babel - ] ++ lib.optionals (pythonAtLeast "3.12") [ setuptools ]; + ] + ++ lib.optionals (pythonAtLeast "3.12") [ setuptools ]; dependencies = [ click @@ -68,7 +69,8 @@ buildPythonPackage rec { pyyaml pyyaml-env-tag watchdog - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; optional-dependencies = { i18n = [ babel ]; @@ -77,7 +79,8 @@ buildPythonPackage rec { nativeCheckInputs = [ unittestCheckHook mock - ] ++ optional-dependencies.i18n; + ] + ++ optional-dependencies.i18n; unittestFlagsArray = [ "-v" diff --git a/pkgs/development/python-modules/mkdocstrings/default.nix b/pkgs/development/python-modules/mkdocstrings/default.nix index 6472e51bb9ed..1ee04a5b9971 100644 --- a/pkgs/development/python-modules/mkdocstrings/default.nix +++ b/pkgs/development/python-modules/mkdocstrings/default.nix @@ -34,18 +34,17 @@ buildPythonPackage rec { build-system = [ pdm-backend ]; - dependencies = - [ - jinja2 - markdown - markupsafe - mkdocs - mkdocs-autorefs - pymdown-extensions - ] - ++ lib.optionals (pythonOlder "3.10") [ - importlib-metadata - ]; + dependencies = [ + jinja2 + markdown + markupsafe + mkdocs + mkdocs-autorefs + pymdown-extensions + ] + ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/mlcroissant/default.nix b/pkgs/development/python-modules/mlcroissant/default.nix index 7711374c5370..96bf7b6dc9f6 100644 --- a/pkgs/development/python-modules/mlcroissant/default.nix +++ b/pkgs/development/python-modules/mlcroissant/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { requests scipy tqdm - ] ++ etils.optional-dependencies.epath; + ] + ++ etils.optional-dependencies.epath; pythonImportsCheck = [ "mlcroissant" ]; diff --git a/pkgs/development/python-modules/mmcv/default.nix b/pkgs/development/python-modules/mmcv/default.nix index cc9efa952bf3..8a0821999811 100644 --- a/pkgs/development/python-modules/mmcv/default.nix +++ b/pkgs/development/python-modules/mmcv/default.nix @@ -65,21 +65,20 @@ buildPythonPackage rec { which ]; - buildInputs = + buildInputs = [ + pybind11 + torch + ] + ++ lib.optionals cudaSupport ( + with cudaPackages; [ - pybind11 - torch + cuda_cudart # cuda_runtime.h + cuda_cccl # + libcublas # cublas_v2.h + libcusolver # cusolverDn.h + libcusparse # cusparse.h ] - ++ lib.optionals cudaSupport ( - with cudaPackages; - [ - cuda_cudart # cuda_runtime.h - cuda_cccl # - libcublas # cublas_v2.h - libcusolver # cusolverDn.h - libcusparse # cusparse.h - ] - ); + ); dependencies = [ addict @@ -96,16 +95,15 @@ buildPythonPackage rec { env.CUDA_HOME = lib.optionalString cudaSupport (lib.getDev cudaPackages.cuda_nvcc); - preConfigure = - '' - export MMCV_WITH_OPS=1 - '' - + lib.optionalString cudaSupport '' - export CC=${lib.getExe' backendStdenv.cc "cc"} - export CXX=${lib.getExe' backendStdenv.cc "c++"} - export TORCH_CUDA_ARCH_LIST="${lib.concatStringsSep ";" cudaCapabilities}" - export FORCE_CUDA=1 - ''; + preConfigure = '' + export MMCV_WITH_OPS=1 + '' + + lib.optionalString cudaSupport '' + export CC=${lib.getExe' backendStdenv.cc "cc"} + export CXX=${lib.getExe' backendStdenv.cc "c++"} + export TORCH_CUDA_ARCH_LIST="${lib.concatStringsSep ";" cudaCapabilities}" + export FORCE_CUDA=1 + ''; pythonImportsCheck = [ "mmcv" ]; @@ -128,23 +126,22 @@ buildPythonPackage rec { # test_cnn test_ops really requires gpus to be useful. # some of the tests take exceedingly long time. # the rest of the tests are disabled due to sandbox env. - disabledTests = - [ - "test_cnn" - "test_ops" - "test_fileclient" - "test_load_model_zoo" - "test_processing" - "test_checkpoint" - "test_hub" - "test_reader" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # flaky numerical tests (AssertionError) - "test_ycbcr2rgb" - "test_ycbcr2bgr" - "test_tensor2imgs" - ]; + disabledTests = [ + "test_cnn" + "test_ops" + "test_fileclient" + "test_load_model_zoo" + "test_processing" + "test_checkpoint" + "test_hub" + "test_reader" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # flaky numerical tests (AssertionError) + "test_ycbcr2rgb" + "test_ycbcr2bgr" + "test_tensor2imgs" + ]; meta = { description = "Foundational Library for Computer Vision Research"; diff --git a/pkgs/development/python-modules/mne/default.nix b/pkgs/development/python-modules/mne/default.nix index 308e455b6cd4..e65caeb6355e 100644 --- a/pkgs/development/python-modules/mne/default.nix +++ b/pkgs/development/python-modules/mne/default.nix @@ -75,7 +75,8 @@ buildPythonPackage rec { pytestCheckHook pytest-cov-stub pytest-timeout - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/development/python-modules/mocket/default.nix b/pkgs/development/python-modules/mocket/default.nix index 78ff2568640d..7dac034861b0 100644 --- a/pkgs/development/python-modules/mocket/default.nix +++ b/pkgs/development/python-modules/mocket/default.nix @@ -72,27 +72,27 @@ buildPythonPackage rec { redisTestHook requests sure - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # Skip http tests, they require network access env.SKIP_TRUE_HTTP = true; __darwinAllowLocalNetworking = true; - disabledTests = - [ - # tests that require network access (like DNS lookups) - "test_truesendall_with_dump_from_recording" - "test_aiohttp" - "test_asyncio_record_replay" - "test_gethostbyname" - # httpx read failure - "test_no_dangling_fds" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fails on darwin due to upstream bug: https://github.com/mindflayer/python-mocket/issues/287 - "test_httprettish_httpx_session" - ]; + disabledTests = [ + # tests that require network access (like DNS lookups) + "test_truesendall_with_dump_from_recording" + "test_aiohttp" + "test_asyncio_record_replay" + "test_gethostbyname" + # httpx read failure + "test_no_dangling_fds" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fails on darwin due to upstream bug: https://github.com/mindflayer/python-mocket/issues/287 + "test_httprettish_httpx_session" + ]; pythonImportsCheck = [ "mocket" ]; diff --git a/pkgs/development/python-modules/molecule/default.nix b/pkgs/development/python-modules/molecule/default.nix index cbdb3ee7578d..792f532fd9cb 100644 --- a/pkgs/development/python-modules/molecule/default.nix +++ b/pkgs/development/python-modules/molecule/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { rich yamllint wcmatch - ] ++ lib.optional withPlugins molecule-plugins; + ] + ++ lib.optional withPlugins molecule-plugins; pythonImportsCheck = [ "molecule" ]; diff --git a/pkgs/development/python-modules/monty/default.nix b/pkgs/development/python-modules/monty/default.nix index 6b6f59540047..1ee9626ab6e5 100644 --- a/pkgs/development/python-modules/monty/default.nix +++ b/pkgs/development/python-modules/monty/default.nix @@ -64,23 +64,23 @@ buildPythonPackage rec { pytest pytest-cov types-requests - ] ++ optional; + ] + ++ optional; dev = [ ipython ]; docs = [ sphinx sphinx-rtd-theme ]; - json = - [ - orjson - pandas - pydantic - pymongo - ] - ++ lib.optionals (pythonOlder "3.13") [ - pint - torch - ]; + json = [ + orjson + pandas + pydantic + pymongo + ] + ++ lib.optionals (pythonOlder "3.13") [ + pint + torch + ]; multiprocessing = [ tqdm ]; optional = dev ++ json ++ multiprocessing ++ serialization; serialization = [ msgpack ]; diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix index 3cd880c4f99d..7ebd9d1554da 100644 --- a/pkgs/development/python-modules/moto/default.nix +++ b/pkgs/development/python-modules/moto/default.nix @@ -310,7 +310,8 @@ buildPythonPackage rec { pytest-order pytest-xdist pytestCheckHook - ] ++ optional-dependencies.server; + ] + ++ optional-dependencies.server; # Some tests depend on AWS credentials environment variables to be set. env.AWS_ACCESS_KEY_ID = "ak"; diff --git a/pkgs/development/python-modules/moviepy/default.nix b/pkgs/development/python-modules/moviepy/default.nix index 4ac2cb5b0d8c..e393427e61d9 100644 --- a/pkgs/development/python-modules/moviepy/default.nix +++ b/pkgs/development/python-modules/moviepy/default.nix @@ -69,32 +69,32 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-timeout pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # See https://github.com/NixOS/nixpkgs/issues/381908 and https://github.com/NixOS/nixpkgs/issues/385450. pytestFlags = [ "--timeout=600" ]; pythonImportsCheck = [ "moviepy" ]; - disabledTests = - [ - # stalls - "test_doc_examples" - # video orientation mismatch, 0 != 180 - "test_PR_529" - # video orientation [1920, 1080] != [1080, 1920] - "test_ffmpeg_parse_video_rotation" - "test_correct_video_rotation" - # media duration mismatch: assert 230.0 == 30.02 - "test_ffmpeg_parse_infos_decode_file" - # Failed: DID NOT RAISE - "test_ffmpeg_resize" - "test_ffmpeg_stabilize_video" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Failed: Timeout >30.0s - "test_issue_1682" - ]; + disabledTests = [ + # stalls + "test_doc_examples" + # video orientation mismatch, 0 != 180 + "test_PR_529" + # video orientation [1920, 1080] != [1080, 1920] + "test_ffmpeg_parse_video_rotation" + "test_correct_video_rotation" + # media duration mismatch: assert 230.0 == 30.02 + "test_ffmpeg_parse_infos_decode_file" + # Failed: DID NOT RAISE + "test_ffmpeg_resize" + "test_ffmpeg_stabilize_video" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Failed: Timeout >30.0s + "test_issue_1682" + ]; disabledTestPaths = [ "tests/test_compositing.py" diff --git a/pkgs/development/python-modules/mrjob/default.nix b/pkgs/development/python-modules/mrjob/default.nix index 1fd83fe21a89..fa36ae67a44a 100644 --- a/pkgs/development/python-modules/mrjob/default.nix +++ b/pkgs/development/python-modules/mrjob/default.nix @@ -71,7 +71,8 @@ buildPythonPackage rec { pyspark unittestCheckHook warcio - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); unittestFlagsArray = [ "-v" ]; diff --git a/pkgs/development/python-modules/msal-extensions/default.nix b/pkgs/development/python-modules/msal-extensions/default.nix index a7d92d95a9e3..4a8d74f7768f 100644 --- a/pkgs/development/python-modules/msal-extensions/default.nix +++ b/pkgs/development/python-modules/msal-extensions/default.nix @@ -35,20 +35,19 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = - [ - # `from gi.repository import Secret` fails to find libsecret - "test_token_cache_roundtrip_with_persistence_builder" - "test_libsecret_persistence" - "test_nonexistent_libsecret_persistence" - # network access - "test_token_cache_roundtrip_with_file_persistence" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # msal_extensions.osx.KeychainError - "test_keychain_roundtrip" - "test_keychain_persistence" - ]; + disabledTests = [ + # `from gi.repository import Secret` fails to find libsecret + "test_token_cache_roundtrip_with_persistence_builder" + "test_libsecret_persistence" + "test_nonexistent_libsecret_persistence" + # network access + "test_token_cache_roundtrip_with_file_persistence" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # msal_extensions.osx.KeychainError + "test_keychain_roundtrip" + "test_keychain_persistence" + ]; pythonImportsCheck = [ "msal_extensions" ]; diff --git a/pkgs/development/python-modules/msal/default.nix b/pkgs/development/python-modules/msal/default.nix index 4efc225e785d..955c4f97a85b 100644 --- a/pkgs/development/python-modules/msal/default.nix +++ b/pkgs/development/python-modules/msal/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { cryptography pyjwt requests - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; # Tests assume Network Connectivity: # https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/e2958961e8ec16d0af4199f60c36c3f913497e48/tests/test_authority.py#L73 diff --git a/pkgs/development/python-modules/msrest/default.nix b/pkgs/development/python-modules/msrest/default.nix index de7662b7bc8f..07e94b76aaa4 100644 --- a/pkgs/development/python-modules/msrest/default.nix +++ b/pkgs/development/python-modules/msrest/default.nix @@ -52,24 +52,23 @@ buildPythonPackage { trio ]; - disabledTests = - [ - # Test require network access - "test_basic_aiohttp" - "test_basic_aiohttp" - "test_basic_async_requests" - "test_basic_async_requests" - "test_conf_async_requests" - "test_conf_async_requests" - "test_conf_async_trio_requests" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # AttributeError: 'TestAuthentication' object has no attribute... - "test_apikey_auth" - "test_cs_auth" - "test_eventgrid_auth" - "test_eventgrid_domain_auth" - ]; + disabledTests = [ + # Test require network access + "test_basic_aiohttp" + "test_basic_aiohttp" + "test_basic_async_requests" + "test_basic_async_requests" + "test_conf_async_requests" + "test_conf_async_requests" + "test_conf_async_trio_requests" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # AttributeError: 'TestAuthentication' object has no attribute... + "test_apikey_auth" + "test_cs_auth" + "test_eventgrid_auth" + "test_eventgrid_domain_auth" + ]; pythonImportsCheck = [ "msrest" ]; diff --git a/pkgs/development/python-modules/mtcnn/default.nix b/pkgs/development/python-modules/mtcnn/default.nix index 4150634f2288..7194e0b2469c 100644 --- a/pkgs/development/python-modules/mtcnn/default.nix +++ b/pkgs/development/python-modules/mtcnn/default.nix @@ -31,14 +31,13 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - joblib - lz4 - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - distutils - ]; + dependencies = [ + joblib + lz4 + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + distutils + ]; pythonImportsCheck = [ "mtcnn" ]; diff --git a/pkgs/development/python-modules/mujoco-mjx/default.nix b/pkgs/development/python-modules/mujoco-mjx/default.nix index 7073dc4484d1..9fc2ebe280d6 100644 --- a/pkgs/development/python-modules/mujoco-mjx/default.nix +++ b/pkgs/development/python-modules/mujoco-mjx/default.nix @@ -38,7 +38,8 @@ buildPythonPackage { mujoco scipy trimesh - ] ++ etils.optional-dependencies.epath; + ] + ++ etils.optional-dependencies.epath; pythonImportsCheck = [ "mujoco.mjx" ]; diff --git a/pkgs/development/python-modules/mypermobil/default.nix b/pkgs/development/python-modules/mypermobil/default.nix index 85c2f56be151..616af8a8c06b 100644 --- a/pkgs/development/python-modules/mypermobil/default.nix +++ b/pkgs/development/python-modules/mypermobil/default.nix @@ -36,15 +36,14 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # requires networking - "test_region" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # AssertionError: MyPermobilAPIException not raised - "test_request_item_404" - ]; + disabledTests = [ + # requires networking + "test_region" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # AssertionError: MyPermobilAPIException not raised + "test_request_item_404" + ]; meta = { changelog = "https://github.com/Permobil-Software/mypermobil/releases/tag/v${version}"; diff --git a/pkgs/development/python-modules/mypy/default.nix b/pkgs/development/python-modules/mypy/default.nix index e7178dfb05f3..79a0cd86947f 100644 --- a/pkgs/development/python-modules/mypy/default.nix +++ b/pkgs/development/python-modules/mypy/default.nix @@ -57,12 +57,14 @@ buildPythonPackage rec { types-setuptools typing-extensions wheel - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; dependencies = [ mypy-extensions typing-extensions - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; optional-dependencies = { dmypy = [ psutil ]; @@ -77,19 +79,18 @@ buildPythonPackage rec { # when testing reduce optimisation level to reduce build time by 20% env.MYPYC_OPT_LEVEL = 1; - pythonImportsCheck = - [ - "mypy" - "mypy.api" - "mypy.fastparse" - "mypy.types" - "mypyc" - "mypyc.analysis" - ] - ++ lib.optionals (!stdenv.hostPlatform.isi686) [ - # ImportError: cannot import name 'map_instance_to_supertype' from partially initialized module 'mypy.maptype' (most likely due to a circular import) - "mypy.report" - ]; + pythonImportsCheck = [ + "mypy" + "mypy.api" + "mypy.fastparse" + "mypy.types" + "mypyc" + "mypyc.analysis" + ] + ++ lib.optionals (!stdenv.hostPlatform.isi686) [ + # ImportError: cannot import name 'map_instance_to_supertype' from partially initialized module 'mypy.maptype' (most likely due to a circular import) + "mypy.report" + ]; nativeCheckInputs = [ attrs @@ -98,33 +99,32 @@ buildPythonPackage rec { pytestCheckHook setuptools tomli - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); - disabledTests = - [ - # fails with typing-extensions>=4.10 - # https://github.com/python/mypy/issues/17005 - "test_runtime_typing_objects" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # requires distutils - "test_c_unit_test" - ]; + disabledTests = [ + # fails with typing-extensions>=4.10 + # https://github.com/python/mypy/issues/17005 + "test_runtime_typing_objects" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # requires distutils + "test_c_unit_test" + ]; - disabledTestPaths = - [ - # fails to find tyoing_extensions - "mypy/test/testcmdline.py" - "mypy/test/testdaemon.py" - # fails to find setuptools - "mypyc/test/test_commandline.py" - # fails to find hatchling - "mypy/test/testpep561.py" - ] - ++ lib.optionals stdenv.hostPlatform.isi686 [ - # https://github.com/python/mypy/issues/15221 - "mypyc/test/test_run.py" - ]; + disabledTestPaths = [ + # fails to find tyoing_extensions + "mypy/test/testcmdline.py" + "mypy/test/testdaemon.py" + # fails to find setuptools + "mypyc/test/test_commandline.py" + # fails to find hatchling + "mypy/test/testpep561.py" + ] + ++ lib.optionals stdenv.hostPlatform.isi686 [ + # https://github.com/python/mypy/issues/15221 + "mypyc/test/test_run.py" + ]; passthru.tests = { # Failing typing checks on the test-driver result in channel blockers. diff --git a/pkgs/development/python-modules/myst-parser/default.nix b/pkgs/development/python-modules/myst-parser/default.nix index ca8edc4a3720..447ceff2c2da 100644 --- a/pkgs/development/python-modules/myst-parser/default.nix +++ b/pkgs/development/python-modules/myst-parser/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { pytest-regressions sphinx-pytest pytestCheckHook - ] ++ markdown-it-py.optional-dependencies.linkify; + ] + ++ markdown-it-py.optional-dependencies.linkify; disabledTests = [ # sphinx 8.2 compat diff --git a/pkgs/development/python-modules/nanobind/default.nix b/pkgs/development/python-modules/nanobind/default.nix index 8c6453c6fd77..3511ec93eafb 100644 --- a/pkgs/development/python-modules/nanobind/default.nix +++ b/pkgs/development/python-modules/nanobind/default.nix @@ -58,18 +58,17 @@ buildPythonPackage rec { make -j $NIX_BUILD_CORES ''; - nativeCheckInputs = - [ - pytestCheckHook - numpy - scipy - torch - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform tensorflow-bin) [ - tensorflow-bin - jax - jaxlib - ]; + nativeCheckInputs = [ + pytestCheckHook + numpy + scipy + torch + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform tensorflow-bin) [ + tensorflow-bin + jax + jaxlib + ]; passthru.tests = { pytest = nanobind.overridePythonAttrs { doCheck = true; }; diff --git a/pkgs/development/python-modules/napari/default.nix b/pkgs/development/python-modules/napari/default.nix index f6bacf9cfb33..3d49194633e6 100644 --- a/pkgs/development/python-modules/napari/default.nix +++ b/pkgs/development/python-modules/napari/default.nix @@ -97,7 +97,8 @@ mkDerivationWith buildPythonPackage rec { typing-extensions vispy wrapt - ] ++ dask.optional-dependencies.array; + ] + ++ dask.optional-dependencies.array; postFixup = '' wrapQtApp $out/bin/napari diff --git a/pkgs/development/python-modules/narwhals/default.nix b/pkgs/development/python-modules/narwhals/default.nix index 0dfe7efcfd7f..35d4ac513145 100644 --- a/pkgs/development/python-modules/narwhals/default.nix +++ b/pkgs/development/python-modules/narwhals/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { hypothesis pytest-env pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "narwhals" ]; diff --git a/pkgs/development/python-modules/nats-py/default.nix b/pkgs/development/python-modules/nats-py/default.nix index be0a09426eb1..1e620f9493bb 100644 --- a/pkgs/development/python-modules/nats-py/default.nix +++ b/pkgs/development/python-modules/nats-py/default.nix @@ -43,25 +43,24 @@ buildPythonPackage rec { uvloop ]; - disabledTests = - [ - # Timeouts - "ClientTLS" - # AssertionError - "test_fetch_n" - "test_kv_simple" - "test_pull_subscribe_limits" - "test_stream_management" - "test_subscribe_no_echo" - # Tests fail on hydra, often Time-out - "test_subscribe_iterate_next_msg" - "test_ordered_consumer_larger_streams" - "test_object_file_basics" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_subscribe_iterate_next_msg" - "test_buf_size_force_flush_timeout" - ]; + disabledTests = [ + # Timeouts + "ClientTLS" + # AssertionError + "test_fetch_n" + "test_kv_simple" + "test_pull_subscribe_limits" + "test_stream_management" + "test_subscribe_no_echo" + # Tests fail on hydra, often Time-out + "test_subscribe_iterate_next_msg" + "test_ordered_consumer_larger_streams" + "test_object_file_basics" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_subscribe_iterate_next_msg" + "test_buf_size_force_flush_timeout" + ]; pythonImportsCheck = [ "nats" ]; diff --git a/pkgs/development/python-modules/nbconvert/default.nix b/pkgs/development/python-modules/nbconvert/default.nix index a4945c93868e..82ce366bbe3c 100644 --- a/pkgs/development/python-modules/nbconvert/default.nix +++ b/pkgs/development/python-modules/nbconvert/default.nix @@ -57,24 +57,23 @@ buildPythonPackage rec { build-system = [ hatchling ]; - dependencies = - [ - beautifulsoup4 - bleach - defusedxml - jinja2 - jupyter-core - jupyterlab-pygments - markupsafe - mistune - nbclient - packaging - pandocfilters - pygments - traitlets - ] - ++ bleach.optional-dependencies.css - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + dependencies = [ + beautifulsoup4 + bleach + defusedxml + jinja2 + jupyter-core + jupyterlab-pygments + markupsafe + mistune + nbclient + packaging + pandocfilters + pygments + traitlets + ] + ++ bleach.optional-dependencies.css + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/development/python-modules/nbdime/default.nix b/pkgs/development/python-modules/nbdime/default.nix index 61f420899a2d..aa3fd2008932 100644 --- a/pkgs/development/python-modules/nbdime/default.nix +++ b/pkgs/development/python-modules/nbdime/default.nix @@ -62,24 +62,23 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; - disabledTests = - [ - # subprocess.CalledProcessError: Command '['git', 'diff', 'base', 'diff.ipynb']' returned non-zero exit status 128. - # git-nbdiffdriver diff: line 1: git-nbdiffdriver: command not found - # fatal: external diff died, stopping at diff.ipynb - "test_git_diffdriver" + disabledTests = [ + # subprocess.CalledProcessError: Command '['git', 'diff', 'base', 'diff.ipynb']' returned non-zero exit status 128. + # git-nbdiffdriver diff: line 1: git-nbdiffdriver: command not found + # fatal: external diff died, stopping at diff.ipynb + "test_git_diffdriver" - # subprocess.CalledProcessError: Command '['git', 'merge', 'remote-no-conflict']' returned non-zero exit status 1. - "test_git_mergedriver" + # subprocess.CalledProcessError: Command '['git', 'merge', 'remote-no-conflict']' returned non-zero exit status 1. + "test_git_mergedriver" - # Require network access - "test_git_difftool" - "test_git_mergetool" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # OSError: Could not find system gitattributes location! - "test_locate_gitattributes_syste" - ]; + # Require network access + "test_git_difftool" + "test_git_mergetool" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # OSError: Could not find system gitattributes location! + "test_locate_gitattributes_syste" + ]; preCheck = '' git config --global user.email "janedoe@example.com" diff --git a/pkgs/development/python-modules/ndeflib/default.nix b/pkgs/development/python-modules/ndeflib/default.nix index 883467b19fa8..a44b9aaa7999 100644 --- a/pkgs/development/python-modules/ndeflib/default.nix +++ b/pkgs/development/python-modules/ndeflib/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { disabledTests = [ # AssertionError caused due to wrong size "test_decode_error" - ] ++ lib.optionals (pythonAtLeast "3.12") [ "test_encode_error" ]; + ] + ++ lib.optionals (pythonAtLeast "3.12") [ "test_encode_error" ]; meta = with lib; { description = "Python package for parsing and generating NFC Data Exchange Format messages"; diff --git a/pkgs/development/python-modules/ndindex/default.nix b/pkgs/development/python-modules/ndindex/default.nix index 2c8fec5e26d3..c6482111d6d9 100644 --- a/pkgs/development/python-modules/ndindex/default.nix +++ b/pkgs/development/python-modules/ndindex/default.nix @@ -66,7 +66,8 @@ buildPythonPackage rec { pytest-cov-stub pytestCheckHook sympy - ] ++ optional-dependencies.arrays; + ] + ++ optional-dependencies.arrays; pytestFlagsArray = [ "--hypothesis-profile" diff --git a/pkgs/development/python-modules/ndtypes/default.nix b/pkgs/development/python-modules/ndtypes/default.nix index d3eb0a25ed01..21b13ffee682 100644 --- a/pkgs/development/python-modules/ndtypes/default.nix +++ b/pkgs/development/python-modules/ndtypes/default.nix @@ -31,14 +31,13 @@ buildPythonPackage { 'runtime_library_dirs = ["${libndtypes}/lib"]' ''; - postInstall = - '' - mkdir $out/include - cp python/ndtypes/*.h $out/include - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -add_rpath ${libndtypes}/lib $out/${python.sitePackages}/ndtypes/_ndtypes.*.so - ''; + postInstall = '' + mkdir $out/include + cp python/ndtypes/*.h $out/include + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -add_rpath ${libndtypes}/lib $out/${python.sitePackages}/ndtypes/_ndtypes.*.so + ''; checkPhase = '' pushd python diff --git a/pkgs/development/python-modules/nebula3-python/default.nix b/pkgs/development/python-modules/nebula3-python/default.nix index 0746dc19fc93..a53459ba64d0 100644 --- a/pkgs/development/python-modules/nebula3-python/default.nix +++ b/pkgs/development/python-modules/nebula3-python/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { httpx pytz six - ] ++ httpx.optional-dependencies.http2; + ] + ++ httpx.optional-dependencies.http2; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/nengo/default.nix b/pkgs/development/python-modules/nengo/default.nix index 2b0b65637704..a78933581c14 100644 --- a/pkgs/development/python-modules/nengo/default.nix +++ b/pkgs/development/python-modules/nengo/default.nix @@ -24,12 +24,11 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools ]; - propagatedBuildInputs = - [ - numpy - ] - ++ lib.optionals scipySupport [ scipy ] - ++ lib.optionals scikitSupport [ scikit-learn ]; + propagatedBuildInputs = [ + numpy + ] + ++ lib.optionals scipySupport [ scipy ] + ++ lib.optionals scikitSupport [ scikit-learn ]; # checks req missing: # pytest-allclose diff --git a/pkgs/development/python-modules/netcdf4/default.nix b/pkgs/development/python-modules/netcdf4/default.nix index 37ee4b79d3df..aa5ec4c56cc1 100644 --- a/pkgs/development/python-modules/netcdf4/default.nix +++ b/pkgs/development/python-modules/netcdf4/default.nix @@ -76,7 +76,8 @@ buildPythonPackage { NETCDF4_DIR = netcdf; CURL_DIR = curl.dev; JPEG_DIR = libjpeg.dev; - } // lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion"; }; + } + // lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion"; }; pythonImportsCheck = [ "netCDF4" ]; diff --git a/pkgs/development/python-modules/nextcord/default.nix b/pkgs/development/python-modules/nextcord/default.nix index 3b11f2fb3bcd..58d244a16e19 100644 --- a/pkgs/development/python-modules/nextcord/default.nix +++ b/pkgs/development/python-modules/nextcord/default.nix @@ -52,18 +52,17 @@ buildPythonPackage rec { poetry-dynamic-versioning ]; - dependencies = - [ - aiodns - aiohttp - brotli - orjson - pynacl - typing-extensions - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - audioop-lts - ]; + dependencies = [ + aiodns + aiohttp + brotli + orjson + pynacl + typing-extensions + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + audioop-lts + ]; # upstream has no tests doCheck = false; diff --git a/pkgs/development/python-modules/niaarm/default.nix b/pkgs/development/python-modules/niaarm/default.nix index bc71a4a970b1..c0979f4c7a4f 100644 --- a/pkgs/development/python-modules/niaarm/default.nix +++ b/pkgs/development/python-modules/niaarm/default.nix @@ -49,19 +49,19 @@ buildPythonPackage rec { pandas plotly scikit-learn - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; - disabledTests = - [ - # Test requires extra nltk data dependency - "test_text_mining" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fatal Python error: Aborted - # matplotlib/backend_bases.py", line 2654 in create_with_canvas - "test_hill_slopes" - "test_two_key_plot" - ]; + disabledTests = [ + # Test requires extra nltk data dependency + "test_text_mining" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fatal Python error: Aborted + # matplotlib/backend_bases.py", line 2654 in create_with_canvas + "test_hill_slopes" + "test_two_key_plot" + ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/nibabel/default.nix b/pkgs/development/python-modules/nibabel/default.nix index 5d81a0b8daf3..14127b352169 100644 --- a/pkgs/development/python-modules/nibabel/default.nix +++ b/pkgs/development/python-modules/nibabel/default.nix @@ -45,13 +45,12 @@ buildPythonPackage rec { hatch-vcs ]; - dependencies = - [ - numpy - packaging - ] - ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ] - ++ lib.optionals (pythonOlder "3.13") [ typing-extensions ]; + dependencies = [ + numpy + packaging + ] + ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ] + ++ lib.optionals (pythonOlder "3.13") [ typing-extensions ]; optional-dependencies = rec { all = dicom ++ dicomfs ++ minc2 ++ spm ++ zstd; @@ -70,7 +69,8 @@ buildPythonPackage rec { pytest-httpserver pytest-xdist pytest7CheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; preCheck = '' export PATH=$out/bin:$PATH diff --git a/pkgs/development/python-modules/nibe/default.nix b/pkgs/development/python-modules/nibe/default.nix index 7546524372da..0aa20d1ac16d 100644 --- a/pkgs/development/python-modules/nibe/default.nix +++ b/pkgs/development/python-modules/nibe/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { aresponses pytest-asyncio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "nibe" ]; diff --git a/pkgs/development/python-modules/nicegui/default.nix b/pkgs/development/python-modules/nicegui/default.nix index d7fd18e67dac..7dbc1e33494c 100644 --- a/pkgs/development/python-modules/nicegui/default.nix +++ b/pkgs/development/python-modules/nicegui/default.nix @@ -102,7 +102,8 @@ buildPythonPackage rec { pytestCheckHook webdriver-manager writableTmpDirAsHomeHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "nicegui" ]; diff --git a/pkgs/development/python-modules/nidaqmx/default.nix b/pkgs/development/python-modules/nidaqmx/default.nix index d0d4df2d0d6f..76b93355d968 100644 --- a/pkgs/development/python-modules/nidaqmx/default.nix +++ b/pkgs/development/python-modules/nidaqmx/default.nix @@ -44,19 +44,18 @@ buildPythonPackage rec { --replace-fail '["poetry>=1.2"]' '["poetry-core>=1.0.0"]' ''; - dependencies = - [ - numpy - deprecation - hightime - tzlocal - python-decouple - click - requests - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - distro - ]; + dependencies = [ + numpy + deprecation + hightime + tzlocal + python-decouple + click + requests + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + distro + ]; passthru.optional-dependencies = { docs = [ diff --git a/pkgs/development/python-modules/nose2/default.nix b/pkgs/development/python-modules/nose2/default.nix index cbf66277951b..68e3032cd3e6 100644 --- a/pkgs/development/python-modules/nose2/default.nix +++ b/pkgs/development/python-modules/nose2/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { nativeCheckInputs = [ unittestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); meta = with lib; { changelog = "https://github.com/nose-devs/nose2/blob/${version}/docs/changelog.rst"; diff --git a/pkgs/development/python-modules/notebook/default.nix b/pkgs/development/python-modules/notebook/default.nix index c6cdaf1e7b58..b25773185de5 100644 --- a/pkgs/development/python-modules/notebook/default.nix +++ b/pkgs/development/python-modules/notebook/default.nix @@ -42,14 +42,13 @@ buildPythonPackage rec { --replace-fail "timeout = 300" "" ''; - nativeBuildInputs = - [ - nodejs - yarn-berry_3.yarnBerryConfigHook - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - distutils - ]; + nativeBuildInputs = [ + nodejs + yarn-berry_3.yarnBerryConfigHook + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + distutils + ]; missingHashes = ./missing-hashes.json; diff --git a/pkgs/development/python-modules/notobuilder/default.nix b/pkgs/development/python-modules/notobuilder/default.nix index 7b5c7b13a585..902cddcd7b9b 100644 --- a/pkgs/development/python-modules/notobuilder/default.nix +++ b/pkgs/development/python-modules/notobuilder/default.nix @@ -53,7 +53,8 @@ buildPythonPackage { diffenator2 chevron sh - ] ++ gftools.optional-dependencies.qa; + ] + ++ gftools.optional-dependencies.qa; pythonImportsCheck = [ "notobuilder" diff --git a/pkgs/development/python-modules/notus-scanner/default.nix b/pkgs/development/python-modules/notus-scanner/default.nix index f7d6ae2eff5c..36a5ac578e97 100644 --- a/pkgs/development/python-modules/notus-scanner/default.nix +++ b/pkgs/development/python-modules/notus-scanner/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { psutil python-gnupg sentry-sdk - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/nox/default.nix b/pkgs/development/python-modules/nox/default.nix index b4d602a8c1fb..91e23202c525 100644 --- a/pkgs/development/python-modules/nox/default.nix +++ b/pkgs/development/python-modules/nox/default.nix @@ -36,16 +36,15 @@ buildPythonPackage rec { build-system = [ hatchling ]; - dependencies = - [ - argcomplete - colorlog - packaging - virtualenv - ] - ++ lib.optionals (pythonOlder "3.11") [ - tomli - ]; + dependencies = [ + argcomplete + colorlog + packaging + virtualenv + ] + ++ lib.optionals (pythonOlder "3.11") [ + tomli + ]; optional-dependencies = { tox_to_nox = [ diff --git a/pkgs/development/python-modules/nsz/default.nix b/pkgs/development/python-modules/nsz/default.nix index 368cfc25151a..75c2dc1f770b 100644 --- a/pkgs/development/python-modules/nsz/default.nix +++ b/pkgs/development/python-modules/nsz/default.nix @@ -28,7 +28,8 @@ buildPythonPackage rec { pycryptodome enlighten zstandard - ] ++ lib.optional withGUI kivy; + ] + ++ lib.optional withGUI kivy; # do not check, as nsz requires producation keys # dumped from a Nintendo Switch. diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index 4f90733b5cf7..58e0e22c4813 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -87,20 +87,19 @@ buildPythonPackage rec { llvmlite ]; - patches = - [ - (fetchpatch2 { - url = "https://github.com/numba/numba/commit/e2c8984ba60295def17e363a926d6f75e7fa9f2d.patch"; - includes = [ "numba/core/bytecode.py" ]; - hash = "sha256-HIVbp3GSmnq6W7zrRIirIbhGjJsFN3PNyHSfAE8fdDw="; - }) - ] - ++ lib.optionals cudaSupport [ - (replaceVars ./cuda_path.patch { - cuda_toolkit_path = cudatoolkit; - cuda_toolkit_lib_path = lib.getLib cudatoolkit; - }) - ]; + patches = [ + (fetchpatch2 { + url = "https://github.com/numba/numba/commit/e2c8984ba60295def17e363a926d6f75e7fa9f2d.patch"; + includes = [ "numba/core/bytecode.py" ]; + hash = "sha256-HIVbp3GSmnq6W7zrRIirIbhGjJsFN3PNyHSfAE8fdDw="; + }) + ] + ++ lib.optionals cudaSupport [ + (replaceVars ./cuda_path.patch { + cuda_toolkit_path = cudatoolkit; + cuda_toolkit_lib_path = lib.getLib cudatoolkit; + }) + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/numcodecs/default.nix b/pkgs/development/python-modules/numcodecs/default.nix index e97d766d732c..4cb141e8fb34 100644 --- a/pkgs/development/python-modules/numcodecs/default.nix +++ b/pkgs/development/python-modules/numcodecs/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook importlib-metadata - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # https://github.com/NixOS/nixpkgs/issues/255262 preCheck = "pushd $out"; diff --git a/pkgs/development/python-modules/numpy/1.nix b/pkgs/development/python-modules/numpy/1.nix index 5d7216286564..4cd993e9ba15 100644 --- a/pkgs/development/python-modules/numpy/1.nix +++ b/pkgs/development/python-modules/numpy/1.nix @@ -69,17 +69,16 @@ buildPythonPackage rec { hash = "sha256-KgKrqe0S5KxOs+qUIcQgMBoMZGDZgw10qd+H76SRIBA="; }; - patches = - [ - # Disable `numpy/core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex256]` - # on x86_64-darwin because it fails under Rosetta 2 due to issues with trig functions and - # 80-bit long double complex numbers. - ./disable-failing-long-double-test-Rosetta-2.patch - ] - # We patch cpython/distutils to fix https://bugs.python.org/issue1222585 - # Patching of numpy.distutils is needed to prevent it from undoing the - # patch to distutils. - ++ lib.optionals python.hasDistutilsCxxPatch [ ./numpy-distutils-C++.patch ]; + patches = [ + # Disable `numpy/core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex256]` + # on x86_64-darwin because it fails under Rosetta 2 due to issues with trig functions and + # 80-bit long double complex numbers. + ./disable-failing-long-double-test-Rosetta-2.patch + ] + # We patch cpython/distutils to fix https://bugs.python.org/issue1222585 + # Patching of numpy.distutils is needed to prevent it from undoing the + # patch to distutils. + ++ lib.optionals python.hasDistutilsCxxPatch [ ./numpy-distutils-C++.patch ]; postPatch = '' # fails with multiple errors because we are not using the pinned setuptools version @@ -98,15 +97,14 @@ buildPythonPackage rec { --replace-fail "meson-python>=0.15.0,<0.16.0" "meson-python" ''; - nativeBuildInputs = - [ - cython - gfortran - meson-python - pkg-config - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ xcbuild.xcrun ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; + nativeBuildInputs = [ + cython + gfortran + meson-python + pkg-config + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ xcbuild.xcrun ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; buildInputs = [ blas @@ -149,36 +147,35 @@ buildPythonPackage rec { ]; # https://github.com/numpy/numpy/issues/24548 - disabledTests = - [ - # Tries to import numpy.distutils.msvccompiler, removed in setuptools 74.0 - "test_api_importable" - ] - ++ lib.optionals stdenv.hostPlatform.isi686 [ - "test_new_policy" # AssertionError: assert False - "test_identityless_reduction_huge_array" # ValueError: Maximum allowed dimension exceeded - "test_float_remainder_overflow" # AssertionError: FloatingPointError not raised by divmod - "test_int" # AssertionError: selectedintkind(19): expected 16 but got -1 - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - "test_impossible_feature_enable" # AssertionError: Failed to generate error - "test_features" # AssertionError: Failure Detection - "test_new_policy" # AssertionError: assert False - "test_identityless_reduction_huge_array" # ValueError: Maximum allowed dimension exceeded - "test_unary_spurious_fpexception" # AssertionError: Got warnings: [] - "test_int" # AssertionError: selectedintkind(19): expected 16 but got -1 - "test_real" # AssertionError: selectedrealkind(16): expected 10 but got -1 - "test_quad_precision" # AssertionError: selectedrealkind(32): expected 16 but got -1 - "test_big_arrays" # ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger tha... - "test_multinomial_pvals_float32" # Failed: DID NOT RAISE - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - "test_big_arrays" # OOM on a 16G machine - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # can fail on virtualized machines confused over their cpu identity - "test_dispatcher" - ]; + disabledTests = [ + # Tries to import numpy.distutils.msvccompiler, removed in setuptools 74.0 + "test_api_importable" + ] + ++ lib.optionals stdenv.hostPlatform.isi686 [ + "test_new_policy" # AssertionError: assert False + "test_identityless_reduction_huge_array" # ValueError: Maximum allowed dimension exceeded + "test_float_remainder_overflow" # AssertionError: FloatingPointError not raised by divmod + "test_int" # AssertionError: selectedintkind(19): expected 16 but got -1 + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + "test_impossible_feature_enable" # AssertionError: Failed to generate error + "test_features" # AssertionError: Failure Detection + "test_new_policy" # AssertionError: assert False + "test_identityless_reduction_huge_array" # ValueError: Maximum allowed dimension exceeded + "test_unary_spurious_fpexception" # AssertionError: Got warnings: [] + "test_int" # AssertionError: selectedintkind(19): expected 16 but got -1 + "test_real" # AssertionError: selectedrealkind(16): expected 10 but got -1 + "test_quad_precision" # AssertionError: selectedrealkind(32): expected 16 but got -1 + "test_big_arrays" # ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger tha... + "test_multinomial_pvals_float32" # Failed: DID NOT RAISE + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + "test_big_arrays" # OOM on a 16G machine + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # can fail on virtualized machines confused over their cpu identity + "test_dispatcher" + ]; passthru = { # just for backwards compatibility diff --git a/pkgs/development/python-modules/numpy/2.nix b/pkgs/development/python-modules/numpy/2.nix index 6d8dbbeb3bd4..c9a4ea304dcd 100644 --- a/pkgs/development/python-modules/numpy/2.nix +++ b/pkgs/development/python-modules/numpy/2.nix @@ -83,15 +83,14 @@ buildPythonPackage rec { --replace-fail 'py.full_path()' "'python'" ''; - build-system = - [ - cython - gfortran - meson-python - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcrun ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; + build-system = [ + cython + gfortran + meson-python + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcrun ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ mesonEmulatorHook ]; # we default openblas to build with 64 threads # if a machine has more than 64 threads, it will segfault @@ -136,36 +135,35 @@ buildPythonPackage rec { "not\\ slow" # fast test suite ]; - disabledTests = - [ - # Tries to import numpy.distutils.msvccompiler, removed in setuptools 74.0 - "test_api_importable" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/numpy/numpy/issues/26713 - "test_iter_refcount" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - # https://github.com/numpy/numpy/issues/24548 - "test_impossible_feature_enable" # AssertionError: Failed to generate error - "test_features" # AssertionError: Failure Detection - "test_new_policy" # AssertionError: assert False - "test_identityless_reduction_huge_array" # ValueError: Maximum allowed dimension exceeded - "test_unary_spurious_fpexception" # AssertionError: Got warnings: [] - "test_int" # AssertionError: selectedintkind(19): expected 16 but got -1 - "test_real" # AssertionError: selectedrealkind(16): expected 10 but got -1 - "test_quad_precision" # AssertionError: selectedrealkind(32): expected 16 but got -1 - "test_big_arrays" # ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger tha... - "test_multinomial_pvals_float32" # Failed: DID NOT RAISE - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # AssertionError: (np.int64(0), np.longdouble('9.9999999999999994515e-21'), np.longdouble('3.9696755572509052902e+20'), 'arctanh') - "test_loss_of_precision" - ] - ++ lib.optionals (stdenv.hostPlatform ? gcc.arch) [ - # remove if https://github.com/numpy/numpy/issues/27460 is resolved - "test_validate_transcendentals" - ]; + disabledTests = [ + # Tries to import numpy.distutils.msvccompiler, removed in setuptools 74.0 + "test_api_importable" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/numpy/numpy/issues/26713 + "test_iter_refcount" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + # https://github.com/numpy/numpy/issues/24548 + "test_impossible_feature_enable" # AssertionError: Failed to generate error + "test_features" # AssertionError: Failure Detection + "test_new_policy" # AssertionError: assert False + "test_identityless_reduction_huge_array" # ValueError: Maximum allowed dimension exceeded + "test_unary_spurious_fpexception" # AssertionError: Got warnings: [] + "test_int" # AssertionError: selectedintkind(19): expected 16 but got -1 + "test_real" # AssertionError: selectedrealkind(16): expected 10 but got -1 + "test_quad_precision" # AssertionError: selectedrealkind(32): expected 16 but got -1 + "test_big_arrays" # ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger tha... + "test_multinomial_pvals_float32" # Failed: DID NOT RAISE + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # AssertionError: (np.int64(0), np.longdouble('9.9999999999999994515e-21'), np.longdouble('3.9696755572509052902e+20'), 'arctanh') + "test_loss_of_precision" + ] + ++ lib.optionals (stdenv.hostPlatform ? gcc.arch) [ + # remove if https://github.com/numpy/numpy/issues/27460 is resolved + "test_validate_transcendentals" + ]; passthru = { # just for backwards compatibility diff --git a/pkgs/development/python-modules/numpyro/default.nix b/pkgs/development/python-modules/numpyro/default.nix index c80c6062ae7f..5546586b7d07 100644 --- a/pkgs/development/python-modules/numpyro/default.nix +++ b/pkgs/development/python-modules/numpyro/default.nix @@ -75,29 +75,28 @@ buildPythonPackage rec { "-Wignore::UserWarning" ]; - disabledTests = - [ - # AssertionError, assert GLOBAL["count"] == 4 (assert 5 == 4) - "test_mcmc_parallel_chain" + disabledTests = [ + # AssertionError, assert GLOBAL["count"] == 4 (assert 5 == 4) + "test_mcmc_parallel_chain" - # AssertionError due to tolerance issues - "test_bijective_transforms" - "test_cpu" - "test_entropy_categorical" - "test_gaussian_model" + # AssertionError due to tolerance issues + "test_bijective_transforms" + "test_cpu" + "test_entropy_categorical" + "test_gaussian_model" - # > with pytest.warns(UserWarning, match="Hessian of log posterior"): - # E Failed: DID NOT WARN. No warnings of type (,) were emitted. - # E Emitted warnings: []. - "test_laplace_approximation_warning" + # > with pytest.warns(UserWarning, match="Hessian of log posterior"): + # E Failed: DID NOT WARN. No warnings of type (,) were emitted. + # E Emitted warnings: []. + "test_laplace_approximation_warning" - # ValueError: compiling computation that requires 2 logical devices, but only 1 XLA devices are available (num_replicas=2) - "test_chain" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # AssertionError: Not equal to tolerance rtol=0.06, atol=0 - "test_functional_map" - ]; + # ValueError: compiling computation that requires 2 logical devices, but only 1 XLA devices are available (num_replicas=2) + "test_chain" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # AssertionError: Not equal to tolerance rtol=0.06, atol=0 + "test_functional_map" + ]; disabledTestPaths = [ # Require internet access diff --git a/pkgs/development/python-modules/nutils/default.nix b/pkgs/development/python-modules/nutils/default.nix index ee7b23f027b9..2c720c5cc3d7 100644 --- a/pkgs/development/python-modules/nutils/default.nix +++ b/pkgs/development/python-modules/nutils/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pkgs.graphviz pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # Error: invalid value 'x' for farg: loading 'x' as float diff --git a/pkgs/development/python-modules/nvchecker/default.nix b/pkgs/development/python-modules/nvchecker/default.nix index 7356b900ff19..fe1461b78801 100644 --- a/pkgs/development/python-modules/nvchecker/default.nix +++ b/pkgs/development/python-modules/nvchecker/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { platformdirs tornado pycurl - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/oauthenticator/default.nix b/pkgs/development/python-modules/oauthenticator/default.nix index 4a1b92734351..63afaab59a7c 100644 --- a/pkgs/development/python-modules/oauthenticator/default.nix +++ b/pkgs/development/python-modules/oauthenticator/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { pytest-cov-stub pytestCheckHook requests-mock - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = [ # Tests are outdated, https://github.com/jupyterhub/oauthenticator/issues/432 diff --git a/pkgs/development/python-modules/oauthlib/default.nix b/pkgs/development/python-modules/oauthlib/default.nix index ea504ea4f621..9fd14254fd49 100644 --- a/pkgs/development/python-modules/oauthlib/default.nix +++ b/pkgs/development/python-modules/oauthlib/default.nix @@ -46,16 +46,16 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); - disabledTests = - [ - # https://github.com/oauthlib/oauthlib/issues/877 - "test_rsa_bad_keys" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - "test_filter_params" - ]; + disabledTests = [ + # https://github.com/oauthlib/oauthlib/issues/877 + "test_rsa_bad_keys" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + "test_filter_params" + ]; pythonImportsCheck = [ "oauthlib" ]; diff --git a/pkgs/development/python-modules/odc-geo/default.nix b/pkgs/development/python-modules/odc-geo/default.nix index c2d4b7f2b922..50c3cd542465 100644 --- a/pkgs/development/python-modules/odc-geo/default.nix +++ b/pkgs/development/python-modules/odc-geo/default.nix @@ -79,7 +79,8 @@ buildPythonPackage rec { geopandas matplotlib pytestCheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; pytestFlagsArray = [ "-m 'not network'" ]; diff --git a/pkgs/development/python-modules/odc-loader/default.nix b/pkgs/development/python-modules/odc-loader/default.nix index a970591f199e..e97bb7e87dc6 100644 --- a/pkgs/development/python-modules/odc-loader/default.nix +++ b/pkgs/development/python-modules/odc-loader/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { nativeCheckInputs = [ geopandas pytestCheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; disabledTests = [ # Require internet access diff --git a/pkgs/development/python-modules/odc-stac/default.nix b/pkgs/development/python-modules/odc-stac/default.nix index 71cc7bce6ffc..9cb54e152e24 100644 --- a/pkgs/development/python-modules/odc-stac/default.nix +++ b/pkgs/development/python-modules/odc-stac/default.nix @@ -66,7 +66,8 @@ buildPythonPackage rec { distributed pystac-client pytestCheckHook - ] ++ optional-dependencies.botocore; + ] + ++ optional-dependencies.botocore; pytestFlagsArray = [ "-m 'not network'" ]; diff --git a/pkgs/development/python-modules/okonomiyaki/default.nix b/pkgs/development/python-modules/okonomiyaki/default.nix index 3c7ed859e6c4..5f57b9968304 100644 --- a/pkgs/development/python-modules/okonomiyaki/default.nix +++ b/pkgs/development/python-modules/okonomiyaki/default.nix @@ -62,17 +62,17 @@ buildPythonPackage rec { parameterized pytestCheckHook testfixtures - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); - preCheck = - '' - substituteInPlace okonomiyaki/runtimes/tests/test_runtime.py \ - --replace-fail 'runtime_info = PythonRuntime.from_running_python()' 'raise unittest.SkipTest() #' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace okonomiyaki/platforms/tests/test_pep425.py \ - --replace-fail 'self.assertEqual(platform_tag, self.tag.platform)' 'raise unittest.SkipTest()' - ''; + preCheck = '' + substituteInPlace okonomiyaki/runtimes/tests/test_runtime.py \ + --replace-fail 'runtime_info = PythonRuntime.from_running_python()' 'raise unittest.SkipTest() #' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace okonomiyaki/platforms/tests/test_pep425.py \ + --replace-fail 'self.assertEqual(platform_tag, self.tag.platform)' 'raise unittest.SkipTest()' + ''; pythonImportsCheck = [ "okonomiyaki" ]; diff --git a/pkgs/development/python-modules/ome-zarr/default.nix b/pkgs/development/python-modules/ome-zarr/default.nix index 4adc430736f4..ba6a6946dccc 100644 --- a/pkgs/development/python-modules/ome-zarr/default.nix +++ b/pkgs/development/python-modules/ome-zarr/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { scikit-image toolz zarr - ] ++ fsspec.optional-dependencies.s3; + ] + ++ fsspec.optional-dependencies.s3; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/omegaconf/default.nix b/pkgs/development/python-modules/omegaconf/default.nix index 0c9e7ab833fe..b985b62ec2c9 100644 --- a/pkgs/development/python-modules/omegaconf/default.nix +++ b/pkgs/development/python-modules/omegaconf/default.nix @@ -70,17 +70,16 @@ buildPythonPackage rec { "ignore::DeprecationWarning" ]; - disabledTests = - [ - # assert (1560791320562868035 == 1560791320562868035) == False - "test_eq" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # pathlib._local.Path != pathlib.Path type check mismatch - "test_errors" - "test_to_yaml" - "test_type_str" - ]; + disabledTests = [ + # assert (1560791320562868035 == 1560791320562868035) == False + "test_eq" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # pathlib._local.Path != pathlib.Path type check mismatch + "test_errors" + "test_to_yaml" + "test_type_str" + ]; meta = with lib; { description = "Framework for configuring complex applications"; diff --git a/pkgs/development/python-modules/onnxruntime/default.nix b/pkgs/development/python-modules/onnxruntime/default.nix index 1de9d7d92c42..6848b811518f 100644 --- a/pkgs/development/python-modules/onnxruntime/default.nix +++ b/pkgs/development/python-modules/onnxruntime/default.nix @@ -45,30 +45,29 @@ buildPythonPackage { ]; # Libraries are not linked correctly. - buildInputs = - [ - oneDNN - re2 - onnxruntime.protobuf + buildInputs = [ + oneDNN + re2 + onnxruntime.protobuf - # https://github.com/NixOS/nixpkgs/pull/357656 patches the onnx lib to ${pkgs.onnxruntime}/lib - # but these files are copied into this package too. If the original non-python onnxruntime - # package is GC-ed, cuda support in this python package will break. - # Two options, rebuild onnxruntime twice with the different paths hard-coded, or just hold a runtime - # dependency between the two. Option 2, because onnxruntime takes forever to build with cuda support. - onnxruntime + # https://github.com/NixOS/nixpkgs/pull/357656 patches the onnx lib to ${pkgs.onnxruntime}/lib + # but these files are copied into this package too. If the original non-python onnxruntime + # package is GC-ed, cuda support in this python package will break. + # Two options, rebuild onnxruntime twice with the different paths hard-coded, or just hold a runtime + # dependency between the two. Option 2, because onnxruntime takes forever to build with cuda support. + onnxruntime + ] + ++ lib.optionals onnxruntime.passthru.cudaSupport ( + with onnxruntime.passthru.cudaPackages; + [ + libcublas # libcublasLt.so.XX libcublas.so.XX + libcurand # libcurand.so.XX + libcufft # libcufft.so.XX + cudnn # libcudnn.soXX + cuda_cudart # libcudart.so.XX + nccl # libnccl.so.XX ] - ++ lib.optionals onnxruntime.passthru.cudaSupport ( - with onnxruntime.passthru.cudaPackages; - [ - libcublas # libcublasLt.so.XX libcublas.so.XX - libcurand # libcurand.so.XX - libcufft # libcufft.so.XX - cudnn # libcudnn.soXX - cuda_cudart # libcudart.so.XX - nccl # libnccl.so.XX - ] - ); + ); propagatedBuildInputs = [ coloredlogs diff --git a/pkgs/development/python-modules/onvif-zeep-async/default.nix b/pkgs/development/python-modules/onvif-zeep-async/default.nix index a09449f2002b..d02a403e7388 100644 --- a/pkgs/development/python-modules/onvif-zeep-async/default.nix +++ b/pkgs/development/python-modules/onvif-zeep-async/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { ciso8601 yarl zeep - ] ++ zeep.optional-dependencies.async; + ] + ++ zeep.optional-dependencies.async; pythonImportsCheck = [ "onvif" ]; diff --git a/pkgs/development/python-modules/open-clip-torch/default.nix b/pkgs/development/python-modules/open-clip-torch/default.nix index bef5ea802b4b..e35c30030bda 100644 --- a/pkgs/development/python-modules/open-clip-torch/default.nix +++ b/pkgs/development/python-modules/open-clip-torch/default.nix @@ -70,23 +70,22 @@ buildPythonPackage rec { # KeyError: Caught KeyError in DataLoader worker process 0 disabledTestPaths = [ "tests/test_wds.py" ]; - disabledTests = - [ - # requires network - "test_download_pretrained_from_hfh" - "test_inference_simple" - "test_inference_with_data" - "test_pretrained_text_encoder" - "test_training_mt5" - # fails due to type errors - "test_num_shards" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ - "test_training" - "test_training_coca" - "test_training_unfreezing_vit" - "test_training_clip_with_jit" - ]; + disabledTests = [ + # requires network + "test_download_pretrained_from_hfh" + "test_inference_simple" + "test_inference_with_data" + "test_pretrained_text_encoder" + "test_training_mt5" + # fails due to type errors + "test_num_shards" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ + "test_training" + "test_training_coca" + "test_training_unfreezing_vit" + "test_training_clip_with_jit" + ]; meta = { description = "Open source implementation of CLIP"; diff --git a/pkgs/development/python-modules/openai-whisper/default.nix b/pkgs/development/python-modules/openai-whisper/default.nix index 0c6e39ad44ec..b15bcefd1503 100644 --- a/pkgs/development/python-modules/openai-whisper/default.nix +++ b/pkgs/development/python-modules/openai-whisper/default.nix @@ -53,7 +53,8 @@ buildPythonPackage rec { tiktoken torch tqdm - ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform triton) [ triton ]; + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform triton) [ triton ]; nativeCheckInputs = [ pytestCheckHook @@ -61,19 +62,18 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; - disabledTests = - [ - # requires network access to download models - "test_transcribe" + disabledTests = [ + # requires network access to download models + "test_transcribe" - # requires NVIDIA drivers - "test_dtw_cuda_equivalence" - "test_median_filter_equivalence" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Fatal Python error: Segmentation fault - "test_dtw" - ]; + # requires NVIDIA drivers + "test_dtw_cuda_equivalence" + "test_median_filter_equivalence" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Fatal Python error: Segmentation fault + "test_dtw" + ]; meta = { changelog = "https://github.com/openai/whisper/blob/v${version}/CHANGELOG.md"; diff --git a/pkgs/development/python-modules/openai/default.nix b/pkgs/development/python-modules/openai/default.nix index 51aaf43caf5a..faeae18bc9c6 100644 --- a/pkgs/development/python-modules/openai/default.nix +++ b/pkgs/development/python-modules/openai/default.nix @@ -68,19 +68,18 @@ buildPythonPackage rec { hatch-fancy-pypi-readme ]; - dependencies = - [ - anyio - distro - httpx - jiter - pydantic - sniffio - tqdm - typing-extensions - ] - ++ lib.optionals withRealtime optional-dependencies.realtime - ++ lib.optionals withVoiceHelpers optional-dependencies.voice-helpers; + dependencies = [ + anyio + distro + httpx + jiter + pydantic + sniffio + tqdm + typing-extensions + ] + ++ lib.optionals withRealtime optional-dependencies.realtime + ++ lib.optionals withVoiceHelpers optional-dependencies.voice-helpers; optional-dependencies = { # `httpx_aiohttp` not currently in `nixpkgs` @@ -119,16 +118,15 @@ buildPythonPackage rec { "-Wignore::DeprecationWarning" ]; - disabledTests = - [ - # Tests make network requests - "test_copy_build_request" - "test_basic_attribute_access_works" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # RuntimeWarning: coroutine method 'aclose' of 'AsyncStream._iter_events' was never awaited - "test_multi_byte_character_multiple_chunks" - ]; + disabledTests = [ + # Tests make network requests + "test_copy_build_request" + "test_basic_attribute_access_works" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # RuntimeWarning: coroutine method 'aclose' of 'AsyncStream._iter_events' was never awaited + "test_multi_byte_character_multiple_chunks" + ]; disabledTestPaths = [ # Test makes network requests diff --git a/pkgs/development/python-modules/openapi-core/default.nix b/pkgs/development/python-modules/openapi-core/default.nix index 49191376d940..639d273bb3df 100644 --- a/pkgs/development/python-modules/openapi-core/default.nix +++ b/pkgs/development/python-modules/openapi-core/default.nix @@ -82,7 +82,8 @@ buildPythonPackage rec { pytestCheckHook responses webob - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTestPaths = [ # Requires secrets and additional configuration diff --git a/pkgs/development/python-modules/openapi-spec-validator/default.nix b/pkgs/development/python-modules/openapi-spec-validator/default.nix index 425df62257c6..7bb12970bd87 100644 --- a/pkgs/development/python-modules/openapi-spec-validator/default.nix +++ b/pkgs/development/python-modules/openapi-spec-validator/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { jsonschema-path lazy-object-proxy openapi-schema-validator - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/opencamlib/default.nix b/pkgs/development/python-modules/opencamlib/default.nix index 82b817adae30..101482b80711 100644 --- a/pkgs/development/python-modules/opencamlib/default.nix +++ b/pkgs/development/python-modules/opencamlib/default.nix @@ -29,7 +29,8 @@ buildPythonPackage rec { buildInputs = [ boost - ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; nativeBuildInputs = [ cmake diff --git a/pkgs/development/python-modules/openfga-sdk/default.nix b/pkgs/development/python-modules/openfga-sdk/default.nix index 37368c4deb21..0b2305b6de1d 100644 --- a/pkgs/development/python-modules/openfga-sdk/default.nix +++ b/pkgs/development/python-modules/openfga-sdk/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { mock pytest-cov-stub pytestCheckHook - ] ++ lib.optionals (pythonAtLeast "3.13") [ pytest-asyncio ]; + ] + ++ lib.optionals (pythonAtLeast "3.13") [ pytest-asyncio ]; disabledTests = lib.optionals (pythonAtLeast "3.13") [ # These fail due to a race condition in the test mocks diff --git a/pkgs/development/python-modules/openpyxl/default.nix b/pkgs/development/python-modules/openpyxl/default.nix index b1754a3620c9..e7c62ed57f02 100644 --- a/pkgs/development/python-modules/openpyxl/default.nix +++ b/pkgs/development/python-modules/openpyxl/default.nix @@ -42,29 +42,28 @@ buildPythonPackage rec { "-Wignore::DeprecationWarning" ]; - disabledTests = - [ - # Tests broken since lxml 2.12; https://foss.heptapod.net/openpyxl/openpyxl/-/issues/2116 - "test_read" - "test_read_comments" - "test_ignore_external_blip" - "test_from_xml" - "test_filenames" - "test_exts" - "test_from_complex" - "test_merge_named_styles" - "test_unprotected_cell" - "test_none_values" - "test_rgb_colors" - "test_named_styles" - "test_read_ole_link" - ] - ++ lib.optionals (pythonAtLeast "3.11") [ - "test_broken_sheet_ref" - "test_name_invalid_index" - "test_defined_names_print_area" - "test_no_styles" - ]; + disabledTests = [ + # Tests broken since lxml 2.12; https://foss.heptapod.net/openpyxl/openpyxl/-/issues/2116 + "test_read" + "test_read_comments" + "test_ignore_external_blip" + "test_from_xml" + "test_filenames" + "test_exts" + "test_from_complex" + "test_merge_named_styles" + "test_unprotected_cell" + "test_none_values" + "test_rgb_colors" + "test_named_styles" + "test_read_ole_link" + ] + ++ lib.optionals (pythonAtLeast "3.11") [ + "test_broken_sheet_ref" + "test_name_invalid_index" + "test_defined_names_print_area" + "test_no_styles" + ]; pythonImportsCheck = [ "openpyxl" ]; diff --git a/pkgs/development/python-modules/opensearch-py/default.nix b/pkgs/development/python-modules/opensearch-py/default.nix index 0b50d63397e4..eac58de9c268 100644 --- a/pkgs/development/python-modules/opensearch-py/default.nix +++ b/pkgs/development/python-modules/opensearch-py/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { pytestCheckHook pyyaml pytz - ] ++ optional-dependencies.async; + ] + ++ optional-dependencies.async; __darwinAllowLocalNetworking = true; @@ -73,21 +74,20 @@ buildPythonPackage rec { "test_opensearchpy/test_server_secured" ]; - disabledTests = - [ - # finds our ca-bundle, but expects something else (/path/to/clientcert/dir or None) - "test_ca_certs_ssl_cert_dir" - "test_no_ca_certs" + disabledTests = [ + # finds our ca-bundle, but expects something else (/path/to/clientcert/dir or None) + "test_ca_certs_ssl_cert_dir" + "test_no_ca_certs" - # Failing tests, issue opened at https://github.com/opensearch-project/opensearch-py/issues/849 - "test_basicauth_in_request_session" - "test_callable_in_request_session" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86) [ - # Flaky tests: OSError: [Errno 48] Address already in use - "test_redirect_failure_when_allow_redirect_false" - "test_redirect_success_when_allow_redirect_true" - ]; + # Failing tests, issue opened at https://github.com/opensearch-project/opensearch-py/issues/849 + "test_basicauth_in_request_session" + "test_callable_in_request_session" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86) [ + # Flaky tests: OSError: [Errno 48] Address already in use + "test_redirect_failure_when_allow_redirect_false" + "test_redirect_success_when_allow_redirect_true" + ]; meta = { description = "Python low-level client for OpenSearch"; diff --git a/pkgs/development/python-modules/opensfm/default.nix b/pkgs/development/python-modules/opensfm/default.nix index 58f6003d7c5a..fb56ece3d4d6 100644 --- a/pkgs/development/python-modules/opensfm/default.nix +++ b/pkgs/development/python-modules/opensfm/default.nix @@ -122,15 +122,14 @@ buildPythonPackage rec { "-Sopensfm/src" ]; - disabledTests = - [ - "test_run_all" # Matplotlib issues. Broken integration is less useless than a broken build - "test_match_candidates_from_metadata_bow" # flaky - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_reconstruction_incremental" - "test_reconstruction_triangulation" - ]; + disabledTests = [ + "test_run_all" # Matplotlib issues. Broken integration is less useless than a broken build + "test_match_candidates_from_metadata_bow" # flaky + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_reconstruction_incremental" + "test_reconstruction_triangulation" + ]; pythonImportsCheck = [ "opensfm" ]; diff --git a/pkgs/development/python-modules/openstacksdk/tests.nix b/pkgs/development/python-modules/openstacksdk/tests.nix index c5bbc68e3d6c..8d9c5ac992f9 100644 --- a/pkgs/development/python-modules/openstacksdk/tests.nix +++ b/pkgs/development/python-modules/openstacksdk/tests.nix @@ -35,41 +35,40 @@ buildPythonPackage { testscenarios ]; - checkPhase = - '' - stestr run -e <(echo " - '' - + lib.optionalString stdenv.hostPlatform.isAarch64 '' - openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_node_set_provision_state_with_retries - openstack.tests.unit.cloud.test_role_assignment.TestRoleAssignment.test_grant_role_user_domain_exists - openstack.tests.unit.cloud.test_volume_backups.TestVolumeBackups.test_delete_volume_backup_force - openstack.tests.unit.object_store.v1.test_proxy.TestTempURLBytesPathAndKey.test_set_account_temp_url_key_second - openstack.tests.unit.cloud.test_security_groups.TestSecurityGroups.test_delete_security_group_neutron_not_found - '' - + '' - openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_wait_for_baremetal_node_lock_locked - openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_inspect_failed - openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_available_wait - openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_wait - openstack.tests.unit.cloud.test_image.TestImage.test_create_image_task - openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_error_396 - openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_wait - openstack.tests.unit.image.v2.test_proxy.TestTask.test_wait_for_task_error_396 - openstack.tests.unit.image.v2.test_proxy.TestTask.test_wait_for_task_wait - openstack.tests.unit.test_resource.TestWaitForDelete.test_callback - openstack.tests.unit.test_resource.TestWaitForDelete.test_callback_without_progress - openstack.tests.unit.test_resource.TestWaitForDelete.test_status - openstack.tests.unit.test_resource.TestWaitForDelete.test_success_not_found - openstack.tests.unit.test_resource.TestWaitForStatus.test_callback - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails_different_attribute - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match - openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match_with_none - openstack.tests.unit.test_stats.TestStats.test_list_projects - openstack.tests.unit.test_stats.TestStats.test_projects - openstack.tests.unit.test_stats.TestStats.test_servers - openstack.tests.unit.test_stats.TestStats.test_servers_no_detail - openstack.tests.unit.test_stats.TestStats.test_timeout - ") - ''; + checkPhase = '' + stestr run -e <(echo " + '' + + lib.optionalString stdenv.hostPlatform.isAarch64 '' + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_node_set_provision_state_with_retries + openstack.tests.unit.cloud.test_role_assignment.TestRoleAssignment.test_grant_role_user_domain_exists + openstack.tests.unit.cloud.test_volume_backups.TestVolumeBackups.test_delete_volume_backup_force + openstack.tests.unit.object_store.v1.test_proxy.TestTempURLBytesPathAndKey.test_set_account_temp_url_key_second + openstack.tests.unit.cloud.test_security_groups.TestSecurityGroups.test_delete_security_group_neutron_not_found + '' + + '' + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_wait_for_baremetal_node_lock_locked + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_inspect_failed + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_available_wait + openstack.tests.unit.cloud.test_baremetal_node.TestBaremetalNode.test_inspect_machine_wait + openstack.tests.unit.cloud.test_image.TestImage.test_create_image_task + openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_error_396 + openstack.tests.unit.image.v2.test_proxy.TestImageProxy.test_wait_for_task_wait + openstack.tests.unit.image.v2.test_proxy.TestTask.test_wait_for_task_error_396 + openstack.tests.unit.image.v2.test_proxy.TestTask.test_wait_for_task_wait + openstack.tests.unit.test_resource.TestWaitForDelete.test_callback + openstack.tests.unit.test_resource.TestWaitForDelete.test_callback_without_progress + openstack.tests.unit.test_resource.TestWaitForDelete.test_status + openstack.tests.unit.test_resource.TestWaitForDelete.test_success_not_found + openstack.tests.unit.test_resource.TestWaitForStatus.test_callback + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_fails_different_attribute + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match + openstack.tests.unit.test_resource.TestWaitForStatus.test_status_match_with_none + openstack.tests.unit.test_stats.TestStats.test_list_projects + openstack.tests.unit.test_stats.TestStats.test_projects + openstack.tests.unit.test_stats.TestStats.test_servers + openstack.tests.unit.test_stats.TestStats.test_servers_no_detail + openstack.tests.unit.test_stats.TestStats.test_timeout + ") + ''; } diff --git a/pkgs/development/python-modules/opentelemetry-instrumentation-django/default.nix b/pkgs/development/python-modules/opentelemetry-instrumentation-django/default.nix index a8b14f1cfd2c..d5608a832a53 100644 --- a/pkgs/development/python-modules/opentelemetry-instrumentation-django/default.nix +++ b/pkgs/development/python-modules/opentelemetry-instrumentation-django/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { nativeCheckInputs = [ opentelemetry-test-utils pytestCheckHook - ] ++ optional-dependencies.asgi; + ] + ++ optional-dependencies.asgi; pythonImportsCheck = [ "opentelemetry.instrumentation.django" ]; diff --git a/pkgs/development/python-modules/openusd/default.nix b/pkgs/development/python-modules/openusd/default.nix index 79261e4bd95e..32937c89d3ed 100644 --- a/pkgs/development/python-modules/openusd/default.nix +++ b/pkgs/development/python-modules/openusd/default.nix @@ -101,76 +101,72 @@ buildPythonPackage rec { (lib.cmakeBool "PXR_ENABLE_OSL_SUPPORT" (!stdenv.hostPlatform.isDarwin && withOsl)) ]; - nativeBuildInputs = - [ - cmake - ninja - setuptools - opensubdiv.dev - opensubdiv.static - ] - ++ lib.optionals withDocs [ - git - graphviz-nox - doxygen - ] - ++ lib.optionals withUsdView [ qt6.wrapQtAppsHook ]; + nativeBuildInputs = [ + cmake + ninja + setuptools + opensubdiv.dev + opensubdiv.static + ] + ++ lib.optionals withDocs [ + git + graphviz-nox + doxygen + ] + ++ lib.optionals withUsdView [ qt6.wrapQtAppsHook ]; - buildInputs = - [ - alembic.dev - bison - draco - embree - flex - imath - materialx - opencolorio - openimageio - ptex - tbb - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libX11 - libXt - ] - ++ lib.optionals withOsl [ osl ] - ++ lib.optionals withUsdView [ qt6.qtbase ] - ++ lib.optionals (withUsdView && stdenv.hostPlatform.isLinux) [ qt6.qtwayland ]; + buildInputs = [ + alembic.dev + bison + draco + embree + flex + imath + materialx + opencolorio + openimageio + ptex + tbb + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libX11 + libXt + ] + ++ lib.optionals withOsl [ osl ] + ++ lib.optionals withUsdView [ qt6.qtbase ] + ++ lib.optionals (withUsdView && stdenv.hostPlatform.isLinux) [ qt6.qtwayland ]; - propagatedBuildInputs = - [ - boost - jinja2 - numpy - opensubdiv - pyopengl - distutils - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libGL - ] - ++ lib.optionals (withTools || withUsdView) [ - pyside-tools-uic - pyside6 - ] - ++ lib.optionals withUsdView [ pyqt6 ]; + propagatedBuildInputs = [ + boost + jinja2 + numpy + opensubdiv + pyopengl + distutils + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libGL + ] + ++ lib.optionals (withTools || withUsdView) [ + pyside-tools-uic + pyside6 + ] + ++ lib.optionals withUsdView [ pyqt6 ]; pythonImportsCheck = [ "pxr" "pxr.Usd" ]; - postInstall = - '' - # Make python lib properly accessible - target_dir=$out/${python.sitePackages} - mkdir -p $(dirname $target_dir) - mv $out/lib/python $target_dir - '' - + lib.optionalString withDocs '' - mv $out/docs $doc - ''; + postInstall = '' + # Make python lib properly accessible + target_dir=$out/${python.sitePackages} + mkdir -p $(dirname $target_dir) + mv $out/lib/python $target_dir + '' + + lib.optionalString withDocs '' + mv $out/docs $doc + ''; meta = { description = "Universal Scene Description"; diff --git a/pkgs/development/python-modules/optimum/default.nix b/pkgs/development/python-modules/optimum/default.nix index c86b3c501445..79959c3a651e 100644 --- a/pkgs/development/python-modules/optimum/default.nix +++ b/pkgs/development/python-modules/optimum/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { packaging torch transformers - ] ++ transformers.optional-dependencies.sentencepiece; + ] + ++ transformers.optional-dependencies.sentencepiece; optional-dependencies = { onnxruntime = [ diff --git a/pkgs/development/python-modules/optuna/default.nix b/pkgs/development/python-modules/optuna/default.nix index 8bb8d9e5d8a5..007b43ef6bfc 100644 --- a/pkgs/development/python-modules/optuna/default.nix +++ b/pkgs/development/python-modules/optuna/default.nix @@ -89,56 +89,54 @@ buildPythonPackage rec { sed -i '/"grpc",/d' optuna/testing/storages.py ''; - nativeCheckInputs = - [ - addBinToPathHook - fakeredis - kaleido - moto - pytest-xdist - pytestCheckHook - torch - versionCheckHook - ] - ++ fakeredis.optional-dependencies.lua - ++ optional-dependencies.optional; + nativeCheckInputs = [ + addBinToPathHook + fakeredis + kaleido + moto + pytest-xdist + pytestCheckHook + torch + versionCheckHook + ] + ++ fakeredis.optional-dependencies.lua + ++ optional-dependencies.optional; versionCheckProgramArg = "--version"; - disabledTests = - [ - # ValueError: Transform failed with error code 525: error creating static canvas/context for image server - "test_get_pareto_front_plot" - # too narrow time limit - "test_get_timeline_plot_with_killed_running_trials" - # times out under load - "test_optimize_with_progbar_timeout" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # ValueError: Failed to start Kaleido subprocess. Error stream - # kaleido/executable/kaleido: line 5: 5956 Illegal instruction: 4 ./bin/kaleido $@ - "test_get_optimization_history_plot" - "test_plot_intermediate_values" - "test_plot_rank" - "test_plot_terminator_improvement" + disabledTests = [ + # ValueError: Transform failed with error code 525: error creating static canvas/context for image server + "test_get_pareto_front_plot" + # too narrow time limit + "test_get_timeline_plot_with_killed_running_trials" + # times out under load + "test_optimize_with_progbar_timeout" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # ValueError: Failed to start Kaleido subprocess. Error stream + # kaleido/executable/kaleido: line 5: 5956 Illegal instruction: 4 ./bin/kaleido $@ + "test_get_optimization_history_plot" + "test_plot_intermediate_values" + "test_plot_rank" + "test_plot_terminator_improvement" - # Fatal Python error: Aborted - # matplotlib/backend_bases.py", line 2654 in create_with_canvas - "test_edf_plot_no_trials" - "test_get_timeline_plot" - "test_plot_contour" - "test_plot_contour_customized_target_name" - "test_plot_edf_with_multiple_studies" - "test_plot_edf_with_target" - "test_plot_parallel_coordinate" - "test_plot_parallel_coordinate_customized_target_name" - "test_plot_param_importances" - "test_plot_param_importances_customized_target_name" - "test_plot_param_importances_multiobjective_all_objectives_displayed" - "test_plot_slice" - "test_plot_slice_customized_target_name" - "test_target_is_none_and_study_is_multi_obj" - "test_visualizations_with_single_objectives" - ]; + # Fatal Python error: Aborted + # matplotlib/backend_bases.py", line 2654 in create_with_canvas + "test_edf_plot_no_trials" + "test_get_timeline_plot" + "test_plot_contour" + "test_plot_contour_customized_target_name" + "test_plot_edf_with_multiple_studies" + "test_plot_edf_with_target" + "test_plot_parallel_coordinate" + "test_plot_parallel_coordinate_customized_target_name" + "test_plot_param_importances" + "test_plot_param_importances_customized_target_name" + "test_plot_param_importances_multiobjective_all_objectives_displayed" + "test_plot_slice" + "test_plot_slice_customized_target_name" + "test_target_is_none_and_study_is_multi_obj" + "test_visualizations_with_single_objectives" + ]; pythonImportsCheck = [ "optuna" ]; diff --git a/pkgs/development/python-modules/orange-widget-base/default.nix b/pkgs/development/python-modules/orange-widget-base/default.nix index 65b270293cf5..02e7ab81f7b9 100644 --- a/pkgs/development/python-modules/orange-widget-base/default.nix +++ b/pkgs/development/python-modules/orange-widget-base/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { pyqtgraph pyqtwebengine typing-extensions - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ appnope ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ appnope ]; pythonImportsCheck = [ "orangewidget" ]; diff --git a/pkgs/development/python-modules/orbax-checkpoint/default.nix b/pkgs/development/python-modules/orbax-checkpoint/default.nix index 3176db485bec..614e010182cf 100644 --- a/pkgs/development/python-modules/orbax-checkpoint/default.nix +++ b/pkgs/development/python-modules/orbax-checkpoint/default.nix @@ -85,19 +85,18 @@ buildPythonPackage rec { "orbax.checkpoint" ]; - disabledTests = - [ - # Flaky - # AssertionError: 2 not greater than 2.0046136379241943 - "test_async_mkdir_parallel" - "test_async_mkdir_sequential" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Probably failing because of a filesystem impurity - # self.assertFalse(os.path.exists(dst_dir)) - # AssertionError: True is not false - "test_create_snapshot" - ]; + disabledTests = [ + # Flaky + # AssertionError: 2 not greater than 2.0046136379241943 + "test_async_mkdir_parallel" + "test_async_mkdir_sequential" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Probably failing because of a filesystem impurity + # self.assertFalse(os.path.exists(dst_dir)) + # AssertionError: True is not false + "test_create_snapshot" + ]; disabledTestPaths = [ # E absl.flags._exceptions.DuplicateFlagError: The flag 'num_processes' is defined twice. diff --git a/pkgs/development/python-modules/orjson/default.nix b/pkgs/development/python-modules/orjson/default.nix index c7812d614aac..91abafd91202 100644 --- a/pkgs/development/python-modules/orjson/default.nix +++ b/pkgs/development/python-modules/orjson/default.nix @@ -47,12 +47,13 @@ buildPythonPackage rec { hash = "sha256-vMuqqUfaYFZ1wC3SZBVF7Wq2OUKd7UkdC8GB93QBq8Y="; }; - nativeBuildInputs = - [ cffi ] - ++ (with rustPlatform; [ - cargoSetupHook - maturinBuildHook - ]); + nativeBuildInputs = [ + cffi + ] + ++ (with rustPlatform; [ + cargoSetupHook + maturinBuildHook + ]); buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; diff --git a/pkgs/development/python-modules/ormar/default.nix b/pkgs/development/python-modules/ormar/default.nix index 8b95da057d1a..80a8b9fbdcae 100644 --- a/pkgs/development/python-modules/ormar/default.nix +++ b/pkgs/development/python-modules/ormar/default.nix @@ -49,18 +49,17 @@ buildPythonPackage rec { poetry-core ]; - propagatedBuildInputs = - [ - databases - psycopg2 - pydantic - sqlalchemy - psycopg2 - ] - ++ lib.optionals (pythonOlder "3.8") [ - typing-extensions - importlib-metadata - ]; + propagatedBuildInputs = [ + databases + psycopg2 + pydantic + sqlalchemy + psycopg2 + ] + ++ lib.optionals (pythonOlder "3.8") [ + typing-extensions + importlib-metadata + ]; optional-dependencies = { postgresql = [ asyncpg ]; @@ -89,7 +88,8 @@ buildPythonPackage rec { httpx nest-asyncio pytest-asyncio - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; disabledTestPaths = [ "benchmarks/test_benchmark_*.py" ]; diff --git a/pkgs/development/python-modules/oslo-log/default.nix b/pkgs/development/python-modules/oslo-log/default.nix index 80af01d323e0..3d285fe8ddcc 100644 --- a/pkgs/development/python-modules/oslo-log/default.nix +++ b/pkgs/development/python-modules/oslo-log/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { oslo-utils pbr python-dateutil - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ pyinotify ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pyinotify ]; nativeCheckInputs = [ eventlet diff --git a/pkgs/development/python-modules/osqp/default.nix b/pkgs/development/python-modules/osqp/default.nix index 83fd6645cde7..84d7e34a3c0f 100644 --- a/pkgs/development/python-modules/osqp/default.nix +++ b/pkgs/development/python-modules/osqp/default.nix @@ -57,19 +57,18 @@ buildPythonPackage rec { pythonImportsCheck = [ "osqp" ]; - disabledTests = - [ - # Need an unfree license package - mkl - "test_issue14" - ] - # disable tests failing after scipy 1.12 update - # https://github.com/osqp/osqp-python/issues/121 - # re-enable once unit tests fixed - ++ [ - "feasibility_tests" - "polish_tests" - "update_matrices_tests" - ]; + disabledTests = [ + # Need an unfree license package - mkl + "test_issue14" + ] + # disable tests failing after scipy 1.12 update + # https://github.com/osqp/osqp-python/issues/121 + # re-enable once unit tests fixed + ++ [ + "feasibility_tests" + "polish_tests" + "update_matrices_tests" + ]; meta = with lib; { description = "Operator Splitting QP Solver"; diff --git a/pkgs/development/python-modules/paddlepaddle/default.nix b/pkgs/development/python-modules/paddlepaddle/default.nix index 02e52be20534..ba2235bd86b0 100644 --- a/pkgs/development/python-modules/paddlepaddle/default.nix +++ b/pkgs/development/python-modules/paddlepaddle/default.nix @@ -115,12 +115,13 @@ buildPythonPackage { homepage = "https://github.com/PaddlePaddle/Paddle"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ happysalada ]; - platforms = - [ "x86_64-linux" ] - ++ lib.optionals (!cudaSupport) [ - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; + platforms = [ + "x86_64-linux" + ] + ++ lib.optionals (!cudaSupport) [ + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; }; } diff --git a/pkgs/development/python-modules/pandas-stubs/default.nix b/pkgs/development/python-modules/pandas-stubs/default.nix index 3ecc12fe9e98..cc22e73d99d6 100644 --- a/pkgs/development/python-modules/pandas-stubs/default.nix +++ b/pkgs/development/python-modules/pandas-stubs/default.nix @@ -77,26 +77,25 @@ buildPythonPackage rec { python-calamine ]; - disabledTests = - [ - # Missing dependencies, error and warning checks - "test_all_read_without_lxml_dtype_backend" # pyarrow.orc - "test_orc" # pyarrow.orc - "test_plotting" # UserWarning: No artists with labels found to put in legend. - "test_spss" # FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0! - "test_show_version" - # FutureWarning: In the future `np.bool` will be defined as the corresponding... - "test_timedelta_cmp" - "test_timestamp_cmp" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_clipboard" # FileNotFoundError: [Errno 2] No such file or directory: 'pbcopy' - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # Disable tests for types that are not supported on aarch64 in `numpy` < 2.0 - "test_astype_float" # `f16` and `float128` - "test_astype_complex" # `c32` and `complex256` - ]; + disabledTests = [ + # Missing dependencies, error and warning checks + "test_all_read_without_lxml_dtype_backend" # pyarrow.orc + "test_orc" # pyarrow.orc + "test_plotting" # UserWarning: No artists with labels found to put in legend. + "test_spss" # FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0! + "test_show_version" + # FutureWarning: In the future `np.bool` will be defined as the corresponding... + "test_timedelta_cmp" + "test_timestamp_cmp" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_clipboard" # FileNotFoundError: [Errno 2] No such file or directory: 'pbcopy' + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # Disable tests for types that are not supported on aarch64 in `numpy` < 2.0 + "test_astype_float" # `f16` and `float128` + "test_astype_complex" # `c32` and `complex256` + ]; pythonImportsCheck = [ "pandas" ]; diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index f08952fe98e9..db0f0122de29 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/pkgs/development/python-modules/pandas/default.nix @@ -110,7 +110,8 @@ let pkg-config versioneer wheel - ] ++ versioneer.optional-dependencies.toml; + ] + ++ versioneer.optional-dependencies.toml; enableParallelBuilding = true; @@ -188,22 +189,21 @@ let doCheck = true; }); - nativeCheckInputs = - [ - hypothesis - pytest-asyncio - pytest-xdist - pytestCheckHook - ] - ++ lib.flatten (lib.attrValues optional-dependencies) - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - # for locale executable - glibc - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # for locale executable - adv_cmds - ]; + nativeCheckInputs = [ + hypothesis + pytest-asyncio + pytest-xdist + pytestCheckHook + ] + ++ lib.flatten (lib.attrValues optional-dependencies) + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + # for locale executable + glibc + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # for locale executable + adv_cmds + ]; # don't max out build cores, it breaks tests dontUsePytestXdist = true; @@ -220,38 +220,36 @@ let "4" ]; - disabledTests = - [ - # AssertionError: Did not see expected warning of class 'FutureWarning' - "test_parsing_tzlocal_deprecated" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # tests/generic/test_finalize.py::test_binops[and_-args4-right] - AssertionError: assert {} == {'a': 1} - "test_binops" - # These tests are unreliable on aarch64-darwin. See https://github.com/pandas-dev/pandas/issues/38921. - "test_rolling" - ] - ++ lib.optional stdenv.hostPlatform.is32bit [ - # https://github.com/pandas-dev/pandas/issues/37398 - "test_rolling_var_numerical_issues" - ]; + disabledTests = [ + # AssertionError: Did not see expected warning of class 'FutureWarning' + "test_parsing_tzlocal_deprecated" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # tests/generic/test_finalize.py::test_binops[and_-args4-right] - AssertionError: assert {} == {'a': 1} + "test_binops" + # These tests are unreliable on aarch64-darwin. See https://github.com/pandas-dev/pandas/issues/38921. + "test_rolling" + ] + ++ lib.optional stdenv.hostPlatform.is32bit [ + # https://github.com/pandas-dev/pandas/issues/37398 + "test_rolling_var_numerical_issues" + ]; # Tests have relative paths, and need to reference compiled C extensions # so change directory where `import .test` is able to be resolved - preCheck = - '' - export HOME=$TMPDIR - cd $out/${python.sitePackages}/pandas - '' - # TODO: Get locale and clipboard support working on darwin. - # Until then we disable the tests. - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Fake the impure dependencies pbpaste and pbcopy - echo "#!${runtimeShell}" > pbcopy - echo "#!${runtimeShell}" > pbpaste - chmod a+x pbcopy pbpaste - export PATH=$(pwd):$PATH - ''; + preCheck = '' + export HOME=$TMPDIR + cd $out/${python.sitePackages}/pandas + '' + # TODO: Get locale and clipboard support working on darwin. + # Until then we disable the tests. + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Fake the impure dependencies pbpaste and pbcopy + echo "#!${runtimeShell}" > pbcopy + echo "#!${runtimeShell}" > pbpaste + chmod a+x pbcopy pbpaste + export PATH=$(pwd):$PATH + ''; pythonImportsCheck = [ "pandas" ]; diff --git a/pkgs/development/python-modules/pandera/default.nix b/pkgs/development/python-modules/pandera/default.nix index dd2276a7909d..20e99f53c645 100644 --- a/pkgs/development/python-modules/pandera/default.nix +++ b/pkgs/development/python-modules/pandera/default.nix @@ -118,7 +118,8 @@ buildPythonPackage rec { joblib pyarrow pyarrow-hotfix - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; pytestFlagsArray = [ # KeyError: 'dask' diff --git a/pkgs/development/python-modules/papermill/default.nix b/pkgs/development/python-modules/papermill/default.nix index 594fd654d594..8084cf8702ba 100644 --- a/pkgs/development/python-modules/papermill/default.nix +++ b/pkgs/development/python-modules/papermill/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { requests tenacity tqdm - ] ++ lib.optionals (pythonAtLeast "3.12") [ aiohttp ]; + ] + ++ lib.optionals (pythonAtLeast "3.12") [ aiohttp ]; optional-dependencies = { azure = [ @@ -76,18 +77,17 @@ buildPythonPackage rec { s3 = [ boto3 ]; }; - nativeCheckInputs = - [ - ipykernel - moto - pytest-mock - pytestCheckHook - versionCheckHook - writableTmpDirAsHomeHook - ] - ++ optional-dependencies.azure - ++ optional-dependencies.s3 - ++ optional-dependencies.gcs; + nativeCheckInputs = [ + ipykernel + moto + pytest-mock + pytestCheckHook + versionCheckHook + writableTmpDirAsHomeHook + ] + ++ optional-dependencies.azure + ++ optional-dependencies.s3 + ++ optional-dependencies.gcs; versionCheckProgramArg = "--version"; pythonImportsCheck = [ "papermill" ]; @@ -101,15 +101,14 @@ buildPythonPackage rec { "--deselect=papermill/tests/test_execute.py::TestOutputFormatting::test_output_formatting" ]; - disabledTests = - [ - # pytest 8 compat - "test_read_with_valid_file_extension" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # might fail due to the sandbox - "test_end2end_autosave_slow_notebook" - ]; + disabledTests = [ + # pytest 8 compat + "test_read_with_valid_file_extension" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # might fail due to the sandbox + "test_end2end_autosave_slow_notebook" + ]; disabledTestPaths = [ # ImportError: cannot import name 'mock_s3' from 'moto' diff --git a/pkgs/development/python-modules/papis/default.nix b/pkgs/development/python-modules/papis/default.nix index bc69dad05eda..101f5fe21732 100644 --- a/pkgs/development/python-modules/papis/default.nix +++ b/pkgs/development/python-modules/papis/default.nix @@ -79,7 +79,8 @@ buildPythonPackage rec { pyyaml requests stevedore - ] ++ lib.optionals withOptDeps optional-dependencies.complete; + ] + ++ lib.optionals withOptDeps optional-dependencies.complete; optional-dependencies = { complete = [ diff --git a/pkgs/development/python-modules/paramiko/default.nix b/pkgs/development/python-modules/paramiko/default.nix index 56c676f8f0e6..c779ec730b49 100644 --- a/pkgs/development/python-modules/paramiko/default.nix +++ b/pkgs/development/python-modules/paramiko/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { mock pytestCheckHook pytest-relaxed - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "paramiko" ]; diff --git a/pkgs/development/python-modules/parver/default.nix b/pkgs/development/python-modules/parver/default.nix index af12a9835283..2db10a0653b1 100644 --- a/pkgs/development/python-modules/parver/default.nix +++ b/pkgs/development/python-modules/parver/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ attrs arpeggio - ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/pathlib2/default.nix b/pkgs/development/python-modules/pathlib2/default.nix index 5e5663c054af..1f6d48e5f1a4 100644 --- a/pkgs/development/python-modules/pathlib2/default.nix +++ b/pkgs/development/python-modules/pathlib2/default.nix @@ -18,12 +18,13 @@ buildPythonPackage rec { hash = "sha256-n+DtrYmLg8DD4ZnIQrJ+0hZkXS4Xd1ey3Wc4TUETxkE="; }; - propagatedBuildInputs = - [ six ] - ++ lib.optionals (pythonOlder "3.5") [ - scandir - typing - ]; + propagatedBuildInputs = [ + six + ] + ++ lib.optionals (pythonOlder "3.5") [ + scandir + typing + ]; meta = with lib; { description = "This module offers classes representing filesystem paths with semantics appropriate for different operating systems"; diff --git a/pkgs/development/python-modules/patool/default.nix b/pkgs/development/python-modules/patool/default.nix index c92bf928cd80..506cca39211f 100644 --- a/pkgs/development/python-modules/patool/default.nix +++ b/pkgs/development/python-modules/patool/default.nix @@ -77,7 +77,8 @@ buildPythonPackage rec { "test_7z_file" "test_7za_file" "test_p7azip" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_ar" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_ar" ]; meta = { description = "portable archive file manager"; diff --git a/pkgs/development/python-modules/pcre2-py/default.nix b/pkgs/development/python-modules/pcre2-py/default.nix index 1124417a0508..82ac9cf16d89 100644 --- a/pkgs/development/python-modules/pcre2-py/default.nix +++ b/pkgs/development/python-modules/pcre2-py/default.nix @@ -51,21 +51,20 @@ buildPythonPackage rec { setuptools ]; - dependencies = - [ - haskellPackages.bz2 - haskellPackages.memfd - ] - ++ [ - build - bzip2 - editline - libedit - libz - pcre2 - readline - requests - ]; + dependencies = [ + haskellPackages.bz2 + haskellPackages.memfd + ] + ++ [ + build + bzip2 + editline + libedit + libz + pcre2 + readline + requests + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/peewee/default.nix b/pkgs/development/python-modules/peewee/default.nix index 6fb0ef09d5f7..0d9e1f674072 100644 --- a/pkgs/development/python-modules/peewee/default.nix +++ b/pkgs/development/python-modules/peewee/default.nix @@ -36,12 +36,11 @@ buildPythonPackage rec { cython ]; - propagatedBuildInputs = - [ - apsw - ] - ++ lib.optionals withPostgres [ psycopg2 ] - ++ lib.optionals withMysql [ mysql-connector ]; + propagatedBuildInputs = [ + apsw + ] + ++ lib.optionals withPostgres [ psycopg2 ] + ++ lib.optionals withMysql [ mysql-connector ]; nativeCheckInputs = [ flask ]; diff --git a/pkgs/development/python-modules/pegen/default.nix b/pkgs/development/python-modules/pegen/default.nix index 0a5f8269e7c9..405236e2a203 100644 --- a/pkgs/development/python-modules/pegen/default.nix +++ b/pkgs/development/python-modules/pegen/default.nix @@ -32,15 +32,14 @@ buildPythonPackage rec { pythonImportsCheck = [ "pegen" ]; - disabledTests = - [ - # ValueError: Expected locations of (1, 3) and... - "test_invalid_call_arguments" - ] - ++ lib.optionals (pythonAtLeast "3.11") [ - # https://github.com/we-like-parsers/pegen/issues/89 - "test_invalid_def_stmt" - ]; + disabledTests = [ + # ValueError: Expected locations of (1, 3) and... + "test_invalid_call_arguments" + ] + ++ lib.optionals (pythonAtLeast "3.11") [ + # https://github.com/we-like-parsers/pegen/issues/89 + "test_invalid_def_stmt" + ]; disabledTestPaths = lib.optionals (pythonAtLeast "3.13") [ "tests/python_parser/test_ast_parsing.py" diff --git a/pkgs/development/python-modules/pem/default.nix b/pkgs/development/python-modules/pem/default.nix index ec74c0766140..7d5f50f4cca9 100644 --- a/pkgs/development/python-modules/pem/default.nix +++ b/pkgs/development/python-modules/pem/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { pyopenssl pytestCheckHook twisted - ] ++ twisted.optional-dependencies.tls; + ] + ++ twisted.optional-dependencies.tls; pythonImportsCheck = [ "pem" ]; diff --git a/pkgs/development/python-modules/pendulum/default.nix b/pkgs/development/python-modules/pendulum/default.nix index f79f1f34417f..d1070a79a376 100644 --- a/pkgs/development/python-modules/pendulum/default.nix +++ b/pkgs/development/python-modules/pendulum/default.nix @@ -52,15 +52,14 @@ buildPythonPackage rec { buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ iconv ]; - propagatedBuildInputs = - [ - python-dateutil - tzdata - ] - ++ lib.optional (!isPyPy) [ time-machine ] - ++ lib.optionals (pythonOlder "3.9") [ - importlib-resources - ]; + propagatedBuildInputs = [ + python-dateutil + tzdata + ] + ++ lib.optional (!isPyPy) [ time-machine ] + ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources + ]; pythonImportsCheck = [ "pendulum" ]; @@ -69,12 +68,13 @@ buildPythonPackage rec { pytz ]; - disabledTestPaths = - [ "tests/benchmarks" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # PermissionError: [Errno 1] Operation not permitted: '/etc/localtime' - "tests/testing/test_time_travel.py" - ]; + disabledTestPaths = [ + "tests/benchmarks" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # PermissionError: [Errno 1] Operation not permitted: '/etc/localtime' + "tests/testing/test_time_travel.py" + ]; meta = with lib; { description = "Python datetimes made easy"; diff --git a/pkgs/development/python-modules/pep517/default.nix b/pkgs/development/python-modules/pep517/default.nix index db633e8d6d36..6417f3306b23 100644 --- a/pkgs/development/python-modules/pep517/default.nix +++ b/pkgs/development/python-modules/pep517/default.nix @@ -26,12 +26,13 @@ buildPythonPackage rec { nativeBuildInputs = [ flit-core ]; - propagatedBuildInputs = - [ tomli ] - ++ lib.optionals (pythonOlder "3.8") [ - importlib-metadata - zipp - ]; + propagatedBuildInputs = [ + tomli + ] + ++ lib.optionals (pythonOlder "3.8") [ + importlib-metadata + zipp + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/persistent/default.nix b/pkgs/development/python-modules/persistent/default.nix index 9a8310e6da1c..5bbf27bf2193 100644 --- a/pkgs/development/python-modules/persistent/default.nix +++ b/pkgs/development/python-modules/persistent/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { dependencies = [ zope-interface zope-deferredimport - ] ++ lib.optionals (!isPyPy) [ cffi ]; + ] + ++ lib.optionals (!isPyPy) [ cffi ]; pythonImportsCheck = [ "persistent" ]; diff --git a/pkgs/development/python-modules/pettingzoo/default.nix b/pkgs/development/python-modules/pettingzoo/default.nix index 71c456c48f36..1409b29e3633 100644 --- a/pkgs/development/python-modules/pettingzoo/default.nix +++ b/pkgs/development/python-modules/pettingzoo/default.nix @@ -106,15 +106,14 @@ buildPythonPackage rec { "test/unwrapped_test.py" ]; - disabledTests = - [ - # ImportError: cannot import name 'pytest_plugins' from 'pettingzoo.classic' - "test_chess" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Crashes on darwin: `Fatal Python error: Aborted` - "test_multi_episode_parallel_env_wrapper" - ]; + disabledTests = [ + # ImportError: cannot import name 'pytest_plugins' from 'pettingzoo.classic' + "test_chess" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Crashes on darwin: `Fatal Python error: Aborted` + "test_multi_episode_parallel_env_wrapper" + ]; meta = { description = "API standard for multi-agent reinforcement learning environments, with popular reference environments and related utilities"; diff --git a/pkgs/development/python-modules/pg8000/default.nix b/pkgs/development/python-modules/pg8000/default.nix index cc83363b3743..2500db486c60 100644 --- a/pkgs/development/python-modules/pg8000/default.nix +++ b/pkgs/development/python-modules/pg8000/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { passlib python-dateutil scramp - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; # Tests require a running PostgreSQL instance doCheck = false; diff --git a/pkgs/development/python-modules/pgcli/default.nix b/pkgs/development/python-modules/pgcli/default.nix index 0209024ce69d..f5eb409af6e8 100644 --- a/pkgs/development/python-modules/pgcli/default.nix +++ b/pkgs/development/python-modules/pgcli/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { disabledTests = [ # requires running postgres "test_application_name_in_env" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_application_name_db_uri" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_application_name_db_uri" ]; meta = with lib; { description = "Command-line interface for PostgreSQL"; diff --git a/pkgs/development/python-modules/pillow-heif/default.nix b/pkgs/development/python-modules/pillow-heif/default.nix index f01487f3ae5d..55114a3c6672 100644 --- a/pkgs/development/python-modules/pillow-heif/default.nix +++ b/pkgs/development/python-modules/pillow-heif/default.nix @@ -80,28 +80,27 @@ buildPythonPackage rec { rm tests/images/heif/L_xmp.heif ''; - disabledTests = - [ - # Time based - "test_decode_threads" - # Missing EXIF info on WEBP-AVIF variant - "test_exif_from_pillow" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # https://github.com/bigcat88/pillow_heif/issues/89 - # not reproducible in nixpkgs - "test_opencv_crash" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # RuntimeError: Encoder plugin generated an error: Unsupported bit depth: Bit depth not supported by x265 - "test_open_heif_compare_non_standard_modes_data" - "test_open_save_disable_16bit" - "test_save_bgr_16bit_to_10_12_bit" - "test_save_bgra_16bit_to_10_12_bit" - "test_premultiplied_alpha" - "test_hdr_save" - "test_I_color_modes_to_10_12_bit" - ]; + disabledTests = [ + # Time based + "test_decode_threads" + # Missing EXIF info on WEBP-AVIF variant + "test_exif_from_pillow" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # https://github.com/bigcat88/pillow_heif/issues/89 + # not reproducible in nixpkgs + "test_opencv_crash" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # RuntimeError: Encoder plugin generated an error: Unsupported bit depth: Bit depth not supported by x265 + "test_open_heif_compare_non_standard_modes_data" + "test_open_save_disable_16bit" + "test_save_bgr_16bit_to_10_12_bit" + "test_save_bgra_16bit_to_10_12_bit" + "test_premultiplied_alpha" + "test_hdr_save" + "test_I_color_modes_to_10_12_bit" + ]; meta = { changelog = "https://github.com/bigcat88/pillow_heif/releases/tag/${src.tag}"; diff --git a/pkgs/development/python-modules/pillow/default.nix b/pkgs/development/python-modules/pillow/default.nix index 3f6ebf4e72fd..55b51dd05891 100644 --- a/pkgs/development/python-modules/pillow/default.nix +++ b/pkgs/development/python-modules/pillow/default.nix @@ -104,24 +104,24 @@ buildPythonPackage rec { pytest-cov-stub pytestCheckHook numpy - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlagsArray = [ # Checks for very precise color values on what's basically white "--deselect=Tests/test_file_avif.py::TestFileAvif::test_background_from_gif" ]; - disabledTests = - [ - # Code quality mismathch 9 vs 10 - "test_pyroma" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Disable darwin tests which require executables: `iconutil` and `screencapture` - "test_grab" - "test_grabclipboard" - "test_save" - ]; + disabledTests = [ + # Code quality mismathch 9 vs 10 + "test_pyroma" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Disable darwin tests which require executables: `iconutil` and `screencapture` + "test_grab" + "test_grabclipboard" + "test_save" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # Crashes the interpreter diff --git a/pkgs/development/python-modules/pins/default.nix b/pkgs/development/python-modules/pins/default.nix index 81ddafdd32dd..e30b2f326a3e 100644 --- a/pkgs/development/python-modules/pins/default.nix +++ b/pkgs/development/python-modules/pins/default.nix @@ -71,7 +71,8 @@ buildPythonPackage rec { pytest-cases pytest-parallel pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "pins" ]; diff --git a/pkgs/development/python-modules/pip-tools/default.nix b/pkgs/development/python-modules/pip-tools/default.nix index b5491d6e3474..a5a04a886480 100644 --- a/pkgs/development/python-modules/pip-tools/default.nix +++ b/pkgs/development/python-modules/pip-tools/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { pip setuptools wheel - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/pipdate/default.nix b/pkgs/development/python-modules/pipdate/default.nix index 87d275cf7c0b..501fcb404c2f 100644 --- a/pkgs/development/python-modules/pipdate/default.nix +++ b/pkgs/development/python-modules/pipdate/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { requests rich setuptools - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; # Tests require network access and pythonImportsCheck requires configuration file doCheck = false; diff --git a/pkgs/development/python-modules/pipdeptree/default.nix b/pkgs/development/python-modules/pipdeptree/default.nix index db4aeef9529e..601b5422dda4 100644 --- a/pkgs/development/python-modules/pipdeptree/default.nix +++ b/pkgs/development/python-modules/pipdeptree/default.nix @@ -54,7 +54,8 @@ buildPythonPackage rec { pytest-mock pytestCheckHook virtualenv - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "pipdeptree" ]; diff --git a/pkgs/development/python-modules/pipx/default.nix b/pkgs/development/python-modules/pipx/default.nix index 1188b6a2ce3c..0fd274db0454 100644 --- a/pkgs/development/python-modules/pipx/default.nix +++ b/pkgs/development/python-modules/pipx/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { packaging platformdirs userpath - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeBuildInputs = [ installShellFiles diff --git a/pkgs/development/python-modules/planetary-computer/default.nix b/pkgs/development/python-modules/planetary-computer/default.nix index 3e581328e10e..7014512b6e4c 100644 --- a/pkgs/development/python-modules/planetary-computer/default.nix +++ b/pkgs/development/python-modules/planetary-computer/default.nix @@ -65,7 +65,8 @@ buildPythonPackage rec { nativeCheckInputs = [ responses pytestCheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; disabledTests = [ # tests require network access diff --git a/pkgs/development/python-modules/playwright/default.nix b/pkgs/development/python-modules/playwright/default.nix index c3e70e9453e0..fe60be7c864f 100644 --- a/pkgs/development/python-modules/playwright/default.nix +++ b/pkgs/development/python-modules/playwright/default.nix @@ -67,7 +67,8 @@ buildPythonPackage rec { gitMinimal setuptools-scm setuptools - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ auditwheel ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ auditwheel ]; pythonRelaxDeps = [ "greenlet" @@ -90,14 +91,13 @@ buildPythonPackage rec { passthru = { inherit driver; - tests = - { - driver = playwright-driver; - browsers = playwright-driver.browsers; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - inherit (nixosTests) playwright-python; - }; + tests = { + driver = playwright-driver; + browsers = playwright-driver.browsers; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + inherit (nixosTests) playwright-python; + }; # Package and playwright driver versions are tightly coupled. # Use the update script to ensure synchronized updates. skipBulkUpdate = true; diff --git a/pkgs/development/python-modules/plotly/default.nix b/pkgs/development/python-modules/plotly/default.nix index 26690081fed9..11cc72fa65c8 100644 --- a/pkgs/development/python-modules/plotly/default.nix +++ b/pkgs/development/python-modules/plotly/default.nix @@ -89,7 +89,8 @@ buildPythonPackage rec { statsmodels which xarray - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # failed pinning test, sensitive to dep versions @@ -105,34 +106,33 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - disabledTestPaths = - [ - # Broken imports - "plotly/matplotlylib/mplexporter/tests" - # Fails to catch error when serializing document - "tests/test_optional/test_kaleido/test_kaleido.py::test_defaults" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fails to launch kaleido subprocess - "tests/test_optional/test_kaleido" - # numpy2 related error, RecursionError - # See: https://github.com/plotly/plotly.py/issues/4852 - "tests/test_plotly_utils/validators/test_angle_validator.py" - "tests/test_plotly_utils/validators/test_any_validator.py" - "tests/test_plotly_utils/validators/test_color_validator.py" - "tests/test_plotly_utils/validators/test_colorlist_validator.py" - "tests/test_plotly_utils/validators/test_colorscale_validator.py" - "tests/test_plotly_utils/validators/test_dataarray_validator.py" - "tests/test_plotly_utils/validators/test_enumerated_validator.py" - "tests/test_plotly_utils/validators/test_fig_deepcopy.py" - "tests/test_plotly_utils/validators/test_flaglist_validator.py" - "tests/test_plotly_utils/validators/test_infoarray_validator.py" - "tests/test_plotly_utils/validators/test_integer_validator.py" - "tests/test_plotly_utils/validators/test_number_validator.py" - "tests/test_plotly_utils/validators/test_pandas_series_input.py" - "tests/test_plotly_utils/validators/test_string_validator.py" - "tests/test_plotly_utils/validators/test_xarray_input.py" - ]; + disabledTestPaths = [ + # Broken imports + "plotly/matplotlylib/mplexporter/tests" + # Fails to catch error when serializing document + "tests/test_optional/test_kaleido/test_kaleido.py::test_defaults" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fails to launch kaleido subprocess + "tests/test_optional/test_kaleido" + # numpy2 related error, RecursionError + # See: https://github.com/plotly/plotly.py/issues/4852 + "tests/test_plotly_utils/validators/test_angle_validator.py" + "tests/test_plotly_utils/validators/test_any_validator.py" + "tests/test_plotly_utils/validators/test_color_validator.py" + "tests/test_plotly_utils/validators/test_colorlist_validator.py" + "tests/test_plotly_utils/validators/test_colorscale_validator.py" + "tests/test_plotly_utils/validators/test_dataarray_validator.py" + "tests/test_plotly_utils/validators/test_enumerated_validator.py" + "tests/test_plotly_utils/validators/test_fig_deepcopy.py" + "tests/test_plotly_utils/validators/test_flaglist_validator.py" + "tests/test_plotly_utils/validators/test_infoarray_validator.py" + "tests/test_plotly_utils/validators/test_integer_validator.py" + "tests/test_plotly_utils/validators/test_number_validator.py" + "tests/test_plotly_utils/validators/test_pandas_series_input.py" + "tests/test_plotly_utils/validators/test_string_validator.py" + "tests/test_plotly_utils/validators/test_xarray_input.py" + ]; pythonImportsCheck = [ "plotly" ]; diff --git a/pkgs/development/python-modules/plumbum/default.nix b/pkgs/development/python-modules/plumbum/default.nix index 29852e2bec8a..fdd6b39f655c 100644 --- a/pkgs/development/python-modules/plumbum/default.nix +++ b/pkgs/development/python-modules/plumbum/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { pytest-mock pytest-timeout pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export HOME=$TMP diff --git a/pkgs/development/python-modules/pluthon/default.nix b/pkgs/development/python-modules/pluthon/default.nix index 47dd7fad00b0..b9b45e241ca1 100644 --- a/pkgs/development/python-modules/pluthon/default.nix +++ b/pkgs/development/python-modules/pluthon/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { setuptools uplc ordered-set - ] ++ lib.optional (pythonOlder "3.9") graphlib-backport; + ] + ++ lib.optional (pythonOlder "3.9") graphlib-backport; pythonImportsCheck = [ "pluthon" ]; diff --git a/pkgs/development/python-modules/podman/default.nix b/pkgs/development/python-modules/podman/default.nix index fec217fcd05a..0cd2354902a3 100644 --- a/pkgs/development/python-modules/podman/default.nix +++ b/pkgs/development/python-modules/podman/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { dependencies = [ requests urllib3 - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; optional-dependencies = { progress_bar = [ rich ]; diff --git a/pkgs/development/python-modules/pontos/default.nix b/pkgs/development/python-modules/pontos/default.nix index 839cd3c78c8b..9bc20c55e4ce 100644 --- a/pkgs/development/python-modules/pontos/default.nix +++ b/pkgs/development/python-modules/pontos/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { shtab rich tomlkit - ] ++ httpx.optional-dependencies.http2; + ] + ++ httpx.optional-dependencies.http2; nativeCheckInputs = [ git diff --git a/pkgs/development/python-modules/powerapi/default.nix b/pkgs/development/python-modules/powerapi/default.nix index 1ae18ae1e5cd..b7b8b5835ea7 100644 --- a/pkgs/development/python-modules/powerapi/default.nix +++ b/pkgs/development/python-modules/powerapi/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { pytest-cov-stub pytestCheckHook pytest-timeout - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "powerapi" ]; diff --git a/pkgs/development/python-modules/powerline/default.nix b/pkgs/development/python-modules/powerline/default.nix index 265a552e99b6..794bc93486f6 100644 --- a/pkgs/development/python-modules/powerline/default.nix +++ b/pkgs/development/python-modules/powerline/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { python-hglib pygit2 pyuv - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ i3ipc ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ i3ipc ]; # tests are travis-specific doCheck = false; diff --git a/pkgs/development/python-modules/prance/default.nix b/pkgs/development/python-modules/prance/default.nix index 5e52815c9d8f..e366ec14c639 100644 --- a/pkgs/development/python-modules/prance/default.nix +++ b/pkgs/development/python-modules/prance/default.nix @@ -54,7 +54,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-cov-stub pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # Disable tests that require network disabledTestPaths = [ "tests/test_convert.py" ]; diff --git a/pkgs/development/python-modules/prisma/default.nix b/pkgs/development/python-modules/prisma/default.nix index e08cbd3c6d7c..d2f6c7b04553 100644 --- a/pkgs/development/python-modules/prisma/default.nix +++ b/pkgs/development/python-modules/prisma/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { python-dotenv tomlkit typing-extensions - ] ++ lib.optionals (pythonOlder "3.11") [ strenum ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ strenum ]; # Building the client requires network access doCheck = false; diff --git a/pkgs/development/python-modules/private-gpt/default.nix b/pkgs/development/python-modules/private-gpt/default.nix index 815964658c8c..bd41b8e6062e 100644 --- a/pkgs/development/python-modules/private-gpt/default.nix +++ b/pkgs/development/python-modules/private-gpt/default.nix @@ -63,7 +63,8 @@ buildPythonPackage rec { pyyaml transformers watchdog - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # This is needed for running the tests and the service in offline mode, # See related issue at https://github.com/zylon-ai/private-gpt/issues/1870 diff --git a/pkgs/development/python-modules/prophet/default.nix b/pkgs/development/python-modules/prophet/default.nix index b2c97deda3c5..cd49cb2a0442 100644 --- a/pkgs/development/python-modules/prophet/default.nix +++ b/pkgs/development/python-modules/prophet/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { optional-dependencies.parallel = [ dask distributed - ] ++ dask.optional-dependencies.dataframe; + ] + ++ dask.optional-dependencies.dataframe; preCheck = '' # use the generated files from $out for testing diff --git a/pkgs/development/python-modules/protobuf/4.nix b/pkgs/development/python-modules/protobuf/4.nix index 48af41c206ec..5369f68bf2e8 100644 --- a/pkgs/development/python-modules/protobuf/4.nix +++ b/pkgs/development/python-modules/protobuf/4.nix @@ -82,7 +82,8 @@ buildPythonPackage { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.optionals (lib.versionAtLeast protobuf.version "22") [ numpy ]; + ] + ++ lib.optionals (lib.versionAtLeast protobuf.version "22") [ numpy ]; disabledTests = lib.optionals isPyPy [ diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index 011e65079083..8c56f8d47001 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -120,13 +120,12 @@ buildPythonPackage rec { disabled = pythonOlder "3.7"; - outputs = - [ - "out" - ] - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ - "doc" - ]; + outputs = [ + "out" + ] + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + "doc" + ]; sphinxRoot = "../docs"; @@ -143,18 +142,17 @@ buildPythonPackage rec { cd psycopg ''; - nativeBuildInputs = - [ - furo - setuptools - shapely - ] - # building the docs fails with the following error when cross compiling - # AttributeError: module 'psycopg_c.pq' has no attribute '__impl__' - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ - sphinx-autodoc-typehints - sphinxHook - ]; + nativeBuildInputs = [ + furo + setuptools + shapely + ] + # building the docs fails with the following error when cross compiling + # AttributeError: module 'psycopg_c.pq' has no attribute '__impl__' + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + sphinx-autodoc-typehints + sphinxHook + ]; propagatedBuildInputs = [ psycopg-c @@ -172,17 +170,16 @@ buildPythonPackage rec { pool = [ psycopg-pool ]; }; - nativeCheckInputs = - [ - anyio - pproxy - pytest-randomly - pytestCheckHook - postgresql - ] - ++ lib.optional stdenv.hostPlatform.isLinux postgresqlTestHook - ++ optional-dependencies.c - ++ optional-dependencies.pool; + nativeCheckInputs = [ + anyio + pproxy + pytest-randomly + pytestCheckHook + postgresql + ] + ++ lib.optional stdenv.hostPlatform.isLinux postgresqlTestHook + ++ optional-dependencies.c + ++ optional-dependencies.pool; env = { postgresqlEnableTCP = 1; @@ -190,13 +187,12 @@ buildPythonPackage rec { PGDATABASE = "psycopg"; }; - preCheck = - '' - cd .. - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - export PSYCOPG_TEST_DSN="host=/build/run/postgresql user=$PGUSER" - ''; + preCheck = '' + cd .. + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + export PSYCOPG_TEST_DSN="host=/build/run/postgresql user=$PGUSER" + ''; disabledTests = [ # don't depend on mypy for tests diff --git a/pkgs/development/python-modules/pulsar-client/default.nix b/pkgs/development/python-modules/pulsar-client/default.nix index ef1f7c0a9427..3c9b5303ad7d 100644 --- a/pkgs/development/python-modules/pulsar-client/default.nix +++ b/pkgs/development/python-modules/pulsar-client/default.nix @@ -72,7 +72,8 @@ buildPythonPackage rec { nativeCheckInputs = [ unittestCheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; unittestFlagsArray = [ "-s" diff --git a/pkgs/development/python-modules/pushbullet-py/default.nix b/pkgs/development/python-modules/pushbullet-py/default.nix index 0b986dff6636..f1dde0f34e9b 100644 --- a/pkgs/development/python-modules/pushbullet-py/default.nix +++ b/pkgs/development/python-modules/pushbullet-py/default.nix @@ -36,17 +36,16 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = - [ - "test_auth_fail" - "test_auth_success" - "test_decryption" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'? - "test_new_device_ok" - "test_new_chat_ok" - ]; + disabledTests = [ + "test_auth_fail" + "test_auth_success" + "test_decryption" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'? + "test_new_device_ok" + "test_new_chat_ok" + ]; meta = with lib; { description = "Simple python client for pushbullet.com"; diff --git a/pkgs/development/python-modules/py-evm/default.nix b/pkgs/development/python-modules/py-evm/default.nix index 2e21a73b9751..9ec30e60434e 100644 --- a/pkgs/development/python-modules/py-evm/default.nix +++ b/pkgs/development/python-modules/py-evm/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { hypothesis pytestCheckHook pytest-xdist - ] ++ eth-hash.optional-dependencies.pycryptodome; + ] + ++ eth-hash.optional-dependencies.pycryptodome; disabledTests = [ # side-effect: runs pip online check and is blocked by sandbox diff --git a/pkgs/development/python-modules/py-sucks/default.nix b/pkgs/development/python-modules/py-sucks/default.nix index efff0337b295..07301cf2090a 100644 --- a/pkgs/development/python-modules/py-sucks/default.nix +++ b/pkgs/development/python-modules/py-sucks/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { nativeCheckInputs = [ requests-mock pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # assumes $HOME is at a specific place diff --git a/pkgs/development/python-modules/pyTelegramBotAPI/default.nix b/pkgs/development/python-modules/pyTelegramBotAPI/default.nix index 93ff870e2481..550809f9150d 100644 --- a/pkgs/development/python-modules/pyTelegramBotAPI/default.nix +++ b/pkgs/development/python-modules/pyTelegramBotAPI/default.nix @@ -47,13 +47,12 @@ buildPythonPackage rec { watchdog = [ watchdog ]; }; - checkInputs = - [ - pytestCheckHook - requests - ] - ++ optional-dependencies.watchdog - ++ optional-dependencies.aiohttp; + checkInputs = [ + pytestCheckHook + requests + ] + ++ optional-dependencies.watchdog + ++ optional-dependencies.aiohttp; pythonImportsCheck = [ "telebot" ]; diff --git a/pkgs/development/python-modules/pyannotate/default.nix b/pkgs/development/python-modules/pyannotate/default.nix index efb769051def..f6f55da2f98c 100644 --- a/pkgs/development/python-modules/pyannotate/default.nix +++ b/pkgs/development/python-modules/pyannotate/default.nix @@ -36,15 +36,14 @@ buildPythonPackage rec { "pyannotate_tools" ]; - disabledTestPaths = - [ - "pyannotate_runtime/tests/test_collect_types.py" - ] - ++ lib.optionals (pythonAtLeast "3.11") [ - # Tests are using lib2to3 - "pyannotate_tools/fixes/tests/test_annotate*.py" - "pyannotate_tools/annotations/tests/dundermain_test.py" - ]; + disabledTestPaths = [ + "pyannotate_runtime/tests/test_collect_types.py" + ] + ++ lib.optionals (pythonAtLeast "3.11") [ + # Tests are using lib2to3 + "pyannotate_tools/fixes/tests/test_annotate*.py" + "pyannotate_tools/annotations/tests/dundermain_test.py" + ]; meta = with lib; { description = "Auto-generate PEP-484 annotations"; diff --git a/pkgs/development/python-modules/pyarrow/default.nix b/pkgs/development/python-modules/pyarrow/default.nix index 15b489bd7b73..136dd474a527 100644 --- a/pkgs/development/python-modules/pyarrow/default.nix +++ b/pkgs/development/python-modules/pyarrow/default.nix @@ -97,76 +97,75 @@ buildPythonPackage rec { find "$PWD/pyarrow/src/arrow" -type f -name '*.h' -exec cp {} "$pyarrow_include/arrow/python" \; ''; - pytestFlagsArray = - [ - # A couple of tests are missing fixture imports, luckily pytest offers a - # clean solution. - "--fixtures pyarrow/tests/conftest.py" - # Deselect a single test because pyarrow prints a 2-line error message where - # only a single line is expected. The additional line of output comes from - # the glog library which is an optional dependency of arrow-cpp that is - # enabled in nixpkgs. - # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11393 - "--deselect=pyarrow/tests/test_memory.py::test_env_var" - # these tests require access to s3 via the internet - "--deselect=pyarrow/tests/test_fs.py::test_resolve_s3_region" - "--deselect=pyarrow/tests/test_fs.py::test_s3_real_aws" - "--deselect=pyarrow/tests/test_fs.py::test_s3_real_aws_region_selection" - "--deselect=pyarrow/tests/test_fs.py::test_s3_options" - # Flaky test - "--deselect=pyarrow/tests/test_flight.py::test_roundtrip_errors" - "--deselect=pyarrow/tests/test_pandas.py::test_threaded_pandas_import" - # Flaky test, works locally but not on Hydra - "--deselect=pyarrow/tests/test_csv.py::TestThreadedCSVTableRead::test_cancellation" - # expects arrow-cpp headers to be bundled - "--deselect=pyarrow/tests/test_cpp_internals.py::test_pyarrow_include" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Requires loopback networking - "--deselect=pyarrow/tests/test_ipc.py::test_socket_" - "--deselect=pyarrow/tests/test_flight.py::test_never_sends_data" - "--deselect=pyarrow/tests/test_flight.py::test_large_descriptor" - "--deselect=pyarrow/tests/test_flight.py::test_large_metadata_client" - "--deselect=pyarrow/tests/test_flight.py::test_none_action_side_effect" - # fails to compile - "--deselect=pyarrow/tests/test_cython.py::test_cython_api" - ] - ++ lib.optionals (pythonAtLeast "3.11") [ - # Repr output is printing number instead of enum name so these tests fail - "--deselect=pyarrow/tests/test_fs.py::test_get_file_info" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # this test requires local networking - "--deselect=pyarrow/tests/test_fs.py::test_filesystem_from_uri_gcs" - ]; + pytestFlagsArray = [ + # A couple of tests are missing fixture imports, luckily pytest offers a + # clean solution. + "--fixtures pyarrow/tests/conftest.py" + # Deselect a single test because pyarrow prints a 2-line error message where + # only a single line is expected. The additional line of output comes from + # the glog library which is an optional dependency of arrow-cpp that is + # enabled in nixpkgs. + # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11393 + "--deselect=pyarrow/tests/test_memory.py::test_env_var" + # these tests require access to s3 via the internet + "--deselect=pyarrow/tests/test_fs.py::test_resolve_s3_region" + "--deselect=pyarrow/tests/test_fs.py::test_s3_real_aws" + "--deselect=pyarrow/tests/test_fs.py::test_s3_real_aws_region_selection" + "--deselect=pyarrow/tests/test_fs.py::test_s3_options" + # Flaky test + "--deselect=pyarrow/tests/test_flight.py::test_roundtrip_errors" + "--deselect=pyarrow/tests/test_pandas.py::test_threaded_pandas_import" + # Flaky test, works locally but not on Hydra + "--deselect=pyarrow/tests/test_csv.py::TestThreadedCSVTableRead::test_cancellation" + # expects arrow-cpp headers to be bundled + "--deselect=pyarrow/tests/test_cpp_internals.py::test_pyarrow_include" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Requires loopback networking + "--deselect=pyarrow/tests/test_ipc.py::test_socket_" + "--deselect=pyarrow/tests/test_flight.py::test_never_sends_data" + "--deselect=pyarrow/tests/test_flight.py::test_large_descriptor" + "--deselect=pyarrow/tests/test_flight.py::test_large_metadata_client" + "--deselect=pyarrow/tests/test_flight.py::test_none_action_side_effect" + # fails to compile + "--deselect=pyarrow/tests/test_cython.py::test_cython_api" + ] + ++ lib.optionals (pythonAtLeast "3.11") [ + # Repr output is printing number instead of enum name so these tests fail + "--deselect=pyarrow/tests/test_fs.py::test_get_file_info" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # this test requires local networking + "--deselect=pyarrow/tests/test_fs.py::test_filesystem_from_uri_gcs" + ]; disabledTests = [ "GcsFileSystem" ]; - preCheck = - '' - shopt -s extglob - rm -r pyarrow/!(conftest.py|tests) - mv pyarrow/conftest.py pyarrow/tests/parent_conftest.py - substituteInPlace pyarrow/tests/conftest.py --replace ..conftest .parent_conftest - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # OSError: [Errno 24] Too many open files - ulimit -n 1024 - ''; + preCheck = '' + shopt -s extglob + rm -r pyarrow/!(conftest.py|tests) + mv pyarrow/conftest.py pyarrow/tests/parent_conftest.py + substituteInPlace pyarrow/tests/conftest.py --replace ..conftest .parent_conftest + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # OSError: [Errno 24] Too many open files + ulimit -n 1024 + ''; - pythonImportsCheck = - [ "pyarrow" ] - ++ map (module: "pyarrow.${module}") [ - "compute" - "csv" - "dataset" - "feather" - "flight" - "fs" - "json" - "orc" - "parquet" - ]; + pythonImportsCheck = [ + "pyarrow" + ] + ++ map (module: "pyarrow.${module}") [ + "compute" + "csv" + "dataset" + "feather" + "flight" + "fs" + "json" + "orc" + "parquet" + ]; meta = with lib; { description = "Cross-language development platform for in-memory data"; diff --git a/pkgs/development/python-modules/pybase64/default.nix b/pkgs/development/python-modules/pybase64/default.nix index 55547720b89a..73e365127214 100644 --- a/pkgs/development/python-modules/pybase64/default.nix +++ b/pkgs/development/python-modules/pybase64/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; pythonImportsCheck = [ "pybase64" ]; diff --git a/pkgs/development/python-modules/pybids/default.nix b/pkgs/development/python-modules/pybids/default.nix index 0dbe1e1c884d..46dd6db8deef 100644 --- a/pkgs/development/python-modules/pybids/default.nix +++ b/pkgs/development/python-modules/pybids/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { build-system = [ setuptools versioneer - ] ++ versioneer.optional-dependencies.toml; + ] + ++ versioneer.optional-dependencies.toml; dependencies = [ bids-validator diff --git a/pkgs/development/python-modules/pybind11-protobuf/default.nix b/pkgs/development/python-modules/pybind11-protobuf/default.nix index c38601de9b72..eb7c0aa0b072 100644 --- a/pkgs/development/python-modules/pybind11-protobuf/default.nix +++ b/pkgs/development/python-modules/pybind11-protobuf/default.nix @@ -37,20 +37,19 @@ buildPythonPackage { zlib ]; - cmakeFlags = - [ - (lib.cmakeBool "USE_SYSTEM_ABSEIL" true) - (lib.cmakeBool "USE_SYSTEM_PROTOBUF" true) - (lib.cmakeBool "USE_SYSTEM_PYBIND" true) + cmakeFlags = [ + (lib.cmakeBool "USE_SYSTEM_ABSEIL" true) + (lib.cmakeBool "USE_SYSTEM_PROTOBUF" true) + (lib.cmakeBool "USE_SYSTEM_PYBIND" true) - # The find_package calls are local to the dependencies subdirectory - (lib.cmakeBool "CMAKE_FIND_PACKAGE_TARGETS_GLOBAL" true) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Without it, Cmake prefers using Find-module which is mysteriously broken - # But the generated Config works - (lib.cmakeBool "CMAKE_FIND_PACKAGE_PREFER_CONFIG" true) - ]; + # The find_package calls are local to the dependencies subdirectory + (lib.cmakeBool "CMAKE_FIND_PACKAGE_TARGETS_GLOBAL" true) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Without it, Cmake prefers using Find-module which is mysteriously broken + # But the generated Config works + (lib.cmakeBool "CMAKE_FIND_PACKAGE_PREFER_CONFIG" true) + ]; meta = { description = "Pybind11 bindings for Google's Protocol Buffers"; diff --git a/pkgs/development/python-modules/pybind11/default.nix b/pkgs/development/python-modules/pybind11/default.nix index 1c1933537a00..e4ba0f17a025 100644 --- a/pkgs/development/python-modules/pybind11/default.nix +++ b/pkgs/development/python-modules/pybind11/default.nix @@ -60,7 +60,8 @@ buildPythonPackage rec { cmakeFlags = [ "-DBoost_INCLUDE_DIR=${lib.getDev boost}/include" "-DEIGEN3_INCLUDE_DIR=${lib.getDev eigen}/include/eigen3" - ] ++ lib.optionals (python.isPy3k && !stdenv.cc.isClang) [ "-DPYBIND11_CXX_STANDARD=-std=c++17" ]; + ] + ++ lib.optionals (python.isPy3k && !stdenv.cc.isClang) [ "-DPYBIND11_CXX_STANDARD=-std=c++17" ]; postBuild = '' # build tests diff --git a/pkgs/development/python-modules/pyclip/default.nix b/pkgs/development/python-modules/pyclip/default.nix index 588b294dc039..df12d1415cdc 100644 --- a/pkgs/development/python-modules/pyclip/default.nix +++ b/pkgs/development/python-modules/pyclip/default.nix @@ -28,12 +28,13 @@ buildPythonPackage rec { --replace docs/README.md README.md ''; - nativeCheckInputs = - [ pytest ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - xclip - xvfb-run - ]; + nativeCheckInputs = [ + pytest + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + xclip + xvfb-run + ]; checkPhase = '' runHook preCheck diff --git a/pkgs/development/python-modules/pycognito/default.nix b/pkgs/development/python-modules/pycognito/default.nix index fc7db24a708b..61441d6b1ccf 100644 --- a/pkgs/development/python-modules/pycognito/default.nix +++ b/pkgs/development/python-modules/pycognito/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { envs pyjwt requests - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; nativeCheckInputs = [ freezegun @@ -44,7 +45,8 @@ buildPythonPackage rec { moto pytestCheckHook requests-mock - ] ++ moto.optional-dependencies.cognitoidp; + ] + ++ moto.optional-dependencies.cognitoidp; enabledTestPaths = [ "tests.py" ]; diff --git a/pkgs/development/python-modules/pycookiecheat/default.nix b/pkgs/development/python-modules/pycookiecheat/default.nix index 97f3c9a407ad..4d89bd956541 100644 --- a/pkgs/development/python-modules/pycookiecheat/default.nix +++ b/pkgs/development/python-modules/pycookiecheat/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { "test_load_firefox_cookie_db" "test_no_cookies" "test_warns_for_string_browser" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_slack_config" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_slack_config" ]; meta = with lib; { description = "Borrow cookies from your browser's authenticated session for use in Python scripts"; diff --git a/pkgs/development/python-modules/pycurl/default.nix b/pkgs/development/python-modules/pycurl/default.nix index ada7bf9428bf..d4850147e1ab 100644 --- a/pkgs/development/python-modules/pycurl/default.nix +++ b/pkgs/development/python-modules/pycurl/default.nix @@ -62,31 +62,30 @@ buildPythonPackage rec { export HOME=$TMPDIR ''; - disabledTests = - [ - # tests that require network access - "test_keyfunction" - "test_keyfunction_bogus_return" - # OSError: tests/fake-curl/libcurl/with_openssl.so: cannot open shared object file: No such file or directory - "test_libcurl_ssl_openssl" - # OSError: tests/fake-curl/libcurl/with_nss.so: cannot open shared object file: No such file or directory - "test_libcurl_ssl_nss" - # OSError: tests/fake-curl/libcurl/with_gnutls.so: cannot open shared object file: No such file or directory - "test_libcurl_ssl_gnutls" - # AssertionError: assert 'crypto' in ['curl'] - "test_ssl_in_static_libs" - # https://github.com/pycurl/pycurl/issues/819 - "test_multi_socket_select" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # https://github.com/pycurl/pycurl/issues/729 - "test_easy_pause_unpause" - "test_multi_socket_action" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # Fatal Python error: Segmentation fault - "cadata_test" - ]; + disabledTests = [ + # tests that require network access + "test_keyfunction" + "test_keyfunction_bogus_return" + # OSError: tests/fake-curl/libcurl/with_openssl.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_openssl" + # OSError: tests/fake-curl/libcurl/with_nss.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_nss" + # OSError: tests/fake-curl/libcurl/with_gnutls.so: cannot open shared object file: No such file or directory + "test_libcurl_ssl_gnutls" + # AssertionError: assert 'crypto' in ['curl'] + "test_ssl_in_static_libs" + # https://github.com/pycurl/pycurl/issues/819 + "test_multi_socket_select" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # https://github.com/pycurl/pycurl/issues/729 + "test_easy_pause_unpause" + "test_multi_socket_action" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # Fatal Python error: Segmentation fault + "cadata_test" + ]; disabledTestPaths = [ # https://github.com/pycurl/pycurl/issues/856 diff --git a/pkgs/development/python-modules/pycyphal/default.nix b/pkgs/development/python-modules/pycyphal/default.nix index 1fc20c3b80b2..112cb1736220 100644 --- a/pkgs/development/python-modules/pycyphal/default.nix +++ b/pkgs/development/python-modules/pycyphal/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-asyncio - ] ++ builtins.foldl' (x: y: x ++ y) [ ] (builtins.attrValues optional-dependencies); + ] + ++ builtins.foldl' (x: y: x ++ y) [ ] (builtins.attrValues optional-dependencies); preCheck = '' export HOME=$TMPDIR diff --git a/pkgs/development/python-modules/pydantic/1.nix b/pkgs/development/python-modules/pydantic/1.nix index 0fa36cec41a1..d6449035de18 100644 --- a/pkgs/development/python-modules/pydantic/1.nix +++ b/pkgs/development/python-modules/pydantic/1.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { pytest-mock pytest7CheckHook writableTmpDirAsHomeHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); enableParallelBuilding = true; diff --git a/pkgs/development/python-modules/pydantic/default.nix b/pkgs/development/python-modules/pydantic/default.nix index 890759f08a84..22552b125b38 100644 --- a/pkgs/development/python-modules/pydantic/default.nix +++ b/pkgs/development/python-modules/pydantic/default.nix @@ -61,19 +61,18 @@ buildPythonPackage rec { email = [ email-validator ]; }; - nativeCheckInputs = - [ - cloudpickle - dirty-equals - jsonschema - pytest-codspeed - pytest-mock - pytest-run-parallel - pytestCheckHook - rich - ] - ++ lib.flatten (lib.attrValues optional-dependencies) - ++ lib.optionals (pythonOlder "3.10") [ eval-type-backport ]; + nativeCheckInputs = [ + cloudpickle + dirty-equals + jsonschema + pytest-codspeed + pytest-mock + pytest-run-parallel + pytestCheckHook + rich + ] + ++ lib.flatten (lib.attrValues optional-dependencies) + ++ lib.optionals (pythonOlder "3.10") [ eval-type-backport ]; preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/development/python-modules/pydeck/default.nix b/pkgs/development/python-modules/pydeck/default.nix index 51cb247a5179..258d996d1283 100644 --- a/pkgs/development/python-modules/pydeck/default.nix +++ b/pkgs/development/python-modules/pydeck/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pandas - ] ++ optional-dependencies.jupyter; + ] + ++ optional-dependencies.jupyter; # tries to start a jupyter server disabledTests = [ "test_nbconvert" ]; diff --git a/pkgs/development/python-modules/pydevd/default.nix b/pkgs/development/python-modules/pydevd/default.nix index e138896db2d4..47280989ba08 100644 --- a/pkgs/development/python-modules/pydevd/default.nix +++ b/pkgs/development/python-modules/pydevd/default.nix @@ -49,33 +49,32 @@ buildPythonPackage rec { untangle ]; - disabledTests = - [ - # Require network connection - "test_completion_sockets_and_messages" - "test_path_translation" - "test_attach_to_pid_no_threads" - "test_attach_to_pid_halted" - "test_remote_debugger_threads" - "test_path_translation_and_source_reference" - "test_attach_to_pid" - "test_terminate" - "test_gui_event_loop_custom" - # AssertionError: assert '/usr/bin/' == '/usr/bin' - # https://github.com/fabioz/PyDev.Debugger/issues/227 - "test_to_server_and_to_client" - # Times out - "test_case_sys_exit_multiple_exception_attach" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # raise segmentation fault - # https://github.com/fabioz/PyDev.Debugger/issues/269 - "test_evaluate_expression" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_multiprocessing_simple" - "test_evaluate_exception_trace" - ]; + disabledTests = [ + # Require network connection + "test_completion_sockets_and_messages" + "test_path_translation" + "test_attach_to_pid_no_threads" + "test_attach_to_pid_halted" + "test_remote_debugger_threads" + "test_path_translation_and_source_reference" + "test_attach_to_pid" + "test_terminate" + "test_gui_event_loop_custom" + # AssertionError: assert '/usr/bin/' == '/usr/bin' + # https://github.com/fabioz/PyDev.Debugger/issues/227 + "test_to_server_and_to_client" + # Times out + "test_case_sys_exit_multiple_exception_attach" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # raise segmentation fault + # https://github.com/fabioz/PyDev.Debugger/issues/269 + "test_evaluate_expression" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_multiprocessing_simple" + "test_evaluate_exception_trace" + ]; pythonImportsCheck = [ "pydevd" ]; diff --git a/pkgs/development/python-modules/pydicom/default.nix b/pkgs/development/python-modules/pydicom/default.nix index f1c42f7579c9..bfab7cb2f30f 100644 --- a/pkgs/development/python-modules/pydicom/default.nix +++ b/pkgs/development/python-modules/pydicom/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook writableTmpDirAsHomeHook - ] ++ optional-dependencies.pixeldata; + ] + ++ optional-dependencies.pixeldata; # Setting $HOME to prevent pytest to try to create a folder inside # /homeless-shelter which is read-only. @@ -65,27 +66,26 @@ buildPythonPackage rec { ln -s ${test_data}/data_store/data $HOME/.pydicom/data ''; - disabledTests = - [ - # tries to remove a dicom inside $HOME/.pydicom/data/ and download it again - "test_fetch_data_files" + disabledTests = [ + # tries to remove a dicom inside $HOME/.pydicom/data/ and download it again + "test_fetch_data_files" - # test_reference_expl{,_binary}[parametric_map_float.dcm] tries to download that file for some reason even though it's present in test-data - "test_reference_expl" - "test_reference_expl_binary" + # test_reference_expl{,_binary}[parametric_map_float.dcm] tries to download that file for some reason even though it's present in test-data + "test_reference_expl" + "test_reference_expl_binary" - # slight error in regex matching - "test_no_decoders_raises" - "test_deepcopy_bufferedreader_raises" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # https://github.com/pydicom/pydicom/issues/1386 - "test_array" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # flaky, hard to reproduce failure outside hydra - "test_time_check" - ]; + # slight error in regex matching + "test_no_decoders_raises" + "test_deepcopy_bufferedreader_raises" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # https://github.com/pydicom/pydicom/issues/1386 + "test_array" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # flaky, hard to reproduce failure outside hydra + "test_time_check" + ]; pythonImportsCheck = [ "pydicom" ]; diff --git a/pkgs/development/python-modules/pydruid/default.nix b/pkgs/development/python-modules/pydruid/default.nix index 788310c18c65..b6a54fb7f945 100644 --- a/pkgs/development/python-modules/pydruid/default.nix +++ b/pkgs/development/python-modules/pydruid/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pycurl - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "pydruid" ]; diff --git a/pkgs/development/python-modules/pyecharts/default.nix b/pkgs/development/python-modules/pyecharts/default.nix index 38750eccb96b..22a55c389e53 100644 --- a/pkgs/development/python-modules/pyecharts/default.nix +++ b/pkgs/development/python-modules/pyecharts/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { pandas pytestCheckHook requests - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "pyecharts" ]; diff --git a/pkgs/development/python-modules/pyfakefs/default.nix b/pkgs/development/python-modules/pyfakefs/default.nix index 0dbf36540165..99379e07d034 100644 --- a/pkgs/development/python-modules/pyfakefs/default.nix +++ b/pkgs/development/python-modules/pyfakefs/default.nix @@ -38,14 +38,13 @@ buildPythonPackage rec { "pyfakefs/tests" ]; - disabledTests = - [ - "test_expand_root" - ] - ++ (lib.optionals stdenv.hostPlatform.isDarwin [ - # this test fails on darwin due to case-insensitive file system - "test_rename_dir_to_existing_dir" - ]); + disabledTests = [ + "test_expand_root" + ] + ++ (lib.optionals stdenv.hostPlatform.isDarwin [ + # this test fails on darwin due to case-insensitive file system + "test_rename_dir_to_existing_dir" + ]); meta = with lib; { description = "Fake file system that mocks the Python file system modules"; diff --git a/pkgs/development/python-modules/pyfnip/default.nix b/pkgs/development/python-modules/pyfnip/default.nix index 919ddea552a5..d86c35104d6e 100644 --- a/pkgs/development/python-modules/pyfnip/default.nix +++ b/pkgs/development/python-modules/pyfnip/default.nix @@ -22,7 +22,8 @@ buildPythonPackage rec { dependencies = [ requests - ] ++ lib.optionals (pythonAtLeast "3.13") [ standard-telnetlib ]; + ] + ++ lib.optionals (pythonAtLeast "3.13") [ standard-telnetlib ]; # Project has no tests doCheck = false; diff --git a/pkgs/development/python-modules/pyftgl/default.nix b/pkgs/development/python-modules/pyftgl/default.nix index 579513a9e9ca..8cb6330d5e92 100644 --- a/pkgs/development/python-modules/pyftgl/default.nix +++ b/pkgs/development/python-modules/pyftgl/default.nix @@ -29,14 +29,13 @@ buildPythonPackage rec { build-system = [ setuptools ]; - postPatch = - '' - substituteInPlace setup.py \ - --replace-fail boost_python boost_python${pythonVersion} - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export NIX_CFLAGS_COMPILE+=" -L$SDKROOT/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" - ''; + postPatch = '' + substituteInPlace setup.py \ + --replace-fail boost_python boost_python${pythonVersion} + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export NIX_CFLAGS_COMPILE+=" -L$SDKROOT/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" + ''; buildInputs = [ boost diff --git a/pkgs/development/python-modules/pygal/default.nix b/pkgs/development/python-modules/pygal/default.nix index 48bf2a93bfdf..e6aeafc66b03 100644 --- a/pkgs/development/python-modules/pygal/default.nix +++ b/pkgs/development/python-modules/pygal/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pyquery pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' # necessary on darwin to pass the testsuite diff --git a/pkgs/development/python-modules/pygame-ce/default.nix b/pkgs/development/python-modules/pygame-ce/default.nix index 9b7a912499e3..edef7857b042 100644 --- a/pkgs/development/python-modules/pygame-ce/default.nix +++ b/pkgs/development/python-modules/pygame-ce/default.nix @@ -65,30 +65,29 @@ buildPythonPackage rec { ./skip-rle-tests.patch ]; - postPatch = - '' - # "pyproject-metadata!=0.9.1" was pinned due to https://github.com/pygame-community/pygame-ce/pull/3395 - # cython was pinned to fix windows build hangs (pygame-community/pygame-ce/pull/3015) - substituteInPlace pyproject.toml \ - --replace-fail '"pyproject-metadata!=0.9.1",' '"pyproject-metadata",' \ - --replace-fail '"meson<=1.7.0",' '"meson",' \ - --replace-fail '"meson-python<=0.17.1",' '"meson-python",' \ - --replace-fail '"ninja<=1.12.1",' "" \ - --replace-fail '"cython<=3.0.11",' '"cython",' \ - --replace-fail '"sphinx<=8.1.3",' "" \ - --replace-fail '"sphinx-autoapi<=3.3.2",' "" - substituteInPlace buildconfig/config_{unix,darwin}.py \ - --replace-fail 'from distutils' 'from setuptools._distutils' - substituteInPlace src_py/sysfont.py \ - --replace-fail 'path="fc-list"' 'path="${fontconfig}/bin/fc-list"' \ - --replace-fail /usr/X11/bin/fc-list ${fontconfig}/bin/fc-list - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # flaky - rm test/system_test.py - substituteInPlace test/meson.build \ - --replace-fail "'system_test.py'," "" - ''; + postPatch = '' + # "pyproject-metadata!=0.9.1" was pinned due to https://github.com/pygame-community/pygame-ce/pull/3395 + # cython was pinned to fix windows build hangs (pygame-community/pygame-ce/pull/3015) + substituteInPlace pyproject.toml \ + --replace-fail '"pyproject-metadata!=0.9.1",' '"pyproject-metadata",' \ + --replace-fail '"meson<=1.7.0",' '"meson",' \ + --replace-fail '"meson-python<=0.17.1",' '"meson-python",' \ + --replace-fail '"ninja<=1.12.1",' "" \ + --replace-fail '"cython<=3.0.11",' '"cython",' \ + --replace-fail '"sphinx<=8.1.3",' "" \ + --replace-fail '"sphinx-autoapi<=3.3.2",' "" + substituteInPlace buildconfig/config_{unix,darwin}.py \ + --replace-fail 'from distutils' 'from setuptools._distutils' + substituteInPlace src_py/sysfont.py \ + --replace-fail 'path="fc-list"' 'path="${fontconfig}/bin/fc-list"' \ + --replace-fail /usr/X11/bin/fc-list ${fontconfig}/bin/fc-list + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # flaky + rm test/system_test.py + substituteInPlace test/meson.build \ + --replace-fail "'system_test.py'," "" + ''; nativeBuildInputs = [ pkg-config @@ -119,13 +118,12 @@ buildPythonPackage rec { ${python.pythonOnBuildForHost.interpreter} -m buildconfig.config ''; - env = - { - SDL_CONFIG = lib.getExe' (lib.getDev SDL2) "sdl2-config"; - } - // lib.optionalAttrs stdenv.cc.isClang { - NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types"; - }; + env = { + SDL_CONFIG = lib.getExe' (lib.getDev SDL2) "sdl2-config"; + } + // lib.optionalAttrs stdenv.cc.isClang { + NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types"; + }; preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/development/python-modules/pygame-gui/default.nix b/pkgs/development/python-modules/pygame-gui/default.nix index e045ccf5af53..4aa759dd63db 100644 --- a/pkgs/development/python-modules/pygame-gui/default.nix +++ b/pkgs/development/python-modules/pygame-gui/default.nix @@ -43,24 +43,23 @@ buildPythonPackage rec { export SDL_VIDEODRIVER=dummy ''; - disabledTests = - [ - # Clipboard doesn't exist in test environment - "test_process_event_text_ctrl_c" - "test_process_event_text_ctrl_v" - "test_process_event_text_ctrl_v_nothing" - "test_process_event_ctrl_v_over_limit" - "test_process_event_ctrl_v_at_limit" - "test_process_event_ctrl_v_over_limit_select_range" - "test_process_event_text_ctrl_v_select_range" - "test_process_event_text_ctrl_a" - "test_process_event_text_ctrl_x" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fails to determine "/" as an existing path - # https://github.com/MyreMylar/pygame_gui/issues/644 - "test_process_event" - ]; + disabledTests = [ + # Clipboard doesn't exist in test environment + "test_process_event_text_ctrl_c" + "test_process_event_text_ctrl_v" + "test_process_event_text_ctrl_v_nothing" + "test_process_event_ctrl_v_over_limit" + "test_process_event_ctrl_v_at_limit" + "test_process_event_ctrl_v_over_limit_select_range" + "test_process_event_text_ctrl_v_select_range" + "test_process_event_text_ctrl_a" + "test_process_event_text_ctrl_x" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fails to determine "/" as an existing path + # https://github.com/MyreMylar/pygame_gui/issues/644 + "test_process_event" + ]; disabledTestPaths = [ "tests/test_performance/test_text_performance.py" ]; diff --git a/pkgs/development/python-modules/pygatt/default.nix b/pkgs/development/python-modules/pygatt/default.nix index 7233c5b4153c..6e6ff7905a00 100644 --- a/pkgs/development/python-modules/pygatt/default.nix +++ b/pkgs/development/python-modules/pygatt/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ optional-dependencies.GATTTOOL; + ] + ++ optional-dependencies.GATTTOOL; pythonImportsCheck = [ "pygatt" ]; diff --git a/pkgs/development/python-modules/pygit2/default.nix b/pkgs/development/python-modules/pygit2/default.nix index 50cf47eee03c..3e62e5dd42f7 100644 --- a/pkgs/development/python-modules/pygit2/default.nix +++ b/pkgs/development/python-modules/pygit2/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { dependencies = [ cached-property pycparser - ] ++ lib.optionals (!isPyPy) [ cffi ]; + ] + ++ lib.optionals (!isPyPy) [ cffi ]; propagatedNativeBuildInputs = lib.optionals (!isPyPy) [ cffi ]; diff --git a/pkgs/development/python-modules/pygithub/default.nix b/pkgs/development/python-modules/pygithub/default.nix index d70539558ac5..86cc0e436660 100644 --- a/pkgs/development/python-modules/pygithub/default.nix +++ b/pkgs/development/python-modules/pygithub/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { requests typing-extensions urllib3 - ] ++ pyjwt.optional-dependencies.crypto; + ] + ++ pyjwt.optional-dependencies.crypto; # Test suite makes REST calls against github.com doCheck = false; diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix index 88dfb1e1abb3..18c6690e60f6 100644 --- a/pkgs/development/python-modules/pygobject/3.nix +++ b/pkgs/development/python-modules/pygobject/3.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { buildInputs = [ cairo glib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ ncurses ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ ncurses ]; propagatedBuildInputs = [ pycairo diff --git a/pkgs/development/python-modules/pyhanko/default.nix b/pkgs/development/python-modules/pyhanko/default.nix index e6c34ec446bd..e1b626c7863e 100644 --- a/pkgs/development/python-modules/pyhanko/default.nix +++ b/pkgs/development/python-modules/pyhanko/default.nix @@ -90,53 +90,52 @@ buildPythonPackage rec { pytestCheckHook python-pae requests-mock - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); - disabledTestPaths = - [ - # ModuleNotFoundError: No module named 'csc_dummy' - "pyhanko_tests/test_csc.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # OSError: One or more parameters passed to a function were not valid. - "pyhanko_tests/cli_tests" - ]; + disabledTestPaths = [ + # ModuleNotFoundError: No module named 'csc_dummy' + "pyhanko_tests/test_csc.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # OSError: One or more parameters passed to a function were not valid. + "pyhanko_tests/cli_tests" + ]; - disabledTests = - [ - # Most of the test require working with local certificates, - # contacting OSCP or performing requests - "test_generic_data_sign_legacy" - "test_generic_data_sign" - "test_cms_v3_sign" - "test_detached_cms_with_self_reported_timestamp" - "test_detached_cms_with_tst" - "test_detached_cms_with_content_tst" - "test_detached_cms_with_wrong_content_tst" - "test_detached_with_malformed_content_tst" - "test_noop_attribute_prov" - "test_detached_cades_cms_with_tst" - "test_read_qr_config" - "test_no_changes_policy" - "test_bogus_metadata_manipulation" - "test_tamper_sig_obj" - "test_signed_file_diff_proxied_objs" - "test_pades_revinfo_live" - "test_diff_fallback_ok" - "test_no_diff_summary" - "test_ocsp_embed" - "test_ts_fetch_aiohttp" - "test_ts_fetch_requests" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # OSError: One or more parameters passed to a function were not valid. - "test_detached_cms_with_duplicated_attr" - "test_detached_cms_with_wrong_tst" - "test_diff_analysis_add_extensions_dict" - "test_diff_analysis_update_indirect_extensions_not_all_path" - "test_no_certificates" - "test_ocsp_without_nextupdate_embed" - ]; + disabledTests = [ + # Most of the test require working with local certificates, + # contacting OSCP or performing requests + "test_generic_data_sign_legacy" + "test_generic_data_sign" + "test_cms_v3_sign" + "test_detached_cms_with_self_reported_timestamp" + "test_detached_cms_with_tst" + "test_detached_cms_with_content_tst" + "test_detached_cms_with_wrong_content_tst" + "test_detached_with_malformed_content_tst" + "test_noop_attribute_prov" + "test_detached_cades_cms_with_tst" + "test_read_qr_config" + "test_no_changes_policy" + "test_bogus_metadata_manipulation" + "test_tamper_sig_obj" + "test_signed_file_diff_proxied_objs" + "test_pades_revinfo_live" + "test_diff_fallback_ok" + "test_no_diff_summary" + "test_ocsp_embed" + "test_ts_fetch_aiohttp" + "test_ts_fetch_requests" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # OSError: One or more parameters passed to a function were not valid. + "test_detached_cms_with_duplicated_attr" + "test_detached_cms_with_wrong_tst" + "test_diff_analysis_add_extensions_dict" + "test_diff_analysis_update_indirect_extensions_not_all_path" + "test_no_certificates" + "test_ocsp_without_nextupdate_embed" + ]; pythonImportsCheck = [ "pyhanko" ]; diff --git a/pkgs/development/python-modules/pyheos/default.nix b/pkgs/development/python-modules/pyheos/default.nix index ad154e5cd6ea..da1f9fefc08c 100644 --- a/pkgs/development/python-modules/pyheos/default.nix +++ b/pkgs/development/python-modules/pyheos/default.nix @@ -29,15 +29,14 @@ buildPythonPackage rec { syrupy ]; - disabledTests = - [ - # accesses network - "test_connect_timeout" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # OSError: could not bind on any address out of [('127.0.0.2', 1255)] - "test_failover" - ]; + disabledTests = [ + # accesses network + "test_connect_timeout" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # OSError: could not bind on any address out of [('127.0.0.2', 1255)] + "test_failover" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/pyiceberg/default.nix b/pkgs/development/python-modules/pyiceberg/default.nix index 01b4af3523ba..e6fd6185591c 100644 --- a/pkgs/development/python-modules/pyiceberg/default.nix +++ b/pkgs/development/python-modules/pyiceberg/default.nix @@ -182,7 +182,8 @@ buildPythonPackage rec { s3fs sqlalchemy thrift - ] ++ moto.optional-dependencies.server; + ] + ++ moto.optional-dependencies.server; pytestFlagsArray = [ "-W" @@ -198,61 +199,60 @@ buildPythonPackage rec { "tests/integration" ]; - disabledTests = - [ - # ModuleNotFoundError: No module named 'puresasl' - "test_create_hive_client_with_kerberos" - "test_create_hive_client_with_kerberos_using_context_manager" + disabledTests = [ + # ModuleNotFoundError: No module named 'puresasl' + "test_create_hive_client_with_kerberos" + "test_create_hive_client_with_kerberos_using_context_manager" - # Require unpackaged pyiceberg_core - "test_bucket_pyarrow_transforms" - "test_transform_consistency_with_pyarrow_transform" - "test_truncate_pyarrow_transforms" + # Require unpackaged pyiceberg_core + "test_bucket_pyarrow_transforms" + "test_transform_consistency_with_pyarrow_transform" + "test_truncate_pyarrow_transforms" - # botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL - "test_checking_if_a_file_exists" - "test_closing_a_file" - "test_fsspec_file_tell" - "test_fsspec_getting_length_of_file" - "test_fsspec_pickle_round_trip_s3" - "test_fsspec_raise_on_opening_file_not_found" - "test_fsspec_read_specified_bytes_for_file" - "test_fsspec_write_and_read_file" - "test_writing_avro_file" + # botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL + "test_checking_if_a_file_exists" + "test_closing_a_file" + "test_fsspec_file_tell" + "test_fsspec_getting_length_of_file" + "test_fsspec_pickle_round_trip_s3" + "test_fsspec_raise_on_opening_file_not_found" + "test_fsspec_read_specified_bytes_for_file" + "test_fsspec_write_and_read_file" + "test_writing_avro_file" - # Require unpackaged gcsfs - "test_fsspec_converting_an_outputfile_to_an_inputfile_gcs" - "test_fsspec_new_input_file_gcs" - "test_fsspec_new_output_file_gcs" - "test_fsspec_pickle_roundtrip_gcs" + # Require unpackaged gcsfs + "test_fsspec_converting_an_outputfile_to_an_inputfile_gcs" + "test_fsspec_new_input_file_gcs" + "test_fsspec_new_output_file_gcs" + "test_fsspec_pickle_roundtrip_gcs" - # Timeout (network access) - "test_fsspec_converting_an_outputfile_to_an_inputfile_adls" - "test_fsspec_new_abfss_output_file_adls" - "test_fsspec_new_input_file_adls" - "test_fsspec_pickle_round_trip_aldfs" - "test_partitioned_write" - "test_token_200_w_oauth2_server_uri" + # Timeout (network access) + "test_fsspec_converting_an_outputfile_to_an_inputfile_adls" + "test_fsspec_new_abfss_output_file_adls" + "test_fsspec_new_input_file_adls" + "test_fsspec_pickle_round_trip_aldfs" + "test_partitioned_write" + "test_token_200_w_oauth2_server_uri" - # Hangs forever (from tests/io/test_pyarrow.py) - "test_getting_length_of_file_gcs" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # ImportError: The pyarrow installation is not built with support for 'GcsFileSystem' - "test_converting_an_outputfile_to_an_inputfile_gcs" - "test_new_input_file_gcs" - "test_new_output_file_gc" + # Hangs forever (from tests/io/test_pyarrow.py) + "test_getting_length_of_file_gcs" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # ImportError: The pyarrow installation is not built with support for 'GcsFileSystem' + "test_converting_an_outputfile_to_an_inputfile_gcs" + "test_new_input_file_gcs" + "test_new_output_file_gc" - # PermissionError: [Errno 13] Failed to open local file - # '/tmp/iceberg/warehouse/default.db/test_projection_partitions/metadata/00000-6c1c61a1-495f-45d3-903d-a2643431be91.metadata.json' - "test_identity_transform_column_projection" - "test_identity_transform_columns_projection" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # AssertionError: - # assert "Incompatible with StructProtocol: " in "Unable to initialize struct: " - "test_read_not_struct_type" - ]; + # PermissionError: [Errno 13] Failed to open local file + # '/tmp/iceberg/warehouse/default.db/test_projection_partitions/metadata/00000-6c1c61a1-495f-45d3-903d-a2643431be91.metadata.json' + "test_identity_transform_column_projection" + "test_identity_transform_columns_projection" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # AssertionError: + # assert "Incompatible with StructProtocol: " in "Unable to initialize struct: " + "test_read_not_struct_type" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/pyinfra/default.nix b/pkgs/development/python-modules/pyinfra/default.nix index 1a2aa719e568..88bd5a77e525 100644 --- a/pkgs/development/python-modules/pyinfra/default.nix +++ b/pkgs/development/python-modules/pyinfra/default.nix @@ -34,21 +34,20 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - click - distro - gevent - jinja2 - packaging - paramiko - python-dateutil - pywinrm - setuptools - typeguard - ] - ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + dependencies = [ + click + distro + gevent + jinja2 + packaging + paramiko + python-dateutil + pywinrm + setuptools + typeguard + ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/pyipp/default.nix b/pkgs/development/python-modules/pyipp/default.nix index 311b836eb12d..eb339091d020 100644 --- a/pkgs/development/python-modules/pyipp/default.nix +++ b/pkgs/development/python-modules/pyipp/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { backoff deepmerge yarl - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; nativeCheckInputs = [ aresponses diff --git a/pkgs/development/python-modules/pykakasi/default.nix b/pkgs/development/python-modules/pykakasi/default.nix index 665d435575d6..f81ba52312a9 100644 --- a/pkgs/development/python-modules/pykakasi/default.nix +++ b/pkgs/development/python-modules/pykakasi/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { dependencies = [ jaconv deprecated - ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; nativeCheckInputs = [ py-cpuinfo diff --git a/pkgs/development/python-modules/pykaleidescape/default.nix b/pkgs/development/python-modules/pykaleidescape/default.nix index 5862c258d2df..e461e8e66167 100644 --- a/pkgs/development/python-modules/pykaleidescape/default.nix +++ b/pkgs/development/python-modules/pykaleidescape/default.nix @@ -39,16 +39,15 @@ buildPythonPackage rec { pythonImportsCheck = [ "kaleidescape" ]; - disabledTests = - [ - # Test requires network access - "test_resolve_succeeds" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # stuck in EpollSelector.poll() - "test_manual_disconnect" - "test_concurrency" - ]; + disabledTests = [ + # Test requires network access + "test_resolve_succeeds" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # stuck in EpollSelector.poll() + "test_manual_disconnect" + "test_concurrency" + ]; meta = with lib; { description = "Module for controlling Kaleidescape devices"; diff --git a/pkgs/development/python-modules/pylance/default.nix b/pkgs/development/python-modules/pylance/default.nix index 98843676082a..758c3299f513 100644 --- a/pkgs/development/python-modules/pylance/default.nix +++ b/pkgs/development/python-modules/pylance/default.nix @@ -92,44 +92,44 @@ buildPythonPackage rec { polars pytestCheckHook tqdm - ] ++ optional-dependencies.torch; + ] + ++ optional-dependencies.torch; preCheck = '' cd python/tests ''; - disabledTests = - [ - # Writes to read-only build directory - "test_add_data_storage_version" - "test_fix_data_storage_version" - "test_fts_backward_v0_27_0" + disabledTests = [ + # Writes to read-only build directory + "test_add_data_storage_version" + "test_fix_data_storage_version" + "test_fts_backward_v0_27_0" - # AttributeError: 'SessionContext' object has no attribute 'register_table_provider' - "test_table_loading" + # AttributeError: 'SessionContext' object has no attribute 'register_table_provider' + "test_table_loading" - # subprocess.CalledProcessError: Command ... returned non-zero exit status 1. - # ModuleNotFoundError: No module named 'lance' - "test_tracing" + # subprocess.CalledProcessError: Command ... returned non-zero exit status 1. + # ModuleNotFoundError: No module named 'lance' + "test_tracing" - # Flaky (AssertionError) - "test_index_cache_size" + # Flaky (AssertionError) + "test_index_cache_size" - # OSError: LanceError(IO): Failed to initialize default tokenizer: - # An invalid argument was passed: - # 'LinderaError { kind: Parse, source: failed to build tokenizer: LinderaError(kind=Io, source=No such file or directory (os error 2)) }', /build/source/rust/lance-index/src/scalar/inverted/tokenizer/lindera.rs:63:21 - "test_lindera_load_config_fallback" + # OSError: LanceError(IO): Failed to initialize default tokenizer: + # An invalid argument was passed: + # 'LinderaError { kind: Parse, source: failed to build tokenizer: LinderaError(kind=Io, source=No such file or directory (os error 2)) }', /build/source/rust/lance-index/src/scalar/inverted/tokenizer/lindera.rs:63:21 + "test_lindera_load_config_fallback" - # OSError: LanceError(IO): Failed to load tokenizer config - "test_indexed_filter_with_fts_index_with_lindera_ipadic_jp_tokenizer" - "test_lindera_ipadic_jp_tokenizer_bin_user_dict" - "test_lindera_ipadic_jp_tokenizer_csv_user_dict" - "test_lindera_load_config_priority" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # OSError: LanceError(IO): Resources exhausted: Failed to allocate additional 1245184 bytes for ExternalSorter[0]... - "test_merge_insert_large" - ]; + # OSError: LanceError(IO): Failed to load tokenizer config + "test_indexed_filter_with_fts_index_with_lindera_ipadic_jp_tokenizer" + "test_lindera_ipadic_jp_tokenizer_bin_user_dict" + "test_lindera_ipadic_jp_tokenizer_csv_user_dict" + "test_lindera_load_config_priority" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # OSError: LanceError(IO): Resources exhausted: Failed to allocate additional 1245184 bytes for ExternalSorter[0]... + "test_merge_insert_large" + ]; meta = { description = "Python wrapper for Lance columnar format"; diff --git a/pkgs/development/python-modules/pylint/default.nix b/pkgs/development/python-modules/pylint/default.nix index cd406ad69d85..78cfec1a22be 100644 --- a/pkgs/development/python-modules/pylint/default.nix +++ b/pkgs/development/python-modules/pylint/default.nix @@ -37,17 +37,16 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - astroid - dill - isort - mccabe - platformdirs - tomlkit - ] - ++ lib.optionals (pythonOlder "3.11") [ tomli ] - ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; + dependencies = [ + astroid + dill + isort + mccabe + platformdirs + tomlkit + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ] + ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; nativeCheckInputs = [ gitpython @@ -80,28 +79,27 @@ buildPythonPackage rec { "tests/pyreverse/test_writer.py" ]; - disabledTests = - [ - # AssertionError when self executing and checking output - # expected output looks like it should match though - "test_invocation_of_pylint_config" - "test_generate_rcfile" - "test_generate_toml_config" - "test_help_msg" - "test_output_of_callback_options" - # Failed: DID NOT WARN. No warnings of type (,) were emitted. The list of emitted warnings is: []. - "test_save_and_load_not_a_linter_stats" - # Truncated string expectation mismatch - "test_truncated_compare" - # Probably related to pytest versions, see pylint-dev/pylint#9477 and pylint-dev/pylint#9483 - "test_functional" - # AssertionError: assert [('specializa..., 'Ancestor')] == [('aggregatio..., 'Ancestor')] - "test_functional_relation_extraction" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_parallel_execution" - "test_py3k_jobs_option" - ]; + disabledTests = [ + # AssertionError when self executing and checking output + # expected output looks like it should match though + "test_invocation_of_pylint_config" + "test_generate_rcfile" + "test_generate_toml_config" + "test_help_msg" + "test_output_of_callback_options" + # Failed: DID NOT WARN. No warnings of type (,) were emitted. The list of emitted warnings is: []. + "test_save_and_load_not_a_linter_stats" + # Truncated string expectation mismatch + "test_truncated_compare" + # Probably related to pytest versions, see pylint-dev/pylint#9477 and pylint-dev/pylint#9483 + "test_functional" + # AssertionError: assert [('specializa..., 'Ancestor')] == [('aggregatio..., 'Ancestor')] + "test_functional_relation_extraction" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_parallel_execution" + "test_py3k_jobs_option" + ]; meta = { description = "Bug and style checker for Python"; diff --git a/pkgs/development/python-modules/pylsp-mypy/default.nix b/pkgs/development/python-modules/pylsp-mypy/default.nix index 8ff5d66ccf49..63c5a1bdfb9a 100644 --- a/pkgs/development/python-modules/pylsp-mypy/default.nix +++ b/pkgs/development/python-modules/pylsp-mypy/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { dependencies = [ mypy python-lsp-server - ] ++ lib.optional (pythonOlder "3.11") tomli; + ] + ++ lib.optional (pythonOlder "3.11") tomli; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/pylutron-caseta/default.nix b/pkgs/development/python-modules/pylutron-caseta/default.nix index a49fd9922a61..3c67d46ea972 100644 --- a/pkgs/development/python-modules/pylutron-caseta/default.nix +++ b/pkgs/development/python-modules/pylutron-caseta/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { dependencies = [ cryptography orjson - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; optional-dependencies = { cli = [ @@ -48,7 +49,8 @@ buildPythonPackage rec { pytest-asyncio pytest-timeout pytestCheckHook - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; pytestFlags = [ "--asyncio-mode=auto" ]; diff --git a/pkgs/development/python-modules/pym3u8downloader/default.nix b/pkgs/development/python-modules/pym3u8downloader/default.nix index 283dcbaee981..c277d4dc8502 100644 --- a/pkgs/development/python-modules/pym3u8downloader/default.nix +++ b/pkgs/development/python-modules/pym3u8downloader/default.nix @@ -37,35 +37,29 @@ buildPythonPackage rec { pytest = pym3u8downloader.overridePythonAttrs (previousPythonAttrs: { TEST_SERVER_PORT = "8000"; - postPatch = - previousPythonAttrs.postPatch or "" - + '' - # Patch test data location - substituteInPlace tests/commonclass.py \ - --replace-fail \ - "f'https://raw.githubusercontent.com/coldsofttech/pym3u8downloader/{branch_name}/tests/files'" \ - "'http://localhost:$TEST_SERVER_PORT/tests/files'" - # Patch the `is_internet_connected()` method - substituteInPlace pym3u8downloader/__main__.py \ - --replace-fail "'http://www.github.com'" "'http://localhost:$TEST_SERVER_PORT'" - ''; + postPatch = previousPythonAttrs.postPatch or "" + '' + # Patch test data location + substituteInPlace tests/commonclass.py \ + --replace-fail \ + "f'https://raw.githubusercontent.com/coldsofttech/pym3u8downloader/{branch_name}/tests/files'" \ + "'http://localhost:$TEST_SERVER_PORT/tests/files'" + # Patch the `is_internet_connected()` method + substituteInPlace pym3u8downloader/__main__.py \ + --replace-fail "'http://www.github.com'" "'http://localhost:$TEST_SERVER_PORT'" + ''; doCheck = true; nativeCheckInputs = [ pytestCheckHook ]; - preCheck = - previousPythonAttrs.preCheck or "" - + '' - python3 -m http.server "$TEST_SERVER_PORT" & - TEST_SERVER_PID="$!" - ''; + preCheck = previousPythonAttrs.preCheck or "" + '' + python3 -m http.server "$TEST_SERVER_PORT" & + TEST_SERVER_PID="$!" + ''; - postCheck = - previousPythonAttrs.postCheck or "" - + '' - kill -s TERM "$TEST_SERVER_PID" - ''; + postCheck = previousPythonAttrs.postCheck or "" + '' + kill -s TERM "$TEST_SERVER_PID" + ''; }); }; }; diff --git a/pkgs/development/python-modules/pymatgen/default.nix b/pkgs/development/python-modules/pymatgen/default.nix index a228353d9a1a..fcf2aaa5cdbb 100644 --- a/pkgs/development/python-modules/pymatgen/default.nix +++ b/pkgs/development/python-modules/pymatgen/default.nix @@ -129,7 +129,8 @@ buildPythonPackage rec { addBinToPathHook pytestCheckHook pytest-xdist - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = # ensure tests can find these @@ -137,42 +138,41 @@ buildPythonPackage rec { export PMG_TEST_FILES_DIR="$(realpath ./tests/files)" ''; - disabledTests = - [ - # Flaky - "test_numerical_eos_values" - "test_pca" - "test_static_si_no_kgrid" - "test_thermal_conductivity" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # AttributeError: 'NoneType' object has no attribute 'items' - "test_mean_field" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fatal Python error: Aborted - # matplotlib/backend_bases.py", line 2654 in create_with_canvas - # https://github.com/materialsproject/pymatgen/issues/4452 - "test_angle" - "test_as_dict_from_dict" - "test_attributes" - "test_basic" - "test_core_state_eigen" - "test_eos_func" - "test_get_info_cohps_to_neighbors" - "test_get_plot" - "test_get_point_group_operations" - "test_matplotlib_plots" - "test_ph_plot_w_gruneisen" - "test_plot" - "test_proj_bandstructure_plot" - "test_structure" - "test_structure_environments" + disabledTests = [ + # Flaky + "test_numerical_eos_values" + "test_pca" + "test_static_si_no_kgrid" + "test_thermal_conductivity" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # AttributeError: 'NoneType' object has no attribute 'items' + "test_mean_field" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fatal Python error: Aborted + # matplotlib/backend_bases.py", line 2654 in create_with_canvas + # https://github.com/materialsproject/pymatgen/issues/4452 + "test_angle" + "test_as_dict_from_dict" + "test_attributes" + "test_basic" + "test_core_state_eigen" + "test_eos_func" + "test_get_info_cohps_to_neighbors" + "test_get_plot" + "test_get_point_group_operations" + "test_matplotlib_plots" + "test_ph_plot_w_gruneisen" + "test_plot" + "test_proj_bandstructure_plot" + "test_structure" + "test_structure_environments" - # attempt to insert nil object from objects[1] - "test_timer_10_2_7" - "test_timer" - ]; + # attempt to insert nil object from objects[1] + "test_timer_10_2_7" + "test_timer" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # Crash when running the pmg command diff --git a/pkgs/development/python-modules/pymatting/default.nix b/pkgs/development/python-modules/pymatting/default.nix index 89ca430db1c3..74fe384e059d 100644 --- a/pkgs/development/python-modules/pymatting/default.nix +++ b/pkgs/development/python-modules/pymatting/default.nix @@ -28,17 +28,16 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - numba - numpy - pillow - scipy - ] - ++ lib.optionals cudaSupport [ - cupy - pyopencl - ]; + dependencies = [ + numba + numpy + pillow + scipy + ] + ++ lib.optionals cudaSupport [ + cupy + pyopencl + ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/pymodbus/default.nix b/pkgs/development/python-modules/pymodbus/default.nix index ed8b828215ca..c6ae93737583 100644 --- a/pkgs/development/python-modules/pymodbus/default.nix +++ b/pkgs/development/python-modules/pymodbus/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { redis sqlalchemy twisted - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' pushd test @@ -59,16 +60,15 @@ buildPythonPackage rec { pythonImportsCheck = [ "pymodbus" ]; - disabledTests = - [ - # Tests often hang - "test_connected" - ] - ++ lib.optionals (lib.versionAtLeast aiohttp.version "3.9.0") [ - "test_split_serial_packet" - "test_serial_poll" - "test_simulator" - ]; + disabledTests = [ + # Tests often hang + "test_connected" + ] + ++ lib.optionals (lib.versionAtLeast aiohttp.version "3.9.0") [ + "test_split_serial_packet" + "test_serial_poll" + "test_simulator" + ]; meta = with lib; { description = "Python implementation of the Modbus protocol"; diff --git a/pkgs/development/python-modules/pymoo/default.nix b/pkgs/development/python-modules/pymoo/default.nix index 6f4d59689c50..f93c72a28969 100644 --- a/pkgs/development/python-modules/pymoo/default.nix +++ b/pkgs/development/python-modules/pymoo/default.nix @@ -94,24 +94,23 @@ buildPythonPackage rec { ]; # Select some lightweight tests pytestFlagsArray = [ "-m 'not long'" ]; - disabledTests = - [ - # ModuleNotFoundError: No module named 'pymoo.cython.non_dominated_sorting' - "test_fast_non_dominated_sorting" - "test_efficient_non_dominated_sort" - "test_dominance_degree_non_dominated_sort" + disabledTests = [ + # ModuleNotFoundError: No module named 'pymoo.cython.non_dominated_sorting' + "test_fast_non_dominated_sorting" + "test_efficient_non_dominated_sort" + "test_dominance_degree_non_dominated_sort" - # sensitive to float precision - "test_cd_and_pcd" + # sensitive to float precision + "test_cd_and_pcd" - # TypeError: 'NoneType' object is not subscriptable - "test_dascomp" - "test_mw" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # AttributeError: 'ZDT3' object has no attribute 'elementwise' - "test_kktpm_correctness" - ]; + # TypeError: 'NoneType' object is not subscriptable + "test_dascomp" + "test_mw" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # AttributeError: 'ZDT3' object has no attribute 'elementwise' + "test_kktpm_correctness" + ]; disabledTestPaths = [ # sensitive to float precision "tests/algorithms/test_no_modfication.py" diff --git a/pkgs/development/python-modules/pympler/default.nix b/pkgs/development/python-modules/pympler/default.nix index 4a786a454863..8a68f5bbc245 100644 --- a/pkgs/development/python-modules/pympler/default.nix +++ b/pkgs/development/python-modules/pympler/default.nix @@ -28,30 +28,29 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = - [ - # 'AssertionError: 'function (test.muppy.test_summary.func)' != 'function (muppy.test_summary.func)' - # https://github.com/pympler/pympler/issues/134 - "test_repr_function" - # Stuck - "test_locals" - "test_globals" - "test_traceback" - "test_otracker_diff" - "test_stracker_store_summary" - ] - ++ lib.optionals (pythonAtLeast "3.11") [ - # https://github.com/pympler/pympler/issues/148 - "test_findgarbage" - "test_get_tree" - "test_prune" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/pympler/pympler/issues/163 - "test_edges_new" - "test_edges_old" - "test_split" - ]; + disabledTests = [ + # 'AssertionError: 'function (test.muppy.test_summary.func)' != 'function (muppy.test_summary.func)' + # https://github.com/pympler/pympler/issues/134 + "test_repr_function" + # Stuck + "test_locals" + "test_globals" + "test_traceback" + "test_otracker_diff" + "test_stracker_store_summary" + ] + ++ lib.optionals (pythonAtLeast "3.11") [ + # https://github.com/pympler/pympler/issues/148 + "test_findgarbage" + "test_get_tree" + "test_prune" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/pympler/pympler/issues/163 + "test_edges_new" + "test_edges_old" + "test_split" + ]; doCheck = stdenv.hostPlatform.isLinux; diff --git a/pkgs/development/python-modules/pynamodb/default.nix b/pkgs/development/python-modules/pynamodb/default.nix index aeabc70b8688..c79ffdb9f624 100644 --- a/pkgs/development/python-modules/pynamodb/default.nix +++ b/pkgs/development/python-modules/pynamodb/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { pytest-env pytest-mock pytestCheckHook - ] ++ optional-dependencies.signal; + ] + ++ optional-dependencies.signal; pythonImportsCheck = [ "pynamodb" ]; diff --git a/pkgs/development/python-modules/pynput/default.nix b/pkgs/development/python-modules/pynput/default.nix index ca7a16e7d070..b4d643d6fbb7 100644 --- a/pkgs/development/python-modules/pynput/default.nix +++ b/pkgs/development/python-modules/pynput/default.nix @@ -46,12 +46,13 @@ buildPythonPackage rec { sphinx ]; - propagatedBuildInputs = - [ six ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - evdev - xlib - ]; + propagatedBuildInputs = [ + six + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + evdev + xlib + ]; doCheck = false; # requires running X server diff --git a/pkgs/development/python-modules/pynvim/default.nix b/pkgs/development/python-modules/pynvim/default.nix index 7501c0313358..275ba924f033 100644 --- a/pkgs/development/python-modules/pynvim/default.nix +++ b/pkgs/development/python-modules/pynvim/default.nix @@ -24,10 +24,11 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ msgpack ] - ++ lib.optionals (!isPyPy) [ greenlet ] - ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; + dependencies = [ + msgpack + ] + ++ lib.optionals (!isPyPy) [ greenlet ] + ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; # Tests require pkgs.neovim which we cannot add because of circular dependency doCheck = false; diff --git a/pkgs/development/python-modules/pynws/default.nix b/pkgs/development/python-modules/pynws/default.nix index 919724232384..b9da7fcbceea 100644 --- a/pkgs/development/python-modules/pynws/default.nix +++ b/pkgs/development/python-modules/pynws/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { pytest-asyncio pytest-cov-stub pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "pynws" ]; diff --git a/pkgs/development/python-modules/pyocd/default.nix b/pkgs/development/python-modules/pyocd/default.nix index 65d7342f9edf..35d09a9373a0 100644 --- a/pkgs/development/python-modules/pyocd/default.nix +++ b/pkgs/development/python-modules/pyocd/default.nix @@ -67,7 +67,8 @@ buildPythonPackage rec { pyusb pyyaml typing-extensions - ] ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ hidapi ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ hidapi ]; pythonImportsCheck = [ "pyocd" ]; diff --git a/pkgs/development/python-modules/pyogrio/default.nix b/pkgs/development/python-modules/pyogrio/default.nix index 3ada3c1488eb..063c1ab12b51 100644 --- a/pkgs/development/python-modules/pyogrio/default.nix +++ b/pkgs/development/python-modules/pyogrio/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { setuptools versioneer wheel - ] ++ versioneer.optional-dependencies.toml; + ] + ++ versioneer.optional-dependencies.toml; buildInputs = [ gdal ]; diff --git a/pkgs/development/python-modules/pyopengl/default.nix b/pkgs/development/python-modules/pyopengl/default.nix index f69770c7dfac..54db146e8eaa 100644 --- a/pkgs/development/python-modules/pyopengl/default.nix +++ b/pkgs/development/python-modules/pyopengl/default.nix @@ -72,14 +72,13 @@ buildPythonPackage rec { doCheck = false; # does not affect pythonImportsCheck # OpenGL looks for libraries during import, making this a somewhat decent test of the flaky patching above. - pythonImportsCheck = - [ - "OpenGL" - "OpenGL.GL" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "OpenGL.GLX" - ]; + pythonImportsCheck = [ + "OpenGL" + "OpenGL.GL" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "OpenGL.GLX" + ]; meta = with lib; { homepage = "https://mcfletch.github.io/pyopengl/"; diff --git a/pkgs/development/python-modules/pyopenssl/default.nix b/pkgs/development/python-modules/pyopenssl/default.nix index b6b36e82b520..ebbfcaff6c1f 100644 --- a/pkgs/development/python-modules/pyopenssl/default.nix +++ b/pkgs/development/python-modules/pyopenssl/default.nix @@ -55,44 +55,43 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - disabledTests = - [ - # https://github.com/pyca/pyopenssl/issues/692 - # These tests, we disable always. - "test_set_default_verify_paths" - "test_fallback_default_verify_paths" - # https://github.com/pyca/pyopenssl/issues/768 - "test_wantWriteError" - # https://github.com/pyca/pyopenssl/issues/1043 - "test_alpn_call_failure" - ] - ++ lib.optionals (lib.hasPrefix "libressl" openssl.meta.name) [ - # https://github.com/pyca/pyopenssl/issues/791 - # These tests, we disable in the case that libressl is passed in as openssl. - "test_op_no_compression" - "test_npn_advertise_error" - "test_npn_select_error" - "test_npn_client_fail" - "test_npn_success" - "test_use_certificate_chain_file_unicode" - "test_use_certificate_chain_file_bytes" - "test_add_extra_chain_cert" - "test_set_session_id_fail" - "test_verify_with_revoked" - "test_set_notAfter" - "test_set_notBefore" - ] - ++ lib.optionals (lib.versionAtLeast (lib.getVersion openssl.name) "1.1") [ - # these tests are extremely tightly wed to the exact output of the openssl cli tool, including exact punctuation. - "test_dump_certificate" - "test_dump_privatekey_text" - "test_dump_certificate_request" - "test_export_text" - ] - ++ lib.optionals stdenv.hostPlatform.is32bit [ - # https://github.com/pyca/pyopenssl/issues/974 - "test_verify_with_time" - ]; + disabledTests = [ + # https://github.com/pyca/pyopenssl/issues/692 + # These tests, we disable always. + "test_set_default_verify_paths" + "test_fallback_default_verify_paths" + # https://github.com/pyca/pyopenssl/issues/768 + "test_wantWriteError" + # https://github.com/pyca/pyopenssl/issues/1043 + "test_alpn_call_failure" + ] + ++ lib.optionals (lib.hasPrefix "libressl" openssl.meta.name) [ + # https://github.com/pyca/pyopenssl/issues/791 + # These tests, we disable in the case that libressl is passed in as openssl. + "test_op_no_compression" + "test_npn_advertise_error" + "test_npn_select_error" + "test_npn_client_fail" + "test_npn_success" + "test_use_certificate_chain_file_unicode" + "test_use_certificate_chain_file_bytes" + "test_add_extra_chain_cert" + "test_set_session_id_fail" + "test_verify_with_revoked" + "test_set_notAfter" + "test_set_notBefore" + ] + ++ lib.optionals (lib.versionAtLeast (lib.getVersion openssl.name) "1.1") [ + # these tests are extremely tightly wed to the exact output of the openssl cli tool, including exact punctuation. + "test_dump_certificate" + "test_dump_privatekey_text" + "test_dump_certificate_request" + "test_export_text" + ] + ++ lib.optionals stdenv.hostPlatform.is32bit [ + # https://github.com/pyca/pyopenssl/issues/974 + "test_verify_with_time" + ]; meta = with lib; { description = "Python wrapper around the OpenSSL library"; diff --git a/pkgs/development/python-modules/pyparted/default.nix b/pkgs/development/python-modules/pyparted/default.nix index 9aa205c3f2c2..1d25461eddc6 100644 --- a/pkgs/development/python-modules/pyparted/default.nix +++ b/pkgs/development/python-modules/pyparted/default.nix @@ -22,18 +22,17 @@ buildPythonPackage rec { hash = "sha256-AiUCCrEbDD0OxrvXs1YN3/1IE7SuVasC2YCirIG58iU="; }; - postPatch = - '' - sed -i -e 's|mke2fs|${pkgs.e2fsprogs}/bin/mke2fs|' tests/baseclass.py - sed -i -e ' - s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path| - ' tests/test__ped_ped.py - '' - + lib.optionalString stdenv.hostPlatform.isi686 '' - # remove some integers in this test case which overflow on 32bit systems - sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \ - tests/test__ped_ped.py - ''; + postPatch = '' + sed -i -e 's|mke2fs|${pkgs.e2fsprogs}/bin/mke2fs|' tests/baseclass.py + sed -i -e ' + s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path| + ' tests/test__ped_ped.py + '' + + lib.optionalString stdenv.hostPlatform.isi686 '' + # remove some integers in this test case which overflow on 32bit systems + sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \ + tests/test__ped_ped.py + ''; preConfigure = '' PATH="${pkgs.parted}/sbin:$PATH" diff --git a/pkgs/development/python-modules/pypdf/default.nix b/pkgs/development/python-modules/pypdf/default.nix index 84fc92953b59..fc9776d8b31f 100644 --- a/pkgs/development/python-modules/pypdf/default.nix +++ b/pkgs/development/python-modules/pypdf/default.nix @@ -73,7 +73,8 @@ buildPythonPackage rec { (fpdf2.overridePythonAttrs { doCheck = false; }) # avoid reference loop pytestCheckHook pytest-timeout - ] ++ optional-dependencies.full; + ] + ++ optional-dependencies.full; pytestFlagsArray = [ # don't access the network diff --git a/pkgs/development/python-modules/pypiserver/default.nix b/pkgs/development/python-modules/pypiserver/default.nix index c998ff590949..d6bda6918515 100644 --- a/pkgs/development/python-modules/pypiserver/default.nix +++ b/pkgs/development/python-modules/pypiserver/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { dependencies = [ distutils pip - ] ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ]; optional-dependencies = { passlib = [ passlib ]; @@ -54,7 +55,8 @@ buildPythonPackage rec { twine webtest build - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/pyproject-parser/default.nix b/pkgs/development/python-modules/pyproject-parser/default.nix index ffef09f55613..f3108c431c3f 100644 --- a/pkgs/development/python-modules/pyproject-parser/default.nix +++ b/pkgs/development/python-modules/pyproject-parser/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { readme = [ docutils readme-renderer - ] ++ readme-renderer.optional-dependencies.md; + ] + ++ readme-renderer.optional-dependencies.md; }; meta = { diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 5e1c96673555..f69ff5edafd0 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -118,32 +118,33 @@ buildPythonPackage rec { dontWrapQtApps = true; - nativeBuildInputs = - [ pkg-config ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ libsForQt5.qmake ] + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ libsForQt5.qmake ] + ++ [ + setuptools + lndir + sip + ] + ++ ( + with pkgsBuildTarget.targetPackages.libsForQt5; + [ ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ qmake ] ++ [ - setuptools - lndir - sip + qtbase + qtsvg + qtdeclarative + qtwebchannel ] - ++ ( - with pkgsBuildTarget.targetPackages.libsForQt5; - [ ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ qmake ] - ++ [ - qtbase - qtsvg - qtdeclarative - qtwebchannel - ] - ++ lib.optional withConnectivity qtconnectivity - ++ lib.optional withMultimedia qtmultimedia - ++ lib.optional withWebKit qtwebkit - ++ lib.optional withWebSockets qtwebsockets - ++ lib.optional withLocation qtlocation - ++ lib.optional withSerialPort qtserialport - ++ lib.optional withTools qttools - ); + ++ lib.optional withConnectivity qtconnectivity + ++ lib.optional withMultimedia qtmultimedia + ++ lib.optional withWebKit qtwebkit + ++ lib.optional withWebSockets qtwebsockets + ++ lib.optional withLocation qtlocation + ++ lib.optional withSerialPort qtserialport + ++ lib.optional withTools qttools + ); buildInputs = with libsForQt5; @@ -182,21 +183,20 @@ buildPythonPackage rec { # Checked using pythonImportsCheck doCheck = false; - pythonImportsCheck = - [ - "PyQt5" - "PyQt5.QtCore" - "PyQt5.QtQml" - "PyQt5.QtWidgets" - "PyQt5.QtGui" - ] - ++ lib.optional withWebSockets "PyQt5.QtWebSockets" - ++ lib.optional withWebKit "PyQt5.QtWebKit" - ++ lib.optional withMultimedia "PyQt5.QtMultimedia" - ++ lib.optional withConnectivity "PyQt5.QtBluetooth" - ++ lib.optional withLocation "PyQt5.QtPositioning" - ++ lib.optional withSerialPort "PyQt5.QtSerialPort" - ++ lib.optional withTools "PyQt5.QtDesigner"; + pythonImportsCheck = [ + "PyQt5" + "PyQt5.QtCore" + "PyQt5.QtQml" + "PyQt5.QtWidgets" + "PyQt5.QtGui" + ] + ++ lib.optional withWebSockets "PyQt5.QtWebSockets" + ++ lib.optional withWebKit "PyQt5.QtWebKit" + ++ lib.optional withMultimedia "PyQt5.QtMultimedia" + ++ lib.optional withConnectivity "PyQt5.QtBluetooth" + ++ lib.optional withLocation "PyQt5.QtPositioning" + ++ lib.optional withSerialPort "PyQt5.QtSerialPort" + ++ lib.optional withTools "PyQt5.QtDesigner"; meta = with lib; { description = "Python bindings for Qt5"; diff --git a/pkgs/development/python-modules/pyqt/6.x.nix b/pkgs/development/python-modules/pyqt/6.x.nix index be45d1fdff6e..8671534aa7a1 100644 --- a/pkgs/development/python-modules/pyqt/6.x.nix +++ b/pkgs/development/python-modules/pyqt/6.x.nix @@ -137,20 +137,19 @@ buildPythonPackage rec { # Checked using pythonImportsCheck, has no tests - pythonImportsCheck = - [ - "PyQt6" - "PyQt6.QtCore" - "PyQt6.QtQml" - "PyQt6.QtWidgets" - "PyQt6.QtGui" - "PyQt6.QtQuick" - ] - ++ lib.optional withWebSockets "PyQt6.QtWebSockets" - ++ lib.optional withMultimedia "PyQt6.QtMultimedia" - # ++ lib.optional withConnectivity "PyQt6.QtConnectivity" - ++ lib.optional withLocation "PyQt6.QtPositioning" - ++ lib.optional withSerialPort "PyQt6.QtSerialPort"; + pythonImportsCheck = [ + "PyQt6" + "PyQt6.QtCore" + "PyQt6.QtQml" + "PyQt6.QtWidgets" + "PyQt6.QtGui" + "PyQt6.QtQuick" + ] + ++ lib.optional withWebSockets "PyQt6.QtWebSockets" + ++ lib.optional withMultimedia "PyQt6.QtMultimedia" + # ++ lib.optional withConnectivity "PyQt6.QtConnectivity" + ++ lib.optional withLocation "PyQt6.QtPositioning" + ++ lib.optional withSerialPort "PyQt6.QtSerialPort"; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-address-of-temporary"; diff --git a/pkgs/development/python-modules/pyqt5-stubs/default.nix b/pkgs/development/python-modules/pyqt5-stubs/default.nix index a891942d1d45..f78ba772eedf 100644 --- a/pkgs/development/python-modules/pyqt5-stubs/default.nix +++ b/pkgs/development/python-modules/pyqt5-stubs/default.nix @@ -23,28 +23,27 @@ buildPythonPackage rec { rev = version; hash = "sha256-qWnvlHnFRy8wbZJ28C0pYqAxod623Epe5z5FZufheDc="; }; - postPatch = - '' - # pulls in a dependency to mypy, but we don't want to run linters - rm tests/test_stubs.py - '' - + lib.optionalString (!pyqt5.connectivityEnabled) '' - rm tests/qflags/test_QtBluetooth_* - rm tests/qflags/test_QtNfc_* - '' - + lib.optionalString (!pyqt5.locationEnabled) '' - rm tests/qflags/test_QtLocation_* - rm tests/qflags/test_QtPositioning_* - '' - + lib.optionalString (!pyqt5.multimediaEnabled) '' - rm tests/qflags/test_QtMultimedia_* - '' - + lib.optionalString (!pyqt5.serialPortEnabled) '' - rm tests/qflags/test_QtSerialPort_* - '' - + lib.optionalString (!pyqt5.toolsEnabled) '' - rm tests/qflags/test_QtDesigner_* - ''; + postPatch = '' + # pulls in a dependency to mypy, but we don't want to run linters + rm tests/test_stubs.py + '' + + lib.optionalString (!pyqt5.connectivityEnabled) '' + rm tests/qflags/test_QtBluetooth_* + rm tests/qflags/test_QtNfc_* + '' + + lib.optionalString (!pyqt5.locationEnabled) '' + rm tests/qflags/test_QtLocation_* + rm tests/qflags/test_QtPositioning_* + '' + + lib.optionalString (!pyqt5.multimediaEnabled) '' + rm tests/qflags/test_QtMultimedia_* + '' + + lib.optionalString (!pyqt5.serialPortEnabled) '' + rm tests/qflags/test_QtSerialPort_* + '' + + lib.optionalString (!pyqt5.toolsEnabled) '' + rm tests/qflags/test_QtDesigner_* + ''; pythonImportsCheck = [ "PyQt5-stubs" ]; diff --git a/pkgs/development/python-modules/pyqtwebengine/default.nix b/pkgs/development/python-modules/pyqtwebengine/default.nix index 11d0f847d832..8127b2c9bcf1 100644 --- a/pkgs/development/python-modules/pyqtwebengine/default.nix +++ b/pkgs/development/python-modules/pyqtwebengine/default.nix @@ -42,39 +42,37 @@ buildPythonPackage ( "dev" ]; - nativeBuildInputs = - [ - pkg-config - libsForQt5.qmake - libsForQt5.wrapQtAppsHook - ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ sip ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - python.pythonOnBuildForHost.pkgs.sip - ] - ++ [ - libsForQt5.qtbase - libsForQt5.qtsvg - libsForQt5.qtwebengine - pyqt-builder - setuptools - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ libsForQt5.qtdeclarative ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + pkg-config + libsForQt5.qmake + libsForQt5.wrapQtAppsHook + ] + ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ sip ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + python.pythonOnBuildForHost.pkgs.sip + ] + ++ [ + libsForQt5.qtbase + libsForQt5.qtsvg + libsForQt5.qtwebengine + pyqt-builder + setuptools + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ libsForQt5.qtdeclarative ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ]; - buildInputs = - [ - sip - libsForQt5.qtbase - libsForQt5.qtsvg - libsForQt5.qtwebengine - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - libsForQt5.qtwebchannel - libsForQt5.qtdeclarative - ]; + buildInputs = [ + sip + libsForQt5.qtbase + libsForQt5.qtsvg + libsForQt5.qtwebengine + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + libsForQt5.qtwebchannel + libsForQt5.qtdeclarative + ]; propagatedBuildInputs = [ pyqt5 ]; diff --git a/pkgs/development/python-modules/pyrail/default.nix b/pkgs/development/python-modules/pyrail/default.nix index dde71a35fd3c..6069db6db723 100644 --- a/pkgs/development/python-modules/pyrail/default.nix +++ b/pkgs/development/python-modules/pyrail/default.nix @@ -26,7 +26,8 @@ buildPythonPackage rec { dependencies = [ aiohttp mashumaro - ] ++ mashumaro.optional-dependencies.orjson; + ] + ++ mashumaro.optional-dependencies.orjson; pythonImportsCheck = [ "pyrail" ]; diff --git a/pkgs/development/python-modules/pyrate-limiter/default.nix b/pkgs/development/python-modules/pyrate-limiter/default.nix index b1d990f513aa..45867188d206 100644 --- a/pkgs/development/python-modules/pyrate-limiter/default.nix +++ b/pkgs/development/python-modules/pyrate-limiter/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { pytest-asyncio pytest-xdist redisTestHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "pyrate_limiter" ]; diff --git a/pkgs/development/python-modules/pyrender/default.nix b/pkgs/development/python-modules/pyrender/default.nix index 04bbda7aa8ef..d52a0d949ecf 100644 --- a/pkgs/development/python-modules/pyrender/default.nix +++ b/pkgs/development/python-modules/pyrender/default.nix @@ -79,13 +79,12 @@ buildPythonPackage rec { env.PYOPENGL_PLATFORM = "egl"; # enables headless rendering during check - nativeCheckInputs = - [ - pytestCheckHook - ] - ++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) [ - mesa.llvmpipeHook - ]; + nativeCheckInputs = [ + pytestCheckHook + ] + ++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) [ + mesa.llvmpipeHook + ]; disabledTestPaths = lib.optionals (!lib.meta.availableOn stdenv.hostPlatform mesa.llvmpipeHook) [ # requires opengl context diff --git a/pkgs/development/python-modules/pyro5/default.nix b/pkgs/development/python-modules/pyro5/default.nix index 657c20bca12b..db4d9ba20209 100644 --- a/pkgs/development/python-modules/pyro5/default.nix +++ b/pkgs/development/python-modules/pyro5/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { "TestBCSetup" # time sensitive tests "testTimeoutCall" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "Socket" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "Socket" ]; pythonImportsCheck = [ "Pyro5" ]; diff --git a/pkgs/development/python-modules/pyscard/default.nix b/pkgs/development/python-modules/pyscard/default.nix index e7b789029583..6440d5839f9e 100644 --- a/pkgs/development/python-modules/pyscard/default.nix +++ b/pkgs/development/python-modules/pyscard/default.nix @@ -30,17 +30,16 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - postPatch = - '' - substituteInPlace pyproject.toml \ - --replace-fail 'requires = ["setuptools","swig"]' 'requires = ["setuptools"]' - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - substituteInPlace setup.py --replace-fail "pkg-config" "$PKG_CONFIG" - substituteInPlace src/smartcard/scard/winscarddll.c \ - --replace-fail "libpcsclite.so.1" \ - "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" - ''; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'requires = ["setuptools","swig"]' 'requires = ["setuptools"]' + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + substituteInPlace setup.py --replace-fail "pkg-config" "$PKG_CONFIG" + substituteInPlace src/smartcard/scard/winscarddll.c \ + --replace-fail "libpcsclite.so.1" \ + "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" + ''; meta = { description = "Smartcard library for python"; diff --git a/pkgs/development/python-modules/pyscreenshot/default.nix b/pkgs/development/python-modules/pyscreenshot/default.nix index 6112062c91e9..0bd9531c0729 100644 --- a/pkgs/development/python-modules/pyscreenshot/default.nix +++ b/pkgs/development/python-modules/pyscreenshot/default.nix @@ -20,16 +20,15 @@ buildPythonPackage rec { hash = "sha256-jA6T8K72amv+Vahqv87WvTlq5LT2zB428EoorSYlWU0="; }; - propagatedBuildInputs = - [ - easyprocess - entrypoint2 - pillow - ] - ++ lib.optionals (isPy3k) [ - jeepney - mss - ]; + propagatedBuildInputs = [ + easyprocess + entrypoint2 + pillow + ] + ++ lib.optionals (isPy3k) [ + jeepney + mss + ]; # recursive dependency on pyvirtualdisplay doCheck = false; diff --git a/pkgs/development/python-modules/pyshark/default.nix b/pkgs/development/python-modules/pyshark/default.nix index 86f102627ad5..73a3e66b63ed 100644 --- a/pkgs/development/python-modules/pyshark/default.nix +++ b/pkgs/development/python-modules/pyshark/default.nix @@ -61,17 +61,16 @@ buildPythonPackage rec { export HOME=$(mktemp -d) ''; - disabledTests = - [ - # flaky - # KeyError: 'Packet of index 0 does not exist in capture' - "test_getting_packet_summary" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # fails on darwin - # _pickle.PicklingError: logger cannot be pickled - "test_iterate_empty_psml_capture" - ]; + disabledTests = [ + # flaky + # KeyError: 'Packet of index 0 does not exist in capture' + "test_getting_packet_summary" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # fails on darwin + # _pickle.PicklingError: logger cannot be pickled + "test_iterate_empty_psml_capture" + ]; pythonImportsCheck = [ "pyshark" ]; diff --git a/pkgs/development/python-modules/pyside6/default.nix b/pkgs/development/python-modules/pyside6/default.nix index c96eeb0abe0d..015b2800e283 100644 --- a/pkgs/development/python-modules/pyside6/default.nix +++ b/pkgs/development/python-modules/pyside6/default.nix @@ -67,19 +67,18 @@ stdenv.mkDerivation (finalAttrs: { # cmake/Macros/PySideModules.cmake supposes that all Qt frameworks on macOS # reside in the same directory as QtCore.framework, which is not true for Nix. # We therefore symLink all required and optional Qt modules in one directory tree ("qt_linked"). - postPatch = - '' - # Don't ignore optional Qt modules - substituteInPlace cmake/PySideHelpers.cmake \ - --replace-fail \ - 'string(FIND "''${_module_dir}" "''${_core_abs_dir}" found_basepath)' \ - 'set (found_basepath 0)' - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace cmake/PySideHelpers.cmake \ - --replace-fail \ - "Designer" "" - ''; + postPatch = '' + # Don't ignore optional Qt modules + substituteInPlace cmake/PySideHelpers.cmake \ + --replace-fail \ + 'string(FIND "''${_module_dir}" "''${_core_abs_dir}" found_basepath)' \ + 'set (found_basepath 0)' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace cmake/PySideHelpers.cmake \ + --replace-fail \ + "Designer" "" + ''; # "Couldn't find libclang.dylib You will likely need to add it manually to PATH to ensure the build succeeds." env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { @@ -91,7 +90,8 @@ stdenv.mkDerivation (finalAttrs: { ninja python pythonImportsCheckHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; buildInputs = ( if stdenv.hostPlatform.isLinux then diff --git a/pkgs/development/python-modules/pysvn/default.nix b/pkgs/development/python-modules/pysvn/default.nix index efa04c42e8f1..715df8648b12 100644 --- a/pkgs/development/python-modules/pysvn/default.nix +++ b/pkgs/development/python-modules/pysvn/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { subversion apr aprutil - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ gcc ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ gcc ]; preConfigure = '' cd Source diff --git a/pkgs/development/python-modules/pytablewriter/default.nix b/pkgs/development/python-modules/pytablewriter/default.nix index 75ec06feea3f..7b638dd962da 100644 --- a/pkgs/development/python-modules/pytablewriter/default.nix +++ b/pkgs/development/python-modules/pytablewriter/default.nix @@ -84,7 +84,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "pathvalidate" ]; diff --git a/pkgs/development/python-modules/pytask/default.nix b/pkgs/development/python-modules/pytask/default.nix index 17336a59d6b9..af475846e3a0 100644 --- a/pkgs/development/python-modules/pytask/default.nix +++ b/pkgs/development/python-modules/pytask/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { rich sqlalchemy universal-pathlib - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/pytest-aio/default.nix b/pkgs/development/python-modules/pytest-aio/default.nix index 9185a4b94b82..d70e7bf6495c 100644 --- a/pkgs/development/python-modules/pytest-aio/default.nix +++ b/pkgs/development/python-modules/pytest-aio/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { hypothesis pytestCheckHook trio-asyncio - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "pytest_aio" ]; diff --git a/pkgs/development/python-modules/pytest-ansible/default.nix b/pkgs/development/python-modules/pytest-ansible/default.nix index 52db6d331f85..226f7d8c0b6c 100644 --- a/pkgs/development/python-modules/pytest-ansible/default.nix +++ b/pkgs/development/python-modules/pytest-ansible/default.nix @@ -54,35 +54,33 @@ buildPythonPackage rec { enabledTestPaths = [ "tests/" ]; - disabledTests = - [ - # Host unreachable in the inventory - "test_become" - # [Errno -3] Temporary failure in name resolution - "test_connection_failure_v2" - "test_connection_failure_extra_inventory_v2" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # These tests fail in the Darwin sandbox - "test_ansible_facts" - "test_func" - "test_param_override_with_marker" - ]; + disabledTests = [ + # Host unreachable in the inventory + "test_become" + # [Errno -3] Temporary failure in name resolution + "test_connection_failure_v2" + "test_connection_failure_extra_inventory_v2" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # These tests fail in the Darwin sandbox + "test_ansible_facts" + "test_func" + "test_param_override_with_marker" + ]; - disabledTestPaths = - [ - # Test want s to execute pytest in a subprocess - "tests/integration/test_molecule.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # These tests fail in the Darwin sandbox - "tests/test_adhoc.py" - "tests/test_adhoc_result.py" - ] - ++ lib.optionals (lib.versionAtLeast ansible-core.version "2.16") [ - # Test fail in the NixOS environment - "tests/test_adhoc.py" - ]; + disabledTestPaths = [ + # Test want s to execute pytest in a subprocess + "tests/integration/test_molecule.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # These tests fail in the Darwin sandbox + "tests/test_adhoc.py" + "tests/test_adhoc_result.py" + ] + ++ lib.optionals (lib.versionAtLeast ansible-core.version "2.16") [ + # Test fail in the NixOS environment + "tests/test_adhoc.py" + ]; pythonImportsCheck = [ "pytest_ansible" ]; diff --git a/pkgs/development/python-modules/pytest-benchmark/default.nix b/pkgs/development/python-modules/pytest-benchmark/default.nix index fc4fbef0c72c..44eb68ebb372 100644 --- a/pkgs/development/python-modules/pytest-benchmark/default.nix +++ b/pkgs/development/python-modules/pytest-benchmark/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { nbmake pytestCheckHook pytest-xdist - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = '' export PATH="$out/bin:$PATH" diff --git a/pkgs/development/python-modules/pytest-jupyter/default.nix b/pkgs/development/python-modules/pytest-jupyter/default.nix index 8f3f0ddcb30f..9d38eb622b9c 100644 --- a/pkgs/development/python-modules/pytest-jupyter/default.nix +++ b/pkgs/development/python-modules/pytest-jupyter/default.nix @@ -59,7 +59,8 @@ let nativeCheckInputs = [ pytest-timeout pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); passthru.tests = { check = self.overridePythonAttrs (_: { diff --git a/pkgs/development/python-modules/pytest-notebook/default.nix b/pkgs/development/python-modules/pytest-notebook/default.nix index 8a37e716f31c..597c27f2b049 100644 --- a/pkgs/development/python-modules/pytest-notebook/default.nix +++ b/pkgs/development/python-modules/pytest-notebook/default.nix @@ -70,23 +70,22 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; - disabledTests = - [ - # AssertionError: FILES DIFFER: - "test_diff_to_string" + disabledTests = [ + # AssertionError: FILES DIFFER: + "test_diff_to_string" - # pytest_notebook.execution.CoverageError: An error occurred while executing coverage start-up - # TypeError: expected str, bytes or os.PathLike object, not NoneType - "test_execute_notebook_with_coverage" - "test_regression_coverage" + # pytest_notebook.execution.CoverageError: An error occurred while executing coverage start-up + # TypeError: expected str, bytes or os.PathLike object, not NoneType + "test_execute_notebook_with_coverage" + "test_regression_coverage" - # pytest_notebook.nb_regression.NBRegressionError - "test_regression_regex_replace_pass" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # AssertionError: FILES DIFFER: - "test_documentation" - ]; + # pytest_notebook.nb_regression.NBRegressionError + "test_regression_regex_replace_pass" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # AssertionError: FILES DIFFER: + "test_documentation" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/pytest-recording/default.nix b/pkgs/development/python-modules/pytest-recording/default.nix index bd02b8ebe59e..4632f7de9365 100644 --- a/pkgs/development/python-modules/pytest-recording/default.nix +++ b/pkgs/development/python-modules/pytest-recording/default.nix @@ -43,12 +43,13 @@ buildPythonPackage rec { requests ]; - disabledTests = - [ "test_block_network_with_allowed_hosts" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Missing socket.AF_NETLINK - "test_other_socket" - ]; + disabledTests = [ + "test_block_network_with_allowed_hosts" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Missing socket.AF_NETLINK + "test_other_socket" + ]; enabledTestPaths = [ "tests" ]; diff --git a/pkgs/development/python-modules/pytest-regressions/default.nix b/pkgs/development/python-modules/pytest-regressions/default.nix index 61608506664b..337c5f048a17 100644 --- a/pkgs/development/python-modules/pytest-regressions/default.nix +++ b/pkgs/development/python-modules/pytest-regressions/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { matplotlib pandas pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlags = [ "-Wignore::DeprecationWarning" diff --git a/pkgs/development/python-modules/pytest-scim2-server/default.nix b/pkgs/development/python-modules/pytest-scim2-server/default.nix index f4256b2576ac..3c6059c5541c 100644 --- a/pkgs/development/python-modules/pytest-scim2-server/default.nix +++ b/pkgs/development/python-modules/pytest-scim2-server/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook scim2-client - ] ++ scim2-client.optional-dependencies.httpx; + ] + ++ scim2-client.optional-dependencies.httpx; env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; diff --git a/pkgs/development/python-modules/pytest-shutil/default.nix b/pkgs/development/python-modules/pytest-shutil/default.nix index c73e063bf1a0..36b88d7ffea3 100644 --- a/pkgs/development/python-modules/pytest-shutil/default.nix +++ b/pkgs/development/python-modules/pytest-shutil/default.nix @@ -46,12 +46,13 @@ buildPythonPackage { nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = - [ "test_pretty_formatter" ] - ++ lib.optionals isPyPy [ - "test_run" - "test_run_integration" - ]; + disabledTests = [ + "test_pretty_formatter" + ] + ++ lib.optionals isPyPy [ + "test_run" + "test_run_integration" + ]; meta = with lib; { description = "Goodie-bag of unix shell and environment tools for py.test"; diff --git a/pkgs/development/python-modules/pytest/7.nix b/pkgs/development/python-modules/pytest/7.nix index cbed444a7264..e0506219976d 100644 --- a/pkgs/development/python-modules/pytest/7.nix +++ b/pkgs/development/python-modules/pytest/7.nix @@ -48,16 +48,15 @@ let setuptools-scm ]; - propagatedBuildInputs = - [ - iniconfig - packaging - pluggy - ] - ++ lib.optionals (pythonOlder "3.11") [ - exceptiongroup - tomli - ]; + propagatedBuildInputs = [ + iniconfig + packaging + pluggy + ] + ++ lib.optionals (pythonOlder "3.11") [ + exceptiongroup + tomli + ]; optional-dependencies = { testing = [ diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index 7027e2492dba..6eb3a02661cb 100644 --- a/pkgs/development/python-modules/pytest/default.nix +++ b/pkgs/development/python-modules/pytest/default.nix @@ -47,16 +47,15 @@ buildPythonPackage rec { setuptools-scm ]; - propagatedBuildInputs = - [ - iniconfig - packaging - pluggy - ] - ++ lib.optionals (pythonOlder "3.11") [ - exceptiongroup - tomli - ]; + propagatedBuildInputs = [ + iniconfig + packaging + pluggy + ] + ++ lib.optionals (pythonOlder "3.11") [ + exceptiongroup + tomli + ]; optional-dependencies = { testing = [ diff --git a/pkgs/development/python-modules/python-barcode/default.nix b/pkgs/development/python-modules/python-barcode/default.nix index 8b80b8a06d65..7d7e59c30af5 100644 --- a/pkgs/development/python-modules/python-barcode/default.nix +++ b/pkgs/development/python-modules/python-barcode/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-cov-stub - ] ++ optional-dependencies.images; + ] + ++ optional-dependencies.images; pythonImportsCheck = [ "barcode" ]; diff --git a/pkgs/development/python-modules/python-benedict/default.nix b/pkgs/development/python-modules/python-benedict/default.nix index 0d596f09f9a2..8c0a132fe539 100644 --- a/pkgs/development/python-modules/python-benedict/default.nix +++ b/pkgs/development/python-modules/python-benedict/default.nix @@ -93,7 +93,8 @@ buildPythonPackage rec { orjson pytestCheckHook python-decouple - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = [ # Tests require network access diff --git a/pkgs/development/python-modules/python-can/default.nix b/pkgs/development/python-modules/python-can/default.nix index 6149314a9459..cb94e9697dcb 100644 --- a/pkgs/development/python-modules/python-can/default.nix +++ b/pkgs/development/python-modules/python-can/default.nix @@ -57,27 +57,27 @@ buildPythonPackage rec { pytest-cov-stub pytest-timeout pytestCheckHook - ] ++ optional-dependencies.serial; + ] + ++ optional-dependencies.serial; disabledTestPaths = [ # We don't support all interfaces "test/test_interface_canalystii.py" ]; - disabledTests = - [ - # Tests require access socket - "BasicTestUdpMulticastBusIPv4" - "BasicTestUdpMulticastBusIPv6" - # pytest.approx is not supported in a boolean context (since pytest7) - "test_pack_unpack" - "test_receive" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # timing sensitive - "test_general" - "test_gap" - ]; + disabledTests = [ + # Tests require access socket + "BasicTestUdpMulticastBusIPv4" + "BasicTestUdpMulticastBusIPv6" + # pytest.approx is not supported in a boolean context (since pytest7) + "test_pack_unpack" + "test_receive" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # timing sensitive + "test_general" + "test_gap" + ]; preCheck = '' export PATH="$PATH:$out/bin"; diff --git a/pkgs/development/python-modules/python-engineio/default.nix b/pkgs/development/python-modules/python-engineio/default.nix index a761777b312b..3c4ca5cdd764 100644 --- a/pkgs/development/python-modules/python-engineio/default.nix +++ b/pkgs/development/python-modules/python-engineio/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { tornado pytest-asyncio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = lib.optionalString stdenv.hostPlatform.isLinux '' echo "nameserver 127.0.0.1" > resolv.conf diff --git a/pkgs/development/python-modules/python-escpos/default.nix b/pkgs/development/python-modules/python-escpos/default.nix index c778e150e666..257870f5b6aa 100644 --- a/pkgs/development/python-modules/python-escpos/default.nix +++ b/pkgs/development/python-modules/python-escpos/default.nix @@ -84,7 +84,8 @@ buildPythonPackage rec { scripttest mock hypothesis - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; pythonImportsCheck = [ "escpos" ]; diff --git a/pkgs/development/python-modules/python-gvm/default.nix b/pkgs/development/python-modules/python-gvm/default.nix index a06b8452af1d..858cd4069be7 100644 --- a/pkgs/development/python-modules/python-gvm/default.nix +++ b/pkgs/development/python-modules/python-gvm/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { # No running SSH available "test_connect_error" "test_feed_xml_error" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_feed_xml_error" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_feed_xml_error" ]; pythonImportsCheck = [ "gvm" ]; diff --git a/pkgs/development/python-modules/python-jose/default.nix b/pkgs/development/python-modules/python-jose/default.nix index e4300f33859b..470337705c89 100644 --- a/pkgs/development/python-modules/python-jose/default.nix +++ b/pkgs/development/python-modules/python-jose/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "jose" ]; diff --git a/pkgs/development/python-modules/python-lsp-black/default.nix b/pkgs/development/python-modules/python-lsp-black/default.nix index 8286298f5308..a01ee17d5014 100644 --- a/pkgs/development/python-modules/python-lsp-black/default.nix +++ b/pkgs/development/python-modules/python-lsp-black/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { dependencies = [ black python-lsp-server - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; pythonImportsCheck = [ "pylsp_black" ]; diff --git a/pkgs/development/python-modules/python-lsp-ruff/default.nix b/pkgs/development/python-modules/python-lsp-ruff/default.nix index 7fbd8706b1a8..8c0f66ee40ea 100644 --- a/pkgs/development/python-modules/python-lsp-ruff/default.nix +++ b/pkgs/development/python-modules/python-lsp-ruff/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { cattrs lsprotocol python-lsp-server - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/python-lsp-server/default.nix b/pkgs/development/python-modules/python-lsp-server/default.nix index f2938223d1df..b20357d1b4c2 100644 --- a/pkgs/development/python-modules/python-lsp-server/default.nix +++ b/pkgs/development/python-modules/python-lsp-server/default.nix @@ -112,7 +112,8 @@ buildPythonPackage rec { pytestCheckHook versionCheckHook writableTmpDirAsHomeHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; versionCheckProgram = "${placeholder "out"}/bin/pylsp"; versionCheckProgramArg = "--version"; diff --git a/pkgs/development/python-modules/python-mapnik/default.nix b/pkgs/development/python-modules/python-mapnik/default.nix index b3021288d6a0..5fd085781c54 100644 --- a/pkgs/development/python-modules/python-mapnik/default.nix +++ b/pkgs/development/python-modules/python-mapnik/default.nix @@ -96,35 +96,33 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - preCheck = - '' - # import from $out - rm -r mapnik - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Replace the hardcoded /tmp references with $TMPDIR - sed -i "s,/tmp,$TMPDIR,g" test/python_tests/*.py - ''; + preCheck = '' + # import from $out + rm -r mapnik + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Replace the hardcoded /tmp references with $TMPDIR + sed -i "s,/tmp,$TMPDIR,g" test/python_tests/*.py + ''; # https://github.com/mapnik/python-mapnik/issues/255 - disabledTests = - [ - "test_geometry_type" - "test_passing_pycairo_context_pdf" - "test_pdf_printing" - "test_render_with_scale_factor" - "test_raster_warping" - "test_pycairo_svg_surface1" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_passing_pycairo_context_png" - "test_passing_pycairo_context_svg" - "test_pycairo_pdf_surface1" - "test_pycairo_pdf_surface2" - "test_pycairo_pdf_surface3" - "test_pycairo_svg_surface2" - "test_pycairo_svg_surface3" - ]; + disabledTests = [ + "test_geometry_type" + "test_passing_pycairo_context_pdf" + "test_pdf_printing" + "test_render_with_scale_factor" + "test_raster_warping" + "test_pycairo_svg_surface1" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_passing_pycairo_context_png" + "test_passing_pycairo_context_svg" + "test_pycairo_pdf_surface1" + "test_pycairo_pdf_surface2" + "test_pycairo_pdf_surface3" + "test_pycairo_svg_surface2" + "test_pycairo_svg_surface3" + ]; pythonImportsCheck = [ "mapnik" ]; diff --git a/pkgs/development/python-modules/python-matter-server/default.nix b/pkgs/development/python-modules/python-matter-server/default.nix index b4b42736a2ab..d93f37732779 100644 --- a/pkgs/development/python-modules/python-matter-server/default.nix +++ b/pkgs/development/python-modules/python-matter-server/default.nix @@ -109,7 +109,8 @@ buildPythonPackage rec { pytest-aiohttp pytest-cov-stub pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); preCheck = let diff --git a/pkgs/development/python-modules/python-miio/default.nix b/pkgs/development/python-modules/python-miio/default.nix index 2949211b9b27..3154ef5312d4 100644 --- a/pkgs/development/python-modules/python-miio/default.nix +++ b/pkgs/development/python-modules/python-miio/default.nix @@ -69,7 +69,8 @@ buildPythonPackage rec { pyyaml tqdm zeroconf - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/python-openstackclient/default.nix b/pkgs/development/python-modules/python-openstackclient/default.nix index a409f2cbc1ca..905cc3d4b17f 100644 --- a/pkgs/development/python-modules/python-openstackclient/default.nix +++ b/pkgs/development/python-modules/python-openstackclient/default.nix @@ -51,16 +51,15 @@ buildPythonPackage rec { sphinxBuilders = [ "man" ]; - dependencies = - [ - osc-lib - pbr - python-cinderclient - python-keystoneclient - requests - ] - # to support proxy envs like ALL_PROXY in requests - ++ requests.optional-dependencies.socks; + dependencies = [ + osc-lib + pbr + python-cinderclient + python-keystoneclient + requests + ] + # to support proxy envs like ALL_PROXY in requests + ++ requests.optional-dependencies.socks; nativeCheckInputs = [ ddt diff --git a/pkgs/development/python-modules/python-rabbitair/default.nix b/pkgs/development/python-modules/python-rabbitair/default.nix index 609986ea2810..6a158f0fc1b8 100644 --- a/pkgs/development/python-modules/python-rabbitair/default.nix +++ b/pkgs/development/python-modules/python-rabbitair/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ cryptography zeroconf - ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; nativeCheckInputs = [ pytest-asyncio diff --git a/pkgs/development/python-modules/python-redis-lock/default.nix b/pkgs/development/python-modules/python-redis-lock/default.nix index b7fd12f2d5c7..f6f46376f9dd 100644 --- a/pkgs/development/python-modules/python-redis-lock/default.nix +++ b/pkgs/development/python-modules/python-redis-lock/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { pytestCheckHook process-tests pkgs.valkey - ] ++ optional-dependencies.django; + ] + ++ optional-dependencies.django; # For Django tests preCheck = "export DJANGO_SETTINGS_MODULE=test_project.settings"; diff --git a/pkgs/development/python-modules/python-roborock/default.nix b/pkgs/development/python-modules/python-roborock/default.nix index 9ad2060e5dc2..d6fb0b903251 100644 --- a/pkgs/development/python-modules/python-roborock/default.nix +++ b/pkgs/development/python-modules/python-roborock/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { pyrate-limiter vacuum-map-parser-roborock pyshark - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ pycryptodomex ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ pycryptodomex ]; nativeCheckInputs = [ aioresponses diff --git a/pkgs/development/python-modules/python-socketio/default.nix b/pkgs/development/python-modules/python-socketio/default.nix index 3ac7d7a73488..bd85309718d6 100644 --- a/pkgs/development/python-modules/python-socketio/default.nix +++ b/pkgs/development/python-modules/python-socketio/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pytestCheckHook uvicorn simple-websocket - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "socketio" ]; diff --git a/pkgs/development/python-modules/python-telegram-bot/default.nix b/pkgs/development/python-modules/python-telegram-bot/default.nix index fdcffd2da479..c815561a0b03 100644 --- a/pkgs/development/python-modules/python-telegram-bot/default.nix +++ b/pkgs/development/python-modules/python-telegram-bot/default.nix @@ -65,7 +65,8 @@ buildPythonPackage rec { pytest-timeout pytest-xdist pytestCheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; pythonImportsCheck = [ "telegram" ]; diff --git a/pkgs/development/python-modules/python-ulid/default.nix b/pkgs/development/python-modules/python-ulid/default.nix index 5b62a0cd410d..5f231685b6dc 100644 --- a/pkgs/development/python-modules/python-ulid/default.nix +++ b/pkgs/development/python-modules/python-ulid/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { nativeCheckInputs = [ freezegun pytestCheckHook - ] ++ optional-dependencies.pydantic; + ] + ++ optional-dependencies.pydantic; pythonImportsCheck = [ "ulid" ]; diff --git a/pkgs/development/python-modules/python-utils/default.nix b/pkgs/development/python-modules/python-utils/default.nix index 1938aab59b97..b4b3c50b7780 100644 --- a/pkgs/development/python-modules/python-utils/default.nix +++ b/pkgs/development/python-modules/python-utils/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytestCheckHook - ] ++ optional-dependencies.loguru; + ] + ++ optional-dependencies.loguru; pythonImportsCheck = [ "python_utils" ]; diff --git a/pkgs/development/python-modules/pythonfinder/default.nix b/pkgs/development/python-modules/pythonfinder/default.nix index 1ca8f1d78e48..5643a946d6d5 100644 --- a/pkgs/development/python-modules/pythonfinder/default.nix +++ b/pkgs/development/python-modules/pythonfinder/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { pytest-cov-stub pytest-timeout pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "pythonfinder" ]; diff --git a/pkgs/development/python-modules/pytoolconfig/default.nix b/pkgs/development/python-modules/pytoolconfig/default.nix index 93ae991ed989..66dc7b7c977f 100644 --- a/pkgs/development/python-modules/pytoolconfig/default.nix +++ b/pkgs/development/python-modules/pytoolconfig/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { sphinx-autodoc-typehints sphinx-rtd-theme sphinxHook - ] ++ optional-dependencies.doc; + ] + ++ optional-dependencies.doc; propagatedBuildInputs = [ packaging ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; @@ -63,7 +64,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); meta = with lib; { description = "Python tool configuration"; diff --git a/pkgs/development/python-modules/pytorch-lightning/default.nix b/pkgs/development/python-modules/pytorch-lightning/default.nix index 7b5c48ee942f..6a8d934b0c9d 100644 --- a/pkgs/development/python-modules/pytorch-lightning/default.nix +++ b/pkgs/development/python-modules/pytorch-lightning/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { torchmetrics tqdm traitlets - ] ++ fsspec.optional-dependencies.http; + ] + ++ fsspec.optional-dependencies.http; nativeCheckInputs = [ psutil diff --git a/pkgs/development/python-modules/pytorch-metric-learning/default.nix b/pkgs/development/python-modules/pytorch-metric-learning/default.nix index 730304ce9138..946927c65e6e 100644 --- a/pkgs/development/python-modules/pytorch-metric-learning/default.nix +++ b/pkgs/development/python-modules/pytorch-metric-learning/default.nix @@ -72,32 +72,32 @@ buildPythonPackage rec { pytestCheckHook torchvision writableTmpDirAsHomeHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); - disabledTests = - [ - # network access - "test_tuplestoweights_sampler" - "test_metric_loss_only" - "test_add_to_indexer" - "test_get_nearest_neighbors" - "test_list_of_text" - "test_untrained_indexer" - ] - ++ lib.optionals cudaSupport [ - # crashes with SIGBART - "test_accuracy_calculator_and_faiss_with_torch_and_numpy" - "test_accuracy_calculator_large_k" - "test_custom_knn" - "test_global_embedding_space_tester" - "test_global_two_stream_embedding_space_tester" - "test_index_type" - "test_k_warning" - "test_many_tied_distances" - "test_query_within_reference" - "test_tied_distances" - "test_with_same_parent_label_tester" - ]; + disabledTests = [ + # network access + "test_tuplestoweights_sampler" + "test_metric_loss_only" + "test_add_to_indexer" + "test_get_nearest_neighbors" + "test_list_of_text" + "test_untrained_indexer" + ] + ++ lib.optionals cudaSupport [ + # crashes with SIGBART + "test_accuracy_calculator_and_faiss_with_torch_and_numpy" + "test_accuracy_calculator_large_k" + "test_custom_knn" + "test_global_embedding_space_tester" + "test_global_two_stream_embedding_space_tester" + "test_index_type" + "test_k_warning" + "test_many_tied_distances" + "test_query_within_reference" + "test_tied_distances" + "test_with_same_parent_label_tester" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # Fatal Python error: Segmentation fault diff --git a/pkgs/development/python-modules/pytorch-pfn-extras/default.nix b/pkgs/development/python-modules/pytorch-pfn-extras/default.nix index b870d3bf6fb2..b9bdc8f1f8a9 100644 --- a/pkgs/development/python-modules/pytorch-pfn-extras/default.nix +++ b/pkgs/development/python-modules/pytorch-pfn-extras/default.nix @@ -55,60 +55,58 @@ buildPythonPackage rec { pythonImportsCheck = [ "pytorch_pfn_extras" ]; - disabledTests = - [ - # AssertionError: assert 4 == 0 - # where 4 = .call_count - "test_lr_scheduler_wait_for_first_optimizer_step" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # RuntimeError: Dynamo is not supported on Python 3.13+ - "test_register" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # torch.distributed was not available on darwin at one point; revisit - "test_create_distributed_evaluator" - "test_distributed_evaluation" - "test_distributed_evaluator_progress_bar" - ]; + disabledTests = [ + # AssertionError: assert 4 == 0 + # where 4 = .call_count + "test_lr_scheduler_wait_for_first_optimizer_step" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # RuntimeError: Dynamo is not supported on Python 3.13+ + "test_register" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # torch.distributed was not available on darwin at one point; revisit + "test_create_distributed_evaluator" + "test_distributed_evaluation" + "test_distributed_evaluator_progress_bar" + ]; - disabledTestPaths = - [ - # Requires optuna which is currently (2022-02-16) marked as broken. - "tests/pytorch_pfn_extras_tests/test_config_types.py" + disabledTestPaths = [ + # Requires optuna which is currently (2022-02-16) marked as broken. + "tests/pytorch_pfn_extras_tests/test_config_types.py" - # requires onnxruntime which was removed because of poor maintainability - # See https://github.com/NixOS/nixpkgs/pull/105951 https://github.com/NixOS/nixpkgs/pull/155058 - "tests/pytorch_pfn_extras_tests/onnx_tests/test_annotate.py" - "tests/pytorch_pfn_extras_tests/onnx_tests/test_as_output.py" - "tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py" - "tests/pytorch_pfn_extras_tests/onnx_tests/test_export_testcase.py" - "tests/pytorch_pfn_extras_tests/onnx_tests/test_lax.py" - "tests/pytorch_pfn_extras_tests/onnx_tests/test_load_model.py" - "tests/pytorch_pfn_extras_tests/onnx_tests/test_torchvision.py" - "tests/pytorch_pfn_extras_tests/onnx_tests/utils.py" + # requires onnxruntime which was removed because of poor maintainability + # See https://github.com/NixOS/nixpkgs/pull/105951 https://github.com/NixOS/nixpkgs/pull/155058 + "tests/pytorch_pfn_extras_tests/onnx_tests/test_annotate.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/test_as_output.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/test_export.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/test_export_testcase.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/test_lax.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/test_load_model.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/test_torchvision.py" + "tests/pytorch_pfn_extras_tests/onnx_tests/utils.py" - # RuntimeError: No Op registered for Gradient with domain_version of 9 - "tests/pytorch_pfn_extras_tests/onnx_tests/test_grad.py" + # RuntimeError: No Op registered for Gradient with domain_version of 9 + "tests/pytorch_pfn_extras_tests/onnx_tests/test_grad.py" - # torch._dynamo.exc.BackendCompilerFailed: backend='compiler_fn' raised: - # AttributeError: module 'torch.fx.experimental.proxy_tensor' has no attribute 'maybe_disable_fake_tensor_mode' - "tests/pytorch_pfn_extras_tests/dynamo_tests/test_compile.py" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # torch.distributed was not available on darwin at one point; revisit - "tests/pytorch_pfn_extras_tests/distributed_tests/test_distributed_validation_sampler.py" - "tests/pytorch_pfn_extras_tests/nn_tests/parallel_tests/test_distributed.py" - "tests/pytorch_pfn_extras_tests/profiler_tests/test_record.py" - "tests/pytorch_pfn_extras_tests/profiler_tests/test_time_summary.py" - "tests/pytorch_pfn_extras_tests/training_tests/extensions_tests/test_accumulate.py" - "tests/pytorch_pfn_extras_tests/training_tests/extensions_tests/test_sharded_snapshot.py" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # RuntimeError: internal error - # convolution (e.g. F.conv3d) causes runtime error - "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_conv.py" - ]; + # torch._dynamo.exc.BackendCompilerFailed: backend='compiler_fn' raised: + # AttributeError: module 'torch.fx.experimental.proxy_tensor' has no attribute 'maybe_disable_fake_tensor_mode' + "tests/pytorch_pfn_extras_tests/dynamo_tests/test_compile.py" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # torch.distributed was not available on darwin at one point; revisit + "tests/pytorch_pfn_extras_tests/distributed_tests/test_distributed_validation_sampler.py" + "tests/pytorch_pfn_extras_tests/nn_tests/parallel_tests/test_distributed.py" + "tests/pytorch_pfn_extras_tests/profiler_tests/test_record.py" + "tests/pytorch_pfn_extras_tests/profiler_tests/test_time_summary.py" + "tests/pytorch_pfn_extras_tests/training_tests/extensions_tests/test_accumulate.py" + "tests/pytorch_pfn_extras_tests/training_tests/extensions_tests/test_sharded_snapshot.py" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # RuntimeError: internal error + # convolution (e.g. F.conv3d) causes runtime error + "tests/pytorch_pfn_extras_tests/nn_tests/modules_tests/test_lazy_conv.py" + ]; meta = { description = "Supplementary components to accelerate research and development in PyTorch"; diff --git a/pkgs/development/python-modules/pytorch3d/default.nix b/pkgs/development/python-modules/pytorch3d/default.nix index 2a92a51ec8bf..c0894da45073 100644 --- a/pkgs/development/python-modules/pytorch3d/default.nix +++ b/pkgs/development/python-modules/pytorch3d/default.nix @@ -36,13 +36,12 @@ buildPythonPackage rec { ]; buildInputs = [ (lib.getOutput "cxxdev" torch) ]; - env = - { - FORCE_CUDA = cudaSupport; - } - // lib.optionalAttrs cudaSupport { - TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" torch.cudaCapabilities}"; - }; + env = { + FORCE_CUDA = cudaSupport; + } + // lib.optionalAttrs cudaSupport { + TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" torch.cudaCapabilities}"; + }; pythonImportsCheck = [ "pytorch3d" ]; diff --git a/pkgs/development/python-modules/pyunbound/default.nix b/pkgs/development/python-modules/pyunbound/default.nix index 0878c20a2c24..fb1b2cfad75a 100644 --- a/pkgs/development/python-modules/pyunbound/default.nix +++ b/pkgs/development/python-modules/pyunbound/default.nix @@ -68,19 +68,18 @@ buildPythonPackage rec { ]; # All we want is the Unbound Python module - postInstall = - '' - # Generate the built in root anchor and root key and store these in a logical place - # to be used by tools depending only on the Python module - $out/bin/unbound-anchor -l | head -1 > $out/etc/${pname}/root.anchor - $out/bin/unbound-anchor -l | tail --lines=+2 - > $out/etc/${pname}/root.key - # We don't need anything else - rm -r $out/bin $out/share $out/include $out/etc/unbound - '' - # patchelf is only available on Linux and no patching is needed on darwin - + lib.optionalString stdenv.hostPlatform.isLinux '' - patchelf --replace-needed libunbound.so.8 $out/${python.sitePackages}/libunbound.so.8 $out/${python.sitePackages}/_unbound.so - ''; + postInstall = '' + # Generate the built in root anchor and root key and store these in a logical place + # to be used by tools depending only on the Python module + $out/bin/unbound-anchor -l | head -1 > $out/etc/${pname}/root.anchor + $out/bin/unbound-anchor -l | tail --lines=+2 - > $out/etc/${pname}/root.key + # We don't need anything else + rm -r $out/bin $out/share $out/include $out/etc/unbound + '' + # patchelf is only available on Linux and no patching is needed on darwin + + lib.optionalString stdenv.hostPlatform.isLinux '' + patchelf --replace-needed libunbound.so.8 $out/${python.sitePackages}/libunbound.so.8 $out/${python.sitePackages}/_unbound.so + ''; meta = with lib; { description = "Python library for Unbound, the validating, recursive, and caching DNS resolver"; diff --git a/pkgs/development/python-modules/pyutil/default.nix b/pkgs/development/python-modules/pyutil/default.nix index 6c079b11712f..37d9751db3ce 100644 --- a/pkgs/development/python-modules/pyutil/default.nix +++ b/pkgs/development/python-modules/pyutil/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { mock twisted pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "pyutil" ]; diff --git a/pkgs/development/python-modules/pywebcopy/default.nix b/pkgs/development/python-modules/pywebcopy/default.nix index 62c907a0cbc8..ebdda05aeead 100644 --- a/pkgs/development/python-modules/pywebcopy/default.nix +++ b/pkgs/development/python-modules/pywebcopy/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { lxml-html-clean requests six - ] ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; + ] + ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/pywebview/default.nix b/pkgs/development/python-modules/pywebview/default.nix index e6148c3a5b47..ca01c3e7ca9f 100644 --- a/pkgs/development/python-modules/pywebview/default.nix +++ b/pkgs/development/python-modules/pywebview/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { pyqtwebengine proxy-tools six - ] ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ]; nativeCheckInputs = [ pygobject3 diff --git a/pkgs/development/python-modules/pywinrm/default.nix b/pkgs/development/python-modules/pywinrm/default.nix index d1fbc9618d33..b8c8880225b9 100644 --- a/pkgs/development/python-modules/pywinrm/default.nix +++ b/pkgs/development/python-modules/pywinrm/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "winrm" ]; diff --git a/pkgs/development/python-modules/pyzmq/default.nix b/pkgs/development/python-modules/pyzmq/default.nix index 591b0df0ca2e..2f184fb3f9be 100644 --- a/pkgs/development/python-modules/pyzmq/default.nix +++ b/pkgs/development/python-modules/pyzmq/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { packaging pathspec scikit-build-core - ] ++ (if isPyPy then [ cffi ] else [ cython ]); + ] + ++ (if isPyPy then [ cffi ] else [ cython ]); dontUseCmakeConfigure = true; diff --git a/pkgs/development/python-modules/qdrant-client/default.nix b/pkgs/development/python-modules/qdrant-client/default.nix index 7f12c6f0cb1a..eb702067ae81 100644 --- a/pkgs/development/python-modules/qdrant-client/default.nix +++ b/pkgs/development/python-modules/qdrant-client/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { portalocker pydantic urllib3 - ] ++ httpx.optional-dependencies.http2; + ] + ++ httpx.optional-dependencies.http2; pythonImportsCheck = [ "qdrant_client" ]; diff --git a/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix b/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix index 833dec1f0d2c..089fdde389ce 100644 --- a/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix +++ b/pkgs/development/python-modules/qiskit-ibmq-provider/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { requests-ntlm websocket-client websockets - ] ++ lib.optionals withVisualization visualizationPackages; + ] + ++ lib.optionals withVisualization visualizationPackages; postPatch = '' substituteInPlace setup.py --replace "websocket-client>=1.0.1" "websocket-client" @@ -75,7 +76,8 @@ buildPythonPackage rec { pproxy qiskit-aer vcrpy - ] ++ lib.optionals (!withVisualization) visualizationPackages; + ] + ++ lib.optionals (!withVisualization) visualizationPackages; pythonImportsCheck = [ "qiskit.providers.ibmq" ]; disabledTests = [ diff --git a/pkgs/development/python-modules/qiskit-ignis/default.nix b/pkgs/development/python-modules/qiskit-ignis/default.nix index 940b5bd556f1..d4d34101e7cb 100644 --- a/pkgs/development/python-modules/qiskit-ignis/default.nix +++ b/pkgs/development/python-modules/qiskit-ignis/default.nix @@ -37,16 +37,15 @@ buildPythonPackage rec { hash = "sha256-WyLNtZhtuGzqCJdOBvtBjZZiGFQihpeSjJQtP7lI248="; }; - propagatedBuildInputs = - [ - numpy - qiskit-terra - scikit-learn - scipy - ] - ++ lib.optionals (withCvx) [ cvxpy ] - ++ lib.optionals (withVisualization) [ matplotlib ] - ++ lib.optionals (withJit) [ numba ]; + propagatedBuildInputs = [ + numpy + qiskit-terra + scikit-learn + scipy + ] + ++ lib.optionals (withCvx) [ cvxpy ] + ++ lib.optionals (withVisualization) [ matplotlib ] + ++ lib.optionals (withJit) [ numba ]; # Tests pythonImportsCheck = [ "qiskit.ignis" ]; @@ -59,13 +58,12 @@ buildPythonPackage rec { pyfakefs qiskit-aer ]; - disabledTests = - [ - "test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - "test_fitters" # Fails check that arrays are close. Might be due to aarch64 math issues. - ]; + disabledTests = [ + "test_tensored_meas_cal_on_circuit" # Flaky test, occasionally returns result outside bounds + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + "test_fitters" # Fails check that arrays are close. Might be due to aarch64 math issues. + ]; meta = with lib; { description = "Qiskit tools for quantum hardware verification, noise characterization, and error correction"; diff --git a/pkgs/development/python-modules/qiskit-nature/default.nix b/pkgs/development/python-modules/qiskit-nature/default.nix index 6fa4918ea47e..f8419b9810d4 100644 --- a/pkgs/development/python-modules/qiskit-nature/default.nix +++ b/pkgs/development/python-modules/qiskit-nature/default.nix @@ -48,7 +48,8 @@ buildPythonPackage rec { rustworkx scikit-learn scipy - ] ++ lib.optional withPyscf pyscf; + ] + ++ lib.optional withPyscf pyscf; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/qiskit-terra/default.nix b/pkgs/development/python-modules/qiskit-terra/default.nix index 05bd0d65f488..232cae299dd4 100644 --- a/pkgs/development/python-modules/qiskit-terra/default.nix +++ b/pkgs/development/python-modules/qiskit-terra/default.nix @@ -87,25 +87,24 @@ buildPythonPackage rec { hash = "sha256-nTYrNH3h1kAwwPx7OMw6eI61vYy8iFhm4eWDTGhWxt4="; }; - propagatedBuildInputs = - [ - dill - numpy - networkx - ply - psutil - python-constraint - python-dateutil - rustworkx - scipy - scikit-quant - stevedore - symengine - sympy - tweedledum - ] - ++ lib.optionals withVisualization visualizationPackages - ++ lib.optionals withCrosstalkPass crosstalkPackages; + propagatedBuildInputs = [ + dill + numpy + networkx + ply + psutil + python-constraint + python-dateutil + rustworkx + scipy + scikit-quant + stevedore + symengine + sympy + tweedledum + ] + ++ lib.optionals withVisualization visualizationPackages + ++ lib.optionals withCrosstalkPass crosstalkPackages; # *** Tests *** nativeCheckInputs = [ @@ -114,7 +113,8 @@ buildPythonPackage rec { hypothesis nbformat nbconvert - ] ++ lib.optionals (!withVisualization) visualizationPackages; + ] + ++ lib.optionals (!withVisualization) visualizationPackages; pythonImportsCheck = [ "qiskit" @@ -132,68 +132,67 @@ buildPythonPackage rec { "test/visual/mpl/circuit/test_circuit_matplotlib_drawer.py" ]; pytestFlags = [ "--durations=10" ]; - disabledTests = - [ - "TestUnitarySynthesisPlugin" # use unittest mocks for transpiler.run(), seems incompatible somehow w/ pytest infrastructure - # matplotlib tests seems to fail non-deterministically - "TestMatplotlibDrawer" - "TestGraphMatplotlibDrawer" - "test_copy" # assertNotIn doesn't seem to work as expected w/ pytest vs unittest + disabledTests = [ + "TestUnitarySynthesisPlugin" # use unittest mocks for transpiler.run(), seems incompatible somehow w/ pytest infrastructure + # matplotlib tests seems to fail non-deterministically + "TestMatplotlibDrawer" + "TestGraphMatplotlibDrawer" + "test_copy" # assertNotIn doesn't seem to work as expected w/ pytest vs unittest - "test_bound_pass_manager" # AssertionError: 0 != 2 - "test_complex_parameter_bound_to_real" # qiskit.circuit.exceptions.CircuitError: "Invalid param type for gate rx." - "test_expressions_of_parameter_with_constant" # Floating point arithmetic error - "test_handle_measurement" # AssertionError: The two circuits are not equal + "test_bound_pass_manager" # AssertionError: 0 != 2 + "test_complex_parameter_bound_to_real" # qiskit.circuit.exceptions.CircuitError: "Invalid param type for gate rx." + "test_expressions_of_parameter_with_constant" # Floating point arithmetic error + "test_handle_measurement" # AssertionError: The two circuits are not equal - # Flaky tests - "test_pulse_limits" # Fails on GitHub Actions, probably due to minor floating point arithmetic error. - "test_cx_equivalence" # Fails due to flaky test - "test_two_qubit_synthesis_not_pulse_optimal" # test of random circuit, seems to randomly fail depending on seed - "test_qv_natural" # fails due to sign error. Not sure why - ] - ++ lib.optionals (lib.versionAtLeast matplotlib.version "3.4.0") [ "test_plot_circuit_layout" ] - # Disabling slow tests for build constraints - ++ [ - "test_all_examples" - "test_controlled_random_unitary" - "test_controlled_standard_gates_1" - "test_jupyter_jobs_pbars" - "test_lookahead_swap_higher_depth_width_is_better" - "test_move_measurements" - "test_job_monitor" - "test_wait_for_final_state" - "test_multi_controlled_y_rotation_matrix_basic_mode" - "test_two_qubit_weyl_decomposition_abc" - "test_isometry" - "test_parallel" - "test_random_state" - "test_random_clifford_valid" - "test_to_matrix" - "test_block_collection_reduces_1q_gate" - "test_multi_controlled_rotation_gate_matrices" - "test_block_collection_runs_for_non_cx_bases" - "test_with_two_qubit_reduction" - "test_basic_aer_qasm" - "test_hhl" - "test_H2_hamiltonian" - "test_max_evals_grouped_2" - "test_qaoa_qc_mixer_4" - "test_abelian_grouper_random_2" - "test_pauli_two_design" - "test_shor_factoring" - "test_sample_counts_memory_ghz" - "test_two_qubit_weyl_decomposition_ab0" - "test_sample_counts_memory_superposition" - "test_piecewise_polynomial_function" - "test_piecewise_chebyshev_mutability" - "test_bit_conditional_no_cregbundle" - "test_gradient_wrapper2" - "test_two_qubit_weyl_decomposition_abmb" - "test_two_qubit_weyl_decomposition_abb" - "test_vqe_qasm" - "test_dag_from_networkx" - "test_defaults_to_dict_46" - ]; + # Flaky tests + "test_pulse_limits" # Fails on GitHub Actions, probably due to minor floating point arithmetic error. + "test_cx_equivalence" # Fails due to flaky test + "test_two_qubit_synthesis_not_pulse_optimal" # test of random circuit, seems to randomly fail depending on seed + "test_qv_natural" # fails due to sign error. Not sure why + ] + ++ lib.optionals (lib.versionAtLeast matplotlib.version "3.4.0") [ "test_plot_circuit_layout" ] + # Disabling slow tests for build constraints + ++ [ + "test_all_examples" + "test_controlled_random_unitary" + "test_controlled_standard_gates_1" + "test_jupyter_jobs_pbars" + "test_lookahead_swap_higher_depth_width_is_better" + "test_move_measurements" + "test_job_monitor" + "test_wait_for_final_state" + "test_multi_controlled_y_rotation_matrix_basic_mode" + "test_two_qubit_weyl_decomposition_abc" + "test_isometry" + "test_parallel" + "test_random_state" + "test_random_clifford_valid" + "test_to_matrix" + "test_block_collection_reduces_1q_gate" + "test_multi_controlled_rotation_gate_matrices" + "test_block_collection_runs_for_non_cx_bases" + "test_with_two_qubit_reduction" + "test_basic_aer_qasm" + "test_hhl" + "test_H2_hamiltonian" + "test_max_evals_grouped_2" + "test_qaoa_qc_mixer_4" + "test_abelian_grouper_random_2" + "test_pauli_two_design" + "test_shor_factoring" + "test_sample_counts_memory_ghz" + "test_two_qubit_weyl_decomposition_ab0" + "test_sample_counts_memory_superposition" + "test_piecewise_polynomial_function" + "test_piecewise_chebyshev_mutability" + "test_bit_conditional_no_cregbundle" + "test_gradient_wrapper2" + "test_two_qubit_weyl_decomposition_abmb" + "test_two_qubit_weyl_decomposition_abb" + "test_vqe_qasm" + "test_dag_from_networkx" + "test_defaults_to_dict_46" + ]; # Moves tests to $PACKAGEDIR/test. They can't be run from /build because of finding # cythonized modules and expecting to find some resource files in the test directory. diff --git a/pkgs/development/python-modules/qiskit/default.nix b/pkgs/development/python-modules/qiskit/default.nix index e120256b0e2d..ac39260c0df0 100644 --- a/pkgs/development/python-modules/qiskit/default.nix +++ b/pkgs/development/python-modules/qiskit/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { qiskit-ibmq-provider qiskit-ignis qiskit-terra - ] ++ lib.optionals withOptionalPackages optionalQiskitPackages; + ] + ++ lib.optionals withOptionalPackages optionalQiskitPackages; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/qrcode/default.nix b/pkgs/development/python-modules/qrcode/default.nix index d105122763cf..4aeda018a902 100644 --- a/pkgs/development/python-modules/qrcode/default.nix +++ b/pkgs/development/python-modules/qrcode/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); passthru.tests = { version = testers.testVersion { diff --git a/pkgs/development/python-modules/qscintilla/default.nix b/pkgs/development/python-modules/qscintilla/default.nix index d58b591c2aac..39b743f9659f 100644 --- a/pkgs/development/python-modules/qscintilla/default.nix +++ b/pkgs/development/python-modules/qscintilla/default.nix @@ -40,30 +40,30 @@ pythonPackages.buildPythonPackage { propagatedBuildInputs = [ pyQtPackage - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ qtmacextras ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ qtmacextras ]; dontWrapQtApps = true; - postPatch = - '' - cd Python - cp pyproject-qt${qtVersion}.toml pyproject.toml - echo '[tool.sip.project]' >> pyproject.toml - echo 'sip-include-dirs = [ "${pyQtPackage}/${python.sitePackages}/PyQt${qtVersion}/bindings"]' \ - >> pyproject.toml - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace project.py \ - --replace \ - "if self.project.qsci_external_lib: - if self.qsci_features_dir is not None:" \ - "if self.project.qsci_external_lib: - self.builder_settings.append('QT += widgets') + postPatch = '' + cd Python + cp pyproject-qt${qtVersion}.toml pyproject.toml + echo '[tool.sip.project]' >> pyproject.toml + echo 'sip-include-dirs = [ "${pyQtPackage}/${python.sitePackages}/PyQt${qtVersion}/bindings"]' \ + >> pyproject.toml + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace project.py \ + --replace \ + "if self.project.qsci_external_lib: + if self.qsci_features_dir is not None:" \ + "if self.project.qsci_external_lib: + self.builder_settings.append('QT += widgets') - self.builder_settings.append('QT += printsupport') + self.builder_settings.append('QT += printsupport') - if self.qsci_features_dir is not None:" - ''; + if self.qsci_features_dir is not None:" + ''; dontConfigure = true; diff --git a/pkgs/development/python-modules/quandl/default.nix b/pkgs/development/python-modules/quandl/default.nix index ea7a305eb377..18ef2dca507b 100644 --- a/pkgs/development/python-modules/quandl/default.nix +++ b/pkgs/development/python-modules/quandl/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { python-dateutil six more-itertools - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; nativeCheckInputs = [ factory-boy diff --git a/pkgs/development/python-modules/quart/default.nix b/pkgs/development/python-modules/quart/default.nix index 129c8f7fff0b..ae415d9e5fce 100644 --- a/pkgs/development/python-modules/quart/default.nix +++ b/pkgs/development/python-modules/quart/default.nix @@ -45,24 +45,23 @@ buildPythonPackage rec { build-system = [ flit-core ]; - dependencies = - [ - aiofiles - blinker - click - flask - hypercorn - itsdangerous - jinja2 - markupsafe - pydata-sphinx-theme - python-dotenv - werkzeug - ] - ++ lib.optionals (pythonOlder "3.10") [ - importlib-metadata - typing-extensions - ]; + dependencies = [ + aiofiles + blinker + click + flask + hypercorn + itsdangerous + jinja2 + markupsafe + pydata-sphinx-theme + python-dotenv + werkzeug + ] + ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + typing-extensions + ]; pythonImportsCheck = [ "quart" ]; diff --git a/pkgs/development/python-modules/qutip/default.nix b/pkgs/development/python-modules/qutip/default.nix index 006db381e8a6..0da2792baee6 100644 --- a/pkgs/development/python-modules/qutip/default.nix +++ b/pkgs/development/python-modules/qutip/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { pytestCheckHook pytest-rerunfailures writableTmpDirAsHomeHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # QuTiP tries to access the home directory to create an rc file for us. # We need to go to another directory to run the tests from there. diff --git a/pkgs/development/python-modules/rarfile/default.nix b/pkgs/development/python-modules/rarfile/default.nix index 1795311b9fbc..0c6cf5586eb6 100644 --- a/pkgs/development/python-modules/rarfile/default.nix +++ b/pkgs/development/python-modules/rarfile/default.nix @@ -28,21 +28,20 @@ buildPythonPackage rec { hash = "sha256-ZiwD2LG25fMd4Z+QWsh/x3ceG5QRBH4s/TZDwMnfpNI="; }; - prePatch = - '' - substituteInPlace rarfile.py \ - '' - + ( - if useUnrar then - '' - --replace 'UNRAR_TOOL = "unrar"' "UNRAR_TOOL = \"${unrar}/bin/unrar\"" - '' - else - '' - --replace 'ALT_TOOL = "bsdtar"' "ALT_TOOL = \"${libarchive}/bin/bsdtar\"" - '' - ) - + ""; + prePatch = '' + substituteInPlace rarfile.py \ + '' + + ( + if useUnrar then + '' + --replace 'UNRAR_TOOL = "unrar"' "UNRAR_TOOL = \"${unrar}/bin/unrar\"" + '' + else + '' + --replace 'ALT_TOOL = "bsdtar"' "ALT_TOOL = \"${libarchive}/bin/bsdtar\"" + '' + ) + + ""; build-system = [ setuptools ]; diff --git a/pkgs/development/python-modules/rasterio/default.nix b/pkgs/development/python-modules/rasterio/default.nix index 9ed522c5a898..9d7273332481 100644 --- a/pkgs/development/python-modules/rasterio/default.nix +++ b/pkgs/development/python-modules/rasterio/default.nix @@ -97,7 +97,8 @@ buildPythonPackage rec { "test_warp" "test_warpedvrt" "test_rio_warp" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_reproject_error_propagation" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_reproject_error_propagation" ]; pythonImportsCheck = [ "rasterio" ]; diff --git a/pkgs/development/python-modules/ratarmountcore/default.nix b/pkgs/development/python-modules/ratarmountcore/default.nix index e8b732b62767..3d5ef3529f57 100644 --- a/pkgs/development/python-modules/ratarmountcore/default.nix +++ b/pkgs/development/python-modules/ratarmountcore/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { zstd fsspec writableTmpDirAsHomeHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "ratarmountcore" ]; diff --git a/pkgs/development/python-modules/raylib-python-cffi/passthru-tests.nix b/pkgs/development/python-modules/raylib-python-cffi/passthru-tests.nix index 1dfa0a68d033..589f01641271 100644 --- a/pkgs/development/python-modules/raylib-python-cffi/passthru-tests.nix +++ b/pkgs/development/python-modules/raylib-python-cffi/passthru-tests.nix @@ -18,12 +18,10 @@ in cffi_binding = (writeTest "cffi_binding" "/tests/test_static_with_only_api_from_dynamic.py").overrideAttrs (prev: { - buildCommand = - prev.buildCommand - + '' - substituteInPlace $out/bin/cffi_binding \ - --replace-fail "examples/models/resources/heightmap.png" \ - "${src}/examples/models/resources/heightmap.png" - ''; + buildCommand = prev.buildCommand + '' + substituteInPlace $out/bin/cffi_binding \ + --replace-fail "examples/models/resources/heightmap.png" \ + "${src}/examples/models/resources/heightmap.png" + ''; }); } diff --git a/pkgs/development/python-modules/rchitect/default.nix b/pkgs/development/python-modules/rchitect/default.nix index c61edb251fca..400394bdebf5 100644 --- a/pkgs/development/python-modules/rchitect/default.nix +++ b/pkgs/development/python-modules/rchitect/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { cffi six packaging - ] ++ (with rPackages; [ reticulate ]); + ] + ++ (with rPackages; [ reticulate ]); nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/rdflib/default.nix b/pkgs/development/python-modules/rdflib/default.nix index abbd2eb4f5b4..75ec5b390020 100644 --- a/pkgs/development/python-modules/rdflib/default.nix +++ b/pkgs/development/python-modules/rdflib/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { dependencies = [ pyparsing - ] ++ lib.optionals (pythonOlder "3.11") [ isodate ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ isodate ]; optional-dependencies = { html = [ html5lib ]; @@ -52,15 +53,14 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - nativeCheckInputs = - [ - pip - pytest-cov-stub - pytestCheckHook - setuptools - ] - ++ optional-dependencies.networkx - ++ optional-dependencies.html; + nativeCheckInputs = [ + pip + pytest-cov-stub + pytestCheckHook + setuptools + ] + ++ optional-dependencies.networkx + ++ optional-dependencies.html; pytestFlagsArray = [ # requires network access @@ -68,21 +68,20 @@ buildPythonPackage rec { "--deselect=test/jsonld/test_onedotone.py::test_suite" ]; - disabledTests = - [ - # Requires network access - "test_service" - "testGuessFormatForParse" - "test_infix_owl_example1" - "test_context" - "test_example" - "test_guess_format_for_parse" - "rdflib.extras.infixowl" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Require loopback network access - "TestGraphHTTP" - ]; + disabledTests = [ + # Requires network access + "test_service" + "testGuessFormatForParse" + "test_infix_owl_example1" + "test_context" + "test_example" + "test_guess_format_for_parse" + "rdflib.extras.infixowl" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Require loopback network access + "TestGraphHTTP" + ]; pythonImportsCheck = [ "rdflib" ]; diff --git a/pkgs/development/python-modules/reikna/default.nix b/pkgs/development/python-modules/reikna/default.nix index ab32dd6e5aaf..014b87d8e787 100644 --- a/pkgs/development/python-modules/reikna/default.nix +++ b/pkgs/development/python-modules/reikna/default.nix @@ -30,14 +30,13 @@ buildPythonPackage rec { pytestCheckHook ]; - propagatedBuildInputs = - [ - mako - numpy - funcsigs - ] - ++ lib.optional withCuda pycuda - ++ lib.optional withOpenCL pyopencl; + propagatedBuildInputs = [ + mako + numpy + funcsigs + ] + ++ lib.optional withCuda pycuda + ++ lib.optional withOpenCL pyopencl; # Requires device doCheck = false; diff --git a/pkgs/development/python-modules/rembg/default.nix b/pkgs/development/python-modules/rembg/default.nix index aa58b0a7d56b..9e8a5554e3f0 100644 --- a/pkgs/development/python-modules/rembg/default.nix +++ b/pkgs/development/python-modules/rembg/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { scikit-image scipy tqdm - ] ++ lib.optionals withCli optional-dependencies.cli; + ] + ++ lib.optionals withCli optional-dependencies.cli; optional-dependencies = { cli = [ diff --git a/pkgs/development/python-modules/remi/default.nix b/pkgs/development/python-modules/remi/default.nix index b88ab282a6ad..1e55434b8f9d 100644 --- a/pkgs/development/python-modules/remi/default.nix +++ b/pkgs/development/python-modules/remi/default.nix @@ -45,13 +45,12 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - setuptools # pkg_resources is referenced at runtime - ] - ++ lib.optionals (!pythonOlder "3.13") [ - legacy-cgi - ]; + dependencies = [ + setuptools # pkg_resources is referenced at runtime + ] + ++ lib.optionals (!pythonOlder "3.13") [ + legacy-cgi + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/renault-api/default.nix b/pkgs/development/python-modules/renault-api/default.nix index 52f913d23557..4905d54a6add 100644 --- a/pkgs/development/python-modules/renault-api/default.nix +++ b/pkgs/development/python-modules/renault-api/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { pytestCheckHook syrupy typeguard - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "renault_api" ]; diff --git a/pkgs/development/python-modules/reproject/default.nix b/pkgs/development/python-modules/reproject/default.nix index fb547247ba8a..ced27b5ebd1c 100644 --- a/pkgs/development/python-modules/reproject/default.nix +++ b/pkgs/development/python-modules/reproject/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { numpy scipy zarr - ] ++ dask.optional-dependencies.array; + ] + ++ dask.optional-dependencies.array; nativeCheckInputs = [ pytest-astropy diff --git a/pkgs/development/python-modules/reptor/default.nix b/pkgs/development/python-modules/reptor/default.nix index 12075dfb7ebd..168ee1054606 100644 --- a/pkgs/development/python-modules/reptor/default.nix +++ b/pkgs/development/python-modules/reptor/default.nix @@ -60,7 +60,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export PATH="$PATH:$out/bin"; diff --git a/pkgs/development/python-modules/requests-cache/default.nix b/pkgs/development/python-modules/requests-cache/default.nix index f5b649a25396..e910e0a22201 100644 --- a/pkgs/development/python-modules/requests-cache/default.nix +++ b/pkgs/development/python-modules/requests-cache/default.nix @@ -68,21 +68,20 @@ buildPythonPackage rec { yaml = [ pyyaml ]; }; - nativeCheckInputs = - [ - psutil - pytestCheckHook - pytest-rerunfailures - pytest-xdist - requests-mock - responses - rich - tenacity - time-machine - timeout-decorator - ] - ++ optional-dependencies.json - ++ optional-dependencies.security; + nativeCheckInputs = [ + psutil + pytestCheckHook + pytest-rerunfailures + pytest-xdist + requests-mock + responses + rich + tenacity + time-machine + timeout-decorator + ] + ++ optional-dependencies.json + ++ optional-dependencies.security; preCheck = '' export HOME=$(mktemp -d); diff --git a/pkgs/development/python-modules/requests-kerberos/default.nix b/pkgs/development/python-modules/requests-kerberos/default.nix index b2829a6a332d..17ff2702c781 100644 --- a/pkgs/development/python-modules/requests-kerberos/default.nix +++ b/pkgs/development/python-modules/requests-kerberos/default.nix @@ -25,14 +25,13 @@ buildPythonPackage rec { hash = "sha256-s1Q3zqKPSuTkiFExr+axai9Eta1xjw/cip8xzfDGR88="; }; - propagatedBuildInputs = - [ - cryptography - requests - pyspnego - ] - # Avoid broken Python krb5 package on Darwin - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) pyspnego.optional-dependencies.kerberos; + propagatedBuildInputs = [ + cryptography + requests + pyspnego + ] + # Avoid broken Python krb5 package on Darwin + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) pyspnego.optional-dependencies.kerberos; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/requests/default.nix b/pkgs/development/python-modules/requests/default.nix index 8a8da6b937fe..a56abe5e9b2e 100644 --- a/pkgs/development/python-modules/requests/default.nix +++ b/pkgs/development/python-modules/requests/default.nix @@ -57,29 +57,29 @@ buildPythonPackage rec { pytest-mock pytest-xdist pytestCheckHook - ] ++ optional-dependencies.socks; + ] + ++ optional-dependencies.socks; - disabledTests = - [ - # Disable tests that require network access and use httpbin - "requests.api.request" - "requests.models.PreparedRequest" - "requests.sessions.Session" - "requests" - "test_redirecting_to_bad_url" - "test_requests_are_updated_each_time" - "test_should_bypass_proxies_pass_only_hostname" - "test_urllib3_pool_connection_closed" - "test_urllib3_retries" - "test_use_proxy_from_environment" - "TestRequests" - "TestTimeout" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # Fatal Python error: Aborted - "test_basic_response" - "test_text_response" - ]; + disabledTests = [ + # Disable tests that require network access and use httpbin + "requests.api.request" + "requests.models.PreparedRequest" + "requests.sessions.Session" + "requests" + "test_redirecting_to_bad_url" + "test_requests_are_updated_each_time" + "test_should_bypass_proxies_pass_only_hostname" + "test_urllib3_pool_connection_closed" + "test_urllib3_retries" + "test_use_proxy_from_environment" + "TestRequests" + "TestTimeout" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # Fatal Python error: Aborted + "test_basic_response" + "test_text_response" + ]; disabledTestPaths = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Fatal Python error: Aborted diff --git a/pkgs/development/python-modules/resampy/default.nix b/pkgs/development/python-modules/resampy/default.nix index b644cc76cadf..263a32e1e36d 100644 --- a/pkgs/development/python-modules/resampy/default.nix +++ b/pkgs/development/python-modules/resampy/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { pytest-cov-stub pytestCheckHook scipy - ] ++ optional-dependencies.design; + ] + ++ optional-dependencies.design; disabledTests = lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ # crashing the interpreter diff --git a/pkgs/development/python-modules/responses/default.nix b/pkgs/development/python-modules/responses/default.nix index 4544ef60d6ce..704da532a583 100644 --- a/pkgs/development/python-modules/responses/default.nix +++ b/pkgs/development/python-modules/responses/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { pytest-httpserver pytestCheckHook tomli-w - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; pythonImportsCheck = [ "responses" ]; diff --git a/pkgs/development/python-modules/rich/default.nix b/pkgs/development/python-modules/rich/default.nix index e0c594822a0b..6e381290a19a 100644 --- a/pkgs/development/python-modules/rich/default.nix +++ b/pkgs/development/python-modules/rich/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { dependencies = [ markdown-it-py pygments - ] ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; optional-dependencies = { jupyter = [ ipywidgets ]; diff --git a/pkgs/development/python-modules/rioxarray/default.nix b/pkgs/development/python-modules/rioxarray/default.nix index e7e761cd78eb..3aca60897592 100644 --- a/pkgs/development/python-modules/rioxarray/default.nix +++ b/pkgs/development/python-modules/rioxarray/default.nix @@ -48,21 +48,20 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # AssertionError: assert 535727386 == 535691205 - "test_clip_geojson__no_drop" - # Fails with GDAL 3.11 warning - "test_rasterio_vrt" - # Fails with small numerical errors on GDAL 3.11 - "test_rasterio_vrt_gcps" - "test_reproject__gcps" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # numerical errors - "test_clip_geojson" - "test_open_rasterio_mask_chunk_clip" - ]; + disabledTests = [ + # AssertionError: assert 535727386 == 535691205 + "test_clip_geojson__no_drop" + # Fails with GDAL 3.11 warning + "test_rasterio_vrt" + # Fails with small numerical errors on GDAL 3.11 + "test_rasterio_vrt_gcps" + "test_reproject__gcps" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # numerical errors + "test_clip_geojson" + "test_open_rasterio_mask_chunk_clip" + ]; pythonImportsCheck = [ "rioxarray" ]; diff --git a/pkgs/development/python-modules/rope/default.nix b/pkgs/development/python-modules/rope/default.nix index 94ba8fafe514..f89cbf34869b 100644 --- a/pkgs/development/python-modules/rope/default.nix +++ b/pkgs/development/python-modules/rope/default.nix @@ -35,18 +35,17 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - "test_search_submodule" - "test_get_package_source_pytest" - "test_get_modname_folder" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/python-rope/rope/issues/801 - "test_skipping_directories_not_accessible_because_of_permission_error" - "test_hint_parametrized_iterable" - "test_hint_parametrized_iterator" - ]; + disabledTests = [ + "test_search_submodule" + "test_get_package_source_pytest" + "test_get_modname_folder" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/python-rope/rope/issues/801 + "test_skipping_directories_not_accessible_because_of_permission_error" + "test_hint_parametrized_iterable" + "test_hint_parametrized_iterator" + ]; meta = with lib; { description = "Python refactoring library"; diff --git a/pkgs/development/python-modules/rpy2/default.nix b/pkgs/development/python-modules/rpy2/default.nix index 326604d6bafa..8a6a5fe9bcaa 100644 --- a/pkgs/development/python-modules/rpy2/default.nix +++ b/pkgs/development/python-modules/rpy2/default.nix @@ -48,31 +48,30 @@ buildPythonPackage rec { substituteInPlace 'requirements.txt' --replace 'pytest' "" ''; - buildInputs = - [ - pcre - xz - bzip2 - zlib - zstd - icu - libdeflate - ] - ++ (with rPackages; [ - # packages expected by the test framework - ggplot2 - dplyr - RSQLite - broom - DBI - dbplyr - hexbin - lazyeval - lme4 - tidyr - ]) - ++ extraRPackages - ++ rWrapper.recommendedPackages; + buildInputs = [ + pcre + xz + bzip2 + zlib + zstd + icu + libdeflate + ] + ++ (with rPackages; [ + # packages expected by the test framework + ggplot2 + dplyr + RSQLite + broom + DBI + dbplyr + hexbin + lazyeval + lme4 + tidyr + ]) + ++ extraRPackages + ++ rWrapper.recommendedPackages; nativeBuildInputs = [ R # needed at setup time to detect R_HOME (alternatively set R_HOME explicitly) diff --git a/pkgs/development/python-modules/s3transfer/default.nix b/pkgs/development/python-modules/s3transfer/default.nix index 24a24150b11f..cb6206734643 100644 --- a/pkgs/development/python-modules/s3transfer/default.nix +++ b/pkgs/development/python-modules/s3transfer/default.nix @@ -32,12 +32,11 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTestPaths = - [ - # Requires network access - "tests/integration" - ] - ++ + disabledTestPaths = [ + # Requires network access + "tests/integration" + ] + ++ # There was a change in python 3.8 that defaults multiprocessing to spawn instead of fork on macOS # See https://bugs.python.org/issue33725 and https://github.com/python/cpython/pull/13603. # I suspect the underlying issue here is that upstream tests aren't compatible with spawn multiprocessing, and pass on linux where the default is still fork diff --git a/pkgs/development/python-modules/safetensors/default.nix b/pkgs/development/python-modules/safetensors/default.nix index 92de3c61d677..609bf9790c0f 100644 --- a/pkgs/development/python-modules/safetensors/default.nix +++ b/pkgs/development/python-modules/safetensors/default.nix @@ -107,16 +107,15 @@ buildPythonPackage rec { ]; # don't require PaddlePaddle (not in Nixpkgs), Flax, or Tensorflow (onerous) to run tests: - disabledTestPaths = - [ - "tests/test_flax_comparison.py" - "tests/test_paddle_comparison.py" - "tests/test_tf_comparison.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # don't require mlx (not in Nixpkgs) to run tests - "tests/test_mlx_comparison.py" - ]; + disabledTestPaths = [ + "tests/test_flax_comparison.py" + "tests/test_paddle_comparison.py" + "tests/test_tf_comparison.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # don't require mlx (not in Nixpkgs) to run tests + "tests/test_mlx_comparison.py" + ]; pythonImportsCheck = [ "safetensors" ]; diff --git a/pkgs/development/python-modules/sagemaker-core/default.nix b/pkgs/development/python-modules/sagemaker-core/default.nix index 0ee3b625525d..c5fff3144b14 100644 --- a/pkgs/development/python-modules/sagemaker-core/default.nix +++ b/pkgs/development/python-modules/sagemaker-core/default.nix @@ -75,7 +75,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTestPaths = [ # Tries to import deprecated `sklearn` diff --git a/pkgs/development/python-modules/samsungtvws/default.nix b/pkgs/development/python-modules/samsungtvws/default.nix index aac1c72487b5..5fa6bff8ccd7 100644 --- a/pkgs/development/python-modules/samsungtvws/default.nix +++ b/pkgs/development/python-modules/samsungtvws/default.nix @@ -51,14 +51,13 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = - [ - aioresponses - pytest-asyncio - pytestCheckHook - ] - ++ optional-dependencies.async - ++ optional-dependencies.encrypted; + nativeCheckInputs = [ + aioresponses + pytest-asyncio + pytestCheckHook + ] + ++ optional-dependencies.async + ++ optional-dependencies.encrypted; pythonImportsCheck = [ "samsungtvws" ]; diff --git a/pkgs/development/python-modules/sanic/default.nix b/pkgs/development/python-modules/sanic/default.nix index e83b467fa52a..10fed42b4bda 100644 --- a/pkgs/development/python-modules/sanic/default.nix +++ b/pkgs/development/python-modules/sanic/default.nix @@ -66,7 +66,8 @@ buildPythonPackage rec { pytestCheckHook sanic-testing uvicorn - ] ++ optional-dependencies.http3; + ] + ++ optional-dependencies.http3; doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/development/python-modules/scalene/default.nix b/pkgs/development/python-modules/scalene/default.nix index a1614f424c48..b33764932a98 100644 --- a/pkgs/development/python-modules/scalene/default.nix +++ b/pkgs/development/python-modules/scalene/default.nix @@ -75,11 +75,13 @@ buildPythonPackage rec { psutil pydantic rich - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ nvidia-ml-py ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ nvidia-ml-py ]; pythonRemoveDeps = [ "nvidia-ml-py3" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "nvidia-ml-py" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "nvidia-ml-py" ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/scancode-toolkit/default.nix b/pkgs/development/python-modules/scancode-toolkit/default.nix index 878faa87630a..91330b55d48e 100644 --- a/pkgs/development/python-modules/scancode-toolkit/default.nix +++ b/pkgs/development/python-modules/scancode-toolkit/default.nix @@ -127,7 +127,8 @@ buildPythonPackage rec { typecode-libmagic urlpy xmltodict - ] ++ lib.optionals (pythonOlder "3.9") [ zipp ]; + ] + ++ lib.optionals (pythonOlder "3.9") [ zipp ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/scapy/default.nix b/pkgs/development/python-modules/scapy/default.nix index 500cf732b92c..5c457b80a29c 100644 --- a/pkgs/development/python-modules/scapy/default.nix +++ b/pkgs/development/python-modules/scapy/default.nix @@ -46,41 +46,39 @@ buildPythonPackage rec { patches = [ ./find-library.patch ]; - postPatch = - '' - printf "${version}" > scapy/VERSION + postPatch = '' + printf "${version}" > scapy/VERSION - libpcap_file="${lib.getLib libpcap}/lib/libpcap${stdenv.hostPlatform.extensions.sharedLibrary}" - if ! [ -e "$libpcap_file" ]; then - echo "error: $libpcap_file not found" >&2 - exit 1 - fi - substituteInPlace "scapy/libs/winpcapy.py" \ - --replace "@libpcap_file@" "$libpcap_file" - '' - + lib.optionalString withManufDb '' - substituteInPlace scapy/data.py --replace "/opt/wireshark" "${wireshark}" - ''; + libpcap_file="${lib.getLib libpcap}/lib/libpcap${stdenv.hostPlatform.extensions.sharedLibrary}" + if ! [ -e "$libpcap_file" ]; then + echo "error: $libpcap_file not found" >&2 + exit 1 + fi + substituteInPlace "scapy/libs/winpcapy.py" \ + --replace "@libpcap_file@" "$libpcap_file" + '' + + lib.optionalString withManufDb '' + substituteInPlace scapy/data.py --replace "/opt/wireshark" "${wireshark}" + ''; buildInputs = lib.optional withVoipSupport sox; - propagatedBuildInputs = - [ - pycrypto - ecdsa - ] - ++ lib.optionals withOptionalDeps [ - tcpdump - ipython - ] - ++ lib.optional withCryptography cryptography - ++ lib.optional withPlottingSupport matplotlib - ++ lib.optionals withGraphicsSupport [ - pyx - texliveBasic - graphviz - imagemagick - ]; + propagatedBuildInputs = [ + pycrypto + ecdsa + ] + ++ lib.optionals withOptionalDeps [ + tcpdump + ipython + ] + ++ lib.optional withCryptography cryptography + ++ lib.optional withPlottingSupport matplotlib + ++ lib.optionals withGraphicsSupport [ + pyx + texliveBasic + graphviz + imagemagick + ]; # Running the tests seems too complicated: doCheck = false; diff --git a/pkgs/development/python-modules/schedula/default.nix b/pkgs/development/python-modules/schedula/default.nix index ffff9a81f2b1..bf0ccb78af15 100644 --- a/pkgs/development/python-modules/schedula/default.nix +++ b/pkgs/development/python-modules/schedula/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { sphinx = [ sphinx sphinx-click - ] ++ plot; + ] + ++ plot; web = [ requests regex @@ -59,16 +60,15 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = - [ - cryptography # doctests - ddt - sphinx - pytestCheckHook - ] - ++ schedula.optional-dependencies.io - ++ schedula.optional-dependencies.parallel - ++ schedula.optional-dependencies.plot; + nativeCheckInputs = [ + cryptography # doctests + ddt + sphinx + pytestCheckHook + ] + ++ schedula.optional-dependencies.io + ++ schedula.optional-dependencies.parallel + ++ schedula.optional-dependencies.plot; disabledTests = [ # FAILED tests/test_setup.py::TestSetup::test_long_description - ModuleNotFoundError: No module named 'sphinxcontrib.writers' diff --git a/pkgs/development/python-modules/schema-salad/default.nix b/pkgs/development/python-modules/schema-salad/default.nix index ca7c52f8bca1..144dc0cc6995 100644 --- a/pkgs/development/python-modules/schema-salad/default.nix +++ b/pkgs/development/python-modules/schema-salad/default.nix @@ -43,21 +43,20 @@ buildPythonPackage rec { build-system = [ setuptools-scm ]; - dependencies = - [ - cachecontrol - mistune - mypy - mypy-extensions - rdflib - requests - ruamel-yaml - types-dataclasses - types-requests - types-setuptools - ] - ++ cachecontrol.optional-dependencies.filecache - ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; + dependencies = [ + cachecontrol + mistune + mypy + mypy-extensions + rdflib + requests + ruamel-yaml + types-dataclasses + types-requests + types-setuptools + ] + ++ cachecontrol.optional-dependencies.filecache + ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.pycodegen; diff --git a/pkgs/development/python-modules/schwifty/default.nix b/pkgs/development/python-modules/schwifty/default.nix index ab4e65e62b26..c708c97c831e 100644 --- a/pkgs/development/python-modules/schwifty/default.nix +++ b/pkgs/development/python-modules/schwifty/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { iso3166 pycountry rstr - ] ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.12") [ importlib-resources ]; optional-dependencies = { pydantic = [ pydantic ]; @@ -50,7 +51,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "schwifty" ]; diff --git a/pkgs/development/python-modules/scikit-build-core/default.nix b/pkgs/development/python-modules/scikit-build-core/default.nix index 77ac79ec10dc..b91717d89972 100644 --- a/pkgs/development/python-modules/scikit-build-core/default.nix +++ b/pkgs/development/python-modules/scikit-build-core/default.nix @@ -50,15 +50,14 @@ buildPythonPackage rec { hatchling ]; - dependencies = - [ - packaging - pathspec - ] - ++ lib.optionals (pythonOlder "3.11") [ - exceptiongroup - tomli - ]; + dependencies = [ + packaging + pathspec + ] + ++ lib.optionals (pythonOlder "3.11") [ + exceptiongroup + tomli + ]; nativeCheckInputs = [ build diff --git a/pkgs/development/python-modules/scikit-build/default.nix b/pkgs/development/python-modules/scikit-build/default.nix index 9a3501a71957..6e6016c38fc5 100644 --- a/pkgs/development/python-modules/scikit-build/default.nix +++ b/pkgs/development/python-modules/scikit-build/default.nix @@ -60,7 +60,8 @@ buildPythonPackage rec { packaging setuptools wheel - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ cmake diff --git a/pkgs/development/python-modules/scikit-hep-testdata/default.nix b/pkgs/development/python-modules/scikit-hep-testdata/default.nix index 6f0d26e69d48..05c443811252 100644 --- a/pkgs/development/python-modules/scikit-hep-testdata/default.nix +++ b/pkgs/development/python-modules/scikit-hep-testdata/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { dependencies = [ pyyaml requests - ] ++ lib.optionals (!pythonAtLeast "3.9") [ importlib-resources ]; + ] + ++ lib.optionals (!pythonAtLeast "3.9") [ importlib-resources ]; SKHEP_DATA = 1; # install the actual root files diff --git a/pkgs/development/python-modules/scikit-image/default.nix b/pkgs/development/python-modules/scikit-image/default.nix index d5439693c4fc..1272f89ef1f5 100644 --- a/pkgs/development/python-modules/scikit-image/default.nix +++ b/pkgs/development/python-modules/scikit-image/default.nix @@ -85,7 +85,8 @@ let pyamg scikit-learn simpleitk - ] ++ dask.optional-dependencies.array; + ] + ++ dask.optional-dependencies.array; }; # test suite is very cpu intensive, move to passthru.tests @@ -108,33 +109,32 @@ let # Requires network access (actually some data is loaded via `skimage._shared.testing.fetch` in the global scope, which calls `pytest.skip` when a network is unaccessible, leading to a pytest collection error). "${installedPackageRoot}/skimage/filters/rank/tests/test_rank.py" ]; - pytestFlagsArray = + pytestFlagsArray = [ + "${installedPackageRoot}" + "--pyargs" + "skimage" + ] + ++ builtins.map (testid: "--deselect=" + testid) ( [ - "${installedPackageRoot}" - "--pyargs" - "skimage" + # These tests require network access + "skimage/data/test_data.py::test_skin" + "skimage/data/tests/test_data.py::test_skin" + "skimage/io/tests/test_io.py::test_imread_http_url" + "skimage/restoration/tests/test_rolling_ball.py::test_ndim" ] - ++ builtins.map (testid: "--deselect=" + testid) ( - [ - # These tests require network access - "skimage/data/test_data.py::test_skin" - "skimage/data/tests/test_data.py::test_skin" - "skimage/io/tests/test_io.py::test_imread_http_url" - "skimage/restoration/tests/test_rolling_ball.py::test_ndim" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Matplotlib tests are broken inside darwin sandbox - "skimage/feature/tests/test_util.py::test_plot_matches" - "skimage/filters/tests/test_thresholding.py::TestSimpleImage::test_try_all_threshold" - "skimage/io/tests/test_mpl_imshow.py::" - # See https://github.com/scikit-image/scikit-image/issues/7061 and https://github.com/scikit-image/scikit-image/issues/7104 - "skimage/measure/tests/test_fit.py" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # https://github.com/scikit-image/scikit-image/issues/7104 - "skimage/measure/tests/test_moments.py" - ] - ); + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Matplotlib tests are broken inside darwin sandbox + "skimage/feature/tests/test_util.py::test_plot_matches" + "skimage/filters/tests/test_thresholding.py::TestSimpleImage::test_try_all_threshold" + "skimage/io/tests/test_mpl_imshow.py::" + # See https://github.com/scikit-image/scikit-image/issues/7061 and https://github.com/scikit-image/scikit-image/issues/7104 + "skimage/measure/tests/test_fit.py" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # https://github.com/scikit-image/scikit-image/issues/7104 + "skimage/measure/tests/test_moments.py" + ] + ); # Check cythonized modules pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/scikit-learn/default.nix b/pkgs/development/python-modules/scikit-learn/default.nix index 319d7c71e7f2..a16a84c1adb8 100644 --- a/pkgs/development/python-modules/scikit-learn/default.nix +++ b/pkgs/development/python-modules/scikit-learn/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { numpy.blas pillow glibcLocales - ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; nativeBuildInputs = [ gfortran @@ -75,22 +76,21 @@ buildPythonPackage rec { # PermissionError: [Errno 1] Operation not permitted: '/nix/nix-installer' doCheck = !stdenv.hostPlatform.isDarwin; - disabledTests = - [ - # Skip test_feature_importance_regression - does web fetch - "test_feature_importance_regression" + disabledTests = [ + # Skip test_feature_importance_regression - does web fetch + "test_feature_importance_regression" - # Fail due to new deprecation warnings in scipy - # FIXME: reenable when fixed upstream - "test_logistic_regression_path_convergence_fail" - "test_linalg_warning_with_newton_solver" - "test_newton_cholesky_fallback_to_lbfgs" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # doesn't seem to produce correct results? - # possibly relevant: https://github.com/scikit-learn/scikit-learn/issues/25838#issuecomment-2308650816 - "test_sparse_input" - ]; + # Fail due to new deprecation warnings in scipy + # FIXME: reenable when fixed upstream + "test_logistic_regression_path_convergence_fail" + "test_linalg_warning_with_newton_solver" + "test_newton_cholesky_fallback_to_lbfgs" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # doesn't seem to produce correct results? + # possibly relevant: https://github.com/scikit-learn/scikit-learn/issues/25838#issuecomment-2308650816 + "test_sparse_input" + ]; pytestFlagsArray = [ # verbose build outputs needed to debug hard-to-reproduce hydra failures diff --git a/pkgs/development/python-modules/scikit-survival/default.nix b/pkgs/development/python-modules/scikit-survival/default.nix index a01a4988b698..54714e1e66b2 100644 --- a/pkgs/development/python-modules/scikit-survival/default.nix +++ b/pkgs/development/python-modules/scikit-survival/default.nix @@ -64,17 +64,17 @@ buildPythonPackage rec { postCheck = "popd"; # very long tests, unnecessary for a leaf package - disabledTests = - [ - "test_coxph" - "test_datasets" - "test_ensemble_selection" - "test_minlip" - "test_pandas_inputs" - "test_survival_svm" - "test_tree" - ] - ++ lib.optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) + disabledTests = [ + "test_coxph" + "test_datasets" + "test_ensemble_selection" + "test_minlip" + "test_pandas_inputs" + "test_survival_svm" + "test_tree" + ] + ++ + lib.optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) # floating point mismatch on aarch64 # 27079905.88052468 to far from 27079905.880496684 "test_coxnet"; diff --git a/pkgs/development/python-modules/scim2-client/default.nix b/pkgs/development/python-modules/scim2-client/default.nix index 27dd921289f1..388c21af3852 100644 --- a/pkgs/development/python-modules/scim2-client/default.nix +++ b/pkgs/development/python-modules/scim2-client/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { scim2-server werkzeug cacert - ] ++ optional-dependencies.httpx; + ] + ++ optional-dependencies.httpx; # Werkzeug returns 500, didn't deem it worth it to investigate disabledTests = [ diff --git a/pkgs/development/python-modules/scim2-filter-parser/default.nix b/pkgs/development/python-modules/scim2-filter-parser/default.nix index ab9e307d3641..883e35096994 100644 --- a/pkgs/development/python-modules/scim2-filter-parser/default.nix +++ b/pkgs/development/python-modules/scim2-filter-parser/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { nativeCheckInputs = [ mock pytestCheckHook - ] ++ optional-dependencies.django-query; + ] + ++ optional-dependencies.django-query; meta = with lib; { description = "Customizable parser/transpiler for SCIM2.0 filters"; diff --git a/pkgs/development/python-modules/scim2-tester/default.nix b/pkgs/development/python-modules/scim2-tester/default.nix index 93de7bf9f384..e751ae17f007 100644 --- a/pkgs/development/python-modules/scim2-tester/default.nix +++ b/pkgs/development/python-modules/scim2-tester/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { scim2-server pytest-httpserver cacert - ] ++ optional-dependencies.httpx; + ] + ++ optional-dependencies.httpx; pythonImportsCheck = [ "scim2_tester" ]; diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index 98dcac1f9b2f..e466fb3f8655 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -107,23 +107,22 @@ buildPythonPackage { --replace-fail "numpy>=2.0.0,<2.6" numpy ''; - build-system = - [ - cython - gfortran - meson-python - nukeReferences - pythran - pkg-config - setuptools - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Minimal version required according to: - # https://github.com/scipy/scipy/blob/v1.16.0/scipy/meson.build#L238-L244 - (xcbuild.override { - sdkVer = "13.3"; - }) - ]; + build-system = [ + cython + gfortran + meson-python + nukeReferences + pythran + pkg-config + setuptools + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Minimal version required according to: + # https://github.com/scipy/scipy/blob/v1.16.0/scipy/meson.build#L238-L244 + (xcbuild.override { + sdkVer = "13.3"; + }) + ]; buildInputs = [ blas @@ -162,23 +161,22 @@ buildPythonPackage { doCheck = !(stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isDarwin); - preConfigure = - '' - # Helps parallelization a bit - export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES - # We download manually the datasets and this variable tells the pooch - # library where these files are cached. See also: - # https://github.com/scipy/scipy/pull/18518#issuecomment-1562350648 And at: - # https://github.com/scipy/scipy/pull/17965#issuecomment-1560759962 - export XDG_CACHE_HOME=$PWD; export HOME=$(mktemp -d); mkdir scipy-data - '' - + (lib.concatStringsSep "\n" ( - lib.mapAttrsToList ( - d: dpath: - # Actually copy the datasets - "cp ${dpath} scipy-data/${d}.dat" - ) datasets - )); + preConfigure = '' + # Helps parallelization a bit + export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES + # We download manually the datasets and this variable tells the pooch + # library where these files are cached. See also: + # https://github.com/scipy/scipy/pull/18518#issuecomment-1562350648 And at: + # https://github.com/scipy/scipy/pull/17965#issuecomment-1560759962 + export XDG_CACHE_HOME=$PWD; export HOME=$(mktemp -d); mkdir scipy-data + '' + + (lib.concatStringsSep "\n" ( + lib.mapAttrsToList ( + d: dpath: + # Actually copy the datasets + "cp ${dpath} scipy-data/${d}.dat" + ) datasets + )); mesonFlags = [ "-Dblas=${blas.pname}" @@ -216,14 +214,13 @@ buildPythonPackage { passthru = { inherit blas; - updateScript = - [ - ./update.sh - # Pass it this file name as argument - (builtins.unsafeGetAttrPos "pname" python.pkgs.scipy).file - ] - # Pass it the names of the datasets to update their hashes - ++ (builtins.attrNames datasetsHashes); + updateScript = [ + ./update.sh + # Pass it this file name as argument + (builtins.unsafeGetAttrPos "pname" python.pkgs.scipy).file + ] + # Pass it the names of the datasets to update their hashes + ++ (builtins.attrNames datasetsHashes); tests = { inherit sage; }; diff --git a/pkgs/development/python-modules/scrapy/default.nix b/pkgs/development/python-modules/scrapy/default.nix index d7c843993b86..ab79f4367282 100644 --- a/pkgs/development/python-modules/scrapy/default.nix +++ b/pkgs/development/python-modules/scrapy/default.nix @@ -116,34 +116,33 @@ buildPythonPackage rec { "docs" ]; - disabledTests = - [ - # Requires network access - "AnonymousFTPTestCase" - "FTPFeedStorageTest" - "FeedExportTest" - "test_custom_asyncio_loop_enabled_true" - "test_custom_loop_asyncio" - "test_custom_loop_asyncio_deferred_signal" - "FileFeedStoragePreFeedOptionsTest" # https://github.com/scrapy/scrapy/issues/5157 - "test_persist" - "test_timeout_download_from_spider_nodata_rcvd" - "test_timeout_download_from_spider_server_hangs" - "test_unbounded_response" - "CookiesMiddlewareTest" - # Test fails on Hydra - "test_start_requests_laziness" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_xmliter_encoding" - "test_download" - "test_reactor_default_twisted_reactor_select" - "URIParamsSettingTest" - "URIParamsFeedOptionTest" - # flaky on darwin-aarch64 - "test_fixed_delay" - "test_start_requests_laziness" - ]; + disabledTests = [ + # Requires network access + "AnonymousFTPTestCase" + "FTPFeedStorageTest" + "FeedExportTest" + "test_custom_asyncio_loop_enabled_true" + "test_custom_loop_asyncio" + "test_custom_loop_asyncio_deferred_signal" + "FileFeedStoragePreFeedOptionsTest" # https://github.com/scrapy/scrapy/issues/5157 + "test_persist" + "test_timeout_download_from_spider_nodata_rcvd" + "test_timeout_download_from_spider_server_hangs" + "test_unbounded_response" + "CookiesMiddlewareTest" + # Test fails on Hydra + "test_start_requests_laziness" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_xmliter_encoding" + "test_download" + "test_reactor_default_twisted_reactor_select" + "URIParamsSettingTest" + "URIParamsFeedOptionTest" + # flaky on darwin-aarch64 + "test_fixed_delay" + "test_start_requests_laziness" + ]; postInstall = '' installManPage extras/scrapy.1 diff --git a/pkgs/development/python-modules/screenlogicpy/default.nix b/pkgs/development/python-modules/screenlogicpy/default.nix index a3424a31b99f..d70c964cf901 100644 --- a/pkgs/development/python-modules/screenlogicpy/default.nix +++ b/pkgs/development/python-modules/screenlogicpy/default.nix @@ -33,23 +33,22 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # Tests require network access - "test_async_discovery" - "test_async" - "test_asyncio_gateway_discovery" - "test_discovery_async_discover" - "test_gateway_discovery" - "test_gateway" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # Tests block on Python 3.12 - "test_sub_unsub" - "test_attach_existing" - "test_login_async_connect_to_gateway" - "test_login_async_gateway_connect" - ]; + disabledTests = [ + # Tests require network access + "test_async_discovery" + "test_async" + "test_asyncio_gateway_discovery" + "test_discovery_async_discover" + "test_gateway_discovery" + "test_gateway" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # Tests block on Python 3.12 + "test_sub_unsub" + "test_attach_existing" + "test_login_async_connect_to_gateway" + "test_login_async_gateway_connect" + ]; pythonImportsCheck = [ "screenlogicpy" ]; diff --git a/pkgs/development/python-modules/sdkmanager/default.nix b/pkgs/development/python-modules/sdkmanager/default.nix index d8352bbe18db..48a1a3b72376 100644 --- a/pkgs/development/python-modules/sdkmanager/default.nix +++ b/pkgs/development/python-modules/sdkmanager/default.nix @@ -29,13 +29,12 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - argcomplete - requests - ] - ++ requests.optional-dependencies.socks - ++ lib.optionals (pythonAtLeast "3.12") [ looseversion ]; + dependencies = [ + argcomplete + requests + ] + ++ requests.optional-dependencies.socks + ++ lib.optionals (pythonAtLeast "3.12") [ looseversion ]; postInstall = '' wrapProgram $out/bin/sdkmanager \ diff --git a/pkgs/development/python-modules/seaborn/default.nix b/pkgs/development/python-modules/seaborn/default.nix index dd730c09029a..d9420b9ce753 100644 --- a/pkgs/development/python-modules/seaborn/default.nix +++ b/pkgs/development/python-modules/seaborn/default.nix @@ -64,15 +64,14 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # requires internet connection - "test_load_dataset_string_error" - ] - ++ lib.optionals (!stdenv.hostPlatform.isx86) [ - # overly strict float tolerances - "TestDendrogram" - ]; + disabledTests = [ + # requires internet connection + "test_load_dataset_string_error" + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86) [ + # overly strict float tolerances + "TestDendrogram" + ]; # All platforms should use Agg. Let's set it explicitly to avoid probing GUI # backends (leads to crashes on macOS). diff --git a/pkgs/development/python-modules/seabreeze/default.nix b/pkgs/development/python-modules/seabreeze/default.nix index 96f5f31d6fa1..03220410191c 100644 --- a/pkgs/development/python-modules/seabreeze/default.nix +++ b/pkgs/development/python-modules/seabreeze/default.nix @@ -79,7 +79,8 @@ buildPythonPackage rec { pytestCheckHook mock zipp - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ "TestHardware" ]; diff --git a/pkgs/development/python-modules/seasonal/default.nix b/pkgs/development/python-modules/seasonal/default.nix index cef289ff5c8e..c3810c8e0610 100644 --- a/pkgs/development/python-modules/seasonal/default.nix +++ b/pkgs/development/python-modules/seasonal/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); meta = with lib; { description = "Robustly estimate trend and periodicity in a timeseries"; diff --git a/pkgs/development/python-modules/securesystemslib/default.nix b/pkgs/development/python-modules/securesystemslib/default.nix index 6862915fafaf..d064b3f477ac 100644 --- a/pkgs/development/python-modules/securesystemslib/default.nix +++ b/pkgs/development/python-modules/securesystemslib/default.nix @@ -65,7 +65,8 @@ buildPythonPackage rec { nativeCheckInputs = [ ed25519 pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "securesystemslib" ]; diff --git a/pkgs/development/python-modules/selenium/default.nix b/pkgs/development/python-modules/selenium/default.nix index cc4cb5485140..e33fc961c8d4 100644 --- a/pkgs/development/python-modules/selenium/default.nix +++ b/pkgs/development/python-modules/selenium/default.nix @@ -38,25 +38,24 @@ buildPythonPackage rec { cd py ''; - postInstall = - '' - DST_PREFIX=$out/${python.sitePackages}/selenium/webdriver/ - DST_REMOTE=$DST_PREFIX/remote/ - DST_FF=$DST_PREFIX/firefox - cp ../rb/lib/selenium/webdriver/atoms/getAttribute.js $DST_REMOTE - cp ../rb/lib/selenium/webdriver/atoms/isDisplayed.js $DST_REMOTE - cp ../rb/lib/selenium/webdriver/atoms/findElements.js $DST_REMOTE - cp ../javascript/cdp-support/mutation-listener.js $DST_REMOTE - cp ../third_party/js/selenium/webdriver.json $DST_FF/webdriver_prefs.json - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $DST_PREFIX/common/macos - ln -s ${lib.getExe selenium-manager} $DST_PREFIX/common/macos/ - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $DST_PREFIX/common/linux/ - ln -s ${lib.getExe selenium-manager} $DST_PREFIX/common/linux/ - ''; + postInstall = '' + DST_PREFIX=$out/${python.sitePackages}/selenium/webdriver/ + DST_REMOTE=$DST_PREFIX/remote/ + DST_FF=$DST_PREFIX/firefox + cp ../rb/lib/selenium/webdriver/atoms/getAttribute.js $DST_REMOTE + cp ../rb/lib/selenium/webdriver/atoms/isDisplayed.js $DST_REMOTE + cp ../rb/lib/selenium/webdriver/atoms/findElements.js $DST_REMOTE + cp ../javascript/cdp-support/mutation-listener.js $DST_REMOTE + cp ../third_party/js/selenium/webdriver.json $DST_FF/webdriver_prefs.json + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $DST_PREFIX/common/macos + ln -s ${lib.getExe selenium-manager} $DST_PREFIX/common/macos/ + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $DST_PREFIX/common/linux/ + ln -s ${lib.getExe selenium-manager} $DST_PREFIX/common/linux/ + ''; build-system = [ setuptools ]; @@ -67,7 +66,8 @@ buildPythonPackage rec { urllib3 typing-extensions websocket-client - ] ++ urllib3.optional-dependencies.socks; + ] + ++ urllib3.optional-dependencies.socks; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/sentence-transformers/default.nix b/pkgs/development/python-modules/sentence-transformers/default.nix index 33998db70e07..1c4f1d5a2430 100644 --- a/pkgs/development/python-modules/sentence-transformers/default.nix +++ b/pkgs/development/python-modules/sentence-transformers/default.nix @@ -63,7 +63,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-cov-stub pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "sentence_transformers" ]; @@ -106,28 +107,27 @@ buildPythonPackage rec { "test_performance_with_large_vectors" ]; - disabledTestPaths = - [ - # Tests require network access - "tests/cross_encoder/test_cross_encoder.py" - "tests/cross_encoder/test_train_stsb.py" - "tests/evaluation/test_information_retrieval_evaluator.py" - "tests/sparse_encoder/models/test_csr.py" - "tests/sparse_encoder/models/test_sparse_static_embedding.py" - "tests/sparse_encoder/test_opensearch_models.py" - "tests/sparse_encoder/test_pretrained.py" - "tests/sparse_encoder/test_sparse_encoder.py" - "tests/test_compute_embeddings.py" - "tests/test_model_card_data.py" - "tests/test_multi_process.py" - "tests/test_pretrained_stsb.py" - "tests/test_sentence_transformer.py" - "tests/test_train_stsb.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Segfault - "tests/test_sparse_tensor.py" - ]; + disabledTestPaths = [ + # Tests require network access + "tests/cross_encoder/test_cross_encoder.py" + "tests/cross_encoder/test_train_stsb.py" + "tests/evaluation/test_information_retrieval_evaluator.py" + "tests/sparse_encoder/models/test_csr.py" + "tests/sparse_encoder/models/test_sparse_static_embedding.py" + "tests/sparse_encoder/test_opensearch_models.py" + "tests/sparse_encoder/test_pretrained.py" + "tests/sparse_encoder/test_sparse_encoder.py" + "tests/test_compute_embeddings.py" + "tests/test_model_card_data.py" + "tests/test_multi_process.py" + "tests/test_pretrained_stsb.py" + "tests/test_sentence_transformer.py" + "tests/test_train_stsb.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Segfault + "tests/test_sparse_tensor.py" + ]; # Sentence-transformer needs a writable hf_home cache postInstall = '' diff --git a/pkgs/development/python-modules/sentry-sdk/default.nix b/pkgs/development/python-modules/sentry-sdk/default.nix index 39538231dbe3..076a82996763 100644 --- a/pkgs/development/python-modules/sentry-sdk/default.nix +++ b/pkgs/development/python-modules/sentry-sdk/default.nix @@ -164,7 +164,8 @@ buildPythonPackage rec { pytest-xdist pytest-watch pytestCheckHook - ] ++ optional-dependencies.http2; + ] + ++ optional-dependencies.http2; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/servefile/default.nix b/pkgs/development/python-modules/servefile/default.nix index 893cf8591544..1d1c0c175bac 100644 --- a/pkgs/development/python-modules/servefile/default.nix +++ b/pkgs/development/python-modules/servefile/default.nix @@ -23,7 +23,8 @@ buildPythonPackage rec { dependencies = [ pyopenssl - ] ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; + ] + ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/setuptools-generate/default.nix b/pkgs/development/python-modules/setuptools-generate/default.nix index db8aa16751e2..d87a3ca4a554 100644 --- a/pkgs/development/python-modules/setuptools-generate/default.nix +++ b/pkgs/development/python-modules/setuptools-generate/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { help2man markdown-it-py shtab - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/setuptools-git-versioning/default.nix b/pkgs/development/python-modules/setuptools-git-versioning/default.nix index fb69ff6313f8..90e0537a81d0 100644 --- a/pkgs/development/python-modules/setuptools-git-versioning/default.nix +++ b/pkgs/development/python-modules/setuptools-git-versioning/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { dependencies = [ packaging setuptools - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; pythonImportsCheck = [ "setuptools_git_versioning" ]; diff --git a/pkgs/development/python-modules/setuptools-rust/default.nix b/pkgs/development/python-modules/setuptools-rust/default.nix index 802c8a8ed901..8f24a4356252 100644 --- a/pkgs/development/python-modules/setuptools-rust/default.nix +++ b/pkgs/development/python-modules/setuptools-rust/default.nix @@ -47,13 +47,14 @@ buildPythonPackage rec { format = "setuptools"; buildAndTestSubdir = null; - nativeBuildInputs = - [ setuptools-rust ] - ++ [ - rustPlatform.cargoSetupHook - cargo - rustc - ]; + nativeBuildInputs = [ + setuptools-rust + ] + ++ [ + rustPlatform.cargoSetupHook + cargo + rustc + ]; preConfigure = '' # sourceRoot puts Cargo.lock in the wrong place due to the diff --git a/pkgs/development/python-modules/setuptools-scm/default.nix b/pkgs/development/python-modules/setuptools-scm/default.nix index 3cd9f6906023..e8eb947c1830 100644 --- a/pkgs/development/python-modules/setuptools-scm/default.nix +++ b/pkgs/development/python-modules/setuptools-scm/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { packaging setuptools typing-extensions - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; optional-dependencies = { rich = [ rich ]; diff --git a/pkgs/development/python-modules/sfrbox-api/default.nix b/pkgs/development/python-modules/sfrbox-api/default.nix index 03499c0d20a0..dcffe7e23817 100644 --- a/pkgs/development/python-modules/sfrbox-api/default.nix +++ b/pkgs/development/python-modules/sfrbox-api/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { pytest-asyncio pytestCheckHook respx - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "sfrbox_api" ]; diff --git a/pkgs/development/python-modules/sh/default.nix b/pkgs/development/python-modules/sh/default.nix index e507aa2dc5d5..d128101ca334 100644 --- a/pkgs/development/python-modules/sh/default.nix +++ b/pkgs/development/python-modules/sh/default.nix @@ -30,25 +30,24 @@ buildPythonPackage rec { export HOME=$(mktemp -d) ''; - disabledTests = - [ - # Disable tests that fail on Hydra - "test_no_fd_leak" - "test_piped_exception1" - "test_piped_exception2" - "test_unicode_path" - # fails to import itself after modifying the environment - "test_environment" - # timing sensitive through usage of sleep(1) and signal handling - # https://github.com/amoffat/sh/issues/684 - "test_general_signal" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Disable tests that fail on Darwin sandbox - "test_background_exception" - "test_cwd" - "test_ok_code" - ]; + disabledTests = [ + # Disable tests that fail on Hydra + "test_no_fd_leak" + "test_piped_exception1" + "test_piped_exception2" + "test_unicode_path" + # fails to import itself after modifying the environment + "test_environment" + # timing sensitive through usage of sleep(1) and signal handling + # https://github.com/amoffat/sh/issues/684 + "test_general_signal" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Disable tests that fail on Darwin sandbox + "test_background_exception" + "test_cwd" + "test_ok_code" + ]; meta = with lib; { description = "Python subprocess interface"; diff --git a/pkgs/development/python-modules/shiboken2/default.nix b/pkgs/development/python-modules/shiboken2/default.nix index dfbbae93d6b9..bfe0d2f8d4e2 100644 --- a/pkgs/development/python-modules/shiboken2/default.nix +++ b/pkgs/development/python-modules/shiboken2/default.nix @@ -31,18 +31,17 @@ stdenv.mkDerivation { qt5.qmake ]; - buildInputs = - [ - llvmPackages_15.libclang - python.pkgs.setuptools - qt5.qtbase - qt5.qtxmlpatterns - ] - ++ (lib.optionals (python.pythonOlder "3.9") [ - # see similar issue: 202262 - # libxcrypt is required for crypt.h for building older python modules - libxcrypt - ]); + buildInputs = [ + llvmPackages_15.libclang + python.pkgs.setuptools + qt5.qtbase + qt5.qtxmlpatterns + ] + ++ (lib.optionals (python.pythonOlder "3.9") [ + # see similar issue: 202262 + # libxcrypt is required for crypt.h for building older python modules + libxcrypt + ]); cmakeFlags = [ "-DBUILD_TESTS=OFF" ]; diff --git a/pkgs/development/python-modules/shiboken6/default.nix b/pkgs/development/python-modules/shiboken6/default.nix index 6aeafa2d10bd..decc00bf12fa 100644 --- a/pkgs/development/python-modules/shiboken6/default.nix +++ b/pkgs/development/python-modules/shiboken6/default.nix @@ -27,20 +27,20 @@ stdenv'.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake (python.pythonOnBuildForHost.withPackages (ps: [ ps.setuptools ])) - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = - [ - llvmPackages.llvm - llvmPackages.libclang - python.pkgs.qt6.qtbase - python.pkgs.ninja - python.pkgs.packaging - python.pkgs.setuptools - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - python.pkgs.qt6.darwinVersionInputs - ]; + buildInputs = [ + llvmPackages.llvm + llvmPackages.libclang + python.pkgs.qt6.qtbase + python.pkgs.ninja + python.pkgs.packaging + python.pkgs.setuptools + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + python.pkgs.qt6.darwinVersionInputs + ]; cmakeFlags = [ "-DBUILD_TESTS=OFF" ]; diff --git a/pkgs/development/python-modules/shiny/default.nix b/pkgs/development/python-modules/shiny/default.nix index 474666efcbd0..e8624fe25831 100644 --- a/pkgs/development/python-modules/shiny/default.nix +++ b/pkgs/development/python-modules/shiny/default.nix @@ -107,7 +107,8 @@ buildPythonPackage rec { pytest-timeout pytest-xdist pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; diff --git a/pkgs/development/python-modules/signedjson/default.nix b/pkgs/development/python-modules/signedjson/default.nix index a03238cf2e00..36480011c569 100644 --- a/pkgs/development/python-modules/signedjson/default.nix +++ b/pkgs/development/python-modules/signedjson/default.nix @@ -26,16 +26,15 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = - [ - canonicaljson - unpaddedbase64 - pynacl - ] - ++ lib.optionals (pythonOlder "3.8") [ - importlib-metadata - typing-extensions - ]; + propagatedBuildInputs = [ + canonicaljson + unpaddedbase64 + pynacl + ] + ++ lib.optionals (pythonOlder "3.8") [ + importlib-metadata + typing-extensions + ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/simpful/default.nix b/pkgs/development/python-modules/simpful/default.nix index fd5f5b4a652d..83851f0ec788 100644 --- a/pkgs/development/python-modules/simpful/default.nix +++ b/pkgs/development/python-modules/simpful/default.nix @@ -44,7 +44,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "simpful" ]; diff --git a/pkgs/development/python-modules/simplekv/default.nix b/pkgs/development/python-modules/simplekv/default.nix index b47cef41fc9c..d401ea2ca7b7 100644 --- a/pkgs/development/python-modules/simplekv/default.nix +++ b/pkgs/development/python-modules/simplekv/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { mock pytestCheckHook six - ] ++ optional-dependencies.git; + ] + ++ optional-dependencies.git; pythonImportsCheck = [ "simplekv" ]; diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix index c48197525a58..067560caee50 100644 --- a/pkgs/development/python-modules/sip/default.nix +++ b/pkgs/development/python-modules/sip/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { dependencies = [ packaging setuptools - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; # There aren't tests doCheck = false; diff --git a/pkgs/development/python-modules/skein/default.nix b/pkgs/development/python-modules/skein/default.nix index 42ead31640cf..fc705bfef2a6 100644 --- a/pkgs/development/python-modules/skein/default.nix +++ b/pkgs/development/python-modules/skein/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { cryptography grpcio pyyaml - ] ++ lib.optionals (!pythonOlder "3.12") [ setuptools ]; + ] + ++ lib.optionals (!pythonOlder "3.12") [ setuptools ]; buildInputs = [ grpcio-tools ]; preBuild = '' @@ -42,17 +43,16 @@ buildPythonPackage rec { ln -s ${skeinJar} skein/java/skein.jar ''; - postPatch = - '' - substituteInPlace skein/core.py --replace "'yarn'" "'${hadoop}/bin/yarn'" \ - --replace "else 'java'" "else '${hadoop.jdk}/bin/java'" - # Remove vendorized versioneer - rm versioneer.py - '' - + lib.optionalString (!pythonOlder "3.12") '' - substituteInPlace skein/utils.py \ - --replace-fail "distutils" "setuptools._distutils" - ''; + postPatch = '' + substituteInPlace skein/core.py --replace "'yarn'" "'${hadoop}/bin/yarn'" \ + --replace "else 'java'" "else '${hadoop.jdk}/bin/java'" + # Remove vendorized versioneer + rm versioneer.py + '' + + lib.optionalString (!pythonOlder "3.12") '' + substituteInPlace skein/utils.py \ + --replace-fail "distutils" "setuptools._distutils" + ''; build-system = [ versioneer ]; diff --git a/pkgs/development/python-modules/skia-pathops/default.nix b/pkgs/development/python-modules/skia-pathops/default.nix index f04f62056a83..d90da9fde156 100644 --- a/pkgs/development/python-modules/skia-pathops/default.nix +++ b/pkgs/development/python-modules/skia-pathops/default.nix @@ -26,31 +26,30 @@ buildPythonPackage rec { hash = "sha256-niUs3rbE0WLoKYbTHb2JxnXRZ3y4AZwuE+YpXUpVcmk="; }; - postPatch = - '' - substituteInPlace setup.py \ - --replace "build_cmd = [sys.executable, build_skia_py, build_dir]" \ - 'build_cmd = [sys.executable, build_skia_py, "--no-fetch-gn", "--no-virtualenv", "--gn-path", "${gn}/bin/gn", build_dir]' - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' - substituteInPlace src/cpp/skia-builder/skia/gn/skia/BUILD.gn \ - --replace "-march=armv7-a" "-march=armv8-a" \ - --replace "-mfpu=neon" "" \ - --replace "-mthumb" "" - substituteInPlace src/cpp/skia-builder/skia/src/core/SkOpts.cpp \ - --replace "defined(SK_CPU_ARM64)" "0" - '' - + - lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) # old compiler? - '' - patch -p1 <(SIZE_MAX / sizeof(T), (size_t)INT_MAX)); - EOF - ''; + postPatch = '' + substituteInPlace setup.py \ + --replace "build_cmd = [sys.executable, build_skia_py, build_dir]" \ + 'build_cmd = [sys.executable, build_skia_py, "--no-fetch-gn", "--no-virtualenv", "--gn-path", "${gn}/bin/gn", build_dir]' + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) '' + substituteInPlace src/cpp/skia-builder/skia/gn/skia/BUILD.gn \ + --replace "-march=armv7-a" "-march=armv8-a" \ + --replace "-mfpu=neon" "" \ + --replace "-mthumb" "" + substituteInPlace src/cpp/skia-builder/skia/src/core/SkOpts.cpp \ + --replace "defined(SK_CPU_ARM64)" "0" + '' + + + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) # old compiler? + '' + patch -p1 <(SIZE_MAX / sizeof(T), (size_t)INT_MAX)); + EOF + ''; build-system = [ cython @@ -58,14 +57,13 @@ buildPythonPackage rec { setuptools-scm ]; - nativeBuildInputs = - [ - ninja - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools.libtool - xcodebuild - ]; + nativeBuildInputs = [ + ninja + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools.libtool + xcodebuild + ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/skops/default.nix b/pkgs/development/python-modules/skops/default.nix index 6118c92dcb2a..2f911749e5f4 100644 --- a/pkgs/development/python-modules/skops/default.nix +++ b/pkgs/development/python-modules/skops/default.nix @@ -47,18 +47,17 @@ buildPythonPackage rec { # flaky "test_base_case_works_as_expected" ]; - disabledTestPaths = - [ - # try to download data from Huggingface Hub: - "skops/hub_utils/tests" - "skops/card/tests" - # minor output formatting issue - "skops/card/_model_card.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Segfaults on darwin - "skops/io/tests/test_persist.py" - ]; + disabledTestPaths = [ + # try to download data from Huggingface Hub: + "skops/hub_utils/tests" + "skops/card/tests" + # minor output formatting issue + "skops/card/_model_card.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Segfaults on darwin + "skops/io/tests/test_persist.py" + ]; pytestFlags = [ # Warning from scipy.optimize in skops/io/tests/test_persist.py::test_dump_and_load_with_file_wrapper # https://github.com/skops-dev/skops/issues/479 diff --git a/pkgs/development/python-modules/skytemple-files/default.nix b/pkgs/development/python-modules/skytemple-files/default.nix index b577c8f0a00d..d5cd9575054b 100644 --- a/pkgs/development/python-modules/skytemple-files/default.nix +++ b/pkgs/development/python-modules/skytemple-files/default.nix @@ -69,14 +69,16 @@ buildPythonPackage rec { gql graphql-core lru-dict - ] ++ gql.optional-dependencies.aiohttp; + ] + ++ gql.optional-dependencies.aiohttp; }; nativeCheckInputs = [ pytestCheckHook parameterized xmldiff - ] ++ optional-dependencies.spritecollab; + ] + ++ optional-dependencies.spritecollab; preCheck = "pushd test"; postCheck = "popd"; diff --git a/pkgs/development/python-modules/skytemple-ssb-debugger/default.nix b/pkgs/development/python-modules/skytemple-ssb-debugger/default.nix index c45ad865403d..dea49fe17c3b 100644 --- a/pkgs/development/python-modules/skytemple-ssb-debugger/default.nix +++ b/pkgs/development/python-modules/skytemple-ssb-debugger/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { skytemple-files skytemple-icons skytemple-ssb-emulator - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; doCheck = false; # requires Pokémon Mystery Dungeon ROM pythonImportsCheck = [ "skytemple_ssb_debugger" ]; diff --git a/pkgs/development/python-modules/slack-bolt/default.nix b/pkgs/development/python-modules/slack-bolt/default.nix index 0fd22c66f47b..34b47d9bd157 100644 --- a/pkgs/development/python-modules/slack-bolt/default.nix +++ b/pkgs/development/python-modules/slack-bolt/default.nix @@ -91,7 +91,8 @@ buildPythonPackage rec { docker pytest-asyncio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export HOME="$(mktemp -d)" diff --git a/pkgs/development/python-modules/slack-sdk/default.nix b/pkgs/development/python-modules/slack-sdk/default.nix index 143314a61700..e5c122f9eb2b 100644 --- a/pkgs/development/python-modules/slack-sdk/default.nix +++ b/pkgs/development/python-modules/slack-sdk/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { moto pytest-asyncio pytestCheckHook - ] ++ optional-dependencies.optional; + ] + ++ optional-dependencies.optional; disabledTests = [ # Requires internet access (to slack API) diff --git a/pkgs/development/python-modules/slowapi/default.nix b/pkgs/development/python-modules/slowapi/default.nix index 10b1800b24ae..50211d2f998c 100644 --- a/pkgs/development/python-modules/slowapi/default.nix +++ b/pkgs/development/python-modules/slowapi/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { # AssertionError: assert '1740326049.9886339' == '1740326049' "test_headers_no_breach" "test_headers_breach" - ] ++ lib.optionals (pythonAtLeast "3.10") [ "test_multiple_decorators" ]; + ] + ++ lib.optionals (pythonAtLeast "3.10") [ "test_multiple_decorators" ]; pythonImportsCheck = [ "slowapi" ]; diff --git a/pkgs/development/python-modules/smart-open/default.nix b/pkgs/development/python-modules/smart-open/default.nix index 45632ab37969..ff80c5d8eec1 100644 --- a/pkgs/development/python-modules/smart-open/default.nix +++ b/pkgs/development/python-modules/smart-open/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { moto pytestCheckHook responses - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); enabledTestPaths = [ "smart_open" ]; diff --git a/pkgs/development/python-modules/smolagents/default.nix b/pkgs/development/python-modules/smolagents/default.nix index 2ee92a75222d..8c56d08a6403 100644 --- a/pkgs/development/python-modules/smolagents/default.nix +++ b/pkgs/development/python-modules/smolagents/default.nix @@ -112,7 +112,8 @@ buildPythonPackage rec { transformers = [ accelerate transformers - ] ++ self.torch; + ] + ++ self.torch; # vision = [ # helium # selenium @@ -128,42 +129,42 @@ buildPythonPackage rec { pytest-datadir pytestCheckHook wikipedia-api - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "smolagents" ]; - disabledTests = - [ - # Missing dependencies - "test_ddgs_with_kwargs" - "test_e2b_executor_instantiation" - "test_flatten_messages_as_text_for_all_models" - "mcp" - "test_import_smolagents_without_extras" - "test_vision_web_browser_main" - "test_multiple_servers" - # Tests require network access - "test_agent_type_output" - "test_call_different_providers_without_key" - "test_can_import_sklearn_if_explicitly_authorized" - "test_transformers_message_no_tool" - "test_transformers_message_vl_no_tool" - "test_transformers_toolcalling_agent" - "test_visit_webpage" - "test_wikipedia_search" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Missing dependencies - "test_get_mlx" + disabledTests = [ + # Missing dependencies + "test_ddgs_with_kwargs" + "test_e2b_executor_instantiation" + "test_flatten_messages_as_text_for_all_models" + "mcp" + "test_import_smolagents_without_extras" + "test_vision_web_browser_main" + "test_multiple_servers" + # Tests require network access + "test_agent_type_output" + "test_call_different_providers_without_key" + "test_can_import_sklearn_if_explicitly_authorized" + "test_transformers_message_no_tool" + "test_transformers_message_vl_no_tool" + "test_transformers_toolcalling_agent" + "test_visit_webpage" + "test_wikipedia_search" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Missing dependencies + "test_get_mlx" - # Fatal Python error: Aborted - # thread '' panicked, Attempted to create a NULL object. - # duckduckgo_search/duckduckgo_search.py", line 83 in __init__ - "TestDuckDuckGoSearchTool" - "test_init_agent_with_different_toolsets" - "test_multiagents_save" - "test_new_instance" - ]; + # Fatal Python error: Aborted + # thread '' panicked, Attempted to create a NULL object. + # duckduckgo_search/duckduckgo_search.py", line 83 in __init__ + "TestDuckDuckGoSearchTool" + "test_init_agent_with_different_toolsets" + "test_multiagents_save" + "test_new_instance" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/snitun/default.nix b/pkgs/development/python-modules/snitun/default.nix index d451e38ee8bd..3f95f9cd081b 100644 --- a/pkgs/development/python-modules/snitun/default.nix +++ b/pkgs/development/python-modules/snitun/default.nix @@ -42,37 +42,36 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # AssertionError: Expected 'fileno' to not have been called. Called 1 times. - "test_client_stop_no_wait" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "test_multiplexer_data_channel_abort_full" # https://github.com/NabuCasa/snitun/issues/61 - # port binding conflicts - "test_snitun_single_runner_timeout" - "test_snitun_single_runner_throttling" - # ConnectionResetError: [Errno 54] Connection reset by peer - "test_peer_listener_timeout" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # blocking - "test_flow_client_peer" - "test_close_client_peer" - "test_init_connector" - "test_flow_connector" - "test_close_connector_remote" - "test_init_connector_whitelist" - "test_init_multiplexer_server" - "test_init_multiplexer_client" - "test_init_multiplexer_server_throttling" - "test_init_multiplexer_client_throttling" - "test_multiplexer_ping" - "test_multiplexer_ping_error" - "test_multiplexer_init_channel_full" - "test_multiplexer_close_channel_full" - "test_init_dual_peer_with_multiplexer" - ]; + disabledTests = [ + # AssertionError: Expected 'fileno' to not have been called. Called 1 times. + "test_client_stop_no_wait" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "test_multiplexer_data_channel_abort_full" # https://github.com/NabuCasa/snitun/issues/61 + # port binding conflicts + "test_snitun_single_runner_timeout" + "test_snitun_single_runner_throttling" + # ConnectionResetError: [Errno 54] Connection reset by peer + "test_peer_listener_timeout" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # blocking + "test_flow_client_peer" + "test_close_client_peer" + "test_init_connector" + "test_flow_connector" + "test_close_connector_remote" + "test_init_connector_whitelist" + "test_init_multiplexer_server" + "test_init_multiplexer_client" + "test_init_multiplexer_server_throttling" + "test_init_multiplexer_client_throttling" + "test_multiplexer_ping" + "test_multiplexer_ping_error" + "test_multiplexer_init_channel_full" + "test_multiplexer_close_channel_full" + "test_init_dual_peer_with_multiplexer" + ]; pythonImportsCheck = [ "snitun" ]; diff --git a/pkgs/development/python-modules/snorkel/default.nix b/pkgs/development/python-modules/snorkel/default.nix index 51c71152bfd8..5a78118c90f8 100644 --- a/pkgs/development/python-modules/snorkel/default.nix +++ b/pkgs/development/python-modules/snorkel/default.nix @@ -58,7 +58,8 @@ buildPythonPackage { dill dask spacy-models.en_core_web_sm - ] ++ dask.optional-dependencies.distributed; + ] + ++ dask.optional-dependencies.distributed; meta = with lib; { description = "System for quickly generating training data with weak supervision"; diff --git a/pkgs/development/python-modules/snscrape/default.nix b/pkgs/development/python-modules/snscrape/default.nix index 4af0d060b735..cb16c0ace1f6 100644 --- a/pkgs/development/python-modules/snscrape/default.nix +++ b/pkgs/development/python-modules/snscrape/default.nix @@ -37,15 +37,14 @@ buildPythonPackage rec { build-system = [ setuptools-scm ]; - dependencies = - [ - beautifulsoup4 - filelock - lxml - requests - ] - ++ requests.optional-dependencies.socks - ++ lib.optionals (pythonOlder "3.9") [ pytz ]; + dependencies = [ + beautifulsoup4 + filelock + lxml + requests + ] + ++ requests.optional-dependencies.socks + ++ lib.optionals (pythonOlder "3.9") [ pytz ]; # There are no tests; make sure the executable works. checkPhase = '' diff --git a/pkgs/development/python-modules/social-auth-core/default.nix b/pkgs/development/python-modules/social-auth-core/default.nix index 1a25c1e82bfc..860b3981b408 100644 --- a/pkgs/development/python-modules/social-auth-core/default.nix +++ b/pkgs/development/python-modules/social-auth-core/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook httpretty - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # Disable checking the code coverage prePatch = '' diff --git a/pkgs/development/python-modules/soxr/default.nix b/pkgs/development/python-modules/soxr/default.nix index dfd38d2a22eb..3470810e5b7e 100644 --- a/pkgs/development/python-modules/soxr/default.nix +++ b/pkgs/development/python-modules/soxr/default.nix @@ -50,16 +50,15 @@ buildPythonPackage rec { "--config=cmake.define.USE_SYSTEM_LIBSOXR=ON" ]; - build-system = - [ - scikit-build-core - nanobind - setuptools - setuptools-scm - ] - ++ lib.optionals (pythonOlder "3.11") [ - typing-extensions - ]; + build-system = [ + scikit-build-core + nanobind + setuptools + setuptools-scm + ] + ++ lib.optionals (pythonOlder "3.11") [ + typing-extensions + ]; buildInputs = [ libsoxr ]; diff --git a/pkgs/development/python-modules/spacy/models.nix b/pkgs/development/python-modules/spacy/models.nix index b1d5ec36a10c..4e9f5062fc05 100644 --- a/pkgs/development/python-modules/spacy/models.nix +++ b/pkgs/development/python-modules/spacy/models.nix @@ -44,21 +44,22 @@ let inherit sha256; }; - propagatedBuildInputs = - [ spacy ] - ++ lib.optionals (lib.hasSuffix "_trf" pname) [ spacy-curated-transformers ] - ++ lib.optionals requires-transformers [ transformers ] - ++ lib.optionals (lang == "ja") [ - sudachidict-core - sudachipy - ] - ++ lib.optionals (lang == "ru") [ pymorphy3 ] - ++ lib.optionals (lang == "uk") [ - pymorphy3 - pymorphy3-dicts-uk - ] - ++ lib.optionals (lang == "zh") [ spacy-pkuseg ] - ++ lib.optionals requires-sentencepiece [ sentencepiece ]; + propagatedBuildInputs = [ + spacy + ] + ++ lib.optionals (lib.hasSuffix "_trf" pname) [ spacy-curated-transformers ] + ++ lib.optionals requires-transformers [ transformers ] + ++ lib.optionals (lang == "ja") [ + sudachidict-core + sudachipy + ] + ++ lib.optionals (lang == "ru") [ pymorphy3 ] + ++ lib.optionals (lang == "uk") [ + pymorphy3 + pymorphy3-dicts-uk + ] + ++ lib.optionals (lang == "zh") [ spacy-pkuseg ] + ++ lib.optionals requires-sentencepiece [ sentencepiece ]; postPatch = lib.optionalString requires-protobuf '' diff --git a/pkgs/development/python-modules/spectral-cube/default.nix b/pkgs/development/python-modules/spectral-cube/default.nix index 0005433a36ef..ae8b62ce0858 100644 --- a/pkgs/development/python-modules/spectral-cube/default.nix +++ b/pkgs/development/python-modules/spectral-cube/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { packaging radio-beam tqdm - ] ++ dask.optional-dependencies.array; + ] + ++ dask.optional-dependencies.array; nativeCheckInputs = [ aplpy @@ -65,102 +66,101 @@ buildPythonPackage rec { "-Wignore::FutureWarning" ]; - disabledTests = - [ - # AttributeError: 'DaskSpectralCube' object has no attribute 'dtype' - "test_key_access_valid" + disabledTests = [ + # AttributeError: 'DaskSpectralCube' object has no attribute 'dtype' + "test_key_access_valid" - # For some reason, those tests are failing with "FutureWarning: Can't acquire a memory view of a Dask array." - # without being caught by the `-W ignore::FutureWarning` flag above. - "test_1d_slice_reductions" - "test_1d_slice_round" - "test_1d_slices" - "test_1dcomparison_mask_1d_index" - "test_1dmask_indexing" - "test_2dcomparison_mask_1d_index" - "test_3d_beams_roundtrip" - "test_4d_beams_roundtrip" - "test_LDO_arithmetic" - "test_add" - "test_apply_everywhere" - "test_apply_everywhere_plusminus" - "test_apply_function_parallel_shape" - "test_attributes" - "test_basic_arrayness" - "test_basic_unit_conversion" - "test_basic_unit_conversion_beams" - "test_beam_jpix_checks_array" - "test_beam_jtok" - "test_beam_jtok_2D" - "test_beam_jtok_array" - "test_beam_proj_meta" - "test_beams_convolution" - "test_beams_convolution_equal" - "test_casa_read_basic" - "test_convolution" - "test_convolve_to_equal" - "test_convolve_to_jybeam_multibeams" - "test_convolve_to_jybeam_onebeam" - "test_convolve_to_with_bad_beams" - "test_cube_add" - "test_cube_stacking" - "test_cube_with_swapped_axes" - "test_div" - "test_filled" - "test_getitem" - "test_getitem_vrsc" - "test_how_withfluxunit" - "test_initialization_from_units" - "test_mask_none" - "test_mosaic_cube" - "test_mul" - "test_mul_cubes" - "test_multibeams_unit_conversions_general_1D" - "test_numpy_ma_tools" - "test_oned_slic" - "test_oned_slice_beams" - "test_padding_direction" - "test_pow" - "test_preserves_header_meta_values" - "test_proj_meta" - "test_regression_719" - "test_repr_1d" - "test_slice_wcs" - "test_slicing" - "test_spatial_smooth_g2d" - "test_spatial_smooth_maxfilter" - "test_spatial_smooth_median" - "test_spatial_smooth_t2d" - "test_spatial_world" - "test_spectral_interpolate" - "test_spectral_interpolate_reversed" - "test_spectral_interpolate_varying_chunksize" - "test_spectral_interpolate_with_fillvalue" - "test_spectral_interpolate_with_mask" - "test_spectral_slice_preserve_units" - "test_spectral_smooth" - "test_spectral_units" - "test_stacking" - "test_stacking_badvels" - "test_stacking_noisy" - "test_stacking_reversed_specaxis" - "test_stacking_woffset" - "test_stacking_wpadding" - "test_subtract" - "test_subtract_cubes" - "test_unit_conversions_general" - "test_unit_conversions_general_1D" - "test_unit_conversions_general_2D" - "test_varyres_mask" - "test_varyres_spectra" - "test_varyres_unitconversion_roundtrip" - "test_with_flux_unit" - "test_with_spectral_unit" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Flaky: AssertionError: assert diffvals.max()*u.B <= 1*u.MB - "test_reproject_3D_memory" - ]; + # For some reason, those tests are failing with "FutureWarning: Can't acquire a memory view of a Dask array." + # without being caught by the `-W ignore::FutureWarning` flag above. + "test_1d_slice_reductions" + "test_1d_slice_round" + "test_1d_slices" + "test_1dcomparison_mask_1d_index" + "test_1dmask_indexing" + "test_2dcomparison_mask_1d_index" + "test_3d_beams_roundtrip" + "test_4d_beams_roundtrip" + "test_LDO_arithmetic" + "test_add" + "test_apply_everywhere" + "test_apply_everywhere_plusminus" + "test_apply_function_parallel_shape" + "test_attributes" + "test_basic_arrayness" + "test_basic_unit_conversion" + "test_basic_unit_conversion_beams" + "test_beam_jpix_checks_array" + "test_beam_jtok" + "test_beam_jtok_2D" + "test_beam_jtok_array" + "test_beam_proj_meta" + "test_beams_convolution" + "test_beams_convolution_equal" + "test_casa_read_basic" + "test_convolution" + "test_convolve_to_equal" + "test_convolve_to_jybeam_multibeams" + "test_convolve_to_jybeam_onebeam" + "test_convolve_to_with_bad_beams" + "test_cube_add" + "test_cube_stacking" + "test_cube_with_swapped_axes" + "test_div" + "test_filled" + "test_getitem" + "test_getitem_vrsc" + "test_how_withfluxunit" + "test_initialization_from_units" + "test_mask_none" + "test_mosaic_cube" + "test_mul" + "test_mul_cubes" + "test_multibeams_unit_conversions_general_1D" + "test_numpy_ma_tools" + "test_oned_slic" + "test_oned_slice_beams" + "test_padding_direction" + "test_pow" + "test_preserves_header_meta_values" + "test_proj_meta" + "test_regression_719" + "test_repr_1d" + "test_slice_wcs" + "test_slicing" + "test_spatial_smooth_g2d" + "test_spatial_smooth_maxfilter" + "test_spatial_smooth_median" + "test_spatial_smooth_t2d" + "test_spatial_world" + "test_spectral_interpolate" + "test_spectral_interpolate_reversed" + "test_spectral_interpolate_varying_chunksize" + "test_spectral_interpolate_with_fillvalue" + "test_spectral_interpolate_with_mask" + "test_spectral_slice_preserve_units" + "test_spectral_smooth" + "test_spectral_units" + "test_stacking" + "test_stacking_badvels" + "test_stacking_noisy" + "test_stacking_reversed_specaxis" + "test_stacking_woffset" + "test_stacking_wpadding" + "test_subtract" + "test_subtract_cubes" + "test_unit_conversions_general" + "test_unit_conversions_general_1D" + "test_unit_conversions_general_2D" + "test_varyres_mask" + "test_varyres_spectra" + "test_varyres_unitconversion_roundtrip" + "test_with_flux_unit" + "test_with_spectral_unit" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Flaky: AssertionError: assert diffvals.max()*u.B <= 1*u.MB + "test_reproject_3D_memory" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # On x86_darwin, this test fails with "Fatal Python error: Aborted" diff --git a/pkgs/development/python-modules/speechrecognition/default.nix b/pkgs/development/python-modules/speechrecognition/default.nix index a7169ac61d1b..4140e605a32b 100644 --- a/pkgs/development/python-modules/speechrecognition/default.nix +++ b/pkgs/development/python-modules/speechrecognition/default.nix @@ -77,7 +77,8 @@ buildPythonPackage rec { pytestCheckHook pocketsphinx respx - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "speech_recognition" ]; diff --git a/pkgs/development/python-modules/spglib/default.nix b/pkgs/development/python-modules/spglib/default.nix index bcd6e8fa02e7..da684cda3b97 100644 --- a/pkgs/development/python-modules/spglib/default.nix +++ b/pkgs/development/python-modules/spglib/default.nix @@ -41,13 +41,12 @@ buildPythonPackage rec { dontUseCmakeConfigure = true; - dependencies = - [ - numpy - ] - ++ lib.optionals (pythonOlder "3.13") [ - typing-extensions - ]; + dependencies = [ + numpy + ] + ++ lib.optionals (pythonOlder "3.13") [ + typing-extensions + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/sphinx-autoapi/default.nix b/pkgs/development/python-modules/sphinx-autoapi/default.nix index 5baa2f0cd3a2..a2b0e5afb539 100644 --- a/pkgs/development/python-modules/sphinx-autoapi/default.nix +++ b/pkgs/development/python-modules/sphinx-autoapi/default.nix @@ -35,16 +35,15 @@ buildPythonPackage rec { build-system = [ flit-core ]; - dependencies = - [ - astroid - jinja2 - pyyaml - sphinx - ] - ++ lib.optionals (pythonOlder "3.10") [ - stdlib-list - ]; + dependencies = [ + astroid + jinja2 + pyyaml + sphinx + ] + ++ lib.optionals (pythonOlder "3.10") [ + stdlib-list + ]; nativeCheckInputs = [ beautifulsoup4 diff --git a/pkgs/development/python-modules/sphinx-autodoc2/default.nix b/pkgs/development/python-modules/sphinx-autodoc2/default.nix index 8b8c8a71e6a0..d50c265dab7c 100644 --- a/pkgs/development/python-modules/sphinx-autodoc2/default.nix +++ b/pkgs/development/python-modules/sphinx-autodoc2/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { # cli deps typer - ] ++ typer.optional-dependencies.standard; + ] + ++ typer.optional-dependencies.standard; preCheck = '' # make sphinx_path an alias of pathlib.Path, since sphinx_path was removed in Sphinx v7.2.0 diff --git a/pkgs/development/python-modules/sphinx/default.nix b/pkgs/development/python-modules/sphinx/default.nix index 72e199987a19..7fe28c9d5eca 100644 --- a/pkgs/development/python-modules/sphinx/default.nix +++ b/pkgs/development/python-modules/sphinx/default.nix @@ -65,29 +65,28 @@ buildPythonPackage rec { build-system = [ flit-core ]; - dependencies = - [ - alabaster - babel - docutils - imagesize - jinja2 - packaging - pygments - requests - roman-numerals-py - snowballstemmer - sphinxcontrib-applehelp - sphinxcontrib-devhelp - sphinxcontrib-htmlhelp - sphinxcontrib-jsmath - sphinxcontrib-qthelp - sphinxcontrib-serializinghtml - # extra[docs] - sphinxcontrib-websupport - ] - ++ lib.optionals (pythonOlder "3.11") [ tomli ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + dependencies = [ + alabaster + babel + docutils + imagesize + jinja2 + packaging + pygments + requests + roman-numerals-py + snowballstemmer + sphinxcontrib-applehelp + sphinxcontrib-devhelp + sphinxcontrib-htmlhelp + sphinxcontrib-jsmath + sphinxcontrib-qthelp + sphinxcontrib-serializinghtml + # extra[docs] + sphinxcontrib-websupport + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; __darwinAllowLocalNetworking = true; @@ -104,54 +103,53 @@ buildPythonPackage rec { export HOME=$TMPDIR ''; - disabledTests = - [ - # requires network access - "test_latex_images" - # racy - "test_defaults" - "test_check_link_response_only" - "test_anchors_ignored_for_url" - "test_autodoc_default_options" - "test_too_many_requests_retry_after_int_delay" - # racy with pytest-xdist - "test_domain_cpp_build_semicolon" - "test_class_alias" - "test_class_alias_having_doccomment" - "test_class_alias_for_imported_object_having_doccomment" - "test_decorators" - # racy with too many threads - # https://github.com/NixOS/nixpkgs/issues/353176 - "test_document_toc_only" - # Assertion error - "test_gettext_literalblock_additional" - # requires cython_0, but fails miserably on 3.11 - "test_cython" - # Could not fetch remote image: http://localhost:7777/sphinx.png - "test_copy_images" - # ModuleNotFoundError: No module named 'fish_licence.halibut' - "test_import_native_module_stubs" - # Racy tex file creation - "test_literalinclude_namedlink_latex" - "test_literalinclude_caption_latex" - ] - ++ lib.optionals (pythonAtLeast "3.12") [ - # https://github.com/sphinx-doc/sphinx/issues/12430 - "test_autodoc_type_aliases" - ] - ++ lib.optionals isPyPy [ - # PyPy has not __builtins__ which get asserted - # https://doc.pypy.org/en/latest/cpython_differences.html#miscellaneous - "test_autosummary_generate_content_for_module" - "test_autosummary_generate_content_for_module_skipped" - # internals are asserted which are sightly different in PyPy - "test_autodoc_inherited_members_None" - "test_automethod_for_builtin" - "test_builtin_function" - "test_isattributedescriptor" - "test_methoddescriptor" - "test_partialfunction" - ]; + disabledTests = [ + # requires network access + "test_latex_images" + # racy + "test_defaults" + "test_check_link_response_only" + "test_anchors_ignored_for_url" + "test_autodoc_default_options" + "test_too_many_requests_retry_after_int_delay" + # racy with pytest-xdist + "test_domain_cpp_build_semicolon" + "test_class_alias" + "test_class_alias_having_doccomment" + "test_class_alias_for_imported_object_having_doccomment" + "test_decorators" + # racy with too many threads + # https://github.com/NixOS/nixpkgs/issues/353176 + "test_document_toc_only" + # Assertion error + "test_gettext_literalblock_additional" + # requires cython_0, but fails miserably on 3.11 + "test_cython" + # Could not fetch remote image: http://localhost:7777/sphinx.png + "test_copy_images" + # ModuleNotFoundError: No module named 'fish_licence.halibut' + "test_import_native_module_stubs" + # Racy tex file creation + "test_literalinclude_namedlink_latex" + "test_literalinclude_caption_latex" + ] + ++ lib.optionals (pythonAtLeast "3.12") [ + # https://github.com/sphinx-doc/sphinx/issues/12430 + "test_autodoc_type_aliases" + ] + ++ lib.optionals isPyPy [ + # PyPy has not __builtins__ which get asserted + # https://doc.pypy.org/en/latest/cpython_differences.html#miscellaneous + "test_autosummary_generate_content_for_module" + "test_autosummary_generate_content_for_module_skipped" + # internals are asserted which are sightly different in PyPy + "test_autodoc_inherited_members_None" + "test_automethod_for_builtin" + "test_builtin_function" + "test_isattributedescriptor" + "test_methoddescriptor" + "test_partialfunction" + ]; passthru.tests = { inherit breathe; diff --git a/pkgs/development/python-modules/sphinxcontrib-bibtex/default.nix b/pkgs/development/python-modules/sphinxcontrib-bibtex/default.nix index 3e1f64080743..9a081b422404 100644 --- a/pkgs/development/python-modules/sphinxcontrib-bibtex/default.nix +++ b/pkgs/development/python-modules/sphinxcontrib-bibtex/default.nix @@ -30,17 +30,16 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - docutils - oset - pybtex - pybtex-docutils - sphinx - ] - ++ lib.optionals (pythonOlder "3.10") [ - importlib-metadata - ]; + dependencies = [ + docutils + oset + pybtex + pybtex-docutils + sphinx + ] + ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/sphinxcontrib-spelling/default.nix b/pkgs/development/python-modules/sphinxcontrib-spelling/default.nix index fe9adf17db31..f0cbe1d2c228 100644 --- a/pkgs/development/python-modules/sphinxcontrib-spelling/default.nix +++ b/pkgs/development/python-modules/sphinxcontrib-spelling/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ sphinx pyenchant - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; # No tests included doCheck = false; diff --git a/pkgs/development/python-modules/sphinxext-opengraph/default.nix b/pkgs/development/python-modules/sphinxext-opengraph/default.nix index ab3fea4eb8fa..2f2d76bd9913 100644 --- a/pkgs/development/python-modules/sphinxext-opengraph/default.nix +++ b/pkgs/development/python-modules/sphinxext-opengraph/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook beautifulsoup4 - ] ++ optional-dependencies.social_cards_generation; + ] + ++ optional-dependencies.social_cards_generation; pythonImportsCheck = [ "sphinxext.opengraph" ]; diff --git a/pkgs/development/python-modules/splinter/default.nix b/pkgs/development/python-modules/splinter/default.nix index 8ceac913de9e..b63e1876e002 100644 --- a/pkgs/development/python-modules/splinter/default.nix +++ b/pkgs/development/python-modules/splinter/default.nix @@ -54,7 +54,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); disabledTests = [ # driver is present and fails with a different error during loading diff --git a/pkgs/development/python-modules/spyder/default.nix b/pkgs/development/python-modules/spyder/default.nix index 79d7adddd1bd..355ccfb56a55 100644 --- a/pkgs/development/python-modules/spyder/default.nix +++ b/pkgs/development/python-modules/spyder/default.nix @@ -123,7 +123,8 @@ buildPythonPackage rec { three-merge watchdog yarl - ] ++ python-lsp-server.optional-dependencies.all; + ] + ++ python-lsp-server.optional-dependencies.all; # There is no test for spyder doCheck = false; diff --git a/pkgs/development/python-modules/sqlalchemy-continuum/default.nix b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix index 501486e5059b..0518e68135b3 100644 --- a/pkgs/development/python-modules/sqlalchemy-continuum/default.nix +++ b/pkgs/development/python-modules/sqlalchemy-continuum/default.nix @@ -42,15 +42,14 @@ buildPythonPackage rec { i18n = [ sqlalchemy-i18n ]; }; - nativeCheckInputs = - [ - psycopg2 - pymysql - pytestCheckHook - ] - ++ optional-dependencies.flask - ++ optional-dependencies.flask-login - ++ optional-dependencies.flask-sqlalchemy; + nativeCheckInputs = [ + psycopg2 + pymysql + pytestCheckHook + ] + ++ optional-dependencies.flask + ++ optional-dependencies.flask-login + ++ optional-dependencies.flask-sqlalchemy; disabledTestPaths = [ # requires sqlalchemy-i18n, which is incompatible with sqlalchemy>=2 diff --git a/pkgs/development/python-modules/sqlalchemy-utils/default.nix b/pkgs/development/python-modules/sqlalchemy-utils/default.nix index b1bdd3a7f606..8062a08fea5a 100644 --- a/pkgs/development/python-modules/sqlalchemy-utils/default.nix +++ b/pkgs/development/python-modules/sqlalchemy-utils/default.nix @@ -62,35 +62,33 @@ buildPythonPackage rec { encrypted = [ cryptography ]; }; - nativeCheckInputs = - [ - pytestCheckHook - pygments - jinja2 - docutils - flexmock - psycopg2 - pg8000 - pytz - python-dateutil - pymysql - pyodbc - ] - ++ lib.flatten (builtins.attrValues optional-dependencies) - ++ lib.optionals (pythonOlder "3.12") [ - # requires distutils, which were removed in 3.12 - psycopg2cffi - ]; + nativeCheckInputs = [ + pytestCheckHook + pygments + jinja2 + docutils + flexmock + psycopg2 + pg8000 + pytz + python-dateutil + pymysql + pyodbc + ] + ++ lib.flatten (builtins.attrValues optional-dependencies) + ++ lib.optionals (pythonOlder "3.12") [ + # requires distutils, which were removed in 3.12 + psycopg2cffi + ]; - disabledTests = - [ - "test_create_database_twice" - "test_create_and_drop" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/kvesteri/sqlalchemy-utils/issues/764 - "test_render_mock_ddl" - ]; + disabledTests = [ + "test_create_database_twice" + "test_create_and_drop" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/kvesteri/sqlalchemy-utils/issues/764 + "test_render_mock_ddl" + ]; pytestFlags = [ "-Wignore::DeprecationWarning" diff --git a/pkgs/development/python-modules/sqlalchemy/1_4.nix b/pkgs/development/python-modules/sqlalchemy/1_4.nix index 2384a4f0c056..d46a9bd691ca 100644 --- a/pkgs/development/python-modules/sqlalchemy/1_4.nix +++ b/pkgs/development/python-modules/sqlalchemy/1_4.nix @@ -77,7 +77,8 @@ buildPythonPackage rec { aiosqlite = [ aiosqlite typing-extensions - ] ++ self.asyncio; + ] + ++ self.asyncio; sqlcipher = [ # TODO: sqlcipher3 ]; diff --git a/pkgs/development/python-modules/sqlfmt/default.nix b/pkgs/development/python-modules/sqlfmt/default.nix index 707b5619d9d0..49bfd2a4a202 100644 --- a/pkgs/development/python-modules/sqlfmt/default.nix +++ b/pkgs/development/python-modules/sqlfmt/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); preCheck = '' export HOME=$(mktemp -d) diff --git a/pkgs/development/python-modules/sshfs/default.nix b/pkgs/development/python-modules/sshfs/default.nix index c9724a63a82f..c8b72c32eb32 100644 --- a/pkgs/development/python-modules/sshfs/default.nix +++ b/pkgs/development/python-modules/sshfs/default.nix @@ -54,15 +54,14 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # Test requires network access - "test_config_expansions" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Test fails with sandbox enabled - "test_checksum" - ]; + disabledTests = [ + # Test requires network access + "test_config_expansions" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Test fails with sandbox enabled + "test_checksum" + ]; pythonImportsCheck = [ "sshfs" ]; diff --git a/pkgs/development/python-modules/starlette-admin/default.nix b/pkgs/development/python-modules/starlette-admin/default.nix index ec521732cd67..57a2c5b2f4f4 100644 --- a/pkgs/development/python-modules/starlette-admin/default.nix +++ b/pkgs/development/python-modules/starlette-admin/default.nix @@ -92,22 +92,21 @@ buildPythonPackage rec { "test_api" ]; - disabledTestPaths = - [ - # odmantic is not packaged - "tests/odmantic" - # beanie is not packaged - "tests/beanie" - # needs mongodb running on port 27017 - "tests/mongoengine" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # very flaky, sandbox issues? - # libcloud.storage.types.ContainerDoesNotExistError - # sqlite3.OperationalError: attempt to write a readonly database - "tests/sqla/test_sync_engine.py" - "tests/sqla/test_async_engine.py" - ]; + disabledTestPaths = [ + # odmantic is not packaged + "tests/odmantic" + # beanie is not packaged + "tests/beanie" + # needs mongodb running on port 27017 + "tests/mongoengine" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # very flaky, sandbox issues? + # libcloud.storage.types.ContainerDoesNotExistError + # sqlite3.OperationalError: attempt to write a readonly database + "tests/sqla/test_sync_engine.py" + "tests/sqla/test_async_engine.py" + ]; pythonImportsCheck = [ "starlette_admin" diff --git a/pkgs/development/python-modules/starlette/default.nix b/pkgs/development/python-modules/starlette/default.nix index ad9b7c7d56a1..91ae514304b6 100644 --- a/pkgs/development/python-modules/starlette/default.nix +++ b/pkgs/development/python-modules/starlette/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { pytestCheckHook trio typing-extensions - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlags = [ "-Wignore::DeprecationWarning" diff --git a/pkgs/development/python-modules/static3/default.nix b/pkgs/development/python-modules/static3/default.nix index 13a41618feb3..607acca24a8a 100644 --- a/pkgs/development/python-modules/static3/default.nix +++ b/pkgs/development/python-modules/static3/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook webtest - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); meta = with lib; { changelog = "https://github.com/rmohr/static3/releases/tag/v${version}"; diff --git a/pkgs/development/python-modules/statmake/default.nix b/pkgs/development/python-modules/statmake/default.nix index f63dd9bd64df..ffaa22ef6841 100644 --- a/pkgs/development/python-modules/statmake/default.nix +++ b/pkgs/development/python-modules/statmake/default.nix @@ -31,16 +31,15 @@ buildPythonPackage rec { nativeBuildInputs = [ poetry-core ]; - propagatedBuildInputs = - [ - attrs - cattrs - fonttools - # required by fonttools[ufo] - fs - ] - ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ] - ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + propagatedBuildInputs = [ + attrs + cattrs + fonttools + # required by fonttools[ufo] + fs + ] + ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/stm32loader/default.nix b/pkgs/development/python-modules/stm32loader/default.nix index 42dc18d593f2..9a0e437cb365 100644 --- a/pkgs/development/python-modules/stm32loader/default.nix +++ b/pkgs/development/python-modules/stm32loader/default.nix @@ -50,7 +50,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); enabledTestPaths = [ "tests/unit" ]; diff --git a/pkgs/development/python-modules/strawberry-django/default.nix b/pkgs/development/python-modules/strawberry-django/default.nix index e9c30e69d7c2..5f4dddff4a8e 100644 --- a/pkgs/development/python-modules/strawberry-django/default.nix +++ b/pkgs/development/python-modules/strawberry-django/default.nix @@ -60,25 +60,24 @@ buildPythonPackage rec { enum = [ django-choices-field ]; }; - nativeCheckInputs = - [ - pytestCheckHook + nativeCheckInputs = [ + pytestCheckHook - django-guardian - django-model-utils - django-mptt - django-polymorphic - django-tree-queries - factory-boy - pillow - psycopg2 - pytest-cov-stub - pytest-django - pytest-mock - pytest-snapshot - ] - ++ optional-dependencies.debug-toolbar - ++ optional-dependencies.enum; + django-guardian + django-model-utils + django-mptt + django-polymorphic + django-tree-queries + factory-boy + pillow + psycopg2 + pytest-cov-stub + pytest-django + pytest-mock + pytest-snapshot + ] + ++ optional-dependencies.debug-toolbar + ++ optional-dependencies.enum; pythonImportsCheck = [ "strawberry_django" ]; diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index 8f0ebd59070c..8db811e095b9 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -138,7 +138,8 @@ buildPythonPackage rec { pytest-snapshot pytestCheckHook sanic-testing - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "strawberry" ]; diff --git a/pkgs/development/python-modules/streamlit/default.nix b/pkgs/development/python-modules/streamlit/default.nix index 6f8fa1272adb..ab13f45f278a 100644 --- a/pkgs/development/python-modules/streamlit/default.nix +++ b/pkgs/development/python-modules/streamlit/default.nix @@ -63,7 +63,8 @@ buildPythonPackage rec { gitpython pydeck tornado - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ watchdog ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ watchdog ]; # pypi package does not include the tests, but cannot be built with fetchFromGitHub doCheck = false; diff --git a/pkgs/development/python-modules/sunpy/default.nix b/pkgs/development/python-modules/sunpy/default.nix index 2eea23f6582a..44ef351a37c3 100644 --- a/pkgs/development/python-modules/sunpy/default.nix +++ b/pkgs/development/python-modules/sunpy/default.nix @@ -84,18 +84,17 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = - [ - hypothesis - pytest-astropy - pytest-mock - pytestCheckHook - ] - ++ optional-dependencies.asdf - ++ optional-dependencies.database - ++ optional-dependencies.image - ++ optional-dependencies.net - ++ optional-dependencies.timeseries; + nativeCheckInputs = [ + hypothesis + pytest-astropy + pytest-mock + pytestCheckHook + ] + ++ optional-dependencies.asdf + ++ optional-dependencies.database + ++ optional-dependencies.image + ++ optional-dependencies.net + ++ optional-dependencies.timeseries; postPatch = '' substituteInPlace setup.cfg \ diff --git a/pkgs/development/python-modules/swh-objstorage/default.nix b/pkgs/development/python-modules/swh-objstorage/default.nix index 0239a7e021b2..984267eb9a1e 100644 --- a/pkgs/development/python-modules/swh-objstorage/default.nix +++ b/pkgs/development/python-modules/swh-objstorage/default.nix @@ -101,7 +101,8 @@ buildPythonPackage rec { types-pyyaml types-requests util-linux - ] ++ psycopg.optional-dependencies.pool; + ] + ++ psycopg.optional-dependencies.pool; disabledTests = lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ # FAILED swh/objstorage/tests/test_objstorage_winery.py::test_winery_leaky_bucket_tick - assert 1 == 0 diff --git a/pkgs/development/python-modules/swh-storage/default.nix b/pkgs/development/python-modules/swh-storage/default.nix index 01806be6b4b8..a3eacef9837b 100644 --- a/pkgs/development/python-modules/swh-storage/default.nix +++ b/pkgs/development/python-modules/swh-storage/default.nix @@ -61,7 +61,8 @@ buildPythonPackage rec { swh-core swh-model swh-objstorage - ] ++ psycopg.optional-dependencies.pool; + ] + ++ psycopg.optional-dependencies.pool; pythonImportsCheck = [ "swh.storage" ]; diff --git a/pkgs/development/python-modules/swifter/default.nix b/pkgs/development/python-modules/swifter/default.nix index c31b30be192b..5635f80f66af 100644 --- a/pkgs/development/python-modules/swifter/default.nix +++ b/pkgs/development/python-modules/swifter/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { psutil dask tqdm - ] ++ dask.optional-dependencies.dataframe; + ] + ++ dask.optional-dependencies.dataframe; optional-dependencies = { groupby = [ ray ]; diff --git a/pkgs/development/python-modules/synergy/default.nix b/pkgs/development/python-modules/synergy/default.nix index 2a60f4b23e5c..ddd32baf85f3 100644 --- a/pkgs/development/python-modules/synergy/default.nix +++ b/pkgs/development/python-modules/synergy/default.nix @@ -43,19 +43,18 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # flaky: hypothesis.errors.FailedHealthCheck - "test_asymptotic_limits" - "test_inverse" - # AssertionError: synthetic_BRAID_reference_1.csv - # E3=0 not in (0.10639582639915163, 1.6900177333904622) - "test_BRAID_fit_bootstrap" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # AssertionError: np.False_ is not true - "test_fit_loewe_antagonism" - ]; + disabledTests = [ + # flaky: hypothesis.errors.FailedHealthCheck + "test_asymptotic_limits" + "test_inverse" + # AssertionError: synthetic_BRAID_reference_1.csv + # E3=0 not in (0.10639582639915163, 1.6900177333904622) + "test_BRAID_fit_bootstrap" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # AssertionError: np.False_ is not true + "test_fit_loewe_antagonism" + ]; pythonImportsCheck = [ "synergy" ]; diff --git a/pkgs/development/python-modules/tabulate/default.nix b/pkgs/development/python-modules/tabulate/default.nix index d0c635cc919c..ac3450f87e1e 100644 --- a/pkgs/development/python-modules/tabulate/default.nix +++ b/pkgs/development/python-modules/tabulate/default.nix @@ -32,7 +32,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); meta = { description = "Pretty-print tabular data"; diff --git a/pkgs/development/python-modules/temporalio/default.nix b/pkgs/development/python-modules/temporalio/default.nix index 9e5ea1607fd5..c176b65a1ebe 100644 --- a/pkgs/development/python-modules/temporalio/default.nix +++ b/pkgs/development/python-modules/temporalio/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { protobuf types-protobuf typing-extensions - ] ++ lib.optional (pythonOlder "3.11") python-dateutil; + ] + ++ lib.optional (pythonOlder "3.11") python-dateutil; nativeBuildInputs = [ cargo diff --git a/pkgs/development/python-modules/tensorboardx/default.nix b/pkgs/development/python-modules/tensorboardx/default.nix index f5f658e2accf..866274409db8 100644 --- a/pkgs/development/python-modules/tensorboardx/default.nix +++ b/pkgs/development/python-modules/tensorboardx/default.nix @@ -55,18 +55,17 @@ buildPythonPackage rec { torchvision ]; - disabledTests = - [ - # ImportError: Visdom visualization requires installation of Visdom - "test_TorchVis" - # Requires network access (FileNotFoundError: [Errno 2] No such file or directory: 'wget') - "test_onnx_graph" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fails with a mysterious error in pytorch: - # RuntimeError: required keyword attribute 'name' has the wrong type - "test_pytorch_graph" - ]; + disabledTests = [ + # ImportError: Visdom visualization requires installation of Visdom + "test_TorchVis" + # Requires network access (FileNotFoundError: [Errno 2] No such file or directory: 'wget') + "test_onnx_graph" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fails with a mysterious error in pytorch: + # RuntimeError: required keyword attribute 'name' has the wrong type + "test_pytorch_graph" + ]; disabledTestPaths = [ # we are not interested in linting errors diff --git a/pkgs/development/python-modules/tensordict/default.nix b/pkgs/development/python-modules/tensordict/default.nix index 66cc02861228..317807f2e6fc 100644 --- a/pkgs/development/python-modules/tensordict/default.nix +++ b/pkgs/development/python-modules/tensordict/default.nix @@ -73,36 +73,34 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # FileNotFoundError: [Errno 2] No such file or directory: '/build/source/tensordict/tensorclass.pyi - "test_tensorclass_instance_methods" - "test_tensorclass_stub_methods" + disabledTests = [ + # FileNotFoundError: [Errno 2] No such file or directory: '/build/source/tensordict/tensorclass.pyi + "test_tensorclass_instance_methods" + "test_tensorclass_stub_methods" - # hangs forever on some CPUs - "test_map_iter_interrupt_early" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Hangs due to the use of a pool - "test_chunksize_num_chunks" - "test_index_with_generator" - "test_map_exception" - "test_map" - "test_multiprocessing" - ]; + # hangs forever on some CPUs + "test_map_iter_interrupt_early" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Hangs due to the use of a pool + "test_chunksize_num_chunks" + "test_index_with_generator" + "test_map_exception" + "test_map" + "test_multiprocessing" + ]; - disabledTestPaths = - [ - # torch._dynamo.exc.Unsupported: Graph break due to unsupported builtin None.ReferenceType.__new__. - "test/test_compile.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Hangs forever - "test/test_distributed.py" - # Hangs after testing due to pool usage - "test/test_h5.py" - "test/test_memmap.py" - ]; + disabledTestPaths = [ + # torch._dynamo.exc.Unsupported: Graph break due to unsupported builtin None.ReferenceType.__new__. + "test/test_compile.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Hangs forever + "test/test_distributed.py" + # Hangs after testing due to pool usage + "test/test_h5.py" + "test/test_memmap.py" + ]; meta = { description = "Pytorch dedicated tensor container"; diff --git a/pkgs/development/python-modules/tensorflow-datasets/default.nix b/pkgs/development/python-modules/tensorflow-datasets/default.nix index f150bbd74e32..27a4a29f93fb 100644 --- a/pkgs/development/python-modules/tensorflow-datasets/default.nix +++ b/pkgs/development/python-modules/tensorflow-datasets/default.nix @@ -76,31 +76,30 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - absl-py - array-record - dm-tree - etils - immutabledict - numpy - promise - protobuf - psutil - pyarrow - requests - simple-parsing - tensorflow-metadata - termcolor - toml - tqdm - wrapt - ] - ++ etils.optional-dependencies.epath - ++ etils.optional-dependencies.etree - ++ lib.optionals (pythonOlder "3.9") [ - importlib-resources - ]; + dependencies = [ + absl-py + array-record + dm-tree + etils + immutabledict + numpy + promise + protobuf + psutil + pyarrow + requests + simple-parsing + tensorflow-metadata + termcolor + toml + tqdm + wrapt + ] + ++ etils.optional-dependencies.epath + ++ etils.optional-dependencies.etree + ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources + ]; pythonImportsCheck = [ "tensorflow_datasets" ]; diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index 797c323cab37..aeebf48288ab 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -96,7 +96,8 @@ buildPythonPackage rec { termcolor typing-extensions wrapt - ] ++ lib.optional (!isPy3k) mock; + ] + ++ lib.optional (!isPy3k) mock; preConfigure = '' unset SOURCE_DATE_EPOCH diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index fb954244d334..8d334c5cc8b7 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -303,40 +303,40 @@ let perl protobuf-core protobuf-extra - ] ++ lib.optional cudaSupport addDriverRunpath; + ] + ++ lib.optional cudaSupport addDriverRunpath; - buildInputs = - [ - jemalloc - mpi - glibcLocales - git + buildInputs = [ + jemalloc + mpi + glibcLocales + git - # libs taken from system through the TF_SYS_LIBS mechanism - abseil-cpp - boringssl - curl - double-conversion - flatbuffers-core - giflib - grpc - # Necessary to fix the "`GLIBCXX_3.4.30' not found" error - (icu.override { inherit stdenv; }) - jsoncpp - libjpeg_turbo - libpng - (pybind11.overridePythonAttrs (_: { - inherit stdenv; - })) - snappy-cpp - sqlite - ] - ++ lib.optionals cudaSupport [ - cudatoolkit - cudnnMerged - ] - ++ lib.optionals mklSupport [ mkl ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ nsync ]; + # libs taken from system through the TF_SYS_LIBS mechanism + abseil-cpp + boringssl + curl + double-conversion + flatbuffers-core + giflib + grpc + # Necessary to fix the "`GLIBCXX_3.4.30' not found" error + (icu.override { inherit stdenv; }) + jsoncpp + libjpeg_turbo + libpng + (pybind11.overridePythonAttrs (_: { + inherit stdenv; + })) + snappy-cpp + sqlite + ] + ++ lib.optionals cudaSupport [ + cudatoolkit + cudnnMerged + ] + ++ lib.optionals mklSupport [ mkl ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ nsync ]; # arbitrarily set to the current latest bazel version, overly careful TF_IGNORE_MAX_BAZEL_VERSION = true; @@ -432,20 +432,20 @@ let ./protobuf_python.patch ./pybind11_protobuf_python_runtime_dep.patch ./pybind11_protobuf_newer_version.patch - ] ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [ ./absl_to_std.patch ]; + ] + ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [ ./absl_to_std.patch ]; - postPatch = - '' - # bazel 3.3 should work just as well as bazel 3.1 - rm -f .bazelversion - patchShebangs . - '' - + lib.optionalString (!withTensorboard) '' - # Tensorboard pulls in a bunch of dependencies, some of which may - # include security vulnerabilities. So we make it optional. - # https://github.com/tensorflow/tensorflow/issues/20280#issuecomment-400230560 - sed -i '/tensorboard ~=/d' tensorflow/tools/pip_package/setup.py - ''; + postPatch = '' + # bazel 3.3 should work just as well as bazel 3.1 + rm -f .bazelversion + patchShebangs . + '' + + lib.optionalString (!withTensorboard) '' + # Tensorboard pulls in a bunch of dependencies, some of which may + # include security vulnerabilities. So we make it optional. + # https://github.com/tensorflow/tensorflow/issues/20280#issuecomment-400230560 + sed -i '/tensorboard ~=/d' tensorflow/tools/pip_package/setup.py + ''; # https://github.com/tensorflow/tensorflow/pull/39470 env.NIX_CFLAGS_COMPILE = toString [ "-Wno-stringop-truncation" ]; @@ -483,20 +483,19 @@ let hardeningDisable = [ "format" ]; - bazelBuildFlags = - [ - "--config=opt" # optimize using the flags set in the configure phase - ] - ++ lib.optionals stdenv.cc.isClang [ - "--cxxopt=-x" - "--cxxopt=c++" - "--host_cxxopt=-x" - "--host_cxxopt=c++" + bazelBuildFlags = [ + "--config=opt" # optimize using the flags set in the configure phase + ] + ++ lib.optionals stdenv.cc.isClang [ + "--cxxopt=-x" + "--cxxopt=c++" + "--host_cxxopt=-x" + "--host_cxxopt=c++" - # workaround for https://github.com/bazelbuild/bazel/issues/15359 - "--spawn_strategy=sandboxed" - ] - ++ lib.optionals (mklSupport) [ "--config=mkl" ]; + # workaround for https://github.com/bazelbuild/bazel/issues/15359 + "--spawn_strategy=sandboxed" + ] + ++ lib.optionals (mklSupport) [ "--config=mkl" ]; bazelTargets = [ "//tensorflow/tools/pip_package:build_pip_package //tensorflow/tools/lib_package:libtensorflow" @@ -576,25 +575,24 @@ let requiredSystemFeatures = [ "big-parallel" ]; }; - meta = - { - badPlatforms = lib.optionals cudaSupport lib.platforms.darwin; - changelog = "https://github.com/tensorflow/tensorflow/releases/tag/v${version}"; - description = "Computation using data flow graphs for scalable machine learning"; - homepage = "http://tensorflow.org"; - license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ abbradar ]; - platforms = with lib.platforms; linux ++ darwin; - broken = - stdenv.hostPlatform.isDarwin - || !(xlaSupport -> cudaSupport) - || !(cudaSupport -> builtins.hasAttr cudnnAttribute cudaPackages) - || !(cudaSupport -> cudaPackages ? cudatoolkit); - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - timeout = 86400; # 24 hours - maxSilent = 14400; # 4h, double the default of 7200s - }; + meta = { + badPlatforms = lib.optionals cudaSupport lib.platforms.darwin; + changelog = "https://github.com/tensorflow/tensorflow/releases/tag/v${version}"; + description = "Computation using data flow graphs for scalable machine learning"; + homepage = "http://tensorflow.org"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ abbradar ]; + platforms = with lib.platforms; linux ++ darwin; + broken = + stdenv.hostPlatform.isDarwin + || !(xlaSupport -> cudaSupport) + || !(cudaSupport -> builtins.hasAttr cudnnAttribute cudaPackages) + || !(cudaSupport -> cudaPackages ? cudatoolkit); + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + timeout = 86400; # 24 hours + maxSilent = 14400; # 4h, double the default of 7200s + }; }; in buildPythonPackage { @@ -652,7 +650,8 @@ buildPythonPackage { termcolor typing-extensions wrapt - ] ++ lib.optionals withTensorboard [ tensorboard ]; + ] + ++ lib.optionals withTensorboard [ tensorboard ]; nativeBuildInputs = lib.optionals cudaSupport [ addDriverRunpath ]; diff --git a/pkgs/development/python-modules/term-image/default.nix b/pkgs/development/python-modules/term-image/default.nix index 71d257b77985..04f5070108d4 100644 --- a/pkgs/development/python-modules/term-image/default.nix +++ b/pkgs/development/python-modules/term-image/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ optional-dependencies.urwid; + ] + ++ optional-dependencies.urwid; disabledTestPaths = [ # test_url needs online access diff --git a/pkgs/development/python-modules/textual-fastdatatable/default.nix b/pkgs/development/python-modules/textual-fastdatatable/default.nix index 46213a689308..1e34f7f105ea 100644 --- a/pkgs/development/python-modules/textual-fastdatatable/default.nix +++ b/pkgs/development/python-modules/textual-fastdatatable/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { pytz textual tzdata - ] ++ textual.optional-dependencies.syntax; + ] + ++ textual.optional-dependencies.syntax; optional-dependencies = { polars = [ polars ]; @@ -45,7 +46,8 @@ buildPythonPackage rec { pytest-asyncio pytest-textual-snapshot pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "textual_fastdatatable" ]; diff --git a/pkgs/development/python-modules/textual-textarea/default.nix b/pkgs/development/python-modules/textual-textarea/default.nix index e136dab4f313..c2edc1e9fbd5 100644 --- a/pkgs/development/python-modules/textual-textarea/default.nix +++ b/pkgs/development/python-modules/textual-textarea/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { dependencies = [ pyperclip textual - ] ++ textual.optional-dependencies.syntax; + ] + ++ textual.optional-dependencies.syntax; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/textual/default.nix b/pkgs/development/python-modules/textual/default.nix index 33410f6c2ce8..dab624cd4053 100644 --- a/pkgs/development/python-modules/textual/default.nix +++ b/pkgs/development/python-modules/textual/default.nix @@ -41,20 +41,20 @@ buildPythonPackage rec { build-system = [ poetry-core ]; - dependencies = - [ - markdown-it-py - platformdirs - rich - typing-extensions - ] - ++ markdown-it-py.optional-dependencies.plugins - ++ markdown-it-py.optional-dependencies.linkify; + dependencies = [ + markdown-it-py + platformdirs + rich + typing-extensions + ] + ++ markdown-it-py.optional-dependencies.plugins + ++ markdown-it-py.optional-dependencies.linkify; optional-dependencies = { syntax = [ tree-sitter - ] ++ lib.optionals (!tree-sitter-languages.meta.broken) [ tree-sitter-languages ]; + ] + ++ lib.optionals (!tree-sitter-languages.meta.broken) [ tree-sitter-languages ]; }; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/tf-keras/default.nix b/pkgs/development/python-modules/tf-keras/default.nix index ff99b3cf5966..4643ea82ef4c 100644 --- a/pkgs/development/python-modules/tf-keras/default.nix +++ b/pkgs/development/python-modules/tf-keras/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { dependencies = [ numpy tensorflow - ] ++ lib.optionals (pythonAtLeast "3.12") [ distutils ]; + ] + ++ lib.optionals (pythonAtLeast "3.12") [ distutils ]; pythonImportsCheck = [ "tf_keras" ]; diff --git a/pkgs/development/python-modules/threat9-test-bed/default.nix b/pkgs/development/python-modules/threat9-test-bed/default.nix index ecd5be4d6ff0..2e18963fa7dd 100644 --- a/pkgs/development/python-modules/threat9-test-bed/default.nix +++ b/pkgs/development/python-modules/threat9-test-bed/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { gunicorn pyopenssl requests - ] ++ lib.optionals (pythonAtLeast "3.13") [ standard-telnetlib ]; + ] + ++ lib.optionals (pythonAtLeast "3.13") [ standard-telnetlib ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/tianshou/default.nix b/pkgs/development/python-modules/tianshou/default.nix index 9078317fc055..2336768719cf 100644 --- a/pkgs/development/python-modules/tianshou/default.nix +++ b/pkgs/development/python-modules/tianshou/default.nix @@ -165,20 +165,19 @@ buildPythonPackage rec { "test/offline" ]; - disabledTests = - [ - # AttributeError: 'TimeLimit' object has no attribute 'test_attribute' - "test_attr_unwrapped" - # Failed: DID NOT RAISE - "test_batch" - # Failed: Raised AssertionError - "test_vecenv" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fatal Python error: Aborted - # pettingzoo/classic/tictactoe/tictactoe.py", line 254 in reset - "test_tic_tac_toe" - ]; + disabledTests = [ + # AttributeError: 'TimeLimit' object has no attribute 'test_attribute' + "test_attr_unwrapped" + # Failed: DID NOT RAISE + "test_batch" + # Failed: Raised AssertionError + "test_vecenv" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fatal Python error: Aborted + # pettingzoo/classic/tictactoe/tictactoe.py", line 254 in reset + "test_tic_tac_toe" + ]; meta = { description = "Elegant PyTorch deep reinforcement learning library"; diff --git a/pkgs/development/python-modules/tinygrad/default.nix b/pkgs/development/python-modules/tinygrad/default.nix index c7b75ac452ab..1cbfb24fd643 100644 --- a/pkgs/development/python-modules/tinygrad/default.nix +++ b/pkgs/development/python-modules/tinygrad/default.nix @@ -132,13 +132,12 @@ buildPythonPackage rec { triton = [ triton ]; }; - pythonImportsCheck = - [ - "tinygrad" - ] - ++ lib.optionals cudaSupport [ - "tinygrad.runtime.ops_nv" - ]; + pythonImportsCheck = [ + "tinygrad" + ] + ++ lib.optionals cudaSupport [ + "tinygrad.runtime.ops_nv" + ]; nativeCheckInputs = [ pytestCheckHook @@ -166,63 +165,63 @@ buildPythonPackage rec { tqdm transformers z3-solver - ] ++ networkx.optional-dependencies.extra; + ] + ++ networkx.optional-dependencies.extra; - disabledTests = - [ - # RuntimeError: Attempting to relocate against an undefined symbol 'fmaxf' - "test_backward_sum_acc_dtype" - "test_failure_27" + disabledTests = [ + # RuntimeError: Attempting to relocate against an undefined symbol 'fmaxf' + "test_backward_sum_acc_dtype" + "test_failure_27" - # Flaky: - # AssertionError: 2.1376906810000946 not less than 2.0 - "test_recursive_pad" + # Flaky: + # AssertionError: 2.1376906810000946 not less than 2.0 + "test_recursive_pad" - # Since updated onnx to 1.18.0: - # onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from ... - # Unsupported model IR version: 11, max supported IR version: 10 - "test_quant_128" + # Since updated onnx to 1.18.0: + # onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from ... + # Unsupported model IR version: 11, max supported IR version: 10 + "test_quant_128" - # Require internet access - "test_benchmark_openpilot_model" - "test_bn_alone" - "test_bn_linear" - "test_bn_mnist" - "test_car" - "test_chicken" - "test_chicken_bigbatch" - "test_conv_mnist" - "testCopySHMtoDefault" - "test_data_parallel_resnet" - "test_e2e_big" - "test_fetch_small" - "test_huggingface_enet_safetensors" - "test_index_mnist" - "test_linear_mnist" - "test_load_convnext" - "test_load_enet" - "test_load_enet_alt" - "test_load_llama2bfloat" - "test_load_resnet" - "test_mnist_val" - "test_openpilot_model" - "test_resnet" - "test_shufflenet" - "test_transcribe_batch12" - "test_transcribe_batch21" - "test_transcribe_file1" - "test_transcribe_file2" - "test_transcribe_long" - "test_transcribe_long_no_batch" - "test_vgg7" - ] - ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ - # Fail with AssertionError - "test_casts_from" - "test_casts_to" - "test_int8" - "test_int8_to_uint16_negative" - ]; + # Require internet access + "test_benchmark_openpilot_model" + "test_bn_alone" + "test_bn_linear" + "test_bn_mnist" + "test_car" + "test_chicken" + "test_chicken_bigbatch" + "test_conv_mnist" + "testCopySHMtoDefault" + "test_data_parallel_resnet" + "test_e2e_big" + "test_fetch_small" + "test_huggingface_enet_safetensors" + "test_index_mnist" + "test_linear_mnist" + "test_load_convnext" + "test_load_enet" + "test_load_enet_alt" + "test_load_llama2bfloat" + "test_load_resnet" + "test_mnist_val" + "test_openpilot_model" + "test_resnet" + "test_shufflenet" + "test_transcribe_batch12" + "test_transcribe_batch21" + "test_transcribe_file1" + "test_transcribe_file2" + "test_transcribe_long" + "test_transcribe_long_no_batch" + "test_vgg7" + ] + ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-linux") [ + # Fail with AssertionError + "test_casts_from" + "test_casts_to" + "test_int8" + "test_int8_to_uint16_negative" + ]; disabledTestPaths = [ # Require internet access diff --git a/pkgs/development/python-modules/torch-geometric/default.nix b/pkgs/development/python-modules/torch-geometric/default.nix index e36c30a0395c..4557ecfe0648 100644 --- a/pkgs/development/python-modules/torch-geometric/default.nix +++ b/pkgs/development/python-modules/torch-geometric/default.nix @@ -153,61 +153,60 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; - disabledTests = - [ - # RuntimeError: addmm: computation on CPU is not implemented for SparseCsr + SparseCsr @ SparseCsr without MKL. - # PyTorch built with MKL has better support for addmm with sparse CPU tensors. - "test_asap" - "test_graph_unet" + disabledTests = [ + # RuntimeError: addmm: computation on CPU is not implemented for SparseCsr + SparseCsr @ SparseCsr without MKL. + # PyTorch built with MKL has better support for addmm with sparse CPU tensors. + "test_asap" + "test_graph_unet" - # AttributeError: type object 'Any' has no attribute '_name' - "test_type_repr" + # AttributeError: type object 'Any' has no attribute '_name' + "test_type_repr" - # AttributeError: module 'torch.fx._symbolic_trace' has no attribute 'List' - "test_set_clear_mask" - "test_sequential_to_hetero" - "test_to_fixed_size" - "test_to_hetero_basic" - "test_to_hetero_with_gcn" - "test_to_hetero_with_basic_model" - "test_to_hetero_and_rgcn_equal_output" - "test_graph_level_to_hetero" - "test_hetero_transformer_self_loop_error" - "test_to_hetero_validate" - "test_to_hetero_on_static_graphs" - "test_to_hetero_with_bases" - "test_to_hetero_with_bases_and_rgcn_equal_output" - "test_to_hetero_with_bases_validate" - "test_to_hetero_with_bases_on_static_graphs" - "test_to_hetero_with_bases_save" + # AttributeError: module 'torch.fx._symbolic_trace' has no attribute 'List' + "test_set_clear_mask" + "test_sequential_to_hetero" + "test_to_fixed_size" + "test_to_hetero_basic" + "test_to_hetero_with_gcn" + "test_to_hetero_with_basic_model" + "test_to_hetero_and_rgcn_equal_output" + "test_graph_level_to_hetero" + "test_hetero_transformer_self_loop_error" + "test_to_hetero_validate" + "test_to_hetero_on_static_graphs" + "test_to_hetero_with_bases" + "test_to_hetero_with_bases_and_rgcn_equal_output" + "test_to_hetero_with_bases_validate" + "test_to_hetero_with_bases_on_static_graphs" + "test_to_hetero_with_bases_save" - # Failed: DID NOT WARN. - "test_to_hetero_validate" - "test_to_hetero_with_bases_validate" + # Failed: DID NOT WARN. + "test_to_hetero_validate" + "test_to_hetero_with_bases_validate" - # Failed: DID NOT RAISE - "test_scatter_backward" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # This test uses `torch.jit` which might not be working on darwin: - # RuntimeError: required keyword attribute 'value' has the wrong type - "test_traceable_my_conv_with_self_loops" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # RuntimeError: Dynamo is not supported on Python 3.13+ - "test_compile" + # Failed: DID NOT RAISE + "test_scatter_backward" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # This test uses `torch.jit` which might not be working on darwin: + # RuntimeError: required keyword attribute 'value' has the wrong type + "test_traceable_my_conv_with_self_loops" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # RuntimeError: Dynamo is not supported on Python 3.13+ + "test_compile" - # RuntimeError: Python 3.13+ not yet supported for torch.compile - "test_compile_graph_breaks" - "test_compile_multi_aggr_sage_conv" - "test_compile_hetero_conv_graph_breaks" + # RuntimeError: Python 3.13+ not yet supported for torch.compile + "test_compile_graph_breaks" + "test_compile_multi_aggr_sage_conv" + "test_compile_hetero_conv_graph_breaks" - # AttributeError: module 'typing' has no attribute 'io'. Did you mean: 'IO'? - "test_packaging" + # AttributeError: module 'typing' has no attribute 'io'. Did you mean: 'IO'? + "test_packaging" - # RuntimeError: Boolean value of Tensor with more than one value is ambiguous - "test_feature_store" - ]; + # RuntimeError: Boolean value of Tensor with more than one value is ambiguous + "test_feature_store" + ]; meta = { description = "Graph Neural Network Library for PyTorch"; diff --git a/pkgs/development/python-modules/torch/bin/default.nix b/pkgs/development/python-modules/torch/bin/default.nix index 9ea397293beb..315094905b60 100644 --- a/pkgs/development/python-modules/torch/bin/default.nix +++ b/pkgs/development/python-modules/torch/bin/default.nix @@ -94,7 +94,8 @@ buildPythonPackage { setuptools sympy typing-extensions - ] ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [ triton ]; + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [ triton ]; postInstall = '' # ONNX conversion diff --git a/pkgs/development/python-modules/torch/source/default.nix b/pkgs/development/python-modules/torch/source/default.nix index 6effc9ff55ca..b6ac1e57523e 100644 --- a/pkgs/development/python-modules/torch/source/default.nix +++ b/pkgs/development/python-modules/torch/source/default.nix @@ -291,91 +291,89 @@ buildPythonPackage rec { ; }; - patches = - [ - ./clang19-template-warning.patch - ] - ++ lib.optionals cudaSupport [ ./fix-cmake-cuda-toolkit.patch ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # Propagate CUPTI to Kineto by overriding the search path with environment variables. - # https://github.com/pytorch/pytorch/pull/108847 - ./pytorch-pr-108847.patch - ] - ++ lib.optionals (lib.getName blas.provider == "mkl") [ - # The CMake install tries to add some hardcoded rpaths, incompatible - # with the Nix store, which fails. Simply remove this step to get - # rpaths that point to the Nix store. - ./disable-cmake-mkl-rpath.patch - ]; + patches = [ + ./clang19-template-warning.patch + ] + ++ lib.optionals cudaSupport [ ./fix-cmake-cuda-toolkit.patch ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # Propagate CUPTI to Kineto by overriding the search path with environment variables. + # https://github.com/pytorch/pytorch/pull/108847 + ./pytorch-pr-108847.patch + ] + ++ lib.optionals (lib.getName blas.provider == "mkl") [ + # The CMake install tries to add some hardcoded rpaths, incompatible + # with the Nix store, which fails. Simply remove this step to get + # rpaths that point to the Nix store. + ./disable-cmake-mkl-rpath.patch + ]; - postPatch = - '' - # Prevent NCCL from being cloned during the configure phase - # TODO: remove when updating to the next release as it will not be needed anymore - substituteInPlace tools/build_pytorch_libs.py \ - --replace-fail " checkout_nccl()" " " + postPatch = '' + # Prevent NCCL from being cloned during the configure phase + # TODO: remove when updating to the next release as it will not be needed anymore + substituteInPlace tools/build_pytorch_libs.py \ + --replace-fail " checkout_nccl()" " " - substituteInPlace cmake/public/cuda.cmake \ - --replace-fail \ - 'message(FATAL_ERROR "Found two conflicting CUDA' \ - 'message(WARNING "Found two conflicting CUDA' \ - --replace-warn \ - "set(CUDAToolkit_ROOT" \ - "# Upstream: set(CUDAToolkit_ROOT" - substituteInPlace third_party/gloo/cmake/Cuda.cmake \ - --replace-warn "find_package(CUDAToolkit 7.0" "find_package(CUDAToolkit" + substituteInPlace cmake/public/cuda.cmake \ + --replace-fail \ + 'message(FATAL_ERROR "Found two conflicting CUDA' \ + 'message(WARNING "Found two conflicting CUDA' \ + --replace-warn \ + "set(CUDAToolkit_ROOT" \ + "# Upstream: set(CUDAToolkit_ROOT" + substituteInPlace third_party/gloo/cmake/Cuda.cmake \ + --replace-warn "find_package(CUDAToolkit 7.0" "find_package(CUDAToolkit" - # annotations (3.7), print_function (3.0), with_statement (2.6) are all supported - sed -i -e "/from __future__ import/d" **.py - substituteInPlace third_party/NNPACK/CMakeLists.txt \ - --replace-fail "PYTHONPATH=" 'PYTHONPATH=$ENV{PYTHONPATH}:' - # flag from cmakeFlags doesn't work, not clear why - # setting it at the top of NNPACK's own CMakeLists does - sed -i '2s;^;set(PYTHON_SIX_SOURCE_DIR ${six.src})\n;' third_party/NNPACK/CMakeLists.txt + # annotations (3.7), print_function (3.0), with_statement (2.6) are all supported + sed -i -e "/from __future__ import/d" **.py + substituteInPlace third_party/NNPACK/CMakeLists.txt \ + --replace-fail "PYTHONPATH=" 'PYTHONPATH=$ENV{PYTHONPATH}:' + # flag from cmakeFlags doesn't work, not clear why + # setting it at the top of NNPACK's own CMakeLists does + sed -i '2s;^;set(PYTHON_SIX_SOURCE_DIR ${six.src})\n;' third_party/NNPACK/CMakeLists.txt - # Ensure that torch profiler unwind uses addr2line from nix - substituteInPlace torch/csrc/profiler/unwind/unwind.cpp \ - --replace-fail 'addr2line_binary_ = "addr2line"' 'addr2line_binary_ = "${lib.getExe' binutils "addr2line"}"' - '' - + lib.optionalString rocmSupport '' - # https://github.com/facebookincubator/gloo/pull/297 - substituteInPlace third_party/gloo/cmake/Hipify.cmake \ - --replace-fail "\''${HIPIFY_COMMAND}" "python \''${HIPIFY_COMMAND}" + # Ensure that torch profiler unwind uses addr2line from nix + substituteInPlace torch/csrc/profiler/unwind/unwind.cpp \ + --replace-fail 'addr2line_binary_ = "addr2line"' 'addr2line_binary_ = "${lib.getExe' binutils "addr2line"}"' + '' + + lib.optionalString rocmSupport '' + # https://github.com/facebookincubator/gloo/pull/297 + substituteInPlace third_party/gloo/cmake/Hipify.cmake \ + --replace-fail "\''${HIPIFY_COMMAND}" "python \''${HIPIFY_COMMAND}" - # Replace hard-coded rocm paths - substituteInPlace caffe2/CMakeLists.txt \ - --replace-fail "hcc/include" "hip/include" \ - --replace-fail "rocblas/include" "include/rocblas" \ - --replace-fail "hipsparse/include" "include/hipsparse" + # Replace hard-coded rocm paths + substituteInPlace caffe2/CMakeLists.txt \ + --replace-fail "hcc/include" "hip/include" \ + --replace-fail "rocblas/include" "include/rocblas" \ + --replace-fail "hipsparse/include" "include/hipsparse" - # Doesn't pick up the environment variable? - substituteInPlace third_party/kineto/libkineto/CMakeLists.txt \ - --replace-fail "\''$ENV{ROCM_SOURCE_DIR}" "${rocmtoolkit_joined}" + # Doesn't pick up the environment variable? + substituteInPlace third_party/kineto/libkineto/CMakeLists.txt \ + --replace-fail "\''$ENV{ROCM_SOURCE_DIR}" "${rocmtoolkit_joined}" - # Strangely, this is never set in cmake - substituteInPlace cmake/public/LoadHIP.cmake \ - --replace "set(ROCM_PATH \$ENV{ROCM_PATH})" \ - "set(ROCM_PATH \$ENV{ROCM_PATH})''\nset(ROCM_VERSION ${lib.concatStrings (lib.intersperse "0" (lib.splitVersion rocmPackages.clr.version))})" + # Strangely, this is never set in cmake + substituteInPlace cmake/public/LoadHIP.cmake \ + --replace "set(ROCM_PATH \$ENV{ROCM_PATH})" \ + "set(ROCM_PATH \$ENV{ROCM_PATH})''\nset(ROCM_VERSION ${lib.concatStrings (lib.intersperse "0" (lib.splitVersion rocmPackages.clr.version))})" - # Use composable kernel as dependency, rather than built-in third-party - substituteInPlace aten/src/ATen/CMakeLists.txt \ - --replace-fail "list(APPEND ATen_HIP_INCLUDE \''${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/composable_kernel/include)" "" \ - --replace-fail "list(APPEND ATen_HIP_INCLUDE \''${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/composable_kernel/library/include)" "" - '' - # Detection of NCCL version doesn't work particularly well when using the static binary. - + lib.optionalString cudaSupport '' - substituteInPlace cmake/Modules/FindNCCL.cmake \ - --replace-fail \ - 'message(FATAL_ERROR "Found NCCL header version and library version' \ - 'message(WARNING "Found NCCL header version and library version' - '' - # Remove PyTorch's FindCUDAToolkit.cmake and use CMake's default. - # NOTE: Parts of pytorch rely on unmaintained FindCUDA.cmake with custom patches to support e.g. - # newer architectures (sm_90a). We do want to delete vendored patches, but have to keep them - # until https://github.com/pytorch/pytorch/issues/76082 is addressed - + lib.optionalString cudaSupport '' - rm cmake/Modules/FindCUDAToolkit.cmake - ''; + # Use composable kernel as dependency, rather than built-in third-party + substituteInPlace aten/src/ATen/CMakeLists.txt \ + --replace-fail "list(APPEND ATen_HIP_INCLUDE \''${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/composable_kernel/include)" "" \ + --replace-fail "list(APPEND ATen_HIP_INCLUDE \''${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/composable_kernel/library/include)" "" + '' + # Detection of NCCL version doesn't work particularly well when using the static binary. + + lib.optionalString cudaSupport '' + substituteInPlace cmake/Modules/FindNCCL.cmake \ + --replace-fail \ + 'message(FATAL_ERROR "Found NCCL header version and library version' \ + 'message(WARNING "Found NCCL header version and library version' + '' + # Remove PyTorch's FindCUDAToolkit.cmake and use CMake's default. + # NOTE: Parts of pytorch rely on unmaintained FindCUDA.cmake with custom patches to support e.g. + # newer architectures (sm_90a). We do want to delete vendored patches, but have to keep them + # until https://github.com/pytorch/pytorch/issues/76082 is addressed + + lib.optionalString cudaSupport '' + rm cmake/Modules/FindCUDAToolkit.cmake + ''; # NOTE(@connorbaker): Though we do not disable Gloo or MPI when building with CUDA support, caution should be taken # when using the different backends. Gloo's GPU support isn't great, and MPI and CUDA can't be used at the same time @@ -435,17 +433,16 @@ buildPythonPackage rec { # https://pytorch.org/docs/stable/distributed.html#torch.distributed.is_available USE_DISTRIBUTED = setBool true; - cmakeFlags = - [ - (lib.cmakeFeature "PYTHON_SIX_SOURCE_DIR" "${six.src}") - # (lib.cmakeBool "CMAKE_FIND_DEBUG_MODE" true) - (lib.cmakeFeature "CUDAToolkit_VERSION" cudaPackages.cudaMajorMinorVersion) - ] - ++ lib.optionals cudaSupport [ - # Unbreaks version discovery in enable_language(CUDA) when wrapping nvcc with ccache - # Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/26363 - (lib.cmakeFeature "CMAKE_CUDA_COMPILER_TOOLKIT_VERSION" cudaPackages.cudaMajorMinorVersion) - ]; + cmakeFlags = [ + (lib.cmakeFeature "PYTHON_SIX_SOURCE_DIR" "${six.src}") + # (lib.cmakeBool "CMAKE_FIND_DEBUG_MODE" true) + (lib.cmakeFeature "CUDAToolkit_VERSION" cudaPackages.cudaMajorMinorVersion) + ] + ++ lib.optionals cudaSupport [ + # Unbreaks version discovery in enable_language(CUDA) when wrapping nvcc with ccache + # Cf. https://gitlab.kitware.com/cmake/cmake/-/issues/26363 + (lib.cmakeFeature "CMAKE_CUDA_COMPILER_TOOLKIT_VERSION" cudaPackages.cudaMajorMinorVersion) + ]; preBuild = '' export MAX_JOBS=$NIX_BUILD_CORES @@ -484,133 +481,129 @@ buildPythonPackage rec { # https://github.com/pytorch/pytorch/commit/3d617333e PYTHON_LIB_REL_PATH = "${placeholder "out"}/${python.sitePackages}"; - env = - { - # disable warnings as errors as they break the build on every compiler - # bump, among other things. - # Also of interest: pytorch ignores CXXFLAGS uses CFLAGS for both C and C++: - # https://github.com/pytorch/pytorch/blob/v1.11.0/setup.py#L17 - NIX_CFLAGS_COMPILE = toString ( - [ - "-Wno-error" - ] - # fix build aarch64-linux build failure with GCC14 - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - "-Wno-error=incompatible-pointer-types" - ] - ); - USE_VULKAN = setBool vulkanSupport; - } - // lib.optionalAttrs vulkanSupport { - VULKAN_SDK = shaderc.bin; - } - // lib.optionalAttrs rocmSupport { - AOTRITON_INSTALLED_PREFIX = "${rocmPackages.aotriton}"; - }; - - nativeBuildInputs = - [ - cmake - which - ninja - pybind11 - pkg-config - removeReferencesTo - ] - ++ lib.optionals cudaSupport ( - with cudaPackages; + env = { + # disable warnings as errors as they break the build on every compiler + # bump, among other things. + # Also of interest: pytorch ignores CXXFLAGS uses CFLAGS for both C and C++: + # https://github.com/pytorch/pytorch/blob/v1.11.0/setup.py#L17 + NIX_CFLAGS_COMPILE = toString ( [ - autoAddDriverRunpath - cuda_nvcc + "-Wno-error" ] - ) - ++ lib.optionals isCudaJetson [ cudaPackages.autoAddCudaCompatRunpath ] - ++ lib.optionals rocmSupport [ rocmtoolkit_joined ]; + # fix build aarch64-linux build failure with GCC14 + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + "-Wno-error=incompatible-pointer-types" + ] + ); + USE_VULKAN = setBool vulkanSupport; + } + // lib.optionalAttrs vulkanSupport { + VULKAN_SDK = shaderc.bin; + } + // lib.optionalAttrs rocmSupport { + AOTRITON_INSTALLED_PREFIX = "${rocmPackages.aotriton}"; + }; - buildInputs = + nativeBuildInputs = [ + cmake + which + ninja + pybind11 + pkg-config + removeReferencesTo + ] + ++ lib.optionals cudaSupport ( + with cudaPackages; [ - blas - blas.provider + autoAddDriverRunpath + cuda_nvcc ] - ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ] - ++ lib.optionals cudaSupport ( - with cudaPackages; - [ - cuda_cccl # - cuda_cudart # cuda_runtime.h and libraries - cuda_cupti # For kineto - cuda_nvcc # crt/host_config.h; even though we include this in nativeBuildInputs, it's needed here too - cuda_nvml_dev # - cuda_nvrtc - cuda_nvtx # -llibNVToolsExt - cusparselt - libcublas - libcufft - libcufile - libcurand - libcusolver - libcusparse - ] - ++ lists.optionals (cudaPackages ? cudnn) [ cudnn ] - ++ lists.optionals useSystemNccl [ - # Some platforms do not support NCCL (i.e., Jetson) - nccl # Provides nccl.h AND a static copy of NCCL! - ] - ++ lists.optionals (cudaOlder "11.8") [ - cuda_nvprof # - ] - ++ lists.optionals (cudaAtLeast "11.8") [ - cuda_profiler_api # - ] - ) - ++ lib.optionals rocmSupport [ rocmPackages.llvm.openmp ] - ++ lib.optionals (cudaSupport || rocmSupport) [ effectiveMagma ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ numactl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_13 + ) + ++ lib.optionals isCudaJetson [ cudaPackages.autoAddCudaCompatRunpath ] + ++ lib.optionals rocmSupport [ rocmtoolkit_joined ]; + + buildInputs = [ + blas + blas.provider + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ] + ++ lib.optionals cudaSupport ( + with cudaPackages; + [ + cuda_cccl # + cuda_cudart # cuda_runtime.h and libraries + cuda_cupti # For kineto + cuda_nvcc # crt/host_config.h; even though we include this in nativeBuildInputs, it's needed here too + cuda_nvml_dev # + cuda_nvrtc + cuda_nvtx # -llibNVToolsExt + cusparselt + libcublas + libcufft + libcufile + libcurand + libcusolver + libcusparse ] - ++ lib.optionals tritonSupport [ _tritonEffective ] - ++ lib.optionals MPISupport [ mpi ] - ++ lib.optionals rocmSupport [ - rocmtoolkit_joined - rocmPackages.clr # Added separately so setup hook applies - ]; + ++ lists.optionals (cudaPackages ? cudnn) [ cudnn ] + ++ lists.optionals useSystemNccl [ + # Some platforms do not support NCCL (i.e., Jetson) + nccl # Provides nccl.h AND a static copy of NCCL! + ] + ++ lists.optionals (cudaOlder "11.8") [ + cuda_nvprof # + ] + ++ lists.optionals (cudaAtLeast "11.8") [ + cuda_profiler_api # + ] + ) + ++ lib.optionals rocmSupport [ rocmPackages.llvm.openmp ] + ++ lib.optionals (cudaSupport || rocmSupport) [ effectiveMagma ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ numactl ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_13 + ] + ++ lib.optionals tritonSupport [ _tritonEffective ] + ++ lib.optionals MPISupport [ mpi ] + ++ lib.optionals rocmSupport [ + rocmtoolkit_joined + rocmPackages.clr # Added separately so setup hook applies + ]; pythonRelaxDeps = [ "sympy" ]; - dependencies = - [ - astunparse - expecttest - filelock - fsspec - hypothesis - jinja2 - networkx - ninja - packaging - psutil - pyyaml - requests - sympy - types-dataclasses - typing-extensions + dependencies = [ + astunparse + expecttest + filelock + fsspec + hypothesis + jinja2 + networkx + ninja + packaging + psutil + pyyaml + requests + sympy + types-dataclasses + typing-extensions - # the following are required for tensorboard support - pillow - six - tensorboard - protobuf + # the following are required for tensorboard support + pillow + six + tensorboard + protobuf - # torch/csrc requires `pybind11` at runtime - pybind11 - ] - ++ lib.optionals tritonSupport [ _tritonEffective ] - ++ lib.optionals vulkanSupport [ - vulkan-headers - vulkan-loader - ]; + # torch/csrc requires `pybind11` at runtime + pybind11 + ] + ++ lib.optionals tritonSupport [ _tritonEffective ] + ++ lib.optionals vulkanSupport [ + vulkan-headers + vulkan-loader + ]; propagatedCxxBuildInputs = [ ] ++ lib.optionals MPISupport [ mpi ] ++ lib.optionals rocmSupport [ rocmtoolkit_joined ]; @@ -650,61 +643,59 @@ buildPythonPackage rec { "pytorch-triton-rocm" ]; - postInstall = - '' - find "$out/${python.sitePackages}/torch/include" "$out/${python.sitePackages}/torch/lib" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + + postInstall = '' + find "$out/${python.sitePackages}/torch/include" "$out/${python.sitePackages}/torch/lib" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + - mkdir $dev + mkdir $dev - # CppExtension requires that include files are packaged with the main - # python library output; which is why they are copied here. - cp -r $out/${python.sitePackages}/torch/include $dev/include + # CppExtension requires that include files are packaged with the main + # python library output; which is why they are copied here. + cp -r $out/${python.sitePackages}/torch/include $dev/include - # Cmake files under /share are different and can be safely moved. This - # avoids unnecessary closure blow-up due to apple sdk references when - # USE_DISTRIBUTED is enabled. - mv $out/${python.sitePackages}/torch/share $dev/share + # Cmake files under /share are different and can be safely moved. This + # avoids unnecessary closure blow-up due to apple sdk references when + # USE_DISTRIBUTED is enabled. + mv $out/${python.sitePackages}/torch/share $dev/share - # Fix up library paths for split outputs - substituteInPlace \ - $dev/share/cmake/Torch/TorchConfig.cmake \ - --replace-fail \''${TORCH_INSTALL_PREFIX}/lib "$lib/lib" + # Fix up library paths for split outputs + substituteInPlace \ + $dev/share/cmake/Torch/TorchConfig.cmake \ + --replace-fail \''${TORCH_INSTALL_PREFIX}/lib "$lib/lib" - substituteInPlace \ - $dev/share/cmake/Caffe2/Caffe2Targets-release.cmake \ - --replace-fail \''${_IMPORT_PREFIX}/lib "$lib/lib" + substituteInPlace \ + $dev/share/cmake/Caffe2/Caffe2Targets-release.cmake \ + --replace-fail \''${_IMPORT_PREFIX}/lib "$lib/lib" - mkdir $lib - mv $out/${python.sitePackages}/torch/lib $lib/lib - ln -s $lib/lib $out/${python.sitePackages}/torch/lib - '' - + lib.optionalString rocmSupport '' - substituteInPlace $dev/share/cmake/Tensorpipe/TensorpipeTargets-release.cmake \ - --replace-fail "\''${_IMPORT_PREFIX}/lib64" "$lib/lib" + mkdir $lib + mv $out/${python.sitePackages}/torch/lib $lib/lib + ln -s $lib/lib $out/${python.sitePackages}/torch/lib + '' + + lib.optionalString rocmSupport '' + substituteInPlace $dev/share/cmake/Tensorpipe/TensorpipeTargets-release.cmake \ + --replace-fail "\''${_IMPORT_PREFIX}/lib64" "$lib/lib" - substituteInPlace $dev/share/cmake/ATen/ATenConfig.cmake \ - --replace-fail "/build/${src.name}/torch/include" "$dev/include" - ''; + substituteInPlace $dev/share/cmake/ATen/ATenConfig.cmake \ + --replace-fail "/build/${src.name}/torch/include" "$dev/include" + ''; - postFixup = - '' - mkdir -p "$cxxdev/nix-support" - printWords "''${propagatedCxxBuildInputs[@]}" >> "$cxxdev/nix-support/propagated-build-inputs" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for f in $(ls $lib/lib/*.dylib); do - install_name_tool -id $lib/lib/$(basename $f) $f || true - done + postFixup = '' + mkdir -p "$cxxdev/nix-support" + printWords "''${propagatedCxxBuildInputs[@]}" >> "$cxxdev/nix-support/propagated-build-inputs" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + for f in $(ls $lib/lib/*.dylib); do + install_name_tool -id $lib/lib/$(basename $f) $f || true + done - install_name_tool -change @rpath/libshm.dylib $lib/lib/libshm.dylib $lib/lib/libtorch_python.dylib - install_name_tool -change @rpath/libtorch.dylib $lib/lib/libtorch.dylib $lib/lib/libtorch_python.dylib - install_name_tool -change @rpath/libc10.dylib $lib/lib/libc10.dylib $lib/lib/libtorch_python.dylib + install_name_tool -change @rpath/libshm.dylib $lib/lib/libshm.dylib $lib/lib/libtorch_python.dylib + install_name_tool -change @rpath/libtorch.dylib $lib/lib/libtorch.dylib $lib/lib/libtorch_python.dylib + install_name_tool -change @rpath/libc10.dylib $lib/lib/libc10.dylib $lib/lib/libtorch_python.dylib - install_name_tool -change @rpath/libc10.dylib $lib/lib/libc10.dylib $lib/lib/libtorch.dylib + install_name_tool -change @rpath/libc10.dylib $lib/lib/libc10.dylib $lib/lib/libtorch.dylib - install_name_tool -change @rpath/libtorch.dylib $lib/lib/libtorch.dylib $lib/lib/libshm.dylib - install_name_tool -change @rpath/libc10.dylib $lib/lib/libc10.dylib $lib/lib/libshm.dylib - ''; + install_name_tool -change @rpath/libtorch.dylib $lib/lib/libtorch.dylib $lib/lib/libshm.dylib + install_name_tool -change @rpath/libc10.dylib $lib/lib/libc10.dylib $lib/lib/libshm.dylib + ''; # See https://github.com/NixOS/nixpkgs/issues/296179 # @@ -755,8 +746,7 @@ buildPythonPackage rec { tscholak ]; # tscholak esp. for darwin-related builds platforms = - lib.platforms.linux - ++ lib.optionals (!cudaSupport && !rocmSupport) lib.platforms.darwin; + lib.platforms.linux ++ lib.optionals (!cudaSupport && !rocmSupport) lib.platforms.darwin; broken = builtins.any trivial.id (builtins.attrValues brokenConditions); }; } diff --git a/pkgs/development/python-modules/torchao/default.nix b/pkgs/development/python-modules/torchao/default.nix index 66d95e175d9b..d249672428ab 100644 --- a/pkgs/development/python-modules/torchao/default.nix +++ b/pkgs/development/python-modules/torchao/default.nix @@ -67,28 +67,27 @@ buildPythonPackage rec { unittest-xml-reporting ]; - disabledTests = - [ - # Requires internet access - "test_on_dummy_distilbert" + disabledTests = [ + # Requires internet access + "test_on_dummy_distilbert" - # FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/meta-llama/Llama-2-7b-chat-hf/model.pth' - "test_gptq_mt" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # RuntimeError: failed to initialize QNNPACK - "test_smooth_linear_cpu" + # FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/meta-llama/Llama-2-7b-chat-hf/model.pth' + "test_gptq_mt" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # RuntimeError: failed to initialize QNNPACK + "test_smooth_linear_cpu" - # torch._inductor.exc.InductorError: LoweringException: AssertionError: Expect L1_cache_size > 0 but got 0 - "test_int8_weight_only_quant_with_freeze_0_cpu" - "test_int8_weight_only_quant_with_freeze_1_cpu" - "test_int8_weight_only_quant_with_freeze_2_cpu" + # torch._inductor.exc.InductorError: LoweringException: AssertionError: Expect L1_cache_size > 0 but got 0 + "test_int8_weight_only_quant_with_freeze_0_cpu" + "test_int8_weight_only_quant_with_freeze_1_cpu" + "test_int8_weight_only_quant_with_freeze_2_cpu" - # FileNotFoundError: [Errno 2] No such file or directory: 'test.pth' - "test_save_load_int4woqtensors_2_cpu" - "test_save_load_int8woqtensors_0_cpu" - "test_save_load_int8woqtensors_1_cpu" - ]; + # FileNotFoundError: [Errno 2] No such file or directory: 'test.pth' + "test_save_load_int4woqtensors_2_cpu" + "test_save_load_int8woqtensors_0_cpu" + "test_save_load_int8woqtensors_1_cpu" + ]; meta = { description = "PyTorch native quantization and sparsity for training and inference"; diff --git a/pkgs/development/python-modules/torchaudio/bin.nix b/pkgs/development/python-modules/torchaudio/bin.nix index d85afea91385..67ca7358dfbb 100644 --- a/pkgs/development/python-modules/torchaudio/bin.nix +++ b/pkgs/development/python-modules/torchaudio/bin.nix @@ -35,24 +35,23 @@ buildPythonPackage rec { disabled = (pythonOlder "3.9") || (pythonAtLeast "3.14"); - buildInputs = + buildInputs = [ + # We need to patch lib/torio/_torio_ffmpeg6 + ffmpeg_6.dev + sox + ] + ++ lib.optionals stdenv.hostPlatform.isLinux ( + with cudaPackages; [ - # We need to patch lib/torio/_torio_ffmpeg6 - ffmpeg_6.dev - sox - ] - ++ lib.optionals stdenv.hostPlatform.isLinux ( - with cudaPackages; - [ - # $out/${sitePackages}/torchaudio/lib/libtorchaudio*.so wants libcudart.so.11.0 but torch/lib only ships - # libcudart.$hash.so.11.0 - cuda_cudart + # $out/${sitePackages}/torchaudio/lib/libtorchaudio*.so wants libcudart.so.11.0 but torch/lib only ships + # libcudart.$hash.so.11.0 + cuda_cudart - # $out/${sitePackages}/torchaudio/lib/libtorchaudio*.so wants libnvToolsExt.so.2 but torch/lib only ships - # libnvToolsExt-$hash.so.1 - cuda_nvtx - ] - ); + # $out/${sitePackages}/torchaudio/lib/libtorchaudio*.so wants libnvToolsExt.so.2 but torch/lib only ships + # libnvToolsExt-$hash.so.1 + cuda_nvtx + ] + ); nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook diff --git a/pkgs/development/python-modules/torchaudio/default.nix b/pkgs/development/python-modules/torchaudio/default.nix index 44902a279cdf..c88e4c58914d 100644 --- a/pkgs/development/python-modules/torchaudio/default.nix +++ b/pkgs/development/python-modules/torchaudio/default.nix @@ -113,28 +113,28 @@ buildPythonPackage rec { ]; }; - nativeBuildInputs = + nativeBuildInputs = [ + cmake + pkg-config + ninja + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ] + ++ lib.optionals rocmSupport ( + with rocmPackages; [ - cmake - pkg-config - ninja + clr + rocblas + hipblas ] - ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ] - ++ lib.optionals rocmSupport ( - with rocmPackages; - [ - clr - rocblas - hipblas - ] - ); + ); buildInputs = [ ffmpeg_6-full pybind11 sox torch.cxxdev - ] ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; + ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; dependencies = [ torch ]; @@ -160,8 +160,7 @@ buildPythonPackage rec { changelog = "https://github.com/pytorch/audio/releases/tag/v${version}"; license = lib.licenses.bsd2; platforms = - lib.platforms.linux - ++ lib.optionals (!cudaSupport && !rocmSupport) lib.platforms.darwin; + lib.platforms.linux ++ lib.optionals (!cudaSupport && !rocmSupport) lib.platforms.darwin; maintainers = with lib.maintainers; [ GaetanLepage junjihashimoto diff --git a/pkgs/development/python-modules/torcheval/default.nix b/pkgs/development/python-modules/torcheval/default.nix index 771d58b498f9..df26b6b9af02 100644 --- a/pkgs/development/python-modules/torcheval/default.nix +++ b/pkgs/development/python-modules/torcheval/default.nix @@ -72,67 +72,66 @@ buildPythonPackage { torchvision ]; - pytestFlagsArray = - [ - "-v" - "tests/" + pytestFlagsArray = [ + "-v" + "tests/" - # -- tests/metrics/audio/test_fad.py -- - # Touch filesystem and require network access. - # torchaudio.utils.download_asset("models/vggish.pt") -> PermissionError: [Errno 13] Permission denied: '/homeless-shelter' - "--deselect=tests/metrics/audio/test_fad.py::TestFAD::test_vggish_fad" - "--deselect=tests/metrics/audio/test_fad.py::TestFAD::test_vggish_fad_merge" + # -- tests/metrics/audio/test_fad.py -- + # Touch filesystem and require network access. + # torchaudio.utils.download_asset("models/vggish.pt") -> PermissionError: [Errno 13] Permission denied: '/homeless-shelter' + "--deselect=tests/metrics/audio/test_fad.py::TestFAD::test_vggish_fad" + "--deselect=tests/metrics/audio/test_fad.py::TestFAD::test_vggish_fad_merge" - # -- tests/metrics/image/test_fid.py -- - # Touch filesystem and require network access. - # models.inception_v3(weights=weights) -> PermissionError: [Errno 13] Permission denied: '/homeless-shelter' - "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_invalid_input" - "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_random_data_custom_model" - "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_random_data_default_model" - "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_with_dissimilar_inputs" - "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_with_similar_inputs" + # -- tests/metrics/image/test_fid.py -- + # Touch filesystem and require network access. + # models.inception_v3(weights=weights) -> PermissionError: [Errno 13] Permission denied: '/homeless-shelter' + "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_invalid_input" + "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_random_data_custom_model" + "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_random_data_default_model" + "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_with_dissimilar_inputs" + "--deselect=tests/metrics/image/test_fid.py::TestFrechetInceptionDistance::test_fid_with_similar_inputs" - # -- tests/metrics/functional/text/test_perplexity.py -- - # AssertionError: Scalars are not close! - # Expected 3.537154912949 but got 3.53715443611145 - "--deselect=tests/metrics/functional/text/test_perplexity.py::Perplexity::test_perplexity_with_ignore_index" + # -- tests/metrics/functional/text/test_perplexity.py -- + # AssertionError: Scalars are not close! + # Expected 3.537154912949 but got 3.53715443611145 + "--deselect=tests/metrics/functional/text/test_perplexity.py::Perplexity::test_perplexity_with_ignore_index" - # -- tests/metrics/image/test_psnr.py -- - # AssertionError: Scalars are not close! - # Expected 7.781850814819336 but got 7.781772613525391 - "--deselect=tests/metrics/image/test_psnr.py::TestPeakSignalNoiseRatio::test_psnr_with_random_data" + # -- tests/metrics/image/test_psnr.py -- + # AssertionError: Scalars are not close! + # Expected 7.781850814819336 but got 7.781772613525391 + "--deselect=tests/metrics/image/test_psnr.py::TestPeakSignalNoiseRatio::test_psnr_with_random_data" - # -- tests/metrics/regression/test_mean_squared_error.py -- - # AssertionError: Scalars are not close! - # Expected -640.4547729492188 but got -640.4707641601562 - "--deselect=tests/metrics/regression/test_mean_squared_error.py::TestMeanSquaredError::test_mean_squared_error_class_update_input_shape_different" + # -- tests/metrics/regression/test_mean_squared_error.py -- + # AssertionError: Scalars are not close! + # Expected -640.4547729492188 but got -640.4707641601562 + "--deselect=tests/metrics/regression/test_mean_squared_error.py::TestMeanSquaredError::test_mean_squared_error_class_update_input_shape_different" - # -- tests/metrics/window/test_mean_squared_error.py -- - # AssertionError: Scalars are not close! - # Expected 0.0009198983898386359 but got 0.0009198188781738281 - "--deselect=tests/metrics/window/test_mean_squared_error.py::TestMeanSquaredError::test_mean_squared_error_class_update_input_shape_different" - ] + # -- tests/metrics/window/test_mean_squared_error.py -- + # AssertionError: Scalars are not close! + # Expected 0.0009198983898386359 but got 0.0009198188781738281 + "--deselect=tests/metrics/window/test_mean_squared_error.py::TestMeanSquaredError::test_mean_squared_error_class_update_input_shape_different" + ] - # These tests error on darwin platforms. - # NotImplementedError: The operator 'c10d::allgather_' is not currently implemented for the mps device - # - # Applying the suggested environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1;` causes the tests to fail, - # as using the CPU instead of the MPS causes the tensors to be on the wrong device: - # RuntimeError: ProcessGroupGloo::allgather: invalid tensor type at index 0; - # Expected TensorOptions(dtype=float, device=cpu, ...), got TensorOptions(dtype=float, device=mps:0, ...) - ++ lib.optional stdenv.hostPlatform.isDarwin [ - # -- tests/metrics/test_synclib.py -- - "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_complex_mixed_state_sync" - "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_complex_mixed_state_sync" - "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_empty_tensor_list_sync_state" - "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_sync_dtype_and_shape" - "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_tensor_list_sync_states" - "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_tensor_dict_sync_states" - "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_tensor_sync_states" - # -- tests/metrics/test_toolkit.py -- - "--deselect=tests/metrics/test_toolkit.py::MetricToolkitTest::test_metric_sync" - "--deselect=tests/metrics/test_toolkit.py::MetricCollectionToolkitTest::test_metric_collection_sync" - ]; + # These tests error on darwin platforms. + # NotImplementedError: The operator 'c10d::allgather_' is not currently implemented for the mps device + # + # Applying the suggested environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1;` causes the tests to fail, + # as using the CPU instead of the MPS causes the tensors to be on the wrong device: + # RuntimeError: ProcessGroupGloo::allgather: invalid tensor type at index 0; + # Expected TensorOptions(dtype=float, device=cpu, ...), got TensorOptions(dtype=float, device=mps:0, ...) + ++ lib.optional stdenv.hostPlatform.isDarwin [ + # -- tests/metrics/test_synclib.py -- + "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_complex_mixed_state_sync" + "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_complex_mixed_state_sync" + "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_empty_tensor_list_sync_state" + "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_sync_dtype_and_shape" + "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_tensor_list_sync_states" + "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_tensor_dict_sync_states" + "--deselect=tests/metrics/test_synclib.py::SynclibTest::test_tensor_sync_states" + # -- tests/metrics/test_toolkit.py -- + "--deselect=tests/metrics/test_toolkit.py::MetricToolkitTest::test_metric_sync" + "--deselect=tests/metrics/test_toolkit.py::MetricCollectionToolkitTest::test_metric_collection_sync" + ]; meta = { description = "Rich collection of performant PyTorch model metrics and tools for PyTorch model evaluations"; diff --git a/pkgs/development/python-modules/torchio/default.nix b/pkgs/development/python-modules/torchio/default.nix index b8955c65970b..fe99a4035539 100644 --- a/pkgs/development/python-modules/torchio/default.nix +++ b/pkgs/development/python-modules/torchio/default.nix @@ -64,15 +64,14 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # tries to download models: - "test_load_all" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ - # RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly - "test_queue_multiprocessing" - ]; + disabledTests = [ + # tries to download models: + "test_load_all" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ + # RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly + "test_queue_multiprocessing" + ]; pythonImportsCheck = [ "torchio" diff --git a/pkgs/development/python-modules/torchrl/default.nix b/pkgs/development/python-modules/torchrl/default.nix index 8f2f72a4dcd1..b4f2d48a021a 100644 --- a/pkgs/development/python-modules/torchrl/default.nix +++ b/pkgs/development/python-modules/torchrl/default.nix @@ -144,102 +144,100 @@ buildPythonPackage rec { export XDG_RUNTIME_DIR=$(mktemp -d) ''; - nativeCheckInputs = - [ - h5py - gymnasium - imageio - pytest-rerunfailures - pytestCheckHook - pyyaml - scipy - torchvision - ] - ++ optional-dependencies.atari - ++ optional-dependencies.gym-continuous - ++ optional-dependencies.llm - ++ optional-dependencies.rendering; + nativeCheckInputs = [ + h5py + gymnasium + imageio + pytest-rerunfailures + pytestCheckHook + pyyaml + scipy + torchvision + ] + ++ optional-dependencies.atari + ++ optional-dependencies.gym-continuous + ++ optional-dependencies.llm + ++ optional-dependencies.rendering; - disabledTests = - [ - # Require network - "test_create_or_load_dataset" - "test_from_text_env_tokenizer" - "test_from_text_env_tokenizer_catframes" - "test_from_text_rb_slicesampler" - "test_generate" - "test_get_dataloader" - "test_get_scores" - "test_preproc_data" - "test_prompt_tensordict_tokenizer" - "test_reward_model" - "test_tensordict_tokenizer" - "test_transform_compose" - "test_transform_model" - "test_transform_no_env" - "test_transform_rb" + disabledTests = [ + # Require network + "test_create_or_load_dataset" + "test_from_text_env_tokenizer" + "test_from_text_env_tokenizer_catframes" + "test_from_text_rb_slicesampler" + "test_generate" + "test_get_dataloader" + "test_get_scores" + "test_preproc_data" + "test_prompt_tensordict_tokenizer" + "test_reward_model" + "test_tensordict_tokenizer" + "test_transform_compose" + "test_transform_model" + "test_transform_no_env" + "test_transform_rb" - # ray.exceptions.RuntimeEnvSetupError: Failed to set up runtime environment - "TestRayCollector" + # ray.exceptions.RuntimeEnvSetupError: Failed to set up runtime environment + "TestRayCollector" - # torchrl is incompatible with gymnasium>=1.0 - # https://github.com/pytorch/rl/discussions/2483 - "test_resetting_strategies" - "test_torchrl_to_gym" - "test_vecenvs_nan" + # torchrl is incompatible with gymnasium>=1.0 + # https://github.com/pytorch/rl/discussions/2483 + "test_resetting_strategies" + "test_torchrl_to_gym" + "test_vecenvs_nan" - # gym.error.VersionNotFound: Environment version `v5` for environment `HalfCheetah` doesn't exist. - "test_collector_run" - "test_transform_inverse" + # gym.error.VersionNotFound: Environment version `v5` for environment `HalfCheetah` doesn't exist. + "test_collector_run" + "test_transform_inverse" - # OSError: Unable to synchronously create file (unable to truncate a file which is already open) - "test_multi_env" - "test_simple_env" + # OSError: Unable to synchronously create file (unable to truncate a file which is already open) + "test_multi_env" + "test_simple_env" - # ImportWarning: Ignoring non-library in plugin directory: - # /nix/store/cy8vwf1dacp3xfwnp9v6a1sz8bic8ylx-python3.12-mujoco-3.3.2/lib/python3.12/site-packages/mujoco/plugin/libmujoco.so.3.3.2 - "test_auto_register" - "test_info_dict_reader" + # ImportWarning: Ignoring non-library in plugin directory: + # /nix/store/cy8vwf1dacp3xfwnp9v6a1sz8bic8ylx-python3.12-mujoco-3.3.2/lib/python3.12/site-packages/mujoco/plugin/libmujoco.so.3.3.2 + "test_auto_register" + "test_info_dict_reader" - # mujoco.FatalError: an OpenGL platform library has not been loaded into this process, this most likely means that a valid OpenGL context has not been created before mjr_makeContext was called - "test_vecenvs_env" + # mujoco.FatalError: an OpenGL platform library has not been loaded into this process, this most likely means that a valid OpenGL context has not been created before mjr_makeContext was called + "test_vecenvs_env" - # ValueError: Can't write images with one color channel. - "test_log_video" + # ValueError: Can't write images with one color channel. + "test_log_video" - # Those tests require the ALE environments (provided by unpackaged shimmy) - "test_collector_env_reset" - "test_gym" - "test_gym_fake_td" - "test_recorder" - "test_recorder_load" - "test_rollout" - "test_parallel_trans_env_check" - "test_serial_trans_env_check" - "test_single_trans_env_check" - "test_td_creation_from_spec" - "test_trans_parallel_env_check" - "test_trans_serial_env_check" - "test_transform_env" + # Those tests require the ALE environments (provided by unpackaged shimmy) + "test_collector_env_reset" + "test_gym" + "test_gym_fake_td" + "test_recorder" + "test_recorder_load" + "test_rollout" + "test_parallel_trans_env_check" + "test_serial_trans_env_check" + "test_single_trans_env_check" + "test_td_creation_from_spec" + "test_trans_parallel_env_check" + "test_trans_serial_env_check" + "test_transform_env" - # undeterministic - "test_distributed_collector_updatepolicy" - "test_timeit" + # undeterministic + "test_distributed_collector_updatepolicy" + "test_timeit" - # On a 24 threads system - # assert torch.get_num_threads() == max(1, init_threads - 3) - # AssertionError: assert 23 == 21 - "test_auto_num_threads" + # On a 24 threads system + # assert torch.get_num_threads() == max(1, init_threads - 3) + # AssertionError: assert 23 == 21 + "test_auto_num_threads" - # Flaky (hangs indefinitely on some CPUs) - "test_gae_multidim" - "test_gae_param_as_tensor" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Flaky - # AssertionError: assert tensor([51.]) == ((5 * 11) + 2) - "test_vecnorm_parallel_auto" - ]; + # Flaky (hangs indefinitely on some CPUs) + "test_gae_multidim" + "test_gae_param_as_tensor" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Flaky + # AssertionError: assert tensor([51.]) == ((5 * 11) + 2) + "test_vecnorm_parallel_auto" + ]; disabledTestPaths = [ # ERROR collecting test/smoke_test.py diff --git a/pkgs/development/python-modules/torchvision/default.nix b/pkgs/development/python-modules/torchvision/default.nix index afe7782cce19..7c7f00a72f1c 100644 --- a/pkgs/development/python-modules/torchvision/default.nix +++ b/pkgs/development/python-modules/torchvision/default.nix @@ -48,22 +48,22 @@ buildPythonPackage { libpng ninja which - ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; + ] + ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; - buildInputs = - [ - libjpeg_turbo - libpng - torch.cxxdev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # This should match the SDK used by `torch` above - apple-sdk_13 + buildInputs = [ + libjpeg_turbo + libpng + torch.cxxdev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # This should match the SDK used by `torch` above + apple-sdk_13 - # error: unknown type name 'MPSGraphCompilationDescriptor'; did you mean 'MPSGraphExecutionDescriptor'? - # https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/ - (darwinMinVersionHook "12.0") - ]; + # error: unknown type name 'MPSGraphCompilationDescriptor'; did you mean 'MPSGraphExecutionDescriptor'? + # https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphcompilationdescriptor/ + (darwinMinVersionHook "12.0") + ]; dependencies = [ numpy @@ -72,15 +72,14 @@ buildPythonPackage { scipy ]; - env = - { - TORCHVISION_INCLUDE = "${libjpeg_turbo.dev}/include/"; - TORCHVISION_LIBRARY = "${libjpeg_turbo}/lib/"; - } - // lib.optionalAttrs cudaSupport { - TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" cudaCapabilities}"; - FORCE_CUDA = 1; - }; + env = { + TORCHVISION_INCLUDE = "${libjpeg_turbo.dev}/include/"; + TORCHVISION_LIBRARY = "${libjpeg_turbo}/lib/"; + } + // lib.optionalAttrs cudaSupport { + TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" cudaCapabilities}"; + FORCE_CUDA = 1; + }; # tests download big datasets, models, require internet connection, etc. doCheck = false; diff --git a/pkgs/development/python-modules/towncrier/default.nix b/pkgs/development/python-modules/towncrier/default.nix index 580d82133f2d..db55452952ce 100644 --- a/pkgs/development/python-modules/towncrier/default.nix +++ b/pkgs/development/python-modules/towncrier/default.nix @@ -29,14 +29,13 @@ buildPythonPackage rec { build-system = [ hatchling ]; - dependencies = - [ - click - incremental - jinja2 - ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-resources ] - ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + dependencies = [ + click + incremental + jinja2 + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-resources ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; preCheck = '' export PATH=$out/bin:$PATH diff --git a/pkgs/development/python-modules/tox/default.nix b/pkgs/development/python-modules/tox/default.nix index 5da04bdd9168..0427ed68a800 100644 --- a/pkgs/development/python-modules/tox/default.nix +++ b/pkgs/development/python-modules/tox/default.nix @@ -57,7 +57,8 @@ buildPythonPackage rec { six toml virtualenv - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; doCheck = false; # infinite recursion via devpi-client diff --git a/pkgs/development/python-modules/tpm2-pytss/default.nix b/pkgs/development/python-modules/tpm2-pytss/default.nix index 9560b1e694ed..e8cdb0ad065a 100644 --- a/pkgs/development/python-modules/tpm2-pytss/default.nix +++ b/pkgs/development/python-modules/tpm2-pytss/default.nix @@ -34,35 +34,34 @@ buildPythonPackage rec { hash = "sha256-IAcRKTeWVvXzw7wW02RhJnKxR9gRkftOufn/n77khBA="; }; - patches = - [ - # Fix hardcoded `fapi-config.json` configuration path - ./fapi-config.patch - # libtpms (underneath swtpm) bumped the TPM revision - # https://github.com/tpm2-software/tpm2-pytss/pull/593 - (fetchpatch { - url = "https://github.com/tpm2-software/tpm2-pytss/pull/593.patch"; - hash = "sha256-CNJnSIvUQ0Yvy0o7GdVfFZ7kHJd2hBt5Zv1lqgOeoks="; - }) - # support cryptography >= 45.0.0 - # https://github.com/tpm2-software/tpm2-pytss/pull/643 - (fetchpatch { - url = "https://github.com/tpm2-software/tpm2-pytss/commit/6ab4c74e6fb3da7cd38e97c1f8e92532312f8439.patch"; - hash = "sha256-01Qe4qpD2IINc5Z120iVdPitiLBwdr8KNBjLFnGgE7E="; - }) - ] - ++ lib.optionals isCross [ - # pytss will regenerate files from headers of tpm2-tss. - # Those headers are fed through a compiler via pycparser. pycparser expects `cpp` - # to be in the path. - # This is put in the path via stdenv when not cross-compiling, but this is absent - # when cross-compiling is turned on. - # This patch changes the call to pycparser.preprocess_file to provide the name - # of the cross-compiling cpp - (replaceVars ./cross.patch { - crossPrefix = stdenv.hostPlatform.config; - }) - ]; + patches = [ + # Fix hardcoded `fapi-config.json` configuration path + ./fapi-config.patch + # libtpms (underneath swtpm) bumped the TPM revision + # https://github.com/tpm2-software/tpm2-pytss/pull/593 + (fetchpatch { + url = "https://github.com/tpm2-software/tpm2-pytss/pull/593.patch"; + hash = "sha256-CNJnSIvUQ0Yvy0o7GdVfFZ7kHJd2hBt5Zv1lqgOeoks="; + }) + # support cryptography >= 45.0.0 + # https://github.com/tpm2-software/tpm2-pytss/pull/643 + (fetchpatch { + url = "https://github.com/tpm2-software/tpm2-pytss/commit/6ab4c74e6fb3da7cd38e97c1f8e92532312f8439.patch"; + hash = "sha256-01Qe4qpD2IINc5Z120iVdPitiLBwdr8KNBjLFnGgE7E="; + }) + ] + ++ lib.optionals isCross [ + # pytss will regenerate files from headers of tpm2-tss. + # Those headers are fed through a compiler via pycparser. pycparser expects `cpp` + # to be in the path. + # This is put in the path via stdenv when not cross-compiling, but this is absent + # when cross-compiling is turned on. + # This patch changes the call to pycparser.preprocess_file to provide the name + # of the cross-compiling cpp + (replaceVars ./cross.patch { + crossPrefix = stdenv.hostPlatform.config; + }) + ]; postPatch = '' sed -i "s#@TPM2_TSS@#${tpm2-tss.out}#" src/tpm2_pytss/FAPI.py diff --git a/pkgs/development/python-modules/transitions/default.nix b/pkgs/development/python-modules/transitions/default.nix index a7b5535c9dcc..61df76109ba0 100644 --- a/pkgs/development/python-modules/transitions/default.nix +++ b/pkgs/development/python-modules/transitions/default.nix @@ -47,25 +47,24 @@ buildPythonPackage rec { "tests/test_async.py" ]; - disabledTests = - [ - "test_diagram" - "test_ordered_with_graph" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Upstream issue https://github.com/pygraphviz/pygraphviz/issues/441 - "test_binary_stream" + disabledTests = [ + "test_diagram" + "test_ordered_with_graph" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Upstream issue https://github.com/pygraphviz/pygraphviz/issues/441 + "test_binary_stream" - # sleep is not accurate on Darwin - "test_timeout" - "test_timeout_callbacks" - "test_timeout_transitioning" - "test_thread_access" - "test_parallel_access" - "test_parallel_deep" - "test_conditional_access" - "test_pickle" - ]; + # sleep is not accurate on Darwin + "test_timeout" + "test_timeout_callbacks" + "test_timeout_transitioning" + "test_thread_access" + "test_parallel_access" + "test_parallel_deep" + "test_conditional_access" + "test_pickle" + ]; pythonImportsCheck = [ "transitions" ]; diff --git a/pkgs/development/python-modules/treq/default.nix b/pkgs/development/python-modules/treq/default.nix index 7138ea063672..2f19ecf00a0a 100644 --- a/pkgs/development/python-modules/treq/default.nix +++ b/pkgs/development/python-modules/treq/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { incremental requests twisted - ] ++ twisted.optional-dependencies.tls; + ] + ++ twisted.optional-dependencies.tls; nativeCheckInputs = [ httpbin diff --git a/pkgs/development/python-modules/trezor/default.nix b/pkgs/development/python-modules/trezor/default.nix index 2b3147874c59..8c62f18b8c6f 100644 --- a/pkgs/development/python-modules/trezor/default.nix +++ b/pkgs/development/python-modules/trezor/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { shamir-mnemonic slip10 typing-extensions - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ trezor-udev-rules ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ trezor-udev-rules ]; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/development/python-modules/trie/default.nix b/pkgs/development/python-modules/trie/default.nix index 261cc26df341..5e1359151709 100644 --- a/pkgs/development/python-modules/trie/default.nix +++ b/pkgs/development/python-modules/trie/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { hypothesis pytestCheckHook pytest-xdist - ] ++ eth-hash.optional-dependencies.pycryptodome; + ] + ++ eth-hash.optional-dependencies.pycryptodome; disabledTests = [ # some core tests require fixture submodule and execution spec diff --git a/pkgs/development/python-modules/trimesh/default.nix b/pkgs/development/python-modules/trimesh/default.nix index acbec34d74c8..062812a768ea 100644 --- a/pkgs/development/python-modules/trimesh/default.nix +++ b/pkgs/development/python-modules/trimesh/default.nix @@ -46,28 +46,27 @@ buildPythonPackage rec { dependencies = [ numpy ]; optional-dependencies = { - easy = - [ - colorlog - manifold3d - charset-normalizer - lxml - jsonschema - networkx - svg-path - pycollada - shapely - xxhash - rtree - httpx - scipy - pillow - # vhacdx # not packaged - mapbox-earcut - ] - ++ lib.optionals embreex.meta.available [ - embreex - ]; + easy = [ + colorlog + manifold3d + charset-normalizer + lxml + jsonschema + networkx + svg-path + pycollada + shapely + xxhash + rtree + httpx + scipy + pillow + # vhacdx # not packaged + mapbox-earcut + ] + ++ lib.optionals embreex.meta.available [ + embreex + ]; }; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/trino-python-client/default.nix b/pkgs/development/python-modules/trino-python-client/default.nix index af118a7a7dc4..251d3ef3c4af 100644 --- a/pkgs/development/python-modules/trino-python-client/default.nix +++ b/pkgs/development/python-modules/trino-python-client/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { nativeCheckInputs = [ httpretty pytestCheckHook - ] ++ optional-dependencies.all; + ] + ++ optional-dependencies.all; pythonImportsCheck = [ "trino" ]; diff --git a/pkgs/development/python-modules/trio-asyncio/default.nix b/pkgs/development/python-modules/trio-asyncio/default.nix index 8b4b901b36a4..b6b32d5110d6 100644 --- a/pkgs/development/python-modules/trio-asyncio/default.nix +++ b/pkgs/development/python-modules/trio-asyncio/default.nix @@ -39,7 +39,8 @@ buildPythonPackage rec { trio outcome sniffio - ] ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; pytestFlags = [ # RuntimeWarning: Can't run the Python asyncio tests because they're not installed diff --git a/pkgs/development/python-modules/trio-websocket/default.nix b/pkgs/development/python-modules/trio-websocket/default.nix index afcc26350ee9..9cb8b5fd1e88 100644 --- a/pkgs/development/python-modules/trio-websocket/default.nix +++ b/pkgs/development/python-modules/trio-websocket/default.nix @@ -30,7 +30,8 @@ buildPythonPackage rec { dependencies = [ trio wsproto - ] ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; nativeCheckInputs = [ pytest-trio @@ -38,27 +39,26 @@ buildPythonPackage rec { trustme ]; - disabledTests = - [ - # https://github.com/python-trio/trio-websocket/issues/187 - "test_handshake_exception_before_accept" - "test_reject_handshake" - "test_reject_handshake_invalid_info_status" - "test_client_open_timeout" - "test_client_close_timeout" - "test_client_connect_networking_error" - "test_finalization_dropped_exception" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Failed: DID NOT RAISE - "test_finalization_dropped_exception" - # Timing related - "test_client_close_timeout" - "test_cm_exit_with_pending_messages" - "test_server_close_timeout" - "test_server_handler_exit" - "test_server_open_timeout" - ]; + disabledTests = [ + # https://github.com/python-trio/trio-websocket/issues/187 + "test_handshake_exception_before_accept" + "test_reject_handshake" + "test_reject_handshake_invalid_info_status" + "test_client_open_timeout" + "test_client_close_timeout" + "test_client_connect_networking_error" + "test_finalization_dropped_exception" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Failed: DID NOT RAISE + "test_finalization_dropped_exception" + # Timing related + "test_client_close_timeout" + "test_cm_exit_with_pending_messages" + "test_server_close_timeout" + "test_server_handler_exit" + "test_server_open_timeout" + ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/trio/default.nix b/pkgs/development/python-modules/trio/default.nix index 4d12513d021f..a3f0f97008bc 100644 --- a/pkgs/development/python-modules/trio/default.nix +++ b/pkgs/development/python-modules/trio/default.nix @@ -56,7 +56,8 @@ buildPythonPackage rec { outcome sniffio sortedcontainers - ] ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ exceptiongroup ]; # tests are failing on Darwin doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/development/python-modules/triton/default.nix b/pkgs/development/python-modules/triton/default.nix index 2c8d2f9c9347..680e8321af79 100644 --- a/pkgs/development/python-modules/triton/default.nix +++ b/pkgs/development/python-modules/triton/default.nix @@ -41,25 +41,24 @@ buildPythonPackage rec { hash = "sha256-XLw7s5K0j4mfIvNMumlHkUpklSzVSTRyfGazZ4lLpn0="; }; - patches = - [ - (replaceVars ./0001-_build-allow-extra-cc-flags.patch { - ccCmdExtraFlags = "-Wl,-rpath,${addDriverRunpath.driverLink}/lib"; - }) - (replaceVars ./0002-nvidia-amd-driver-short-circuit-before-ldconfig.patch { - libhipDir = if rocmSupport then "${lib.getLib rocmPackages.clr}/lib" else null; - libcudaStubsDir = - if cudaSupport then "${lib.getOutput "stubs" cudaPackages.cuda_cudart}/lib/stubs" else null; - }) - ] - ++ lib.optionals cudaSupport [ - (replaceVars ./0003-nvidia-cudart-a-systempath.patch { - cudaToolkitIncludeDirs = "${lib.getInclude cudaPackages.cuda_cudart}/include"; - }) - (replaceVars ./0004-nvidia-allow-static-ptxas-path.patch { - nixpkgsExtraBinaryPaths = lib.escapeShellArgs [ (lib.getExe' cudaPackages.cuda_nvcc "ptxas") ]; - }) - ]; + patches = [ + (replaceVars ./0001-_build-allow-extra-cc-flags.patch { + ccCmdExtraFlags = "-Wl,-rpath,${addDriverRunpath.driverLink}/lib"; + }) + (replaceVars ./0002-nvidia-amd-driver-short-circuit-before-ldconfig.patch { + libhipDir = if rocmSupport then "${lib.getLib rocmPackages.clr}/lib" else null; + libcudaStubsDir = + if cudaSupport then "${lib.getOutput "stubs" cudaPackages.cuda_cudart}/lib/stubs" else null; + }) + ] + ++ lib.optionals cudaSupport [ + (replaceVars ./0003-nvidia-cudart-a-systempath.patch { + cudaToolkitIncludeDirs = "${lib.getInclude cudaPackages.cuda_cudart}/include"; + }) + (replaceVars ./0004-nvidia-allow-static-ptxas-path.patch { + nixpkgsExtraBinaryPaths = lib.escapeShellArgs [ (lib.getExe' cudaPackages.cuda_nvcc "ptxas") ]; + }) + ]; postPatch = '' # Use our `cmakeFlags` instead and avoid downloading dependencies @@ -128,23 +127,22 @@ buildPythonPackage rec { cd python ''; - env = - { - TRITON_BUILD_PROTON = "OFF"; - TRITON_OFFLINE_BUILD = true; - } - // lib.optionalAttrs cudaSupport { - CC = lib.getExe' cudaPackages.backendStdenv.cc "cc"; - CXX = lib.getExe' cudaPackages.backendStdenv.cc "c++"; + env = { + TRITON_BUILD_PROTON = "OFF"; + TRITON_OFFLINE_BUILD = true; + } + // lib.optionalAttrs cudaSupport { + CC = lib.getExe' cudaPackages.backendStdenv.cc "cc"; + CXX = lib.getExe' cudaPackages.backendStdenv.cc "c++"; - # TODO: Unused because of how TRITON_OFFLINE_BUILD currently works (subject to change) - TRITON_PTXAS_PATH = lib.getExe' cudaPackages.cuda_nvcc "ptxas"; # Make sure cudaPackages is the right version each update (See python/setup.py) - TRITON_CUOBJDUMP_PATH = lib.getExe' cudaPackages.cuda_cuobjdump "cuobjdump"; - TRITON_NVDISASM_PATH = lib.getExe' cudaPackages.cuda_nvdisasm "nvdisasm"; - TRITON_CUDACRT_PATH = lib.getInclude cudaPackages.cuda_nvcc; - TRITON_CUDART_PATH = lib.getInclude cudaPackages.cuda_cudart; - TRITON_CUPTI_PATH = cudaPackages.cuda_cupti; - }; + # TODO: Unused because of how TRITON_OFFLINE_BUILD currently works (subject to change) + TRITON_PTXAS_PATH = lib.getExe' cudaPackages.cuda_nvcc "ptxas"; # Make sure cudaPackages is the right version each update (See python/setup.py) + TRITON_CUOBJDUMP_PATH = lib.getExe' cudaPackages.cuda_cuobjdump "cuobjdump"; + TRITON_NVDISASM_PATH = lib.getExe' cudaPackages.cuda_nvdisasm "nvdisasm"; + TRITON_CUDACRT_PATH = lib.getInclude cudaPackages.cuda_nvcc; + TRITON_CUDART_PATH = lib.getInclude cudaPackages.cuda_cudart; + TRITON_CUPTI_PATH = cudaPackages.cuda_cupti; + }; pythonRemoveDeps = [ # Circular dependency, cf. https://github.com/triton-lang/triton/issues/1374 diff --git a/pkgs/development/python-modules/trytond/default.nix b/pkgs/development/python-modules/trytond/default.nix index 894fd5119983..19c9040d1f60 100644 --- a/pkgs/development/python-modules/trytond/default.nix +++ b/pkgs/development/python-modules/trytond/default.nix @@ -42,32 +42,31 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - defusedxml - lxml - relatorio - genshi - python-dateutil - polib - python-sql - werkzeug - passlib + dependencies = [ + defusedxml + lxml + relatorio + genshi + python-dateutil + polib + python-sql + werkzeug + passlib - # extra dependencies - pydot - levenshtein - html2text - weasyprint - gevent - pillow - pwdlib - simpleeval - ] - ++ relatorio.optional-dependencies.fodt - ++ passlib.optional-dependencies.bcrypt - ++ passlib.optional-dependencies.argon2 - ++ lib.optional withPostgresql psycopg2; + # extra dependencies + pydot + levenshtein + html2text + weasyprint + gevent + pillow + pwdlib + simpleeval + ] + ++ relatorio.optional-dependencies.fodt + ++ passlib.optional-dependencies.bcrypt + ++ passlib.optional-dependencies.argon2 + ++ lib.optional withPostgresql psycopg2; # Fontconfig error: Cannot load default config file: No such file: (null) doCheck = false; diff --git a/pkgs/development/python-modules/tsfresh/default.nix b/pkgs/development/python-modules/tsfresh/default.nix index 7f682c302c48..585368b1a017 100644 --- a/pkgs/development/python-modules/tsfresh/default.nix +++ b/pkgs/development/python-modules/tsfresh/default.nix @@ -63,7 +63,8 @@ buildPythonPackage rec { stumpy cloudpickle pywavelets - ] ++ dask.optional-dependencies.dataframe; + ] + ++ dask.optional-dependencies.dataframe; # python-datareader is disabled on Python 3.12+ and is require only for checks. doCheck = !pandas-datareader.disabled; @@ -80,25 +81,24 @@ buildPythonPackage rec { pandas-datareader ]; - disabledTests = - [ - # touches network - "test_relevant_extraction" - "test_characteristics_downloaded_robot_execution_failures" - "test_index" - "test_binary_target_is_default" - "test_characteristics_downloaded_robot_execution_failures" - "test_extraction_runs_through" - "test_multilabel_target_on_request" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # RuntimeError: Cluster failed to start: [Errno 1] Operation not permitted - # may require extra privileges on darwin - "test_local_dask_cluster_extraction_one_worker" - "test_local_dask_cluster_extraction_two_worker" - "test_dask_cluster_extraction_one_worker" - "test_dask_cluster_extraction_two_workers" - ]; + disabledTests = [ + # touches network + "test_relevant_extraction" + "test_characteristics_downloaded_robot_execution_failures" + "test_index" + "test_binary_target_is_default" + "test_characteristics_downloaded_robot_execution_failures" + "test_extraction_runs_through" + "test_multilabel_target_on_request" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # RuntimeError: Cluster failed to start: [Errno 1] Operation not permitted + # may require extra privileges on darwin + "test_local_dask_cluster_extraction_one_worker" + "test_local_dask_cluster_extraction_two_worker" + "test_dask_cluster_extraction_one_worker" + "test_dask_cluster_extraction_two_workers" + ]; pythonImportsCheck = [ "tsfresh" ]; diff --git a/pkgs/development/python-modules/ttfautohint-py/default.nix b/pkgs/development/python-modules/ttfautohint-py/default.nix index b99908f2bda3..9e43acab06b9 100644 --- a/pkgs/development/python-modules/ttfautohint-py/default.nix +++ b/pkgs/development/python-modules/ttfautohint-py/default.nix @@ -23,15 +23,14 @@ buildPythonPackage rec { hash = "sha256-NTog461RpyHKo/Qpicj3tflehaKj9LlZEN9qeCMM6JQ="; }; - postPatch = - '' - substituteInPlace src/python/ttfautohint/__init__.py \ - --replace-fail 'find_library("ttfautohint")' '"${lib.getLib ttfautohint}/lib/libttfautohint${stdenv.hostPlatform.extensions.sharedLibrary}"' - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace src/python/ttfautohint/memory.py \ - --replace-fail 'find_library("c")' '"${lib.getLib stdenv.cc.libc}/lib/libc.so.6"' - ''; + postPatch = '' + substituteInPlace src/python/ttfautohint/__init__.py \ + --replace-fail 'find_library("ttfautohint")' '"${lib.getLib ttfautohint}/lib/libttfautohint${stdenv.hostPlatform.extensions.sharedLibrary}"' + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace src/python/ttfautohint/memory.py \ + --replace-fail 'find_library("c")' '"${lib.getLib stdenv.cc.libc}/lib/libc.so.6"' + ''; env.TTFAUTOHINTPY_BUNDLE_DLL = false; diff --git a/pkgs/development/python-modules/tuf/default.nix b/pkgs/development/python-modules/tuf/default.nix index a23caeae9827..d8245d540bb6 100644 --- a/pkgs/development/python-modules/tuf/default.nix +++ b/pkgs/development/python-modules/tuf/default.nix @@ -28,13 +28,12 @@ buildPythonPackage rec { hatchling ]; - dependencies = - [ - requests - securesystemslib - ] - ++ securesystemslib.optional-dependencies.pynacl - ++ securesystemslib.optional-dependencies.crypto; + dependencies = [ + requests + securesystemslib + ] + ++ securesystemslib.optional-dependencies.pynacl + ++ securesystemslib.optional-dependencies.crypto; __darwinAllowLocalNetworking = true; diff --git a/pkgs/development/python-modules/tweepy/default.nix b/pkgs/development/python-modules/tweepy/default.nix index 24f7471819a8..975136a2fec9 100644 --- a/pkgs/development/python-modules/tweepy/default.nix +++ b/pkgs/development/python-modules/tweepy/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook vcrpy - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "tweepy" ]; diff --git a/pkgs/development/python-modules/twine/default.nix b/pkgs/development/python-modules/twine/default.nix index 65f53fb7d6b0..070e7d675e89 100644 --- a/pkgs/development/python-modules/twine/default.nix +++ b/pkgs/development/python-modules/twine/default.nix @@ -38,22 +38,21 @@ buildPythonPackage rec { setuptools-scm ]; - dependencies = - [ - id - keyring - packaging - pkginfo - readme-renderer - requests - requests-toolbelt - rfc3986 - rich - urllib3 - ] - ++ lib.optionals (pythonOlder "3.10") [ - importlib-metadata - ]; + dependencies = [ + id + keyring + packaging + pkginfo + readme-renderer + requests + requests-toolbelt + rfc3986 + rich + urllib3 + ] + ++ lib.optionals (pythonOlder "3.10") [ + importlib-metadata + ]; nativeCheckInputs = [ build diff --git a/pkgs/development/python-modules/twisted/default.nix b/pkgs/development/python-modules/twisted/default.nix index e6d853fe2314..4274fe5e05d2 100644 --- a/pkgs/development/python-modules/twisted/default.nix +++ b/pkgs/development/python-modules/twisted/default.nix @@ -86,94 +86,93 @@ buildPythonPackage rec { postPatch = let - skippedTests = - { - "src/twisted/conch/test/test_cftp.py" = [ - # timezone issues - "ListingTests.test_localeIndependent" - "ListingTests.test_newSingleDigitDayOfMonth" - "ListingTests.test_oldFile" - "ListingTests.test_oldSingleDigitDayOfMonth" - "ListingTests.test_newFile" - ]; - "src/twisted/test/test_log.py" = [ - # wrong timezone offset calculation - "FileObserverTests.test_getTimezoneOffsetEastOfUTC" - "FileObserverTests.test_getTimezoneOffsetWestOfUTC" - "FileObserverTests.test_getTimezoneOffsetWithoutDaylightSavingTime" - ]; - "src/twisted/test/test_udp.py" = [ - # "No such device" (No multicast support in the build sandbox) - "MulticastTests.test_joinLeave" - "MulticastTests.test_loopback" - "MulticastTests.test_multicast" - "MulticastTests.test_multiListen" - ]; - "src/twisted/trial/test/test_script.py" = [ - # Fails in LXC containers with less than all cores available (limits.cpu) - "AutoJobsTests.test_cpuCount" - ]; - "src/twisted/internet/test/test_unix.py" = [ - # flaky? - "UNIXTestsBuilder.test_sendFileDescriptorTriggersPauseProducing" - ]; - } - // lib.optionalAttrs (pythonAtLeast "3.12") { - "src/twisted/trial/_dist/test/test_workerreporter.py" = [ - "WorkerReporterTests.test_addSkipPyunit" - ]; - "src/twisted/trial/_dist/test/test_worker.py" = [ - "LocalWorkerAMPTests.test_runSkip" - ]; - } - // lib.optionalAttrs (pythonOlder "3.13") { - # missing ciphers in the crypt module due to libxcrypt - "src/twisted/web/test/test_tap.py" = [ - "ServiceTests.test_HTTPSFailureOnMissingSSL" - "ServiceTests.test_HTTPSFailureOnMissingSSL" - ]; - "src/twisted/conch/test/test_checkers.py" = [ - "HelperTests.test_refuteCryptedPassword" - "HelperTests.test_verifyCryptedPassword" - "HelperTests.test_verifyCryptedPasswordMD5" - "UNIXPasswordDatabaseTests.test_defaultCheckers" - "UNIXPasswordDatabaseTests.test_passInCheckers" - ]; - "src/twisted/cred/test/test_strcred.py" = [ - "UnixCheckerTests.test_isChecker" - "UnixCheckerTests.test_unixCheckerFailsPassword" - "UnixCheckerTests.test_unixCheckerFailsPasswordBytes" - "UnixCheckerTests.test_unixCheckerFailsUsername" - "UnixCheckerTests.test_unixCheckerFailsUsernameBytes" - "UnixCheckerTests.test_unixCheckerSucceeds" - "UnixCheckerTests.test_unixCheckerSucceedsBytes" - "CryptTests.test_verifyCryptedPassword" - "CryptTests.test_verifyCryptedPasswordOSError" - ]; - # dependant on UnixCheckerTests.test_isChecker - "src/twisted/cred/test/test_cred.py" = [ - "HashedPasswordOnDiskDatabaseTests.testBadCredentials" - "HashedPasswordOnDiskDatabaseTests.testGoodCredentials" - "HashedPasswordOnDiskDatabaseTests.testGoodCredentials_login" - "HashedPasswordOnDiskDatabaseTests.testHashedCredentials" - ]; - } - // lib.optionalAttrs (pythonAtLeast "3.13") { - "src/twisted/web/test/test_flatten.py" = [ - "FlattenerErrorTests.test_asynchronousFlattenError" - "FlattenerErrorTests.test_cancel" - ]; - } - // lib.optionalAttrs stdenv.hostPlatform.isDarwin { - "src/twisted/internet/test/test_process.py" = [ - # invalid syntaax - "ProcessTestsBuilder_AsyncioSelectorReactorTests.test_openFileDescriptors" - "ProcessTestsBuilder_SelectReactorTests.test_openFileDescriptors" - # exit code 120 - "ProcessTestsBuilder_AsyncioSelectorReactorTests.test_processEnded" - "ProcessTestsBuilder_SelectReactorTests.test_processEnded" - ]; - }; + skippedTests = { + "src/twisted/conch/test/test_cftp.py" = [ + # timezone issues + "ListingTests.test_localeIndependent" + "ListingTests.test_newSingleDigitDayOfMonth" + "ListingTests.test_oldFile" + "ListingTests.test_oldSingleDigitDayOfMonth" + "ListingTests.test_newFile" + ]; + "src/twisted/test/test_log.py" = [ + # wrong timezone offset calculation + "FileObserverTests.test_getTimezoneOffsetEastOfUTC" + "FileObserverTests.test_getTimezoneOffsetWestOfUTC" + "FileObserverTests.test_getTimezoneOffsetWithoutDaylightSavingTime" + ]; + "src/twisted/test/test_udp.py" = [ + # "No such device" (No multicast support in the build sandbox) + "MulticastTests.test_joinLeave" + "MulticastTests.test_loopback" + "MulticastTests.test_multicast" + "MulticastTests.test_multiListen" + ]; + "src/twisted/trial/test/test_script.py" = [ + # Fails in LXC containers with less than all cores available (limits.cpu) + "AutoJobsTests.test_cpuCount" + ]; + "src/twisted/internet/test/test_unix.py" = [ + # flaky? + "UNIXTestsBuilder.test_sendFileDescriptorTriggersPauseProducing" + ]; + } + // lib.optionalAttrs (pythonAtLeast "3.12") { + "src/twisted/trial/_dist/test/test_workerreporter.py" = [ + "WorkerReporterTests.test_addSkipPyunit" + ]; + "src/twisted/trial/_dist/test/test_worker.py" = [ + "LocalWorkerAMPTests.test_runSkip" + ]; + } + // lib.optionalAttrs (pythonOlder "3.13") { + # missing ciphers in the crypt module due to libxcrypt + "src/twisted/web/test/test_tap.py" = [ + "ServiceTests.test_HTTPSFailureOnMissingSSL" + "ServiceTests.test_HTTPSFailureOnMissingSSL" + ]; + "src/twisted/conch/test/test_checkers.py" = [ + "HelperTests.test_refuteCryptedPassword" + "HelperTests.test_verifyCryptedPassword" + "HelperTests.test_verifyCryptedPasswordMD5" + "UNIXPasswordDatabaseTests.test_defaultCheckers" + "UNIXPasswordDatabaseTests.test_passInCheckers" + ]; + "src/twisted/cred/test/test_strcred.py" = [ + "UnixCheckerTests.test_isChecker" + "UnixCheckerTests.test_unixCheckerFailsPassword" + "UnixCheckerTests.test_unixCheckerFailsPasswordBytes" + "UnixCheckerTests.test_unixCheckerFailsUsername" + "UnixCheckerTests.test_unixCheckerFailsUsernameBytes" + "UnixCheckerTests.test_unixCheckerSucceeds" + "UnixCheckerTests.test_unixCheckerSucceedsBytes" + "CryptTests.test_verifyCryptedPassword" + "CryptTests.test_verifyCryptedPasswordOSError" + ]; + # dependant on UnixCheckerTests.test_isChecker + "src/twisted/cred/test/test_cred.py" = [ + "HashedPasswordOnDiskDatabaseTests.testBadCredentials" + "HashedPasswordOnDiskDatabaseTests.testGoodCredentials" + "HashedPasswordOnDiskDatabaseTests.testGoodCredentials_login" + "HashedPasswordOnDiskDatabaseTests.testHashedCredentials" + ]; + } + // lib.optionalAttrs (pythonAtLeast "3.13") { + "src/twisted/web/test/test_flatten.py" = [ + "FlattenerErrorTests.test_asynchronousFlattenError" + "FlattenerErrorTests.test_cancel" + ]; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + "src/twisted/internet/test/test_process.py" = [ + # invalid syntaax + "ProcessTestsBuilder_AsyncioSelectorReactorTests.test_openFileDescriptors" + "ProcessTestsBuilder_SelectReactorTests.test_openFileDescriptors" + # exit code 120 + "ProcessTestsBuilder_AsyncioSelectorReactorTests.test_processEnded" + "ProcessTestsBuilder_SelectReactorTests.test_processEnded" + ]; + }; in lib.concatStringsSep "\n" ( lib.mapAttrsToList ( @@ -194,16 +193,15 @@ buildPythonPackage rec { $out/bin/twistd --help > /dev/null ''; - nativeCheckInputs = - [ - git - glibcLocales - ] - ++ optional-dependencies.test - ++ optional-dependencies.conch - ++ optional-dependencies.http2 - ++ optional-dependencies.serial - ++ optional-dependencies.tls; + nativeCheckInputs = [ + git + glibcLocales + ] + ++ optional-dependencies.test + ++ optional-dependencies.conch + ++ optional-dependencies.http2 + ++ optional-dependencies.serial + ++ optional-dependencies.tls; preCheck = '' export SOURCE_DATE_EPOCH=315532800 @@ -233,7 +231,8 @@ buildPythonPackage rec { pyhamcrest hypothesis httpx - ] ++ httpx.optional-dependencies.http2; + ] + ++ httpx.optional-dependencies.http2; tls = [ idna pyopenssl diff --git a/pkgs/development/python-modules/txredisapi/default.nix b/pkgs/development/python-modules/txredisapi/default.nix index a3c64f64ee83..b91e6927d306 100644 --- a/pkgs/development/python-modules/txredisapi/default.nix +++ b/pkgs/development/python-modules/txredisapi/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ six twisted - ] ++ twisted.optional-dependencies.tls; + ] + ++ twisted.optional-dependencies.tls; pythonImportsCheck = [ "txredisapi" ]; diff --git a/pkgs/development/python-modules/txtai/default.nix b/pkgs/development/python-modules/txtai/default.nix index 888124f28ecb..8f58b0d0a3e7 100644 --- a/pkgs/development/python-modules/txtai/default.nix +++ b/pkgs/development/python-modules/txtai/default.nix @@ -276,19 +276,18 @@ buildPythonPackage { pythonImportsCheck = [ "txtai" ]; - nativeCheckInputs = - [ - httpx - msgpack - pytestCheckHook - python-multipart - timm - sqlalchemy - ] - ++ optional-dependencies.agent - ++ optional-dependencies.ann - ++ optional-dependencies.api - ++ optional-dependencies.similarity; + nativeCheckInputs = [ + httpx + msgpack + pytestCheckHook + python-multipart + timm + sqlalchemy + ] + ++ optional-dependencies.agent + ++ optional-dependencies.ann + ++ optional-dependencies.api + ++ optional-dependencies.similarity; # The deselected paths depend on the huggingface hub and should be run as a passthru test # disabledTestPaths won't work as the problem is with the classes containing the tests diff --git a/pkgs/development/python-modules/txtorcon/default.nix b/pkgs/development/python-modules/txtorcon/default.nix index 66329d3b0985..81ff771af7f8 100644 --- a/pkgs/development/python-modules/txtorcon/default.nix +++ b/pkgs/development/python-modules/txtorcon/default.nix @@ -34,7 +34,8 @@ buildPythonPackage rec { twisted automat zope-interface - ] ++ twisted.optional-dependencies.tls; + ] + ++ twisted.optional-dependencies.tls; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/typed-settings/default.nix b/pkgs/development/python-modules/typed-settings/default.nix index a9ca8f0853ce..2e37f4f02ac1 100644 --- a/pkgs/development/python-modules/typed-settings/default.nix +++ b/pkgs/development/python-modules/typed-settings/default.nix @@ -58,16 +58,15 @@ buildPythonPackage rec { nativeBuildInputs = [ hatch-vcs ]; - nativeCheckInputs = - [ - hypothesis - pytest-cov-stub - pytestCheckHook - rich-click - sybil - ] - ++ (lib.optional (pythonOlder "3.11") typing-extensions) - ++ (lib.flatten (lib.attrValues optional-dependencies)); + nativeCheckInputs = [ + hypothesis + pytest-cov-stub + pytestCheckHook + rich-click + sybil + ] + ++ (lib.optional (pythonOlder "3.11") typing-extensions) + ++ (lib.flatten (lib.attrValues optional-dependencies)); enabledTestPaths = [ "tests" ]; diff --git a/pkgs/development/python-modules/typeguard/default.nix b/pkgs/development/python-modules/typeguard/default.nix index 15d06f3946cc..4873e61061da 100644 --- a/pkgs/development/python-modules/typeguard/default.nix +++ b/pkgs/development/python-modules/typeguard/default.nix @@ -43,7 +43,8 @@ buildPythonPackage rec { dependencies = [ typing-extensions - ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; env.LC_ALL = "en_US.utf-8"; diff --git a/pkgs/development/python-modules/typepy/default.nix b/pkgs/development/python-modules/typepy/default.nix index 1e5e8b2f7059..c4979dc6ac86 100644 --- a/pkgs/development/python-modules/typepy/default.nix +++ b/pkgs/development/python-modules/typepy/default.nix @@ -41,7 +41,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook tcolorpy - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "typepy" ]; diff --git a/pkgs/development/python-modules/typer/default.nix b/pkgs/development/python-modules/typer/default.nix index 2f6da0bfae78..044cda773072 100644 --- a/pkgs/development/python-modules/typer/default.nix +++ b/pkgs/development/python-modules/typer/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { typing-extensions # Build includes the standard optional by default # https://github.com/tiangolo/typer/blob/0.12.3/pyproject.toml#L71-L72 - ] ++ optional-dependencies.standard; + ] + ++ optional-dependencies.standard; optional-dependencies = { standard = [ @@ -51,28 +52,26 @@ buildPythonPackage rec { ]; }; - nativeCheckInputs = - [ - coverage # execs coverage in tests - pytest-xdist - pytestCheckHook - writableTmpDirAsHomeHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - procps - ]; + nativeCheckInputs = [ + coverage # execs coverage in tests + pytest-xdist + pytestCheckHook + writableTmpDirAsHomeHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + procps + ]; - disabledTests = - [ - "test_scripts" - # Likely related to https://github.com/sarugaku/shellingham/issues/35 - # fails also on Linux - "test_show_completion" - "test_install_completion" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - "test_install_completion" - ]; + disabledTests = [ + "test_scripts" + # Likely related to https://github.com/sarugaku/shellingham/issues/35 + # fails also on Linux + "test_show_completion" + "test_install_completion" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + "test_install_completion" + ]; pythonImportsCheck = [ "typer" ]; diff --git a/pkgs/development/python-modules/types-aiobotocore-packages/default.nix b/pkgs/development/python-modules/types-aiobotocore-packages/default.nix index dcbd9ee10392..6cde7b94c141 100644 --- a/pkgs/development/python-modules/types-aiobotocore-packages/default.nix +++ b/pkgs/development/python-modules/types-aiobotocore-packages/default.nix @@ -43,7 +43,8 @@ let aiobotocore boto3 botocore - ] ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.12") [ typing-extensions ]; # Module has no tests doCheck = false; diff --git a/pkgs/development/python-modules/types-lxml/default.nix b/pkgs/development/python-modules/types-lxml/default.nix index a0e03f05ca78..270dac5caa1d 100644 --- a/pkgs/development/python-modules/types-lxml/default.nix +++ b/pkgs/development/python-modules/types-lxml/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { pytestCheckHook typeguard urllib3 - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "lxml-stubs" ]; diff --git a/pkgs/development/python-modules/tzdata/default.nix b/pkgs/development/python-modules/tzdata/default.nix index f22fdb1e091a..c9510654637f 100644 --- a/pkgs/development/python-modules/tzdata/default.nix +++ b/pkgs/development/python-modules/tzdata/default.nix @@ -24,7 +24,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-subtests - ] ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ]; + ] + ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ]; pythonImportsCheck = [ "tzdata" ]; diff --git a/pkgs/development/python-modules/tzlocal/default.nix b/pkgs/development/python-modules/tzlocal/default.nix index 6f100cfb5a7a..3ad58df8776d 100644 --- a/pkgs/development/python-modules/tzlocal/default.nix +++ b/pkgs/development/python-modules/tzlocal/default.nix @@ -33,7 +33,8 @@ buildPythonPackage rec { "test_conflicting" "test_noconflict" "test_symlink_localtime" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "test_assert_tz_offset"; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "test_assert_tz_offset"; pythonImportsCheck = [ "tzlocal" ]; diff --git a/pkgs/development/python-modules/ufmt/default.nix b/pkgs/development/python-modules/ufmt/default.nix index 13237ffd853b..7f55664ad786 100644 --- a/pkgs/development/python-modules/ufmt/default.nix +++ b/pkgs/development/python-modules/ufmt/default.nix @@ -51,7 +51,8 @@ buildPythonPackage rec { nativeCheckInputs = [ unittestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "ufmt" ]; diff --git a/pkgs/development/python-modules/ufo2ft/default.nix b/pkgs/development/python-modules/ufo2ft/default.nix index f7a06df6ebbc..a7b85b658083 100644 --- a/pkgs/development/python-modules/ufo2ft/default.nix +++ b/pkgs/development/python-modules/ufo2ft/default.nix @@ -35,20 +35,19 @@ buildPythonPackage rec { pythonRelaxDeps = [ "cffsubr" ]; - dependencies = - [ - cu2qu - fontmath - fonttools - defcon - compreffor - booleanoperations - cffsubr - ufolib2 - skia-pathops - ] - ++ fonttools.optional-dependencies.lxml - ++ fonttools.optional-dependencies.ufo; + dependencies = [ + cu2qu + fontmath + fonttools + defcon + compreffor + booleanoperations + cffsubr + ufolib2 + skia-pathops + ] + ++ fonttools.optional-dependencies.lxml + ++ fonttools.optional-dependencies.ufo; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/ufolib2/default.nix b/pkgs/development/python-modules/ufolib2/default.nix index 534cc635a5fb..6597a46dabeb 100644 --- a/pkgs/development/python-modules/ufolib2/default.nix +++ b/pkgs/development/python-modules/ufolib2/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { dependencies = [ attrs fonttools - ] ++ fonttools.optional-dependencies.ufo; + ] + ++ fonttools.optional-dependencies.ufo; optional-dependencies = { lxml = [ lxml ]; @@ -48,7 +49,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "ufoLib2" ]; diff --git a/pkgs/development/python-modules/ufoprocessor/default.nix b/pkgs/development/python-modules/ufoprocessor/default.nix index 123ba62afdfd..e848536d8c60 100644 --- a/pkgs/development/python-modules/ufoprocessor/default.nix +++ b/pkgs/development/python-modules/ufoprocessor/default.nix @@ -24,17 +24,16 @@ buildPythonPackage rec { build-system = [ setuptools-scm ]; - dependencies = - [ - defcon - fontmath - fontparts - fonttools - mutatormath - ] - ++ defcon.optional-dependencies.lxml - ++ fonttools.optional-dependencies.lxml - ++ fonttools.optional-dependencies.ufo; + dependencies = [ + defcon + fontmath + fontparts + fonttools + mutatormath + ] + ++ defcon.optional-dependencies.lxml + ++ fonttools.optional-dependencies.lxml + ++ fonttools.optional-dependencies.ufo; checkPhase = '' runHook preCheck diff --git a/pkgs/development/python-modules/ultralytics/default.nix b/pkgs/development/python-modules/ultralytics/default.nix index 2056c41979f8..926844ac46f6 100644 --- a/pkgs/development/python-modules/ultralytics/default.nix +++ b/pkgs/development/python-modules/ultralytics/default.nix @@ -80,43 +80,42 @@ buildPythonPackage rec { "tests/test_python.py" ]; - disabledTests = - [ - # also remove the individual tests that require internet - "test_all_model_yamls" - "test_data_annotator" - "test_labels_and_crops" - "test_model_embeddings" - "test_model_methods" - "test_predict_callback_and_setup" - "test_predict_grey_and_4ch" - "test_predict_img" - "test_predict_txt" - "test_predict_visualize" - "test_results" - "test_train_pretrained" - "test_train_scratch" - "test_utils_torchutils" - "test_val" - "test_workflow" - "test_yolo_world" - "test_yolov10" - "test_yoloe" - "test_multichannel" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Fatal Python error: Aborted - # onnxruntime/capi/_pybind_state.py", line 32 in - "test_utils_benchmarks" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Fatal Python error: Aborted - # ultralytics/utils/checks.py", line 598 in check_imshow - "test_utils_checks" + disabledTests = [ + # also remove the individual tests that require internet + "test_all_model_yamls" + "test_data_annotator" + "test_labels_and_crops" + "test_model_embeddings" + "test_model_methods" + "test_predict_callback_and_setup" + "test_predict_grey_and_4ch" + "test_predict_img" + "test_predict_txt" + "test_predict_visualize" + "test_results" + "test_train_pretrained" + "test_train_scratch" + "test_utils_torchutils" + "test_val" + "test_workflow" + "test_yolo_world" + "test_yolov10" + "test_yoloe" + "test_multichannel" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Fatal Python error: Aborted + # onnxruntime/capi/_pybind_state.py", line 32 in + "test_utils_benchmarks" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Fatal Python error: Aborted + # ultralytics/utils/checks.py", line 598 in check_imshow + "test_utils_checks" - # RuntimeError: required keyword attribute 'value' has the wrong type - "test_utils_benchmarks" - ]; + # RuntimeError: required keyword attribute 'value' has the wrong type + "test_utils_benchmarks" + ]; meta = { homepage = "https://github.com/ultralytics/ultralytics"; diff --git a/pkgs/development/python-modules/uncertainties/default.nix b/pkgs/development/python-modules/uncertainties/default.nix index 89b03edc4b9d..a54accfa3516 100644 --- a/pkgs/development/python-modules/uncertainties/default.nix +++ b/pkgs/development/python-modules/uncertainties/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ optional-dependencies.arrays; + ] + ++ optional-dependencies.arrays; pythonImportsCheck = [ "uncertainties" ]; diff --git a/pkgs/development/python-modules/universal-silabs-flasher/default.nix b/pkgs/development/python-modules/universal-silabs-flasher/default.nix index e4f1d582f328..285db38955a9 100644 --- a/pkgs/development/python-modules/universal-silabs-flasher/default.nix +++ b/pkgs/development/python-modules/universal-silabs-flasher/default.nix @@ -46,18 +46,17 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - bellows - click - coloredlogs - crc - pyserial-asyncio-fast - typing-extensions - zigpy - ] - ++ lib.optionals (pythonOlder "3.11") [ async-timeout ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ libgpiod ]; + dependencies = [ + bellows + click + coloredlogs + crc + pyserial-asyncio-fast + typing-extensions + zigpy + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ libgpiod ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/unstructured-api-tools/default.nix b/pkgs/development/python-modules/unstructured-api-tools/default.nix index 6413392c7163..af5d0dc4c553 100644 --- a/pkgs/development/python-modules/unstructured-api-tools/default.nix +++ b/pkgs/development/python-modules/unstructured-api-tools/default.nix @@ -57,7 +57,8 @@ buildPythonPackage { types-ujson uvicorn autoflake - ] ++ uvicorn.optional-dependencies.standard; + ] + ++ uvicorn.optional-dependencies.standard; pythonImportsCheck = [ "unstructured_api_tools" ]; diff --git a/pkgs/development/python-modules/unstructured-inference/default.nix b/pkgs/development/python-modules/unstructured-inference/default.nix index e21dadc0743b..ef47a94a811a 100644 --- a/pkgs/development/python-modules/unstructured-inference/default.nix +++ b/pkgs/development/python-modules/unstructured-inference/default.nix @@ -33,20 +33,19 @@ buildPythonPackage rec { hash = "sha256-wRFTwSvkPdvvB08qGOvn8lrbUuoXF6yPqNSk9iiB1S8="; }; - propagatedBuildInputs = - [ - layoutparser - python-multipart - huggingface-hub - opencv-python - onnxruntime - transformers - # detectron2 # fails to build - # paddleocr # 3.12 not yet supported - # yolox - ] - ++ layoutparser.optional-dependencies.layoutmodels - ++ layoutparser.optional-dependencies.tesseract; + propagatedBuildInputs = [ + layoutparser + python-multipart + huggingface-hub + opencv-python + onnxruntime + transformers + # detectron2 # fails to build + # paddleocr # 3.12 not yet supported + # yolox + ] + ++ layoutparser.optional-dependencies.layoutmodels + ++ layoutparser.optional-dependencies.tesseract; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/uqbar/default.nix b/pkgs/development/python-modules/uqbar/default.nix index 63eaa24ab4fb..68eca27e0128 100644 --- a/pkgs/development/python-modules/uqbar/default.nix +++ b/pkgs/development/python-modules/uqbar/default.nix @@ -44,26 +44,25 @@ buildPythonPackage rec { typing-extensions ]; - disabledTests = - [ - # UnboundLocalError: local variable 'output_path' referenced before assignment - "test_01" - # AssertionError: assert False - "test_sphinx_book_html_cached" - # FileNotFoundError: [Errno 2] No such file or directory: 'unflatten' - "test_sphinx_style_html" - # assert not ["\x1b[91mWARNING: dot command 'dot' cannot be run (needed for - # graphviz output), check the graphviz_dot setting\x1b[39;49;00m"] - "test_sphinx_style_latex" - ] - ++ lib.optional (pythonAtLeast "3.11") [ - # assert not '\x1b[91m/build/uqbar-0.7.0/tests/fake_package/enums.py:docstring - "test_sphinx_style" - ] - ++ lib.optional (pythonAtLeast "3.12") [ - # https://github.com/josiah-wolf-oberholtzer/uqbar/issues/93 - "objects.get_vars" - ]; + disabledTests = [ + # UnboundLocalError: local variable 'output_path' referenced before assignment + "test_01" + # AssertionError: assert False + "test_sphinx_book_html_cached" + # FileNotFoundError: [Errno 2] No such file or directory: 'unflatten' + "test_sphinx_style_html" + # assert not ["\x1b[91mWARNING: dot command 'dot' cannot be run (needed for + # graphviz output), check the graphviz_dot setting\x1b[39;49;00m"] + "test_sphinx_style_latex" + ] + ++ lib.optional (pythonAtLeast "3.11") [ + # assert not '\x1b[91m/build/uqbar-0.7.0/tests/fake_package/enums.py:docstring + "test_sphinx_style" + ] + ++ lib.optional (pythonAtLeast "3.12") [ + # https://github.com/josiah-wolf-oberholtzer/uqbar/issues/93 + "objects.get_vars" + ]; pythonImportsCheck = [ "uqbar" ]; diff --git a/pkgs/development/python-modules/urllib3/default.nix b/pkgs/development/python-modules/urllib3/default.nix index 659ce03e2b85..624db352750b 100644 --- a/pkgs/development/python-modules/urllib3/default.nix +++ b/pkgs/development/python-modules/urllib3/default.nix @@ -48,7 +48,8 @@ let pytestCheckHook tornado trustme - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); # Tests in urllib3 are mostly timeout-based instead of event-based and # are therefore inherently flaky. On your own machine, the tests will diff --git a/pkgs/development/python-modules/urwid/default.nix b/pkgs/development/python-modules/urwid/default.nix index bde14cb87407..950606c53d01 100644 --- a/pkgs/development/python-modules/urwid/default.nix +++ b/pkgs/development/python-modules/urwid/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { nativeCheckInputs = [ glibcLocales pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); env.LC_ALL = "en_US.UTF8"; diff --git a/pkgs/development/python-modules/uvicorn/default.nix b/pkgs/development/python-modules/uvicorn/default.nix index f9a95d3fe3d1..cb436823f6ad 100644 --- a/pkgs/development/python-modules/uvicorn/default.nix +++ b/pkgs/development/python-modules/uvicorn/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { dependencies = [ click h11 - ] ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ typing-extensions ]; optional-dependencies.standard = [ httptools diff --git a/pkgs/development/python-modules/uvicorn/tests.nix b/pkgs/development/python-modules/uvicorn/tests.nix index 62fc83d21fb1..33eb1564aa76 100644 --- a/pkgs/development/python-modules/uvicorn/tests.nix +++ b/pkgs/development/python-modules/uvicorn/tests.nix @@ -34,7 +34,8 @@ buildPythonPackage { a2wsgi watchgod wsproto - ] ++ uvicorn.optional-dependencies.standard; + ] + ++ uvicorn.optional-dependencies.standard; doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/development/python-modules/uvloop/default.nix b/pkgs/development/python-modules/uvloop/default.nix index 4814c6bbcd34..cda85ed6c226 100644 --- a/pkgs/development/python-modules/uvloop/default.nix +++ b/pkgs/development/python-modules/uvloop/default.nix @@ -67,44 +67,42 @@ buildPythonPackage rec { psutil ]; - pytestFlagsArray = - [ - # Tries to run "env", but fails to find it, even with coreutils provided - "--deselect=tests/test_process.py::Test_UV_Process::test_process_env_2" - "--deselect=tests/test_process.py::Test_AIO_Process::test_process_env_2" - # AssertionError: b'' != b'out\n' - "--deselect=tests/test_process.py::Test_UV_Process::test_process_streams_redirect" - "--deselect=tests/test_process.py::Test_AIO_Process::test_process_streams_redirect" - # Depends on performance of builder - "--deselect=tests/test_base.py::TestBaseUV.test_call_at" - # Pointless and flaky (at least on darwin, depending on the sandbox perhaps) - "--deselect=tests/test_dns.py" - ] - ++ lib.optionals (pythonOlder "3.11") [ - "--deselect=tests/test_tcp.py::Test_UV_TCPSSL::test_create_connection_ssl_failed_certificat" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # Segmentation fault - "--deselect=tests/test_fs_event.py::Test_UV_FS_EVENT_RENAME::test_fs_event_rename" - # Broken: https://github.com/NixOS/nixpkgs/issues/160904 - "--deselect=tests/test_context.py::Test_UV_Context::test_create_ssl_server_manual_connection_lost" - ]; + pytestFlagsArray = [ + # Tries to run "env", but fails to find it, even with coreutils provided + "--deselect=tests/test_process.py::Test_UV_Process::test_process_env_2" + "--deselect=tests/test_process.py::Test_AIO_Process::test_process_env_2" + # AssertionError: b'' != b'out\n' + "--deselect=tests/test_process.py::Test_UV_Process::test_process_streams_redirect" + "--deselect=tests/test_process.py::Test_AIO_Process::test_process_streams_redirect" + # Depends on performance of builder + "--deselect=tests/test_base.py::TestBaseUV.test_call_at" + # Pointless and flaky (at least on darwin, depending on the sandbox perhaps) + "--deselect=tests/test_dns.py" + ] + ++ lib.optionals (pythonOlder "3.11") [ + "--deselect=tests/test_tcp.py::Test_UV_TCPSSL::test_create_connection_ssl_failed_certificat" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # Segmentation fault + "--deselect=tests/test_fs_event.py::Test_UV_FS_EVENT_RENAME::test_fs_event_rename" + # Broken: https://github.com/NixOS/nixpkgs/issues/160904 + "--deselect=tests/test_context.py::Test_UV_Context::test_create_ssl_server_manual_connection_lost" + ]; disabledTestPaths = [ # ignore code linting tests "tests/test_sourcecode.py" ]; - preCheck = - '' - # force using installed/compiled uvloop - rm -rf uvloop - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Work around "OSError: AF_UNIX path too long" - # https://github.com/MagicStack/uvloop/issues/463 - export TMPDIR="/tmp" - ''; + preCheck = '' + # force using installed/compiled uvloop + rm -rf uvloop + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Work around "OSError: AF_UNIX path too long" + # https://github.com/MagicStack/uvloop/issues/463 + export TMPDIR="/tmp" + ''; pythonImportsCheck = [ "uvloop" diff --git a/pkgs/development/python-modules/valkey/default.nix b/pkgs/development/python-modules/valkey/default.nix index 25cac9c152b2..ed774e51238e 100644 --- a/pkgs/development/python-modules/valkey/default.nix +++ b/pkgs/development/python-modules/valkey/default.nix @@ -73,23 +73,23 @@ buildPythonPackage rec { redisTestHook ujson uvloop - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pytestFlagsArray = [ "-m 'not onlycluster and not ssl'" ]; - disabledTests = - [ - # valkey.sentinel.MasterNotFoundError: No master found for 'valkey-py-test' - "test_get_from_cache" - "test_cache_decode_response" - # Expects another valkey instance on port 6380 *shrug* - "test_psync" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # OSError: AF_UNIX path too long - "test_uds_connect" - "test_network_connection_failure" - ]; + disabledTests = [ + # valkey.sentinel.MasterNotFoundError: No master found for 'valkey-py-test' + "test_get_from_cache" + "test_cache_decode_response" + # Expects another valkey instance on port 6380 *shrug* + "test_psync" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # OSError: AF_UNIX path too long + "test_uds_connect" + "test_network_connection_failure" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # AttributeError: Can't get local object 'TestMultiprocessing.test_valkey_client..target' diff --git a/pkgs/development/python-modules/vbuild/default.nix b/pkgs/development/python-modules/vbuild/default.nix index 4ed92013e018..e54f584ad896 100644 --- a/pkgs/development/python-modules/vbuild/default.nix +++ b/pkgs/development/python-modules/vbuild/default.nix @@ -39,15 +39,14 @@ buildPythonPackage rec { pythonImportsCheck = [ "vbuild" ]; - disabledTests = - [ - # Tests require network access - "test_min" - "test_pycomp_onlineClosurable" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - "test_ok" - ]; + disabledTests = [ + # Tests require network access + "test_min" + "test_pycomp_onlineClosurable" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + "test_ok" + ]; disabledTestPaths = lib.optionals (pythonAtLeast "3.13") [ # https://github.com/manatlan/vbuild/issues/13 diff --git a/pkgs/development/python-modules/vector/default.nix b/pkgs/development/python-modules/vector/default.nix index b2459eed385b..0a92d42fa9c4 100644 --- a/pkgs/development/python-modules/vector/default.nix +++ b/pkgs/development/python-modules/vector/default.nix @@ -58,30 +58,29 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - disabledTests = - [ - # AssertionErrors in sympy tests - "test_lorentz_object" - "test_lorentz_sympy" - "test_rhophi_eta_t" - "test_rhophi_eta_tau" - "test_xy_eta_t" - "test_xy_eta_tau" + disabledTests = [ + # AssertionErrors in sympy tests + "test_lorentz_object" + "test_lorentz_sympy" + "test_rhophi_eta_t" + "test_rhophi_eta_tau" + "test_xy_eta_t" + "test_xy_eta_tau" - # AssertionError: assert array([2.]) == array([-2.]) - "test_issue_443" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ - # Fatal Python error: Segmentation fault - # numba/typed/typeddict.py", line 185 in __setitem__ - "test_method_transform2D" - "test_method_transform3D" - "test_method_transform4D" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # AssertionError: assert 2.1073424255447017e-08 == 0.0 - "test_issue_463" - ]; + # AssertionError: assert array([2.]) == array([-2.]) + "test_issue_443" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # Fatal Python error: Segmentation fault + # numba/typed/typeddict.py", line 185 in __setitem__ + "test_method_transform2D" + "test_method_transform3D" + "test_method_transform4D" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # AssertionError: assert 2.1073424255447017e-08 == 0.0 + "test_issue_463" + ]; meta = { description = "Library for 2D, 3D, and Lorentz vectors, especially arrays of vectors, to solve common physics problems in a NumPy-like way"; diff --git a/pkgs/development/python-modules/versioningit/default.nix b/pkgs/development/python-modules/versioningit/default.nix index 05dc14a79557..48112241bf1d 100644 --- a/pkgs/development/python-modules/versioningit/default.nix +++ b/pkgs/development/python-modules/versioningit/default.nix @@ -31,10 +31,11 @@ buildPythonPackage rec { build-system = [ hatchling ]; - dependencies = - [ packaging ] - ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] - ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + dependencies = [ + packaging + ] + ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; # AttributeError: type object 'CaseDetails' has no attribute 'model_validate_json' doCheck = lib.versionAtLeast pydantic.version "2"; diff --git a/pkgs/development/python-modules/virtualenv/default.nix b/pkgs/development/python-modules/virtualenv/default.nix index 8258b6e0d176..e058d36035cb 100644 --- a/pkgs/development/python-modules/virtualenv/default.nix +++ b/pkgs/development/python-modules/virtualenv/default.nix @@ -40,7 +40,8 @@ buildPythonPackage rec { distlib filelock platformdirs - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; + ] + ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; nativeCheckInputs = [ cython @@ -49,7 +50,8 @@ buildPythonPackage rec { pytest-mock pytest-timeout pytestCheckHook - ] ++ lib.optionals (!isPyPy) [ time-machine ]; + ] + ++ lib.optionals (!isPyPy) [ time-machine ]; preCheck = '' export HOME=$(mktemp -d) @@ -61,23 +63,22 @@ buildPythonPackage rec { "tests/unit/seed/embed/test_bootstrap_link_via_app_data.py" ]; - disabledTests = - [ - # Network access - "test_create_no_seed" - "test_seed_link_via_app_data" - # Permission Error - "test_bad_exe_py_info_no_raise" - ] - ++ lib.optionals (pythonOlder "3.11") [ "test_help" ] - ++ lib.optionals (isPyPy) [ - # encoding problems - "test_bash" - # permission error - "test_can_build_c_extensions" - # fails to detect pypy version - "test_discover_ok" - ]; + disabledTests = [ + # Network access + "test_create_no_seed" + "test_seed_link_via_app_data" + # Permission Error + "test_bad_exe_py_info_no_raise" + ] + ++ lib.optionals (pythonOlder "3.11") [ "test_help" ] + ++ lib.optionals (isPyPy) [ + # encoding problems + "test_bash" + # permission error + "test_can_build_c_extensions" + # fails to detect pypy version + "test_discover_ok" + ]; pythonImportsCheck = [ "virtualenv" ]; diff --git a/pkgs/development/python-modules/visions/default.nix b/pkgs/development/python-modules/visions/default.nix index b79e2a403704..9d9fa3e12107 100644 --- a/pkgs/development/python-modules/visions/default.nix +++ b/pkgs/development/python-modules/visions/default.nix @@ -59,7 +59,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTestPaths = [ # requires running Apache Spark: diff --git a/pkgs/development/python-modules/vivisect/default.nix b/pkgs/development/python-modules/vivisect/default.nix index 06b15686ec24..af4060ef9238 100644 --- a/pkgs/development/python-modules/vivisect/default.nix +++ b/pkgs/development/python-modules/vivisect/default.nix @@ -46,7 +46,8 @@ buildPythonPackage rec { cxxfilt msgpack pycparser - ] ++ lib.optionals (withGui) optional-dependencies.gui; + ] + ++ lib.optionals (withGui) optional-dependencies.gui; optional-dependencies.gui = [ pyqt5 diff --git a/pkgs/development/python-modules/vllm/default.nix b/pkgs/development/python-modules/vllm/default.nix index 61e2634cdad7..77171c28edc0 100644 --- a/pkgs/development/python-modules/vllm/default.nix +++ b/pkgs/development/python-modules/vllm/default.nix @@ -145,15 +145,14 @@ let dontConfigure = true; # vllm-flash-attn normally relies on `git submodule update` to fetch cutlass and composable_kernel - buildPhase = - '' - rm -rf csrc/cutlass - ln -sf ${cutlass} csrc/cutlass - '' - + lib.optionalString (rocmSupport) '' - rm -rf csrc/composable_kernel; - ln -sf ${rocmPackages.composable_kernel} csrc/composable_kernel - ''; + buildPhase = '' + rm -rf csrc/cutlass + ln -sf ${cutlass} csrc/cutlass + '' + + lib.optionalString (rocmSupport) '' + rm -rf csrc/composable_kernel; + ln -sf ${rocmPackages.composable_kernel} csrc/composable_kernel + ''; installPhase = '' cp -rva . $out @@ -298,20 +297,19 @@ buildPythonPackage rec { --replace-fail '$PYTHONPATH' '$ENV{PYTHONPATH}' ''; - nativeBuildInputs = - [ - which - ] - ++ lib.optionals rocmSupport [ - rocmPackages.hipcc - ] - ++ lib.optionals cudaSupport [ - cudaPackages.cuda_nvcc - autoAddDriverRunpath - ] - ++ lib.optionals isCudaJetson [ - cudaPackages.autoAddCudaCompatRunpath - ]; + nativeBuildInputs = [ + which + ] + ++ lib.optionals rocmSupport [ + rocmPackages.hipcc + ] + ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + autoAddDriverRunpath + ] + ++ lib.optionals isCudaJetson [ + cudaPackages.autoAddCudaCompatRunpath + ]; build-system = [ cmake @@ -352,86 +350,84 @@ buildPythonPackage rec { llvmPackages.openmp ]; - dependencies = - [ - aioprometheus - blake3 - cachetools - depyf - fastapi - llguidance - lm-format-enforcer - numpy - openai - opencv-python-headless - outlines - pandas - prometheus-fastapi-instrumentator - py-cpuinfo - pyarrow - pydantic - python-json-logger - python-multipart - pyzmq - ray - sentencepiece - tiktoken - tokenizers - msgspec - gguf - einops - importlib-metadata - partial-json-parser - compressed-tensors - mistral-common - torch - torchaudio - torchvision - transformers - uvicorn - xformers - xgrammar - numba - opentelemetry-sdk - opentelemetry-api - opentelemetry-exporter-otlp - bitsandbytes - # vLLM needs Torch's compiler to be present in order to use torch.compile - torch.stdenv.cc - ] - ++ uvicorn.optional-dependencies.standard - ++ aioprometheus.optional-dependencies.starlette - ++ lib.optionals stdenv.targetPlatform.isLinux [ - py-libnuma - psutil - ] - ++ lib.optionals cudaSupport [ - cupy - pynvml - flashinfer - ]; + dependencies = [ + aioprometheus + blake3 + cachetools + depyf + fastapi + llguidance + lm-format-enforcer + numpy + openai + opencv-python-headless + outlines + pandas + prometheus-fastapi-instrumentator + py-cpuinfo + pyarrow + pydantic + python-json-logger + python-multipart + pyzmq + ray + sentencepiece + tiktoken + tokenizers + msgspec + gguf + einops + importlib-metadata + partial-json-parser + compressed-tensors + mistral-common + torch + torchaudio + torchvision + transformers + uvicorn + xformers + xgrammar + numba + opentelemetry-sdk + opentelemetry-api + opentelemetry-exporter-otlp + bitsandbytes + # vLLM needs Torch's compiler to be present in order to use torch.compile + torch.stdenv.cc + ] + ++ uvicorn.optional-dependencies.standard + ++ aioprometheus.optional-dependencies.starlette + ++ lib.optionals stdenv.targetPlatform.isLinux [ + py-libnuma + psutil + ] + ++ lib.optionals cudaSupport [ + cupy + pynvml + flashinfer + ]; dontUseCmakeConfigure = true; - cmakeFlags = - [ - ] - ++ lib.optionals cudaSupport [ - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_CUTLASS" "${lib.getDev cutlass}") - (lib.cmakeFeature "FLASH_MLA_SRC_DIR" "${lib.getDev flashmla}") - (lib.cmakeFeature "VLLM_FLASH_ATTN_SRC_DIR" "${lib.getDev vllm-flash-attn'}") - (lib.cmakeFeature "TORCH_CUDA_ARCH_LIST" "${gpuTargetString}") - (lib.cmakeFeature "CUTLASS_NVCC_ARCHS_ENABLED" "${cudaPackages.flags.cmakeCudaArchitecturesString}") - (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${symlinkJoin { - name = "cuda-merged-${cudaPackages.cudaMajorMinorVersion}"; - paths = builtins.concatMap getAllOutputs mergedCudaLibraries; - }}") - (lib.cmakeFeature "CAFFE2_USE_CUDNN" "ON") - (lib.cmakeFeature "CAFFE2_USE_CUFILE" "ON") - (lib.cmakeFeature "CUTLASS_ENABLE_CUBLAS" "ON") - ] - ++ lib.optionals cpuSupport [ - (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_ONEDNN" "${lib.getDev oneDNN}") - ]; + cmakeFlags = [ + ] + ++ lib.optionals cudaSupport [ + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_CUTLASS" "${lib.getDev cutlass}") + (lib.cmakeFeature "FLASH_MLA_SRC_DIR" "${lib.getDev flashmla}") + (lib.cmakeFeature "VLLM_FLASH_ATTN_SRC_DIR" "${lib.getDev vllm-flash-attn'}") + (lib.cmakeFeature "TORCH_CUDA_ARCH_LIST" "${gpuTargetString}") + (lib.cmakeFeature "CUTLASS_NVCC_ARCHS_ENABLED" "${cudaPackages.flags.cmakeCudaArchitecturesString}") + (lib.cmakeFeature "CUDA_TOOLKIT_ROOT_DIR" "${symlinkJoin { + name = "cuda-merged-${cudaPackages.cudaMajorMinorVersion}"; + paths = builtins.concatMap getAllOutputs mergedCudaLibraries; + }}") + (lib.cmakeFeature "CAFFE2_USE_CUDNN" "ON") + (lib.cmakeFeature "CAFFE2_USE_CUFILE" "ON") + (lib.cmakeFeature "CUTLASS_ENABLE_CUBLAS" "ON") + ] + ++ lib.optionals cpuSupport [ + (lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_ONEDNN" "${lib.getDev oneDNN}") + ]; env = lib.optionalAttrs cudaSupport { diff --git a/pkgs/development/python-modules/volvooncall/default.nix b/pkgs/development/python-modules/volvooncall/default.nix index 0e4deae81b5a..bb630bbe02ed 100644 --- a/pkgs/development/python-modules/volvooncall/default.nix +++ b/pkgs/development/python-modules/volvooncall/default.nix @@ -55,7 +55,8 @@ buildPythonPackage rec { mock pytest-asyncio pytestCheckHook - ] ++ optional-dependencies.mqtt; + ] + ++ optional-dependencies.mqtt; pythonImportsCheck = [ "volvooncall" ]; diff --git a/pkgs/development/python-modules/w1thermsensor/default.nix b/pkgs/development/python-modules/w1thermsensor/default.nix index af8854ce96ec..4a417f3e8a79 100644 --- a/pkgs/development/python-modules/w1thermsensor/default.nix +++ b/pkgs/development/python-modules/w1thermsensor/default.nix @@ -39,14 +39,13 @@ buildPythonPackage rec { # Don't try to load the kernel module in tests. env.W1THERMSENSOR_NO_KERNEL_MODULE = 1; - nativeCheckInputs = - [ - pytest-mock - pytest-asyncio - pytestCheckHook - ] - ++ lib.optionals (pythonOlder "3.11") [ tomli ] - ++ lib.flatten (builtins.attrValues optional-dependencies); + nativeCheckInputs = [ + pytest-mock + pytest-asyncio + pytestCheckHook + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "w1thermsensor" ]; diff --git a/pkgs/development/python-modules/wacz/default.nix b/pkgs/development/python-modules/wacz/default.nix index 01663a47cfdf..6d4c0268a03d 100644 --- a/pkgs/development/python-modules/wacz/default.nix +++ b/pkgs/development/python-modules/wacz/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { frictionless pyyaml shortuuid - ] ++ frictionless.optional-dependencies.json; + ] + ++ frictionless.optional-dependencies.json; optional-dependencies = { # signing = [ diff --git a/pkgs/development/python-modules/wagtail/default.nix b/pkgs/development/python-modules/wagtail/default.nix index f36f7602a0bf..fe49bbaf53a6 100644 --- a/pkgs/development/python-modules/wagtail/default.nix +++ b/pkgs/development/python-modules/wagtail/default.nix @@ -66,7 +66,8 @@ buildPythonPackage rec { requests telepath willow - ] ++ willow.optional-dependencies.heif; + ] + ++ willow.optional-dependencies.heif; # Tests are in separate derivation because they require a package that depends # on wagtail (wagtail-factories) diff --git a/pkgs/development/python-modules/wand/default.nix b/pkgs/development/python-modules/wand/default.nix index b68b5dde4923..4e849b8b0c8a 100644 --- a/pkgs/development/python-modules/wand/default.nix +++ b/pkgs/development/python-modules/wand/default.nix @@ -30,18 +30,17 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # https://github.com/emcconville/wand/issues/558 - "test_forward_fourier_transform" - "test_inverse_fourier_transform" - # our imagemagick doesn't set MagickReleaseDate - "test_configure_options" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # AssertionError: assert wand.color.Color('srgb(255,0,1.41553e-14)') == wand.color.Color('srgb(255,0,0)') - "test_sparse_color" - ]; + disabledTests = [ + # https://github.com/emcconville/wand/issues/558 + "test_forward_fourier_transform" + "test_inverse_fourier_transform" + # our imagemagick doesn't set MagickReleaseDate + "test_configure_options" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # AssertionError: assert wand.color.Color('srgb(255,0,1.41553e-14)') == wand.color.Color('srgb(255,0,0)') + "test_sparse_color" + ]; passthru.imagemagick = imagemagickBig; diff --git a/pkgs/development/python-modules/wandb/default.nix b/pkgs/development/python-modules/wandb/default.nix index 980982b0cd1b..d4ab78811d92 100644 --- a/pkgs/development/python-modules/wandb/default.nix +++ b/pkgs/development/python-modules/wandb/default.nix @@ -208,28 +208,27 @@ buildPythonPackage rec { hatchling ]; - dependencies = - [ - click - docker-pycreds - gitpython - platformdirs - protobuf - psutil - pydantic - pyyaml - requests - sentry-sdk - setproctitle - # setuptools is necessary since pkg_resources is required at runtime. - setuptools - ] - ++ lib.optionals (pythonOlder "3.10") [ - eval-type-backport - ] - ++ lib.optionals (pythonOlder "3.12") [ - typing-extensions - ]; + dependencies = [ + click + docker-pycreds + gitpython + platformdirs + protobuf + psutil + pydantic + pyyaml + requests + sentry-sdk + setproctitle + # setuptools is necessary since pkg_resources is required at runtime. + setuptools + ] + ++ lib.optionals (pythonOlder "3.10") [ + eval-type-backport + ] + ++ lib.optionals (pythonOlder "3.12") [ + typing-extensions + ]; __darwinAllowLocalNetworking = true; @@ -279,133 +278,131 @@ buildPythonPackage rec { "--timeout=1024" ]; - disabledTestPaths = - [ - # Require docker access - "tests/system_tests" + disabledTestPaths = [ + # Require docker access + "tests/system_tests" - # broke somewhere between sentry-sdk 2.15.0 and 2.22.0 - "tests/unit_tests/test_analytics/test_sentry.py" + # broke somewhere between sentry-sdk 2.15.0 and 2.22.0 + "tests/unit_tests/test_analytics/test_sentry.py" - # Server connection times out under load - "tests/unit_tests/test_wandb_login.py" + # Server connection times out under load + "tests/unit_tests/test_wandb_login.py" - # PermissionError: unable to write to .cache/wandb/artifacts - "tests/unit_tests/test_artifacts/test_wandb_artifacts.py" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Breaks in sandbox: "Timed out waiting for wandb service to start" - "tests/unit_tests/test_job_builder.py" - ]; + # PermissionError: unable to write to .cache/wandb/artifacts + "tests/unit_tests/test_artifacts/test_wandb_artifacts.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Breaks in sandbox: "Timed out waiting for wandb service to start" + "tests/unit_tests/test_job_builder.py" + ]; - disabledTests = - [ - # Probably failing because of lack of internet access - # AttributeError: module 'wandb.sdk.launch.registry' has no attribute 'azure_container_registry'. Did you mean: 'elastic_container_registry'? - "test_registry_from_uri" + disabledTests = [ + # Probably failing because of lack of internet access + # AttributeError: module 'wandb.sdk.launch.registry' has no attribute 'azure_container_registry'. Did you mean: 'elastic_container_registry'? + "test_registry_from_uri" - # Require docker - "test_get_requirements_section_pyproject" - "test_local_custom_env" - "test_local_custom_port" - "test_local_default" + # Require docker + "test_get_requirements_section_pyproject" + "test_local_custom_env" + "test_local_custom_port" + "test_local_default" - # Expects python binary to be named `python3` but nix provides `python3.12` - # AssertionError: assert ['python3.12', 'main.py'] == ['python3', 'main.py'] - "test_get_entrypoint" + # Expects python binary to be named `python3` but nix provides `python3.12` + # AssertionError: assert ['python3.12', 'main.py'] == ['python3', 'main.py'] + "test_get_entrypoint" - # Require internet access - "test_audio_refs" - "test_bind_image" - "test_check_cors_configuration" - "test_check_wandb_version" - "test_from_path_project_type" - "test_image_accepts_bounding_boxes" - "test_image_accepts_bounding_boxes_optional_args" - "test_image_accepts_masks" - "test_image_accepts_masks_without_class_labels" - "test_image_seq_to_json" - "test_max_images" - "test_media_keys_escaped_as_glob_for_publish" - "test_parse_path" - "test_parse_project_path" - "test_translates_azure_err_to_normal_err" + # Require internet access + "test_audio_refs" + "test_bind_image" + "test_check_cors_configuration" + "test_check_wandb_version" + "test_from_path_project_type" + "test_image_accepts_bounding_boxes" + "test_image_accepts_bounding_boxes_optional_args" + "test_image_accepts_masks" + "test_image_accepts_masks_without_class_labels" + "test_image_seq_to_json" + "test_max_images" + "test_media_keys_escaped_as_glob_for_publish" + "test_parse_path" + "test_parse_project_path" + "test_translates_azure_err_to_normal_err" - # tests assertion if filesystem is compressed - "test_artifact_file_cache_cleanup" + # tests assertion if filesystem is compressed + "test_artifact_file_cache_cleanup" - # Tries to access a storage disk but there are none in the sandbox - # psutil.test_disk_out() returns None - "test_disk_in" - "test_disk_out" + # Tries to access a storage disk but there are none in the sandbox + # psutil.test_disk_out() returns None + "test_disk_in" + "test_disk_out" - # AssertionError: assert is_available('http://localhost:9400/metrics') - "test_dcgm" + # AssertionError: assert is_available('http://localhost:9400/metrics') + "test_dcgm" - # Error in the moviepy package: - # TypeError: must be real number, not NoneType - "test_video_numpy_mp4" + # Error in the moviepy package: + # TypeError: must be real number, not NoneType + "test_video_numpy_mp4" - # AssertionError: assert not _IS_INTERNAL_PROCESS - "test_disabled_can_pickle" - "test_disabled_context_manager" - "test_mode_disabled" + # AssertionError: assert not _IS_INTERNAL_PROCESS + "test_disabled_can_pickle" + "test_disabled_context_manager" + "test_mode_disabled" - # AssertionError: "one of name or plugin needs to be specified" - "test_opener_works_across_filesystem_boundaries" - "test_md5_file_hashes_on_mounted_filesystem" + # AssertionError: "one of name or plugin needs to be specified" + "test_opener_works_across_filesystem_boundaries" + "test_md5_file_hashes_on_mounted_filesystem" - # AttributeError: 'bytes' object has no attribute 'read' - "test_rewinds_on_failure" - "test_smoke" - "test_handles_multiple_calls" + # AttributeError: 'bytes' object has no attribute 'read' + "test_rewinds_on_failure" + "test_smoke" + "test_handles_multiple_calls" - # wandb.sdk.launch.errors.LaunchError: Found invalid name for agent MagicMock - "test_monitor_preempted" - "test_monitor_failed" - "test_monitor_running" - "test_monitor_job_deleted" + # wandb.sdk.launch.errors.LaunchError: Found invalid name for agent MagicMock + "test_monitor_preempted" + "test_monitor_failed" + "test_monitor_running" + "test_monitor_job_deleted" - # Timeout >1024.0s - "test_log_media_prefixed_with_multiple_slashes" - "test_log_media_saves_to_run_directory" - "test_log_media_with_path_traversal" + # Timeout >1024.0s + "test_log_media_prefixed_with_multiple_slashes" + "test_log_media_saves_to_run_directory" + "test_log_media_with_path_traversal" - # HandleAbandonedError / SystemExit when run in sandbox - "test_makedirs_raises_oserror__uses_temp_dir" - "test_no_root_dir_access__uses_temp_dir" + # HandleAbandonedError / SystemExit when run in sandbox + "test_makedirs_raises_oserror__uses_temp_dir" + "test_no_root_dir_access__uses_temp_dir" - # AssertionError: Not all requests have been executed - "test_image_refs" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # AssertionError: assert not copy2_mock.called - "test_copy_or_overwrite_changed_no_copy" + # AssertionError: Not all requests have been executed + "test_image_refs" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # AssertionError: assert not copy2_mock.called + "test_copy_or_overwrite_changed_no_copy" - # Fatal Python error: Aborted - "test_convert_plots" - "test_gpu_apple" - "test_image_from_matplotlib_with_image" - "test_make_plot_media_from_matplotlib_with_image" - "test_make_plot_media_from_matplotlib_without_image" - "test_matplotlib_contains_images" - "test_matplotlib_image" - "test_matplotlib_plotly_with_multiple_axes" - "test_matplotlib_to_plotly" - "test_plotly_from_matplotlib_with_image" + # Fatal Python error: Aborted + "test_convert_plots" + "test_gpu_apple" + "test_image_from_matplotlib_with_image" + "test_make_plot_media_from_matplotlib_with_image" + "test_make_plot_media_from_matplotlib_without_image" + "test_matplotlib_contains_images" + "test_matplotlib_image" + "test_matplotlib_plotly_with_multiple_axes" + "test_matplotlib_to_plotly" + "test_plotly_from_matplotlib_with_image" - # RuntimeError: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1] - "test_wandb_image_with_matplotlib_figure" + # RuntimeError: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1] + "test_wandb_image_with_matplotlib_figure" - # AssertionError: assert 'did you mean https://api.wandb.ai' in '1' - "test_login_bad_host" + # AssertionError: assert 'did you mean https://api.wandb.ai' in '1' + "test_login_bad_host" - # Asserttion error: 1 != 0 (testing system exit code) - "test_login_host_trailing_slash_fix_invalid" + # Asserttion error: 1 != 0 (testing system exit code) + "test_login_host_trailing_slash_fix_invalid" - # Breaks in sandbox: "Timed out waiting for wandb service to start" - "test_setup_offline" - ]; + # Breaks in sandbox: "Timed out waiting for wandb service to start" + "test_setup_offline" + ]; pythonImportsCheck = [ "wandb" ]; diff --git a/pkgs/development/python-modules/watchdog/default.nix b/pkgs/development/python-modules/watchdog/default.nix index 3dcd610c3eb1..a133e122fa7b 100644 --- a/pkgs/development/python-modules/watchdog/default.nix +++ b/pkgs/development/python-modules/watchdog/default.nix @@ -27,66 +27,63 @@ buildPythonPackage rec { optional-dependencies.watchmedo = [ pyyaml ]; - nativeCheckInputs = - [ - flaky - pytest-cov-stub - pytest-timeout - pytestCheckHook - ] - ++ optional-dependencies.watchmedo - ++ lib.optionals (pythonOlder "3.13") [ eventlet ]; + nativeCheckInputs = [ + flaky + pytest-cov-stub + pytest-timeout + pytestCheckHook + ] + ++ optional-dependencies.watchmedo + ++ lib.optionals (pythonOlder "3.13") [ eventlet ]; - pytestFlagsArray = - [ - "--deselect=tests/test_emitter.py::test_create_wrong_encoding" - "--deselect=tests/test_emitter.py::test_close" - # assert cap.out.splitlines(keepends=False).count('+++++ 0') == 2 != 3 - "--deselect=tests/test_0_watchmedo.py::test_auto_restart_on_file_change_debounce" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # fails to stop process in teardown - "--deselect=tests/test_0_watchmedo.py::test_auto_restart_subprocess_termination" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ - # FileCreationEvent != FileDeletionEvent - "--deselect=tests/test_emitter.py::test_separate_consecutive_moves" - "--deselect=tests/test_observers_polling.py::test___init__" - # segfaults - "--deselect=tests/test_delayed_queue.py::test_delayed_get" - "--deselect=tests/test_emitter.py::test_delete" - # AttributeError: '_thread.RLock' object has no attribute 'key'" - "--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # segfaults - "--deselect=tests/test_delayed_queue.py::test_delayed_get" - "--deselect=tests/test_0_watchmedo.py::test_tricks_from_file" - "--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_1" - "--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_2" - "--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching" - "--deselect=tests/test_fsevents.py::test_recursive_check_accepts_relative_paths" - # fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter - "--deselect=tests/test_fsevents.py::test_watchdog_recursive" - # SystemError: Cannot start fsevents stream. Use a kqueue or polling observer... - "--deselect=tests/test_fsevents.py::test_add_watch_twice" - # fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter - "--deselect=ests/test_fsevents.py::test_recursive_check_accepts_relative_paths" - # gets stuck - "--deselect=tests/test_fsevents.py::test_converting_cfstring_to_pyunicode" - ]; + pytestFlagsArray = [ + "--deselect=tests/test_emitter.py::test_create_wrong_encoding" + "--deselect=tests/test_emitter.py::test_close" + # assert cap.out.splitlines(keepends=False).count('+++++ 0') == 2 != 3 + "--deselect=tests/test_0_watchmedo.py::test_auto_restart_on_file_change_debounce" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # fails to stop process in teardown + "--deselect=tests/test_0_watchmedo.py::test_auto_restart_subprocess_termination" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + # FileCreationEvent != FileDeletionEvent + "--deselect=tests/test_emitter.py::test_separate_consecutive_moves" + "--deselect=tests/test_observers_polling.py::test___init__" + # segfaults + "--deselect=tests/test_delayed_queue.py::test_delayed_get" + "--deselect=tests/test_emitter.py::test_delete" + # AttributeError: '_thread.RLock' object has no attribute 'key'" + "--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # segfaults + "--deselect=tests/test_delayed_queue.py::test_delayed_get" + "--deselect=tests/test_0_watchmedo.py::test_tricks_from_file" + "--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_1" + "--deselect=tests/test_fsevents.py::test_watcher_deletion_while_receiving_events_2" + "--deselect=tests/test_skip_repeats_queue.py::test_eventlet_monkey_patching" + "--deselect=tests/test_fsevents.py::test_recursive_check_accepts_relative_paths" + # fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter + "--deselect=tests/test_fsevents.py::test_watchdog_recursive" + # SystemError: Cannot start fsevents stream. Use a kqueue or polling observer... + "--deselect=tests/test_fsevents.py::test_add_watch_twice" + # fsevents:fsevents.py:318 Unhandled exception in FSEventsEmitter + "--deselect=ests/test_fsevents.py::test_recursive_check_accepts_relative_paths" + # gets stuck + "--deselect=tests/test_fsevents.py::test_converting_cfstring_to_pyunicode" + ]; - disabledTestPaths = - [ - # tests timeout easily - "tests/test_inotify_buffer.py" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - # segfaults the testsuite - "tests/test_emitter.py" - # unsupported on x86_64-darwin - "tests/test_fsevents.py" - ]; + disabledTestPaths = [ + # tests timeout easily + "tests/test_inotify_buffer.py" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # segfaults the testsuite + "tests/test_emitter.py" + # unsupported on x86_64-darwin + "tests/test_fsevents.py" + ]; pythonImportsCheck = [ "watchdog" ]; diff --git a/pkgs/development/python-modules/watermark/default.nix b/pkgs/development/python-modules/watermark/default.nix index b44ca8eda645..569b9d02bdc7 100644 --- a/pkgs/development/python-modules/watermark/default.nix +++ b/pkgs/development/python-modules/watermark/default.nix @@ -37,7 +37,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); pythonImportsCheck = [ "watermark" ]; diff --git a/pkgs/development/python-modules/weasyprint/default.nix b/pkgs/development/python-modules/weasyprint/default.nix index 3767704c8200..fce0a2c3baca 100644 --- a/pkgs/development/python-modules/weasyprint/default.nix +++ b/pkgs/development/python-modules/weasyprint/default.nix @@ -64,7 +64,8 @@ buildPythonPackage rec { pyphen tinycss2 tinyhtml5 - ] ++ fonttools.optional-dependencies.woff; + ] + ++ fonttools.optional-dependencies.woff; nativeCheckInputs = [ pkgs.ghostscript diff --git a/pkgs/development/python-modules/web/default.nix b/pkgs/development/python-modules/web/default.nix index 99c0ccd77fa5..b79a399aea5d 100644 --- a/pkgs/development/python-modules/web/default.nix +++ b/pkgs/development/python-modules/web/default.nix @@ -25,7 +25,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ cheroot - ] ++ lib.optional (pythonAtLeast "3.13") legacy-cgi; + ] + ++ lib.optional (pythonAtLeast "3.13") legacy-cgi; # requires multiple running databases doCheck = false; diff --git a/pkgs/development/python-modules/web3/default.nix b/pkgs/development/python-modules/web3/default.nix index 282de6e5824a..1ec9324c3392 100644 --- a/pkgs/development/python-modules/web3/default.nix +++ b/pkgs/development/python-modules/web3/default.nix @@ -55,26 +55,25 @@ buildPythonPackage rec { "websockets" ]; - dependencies = - [ - aiohttp - eth-abi - eth-account - eth-hash - ] - ++ eth-hash.optional-dependencies.pycryptodome - ++ [ - eth-typing - eth-utils - hexbytes - jsonschema - lru-dict - protobuf - pydantic - requests - types-requests - websockets - ]; + dependencies = [ + aiohttp + eth-abi + eth-account + eth-hash + ] + ++ eth-hash.optional-dependencies.pycryptodome + ++ [ + eth-typing + eth-utils + hexbytes + jsonschema + lru-dict + protobuf + pydantic + requests + types-requests + websockets + ]; # Note: to reflect the extra_requires in main/setup.py. optional-dependencies = { diff --git a/pkgs/development/python-modules/webdataset/default.nix b/pkgs/development/python-modules/webdataset/default.nix index bf7794d33608..50cea1cba689 100644 --- a/pkgs/development/python-modules/webdataset/default.nix +++ b/pkgs/development/python-modules/webdataset/default.nix @@ -57,38 +57,37 @@ buildPythonPackage rec { export WIDS_CACHE=$TMPDIR ''; - disabledTests = - [ - # requires network - "test_batched" - "test_cache_dir" - "test_concurrent_download_and_open" - "test_dataloader" - "test_decode_handlers" - "test_decoder" - "test_download" - "test_handlers" - "test_pipe" - "test_remote_file" - "test_shard_syntax" - "test_torchvision" - "test_unbatched" - "test_yaml3" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # pickling error - "test_background_download" - ] - ++ lib.optionals (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isDarwin) [ - "test_concurrent_access" - ] - ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ - # segfaults on aarch64-linux - "test_webloader" - "test_webloader2" - "test_webloader_repeat" - "test_webloader_unbatched" - ]; + disabledTests = [ + # requires network + "test_batched" + "test_cache_dir" + "test_concurrent_download_and_open" + "test_dataloader" + "test_decode_handlers" + "test_decoder" + "test_download" + "test_handlers" + "test_pipe" + "test_remote_file" + "test_shard_syntax" + "test_torchvision" + "test_unbatched" + "test_yaml3" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # pickling error + "test_background_download" + ] + ++ lib.optionals (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isDarwin) [ + "test_concurrent_access" + ] + ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux) [ + # segfaults on aarch64-linux + "test_webloader" + "test_webloader2" + "test_webloader_repeat" + "test_webloader_unbatched" + ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # Issue with creating a temp file in the sandbox diff --git a/pkgs/development/python-modules/webdav4/default.nix b/pkgs/development/python-modules/webdav4/default.nix index 4f40d993758b..53ecaf568bd8 100644 --- a/pkgs/development/python-modules/webdav4/default.nix +++ b/pkgs/development/python-modules/webdav4/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { pytestCheckHook pytest-cov-stub wsgidav - ] ++ optional-dependencies.fsspec; + ] + ++ optional-dependencies.fsspec; optional-dependencies = { fsspec = [ fsspec ]; diff --git a/pkgs/development/python-modules/weblate-schemas/default.nix b/pkgs/development/python-modules/weblate-schemas/default.nix index c46d422612ff..4181eb68a018 100644 --- a/pkgs/development/python-modules/weblate-schemas/default.nix +++ b/pkgs/development/python-modules/weblate-schemas/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { nativeCheckInputs = [ fedora-messaging pytestCheckHook - ] ++ jsonschema.optional-dependencies.format; + ] + ++ jsonschema.optional-dependencies.format; pythonImportsCheck = [ "weblate_schemas" ]; diff --git a/pkgs/development/python-modules/websockets/default.nix b/pkgs/development/python-modules/websockets/default.nix index 50b2c11c4b53..25ff8ada5b62 100644 --- a/pkgs/development/python-modules/websockets/default.nix +++ b/pkgs/development/python-modules/websockets/default.nix @@ -26,26 +26,25 @@ buildPythonPackage rec { build-system = [ setuptools ]; - disabledTests = - [ - # Disables tests relying on tight timeouts to avoid failures like: - # File "/build/source/tests/legacy/test_protocol.py", line 1270, in test_keepalive_ping_with_no_ping_timeout - # ping_1_again, ping_2 = tuple(self.protocol.pings) - # ValueError: too many values to unpack (expected 2) - "test_keepalive_ping_stops_when_connection_closing" - "test_keepalive_ping_does_not_crash_when_connection_lost" - "test_keepalive_ping" - "test_keepalive_ping_not_acknowledged_closes_connection" - "test_keepalive_ping_with_no_ping_timeout" - ] - ++ lib.optionals (pythonAtLeast "3.13") [ - # https://github.com/python-websockets/websockets/issues/1569 - "test_writing_in_send_context_fails" - ] - ++ lib.optionals (pythonOlder "3.11") [ - # Our Python 3.10 and older raise SSLError instead of SSLCertVerificationError - "test_reject_invalid_server_certificate" - ]; + disabledTests = [ + # Disables tests relying on tight timeouts to avoid failures like: + # File "/build/source/tests/legacy/test_protocol.py", line 1270, in test_keepalive_ping_with_no_ping_timeout + # ping_1_again, ping_2 = tuple(self.protocol.pings) + # ValueError: too many values to unpack (expected 2) + "test_keepalive_ping_stops_when_connection_closing" + "test_keepalive_ping_does_not_crash_when_connection_lost" + "test_keepalive_ping" + "test_keepalive_ping_not_acknowledged_closes_connection" + "test_keepalive_ping_with_no_ping_timeout" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + # https://github.com/python-websockets/websockets/issues/1569 + "test_writing_in_send_context_fails" + ] + ++ lib.optionals (pythonOlder "3.11") [ + # Our Python 3.10 and older raise SSLError instead of SSLCertVerificationError + "test_reject_invalid_server_certificate" + ]; nativeCheckInputs = [ unittestCheckHook diff --git a/pkgs/development/python-modules/weconnect-mqtt/default.nix b/pkgs/development/python-modules/weconnect-mqtt/default.nix index 2c7b5045cf83..d8ee33f4fcab 100644 --- a/pkgs/development/python-modules/weconnect-mqtt/default.nix +++ b/pkgs/development/python-modules/weconnect-mqtt/default.nix @@ -42,7 +42,8 @@ buildPythonPackage rec { paho-mqtt python-dateutil weconnect - ] ++ weconnect.optional-dependencies.Images; + ] + ++ weconnect.optional-dependencies.Images; nativeCheckInputs = [ pytest-cov-stub diff --git a/pkgs/development/python-modules/werkzeug/default.nix b/pkgs/development/python-modules/werkzeug/default.nix index aef1412124fd..b51326f7a373 100644 --- a/pkgs/development/python-modules/werkzeug/default.nix +++ b/pkgs/development/python-modules/werkzeug/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { ephemeral-port-reserve pytest-timeout pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "werkzeug" ]; @@ -62,7 +63,8 @@ buildPythonPackage rec { # ResourceWarning: subprocess 309 is still running "test_basic" "test_long_build" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_get_machine_id" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_get_machine_id" ]; disabledTestPaths = [ # ConnectionRefusedError: [Errno 111] Connection refused diff --git a/pkgs/development/python-modules/wfuzz/default.nix b/pkgs/development/python-modules/wfuzz/default.nix index 0ac28138a076..2277341460be 100644 --- a/pkgs/development/python-modules/wfuzz/default.nix +++ b/pkgs/development/python-modules/wfuzz/default.nix @@ -48,17 +48,16 @@ buildPythonPackage rec { build-system = [ setuptools ]; - dependencies = - [ - chardet - distutils # src/wfuzz/plugin_api/base.py - pycurl - six - setuptools - pyparsing - ] - ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] - ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; + dependencies = [ + chardet + distutils # src/wfuzz/plugin_api/base.py + pycurl + six + setuptools + pyparsing + ] + ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] + ++ lib.optionals (pythonAtLeast "3.13") [ legacy-cgi ]; nativeCheckInputs = [ netaddr diff --git a/pkgs/development/python-modules/whey/default.nix b/pkgs/development/python-modules/whey/default.nix index 61ef34e74ad6..ace0f3fbad75 100644 --- a/pkgs/development/python-modules/whey/default.nix +++ b/pkgs/development/python-modules/whey/default.nix @@ -62,7 +62,8 @@ buildPythonPackage rec { readme = [ docutils pyproject-parser - ] ++ pyproject-parser.optional-dependencies.readme; + ] + ++ pyproject-parser.optional-dependencies.readme; }; nativeCheckInputs = [ diff --git a/pkgs/development/python-modules/whool/default.nix b/pkgs/development/python-modules/whool/default.nix index fc015b584b7b..50e860e89b51 100644 --- a/pkgs/development/python-modules/whool/default.nix +++ b/pkgs/development/python-modules/whool/default.nix @@ -28,7 +28,8 @@ buildPythonPackage rec { dependencies = [ manifestoo-core wheel - ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ tomli ]; pythonImportsCheck = [ "whool" ]; diff --git a/pkgs/development/python-modules/willow/default.nix b/pkgs/development/python-modules/willow/default.nix index e4f67b86e6bf..ab76e36017cf 100644 --- a/pkgs/development/python-modules/willow/default.nix +++ b/pkgs/development/python-modules/willow/default.nix @@ -45,7 +45,8 @@ buildPythonPackage rec { pytestCheckHook pillow wand - ] ++ optional-dependencies.heif; + ] + ++ optional-dependencies.heif; meta = { description = "Python image library that sits on top of Pillow, Wand and OpenCV"; diff --git a/pkgs/development/python-modules/wtforms/default.nix b/pkgs/development/python-modules/wtforms/default.nix index 1ee5fac732b8..5e1043684687 100644 --- a/pkgs/development/python-modules/wtforms/default.nix +++ b/pkgs/development/python-modules/wtforms/default.nix @@ -47,7 +47,8 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); pythonImportsCheck = [ "wtforms" ]; diff --git a/pkgs/development/python-modules/wxpython/4.2.nix b/pkgs/development/python-modules/wxpython/4.2.nix index 9edee34105d9..d9d00c9a3c1a 100644 --- a/pkgs/development/python-modules/wxpython/4.2.nix +++ b/pkgs/development/python-modules/wxpython/4.2.nix @@ -75,26 +75,26 @@ buildPythonPackage rec { sip which wxGTK - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; - buildInputs = - [ - wxGTK - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gst_all_1.gst-plugins-base - gst_all_1.gstreamer - libGL - libGLU - libSM - libXinerama - libXtst - libXxf86vm - libglvnd - libgbm - webkitgtk_4_1 - xorgproto - ]; + buildInputs = [ + wxGTK + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gst_all_1.gst-plugins-base + gst_all_1.gstreamer + libGL + libGLU + libSM + libXinerama + libXtst + libXxf86vm + libglvnd + libgbm + webkitgtk_4_1 + xorgproto + ]; propagatedBuildInputs = [ numpy diff --git a/pkgs/development/python-modules/xformers/default.nix b/pkgs/development/python-modules/xformers/default.nix index 46e77b3c3acd..fe5836ed207e 100644 --- a/pkgs/development/python-modules/xformers/default.nix +++ b/pkgs/development/python-modules/xformers/default.nix @@ -82,13 +82,12 @@ buildPythonPackage { ] ); - nativeBuildInputs = - [ - ninja - which - ] - ++ lib.optionals cudaSupport (with cudaPackages; [ cuda_nvcc ]) - ++ lib.optional stdenv.hostPlatform.isDarwin openmp.dev; + nativeBuildInputs = [ + ninja + which + ] + ++ lib.optionals cudaSupport (with cudaPackages; [ cuda_nvcc ]) + ++ lib.optional stdenv.hostPlatform.isDarwin openmp.dev; dependencies = [ numpy diff --git a/pkgs/development/python-modules/xgrammar/default.nix b/pkgs/development/python-modules/xgrammar/default.nix index 78cf62927f6d..66022da38e27 100644 --- a/pkgs/development/python-modules/xgrammar/default.nix +++ b/pkgs/development/python-modules/xgrammar/default.nix @@ -48,17 +48,16 @@ buildPythonPackage rec { ]; dontUseCmakeConfigure = true; - dependencies = - [ - pydantic - sentencepiece - tiktoken - torch - transformers - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [ - triton - ]; + dependencies = [ + pydantic + sentencepiece + tiktoken + torch + transformers + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [ + triton + ]; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/xknx/default.nix b/pkgs/development/python-modules/xknx/default.nix index 0c0398330567..6c8692ccf9b1 100644 --- a/pkgs/development/python-modules/xknx/default.nix +++ b/pkgs/development/python-modules/xknx/default.nix @@ -31,7 +31,8 @@ buildPythonPackage rec { dependencies = [ cryptography ifaddr - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; nativeCheckInputs = [ freezegun diff --git a/pkgs/development/python-modules/xnd/default.nix b/pkgs/development/python-modules/xnd/default.nix index e3145bacc539..0c2110bd56bd 100644 --- a/pkgs/development/python-modules/xnd/default.nix +++ b/pkgs/development/python-modules/xnd/default.nix @@ -21,32 +21,30 @@ buildPythonPackage { buildInputs = [ libndtypes ]; - postPatch = - '' - substituteInPlace setup.py \ - --replace-fail \ - 'include_dirs = ["libxnd", "ndtypes/python/ndtypes"] + INCLUDES' \ - 'include_dirs = ["${libndtypes}/include", "${ndtypes}/include", "${libxnd}/include"]' \ - --replace-fail \ - 'library_dirs = ["libxnd", "ndtypes/libndtypes"] + LIBS' \ - 'library_dirs = ["${libndtypes}/lib", "${libxnd}/lib"]' \ - --replace-fail \ - 'runtime_library_dirs = ["$ORIGIN"]' \ - 'runtime_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib"]' - '' - + lib.optionalString (pythonAtLeast "3.12") '' - substituteInPlace python/xnd/util.h \ - --replace-fail '->ob_digit[i]' '->long_value.ob_digit[i]' - ''; + postPatch = '' + substituteInPlace setup.py \ + --replace-fail \ + 'include_dirs = ["libxnd", "ndtypes/python/ndtypes"] + INCLUDES' \ + 'include_dirs = ["${libndtypes}/include", "${ndtypes}/include", "${libxnd}/include"]' \ + --replace-fail \ + 'library_dirs = ["libxnd", "ndtypes/libndtypes"] + LIBS' \ + 'library_dirs = ["${libndtypes}/lib", "${libxnd}/lib"]' \ + --replace-fail \ + 'runtime_library_dirs = ["$ORIGIN"]' \ + 'runtime_library_dirs = ["${libndtypes}/lib", "${libxnd}/lib"]' + '' + + lib.optionalString (pythonAtLeast "3.12") '' + substituteInPlace python/xnd/util.h \ + --replace-fail '->ob_digit[i]' '->long_value.ob_digit[i]' + ''; - postInstall = - '' - mkdir $out/include - cp python/xnd/*.h $out/include - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -add_rpath ${libxnd}/lib $out/${python.sitePackages}/xnd/_xnd.*.so - ''; + postInstall = '' + mkdir $out/include + cp python/xnd/*.h $out/include + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -add_rpath ${libxnd}/lib $out/${python.sitePackages}/xnd/_xnd.*.so + ''; checkPhase = '' runHook preCheck diff --git a/pkgs/development/python-modules/xsdata/default.nix b/pkgs/development/python-modules/xsdata/default.nix index 37d8dfa2903f..e991b6549619 100644 --- a/pkgs/development/python-modules/xsdata/default.nix +++ b/pkgs/development/python-modules/xsdata/default.nix @@ -55,13 +55,12 @@ buildPythonPackage rec { soap = [ requests ]; }; - nativeCheckInputs = - [ - pytestCheckHook - ] - ++ optional-dependencies.cli - ++ optional-dependencies.lxml - ++ optional-dependencies.soap; + nativeCheckInputs = [ + pytestCheckHook + ] + ++ optional-dependencies.cli + ++ optional-dependencies.lxml + ++ optional-dependencies.soap; disabledTestPaths = [ "tests/integration/benchmarks" ]; diff --git a/pkgs/development/python-modules/yalexs/default.nix b/pkgs/development/python-modules/yalexs/default.nix index aab259612d16..7c7c619c3fc4 100644 --- a/pkgs/development/python-modules/yalexs/default.nix +++ b/pkgs/development/python-modules/yalexs/default.nix @@ -52,7 +52,8 @@ buildPythonPackage rec { python-socketio requests typing-extensions - ] ++ python-socketio.optional-dependencies.asyncio_client; + ] + ++ python-socketio.optional-dependencies.asyncio_client; nativeCheckInputs = [ aioresponses diff --git a/pkgs/development/python-modules/yamllint/default.nix b/pkgs/development/python-modules/yamllint/default.nix index bb46c3444136..64aa2e5fdbc3 100644 --- a/pkgs/development/python-modules/yamllint/default.nix +++ b/pkgs/development/python-modules/yamllint/default.nix @@ -33,19 +33,18 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - disabledTests = - [ - # test failure reported upstream: https://github.com/adrienverge/yamllint/issues/373 - "test_find_files_recursively" - # Issue with fixture - "test_codec_built_in_equivalent" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # locale tests are broken on BSDs; see https://github.com/adrienverge/yamllint/issues/307 - "test_locale_accents" - "test_locale_case" - "test_run_with_locale" - ]; + disabledTests = [ + # test failure reported upstream: https://github.com/adrienverge/yamllint/issues/373 + "test_find_files_recursively" + # Issue with fixture + "test_codec_built_in_equivalent" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # locale tests are broken on BSDs; see https://github.com/adrienverge/yamllint/issues/307 + "test_locale_accents" + "test_locale_case" + "test_run_with_locale" + ]; pythonImportsCheck = [ "yamllint" ]; diff --git a/pkgs/development/python-modules/yowsup/default.nix b/pkgs/development/python-modules/yowsup/default.nix index 77fe1f9733da..39a6579dd7c5 100644 --- a/pkgs/development/python-modules/yowsup/default.nix +++ b/pkgs/development/python-modules/yowsup/default.nix @@ -49,7 +49,8 @@ buildPythonPackage rec { protobuf python-axolotl six - ] ++ lib.optionals (!pythonOlder "3.12") [ pyasyncore ]; + ] + ++ lib.optionals (!pythonOlder "3.12") [ pyasyncore ]; meta = { homepage = "https://github.com/tgalal/yowsup"; diff --git a/pkgs/development/python-modules/zarr/default.nix b/pkgs/development/python-modules/zarr/default.nix index 3caee9945d97..a203a9b2254c 100644 --- a/pkgs/development/python-modules/zarr/default.nix +++ b/pkgs/development/python-modules/zarr/default.nix @@ -38,7 +38,8 @@ buildPythonPackage rec { numpy fasteners numcodecs - ] ++ numcodecs.optional-dependencies.msgpack; + ] + ++ numcodecs.optional-dependencies.msgpack; nativeCheckInputs = [ pytestCheckHook diff --git a/pkgs/development/python-modules/zeep/default.nix b/pkgs/development/python-modules/zeep/default.nix index 13c8788fd442..fe144dddf8a2 100644 --- a/pkgs/development/python-modules/zeep/default.nix +++ b/pkgs/development/python-modules/zeep/default.nix @@ -75,7 +75,8 @@ buildPythonPackage rec { pytest-httpx pytestCheckHook requests-mock - ] ++ lib.flatten (builtins.attrValues optional-dependencies); + ] + ++ lib.flatten (builtins.attrValues optional-dependencies); disabledTests = [ # Failed: External connections not allowed during tests. diff --git a/pkgs/development/python-modules/zigpy/default.nix b/pkgs/development/python-modules/zigpy/default.nix index 9aed2df47d68..250143f44ede 100644 --- a/pkgs/development/python-modules/zigpy/default.nix +++ b/pkgs/development/python-modules/zigpy/default.nix @@ -54,7 +54,8 @@ buildPythonPackage rec { pyserial-asyncio typing-extensions voluptuous - ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; + ] + ++ lib.optionals (pythonOlder "3.11") [ async-timeout ]; nativeCheckInputs = [ aioresponses @@ -64,14 +65,13 @@ buildPythonPackage rec { pytestCheckHook ]; - disabledTests = - [ - # assert quirked.quirk_metadata.quirk_location.endswith("zigpy/tests/test_quirks_v2.py]-line:104") is False - "test_quirks_v2" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [ - "test_periodic_scan_priority" - ]; + disabledTests = [ + # assert quirked.quirk_metadata.quirk_location.endswith("zigpy/tests/test_quirks_v2.py]-line:104") is False + "test_quirks_v2" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [ + "test_periodic_scan_priority" + ]; disabledTestPaths = [ # Tests require network access diff --git a/pkgs/development/python-modules/zope-security/default.nix b/pkgs/development/python-modules/zope-security/default.nix index ede2248dac39..0e7d69093da0 100644 --- a/pkgs/development/python-modules/zope-security/default.nix +++ b/pkgs/development/python-modules/zope-security/default.nix @@ -58,7 +58,8 @@ buildPythonPackage rec { unittestCheckHook zope-exceptions zope-testing - ] ++ lib.flatten (lib.attrValues optional-dependencies); + ] + ++ lib.flatten (lib.attrValues optional-dependencies); # Import process is too complex and some tests fail preCheck = '' diff --git a/pkgs/development/python-modules/zulip/default.nix b/pkgs/development/python-modules/zulip/default.nix index d5bec61a0c0f..54cd375944b8 100644 --- a/pkgs/development/python-modules/zulip/default.nix +++ b/pkgs/development/python-modules/zulip/default.nix @@ -36,7 +36,8 @@ buildPythonPackage rec { distro click typing-extensions - ] ++ requests.optional-dependencies.security; + ] + ++ requests.optional-dependencies.security; nativeCheckInputs = [ matrix-nio diff --git a/pkgs/development/python2-modules/importlib-metadata/default.nix b/pkgs/development/python2-modules/importlib-metadata/default.nix index 219da18edf70..926926f3d578 100644 --- a/pkgs/development/python2-modules/importlib-metadata/default.nix +++ b/pkgs/development/python2-modules/importlib-metadata/default.nix @@ -23,13 +23,14 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = - [ zipp ] - ++ lib.optionals (!isPy3k) [ - pathlib2 - contextlib2 - configparser - ]; + propagatedBuildInputs = [ + zipp + ] + ++ lib.optionals (!isPy3k) [ + pathlib2 + contextlib2 + configparser + ]; # Cyclic dependencies doCheck = false; diff --git a/pkgs/development/python2-modules/mock/default.nix b/pkgs/development/python2-modules/mock/default.nix index 79d73b9dba27..e28e5e651a80 100644 --- a/pkgs/development/python2-modules/mock/default.nix +++ b/pkgs/development/python2-modules/mock/default.nix @@ -23,7 +23,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ six pbr - ] ++ lib.optionals isPy27 [ funcsigs ]; + ] + ++ lib.optionals isPy27 [ funcsigs ]; # On PyPy for Python 2.7 in particular, Mock's tests have a known failure. # Mock upstream has a decoration to disable the failing test and make diff --git a/pkgs/development/python2-modules/pygtk/default.nix b/pkgs/development/python2-modules/pygtk/default.nix index 066a00884ef0..805f7163feac 100644 --- a/pkgs/development/python2-modules/pygtk/default.nix +++ b/pkgs/development/python2-modules/pygtk/default.nix @@ -63,21 +63,20 @@ buildPythonPackage rec { installPhase = "installPhase"; - checkPhase = - '' - sed -i -e "s/glade = importModule('gtk.glade', buildDir)//" \ - tests/common.py - sed -i -e "s/, glade$//" \ - -e "s/.*testGlade.*//" \ - -e "s/.*(glade.*//" \ - tests/test_api.py - '' - + '' - sed -i -e "s/sys.path.insert(0, os.path.join(buildDir, 'gtk'))//" \ - -e "s/sys.path.insert(0, buildDir)//" \ - tests/common.py - make check - ''; + checkPhase = '' + sed -i -e "s/glade = importModule('gtk.glade', buildDir)//" \ + tests/common.py + sed -i -e "s/, glade$//" \ + -e "s/.*testGlade.*//" \ + -e "s/.*(glade.*//" \ + tests/test_api.py + '' + + '' + sed -i -e "s/sys.path.insert(0, os.path.join(buildDir, 'gtk'))//" \ + -e "s/sys.path.insert(0, buildDir)//" \ + tests/common.py + make check + ''; # XXX: TypeError: Unsupported type: # The check phase was not executed in the previous # non-buildPythonPackage setup - not sure why not. diff --git a/pkgs/development/python2-modules/pytest/default.nix b/pkgs/development/python2-modules/pytest/default.nix index 6f22a854c335..44d14de952f3 100644 --- a/pkgs/development/python2-modules/pytest/default.nix +++ b/pkgs/development/python2-modules/pytest/default.nix @@ -41,20 +41,19 @@ buildPythonPackage rec { mock ]; buildInputs = [ setuptools-scm ]; - propagatedBuildInputs = - [ - attrs - py - setuptools - six - pluggy - more-itertools - atomicwrites - wcwidth - packaging - ] - ++ lib.optionals (!isPy3k) [ funcsigs ] - ++ lib.optionals (pythonOlder "3.6") [ pathlib2 ]; + propagatedBuildInputs = [ + attrs + py + setuptools + six + pluggy + more-itertools + atomicwrites + wcwidth + packaging + ] + ++ lib.optionals (!isPy3k) [ funcsigs ] + ++ lib.optionals (pythonOlder "3.6") [ pathlib2 ]; doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460 checkPhase = '' diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 82f2b1dc19cf..7aabc5fdf58e 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -358,14 +358,13 @@ let # `self` is `_self` with overridden packages; # packages in `_self` may depends on overridden packages. self = (defaultOverrides _self self) // overrides; - _self = - { - inherit buildRPackage; - } - // mkPackageSet deriveBioc biocPackagesGenerated - // mkPackageSet deriveBiocAnn biocAnnotationPackagesGenerated - // mkPackageSet deriveBiocExp biocExperimentPackagesGenerated - // mkPackageSet deriveCran cranPackagesGenerated; + _self = { + inherit buildRPackage; + } + // mkPackageSet deriveBioc biocPackagesGenerated + // mkPackageSet deriveBiocAnn biocAnnotationPackagesGenerated + // mkPackageSet deriveBiocExp biocExperimentPackagesGenerated + // mkPackageSet deriveCran cranPackagesGenerated; # Takes in a generated JSON file's imported contents # and transforms it by swapping each element of the depends array with the dependency's derivation @@ -2504,7 +2503,8 @@ let icu which zstd.dev - ] ++ attrs.buildInputs; + ] + ++ attrs.buildInputs; postInstall = '' install -d $out/bin $out/share/man/man1 ln -s ../library/littler/bin/r $out/bin/r diff --git a/pkgs/development/r-modules/wrapper-radian.nix b/pkgs/development/r-modules/wrapper-radian.nix index be829ccde8d1..3b9938b78db6 100644 --- a/pkgs/development/r-modules/wrapper-radian.nix +++ b/pkgs/development/r-modules/wrapper-radian.nix @@ -14,13 +14,12 @@ runCommand (radian.name + "-wrapper") preferLocalBuild = true; allowSubstitutes = false; - buildInputs = - [ - R - radian - ] - ++ recommendedPackages - ++ packages; + buildInputs = [ + R + radian + ] + ++ recommendedPackages + ++ packages; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/development/r-modules/wrapper-rstudio.nix b/pkgs/development/r-modules/wrapper-rstudio.nix index fdba8b6f5255..817888a7ce50 100644 --- a/pkgs/development/r-modules/wrapper-rstudio.nix +++ b/pkgs/development/r-modules/wrapper-rstudio.nix @@ -18,13 +18,12 @@ runCommand (rstudio.name + "-wrapper") nativeBuildInputs = [ makeWrapper ]; dontWrapQtApps = true; - buildInputs = - [ - R - rstudio - ] - ++ recommendedPackages - ++ packages; + buildInputs = [ + R + rstudio + ] + ++ recommendedPackages + ++ packages; # rWrapper points R to a specific set of packages by using a wrapper # (as in https://nixos.org/nixpkgs/manual/#r-packages) which sets diff --git a/pkgs/development/rocm-modules/6/aotriton/default.nix b/pkgs/development/rocm-modules/6/aotriton/default.nix index a7e58f2952c0..ccadbbf9633e 100644 --- a/pkgs/development/rocm-modules/6/aotriton/default.nix +++ b/pkgs/development/rocm-modules/6/aotriton/default.nix @@ -75,19 +75,18 @@ stdenv.mkDerivation ( env.ROCM_PATH = "${clr}"; requiredSystemFeatures = [ "big-parallel" ]; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; # Need an empty cuda.h for this to compile # Better than pulling in unfree cuda headers @@ -107,31 +106,30 @@ stdenv.mkDerivation ( ninja ]; - buildInputs = - [ - rocblas - rocsolver - hipblas-common - hipblas - openmp - libffi - ncurses - xz - nlohmann_json - rocmlir + buildInputs = [ + rocblas + rocsolver + hipblas-common + hipblas + openmp + libffi + ncurses + xz + nlohmann_json + rocmlir - msgpack - libxml2 - python3Packages.msgpack - zlib - zstd - ] - ++ lib.optionals buildTests [ - gtest - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - lapack-reference - ]; + msgpack + libxml2 + python3Packages.msgpack + zlib + zstd + ] + ++ lib.optionals buildTests [ + gtest + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + lapack-reference + ]; env.TRITON_OFFLINE_BUILD = 1; env.LLVM_SYSPATH = "${triton-llvm'}"; @@ -177,31 +175,30 @@ stdenv.mkDerivation ( runHook postInstall ''; - cmakeFlags = - [ - "-Wno-dev" - "-DAOTRITON_NOIMAGE_MODE=ON" # FIXME: Should be able to build with object code but generate_shim is failing - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DVIRTUALENV_PYTHON_EXENAME=${lib.getExe py}" - "-DCMAKE_CXX_COMPILER=${compiler}" - # Manually define CMAKE_INSTALL_ - # See: https://github.com/NixOS/nixpkgs/pull/197838 - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DAMDGPU_TARGETS=${gpuTargets'}" - "-DGPU_TARGETS=${gpuTargets'}" - ] - ++ lib.optionals buildTests [ - "-DBUILD_CLIENTS_TESTS=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_CLIENTS_BENCHMARKS=ON" - ] - ++ lib.optionals buildSamples [ - "-DBUILD_CLIENTS_SAMPLES=ON" - ]; + cmakeFlags = [ + "-Wno-dev" + "-DAOTRITON_NOIMAGE_MODE=ON" # FIXME: Should be able to build with object code but generate_shim is failing + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DVIRTUALENV_PYTHON_EXENAME=${lib.getExe py}" + "-DCMAKE_CXX_COMPILER=${compiler}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DAMDGPU_TARGETS=${gpuTargets'}" + "-DGPU_TARGETS=${gpuTargets'}" + ] + ++ lib.optionals buildTests [ + "-DBUILD_CLIENTS_TESTS=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ] + ++ lib.optionals buildSamples [ + "-DBUILD_CLIENTS_SAMPLES=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/clr/default.nix b/pkgs/development/rocm-modules/6/clr/default.nix index 1644cd122c95..566863dec35c 100644 --- a/pkgs/development/rocm-modules/6/clr/default.nix +++ b/pkgs/development/rocm-modules/6/clr/default.nix @@ -213,70 +213,69 @@ stdenv.mkDerivation (finalAttrs: { gcc-unwrapped ]; - passthru = - { - # All known and valid general GPU targets - # We cannot use this for each ROCm library, as each defines their own supported targets - # See: https://github.com/ROCm/ROCm/blob/77cbac4abab13046ee93d8b5bf410684caf91145/README.md#library-target-matrix - # Generic targets are not yet available in rocm-6.3.1 llvm - gpuTargets = lib.forEach [ - # "9-generic" - "900" # MI25, Vega 56/64 - "906" # MI50/60, Radeon VII - "908" # MI100 - "90a" # MI210 / MI250 - # "9-4-generic" - # 940/1 - never released publicly, maybe HPE cray specific MI3xx? - "942" # MI300 - # "10-1-generic" - "1010" - "1012" - # "10-3-generic" - "1030" # W6800, various Radeon cards - # "11-generic" - "1100" - "1101" - "1102" - "1200" # RX 9070 - "1201" # RX 9070 XT - ] (target: "gfx${target}"); + passthru = { + # All known and valid general GPU targets + # We cannot use this for each ROCm library, as each defines their own supported targets + # See: https://github.com/ROCm/ROCm/blob/77cbac4abab13046ee93d8b5bf410684caf91145/README.md#library-target-matrix + # Generic targets are not yet available in rocm-6.3.1 llvm + gpuTargets = lib.forEach [ + # "9-generic" + "900" # MI25, Vega 56/64 + "906" # MI50/60, Radeon VII + "908" # MI100 + "90a" # MI210 / MI250 + # "9-4-generic" + # 940/1 - never released publicly, maybe HPE cray specific MI3xx? + "942" # MI300 + # "10-1-generic" + "1010" + "1012" + # "10-3-generic" + "1030" # W6800, various Radeon cards + # "11-generic" + "1100" + "1101" + "1102" + "1200" # RX 9070 + "1201" # RX 9070 XT + ] (target: "gfx${target}"); - inherit hipClangPath; + inherit hipClangPath; - updateScript = rocmUpdateScript { - name = finalAttrs.pname; - inherit (finalAttrs.src) owner; - inherit (finalAttrs.src) repo; - page = "tags?per_page=4"; - }; - - impureTests = { - rocm-smi = callPackage ./test-rocm-smi.nix { - inherit rocm-smi; - clr = finalAttrs.finalPackage; - }; - opencl-example = callPackage ./test-opencl-example.nix { - clr = finalAttrs.finalPackage; - }; - }; - - selectGpuTargets = - { - supported ? [ ], - }: - supported; - gpuArchSuffix = ""; - } - // lib.optionalAttrs (localGpuTargets != null) { - inherit localGpuTargets; - gpuArchSuffix = "-" + (builtins.concatStringsSep "-" localGpuTargets); - selectGpuTargets = - { - supported ? [ ], - }: - if supported == [ ] then localGpuTargets else lib.lists.intersectLists localGpuTargets supported; + updateScript = rocmUpdateScript { + name = finalAttrs.pname; + inherit (finalAttrs.src) owner; + inherit (finalAttrs.src) repo; + page = "tags?per_page=4"; }; + impureTests = { + rocm-smi = callPackage ./test-rocm-smi.nix { + inherit rocm-smi; + clr = finalAttrs.finalPackage; + }; + opencl-example = callPackage ./test-opencl-example.nix { + clr = finalAttrs.finalPackage; + }; + }; + + selectGpuTargets = + { + supported ? [ ], + }: + supported; + gpuArchSuffix = ""; + } + // lib.optionalAttrs (localGpuTargets != null) { + inherit localGpuTargets; + gpuArchSuffix = "-" + (builtins.concatStringsSep "-" localGpuTargets); + selectGpuTargets = + { + supported ? [ ], + }: + if supported == [ ] then localGpuTargets else lib.lists.intersectLists localGpuTargets supported; + }; + meta = with lib; { description = "AMD Common Language Runtime for hipamd, opencl, and rocclr"; homepage = "https://github.com/ROCm/clr"; diff --git a/pkgs/development/rocm-modules/6/composable_kernel/base.nix b/pkgs/development/rocm-modules/6/composable_kernel/base.nix index 29fa699e97e4..53b933fab0d2 100644 --- a/pkgs/development/rocm-modules/6/composable_kernel/base.nix +++ b/pkgs/development/rocm-modules/6/composable_kernel/base.nix @@ -42,16 +42,15 @@ stdenv.mkDerivation (finalAttrs: { # and it matches the version torch 2.6 wants version = "6.4.0-unstable-20241220"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildExamples [ - "example" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildExamples [ + "example" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -83,40 +82,39 @@ stdenv.mkDerivation (finalAttrs: { env.ROCM_PATH = clr; env.HIP_CLANG_PATH = "${rocm-merged-llvm}/bin"; - cmakeFlags = - [ - "-DCMAKE_MODULE_PATH=${clr}/hip/cmake" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_POLICY_DEFAULT_CMP0069=NEW" - # "-DDL_KERNELS=ON" # Not needed, slow to build - # CK_USE_CODEGEN Required for migraphx which uses device_gemm_multiple_d.hpp - # but migraphx requires an incompatible fork of CK and fails anyway - # "-DCK_USE_CODEGEN=ON" - # It might be worth skipping fp64 in future with this: - # "-DDTYPES=fp32;fp16;fp8;bf16;int8" - # Manually define CMAKE_INSTALL_ - # See: https://github.com/NixOS/nixpkgs/pull/197838 - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DBUILD_DEV=OFF" - "-DROCM_PATH=${clr}" - "-DCMAKE_HIP_COMPILER_ROCM_ROOT=${clr}" + cmakeFlags = [ + "-DCMAKE_MODULE_PATH=${clr}/hip/cmake" + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_POLICY_DEFAULT_CMP0069=NEW" + # "-DDL_KERNELS=ON" # Not needed, slow to build + # CK_USE_CODEGEN Required for migraphx which uses device_gemm_multiple_d.hpp + # but migraphx requires an incompatible fork of CK and fails anyway + # "-DCK_USE_CODEGEN=ON" + # It might be worth skipping fp64 in future with this: + # "-DDTYPES=fp32;fp16;fp8;bf16;int8" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DBUILD_DEV=OFF" + "-DROCM_PATH=${clr}" + "-DCMAKE_HIP_COMPILER_ROCM_ROOT=${clr}" - # FP8 can build for 908/90a but very slow build - # and produces unusably slow kernels that are huge - "-DCK_USE_FP8_ON_UNSUPPORTED_ARCH=OFF" - ] - ++ lib.optionals (gpuTargets != [ ]) [ - # We intentionally set GPU_ARCHS and not AMD/GPU_TARGETS - # per readme this is required if archs are dissimilar - # In rocm-6.3.x not setting any arch flag worked - # but setting dissimilar arches always failed - "-DGPU_ARCHS=${lib.concatStringsSep ";" gpuTargets}" - ] - ++ lib.optionals buildTests [ - "-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names - ]; + # FP8 can build for 908/90a but very slow build + # and produces unusably slow kernels that are huge + "-DCK_USE_FP8_ON_UNSUPPORTED_ARCH=OFF" + ] + ++ lib.optionals (gpuTargets != [ ]) [ + # We intentionally set GPU_ARCHS and not AMD/GPU_TARGETS + # per readme this is required if archs are dissimilar + # In rocm-6.3.x not setting any arch flag worked + # but setting dissimilar arches always failed + "-DGPU_ARCHS=${lib.concatStringsSep ";" gpuTargets}" + ] + ++ lib.optionals buildTests [ + "-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names + ]; # No flags to build selectively it seems... postPatch = diff --git a/pkgs/development/rocm-modules/6/composable_kernel/default.nix b/pkgs/development/rocm-modules/6/composable_kernel/default.nix index dc8d6c3506f9..0ec02b962cc1 100644 --- a/pkgs/development/rocm-modules/6/composable_kernel/default.nix +++ b/pkgs/development/rocm-modules/6/composable_kernel/default.nix @@ -184,20 +184,18 @@ let # Nix/nixpkgs doesn't really have any infra to tell it that this build is unusually memory hungry # So, bodge. Otherwise you end up having to build all of ROCm with a low core limit when # it's only this package that has trouble. - preConfigure = - old.preConfigure or "" - + '' - MEM_GB_TOTAL=$(awk '/MemTotal/ { printf "%d \n", $2/1024/1024 }' /proc/meminfo) - MEM_GB_AVAILABLE=$(awk '/MemAvailable/ { printf "%d \n", $2/1024/1024 }' /proc/meminfo) - APPX_GB=$((MEM_GB_AVAILABLE > MEM_GB_TOTAL ? MEM_GB_TOTAL : MEM_GB_AVAILABLE)) - MAX_CORES=$((1 + APPX_GB/3)) - MAX_CORES=$((MAX_CORES < NIX_BUILD_CORES/3 ? NIX_BUILD_CORES/3 : MAX_CORES)) - export NIX_BUILD_CORES="$((NIX_BUILD_CORES > MAX_CORES ? MAX_CORES : NIX_BUILD_CORES))" - echo "Picked new core limit NIX_BUILD_CORES=$NIX_BUILD_CORES based on available mem: $APPX_GB GB" - cmakeFlagsArray+=( - "-DCK_PARALLEL_COMPILE_JOBS=$NIX_BUILD_CORES" - ) - ''; + preConfigure = old.preConfigure or "" + '' + MEM_GB_TOTAL=$(awk '/MemTotal/ { printf "%d \n", $2/1024/1024 }' /proc/meminfo) + MEM_GB_AVAILABLE=$(awk '/MemAvailable/ { printf "%d \n", $2/1024/1024 }' /proc/meminfo) + APPX_GB=$((MEM_GB_AVAILABLE > MEM_GB_TOTAL ? MEM_GB_TOTAL : MEM_GB_AVAILABLE)) + MAX_CORES=$((1 + APPX_GB/3)) + MAX_CORES=$((MAX_CORES < NIX_BUILD_CORES/3 ? NIX_BUILD_CORES/3 : MAX_CORES)) + export NIX_BUILD_CORES="$((NIX_BUILD_CORES > MAX_CORES ? MAX_CORES : NIX_BUILD_CORES))" + echo "Picked new core limit NIX_BUILD_CORES=$NIX_BUILD_CORES based on available mem: $APPX_GB GB" + cmakeFlagsArray+=( + "-DCK_PARALLEL_COMPILE_JOBS=$NIX_BUILD_CORES" + ) + ''; cmakeFlags = old.cmakeFlags ++ extraCmakeFlags; # Early exit after build phase with success, skips fixups etc # Will get copied back into /build of the final CK diff --git a/pkgs/development/rocm-modules/6/hipblas/default.nix b/pkgs/development/rocm-modules/6/hipblas/default.nix index 22706ff562b5..ca236f1b85ff 100644 --- a/pkgs/development/rocm-modules/6/hipblas/default.nix +++ b/pkgs/development/rocm-modules/6/hipblas/default.nix @@ -25,19 +25,18 @@ stdenv.mkDerivation (finalAttrs: { pname = "hipblas"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -69,42 +68,40 @@ stdenv.mkDerivation (finalAttrs: { propagatedBuildInputs = [ hipblas-common ]; - buildInputs = - [ - rocblas - rocprim - rocsparse - rocsolver - ] - ++ lib.optionals buildTests [ - gtest - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - lapack-reference - ]; + buildInputs = [ + rocblas + rocprim + rocsparse + rocsolver + ] + ++ lib.optionals buildTests [ + gtest + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + lapack-reference + ]; - cmakeFlags = - [ - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_CXX_COMPILER=${lib.getExe' clr "hipcc"}" - # Upstream is migrating to amdclang++, it is likely this will be correct in next version bump - #"-DCMAKE_CXX_COMPILER=${lib.getBin clr}/bin/amdclang++" - # Manually define CMAKE_INSTALL_ - # See: https://github.com/NixOS/nixpkgs/pull/197838 - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DAMDGPU_TARGETS=${rocblas.amdgpu_targets}" - ] - ++ lib.optionals buildTests [ - "-DBUILD_CLIENTS_TESTS=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_CLIENTS_BENCHMARKS=ON" - ] - ++ lib.optionals buildSamples [ - "-DBUILD_CLIENTS_SAMPLES=ON" - ]; + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_CXX_COMPILER=${lib.getExe' clr "hipcc"}" + # Upstream is migrating to amdclang++, it is likely this will be correct in next version bump + #"-DCMAKE_CXX_COMPILER=${lib.getBin clr}/bin/amdclang++" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DAMDGPU_TARGETS=${rocblas.amdgpu_targets}" + ] + ++ lib.optionals buildTests [ + "-DBUILD_CLIENTS_TESTS=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ] + ++ lib.optionals buildSamples [ + "-DBUILD_CLIENTS_SAMPLES=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/hipblaslt/default.nix b/pkgs/development/rocm-modules/6/hipblaslt/default.nix index a5ab8ff2ab21..9d47111e9470 100644 --- a/pkgs/development/rocm-modules/6/hipblaslt/default.nix +++ b/pkgs/development/rocm-modules/6/hipblaslt/default.nix @@ -77,19 +77,18 @@ stdenv.mkDerivation ( env.CMAKE_CXX_COMPILER = lib.getExe' clr "amdclang++"; requiredSystemFeatures = [ "big-parallel" ]; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; postPatch = '' mkdir -p build/Tensile/library @@ -137,64 +136,62 @@ stdenv.mkDerivation ( # so deliberately not using ninja ]; - buildInputs = - [ - hipblas-common - tensile' - openmp - libffi - ncurses + buildInputs = [ + hipblas-common + tensile' + openmp + libffi + ncurses - # Tensile deps - not optional, building without tensile isn't actually supported - msgpack # FIXME: not included in cmake! - libxml2 - python3Packages.msgpack - python3Packages.joblib - zlib - zstd - ] - ++ lib.optionals buildTests [ - gtest - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - lapack-reference - ]; + # Tensile deps - not optional, building without tensile isn't actually supported + msgpack # FIXME: not included in cmake! + libxml2 + python3Packages.msgpack + python3Packages.joblib + zlib + zstd + ] + ++ lib.optionals buildTests [ + gtest + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + lapack-reference + ]; - cmakeFlags = - [ - "-Wno-dev" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DVIRTUALENV_PYTHON_EXENAME=${lib.getExe py}" - "-DTENSILE_USE_HIP=ON" - "-DTENSILE_BUILD_CLIENT=OFF" - "-DTENSILE_USE_FLOAT16_BUILTIN=ON" - "-DCMAKE_CXX_COMPILER=${compiler}" - # Manually define CMAKE_INSTALL_ - # See: https://github.com/NixOS/nixpkgs/pull/197838 - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DHIPBLASLT_ENABLE_MARKER=Off" - # FIXME what are the implications of hardcoding this? - "-DTensile_CODE_OBJECT_VERSION=V5" - "-DTensile_COMPILER=${compiler}" - "-DAMDGPU_TARGETS=${gpuTargets'}" - "-DGPU_TARGETS=${gpuTargets'}" - "-DTensile_LIBRARY_FORMAT=msgpack" - ] - ++ lib.optionals (!supportsTargetArches) [ - "-DBUILD_WITH_TENSILE=OFF" - ] - ++ lib.optionals buildTests [ - "-DBUILD_CLIENTS_TESTS=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_CLIENTS_BENCHMARKS=ON" - ] - ++ lib.optionals buildSamples [ - "-DBUILD_CLIENTS_SAMPLES=ON" - ]; + cmakeFlags = [ + "-Wno-dev" + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DVIRTUALENV_PYTHON_EXENAME=${lib.getExe py}" + "-DTENSILE_USE_HIP=ON" + "-DTENSILE_BUILD_CLIENT=OFF" + "-DTENSILE_USE_FLOAT16_BUILTIN=ON" + "-DCMAKE_CXX_COMPILER=${compiler}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DHIPBLASLT_ENABLE_MARKER=Off" + # FIXME what are the implications of hardcoding this? + "-DTensile_CODE_OBJECT_VERSION=V5" + "-DTensile_COMPILER=${compiler}" + "-DAMDGPU_TARGETS=${gpuTargets'}" + "-DGPU_TARGETS=${gpuTargets'}" + "-DTensile_LIBRARY_FORMAT=msgpack" + ] + ++ lib.optionals (!supportsTargetArches) [ + "-DBUILD_WITH_TENSILE=OFF" + ] + ++ lib.optionals buildTests [ + "-DBUILD_CLIENTS_TESTS=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ] + ++ lib.optionals buildSamples [ + "-DBUILD_CLIENTS_SAMPLES=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/hipcub/default.nix b/pkgs/development/rocm-modules/6/hipcub/default.nix index d51b5b36bab9..c559760738aa 100644 --- a/pkgs/development/rocm-modules/6/hipcub/default.nix +++ b/pkgs/development/rocm-modules/6/hipcub/default.nix @@ -19,16 +19,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "hipcub"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -43,35 +42,33 @@ stdenv.mkDerivation (finalAttrs: { clr ]; - buildInputs = - [ - rocprim - ] - ++ lib.optionals buildTests [ - gtest - ] - ++ lib.optionals buildBenchmarks [ - gbenchmark - ]; + buildInputs = [ + rocprim + ] + ++ lib.optionals buildTests [ + gtest + ] + ++ lib.optionals buildBenchmarks [ + gbenchmark + ]; - cmakeFlags = - [ - "-DHIP_ROOT_DIR=${clr}" - # 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_TEST=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_BENCHMARK=ON" - ]; + cmakeFlags = [ + "-DHIP_ROOT_DIR=${clr}" + # 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_TEST=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_BENCHMARK=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/hipfft/default.nix b/pkgs/development/rocm-modules/6/hipfft/default.nix index 80c21f158a77..21507e774c6d 100644 --- a/pkgs/development/rocm-modules/6/hipfft/default.nix +++ b/pkgs/development/rocm-modules/6/hipfft/default.nix @@ -24,19 +24,18 @@ stdenv.mkDerivation (finalAttrs: { pname = "hipfft"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -53,43 +52,41 @@ stdenv.mkDerivation (finalAttrs: { rocm-cmake ]; - buildInputs = - [ - rocfft - ] - ++ lib.optionals (buildTests || buildBenchmarks || buildSamples) [ - gtest - boost - fftw - fftwFloat - openmp - ]; + buildInputs = [ + rocfft + ] + ++ lib.optionals (buildTests || buildBenchmarks || buildSamples) [ + gtest + boost + fftw + fftwFloat + openmp + ]; - cmakeFlags = - [ - "-DCMAKE_C_COMPILER=hipcc" - "-DCMAKE_CXX_COMPILER=hipcc" - "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" - "-DHIP_ROOT_DIR=${clr}" - "-DHIP_PATH=${clr}" - # 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_RIDER=ON" - ] - ++ lib.optionals buildSamples [ - "-DBUILD_CLIENTS_SAMPLES=ON" - ]; + cmakeFlags = [ + "-DCMAKE_C_COMPILER=hipcc" + "-DCMAKE_CXX_COMPILER=hipcc" + "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip" + "-DHIP_ROOT_DIR=${clr}" + "-DHIP_PATH=${clr}" + # 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_RIDER=ON" + ] + ++ lib.optionals buildSamples [ + "-DBUILD_CLIENTS_SAMPLES=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/hiprand/default.nix b/pkgs/development/rocm-modules/6/hiprand/default.nix index f32f4e508a18..d39e01ac2a78 100644 --- a/pkgs/development/rocm-modules/6/hiprand/default.nix +++ b/pkgs/development/rocm-modules/6/hiprand/default.nix @@ -16,13 +16,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "hiprand"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -39,21 +38,20 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ rocrand ] ++ (lib.optionals buildTests [ gtest ]); - cmakeFlags = - [ - "-DHIP_ROOT_DIR=${clr}" - # 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_TEST=ON" - ]; + cmakeFlags = [ + "-DHIP_ROOT_DIR=${clr}" + # 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_TEST=ON" + ]; postInstall = lib.optionalString buildTests '' mkdir -p $test/bin diff --git a/pkgs/development/rocm-modules/6/hipsolver/default.nix b/pkgs/development/rocm-modules/6/hipsolver/default.nix index dbc0b0c43c3d..d87c58eb3dbf 100644 --- a/pkgs/development/rocm-modules/6/hipsolver/default.nix +++ b/pkgs/development/rocm-modules/6/hipsolver/default.nix @@ -23,19 +23,18 @@ stdenv.mkDerivation (finalAttrs: { pname = "hipsolver"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -51,39 +50,37 @@ stdenv.mkDerivation (finalAttrs: { gfortran ]; - buildInputs = - [ - rocblas - rocsolver - rocsparse - suitesparse - ] - ++ lib.optionals buildTests [ - gtest - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - lapack-reference - ]; + buildInputs = [ + rocblas + rocsolver + rocsparse + suitesparse + ] + ++ 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" - "-DBUILD_WITH_SPARSE=OFF" # FIXME: broken - can't find suitesparse/cholmod, looks fixed in master - ] - ++ lib.optionals buildTests [ - "-DBUILD_CLIENTS_TESTS=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_CLIENTS_BENCHMARKS=ON" - ] - ++ lib.optionals buildSamples [ - "-DBUILD_CLIENTS_SAMPLES=ON" - ]; + 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" + "-DBUILD_WITH_SPARSE=OFF" # FIXME: broken - can't find suitesparse/cholmod, looks fixed in master + ] + ++ lib.optionals buildTests [ + "-DBUILD_CLIENTS_TESTS=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ] + ++ lib.optionals buildSamples [ + "-DBUILD_CLIENTS_SAMPLES=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/hipsparse/default.nix b/pkgs/development/rocm-modules/6/hipsparse/default.nix index 5a318c7fe1e2..0a1795d3ab16 100644 --- a/pkgs/development/rocm-modules/6/hipsparse/default.nix +++ b/pkgs/development/rocm-modules/6/hipsparse/default.nix @@ -22,16 +22,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "hipsparse"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -47,32 +46,30 @@ stdenv.mkDerivation (finalAttrs: { gfortran ]; - buildInputs = - [ - rocsparse - git - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - gtest - ] - ++ lib.optionals (buildTests || buildSamples) [ - openmp - ]; + buildInputs = [ + rocsparse + git + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + gtest + ] + ++ lib.optionals (buildTests || buildSamples) [ + openmp + ]; - 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" - (lib.cmakeBool "BUILD_CLIENTS_TESTS" buildTests) - (lib.cmakeBool "BUILD_CLIENTS_BENCHMARKS" buildBenchmarks) - (lib.cmakeBool "BUILD_CLIENTS_SAMPLES" buildSamples) - ] - ++ lib.optionals (gpuTargets != [ ]) [ - "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - ]; + 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" + (lib.cmakeBool "BUILD_CLIENTS_TESTS" buildTests) + (lib.cmakeBool "BUILD_CLIENTS_BENCHMARKS" buildBenchmarks) + (lib.cmakeBool "BUILD_CLIENTS_SAMPLES" buildSamples) + ] + ++ lib.optionals (gpuTargets != [ ]) [ + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ]; # We have to manually generate the matrices # CMAKE_MATRICES_DIR seems to be reset in clients/tests/CMakeLists.txt diff --git a/pkgs/development/rocm-modules/6/llvm/default.nix b/pkgs/development/rocm-modules/6/llvm/default.nix index 9a1011671a5e..c8fb82fa0235 100644 --- a/pkgs/development/rocm-modules/6/llvm/default.nix +++ b/pkgs/development/rocm-modules/6/llvm/default.nix @@ -381,22 +381,18 @@ rec { # FIXME: Config file in rocmcxx instead of GCC_INSTALL_PREFIX? "-DGCC_INSTALL_PREFIX=${gcc-prefix}" ]; - postFixup = - (old.postFixup or "") - + '' - find $lib -type f -exec remove-references-to -t ${stdenvToBuildRocmLlvm.cc} {} + - find $lib -type f -exec remove-references-to -t ${stdenv.cc} {} + - find $lib -type f -exec remove-references-to -t ${stdenv.cc.cc} {} + - find $lib -type f -exec remove-references-to -t ${stdenv.cc.bintools} {} + - ''; - preConfigure = - (old.preConfigure or "") - + '' - cmakeFlagsArray+=( - '-DCMAKE_C_FLAGS_RELEASE=${llvmExtraCflags}' - '-DCMAKE_CXX_FLAGS_RELEASE=${llvmExtraCflags}' - ) - ''; + postFixup = (old.postFixup or "") + '' + find $lib -type f -exec remove-references-to -t ${stdenvToBuildRocmLlvm.cc} {} + + find $lib -type f -exec remove-references-to -t ${stdenv.cc} {} + + find $lib -type f -exec remove-references-to -t ${stdenv.cc.cc} {} + + find $lib -type f -exec remove-references-to -t ${stdenv.cc.bintools} {} + + ''; + preConfigure = (old.preConfigure or "") + '' + cmakeFlagsArray+=( + '-DCMAKE_C_FLAGS_RELEASE=${llvmExtraCflags}' + '-DCMAKE_CXX_FLAGS_RELEASE=${llvmExtraCflags}' + ) + ''; } ) ) @@ -456,24 +452,23 @@ rec { # Emulate a monolithic ROCm LLVM build to support building ROCm's in-tree LLVM projects rocm-merged-llvm = symlinkJoin { name = "rocm-llvm-merge"; - paths = - [ - llvm - llvm.dev - lld - lld.lib - lld.dev - libunwind - libunwind.dev - compiler-rt - compiler-rt.dev - rocmcxx - ] - ++ lib.optionals useLibcxx [ - libcxx - libcxx.out - libcxx.dev - ]; + paths = [ + llvm + llvm.dev + lld + lld.lib + lld.dev + libunwind + libunwind.dev + compiler-rt + compiler-rt.dev + rocmcxx + ] + ++ lib.optionals useLibcxx [ + libcxx + libcxx.out + libcxx.dev + ]; postBuild = builtins.unsafeDiscardStringContext '' found_files=$(find $out -name '*.cmake') if [ -z "$found_files" ]; then diff --git a/pkgs/development/rocm-modules/6/migraphx/default.nix b/pkgs/development/rocm-modules/6/migraphx/default.nix index 54620d320076..b1b88b1c170c 100644 --- a/pkgs/development/rocm-modules/6/migraphx/default.nix +++ b/pkgs/development/rocm-modules/6/migraphx/default.nix @@ -65,16 +65,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "migraphx"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildDocs [ - "doc" - ] - ++ lib.optionals buildTests [ - "test" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ] + ++ lib.optionals buildTests [ + "test" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -83,23 +82,22 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-h9cTbrMwHeRGVJS/uHQnCXplNcrBqxbhwz2AcAEso0M="; }; - nativeBuildInputs = - [ - pkg-config - cmake - rocm-cmake - clr - python3Packages.python - ] - ++ lib.optionals buildDocs [ - latex - doxygen - sphinx - docutils - ghostscript - python3Packages.sphinx-rtd-theme - python3Packages.breathe - ]; + nativeBuildInputs = [ + pkg-config + cmake + rocm-cmake + clr + python3Packages.python + ] + ++ lib.optionals buildDocs [ + latex + doxygen + sphinx + docutils + ghostscript + python3Packages.sphinx-rtd-theme + python3Packages.breathe + ]; buildInputs = [ openmp @@ -149,23 +147,22 @@ stdenv.mkDerivation (finalAttrs: { "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" ]; - postPatch = - '' - export CXXFLAGS+=" -w -isystem${rocmlir}/include/rocmlir -I${half}/include -I${abseil-cpp}/include -I${hipblas-common}/include" - patchShebangs tools + postPatch = '' + export CXXFLAGS+=" -w -isystem${rocmlir}/include/rocmlir -I${half}/include -I${abseil-cpp}/include -I${hipblas-common}/include" + patchShebangs tools - # `error: '__clang_hip_runtime_wrapper.h' file not found [clang-diagnostic-error]` - substituteInPlace CMakeLists.txt \ - --replace "set(MIGRAPHX_TIDY_ERRORS ALL)" "" - '' - + lib.optionalString (!buildDocs) '' - substituteInPlace CMakeLists.txt \ - --replace "add_subdirectory(doc)" "" - '' - + lib.optionalString (!buildTests) '' - substituteInPlace CMakeLists.txt \ - --replace "add_subdirectory(test)" "" - ''; + # `error: '__clang_hip_runtime_wrapper.h' file not found [clang-diagnostic-error]` + substituteInPlace CMakeLists.txt \ + --replace "set(MIGRAPHX_TIDY_ERRORS ALL)" "" + '' + + lib.optionalString (!buildDocs) '' + substituteInPlace CMakeLists.txt \ + --replace "add_subdirectory(doc)" "" + '' + + lib.optionalString (!buildTests) '' + substituteInPlace CMakeLists.txt \ + --replace "add_subdirectory(test)" "" + ''; # Unfortunately, it seems like we have to call make on this manually preInstall = lib.optionalString buildDocs '' diff --git a/pkgs/development/rocm-modules/6/miopen/default.nix b/pkgs/development/rocm-modules/6/miopen/default.nix index b8e072b9c3fb..3a24c267ffaf 100644 --- a/pkgs/development/rocm-modules/6/miopen/default.nix +++ b/pkgs/development/rocm-modules/6/miopen/default.nix @@ -151,16 +151,15 @@ stdenv.mkDerivation (finalAttrs: { # }) ]; - outputs = - [ - "out" - ] - ++ lib.optionals buildDocs [ - "doc" - ] - ++ lib.optionals buildTests [ - "test" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ] + ++ lib.optionals buildTests [ + "test" + ]; enableParallelBuilding = true; env.ROCM_PATH = clr; env.LD_LIBRARY_PATH = lib.makeLibraryPath [ rocm-runtime ]; @@ -173,73 +172,71 @@ stdenv.mkDerivation (finalAttrs: { clr ]; - buildInputs = - [ - hipblas - hipblas-common - rocblas - rocmlir - half - boost - sqlite - bzip2 - nlohmann_json - frugally-deep - roctracer - rocrand - hipblaslt - ] - ++ lib.optionals withComposableKernel [ - composable_kernel - ] - ++ lib.optionals buildDocs [ - latex - doxygen - sphinx - rocm-docs-core - python3Packages.sphinx-rtd-theme - python3Packages.breathe - python3Packages.myst-parser - ] - ++ lib.optionals buildTests [ - gtest - zlib - ]; + buildInputs = [ + hipblas + hipblas-common + rocblas + rocmlir + half + boost + sqlite + bzip2 + nlohmann_json + frugally-deep + roctracer + rocrand + hipblaslt + ] + ++ lib.optionals withComposableKernel [ + composable_kernel + ] + ++ lib.optionals buildDocs [ + latex + doxygen + sphinx + rocm-docs-core + python3Packages.sphinx-rtd-theme + python3Packages.breathe + python3Packages.myst-parser + ] + ++ lib.optionals buildTests [ + gtest + zlib + ]; - cmakeFlags = - [ - "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - "-DGPU_ARCHS=${lib.concatStringsSep ";" gpuTargets}" - "-DMIOPEN_USE_SQLITE_PERFDB=ON" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DCMAKE_MODULE_PATH=${clr}/hip/cmake" - "-DCMAKE_BUILD_TYPE=Release" + cmakeFlags = [ + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + "-DGPU_ARCHS=${lib.concatStringsSep ";" gpuTargets}" + "-DMIOPEN_USE_SQLITE_PERFDB=ON" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DCMAKE_MODULE_PATH=${clr}/hip/cmake" + "-DCMAKE_BUILD_TYPE=Release" - # needs to stream to stdout so bzcat rather than bunzip2 - "-DUNZIPPER=${bzip2}/bin/bzcat" + # needs to stream to stdout so bzcat rather than bunzip2 + "-DUNZIPPER=${bzip2}/bin/bzcat" - "-DCMAKE_C_COMPILER=amdclang" - "-DCMAKE_CXX_COMPILER=amdclang++" - "-DROCM_PATH=${clr}" - "-DHIP_ROOT_DIR=${clr}" - (lib.cmakeBool "MIOPEN_USE_ROCBLAS" true) - (lib.cmakeBool "MIOPEN_USE_HIPBLASLT" true) - (lib.cmakeBool "MIOPEN_USE_COMPOSABLEKERNEL" withComposableKernel) - (lib.cmakeBool "MIOPEN_USE_HIPRTC" true) - (lib.cmakeBool "MIOPEN_USE_COMGR" true) - "-DCMAKE_HIP_COMPILER_ROCM_ROOT=${clr}" - # Manually define CMAKE_INSTALL_ - # See: https://github.com/NixOS/nixpkgs/pull/197838 - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DMIOPEN_BACKEND=HIP" - ] - ++ lib.optionals buildTests [ - "-DBUILD_TESTS=ON" - "-DMIOPEN_TEST_ALL=ON" - ]; + "-DCMAKE_C_COMPILER=amdclang" + "-DCMAKE_CXX_COMPILER=amdclang++" + "-DROCM_PATH=${clr}" + "-DHIP_ROOT_DIR=${clr}" + (lib.cmakeBool "MIOPEN_USE_ROCBLAS" true) + (lib.cmakeBool "MIOPEN_USE_HIPBLASLT" true) + (lib.cmakeBool "MIOPEN_USE_COMPOSABLEKERNEL" withComposableKernel) + (lib.cmakeBool "MIOPEN_USE_HIPRTC" true) + (lib.cmakeBool "MIOPEN_USE_COMGR" true) + "-DCMAKE_HIP_COMPILER_ROCM_ROOT=${clr}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DMIOPEN_BACKEND=HIP" + ] + ++ lib.optionals buildTests [ + "-DBUILD_TESTS=ON" + "-DMIOPEN_TEST_ALL=ON" + ]; postPatch = '' substituteInPlace cmake/ClangTidy.cmake \ @@ -273,31 +270,30 @@ stdenv.mkDerivation (finalAttrs: { make -j$NIX_BUILD_CORES check ''; - postInstall = - '' - rm $out/bin/install_precompiled_kernels.sh - ln -sf ${gfx900} $out/share/miopen/db/gfx900.kdb - ln -sf ${gfx906} $out/share/miopen/db/gfx906.kdb - ln -sf ${gfx908} $out/share/miopen/db/gfx908.kdb - ln -sf ${gfx90a} $out/share/miopen/db/gfx90a.kdb - ln -sf ${gfx1030} $out/share/miopen/db/gfx1030.kdb - '' - + lib.optionalString buildDocs '' - mv ../doc/html $out/share/doc/miopen-hip - '' - + lib.optionalString buildTests '' - mkdir -p $test/bin - mv bin/test_* $test/bin - patchelf --set-rpath $out/lib:${ - lib.makeLibraryPath ( - finalAttrs.buildInputs - ++ [ - clr - rocm-comgr - ] - ) - } $test/bin/* - ''; + postInstall = '' + rm $out/bin/install_precompiled_kernels.sh + ln -sf ${gfx900} $out/share/miopen/db/gfx900.kdb + ln -sf ${gfx906} $out/share/miopen/db/gfx906.kdb + ln -sf ${gfx908} $out/share/miopen/db/gfx908.kdb + ln -sf ${gfx90a} $out/share/miopen/db/gfx90a.kdb + ln -sf ${gfx1030} $out/share/miopen/db/gfx1030.kdb + '' + + lib.optionalString buildDocs '' + mv ../doc/html $out/share/doc/miopen-hip + '' + + lib.optionalString buildTests '' + mkdir -p $test/bin + mv bin/test_* $test/bin + patchelf --set-rpath $out/lib:${ + lib.makeLibraryPath ( + finalAttrs.buildInputs + ++ [ + clr + rocm-comgr + ] + ) + } $test/bin/* + ''; requiredSystemFeatures = [ "big-parallel" ]; diff --git a/pkgs/development/rocm-modules/6/mivisionx/default.nix b/pkgs/development/rocm-modules/6/mivisionx/default.nix index 34d1fadc2c36..0008b69f404a 100644 --- a/pkgs/development/rocm-modules/6/mivisionx/default.nix +++ b/pkgs/development/rocm-modules/6/mivisionx/default.nix @@ -55,17 +55,16 @@ stdenv.mkDerivation (finalAttrs: { ./0001-set-__STDC_CONSTANT_MACROS-to-make-rocAL-compile.patch ]; - nativeBuildInputs = - [ - cmake - rocm-cmake - clr - pkg-config - ] - ++ lib.optionals buildDocs [ - rocm-docs-core - python3Packages.python - ]; + nativeBuildInputs = [ + cmake + rocm-cmake + clr + pkg-config + ] + ++ lib.optionals buildDocs [ + rocm-docs-core + python3Packages.python + ]; buildInputs = [ miopen @@ -87,33 +86,32 @@ stdenv.mkDerivation (finalAttrs: { python3Packages.torchWithRocm ]; - cmakeFlags = - [ - "-DROCM_PATH=${clr}" - "-DAMDRPP_PATH=${rpp}" - # Manually define CMAKE_INSTALL_ - # See: https://github.com/NixOS/nixpkgs/pull/197838 - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_PREFIX_PYTHON=lib" - "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_omp_LIBRARY=${openmp}/lib" - # "-DAMD_FP16_SUPPORT=ON" `error: typedef redefinition with different types ('__half' vs 'half_float::half')` - ] - ++ lib.optionals (gpuTargets != [ ]) [ - "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - ] - ++ lib.optionals (!useOpenCL && !useCPU) [ - "-DBACKEND=HIP" - ] - ++ lib.optionals (useOpenCL && !useCPU) [ - "-DBACKEND=OCL" - ] - ++ lib.optionals useCPU [ - "-DBACKEND=CPU" - ]; + cmakeFlags = [ + "-DROCM_PATH=${clr}" + "-DAMDRPP_PATH=${rpp}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_PREFIX_PYTHON=lib" + "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_omp_LIBRARY=${openmp}/lib" + # "-DAMD_FP16_SUPPORT=ON" `error: typedef redefinition with different types ('__half' vs 'half_float::half')` + ] + ++ lib.optionals (gpuTargets != [ ]) [ + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ] + ++ lib.optionals (!useOpenCL && !useCPU) [ + "-DBACKEND=HIP" + ] + ++ lib.optionals (useOpenCL && !useCPU) [ + "-DBACKEND=OCL" + ] + ++ lib.optionals useCPU [ + "-DBACKEND=CPU" + ]; postPatch = '' # We need to not use hipcc and define the CXXFLAGS manually due to `undefined hidden symbol: tensorflow:: ...` diff --git a/pkgs/development/rocm-modules/6/rccl/default.nix b/pkgs/development/rocm-modules/6/rccl/default.nix index c74c6287cf21..4e7d32bd4bc4 100644 --- a/pkgs/development/rocm-modules/6/rccl/default.nix +++ b/pkgs/development/rocm-modules/6/rccl/default.nix @@ -36,13 +36,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "rccl${clr.gpuArchSuffix}"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ]; patches = [ ./fix-mainline-support-and-ub.diff @@ -66,45 +65,43 @@ stdenv.mkDerivation (finalAttrs: { autoPatchelfHook # ASAN doesn't add rpath without this ]; - buildInputs = - [ - rocm-smi - gtest - rocprofiler - rocprofiler-register - mscclpp - ] - ++ lib.optionals buildTests [ - chrpath - ]; + buildInputs = [ + rocm-smi + gtest + rocprofiler + rocprofiler-register + mscclpp + ] + ++ lib.optionals buildTests [ + chrpath + ]; - cmakeFlags = - [ - "-DHIP_CLANG_NUM_PARALLEL_JOBS=4" - "-DCMAKE_BUILD_TYPE=Release" - "-DROCM_PATH=${clr}" - "-DHIP_COMPILER=${clr}/bin/amdclang++" - "-DCMAKE_CXX_COMPILER=${clr}/bin/amdclang++" - "-DROCM_PATCH_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" - "-DROCM_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" - "-DBUILD_BFD=OFF" # Can't get it to detect bfd.h - "-DENABLE_MSCCL_KERNEL=ON" - "-DENABLE_MSCCLPP=ON" - "-DMSCCLPP_ROOT=${mscclpp}" - # 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 != [ ]) [ - # AMD can't make up their minds and keep changing which one is used in different projects. - "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - ] - ++ lib.optionals buildTests [ - "-DBUILD_TESTS=ON" - ]; + cmakeFlags = [ + "-DHIP_CLANG_NUM_PARALLEL_JOBS=4" + "-DCMAKE_BUILD_TYPE=Release" + "-DROCM_PATH=${clr}" + "-DHIP_COMPILER=${clr}/bin/amdclang++" + "-DCMAKE_CXX_COMPILER=${clr}/bin/amdclang++" + "-DROCM_PATCH_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" + "-DROCM_VERSION=${rocm-core.ROCM_LIBPATCH_VERSION}" + "-DBUILD_BFD=OFF" # Can't get it to detect bfd.h + "-DENABLE_MSCCL_KERNEL=ON" + "-DENABLE_MSCCLPP=ON" + "-DMSCCLPP_ROOT=${mscclpp}" + # 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 != [ ]) [ + # AMD can't make up their minds and keep changing which one is used in different projects. + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ] + ++ lib.optionals buildTests [ + "-DBUILD_TESTS=ON" + ]; # -O2 and -fno-strict-aliasing due to UB issues in RCCL :c # Reported upstream diff --git a/pkgs/development/rocm-modules/6/rdc/default.nix b/pkgs/development/rocm-modules/6/rdc/default.nix index a19f2c9aa51f..36f85f90c3dc 100644 --- a/pkgs/development/rocm-modules/6/rdc/default.nix +++ b/pkgs/development/rocm-modules/6/rdc/default.nix @@ -50,16 +50,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rdc"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildDocs [ - "doc" - ] - ++ lib.optionals buildTests [ - "test" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ] + ++ lib.optionals buildTests [ + "test" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -68,67 +67,63 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-s/31b8/Kn5l1QJ941UMSB8SCzpvODsPfOLMmEBUYYmY="; }; - nativeBuildInputs = - [ - cmake - protobuf - ] - ++ lib.optionals buildDocs [ - doxygen - graphviz - latex - ]; + nativeBuildInputs = [ + cmake + protobuf + ] + ++ lib.optionals buildDocs [ + doxygen + graphviz + latex + ]; - buildInputs = - [ - amdsmi - rocm-smi - rocm-runtime - libcap - libdrm - grpc - openssl - ] - ++ lib.optionals buildTests [ - gtest - ]; + buildInputs = [ + amdsmi + rocm-smi + rocm-runtime + libcap + libdrm + grpc + openssl + ] + ++ lib.optionals buildTests [ + gtest + ]; CXXFLAGS = "-I${libcap.dev}/include"; - cmakeFlags = - [ - "-DCMAKE_VERBOSE_MAKEFILE=OFF" - "-DRDC_INSTALL_PREFIX=${placeholder "out"}" - "-DBUILD_ROCRTEST=ON" - "-DRSMI_INC_DIR=${rocm-smi}/include" - "-DRSMI_LIB_DIR=${rocm-smi}/lib" - "-DGRPC_ROOT=${grpc}" - # Manually define CMAKE_INSTALL_ - # See: https://github.com/NixOS/nixpkgs/pull/197838 - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_LIBEXECDIR=libexec" - "-DCMAKE_INSTALL_DOCDIR=doc" - ] - ++ lib.optionals buildTests [ - "-DBUILD_TESTS=ON" - ]; + cmakeFlags = [ + "-DCMAKE_VERBOSE_MAKEFILE=OFF" + "-DRDC_INSTALL_PREFIX=${placeholder "out"}" + "-DBUILD_ROCRTEST=ON" + "-DRSMI_INC_DIR=${rocm-smi}/include" + "-DRSMI_LIB_DIR=${rocm-smi}/lib" + "-DGRPC_ROOT=${grpc}" + # Manually define CMAKE_INSTALL_ + # See: https://github.com/NixOS/nixpkgs/pull/197838 + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBEXECDIR=libexec" + "-DCMAKE_INSTALL_DOCDIR=doc" + ] + ++ lib.optionals buildTests [ + "-DBUILD_TESTS=ON" + ]; postPatch = '' substituteInPlace CMakeLists.txt \ --replace "file(STRINGS /etc/os-release LINUX_DISTRO LIMIT_COUNT 1 REGEX \"NAME=\")" "set(LINUX_DISTRO \"NixOS\")" ''; - postInstall = - '' - find $out/bin -executable -type f -exec \ - patchelf {} --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" \; - '' - + lib.optionalString buildTests '' - mkdir -p $test - mv $out/bin/rdctst_tests $test/bin - ''; + postInstall = '' + find $out/bin -executable -type f -exec \ + patchelf {} --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" \; + '' + + lib.optionalString buildTests '' + mkdir -p $test + mv $out/bin/rdctst_tests $test/bin + ''; passthru.updateScript = rocmUpdateScript { name = finalAttrs.pname; diff --git a/pkgs/development/rocm-modules/6/rocalution/default.nix b/pkgs/development/rocm-modules/6/rocalution/default.nix index 785a2f4676a2..c0b7222747fd 100644 --- a/pkgs/development/rocm-modules/6/rocalution/default.nix +++ b/pkgs/development/rocm-modules/6/rocalution/default.nix @@ -25,19 +25,18 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocalution"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -54,47 +53,45 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - rocblas - rocsparse - rocprim - rocrand - openmp - openmpi - ] - ++ lib.optionals buildTests [ - gtest - ]; + buildInputs = [ + rocblas + rocsparse + rocprim + rocrand + openmp + openmpi + ] + ++ lib.optionals buildTests [ + gtest + ]; CXXFLAGS = "-I${openmp.dev}/include"; - cmakeFlags = - [ - "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_omp_LIBRARY=${openmp}/lib" - "-DROCM_PATH=${clr}" - "-DHIP_ROOT_DIR=${clr}" - "-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}" - "-DGPU_TARGETS=${lib.strings.concatStringsSep ";" gpuTargets}" - ] - ++ lib.optionals buildTests [ - "-DBUILD_CLIENTS_TESTS=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_CLIENTS_BENCHMARKS=ON" - ]; + cmakeFlags = [ + "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_omp_LIBRARY=${openmp}/lib" + "-DROCM_PATH=${clr}" + "-DHIP_ROOT_DIR=${clr}" + "-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}" + "-DGPU_TARGETS=${lib.strings.concatStringsSep ";" gpuTargets}" + ] + ++ lib.optionals buildTests [ + "-DBUILD_CLIENTS_TESTS=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/rocblas/default.nix b/pkgs/development/rocm-modules/6/rocblas/default.nix index 110b96ec118b..350e8bfc3fcf 100644 --- a/pkgs/development/rocm-modules/6/rocblas/default.nix +++ b/pkgs/development/rocm-modules/6/rocblas/default.nix @@ -76,45 +76,43 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-IYcrVcGH4yZDkFZeNOJPfG0qsPS/WiH0fTSUSdo1BH4="; }; - nativeBuildInputs = - [ - cmake - # no ninja, it buffers console output and nix times out long periods of no output - rocm-cmake - clr - git - ] - ++ lib.optionals buildTensile [ - tensile - ]; + nativeBuildInputs = [ + cmake + # no ninja, it buffers console output and nix times out long periods of no output + rocm-cmake + clr + git + ] + ++ lib.optionals buildTensile [ + tensile + ]; - buildInputs = - [ - python3 - hipblas-common - ] - ++ lib.optionals withHipBlasLt [ - hipblaslt - ] - ++ lib.optionals buildTensile [ - zstd - msgpack - libxml2 - python3Packages.msgpack - python3Packages.zstandard - ] - ++ lib.optionals buildTests [ - gtest - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - gfortran - openmp - amd-blis - rocm-smi - ] - ++ lib.optionals (buildTensile || buildTests || buildBenchmarks) [ - python3Packages.pyyaml - ]; + buildInputs = [ + python3 + hipblas-common + ] + ++ lib.optionals withHipBlasLt [ + hipblaslt + ] + ++ lib.optionals buildTensile [ + zstd + msgpack + libxml2 + python3Packages.msgpack + python3Packages.zstandard + ] + ++ lib.optionals buildTests [ + gtest + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + gfortran + openmp + amd-blis + rocm-smi + ] + ++ lib.optionals (buildTensile || buildTests || buildBenchmarks) [ + python3Packages.pyyaml + ]; dontStrip = true; env.CXXFLAGS = @@ -126,42 +124,41 @@ stdenv.mkDerivation (finalAttrs: { ) "-Wl,--as-needed -L${amd-blis}/lib -lblis-mt -lcblas"; env.TENSILE_ROCM_ASSEMBLER_PATH = "${stdenv.cc}/bin/clang++"; - cmakeFlags = - [ - (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") - (lib.cmakeBool "CMAKE_VERBOSE_MAKEFILE" true) - (lib.cmakeFeature "CMAKE_EXECUTE_PROCESS_COMMAND_ECHO" "STDERR") - (lib.cmakeFeature "CMAKE_Fortran_COMPILER" "${lib.getBin gfortran}/bin/gfortran") - (lib.cmakeFeature "CMAKE_Fortran_COMPILER_AR" "${lib.getBin gfortran}/bin/ar") - (lib.cmakeFeature "CMAKE_Fortran_COMPILER_RANLIB" "${lib.getBin gfortran}/bin/ranlib") - (lib.cmakeFeature "python" "python3") - (lib.cmakeFeature "SUPPORTED_TARGETS" gpuTargets') - (lib.cmakeFeature "AMDGPU_TARGETS" gpuTargets') - (lib.cmakeFeature "GPU_TARGETS" gpuTargets') - (lib.cmakeBool "BUILD_WITH_TENSILE" buildTensile) - (lib.cmakeBool "ROCM_SYMLINK_LIBS" false) - (lib.cmakeFeature "ROCBLAS_TENSILE_LIBRARY_DIR" "lib/rocblas") - (lib.cmakeBool "BUILD_WITH_HIPBLASLT" withHipBlasLt) - (lib.cmakeBool "BUILD_CLIENTS_TESTS" buildTests) - (lib.cmakeBool "BUILD_CLIENTS_BENCHMARKS" buildBenchmarks) - (lib.cmakeBool "BUILD_CLIENTS_SAMPLES" buildBenchmarks) - (lib.cmakeBool "BUILD_OFFLOAD_COMPRESS" true) - # Temporarily set variables to work around upstream CMakeLists issue - # Can be removed once https://github.com/ROCm/rocm-cmake/issues/121 is fixed - "-DCMAKE_INSTALL_BINDIR=bin" - "-DCMAKE_INSTALL_INCLUDEDIR=include" - "-DCMAKE_INSTALL_LIBDIR=lib" - ] - ++ lib.optionals buildTensile [ - "-DCPACK_SET_DESTDIR=OFF" - "-DLINK_BLIS=ON" - "-DTensile_CODE_OBJECT_VERSION=default" - "-DTensile_LOGIC=asm_full" - "-DTensile_LIBRARY_FORMAT=msgpack" - (lib.cmakeBool "BUILD_WITH_PIP" false) - (lib.cmakeBool "Tensile_SEPARATE_ARCHITECTURES" tensileSepArch) - (lib.cmakeBool "Tensile_LAZY_LIBRARY_LOADING" tensileLazyLib) - ]; + cmakeFlags = [ + (lib.cmakeFeature "CMAKE_BUILD_TYPE" "Release") + (lib.cmakeBool "CMAKE_VERBOSE_MAKEFILE" true) + (lib.cmakeFeature "CMAKE_EXECUTE_PROCESS_COMMAND_ECHO" "STDERR") + (lib.cmakeFeature "CMAKE_Fortran_COMPILER" "${lib.getBin gfortran}/bin/gfortran") + (lib.cmakeFeature "CMAKE_Fortran_COMPILER_AR" "${lib.getBin gfortran}/bin/ar") + (lib.cmakeFeature "CMAKE_Fortran_COMPILER_RANLIB" "${lib.getBin gfortran}/bin/ranlib") + (lib.cmakeFeature "python" "python3") + (lib.cmakeFeature "SUPPORTED_TARGETS" gpuTargets') + (lib.cmakeFeature "AMDGPU_TARGETS" gpuTargets') + (lib.cmakeFeature "GPU_TARGETS" gpuTargets') + (lib.cmakeBool "BUILD_WITH_TENSILE" buildTensile) + (lib.cmakeBool "ROCM_SYMLINK_LIBS" false) + (lib.cmakeFeature "ROCBLAS_TENSILE_LIBRARY_DIR" "lib/rocblas") + (lib.cmakeBool "BUILD_WITH_HIPBLASLT" withHipBlasLt) + (lib.cmakeBool "BUILD_CLIENTS_TESTS" buildTests) + (lib.cmakeBool "BUILD_CLIENTS_BENCHMARKS" buildBenchmarks) + (lib.cmakeBool "BUILD_CLIENTS_SAMPLES" buildBenchmarks) + (lib.cmakeBool "BUILD_OFFLOAD_COMPRESS" true) + # Temporarily set variables to work around upstream CMakeLists issue + # Can be removed once https://github.com/ROCm/rocm-cmake/issues/121 is fixed + "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBDIR=lib" + ] + ++ lib.optionals buildTensile [ + "-DCPACK_SET_DESTDIR=OFF" + "-DLINK_BLIS=ON" + "-DTensile_CODE_OBJECT_VERSION=default" + "-DTensile_LOGIC=asm_full" + "-DTensile_LIBRARY_FORMAT=msgpack" + (lib.cmakeBool "BUILD_WITH_PIP" false) + (lib.cmakeBool "Tensile_SEPARATE_ARCHITECTURES" tensileSepArch) + (lib.cmakeBool "Tensile_LAZY_LIBRARY_LOADING" tensileLazyLib) + ]; passthru.amdgpu_targets = gpuTargets'; diff --git a/pkgs/development/rocm-modules/6/rocdbgapi/default.nix b/pkgs/development/rocm-modules/6/rocdbgapi/default.nix index 8226f62bf0f3..16ef4b115bdd 100644 --- a/pkgs/development/rocm-modules/6/rocdbgapi/default.nix +++ b/pkgs/development/rocm-modules/6/rocdbgapi/default.nix @@ -45,13 +45,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocdbgapi"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildDocs [ - "doc" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -60,17 +59,16 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-6itfBrWVspobU47aiJAOQoxT8chwrq9scRn0or3bXto="; }; - nativeBuildInputs = - [ - cmake - rocm-cmake - git - ] - ++ lib.optionals buildDocs [ - latex - doxygen - graphviz - ]; + nativeBuildInputs = [ + cmake + rocm-cmake + git + ] + ++ lib.optionals buildDocs [ + latex + doxygen + graphviz + ]; buildInputs = [ rocm-comgr diff --git a/pkgs/development/rocm-modules/6/rocfft/default.nix b/pkgs/development/rocm-modules/6/rocfft/default.nix index d8ae87d509c1..dc64f6bf3e93 100644 --- a/pkgs/development/rocm-modules/6/rocfft/default.nix +++ b/pkgs/development/rocm-modules/6/rocfft/default.nix @@ -39,20 +39,19 @@ stdenv.mkDerivation (finalAttrs: { # due to a long period with no terminal output buildInputs = [ sqlite ]; - cmakeFlags = - [ - "-DCMAKE_C_COMPILER=hipcc" - "-DCMAKE_CXX_COMPILER=hipcc" - "-DSQLITE_USE_SYSTEM_PACKAGE=ON" - # 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}" - ]; + cmakeFlags = [ + "-DCMAKE_C_COMPILER=hipcc" + "-DCMAKE_CXX_COMPILER=hipcc" + "-DSQLITE_USE_SYSTEM_PACKAGE=ON" + # 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}" + ]; passthru = { test = stdenv.mkDerivation { diff --git a/pkgs/development/rocm-modules/6/rocmlir/default.nix b/pkgs/development/rocm-modules/6/rocmlir/default.nix index 13ffe4ada1bd..480b9d2fa48d 100644 --- a/pkgs/development/rocm-modules/6/rocmlir/default.nix +++ b/pkgs/development/rocm-modules/6/rocmlir/default.nix @@ -43,13 +43,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocmlir${suffix}"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals (!buildRockCompiler) [ - "external" - ]; + outputs = [ + "out" + ] + ++ lib.optionals (!buildRockCompiler) [ + "external" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -82,26 +81,25 @@ stdenv.mkDerivation (finalAttrs: { ./initparamdata-sort-const.patch ]; - cmakeFlags = - [ - "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" - "-DCMAKE_BUILD_TYPE=Release" - "-DLLVM_USE_LINKER=lld" - "-DLLVM_ENABLE_ZSTD=FORCE_ON" - "-DLLVM_ENABLE_ZLIB=FORCE_ON" - "-DLLVM_ENABLE_LIBCXX=ON" - "-DLLVM_ENABLE_TERMINFO=ON" - "-DROCM_PATH=${clr}" - # 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.cmakeBool "BUILD_FAT_LIBROCKCOMPILER" buildRockCompiler) - ] - ++ lib.optionals (!buildRockCompiler) [ - "-DROCM_TEST_CHIPSET=gfx000" - ]; + cmakeFlags = [ + "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}" + "-DCMAKE_BUILD_TYPE=Release" + "-DLLVM_USE_LINKER=lld" + "-DLLVM_ENABLE_ZSTD=FORCE_ON" + "-DLLVM_ENABLE_ZLIB=FORCE_ON" + "-DLLVM_ENABLE_LIBCXX=ON" + "-DLLVM_ENABLE_TERMINFO=ON" + "-DROCM_PATH=${clr}" + # 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.cmakeBool "BUILD_FAT_LIBROCKCOMPILER" buildRockCompiler) + ] + ++ lib.optionals (!buildRockCompiler) [ + "-DROCM_TEST_CHIPSET=gfx000" + ]; postPatch = '' patchShebangs mlir diff --git a/pkgs/development/rocm-modules/6/rocprim/default.nix b/pkgs/development/rocm-modules/6/rocprim/default.nix index 87505bee0d7a..1b92663403c4 100644 --- a/pkgs/development/rocm-modules/6/rocprim/default.nix +++ b/pkgs/development/rocm-modules/6/rocprim/default.nix @@ -17,16 +17,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocprim"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -49,24 +48,23 @@ stdenv.mkDerivation (finalAttrs: { gbenchmark ]; - cmakeFlags = - [ - "-DCMAKE_BUILD_TYPE=Release" - # 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_TEST=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_BENCHMARK=ON" - ]; + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + # 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_TEST=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_BENCHMARK=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/rocrand/default.nix b/pkgs/development/rocm-modules/6/rocrand/default.nix index d0796c1267b8..d58e596d97a8 100644 --- a/pkgs/development/rocm-modules/6/rocrand/default.nix +++ b/pkgs/development/rocm-modules/6/rocrand/default.nix @@ -17,16 +17,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocrand${clr.gpuArchSuffix}"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -49,24 +48,23 @@ stdenv.mkDerivation (finalAttrs: { gbenchmark ]; - cmakeFlags = - [ - "-DHIP_ROOT_DIR=${clr}" - # 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_TEST=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_BENCHMARK=ON" - ]; + cmakeFlags = [ + "-DHIP_ROOT_DIR=${clr}" + # 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_TEST=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_BENCHMARK=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/rocsolver/default.nix b/pkgs/development/rocm-modules/6/rocsolver/default.nix index 317690b40e8b..b2f3764d2e0b 100644 --- a/pkgs/development/rocm-modules/6/rocsolver/default.nix +++ b/pkgs/development/rocm-modules/6/rocsolver/default.nix @@ -37,16 +37,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocsolver${clr.gpuArchSuffix}"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -55,54 +54,51 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-+sGU+0CB48iolJSyYo+xH36q5LCUp+nKtOYbguzMuhg="; }; - nativeBuildInputs = - [ - cmake - # no ninja, it buffers console output and nix times out long periods of no output - rocm-cmake - clr - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - gfortran - ]; + nativeBuildInputs = [ + cmake + # no ninja, it buffers console output and nix times out long periods of no output + rocm-cmake + clr + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + gfortran + ]; - buildInputs = - [ - # FIXME: rocblas and rocsolver can't build in parallel - # but rocsolver doesn't need rocblas' offload builds at build time - # could we build against a rocblas-minimal? - rocblas - rocprim - rocsparse - fmt - ] - ++ lib.optionals buildTests [ - gtest - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - lapack-reference - ]; + buildInputs = [ + # FIXME: rocblas and rocsolver can't build in parallel + # but rocsolver doesn't need rocblas' offload builds at build time + # could we build against a rocblas-minimal? + rocblas + rocprim + rocsparse + fmt + ] + ++ lib.optionals buildTests [ + gtest + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + lapack-reference + ]; - cmakeFlags = - [ - "-DHIP_CLANG_NUM_PARALLEL_JOBS=4" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - # 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" - ]; + cmakeFlags = [ + "-DHIP_CLANG_NUM_PARALLEL_JOBS=4" + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + # 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 '' diff --git a/pkgs/development/rocm-modules/6/rocsparse/default.nix b/pkgs/development/rocm-modules/6/rocsparse/default.nix index b4a1ead7608a..ee7fd4d96f15 100644 --- a/pkgs/development/rocm-modules/6/rocsparse/default.nix +++ b/pkgs/development/rocm-modules/6/rocsparse/default.nix @@ -22,16 +22,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocsparse${clr.gpuArchSuffix}"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ]; + outputs = [ + "out" + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -48,38 +47,36 @@ stdenv.mkDerivation (finalAttrs: { gfortran ]; - buildInputs = - [ - rocprim - git - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - gtest - boost - python3Packages.python - python3Packages.pyyaml - ]; + buildInputs = [ + rocprim + git + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + gtest + boost + python3Packages.python + python3Packages.pyyaml + ]; - cmakeFlags = - [ - "-DCMAKE_BUILD_TYPE=Release" - # 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 || buildBenchmarks) [ - "-DBUILD_CLIENTS_TESTS=ON" - "-DCMAKE_MATRICES_DIR=/build/source/matrices" - "-Dpython=python3" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_CLIENTS_BENCHMARKS=ON" - ]; + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + # 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 || buildBenchmarks) [ + "-DBUILD_CLIENTS_TESTS=ON" + "-DCMAKE_MATRICES_DIR=/build/source/matrices" + "-Dpython=python3" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_CLIENTS_BENCHMARKS=ON" + ]; # We have to manually generate the matrices postPatch = lib.optionalString (buildTests || buildBenchmarks) '' diff --git a/pkgs/development/rocm-modules/6/rocthrust/default.nix b/pkgs/development/rocm-modules/6/rocthrust/default.nix index 06cd7a552aeb..0a5254f60b95 100644 --- a/pkgs/development/rocm-modules/6/rocthrust/default.nix +++ b/pkgs/development/rocm-modules/6/rocthrust/default.nix @@ -17,16 +17,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocthrust"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildTests [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildTests [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -46,24 +45,23 @@ stdenv.mkDerivation (finalAttrs: { gtest ]; - cmakeFlags = - [ - "-DHIP_ROOT_DIR=${clr}" - # 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_TEST=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DBUILD_BENCHMARKS=ON" - ]; + cmakeFlags = [ + "-DHIP_ROOT_DIR=${clr}" + # 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_TEST=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DBUILD_BENCHMARKS=ON" + ]; postInstall = lib.optionalString buildTests '' diff --git a/pkgs/development/rocm-modules/6/roctracer/default.nix b/pkgs/development/rocm-modules/6/roctracer/default.nix index c0fe6456df95..e45b340c9a63 100644 --- a/pkgs/development/rocm-modules/6/roctracer/default.nix +++ b/pkgs/development/rocm-modules/6/roctracer/default.nix @@ -21,16 +21,15 @@ stdenv.mkDerivation (finalAttrs: { pname = "roctracer"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals buildDocs [ - "doc" - ] - ++ lib.optionals buildTests [ - "test" - ]; + outputs = [ + "out" + ] + ++ lib.optionals buildDocs [ + "doc" + ] + ++ lib.optionals buildTests [ + "test" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -39,15 +38,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-GhnF7rqNLQLLB7nzIp0xNqyqBOwj9ZJ+hzzj1EAaXWU="; }; - nativeBuildInputs = - [ - cmake - clr - ] - ++ lib.optionals buildDocs [ - doxygen - graphviz - ]; + nativeBuildInputs = [ + cmake + clr + ] + ++ lib.optionals buildDocs [ + doxygen + graphviz + ]; buildInputs = [ libxml2 @@ -70,14 +68,13 @@ stdenv.mkDerivation (finalAttrs: { "-Wno-error=array-bounds" ]; - postPatch = - '' - export HIP_DEVICE_LIB_PATH=${rocm-device-libs}/amdgcn/bitcode - '' - + lib.optionalString (!buildTests) '' - substituteInPlace CMakeLists.txt \ - --replace "add_subdirectory(test)" "" - ''; + 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; diff --git a/pkgs/development/rocm-modules/6/rocwmma/default.nix b/pkgs/development/rocm-modules/6/rocwmma/default.nix index 623e6878a283..718f45b18519 100644 --- a/pkgs/development/rocm-modules/6/rocwmma/default.nix +++ b/pkgs/development/rocm-modules/6/rocwmma/default.nix @@ -21,19 +21,18 @@ stdenv.mkDerivation (finalAttrs: { pname = "rocwmma"; version = "6.3.3"; - outputs = - [ - "out" - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - "test" - ] - ++ lib.optionals buildBenchmarks [ - "benchmark" - ] - ++ lib.optionals buildSamples [ - "sample" - ]; + outputs = [ + "out" + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + "test" + ] + ++ lib.optionals buildBenchmarks [ + "benchmark" + ] + ++ lib.optionals buildSamples [ + "sample" + ]; src = fetchFromGitHub { owner = "ROCm"; @@ -52,39 +51,37 @@ stdenv.mkDerivation (finalAttrs: { clr ]; - buildInputs = - [ - openmp - ] - ++ lib.optionals (buildTests || buildBenchmarks) [ - rocm-smi - gtest - rocblas - ]; + buildInputs = [ + openmp + ] + ++ lib.optionals (buildTests || buildBenchmarks) [ + rocm-smi + gtest + rocblas + ]; - cmakeFlags = - [ - "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_omp_LIBRARY=${openmp}/lib" - "-DROCWMMA_BUILD_TESTS=${if buildTests || buildBenchmarks then "ON" else "OFF"}" - "-DROCWMMA_BUILD_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 != [ ]) [ - "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - ] - ++ lib.optionals buildExtendedTests [ - "-DROCWMMA_BUILD_EXTENDED_TESTS=ON" - ] - ++ lib.optionals buildBenchmarks [ - "-DROCWMMA_BUILD_BENCHMARK_TESTS=ON" - "-DROCWMMA_BENCHMARK_WITH_ROCBLAS=ON" - ]; + cmakeFlags = [ + "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_omp_LIBRARY=${openmp}/lib" + "-DROCWMMA_BUILD_TESTS=${if buildTests || buildBenchmarks then "ON" else "OFF"}" + "-DROCWMMA_BUILD_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 != [ ]) [ + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ] + ++ lib.optionals buildExtendedTests [ + "-DROCWMMA_BUILD_EXTENDED_TESTS=ON" + ] + ++ lib.optionals buildBenchmarks [ + "-DROCWMMA_BUILD_BENCHMARK_TESTS=ON" + "-DROCWMMA_BENCHMARK_WITH_ROCBLAS=ON" + ]; postInstall = lib.optionalString (buildTests || buildBenchmarks) '' diff --git a/pkgs/development/rocm-modules/6/rpp/default.nix b/pkgs/development/rocm-modules/6/rpp/default.nix index 64fd8af1cba6..4185c91e079f 100644 --- a/pkgs/development/rocm-modules/6/rpp/default.nix +++ b/pkgs/development/rocm-modules/6/rpp/default.nix @@ -38,16 +38,15 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-METwagek17/DdZGaOTQqvyU6xGt7OBMLHk4YM4KmgtA="; }; - nativeBuildInputs = - [ - cmake - rocm-cmake - clr - ] - ++ lib.optionals buildDocs [ - rocm-docs-core - python3Packages.python - ]; + nativeBuildInputs = [ + cmake + rocm-cmake + clr + ] + ++ lib.optionals buildDocs [ + rocm-docs-core + python3Packages.python + ]; buildInputs = [ half @@ -57,25 +56,24 @@ stdenv.mkDerivation (finalAttrs: { CFLAGS = "-I${openmp.dev}/include"; CXXFLAGS = "-I${openmp.dev}/include"; - cmakeFlags = - [ - "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" - "-DOpenMP_omp_LIBRARY=${openmp}/lib" - "-DROCM_PATH=${clr}" - ] - ++ lib.optionals (gpuTargets != [ ]) [ - "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" - ] - ++ lib.optionals (!useOpenCL && !useCPU) [ - "-DBACKEND=HIP" - ] - ++ lib.optionals (useOpenCL && !useCPU) [ - "-DBACKEND=OCL" - ] - ++ lib.optionals useCPU [ - "-DBACKEND=CPU" - ]; + cmakeFlags = [ + "-DOpenMP_C_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_CXX_INCLUDE_DIR=${openmp.dev}/include" + "-DOpenMP_omp_LIBRARY=${openmp}/lib" + "-DROCM_PATH=${clr}" + ] + ++ lib.optionals (gpuTargets != [ ]) [ + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" + ] + ++ lib.optionals (!useOpenCL && !useCPU) [ + "-DBACKEND=HIP" + ] + ++ lib.optionals (useOpenCL && !useCPU) [ + "-DBACKEND=OCL" + ] + ++ lib.optionals useCPU [ + "-DBACKEND=CPU" + ]; postPatch = lib.optionalString (!useOpenCL && !useCPU) '' # Bad path diff --git a/pkgs/development/rocm-modules/6/tensile/default.nix b/pkgs/development/rocm-modules/6/tensile/default.nix index 6d66513bd402..9446452692f2 100644 --- a/pkgs/development/rocm-modules/6/tensile/default.nix +++ b/pkgs/development/rocm-modules/6/tensile/default.nix @@ -58,21 +58,20 @@ buildPythonPackage rec { buildInputs = [ setuptools ]; - propagatedBuildInputs = - [ - pyyaml - msgpack - pandas - joblib - ] - ++ lib.optionals (!isTensileLite) [ - rich - ] - ++ lib.optionals isTensileLite [ - simplejson - ujson - orjson - ]; + propagatedBuildInputs = [ + pyyaml + msgpack + pandas + joblib + ] + ++ lib.optionals (!isTensileLite) [ + rich + ] + ++ lib.optionals isTensileLite [ + simplejson + ujson + orjson + ]; patches = lib.optional (!isTensileLite) ./tensile-solutionstructs-perf-fix.diff diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix index 479bc6eec29d..0fb92ea07928 100644 --- a/pkgs/development/ruby-modules/bundled-common/default.nix +++ b/pkgs/development/ruby-modules/bundled-common/default.nix @@ -164,7 +164,8 @@ let meta = { platforms = ruby.meta.platforms; - } // meta; + } + // meta; passthru = ( lib.optionalAttrs (pname != null) { diff --git a/pkgs/development/ruby-modules/bundler-app/default.nix b/pkgs/development/ruby-modules/bundler-app/default.nix index 0a0b5818f375..2d6714b55688 100644 --- a/pkgs/development/ruby-modules/bundler-app/default.nix +++ b/pkgs/development/ruby-modules/bundler-app/default.nix @@ -64,7 +64,8 @@ let meta = { mainProgram = pname; inherit (ruby.meta) platforms; - } // meta; + } + // meta; passthru = basicEnv.passthru // { diff --git a/pkgs/development/ruby-modules/bundler-env/default.nix b/pkgs/development/ruby-modules/bundler-env/default.nix index df43ce4c6a36..9510ebf659bd 100644 --- a/pkgs/development/ruby-modules/bundler-env/default.nix +++ b/pkgs/development/ruby-modules/bundler-env/default.nix @@ -90,7 +90,8 @@ else meta = { platforms = ruby.meta.platforms; - } // meta; + } + // meta; passthru = basicEnv.passthru // { diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix index cbac40eaac8b..e746c32fe896 100644 --- a/pkgs/development/ruby-modules/gem-config/default.nix +++ b/pkgs/development/ruby-modules/gem-config/default.nix @@ -142,7 +142,8 @@ in rake bundler pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; propagatedBuildInputs = [ gobject-introspection wrapGAppsHook3 @@ -372,7 +373,8 @@ in pkg-config bundler rake - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; propagatedBuildInputs = [ gobject-introspection wrapGAppsHook3 @@ -385,7 +387,8 @@ in pkg-config bundler rake - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; propagatedBuildInputs = [ gobject-introspection wrapGAppsHook3 @@ -404,18 +407,18 @@ in nativeBuildInputs = [ pkg-config gobject-introspection - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; - buildInputs = - [ - glib - libsysprof-capture - pcre2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linux - libselinux - libsepol - ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; + buildInputs = [ + glib + libsysprof-capture + pcre2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linux + libselinux + libsepol + ]; }; gitlab-markup = attrs: { meta.priority = 1; }; @@ -529,17 +532,16 @@ in }; gtk3 = attrs: { - nativeBuildInputs = - [ - binutils - pkg-config - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linux - libselinux - libsepol - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; + nativeBuildInputs = [ + binutils + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linux + libselinux + libsepol + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; propagatedBuildInputs = [ atk gdk-pixbuf @@ -590,14 +592,15 @@ in }; grpc = attrs: { - nativeBuildInputs = - [ pkg-config ] - ++ lib.optional stdenv.hostPlatform.isDarwin cctools - ++ lib.optional ( - lib.versionAtLeast attrs.version "1.53.0" - && stdenv.hostPlatform.isDarwin - && stdenv.hostPlatform.isAarch64 - ) autoSignDarwinBinariesHook; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optional stdenv.hostPlatform.isDarwin cctools + ++ lib.optional ( + lib.versionAtLeast attrs.version "1.53.0" + && stdenv.hostPlatform.isDarwin + && stdenv.hostPlatform.isAarch64 + ) autoSignDarwinBinariesHook; buildInputs = [ openssl ]; hardeningDisable = [ "format" ]; env = lib.optionalAttrs (lib.versionOlder attrs.version "1.68.1") { @@ -614,19 +617,18 @@ in }) ]; dontBuild = false; - postPatch = - '' - substituteInPlace Makefile \ - --replace '-Wno-invalid-source-encoding' "" - '' - + lib.optionalString (lib.versionOlder attrs.version "1.53.0" && stdenv.hostPlatform.isDarwin) '' - # For < v1.48.0 - substituteInPlace src/ruby/ext/grpc/extconf.rb \ - --replace "ENV['AR'] = 'libtool -o' if RUBY_PLATFORM =~ /darwin/" "" - # For >= v1.48.0 - substituteInPlace src/ruby/ext/grpc/extconf.rb \ - --replace 'apple_toolchain = ' 'apple_toolchain = false && ' - ''; + postPatch = '' + substituteInPlace Makefile \ + --replace '-Wno-invalid-source-encoding' "" + '' + + lib.optionalString (lib.versionOlder attrs.version "1.53.0" && stdenv.hostPlatform.isDarwin) '' + # For < v1.48.0 + substituteInPlace src/ruby/ext/grpc/extconf.rb \ + --replace "ENV['AR'] = 'libtool -o' if RUBY_PLATFORM =~ /darwin/" "" + # For >= v1.48.0 + substituteInPlace src/ruby/ext/grpc/extconf.rb \ + --replace 'apple_toolchain = ' 'apple_toolchain = false && ' + ''; }; hiredis-client = attrs: { @@ -671,15 +673,14 @@ in }; libxml-ruby = attrs: { - buildFlags = - [ - "--with-xml2-lib=${libxml2.out}/lib" - "--with-xml2-include=${libxml2.dev}/include/libxml2" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--with-iconv-dir=${lib.getLib libiconv}" - "--with-opt-include=${lib.getDev libiconv}/include" - ]; + buildFlags = [ + "--with-xml2-lib=${libxml2.out}/lib" + "--with-xml2-include=${libxml2.dev}/include/libxml2" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--with-iconv-dir=${lib.getLib libiconv}" + "--with-opt-include=${lib.getDev libiconv}/include" + ]; }; mathematical = attrs: { @@ -792,22 +793,21 @@ in attrs: ( { - buildFlags = - [ - "--use-system-libraries" - "--with-zlib-lib=${zlib.out}/lib" - "--with-zlib-include=${zlib.dev}/include" - "--with-xml2-lib=${libxml2.out}/lib" - "--with-xml2-include=${libxml2.dev}/include/libxml2" - "--with-xslt-lib=${libxslt.out}/lib" - "--with-xslt-include=${libxslt.dev}/include" - "--with-exslt-lib=${libxslt.out}/lib" - "--with-exslt-include=${libxslt.dev}/include" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "--with-iconv-dir=${libiconv}" - "--with-opt-include=${libiconv}/include" - ]; + buildFlags = [ + "--use-system-libraries" + "--with-zlib-lib=${zlib.out}/lib" + "--with-zlib-include=${zlib.dev}/include" + "--with-xml2-lib=${libxml2.out}/lib" + "--with-xml2-include=${libxml2.dev}/include/libxml2" + "--with-xslt-lib=${libxslt.out}/lib" + "--with-xslt-include=${libxslt.dev}/include" + "--with-exslt-lib=${libxslt.out}/lib" + "--with-exslt-include=${libxslt.dev}/include" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "--with-iconv-dir=${libiconv}" + "--with-opt-include=${libiconv}/include" + ]; } // lib.optionalAttrs stdenv.hostPlatform.isDarwin { buildInputs = [ libxml2 ]; @@ -852,23 +852,23 @@ in pango = attrs: { nativeBuildInputs = [ pkg-config - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; - buildInputs = - [ - libdatrie - libthai - fribidi - harfbuzz - libsysprof-capture - pcre2 - xorg.libpthreadstubs - xorg.libXdmcp - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libselinux - libsepol - util-linux - ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools ]; + buildInputs = [ + libdatrie + libthai + fribidi + harfbuzz + libsysprof-capture + pcre2 + xorg.libpthreadstubs + xorg.libXdmcp + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libselinux + libsepol + util-linux + ]; propagatedBuildInputs = [ gobject-introspection wrapGAppsHook3 @@ -1031,7 +1031,8 @@ in cmake pkg-config which - ] ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; buildInputs = [ openssl libssh2 diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix index 2f677f860f87..0e3c1c4187f2 100644 --- a/pkgs/development/ruby-modules/gem/default.nix +++ b/pkgs/development/ruby-modules/gem/default.nix @@ -115,18 +115,18 @@ lib.makeOverridable ( inherit suffix; gemType = type; - nativeBuildInputs = - [ - ruby - makeWrapper - ] - ++ lib.optionals (type == "git") [ gitMinimal ] - ++ lib.optionals (type != "gem") [ bundler ] - ++ nativeBuildInputs; + nativeBuildInputs = [ + ruby + makeWrapper + ] + ++ lib.optionals (type == "git") [ gitMinimal ] + ++ lib.optionals (type != "gem") [ bundler ] + ++ nativeBuildInputs; buildInputs = [ ruby - ] ++ buildInputs; + ] + ++ buildInputs; #name = builtins.trace (attrs.name or "no attr.name" ) "${namePrefix}${gemName}-${version}"; name = attrs.name or "${namePrefix}${gemName}-${suffix}"; @@ -299,7 +299,8 @@ lib.makeOverridable ( # default to Ruby's platforms platforms = ruby.meta.platforms; mainProgram = gemName; - } // meta; + } + // meta; } ) diff --git a/pkgs/development/skaware-packages/build-skaware-package.nix b/pkgs/development/skaware-packages/build-skaware-package.nix index c9e61fa8afcd..063a1d9461b2 100644 --- a/pkgs/development/skaware-packages/build-skaware-package.nix +++ b/pkgs/development/skaware-packages/build-skaware-package.nix @@ -149,19 +149,18 @@ stdenv.mkDerivation { ${cleanPackaging.checkForRemainingFiles} ''; - passthru = - { - updateScript = nix-update-script { - extraArgs = [ - "--url" - "https://github.com/skarnet/${pname}" - "--override-filename" - "pkgs/development/skaware-packages/${pname}/default.nix" - ]; - }; - } - // passthru - // (if manpages == null then { } else { inherit manpages; }); + passthru = { + updateScript = nix-update-script { + extraArgs = [ + "--url" + "https://github.com/skarnet/${pname}" + "--override-filename" + "pkgs/development/skaware-packages/${pname}/default.nix" + ]; + }; + } + // passthru + // (if manpages == null then { } else { inherit manpages; }); meta = { homepage = "https://skarnet.org/software/${pname}/"; diff --git a/pkgs/development/skaware-packages/s6-networking/default.nix b/pkgs/development/skaware-packages/s6-networking/default.nix index 74d78051ac1a..2c5493ec7b21 100644 --- a/pkgs/development/skaware-packages/s6-networking/default.nix +++ b/pkgs/development/skaware-packages/s6-networking/default.nix @@ -47,33 +47,32 @@ skawarePackages.buildPackage { ]; # TODO: nsss support - configureFlags = - [ - "--libdir=\${lib}/lib" - "--libexecdir=\${lib}/libexec" - "--dynlibdir=\${lib}/lib" - "--bindir=\${bin}/bin" - "--includedir=\${dev}/include" - "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps" - "--with-include=${skalibs.dev}/include" - "--with-include=${execline.dev}/include" - "--with-include=${s6.dev}/include" - "--with-include=${s6-dns.dev}/include" - "--with-lib=${skalibs.lib}/lib" - "--with-lib=${execline.lib}/lib" - "--with-lib=${s6.out}/lib" - "--with-lib=${s6-dns.lib}/lib" - "--with-dynlib=${skalibs.lib}/lib" - "--with-dynlib=${execline.lib}/lib" - "--with-dynlib=${s6.out}/lib" - "--with-dynlib=${s6-dns.lib}/lib" - ] - ++ (lib.optionals sslSupportEnabled [ - "--enable-ssl=${sslSupport}" - "--with-include=${lib.getDev sslLibs.${sslSupport}}/include" - "--with-lib=${lib.getLib sslLibs.${sslSupport}}/lib" - "--with-dynlib=${lib.getLib sslLibs.${sslSupport}}/lib" - ]); + configureFlags = [ + "--libdir=\${lib}/lib" + "--libexecdir=\${lib}/libexec" + "--dynlibdir=\${lib}/lib" + "--bindir=\${bin}/bin" + "--includedir=\${dev}/include" + "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps" + "--with-include=${skalibs.dev}/include" + "--with-include=${execline.dev}/include" + "--with-include=${s6.dev}/include" + "--with-include=${s6-dns.dev}/include" + "--with-lib=${skalibs.lib}/lib" + "--with-lib=${execline.lib}/lib" + "--with-lib=${s6.out}/lib" + "--with-lib=${s6-dns.lib}/lib" + "--with-dynlib=${skalibs.lib}/lib" + "--with-dynlib=${execline.lib}/lib" + "--with-dynlib=${s6.out}/lib" + "--with-dynlib=${s6-dns.lib}/lib" + ] + ++ (lib.optionals sslSupportEnabled [ + "--enable-ssl=${sslSupport}" + "--with-include=${lib.getDev sslLibs.${sslSupport}}/include" + "--with-lib=${lib.getLib sslLibs.${sslSupport}}/lib" + "--with-dynlib=${lib.getLib sslLibs.${sslSupport}}/lib" + ]); postInstall = '' # remove all s6 executables from build directory diff --git a/pkgs/development/skaware-packages/skalibs/default.nix b/pkgs/development/skaware-packages/skalibs/default.nix index bf52599b7591..53ac8cbe2d9c 100644 --- a/pkgs/development/skaware-packages/skalibs/default.nix +++ b/pkgs/development/skaware-packages/skalibs/default.nix @@ -19,39 +19,38 @@ skawarePackages.buildPackage { "out" ]; - configureFlags = - [ - # assume /dev/random works - "--enable-force-devr" - "--libdir=\${lib}/lib" - "--dynlibdir=\${lib}/lib" - "--includedir=\${dev}/include" - "--sysdepdir=\${lib}/lib/skalibs/sysdeps" - # Empty the default path, which would be "/usr/bin:bin". - # It would be set when PATH is empty. This hurts hermeticity. - "--with-default-path=" + configureFlags = [ + # assume /dev/random works + "--enable-force-devr" + "--libdir=\${lib}/lib" + "--dynlibdir=\${lib}/lib" + "--includedir=\${dev}/include" + "--sysdepdir=\${lib}/lib/skalibs/sysdeps" + # Empty the default path, which would be "/usr/bin:bin". + # It would be set when PATH is empty. This hurts hermeticity. + "--with-default-path=" - ] - ++ lib.optionals (stdenv.buildPlatform.config != stdenv.hostPlatform.config) [ - # There's a fallback path for BSDs. - "--with-sysdep-procselfexe=${ - if stdenv.hostPlatform.isLinux then - "/proc/self/exe" - else if stdenv.hostPlatform.isSunOS then - "/proc/self/path/a.out" - else - "none" - }" - # ./configure: sysdep posixspawnearlyreturn cannot be autodetected - # when cross-compiling. Please manually provide a value with the - # --with-sysdep-posixspawnearlyreturn=yes|no|... option. - # - # posixspawnearlyreturn: `yes` if the target has a broken - # `posix_spawn()` implementation that can return before the - # child has successfully exec'ed. That happens with old glibcs - # and some virtual platforms. - "--with-sysdep-posixspawnearlyreturn=no" - ]; + ] + ++ lib.optionals (stdenv.buildPlatform.config != stdenv.hostPlatform.config) [ + # There's a fallback path for BSDs. + "--with-sysdep-procselfexe=${ + if stdenv.hostPlatform.isLinux then + "/proc/self/exe" + else if stdenv.hostPlatform.isSunOS then + "/proc/self/path/a.out" + else + "none" + }" + # ./configure: sysdep posixspawnearlyreturn cannot be autodetected + # when cross-compiling. Please manually provide a value with the + # --with-sysdep-posixspawnearlyreturn=yes|no|... option. + # + # posixspawnearlyreturn: `yes` if the target has a broken + # `posix_spawn()` implementation that can return before the + # child has successfully exec'ed. That happens with old glibcs + # and some virtual platforms. + "--with-sysdep-posixspawnearlyreturn=no" + ]; postInstall = '' rm -rf sysdeps.cfg diff --git a/pkgs/development/tcl-modules/by-name/ti/tix/package.nix b/pkgs/development/tcl-modules/by-name/ti/tix/package.nix index 9257d4a760aa..f7c1c16b5185 100644 --- a/pkgs/development/tcl-modules/by-name/ti/tix/package.nix +++ b/pkgs/development/tcl-modules/by-name/ti/tix/package.nix @@ -13,24 +13,23 @@ tcl.mkTclDerivation { url = "mirror://sourceforge/tix/tix/8.4.3/Tix8.4.3-src.tar.gz"; sha256 = "1jq3dkyk9mqkj4cg7mdk5r0cclqsby9l2b7wrysi0zk5yw7h8bsn"; }; - patches = - [ - (fetchpatch { - name = "tix-8.4.3-tcl8.5.patch"; - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.5.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; - sha256 = "0wzqmcxxq0rqpnjgxz10spw92yhfygnlwv0h8pcx2ycnqiljz6vj"; - }) - # Remove duplicated definition of XLowerWindow - ./duplicated-xlowerwindow.patch - # Fix incompatible function pointer conversions and implicit definition of `panic`. - # `panic` is just `Tcl_Panic`, but it is not defined on Darwin due to a conflict with `mach/mach.h`. - ./fix-clang16.patch - ] - ++ lib.optional (tcl.release == "8.6") (fetchpatch { - name = "tix-8.4.3-tcl8.6.patch"; - url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.6.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; - sha256 = "1jaz0l22xj7x1k4rb9ia6i1psnbwk4pblgq4gfvya7gg7fbb7r36"; - }); + patches = [ + (fetchpatch { + name = "tix-8.4.3-tcl8.5.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.5.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; + sha256 = "0wzqmcxxq0rqpnjgxz10spw92yhfygnlwv0h8pcx2ycnqiljz6vj"; + }) + # Remove duplicated definition of XLowerWindow + ./duplicated-xlowerwindow.patch + # Fix incompatible function pointer conversions and implicit definition of `panic`. + # `panic` is just `Tcl_Panic`, but it is not defined on Darwin due to a conflict with `mach/mach.h`. + ./fix-clang16.patch + ] + ++ lib.optional (tcl.release == "8.6") (fetchpatch { + name = "tix-8.4.3-tcl8.6.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.6.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d"; + sha256 = "1jaz0l22xj7x1k4rb9ia6i1psnbwk4pblgq4gfvya7gg7fbb7r36"; + }); buildInputs = [ tk ]; # the configure script expects to find the location of the sources of # tcl and tk in {tcl,tk}Config.sh diff --git a/pkgs/development/tools/ammonite/default.nix b/pkgs/development/tools/ammonite/default.nix index 7573c528e305..99e254291373 100644 --- a/pkgs/development/tools/ammonite/default.nix +++ b/pkgs/development/tools/ammonite/default.nix @@ -28,15 +28,14 @@ let dontUnpack = true; - installPhase = - '' - install -Dm755 $src $out/bin/amm - sed -i '0,/java/{s|java|${jre}/bin/java|}' $out/bin/amm - '' - + lib.optionalString (disableRemoteLogging) '' - sed -i "0,/ammonite.Main/{s|ammonite.Main'|ammonite.Main' --no-remote-logging|}" $out/bin/amm - sed -i '1i #!/bin/sh' $out/bin/amm - ''; + installPhase = '' + install -Dm755 $src $out/bin/amm + sed -i '0,/java/{s|java|${jre}/bin/java|}' $out/bin/amm + '' + + lib.optionalString (disableRemoteLogging) '' + sed -i "0,/ammonite.Main/{s|ammonite.Main'|ammonite.Main' --no-remote-logging|}" $out/bin/amm + sed -i '1i #!/bin/sh' $out/bin/amm + ''; passthru = { diff --git a/pkgs/development/tools/analysis/qcachegrind/default.nix b/pkgs/development/tools/analysis/qcachegrind/default.nix index 352160006742..b8bda7488a40 100644 --- a/pkgs/development/tools/analysis/qcachegrind/default.nix +++ b/pkgs/development/tools/analysis/qcachegrind/default.nix @@ -28,30 +28,29 @@ stdenv.mkDerivation { dontWrapQtApps = true; - postInstall = - '' - mkdir -p $out/bin - cp -p converters/dprof2calltree $out/bin/dprof2calltree - cp -p converters/memprof2calltree $out/bin/memprof2calltree - cp -p converters/op2calltree $out/bin/op2calltree - cp -p converters/pprof2calltree $out/bin/pprof2calltree - chmod -R +x $out/bin/ - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - mkdir -p $out/Applications - cp cgview/cgview.app/Contents/MacOS/cgview $out/bin - cp -a qcachegrind/qcachegrind.app $out/Applications - '' - else - '' - install qcachegrind/qcachegrind cgview/cgview -t "$out/bin" - install -Dm644 qcachegrind/qcachegrind.desktop -t "$out/share/applications" - install -Dm644 kcachegrind/32-apps-kcachegrind.png "$out/share/icons/hicolor/32x32/apps/kcachegrind.png" - install -Dm644 kcachegrind/48-apps-kcachegrind.png "$out/share/icons/hicolor/48x48/apps/kcachegrind.png" - '' - ); + postInstall = '' + mkdir -p $out/bin + cp -p converters/dprof2calltree $out/bin/dprof2calltree + cp -p converters/memprof2calltree $out/bin/memprof2calltree + cp -p converters/op2calltree $out/bin/op2calltree + cp -p converters/pprof2calltree $out/bin/pprof2calltree + chmod -R +x $out/bin/ + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + mkdir -p $out/Applications + cp cgview/cgview.app/Contents/MacOS/cgview $out/bin + cp -a qcachegrind/qcachegrind.app $out/Applications + '' + else + '' + install qcachegrind/qcachegrind cgview/cgview -t "$out/bin" + install -Dm644 qcachegrind/qcachegrind.desktop -t "$out/share/applications" + install -Dm644 kcachegrind/32-apps-kcachegrind.png "$out/share/icons/hicolor/32x32/apps/kcachegrind.png" + install -Dm644 kcachegrind/48-apps-kcachegrind.png "$out/share/icons/hicolor/48x48/apps/kcachegrind.png" + '' + ); preFixup = '' wrapQtApp "$out/bin/qcachegrind" diff --git a/pkgs/development/tools/analysis/radare2/default.nix b/pkgs/development/tools/analysis/radare2/default.nix index 2fff31fed31d..0ba38fb56811 100644 --- a/pkgs/development/tools/analysis/radare2/default.nix +++ b/pkgs/development/tools/analysis/radare2/default.nix @@ -94,26 +94,25 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - capstone - file - readline - libusb-compat-0_1 - libewf - perl - zlib - openssl - libuv - lz4 - ] - ++ lib.optionals useX11 [ - gtkdialog - vte - gtk2 - ] - ++ lib.optionals rubyBindings [ ruby ] - ++ lib.optionals luaBindings [ lua ]; + buildInputs = [ + capstone + file + readline + libusb-compat-0_1 + libewf + perl + zlib + openssl + libuv + lz4 + ] + ++ lib.optionals useX11 [ + gtkdialog + vte + gtk2 + ] + ++ lib.optionals rubyBindings [ ruby ] + ++ lib.optionals luaBindings [ lua ]; propagatedBuildInputs = [ # radare2 exposes r_lib which depends on these libraries diff --git a/pkgs/development/tools/analysis/rizin/cutter.nix b/pkgs/development/tools/analysis/rizin/cutter.nix index 86d7c2dd36d4..4e1a8fc07a80 100644 --- a/pkgs/development/tools/analysis/rizin/cutter.nix +++ b/pkgs/development/tools/analysis/rizin/cutter.nix @@ -46,20 +46,19 @@ let python3.pkgs.pyside6 ]; - buildInputs = - [ - graphviz - python3 - qt5compat - qtbase - qtsvg - qttools - qtwebengine - rizin - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ]; + buildInputs = [ + graphviz + python3 + qt5compat + qtbase + qtsvg + qttools + qtwebengine + rizin + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ]; cmakeFlags = [ "-DCUTTER_USE_BUNDLED_RIZIN=OFF" diff --git a/pkgs/development/tools/analysis/rizin/default.nix b/pkgs/development/tools/analysis/rizin/default.nix index a5df7ec02e9e..35e6374b623d 100644 --- a/pkgs/development/tools/analysis/rizin/default.nix +++ b/pkgs/development/tools/analysis/rizin/default.nix @@ -76,20 +76,19 @@ let # meson's find_library seems to not use our compiler wrapper if static parameter # is either true/false... We work around by also providing LIBRARY_PATH - preConfigure = - '' - LIBRARY_PATH="" - for b in ${toString (map lib.getLib buildInputs)}; do - if [[ -d "$b/lib" ]]; then - LIBRARY_PATH="$b/lib''${LIBRARY_PATH:+:}$LIBRARY_PATH" - fi - done - export LIBRARY_PATH - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace binrz/rizin/macos_sign.sh \ - --replace 'codesign' '# codesign' - ''; + preConfigure = '' + LIBRARY_PATH="" + for b in ${toString (map lib.getLib buildInputs)}; do + if [[ -d "$b/lib" ]]; then + LIBRARY_PATH="$b/lib''${LIBRARY_PATH:+:}$LIBRARY_PATH" + fi + done + export LIBRARY_PATH + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace binrz/rizin/macos_sign.sh \ + --replace 'codesign' '# codesign' + ''; buildInputs = [ file diff --git a/pkgs/development/tools/analysis/rizin/rz-ghidra.nix b/pkgs/development/tools/analysis/rizin/rz-ghidra.nix index d0808fb07cc8..4348c8da7ffc 100644 --- a/pkgs/development/tools/analysis/rizin/rz-ghidra.nix +++ b/pkgs/development/tools/analysis/rizin/rz-ghidra.nix @@ -28,29 +28,27 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ cmake ]; - buildInputs = - [ - openssl - pugixml - rizin - ] - ++ lib.optionals enableCutterPlugin [ - cutter - qt5compat - qtbase - qtsvg - ]; + buildInputs = [ + openssl + pugixml + rizin + ] + ++ lib.optionals enableCutterPlugin [ + cutter + qt5compat + qtbase + qtsvg + ]; dontWrapQtApps = true; - cmakeFlags = - [ - "-DUSE_SYSTEM_PUGIXML=ON" - ] - ++ lib.optionals enableCutterPlugin [ - "-DBUILD_CUTTER_PLUGIN=ON" - "-DCUTTER_INSTALL_PLUGDIR=share/rizin/cutter/plugins/native" - ]; + cmakeFlags = [ + "-DUSE_SYSTEM_PUGIXML=ON" + ] + ++ lib.optionals enableCutterPlugin [ + "-DBUILD_CUTTER_PLUGIN=ON" + "-DCUTTER_INSTALL_PLUGDIR=share/rizin/cutter/plugins/native" + ]; meta = with lib; { # errors out with undefined symbols from Cutter diff --git a/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix index c78e571adad9..65d9697249f8 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_5/default.nix @@ -230,7 +230,8 @@ stdenv.mkDerivation rec { # disable suspend detection during a build inside Nix as this is # not available inside the darwin sandbox ./bazel_darwin_sandbox.patch - ] ++ lib.optional enableNixHacks ../nix-hacks.patch; + ] + ++ lib.optional enableNixHacks ../nix-hacks.patch; # Additional tests that check bazel’s functionality. Execute # @@ -609,19 +610,18 @@ stdenv.mkDerivation rec { # when a command can’t be found in a bazel build, you might also # need to add it to `defaultShellPath`. - nativeBuildInputs = - [ - installShellFiles - makeWrapper - python3 - unzip - which - zip - python3.pkgs.absl-py # Needed to build fish completion - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - cctools - ]; + nativeBuildInputs = [ + installShellFiles + makeWrapper + python3 + unzip + which + zip + python3.pkgs.absl-py # Needed to build fish completion + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + cctools + ]; # Bazel makes extensive use of symlinks in the WORKSPACE. # This causes problems with infinite symlinks if the build output is in the same location as the @@ -742,18 +742,17 @@ stdenv.mkDerivation rec { # Save paths to hardcoded dependencies so Nix can detect them. # This is needed because the templates get tar’d up into a .jar. - postFixup = - '' - mkdir -p $out/nix-support - echo "${defaultShellPath}" >> $out/nix-support/depends - # The string literal specifying the path to the bazel-rc file is sometimes - # stored non-contiguously in the binary due to gcc optimisations, which leads - # Nix to miss the hash when scanning for dependencies - echo "${bazelRC}" >> $out/nix-support/depends - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - echo "${cctools}" >> $out/nix-support/depends - ''; + postFixup = '' + mkdir -p $out/nix-support + echo "${defaultShellPath}" >> $out/nix-support/depends + # The string literal specifying the path to the bazel-rc file is sometimes + # stored non-contiguously in the binary due to gcc optimisations, which leads + # Nix to miss the hash when scanning for dependencies + echo "${bazelRC}" >> $out/nix-support/depends + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + echo "${cctools}" >> $out/nix-support/depends + ''; dontStrip = true; dontPatchELF = true; diff --git a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix index 2ca251cffe85..27b747e3b67a 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_6/default.nix @@ -292,7 +292,8 @@ stdenv.mkDerivation rec { (replaceVars ../bazel_rc.patch { bazelSystemBazelRCPath = bazelRC; }) - ] ++ lib.optional enableNixHacks ./nix-hacks.patch; + ] + ++ lib.optional enableNixHacks ./nix-hacks.patch; # Additional tests that check bazel’s functionality. Execute # @@ -673,24 +674,24 @@ stdenv.mkDerivation rec { buildInputs = [ buildJdk bashWithDefaultShellUtils - ] ++ defaultShellUtils; + ] + ++ defaultShellUtils; # when a command can’t be found in a bazel build, you might also # need to add it to `defaultShellPath`. - nativeBuildInputs = - [ - installShellFiles - makeWrapper - python3 - unzip - which - zip - python3.pkgs.absl-py # Needed to build fish completion - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - cctools - sigtool - ]; + nativeBuildInputs = [ + installShellFiles + makeWrapper + python3 + unzip + which + zip + python3.pkgs.absl-py # Needed to build fish completion + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + cctools + sigtool + ]; # Bazel makes extensive use of symlinks in the WORKSPACE. # This causes problems with infinite symlinks if the build output is in the same location as the @@ -703,85 +704,83 @@ stdenv.mkDerivation rec { shopt -s dotglob extglob mv !(bazel_src) bazel_src ''; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - # Increasing memory during compilation might be necessary. - # export BAZEL_JAVAC_OPTS="-J-Xmx2g -J-Xms200m" + # Increasing memory during compilation might be necessary. + # export BAZEL_JAVAC_OPTS="-J-Xmx2g -J-Xms200m" - # If EMBED_LABEL isn't set, it'd be auto-detected from CHANGELOG.md - # and `git rev-parse --short HEAD` which would result in - # "3.7.0- (@non-git)" due to non-git build and incomplete changelog. - # Actual bazel releases use scripts/release/common.sh which is based - # on branch/tag information which we don't have with tarball releases. - # Note that .bazelversion is always correct and is based on bazel-* - # executable name, version checks should work fine - export EMBED_LABEL="${version}- (@non-git)" - ${bash}/bin/bash ./bazel_src/compile.sh - ./bazel_src/scripts/generate_bash_completion.sh \ - --bazel=./bazel_src/output/bazel \ - --output=./bazel_src/output/bazel-complete.bash \ - --prepend=./bazel_src/scripts/bazel-complete-header.bash \ - --prepend=./bazel_src/scripts/bazel-complete-template.bash - ${python3}/bin/python3 ./bazel_src/scripts/generate_fish_completion.py \ - --bazel=./bazel_src/output/bazel \ - --output=./bazel_src/output/bazel-complete.fish - '' - + - # disable execlog parser on darwin, since it fails to build - # see https://github.com/NixOS/nixpkgs/pull/273774#issuecomment-1865322055 - lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - # need to change directory for bazel to find the workspace - cd ./bazel_src - # build execlog tooling - export HOME=$(mktemp -d) - ./output/bazel build src/tools/execlog:parser_deploy.jar - cd - + # If EMBED_LABEL isn't set, it'd be auto-detected from CHANGELOG.md + # and `git rev-parse --short HEAD` which would result in + # "3.7.0- (@non-git)" due to non-git build and incomplete changelog. + # Actual bazel releases use scripts/release/common.sh which is based + # on branch/tag information which we don't have with tarball releases. + # Note that .bazelversion is always correct and is based on bazel-* + # executable name, version checks should work fine + export EMBED_LABEL="${version}- (@non-git)" + ${bash}/bin/bash ./bazel_src/compile.sh + ./bazel_src/scripts/generate_bash_completion.sh \ + --bazel=./bazel_src/output/bazel \ + --output=./bazel_src/output/bazel-complete.bash \ + --prepend=./bazel_src/scripts/bazel-complete-header.bash \ + --prepend=./bazel_src/scripts/bazel-complete-template.bash + ${python3}/bin/python3 ./bazel_src/scripts/generate_fish_completion.py \ + --bazel=./bazel_src/output/bazel \ + --output=./bazel_src/output/bazel-complete.fish + '' + + + # disable execlog parser on darwin, since it fails to build + # see https://github.com/NixOS/nixpkgs/pull/273774#issuecomment-1865322055 + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + # need to change directory for bazel to find the workspace + cd ./bazel_src + # build execlog tooling + export HOME=$(mktemp -d) + ./output/bazel build src/tools/execlog:parser_deploy.jar + cd - - runHook postBuild - ''; - - installPhase = - '' - runHook preInstall - - mkdir -p $out/bin - - # official wrapper scripts that searches for $WORKSPACE_ROOT/tools/bazel - # if it can’t find something in tools, it calls $out/bin/bazel-{version}-{os_arch} - # The binary _must_ exist with this naming if your project contains a .bazelversion - # file. - cp ./bazel_src/scripts/packages/bazel.sh $out/bin/bazel - wrapProgram $out/bin/bazel $wrapperfile --suffix PATH : ${defaultShellPath} - mv ./bazel_src/output/bazel $out/bin/bazel-${version}-${system}-${arch} - - '' - + - # disable execlog parser on darwin, since it fails to build - # see https://github.com/NixOS/nixpkgs/pull/273774#issuecomment-1865322055 - (lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - mkdir $out/share - cp ./bazel_src/bazel-bin/src/tools/execlog/parser_deploy.jar $out/share/parser_deploy.jar - cat < $out/bin/bazel-execlog - #!${runtimeShell} -e - ${runJdk}/bin/java -jar $out/share/parser_deploy.jar \$@ - EOF - chmod +x $out/bin/bazel-execlog - '') - + '' - # shell completion files - installShellCompletion --bash \ - --name bazel.bash \ - ./bazel_src/output/bazel-complete.bash - installShellCompletion --zsh \ - --name _bazel \ - ./bazel_src/scripts/zsh_completion/_bazel - installShellCompletion --fish \ - --name bazel.fish \ - ./bazel_src/output/bazel-complete.fish + runHook postBuild ''; + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + + # official wrapper scripts that searches for $WORKSPACE_ROOT/tools/bazel + # if it can’t find something in tools, it calls $out/bin/bazel-{version}-{os_arch} + # The binary _must_ exist with this naming if your project contains a .bazelversion + # file. + cp ./bazel_src/scripts/packages/bazel.sh $out/bin/bazel + wrapProgram $out/bin/bazel $wrapperfile --suffix PATH : ${defaultShellPath} + mv ./bazel_src/output/bazel $out/bin/bazel-${version}-${system}-${arch} + + '' + + + # disable execlog parser on darwin, since it fails to build + # see https://github.com/NixOS/nixpkgs/pull/273774#issuecomment-1865322055 + (lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + mkdir $out/share + cp ./bazel_src/bazel-bin/src/tools/execlog/parser_deploy.jar $out/share/parser_deploy.jar + cat < $out/bin/bazel-execlog + #!${runtimeShell} -e + ${runJdk}/bin/java -jar $out/share/parser_deploy.jar \$@ + EOF + chmod +x $out/bin/bazel-execlog + '') + + '' + # shell completion files + installShellCompletion --bash \ + --name bazel.bash \ + ./bazel_src/output/bazel-complete.bash + installShellCompletion --zsh \ + --name _bazel \ + ./bazel_src/scripts/zsh_completion/_bazel + installShellCompletion --fish \ + --name bazel.fish \ + ./bazel_src/output/bazel-complete.fish + ''; + # Install check fails on `aarch64-darwin` # https://github.com/NixOS/nixpkgs/issues/145587 doInstallCheck = stdenv.hostPlatform.system != "aarch64-darwin"; @@ -835,18 +834,17 @@ stdenv.mkDerivation rec { # Save paths to hardcoded dependencies so Nix can detect them. # This is needed because the templates get tar’d up into a .jar. - postFixup = - '' - mkdir -p $out/nix-support - echo "${defaultShellPath}" >> $out/nix-support/depends - # The string literal specifying the path to the bazel-rc file is sometimes - # stored non-contiguously in the binary due to gcc optimisations, which leads - # Nix to miss the hash when scanning for dependencies - echo "${bazelRC}" >> $out/nix-support/depends - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - echo "${cctools}" >> $out/nix-support/depends - ''; + postFixup = '' + mkdir -p $out/nix-support + echo "${defaultShellPath}" >> $out/nix-support/depends + # The string literal specifying the path to the bazel-rc file is sometimes + # stored non-contiguously in the binary due to gcc optimisations, which leads + # Nix to miss the hash when scanning for dependencies + echo "${bazelRC}" >> $out/nix-support/depends + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + echo "${cctools}" >> $out/nix-support/depends + ''; dontStrip = true; dontPatchELF = true; diff --git a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix index fe710bdd30cb..cd62a9de62e2 100644 --- a/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix +++ b/pkgs/development/tools/build-managers/bazel/bazel_7/default.nix @@ -130,7 +130,8 @@ let nativeBuildInputs = defaultShellUtils; buildInputs = [ stdenv.cc.cc - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; dontUnpack = true; dontPatch = true; @@ -186,7 +187,8 @@ let unzip runJdk bazelForDeps - ] ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool; + ] + ++ lib.optional (stdenv.hostPlatform.isDarwin) libtool; configurePhase = '' runHook preConfigure @@ -308,86 +310,85 @@ stdenv.mkDerivation rec { inherit version src; inherit sourceRoot; - patches = - [ - # Remote java toolchains do not work on NixOS because they download binaries, - # so we need to use the @local_jdk//:jdk - # It could in theory be done by registering @local_jdk//:all toolchains, - # but these java toolchains still bundle binaries for ijar and stuff. So we - # need a nonprebult java toolchain (where ijar and stuff is built from - # sources). - # There is no such java toolchain, so we introduce one here. - # By providing no version information, the toolchain will set itself to the - # version of $JAVA_HOME/bin/java, just like the local_jdk does. - # To ensure this toolchain gets used, we can set - # --{,tool_}java_runtime_version=local_jdk and rely on the fact no java - # toolchain registered by default uses the local_jdk, making the selection - # unambiguous. - # This toolchain has the advantage that it can use any ambient java jdk, - # not only a given, fixed version. It allows bazel to work correctly in any - # environment where JAVA_HOME is set to the right java version, like inside - # nix derivations. - # However, this patch breaks bazel hermeticity, by picking the ambient java - # version instead of the more hermetic remote_jdk prebuilt binaries that - # rules_java provide by default. It also requires the user to have a - # JAVA_HOME set to the exact version required by the project. - # With more code, we could define java toolchains for all the java versions - # supported by the jdk as in rules_java's - # toolchains/local_java_repository.bzl, but this is not implemented here. - # To recover vanilla behavior, non NixOS users can set - # --{,tool_}java_runtime_version=remote_jdk, effectively reverting the - # effect of this patch and the fake system bazelrc. - ./java_toolchain.patch + patches = [ + # Remote java toolchains do not work on NixOS because they download binaries, + # so we need to use the @local_jdk//:jdk + # It could in theory be done by registering @local_jdk//:all toolchains, + # but these java toolchains still bundle binaries for ijar and stuff. So we + # need a nonprebult java toolchain (where ijar and stuff is built from + # sources). + # There is no such java toolchain, so we introduce one here. + # By providing no version information, the toolchain will set itself to the + # version of $JAVA_HOME/bin/java, just like the local_jdk does. + # To ensure this toolchain gets used, we can set + # --{,tool_}java_runtime_version=local_jdk and rely on the fact no java + # toolchain registered by default uses the local_jdk, making the selection + # unambiguous. + # This toolchain has the advantage that it can use any ambient java jdk, + # not only a given, fixed version. It allows bazel to work correctly in any + # environment where JAVA_HOME is set to the right java version, like inside + # nix derivations. + # However, this patch breaks bazel hermeticity, by picking the ambient java + # version instead of the more hermetic remote_jdk prebuilt binaries that + # rules_java provide by default. It also requires the user to have a + # JAVA_HOME set to the exact version required by the project. + # With more code, we could define java toolchains for all the java versions + # supported by the jdk as in rules_java's + # toolchains/local_java_repository.bzl, but this is not implemented here. + # To recover vanilla behavior, non NixOS users can set + # --{,tool_}java_runtime_version=remote_jdk, effectively reverting the + # effect of this patch and the fake system bazelrc. + ./java_toolchain.patch - # Bazel integrates with apple IOKit to inhibit and track system sleep. - # Inside the darwin sandbox, these API calls are blocked, and bazel - # crashes. It seems possible to allow these APIs inside the sandbox, but it - # feels simpler to patch bazel not to use it at all. So our bazel is - # incapable of preventing system sleep, which is a small price to pay to - # guarantee that it will always run in any nix context. - # - # See also ./bazel_darwin_sandbox.patch in bazel_5. That patch uses - # NIX_BUILD_TOP env var to conditionally disable sleep features inside the - # sandbox. - # - # If you want to investigate the sandbox profile path, - # IORegisterForSystemPower can be allowed with - # - # propagatedSandboxProfile = '' - # (allow iokit-open (iokit-user-client-class "RootDomainUserClient")) - # ''; - # - # I do not know yet how to allow IOPMAssertion{CreateWithName,Release} - ./darwin_sleep.patch + # Bazel integrates with apple IOKit to inhibit and track system sleep. + # Inside the darwin sandbox, these API calls are blocked, and bazel + # crashes. It seems possible to allow these APIs inside the sandbox, but it + # feels simpler to patch bazel not to use it at all. So our bazel is + # incapable of preventing system sleep, which is a small price to pay to + # guarantee that it will always run in any nix context. + # + # See also ./bazel_darwin_sandbox.patch in bazel_5. That patch uses + # NIX_BUILD_TOP env var to conditionally disable sleep features inside the + # sandbox. + # + # If you want to investigate the sandbox profile path, + # IORegisterForSystemPower can be allowed with + # + # propagatedSandboxProfile = '' + # (allow iokit-open (iokit-user-client-class "RootDomainUserClient")) + # ''; + # + # I do not know yet how to allow IOPMAssertion{CreateWithName,Release} + ./darwin_sleep.patch - # Fix DARWIN_XCODE_LOCATOR_COMPILE_COMMAND by removing multi-arch support. - # Nixpkgs toolcahins do not support that (yet?) and get confused. - # Also add an explicit /usr/bin prefix that will be patched below. - ./xcode_locator.patch + # Fix DARWIN_XCODE_LOCATOR_COMPILE_COMMAND by removing multi-arch support. + # Nixpkgs toolcahins do not support that (yet?) and get confused. + # Also add an explicit /usr/bin prefix that will be patched below. + ./xcode_locator.patch - # On Darwin, the last argument to gcc is coming up as an empty string. i.e: '' - # This is breaking the build of any C target. This patch removes the last - # argument if it's found to be an empty string. - ../trim-last-argument-to-gcc-if-empty.patch + # On Darwin, the last argument to gcc is coming up as an empty string. i.e: '' + # This is breaking the build of any C target. This patch removes the last + # argument if it's found to be an empty string. + ../trim-last-argument-to-gcc-if-empty.patch - # --experimental_strict_action_env (which may one day become the default - # see bazelbuild/bazel#2574) hardcodes the default - # action environment to a non hermetic value (e.g. "/usr/local/bin"). - # This is non hermetic on non-nixos systems. On NixOS, bazel cannot find the required binaries. - # So we are replacing this bazel paths by defaultShellPath, - # improving hermeticity and making it work in nixos. - (replaceVars ../strict_action_env.patch { - strictActionEnvPatch = defaultShellPath; - }) + # --experimental_strict_action_env (which may one day become the default + # see bazelbuild/bazel#2574) hardcodes the default + # action environment to a non hermetic value (e.g. "/usr/local/bin"). + # This is non hermetic on non-nixos systems. On NixOS, bazel cannot find the required binaries. + # So we are replacing this bazel paths by defaultShellPath, + # improving hermeticity and making it work in nixos. + (replaceVars ../strict_action_env.patch { + strictActionEnvPatch = defaultShellPath; + }) - # bazel reads its system bazelrc in /etc - # override this path to a builtin one - (replaceVars ../bazel_rc.patch { - bazelSystemBazelRCPath = bazelRC; - }) - ] - # See enableNixHacks argument above. - ++ lib.optional enableNixHacks ./nix-build-bazel-package-hacks.patch; + # bazel reads its system bazelrc in /etc + # override this path to a builtin one + (replaceVars ../bazel_rc.patch { + bazelSystemBazelRCPath = bazelRC; + }) + ] + # See enableNixHacks argument above. + ++ lib.optional enableNixHacks ./nix-build-bazel-package-hacks.patch; postPatch = let @@ -537,23 +538,23 @@ stdenv.mkDerivation rec { buildInputs = [ buildJdk bashWithDefaultShellUtils - ] ++ defaultShellUtils; + ] + ++ defaultShellUtils; # when a command can’t be found in a bazel build, you might also # need to add it to `defaultShellPath`. - nativeBuildInputs = - [ - installShellFiles - makeWrapper - python3 - unzip - which - zip - python3.pkgs.absl-py # Needed to build fish completion - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - cctools - ]; + nativeBuildInputs = [ + installShellFiles + makeWrapper + python3 + unzip + which + zip + python3.pkgs.absl-py # Needed to build fish completion + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + cctools + ]; # Bazel makes extensive use of symlinks in the WORKSPACE. # This causes problems with infinite symlinks if the build output is in the same location as the @@ -687,18 +688,17 @@ stdenv.mkDerivation rec { # Save paths to hardcoded dependencies so Nix can detect them. # This is needed because the templates get tar’d up into a .jar. - postFixup = - '' - mkdir -p $out/nix-support - echo "${defaultShellPath}" >> $out/nix-support/depends - # The string literal specifying the path to the bazel-rc file is sometimes - # stored non-contiguously in the binary due to gcc optimisations, which leads - # Nix to miss the hash when scanning for dependencies - echo "${bazelRC}" >> $out/nix-support/depends - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - echo "${cctools}" >> $out/nix-support/depends - ''; + postFixup = '' + mkdir -p $out/nix-support + echo "${defaultShellPath}" >> $out/nix-support/depends + # The string literal specifying the path to the bazel-rc file is sometimes + # stored non-contiguously in the binary due to gcc optimisations, which leads + # Nix to miss the hash when scanning for dependencies + echo "${bazelRC}" >> $out/nix-support/depends + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + echo "${cctools}" >> $out/nix-support/depends + ''; dontStrip = true; dontPatchELF = true; diff --git a/pkgs/development/tools/build-managers/bazel/cpp-test.nix b/pkgs/development/tools/build-managers/bazel/cpp-test.nix index e5ad6bc2a41c..6581331c7697 100644 --- a/pkgs/development/tools/build-managers/bazel/cpp-test.nix +++ b/pkgs/development/tools/build-managers/bazel/cpp-test.nix @@ -45,18 +45,17 @@ let name = "${bazel.pname}-test-cpp"; inherit workspaceDir; bazelPkg = bazel; - bazelScript = - '' - ${bazel}/bin/bazel build //... \ - --verbose_failures \ - --distdir=${distDir} \ - --curses=no \ - ${extraBazelArgs} \ - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin) '' - --cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \ - --linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \ - ''; + bazelScript = '' + ${bazel}/bin/bazel build //... \ + --verbose_failures \ + --distdir=${distDir} \ + --curses=no \ + ${extraBazelArgs} \ + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin) '' + --cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \ + --linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \ + ''; }; in diff --git a/pkgs/development/tools/build-managers/bazel/java-test.nix b/pkgs/development/tools/build-managers/bazel/java-test.nix index c17e34cb60cd..c3d94a7fd8e2 100644 --- a/pkgs/development/tools/build-managers/bazel/java-test.nix +++ b/pkgs/development/tools/build-managers/bazel/java-test.nix @@ -50,24 +50,23 @@ let buildInputs = [ (if lib.strings.versionOlder bazel.version "5.0.0" then openjdk8 else jdk11_headless) ]; - bazelScript = - '' - ${bazel}/bin/bazel \ - run \ - --announce_rc \ - ${lib.optionalString (lib.strings.versionOlder "5.0.0" bazel.version) "--toolchain_resolution_debug='@bazel_tools//tools/jdk:(runtime_)?toolchain_type'"} \ - --distdir=${distDir} \ - --verbose_failures \ - --curses=no \ - --strict_java_deps=off \ - //:ProjectRunner \ - '' - + lib.optionalString (lib.strings.versionOlder bazel.version "5.0.0") '' - --host_javabase='@local_jdk//:jdk' \ - --java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \ - --javabase='@local_jdk//:jdk' \ - '' - + extraBazelArgs; + bazelScript = '' + ${bazel}/bin/bazel \ + run \ + --announce_rc \ + ${lib.optionalString (lib.strings.versionOlder "5.0.0" bazel.version) "--toolchain_resolution_debug='@bazel_tools//tools/jdk:(runtime_)?toolchain_type'"} \ + --distdir=${distDir} \ + --verbose_failures \ + --curses=no \ + --strict_java_deps=off \ + //:ProjectRunner \ + '' + + lib.optionalString (lib.strings.versionOlder bazel.version "5.0.0") '' + --host_javabase='@local_jdk//:jdk' \ + --java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \ + --javabase='@local_jdk//:jdk' \ + '' + + extraBazelArgs; }; in diff --git a/pkgs/development/tools/build-managers/bazel/protobuf-test.nix b/pkgs/development/tools/build-managers/bazel/protobuf-test.nix index 0522c9172eca..0cbcf2dae2aa 100644 --- a/pkgs/development/tools/build-managers/bazel/protobuf-test.nix +++ b/pkgs/development/tools/build-managers/bazel/protobuf-test.nix @@ -168,27 +168,26 @@ let buildInputs = [ (if lib.strings.versionOlder bazel.version "5.0.0" then openjdk8 else jdk11_headless) ]; - bazelScript = - '' - ${bazel}/bin/bazel \ - build \ - --distdir=${distDir} \ - --verbose_failures \ - --curses=no \ - --subcommands \ - --strict_java_deps=off \ - --strict_proto_deps=off \ - //... \ - '' - + lib.optionalString (lib.strings.versionOlder bazel.version "5.0.0") '' - --host_javabase='@local_jdk//:jdk' \ - --java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \ - --javabase='@local_jdk//:jdk' \ - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin) '' - --cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \ - --linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \ - ''; + bazelScript = '' + ${bazel}/bin/bazel \ + build \ + --distdir=${distDir} \ + --verbose_failures \ + --curses=no \ + --subcommands \ + --strict_java_deps=off \ + --strict_proto_deps=off \ + //... \ + '' + + lib.optionalString (lib.strings.versionOlder bazel.version "5.0.0") '' + --host_javabase='@local_jdk//:jdk' \ + --java_toolchain='@bazel_tools//tools/jdk:toolchain_hostjdk8' \ + --javabase='@local_jdk//:jdk' \ + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin) '' + --cxxopt=-x --cxxopt=c++ --host_cxxopt=-x --host_cxxopt=c++ \ + --linkopt=-stdlib=libc++ --host_linkopt=-stdlib=libc++ \ + ''; }; in diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix index 7a256239768c..479f6afa75a4 100644 --- a/pkgs/development/tools/build-managers/gradle/default.nix +++ b/pkgs/development/tools/build-managers/gradle/default.nix @@ -70,14 +70,13 @@ rec { dontBuild = true; - nativeBuildInputs = - [ - makeWrapper - unzip - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + makeWrapper + unzip + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ]; buildInputs = [ stdenv.cc.cc @@ -274,54 +273,54 @@ rec { mitm-cache ]; - passthru = - { - fetchDeps = callPackage ./fetch-deps.nix { inherit mitm-cache; }; - inherit (gradle) jdk; - unwrapped = gradle; - tests = { - toolchains = - let - javaVersion = lib.getVersion jdk23; - javaMajorVersion = lib.versions.major javaVersion; - in - runCommand "detects-toolchains-from-nix-env" - { - # Use JDKs that are not the default for any of the gradle versions - nativeBuildInputs = [ - (gradle.override { - javaToolchains = [ - jdk23 - ]; - }) - ]; - src = ./tests/toolchains; - } - '' - cp -a $src/* . - substituteInPlace ./build.gradle --replace-fail '@JAVA_VERSION@' '${javaMajorVersion}' - env GRADLE_USER_HOME=$TMPDIR/gradle org.gradle.native.dir=$TMPDIR/native \ - gradle run --no-daemon --quiet --console plain > $out - actual="$(<$out)" - if [[ "${javaVersion}" != "$actual"* ]]; then - echo "Error: Expected '${javaVersion}', to start with '$actual'" >&2 - exit 1 - fi - ''; - } // gradle.tests; + passthru = { + fetchDeps = callPackage ./fetch-deps.nix { inherit mitm-cache; }; + inherit (gradle) jdk; + unwrapped = gradle; + tests = { + toolchains = + let + javaVersion = lib.getVersion jdk23; + javaMajorVersion = lib.versions.major javaVersion; + in + runCommand "detects-toolchains-from-nix-env" + { + # Use JDKs that are not the default for any of the gradle versions + nativeBuildInputs = [ + (gradle.override { + javaToolchains = [ + jdk23 + ]; + }) + ]; + src = ./tests/toolchains; + } + '' + cp -a $src/* . + substituteInPlace ./build.gradle --replace-fail '@JAVA_VERSION@' '${javaMajorVersion}' + env GRADLE_USER_HOME=$TMPDIR/gradle org.gradle.native.dir=$TMPDIR/native \ + gradle run --no-daemon --quiet --console plain > $out + actual="$(<$out)" + if [[ "${javaVersion}" != "$actual"* ]]; then + echo "Error: Expected '${javaVersion}', to start with '$actual'" >&2 + exit 1 + fi + ''; } - // lib.optionalAttrs (updateAttrPath != null) { - updateScript = nix-update-script { - attrPath = updateAttrPath; - extraArgs = [ - "--url=https://github.com/gradle/gradle" - # Gradle’s .0 releases are tagged as `vX.Y.0`, but the actual - # release version omits the `.0`, so we’ll wanto to only capture - # the version up but not including the the trailing `.0`. - "--version-regex=^v(\\d+\\.\\d+(?:\\.[1-9]\\d?)?)(\\.0)?$" - ]; - }; + // gradle.tests; + } + // lib.optionalAttrs (updateAttrPath != null) { + updateScript = nix-update-script { + attrPath = updateAttrPath; + extraArgs = [ + "--url=https://github.com/gradle/gradle" + # Gradle’s .0 releases are tagged as `vX.Y.0`, but the actual + # release version omits the `.0`, so we’ll wanto to only capture + # the version up but not including the the trailing `.0`. + "--version-regex=^v(\\d+\\.\\d+(?:\\.[1-9]\\d?)?)(\\.0)?$" + ]; }; + }; meta = gradle.meta // { # prefer normal gradle/mitm-cache over this wrapper, this wrapper only provides the setup hook diff --git a/pkgs/development/tools/build-managers/gradle/update-deps.nix b/pkgs/development/tools/build-managers/gradle/update-deps.nix index 2e03f70df70c..10db28f0fdcb 100644 --- a/pkgs/development/tools/build-managers/gradle/update-deps.nix +++ b/pkgs/development/tools/build-managers/gradle/update-deps.nix @@ -68,7 +68,8 @@ lib.makeOverridable ( # see pkgs/common-updater/combinators.nix derivationArgs.passthru = { supportedFeatures = lib.optional silent "silent"; - } // lib.optionalAttrs (attrPath != null) { inherit attrPath; }; + } + // lib.optionalAttrs (attrPath != null) { inherit attrPath; }; text = '' #!${runtimeShell} set -eo pipefail diff --git a/pkgs/development/tools/build-managers/sbt/scala-native.nix b/pkgs/development/tools/build-managers/sbt/scala-native.nix index 86df0b139612..012b5507494c 100644 --- a/pkgs/development/tools/build-managers/sbt/scala-native.nix +++ b/pkgs/development/tools/build-managers/sbt/scala-native.nix @@ -12,30 +12,28 @@ sbt.overrideAttrs (previousAttrs: { nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [ makeWrapper ]; - postFixup = - (previousAttrs.postFixup or "") - + '' - wrapProgram $out/bin/sbt \ - --set CLANG_PATH "${llvmPackages.clang}/bin/clang" \ - --set CLANGPP_PATH "${llvmPackages.clang}/bin/clang" \ - --set CPATH "${ - lib.makeSearchPathOutput "dev" "include" [ - re2 - zlib - boehmgc - libunwind - llvmPackages.libcxx - ] - }/c++/v1" \ - --set LIBRARY_PATH "${ - lib.makeLibraryPath [ - re2 - zlib - boehmgc - libunwind - llvmPackages.libcxx - ] - }" \ - --set NIX_CFLAGS_LINK "-lc++" - ''; + postFixup = (previousAttrs.postFixup or "") + '' + wrapProgram $out/bin/sbt \ + --set CLANG_PATH "${llvmPackages.clang}/bin/clang" \ + --set CLANGPP_PATH "${llvmPackages.clang}/bin/clang" \ + --set CPATH "${ + lib.makeSearchPathOutput "dev" "include" [ + re2 + zlib + boehmgc + libunwind + llvmPackages.libcxx + ] + }/c++/v1" \ + --set LIBRARY_PATH "${ + lib.makeLibraryPath [ + re2 + zlib + boehmgc + libunwind + llvmPackages.libcxx + ] + }" \ + --set NIX_CFLAGS_LINK "-lc++" + ''; }) diff --git a/pkgs/development/tools/buildah/default.nix b/pkgs/development/tools/buildah/default.nix index a268b255c2d4..587ad7b46d25 100644 --- a/pkgs/development/tools/buildah/default.nix +++ b/pkgs/development/tools/buildah/default.nix @@ -45,17 +45,16 @@ buildGoModule rec { pkg-config ]; - buildInputs = - [ - gpgme - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - btrfs-progs - libapparmor - libseccomp - libselinux - lvm2 - ]; + buildInputs = [ + gpgme + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + btrfs-progs + libapparmor + libseccomp + libselinux + lvm2 + ]; buildPhase = '' runHook preBuild diff --git a/pkgs/development/tools/buildah/wrapper.nix b/pkgs/development/tools/buildah/wrapper.nix index 9da8c022ac76..1bea128830d7 100644 --- a/pkgs/development/tools/buildah/wrapper.nix +++ b/pkgs/development/tools/buildah/wrapper.nix @@ -38,14 +38,13 @@ let name = "${buildah-unwrapped.pname}-helper-binary-wrapper-${buildah-unwrapped.version}"; # this only works for some binaries, others may need to be added to `binPath` or in the modules - paths = - [ - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - aardvark-dns - netavark - passt - ]; + paths = [ + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + aardvark-dns + netavark + passt + ]; }; in diff --git a/pkgs/development/tools/comby/default.nix b/pkgs/development/tools/comby/default.nix index e55d66009ed5..b8571d58018d 100644 --- a/pkgs/development/tools/comby/default.nix +++ b/pkgs/development/tools/comby/default.nix @@ -48,7 +48,8 @@ let ocamlPackages.ppx_deriving_yojson ocamlPackages.ppx_sexp_conv ocamlPackages.ppx_sexp_message - ] ++ extraBuildInputs; + ] + ++ extraBuildInputs; nativeCheckInputs = [ cacert ]; @@ -80,36 +81,35 @@ mkCombyPackage { rm test/common/{test_cli_list,test_cli_helper,test_cli}.ml ''; - extraBuildInputs = - [ - zlib - gmp - libev - sqlite - ocamlPackages.shell # This input must appear before `parany` or any other input that propagates `ocamlnet` - ocamlPackages.lwt - ocamlPackages.patience_diff - ocamlPackages.toml - ocamlPackages.cohttp-lwt-unix - ocamlPackages.textutils - ocamlPackages.jst-config - ocamlPackages.parany - ocamlPackages.conduit-lwt-unix - ocamlPackages.lwt_react - ocamlPackages.tar-unix - ocamlPackages.tls - ocamlPackages.ppx_jane - ocamlPackages.ppx_expect - ocamlPackages.dune-configurator - combyKernel - combySemantic - ] - ++ ( - if !stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64 then - [ ocamlPackages.hack_parallel ] - else - [ ] - ); + extraBuildInputs = [ + zlib + gmp + libev + sqlite + ocamlPackages.shell # This input must appear before `parany` or any other input that propagates `ocamlnet` + ocamlPackages.lwt + ocamlPackages.patience_diff + ocamlPackages.toml + ocamlPackages.cohttp-lwt-unix + ocamlPackages.textutils + ocamlPackages.jst-config + ocamlPackages.parany + ocamlPackages.conduit-lwt-unix + ocamlPackages.lwt_react + ocamlPackages.tar-unix + ocamlPackages.tls + ocamlPackages.ppx_jane + ocamlPackages.ppx_expect + ocamlPackages.dune-configurator + combyKernel + combySemantic + ] + ++ ( + if !stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64 then + [ ocamlPackages.hack_parallel ] + else + [ ] + ); extraNativeInputs = [ autoconf diff --git a/pkgs/development/tools/continuous-integration/buildbot/master.nix b/pkgs/development/tools/continuous-integration/buildbot/master.nix index 22fbbd4f7260..d3b35de6b63b 100644 --- a/pkgs/development/tools/continuous-integration/buildbot/master.nix +++ b/pkgs/development/tools/continuous-integration/buildbot/master.nix @@ -94,31 +94,30 @@ buildPythonApplication rec { "twisted" ]; - propagatedBuildInputs = - [ - # core - twisted - jinja2 - msgpack - zope-interface - sqlalchemy - alembic - python-dateutil - txaio - autobahn - pyjwt - pyyaml - setuptools - croniter - importlib-resources - packaging - unidiff - treq - brotli - zstandard - ] - # tls - ++ twisted.optional-dependencies.tls; + propagatedBuildInputs = [ + # core + twisted + jinja2 + msgpack + zope-interface + sqlalchemy + alembic + python-dateutil + txaio + autobahn + pyjwt + pyyaml + setuptools + croniter + importlib-resources + packaging + unidiff + treq + brotli + zstandard + ] + # tls + ++ twisted.optional-dependencies.tls; nativeCheckInputs = [ treq @@ -156,16 +155,15 @@ buildPythonApplication rec { export PATH="$out/bin:$PATH" ''; - passthru = - { - inherit withPlugins python; - updateScript = ./update.sh; - } - // lib.optionalAttrs stdenv.hostPlatform.isLinux { - tests = { - inherit (nixosTests) buildbot; - }; + passthru = { + inherit withPlugins python; + updateScript = ./update.sh; + } + // lib.optionalAttrs stdenv.hostPlatform.isLinux { + tests = { + inherit (nixosTests) buildbot; }; + }; meta = with lib; { description = "Open-source continuous integration framework for automating software build, test, and release processes"; diff --git a/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix b/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix index 0fd5e62e414e..84b63e689f9f 100644 --- a/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix +++ b/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix @@ -20,7 +20,8 @@ let gzip git openssh - ] ++ lib.optional stdenv.hostPlatform.isLinux crun; + ] + ++ lib.optional stdenv.hostPlatform.isLinux crun; pkg = # justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990 @@ -43,50 +44,49 @@ pkg.overrideAttrs ( position = toString ./default.nix + ":1"; }; passthru = o.passthru // { - tests = - { - version = testers.testVersion { - package = finalAttrs.finalPackage; - command = "hercules-ci-agent --help"; - }; - } - // lib.optionalAttrs (stdenv.hostPlatform.isLinux) { - # Does not test the package, but evaluation of the related NixOS module. - nixos-simple-config = - (nixos { + tests = { + version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "hercules-ci-agent --help"; + }; + } + // lib.optionalAttrs (stdenv.hostPlatform.isLinux) { + # Does not test the package, but evaluation of the related NixOS module. + nixos-simple-config = + (nixos { + boot.loader.grub.enable = false; + fileSystems."/".device = "bogus"; + services.hercules-ci-agent.enable = true; + # Dummy value for testing only. + system.stateVersion = lib.trivial.release; # TEST ONLY + }).config.system.build.toplevel; + + nixos-many-options-config = + (nixos ( + { pkgs, ... }: + { boot.loader.grub.enable = false; fileSystems."/".device = "bogus"; - services.hercules-ci-agent.enable = true; + services.hercules-ci-agent = { + enable = true; + package = pkgs.hercules-ci-agent; + settings = { + workDirectory = "/var/tmp/hci"; + binaryCachesPath = "/var/keys/binary-caches.json"; + labels.foo.bar.baz = "qux"; + labels.qux = [ + "q" + "u" + ]; + apiBaseUrl = "https://hci.dev.biz.example.com"; + concurrentTasks = 42; + }; + }; # Dummy value for testing only. system.stateVersion = lib.trivial.release; # TEST ONLY - }).config.system.build.toplevel; - - nixos-many-options-config = - (nixos ( - { pkgs, ... }: - { - boot.loader.grub.enable = false; - fileSystems."/".device = "bogus"; - services.hercules-ci-agent = { - enable = true; - package = pkgs.hercules-ci-agent; - settings = { - workDirectory = "/var/tmp/hci"; - binaryCachesPath = "/var/keys/binary-caches.json"; - labels.foo.bar.baz = "qux"; - labels.qux = [ - "q" - "u" - ]; - apiBaseUrl = "https://hci.dev.biz.example.com"; - concurrentTasks = 42; - }; - }; - # Dummy value for testing only. - system.stateVersion = lib.trivial.release; # TEST ONLY - } - )).config.system.build.toplevel; - }; + } + )).config.system.build.toplevel; + }; }; } ) diff --git a/pkgs/development/tools/database/sqlitebrowser/default.nix b/pkgs/development/tools/database/sqlitebrowser/default.nix index 3f578ceb211f..5a39d5126526 100644 --- a/pkgs/development/tools/database/sqlitebrowser/default.nix +++ b/pkgs/development/tools/database/sqlitebrowser/default.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ qtbase sqlcipher - ] ++ lib.optional stdenv.hostPlatform.isDarwin qtmacextras; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin qtmacextras; nativeBuildInputs = [ cmake diff --git a/pkgs/development/tools/devpi-server/default.nix b/pkgs/development/tools/devpi-server/default.nix index 0ad6e9e7f830..4d12ed9e5193 100644 --- a/pkgs/development/tools/devpi-server/default.nix +++ b/pkgs/development/tools/devpi-server/default.nix @@ -73,7 +73,8 @@ buildPythonApplication rec { waitress py httpx - ] ++ passlib.optional-dependencies.argon2; + ] + ++ passlib.optional-dependencies.argon2; nativeCheckInputs = [ beautifulsoup4 diff --git a/pkgs/development/tools/devpod/default.nix b/pkgs/development/tools/devpod/default.nix index db37f9aded68..23e4f5833ab2 100644 --- a/pkgs/development/tools/devpod/default.nix +++ b/pkgs/development/tools/devpod/default.nix @@ -108,35 +108,33 @@ let ./exit-update-checker-loop.patch ]; - postPatch = - '' - ln -s ${lib.getExe devpod} src-tauri/bin/devpod-cli-${stdenv.hostPlatform.rust.rustcTarget} + postPatch = '' + ln -s ${lib.getExe devpod} src-tauri/bin/devpod-cli-${stdenv.hostPlatform.rust.rustcTarget} - # disable upstream updater - jq '.plugins.updater.endpoints = [ ] | .bundle.createUpdaterArtifacts = false' src-tauri/tauri.conf.json \ - | sponge src-tauri/tauri.conf.json - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \ - --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" - ''; + # disable upstream updater + jq '.plugins.updater.endpoints = [ ] | .bundle.createUpdaterArtifacts = false' src-tauri/tauri.conf.json \ + | sponge src-tauri/tauri.conf.json + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \ + --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1" + ''; - nativeBuildInputs = - [ - cargo-tauri.hook - jq - moreutils - nodejs - yarnConfigHook - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - desktop-file-utils - pkg-config - wrapGAppsHook3 - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - makeBinaryWrapper - ]; + nativeBuildInputs = [ + cargo-tauri.hook + jq + moreutils + nodejs + yarnConfigHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + desktop-file-utils + pkg-config + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + makeBinaryWrapper + ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ glib-networking diff --git a/pkgs/development/tools/documentation/doxygen/default.nix b/pkgs/development/tools/documentation/doxygen/default.nix index 29a48d5c96fa..0bf02da22143 100644 --- a/pkgs/development/tools/documentation/doxygen/default.nix +++ b/pkgs/development/tools/documentation/doxygen/default.nix @@ -38,24 +38,24 @@ stdenv.mkDerivation (finalAttrs: { bison ]; - buildInputs = + buildInputs = [ + libiconv + spdlog + sqlite + ] + ++ lib.optionals (qt5 != null) ( + with qt5; [ - libiconv - spdlog - sqlite + qtbase + wrapQtAppsHook ] - ++ lib.optionals (qt5 != null) ( - with qt5; - [ - qtbase - wrapQtAppsHook - ] - ); + ); cmakeFlags = [ "-Duse_sys_spdlog=ON" "-Duse_sys_sqlite3=ON" - ] ++ lib.optional (qt5 != null) "-Dbuild_wizard=YES"; + ] + ++ lib.optional (qt5 != null) "-Dbuild_wizard=YES"; # put examples in an output so people/tools can test against them outputs = [ diff --git a/pkgs/development/tools/electron/common.nix b/pkgs/development/tools/electron/common.nix index 969023f023cd..44c4ea2c62a0 100644 --- a/pkgs/development/tools/electron/common.nix +++ b/pkgs/development/tools/electron/common.nix @@ -155,91 +155,89 @@ in npmRoot = "third_party/node"; - postPatch = - '' - mkdir -p third_party/jdk/current/bin + postPatch = '' + mkdir -p third_party/jdk/current/bin - echo 'build_with_chromium = true' >> build/config/gclient_args.gni - echo 'checkout_google_benchmark = false' >> build/config/gclient_args.gni - echo 'checkout_android = false' >> build/config/gclient_args.gni - echo 'checkout_android_prebuilts_build_tools = false' >> build/config/gclient_args.gni - echo 'checkout_android_native_support = false' >> build/config/gclient_args.gni - echo 'checkout_ios_webkit = false' >> build/config/gclient_args.gni - echo 'checkout_nacl = false' >> build/config/gclient_args.gni - echo 'checkout_openxr = false' >> build/config/gclient_args.gni - echo 'checkout_rts_model = false' >> build/config/gclient_args.gni - echo 'checkout_src_internal = false' >> build/config/gclient_args.gni - echo 'cros_boards = ""' >> build/config/gclient_args.gni - echo 'cros_boards_with_qemu_images = ""' >> build/config/gclient_args.gni - echo 'generate_location_tags = true' >> build/config/gclient_args.gni + echo 'build_with_chromium = true' >> build/config/gclient_args.gni + echo 'checkout_google_benchmark = false' >> build/config/gclient_args.gni + echo 'checkout_android = false' >> build/config/gclient_args.gni + echo 'checkout_android_prebuilts_build_tools = false' >> build/config/gclient_args.gni + echo 'checkout_android_native_support = false' >> build/config/gclient_args.gni + echo 'checkout_ios_webkit = false' >> build/config/gclient_args.gni + echo 'checkout_nacl = false' >> build/config/gclient_args.gni + echo 'checkout_openxr = false' >> build/config/gclient_args.gni + echo 'checkout_rts_model = false' >> build/config/gclient_args.gni + echo 'checkout_src_internal = false' >> build/config/gclient_args.gni + echo 'cros_boards = ""' >> build/config/gclient_args.gni + echo 'cros_boards_with_qemu_images = ""' >> build/config/gclient_args.gni + echo 'generate_location_tags = true' >> build/config/gclient_args.gni - echo 'LASTCHANGE=${info.deps."src".args.tag}-refs/heads/master@{#0}' > build/util/LASTCHANGE - echo "$SOURCE_DATE_EPOCH" > build/util/LASTCHANGE.committime + echo 'LASTCHANGE=${info.deps."src".args.tag}-refs/heads/master@{#0}' > build/util/LASTCHANGE + echo "$SOURCE_DATE_EPOCH" > build/util/LASTCHANGE.committime - cat << EOF > gpu/config/gpu_lists_version.h - /* Generated by lastchange.py, do not edit.*/ - #ifndef GPU_CONFIG_GPU_LISTS_VERSION_H_ - #define GPU_CONFIG_GPU_LISTS_VERSION_H_ - #define GPU_LISTS_VERSION "${info.deps."src".args.tag}" - #endif // GPU_CONFIG_GPU_LISTS_VERSION_H_ - EOF + cat << EOF > gpu/config/gpu_lists_version.h + /* Generated by lastchange.py, do not edit.*/ + #ifndef GPU_CONFIG_GPU_LISTS_VERSION_H_ + #define GPU_CONFIG_GPU_LISTS_VERSION_H_ + #define GPU_LISTS_VERSION "${info.deps."src".args.tag}" + #endif // GPU_CONFIG_GPU_LISTS_VERSION_H_ + EOF - cat << EOF > skia/ext/skia_commit_hash.h - /* Generated by lastchange.py, do not edit.*/ - #ifndef SKIA_EXT_SKIA_COMMIT_HASH_H_ - #define SKIA_EXT_SKIA_COMMIT_HASH_H_ - #define SKIA_COMMIT_HASH "${info.deps."src/third_party/skia".args.rev}-" - #endif // SKIA_EXT_SKIA_COMMIT_HASH_H_ - EOF + cat << EOF > skia/ext/skia_commit_hash.h + /* Generated by lastchange.py, do not edit.*/ + #ifndef SKIA_EXT_SKIA_COMMIT_HASH_H_ + #define SKIA_EXT_SKIA_COMMIT_HASH_H_ + #define SKIA_COMMIT_HASH "${info.deps."src/third_party/skia".args.rev}-" + #endif // SKIA_EXT_SKIA_COMMIT_HASH_H_ + EOF - echo -n '${info.deps."src/third_party/dawn".args.rev}' > gpu/webgpu/DAWN_VERSION + echo -n '${info.deps."src/third_party/dawn".args.rev}' > gpu/webgpu/DAWN_VERSION - ( - cd electron - export HOME=$TMPDIR/fake_home - yarn config --offline set yarn-offline-mirror $electronOfflineCache - fixup-yarn-lock yarn.lock - yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive - ) + ( + cd electron + export HOME=$TMPDIR/fake_home + yarn config --offline set yarn-offline-mirror $electronOfflineCache + fixup-yarn-lock yarn.lock + yarn install --offline --frozen-lockfile --ignore-scripts --no-progress --non-interactive + ) - ( - cd .. - PATH=$PATH:${ - lib.makeBinPath ( - with pkgsBuildHost; - [ - jq - git - ] - ) - } - config=src/electron/patches/config.json - for entry in $(cat $config | jq -c ".[]") + ( + cd .. + PATH=$PATH:${ + lib.makeBinPath ( + with pkgsBuildHost; + [ + jq + git + ] + ) + } + config=src/electron/patches/config.json + for entry in $(cat $config | jq -c ".[]") + do + patch_dir=$(echo $entry | jq -r ".patch_dir") + repo=$(echo $entry | jq -r ".repo") + for patch in $(cat $patch_dir/.patches) do - patch_dir=$(echo $entry | jq -r ".patch_dir") - repo=$(echo $entry | jq -r ".repo") - for patch in $(cat $patch_dir/.patches) - do - echo applying in $repo: $patch - git apply -p1 --directory=$repo --exclude='src/third_party/blink/web_tests/*' --exclude='src/content/test/data/*' $patch_dir/$patch - done + echo applying in $repo: $patch + git apply -p1 --directory=$repo --exclude='src/third_party/blink/web_tests/*' --exclude='src/content/test/data/*' $patch_dir/$patch done - ) - '' - + lib.optionalString (lib.versionAtLeast info.version "36") '' - echo 'checkout_glic_e2e_tests = false' >> build/config/gclient_args.gni - echo 'checkout_mutter = false' >> build/config/gclient_args.gni - '' - + base.postPatch; + done + ) + '' + + lib.optionalString (lib.versionAtLeast info.version "36") '' + echo 'checkout_glic_e2e_tests = false' >> build/config/gclient_args.gni + echo 'checkout_mutter = false' >> build/config/gclient_args.gni + '' + + base.postPatch; - preConfigure = - '' - ( - cd third_party/node - grep patch update_npm_deps | sh - ) - '' - + (base.preConfigure or ""); + preConfigure = '' + ( + cd third_party/node + grep patch update_npm_deps | sh + ) + '' + + (base.preConfigure or ""); gnFlags = rec { # build/args/release.gn diff --git a/pkgs/development/tools/godot/3/default.nix b/pkgs/development/tools/godot/3/default.nix index ca22c59c401a..c711aeda47bf 100644 --- a/pkgs/development/tools/godot/3/default.nix +++ b/pkgs/development/tools/godot/3/default.nix @@ -110,10 +110,11 @@ stdenv.mkDerivation (self: { shouldInstallHeaders = self.shouldBuildTools; shouldInstallShortcut = self.shouldBuildTools && self.godotBuildPlatform != "server"; - outputs = - [ "out" ] - ++ lib.optional self.shouldInstallManual "man" - ++ lib.optional self.shouldBuildTools "dev"; + outputs = [ + "out" + ] + ++ lib.optional self.shouldInstallManual "man" + ++ lib.optional self.shouldBuildTools "dev"; builtGodotBinNamePattern = if self.godotBuildPlatform == "server" then "godot_server.*" else "godot.*"; diff --git a/pkgs/development/tools/godot/common.nix b/pkgs/development/tools/godot/common.nix index a6d36e673916..6c4344f9a423 100644 --- a/pkgs/development/tools/godot/common.nix +++ b/pkgs/development/tools/godot/common.nix @@ -318,7 +318,8 @@ let outputs = [ "out" - ] ++ lib.optional (editor) "man"; + ] + ++ lib.optional (editor) "man"; separateDebugInfo = true; # Set the build name which is part of the version. In official downloads, this @@ -446,18 +447,17 @@ let ] ++ lib.optional withUdev udev; - nativeBuildInputs = - [ - installShellFiles - perl - pkg-config - scons - ] - ++ lib.optionals withWayland [ wayland-scanner ] - ++ lib.optional (editor && withMono) [ - makeWrapper - dotnet-sdk - ]; + nativeBuildInputs = [ + installShellFiles + perl + pkg-config + scons + ] + ++ lib.optionals withWayland [ wayland-scanner ] + ++ lib.optional (editor && withMono) [ + makeWrapper + dotnet-sdk + ]; postBuild = lib.optionalString (editor && withMono) '' echo "Generating Glue" @@ -466,88 +466,86 @@ let python modules/mono/build_scripts/build_assemblies.py --godot-output-dir bin --precision=${withPrecision} ''; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -p "$out"/{bin,libexec} - cp -r bin/* "$out"/libexec + mkdir -p "$out"/{bin,libexec} + cp -r bin/* "$out"/libexec - cd "$out"/bin - ln -s ../libexec/${binary} godot${lib.versions.majorMinor version}${suffix} - ln -s godot${lib.versions.majorMinor version}${suffix} godot${lib.versions.major version}${suffix} - ln -s godot${lib.versions.major version}${suffix} godot${suffix} - cd - - '' - + ( - if editor then - '' - installManPage misc/dist/linux/godot.6 + cd "$out"/bin + ln -s ../libexec/${binary} godot${lib.versions.majorMinor version}${suffix} + ln -s godot${lib.versions.majorMinor version}${suffix} godot${lib.versions.major version}${suffix} + ln -s godot${lib.versions.major version}${suffix} godot${suffix} + cd - + '' + + ( + if editor then + '' + installManPage misc/dist/linux/godot.6 - mkdir -p "$out"/share/{applications,icons/hicolor/scalable/apps} - cp misc/dist/linux/org.godotengine.Godot.desktop \ - "$out/share/applications/org.godotengine.Godot${lib.versions.majorMinor version}${suffix}.desktop" + mkdir -p "$out"/share/{applications,icons/hicolor/scalable/apps} + cp misc/dist/linux/org.godotengine.Godot.desktop \ + "$out/share/applications/org.godotengine.Godot${lib.versions.majorMinor version}${suffix}.desktop" - substituteInPlace "$out/share/applications/org.godotengine.Godot${lib.versions.majorMinor version}${suffix}.desktop" \ - --replace-fail "Exec=godot" "Exec=$out/bin/godot${suffix}" \ - --replace-fail "Godot Engine" "Godot Engine ${ - lib.versions.majorMinor version + lib.optionalString withMono " (Mono)" - }" - cp icon.svg "$out/share/icons/hicolor/scalable/apps/godot.svg" - cp icon.png "$out/share/icons/godot.png" - '' - + lib.optionalString withMono '' - mkdir -p "$out"/share/nuget - mv "$out"/libexec/GodotSharp/Tools/nupkgs "$out"/share/nuget/source + substituteInPlace "$out/share/applications/org.godotengine.Godot${lib.versions.majorMinor version}${suffix}.desktop" \ + --replace-fail "Exec=godot" "Exec=$out/bin/godot${suffix}" \ + --replace-fail "Godot Engine" "Godot Engine ${ + lib.versions.majorMinor version + lib.optionalString withMono " (Mono)" + }" + cp icon.svg "$out/share/icons/hicolor/scalable/apps/godot.svg" + cp icon.png "$out/share/icons/godot.png" + '' + + lib.optionalString withMono '' + mkdir -p "$out"/share/nuget + mv "$out"/libexec/GodotSharp/Tools/nupkgs "$out"/share/nuget/source - wrapProgram "$out"/libexec/${binary} \ - --prefix NUGET_FALLBACK_PACKAGES ';' "$out"/share/nuget/packages/ - '' - else - let - template = - (lib.replaceStrings - [ "template" ] - [ - { - linuxbsd = "linux"; - } - .${withPlatform} - ] - target - ) - + "." - + arch; - in - '' - templates="$out"/share/godot/export_templates/${dottedVersion} - mkdir -p "$templates" - ln -s "$out"/libexec/${binary} "$templates"/${template} - '' - ) - + '' - runHook postInstall - ''; + wrapProgram "$out"/libexec/${binary} \ + --prefix NUGET_FALLBACK_PACKAGES ';' "$out"/share/nuget/packages/ + '' + else + let + template = + (lib.replaceStrings + [ "template" ] + [ + { + linuxbsd = "linux"; + } + .${withPlatform} + ] + target + ) + + "." + + arch; + in + '' + templates="$out"/share/godot/export_templates/${dottedVersion} + mkdir -p "$templates" + ln -s "$out"/libexec/${binary} "$templates"/${template} + '' + ) + + '' + runHook postInstall + ''; - passthru = - { - inherit updateScript; - tests = - mkTests finalAttrs.finalPackage dotnet-sdk - // lib.optionalAttrs (editor && withMono) { - sdk-override = mkTests finalAttrs.finalPackage dotnet-sdk_alt; - }; - } - // lib.optionalAttrs editor { - export-template = mkTarget "template_release"; - export-templates-bin = ( - callPackage ./export-templates-bin.nix { - inherit version withMono; - godot = finalAttrs.finalPackage; - hash = exportTemplatesHash; - } - ); - }; + passthru = { + inherit updateScript; + tests = + mkTests finalAttrs.finalPackage dotnet-sdk + // lib.optionalAttrs (editor && withMono) { + sdk-override = mkTests finalAttrs.finalPackage dotnet-sdk_alt; + }; + } + // lib.optionalAttrs editor { + export-template = mkTarget "template_release"; + export-templates-bin = ( + callPackage ./export-templates-bin.nix { + inherit version withMono; + godot = finalAttrs.finalPackage; + hash = exportTemplatesHash; + } + ); + }; requiredSystemFeatures = [ # fixes: No space left on device @@ -562,7 +560,8 @@ let platforms = [ "x86_64-linux" "aarch64-linux" - ] ++ lib.optional (!withMono) "i686-linux"; + ] + ++ lib.optional (!withMono) "i686-linux"; maintainers = with lib.maintainers; [ shiryel corngood diff --git a/pkgs/development/tools/haskell/hadrian/hadrian.nix b/pkgs/development/tools/haskell/hadrian/hadrian.nix index cdd511e1b66c..17c5a3466e15 100644 --- a/pkgs/development/tools/haskell/hadrian/hadrian.nix +++ b/pkgs/development/tools/haskell/hadrian/hadrian.nix @@ -56,30 +56,29 @@ mkDerivation { || (lib.versionAtLeast ghcVersion "9.12" && lib.versionOlder ghcVersion "9.15"); isLibrary = false; isExecutable = true; - executableHaskellDepends = - [ - base - bytestring - Cabal - containers - directory - extra - filepath - mtl - parsec - shake - text - transformers - unordered-containers - ] - ++ lib.optionals (lib.versionAtLeast ghcVersion "9.7") [ - cryptohash-sha256 - base16-bytestring - ] - ++ lib.optionals (lib.versionAtLeast ghcVersion "9.9") [ - ghc-platform - ghc-toolchain - ]; + executableHaskellDepends = [ + base + bytestring + Cabal + containers + directory + extra + filepath + mtl + parsec + shake + text + transformers + unordered-containers + ] + ++ lib.optionals (lib.versionAtLeast ghcVersion "9.7") [ + cryptohash-sha256 + base16-bytestring + ] + ++ lib.optionals (lib.versionAtLeast ghcVersion "9.9") [ + ghc-platform + ghc-toolchain + ]; passthru = { # Expose »private« dependencies if any inherit ghc-platform ghc-toolchain; diff --git a/pkgs/development/tools/haskell/lambdabot/default.nix b/pkgs/development/tools/haskell/lambdabot/default.nix index 0109e1ea2934..2e50275c57a5 100644 --- a/pkgs/development/tools/haskell/lambdabot/default.nix +++ b/pkgs/development/tools/haskell/lambdabot/default.nix @@ -33,21 +33,17 @@ let in haskellLib.overrideCabal (self: { patches = (self.patches or [ ]) ++ [ ./custom-config.patch ]; - postPatch = - (self.postPatch or "") - + '' - substituteInPlace src/Main.hs \ - --replace '@config@' '${configStr}' - substituteInPlace src/Modules.hs \ - --replace '@modules@' '${modulesStr}' - ''; + postPatch = (self.postPatch or "") + '' + substituteInPlace src/Main.hs \ + --replace '@config@' '${configStr}' + substituteInPlace src/Modules.hs \ + --replace '@modules@' '${modulesStr}' + ''; buildTools = (self.buildTools or [ ]) ++ [ makeWrapper ]; - postInstall = - (self.postInstall or "") - + '' - wrapProgram $out/bin/lambdabot \ - --prefix PATH ":" '${bins}' - ''; + postInstall = (self.postInstall or "") + '' + wrapProgram $out/bin/lambdabot \ + --prefix PATH ":" '${bins}' + ''; }) haskellPackages.lambdabot diff --git a/pkgs/development/tools/hotdoc/default.nix b/pkgs/development/tools/hotdoc/default.nix index 07dcefbebc8a..462f3d78d15f 100644 --- a/pkgs/development/tools/hotdoc/default.nix +++ b/pkgs/development/tools/hotdoc/default.nix @@ -100,15 +100,14 @@ buildPythonApplication rec { "hotdoc" ]; - disabledTests = - [ - # Test does not correctly handle path normalization for test comparison - "test_cli_overrides" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # Test does not correctly handle absolute /home paths on Darwin (even fake ones) - "test_index" - ]; + disabledTests = [ + # Test does not correctly handle path normalization for test comparison + "test_cli_overrides" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Test does not correctly handle absolute /home paths on Darwin (even fake ones) + "test_index" + ]; # Hardcode libclang paths postPatch = '' diff --git a/pkgs/development/tools/ilspycmd/default.nix b/pkgs/development/tools/ilspycmd/default.nix index 4ca7e57522da..d79a66b6b9d8 100644 --- a/pkgs/development/tools/ilspycmd/default.nix +++ b/pkgs/development/tools/ilspycmd/default.nix @@ -19,13 +19,12 @@ buildDotnetModule (finalAttrs: { hash = "sha256-7cPXFaEKr76GtqcNsKx7tstRUeTpSTF8ggxbyEnQa9M="; }; - nativeBuildInputs = - [ - powershell - ] - ++ lib.optionals (stdenvNoCC.hostPlatform.isDarwin && stdenvNoCC.hostPlatform.isAarch64) [ - autoSignDarwinBinariesHook - ]; + nativeBuildInputs = [ + powershell + ] + ++ lib.optionals (stdenvNoCC.hostPlatform.isDarwin && stdenvNoCC.hostPlatform.isAarch64) [ + autoSignDarwinBinariesHook + ]; # https://github.com/NixOS/nixpkgs/issues/38991 # bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) diff --git a/pkgs/development/tools/misc/binutils/2.38/default.nix b/pkgs/development/tools/misc/binutils/2.38/default.nix index 2fe833bc2841..4b3c8443dbbc 100644 --- a/pkgs/development/tools/misc/binutils/2.38/default.nix +++ b/pkgs/development/tools/misc/binutils/2.38/default.nix @@ -61,61 +61,60 @@ stdenv.mkDerivation { # WARN: this package is used for bootstrapping fetchurl, and thus cannot use # fetchpatch! All mutable patches (generated by GitHub or cgit) that are # needed here should be included directly in Nixpkgs as files. - patches = - [ - # Make binutils output deterministic by default. - ./deterministic.patch + patches = [ + # Make binutils output deterministic by default. + ./deterministic.patch - # Breaks nm BSD flag detection - ./0001-Revert-libtool.m4-fix-nm-BSD-flag-detection.patch + # Breaks nm BSD flag detection + ./0001-Revert-libtool.m4-fix-nm-BSD-flag-detection.patch - # Required for newer macos versions - ./0001-libtool.m4-update-macos-version-detection-block.patch + # Required for newer macos versions + ./0001-libtool.m4-update-macos-version-detection-block.patch - # For some reason bfd ld doesn't search DT_RPATH when cross-compiling. It's - # not clear why this behavior was decided upon but it has the unfortunate - # consequence that the linker will fail to find transitive dependencies of - # shared objects when cross-compiling. Consequently, we are forced to - # override this behavior, forcing ld to search DT_RPATH even when - # cross-compiling. - ./always-search-rpath.patch + # For some reason bfd ld doesn't search DT_RPATH when cross-compiling. It's + # not clear why this behavior was decided upon but it has the unfortunate + # consequence that the linker will fail to find transitive dependencies of + # shared objects when cross-compiling. Consequently, we are forced to + # override this behavior, forcing ld to search DT_RPATH even when + # cross-compiling. + ./always-search-rpath.patch - # Fixed in 2.39 - # https://sourceware.org/bugzilla/show_bug.cgi?id=28885 - # https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=99852365513266afdd793289813e8e565186c9e6 - # https://github.com/NixOS/nixpkgs/issues/170946 - ./deterministic-temp-prefixes.patch - ] - ++ lib.optional targetPlatform.isiOS ./support-ios.patch - ++ lib.optional stdenv.targetPlatform.isWindows ./windres-locate-gcc.patch - ++ - lib.optional stdenv.targetPlatform.isMips64n64 - # this patch is from debian: - # https://sources.debian.org/data/main/b/binutils/2.38-3/debian/patches/mips64-default-n64.diff - ( - if stdenv.targetPlatform.isMusl then - substitute { - src = ./mips64-default-n64.patch; - substitutions = [ - "--replace" - "gnuabi64" - "muslabi64" - ]; - } - else - ./mips64-default-n64.patch - ) - # On PowerPC, when generating assembly code, GCC generates a `.machine` - # custom instruction which instructs the assembler to generate code for this - # machine. However, some GCC versions generate the wrong one, or make it - # too strict, which leads to some confusing "unrecognized opcode: wrtee" - # or "unrecognized opcode: eieio" errors. - # - # To remove when binutils 2.39 is released. - # - # Upstream commit: - # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=cebc89b9328eab994f6b0314c263f94e7949a553 - ++ lib.optional stdenv.targetPlatform.isPower ./ppc-make-machine-less-strict.patch; + # Fixed in 2.39 + # https://sourceware.org/bugzilla/show_bug.cgi?id=28885 + # https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=99852365513266afdd793289813e8e565186c9e6 + # https://github.com/NixOS/nixpkgs/issues/170946 + ./deterministic-temp-prefixes.patch + ] + ++ lib.optional targetPlatform.isiOS ./support-ios.patch + ++ lib.optional stdenv.targetPlatform.isWindows ./windres-locate-gcc.patch + ++ + lib.optional stdenv.targetPlatform.isMips64n64 + # this patch is from debian: + # https://sources.debian.org/data/main/b/binutils/2.38-3/debian/patches/mips64-default-n64.diff + ( + if stdenv.targetPlatform.isMusl then + substitute { + src = ./mips64-default-n64.patch; + substitutions = [ + "--replace" + "gnuabi64" + "muslabi64" + ]; + } + else + ./mips64-default-n64.patch + ) + # On PowerPC, when generating assembly code, GCC generates a `.machine` + # custom instruction which instructs the assembler to generate code for this + # machine. However, some GCC versions generate the wrong one, or make it + # too strict, which leads to some confusing "unrecognized opcode: wrtee" + # or "unrecognized opcode: eieio" errors. + # + # To remove when binutils 2.39 is released. + # + # Upstream commit: + # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=cebc89b9328eab994f6b0314c263f94e7949a553 + ++ lib.optional stdenv.targetPlatform.isPower ./ppc-make-machine-less-strict.patch; outputs = [ "out" @@ -125,20 +124,19 @@ stdenv.mkDerivation { strictDeps = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - bison - perl - texinfo - ] - ++ lib.optionals targetPlatform.isiOS [ autoreconfHook ] - ++ lib.optionals buildPlatform.isDarwin [ - autoconf269 - automake - gettext - libtool - ] - ++ lib.optionals targetPlatform.isVc4 [ flex ]; + nativeBuildInputs = [ + bison + perl + texinfo + ] + ++ lib.optionals targetPlatform.isiOS [ autoreconfHook ] + ++ lib.optionals buildPlatform.isDarwin [ + autoconf269 + automake + gettext + libtool + ] + ++ lib.optionals targetPlatform.isVc4 [ flex ]; buildInputs = [ zlib @@ -190,46 +188,45 @@ stdenv.mkDerivation { "target" ]; - configureFlags = - [ - "--enable-64-bit-bfd" - "--with-system-zlib" + configureFlags = [ + "--enable-64-bit-bfd" + "--with-system-zlib" - "--enable-deterministic-archives" - "--disable-werror" - "--enable-fix-loongson2f-nop" + "--enable-deterministic-archives" + "--disable-werror" + "--enable-fix-loongson2f-nop" - # Turn on --enable-new-dtags by default to make the linker set - # RUNPATH instead of RPATH on binaries. This is important because - # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. - "--enable-new-dtags" + # Turn on --enable-new-dtags by default to make the linker set + # RUNPATH instead of RPATH on binaries. This is important because + # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. + "--enable-new-dtags" - # force target prefix. Some versions of binutils will make it empty if - # `--host` and `--target` are too close, even if Nixpkgs thinks the - # platforms are different (e.g. because not all the info makes the - # `config`). Other versions of binutils will always prefix if `--target` is - # passed, even if `--host` and `--target` are the same. The easiest thing - # for us to do is not leave it to chance, and force the program prefix to be - # what we want it to be. - "--program-prefix=${targetPrefix}" - ] - ++ lib.optionals withAllTargets [ "--enable-targets=all" ] - ++ lib.optionals enableGold [ - "--enable-gold" - "--enable-plugins" - ] - ++ ( - if enableShared then - [ - "--enable-shared" - "--disable-static" - ] - else - [ - "--disable-shared" - "--enable-static" - ] - ); + # force target prefix. Some versions of binutils will make it empty if + # `--host` and `--target` are too close, even if Nixpkgs thinks the + # platforms are different (e.g. because not all the info makes the + # `config`). Other versions of binutils will always prefix if `--target` is + # passed, even if `--host` and `--target` are the same. The easiest thing + # for us to do is not leave it to chance, and force the program prefix to be + # what we want it to be. + "--program-prefix=${targetPrefix}" + ] + ++ lib.optionals withAllTargets [ "--enable-targets=all" ] + ++ lib.optionals enableGold [ + "--enable-gold" + "--enable-plugins" + ] + ++ ( + if enableShared then + [ + "--enable-shared" + "--disable-static" + ] + else + [ + "--disable-shared" + "--enable-static" + ] + ); # Fails doCheck = false; diff --git a/pkgs/development/tools/misc/binutils/2.38/libbfd.nix b/pkgs/development/tools/misc/binutils/2.38/libbfd.nix index c24d23826115..d63405118e71 100644 --- a/pkgs/development/tools/misc/binutils/2.38/libbfd.nix +++ b/pkgs/development/tools/misc/binutils/2.38/libbfd.nix @@ -49,7 +49,8 @@ stdenv.mkDerivation { buildInputs = [ libiberty zlib - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ]; configurePlatforms = [ "build" @@ -60,7 +61,8 @@ stdenv.mkDerivation { "--enable-64-bit-bfd" "--enable-install-libbfd" "--with-system-zlib" - ] ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared"; + ] + ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared"; enableParallelBuilding = true; diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 8e6f6605079d..04e311bf38a1 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -120,38 +120,36 @@ stdenv.mkDerivation (finalAttrs: { ./windres-locate-gcc.patch ]; - outputs = - [ - "out" - "info" - "man" - "dev" - ] - # Ideally we would like to always install 'lib' into a separate - # target. Unfortunately cross-compiled binutils installs libraries - # across both `$lib/lib/` and `$out/$target/lib` with a reference - # from $out to $lib. Probably a binutils bug: all libraries should go - # to $lib as binutils does not build target libraries. Let's make our - # life slightly simpler by installing everything into $out for - # cross-binutils. - ++ lib.optionals (targetPlatform == hostPlatform) [ "lib" ]; + outputs = [ + "out" + "info" + "man" + "dev" + ] + # Ideally we would like to always install 'lib' into a separate + # target. Unfortunately cross-compiled binutils installs libraries + # across both `$lib/lib/` and `$out/$target/lib` with a reference + # from $out to $lib. Probably a binutils bug: all libraries should go + # to $lib as binutils does not build target libraries. Let's make our + # life slightly simpler by installing everything into $out for + # cross-binutils. + ++ lib.optionals (targetPlatform == hostPlatform) [ "lib" ]; strictDeps = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; # texinfo was removed here in https://github.com/NixOS/nixpkgs/pull/210132 # to reduce rebuilds during stdenv bootstrap. Please don't add it back without # checking the impact there first. - nativeBuildInputs = - [ - bison - perl - ] - ++ lib.optionals buildPlatform.isDarwin [ - autoconf269 - automake - gettext - libtool - ]; + nativeBuildInputs = [ + bison + perl + ] + ++ lib.optionals buildPlatform.isDarwin [ + autoconf269 + automake + gettext + libtool + ]; buildInputs = [ zlib @@ -212,69 +210,68 @@ stdenv.mkDerivation (finalAttrs: { "target" ]; - configureFlags = - [ - "--enable-64-bit-bfd" - "--with-system-zlib" + configureFlags = [ + "--enable-64-bit-bfd" + "--with-system-zlib" - "--enable-deterministic-archives" - "--disable-werror" - "--enable-fix-loongson2f-nop" + "--enable-deterministic-archives" + "--disable-werror" + "--enable-fix-loongson2f-nop" - # Turn on --enable-new-dtags by default to make the linker set - # RUNPATH instead of RPATH on binaries. This is important because - # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. - "--enable-new-dtags" + # Turn on --enable-new-dtags by default to make the linker set + # RUNPATH instead of RPATH on binaries. This is important because + # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. + "--enable-new-dtags" - # force target prefix. Some versions of binutils will make it empty if - # `--host` and `--target` are too close, even if Nixpkgs thinks the - # platforms are different (e.g. because not all the info makes the - # `config`). Other versions of binutils will always prefix if `--target` is - # passed, even if `--host` and `--target` are the same. The easiest thing - # for us to do is not leave it to chance, and force the program prefix to be - # what we want it to be. - "--program-prefix=${targetPrefix}" + # force target prefix. Some versions of binutils will make it empty if + # `--host` and `--target` are too close, even if Nixpkgs thinks the + # platforms are different (e.g. because not all the info makes the + # `config`). Other versions of binutils will always prefix if `--target` is + # passed, even if `--host` and `--target` are the same. The easiest thing + # for us to do is not leave it to chance, and force the program prefix to be + # what we want it to be. + "--program-prefix=${targetPrefix}" - # Unconditionally disable: - # - musl target needs porting: https://sourceware.org/PR29477 - "--disable-gprofng" + # Unconditionally disable: + # - musl target needs porting: https://sourceware.org/PR29477 + "--disable-gprofng" - # By default binutils searches $libdir for libraries. This brings in - # libbfd and libopcodes into a default visibility. Drop default lib - # path to force users to declare their use of these libraries. - "--with-lib-path=:" - ] - ++ lib.optionals withAllTargets [ - "--enable-targets=all" - # gas will be built separately for each target. - "--disable-gas" - ] - ++ lib.optionals enableGold [ - "--enable-gold${lib.optionalString enableGoldDefault "=default"}" - "--enable-plugins" - ] - ++ ( - if enableShared then - [ - "--enable-shared" - "--disable-static" - ] - else - [ - "--disable-shared" - "--enable-static" - ] - ) - ++ (lib.optionals (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") + # By default binutils searches $libdir for libraries. This brings in + # libbfd and libopcodes into a default visibility. Drop default lib + # path to force users to declare their use of these libraries. + "--with-lib-path=:" + ] + ++ lib.optionals withAllTargets [ + "--enable-targets=all" + # gas will be built separately for each target. + "--disable-gas" + ] + ++ lib.optionals enableGold [ + "--enable-gold${lib.optionalString enableGoldDefault "=default"}" + "--enable-plugins" + ] + ++ ( + if enableShared then [ - # lld17+ passes `--no-undefined-version` by default and makes this a hard - # error; libctf.ver version script references symbols that aren't present. - # - # This is fixed upstream and can be removed with the future release of 2.43. - # For now we allow this with `--undefined-version`: - "LDFLAGS=-Wl,--undefined-version" + "--enable-shared" + "--disable-static" ] - ); + else + [ + "--disable-shared" + "--enable-static" + ] + ) + ++ (lib.optionals (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") + [ + # lld17+ passes `--no-undefined-version` by default and makes this a hard + # error; libctf.ver version script references symbols that aren't present. + # + # This is fixed upstream and can be removed with the future release of 2.43. + # For now we allow this with `--undefined-version`: + "LDFLAGS=-Wl,--undefined-version" + ] + ); postConfigure = lib.optionalString withAllTargets '' for target in ${lib.escapeShellArgs allGasTargets}; do diff --git a/pkgs/development/tools/misc/creduce/default.nix b/pkgs/development/tools/misc/creduce/default.nix index a893a0acb8a1..3efde95d5851 100644 --- a/pkgs/development/tools/misc/creduce/default.nix +++ b/pkgs/development/tools/misc/creduce/default.nix @@ -39,42 +39,40 @@ stdenv.mkDerivation rec { }) ]; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace "-std=c++11" "-std=c++17" - '' - # On Linux, c-reduce's preferred way to reason about - # the cpu architecture/topology is to use 'lscpu', - # so let's make sure it knows where to find it: - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace creduce/creduce_utils.pm --replace \ - lscpu ${util-linux}/bin/lscpu - ''; + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "-std=c++11" "-std=c++17" + '' + # On Linux, c-reduce's preferred way to reason about + # the cpu architecture/topology is to use 'lscpu', + # so let's make sure it knows where to find it: + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace creduce/creduce_utils.pm --replace \ + lscpu ${util-linux}/bin/lscpu + ''; nativeBuildInputs = [ cmake makeWrapper llvm.dev ]; - buildInputs = - [ - # Ensure stdenv's CC is on PATH before clang-unwrapped - stdenv.cc - # Actual deps: - llvm - libclang - flex - zlib - ] - ++ (with perlPackages; [ - perl - ExporterLite - FileWhich - GetoptTabular - RegexpCommon - TermReadKey - ]); + buildInputs = [ + # Ensure stdenv's CC is on PATH before clang-unwrapped + stdenv.cc + # Actual deps: + llvm + libclang + flex + zlib + ] + ++ (with perlPackages; [ + perl + ExporterLite + FileWhich + GetoptTabular + RegexpCommon + TermReadKey + ]); postInstall = '' wrapProgram $out/bin/creduce --prefix PERL5LIB : "$PERL5LIB" diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index a861204bdbf1..55b2572df2ff 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -72,13 +72,12 @@ stdenv.mkDerivation rec { substituteInPlace sim/ppc/emul_unix.c --replace sys/termios.h termios.h ''; - patches = - [ - ./debug-info-from-env.patch - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - ./darwin-target-match.patch - ]; + patches = [ + ./debug-info-from-env.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + ./darwin-target-match.patch + ]; nativeBuildInputs = [ pkg-config @@ -87,24 +86,23 @@ stdenv.mkDerivation rec { setupDebugInfoDirs ]; - buildInputs = - [ - ncurses - readline - gmp - mpfr - expat - libipt - zlib - zstd - xz - guile - sourceHighlight - ] - ++ lib.optional pythonSupport python3 - ++ lib.optional doCheck dejagnu - ++ lib.optional enableDebuginfod (elfutils.override { enableDebuginfod = true; }) - ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + buildInputs = [ + ncurses + readline + gmp + mpfr + expat + libipt + zlib + zstd + xz + guile + sourceHighlight + ] + ++ lib.optional pythonSupport python3 + ++ lib.optional doCheck dejagnu + ++ lib.optional enableDebuginfod (elfutils.override { enableDebuginfod = true; }) + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; propagatedNativeBuildInputs = [ setupDebugInfoDirs ]; @@ -140,44 +138,43 @@ stdenv.mkDerivation rec { ''; configureScript = "../configure"; - configureFlags = - [ - # Set the program prefix to the current targetPrefix. - # This ensures that the prefix always conforms to - # nixpkgs' expectations instead of relying on the build - # system which only receives `config` which is merely a - # subset of the platform description. - "--program-prefix=${targetPrefix}" + configureFlags = [ + # Set the program prefix to the current targetPrefix. + # This ensures that the prefix always conforms to + # nixpkgs' expectations instead of relying on the build + # system which only receives `config` which is merely a + # subset of the platform description. + "--program-prefix=${targetPrefix}" - "--disable-werror" - ] - ++ lib.optional (!hostCpuOnly) "--enable-targets=all" - ++ [ - "--enable-64-bit-bfd" - "--disable-install-libbfd" - "--disable-shared" - "--enable-static" - "--with-system-zlib" - "--with-system-readline" + "--disable-werror" + ] + ++ lib.optional (!hostCpuOnly) "--enable-targets=all" + ++ [ + "--enable-64-bit-bfd" + "--disable-install-libbfd" + "--disable-shared" + "--enable-static" + "--with-system-zlib" + "--with-system-readline" - "--with-system-gdbinit=/etc/gdb/gdbinit" - "--with-system-gdbinit-dir=/etc/gdb/gdbinit.d" + "--with-system-gdbinit=/etc/gdb/gdbinit" + "--with-system-gdbinit-dir=/etc/gdb/gdbinit.d" - "--with-gmp=${gmp.dev}" - "--with-mpfr=${mpfr.dev}" - "--with-expat" - "--with-libexpat-prefix=${expat.dev}" - "--with-auto-load-safe-path=${builtins.concatStringsSep ":" safePaths}" - ] - ++ lib.optional (!pythonSupport) "--without-python" - ++ lib.optional stdenv.hostPlatform.isMusl "--disable-nls" - ++ lib.optional stdenv.hostPlatform.isStatic "--disable-inprocess-agent" - ++ lib.optional enableDebuginfod "--with-debuginfod=yes" - ++ lib.optional (!enableSim) "--disable-sim" - # Workaround for Apple Silicon, "--target" must be "faked", see eg: https://github.com/Homebrew/homebrew-core/pull/209753 - ++ lib.optional ( - stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 - ) "--target=x86_64-apple-darwin"; + "--with-gmp=${gmp.dev}" + "--with-mpfr=${mpfr.dev}" + "--with-expat" + "--with-libexpat-prefix=${expat.dev}" + "--with-auto-load-safe-path=${builtins.concatStringsSep ":" safePaths}" + ] + ++ lib.optional (!pythonSupport) "--without-python" + ++ lib.optional stdenv.hostPlatform.isMusl "--disable-nls" + ++ lib.optional stdenv.hostPlatform.isStatic "--disable-inprocess-agent" + ++ lib.optional enableDebuginfod "--with-debuginfod=yes" + ++ lib.optional (!enableSim) "--disable-sim" + # Workaround for Apple Silicon, "--target" must be "faked", see eg: https://github.com/Homebrew/homebrew-core/pull/209753 + ++ lib.optional ( + stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 + ) "--target=x86_64-apple-darwin"; postInstall = '' # Remove Info files already provided by Binutils and other packages. diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix index 9cb4a80efa66..64f9d9f6ae69 100644 --- a/pkgs/development/tools/misc/luarocks/default.nix +++ b/pkgs/development/tools/misc/luarocks/default.nix @@ -73,35 +73,34 @@ stdenv.mkDerivation (finalAttrs: { which ]; - postInstall = - '' - sed -e "1s@.*@#! ${lua}/bin/lua$LUA_SUFFIX@" -i "$out"/bin/* - substituteInPlace $out/etc/luarocks/* \ - --replace-quiet '${lua.luaOnBuild}' '${lua}' - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd luarocks \ - --bash <($out/bin/luarocks completion bash) \ - --fish <($out/bin/luarocks completion fish) \ - --zsh <($out/bin/luarocks completion zsh) + postInstall = '' + sed -e "1s@.*@#! ${lua}/bin/lua$LUA_SUFFIX@" -i "$out"/bin/* + substituteInPlace $out/etc/luarocks/* \ + --replace-quiet '${lua.luaOnBuild}' '${lua}' + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd luarocks \ + --bash <($out/bin/luarocks completion bash) \ + --fish <($out/bin/luarocks completion fish) \ + --zsh <($out/bin/luarocks completion zsh) - installShellCompletion --cmd luarocks-admin \ - --bash <($out/bin/luarocks-admin completion bash) \ - --fish <($out/bin/luarocks-admin completion fish) \ - --zsh <($out/bin/luarocks-admin completion zsh) - '' - + '' - for i in "$out"/bin/*; do - test -L "$i" || { - wrapProgram "$i" \ - --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?.lua" \ - --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?/init.lua" \ - --suffix LUA_CPATH ";" "$(echo "$out"/lib/lua/*/)?.so" \ - --suffix LUA_CPATH ";" "$(echo "$out"/share/lua/*/)?/init.lua" \ - --suffix PATH : ${lib.makeBinPath finalAttrs.propagatedNativeBuildInputs} - } - done - ''; + installShellCompletion --cmd luarocks-admin \ + --bash <($out/bin/luarocks-admin completion bash) \ + --fish <($out/bin/luarocks-admin completion fish) \ + --zsh <($out/bin/luarocks-admin completion zsh) + '' + + '' + for i in "$out"/bin/*; do + test -L "$i" || { + wrapProgram "$i" \ + --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?.lua" \ + --suffix LUA_PATH ";" "$(echo "$out"/share/lua/*/)?/init.lua" \ + --suffix LUA_CPATH ";" "$(echo "$out"/lib/lua/*/)?.so" \ + --suffix LUA_CPATH ";" "$(echo "$out"/share/lua/*/)?/init.lua" \ + --suffix PATH : ${lib.makeBinPath finalAttrs.propagatedNativeBuildInputs} + } + done + ''; propagatedNativeBuildInputs = [ zip diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix index 8a60b708fc78..e5f12a79fa25 100644 --- a/pkgs/development/tools/misc/premake/5.nix +++ b/pkgs/development/tools/misc/premake/5.nix @@ -22,31 +22,29 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-sNLCyIHWDW/8jIrMFCZAqtWsh4SRugqtPR4HaoW/Vzk="; }; - buildInputs = - [ - libuuid - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - readline - ]; + buildInputs = [ + libuuid + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + readline + ]; patches = [ ./no-curl-ca.patch ]; - postPatch = - '' - substituteInPlace contrib/curl/premake5.lua \ - --replace-fail "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace premake5.lua \ - --replace-fail '"-arch arm64"' '""' \ - --replace-fail '"-arch x86_64"' '""' - '' - + lib.optionalString stdenv.hostPlatform.isStatic '' - substituteInPlace \ - binmodules/example/premake5.lua \ - binmodules/luasocket/premake5.lua \ - --replace-fail SharedLib StaticLib - ''; + postPatch = '' + substituteInPlace contrib/curl/premake5.lua \ + --replace-fail "ca = nil" "ca = '${cacert}/etc/ssl/certs/ca-bundle.crt'" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace premake5.lua \ + --replace-fail '"-arch arm64"' '""' \ + --replace-fail '"-arch x86_64"' '""' + '' + + lib.optionalString stdenv.hostPlatform.isStatic '' + substituteInPlace \ + binmodules/example/premake5.lua \ + binmodules/luasocket/premake5.lua \ + --replace-fail SharedLib StaticLib + ''; buildPhase = if stdenv.hostPlatform.isDarwin then diff --git a/pkgs/development/tools/misc/sqitch/default.nix b/pkgs/development/tools/misc/sqitch/default.nix index 7e23adee7bfd..bbd7bef633ef 100644 --- a/pkgs/development/tools/misc/sqitch/default.nix +++ b/pkgs/development/tools/misc/sqitch/default.nix @@ -30,20 +30,19 @@ stdenv.mkDerivation { src = sqitch; dontBuild = true; - installPhase = - '' - mkdir -p $out/bin - for d in bin/sqitch etc lib share ; do - # make sure dest alreay exists before symlink - # this prevents installing a broken link into the path - if [ -e ${sqitch}/$d ]; then - ln -s ${sqitch}/$d $out/$d - fi - done - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - shortenPerlShebang $out/bin/sqitch - ''; + installPhase = '' + mkdir -p $out/bin + for d in bin/sqitch etc lib share ; do + # make sure dest alreay exists before symlink + # this prevents installing a broken link into the path + if [ -e ${sqitch}/$d ]; then + ln -s ${sqitch}/$d $out/$d + fi + done + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + shortenPerlShebang $out/bin/sqitch + ''; dontStrip = true; postFixup = '' wrapProgram $out/bin/sqitch --prefix PERL5LIB : ${lib.escapeShellArg (perlPackages.makeFullPerlPath modules)} diff --git a/pkgs/development/tools/misc/texinfo/common.nix b/pkgs/development/tools/misc/texinfo/common.nix index 9d70fc7a8680..49f1bf8c8018 100644 --- a/pkgs/development/tools/misc/texinfo/common.nix +++ b/pkgs/development/tools/misc/texinfo/common.nix @@ -58,30 +58,29 @@ stdenv.mkDerivation { patchShebangs tp/maintain/regenerate_commands_perl_info.pl ''; - env = - { - XFAIL_TESTS = toString ( - optionals stdenv.hostPlatform.isMusl [ - # musl does not support locales. - "different_languages_gen_master_menu.sh" - "test_scripts/formatting_documentlanguage_cmdline.sh" - "test_scripts/layout_formatting_fr_info.sh" - "test_scripts/layout_formatting_fr.sh" - "test_scripts/layout_formatting_fr_icons.sh" - ] - ++ optionals (!stdenv.hostPlatform.isMusl && versionOlder version "7") [ - # Test is known to fail on various locales on texinfo-6.8: - # https://lists.gnu.org/r/bug-texinfo/2021-07/msg00012.html - "test_scripts/layout_formatting_fr_icons.sh" - ] - ); - } - // lib.optionalAttrs crossBuildTools { - # ncurses is required to build `makedoc' - # this feature is introduced by the ./cross-tools-flags.patch - NATIVE_TOOLS_CFLAGS = "-I${getDev buildPackages.ncurses}/include"; - NATIVE_TOOLS_LDFLAGS = "-L${getLib buildPackages.ncurses}/lib"; - }; + env = { + XFAIL_TESTS = toString ( + optionals stdenv.hostPlatform.isMusl [ + # musl does not support locales. + "different_languages_gen_master_menu.sh" + "test_scripts/formatting_documentlanguage_cmdline.sh" + "test_scripts/layout_formatting_fr_info.sh" + "test_scripts/layout_formatting_fr.sh" + "test_scripts/layout_formatting_fr_icons.sh" + ] + ++ optionals (!stdenv.hostPlatform.isMusl && versionOlder version "7") [ + # Test is known to fail on various locales on texinfo-6.8: + # https://lists.gnu.org/r/bug-texinfo/2021-07/msg00012.html + "test_scripts/layout_formatting_fr_icons.sh" + ] + ); + } + // lib.optionalAttrs crossBuildTools { + # ncurses is required to build `makedoc' + # this feature is introduced by the ./cross-tools-flags.patch + NATIVE_TOOLS_CFLAGS = "-I${getDev buildPackages.ncurses}/include"; + NATIVE_TOOLS_LDFLAGS = "-L${getLib buildPackages.ncurses}/lib"; + }; strictDeps = true; enableParallelBuilding = true; @@ -93,30 +92,30 @@ stdenv.mkDerivation { ]; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]; - buildInputs = - [ - bashNonInteractive - libintl - ] - ++ optionals stdenv.hostPlatform.isSunOS [ - libiconv - gawk - ] - ++ optional interactive ncurses; + buildInputs = [ + bashNonInteractive + libintl + ] + ++ optionals stdenv.hostPlatform.isSunOS [ + libiconv + gawk + ] + ++ optional interactive ncurses; - configureFlags = - [ "PERL=${buildPackages.perl}/bin/perl" ] - # Perl XS modules are difficult to cross-compile and texinfo has pure Perl - # fallbacks. - # Also prevent the buildPlatform's awk being used in the texindex script - ++ optionals crossBuildTools [ - "--enable-perl-xs=no" - "TI_AWK=${getBin gawk}/bin/awk" - ] - ++ optionals (crossBuildTools && lib.versionAtLeast version "7.1") [ - "texinfo_cv_sys_iconv_converts_euc_cn=yes" - ] - ++ optional stdenv.hostPlatform.isSunOS "AWK=${gawk}/bin/awk"; + configureFlags = [ + "PERL=${buildPackages.perl}/bin/perl" + ] + # Perl XS modules are difficult to cross-compile and texinfo has pure Perl + # fallbacks. + # Also prevent the buildPlatform's awk being used in the texindex script + ++ optionals crossBuildTools [ + "--enable-perl-xs=no" + "TI_AWK=${getBin gawk}/bin/awk" + ] + ++ optionals (crossBuildTools && lib.versionAtLeast version "7.1") [ + "texinfo_cv_sys_iconv_converts_euc_cn=yes" + ] + ++ optional stdenv.hostPlatform.isSunOS "AWK=${gawk}/bin/awk"; installFlags = [ "TEXMF=$(out)/texmf-dist" ]; installTargets = [ diff --git a/pkgs/development/tools/mysql-shell/8.nix b/pkgs/development/tools/mysql-shell/8.nix index 5f2ac287b656..f7a769ed03f9 100644 --- a/pkgs/development/tools/mysql-shell/8.nix +++ b/pkgs/development/tools/mysql-shell/8.nix @@ -75,44 +75,42 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace cmake/libutils.cmake --replace-fail /usr/bin/libtool libtool ''; - nativeBuildInputs = - [ - pkg-config - cmake - git - bison - makeWrapper - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - darwin.DarwinTools - ]; + nativeBuildInputs = [ + pkg-config + cmake + git + bison + makeWrapper + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + darwin.DarwinTools + ]; - buildInputs = - [ - curl - libedit - libssh - lz4 - openssl - protobuf - readline - zlib - zstd - libevent - icu - re2 - ncurses - libfido2 - cyrus_sasl - openldap - python3 - antlr.runtime.cpp - ] - ++ pythonDeps - ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ]; + buildInputs = [ + curl + libedit + libssh + lz4 + openssl + protobuf + readline + zlib + zstd + libevent + icu + re2 + ncurses + libfido2 + cyrus_sasl + openldap + python3 + antlr.runtime.cpp + ] + ++ pythonDeps + ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ]; preConfigure = '' # Build MySQL diff --git a/pkgs/development/tools/mysql-shell/innovation.nix b/pkgs/development/tools/mysql-shell/innovation.nix index 177992ca170b..f9305754f960 100644 --- a/pkgs/development/tools/mysql-shell/innovation.nix +++ b/pkgs/development/tools/mysql-shell/innovation.nix @@ -75,44 +75,42 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace cmake/libutils.cmake --replace-fail /usr/bin/libtool libtool ''; - nativeBuildInputs = - [ - pkg-config - cmake - git - bison - makeWrapper - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - darwin.DarwinTools - ]; + nativeBuildInputs = [ + pkg-config + cmake + git + bison + makeWrapper + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + darwin.DarwinTools + ]; - buildInputs = - [ - curl - libedit - libssh - lz4 - openssl - protobuf - readline - zlib - zstd - libevent - icu - re2 - ncurses - libfido2 - cyrus_sasl - openldap - python3 - antlr.runtime.cpp - ] - ++ pythonDeps - ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ]; + buildInputs = [ + curl + libedit + libssh + lz4 + openssl + protobuf + readline + zlib + zstd + libevent + icu + re2 + ncurses + libfido2 + cyrus_sasl + openldap + python3 + antlr.runtime.cpp + ] + ++ pythonDeps + ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ]; env = { ${if stdenv.cc.isGNU then "NIX_CFLAGS_COMPILE" else null} = "-Wno-error=maybe-uninitialized"; diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix index 89cdc1eb6ec3..d6b5ee620eb7 100644 --- a/pkgs/development/tools/ocaml/camlp4/default.nix +++ b/pkgs/development/tools/ocaml/camlp4/default.nix @@ -99,15 +99,14 @@ else strictDeps = true; - nativeBuildInputs = - [ - which - ocaml - ocamlbuild - ] - ++ lib.optionals (lib.versionAtLeast ocaml.version "5.0") [ - findlib - ]; + nativeBuildInputs = [ + which + ocaml + ocamlbuild + ] + ++ lib.optionals (lib.versionAtLeast ocaml.version "5.0") [ + findlib + ]; buildInputs = lib.optionals (lib.versionAtLeast ocaml.version "5.0") [ camlp-streams diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index 4d8f48f6f1c7..4efd7cba37ee 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -39,13 +39,12 @@ stdenv.mkDerivation rec { "${placeholder "out"}/etc/findlib.conf" ]; - buildFlags = - [ - "all" - ] - ++ lib.optionals ocaml.nativeCompilers [ - "opt" - ]; + buildFlags = [ + "all" + ] + ++ lib.optionals ocaml.nativeCompilers [ + "opt" + ]; setupHook = writeText "setupHook.sh" '' addOCamlPath () { diff --git a/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix b/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix index 10420f81acc6..df404d66b16c 100644 --- a/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix +++ b/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix @@ -16,18 +16,19 @@ buildDunePackage rec { minimalOCamlVersion = "4.06"; - buildInputs = - [ findlib ] - ++ ( - if lib.versionAtLeast version "4.7-414" then - [ merlin-lib ] - else - [ - yojson - csexp - result - ] - ); + buildInputs = [ + findlib + ] + ++ ( + if lib.versionAtLeast version "4.7-414" then + [ merlin-lib ] + else + [ + yojson + csexp + result + ] + ); meta = with lib; { description = "Reads config files for merlin"; diff --git a/pkgs/development/tools/ocaml/opam/default.nix b/pkgs/development/tools/ocaml/opam/default.nix index e6d761e19250..e2e6e99fb8eb 100644 --- a/pkgs/development/tools/ocaml/opam/default.nix +++ b/pkgs/development/tools/ocaml/opam/default.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ ncurses getconf - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ bubblewrap ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ bubblewrap ]; patches = [ ./opam-shebangs.patch ]; diff --git a/pkgs/development/tools/parsing/flex/default.nix b/pkgs/development/tools/parsing/flex/default.nix index c6c62b2cc2dc..15aa95351878 100644 --- a/pkgs/development/tools/parsing/flex/default.nix +++ b/pkgs/development/tools/parsing/flex/default.nix @@ -32,15 +32,14 @@ stdenv.mkDerivation rec { }) ]; - postPatch = - '' - patchShebangs tests - '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - substituteInPlace Makefile.in --replace "tests" " " + postPatch = '' + patchShebangs tests + '' + + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + substituteInPlace Makefile.in --replace "tests" " " - substituteInPlace doc/Makefile.am --replace 'flex.1: $(top_srcdir)/configure.ac' 'flex.1: ' - ''; + substituteInPlace doc/Makefile.am --replace 'flex.1: $(top_srcdir)/configure.ac' 'flex.1: ' + ''; depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ diff --git a/pkgs/development/tools/parsing/tree-sitter/default.nix b/pkgs/development/tools/parsing/tree-sitter/default.nix index bdeb13230440..499942477a8e 100644 --- a/pkgs/development/tools/parsing/tree-sitter/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/default.nix @@ -173,17 +173,19 @@ rustPlatform.buildRustPackage { cargoHash = "sha256-sGh16M7cbT5ct1sT2FcUUoIQFcoOftTuQ0aSCjtkTEs="; - buildInputs = - [ installShellFiles ] - ++ lib.optionals webUISupport [ - openssl - ]; - nativeBuildInputs = - [ which ] - ++ lib.optionals webUISupport [ - emscripten - pkg-config - ]; + buildInputs = [ + installShellFiles + ] + ++ lib.optionals webUISupport [ + openssl + ]; + nativeBuildInputs = [ + which + ] + ++ lib.optionals webUISupport [ + emscripten + pkg-config + ]; patches = lib.optionals (!webUISupport) [ (substitute { @@ -205,24 +207,23 @@ rustPlatform.buildRustPackage { cargo run --package xtask -- build-wasm --debug ''; - postInstall = - '' - PREFIX=$out make install - ${lib.optionalString (!enableShared) "rm $out/lib/*.so{,.*}"} - ${lib.optionalString (!enableStatic) "rm $out/lib/*.a"} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd tree-sitter \ - --bash <("$out/bin/tree-sitter" complete --shell bash) \ - --zsh <("$out/bin/tree-sitter" complete --shell zsh) \ - --fish <("$out/bin/tree-sitter" complete --shell fish) - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd tree-sitter \ - --bash "${buildPackages.tree-sitter}"/share/bash-completion/completions/*.bash \ - --zsh "${buildPackages.tree-sitter}"/share/zsh/site-functions/* \ - --fish "${buildPackages.tree-sitter}"/share/fish/*/* - ''; + postInstall = '' + PREFIX=$out make install + ${lib.optionalString (!enableShared) "rm $out/lib/*.so{,.*}"} + ${lib.optionalString (!enableStatic) "rm $out/lib/*.a"} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd tree-sitter \ + --bash <("$out/bin/tree-sitter" complete --shell bash) \ + --zsh <("$out/bin/tree-sitter" complete --shell zsh) \ + --fish <("$out/bin/tree-sitter" complete --shell fish) + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd tree-sitter \ + --bash "${buildPackages.tree-sitter}"/share/bash-completion/completions/*.bash \ + --zsh "${buildPackages.tree-sitter}"/share/zsh/site-functions/* \ + --fish "${buildPackages.tree-sitter}"/share/fish/*/* + ''; # test result: FAILED. 120 passed; 13 failed; 0 ignored; 0 measured; 0 filtered out doCheck = false; diff --git a/pkgs/development/tools/profiling/heaptrack/default.nix b/pkgs/development/tools/profiling/heaptrack/default.nix index 492864c6d9ae..f0920e8b850f 100644 --- a/pkgs/development/tools/profiling/heaptrack/default.nix +++ b/pkgs/development/tools/profiling/heaptrack/default.nix @@ -46,24 +46,23 @@ mkDerivation rec { extra-cmake-modules makeBinaryWrapper ]; - buildInputs = - [ - zlib - boost - libunwind - sparsehash - zstd - qtbase - kio - kitemmodels - threadweaver - kconfigwidgets - kcoreaddons - kdiagram - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - elfutils - ]; + buildInputs = [ + zlib + boost + libunwind + sparsehash + zstd + qtbase + kio + kitemmodels + threadweaver + kconfigwidgets + kcoreaddons + kdiagram + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + elfutils + ]; postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' makeWrapper \ diff --git a/pkgs/development/tools/rust/bindgen/default.nix b/pkgs/development/tools/rust/bindgen/default.nix index c6e6ec12f9d0..b574eb546421 100644 --- a/pkgs/development/tools/rust/bindgen/default.nix +++ b/pkgs/development/tools/rust/bindgen/default.nix @@ -16,13 +16,11 @@ let unwrapped = rust-bindgen-unwrapped; libclang = (lib.getLib clang.cc); meta = rust-bindgen-unwrapped.meta // { - longDescription = - rust-bindgen-unwrapped.meta.longDescription - + '' - This version of bindgen is wrapped with the required compiler flags - required to find the c and c++ standard library, as well as the libraries - specified in the buildInputs of your derivation. - ''; + longDescription = rust-bindgen-unwrapped.meta.longDescription + '' + This version of bindgen is wrapped with the required compiler flags + required to find the c and c++ standard library, as well as the libraries + specified in the buildInputs of your derivation. + ''; }; passthru.tests = { simple-c = runCommandCC "simple-c-bindgen-tests" { } '' diff --git a/pkgs/development/tools/rust/rustup/default.nix b/pkgs/development/tools/rust/rustup/default.nix index 911a956b9c44..ed3434d7b501 100644 --- a/pkgs/development/tools/rust/rustup/default.nix +++ b/pkgs/development/tools/rust/rustup/default.nix @@ -44,16 +44,15 @@ rustPlatform.buildRustPackage (finalAttrs: { installShellFiles ]; - buildInputs = - [ - openssl - curl - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - xz - ]; + buildInputs = [ + openssl + curl + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + xz + ]; buildFeatures = [ "no-self-update" ]; diff --git a/pkgs/development/tools/simavr/default.nix b/pkgs/development/tools/simavr/default.nix index f655d995f2cc..19a993f07896 100644 --- a/pkgs/development/tools/simavr/default.nix +++ b/pkgs/development/tools/simavr/default.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation rec { which pkg-config avrgcc - ] ++ lib.optional stdenv.hostPlatform.isDarwin setupHookDarwin; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin setupHookDarwin; buildInputs = [ libelf libglut diff --git a/pkgs/development/tools/wails/default.nix b/pkgs/development/tools/wails/default.nix index 946b4f3a1dcb..674281f43885 100644 --- a/pkgs/development/tools/wails/default.nix +++ b/pkgs/development/tools/wails/default.nix @@ -44,17 +44,16 @@ buildGoModule rec { allowGoReference = true; # Following packages are required when wails used as a builder. - propagatedBuildInputs = - [ - pkg-config - go - stdenv.cc - nodejs - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - gtk3 - webkitgtk_4_0 - ]; + propagatedBuildInputs = [ + pkg-config + go + stdenv.cc + nodejs + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + gtk3 + webkitgtk_4_0 + ]; ldflags = [ "-s" diff --git a/pkgs/development/tools/wasmedge/default.nix b/pkgs/development/tools/wasmedge/default.nix index 1d9e47a9ad7d..ce96078ef7a5 100644 --- a/pkgs/development/tools/wasmedge/default.nix +++ b/pkgs/development/tools/wasmedge/default.nix @@ -46,13 +46,12 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { libffi ]; - cmakeFlags = - [ - "-DWASMEDGE_BUILD_TESTS=OFF" # Tests are downloaded using git - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DWASMEDGE_FORCE_DISABLE_LTO=ON" - ]; + cmakeFlags = [ + "-DWASMEDGE_BUILD_TESTS=OFF" # Tests are downloaded using git + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DWASMEDGE_FORCE_DISABLE_LTO=ON" + ]; postPatch = '' echo -n $version > VERSION diff --git a/pkgs/development/tools/yarn2nix-moretea/default.nix b/pkgs/development/tools/yarn2nix-moretea/default.nix index 54bcdb8b68a7..dc10d2d51819 100644 --- a/pkgs/development/tools/yarn2nix-moretea/default.nix +++ b/pkgs/development/tools/yarn2nix-moretea/default.nix @@ -145,7 +145,8 @@ rec { yarn nodejs git - ] ++ extraNativeBuildInputs; + ] + ++ extraNativeBuildInputs; buildInputs = extraBuildInputs; configurePhase = @@ -401,7 +402,8 @@ rec { yarn nodejs rsync - ] ++ extraBuildInputs; + ] + ++ extraBuildInputs; node_modules = deps + "/node_modules"; @@ -471,16 +473,16 @@ rec { passthru = { inherit package packageJSON deps; workspaceDependencies = workspaceDependenciesTransitive; - } // (attrs.passthru or { }); + } + // (attrs.passthru or { }); - meta = - { - inherit (nodejs.meta) platforms; - } - // lib.optionalAttrs (package ? description) { inherit (package) description; } - // lib.optionalAttrs (package ? homepage) { inherit (package) homepage; } - // lib.optionalAttrs (package ? license) { license = getLicenseFromSpdxId package.license; } - // (attrs.meta or { }); + meta = { + inherit (nodejs.meta) platforms; + } + // lib.optionalAttrs (package ? description) { inherit (package) description; } + // lib.optionalAttrs (package ? homepage) { inherit (package) homepage; } + // lib.optionalAttrs (package ? license) { license = getLicenseFromSpdxId package.license; } + // (attrs.meta or { }); } ); diff --git a/pkgs/development/web/grails/default.nix b/pkgs/development/web/grails/default.nix index d81ad8c03597..3fb7833d3a96 100644 --- a/pkgs/development/web/grails/default.nix +++ b/pkgs/development/web/grails/default.nix @@ -36,19 +36,18 @@ stdenv.mkDerivation rec { dontBuild = true; - installPhase = - '' - mkdir -p "$out" - cp -vr . "$out" - # Remove (for now) uneeded Windows .bat files - rm -f "$out"/bin/*.bat - # Improve purity - sed -i -e '2iPATH=${binpath}:\$PATH' "$out"/bin/grails - '' - + lib.optionalString (jdk != null) '' - # Inject JDK path into grails - sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails - ''; + installPhase = '' + mkdir -p "$out" + cp -vr . "$out" + # Remove (for now) uneeded Windows .bat files + rm -f "$out"/bin/*.bat + # Improve purity + sed -i -e '2iPATH=${binpath}:\$PATH' "$out"/bin/grails + '' + + lib.optionalString (jdk != null) '' + # Inject JDK path into grails + sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails + ''; preferLocalBuild = true; diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 0ec9e4ec9633..fd84c71c0159 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -126,16 +126,15 @@ let !stdenv.hostPlatform.isDarwin && lib.versionOlder "${majorVersion}.${minorVersion}" "11.4"; useSharedSQLite = lib.versionAtLeast version "22.5"; - sharedLibDeps = - { - inherit openssl zlib libuv; - } - // (lib.optionalAttrs useSharedHttpParser { - inherit http-parser; - }) - // (lib.optionalAttrs useSharedSQLite { - inherit sqlite; - }); + sharedLibDeps = { + inherit openssl zlib libuv; + } + // (lib.optionalAttrs useSharedHttpParser { + inherit http-parser; + }) + // (lib.optionalAttrs useSharedSQLite { + inherit sqlite; + }); copyLibHeaders = map (name: "${lib.getDev sharedLibDeps.${name}}/include/*") ( builtins.attrNames sharedLibDeps @@ -193,21 +192,20 @@ let strictDeps = true; - env = - { - # Tell ninja to avoid ANSI sequences, otherwise we don’t see build - # progress in Nix logs. - # - # Note: do not set TERM=dumb environment variable globally, it is used in - # test-ci-js test suite to skip tests that otherwise run fine. - NINJA = "TERM=dumb ninja"; - } - // lib.optionalAttrs (!canExecute && !canEmulate) { - # these are used in the --cross-compiling case. see comment at postConfigure. - CC_host = touchScript "${buildPackages.stdenv.cc}/bin/cc"; - CXX_host = touchScript "${buildPackages.stdenv.cc}/bin/c++"; - AR_host = touchScript "${buildPackages.stdenv.cc}/bin/ar"; - }; + env = { + # Tell ninja to avoid ANSI sequences, otherwise we don’t see build + # progress in Nix logs. + # + # Note: do not set TERM=dumb environment variable globally, it is used in + # test-ci-js test suite to skip tests that otherwise run fine. + NINJA = "TERM=dumb ninja"; + } + // lib.optionalAttrs (!canExecute && !canEmulate) { + # these are used in the --cross-compiling case. see comment at postConfigure. + CC_host = touchScript "${buildPackages.stdenv.cc}/bin/cc"; + CXX_host = touchScript "${buildPackages.stdenv.cc}/bin/c++"; + AR_host = touchScript "${buildPackages.stdenv.cc}/bin/ar"; + }; # NB: technically, we do not need bash in build inputs since all scripts are # wrappers over the corresponding JS scripts. There are some packages though @@ -219,23 +217,23 @@ let http-parser icu bash - ] ++ lib.optionals useSharedSQLite [ sqlite ]; + ] + ++ lib.optionals useSharedSQLite [ sqlite ]; - nativeBuildInputs = - [ - installShellFiles - ninja - pkgconf - python - ] - ++ lib.optionals stdenv.buildPlatform.isDarwin [ - # gyp checks `sysctl -n hw.memsize` if `sys.platform == "darwin"`. - unixtools.sysctl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # For gyp-mac-tool if `flavor == "mac"`. - darwin-cctools-only-libtool - ]; + nativeBuildInputs = [ + installShellFiles + ninja + pkgconf + python + ] + ++ lib.optionals stdenv.buildPlatform.isDarwin [ + # gyp checks `sysctl -n hw.memsize` if `sys.platform == "darwin"`. + unixtools.sysctl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # For gyp-mac-tool if `flavor == "mac"`. + darwin-cctools-only-libtool + ]; # We currently rely on Makefile and stdenv for build phases, so do not let # ninja’s setup hook to override default stdenv phases. @@ -246,44 +244,44 @@ let outputs = [ "out" "libv8" - ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "dev" ]; + ] + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "dev" ]; setOutputFlags = false; moveToDev = false; - configureFlags = - [ - "--ninja" - "--with-intl=system-icu" - "--openssl-use-def-ca-store" - # --cross-compiling flag enables use of CC_host et. al - (if canExecute || canEmulate then "--no-cross-compiling" else "--cross-compiling") - "--dest-os=${destOS}" - "--dest-cpu=${destCPU}" - ] - ++ lib.optionals (destARMFPU != null) [ "--with-arm-fpu=${destARMFPU}" ] - ++ lib.optionals (destARMFloatABI != null) [ "--with-arm-float-abi=${destARMFloatABI}" ] - ++ lib.optionals (!canExecute && canEmulate) [ - # Node.js requires matching bitness between build and host platforms, e.g. - # for V8 startup snapshot builder (see tools/snapshot) and some other - # tools. We apply a patch that runs these tools using a host platform - # emulator and avoid cross-compiling altogether (from the build system’s - # perspective). - "--emulator=${emulator}" - ] - ++ lib.optionals (lib.versionOlder version "19") [ "--without-dtrace" ] - ++ lib.optionals (!enableNpm) [ "--without-npm" ] - ++ lib.concatMap (name: [ - "--shared-${name}" - "--shared-${name}-libpath=${lib.getLib sharedLibDeps.${name}}/lib" - /** - Closure notes: we explicitly avoid specifying --shared-*-includes, - as that would put the paths into bin/nodejs. - Including pkg-config in build inputs would also have the same effect! + configureFlags = [ + "--ninja" + "--with-intl=system-icu" + "--openssl-use-def-ca-store" + # --cross-compiling flag enables use of CC_host et. al + (if canExecute || canEmulate then "--no-cross-compiling" else "--cross-compiling") + "--dest-os=${destOS}" + "--dest-cpu=${destCPU}" + ] + ++ lib.optionals (destARMFPU != null) [ "--with-arm-fpu=${destARMFPU}" ] + ++ lib.optionals (destARMFloatABI != null) [ "--with-arm-float-abi=${destARMFloatABI}" ] + ++ lib.optionals (!canExecute && canEmulate) [ + # Node.js requires matching bitness between build and host platforms, e.g. + # for V8 startup snapshot builder (see tools/snapshot) and some other + # tools. We apply a patch that runs these tools using a host platform + # emulator and avoid cross-compiling altogether (from the build system’s + # perspective). + "--emulator=${emulator}" + ] + ++ lib.optionals (lib.versionOlder version "19") [ "--without-dtrace" ] + ++ lib.optionals (!enableNpm) [ "--without-npm" ] + ++ lib.concatMap (name: [ + "--shared-${name}" + "--shared-${name}-libpath=${lib.getLib sharedLibDeps.${name}}/lib" + /** + Closure notes: we explicitly avoid specifying --shared-*-includes, + as that would put the paths into bin/nodejs. + Including pkg-config in build inputs would also have the same effect! - FIXME: the statement above is outdated, we have to include pkg-config - in build inputs for system-icu. - */ - ]) (builtins.attrNames sharedLibDeps); + FIXME: the statement above is outdated, we have to include pkg-config + in build inputs for system-icu. + */ + ]) (builtins.attrNames sharedLibDeps); configurePlatforms = [ ]; @@ -351,103 +349,102 @@ let ] ); - checkFlags = - [ - # Do not create __pycache__ when running tests. - "PYTHONDONTWRITEBYTECODE=1" - ] - ++ lib.optionals (stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64) [ - # Python 3.12 introduced a warning for calling `os.fork()` in a - # multi‐threaded program. For some reason, the Node.js - # `tools/pseudo-tty.py` program used for PTY‐related tests - # triggers this warning on Hydra, on `x86_64-darwin` only, - # despite not creating any threads itself. This causes the - # Node.js test runner to misinterpret the warnings as part of the - # test output and fail. It does not reproduce reliably off Hydra - # on Intel Macs, or occur on the `aarch64-darwin` builds. - # - # This seems likely to be related to Rosetta 2, but it could also - # be some strange x86‐64‐only threading behaviour of the Darwin - # system libraries, or a bug in CPython, or something else - # haunted about the Nixpkgs/Hydra build environment. We silence - # the warnings in the hope that closing our eyes will make the - # ghosts go away. - "PYTHONWARNINGS=ignore::DeprecationWarning" - ] - ++ lib.optionals (!stdenv.buildPlatform.isDarwin || lib.versionAtLeast version "20") [ - "FLAKY_TESTS=skip" - # Skip some tests that are not passing in this context - "CI_SKIP_TESTS=${ - lib.concatStringsSep "," ( - [ - # Tests don't work in sandbox. - "test-child-process-exec-env" - "test-child-process-uid-gid" - "test-fs-write-stream-eagain" - "test-process-euid-egid" - "test-process-initgroups" - "test-process-setgroups" - "test-process-uid-gid" - "test-setproctitle" - # This is a bit weird, but for some reason fs watch tests fail with - # sandbox. - "test-fs-promises-watch" - "test-fs-watch" - "test-fs-watch-encoding" - "test-fs-watch-non-recursive" - "test-fs-watch-recursive-add-file" - "test-fs-watch-recursive-add-file-to-existing-subfolder" - "test-fs-watch-recursive-add-file-to-new-folder" - "test-fs-watch-recursive-add-file-with-url" - "test-fs-watch-recursive-add-folder" - "test-fs-watch-recursive-assert-leaks" - "test-fs-watch-recursive-promise" - "test-fs-watch-recursive-symlink" - "test-fs-watch-recursive-sync-write" - "test-fs-watch-recursive-update-file" - "test-fs-watchfile" - "test-runner-run" - "test-runner-watch-mode" - "test-watch-mode-files_watcher" - ] - ++ lib.optionals (!lib.versionAtLeast version "22") [ - "test-tls-multi-key" - ] - ++ lib.optionals stdenv.hostPlatform.is32bit [ - # utime (actually utimensat) fails with EINVAL on 2038 timestamp - "test-fs-utimes-y2K38" - ] - ++ lib.optionals stdenv.buildPlatform.isDarwin [ - # Disable tests that don’t work under macOS sandbox. - "test-macos-app-sandbox" - "test-os" - "test-os-process-priority" + checkFlags = [ + # Do not create __pycache__ when running tests. + "PYTHONDONTWRITEBYTECODE=1" + ] + ++ lib.optionals (stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64) [ + # Python 3.12 introduced a warning for calling `os.fork()` in a + # multi‐threaded program. For some reason, the Node.js + # `tools/pseudo-tty.py` program used for PTY‐related tests + # triggers this warning on Hydra, on `x86_64-darwin` only, + # despite not creating any threads itself. This causes the + # Node.js test runner to misinterpret the warnings as part of the + # test output and fail. It does not reproduce reliably off Hydra + # on Intel Macs, or occur on the `aarch64-darwin` builds. + # + # This seems likely to be related to Rosetta 2, but it could also + # be some strange x86‐64‐only threading behaviour of the Darwin + # system libraries, or a bug in CPython, or something else + # haunted about the Nixpkgs/Hydra build environment. We silence + # the warnings in the hope that closing our eyes will make the + # ghosts go away. + "PYTHONWARNINGS=ignore::DeprecationWarning" + ] + ++ lib.optionals (!stdenv.buildPlatform.isDarwin || lib.versionAtLeast version "20") [ + "FLAKY_TESTS=skip" + # Skip some tests that are not passing in this context + "CI_SKIP_TESTS=${ + lib.concatStringsSep "," ( + [ + # Tests don't work in sandbox. + "test-child-process-exec-env" + "test-child-process-uid-gid" + "test-fs-write-stream-eagain" + "test-process-euid-egid" + "test-process-initgroups" + "test-process-setgroups" + "test-process-uid-gid" + "test-setproctitle" + # This is a bit weird, but for some reason fs watch tests fail with + # sandbox. + "test-fs-promises-watch" + "test-fs-watch" + "test-fs-watch-encoding" + "test-fs-watch-non-recursive" + "test-fs-watch-recursive-add-file" + "test-fs-watch-recursive-add-file-to-existing-subfolder" + "test-fs-watch-recursive-add-file-to-new-folder" + "test-fs-watch-recursive-add-file-with-url" + "test-fs-watch-recursive-add-folder" + "test-fs-watch-recursive-assert-leaks" + "test-fs-watch-recursive-promise" + "test-fs-watch-recursive-symlink" + "test-fs-watch-recursive-sync-write" + "test-fs-watch-recursive-update-file" + "test-fs-watchfile" + "test-runner-run" + "test-runner-watch-mode" + "test-watch-mode-files_watcher" + ] + ++ lib.optionals (!lib.versionAtLeast version "22") [ + "test-tls-multi-key" + ] + ++ lib.optionals stdenv.hostPlatform.is32bit [ + # utime (actually utimensat) fails with EINVAL on 2038 timestamp + "test-fs-utimes-y2K38" + ] + ++ lib.optionals stdenv.buildPlatform.isDarwin [ + # Disable tests that don’t work under macOS sandbox. + "test-macos-app-sandbox" + "test-os" + "test-os-process-priority" - # Debugger tests failing on macOS 15.4 - "test-debugger-extract-function-name" - "test-debugger-random-port-with-inspect-port" - "test-debugger-launch" - "test-debugger-pid" + # Debugger tests failing on macOS 15.4 + "test-debugger-extract-function-name" + "test-debugger-random-port-with-inspect-port" + "test-debugger-launch" + "test-debugger-pid" - # Those are annoyingly flaky, but not enough to be marked as such upstream. - "test-wasi" - ] - ++ lib.optionals (stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64) [ - # These tests fail on x86_64-darwin (even without sandbox). - # TODO: revisit at a later date. - "test-fs-readv" - "test-fs-readv-sync" - "test-vm-memleak" - - # Those are annoyingly flaky, but not enough to be marked as such upstream. - "test-tick-processor-arguments" - "test-set-raw-mode-reset-signal" - ] # Those are annoyingly flaky, but not enough to be marked as such upstream. - ++ lib.optional (majorVersion == "22") "test-child-process-stdout-flush-exit" - ) - }" - ]; + "test-wasi" + ] + ++ lib.optionals (stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64) [ + # These tests fail on x86_64-darwin (even without sandbox). + # TODO: revisit at a later date. + "test-fs-readv" + "test-fs-readv-sync" + "test-vm-memleak" + + # Those are annoyingly flaky, but not enough to be marked as such upstream. + "test-tick-processor-arguments" + "test-set-raw-mode-reset-signal" + ] + # Those are annoyingly flaky, but not enough to be marked as such upstream. + ++ lib.optional (majorVersion == "22") "test-child-process-stdout-flush-exit" + ) + }" + ]; postInstall = let diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix index 5294b31f31dd..4a78b44276f4 100644 --- a/pkgs/development/web/nodejs/v20.nix +++ b/pkgs/development/web/nodejs/v20.nix @@ -27,5 +27,6 @@ buildNodejs { ./bypass-darwin-xcrun-node16.patch ./node-npm-build-npm-package-logic.patch ./use-correct-env-in-tests.patch - ] ++ gypPatches; + ] + ++ gypPatches; } diff --git a/pkgs/development/web/playwright/webkit.nix b/pkgs/development/web/playwright/webkit.nix index 91eefb5f1b86..1d188b296ad4 100644 --- a/pkgs/development/web/playwright/webkit.nix +++ b/pkgs/development/web/playwright/webkit.nix @@ -105,18 +105,17 @@ let postPatch = ""; postInstall = ""; - cmakeFlags = - [ - "-DJPEGXL_FORCE_SYSTEM_BROTLI=ON" - "-DJPEGXL_FORCE_SYSTEM_HWY=ON" - "-DJPEGXL_FORCE_SYSTEM_GTEST=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "-DJPEGXL_STATIC=ON" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch32 [ - "-DJPEGXL_FORCE_NEON=ON" - ]; + cmakeFlags = [ + "-DJPEGXL_FORCE_SYSTEM_BROTLI=ON" + "-DJPEGXL_FORCE_SYSTEM_HWY=ON" + "-DJPEGXL_FORCE_SYSTEM_GTEST=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "-DJPEGXL_STATIC=ON" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch32 [ + "-DJPEGXL_FORCE_NEON=ON" + ]; } ); webkit-linux = stdenv.mkDerivation { diff --git a/pkgs/games/anki/addons/anki-utils.nix b/pkgs/games/anki/addons/anki-utils.nix index e2247ebac874..56096cf0f4c0 100644 --- a/pkgs/games/anki/addons/anki-utils.nix +++ b/pkgs/games/anki/addons/anki-utils.nix @@ -102,11 +102,13 @@ ${processUserFiles} ''; }; - } // passthru; + } + // passthru; meta = { platforms = lib.platforms.all; - } // meta; + } + // meta; }; }; diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index 89ba530f909b..a98966bf73cc 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -117,12 +117,14 @@ python3.pkgs.buildPythonApplication rec { rustPlatform.cargoSetupHook writableTmpDirAsHomeHook yarn-berry_4.yarnBerryConfigHook - ] ++ lib.optional stdenv.hostPlatform.isDarwin swift; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin swift; buildInputs = [ qt6.qtbase qt6.qtsvg - ] ++ lib.optional stdenv.hostPlatform.isLinux qt6.qtwayland; + ] + ++ lib.optional stdenv.hostPlatform.isLinux qt6.qtwayland; propagatedBuildInputs = with python3.pkgs; [ # This rather long list came from running: diff --git a/pkgs/games/armagetronad/default.nix b/pkgs/games/armagetronad/default.nix index 316efc0d8bab..cd9dfe4916f0 100644 --- a/pkgs/games/armagetronad/default.nix +++ b/pkgs/games/armagetronad/default.nix @@ -76,22 +76,21 @@ let dedicatedServer: { version = "${unstableVersionMajor}-${builtins.substring 0 8 rev}"; src = fetchArmagetron rev hash; - extraBuildInputs = - [ - protobuf - boost - ] - ++ lib.optionals (!dedicatedServer) [ - glew - ftgl - freetype - libGL - libGLU - libX11 - SDL2 - SDL2_image - SDL2_mixer - ]; + extraBuildInputs = [ + protobuf + boost + ] + ++ lib.optionals (!dedicatedServer) [ + glew + ftgl + freetype + libGL + libGLU + libX11 + SDL2 + SDL2_image + SDL2_mixer + ]; extraNativeBuildInputs = [ bison ]; }; @@ -160,19 +159,18 @@ let ./bootstrap.sh ''; - configureFlags = - [ - "--enable-automakedefaults" - "--enable-authentication" - "--disable-memmanager" - "--disable-useradd" - "--disable-initscripts" - "--disable-etc" - "--disable-uninstall" - "--disable-sysinstall" - ] - ++ lib.optional dedicatedServer "--enable-dedicated" - ++ lib.optional (!dedicatedServer) "--enable-music"; + configureFlags = [ + "--enable-automakedefaults" + "--enable-authentication" + "--disable-memmanager" + "--disable-useradd" + "--disable-initscripts" + "--disable-etc" + "--disable-uninstall" + "--disable-sysinstall" + ] + ++ lib.optional dedicatedServer "--enable-dedicated" + ++ lib.optional (!dedicatedServer) "--enable-music"; buildInputs = lib.singleton (libxml2.override { enableHttp = true; }) ++ (resolvedParams.extraBuildInputs or [ ]); @@ -184,12 +182,14 @@ let pkg-config which python3 - ] ++ (resolvedParams.extraNativeBuildInputs or [ ]); + ] + ++ (resolvedParams.extraNativeBuildInputs or [ ]); - nativeInstallCheckInputs = - [ gnugrep ] - ++ lib.optional (!dedicatedServer) xvfb-run - ++ (resolvedParams.extraNativeInstallCheckInputs or [ ]); + nativeInstallCheckInputs = [ + gnugrep + ] + ++ lib.optional (!dedicatedServer) xvfb-run + ++ (resolvedParams.extraNativeInstallCheckInputs or [ ]); postInstall = lib.optionalString (!dedicatedServer) '' mkdir -p $out/share/{applications,icons/hicolor} diff --git a/pkgs/games/arx-libertatis/default.nix b/pkgs/games/arx-libertatis/default.nix index a55b58c7e83a..230497a50546 100644 --- a/pkgs/games/arx-libertatis/default.nix +++ b/pkgs/games/arx-libertatis/default.nix @@ -48,24 +48,24 @@ stdenv.mkDerivation rec { inkscape imagemagick optipng - ] ++ optionals withCrashReporter [ wrapQtAppsHook ]; + ] + ++ optionals withCrashReporter [ wrapQtAppsHook ]; - buildInputs = - [ - zlib - boost - openal - glm - freetype - libGLU - SDL2 - libepoxy - ] - ++ optionals withCrashReporter [ - qtbase - curl - ] - ++ optionals stdenv.hostPlatform.isLinux [ gdb ]; + buildInputs = [ + zlib + boost + openal + glm + freetype + libGLU + SDL2 + libepoxy + ] + ++ optionals withCrashReporter [ + qtbase + curl + ] + ++ optionals stdenv.hostPlatform.isLinux [ gdb ]; cmakeFlags = [ "-DDATA_DIR_PREFIXES=$out/share" @@ -75,15 +75,14 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; - postInstall = - '' - ln -sf \ - ${dejavu_fonts}/share/fonts/truetype/DejaVuSansMono.ttf \ - $out/share/games/arx/misc/dejavusansmono.ttf - '' - + optionalString withCrashReporter '' - wrapQtApp "$out/libexec/arxcrashreporter" - ''; + postInstall = '' + ln -sf \ + ${dejavu_fonts}/share/fonts/truetype/DejaVuSansMono.ttf \ + $out/share/games/arx/misc/dejavusansmono.ttf + '' + + optionalString withCrashReporter '' + wrapQtApp "$out/libexec/arxcrashreporter" + ''; meta = { description = '' diff --git a/pkgs/games/blightmud/default.nix b/pkgs/games/blightmud/default.nix index d12175c67f8a..a1619ffe6563 100644 --- a/pkgs/games/blightmud/default.nix +++ b/pkgs/games/blightmud/default.nix @@ -30,10 +30,11 @@ rustPlatform.buildRustPackage rec { rustPlatform.bindgenHook ]; - buildInputs = - [ openssl ] - ++ lib.optionals (withTTS && stdenv.hostPlatform.isLinux) [ speechd-minimal ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; + buildInputs = [ + openssl + ] + ++ lib.optionals (withTTS && stdenv.hostPlatform.isLinux) [ speechd-minimal ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]; checkFlags = let diff --git a/pkgs/games/cataclysm-dda/common.nix b/pkgs/games/cataclysm-dda/common.nix index 24c33f9a0664..fa5091758d40 100644 --- a/pkgs/games/cataclysm-dda/common.nix +++ b/pkgs/games/cataclysm-dda/common.nix @@ -66,24 +66,23 @@ stdenv.mkDerivation { patchShebangs lang/compile_mo.sh ''; - makeFlags = - [ - "PREFIX=$(out)" - "LANGUAGES=all" - (if useXdgDir then "USE_XDG_DIR=1" else "USE_HOME_DIR=1") - ] - ++ optionals (!debug) [ - "RELEASE=1" - ] - ++ optionals tiles [ - "TILES=1" - "SOUND=1" - ] - ++ optionals stdenv.hostPlatform.isDarwin [ - "NATIVE=osx" - "CLANG=1" - "OSX_MIN=${stdenv.hostPlatform.darwinMinVersion}" - ]; + makeFlags = [ + "PREFIX=$(out)" + "LANGUAGES=all" + (if useXdgDir then "USE_XDG_DIR=1" else "USE_HOME_DIR=1") + ] + ++ optionals (!debug) [ + "RELEASE=1" + ] + ++ optionals tiles [ + "TILES=1" + "SOUND=1" + ] + ++ optionals stdenv.hostPlatform.isDarwin [ + "NATIVE=osx" + "CLANG=1" + "OSX_MIN=${stdenv.hostPlatform.darwinMinVersion}" + ]; postInstall = optionalString tiles ( if !stdenv.hostPlatform.isDarwin then patchDesktopFile else installMacOSAppLauncher diff --git a/pkgs/games/chiaki/default.nix b/pkgs/games/chiaki/default.nix index 260f2f41b071..608664d61ad5 100644 --- a/pkgs/games/chiaki/default.nix +++ b/pkgs/games/chiaki/default.nix @@ -33,23 +33,22 @@ mkDerivation rec { pkg-config ]; - buildInputs = - [ - ffmpeg - libopus - qtbase - qtmultimedia - qtsvg - SDL2 - nanopb - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libevdev - udev - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - qtmacextras - ]; + buildInputs = [ + ffmpeg + libopus + qtbase + qtmultimedia + qtsvg + SDL2 + nanopb + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libevdev + udev + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + qtmacextras + ]; doCheck = true; diff --git a/pkgs/games/construo/default.nix b/pkgs/games/construo/default.nix index b4805a029bd5..77c6d9b272f6 100644 --- a/pkgs/games/construo/default.nix +++ b/pkgs/games/construo/default.nix @@ -19,15 +19,14 @@ stdenv.mkDerivation rec { sha256 = "1wmj527hbj1qv44cdsj6ahfjrnrjwg2dp8gdick8nd07vm062qxa"; }; - buildInputs = - [ - libX11 - zlib - xorgproto - ] - ++ lib.optional (libGL != null) libGL - ++ lib.optional (libGLU != null) libGLU - ++ lib.optional (libglut != null) libglut; + buildInputs = [ + libX11 + zlib + xorgproto + ] + ++ lib.optional (libGL != null) libGL + ++ lib.optional (libGLU != null) libGLU + ++ lib.optional (libglut != null) libglut; preConfigure = '' substituteInPlace src/Makefile.in \ diff --git a/pkgs/games/crawl/default.nix b/pkgs/games/crawl/default.nix index 458ca1034b06..8a21ea4bed56 100644 --- a/pkgs/games/crawl/default.nix +++ b/pkgs/games/crawl/default.nix @@ -53,51 +53,48 @@ stdenv.mkDerivation rec { ]; # Still unstable with luajit - buildInputs = - [ - lua5_1 - zlib - sqlite - ncurses - ] - ++ (with python3.pkgs; [ pyyaml ]) - ++ lib.optionals tileMode [ - libpng - SDL2 - SDL2_image - freetype - libGLU - libGL - ] - ++ lib.optional enableSound SDL2_mixer; + buildInputs = [ + lua5_1 + zlib + sqlite + ncurses + ] + ++ (with python3.pkgs; [ pyyaml ]) + ++ lib.optionals tileMode [ + libpng + SDL2 + SDL2_image + freetype + libGLU + libGL + ] + ++ lib.optional enableSound SDL2_mixer; - preBuild = - '' - cd crawl-ref/source - echo "${version}" > util/release_ver - patchShebangs 'util' - patchShebangs util/gen-mi-enum - rm -rf contrib - mkdir -p $out/xdg-data - '' - + lib.optionalString tileMode "mv xdg-data/*_tiles.* $out/xdg-data" - + lib.optionalString (!tileMode) "mv xdg-data/*_console.* $out/xdg-data"; + preBuild = '' + cd crawl-ref/source + echo "${version}" > util/release_ver + patchShebangs 'util' + patchShebangs util/gen-mi-enum + rm -rf contrib + mkdir -p $out/xdg-data + '' + + lib.optionalString tileMode "mv xdg-data/*_tiles.* $out/xdg-data" + + lib.optionalString (!tileMode) "mv xdg-data/*_console.* $out/xdg-data"; fontsPath = lib.optionalString tileMode dejavu_fonts; - makeFlags = - [ - "prefix=${placeholder "out"}" - "FORCE_CC=${stdenv.cc.targetPrefix}cc" - "FORCE_CXX=${stdenv.cc.targetPrefix}c++" - "HOSTCXX=${buildPackages.stdenv.cc.targetPrefix}c++" - "FORCE_PKGCONFIG=y" - "SAVEDIR=~/.crawl" - "sqlite=${sqlite.dev}" - "DATADIR=${placeholder "out"}" - ] - ++ lib.optional tileMode "TILES=y" - ++ lib.optional enableSound "SOUND=y"; + makeFlags = [ + "prefix=${placeholder "out"}" + "FORCE_CC=${stdenv.cc.targetPrefix}cc" + "FORCE_CXX=${stdenv.cc.targetPrefix}c++" + "HOSTCXX=${buildPackages.stdenv.cc.targetPrefix}c++" + "FORCE_PKGCONFIG=y" + "SAVEDIR=~/.crawl" + "sqlite=${sqlite.dev}" + "DATADIR=${placeholder "out"}" + ] + ++ lib.optional tileMode "TILES=y" + ++ lib.optional enableSound "SOUND=y"; postInstall = lib.optionalString tileMode '' diff --git a/pkgs/games/cutemaze/default.nix b/pkgs/games/cutemaze/default.nix index 434e25de23ea..cb4a66b3bf3c 100644 --- a/pkgs/games/cutemaze/default.nix +++ b/pkgs/games/cutemaze/default.nix @@ -25,14 +25,13 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; - buildInputs = - [ - qtbase - qtsvg - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - qtwayland - ]; + buildInputs = [ + qtbase + qtsvg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qtwayland + ]; installPhase = if stdenv.hostPlatform.isDarwin then diff --git a/pkgs/games/doom-ports/zandronum/alpha/default.nix b/pkgs/games/doom-ports/zandronum/alpha/default.nix index 739d3eea18d8..5298485df6b6 100644 --- a/pkgs/games/doom-ports/zandronum/alpha/default.nix +++ b/pkgs/games/doom-ports/zandronum/alpha/default.nix @@ -52,23 +52,22 @@ stdenv.mkDerivation { # I have no idea why would SDL and libjpeg be needed for the server part! # But they are. - buildInputs = - [ - openssl - bzip2 - zlib - SDL_compat - libjpeg - sqlite - game-music-emu - ] - ++ lib.optionals (!serverOnly) [ - libGL - glew - fmod - fluidsynth - gtk2 - ]; + buildInputs = [ + openssl + bzip2 + zlib + SDL_compat + libjpeg + sqlite + game-music-emu + ] + ++ lib.optionals (!serverOnly) [ + libGL + glew + fmod + fluidsynth + gtk2 + ]; nativeBuildInputs = [ cmake @@ -77,22 +76,22 @@ stdenv.mkDerivation { python3 ]; - preConfigure = - '' - ln -s ${sqlite}/* sqlite/ - sed -i -e 's| restrict| _restrict|g' dumb/include/dumb.h \ - dumb/src/it/*.c - '' - + lib.optionalString (!serverOnly) '' - sed -i \ - -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \ - -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \ - src/sound/music_fluidsynth_mididevice.cpp - ''; + preConfigure = '' + ln -s ${sqlite}/* sqlite/ + sed -i -e 's| restrict| _restrict|g' dumb/include/dumb.h \ + dumb/src/it/*.c + '' + + lib.optionalString (!serverOnly) '' + sed -i \ + -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \ + -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \ + src/sound/music_fluidsynth_mididevice.cpp + ''; cmakeFlags = [ "-DFORCE_INTERNAL_GME=OFF" - ] ++ (if serverOnly then [ "-DSERVERONLY=ON" ] else [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ]); + ] + ++ (if serverOnly then [ "-DSERVERONLY=ON" ] else [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ]); hardeningDisable = [ "format" ]; diff --git a/pkgs/games/doom-ports/zandronum/default.nix b/pkgs/games/doom-ports/zandronum/default.nix index d9b076173b3f..837339921bb5 100644 --- a/pkgs/games/doom-ports/zandronum/default.nix +++ b/pkgs/games/doom-ports/zandronum/default.nix @@ -52,23 +52,22 @@ stdenv.mkDerivation { # I have no idea why would SDL and libjpeg be needed for the server part! # But they are. - buildInputs = - [ - openssl - bzip2 - zlib - SDL_compat - libjpeg - sqlite - game-music-emu - ] - ++ lib.optionals (!serverOnly) [ - libGL - glew - fmod - fluidsynth - gtk2 - ]; + buildInputs = [ + openssl + bzip2 + zlib + SDL_compat + libjpeg + sqlite + game-music-emu + ] + ++ lib.optionals (!serverOnly) [ + libGL + glew + fmod + fluidsynth + gtk2 + ]; nativeBuildInputs = [ cmake @@ -77,22 +76,22 @@ stdenv.mkDerivation { python3 ]; - preConfigure = - '' - ln -s ${sqlite}/* sqlite/ - sed -i -e 's| restrict| _restrict|g' dumb/include/dumb.h \ - dumb/src/it/*.c - '' - + lib.optionalString (!serverOnly) '' - sed -i \ - -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \ - -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \ - src/sound/music_fluidsynth_mididevice.cpp - ''; + preConfigure = '' + ln -s ${sqlite}/* sqlite/ + sed -i -e 's| restrict| _restrict|g' dumb/include/dumb.h \ + dumb/src/it/*.c + '' + + lib.optionalString (!serverOnly) '' + sed -i \ + -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \ + -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \ + src/sound/music_fluidsynth_mididevice.cpp + ''; cmakeFlags = [ "-DFORCE_INTERNAL_GME=OFF" - ] ++ (if serverOnly then [ "-DSERVERONLY=ON" ] else [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ]); + ] + ++ (if serverOnly then [ "-DSERVERONLY=ON" ] else [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ]); hardeningDisable = [ "format" ]; diff --git a/pkgs/games/dwarf-fortress/dfhack/default.nix b/pkgs/games/dwarf-fortress/dfhack/default.nix index 50f5ec2c9803..82f20430d1fa 100644 --- a/pkgs/games/dwarf-fortress/dfhack/default.nix +++ b/pkgs/games/dwarf-fortress/dfhack/default.nix @@ -148,15 +148,16 @@ stdenv.mkDerivation { ]; # We don't use system libraries because dfhack needs old C++ ABI. - buildInputs = - [ zlib ] - ++ optional isAtLeast50 SDL2 - ++ optional (!isAtLeast50) SDL - ++ optionals enableStoneSense [ - allegro5 - libGLU - libGL - ]; + buildInputs = [ + zlib + ] + ++ optional isAtLeast50 SDL2 + ++ optional (!isAtLeast50) SDL + ++ optionals enableStoneSense [ + allegro5 + libGLU + libGL + ]; preConfigure = '' # Trick the build system into believing we have .git. @@ -164,27 +165,27 @@ stdenv.mkDerivation { touch .git/index .git/modules/library/xml/index ''; - cmakeFlags = - [ - # Race condition in `Generating codegen.out.xml and df/headers` that is fixed when using Ninja. - "-GNinja" - "-DDFHACK_BUILD_ARCH=${arch}" + cmakeFlags = [ + # Race condition in `Generating codegen.out.xml and df/headers` that is fixed when using Ninja. + "-GNinja" + "-DDFHACK_BUILD_ARCH=${arch}" - # Don't download anything. - "-DDOWNLOAD_RUBY=OFF" - "-DUSE_SYSTEM_SDL2=ON" + # Don't download anything. + "-DDOWNLOAD_RUBY=OFF" + "-DUSE_SYSTEM_SDL2=ON" - # Ruby support with dfhack is very spotty and was removed in version 50. - "-DBUILD_RUBY=OFF" - ] - ++ optionals enableStoneSense [ - "-DBUILD_STONESENSE=ON" - "-DSTONESENSE_INTERNAL_SO=OFF" - ]; + # Ruby support with dfhack is very spotty and was removed in version 50. + "-DBUILD_RUBY=OFF" + ] + ++ optionals enableStoneSense [ + "-DBUILD_STONESENSE=ON" + "-DSTONESENSE_INTERNAL_SO=OFF" + ]; NIX_CFLAGS_COMPILE = [ "-Wno-error=deprecated-enum-enum-conversion" - ] ++ optionals (versionOlder version "0.47") [ "-fpermissive" ]; + ] + ++ optionals (versionOlder version "0.47") [ "-fpermissive" ]; preFixup = '' # Wrap dfhack scripts. diff --git a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix index 62f4b3bdaf91..c07d48d26e72 100644 --- a/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix +++ b/pkgs/games/dwarf-fortress/dwarf-therapist/wrapper.nix @@ -56,13 +56,14 @@ stdenv.mkDerivation { paths = [ dwarf-therapist ]; - nativeBuildInputs = - [ wrapQtAppsHook ] - ++ lib.optionals unsupportedVersion [ - expect - xvfb-run - dfHackWrapper - ]; + nativeBuildInputs = [ + wrapQtAppsHook + ] + ++ lib.optionals unsupportedVersion [ + expect + xvfb-run + dfHackWrapper + ]; passthru = { inherit dwarf-fortress dwarf-therapist; }; diff --git a/pkgs/games/dwarf-fortress/game.nix b/pkgs/games/dwarf-fortress/game.nix index 61a0ee31039c..b9e1000bb2b1 100644 --- a/pkgs/games/dwarf-fortress/game.nix +++ b/pkgs/games/dwarf-fortress/game.nix @@ -113,52 +113,51 @@ stdenv.mkDerivation { ++ optional enableUnfuck dwarf-fortress-unfuck ++ [ (lib.getLib stdenv.cc.cc) ]; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - exe=$out/${exe} - mkdir -p $out - cp -r * $out + exe=$out/${exe} + mkdir -p $out + cp -r * $out - # Clean up OS X detritus in the tarball. - find $out -type f -name '._*' -exec rm -rf {} \; + # Clean up OS X detritus in the tarball. + find $out -type f -name '._*' -exec rm -rf {} \; - # Lots of files are +x in the newer releases... - find $out -type d -exec chmod 0755 {} \; - find $out -type f -exec chmod 0644 {} \; - chmod +x $exe - [ -f $out/df ] && chmod +x $out/df - [ -f $out/run_df ] && chmod +x $out/run_df + # Lots of files are +x in the newer releases... + find $out -type d -exec chmod 0755 {} \; + find $out -type f -exec chmod 0644 {} \; + chmod +x $exe + [ -f $out/df ] && chmod +x $out/df + [ -f $out/run_df ] && chmod +x $out/run_df - # We don't need any of these since they will just break autoPatchelf on $out/hash.md5.orig - echo "Original MD5: $(<$out/hash.md5.orig)" >&2 - '' - + optionalString stdenv.hostPlatform.isDarwin '' - # My custom unfucked dwarfort.exe for macOS. Can't use - # absolute paths because original doesn't have enough - # header space. Someone plz break into Tarn's house & put - # -headerpad_max_install_names into his LDFLAGS. + # Store the original hash + md5sum $exe | awk '{ print $1 }' > $out/hash.md5.orig + echo "Original MD5: $(<$out/hash.md5.orig)" >&2 + '' + + optionalString stdenv.hostPlatform.isDarwin '' + # My custom unfucked dwarfort.exe for macOS. Can't use + # absolute paths because original doesn't have enough + # header space. Someone plz break into Tarn's house & put + # -headerpad_max_install_names into his LDFLAGS. - ln -s ${getLib ncurses}/lib/libncurses.dylib $out/libs - ln -s ${getLib gcc.cc}/lib/libstdc++.6.dylib $out/libs - ln -s ${getLib gcc.cc}/lib/libgcc_s.1.dylib $out/libs - ln -s ${getLib fmodex}/lib/libfmodex.dylib $out/libs + ln -s ${getLib ncurses}/lib/libncurses.dylib $out/libs + ln -s ${getLib gcc.cc}/lib/libstdc++.6.dylib $out/libs + ln -s ${getLib gcc.cc}/lib/libgcc_s.1.dylib $out/libs + ln -s ${getLib fmodex}/lib/libfmodex.dylib $out/libs - install_name_tool \ - -change /usr/lib/libncurses.5.4.dylib \ - @executable_path/libs/libncurses.dylib \ - -change /usr/local/lib/x86_64/libstdc++.6.dylib \ - @executable_path/libs/libstdc++.6.dylib \ - $exe - '' - + '' - runHook postInstall - ''; + install_name_tool \ + -change /usr/lib/libncurses.5.4.dylib \ + @executable_path/libs/libncurses.dylib \ + -change /usr/local/lib/x86_64/libstdc++.6.dylib \ + @executable_path/libs/libstdc++.6.dylib \ + $exe + '' + + '' + runHook postInstall + ''; preFixup = '' recompute_hash() { diff --git a/pkgs/games/dwarf-fortress/lazy-pack.nix b/pkgs/games/dwarf-fortress/lazy-pack.nix index 732c1019bf12..73736d34d9be 100644 --- a/pkgs/games/dwarf-fortress/lazy-pack.nix +++ b/pkgs/games/dwarf-fortress/lazy-pack.nix @@ -48,25 +48,24 @@ let in buildEnv { name = "dwarf-fortress-full"; - paths = - [ - (dwarf-fortress.override { - inherit - enableDFHack - enableTWBT - enableSoundSense - enableStoneSense - theme - enableIntro - enableTruetype - enableFPS - enableTextMode - enableSound - ; - }) - ] - ++ optional enableDwarfTherapist dwarf-therapist - ++ optional enableLegendsBrowser legends-browser; + paths = [ + (dwarf-fortress.override { + inherit + enableDFHack + enableTWBT + enableSoundSense + enableStoneSense + theme + enableIntro + enableTruetype + enableFPS + enableTextMode + enableSound + ; + }) + ] + ++ optional enableDwarfTherapist dwarf-therapist + ++ optional enableLegendsBrowser legends-browser; meta = { inherit mainProgram; diff --git a/pkgs/games/dwarf-fortress/unfuck.nix b/pkgs/games/dwarf-fortress/unfuck.nix index d679eb4d0a3a..15bb084c1e00 100644 --- a/pkgs/games/dwarf-fortress/unfuck.nix +++ b/pkgs/games/dwarf-fortress/unfuck.nix @@ -82,30 +82,29 @@ stdenv.mkDerivation { cmake pkg-config ]; - buildInputs = - [ - libSM - SDL - SDL_image - SDL_ttf - glew - openalSoft - ncurses - libsndfile - zlib - libGL - ] - # switched to gtk3 in 0.47.05 - ++ ( - if versionOlder release.unfuckRelease "0.47.05" then - [ - gtk2 - ] - else - [ - gtk3 - ] - ); + buildInputs = [ + libSM + SDL + SDL_image + SDL_ttf + glew + openalSoft + ncurses + libsndfile + zlib + libGL + ] + # switched to gtk3 in 0.47.05 + ++ ( + if versionOlder release.unfuckRelease "0.47.05" then + [ + gtk2 + ] + else + [ + gtk3 + ] + ); # Don't strip unused symbols; dfhack hooks into some of them. dontStrip = true; diff --git a/pkgs/games/dwarf-fortress/wrapper/default.nix b/pkgs/games/dwarf-fortress/wrapper/default.nix index 8fe83273dc4a..6321e88d3dd6 100644 --- a/pkgs/games/dwarf-fortress/wrapper/default.nix +++ b/pkgs/games/dwarf-fortress/wrapper/default.nix @@ -215,30 +215,29 @@ lib.throwIf (enableTWBT' && !enableDFHack) "dwarf-fortress: TWBT requires DFHack dontUnpack = true; dontBuild = true; preferLocalBuild = true; - installPhase = - '' - mkdir -p $out/bin + installPhase = '' + mkdir -p $out/bin - substitute $runDF $out/bin/dwarf-fortress \ - --subst-var-by stdenv_shell ${stdenv.shell} \ - --subst-var-by dfExe ${dwarf-fortress.exe} \ - --subst-var dfInit - chmod 755 $out/bin/dwarf-fortress - '' - + lib.optionalString enableDFHack '' - substitute $runDF $out/bin/dfhack \ - --subst-var-by stdenv_shell ${stdenv.shell} \ - --subst-var-by dfExe dfhack \ - --subst-var dfInit - chmod 755 $out/bin/dfhack - '' - + lib.optionalString enableSoundSense '' - substitute $runSoundSense $out/bin/soundsense \ - --subst-var-by stdenv_shell ${stdenv.shell} \ - --subst-var-by jre ${jre} \ - --subst-var dfInit - chmod 755 $out/bin/soundsense - ''; + substitute $runDF $out/bin/dwarf-fortress \ + --subst-var-by stdenv_shell ${stdenv.shell} \ + --subst-var-by dfExe ${dwarf-fortress.exe} \ + --subst-var dfInit + chmod 755 $out/bin/dwarf-fortress + '' + + lib.optionalString enableDFHack '' + substitute $runDF $out/bin/dfhack \ + --subst-var-by stdenv_shell ${stdenv.shell} \ + --subst-var-by dfExe dfhack \ + --subst-var dfInit + chmod 755 $out/bin/dfhack + '' + + lib.optionalString enableSoundSense '' + substitute $runSoundSense $out/bin/soundsense \ + --subst-var-by stdenv_shell ${stdenv.shell} \ + --subst-var-by jre ${jre} \ + --subst-var dfInit + chmod 755 $out/bin/soundsense + ''; doInstallCheck = stdenv.hostPlatform.isLinux; nativeInstallCheckInputs = lib.optionals stdenv.hostPlatform.isLinux [ diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix index 19bc95582e47..529f336e3ac8 100644 --- a/pkgs/games/freeciv/default.nix +++ b/pkgs/games/freeciv/default.nix @@ -53,38 +53,36 @@ stdenv.mkDerivation rec { done ''; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - ] - ++ lib.optionals qtClient [ qt5.wrapQtAppsHook ] - ++ lib.optionals gtkClient [ wrapGAppsHook3 ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ] + ++ lib.optionals qtClient [ qt5.wrapQtAppsHook ] + ++ lib.optionals gtkClient [ wrapGAppsHook3 ]; - buildInputs = - [ - lua5_3 - zlib - bzip2 - curl - xz - gettext - libiconv - icu - ] - ++ lib.optionals sdl2Client [ - SDL2 - SDL2_mixer - SDL2_image - SDL2_ttf - SDL2_gfx - freetype - fluidsynth - ] - ++ lib.optionals gtkClient [ gtk3 ] - ++ lib.optionals qtClient [ qt5.qtbase ] - ++ lib.optional server readline - ++ lib.optional enableSqlite sqlite; + buildInputs = [ + lua5_3 + zlib + bzip2 + curl + xz + gettext + libiconv + icu + ] + ++ lib.optionals sdl2Client [ + SDL2 + SDL2_mixer + SDL2_image + SDL2_ttf + SDL2_gfx + freetype + fluidsynth + ] + ++ lib.optionals gtkClient [ gtk3 ] + ++ lib.optionals qtClient [ qt5.qtbase ] + ++ lib.optional server readline + ++ lib.optional enableSqlite sqlite; dontWrapQtApps = true; dontWrapGApps = true; @@ -94,21 +92,22 @@ stdenv.mkDerivation rec { preConfigure = '' export CPPFLAGS="$(echo $SDL2_PATH | sed 's#/nix/store/#-I/nix/store/#g')" ''; - configureFlags = - [ "--enable-shared" ] - ++ lib.optionals sdl2Client [ - "--enable-client=sdl2" - "--enable-sdl-mixer=sdl2" - ] - ++ lib.optionals qtClient [ - "--enable-client=qt" - "--with-qtver=qt5" - "--with-qt5-includes=${qt5.qtbase.dev}/include" - ] - ++ lib.optionals gtkClient [ "--enable-client=gtk3.22" ] - ++ lib.optional enableSqlite "--enable-fcdb=sqlite3" - ++ lib.optional (!gtkClient) "--enable-fcmp=cli" - ++ lib.optional (!server) "--disable-server"; + configureFlags = [ + "--enable-shared" + ] + ++ lib.optionals sdl2Client [ + "--enable-client=sdl2" + "--enable-sdl-mixer=sdl2" + ] + ++ lib.optionals qtClient [ + "--enable-client=qt" + "--with-qtver=qt5" + "--with-qt5-includes=${qt5.qtbase.dev}/include" + ] + ++ lib.optionals gtkClient [ "--enable-client=gtk3.22" ] + ++ lib.optional enableSqlite "--enable-fcdb=sqlite3" + ++ lib.optional (!gtkClient) "--enable-fcmp=cli" + ++ lib.optional (!server) "--disable-server"; postFixup = lib.optionalString qtClient '' diff --git a/pkgs/games/koboredux/default.nix b/pkgs/games/koboredux/default.nix index 5f4d0a39a8a9..d694266934cf 100644 --- a/pkgs/games/koboredux/default.nix +++ b/pkgs/games/koboredux/default.nix @@ -88,18 +88,17 @@ stdenv.mkDerivation rec { "Frantic 80's style 2D shooter, similar to XKobo and Kobo Deluxe" + optionalString (!useProprietaryAssets) " (built without proprietary assets)"; mainProgram = "kobord"; - longDescription = - '' - Kobo Redux is a frantic 80's style 2D shooter, inspired by the look and - feel of 90's arcade cabinets. The gameplay is fast and unforgiving, - although with less of the frustrating quirkiness of the actual games - of the 80's. A true challenge in the spirit of the arcade era! - '' - + optionalString (!useProprietaryAssets) '' + longDescription = '' + Kobo Redux is a frantic 80's style 2D shooter, inspired by the look and + feel of 90's arcade cabinets. The gameplay is fast and unforgiving, + although with less of the frustrating quirkiness of the actual games + of the 80's. A true challenge in the spirit of the arcade era! + '' + + optionalString (!useProprietaryAssets) '' - This version replaces the official proprietary assets with placeholders. - For the full experience, consider installing "koboredux" instead. - ''; + This version replaces the official proprietary assets with placeholders. + For the full experience, consider installing "koboredux" instead. + ''; homepage = "https://olofson.itch.io/kobo-redux"; license = with licenses; if useProprietaryAssets then unfree else gpl2Plus; platforms = platforms.all; diff --git a/pkgs/games/mudlet/default.nix b/pkgs/games/mudlet/default.nix index 76f3e95b9508..673d41d92da3 100644 --- a/pkgs/games/mudlet/default.nix +++ b/pkgs/games/mudlet/default.nix @@ -109,58 +109,57 @@ stdenv.mkDerivation rec { WITH_FONTS = "NO"; WITH_UPDATER = "NO"; - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - mkdir -pv $out/lib - cp 3rdparty/edbee-lib/edbee-lib/qslog/lib/libQsLog${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib - mkdir -pv $out/share/mudlet - cp -r ../src/mudlet-lua/lua $out/share/mudlet/ + mkdir -pv $out/lib + cp 3rdparty/edbee-lib/edbee-lib/qslog/lib/libQsLog${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib + mkdir -pv $out/share/mudlet + cp -r ../src/mudlet-lua/lua $out/share/mudlet/ - mkdir -pv $out/share/pixmaps - cp -r ../mudlet.png $out/share/pixmaps/ + mkdir -pv $out/share/pixmaps + cp -r ../mudlet.png $out/share/pixmaps/ - cp -r ../translations $out/share/ + cp -r ../translations $out/share/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -r src/mudlet.app/ $out/Applications/mudlet.app - mv $out/Applications/mudlet.app/Contents/MacOS/mudlet $out/Applications/mudlet.app/Contents/MacOS/mudlet-unwrapped - makeQtWrapper $out/Applications/Mudlet.app/Contents/MacOS/mudlet-unwrapped $out/Applications/Mudlet.app/Contents/MacOS/mudlet \ - --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \ - --prefix LUA_PATH : "$NIX_LUA_PATH" \ - --prefix DYLD_LIBRARY_PATH : "${ - lib.makeLibraryPath [ - libsForQt5.qtkeychain - discord-rpc - ] - }:$out/lib" \ - --chdir "$out"; + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -r src/mudlet.app/ $out/Applications/mudlet.app + mv $out/Applications/mudlet.app/Contents/MacOS/mudlet $out/Applications/mudlet.app/Contents/MacOS/mudlet-unwrapped + makeQtWrapper $out/Applications/Mudlet.app/Contents/MacOS/mudlet-unwrapped $out/Applications/Mudlet.app/Contents/MacOS/mudlet \ + --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \ + --prefix LUA_PATH : "$NIX_LUA_PATH" \ + --prefix DYLD_LIBRARY_PATH : "${ + lib.makeLibraryPath [ + libsForQt5.qtkeychain + discord-rpc + ] + }:$out/lib" \ + --chdir "$out"; - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - mkdir -pv $out/bin - cp src/mudlet $out/bin/mudlet-unwrapped - makeQtWrapper $out/bin/mudlet-unwrapped $out/bin/mudlet \ - --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \ - --prefix LUA_PATH : "$NIX_LUA_PATH" \ - --prefix LD_LIBRARY_PATH : "${ - lib.makeLibraryPath [ - libsForQt5.qtkeychain - discord-rpc - ] - }" \ - --chdir "$out"; + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + mkdir -pv $out/bin + cp src/mudlet $out/bin/mudlet-unwrapped + makeQtWrapper $out/bin/mudlet-unwrapped $out/bin/mudlet \ + --set LUA_CPATH "${luaEnv}/lib/lua/${lua.luaversion}/?.so" \ + --prefix LUA_PATH : "$NIX_LUA_PATH" \ + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath [ + libsForQt5.qtkeychain + discord-rpc + ] + }" \ + --chdir "$out"; - mkdir -pv $out/share/applications - cp ../mudlet.desktop $out/share/applications/ + mkdir -pv $out/share/applications + cp ../mudlet.desktop $out/share/applications/ - '' - + '' - runHook postInstall - ''; + '' + + '' + runHook postInstall + ''; meta = with lib; { description = "Crossplatform mud client"; diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix index c9f804c43e15..da9a3ee83a00 100644 --- a/pkgs/games/nethack/default.nix +++ b/pkgs/games/nethack/default.nix @@ -64,37 +64,37 @@ stdenv.mkDerivation rec { sha256 = "sha256-mM9n323r+WaKYXRaqEwJvKs2Ll0z9blE7FFV1E0qrLI="; }; - buildInputs = - [ ncurses ] - ++ lib.optionals x11Mode [ - libXaw - libXext - libXpm - ] - ++ lib.optionals qtMode [ - gzip - qt5.qtbase.bin - qt5.qtmultimedia.bin - ]; + buildInputs = [ + ncurses + ] + ++ lib.optionals x11Mode [ + libXaw + libXext + libXpm + ] + ++ lib.optionals qtMode [ + gzip + qt5.qtbase.bin + qt5.qtmultimedia.bin + ]; - nativeBuildInputs = - [ - flex - bison - copyDesktopItems - ] - ++ lib.optionals x11Mode [ - mkfontdir - bdftopcf - ] - ++ lib.optionals qtMode [ - pkg-config - mkfontdir - qt5.qtbase.dev - qt5.qtmultimedia.dev - qt5.wrapQtAppsHook - bdftopcf - ]; + nativeBuildInputs = [ + flex + bison + copyDesktopItems + ] + ++ lib.optionals x11Mode [ + mkfontdir + bdftopcf + ] + ++ lib.optionals qtMode [ + pkg-config + mkfontdir + qt5.qtbase.dev + qt5.qtmultimedia.dev + qt5.wrapQtAppsHook + bdftopcf + ]; makeFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/games/openmw/default.nix b/pkgs/games/openmw/default.nix index cff3576ebafe..8201d10e847d 100644 --- a/pkgs/games/openmw/default.nix +++ b/pkgs/games/openmw/default.nix @@ -77,14 +77,13 @@ stdenv.mkDerivation rec { patches = [ ./0001-function-inclusion-fixes-for-gcc14.patch ]; - postPatch = - '' - sed '1i#include ' -i components/myguiplatform/myguidatamanager.cpp # gcc12 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Don't fix Darwin app bundle - sed -i '/fixup_bundle/d' CMakeLists.txt - ''; + postPatch = '' + sed '1i#include ' -i components/myguiplatform/myguidatamanager.cpp # gcc12 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Don't fix Darwin app bundle + sed -i '/fixup_bundle/d' CMakeLists.txt + ''; nativeBuildInputs = [ cmake @@ -111,14 +110,13 @@ stdenv.mkDerivation rec { yaml-cpp ]; - cmakeFlags = - [ - "-DOpenGL_GL_PREFERENCE=${GL}" - "-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=1" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DOPENMW_OSX_DEPLOYMENT=ON" - ]; + cmakeFlags = [ + "-DOpenGL_GL_PREFERENCE=${GL}" + "-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=1" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DOPENMW_OSX_DEPLOYMENT=ON" + ]; meta = with lib; { description = "Unofficial open source engine reimplementation of the game Morrowind"; diff --git a/pkgs/games/openttd/default.nix b/pkgs/games/openttd/default.nix index 76b0f49ce2ad..4a81ab7314be 100644 --- a/pkgs/games/openttd/default.nix +++ b/pkgs/games/openttd/default.nix @@ -84,44 +84,42 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - cmake - pkg-config - makeWrapper - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - crossTools - ]; + nativeBuildInputs = [ + cmake + pkg-config + makeWrapper + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + crossTools + ]; - buildInputs = - [ - SDL2 - libpng - xz - zlib - freetype - fontconfig - curl - icu - harfbuzz - expat - glib - pcre2 - ] - ++ lib.optionals withFluidSynth [ - fluidsynth - soundfont-fluid - libsndfile - flac - libogg - libvorbis - libopus - libmpg123 - pulseaudio - alsa-lib - libjack2 - ]; + buildInputs = [ + SDL2 + libpng + xz + zlib + freetype + fontconfig + curl + icu + harfbuzz + expat + glib + pcre2 + ] + ++ lib.optionals withFluidSynth [ + fluidsynth + soundfont-fluid + libsndfile + flac + libogg + libvorbis + libopus + libmpg123 + pulseaudio + alsa-lib + libjack2 + ]; strictDeps = true; diff --git a/pkgs/games/openxray/default.nix b/pkgs/games/openxray/default.nix index 340e1bbf68b0..563c12e02393 100644 --- a/pkgs/games/openxray/default.nix +++ b/pkgs/games/openxray/default.nix @@ -54,15 +54,14 @@ stdenv.mkDerivation (finalAttrs: { pcre ]; - cmakeFlags = - [ - # Breaks on Darwin - (lib.cmakeBool "USE_LTO" (!stdenv.hostPlatform.isDarwin)) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # This seemingly only gets set properly by CMake when using the XCode generator - (lib.cmakeFeature "CMAKE_OSX_DEPLOYMENT_TARGET" "${stdenv.hostPlatform.darwinMinVersion}") - ]; + cmakeFlags = [ + # Breaks on Darwin + (lib.cmakeBool "USE_LTO" (!stdenv.hostPlatform.isDarwin)) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # This seemingly only gets set properly by CMake when using the XCode generator + (lib.cmakeFeature "CMAKE_OSX_DEPLOYMENT_TARGET" "${stdenv.hostPlatform.darwinMinVersion}") + ]; # Crashes can happen, we'd like them to be reasonably debuggable cmakeBuildType = "RelWithDebInfo"; diff --git a/pkgs/games/path-of-building/default.nix b/pkgs/games/path-of-building/default.nix index c7a2c63b49d8..15d8672ca72c 100644 --- a/pkgs/games/path-of-building/default.nix +++ b/pkgs/games/path-of-building/default.nix @@ -64,7 +64,8 @@ stdenv.mkDerivation { qttools wrapQtAppsHook icoutils - ] ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; + ] + ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems; buildInputs = [ qtbase diff --git a/pkgs/games/quake2/yquake2/default.nix b/pkgs/games/quake2/yquake2/default.nix index 11c71d6045b8..31e2b7ee9d65 100644 --- a/pkgs/games/quake2/yquake2/default.nix +++ b/pkgs/games/quake2/yquake2/default.nix @@ -41,21 +41,21 @@ let sha256 = "sha256-u8WXelbvfmbD+t6uTaE9z+kHBD3Re0P4SOUBL4MfAR4="; }; - postPatch = - '' - substituteInPlace src/client/curl/qcurl.c \ - --replace "\"libcurl.so.3\", \"libcurl.so.4\"" "\"${curl.out}/lib/libcurl.so\", \"libcurl.so.3\", \"libcurl.so.4\"" - '' - + lib.optionalString (openalSupport && !stdenv.hostPlatform.isDarwin) '' - substituteInPlace Makefile \ - --replace "\"libopenal.so.1\"" "\"${openal}/lib/libopenal.so.1\"" - ''; + postPatch = '' + substituteInPlace src/client/curl/qcurl.c \ + --replace "\"libcurl.so.3\", \"libcurl.so.4\"" "\"${curl.out}/lib/libcurl.so\", \"libcurl.so.3\", \"libcurl.so.4\"" + '' + + lib.optionalString (openalSupport && !stdenv.hostPlatform.isDarwin) '' + substituteInPlace Makefile \ + --replace "\"libopenal.so.1\"" "\"${openal}/lib/libopenal.so.1\"" + ''; buildInputs = [ SDL2 libGL curl - ] ++ lib.optional openalSupport openal; + ] + ++ lib.optional openalSupport openal; makeFlags = [ "WITH_OPENAL=${mkFlag openalSupport}" diff --git a/pkgs/games/quake2/yquake2/wrapper.nix b/pkgs/games/quake2/yquake2/wrapper.nix index 696e5b34ab9f..6c2437d3286e 100644 --- a/pkgs/games/quake2/yquake2/wrapper.nix +++ b/pkgs/games/quake2/yquake2/wrapper.nix @@ -32,21 +32,20 @@ stdenv.mkDerivation { dontUnpack = true; - installPhase = - '' - runHook preInstall - mkdir -p $out/bin - '' - + lib.concatMapStringsSep "\n" (game: '' - makeWrapper ${env}/bin/yquake2 $out/bin/yquake2-${game.title} \ - --add-flags "+set game ${game.id}" - makeWrapper ${env}/bin/yq2ded $out/bin/yq2ded-${game.title} \ - --add-flags "+set game ${game.id}" - '') games - + '' - install -Dm644 ${yquake2}/share/pixmaps/yamagi-quake2.png $out/share/pixmaps/yamagi-quake2.png; - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p $out/bin + '' + + lib.concatMapStringsSep "\n" (game: '' + makeWrapper ${env}/bin/yquake2 $out/bin/yquake2-${game.title} \ + --add-flags "+set game ${game.id}" + makeWrapper ${env}/bin/yq2ded $out/bin/yq2ded-${game.title} \ + --add-flags "+set game ${game.id}" + '') games + + '' + install -Dm644 ${yquake2}/share/pixmaps/yamagi-quake2.png $out/share/pixmaps/yamagi-quake2.png; + runHook postInstall + ''; desktopItems = map ( game: diff --git a/pkgs/games/quakespasm/default.nix b/pkgs/games/quakespasm/default.nix index 7f28c9d580d2..8b669b489773 100644 --- a/pkgs/games/quakespasm/default.nix +++ b/pkgs/games/quakespasm/default.nix @@ -60,25 +60,24 @@ stdenv.mkDerivation rec { (if useSDL2 then SDL2 else SDL) ]; - buildFlags = - [ - "DO_USERDIRS=1" - # Makefile defaults, set here to enforce consistency on Darwin build - "USE_CODEC_WAVE=1" - "USE_CODEC_MP3=1" - "USE_CODEC_VORBIS=1" - "USE_CODEC_FLAC=1" - "USE_CODEC_OPUS=1" - "USE_CODEC_MIKMOD=0" - "USE_CODEC_UMX=0" - "USE_CODEC_XMP=1" - "MP3LIB=mad" - "VORBISLIB=vorbis" - ] - ++ lib.optionals useSDL2 [ - "SDL_CONFIG=sdl2-config" - "USE_SDL2=1" - ]; + buildFlags = [ + "DO_USERDIRS=1" + # Makefile defaults, set here to enforce consistency on Darwin build + "USE_CODEC_WAVE=1" + "USE_CODEC_MP3=1" + "USE_CODEC_VORBIS=1" + "USE_CODEC_FLAC=1" + "USE_CODEC_OPUS=1" + "USE_CODEC_MIKMOD=0" + "USE_CODEC_UMX=0" + "USE_CODEC_XMP=1" + "MP3LIB=mad" + "VORBISLIB=vorbis" + ] + ++ lib.optionals useSDL2 [ + "SDL_CONFIG=sdl2-config" + "USE_SDL2=1" + ]; makefile = if (stdenv.hostPlatform.isDarwin) then "Makefile.darwin" else "Makefile"; diff --git a/pkgs/games/quakespasm/vulkan.nix b/pkgs/games/quakespasm/vulkan.nix index 70d3c792b187..496fb997a28c 100644 --- a/pkgs/games/quakespasm/vulkan.nix +++ b/pkgs/games/quakespasm/vulkan.nix @@ -41,22 +41,21 @@ stdenv.mkDerivation (finalAttrs: { copyDesktopItems ]; - buildInputs = - [ - SDL2 - flac - gzip - libmpg123 - libopus - libvorbis - libX11 - opusfile - vulkan-loader - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - moltenvk - vulkan-headers - ]; + buildInputs = [ + SDL2 + flac + gzip + libmpg123 + libopus + libvorbis + libX11 + opusfile + vulkan-loader + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + moltenvk + vulkan-headers + ]; buildFlags = [ "DO_USERDIRS=1" ]; diff --git a/pkgs/games/scummvm/default.nix b/pkgs/games/scummvm/default.nix index 5cf9d4d00150..54e4c74bd414 100644 --- a/pkgs/games/scummvm/default.nix +++ b/pkgs/games/scummvm/default.nix @@ -68,14 +68,13 @@ stdenv.mkDerivation rec { ]; # They use 'install -s', that calls the native strip instead of the cross - postConfigure = - '' - sed -i "s/-c -s/-c -s --strip-program=''${STRIP@Q}/" ports.mk - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace config.mk \ - --replace-fail ${stdenv.hostPlatform.config}-ranlib ${cctools}/bin/ranlib - ''; + postConfigure = '' + sed -i "s/-c -s/-c -s --strip-program=''${STRIP@Q}/" ports.mk + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace config.mk \ + --replace-fail ${stdenv.hostPlatform.config}-ranlib ${cctools}/bin/ranlib + ''; NIX_CFLAGS_COMPILE = [ "-fpermissive" ]; diff --git a/pkgs/games/shattered-pixel-dungeon/generic.nix b/pkgs/games/shattered-pixel-dungeon/generic.nix index 496f54cf426e..c881d994cded 100644 --- a/pkgs/games/shattered-pixel-dungeon/generic.nix +++ b/pkgs/games/shattered-pixel-dungeon/generic.nix @@ -90,7 +90,8 @@ stdenv.mkDerivation ( perl makeWrapper copyDesktopItems - ] ++ attrs.nativeBuildInputs or [ ]; + ] + ++ attrs.nativeBuildInputs or [ ]; desktopItems = [ desktopItem ]; diff --git a/pkgs/games/spring/default.nix b/pkgs/games/spring/default.nix index b2c127e188bc..3fb823ef1937 100644 --- a/pkgs/games/spring/default.nix +++ b/pkgs/games/spring/default.nix @@ -62,30 +62,29 @@ stdenv.mkDerivation rec { docbook_xsl_ns asciidoc ]; - buildInputs = - [ - boost - curl - freetype - glew - libdevil - libGL - libGLU - libunwind - libvorbis - minizip - openal - p7zip - SDL2 - xorg.libX11 - xorg.libXcursor - xz - zlib - ] - ++ lib.optionals withAI [ - python3 - jdk - ]; + buildInputs = [ + boost + curl + freetype + glew + libdevil + libGL + libGLU + libunwind + libvorbis + minizip + openal + p7zip + SDL2 + xorg.libX11 + xorg.libXcursor + xz + zlib + ] + ++ lib.optionals withAI [ + python3 + jdk + ]; postInstall = '' wrapProgram "$out/bin/spring" \ diff --git a/pkgs/games/xonotic/default.nix b/pkgs/games/xonotic/default.nix index 389418a1b152..54d1038697fe 100644 --- a/pkgs/games/xonotic/default.nix +++ b/pkgs/games/xonotic/default.nix @@ -92,24 +92,23 @@ let }; nativeBuildInputs = [ unzip ]; - buildInputs = - [ - libjpeg - zlib - libvorbis - curl - gmp - libX11 - ] - ++ lib.optionals withGLX [ - libGLU - libGL - libXpm - libXext - libXxf86vm - alsa-lib - ] - ++ lib.optionals withSDL [ SDL2 ]; + buildInputs = [ + libjpeg + zlib + libvorbis + curl + gmp + libX11 + ] + ++ lib.optionals withGLX [ + libGLU + libGL + libXpm + libXext + libXxf86vm + alsa-lib + ] + ++ lib.optionals withSDL [ SDL2 ]; sourceRoot = "Xonotic/source/darkplaces"; diff --git a/pkgs/kde/gear/akonadi/default.nix b/pkgs/kde/gear/akonadi/default.nix index 6225b7e9cfda..1b84ee1212f0 100644 --- a/pkgs/kde/gear/akonadi/default.nix +++ b/pkgs/kde/gear/akonadi/default.nix @@ -26,40 +26,39 @@ mkKdeDerivation { ./ignore-mysql-config-timestamp.patch ]; - extraCmakeFlags = - [ "-DDATABASE_BACKEND=${lib.toUpper backend}" ] - ++ lib.optionals (backend == "mysql") [ - "-DMYSQLD_SCRIPTS_PATH=${lib.getBin mariadb}/bin" - ] - ++ lib.optionals (backend == "postgres") [ - "-DPOSTGRES_PATH=${lib.getBin libpq}/bin" - ]; + extraCmakeFlags = [ + "-DDATABASE_BACKEND=${lib.toUpper backend}" + ] + ++ lib.optionals (backend == "mysql") [ + "-DMYSQLD_SCRIPTS_PATH=${lib.getBin mariadb}/bin" + ] + ++ lib.optionals (backend == "postgres") [ + "-DPOSTGRES_PATH=${lib.getBin libpq}/bin" + ]; extraNativeBuildInputs = [ qttools shared-mime-info ]; - extraBuildInputs = - [ - kaccounts-integration - accounts-qt - xz - ] - ++ lib.optionals (backend == "mysql") [ mariadb ] - ++ lib.optionals (backend == "postgres") [ libpq ] - ++ lib.optionals (backend == "sqlite") [ sqlite ]; + extraBuildInputs = [ + kaccounts-integration + accounts-qt + xz + ] + ++ lib.optionals (backend == "mysql") [ mariadb ] + ++ lib.optionals (backend == "postgres") [ libpq ] + ++ lib.optionals (backend == "sqlite") [ sqlite ]; # Hardcoded as a QString, which is UTF-16 so Nix can't pick it up automatically - postFixup = - '' - mkdir -p $out/nix-support - '' - + lib.optionalString (backend == "mysql") '' - echo "${mariadb}" > $out/nix-support/depends - '' - + lib.optionalString (backend == "postgres") '' - echo "${libpq}" > $out/nix-support/depends - ''; + postFixup = '' + mkdir -p $out/nix-support + '' + + lib.optionalString (backend == "mysql") '' + echo "${mariadb}" > $out/nix-support/depends + '' + + lib.optionalString (backend == "postgres") '' + echo "${libpq}" > $out/nix-support/depends + ''; } diff --git a/pkgs/kde/gear/audiotube/default.nix b/pkgs/kde/gear/audiotube/default.nix index b27ab60155a5..1ebd8bbfb3fc 100644 --- a/pkgs/kde/gear/audiotube/default.nix +++ b/pkgs/kde/gear/audiotube/default.nix @@ -44,7 +44,8 @@ mkKdeDerivation { kwindowsystem purpose qcoro - ] ++ pythonDeps; + ] + ++ pythonDeps; qtWrapperArgs = [ "--prefix PYTHONPATH : ${ps.makePythonPath pythonDeps}" diff --git a/pkgs/kde/lib/mk-kde-derivation.nix b/pkgs/kde/lib/mk-kde-derivation.nix index 02885eb947ff..75228d1e36eb 100644 --- a/pkgs/kde/lib/mk-kde-derivation.nix +++ b/pkgs/kde/lib/mk-kde-derivation.nix @@ -123,30 +123,31 @@ let "out" "dev" "devtools" - ] ++ lib.optionals hasPythonBindings [ "python" ]; + ] + ++ lib.optionals hasPythonBindings [ "python" ]; - nativeBuildInputs = - [ - cmake - ninja - qt6.wrapQtAppsHook - moveOutputsHook - ] - ++ lib.optionals hasPythonBindings [ - python3Packages.shiboken6 - (python3.withPackages (ps: [ - ps.build - ps.setuptools - ])) - ] - ++ extraNativeBuildInputs; + nativeBuildInputs = [ + cmake + ninja + qt6.wrapQtAppsHook + moveOutputsHook + ] + ++ lib.optionals hasPythonBindings [ + python3Packages.shiboken6 + (python3.withPackages (ps: [ + ps.build + ps.setuptools + ])) + ] + ++ extraNativeBuildInputs; - buildInputs = - [ qt6.qtbase ] - ++ lib.optionals hasPythonBindings [ - python3Packages.pyside6 - ] - ++ extraBuildInputs; + buildInputs = [ + qt6.qtbase + ] + ++ lib.optionals hasPythonBindings [ + python3Packages.pyside6 + ] + ++ extraBuildInputs; # FIXME: figure out what to propagate here propagatedBuildInputs = deps ++ extraPropagatedBuildInputs; @@ -177,7 +178,8 @@ let teams = [ lib.teams.qt-kde ]; # Platforms are currently limited to what upstream tests in CI, but can be extended if there's interest. platforms = lib.platforms.linux ++ lib.platforms.freebsd; - } // (args.meta or { }); + } + // (args.meta or { }); pos = builtins.unsafeGetAttrPos "pname" args; in diff --git a/pkgs/kde/plasma/breeze-plymouth/default.nix b/pkgs/kde/plasma/breeze-plymouth/default.nix index 97abe3948ac9..d85dd1861a10 100644 --- a/pkgs/kde/plasma/breeze-plymouth/default.nix +++ b/pkgs/kde/plasma/breeze-plymouth/default.nix @@ -38,13 +38,14 @@ mkKdeDerivation { # FIXME(later): discuss with upstream patches = [ ./install-paths.patch ]; - extraNativeBuildInputs = - [ pkg-config ] - ++ lib.optionals (logoFile != null) [ - imagemagick - netpbm - perl - ]; + extraNativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (logoFile != null) [ + imagemagick + netpbm + perl + ]; extraBuildInputs = [ plymouth ]; extraCmakeFlags = @@ -55,15 +56,14 @@ mkKdeDerivation { ++ lib.optional (topColor != null) "-DBACKGROUND_TOP_COLOR=${topColor}" ++ lib.optional (bottomColor != null) "-DBACKGROUND_BOTTOM_COLOR=${bottomColor}"; - postPatch = - '' - substituteInPlace cmake/FindPlymouth.cmake --subst-var out - '' - + lib.optionalString (logoFile != null) '' - cp ${logoFile} breeze/images/${resolvedLogoName}.logo.png + postPatch = '' + substituteInPlace cmake/FindPlymouth.cmake --subst-var out + '' + + lib.optionalString (logoFile != null) '' + cp ${logoFile} breeze/images/${resolvedLogoName}.logo.png - # conversion for 16bit taken from the breeze-plymouth readme - convert ${logoFile} -alpha Background -background "#000000" -fill "#000000" -flatten tmp.png - pngtopnm tmp.png | pnmquant 16 | pnmtopng > breeze/images/16bit/${resolvedLogoName}.logo.png - ''; + # conversion for 16bit taken from the breeze-plymouth readme + convert ${logoFile} -alpha Background -background "#000000" -fill "#000000" -flatten tmp.png + pngtopnm tmp.png | pnmquant 16 | pnmtopng > breeze/images/16bit/${resolvedLogoName}.logo.png + ''; } diff --git a/pkgs/misc/arm-trusted-firmware/default.nix b/pkgs/misc/arm-trusted-firmware/default.nix index bcb0a2e1efe9..93888011ba8a 100644 --- a/pkgs/misc/arm-trusted-firmware/default.nix +++ b/pkgs/misc/arm-trusted-firmware/default.nix @@ -70,22 +70,21 @@ let buildInputs = [ openssl ]; - makeFlags = - [ - "HOSTCC=$(CC_FOR_BUILD)" - "M0_CROSS_COMPILE=${pkgsCross.arm-embedded.stdenv.cc.targetPrefix}" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - # Make the new toolchain guessing (from 2.11+) happy - "CC=${stdenv.cc.targetPrefix}cc" - "LD=${stdenv.cc.targetPrefix}cc" - "AS=${stdenv.cc.targetPrefix}cc" - "OC=${stdenv.cc.targetPrefix}objcopy" - "OD=${stdenv.cc.targetPrefix}objdump" - # Passing OpenSSL path according to docs/design/trusted-board-boot-build.rst - "OPENSSL_DIR=${openssl}" - ] - ++ (lib.optional (platform != null) "PLAT=${platform}") - ++ extraMakeFlags; + makeFlags = [ + "HOSTCC=$(CC_FOR_BUILD)" + "M0_CROSS_COMPILE=${pkgsCross.arm-embedded.stdenv.cc.targetPrefix}" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + # Make the new toolchain guessing (from 2.11+) happy + "CC=${stdenv.cc.targetPrefix}cc" + "LD=${stdenv.cc.targetPrefix}cc" + "AS=${stdenv.cc.targetPrefix}cc" + "OC=${stdenv.cc.targetPrefix}objcopy" + "OD=${stdenv.cc.targetPrefix}objdump" + # Passing OpenSSL path according to docs/design/trusted-board-boot-build.rst + "OPENSSL_DIR=${openssl}" + ] + ++ (lib.optional (platform != null) "PLAT=${platform}") + ++ extraMakeFlags; installPhase = '' runHook preInstall @@ -109,7 +108,8 @@ let description = "Reference implementation of secure world software for ARMv8-A"; license = [ licenses.bsd3 - ] ++ lib.optionals (!deleteHDCPBlobBeforeBuild) [ licenses.unfreeRedistributable ]; + ] + ++ lib.optionals (!deleteHDCPBlobBeforeBuild) [ licenses.unfreeRedistributable ]; maintainers = with maintainers; [ lopsided98 ]; } // extraMeta; diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix index 6af2da10e8a8..7ca9ce3dfe28 100644 --- a/pkgs/misc/cups/default.nix +++ b/pkgs/misc/cups/default.nix @@ -39,46 +39,44 @@ stdenv.mkDerivation rec { "man" ]; - postPatch = - '' - substituteInPlace cups/testfile.c \ - --replace 'cupsFileFind("cat", "/bin' 'cupsFileFind("cat", "${coreutils}/bin' + 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 - '' - + - lib.optionalString - (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "12") - '' - substituteInPlace backend/usb-darwin.c \ - --replace "kIOMainPortDefault" "kIOMasterPortDefault" - ''; + # 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 + '' + + + lib.optionalString + (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "12") + '' + substituteInPlace backend/usb-darwin.c \ + --replace "kIOMainPortDefault" "kIOMasterPortDefault" + ''; nativeBuildInputs = [ pkg-config removeReferencesTo ]; - buildInputs = - [ - zlib - libjpeg - libpng - libtiff - libusb1 - gnutls - libpaper - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - avahi - pam - dbus - acl - ] - ++ lib.optional enableSystemd systemd; + buildInputs = [ + zlib + libjpeg + libpng + libtiff + libusb1 + gnutls + libpaper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + avahi + pam + dbus + acl + ] + ++ lib.optional enableSystemd systemd; propagatedBuildInputs = [ gmp ]; @@ -86,22 +84,21 @@ stdenv.mkDerivation rec { "build" "host" ]; - configureFlags = - [ - "--localstatedir=/var" - "--sysconfdir=/etc" - "--enable-raw-printing" - "--enable-threads" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-dbus" - "--enable-pam" - "--with-dbusdir=${placeholder "out"}/share/dbus-1" - ] - ++ lib.optional (libusb1 != null) "--enable-libusb" - ++ lib.optional (gnutls != null) "--enable-ssl" - ++ lib.optional (avahi != null) "--enable-avahi" - ++ lib.optional (libpaper != null) "--enable-libpaper"; + configureFlags = [ + "--localstatedir=/var" + "--sysconfdir=/etc" + "--enable-raw-printing" + "--enable-threads" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--enable-dbus" + "--enable-pam" + "--with-dbusdir=${placeholder "out"}/share/dbus-1" + ] + ++ lib.optional (libusb1 != null) "--enable-libusb" + ++ lib.optional (gnutls != null) "--enable-ssl" + ++ lib.optional (avahi != null) "--enable-avahi" + ++ lib.optional (libpaper != null) "--enable-libpaper"; # AR has to be an absolute path preConfigure = '' @@ -142,33 +139,32 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - postInstall = - '' - libexec=${if stdenv.hostPlatform.isDarwin then "libexec/cups" else "lib/cups"} - moveToOutput $libexec "$out" + postInstall = '' + libexec=${if stdenv.hostPlatform.isDarwin then "libexec/cups" else "lib/cups"} + moveToOutput $libexec "$out" - # $lib contains references to $out/share/cups. - # CUPS is working without them, so they are not vital. - find "$lib" -type f -exec grep -q "$out" {} \; \ - -printf "removing references from %p\n" \ - -exec remove-references-to -t "$out" {} + + # $lib contains references to $out/share/cups. + # CUPS is working without them, so they are not vital. + find "$lib" -type f -exec grep -q "$out" {} \; \ + -printf "removing references from %p\n" \ + -exec remove-references-to -t "$out" {} + - # Delete obsolete stuff that conflicts with cups-filters. - rm -rf $out/share/cups/banners $out/share/cups/data/testprint + # Delete obsolete stuff that conflicts with cups-filters. + rm -rf $out/share/cups/banners $out/share/cups/data/testprint - moveToOutput bin/cups-config "$dev" - sed -e "/^cups_serverbin=/s|$lib|$out|" \ - -i "$dev/bin/cups-config" + moveToOutput bin/cups-config "$dev" + sed -e "/^cups_serverbin=/s|$lib|$out|" \ + -i "$dev/bin/cups-config" - for f in "$out"/lib/systemd/system/*; do - substituteInPlace "$f" --replace "$lib/$libexec" "$out/$libexec" - done - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Use xdg-open when on Linux - substituteInPlace "$out"/share/applications/cups.desktop \ - --replace "Exec=htmlview" "Exec=xdg-open" - ''; + for f in "$out"/lib/systemd/system/*; do + substituteInPlace "$f" --replace "$lib/$libexec" "$out/$libexec" + done + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + # Use xdg-open when on Linux + substituteInPlace "$out"/share/applications/cups.desktop \ + --replace "Exec=htmlview" "Exec=xdg-open" + ''; passthru.tests = { inherit (nixosTests) diff --git a/pkgs/misc/drivers/epkowa/default.nix b/pkgs/misc/drivers/epkowa/default.nix index 21ad1bbc8873..d503490c6120 100644 --- a/pkgs/misc/drivers/epkowa/default.nix +++ b/pkgs/misc/drivers/epkowa/default.nix @@ -554,26 +554,24 @@ stdenv.mkDerivation rec { mkdir -p $out/lib/iscan ln -s ${plugins.network}/lib/iscan/network $out/lib/iscan/network ''; - postFixup = - '' - # iscan-registry is a shell script requiring getopt - wrapProgram $out/bin/iscan-registry --prefix PATH : ${getopt}/bin - registry=$out/bin/iscan-registry; - '' - + lib.concatStrings ( - lib.mapAttrsToList (name: value: '' - plugin=${value}; - ${value.passthru.registrationCommand} - '') plugins - ); + postFixup = '' + # iscan-registry is a shell script requiring getopt + wrapProgram $out/bin/iscan-registry --prefix PATH : ${getopt}/bin + registry=$out/bin/iscan-registry; + '' + + lib.concatStrings ( + lib.mapAttrsToList (name: value: '' + plugin=${value}; + ${value.passthru.registrationCommand} + '') plugins + ); meta = common_meta // { description = "sane-epkowa backend for some epson scanners"; - longDescription = - '' - Includes gui-less iscan (aka. Image Scan! for Linux). - Supported hardware: at least : - '' - + lib.concatStringsSep ", " (lib.mapAttrsToList (name: value: value.passthru.hw) plugins); + longDescription = '' + Includes gui-less iscan (aka. Image Scan! for Linux). + Supported hardware: at least : + '' + + lib.concatStringsSep ", " (lib.mapAttrsToList (name: value: value.passthru.hw) plugins); maintainers = with lib.maintainers; [ symphorien dominikh diff --git a/pkgs/misc/drivers/gutenprint/default.nix b/pkgs/misc/drivers/gutenprint/default.nix index 40ee58de2cf9..385e8491546c 100644 --- a/pkgs/misc/drivers/gutenprint/default.nix +++ b/pkgs/misc/drivers/gutenprint/default.nix @@ -25,29 +25,27 @@ stdenv.mkDerivation rec { }; strictDeps = true; - nativeBuildInputs = - [ - makeWrapper - pkg-config - ] - ++ lib.optionals cupsSupport [ - cups - perl - ]; # for cups-config - buildInputs = - [ - ijs - zlib - ] - ++ lib.optionals gimp2Support [ - gimp.gtk - gimp - ] - ++ lib.optionals cupsSupport [ - cups - libusb1 - perl - ]; + nativeBuildInputs = [ + makeWrapper + pkg-config + ] + ++ lib.optionals cupsSupport [ + cups + perl + ]; # for cups-config + buildInputs = [ + ijs + zlib + ] + ++ lib.optionals gimp2Support [ + gimp.gtk + gimp + ] + ++ lib.optionals cupsSupport [ + cups + libusb1 + perl + ]; configureFlags = lib.optionals cupsSupport [ "--disable-static-genppd" # should be harmless on NixOS diff --git a/pkgs/misc/jackaudio/default.nix b/pkgs/misc/jackaudio/default.nix index 774185941a9b..5ff5b4b47661 100644 --- a/pkgs/misc/jackaudio/default.nix +++ b/pkgs/misc/jackaudio/default.nix @@ -57,21 +57,21 @@ stdenv.mkDerivation (finalAttrs: { pkg-config python wafHook - ] ++ lib.optionals (optDbus != null) [ makeWrapper ]; - buildInputs = - [ - libsamplerate - optDbus - optPythonDBus - optLibffado - optAlsaLib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - aften - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - freebsd.libsysinfo - ]; + ] + ++ lib.optionals (optDbus != null) [ makeWrapper ]; + buildInputs = [ + libsamplerate + optDbus + optPythonDBus + optLibffado + optAlsaLib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + aften + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + freebsd.libsysinfo + ]; patches = [ (fetchpatch2 { @@ -86,17 +86,16 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs --build svnversion_regenerate.sh ''; - wafConfigureFlags = - [ - "--classic" - "--autostart=${if (optDbus != null) then "dbus" else "classic"}" - ] - ++ lib.optional (optDbus != null) "--dbus" - ++ lib.optional (optLibffado != null) "--firewire" - ++ lib.optional (optAlsaLib != null) "--alsa" - ++ lib.optional ( - stdenv.hostPlatform != stdenv.buildPlatform - ) "--platform=${stdenv.hostPlatform.parsed.kernel.name}"; + wafConfigureFlags = [ + "--classic" + "--autostart=${if (optDbus != null) then "dbus" else "classic"}" + ] + ++ lib.optional (optDbus != null) "--dbus" + ++ lib.optional (optLibffado != null) "--firewire" + ++ lib.optional (optAlsaLib != null) "--alsa" + ++ lib.optional ( + stdenv.hostPlatform != stdenv.buildPlatform + ) "--platform=${stdenv.hostPlatform.parsed.kernel.name}"; postInstall = ( if libOnly then diff --git a/pkgs/misc/jackaudio/tools.nix b/pkgs/misc/jackaudio/tools.nix index 25b0b5af38ab..976cab0e16c8 100644 --- a/pkgs/misc/jackaudio/tools.nix +++ b/pkgs/misc/jackaudio/tools.nix @@ -40,19 +40,18 @@ stdenv.mkDerivation (final: { meson ninja ]; - buildInputs = - [ - jack - libopus - libsamplerate - libsndfile - readline - ] - ++ lib.optionals enableAlsa [ - alsa-lib - zita-alsa-pcmi - zita-resampler - ]; + buildInputs = [ + jack + libopus + libsamplerate + libsndfile + readline + ] + ++ lib.optionals enableAlsa [ + alsa-lib + zita-alsa-pcmi + zita-resampler + ]; mesonFlags = [ (lib.mesonEnable "alsa_in_out" enableAlsa) diff --git a/pkgs/misc/opcua-client-gui/default.nix b/pkgs/misc/opcua-client-gui/default.nix index b0af3ee898c8..26ef34fd7715 100644 --- a/pkgs/misc/opcua-client-gui/default.nix +++ b/pkgs/misc/opcua-client-gui/default.nix @@ -24,7 +24,8 @@ python3Packages.buildPythonApplication rec { nativeBuildInputs = [ copyDesktopItems wrapQtAppsHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; makeWrapperArgs = [ "\${qtWrapperArgs[@]}" diff --git a/pkgs/misc/optee-os/default.nix b/pkgs/misc/optee-os/default.nix index 6b6d5ae692af..dcfe4f213c04 100644 --- a/pkgs/misc/optee-os/default.nix +++ b/pkgs/misc/optee-os/default.nix @@ -69,21 +69,20 @@ let )) ]; - makeFlags = - [ - "O=out" - "PLATFORM=${platform}" - "CFG_USER_TA_TARGETS=${taTarget}" - ] - ++ (lib.optionals (is32bit) [ - "CFG_ARM32_core=y" - "CROSS_COMPILE32=${stdenv.cc.targetPrefix}" - ]) - ++ (lib.optionals (is64bit) [ - "CFG_ARM64_core=y" - "CROSS_COMPILE64=${stdenv.cc.targetPrefix}" - ]) - ++ extraMakeFlags; + makeFlags = [ + "O=out" + "PLATFORM=${platform}" + "CFG_USER_TA_TARGETS=${taTarget}" + ] + ++ (lib.optionals (is32bit) [ + "CFG_ARM32_core=y" + "CROSS_COMPILE32=${stdenv.cc.targetPrefix}" + ]) + ++ (lib.optionals (is64bit) [ + "CFG_ARM64_core=y" + "CROSS_COMPILE64=${stdenv.cc.targetPrefix}" + ]) + ++ extraMakeFlags; installPhase = '' runHook preInstall diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix index de8fecd931c1..089630b5f18c 100644 --- a/pkgs/misc/uboot/default.nix +++ b/pkgs/misc/uboot/default.nix @@ -83,24 +83,23 @@ let patchShebangs scripts ''; - nativeBuildInputs = - [ - ncurses # tools/kwboot - bc - bison - flex - installShellFiles - (buildPackages.python3.withPackages (p: [ - p.libfdt - p.setuptools # for pkg_resources - p.pyelftools - ])) - swig - which # for scripts/dtc-version.sh - perl # for oid build (secureboot) - ] - ++ lib.optionals (!crossTools) toolsDeps - ++ lib.optionals stdenv.buildPlatform.isDarwin [ darwin.DarwinTools ]; # sw_vers command is needed on darwin + nativeBuildInputs = [ + ncurses # tools/kwboot + bc + bison + flex + installShellFiles + (buildPackages.python3.withPackages (p: [ + p.libfdt + p.setuptools # for pkg_resources + p.pyelftools + ])) + swig + which # for scripts/dtc-version.sh + perl # for oid build (secureboot) + ] + ++ lib.optionals (!crossTools) toolsDeps + ++ lib.optionals stdenv.buildPlatform.isDarwin [ darwin.DarwinTools ]; # sw_vers command is needed on darwin depsBuildBuild = [ buildPackages.gccStdenv.cc ]; # gccStdenv is needed for Darwin buildPlatform buildInputs = lib.optionals crossTools toolsDeps; @@ -112,7 +111,8 @@ let "DTC=${lib.getExe buildPackages.dtc}" "CROSS_COMPILE=${stdenv.cc.targetPrefix}" "HOSTCFLAGS=-fcommon" - ] ++ extraMakeFlags; + ] + ++ extraMakeFlags; passAsFile = [ "extraConfig" ]; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix index 940c7a000677..d56026227294 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/compat/package.nix @@ -21,114 +21,112 @@ in mkDerivation { pname = "compat"; path = "tools/build"; - extraPaths = - [ - "lib/libc/db" - "lib/libc/stdlib" # getopt - "lib/libc/gen" # getcap - "lib/libc/locale" # rpmatch - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "lib/libc/string" # strlcpy - "lib/libutil" - ] - ++ [ - "contrib/libc-pwcache" - "contrib/libc-vis" - "sys/libkern" - "sys/kern/subr_capability.c" + extraPaths = [ + "lib/libc/db" + "lib/libc/stdlib" # getopt + "lib/libc/gen" # getcap + "lib/libc/locale" # rpmatch + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "lib/libc/string" # strlcpy + "lib/libutil" + ] + ++ [ + "contrib/libc-pwcache" + "contrib/libc-vis" + "sys/libkern" + "sys/kern/subr_capability.c" - # Take only individual headers, or else we will clobber native libc, etc. + # Take only individual headers, or else we will clobber native libc, etc. - "sys/rpc/types.h" - ] - ++ lib.optionals (versionData.major >= 14) [ - "sys/sys/bitcount.h" - "sys/sys/linker_set.h" - "sys/sys/module.h" - ] - ++ [ - # Listed in Makekfile as INC - "include/mpool.h" - "include/ndbm.h" - "include/err.h" - "include/stringlist.h" - "include/a.out.h" - "include/nlist.h" - "include/db.h" - "include/getopt.h" - "include/nl_types.h" - "include/elf.h" - "sys/sys/ctf.h" - ] - ++ lib.optionals (versionData.major >= 14) [ - "include/bitstring.h" - "sys/sys/bitstring.h" - "sys/sys/nv_namespace.h" - ] - ++ [ + "sys/rpc/types.h" + ] + ++ lib.optionals (versionData.major >= 14) [ + "sys/sys/bitcount.h" + "sys/sys/linker_set.h" + "sys/sys/module.h" + ] + ++ [ + # Listed in Makekfile as INC + "include/mpool.h" + "include/ndbm.h" + "include/err.h" + "include/stringlist.h" + "include/a.out.h" + "include/nlist.h" + "include/db.h" + "include/getopt.h" + "include/nl_types.h" + "include/elf.h" + "sys/sys/ctf.h" + ] + ++ lib.optionals (versionData.major >= 14) [ + "include/bitstring.h" + "sys/sys/bitstring.h" + "sys/sys/nv_namespace.h" + ] + ++ [ - # Listed in Makefile as SYSINCS + # Listed in Makefile as SYSINCS - "sys/sys/capsicum.h" - "sys/sys/caprights.h" - "sys/sys/imgact_aout.h" - "sys/sys/nlist_aout.h" - "sys/sys/nv.h" - "sys/sys/dnv.h" - "sys/sys/cnv.h" + "sys/sys/capsicum.h" + "sys/sys/caprights.h" + "sys/sys/imgact_aout.h" + "sys/sys/nlist_aout.h" + "sys/sys/nv.h" + "sys/sys/dnv.h" + "sys/sys/cnv.h" - "sys/sys/elf32.h" - "sys/sys/elf64.h" - "sys/sys/elf_common.h" - "sys/sys/elf_generic.h" - "sys/${mkBsdMachine stdenv}/include" - ] - ++ lib.optionals stdenv.hostPlatform.isx86 [ "sys/x86/include" ] - ++ [ + "sys/sys/elf32.h" + "sys/sys/elf64.h" + "sys/sys/elf_common.h" + "sys/sys/elf_generic.h" + "sys/${mkBsdMachine stdenv}/include" + ] + ++ lib.optionals stdenv.hostPlatform.isx86 [ "sys/x86/include" ] + ++ [ - "sys/sys/queue.h" - "sys/sys/md5.h" - "sys/sys/sbuf.h" - "sys/sys/tree.h" - "sys/sys/font.h" - "sys/sys/consio.h" - "sys/sys/fnv_hash.h" - #"sys/sys/cdefs.h" - #"sys/sys/param.h" - "sys/sys/_null.h" - #"sys/sys/types.h" - "sys/sys/_pthreadtypes.h" - "sys/sys/_stdint.h" + "sys/sys/queue.h" + "sys/sys/md5.h" + "sys/sys/sbuf.h" + "sys/sys/tree.h" + "sys/sys/font.h" + "sys/sys/consio.h" + "sys/sys/fnv_hash.h" + #"sys/sys/cdefs.h" + #"sys/sys/param.h" + "sys/sys/_null.h" + #"sys/sys/types.h" + "sys/sys/_pthreadtypes.h" + "sys/sys/_stdint.h" - "sys/crypto/chacha20/_chacha.h" - "sys/crypto/chacha20/chacha.h" - # included too, despite ".c" - "sys/crypto/chacha20/chacha.c" + "sys/crypto/chacha20/_chacha.h" + "sys/crypto/chacha20/chacha.h" + # included too, despite ".c" + "sys/crypto/chacha20/chacha.c" - "sys/fs" - "sys/ufs" - "sys/sys/disk" + "sys/fs" + "sys/ufs" + "sys/sys/disk" - "lib/libcapsicum" - "lib/libcasper" - "lib/libmd" + "lib/libcapsicum" + "lib/libcasper" + "lib/libmd" - # idk bro - "sys/sys/kbio.h" - ] - ++ extraSrc; + # idk bro + "sys/sys/kbio.h" + ] + ++ extraSrc; - preBuild = - '' - NIX_CFLAGS_COMPILE+=' -I../../include -I../../sys' + preBuild = '' + NIX_CFLAGS_COMPILE+=' -I../../include -I../../sys' - cp ../../sys/${mkBsdMachine stdenv}/include/elf.h ../../sys/sys - cp ../../sys/${mkBsdMachine stdenv}/include/elf.h ../../sys/sys/${mkBsdMachine stdenv} - '' - + lib.optionalString stdenv.hostPlatform.isx86 '' - cp ../../sys/x86/include/elf.h ../../sys/x86 - ''; + cp ../../sys/${mkBsdMachine stdenv}/include/elf.h ../../sys/sys + cp ../../sys/${mkBsdMachine stdenv}/include/elf.h ../../sys/sys/${mkBsdMachine stdenv} + '' + + lib.optionalString stdenv.hostPlatform.isx86 '' + cp ../../sys/x86/include/elf.h ../../sys/x86 + ''; setupHooks = [ ../../../../../build-support/setup-hooks/role.bash @@ -160,17 +158,16 @@ mkDerivation { "INSTALL=boot-install" ]; - preIncludes = - '' - mkdir -p $out/{0,1}-include - cp --no-preserve=mode -r cross-build/include/common/* $out/0-include - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - cp --no-preserve=mode -r cross-build/include/linux/* $out/1-include - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - cp --no-preserve=mode -r cross-build/include/darwin/* $out/1-include - ''; + preIncludes = '' + mkdir -p $out/{0,1}-include + cp --no-preserve=mode -r cross-build/include/common/* $out/0-include + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + cp --no-preserve=mode -r cross-build/include/linux/* $out/1-include + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + cp --no-preserve=mode -r cross-build/include/darwin/* $out/1-include + ''; # Compat is for making other platforms look like FreeBSD (e.g. to # build build-time dependencies for building FreeBSD packages). It is diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/csu.nix b/pkgs/os-specific/bsd/freebsd/pkgs/csu.nix index d17a73a8d469..55d00923d103 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/csu.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/csu.nix @@ -18,7 +18,8 @@ mkDerivation { extraPaths = [ "lib/Makefile.inc" "lib/libc/include/libc_private.h" - ] ++ lib.optionals (versionData.major >= 14) [ "sys/sys/param.h" ]; + ] + ++ lib.optionals (versionData.major >= 14) [ "sys/sys/param.h" ]; nativeBuildInputs = [ bsdSetupHook freebsdSetupHook diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/install.nix b/pkgs/os-specific/bsd/freebsd/pkgs/install.nix index aab60480ec7a..01e40b9d9144 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/install.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/install.nix @@ -50,16 +50,15 @@ mkDerivation { ++ [ libnetbsd ]; - makeFlags = - [ - "STRIP=-s" # flag to install, not command - "MK_WERROR=no" - "TESTSDIR=${builtins.placeholder "test"}" - ] - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ - "BOOTSTRAPPING=1" - "INSTALL=boot-install" - ]; + makeFlags = [ + "STRIP=-s" # flag to install, not command + "MK_WERROR=no" + "TESTSDIR=${builtins.placeholder "test"}" + ] + ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + "BOOTSTRAPPING=1" + "INSTALL=boot-install" + ]; postInstall = '' install -C -m 0550 ${binstall} $out/bin/binstall substituteInPlace $out/bin/binstall --subst-var out diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix index 36b6f24ad1f4..c5977cb80c4c 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libcMinimal.nix @@ -34,7 +34,8 @@ mkDerivation { "etc/master.passwd" "etc/shells" "include/paths.h" - ] ++ extraSrc; + ] + ++ extraSrc; outputs = [ "out" diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libcasper.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libcasper.nix index df27f72bc8cb..d54fa2edf1c7 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libcasper.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libcasper.nix @@ -17,7 +17,8 @@ mkDerivation { makeFlags = [ "STRIP=-s" # flag to install, not command "CFLAGS=-DWITH_CASPER" - ] ++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no"; + ] + ++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no"; postInstall = '' make -C $BSDSRCDIR/lib/libcasper/services $makeFlags CFLAGS="-DWITH_CASPER -I$out/include" diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix index 0062dac44d87..c2de9562f6d5 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libmd.nix @@ -23,7 +23,8 @@ mkDerivation ( extraPaths = [ "sys/crypto" "sys/sys" - ] ++ extraSrc; + ] + ++ extraSrc; outputs = [ "out" @@ -41,13 +42,12 @@ mkDerivation ( ] ++ compatIfNeeded; - preBuild = - '' - mkdir $BSDSRCDIR/lib/libmd/sys - '' - + lib.optionalString stdenv.hostPlatform.isFreeBSD '' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib" - ''; + preBuild = '' + mkdir $BSDSRCDIR/lib/libmd/sys + '' + + lib.optionalString stdenv.hostPlatform.isFreeBSD '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib" + ''; installPhase = if (!bootstrapInstallation) then diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix index 1752583b0532..4cd030ebe02e 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix @@ -24,7 +24,8 @@ mkDerivation { makeFlags = [ "STRIP=-s" # flag to install, not command "MK_WERROR=no" - ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "INSTALL=boot-install"; + ] + ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "INSTALL=boot-install"; alwaysKeepStatic = true; } diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libprocstat.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libprocstat.nix index 69c23fca74a4..7ed03a6b2662 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libprocstat.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libprocstat.nix @@ -18,7 +18,8 @@ mkDerivation { "sys/contrib/pcg-c" "sys/opencrypto" "sys/crypto" - ] ++ extraSrc; + ] + ++ extraSrc; outputs = [ "out" diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libthr.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libthr.nix index 65ce4534fe4a..bd33c4121f7c 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libthr.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libthr.nix @@ -15,7 +15,8 @@ mkDerivation { "lib/libthread_db" "lib/libc" # needs /include + arch-specific files "libexec/rtld-elf" - ] ++ extraSrc; + ] + ++ extraSrc; outputs = [ "out" diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix index 4796b6d6a651..ae57d195fd6a 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libzfs.nix @@ -63,15 +63,14 @@ mkDerivation { # If we don't specify an object directory then # make will try to put openzfs objects in nonexistent directories. # This one seems to work - preBuild = - '' - export MAKEOBJDIRPREFIX=$BSDSRCDIR/obj - '' - + lib.flip lib.concatMapStrings libs (libname: '' - echo "building dependency ${libname}" - make -C $BSDSRCDIR/cddl/lib/${libname} $makeFlags - make -C $BSDSRCDIR/cddl/lib/${libname} $makeFlags install - ''); + preBuild = '' + export MAKEOBJDIRPREFIX=$BSDSRCDIR/obj + '' + + lib.flip lib.concatMapStrings libs (libname: '' + echo "building dependency ${libname}" + make -C $BSDSRCDIR/cddl/lib/${libname} $makeFlags + make -C $BSDSRCDIR/cddl/lib/${libname} $makeFlags install + ''); outputs = [ "out" diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/localedef.nix b/pkgs/os-specific/bsd/freebsd/pkgs/localedef.nix index 72180f8b1e2f..5703f669d74e 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/localedef.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/localedef.nix @@ -15,7 +15,8 @@ mkDerivation ({ extraPaths = [ "lib/libc/locale" "lib/libc/stdtime" - ] ++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ "." ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ "." ]; nativeBuildInputs = [ bsdSetupHook diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/locales.nix b/pkgs/os-specific/bsd/freebsd/pkgs/locales.nix index d8d3de93d5ec..8249fac2a6d1 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/locales.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/locales.nix @@ -30,7 +30,8 @@ let lorder mandoc groff - ] ++ lib.optional needsLocaledef localedef; + ] + ++ lib.optional needsLocaledef localedef; }; directories = { colldef = true; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/make.nix b/pkgs/os-specific/bsd/freebsd/pkgs/make.nix index a622e25f7a77..848a718bee15 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/make.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/make.nix @@ -7,17 +7,16 @@ mkDerivation { path = "contrib/bmake"; version = "9.2"; - postPatch = - '' - # make needs this to pick up our sys make files - export NIX_CFLAGS_COMPILE+=" -D_PATH_DEFSYSPATH=\"$out/share/mk\"" + postPatch = '' + # make needs this to pick up our sys make files + export NIX_CFLAGS_COMPILE+=" -D_PATH_DEFSYSPATH=\"$out/share/mk\"" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace $BSDSRCDIR/share/mk/bsd.sys.mk \ - --replace '-Wl,--fatal-warnings' "" \ - --replace '-Wl,--warn-shared-textrel' "" - ''; + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace $BSDSRCDIR/share/mk/bsd.sys.mk \ + --replace '-Wl,--fatal-warnings' "" \ + --replace '-Wl,--warn-shared-textrel' "" + ''; postInstall = '' make -C $BSDSRCDIR/share/mk FILESDIR=$out/share/mk install ''; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix index 4dc0f4c42bb7..aa4967e2c512 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix @@ -53,49 +53,48 @@ lib.makeOverridable ( lorder mandoc groff - ] ++ attrs.extraNativeBuildInputs or [ ]; + ] + ++ attrs.extraNativeBuildInputs or [ ]; buildInputs = compatIfNeeded; - makeFlags = - [ - "STRIP=-s" # flag to install, not command - ] - ++ lib.optional (!stdenv'.hostPlatform.isFreeBSD) "MK_WERROR=no" - ++ lib.optional stdenv.hostPlatform.isStatic "SHLIB_NAME="; + makeFlags = [ + "STRIP=-s" # flag to install, not command + ] + ++ lib.optional (!stdenv'.hostPlatform.isFreeBSD) "MK_WERROR=no" + ++ lib.optional stdenv.hostPlatform.isStatic "SHLIB_NAME="; - env = - { - HOST_SH = stdenv'.shell; + env = { + HOST_SH = stdenv'.shell; - # amd64 not x86_64 for this on unlike NetBSD - MACHINE_ARCH = freebsd-lib.mkBsdArch stdenv'; + # amd64 not x86_64 for this on unlike NetBSD + MACHINE_ARCH = freebsd-lib.mkBsdArch stdenv'; - MACHINE = freebsd-lib.mkBsdMachine stdenv'; + MACHINE = freebsd-lib.mkBsdMachine stdenv'; - MACHINE_CPUARCH = freebsd-lib.mkBsdCpuArch stdenv'; + MACHINE_CPUARCH = freebsd-lib.mkBsdCpuArch stdenv'; - COMPONENT_PATH = attrs.path or null; + COMPONENT_PATH = attrs.path or null; - # don't set filesystem flags that require root - NO_FSCHG = "yes"; - } - // lib.optionalAttrs stdenv'.hasCC { - # TODO should CC wrapper set this? - CPP = "${stdenv'.cc.targetPrefix}cpp"; + # don't set filesystem flags that require root + NO_FSCHG = "yes"; + } + // lib.optionalAttrs stdenv'.hasCC { + # TODO should CC wrapper set this? + CPP = "${stdenv'.cc.targetPrefix}cpp"; - # Since STRIP in `makeFlags` has to be a flag, not the binary itself - STRIPBIN = "${stdenv'.cc.bintools.targetPrefix}strip"; - } - // lib.optionalAttrs (!stdenv.hostPlatform.isFreeBSD) { BOOTSTRAPPING = true; } - // lib.optionalAttrs stdenv'.hostPlatform.isDarwin { MKRELRO = "no"; } - // lib.optionalAttrs (stdenv'.cc.isClang or false) { - HAVE_LLVM = lib.versions.major (lib.getVersion stdenv'.cc.cc); - } - // lib.optionalAttrs (stdenv'.cc.isGNU or false) { - HAVE_GCC = lib.versions.major (lib.getVersion stdenv'.cc.cc); - } - // lib.optionalAttrs (stdenv'.hostPlatform.isx86_32) { USE_SSP = "no"; } - // (attrs.env or { }); + # Since STRIP in `makeFlags` has to be a flag, not the binary itself + STRIPBIN = "${stdenv'.cc.bintools.targetPrefix}strip"; + } + // lib.optionalAttrs (!stdenv.hostPlatform.isFreeBSD) { BOOTSTRAPPING = true; } + // lib.optionalAttrs stdenv'.hostPlatform.isDarwin { MKRELRO = "no"; } + // lib.optionalAttrs (stdenv'.cc.isClang or false) { + HAVE_LLVM = lib.versions.major (lib.getVersion stdenv'.cc.cc); + } + // lib.optionalAttrs (stdenv'.cc.isGNU or false) { + HAVE_GCC = lib.versions.major (lib.getVersion stdenv'.cc.cc); + } + // lib.optionalAttrs (stdenv'.hostPlatform.isx86_32) { USE_SSP = "no"; } + // (attrs.env or { }); strictDeps = true; @@ -106,7 +105,8 @@ lib.makeOverridable ( ]; platforms = lib.platforms.unix; license = lib.licenses.bsd2; - } // attrs.meta or { }; + } + // attrs.meta or { }; } // lib.optionalAttrs (attrs.headersOnly or false) { installPhase = "includesPhase"; @@ -114,14 +114,13 @@ lib.makeOverridable ( } // (builtins.removeAttrs attrs [ "env" ]) // lib.optionalAttrs (stdenv'.hasCC && stdenv'.cc.isClang or false && attrs.clangFixup or true) { - preBuild = - '' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D_VA_LIST -D_VA_LIST_DECLARED -Dva_list=__builtin_va_list -D_SIZE_T_DECLARED -D_SIZE_T -Dsize_t=__SIZE_TYPE__ -D_WCHAR_T" - '' - + lib.optionalString (versionData.major == 13) '' - export NIX_LDFLAGS="$NIX_LDFLAGS --undefined-version" - '' - + (attrs.preBuild or ""); + preBuild = '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D_VA_LIST -D_VA_LIST_DECLARED -Dva_list=__builtin_va_list -D_SIZE_T_DECLARED -D_SIZE_T -Dsize_t=__SIZE_TYPE__ -D_WCHAR_T" + '' + + lib.optionalString (versionData.major == 13) '' + export NIX_LDFLAGS="$NIX_LDFLAGS --undefined-version" + '' + + (attrs.preBuild or ""); } // { patches = @@ -136,11 +135,9 @@ lib.makeOverridable ( lib.optionalAttrs (!stdenv.hostPlatform.isStatic && !attrs.alwaysKeepStatic or false && stdenv.hostPlatform.isFreeBSD) { - postInstall = - (attrs.postInstall or "") - + '' - rm -f $out/lib/*.a - ''; + postInstall = (attrs.postInstall or "") + '' + rm -f $out/lib/*.a + ''; } // lib.optionalAttrs diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/rc.nix b/pkgs/os-specific/bsd/freebsd/pkgs/rc.nix index 9e4932ef7206..cd4d7ab854b5 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/rc.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/rc.nix @@ -33,49 +33,48 @@ mkDerivation { "services" ]; - postPatch = + postPatch = '' + substituteInPlace "$BSDSRCDIR/libexec/rc/Makefile" --replace-fail /etc $out/etc + substituteInPlace "$BSDSRCDIR/libexec/rc/rc.d/Makefile" \ + --replace-fail /etc $services/etc \ + --replace-fail /var $services/var + '' + + ( + let + bins = [ + "/sbin/sysctl" + "/usr/bin/protect" + "/usr/bin/id" + "/bin/ps" + "/bin/cpuset" + "/usr/bin/stat" + "/bin/rm" + "/bin/chmod" + "/bin/cat" + "/bin/sync" + "/bin/sleep" + "/bin/date" + ]; + scripts = [ + "rc" + "rc.initdiskless" + "rc.shutdown" + "rc.subr" + "rc.suspend" + "rc.resume" + ]; + scriptPaths = "$BSDSRCDIR/libexec/rc/{${lib.concatStringsSep "," scripts}}"; + in + # set PATH correctly in scripts '' - substituteInPlace "$BSDSRCDIR/libexec/rc/Makefile" --replace-fail /etc $out/etc - substituteInPlace "$BSDSRCDIR/libexec/rc/rc.d/Makefile" \ - --replace-fail /etc $services/etc \ - --replace-fail /var $services/var + sed -E -i -e "s|PATH=.*|PATH=${rcDepsPath}|g" ${scriptPaths} '' - + ( - let - bins = [ - "/sbin/sysctl" - "/usr/bin/protect" - "/usr/bin/id" - "/bin/ps" - "/bin/cpuset" - "/usr/bin/stat" - "/bin/rm" - "/bin/chmod" - "/bin/cat" - "/bin/sync" - "/bin/sleep" - "/bin/date" - ]; - scripts = [ - "rc" - "rc.initdiskless" - "rc.shutdown" - "rc.subr" - "rc.suspend" - "rc.resume" - ]; - scriptPaths = "$BSDSRCDIR/libexec/rc/{${lib.concatStringsSep "," scripts}}"; - in - # set PATH correctly in scripts - '' - sed -E -i -e "s|PATH=.*|PATH=${rcDepsPath}|g" ${scriptPaths} - '' - # replace executable absolute filepaths with PATH lookups - + lib.concatMapStringsSep "\n" (fname: '' - sed -E -i -e "s|${fname}|${lib.last (lib.splitString "/" fname)}|g" \ - ${scriptPaths}'') bins - + "\n" - ); + # replace executable absolute filepaths with PATH lookups + + lib.concatMapStringsSep "\n" (fname: '' + sed -E -i -e "s|${fname}|${lib.last (lib.splitString "/" fname)}|g" \ + ${scriptPaths}'') bins + + "\n" + ); skipIncludesPhase = true; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/rtld-elf.nix b/pkgs/os-specific/bsd/freebsd/pkgs/rtld-elf.nix index 34bf582b86ed..27f90f4cf05c 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/rtld-elf.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/rtld-elf.nix @@ -27,7 +27,8 @@ mkDerivation { "sys/kern" "sys/libkern" "sys/crypto" - ] ++ extraSrc; + ] + ++ extraSrc; outputs = [ "out" diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/stand-efi.nix b/pkgs/os-specific/bsd/freebsd/pkgs/stand-efi.nix index 1bb3926f2a23..85f45a5c7835 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/stand-efi.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/stand-efi.nix @@ -32,7 +32,8 @@ mkDerivation { "MK_MAN=no" "MK_TESTS=no" "OBJCOPY=${lib.getBin buildPackages.binutils-unwrapped}/bin/${buildPackages.binutils-unwrapped.targetPrefix}objcopy" - ] ++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no"; + ] + ++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no"; hardeningDisable = [ "stackprotector" ]; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix index 7436ace0863d..b788d9a81eb5 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix @@ -45,36 +45,34 @@ let "sys" "include" ]; - postPatch = - '' - for f in sys/conf/kmod.mk sys/contrib/dev/acpica/acpica_prep.sh; do - substituteInPlace "$f" --replace-warn 'xargs -J' 'xargs-j ' - done + postPatch = '' + for f in sys/conf/kmod.mk sys/contrib/dev/acpica/acpica_prep.sh; do + substituteInPlace "$f" --replace-warn 'xargs -J' 'xargs-j ' + done - for f in sys/conf/*.mk; do - substituteInPlace "$f" --replace-quiet 'KERN_DEBUGDIR}''${' 'KERN_DEBUGDIR_' - done + for f in sys/conf/*.mk; do + substituteInPlace "$f" --replace-quiet 'KERN_DEBUGDIR}''${' 'KERN_DEBUGDIR_' + done - sed -i sys/${hostArchBsd}/conf/${baseConfig} \ - -e 's/WITH_CTF=1/WITH_CTF=0/' \ - -e '/KDTRACE/d' - '' - + lib.optionalString (baseConfigFile != null) '' - cat ${baseConfigFile} >>sys/${hostArchBsd}/conf/${baseConfig} - ''; + sed -i sys/${hostArchBsd}/conf/${baseConfig} \ + -e 's/WITH_CTF=1/WITH_CTF=0/' \ + -e '/KDTRACE/d' + '' + + lib.optionalString (baseConfigFile != null) '' + cat ${baseConfigFile} >>sys/${hostArchBsd}/conf/${baseConfig} + ''; }; # Kernel modules need this for kern.opts.mk - env = - { - MK_CTF = "no"; + env = { + MK_CTF = "no"; + } + // (lib.flip lib.mapAttrs' extraFlags ( + name: value: { + name = "MK_${lib.toUpper name}"; + value = if value then "yes" else "no"; } - // (lib.flip lib.mapAttrs' extraFlags ( - name: value: { - name = "MK_${lib.toUpper name}"; - value = if value then "yes" else "no"; - } - )); + )); in mkDerivation rec { pname = "sys"; diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix index f65f901f4904..e0be2bb0621c 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix @@ -38,15 +38,16 @@ mkDerivation ( "build" "host" ]; - configureFlags = - [ "--cache-file=config.cache" ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - # We include this header in our musl package only for legacy - # compatibility, and compat works fine without it (and having it - # know about sys/cdefs.h breaks packages like glib when built - # statically). - "ac_cv_header_sys_cdefs_h=no" - ]; + configureFlags = [ + "--cache-file=config.cache" + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + # We include this header in our musl package only for legacy + # compatibility, and compat works fine without it (and having it + # know about sys/cdefs.h breaks packages like glib when built + # statically). + "ac_cv_header_sys_cdefs_h=no" + ]; nativeBuildInputs = commonDeps ++ [ bsdSetupHook @@ -92,43 +93,42 @@ mkDerivation ( makeFlagsArray+=('INSTALL_SYMLINK=''${INSTALL} ''${SYMLINK} ''${RENAME}') ''; - postInstall = - '' - # why aren't these installed by netbsd? - install -D compat_defs.h $dev/include/compat_defs.h - install -D $BSDSRCDIR/include/cdbw.h $dev/include/cdbw.h - install -D $BSDSRCDIR/sys/sys/cdbr.h $dev/include/cdbr.h - install -D $BSDSRCDIR/sys/sys/featuretest.h \ - $dev/include/sys/featuretest.h - install -D $BSDSRCDIR/sys/sys/md5.h $dev/include/md5.h - install -D $BSDSRCDIR/sys/sys/rmd160.h $dev/include/rmd160.h - install -D $BSDSRCDIR/sys/sys/sha1.h $dev/include/sha1.h - install -D $BSDSRCDIR/sys/sys/sha2.h $dev/include/sha2.h - install -D $BSDSRCDIR/sys/sys/queue.h $dev/include/sys/queue.h - install -D $BSDSRCDIR/include/vis.h $dev/include/vis.h - install -D $BSDSRCDIR/include/db.h $dev/include/db.h - install -D $BSDSRCDIR/include/netconfig.h $dev/include/netconfig.h - install -D $BSDSRCDIR/include/utmpx.h $dev/include/utmpx.h - install -D $BSDSRCDIR/include/tzfile.h $dev/include/tzfile.h - install -D $BSDSRCDIR/sys/sys/tree.h $dev/include/sys/tree.h - install -D $BSDSRCDIR/include/nl_types.h $dev/include/nl_types.h - install -D $BSDSRCDIR/include/stringlist.h $dev/include/stringlist.h + postInstall = '' + # why aren't these installed by netbsd? + install -D compat_defs.h $dev/include/compat_defs.h + install -D $BSDSRCDIR/include/cdbw.h $dev/include/cdbw.h + install -D $BSDSRCDIR/sys/sys/cdbr.h $dev/include/cdbr.h + install -D $BSDSRCDIR/sys/sys/featuretest.h \ + $dev/include/sys/featuretest.h + install -D $BSDSRCDIR/sys/sys/md5.h $dev/include/md5.h + install -D $BSDSRCDIR/sys/sys/rmd160.h $dev/include/rmd160.h + install -D $BSDSRCDIR/sys/sys/sha1.h $dev/include/sha1.h + install -D $BSDSRCDIR/sys/sys/sha2.h $dev/include/sha2.h + install -D $BSDSRCDIR/sys/sys/queue.h $dev/include/sys/queue.h + install -D $BSDSRCDIR/include/vis.h $dev/include/vis.h + install -D $BSDSRCDIR/include/db.h $dev/include/db.h + install -D $BSDSRCDIR/include/netconfig.h $dev/include/netconfig.h + install -D $BSDSRCDIR/include/utmpx.h $dev/include/utmpx.h + install -D $BSDSRCDIR/include/tzfile.h $dev/include/tzfile.h + install -D $BSDSRCDIR/sys/sys/tree.h $dev/include/sys/tree.h + install -D $BSDSRCDIR/include/nl_types.h $dev/include/nl_types.h + install -D $BSDSRCDIR/include/stringlist.h $dev/include/stringlist.h - # Collapse includes slightly to fix dangling reference - install -D $BSDSRCDIR/common/include/rpc/types.h $dev/include/rpc/types.h - sed -i '1s;^;#include "nbtool_config.h"\n;' $dev/include/rpc/types.h - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $dev/include/ssp - touch $dev/include/ssp/ssp.h - '' - + '' - mkdir -p $dev/lib/pkgconfig - substitute ${./libbsd-overlay.pc} $dev/lib/pkgconfig/libbsd-overlay.pc \ - --subst-var-by out "$out" \ - --subst-var-by includedir "$dev/include" \ - --subst-var-by version ${version} - ''; + # Collapse includes slightly to fix dangling reference + install -D $BSDSRCDIR/common/include/rpc/types.h $dev/include/rpc/types.h + sed -i '1s;^;#include "nbtool_config.h"\n;' $dev/include/rpc/types.h + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $dev/include/ssp + touch $dev/include/ssp/ssp.h + '' + + '' + mkdir -p $dev/lib/pkgconfig + substitute ${./libbsd-overlay.pc} $dev/lib/pkgconfig/libbsd-overlay.pc \ + --subst-var-by out "$out" \ + --subst-var-by includedir "$dev/include" \ + --subst-var-by version ${version} + ''; extraPaths = [ "common" "include" diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix b/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix index e16027b535fc..e468dbbdaaa1 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/make-rules.nix @@ -18,51 +18,50 @@ mkDerivation { dontBuild = true; - postPatch = - '' - substituteInPlace $BSDSRCDIR/share/mk/bsd.doc.mk \ - --replace '-o ''${DOCOWN}' "" \ - --replace '-g ''${DOCGRP}' "" - for mk in $BSDSRCDIR/share/mk/bsd.inc.mk $BSDSRCDIR/share/mk/bsd.kinc.mk; do - substituteInPlace $mk \ - --replace '-o ''${BINOWN}' "" \ - --replace '-g ''${BINGRP}' "" - done - substituteInPlace $BSDSRCDIR/share/mk/bsd.kmodule.mk \ - --replace '-o ''${KMODULEOWN}' "" \ - --replace '-g ''${KMODULEGRP}' "" - substituteInPlace $BSDSRCDIR/share/mk/bsd.lib.mk \ - --replace '-o ''${LIBOWN}' "" \ - --replace '-g ''${LIBGRP}' "" \ - --replace '-o ''${DEBUGOWN}' "" \ - --replace '-g ''${DEBUGGRP}' "" - substituteInPlace $BSDSRCDIR/share/mk/bsd.lua.mk \ - --replace '-o ''${LIBOWN}' "" \ - --replace '-g ''${LIBGRP}' "" - substituteInPlace $BSDSRCDIR/share/mk/bsd.man.mk \ - --replace '-o ''${MANOWN}' "" \ - --replace '-g ''${MANGRP}' "" - substituteInPlace $BSDSRCDIR/share/mk/bsd.nls.mk \ - --replace '-o ''${NLSOWN}' "" \ - --replace '-g ''${NLSGRP}' "" - substituteInPlace $BSDSRCDIR/share/mk/bsd.prog.mk \ + postPatch = '' + substituteInPlace $BSDSRCDIR/share/mk/bsd.doc.mk \ + --replace '-o ''${DOCOWN}' "" \ + --replace '-g ''${DOCGRP}' "" + for mk in $BSDSRCDIR/share/mk/bsd.inc.mk $BSDSRCDIR/share/mk/bsd.kinc.mk; do + substituteInPlace $mk \ --replace '-o ''${BINOWN}' "" \ - --replace '-g ''${BINGRP}' "" \ - --replace '-o ''${RUMPBINOWN}' "" \ - --replace '-g ''${RUMPBINGRP}' "" \ - --replace '-o ''${DEBUGOWN}' "" \ - --replace '-g ''${DEBUGGRP}' "" + --replace '-g ''${BINGRP}' "" + done + substituteInPlace $BSDSRCDIR/share/mk/bsd.kmodule.mk \ + --replace '-o ''${KMODULEOWN}' "" \ + --replace '-g ''${KMODULEGRP}' "" + substituteInPlace $BSDSRCDIR/share/mk/bsd.lib.mk \ + --replace '-o ''${LIBOWN}' "" \ + --replace '-g ''${LIBGRP}' "" \ + --replace '-o ''${DEBUGOWN}' "" \ + --replace '-g ''${DEBUGGRP}' "" + substituteInPlace $BSDSRCDIR/share/mk/bsd.lua.mk \ + --replace '-o ''${LIBOWN}' "" \ + --replace '-g ''${LIBGRP}' "" + substituteInPlace $BSDSRCDIR/share/mk/bsd.man.mk \ + --replace '-o ''${MANOWN}' "" \ + --replace '-g ''${MANGRP}' "" + substituteInPlace $BSDSRCDIR/share/mk/bsd.nls.mk \ + --replace '-o ''${NLSOWN}' "" \ + --replace '-g ''${NLSGRP}' "" + substituteInPlace $BSDSRCDIR/share/mk/bsd.prog.mk \ + --replace '-o ''${BINOWN}' "" \ + --replace '-g ''${BINGRP}' "" \ + --replace '-o ''${RUMPBINOWN}' "" \ + --replace '-g ''${RUMPBINGRP}' "" \ + --replace '-o ''${DEBUGOWN}' "" \ + --replace '-g ''${DEBUGGRP}' "" - substituteInPlace $BSDSRCDIR/share/mk/bsd.lib.mk \ - --replace '_INSTRANLIB=''${empty(PRESERVE):?-a "''${RANLIB} -t":}' '_INSTRANLIB=' - substituteInPlace $BSDSRCDIR/share/mk/bsd.kinc.mk \ - --replace /bin/rm rm - '' - + lib.optionalString stdenv.targetPlatform.isDarwin '' - substituteInPlace $BSDSRCDIR/share/mk/bsd.sys.mk \ - --replace '-Wl,--fatal-warnings' "" \ - --replace '-Wl,--warn-shared-textrel' "" - ''; + substituteInPlace $BSDSRCDIR/share/mk/bsd.lib.mk \ + --replace '_INSTRANLIB=''${empty(PRESERVE):?-a "''${RANLIB} -t":}' '_INSTRANLIB=' + substituteInPlace $BSDSRCDIR/share/mk/bsd.kinc.mk \ + --replace /bin/rm rm + '' + + lib.optionalString stdenv.targetPlatform.isDarwin '' + substituteInPlace $BSDSRCDIR/share/mk/bsd.sys.mk \ + --replace '-Wl,--fatal-warnings' "" \ + --replace '-Wl,--warn-shared-textrel' "" + ''; installPhase = '' cp -r . $out diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/make.nix b/pkgs/os-specific/bsd/netbsd/pkgs/make.nix index 4cbb488dc3c6..266afa36ad72 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/make.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/make.nix @@ -3,12 +3,10 @@ mkDerivation { path = "usr.bin/make"; - postPatch = - make-rules.postPatch - + '' - # make needs this to pick up our sys make files - appendToVar NIX_CFLAGS_COMPILE "-D_PATH_DEFSYSPATH=\"$out/share/mk\"" - ''; + postPatch = make-rules.postPatch + '' + # make needs this to pick up our sys make files + appendToVar NIX_CFLAGS_COMPILE "-D_PATH_DEFSYSPATH=\"$out/share/mk\"" + ''; postInstall = '' make -C $BSDSRCDIR/share/mk FILESDIR=$out/share/mk install diff --git a/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix b/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix index 116aa46e7350..8852075d14fd 100644 --- a/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix +++ b/pkgs/os-specific/bsd/netbsd/pkgs/sys/base.nix @@ -32,14 +32,13 @@ ./sys-headers-incsdir.patch ]; - postPatch = - '' - substituteInPlace sys/arch/i386/stand/efiboot/Makefile.efiboot \ - --replace "-nocombreloc" "-z nocombreloc" - '' - + - # multiple header dirs, see above - include.postPatch; + postPatch = '' + substituteInPlace sys/arch/i386/stand/efiboot/Makefile.efiboot \ + --replace "-nocombreloc" "-z nocombreloc" + '' + + + # multiple header dirs, see above + include.postPatch; CONFIG = "GENERIC"; @@ -57,14 +56,13 @@ genassym ]; - postConfigure = - '' - pushd arch/$MACHINE/conf - config $CONFIG - popd - '' - # multiple header dirs, see above - + include.postConfigure; + postConfigure = '' + pushd arch/$MACHINE/conf + config $CONFIG + popd + '' + # multiple header dirs, see above + + include.postConfigure; makeFlags = defaultMakeFlags ++ [ "FIRMWAREDIR=$(out)/libdata/firmware" ]; hardeningDisable = [ "pic" ]; diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix index e5a5d71ee517..7ef016e6f9f9 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/mkDerivation.nix @@ -72,7 +72,8 @@ lib.makeOverridable ( install tsort lorder - ] ++ (attrs.extraNativeBuildInputs or [ ]); + ] + ++ (attrs.extraNativeBuildInputs or [ ]); HOST_SH = stdenv'.shell; diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/sys/package.nix b/pkgs/os-specific/bsd/openbsd/pkgs/sys/package.nix index ba91ab9230b2..f26545493c02 100644 --- a/pkgs/os-specific/bsd/openbsd/pkgs/sys/package.nix +++ b/pkgs/os-specific/bsd/openbsd/pkgs/sys/package.nix @@ -61,12 +61,12 @@ ln -s ${pkgsBuildTarget.binutils}/bin/${pkgsBuildTarget.binutils.targetPrefix}ld $TMP/bin/ld '' + - # The Makefile claims it needs includes, but it really doesn't. - # Tell it includes aren't real and can't hurt it. - '' - cd compile/${baseConfig}/obj - echo 'includes:' >>Makefile - ''; + # The Makefile claims it needs includes, but it really doesn't. + # Tell it includes aren't real and can't hurt it. + '' + cd compile/${baseConfig}/obj + echo 'includes:' >>Makefile + ''; # stand is in a separate package env.SKIPDIR = "stand"; diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/package.nix b/pkgs/os-specific/darwin/apple-source-releases/ICU/package.nix index fffef1c814a8..9a7ec4561355 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/ICU/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/ICU/package.nix @@ -44,21 +44,20 @@ let dontDisableStatic = withStatic; - configureFlags = - [ - (lib.enableFeature false "debug") - (lib.enableFeature false "renaming") - (lib.enableFeature false "extras") - (lib.enableFeature false "layout") - (lib.enableFeature false "samples") - ] - ++ lib.optionals (stdenv.hostPlatform.isFreeBSD || stdenv.hostPlatform.isDarwin) [ - (lib.enableFeature true "rpath") - ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ - (lib.withFeatureAs true "cross-build" nativeBuildRoot) - ] - ++ lib.optionals withStatic [ (lib.enableFeature true "static") ]; + configureFlags = [ + (lib.enableFeature false "debug") + (lib.enableFeature false "renaming") + (lib.enableFeature false "extras") + (lib.enableFeature false "layout") + (lib.enableFeature false "samples") + ] + ++ lib.optionals (stdenv.hostPlatform.isFreeBSD || stdenv.hostPlatform.isDarwin) [ + (lib.enableFeature true "rpath") + ] + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + (lib.withFeatureAs true "cross-build" nativeBuildRoot) + ] + ++ lib.optionals withStatic [ (lib.enableFeature true "static") ]; nativeBuildInputs = [ python3 ]; @@ -90,7 +89,8 @@ let outputs = [ "out" "dev" - ] ++ lib.optional withStatic "static"; + ] + ++ lib.optional withStatic "static"; outputBin = "dev"; postPatch = lib.optionalString self.finalPackage.doCheck '' @@ -189,19 +189,17 @@ let buildRootOnlyAttrs = self: super: { pname = "ICU-build-root"; - preConfigure = - super.preConfigure - + '' - mkdir build - cd build - configureScript=../configure + preConfigure = super.preConfigure + '' + mkdir build + cd build + configureScript=../configure - # Apple’s customizations require building and linking additional files, which are handled via `Makefile.local`. - # These need copied into the build environment to avoid link errors from not building them. - mkdir common i18n - cp ../common/Makefile.local common/Makefile.local - cp ../i18n/Makefile.local i18n/Makefile.local - ''; + # Apple’s customizations require building and linking additional files, which are handled via `Makefile.local`. + # These need copied into the build environment to avoid link errors from not building them. + mkdir common i18n + cp ../common/Makefile.local common/Makefile.local + cp ../i18n/Makefile.local i18n/Makefile.local + ''; postBuild = '' cd .. diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix index 52cb03245a0e..be9b1e32d6d3 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/package.nix @@ -30,21 +30,20 @@ mkAppleDerivation (finalAttrs: { # Propagate `out` only when there are dylibs to link (i.e., don’t propagate when doing a static build). propagatedBuildOutputs = lib.optionalString (!hostPlatform.isStatic) "out"; - postPatch = - '' - # Work around unnecessary private API usage in libcharset. - mkdir -p libcharset/os && cat < libcharset/os/variant_private.h - #pragma once - #include - static inline bool os_variant_has_internal_content(const char*) { return false; } - EOF + postPatch = '' + # Work around unnecessary private API usage in libcharset. + mkdir -p libcharset/os && cat < libcharset/os/variant_private.h + #pragma once + #include + static inline bool os_variant_has_internal_content(const char*) { return false; } + EOF - # Add additional test cases found while working on packaging libiconv in nixpkgs. - cp ${./nixpkgs_test.c} tests/libiconv/nixpkgs_test.c - '' - + lib.optionalString hostPlatform.isStatic '' - cp ${./static-modules.gperf} static-modules.gperf - ''; + # Add additional test cases found while working on packaging libiconv in nixpkgs. + cp ${./nixpkgs_test.c} tests/libiconv/nixpkgs_test.c + '' + + lib.optionalString hostPlatform.isStatic '' + cp ${./static-modules.gperf} static-modules.gperf + ''; # Dynamic builds use `dlopen` to load modules, but static builds have to link them all. # `gperf` is used to generate a lookup table from module to ops functions. @@ -87,7 +86,8 @@ mkAppleDerivation (finalAttrs: { license = [ lib.licenses.bsd2 lib.licenses.bsd3 - ] ++ lib.optional finalAttrs.finalPackage.doInstallCheck lib.licenses.apple-psl10; + ] + ++ lib.optional finalAttrs.finalPackage.doInstallCheck lib.licenses.apple-psl10; mainProgram = "iconv"; }; }) diff --git a/pkgs/os-specific/darwin/apple-source-releases/libpcap/package.nix b/pkgs/os-specific/darwin/apple-source-releases/libpcap/package.nix index aba3fc53a4f7..2fbff68ebfbe 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libpcap/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libpcap/package.nix @@ -78,7 +78,8 @@ mkAppleDerivation { configureFlags = [ (lib.withFeatureAs true "pcap" (if stdenv.hostPlatform.isLinux then "linux" else "bpf")) (lib.enableFeature withRemote "remote") - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ (lib.enableFeature false "universal") ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ (lib.enableFeature false "universal") ]; preConfigure = '' cd libpcap @@ -89,7 +90,8 @@ mkAppleDerivation { nativeBuildInputs = [ bison flex - ] ++ lib.optionals withBluez [ bluez.dev ]; + ] + ++ lib.optionals withBluez [ bluez.dev ]; meta = { description = "Packet Capture Library (with Apple modifications)"; diff --git a/pkgs/os-specific/darwin/apple-source-releases/mkAppleDerivation.nix b/pkgs/os-specific/darwin/apple-source-releases/mkAppleDerivation.nix index d53da980b648..d42357f6b245 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/mkAppleDerivation.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/mkAppleDerivation.nix @@ -61,7 +61,8 @@ lib.makeOverridable ( license = lib.licenses.apple-psl20; teams = [ lib.teams.darwin ]; platforms = lib.platforms.darwin; - } // super.meta or { }; + } + // super.meta or { }; } // lib.optionalAttrs (super ? xcodeHash) { postUnpack = diff --git a/pkgs/os-specific/darwin/apple-source-releases/text_cmds/package.nix b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/package.nix index 95867cad1186..b640edb096b8 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/text_cmds/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/package.nix @@ -49,31 +49,30 @@ mkAppleDerivation { xcodeHash = "sha256-dZ+yJyfflhmUyx3gitRXC115QxS87SGC4/HjMa199Ts="; - postPatch = - '' - # Improve compatiblity with libmd in nixpkgs. - substituteInPlace md5/md5.c \ - --replace-fail '' '' \ - --replace-fail SHA224_Init SHA224Init \ - --replace-fail SHA224_Update SHA224Update \ - --replace-fail SHA224_End SHA224End \ - --replace-fail SHA224_Data SHA224Data \ - --replace-fail SHA224_CTX SHA2_CTX \ - --replace-fail '' '' \ - --replace-fail 'const void *, unsigned int, char *' 'const uint8_t *, size_t, char *' - '' - + lib.optionalString (lib.versionOlder (lib.getVersion apple-sdk) "13.0") '' - # Backport vis APIs from the 13.3 SDK (needed by vis). - cp '${Libc_13}/gen/FreeBSD/vis.c' vis/vis-libc.c - # Backport errx APIs from the 13.3 SDK (needed by lots of things). - mkdir sys - cp '${Libc_13}/gen/FreeBSD/err.c' err-libc.c - cp '${Libc_13}/include/err.h' err.h - cp '${Libc_13}/fbsdcompat/sys/cdefs.h' sys/cdefs.h - substituteInPlace err.h \ - --replace-fail '__cold' "" - touch namespace.h un-namespace.h libc_private.h - ''; + postPatch = '' + # Improve compatiblity with libmd in nixpkgs. + substituteInPlace md5/md5.c \ + --replace-fail '' '' \ + --replace-fail SHA224_Init SHA224Init \ + --replace-fail SHA224_Update SHA224Update \ + --replace-fail SHA224_End SHA224End \ + --replace-fail SHA224_Data SHA224Data \ + --replace-fail SHA224_CTX SHA2_CTX \ + --replace-fail '' '' \ + --replace-fail 'const void *, unsigned int, char *' 'const uint8_t *, size_t, char *' + '' + + lib.optionalString (lib.versionOlder (lib.getVersion apple-sdk) "13.0") '' + # Backport vis APIs from the 13.3 SDK (needed by vis). + cp '${Libc_13}/gen/FreeBSD/vis.c' vis/vis-libc.c + # Backport errx APIs from the 13.3 SDK (needed by lots of things). + mkdir sys + cp '${Libc_13}/gen/FreeBSD/err.c' err-libc.c + cp '${Libc_13}/include/err.h' err.h + cp '${Libc_13}/fbsdcompat/sys/cdefs.h' sys/cdefs.h + substituteInPlace err.h \ + --replace-fail '__cold' "" + touch namespace.h un-namespace.h libc_private.h + ''; env.NIX_CFLAGS_COMPILE = "-I${privateHeaders}/include"; diff --git a/pkgs/os-specific/linux/ax99100/default.nix b/pkgs/os-specific/linux/ax99100/default.nix index 3641fc59b4e8..e4f9a2accc50 100644 --- a/pkgs/os-specific/linux/ax99100/default.nix +++ b/pkgs/os-specific/linux/ax99100/default.nix @@ -14,7 +14,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ dos2unix kmod - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; src = fetchzip { url = "https://www.asix.com.tw/en/support/download/file/1229"; @@ -33,15 +34,14 @@ stdenv.mkDerivation { # We included them here instead of fetching them, because of line # ending issues that are easier to fix manually. Also the # set_termios patch needs to be applied for 6.1 not for 6.0. - patches = - [ - ./kernel-5.18-pci_free_consistent-pci_alloc_consistent.patch - ./kernel-6.1-set_termios-const-ktermios.patch - ] - ++ lib.optionals (lib.versionAtLeast kernel.version "6.2") [ - ./kernel-6.2-fix-pointer-type.patch - ./kernel-6.4-fix-define-semaphore.patch - ]; + patches = [ + ./kernel-5.18-pci_free_consistent-pci_alloc_consistent.patch + ./kernel-6.1-set_termios-const-ktermios.patch + ] + ++ lib.optionals (lib.versionAtLeast kernel.version "6.2") [ + ./kernel-6.2-fix-pointer-type.patch + ./kernel-6.4-fix-define-semaphore.patch + ]; patchFlags = [ "-p0" ]; diff --git a/pkgs/os-specific/linux/bionic-prebuilt/default.nix b/pkgs/os-specific/linux/bionic-prebuilt/default.nix index be53b12a42ce..9830f07266fd 100644 --- a/pkgs/os-specific/linux/bionic-prebuilt/default.nix +++ b/pkgs/os-specific/linux/bionic-prebuilt/default.nix @@ -97,54 +97,53 @@ stdenvNoCC.mkDerivation rec { "!defined(BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD)" "0" ''; - installPhase = - '' - # copy the bionic headers - mkdir -p $out/include/support $out/include/android - cp -vr libc/include/* $out/include - # copy the kernel headers - cp -vr ${kernelHeaders}/include/* $out/include/ + installPhase = '' + # copy the bionic headers + mkdir -p $out/include/support $out/include/android + cp -vr libc/include/* $out/include + # copy the kernel headers + cp -vr ${kernelHeaders}/include/* $out/include/ - chmod -R +w $out/include/linux + chmod -R +w $out/include/linux - # fix a bunch of kernel headers so that things can actually be found - sed -i 's,struct epoll_event {,#include \nstruct Xepoll_event {,' $out/include/linux/eventpoll.h - sed -i 's,struct in_addr {,typedef unsigned int in_addr_t;\nstruct in_addr {,' $out/include/linux/in.h - sed -i 's,struct udphdr {,struct Xudphdr {,' $out/include/linux/udp.h - sed -i 's,union semun {,union Xsemun {,' $out/include/linux/sem.h - sed -i 's,struct __kernel_sockaddr_storage,#define sockaddr_storage __kernel_sockaddr_storage\nstruct __kernel_sockaddr_storage,' $out/include/linux/socket.h - sed -i 's,#ifndef __UAPI_DEF_.*$,#if 1,' $out/include/linux/libc-compat.h - substituteInPlace $out/include/linux/in.h --replace "__be32 imr_" "struct in_addr imr_" - substituteInPlace $out/include/linux/in.h --replace "__be32 imsf_" "struct in_addr imsf_" - substituteInPlace $out/include/linux/sysctl.h --replace "__unused" "_unused" + # fix a bunch of kernel headers so that things can actually be found + sed -i 's,struct epoll_event {,#include \nstruct Xepoll_event {,' $out/include/linux/eventpoll.h + sed -i 's,struct in_addr {,typedef unsigned int in_addr_t;\nstruct in_addr {,' $out/include/linux/in.h + sed -i 's,struct udphdr {,struct Xudphdr {,' $out/include/linux/udp.h + sed -i 's,union semun {,union Xsemun {,' $out/include/linux/sem.h + sed -i 's,struct __kernel_sockaddr_storage,#define sockaddr_storage __kernel_sockaddr_storage\nstruct __kernel_sockaddr_storage,' $out/include/linux/socket.h + sed -i 's,#ifndef __UAPI_DEF_.*$,#if 1,' $out/include/linux/libc-compat.h + substituteInPlace $out/include/linux/in.h --replace "__be32 imr_" "struct in_addr imr_" + substituteInPlace $out/include/linux/in.h --replace "__be32 imsf_" "struct in_addr imsf_" + substituteInPlace $out/include/linux/sysctl.h --replace "__unused" "_unused" - # what could possibly live in - touch $out/include/linux/compiler.h + # what could possibly live in + touch $out/include/linux/compiler.h - # copy the support headers - cp -vr ${ndk_support_headers}* $out/include/support/ + # copy the support headers + cp -vr ${ndk_support_headers}* $out/include/support/ - mkdir $out/lib - cp -v ${prebuilt_crt.out}/*.o $out/lib/ - cp -v ${prebuilt_crt.out}/libgcc.a $out/lib/ - cp -v ${prebuilt_ndk_crt.out}/*.o $out/lib/ - '' - + lib.optionalString enableShared '' - for i in libc.so libm.so libdl.so liblog.so; do - cp -v ${prebuilt_libs.out}/$i $out/lib/ - done - '' - + lib.optionalString enableStatic '' - # no liblog.a; while it's also part of the base libraries, - # it's only available as shared object in the prebuilts. - for i in libc.a libm.a libdl.a; do - cp -v ${prebuilt_ndk_crt.out}/$i $out/lib/ - done - '' - + '' - mkdir -p $dev/include - cp -v $out/include/*.h $dev/include/ - ''; + mkdir $out/lib + cp -v ${prebuilt_crt.out}/*.o $out/lib/ + cp -v ${prebuilt_crt.out}/libgcc.a $out/lib/ + cp -v ${prebuilt_ndk_crt.out}/*.o $out/lib/ + '' + + lib.optionalString enableShared '' + for i in libc.so libm.so libdl.so liblog.so; do + cp -v ${prebuilt_libs.out}/$i $out/lib/ + done + '' + + lib.optionalString enableStatic '' + # no liblog.a; while it's also part of the base libraries, + # it's only available as shared object in the prebuilts. + for i in libc.a libm.a libdl.a; do + cp -v ${prebuilt_ndk_crt.out}/$i $out/lib/ + done + '' + + '' + mkdir -p $dev/include + cp -v $out/include/*.h $dev/include/ + ''; outputs = [ "out" diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index 1795b712ef38..ef7b545ed548 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -70,7 +70,8 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" "pie" - ] ++ lib.optionals enableStatic [ "fortify" ]; + ] + ++ lib.optionals enableStatic [ "fortify" ]; patches = [ ./busybox-in-store.patch @@ -105,7 +106,8 @@ stdenv.mkDerivation rec { url = "https://git.alpinelinux.org/aports/plain/main/busybox/CVE-2023-42364-CVE-2023-42365.patch?id=8a4bf5971168bf48201c05afda7bee0fbb188e13"; hash = "sha256-nQPgT9eA1asCo38Z9X7LR9My0+Vz5YBPba3ARV3fWcc="; }) - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./clang-cross.patch; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./clang-cross.patch; separateDebugInfo = true; diff --git a/pkgs/os-specific/linux/conky/default.nix b/pkgs/os-specific/linux/conky/default.nix index 1ef67406f0e8..8f32a4310e89 100644 --- a/pkgs/os-specific/linux/conky/default.nix +++ b/pkgs/os-specific/linux/conky/default.nix @@ -106,53 +106,51 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = - [ - cmake - pkg-config - gperf - ] - ++ lib.optional docsSupport pandoc - ++ lib.optional (docsSupport || extrasSupport) ( - # Use buildPackages to work around https://github.com/NixOS/nixpkgs/issues/305858 - buildPackages.python3.withPackages (ps: [ - ps.jinja2 - ps.pyyaml - ]) - ) - ++ lib.optional luaImlib2Support toluapp - ++ lib.optional luaCairoSupport toluapp; + nativeBuildInputs = [ + cmake + pkg-config + gperf + ] + ++ lib.optional docsSupport pandoc + ++ lib.optional (docsSupport || extrasSupport) ( + # Use buildPackages to work around https://github.com/NixOS/nixpkgs/issues/305858 + buildPackages.python3.withPackages (ps: [ + ps.jinja2 + ps.pyyaml + ]) + ) + ++ lib.optional luaImlib2Support toluapp + ++ lib.optional luaCairoSupport toluapp; - buildInputs = - [ - glib - libXinerama - ] - ++ lib.optional ncursesSupport ncurses - ++ lib.optionals x11Support [ - freetype - xorg.libICE - xorg.libX11 - xorg.libXext - xorg.libXft - xorg.libSM - ] - ++ lib.optionals waylandSupport [ - pango - wayland - wayland-protocols - ] - ++ lib.optional xdamageSupport libXdamage - ++ lib.optional imlib2Support imlib2 - ++ lib.optional luaSupport lua - ++ lib.optional luaImlib2Support imlib2 - ++ lib.optional luaCairoSupport cairo - ++ lib.optional wirelessSupport wirelesstools - ++ lib.optional curlSupport curl - ++ lib.optional rssSupport libxml2 - ++ lib.optional nvidiaSupport libXNVCtrl - ++ lib.optional pulseSupport libpulseaudio - ++ lib.optional journalSupport systemd; + buildInputs = [ + glib + libXinerama + ] + ++ lib.optional ncursesSupport ncurses + ++ lib.optionals x11Support [ + freetype + xorg.libICE + xorg.libX11 + xorg.libXext + xorg.libXft + xorg.libSM + ] + ++ lib.optionals waylandSupport [ + pango + wayland + wayland-protocols + ] + ++ lib.optional xdamageSupport libXdamage + ++ lib.optional imlib2Support imlib2 + ++ lib.optional luaSupport lua + ++ lib.optional luaImlib2Support imlib2 + ++ lib.optional luaCairoSupport cairo + ++ lib.optional wirelessSupport wirelesstools + ++ lib.optional curlSupport curl + ++ lib.optional rssSupport libxml2 + ++ lib.optional nvidiaSupport libXNVCtrl + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional journalSupport systemd; cmakeFlags = [ (lib.cmakeBool "REPRODUCIBLE_BUILD" true) diff --git a/pkgs/os-specific/linux/corefreq/default.nix b/pkgs/os-specific/linux/corefreq/default.nix index d1dabe816c12..b5f8edef4af8 100644 --- a/pkgs/os-specific/linux/corefreq/default.nix +++ b/pkgs/os-specific/linux/corefreq/default.nix @@ -25,7 +25,8 @@ stdenv.mkDerivation rec { makeFlags = [ "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" - ] ++ extraFlags; + ] + ++ extraFlags; preInstall = '' mkdir -p $out/bin diff --git a/pkgs/os-specific/linux/dmraid/default.nix b/pkgs/os-specific/linux/dmraid/default.nix index 78ccf00831e4..18874fa3b7a2 100644 --- a/pkgs/os-specific/linux/dmraid/default.nix +++ b/pkgs/os-specific/linux/dmraid/default.nix @@ -15,33 +15,31 @@ stdenv.mkDerivation rec { sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq"; }; - patches = - [ - ./hardening-format.patch - ./fix-dmevent_tool.patch - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - (fetchpatch { - url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch"; - sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w"; - stripLen = 2; - extraPrefix = "1.0.0.rc16/"; - }) - (fetchpatch { - url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/007-fix-loff_t-musl.patch"; - sha256 = "0msnq39qnzg3b1pdksnz1dgqwa3ak03g41pqh0lw3h7w5rjc016k"; - stripLen = 2; - extraPrefix = "1.0.0.rc16/"; - }) - ]; + patches = [ + ./hardening-format.patch + ./fix-dmevent_tool.patch + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + (fetchpatch { + url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/006-musl-libc.patch"; + sha256 = "1j8xda0fpz8lxjxnqdidy7qb866qrzwpbca56yjdg6vf4x21hx6w"; + stripLen = 2; + extraPrefix = "1.0.0.rc16/"; + }) + (fetchpatch { + url = "https://raw.githubusercontent.com/void-linux/void-packages/fceed4b8e96b3c1da07babf6f67b6ed1588a28b2/srcpkgs/dmraid/patches/007-fix-loff_t-musl.patch"; + sha256 = "0msnq39qnzg3b1pdksnz1dgqwa3ak03g41pqh0lw3h7w5rjc016k"; + stripLen = 2; + extraPrefix = "1.0.0.rc16/"; + }) + ]; - postPatch = - '' - sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in - '' - + lib.optionalString stdenv.hostPlatform.isMusl '' - NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE" - ''; + postPatch = '' + sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in + '' + + lib.optionalString stdenv.hostPlatform.isMusl '' + NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE" + ''; preConfigure = "cd */"; diff --git a/pkgs/os-specific/linux/drbd/utils.nix b/pkgs/os-specific/linux/drbd/utils.nix index f5a6d8493224..ca1078e58322 100644 --- a/pkgs/os-specific/linux/drbd/utils.nix +++ b/pkgs/os-specific/linux/drbd/utils.nix @@ -58,7 +58,8 @@ stdenv.mkDerivation rec { makeFlags = [ "SOURCE_DATE_EPOCH=1" "WANT_DRBD_REPRODUCIBLE_BUILD=1" - ] ++ lib.optional (!forOCF) "OCF_ROOT=${ocf-resource-agents}/usr/lib/ocf}"; + ] + ++ lib.optional (!forOCF) "OCF_ROOT=${ocf-resource-agents}/usr/lib/ocf}"; installFlags = [ "prefix=" diff --git a/pkgs/os-specific/linux/exfat/default.nix b/pkgs/os-specific/linux/exfat/default.nix index d3af00569583..8f7813ac2a8c 100644 --- a/pkgs/os-specific/linux/exfat/default.nix +++ b/pkgs/os-specific/linux/exfat/default.nix @@ -20,14 +20,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - makeFlags = - [ - "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - "ARCH=${stdenv.hostPlatform.linuxArch}" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "ARCH=${stdenv.hostPlatform.linuxArch}" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; installPhase = '' install -m644 -b -D exfat.ko $out/lib/modules/${kernel.modDirVersion}/kernel/fs/exfat/exfat.ko diff --git a/pkgs/os-specific/linux/ffado/default.nix b/pkgs/os-specific/linux/ffado/default.nix index 92203c758a57..50c9250293c1 100644 --- a/pkgs/os-specific/linux/ffado/default.nix +++ b/pkgs/os-specific/linux/ffado/default.nix @@ -50,37 +50,35 @@ stdenv.mkDerivation rec { hash = "sha256-xELFL60Ryv1VE7tOhGyFHxAchIT4karFRe0ZDo/U0Q8="; }; - prePatch = - '' - substituteInPlace ./support/tools/ffado-diag.in \ - --replace /lib/modules/ "/run/booted-system/kernel-modules/lib/modules/" + prePatch = '' + substituteInPlace ./support/tools/ffado-diag.in \ + --replace /lib/modules/ "/run/booted-system/kernel-modules/lib/modules/" - # prevent build tools from leaking into closure - substituteInPlace support/tools/SConscript --replace-fail \ - 'support/tools/ffado-diag --static' \ - "echo '"'See `nix-store --query --tree ${placeholder "out"}`.'"'" - '' - + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - # skip the CC sanity check, since that requires invoking cross-compiled binaries during build - substituteInPlace SConstruct \ - --replace-fail 'conf.CompilerCheck()' 'True' \ - --replace-fail "pkg-config" "$PKG_CONFIG" - substituteInPlace admin/pkgconfig.py \ - --replace-fail "pkg-config" "$PKG_CONFIG" - ''; + # prevent build tools from leaking into closure + substituteInPlace support/tools/SConscript --replace-fail \ + 'support/tools/ffado-diag --static' \ + "echo '"'See `nix-store --query --tree ${placeholder "out"}`.'"'" + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # skip the CC sanity check, since that requires invoking cross-compiled binaries during build + substituteInPlace SConstruct \ + --replace-fail 'conf.CompilerCheck()' 'True' \ + --replace-fail "pkg-config" "$PKG_CONFIG" + substituteInPlace admin/pkgconfig.py \ + --replace-fail "pkg-config" "$PKG_CONFIG" + ''; - nativeBuildInputs = - [ - scons - pkg-config - which - udevCheckHook - ] - ++ lib.optionals withMixer [ - python - python.pkgs.pyqt5 - qt5.wrapQtAppsHook - ]; + nativeBuildInputs = [ + scons + pkg-config + which + udevCheckHook + ] + ++ lib.optionals withMixer [ + python + python.pkgs.pyqt5 + qt5.wrapQtAppsHook + ]; prefixKey = "PREFIX="; sconsFlags = [ @@ -97,21 +95,20 @@ stdenv.mkDerivation rec { "PYTHON_INTERPRETER=${python.interpreter}" ]; - buildInputs = - [ - dbus - dbus_cplusplus - glibmm - libavc1394 - libconfig - libiec61883 - libraw1394 - libxmlxx3 - python - ] - ++ lib.optionals (!stdenv.hostPlatform.isGnu) [ - argp-standalone - ]; + buildInputs = [ + dbus + dbus_cplusplus + glibmm + libavc1394 + libconfig + libiec61883 + libraw1394 + libxmlxx3 + python + ] + ++ lib.optionals (!stdenv.hostPlatform.isGnu) [ + argp-standalone + ]; NIX_LDFLAGS = lib.optionalString (!stdenv.hostPlatform.isGnu) "-largp"; diff --git a/pkgs/os-specific/linux/firmware/ath9k/default.nix b/pkgs/os-specific/linux/firmware/ath9k/default.nix index 87448530fb11..96a55187ecc5 100644 --- a/pkgs/os-specific/linux/firmware/ath9k/default.nix +++ b/pkgs/os-specific/linux/firmware/ath9k/default.nix @@ -113,33 +113,32 @@ stdenv.mkDerivation (finalAttrs: { ''; update = stdenv.mkDerivation { name = "${finalAttrs.pname}-${finalAttrs.version}-update"; - shellHook = - '' - echo 'rec {' - echo ' BASEDIR="$NIX_BUILD_TOP";' - make --dry-run --print-data-base -f ${finalAttrs.src}/Makefile download \ - | egrep '^[A-Z]+_(VER|URL|SUM|DIR) = ' \ - | sed 's_\([^ ]*\) = \(.*\)_\1 = "\2\";_' \ - | tr \( \{ \ - | tr \) \} - '' - # sha256 checksums were not added to upstream's Makefile until - # after the 1.4.0 release. The following line is needed for - # the `enableUnstable==false` build but not for the - # `enableUnstable==true` build. We can remove the lines below - # as soon as `enableUnstable==false` points to a version - # greater than 1.4.0. - + lib.optionalString (finalAttrs.version == "1.4.0") '' - echo 'GCC_SUM = "sha256-kuYcbcOgpEnmLXKjgYX9pVAWioZwLeoHEl69PsOZYoI=";' - echo 'MPFR_SUM = "sha256-e2bD8T3IOF8IJkyAWFPz4aju2rgHHVgvPmYZccms1f0=";' - echo 'MPC_SUM = "sha256-7VqBXP6lJdx3jfDLN0aLnBtVSq8w2TKLFDHKcFt0AP8=";' - echo 'GMP_SUM = "sha256-H1iKrMxBu5rtlG+f44Uhwm2LKQ0APF34B/ZWkPKq3sk=";' - echo 'BINUTILS_SUM = "sha256-KrLlsD4IbRLGKV+DGtrUaz4UEKOiNJM6Lo+sZssuehk=";' - '' - + '' - echo '}' - exit - ''; + shellHook = '' + echo 'rec {' + echo ' BASEDIR="$NIX_BUILD_TOP";' + make --dry-run --print-data-base -f ${finalAttrs.src}/Makefile download \ + | egrep '^[A-Z]+_(VER|URL|SUM|DIR) = ' \ + | sed 's_\([^ ]*\) = \(.*\)_\1 = "\2\";_' \ + | tr \( \{ \ + | tr \) \} + '' + # sha256 checksums were not added to upstream's Makefile until + # after the 1.4.0 release. The following line is needed for + # the `enableUnstable==false` build but not for the + # `enableUnstable==true` build. We can remove the lines below + # as soon as `enableUnstable==false` points to a version + # greater than 1.4.0. + + lib.optionalString (finalAttrs.version == "1.4.0") '' + echo 'GCC_SUM = "sha256-kuYcbcOgpEnmLXKjgYX9pVAWioZwLeoHEl69PsOZYoI=";' + echo 'MPFR_SUM = "sha256-e2bD8T3IOF8IJkyAWFPz4aju2rgHHVgvPmYZccms1f0=";' + echo 'MPC_SUM = "sha256-7VqBXP6lJdx3jfDLN0aLnBtVSq8w2TKLFDHKcFt0AP8=";' + echo 'GMP_SUM = "sha256-H1iKrMxBu5rtlG+f44Uhwm2LKQ0APF34B/ZWkPKq3sk=";' + echo 'BINUTILS_SUM = "sha256-KrLlsD4IbRLGKV+DGtrUaz4UEKOiNJM6Lo+sZssuehk=";' + '' + + '' + echo '}' + exit + ''; }; }; diff --git a/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix b/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix index ec5ec8ef98c2..b602c7532481 100644 --- a/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix +++ b/pkgs/os-specific/linux/firmware/raspberrypi/armstubs.nix @@ -26,26 +26,25 @@ stdenv.mkDerivation { cd armstubs ''; - makeFlags = - [ - "CC8=${stdenv.cc.targetPrefix}cc" - "LD8=${stdenv.cc.targetPrefix}ld" - "OBJCOPY8=${stdenv.cc.targetPrefix}objcopy" - "OBJDUMP8=${stdenv.cc.targetPrefix}objdump" - "CC7=${stdenv.cc.targetPrefix}cc" - "LD7=${stdenv.cc.targetPrefix}ld" - "OBJCOPY7=${stdenv.cc.targetPrefix}objcopy" - "OBJDUMP7=${stdenv.cc.targetPrefix}objdump" - ] - ++ optionals (stdenv.hostPlatform.isAarch64) [ - "armstub8.bin" - "armstub8-gic.bin" - ] - ++ optionals (stdenv.hostPlatform.isAarch32) [ - "armstub7.bin" - "armstub8-32.bin" - "armstub8-32-gic.bin" - ]; + makeFlags = [ + "CC8=${stdenv.cc.targetPrefix}cc" + "LD8=${stdenv.cc.targetPrefix}ld" + "OBJCOPY8=${stdenv.cc.targetPrefix}objcopy" + "OBJDUMP8=${stdenv.cc.targetPrefix}objdump" + "CC7=${stdenv.cc.targetPrefix}cc" + "LD7=${stdenv.cc.targetPrefix}ld" + "OBJCOPY7=${stdenv.cc.targetPrefix}objcopy" + "OBJDUMP7=${stdenv.cc.targetPrefix}objdump" + ] + ++ optionals (stdenv.hostPlatform.isAarch64) [ + "armstub8.bin" + "armstub8-gic.bin" + ] + ++ optionals (stdenv.hostPlatform.isAarch32) [ + "armstub7.bin" + "armstub8-32.bin" + "armstub8-32-gic.bin" + ]; installPhase = '' runHook preInstall diff --git a/pkgs/os-specific/linux/freeipa/default.nix b/pkgs/os-specific/linux/freeipa/default.nix index b50e3f79e488..fba09bc4c2ca 100644 --- a/pkgs/os-specific/linux/freeipa/default.nix +++ b/pkgs/os-specific/linux/freeipa/default.nix @@ -122,7 +122,8 @@ stdenv.mkDerivation rec { bind libpwquality jansson - ] ++ pythonInputs; + ] + ++ pythonInputs; postPatch = '' patchShebangs makeapi makeaci install/ui/util diff --git a/pkgs/os-specific/linux/fuse/common.nix b/pkgs/os-specific/linux/fuse/common.nix index 41c86f07a976..726032f36d26 100644 --- a/pkgs/os-specific/linux/fuse/common.nix +++ b/pkgs/os-specific/linux/fuse/common.nix @@ -73,7 +73,8 @@ stdenv.mkDerivation rec { "out" "dev" "man" - ] ++ lib.optional isFuse3 "udev"; + ] + ++ lib.optional isFuse3 "udev"; mesonFlags = lib.optionals isFuse3 [ "-Dudevrulesdir=/udev/rules.d" @@ -87,26 +88,25 @@ stdenv.mkDerivation rec { # $PATH, so it should also work on non-NixOS systems. env.NIX_CFLAGS_COMPILE = ''-DFUSERMOUNT_DIR="/run/wrappers/bin"''; - preConfigure = - '' - substituteInPlace lib/mount_util.c \ - --replace-fail "/bin/mount" "${lib.getBin util-linux}/bin/mount" \ - --replace-fail "/bin/umount" "${lib.getBin util-linux}/bin/umount" - substituteInPlace util/mount.fuse.c \ - --replace-fail "/bin/sh" "${runtimeShell}" - '' - + lib.optionalString (!isFuse3) '' - export MOUNT_FUSE_PATH=$bin/bin + preConfigure = '' + substituteInPlace lib/mount_util.c \ + --replace-fail "/bin/mount" "${lib.getBin util-linux}/bin/mount" \ + --replace-fail "/bin/umount" "${lib.getBin util-linux}/bin/umount" + substituteInPlace util/mount.fuse.c \ + --replace-fail "/bin/sh" "${runtimeShell}" + '' + + lib.optionalString (!isFuse3) '' + export MOUNT_FUSE_PATH=$bin/bin - # Do not install these files for fuse2 which are not useful for NixOS. - export INIT_D_PATH=$TMPDIR/etc/init.d - export UDEV_RULES_PATH=$TMPDIR/etc/udev/rules.d + # Do not install these files for fuse2 which are not useful for NixOS. + export INIT_D_PATH=$TMPDIR/etc/init.d + export UDEV_RULES_PATH=$TMPDIR/etc/udev/rules.d - # This is for `setuid=`, and needs root permission anyway. - # No need to use the SUID wrapper. - substituteInPlace util/mount.fuse.c \ - --replace-fail '"su"' '"${lib.getBin shadow.su}/bin/su"' - ''; + # This is for `setuid=`, and needs root permission anyway. + # No need to use the SUID wrapper. + substituteInPlace util/mount.fuse.c \ + --replace-fail '"su"' '"${lib.getBin shadow.su}/bin/su"' + ''; # v2: no tests, v3: all tests get skipped in a sandbox doCheck = false; diff --git a/pkgs/os-specific/linux/guvcview/default.nix b/pkgs/os-specific/linux/guvcview/default.nix index 3920ff0938cf..d5d16ff3066c 100644 --- a/pkgs/os-specific/linux/guvcview/default.nix +++ b/pkgs/os-specific/linux/guvcview/default.nix @@ -36,40 +36,37 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-0q3HznYpYehTw+FrURutYVBEktEvPi634w2kovet5a8="; }; - nativeBuildInputs = - [ - intltool - pkg-config - cmake - ] - ++ lib.optionals useGtk [ wrapGAppsHook3 ] - ++ lib.optionals useQt [ wrapQtAppsHook ]; + nativeBuildInputs = [ + intltool + pkg-config + cmake + ] + ++ lib.optionals useGtk [ wrapGAppsHook3 ] + ++ lib.optionals useQt [ wrapQtAppsHook ]; - buildInputs = - [ - SDL2 - alsa-lib - ffmpeg - libusb1 - libv4l - portaudio - udev - gsl - libpng - sfml_2 - ] - ++ lib.optionals pulseaudioSupport [ libpulseaudio ] - ++ lib.optionals useGtk [ gtk3 ] - ++ lib.optionals useQt [ - qtbase - ]; + buildInputs = [ + SDL2 + alsa-lib + ffmpeg + libusb1 + libv4l + portaudio + udev + gsl + libpng + sfml_2 + ] + ++ lib.optionals pulseaudioSupport [ libpulseaudio ] + ++ lib.optionals useGtk [ gtk3 ] + ++ lib.optionals useQt [ + qtbase + ]; - configureFlags = - [ - "--enable-sfml" - ] - ++ lib.optionals useGtk [ "--enable-gtk3" ] - ++ lib.optionals useQt [ "--enable-qt5" ]; + configureFlags = [ + "--enable-sfml" + ] + ++ lib.optionals useGtk [ "--enable-gtk3" ] + ++ lib.optionals useQt [ "--enable-qt5" ]; meta = { description = "Simple interface for devices supported by the linux UVC driver"; diff --git a/pkgs/os-specific/linux/iptables/default.nix b/pkgs/os-specific/linux/iptables/default.nix index a37b6cb4ac95..aebb616eb39d 100644 --- a/pkgs/os-specific/linux/iptables/default.nix +++ b/pkgs/os-specific/linux/iptables/default.nix @@ -53,7 +53,8 @@ stdenv.mkDerivation rec { "--enable-libipq" "--enable-nfsynproxy" "--enable-shared" - ] ++ lib.optional (!nftablesCompat) "--disable-nftables"; + ] + ++ lib.optional (!nftablesCompat) "--disable-nftables"; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix index 51c10e41a68c..bbd957a4f46b 100644 --- a/pkgs/os-specific/linux/iputils/default.nix +++ b/pkgs/os-specific/linux/iputils/default.nix @@ -34,15 +34,14 @@ stdenv.mkDerivation rec { # /build/source/build/ping/ping: socket: Operation not permitted doCheck = false; - mesonFlags = - [ - "-DNO_SETCAP_OR_SUID=true" - "-Dsystemdunitdir=etc/systemd/system" - "-DINSTALL_SYSTEMD_UNITS=true" - "-DSKIP_TESTS=${lib.boolToString (!doCheck)}" - ] - # Disable idn usage w/musl (https://github.com/iputils/iputils/pull/111): - ++ lib.optional stdenv.hostPlatform.isMusl "-DUSE_IDN=false"; + mesonFlags = [ + "-DNO_SETCAP_OR_SUID=true" + "-Dsystemdunitdir=etc/systemd/system" + "-DINSTALL_SYSTEMD_UNITS=true" + "-DSKIP_TESTS=${lib.boolToString (!doCheck)}" + ] + # Disable idn usage w/musl (https://github.com/iputils/iputils/pull/111): + ++ lib.optional stdenv.hostPlatform.isMusl "-DUSE_IDN=false"; nativeBuildInputs = [ meson diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index f96047724475..371eb343f74d 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -58,20 +58,19 @@ let # We do this so we have a build->build, not build->host, C compiler. depsBuildBuild = [ buildPackages.stdenv.cc ]; # `elf-header` is null when libc provides `elf.h`. - nativeBuildInputs = - [ - perl - elf-header - ] - ++ lib.optionals stdenvNoCC.hostPlatform.isAndroid [ - bison - flex - rsync - ] - ++ lib.optionals (stdenvNoCC.buildPlatform.isDarwin && stdenvNoCC.hostPlatform.isMips) [ - darwin-endian-h - darwin-byteswap-h - ]; + nativeBuildInputs = [ + perl + elf-header + ] + ++ lib.optionals stdenvNoCC.hostPlatform.isAndroid [ + bison + flex + rsync + ] + ++ lib.optionals (stdenvNoCC.buildPlatform.isDarwin && stdenvNoCC.hostPlatform.isMips) [ + darwin-endian-h + darwin-byteswap-h + ]; extraIncludeDirs = lib.optionals (with stdenvNoCC.hostPlatform; isPower && is32bit && isBigEndian) [ "ppc" @@ -119,17 +118,16 @@ let # but rsync depends on popt which does not compile on aarch64 without # updateAutotoolsGnuConfigScriptsHook which is not enabled in stage2, # so we replicate it with cp. This also reduces bootstrap closure size. - installPhase = - '' - mkdir -p $out - cp -r usr/include $out - find $out -type f ! -name '*.h' -delete - '' - # Some builds (e.g. KVM) want a kernel.release. - + '' - mkdir -p $out/include/config - echo "${version}-default" > $out/include/config/kernel.release - ''; + installPhase = '' + mkdir -p $out + cp -r usr/include $out + find $out -type f ! -name '*.h' -delete + '' + # Some builds (e.g. KVM) want a kernel.release. + + '' + mkdir -p $out/include/config + echo "${version}-default" > $out/include/config/kernel.release + ''; meta = { description = "Header files and scripts for Linux kernel"; diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 4a6d742f6057..99a187200997 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -117,93 +117,92 @@ let MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT = whenAtLeast "6.10" yes; }; - power-management = - { - CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = yes; - CPU_FREQ_GOV_SCHEDUTIL = yes; - PM_DEBUG = yes; - PM_ADVANCED_DEBUG = yes; - PM_WAKELOCKS = yes; - POWERCAP = yes; - # ACPI Firmware Performance Data Table Support - ACPI_FPDT = whenAtLeast "5.12" (option yes); - # ACPI Heterogeneous Memory Attribute Table Support - ACPI_HMAT = option yes; - # ACPI Platform Error Interface - ACPI_APEI = (option yes); - # APEI Generic Hardware Error Source - ACPI_APEI_GHES = (option yes); + power-management = { + CPU_FREQ_DEFAULT_GOV_SCHEDUTIL = yes; + CPU_FREQ_GOV_SCHEDUTIL = yes; + PM_DEBUG = yes; + PM_ADVANCED_DEBUG = yes; + PM_WAKELOCKS = yes; + POWERCAP = yes; + # ACPI Firmware Performance Data Table Support + ACPI_FPDT = whenAtLeast "5.12" (option yes); + # ACPI Heterogeneous Memory Attribute Table Support + ACPI_HMAT = option yes; + # ACPI Platform Error Interface + ACPI_APEI = (option yes); + # APEI Generic Hardware Error Source + ACPI_APEI_GHES = (option yes); - # Without this, on some hardware the kernel fails at some - # point after the EFI stub has executed but before a console - # is set up. Regardless, it's good to have the extra debug - # anyway. - ACPI_DEBUG = yes; + # Without this, on some hardware the kernel fails at some + # point after the EFI stub has executed but before a console + # is set up. Regardless, it's good to have the extra debug + # anyway. + ACPI_DEBUG = yes; - # Enable lazy RCUs for power savings: - # https://lore.kernel.org/rcu/20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1/ - # RCU_LAZY depends on RCU_NOCB_CPU depends on NO_HZ_FULL - # depends on HAVE_VIRT_CPU_ACCOUNTING_GEN depends on 64BIT, - # so we can't force-enable this - RCU_LAZY = whenAtLeast "6.2" (option yes); + # Enable lazy RCUs for power savings: + # https://lore.kernel.org/rcu/20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1/ + # RCU_LAZY depends on RCU_NOCB_CPU depends on NO_HZ_FULL + # depends on HAVE_VIRT_CPU_ACCOUNTING_GEN depends on 64BIT, + # so we can't force-enable this + RCU_LAZY = whenAtLeast "6.2" (option yes); - # Auto suspend Bluetooth devices at idle - BT_HCIBTUSB_AUTOSUSPEND = yes; + # Auto suspend Bluetooth devices at idle + BT_HCIBTUSB_AUTOSUSPEND = yes; - # Expose cpufreq stats in sysfs - CPU_FREQ_STAT = yes; + # Expose cpufreq stats in sysfs + CPU_FREQ_STAT = yes; - # Enable CPU energy model for scheduling - ENERGY_MODEL = whenAtLeast "5.0" yes; + # Enable CPU energy model for scheduling + ENERGY_MODEL = whenAtLeast "5.0" yes; - # Enable thermal interface netlink API - THERMAL_NETLINK = whenAtLeast "5.9" yes; + # Enable thermal interface netlink API + THERMAL_NETLINK = whenAtLeast "5.9" yes; - # Prefer power-efficient workqueue implementation to per-CPU workqueues, - # which is slightly slower, but improves battery life. - # This is opt-in per workqueue, and can be disabled globally with a kernel command line option. - WQ_POWER_EFFICIENT_DEFAULT = yes; + # Prefer power-efficient workqueue implementation to per-CPU workqueues, + # which is slightly slower, but improves battery life. + # This is opt-in per workqueue, and can be disabled globally with a kernel command line option. + WQ_POWER_EFFICIENT_DEFAULT = yes; - # Default SATA link power management to "medium with device initiated PM" - # for some extra power savings. - SATA_MOBILE_LPM_POLICY = whenAtLeast "5.18" (freeform "3"); + # Default SATA link power management to "medium with device initiated PM" + # for some extra power savings. + SATA_MOBILE_LPM_POLICY = whenAtLeast "5.18" (freeform "3"); - # GPIO power management - POWER_RESET_GPIO = option yes; - POWER_RESET_GPIO_RESTART = option yes; + # GPIO power management + POWER_RESET_GPIO = option yes; + POWER_RESET_GPIO_RESTART = option yes; - # Enable Pulse-Width-Modulation support, commonly used for fan and backlight. - PWM = yes; - } - // lib.optionalAttrs (stdenv.hostPlatform.isx86) { - INTEL_IDLE = yes; - INTEL_RAPL = module; - X86_INTEL_LPSS = yes; - X86_INTEL_PSTATE = yes; - X86_AMD_PSTATE = whenAtLeast "5.17" yes; - # Intel DPTF (Dynamic Platform and Thermal Framework) Support - ACPI_DPTF = whenAtLeast "5.10" yes; + # Enable Pulse-Width-Modulation support, commonly used for fan and backlight. + PWM = yes; + } + // lib.optionalAttrs (stdenv.hostPlatform.isx86) { + INTEL_IDLE = yes; + INTEL_RAPL = module; + X86_INTEL_LPSS = yes; + X86_INTEL_PSTATE = yes; + X86_AMD_PSTATE = whenAtLeast "5.17" yes; + # Intel DPTF (Dynamic Platform and Thermal Framework) Support + ACPI_DPTF = whenAtLeast "5.10" yes; - # Required to bring up some Bay Trail devices properly - I2C = yes; - I2C_DESIGNWARE_CORE = yes; - I2C_DESIGNWARE_PLATFORM = yes; - PMIC_OPREGION = whenAtLeast "5.10" yes; - INTEL_SOC_PMIC = whenAtLeast "5.10" yes; - BYTCRC_PMIC_OPREGION = whenAtLeast "5.10" yes; - CHTCRC_PMIC_OPREGION = whenAtLeast "5.10" yes; - XPOWER_PMIC_OPREGION = whenAtLeast "5.10" yes; - BXT_WC_PMIC_OPREGION = whenAtLeast "5.10" yes; - INTEL_SOC_PMIC_CHTWC = whenAtLeast "5.10" yes; - CHT_WC_PMIC_OPREGION = whenAtLeast "5.10" yes; - INTEL_SOC_PMIC_CHTDC_TI = whenAtLeast "5.10" yes; - CHT_DC_TI_PMIC_OPREGION = whenAtLeast "5.10" yes; - MFD_TPS68470 = whenBetween "5.10" "5.13" yes; - TPS68470_PMIC_OPREGION = whenAtLeast "5.10" yes; + # Required to bring up some Bay Trail devices properly + I2C = yes; + I2C_DESIGNWARE_CORE = yes; + I2C_DESIGNWARE_PLATFORM = yes; + PMIC_OPREGION = whenAtLeast "5.10" yes; + INTEL_SOC_PMIC = whenAtLeast "5.10" yes; + BYTCRC_PMIC_OPREGION = whenAtLeast "5.10" yes; + CHTCRC_PMIC_OPREGION = whenAtLeast "5.10" yes; + XPOWER_PMIC_OPREGION = whenAtLeast "5.10" yes; + BXT_WC_PMIC_OPREGION = whenAtLeast "5.10" yes; + INTEL_SOC_PMIC_CHTWC = whenAtLeast "5.10" yes; + CHT_WC_PMIC_OPREGION = whenAtLeast "5.10" yes; + INTEL_SOC_PMIC_CHTDC_TI = whenAtLeast "5.10" yes; + CHT_DC_TI_PMIC_OPREGION = whenAtLeast "5.10" yes; + MFD_TPS68470 = whenBetween "5.10" "5.13" yes; + TPS68470_PMIC_OPREGION = whenAtLeast "5.10" yes; - # Enable Intel thermal hardware feedback - INTEL_HFI_THERMAL = whenAtLeast "5.18" yes; - }; + # Enable Intel thermal hardware feedback + INTEL_HFI_THERMAL = whenAtLeast "5.18" yes; + }; external-firmware = { # Support drivers that need external firmware. @@ -222,27 +221,26 @@ let CC_OPTIMIZE_FOR_SIZE = no; }; - memory = - { - DAMON = whenAtLeast "5.15" yes; - DAMON_VADDR = whenAtLeast "5.15" yes; - DAMON_PADDR = whenAtLeast "5.16" yes; - DAMON_SYSFS = whenAtLeast "5.18" yes; - DAMON_DBGFS = whenBetween "5.15" "6.9" yes; - DAMON_RECLAIM = whenAtLeast "5.16" yes; - DAMON_LRU_SORT = whenAtLeast "6.0" yes; - # Support recovering from memory failures on systems with ECC and MCA recovery. - MEMORY_FAILURE = yes; + memory = { + DAMON = whenAtLeast "5.15" yes; + DAMON_VADDR = whenAtLeast "5.15" yes; + DAMON_PADDR = whenAtLeast "5.16" yes; + DAMON_SYSFS = whenAtLeast "5.18" yes; + DAMON_DBGFS = whenBetween "5.15" "6.9" yes; + DAMON_RECLAIM = whenAtLeast "5.16" yes; + DAMON_LRU_SORT = whenAtLeast "6.0" yes; + # Support recovering from memory failures on systems with ECC and MCA recovery. + MEMORY_FAILURE = yes; - # Collect ECC errors and retire pages that fail too often - RAS_CEC = lib.mkIf stdenv.hostPlatform.isx86 yes; - } - // lib.optionalAttrs (stdenv.hostPlatform.is32bit) { - # Enable access to the full memory range (aka PAE) on 32-bit architectures - # This check isn't super accurate but it's close enough - HIGHMEM = option yes; - BOUNCE = option yes; - }; + # Collect ECC errors and retire pages that fail too often + RAS_CEC = lib.mkIf stdenv.hostPlatform.isx86 yes; + } + // lib.optionalAttrs (stdenv.hostPlatform.is32bit) { + # Enable access to the full memory range (aka PAE) on 32-bit architectures + # This check isn't super accurate but it's close enough + HIGHMEM = option yes; + BOUNCE = option yes; + }; memtest = { MEMTEST = yes; @@ -277,139 +275,138 @@ let NUMA_BALANCING = option yes; }; - networking = - { - NET = yes; - IP_ADVANCED_ROUTER = yes; - IP_PNP = no; - IP_ROUTE_MULTIPATH = yes; - IP_VS_PROTO_TCP = yes; - IP_VS_PROTO_UDP = yes; - IP_VS_PROTO_ESP = yes; - IP_VS_PROTO_AH = yes; - IP_VS_IPV6 = yes; - IP_DCCP_CCID3 = whenOlder "6.16" no; # experimental - CLS_U32_PERF = yes; - CLS_U32_MARK = yes; - BPF_JIT = whenPlatformHasEBPFJit yes; - BPF_JIT_ALWAYS_ON = whenPlatformHasEBPFJit no; # whenPlatformHasEBPFJit yes; # see https://github.com/NixOS/nixpkgs/issues/79304 - HAVE_EBPF_JIT = whenPlatformHasEBPFJit yes; - BPF_STREAM_PARSER = yes; - XDP_SOCKETS = yes; - XDP_SOCKETS_DIAG = yes; - WAN = yes; - TCP_CONG_ADVANCED = yes; - TCP_CONG_CUBIC = yes; # This is the default congestion control algorithm since 2.6.19 - # Required by systemd per-cgroup firewalling - CGROUP_BPF = option yes; - CGROUP_NET_PRIO = yes; # Required by systemd - IP_ROUTE_VERBOSE = yes; - IP_MROUTE = yes; - IP_MROUTE_MULTIPLE_TABLES = yes; - IP_MULTICAST = yes; - IP_MULTIPLE_TABLES = yes; - IPV6 = yes; - IPV6_ROUTER_PREF = yes; - IPV6_ROUTE_INFO = yes; - IPV6_OPTIMISTIC_DAD = yes; - IPV6_MULTIPLE_TABLES = yes; - IPV6_SUBTREES = yes; - IPV6_MROUTE = yes; - IPV6_MROUTE_MULTIPLE_TABLES = yes; - IPV6_PIMSM_V2 = yes; - IPV6_FOU_TUNNEL = module; - IPV6_SEG6_LWTUNNEL = yes; - IPV6_SEG6_HMAC = yes; - IPV6_SEG6_BPF = yes; - NET_CLS_BPF = module; - NET_ACT_BPF = module; - NET_SCHED = yes; - L2TP_V3 = yes; - L2TP_IP = module; - L2TP_ETH = module; - BRIDGE_VLAN_FILTERING = yes; - BONDING = module; - NET_L3_MASTER_DEV = option yes; - NET_FOU_IP_TUNNELS = option yes; - IP_NF_TARGET_REDIRECT = module; - NETKIT = whenAtLeast "6.7" yes; + networking = { + NET = yes; + IP_ADVANCED_ROUTER = yes; + IP_PNP = no; + IP_ROUTE_MULTIPATH = yes; + IP_VS_PROTO_TCP = yes; + IP_VS_PROTO_UDP = yes; + IP_VS_PROTO_ESP = yes; + IP_VS_PROTO_AH = yes; + IP_VS_IPV6 = yes; + IP_DCCP_CCID3 = whenOlder "6.16" no; # experimental + CLS_U32_PERF = yes; + CLS_U32_MARK = yes; + BPF_JIT = whenPlatformHasEBPFJit yes; + BPF_JIT_ALWAYS_ON = whenPlatformHasEBPFJit no; # whenPlatformHasEBPFJit yes; # see https://github.com/NixOS/nixpkgs/issues/79304 + HAVE_EBPF_JIT = whenPlatformHasEBPFJit yes; + BPF_STREAM_PARSER = yes; + XDP_SOCKETS = yes; + XDP_SOCKETS_DIAG = yes; + WAN = yes; + TCP_CONG_ADVANCED = yes; + TCP_CONG_CUBIC = yes; # This is the default congestion control algorithm since 2.6.19 + # Required by systemd per-cgroup firewalling + CGROUP_BPF = option yes; + CGROUP_NET_PRIO = yes; # Required by systemd + IP_ROUTE_VERBOSE = yes; + IP_MROUTE = yes; + IP_MROUTE_MULTIPLE_TABLES = yes; + IP_MULTICAST = yes; + IP_MULTIPLE_TABLES = yes; + IPV6 = yes; + IPV6_ROUTER_PREF = yes; + IPV6_ROUTE_INFO = yes; + IPV6_OPTIMISTIC_DAD = yes; + IPV6_MULTIPLE_TABLES = yes; + IPV6_SUBTREES = yes; + IPV6_MROUTE = yes; + IPV6_MROUTE_MULTIPLE_TABLES = yes; + IPV6_PIMSM_V2 = yes; + IPV6_FOU_TUNNEL = module; + IPV6_SEG6_LWTUNNEL = yes; + IPV6_SEG6_HMAC = yes; + IPV6_SEG6_BPF = yes; + NET_CLS_BPF = module; + NET_ACT_BPF = module; + NET_SCHED = yes; + L2TP_V3 = yes; + L2TP_IP = module; + L2TP_ETH = module; + BRIDGE_VLAN_FILTERING = yes; + BONDING = module; + NET_L3_MASTER_DEV = option yes; + NET_FOU_IP_TUNNELS = option yes; + IP_NF_TARGET_REDIRECT = module; + NETKIT = whenAtLeast "6.7" yes; - PPP_MULTILINK = yes; # PPP multilink support - PPP_FILTER = yes; + PPP_MULTILINK = yes; # PPP multilink support + PPP_FILTER = yes; - # needed for iwd WPS support (wpa_supplicant replacement) - KEY_DH_OPERATIONS = yes; + # needed for iwd WPS support (wpa_supplicant replacement) + KEY_DH_OPERATIONS = yes; - # needed for nftables - # Networking Options - NETFILTER = yes; - NETFILTER_ADVANCED = yes; - # Core Netfilter Configuration - NF_CONNTRACK_ZONES = yes; - NF_CONNTRACK_EVENTS = yes; - NF_CONNTRACK_TIMEOUT = yes; - NF_CONNTRACK_TIMESTAMP = yes; - NETFILTER_NETLINK_GLUE_CT = yes; - NF_TABLES_INET = yes; - NF_TABLES_NETDEV = yes; - NFT_REJECT_NETDEV = whenAtLeast "5.11" module; + # needed for nftables + # Networking Options + NETFILTER = yes; + NETFILTER_ADVANCED = yes; + # Core Netfilter Configuration + NF_CONNTRACK_ZONES = yes; + NF_CONNTRACK_EVENTS = yes; + NF_CONNTRACK_TIMEOUT = yes; + NF_CONNTRACK_TIMESTAMP = yes; + NETFILTER_NETLINK_GLUE_CT = yes; + NF_TABLES_INET = yes; + NF_TABLES_NETDEV = yes; + NFT_REJECT_NETDEV = whenAtLeast "5.11" module; - # IP: Netfilter Configuration - NF_TABLES_IPV4 = yes; - NF_TABLES_ARP = yes; - # IPv6: Netfilter Configuration - NF_TABLES_IPV6 = yes; - # Bridge Netfilter Configuration - NF_TABLES_BRIDGE = module; - # Expose some debug info - NF_CONNTRACK_PROCFS = yes; - NF_FLOW_TABLE_PROCFS = whenAtLeast "6.0" yes; + # IP: Netfilter Configuration + NF_TABLES_IPV4 = yes; + NF_TABLES_ARP = yes; + # IPv6: Netfilter Configuration + NF_TABLES_IPV6 = yes; + # Bridge Netfilter Configuration + NF_TABLES_BRIDGE = module; + # Expose some debug info + NF_CONNTRACK_PROCFS = yes; + NF_FLOW_TABLE_PROCFS = whenAtLeast "6.0" yes; - # needed for `dropwatch` - # Builtin-only since https://github.com/torvalds/linux/commit/f4b6bcc7002f0e3a3428bac33cf1945abff95450 - NET_DROP_MONITOR = yes; + # needed for `dropwatch` + # Builtin-only since https://github.com/torvalds/linux/commit/f4b6bcc7002f0e3a3428bac33cf1945abff95450 + NET_DROP_MONITOR = yes; - # needed for ss - # Use a lower priority to allow these options to be overridden in hardened/config.nix - INET_DIAG = lib.mkDefault module; - INET_TCP_DIAG = lib.mkDefault module; - INET_UDP_DIAG = lib.mkDefault module; - INET_RAW_DIAG = lib.mkDefault module; - INET_DIAG_DESTROY = lib.mkDefault yes; + # needed for ss + # Use a lower priority to allow these options to be overridden in hardened/config.nix + INET_DIAG = lib.mkDefault module; + INET_TCP_DIAG = lib.mkDefault module; + INET_UDP_DIAG = lib.mkDefault module; + INET_RAW_DIAG = lib.mkDefault module; + INET_DIAG_DESTROY = lib.mkDefault yes; - # IPsec over TCP - INET_ESPINTCP = whenAtLeast "5.8" yes; - INET6_ESPINTCP = whenAtLeast "5.8" yes; + # IPsec over TCP + INET_ESPINTCP = whenAtLeast "5.8" yes; + INET6_ESPINTCP = whenAtLeast "5.8" yes; - # enable multipath-tcp - MPTCP = whenAtLeast "5.6" yes; - MPTCP_IPV6 = whenAtLeast "5.6" yes; - INET_MPTCP_DIAG = whenAtLeast "5.9" (lib.mkDefault module); + # enable multipath-tcp + MPTCP = whenAtLeast "5.6" yes; + MPTCP_IPV6 = whenAtLeast "5.6" yes; + INET_MPTCP_DIAG = whenAtLeast "5.9" (lib.mkDefault module); - # Kernel TLS - TLS = module; - TLS_DEVICE = yes; + # Kernel TLS + TLS = module; + TLS_DEVICE = yes; - # infiniband - INFINIBAND = module; - INFINIBAND_IPOIB = module; - INFINIBAND_IPOIB_CM = yes; + # infiniband + INFINIBAND = module; + INFINIBAND_IPOIB = module; + INFINIBAND_IPOIB_CM = yes; - # Enable debugfs for wireless drivers - CFG80211_DEBUGFS = yes; - MAC80211_DEBUGFS = yes; + # Enable debugfs for wireless drivers + CFG80211_DEBUGFS = yes; + MAC80211_DEBUGFS = yes; - # HAM radio - HAMRADIO = yes; - AX25 = module; - } - // lib.optionalAttrs (stdenv.hostPlatform.system == "aarch64-linux") { - # Not enabled by default, hides modules behind it - NET_VENDOR_MEDIATEK = yes; - # Enable SoC interface for MT7915 module, required for MT798X. - MT7986_WMAC = whenBetween "5.18" "6.6" yes; - MT798X_WMAC = whenAtLeast "6.6" yes; - }; + # HAM radio + HAMRADIO = yes; + AX25 = module; + } + // lib.optionalAttrs (stdenv.hostPlatform.system == "aarch64-linux") { + # Not enabled by default, hides modules behind it + NET_VENDOR_MEDIATEK = yes; + # Enable SoC interface for MT7915 module, required for MT798X. + MT7986_WMAC = whenBetween "5.18" "6.6" yes; + MT798X_WMAC = whenAtLeast "6.6" yes; + }; wireless = { CFG80211_WEXT = option yes; # Without it, ipw2200 drivers don't build @@ -591,28 +588,27 @@ let DRM_PANIC_SCREEN_QR_CODE = whenAtLeast "6.12" yes; }; - sound = - { - SND_DYNAMIC_MINORS = yes; - SND_AC97_POWER_SAVE = yes; # AC97 Power-Saving Mode - # 10s for the idle timeout, Fedora does 1, Arch does 10. - # The kernel says we should do 10. - # Read: https://docs.kernel.org/sound/designs/powersave.html - SND_AC97_POWER_SAVE_DEFAULT = freeform "10"; - SND_HDA_POWER_SAVE_DEFAULT = freeform "10"; - SND_HDA_INPUT_BEEP = yes; # Support digital beep via input layer - SND_HDA_RECONFIG = yes; # Support reconfiguration of jack functions - # Support configuring jack functions via fw mechanism at boot - SND_HDA_PATCH_LOADER = yes; - SND_HDA_CODEC_CA0132_DSP = whenOlder "5.7" yes; # Enable DSP firmware loading on Creative Soundblaster Z/Zx/ZxR/Recon - SND_HDA_CODEC_CS8409 = whenAtLeast "6.6" module; # Cirrus Logic HDA Bridge CS8409 - SND_OSSEMUL = yes; - SND_USB_CAIAQ_INPUT = yes; - SND_USB_AUDIO_MIDI_V2 = whenAtLeast "6.5" yes; - # Enable Sound Open Firmware support - } - // lib.optionalAttrs - (stdenv.hostPlatform.system == "x86_64-linux" && lib.versionAtLeast version "5.5") + sound = { + SND_DYNAMIC_MINORS = yes; + SND_AC97_POWER_SAVE = yes; # AC97 Power-Saving Mode + # 10s for the idle timeout, Fedora does 1, Arch does 10. + # The kernel says we should do 10. + # Read: https://docs.kernel.org/sound/designs/powersave.html + SND_AC97_POWER_SAVE_DEFAULT = freeform "10"; + SND_HDA_POWER_SAVE_DEFAULT = freeform "10"; + SND_HDA_INPUT_BEEP = yes; # Support digital beep via input layer + SND_HDA_RECONFIG = yes; # Support reconfiguration of jack functions + # Support configuring jack functions via fw mechanism at boot + SND_HDA_PATCH_LOADER = yes; + SND_HDA_CODEC_CA0132_DSP = whenOlder "5.7" yes; # Enable DSP firmware loading on Creative Soundblaster Z/Zx/ZxR/Recon + SND_HDA_CODEC_CS8409 = whenAtLeast "6.6" module; # Cirrus Logic HDA Bridge CS8409 + SND_OSSEMUL = yes; + SND_USB_CAIAQ_INPUT = yes; + SND_USB_AUDIO_MIDI_V2 = whenAtLeast "6.5" yes; + # Enable Sound Open Firmware support + } + // + lib.optionalAttrs (stdenv.hostPlatform.system == "x86_64-linux" && lib.versionAtLeast version "5.5") { SND_SOC_INTEL_SOUNDWIRE_SOF_MACH = whenAtLeast "5.10" module; SND_SOC_INTEL_USER_FRIENDLY_LONG_NAMES = whenAtLeast "5.10" yes; # dep of SOF_MACH @@ -766,109 +762,108 @@ let UNICODE = yes; # Casefolding support for filesystems }; - security = - { - # Report BUG() conditions and kill the offending process. - BUG = yes; - BUG_ON_DATA_CORRUPTION = yes; + security = { + # Report BUG() conditions and kill the offending process. + BUG = yes; + BUG_ON_DATA_CORRUPTION = yes; - FORTIFY_SOURCE = option yes; + FORTIFY_SOURCE = option yes; - # https://googleprojectzero.blogspot.com/2019/11/bad-binder-android-in-wild-exploit.html - DEBUG_LIST = yes; + # https://googleprojectzero.blogspot.com/2019/11/bad-binder-android-in-wild-exploit.html + DEBUG_LIST = yes; - HARDENED_USERCOPY = yes; - RANDOMIZE_BASE = option yes; - STRICT_KERNEL_RWX = yes; - STRICT_MODULE_RWX = yes; - STRICT_DEVMEM = lib.mkDefault yes; # Filter access to /dev/mem - IO_STRICT_DEVMEM = lib.mkDefault yes; + HARDENED_USERCOPY = yes; + RANDOMIZE_BASE = option yes; + STRICT_KERNEL_RWX = yes; + STRICT_MODULE_RWX = yes; + STRICT_DEVMEM = lib.mkDefault yes; # Filter access to /dev/mem + IO_STRICT_DEVMEM = lib.mkDefault yes; - # Prevent processes from ptracing non-children processes - SECURITY_YAMA = option yes; - # The goal of Landlock is to enable to restrict ambient rights (e.g. global filesystem access) for a set of processes. - # This does not have any effect if a program does not support it - SECURITY_LANDLOCK = whenAtLeast "5.13" yes; + # Prevent processes from ptracing non-children processes + SECURITY_YAMA = option yes; + # The goal of Landlock is to enable to restrict ambient rights (e.g. global filesystem access) for a set of processes. + # This does not have any effect if a program does not support it + SECURITY_LANDLOCK = whenAtLeast "5.13" yes; - DEVKMEM = lib.mkIf (!stdenv.hostPlatform.isAarch64) (whenOlder "5.13" no); # Disable /dev/kmem + DEVKMEM = lib.mkIf (!stdenv.hostPlatform.isAarch64) (whenOlder "5.13" no); # Disable /dev/kmem - USER_NS = yes; # Support for user namespaces + USER_NS = yes; # Support for user namespaces - SECURITY_APPARMOR = yes; - DEFAULT_SECURITY_APPARMOR = yes; + SECURITY_APPARMOR = yes; + DEFAULT_SECURITY_APPARMOR = yes; - SECURITY_DMESG_RESTRICT = yes; + SECURITY_DMESG_RESTRICT = yes; - RANDOM_TRUST_CPU = whenOlder "6.2" yes; # allow RDRAND to seed the RNG - RANDOM_TRUST_BOOTLOADER = whenOlder "6.2" yes; # allow the bootloader to seed the RNG + RANDOM_TRUST_CPU = whenOlder "6.2" yes; # allow RDRAND to seed the RNG + RANDOM_TRUST_BOOTLOADER = whenOlder "6.2" yes; # allow the bootloader to seed the RNG - MODULE_SIG = no; # r13y, generates a random key during build and bakes it in - # Depends on MODULE_SIG and only really helps when you sign your modules - # and enforce signatures which we don't do by default. - SECURITY_LOCKDOWN_LSM = no; + MODULE_SIG = no; # r13y, generates a random key during build and bakes it in + # Depends on MODULE_SIG and only really helps when you sign your modules + # and enforce signatures which we don't do by default. + SECURITY_LOCKDOWN_LSM = no; - # provides a register of persistent per-UID keyrings, useful for encrypting storage pools in stratis - PERSISTENT_KEYRINGS = yes; - # enable temporary caching of the last request_key() result - KEYS_REQUEST_CACHE = yes; - # randomized slab caches - RANDOM_KMALLOC_CACHES = whenAtLeast "6.6" yes; + # provides a register of persistent per-UID keyrings, useful for encrypting storage pools in stratis + PERSISTENT_KEYRINGS = yes; + # enable temporary caching of the last request_key() result + KEYS_REQUEST_CACHE = yes; + # randomized slab caches + RANDOM_KMALLOC_CACHES = whenAtLeast "6.6" yes; - # NIST SP800-90A DRBG modes - enabled by most distributions - # and required by some out-of-tree modules (ShuffleCake) - # This does not include the NSA-backdoored Dual-EC mode from the same NIST publication. - CRYPTO_DRBG_HASH = yes; - CRYPTO_DRBG_CTR = yes; + # NIST SP800-90A DRBG modes - enabled by most distributions + # and required by some out-of-tree modules (ShuffleCake) + # This does not include the NSA-backdoored Dual-EC mode from the same NIST publication. + CRYPTO_DRBG_HASH = yes; + CRYPTO_DRBG_CTR = yes; - # Enable KFENCE - # See: https://docs.kernel.org/dev-tools/kfence.html - KFENCE = whenAtLeast "5.12" yes; + # Enable KFENCE + # See: https://docs.kernel.org/dev-tools/kfence.html + KFENCE = whenAtLeast "5.12" yes; - # Enable support for page poisoning. Still needs to be enabled on the command line to actually work. - PAGE_POISONING = yes; - # Randomize page allocator when page_alloc.shuffle=1 - SHUFFLE_PAGE_ALLOCATOR = yes; + # Enable support for page poisoning. Still needs to be enabled on the command line to actually work. + PAGE_POISONING = yes; + # Randomize page allocator when page_alloc.shuffle=1 + SHUFFLE_PAGE_ALLOCATOR = yes; - INIT_ON_ALLOC_DEFAULT_ON = yes; + INIT_ON_ALLOC_DEFAULT_ON = yes; - # Enable stack smashing protections in schedule() - # See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.8&id=0d9e26329b0c9263d4d9e0422d80a0e73268c52f - SCHED_STACK_END_CHECK = yes; + # Enable stack smashing protections in schedule() + # See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.8&id=0d9e26329b0c9263d4d9e0422d80a0e73268c52f + SCHED_STACK_END_CHECK = yes; - # Enable separate slab buckets for user controlled allocations - # See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67f2df3b82d091ed095d0e47e1f3a9d3e18e4e41 - SLAB_BUCKETS = whenAtLeast "6.11" yes; - } - // lib.optionalAttrs stdenv.hostPlatform.isx86_64 { - # Enable Intel SGX - X86_SGX = whenAtLeast "5.11" yes; - # Allow KVM guests to load SGX enclaves - X86_SGX_KVM = whenAtLeast "5.13" yes; + # Enable separate slab buckets for user controlled allocations + # See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67f2df3b82d091ed095d0e47e1f3a9d3e18e4e41 + SLAB_BUCKETS = whenAtLeast "6.11" yes; + } + // lib.optionalAttrs stdenv.hostPlatform.isx86_64 { + # Enable Intel SGX + X86_SGX = whenAtLeast "5.11" yes; + # Allow KVM guests to load SGX enclaves + X86_SGX_KVM = whenAtLeast "5.13" yes; - # AMD Cryptographic Coprocessor (CCP) - CRYPTO_DEV_CCP = yes; - # AMD SME - AMD_MEM_ENCRYPT = yes; - # AMD SEV and AMD SEV-SE - KVM_AMD_SEV = yes; - # AMD SEV-SNP - SEV_GUEST = whenAtLeast "5.19" module; - # Shadow stacks - X86_USER_SHADOW_STACK = whenAtLeast "6.6" yes; + # AMD Cryptographic Coprocessor (CCP) + CRYPTO_DEV_CCP = yes; + # AMD SME + AMD_MEM_ENCRYPT = yes; + # AMD SEV and AMD SEV-SE + KVM_AMD_SEV = yes; + # AMD SEV-SNP + SEV_GUEST = whenAtLeast "5.19" module; + # Shadow stacks + X86_USER_SHADOW_STACK = whenAtLeast "6.6" yes; - # Enable support for Intel Trust Domain Extensions (TDX) - INTEL_TDX_GUEST = whenAtLeast "5.19" yes; - TDX_GUEST_DRIVER = whenAtLeast "6.2" module; + # Enable support for Intel Trust Domain Extensions (TDX) + INTEL_TDX_GUEST = whenAtLeast "5.19" yes; + TDX_GUEST_DRIVER = whenAtLeast "6.2" module; - # Mitigate straight line speculation at the cost of some file size - SLS = whenBetween "5.17" "6.9" yes; - MITIGATION_SLS = whenAtLeast "6.9" yes; + # Mitigate straight line speculation at the cost of some file size + SLS = whenBetween "5.17" "6.9" yes; + MITIGATION_SLS = whenAtLeast "6.9" yes; - DEFAULT_MMAP_MIN_ADDR = freeform "65536"; - } - // lib.optionalAttrs stdenv.hostPlatform.isAarch64 { - DEFAULT_MMAP_MIN_ADDR = freeform "32768"; - }; + DEFAULT_MMAP_MIN_ADDR = freeform "65536"; + } + // lib.optionalAttrs stdenv.hostPlatform.isAarch64 { + DEFAULT_MMAP_MIN_ADDR = freeform "32768"; + }; microcode = { MICROCODE = lib.mkIf stdenv.hostPlatform.isx86 yes; @@ -1034,25 +1029,24 @@ let }; # Disable various self-test modules that have no use in a production system - tests = - { - # This menu disables all/most of them on >= 4.16 - RUNTIME_TESTING_MENU = option no; - } - // { - CRC32_SELFTEST = option no; - CRYPTO_TEST = option no; - EFI_TEST = option no; - GLOB_SELFTEST = option no; - LOCK_TORTURE_TEST = option no; - MTD_TESTS = option no; - NOTIFIER_ERROR_INJECTION = option no; - RCU_PERF_TEST = whenOlder "5.9" no; - RCU_SCALE_TEST = whenAtLeast "5.10" no; - TEST_ASYNC_DRIVER_PROBE = option no; - WW_MUTEX_SELFTEST = option no; - XZ_DEC_TEST = option no; - }; + tests = { + # This menu disables all/most of them on >= 4.16 + RUNTIME_TESTING_MENU = option no; + } + // { + CRC32_SELFTEST = option no; + CRYPTO_TEST = option no; + EFI_TEST = option no; + GLOB_SELFTEST = option no; + LOCK_TORTURE_TEST = option no; + MTD_TESTS = option no; + NOTIFIER_ERROR_INJECTION = option no; + RCU_PERF_TEST = whenOlder "5.9" no; + RCU_SCALE_TEST = whenAtLeast "5.10" no; + TEST_ASYNC_DRIVER_PROBE = option no; + WW_MUTEX_SELFTEST = option no; + XZ_DEC_TEST = option no; + }; criu = { # Unconditionally enabled, because it is required for CRIU and diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 71673921d238..65583ad03f29 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -180,20 +180,19 @@ let passAsFile = [ "kernelConfig" ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - perl - gmp - libmpc - mpfr - bison - flex - ] - ++ lib.optional (lib.versionAtLeast version "5.2") pahole - ++ lib.optionals withRust [ - rust-bindgen - rustc - ]; + nativeBuildInputs = [ + perl + gmp + libmpc + mpfr + bison + flex + ] + ++ lib.optional (lib.versionAtLeast version "5.2") pahole + ++ lib.optionals withRust [ + rust-bindgen + rustc + ]; RUST_LIB_SRC = lib.optionalString withRust rustPlatform.rustLibSrc; @@ -208,13 +207,11 @@ let ) stdenv.hostPlatform.linux-kernel.makeFlags ++ extraMakeFlags; - postPatch = - kernel.postPatch - + '' - # Patch kconfig to print "###" after every question so that - # generate-config.pl from the generic builder can answer them. - sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c - ''; + postPatch = kernel.postPatch + '' + # Patch kconfig to print "###" after every question so that + # generate-config.pl from the generic builder can answer them. + sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c + ''; preUnpack = kernel.preUnpack or ""; @@ -250,23 +247,22 @@ let # The result is a set of two attributes moduleStructuredConfig = (lib.evalModules { - modules = - [ - module - ] - ++ lib.optionals enableCommonConfig [ - { - settings = commonStructuredConfig; - _file = "pkgs/os-specific/linux/kernel/common-config.nix"; - } - ] - ++ [ - { - settings = structuredExtraConfig; - _file = "structuredExtraConfig"; - } - ] - ++ structuredConfigFromPatches; + modules = [ + module + ] + ++ lib.optionals enableCommonConfig [ + { + settings = commonStructuredConfig; + _file = "pkgs/os-specific/linux/kernel/common-config.nix"; + } + ] + ++ [ + { + settings = structuredExtraConfig; + _file = "structuredExtraConfig"; + } + ] + ++ structuredConfigFromPatches; }).config; structuredConfig = moduleStructuredConfig.settings; diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix index db13fbdf2426..e9054e140e8e 100644 --- a/pkgs/os-specific/linux/kernel/linux-rpi.nix +++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix @@ -38,7 +38,8 @@ lib.overrideDerivation features = { efiBootStub = false; - } // (args.features or { }); + } + // (args.features or { }); extraMeta = if (rpiVersion < 3) then @@ -64,41 +65,40 @@ lib.overrideDerivation # Make copies of the DTBs named after the upstream names so that U-Boot finds them. # This is ugly as heck, but I don't know a better solution so far. - postFixup = - '' - dtbDir=${if stdenv.hostPlatform.isAarch64 then "$out/dtbs/broadcom" else "$out/dtbs"} - rm $dtbDir/bcm283*.dtb - copyDTB() { - cp -v "$dtbDir/$1" "$dtbDir/$2" - } - '' - + lib.optionalString (lib.elem stdenv.hostPlatform.system [ "armv6l-linux" ]) '' - copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb - copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb - copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb - copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb - copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb - copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb - copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb - copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb - copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb - '' - + lib.optionalString (lib.elem stdenv.hostPlatform.system [ "armv7l-linux" ]) '' - copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb - '' - + - lib.optionalString - (lib.elem stdenv.hostPlatform.system [ - "armv7l-linux" - "aarch64-linux" - ]) - '' - copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb - copyDTB bcm2710-rpi-zero-2-w.dtb bcm2837-rpi-zero-2-w.dtb - copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb - copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb - copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb - copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb - copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb - ''; + postFixup = '' + dtbDir=${if stdenv.hostPlatform.isAarch64 then "$out/dtbs/broadcom" else "$out/dtbs"} + rm $dtbDir/bcm283*.dtb + copyDTB() { + cp -v "$dtbDir/$1" "$dtbDir/$2" + } + '' + + lib.optionalString (lib.elem stdenv.hostPlatform.system [ "armv6l-linux" ]) '' + copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb + copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb + copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb + copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb + copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb + copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb + copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb + copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb + copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb + '' + + lib.optionalString (lib.elem stdenv.hostPlatform.system [ "armv7l-linux" ]) '' + copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb + '' + + + lib.optionalString + (lib.elem stdenv.hostPlatform.system [ + "armv7l-linux" + "aarch64-linux" + ]) + '' + copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb + copyDTB bcm2710-rpi-zero-2-w.dtb bcm2837-rpi-zero-2-w.dtb + copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb + copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb + copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb + copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb + copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb + ''; }) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 16972d20dfd2..c0c6713fc346 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -160,19 +160,18 @@ lib.makeOverridable ( buildDTBs = kernelConf.DTB or false; # Dependencies that are required to build kernel modules - moduleBuildDependencies = - [ - pahole - perl - elfutils - # module makefiles often run uname commands to find out the kernel version - (buildPackages.deterministic-uname.override { inherit modDirVersion; }) - ] - ++ optional (lib.versionAtLeast version "5.13") zstd - ++ optionals withRust [ - rustc - rust-bindgen - ]; + moduleBuildDependencies = [ + pahole + perl + elfutils + # module makefiles often run uname commands to find out the kernel version + (buildPackages.deterministic-uname.override { inherit modDirVersion; }) + ] + ++ optional (lib.versionAtLeast version "5.13") zstd + ++ optionals withRust [ + rustc + rust-bindgen + ]; in (optionalAttrs isModular { @@ -207,33 +206,32 @@ lib.makeOverridable ( inherit src; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - bison - flex - perl - bc - openssl - rsync - gmp - libmpc - mpfr - elfutils - zstd - python3Minimal - kmod - hexdump - ] - ++ optional needsUbootTools ubootTools - ++ optionals (lib.versionAtLeast version "5.2") [ - cpio - pahole - zlib - ] - ++ optionals withRust [ - rustc - rust-bindgen - ]; + nativeBuildInputs = [ + bison + flex + perl + bc + openssl + rsync + gmp + libmpc + mpfr + elfutils + zstd + python3Minimal + kmod + hexdump + ] + ++ optional needsUbootTools ubootTools + ++ optionals (lib.versionAtLeast version "5.2") [ + cpio + pahole + zlib + ] + ++ optionals withRust [ + rustc + rust-bindgen + ]; RUST_LIB_SRC = lib.optionalString withRust rustPlatform.rustLibSrc; @@ -323,28 +321,26 @@ lib.makeOverridable ( cd $buildRoot ''; - buildFlags = - [ - "KBUILD_BUILD_VERSION=1-NixOS" - kernelConf.target - "vmlinux" # for "perf" and things like that - ] - ++ optional isModular "modules" - ++ optionals buildDTBs [ - "dtbs" - "DTC_FLAGS=-@" - ] - ++ extraMakeFlags; + buildFlags = [ + "KBUILD_BUILD_VERSION=1-NixOS" + kernelConf.target + "vmlinux" # for "perf" and things like that + ] + ++ optional isModular "modules" + ++ optionals buildDTBs [ + "dtbs" + "DTC_FLAGS=-@" + ] + ++ extraMakeFlags; - installFlags = - [ - "INSTALL_PATH=$(out)" - ] - ++ (optional isModular "INSTALL_MOD_PATH=$(out)") - ++ optionals buildDTBs [ - "dtbs_install" - "INSTALL_DTBS_PATH=$(out)/dtbs" - ]; + installFlags = [ + "INSTALL_PATH=$(out)" + ] + ++ (optional isModular "INSTALL_MOD_PATH=$(out)") + ++ optionals buildDTBs [ + "dtbs_install" + "INSTALL_DTBS_PATH=$(out)/dtbs" + ]; preInstall = let @@ -531,24 +527,24 @@ lib.makeOverridable ( ] ++ lib.optional (lib.versionOlder version "5.19") "loongarch64-linux"; timeout = 14400; # 4 hours - } // extraMeta; + } + // extraMeta; }; # Absolute paths for compilers avoid any PATH-clobbering issues. - commonMakeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ] - ++ lib.optionals (stdenv.isx86_64 && stdenv.cc.bintools.isLLVM) [ - # The wrapper for ld.lld breaks linking the kernel. We use the - # unwrapped linker as workaround. See: - # - # https://github.com/NixOS/nixpkgs/issues/321667 - "LD=${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ld" - ] - ++ (stdenv.hostPlatform.linux-kernel.makeFlags or [ ]) - ++ extraMakeFlags; + commonMakeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ] + ++ lib.optionals (stdenv.isx86_64 && stdenv.cc.bintools.isLLVM) [ + # The wrapper for ld.lld breaks linking the kernel. We use the + # unwrapped linker as workaround. See: + # + # https://github.com/NixOS/nixpkgs/issues/321667 + "LD=${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ld" + ] + ++ (stdenv.hostPlatform.linux-kernel.makeFlags or [ ]) + ++ extraMakeFlags; in stdenv.mkDerivation ( @@ -570,7 +566,8 @@ lib.makeOverridable ( makeFlags = [ "O=$(buildRoot)" - ] ++ commonMakeFlags; + ] + ++ commonMakeFlags; passthru = { inherit commonMakeFlags; }; diff --git a/pkgs/os-specific/linux/kernel/perf/default.nix b/pkgs/os-specific/linux/kernel/perf/default.nix index 270cb1dbe49d..d0caa28e1432 100644 --- a/pkgs/os-specific/linux/kernel/perf/default.nix +++ b/pkgs/os-specific/linux/kernel/perf/default.nix @@ -72,44 +72,42 @@ stdenv.mkDerivation { ./fix-dmesg-path.diff ]; - postPatch = - '' - # Linux scripts - patchShebangs scripts - patchShebangs tools/perf/check-headers.sh - '' - + lib.optionalString (lib.versionAtLeast kernel.version "6.3") '' - # perf-specific scripts - patchShebangs tools/perf/pmu-events - '' - + '' - cd tools/perf + postPatch = '' + # Linux scripts + patchShebangs scripts + patchShebangs tools/perf/check-headers.sh + '' + + lib.optionalString (lib.versionAtLeast kernel.version "6.3") '' + # perf-specific scripts + patchShebangs tools/perf/pmu-events + '' + + '' + cd tools/perf - for x in util/build-id.c util/dso.c; do - substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug - done + for x in util/build-id.c util/dso.c; do + substituteInPlace $x --replace /usr/lib/debug /run/current-system/sw/lib/debug + done - '' - + lib.optionalString (lib.versionAtLeast kernel.version "5.8") '' - substituteInPlace scripts/python/flamegraph.py \ - --replace "/usr/share/d3-flame-graph/d3-flamegraph-base.html" \ - "${d3-flame-graph-templates}/share/d3-flame-graph/d3-flamegraph-base.html" + '' + + lib.optionalString (lib.versionAtLeast kernel.version "5.8") '' + substituteInPlace scripts/python/flamegraph.py \ + --replace "/usr/share/d3-flame-graph/d3-flamegraph-base.html" \ + "${d3-flame-graph-templates}/share/d3-flame-graph/d3-flamegraph-base.html" - '' - + lib.optionalString (lib.versionAtLeast kernel.version "6.0") '' - patchShebangs pmu-events/jevents.py - ''; + '' + + lib.optionalString (lib.versionAtLeast kernel.version "6.0") '' + patchShebangs pmu-events/jevents.py + ''; - makeFlags = - [ - "prefix=$(out)" - "WERROR=0" - "ASCIIDOC8=1" - ] - ++ kernelModuleMakeFlags - ++ lib.optional (!withGtk) "NO_GTK2=1" - ++ lib.optional (!withZstd) "NO_LIBZSTD=1" - ++ lib.optional (!withLibcap) "NO_LIBCAP=1"; + makeFlags = [ + "prefix=$(out)" + "WERROR=0" + "ASCIIDOC8=1" + ] + ++ kernelModuleMakeFlags + ++ lib.optional (!withGtk) "NO_GTK2=1" + ++ lib.optional (!withZstd) "NO_LIBZSTD=1" + ++ lib.optional (!withLibcap) "NO_LIBCAP=1"; hardeningDisable = [ "format" ]; @@ -129,46 +127,45 @@ stdenv.mkDerivation { python3 ]; - buildInputs = - [ - elfutils - newt - slang - libtraceevent - libunwind - zlib - openssl - numactl - python3 - perl - babeltrace - ] - ++ ( - if (lib.versionAtLeast kernel.version "5.19") then - [ - libbfd - libopcodes - ] - else - [ - libbfd_2_38 - libopcodes_2_38 - ] - ) - ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform systemtap) systemtap.stapBuild - ++ lib.optional withGtk gtk2 - ++ lib.optional withZstd zstd - ++ lib.optional withLibcap libcap - ++ lib.optional (lib.versionAtLeast kernel.version "5.8") libpfm - ++ lib.optional (lib.versionAtLeast kernel.version "6.0") python3.pkgs.setuptools - # Python 3.12 no longer includes distutils, not needed for 6.0 and newer. - ++ - lib.optional - (!(lib.versionAtLeast kernel.version "6.0") && lib.versionAtLeast python3.version "3.12") - [ - python3.pkgs.distutils - python3.pkgs.packaging - ]; + buildInputs = [ + elfutils + newt + slang + libtraceevent + libunwind + zlib + openssl + numactl + python3 + perl + babeltrace + ] + ++ ( + if (lib.versionAtLeast kernel.version "5.19") then + [ + libbfd + libopcodes + ] + else + [ + libbfd_2_38 + libopcodes_2_38 + ] + ) + ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform systemtap) systemtap.stapBuild + ++ lib.optional withGtk gtk2 + ++ lib.optional withZstd zstd + ++ lib.optional withLibcap libcap + ++ lib.optional (lib.versionAtLeast kernel.version "5.8") libpfm + ++ lib.optional (lib.versionAtLeast kernel.version "6.0") python3.pkgs.setuptools + # Python 3.12 no longer includes distutils, not needed for 6.0 and newer. + ++ + lib.optional + (!(lib.versionAtLeast kernel.version "6.0") && lib.versionAtLeast python3.version "3.12") + [ + python3.pkgs.distutils + python3.pkgs.packaging + ]; env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=cpp" diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix index 6a73b3416db6..5cc3d51987ec 100644 --- a/pkgs/os-specific/linux/kmod/default.nix +++ b/pkgs/os-specific/linux/kmod/default.nix @@ -47,31 +47,30 @@ stdenv.mkDerivation rec { "out" "dev" "lib" - ] ++ lib.optional withDevdoc "devdoc"; + ] + ++ lib.optional withDevdoc "devdoc"; strictDeps = true; - nativeBuildInputs = - [ - autoconf - automake - docbook_xsl - libtool - libxslt - pkg-config + nativeBuildInputs = [ + autoconf + automake + docbook_xsl + libtool + libxslt + pkg-config - docbook_xml_dtd_42 # for the man pages - ] - ++ lib.optionals withDevdoc [ - docbook_xml_dtd_43 - gtk-doc - ]; - buildInputs = - [ - xz - zstd - ] - # gtk-doc is looked for with pkg-config - ++ lib.optionals withDevdoc [ gtk-doc ]; + docbook_xml_dtd_42 # for the man pages + ] + ++ lib.optionals withDevdoc [ + docbook_xml_dtd_43 + gtk-doc + ]; + buildInputs = [ + xz + zstd + ] + # gtk-doc is looked for with pkg-config + ++ lib.optionals withDevdoc [ gtk-doc ]; preConfigure = '' ./autogen.sh @@ -83,7 +82,8 @@ stdenv.mkDerivation rec { "--with-zstd" "--with-modulesdirs=${modulesDirs}" (lib.enableFeature withDevdoc "gtk-doc") - ] ++ lib.optional withStatic "--enable-static"; + ] + ++ lib.optional withStatic "--enable-static"; patches = [ ./module-dir.patch @@ -92,7 +92,8 @@ stdenv.mkDerivation rec { url = "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/patch/?id=11eb9bc67c319900ab00523997323a97d2d08ad2"; hash = "sha256-CYG615elMWces6QGQRg2H/NL7W4XsG9Zvz5H+xsdFFo="; }) - ] ++ lib.optional withStatic ./enable-static.patch; + ] + ++ lib.optional withStatic ./enable-static.patch; postInstall = '' for prog in rmmod insmod lsmod modinfo modprobe depmod; do diff --git a/pkgs/os-specific/linux/lvm2/common.nix b/pkgs/os-specific/linux/lvm2/common.nix index 8aba01683f2a..cc612e8ddaf8 100644 --- a/pkgs/os-specific/linux/lvm2/common.nix +++ b/pkgs/os-specific/linux/lvm2/common.nix @@ -48,56 +48,54 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ pkg-config ] ++ lib.optionals udevSupport [ udevCheckHook ]; - buildInputs = - [ - libaio - ] - ++ lib.optionals udevSupport [ - udev - ] - ++ lib.optionals (!onlyLib) [ - libuuid - ] - ++ lib.optionals enableVDO [ - vdo - ]; + buildInputs = [ + libaio + ] + ++ lib.optionals udevSupport [ + udev + ] + ++ lib.optionals (!onlyLib) [ + libuuid + ] + ++ lib.optionals enableVDO [ + vdo + ]; - configureFlags = - [ - "--disable-readline" - "--enable-pkgconfig" - "--with-default-locking-dir=/run/lock/lvm" - "--with-default-run-dir=/run/lvm" - "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "--with-systemd-run=/run/current-system/systemd/bin/systemd-run" - "--with-default-profile-subdir=profile.d" - ] - ++ lib.optionals (!enableCmdlib && !onlyLib) [ - "--bindir=${placeholder "bin"}/bin" - "--sbindir=${placeholder "bin"}/bin" - "--libdir=${placeholder "lib"}/lib" - "--with-libexecdir=${placeholder "lib"}/libexec" - ] - ++ lib.optional enableCmdlib "--enable-cmdlib" - ++ lib.optionals enableDmeventd [ - "--enable-dmeventd" - "--with-dmeventd-pidfile=/run/dmeventd/pid" - "--with-default-dm-run-dir=/run/dmeventd" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ] - ++ lib.optionals udevSupport [ - "--enable-udev_rules" - "--enable-udev_sync" - ] - ++ lib.optionals enableVDO [ - "--enable-vdo" - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - "--enable-static_link" - ]; + configureFlags = [ + "--disable-readline" + "--enable-pkgconfig" + "--with-default-locking-dir=/run/lock/lvm" + "--with-default-run-dir=/run/lvm" + "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "--with-systemd-run=/run/current-system/systemd/bin/systemd-run" + "--with-default-profile-subdir=profile.d" + ] + ++ lib.optionals (!enableCmdlib && !onlyLib) [ + "--bindir=${placeholder "bin"}/bin" + "--sbindir=${placeholder "bin"}/bin" + "--libdir=${placeholder "lib"}/lib" + "--with-libexecdir=${placeholder "lib"}/libexec" + ] + ++ lib.optional enableCmdlib "--enable-cmdlib" + ++ lib.optionals enableDmeventd [ + "--enable-dmeventd" + "--with-dmeventd-pidfile=/run/dmeventd/pid" + "--with-default-dm-run-dir=/run/dmeventd" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ] + ++ lib.optionals udevSupport [ + "--enable-udev_rules" + "--enable-udev_sync" + ] + ++ lib.optionals enableVDO [ + "--enable-vdo" + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + "--enable-static_link" + ]; preConfigure = '' sed -i /DEFAULT_SYS_DIR/d Makefile.in @@ -153,13 +151,14 @@ stdenv.mkDerivation rec { ]; # Install systemd stuff. - installTargets = - [ "install" ] - ++ lib.optionals udevSupport [ - "install_systemd_generators" - "install_systemd_units" - "install_tmpfiles_configuration" - ]; + installTargets = [ + "install" + ] + ++ lib.optionals udevSupport [ + "install_systemd_generators" + "install_systemd_units" + "install_tmpfiles_configuration" + ]; installPhase = lib.optionalString onlyLib '' make -C libdm install_${if stdenv.hostPlatform.isStatic then "static" else "dynamic"} @@ -168,18 +167,17 @@ stdenv.mkDerivation rec { ''; # only split bin and lib out from out if cmdlib isn't enabled - outputs = - [ - "out" - ] - ++ lib.optionals (!onlyLib) [ - "dev" - "man" - ] - ++ lib.optionals (!onlyLib && !enableCmdlib) [ - "bin" - "lib" - ]; + outputs = [ + "out" + ] + ++ lib.optionals (!onlyLib) [ + "dev" + "man" + ] + ++ lib.optionals (!onlyLib && !enableCmdlib) [ + "bin" + "lib" + ]; postInstall = lib.optionalString (enableCmdlib != true) '' moveToOutput lib/libdevmapper.so $lib diff --git a/pkgs/os-specific/linux/minimal-bootstrap/gnumake/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/gnumake/default.nix index 4307dadc3298..71da482689d6 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/gnumake/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/gnumake/default.nix @@ -37,7 +37,8 @@ let "-DNO_OUTPUT_SYNC=1" # mes-libc doesn't define O_TMPFILE "-DO_TMPFILE=020000000" - ] ++ config; + ] + ++ config; /* Maintenance notes: diff --git a/pkgs/os-specific/linux/mstflint_access/default.nix b/pkgs/os-specific/linux/mstflint_access/default.nix index 9c4576c9256c..84029c01d74d 100644 --- a/pkgs/os-specific/linux/mstflint_access/default.nix +++ b/pkgs/os-specific/linux/mstflint_access/default.nix @@ -32,7 +32,8 @@ stdenv.mkDerivation rec { "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=${placeholder "out"}" "M=$(PWD)" - ] ++ makeFlags; + ] + ++ makeFlags; meta = with lib; { description = "Kernel module for Nvidia NIC firmware update"; diff --git a/pkgs/os-specific/linux/nftables/default.nix b/pkgs/os-specific/linux/nftables/default.nix index f0f211755af0..0f9a175711f2 100644 --- a/pkgs/os-specific/linux/nftables/default.nix +++ b/pkgs/os-specific/linux/nftables/default.nix @@ -54,24 +54,22 @@ stdenv.mkDerivation rec { libxslt ]; - buildInputs = - [ - libmnl - libnftnl - libpcap - gmp - jansson - ] - ++ lib.optional withCli libedit - ++ lib.optional withXtables iptables; + buildInputs = [ + libmnl + libnftnl + libpcap + gmp + jansson + ] + ++ lib.optional withCli libedit + ++ lib.optional withXtables iptables; - configureFlags = - [ - "--with-json" - (lib.withFeatureAs withCli "cli" "editline") - ] - ++ lib.optional (!withDebugSymbols) "--disable-debug" - ++ lib.optional withXtables "--with-xtables"; + configureFlags = [ + "--with-json" + (lib.withFeatureAs withCli "cli" "editline") + ] + ++ lib.optional (!withDebugSymbols) "--disable-debug" + ++ lib.optional withXtables "--with-xtables"; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index baed507561fc..e5ad9fd5fd1f 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -196,11 +196,12 @@ stdenv.mkDerivation (finalAttrs: { inherit (stdenv.hostPlatform) system; inherit i686bundled; - outputs = - [ "out" ] - ++ lib.optional i686bundled "lib32" - ++ lib.optional (!libsOnly) "bin" - ++ lib.optional (!libsOnly && firmware) "firmware"; + outputs = [ + "out" + ] + ++ lib.optional i686bundled "lib32" + ++ lib.optional (!libsOnly) "bin" + ++ lib.optional (!libsOnly && firmware) "firmware"; outputDev = if libsOnly then null else "bin"; kernel = if libsOnly then null else kernel.dev; @@ -233,7 +234,8 @@ stdenv.mkDerivation (finalAttrs: { which libarchive jq - ] ++ lib.optionals (!libsOnly) kernel.moduleBuildDependencies; + ] + ++ lib.optionals (!libsOnly) kernel.moduleBuildDependencies; disallowedReferences = lib.optionals (!libsOnly) [ kernel.dev ]; @@ -328,10 +330,11 @@ stdenv.mkDerivation (finalAttrs: { if useFabricmanager then "Data Center" else "X.org" } driver and kernel module for NVIDIA cards"; license = licenses.unfreeRedistributable; - platforms = - [ "x86_64-linux" ] - ++ lib.optionals (sha256_32bit != null) [ "i686-linux" ] - ++ lib.optionals (sha256_aarch64 != null) [ "aarch64-linux" ]; + platforms = [ + "x86_64-linux" + ] + ++ lib.optionals (sha256_32bit != null) [ "i686-linux" ] + ++ lib.optionals (sha256_aarch64 != null) [ "aarch64-linux" ]; maintainers = with maintainers; [ kiskae edwtjo diff --git a/pkgs/os-specific/linux/nvidia-x11/settings.nix b/pkgs/os-specific/linux/nvidia-x11/settings.nix index f67b33368c8b..15f3dad44275 100644 --- a/pkgs/os-specific/linux/nvidia-x11/settings.nix +++ b/pkgs/os-specific/linux/nvidia-x11/settings.nix @@ -111,16 +111,17 @@ stdenv.mkDerivation { url = "https://github.com/NVIDIA/nvidia-settings/commit/a7c1f5fce6303a643fadff7d85d59934bd0cf6b6.patch"; hash = "sha256-ZwF3dRTYt/hO8ELg9weoz1U/XcU93qiJL2d1aq1Jlak="; }) - ++ lib.optional - ( - (lib.versionAtLeast nvidia_x11.settingsVersion "515.43.04") - && (lib.versionOlder nvidia_x11.settingsVersion "545.29") - ) - (fetchpatch { - # fix wayland support for compositors that use wl_output version 4 - url = "https://github.com/NVIDIA/nvidia-settings/pull/99/commits/2e0575197e2b3247deafd2a48f45afc038939a06.patch"; - hash = "sha256-wKuO5CUTUuwYvsP46Pz+6fI0yxLNpZv8qlbL0TFkEFE="; - }); + ++ + lib.optional + ( + (lib.versionAtLeast nvidia_x11.settingsVersion "515.43.04") + && (lib.versionOlder nvidia_x11.settingsVersion "545.29") + ) + (fetchpatch { + # fix wayland support for compositors that use wl_output version 4 + url = "https://github.com/NVIDIA/nvidia-settings/pull/99/commits/2e0575197e2b3247deafd2a48f45afc038939a06.patch"; + hash = "sha256-wKuO5CUTUuwYvsP46Pz+6fI0yxLNpZv8qlbL0TFkEFE="; + }); postPatch = lib.optionalString nvidia_x11.useProfiles '' sed -i 's,/usr/share/nvidia/,${nvidia_x11.bin}/share/nvidia/,g' src/gtk+-2.x/ctkappprofile.c @@ -141,25 +142,25 @@ stdenv.mkDerivation { pkg-config m4 addDriverRunpath - ] ++ lib.optionals withGtk3 [ wrapGAppsHook3 ]; + ] + ++ lib.optionals withGtk3 [ wrapGAppsHook3 ]; - buildInputs = - [ - jansson - libXv - libXrandr - libXext - libXxf86vm - libvdpau - nvidia_x11 - dbus - vulkan-headers - ] - ++ lib.optionals (withGtk2 || lib.versionOlder nvidia_x11.settingsVersion "525.53") [ gtk2 ] - ++ lib.optionals withGtk3 [ - gtk3 - librsvg - ]; + buildInputs = [ + jansson + libXv + libXrandr + libXext + libXxf86vm + libvdpau + nvidia_x11 + dbus + vulkan-headers + ] + ++ lib.optionals (withGtk2 || lib.versionOlder nvidia_x11.settingsVersion "525.53") [ gtk2 ] + ++ lib.optionals withGtk3 [ + gtk3 + librsvg + ]; installFlags = [ "PREFIX=$(out)" ]; diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix index b00f3401bc44..3a042cd50e4f 100644 --- a/pkgs/os-specific/linux/prl-tools/default.nix +++ b/pkgs/os-specific/linux/prl-tools/default.nix @@ -64,7 +64,8 @@ stdenv.mkDerivation (finalAttrs: { p7zip perl undmg - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; buildInputs = [ dbus-glib diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index 59cdf14af493..a8fbc328b178 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -42,17 +42,16 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; # Too red; 8bit support for fixing https://github.com/NixOS/nixpkgs/issues/275220 - configureFlags = - [ - "--disable-modern-top" - "--enable-watch8bit" - ] - ++ lib.optional withSystemd "--with-systemd" - ++ lib.optional stdenv.hostPlatform.isMusl "--disable-w" - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "ac_cv_func_malloc_0_nonnull=yes" - "ac_cv_func_realloc_0_nonnull=yes" - ]; + configureFlags = [ + "--disable-modern-top" + "--enable-watch8bit" + ] + ++ lib.optional withSystemd "--with-systemd" + ++ lib.optional stdenv.hostPlatform.isMusl "--disable-w" + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; installPhase = lib.optionalString watchOnly '' install -m 0755 -D src/watch $out/bin/watch diff --git a/pkgs/os-specific/linux/rtl8189es/default.nix b/pkgs/os-specific/linux/rtl8189es/default.nix index 60c62d8222d3..189003f586d9 100644 --- a/pkgs/os-specific/linux/rtl8189es/default.nix +++ b/pkgs/os-specific/linux/rtl8189es/default.nix @@ -22,7 +22,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ bc nukeReferences - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; hardeningDisable = [ "pic" diff --git a/pkgs/os-specific/linux/rtl8723ds/default.nix b/pkgs/os-specific/linux/rtl8723ds/default.nix index bc7b9e51a754..aec2c7a4ee38 100644 --- a/pkgs/os-specific/linux/rtl8723ds/default.nix +++ b/pkgs/os-specific/linux/rtl8723ds/default.nix @@ -21,13 +21,12 @@ stdenv.mkDerivation { nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies; - makeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; postPatch = '' substituteInPlace ./Makefile \ diff --git a/pkgs/os-specific/linux/rtl8812au/default.nix b/pkgs/os-specific/linux/rtl8812au/default.nix index a429d075feb5..437fa75c4708 100644 --- a/pkgs/os-specific/linux/rtl8812au/default.nix +++ b/pkgs/os-specific/linux/rtl8812au/default.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ bc nukeReferences - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; hardeningDisable = [ "pic" "format" @@ -34,15 +35,14 @@ stdenv.mkDerivation { --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" ''; - makeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) - ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) + ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; preInstall = '' mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" diff --git a/pkgs/os-specific/linux/rtl8821au/default.nix b/pkgs/os-specific/linux/rtl8821au/default.nix index 99864ce11fc0..bd683450a4b1 100644 --- a/pkgs/os-specific/linux/rtl8821au/default.nix +++ b/pkgs/os-specific/linux/rtl8821au/default.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ bc nukeReferences - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; hardeningDisable = [ "pic" @@ -30,18 +31,17 @@ stdenv.mkDerivation { env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types"; - makeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) - ( - "CONFIG_PLATFORM_ARM_RPI=" - + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n") - ) - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) + ( + "CONFIG_PLATFORM_ARM_RPI=" + + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n") + ) + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; prePatch = '' substituteInPlace ./Makefile \ diff --git a/pkgs/os-specific/linux/rtl8852au/default.nix b/pkgs/os-specific/linux/rtl8852au/default.nix index 2002b678b613..558e62927ec0 100644 --- a/pkgs/os-specific/linux/rtl8852au/default.nix +++ b/pkgs/os-specific/linux/rtl8852au/default.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ bc nukeReferences - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; hardeningDisable = [ "pic" "format" @@ -41,15 +42,14 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail /lib/modules "${kernel.dev}/lib/modules" ''; - makeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) - ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) + ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; preInstall = '' mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" diff --git a/pkgs/os-specific/linux/rtl8852bu/default.nix b/pkgs/os-specific/linux/rtl8852bu/default.nix index e07d2eb1d5b9..8b317d655509 100644 --- a/pkgs/os-specific/linux/rtl8852bu/default.nix +++ b/pkgs/os-specific/linux/rtl8852bu/default.nix @@ -21,7 +21,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ bc nukeReferences - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; hardeningDisable = [ "pic" "format" @@ -38,15 +39,14 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail /lib/modules "${kernel.dev}/lib/modules" ''; - makeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) - ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) + ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; preInstall = '' mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" diff --git a/pkgs/os-specific/linux/scx/scx_cscheds.nix b/pkgs/os-specific/linux/scx/scx_cscheds.nix index e024239ccb50..dc9e138cd7f4 100644 --- a/pkgs/os-specific/linux/scx/scx_cscheds.nix +++ b/pkgs/os-specific/linux/scx/scx_cscheds.nix @@ -73,18 +73,17 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: { --replace-fail '#define __builtin_preserve_enum_value(x,y,z) 1' '#define __builtin_preserve_enum_value(x,y) 1' ''; - nativeBuildInputs = - [ - meson - ninja - jq - pkg-config - zstd - protobuf - llvmPackages.libllvm - ] - ++ bpftools.buildInputs - ++ bpftools.nativeBuildInputs; + nativeBuildInputs = [ + meson + ninja + jq + pkg-config + zstd + protobuf + llvmPackages.libllvm + ] + ++ bpftools.buildInputs + ++ bpftools.nativeBuildInputs; buildInputs = [ elfutils diff --git a/pkgs/os-specific/linux/scx/scx_full.nix b/pkgs/os-specific/linux/scx/scx_full.nix index ea1d9ad7b23e..f47e92e8b96e 100644 --- a/pkgs/os-specific/linux/scx/scx_full.nix +++ b/pkgs/os-specific/linux/scx/scx_full.nix @@ -7,11 +7,9 @@ }: scx.cscheds.overrideAttrs (oldAttrs: { pname = "scx_full"; - postInstall = - (oldAttrs.postInstall or "") - + '' - cp ${scx.rustscheds}/bin/* ${placeholder "bin"}/bin/ - ''; + postInstall = (oldAttrs.postInstall or "") + '' + cp ${scx.rustscheds}/bin/* ${placeholder "bin"}/bin/ + ''; passthru.tests.basic = nixosTests.scx; diff --git a/pkgs/os-specific/linux/sgx/sdk/default.nix b/pkgs/os-specific/linux/sgx/sdk/default.nix index 5e9b99af143f..9da7360db581 100644 --- a/pkgs/os-specific/linux/sgx/sdk/default.nix +++ b/pkgs/os-specific/linux/sgx/sdk/default.nix @@ -142,13 +142,12 @@ stdenv.mkDerivation rec { popd ''; - buildFlags = - [ - "sdk_install_pkg" - ] - ++ lib.optionals debug [ - "DEBUG=1" - ]; + buildFlags = [ + "sdk_install_pkg" + ] + ++ lib.optionals debug [ + "DEBUG=1" + ]; postBuild = '' patchShebangs linux/installer/bin/sgx_linux_x64_sdk_${version}.bin diff --git a/pkgs/os-specific/linux/sgx/sdk/ipp-crypto.nix b/pkgs/os-specific/linux/sgx/sdk/ipp-crypto.nix index d75654fdcf1a..78658736944b 100644 --- a/pkgs/os-specific/linux/sgx/sdk/ipp-crypto.nix +++ b/pkgs/os-specific/linux/sgx/sdk/ipp-crypto.nix @@ -22,7 +22,8 @@ gcc11Stdenv.mkDerivation rec { "-DARCH=intel64" # sgx-sdk now requires FIPS-compliance mode turned on "-DIPPCP_FIPS_MODE=on" - ] ++ extraCmakeFlags; + ] + ++ extraCmakeFlags; nativeBuildInputs = [ cmake diff --git a/pkgs/os-specific/linux/sssd/default.nix b/pkgs/os-specific/linux/sssd/default.nix index 66c0b4aafa9a..d3786baebb13 100644 --- a/pkgs/os-specific/linux/sssd/default.nix +++ b/pkgs/os-specific/linux/sssd/default.nix @@ -80,30 +80,29 @@ stdenv.mkDerivation (finalAttrs: { "-I${libxml2.dev}/include/libxml2" ]; - preConfigure = - '' - export SGML_CATALOG_FILES="${docbookFiles}" - export PATH=$PATH:${openldap}/libexec + preConfigure = '' + export SGML_CATALOG_FILES="${docbookFiles}" + export PATH=$PATH:${openldap}/libexec - configureFlagsArray=( - --prefix=$out - --sysconfdir=/etc - --localstatedir=/var - --enable-pammoddir=$out/lib/security - --with-os=fedora - --with-pid-path=/run - --with-python3-bindings - --with-syslog=journald - --without-selinux - --without-semanage - --with-xml-catalog-path=''${SGML_CATALOG_FILES%%:*} - --with-ldb-lib-dir=$out/modules/ldb - --with-nscd=${glibc.bin}/sbin/nscd - ) - '' - + lib.optionalString withSudo '' - configureFlagsArray+=("--with-sudo") - ''; + configureFlagsArray=( + --prefix=$out + --sysconfdir=/etc + --localstatedir=/var + --enable-pammoddir=$out/lib/security + --with-os=fedora + --with-pid-path=/run + --with-python3-bindings + --with-syslog=journald + --without-selinux + --without-semanage + --with-xml-catalog-path=''${SGML_CATALOG_FILES%%:*} + --with-ldb-lib-dir=$out/modules/ldb + --with-nscd=${glibc.bin}/sbin/nscd + ) + '' + + lib.optionalString withSudo '' + configureFlagsArray+=("--with-sudo") + ''; enableParallelBuilding = true; # Disable parallel install due to missing depends: diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix index d1a420d22422..29ae5cf0e79c 100644 --- a/pkgs/os-specific/linux/sysdig/default.nix +++ b/pkgs/os-specific/linux/sysdig/default.nix @@ -76,31 +76,30 @@ stdenv.mkDerivation { installShellFiles pkg-config ]; - buildInputs = - [ - luajit - ncurses - openssl - curl - jq - tbb - re2 - protobuf - grpc - yaml-cpp - jsoncpp - nlohmann_json - zstd - uthash - ] - ++ lib.optionals stdenv.isLinux [ - bpftools - elfutils - libbpf - clang - gcc - ] - ++ lib.optionals (kernel != null) kernel.moduleBuildDependencies; + buildInputs = [ + luajit + ncurses + openssl + curl + jq + tbb + re2 + protobuf + grpc + yaml-cpp + jsoncpp + nlohmann_json + zstd + uthash + ] + ++ lib.optionals stdenv.isLinux [ + bpftools + elfutils + libbpf + clang + gcc + ] + ++ lib.optionals (kernel != null) kernel.moduleBuildDependencies; hardeningDisable = [ "pic" @@ -142,24 +141,24 @@ stdenv.mkDerivation { "-DCREATE_TEST_TARGETS=OFF" "-DVALIJSON_INCLUDE=${valijson}/include" "-DUTHASH_INCLUDE=${uthash}/include" - ] ++ lib.optional (kernel == null) "-DBUILD_DRIVER=OFF"; + ] + ++ lib.optional (kernel == null) "-DBUILD_DRIVER=OFF"; env.NIX_CFLAGS_COMPILE = # fix compiler warnings been treated as errors "-Wno-error"; - preConfigure = - '' - if ! grep -q "${libsRev}" cmake/modules/falcosecurity-libs.cmake; then - echo "falcosecurity-libs checksum needs to be updated!" - exit 1 - fi - cmakeFlagsArray+=(-DCMAKE_EXE_LINKER_FLAGS="-ltbb -lcurl -lzstd -labsl_synchronization") - '' - + lib.optionalString (kernel != null) '' - export INSTALL_MOD_PATH="$out" - export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - ''; + preConfigure = '' + if ! grep -q "${libsRev}" cmake/modules/falcosecurity-libs.cmake; then + echo "falcosecurity-libs checksum needs to be updated!" + exit 1 + fi + cmakeFlagsArray+=(-DCMAKE_EXE_LINKER_FLAGS="-ltbb -lcurl -lzstd -labsl_synchronization") + '' + + lib.optionalString (kernel != null) '' + export INSTALL_MOD_PATH="$out" + export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ''; postInstall = lib.optionalString stdenv.isLinux '' diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 10808bda7b27..081d9703ec90 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -226,391 +226,386 @@ stdenv.mkDerivation (finalAttrs: { # `git -c format.signoff=false format-patch v${version} --no-numbered --zero-commit --no-signature`. # Use `find . -name "*.patch" | sort` to get an up-to-date listing of all # patches - patches = - [ - ./0001-Start-device-units-for-uninitialised-encrypted-devic.patch - ./0002-Don-t-try-to-unmount-nix-or-nix-store.patch - ./0003-Fix-NixOS-containers.patch - ./0004-Add-some-NixOS-specific-unit-directories.patch - ./0005-Get-rid-of-a-useless-message-in-user-sessions.patch - ./0006-hostnamed-localed-timedated-disable-methods-that-cha.patch - ./0007-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch - ./0008-localectl-use-etc-X11-xkb-for-list-x11.patch - ./0009-add-rootprefix-to-lookup-dir-paths.patch - ./0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch - ./0011-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch - ./0012-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch - ./0013-inherit-systemd-environment-when-calling-generators.patch - ./0014-core-don-t-taint-on-unmerged-usr.patch - ./0015-tpm2_context_init-fix-driver-name-checking.patch - ./0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch - ./0017-meson.build-do-not-create-systemdstatedir.patch - ./0018-Revert-bootctl-update-list-remove-all-instances-of-s.patch # https://github.com/systemd/systemd/issues/33392 - # systemd tries to link the systemd-ssh-proxy ssh config snippet with tmpfiles - # if the install prefix is not /usr, but that does not work for us - # because we include the config snippet manually - ./0019-meson-Don-t-link-ssh-dropins.patch - ./0020-install-unit_file_exists_full-follow-symlinks.patch + patches = [ + ./0001-Start-device-units-for-uninitialised-encrypted-devic.patch + ./0002-Don-t-try-to-unmount-nix-or-nix-store.patch + ./0003-Fix-NixOS-containers.patch + ./0004-Add-some-NixOS-specific-unit-directories.patch + ./0005-Get-rid-of-a-useless-message-in-user-sessions.patch + ./0006-hostnamed-localed-timedated-disable-methods-that-cha.patch + ./0007-Change-usr-share-zoneinfo-to-etc-zoneinfo.patch + ./0008-localectl-use-etc-X11-xkb-for-list-x11.patch + ./0009-add-rootprefix-to-lookup-dir-paths.patch + ./0010-systemd-shutdown-execute-scripts-in-etc-systemd-syst.patch + ./0011-systemd-sleep-execute-scripts-in-etc-systemd-system-.patch + ./0012-path-util.h-add-placeholder-for-DEFAULT_PATH_NORMAL.patch + ./0013-inherit-systemd-environment-when-calling-generators.patch + ./0014-core-don-t-taint-on-unmerged-usr.patch + ./0015-tpm2_context_init-fix-driver-name-checking.patch + ./0016-systemctl-edit-suggest-systemdctl-edit-runtime-on-sy.patch + ./0017-meson.build-do-not-create-systemdstatedir.patch + ./0018-Revert-bootctl-update-list-remove-all-instances-of-s.patch # https://github.com/systemd/systemd/issues/33392 + # systemd tries to link the systemd-ssh-proxy ssh config snippet with tmpfiles + # if the install prefix is not /usr, but that does not work for us + # because we include the config snippet manually + ./0019-meson-Don-t-link-ssh-dropins.patch + ./0020-install-unit_file_exists_full-follow-symlinks.patch + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu) [ + ./0021-timesyncd-disable-NSCD-when-DNSSEC-validation-is-dis.patch + ] + ++ lib.optionals stdenv.hostPlatform.isMusl ( + let + # NOTE: the master-next branch does not have stable URLs. + # If we need patches that aren't in master yet, they'll have to be + # vendored. + oe-core = fetchzip { + url = "https://git.openembedded.org/openembedded-core/snapshot/openembedded-core-4891f47cdaf919033bf1c02cc12e4805e5db99a0.tar.gz"; + hash = "sha256-YKL/oC+rPZ2EEVNidEV+pJihZgUv7vLb0OASplgktn4="; + }; + in + map (patch: "${oe-core}/meta/recipes-core/systemd/systemd/${patch}") [ + "0003-missing_type.h-add-comparison_fn_t.patch" + "0004-add-fallback-parse_printf_format-implementation.patch" + "0005-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch" + "0006-add-missing-FTW_-macros-for-musl.patch" + "0007-Use-uintmax_t-for-handling-rlim_t.patch" + "0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch" + "0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch" + "0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch" + "0011-avoid-redefinition-of-prctl_mm_map-structure.patch" + "0012-do-not-disable-buffer-in-writing-files.patch" + "0013-Handle-__cpu_mask-usage.patch" + "0014-Handle-missing-gshadow.patch" + "0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch" + "0016-pass-correct-parameters-to-getdents64.patch" + "0017-Adjust-for-musl-headers.patch" + "0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch" + "0019-errno-util-Make-STRERROR-portable-for-musl.patch" + "0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch" + "0021-shared-Do-not-use-malloc_info-on-musl.patch" + "0022-avoid-missing-LOCK_EX-declaration.patch" + "0023-include-signal.h-to-avoid-the-undeclared-error.patch" + "0024-undef-stdin-for-references-using-stdin-as-a-struct-m.patch" + "0025-adjust-header-inclusion-order-to-avoid-redeclaration.patch" + "0026-build-path.c-avoid-boot-time-segfault-for-musl.patch" ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu) [ - ./0021-timesyncd-disable-NSCD-when-DNSSEC-validation-is-dis.patch + ++ [ + # add a missing include + (fetchpatch { + url = "https://github.com/systemd/systemd/commit/34fcd3638817060c79e1186b370e46d9b3a7409f.patch"; + hash = "sha256-Uaewo3jPrZGJttlLcqO6cCj1w3IGZmvbur4+TBdIPxc="; + excludes = [ "src/udev/udevd.c" ]; + }) ] - ++ lib.optionals stdenv.hostPlatform.isMusl ( - let - # NOTE: the master-next branch does not have stable URLs. - # If we need patches that aren't in master yet, they'll have to be - # vendored. - oe-core = fetchzip { - url = "https://git.openembedded.org/openembedded-core/snapshot/openembedded-core-4891f47cdaf919033bf1c02cc12e4805e5db99a0.tar.gz"; - hash = "sha256-YKL/oC+rPZ2EEVNidEV+pJihZgUv7vLb0OASplgktn4="; - }; - in - map (patch: "${oe-core}/meta/recipes-core/systemd/systemd/${patch}") [ - "0003-missing_type.h-add-comparison_fn_t.patch" - "0004-add-fallback-parse_printf_format-implementation.patch" - "0005-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch" - "0006-add-missing-FTW_-macros-for-musl.patch" - "0007-Use-uintmax_t-for-handling-rlim_t.patch" - "0008-Define-glibc-compatible-basename-for-non-glibc-syste.patch" - "0009-Do-not-disable-buffering-when-writing-to-oom_score_a.patch" - "0010-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch" - "0011-avoid-redefinition-of-prctl_mm_map-structure.patch" - "0012-do-not-disable-buffer-in-writing-files.patch" - "0013-Handle-__cpu_mask-usage.patch" - "0014-Handle-missing-gshadow.patch" - "0015-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch" - "0016-pass-correct-parameters-to-getdents64.patch" - "0017-Adjust-for-musl-headers.patch" - "0018-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch" - "0019-errno-util-Make-STRERROR-portable-for-musl.patch" - "0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch" - "0021-shared-Do-not-use-malloc_info-on-musl.patch" - "0022-avoid-missing-LOCK_EX-declaration.patch" - "0023-include-signal.h-to-avoid-the-undeclared-error.patch" - "0024-undef-stdin-for-references-using-stdin-as-a-struct-m.patch" - "0025-adjust-header-inclusion-order-to-avoid-redeclaration.patch" - "0026-build-path.c-avoid-boot-time-segfault-for-musl.patch" - ] - ++ [ - # add a missing include - (fetchpatch { - url = "https://github.com/systemd/systemd/commit/34fcd3638817060c79e1186b370e46d9b3a7409f.patch"; - hash = "sha256-Uaewo3jPrZGJttlLcqO6cCj1w3IGZmvbur4+TBdIPxc="; - excludes = [ "src/udev/udevd.c" ]; - }) - ] - ); + ); - postPatch = - '' - substituteInPlace src/basic/path-util.h --replace "@defaultPathNormal@" "${placeholder "out"}/bin/" - '' - + lib.optionalString withLibBPF '' - substituteInPlace meson.build \ - --replace "find_program('clang'" "find_program('${stdenv.cc.targetPrefix}clang'" - '' - + lib.optionalString withUkify '' - substituteInPlace src/ukify/ukify.py \ - --replace \ - "'readelf'" \ - "'${targetPackages.stdenv.cc.bintools.targetPrefix}readelf'" \ - --replace \ - "/usr/lib/systemd/boot/efi" \ - "$out/lib/systemd/boot/efi" - '' - # Finally, patch shebangs in scripts used at build time. This must not patch - # scripts that will end up in the output, to avoid build platform references - # when cross-compiling. - + '' - shopt -s extglob - patchShebangs tools test src/!(rpm|kernel-install|ukify) src/kernel-install/test-kernel-install.sh - ''; + postPatch = '' + substituteInPlace src/basic/path-util.h --replace "@defaultPathNormal@" "${placeholder "out"}/bin/" + '' + + lib.optionalString withLibBPF '' + substituteInPlace meson.build \ + --replace "find_program('clang'" "find_program('${stdenv.cc.targetPrefix}clang'" + '' + + lib.optionalString withUkify '' + substituteInPlace src/ukify/ukify.py \ + --replace \ + "'readelf'" \ + "'${targetPackages.stdenv.cc.bintools.targetPrefix}readelf'" \ + --replace \ + "/usr/lib/systemd/boot/efi" \ + "$out/lib/systemd/boot/efi" + '' + # Finally, patch shebangs in scripts used at build time. This must not patch + # scripts that will end up in the output, to avoid build platform references + # when cross-compiling. + + '' + shopt -s extglob + patchShebangs tools test src/!(rpm|kernel-install|ukify) src/kernel-install/test-kernel-install.sh + ''; outputs = [ "out" "dev" - ] ++ (lib.optional (!buildLibsOnly) "man"); + ] + ++ (lib.optional (!buildLibsOnly) "man"); separateDebugInfo = true; __structuredAttrs = true; - hardeningDisable = - [ - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111523 - "trivialautovarinit" - ] - ++ (lib.optionals withLibBPF [ - # breaks clang -target bpf; should be fixed to not use - # a wrapped clang? - "zerocallusedregs" - "shadowstack" - "pacret" - ]); + hardeningDisable = [ + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111523 + "trivialautovarinit" + ] + ++ (lib.optionals withLibBPF [ + # breaks clang -target bpf; should be fixed to not use + # a wrapped clang? + "zerocallusedregs" + "shadowstack" + "pacret" + ]); - nativeBuildInputs = - [ - pkg-config - makeBinaryWrapper - gperf - ninja - meson - glibcLocales - getent - m4 - autoPatchelfHook + nativeBuildInputs = [ + pkg-config + makeBinaryWrapper + gperf + ninja + meson + glibcLocales + getent + m4 + autoPatchelfHook - intltool - gettext + intltool + gettext - libxslt - docbook_xsl - docbook_xml_dtd_42 - docbook_xml_dtd_45 - bash - (buildPackages.python3Packages.python.withPackages ( - ps: - with ps; - [ - lxml - jinja2 - ] - ++ lib.optional withEfi ps.pyelftools - )) - ] - ++ lib.optionals withLibBPF [ - bpftools - buildPackages.llvmPackages.clang - buildPackages.llvmPackages.libllvm - ]; + libxslt + docbook_xsl + docbook_xml_dtd_42 + docbook_xml_dtd_45 + bash + (buildPackages.python3Packages.python.withPackages ( + ps: + with ps; + [ + lxml + jinja2 + ] + ++ lib.optional withEfi ps.pyelftools + )) + ] + ++ lib.optionals withLibBPF [ + bpftools + buildPackages.llvmPackages.clang + buildPackages.llvmPackages.libllvm + ]; autoPatchelfFlags = [ "--keep-libc" ]; - buildInputs = - [ - libxcrypt - libcap - libuuid - linuxHeaders - bashInteractive # for patch shebangs - ] + buildInputs = [ + libxcrypt + libcap + libuuid + linuxHeaders + bashInteractive # for patch shebangs + ] - ++ lib.optionals withGcrypt [ - libgcrypt - libgpg-error - ] - ++ lib.optionals withOpenSSL [ openssl ] - ++ lib.optional withTests glib - ++ lib.optional withAcl acl - ++ lib.optional withApparmor libapparmor - ++ lib.optional withAudit audit - ++ lib.optional wantCurl (lib.getDev curl) - ++ lib.optionals withCompression [ - zlib - bzip2 - lz4 - xz - zstd - ] - ++ lib.optional withCoredump elfutils - ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) - ++ lib.optional withKexectools kexec-tools - ++ lib.optional withKmod kmod - ++ lib.optional withLibidn2 libidn2 - ++ lib.optional withLibseccomp libseccomp - ++ lib.optional withIptables iptables - ++ lib.optional withPam pam - ++ lib.optional withPCRE2 pcre2 - ++ lib.optional withSelinux libselinux - ++ lib.optionals withRemote [ - libmicrohttpd - gnutls - ] - ++ lib.optionals (withHomed || withCryptsetup) [ p11-kit ] - ++ lib.optionals (withHomed || withCryptsetup) [ libfido2 ] - ++ lib.optionals withLibBPF [ libbpf ] - ++ lib.optional withTpm2Tss tpm2-tss - ++ lib.optional withUkify (python3Packages.python.withPackages (ps: with ps; [ pefile ])) - ++ lib.optionals withPasswordQuality [ libpwquality ] - ++ lib.optionals withQrencode [ qrencode ] - ++ lib.optionals withLibarchive [ libarchive ] - ++ lib.optional (withBootloader && stdenv.targetPlatform.useLLVM or false) ( - llvmPackages.compiler-rt.override { - doFakeLibgcc = true; - } - ); + ++ lib.optionals withGcrypt [ + libgcrypt + libgpg-error + ] + ++ lib.optionals withOpenSSL [ openssl ] + ++ lib.optional withTests glib + ++ lib.optional withAcl acl + ++ lib.optional withApparmor libapparmor + ++ lib.optional withAudit audit + ++ lib.optional wantCurl (lib.getDev curl) + ++ lib.optionals withCompression [ + zlib + bzip2 + lz4 + xz + zstd + ] + ++ lib.optional withCoredump elfutils + ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) + ++ lib.optional withKexectools kexec-tools + ++ lib.optional withKmod kmod + ++ lib.optional withLibidn2 libidn2 + ++ lib.optional withLibseccomp libseccomp + ++ lib.optional withIptables iptables + ++ lib.optional withPam pam + ++ lib.optional withPCRE2 pcre2 + ++ lib.optional withSelinux libselinux + ++ lib.optionals withRemote [ + libmicrohttpd + gnutls + ] + ++ lib.optionals (withHomed || withCryptsetup) [ p11-kit ] + ++ lib.optionals (withHomed || withCryptsetup) [ libfido2 ] + ++ lib.optionals withLibBPF [ libbpf ] + ++ lib.optional withTpm2Tss tpm2-tss + ++ lib.optional withUkify (python3Packages.python.withPackages (ps: with ps; [ pefile ])) + ++ lib.optionals withPasswordQuality [ libpwquality ] + ++ lib.optionals withQrencode [ qrencode ] + ++ lib.optionals withLibarchive [ libarchive ] + ++ lib.optional (withBootloader && stdenv.targetPlatform.useLLVM or false) ( + llvmPackages.compiler-rt.override { + doFakeLibgcc = true; + } + ); mesonBuildType = "release"; - mesonFlags = - [ - # Options + mesonFlags = [ + # Options - # We bump this attribute on every (major) version change to ensure that we - # have known-good value for a timestamp that is in the (not so distant) - # past. This serves as a lower bound for valid system timestamps during - # startup. Systemd will reset the system timestamp if this date is +- 15 - # years from the system time. - # See the systemd v250 release notes for further details: - # https://github.com/systemd/systemd/blob/60e930fc3e6eb8a36fbc184773119eb8d2f30364/NEWS#L258-L266 - (lib.mesonOption "time-epoch" releaseTimestamp) + # We bump this attribute on every (major) version change to ensure that we + # have known-good value for a timestamp that is in the (not so distant) + # past. This serves as a lower bound for valid system timestamps during + # startup. Systemd will reset the system timestamp if this date is +- 15 + # years from the system time. + # See the systemd v250 release notes for further details: + # https://github.com/systemd/systemd/blob/60e930fc3e6eb8a36fbc184773119eb8d2f30364/NEWS#L258-L266 + (lib.mesonOption "time-epoch" releaseTimestamp) - (lib.mesonOption "version-tag" version) - (lib.mesonOption "mode" "release") - (lib.mesonOption "tty-gid" "3") # tty in NixOS has gid 3 - (lib.mesonOption "debug-shell" "${bashInteractive}/bin/bash") - (lib.mesonOption "pamconfdir" "${placeholder "out"}/etc/pam.d") - (lib.mesonOption "shellprofiledir" "${placeholder "out"}/etc/profile.d") - (lib.mesonOption "kmod-path" "${kmod}/bin/kmod") + (lib.mesonOption "version-tag" version) + (lib.mesonOption "mode" "release") + (lib.mesonOption "tty-gid" "3") # tty in NixOS has gid 3 + (lib.mesonOption "debug-shell" "${bashInteractive}/bin/bash") + (lib.mesonOption "pamconfdir" "${placeholder "out"}/etc/pam.d") + (lib.mesonOption "shellprofiledir" "${placeholder "out"}/etc/profile.d") + (lib.mesonOption "kmod-path" "${kmod}/bin/kmod") - # Attempts to check /usr/sbin and that fails in macOS sandbox because - # permission is denied. If /usr/sbin is not a symlink, it defaults to true. - # We set it to false since stdenv moves sbin/* to bin and creates a symlink, - # that is, we do not have split bin. - (lib.mesonOption "split-bin" "false") + # Attempts to check /usr/sbin and that fails in macOS sandbox because + # permission is denied. If /usr/sbin is not a symlink, it defaults to true. + # We set it to false since stdenv moves sbin/* to bin and creates a symlink, + # that is, we do not have split bin. + (lib.mesonOption "split-bin" "false") - # D-Bus - (lib.mesonOption "dbuspolicydir" "${placeholder "out"}/share/dbus-1/system.d") - (lib.mesonOption "dbussessionservicedir" "${placeholder "out"}/share/dbus-1/services") - (lib.mesonOption "dbussystemservicedir" "${placeholder "out"}/share/dbus-1/system-services") + # D-Bus + (lib.mesonOption "dbuspolicydir" "${placeholder "out"}/share/dbus-1/system.d") + (lib.mesonOption "dbussessionservicedir" "${placeholder "out"}/share/dbus-1/services") + (lib.mesonOption "dbussystemservicedir" "${placeholder "out"}/share/dbus-1/system-services") - # pkgconfig - (lib.mesonOption "pkgconfiglibdir" "${placeholder "dev"}/lib/pkgconfig") - (lib.mesonOption "pkgconfigdatadir" "${placeholder "dev"}/share/pkgconfig") + # pkgconfig + (lib.mesonOption "pkgconfiglibdir" "${placeholder "dev"}/lib/pkgconfig") + (lib.mesonOption "pkgconfigdatadir" "${placeholder "dev"}/share/pkgconfig") - # Keyboard - (lib.mesonOption "loadkeys-path" "${kbd}/bin/loadkeys") - (lib.mesonOption "setfont-path" "${kbd}/bin/setfont") + # Keyboard + (lib.mesonOption "loadkeys-path" "${kbd}/bin/loadkeys") + (lib.mesonOption "setfont-path" "${kbd}/bin/setfont") - # SBAT - (lib.mesonOption "sbat-distro" "nixos") - (lib.mesonOption "sbat-distro-summary" "NixOS") - (lib.mesonOption "sbat-distro-url" "https://nixos.org/") - (lib.mesonOption "sbat-distro-pkgname" pname) - (lib.mesonOption "sbat-distro-version" version) + # SBAT + (lib.mesonOption "sbat-distro" "nixos") + (lib.mesonOption "sbat-distro-summary" "NixOS") + (lib.mesonOption "sbat-distro-url" "https://nixos.org/") + (lib.mesonOption "sbat-distro-pkgname" pname) + (lib.mesonOption "sbat-distro-version" version) - # Users - (lib.mesonOption "system-uid-max" "999") - (lib.mesonOption "system-gid-max" "999") + # Users + (lib.mesonOption "system-uid-max" "999") + (lib.mesonOption "system-gid-max" "999") - # SysVinit - (lib.mesonOption "sysvinit-path" "") - (lib.mesonOption "sysvrcnd-path" "") + # SysVinit + (lib.mesonOption "sysvinit-path" "") + (lib.mesonOption "sysvrcnd-path" "") - # Login - (lib.mesonOption "sulogin-path" "${util-linux.login}/bin/sulogin") - (lib.mesonOption "nologin-path" "${util-linux.login}/bin/nologin") + # Login + (lib.mesonOption "sulogin-path" "${util-linux.login}/bin/sulogin") + (lib.mesonOption "nologin-path" "${util-linux.login}/bin/nologin") - # Mount - (lib.mesonOption "mount-path" "${lib.getOutput "mount" util-linux}/bin/mount") - (lib.mesonOption "umount-path" "${lib.getOutput "mount" util-linux}/bin/umount") + # Mount + (lib.mesonOption "mount-path" "${lib.getOutput "mount" util-linux}/bin/mount") + (lib.mesonOption "umount-path" "${lib.getOutput "mount" util-linux}/bin/umount") - # SSH - (lib.mesonOption "sshconfdir" "") - (lib.mesonOption "sshdconfdir" "no") + # SSH + (lib.mesonOption "sshconfdir" "") + (lib.mesonOption "sshdconfdir" "no") - # Features + # Features - # Tests - (lib.mesonBool "tests" withTests) - (lib.mesonEnable "glib" withTests) - (lib.mesonEnable "dbus" withTests) + # Tests + (lib.mesonBool "tests" withTests) + (lib.mesonEnable "glib" withTests) + (lib.mesonEnable "dbus" withTests) - # Compression - (lib.mesonEnable "bzip2" withCompression) - (lib.mesonEnable "lz4" withCompression) - (lib.mesonEnable "xz" withCompression) - (lib.mesonEnable "zstd" withCompression) - (lib.mesonEnable "zlib" withCompression) + # Compression + (lib.mesonEnable "bzip2" withCompression) + (lib.mesonEnable "lz4" withCompression) + (lib.mesonEnable "xz" withCompression) + (lib.mesonEnable "zstd" withCompression) + (lib.mesonEnable "zlib" withCompression) - # NSS - (lib.mesonEnable "nss-mymachines" (withNss && withMachined)) - (lib.mesonEnable "nss-resolve" withNss) - (lib.mesonBool "nss-myhostname" withNss) - (lib.mesonBool "nss-systemd" withNss) + # NSS + (lib.mesonEnable "nss-mymachines" (withNss && withMachined)) + (lib.mesonEnable "nss-resolve" withNss) + (lib.mesonBool "nss-myhostname" withNss) + (lib.mesonBool "nss-systemd" withNss) - # Cryptsetup - (lib.mesonEnable "libcryptsetup" withCryptsetup) - (lib.mesonEnable "libcryptsetup-plugins" withCryptsetup) - (lib.mesonEnable "p11kit" (withHomed || withCryptsetup)) + # Cryptsetup + (lib.mesonEnable "libcryptsetup" withCryptsetup) + (lib.mesonEnable "libcryptsetup-plugins" withCryptsetup) + (lib.mesonEnable "p11kit" (withHomed || withCryptsetup)) - # FIDO2 - (lib.mesonEnable "libfido2" withFido2) - (lib.mesonEnable "openssl" withOpenSSL) + # FIDO2 + (lib.mesonEnable "libfido2" withFido2) + (lib.mesonEnable "openssl" withOpenSSL) - # Password Quality - (lib.mesonEnable "pwquality" withPasswordQuality) - (lib.mesonEnable "passwdqc" false) + # Password Quality + (lib.mesonEnable "pwquality" withPasswordQuality) + (lib.mesonEnable "passwdqc" false) - # Remote - (lib.mesonEnable "remote" withRemote) - (lib.mesonEnable "microhttpd" withRemote) + # Remote + (lib.mesonEnable "remote" withRemote) + (lib.mesonEnable "microhttpd" withRemote) - (lib.mesonEnable "pam" withPam) - (lib.mesonEnable "acl" withAcl) - (lib.mesonEnable "audit" withAudit) - (lib.mesonEnable "apparmor" withApparmor) - (lib.mesonEnable "gcrypt" withGcrypt) - (lib.mesonEnable "importd" withImportd) - (lib.mesonEnable "homed" withHomed) - (lib.mesonEnable "polkit" withPolkit) - (lib.mesonEnable "elfutils" withCoredump) - (lib.mesonEnable "libcurl" wantCurl) - (lib.mesonEnable "libidn" false) - (lib.mesonEnable "libidn2" withLibidn2) - (lib.mesonEnable "libiptc" withIptables) - (lib.mesonEnable "repart" withRepart) - (lib.mesonEnable "sysupdate" withSysupdate) - (lib.mesonEnable "seccomp" withLibseccomp) - (lib.mesonEnable "selinux" withSelinux) - (lib.mesonEnable "tpm2" withTpm2Tss) - (lib.mesonEnable "pcre2" withPCRE2) - (lib.mesonEnable "bpf-framework" withLibBPF) - (lib.mesonEnable "bootloader" withBootloader) - (lib.mesonEnable "ukify" withUkify) - (lib.mesonEnable "kmod" withKmod) - (lib.mesonEnable "qrencode" withQrencode) - (lib.mesonEnable "vmspawn" withVmspawn) - (lib.mesonEnable "libarchive" withLibarchive) - (lib.mesonEnable "xenctrl" false) - (lib.mesonEnable "gnutls" false) - (lib.mesonEnable "xkbcommon" false) - (lib.mesonEnable "man" true) + (lib.mesonEnable "pam" withPam) + (lib.mesonEnable "acl" withAcl) + (lib.mesonEnable "audit" withAudit) + (lib.mesonEnable "apparmor" withApparmor) + (lib.mesonEnable "gcrypt" withGcrypt) + (lib.mesonEnable "importd" withImportd) + (lib.mesonEnable "homed" withHomed) + (lib.mesonEnable "polkit" withPolkit) + (lib.mesonEnable "elfutils" withCoredump) + (lib.mesonEnable "libcurl" wantCurl) + (lib.mesonEnable "libidn" false) + (lib.mesonEnable "libidn2" withLibidn2) + (lib.mesonEnable "libiptc" withIptables) + (lib.mesonEnable "repart" withRepart) + (lib.mesonEnable "sysupdate" withSysupdate) + (lib.mesonEnable "seccomp" withLibseccomp) + (lib.mesonEnable "selinux" withSelinux) + (lib.mesonEnable "tpm2" withTpm2Tss) + (lib.mesonEnable "pcre2" withPCRE2) + (lib.mesonEnable "bpf-framework" withLibBPF) + (lib.mesonEnable "bootloader" withBootloader) + (lib.mesonEnable "ukify" withUkify) + (lib.mesonEnable "kmod" withKmod) + (lib.mesonEnable "qrencode" withQrencode) + (lib.mesonEnable "vmspawn" withVmspawn) + (lib.mesonEnable "libarchive" withLibarchive) + (lib.mesonEnable "xenctrl" false) + (lib.mesonEnable "gnutls" false) + (lib.mesonEnable "xkbcommon" false) + (lib.mesonEnable "man" true) - (lib.mesonBool "analyze" withAnalyze) - (lib.mesonBool "logind" withLogind) - (lib.mesonBool "localed" withLocaled) - (lib.mesonBool "hostnamed" withHostnamed) - (lib.mesonBool "machined" withMachined) - (lib.mesonBool "networkd" withNetworkd) - (lib.mesonBool "oomd" withOomd) - (lib.mesonBool "portabled" withPortabled) - (lib.mesonBool "hwdb" withHwdb) - (lib.mesonBool "timedated" withTimedated) - (lib.mesonBool "timesyncd" withTimesyncd) - (lib.mesonBool "userdb" withUserDb) - (lib.mesonBool "coredump" withCoredump) - (lib.mesonBool "firstboot" withFirstboot) - (lib.mesonBool "resolve" withResolved) - (lib.mesonBool "sysusers" withSysusers) - (lib.mesonBool "efi" withEfi) - (lib.mesonBool "utmp" withUtmp) - (lib.mesonBool "log-trace" withLogTrace) - (lib.mesonBool "kernel-install" withKernelInstall) - (lib.mesonBool "quotacheck" false) - (lib.mesonBool "ldconfig" false) - (lib.mesonBool "install-sysconfdir" false) - (lib.mesonBool "create-log-dirs" false) - (lib.mesonBool "smack" true) - (lib.mesonBool "b_pie" true) + (lib.mesonBool "analyze" withAnalyze) + (lib.mesonBool "logind" withLogind) + (lib.mesonBool "localed" withLocaled) + (lib.mesonBool "hostnamed" withHostnamed) + (lib.mesonBool "machined" withMachined) + (lib.mesonBool "networkd" withNetworkd) + (lib.mesonBool "oomd" withOomd) + (lib.mesonBool "portabled" withPortabled) + (lib.mesonBool "hwdb" withHwdb) + (lib.mesonBool "timedated" withTimedated) + (lib.mesonBool "timesyncd" withTimesyncd) + (lib.mesonBool "userdb" withUserDb) + (lib.mesonBool "coredump" withCoredump) + (lib.mesonBool "firstboot" withFirstboot) + (lib.mesonBool "resolve" withResolved) + (lib.mesonBool "sysusers" withSysusers) + (lib.mesonBool "efi" withEfi) + (lib.mesonBool "utmp" withUtmp) + (lib.mesonBool "log-trace" withLogTrace) + (lib.mesonBool "kernel-install" withKernelInstall) + (lib.mesonBool "quotacheck" false) + (lib.mesonBool "ldconfig" false) + (lib.mesonBool "install-sysconfdir" false) + (lib.mesonBool "create-log-dirs" false) + (lib.mesonBool "smack" true) + (lib.mesonBool "b_pie" true) - ] - ++ lib.optionals (withShellCompletions == false) [ - (lib.mesonOption "bashcompletiondir" "no") - (lib.mesonOption "zshcompletiondir" "no") - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - (lib.mesonBool "gshadow" false) - (lib.mesonBool "idn" false) - ]; + ] + ++ lib.optionals (withShellCompletions == false) [ + (lib.mesonOption "bashcompletiondir" "no") + (lib.mesonOption "zshcompletiondir" "no") + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + (lib.mesonBool "gshadow" false) + (lib.mesonBool "idn" false) + ]; preConfigure = let # A list of all the runtime binaries referenced by the source code (plus @@ -620,96 +615,95 @@ stdenv.mkDerivation (finalAttrs: { # The `where` attribute for each of the replacement patterns must be # exhaustive. If another (unhandled) case is found in the source code the # build fails with an error message. - binaryReplacements = - [ - { - search = "/usr/bin/getent"; - replacement = "${getent}/bin/getent"; - where = [ "src/nspawn/nspawn-setuid.c" ]; - } - { - search = "/sbin/mkswap"; - replacement = "${lib.getBin util-linux}/sbin/mkswap"; - where = [ - "man/systemd-makefs@.service.xml" - ]; - } - { - search = "/sbin/swapon"; - replacement = "${lib.getOutput "swap" util-linux}/sbin/swapon"; - where = [ - "src/core/swap.c" - "src/basic/unit-def.h" - ]; - } - { - search = "/sbin/swapoff"; - replacement = "${lib.getOutput "swap" util-linux}/sbin/swapoff"; - where = [ "src/core/swap.c" ]; - } - { - search = "/bin/echo"; - replacement = "${coreutils}/bin/echo"; - where = [ - "man/systemd-analyze.xml" - "man/systemd.service.xml" - "man/systemd-run.xml" - "src/analyze/test-verify.c" - "src/test/test-env-file.c" - "src/test/test-fileio.c" - "src/test/test-load-fragment.c" - ]; - } - { - search = "/bin/cat"; - replacement = "${coreutils}/bin/cat"; - where = [ - "test/test-execute/exec-noexecpaths-simple.service" - "src/journal/cat.c" - ]; - } - { - search = "/usr/lib/systemd/systemd-fsck"; - replacement = "$out/lib/systemd/systemd-fsck"; - where = [ "man/systemd-fsck@.service.xml" ]; - } - ] - ++ lib.optionals withImportd [ - { - search = "\"gpg\""; - replacement = "\\\"${gnupg}/bin/gpg\\\""; - where = [ "src/import/pull-common.c" ]; - } - { - search = "\"tar\""; - replacement = "\\\"${gnutar}/bin/tar\\\""; - where = [ - "src/import/export-tar.c" - "src/import/import-common.c" - "src/import/import-tar.c" - ]; - ignore = [ - # occurrences here refer to the tar sub command - "src/sysupdate/sysupdate-resource.c" - "src/sysupdate/sysupdate-transfer.c" - "src/import/pull.c" - "src/import/export.c" - "src/import/import.c" - "src/import/importd.c" - # runs `tar` but also also creates a temporary directory with the string - "src/import/pull-tar.c" - # tar referenced as file suffix - "src/shared/import-util.c" - ]; - } - ] - ++ lib.optionals withKmod [ - { - search = "/sbin/modprobe"; - replacement = "${lib.getBin kmod}/sbin/modprobe"; - where = [ "units/modprobe@.service" ]; - } - ]; + binaryReplacements = [ + { + search = "/usr/bin/getent"; + replacement = "${getent}/bin/getent"; + where = [ "src/nspawn/nspawn-setuid.c" ]; + } + { + search = "/sbin/mkswap"; + replacement = "${lib.getBin util-linux}/sbin/mkswap"; + where = [ + "man/systemd-makefs@.service.xml" + ]; + } + { + search = "/sbin/swapon"; + replacement = "${lib.getOutput "swap" util-linux}/sbin/swapon"; + where = [ + "src/core/swap.c" + "src/basic/unit-def.h" + ]; + } + { + search = "/sbin/swapoff"; + replacement = "${lib.getOutput "swap" util-linux}/sbin/swapoff"; + where = [ "src/core/swap.c" ]; + } + { + search = "/bin/echo"; + replacement = "${coreutils}/bin/echo"; + where = [ + "man/systemd-analyze.xml" + "man/systemd.service.xml" + "man/systemd-run.xml" + "src/analyze/test-verify.c" + "src/test/test-env-file.c" + "src/test/test-fileio.c" + "src/test/test-load-fragment.c" + ]; + } + { + search = "/bin/cat"; + replacement = "${coreutils}/bin/cat"; + where = [ + "test/test-execute/exec-noexecpaths-simple.service" + "src/journal/cat.c" + ]; + } + { + search = "/usr/lib/systemd/systemd-fsck"; + replacement = "$out/lib/systemd/systemd-fsck"; + where = [ "man/systemd-fsck@.service.xml" ]; + } + ] + ++ lib.optionals withImportd [ + { + search = "\"gpg\""; + replacement = "\\\"${gnupg}/bin/gpg\\\""; + where = [ "src/import/pull-common.c" ]; + } + { + search = "\"tar\""; + replacement = "\\\"${gnutar}/bin/tar\\\""; + where = [ + "src/import/export-tar.c" + "src/import/import-common.c" + "src/import/import-tar.c" + ]; + ignore = [ + # occurrences here refer to the tar sub command + "src/sysupdate/sysupdate-resource.c" + "src/sysupdate/sysupdate-transfer.c" + "src/import/pull.c" + "src/import/export.c" + "src/import/import.c" + "src/import/importd.c" + # runs `tar` but also also creates a temporary directory with the string + "src/import/pull-tar.c" + # tar referenced as file suffix + "src/shared/import-util.c" + ]; + } + ] + ++ lib.optionals withKmod [ + { + search = "/sbin/modprobe"; + replacement = "${lib.getBin kmod}/sbin/modprobe"; + where = [ "units/modprobe@.service" ]; + } + ]; # { replacement, search, where, ignore } -> List[str] mkSubstitute = diff --git a/pkgs/os-specific/linux/tbs/default.nix b/pkgs/os-specific/linux/tbs/default.nix index c29a12987efb..2fe60b5b76e3 100644 --- a/pkgs/os-specific/linux/tbs/default.nix +++ b/pkgs/os-specific/linux/tbs/default.nix @@ -68,7 +68,8 @@ stdenv.mkDerivation { patchutils kmod perlPackages.ProcProcessTable - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; postInstall = '' find $out/lib/modules/${kernel.modDirVersion} -name "*.ko" -exec xz {} \; diff --git a/pkgs/os-specific/linux/udisks/2-default.nix b/pkgs/os-specific/linux/udisks/2-default.nix index 6022a3c224b2..abc5ca0e0150 100644 --- a/pkgs/os-specific/linux/udisks/2-default.nix +++ b/pkgs/os-specific/linux/udisks/2-default.nix @@ -54,7 +54,8 @@ stdenv.mkDerivation rec { "out" "man" "dev" - ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc"; + ] + ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc"; patches = [ (replaceVars ./fix-paths.patch { diff --git a/pkgs/os-specific/linux/v4l-utils/default.nix b/pkgs/os-specific/linux/v4l-utils/default.nix index 67f3ad828bf1..38d204725ff8 100644 --- a/pkgs/os-specific/linux/v4l-utils/default.nix +++ b/pkgs/os-specific/linux/v4l-utils/default.nix @@ -41,13 +41,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-wc9UnC7DzznrXse/FXMTSeYbJqIbXpY5IttCIzO64Zc="; }; - outputs = - [ "out" ] - ++ lib.optional withUtils "lib" - ++ [ - "doc" - "dev" - ]; + outputs = [ + "out" + ] + ++ lib.optional withUtils "lib" + ++ [ + "doc" + "dev" + ]; mesonFlags = [ (lib.mesonBool "v4l-utils" withUtils) @@ -70,22 +71,22 @@ stdenv.mkDerivation (finalAttrs: { pkg-config perl udevCheckHook - ] ++ lib.optional withQt wrapQtAppsHook; + ] + ++ lib.optional withQt wrapQtAppsHook; - buildInputs = - [ - json_c - libbpf - libelf - udev - ] - ++ lib.optional (!stdenv.hostPlatform.isGnu) argp-standalone - ++ lib.optionals withQt [ - alsa-lib - qt5compat - qtbase - libGLU - ]; + buildInputs = [ + json_c + libbpf + libelf + udev + ] + ++ lib.optional (!stdenv.hostPlatform.isGnu) argp-standalone + ++ lib.optionals withQt [ + alsa-lib + qt5compat + qtbase + libGLU + ]; hardeningDisable = [ "zerocallusedregs" ]; diff --git a/pkgs/os-specific/linux/wireguard/default.nix b/pkgs/os-specific/linux/wireguard/default.nix index 64925ce884b6..733f08fa0fd9 100644 --- a/pkgs/os-specific/linux/wireguard/default.nix +++ b/pkgs/os-specific/linux/wireguard/default.nix @@ -27,17 +27,17 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl bc - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; preBuild = "cd src"; buildFlags = [ "module" ]; - makeFlags = - [ - "ARCH=${stdenv.hostPlatform.linuxArch}" - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" - ]; + makeFlags = [ + "ARCH=${stdenv.hostPlatform.linuxArch}" + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "CROSS_COMPILE=${stdenv.cc.targetPrefix}" + ]; INSTALL_MOD_PATH = placeholder "out"; installFlags = [ "DEPMOD=true" ]; diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix index d51c0bb87aed..32481a4c757e 100644 --- a/pkgs/os-specific/linux/wpa_supplicant/default.nix +++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix @@ -43,81 +43,80 @@ stdenv.mkDerivation rec { # TODO: Patch epoll so that the dbus actually responds # TODO: Figure out how to get privsep working, currently getting SIGBUS - extraConfig = - '' - #CONFIG_ELOOP_EPOLL=y - #CONFIG_PRIVSEP=y - #CONFIG_TLSV12=y see #8332 - CONFIG_AP=y - CONFIG_BGSCAN_LEARN=y - CONFIG_BGSCAN_SIMPLE=y - CONFIG_DEBUG_SYSLOG=y - CONFIG_EAP_EKE=y - CONFIG_EAP_FAST=y - CONFIG_EAP_GPSK=y - CONFIG_EAP_GPSK_SHA256=y - CONFIG_EAP_IKEV2=y - CONFIG_EAP_PAX=y - CONFIG_EAP_PWD=y - CONFIG_EAP_SAKE=y - CONFIG_ELOOP=eloop - CONFIG_EXT_PASSWORD_FILE=y - CONFIG_HS20=y - CONFIG_HT_OVERRIDES=y - CONFIG_IEEE80211AC=y - CONFIG_IEEE80211AX=y - CONFIG_IEEE80211BE=y - CONFIG_IEEE80211N=y - CONFIG_IEEE80211R=y - CONFIG_IEEE80211W=y - CONFIG_INTERNETWORKING=y - CONFIG_L2_PACKET=linux - CONFIG_LIBNL32=y - CONFIG_MESH=y - CONFIG_OWE=y - CONFIG_P2P=y - CONFIG_SAE_PK=y - CONFIG_TDLS=y - CONFIG_TLS=openssl - CONFIG_TLSV11=y - CONFIG_VHT_OVERRIDES=y - CONFIG_WNM=y - CONFIG_WPS=y - CONFIG_WPS_ER=y - CONFIG_WPS_NFS=y - CONFIG_SUITEB=y - CONFIG_SUITEB192=y - '' - + lib.optionalString withPcsclite '' - CONFIG_EAP_SIM=y - CONFIG_EAP_AKA=y - CONFIG_EAP_AKA_PRIME=y - CONFIG_PCSC=y - '' - + lib.optionalString dbusSupport '' - CONFIG_CTRL_IFACE_DBUS=y - CONFIG_CTRL_IFACE_DBUS_NEW=y - CONFIG_CTRL_IFACE_DBUS_INTRO=y - '' - # Upstream uses conditionals based on ifdef, so opposite of =y is - # not =n, as one may expect, but undefine. - # - # This config is sourced into makefile. - + lib.optionalString (!dbusSupport) '' - undefine CONFIG_CTRL_IFACE_DBUS - undefine CONFIG_CTRL_IFACE_DBUS_NEW - undefine CONFIG_CTRL_IFACE_DBUS_INTRO - '' - + ( - if withReadline then - '' - CONFIG_READLINE=y - '' - else - '' - CONFIG_WPA_CLI_EDIT=y - '' - ); + extraConfig = '' + #CONFIG_ELOOP_EPOLL=y + #CONFIG_PRIVSEP=y + #CONFIG_TLSV12=y see #8332 + CONFIG_AP=y + CONFIG_BGSCAN_LEARN=y + CONFIG_BGSCAN_SIMPLE=y + CONFIG_DEBUG_SYSLOG=y + CONFIG_EAP_EKE=y + CONFIG_EAP_FAST=y + CONFIG_EAP_GPSK=y + CONFIG_EAP_GPSK_SHA256=y + CONFIG_EAP_IKEV2=y + CONFIG_EAP_PAX=y + CONFIG_EAP_PWD=y + CONFIG_EAP_SAKE=y + CONFIG_ELOOP=eloop + CONFIG_EXT_PASSWORD_FILE=y + CONFIG_HS20=y + CONFIG_HT_OVERRIDES=y + CONFIG_IEEE80211AC=y + CONFIG_IEEE80211AX=y + CONFIG_IEEE80211BE=y + CONFIG_IEEE80211N=y + CONFIG_IEEE80211R=y + CONFIG_IEEE80211W=y + CONFIG_INTERNETWORKING=y + CONFIG_L2_PACKET=linux + CONFIG_LIBNL32=y + CONFIG_MESH=y + CONFIG_OWE=y + CONFIG_P2P=y + CONFIG_SAE_PK=y + CONFIG_TDLS=y + CONFIG_TLS=openssl + CONFIG_TLSV11=y + CONFIG_VHT_OVERRIDES=y + CONFIG_WNM=y + CONFIG_WPS=y + CONFIG_WPS_ER=y + CONFIG_WPS_NFS=y + CONFIG_SUITEB=y + CONFIG_SUITEB192=y + '' + + lib.optionalString withPcsclite '' + CONFIG_EAP_SIM=y + CONFIG_EAP_AKA=y + CONFIG_EAP_AKA_PRIME=y + CONFIG_PCSC=y + '' + + lib.optionalString dbusSupport '' + CONFIG_CTRL_IFACE_DBUS=y + CONFIG_CTRL_IFACE_DBUS_NEW=y + CONFIG_CTRL_IFACE_DBUS_INTRO=y + '' + # Upstream uses conditionals based on ifdef, so opposite of =y is + # not =n, as one may expect, but undefine. + # + # This config is sourced into makefile. + + lib.optionalString (!dbusSupport) '' + undefine CONFIG_CTRL_IFACE_DBUS + undefine CONFIG_CTRL_IFACE_DBUS_NEW + undefine CONFIG_CTRL_IFACE_DBUS_INTRO + '' + + ( + if withReadline then + '' + CONFIG_READLINE=y + '' + else + '' + CONFIG_WPA_CLI_EDIT=y + '' + ); preBuild = '' for manpage in wpa_supplicant/doc/docbook/wpa_supplicant.conf* ; do @@ -133,33 +132,31 @@ stdenv.mkDerivation rec { ${lib.optionalString withPcsclite "-I${lib.getDev pcsclite}/include/PCSC/"}" ''; - buildInputs = - [ - openssl - libnl - ] - ++ lib.optional dbusSupport dbus - ++ lib.optional withReadline readline - ++ lib.optional withPcsclite pcsclite; + buildInputs = [ + openssl + libnl + ] + ++ lib.optional dbusSupport dbus + ++ lib.optional withReadline readline + ++ lib.optional withPcsclite pcsclite; nativeBuildInputs = [ pkg-config ]; - postInstall = - '' - mkdir -p $out/share/man/man5 $out/share/man/man8 - cp -v "doc/docbook/"*.5 $out/share/man/man5/ - cp -v "doc/docbook/"*.8 $out/share/man/man8/ - '' - + lib.optionalString dbusSupport '' - mkdir -p $out/share/dbus-1/system.d $out/share/dbus-1/system-services $out/etc/systemd/system - cp -v "dbus/"*service $out/share/dbus-1/system-services - cp -v dbus/dbus-wpa_supplicant.conf $out/share/dbus-1/system.d - cp -v "systemd/"*.service $out/etc/systemd/system - '' - + '' - rm $out/share/man/man8/wpa_priv.8 - install -Dm444 wpa_supplicant.conf $out/share/doc/wpa_supplicant/wpa_supplicant.conf.example - ''; + postInstall = '' + mkdir -p $out/share/man/man5 $out/share/man/man8 + cp -v "doc/docbook/"*.5 $out/share/man/man5/ + cp -v "doc/docbook/"*.8 $out/share/man/man8/ + '' + + lib.optionalString dbusSupport '' + mkdir -p $out/share/dbus-1/system.d $out/share/dbus-1/system-services $out/etc/systemd/system + cp -v "dbus/"*service $out/share/dbus-1/system-services + cp -v dbus/dbus-wpa_supplicant.conf $out/share/dbus-1/system.d + cp -v "systemd/"*.service $out/etc/systemd/system + '' + + '' + rm $out/share/man/man8/wpa_priv.8 + install -Dm444 wpa_supplicant.conf $out/share/doc/wpa_supplicant/wpa_supplicant.conf.example + ''; passthru.tests = { inherit (nixosTests) wpa_supplicant; diff --git a/pkgs/os-specific/linux/zfs/2_2.nix b/pkgs/os-specific/linux/zfs/2_2.nix index f32312ae3d80..bdd58548f2e8 100644 --- a/pkgs/os-specific/linux/zfs/2_2.nix +++ b/pkgs/os-specific/linux/zfs/2_2.nix @@ -16,13 +16,12 @@ callPackage ./generic.nix args { # this package should point to the latest release. version = "2.2.8"; - tests = - { - inherit (nixosTests.zfs) series_2_2; - } - // lib.optionalAttrs stdenv.isx86_64 { - inherit (nixosTests.zfs) installer; - }; + tests = { + inherit (nixosTests.zfs) series_2_2; + } + // lib.optionalAttrs stdenv.isx86_64 { + inherit (nixosTests.zfs) installer; + }; maintainers = with lib.maintainers; [ adamcstephens diff --git a/pkgs/os-specific/linux/zfs/2_3.nix b/pkgs/os-specific/linux/zfs/2_3.nix index 965f4ee874f3..1b4f0e642bf5 100644 --- a/pkgs/os-specific/linux/zfs/2_3.nix +++ b/pkgs/os-specific/linux/zfs/2_3.nix @@ -16,13 +16,12 @@ callPackage ./generic.nix args { # this package should point to the latest release. version = "2.3.3"; - tests = - { - inherit (nixosTests.zfs) series_2_3; - } - // lib.optionalAttrs stdenv.isx86_64 { - inherit (nixosTests.zfs) installer; - }; + tests = { + inherit (nixosTests.zfs) series_2_3; + } + // lib.optionalAttrs stdenv.isx86_64 { + inherit (nixosTests.zfs) installer; + }; maintainers = with lib.maintainers; [ adamcstephens diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index b0b47ba8d5ec..2d74e9734c56 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -141,16 +141,15 @@ let substituteInPlace ./cmd/arc_summary --replace-fail "/sbin/modinfo" "modinfo" ''; - nativeBuildInputs = - [ - autoreconfHook269 - nukeReferences - ] - ++ optionals buildKernel (kernel.moduleBuildDependencies ++ [ perl ]) - ++ optionals buildUser [ - pkg-config - udevCheckHook - ]; + nativeBuildInputs = [ + autoreconfHook269 + nukeReferences + ] + ++ optionals buildKernel (kernel.moduleBuildDependencies ++ [ perl ]) + ++ optionals buildUser [ + pkg-config + udevCheckHook + ]; buildInputs = optionals buildUser [ zlib @@ -172,32 +171,31 @@ let "pic" ]; - configureFlags = + configureFlags = [ + "--with-config=${configFile}" + "--with-tirpc=1" + (lib.withFeatureAs (buildUser && enablePython) "python" python3.interpreter) + ] + ++ optionals buildUser [ + "--with-dracutdir=$(out)/lib/dracut" + "--with-udevdir=$(out)/lib/udev" + "--with-systemdunitdir=$(out)/etc/systemd/system" + "--with-systemdpresetdir=$(out)/etc/systemd/system-preset" + "--with-systemdgeneratordir=$(out)/lib/systemd/system-generator" + "--with-mounthelperdir=$(out)/bin" + "--libexecdir=$(out)/libexec" + "--sysconfdir=/etc" + "--localstatedir=/var" + "--enable-systemd" + "--enable-pam" + ] + ++ optionals buildKernel ( [ - "--with-config=${configFile}" - "--with-tirpc=1" - (lib.withFeatureAs (buildUser && enablePython) "python" python3.interpreter) + "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" + "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ] - ++ optionals buildUser [ - "--with-dracutdir=$(out)/lib/dracut" - "--with-udevdir=$(out)/lib/udev" - "--with-systemdunitdir=$(out)/etc/systemd/system" - "--with-systemdpresetdir=$(out)/etc/systemd/system-preset" - "--with-systemdgeneratordir=$(out)/lib/systemd/system-generator" - "--with-mounthelperdir=$(out)/bin" - "--libexecdir=$(out)/libexec" - "--sysconfdir=/etc" - "--localstatedir=/var" - "--enable-systemd" - "--enable-pam" - ] - ++ optionals buildKernel ( - [ - "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source" - "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - ] - ++ kernelModuleMakeFlags - ); + ++ kernelModuleMakeFlags + ); makeFlags = optionals buildKernel kernelModuleMakeFlags; @@ -270,45 +268,43 @@ let outputs = [ "out" ] ++ optionals buildUser [ "dev" ]; - passthru = - { - inherit kernel; - inherit enableMail kernelModuleAttribute; - latestCompatibleLinuxPackages = lib.warn "zfs.latestCompatibleLinuxPackages is deprecated and is now pointing at the default kernel. If using the stable LTS kernel (default `linuxPackages` is not possible then you must explicitly pin a specific kernel release. For example, `boot.kernelPackages = pkgs.linuxPackages_6_6`. Please be aware that non-LTS kernels are likely to go EOL before ZFS supports the latest supported non-LTS release, requiring manual intervention." linuxPackages; + passthru = { + inherit kernel; + inherit enableMail kernelModuleAttribute; + latestCompatibleLinuxPackages = lib.warn "zfs.latestCompatibleLinuxPackages is deprecated and is now pointing at the default kernel. If using the stable LTS kernel (default `linuxPackages` is not possible then you must explicitly pin a specific kernel release. For example, `boot.kernelPackages = pkgs.linuxPackages_6_6`. Please be aware that non-LTS kernels are likely to go EOL before ZFS supports the latest supported non-LTS release, requiring manual intervention." linuxPackages; - # The corresponding userspace tools to this instantiation - # of the ZFS package set. - userspaceTools = genericBuild ( - outerArgs - // { - configFile = "user"; - } - ) innerArgs; + # The corresponding userspace tools to this instantiation + # of the ZFS package set. + userspaceTools = genericBuild ( + outerArgs + // { + configFile = "user"; + } + ) innerArgs; - inherit tests; - } - // lib.optionalAttrs (kernelModuleAttribute != "zfs_unstable") { - updateScript = nix-update-script { - extraArgs = [ - "--version-regex=^zfs-(${lib.versions.major version}\\.${lib.versions.minor version}\\.[0-9]+)" - "--override-filename=pkgs/os-specific/linux/zfs/${lib.versions.major version}_${lib.versions.minor version}.nix" - ]; - }; + inherit tests; + } + // lib.optionalAttrs (kernelModuleAttribute != "zfs_unstable") { + updateScript = nix-update-script { + extraArgs = [ + "--version-regex=^zfs-(${lib.versions.major version}\\.${lib.versions.minor version}\\.[0-9]+)" + "--override-filename=pkgs/os-specific/linux/zfs/${lib.versions.major version}_${lib.versions.minor version}.nix" + ]; }; + }; meta = { description = "ZFS Filesystem Linux" + (if buildUser then " Userspace Tools" else " Kernel Module"); - longDescription = - '' - ZFS is a filesystem that combines a logical volume manager with a - Copy-On-Write filesystem with data integrity detection and repair, - snapshotting, cloning, block devices, deduplication, and more. + longDescription = '' + ZFS is a filesystem that combines a logical volume manager with a + Copy-On-Write filesystem with data integrity detection and repair, + snapshotting, cloning, block devices, deduplication, and more. - ${ - if buildUser then "This is the userspace tools package." else "This is the kernel module package." - } - '' - + extraLongDescription; + ${ + if buildUser then "This is the userspace tools package." else "This is the kernel module package." + } + '' + + extraLongDescription; homepage = "https://github.com/openzfs/zfs"; changelog = "https://github.com/openzfs/zfs/releases/tag/zfs-${version}"; license = lib.licenses.cddl; diff --git a/pkgs/servers/asterisk/default.nix b/pkgs/servers/asterisk/default.nix index fb50f3b31437..da2845f8ea80 100644 --- a/pkgs/servers/asterisk/default.nix +++ b/pkgs/servers/asterisk/default.nix @@ -47,31 +47,30 @@ let inherit version; pname = "asterisk" + lib.optionalString ldapSupport "-ldap"; - buildInputs = - [ - jansson - libedit - libxml2 - libxslt - ncurses - openssl - sqlite - dmidecode - libuuid - newt - lua - speex - srtp - wget - curl - iksemel - ] - ++ lib.optionals withOpus [ - libopus - opusfile - libogg - ] - ++ lib.optionals ldapSupport [ openldap ]; + buildInputs = [ + jansson + libedit + libxml2 + libxslt + ncurses + openssl + sqlite + dmidecode + libuuid + newt + lua + speex + srtp + wget + curl + iksemel + ] + ++ lib.optionals withOpus [ + libopus + opusfile + libogg + ] + ++ lib.optionals ldapSupport [ openldap ]; nativeBuildInputs = [ util-linux pkg-config @@ -86,7 +85,8 @@ let # This patch changes the runtime behavior to look for state # directories in /var rather than ${out}/var. ./runtime-vardirs.patch - ] ++ lib.optional withOpus "${asterisk-opus}/asterisk.patch"; + ] + ++ lib.optional withOpus "${asterisk-opus}/asterisk.patch"; postPatch = '' echo "PJPROJECT_CONFIG_OPTS += --prefix=$out" >> third-party/pjproject/Makefile.rules diff --git a/pkgs/servers/authelia/default.nix b/pkgs/servers/authelia/default.nix index 1d247e4899cb..22b4f8f88e03 100644 --- a/pkgs/servers/authelia/default.nix +++ b/pkgs/servers/authelia/default.nix @@ -60,17 +60,16 @@ buildGoModule rec { # several tests with networking and several that want chromium doCheck = false; - postInstall = - '' - mkdir -p $out/etc/authelia - cp config.template.yml $out/etc/authelia - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd authelia \ - --bash <($out/bin/authelia completion bash) \ - --fish <($out/bin/authelia completion fish) \ - --zsh <($out/bin/authelia completion zsh) - ''; + postInstall = '' + mkdir -p $out/etc/authelia + cp config.template.yml $out/etc/authelia + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd authelia \ + --bash <($out/bin/authelia completion bash) \ + --fish <($out/bin/authelia completion fish) \ + --zsh <($out/bin/authelia completion zsh) + ''; doInstallCheck = true; installCheckPhase = '' diff --git a/pkgs/servers/code-server/default.nix b/pkgs/servers/code-server/default.nix index 46977793f6fd..2494fa1e5e11 100644 --- a/pkgs/servers/code-server/default.nix +++ b/pkgs/servers/code-server/default.nix @@ -136,18 +136,17 @@ stdenv.mkDerivation (finalAttrs: { quilt ]; - buildInputs = - [ - xorg.libX11 - xorg.libxkbfile - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libsecret - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - xcbuild - ]; + buildInputs = [ + xorg.libX11 + xorg.libxkbfile + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libsecret + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + xcbuild + ]; patches = [ # Remove all git calls from the VS Code build script except `git rev-parse @@ -198,98 +197,97 @@ stdenv.mkDerivation (finalAttrs: { runHook postConfigure ''; - buildPhase = - '' - runHook preBuild + buildPhase = '' + runHook preBuild - # Apply patches. - quilt push -a + # Apply patches. + quilt push -a - export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 - export SKIP_SUBMODULE_DEPS=1 - export NODE_OPTIONS="--openssl-legacy-provider --max-old-space-size=4096" + export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 + export SKIP_SUBMODULE_DEPS=1 + export NODE_OPTIONS="--openssl-legacy-provider --max-old-space-size=4096" - # Remove all built-in extensions, as these are 3rd party extensions that - # get downloaded from the VS Code marketplace. - jq --slurp '.[0] * .[1]' "./lib/vscode/product.json" <( - cat << EOF - { - "builtInExtensions": [] - } - EOF - ) | sponge ./lib/vscode/product.json + # Remove all built-in extensions, as these are 3rd party extensions that + # get downloaded from the VS Code marketplace. + jq --slurp '.[0] * .[1]' "./lib/vscode/product.json" <( + cat << EOF + { + "builtInExtensions": [] + } + EOF + ) | sponge ./lib/vscode/product.json - # Disable automatic updates. - sed -i '/update.mode/,/\}/{s/default:.*/default: "none",/g}' \ - lib/vscode/src/vs/platform/update/common/update.config.contribution.ts + # Disable automatic updates. + sed -i '/update.mode/,/\}/{s/default:.*/default: "none",/g}' \ + lib/vscode/src/vs/platform/update/common/update.config.contribution.ts - # Patch out remote download of nodejs from build script. - patch -p1 -i ${./remove-node-download.patch} + # Patch out remote download of nodejs from build script. + patch -p1 -i ${./remove-node-download.patch} - # Install dependencies. - patchShebangs . - find . -name "yarn.lock" -printf "%h\n" | \ - xargs -I {} yarn --cwd {} \ - --offline --frozen-lockfile --ignore-scripts --ignore-engines - patchShebangs . + # Install dependencies. + patchShebangs . + find . -name "yarn.lock" -printf "%h\n" | \ + xargs -I {} yarn --cwd {} \ + --offline --frozen-lockfile --ignore-scripts --ignore-engines + patchShebangs . - # Use esbuild from nixpkgs. - ${patchEsbuild "./lib/vscode/build" "0.12.6"} - ${patchEsbuild "./lib/vscode/extensions" "0.11.23"} + # Use esbuild from nixpkgs. + ${patchEsbuild "./lib/vscode/build" "0.12.6"} + ${patchEsbuild "./lib/vscode/extensions" "0.11.23"} - # Kerberos errors while building, so remove it for now as it is not - # required. - yarn remove kerberos --cwd lib/vscode/remote --offline --frozen-lockfile --ignore-scripts --ignore-engines + # Kerberos errors while building, so remove it for now as it is not + # required. + yarn remove kerberos --cwd lib/vscode/remote --offline --frozen-lockfile --ignore-scripts --ignore-engines - # Put ripgrep binary into bin, so post-install does not try to download it. - find -name ripgrep -type d \ - -execdir mkdir -p {}/bin \; \ - -execdir ln -s ${ripgrep}/bin/rg {}/bin/rg \; + # Put ripgrep binary into bin, so post-install does not try to download it. + find -name ripgrep -type d \ + -execdir mkdir -p {}/bin \; \ + -execdir ln -s ${ripgrep}/bin/rg {}/bin/rg \; - # Run post-install scripts after patching. - find ./lib/vscode \( -path "*/node_modules/*" -or -path "*/extensions/*" \) \ - -and -type f -name "yarn.lock" -printf "%h\n" | \ - xargs -I {} sh -c 'jq -e ".scripts.postinstall" {}/package.json >/dev/null && yarn --cwd {} postinstall --frozen-lockfile --offline || true' - patchShebangs . + # Run post-install scripts after patching. + find ./lib/vscode \( -path "*/node_modules/*" -or -path "*/extensions/*" \) \ + -and -type f -name "yarn.lock" -printf "%h\n" | \ + xargs -I {} sh -c 'jq -e ".scripts.postinstall" {}/package.json >/dev/null && yarn --cwd {} postinstall --frozen-lockfile --offline || true' + patchShebangs . - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Use prebuilt binary for @parcel/watcher, which requires macOS SDK 10.13+ - # (see issue #101229). - pushd ./lib/vscode/remote/node_modules/@parcel/watcher - mkdir -p ./build/Release - mv ./prebuilds/darwin-x64/node.napi.glibc.node ./build/Release/watcher.node - jq "del(.scripts) | .gypfile = false" ./package.json | sponge ./package.json - popd - '' - + '' + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # Use prebuilt binary for @parcel/watcher, which requires macOS SDK 10.13+ + # (see issue #101229). + pushd ./lib/vscode/remote/node_modules/@parcel/watcher + mkdir -p ./build/Release + mv ./prebuilds/darwin-x64/node.napi.glibc.node ./build/Release/watcher.node + jq "del(.scripts) | .gypfile = false" ./package.json | sponge ./package.json + popd + '' + + '' - # Build binary packages (argon2, node-pty, etc). - npm rebuild --offline - npm rebuild --offline --prefix lib/vscode/remote + # Build binary packages (argon2, node-pty, etc). + npm rebuild --offline + npm rebuild --offline --prefix lib/vscode/remote - # Build code-server and VS Code. - yarn build - VERSION=${finalAttrs.version} yarn build:vscode + # Build code-server and VS Code. + yarn build + VERSION=${finalAttrs.version} yarn build:vscode - # Inject version into package.json. - jq --slurp '.[0] * .[1]' ./package.json <( - cat << EOF - { - "version": "${finalAttrs.version}" - } - EOF - ) | sponge ./package.json + # Inject version into package.json. + jq --slurp '.[0] * .[1]' ./package.json <( + cat << EOF + { + "version": "${finalAttrs.version}" + } + EOF + ) | sponge ./package.json - # Create release, keeping all dependencies. - KEEP_MODULES=1 yarn release + # Create release, keeping all dependencies. + KEEP_MODULES=1 yarn release - # Prune development dependencies. We only need to do this for the root as - # the VS Code build process already does this for VS Code. - npm prune --omit=dev --prefix release + # Prune development dependencies. We only need to do this for the root as + # the VS Code build process already does this for VS Code. + npm prune --omit=dev --prefix release - runHook postBuild - ''; + runHook postBuild + ''; installPhase = '' runHook preInstall diff --git a/pkgs/servers/dns/knot-resolver/default.nix b/pkgs/servers/dns/knot-resolver/default.nix index a6ae26271324..a589b7fb93bb 100644 --- a/pkgs/servers/dns/knot-resolver/default.nix +++ b/pkgs/servers/dns/knot-resolver/default.nix @@ -48,33 +48,32 @@ let ]; # Path fixups for the NixOS service. - postPatch = - '' - patch meson.build < daemon/lua/trust_anchors.test/bootstrap.test.lua - sed -E '/^[[:blank:]]*test_(dstaddr|headers),?$/d' -i \ - tests/config/doh2.test.lua modules/http/http_doh.test.lua - ''; + # On x86_64-darwin loading by soname fails to find the libs, surprisingly. + # Even though they should already be loaded and they're in RPATH, too. + for f in daemon/lua/{kres,zonefile}.lua; do + substituteInPlace "$f" \ + --replace-fail "ffi.load(" "ffi.load('${lib.getLib knot-dns}/lib/' .. " + done + '' + # some tests have issues with network sandboxing, apparently + + optionalString doInstallCheck '' + echo 'os.exit(77)' > daemon/lua/trust_anchors.test/bootstrap.test.lua + sed -E '/^[[:blank:]]*test_(dstaddr|headers),?$/d' -i \ + tests/config/doh2.test.lua modules/http/http_doh.test.lua + ''; preConfigure = '' patchShebangs scripts/ @@ -87,52 +86,49 @@ let ]; # http://knot-resolver.readthedocs.io/en/latest/build.html#requirements - buildInputs = - [ - knot-dns - lua.lua - libuv - gnutls - lmdb - ] - ## the rest are optional dependencies - ++ optionals stdenv.hostPlatform.isLinux [ - # lib - systemd - libcap_ng - ] - ++ [ - jemalloc - nghttp2 - ] - ++ [ - fstrm - protobufc - ] # dnstap support + buildInputs = [ + knot-dns + lua.lua + libuv + gnutls + lmdb + ] + ## the rest are optional dependencies + ++ optionals stdenv.hostPlatform.isLinux [ + # lib + systemd + libcap_ng + ] + ++ [ + jemalloc + nghttp2 + ] + ++ [ + fstrm + protobufc + ] # dnstap support ; - mesonFlags = - [ - "-Dkeyfile_default=${dns-root-data}/root.ds" - "-Droot_hints=${dns-root-data}/root.hints" - "-Dinstall_kresd_conf=disabled" # not really useful; examples are inside share/doc/ - "-Dmalloc=jemalloc" - "--default-library=static" # not used by anyone - ] - ++ optional doInstallCheck "-Dunit_tests=enabled" - ++ optional doInstallCheck "-Dconfig_tests=enabled" - ++ optional stdenv.hostPlatform.isLinux "-Dsystemd_files=enabled" # used by NixOS service + mesonFlags = [ + "-Dkeyfile_default=${dns-root-data}/root.ds" + "-Droot_hints=${dns-root-data}/root.hints" + "-Dinstall_kresd_conf=disabled" # not really useful; examples are inside share/doc/ + "-Dmalloc=jemalloc" + "--default-library=static" # not used by anyone + ] + ++ optional doInstallCheck "-Dunit_tests=enabled" + ++ optional doInstallCheck "-Dconfig_tests=enabled" + ++ optional stdenv.hostPlatform.isLinux "-Dsystemd_files=enabled" # used by NixOS service #"-Dextra_tests=enabled" # not suitable as in-distro tests; many deps, too. ; - postInstall = - '' - rm "$out"/lib/libkres.a - rm "$out"/lib/knot-resolver/upgrade-4-to-5.lua # not meaningful on NixOS - '' - + optionalString stdenv.hostPlatform.isLinux '' - rm -r "$out"/lib/sysusers.d/ # ATM more likely to harm than help - ''; + postInstall = '' + rm "$out"/lib/libkres.a + rm "$out"/lib/knot-resolver/upgrade-4-to-5.lua # not meaningful on NixOS + '' + + optionalString stdenv.hostPlatform.isLinux '' + rm -r "$out"/lib/sysusers.d/ # ATM more likely to harm than help + ''; doInstallCheck = with stdenv; hostPlatform == buildPlatform; nativeInstallCheckInputs = [ diff --git a/pkgs/servers/dns/nsd/default.nix b/pkgs/servers/dns/nsd/default.nix index 30132403da78..252604ba9e82 100644 --- a/pkgs/servers/dns/nsd/default.nix +++ b/pkgs/servers/dns/nsd/default.nix @@ -36,15 +36,14 @@ stdenv.mkDerivation rec { substituteInPlace nsd-control-setup.sh.in --replace openssl ${openssl}/bin/openssl ''; - buildInputs = - [ - libevent - openssl - ] - ++ lib.optionals withSystemd [ - systemdMinimal - pkg-config - ]; + buildInputs = [ + libevent + openssl + ] + ++ lib.optionals withSystemd [ + systemdMinimal + pkg-config + ]; enableParallelBuilding = true; diff --git a/pkgs/servers/firebird/default.nix b/pkgs/servers/firebird/default.nix index dca4bf5146d1..557231de14f3 100644 --- a/pkgs/servers/firebird/default.nix +++ b/pkgs/servers/firebird/default.nix @@ -43,7 +43,8 @@ let configureFlags = [ "--with-system-editline" - ] ++ (lib.optional superServer "--enable-superserver"); + ] + ++ (lib.optional superServer "--enable-superserver"); installPhase = '' runHook preInstall diff --git a/pkgs/servers/home-assistant/build-custom-component/default.nix b/pkgs/servers/home-assistant/build-custom-component/default.nix index a3b5b5d5e834..1033f50d045d 100644 --- a/pkgs/servers/home-assistant/build-custom-component/default.nix +++ b/pkgs/servers/home-assistant/build-custom-component/default.nix @@ -55,11 +55,13 @@ home-assistant.python.pkgs.buildPythonPackage ( passthru = { isHomeAssistantComponent = true; - } // args.passthru or { }; + } + // args.passthru or { }; meta = { inherit (home-assistant.meta) platforms; - } // args.meta or { }; + } + // args.meta or { }; } // builtins.removeAttrs args [ diff --git a/pkgs/servers/home-assistant/custom-components/frigate/package.nix b/pkgs/servers/home-assistant/custom-components/frigate/package.nix index c1e268446157..eb9c379f5d06 100644 --- a/pkgs/servers/home-assistant/custom-components/frigate/package.nix +++ b/pkgs/servers/home-assistant/custom-components/frigate/package.nix @@ -29,17 +29,16 @@ buildHomeAssistantComponent rec { dependencies = [ hass-web-proxy-lib ]; - nativeCheckInputs = - [ - homeassistant - pytest-aiohttp - pytest-cov-stub - pytest-homeassistant-custom-component - pytest-timeout - pytestCheckHook - ] - ++ (homeassistant.getPackages "mqtt" homeassistant.python.pkgs) - ++ (homeassistant.getPackages "stream" homeassistant.python.pkgs); + nativeCheckInputs = [ + homeassistant + pytest-aiohttp + pytest-cov-stub + pytest-homeassistant-custom-component + pytest-timeout + pytestCheckHook + ] + ++ (homeassistant.getPackages "mqtt" homeassistant.python.pkgs) + ++ (homeassistant.getPackages "stream" homeassistant.python.pkgs); disabledTests = [ # https://github.com/blakeblackshear/frigate-hass-integration/issues/922 diff --git a/pkgs/servers/home-assistant/custom-components/yandex-station/package.nix b/pkgs/servers/home-assistant/custom-components/yandex-station/package.nix index 231af74406f3..bed422d2365f 100644 --- a/pkgs/servers/home-assistant/custom-components/yandex-station/package.nix +++ b/pkgs/servers/home-assistant/custom-components/yandex-station/package.nix @@ -30,7 +30,8 @@ buildHomeAssistantComponent rec { nativeCheckInputs = [ home-assistant pytestCheckHook - ] ++ (home-assistant.getPackages "stream" home-assistant.python.pkgs); + ] + ++ (home-assistant.getPackages "stream" home-assistant.python.pkgs); meta = { description = "Controlling Yandex.Station and other smart home devices with Alice from Home Assistant"; diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix index cc73ff8591aa..dce4ce4ce0c9 100644 --- a/pkgs/servers/http/apache-httpd/2.4.nix +++ b/pkgs/servers/http/apache-httpd/2.4.nix @@ -66,19 +66,18 @@ stdenv.mkDerivation rec { which ]; - buildInputs = - [ - perl - libxcrypt - zlib - ] - ++ lib.optional brotliSupport brotli - ++ lib.optional sslSupport openssl - ++ lib.optional ldapSupport openldap - # there is no --with-ldap flag - ++ lib.optional libxml2Support libxml2 - ++ lib.optional http2Support nghttp2 - ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; + buildInputs = [ + perl + libxcrypt + zlib + ] + ++ lib.optional brotliSupport brotli + ++ lib.optional sslSupport openssl + ++ lib.optional ldapSupport openldap + # there is no --with-ldap flag + ++ lib.optional libxml2Support libxml2 + ++ lib.optional http2Support nghttp2 + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv; postPatch = '' sed -i config.layout -e "s|installbuilddir:.*|installbuilddir: $dev/share/build|" @@ -89,39 +88,38 @@ stdenv.mkDerivation rec { # Required for ‘pthread_cancel’. NIX_LDFLAGS = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-lgcc_s"; - configureFlags = - [ - "--with-apr=${apr.dev}" - "--with-apr-util=${aprutil.dev}" - "--with-z=${zlib.dev}" - "--with-pcre=${pcre2.dev}/bin/pcre2-config" - "--disable-maintainer-mode" - "--disable-debugger-mode" - "--enable-mods-shared=all" - "--enable-mpms-shared=all" - "--enable-cern-meta" - "--enable-imagemap" - "--enable-cgi" - "--includedir=${placeholder "dev"}/include" - (lib.enableFeature proxySupport "proxy") - (lib.enableFeature sslSupport "ssl") - (lib.withFeatureAs libxml2Support "libxml2" "${libxml2.dev}/include/libxml2") - "--docdir=$(doc)/share/doc" + configureFlags = [ + "--with-apr=${apr.dev}" + "--with-apr-util=${aprutil.dev}" + "--with-z=${zlib.dev}" + "--with-pcre=${pcre2.dev}/bin/pcre2-config" + "--disable-maintainer-mode" + "--disable-debugger-mode" + "--enable-mods-shared=all" + "--enable-mpms-shared=all" + "--enable-cern-meta" + "--enable-imagemap" + "--enable-cgi" + "--includedir=${placeholder "dev"}/include" + (lib.enableFeature proxySupport "proxy") + (lib.enableFeature sslSupport "ssl") + (lib.withFeatureAs libxml2Support "libxml2" "${libxml2.dev}/include/libxml2") + "--docdir=$(doc)/share/doc" - (lib.enableFeature brotliSupport "brotli") - (lib.withFeatureAs brotliSupport "brotli" brotli) + (lib.enableFeature brotliSupport "brotli") + (lib.withFeatureAs brotliSupport "brotli" brotli) - (lib.enableFeature http2Support "http2") - (lib.withFeature http2Support "nghttp2") + (lib.enableFeature http2Support "http2") + (lib.withFeature http2Support "nghttp2") - (lib.enableFeature luaSupport "lua") - (lib.withFeatureAs luaSupport "lua" lua5) - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - # skip bad config check when cross compiling - # https://gitlab.com/buildroot.org/buildroot/-/blob/5dae8cddeecf16c791f3c138542ec51c4e627d75/package/apache/apache.mk#L23 - "ap_cv_void_ptr_lt_long=no" - ]; + (lib.enableFeature luaSupport "lua") + (lib.withFeatureAs luaSupport "lua" lua5) + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + # skip bad config check when cross compiling + # https://gitlab.com/buildroot.org/buildroot/-/blob/5dae8cddeecf16c791f3c138542ec51c4e627d75/package/apache/apache.mk#L23 + "ap_cv_void_ptr_lt_long=no" + ]; enableParallelBuilding = true; diff --git a/pkgs/servers/http/apache-modules/mod_python/default.nix b/pkgs/servers/http/apache-modules/mod_python/default.nix index 6a1afb6b5d59..e560cc75512c 100644 --- a/pkgs/servers/http/apache-modules/mod_python/default.nix +++ b/pkgs/servers/http/apache-modules/mod_python/default.nix @@ -31,20 +31,19 @@ stdenv.mkDerivation (finalAttrs: { ensureNewerSourcesForZipFilesHook ]; - buildInputs = - [ - apacheHttpd - (python3.withPackages ( - ps: with ps; [ - distutils - packaging - setuptools - ] - )) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libintl - ]; + buildInputs = [ + apacheHttpd + (python3.withPackages ( + ps: with ps; [ + distutils + packaging + setuptools + ] + )) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libintl + ]; passthru = { inherit apacheHttpd; diff --git a/pkgs/servers/http/couchdb/3.nix b/pkgs/servers/http/couchdb/3.nix index c0df8f06bb4e..50d1d63a9825 100644 --- a/pkgs/servers/http/couchdb/3.nix +++ b/pkgs/servers/http/couchdb/3.nix @@ -19,17 +19,16 @@ stdenv.mkDerivation rec { hash = "sha256-api5CpqYC77yw1tJlqjnGi8a5SJ1RshfBMQ2EBvfeL8="; }; - postPatch = - '' - substituteInPlace src/couch/rebar.config.script --replace '/usr/include/mozjs-91' "${spidermonkey_91.dev}/include/mozjs-91" - substituteInPlace configure --replace '/usr/include/''${SM_HEADERS}' "${spidermonkey_91.dev}/include/mozjs-91" - patchShebangs bin/rebar - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - # LTO with Clang produces LLVM bitcode, which causes linking to fail quietly. - # (There are warnings, but no hard errors, and it produces an empty dylib.) - substituteInPlace src/jiffy/rebar.config.script --replace '"-flto"' '""' - ''; + postPatch = '' + substituteInPlace src/couch/rebar.config.script --replace '/usr/include/mozjs-91' "${spidermonkey_91.dev}/include/mozjs-91" + substituteInPlace configure --replace '/usr/include/''${SM_HEADERS}' "${spidermonkey_91.dev}/include/mozjs-91" + patchShebangs bin/rebar + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + # LTO with Clang produces LLVM bitcode, which causes linking to fail quietly. + # (There are warnings, but no hard errors, and it produces an empty dylib.) + substituteInPlace src/jiffy/rebar.config.script --replace '"-flto"' '""' + ''; nativeBuildInputs = [ erlang diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix index 69dc64712451..34356f77fab4 100644 --- a/pkgs/servers/http/nginx/generic.nix +++ b/pkgs/servers/http/nginx/generic.nix @@ -97,84 +97,83 @@ stdenv.mkDerivation { nativeBuildInputs = [ installShellFiles removeReferencesTo - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; - buildInputs = - [ - openssl - zlib-ng - pcre2 - libxml2 - libxslt - perl - ] - ++ buildInputs - ++ mapModules "inputs" - ++ lib.optional withGeoIP geoip - ++ lib.optional withImageFilter gd; + buildInputs = [ + openssl + zlib-ng + pcre2 + libxml2 + libxslt + perl + ] + ++ buildInputs + ++ mapModules "inputs" + ++ lib.optional withGeoIP geoip + ++ lib.optional withImageFilter gd; - configureFlags = - [ - "--sbin-path=bin/nginx" - "--with-http_ssl_module" - "--with-http_v2_module" - "--with-http_realip_module" - "--with-http_addition_module" - "--with-http_xslt_module" - "--with-http_sub_module" - "--with-http_dav_module" - "--with-http_flv_module" - "--with-http_mp4_module" - "--with-http_gunzip_module" - "--with-http_gzip_static_module" - "--with-http_auth_request_module" - "--with-http_random_index_module" - "--with-http_secure_link_module" - "--with-http_degradation_module" - "--with-http_stub_status_module" - "--with-threads" - "--with-pcre-jit" - "--http-log-path=/var/log/nginx/access.log" - "--error-log-path=/var/log/nginx/error.log" - "--pid-path=/var/log/nginx/nginx.pid" - "--http-client-body-temp-path=/tmp/nginx_client_body" - "--http-proxy-temp-path=/tmp/nginx_proxy" - "--http-fastcgi-temp-path=/tmp/nginx_fastcgi" - "--http-uwsgi-temp-path=/tmp/nginx_uwsgi" - "--http-scgi-temp-path=/tmp/nginx_scgi" - ] - ++ lib.optionals withDebug [ - "--with-debug" - ] - ++ lib.optionals withKTLS [ - "--with-openssl-opt=enable-ktls" - ] - ++ lib.optionals withStream [ - "--with-stream" - "--with-stream_realip_module" - "--with-stream_ssl_module" - "--with-stream_ssl_preread_module" - ] - ++ lib.optionals withMail [ - "--with-mail" - "--with-mail_ssl_module" - ] - ++ lib.optionals withPerl [ - "--with-http_perl_module" - "--with-perl=${perl}/bin/perl" - "--with-perl_modules_path=lib/perl5" - ] - ++ lib.optional withImageFilter "--with-http_image_filter_module" - ++ lib.optional withSlice "--with-http_slice_module" - ++ lib.optionals withGeoIP ( - [ "--with-http_geoip_module" ] ++ lib.optional withStream "--with-stream_geoip_module" - ) - ++ lib.optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" - ++ lib.optional ( - stdenv.buildPlatform != stdenv.hostPlatform - ) "--crossbuild=${stdenv.hostPlatform.uname.system}::${stdenv.hostPlatform.uname.processor}" - ++ configureFlags - ++ map (mod: "--add-module=${mod.src}") modules; + configureFlags = [ + "--sbin-path=bin/nginx" + "--with-http_ssl_module" + "--with-http_v2_module" + "--with-http_realip_module" + "--with-http_addition_module" + "--with-http_xslt_module" + "--with-http_sub_module" + "--with-http_dav_module" + "--with-http_flv_module" + "--with-http_mp4_module" + "--with-http_gunzip_module" + "--with-http_gzip_static_module" + "--with-http_auth_request_module" + "--with-http_random_index_module" + "--with-http_secure_link_module" + "--with-http_degradation_module" + "--with-http_stub_status_module" + "--with-threads" + "--with-pcre-jit" + "--http-log-path=/var/log/nginx/access.log" + "--error-log-path=/var/log/nginx/error.log" + "--pid-path=/var/log/nginx/nginx.pid" + "--http-client-body-temp-path=/tmp/nginx_client_body" + "--http-proxy-temp-path=/tmp/nginx_proxy" + "--http-fastcgi-temp-path=/tmp/nginx_fastcgi" + "--http-uwsgi-temp-path=/tmp/nginx_uwsgi" + "--http-scgi-temp-path=/tmp/nginx_scgi" + ] + ++ lib.optionals withDebug [ + "--with-debug" + ] + ++ lib.optionals withKTLS [ + "--with-openssl-opt=enable-ktls" + ] + ++ lib.optionals withStream [ + "--with-stream" + "--with-stream_realip_module" + "--with-stream_ssl_module" + "--with-stream_ssl_preread_module" + ] + ++ lib.optionals withMail [ + "--with-mail" + "--with-mail_ssl_module" + ] + ++ lib.optionals withPerl [ + "--with-http_perl_module" + "--with-perl=${perl}/bin/perl" + "--with-perl_modules_path=lib/perl5" + ] + ++ lib.optional withImageFilter "--with-http_image_filter_module" + ++ lib.optional withSlice "--with-http_slice_module" + ++ lib.optionals withGeoIP ( + [ "--with-http_geoip_module" ] ++ lib.optional withStream "--with-stream_geoip_module" + ) + ++ lib.optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" + ++ lib.optional ( + stdenv.buildPlatform != stdenv.hostPlatform + ) "--crossbuild=${stdenv.hostPlatform.uname.system}::${stdenv.hostPlatform.uname.processor}" + ++ configureFlags + ++ map (mod: "--add-module=${mod.src}") modules; env.NIX_CFLAGS_COMPILE = toString ( [ @@ -207,12 +206,11 @@ stdenv.mkDerivation { # Disable _multioutConfig hook which adds --bindir=$out/bin into configureFlags, # which breaks build, since nginx does not actually use autoconf. - preConfigure = - '' - setOutputFlags= - '' - + preConfigure - + lib.concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules; + preConfigure = '' + setOutputFlags= + '' + + preConfigure + + lib.concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules; patches = map fixPatch ( @@ -248,18 +246,17 @@ stdenv.mkDerivation { enableParallelBuilding = true; - preInstall = - '' - mkdir -p $doc - cp -r ${nginx-doc}/* $doc + preInstall = '' + mkdir -p $doc + cp -r ${nginx-doc}/* $doc - # TODO: make it unconditional when `openresty` and `nginx` are not - # sharing this code. - if [[ -e man/nginx.8 ]]; then - installManPage man/nginx.8 - fi - '' - + preInstall; + # TODO: make it unconditional when `openresty` and `nginx` are not + # sharing this code. + if [[ -e man/nginx.8 ]]; then + installManPage man/nginx.8 + fi + '' + + preInstall; disallowedReferences = map (m: m.src) modules; @@ -289,7 +286,8 @@ stdenv.mkDerivation { ; variants = lib.recurseIntoAttrs nixosTests.nginx-variants; acme-integration = nixosTests.acme.nginx; - } // passthru.tests; + } + // passthru.tests; }; meta = diff --git a/pkgs/servers/http/tengine/default.nix b/pkgs/servers/http/tengine/default.nix index d60b8ec7815b..5a856b21c541 100644 --- a/pkgs/servers/http/tengine/default.nix +++ b/pkgs/servers/http/tengine/default.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation rec { geoip gperftools jemalloc - ] ++ lib.concatMap (mod: mod.inputs or [ ]) modules; + ] + ++ lib.concatMap (mod: mod.inputs or [ ]) modules; patches = [ ../nginx/nix-etag-1.15.4.patch @@ -60,76 +61,75 @@ stdenv.mkDerivation rec { --replace-fail '@nixStoreDirLen@' "''${#NIX_STORE}" ''; - configureFlags = - [ - "--with-http_ssl_module" - "--with-http_v2_module" - "--with-http_realip_module" - "--with-http_addition_module" - "--with-http_xslt_module" - "--with-http_geoip_module" - "--with-http_sub_module" - "--with-http_dav_module" - "--with-http_flv_module" - "--with-http_mp4_module" - "--with-http_gunzip_module" - "--with-http_gzip_static_module" - "--with-http_auth_request_module" - "--with-http_random_index_module" - "--with-http_secure_link_module" - "--with-http_degradation_module" - "--with-http_stub_status_module" - "--with-threads" - "--with-pcre-jit" - "--with-http_slice_module" - "--with-select_module" - "--with-poll_module" - "--with-google_perftools_module" - "--with-jemalloc" - "--http-log-path=/var/log/nginx/access.log" - "--error-log-path=/var/log/nginx/error.log" - "--pid-path=/var/log/nginx/nginx.pid" - "--http-client-body-temp-path=/var/cache/nginx/client_body" - "--http-proxy-temp-path=/var/cache/nginx/proxy" - "--http-fastcgi-temp-path=/var/cache/nginx/fastcgi" - "--http-uwsgi-temp-path=/var/cache/nginx/uwsgi" - "--http-scgi-temp-path=/var/cache/nginx/scgi" - ] - ++ optionals withDebug [ - "--with-debug" - ] - ++ optionals withMail [ - "--with-mail" - "--with-mail_ssl_module" - ] - ++ optionals (!withMail) [ - "--without-mail_pop3_module" - "--without-mail_imap_module" - "--without-mail_smtp_module" - ] - ++ optionals withStream [ - "--with-stream" - "--with-stream_ssl_module" - "--with-stream_realip_module" - "--with-stream_geoip_module" - "--with-stream_ssl_preread_module" - "--with-stream_sni" - ] - ++ optionals (!withStream) [ - "--without-stream_limit_conn_module" - "--without-stream_access_module" - "--without-stream_geo_module" - "--without-stream_map_module" - "--without-stream_split_clients_module" - "--without-stream_return_module" - "--without-stream_upstream_hash_module" - "--without-stream_upstream_least_conn_module" - "--without-stream_upstream_random_module" - "--without-stream_upstream_zone_module" - ] - ++ optional (gd != null) "--with-http_image_filter_module" - ++ optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" - ++ map (mod: "--add-module=${mod.src}") modules; + configureFlags = [ + "--with-http_ssl_module" + "--with-http_v2_module" + "--with-http_realip_module" + "--with-http_addition_module" + "--with-http_xslt_module" + "--with-http_geoip_module" + "--with-http_sub_module" + "--with-http_dav_module" + "--with-http_flv_module" + "--with-http_mp4_module" + "--with-http_gunzip_module" + "--with-http_gzip_static_module" + "--with-http_auth_request_module" + "--with-http_random_index_module" + "--with-http_secure_link_module" + "--with-http_degradation_module" + "--with-http_stub_status_module" + "--with-threads" + "--with-pcre-jit" + "--with-http_slice_module" + "--with-select_module" + "--with-poll_module" + "--with-google_perftools_module" + "--with-jemalloc" + "--http-log-path=/var/log/nginx/access.log" + "--error-log-path=/var/log/nginx/error.log" + "--pid-path=/var/log/nginx/nginx.pid" + "--http-client-body-temp-path=/var/cache/nginx/client_body" + "--http-proxy-temp-path=/var/cache/nginx/proxy" + "--http-fastcgi-temp-path=/var/cache/nginx/fastcgi" + "--http-uwsgi-temp-path=/var/cache/nginx/uwsgi" + "--http-scgi-temp-path=/var/cache/nginx/scgi" + ] + ++ optionals withDebug [ + "--with-debug" + ] + ++ optionals withMail [ + "--with-mail" + "--with-mail_ssl_module" + ] + ++ optionals (!withMail) [ + "--without-mail_pop3_module" + "--without-mail_imap_module" + "--without-mail_smtp_module" + ] + ++ optionals withStream [ + "--with-stream" + "--with-stream_ssl_module" + "--with-stream_realip_module" + "--with-stream_geoip_module" + "--with-stream_ssl_preread_module" + "--with-stream_sni" + ] + ++ optionals (!withStream) [ + "--without-stream_limit_conn_module" + "--without-stream_access_module" + "--without-stream_geo_module" + "--without-stream_map_module" + "--without-stream_split_clients_module" + "--without-stream_return_module" + "--without-stream_upstream_hash_module" + "--without-stream_upstream_least_conn_module" + "--without-stream_upstream_random_module" + "--without-stream_upstream_zone_module" + ] + ++ optional (gd != null) "--with-http_image_filter_module" + ++ optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" + ++ map (mod: "--add-module=${mod.src}") modules; env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2 -Wno-error=implicit-fallthrough" diff --git a/pkgs/servers/irc/solanum/default.nix b/pkgs/servers/irc/solanum/default.nix index 2dbd9ab7f6ce..ac3793dd43bc 100644 --- a/pkgs/servers/irc/solanum/default.nix +++ b/pkgs/servers/irc/solanum/default.nix @@ -33,19 +33,18 @@ stdenv.mkDerivation { substituteInPlace include/defaults.h --replace 'ETCPATH "' '"/etc/solanum' ''; - configureFlags = - [ - "--enable-epoll" - "--enable-ipv6" - "--enable-openssl=${openssl.dev}" - "--with-program-prefix=solanum-" - "--localstatedir=/var/lib" - "--with-rundir=/run" - "--with-logdir=/var/log" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - "--enable-sctp=${lksctp-tools.out}/lib" - ]; + configureFlags = [ + "--enable-epoll" + "--enable-ipv6" + "--enable-openssl=${openssl.dev}" + "--with-program-prefix=solanum-" + "--localstatedir=/var/lib" + "--with-rundir=/run" + "--with-logdir=/var/log" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + "--enable-sctp=${lksctp-tools.out}/lib" + ]; nativeBuildInputs = [ autoreconfHook diff --git a/pkgs/servers/klipper/klipper-flash.nix b/pkgs/servers/klipper/klipper-flash.nix index 866e39842167..7a6652580654 100644 --- a/pkgs/servers/klipper/klipper-flash.nix +++ b/pkgs/servers/klipper/klipper-flash.nix @@ -25,14 +25,13 @@ let in writeShellApplication { name = "klipper-flash-${mcu}"; - runtimeInputs = - [ - python3 - pkgsCross.avr.stdenv.cc - gnumake - ] - ++ lib.optionals (boardArch == "avr") [ avrdude ] - ++ lib.optionals (boardArch == "stm32") [ stm32flash ]; + runtimeInputs = [ + python3 + pkgsCross.avr.stdenv.cc + gnumake + ] + ++ lib.optionals (boardArch == "avr") [ avrdude ] + ++ lib.optionals (boardArch == "stm32") [ stm32flash ]; text = '' if ${lib.boolToString (!builtins.elem boardArch supportedArches)}; then printf "Flashing Klipper firmware to your board is not supported yet.\n" diff --git a/pkgs/servers/mail/mailman/hyperkitty.nix b/pkgs/servers/mail/mailman/hyperkitty.nix index 3e394eb1a1b9..d921b1dc7b7a 100644 --- a/pkgs/servers/mail/mailman/hyperkitty.nix +++ b/pkgs/servers/mail/mailman/hyperkitty.nix @@ -66,7 +66,8 @@ buildPythonPackage rec { elasticsearch mock whoosh - ] ++ beautifulsoup4.optional-dependencies.lxml; + ] + ++ beautifulsoup4.optional-dependencies.lxml; checkPhase = '' cd $NIX_BUILD_TOP/$sourceRoot diff --git a/pkgs/servers/mail/mailman/postorius.nix b/pkgs/servers/mail/mailman/postorius.nix index 257b1265d8d1..7b5f140d3b27 100644 --- a/pkgs/servers/mail/mailman/postorius.nix +++ b/pkgs/servers/mail/mailman/postorius.nix @@ -20,7 +20,8 @@ buildPythonPackage rec { propagatedBuildInputs = [ django-mailman3 readme-renderer - ] ++ readme-renderer.optional-dependencies.md; + ] + ++ readme-renderer.optional-dependencies.md; nativeCheckInputs = [ beautifulsoup4 vcrpy diff --git a/pkgs/servers/mail/nullmailer/default.nix b/pkgs/servers/mail/nullmailer/default.nix index d91d8f4cb930..6276035dc3e0 100644 --- a/pkgs/servers/mail/nullmailer/default.nix +++ b/pkgs/servers/mail/nullmailer/default.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { configureFlags = [ "--sysconfdir=/etc" "--localstatedir=/var" - ] ++ lib.optional tls "--enable-tls"; + ] + ++ lib.optional tls "--enable-tls"; installFlags = [ "DESTDIR=$(out)" ]; diff --git a/pkgs/servers/mail/public-inbox/default.nix b/pkgs/servers/mail/public-inbox/default.nix index 90d699a24ffb..32effee18f62 100644 --- a/pkgs/servers/mail/public-inbox/default.nix +++ b/pkgs/servers/mail/public-inbox/default.nix @@ -136,22 +136,21 @@ buildPerlPackage rec { ]; doCheck = !stdenv.hostPlatform.isDarwin; - nativeCheckInputs = - [ - curl - git - openssl - pkg-config - sqlite - xapian - EmailMIME - PlackTestExternalServer - TestSimple13 - XMLTreePP - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - LinuxInotify2 - ]; + nativeCheckInputs = [ + curl + git + openssl + pkg-config + sqlite + xapian + EmailMIME + PlackTestExternalServer + TestSimple13 + XMLTreePP + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + LinuxInotify2 + ]; preCheck = '' perl certs/create-certs.perl export TEST_LEI_ERR_LOUD=1 diff --git a/pkgs/servers/mir/common.nix b/pkgs/servers/mir/common.nix index a9e66792a87c..6580ff023991 100644 --- a/pkgs/servers/mir/common.nix +++ b/pkgs/servers/mir/common.nix @@ -60,31 +60,30 @@ stdenv.mkDerivation (finalAttrs: { inherit patches; - postPatch = - '' - # Fix scripts that get run in tests - patchShebangs tools/detect_fd_leaks.bash tests/acceptance-tests/wayland-generator/test_wayland_generator.sh.in + postPatch = '' + # Fix scripts that get run in tests + patchShebangs tools/detect_fd_leaks.bash tests/acceptance-tests/wayland-generator/test_wayland_generator.sh.in - # Fix LD_PRELOADing in tests - substituteInPlace \ - cmake/MirCommon.cmake \ - tests/umock-acceptance-tests/CMakeLists.txt \ - tests/unit-tests/platforms/gbm-kms/kms/CMakeLists.txt \ - tests/unit-tests/CMakeLists.txt \ - --replace-warn 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \ - --replace-warn 'LD_PRELOAD=libumockdev-preload.so.0' 'LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0' + # Fix LD_PRELOADing in tests + substituteInPlace \ + cmake/MirCommon.cmake \ + tests/umock-acceptance-tests/CMakeLists.txt \ + tests/unit-tests/platforms/gbm-kms/kms/CMakeLists.txt \ + tests/unit-tests/CMakeLists.txt \ + --replace-warn 'LD_PRELOAD=liblttng-ust-fork.so' 'LD_PRELOAD=${lib.getLib lttng-ust}/lib/liblttng-ust-fork.so' \ + --replace-warn 'LD_PRELOAD=libumockdev-preload.so.0' 'LD_PRELOAD=${lib.getLib umockdev}/lib/libumockdev-preload.so.0' - # Fix Xwayland default - substituteInPlace src/miral/x11_support.cpp \ - --replace-fail '/usr/bin/Xwayland' '${lib.getExe xwayland}' - '' - + lib.optionalString (lib.strings.versionOlder version "2.18.0") '' + # Fix Xwayland default + substituteInPlace src/miral/x11_support.cpp \ + --replace-fail '/usr/bin/Xwayland' '${lib.getExe xwayland}' + '' + + lib.optionalString (lib.strings.versionOlder version "2.18.0") '' - # Fix paths for generating drm-formats - substituteInPlace src/platform/graphics/CMakeLists.txt \ - --replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \ - --replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" - ''; + # Fix paths for generating drm-formats + substituteInPlace src/platform/graphics/CMakeLists.txt \ + --replace-fail "/usr/include/drm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" \ + --replace-fail "/usr/include/libdrm/drm_fourcc.h" "${lib.getDev libdrm}/include/libdrm/drm_fourcc.h" + ''; strictDeps = true; @@ -106,39 +105,38 @@ stdenv.mkDerivation (finalAttrs: { wayland-scanner ]; - buildInputs = - [ - boost - egl-wayland - freetype - glib - glm - libdrm - libepoxy - libevdev - libglvnd - libinput - libuuid - libxcb - libxkbcommon - libxmlxx - yaml-cpp - lttng-ust - libgbm - nettle - udev - wayland - xorg.libX11 - xorg.libXcursor - xorg.xorgproto - xwayland - ] - ++ lib.optionals (lib.strings.versionAtLeast version "2.18.0") [ - libapparmor - ] - ++ lib.optionals (lib.strings.versionAtLeast version "2.21.0") [ - pixman - ]; + buildInputs = [ + boost + egl-wayland + freetype + glib + glm + libdrm + libepoxy + libevdev + libglvnd + libinput + libuuid + libxcb + libxkbcommon + libxmlxx + yaml-cpp + lttng-ust + libgbm + nettle + udev + wayland + xorg.libX11 + xorg.libXcursor + xorg.xorgproto + xwayland + ] + ++ lib.optionals (lib.strings.versionAtLeast version "2.18.0") [ + libapparmor + ] + ++ lib.optionals (lib.strings.versionAtLeast version "2.21.0") [ + pixman + ]; nativeCheckInputs = [ dbus @@ -199,7 +197,8 @@ stdenv.mkDerivation (finalAttrs: { passthru = { tests = { pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - } // lib.optionalAttrs (!pinned) { inherit (nixosTests) miriway miracle-wm; }; + } + // lib.optionalAttrs (!pinned) { inherit (nixosTests) miriway miracle-wm; }; providedSessions = lib.optionals (lib.strings.versionOlder version "2.16.0") [ # More of an example than a fully functioning shell, some notes for the adventurous: # - ~/.config/miral-shell.config is one possible user config location, @@ -210,7 +209,8 @@ stdenv.mkDerivation (finalAttrs: { # does not know about preferred terminal "mir-shell" ]; - } // lib.optionalAttrs (!pinned) { updateScript = ./update.sh; }; + } + // lib.optionalAttrs (!pinned) { updateScript = ./update.sh; }; meta = { description = "Display server and Wayland compositor developed by Canonical"; @@ -222,23 +222,22 @@ stdenv.mkDerivation (finalAttrs: { OPNA2608 ]; platforms = lib.platforms.linux; - pkgConfigModules = - [ - "miral" - "mircommon" - "mircore" - "miroil" - "mirplatform" - "mir-renderer-gl-dev" - "mirrenderer" - "mirserver" - "mirtest" - "mirwayland" - ] - ++ lib.optionals (lib.strings.versionOlder version "2.17.0") [ "mircookie" ] - ++ lib.optionals (lib.strings.versionAtLeast version "2.17.0") [ - "mircommon-internal" - "mirserver-internal" - ]; + pkgConfigModules = [ + "miral" + "mircommon" + "mircore" + "miroil" + "mirplatform" + "mir-renderer-gl-dev" + "mirrenderer" + "mirserver" + "mirtest" + "mirwayland" + ] + ++ lib.optionals (lib.strings.versionOlder version "2.17.0") [ "mircookie" ] + ++ lib.optionals (lib.strings.versionAtLeast version "2.17.0") [ + "mircommon-internal" + "mirserver-internal" + ]; }; }) diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix index bd2eb1ac0c67..d2097de24765 100644 --- a/pkgs/servers/monitoring/grafana/default.nix +++ b/pkgs/servers/monitoring/grafana/default.nix @@ -87,7 +87,8 @@ buildGoModule rec { faketty yarn-berry_4 yarn-berry_4.yarnBerryConfigHook - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcbuild ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild.xcbuild ]; # We have to remove this setupHook, otherwise it also runs in the `goModules` # derivation and fails because `offlineCache` is missing there. diff --git a/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix b/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix index e9262c2cac76..9735f5103b24 100644 --- a/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix +++ b/pkgs/servers/monitoring/grafana/plugins/grafana-plugin.nix @@ -56,11 +56,13 @@ stdenvNoCC.mkDerivation ( ./update-grafana-plugin.sh pname ]; - } // passthru; + } + // passthru; meta = { homepage = "https://grafana.com/grafana/plugins/${pname}"; - } // meta; + } + // meta; } // (builtins.removeAttrs args [ "zipHash" diff --git a/pkgs/servers/monitoring/icinga2/default.nix b/pkgs/servers/monitoring/icinga2/default.nix index dab521e6f81a..1f6d1b774332 100644 --- a/pkgs/servers/monitoring/icinga2/default.nix +++ b/pkgs/servers/monitoring/icinga2/default.nix @@ -85,7 +85,8 @@ stdenv.mkDerivation rec { libedit openssl systemd - ] ++ lib.optional withPostgresql libpq; + ] + ++ lib.optional withPostgresql libpq; nativeBuildInputs = [ cmake diff --git a/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix b/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix index 3e397eb0cfc8..3875af9c7dcb 100644 --- a/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix +++ b/pkgs/servers/monitoring/prometheus/xmpp-alerts.nix @@ -24,19 +24,18 @@ python3Packages.buildPythonApplication rec { --replace "bs4" "beautifulsoup4" ''; - propagatedBuildInputs = - [ - prometheus-alertmanager - ] - ++ (with python3Packages; [ - aiohttp - aiohttp-openmetrics - beautifulsoup4 - jinja2 - slixmpp - prometheus-client - pyyaml - ]); + propagatedBuildInputs = [ + prometheus-alertmanager + ] + ++ (with python3Packages; [ + aiohttp + aiohttp-openmetrics + beautifulsoup4 + jinja2 + slixmpp + prometheus-client + pyyaml + ]); nativeCheckInputs = with python3Packages; [ setuptools diff --git a/pkgs/servers/monitoring/zabbix/proxy.nix b/pkgs/servers/monitoring/zabbix/proxy.nix index cd66c2997046..ef2b02083a52 100644 --- a/pkgs/servers/monitoring/zabbix/proxy.nix +++ b/pkgs/servers/monitoring/zabbix/proxy.nix @@ -55,40 +55,39 @@ import ./versions.nix ( nativeBuildInputs = [ pkg-config - ] ++ optional postgresqlSupport libpq.pg_config; - buildInputs = - [ - curl - libevent - libiconv - openssl - (if (lib.versions.major version >= "7" && lib.versions.minor version >= "4") then pcre2 else pcre) - zlib - ] - ++ optional odbcSupport unixODBC - ++ optional snmpSupport net-snmp - ++ optional sqliteSupport sqlite - ++ optional sshSupport libssh2 - ++ optional mysqlSupport libmysqlclient - ++ optional postgresqlSupport libpq; + ] + ++ optional postgresqlSupport libpq.pg_config; + buildInputs = [ + curl + libevent + libiconv + openssl + (if (lib.versions.major version >= "7" && lib.versions.minor version >= "4") then pcre2 else pcre) + zlib + ] + ++ optional odbcSupport unixODBC + ++ optional snmpSupport net-snmp + ++ optional sqliteSupport sqlite + ++ optional sshSupport libssh2 + ++ optional mysqlSupport libmysqlclient + ++ optional postgresqlSupport libpq; - configureFlags = - [ - "--enable-ipv6" - "--enable-proxy" - "--with-iconv" - "--with-libcurl" - "--with-libevent" - "--with-libpcre" - "--with-openssl=${openssl.dev}" - "--with-zlib=${zlib}" - ] - ++ optional odbcSupport "--with-unixodbc" - ++ optional snmpSupport "--with-net-snmp" - ++ optional sqliteSupport "--with-sqlite3=${sqlite.dev}" - ++ optional sshSupport "--with-ssh2=${libssh2.dev}" - ++ optional mysqlSupport "--with-mysql=${fake_mysql_config}" - ++ optional postgresqlSupport "--with-postgresql"; + configureFlags = [ + "--enable-ipv6" + "--enable-proxy" + "--with-iconv" + "--with-libcurl" + "--with-libevent" + "--with-libpcre" + "--with-openssl=${openssl.dev}" + "--with-zlib=${zlib}" + ] + ++ optional odbcSupport "--with-unixodbc" + ++ optional snmpSupport "--with-net-snmp" + ++ optional sqliteSupport "--with-sqlite3=${sqlite.dev}" + ++ optional sshSupport "--with-ssh2=${libssh2.dev}" + ++ optional mysqlSupport "--with-mysql=${fake_mysql_config}" + ++ optional postgresqlSupport "--with-postgresql"; prePatch = '' find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} + @@ -99,22 +98,21 @@ import ./versions.nix ( "RANLIB:=$(RANLIB)" ]; - postInstall = - '' - mkdir -p $out/share/zabbix/database/ - '' - + optionalString sqliteSupport '' - mkdir -p $out/share/zabbix/database/sqlite3 - cp -prvd database/sqlite3/schema.sql $out/share/zabbix/database/sqlite3/ - '' - + optionalString mysqlSupport '' - mkdir -p $out/share/zabbix/database/mysql - cp -prvd database/mysql/schema.sql $out/share/zabbix/database/mysql/ - '' - + optionalString postgresqlSupport '' - mkdir -p $out/share/zabbix/database/postgresql - cp -prvd database/postgresql/schema.sql $out/share/zabbix/database/postgresql/ - ''; + postInstall = '' + mkdir -p $out/share/zabbix/database/ + '' + + optionalString sqliteSupport '' + mkdir -p $out/share/zabbix/database/sqlite3 + cp -prvd database/sqlite3/schema.sql $out/share/zabbix/database/sqlite3/ + '' + + optionalString mysqlSupport '' + mkdir -p $out/share/zabbix/database/mysql + cp -prvd database/mysql/schema.sql $out/share/zabbix/database/mysql/ + '' + + optionalString postgresqlSupport '' + mkdir -p $out/share/zabbix/database/postgresql + cp -prvd database/postgresql/schema.sql $out/share/zabbix/database/postgresql/ + ''; meta = { description = "Enterprise-class open source distributed monitoring solution (client-server proxy)"; diff --git a/pkgs/servers/monitoring/zabbix/server.nix b/pkgs/servers/monitoring/zabbix/server.nix index a45d0a52eda9..9811448aa169 100644 --- a/pkgs/servers/monitoring/zabbix/server.nix +++ b/pkgs/servers/monitoring/zabbix/server.nix @@ -51,46 +51,45 @@ import ./versions.nix ( nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ optional postgresqlSupport libpq.pg_config; - buildInputs = - [ - curl - libevent - libiconv - libxml2 - openssl - (if (lib.versions.major version >= "7" && lib.versions.minor version >= "4") then pcre2 else pcre) - zlib - ] - ++ optional odbcSupport unixODBC - ++ optional jabberSupport iksemel - ++ optional ldapSupport openldap - ++ optional snmpSupport net-snmp - ++ optional sshSupport libssh2 - ++ optional mysqlSupport libmysqlclient - ++ optional postgresqlSupport libpq - ++ optional ipmiSupport openipmi; + ] + ++ optional postgresqlSupport libpq.pg_config; + buildInputs = [ + curl + libevent + libiconv + libxml2 + openssl + (if (lib.versions.major version >= "7" && lib.versions.minor version >= "4") then pcre2 else pcre) + zlib + ] + ++ optional odbcSupport unixODBC + ++ optional jabberSupport iksemel + ++ optional ldapSupport openldap + ++ optional snmpSupport net-snmp + ++ optional sshSupport libssh2 + ++ optional mysqlSupport libmysqlclient + ++ optional postgresqlSupport libpq + ++ optional ipmiSupport openipmi; - configureFlags = - [ - "--enable-ipv6" - "--enable-server" - "--with-iconv" - "--with-libcurl" - "--with-libevent" - "--with-libpcre" - "--with-libxml2" - "--with-openssl=${openssl.dev}" - "--with-zlib=${zlib}" - ] - ++ optional odbcSupport "--with-unixodbc" - ++ optional jabberSupport "--with-jabber" - ++ optional ldapSupport "--with-ldap=${openldap.dev}" - ++ optional snmpSupport "--with-net-snmp" - ++ optional sshSupport "--with-ssh2=${libssh2.dev}" - ++ optional mysqlSupport "--with-mysql" - ++ optional postgresqlSupport "--with-postgresql" - ++ optional ipmiSupport "--with-openipmi=${openipmi.dev}"; + configureFlags = [ + "--enable-ipv6" + "--enable-server" + "--with-iconv" + "--with-libcurl" + "--with-libevent" + "--with-libpcre" + "--with-libxml2" + "--with-openssl=${openssl.dev}" + "--with-zlib=${zlib}" + ] + ++ optional odbcSupport "--with-unixodbc" + ++ optional jabberSupport "--with-jabber" + ++ optional ldapSupport "--with-ldap=${openldap.dev}" + ++ optional snmpSupport "--with-net-snmp" + ++ optional sshSupport "--with-ssh2=${libssh2.dev}" + ++ optional mysqlSupport "--with-mysql" + ++ optional postgresqlSupport "--with-postgresql" + ++ optional ipmiSupport "--with-openipmi=${openipmi.dev}"; prePatch = '' find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} + @@ -103,19 +102,18 @@ import ./versions.nix ( done ''; - postInstall = - '' - mkdir -p $out/share/zabbix/database/ - cp -r include $out/ - '' - + optionalString mysqlSupport '' - mkdir -p $out/share/zabbix/database/mysql - cp -prvd database/mysql/*.sql $out/share/zabbix/database/mysql/ - '' - + optionalString postgresqlSupport '' - mkdir -p $out/share/zabbix/database/postgresql - cp -prvd database/postgresql/*.sql $out/share/zabbix/database/postgresql/ - ''; + postInstall = '' + mkdir -p $out/share/zabbix/database/ + cp -r include $out/ + '' + + optionalString mysqlSupport '' + mkdir -p $out/share/zabbix/database/mysql + cp -prvd database/mysql/*.sql $out/share/zabbix/database/mysql/ + '' + + optionalString postgresqlSupport '' + mkdir -p $out/share/zabbix/database/postgresql + cp -prvd database/postgresql/*.sql $out/share/zabbix/database/postgresql/ + ''; meta = { description = "Enterprise-class open source distributed monitoring solution"; diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index 5484d3e0ad94..7fa51bbfc85d 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -176,8 +176,7 @@ let ]; knownFeatures = - builtins.attrNames featureDependencies - ++ builtins.attrNames nativeFeatureDependencies; + builtins.attrNames featureDependencies ++ builtins.attrNames nativeFeatureDependencies; platformFeatures = lib.subtractLists platformMask knownFeatures; features_ = @@ -219,13 +218,15 @@ let # Run-time dependency GTest found: YES 1.10.0 gtest libupnp - ] ++ concatAttrVals features_ featureDependencies; + ] + ++ concatAttrVals features_ featureDependencies; nativeBuildInputs = [ meson ninja pkg-config - ] ++ concatAttrVals features_ nativeFeatureDependencies; + ] + ++ concatAttrVals features_ nativeFeatureDependencies; depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -250,25 +251,25 @@ let outputs = [ "out" "doc" - ] ++ lib.optional (builtins.elem "documentation" features_) "man"; + ] + ++ lib.optional (builtins.elem "documentation" features_) "man"; CXXFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [ "-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0" ]; - mesonFlags = - [ - "-Dtest=true" - "-Dmanpages=true" - "-Dhtml_manual=true" - ] - ++ map (x: "-D${x}=enabled") features_ - ++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures) - ++ lib.optional (builtins.elem "zeroconf" features_) ( - "-Dzeroconf=" + (if stdenv.hostPlatform.isDarwin then "bonjour" else "avahi") - ) - ++ lib.optional (builtins.elem "systemd" features_) "-Dsystemd_system_unit_dir=etc/systemd/system" - ++ lib.optional (builtins.elem "qobuz" features_) "-Dnlohmann_json=enabled"; + mesonFlags = [ + "-Dtest=true" + "-Dmanpages=true" + "-Dhtml_manual=true" + ] + ++ map (x: "-D${x}=enabled") features_ + ++ map (x: "-D${x}=disabled") (lib.subtractLists features_ knownFeatures) + ++ lib.optional (builtins.elem "zeroconf" features_) ( + "-Dzeroconf=" + (if stdenv.hostPlatform.isDarwin then "bonjour" else "avahi") + ) + ++ lib.optional (builtins.elem "systemd" features_) "-Dsystemd_system_unit_dir=etc/systemd/system" + ++ lib.optional (builtins.elem "qobuz" features_) "-Dnlohmann_json=enabled"; passthru.tests.nixos = nixosTests.mpd; @@ -293,42 +294,41 @@ in { mpd = run { }; mpd-small = run { - features = - [ - "webdav" - "curl" - "mms" - "bzip2" - "zzip" - "nfs" - "audiofile" - "faad" - "flac" - "gme" - "mpg123" - "opus" - "vorbis" - "vorbisenc" - "lame" - "libsamplerate" - "shout" - "libmpdclient" - "id3tag" - "expat" - "pcre" - "sqlite" - "qobuz" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "alsa" - "systemd" - "syslog" - "io_uring" - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "mad" - "jack" - ]; + features = [ + "webdav" + "curl" + "mms" + "bzip2" + "zzip" + "nfs" + "audiofile" + "faad" + "flac" + "gme" + "mpg123" + "opus" + "vorbis" + "vorbisenc" + "lame" + "libsamplerate" + "shout" + "libmpdclient" + "id3tag" + "expat" + "pcre" + "sqlite" + "qobuz" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "alsa" + "systemd" + "syslog" + "io_uring" + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + "mad" + "jack" + ]; }; mpdWithFeatures = run; } diff --git a/pkgs/servers/nextcloud/packages/apps/recognize.nix b/pkgs/servers/nextcloud/packages/apps/recognize.nix index e1f0b3f70624..2159c1132dd3 100644 --- a/pkgs/servers/nextcloud/packages/apps/recognize.nix +++ b/pkgs/servers/nextcloud/packages/apps/recognize.nix @@ -35,36 +35,34 @@ stdenv.mkDerivation rec { pname = "nextcloud-app-recognize"; inherit (currentVersionInfo) version; - srcs = - [ - (fetchurl { - url = "https://github.com/nextcloud/recognize/releases/download/v${version}/recognize-${version}.tar.gz"; - hash = currentVersionInfo.appHash; - }) + srcs = [ + (fetchurl { + url = "https://github.com/nextcloud/recognize/releases/download/v${version}/recognize-${version}.tar.gz"; + hash = currentVersionInfo.appHash; + }) - (fetchurl { - url = "https://github.com/nextcloud/recognize/archive/refs/tags/v${version}.tar.gz"; - hash = currentVersionInfo.modelHash; - }) - ] - ++ lib.optionals useLibTensorflow [ - (fetchurl { - # For version see LIBTENSORFLOW_VERSION in https://github.com/tensorflow/tfjs/blob/master/tfjs-node/scripts/deps-constants.js - url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz"; - hash = "sha256-f1ENJUbj214QsdEZRjaJAD1YeEKJKtPJW8pRz4KCAXM="; - }) - ]; + (fetchurl { + url = "https://github.com/nextcloud/recognize/archive/refs/tags/v${version}.tar.gz"; + hash = currentVersionInfo.modelHash; + }) + ] + ++ lib.optionals useLibTensorflow [ + (fetchurl { + # For version see LIBTENSORFLOW_VERSION in https://github.com/tensorflow/tfjs/blob/master/tfjs-node/scripts/deps-constants.js + url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz"; + hash = "sha256-f1ENJUbj214QsdEZRjaJAD1YeEKJKtPJW8pRz4KCAXM="; + }) + ]; - unpackPhase = - '' - # Merge the app and the models from github - tar -xzpf "${builtins.elemAt srcs 0}" recognize - tar -xzpf "${builtins.elemAt srcs 1}" -C recognize --strip-components=1 recognize-${version}/models - '' - + lib.optionalString useLibTensorflow '' - # Place the tensorflow lib at the right place for building - tar -xzpf "${builtins.elemAt srcs 2}" -C recognize/node_modules/@tensorflow/tfjs-node/deps - ''; + unpackPhase = '' + # Merge the app and the models from github + tar -xzpf "${builtins.elemAt srcs 0}" recognize + tar -xzpf "${builtins.elemAt srcs 1}" -C recognize --strip-components=1 recognize-${version}/models + '' + + lib.optionalString useLibTensorflow '' + # Place the tensorflow lib at the right place for building + tar -xzpf "${builtins.elemAt srcs 2}" -C recognize/node_modules/@tensorflow/tfjs-node/deps + ''; postPatch = '' # Make it clear we are not reading the node in settings diff --git a/pkgs/servers/nosql/influxdb/default.nix b/pkgs/servers/nosql/influxdb/default.nix index 08abc6ff864b..63d89f2a9a11 100644 --- a/pkgs/servers/nosql/influxdb/default.nix +++ b/pkgs/servers/nosql/influxdb/default.nix @@ -44,16 +44,15 @@ let Libs: -L/out/lib -lflux -lpthread ''; passAsFile = [ "pkgcfg" ]; - postInstall = - '' - mkdir -p $out/include $out/pkgconfig - cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include - substitute $pkgcfgPath $out/pkgconfig/flux.pc \ - --replace-fail /out $out - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib - ''; + postInstall = '' + mkdir -p $out/include $out/pkgconfig + cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include + substitute $pkgcfgPath $out/pkgconfig/flux.pc \ + --replace-fail /out $out + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib + ''; }; in buildGoModule rec { diff --git a/pkgs/servers/nosql/influxdb2/default.nix b/pkgs/servers/nosql/influxdb2/default.nix index 60d4ec2b917f..c46ac95c33b3 100644 --- a/pkgs/servers/nosql/influxdb2/default.nix +++ b/pkgs/servers/nosql/influxdb2/default.nix @@ -61,16 +61,15 @@ let Libs: -L/out/lib -lflux -lpthread ''; passAsFile = [ "pkgcfg" ]; - postInstall = - '' - mkdir -p $out/include $out/pkgconfig - cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include - substitute $pkgcfgPath $out/pkgconfig/flux.pc \ - --replace-fail /out $out - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib - ''; + postInstall = '' + mkdir -p $out/include $out/pkgconfig + cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include + substitute $pkgcfgPath $out/pkgconfig/flux.pc \ + --replace-fail /out $out + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib + ''; }; in buildGoModule { diff --git a/pkgs/servers/nosql/mongodb/7.0.nix b/pkgs/servers/nosql/mongodb/7.0.nix index a08835c5b994..cb4bbf53279f 100644 --- a/pkgs/servers/nosql/mongodb/7.0.nix +++ b/pkgs/servers/nosql/mongodb/7.0.nix @@ -34,7 +34,8 @@ buildMongoDB { # mongodb-7_0's mozjs uses avx2 instructions # https://github.com/GermanAizek/mongodb-without-avx/issues/16 - ] ++ lib.optionals (!avxSupport) [ ./mozjs-noavx.patch ]; + ] + ++ lib.optionals (!avxSupport) [ ./mozjs-noavx.patch ]; passthru.tests = { inherit (nixosTests) mongodb; diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 1448fed7faaa..b847dfc278df 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -47,24 +47,23 @@ let ] ); - system-libraries = - [ - "boost" - "snappy" - "yaml" - "zlib" - #"asio" -- XXX use package? - #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs). - #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source. - #"wiredtiger" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ "tcmalloc" ] - ++ lib.optionals (lib.versionOlder version "7.0") [ - "pcre" - ] - ++ lib.optionals (lib.versionAtLeast version "7.0") [ - "pcre2" - ]; + system-libraries = [ + "boost" + "snappy" + "yaml" + "zlib" + #"asio" -- XXX use package? + #"stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs). + #"valgrind" -- mongodb only requires valgrind.h, which is vendored in the source. + #"wiredtiger" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ "tcmalloc" ] + ++ lib.optionals (lib.versionOlder version "7.0") [ + "pcre" + ] + ++ lib.optionals (lib.versionAtLeast version "7.0") [ + "pcre2" + ]; inherit (lib) systems subtractLists; in @@ -82,52 +81,51 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ scons python - ] ++ lib.optional stdenv.hostPlatform.isLinux net-snmp; + ] + ++ lib.optional stdenv.hostPlatform.isLinux net-snmp; - buildInputs = - [ - boost - curl - gperftools - libpcap - yaml-cpp - openssl - openldap - pcre2 - pcre-cpp - sasl - snappy - zlib - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ] - ++ lib.optional stdenv.hostPlatform.isLinux net-snmp - ++ [ xz ]; + buildInputs = [ + boost + curl + gperftools + libpcap + yaml-cpp + openssl + openldap + pcre2 + pcre-cpp + sasl + snappy + zlib + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ] + ++ lib.optional stdenv.hostPlatform.isLinux net-snmp + ++ [ xz ]; # MongoDB keeps track of its build parameters, which tricks nix into # keeping dependencies to build inputs in the final output. # We remove the build flags from buildInfo data. inherit patches; - postPatch = - '' - # fix environment variable reading - substituteInPlace SConstruct \ - --replace "env = Environment(" "env = Environment(ENV = os.environ," - '' - + '' - # Fix debug gcc 11 and clang 12 builds on Fedora - # https://github.com/mongodb/mongo/commit/e78b2bf6eaa0c43bd76dbb841add167b443d2bb0.patch - substituteInPlace src/mongo/db/query/plan_summary_stats.h --replace '#include ' '#include - #include ' - substituteInPlace src/mongo/db/exec/plan_stats.h --replace '#include ' '#include - #include ' - '' - + lib.optionalString (!avxSupport) '' - substituteInPlace SConstruct \ - --replace-fail "default=['+sandybridge']," 'default=[],' - ''; + postPatch = '' + # fix environment variable reading + substituteInPlace SConstruct \ + --replace "env = Environment(" "env = Environment(ENV = os.environ," + '' + + '' + # Fix debug gcc 11 and clang 12 builds on Fedora + # https://github.com/mongodb/mongo/commit/e78b2bf6eaa0c43bd76dbb841add167b443d2bb0.patch + substituteInPlace src/mongo/db/query/plan_summary_stats.h --replace '#include ' '#include + #include ' + substituteInPlace src/mongo/db/exec/plan_stats.h --replace '#include ' '#include + #include ' + '' + + lib.optionalString (!avxSupport) '' + substituteInPlace SConstruct \ + --replace-fail "default=['+sandybridge']," 'default=[],' + ''; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument"; @@ -142,22 +140,22 @@ stdenv.mkDerivation rec { "VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld "--link-model=static" "MONGO_VERSION=${version}" - ] ++ map (lib: "--use-system-${lib}") system-libraries; + ] + ++ map (lib: "--use-system-${lib}") system-libraries; # This seems to fix mongodb not able to find OpenSSL's crypto.h during build hardeningDisable = [ "fortify3" ]; - preBuild = - '' - appendToVar sconsFlags "CC=$CC" - appendToVar sconsFlags "CXX=$CXX" - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - appendToVar sconsFlags "AR=$AR" - '' - + lib.optionalString stdenv.hostPlatform.isAarch64 '' - appendToVar sconsFlags "CCFLAGS=-march=armv8-a+crc" - ''; + preBuild = '' + appendToVar sconsFlags "CC=$CC" + appendToVar sconsFlags "CXX=$CXX" + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + appendToVar sconsFlags "AR=$AR" + '' + + lib.optionalString stdenv.hostPlatform.isAarch64 '' + appendToVar sconsFlags "CCFLAGS=-march=armv8-a+crc" + ''; preInstall = '' mkdir -p "$out/lib" diff --git a/pkgs/servers/nosql/rethinkdb/default.nix b/pkgs/servers/nosql/rethinkdb/default.nix index f1c3cf02c331..f6842768af6a 100644 --- a/pkgs/servers/nosql/rethinkdb/default.nix +++ b/pkgs/servers/nosql/rethinkdb/default.nix @@ -43,17 +43,16 @@ stdenv.mkDerivation rec { makeFlags = [ "rethinkdb" ]; - buildInputs = - [ - protobuf - boost - zlib - curl - openssl - icu - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) jemalloc - ++ lib.optional stdenv.hostPlatform.isDarwin libtool; + buildInputs = [ + protobuf + boost + zlib + curl + openssl + icu + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) jemalloc + ++ lib.optional stdenv.hostPlatform.isDarwin libtool; nativeBuildInputs = [ which diff --git a/pkgs/servers/openafs/1.8/default.nix b/pkgs/servers/openafs/1.8/default.nix index 1f8b92c6d6c7..d5c5645e95bb 100644 --- a/pkgs/servers/openafs/1.8/default.nix +++ b/pkgs/servers/openafs/1.8/default.nix @@ -35,35 +35,36 @@ stdenv.mkDerivation { inherit version srcs; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = - [ - autoconf - automake - flex - libxslt - libtool_2 - perl - which - bison - ] - ++ optionals withDevdoc [ - doxygen - dblatex - ]; + nativeBuildInputs = [ + autoconf + automake + flex + libxslt + libtool_2 + perl + which + bison + ] + ++ optionals withDevdoc [ + doxygen + dblatex + ]; buildInputs = [ libkrb5 ] ++ optional withNcurses ncurses; patches = [ ./bosserver.patch ./cross-build.patch - ] ++ optional withTsm ./tsmbac.patch; + ] + ++ optional withTsm ./tsmbac.patch; outputs = [ "out" "dev" "man" "doc" - ] ++ optional withDevdoc "devdoc"; + ] + ++ optional withDevdoc "devdoc"; enableParallelBuilding = false; @@ -72,69 +73,66 @@ stdenv.mkDerivation { # Makefiles don't include install targets for all new shared libs, yet. dontDisableStatic = true; - preConfigure = - '' - patchShebangs . - for i in `grep -l -R '/usr/\(include\|src\)' .`; do - echo "Patch /usr/include and /usr/src in $i" - substituteInPlace $i \ - --replace "/usr/include" "${glibc.dev}/include" \ - --replace "/usr/src" "$TMP" - done + preConfigure = '' + patchShebangs . + for i in `grep -l -R '/usr/\(include\|src\)' .`; do + echo "Patch /usr/include and /usr/src in $i" + substituteInPlace $i \ + --replace "/usr/include" "${glibc.dev}/include" \ + --replace "/usr/src" "$TMP" + done - for i in ./doc/xml/{AdminGuide,QuickStartUnix,UserGuide}/*.xml; do - substituteInPlace "''${i}" --replace "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" \ - "${docbook_xml_dtd_43}/xml/dtd/docbook/docbookx.dtd" - done + for i in ./doc/xml/{AdminGuide,QuickStartUnix,UserGuide}/*.xml; do + substituteInPlace "''${i}" --replace "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" \ + "${docbook_xml_dtd_43}/xml/dtd/docbook/docbookx.dtd" + done - ./regen.sh + ./regen.sh - configureFlagsArray=( - "--with-krb5" - "--sysconfdir=/etc" - "--localstatedir=/var" - "--disable-kernel-module" - "--disable-fuse-client" - "--with-docbook-stylesheets=${docbook_xsl}/share/xml/docbook-xsl" - ${optionalString withTsm "--enable-tivoli-tsm"} - ${optionalString (!withNcurses) "--disable-gtx"} - "--disable-linux-d_splice-alias-extra-iput" - ) - '' - + optionalString withTsm '' - export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsm-client}/lib64/sample -DXBSA_TSMLIB=\\\"${tsm-client}/lib64/libApiTSM64.so\\\"" - ''; + configureFlagsArray=( + "--with-krb5" + "--sysconfdir=/etc" + "--localstatedir=/var" + "--disable-kernel-module" + "--disable-fuse-client" + "--with-docbook-stylesheets=${docbook_xsl}/share/xml/docbook-xsl" + ${optionalString withTsm "--enable-tivoli-tsm"} + ${optionalString (!withNcurses) "--disable-gtx"} + "--disable-linux-d_splice-alias-extra-iput" + ) + '' + + optionalString withTsm '' + export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsm-client}/lib64/sample -DXBSA_TSMLIB=\\\"${tsm-client}/lib64/libApiTSM64.so\\\"" + ''; buildFlags = [ "all_nolibafs" ]; - postBuild = - '' - for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do - make -C "''${d}" index.html - done - '' - + optionalString withDevdoc '' - make dox - ''; + postBuild = '' + for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do + make -C "''${d}" index.html + done + '' + + optionalString withDevdoc '' + make dox + ''; - postInstall = - '' - mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide} - cp -r doc/txt README LICENSE $doc/share/doc/openafs - for d in AdminGuide QuickStartUnix UserGuide ; do - cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}" - done + postInstall = '' + mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide} + cp -r doc/txt README LICENSE $doc/share/doc/openafs + for d in AdminGuide QuickStartUnix UserGuide ; do + cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}" + done - cp src/tools/dumpscan/{afsdump_dirlist,afsdump_extract,afsdump_scan,dumptool} $out/bin + cp src/tools/dumpscan/{afsdump_dirlist,afsdump_extract,afsdump_scan,dumptool} $out/bin - rm -r $out/lib/openafs - '' - + optionalString withDevdoc '' - mkdir -p $devdoc/share/devhelp/openafs/doxygen - cp -r doc/{pdf,protocol} $devdoc/share/devhelp/openafs - cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen - ''; + rm -r $out/lib/openafs + '' + + optionalString withDevdoc '' + mkdir -p $devdoc/share/devhelp/openafs/doxygen + cp -r doc/{pdf,protocol} $devdoc/share/devhelp/openafs + cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen + ''; # remove forbidden references to $TMPDIR preFixup = '' diff --git a/pkgs/servers/openafs/1.8/module.nix b/pkgs/servers/openafs/1.8/module.nix index 5e3c9010ed55..c630ce82451e 100644 --- a/pkgs/servers/openafs/1.8/module.nix +++ b/pkgs/servers/openafs/1.8/module.nix @@ -86,7 +86,8 @@ stdenv.mkDerivation { perl which bison - ] ++ kernel.moduleBuildDependencies; + ] + ++ kernel.moduleBuildDependencies; buildInputs = [ libkrb5 ]; diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index b07fd401f798..f9bd9f94c3cf 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -102,76 +102,74 @@ stdenv.mkDerivation rec { "dev" ]; - nativeBuildInputs = - [ - pkg-config - meson - ninja - makeWrapper - perlPackages.perl - perlPackages.XMLParser - m4 - udevCheckHook - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ glib ] - # gstreamer plugin discovery requires wrapping - ++ lib.optional (bluetoothSupport && advancedBluetoothCodecs) wrapGAppsHook3; + nativeBuildInputs = [ + pkg-config + meson + ninja + makeWrapper + perlPackages.perl + perlPackages.XMLParser + m4 + udevCheckHook + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ glib ] + # gstreamer plugin discovery requires wrapping + ++ lib.optional (bluetoothSupport && advancedBluetoothCodecs) wrapGAppsHook3; propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libcap ]; - buildInputs = + buildInputs = [ + libtool + libsndfile + soxr + speexdsp + fftwFloat + check + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + glib + dbus + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) [ + libintl + ] + ++ lib.optionals (!libOnly) ( [ - libtool - libsndfile - soxr - speexdsp - fftwFloat - check + libasyncns + webrtc-audio-processing_1 ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - glib - dbus + ++ lib.optional jackaudioSupport libjack2 + ++ lib.optionals x11Support [ + xorg.libICE + xorg.libSM + xorg.libX11 + xorg.libXi + xorg.libXtst ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) [ - libintl + ++ lib.optional useSystemd systemd + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + udev ] - ++ lib.optionals (!libOnly) ( - [ - libasyncns - webrtc-audio-processing_1 - ] - ++ lib.optional jackaudioSupport libjack2 - ++ lib.optionals x11Support [ - xorg.libICE - xorg.libSM - xorg.libX11 - xorg.libXi - xorg.libXtst - ] - ++ lib.optional useSystemd systemd - ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - udev - ] - ++ lib.optional airtunesSupport openssl - ++ lib.optionals bluetoothSupport [ - bluez5 - sbc - ] - # aptX and LDAC codecs are in gst-plugins-bad so far, rtpldacpay is in -good - ++ lib.optionals (bluetoothSupport && advancedBluetoothCodecs) ( - builtins.attrValues { - inherit (gst_all_1) - gst-plugins-bad - gst-plugins-good - gst-plugins-base - gstreamer - ; - } - ) - ++ lib.optional remoteControlSupport lirc - ++ lib.optional zeroconfSupport avahi - ); + ++ lib.optional airtunesSupport openssl + ++ lib.optionals bluetoothSupport [ + bluez5 + sbc + ] + # aptX and LDAC codecs are in gst-plugins-bad so far, rtpldacpay is in -good + ++ lib.optionals (bluetoothSupport && advancedBluetoothCodecs) ( + builtins.attrValues { + inherit (gst_all_1) + gst-plugins-bad + gst-plugins-good + gst-plugins-base + gstreamer + ; + } + ) + ++ lib.optional remoteControlSupport lirc + ++ lib.optional zeroconfSupport avahi + ); env = lib.optionalAttrs (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") @@ -180,53 +178,52 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = "--undefined-version"; }; - mesonFlags = - [ - (lib.mesonEnable "alsa" (!libOnly && alsaSupport)) - (lib.mesonEnable "asyncns" (!libOnly)) - (lib.mesonEnable "avahi" zeroconfSupport) - (lib.mesonEnable "bluez5" (!libOnly && bluetoothSupport)) - # advanced bluetooth audio codecs are provided by gstreamer - (lib.mesonEnable "bluez5-gstreamer" (!libOnly && bluetoothSupport && advancedBluetoothCodecs)) - (lib.mesonOption "database" "simple") - (lib.mesonBool "doxygen" false) - (lib.mesonEnable "elogind" false) - # gsettings does not support cross-compilation - (lib.mesonEnable "gsettings" ( - stdenv.hostPlatform.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform) - )) - (lib.mesonEnable "gstreamer" false) - (lib.mesonEnable "gtk" false) - (lib.mesonEnable "jack" (jackaudioSupport && !libOnly)) - (lib.mesonEnable "lirc" remoteControlSupport) - (lib.mesonEnable "openssl" airtunesSupport) - (lib.mesonEnable "orc" false) - (lib.mesonEnable "systemd" (useSystemd && !libOnly)) - (lib.mesonEnable "tcpwrap" false) - (lib.mesonEnable "udev" (!libOnly && udevSupport)) - (lib.mesonEnable "valgrind" false) - (lib.mesonEnable "webrtc-aec" (!libOnly)) - (lib.mesonEnable "x11" x11Support) + mesonFlags = [ + (lib.mesonEnable "alsa" (!libOnly && alsaSupport)) + (lib.mesonEnable "asyncns" (!libOnly)) + (lib.mesonEnable "avahi" zeroconfSupport) + (lib.mesonEnable "bluez5" (!libOnly && bluetoothSupport)) + # advanced bluetooth audio codecs are provided by gstreamer + (lib.mesonEnable "bluez5-gstreamer" (!libOnly && bluetoothSupport && advancedBluetoothCodecs)) + (lib.mesonOption "database" "simple") + (lib.mesonBool "doxygen" false) + (lib.mesonEnable "elogind" false) + # gsettings does not support cross-compilation + (lib.mesonEnable "gsettings" ( + stdenv.hostPlatform.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform) + )) + (lib.mesonEnable "gstreamer" false) + (lib.mesonEnable "gtk" false) + (lib.mesonEnable "jack" (jackaudioSupport && !libOnly)) + (lib.mesonEnable "lirc" remoteControlSupport) + (lib.mesonEnable "openssl" airtunesSupport) + (lib.mesonEnable "orc" false) + (lib.mesonEnable "systemd" (useSystemd && !libOnly)) + (lib.mesonEnable "tcpwrap" false) + (lib.mesonEnable "udev" (!libOnly && udevSupport)) + (lib.mesonEnable "valgrind" false) + (lib.mesonEnable "webrtc-aec" (!libOnly)) + (lib.mesonEnable "x11" x11Support) - (lib.mesonOption "localstatedir" "/var") - (lib.mesonOption "sysconfdir" "/etc") - (lib.mesonOption "sysconfdir_install" "${placeholder "out"}/etc") - (lib.mesonOption "udevrulesdir" "${placeholder "out"}/lib/udev/rules.d") + (lib.mesonOption "localstatedir" "/var") + (lib.mesonOption "sysconfdir" "/etc") + (lib.mesonOption "sysconfdir_install" "${placeholder "out"}/etc") + (lib.mesonOption "udevrulesdir" "${placeholder "out"}/lib/udev/rules.d") - # pulseaudio complains if its binary is moved after installation; - # this is needed so that wrapGApp can operate *without* - # renaming the unwrapped binaries (see below) - "--bindir=${placeholder "out"}/.bin-unwrapped" - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux && useSystemd) [ - (lib.mesonOption "systemduserunitdir" "${placeholder "out"}/lib/systemd/user") - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - (lib.mesonEnable "consolekit" false) - (lib.mesonEnable "dbus" false) - (lib.mesonEnable "glib" false) - (lib.mesonEnable "oss-output" false) - ]; + # pulseaudio complains if its binary is moved after installation; + # this is needed so that wrapGApp can operate *without* + # renaming the unwrapped binaries (see below) + "--bindir=${placeholder "out"}/.bin-unwrapped" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && useSystemd) [ + (lib.mesonOption "systemduserunitdir" "${placeholder "out"}/lib/systemd/user") + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + (lib.mesonEnable "consolekit" false) + (lib.mesonEnable "dbus" false) + (lib.mesonEnable "glib" false) + (lib.mesonEnable "oss-output" false) + ]; # tests fail on Darwin because of timeouts doCheck = !stdenv.hostPlatform.isDarwin; diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix index 91f1e31d03d6..72725f65db20 100644 --- a/pkgs/servers/samba/4.x.nix +++ b/pkgs/servers/samba/4.x.nix @@ -121,155 +121,150 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - nativeBuildInputs = - [ - python3Packages.python - wafHook - pkg-config - bison - flex - perl - perl.pkgs.ParseYapp - perl.pkgs.JSON - libxslt - docbook_xsl - docbook_xml_dtd_45 - cmocka - rpcsvc-proto - ] - ++ optionals stdenv.hostPlatform.isLinux [ - buildPackages.stdenv.cc - ] - ++ optional (stdenv.buildPlatform != stdenv.hostPlatform) samba # asn1_compile/compile_et - ++ optionals stdenv.hostPlatform.isDarwin [ - fixDarwinDylibNames - ]; + nativeBuildInputs = [ + python3Packages.python + wafHook + pkg-config + bison + flex + perl + perl.pkgs.ParseYapp + perl.pkgs.JSON + libxslt + docbook_xsl + docbook_xml_dtd_45 + cmocka + rpcsvc-proto + ] + ++ optionals stdenv.hostPlatform.isLinux [ + buildPackages.stdenv.cc + ] + ++ optional (stdenv.buildPlatform != stdenv.hostPlatform) samba # asn1_compile/compile_et + ++ optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; wafPath = "buildtools/bin/waf"; - buildInputs = - [ - bash - wrapPython - python - readline - popt - dbus - jansson - libarchive - zlib - gnutls - libtasn1 - tdb - libxcrypt - ] - ++ optionals (!stdenv.hostPlatform.isBSD) [ - libbsd - ] - ++ optionals stdenv.hostPlatform.isLinux [ - liburing - systemd - ] - ++ optionals stdenv.hostPlatform.isDarwin [ libiconv ] - ++ optionals enableLDAP [ - openldap.dev - python3Packages.markdown - ] - ++ optionals (!enableLDAP && stdenv.hostPlatform.isLinux) [ - ldb - talloc - tevent - ] - ++ optional enablePrinting cups - ++ optional enableMDNS avahi - ++ optionals enableDomainController [ - gpgme - lmdb - python3Packages.dnspython - ] - ++ optional enableRegedit ncurses - ++ optional (enableCephFS && stdenv.hostPlatform.isLinux) (lib.getDev ceph) - ++ optionals (enableGlusterFS && stdenv.hostPlatform.isLinux) [ - glusterfs - libuuid - ] - ++ optional enableAcl acl - ++ optional enableLibunwind libunwind - ++ optional enablePam pam; + buildInputs = [ + bash + wrapPython + python + readline + popt + dbus + jansson + libarchive + zlib + gnutls + libtasn1 + tdb + libxcrypt + ] + ++ optionals (!stdenv.hostPlatform.isBSD) [ + libbsd + ] + ++ optionals stdenv.hostPlatform.isLinux [ + liburing + systemd + ] + ++ optionals stdenv.hostPlatform.isDarwin [ libiconv ] + ++ optionals enableLDAP [ + openldap.dev + python3Packages.markdown + ] + ++ optionals (!enableLDAP && stdenv.hostPlatform.isLinux) [ + ldb + talloc + tevent + ] + ++ optional enablePrinting cups + ++ optional enableMDNS avahi + ++ optionals enableDomainController [ + gpgme + lmdb + python3Packages.dnspython + ] + ++ optional enableRegedit ncurses + ++ optional (enableCephFS && stdenv.hostPlatform.isLinux) (lib.getDev ceph) + ++ optionals (enableGlusterFS && stdenv.hostPlatform.isLinux) [ + glusterfs + libuuid + ] + ++ optional enableAcl acl + ++ optional enableLibunwind libunwind + ++ optional enablePam pam; - postPatch = - '' - # Removes absolute paths in scripts - sed -i 's,/sbin/,,g' ctdb/config/functions + postPatch = '' + # Removes absolute paths in scripts + sed -i 's,/sbin/,,g' ctdb/config/functions - # Fix the XML Catalog Paths - sed -i "s,\(XML_CATALOG_FILES=\"\),\1$XML_CATALOG_FILES ,g" buildtools/wafsamba/wafsamba.py + # Fix the XML Catalog Paths + sed -i "s,\(XML_CATALOG_FILES=\"\),\1$XML_CATALOG_FILES ,g" buildtools/wafsamba/wafsamba.py - patchShebangs ./buildtools/bin - '' - + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' - substituteInPlace wscript source3/wscript nsswitch/wscript_build lib/replace/wscript source4/ntvfs/sysdep/wscript_configure --replace-fail 'sys.platform' '"${stdenv.hostPlatform.parsed.kernel.name}"' - ''; + patchShebangs ./buildtools/bin + '' + + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + substituteInPlace wscript source3/wscript nsswitch/wscript_build lib/replace/wscript source4/ntvfs/sysdep/wscript_configure --replace-fail 'sys.platform' '"${stdenv.hostPlatform.parsed.kernel.name}"' + ''; - preConfigure = - '' - export PKGCONFIG="$PKG_CONFIG" - export PYTHONHASHSEED=1 - '' - + lib.optionalString needsAnswers '' - cp ${answers} answers - chmod +w answers - ''; + preConfigure = '' + export PKGCONFIG="$PKG_CONFIG" + export PYTHONHASHSEED=1 + '' + + lib.optionalString needsAnswers '' + cp ${answers} answers + chmod +w answers + ''; env.NIX_LDFLAGS = lib.optionalString ( stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17" ) "--undefined-version"; - wafConfigureFlags = - [ - "--with-static-modules=NONE" - "--with-shared-modules=ALL" - "--enable-fhs" - "--sysconfdir=/etc" - "--localstatedir=/var" - "--disable-rpath" - # otherwise third_party/waf/waflib/Tools/python.py would - # get the wrong pythondir from build platform python - "--pythondir=${placeholder "out"}/${python.sitePackages}" - (lib.enableFeature enablePrinting "cups") - ] - ++ optional (!enableDomainController) "--without-ad-dc" - ++ optionals (!enableLDAP) [ - "--without-ldap" - "--without-ads" - ] - ++ optionals (!enableLDAP && stdenv.hostPlatform.isLinux) [ - "--bundled-libraries=!ldb,!pyldb-util!talloc,!pytalloc-util,!tevent,!tdb,!pytdb" - ] - ++ optional enableLibunwind "--with-libunwind" - ++ optional enableProfiling "--with-profiling-data" - ++ optional (!enableAcl) "--without-acl-support" - ++ optional (!enablePam) "--without-pam" - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ - "--bundled-libraries=!asn1_compile,!compile_et" - "--cross-compile" - ( - if (stdenv.hostPlatform.emulatorAvailable buildPackages) then - "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" - else - "--cross-answers=answers" - ) - ]) - ++ optionals stdenv.buildPlatform.is32bit [ - # By default `waf configure` spawns as many as available CPUs. On - # 32-bit systems with many CPUs (like `i686` chroot on `x86_64` - # kernel) it can easily exhaust 32-bit address space and hang up: - # https://github.com/NixOS/nixpkgs/issues/287339#issuecomment-1949462057 - # https://bugs.gentoo.org/683148 - # Limit the job count down to the minimal on system with limited address - # space. - "--jobs 1" - ]; + wafConfigureFlags = [ + "--with-static-modules=NONE" + "--with-shared-modules=ALL" + "--enable-fhs" + "--sysconfdir=/etc" + "--localstatedir=/var" + "--disable-rpath" + # otherwise third_party/waf/waflib/Tools/python.py would + # get the wrong pythondir from build platform python + "--pythondir=${placeholder "out"}/${python.sitePackages}" + (lib.enableFeature enablePrinting "cups") + ] + ++ optional (!enableDomainController) "--without-ad-dc" + ++ optionals (!enableLDAP) [ + "--without-ldap" + "--without-ads" + ] + ++ optionals (!enableLDAP && stdenv.hostPlatform.isLinux) [ + "--bundled-libraries=!ldb,!pyldb-util!talloc,!pytalloc-util,!tevent,!tdb,!pytdb" + ] + ++ optional enableLibunwind "--with-libunwind" + ++ optional enableProfiling "--with-profiling-data" + ++ optional (!enableAcl) "--without-acl-support" + ++ optional (!enablePam) "--without-pam" + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ + "--bundled-libraries=!asn1_compile,!compile_et" + "--cross-compile" + ( + if (stdenv.hostPlatform.emulatorAvailable buildPackages) then + "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" + else + "--cross-answers=answers" + ) + ]) + ++ optionals stdenv.buildPlatform.is32bit [ + # By default `waf configure` spawns as many as available CPUs. On + # 32-bit systems with many CPUs (like `i686` chroot on `x86_64` + # kernel) it can easily exhaust 32-bit address space and hang up: + # https://github.com/NixOS/nixpkgs/issues/287339#issuecomment-1949462057 + # https://bugs.gentoo.org/683148 + # Limit the job count down to the minimal on system with limited address + # space. + "--jobs 1" + ]; # python-config from build Python gives incorrect values when cross-compiling. # If python-config is not found, the build falls back to using the sysconfig @@ -296,40 +291,39 @@ stdenv.mkDerivation (finalAttrs: { # Some libraries don't have /lib/samba in RPATH but need it. # Use find -type f -executable -exec echo {} \; -exec sh -c 'ldd {} | grep "not found"' \; # Looks like a bug in installer scripts. - postFixup = - '' - export SAMBA_LIBS="$(find $out -type f -regex '.*\${stdenv.hostPlatform.extensions.sharedLibrary}\(\..*\)?' -exec dirname {} \; | sort | uniq)" - read -r -d "" SCRIPT << EOF || true - [ -z "\$SAMBA_LIBS" ] && exit 1; - BIN='{}'; - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - OLD_LIBS="\$(patchelf --print-rpath "\$BIN" 2>/dev/null | tr ':' '\n')"; - ALL_LIBS="\$(echo -e "\$SAMBA_LIBS\n\$OLD_LIBS" | sort | uniq | tr '\n' ':')"; - patchelf --set-rpath "\$ALL_LIBS" "\$BIN" 2>/dev/null || exit $?; - patchelf --shrink-rpath "\$BIN"; - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -id \$BIN \$BIN - for old_rpath in \$(otool -L \$BIN | grep /private/tmp/ | awk '{print \$1}'); do - new_rpath=\$(find \$SAMBA_LIBS -name \$(basename \$old_rpath) | head -n 1) - install_name_tool -change \$old_rpath \$new_rpath \$BIN - done - '' - + '' - EOF - find $out -type f -regex '.*\${stdenv.hostPlatform.extensions.sharedLibrary}\(\..*\)?' -exec $SHELL -c "$SCRIPT" \; - find $out/bin -type f -exec $SHELL -c "$SCRIPT" \; + postFixup = '' + export SAMBA_LIBS="$(find $out -type f -regex '.*\${stdenv.hostPlatform.extensions.sharedLibrary}\(\..*\)?' -exec dirname {} \; | sort | uniq)" + read -r -d "" SCRIPT << EOF || true + [ -z "\$SAMBA_LIBS" ] && exit 1; + BIN='{}'; + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + OLD_LIBS="\$(patchelf --print-rpath "\$BIN" 2>/dev/null | tr ':' '\n')"; + ALL_LIBS="\$(echo -e "\$SAMBA_LIBS\n\$OLD_LIBS" | sort | uniq | tr '\n' ':')"; + patchelf --set-rpath "\$ALL_LIBS" "\$BIN" 2>/dev/null || exit $?; + patchelf --shrink-rpath "\$BIN"; + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -id \$BIN \$BIN + for old_rpath in \$(otool -L \$BIN | grep /private/tmp/ | awk '{print \$1}'); do + new_rpath=\$(find \$SAMBA_LIBS -name \$(basename \$old_rpath) | head -n 1) + install_name_tool -change \$old_rpath \$new_rpath \$BIN + done + '' + + '' + EOF + find $out -type f -regex '.*\${stdenv.hostPlatform.extensions.sharedLibrary}\(\..*\)?' -exec $SHELL -c "$SCRIPT" \; + find $out/bin -type f -exec $SHELL -c "$SCRIPT" \; - # Fix PYTHONPATH for some tools - wrapPythonPrograms + # Fix PYTHONPATH for some tools + wrapPythonPrograms - # Samba does its own shebang patching, but uses build Python - find $out/bin -type f -executable | while read file; do - isScript "$file" || continue - sed -i 's^${lib.getBin buildPackages.python3Packages.python}^${lib.getBin python}^' "$file" - done - ''; + # Samba does its own shebang patching, but uses build Python + find $out/bin -type f -executable | while read file; do + isScript "$file" || continue + sed -i 's^${lib.getBin buildPackages.python3Packages.python}^${lib.getBin python}^' "$file" + done + ''; disallowedReferences = lib.optionals ( buildPackages.python3Packages.python != python3Packages.python diff --git a/pkgs/servers/search/elasticsearch/7.x.nix b/pkgs/servers/search/elasticsearch/7.x.nix index a06b8e29af45..e95f5292109d 100644 --- a/pkgs/servers/search/elasticsearch/7.x.nix +++ b/pkgs/servers/search/elasticsearch/7.x.nix @@ -46,7 +46,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook; buildInputs = [ jre_headless diff --git a/pkgs/servers/shishi/default.nix b/pkgs/servers/shishi/default.nix index 264b225b0c08..e9dfddb839de 100644 --- a/pkgs/servers/shishi/default.nix +++ b/pkgs/servers/shishi/default.nix @@ -73,21 +73,20 @@ stdenv.mkDerivation rec { installFlags = [ "sysconfdir=\${out}/etc" ]; # Fix *.la files - postInstall = - '' - sed -i $out/lib/libshi{sa,shi}.la \ - '' - + optionalString (optLibidn != null) '' - -e 's,\(-lidn\),-L${optLibidn.out}/lib \1,' \ - '' - + optionalString (optGnutls != null) '' - -e 's,\(-lgnutls\),-L${optGnutls.out}/lib \1,' \ - '' - + '' - -e 's,\(-lgcrypt\),-L${libgcrypt.out}/lib \1,' \ - -e 's,\(-lgpg-error\),-L${libgpg-error.out}/lib \1,' \ - -e 's,\(-ltasn1\),-L${libtasn1.out}/lib \1,' - ''; + postInstall = '' + sed -i $out/lib/libshi{sa,shi}.la \ + '' + + optionalString (optLibidn != null) '' + -e 's,\(-lidn\),-L${optLibidn.out}/lib \1,' \ + '' + + optionalString (optGnutls != null) '' + -e 's,\(-lgnutls\),-L${optGnutls.out}/lib \1,' \ + '' + + '' + -e 's,\(-lgcrypt\),-L${libgcrypt.out}/lib \1,' \ + -e 's,\(-lgpg-error\),-L${libgpg-error.out}/lib \1,' \ + -e 's,\(-ltasn1\),-L${libtasn1.out}/lib \1,' + ''; meta = with lib; { homepage = "https://www.gnu.org/software/shishi/"; diff --git a/pkgs/servers/sql/mariadb/connector-c/default.nix b/pkgs/servers/sql/mariadb/connector-c/default.nix index 6b5a5674078f..4d4c9c214778 100644 --- a/pkgs/servers/sql/mariadb/connector-c/default.nix +++ b/pkgs/servers/sql/mariadb/connector-c/default.nix @@ -40,23 +40,22 @@ stdenv.mkDerivation { "-DWITH_MYSQLCOMPAT=ON" ]; - postPatch = - '' - substituteInPlace mariadb_config/mariadb_config.c.in \ - --replace '#define INCLUDE "-I%s/@INSTALL_INCLUDEDIR@ -I%s/@INSTALL_INCLUDEDIR@/mysql"' "#define INCLUDE \"-I$dev/include -I$dev/include/mysql\"" \ - --replace '#define LIBS "-L%s/@INSTALL_LIBDIR@/ -lmariadb"' "#define LIBS \"-L$out/lib/mariadb -lmariadb\"" \ - --replace '#define PKG_LIBDIR "%s/@INSTALL_LIBDIR@"' "#define PKG_LIBDIR \"$out/lib/mariadb\"" \ - --replace '#define PLUGIN_DIR "%s/@INSTALL_PLUGINDIR@"' "#define PLUGIN_DIR \"$out/lib/mariadb/plugin\"" \ - --replace '#define PKG_PLUGINDIR "%s/@INSTALL_PLUGINDIR@"' "#define PKG_PLUGINDIR \"$out/lib/mariadb/plugin\"" - '' - + lib.optionalString stdenv.hostPlatform.isStatic '' - # Disables all dynamic plugins - substituteInPlace cmake/plugins.cmake \ - --replace 'if(''${CC_PLUGIN_DEFAULT} STREQUAL "DYNAMIC")' 'if(''${CC_PLUGIN_DEFAULT} STREQUAL "INVALID")' - # Force building static libraries - substituteInPlace libmariadb/CMakeLists.txt \ - --replace 'libmariadb SHARED' 'libmariadb STATIC' - ''; + postPatch = '' + substituteInPlace mariadb_config/mariadb_config.c.in \ + --replace '#define INCLUDE "-I%s/@INSTALL_INCLUDEDIR@ -I%s/@INSTALL_INCLUDEDIR@/mysql"' "#define INCLUDE \"-I$dev/include -I$dev/include/mysql\"" \ + --replace '#define LIBS "-L%s/@INSTALL_LIBDIR@/ -lmariadb"' "#define LIBS \"-L$out/lib/mariadb -lmariadb\"" \ + --replace '#define PKG_LIBDIR "%s/@INSTALL_LIBDIR@"' "#define PKG_LIBDIR \"$out/lib/mariadb\"" \ + --replace '#define PLUGIN_DIR "%s/@INSTALL_PLUGINDIR@"' "#define PLUGIN_DIR \"$out/lib/mariadb/plugin\"" \ + --replace '#define PKG_PLUGINDIR "%s/@INSTALL_PLUGINDIR@"' "#define PKG_PLUGINDIR \"$out/lib/mariadb/plugin\"" + '' + + lib.optionalString stdenv.hostPlatform.isStatic '' + # Disables all dynamic plugins + substituteInPlace cmake/plugins.cmake \ + --replace 'if(''${CC_PLUGIN_DEFAULT} STREQUAL "DYNAMIC")' 'if(''${CC_PLUGIN_DEFAULT} STREQUAL "INVALID")' + # Force building static libraries + substituteInPlace libmariadb/CMakeLists.txt \ + --replace 'libmariadb SHARED' 'libmariadb STATIC' + ''; # The cmake setup-hook uses $out/lib by default, this is not the case here. preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin '' @@ -68,7 +67,8 @@ stdenv.mkDerivation { curl openssl zlib - ] ++ lib.optional isVer33 zstd; + ] + ++ lib.optional isVer33 zstd; buildInputs = [ libiconv ]; postInstall = '' diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 00246dd59702..80dcc2dfbed9 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -84,36 +84,34 @@ let "man" ]; - nativeBuildInputs = - [ - cmake - pkg-config - ] - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames - ++ lib.optional (!stdenv.hostPlatform.isDarwin) makeWrapper; + nativeBuildInputs = [ + cmake + pkg-config + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames + ++ lib.optional (!stdenv.hostPlatform.isDarwin) makeWrapper; - buildInputs = + buildInputs = [ + libiconv + ncurses + zlib + pcre2 + openssl + curl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux ( [ - libiconv - ncurses - zlib - pcre2 - openssl - curl + libkrb5 + systemd ] - ++ lib.optionals stdenv.hostPlatform.isLinux ( - [ - libkrb5 - systemd - ] - ++ (if (lib.versionOlder version "10.6") then [ libaio ] else [ liburing ]) - ) - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - perl - libedit - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ jemalloc ]; + ++ (if (lib.versionOlder version "10.6") then [ libaio ] else [ liburing ]) + ) + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + perl + libedit + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ jemalloc ]; prePatch = '' sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt @@ -123,66 +121,64 @@ let NIX_CFLAGS_COMPILE = "-D_LARGEFILE64_SOURCE"; }; - patches = - [ - ./patch/cmake-includedir.patch - # patch for musl compatibility - ./patch/include-cstdint-full.patch - ] - # Fixes a build issue as documented on - # https://jira.mariadb.org/browse/MDEV-26769?focusedCommentId=206073&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-206073 - ++ lib.optional ( - !stdenv.hostPlatform.isLinux && lib.versionAtLeast version "10.6" - ) ./patch/macos-MDEV-26769-regression-fix.patch; + patches = [ + ./patch/cmake-includedir.patch + # patch for musl compatibility + ./patch/include-cstdint-full.patch + ] + # Fixes a build issue as documented on + # https://jira.mariadb.org/browse/MDEV-26769?focusedCommentId=206073&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-206073 + ++ lib.optional ( + !stdenv.hostPlatform.isLinux && lib.versionAtLeast version "10.6" + ) ./patch/macos-MDEV-26769-regression-fix.patch; - cmakeFlags = - [ - "-DBUILD_CONFIG=mysql_release" - "-DMANUFACTURER=nixos.org" - "-DDEFAULT_CHARSET=utf8mb4" - "-DDEFAULT_COLLATION=utf8mb4_unicode_ci" - "-DSECURITY_HARDENED=ON" + cmakeFlags = [ + "-DBUILD_CONFIG=mysql_release" + "-DMANUFACTURER=nixos.org" + "-DDEFAULT_CHARSET=utf8mb4" + "-DDEFAULT_COLLATION=utf8mb4_unicode_ci" + "-DSECURITY_HARDENED=ON" - "-DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock" - "-DINSTALL_BINDIR=bin" - "-DINSTALL_DOCDIR=share/doc/mysql" - "-DINSTALL_DOCREADMEDIR=share/doc/mysql" - "-DINSTALL_INCLUDEDIR=include/mysql" - "-DINSTALL_LIBDIR=lib" - "-DINSTALL_PLUGINDIR=lib/mysql/plugin" - "-DINSTALL_INFODIR=share/mysql/docs" - "-DINSTALL_MANDIR=share/man" - "-DINSTALL_MYSQLSHAREDIR=share/mysql" - "-DINSTALL_SCRIPTDIR=bin" - "-DINSTALL_SUPPORTFILESDIR=share/doc/mysql" - "-DINSTALL_MYSQLTESTDIR=OFF" - "-DINSTALL_SQLBENCHDIR=OFF" - "-DINSTALL_PAMDIR=share/pam/lib/security" - "-DINSTALL_PAMDATADIR=share/pam/etc/security" + "-DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock" + "-DINSTALL_BINDIR=bin" + "-DINSTALL_DOCDIR=share/doc/mysql" + "-DINSTALL_DOCREADMEDIR=share/doc/mysql" + "-DINSTALL_INCLUDEDIR=include/mysql" + "-DINSTALL_LIBDIR=lib" + "-DINSTALL_PLUGINDIR=lib/mysql/plugin" + "-DINSTALL_INFODIR=share/mysql/docs" + "-DINSTALL_MANDIR=share/man" + "-DINSTALL_MYSQLSHAREDIR=share/mysql" + "-DINSTALL_SCRIPTDIR=bin" + "-DINSTALL_SUPPORTFILESDIR=share/doc/mysql" + "-DINSTALL_MYSQLTESTDIR=OFF" + "-DINSTALL_SQLBENCHDIR=OFF" + "-DINSTALL_PAMDIR=share/pam/lib/security" + "-DINSTALL_PAMDATADIR=share/pam/etc/security" - "-DWITH_ZLIB=system" - "-DWITH_SSL=system" - "-DWITH_PCRE=system" - "-DWITH_SAFEMALLOC=OFF" - "-DWITH_UNIT_TESTS=OFF" - "-DEMBEDDED_LIBRARY=OFF" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # On Darwin without sandbox, CMake will find the system java and attempt to build with java support, but - # then it will fail during the actual build. Let's just disable the flag explicitly until someone decides - # to pass in java explicitly. - "-DCONNECT_WITH_JDBC=OFF" - "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && lib.versionAtLeast version "10.6") [ - # workaround for https://jira.mariadb.org/browse/MDEV-29925 - "-Dhave_C__Wl___as_needed=" - ] - ++ lib.optionals isCross [ - # revisit this if nixpkgs supports any architecture whose stack grows upwards - "-DSTACK_DIRECTION=-1" - "-DCMAKE_CROSSCOMPILING_EMULATOR=${stdenv.hostPlatform.emulator buildPackages}" - ]; + "-DWITH_ZLIB=system" + "-DWITH_SSL=system" + "-DWITH_PCRE=system" + "-DWITH_SAFEMALLOC=OFF" + "-DWITH_UNIT_TESTS=OFF" + "-DEMBEDDED_LIBRARY=OFF" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # On Darwin without sandbox, CMake will find the system java and attempt to build with java support, but + # then it will fail during the actual build. Let's just disable the flag explicitly until someone decides + # to pass in java explicitly. + "-DCONNECT_WITH_JDBC=OFF" + "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && lib.versionAtLeast version "10.6") [ + # workaround for https://jira.mariadb.org/browse/MDEV-29925 + "-Dhave_C__Wl___as_needed=" + ] + ++ lib.optionals isCross [ + # revisit this if nixpkgs supports any architecture whose stack grows upwards + "-DSTACK_DIRECTION=-1" + "-DCMAKE_CROSSCOMPILING_EMULATOR=${stdenv.hostPlatform.emulator buildPackages}" + ]; postInstall = lib.optionalString (!withEmbedded) '' # Remove Development components. Need to use libmysqlclient. @@ -235,8 +231,7 @@ let ]; buildInputs = - common.buildInputs - ++ lib.optionals (lib.versionAtLeast common.version "10.11") [ fmt_11 ]; + common.buildInputs ++ lib.optionals (lib.versionAtLeast common.version "10.11") [ fmt_11 ]; cmakeFlags = common.cmakeFlags ++ [ "-DPLUGIN_AUTH_PAM=NO" @@ -245,15 +240,13 @@ let "-DINSTALL_MYSQLSHAREDIR=share/mysql-client" ]; - postInstall = - common.postInstall - + '' - rm "$out"/bin/{mariadb-test,mysqltest} - libmysqlclient_path=$(readlink -f $out/lib/libmysqlclient${libExt}) - rm "$out"/lib/{libmariadb${libExt},libmysqlclient${libExt},libmysqlclient_r${libExt}} - mv "$libmysqlclient_path" "$out"/lib/libmysqlclient${libExt} - ln -sv libmysqlclient${libExt} "$out"/lib/libmysqlclient_r${libExt} - ''; + postInstall = common.postInstall + '' + rm "$out"/bin/{mariadb-test,mysqltest} + libmysqlclient_path=$(readlink -f $out/lib/libmysqlclient${libExt}) + rm "$out"/lib/{libmariadb${libExt},libmysqlclient${libExt},libmysqlclient_r${libExt}} + mv "$libmysqlclient_path" "$out"/lib/libmysqlclient${libExt} + ln -sv libmysqlclient${libExt} "$out"/lib/libmysqlclient_r${libExt} + ''; } ); in diff --git a/pkgs/servers/sql/mysql/8.0.x.nix b/pkgs/servers/sql/mysql/8.0.x.nix index fe1a1488ac0a..5bf46145cb65 100644 --- a/pkgs/servers/sql/mysql/8.0.x.nix +++ b/pkgs/servers/sql/mysql/8.0.x.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation (finalAttrs: { cmake pkg-config protobuf - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; patches = [ ./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch @@ -63,30 +64,29 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace cmake/package_name.cmake --replace-fail "COMMAND sw_vers" "COMMAND ${DarwinTools}/bin/sw_vers" ''; - buildInputs = - [ - boost - (curl.override { inherit openssl; }) - icu - libedit - libevent - lz4 - ncurses - openssl - protobuf - re2 - readline - zlib - zstd - libfido2 - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - numactl - libtirpc - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - developer_cmds - ]; + buildInputs = [ + boost + (curl.override { inherit openssl; }) + icu + libedit + libevent + lz4 + ncurses + openssl + protobuf + re2 + readline + zlib + zstd + libfido2 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + numactl + libtirpc + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + developer_cmds + ]; strictDeps = true; diff --git a/pkgs/servers/sql/percona-server/8_0.nix b/pkgs/servers/sql/percona-server/8_0.nix index 7a7efd9dbb31..8cdca01efb1e 100644 --- a/pkgs/servers/sql/percona-server/8_0.nix +++ b/pkgs/servers/sql/percona-server/8_0.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation (finalAttrs: { coreutils gnugrep procps - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; patches = [ # adapted from mysql80's llvm 19 fixes @@ -86,35 +87,34 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "make --" "${gnumake}/bin/make --" ''; - buildInputs = - [ - boost - (curl.override { inherit openssl; }) - icu - libedit - libevent - lz4 - ncurses - openssl - protobuf - re2 - readline - zlib - zstd - libfido2 - openldap - perl - cyrus_sasl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - numactl - libtirpc - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - developer_cmds - DarwinTools - ]; + buildInputs = [ + boost + (curl.override { inherit openssl; }) + icu + libedit + libevent + lz4 + ncurses + openssl + protobuf + re2 + readline + zlib + zstd + libfido2 + openldap + perl + cyrus_sasl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + numactl + libtirpc + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + developer_cmds + DarwinTools + ]; outputs = [ "out" diff --git a/pkgs/servers/sql/percona-server/8_4.nix b/pkgs/servers/sql/percona-server/8_4.nix index 5803fd2a6872..9635493e2003 100644 --- a/pkgs/servers/sql/percona-server/8_4.nix +++ b/pkgs/servers/sql/percona-server/8_4.nix @@ -66,7 +66,8 @@ stdenv.mkDerivation (finalAttrs: { coreutils gnugrep procps - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ rpcsvc-proto ]; patches = [ ./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch @@ -84,120 +85,117 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "make --" "${gnumake}/bin/make --" ''; - buildInputs = - [ - boost - (curl.override { inherit openssl; }) - icu - libedit - libevent - lz4 - ncurses - openssl - protobuf - re2 - readline - zlib - zstd - libfido2 - openldap - perl - cyrus_sasl - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - numactl - libtirpc - systemd - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - developer_cmds - DarwinTools - ] - ++ lib.optional (stdenv.hostPlatform.isLinux && withJemalloc) jemalloc - ++ lib.optional (stdenv.hostPlatform.isLinux && withTcmalloc) gperftools; + buildInputs = [ + boost + (curl.override { inherit openssl; }) + icu + libedit + libevent + lz4 + ncurses + openssl + protobuf + re2 + readline + zlib + zstd + libfido2 + openldap + perl + cyrus_sasl + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + numactl + libtirpc + systemd + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + developer_cmds + DarwinTools + ] + ++ lib.optional (stdenv.hostPlatform.isLinux && withJemalloc) jemalloc + ++ lib.optional (stdenv.hostPlatform.isLinux && withTcmalloc) gperftools; outputs = [ "out" "static" ]; - cmakeFlags = - [ - # Percona-specific flags. - "-DPORTABLE=1" - "-DWITH_LDAP=system" - "-DROCKSDB_DISABLE_AVX2=1" - "-DROCKSDB_DISABLE_MARCH_NATIVE=1" + cmakeFlags = [ + # Percona-specific flags. + "-DPORTABLE=1" + "-DWITH_LDAP=system" + "-DROCKSDB_DISABLE_AVX2=1" + "-DROCKSDB_DISABLE_MARCH_NATIVE=1" - # Flags taken from mysql package. - "-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin. - "-DWITH_ROUTER=OFF" # It may be packaged separately. - "-DWITH_SYSTEM_LIBS=ON" - "-DWITH_UNIT_TESTS=OFF" - "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" - "-DMYSQL_DATADIR=/var/lib/mysql" - "-DINSTALL_INFODIR=share/mysql/docs" - "-DINSTALL_MANDIR=share/man" - "-DINSTALL_PLUGINDIR=lib/mysql/plugin" - "-DINSTALL_INCLUDEDIR=include/mysql" - "-DINSTALL_DOCREADMEDIR=share/mysql" - "-DINSTALL_SUPPORTFILESDIR=share/mysql" - "-DINSTALL_MYSQLSHAREDIR=share/mysql" - "-DINSTALL_MYSQLTESTDIR=" - "-DINSTALL_DOCDIR=share/mysql/docs" - "-DINSTALL_SHAREDIR=share/mysql" + # Flags taken from mysql package. + "-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin. + "-DWITH_ROUTER=OFF" # It may be packaged separately. + "-DWITH_SYSTEM_LIBS=ON" + "-DWITH_UNIT_TESTS=OFF" + "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" + "-DMYSQL_DATADIR=/var/lib/mysql" + "-DINSTALL_INFODIR=share/mysql/docs" + "-DINSTALL_MANDIR=share/man" + "-DINSTALL_PLUGINDIR=lib/mysql/plugin" + "-DINSTALL_INCLUDEDIR=include/mysql" + "-DINSTALL_DOCREADMEDIR=share/mysql" + "-DINSTALL_SUPPORTFILESDIR=share/mysql" + "-DINSTALL_MYSQLSHAREDIR=share/mysql" + "-DINSTALL_MYSQLTESTDIR=" + "-DINSTALL_DOCDIR=share/mysql/docs" + "-DINSTALL_SHAREDIR=share/mysql" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DWITH_SYSTEMD=1" - "-DWITH_SYSTEMD_DEBUG=1" - ] - ++ lib.optional (stdenv.hostPlatform.isLinux && withJemalloc) "-DWITH_JEMALLOC=1" - ++ lib.optional (stdenv.hostPlatform.isLinux && withTcmalloc) "-DWITH_TCMALLOC=1"; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DWITH_SYSTEMD=1" + "-DWITH_SYSTEMD_DEBUG=1" + ] + ++ lib.optional (stdenv.hostPlatform.isLinux && withJemalloc) "-DWITH_JEMALLOC=1" + ++ lib.optional (stdenv.hostPlatform.isLinux && withTcmalloc) "-DWITH_TCMALLOC=1"; - postInstall = - '' - moveToOutput "lib/*.a" $static - so=${stdenv.hostPlatform.extensions.sharedLibrary} - ln -s libperconaserverclient$so $out/lib/libmysqlclient_r$so + postInstall = '' + moveToOutput "lib/*.a" $static + so=${stdenv.hostPlatform.extensions.sharedLibrary} + ln -s libperconaserverclient$so $out/lib/libmysqlclient_r$so - wrapProgram $out/bin/mysqld_safe --prefix PATH : ${ - lib.makeBinPath [ - coreutils - procps - gnugrep - gnused - hostname - ] - } - wrapProgram $out/bin/mysql_config --prefix PATH : ${ - lib.makeBinPath [ - coreutils - gnused - ] - } - wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${ - lib.makeBinPath [ - coreutils - gnugrep - ] - } - wrapProgram $out/bin/ps-admin --prefix PATH : ${ - lib.makeBinPath [ - coreutils - gnugrep - ] - } - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - wrapProgram $out/bin/mysqld_multi --prefix PATH : ${ - lib.makeBinPath [ - coreutils - gnugrep - ] - } - ''; + wrapProgram $out/bin/mysqld_safe --prefix PATH : ${ + lib.makeBinPath [ + coreutils + procps + gnugrep + gnused + hostname + ] + } + wrapProgram $out/bin/mysql_config --prefix PATH : ${ + lib.makeBinPath [ + coreutils + gnused + ] + } + wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${ + lib.makeBinPath [ + coreutils + gnugrep + ] + } + wrapProgram $out/bin/ps-admin --prefix PATH : ${ + lib.makeBinPath [ + coreutils + gnugrep + ] + } + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + wrapProgram $out/bin/mysqld_multi --prefix PATH : ${ + lib.makeBinPath [ + coreutils + gnugrep + ] + } + ''; passthru = { client = finalAttrs.finalPackage; diff --git a/pkgs/servers/sql/postgresql/ext/h3-pg.nix b/pkgs/servers/sql/postgresql/ext/h3-pg.nix index 69e67b2e339e..47ab4f11411b 100644 --- a/pkgs/servers/sql/postgresql/ext/h3-pg.nix +++ b/pkgs/servers/sql/postgresql/ext/h3-pg.nix @@ -20,15 +20,14 @@ postgresqlBuildExtension (finalAttrs: { hash = "sha256-kTh0Y0C2pNB5Ul1rp77ets/5VeU1zw1WasGHkOaDMh8="; }; - postPatch = - '' - substituteInPlace CMakeLists.txt \ - --replace-fail "add_subdirectory(cmake/h3)" "include_directories(${lib.getDev h3_4}/include/h3)" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace cmake/AddPostgreSQLExtension.cmake \ - --replace-fail "INTERPROCEDURAL_OPTIMIZATION TRUE" "" - ''; + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail "add_subdirectory(cmake/h3)" "include_directories(${lib.getDev h3_4}/include/h3)" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace cmake/AddPostgreSQLExtension.cmake \ + --replace-fail "INTERPROCEDURAL_OPTIMIZATION TRUE" "" + ''; nativeBuildInputs = [ cmake diff --git a/pkgs/servers/sql/postgresql/ext/postgis.nix b/pkgs/servers/sql/postgresql/ext/postgis.nix index 541ddbcf0484..9c14f0f30545 100644 --- a/pkgs/servers/sql/postgresql/ext/postgis.nix +++ b/pkgs/servers/sql/postgresql/ext/postgis.nix @@ -49,17 +49,16 @@ postgresqlBuildExtension (finalAttrs: { hash = "sha256-rJxIZGsQhh8QAacgkepBzzC79McVhY9wFphQIVRQHA8="; }; - buildInputs = - [ - geos - proj - gdal - json_c - protobufc - pcre2.dev - ] - ++ lib.optional stdenv.hostPlatform.isDarwin libiconv - ++ lib.optional withSfcgal sfcgal; + buildInputs = [ + geos + proj + gdal + json_c + protobufc + pcre2.dev + ] + ++ lib.optional stdenv.hostPlatform.isDarwin libiconv + ++ lib.optional withSfcgal sfcgal; nativeBuildInputs = [ autoconf @@ -70,7 +69,8 @@ postgresqlBuildExtension (finalAttrs: { pkg-config protobufc which - ] ++ lib.optional jitSupport llvm; + ] + ++ lib.optional jitSupport llvm; dontDisableStatic = true; @@ -129,40 +129,38 @@ postgresqlBuildExtension (finalAttrs: { passthru.tests.extension = postgresqlTestExtension { inherit (finalAttrs) finalPackage; - sql = - '' - CREATE EXTENSION postgis; - CREATE EXTENSION postgis_raster; - CREATE EXTENSION postgis_topology; - -- st_makepoint goes through c code - select st_makepoint(1, 1); - '' - + lib.optionalString withSfcgal '' - CREATE EXTENSION postgis_sfcgal; - CREATE TABLE geometries ( - name varchar, - geom geometry(PolygonZ) NOT NULL - ); + sql = '' + CREATE EXTENSION postgis; + CREATE EXTENSION postgis_raster; + CREATE EXTENSION postgis_topology; + -- st_makepoint goes through c code + select st_makepoint(1, 1); + '' + + lib.optionalString withSfcgal '' + CREATE EXTENSION postgis_sfcgal; + CREATE TABLE geometries ( + name varchar, + geom geometry(PolygonZ) NOT NULL + ); - INSERT INTO geometries(name, geom) VALUES - ('planar geom', 'PolygonZ((1 1 0, 1 2 0, 2 2 0, 2 1 0, 1 1 0))'), - ('nonplanar geom', 'PolygonZ((1 1 1, 1 2 -1, 2 2 2, 2 1 0, 1 1 1))'); + INSERT INTO geometries(name, geom) VALUES + ('planar geom', 'PolygonZ((1 1 0, 1 2 0, 2 2 0, 2 1 0, 1 1 0))'), + ('nonplanar geom', 'PolygonZ((1 1 1, 1 2 -1, 2 2 2, 2 1 0, 1 1 1))'); - SELECT name from geometries where cg_isplanar(geom); - ''; - asserts = - [ - { - query = "postgis_version()"; - expected = "'${lib.versions.major finalAttrs.version}.${lib.versions.minor finalAttrs.version} USE_GEOS=1 USE_PROJ=1 USE_STATS=1'"; - description = "postgis_version() returns correct values."; - } - ] - ++ lib.optional withSfcgal { - query = "postgis_sfcgal_version()"; - expected = "'${sfcgal.version}'"; - description = "postgis_sfcgal_version() returns correct value."; - }; + SELECT name from geometries where cg_isplanar(geom); + ''; + asserts = [ + { + query = "postgis_version()"; + expected = "'${lib.versions.major finalAttrs.version}.${lib.versions.minor finalAttrs.version} USE_GEOS=1 USE_PROJ=1 USE_STATS=1'"; + description = "postgis_version() returns correct values."; + } + ] + ++ lib.optional withSfcgal { + query = "postgis_sfcgal_version()"; + expected = "'${sfcgal.version}'"; + description = "postgis_sfcgal_version() returns correct value."; + }; }; meta = { diff --git a/pkgs/servers/sql/postgresql/generic.nix b/pkgs/servers/sql/postgresql/generic.nix index 3f8c4f893f24..028722c5aff1 100644 --- a/pkgs/servers/sql/postgresql/generic.nix +++ b/pkgs/servers/sql/postgresql/generic.nix @@ -194,120 +194,123 @@ let __structuredAttrs = true; - outputs = - [ - "out" - "dev" - "doc" - "lib" - "man" - ] - ++ lib.optionals jitSupport [ "jit" ] - ++ lib.optionals perlSupport [ "plperl" ] - ++ lib.optionals pythonSupport [ "plpython3" ] - ++ lib.optionals tclSupport [ "pltcl" ]; + outputs = [ + "out" + "dev" + "doc" + "lib" + "man" + ] + ++ lib.optionals jitSupport [ "jit" ] + ++ lib.optionals perlSupport [ "plperl" ] + ++ lib.optionals pythonSupport [ "plpython3" ] + ++ lib.optionals tclSupport [ "pltcl" ]; - outputChecks = - { - out = { - disallowedReferences = [ - "dev" - "doc" - "man" - ] ++ lib.optionals jitSupport [ "jit" ]; - disallowedRequisites = [ - stdenv'.cc - llvmPackages.llvm.out - llvmPackages.llvm.lib - ] ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); - }; - - lib = { - disallowedReferences = [ - "out" - "dev" - "doc" - "man" - ] ++ lib.optionals jitSupport [ "jit" ]; - disallowedRequisites = [ - stdenv'.cc - llvmPackages.llvm.out - llvmPackages.llvm.lib - ] ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); - }; - - doc = { - disallowedReferences = [ - "out" - "dev" - "man" - ] ++ lib.optionals jitSupport [ "jit" ]; - }; - - man = { - disallowedReferences = [ - "out" - "dev" - "doc" - ] ++ lib.optionals jitSupport [ "jit" ]; - }; - } - // lib.optionalAttrs jitSupport { - jit = { - disallowedReferences = [ - "dev" - "doc" - "man" - ]; - disallowedRequisites = [ - stdenv'.cc - llvmPackages.llvm.out - ] ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); - }; + outputChecks = { + out = { + disallowedReferences = [ + "dev" + "doc" + "man" + ] + ++ lib.optionals jitSupport [ "jit" ]; + disallowedRequisites = [ + stdenv'.cc + llvmPackages.llvm.out + llvmPackages.llvm.lib + ] + ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); }; + lib = { + disallowedReferences = [ + "out" + "dev" + "doc" + "man" + ] + ++ lib.optionals jitSupport [ "jit" ]; + disallowedRequisites = [ + stdenv'.cc + llvmPackages.llvm.out + llvmPackages.llvm.lib + ] + ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); + }; + + doc = { + disallowedReferences = [ + "out" + "dev" + "man" + ] + ++ lib.optionals jitSupport [ "jit" ]; + }; + + man = { + disallowedReferences = [ + "out" + "dev" + "doc" + ] + ++ lib.optionals jitSupport [ "jit" ]; + }; + } + // lib.optionalAttrs jitSupport { + jit = { + disallowedReferences = [ + "dev" + "doc" + "man" + ]; + disallowedRequisites = [ + stdenv'.cc + llvmPackages.llvm.out + ] + ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); + }; + }; + strictDeps = true; - buildInputs = - [ - zlib - readline - openssl - libxml2 - libuuid - ] - ++ lib.optionals icuSupport [ icu ] - ++ lib.optionals jitSupport [ llvmPackages.llvm ] - ++ lib.optionals lz4Enabled [ lz4 ] - ++ lib.optionals zstdEnabled [ zstd ] - ++ lib.optionals systemdSupport [ systemdLibs ] - ++ lib.optionals uringSupport [ liburing ] - ++ lib.optionals curlSupport [ curl ] - ++ lib.optionals numaSupport [ numactl ] - ++ lib.optionals gssSupport [ libkrb5 ] - ++ lib.optionals pamSupport [ linux-pam ] - ++ lib.optionals perlSupport [ perl ] - ++ lib.optionals ldapSupport [ openldap ] - ++ lib.optionals selinuxSupport [ libselinux ] - ++ lib.optionals nlsSupport [ gettext ]; + buildInputs = [ + zlib + readline + openssl + libxml2 + libuuid + ] + ++ lib.optionals icuSupport [ icu ] + ++ lib.optionals jitSupport [ llvmPackages.llvm ] + ++ lib.optionals lz4Enabled [ lz4 ] + ++ lib.optionals zstdEnabled [ zstd ] + ++ lib.optionals systemdSupport [ systemdLibs ] + ++ lib.optionals uringSupport [ liburing ] + ++ lib.optionals curlSupport [ curl ] + ++ lib.optionals numaSupport [ numactl ] + ++ lib.optionals gssSupport [ libkrb5 ] + ++ lib.optionals pamSupport [ linux-pam ] + ++ lib.optionals perlSupport [ perl ] + ++ lib.optionals ldapSupport [ openldap ] + ++ lib.optionals selinuxSupport [ libselinux ] + ++ lib.optionals nlsSupport [ gettext ]; - nativeBuildInputs = - [ - bison - docbook-xsl-nons - docbook_xml_dtd_45 - flex - libxml2 - libxslt - makeBinaryWrapper - perl - pkg-config - removeReferencesTo - ] - ++ lib.optionals jitSupport [ - llvmPackages.llvm.dev - nukeReferences - ]; + nativeBuildInputs = [ + bison + docbook-xsl-nons + docbook_xml_dtd_45 + flex + libxml2 + libxslt + makeBinaryWrapper + perl + pkg-config + removeReferencesTo + ] + ++ lib.optionals jitSupport [ + llvmPackages.llvm.dev + nukeReferences + ]; enableParallelBuilding = true; @@ -315,27 +318,26 @@ let buildFlags = [ "world" ]; - env = - { - # libpgcommon.a and libpgport.a contain all paths returned by pg_config and are linked - # into all binaries. However, almost no binaries actually use those paths. The following - # flags will remove unused sections from all shared libraries and binaries - including - # those paths. This avoids a lot of circular dependency problems with different outputs, - # and allows splitting them cleanly. - CFLAGS = "-fdata-sections -ffunction-sections -flto"; + env = { + # libpgcommon.a and libpgport.a contain all paths returned by pg_config and are linked + # into all binaries. However, almost no binaries actually use those paths. The following + # flags will remove unused sections from all shared libraries and binaries - including + # those paths. This avoids a lot of circular dependency problems with different outputs, + # and allows splitting them cleanly. + CFLAGS = "-fdata-sections -ffunction-sections -flto"; - # This flag was introduced upstream in: - # https://github.com/postgres/postgres/commit/b6c7cfac88c47a9194d76f3d074129da3c46545a - # It causes errors when linking against libpq.a in pkgsStatic: - # undefined reference to `pg_encoding_to_char' - # Unsetting the flag fixes it. The upstream reasoning to introduce it is about the risk - # to have initdb load a libpq.so from a different major version and how to avoid that. - # This doesn't apply to us with Nix. - NIX_CFLAGS_COMPILE = "-UUSE_PRIVATE_ENCODING_FUNCS"; - } - // lib.optionalAttrs perlSupport { PERL = lib.getExe perl; } - // lib.optionalAttrs pythonSupport { PYTHON = lib.getExe python3; } - // lib.optionalAttrs tclSupport { TCLSH = "${lib.getBin tcl}/bin/tclsh"; }; + # This flag was introduced upstream in: + # https://github.com/postgres/postgres/commit/b6c7cfac88c47a9194d76f3d074129da3c46545a + # It causes errors when linking against libpq.a in pkgsStatic: + # undefined reference to `pg_encoding_to_char' + # Unsetting the flag fixes it. The upstream reasoning to introduce it is about the risk + # to have initdb load a libpq.so from a different major version and how to avoid that. + # This doesn't apply to us with Nix. + NIX_CFLAGS_COMPILE = "-UUSE_PRIVATE_ENCODING_FUNCS"; + } + // lib.optionalAttrs perlSupport { PERL = lib.getExe perl; } + // lib.optionalAttrs pythonSupport { PYTHON = lib.getExe python3; } + // lib.optionalAttrs tclSupport { TCLSH = "${lib.getBin tcl}/bin/tclsh"; }; configureFlags = let @@ -385,136 +387,133 @@ let ++ lib.optionals nlsSupport [ "--enable-nls" ] ++ lib.optionals bonjourSupport [ "--with-bonjour" ]; - patches = - [ - ( - if atLeast "16" then - ./patches/relative-to-symlinks-16+.patch - else - ./patches/relative-to-symlinks.patch - ) - ( - if atLeast "15" then - ./patches/empty-pg-config-view-15+.patch - else - ./patches/empty-pg-config-view.patch - ) - ./patches/less-is-more.patch - ./patches/paths-for-split-outputs.patch - ./patches/paths-with-postgresql-suffix.patch - - (replaceVars ./patches/locale-binary-path.patch { - locale = "${ - if stdenv.hostPlatform.isDarwin then - darwin.adv_cmds - else if stdenv.hostPlatform.isFreeBSD then - freebsd.locale - else - lib.getBin stdenv.cc.libc - }/bin/locale"; - }) - ] - ++ lib.optionals stdenv'.hostPlatform.isMusl ( - # Using fetchurl instead of fetchpatch on purpose: https://github.com/NixOS/nixpkgs/issues/240141 - map fetchurl (lib.attrValues muslPatches) + patches = [ + ( + if atLeast "16" then + ./patches/relative-to-symlinks-16+.patch + else + ./patches/relative-to-symlinks.patch ) - ++ lib.optionals stdenv'.hostPlatform.isLinux [ - ./patches/socketdir-in-run-13+.patch - ] - ++ lib.optionals (stdenv'.hostPlatform.isDarwin && olderThan "16") [ - ./patches/export-dynamic-darwin-15-.patch - ]; + ( + if atLeast "15" then + ./patches/empty-pg-config-view-15+.patch + else + ./patches/empty-pg-config-view.patch + ) + ./patches/less-is-more.patch + ./patches/paths-for-split-outputs.patch + ./patches/paths-with-postgresql-suffix.patch + + (replaceVars ./patches/locale-binary-path.patch { + locale = "${ + if stdenv.hostPlatform.isDarwin then + darwin.adv_cmds + else if stdenv.hostPlatform.isFreeBSD then + freebsd.locale + else + lib.getBin stdenv.cc.libc + }/bin/locale"; + }) + ] + ++ lib.optionals stdenv'.hostPlatform.isMusl ( + # Using fetchurl instead of fetchpatch on purpose: https://github.com/NixOS/nixpkgs/issues/240141 + map fetchurl (lib.attrValues muslPatches) + ) + ++ lib.optionals stdenv'.hostPlatform.isLinux [ + ./patches/socketdir-in-run-13+.patch + ] + ++ lib.optionals (stdenv'.hostPlatform.isDarwin && olderThan "16") [ + ./patches/export-dynamic-darwin-15-.patch + ]; installTargets = [ "install-world" ]; - postPatch = - '' - substituteInPlace "src/Makefile.global.in" --subst-var out - substituteInPlace "src/common/config_info.c" --subst-var dev - cat ${./pg_config.env.mk} >> src/common/Makefile - '' - # This check was introduced upstream to prevent calls to "exit" inside libpq. - # However, this doesn't work reliably with static linking, see this and following: - # https://postgr.es/m/flat/20210703001639.GB2374652%40rfd.leadboat.com#52584ca4bd3cb9dac376f3158c419f97 - # Thus, disable the check entirely, as it would currently fail with this: - # > libpq.so.5.17: U atexit - # > libpq.so.5.17: U pthread_exit - # > libpq must not be calling any function which invokes exit - # Don't mind the fact that this checks libpq.**so** in pkgsStatic - that's correct, since PostgreSQL - # still needs a shared library internally. - + lib.optionalString (atLeast "15" && stdenv'.hostPlatform.isStatic) '' - substituteInPlace src/interfaces/libpq/Makefile \ - --replace-fail "echo 'libpq must not be calling any function which invokes exit'; exit 1;" "echo;" - ''; + postPatch = '' + substituteInPlace "src/Makefile.global.in" --subst-var out + substituteInPlace "src/common/config_info.c" --subst-var dev + cat ${./pg_config.env.mk} >> src/common/Makefile + '' + # This check was introduced upstream to prevent calls to "exit" inside libpq. + # However, this doesn't work reliably with static linking, see this and following: + # https://postgr.es/m/flat/20210703001639.GB2374652%40rfd.leadboat.com#52584ca4bd3cb9dac376f3158c419f97 + # Thus, disable the check entirely, as it would currently fail with this: + # > libpq.so.5.17: U atexit + # > libpq.so.5.17: U pthread_exit + # > libpq must not be calling any function which invokes exit + # Don't mind the fact that this checks libpq.**so** in pkgsStatic - that's correct, since PostgreSQL + # still needs a shared library internally. + + lib.optionalString (atLeast "15" && stdenv'.hostPlatform.isStatic) '' + substituteInPlace src/interfaces/libpq/Makefile \ + --replace-fail "echo 'libpq must not be calling any function which invokes exit'; exit 1;" "echo;" + ''; - postInstall = - '' - moveToOutput "bin/ecpg" "$dev" - moveToOutput "lib/pgxs" "$dev" - '' - + lib.optionalString (stdenv'.buildPlatform.canExecute stdenv'.hostPlatform) '' - mkdir -p "$dev/nix-support" - "$out/bin/pg_config" > "$dev/nix-support/pg_config.expected" - '' - + '' - rm "$out/bin/pg_config" - make -C src/common pg_config.env - install -D src/common/pg_config.env "$dev/nix-support/pg_config.env" + postInstall = '' + moveToOutput "bin/ecpg" "$dev" + moveToOutput "lib/pgxs" "$dev" + '' + + lib.optionalString (stdenv'.buildPlatform.canExecute stdenv'.hostPlatform) '' + mkdir -p "$dev/nix-support" + "$out/bin/pg_config" > "$dev/nix-support/pg_config.expected" + '' + + '' + rm "$out/bin/pg_config" + make -C src/common pg_config.env + install -D src/common/pg_config.env "$dev/nix-support/pg_config.env" - # postgres exposes external symbols get_pkginclude_path and similar. Those - # can't be stripped away by --gc-sections/LTO, because they could theoretically - # be used by dynamically loaded modules / extensions. To avoid circular dependencies, - # references to -dev, -doc and -man are removed here. References to -lib must be kept, - # because there is a realistic use-case for extensions to locate the /lib directory to - # load other shared modules. - remove-references-to -t "$dev" -t "$doc" -t "$man" "$out/bin/postgres" - '' - + lib.optionalString (!stdenv'.hostPlatform.isStatic) '' - if [ -z "''${dontDisableStatic:-}" ]; then - # Remove static libraries in case dynamic are available. - for i in $lib/lib/*.a; do - name="$(basename "$i")" - ext="${stdenv'.hostPlatform.extensions.sharedLibrary}" - if [ -e "$lib/lib/''${name%.a}$ext" ] || [ -e "''${i%.a}$ext" ]; then - rm "$i" - fi - done - fi - '' - + '' - # The remaining static libraries are libpgcommon.a, libpgport.a and related. - # Those are only used when building e.g. extensions, so go to $dev. - moveToOutput "lib/*.a" "$dev" - '' - + lib.optionalString jitSupport '' - # In the case of JIT support, prevent useless dependencies on header files - find "$out/lib" -iname '*.bc' -type f -exec nuke-refs '{}' + + # postgres exposes external symbols get_pkginclude_path and similar. Those + # can't be stripped away by --gc-sections/LTO, because they could theoretically + # be used by dynamically loaded modules / extensions. To avoid circular dependencies, + # references to -dev, -doc and -man are removed here. References to -lib must be kept, + # because there is a realistic use-case for extensions to locate the /lib directory to + # load other shared modules. + remove-references-to -t "$dev" -t "$doc" -t "$man" "$out/bin/postgres" + '' + + lib.optionalString (!stdenv'.hostPlatform.isStatic) '' + if [ -z "''${dontDisableStatic:-}" ]; then + # Remove static libraries in case dynamic are available. + for i in $lib/lib/*.a; do + name="$(basename "$i")" + ext="${stdenv'.hostPlatform.extensions.sharedLibrary}" + if [ -e "$lib/lib/''${name%.a}$ext" ] || [ -e "''${i%.a}$ext" ]; then + rm "$i" + fi + done + fi + '' + + '' + # The remaining static libraries are libpgcommon.a, libpgport.a and related. + # Those are only used when building e.g. extensions, so go to $dev. + moveToOutput "lib/*.a" "$dev" + '' + + lib.optionalString jitSupport '' + # In the case of JIT support, prevent useless dependencies on header files + find "$out/lib" -iname '*.bc' -type f -exec nuke-refs '{}' + - # Stop lib depending on the -dev output of llvm - remove-references-to -t ${llvmPackages.llvm.dev} "$out/lib/llvmjit${dlSuffix}" + # Stop lib depending on the -dev output of llvm + remove-references-to -t ${llvmPackages.llvm.dev} "$out/lib/llvmjit${dlSuffix}" - moveToOutput "lib/bitcode" "$jit" - moveToOutput "lib/llvmjit*" "$jit" - '' - + lib.optionalString stdenv'.hostPlatform.isDarwin '' - # The darwin specific Makefile for PGXS contains a reference to the postgres - # binary. Some extensions (here: postgis), which are able to set bindir correctly - # to their own output for installation, will then fail to find "postgres" during linking. - substituteInPlace "$dev/lib/pgxs/src/Makefile.port" \ - --replace-fail '-bundle_loader $(bindir)/postgres' "-bundle_loader $out/bin/postgres" - '' - + lib.optionalString perlSupport '' - moveToOutput "lib/*plperl*" "$plperl" - moveToOutput "share/postgresql/extension/*plperl*" "$plperl" - '' - + lib.optionalString pythonSupport '' - moveToOutput "lib/*plpython3*" "$plpython3" - moveToOutput "share/postgresql/extension/*plpython3*" "$plpython3" - '' - + lib.optionalString tclSupport '' - moveToOutput "lib/*pltcl*" "$pltcl" - moveToOutput "share/postgresql/extension/*pltcl*" "$pltcl" - ''; + moveToOutput "lib/bitcode" "$jit" + moveToOutput "lib/llvmjit*" "$jit" + '' + + lib.optionalString stdenv'.hostPlatform.isDarwin '' + # The darwin specific Makefile for PGXS contains a reference to the postgres + # binary. Some extensions (here: postgis), which are able to set bindir correctly + # to their own output for installation, will then fail to find "postgres" during linking. + substituteInPlace "$dev/lib/pgxs/src/Makefile.port" \ + --replace-fail '-bundle_loader $(bindir)/postgres' "-bundle_loader $out/bin/postgres" + '' + + lib.optionalString perlSupport '' + moveToOutput "lib/*plperl*" "$plperl" + moveToOutput "share/postgresql/extension/*plperl*" "$plperl" + '' + + lib.optionalString pythonSupport '' + moveToOutput "lib/*plpython3*" "$plpython3" + moveToOutput "share/postgresql/extension/*plpython3*" "$plpython3" + '' + + lib.optionalString tclSupport '' + moveToOutput "lib/*pltcl*" "$pltcl" + moveToOutput "share/postgresql/extension/*pltcl*" "$pltcl" + ''; postFixup = lib.optionalString stdenv'.hostPlatform.isGnu '' # initdb needs access to "locale" command from glibc. @@ -588,16 +587,15 @@ let pg_config = buildPackages.callPackage ./pg_config.nix { inherit (finalAttrs) finalPackage; }; - tests = - { - postgresql = nixosTests.postgresql.postgresql.passthru.override finalAttrs.finalPackage; - postgresql-tls-client-cert = nixosTests.postgresql.postgresql-tls-client-cert.passthru.override finalAttrs.finalPackage; - postgresql-wal-receiver = nixosTests.postgresql.postgresql-wal-receiver.passthru.override finalAttrs.finalPackage; - pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - } - // lib.optionalAttrs jitSupport { - postgresql-jit = nixosTests.postgresql.postgresql-jit.passthru.override finalAttrs.finalPackage; - }; + tests = { + postgresql = nixosTests.postgresql.postgresql.passthru.override finalAttrs.finalPackage; + postgresql-tls-client-cert = nixosTests.postgresql.postgresql-tls-client-cert.passthru.override finalAttrs.finalPackage; + postgresql-wal-receiver = nixosTests.postgresql.postgresql-wal-receiver.passthru.override finalAttrs.finalPackage; + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + } + // lib.optionalAttrs jitSupport { + postgresql-jit = nixosTests.postgresql.postgresql-jit.passthru.override finalAttrs.finalPackage; + }; }; meta = with lib; { diff --git a/pkgs/servers/sql/postgresql/libpq.nix b/pkgs/servers/sql/postgresql/libpq.nix index 6af21fba86b7..d3f3da989186 100644 --- a/pkgs/servers/sql/postgresql/libpq.nix +++ b/pkgs/servers/sql/postgresql/libpq.nix @@ -53,16 +53,16 @@ stdenv.mkDerivation (finalAttrs: { disallowedReferences = [ "dev" ]; disallowedRequisites = [ stdenv.cc - ] ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); + ] + ++ (map lib.getDev (builtins.filter (drv: drv ? "dev") finalAttrs.buildInputs)); }; - buildInputs = - [ - zlib - openssl - ] - ++ lib.optionals gssSupport [ libkrb5 ] - ++ lib.optionals nlsSupport [ gettext ]; + buildInputs = [ + zlib + openssl + ] + ++ lib.optionals gssSupport [ libkrb5 ] + ++ lib.optionals nlsSupport [ gettext ]; nativeBuildInputs = [ bison @@ -100,18 +100,17 @@ stdenv.mkDerivation (finalAttrs: { # This doesn't apply to us with Nix. env.NIX_CFLAGS_COMPILE = "-UUSE_PRIVATE_ENCODING_FUNCS"; - configureFlags = - [ - "--enable-debug" - "--sysconfdir=/etc" - "--with-openssl" - "--with-system-tzdata=${tzdata}/share/zoneinfo" - "--without-icu" - "--without-perl" - "--without-readline" - ] - ++ lib.optionals gssSupport [ "--with-gssapi" ] - ++ lib.optionals nlsSupport [ "--enable-nls" ]; + configureFlags = [ + "--enable-debug" + "--sysconfdir=/etc" + "--with-openssl" + "--with-system-tzdata=${tzdata}/share/zoneinfo" + "--without-icu" + "--without-perl" + "--without-readline" + ] + ++ lib.optionals gssSupport [ "--with-gssapi" ] + ++ lib.optionals nlsSupport [ "--enable-nls" ]; patches = lib.optionals stdenv.hostPlatform.isLinux [ ./patches/socketdir-in-run-13+.patch diff --git a/pkgs/servers/sql/postgresql/postgresqlBuildExtension.nix b/pkgs/servers/sql/postgresql/postgresqlBuildExtension.nix index de5c6c43a168..1fc3574fc77e 100644 --- a/pkgs/servers/sql/postgresql/postgresqlBuildExtension.nix +++ b/pkgs/servers/sql/postgresql/postgresqlBuildExtension.nix @@ -94,59 +94,59 @@ lib.extendMkDerivation { installFlags = [ "DESTDIR=${placeholder "out"}" - ] ++ prevAttrs.installFlags or [ ]; + ] + ++ prevAttrs.installFlags or [ ]; - postInstall = - '' - # DESTDIR + pg_config install the files into - # /nix/store//nix/store//... - # We'll now remove the /nix/store/ part: - if [[ -d "$out${postgresql}" ]]; then - cp -alt "$out" "$out${postgresql}"/* - rm -r "$out${postgresql}" - fi + postInstall = '' + # DESTDIR + pg_config install the files into + # /nix/store//nix/store//... + # We'll now remove the /nix/store/ part: + if [[ -d "$out${postgresql}" ]]; then + cp -alt "$out" "$out${postgresql}"/* + rm -r "$out${postgresql}" + fi - if [[ -d "$out${postgresql.dev}" ]]; then - mkdir -p "''${dev:-$out}" - cp -alt "''${dev:-$out}" "$out${postgresql.dev}"/* - rm -r "$out${postgresql.dev}" - fi + if [[ -d "$out${postgresql.dev}" ]]; then + mkdir -p "''${dev:-$out}" + cp -alt "''${dev:-$out}" "$out${postgresql.dev}"/* + rm -r "$out${postgresql.dev}" + fi - if [[ -d "$out${postgresql.lib}" ]]; then - mkdir -p "''${lib:-$out}" - cp -alt "''${lib:-$out}" "$out${postgresql.lib}"/* - rm -r "$out${postgresql.lib}" - fi + if [[ -d "$out${postgresql.lib}" ]]; then + mkdir -p "''${lib:-$out}" + cp -alt "''${lib:-$out}" "$out${postgresql.lib}"/* + rm -r "$out${postgresql.lib}" + fi - if [[ -d "$out${postgresql.doc}" ]]; then - mkdir -p "''${doc:-$out}" - cp -alt "''${doc:-$out}" "$out${postgresql.doc}"/* - rm -r "$out${postgresql.doc}" - fi + if [[ -d "$out${postgresql.doc}" ]]; then + mkdir -p "''${doc:-$out}" + cp -alt "''${doc:-$out}" "$out${postgresql.doc}"/* + rm -r "$out${postgresql.doc}" + fi - if [[ -d "$out${postgresql.man}" ]]; then - mkdir -p "''${man:-$out}" - cp -alt "''${man:-$out}" "$out${postgresql.man}"/* - rm -r "$out${postgresql.man}" - fi + if [[ -d "$out${postgresql.man}" ]]; then + mkdir -p "''${man:-$out}" + cp -alt "''${man:-$out}" "$out${postgresql.man}"/* + rm -r "$out${postgresql.man}" + fi - # In some cases (postgis) parts of the install script - # actually work "OK", before we add DESTDIR, so some - # files end up in - # /nix/store//nix/store//... - if [[ -d "$out$out" ]]; then - cp -alt "$out" "$out$out"/* - rm -r "$out$out" - fi + # In some cases (postgis) parts of the install script + # actually work "OK", before we add DESTDIR, so some + # files end up in + # /nix/store//nix/store//... + if [[ -d "$out$out" ]]; then + cp -alt "$out" "$out$out"/* + rm -r "$out$out" + fi - if [[ -d "$out/nix/store" ]]; then - if ! rmdir "$out/nix/store" "$out/nix"; then - find "$out/nix" - nixErrorLog 'Found left-overs in $out/nix/store, make sure to move them into $out properly.' - exit 1 - fi - fi - '' - + prevAttrs.postInstall or ""; + if [[ -d "$out/nix/store" ]]; then + if ! rmdir "$out/nix/store" "$out/nix"; then + find "$out/nix" + nixErrorLog 'Found left-overs in $out/nix/store, make sure to move them into $out properly.' + exit 1 + fi + fi + '' + + prevAttrs.postInstall or ""; }; } diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix index 2d6930e34970..39d92a8f9bc3 100644 --- a/pkgs/servers/varnish/default.nix +++ b/pkgs/servers/varnish/default.nix @@ -41,19 +41,18 @@ let sphinx makeWrapper ]; - buildInputs = - [ - libxslt - groff - ncurses - readline - libedit - python3 - ] - ++ lib.optional (lib.versionOlder version "7") pcre - ++ lib.optional (lib.versionAtLeast version "7") pcre2 - ++ lib.optional stdenv.hostPlatform.isDarwin libunwind - ++ lib.optional stdenv.hostPlatform.isLinux jemalloc; + buildInputs = [ + libxslt + groff + ncurses + readline + libedit + python3 + ] + ++ lib.optional (lib.versionOlder version "7") pcre + ++ lib.optional (lib.versionAtLeast version "7") pcre2 + ++ lib.optional stdenv.hostPlatform.isDarwin libunwind + ++ lib.optional stdenv.hostPlatform.isLinux jemalloc; buildFlags = [ "localstatedir=/var/run" ]; diff --git a/pkgs/servers/web-apps/discourse/default.nix b/pkgs/servers/web-apps/discourse/default.nix index a5d3d0489359..e8186c8b7716 100644 --- a/pkgs/servers/web-apps/discourse/default.nix +++ b/pkgs/servers/web-apps/discourse/default.nix @@ -122,30 +122,29 @@ let pluginName = if name != null then name else "${pname}-${version}"; dontConfigure = true; dontBuild = true; - installPhase = - '' - runHook preInstall - mkdir -p $out - cp -r * $out/ - '' - + lib.optionalString (bundlerEnvArgs != { }) ( - if preserveGemsDir then - '' - cp -r ${rubyEnv}/lib/ruby/gems/* $out/gems/ - '' - else - '' - if [[ -e $out/gems ]]; then - echo "Warning: The repo contains a 'gems' directory which will be removed!" - echo " If you need to preserve it, set 'preserveGemsDir = true'." - rm -r $out/gems - fi - ln -sf ${rubyEnv}/lib/ruby/gems $out/gems - '' - + '' - runHook postInstall - '' - ); + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r * $out/ + '' + + lib.optionalString (bundlerEnvArgs != { }) ( + if preserveGemsDir then + '' + cp -r ${rubyEnv}/lib/ruby/gems/* $out/gems/ + '' + else + '' + if [[ -e $out/gems ]]; then + echo "Warning: The repo contains a 'gems' directory which will be removed!" + echo " If you need to preserve it, set 'preserveGemsDir = true'." + rm -r $out/gems + fi + ln -sf ${rubyEnv}/lib/ruby/gems $out/gems + '' + + '' + runHook postInstall + '' + ); } ); diff --git a/pkgs/servers/web-apps/lemmy/server.nix b/pkgs/servers/web-apps/lemmy/server.nix index c868e7463e5c..f1f84ada00c4 100644 --- a/pkgs/servers/web-apps/lemmy/server.nix +++ b/pkgs/servers/web-apps/lemmy/server.nix @@ -33,11 +33,12 @@ rustPlatform.buildRustPackage rec { useFetchCargoVendor = true; cargoHash = pinData.serverCargoHash; - buildInputs = - [ libpq ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + libpq + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; # Using OPENSSL_NO_VENDOR is not an option on darwin # As of version 0.10.35 rust-openssl looks for openssl on darwin diff --git a/pkgs/servers/web-apps/wordpress/packages/default.nix b/pkgs/servers/web-apps/wordpress/packages/default.nix index a0b64dd245d7..5fafdd153413 100644 --- a/pkgs/servers/web-apps/wordpress/packages/default.nix +++ b/pkgs/servers/web-apps/wordpress/packages/default.nix @@ -68,7 +68,8 @@ let meta = { license = lib.licenses.${license}; - } // (args.passthru or { }); + } + // (args.passthru or { }); } // lib.optionalAttrs (type == "language") { nativeBuildInputs = [ diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 49f4838a058b..273071f0fbd8 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -159,7 +159,8 @@ self: super: configureFlags = [ "--enable-xkb" "--enable-xinput" - ] ++ lib.optional stdenv.hostPlatform.isStatic "--disable-shared"; + ] + ++ lib.optional stdenv.hostPlatform.isStatic "--disable-shared"; outputs = [ "out" "dev" @@ -207,13 +208,12 @@ self: super: attrs.configureFlags or [ ] ++ malloc0ReturnsNullCrossFlag ++ lib.optional (stdenv.targetPlatform.useLLVM or false) "ac_cv_path_RAWCPP=cpp"; - depsBuildBuild = - [ - buildPackages.stdenv.cc - ] - ++ lib.optionals stdenv.hostPlatform.isStatic [ - (xorg.buildPackages.libc.static or null) - ]; + depsBuildBuild = [ + buildPackages.stdenv.cc + ] + ++ lib.optionals stdenv.hostPlatform.isStatic [ + (xorg.buildPackages.libc.static or null) + ]; preConfigure = '' sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure ''; @@ -1032,24 +1032,23 @@ self: super: prePatch = lib.optionalString stdenv.hostPlatform.isMusl '' export CFLAGS+=" -D__uid_t=uid_t -D__gid_t=gid_t" ''; - configureFlags = - [ - "--enable-kdrive" # not built by default - "--enable-xephyr" - "--enable-xcsecurity" # enable SECURITY extension - "--with-default-font-path=" - # there were only paths containing "${prefix}", - # and there are no fonts in this package anyway - "--with-xkb-bin-directory=${xorg.xkbcomp}/bin" - "--with-xkb-path=${xorg.xkeyboardconfig}/share/X11/xkb" - "--with-xkb-output=$out/share/X11/xkb/compiled" - "--with-log-dir=/var/log" - "--enable-glamor" - "--with-os-name=Nix" # r13y, embeds the build machine's kernel version otherwise - ] - ++ lib.optionals stdenv.hostPlatform.isMusl [ - "--disable-tls" - ]; + configureFlags = [ + "--enable-kdrive" # not built by default + "--enable-xephyr" + "--enable-xcsecurity" # enable SECURITY extension + "--with-default-font-path=" + # there were only paths containing "${prefix}", + # and there are no fonts in this package anyway + "--with-xkb-bin-directory=${xorg.xkbcomp}/bin" + "--with-xkb-path=${xorg.xkeyboardconfig}/share/X11/xkb" + "--with-xkb-output=$out/share/X11/xkb/compiled" + "--with-log-dir=/var/log" + "--enable-glamor" + "--with-os-name=Nix" # r13y, embeds the build machine's kernel version otherwise + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ + "--disable-tls" + ]; env.NIX_CFLAGS_COMPILE = toString [ # Needed with GCC 12 @@ -1114,12 +1113,10 @@ self: super: ./darwin/stub.patch ]; - postPatch = - attrs.postPatch - + '' - substituteInPlace hw/xquartz/mach-startup/stub.c \ - --subst-var-by XQUARTZ_APP "$out/Applications/XQuartz.app" - ''; + postPatch = attrs.postPatch + '' + substituteInPlace hw/xquartz/mach-startup/stub.c \ + --subst-var-by XQUARTZ_APP "$out/Applications/XQuartz.app" + ''; configureFlags = [ # note: --enable-xquartz is auto @@ -1160,24 +1157,23 @@ self: super: # and doesn't support hardware accelerated rendering # so remove it from the rebuild heavy path for mesa xvfb = super.xorgserver.overrideAttrs (old: { - configureFlags = - [ - "--enable-xvfb" - "--disable-xorg" - "--disable-xquartz" - "--disable-xwayland" - "--disable-glamor" - "--disable-glx" - "--disable-dri" - "--disable-dri2" - "--disable-dri3" - "--with-xkb-bin-directory=${xorg.xkbcomp}/bin" - "--with-xkb-path=${xorg.xkeyboardconfig}/share/X11/xkb" - "--with-xkb-output=$out/share/X11/xkb/compiled" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin [ - "--without-dtrace" - ]; + configureFlags = [ + "--enable-xvfb" + "--disable-xorg" + "--disable-xquartz" + "--disable-xwayland" + "--disable-glamor" + "--disable-glx" + "--disable-dri" + "--disable-dri2" + "--disable-dri3" + "--with-xkb-bin-directory=${xorg.xkbcomp}/bin" + "--with-xkb-path=${xorg.xkeyboardconfig}/share/X11/xkb" + "--with-xkb-output=$out/share/X11/xkb/compiled" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin [ + "--without-dtrace" + ]; buildInputs = old.buildInputs ++ [ xorg.pixman @@ -1230,15 +1226,14 @@ self: super: (attrs: { nativeBuildInputs = attrs.nativeBuildInputs ++ lib.optional isDarwin bootstrap_cmds; depsBuildBuild = [ buildPackages.stdenv.cc ]; - configureFlags = - [ - "--with-xserver=${xorg.xorgserver.out}/bin/X" - ] - ++ lib.optionals isDarwin [ - "--with-bundle-id-prefix=org.nixos.xquartz" - "--with-launchdaemons-dir=\${out}/LaunchDaemons" - "--with-launchagents-dir=\${out}/LaunchAgents" - ]; + configureFlags = [ + "--with-xserver=${xorg.xorgserver.out}/bin/X" + ] + ++ lib.optionals isDarwin [ + "--with-bundle-id-prefix=org.nixos.xquartz" + "--with-launchdaemons-dir=\${out}/LaunchDaemons" + "--with-launchagents-dir=\${out}/LaunchAgents" + ]; postPatch = '' # Avoid replacement of word-looking cpp's builtin macros in Nix's cross-compiled paths substituteInPlace Makefile.in --replace "PROGCPPDEFS =" "PROGCPPDEFS = -Dlinux=linux -Dunix=unix" diff --git a/pkgs/servers/x11/xorg/xwayland.nix b/pkgs/servers/x11/xorg/xwayland.nix index 3b255de27691..5b24b53185fa 100644 --- a/pkgs/servers/x11/xorg/xwayland.nix +++ b/pkgs/servers/x11/xorg/xwayland.nix @@ -75,49 +75,48 @@ stdenv.mkDerivation rec { ninja wayland-scanner ]; - buildInputs = - [ - dri-pkgconfig-stub - egl-wayland - libdecor - libgbm - libepoxy - libei - fontutil - libGL - libGLU - libX11 - libXau - libXaw - libXdmcp - libXext - libXfixes - libXfont2 - libXmu - libXpm - libXrender - libXres - libXt - libdrm - libtirpc - libxcb - libxkbfile - libxshmfence - libxcvt - mesa-gl-headers - openssl - pixman - systemd - wayland - wayland-protocols - xkbcomp - xorgproto - xtrans - zlib - ] - ++ lib.optionals withLibunwind [ - libunwind - ]; + buildInputs = [ + dri-pkgconfig-stub + egl-wayland + libdecor + libgbm + libepoxy + libei + fontutil + libGL + libGLU + libX11 + libXau + libXaw + libXdmcp + libXext + libXfixes + libXfont2 + libXmu + libXpm + libXrender + libXres + libXt + libdrm + libtirpc + libxcb + libxkbfile + libxshmfence + libxcvt + mesa-gl-headers + openssl + pixman + systemd + wayland + wayland-protocols + xkbcomp + xorgproto + xtrans + zlib + ] + ++ lib.optionals withLibunwind [ + libunwind + ]; mesonFlags = [ (lib.mesonBool "xcsecurity" true) (lib.mesonOption "default_font_path" defaultFontPath) diff --git a/pkgs/servers/xmpp/prosody/default.nix b/pkgs/servers/xmpp/prosody/default.nix index e88f6184e0ae..997716a8928f 100644 --- a/pkgs/servers/xmpp/prosody/default.nix +++ b/pkgs/servers/xmpp/prosody/default.nix @@ -66,7 +66,8 @@ stdenv.mkDerivation rec { libidn openssl icu - ] ++ withExtraLibs; + ] + ++ withExtraLibs; configureFlags = [ "--ostype=linux" diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix index 12cb7ee42bc7..98b2f3e1400d 100644 --- a/pkgs/shells/bash/5.nix +++ b/pkgs/shells/bash/5.nix @@ -39,12 +39,13 @@ lib.warnIf (withDocs != null) 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"; + 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"; outputs = [ "out" @@ -56,20 +57,19 @@ lib.warnIf (withDocs != null) separateDebugInfo = true; - env.NIX_CFLAGS_COMPILE = - '' - -DSYS_BASHRC="/etc/bashrc" - -DSYS_BASH_LOGOUT="/etc/bash_logout" - '' - + lib.optionalString (!forFHSEnv) '' - -DDEFAULT_PATH_VALUE="/no-such-path" - -DSTANDARD_UTILS_PATH="/no-such-path" - -DDEFAULT_LOADABLE_BUILTINS_PATH="${placeholder "out"}/lib/bash:." - '' - + '' - -DNON_INTERACTIVE_LOGIN_SHELLS - -DSSH_SOURCE_BASHRC - ''; + env.NIX_CFLAGS_COMPILE = '' + -DSYS_BASHRC="/etc/bashrc" + -DSYS_BASH_LOGOUT="/etc/bash_logout" + '' + + lib.optionalString (!forFHSEnv) '' + -DDEFAULT_PATH_VALUE="/no-such-path" + -DSTANDARD_UTILS_PATH="/no-such-path" + -DDEFAULT_LOADABLE_BUILTINS_PATH="${placeholder "out"}/lib/bash:." + '' + + '' + -DNON_INTERACTIVE_LOGIN_SHELLS + -DSSH_SOURCE_BASHRC + ''; patchFlags = [ "-p0" ]; @@ -88,43 +88,42 @@ lib.warnIf (withDocs != null) ./fix-pop-var-context-error.patch ]; - configureFlags = - [ - # At least on Linux bash memory allocator has pathological performance - # in scenarios involving use of larger memory: - # https://lists.gnu.org/archive/html/bug-bash/2023-08/msg00052.html - # Various distributions default to system allocator. Let's nixpkgs - # do the same. - "--without-bash-malloc" - (if interactive then "--with-installed-readline" else "--disable-readline") - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "bash_cv_job_control_missing=nomissing" - "bash_cv_sys_named_pipes=nomissing" - "bash_cv_getcwd_malloc=yes" - # This check cannot be performed when cross compiling. The "yes" - # default is fine for static linking on Linux (weak symbols?) but - # not with BSDs, when it does clash with the regular `getenv`. - "bash_cv_getenv_redef=${ - if !(with stdenv.hostPlatform; isStatic && (isOpenBSD || isFreeBSD)) then "yes" else "no" - }" - ] - ++ lib.optionals stdenv.hostPlatform.isCygwin [ - "--without-libintl-prefix" - "--without-libiconv-prefix" - "--with-installed-readline" - "bash_cv_dev_stdin=present" - "bash_cv_dev_fd=standard" - "bash_cv_termcap_lib=libncurses" - ] - ++ lib.optionals (stdenv.hostPlatform.libc == "musl") [ - "--disable-nls" - ] - ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ - # /dev/fd is optional on FreeBSD. we need it to work when built on a system - # with it and transferred to a system without it! This includes linux cross. - "bash_cv_dev_fd=absent" - ]; + configureFlags = [ + # At least on Linux bash memory allocator has pathological performance + # in scenarios involving use of larger memory: + # https://lists.gnu.org/archive/html/bug-bash/2023-08/msg00052.html + # Various distributions default to system allocator. Let's nixpkgs + # do the same. + "--without-bash-malloc" + (if interactive then "--with-installed-readline" else "--disable-readline") + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "bash_cv_job_control_missing=nomissing" + "bash_cv_sys_named_pipes=nomissing" + "bash_cv_getcwd_malloc=yes" + # This check cannot be performed when cross compiling. The "yes" + # default is fine for static linking on Linux (weak symbols?) but + # not with BSDs, when it does clash with the regular `getenv`. + "bash_cv_getenv_redef=${ + if !(with stdenv.hostPlatform; isStatic && (isOpenBSD || isFreeBSD)) then "yes" else "no" + }" + ] + ++ lib.optionals stdenv.hostPlatform.isCygwin [ + "--without-libintl-prefix" + "--without-libiconv-prefix" + "--with-installed-readline" + "bash_cv_dev_stdin=present" + "bash_cv_dev_fd=standard" + "bash_cv_termcap_lib=libncurses" + ] + ++ lib.optionals (stdenv.hostPlatform.libc == "musl") [ + "--disable-nls" + ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + # /dev/fd is optional on FreeBSD. we need it to work when built on a system + # with it and transferred to a system without it! This includes linux cross. + "bash_cv_dev_fd=absent" + ]; strictDeps = true; # Note: Bison is needed because the patches above modify parse.y. @@ -132,7 +131,8 @@ lib.warnIf (withDocs != null) nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook bison - ] ++ lib.optional stdenv.hostPlatform.isDarwin stdenv.cc.bintools; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin stdenv.cc.bintools; buildInputs = lib.optional interactive readline; diff --git a/pkgs/shells/fish/plugins/build-fish-plugin.nix b/pkgs/shells/fish/plugins/build-fish-plugin.nix index 7f57cf2c6f2e..a3366707f548 100644 --- a/pkgs/shells/fish/plugins/build-fish-plugin.nix +++ b/pkgs/shells/fish/plugins/build-fish-plugin.nix @@ -75,7 +75,8 @@ stdenv.mkDerivation ( pluginPkgs = checkPlugins; functionDirs = checkFunctionDirs; }) - ] ++ nativeCheckInputs; + ] + ++ nativeCheckInputs; checkPhase = '' export HOME=$(mktemp -d) # fish wants a writable home diff --git a/pkgs/shells/fish/plugins/fzf-fish.nix b/pkgs/shells/fish/plugins/fzf-fish.nix index 1bf3f640e309..ed4abfb44125 100644 --- a/pkgs/shells/fish/plugins/fzf-fish.nix +++ b/pkgs/shells/fish/plugins/fzf-fish.nix @@ -36,27 +36,26 @@ buildFishPlugin rec { fishtape_3 ]; checkFunctionDirs = [ "./functions" ]; - checkPhase = - '' - # Disable git tests which inspect the project's git repo, which isn't - # possible since we strip the impure .git from our build input - rm -r tests/*git* - rm -r tests/preview_changed_file/modified_path_with_spaces.fish - rm -r tests/preview_changed_file/renamed_path_modifications.fish + checkPhase = '' + # Disable git tests which inspect the project's git repo, which isn't + # possible since we strip the impure .git from our build input + rm -r tests/*git* + rm -r tests/preview_changed_file/modified_path_with_spaces.fish + rm -r tests/preview_changed_file/renamed_path_modifications.fish - # Disable tests that are failing, probably because of our wrappers - rm -r tests/configure_bindings - rm -r tests/search_variables + # Disable tests that are failing, probably because of our wrappers + rm -r tests/configure_bindings + rm -r tests/search_variables - # Disable tests that are failing, because there is not 'rev' command - rm tests/preview_file/custom_file_preview.fish - '' - + ( - if stdenv.hostPlatform.isDarwin then - ''script /dev/null fish -c "fishtape tests/*/*.fish"'' - else - ''script -c 'fish -c "fishtape tests/*/*.fish"' '' - ); + # Disable tests that are failing, because there is not 'rev' command + rm tests/preview_file/custom_file_preview.fish + '' + + ( + if stdenv.hostPlatform.isDarwin then + ''script /dev/null fish -c "fishtape tests/*/*.fish"'' + else + ''script -c 'fish -c "fishtape tests/*/*.fish"' '' + ); meta = with lib; { description = "Augment your fish command line with fzf key bindings"; diff --git a/pkgs/shells/nushell/default.nix b/pkgs/shells/nushell/default.nix index 3f92cc4224fb..46b698b44bc9 100644 --- a/pkgs/shells/nushell/default.nix +++ b/pkgs/shells/nushell/default.nix @@ -39,19 +39,21 @@ rustPlatform.buildRustPackage { useFetchCargoVendor = true; cargoHash = "sha256-v3BtcEd1eMtHlDLsu0Y4i6CWA47G0CMOyVlMchj7EJo="; - nativeBuildInputs = - [ pkg-config ] - ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ python3 ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ python3 ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ]; - buildInputs = - [ zstd ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ zlib ] - ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ xorg.libX11 ] - ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isDarwin) [ - nghttp2 - libgit2 - ]; + buildInputs = [ + zstd + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ zlib ] + ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ xorg.libX11 ] + ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isDarwin) [ + nghttp2 + libgit2 + ]; buildNoDefaultFeatures = !withDefaultFeatures; buildFeatures = additionalFeatures [ ]; diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix index 7485cf1ce6eb..26a59ffb84d0 100644 --- a/pkgs/stdenv/freebsd/default.nix +++ b/pkgs/stdenv/freebsd/default.nix @@ -455,15 +455,14 @@ let }; }; overrides = overrides prevStage; - preHook = - '' - export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" - export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" - export PATH_LOCALE=${prevStage.freebsd.localesReal or prevStage.freebsd.locales}/share/locale - '' - + lib.optionalString (prevStage.freebsd ? libiconvModules) '' - export PATH_I18NMODULE=${prevStage.freebsd.libiconvModules}/lib/i18n - ''; + preHook = '' + export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" + export PATH_LOCALE=${prevStage.freebsd.localesReal or prevStage.freebsd.locales}/share/locale + '' + + lib.optionalString (prevStage.freebsd ? libiconvModules) '' + export PATH_I18NMODULE=${prevStage.freebsd.libiconvModules}/lib/i18n + ''; }; in { diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index adff97a26914..b1433dac99b6 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -602,7 +602,8 @@ let else findFirst hasOutput null outputs ) - ] ++ optional (hasOutput "man") "man"; + ] + ++ optional (hasOutput "man") "man"; } // (filterAttrs (_: v: v != null) { # CI scripts look at these to determine pings. Note that we should filter nulls out of this, @@ -620,8 +621,7 @@ let # Note that there may be external consumers of this API (repology, for instance) - # if you add a new maintainer or team attribute please ensure that this expectation is still met. maintainers = - attrs.meta.maintainers or [ ] - ++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ]; + attrs.meta.maintainers or [ ] ++ concatMap (team: team.members or [ ]) attrs.meta.teams or [ ]; } // { # Expose the result of the checks for everyone to see. diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 65cda200c874..f453e61510c3 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -623,14 +623,15 @@ let # TODO: remove `unique` once nix has a list canonicalization primitive __sandboxProfile = let - profiles = - [ stdenv.extraSandboxProfile ] - ++ computedSandboxProfile - ++ computedPropagatedSandboxProfile - ++ [ - propagatedSandboxProfile - sandboxProfile - ]; + profiles = [ + stdenv.extraSandboxProfile + ] + ++ computedSandboxProfile + ++ computedPropagatedSandboxProfile + ++ [ + propagatedSandboxProfile + sandboxProfile + ]; final = concatStringsSep "\n" (filter (x: x != "") (unique profiles)); in final; diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 2cccf5afb3bf..6287a3877b41 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -216,11 +216,9 @@ let a: lib.optionalAttrs (prevStage.gcc-unwrapped.passthru.isXgcc or false) { # This affects only `xgcc` (the compiler which compiles the final compiler). - postFixup = - (a.postFixup or "") - + '' - echo "--sysroot=${lib.getDev prevStage.libc}" >> $out/nix-support/cc-cflags - ''; + postFixup = (a.postFixup or "") + '' + echo "--sysroot=${lib.getDev prevStage.libc}" >> $out/nix-support/cc-cflags + ''; } ); @@ -272,17 +270,16 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check strictDeps = true; version = "bootstrapFiles"; enableParallelBuilding = true; - buildCommand = - '' - mkdir -p $out - ln -s ${bootstrapTools}/lib $out/lib - '' - + lib.optionalString (localSystem.libc == "glibc") '' - ln -s ${bootstrapTools}/include-glibc $out/include - '' - + lib.optionalString (localSystem.libc == "musl") '' - ln -s ${bootstrapTools}/include-libc $out/include - ''; + buildCommand = '' + mkdir -p $out + ln -s ${bootstrapTools}/lib $out/lib + '' + + lib.optionalString (localSystem.libc == "glibc") '' + ln -s ${bootstrapTools}/include-glibc $out/include + '' + + lib.optionalString (localSystem.libc == "musl") '' + ln -s ${bootstrapTools}/include-libc $out/include + ''; passthru.isFromBootstrapFiles = true; }; gcc-unwrapped = bootstrapTools; @@ -521,11 +518,9 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check # and use the result as input for our final glibc. We also pass this pair # through, so the final package-set uses exactly the same builds. libunistring = super.libunistring.overrideAttrs (attrs: { - postFixup = - attrs.postFixup or "" - + '' - ${self.nukeReferences}/bin/nuke-refs "$out"/lib/lib*.so.*.* - ''; + postFixup = attrs.postFixup or "" + '' + ${self.nukeReferences}/bin/nuke-refs "$out"/lib/lib*.so.*.* + ''; # 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. @@ -534,12 +529,10 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check }; }); libidn2 = super.libidn2.overrideAttrs (attrs: { - postFixup = - attrs.postFixup or "" - + '' - ${self.nukeReferences}/bin/nuke-refs -e '${lib.getLib self.libunistring}' \ - "$out"/lib/lib*.so.*.* - ''; + postFixup = attrs.postFixup or "" + '' + ${self.nukeReferences}/bin/nuke-refs -e '${lib.getLib self.libunistring}' \ + "$out"/lib/lib*.so.*.* + ''; }); # This also contains the full, dynamically linked, final Glibc. diff --git a/pkgs/stdenv/linux/stdenv-bootstrap-tools.nix b/pkgs/stdenv/linux/stdenv-bootstrap-tools.nix index 5293240a4480..e4f1ae734205 100644 --- a/pkgs/stdenv/linux/stdenv-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/stdenv-bootstrap-tools.nix @@ -44,163 +44,162 @@ stdenv.mkDerivation (finalAttrs: { buildPackages.cpio ]; - buildCommand = - '' - set -x - mkdir -p $out/bin $out/lib $out/libexec + buildCommand = '' + set -x + mkdir -p $out/bin $out/lib $out/libexec - '' - + ( - if (stdenv.hostPlatform.libc == "glibc") then - '' - # Copy what we need of Glibc. - cp -d ${libc.out}/lib/ld*.so* $out/lib - cp -d ${libc.out}/lib/libc*.so* $out/lib - cp -d ${libc.out}/lib/libc_nonshared.a $out/lib - cp -d ${libc.out}/lib/libm*.so* $out/lib - cp -d ${libc.out}/lib/libdl*.so* $out/lib - cp -d ${libc.out}/lib/librt*.so* $out/lib - cp -d ${libc.out}/lib/libpthread*.so* $out/lib - '' - + lib.optionalString withLibnsl '' - cp -d ${libc.out}/lib/libnsl*.so* $out/lib - '' - + '' - cp -d ${libc.out}/lib/libnss*.so* $out/lib - cp -d ${libc.out}/lib/libresolv*.so* $out/lib - # Copy all runtime files to enable non-PIE, PIE, static PIE and profile-generated builds - cp -d ${libc.out}/lib/*.o $out/lib + '' + + ( + if (stdenv.hostPlatform.libc == "glibc") then + '' + # Copy what we need of Glibc. + cp -d ${libc.out}/lib/ld*.so* $out/lib + cp -d ${libc.out}/lib/libc*.so* $out/lib + cp -d ${libc.out}/lib/libc_nonshared.a $out/lib + cp -d ${libc.out}/lib/libm*.so* $out/lib + cp -d ${libc.out}/lib/libdl*.so* $out/lib + cp -d ${libc.out}/lib/librt*.so* $out/lib + cp -d ${libc.out}/lib/libpthread*.so* $out/lib + '' + + lib.optionalString withLibnsl '' + cp -d ${libc.out}/lib/libnsl*.so* $out/lib + '' + + '' + cp -d ${libc.out}/lib/libnss*.so* $out/lib + cp -d ${libc.out}/lib/libresolv*.so* $out/lib + # Copy all runtime files to enable non-PIE, PIE, static PIE and profile-generated builds + cp -d ${libc.out}/lib/*.o $out/lib - # Hacky compat with our current unpack-bootstrap-tools.sh - ln -s librt.so "$out"/lib/librt-dummy.so + # Hacky compat with our current unpack-bootstrap-tools.sh + ln -s librt.so "$out"/lib/librt-dummy.so - cp -rL ${libc.dev}/include $out - chmod -R u+w "$out" + cp -rL ${libc.dev}/include $out + chmod -R u+w "$out" - # libc can contain linker scripts: find them, copy their deps, - # and get rid of absolute paths (nuke-refs would make them useless) - local lScripts=$(grep --files-with-matches --max-count=1 'GNU ld script' -R "$out/lib") - cp -d -t "$out/lib/" $(cat $lScripts | tr " " "\n" | grep -F '${libc.out}' | sort -u) - for f in $lScripts; do - substituteInPlace "$f" --replace '${libc.out}/lib/' "" - done + # libc can contain linker scripts: find them, copy their deps, + # and get rid of absolute paths (nuke-refs would make them useless) + local lScripts=$(grep --files-with-matches --max-count=1 'GNU ld script' -R "$out/lib") + cp -d -t "$out/lib/" $(cat $lScripts | tr " " "\n" | grep -F '${libc.out}' | sort -u) + for f in $lScripts; do + substituteInPlace "$f" --replace '${libc.out}/lib/' "" + done - # Hopefully we won't need these. - rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video - find $out/include -name .install -exec rm {} \; - find $out/include -name ..install.cmd -exec rm {} \; - mv $out/include $out/include-glibc - '' - else if (stdenv.hostPlatform.libc == "musl") then - '' - # Copy what we need from musl - cp ${libc.out}/lib/* $out/lib - cp -rL ${libc.dev}/include $out - chmod -R u+w "$out" + # Hopefully we won't need these. + rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video + find $out/include -name .install -exec rm {} \; + find $out/include -name ..install.cmd -exec rm {} \; + mv $out/include $out/include-glibc + '' + else if (stdenv.hostPlatform.libc == "musl") then + '' + # Copy what we need from musl + cp ${libc.out}/lib/* $out/lib + cp -rL ${libc.dev}/include $out + chmod -R u+w "$out" - rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video - find $out/include -name .install -exec rm {} \; - find $out/include -name ..install.cmd -exec rm {} \; - mv $out/include $out/include-libc - '' - else - throw "unsupported libc for bootstrap tools" - ) - + '' - # Copy coreutils, bash, etc. - cp -d ${coreutilsMinimal.out}/bin/* $out/bin - (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users) + rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video + find $out/include -name .install -exec rm {} \; + find $out/include -name ..install.cmd -exec rm {} \; + mv $out/include $out/include-libc + '' + else + throw "unsupported libc for bootstrap tools" + ) + + '' + # Copy coreutils, bash, etc. + cp -d ${coreutilsMinimal.out}/bin/* $out/bin + (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users) - cp ${bashNonInteractive.out}/bin/bash $out/bin - cp ${findutils.out}/bin/find $out/bin - cp ${findutils.out}/bin/xargs $out/bin - cp -d ${diffutils.out}/bin/* $out/bin - cp -d ${gnused.out}/bin/* $out/bin - cp -d ${gnugrep.out}/bin/grep $out/bin - cp ${gawk.out}/bin/gawk $out/bin - cp -d ${gawk.out}/bin/awk $out/bin - cp ${tarMinimal.out}/bin/tar $out/bin - cp ${gzip.out}/bin/.gzip-wrapped $out/bin/gzip - cp ${bzip2.bin}/bin/bzip2 $out/bin - cp -d ${gnumake.out}/bin/* $out/bin - cp -d ${patch}/bin/* $out/bin - cp ${patchelf}/bin/* $out/bin + cp ${bashNonInteractive.out}/bin/bash $out/bin + cp ${findutils.out}/bin/find $out/bin + cp ${findutils.out}/bin/xargs $out/bin + cp -d ${diffutils.out}/bin/* $out/bin + cp -d ${gnused.out}/bin/* $out/bin + cp -d ${gnugrep.out}/bin/grep $out/bin + cp ${gawk.out}/bin/gawk $out/bin + cp -d ${gawk.out}/bin/awk $out/bin + cp ${tarMinimal.out}/bin/tar $out/bin + cp ${gzip.out}/bin/.gzip-wrapped $out/bin/gzip + cp ${bzip2.bin}/bin/bzip2 $out/bin + cp -d ${gnumake.out}/bin/* $out/bin + cp -d ${patch}/bin/* $out/bin + cp ${patchelf}/bin/* $out/bin - cp -d ${gnugrep.pcre2.out}/lib/libpcre2*.so* $out/lib # needed by grep + cp -d ${gnugrep.pcre2.out}/lib/libpcre2*.so* $out/lib # needed by grep - # Copy what we need of GCC. - cp -d ${bootGCC.out}/bin/gcc $out/bin - cp -d ${bootGCC.out}/bin/cpp $out/bin - cp -d ${bootGCC.out}/bin/g++ $out/bin - cp ${bootGCC.lib}/lib/libgcc_s.so* $out/lib - cp -d ${bootGCC.lib}/lib/libstdc++.so* $out/lib - cp -d ${bootGCC.out}/lib/libssp.a* $out/lib - cp -d ${bootGCC.out}/lib/libssp_nonshared.a $out/lib - cp -rd ${bootGCC.out}/lib/gcc $out/lib - chmod -R u+w $out/lib - rm -f $out/lib/gcc/*/*/include*/linux - rm -f $out/lib/gcc/*/*/include*/sound - rm -rf $out/lib/gcc/*/*/include*/root - rm -f $out/lib/gcc/*/*/include-fixed/asm - rm -rf $out/lib/gcc/*/*/plugin - #rm -f $out/lib/gcc/*/*/*.a - cp -rd ${bootGCC.out}/libexec/* $out/libexec - chmod -R u+w $out/libexec - rm -rf $out/libexec/gcc/*/*/plugin - mkdir -p $out/include - cp -rd ${bootGCC.out}/include/c++ $out/include - chmod -R u+w $out/include - rm -rf $out/include/c++/*/ext/pb_ds - rm -rf $out/include/c++/*/ext/parallel + # Copy what we need of GCC. + cp -d ${bootGCC.out}/bin/gcc $out/bin + cp -d ${bootGCC.out}/bin/cpp $out/bin + cp -d ${bootGCC.out}/bin/g++ $out/bin + cp ${bootGCC.lib}/lib/libgcc_s.so* $out/lib + cp -d ${bootGCC.lib}/lib/libstdc++.so* $out/lib + cp -d ${bootGCC.out}/lib/libssp.a* $out/lib + cp -d ${bootGCC.out}/lib/libssp_nonshared.a $out/lib + cp -rd ${bootGCC.out}/lib/gcc $out/lib + chmod -R u+w $out/lib + rm -f $out/lib/gcc/*/*/include*/linux + rm -f $out/lib/gcc/*/*/include*/sound + rm -rf $out/lib/gcc/*/*/include*/root + rm -f $out/lib/gcc/*/*/include-fixed/asm + rm -rf $out/lib/gcc/*/*/plugin + #rm -f $out/lib/gcc/*/*/*.a + cp -rd ${bootGCC.out}/libexec/* $out/libexec + chmod -R u+w $out/libexec + rm -rf $out/libexec/gcc/*/*/plugin + mkdir -p $out/include + cp -rd ${bootGCC.out}/include/c++ $out/include + chmod -R u+w $out/include + rm -rf $out/include/c++/*/ext/pb_ds + rm -rf $out/include/c++/*/ext/parallel - cp -d ${gmpxx.out}/lib/libgmp*.so* $out/lib - cp -d ${mpfr.out}/lib/libmpfr*.so* $out/lib - cp -d ${libmpc.out}/lib/libmpc*.so* $out/lib - cp -d ${zlib.out}/lib/libz.so* $out/lib + cp -d ${gmpxx.out}/lib/libgmp*.so* $out/lib + cp -d ${mpfr.out}/lib/libmpfr*.so* $out/lib + cp -d ${libmpc.out}/lib/libmpc*.so* $out/lib + cp -d ${zlib.out}/lib/libz.so* $out/lib - '' - + lib.optionalString (stdenv.hostPlatform.isRiscV) '' - # libatomic is required on RiscV platform for C/C++ atomics and pthread - # even though they may be translated into native instructions. - cp -d ${bootGCC.out}/lib/libatomic.a* $out/lib + '' + + lib.optionalString (stdenv.hostPlatform.isRiscV) '' + # libatomic is required on RiscV platform for C/C++ atomics and pthread + # even though they may be translated into native instructions. + cp -d ${bootGCC.out}/lib/libatomic.a* $out/lib - '' - + '' - cp -d ${bzip2.out}/lib/libbz2.so* $out/lib + '' + + '' + cp -d ${bzip2.out}/lib/libbz2.so* $out/lib - # Copy binutils. - for i in as ld ar ranlib nm strip readelf objdump; do - cp ${bootBinutils.out}/bin/$i $out/bin - done - cp -r '${lib.getLib binutils.bintools}'/lib/* "$out/lib/" + # Copy binutils. + for i in as ld ar ranlib nm strip readelf objdump; do + cp ${bootBinutils.out}/bin/$i $out/bin + done + cp -r '${lib.getLib binutils.bintools}'/lib/* "$out/lib/" - chmod -R u+w $out + chmod -R u+w $out - # Strip executables even further. - for i in $out/bin/* $out/libexec/gcc/*/*/*; do - if test -x $i -a ! -L $i; then - chmod +w $i - $STRIP -s $i || true - fi - done + # Strip executables even further. + for i in $out/bin/* $out/libexec/gcc/*/*/*; do + if test -x $i -a ! -L $i; then + chmod +w $i + $STRIP -s $i || true + fi + done - nuke-refs $out/bin/* - nuke-refs $out/lib/* - nuke-refs $out/lib/*/* - nuke-refs $out/libexec/gcc/*/*/* - nuke-refs $out/lib/gcc/*/*/* - nuke-refs $out/lib/gcc/*/*/include-fixed/*{,/*} + nuke-refs $out/bin/* + nuke-refs $out/lib/* + nuke-refs $out/lib/*/* + nuke-refs $out/libexec/gcc/*/*/* + nuke-refs $out/lib/gcc/*/*/* + nuke-refs $out/lib/gcc/*/*/include-fixed/*{,/*} - mkdir $out/.pack - mv $out/* $out/.pack - mv $out/.pack $out/pack + mkdir $out/.pack + mv $out/* $out/.pack + mv $out/.pack $out/pack - mkdir $out/on-server - XZ_OPT="-9 -e" tar cvJf $out/on-server/bootstrap-tools.tar.xz --hard-dereference --sort=name --numeric-owner --owner=0 --group=0 --mtime=@1 -C $out/pack . - cp ${busyboxMinimal}/bin/busybox $out/on-server - chmod u+w $out/on-server/busybox - nuke-refs $out/on-server/busybox - ''; # */ + mkdir $out/on-server + XZ_OPT="-9 -e" tar cvJf $out/on-server/bootstrap-tools.tar.xz --hard-dereference --sort=name --numeric-owner --owner=0 --group=0 --mtime=@1 -C $out/pack . + cp ${busyboxMinimal}/bin/busybox $out/on-server + chmod u+w $out/on-server/busybox + nuke-refs $out/on-server/busybox + ''; # */ # The result should not contain any references (store paths) so # that we can safely copy them out of the store and to other diff --git a/pkgs/stdenv/linux/test-bootstrap-tools.nix b/pkgs/stdenv/linux/test-bootstrap-tools.nix index e199e5159195..ee4e3b0e6c4c 100644 --- a/pkgs/stdenv/linux/test-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/test-bootstrap-tools.nix @@ -18,54 +18,53 @@ builtins.derivation { "eval \"$buildCommand\"" ]; - buildCommand = - '' - export PATH=${bootstrapTools}/bin + buildCommand = '' + export PATH=${bootstrapTools}/bin - ls -l - mkdir $out - mkdir $out/bin - sed --version - find --version - diff --version - patch --version - make --version - awk --version - grep --version - gcc --version + ls -l + mkdir $out + mkdir $out/bin + sed --version + find --version + diff --version + patch --version + make --version + awk --version + grep --version + gcc --version - '' - + lib.optionalString (stdenv.hostPlatform.libc == "glibc") '' - rtld=$(echo ${bootstrapTools}/lib/${builtins.unsafeDiscardStringContext # only basename - (builtins.baseNameOf binutils.dynamicLinker)}) - libc_includes=${bootstrapTools}/include-glibc - '' - + lib.optionalString (stdenv.hostPlatform.libc == "musl") '' - rtld=$(echo ${bootstrapTools}/lib/ld-musl*.so.?) - libc_includes=${bootstrapTools}/include-libc - '' - + '' - # path to version-specific libraries, like libstdc++.so - cxx_libs=$(echo ${bootstrapTools}/lib/gcc/*/*) - export CPP="cpp -idirafter $libc_includes -B${bootstrapTools}" - export CC="gcc -idirafter $libc_includes -B${bootstrapTools} -Wl,-dynamic-linker,$rtld -Wl,-rpath,${bootstrapTools}/lib -Wl,-rpath,$cxx_libs" - export CXX="g++ -idirafter $libc_includes -B${bootstrapTools} -Wl,-dynamic-linker,$rtld -Wl,-rpath,${bootstrapTools}/lib -Wl,-rpath,$cxx_libs" + '' + + lib.optionalString (stdenv.hostPlatform.libc == "glibc") '' + rtld=$(echo ${bootstrapTools}/lib/${builtins.unsafeDiscardStringContext # only basename + (builtins.baseNameOf binutils.dynamicLinker)}) + libc_includes=${bootstrapTools}/include-glibc + '' + + lib.optionalString (stdenv.hostPlatform.libc == "musl") '' + rtld=$(echo ${bootstrapTools}/lib/ld-musl*.so.?) + libc_includes=${bootstrapTools}/include-libc + '' + + '' + # path to version-specific libraries, like libstdc++.so + cxx_libs=$(echo ${bootstrapTools}/lib/gcc/*/*) + export CPP="cpp -idirafter $libc_includes -B${bootstrapTools}" + export CC="gcc -idirafter $libc_includes -B${bootstrapTools} -Wl,-dynamic-linker,$rtld -Wl,-rpath,${bootstrapTools}/lib -Wl,-rpath,$cxx_libs" + export CXX="g++ -idirafter $libc_includes -B${bootstrapTools} -Wl,-dynamic-linker,$rtld -Wl,-rpath,${bootstrapTools}/lib -Wl,-rpath,$cxx_libs" - echo '#include ' >> foo.c - echo '#include ' >> foo.c - echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c - $CC -o $out/bin/foo foo.c - $out/bin/foo + echo '#include ' >> foo.c + echo '#include ' >> foo.c + echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c + $CC -o $out/bin/foo foo.c + $out/bin/foo - echo '#include ' >> bar.cc - echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc - $CXX -v -o $out/bin/bar bar.cc - $out/bin/bar + echo '#include ' >> bar.cc + echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc + $CXX -v -o $out/bin/bar bar.cc + $out/bin/bar - tar xvf ${hello.src} - cd hello-* - ./configure --prefix=$out - make - make install - ''; + tar xvf ${hello.src} + cd hello-* + ./configure --prefix=$out + make + make install + ''; } diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index 66ac2aa7d129..2be03abd9528 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -77,23 +77,22 @@ let export lt_cv_deplibs_check_method=pass_all ''; - extraNativeBuildInputsCygwin = - [ - ../cygwin/all-buildinputs-as-runtimedep.sh - ../cygwin/wrap-exes-to-find-dlls.sh - ] - ++ ( - if system == "i686-cygwin" then - [ - ../cygwin/rebase-i686.sh - ] - else if system == "x86_64-cygwin" then - [ - ../cygwin/rebase-x86_64.sh - ] - else - [ ] - ); + extraNativeBuildInputsCygwin = [ + ../cygwin/all-buildinputs-as-runtimedep.sh + ../cygwin/wrap-exes-to-find-dlls.sh + ] + ++ ( + if system == "i686-cygwin" then + [ + ../cygwin/rebase-i686.sh + ] + else if system == "x86_64-cygwin" then + [ + ../cygwin/rebase-x86_64.sh + ] + else + [ ] + ); # A function that builds a "native" stdenv (one that uses tools in # /usr etc.). diff --git a/pkgs/test/auto-patchelf-hook/package.nix b/pkgs/test/auto-patchelf-hook/package.nix index c67aa2ca375b..7f5919a1ea3e 100644 --- a/pkgs/test/auto-patchelf-hook/package.nix +++ b/pkgs/test/auto-patchelf-hook/package.nix @@ -18,14 +18,13 @@ }: let - runtimeDependencies = - [ - (lib.getLib curl) - "/some/dep" - "/some/other/dep" - ] - # A dependency with space only works with __structuredAttrs set to true. - ++ lib.lists.optional __structuredAttrs "/some/dep with space"; + runtimeDependencies = [ + (lib.getLib curl) + "/some/dep" + "/some/other/dep" + ] + # A dependency with space only works with __structuredAttrs set to true. + ++ lib.lists.optional __structuredAttrs "/some/dep with space"; in stdenv.mkDerivation { diff --git a/pkgs/test/cc-wrapper/hardening.nix b/pkgs/test/cc-wrapper/hardening.nix index 5ae8a0196873..9f2de5243278 100644 --- a/pkgs/test/cc-wrapper/hardening.nix +++ b/pkgs/test/cc-wrapper/hardening.nix @@ -22,7 +22,8 @@ let inherit codePath; preferLocalBuild = true; allowSubstitutes = false; - } // env; + } + // env; } '' [ -n "$postConfigure" ] && eval "$postConfigure" diff --git a/pkgs/test/cross/default.nix b/pkgs/test/cross/default.nix index 8035abbc2902..aeb39b59a2da 100644 --- a/pkgs/test/cross/default.nix +++ b/pkgs/test/cross/default.nix @@ -176,43 +176,42 @@ let # so we can ask @ofborg to check it, yet should have good examples # of things that often break. So, no buckshot `mapTestOnCross` # calls here. - sanity = - [ - mbuffer - #pkgs.pkgsCross.gnu64.bash # https://github.com/NixOS/nixpkgs/issues/243164 - pkgs.gcc_multi.cc - pkgs.pkgsMusl.stdenv - pkgs.pkgsLLVM.stdenv - pkgs.pkgsStatic.bash - #pkgs.pkgsCross.gnu64_simplekernel.bash # https://github.com/NixOS/nixpkgs/issues/264989 - pkgs.pkgsCross.arm-embedded.stdenv - pkgs.pkgsCross.sheevaplug.stdenv # for armv5tel - pkgs.pkgsCross.raspberryPi.stdenv # for armv6l - pkgs.pkgsCross.armv7l-hf-multiplatform.stdenv - pkgs.pkgsCross.m68k.stdenv - pkgs.pkgsCross.aarch64-multiplatform.pkgsBuildTarget.gcc - pkgs.pkgsCross.powernv.pkgsBuildTarget.gcc - pkgs.pkgsCross.s390.stdenv - pkgs.pkgsCross.mips64el-linux-gnuabi64.stdenv - pkgs.pkgsCross.mips64el-linux-gnuabin32.stdenv - pkgs.pkgsCross.mingwW64.stdenv - # Uses the expression that is used by the most cross-compil_ed_ GHCs - pkgs.pkgsCross.riscv64.haskell.compiler.native-bignum.ghc948 + sanity = [ + mbuffer + #pkgs.pkgsCross.gnu64.bash # https://github.com/NixOS/nixpkgs/issues/243164 + pkgs.gcc_multi.cc + pkgs.pkgsMusl.stdenv + pkgs.pkgsLLVM.stdenv + pkgs.pkgsStatic.bash + #pkgs.pkgsCross.gnu64_simplekernel.bash # https://github.com/NixOS/nixpkgs/issues/264989 + pkgs.pkgsCross.arm-embedded.stdenv + pkgs.pkgsCross.sheevaplug.stdenv # for armv5tel + pkgs.pkgsCross.raspberryPi.stdenv # for armv6l + pkgs.pkgsCross.armv7l-hf-multiplatform.stdenv + pkgs.pkgsCross.m68k.stdenv + pkgs.pkgsCross.aarch64-multiplatform.pkgsBuildTarget.gcc + pkgs.pkgsCross.powernv.pkgsBuildTarget.gcc + pkgs.pkgsCross.s390.stdenv + pkgs.pkgsCross.mips64el-linux-gnuabi64.stdenv + pkgs.pkgsCross.mips64el-linux-gnuabin32.stdenv + pkgs.pkgsCross.mingwW64.stdenv + # Uses the expression that is used by the most cross-compil_ed_ GHCs + pkgs.pkgsCross.riscv64.haskell.compiler.native-bignum.ghc948 - ] - ++ lib.optionals (with pkgs.stdenv.buildPlatform; isx86_64 && isLinux) [ - # Musl-to-glibc cross on the same architecture tends to turn up - # lots of interesting corner cases. Only expected to work for - # x86_64-linux buildPlatform. - pkgs.pkgsMusl.pkgsCross.gnu64.hello + ] + ++ lib.optionals (with pkgs.stdenv.buildPlatform; isx86_64 && isLinux) [ + # Musl-to-glibc cross on the same architecture tends to turn up + # lots of interesting corner cases. Only expected to work for + # x86_64-linux buildPlatform. + pkgs.pkgsMusl.pkgsCross.gnu64.hello - # Two web browsers -- exercises almost the entire packageset - pkgs.pkgsCross.aarch64-multiplatform.qutebrowser-qt5 - pkgs.pkgsCross.aarch64-multiplatform.firefox + # Two web browsers -- exercises almost the entire packageset + pkgs.pkgsCross.aarch64-multiplatform.qutebrowser-qt5 + pkgs.pkgsCross.aarch64-multiplatform.firefox - # Uses pkgsCross.riscv64-embedded; see https://github.com/NixOS/nixpkgs/issues/267859 - pkgs.spike - ]; + # Uses pkgsCross.riscv64-embedded; see https://github.com/NixOS/nixpkgs/issues/267859 + pkgs.spike + ]; in { diff --git a/pkgs/test/dotnet/use-dotnet-from-env/default.nix b/pkgs/test/dotnet/use-dotnet-from-env/default.nix index 2acda2173889..97f4b139a673 100644 --- a/pkgs/test/dotnet/use-dotnet-from-env/default.nix +++ b/pkgs/test/dotnet/use-dotnet-from-env/default.nix @@ -21,11 +21,9 @@ let nativeBuildInputs = (oldAttrs.nativeBuildInputs or [ ]) ++ [ removeReferencesTo ]; - postFixup = - (oldAttrs.postFixup or "") - + '' - remove-references-to -t ${dotnet-runtime} "$out/bin/Application" - ''; + postFixup = (oldAttrs.postFixup or "") + '' + remove-references-to -t ${dotnet-runtime} "$out/bin/Application" + ''; }); runtimeVersion = lib.getVersion dotnet-runtime; diff --git a/pkgs/test/haskell/upstreamStackHpackVersion/default.nix b/pkgs/test/haskell/upstreamStackHpackVersion/default.nix index 4e01c213700b..5092bb473049 100644 --- a/pkgs/test/haskell/upstreamStackHpackVersion/default.nix +++ b/pkgs/test/haskell/upstreamStackHpackVersion/default.nix @@ -136,16 +136,15 @@ stdenv.mkDerivation { impureEnvVars = lib.fetchers.proxyImpureEnvVars; - buildCommand = - '' - # Make sure curl can access HTTPS sites, like GitHub. - # - # Note that we absolutely don't want the Nix store path of the cacert - # derivation in the testScript, because we don't want to rebuild this - # derivation when only the cacert derivation changes. - export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt" - '' - + testScript; + buildCommand = '' + # Make sure curl can access HTTPS sites, like GitHub. + # + # Note that we absolutely don't want the Nix store path of the cacert + # derivation in the testScript, because we don't want to rebuild this + # derivation when only the cacert derivation changes. + export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt" + '' + + testScript; meta = with lib; { description = "Test that the stack in Nixpkgs uses the same version of Hpack as the upstream stack release"; diff --git a/pkgs/test/overriding.nix b/pkgs/test/overriding.nix index 29bdbf2fd8fd..67ed3bd90f9a 100644 --- a/pkgs/test/overriding.nix +++ b/pkgs/test/overriding.nix @@ -312,12 +312,11 @@ in stdenvNoCC.mkDerivation { name = "test-overriding"; passthru = { inherit tests; }; - buildCommand = - '' - touch $out - '' - + lib.concatMapAttrsStringSep "\n" ( - name: t: - "([[ ${lib.boolToString t.expr} == ${lib.boolToString t.expected} ]] && echo '${name} success') || (echo '${name} fail' && exit 1)" - ) tests; + buildCommand = '' + touch $out + '' + + lib.concatMapAttrsStringSep "\n" ( + name: t: + "([[ ${lib.boolToString t.expr} == ${lib.boolToString t.expected} ]] && echo '${name} success') || (echo '${name} fail' && exit 1)" + ) tests; } diff --git a/pkgs/test/php/default.nix b/pkgs/test/php/default.nix index cef46d3e3fa6..f2f129925f04 100644 --- a/pkgs/test/php/default.nix +++ b/pkgs/test/php/default.nix @@ -46,11 +46,9 @@ in overrideAttrs-preserves-enabled-extensions = let customPhp = (php.withExtensions ({ all, ... }: [ all.imagick ])).overrideAttrs (attrs: { - postInstall = - attrs.postInstall or "" - + '' - touch "$out/oApee-was-here" - ''; + postInstall = attrs.postInstall or "" + '' + touch "$out/oApee-was-here" + ''; }); in runTest "php-test-overrideAttrs-preserves-enabled-extensions" '' @@ -74,22 +72,18 @@ in ( pkg: pkg.overrideAttrs (attrs: { - postInstall = - attrs.postInstall or "" - + '' - touch "$out/oAs-first" - ''; + postInstall = attrs.postInstall or "" + '' + touch "$out/oAs-first" + ''; }) ) ( pkg: pkg.overrideAttrs (attrs: { - postInstall = - attrs.postInstall or "" - + '' - touch "$out/oAs-second" - ''; + postInstall = attrs.postInstall or "" + '' + touch "$out/oAs-second" + ''; }) ) ]; @@ -108,22 +102,18 @@ in ( pkg: pkg.overrideAttrs (attrs: { - postInstall = - attrs.postInstall or "" - + '' - touch "$out/oAs-first" - ''; + postInstall = attrs.postInstall or "" + '' + touch "$out/oAs-first" + ''; }) ) ( pkg: pkg.overrideAttrs (attrs: { - postInstall = - attrs.postInstall or "" - + '' - touch "$out/oAs-second" - ''; + postInstall = attrs.postInstall or "" + '' + touch "$out/oAs-second" + ''; }) ) ]; diff --git a/pkgs/test/stdenv/default.nix b/pkgs/test/stdenv/default.nix index 5f31e142e03e..45205734dd4c 100644 --- a/pkgs/test/stdenv/default.nix +++ b/pkgs/test/stdenv/default.nix @@ -40,21 +40,19 @@ let { 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) + 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) + 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 - ''; + touch $out + ''; } // extraAttrs ) diff --git a/pkgs/test/stdenv/no-broken-symlinks.nix b/pkgs/test/stdenv/no-broken-symlinks.nix index af23373c5630..8e09baccd479 100644 --- a/pkgs/test/stdenv/no-broken-symlinks.nix +++ b/pkgs/test/stdenv/no-broken-symlinks.nix @@ -52,12 +52,11 @@ let dontPatch = true; dontConfigure = true; dontBuild = true; - installPhase = - '' - mkdir -p "$out" + installPhase = '' + mkdir -p "$out" - '' - + concatStringsSep "\n" commands; + '' + + concatStringsSep "\n" commands; } // derivationArgs ); diff --git a/pkgs/test/texlive/default.nix b/pkgs/test/texlive/default.nix index 73861bb3fadf..9791f4c29969 100644 --- a/pkgs/test/texlive/default.nix +++ b/pkgs/test/texlive/default.nix @@ -443,7 +443,8 @@ rec { # 'Error initialising QuantumRenderer: no suitable pipeline found' "tlcockpit" - ] ++ lib.optional stdenv.hostPlatform.isDarwin "epspdftk"; # wish shebang is a script, not a binary! + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "epspdftk"; # wish shebang is a script, not a binary! # (1) binaries requiring -v shortVersion = [ diff --git a/pkgs/tools/X11/virtualgl/default.nix b/pkgs/tools/X11/virtualgl/default.nix index de7f6d21fbf7..15de52551f3e 100644 --- a/pkgs/tools/X11/virtualgl/default.nix +++ b/pkgs/tools/X11/virtualgl/default.nix @@ -15,29 +15,28 @@ stdenv.mkDerivation { paths = [ virtualglLib ]; nativeBuildInputs = [ makeWrapper ]; - buildCommand = - '' - mkdir -p $out/bin - for i in ${virtualglLib}/bin/* ${virtualglLib}/bin/.vglrun*; do - ln -s "$i" $out/bin - done + buildCommand = '' + mkdir -p $out/bin + for i in ${virtualglLib}/bin/* ${virtualglLib}/bin/.vglrun*; do + ln -s "$i" $out/bin + done - wrapProgram $out/bin/vglrun \ - --prefix LD_LIBRARY_PATH : "${ - lib.makeLibraryPath [ - virtualglLib - virtualglLib_i686 + wrapProgram $out/bin/vglrun \ + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath [ + virtualglLib + virtualglLib_i686 - addDriverRunpath.driverLink + addDriverRunpath.driverLink - # Needed for vulkaninfo to work - vulkan-loader - ] - }" - '' - + lib.optionalString (virtualglLib_i686 != null) '' - ln -sf ${virtualglLib_i686}/bin/.vglrun.vars32 $out/bin - ''; + # Needed for vulkaninfo to work + vulkan-loader + ] + }" + '' + + lib.optionalString (virtualglLib_i686 != null) '' + ln -sf ${virtualglLib_i686}/bin/.vglrun.vars32 $out/bin + ''; meta = { platforms = lib.platforms.linux; diff --git a/pkgs/tools/admin/google-cloud-sdk/components.nix b/pkgs/tools/admin/google-cloud-sdk/components.nix index eed21e73c364..690afb80e5df 100644 --- a/pkgs/tools/admin/google-cloud-sdk/components.nix +++ b/pkgs/tools/admin/google-cloud-sdk/components.nix @@ -169,14 +169,13 @@ let # Write the snapshot file to the `.install` folder cp $snapshotPath $out/google-cloud-sdk/.install/${pname}.snapshot.json ''; - nativeBuildInputs = - [ - python3 - stdenv.cc.cc - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - ]; + nativeBuildInputs = [ + python3 + stdenv.cc.cc + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ]; buildInputs = [ libxcrypt-legacy ]; diff --git a/pkgs/tools/admin/google-cloud-sdk/withExtraComponents.nix b/pkgs/tools/admin/google-cloud-sdk/withExtraComponents.nix index 29cdc6334f89..2e704194f69a 100644 --- a/pkgs/tools/admin/google-cloud-sdk/withExtraComponents.nix +++ b/pkgs/tools/admin/google-cloud-sdk/withExtraComponents.nix @@ -38,7 +38,8 @@ let comps = [ google-cloud-sdk - ] ++ filterPreInstalled (findDepsRecursive (defaultComponents ++ comps_)); + ] + ++ filterPreInstalled (findDepsRecursive (defaultComponents ++ comps_)); installCheck = let @@ -74,7 +75,8 @@ symlinkJoin { paths = [ google-cloud-sdk - ] ++ comps; + ] + ++ comps; postBuild = '' sed -i ';' $out/google-cloud-sdk/bin/.gcloud-wrapped diff --git a/pkgs/tools/admin/ibmcloud-cli/default.nix b/pkgs/tools/admin/ibmcloud-cli/default.nix index 4cb22081bdb9..ee2f80607d8e 100644 --- a/pkgs/tools/admin/ibmcloud-cli/default.nix +++ b/pkgs/tools/admin/ibmcloud-cli/default.nix @@ -76,7 +76,8 @@ stdenv.mkDerivation (finalAttrs: { "i686-linux" "powerpc64le-linux" "s390x-linux" - ] ++ lib.platforms.darwin; + ] + ++ lib.platforms.darwin; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; mainProgram = "ibmcloud"; }; diff --git a/pkgs/tools/admin/pulumi-bin/default.nix b/pkgs/tools/admin/pulumi-bin/default.nix index a67f2d7071df..d36e3afaa1d7 100644 --- a/pkgs/tools/admin/pulumi-bin/default.nix +++ b/pkgs/tools/admin/pulumi-bin/default.nix @@ -20,26 +20,26 @@ stdenv.mkDerivation { srcs = map fetchurl data.pulumiPkgs.${stdenv.hostPlatform.system}; - installPhase = - '' - install -D -t $out/bin/ * - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${lib.getLib stdenv.cc.cc}/lib" - '' - + '' - installShellCompletion --cmd pulumi \ - --bash <($out/bin/pulumi completion bash) \ - --fish <($out/bin/pulumi completion fish) \ - --zsh <($out/bin/pulumi completion zsh) - ''; + installPhase = '' + install -D -t $out/bin/ * + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${lib.getLib stdenv.cc.cc}/lib" + '' + + '' + installShellCompletion --cmd pulumi \ + --bash <($out/bin/pulumi completion bash) \ + --fish <($out/bin/pulumi completion fish) \ + --zsh <($out/bin/pulumi completion zsh) + ''; - nativeBuildInputs = - [ installShellFiles ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - autoPatchelfHook - makeWrapper - ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + makeWrapper + ]; buildInputs = [ stdenv.cc.cc.libgcc or null ]; meta = with lib; { diff --git a/pkgs/tools/admin/turbovnc/default.nix b/pkgs/tools/admin/turbovnc/default.nix index 16107caa1e0a..0444488eb1b6 100644 --- a/pkgs/tools/admin/turbovnc/default.nix +++ b/pkgs/tools/admin/turbovnc/default.nix @@ -64,34 +64,33 @@ stdenv.mkDerivation (finalAttrs: { python3 ]; - buildInputs = - [ - bzip2 - dri-pkgconfig-stub - freetype - libGL # for -DTVNC_SYSTEMX11=1 - libgbm - libjpeg_turbo - openssl - pam - perl - ] - ++ (with xorg; [ - libfontenc # for -DTVNC_SYSTEMX11=1 - libSM - libX11 - libXdamage # for -DTVNC_SYSTEMX11=1 - libXdmcp # for -DTVNC_SYSTEMX11=1 - libXext - libXfont2 # for -DTVNC_SYSTEMX11=1 - libxkbfile # for -DTVNC_SYSTEMX11=1 - libxshmfence - libXi - mesa-gl-headers # for -DTVNC_SYSTEMX11=1 - pixman # for -DTVNC_SYSTEMX11=1 - xorgproto - xtrans # for -DTVNC_SYSTEMX11=1 - ]); + buildInputs = [ + bzip2 + dri-pkgconfig-stub + freetype + libGL # for -DTVNC_SYSTEMX11=1 + libgbm + libjpeg_turbo + openssl + pam + perl + ] + ++ (with xorg; [ + libfontenc # for -DTVNC_SYSTEMX11=1 + libSM + libX11 + libXdamage # for -DTVNC_SYSTEMX11=1 + libXdmcp # for -DTVNC_SYSTEMX11=1 + libXext + libXfont2 # for -DTVNC_SYSTEMX11=1 + libxkbfile # for -DTVNC_SYSTEMX11=1 + libxshmfence + libXi + mesa-gl-headers # for -DTVNC_SYSTEMX11=1 + pixman # for -DTVNC_SYSTEMX11=1 + xorgproto + xtrans # for -DTVNC_SYSTEMX11=1 + ]); postPatch = '' substituteInPlace unix/Xvnc/CMakeLists.txt --replace 'string(REGEX REPLACE "X11" "Xfont2" X11_Xfont2_LIB' 'set(X11_Xfont2_LIB ${xorg.libXfont2}/lib/libXfont2.so) #' diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index 4dc99c56b0a0..0c7578b441df 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -30,30 +30,28 @@ stdenv.mkDerivation (finalAttrs: { }; # Default makefile is full of impurities on Darwin. The patch doesn't hurt Linux so I'm leaving it unconditional - postPatch = - '' - sed -i '/CC=\/usr/d' makefile.macosx_llvm_64bits - # Avoid writing timestamps into compressed manpages - # to maintain determinism. - substituteInPlace install.sh --replace 'gzip' 'gzip -n' - chmod +x install.sh + postPatch = '' + sed -i '/CC=\/usr/d' makefile.macosx_llvm_64bits + # Avoid writing timestamps into compressed manpages + # to maintain determinism. + substituteInPlace install.sh --replace 'gzip' 'gzip -n' + chmod +x install.sh - # I think this is a typo and should be CXX? Either way let's kill it - sed -i '/XX=\/usr/d' makefile.macosx_llvm_64bits - '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - substituteInPlace makefile.machine \ - --replace 'CC=gcc' 'CC=${stdenv.cc.targetPrefix}gcc' \ - --replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++' - ''; + # I think this is a typo and should be CXX? Either way let's kill it + sed -i '/XX=\/usr/d' makefile.macosx_llvm_64bits + '' + + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + substituteInPlace makefile.machine \ + --replace 'CC=gcc' 'CC=${stdenv.cc.targetPrefix}gcc' \ + --replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++' + ''; - preConfigure = - '' - buildFlags=all3 - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - cp makefile.macosx_llvm_64bits makefile.machine - ''; + preConfigure = '' + buildFlags=all3 + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + cp makefile.macosx_llvm_64bits makefile.machine + ''; enableParallelBuilding = true; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing"; diff --git a/pkgs/tools/archivers/rar/default.nix b/pkgs/tools/archivers/rar/default.nix index dedd67f20cd3..45794631b5b9 100644 --- a/pkgs/tools/archivers/rar/default.nix +++ b/pkgs/tools/archivers/rar/default.nix @@ -48,7 +48,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ]; installPhase = '' runHook preInstall diff --git a/pkgs/tools/archivers/unar/default.nix b/pkgs/tools/archivers/unar/default.nix index 640849617f89..3bbd3f8e5509 100644 --- a/pkgs/tools/archivers/unar/default.nix +++ b/pkgs/tools/archivers/unar/default.nix @@ -33,31 +33,30 @@ stdenv.mkDerivation rec { }) ]; - postPatch = - '' - substituteInPlace unar.m lsar.m \ - --replace-fail "v1.10.7" "v${version}" - '' - + ( - if stdenv.hostPlatform.isDarwin then - '' - substituteInPlace "./XADMaster.xcodeproj/project.pbxproj" \ - --replace "libstdc++.6.dylib" "libc++.1.dylib" - '' - else - '' - for f in Makefile.linux ../UniversalDetector/Makefile.linux ; do - substituteInPlace $f \ - --replace "= gcc" "=${stdenv.cc.targetPrefix}cc" \ - --replace "= g++" "=${stdenv.cc.targetPrefix}c++" \ - --replace "-DGNU_RUNTIME=1" "" \ - --replace "-fgnu-runtime" "-fobjc-runtime=gnustep-2.0" - done + postPatch = '' + substituteInPlace unar.m lsar.m \ + --replace-fail "v1.10.7" "v${version}" + '' + + ( + if stdenv.hostPlatform.isDarwin then + '' + substituteInPlace "./XADMaster.xcodeproj/project.pbxproj" \ + --replace "libstdc++.6.dylib" "libc++.1.dylib" + '' + else + '' + for f in Makefile.linux ../UniversalDetector/Makefile.linux ; do + substituteInPlace $f \ + --replace "= gcc" "=${stdenv.cc.targetPrefix}cc" \ + --replace "= g++" "=${stdenv.cc.targetPrefix}c++" \ + --replace "-DGNU_RUNTIME=1" "" \ + --replace "-fgnu-runtime" "-fobjc-runtime=gnustep-2.0" + done - # we need to build inside this directory as well, so we have to make it writeable - chmod +w ../UniversalDetector -R - '' - ); + # we need to build inside this directory as well, so we have to make it writeable + chmod +w ../UniversalDetector -R + '' + ); buildInputs = [ bzip2 @@ -65,11 +64,13 @@ stdenv.mkDerivation rec { openssl wavpack zlib - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ gnustep-base ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ gnustep-base ]; nativeBuildInputs = [ installShellFiles - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuildHook ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuildHook ]; xcbuildFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "-target unar" diff --git a/pkgs/tools/archivers/zpaq/default.nix b/pkgs/tools/archivers/zpaq/default.nix index af927a4a45de..776003a2591a 100644 --- a/pkgs/tools/archivers/zpaq/default.nix +++ b/pkgs/tools/archivers/zpaq/default.nix @@ -22,7 +22,8 @@ stdenv.mkDerivation rec { CPPFLAGS = [ "-Dunix" - ] ++ lib.optional (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) "-DNOJIT"; + ] + ++ lib.optional (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) "-DNOJIT"; CXXFLAGS = [ "-O3" "-DNDEBUG" diff --git a/pkgs/tools/audio/beets/common.nix b/pkgs/tools/audio/beets/common.nix index d342770abe2a..f9fbb70667fa 100644 --- a/pkgs/tools/audio/beets/common.nix +++ b/pkgs/tools/audio/beets/common.nix @@ -82,7 +82,8 @@ python3Packages.buildPythonApplication { pyproject = true; patches = [ - ] ++ extraPatches; + ] + ++ extraPatches; build-system = [ python3Packages.poetry-core @@ -109,16 +110,16 @@ python3Packages.buildPythonApplication { gobject-introspection sphinxHook python3Packages.pydata-sphinx-theme - ] ++ extraNativeBuildInputs; + ] + ++ extraNativeBuildInputs; - buildInputs = - [ - ] - ++ (with gst_all_1; [ - gst-plugins-base - gst-plugins-good - gst-plugins-ugly - ]); + buildInputs = [ + ] + ++ (with gst_all_1; [ + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + ]); outputs = [ "out" diff --git a/pkgs/tools/audio/beets/plugins/filetote.nix b/pkgs/tools/audio/beets/plugins/filetote.nix index 98aad485e7d9..c9a296b4bb22 100644 --- a/pkgs/tools/audio/beets/plugins/filetote.nix +++ b/pkgs/tools/audio/beets/plugins/filetote.nix @@ -70,7 +70,8 @@ python3Packages.buildPythonApplication rec { nativeCheckInputs = [ python3Packages.pytestCheckHook writableTmpDirAsHomeHook - ] ++ optional-dependencies.test; + ] + ++ optional-dependencies.test; meta = with lib; { description = "Beets plugin to move non-music files during the import process"; diff --git a/pkgs/tools/backup/percona-xtrabackup/generic.nix b/pkgs/tools/backup/percona-xtrabackup/generic.nix index 949f3773aee5..1460b5fa3387 100644 --- a/pkgs/tools/backup/percona-xtrabackup/generic.nix +++ b/pkgs/tools/backup/percona-xtrabackup/generic.nix @@ -52,31 +52,30 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - buildInputs = - [ - (curl.override { inherit openssl; }) - cyrus_sasl - libaio - libedit - libevent - libev - libgcrypt - libgpg-error - lz4 - ncurses - numactl - openssl - procps - protobuf - valgrind - xxd - zlib - ] - ++ (with perlPackages; [ - perl - DBI - DBDmysql - ]); + buildInputs = [ + (curl.override { inherit openssl; }) + cyrus_sasl + libaio + libedit + libevent + libev + libgcrypt + libgpg-error + lz4 + ncurses + numactl + openssl + procps + protobuf + valgrind + xxd + zlib + ] + ++ (with perlPackages; [ + perl + DBI + DBDmysql + ]); patches = extraPatches; @@ -97,12 +96,11 @@ stdenv.mkDerivation (finalAttrs: { "-DWITH_MAN_PAGES=OFF" ]; - postInstall = - '' - wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB - rm -r "$out"/lib/plugin/debug - '' - + extraPostInstall; + postInstall = '' + wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB + rm -r "$out"/lib/plugin/debug + '' + + extraPostInstall; passthru.mysqlVersion = lib.versions.majorMinor finalAttrs.version; diff --git a/pkgs/tools/compression/bzip3/default.nix b/pkgs/tools/compression/bzip3/default.nix index de47bfbf4461..9447ee19fb5b 100644 --- a/pkgs/tools/compression/bzip3/default.nix +++ b/pkgs/tools/compression/bzip3/default.nix @@ -39,7 +39,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--disable-arch-native" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-link-time-optimization" ]; + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-link-time-optimization" ]; passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index 866ce808d4f3..2f3ce88b99e3 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -48,18 +48,17 @@ stdenv.mkDerivation rec { # executables being in $PATH. Rather than try to re-write all the # internal cross-references, just add $out/bin to PATH at the top of # all the executables that are shell scripts. - preFixup = - '' - sed -i '1{;/#!\/bin\/sh/aPATH="'$out'/bin:$PATH" - }' $out/bin/* - '' - # run gzip with "-n" when $GZIP_NO_TIMESTAMPS (set by stdenv's setup.sh) is set to stop gzip from adding timestamps - # to archive headers: https://github.com/NixOS/nixpkgs/issues/86348 - # if changing so that there's no longer a .gzip-wrapped then update copy in make-bootstrap-tools.nix - + '' - wrapProgram $out/bin/gzip \ - --add-flags "\''${GZIP_NO_TIMESTAMPS:+-n}" - ''; + preFixup = '' + sed -i '1{;/#!\/bin\/sh/aPATH="'$out'/bin:$PATH" + }' $out/bin/* + '' + # run gzip with "-n" when $GZIP_NO_TIMESTAMPS (set by stdenv's setup.sh) is set to stop gzip from adding timestamps + # to archive headers: https://github.com/NixOS/nixpkgs/issues/86348 + # if changing so that there's no longer a .gzip-wrapped then update copy in make-bootstrap-tools.nix + + '' + wrapProgram $out/bin/gzip \ + --add-flags "\''${GZIP_NO_TIMESTAMPS:+-n}" + ''; meta = { homepage = "https://www.gnu.org/software/gzip/"; diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix index 373e196d40ae..98c0dcfb6713 100644 --- a/pkgs/tools/compression/zstd/default.nix +++ b/pkgs/tools/compression/zstd/default.nix @@ -92,32 +92,30 @@ stdenv.mkDerivation rec { runHook postCheck ''; - preInstall = - '' - mkdir -p $bin/bin - substituteInPlace ../programs/zstdgrep \ - --replace ":-grep" ":-${gnugrep}/bin/grep" \ - --replace ":-zstdcat" ":-$bin/bin/zstdcat" + preInstall = '' + mkdir -p $bin/bin + substituteInPlace ../programs/zstdgrep \ + --replace ":-grep" ":-${gnugrep}/bin/grep" \ + --replace ":-zstdcat" ":-$bin/bin/zstdcat" - substituteInPlace ../programs/zstdless \ - --replace "zstdcat" "$bin/bin/zstdcat" + substituteInPlace ../programs/zstdless \ + --replace "zstdcat" "$bin/bin/zstdcat" + '' + + lib.optionalString buildContrib ( '' - + lib.optionalString buildContrib ( - '' - cp contrib/pzstd/pzstd $bin/bin/pzstd - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - install_name_tool -change @rpath/libzstd.1.dylib $out/lib/libzstd.1.dylib $bin/bin/pzstd - '' - ); + cp contrib/pzstd/pzstd $bin/bin/pzstd + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + install_name_tool -change @rpath/libzstd.1.dylib $out/lib/libzstd.1.dylib $bin/bin/pzstd + '' + ); - outputs = - [ - "bin" - "dev" - ] - ++ lib.optional stdenv.hostPlatform.isUnix "man" - ++ [ "out" ]; + outputs = [ + "bin" + "dev" + ] + ++ lib.optional stdenv.hostPlatform.isUnix "man" + ++ [ "out" ]; passthru = { updateScript = nix-update-script { }; diff --git a/pkgs/tools/filesystems/ceph/arrow-cpp-19.nix b/pkgs/tools/filesystems/ceph/arrow-cpp-19.nix index 1750d98bb0ff..d39d01245588 100644 --- a/pkgs/tools/filesystems/ceph/arrow-cpp-19.nix +++ b/pkgs/tools/filesystems/ceph/arrow-cpp-19.nix @@ -139,45 +139,45 @@ stdenv.mkDerivation (finalAttrs: { ninja autoconf # for vendored jemalloc flatbuffers - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - buildInputs = - [ - boost - brotli - bzip2 - flatbuffers - gflags - glog - gtest - libbacktrace - lz4 - nlohmann_json # alternative JSON parser to rapidjson - protobuf # substrait requires protobuf - rapidjson - re2 - snappy - thrift - utf8proc - zlib - zstd - ] - ++ lib.optionals enableFlight [ - grpc - openssl - protobuf - sqlite - ] - ++ lib.optionals enableS3 [ - aws-sdk-cpp-arrow - openssl - ] - ++ lib.optionals enableGcs [ - crc32c - curl - google-cloud-cpp - grpc - nlohmann_json - ]; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + buildInputs = [ + boost + brotli + bzip2 + flatbuffers + gflags + glog + gtest + libbacktrace + lz4 + nlohmann_json # alternative JSON parser to rapidjson + protobuf # substrait requires protobuf + rapidjson + re2 + snappy + thrift + utf8proc + zlib + zstd + ] + ++ lib.optionals enableFlight [ + grpc + openssl + protobuf + sqlite + ] + ++ lib.optionals enableS3 [ + aws-sdk-cpp-arrow + openssl + ] + ++ lib.optionals enableGcs [ + crc32c + curl + google-cloud-cpp + grpc + nlohmann_json + ]; preConfigure = '' patchShebangs build-support/ @@ -185,57 +185,56 @@ stdenv.mkDerivation (finalAttrs: { --replace-fail 'discover_tz_dir();' '"${tzdata}/share/zoneinfo";' ''; - cmakeFlags = - [ - "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON" - "-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}" - "-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}" - "-DARROW_BUILD_TESTS=${if enableShared then "ON" else "OFF"}" - "-DARROW_BUILD_INTEGRATION=ON" - "-DARROW_BUILD_UTILITIES=ON" - "-DARROW_EXTRA_ERROR_CONTEXT=ON" - "-DARROW_VERBOSE_THIRDPARTY_BUILD=ON" - "-DARROW_DEPENDENCY_SOURCE=SYSTEM" - "-Dxsimd_SOURCE=AUTO" - "-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}" - "-DARROW_COMPUTE=ON" - "-DARROW_CSV=ON" - "-DARROW_DATASET=ON" - "-DARROW_FILESYSTEM=ON" - "-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}" - "-DARROW_HDFS=ON" - "-DARROW_IPC=ON" - "-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}" - "-DARROW_JSON=ON" - "-DARROW_USE_GLOG=ON" - "-DARROW_WITH_BACKTRACE=ON" - "-DARROW_WITH_BROTLI=ON" - "-DARROW_WITH_BZ2=ON" - "-DARROW_WITH_LZ4=ON" - "-DARROW_WITH_NLOHMANN_JSON=ON" - "-DARROW_WITH_SNAPPY=ON" - "-DARROW_WITH_UTF8PROC=ON" - "-DARROW_WITH_ZLIB=ON" - "-DARROW_WITH_ZSTD=ON" - "-DARROW_MIMALLOC=ON" - "-DARROW_SUBSTRAIT=ON" - "-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}" - "-DARROW_FLIGHT_TESTING=${if enableFlight then "ON" else "OFF"}" - "-DARROW_S3=${if enableS3 then "ON" else "OFF"}" - "-DARROW_GCS=${if enableGcs then "ON" else "OFF"}" - # Parquet options: - "-DARROW_PARQUET=ON" - "-DPARQUET_BUILD_EXECUTABLES=ON" - "-DPARQUET_REQUIRE_ENCRYPTION=ON" - ] - ++ lib.optionals (!enableShared) [ "-DARROW_TEST_LINKAGE=static" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables - ] - ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "-DARROW_USE_SIMD=OFF" ] - ++ lib.optionals enableS3 [ - "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp-arrow}/include/aws/core/Aws.h" - ]; + cmakeFlags = [ + "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON" + "-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}" + "-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}" + "-DARROW_BUILD_TESTS=${if enableShared then "ON" else "OFF"}" + "-DARROW_BUILD_INTEGRATION=ON" + "-DARROW_BUILD_UTILITIES=ON" + "-DARROW_EXTRA_ERROR_CONTEXT=ON" + "-DARROW_VERBOSE_THIRDPARTY_BUILD=ON" + "-DARROW_DEPENDENCY_SOURCE=SYSTEM" + "-Dxsimd_SOURCE=AUTO" + "-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}" + "-DARROW_COMPUTE=ON" + "-DARROW_CSV=ON" + "-DARROW_DATASET=ON" + "-DARROW_FILESYSTEM=ON" + "-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}" + "-DARROW_HDFS=ON" + "-DARROW_IPC=ON" + "-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}" + "-DARROW_JSON=ON" + "-DARROW_USE_GLOG=ON" + "-DARROW_WITH_BACKTRACE=ON" + "-DARROW_WITH_BROTLI=ON" + "-DARROW_WITH_BZ2=ON" + "-DARROW_WITH_LZ4=ON" + "-DARROW_WITH_NLOHMANN_JSON=ON" + "-DARROW_WITH_SNAPPY=ON" + "-DARROW_WITH_UTF8PROC=ON" + "-DARROW_WITH_ZLIB=ON" + "-DARROW_WITH_ZSTD=ON" + "-DARROW_MIMALLOC=ON" + "-DARROW_SUBSTRAIT=ON" + "-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}" + "-DARROW_FLIGHT_TESTING=${if enableFlight then "ON" else "OFF"}" + "-DARROW_S3=${if enableS3 then "ON" else "OFF"}" + "-DARROW_GCS=${if enableGcs then "ON" else "OFF"}" + # Parquet options: + "-DARROW_PARQUET=ON" + "-DPARQUET_BUILD_EXECUTABLES=ON" + "-DPARQUET_REQUIRE_ENCRYPTION=ON" + ] + ++ lib.optionals (!enableShared) [ "-DARROW_TEST_LINKAGE=static" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables + ] + ++ lib.optionals (!stdenv.hostPlatform.isx86_64) [ "-DARROW_USE_SIMD=OFF" ] + ++ lib.optionals enableS3 [ + "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp-arrow}/include/aws/core/Aws.h" + ]; doInstallCheck = true; ARROW_TEST_DATA = lib.optionalString finalAttrs.doInstallCheck "${arrow-testing}/data"; @@ -270,14 +269,13 @@ stdenv.mkDerivation (finalAttrs: { __darwinAllowLocalNetworking = true; - nativeInstallCheckInputs = - [ - perl - which - sqlite - ] - ++ lib.optionals enableS3 [ minio ] - ++ lib.optionals enableFlight [ python3 ]; + nativeInstallCheckInputs = [ + perl + which + sqlite + ] + ++ lib.optionals enableS3 [ minio ] + ++ lib.optionals enableFlight [ python3 ]; installCheckPhase = let diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix index 69a1b4be2ec7..6fbfbde63fc0 100644 --- a/pkgs/tools/filesystems/ceph/default.nix +++ b/pkgs/tools/filesystems/ceph/default.nix @@ -559,7 +559,8 @@ rec { "-DWITH_MGR_DASHBOARD_FRONTEND:BOOL=OFF" # WITH_XFS has been set default ON from Ceph 16, keeping it optional in nixpkgs for now ''-DWITH_XFS=${if optLibxfs != null then "ON" else "OFF"}'' - ] ++ lib.optional stdenv.hostPlatform.isLinux "-DWITH_SYSTEM_LIBURING=ON"; + ] + ++ lib.optional stdenv.hostPlatform.isLinux "-DWITH_SYSTEM_LIBURING=ON"; preBuild = # The legacy-option-headers target is not correctly empbedded in the build graph. diff --git a/pkgs/tools/filesystems/ceph/old-python-packages/cryptography.nix b/pkgs/tools/filesystems/ceph/old-python-packages/cryptography.nix index 92b69827d4e3..b90be3497dbb 100644 --- a/pkgs/tools/filesystems/ceph/old-python-packages/cryptography.nix +++ b/pkgs/tools/filesystems/ceph/old-python-packages/cryptography.nix @@ -80,14 +80,16 @@ buildPythonPackage rec { cargo rustc pkg-config - ] ++ lib.optionals (!isPyPy) [ cffi ]; + ] + ++ lib.optionals (!isPyPy) [ cffi ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ lib.optionals (pythonOlder "3.9") [ libxcrypt ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.optionals (pythonOlder "3.9") [ libxcrypt ]; propagatedBuildInputs = lib.optionals (!isPyPy) [ cffi ]; @@ -104,16 +106,15 @@ buildPythonPackage rec { pytestFlags = [ "--disable-pytest-warnings" ]; - disabledTestPaths = - [ - # save compute time by not running benchmarks - "tests/bench" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ - # aarch64-darwin forbids W+X memory, but this tests depends on it: - # * https://cffi.readthedocs.io/en/latest/using.html#callbacks - "tests/hazmat/backends/test_openssl_memleak.py" - ]; + disabledTestPaths = [ + # save compute time by not running benchmarks + "tests/bench" + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # aarch64-darwin forbids W+X memory, but this tests depends on it: + # * https://cffi.readthedocs.io/en/latest/using.html#callbacks + "tests/hazmat/backends/test_openssl_memleak.py" + ]; meta = with lib; { description = "A package which provides cryptographic recipes and primitives"; diff --git a/pkgs/tools/filesystems/garage/default.nix b/pkgs/tools/filesystems/garage/default.nix index f1f218e31b13..c193d62738b1 100644 --- a/pkgs/tools/filesystems/garage/default.nix +++ b/pkgs/tools/filesystems/garage/default.nix @@ -57,35 +57,33 @@ let # See https://git.deuxfleurs.fr/Deuxfleurs/garage/src/tag/v0.8.2/nix/compile.nix#L192-L198 # on version changes for checking if changes are required here - buildFeatures = - [ - "kubernetes-discovery" - "bundled-libs" - ] - ++ lib.optional (lib.versionOlder version "1.0") "sled" - ++ [ - "metrics" - "k2v" - "telemetry-otlp" - "lmdb" - "sqlite" - "consul-discovery" - ]; + buildFeatures = [ + "kubernetes-discovery" + "bundled-libs" + ] + ++ lib.optional (lib.versionOlder version "1.0") "sled" + ++ [ + "metrics" + "k2v" + "telemetry-otlp" + "lmdb" + "sqlite" + "consul-discovery" + ]; # To make integration tests pass, we include the optional k2v feature here, # but in buildFeatures only for version 0.8+, where it's enabled by default. # See: https://garagehq.deuxfleurs.fr/documentation/reference-manual/k2v/ - checkFeatures = - [ - "k2v" - "kubernetes-discovery" - "bundled-libs" - ] - ++ lib.optional (lib.versionOlder version "1.0") "sled" - ++ [ - "lmdb" - "sqlite" - ]; + checkFeatures = [ + "k2v" + "kubernetes-discovery" + "bundled-libs" + ] + ++ lib.optional (lib.versionOlder version "1.0") "sled" + ++ [ + "lmdb" + "sqlite" + ]; disabledTests = [ # Upstream told us this test is flakey. diff --git a/pkgs/tools/filesystems/irods/default.nix b/pkgs/tools/filesystems/irods/default.nix index e5e6f29e7eb4..dd730d523280 100644 --- a/pkgs/tools/filesystems/irods/default.nix +++ b/pkgs/tools/filesystems/irods/default.nix @@ -112,18 +112,16 @@ rec { "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${placeholder "out"}/lib" ]; - postPatch = - common.postPatch - + '' - patchShebangs ./test - substituteInPlace plugins/database/CMakeLists.txt --replace-fail "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp" - for file in unit_tests/cmake/test_config/*.cmake - do - substituteInPlace $file --replace-quiet "CATCH2}/include" "CATCH2}/include/catch2" - done + postPatch = common.postPatch + '' + patchShebangs ./test + substituteInPlace plugins/database/CMakeLists.txt --replace-fail "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp" + for file in unit_tests/cmake/test_config/*.cmake + do + substituteInPlace $file --replace-quiet "CATCH2}/include" "CATCH2}/include/catch2" + done - substituteInPlace server/auth/CMakeLists.txt --replace-fail SETUID "" - ''; + substituteInPlace server/auth/CMakeLists.txt --replace-fail SETUID "" + ''; meta = common.meta // { longDescription = common.meta.longDescription + "This package provides the servers and libraries."; @@ -149,11 +147,9 @@ rec { buildInputs = common.buildInputs ++ [ irods ]; - postPatch = - common.postPatch - + '' - patchShebangs ./bin - ''; + postPatch = common.postPatch + '' + patchShebangs ./bin + ''; cmakeFlags = common.cmakeFlags ++ [ "-DCMAKE_INSTALL_PREFIX=${stdenv.out}" diff --git a/pkgs/tools/games/alice-tools/default.nix b/pkgs/tools/games/alice-tools/default.nix index 7964aa77c38a..68a380b0e1b6 100644 --- a/pkgs/tools/games/alice-tools/default.nix +++ b/pkgs/tools/games/alice-tools/default.nix @@ -47,47 +47,44 @@ stdenv.mkDerivation (finalAttrs: { "-Dcpp_std=c++17" ]; - nativeBuildInputs = - [ - meson - ninja - pkg-config - bison - flex - ] - ++ lib.optionals withGUI [ - wrapQtAppsHook - ]; + nativeBuildInputs = [ + meson + ninja + pkg-config + bison + flex + ] + ++ lib.optionals withGUI [ + wrapQtAppsHook + ]; - buildInputs = - [ - libiconv - libpng - libjpeg - libwebp - zlib - ] - ++ lib.optionals withGUI [ - qtbase - ]; + buildInputs = [ + libiconv + libpng + libjpeg + libwebp + zlib + ] + ++ lib.optionals withGUI [ + qtbase + ]; dontWrapQtApps = true; # Default install step only installs a static library of a build dependency - installPhase = - '' - runHook preInstall + installPhase = '' + runHook preInstall - install -Dm755 src/alice $out/bin/alice - '' - + lib.optionalString withGUI '' - install -Dm755 src/galice $out/bin/galice - wrapQtApp $out/bin/galice - '' - + '' + install -Dm755 src/alice $out/bin/alice + '' + + lib.optionalString withGUI '' + install -Dm755 src/galice $out/bin/galice + wrapQtApp $out/bin/galice + '' + + '' - runHook postInstall - ''; + runHook postInstall + ''; passthru = { updateScript = gitUpdater { }; diff --git a/pkgs/tools/games/pokefinder/default.nix b/pkgs/tools/games/pokefinder/default.nix index 874dc499debc..19f0dd56d803 100644 --- a/pkgs/tools/games/pokefinder/default.nix +++ b/pkgs/tools/games/pokefinder/default.nix @@ -35,33 +35,31 @@ stdenv.mkDerivation rec { patchShebangs Source/Core/Resources/ ''; - installPhase = - '' - runHook preInstall - '' - + lib.optionalString (stdenv.hostPlatform.isDarwin) '' - mkdir -p $out/Applications - cp -R Source/PokeFinder.app $out/Applications - '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - install -D Source/PokeFinder $out/bin/PokeFinder - mkdir -p $out/share/pixmaps - convert "$src/Source/Form/Images/pokefinder.ico[-1]" $out/share/pixmaps/pokefinder.png - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + lib.optionalString (stdenv.hostPlatform.isDarwin) '' + mkdir -p $out/Applications + cp -R Source/PokeFinder.app $out/Applications + '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + install -D Source/PokeFinder $out/bin/PokeFinder + mkdir -p $out/share/pixmaps + convert "$src/Source/Form/Images/pokefinder.ico[-1]" $out/share/pixmaps/pokefinder.png + '' + + '' + runHook postInstall + ''; - nativeBuildInputs = - [ - cmake - wrapQtAppsHook - python3 - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - copyDesktopItems - imagemagick - ]; + nativeBuildInputs = [ + cmake + wrapQtAppsHook + python3 + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + copyDesktopItems + imagemagick + ]; desktopItems = [ (makeDesktopItem { @@ -77,7 +75,8 @@ stdenv.mkDerivation rec { buildInputs = [ qtbase qttools - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ]; passthru.updateScript = gitUpdater { rev-prefix = "v"; diff --git a/pkgs/tools/graphics/asymptote/default.nix b/pkgs/tools/graphics/asymptote/default.nix index 150b919b4e23..c40eef77c647 100644 --- a/pkgs/tools/graphics/asymptote/default.nix +++ b/pkgs/tools/graphics/asymptote/default.nix @@ -55,39 +55,38 @@ stdenv.mkDerivation (finalAttrs: { texContainer = null; texdocContainer = null; - nativeBuildInputs = - [ - autoreconfHook - bison - flex - bison - texinfo - wrapQtAppsHook - cmake - ghostscriptX - perl - pkg-config - (python3.withPackages ( - ps: with ps; [ - click - cson - numpy - pyqt5 - ] - )) - ] - ++ lib.optional (finalAttrs.texContainer == null || finalAttrs.texdocContainer == null) ( - texliveSmall.withPackages ( - ps: with ps; [ - epsf - cm-super - ps.texinfo - media9 - ocgx2 - collection-latexextra - ] - ) - ); + nativeBuildInputs = [ + autoreconfHook + bison + flex + bison + texinfo + wrapQtAppsHook + cmake + ghostscriptX + perl + pkg-config + (python3.withPackages ( + ps: with ps; [ + click + cson + numpy + pyqt5 + ] + )) + ] + ++ lib.optional (finalAttrs.texContainer == null || finalAttrs.texdocContainer == null) ( + texliveSmall.withPackages ( + ps: with ps; [ + epsf + cm-super + ps.texinfo + media9 + ocgx2 + collection-latexextra + ] + ) + ); buildInputs = [ ghostscriptX @@ -114,18 +113,18 @@ stdenv.mkDerivation (finalAttrs: { pyqt5 ] )) - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ]; - propagatedBuildInputs = - [ - glm - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libglut - libGLU - libGL - libglvnd - ]; + propagatedBuildInputs = [ + glm + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libglut + libGLU + libGL + libglvnd + ]; dontWrapQtApps = true; diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index 4bb9f57c0905..368991fa39e2 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -51,45 +51,44 @@ in makeWrapper pkg-config texinfo - ] ++ lib.optional withQt qttools; + ] + ++ lib.optional withQt qttools; - buildInputs = - [ - cairo - gd - libcerf - pango - readline - zlib - ] - ++ lib.optional withTeXLive texliveSmall - ++ lib.optional withLua lua - ++ lib.optional withCaca libcaca - ++ lib.optionals withX [ - libX11 - libXpm - libXt - libXaw - ] - ++ lib.optionals withQt [ - qtbase - qtsvg - ] - ++ lib.optional withWxGTK wxGTK32; + buildInputs = [ + cairo + gd + libcerf + pango + readline + zlib + ] + ++ lib.optional withTeXLive texliveSmall + ++ lib.optional withLua lua + ++ lib.optional withCaca libcaca + ++ lib.optionals withX [ + libX11 + libXpm + libXt + libXaw + ] + ++ lib.optionals withQt [ + qtbase + qtsvg + ] + ++ lib.optional withWxGTK wxGTK32; postPatch = '' # lrelease is in qttools, not in qtbase. sed -i configure -e 's|''${QT5LOC}/lrelease|lrelease|' ''; - configureFlags = - [ - (if withX then "--with-x" else "--without-x") - (if withQt then "--with-qt=qt5" else "--without-qt") - (if aquaterm then "--with-aquaterm" else "--without-aquaterm") - ] - ++ lib.optional withCaca "--with-caca" - ++ lib.optional withTeXLive "--with-texdir=${placeholder "out"}/share/texmf/tex/latex/gnuplot"; + configureFlags = [ + (if withX then "--with-x" else "--without-x") + (if withQt then "--with-qt=qt5" else "--without-qt") + (if aquaterm then "--with-aquaterm" else "--without-aquaterm") + ] + ++ lib.optional withCaca "--with-caca" + ++ lib.optional withTeXLive "--with-texdir=${placeholder "out"}/share/texmf/tex/latex/gnuplot"; CXXFLAGS = lib.optionalString (stdenv.hostPlatform.isDarwin && withQt) "-std=c++11"; diff --git a/pkgs/tools/graphics/graphviz/default.nix b/pkgs/tools/graphics/graphviz/default.nix index b73f00771c51..03fc9497cb95 100644 --- a/pkgs/tools/graphics/graphviz/default.nix +++ b/pkgs/tools/graphics/graphviz/default.nix @@ -59,14 +59,16 @@ stdenv.mkDerivation rec { gts pango bash - ] ++ optionals withXorg (with xorg; [ libXrender ]); + ] + ++ optionals withXorg (with xorg; [ libXrender ]); hardeningDisable = [ "fortify" ]; configureFlags = [ "--with-ltdl-lib=${libtool.lib}/lib" "--with-ltdl-include=${libtool}/include" - ] ++ optional (xorg == null) "--without-x"; + ] + ++ optional (xorg == null) "--without-x"; enableParallelBuilding = true; diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index b565ce52b92c..992afd60d3cb 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -188,21 +188,20 @@ stdenv.mkDerivation (finalAttrs: { unzip ]; - buildInputs = - [ - dbus - nlohmann_json - spdlog - ] - ++ lib.optional waylandSupport wayland - ++ lib.optional x11Support libX11 - ++ lib.optional nvidiaSupport libXNVCtrl - ++ lib.optional (x11Support || waylandSupport) libxkbcommon - ++ lib.optionals mangoappSupport [ - glew - glfw - libXrandr - ]; + buildInputs = [ + dbus + nlohmann_json + spdlog + ] + ++ lib.optional waylandSupport wayland + ++ lib.optional x11Support libX11 + ++ lib.optional nvidiaSupport libXNVCtrl + ++ lib.optional (x11Support || waylandSupport) libxkbcommon + ++ lib.optionals mangoappSupport [ + glew + glfw + libXrandr + ]; doCheck = true; diff --git a/pkgs/tools/graphics/nifskope/default.nix b/pkgs/tools/graphics/nifskope/default.nix index c34ac5bdf935..5d74c450fd5b 100644 --- a/pkgs/tools/graphics/nifskope/default.nix +++ b/pkgs/tools/graphics/nifskope/default.nix @@ -35,7 +35,8 @@ stdenv.mkDerivation { url = "https://github.com/niftools/nifskope/commit/30954e7f01f3d779a2a1fd37d363e8a6ad560bd3.patch"; sha256 = "0d6xjj2mjjhdd7w1aig5f75jksjni16jyj0lxsz51pys6xqb6fpj"; }) - ] ++ (lib.optional stdenv.hostPlatform.isAarch64 ./no-sse-on-arm.patch); + ] + ++ (lib.optional stdenv.hostPlatform.isAarch64 ./no-sse-on-arm.patch); buildInputs = [ qtbase diff --git a/pkgs/tools/graphics/pfstools/default.nix b/pkgs/tools/graphics/pfstools/default.nix index 43b9bdb9f8e7..4e4d7440792c 100644 --- a/pkgs/tools/graphics/pfstools/default.nix +++ b/pkgs/tools/graphics/pfstools/default.nix @@ -54,25 +54,24 @@ mkDerivation rec { cmake pkg-config ]; - buildInputs = - [ - openexr - zlib - imagemagick6 - fftwFloat - fftw - gsl - libexif - perl - qtbase - netpbm - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - libGLU - libGL - libglut - ] - ++ lib.optional enableUnfree (opencv.override { enableUnfree = true; }); + buildInputs = [ + openexr + zlib + imagemagick6 + fftwFloat + fftw + gsl + libexif + perl + qtbase + netpbm + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libGLU + libGL + libglut + ] + ++ lib.optional enableUnfree (opencv.override { enableUnfree = true; }); patches = [ ./glut.patch diff --git a/pkgs/tools/graphics/vulkan-caps-viewer/default.nix b/pkgs/tools/graphics/vulkan-caps-viewer/default.nix index 9118744a1474..c55b7275388a 100644 --- a/pkgs/tools/graphics/vulkan-caps-viewer/default.nix +++ b/pkgs/tools/graphics/vulkan-caps-viewer/default.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { buildInputs = [ vulkan-loader wayland - ] ++ lib.lists.optionals x11Support [ qtx11extras ]; + ] + ++ lib.lists.optionals x11Support [ qtx11extras ]; patchPhase = '' substituteInPlace vulkanCapsViewer.pro \ diff --git a/pkgs/tools/graphics/zbar/default.nix b/pkgs/tools/graphics/zbar/default.nix index a20738a53ee0..08cf27e3f0a0 100644 --- a/pkgs/tools/graphics/zbar/default.nix +++ b/pkgs/tools/graphics/zbar/default.nix @@ -63,39 +63,37 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = - [ - pkg-config - xmlto - autoreconfHook - docbook_xsl - ] - ++ lib.optionals enableVideo [ - wrapGAppsHook3 - wrapQtAppsHook - qtbase - ]; + nativeBuildInputs = [ + pkg-config + xmlto + autoreconfHook + docbook_xsl + ] + ++ lib.optionals enableVideo [ + wrapGAppsHook3 + wrapQtAppsHook + qtbase + ]; - buildInputs = - [ - imagemagickBig - libintl - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ] - ++ lib.optionals enableDbus [ - dbus - ] - ++ lib.optionals withXorg [ - libX11 - ] - ++ lib.optionals enableVideo [ - libv4l - gtk3 - qtbase - qtx11extras - ]; + buildInputs = [ + imagemagickBig + libintl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ] + ++ lib.optionals enableDbus [ + dbus + ] + ++ lib.optionals withXorg [ + libX11 + ] + ++ lib.optionals enableVideo [ + libv4l + gtk3 + qtbase + qtx11extras + ]; nativeCheckInputs = [ bash @@ -121,32 +119,31 @@ stdenv.mkDerivation rec { # Disable assertions which include -dev QtBase file paths. env.NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG"; - configureFlags = - [ - "--without-python" - ] - ++ ( - if enableDbus then - [ - "--with-dbusconfdir=${placeholder "out"}/share" - ] - else - [ - "--without-dbus" - ] - ) - ++ ( - if enableVideo then - [ - "--with-gtk=gtk3" - ] - else - [ - "--disable-video" - "--without-gtk" - "--without-qt" - ] - ); + configureFlags = [ + "--without-python" + ] + ++ ( + if enableDbus then + [ + "--with-dbusconfdir=${placeholder "out"}/share" + ] + else + [ + "--without-dbus" + ] + ) + ++ ( + if enableVideo then + [ + "--with-gtk=gtk3" + ] + else + [ + "--disable-video" + "--without-gtk" + "--without-qt" + ] + ); doCheck = true; diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix index 4203126e72e5..0229b679a69d 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix @@ -64,7 +64,8 @@ stdenv.mkDerivation rec { opencc qtwebengine fmt - ] ++ lib.optional luaSupport fcitx5-lua; + ] + ++ lib.optional luaSupport fcitx5-lua; cmakeFlags = [ (lib.cmakeBool "USE_QT6" (lib.versions.major qtbase.version == "6")) diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix index 4e4dce0c97f2..7c424bad855f 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-configtool.nix @@ -52,38 +52,37 @@ stdenv.mkDerivation rec { wrapQtAppsHook ]; - buildInputs = + buildInputs = [ + fcitx5 + fcitx5-qt + qtbase + qtsvg + qtwayland + kitemviews + kwidgetsaddons + isocodes + xkeyboardconfig + libxkbfile + ] + ++ lib.optionals (lib.versions.major qtbase.version == "5") [ + qtx11extras + ] + ++ lib.optionals kcmSupport ( [ - fcitx5 - fcitx5-qt - qtbase - qtsvg - qtwayland - kitemviews - kwidgetsaddons - isocodes - xkeyboardconfig - libxkbfile + qtdeclarative + kcoreaddons + kdeclarative ] ++ lib.optionals (lib.versions.major qtbase.version == "5") [ - qtx11extras + qtquickcontrols2 + plasma-framework + kirigami2 ] - ++ lib.optionals kcmSupport ( - [ - qtdeclarative - kcoreaddons - kdeclarative - ] - ++ lib.optionals (lib.versions.major qtbase.version == "5") [ - qtquickcontrols2 - plasma-framework - kirigami2 - ] - ++ lib.optionals (lib.versions.major qtbase.version == "6") [ - libplasma - kirigami - ] - ); + ++ lib.optionals (lib.versions.major qtbase.version == "6") [ + libplasma + kirigami + ] + ); meta = with lib; { description = "Configuration Tool for Fcitx5"; diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix index a4fdb999588b..b27ecea3c3fd 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-gtk.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DGOBJECT_INTROSPECTION_GIRDIR=share/gir-1.0" "-DGOBJECT_INTROSPECTION_TYPELIBDIR=lib/girepository-1.0" - ] ++ lib.optional (!withGTK2) "-DENABLE_GTK2_IM_MODULE=off"; + ] + ++ lib.optional (!withGTK2) "-DENABLE_GTK2_IM_MODULE=off"; buildInputs = [ glib @@ -65,7 +66,8 @@ stdenv.mkDerivation rec { dbus at-spi2-core libXtst - ] ++ lib.optional withGTK2 gtk2; + ] + ++ lib.optional withGTK2 gtk2; nativeBuildInputs = [ cmake diff --git a/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix b/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix index 0978efc04c07..66ba434f4090 100644 --- a/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix +++ b/pkgs/tools/inputmethods/fcitx5/fcitx5-skk.nix @@ -32,15 +32,14 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - fcitx5 - libskk - ] - ++ lib.optionals enableQt [ - fcitx5-qt - qtbase - ]; + buildInputs = [ + fcitx5 + libskk + ] + ++ lib.optionals enableQt [ + fcitx5-qt + qtbase + ]; cmakeFlags = [ (lib.cmakeBool "ENABLE_QT" enableQt) diff --git a/pkgs/tools/inputmethods/fcitx5/with-addons.nix b/pkgs/tools/inputmethods/fcitx5/with-addons.nix index f6480fe19141..b8063ec9e452 100644 --- a/pkgs/tools/inputmethods/fcitx5/with-addons.nix +++ b/pkgs/tools/inputmethods/fcitx5/with-addons.nix @@ -14,17 +14,16 @@ symlinkJoin { name = "fcitx5-with-addons-${fcitx5.version}"; - paths = - [ - fcitx5 - libsForQt5.fcitx5-qt - qt6Packages.fcitx5-qt - fcitx5-gtk - ] - ++ lib.optionals withConfigtool [ - fcitx5-configtool - ] - ++ addons; + paths = [ + fcitx5 + libsForQt5.fcitx5-qt + qt6Packages.fcitx5-qt + fcitx5-gtk + ] + ++ lib.optionals withConfigtool [ + fcitx5-configtool + ] + ++ addons; nativeBuildInputs = [ makeBinaryWrapper ]; diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-cangjie/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-cangjie/default.nix index 0fca600cb627..571f9f8b901d 100644 --- a/pkgs/tools/inputmethods/ibus-engines/ibus-cangjie/default.nix +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-cangjie/default.nix @@ -43,7 +43,8 @@ stdenv.mkDerivation { gtk3 ibus python3 - ] ++ pythonModules; + ] + ++ pythonModules; nativeBuildInputs = [ autoreconfHook diff --git a/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix index 7f9e29b7e915..e38289e360b1 100644 --- a/pkgs/tools/inputmethods/ibus/default.nix +++ b/pkgs/tools/inputmethods/ibus/default.nix @@ -90,14 +90,13 @@ stdenv.mkDerivation (finalAttrs: { ./build-without-dbus-launch.patch ]; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals (!libOnly) [ - "installedTests" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals (!libOnly) [ + "installedTests" + ]; postPatch = '' # Maintainer does not want to create separate tarballs for final release candidate and release versions, @@ -114,36 +113,35 @@ stdenv.mkDerivation (finalAttrs: { preAutoreconf = "touch ChangeLog"; - configureFlags = - [ - # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries, - # so we set `{CC,CXX}_FOR_BUILD` to override that behavior. - # https://github.com/NixOS/nixpkgs/issues/21751 - "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" - "CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++" - "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources" - "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen" - "--disable-memconf" - "--disable-gtk2" - "--with-python=${python3BuildEnv.interpreter}" - (lib.enableFeature (!libOnly && dconf != null) "dconf") - (lib.enableFeature (!libOnly && libnotify != null) "libnotify") - (lib.enableFeature withWayland "wayland") - (lib.enableFeature enableUI "ui") - (lib.enableFeature (!libOnly) "gtk3") - (lib.enableFeature (!libOnly) "gtk4") - (lib.enableFeature (!libOnly) "xim") - (lib.enableFeature (!libOnly) "appindicator") - (lib.enableFeature (!libOnly) "tests") - (lib.enableFeature (!libOnly) "install-tests") - (lib.enableFeature (!libOnly) "emoji-dict") - (lib.enableFeature (!libOnly) "unicode-dict") - ] - ++ lib.optionals (!libOnly) [ - "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" - "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations" - "--with-ucd-dir=${unicode-character-database}/share/unicode" - ]; + configureFlags = [ + # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries, + # so we set `{CC,CXX}_FOR_BUILD` to override that behavior. + # https://github.com/NixOS/nixpkgs/issues/21751 + "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" + "CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++" + "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources" + "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen" + "--disable-memconf" + "--disable-gtk2" + "--with-python=${python3BuildEnv.interpreter}" + (lib.enableFeature (!libOnly && dconf != null) "dconf") + (lib.enableFeature (!libOnly && libnotify != null) "libnotify") + (lib.enableFeature withWayland "wayland") + (lib.enableFeature enableUI "ui") + (lib.enableFeature (!libOnly) "gtk3") + (lib.enableFeature (!libOnly) "gtk4") + (lib.enableFeature (!libOnly) "xim") + (lib.enableFeature (!libOnly) "appindicator") + (lib.enableFeature (!libOnly) "tests") + (lib.enableFeature (!libOnly) "install-tests") + (lib.enableFeature (!libOnly) "emoji-dict") + (lib.enableFeature (!libOnly) "unicode-dict") + ] + ++ lib.optionals (!libOnly) [ + "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" + "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations" + "--with-ucd-dir=${unicode-character-database}/share/unicode" + ]; makeFlags = lib.optionals (!libOnly) [ "test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus" @@ -154,53 +152,51 @@ stdenv.mkDerivation (finalAttrs: { pkg-config ]; - nativeBuildInputs = - [ - autoreconfHook - gtk-doc - gettext - makeWrapper - pkg-config - python3BuildEnv - dbus-launch - glib # required to satisfy AM_PATH_GLIB_2_0 - vala - gobject-introspection - ] - ++ lib.optionals (!libOnly) [ - wrapGAppsHook3 - ] - ++ lib.optionals withWayland [ - wayland-scanner - ]; + nativeBuildInputs = [ + autoreconfHook + gtk-doc + gettext + makeWrapper + pkg-config + python3BuildEnv + dbus-launch + glib # required to satisfy AM_PATH_GLIB_2_0 + vala + gobject-introspection + ] + ++ lib.optionals (!libOnly) [ + wrapGAppsHook3 + ] + ++ lib.optionals withWayland [ + wayland-scanner + ]; propagatedBuildInputs = [ glib ]; - buildInputs = - [ - dbus - systemd - dconf - python3.pkgs.pygobject3 # for pygobject overrides - isocodes - json-glib - libX11 - vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN) - ] - ++ lib.optionals (!libOnly) [ - gtk3 - gtk4 - gdk-pixbuf - libdbusmenu-gtk3 - libnotify - ] - ++ lib.optionals withWayland [ - libxkbcommon - wayland - wayland-protocols - ]; + buildInputs = [ + dbus + systemd + dconf + python3.pkgs.pygobject3 # for pygobject overrides + isocodes + json-glib + libX11 + vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN) + ] + ++ lib.optionals (!libOnly) [ + gtk3 + gtk4 + gdk-pixbuf + libdbusmenu-gtk3 + libnotify + ] + ++ lib.optionals withWayland [ + libxkbcommon + wayland + wayland-protocols + ]; enableParallelBuilding = true; strictDeps = true; diff --git a/pkgs/tools/inputmethods/input-remapper/default.nix b/pkgs/tools/inputmethods/input-remapper/default.nix index d27feb6ba541..49a41fd31d8f 100644 --- a/pkgs/tools/inputmethods/input-remapper/default.nix +++ b/pkgs/tools/inputmethods/input-remapper/default.nix @@ -48,17 +48,16 @@ in hash = "sha256-GMKcs2UK1yegGT/TBsLGgTBJROQ38M6WwnLbJIuAZwg="; }; - postPatch = - '' - # fix FHS paths - substituteInPlace inputremapper/configs/data.py \ - --replace-fail "/usr/share" "$out/usr/share" - '' - + lib.optionalString withDebugLogLevel '' - # if debugging - substituteInPlace inputremapper/logger.py \ - --replace-fail "logger.setLevel(logging.INFO)" "logger.setLevel(logging.DEBUG)" - ''; + postPatch = '' + # fix FHS paths + substituteInPlace inputremapper/configs/data.py \ + --replace-fail "/usr/share" "$out/usr/share" + '' + + lib.optionalString withDebugLogLevel '' + # if debugging + substituteInPlace inputremapper/logger.py \ + --replace-fail "logger.setLevel(logging.INFO)" "logger.setLevel(logging.DEBUG)" + ''; nativeBuildInputs = [ wrapGAppsHook3 @@ -68,7 +67,8 @@ in gobject-introspection pygobject3 udevCheckHook - ] ++ maybeXmodmap; + ] + ++ maybeXmodmap; dependencies = [ setuptools # needs pkg_resources @@ -177,11 +177,9 @@ in # this ensures the rev matches the input src's rev after overriding # See https://discourse.nixos.org/t/avoid-rec-expresions-in-nixpkgs/8293/7 for more # discussion - postPatch = - prev.postPatch or "" - + '' - # set revision for --version output - echo "COMMIT_HASH = '${final.src.rev}'" > inputremapper/commit_hash.py - ''; + postPatch = prev.postPatch or "" + '' + # set revision for --version output + echo "COMMIT_HASH = '${final.src.rev}'" > inputremapper/commit_hash.py + ''; } ) diff --git a/pkgs/tools/inputmethods/skk/skk-dicts/default.nix b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix index 83981b27fc3a..c1c03db8cf25 100644 --- a/pkgs/tools/inputmethods/skk/skk-dicts/default.nix +++ b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix @@ -35,31 +35,29 @@ let strictDeps = true; - buildPhase = - '' - runHook preBuild - '' - + lib.concatMapStrings (file: '' - nkf -w ${file} \ - | LC_ALL=C sed 's/coding: [^ ]\{1,\}/coding: utf-8/' \ - > ${file + suffix} - '') (lib.optionals useUtf8 (map lib.escapeShellArg files)) - + '' - runHook postBuild - ''; + buildPhase = '' + runHook preBuild + '' + + lib.concatMapStrings (file: '' + nkf -w ${file} \ + | LC_ALL=C sed 's/coding: [^ ]\{1,\}/coding: utf-8/' \ + > ${file + suffix} + '') (lib.optionals useUtf8 (map lib.escapeShellArg files)) + + '' + runHook postBuild + ''; - installPhase = - '' - runHook preInstall - '' - + lib.concatMapStrings (file: '' - install -Dm644 \ - ${lib.escapeShellArg file} \ - $out/share/skk/${lib.escapeShellArg (baseNameOf file)} - '') (map (file: file + suffix) files) - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + '' + + lib.concatMapStrings (file: '' + install -Dm644 \ + ${lib.escapeShellArg file} \ + $out/share/skk/${lib.escapeShellArg (baseNameOf file)} + '') (map (file: file + suffix) files) + + '' + runHook postInstall + ''; doInstallCheck = true; installCheckPhase = '' diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix index 611e906448c2..03209bb6df75 100644 --- a/pkgs/tools/inputmethods/uim/default.nix +++ b/pkgs/tools/inputmethods/uim/default.nix @@ -66,44 +66,42 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-7Ng9IPF6xN1Zb9uEacq7SUhpJc1jWzneVSbbjyqL6g4="; }; - nativeBuildInputs = - [ - autoconf - automake - intltool - libtool - pkg-config - cmake + nativeBuildInputs = [ + autoconf + automake + intltool + libtool + pkg-config + cmake - ruby # used by sigscheme build to generate function tables - librsvg # used by uim build to generate png pixmaps from svg - ] - ++ lib.optionals withQt5 [ - qt5.wrapQtAppsHook - ]; + ruby # used by sigscheme build to generate function tables + librsvg # used by uim build to generate png pixmaps from svg + ] + ++ lib.optionals withQt5 [ + qt5.wrapQtAppsHook + ]; - buildInputs = - [ - ncurses - m17n_lib - m17n_db - expat - ] - ++ lib.optional withAnthy anthy - ++ lib.optional withGtk2 gtk2 - ++ lib.optional withGtk3 gtk3 - ++ lib.optionals withQt5 [ - qt5.qtbase - qt5.qtx11extras - ] - ++ lib.optional withLibnotify libnotify - ++ lib.optional withSqlite sqlite - ++ lib.optionals withNetworking [ - curl - openssl - ] - ++ lib.optional withFFI libffi - ++ lib.optional withMisc libeb; + buildInputs = [ + ncurses + m17n_lib + m17n_db + expat + ] + ++ lib.optional withAnthy anthy + ++ lib.optional withGtk2 gtk2 + ++ lib.optional withGtk3 gtk3 + ++ lib.optionals withQt5 [ + qt5.qtbase + qt5.qtx11extras + ] + ++ lib.optional withLibnotify libnotify + ++ lib.optional withSqlite sqlite + ++ lib.optionals withNetworking [ + curl + openssl + ] + ++ lib.optional withFFI libffi + ++ lib.optional withMisc libeb; postPatch = '' patchShebangs *.sh */*.sh */*/*.sh @@ -124,33 +122,32 @@ stdenv.mkDerivation (finalAttrs: { ./data-hook.patch ]; - configureFlags = - [ - # configure in maintainer mode or else some pixmaps won't get autogenerated - # this should imply the above `--enable-maintainer-mode`, but it does not - "--enable-maintainer-mode" + configureFlags = [ + # configure in maintainer mode or else some pixmaps won't get autogenerated + # this should imply the above `--enable-maintainer-mode`, but it does not + "--enable-maintainer-mode" - "--enable-pref" - "--with-skk" - "--with-x" - "--with-xft" - "--with-expat=${expat.dev}" - ] - ++ lib.optional withAnthy "--with-anthy-utf8" - ++ lib.optional withGtk2 "--with-gtk2" - ++ lib.optional withGtk3 "--with-gtk3" - ++ lib.optionals withQt5 [ - "--with-qt5" - "--with-qt5-immodule" - ] - ++ lib.optional withLibnotify "--enable-notify=libnotify" - ++ lib.optional withSqlite "--with-sqlite3" - ++ lib.optionals withNetworking [ - "--with-curl" - "--with-openssl-dir=${openssl.dev}" - ] - ++ lib.optional withFFI "--with-ffi" - ++ lib.optional withMisc "--with-eb"; + "--enable-pref" + "--with-skk" + "--with-x" + "--with-xft" + "--with-expat=${expat.dev}" + ] + ++ lib.optional withAnthy "--with-anthy-utf8" + ++ lib.optional withGtk2 "--with-gtk2" + ++ lib.optional withGtk3 "--with-gtk3" + ++ lib.optionals withQt5 [ + "--with-qt5" + "--with-qt5-immodule" + ] + ++ lib.optional withLibnotify "--enable-notify=libnotify" + ++ lib.optional withSqlite "--with-sqlite3" + ++ lib.optionals withNetworking [ + "--with-curl" + "--with-openssl-dir=${openssl.dev}" + ] + ++ lib.optional withFFI "--with-ffi" + ++ lib.optional withMisc "--with-eb"; # TODO: things in `./configure --help`, but not in nixpkgs #--with-canna Use Canna [default=no] diff --git a/pkgs/tools/misc/bat-extras/buildBatExtrasPkg.nix b/pkgs/tools/misc/bat-extras/buildBatExtrasPkg.nix index adc621108c58..ec09f788a360 100644 --- a/pkgs/tools/misc/bat-extras/buildBatExtrasPkg.nix +++ b/pkgs/tools/misc/bat-extras/buildBatExtrasPkg.nix @@ -48,26 +48,26 @@ stdenv.mkDerivation ( bash fish zsh - ] ++ (lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]); + ] + ++ (lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]); checkPhase = '' runHook preCheck bash ./test.sh --compiled --suite ${name} runHook postCheck ''; - installPhase = - '' - runHook preInstall - mkdir -p $out/bin - cp -p bin/${name} $out/bin/${name} - '' - + lib.optionalString (dependencies != [ ]) '' - wrapProgram $out/bin/${name} \ - --prefix PATH : ${lib.makeBinPath dependencies} - '' - + '' - runHook postInstall - ''; + installPhase = '' + runHook preInstall + mkdir -p $out/bin + cp -p bin/${name} $out/bin/${name} + '' + + lib.optionalString (dependencies != [ ]) '' + wrapProgram $out/bin/${name} \ + --prefix PATH : ${lib.makeBinPath dependencies} + '' + + '' + runHook postInstall + ''; # We already patched dontPatchShebangs = true; diff --git a/pkgs/tools/misc/bat-extras/modules/batdiff.nix b/pkgs/tools/misc/bat-extras/modules/batdiff.nix index 57110cc4111f..b06b7423aa55 100644 --- a/pkgs/tools/misc/bat-extras/modules/batdiff.nix +++ b/pkgs/tools/misc/bat-extras/modules/batdiff.nix @@ -13,6 +13,7 @@ buildBatExtrasPkg { less coreutils gitMinimal - ] ++ lib.optional withDelta delta; + ] + ++ lib.optional withDelta delta; meta.description = "Diff a file against the current git index, or display the diff between two files"; } diff --git a/pkgs/tools/misc/bat-extras/modules/batwatch.nix b/pkgs/tools/misc/bat-extras/modules/batwatch.nix index 0293629dddc2..9d221d13cda2 100644 --- a/pkgs/tools/misc/bat-extras/modules/batwatch.nix +++ b/pkgs/tools/misc/bat-extras/modules/batwatch.nix @@ -12,6 +12,7 @@ buildBatExtrasPkg { dependencies = [ less coreutils - ] ++ lib.optional withEntr entr; + ] + ++ lib.optional withEntr entr; meta.description = "Watch for changes in one or more files, and print them with bat"; } diff --git a/pkgs/tools/misc/bat-extras/modules/core.nix b/pkgs/tools/misc/bat-extras/modules/core.nix index 6bb09788c948..b27f8be6e3e1 100644 --- a/pkgs/tools/misc/bat-extras/modules/core.nix +++ b/pkgs/tools/misc/bat-extras/modules/core.nix @@ -44,7 +44,8 @@ stdenv.mkDerivation rec { bash fish zsh - ] ++ (lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]); + ] + ++ (lib.optionals stdenv.hostPlatform.isDarwin [ getconf ]); checkPhase = '' runHook preCheck # test list repeats suites. Unique them diff --git a/pkgs/tools/misc/ckb-next/default.nix b/pkgs/tools/misc/ckb-next/default.nix index 7f07c7bb1077..28fe6432acd4 100644 --- a/pkgs/tools/misc/ckb-next/default.nix +++ b/pkgs/tools/misc/ckb-next/default.nix @@ -41,7 +41,8 @@ stdenv.mkDerivation rec { qtx11extras libdbusmenu quazip - ] ++ lib.optional withPulseaudio libpulseaudio; + ] + ++ lib.optional withPulseaudio libpulseaudio; nativeBuildInputs = [ wrapQtAppsHook diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 8b0177f03fbe..6feb808706df 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -61,64 +61,63 @@ stdenv.mkDerivation rec { ./CVE-2025-5278.patch ]; - postPatch = - '' - # The test tends to fail on btrfs, f2fs and maybe other unusual filesystems. - sed '2i echo Skipping dd sparse test && exit 77' -i ./tests/dd/sparse.sh - sed '2i echo Skipping du threshold test && exit 77' -i ./tests/du/threshold.sh - sed '2i echo Skipping cp reflink-auto test && exit 77' -i ./tests/cp/reflink-auto.sh - sed '2i echo Skipping cp sparse test && exit 77' -i ./tests/cp/sparse.sh - sed '2i echo Skipping env test && exit 77' -i ./tests/env/env.sh - sed '2i echo Skipping rm deep-2 test && exit 77' -i ./tests/rm/deep-2.sh - sed '2i echo Skipping du long-from-unreadable test && exit 77' -i ./tests/du/long-from-unreadable.sh + postPatch = '' + # The test tends to fail on btrfs, f2fs and maybe other unusual filesystems. + sed '2i echo Skipping dd sparse test && exit 77' -i ./tests/dd/sparse.sh + sed '2i echo Skipping du threshold test && exit 77' -i ./tests/du/threshold.sh + sed '2i echo Skipping cp reflink-auto test && exit 77' -i ./tests/cp/reflink-auto.sh + sed '2i echo Skipping cp sparse test && exit 77' -i ./tests/cp/sparse.sh + sed '2i echo Skipping env test && exit 77' -i ./tests/env/env.sh + sed '2i echo Skipping rm deep-2 test && exit 77' -i ./tests/rm/deep-2.sh + sed '2i echo Skipping du long-from-unreadable test && exit 77' -i ./tests/du/long-from-unreadable.sh - # The test tends to fail on cephfs - sed '2i echo Skipping df total-verify test && exit 77' -i ./tests/df/total-verify.sh + # The test tends to fail on cephfs + sed '2i echo Skipping df total-verify test && exit 77' -i ./tests/df/total-verify.sh - # Some target platforms, especially when building inside a container have - # issues with the inotify test. - sed '2i echo Skipping tail inotify dir recreate test && exit 77' -i ./tests/tail/inotify-dir-recreate.sh + # Some target platforms, especially when building inside a container have + # issues with the inotify test. + sed '2i echo Skipping tail inotify dir recreate test && exit 77' -i ./tests/tail/inotify-dir-recreate.sh - # sandbox does not allow setgid - sed '2i echo Skipping chmod setgid test && exit 77' -i ./tests/chmod/setgid.sh - substituteInPlace ./tests/install/install-C.sh \ - --replace 'mode3=2755' 'mode3=1755' + # sandbox does not allow setgid + sed '2i echo Skipping chmod setgid test && exit 77' -i ./tests/chmod/setgid.sh + substituteInPlace ./tests/install/install-C.sh \ + --replace 'mode3=2755' 'mode3=1755' - # Fails on systems with a rootfs. Looks like a bug in the test, see - # https://lists.gnu.org/archive/html/bug-coreutils/2019-12/msg00000.html - sed '2i print "Skipping df skip-rootfs test"; exit 77' -i ./tests/df/skip-rootfs.sh + # Fails on systems with a rootfs. Looks like a bug in the test, see + # https://lists.gnu.org/archive/html/bug-coreutils/2019-12/msg00000.html + sed '2i print "Skipping df skip-rootfs test"; exit 77' -i ./tests/df/skip-rootfs.sh - # these tests fail in the unprivileged nix sandbox (without nix-daemon) as we break posix assumptions - for f in ./tests/chgrp/{basic.sh,recurse.sh,default-no-deref.sh,no-x.sh,posix-H.sh}; do - sed '2i echo Skipping chgrp && exit 77' -i "$f" - done - for f in gnulib-tests/{test-chown.c,test-fchownat.c,test-lchown.c}; do - echo "int main() { return 77; }" > "$f" - done + # these tests fail in the unprivileged nix sandbox (without nix-daemon) as we break posix assumptions + for f in ./tests/chgrp/{basic.sh,recurse.sh,default-no-deref.sh,no-x.sh,posix-H.sh}; do + sed '2i echo Skipping chgrp && exit 77' -i "$f" + done + for f in gnulib-tests/{test-chown.c,test-fchownat.c,test-lchown.c}; do + echo "int main() { return 77; }" > "$f" + done - # We don't have localtime in the sandbox - for f in gnulib-tests/{test-localtime_r.c,test-localtime_r-mt.c}; do - echo "int main() { return 77; }" > "$f" - done + # We don't have localtime in the sandbox + for f in gnulib-tests/{test-localtime_r.c,test-localtime_r-mt.c}; do + echo "int main() { return 77; }" > "$f" + done - # intermittent failures on builders, unknown reason - sed '2i echo Skipping du basic test && exit 77' -i ./tests/du/basic.sh + # intermittent failures on builders, unknown reason + sed '2i echo Skipping du basic test && exit 77' -i ./tests/du/basic.sh - # fails when syscalls related to acl not being available, e.g. in sandboxed environment - sed '2i echo Skipping ls -al with acl test && exit 77' -i ./tests/ls/acl.sh - '' - + (optionalString (stdenv.hostPlatform.libc == "musl") ( - concatStringsSep "\n" [ - '' - echo "int main() { return 77; }" > gnulib-tests/test-parse-datetime.c - echo "int main() { return 77; }" > gnulib-tests/test-getlogin.c - '' - ] - )) - + (optionalString stdenv.hostPlatform.isAarch64 '' - # Sometimes fails: https://github.com/NixOS/nixpkgs/pull/143097#issuecomment-954462584 - sed '2i echo Skipping cut huge range test && exit 77' -i ./tests/cut/cut-huge-range.sh - ''); + # fails when syscalls related to acl not being available, e.g. in sandboxed environment + sed '2i echo Skipping ls -al with acl test && exit 77' -i ./tests/ls/acl.sh + '' + + (optionalString (stdenv.hostPlatform.libc == "musl") ( + concatStringsSep "\n" [ + '' + echo "int main() { return 77; }" > gnulib-tests/test-parse-datetime.c + echo "int main() { return 77; }" > gnulib-tests/test-getlogin.c + '' + ] + )) + + (optionalString stdenv.hostPlatform.isAarch64 '' + # Sometimes fails: https://github.com/NixOS/nixpkgs/pull/143097#issuecomment-954462584 + sed '2i echo Skipping cut huge range test && exit 77' -i ./tests/cut/cut-huge-range.sh + ''); outputs = [ "out" @@ -126,16 +125,15 @@ stdenv.mkDerivation rec { ]; separateDebugInfo = true; - nativeBuildInputs = - [ - perl - xz.bin - ] - ++ optionals stdenv.hostPlatform.isCygwin [ - # due to patch - autoreconfHook - texinfo - ]; + nativeBuildInputs = [ + perl + xz.bin + ] + ++ optionals stdenv.hostPlatform.isCygwin [ + # due to patch + autoreconfHook + texinfo + ]; buildInputs = [ ] @@ -152,32 +150,33 @@ stdenv.mkDerivation rec { hardeningDisable = [ "trivialautovarinit" ]; - configureFlags = - [ "--with-packager=https://nixos.org" ] - ++ optional (singleBinary != false) ( - "--enable-single-binary" + optionalString (isString singleBinary) "=${singleBinary}" - ) - ++ optional withOpenssl "--with-openssl" - ++ optional stdenv.hostPlatform.isSunOS "ac_cv_func_inotify_init=no" - ++ optional withPrefix "--program-prefix=g" - # the shipped configure script doesn't enable nls, but using autoreconfHook - # does so which breaks the build - ++ optional stdenv.hostPlatform.isDarwin "--disable-nls" - # The VMULL-based CRC implementation produces incorrect results on musl. - # https://lists.gnu.org/archive/html/bug-coreutils/2025-02/msg00046.html - ++ optional ( - stdenv.hostPlatform.config == "aarch64-unknown-linux-musl" - ) "utils_cv_vmull_intrinsic_exists=no" - ++ optionals (isCross && stdenv.hostPlatform.libc == "glibc") [ - # TODO(19b98110126fde7cbb1127af7e3fe1568eacad3d): Needed for fstatfs() I - # don't know why it is not properly detected cross building with glibc. - "fu_cv_sys_stat_statfs2_bsize=yes" - ] - # /proc/uptime is available on Linux and produces accurate results even if - # the boot time is set to the epoch because the system has no RTC. We - # explicitly enable it for cases where it can't be detected automatically, - # such as when cross-compiling. - ++ optional stdenv.hostPlatform.isLinux "gl_cv_have_proc_uptime=yes"; + configureFlags = [ + "--with-packager=https://nixos.org" + ] + ++ optional (singleBinary != false) ( + "--enable-single-binary" + optionalString (isString singleBinary) "=${singleBinary}" + ) + ++ optional withOpenssl "--with-openssl" + ++ optional stdenv.hostPlatform.isSunOS "ac_cv_func_inotify_init=no" + ++ optional withPrefix "--program-prefix=g" + # the shipped configure script doesn't enable nls, but using autoreconfHook + # does so which breaks the build + ++ optional stdenv.hostPlatform.isDarwin "--disable-nls" + # The VMULL-based CRC implementation produces incorrect results on musl. + # https://lists.gnu.org/archive/html/bug-coreutils/2025-02/msg00046.html + ++ optional ( + stdenv.hostPlatform.config == "aarch64-unknown-linux-musl" + ) "utils_cv_vmull_intrinsic_exists=no" + ++ optionals (isCross && stdenv.hostPlatform.libc == "glibc") [ + # TODO(19b98110126fde7cbb1127af7e3fe1568eacad3d): Needed for fstatfs() I + # don't know why it is not properly detected cross building with glibc. + "fu_cv_sys_stat_statfs2_bsize=yes" + ] + # /proc/uptime is available on Linux and produces accurate results even if + # the boot time is set to the epoch because the system has no RTC. We + # explicitly enable it for cases where it can't be detected automatically, + # such as when cross-compiling. + ++ optional stdenv.hostPlatform.isLinux "gl_cv_have_proc_uptime=yes"; # The tests are known broken on Cygwin # (http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/19025), diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix index 1c79da3c65e3..77dd8f632906 100644 --- a/pkgs/tools/misc/file/default.nix +++ b/pkgs/tools/misc/file/default.nix @@ -51,7 +51,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file; + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file; buildInputs = [ zlib ] ++ lib.optional stdenv.hostPlatform.isWindows libgnurx; # https://bugs.astron.com/view.php?id=382 diff --git a/pkgs/tools/misc/graylog/graylog.nix b/pkgs/tools/misc/graylog/graylog.nix index 9e17f21515be..3890f493f295 100644 --- a/pkgs/tools/misc/graylog/graylog.nix +++ b/pkgs/tools/misc/graylog/graylog.nix @@ -36,17 +36,16 @@ stdenv.mkDerivation rec { passthru.tests = { inherit (nixosTests) graylog; }; - installPhase = - '' - mkdir -p $out - cp -r {graylog.jar,bin,plugin} $out - '' - + lib.optionalString (lib.versionOlder version "4.3") '' - cp -r lib $out - '' - + '' - wrapProgram $out/bin/graylogctl $makeWrapperArgs - ''; + installPhase = '' + mkdir -p $out + cp -r {graylog.jar,bin,plugin} $out + '' + + lib.optionalString (lib.versionOlder version "4.3") '' + cp -r lib $out + '' + + '' + wrapProgram $out/bin/graylogctl $makeWrapperArgs + ''; meta = with lib; { description = "Open source log management solution"; diff --git a/pkgs/tools/misc/grub/default.nix b/pkgs/tools/misc/grub/default.nix index 43d06dcc5a5c..4e795fd6607e 100644 --- a/pkgs/tools/misc/grub/default.nix +++ b/pkgs/tools/misc/grub/default.nix @@ -520,18 +520,17 @@ stdenv.mkDerivation rec { automake help2man ]; - buildInputs = - [ - ncurses - libusb-compat-0_1 - freetype - lvm2 - fuse - libtool - bash - ] - ++ lib.optional doCheck qemu - ++ lib.optional zfsSupport zfs; + buildInputs = [ + ncurses + libusb-compat-0_1 + freetype + lvm2 + fuse + libtool + bash + ] + ++ lib.optional doCheck qemu + ++ lib.optional zfsSupport zfs; strictDeps = true; @@ -583,32 +582,31 @@ stdenv.mkDerivation rec { make dist ''; - configureFlags = - [ - "--enable-grub-mount" # dep of os-prober - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - # grub doesn't do cross-compilation as usual and tries to use unprefixed - # tools to target the host. Provide toolchain information explicitly for - # cross builds. - # - # Ref: # https://github.com/buildroot/buildroot/blob/master/boot/grub2/grub2.mk#L108 - "TARGET_CC=${stdenv.cc.targetPrefix}cc" - "TARGET_NM=${stdenv.cc.targetPrefix}nm" - "TARGET_OBJCOPY=${stdenv.cc.targetPrefix}objcopy" - "TARGET_RANLIB=${stdenv.cc.targetPrefix}ranlib" - "TARGET_STRIP=${stdenv.cc.targetPrefix}strip" - ] - ++ lib.optional zfsSupport "--enable-libzfs" - ++ lib.optionals efiSupport [ - "--with-platform=efi" - "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" - "--program-prefix=" - ] - ++ lib.optionals xenSupport [ - "--with-platform=xen" - "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" - ]; + configureFlags = [ + "--enable-grub-mount" # dep of os-prober + ] + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # grub doesn't do cross-compilation as usual and tries to use unprefixed + # tools to target the host. Provide toolchain information explicitly for + # cross builds. + # + # Ref: # https://github.com/buildroot/buildroot/blob/master/boot/grub2/grub2.mk#L108 + "TARGET_CC=${stdenv.cc.targetPrefix}cc" + "TARGET_NM=${stdenv.cc.targetPrefix}nm" + "TARGET_OBJCOPY=${stdenv.cc.targetPrefix}objcopy" + "TARGET_RANLIB=${stdenv.cc.targetPrefix}ranlib" + "TARGET_STRIP=${stdenv.cc.targetPrefix}strip" + ] + ++ lib.optional zfsSupport "--enable-libzfs" + ++ lib.optionals efiSupport [ + "--with-platform=efi" + "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" + "--program-prefix=" + ] + ++ lib.optionals xenSupport [ + "--with-platform=xen" + "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" + ]; # save target that grub is compiled for grubTarget = diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index 23e469383adc..8ab43953fcb7 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -69,64 +69,63 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ removeReferencesTo cmake - ] ++ optional fortranSupport fortran; + ] + ++ optional fortranSupport fortran; buildInputs = optional fortranSupport fortran ++ optional szipSupport szip ++ optional javaSupport jdk; propagatedBuildInputs = optional zlibSupport zlib ++ optional mpiSupport mpi; - cmakeFlags = - [ - "-DHDF5_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake" - "-DBUILD_STATIC_LIBS=${lib.boolToString enableStatic}" - ] - ++ lib.optional stdenv.hostPlatform.isDarwin "-DHDF5_BUILD_WITH_INSTALL_NAME=ON" - ++ lib.optional cppSupport "-DHDF5_BUILD_CPP_LIB=ON" - ++ lib.optional fortranSupport "-DHDF5_BUILD_FORTRAN=ON" - ++ lib.optional szipSupport "-DHDF5_ENABLE_SZIP_SUPPORT=ON" - ++ lib.optionals mpiSupport [ "-DHDF5_ENABLE_PARALLEL=ON" ] - ++ lib.optional enableShared "-DBUILD_SHARED_LIBS=ON" - ++ lib.optional javaSupport "-DHDF5_BUILD_JAVA=ON" - ++ lib.optional usev110Api "-DDEFAULT_API_VERSION=v110" - ++ lib.optionals threadsafe [ - "-DDHDF5_ENABLE_THREADSAFE:BOOL=ON" - "-DHDF5_BUILD_HL_LIB=OFF" - ] - # broken in nixpkgs since around 1.14.3 -> 1.14.4.3 - # https://github.com/HDFGroup/hdf5/issues/4208#issuecomment-2098698567 - ++ lib.optional ( - stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 - ) "-DHDF5_ENABLE_NONSTANDARD_FEATURE_FLOAT16=OFF"; + cmakeFlags = [ + "-DHDF5_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake" + "-DBUILD_STATIC_LIBS=${lib.boolToString enableStatic}" + ] + ++ lib.optional stdenv.hostPlatform.isDarwin "-DHDF5_BUILD_WITH_INSTALL_NAME=ON" + ++ lib.optional cppSupport "-DHDF5_BUILD_CPP_LIB=ON" + ++ lib.optional fortranSupport "-DHDF5_BUILD_FORTRAN=ON" + ++ lib.optional szipSupport "-DHDF5_ENABLE_SZIP_SUPPORT=ON" + ++ lib.optionals mpiSupport [ "-DHDF5_ENABLE_PARALLEL=ON" ] + ++ lib.optional enableShared "-DBUILD_SHARED_LIBS=ON" + ++ lib.optional javaSupport "-DHDF5_BUILD_JAVA=ON" + ++ lib.optional usev110Api "-DDEFAULT_API_VERSION=v110" + ++ lib.optionals threadsafe [ + "-DDHDF5_ENABLE_THREADSAFE:BOOL=ON" + "-DHDF5_BUILD_HL_LIB=OFF" + ] + # broken in nixpkgs since around 1.14.3 -> 1.14.4.3 + # https://github.com/HDFGroup/hdf5/issues/4208#issuecomment-2098698567 + ++ lib.optional ( + stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 + ) "-DHDF5_ENABLE_NONSTANDARD_FEATURE_FLOAT16=OFF"; - postInstall = - '' - find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + - moveToOutput 'bin/' "''${!outputBin}" - moveToOutput 'bin/h5cc' "''${!outputDev}" - moveToOutput 'bin/h5c++' "''${!outputDev}" - moveToOutput 'bin/h5fc' "''${!outputDev}" - moveToOutput 'bin/h5pcc' "''${!outputDev}" - moveToOutput 'bin/h5hlcc' "''${!outputDev}" - moveToOutput 'bin/h5hlc++' "''${!outputDev}" - '' - + - lib.optionalString enableShared - # The shared build creates binaries with -shared suffixes, - # so we remove these suffixes. - '' - pushd ''${!outputBin}/bin - for file in *-shared; do - mv "$file" "''${file%%-shared}" - done - popd - '' - + lib.optionalString fortranSupport '' - mv $out/mod/shared $dev/include - rm -r $out/mod + postInstall = '' + find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + + moveToOutput 'bin/' "''${!outputBin}" + moveToOutput 'bin/h5cc' "''${!outputDev}" + moveToOutput 'bin/h5c++' "''${!outputDev}" + moveToOutput 'bin/h5fc' "''${!outputDev}" + moveToOutput 'bin/h5pcc' "''${!outputDev}" + moveToOutput 'bin/h5hlcc' "''${!outputDev}" + moveToOutput 'bin/h5hlc++' "''${!outputDev}" + '' + + + lib.optionalString enableShared + # The shared build creates binaries with -shared suffixes, + # so we remove these suffixes. + '' + pushd ''${!outputBin}/bin + for file in *-shared; do + mv "$file" "''${file%%-shared}" + done + popd + '' + + lib.optionalString fortranSupport '' + mv $out/mod/shared $dev/include + rm -r $out/mod - find "$out" -type f -exec remove-references-to -t ${fortran} '{}' + - ''; + find "$out" -type f -exec remove-references-to -t ${fortran} '{}' + + ''; enableParallelBuilding = true; diff --git a/pkgs/tools/misc/moreutils/default.nix b/pkgs/tools/misc/moreutils/default.nix index e4b6f639a055..8842122cca6a 100644 --- a/pkgs/tools/misc/moreutils/default.nix +++ b/pkgs/tools/misc/moreutils/default.nix @@ -32,17 +32,16 @@ stdenv.mkDerivation rec { docbook-xsl docbook_xml_dtd_44 ]; - buildInputs = - [ - (perl.withPackages (p: [ - p.IPCRun - p.TimeDate - p.TimeDuration - ])) - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - cctools - ]; + buildInputs = [ + (perl.withPackages (p: [ + p.IPCRun + p.TimeDate + p.TimeDuration + ])) + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + ]; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" diff --git a/pkgs/tools/misc/qflipper/default.nix b/pkgs/tools/misc/qflipper/default.nix index e1528ddfb915..568a16845daf 100644 --- a/pkgs/tools/misc/qflipper/default.nix +++ b/pkgs/tools/misc/qflipper/default.nix @@ -50,24 +50,23 @@ mkDerivation { wrapQtAppsHook ]; - buildInputs = - [ - zlib - libusb1 - libGL + buildInputs = [ + zlib + libusb1 + libGL - qtbase - qt3d - qtsvg - qtserialport - qtdeclarative - qtquickcontrols - qtquickcontrols2 - qtgraphicaleffects - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - qtwayland - ]; + qtbase + qt3d + qtsvg + qtserialport + qtdeclarative + qtquickcontrols + qtquickcontrols2 + qtgraphicaleffects + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux) [ + qtwayland + ]; qmakeFlags = [ "DEFINES+=DISABLE_APPLICATION_UPDATES" diff --git a/pkgs/tools/misc/rmlint/default.nix b/pkgs/tools/misc/rmlint/default.nix index 4a06287dc93e..8e15a2cfe545 100644 --- a/pkgs/tools/misc/rmlint/default.nix +++ b/pkgs/tools/misc/rmlint/default.nix @@ -44,35 +44,33 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = - [ - pkg-config - sphinx - scons - ] - ++ lib.optionals withGui [ - makeWrapper - wrapGAppsHook3 - gobject-introspection - ]; + nativeBuildInputs = [ + pkg-config + sphinx + scons + ] + ++ lib.optionals withGui [ + makeWrapper + wrapGAppsHook3 + gobject-introspection + ]; - buildInputs = - [ - glib - json-glib - util-linux - ] - ++ lib.optionals withGui [ - cairo - gtksourceview3 - pango - polkit - python3 - python3.pkgs.pygobject3 - ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ - elfutils - ]; + buildInputs = [ + glib + json-glib + util-linux + ] + ++ lib.optionals withGui [ + cairo + gtksourceview3 + pango + polkit + python3 + python3.pkgs.pygobject3 + ] + ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [ + elfutils + ]; prePatch = '' # remove sources of nondeterminism diff --git a/pkgs/tools/misc/tlp/default.nix b/pkgs/tools/misc/tlp/default.nix index ad8c677ea5b6..99ea5484c214 100644 --- a/pkgs/tools/misc/tlp/default.nix +++ b/pkgs/tools/misc/tlp/default.nix @@ -67,15 +67,14 @@ stdenv.mkDerivation rec { "DESTDIR=${placeholder "out"}" ]; - installTargets = - [ - "install-tlp" - "install-man" - ] - ++ lib.optionals enableRDW [ - "install-rdw" - "install-man-rdw" - ]; + installTargets = [ + "install-tlp" + "install-man" + ] + ++ lib.optionals enableRDW [ + "install-rdw" + "install-man-rdw" + ]; doCheck = true; nativeCheckInputs = [ diff --git a/pkgs/tools/misc/tremor-rs/default.nix b/pkgs/tools/misc/tremor-rs/default.nix index 3a2d425fe376..94e980ae7373 100644 --- a/pkgs/tools/misc/tremor-rs/default.nix +++ b/pkgs/tools/misc/tremor-rs/default.nix @@ -32,11 +32,12 @@ rustPlatform.buildRustPackage rec { rustPlatform.bindgenHook ]; - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - ]; + buildInputs = [ + openssl + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + libiconv + ]; # relax lints to fix an error caused by invalid macro_export # error: `log_error` isn't a valid `#[macro_export]` argument @@ -49,18 +50,17 @@ rustPlatform.buildRustPackage rec { ''; # TODO export TREMOR_PATH($out/lib) variable - postInstall = - '' - # Copy the standard library to $out/lib - cp -r ${src}/tremor-script/lib/ $out + postInstall = '' + # Copy the standard library to $out/lib + cp -r ${src}/tremor-script/lib/ $out - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - installShellCompletion --cmd tremor \ - --bash <($out/bin/tremor completions bash) \ - --fish <($out/bin/tremor completions fish) \ - --zsh <($out/bin/tremor completions zsh) - ''; + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd tremor \ + --bash <($out/bin/tremor completions bash) \ + --fish <($out/bin/tremor completions fish) \ + --zsh <($out/bin/tremor completions zsh) + ''; # OPENSSL_NO_VENDOR - If set, always find OpenSSL in the system, even if the vendored feature is enabled. OPENSSL_NO_VENDOR = 1; diff --git a/pkgs/tools/misc/ttfautohint/default.nix b/pkgs/tools/misc/ttfautohint/default.nix index 711e62d88feb..a4fea24080fd 100644 --- a/pkgs/tools/misc/ttfautohint/default.nix +++ b/pkgs/tools/misc/ttfautohint/default.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation rec { freetype harfbuzz libiconv - ] ++ lib.optional enableGUI qtbase; + ] + ++ lib.optional enableGUI qtbase; configureFlags = [ ''--with-qt=${if enableGUI then "${qtbase}/lib" else "no"}'' ]; diff --git a/pkgs/tools/misc/vimpager/latest.nix b/pkgs/tools/misc/vimpager/latest.nix index 4557f7aad574..36792e1c10a3 100644 --- a/pkgs/tools/misc/vimpager/latest.nix +++ b/pkgs/tools/misc/vimpager/latest.nix @@ -5,9 +5,7 @@ sha256 = "0gcjpw2q263hh8w2sjvq3f3k2d28qpkkv0jnl8hw1l7v604i8zxg"; }).overrideAttrs (old: { - postPatch = - old.postPatch or "" - + '' - echo 'echo ${runtimeShell}' > scripts/find_shell - ''; + postPatch = old.postPatch or "" + '' + echo 'echo ${runtimeShell}' > scripts/find_shell + ''; }) diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix index b4717bd43da9..0ebe54dc3e83 100644 --- a/pkgs/tools/misc/youtube-dl/default.nix +++ b/pkgs/tools/misc/youtube-dl/default.nix @@ -78,8 +78,11 @@ buildPythonPackage rec { # - atomicparsley: embedding thumbnails makeWrapperArgs = let - packagesToBinPath = - [ atomicparsley ] ++ lib.optional ffmpegSupport ffmpeg ++ lib.optional rtmpSupport rtmpdump; + packagesToBinPath = [ + atomicparsley + ] + ++ lib.optional ffmpegSupport ffmpeg + ++ lib.optional rtmpSupport rtmpdump; in [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ]; diff --git a/pkgs/tools/networking/bitmask-vpn/default.nix b/pkgs/tools/networking/bitmask-vpn/default.nix index e5d772e27798..4242ac59a666 100644 --- a/pkgs/tools/networking/bitmask-vpn/default.nix +++ b/pkgs/tools/networking/bitmask-vpn/default.nix @@ -80,31 +80,30 @@ buildGoModule rec { ./build_release.patch ]; - postPatch = - '' - substituteInPlace pkg/pickle/helpers.go \ - --replace /usr/share $out/share + postPatch = '' + substituteInPlace pkg/pickle/helpers.go \ + --replace /usr/share $out/share - # Using $PROVIDER is not working, - # thus replacing directly into the vendor.conf - substituteInPlace providers/vendor.conf \ - --replace "provider = bitmask" "provider = ${provider}" + # Using $PROVIDER is not working, + # thus replacing directly into the vendor.conf + substituteInPlace providers/vendor.conf \ + --replace "provider = bitmask" "provider = ${provider}" - substituteInPlace branding/templates/debian/app.desktop-template \ - --replace "Icon=icon" "Icon=${pname}" + substituteInPlace branding/templates/debian/app.desktop-template \ + --replace "Icon=icon" "Icon=${pname}" - patchShebangs gui/build.sh - wrapPythonProgramsIn branding/scripts - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace pkg/helper/linux.go \ - --replace /usr/sbin/openvpn ${openvpn}/bin/openvpn - substituteInPlace pkg/launcher/launcher_linux.go \ - --replace /usr/sbin/openvpn ${openvpn}/bin/openvpn \ - --replace /usr/sbin/bitmask-root ${bitmask-root}/bin/bitmask-root \ - --replace /usr/bin/lxpolkit /run/wrappers/bin/polkit-agent-helper-1 \ - --replace '"polkit-gnome-authentication-agent-1",' '"polkit-gnome-authentication-agent-1","polkitd",' - ''; + patchShebangs gui/build.sh + wrapPythonProgramsIn branding/scripts + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace pkg/helper/linux.go \ + --replace /usr/sbin/openvpn ${openvpn}/bin/openvpn + substituteInPlace pkg/launcher/launcher_linux.go \ + --replace /usr/sbin/openvpn ${openvpn}/bin/openvpn \ + --replace /usr/sbin/bitmask-root ${bitmask-root}/bin/bitmask-root \ + --replace /usr/bin/lxpolkit /run/wrappers/bin/polkit-agent-helper-1 \ + --replace '"polkit-gnome-authentication-agent-1",' '"polkit-gnome-authentication-agent-1","polkitd",' + ''; nativeBuildInputs = [ cmake @@ -123,7 +122,8 @@ buildGoModule rec { qtbase qtdeclarative qtsvg - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ]; # FIXME: building on Darwin currently fails # due to missing debug symbols for Qt, @@ -148,18 +148,17 @@ buildGoModule rec { runHook postBuild ''; - postInstall = - '' - install -m 755 -D -t $out/bin build/qt/release/${pname} + postInstall = '' + install -m 755 -D -t $out/bin build/qt/release/${pname} - VERSION=${version} VENDOR_PATH=providers branding/scripts/generate-debian branding/templates/debian/data.json - (cd branding/templates/debian && ${python3Packages.python}/bin/python3 generate.py) - install -m 444 -D branding/templates/debian/app.desktop $out/share/applications/${pname}.desktop - install -m 444 -D providers/${provider}/assets/icon.svg $out/share/icons/hicolor/scalable/apps/${pname}.svg - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - install -m 444 -D -t $out/share/polkit-1/actions ${bitmask-root}/share/polkit-1/actions/se.leap.bitmask.policy - ''; + VERSION=${version} VENDOR_PATH=providers branding/scripts/generate-debian branding/templates/debian/data.json + (cd branding/templates/debian && ${python3Packages.python}/bin/python3 generate.py) + install -m 444 -D branding/templates/debian/app.desktop $out/share/applications/${pname}.desktop + install -m 444 -D providers/${provider}/assets/icon.svg $out/share/icons/hicolor/scalable/apps/${pname}.svg + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + install -m 444 -D -t $out/share/polkit-1/actions ${bitmask-root}/share/polkit-1/actions/se.leap.bitmask.policy + ''; # Some tests need access to the Internet: # Post "https://api.black.riseup.net/3/cert": dial tcp: lookup api.black.riseup.net on [::1]:53: read udp [::1]:56553->[::1]:53: read: connection refused diff --git a/pkgs/tools/networking/dd-agent/datadog-agent.nix b/pkgs/tools/networking/dd-agent/datadog-agent.nix index 681e7ddfe8f0..9f4da6aa77d6 100644 --- a/pkgs/tools/networking/dd-agent/datadog-agent.nix +++ b/pkgs/tools/networking/dd-agent/datadog-agent.nix @@ -69,18 +69,17 @@ buildGoModule rec { buildInputs = [ rtloader ] ++ lib.optionals withSystemd [ systemd ]; PKG_CONFIG_PATH = "${python}/lib/pkgconfig"; - tags = - [ - "ec2" - "python" - "process" - "log" - "secrets" - "zlib" - ] - ++ lib.optionals withSystemd [ "systemd" ] - ++ lib.optionals withDocker [ "docker" ] - ++ extraTags; + tags = [ + "ec2" + "python" + "process" + "log" + "secrets" + "zlib" + ] + ++ lib.optionals withSystemd [ "systemd" ] + ++ lib.optionals withDocker [ "docker" ] + ++ extraTags; ldflags = [ "-X ${goPackagePath}/pkg/version.Commit=${src.rev}" @@ -105,21 +104,20 @@ buildGoModule rec { # Install the config files and python modules from the "dist" dir # into standard paths. - postInstall = - '' - mkdir -p $out/${python.sitePackages} $out/share/datadog-agent - cp -R --no-preserve=mode $src/cmd/agent/dist/conf.d $out/share/datadog-agent - rm -rf $out/share/datadog-agent/conf.d/{apm.yaml.default,process_agent.yaml.default,winproc.d,agentcrashdetect.d,myapp.d} - cp -R $src/cmd/agent/dist/{checks,utils,config.py} $out/${python.sitePackages} + postInstall = '' + mkdir -p $out/${python.sitePackages} $out/share/datadog-agent + cp -R --no-preserve=mode $src/cmd/agent/dist/conf.d $out/share/datadog-agent + rm -rf $out/share/datadog-agent/conf.d/{apm.yaml.default,process_agent.yaml.default,winproc.d,agentcrashdetect.d,myapp.d} + cp -R $src/cmd/agent/dist/{checks,utils,config.py} $out/${python.sitePackages} - wrapProgram "$out/bin/agent" \ - --set PYTHONPATH "$out/${python.sitePackages}"'' - + lib.optionalString withSystemd " --prefix LD_LIBRARY_PATH : ${ - lib.makeLibraryPath [ - (lib.getLib systemd) - rtloader - ] - }"; + wrapProgram "$out/bin/agent" \ + --set PYTHONPATH "$out/${python.sitePackages}"'' + + lib.optionalString withSystemd " --prefix LD_LIBRARY_PATH : ${ + lib.makeLibraryPath [ + (lib.getLib systemd) + rtloader + ] + }"; passthru.tests.version = testers.testVersion { package = datadog-agent; diff --git a/pkgs/tools/networking/gp-saml-gui/default.nix b/pkgs/tools/networking/gp-saml-gui/default.nix index 9d52127ba5d8..f297f189851f 100644 --- a/pkgs/tools/networking/gp-saml-gui/default.nix +++ b/pkgs/tools/networking/gp-saml-gui/default.nix @@ -35,7 +35,8 @@ buildPythonPackage rec { requests pygobject3 openconnect - ] ++ lib.optional stdenv.hostPlatform.isLinux webkitgtk_4_1; + ] + ++ lib.optional stdenv.hostPlatform.isLinux webkitgtk_4_1; preFixup = '' gappsWrapperArgs+=( diff --git a/pkgs/tools/networking/lxi-tools/default.nix b/pkgs/tools/networking/lxi-tools/default.nix index 40ac48b15f82..c7fab943cfb3 100644 --- a/pkgs/tools/networking/lxi-tools/default.nix +++ b/pkgs/tools/networking/lxi-tools/default.nix @@ -38,25 +38,25 @@ stdenv.mkDerivation rec { ninja cmake pkg-config - ] ++ lib.optional withGui wrapGAppsHook4; + ] + ++ lib.optional withGui wrapGAppsHook4; - buildInputs = - [ - liblxi - readline - lua - bash-completion - ] - ++ lib.optionals withGui [ - glib - gtk4 - gtksourceview5 - libadwaita - json-glib - desktop-file-utils - appstream-glib - gsettings-desktop-schemas - ]; + buildInputs = [ + liblxi + readline + lua + bash-completion + ] + ++ lib.optionals withGui [ + glib + gtk4 + gtksourceview5 + libadwaita + json-glib + desktop-file-utils + appstream-glib + gsettings-desktop-schemas + ]; postUnpack = "sed -i '/meson.add_install.*$/d' source/meson.build"; diff --git a/pkgs/tools/networking/maubot/plugins/generated.nix b/pkgs/tools/networking/maubot/plugins/generated.nix index 5008acdcc4b3..dbaee26f8853 100644 --- a/pkgs/tools/networking/maubot/plugins/generated.nix +++ b/pkgs/tools/networking/maubot/plugins/generated.nix @@ -84,13 +84,11 @@ lib.flip builtins.mapAttrs json ( )) ]; - preBuild = - lib.optionalString (entry ? attrs.preBuild) (entry.attrs.preBuild + "\n") - + '' - export HOME=$(mktemp -d) - [[ ! -d scripts ]] || patchShebangs --build scripts - make maubot.yaml - ''; + preBuild = lib.optionalString (entry ? attrs.preBuild) (entry.attrs.preBuild + "\n") + '' + export HOME=$(mktemp -d) + [[ ! -d scripts ]] || patchShebangs --build scripts + make maubot.yaml + ''; } ) ) diff --git a/pkgs/tools/networking/miniupnpd/default.nix b/pkgs/tools/networking/miniupnpd/default.nix index 2cdd9ef83b23..19b9dbc95e14 100644 --- a/pkgs/tools/networking/miniupnpd/default.nix +++ b/pkgs/tools/networking/miniupnpd/default.nix @@ -54,16 +54,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-Zss8PWl6srs6YdPEhigWbWujKNfC2+uViY/fKjICr3s="; }; - buildInputs = - [ - iptables-legacy - libuuid - openssl - ] - ++ lib.optionals (firewall == "nftables") [ - libmnl - libnftnl - ]; + buildInputs = [ + iptables-legacy + libuuid + openssl + ] + ++ lib.optionals (firewall == "nftables") [ + libmnl + libnftnl + ]; nativeBuildInputs = [ pkg-config makeWrapper diff --git a/pkgs/tools/networking/mtr/default.nix b/pkgs/tools/networking/mtr/default.nix index 30878c787953..78f46bcd7940 100644 --- a/pkgs/tools/networking/mtr/default.nix +++ b/pkgs/tools/networking/mtr/default.nix @@ -40,13 +40,12 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = - [ - ncurses - jansson - ] - ++ lib.optional withGtk gtk3 - ++ lib.optional stdenv.hostPlatform.isLinux libcap; + buildInputs = [ + ncurses + jansson + ] + ++ lib.optional withGtk gtk3 + ++ lib.optional stdenv.hostPlatform.isLinux libcap; enableParallelBuilding = true; diff --git a/pkgs/tools/networking/networkmanager/default.nix b/pkgs/tools/networking/networkmanager/default.nix index a32da370bef2..dd1d931001a2 100644 --- a/pkgs/tools/networking/networkmanager/default.nix +++ b/pkgs/tools/networking/networkmanager/default.nix @@ -165,45 +165,43 @@ stdenv.mkDerivation (finalAttrs: { libgcrypt ]; - nativeBuildInputs = - [ - meson - ninja - gettext - pkg-config - vala - gobject-introspection - perl - elfutils # used to find jansson soname - # Docs - gtk-doc - libxslt - docbook_xsl - docbook_xml_dtd_412 - docbook_xml_dtd_42 - docbook_xml_dtd_43 - pythonForDocs - udevCheckHook - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + nativeBuildInputs = [ + meson + ninja + gettext + pkg-config + vala + gobject-introspection + perl + elfutils # used to find jansson soname + # Docs + gtk-doc + libxslt + docbook_xsl + docbook_xml_dtd_412 + docbook_xml_dtd_42 + docbook_xml_dtd_43 + pythonForDocs + udevCheckHook + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + mesonEmulatorHook + ]; doCheck = false; # requires /sys, the net - postPatch = - '' - patchShebangs ./tools - patchShebangs libnm/generate-setting-docs.py + postPatch = '' + patchShebangs ./tools + patchShebangs libnm/generate-setting-docs.py - # TODO: submit upstream - substituteInPlace meson.build \ - --replace "'vala', req" "'vala', native: false, req" - '' - + lib.optionalString withSystemd '' - substituteInPlace data/NetworkManager.service.in \ - --replace-fail /usr/bin/busctl ${systemd}/bin/busctl - ''; + # TODO: submit upstream + substituteInPlace meson.build \ + --replace "'vala', req" "'vala', native: false, req" + '' + + lib.optionalString withSystemd '' + substituteInPlace data/NetworkManager.service.in \ + --replace-fail /usr/bin/busctl ${systemd}/bin/busctl + ''; preBuild = '' # Our gobject-introspection patches make the shared library paths absolute diff --git a/pkgs/tools/networking/openconnect/common.nix b/pkgs/tools/networking/openconnect/common.nix index 34dbe7cf7221..b46438481254 100644 --- a/pkgs/tools/networking/openconnect/common.nix +++ b/pkgs/tools/networking/openconnect/common.nix @@ -38,19 +38,18 @@ stdenv.mkDerivation { "--without-openssl-version-check" ]; - buildInputs = - [ - gmp - libxml2 - stoken - zlib - (if useOpenSSL then openssl else gnutls) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - p11-kit - pcsclite - ] - ++ lib.optional useDefaultExternalBrowser xdg-utils; + buildInputs = [ + gmp + libxml2 + stoken + zlib + (if useOpenSSL then openssl else gnutls) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + p11-kit + pcsclite + ] + ++ lib.optional useDefaultExternalBrowser xdg-utils; nativeBuildInputs = [ pkg-config autoreconfHook diff --git a/pkgs/tools/networking/openssh/common.nix b/pkgs/tools/networking/openssh/common.nix index fac0da41d2cf..67b850d55a9b 100644 --- a/pkgs/tools/networking/openssh/common.nix +++ b/pkgs/tools/networking/openssh/common.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation (finalAttrs: { # See discussion in https://github.com/NixOS/nixpkgs/pull/16966 ./dont_create_privsep_path.patch - ] ++ extraPatches; + ] + ++ extraPatches; postPatch = # On Hydra this makes installation fail (sometimes?), @@ -69,26 +70,24 @@ stdenv.mkDerivation (finalAttrs: { ''; strictDeps = true; - nativeBuildInputs = - [ - autoreconfHook - pkg-config - ] - # This is not the same as the krb5 from the inputs! pkgs.krb5 is - # needed here to access krb5-config in order to cross compile. See: - # https://github.com/NixOS/nixpkgs/pull/107606 - ++ lib.optional withKerberos pkgs.krb5 - ++ extraNativeBuildInputs; - buildInputs = - [ - zlib - libedit - ] - ++ [ (if linkOpenssl then openssl else libxcrypt) ] - ++ lib.optional withFIDO libfido2 - ++ lib.optional withKerberos krb5 - ++ lib.optional withLdns ldns - ++ lib.optional withPAM pam; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ] + # This is not the same as the krb5 from the inputs! pkgs.krb5 is + # needed here to access krb5-config in order to cross compile. See: + # https://github.com/NixOS/nixpkgs/pull/107606 + ++ lib.optional withKerberos pkgs.krb5 + ++ extraNativeBuildInputs; + buildInputs = [ + zlib + libedit + ] + ++ [ (if linkOpenssl then openssl else libxcrypt) ] + ++ lib.optional withFIDO libfido2 + ++ lib.optional withKerberos krb5 + ++ lib.optional withLdns ldns + ++ lib.optional withPAM pam; preConfigure = '' # Setting LD causes `configure' and `make' to disagree about which linker @@ -104,32 +103,34 @@ stdenv.mkDerivation (finalAttrs: { # I set --disable-strip because later we strip anyway. And it fails to strip # properly when cross building. - configureFlags = - [ - "--sbindir=\${out}/bin" - "--localstatedir=/var" - "--with-pid-dir=/run" - "--with-mantype=doc" - "--with-libedit=yes" - "--disable-strip" - (lib.withFeature withPAM "pam") - ] - ++ lib.optional (etcDir != null) "--sysconfdir=${etcDir}" - ++ lib.optional (!withSecurityKey) "--disable-security-key" - ++ lib.optional withFIDO "--with-security-key-builtin=yes" - ++ lib.optional withKerberos ( - assert krb5 != null; - "--with-kerberos5=${lib.getDev krb5}" - ) - ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-libutil" - ++ lib.optional (!linkOpenssl) "--without-openssl" - ++ lib.optional withLdns "--with-ldns" - ++ lib.optional stdenv.hostPlatform.isOpenBSD "--with-bsd-auth" - ++ lib.optional withLinuxMemlock "--with-linux-memlock-onfault" - ++ extraConfigureFlags; + configureFlags = [ + "--sbindir=\${out}/bin" + "--localstatedir=/var" + "--with-pid-dir=/run" + "--with-mantype=doc" + "--with-libedit=yes" + "--disable-strip" + (lib.withFeature withPAM "pam") + ] + ++ lib.optional (etcDir != null) "--sysconfdir=${etcDir}" + ++ lib.optional (!withSecurityKey) "--disable-security-key" + ++ lib.optional withFIDO "--with-security-key-builtin=yes" + ++ lib.optional withKerberos ( + assert krb5 != null; + "--with-kerberos5=${lib.getDev krb5}" + ) + ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-libutil" + ++ lib.optional (!linkOpenssl) "--without-openssl" + ++ lib.optional withLdns "--with-ldns" + ++ lib.optional stdenv.hostPlatform.isOpenBSD "--with-bsd-auth" + ++ lib.optional withLinuxMemlock "--with-linux-memlock-onfault" + ++ extraConfigureFlags; - ${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null} = - [ "-laudit" ] ++ lib.optional withKerberos "-lkeyutils" ++ lib.optional withLdns "-lcrypto"; + ${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null} = [ + "-laudit" + ] + ++ lib.optional withKerberos "-lkeyutils" + ++ lib.optional withLdns "-lcrypto"; buildFlags = [ "SSH_KEYSIGN=ssh-keysign" ]; @@ -139,12 +140,11 @@ stdenv.mkDerivation (finalAttrs: { doCheck = false; enableParallelChecking = false; - nativeCheckInputs = - [ - openssl - ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) hostname - ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isMusl) softhsm; + nativeCheckInputs = [ + openssl + ] + ++ lib.optional (!stdenv.hostPlatform.isDarwin) hostname + ++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isMusl) softhsm; preCheck = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' @@ -253,5 +253,6 @@ stdenv.mkDerivation (finalAttrs: { platforms = lib.platforms.unix ++ lib.platforms.windows; maintainers = extraMeta.maintainers or [ ]; mainProgram = "ssh"; - } // extraMeta; + } + // extraMeta; }) diff --git a/pkgs/tools/networking/openvpn/default.nix b/pkgs/tools/networking/openvpn/default.nix index f28bf75897f4..61937d6200f5 100644 --- a/pkgs/tools/networking/openvpn/default.nix +++ b/pkgs/tools/networking/openvpn/default.nix @@ -30,26 +30,26 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-nramYYNS+ee3canTiuFjG17f7tbUAjPiQ+YC3fIZXno="; }; - nativeBuildInputs = - [ pkg-config ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - unixtools.route - unixtools.ifconfig - ]; + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + unixtools.route + unixtools.ifconfig + ]; - buildInputs = - [ - lz4 - lzo - openssl - ] - ++ optionals stdenv.hostPlatform.isLinux [ - libcap_ng - libnl - pam - ] - ++ optional useSystemd systemd - ++ optional pkcs11Support pkcs11helper; + buildInputs = [ + lz4 + lzo + openssl + ] + ++ optionals stdenv.hostPlatform.isLinux [ + libcap_ng + libnl + pam + ] + ++ optional useSystemd systemd + ++ optional pkcs11Support pkcs11helper; configureFlags = optional useSystemd "--enable-systemd" @@ -60,14 +60,13 @@ stdenv.mkDerivation (finalAttrs: { # but a separate package was made, that uses libexec/openvpn. Copy it # into libexec in case any consumers expect it to be there even though # they should use the update-systemd-resolved package instead. - postInstall = - '' - mkdir -p $out/share/doc/openvpn/examples - cp -r sample/sample-{config-files,keys,scripts}/ $out/share/doc/openvpn/examples - '' - + optionalString useSystemd '' - install -Dm555 -t $out/libexec ${update-systemd-resolved}/libexec/openvpn/* - ''; + postInstall = '' + mkdir -p $out/share/doc/openvpn/examples + cp -r sample/sample-{config-files,keys,scripts}/ $out/share/doc/openvpn/examples + '' + + optionalString useSystemd '' + install -Dm555 -t $out/libexec ${update-systemd-resolved}/libexec/openvpn/* + ''; enableParallelBuilding = true; diff --git a/pkgs/tools/networking/pdsh/default.nix b/pkgs/tools/networking/pdsh/default.nix index 7b90ec86ce20..d364b419a10f 100644 --- a/pkgs/tools/networking/pdsh/default.nix +++ b/pkgs/tools/networking/pdsh/default.nix @@ -24,7 +24,8 @@ stdenv.mkDerivation rec { perl readline ssh - ] ++ (lib.optional slurmSupport slurm); + ] + ++ (lib.optional slurmSupport slurm); nativeBuildInputs = [ autoreconfHook ]; diff --git a/pkgs/tools/networking/spoofer/default.nix b/pkgs/tools/networking/spoofer/default.nix index 2f7093bfb6a4..83a282e074a6 100644 --- a/pkgs/tools/networking/spoofer/default.nix +++ b/pkgs/tools/networking/spoofer/default.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation rec { protobuf libpcap traceroute - ] ++ optional withGUI qt5.qtbase; + ] + ++ optional withGUI qt5.qtbase; dontWrapQtApps = true; diff --git a/pkgs/tools/package-management/akku/akkuDerivation.nix b/pkgs/tools/package-management/akku/akkuDerivation.nix index 27d2b10bcda1..eb79b353d437 100644 --- a/pkgs/tools/package-management/akku/akkuDerivation.nix +++ b/pkgs/tools/package-management/akku/akkuDerivation.nix @@ -33,7 +33,8 @@ stdenv.mkDerivation ( akku chez chibi - ] ++ nativeBuildInputs; + ] + ++ nativeBuildInputs; buildPhase = '' runHook preBuild @@ -114,7 +115,8 @@ stdenv.mkDerivation ( ''; meta = { inherit (akku.meta) platforms; - } // args.meta or { }; + } + // args.meta or { }; setupHook = ./setup-hook.sh; } // builtins.removeAttrs args [ diff --git a/pkgs/tools/package-management/apk-tools/default.nix b/pkgs/tools/package-management/apk-tools/default.nix index a3283ce08f11..c2a38d10bb78 100644 --- a/pkgs/tools/package-management/apk-tools/default.nix +++ b/pkgs/tools/package-management/apk-tools/default.nix @@ -22,19 +22,19 @@ stdenv.mkDerivation rec { sha256 = "sha256-9TSkcJe7FVdTtfcCmwp+IWMYa/OL9OXJwPcKLyj5AAA="; }; - nativeBuildInputs = - [ - pkg-config - scdoc - ] - ++ lib.optionals luaSupport [ - lua - lua.pkgs.lua-zlib - ]; + nativeBuildInputs = [ + pkg-config + scdoc + ] + ++ lib.optionals luaSupport [ + lua + lua.pkgs.lua-zlib + ]; buildInputs = [ openssl zlib - ] ++ lib.optional luaSupport lua; + ] + ++ lib.optional luaSupport lua; strictDeps = true; makeFlags = [ diff --git a/pkgs/tools/package-management/disnix/dysnomia/default.nix b/pkgs/tools/package-management/disnix/dysnomia/default.nix index 2500e47f36cf..a4c4f40b99d3 100644 --- a/pkgs/tools/package-management/disnix/dysnomia/default.nix +++ b/pkgs/tools/package-management/disnix/dysnomia/default.nix @@ -77,28 +77,28 @@ stdenv.mkDerivation rec { (if enableS6RCService then "--with-s6-rc" else "--without-s6-rc") (if stdenv.hostPlatform.isDarwin then "--with-launchd" else "--without-launchd") "--with-job-template=${jobTemplate}" - ] ++ lib.optional enableLegacy "--enable-legacy"; + ] + ++ lib.optional enableLegacy "--enable-legacy"; - buildInputs = - [ - getopt - netcat - ] - ++ lib.optional stdenv.hostPlatform.isLinux systemd - ++ lib.optional enableEjabberdDump ejabberd - ++ lib.optional enableMySQLDatabase mariadb.out - ++ lib.optional enablePostgreSQLDatabase libpq - ++ lib.optional enableSubversionRepository subversion - ++ lib.optionals enableMongoDatabase [ - mongodb - mongodb-tools - ] - ++ lib.optional enableInfluxDatabase influxdb - ++ lib.optional enableSupervisordProgram supervisor - ++ lib.optional enableDockerContainer docker - ++ lib.optional enableNginxWebApplication nginx - ++ lib.optional enableS6RCService s6-rc - ++ lib.optional enableXinetdService xinetd; + buildInputs = [ + getopt + netcat + ] + ++ lib.optional stdenv.hostPlatform.isLinux systemd + ++ lib.optional enableEjabberdDump ejabberd + ++ lib.optional enableMySQLDatabase mariadb.out + ++ lib.optional enablePostgreSQLDatabase libpq + ++ lib.optional enableSubversionRepository subversion + ++ lib.optionals enableMongoDatabase [ + mongodb + mongodb-tools + ] + ++ lib.optional enableInfluxDatabase influxdb + ++ lib.optional enableSupervisordProgram supervisor + ++ lib.optional enableDockerContainer docker + ++ lib.optional enableNginxWebApplication nginx + ++ lib.optional enableS6RCService s6-rc + ++ lib.optional enableXinetdService xinetd; meta = { description = "Automated deployment of mutable components and services for Disnix"; diff --git a/pkgs/tools/package-management/lix/common-lix.nix b/pkgs/tools/package-management/lix/common-lix.nix index d36d099f7f75..f414bd836135 100644 --- a/pkgs/tools/package-management/lix/common-lix.nix +++ b/pkgs/tools/package-management/lix/common-lix.nix @@ -113,16 +113,15 @@ stdenv.mkDerivation (finalAttrs: { inherit src patches; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals enableDocumentation [ - "man" - "doc" - "devdoc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals enableDocumentation [ + "man" + "doc" + "devdoc" + ]; strictDeps = true; disallowedReferences = lib.optionals isLLVMOnly [ @@ -136,76 +135,74 @@ stdenv.mkDerivation (finalAttrs: { # We only include CMake so that Meson can locate toml11, which only ships CMake dependency metadata. dontUseCmakeConfigure = true; - nativeBuildInputs = - [ - # python3.withPackages does not splice properly, see https://github.com/NixOS/nixpkgs/issues/305858 - (python3.pythonOnBuildForHost.withPackages (p: [ - p.pytest - p.pytest-xdist - p.python-frontmatter - p.toml - ])) - pkg-config - flex - jq - meson - ninja - cmake - python3 - # Required for libstd++ assertions that leaks inside of the final binary. - removeReferencesTo + nativeBuildInputs = [ + # python3.withPackages does not splice properly, see https://github.com/NixOS/nixpkgs/issues/305858 + (python3.pythonOnBuildForHost.withPackages (p: [ + p.pytest + p.pytest-xdist + p.python-frontmatter + p.toml + ])) + pkg-config + flex + jq + meson + ninja + cmake + python3 + # Required for libstd++ assertions that leaks inside of the final binary. + removeReferencesTo - # Tests - git - mercurial - jq - lsof - ] - ++ lib.optionals isLLVMOnly [ - rustc - cargo - rustPlatform.cargoSetupHook - ] - ++ lib.optionals isLegacyParser [ bison ] - ++ lib.optionals enableDocumentation [ - (lib.getBin lowdown-unsandboxed) - mdbook - mdbook-linkcheck - doxygen - ] - ++ lib.optionals (hasDtraceSupport && withDtrace) [ systemtap-sdt ] - ++ lib.optionals pastaFod [ passt ] - ++ lib.optionals parseToYAML [ yq ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linuxMinimal ]; + # Tests + git + mercurial + jq + lsof + ] + ++ lib.optionals isLLVMOnly [ + rustc + cargo + rustPlatform.cargoSetupHook + ] + ++ lib.optionals isLegacyParser [ bison ] + ++ lib.optionals enableDocumentation [ + (lib.getBin lowdown-unsandboxed) + mdbook + mdbook-linkcheck + doxygen + ] + ++ lib.optionals (hasDtraceSupport && withDtrace) [ systemtap-sdt ] + ++ lib.optionals pastaFod [ passt ] + ++ lib.optionals parseToYAML [ yq ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linuxMinimal ]; - buildInputs = - [ - boost - brotli - bzip2 - curl - capnproto - editline - libsodium - openssl - sqlite - xz - gtest - libarchive - lowdown - rapidcheck - toml11 - ] - ++ lib.optionals hasExternalLixDoc [ lix-doc ] - ++ lib.optionals (!isLegacyParser) [ pegtl ] - # NOTE(Raito): I'd have expected that the LLVM packaging would inject the - # libunwind library path directly in the wrappers, but it does inject - # -lunwind without injecting the library path... - ++ lib.optionals stdenv.hostPlatform.isStatic [ llvmPackages.libunwind ] - ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ libcpuid ] - ++ lib.optionals withLibseccomp [ libseccomp ] - ++ lib.optionals withAWS [ aws-sdk-cpp ] - ++ lib.optionals (hasDtraceSupport && withDtrace) [ libsystemtap ]; + buildInputs = [ + boost + brotli + bzip2 + curl + capnproto + editline + libsodium + openssl + sqlite + xz + gtest + libarchive + lowdown + rapidcheck + toml11 + ] + ++ lib.optionals hasExternalLixDoc [ lix-doc ] + ++ lib.optionals (!isLegacyParser) [ pegtl ] + # NOTE(Raito): I'd have expected that the LLVM packaging would inject the + # libunwind library path directly in the wrappers, but it does inject + # -lunwind without injecting the library path... + ++ lib.optionals stdenv.hostPlatform.isStatic [ llvmPackages.libunwind ] + ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ libcpuid ] + ++ lib.optionals withLibseccomp [ libseccomp ] + ++ lib.optionals withAWS [ aws-sdk-cpp ] + ++ lib.optionals (hasDtraceSupport && withDtrace) [ libsystemtap ]; inherit cargoDeps; @@ -255,34 +252,33 @@ stdenv.mkDerivation (finalAttrs: { # We use -O2 upstream https://gerrit.lix.systems/c/lix/+/554 mesonBuildType = "debugoptimized"; - mesonFlags = - [ - # Enable LTO, since it improves eval performance a fair amount - # LTO is disabled on: - # - static builds (strange linkage errors) - # - darwin builds (install test failures. see fj#568 & fj#832) - (lib.mesonBool "b_lto" ( - !stdenv.hostPlatform.isStatic && !stdenv.hostPlatform.isDarwin && (isLLVMOnly || stdenv.cc.isGNU) - )) - (lib.mesonEnable "gc" true) - (lib.mesonBool "enable-tests" true) - (lib.mesonBool "enable-docs" enableDocumentation) - (lib.mesonEnable "internal-api-docs" enableDocumentation) - (lib.mesonBool "enable-embedded-sandbox-shell" ( - stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic - )) - (lib.mesonEnable "seccomp-sandboxing" withLibseccomp) + mesonFlags = [ + # Enable LTO, since it improves eval performance a fair amount + # LTO is disabled on: + # - static builds (strange linkage errors) + # - darwin builds (install test failures. see fj#568 & fj#832) + (lib.mesonBool "b_lto" ( + !stdenv.hostPlatform.isStatic && !stdenv.hostPlatform.isDarwin && (isLLVMOnly || stdenv.cc.isGNU) + )) + (lib.mesonEnable "gc" true) + (lib.mesonBool "enable-tests" true) + (lib.mesonBool "enable-docs" enableDocumentation) + (lib.mesonEnable "internal-api-docs" enableDocumentation) + (lib.mesonBool "enable-embedded-sandbox-shell" ( + stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic + )) + (lib.mesonEnable "seccomp-sandboxing" withLibseccomp) - (lib.mesonOption "store-dir" storeDir) - (lib.mesonOption "state-dir" stateDir) - (lib.mesonOption "sysconfdir" confDir) - ] - ++ lib.optionals hasDtraceSupport [ - (lib.mesonEnable "dtrace-probes" withDtrace) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - (lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") - ]; + (lib.mesonOption "store-dir" storeDir) + (lib.mesonOption "state-dir" stateDir) + (lib.mesonOption "sysconfdir" confDir) + ] + ++ lib.optionals hasDtraceSupport [ + (lib.mesonEnable "dtrace-probes" withDtrace) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + (lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") + ]; ninjaFlags = [ "-v" ]; @@ -352,14 +348,13 @@ stdenv.mkDerivation (finalAttrs: { meson test --no-rebuild "''${flagsArray[@]}" runHook postInstallCheck ''; - hardeningDisable = - [ - "shadowstack" - # strictoverflow is disabled because we trap on signed overflow instead - "strictoverflow" - ] - # fortify breaks the build with lto and musl for some reason - ++ lib.optional stdenv.hostPlatform.isMusl "fortify"; + hardeningDisable = [ + "shadowstack" + # strictoverflow is disabled because we trap on signed overflow instead + "strictoverflow" + ] + # fortify breaks the build with lto and musl for some reason + ++ lib.optional stdenv.hostPlatform.isMusl "fortify"; # hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ]; separateDebugInfo = stdenv.hostPlatform.isLinux && !enableStatic; diff --git a/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix b/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix index 07237c34ee3a..26fdc0e2706b 100644 --- a/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix +++ b/pkgs/tools/package-management/lix/common-nix-eval-jobs.nix @@ -25,22 +25,22 @@ stdenv.mkDerivation { version = "${version}${suffix}"; inherit src patches; sourceRoot = if lib.versionAtLeast version "2.93" then "source/subprojects/nix-eval-jobs" else null; - buildInputs = - [ - nlohmann_json - lix - boost - ] - ++ lib.optionals (lib.versionAtLeast version "2.93") [ - capnproto - ]; + buildInputs = [ + nlohmann_json + lix + boost + ] + ++ lib.optionals (lib.versionAtLeast version "2.93") [ + capnproto + ]; nativeBuildInputs = [ meson pkg-config ninja # nlohmann_json can be only discovered via cmake files cmake - ] ++ (lib.optional stdenv.cc.isClang [ buildPackages.clang-tools ]); + ] + ++ (lib.optional stdenv.cc.isClang [ buildPackages.clang-tools ]); # point 'nix edit' and ofborg at the file that defines the attribute, # not this common file. diff --git a/pkgs/tools/package-management/nix/common-autoconf.nix b/pkgs/tools/package-management/nix/common-autoconf.nix index a6e758467596..6f9b4fef5747 100644 --- a/pkgs/tools/package-management/nix/common-autoconf.nix +++ b/pkgs/tools/package-management/nix/common-autoconf.nix @@ -100,95 +100,92 @@ let inherit src patches; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals enableDocumentation [ - "man" - "doc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals enableDocumentation [ + "man" + "doc" + ]; hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ]; hardeningDisable = [ "shadowstack" - ] ++ lib.optional stdenv.hostPlatform.isMusl "fortify"; + ] + ++ lib.optional stdenv.hostPlatform.isMusl "fortify"; nativeInstallCheckInputs = lib.optionals atLeast224 [ git man ]; - nativeBuildInputs = - [ - pkg-config - autoconf-archive - autoreconfHook - bison - flex - jq - ] - ++ lib.optionals enableDocumentation ( - if atLeast224 then - [ - (lib.getBin lowdown-unsandboxed) - mdbook - mdbook-linkcheck - ] - else - [ - libxslt - libxml2 - docbook_xsl_ns - docbook5 - ] - ) - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linuxMinimal - ]; + nativeBuildInputs = [ + pkg-config + autoconf-archive + autoreconfHook + bison + flex + jq + ] + ++ lib.optionals enableDocumentation ( + if atLeast224 then + [ + (lib.getBin lowdown-unsandboxed) + mdbook + mdbook-linkcheck + ] + else + [ + libxslt + libxml2 + docbook_xsl_ns + docbook5 + ] + ) + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linuxMinimal + ]; - buildInputs = - [ - boost - brotli - bzip2 - curl - editline - libsodium - openssl - sqlite - xz - gtest - libarchive - lowdown - ] - ++ lib.optionals atLeast224 [ - libgit2 - toml11 - rapidcheck - ] - ++ lib.optionals (atLeast225 && enableDocumentation) [ - python3 - ] - ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ - libcpuid - ] - ++ lib.optionals withLibseccomp [ - libseccomp - ] - ++ lib.optionals withAWS [ - aws-sdk-cpp - ]; + buildInputs = [ + boost + brotli + bzip2 + curl + editline + libsodium + openssl + sqlite + xz + gtest + libarchive + lowdown + ] + ++ lib.optionals atLeast224 [ + libgit2 + toml11 + rapidcheck + ] + ++ lib.optionals (atLeast225 && enableDocumentation) [ + python3 + ] + ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ + libcpuid + ] + ++ lib.optionals withLibseccomp [ + libseccomp + ] + ++ lib.optionals withAWS [ + aws-sdk-cpp + ]; - propagatedBuildInputs = - [ - boehmgc - ] - ++ lib.optionals atLeast224 [ - nlohmann_json - ]; + propagatedBuildInputs = [ + boehmgc + ] + ++ lib.optionals atLeast224 [ + nlohmann_json + ]; postPatch = '' patchShebangs --build tests @@ -224,50 +221,48 @@ let mv tmp/config.nix.in corepkgs/config.nix.in ''; - configureFlags = - [ - "--with-store-dir=${storeDir}" - "--localstatedir=${stateDir}" - "--sysconfdir=${confDir}" - "--enable-gc" - ] - ++ lib.optionals (!enableDocumentation) [ - "--disable-doc-gen" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--with-sandbox-shell=${busybox-sandbox-shell}/bin/busybox" - ] - ++ lib.optionals (atLeast224 && stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) [ - "--enable-embedded-sandbox-shell" - ] - ++ - lib.optionals - ( - stdenv.hostPlatform != stdenv.buildPlatform - && stdenv.hostPlatform ? nix - && stdenv.hostPlatform.nix ? system - ) - [ - "--with-system=${stdenv.hostPlatform.nix.system}" - ] - ++ lib.optionals (!withLibseccomp) [ - # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 - "--disable-seccomp-sandboxing" - ] - ++ lib.optionals (atLeast224 && stdenv.cc.isGNU && !enableStatic) [ - "--enable-lto" - ]; + configureFlags = [ + "--with-store-dir=${storeDir}" + "--localstatedir=${stateDir}" + "--sysconfdir=${confDir}" + "--enable-gc" + ] + ++ lib.optionals (!enableDocumentation) [ + "--disable-doc-gen" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--with-sandbox-shell=${busybox-sandbox-shell}/bin/busybox" + ] + ++ lib.optionals (atLeast224 && stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) [ + "--enable-embedded-sandbox-shell" + ] + ++ + lib.optionals + ( + stdenv.hostPlatform != stdenv.buildPlatform + && stdenv.hostPlatform ? nix + && stdenv.hostPlatform.nix ? system + ) + [ + "--with-system=${stdenv.hostPlatform.nix.system}" + ] + ++ lib.optionals (!withLibseccomp) [ + # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 + "--disable-seccomp-sandboxing" + ] + ++ lib.optionals (atLeast224 && stdenv.cc.isGNU && !enableStatic) [ + "--enable-lto" + ]; - makeFlags = - [ - # gcc runs multi-threaded LTO using make and does not yet detect the new fifo:/path style - # of make jobserver. until gcc adds support for this we have to instruct make to use this - # old style or LTO builds will run their linking on only one thread, which takes forever. - "--jobserver-style=pipe" - "profiledir=$(out)/etc/profile.d" - ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "PRECOMPILE_HEADERS=0" - ++ lib.optional (stdenv.hostPlatform.isDarwin) "PRECOMPILE_HEADERS=1"; + makeFlags = [ + # gcc runs multi-threaded LTO using make and does not yet detect the new fifo:/path style + # of make jobserver. until gcc adds support for this we have to instruct make to use this + # old style or LTO builds will run their linking on only one thread, which takes forever. + "--jobserver-style=pipe" + "profiledir=$(out)/etc/profile.d" + ] + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "PRECOMPILE_HEADERS=0" + ++ lib.optional (stdenv.hostPlatform.isDarwin) "PRECOMPILE_HEADERS=1"; installFlags = [ "sysconfdir=$(out)/etc" ]; diff --git a/pkgs/tools/package-management/nix/common-meson.nix b/pkgs/tools/package-management/nix/common-meson.nix index 50e5c9fd060d..f41f9e986a29 100644 --- a/pkgs/tools/package-management/nix/common-meson.nix +++ b/pkgs/tools/package-management/nix/common-meson.nix @@ -91,78 +91,76 @@ stdenv.mkDerivation (finalAttrs: { inherit src patches; - outputs = - [ - "out" - "dev" - ] - ++ lib.optionals enableDocumentation [ - "man" - "doc" - ]; + outputs = [ + "out" + "dev" + ] + ++ lib.optionals enableDocumentation [ + "man" + "doc" + ]; hardeningEnable = lib.optionals (!stdenv.hostPlatform.isDarwin) [ "pie" ]; hardeningDisable = [ "shadowstack" - ] ++ lib.optional stdenv.hostPlatform.isMusl "fortify"; + ] + ++ lib.optional stdenv.hostPlatform.isMusl "fortify"; nativeCheckInputs = [ git man ]; - nativeBuildInputs = - [ - bison - cmake - flex - jq - meson - ninja - pkg-config - rsync - ] - ++ lib.optionals enableDocumentation [ - (lib.getBin lowdown-unsandboxed) - mdbook - mdbook-linkcheck - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - util-linuxMinimal - ] - ++ lib.optionals enableDocumentation [ - python3 - doxygen - ]; + nativeBuildInputs = [ + bison + cmake + flex + jq + meson + ninja + pkg-config + rsync + ] + ++ lib.optionals enableDocumentation [ + (lib.getBin lowdown-unsandboxed) + mdbook + mdbook-linkcheck + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + util-linuxMinimal + ] + ++ lib.optionals enableDocumentation [ + python3 + doxygen + ]; - buildInputs = - [ - boost - brotli - bzip2 - curl - editline - libgit2 - libsodium - lowdown - openssl - sqlite - toml11 - xz - ] - ++ lib.optionals (lib.versionAtLeast version "2.26") [ - libblake3 - ] - ++ lib.optionals stdenv.hostPlatform.isx86_64 [ - libcpuid - ] - ++ lib.optionals withLibseccomp [ - libseccomp - ] - ++ lib.optionals withAWS [ - aws-sdk-cpp - ]; + buildInputs = [ + boost + brotli + bzip2 + curl + editline + libgit2 + libsodium + lowdown + openssl + sqlite + toml11 + xz + ] + ++ lib.optionals (lib.versionAtLeast version "2.26") [ + libblake3 + ] + ++ lib.optionals stdenv.hostPlatform.isx86_64 [ + libcpuid + ] + ++ lib.optionals withLibseccomp [ + libseccomp + ] + ++ lib.optionals withAWS [ + aws-sdk-cpp + ]; propagatedBuildInputs = [ boehmgc @@ -194,28 +192,27 @@ stdenv.mkDerivation (finalAttrs: { dontUseCmakeConfigure = true; - mesonFlags = - [ - (lib.mesonBool "unit-tests" (stdenv.buildPlatform.canExecute stdenv.hostPlatform)) - (lib.mesonBool "bindings" false) - (lib.mesonOption "libstore:store-dir" storeDir) - (lib.mesonOption "libstore:localstatedir" stateDir) - (lib.mesonOption "libstore:sysconfdir" confDir) - (lib.mesonEnable "libutil:cpuid" stdenv.hostPlatform.isx86_64) - (lib.mesonEnable "libstore:seccomp-sandboxing" withLibseccomp) - (lib.mesonBool "libstore:embedded-sandbox-shell" ( - stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic - )) - (lib.mesonBool "doc-gen" enableDocumentation) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - (lib.mesonOption "libstore:sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") - # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 - ] - ++ lib.optionals (stdenv.cc.isGNU && !enableStatic) [ - # TODO: do we still need this? - # "--enable-lto" - ]; + mesonFlags = [ + (lib.mesonBool "unit-tests" (stdenv.buildPlatform.canExecute stdenv.hostPlatform)) + (lib.mesonBool "bindings" false) + (lib.mesonOption "libstore:store-dir" storeDir) + (lib.mesonOption "libstore:localstatedir" stateDir) + (lib.mesonOption "libstore:sysconfdir" confDir) + (lib.mesonEnable "libutil:cpuid" stdenv.hostPlatform.isx86_64) + (lib.mesonEnable "libstore:seccomp-sandboxing" withLibseccomp) + (lib.mesonBool "libstore:embedded-sandbox-shell" ( + stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic + )) + (lib.mesonBool "doc-gen" enableDocumentation) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + (lib.mesonOption "libstore:sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") + # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 + ] + ++ lib.optionals (stdenv.cc.isGNU && !enableStatic) [ + # TODO: do we still need this? + # "--enable-lto" + ]; doCheck = true; diff --git a/pkgs/tools/package-management/nix/dependencies.nix b/pkgs/tools/package-management/nix/dependencies.nix index a736181cf563..281b1f6c390c 100644 --- a/pkgs/tools/package-management/nix/dependencies.nix +++ b/pkgs/tools/package-management/nix/dependencies.nix @@ -29,39 +29,38 @@ regular@{ rev = version; hash = "sha256-Z1eRKW+8nVD53GkNyYlZjCcT74MqFqqRMeMc33eIQ9g="; }; - postPatch = - '' - # Avoid blanket -Werror to evade build failures on less - # tested compilers. - substituteInPlace cmake/compiler_settings.cmake \ - --replace '"-Werror"' ' ' + postPatch = '' + # Avoid blanket -Werror to evade build failures on less + # tested compilers. + substituteInPlace cmake/compiler_settings.cmake \ + --replace '"-Werror"' ' ' - # Missing includes for GCC11 - sed '5i#include ' -i \ - aws-cpp-sdk-cloudfront-integration-tests/CloudfrontOperationTest.cpp \ - aws-cpp-sdk-cognitoidentity-integration-tests/IdentityPoolOperationTest.cpp \ - aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp \ - aws-cpp-sdk-elasticfilesystem-integration-tests/ElasticFileSystemTest.cpp \ - aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp \ - aws-cpp-sdk-mediastore-data-integration-tests/MediaStoreDataTest.cpp \ - aws-cpp-sdk-queues/source/sqs/SQSQueue.cpp \ - aws-cpp-sdk-redshift-integration-tests/RedshiftClientTest.cpp \ - aws-cpp-sdk-s3-crt-integration-tests/BucketAndObjectOperationTest.cpp \ - aws-cpp-sdk-s3-integration-tests/BucketAndObjectOperationTest.cpp \ - aws-cpp-sdk-s3control-integration-tests/S3ControlTest.cpp \ - aws-cpp-sdk-sqs-integration-tests/QueueOperationTest.cpp \ - aws-cpp-sdk-transfer-tests/TransferTests.cpp - # Flaky on Hydra - rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp - # Includes aws-c-auth private headers, so only works with submodule build - rm aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp - # TestRandomURLMultiThreaded fails - rm aws-cpp-sdk-core-tests/http/HttpClientTest.cpp - '' - + lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 '' - # EPSILON is exceeded - rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp - ''; + # Missing includes for GCC11 + sed '5i#include ' -i \ + aws-cpp-sdk-cloudfront-integration-tests/CloudfrontOperationTest.cpp \ + aws-cpp-sdk-cognitoidentity-integration-tests/IdentityPoolOperationTest.cpp \ + aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp \ + aws-cpp-sdk-elasticfilesystem-integration-tests/ElasticFileSystemTest.cpp \ + aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp \ + aws-cpp-sdk-mediastore-data-integration-tests/MediaStoreDataTest.cpp \ + aws-cpp-sdk-queues/source/sqs/SQSQueue.cpp \ + aws-cpp-sdk-redshift-integration-tests/RedshiftClientTest.cpp \ + aws-cpp-sdk-s3-crt-integration-tests/BucketAndObjectOperationTest.cpp \ + aws-cpp-sdk-s3-integration-tests/BucketAndObjectOperationTest.cpp \ + aws-cpp-sdk-s3control-integration-tests/S3ControlTest.cpp \ + aws-cpp-sdk-sqs-integration-tests/QueueOperationTest.cpp \ + aws-cpp-sdk-transfer-tests/TransferTests.cpp + # Flaky on Hydra + rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp + # Includes aws-c-auth private headers, so only works with submodule build + rm aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp + # TestRandomURLMultiThreaded fails + rm aws-cpp-sdk-core-tests/http/HttpClientTest.cpp + '' + + lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 '' + # EPSILON is exceeded + rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp + ''; patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ]; diff --git a/pkgs/tools/package-management/nix/modular/packaging/components.nix b/pkgs/tools/package-management/nix/modular/packaging/components.nix index 144f75a61331..3ce3f2938d89 100644 --- a/pkgs/tools/package-management/nix/modular/packaging/components.nix +++ b/pkgs/tools/package-management/nix/modular/packaging/components.nix @@ -44,12 +44,12 @@ let preConfigure = prevAttrs.preConfigure or "" + - # Update the repo-global .version file. - # Symlink ./.version points there, but by default only workDir is writable. - '' - chmod u+w ./.version - echo ${finalAttrs.version} > ./.version - ''; + # Update the repo-global .version file. + # Symlink ./.version points there, but by default only workDir is writable. + '' + chmod u+w ./.version + echo ${finalAttrs.version} > ./.version + ''; }; localSourceLayer = @@ -138,7 +138,8 @@ let nativeBuildInputs = [ meson ninja - ] ++ prevAttrs.nativeBuildInputs or [ ]; + ] + ++ prevAttrs.nativeBuildInputs or [ ]; mesonCheckFlags = prevAttrs.mesonCheckFlags or [ ] ++ [ "--print-errorlogs" ]; diff --git a/pkgs/tools/package-management/nix/modular/packaging/everything.nix b/pkgs/tools/package-management/nix/modular/packaging/everything.nix index 9582c12fbb18..f648507b5a31 100644 --- a/pkgs/tools/package-management/nix/modular/packaging/everything.nix +++ b/pkgs/tools/package-management/nix/modular/packaging/everything.nix @@ -50,37 +50,36 @@ }: let - libs = - { - inherit - nix-util - nix-util-c - nix-store - nix-store-c - nix-fetchers - nix-expr - nix-expr-c - nix-flake - nix-flake-c - nix-main - nix-main-c - nix-cmd - ; - } - // lib.optionalAttrs (lib.versionAtLeast version "2.29pre") { - inherit - nix-fetchers-c - ; - } - // - lib.optionalAttrs - (!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform) - { - # Currently fails in static build - inherit - nix-perl-bindings - ; - }; + libs = { + inherit + nix-util + nix-util-c + nix-store + nix-store-c + nix-fetchers + nix-expr + nix-expr-c + nix-flake + nix-flake-c + nix-main + nix-main-c + nix-cmd + ; + } + // lib.optionalAttrs (lib.versionAtLeast version "2.29pre") { + inherit + nix-fetchers-c + ; + } + // + lib.optionalAttrs + (!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform) + { + # Currently fails in static build + inherit + nix-perl-bindings + ; + }; devdoc = buildEnv { name = "nix-${nix-cli.version}-devdoc"; @@ -135,20 +134,19 @@ stdenv.mkDerivation (finalAttrs: { */ dontFixup = true; - checkInputs = - [ - # Make sure the unit tests have passed - nix-util-tests.tests.run - nix-store-tests.tests.run - nix-expr-tests.tests.run - nix-fetchers-tests.tests.run - nix-flake-tests.tests.run + checkInputs = [ + # Make sure the unit tests have passed + nix-util-tests.tests.run + nix-store-tests.tests.run + nix-expr-tests.tests.run + nix-fetchers-tests.tests.run + nix-flake-tests.tests.run - # Make sure the functional tests have passed - nix-functional-tests - ] - ++ lib.optionals - (!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform) + # Make sure the functional tests have passed + nix-functional-tests + ] + ++ + lib.optionals (!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ # Perl currently fails in static build # TODO: Split out tests into a separate derivation? @@ -236,26 +234,25 @@ stdenv.mkDerivation (finalAttrs: { "out" "man" ]; - pkgConfigModules = - [ - "nix-cmd" - "nix-expr" - "nix-expr-c" - "nix-fetchers" - ] - ++ lib.optionals (lib.versionAtLeast version "2.29pre") [ - "nix-fetchers-c" - ] - ++ [ - "nix-flake" - "nix-flake-c" - "nix-main" - "nix-main-c" - "nix-store" - "nix-store-c" - "nix-util" - "nix-util-c" - ]; + pkgConfigModules = [ + "nix-cmd" + "nix-expr" + "nix-expr-c" + "nix-fetchers" + ] + ++ lib.optionals (lib.versionAtLeast version "2.29pre") [ + "nix-fetchers-c" + ] + ++ [ + "nix-flake" + "nix-flake-c" + "nix-main" + "nix-main-c" + "nix-store" + "nix-store-c" + "nix-util" + "nix-util-c" + ]; }; }) diff --git a/pkgs/tools/package-management/nix/modular/src/libcmd/package.nix b/pkgs/tools/package-management/nix/modular/src/libcmd/package.nix index f0ad6d0f5012..ad596ad6f518 100644 --- a/pkgs/tools/package-management/nix/modular/src/libcmd/package.nix +++ b/pkgs/tools/package-management/nix/modular/src/libcmd/package.nix @@ -38,7 +38,8 @@ mkMesonLibrary (finalAttrs: { buildInputs = [ ({ inherit editline readline; }.${readlineFlavor}) - ] ++ lib.optional enableMarkdown lowdown; + ] + ++ lib.optional enableMarkdown lowdown; propagatedBuildInputs = [ nix-util diff --git a/pkgs/tools/package-management/nix/modular/src/libexpr/package.nix b/pkgs/tools/package-management/nix/modular/src/libexpr/package.nix index d4cc448a07f5..44fc5b105d8c 100644 --- a/pkgs/tools/package-management/nix/modular/src/libexpr/package.nix +++ b/pkgs/tools/package-management/nix/modular/src/libexpr/package.nix @@ -51,13 +51,15 @@ mkMesonLibrary (finalAttrs: { nix-util nix-store nix-fetchers - ] ++ finalAttrs.passthru.externalPropagatedBuildInputs; + ] + ++ finalAttrs.passthru.externalPropagatedBuildInputs; # Hack for sake of the dev shell passthru.externalPropagatedBuildInputs = [ boost nlohmann_json - ] ++ lib.optional enableGC boehmgc; + ] + ++ lib.optional enableGC boehmgc; mesonFlags = [ (lib.mesonEnable "gc" enableGC) diff --git a/pkgs/tools/package-management/nix/modular/src/libfetchers-tests/package.nix b/pkgs/tools/package-management/nix/modular/src/libfetchers-tests/package.nix index 54766cc52010..132e4c1da99b 100644 --- a/pkgs/tools/package-management/nix/modular/src/libfetchers-tests/package.nix +++ b/pkgs/tools/package-management/nix/modular/src/libfetchers-tests/package.nix @@ -25,19 +25,18 @@ mkMesonExecutable (finalAttrs: { workDir = ./.; - buildInputs = - [ - nix-fetchers - nix-store-test-support - rapidcheck - gtest - ] - ++ lib.optionals (lib.versionAtLeast version "2.29pre") [ - nix-fetchers-c - ] - ++ lib.optionals (lib.versionAtLeast version "2.27") [ - libgit2 - ]; + buildInputs = [ + nix-fetchers + nix-store-test-support + rapidcheck + gtest + ] + ++ lib.optionals (lib.versionAtLeast version "2.29pre") [ + nix-fetchers-c + ] + ++ lib.optionals (lib.versionAtLeast version "2.27") [ + libgit2 + ]; mesonFlags = [ ]; diff --git a/pkgs/tools/package-management/nix/modular/src/libflake-c/package.nix b/pkgs/tools/package-management/nix/modular/src/libflake-c/package.nix index e2d54f827ef8..bbea479049c0 100644 --- a/pkgs/tools/package-management/nix/modular/src/libflake-c/package.nix +++ b/pkgs/tools/package-management/nix/modular/src/libflake-c/package.nix @@ -18,17 +18,16 @@ mkMesonLibrary (finalAttrs: { workDir = ./.; - propagatedBuildInputs = - [ - nix-expr-c - nix-store-c - ] - ++ lib.optionals (lib.versionAtLeast version "2.29pre") [ - nix-fetchers-c - ] - ++ [ - nix-flake - ]; + propagatedBuildInputs = [ + nix-expr-c + nix-store-c + ] + ++ lib.optionals (lib.versionAtLeast version "2.29pre") [ + nix-fetchers-c + ] + ++ [ + nix-flake + ]; mesonFlags = [ ]; diff --git a/pkgs/tools/package-management/nix/modular/src/libstore/package.nix b/pkgs/tools/package-management/nix/modular/src/libstore/package.nix index e08658a32761..988ed8d23370 100644 --- a/pkgs/tools/package-management/nix/modular/src/libstore/package.nix +++ b/pkgs/tools/package-management/nix/modular/src/libstore/package.nix @@ -30,31 +30,29 @@ mkMesonLibrary (finalAttrs: { nativeBuildInputs = lib.optional embeddedSandboxShell unixtools.hexdump; - buildInputs = - [ - boost - curl - sqlite - ] - ++ lib.optional stdenv.hostPlatform.isLinux libseccomp - # There have been issues building these dependencies - ++ lib.optional ( - stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin) - ) aws-sdk-cpp; + buildInputs = [ + boost + curl + sqlite + ] + ++ lib.optional stdenv.hostPlatform.isLinux libseccomp + # There have been issues building these dependencies + ++ lib.optional ( + stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin) + ) aws-sdk-cpp; propagatedBuildInputs = [ nix-util nlohmann_json ]; - mesonFlags = - [ - (lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux) - (lib.mesonBool "embedded-sandbox-shell" embeddedSandboxShell) - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - (lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") - ]; + mesonFlags = [ + (lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux) + (lib.mesonBool "embedded-sandbox-shell" embeddedSandboxShell) + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + (lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox") + ]; meta = { platforms = lib.platforms.unix ++ lib.platforms.windows; diff --git a/pkgs/tools/package-management/nix/modular/src/libutil/package.nix b/pkgs/tools/package-management/nix/modular/src/libutil/package.nix index c4d2aefd6a39..4be08b14bf60 100644 --- a/pkgs/tools/package-management/nix/modular/src/libutil/package.nix +++ b/pkgs/tools/package-management/nix/modular/src/libutil/package.nix @@ -23,16 +23,15 @@ mkMesonLibrary (finalAttrs: { workDir = ./.; - buildInputs = - [ - brotli - ] - ++ lib.optional (lib.versionAtLeast version "2.27") libblake3 - ++ [ - libsodium - openssl - ] - ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid; + buildInputs = [ + brotli + ] + ++ lib.optional (lib.versionAtLeast version "2.27") libblake3 + ++ [ + libsodium + openssl + ] + ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid; propagatedBuildInputs = [ boost diff --git a/pkgs/tools/package-management/nix/modular/src/perl/package.nix b/pkgs/tools/package-management/nix/modular/src/perl/package.nix index 5c788ccdd8cd..f425146fbe33 100644 --- a/pkgs/tools/package-management/nix/modular/src/perl/package.nix +++ b/pkgs/tools/package-management/nix/modular/src/perl/package.nix @@ -27,7 +27,8 @@ perl.pkgs.toPerlModule ( buildInputs = [ nix-store - ] ++ finalAttrs.passthru.externalBuildInputs; + ] + ++ finalAttrs.passthru.externalBuildInputs; # Hack for sake of the dev shell passthru.externalBuildInputs = [ diff --git a/pkgs/tools/package-management/nix/modular/tests/functional/package.nix b/pkgs/tools/package-management/nix/modular/tests/functional/package.nix index 333149208c21..c6963ba3298a 100644 --- a/pkgs/tools/package-management/nix/modular/tests/functional/package.nix +++ b/pkgs/tools/package-management/nix/modular/tests/functional/package.nix @@ -35,25 +35,24 @@ mkMesonDerivation ( workDir = ./.; # Hack for sake of the dev shell - passthru.externalNativeBuildInputs = - [ - meson - ninja - pkg-config + passthru.externalNativeBuildInputs = [ + meson + ninja + pkg-config - jq - git - mercurial - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - # For various sandboxing tests that needs a statically-linked shell, - # etc. - busybox-sandbox-shell - # For Overlay FS tests need `mount`, `umount`, and `unshare`. - # For `script` command (ensuring a TTY) - # TODO use `unixtools` to be precise over which executables instead? - util-linux - ]; + jq + git + mercurial + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + # For various sandboxing tests that needs a statically-linked shell, + # etc. + busybox-sandbox-shell + # For Overlay FS tests need `mount`, `umount`, and `unshare`. + # For `script` command (ensuring a TTY) + # TODO use `unixtools` to be precise over which executables instead? + util-linux + ]; nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [ nix-cli diff --git a/pkgs/tools/package-management/nix/nix-perl.nix b/pkgs/tools/package-management/nix/nix-perl.nix index 38478c79c0d7..828255f5453a 100644 --- a/pkgs/tools/package-management/nix/nix-perl.nix +++ b/pkgs/tools/package-management/nix/nix-perl.nix @@ -54,29 +54,29 @@ stdenv.mkDerivation (finalAttrs: { nix perl xz - ] ++ lib.optional atLeast226 libarchive; + ] + ++ lib.optional atLeast226 libarchive; # Not cross-safe since Nix checks for curl/perl via # NEED_PROG/find_program, but both seem to be needed at runtime # as well. - nativeBuildInputs = - [ - pkg-config - perl - curl - ] - ++ ( - if atLeast223 then - [ - meson - ninja - ] - else - [ - autoconf-archive - autoreconfHook - ] - ); + nativeBuildInputs = [ + pkg-config + perl + curl + ] + ++ ( + if atLeast223 then + [ + meson + ninja + ] + else + [ + autoconf-archive + autoreconfHook + ] + ); # `perlPackages.Test2Harness` is marked broken for Darwin doCheck = !stdenv.hostPlatform.isDarwin; @@ -85,22 +85,21 @@ stdenv.mkDerivation (finalAttrs: { perl.pkgs.Test2Harness ]; - ${if atLeast223 then "mesonFlags" else "configureFlags"} = - [ - (mkConfigureOption { - mesonOption = "dbi_path"; - autoconfOption = "dbi"; - value = "${perl.pkgs.DBI}/${perl.libPrefix}"; - }) - (mkConfigureOption { - mesonOption = "dbd_sqlite_path"; - autoconfOption = "dbd-sqlite"; - value = "${perl.pkgs.DBDSQLite}/${perl.libPrefix}"; - }) - ] - ++ lib.optionals atLeast223 [ - (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) - ]; + ${if atLeast223 then "mesonFlags" else "configureFlags"} = [ + (mkConfigureOption { + mesonOption = "dbi_path"; + autoconfOption = "dbi"; + value = "${perl.pkgs.DBI}/${perl.libPrefix}"; + }) + (mkConfigureOption { + mesonOption = "dbd_sqlite_path"; + autoconfOption = "dbd-sqlite"; + value = "${perl.pkgs.DBDSQLite}/${perl.libPrefix}"; + }) + ] + ++ lib.optionals atLeast223 [ + (lib.mesonEnable "tests" finalAttrs.finalPackage.doCheck) + ]; preConfigure = "export NIX_STATE_DIR=$TMPDIR"; diff --git a/pkgs/tools/package-management/packagekit/default.nix b/pkgs/tools/package-management/packagekit/default.nix index 628f1ab65155..379ca62ac758 100644 --- a/pkgs/tools/package-management/packagekit/default.nix +++ b/pkgs/tools/package-management/packagekit/default.nix @@ -45,19 +45,18 @@ stdenv.mkDerivation rec { hash = "sha256-8sgvD6pZ2n4Du44kTPsvYtSYpkMKCpfxeSrGjWeSw50="; }; - buildInputs = - [ - glib - polkit - python3 - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gtk3 - sqlite - boost - ] - ++ lib.optional enableSystemd systemd - ++ lib.optional enableBashCompletion bash-completion; + buildInputs = [ + glib + polkit + python3 + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gtk3 + sqlite + boost + ] + ++ lib.optional enableSystemd systemd + ++ lib.optional enableBashCompletion bash-completion; nativeBuildInputs = [ gobject-introspection glib @@ -73,23 +72,22 @@ stdenv.mkDerivation rec { ninja ]; - mesonFlags = - [ - (if enableSystemd then "-Dsystemd=true" else "-Dsystem=false") - # often fails to build with nix updates - # and remounts /nix/store as rw - # https://github.com/NixOS/nixpkgs/issues/177946 - #"-Dpackaging_backend=nix" - "-Ddbus_sys=${placeholder "out"}/share/dbus-1/system.d" - "-Ddbus_services=${placeholder "out"}/share/dbus-1/system-services" - "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - "-Dcron=false" - "-Dgtk_doc=true" - "--sysconfdir=/etc" - "--localstatedir=/var" - ] - ++ lib.optional (!enableBashCompletion) "-Dbash_completion=false" - ++ lib.optional (!enableCommandNotFound) "-Dbash_command_not_found=false"; + mesonFlags = [ + (if enableSystemd then "-Dsystemd=true" else "-Dsystem=false") + # often fails to build with nix updates + # and remounts /nix/store as rw + # https://github.com/NixOS/nixpkgs/issues/177946 + #"-Dpackaging_backend=nix" + "-Ddbus_sys=${placeholder "out"}/share/dbus-1/system.d" + "-Ddbus_services=${placeholder "out"}/share/dbus-1/system-services" + "-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + "-Dcron=false" + "-Dgtk_doc=true" + "--sysconfdir=/etc" + "--localstatedir=/var" + ] + ++ lib.optional (!enableBashCompletion) "-Dbash_completion=false" + ++ lib.optional (!enableCommandNotFound) "-Dbash_command_not_found=false"; postPatch = '' # HACK: we want packagekit to look in /etc for configs but install diff --git a/pkgs/tools/package-management/protontricks/default.nix b/pkgs/tools/package-management/protontricks/default.nix index 2326c6948dab..fc209fc9b1bf 100644 --- a/pkgs/tools/package-management/protontricks/default.nix +++ b/pkgs/tools/package-management/protontricks/default.nix @@ -54,18 +54,17 @@ buildPythonApplication rec { pillow ]; - makeWrapperArgs = - [ - "--prefix PATH : ${ - lib.makeBinPath [ - winetricks - yad - ] - }" - # Steam Runtime does not work outside of steam-run, so don't use it - "--set STEAM_RUNTIME 0" - ] - ++ lib.optional (extraCompatPaths != "") "--set STEAM_EXTRA_COMPAT_TOOLS_PATHS ${extraCompatPaths}"; + makeWrapperArgs = [ + "--prefix PATH : ${ + lib.makeBinPath [ + winetricks + yad + ] + }" + # Steam Runtime does not work outside of steam-run, so don't use it + "--set STEAM_RUNTIME 0" + ] + ++ lib.optional (extraCompatPaths != "") "--set STEAM_EXTRA_COMPAT_TOOLS_PATHS ${extraCompatPaths}"; nativeCheckInputs = [ pytestCheckHook ]; diff --git a/pkgs/tools/package-management/rpm/default.nix b/pkgs/tools/package-management/rpm/default.nix index 4cd1d518868e..94ac9d77b37d 100644 --- a/pkgs/tools/package-management/rpm/default.nix +++ b/pkgs/tools/package-management/rpm/default.nix @@ -44,25 +44,23 @@ stdenv.mkDerivation rec { hash = "sha256-UmR+EmODZFM6tnHLyOSFyW+fCIidk/4O0QSmYyZhEk8="; }; - postPatch = - '' - sed -i 's#''${Python3_SITEARCH}#${placeholder "out"}/${python3.sitePackages}#' python/CMakeLists.txt - sed -i 's#PATHS ENV MYPATH#PATHS ENV PATH#' CMakeLists.txt - '' - # clang: error: unknown argument: '-fhardened' - + lib.optionalString stdenv.cc.isClang '' - substituteInPlace CMakeLists.txt \ - --replace-fail "-fhardened" "" - ''; + postPatch = '' + sed -i 's#''${Python3_SITEARCH}#${placeholder "out"}/${python3.sitePackages}#' python/CMakeLists.txt + sed -i 's#PATHS ENV MYPATH#PATHS ENV PATH#' CMakeLists.txt + '' + # clang: error: unknown argument: '-fhardened' + + lib.optionalString stdenv.cc.isClang '' + substituteInPlace CMakeLists.txt \ + --replace-fail "-fhardened" "" + ''; - outputs = - [ - "out" - "man" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "dev" - ]; + outputs = [ + "out" + "man" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "dev" + ]; separateDebugInfo = true; nativeBuildInputs = [ @@ -71,68 +69,68 @@ stdenv.mkDerivation rec { autoconf python3 gettext - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ bubblewrap ]; - buildInputs = - [ - bzip2 - zlib - zstd - file - libarchive - xz - lua - sqlite - openssl - readline - rpm-sequoia - gnupg - ] - ++ lib.optional stdenv.cc.isClang llvmPackages.openmp - ++ lib.optionals stdenv.hostPlatform.isLinux [ - libcap - audit - systemd - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - apple-sdk_13 - (darwinMinVersionHook "13.0") - ]; + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ bubblewrap ]; + buildInputs = [ + bzip2 + zlib + zstd + file + libarchive + xz + lua + sqlite + openssl + readline + rpm-sequoia + gnupg + ] + ++ lib.optional stdenv.cc.isClang llvmPackages.openmp + ++ lib.optionals stdenv.hostPlatform.isLinux [ + libcap + audit + systemd + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + apple-sdk_13 + (darwinMinVersionHook "13.0") + ]; patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./sighandler_t-macos.patch ]; - cmakeFlags = - [ - "-DWITH_DBUS=OFF" - # libselinux is missing propagatedBuildInputs - "-DWITH_SELINUX=OFF" + cmakeFlags = [ + "-DWITH_DBUS=OFF" + # libselinux is missing propagatedBuildInputs + "-DWITH_SELINUX=OFF" - "-DCMAKE_INSTALL_LOCALSTATEDIR=/var" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-DMKTREE_BACKEND=rootfs" - ] - ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ - # Test suite rely on either podman or bubblewrap - "-DENABLE_TESTSUITE=OFF" + "-DCMAKE_INSTALL_LOCALSTATEDIR=/var" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "-DMKTREE_BACKEND=rootfs" + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + # Test suite rely on either podman or bubblewrap + "-DENABLE_TESTSUITE=OFF" - "-DWITH_CAP=OFF" - "-DWITH_AUDIT=OFF" - "-DWITH_ACL=OFF" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DWITH_LIBELF=OFF" - "-DWITH_LIBDW=OFF" - ] - ++ lib.optionals disableUnshare [ - "-DHAVE_UNSHARE=OFF" - ]; + "-DWITH_CAP=OFF" + "-DWITH_AUDIT=OFF" + "-DWITH_ACL=OFF" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "-DWITH_LIBELF=OFF" + "-DWITH_LIBDW=OFF" + ] + ++ lib.optionals disableUnshare [ + "-DHAVE_UNSHARE=OFF" + ]; # rpm/rpmlib.h includes popt.h, and then the pkg-config file mentions these as linkage requirements propagatedBuildInputs = [ popt - ] ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform elfutils) elfutils; + ] + ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform elfutils) elfutils; enableParallelBuilding = true; diff --git a/pkgs/tools/security/aflplusplus/default.nix b/pkgs/tools/security/aflplusplus/default.nix index 6d5db8f1061b..456cc84efbaa 100644 --- a/pkgs/tools/security/aflplusplus/default.nix +++ b/pkgs/tools/security/aflplusplus/default.nix @@ -61,7 +61,8 @@ let python3 gmp llvmPackages.bintools - ] ++ lib.optional (wine != null) python3.pkgs.wrapPython; + ] + ++ lib.optional (wine != null) python3.pkgs.wrapPython; # Flag is already set by package and causes some compiler warnings. # warning: "_FORTIFY_SOURCE" redefined @@ -115,50 +116,49 @@ let runHook postBuild ''; - postInstall = - '' - # remove afl-clang(++) which are just symlinks to afl-clang-fast - rm $out/bin/afl-clang $out/bin/afl-clang++ + postInstall = '' + # remove afl-clang(++) which are just symlinks to afl-clang-fast + rm $out/bin/afl-clang $out/bin/afl-clang++ - # the makefile neglects to install unsigaction - cp qemu_mode/unsigaction/unsigaction*.so $out/lib/afl/ + # the makefile neglects to install unsigaction + cp qemu_mode/unsigaction/unsigaction*.so $out/lib/afl/ - # Install the custom QEMU emulator for binary blob fuzzing. - ln -s ${aflplusplus-qemu}/bin/${qemu-exe-name} $out/bin/afl-qemu-trace + # Install the custom QEMU emulator for binary blob fuzzing. + ln -s ${aflplusplus-qemu}/bin/${qemu-exe-name} $out/bin/afl-qemu-trace - # give user a convenient way of accessing libcompconv.so, libdislocator.so, libtokencap.so - cat > $out/bin/get-afl-qemu-libcompcov-so < $out/bin/get-afl-qemu-libcompcov-so < env.NIX_CFLAGS_COMPILE = lib.optionalString needDrm "-isystem ${lib.getDev libdrm}/include/libdrm"; diff --git a/pkgs/tools/system/plan9port/default.nix b/pkgs/tools/system/plan9port/default.nix index 8887d0623776..99152ddc974a 100644 --- a/pkgs/tools/system/plan9port/default.nix +++ b/pkgs/tools/system/plan9port/default.nix @@ -44,26 +44,25 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ ed ]; - buildInputs = - [ - perl - which - ] - ++ ( - if !stdenv.hostPlatform.isDarwin then - [ - fontconfig - freetype # fontsrv uses these - libX11 - libXext - libXt - xorgproto - ] - else - [ - DarwinTools - ] - ); + buildInputs = [ + perl + which + ] + ++ ( + if !stdenv.hostPlatform.isDarwin then + [ + fontconfig + freetype # fontsrv uses these + libX11 + libXext + libXt + xorgproto + ] + else + [ + DarwinTools + ] + ); configurePhase = '' runHook preConfigure diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix index 981d68a5153f..6973094b569b 100644 --- a/pkgs/tools/system/rsyslog/default.nix +++ b/pkgs/tools/system/rsyslog/default.nix @@ -75,37 +75,36 @@ stdenv.mkDerivation rec { docutils ]; - buildInputs = - [ - fastJson - libestr - json_c - zlib - ] - ++ lib.optional withKrb5 libkrb5 - ++ lib.optional withJemalloc jemalloc - ++ lib.optional withPostgres libpq - ++ lib.optional withDbi libdbi - ++ lib.optional withNetSnmp net-snmp - ++ lib.optional withUuid libuuid - ++ lib.optional withCurl curl - ++ lib.optional withGnutls gnutls - ++ lib.optional withGcrypt libgcrypt - ++ lib.optional withLognorm liblognorm - ++ lib.optional withOpenssl openssl - ++ lib.optional withRelp librelp - ++ lib.optional withKsi libksi - ++ lib.optional withLogging liblogging - ++ lib.optional withNet libnet - ++ lib.optional withHadoop hadoop - ++ lib.optional withRdkafka rdkafka - ++ lib.optionals withMongo [ mongoc ] - ++ lib.optional withCzmq czmq - ++ lib.optional withRabbitmq rabbitmq-c - ++ lib.optional withHiredis hiredis - ++ lib.optional withMaxminddb libmaxminddb - ++ lib.optional withMysql libmysqlclient - ++ lib.optional withSystemd systemd; + buildInputs = [ + fastJson + libestr + json_c + zlib + ] + ++ lib.optional withKrb5 libkrb5 + ++ lib.optional withJemalloc jemalloc + ++ lib.optional withPostgres libpq + ++ lib.optional withDbi libdbi + ++ lib.optional withNetSnmp net-snmp + ++ lib.optional withUuid libuuid + ++ lib.optional withCurl curl + ++ lib.optional withGnutls gnutls + ++ lib.optional withGcrypt libgcrypt + ++ lib.optional withLognorm liblognorm + ++ lib.optional withOpenssl openssl + ++ lib.optional withRelp librelp + ++ lib.optional withKsi libksi + ++ lib.optional withLogging liblogging + ++ lib.optional withNet libnet + ++ lib.optional withHadoop hadoop + ++ lib.optional withRdkafka rdkafka + ++ lib.optionals withMongo [ mongoc ] + ++ lib.optional withCzmq czmq + ++ lib.optional withRabbitmq rabbitmq-c + ++ lib.optional withHiredis hiredis + ++ lib.optional withMaxminddb libmaxminddb + ++ lib.optional withMysql libmysqlclient + ++ lib.optional withSystemd systemd; configureFlags = [ "--sysconfdir=/etc" diff --git a/pkgs/tools/system/testdisk/default.nix b/pkgs/tools/system/testdisk/default.nix index 810d6a8cf7f2..ff23b602c00d 100644 --- a/pkgs/tools/system/testdisk/default.nix +++ b/pkgs/tools/system/testdisk/default.nix @@ -44,21 +44,20 @@ assert enableQt -> qwt != null; enableParallelBuilding = true; - buildInputs = - [ - ncurses - libuuid - libjpeg - zlib - libewf - ] - ++ lib.optional enableNtfs ntfs3g - ++ lib.optional enableExtFs e2fsprogs - ++ lib.optionals enableQt [ - qtbase - qttools - qwt - ]; + buildInputs = [ + ncurses + libuuid + libjpeg + zlib + libewf + ] + ++ lib.optional enableNtfs ntfs3g + ++ lib.optional enableExtFs e2fsprogs + ++ lib.optionals enableQt [ + qtbase + qttools + qwt + ]; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index d8247d6b69ca..6bc745fe88b7 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -42,22 +42,22 @@ stdenv.mkDerivation rec { outputs = [ "out" "info" - ] ++ lib.optional (!interactive) "man"; + ] + ++ lib.optional (!interactive) "man"; strictDeps = true; # no-pma fix - nativeBuildInputs = - [ - autoreconfHook - texinfo - ] - ++ lib.optionals interactive [ - removeReferencesTo - ] - ++ lib.optionals (doCheck && stdenv.hostPlatform.isLinux) [ - glibcLocales - ]; + nativeBuildInputs = [ + autoreconfHook + texinfo + ] + ++ lib.optionals interactive [ + removeReferencesTo + ] + ++ lib.optionals (doCheck && stdenv.hostPlatform.isLinux) [ + glibcLocales + ]; buildInputs = lib.optionals interactive [ diff --git a/pkgs/tools/text/gawk/gawkextlib.nix b/pkgs/tools/text/gawk/gawkextlib.nix index 93b189e5c53d..abea3e32a139 100644 --- a/pkgs/tools/text/gawk/gawkextlib.nix +++ b/pkgs/tools/text/gawk/gawkextlib.nix @@ -53,11 +53,10 @@ let inherit patches; - postPatch = - '' - cd ${name} - '' - + extraPostPatch; + postPatch = '' + cd ${name} + '' + + extraPostPatch; nativeBuildInputs = [ autoconf @@ -95,7 +94,8 @@ let license = lib.licenses.gpl3Plus; platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ tomberek ]; - } // lib.optionalAttrs (broken != null) { inherit broken; }; + } + // lib.optionalAttrs (broken != null) { inherit broken; }; } ); gawkextlib = buildExtension { diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index d4bb7bd9d23e..c3df46d623d9 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -52,7 +52,8 @@ stdenv.mkDerivation { buildInputs = [ pcre2 libiconv - ] ++ lib.optional (!stdenv.hostPlatform.isWindows) runtimeShellPackage; + ] + ++ lib.optional (!stdenv.hostPlatform.isWindows) runtimeShellPackage; # cygwin: FAIL: multibyte-white-space # freebsd: FAIL mb-non-UTF8-performance diff --git a/pkgs/tools/text/highlight/default.nix b/pkgs/tools/text/highlight/default.nix index 12606328e441..e63584274cff 100644 --- a/pkgs/tools/text/highlight/default.nix +++ b/pkgs/tools/text/highlight/default.nix @@ -30,7 +30,8 @@ let pkg-config swig perl - ] ++ lib.optional stdenv.hostPlatform.isDarwin gcc; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin gcc; buildInputs = [ getopt @@ -39,17 +40,16 @@ let libxcrypt ]; - postPatch = - '' - substituteInPlace src/makefile \ - --replace "shell pkg-config" "shell $PKG_CONFIG" - substituteInPlace makefile \ - --replace 'gzip' 'gzip -n' - '' - + lib.optionalString stdenv.cc.isClang '' - substituteInPlace src/makefile \ - --replace 'CXX=g++' 'CXX=clang++' - ''; + postPatch = '' + substituteInPlace src/makefile \ + --replace "shell pkg-config" "shell $PKG_CONFIG" + substituteInPlace makefile \ + --replace 'gzip' 'gzip -n' + '' + + lib.optionalString stdenv.cc.isClang '' + substituteInPlace src/makefile \ + --replace 'CXX=g++' 'CXX=clang++' + ''; preConfigure = '' makeFlags="PREFIX=$out conf_dir=$out/etc/highlight/ CXX=$CXX AR=$AR" diff --git a/pkgs/tools/text/mdcat/default.nix b/pkgs/tools/text/mdcat/default.nix index 75f05104bd6e..e600f1aa06d4 100644 --- a/pkgs/tools/text/mdcat/default.nix +++ b/pkgs/tools/text/mdcat/default.nix @@ -48,19 +48,18 @@ rustPlatform.buildRustPackage rec { "--skip iterm2_tests_render_md_samples_images_md" ]; - postInstall = - '' - installManPage $releaseDir/build/mdcat-*/out/mdcat.1 - ln -sr $out/bin/{mdcat,mdless} - '' - + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - for bin in mdcat mdless; do - installShellCompletion --cmd $bin \ - --bash <($out/bin/$bin --completions bash) \ - --fish <($out/bin/$bin --completions fish) \ - --zsh <($out/bin/$bin --completions zsh) - done - ''; + postInstall = '' + installManPage $releaseDir/build/mdcat-*/out/mdcat.1 + ln -sr $out/bin/{mdcat,mdless} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for bin in mdcat mdless; do + installShellCompletion --cmd $bin \ + --bash <($out/bin/$bin --completions bash) \ + --fish <($out/bin/$bin --completions fish) \ + --zsh <($out/bin/$bin --completions zsh) + done + ''; meta = with lib; { description = "cat for markdown"; diff --git a/pkgs/tools/text/mecab/ipadic.nix b/pkgs/tools/text/mecab/ipadic.nix index 1a44af2d3eb8..9f49e5f1b5e4 100644 --- a/pkgs/tools/text/mecab/ipadic.nix +++ b/pkgs/tools/text/mecab/ipadic.nix @@ -18,15 +18,14 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ mecab-nodic ]; - configureFlags = - [ - "--with-charset=utf8" - "--with-dicdir=${placeholder "out"}" - ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "--with-mecab-config=${lib.getExe' buildPackages.mecab "mecab-config"}" - ] - ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "--with-mecab-config=${lib.getExe' (lib.getDev mecab-nodic) "mecab-config"}" - ]; + configureFlags = [ + "--with-charset=utf8" + "--with-dicdir=${placeholder "out"}" + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "--with-mecab-config=${lib.getExe' buildPackages.mecab "mecab-config"}" + ] + ++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + "--with-mecab-config=${lib.getExe' (lib.getDev mecab-nodic) "mecab-config"}" + ]; }) diff --git a/pkgs/tools/text/patchutils/generic.nix b/pkgs/tools/text/patchutils/generic.nix index 047b4cfd55cc..9d1da3980742 100644 --- a/pkgs/tools/text/patchutils/generic.nix +++ b/pkgs/tools/text/patchutils/generic.nix @@ -35,15 +35,14 @@ stdenv.mkDerivation rec { doCheck = lib.versionAtLeast version "0.3.4"; - preCheck = - '' - patchShebangs tests - chmod +x scripts/* - '' - + lib.optionalString (lib.versionOlder version "0.4.2") '' - find tests -type f -name 'run-test' \ - -exec sed -i '{}' -e 's|/bin/echo|echo|g' \; - ''; + preCheck = '' + patchShebangs tests + chmod +x scripts/* + '' + + lib.optionalString (lib.versionOlder version "0.4.2") '' + find tests -type f -name 'run-test' \ + -exec sed -i '{}' -e 's|/bin/echo|echo|g' \; + ''; meta = with lib; { description = "Tools to manipulate patch files"; diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix index 3f8caf570f62..a301ee3827f0 100644 --- a/pkgs/tools/typesetting/asciidoc/default.nix +++ b/pkgs/tools/typesetting/asciidoc/default.nix @@ -160,141 +160,140 @@ python3.pkgs.buildPythonApplication rec { ]; # install filters early, so their shebangs are patched too - postPatch = - '' - mkdir -p "$out/etc/asciidoc/filters" - mkdir -p "$out/etc/asciidoc/backends" - '' - + lib.optionalString _enableDitaaFilter '' - echo "Extracting ditaa filter" - unzip -d "$out/etc/asciidoc/filters/ditaa" "${ditaaFilterSrc}" - sed -i -e "s|java -jar|${jre}/bin/java -jar|" \ - "$out/etc/asciidoc/filters/ditaa/ditaa2img.py" - '' - + lib.optionalString _enableMscgenFilter '' - echo "Extracting mscgen filter" - unzip -d "$out/etc/asciidoc/filters/mscgen" "${mscgenFilterSrc}" - sed -i -e "s|filter-wrapper.py mscgen|filter-wrapper.py ${mscgen}/bin/mscgen|" \ - "$out/etc/asciidoc/filters/mscgen/mscgen-filter.conf" - '' - + lib.optionalString _enableDiagFilter '' - echo "Extracting diag filter" - unzip -d "$out/etc/asciidoc/filters/diag" "${diagFilterSrc}" - sed -i \ - -e "s|filter='blockdiag|filter=\'${blockdiag}/bin/blockdiag|" \ - -e "s|filter='seqdiag|filter=\'${seqdiag}/bin/seqdiag|" \ - -e "s|filter='actdiag|filter=\'${actdiag}/bin/actdiag|" \ - -e "s|filter='nwdiag|filter=\'${nwdiag}/bin/nwdiag|" \ - -e "s|filter='packetdiag|filter=\'${nwdiag}/bin/packetdiag|" \ - "$out/etc/asciidoc/filters/diag/diag-filter.conf" - '' - + lib.optionalString _enableQrcodeFilter '' - echo "Extracting qrcode filter" - unzip -d "$out/etc/asciidoc/filters/qrcode" "${qrcodeFilterSrc}" - sed -i -e "s|systemcmd('qrencode|systemcmd('${qrencode}/bin/qrencode|" \ - "$out/etc/asciidoc/filters/qrcode/qrcode2img.py" - '' - + lib.optionalString _enableMatplotlibFilter '' - echo "Extracting mpl (matplotlib) filter" - mkdir -p "$out/etc/asciidoc/filters/mpl" - tar xvf "${matplotlibFilterSrc}" -C "$out/etc/asciidoc/filters/mpl" --strip-components=1 - # Stop asciidoc from loading mpl/.old/chart-filter.conf - rm -rf "$out/etc/asciidoc/filters/mpl/.old" - # Add matplotlib and numpy to sys.path - matplotlib_path="$(toPythonPath ${matplotlib})" - numpy_path="$(toPythonPath ${numpy})" - sed -i "/^import.*sys/asys.path.append(\"$matplotlib_path\"); sys.path.append(\"$numpy_path\");" \ - "$out/etc/asciidoc/filters/mpl/mplw.py" - '' - + lib.optionalString _enableAafigureFilter '' - echo "Extracting aafigure filter" - unzip -d "$out/etc/asciidoc/filters/aafigure" "${aafigureFilterSrc}" - # Add aafigure to sys.path (and it needs recursive-pth-loader) - pth_loader_path="$(toPythonPath ${recursive-pth-loader})" - aafigure_path="$(toPythonPath ${aafigure})" - sed -i "/^import.*sys/asys.path.append(\"$pth_loader_path\"); sys.path.append(\"$aafigure_path\"); import sitecustomize" \ - "$out/etc/asciidoc/filters/aafigure/aafig2img.py" - '' - + lib.optionalString _enableDeckjsBackend '' - echo "Extracting deckjs backend" - unzip -d "$out/etc/asciidoc/backends/deckjs" "${deckjsBackendSrc}" - '' - + lib.optionalString _enableOdfBackend '' - echo "Extracting odf backend (odt + odp)" - unzip -d "$out/etc/asciidoc/backends/odt" "${odtBackendSrc}" - unzip -d "$out/etc/asciidoc/backends/odp" "${odpBackendSrc}" - # The odt backend has a TODO note about removing this hardcoded path, but - # the odp backend already has that fix. Copy it here until fixed upstream. - sed -i "s|'/etc/asciidoc/backends/odt/asciidoc.ott'|os.path.dirname(__file__),'asciidoc.ott'|" \ - "$out/etc/asciidoc/backends/odt/a2x-backend.py" - '' - + ( - if enableStandardFeatures then - '' - sed -e "s|dot|${graphviz}/bin/dot|g" \ - -e "s|neato|${graphviz}/bin/neato|g" \ - -e "s|twopi|${graphviz}/bin/twopi|g" \ - -e "s|circo|${graphviz}/bin/circo|g" \ - -e "s|fdp|${graphviz}/bin/fdp|g" \ - -i "asciidoc/resources/filters/graphviz/graphviz2png.py" + postPatch = '' + mkdir -p "$out/etc/asciidoc/filters" + mkdir -p "$out/etc/asciidoc/backends" + '' + + lib.optionalString _enableDitaaFilter '' + echo "Extracting ditaa filter" + unzip -d "$out/etc/asciidoc/filters/ditaa" "${ditaaFilterSrc}" + sed -i -e "s|java -jar|${jre}/bin/java -jar|" \ + "$out/etc/asciidoc/filters/ditaa/ditaa2img.py" + '' + + lib.optionalString _enableMscgenFilter '' + echo "Extracting mscgen filter" + unzip -d "$out/etc/asciidoc/filters/mscgen" "${mscgenFilterSrc}" + sed -i -e "s|filter-wrapper.py mscgen|filter-wrapper.py ${mscgen}/bin/mscgen|" \ + "$out/etc/asciidoc/filters/mscgen/mscgen-filter.conf" + '' + + lib.optionalString _enableDiagFilter '' + echo "Extracting diag filter" + unzip -d "$out/etc/asciidoc/filters/diag" "${diagFilterSrc}" + sed -i \ + -e "s|filter='blockdiag|filter=\'${blockdiag}/bin/blockdiag|" \ + -e "s|filter='seqdiag|filter=\'${seqdiag}/bin/seqdiag|" \ + -e "s|filter='actdiag|filter=\'${actdiag}/bin/actdiag|" \ + -e "s|filter='nwdiag|filter=\'${nwdiag}/bin/nwdiag|" \ + -e "s|filter='packetdiag|filter=\'${nwdiag}/bin/packetdiag|" \ + "$out/etc/asciidoc/filters/diag/diag-filter.conf" + '' + + lib.optionalString _enableQrcodeFilter '' + echo "Extracting qrcode filter" + unzip -d "$out/etc/asciidoc/filters/qrcode" "${qrcodeFilterSrc}" + sed -i -e "s|systemcmd('qrencode|systemcmd('${qrencode}/bin/qrencode|" \ + "$out/etc/asciidoc/filters/qrcode/qrcode2img.py" + '' + + lib.optionalString _enableMatplotlibFilter '' + echo "Extracting mpl (matplotlib) filter" + mkdir -p "$out/etc/asciidoc/filters/mpl" + tar xvf "${matplotlibFilterSrc}" -C "$out/etc/asciidoc/filters/mpl" --strip-components=1 + # Stop asciidoc from loading mpl/.old/chart-filter.conf + rm -rf "$out/etc/asciidoc/filters/mpl/.old" + # Add matplotlib and numpy to sys.path + matplotlib_path="$(toPythonPath ${matplotlib})" + numpy_path="$(toPythonPath ${numpy})" + sed -i "/^import.*sys/asys.path.append(\"$matplotlib_path\"); sys.path.append(\"$numpy_path\");" \ + "$out/etc/asciidoc/filters/mpl/mplw.py" + '' + + lib.optionalString _enableAafigureFilter '' + echo "Extracting aafigure filter" + unzip -d "$out/etc/asciidoc/filters/aafigure" "${aafigureFilterSrc}" + # Add aafigure to sys.path (and it needs recursive-pth-loader) + pth_loader_path="$(toPythonPath ${recursive-pth-loader})" + aafigure_path="$(toPythonPath ${aafigure})" + sed -i "/^import.*sys/asys.path.append(\"$pth_loader_path\"); sys.path.append(\"$aafigure_path\"); import sitecustomize" \ + "$out/etc/asciidoc/filters/aafigure/aafig2img.py" + '' + + lib.optionalString _enableDeckjsBackend '' + echo "Extracting deckjs backend" + unzip -d "$out/etc/asciidoc/backends/deckjs" "${deckjsBackendSrc}" + '' + + lib.optionalString _enableOdfBackend '' + echo "Extracting odf backend (odt + odp)" + unzip -d "$out/etc/asciidoc/backends/odt" "${odtBackendSrc}" + unzip -d "$out/etc/asciidoc/backends/odp" "${odpBackendSrc}" + # The odt backend has a TODO note about removing this hardcoded path, but + # the odp backend already has that fix. Copy it here until fixed upstream. + sed -i "s|'/etc/asciidoc/backends/odt/asciidoc.ott'|os.path.dirname(__file__),'asciidoc.ott'|" \ + "$out/etc/asciidoc/backends/odt/a2x-backend.py" + '' + + ( + if enableStandardFeatures then + '' + sed -e "s|dot|${graphviz}/bin/dot|g" \ + -e "s|neato|${graphviz}/bin/neato|g" \ + -e "s|twopi|${graphviz}/bin/twopi|g" \ + -e "s|circo|${graphviz}/bin/circo|g" \ + -e "s|fdp|${graphviz}/bin/fdp|g" \ + -i "asciidoc/resources/filters/graphviz/graphviz2png.py" - sed -e "s|run('latex|run('${texlive}/bin/latex|g" \ - -e "s|cmd = 'dvipng'|cmd = '${texlive}/bin/dvipng'|g" \ - -e "s|cmd = 'dvisvgm'|cmd = '${texlive}/bin/dvisvgm'|g" \ - -i "asciidoc/resources/filters/latex/latex2img.py" + sed -e "s|run('latex|run('${texlive}/bin/latex|g" \ + -e "s|cmd = 'dvipng'|cmd = '${texlive}/bin/dvipng'|g" \ + -e "s|cmd = 'dvisvgm'|cmd = '${texlive}/bin/dvisvgm'|g" \ + -i "asciidoc/resources/filters/latex/latex2img.py" - sed -e "s|run('abc2ly|run('${lilypond}/bin/abc2ly|g" \ - -e "s|run('lilypond|run('${lilypond}/bin/lilypond|g" \ - -e "s|run('convert|run('${imagemagick.out}/bin/convert|g" \ - -i "asciidoc/resources/filters/music/music2png.py" + sed -e "s|run('abc2ly|run('${lilypond}/bin/abc2ly|g" \ + -e "s|run('lilypond|run('${lilypond}/bin/lilypond|g" \ + -e "s|run('convert|run('${imagemagick.out}/bin/convert|g" \ + -i "asciidoc/resources/filters/music/music2png.py" - sed -e 's|filter="source-highlight|filter="${sourceHighlight}/bin/source-highlight|' \ - -e 's|filter="highlight|filter="${highlight}/bin/highlight|' \ - -e 's|filter="pygmentize|filter="${pygments}/bin/pygmentize|' \ - -i "asciidoc/resources/filters/source/source-highlight-filter.conf" + sed -e 's|filter="source-highlight|filter="${sourceHighlight}/bin/source-highlight|' \ + -e 's|filter="highlight|filter="${highlight}/bin/highlight|' \ + -e 's|filter="pygmentize|filter="${pygments}/bin/pygmentize|' \ + -i "asciidoc/resources/filters/source/source-highlight-filter.conf" - # ENV is custom environment passed to programs that a2x invokes. Here we - # use it to work around an impurity in the tetex package; tetex tools - # cannot find their neighbours (e.g. pdflatex doesn't find mktextfm). - # We can remove PATH= when those impurities are fixed. - # TODO: Is this still necessary when using texlive? - sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook_xsl_ns}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml', PATH='${ - lib.makeBinPath [ - texlive - coreutils - gnused - ] - }', **(dict(filter(lambda v: v[0] == 'SOURCE_DATE_EPOCH', os.environ.items()))))|" \ - -e "s|^ASCIIDOC =.*|ASCIIDOC = '$out/bin/asciidoc'|" \ - -e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \ - -e "s|^DBLATEX =.*|DBLATEX = '${dblatexFull}/bin/dblatex'|" \ - ${lib.optionalString enableJava ''-e "s|^FOP =.*|FOP = '${fop}/bin/fop'|"''} \ - -e "s|^W3M =.*|W3M = '${w3m}/bin/w3m'|" \ - -e "s|^LYNX =.*|LYNX = '${lynx}/bin/lynx'|" \ - -e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \ - -e "s|^EPUBCHECK =.*|EPUBCHECK = '${epubcheck}/bin/epubcheck'|" \ - -i asciidoc/a2x.py - '' - else - '' - sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook_xsl_ns}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml', **(dict(filter(lambda v: v[0] == 'SOURCE_DATE_EPOCH', os.environ.items()))))|" \ - -e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \ - -e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \ - -i asciidoc/a2x.py - '' - ) - + '' - # Fix tests - for f in $(grep -R --files-with-matches "2002-11-25") ; do - substituteInPlace $f --replace "2002-11-25" "1980-01-02" - substituteInPlace $f --replace "00:37:42" "00:00:00" - done - '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - # We want to use asciidoc from the build platform to build the documentation. - substituteInPlace Makefile.in \ - --replace "python3 -m asciidoc.a2x" "${buildPackages.asciidoc}/bin/a2x" - ''; + # ENV is custom environment passed to programs that a2x invokes. Here we + # use it to work around an impurity in the tetex package; tetex tools + # cannot find their neighbours (e.g. pdflatex doesn't find mktextfm). + # We can remove PATH= when those impurities are fixed. + # TODO: Is this still necessary when using texlive? + sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook_xsl_ns}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml', PATH='${ + lib.makeBinPath [ + texlive + coreutils + gnused + ] + }', **(dict(filter(lambda v: v[0] == 'SOURCE_DATE_EPOCH', os.environ.items()))))|" \ + -e "s|^ASCIIDOC =.*|ASCIIDOC = '$out/bin/asciidoc'|" \ + -e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \ + -e "s|^DBLATEX =.*|DBLATEX = '${dblatexFull}/bin/dblatex'|" \ + ${lib.optionalString enableJava ''-e "s|^FOP =.*|FOP = '${fop}/bin/fop'|"''} \ + -e "s|^W3M =.*|W3M = '${w3m}/bin/w3m'|" \ + -e "s|^LYNX =.*|LYNX = '${lynx}/bin/lynx'|" \ + -e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \ + -e "s|^EPUBCHECK =.*|EPUBCHECK = '${epubcheck}/bin/epubcheck'|" \ + -i asciidoc/a2x.py + '' + else + '' + sed -e "s|^ENV =.*|ENV = dict(XML_CATALOG_FILES='${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml ${docbook_xsl_ns}/xml/xsl/docbook/catalog.xml ${docbook_xsl}/xml/xsl/docbook/catalog.xml', **(dict(filter(lambda v: v[0] == 'SOURCE_DATE_EPOCH', os.environ.items()))))|" \ + -e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \ + -e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \ + -i asciidoc/a2x.py + '' + ) + + '' + # Fix tests + for f in $(grep -R --files-with-matches "2002-11-25") ; do + substituteInPlace $f --replace "2002-11-25" "1980-01-02" + substituteInPlace $f --replace "00:37:42" "00:00:00" + done + '' + + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + # We want to use asciidoc from the build platform to build the documentation. + substituteInPlace Makefile.in \ + --replace "python3 -m asciidoc.a2x" "${buildPackages.asciidoc}/bin/a2x" + ''; build-system = with python3.pythonOnBuildForHost.pkgs; [ setuptools ]; @@ -333,7 +332,8 @@ python3.pkgs.buildPythonApplication rec { ''; sourceProvenance = [ lib.sourceTypes.fromSource - ] ++ lib.optional _enableDitaaFilter lib.sourceTypes.binaryBytecode; + ] + ++ lib.optional _enableDitaaFilter lib.sourceTypes.binaryBytecode; homepage = "https://asciidoc-py.github.io/"; changelog = "https://github.com/asciidoc-py/asciidoc-py/blob/${version}/CHANGELOG.adoc"; license = lib.licenses.gpl2Plus; diff --git a/pkgs/tools/typesetting/tex/nix/default.nix b/pkgs/tools/typesetting/tex/nix/default.nix index 9bc056fe696a..1d43b85cefc7 100644 --- a/pkgs/tools/typesetting/tex/nix/default.nix +++ b/pkgs/tools/typesetting/tex/nix/default.nix @@ -51,7 +51,8 @@ rec { buildInputs = [ tex pkgs.perl - ] ++ packages; + ] + ++ packages; }; # Returns the closure of the "dependencies" of a LaTeX source file. diff --git a/pkgs/tools/typesetting/tex/tetex/default.nix b/pkgs/tools/typesetting/tex/tetex/default.nix index 9cd558082699..eb561b13b448 100644 --- a/pkgs/tools/typesetting/tex/tetex/default.nix +++ b/pkgs/tools/typesetting/tex/tetex/default.nix @@ -63,20 +63,19 @@ stdenv.mkDerivation rec { CXXFLAGS = "-std=c++03"; }; - configureFlags = - [ - "--disable-multiplatform" - "--without-x11" - "--without-xdvik" - "--without-oxdvik" - "--without-texinfo" - "--without-texi2html" - "--with-system-zlib" - "--with-system-pnglib" - "--with-system-ncurses" - ] - # couldn't get gsftopk working on darwin - ++ lib.optional stdenv.hostPlatform.isDarwin "--without-gsftopk"; + configureFlags = [ + "--disable-multiplatform" + "--without-x11" + "--without-xdvik" + "--without-oxdvik" + "--without-texinfo" + "--without-texi2html" + "--with-system-zlib" + "--with-system-pnglib" + "--with-system-ncurses" + ] + # couldn't get gsftopk working on darwin + ++ lib.optional stdenv.hostPlatform.isDarwin "--without-gsftopk"; postUnpack = '' mkdir -p $out/share/texmf diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 327d5ed2a06e..2f01868c1c6b 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -132,7 +132,8 @@ let "luahbtex" "upmendex" "xetex" - ] ++ lib.optional withLuaJIT "luajittex"; + ] + ++ lib.optional withLuaJIT "luajittex"; binPackages = lib.getAttrs (corePackages ++ coreBigPackages) tlpdb; common = { @@ -144,56 +145,54 @@ let hash = "sha256-//2xo9FDwXekOYoiKaQNaojxgJjl9tz9V2SMnyQXSQ8="; }; - prePatch = - '' - for i in texk/kpathsea/mktex*; do - sed -i '/^mydir=/d' "$i" - done + prePatch = '' + for i in texk/kpathsea/mktex*; do + sed -i '/^mydir=/d' "$i" + done - # ST_NLINK_TRICK causes kpathsea to treat folders with no real subfolders - # as leaves, even if they contain symlinks to other folders; must be - # disabled to work correctly with the nix store", see section 5.3.6 - # “Subdirectory expansion” of the kpathsea manual - # http://mirrors.ctan.org/systems/doc/kpathsea/kpathsea.pdf for more - # details - sed -i '/^#define ST_NLINK_TRICK/d' texk/kpathsea/config.h - '' - + - # when cross compiling, we must use himktables from PATH - # (i.e. from buildPackages.texlive.bin.core.dev) - lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' - sed -i 's|\./himktables|himktables|' texk/web2c/Makefile.in - ''; + # ST_NLINK_TRICK causes kpathsea to treat folders with no real subfolders + # as leaves, even if they contain symlinks to other folders; must be + # disabled to work correctly with the nix store", see section 5.3.6 + # “Subdirectory expansion” of the kpathsea manual + # http://mirrors.ctan.org/systems/doc/kpathsea/kpathsea.pdf for more + # details + sed -i '/^#define ST_NLINK_TRICK/d' texk/kpathsea/config.h + '' + + + # when cross compiling, we must use himktables from PATH + # (i.e. from buildPackages.texlive.bin.core.dev) + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + sed -i 's|\./himktables|himktables|' texk/web2c/Makefile.in + ''; - configureFlags = - [ - "--with-banner-add=/nixos.org" - "--disable-missing" - # terminate if a requested program or feature must be - # disabled, e.g., due to missing libraries - "--disable-native-texlive-build" # do not build for the TeX Live binary distribution - "--enable-shared" # "--enable-cxx-runtime-hack" # static runtime - "--enable-tex-synctex" - "--disable-texlive" # do not build the texlive (TeX Live scripts) package - "--disable-linked-scripts" # do not install the linked scripts - "-C" # use configure cache to speed up - ] - ++ withSystemLibs [ - # see "from TL tree" vs. "Using installed" in configure output - "zziplib" - "mpfr" - "gmp" - "pixman" - "potrace" - "gd" - "freetype2" - "libpng" - "libpaper" - "zlib" - ] - ++ lib.optional ( - stdenv.hostPlatform != stdenv.buildPlatform - ) "BUILDCC=${buildPackages.stdenv.cc.targetPrefix}cc"; + configureFlags = [ + "--with-banner-add=/nixos.org" + "--disable-missing" + # terminate if a requested program or feature must be + # disabled, e.g., due to missing libraries + "--disable-native-texlive-build" # do not build for the TeX Live binary distribution + "--enable-shared" # "--enable-cxx-runtime-hack" # static runtime + "--enable-tex-synctex" + "--disable-texlive" # do not build the texlive (TeX Live scripts) package + "--disable-linked-scripts" # do not install the linked scripts + "-C" # use configure cache to speed up + ] + ++ withSystemLibs [ + # see "from TL tree" vs. "Using installed" in configure output + "zziplib" + "mpfr" + "gmp" + "pixman" + "potrace" + "gd" + "freetype2" + "libpng" + "libpaper" + "zlib" + ] + ++ lib.optional ( + stdenv.hostPlatform != stdenv.buildPlatform + ) "BUILDCC=${buildPackages.stdenv.cc.targetPrefix}cc"; # move binaries to corresponding split outputs, based on content of texlive.tlpdb binToOutput = lib.listToAttrs ( @@ -250,24 +249,24 @@ rec { "dev" "man" "info" - ] ++ (builtins.map (builtins.replaceStrings [ "-" ] [ "_" ]) corePackages); + ] + ++ (builtins.map (builtins.replaceStrings [ "-" ] [ "_" ]) corePackages); - nativeBuildInputs = + nativeBuildInputs = [ + pkg-config + ] + ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ( + with texlive.bin.core; [ - pkg-config + # configure: error: tangle was not found but is required when cross-compiling. + # dev (himktables) is used when building hitex to generate the additional source file hitables.c + web # tangle + cweb # ctangle + omegaware # otangle + tie # tie see "Building TeX Live" 6.4.2 Cross problems + dev # himktables ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ( - with texlive.bin.core; - [ - # configure: error: tangle was not found but is required when cross-compiling. - # dev (himktables) is used when building hitex to generate the additional source file hitables.c - web # tangle - cweb # ctangle - omegaware # otangle - tie # tie see "Building TeX Live" 6.4.2 Cross problems - dev # himktables - ] - ); + ); buildInputs = [ # teckit @@ -423,24 +422,23 @@ rec { deleting the unused packages speeds up configure by a considerable margin and ensures we do not rebuild existing libraries by mistake */ - preConfigure = - '' - rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \ - libs/{mpfr,pixman,xpdf,zlib,zziplib} \ - texk/{afm2pl,bibtex-x,chktex,cjkutils,detex,dtl,dvi2tty,dvidvi,dviljk,dviout-util} \ - texk/{dvipdfm-x,dvipng,dvipos,dvipsk,dvisvgm,gregorio,gsftopk,kpathsea} \ - texk/{lcdf-typetools,makeindexk,makejvf,mendexk,musixtnt,ps2pk,psutils,ptexenc} \ - texk/{seetexk,tex4htk,texlive,ttf2pk2,ttfdump,xdvik} \ - utils/{asymptote,autosp,axodraw2,devnag,lacheck,m-tx,pmx,ps2eps,t1utils,texdoctk} \ - utils/{tpic2pdftex,vlna,xindy,xml2pmx,xpdfopen} - mkdir WorkDir - cd WorkDir - '' - # force XeTeX to use fontconfig instead of Core Text, so that fonts can be made available via FONTCONFIG_FILE, - # by tricking configure into thinking that the relevant test result is already in the config cache - + lib.optionalString stdenv.hostPlatform.isDarwin '' - export kpse_cv_have_ApplicationServices=no - ''; + preConfigure = '' + rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \ + libs/{mpfr,pixman,xpdf,zlib,zziplib} \ + texk/{afm2pl,bibtex-x,chktex,cjkutils,detex,dtl,dvi2tty,dvidvi,dviljk,dviout-util} \ + texk/{dvipdfm-x,dvipng,dvipos,dvipsk,dvisvgm,gregorio,gsftopk,kpathsea} \ + texk/{lcdf-typetools,makeindexk,makejvf,mendexk,musixtnt,ps2pk,psutils,ptexenc} \ + texk/{seetexk,tex4htk,texlive,ttf2pk2,ttfdump,xdvik} \ + utils/{asymptote,autosp,axodraw2,devnag,lacheck,m-tx,pmx,ps2eps,t1utils,texdoctk} \ + utils/{tpic2pdftex,vlna,xindy,xml2pmx,xpdfopen} + mkdir WorkDir + cd WorkDir + '' + # force XeTeX to use fontconfig instead of Core Text, so that fonts can be made available via FONTCONFIG_FILE, + # by tricking configure into thinking that the relevant test result is already in the config cache + + lib.optionalString stdenv.hostPlatform.isDarwin '' + export kpse_cv_have_ApplicationServices=no + ''; configureFlags = common.configureFlags @@ -489,28 +487,27 @@ rec { doCheck = false; # fails - outputs = - [ - "out" - "dev" - "man" - "info" - ] - ++ (builtins.map (builtins.replaceStrings [ "-" ] [ "_" ]) coreBigPackages) - # some outputs of metapost, omegaware are for ptex/uptex - ++ [ - "ptex" - "uptex" - ] - # unavoidable duplicates from core - ++ [ - "ctie" - "cweb" - "omegaware" - "texlive_scripts_extra" - "tie" - "web" - ]; + outputs = [ + "out" + "dev" + "man" + "info" + ] + ++ (builtins.map (builtins.replaceStrings [ "-" ] [ "_" ]) coreBigPackages) + # some outputs of metapost, omegaware are for ptex/uptex + ++ [ + "ptex" + "uptex" + ] + # unavoidable duplicates from core + ++ [ + "ctie" + "cweb" + "omegaware" + "texlive_scripts_extra" + "tie" + "web" + ]; postInstall = common.moveBins; }; @@ -738,22 +735,21 @@ rec { inherit (common) src; nativeBuildInputs = [ pkg-config ]; - buildInputs = - [ - core # kpathsea - freetype - ghostscript - ] - ++ (with xorg; [ - libX11 - libXaw - libXi - libXpm - libXmu - libXaw - libXext - libXfixes - ]); + buildInputs = [ + core # kpathsea + freetype + ghostscript + ] + ++ (with xorg; [ + libX11 + libXaw + libXi + libXpm + libXmu + libXaw + libXext + libXfixes + ]); preConfigure = "cd texk/xdvik"; diff --git a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix index 01ee20554031..e506100ecbb3 100644 --- a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix +++ b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix @@ -418,7 +418,8 @@ lib.fix ( # use attrNames, attrValues to ensure the two lists are sorted in the same way outputs = [ "out" - ] ++ lib.optionals (!__combine && __formatsOf == null) (builtins.attrNames nonEnvOutputs); + ] + ++ lib.optionals (!__combine && __formatsOf == null) (builtins.attrNames nonEnvOutputs); otherOutputs = lib.optionals (!__combine && __formatsOf == null) ( builtins.attrValues nonEnvOutputs ); @@ -451,7 +452,8 @@ lib.fix ( gawk gnugrep gnused - ] ++ lib.optional needsGhostscript ghostscript; + ] + ++ lib.optional needsGhostscript ghostscript; inherit meta passthru __combine; __formatsOf = __formatsOf.pname or null; diff --git a/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix b/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix index 923fa12fc912..11c77e487548 100644 --- a/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix +++ b/pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix @@ -62,28 +62,27 @@ let # common metadata name = "${pname}-${version}${extraVersion}"; - meta = - { - license = map (x: lib.licenses.${x}) license; - # TeX Live packages should not be installed directly into the user profile - outputsToInstall = [ ]; - longDescription = '' - This package cannot be installed or used directly. Please use `texlive.withPackages (ps: [ ps.${lib.strings.escapeNixIdentifier pname} ])`. - ''; - # discourage nix-env from matching this package - priority = 10; - platforms = lib.platforms.all; - # These create a large number of jobs, which puts load on Hydra - # without any appreciable benefit (as the combined packages already - # cause them all to be built and cached anyway). - hydraPlatforms = [ ]; - } - // lib.optionalAttrs (args ? shortdesc) { - description = args.shortdesc; - } - // lib.optionalAttrs hasCatalogue { - homepage = "https://ctan.org/pkg/${catalogue}"; - }; + meta = { + license = map (x: lib.licenses.${x}) license; + # TeX Live packages should not be installed directly into the user profile + outputsToInstall = [ ]; + longDescription = '' + This package cannot be installed or used directly. Please use `texlive.withPackages (ps: [ ps.${lib.strings.escapeNixIdentifier pname} ])`. + ''; + # discourage nix-env from matching this package + priority = 10; + platforms = lib.platforms.all; + # These create a large number of jobs, which puts load on Hydra + # without any appreciable benefit (as the combined packages already + # cause them all to be built and cached anyway). + hydraPlatforms = [ ]; + } + // lib.optionalAttrs (args ? shortdesc) { + description = args.shortdesc; + } + // lib.optionalAttrs hasCatalogue { + homepage = "https://ctan.org/pkg/${catalogue}"; + }; hasBinfiles = args ? binfiles && args.binfiles != [ ]; hasDocfiles = sha512 ? doc; @@ -103,22 +102,21 @@ let ++ lib.optional hasInfo "info"; outputDrvs = lib.getAttrs outputs containers; - passthru = - { - # metadata - inherit pname; - revision = toString revision + extraRevision; - version = version + extraVersion; - # containers behave like specified outputs - outputSpecified = true; - } - // lib.optionalAttrs (args ? deps) { tlDeps = args.deps; } - // lib.optionalAttrs (args ? fontMaps) { inherit (args) fontMaps; } - // lib.optionalAttrs (args ? formats) { inherit (args) formats; } - // lib.optionalAttrs (args ? hyphenPatterns) { inherit (args) hyphenPatterns; } - // lib.optionalAttrs (args ? postactionScript) { inherit (args) postactionScript; } - // lib.optionalAttrs hasSource { inherit (containers) texsource; } - // lib.optionalAttrs (!hasRunfiles) { tex = fakeTeX; }; + passthru = { + # metadata + inherit pname; + revision = toString revision + extraRevision; + version = version + extraVersion; + # containers behave like specified outputs + outputSpecified = true; + } + // lib.optionalAttrs (args ? deps) { tlDeps = args.deps; } + // lib.optionalAttrs (args ? fontMaps) { inherit (args) fontMaps; } + // lib.optionalAttrs (args ? formats) { inherit (args) formats; } + // lib.optionalAttrs (args ? hyphenPatterns) { inherit (args) hyphenPatterns; } + // lib.optionalAttrs (args ? postactionScript) { inherit (args) postactionScript; } + // lib.optionalAttrs hasSource { inherit (containers) texsource; } + // lib.optionalAttrs (!hasRunfiles) { tex = fakeTeX; }; # build run, doc, source, tlpkg containers mkContainer = diff --git a/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix b/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix index 6748ff7b63d6..fb0a180e1bfd 100644 --- a/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix +++ b/pkgs/tools/typesetting/tex/texlive/tlpdb-overrides.nix @@ -585,8 +585,11 @@ lib.recursiveUpdate orig rec { extraVersion = "-tlpdb-${toString tlpdbVersion.revision}"; # add license of tlmgr and TeXLive::* perl packages and of bin.core - license = - [ "gpl2Plus" ] ++ lib.toList bin.core.meta.license.shortName ++ orig."texlive.infra".license or [ ]; + license = [ + "gpl2Plus" + ] + ++ lib.toList bin.core.meta.license.shortName + ++ orig."texlive.infra".license or [ ]; scriptsFolder = "texlive"; extraBuildInputs = [ diff --git a/pkgs/tools/virtualization/mkosi/default.nix b/pkgs/tools/virtualization/mkosi/default.nix index 5bd8b763e878..867428ef1a17 100644 --- a/pkgs/tools/virtualization/mkosi/default.nix +++ b/pkgs/tools/virtualization/mkosi/default.nix @@ -48,21 +48,20 @@ let pythonWithPefile = python.withPackages (ps: [ ps.pefile ]); - deps = - [ - bash - btrfs-progs - coreutils - cpio - gnutar - kmod - systemdForMkosi - util-linux - ] - ++ extraDeps - ++ lib.optionals withQemu [ - qemu - ]; + deps = [ + bash + btrfs-progs + coreutils + cpio + gnutar + kmod + systemdForMkosi + util-linux + ] + ++ extraDeps + ++ lib.optionals withQemu [ + qemu + ]; in buildPythonApplication rec { pname = "mkosi"; @@ -81,24 +80,23 @@ buildPythonApplication rec { hash = "sha256-3dhr9lFJpI8aN8HILaMvGuuTbmTVUqdaLAGxSpqciTs="; }; - patches = - [ - (replaceVars ./0001-Use-wrapped-binaries-instead-of-Python-interpreter.patch { - UKIFY = "${systemdForMkosi}/lib/systemd/ukify"; - PYTHON_PEFILE = lib.getExe pythonWithPefile; - NIX_PATH = toString (lib.makeBinPath deps); - MKOSI_SANDBOX = null; # will be replaced in postPatch - }) - (replaceVars ./0002-Fix-library-resolving.patch { - LIBC = "${stdenv.cc.libc}/lib/libc.so.6"; - LIBSECCOMP = "${libseccomp.lib}/lib/libseccomp.so.2"; - }) - ] - ++ lib.optional withQemu ( - replaceVars ./0003-Fix-QEMU-firmware-path.patch { - QEMU_FIRMWARE = "${qemu}/share/qemu/firmware"; - } - ); + patches = [ + (replaceVars ./0001-Use-wrapped-binaries-instead-of-Python-interpreter.patch { + UKIFY = "${systemdForMkosi}/lib/systemd/ukify"; + PYTHON_PEFILE = lib.getExe pythonWithPefile; + NIX_PATH = toString (lib.makeBinPath deps); + MKOSI_SANDBOX = null; # will be replaced in postPatch + }) + (replaceVars ./0002-Fix-library-resolving.patch { + LIBC = "${stdenv.cc.libc}/lib/libc.so.6"; + LIBSECCOMP = "${libseccomp.lib}/lib/libseccomp.so.2"; + }) + ] + ++ lib.optional withQemu ( + replaceVars ./0003-Fix-QEMU-firmware-path.patch { + QEMU_FIRMWARE = "${qemu}/share/qemu/firmware"; + } + ); postPatch = '' # As we need the $out reference, we can't use `replaceVars` here. diff --git a/pkgs/tools/virtualization/supermin/default.nix b/pkgs/tools/virtualization/supermin/default.nix index 4c55b3909798..ffc624d59463 100644 --- a/pkgs/tools/virtualization/supermin/default.nix +++ b/pkgs/tools/virtualization/supermin/default.nix @@ -19,17 +19,16 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "zjkh02NcgWjPt8oMWoK51c71srJx+Et3bWO4u77sNY4="; }; - nativeBuildInputs = - [ - cpio - e2fsprogs - perl - pkg-config - ] - ++ (with ocamlPackages; [ - findlib - ocaml - ]); + nativeBuildInputs = [ + cpio + e2fsprogs + perl + pkg-config + ] + ++ (with ocamlPackages; [ + findlib + ocaml + ]); buildInputs = lib.optionals stdenv.hostPlatform.isGnu [ glibc glibc.static diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 51840cfea1f7..fcf38107ed8b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3845,8 +3845,7 @@ with pkgs; toPythonApplication ( nvchecker.overridePythonAttrs (oldAttrs: { propagatedBuildInputs = - oldAttrs.propagatedBuildInputs - ++ lib.flatten (builtins.attrValues oldAttrs.optional-dependencies); + oldAttrs.propagatedBuildInputs ++ lib.flatten (builtins.attrValues oldAttrs.optional-dependencies); }) ); @@ -6144,7 +6143,8 @@ with pkgs; nixSupport zlib ; - } // extraArgs; + } + // extraArgs; in self ); @@ -6171,7 +6171,8 @@ with pkgs; noLibc = (self.libc == null); inherit bintools libc; - } // extraArgs; + } + // extraArgs; in self ); @@ -16058,7 +16059,8 @@ with pkgs; config.nixpkgs.localSystem = lib.mkDefault stdenv.hostPlatform; } ) - ] ++ (if builtins.isList configuration then configuration else [ configuration ]); + ] + ++ (if builtins.isList configuration then configuration else [ configuration ]); # The system is inherited from the current pkgs above. # Set it to null, to remove the "legacy" entrypoint's non-hermetic default. diff --git a/pkgs/top-level/darwin-aliases.nix b/pkgs/top-level/darwin-aliases.nix index 2e7849c2fefd..d2cc6f94a960 100644 --- a/pkgs/top-level/darwin-aliases.nix +++ b/pkgs/top-level/darwin-aliases.nix @@ -55,45 +55,44 @@ let apple_sdk = apple_sdk_11_0; - stubs = - { - inherit apple_sdk apple_sdk_11_0 apple_sdk_12_3; - } - // lib.genAttrs [ - "CF" - "CarbonHeaders" - "CommonCrypto" - "CoreSymbolication" - "IOKit" - "Libc" - "Libinfo" - "Libm" - "Libnotify" - "Librpcsvc" - "Libsystem" - "LibsystemCross" - "Security" - "architecture" - "cf-private" - "configd" - "configdHeaders" - "darwin-stubs" - "dtrace" - "eap8021x" - "hfs" - "hfsHeaders" - "launchd" - "libclosure" - "libdispatch" - "libmalloc" - "libobjc" - "libplatform" - "libpthread" - "mDNSResponder" - "objc4" - "ppp" - "xnu" - ] (mkStub "darwin" "11.0"); + stubs = { + inherit apple_sdk apple_sdk_11_0 apple_sdk_12_3; + } + // lib.genAttrs [ + "CF" + "CarbonHeaders" + "CommonCrypto" + "CoreSymbolication" + "IOKit" + "Libc" + "Libinfo" + "Libm" + "Libnotify" + "Librpcsvc" + "Libsystem" + "LibsystemCross" + "Security" + "architecture" + "cf-private" + "configd" + "configdHeaders" + "darwin-stubs" + "dtrace" + "eap8021x" + "hfs" + "hfsHeaders" + "launchd" + "libclosure" + "libdispatch" + "libmalloc" + "libobjc" + "libplatform" + "libpthread" + "mDNSResponder" + "objc4" + "ppp" + "xnu" + ] (mkStub "darwin" "11.0"); in stubs diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 29eb4bfe72b0..7c5c342970f7 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -190,7 +190,8 @@ makeScopeWithSplicing' { configuration = { imports = [ ../../nixos/modules/profiles/nix-builder-vm.nix - ] ++ modules; + ] + ++ modules; # If you need to override this, consider starting with the right Nixpkgs # in the first place, ie change `pkgs` in `pkgs.darwin.linux-builder`. diff --git a/pkgs/top-level/haxe-packages.nix b/pkgs/top-level/haxe-packages.nix index 53d0119d9e11..23dd1a0f906e 100644 --- a/pkgs/top-level/haxe-packages.nix +++ b/pkgs/top-level/haxe-packages.nix @@ -75,7 +75,8 @@ let license = lib.licenses.bsd2; platforms = lib.platforms.all; description = throw "please write meta.description"; - } // attrs.meta; + } + // attrs.meta; } ); in diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index 055f509b98b2..837f2d3a51bb 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -723,25 +723,24 @@ in hardenedPackagesFor = kernel: overrides: packagesFor (hardenedKernelFor kernel overrides); - vanillaPackages = - { - # recurse to build modules for the kernels - linux_5_4 = recurseIntoAttrs (packagesFor kernels.linux_5_4); - linux_5_10 = recurseIntoAttrs (packagesFor kernels.linux_5_10); - linux_5_15 = recurseIntoAttrs (packagesFor kernels.linux_5_15); - linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1); - linux_6_6 = recurseIntoAttrs (packagesFor kernels.linux_6_6); - linux_6_12 = recurseIntoAttrs (packagesFor kernels.linux_6_12); - linux_6_15 = recurseIntoAttrs (packagesFor kernels.linux_6_15); - } - // lib.optionalAttrs config.allowAliases { - linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; # Added 2024-09-21 - linux_6_9 = throw "linux 6.9 was removed because it reached its end of life upstream"; # Added 2024-08-02 - linux_6_10 = throw "linux 6.10 was removed because it reached its end of life upstream"; # Added 2024-10-23 - linux_6_11 = throw "linux 6.11 was removed because it reached its end of life upstream"; # Added 2025-03-23 - linux_6_13 = throw "linux 6.13 was removed because it reached its end of life upstream"; # Added 2025-06-22 - linux_6_14 = throw "linux 6.14 was removed because it reached its end of life upstream"; # Added 2025-06-22 - }; + vanillaPackages = { + # recurse to build modules for the kernels + linux_5_4 = recurseIntoAttrs (packagesFor kernels.linux_5_4); + linux_5_10 = recurseIntoAttrs (packagesFor kernels.linux_5_10); + linux_5_15 = recurseIntoAttrs (packagesFor kernels.linux_5_15); + linux_6_1 = recurseIntoAttrs (packagesFor kernels.linux_6_1); + linux_6_6 = recurseIntoAttrs (packagesFor kernels.linux_6_6); + linux_6_12 = recurseIntoAttrs (packagesFor kernels.linux_6_12); + linux_6_15 = recurseIntoAttrs (packagesFor kernels.linux_6_15); + } + // lib.optionalAttrs config.allowAliases { + linux_4_19 = throw "linux 4.19 was removed because it will reach its end of life within 24.11"; # Added 2024-09-21 + linux_6_9 = throw "linux 6.9 was removed because it reached its end of life upstream"; # Added 2024-08-02 + linux_6_10 = throw "linux 6.10 was removed because it reached its end of life upstream"; # Added 2024-10-23 + linux_6_11 = throw "linux 6.11 was removed because it reached its end of life upstream"; # Added 2025-03-23 + linux_6_13 = throw "linux 6.13 was removed because it reached its end of life upstream"; # Added 2025-06-22 + linux_6_14 = throw "linux 6.14 was removed because it reached its end of life upstream"; # Added 2025-06-22 + }; rtPackages = { # realtime kernel packages @@ -799,17 +798,16 @@ in } ); - packageAliases = - { - linux_default = packages.linux_6_12; - # Update this when adding the newest kernel major version! - linux_latest = packages.linux_6_15; - linux_rt_default = packages.linux_rt_5_15; - linux_rt_latest = packages.linux_rt_6_6; - } - // lib.optionalAttrs config.allowAliases { - linux_mptcp = throw "'linux_mptcp' has been moved to https://github.com/teto/mptcp-flake"; - }; + packageAliases = { + linux_default = packages.linux_6_12; + # Update this when adding the newest kernel major version! + linux_latest = packages.linux_6_15; + linux_rt_default = packages.linux_rt_5_15; + linux_rt_latest = packages.linux_rt_6_6; + } + // lib.optionalAttrs config.allowAliases { + linux_mptcp = throw "'linux_mptcp' has been moved to https://github.com/teto/mptcp-flake"; + }; manualConfig = callPackage ../os-specific/linux/kernel/manual-config.nix { }; @@ -844,12 +842,13 @@ in }: stdenvNoCC.mkDerivation { inherit name src; - depsBuildBuild = - [ buildPackages.stdenv.cc ] - ++ lib.optionals (lib.versionAtLeast version "4.16") [ - buildPackages.bison - buildPackages.flex - ]; + depsBuildBuild = [ + buildPackages.stdenv.cc + ] + ++ lib.optionals (lib.versionAtLeast version "4.16") [ + buildPackages.bison + buildPackages.flex + ]; patches = map (p: p.patch) kernelPatches; # Patches may include new configs. postPatch = '' patchShebangs scripts/ diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 0ed6aa66b79e..2223827f13db 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -1278,7 +1278,8 @@ with self; PDFAPI2 StringInterpolateNamed TextLayout - ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ Wx ]; + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ Wx ]; nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; # Delete tests that fail when version env var is set, see @@ -18341,21 +18342,21 @@ with self; ]; nativeBuildInputs = [ pkgs.makeWrapper - ] ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; + ] + ++ lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang; makeMakerFlags = [ "TEXMF=\${tex}" "NOMKTEXLSR" ]; # shebangs need to be patched before executables are copied to $out - preBuild = - '' - patchShebangs bin/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - for file in bin/*; do - shortenPerlShebang "$file" - done - ''; + preBuild = '' + patchShebangs bin/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + for file in bin/*; do + shortenPerlShebang "$file" + done + ''; postInstall = '' for file in latexmlc latexmlmath latexmlpost ; do # add runtime dependencies that cause silent failures when missing @@ -26687,14 +26688,13 @@ with self; # Most tests are skipped as no server is available in the sandbox. # `t/35_log.t` seems to suffer from a race condition; remove it. See # https://github.com/NixOS/nixpkgs/pull/104889#issuecomment-737144513 - preCheck = - '' - rm t/35_log.t - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - rm t/30_connect.t - rm t/45_class.t - ''; + preCheck = '' + rm t/35_log.t + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + rm t/30_connect.t + rm t/45_class.t + ''; meta = { description = "Perl extension for Apache ZooKeeper"; homepage = "https://github.com/mark-5/p5-net-zookeeper"; @@ -27499,19 +27499,18 @@ with self; (lib.getDev mesa_glu) ]; - buildInputs = - [ - DevelChecklib - TestDeep - TestException - TestWarn - ] - ++ (with pkgs; [ - gsl - libglut - xorg.libXmu - xorg.libXi - ]); + buildInputs = [ + DevelChecklib + TestDeep + TestException + TestWarn + ] + ++ (with pkgs; [ + gsl + libglut + xorg.libXmu + xorg.libXi + ]); propagatedBuildInputs = [ AstroFITSHeader @@ -32556,15 +32555,14 @@ with self; buildPhase = '' perl Makefile.PL --tclsh "${pkgs.tk.tcl}/bin/tclsh" INSTALL_BASE=$out --no-test-for-tk ''; - postInstall = - '' - mkdir -p $out/lib/perl5/site_perl - mv $out/lib/perl5/Tcl $out/lib/perl5/site_perl/ - mv $out/lib/perl5/auto $out/lib/perl5/site_perl/ - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mv $out/lib/perl5/darwin-thread-multi-2level $out/lib/perl5/site_perl/ - ''; + postInstall = '' + mkdir -p $out/lib/perl5/site_perl + mv $out/lib/perl5/Tcl $out/lib/perl5/site_perl/ + mv $out/lib/perl5/auto $out/lib/perl5/site_perl/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mv $out/lib/perl5/darwin-thread-multi-2level $out/lib/perl5/site_perl/ + ''; meta = { description = "Interface to Tcl/Tk with Perl/Tk compatible syntax"; license = with lib.licenses; [ @@ -38405,18 +38403,17 @@ with self; hash = "sha256-opvz8Aq5ye4EIYFU4K/I95m/I2dOuZwantTeH0BZpI0="; }; SKIP_SAX_INSTALL = 1; - buildInputs = + buildInputs = [ + AlienBuild + AlienLibxml2 + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin ( + with pkgs; [ - AlienBuild - AlienLibxml2 + libiconv + zlib ] - ++ lib.optionals stdenv.hostPlatform.isDarwin ( - with pkgs; - [ - libiconv - zlib - ] - ); + ); patches = [ # https://github.com/shlomif/perl-XML-LibXML/pull/87 ../development/perl-modules/XML-LibXML-fix-tests-libxml-2.13.0.patch diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 1847580e4306..43f6263cb817 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -210,7 +210,8 @@ lib.makeScope pkgs.newScope ( license platforms ; - } // args.meta or { }; + } + // args.meta or { }; } ) ); @@ -218,50 +219,49 @@ lib.makeScope pkgs.newScope ( php = phpPackage; # This is a set of interactive tools based on PHP. - tools = - { - box = callPackage ../development/php-packages/box { }; + tools = { + box = callPackage ../development/php-packages/box { }; - castor = callPackage ../development/php-packages/castor { }; + castor = callPackage ../development/php-packages/castor { }; - composer = callPackage ../development/php-packages/composer { }; + composer = callPackage ../development/php-packages/composer { }; - composer-local-repo-plugin = callPackage ../development/php-packages/composer-local-repo-plugin { }; + composer-local-repo-plugin = callPackage ../development/php-packages/composer-local-repo-plugin { }; - cyclonedx-php-composer = callPackage ../development/php-packages/cyclonedx-php-composer { }; + cyclonedx-php-composer = callPackage ../development/php-packages/cyclonedx-php-composer { }; - deployer = callPackage ../development/php-packages/deployer { }; + deployer = callPackage ../development/php-packages/deployer { }; - grumphp = callPackage ../development/php-packages/grumphp { }; + grumphp = callPackage ../development/php-packages/grumphp { }; - phan = callPackage ../development/php-packages/phan { }; + phan = callPackage ../development/php-packages/phan { }; - phing = callPackage ../development/php-packages/phing { }; + phing = callPackage ../development/php-packages/phing { }; - phive = callPackage ../development/php-packages/phive { }; + phive = callPackage ../development/php-packages/phive { }; - php-codesniffer = callPackage ../development/php-packages/php-codesniffer { }; + php-codesniffer = callPackage ../development/php-packages/php-codesniffer { }; - php-cs-fixer = callPackage ../development/php-packages/php-cs-fixer { }; + php-cs-fixer = callPackage ../development/php-packages/php-cs-fixer { }; - php-parallel-lint = callPackage ../development/php-packages/php-parallel-lint { }; + php-parallel-lint = callPackage ../development/php-packages/php-parallel-lint { }; - phpinsights = callPackage ../development/php-packages/phpinsights { }; + phpinsights = callPackage ../development/php-packages/phpinsights { }; - phpmd = callPackage ../development/php-packages/phpmd { }; + phpmd = callPackage ../development/php-packages/phpmd { }; - phpspy = callPackage ../development/php-packages/phpspy { }; + phpspy = callPackage ../development/php-packages/phpspy { }; - phpstan = callPackage ../development/php-packages/phpstan { }; + phpstan = callPackage ../development/php-packages/phpstan { }; - psalm = callPackage ../development/php-packages/psalm { }; + psalm = callPackage ../development/php-packages/psalm { }; - psysh = callPackage ../development/php-packages/psysh { }; - } - // lib.optionalAttrs config.allowAliases { - phpcbf = throw "`phpcbf` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`."; - phpcs = throw "`phpcs` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`."; - }; + psysh = callPackage ../development/php-packages/psysh { }; + } + // lib.optionalAttrs config.allowAliases { + phpcbf = throw "`phpcbf` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`."; + phpcs = throw "`phpcs` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`."; + }; # This is a set of PHP extensions meant to be used in php.buildEnv # or php.withExtensions to extend the functionality of the PHP @@ -417,430 +417,429 @@ lib.makeScope pkgs.newScope ( # want to build. # # These will be passed as arguments to mkExtension above. - extensionData = - [ - { name = "bcmath"; } - { - name = "bz2"; - buildInputs = [ bzip2 ]; - configureFlags = [ "--with-bz2=${bzip2.dev}" ]; - } - { name = "calendar"; } - { - name = "ctype"; - postPatch = - lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionAtLeast php.version "8.2") - # Broken test on aarch64-darwin - '' - rm ext/ctype/tests/lc_ctype_inheritance.phpt - ''; - } - { - name = "curl"; - buildInputs = [ curl ]; - configureFlags = [ "--with-curl=${curl.dev}" ]; - doCheck = false; - } - { name = "dba"; } - { - name = "dom"; - buildInputs = [ libxml2 ]; - configureFlags = [ - "--enable-dom" - ]; - } - { - name = "enchant"; - buildInputs = [ enchant2 ]; - configureFlags = [ "--with-enchant" ]; - doCheck = false; - } - { - name = "exif"; - doCheck = false; - } - { - name = "ffi"; - buildInputs = [ libffi ]; - } - { - name = "fileinfo"; - buildInputs = [ pcre2 ]; - } - { - name = "filter"; - buildInputs = [ pcre2 ]; - } - { - name = "ftp"; - buildInputs = [ openssl ]; - } - { - name = "gd"; - buildInputs = [ - zlib - gd - ]; - configureFlags = [ - "--enable-gd" - "--with-external-gd=${gd.dev}" - "--enable-gd-jis-conv" - ]; - doCheck = false; - } - { - name = "gettext"; - buildInputs = [ gettext ]; - postPhpize = ''substituteInPlace configure --replace-fail 'as_fn_error $? "Cannot locate header file libintl.h" "$LINENO" 5' ':' ''; - configureFlags = [ "--with-gettext=${gettext}" ]; - } - { - name = "gmp"; - buildInputs = [ gmp ]; - configureFlags = [ "--with-gmp=${gmp.dev}" ]; - } - { - name = "iconv"; - buildInputs = [ libiconv ]; - configureFlags = [ "--with-iconv" ]; - # Some other extensions support separate libdirs, but iconv does not. This causes problems with detecting - # Darwin’s libiconv because it has separate outputs. Adding `-liconv` works around the issue. - env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_LDFLAGS = "-liconv"; }; - doCheck = stdenv.hostPlatform.isLinux; - } - { - name = "intl"; - buildInputs = [ icu73 ]; - } - { - name = "ldap"; - buildInputs = [ - openldap - cyrus_sasl - ]; - configureFlags = - [ - "--with-ldap" - "LDAP_DIR=${openldap.dev}" - "LDAP_INCDIR=${openldap.dev}/include" - "LDAP_LIBDIR=${openldap.out}/lib" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--with-ldap-sasl=${cyrus_sasl.dev}" - ]; - doCheck = false; - } - { - name = "mbstring"; - buildInputs = [ - oniguruma - pcre2 - ]; - doCheck = false; - } - { - name = "mysqli"; - internalDeps = [ php.extensions.mysqlnd ]; - configureFlags = [ - "--with-mysqli=mysqlnd" - "--with-mysql-sock=/run/mysqld/mysqld.sock" - ]; - doCheck = false; - } - { - name = "mysqlnd"; - buildInputs = [ - zlib - openssl - ]; - configureFlags = [ "--with-mysqlnd-ssl" ]; - # The configure script doesn't correctly add library link - # flags, so we add them to the variable used by the Makefile - # when linking. - MYSQLND_SHARED_LIBADD = "-lz -lssl -lcrypto"; - # The configure script builds a config.h which is never - # included. Let's include it in the main header file - # included by all .c-files. - patches = [ - (pkgs.writeText "mysqlnd_config.patch" '' - --- a/ext/mysqlnd/mysqlnd.h - +++ b/ext/mysqlnd/mysqlnd.h - @@ -1,3 +1,6 @@ - +#ifdef HAVE_CONFIG_H - +#include "config.h" - +#endif - /* - +----------------------------------------------------------------------+ - | Copyright (c) The PHP Group | - '') - ]; - } - { - name = "opcache"; - buildInputs = - [ pcre2 ] - ++ lib.optional ( - !stdenv.hostPlatform.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind - ) valgrind.dev; - configureFlags = lib.optional php.ztsSupport "--disable-opcache-jit"; - zendExtension = true; - postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' - # Tests are flaky on darwin - rm ext/opcache/tests/blacklist.phpt - rm ext/opcache/tests/bug66338.phpt - rm ext/opcache/tests/bug78106.phpt - rm ext/opcache/tests/issue0115.phpt - rm ext/opcache/tests/issue0149.phpt - rm ext/opcache/tests/revalidate_path_01.phpt - ''; - # Tests launch the builtin webserver. - __darwinAllowLocalNetworking = true; - } - { - name = "openssl"; - buildInputs = [ openssl ]; - configureFlags = [ "--with-openssl" ]; - doCheck = false; - } - # This provides a legacy OpenSSL PHP extension - # For situations where OpenSSL 3 do not support a set of features - # without a specific openssl.cnf file - { - name = "openssl-legacy"; - extName = "openssl"; - buildInputs = [ openssl_1_1 ]; - configureFlags = [ "--with-openssl" ]; - doCheck = false; - } - { name = "pcntl"; } - { - name = "pdo"; - doCheck = false; - } - { - name = "pdo_dblib"; - internalDeps = [ php.extensions.pdo ]; - configureFlags = [ "--with-pdo-dblib=${freetds}" ]; - meta.broken = stdenv.hostPlatform.isDarwin; - doCheck = false; - } - { - name = "pdo_mysql"; - internalDeps = with php.extensions; [ - pdo - mysqlnd - ]; - configureFlags = [ - "--with-pdo-mysql=mysqlnd" - "PHP_MYSQL_SOCK=/run/mysqld/mysqld.sock" - ]; - doCheck = false; - } - { - name = "pdo_odbc"; - internalDeps = [ php.extensions.pdo ]; - buildInputs = [ unixODBC ]; - configureFlags = [ "--with-pdo-odbc=unixODBC,${unixODBC}" ]; - doCheck = false; - } - { - name = "pdo_pgsql"; - internalDeps = [ php.extensions.pdo ]; - configureFlags = [ "--with-pdo-pgsql=${libpq.pg_config}" ]; - doCheck = false; - } - { - name = "pdo_sqlite"; - internalDeps = [ php.extensions.pdo ]; - buildInputs = [ sqlite ]; - configureFlags = [ "--with-pdo-sqlite=${sqlite.dev}" ]; - doCheck = false; - } - { - name = "pgsql"; - buildInputs = [ - pcre2 - ]; - configureFlags = [ "--with-pgsql=${libpq.pg_config}" ]; - doCheck = false; - } - { - name = "posix"; - doCheck = false; - } - { - name = "readline"; - buildInputs = [ - readline - ]; - configureFlags = [ - "--with-readline=${readline.dev}" - ]; - postPatch = '' - # Fix `--with-readline` option not being available. - # `PHP_ALWAYS_SHARED` generated by phpize enables all options - # without the possibility to override them. But when `--with-libedit` - # is enabled, `--with-readline` is not registered. - echo ' - AC_DEFUN([PHP_ALWAYS_SHARED],[ - test "[$]$1" != "no" && ext_shared=yes - ])dnl - ' | cat - ext/readline/config.m4 > ext/readline/config.m4.tmp - mv ext/readline/config.m4{.tmp,} - ''; - doCheck = false; - } - { - name = "session"; - doCheck = false; - } - { name = "shmop"; } - { - name = "simplexml"; - buildInputs = [ - libxml2 - pcre2 - ]; - configureFlags = [ - "--enable-simplexml" - ]; - } - { - name = "snmp"; - buildInputs = [ - net-snmp - openssl - ]; - configureFlags = [ "--with-snmp" ]; - doCheck = false; - } - { - name = "soap"; - buildInputs = [ libxml2 ]; - configureFlags = [ - "--enable-soap" - ]; - # Some tests are causing issues in the Darwin sandbox with issues - # such as - # Unknown: php_network_getaddresses: getaddrinfo for localhost failed: nodename nor servname provided - doCheck = !stdenv.hostPlatform.isDarwin && lib.versionOlder php.version "8.4"; - internalDeps = [ php.extensions.session ]; - } - { - name = "sockets"; - doCheck = false; - } - { - name = "sodium"; - buildInputs = [ libsodium ]; - } - { - name = "sqlite3"; - buildInputs = [ sqlite ]; + extensionData = [ + { name = "bcmath"; } + { + name = "bz2"; + buildInputs = [ bzip2 ]; + configureFlags = [ "--with-bz2=${bzip2.dev}" ]; + } + { name = "calendar"; } + { + name = "ctype"; + postPatch = + lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionAtLeast php.version "8.2") + # Broken test on aarch64-darwin + '' + rm ext/ctype/tests/lc_ctype_inheritance.phpt + ''; + } + { + name = "curl"; + buildInputs = [ curl ]; + configureFlags = [ "--with-curl=${curl.dev}" ]; + doCheck = false; + } + { name = "dba"; } + { + name = "dom"; + buildInputs = [ libxml2 ]; + configureFlags = [ + "--enable-dom" + ]; + } + { + name = "enchant"; + buildInputs = [ enchant2 ]; + configureFlags = [ "--with-enchant" ]; + doCheck = false; + } + { + name = "exif"; + doCheck = false; + } + { + name = "ffi"; + buildInputs = [ libffi ]; + } + { + name = "fileinfo"; + buildInputs = [ pcre2 ]; + } + { + name = "filter"; + buildInputs = [ pcre2 ]; + } + { + name = "ftp"; + buildInputs = [ openssl ]; + } + { + name = "gd"; + buildInputs = [ + zlib + gd + ]; + configureFlags = [ + "--enable-gd" + "--with-external-gd=${gd.dev}" + "--enable-gd-jis-conv" + ]; + doCheck = false; + } + { + name = "gettext"; + buildInputs = [ gettext ]; + postPhpize = ''substituteInPlace configure --replace-fail 'as_fn_error $? "Cannot locate header file libintl.h" "$LINENO" 5' ':' ''; + configureFlags = [ "--with-gettext=${gettext}" ]; + } + { + name = "gmp"; + buildInputs = [ gmp ]; + configureFlags = [ "--with-gmp=${gmp.dev}" ]; + } + { + name = "iconv"; + buildInputs = [ libiconv ]; + configureFlags = [ "--with-iconv" ]; + # Some other extensions support separate libdirs, but iconv does not. This causes problems with detecting + # Darwin’s libiconv because it has separate outputs. Adding `-liconv` works around the issue. + env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_LDFLAGS = "-liconv"; }; + doCheck = stdenv.hostPlatform.isLinux; + } + { + name = "intl"; + buildInputs = [ icu73 ]; + } + { + name = "ldap"; + buildInputs = [ + openldap + cyrus_sasl + ]; + configureFlags = [ + "--with-ldap" + "LDAP_DIR=${openldap.dev}" + "LDAP_INCDIR=${openldap.dev}/include" + "LDAP_LIBDIR=${openldap.out}/lib" + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + "--with-ldap-sasl=${cyrus_sasl.dev}" + ]; + doCheck = false; + } + { + name = "mbstring"; + buildInputs = [ + oniguruma + pcre2 + ]; + doCheck = false; + } + { + name = "mysqli"; + internalDeps = [ php.extensions.mysqlnd ]; + configureFlags = [ + "--with-mysqli=mysqlnd" + "--with-mysql-sock=/run/mysqld/mysqld.sock" + ]; + doCheck = false; + } + { + name = "mysqlnd"; + buildInputs = [ + zlib + openssl + ]; + configureFlags = [ "--with-mysqlnd-ssl" ]; + # The configure script doesn't correctly add library link + # flags, so we add them to the variable used by the Makefile + # when linking. + MYSQLND_SHARED_LIBADD = "-lz -lssl -lcrypto"; + # The configure script builds a config.h which is never + # included. Let's include it in the main header file + # included by all .c-files. + patches = [ + (pkgs.writeText "mysqlnd_config.patch" '' + --- a/ext/mysqlnd/mysqlnd.h + +++ b/ext/mysqlnd/mysqlnd.h + @@ -1,3 +1,6 @@ + +#ifdef HAVE_CONFIG_H + +#include "config.h" + +#endif + /* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + '') + ]; + } + { + name = "opcache"; + buildInputs = [ + pcre2 + ] + ++ lib.optional ( + !stdenv.hostPlatform.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind + ) valgrind.dev; + configureFlags = lib.optional php.ztsSupport "--disable-opcache-jit"; + zendExtension = true; + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' + # Tests are flaky on darwin + rm ext/opcache/tests/blacklist.phpt + rm ext/opcache/tests/bug66338.phpt + rm ext/opcache/tests/bug78106.phpt + rm ext/opcache/tests/issue0115.phpt + rm ext/opcache/tests/issue0149.phpt + rm ext/opcache/tests/revalidate_path_01.phpt + ''; + # Tests launch the builtin webserver. + __darwinAllowLocalNetworking = true; + } + { + name = "openssl"; + buildInputs = [ openssl ]; + configureFlags = [ "--with-openssl" ]; + doCheck = false; + } + # This provides a legacy OpenSSL PHP extension + # For situations where OpenSSL 3 do not support a set of features + # without a specific openssl.cnf file + { + name = "openssl-legacy"; + extName = "openssl"; + buildInputs = [ openssl_1_1 ]; + configureFlags = [ "--with-openssl" ]; + doCheck = false; + } + { name = "pcntl"; } + { + name = "pdo"; + doCheck = false; + } + { + name = "pdo_dblib"; + internalDeps = [ php.extensions.pdo ]; + configureFlags = [ "--with-pdo-dblib=${freetds}" ]; + meta.broken = stdenv.hostPlatform.isDarwin; + doCheck = false; + } + { + name = "pdo_mysql"; + internalDeps = with php.extensions; [ + pdo + mysqlnd + ]; + configureFlags = [ + "--with-pdo-mysql=mysqlnd" + "PHP_MYSQL_SOCK=/run/mysqld/mysqld.sock" + ]; + doCheck = false; + } + { + name = "pdo_odbc"; + internalDeps = [ php.extensions.pdo ]; + buildInputs = [ unixODBC ]; + configureFlags = [ "--with-pdo-odbc=unixODBC,${unixODBC}" ]; + doCheck = false; + } + { + name = "pdo_pgsql"; + internalDeps = [ php.extensions.pdo ]; + configureFlags = [ "--with-pdo-pgsql=${libpq.pg_config}" ]; + doCheck = false; + } + { + name = "pdo_sqlite"; + internalDeps = [ php.extensions.pdo ]; + buildInputs = [ sqlite ]; + configureFlags = [ "--with-pdo-sqlite=${sqlite.dev}" ]; + doCheck = false; + } + { + name = "pgsql"; + buildInputs = [ + pcre2 + ]; + configureFlags = [ "--with-pgsql=${libpq.pg_config}" ]; + doCheck = false; + } + { + name = "posix"; + doCheck = false; + } + { + name = "readline"; + buildInputs = [ + readline + ]; + configureFlags = [ + "--with-readline=${readline.dev}" + ]; + postPatch = '' + # Fix `--with-readline` option not being available. + # `PHP_ALWAYS_SHARED` generated by phpize enables all options + # without the possibility to override them. But when `--with-libedit` + # is enabled, `--with-readline` is not registered. + echo ' + AC_DEFUN([PHP_ALWAYS_SHARED],[ + test "[$]$1" != "no" && ext_shared=yes + ])dnl + ' | cat - ext/readline/config.m4 > ext/readline/config.m4.tmp + mv ext/readline/config.m4{.tmp,} + ''; + doCheck = false; + } + { + name = "session"; + doCheck = false; + } + { name = "shmop"; } + { + name = "simplexml"; + buildInputs = [ + libxml2 + pcre2 + ]; + configureFlags = [ + "--enable-simplexml" + ]; + } + { + name = "snmp"; + buildInputs = [ + net-snmp + openssl + ]; + configureFlags = [ "--with-snmp" ]; + doCheck = false; + } + { + name = "soap"; + buildInputs = [ libxml2 ]; + configureFlags = [ + "--enable-soap" + ]; + # Some tests are causing issues in the Darwin sandbox with issues + # such as + # Unknown: php_network_getaddresses: getaddrinfo for localhost failed: nodename nor servname provided + doCheck = !stdenv.hostPlatform.isDarwin && lib.versionOlder php.version "8.4"; + internalDeps = [ php.extensions.session ]; + } + { + name = "sockets"; + doCheck = false; + } + { + name = "sodium"; + buildInputs = [ libsodium ]; + } + { + name = "sqlite3"; + buildInputs = [ sqlite ]; - # The `sqlite3_bind_bug68849.phpt` test is currently broken for i686 Linux systems since sqlite 3.43, cf.: - # - https://github.com/php/php-src/issues/12076 - # - https://www.sqlite.org/forum/forumpost/abbb95376ec6cd5f - patches = lib.optionals (stdenv.hostPlatform.isi686 && stdenv.hostPlatform.isLinux) [ - ../development/interpreters/php/skip-sqlite3_bind_bug68849.phpt.patch - ]; - } - { name = "sysvmsg"; } - { name = "sysvsem"; } - { name = "sysvshm"; } - { - name = "tidy"; - configureFlags = [ "--with-tidy=${html-tidy}" ]; - doCheck = false; - } - { - name = "tokenizer"; - patches = [ ../development/interpreters/php/fix-tokenizer-php81.patch ]; - } - { - name = "xml"; - buildInputs = [ libxml2 ]; - configureFlags = [ - "--enable-xml" - ]; - doCheck = false; - } - { - name = "xmlreader"; - buildInputs = [ libxml2 ]; - internalDeps = [ php.extensions.dom ]; - env.NIX_CFLAGS_COMPILE = toString [ - "-I../.." - "-DHAVE_DOM" - ]; - doCheck = false; - configureFlags = [ - "--enable-xmlreader" - ]; - } - { - name = "xmlwriter"; - buildInputs = [ libxml2 ]; - configureFlags = [ - "--enable-xmlwriter" - ]; - } - { - name = "xsl"; - buildInputs = [ - libxslt - libxml2 - ]; - internalDeps = [ php.extensions.dom ]; - doCheck = false; - env.NIX_CFLAGS_COMPILE = toString [ - "-I../.." - "-DHAVE_DOM" - ]; - configureFlags = [ "--with-xsl=${libxslt.dev}" ]; - } - { - name = "zend_test"; - internalDeps = [ php.extensions.dom ]; - env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; - } - { - name = "zip"; - buildInputs = [ - libzip - pcre2 - ]; - configureFlags = [ - "--with-zip" - ]; - doCheck = false; - } - { - name = "zlib"; - buildInputs = [ zlib ]; - configureFlags = [ - "--with-zlib" - ]; - } - ] - ++ lib.optionals (lib.versionOlder php.version "8.3") [ - # Using version from PECL on new PHP versions. - { - name = "imap"; - buildInputs = [ - uwimap - openssl - pam - pcre2 - libkrb5 - ]; - configureFlags = [ - "--with-imap=${uwimap}" - "--with-imap-ssl" - "--with-kerberos" - ]; - } - ]; + # The `sqlite3_bind_bug68849.phpt` test is currently broken for i686 Linux systems since sqlite 3.43, cf.: + # - https://github.com/php/php-src/issues/12076 + # - https://www.sqlite.org/forum/forumpost/abbb95376ec6cd5f + patches = lib.optionals (stdenv.hostPlatform.isi686 && stdenv.hostPlatform.isLinux) [ + ../development/interpreters/php/skip-sqlite3_bind_bug68849.phpt.patch + ]; + } + { name = "sysvmsg"; } + { name = "sysvsem"; } + { name = "sysvshm"; } + { + name = "tidy"; + configureFlags = [ "--with-tidy=${html-tidy}" ]; + doCheck = false; + } + { + name = "tokenizer"; + patches = [ ../development/interpreters/php/fix-tokenizer-php81.patch ]; + } + { + name = "xml"; + buildInputs = [ libxml2 ]; + configureFlags = [ + "--enable-xml" + ]; + doCheck = false; + } + { + name = "xmlreader"; + buildInputs = [ libxml2 ]; + internalDeps = [ php.extensions.dom ]; + env.NIX_CFLAGS_COMPILE = toString [ + "-I../.." + "-DHAVE_DOM" + ]; + doCheck = false; + configureFlags = [ + "--enable-xmlreader" + ]; + } + { + name = "xmlwriter"; + buildInputs = [ libxml2 ]; + configureFlags = [ + "--enable-xmlwriter" + ]; + } + { + name = "xsl"; + buildInputs = [ + libxslt + libxml2 + ]; + internalDeps = [ php.extensions.dom ]; + doCheck = false; + env.NIX_CFLAGS_COMPILE = toString [ + "-I../.." + "-DHAVE_DOM" + ]; + configureFlags = [ "--with-xsl=${libxslt.dev}" ]; + } + { + name = "zend_test"; + internalDeps = [ php.extensions.dom ]; + env.NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2"; + } + { + name = "zip"; + buildInputs = [ + libzip + pcre2 + ]; + configureFlags = [ + "--with-zip" + ]; + doCheck = false; + } + { + name = "zlib"; + buildInputs = [ zlib ]; + configureFlags = [ + "--with-zlib" + ]; + } + ] + ++ lib.optionals (lib.versionOlder php.version "8.3") [ + # Using version from PECL on new PHP versions. + { + name = "imap"; + buildInputs = [ + uwimap + openssl + pam + pcre2 + libkrb5 + ]; + configureFlags = [ + "--with-imap=${uwimap}" + "--with-imap-ssl" + "--with-kerberos" + ]; + } + ]; # Convert the list of attrs: # [ { name = ; ... } ... ] diff --git a/pkgs/top-level/release-alternatives.nix b/pkgs/top-level/release-alternatives.nix index 8d48ee27ce0f..d988265f7735 100644 --- a/pkgs/top-level/release-alternatives.nix +++ b/pkgs/top-level/release-alternatives.nix @@ -89,7 +89,8 @@ let "haskellPackages" "bindings-levmar" ] - ] ++ lib.optionals allowUnfree [ "magma" ]; + ] + ++ lib.optionals allowUnfree [ "magma" ]; blas64Users = [ "rspamd" "sundials" @@ -115,7 +116,8 @@ let "haskellPackages" "bindings-levmar" ] - ] ++ lib.optionals allowUnfree [ "magma" ]; + ] + ++ lib.optionals allowUnfree [ "magma" ]; blasProviders = system: [ diff --git a/pkgs/top-level/release-attrpaths-superset.nix b/pkgs/top-level/release-attrpaths-superset.nix index e339d15e1554..6802da8b3711 100644 --- a/pkgs/top-level/release-attrpaths-superset.nix +++ b/pkgs/top-level/release-attrpaths-superset.nix @@ -130,7 +130,8 @@ let "pkgsMusl" "stdenv" ] - ] ++ justAttrNames [ ] releaseOutpaths; + ] + ++ justAttrNames [ ] releaseOutpaths; names = map (path: (lib.concatStringsSep "." path)) paths; diff --git a/pkgs/top-level/release-python.nix b/pkgs/top-level/release-python.nix index 463086049e7d..18774202503f 100644 --- a/pkgs/top-level/release-python.nix +++ b/pkgs/top-level/release-python.nix @@ -68,6 +68,7 @@ let ]; }; - } // (mapTestOn (packagePython pkgs)); + } + // (mapTestOn (packagePython pkgs)); in jobs diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix index 50a0b587f346..700815d5034f 100644 --- a/pkgs/top-level/release.nix +++ b/pkgs/top-level/release.nix @@ -134,99 +134,98 @@ let pkgs.releaseTools.aggregate { name = "nixpkgs-darwin-${jobs.tarball.version}"; meta.description = "Release-critical builds for the Nixpkgs darwin channel"; - constituents = - [ - jobs.tarball - jobs.release-checks - ] - ++ optionals supportDarwin.x86_64 [ - jobs.cabal2nix.x86_64-darwin - jobs.ghc.x86_64-darwin - jobs.git.x86_64-darwin - jobs.go.x86_64-darwin - jobs.mariadb.x86_64-darwin - jobs.nix.x86_64-darwin - jobs.nixpkgs-review.x86_64-darwin - jobs.nix-info.x86_64-darwin - jobs.nix-info-tested.x86_64-darwin - jobs.openssh.x86_64-darwin - jobs.openssl.x86_64-darwin - jobs.pandoc.x86_64-darwin - jobs.postgresql.x86_64-darwin - jobs.python3.x86_64-darwin - jobs.ruby.x86_64-darwin - jobs.rustc.x86_64-darwin - # blocking ofBorg CI 2020-02-28 - # jobs.stack.x86_64-darwin - jobs.stdenv.x86_64-darwin - jobs.vim.x86_64-darwin - jobs.cachix.x86_64-darwin - jobs.darwin.linux-builder.x86_64-darwin + constituents = [ + jobs.tarball + jobs.release-checks + ] + ++ optionals supportDarwin.x86_64 [ + jobs.cabal2nix.x86_64-darwin + jobs.ghc.x86_64-darwin + jobs.git.x86_64-darwin + jobs.go.x86_64-darwin + jobs.mariadb.x86_64-darwin + jobs.nix.x86_64-darwin + jobs.nixpkgs-review.x86_64-darwin + jobs.nix-info.x86_64-darwin + jobs.nix-info-tested.x86_64-darwin + jobs.openssh.x86_64-darwin + jobs.openssl.x86_64-darwin + jobs.pandoc.x86_64-darwin + jobs.postgresql.x86_64-darwin + jobs.python3.x86_64-darwin + jobs.ruby.x86_64-darwin + jobs.rustc.x86_64-darwin + # blocking ofBorg CI 2020-02-28 + # jobs.stack.x86_64-darwin + jobs.stdenv.x86_64-darwin + jobs.vim.x86_64-darwin + jobs.cachix.x86_64-darwin + jobs.darwin.linux-builder.x86_64-darwin - # UI apps - # jobs.firefox-unwrapped.x86_64-darwin - jobs.qt5.qtmultimedia.x86_64-darwin - jobs.inkscape.x86_64-darwin - jobs.gimp.x86_64-darwin - jobs.emacs.x86_64-darwin - jobs.wireshark.x86_64-darwin - jobs.transmission_3-gtk.x86_64-darwin - jobs.transmission_4-gtk.x86_64-darwin + # UI apps + # jobs.firefox-unwrapped.x86_64-darwin + jobs.qt5.qtmultimedia.x86_64-darwin + jobs.inkscape.x86_64-darwin + jobs.gimp.x86_64-darwin + jobs.emacs.x86_64-darwin + jobs.wireshark.x86_64-darwin + jobs.transmission_3-gtk.x86_64-darwin + jobs.transmission_4-gtk.x86_64-darwin - # Tests - /* - jobs.tests.cc-wrapper.default.x86_64-darwin - jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin - jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin - jobs.tests.stdenv-inputs.x86_64-darwin - jobs.tests.macOSSierraShared.x86_64-darwin - jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin - */ - ] - ++ optionals supportDarwin.aarch64 [ - jobs.cabal2nix.aarch64-darwin - jobs.ghc.aarch64-darwin - jobs.git.aarch64-darwin - jobs.go.aarch64-darwin - jobs.mariadb.aarch64-darwin - jobs.nix.aarch64-darwin - jobs.nixpkgs-review.aarch64-darwin - jobs.nix-info.aarch64-darwin - jobs.nix-info-tested.aarch64-darwin - jobs.openssh.aarch64-darwin - jobs.openssl.aarch64-darwin - jobs.pandoc.aarch64-darwin - jobs.postgresql.aarch64-darwin - jobs.python3.aarch64-darwin - jobs.ruby.aarch64-darwin - jobs.rustc.aarch64-darwin - # blocking ofBorg CI 2020-02-28 - # jobs.stack.aarch64-darwin - jobs.stdenv.aarch64-darwin - jobs.vim.aarch64-darwin - jobs.cachix.aarch64-darwin - jobs.darwin.linux-builder.aarch64-darwin + # Tests + /* + jobs.tests.cc-wrapper.default.x86_64-darwin + jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin + jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin + jobs.tests.stdenv-inputs.x86_64-darwin + jobs.tests.macOSSierraShared.x86_64-darwin + jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin + */ + ] + ++ optionals supportDarwin.aarch64 [ + jobs.cabal2nix.aarch64-darwin + jobs.ghc.aarch64-darwin + jobs.git.aarch64-darwin + jobs.go.aarch64-darwin + jobs.mariadb.aarch64-darwin + jobs.nix.aarch64-darwin + jobs.nixpkgs-review.aarch64-darwin + jobs.nix-info.aarch64-darwin + jobs.nix-info-tested.aarch64-darwin + jobs.openssh.aarch64-darwin + jobs.openssl.aarch64-darwin + jobs.pandoc.aarch64-darwin + jobs.postgresql.aarch64-darwin + jobs.python3.aarch64-darwin + jobs.ruby.aarch64-darwin + jobs.rustc.aarch64-darwin + # blocking ofBorg CI 2020-02-28 + # jobs.stack.aarch64-darwin + jobs.stdenv.aarch64-darwin + jobs.vim.aarch64-darwin + jobs.cachix.aarch64-darwin + jobs.darwin.linux-builder.aarch64-darwin - # UI apps - # jobs.firefox-unwrapped.aarch64-darwin - jobs.qt5.qtmultimedia.aarch64-darwin - jobs.inkscape.aarch64-darwin - jobs.gimp.aarch64-darwin - jobs.emacs.aarch64-darwin - jobs.wireshark.aarch64-darwin - jobs.transmission_3-gtk.aarch64-darwin - jobs.transmission_4-gtk.aarch64-darwin + # UI apps + # jobs.firefox-unwrapped.aarch64-darwin + jobs.qt5.qtmultimedia.aarch64-darwin + jobs.inkscape.aarch64-darwin + jobs.gimp.aarch64-darwin + jobs.emacs.aarch64-darwin + jobs.wireshark.aarch64-darwin + jobs.transmission_3-gtk.aarch64-darwin + jobs.transmission_4-gtk.aarch64-darwin - # Tests - /* - jobs.tests.cc-wrapper.default.aarch64-darwin - jobs.tests.cc-wrapper.llvmPackages.clang.aarch64-darwin - jobs.tests.cc-wrapper.llvmPackages.libcxx.aarch64-darwin - jobs.tests.stdenv-inputs.aarch64-darwin - jobs.tests.macOSSierraShared.aarch64-darwin - jobs.tests.stdenv.hooks.patch-shebangs.aarch64-darwin - */ - ]; + # Tests + /* + jobs.tests.cc-wrapper.default.aarch64-darwin + jobs.tests.cc-wrapper.llvmPackages.clang.aarch64-darwin + jobs.tests.cc-wrapper.llvmPackages.libcxx.aarch64-darwin + jobs.tests.stdenv-inputs.aarch64-darwin + jobs.tests.macOSSierraShared.aarch64-darwin + jobs.tests.stdenv.hooks.patch-shebangs.aarch64-darwin + */ + ]; } else null; @@ -234,92 +233,91 @@ let unstable = pkgs.releaseTools.aggregate { name = "nixpkgs-${jobs.tarball.version}"; meta.description = "Release-critical builds for the Nixpkgs unstable channel"; - constituents = - [ - jobs.tarball - jobs.release-checks - jobs.metrics - jobs.manual - jobs.lib-tests - jobs.pkgs-lib-tests - jobs.stdenv.x86_64-linux - jobs.cargo.x86_64-linux - jobs.go.x86_64-linux - jobs.linux.x86_64-linux - jobs.nix.x86_64-linux - jobs.pandoc.x86_64-linux - jobs.python3.x86_64-linux - # Needed by contributors to test PRs (by inclusion of the PR template) - jobs.nixpkgs-review.x86_64-linux - # Needed for support - jobs.nix-info.x86_64-linux - jobs.nix-info-tested.x86_64-linux - # Ensure that X11/GTK are in order. - jobs.firefox-unwrapped.x86_64-linux - jobs.cachix.x86_64-linux - jobs.devenv.x86_64-linux + constituents = [ + jobs.tarball + jobs.release-checks + jobs.metrics + jobs.manual + jobs.lib-tests + jobs.pkgs-lib-tests + jobs.stdenv.x86_64-linux + jobs.cargo.x86_64-linux + jobs.go.x86_64-linux + jobs.linux.x86_64-linux + jobs.nix.x86_64-linux + jobs.pandoc.x86_64-linux + jobs.python3.x86_64-linux + # Needed by contributors to test PRs (by inclusion of the PR template) + jobs.nixpkgs-review.x86_64-linux + # Needed for support + jobs.nix-info.x86_64-linux + jobs.nix-info-tested.x86_64-linux + # Ensure that X11/GTK are in order. + jobs.firefox-unwrapped.x86_64-linux + jobs.cachix.x86_64-linux + jobs.devenv.x86_64-linux - /* - TODO: re-add tests; context: https://github.com/NixOS/nixpkgs/commit/36587a587ab191eddd868179d63c82cdd5dee21b + /* + TODO: re-add tests; context: https://github.com/NixOS/nixpkgs/commit/36587a587ab191eddd868179d63c82cdd5dee21b - jobs.tests.cc-wrapper.default.x86_64-linux + jobs.tests.cc-wrapper.default.x86_64-linux - # broken see issue #40038 + # broken see issue #40038 - jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-linux - jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-linux - jobs.tests.cc-multilib-gcc.x86_64-linux - jobs.tests.cc-multilib-clang.x86_64-linux - jobs.tests.stdenv-inputs.x86_64-linux - jobs.tests.stdenv.hooks.patch-shebangs.x86_64-linux - */ - ] - ++ collect isDerivation jobs.stdenvBootstrapTools - ++ optionals supportDarwin.x86_64 [ - jobs.stdenv.x86_64-darwin - jobs.cargo.x86_64-darwin - jobs.cachix.x86_64-darwin - jobs.devenv.x86_64-darwin - jobs.go.x86_64-darwin - jobs.python3.x86_64-darwin - jobs.nixpkgs-review.x86_64-darwin - jobs.nix.x86_64-darwin - jobs.nix-info.x86_64-darwin - jobs.nix-info-tested.x86_64-darwin - jobs.git.x86_64-darwin - jobs.mariadb.x86_64-darwin - jobs.vim.x86_64-darwin - jobs.inkscape.x86_64-darwin - jobs.qt5.qtmultimedia.x86_64-darwin - jobs.darwin.linux-builder.x86_64-darwin - /* - jobs.tests.cc-wrapper.default.x86_64-darwin - jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin - jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin - jobs.tests.stdenv-inputs.x86_64-darwin - jobs.tests.macOSSierraShared.x86_64-darwin - jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin - */ - ] - ++ optionals supportDarwin.aarch64 [ - jobs.stdenv.aarch64-darwin - jobs.cargo.aarch64-darwin - jobs.cachix.aarch64-darwin - jobs.devenv.aarch64-darwin - jobs.go.aarch64-darwin - jobs.python3.aarch64-darwin - jobs.nixpkgs-review.aarch64-darwin - jobs.nix.aarch64-darwin - jobs.nix-info.aarch64-darwin - jobs.nix-info-tested.aarch64-darwin - jobs.git.aarch64-darwin - jobs.mariadb.aarch64-darwin - jobs.vim.aarch64-darwin - jobs.inkscape.aarch64-darwin - jobs.qt5.qtmultimedia.aarch64-darwin - jobs.darwin.linux-builder.aarch64-darwin - # consider adding tests, as suggested above for x86_64-darwin - ]; + jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-linux + jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-linux + jobs.tests.cc-multilib-gcc.x86_64-linux + jobs.tests.cc-multilib-clang.x86_64-linux + jobs.tests.stdenv-inputs.x86_64-linux + jobs.tests.stdenv.hooks.patch-shebangs.x86_64-linux + */ + ] + ++ collect isDerivation jobs.stdenvBootstrapTools + ++ optionals supportDarwin.x86_64 [ + jobs.stdenv.x86_64-darwin + jobs.cargo.x86_64-darwin + jobs.cachix.x86_64-darwin + jobs.devenv.x86_64-darwin + jobs.go.x86_64-darwin + jobs.python3.x86_64-darwin + jobs.nixpkgs-review.x86_64-darwin + jobs.nix.x86_64-darwin + jobs.nix-info.x86_64-darwin + jobs.nix-info-tested.x86_64-darwin + jobs.git.x86_64-darwin + jobs.mariadb.x86_64-darwin + jobs.vim.x86_64-darwin + jobs.inkscape.x86_64-darwin + jobs.qt5.qtmultimedia.x86_64-darwin + jobs.darwin.linux-builder.x86_64-darwin + /* + jobs.tests.cc-wrapper.default.x86_64-darwin + jobs.tests.cc-wrapper.llvmPackages.clang.x86_64-darwin + jobs.tests.cc-wrapper.llvmPackages.libcxx.x86_64-darwin + jobs.tests.stdenv-inputs.x86_64-darwin + jobs.tests.macOSSierraShared.x86_64-darwin + jobs.tests.stdenv.hooks.patch-shebangs.x86_64-darwin + */ + ] + ++ optionals supportDarwin.aarch64 [ + jobs.stdenv.aarch64-darwin + jobs.cargo.aarch64-darwin + jobs.cachix.aarch64-darwin + jobs.devenv.aarch64-darwin + jobs.go.aarch64-darwin + jobs.python3.aarch64-darwin + jobs.nixpkgs-review.aarch64-darwin + jobs.nix.aarch64-darwin + jobs.nix-info.aarch64-darwin + jobs.nix-info-tested.aarch64-darwin + jobs.git.aarch64-darwin + jobs.mariadb.aarch64-darwin + jobs.vim.aarch64-darwin + jobs.inkscape.aarch64-darwin + jobs.qt5.qtmultimedia.aarch64-darwin + jobs.darwin.linux-builder.aarch64-darwin + # consider adding tests, as suggested above for x86_64-darwin + ]; }; stdenvBootstrapTools = genAttrs bootstrapConfigs ( diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 0b94502a96c9..e921f7decf1a 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -266,7 +266,8 @@ let }; } ) - ] ++ overlays; + ] + ++ overlays; ${if stdenv.hostPlatform == stdenv.buildPlatform then "localSystem" else "crossSystem"} = { config = lib.systems.parse.tripleFromSystem ( stdenv.hostPlatform.parsed @@ -287,7 +288,8 @@ let (self': super': { pkgsx86_64Darwin = super'; }) - ] ++ overlays; + ] + ++ overlays; localSystem = { config = lib.systems.parse.tripleFromSystem ( stdenv.hostPlatform.parsed @@ -334,7 +336,8 @@ let (self': super': { pkgsStatic = super'; }) - ] ++ overlays; + ] + ++ overlays; crossSystem = { isStatic = true; config = lib.systems.parse.tripleFromSystem ( diff --git a/pkgs/top-level/unixtools.nix b/pkgs/top-level/unixtools.nix index f4f8e6e3df62..21c2ede1794e 100644 --- a/pkgs/top-level/unixtools.nix +++ b/pkgs/top-level/unixtools.nix @@ -42,13 +42,12 @@ let priority = 10; platforms = platforms.${stdenv.hostPlatform.parsed.kernel.name} or platforms.all; }; - passthru = - { - inherit provider; - } - // lib.optionalAttrs (builtins.hasAttr "binlore" providers) { - binlore.out = (binlore.synthesize (getBin bins.${cmd}) providers.binlore); - }; + passthru = { + inherit provider; + } + // lib.optionalAttrs (builtins.hasAttr "binlore" providers) { + binlore.out = (binlore.synthesize (getBin bins.${cmd}) providers.binlore); + }; preferLocalBuild = true; } '' diff --git a/pkgs/top-level/variants.nix b/pkgs/top-level/variants.nix index 3d6b4bd44e99..bb4b877cb6e8 100644 --- a/pkgs/top-level/variants.nix +++ b/pkgs/top-level/variants.nix @@ -28,7 +28,8 @@ self: super: { (self': super': { pkgsLLVM = super'; }) - ] ++ overlays; + ] + ++ overlays; # Bootstrap a cross stdenv using the LLVM toolchain. # This is currently not possible when compiling natively, # so we don't need to check hostPlatform != buildPlatform. @@ -43,7 +44,8 @@ self: super: { (self': super': { pkgsArocc = super'; }) - ] ++ overlays; + ] + ++ overlays; # Bootstrap a cross stdenv using the Aro C compiler. # This is currently not possible when compiling natively, # so we don't need to check hostPlatform != buildPlatform. @@ -58,7 +60,8 @@ self: super: { (self': super': { pkgsZig = super'; }) - ] ++ overlays; + ] + ++ overlays; # Bootstrap a cross stdenv using the Zig toolchain. # This is currently not possible when compiling natively, # so we don't need to check hostPlatform != buildPlatform. @@ -78,7 +81,8 @@ self: super: { (self': super': { pkgsMusl = super'; }) - ] ++ overlays; + ] + ++ overlays; ${if stdenv.hostPlatform == stdenv.buildPlatform then "localSystem" else "crossSystem"} = { config = lib.systems.parse.tripleFromSystem (makeMuslParsedPlatform stdenv.hostPlatform.parsed); }; @@ -152,6 +156,7 @@ self: super: { pcre-cpp = super'.pcre-cpp.override { enableJit = false; }; } ) - ] ++ overlays; + ] + ++ overlays; }; }